@@ -19,17 +19,21 @@ import {
1919 AlertIcon ,
2020 AlertText ,
2121 InfoIcon ,
22- CheckCircleIcon ,
23- CloseCircleIcon ,
24- BellIcon ,
25- AlertCircleIcon ,
22+ CloseIcon ,
23+ RepeatIcon ,
2624 Icon ,
2725 VStack ,
28- Center ,
2926 HStack ,
27+ Text ,
28+ Heading ,
29+ Button ,
30+ ButtonText ,
31+ Input ,
32+ InputField ,
33+ InputSlot ,
34+ InputIcon
3035} from ' ../../core-components/nativewind' ;
31-
32-
36+ import { Bomb , EyeIcon , EyeOffIcon } from " lucide-react-native" ;
3337import { transformedCode } from ' ../../utils' ;
3438import {
3539 AppProvider ,
@@ -51,10 +55,10 @@ This is an illustration of **Alert** component.
5155 showArgsController = { true }
5256 metaData = { {
5357 code: `
54- <Alert className="mx-2.5" {...props}>
55- <AlertIcon as={InfoIcon} className="mr-3" />
58+ <Alert {...props}>
59+ <AlertIcon as={InfoIcon} />
5660 <AlertText>
57- We have updated our terms of service. Please review and accept to continue using our service.
61+ Description of alert!
5862 </AlertText>
5963 </Alert>
6064 ` ,
@@ -76,7 +80,7 @@ This is an illustration of **Alert** component.
7680 },
7781 variant: {
7882 control: ' select' ,
79- options: [' accent ' , ' solid' , ' outline' ],
83+ options: [' solid' , ' outline' ],
8084 default: ' solid' ,
8185 },
8286 },
@@ -210,7 +214,7 @@ Alert component is created using View component from react-native. It extends al
210214 </Table.TText >
211215 </Table.TD >
212216 <Table.TD >
213- <Table.TText >solid | outline | accent </Table.TText >
217+ <Table.TText >solid | outline</Table.TText >
214218 </Table.TD >
215219 <Table.TD >
216220 <Table.TText >solid</Table.TText >
@@ -225,42 +229,218 @@ Alert component is created using View component from react-native. It extends al
225229
226230The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.
227231
228- #### Alert with Heading
229-
230- An example of an alert component with a heading, which further contains another alert component for displaying supplementary information.
232+ #### Alert with CTA
231233
232234<Wrapper >
233235 <CodePreview
234236 showComponentRenderer = { true }
235237 showArgsController = { false }
238+ _rendererWrapper = { {
239+ alignItems: ' stretch' ,
240+ padding: 20
241+ }}
236242 metaData = { {
237243 code: `
238- <Alert action='success'>
239- <AlertIcon as={CheckCircleIcon} size="xl" className='mr-3' />
240- <VStack space='xs'>
241- <AlertText className='font-bold' >
242- Congratulations!
243- </AlertText >
244- <AlertText >
245- Thank you for your submission. You will receive a confirmation email shortly.
244+ <Alert
245+ action="success"
246+ className="gap-4 max-w-[585px] w-full self-center items-start min-[400px]:items-center"
247+ >
248+ <VStack className="gap-4 min-[400px]:flex-row justify-between flex-1 min-[400px]:items-center">
249+ <AlertText className="font-semibold text-typography-900" size="sm">
250+ Verify your phone number to create an API key
246251 </AlertText>
252+ <Button size="sm">
253+ <ButtonText>Start verification</ButtonText>
254+ </Button>
247255 </VStack>
256+ <Icon as={CloseIcon} />
248257 </Alert>
249258 ` ,
250259 transformCode : (code ) => {
251260 return transformedCode (code );
252261 },
253262 scope: {
254263 Alert ,
255- AlertIcon ,
256264 AlertText ,
257265 Wrapper ,
258- CheckCircleIcon ,
259266 VStack ,
260267 Icon ,
268+ CloseIcon ,
269+ Button ,
270+ ButtonText
271+ },
272+ argsType: {},
273+ }}
274+ />
275+ </Wrapper >
276+
277+ #### Alert on cloud sync
278+
279+ <Wrapper >
280+ <CodePreview
281+ _rendererWrapper = { {
282+ alignItems: ' stretch' ,
283+ padding: 20
284+ }}
285+ showComponentRenderer = { true }
286+ showArgsController = { false }
287+ metaData = { {
288+ code: `
289+ <Alert
290+ action="warning"
291+ className="gap-4 max-w-[516px] w-full flex-row flex py-4 items-start self-center"
292+ >
293+ <AlertIcon as={RepeatIcon} />
294+ <HStack className="justify-between flex-1 items-center gap-1 sm:gap-8">
295+ <VStack className="flex-1">
296+ <Text className="font-semibold text-typography-900">
297+ Sync is disabled
298+ </Text>
299+ <AlertText className="text-typography-900" size="sm">
300+ Enable cloud sync to help safeguard your data
301+ </AlertText>
302+ </VStack>
303+ <Button size="xs">
304+ <ButtonText>Turn on</ButtonText>
305+ </Button>
306+ </HStack>
307+ </Alert>
308+ ` ,
309+ transformCode : (code ) => {
310+ return transformedCode (code );
311+ },
312+ scope: {
313+ Alert ,
314+ AlertIcon ,
315+ AlertText ,
316+ Wrapper ,
317+ HStack ,
318+ VStack ,
319+ RepeatIcon ,
320+ Button ,
321+ ButtonText ,
322+ Text
323+ },
324+ argsType: {},
325+ }}
326+ />
327+ </Wrapper >
328+
329+ #### Warning alert
330+
331+ <Wrapper >
332+ <CodePreview
333+ _rendererWrapper = { {
334+ padding: 20
335+ }}
336+ showComponentRenderer = { true }
337+ showArgsController = { false }
338+ metaData = { {
339+ code: `
340+ <Alert action="error" className="gap-3 items-start">
341+ {/* Bomb is imported from 'lucide-react-native' */}
342+ <AlertIcon as={Bomb} size="lg" />
343+ <AlertText className="text-typography-900" size="sm">
344+ <Text className="mr-2 font-semibold text-typography-900">
345+ Heads up:
346+ </Text>
347+ Once done, this action cannot be undone
348+ </AlertText>
349+ </Alert>
350+ ` ,
351+ transformCode : (code ) => {
352+ return transformedCode (code );
353+ },
354+ scope: {
355+ Alert ,
356+ AlertIcon ,
357+ AlertText ,
358+ Wrapper ,
359+ Text ,
360+ Bomb
261361 },
262362 argsType: {},
263363 }}
264- />
364+ />
365+ </Wrapper >
265366
367+ #### Alert on confirm password modal
368+
369+ <Wrapper >
370+ <CodePreview
371+ _rendererWrapper = { {
372+ padding: 20
373+ }}
374+ showComponentRenderer = { true }
375+ showArgsController = { false }
376+ metaData = { {
377+ code: `
378+ function Example() {
379+ const [showPassword, setShowPassword] = React.useState(false);
380+ const handleState = () => {
381+ setShowPassword((showState) => {
382+ return !showState;
383+ });
384+ };
385+ return (
386+ <VStack className="gap-5 sm:gap-8 p-6 sm:p-9 border border-outline-200 bg-background-0 rounded-xl shadow-hard-5 w-full max-w-[423px]">
387+ <VStack className="items-center gap-1">
388+ <Heading size="xl">Confirm our password?</Heading>
389+ <Text>johnsmith@gmail.com</Text>
390+ </VStack>
391+ <VStack className="gap-3 sm:gap-5">
392+ <Input className="rounded-md" size="sm">
393+ <InputField
394+ type={showPassword ? 'text' : 'password'}
395+ placeholder="Enter password"
396+ />
397+ <InputSlot className="mr-3" onPress={handleState}>
398+ {/* EyeIcon, EyeOffIcon are both imported from 'lucide-react-native' */}
399+ <InputIcon
400+ size="xs"
401+ as={showPassword ? EyeIcon : EyeOffIcon}
402+ className="stroke-background-600"
403+ />
404+ </InputSlot>
405+ </Input>
406+ <Button className="w-full rounded-md" size="sm">
407+ <ButtonText>Confirm</ButtonText>
408+ </Button>
409+ </VStack>
410+ <Alert className="items-start" action="muted">
411+ <AlertIcon as={InfoIcon} size="xs" className="stroke-background-500" />
412+ <AlertText className="text-typography-600" size="xs">
413+ Minimum 8 characters, with at least 1 uppercase, 1 lowercase, and 1
414+ number required.
415+ </AlertText>
416+ </Alert>
417+ </VStack>
418+ );
419+ };
420+ ` ,
421+ transformCode : (code ) => {
422+ return transformedCode (code , ' function' , ' Example' );
423+ },
424+ scope: {
425+ Alert ,
426+ AlertIcon ,
427+ AlertText ,
428+ Wrapper ,
429+ HStack ,
430+ VStack ,
431+ Button ,
432+ ButtonText ,
433+ Text ,
434+ Heading ,
435+ Input ,
436+ InputField ,
437+ InputSlot ,
438+ InputIcon ,
439+ EyeIcon ,
440+ EyeOffIcon ,
441+ InfoIcon
442+ },
443+ argsType: {},
444+ }}
445+ />
266446</Wrapper >
0 commit comments