@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,224 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Divider } from './Divider';
|
|
3
|
+
import { VStack } from '../VStack';
|
|
4
|
+
import { HStack } from '../HStack';
|
|
5
|
+
import { Box } from '../Box';
|
|
6
|
+
import { Text } from '../Text';
|
|
7
|
+
import { colors, spacing, borderRadius, elevation } from '../../styles/tokens';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof Divider> = {
|
|
10
|
+
title: 'Layout/Divider',
|
|
11
|
+
component: Divider,
|
|
12
|
+
argTypes: {
|
|
13
|
+
orientation: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['horizontal', 'vertical'],
|
|
16
|
+
},
|
|
17
|
+
variant: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['solid', 'dashed', 'dotted'],
|
|
20
|
+
},
|
|
21
|
+
thickness: { control: 'number' },
|
|
22
|
+
color: { control: 'color' },
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
orientation: 'horizontal',
|
|
26
|
+
variant: 'solid',
|
|
27
|
+
thickness: 1,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj<typeof Divider>;
|
|
34
|
+
|
|
35
|
+
export const Default: Story = {
|
|
36
|
+
render: (args) => (
|
|
37
|
+
<VStack space={spacing.lg}>
|
|
38
|
+
<Text>Content Above</Text>
|
|
39
|
+
<Divider {...args} />
|
|
40
|
+
<Text>Content Below</Text>
|
|
41
|
+
</VStack>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Horizontal: Story = {
|
|
46
|
+
render: () => (
|
|
47
|
+
<VStack space={spacing.lg}>
|
|
48
|
+
<Text weight="semiBold">Horizontal Dividers</Text>
|
|
49
|
+
<Box p={spacing.lg} bg={colors.background.secondary} rounded="md">
|
|
50
|
+
<VStack space={spacing.md}>
|
|
51
|
+
<Text>Section 1</Text>
|
|
52
|
+
<Divider />
|
|
53
|
+
<Text>Section 2</Text>
|
|
54
|
+
<Divider />
|
|
55
|
+
<Text>Section 3</Text>
|
|
56
|
+
</VStack>
|
|
57
|
+
</Box>
|
|
58
|
+
</VStack>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const Vertical: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<VStack space={spacing.lg}>
|
|
65
|
+
<Text weight="semiBold">Vertical Dividers</Text>
|
|
66
|
+
<Box p={spacing.lg} bg={colors.background.secondary} rounded="md">
|
|
67
|
+
<HStack space={spacing.md} style={{ height: 60 }} alignItems="center">
|
|
68
|
+
<Text>Item 1</Text>
|
|
69
|
+
<Divider orientation="vertical" />
|
|
70
|
+
<Text>Item 2</Text>
|
|
71
|
+
<Divider orientation="vertical" />
|
|
72
|
+
<Text>Item 3</Text>
|
|
73
|
+
</HStack>
|
|
74
|
+
</Box>
|
|
75
|
+
</VStack>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const Variants: Story = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<VStack space={spacing.xl}>
|
|
82
|
+
<Text weight="semiBold">Divider Variants</Text>
|
|
83
|
+
<VStack space={spacing.lg}>
|
|
84
|
+
<VStack space={spacing.sm}>
|
|
85
|
+
<Text size="sm" color={colors.text.secondary}>Solid</Text>
|
|
86
|
+
<Divider variant="solid" />
|
|
87
|
+
</VStack>
|
|
88
|
+
<VStack space={spacing.sm}>
|
|
89
|
+
<Text size="sm" color={colors.text.secondary}>Dashed</Text>
|
|
90
|
+
<Divider variant="dashed" />
|
|
91
|
+
</VStack>
|
|
92
|
+
<VStack space={spacing.sm}>
|
|
93
|
+
<Text size="sm" color={colors.text.secondary}>Dotted</Text>
|
|
94
|
+
<Divider variant="dotted" />
|
|
95
|
+
</VStack>
|
|
96
|
+
</VStack>
|
|
97
|
+
</VStack>
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const Thickness: Story = {
|
|
102
|
+
render: () => (
|
|
103
|
+
<VStack space={spacing.xl}>
|
|
104
|
+
<Text weight="semiBold">Divider Thickness</Text>
|
|
105
|
+
<VStack space={spacing.lg}>
|
|
106
|
+
<VStack space={spacing.sm}>
|
|
107
|
+
<Text size="sm" color={colors.text.secondary}>thickness=1</Text>
|
|
108
|
+
<Divider thickness={1} />
|
|
109
|
+
</VStack>
|
|
110
|
+
<VStack space={spacing.sm}>
|
|
111
|
+
<Text size="sm" color={colors.text.secondary}>thickness=2</Text>
|
|
112
|
+
<Divider thickness={2} />
|
|
113
|
+
</VStack>
|
|
114
|
+
<VStack space={spacing.sm}>
|
|
115
|
+
<Text size="sm" color={colors.text.secondary}>thickness=3</Text>
|
|
116
|
+
<Divider thickness={3} />
|
|
117
|
+
</VStack>
|
|
118
|
+
<VStack space={spacing.sm}>
|
|
119
|
+
<Text size="sm" color={colors.text.secondary}>thickness=4</Text>
|
|
120
|
+
<Divider thickness={4} />
|
|
121
|
+
</VStack>
|
|
122
|
+
</VStack>
|
|
123
|
+
</VStack>
|
|
124
|
+
),
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const Colors: Story = {
|
|
128
|
+
render: () => (
|
|
129
|
+
<VStack space={spacing.xl}>
|
|
130
|
+
<Text weight="semiBold">Colored Dividers</Text>
|
|
131
|
+
<VStack space={spacing.lg}>
|
|
132
|
+
<VStack space={spacing.sm}>
|
|
133
|
+
<Text size="sm" color={colors.text.secondary}>Blue</Text>
|
|
134
|
+
<Divider color={colors.brand.blue} thickness={2} />
|
|
135
|
+
</VStack>
|
|
136
|
+
<VStack space={spacing.sm}>
|
|
137
|
+
<Text size="sm" color={colors.text.secondary}>Green</Text>
|
|
138
|
+
<Divider color={colors.feedback.success.content} thickness={2} />
|
|
139
|
+
</VStack>
|
|
140
|
+
<VStack space={spacing.sm}>
|
|
141
|
+
<Text size="sm" color={colors.text.secondary}>Red</Text>
|
|
142
|
+
<Divider color={colors.feedback.error.content} thickness={2} />
|
|
143
|
+
</VStack>
|
|
144
|
+
<VStack space={spacing.sm}>
|
|
145
|
+
<Text size="sm" color={colors.text.secondary}>Purple</Text>
|
|
146
|
+
<Divider color={colors.badge.purple} thickness={2} />
|
|
147
|
+
</VStack>
|
|
148
|
+
</VStack>
|
|
149
|
+
</VStack>
|
|
150
|
+
),
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const InCard: Story = {
|
|
154
|
+
render: () => (
|
|
155
|
+
<VStack space={spacing.lg}>
|
|
156
|
+
<Text weight="semiBold">Divider in Card</Text>
|
|
157
|
+
<Box p={0} bg={colors.white} rounded="lg" shadow="10" overflow="hidden">
|
|
158
|
+
<Box p={spacing.lg}>
|
|
159
|
+
<Text weight="semiBold">Card Title</Text>
|
|
160
|
+
<Text size="sm" color={colors.text.secondary}>Card subtitle or description</Text>
|
|
161
|
+
</Box>
|
|
162
|
+
<Divider />
|
|
163
|
+
<Box p={spacing.lg}>
|
|
164
|
+
<Text size="sm">
|
|
165
|
+
This is the main content area of the card. It contains important information
|
|
166
|
+
that users need to see.
|
|
167
|
+
</Text>
|
|
168
|
+
</Box>
|
|
169
|
+
<Divider />
|
|
170
|
+
<Box p={spacing.md}>
|
|
171
|
+
<HStack justifyContent="flex-end" space={spacing.sm}>
|
|
172
|
+
<Text size="sm" color={colors.brand.blue}>Cancel</Text>
|
|
173
|
+
<Text size="sm" color={colors.brand.blue}>Save</Text>
|
|
174
|
+
</HStack>
|
|
175
|
+
</Box>
|
|
176
|
+
</Box>
|
|
177
|
+
</VStack>
|
|
178
|
+
),
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export const InList: Story = {
|
|
182
|
+
render: () => (
|
|
183
|
+
<VStack space={spacing.lg}>
|
|
184
|
+
<Text weight="semiBold">Divider in List</Text>
|
|
185
|
+
<Box bg={colors.white} rounded="lg" shadow="10" overflow="hidden">
|
|
186
|
+
{['John Doe', 'Jane Smith', 'Bob Johnson', 'Alice Brown'].map((name, index, arr) => (
|
|
187
|
+
<Box key={name}>
|
|
188
|
+
<Box p={spacing.lg}>
|
|
189
|
+
<HStack space={spacing.md} alignItems="center">
|
|
190
|
+
<Box w={40} h={40} bg={colors.brand.blue + '20'} rounded="full" alignItems="center" justifyContent="center">
|
|
191
|
+
<Text weight="semiBold">{name.charAt(0)}</Text>
|
|
192
|
+
</Box>
|
|
193
|
+
<VStack space={spacing.xs}>
|
|
194
|
+
<Text weight="medium">{name}</Text>
|
|
195
|
+
<Text size="sm" color={colors.text.secondary}>user@email.com</Text>
|
|
196
|
+
</VStack>
|
|
197
|
+
</HStack>
|
|
198
|
+
</Box>
|
|
199
|
+
{index < arr.length - 1 && <Divider />}
|
|
200
|
+
</Box>
|
|
201
|
+
))}
|
|
202
|
+
</Box>
|
|
203
|
+
</VStack>
|
|
204
|
+
),
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const WithText: Story = {
|
|
208
|
+
render: () => (
|
|
209
|
+
<VStack space={spacing.lg}>
|
|
210
|
+
<Text weight="semiBold">Divider with Text (Custom)</Text>
|
|
211
|
+
<HStack alignItems="center" space={spacing.md}>
|
|
212
|
+
<Box flex={1}><Divider /></Box>
|
|
213
|
+
<Text size="sm" color={colors.text.secondary}>OR</Text>
|
|
214
|
+
<Box flex={1}><Divider /></Box>
|
|
215
|
+
</HStack>
|
|
216
|
+
<HStack alignItems="center" space={spacing.md}>
|
|
217
|
+
<Box flex={1}><Divider /></Box>
|
|
218
|
+
<Text size="sm" color={colors.text.secondary}>Continue with</Text>
|
|
219
|
+
<Box flex={1}><Divider /></Box>
|
|
220
|
+
</HStack>
|
|
221
|
+
</VStack>
|
|
222
|
+
),
|
|
223
|
+
};
|
|
224
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Divider Component
|
|
3
|
+
* Visual separator between content sections
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { forwardRef } from 'react';
|
|
7
|
+
import { View, ViewProps, StyleSheet } from 'react-native';
|
|
8
|
+
import { colors } from '../../styles/tokens';
|
|
9
|
+
|
|
10
|
+
export interface DividerProps extends ViewProps {
|
|
11
|
+
/** Orientation */
|
|
12
|
+
orientation?: 'horizontal' | 'vertical';
|
|
13
|
+
/** Thickness */
|
|
14
|
+
thickness?: number;
|
|
15
|
+
/** Color */
|
|
16
|
+
color?: string;
|
|
17
|
+
/** Variant */
|
|
18
|
+
variant?: 'solid' | 'dashed' | 'dotted';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Divider = forwardRef<View, DividerProps>(
|
|
22
|
+
(
|
|
23
|
+
{
|
|
24
|
+
style,
|
|
25
|
+
orientation = 'horizontal',
|
|
26
|
+
thickness = 1,
|
|
27
|
+
color,
|
|
28
|
+
variant = 'solid',
|
|
29
|
+
...props
|
|
30
|
+
},
|
|
31
|
+
ref
|
|
32
|
+
) => {
|
|
33
|
+
const dividerColor = color || colors.border.default;
|
|
34
|
+
|
|
35
|
+
const orientationStyle =
|
|
36
|
+
orientation === 'horizontal'
|
|
37
|
+
? { height: thickness, width: '100%' as const }
|
|
38
|
+
: { width: thickness, height: '100%' as const };
|
|
39
|
+
|
|
40
|
+
const variantStyle =
|
|
41
|
+
variant === 'dashed'
|
|
42
|
+
? { borderStyle: 'dashed' as const }
|
|
43
|
+
: variant === 'dotted'
|
|
44
|
+
? { borderStyle: 'dotted' as const }
|
|
45
|
+
: { borderStyle: 'solid' as const };
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<View
|
|
49
|
+
ref={ref}
|
|
50
|
+
style={[
|
|
51
|
+
styles.divider,
|
|
52
|
+
orientationStyle,
|
|
53
|
+
{ backgroundColor: variant === 'solid' ? dividerColor : 'transparent' },
|
|
54
|
+
variant !== 'solid' && {
|
|
55
|
+
borderColor: dividerColor,
|
|
56
|
+
borderWidth: thickness,
|
|
57
|
+
...variantStyle,
|
|
58
|
+
},
|
|
59
|
+
style,
|
|
60
|
+
]}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
Divider.displayName = 'Divider';
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
divider: {
|
|
71
|
+
backgroundColor: colors.border.default,
|
|
72
|
+
},
|
|
73
|
+
});
|