@urbint/cl 1.0.1
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/.cursor/rules +313 -0
- package/.rnstorybook/index.ts +11 -0
- package/.rnstorybook/main.ts +8 -0
- package/.rnstorybook/preview.tsx +14 -0
- package/.rnstorybook/storybook.requires.ts +49 -0
- package/.storybook/main.ts +16 -0
- package/.storybook/preview.ts +32 -0
- package/.storybook/vitest.setup.ts +7 -0
- package/App.tsx +422 -0
- package/README.md +229 -0
- package/app.json +33 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash-icon.png +0 -0
- package/babel.config.js +16 -0
- package/docs/components/CodeBlock.tsx +80 -0
- package/docs/components/PropTable.tsx +93 -0
- package/docs/components/Sidebar.tsx +199 -0
- package/docs/components/index.ts +8 -0
- package/docs/data/colorTokens.ts +70 -0
- package/docs/data/componentData.tsx +1685 -0
- package/docs/data/index.ts +7 -0
- package/docs/index.ts +19 -0
- package/docs/navigation.ts +94 -0
- package/docs/pages/ColorsPage.tsx +226 -0
- package/docs/pages/ComponentPage.tsx +235 -0
- package/docs/pages/InstallationPage.tsx +232 -0
- package/docs/pages/IntroductionPage.tsx +163 -0
- package/docs/pages/ThemingPage.tsx +251 -0
- package/docs/pages/index.ts +10 -0
- package/docs/theme.ts +64 -0
- package/docs/types.ts +54 -0
- package/index.ts +8 -0
- package/llms.txt +1893 -0
- package/mcp-config.example.json +10 -0
- package/mcp-server/README.md +192 -0
- package/mcp-server/package-lock.json +1707 -0
- package/mcp-server/package.json +38 -0
- package/mcp-server/src/index.ts +1136 -0
- package/mcp-server/src/registry/components.ts +1446 -0
- package/mcp-server/src/registry/index.ts +3 -0
- package/mcp-server/src/registry/tokens.ts +256 -0
- package/mcp-server/tsconfig.json +19 -0
- package/package.json +92 -0
- package/src/components/Accordion/Accordion.stories.tsx +226 -0
- package/src/components/Accordion/Accordion.tsx +255 -0
- package/src/components/Accordion/index.ts +12 -0
- package/src/components/ActionSheet/ActionSheet.stories.tsx +393 -0
- package/src/components/ActionSheet/ActionSheet.tsx +258 -0
- package/src/components/ActionSheet/index.ts +2 -0
- package/src/components/Alert/Alert.stories.tsx +165 -0
- package/src/components/Alert/Alert.tsx +164 -0
- package/src/components/Alert/index.ts +2 -0
- package/src/components/AlertDialog/AlertDialog.stories.tsx +330 -0
- package/src/components/AlertDialog/AlertDialog.tsx +234 -0
- package/src/components/AlertDialog/index.ts +2 -0
- package/src/components/Avatar/Avatar.stories.tsx +154 -0
- package/src/components/Avatar/Avatar.tsx +219 -0
- package/src/components/Avatar/index.ts +2 -0
- package/src/components/Badge/Badge.stories.tsx +146 -0
- package/src/components/Badge/Badge.tsx +125 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Box/Box.stories.tsx +192 -0
- package/src/components/Box/Box.tsx +184 -0
- package/src/components/Box/index.ts +2 -0
- package/src/components/Button/Button.stories.tsx +157 -0
- package/src/components/Button/Button.tsx +180 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Card/Card.stories.tsx +145 -0
- package/src/components/Card/Card.tsx +169 -0
- package/src/components/Card/index.ts +11 -0
- package/src/components/Center/Center.stories.tsx +215 -0
- package/src/components/Center/Center.tsx +29 -0
- package/src/components/Center/index.ts +2 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +94 -0
- package/src/components/Checkbox/Checkbox.tsx +242 -0
- package/src/components/Checkbox/index.ts +2 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +623 -0
- package/src/components/DatePicker/DatePicker.tsx +1228 -0
- package/src/components/DatePicker/index.ts +8 -0
- package/src/components/Divider/Divider.stories.tsx +224 -0
- package/src/components/Divider/Divider.tsx +73 -0
- package/src/components/Divider/index.ts +2 -0
- package/src/components/Drawer/Drawer.stories.tsx +414 -0
- package/src/components/Drawer/Drawer.tsx +342 -0
- package/src/components/Drawer/index.ts +11 -0
- package/src/components/Fab/Fab.stories.tsx +360 -0
- package/src/components/Fab/Fab.tsx +185 -0
- package/src/components/Fab/index.ts +2 -0
- package/src/components/FormControl/FormControl.stories.tsx +276 -0
- package/src/components/FormControl/FormControl.tsx +185 -0
- package/src/components/FormControl/index.ts +12 -0
- package/src/components/Grid/Grid.stories.tsx +244 -0
- package/src/components/Grid/Grid.tsx +93 -0
- package/src/components/Grid/index.ts +2 -0
- package/src/components/HStack/HStack.stories.tsx +230 -0
- package/src/components/HStack/HStack.tsx +80 -0
- package/src/components/HStack/index.ts +2 -0
- package/src/components/Heading/Heading.stories.tsx +111 -0
- package/src/components/Heading/Heading.tsx +85 -0
- package/src/components/Heading/index.ts +2 -0
- package/src/components/Icon/Icon.stories.tsx +320 -0
- package/src/components/Icon/Icon.tsx +117 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Image/Image.stories.tsx +357 -0
- package/src/components/Image/Image.tsx +168 -0
- package/src/components/Image/index.ts +2 -0
- package/src/components/Input/Input.stories.tsx +164 -0
- package/src/components/Input/Input.tsx +274 -0
- package/src/components/Input/index.ts +2 -0
- package/src/components/Link/Link.stories.tsx +187 -0
- package/src/components/Link/Link.tsx +104 -0
- package/src/components/Link/index.ts +2 -0
- package/src/components/Menu/Menu.stories.tsx +363 -0
- package/src/components/Menu/Menu.tsx +238 -0
- package/src/components/Menu/index.ts +2 -0
- package/src/components/Modal/Modal.stories.tsx +156 -0
- package/src/components/Modal/Modal.tsx +280 -0
- package/src/components/Modal/index.ts +11 -0
- package/src/components/Popover/Popover.stories.tsx +330 -0
- package/src/components/Popover/Popover.tsx +315 -0
- package/src/components/Popover/index.ts +11 -0
- package/src/components/Portal/Portal.stories.tsx +376 -0
- package/src/components/Portal/Portal.tsx +100 -0
- package/src/components/Portal/index.ts +2 -0
- package/src/components/Pressable/Pressable.stories.tsx +338 -0
- package/src/components/Pressable/Pressable.tsx +71 -0
- package/src/components/Pressable/index.ts +2 -0
- package/src/components/Progress/Progress.stories.tsx +131 -0
- package/src/components/Progress/Progress.tsx +219 -0
- package/src/components/Progress/index.ts +2 -0
- package/src/components/Radio/Radio.stories.tsx +101 -0
- package/src/components/Radio/Radio.tsx +234 -0
- package/src/components/Radio/index.ts +2 -0
- package/src/components/Select/Select.stories.tsx +908 -0
- package/src/components/Select/Select.tsx +659 -0
- package/src/components/Select/index.ts +8 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +154 -0
- package/src/components/Skeleton/Skeleton.tsx +192 -0
- package/src/components/Skeleton/index.ts +8 -0
- package/src/components/Slider/Slider.stories.tsx +363 -0
- package/src/components/Slider/Slider.tsx +209 -0
- package/src/components/Slider/index.ts +2 -0
- package/src/components/Spinner/Spinner.stories.tsx +108 -0
- package/src/components/Spinner/Spinner.tsx +121 -0
- package/src/components/Spinner/index.ts +2 -0
- package/src/components/Switch/Switch.stories.tsx +116 -0
- package/src/components/Switch/Switch.tsx +172 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/Table.stories.tsx +417 -0
- package/src/components/Table/Table.tsx +233 -0
- package/src/components/Table/index.ts +2 -0
- package/src/components/Text/Text.stories.tsx +93 -0
- package/src/components/Text/Text.tsx +119 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Textarea/Textarea.stories.tsx +280 -0
- package/src/components/Textarea/Textarea.tsx +212 -0
- package/src/components/Textarea/index.ts +2 -0
- package/src/components/Toast/Toast.stories.tsx +446 -0
- package/src/components/Toast/Toast.tsx +221 -0
- package/src/components/Toast/index.ts +2 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +354 -0
- package/src/components/Tooltip/Tooltip.tsx +261 -0
- package/src/components/Tooltip/index.ts +2 -0
- package/src/components/VStack/VStack.stories.tsx +183 -0
- package/src/components/VStack/VStack.tsx +76 -0
- package/src/components/VStack/index.ts +2 -0
- package/src/components/index.ts +62 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useControllableState.ts +41 -0
- package/src/hooks/useDisclosure.ts +51 -0
- package/src/index.ts +22 -0
- package/src/stories/Button.stories.tsx +53 -0
- package/src/stories/Button.tsx +101 -0
- package/src/stories/Configure.mdx +364 -0
- package/src/stories/Header.stories.tsx +33 -0
- package/src/stories/Header.tsx +75 -0
- package/src/stories/Page.stories.tsx +25 -0
- package/src/stories/Page.tsx +154 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/styles/index.ts +7 -0
- package/src/styles/tokens.ts +318 -0
- package/src/styles/unistyles.ts +254 -0
- package/src/utils/createContext.tsx +25 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/mergeRefs.ts +21 -0
- package/tsconfig.json +26 -0
- package/urbint-cl-1.0.0.tgz +0 -0
- package/vitest.config.ts +37 -0
- package/vitest.shims.d.ts +1 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import { Drawer, DrawerHeader, DrawerBody, DrawerFooter } from './Drawer';
|
|
5
|
+
import { Button } from '../Button';
|
|
6
|
+
import { VStack } from '../VStack';
|
|
7
|
+
import { HStack } from '../HStack';
|
|
8
|
+
import { Text } from '../Text';
|
|
9
|
+
import { Box } from '../Box';
|
|
10
|
+
import { Input } from '../Input';
|
|
11
|
+
import { Divider } from '../Divider';
|
|
12
|
+
import { colors, spacing, borderRadius } from '../../styles/tokens';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Story container with design system tokens
|
|
16
|
+
*/
|
|
17
|
+
const StoryContainer: React.FC<{ children: React.ReactNode }> = ({ children }) => (
|
|
18
|
+
<View style={styles.container}>{children}</View>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const meta: Meta<typeof Drawer> = {
|
|
22
|
+
title: 'Overlay/Drawer',
|
|
23
|
+
component: Drawer,
|
|
24
|
+
decorators: [
|
|
25
|
+
(Story) => (
|
|
26
|
+
<StoryContainer>
|
|
27
|
+
<Story />
|
|
28
|
+
</StoryContainer>
|
|
29
|
+
),
|
|
30
|
+
],
|
|
31
|
+
argTypes: {
|
|
32
|
+
placement: {
|
|
33
|
+
control: 'select',
|
|
34
|
+
options: ['left', 'right', 'top', 'bottom'],
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
control: 'select',
|
|
38
|
+
options: ['sm', 'md', 'lg', 'xl', 'full'],
|
|
39
|
+
},
|
|
40
|
+
closeOnOverlayClick: { control: 'boolean' },
|
|
41
|
+
showCloseButton: { control: 'boolean' },
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
placement: 'left',
|
|
45
|
+
size: 'md',
|
|
46
|
+
closeOnOverlayClick: true,
|
|
47
|
+
showCloseButton: true,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default meta;
|
|
52
|
+
|
|
53
|
+
type Story = StoryObj<typeof Drawer>;
|
|
54
|
+
|
|
55
|
+
const DrawerDemo = ({ placement = 'left', size = 'md' }: any) => {
|
|
56
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<VStack space={spacing.lg}>
|
|
60
|
+
<Button onPress={() => setIsOpen(true)}>Open Drawer</Button>
|
|
61
|
+
<Drawer
|
|
62
|
+
isOpen={isOpen}
|
|
63
|
+
onClose={() => setIsOpen(false)}
|
|
64
|
+
placement={placement}
|
|
65
|
+
size={size}
|
|
66
|
+
>
|
|
67
|
+
<DrawerHeader>Drawer Title</DrawerHeader>
|
|
68
|
+
<DrawerBody>
|
|
69
|
+
<Text>
|
|
70
|
+
This is the drawer content. You can put any content here including
|
|
71
|
+
forms, navigation menus, or detailed information.
|
|
72
|
+
</Text>
|
|
73
|
+
</DrawerBody>
|
|
74
|
+
<DrawerFooter>
|
|
75
|
+
<Button variant="ghost" onPress={() => setIsOpen(false)}>
|
|
76
|
+
Cancel
|
|
77
|
+
</Button>
|
|
78
|
+
<Button onPress={() => setIsOpen(false)}>Save</Button>
|
|
79
|
+
</DrawerFooter>
|
|
80
|
+
</Drawer>
|
|
81
|
+
</VStack>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Default: Story = {
|
|
86
|
+
render: () => <DrawerDemo />,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const PlacementDemo = () => {
|
|
90
|
+
const [placement, setPlacement] = useState<'left' | 'right' | 'top' | 'bottom'>('left');
|
|
91
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<VStack space={spacing.lg}>
|
|
95
|
+
<Text weight="semiBold">Drawer Placement</Text>
|
|
96
|
+
<HStack space={spacing.sm} wrap>
|
|
97
|
+
{(['left', 'right', 'top', 'bottom'] as const).map((p) => (
|
|
98
|
+
<Button
|
|
99
|
+
key={p}
|
|
100
|
+
variant={placement === p ? 'primary' : 'secondary'}
|
|
101
|
+
size="sm"
|
|
102
|
+
onPress={() => {
|
|
103
|
+
setPlacement(p);
|
|
104
|
+
setIsOpen(true);
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{p.charAt(0).toUpperCase() + p.slice(1)}
|
|
108
|
+
</Button>
|
|
109
|
+
))}
|
|
110
|
+
</HStack>
|
|
111
|
+
<Drawer
|
|
112
|
+
isOpen={isOpen}
|
|
113
|
+
onClose={() => setIsOpen(false)}
|
|
114
|
+
placement={placement}
|
|
115
|
+
>
|
|
116
|
+
<DrawerHeader>{placement.charAt(0).toUpperCase() + placement.slice(1)} Drawer</DrawerHeader>
|
|
117
|
+
<DrawerBody>
|
|
118
|
+
<Text>
|
|
119
|
+
This drawer slides in from the {placement}.
|
|
120
|
+
</Text>
|
|
121
|
+
</DrawerBody>
|
|
122
|
+
<DrawerFooter>
|
|
123
|
+
<Button onPress={() => setIsOpen(false)}>Close</Button>
|
|
124
|
+
</DrawerFooter>
|
|
125
|
+
</Drawer>
|
|
126
|
+
</VStack>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const Placement: Story = {
|
|
131
|
+
render: () => <PlacementDemo />,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const SizeDemo = () => {
|
|
135
|
+
const [size, setSize] = useState<'sm' | 'md' | 'lg' | 'xl' | 'full'>('md');
|
|
136
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<VStack space={spacing.lg}>
|
|
140
|
+
<Text weight="semiBold">Drawer Sizes</Text>
|
|
141
|
+
<HStack space={spacing.sm} wrap>
|
|
142
|
+
{(['sm', 'md', 'lg', 'xl', 'full'] as const).map((s) => (
|
|
143
|
+
<Button
|
|
144
|
+
key={s}
|
|
145
|
+
variant={size === s ? 'primary' : 'secondary'}
|
|
146
|
+
size="sm"
|
|
147
|
+
onPress={() => {
|
|
148
|
+
setSize(s);
|
|
149
|
+
setIsOpen(true);
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
{s.toUpperCase()}
|
|
153
|
+
</Button>
|
|
154
|
+
))}
|
|
155
|
+
</HStack>
|
|
156
|
+
<Drawer
|
|
157
|
+
isOpen={isOpen}
|
|
158
|
+
onClose={() => setIsOpen(false)}
|
|
159
|
+
size={size}
|
|
160
|
+
>
|
|
161
|
+
<DrawerHeader>Size: {size.toUpperCase()}</DrawerHeader>
|
|
162
|
+
<DrawerBody>
|
|
163
|
+
<Text>
|
|
164
|
+
This drawer has size "{size}".
|
|
165
|
+
</Text>
|
|
166
|
+
</DrawerBody>
|
|
167
|
+
<DrawerFooter>
|
|
168
|
+
<Button onPress={() => setIsOpen(false)}>Close</Button>
|
|
169
|
+
</DrawerFooter>
|
|
170
|
+
</Drawer>
|
|
171
|
+
</VStack>
|
|
172
|
+
);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const Sizes: Story = {
|
|
176
|
+
render: () => <SizeDemo />,
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const NavigationDrawer = () => {
|
|
180
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
181
|
+
|
|
182
|
+
const menuItems = [
|
|
183
|
+
{ icon: '🏠', label: 'Home' },
|
|
184
|
+
{ icon: '📊', label: 'Dashboard' },
|
|
185
|
+
{ icon: '📁', label: 'Projects' },
|
|
186
|
+
{ icon: '👥', label: 'Team' },
|
|
187
|
+
{ icon: '📅', label: 'Calendar' },
|
|
188
|
+
{ icon: '⚙️', label: 'Settings' },
|
|
189
|
+
];
|
|
190
|
+
|
|
191
|
+
return (
|
|
192
|
+
<VStack space={spacing.lg}>
|
|
193
|
+
<Text weight="semiBold">Navigation Drawer</Text>
|
|
194
|
+
<Button onPress={() => setIsOpen(true)}>Open Navigation</Button>
|
|
195
|
+
<Drawer
|
|
196
|
+
isOpen={isOpen}
|
|
197
|
+
onClose={() => setIsOpen(false)}
|
|
198
|
+
placement="left"
|
|
199
|
+
size="sm"
|
|
200
|
+
>
|
|
201
|
+
<DrawerBody>
|
|
202
|
+
<VStack space={spacing.xs}>
|
|
203
|
+
<Box py={spacing.lg}>
|
|
204
|
+
<Text weight="bold">My App</Text>
|
|
205
|
+
</Box>
|
|
206
|
+
<Divider />
|
|
207
|
+
<VStack space={spacing.xs} style={{ marginTop: spacing.lg }}>
|
|
208
|
+
{menuItems.map((item) => (
|
|
209
|
+
<Box
|
|
210
|
+
key={item.label}
|
|
211
|
+
p={spacing.md}
|
|
212
|
+
rounded="md"
|
|
213
|
+
bg={colors.background.secondary}
|
|
214
|
+
>
|
|
215
|
+
<HStack space={spacing.md}>
|
|
216
|
+
<Text>{item.icon}</Text>
|
|
217
|
+
<Text>{item.label}</Text>
|
|
218
|
+
</HStack>
|
|
219
|
+
</Box>
|
|
220
|
+
))}
|
|
221
|
+
</VStack>
|
|
222
|
+
</VStack>
|
|
223
|
+
</DrawerBody>
|
|
224
|
+
</Drawer>
|
|
225
|
+
</VStack>
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export const Navigation: Story = {
|
|
230
|
+
render: () => <NavigationDrawer />,
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const FormDrawer = () => {
|
|
234
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
235
|
+
|
|
236
|
+
return (
|
|
237
|
+
<VStack space={spacing.lg}>
|
|
238
|
+
<Text weight="semiBold">Form in Drawer</Text>
|
|
239
|
+
<Button onPress={() => setIsOpen(true)}>Add New User</Button>
|
|
240
|
+
<Drawer
|
|
241
|
+
isOpen={isOpen}
|
|
242
|
+
onClose={() => setIsOpen(false)}
|
|
243
|
+
placement="right"
|
|
244
|
+
size="md"
|
|
245
|
+
>
|
|
246
|
+
<DrawerHeader>Add New User</DrawerHeader>
|
|
247
|
+
<DrawerBody>
|
|
248
|
+
<VStack space={spacing.lg}>
|
|
249
|
+
<Input label="First Name" placeholder="Enter first name" />
|
|
250
|
+
<Input label="Last Name" placeholder="Enter last name" />
|
|
251
|
+
<Input label="Email" placeholder="user@example.com" keyboardType="email-address" />
|
|
252
|
+
<Input label="Phone" placeholder="+1 (555) 000-0000" keyboardType="phone-pad" />
|
|
253
|
+
</VStack>
|
|
254
|
+
</DrawerBody>
|
|
255
|
+
<DrawerFooter>
|
|
256
|
+
<Button variant="ghost" onPress={() => setIsOpen(false)}>
|
|
257
|
+
Cancel
|
|
258
|
+
</Button>
|
|
259
|
+
<Button onPress={() => setIsOpen(false)}>
|
|
260
|
+
Add User
|
|
261
|
+
</Button>
|
|
262
|
+
</DrawerFooter>
|
|
263
|
+
</Drawer>
|
|
264
|
+
</VStack>
|
|
265
|
+
);
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const WithForm: Story = {
|
|
269
|
+
render: () => <FormDrawer />,
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const FilterDrawer = () => {
|
|
273
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
274
|
+
|
|
275
|
+
return (
|
|
276
|
+
<VStack space={spacing.lg}>
|
|
277
|
+
<Text weight="semiBold">Filter Drawer (Bottom)</Text>
|
|
278
|
+
<Button onPress={() => setIsOpen(true)}>Show Filters</Button>
|
|
279
|
+
<Drawer
|
|
280
|
+
isOpen={isOpen}
|
|
281
|
+
onClose={() => setIsOpen(false)}
|
|
282
|
+
placement="bottom"
|
|
283
|
+
size="md"
|
|
284
|
+
>
|
|
285
|
+
<DrawerHeader>Filters</DrawerHeader>
|
|
286
|
+
<DrawerBody>
|
|
287
|
+
<VStack space={spacing.lg}>
|
|
288
|
+
<Text weight="medium">Category</Text>
|
|
289
|
+
<HStack space={spacing.sm} wrap>
|
|
290
|
+
{['All', 'Electronics', 'Clothing', 'Home', 'Sports'].map((cat) => (
|
|
291
|
+
<Box key={cat} p={spacing.sm} bg={colors.feedback.info.background} rounded="full">
|
|
292
|
+
<Text variant="small">{cat}</Text>
|
|
293
|
+
</Box>
|
|
294
|
+
))}
|
|
295
|
+
</HStack>
|
|
296
|
+
<Divider />
|
|
297
|
+
<Text weight="medium">Price Range</Text>
|
|
298
|
+
<HStack space={spacing.sm}>
|
|
299
|
+
<Input placeholder="Min" style={{ flex: 1 }} />
|
|
300
|
+
<Text>-</Text>
|
|
301
|
+
<Input placeholder="Max" style={{ flex: 1 }} />
|
|
302
|
+
</HStack>
|
|
303
|
+
<Divider />
|
|
304
|
+
<Text weight="medium">Rating</Text>
|
|
305
|
+
<HStack space={spacing.sm}>
|
|
306
|
+
{['⭐', '⭐⭐', '⭐⭐⭐', '⭐⭐⭐⭐', '⭐⭐⭐⭐⭐'].map((rating, i) => (
|
|
307
|
+
<Box key={i} p={spacing.xs} bg={colors.feedback.warning.background} rounded="md">
|
|
308
|
+
<Text variant="small">{rating}</Text>
|
|
309
|
+
</Box>
|
|
310
|
+
))}
|
|
311
|
+
</HStack>
|
|
312
|
+
</VStack>
|
|
313
|
+
</DrawerBody>
|
|
314
|
+
<DrawerFooter>
|
|
315
|
+
<Button variant="ghost" onPress={() => setIsOpen(false)}>
|
|
316
|
+
Clear All
|
|
317
|
+
</Button>
|
|
318
|
+
<Button onPress={() => setIsOpen(false)}>
|
|
319
|
+
Apply Filters
|
|
320
|
+
</Button>
|
|
321
|
+
</DrawerFooter>
|
|
322
|
+
</Drawer>
|
|
323
|
+
</VStack>
|
|
324
|
+
);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
export const Filters: Story = {
|
|
328
|
+
render: () => <FilterDrawer />,
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const DetailDrawer = () => {
|
|
332
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
333
|
+
|
|
334
|
+
return (
|
|
335
|
+
<VStack space={spacing.lg}>
|
|
336
|
+
<Text weight="semiBold">Detail Panel</Text>
|
|
337
|
+
<Button onPress={() => setIsOpen(true)}>View Details</Button>
|
|
338
|
+
<Drawer
|
|
339
|
+
isOpen={isOpen}
|
|
340
|
+
onClose={() => setIsOpen(false)}
|
|
341
|
+
placement="right"
|
|
342
|
+
size="lg"
|
|
343
|
+
>
|
|
344
|
+
<DrawerHeader>Order Details</DrawerHeader>
|
|
345
|
+
<DrawerBody>
|
|
346
|
+
<VStack space={spacing.lg}>
|
|
347
|
+
<Box p={spacing.lg} bg={colors.background.secondary} rounded="lg">
|
|
348
|
+
<VStack space={spacing.sm}>
|
|
349
|
+
<HStack justifyContent="space-between">
|
|
350
|
+
<Text color={colors.text.secondary}>Order ID</Text>
|
|
351
|
+
<Text weight="medium">#ORD-12345</Text>
|
|
352
|
+
</HStack>
|
|
353
|
+
<HStack justifyContent="space-between">
|
|
354
|
+
<Text color={colors.text.secondary}>Date</Text>
|
|
355
|
+
<Text weight="medium">Jan 15, 2024</Text>
|
|
356
|
+
</HStack>
|
|
357
|
+
<HStack justifyContent="space-between">
|
|
358
|
+
<Text color={colors.text.secondary}>Status</Text>
|
|
359
|
+
<Box px={spacing.sm} py={spacing.xs} bg={colors.feedback.success.background} rounded="full">
|
|
360
|
+
<Text variant="small" color={colors.feedback.success.content}>Completed</Text>
|
|
361
|
+
</Box>
|
|
362
|
+
</HStack>
|
|
363
|
+
</VStack>
|
|
364
|
+
</Box>
|
|
365
|
+
<Divider />
|
|
366
|
+
<Text weight="semiBold">Items</Text>
|
|
367
|
+
{[
|
|
368
|
+
{ name: 'Product A', qty: 2, price: '$25.00' },
|
|
369
|
+
{ name: 'Product B', qty: 1, price: '$45.00' },
|
|
370
|
+
{ name: 'Product C', qty: 3, price: '$15.00' },
|
|
371
|
+
].map((item, i) => (
|
|
372
|
+
<HStack key={i} justifyContent="space-between" alignItems="center">
|
|
373
|
+
<VStack space={2}>
|
|
374
|
+
<Text>{item.name}</Text>
|
|
375
|
+
<Text variant="small" color={colors.text.secondary}>Qty: {item.qty}</Text>
|
|
376
|
+
</VStack>
|
|
377
|
+
<Text weight="medium">{item.price}</Text>
|
|
378
|
+
</HStack>
|
|
379
|
+
))}
|
|
380
|
+
<Divider />
|
|
381
|
+
<HStack justifyContent="space-between">
|
|
382
|
+
<Text weight="semiBold">Total</Text>
|
|
383
|
+
<Text weight="bold">$140.00</Text>
|
|
384
|
+
</HStack>
|
|
385
|
+
</VStack>
|
|
386
|
+
</DrawerBody>
|
|
387
|
+
<DrawerFooter>
|
|
388
|
+
<Button variant="ghost" onPress={() => setIsOpen(false)}>
|
|
389
|
+
Close
|
|
390
|
+
</Button>
|
|
391
|
+
<Button onPress={() => setIsOpen(false)}>
|
|
392
|
+
Print Receipt
|
|
393
|
+
</Button>
|
|
394
|
+
</DrawerFooter>
|
|
395
|
+
</Drawer>
|
|
396
|
+
</VStack>
|
|
397
|
+
);
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export const DetailPanel: Story = {
|
|
401
|
+
render: () => <DetailDrawer />,
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Styles using design system tokens
|
|
406
|
+
*/
|
|
407
|
+
const styles = StyleSheet.create({
|
|
408
|
+
container: {
|
|
409
|
+
padding: spacing.lg,
|
|
410
|
+
backgroundColor: colors.background.default,
|
|
411
|
+
borderRadius: borderRadius.lg,
|
|
412
|
+
},
|
|
413
|
+
});
|
|
414
|
+
|