@campxdev/react-native-blueprint 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/global.css +672 -0
- package/lib/module/assets/Loading Animation.json +1 -0
- package/lib/module/assets/Success-Tick.json +1 -0
- package/lib/module/assets/lotties/index.js +3 -1
- package/lib/module/assets/lotties/index.js.map +1 -1
- package/lib/module/components/DataDisplay/Accordion/Accordion.js +1 -0
- package/lib/module/components/DataDisplay/Accordion/Accordion.js.map +1 -1
- package/lib/module/components/DataDisplay/AccordionItem/AccordionItem.js +1 -0
- package/lib/module/components/DataDisplay/AccordionItem/AccordionItem.js.map +1 -1
- package/lib/module/components/DataDisplay/Badge/Badge.figma.js +1 -0
- package/lib/module/components/DataDisplay/Badge/Badge.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Badge/Badge.js +1 -0
- package/lib/module/components/DataDisplay/Badge/Badge.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js +25 -0
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/Banner/Banner.js +101 -0
- package/lib/module/components/DataDisplay/Banner/Banner.js.map +1 -0
- package/lib/module/components/DataDisplay/BannerRow/BannerRow.js +1 -0
- package/lib/module/components/DataDisplay/BannerRow/BannerRow.js.map +1 -1
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js +1 -0
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js.map +1 -1
- package/lib/module/components/DataDisplay/Card/Card.js +1 -0
- package/lib/module/components/DataDisplay/Card/Card.js.map +1 -1
- package/lib/module/components/DataDisplay/Chips/Chips.js +1 -0
- package/lib/module/components/DataDisplay/Chips/Chips.js.map +1 -1
- package/lib/module/components/DataDisplay/ChipsRow/ChipsRow.js +1 -0
- package/lib/module/components/DataDisplay/ChipsRow/ChipsRow.js.map +1 -1
- package/lib/module/components/DataDisplay/DataListItem/DataListItem.js +1 -0
- package/lib/module/components/DataDisplay/DataListItem/DataListItem.js.map +1 -1
- package/lib/module/components/DataDisplay/Datalist/Datalist.js +1 -0
- package/lib/module/components/DataDisplay/Datalist/Datalist.js.map +1 -1
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js +15 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.js +121 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.js.map +1 -0
- package/lib/module/components/DataDisplay/MonthCalendar/MonthCalendar.figma.js +5 -7
- package/lib/module/components/DataDisplay/MonthCalendar/MonthCalendar.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Separator/Separator.js +1 -0
- package/lib/module/components/DataDisplay/Separator/Separator.js.map +1 -1
- package/lib/module/components/DataDisplay/Skeleton/Skeleton.js +1 -0
- package/lib/module/components/DataDisplay/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/components/DataDisplay/Tooltip/Tooltip.figma.js +1 -0
- package/lib/module/components/DataDisplay/Tooltip/Tooltip.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Tooltip/Tooltip.js +1 -0
- package/lib/module/components/DataDisplay/Tooltip/Tooltip.js.map +1 -1
- package/lib/module/components/Feedback/InfoBar/InfoBar.figma.js +32 -0
- package/lib/module/components/Feedback/InfoBar/InfoBar.figma.js.map +1 -0
- package/lib/module/components/Feedback/InfoBar/InfoBar.js +107 -0
- package/lib/module/components/Feedback/InfoBar/InfoBar.js.map +1 -0
- package/lib/module/components/Feedback/ProgressCircular/Progress-circular.js +1 -0
- package/lib/module/components/Feedback/ProgressCircular/Progress-circular.js.map +1 -1
- package/lib/module/components/Feedback/ProgressLinear/Progress-linear.js +1 -0
- package/lib/module/components/Feedback/ProgressLinear/Progress-linear.js.map +1 -1
- package/lib/module/components/Input/Button/Button.js +99 -43
- package/lib/module/components/Input/Button/Button.js.map +1 -1
- package/lib/module/components/Input/Checkbox/Checkbox.js +1 -0
- package/lib/module/components/Input/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/components/Input/RadioGroup/Radio-Group.figma.js +3 -3
- package/lib/module/components/Input/RadioGroup/Radio-Group.figma.js.map +1 -1
- package/lib/module/components/Input/RadioGroup/Radio-Group.js +1 -0
- package/lib/module/components/Input/RadioGroup/Radio-Group.js.map +1 -1
- package/lib/module/components/Input/Select/Select.js +1 -0
- package/lib/module/components/Input/Select/Select.js.map +1 -1
- package/lib/module/components/Input/TextField/Textfield.figma.js +4 -2
- package/lib/module/components/Input/TextField/Textfield.figma.js.map +1 -1
- package/lib/module/components/Input/TextField/Textfield.js +219 -43
- package/lib/module/components/Input/TextField/Textfield.js.map +1 -1
- package/lib/module/components/Input/Toggle/Toggle.figma.js +32 -0
- package/lib/module/components/Input/Toggle/Toggle.figma.js.map +1 -0
- package/lib/module/components/Input/Toggle/Toggle.js +52 -23
- package/lib/module/components/Input/Toggle/Toggle.js.map +1 -1
- package/lib/module/components/Input/ToggleGroup/Toggle-Group.js +1 -0
- package/lib/module/components/Input/ToggleGroup/Toggle-Group.js.map +1 -1
- package/lib/module/components/Input/switch/Switch.figma.js +1 -0
- package/lib/module/components/Input/switch/Switch.figma.js.map +1 -1
- package/lib/module/components/Input/switch/Switch.js +1 -0
- package/lib/module/components/Input/switch/Switch.js.map +1 -1
- package/lib/module/components/Layout/Tabs/Tabs.figma.js +1 -0
- package/lib/module/components/Layout/Tabs/Tabs.figma.js.map +1 -1
- package/lib/module/components/Layout/Tabs/Tabs.js +1 -0
- package/lib/module/components/Layout/Tabs/Tabs.js.map +1 -1
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js +1 -0
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js.map +1 -1
- package/lib/module/components/Navigation/FloatingAction/Floating-Action.js +1 -0
- package/lib/module/components/Navigation/FloatingAction/Floating-Action.js.map +1 -1
- package/lib/module/components/Navigation/Popover/Popover.figma.js +1 -0
- package/lib/module/components/Navigation/Popover/Popover.figma.js.map +1 -1
- package/lib/module/components/Navigation/Popover/Popover.js +1 -0
- package/lib/module/components/Navigation/Popover/Popover.js.map +1 -1
- package/lib/module/components/ui/Custom-Card.js +1 -0
- package/lib/module/components/ui/Custom-Card.js.map +1 -1
- package/lib/module/components/ui/Dropdown-Menu.js +1 -0
- package/lib/module/components/ui/Dropdown-Menu.js.map +1 -1
- package/lib/module/components/ui/Hover-Card.js +1 -0
- package/lib/module/components/ui/Hover-Card.js.map +1 -1
- package/lib/module/components/ui/Icon.js +1 -0
- package/lib/module/components/ui/Icon.js.map +1 -1
- package/lib/module/components/ui/Input.js +1 -0
- package/lib/module/components/ui/Input.js.map +1 -1
- package/lib/module/components/ui/Menubar.js +1 -0
- package/lib/module/components/ui/Menubar.js.map +1 -1
- package/lib/module/components/ui/Slider.js +1 -0
- package/lib/module/components/ui/Slider.js.map +1 -1
- package/lib/module/components/ui/Table.js +1 -0
- package/lib/module/components/ui/Table.js.map +1 -1
- package/lib/module/components/ui/Toast.js +1 -0
- package/lib/module/components/ui/Toast.js.map +1 -1
- package/lib/module/components/ui/index.js +4 -1
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/patterns/pattern-components/AlertDialogPattern/AlertDialogPattern.js +1 -0
- package/lib/module/patterns/pattern-components/AlertDialogPattern/AlertDialogPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/AlertPattern/AlertPattern.js +1 -0
- package/lib/module/patterns/pattern-components/AlertPattern/AlertPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/BottomSheetPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/BottomSheetPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.js +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.js.map +1 -1
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.js +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/CalendarPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/DashboardPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/DashboardPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/EmptyState/EmptyState.js +1 -0
- package/lib/module/patterns/pattern-components/EmptyState/EmptyState.js.map +1 -1
- package/lib/module/patterns/pattern-components/EntityPatternGuided/EntityPatternGuided.js +1 -0
- package/lib/module/patterns/pattern-components/EntityPatternGuided/EntityPatternGuided.js.map +1 -1
- package/lib/module/patterns/pattern-components/EntityPatternGuided/index.js +4 -0
- package/lib/module/patterns/pattern-components/EntityPatternGuided/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/EntityPatternOverview/EntityPatternOverview.js +1 -0
- package/lib/module/patterns/pattern-components/EntityPatternOverview/EntityPatternOverview.js.map +1 -1
- package/lib/module/patterns/pattern-components/EntityPatternStructured/EntityPatternStructured.js +1 -0
- package/lib/module/patterns/pattern-components/EntityPatternStructured/EntityPatternStructured.js.map +1 -1
- package/lib/module/patterns/pattern-components/FormPattern/FormPattern.js +1 -0
- package/lib/module/patterns/pattern-components/FormPattern/FormPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.js +38 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.js +91 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/index.js +5 -3
- package/lib/module/patterns/pattern-components/index.js.map +1 -1
- package/package.json +4 -3
- package/src/assets/Loading Animation.json +1 -0
- package/src/assets/Success-Tick.json +1 -0
- package/src/assets/lotties/index.ts +2 -0
- package/src/components/DataDisplay/Accordion/Accordion.tsx +1 -0
- package/src/components/DataDisplay/AccordionItem/AccordionItem.tsx +1 -0
- package/src/components/DataDisplay/Badge/Badge.figma.tsx +1 -0
- package/src/components/DataDisplay/Badge/Badge.tsx +1 -0
- package/src/components/DataDisplay/Banner/Banner.figma.tsx +26 -0
- package/src/components/DataDisplay/Banner/Banner.tsx +108 -0
- package/src/components/DataDisplay/BannerRow/BannerRow.tsx +1 -0
- package/src/components/DataDisplay/CalendarItem/CalendarItem.tsx +1 -0
- package/src/components/DataDisplay/Card/Card.tsx +1 -0
- package/src/components/DataDisplay/Chips/Chips.tsx +1 -0
- package/src/components/DataDisplay/ChipsRow/ChipsRow.tsx +1 -0
- package/src/components/DataDisplay/DataListItem/DataListItem.tsx +1 -0
- package/src/components/DataDisplay/Datalist/Datalist.tsx +1 -0
- package/src/components/DataDisplay/Greeting/Greeting.figma.tsx +12 -0
- package/src/components/DataDisplay/Greeting/Greeting.tsx +154 -0
- package/src/components/DataDisplay/MonthCalendar/MonthCalendar.figma.tsx +7 -11
- package/src/components/DataDisplay/Separator/Separator.tsx +1 -0
- package/src/components/DataDisplay/Skeleton/Skeleton.tsx +1 -0
- package/src/components/DataDisplay/Tooltip/Tooltip.figma.tsx +1 -0
- package/src/components/DataDisplay/Tooltip/Tooltip.tsx +1 -0
- package/src/components/Feedback/InfoBar/InfoBar.figma.tsx +31 -0
- package/src/components/Feedback/InfoBar/InfoBar.tsx +127 -0
- package/src/components/Feedback/ProgressCircular/Progress-circular.tsx +1 -0
- package/src/components/Feedback/ProgressLinear/Progress-linear.tsx +1 -0
- package/src/components/Input/Button/Button.tsx +110 -43
- package/src/components/Input/Checkbox/Checkbox.tsx +1 -0
- package/src/components/Input/RadioGroup/Radio-Group.figma.tsx +3 -3
- package/src/components/Input/RadioGroup/Radio-Group.tsx +1 -0
- package/src/components/Input/Select/Select.tsx +1 -0
- package/src/components/Input/TextField/Textfield.figma.tsx +2 -0
- package/src/components/Input/TextField/Textfield.tsx +280 -48
- package/src/components/Input/Toggle/Toggle.figma.tsx +37 -0
- package/src/components/Input/Toggle/Toggle.tsx +49 -22
- package/src/components/Input/ToggleGroup/Toggle-Group.tsx +1 -0
- package/src/components/Input/switch/Switch.figma.tsx +1 -0
- package/src/components/Input/switch/Switch.tsx +1 -0
- package/src/components/Layout/Tabs/Tabs.figma.tsx +1 -0
- package/src/components/Layout/Tabs/Tabs.tsx +1 -0
- package/src/components/Navigation/Appbar/AppBar.figma.tsx +1 -0
- package/src/components/Navigation/FloatingAction/Floating-Action.tsx +1 -0
- package/src/components/Navigation/Popover/Popover.figma.tsx +1 -0
- package/src/components/Navigation/Popover/Popover.tsx +1 -0
- package/src/components/ui/Custom-Card.tsx +1 -0
- package/src/components/ui/Dropdown-Menu.tsx +1 -0
- package/src/components/ui/Hover-Card.tsx +1 -0
- package/src/components/ui/Icon.tsx +1 -0
- package/src/components/ui/Input.tsx +1 -0
- package/src/components/ui/Menubar.tsx +1 -0
- package/src/components/ui/Slider.tsx +1 -0
- package/src/components/ui/Table.tsx +1 -0
- package/src/components/ui/Toast.tsx +1 -0
- package/src/components/ui/index.ts +5 -1
- package/src/index.tsx +3 -0
- package/src/patterns/pattern-components/AlertDialogPattern/AlertDialogPattern.tsx +1 -0
- package/src/patterns/pattern-components/AlertPattern/AlertPattern.tsx +1 -0
- package/src/patterns/pattern-components/BottomSheetPattern/index.ts +1 -0
- package/src/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.tsx +1 -0
- package/src/patterns/pattern-components/CalendarPattern/CalendarPattern.tsx +1 -0
- package/src/patterns/pattern-components/CalendarPattern/index.ts +1 -0
- package/src/patterns/pattern-components/DashboardPattern/index.ts +1 -0
- package/src/patterns/pattern-components/EmptyState/EmptyState.tsx +1 -0
- package/src/patterns/pattern-components/EntityPatternGuided/EntityPatternGuided.tsx +1 -0
- package/src/patterns/pattern-components/EntityPatternGuided/index.ts +1 -0
- package/src/patterns/pattern-components/EntityPatternOverview/EntityPatternOverview.tsx +1 -0
- package/src/patterns/pattern-components/EntityPatternStructured/EntityPatternStructured.tsx +1 -0
- package/src/patterns/pattern-components/FormPattern/FormPattern.tsx +1 -0
- package/src/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.tsx +38 -0
- package/src/patterns/pattern-components/SuccessPattern/SuccessPattern.tsx +119 -0
- package/src/patterns/pattern-components/SuccessPattern/index.ts +2 -0
- package/src/patterns/pattern-components/index.ts +3 -1
- package/lib/module/components/ui/Greeting-Card.js +0 -392
- package/lib/module/components/ui/Greeting-Card.js.map +0 -1
- package/src/components/ui/Greeting-Card.tsx +0 -471
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { ToggleItem } from './Toggle';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=408-2632';
|
|
6
|
+
|
|
7
|
+
figma.connect(ToggleItem, FIGMA_URL, {
|
|
8
|
+
props: {
|
|
9
|
+
// State (whether toggle is on/off)
|
|
10
|
+
state: figma.boolean('state'),
|
|
11
|
+
|
|
12
|
+
// Tone (color variant)
|
|
13
|
+
tone: figma.enum('tone', {
|
|
14
|
+
default: 'default',
|
|
15
|
+
success: 'success',
|
|
16
|
+
destructive: 'destructive',
|
|
17
|
+
warning: 'warning',
|
|
18
|
+
}),
|
|
19
|
+
|
|
20
|
+
// Text content
|
|
21
|
+
text: figma.string('Text'),
|
|
22
|
+
|
|
23
|
+
// Icon visibility
|
|
24
|
+
showLeftIcon: figma.boolean('Show leftIcon'),
|
|
25
|
+
showRightIcon: figma.boolean('Show rightIcon'),
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
example: (props) => (
|
|
29
|
+
<ToggleItem
|
|
30
|
+
state={props.state}
|
|
31
|
+
tone={props.tone}
|
|
32
|
+
text={props.text}
|
|
33
|
+
showLeftIcon={props.showLeftIcon}
|
|
34
|
+
showRightIcon={props.showRightIcon}
|
|
35
|
+
/>
|
|
36
|
+
),
|
|
37
|
+
});
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { View, Text } from 'react-native';
|
|
4
|
+
import { cssInterop } from 'nativewind';
|
|
3
5
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
6
|
import { cn } from '../../../lib/utils';
|
|
5
7
|
|
|
8
|
+
// NativeWind interop
|
|
9
|
+
cssInterop(View, { className: 'style' });
|
|
10
|
+
cssInterop(Text, { className: 'style' });
|
|
11
|
+
|
|
12
|
+
// Typed components
|
|
13
|
+
const StyledView = View as any;
|
|
14
|
+
const StyledText = Text as any;
|
|
15
|
+
|
|
6
16
|
/* ------------------------------------------------------------------
|
|
7
17
|
* Variants
|
|
8
18
|
* ------------------------------------------------------------------ */
|
|
@@ -12,14 +22,14 @@ const toggleItemVariants = cva(
|
|
|
12
22
|
{
|
|
13
23
|
variants: {
|
|
14
24
|
tone: {
|
|
15
|
-
default: 'border-
|
|
16
|
-
success: 'border-
|
|
17
|
-
destructive: 'border-
|
|
18
|
-
warning: 'border-
|
|
25
|
+
default: 'border-text-primary bg-surface-default',
|
|
26
|
+
success: 'border-text-primary bg-surface-default',
|
|
27
|
+
destructive: 'border-text-primary bg-surface-default',
|
|
28
|
+
warning: 'border-text-primary bg-surface-default',
|
|
19
29
|
},
|
|
20
30
|
state: {
|
|
21
31
|
true: '',
|
|
22
|
-
false: '
|
|
32
|
+
false: '',
|
|
23
33
|
},
|
|
24
34
|
},
|
|
25
35
|
compoundVariants: [
|
|
@@ -27,25 +37,27 @@ const toggleItemVariants = cva(
|
|
|
27
37
|
{
|
|
28
38
|
tone: 'default',
|
|
29
39
|
state: true,
|
|
30
|
-
className: 'bg-surface-subtle',
|
|
40
|
+
className: 'bg-surface-subtle border-text-primary',
|
|
31
41
|
},
|
|
32
42
|
// SUCCESS (ON)
|
|
33
43
|
{
|
|
34
44
|
tone: 'success',
|
|
35
45
|
state: true,
|
|
36
|
-
className:
|
|
46
|
+
className:
|
|
47
|
+
'bg-highlight-success-green-muted border-highlight-success-green',
|
|
37
48
|
},
|
|
38
49
|
// DESTRUCTIVE (ON)
|
|
39
50
|
{
|
|
40
51
|
tone: 'destructive',
|
|
41
52
|
state: true,
|
|
42
|
-
className: 'bg-highlight-alert-red-muted',
|
|
53
|
+
className: 'bg-highlight-alert-red-muted border-highlight-alert-red',
|
|
43
54
|
},
|
|
44
55
|
// WARNING (ON)
|
|
45
56
|
{
|
|
46
57
|
tone: 'warning',
|
|
47
58
|
state: true,
|
|
48
|
-
className:
|
|
59
|
+
className:
|
|
60
|
+
'bg-highlight-warning-orange-muted border-highlight-warning-orange',
|
|
49
61
|
},
|
|
50
62
|
],
|
|
51
63
|
defaultVariants: {
|
|
@@ -59,9 +71,9 @@ const textVariants = cva('text-sm font-semibold', {
|
|
|
59
71
|
variants: {
|
|
60
72
|
tone: {
|
|
61
73
|
default: 'text-text-secondary',
|
|
62
|
-
success: 'text-
|
|
63
|
-
destructive: 'text-
|
|
64
|
-
warning: 'text-
|
|
74
|
+
success: 'text-text-secondary',
|
|
75
|
+
destructive: 'text-text-secondary',
|
|
76
|
+
warning: 'text-text-secondary',
|
|
65
77
|
},
|
|
66
78
|
state: {
|
|
67
79
|
true: '',
|
|
@@ -75,9 +87,24 @@ const textVariants = cva('text-sm font-semibold', {
|
|
|
75
87
|
state: true,
|
|
76
88
|
className: 'text-brand-primary',
|
|
77
89
|
},
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
// Success (ON)
|
|
91
|
+
{
|
|
92
|
+
tone: 'success',
|
|
93
|
+
state: true,
|
|
94
|
+
className: 'text-highlight-success-green',
|
|
95
|
+
},
|
|
96
|
+
// Destructive (ON)
|
|
97
|
+
{
|
|
98
|
+
tone: 'destructive',
|
|
99
|
+
state: true,
|
|
100
|
+
className: 'text-highlight-alert-red',
|
|
101
|
+
},
|
|
102
|
+
// Warning (ON)
|
|
103
|
+
{
|
|
104
|
+
tone: 'warning',
|
|
105
|
+
state: true,
|
|
106
|
+
className: 'text-highlight-warning-orange',
|
|
107
|
+
},
|
|
81
108
|
],
|
|
82
109
|
});
|
|
83
110
|
|
|
@@ -101,19 +128,19 @@ export function ToggleItem({
|
|
|
101
128
|
className,
|
|
102
129
|
}: ToggleItemProps) {
|
|
103
130
|
return (
|
|
104
|
-
<
|
|
105
|
-
{showLeftIcon && <
|
|
131
|
+
<StyledView className={cn(toggleItemVariants({ tone, state }), className)}>
|
|
132
|
+
{showLeftIcon && <StyledView className="h-4 w-4 bg-muted rounded-sm" />}
|
|
106
133
|
|
|
107
|
-
<
|
|
134
|
+
<StyledText
|
|
108
135
|
className={textVariants({
|
|
109
136
|
tone,
|
|
110
137
|
state,
|
|
111
138
|
})}
|
|
112
139
|
>
|
|
113
140
|
{text}
|
|
114
|
-
</
|
|
141
|
+
</StyledText>
|
|
115
142
|
|
|
116
|
-
{showRightIcon && <
|
|
117
|
-
</
|
|
143
|
+
{showRightIcon && <StyledView className="h-4 w-4 bg-muted rounded-sm" />}
|
|
144
|
+
</StyledView>
|
|
118
145
|
);
|
|
119
146
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
export * from '../DataDisplay/Accordion/Accordion';
|
|
2
3
|
export * from '../DataDisplay/AccordionItem/AccordionItem';
|
|
3
4
|
export * from '../Feedback/Alert/Alert';
|
|
4
5
|
export * from '../Feedback/AlertDialog/Alert-Dialog';
|
|
6
|
+
export * from '../Feedback/InfoBar/InfoBar';
|
|
5
7
|
export * from '../Navigation/Appbar/AppBar';
|
|
6
8
|
export * from '../Layout/AspectRatio/Aspect-Ratio';
|
|
7
9
|
export * from '../DataDisplay/Avatar/Avatar';
|
|
8
10
|
export * from '../DataDisplay/Badge/Badge';
|
|
11
|
+
export * from '../DataDisplay/Banner/Banner';
|
|
9
12
|
export * from '../DataDisplay/Chips/Chips';
|
|
10
13
|
export * from '../DataDisplay/ChipsRow/ChipsRow';
|
|
11
14
|
export * from '../DataDisplay/BannerRow/BannerRow';
|
|
@@ -16,6 +19,7 @@ export * from '../Layout/Bottomsheet/Bottom-Sheet';
|
|
|
16
19
|
export * from '../Input/Button/Button';
|
|
17
20
|
export * from '../DataDisplay/Card/Card';
|
|
18
21
|
export * from '../DataDisplay/CalendarItem/CalendarItem';
|
|
22
|
+
export * from '../DataDisplay/Greeting/Greeting';
|
|
19
23
|
export * from '../DataDisplay/MonthCalendar/MonthCalendar';
|
|
20
24
|
export * from '../DataDisplay/DataCard/DataCard';
|
|
21
25
|
export * from '../Input/Checkbox/Checkbox';
|
|
@@ -25,7 +29,7 @@ export * from './Custom-Card';
|
|
|
25
29
|
export * from '../Navigation/Dialog/Dialog';
|
|
26
30
|
export * from './Dropdown-Menu';
|
|
27
31
|
export * from '../Navigation/FloatingAction/Floating-Action';
|
|
28
|
-
|
|
32
|
+
|
|
29
33
|
export * from './Hover-Card';
|
|
30
34
|
export * from './Icon';
|
|
31
35
|
export * from './Input';
|
package/src/index.tsx
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BottomSheetPattern } from './BottomSheetPattern';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CalendarPattern } from './CalendarPattern';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DashboardPattern } from './DashboardPattern';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EntityPatternGuided } from './EntityPatternGuided';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { SuccessPattern } from './SuccessPattern';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=411-3184';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SuccessPattern - Success state pattern with animated checkmark
|
|
9
|
+
*
|
|
10
|
+
* Use cases:
|
|
11
|
+
* - Order confirmation screens
|
|
12
|
+
* - Form submission success
|
|
13
|
+
* - Action completion feedback
|
|
14
|
+
* - Payment confirmation
|
|
15
|
+
* - Task completion states
|
|
16
|
+
*
|
|
17
|
+
* Features:
|
|
18
|
+
* - Animated success tick using Lottie (Success-Tick.json)
|
|
19
|
+
* - Customizable success message
|
|
20
|
+
* - Optional description text
|
|
21
|
+
* - Configurable animation behavior (loop, autoplay, duration)
|
|
22
|
+
* - Callback when animation completes
|
|
23
|
+
*/
|
|
24
|
+
figma.connect(SuccessPattern, FIGMA_URL, {
|
|
25
|
+
props: {
|
|
26
|
+
successMessage: figma.string('SuccessMessage'),
|
|
27
|
+
description: figma.string('Description'),
|
|
28
|
+
},
|
|
29
|
+
example: (props) => (
|
|
30
|
+
<SuccessPattern
|
|
31
|
+
successMessage={props.successMessage}
|
|
32
|
+
description={props.description}
|
|
33
|
+
showAnimation={true}
|
|
34
|
+
autoplay={true}
|
|
35
|
+
loop={false}
|
|
36
|
+
/>
|
|
37
|
+
),
|
|
38
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View as RNView } from 'react-native';
|
|
4
|
+
import { cssInterop } from 'nativewind';
|
|
5
|
+
import LottieView from 'lottie-react-native';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { Text } from '../../../components/Input/Text/Text';
|
|
8
|
+
|
|
9
|
+
cssInterop(RNView, { className: 'style' });
|
|
10
|
+
|
|
11
|
+
const View = RNView as React.ComponentType<
|
|
12
|
+
React.ComponentProps<typeof RNView> & { className?: string }
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
/* ============================================================================
|
|
16
|
+
* Types
|
|
17
|
+
* ============================================================================ */
|
|
18
|
+
|
|
19
|
+
export interface SuccessPatternProps {
|
|
20
|
+
/** Main success message text */
|
|
21
|
+
successMessage?: string;
|
|
22
|
+
/** Secondary description text */
|
|
23
|
+
description?: string;
|
|
24
|
+
/** Whether to show the lottie animation */
|
|
25
|
+
showAnimation?: boolean;
|
|
26
|
+
/** Animation duration in milliseconds */
|
|
27
|
+
animationDuration?: number;
|
|
28
|
+
/** Loop the animation */
|
|
29
|
+
loop?: boolean;
|
|
30
|
+
/** Auto-play the animation */
|
|
31
|
+
autoplay?: boolean;
|
|
32
|
+
/** Custom className for styling */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Test ID for testing */
|
|
35
|
+
testID?: string;
|
|
36
|
+
/** Callback when animation completes */
|
|
37
|
+
onAnimationFinish?: () => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ============================================================================
|
|
41
|
+
* Component
|
|
42
|
+
* ============================================================================ */
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* SuccessPattern Component
|
|
46
|
+
*
|
|
47
|
+
* A pattern component that displays a success state with:
|
|
48
|
+
* - Animated success tick/checkmark (Lottie animation)
|
|
49
|
+
* - Success message
|
|
50
|
+
* - Description text
|
|
51
|
+
*
|
|
52
|
+
* Perfect for use after form submissions, confirmations, or successful operations.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* <SuccessPattern
|
|
57
|
+
* successMessage="Order Placed Successfully!"
|
|
58
|
+
* description="Your order has been confirmed"
|
|
59
|
+
* showAnimation={true}
|
|
60
|
+
* onAnimationFinish={() => navigation.navigate('Home')}
|
|
61
|
+
* />
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export const SuccessPattern = ({
|
|
65
|
+
successMessage = 'This is the Success Message',
|
|
66
|
+
description = 'Success message descriptions goes here',
|
|
67
|
+
showAnimation = true,
|
|
68
|
+
animationDuration = 2000,
|
|
69
|
+
loop = false,
|
|
70
|
+
autoplay = true,
|
|
71
|
+
className,
|
|
72
|
+
testID,
|
|
73
|
+
onAnimationFinish,
|
|
74
|
+
}: SuccessPatternProps) => {
|
|
75
|
+
const animationRef = React.useRef<any>(null);
|
|
76
|
+
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
if (autoplay && animationRef.current && showAnimation) {
|
|
79
|
+
animationRef.current.play();
|
|
80
|
+
}
|
|
81
|
+
}, [showAnimation, autoplay]);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<View
|
|
85
|
+
testID={testID}
|
|
86
|
+
className={cn(
|
|
87
|
+
'w-full items-center justify-center bg-surface-page',
|
|
88
|
+
className
|
|
89
|
+
)}
|
|
90
|
+
>
|
|
91
|
+
{/* Animation Container */}
|
|
92
|
+
{showAnimation && (
|
|
93
|
+
<View className="h-60 w-60 items-center justify-center">
|
|
94
|
+
<LottieView
|
|
95
|
+
ref={animationRef}
|
|
96
|
+
source={require('../../../assets/Success-Tick.json')}
|
|
97
|
+
autoPlay={autoplay}
|
|
98
|
+
loop={loop}
|
|
99
|
+
duration={animationDuration}
|
|
100
|
+
onAnimationFinish={onAnimationFinish}
|
|
101
|
+
style={{ width: 300, height: 300 }}
|
|
102
|
+
/>
|
|
103
|
+
</View>
|
|
104
|
+
)}
|
|
105
|
+
|
|
106
|
+
{/* Content Section */}
|
|
107
|
+
<View className="w-full items-center gap-2 text-center px-4 py-6">
|
|
108
|
+
<Text className="text-lg font-semibold text-text-primary">
|
|
109
|
+
{successMessage}
|
|
110
|
+
</Text>
|
|
111
|
+
<Text className="text-sm font-medium text-text-secondary">
|
|
112
|
+
{description}
|
|
113
|
+
</Text>
|
|
114
|
+
</View>
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
SuccessPattern.displayName = 'SuccessPattern';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
export * from './AlertDialogPattern';
|
|
2
3
|
export * from './DashboardPattern';
|
|
3
4
|
export * from './EmptyState';
|
|
@@ -6,9 +7,10 @@ export * from './CardListPattern';
|
|
|
6
7
|
export * from './AlertPattern';
|
|
7
8
|
export * from './DialogPattern';
|
|
8
9
|
export * from './SkeletonPattern';
|
|
10
|
+
export * from './SuccessPattern';
|
|
9
11
|
export * from './FormPattern';
|
|
10
12
|
export * from './EntityPatternOverview';
|
|
11
13
|
export * from './EntityPatternStructured';
|
|
12
14
|
export * from './EntityPatternGuided';
|
|
13
|
-
export * from './CalendarPattern
|
|
15
|
+
export * from './CalendarPattern';
|
|
14
16
|
export * from './MonthlyCalendarPattern';
|