@idealyst/components 1.0.83 → 1.0.84

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.
Files changed (316) hide show
  1. package/CLAUDE.md +199 -232
  2. package/README.md +5 -5
  3. package/package.json +20 -2
  4. package/plugin/README.md +272 -0
  5. package/plugin/test-cases.jsx +112 -0
  6. package/plugin/web-legacy.js +320 -0
  7. package/plugin/web.js +422 -124
  8. package/src/Accordion/Accordion.native.tsx +182 -0
  9. package/src/Accordion/Accordion.styles.tsx +260 -0
  10. package/src/Accordion/Accordion.web.tsx +147 -0
  11. package/src/Accordion/index.native.tsx +3 -0
  12. package/src/Accordion/index.ts +3 -0
  13. package/src/Accordion/index.web.tsx +3 -0
  14. package/src/Accordion/types.ts +23 -0
  15. package/src/ActivityIndicator/ActivityIndicator.native.tsx +17 -12
  16. package/src/ActivityIndicator/ActivityIndicator.styles.tsx +83 -109
  17. package/src/ActivityIndicator/ActivityIndicator.web.tsx +23 -17
  18. package/src/ActivityIndicator/index.ts +5 -2
  19. package/src/ActivityIndicator/index.web.ts +5 -2
  20. package/src/ActivityIndicator/types.ts +15 -10
  21. package/src/Alert/Alert.native.tsx +113 -0
  22. package/src/Alert/Alert.styles.tsx +304 -0
  23. package/src/Alert/Alert.web.tsx +123 -0
  24. package/src/Alert/index.native.ts +5 -0
  25. package/src/Alert/index.ts +5 -0
  26. package/src/Alert/index.web.ts +5 -0
  27. package/src/Alert/types.ts +21 -0
  28. package/src/Avatar/Avatar.native.tsx +8 -6
  29. package/src/Avatar/Avatar.styles.tsx +64 -58
  30. package/src/Avatar/Avatar.web.tsx +13 -8
  31. package/src/Avatar/index.ts +5 -2
  32. package/src/Avatar/index.web.ts +5 -2
  33. package/src/Avatar/types.ts +19 -13
  34. package/src/Badge/Badge.native.tsx +59 -14
  35. package/src/Badge/Badge.styles.tsx +125 -139
  36. package/src/Badge/Badge.web.tsx +72 -16
  37. package/src/Badge/index.ts +5 -2
  38. package/src/Badge/index.web.ts +5 -2
  39. package/src/Badge/types.ts +23 -11
  40. package/src/Breadcrumb/Breadcrumb.native.tsx +225 -0
  41. package/src/Breadcrumb/Breadcrumb.styles.tsx +234 -0
  42. package/src/Breadcrumb/Breadcrumb.web.tsx +268 -0
  43. package/src/Breadcrumb/index.native.ts +5 -0
  44. package/src/Breadcrumb/index.ts +5 -0
  45. package/src/Breadcrumb/index.web.ts +5 -0
  46. package/src/Breadcrumb/types.ts +56 -0
  47. package/src/Button/Button.native.tsx +75 -24
  48. package/src/Button/Button.styles.tsx +248 -205
  49. package/src/Button/Button.web.tsx +82 -25
  50. package/src/Button/index.ts +5 -5
  51. package/src/Button/index.web.ts +5 -3
  52. package/src/Button/types.ts +32 -15
  53. package/src/Card/Card.native.tsx +14 -11
  54. package/src/Card/Card.styles.tsx +146 -220
  55. package/src/Card/Card.web.tsx +20 -21
  56. package/src/Card/index.ts +5 -5
  57. package/src/Card/index.web.ts +5 -3
  58. package/src/Card/types.ts +24 -17
  59. package/src/Checkbox/Checkbox.native.tsx +24 -34
  60. package/src/Checkbox/Checkbox.styles.tsx +223 -275
  61. package/src/Checkbox/Checkbox.web.tsx +30 -37
  62. package/src/Checkbox/index.ts +5 -5
  63. package/src/Checkbox/index.web.ts +5 -3
  64. package/src/Checkbox/types.ts +26 -20
  65. package/src/Chip/Chip.native.tsx +126 -0
  66. package/src/Chip/Chip.styles.tsx +138 -0
  67. package/src/Chip/Chip.web.tsx +154 -0
  68. package/src/Chip/index.native.ts +5 -0
  69. package/src/Chip/index.ts +5 -0
  70. package/src/Chip/index.web.ts +5 -0
  71. package/src/Chip/types.ts +51 -0
  72. package/src/Dialog/Dialog.native.tsx +65 -12
  73. package/src/Dialog/Dialog.styles.tsx +154 -136
  74. package/src/Dialog/Dialog.web.tsx +16 -11
  75. package/src/Dialog/index.ts +5 -2
  76. package/src/Dialog/index.web.ts +5 -2
  77. package/src/Dialog/types.ts +22 -16
  78. package/src/Divider/Divider.native.tsx +19 -14
  79. package/src/Divider/Divider.styles.tsx +273 -595
  80. package/src/Divider/Divider.web.tsx +19 -12
  81. package/src/Divider/index.ts +5 -5
  82. package/src/Divider/index.web.ts +5 -3
  83. package/src/Divider/types.ts +28 -19
  84. package/src/Icon/Icon.native.tsx +17 -24
  85. package/src/Icon/Icon.styles.tsx +64 -48
  86. package/src/Icon/Icon.web.tsx +14 -11
  87. package/src/Icon/IconSvg/IconSvg.native.tsx +42 -0
  88. package/src/Icon/IconSvg/IconSvg.web.tsx +40 -0
  89. package/src/Icon/IconSvg/index.native.ts +1 -0
  90. package/src/Icon/IconSvg/index.ts +1 -0
  91. package/src/Icon/icon-resolver.native.ts +27 -0
  92. package/src/Icon/icon-resolver.ts +70 -0
  93. package/src/Icon/index.ts +5 -5
  94. package/src/Icon/index.web.ts +5 -3
  95. package/src/Icon/types.ts +17 -11
  96. package/src/Image/Image.native.tsx +86 -0
  97. package/src/Image/Image.styles.tsx +57 -0
  98. package/src/Image/Image.web.tsx +92 -0
  99. package/src/Image/index.native.ts +5 -0
  100. package/src/Image/index.ts +5 -0
  101. package/src/Image/types.ts +21 -0
  102. package/src/Input/Input.native.tsx +103 -26
  103. package/src/Input/Input.styles.tsx +240 -177
  104. package/src/Input/Input.web.tsx +141 -38
  105. package/src/Input/index.ts +5 -5
  106. package/src/Input/index.web.ts +5 -3
  107. package/src/Input/types.ts +43 -20
  108. package/src/List/List.native.tsx +56 -0
  109. package/src/List/List.styles.tsx +257 -0
  110. package/src/List/List.web.tsx +43 -0
  111. package/src/List/ListContext.tsx +16 -0
  112. package/src/List/ListItem.native.tsx +111 -0
  113. package/src/List/ListItem.web.tsx +110 -0
  114. package/src/List/ListSection.native.tsx +31 -0
  115. package/src/List/ListSection.web.tsx +33 -0
  116. package/src/List/index.native.tsx +5 -0
  117. package/src/List/index.ts +5 -0
  118. package/src/List/index.web.tsx +5 -0
  119. package/src/List/types.ts +42 -0
  120. package/src/Menu/Menu.native.tsx +150 -0
  121. package/src/Menu/Menu.styles.tsx +185 -0
  122. package/src/Menu/Menu.web.tsx +99 -0
  123. package/src/Menu/MenuItem.native.tsx +66 -0
  124. package/src/Menu/MenuItem.styles.tsx +119 -0
  125. package/src/Menu/MenuItem.web.tsx +67 -0
  126. package/src/Menu/index.native.ts +3 -0
  127. package/src/Menu/index.ts +3 -0
  128. package/src/Menu/index.web.ts +3 -0
  129. package/src/Menu/types.ts +30 -0
  130. package/src/Popover/Popover.native.tsx +102 -32
  131. package/src/Popover/Popover.styles.tsx +100 -67
  132. package/src/Popover/Popover.web.tsx +36 -260
  133. package/src/Popover/index.ts +5 -2
  134. package/src/Popover/index.web.ts +5 -2
  135. package/src/Popover/types.ts +14 -13
  136. package/src/Pressable/Pressable.native.tsx +7 -6
  137. package/src/Pressable/Pressable.web.tsx +8 -6
  138. package/src/Pressable/index.ts +5 -2
  139. package/src/Pressable/index.web.ts +5 -2
  140. package/src/Pressable/types.ts +11 -10
  141. package/src/Progress/Progress.native.tsx +179 -0
  142. package/src/Progress/Progress.styles.tsx +164 -0
  143. package/src/Progress/Progress.web.tsx +144 -0
  144. package/src/Progress/index.native.ts +1 -0
  145. package/src/Progress/index.ts +5 -0
  146. package/src/Progress/index.web.ts +5 -0
  147. package/src/Progress/types.ts +21 -0
  148. package/src/RadioButton/RadioButton.native.tsx +88 -0
  149. package/src/RadioButton/RadioButton.styles.tsx +163 -0
  150. package/src/RadioButton/RadioButton.web.tsx +85 -0
  151. package/src/RadioButton/RadioGroup.native.tsx +43 -0
  152. package/src/RadioButton/RadioGroup.web.tsx +49 -0
  153. package/src/RadioButton/index.native.ts +2 -0
  154. package/src/RadioButton/index.ts +2 -0
  155. package/src/RadioButton/index.web.ts +2 -0
  156. package/src/RadioButton/types.ts +29 -0
  157. package/src/SVGImage/SVGImage.native.tsx +9 -7
  158. package/src/SVGImage/SVGImage.styles.tsx +63 -55
  159. package/src/SVGImage/SVGImage.web.tsx +16 -13
  160. package/src/SVGImage/index.ts +5 -5
  161. package/src/SVGImage/index.web.ts +5 -2
  162. package/src/SVGImage/types.ts +7 -3
  163. package/src/Screen/Screen.native.tsx +43 -17
  164. package/src/Screen/Screen.styles.tsx +58 -54
  165. package/src/Screen/Screen.web.tsx +11 -5
  166. package/src/Screen/index.ts +5 -2
  167. package/src/Screen/index.web.ts +5 -2
  168. package/src/Screen/types.ts +23 -9
  169. package/src/Select/Select.native.tsx +140 -63
  170. package/src/Select/Select.styles.tsx +312 -302
  171. package/src/Select/Select.web.tsx +156 -316
  172. package/src/Select/index.ts +5 -2
  173. package/src/Select/index.web.ts +5 -2
  174. package/src/Select/types.ts +13 -7
  175. package/src/Skeleton/Skeleton.native.tsx +139 -0
  176. package/src/Skeleton/Skeleton.styles.tsx +59 -0
  177. package/src/Skeleton/Skeleton.web.tsx +112 -0
  178. package/src/Skeleton/index.native.ts +4 -0
  179. package/src/Skeleton/index.ts +5 -0
  180. package/src/Skeleton/index.web.ts +5 -0
  181. package/src/Skeleton/types.ts +75 -0
  182. package/src/Slider/Slider.native.tsx +248 -0
  183. package/src/Slider/Slider.styles.tsx +241 -0
  184. package/src/Slider/Slider.web.tsx +226 -0
  185. package/src/Slider/index.native.ts +3 -0
  186. package/src/Slider/index.ts +5 -0
  187. package/src/Slider/index.web.ts +5 -0
  188. package/src/Slider/types.ts +31 -0
  189. package/src/Switch/Switch.native.tsx +131 -0
  190. package/src/Switch/Switch.styles.tsx +169 -0
  191. package/src/Switch/Switch.web.tsx +121 -0
  192. package/src/Switch/index.native.ts +3 -0
  193. package/src/Switch/index.ts +5 -0
  194. package/src/Switch/index.web.ts +5 -0
  195. package/src/Switch/types.ts +21 -0
  196. package/src/TabBar/TabBar.native.tsx +142 -0
  197. package/src/TabBar/TabBar.styles.tsx +399 -0
  198. package/src/TabBar/TabBar.web.tsx +205 -0
  199. package/src/TabBar/index.native.tsx +3 -0
  200. package/src/TabBar/index.ts +3 -0
  201. package/src/TabBar/index.web.tsx +3 -0
  202. package/src/TabBar/types.ts +26 -0
  203. package/src/Table/Table.native.tsx +122 -0
  204. package/src/Table/Table.styles.tsx +283 -0
  205. package/src/Table/Table.web.tsx +112 -0
  206. package/src/Table/index.native.tsx +3 -0
  207. package/src/Table/index.ts +3 -0
  208. package/src/Table/index.web.tsx +3 -0
  209. package/src/Table/types.ts +28 -0
  210. package/src/Text/Text.native.tsx +12 -11
  211. package/src/Text/Text.styles.tsx +76 -64
  212. package/src/Text/Text.web.tsx +14 -9
  213. package/src/Text/index.ts +5 -5
  214. package/src/Text/index.web.ts +5 -3
  215. package/src/Text/types.ts +20 -13
  216. package/src/TextArea/TextArea.native.tsx +134 -0
  217. package/src/TextArea/TextArea.styles.tsx +175 -0
  218. package/src/TextArea/TextArea.web.tsx +156 -0
  219. package/src/TextArea/index.native.ts +3 -0
  220. package/src/TextArea/index.ts +3 -0
  221. package/src/TextArea/index.web.ts +3 -0
  222. package/src/TextArea/types.ts +30 -0
  223. package/src/Tooltip/Tooltip.native.tsx +165 -0
  224. package/src/Tooltip/Tooltip.styles.tsx +73 -0
  225. package/src/Tooltip/Tooltip.web.tsx +87 -0
  226. package/src/Tooltip/index.native.ts +3 -0
  227. package/src/Tooltip/index.ts +3 -0
  228. package/src/Tooltip/types.ts +18 -0
  229. package/src/Video/Video.native.tsx +105 -0
  230. package/src/Video/Video.styles.tsx +39 -0
  231. package/src/Video/Video.web.tsx +115 -0
  232. package/src/Video/index.native.ts +5 -0
  233. package/src/Video/index.ts +5 -0
  234. package/src/Video/types.ts +29 -0
  235. package/src/View/View.native.tsx +9 -14
  236. package/src/View/View.styles.tsx +101 -93
  237. package/src/View/View.web.tsx +16 -17
  238. package/src/View/index.ts +5 -5
  239. package/src/View/index.web.ts +5 -3
  240. package/src/View/types.ts +29 -21
  241. package/src/examples/AccordionExamples.tsx +126 -0
  242. package/src/examples/AlertExamples.tsx +280 -0
  243. package/src/examples/AvatarExamples.tsx +23 -23
  244. package/src/examples/BadgeExamples.tsx +109 -41
  245. package/src/examples/BreadcrumbExamples.tsx +312 -0
  246. package/src/examples/ButtonExamples.tsx +160 -33
  247. package/src/examples/CardExamples.tsx +40 -40
  248. package/src/examples/CheckboxExamples.tsx +12 -12
  249. package/src/examples/ChipExamples.tsx +197 -0
  250. package/src/examples/DialogExamples.tsx +22 -22
  251. package/src/examples/DividerExamples.tsx +49 -49
  252. package/src/examples/IconExamples.tsx +270 -54
  253. package/src/examples/ImageExamples.tsx +174 -0
  254. package/src/examples/InputExamples.tsx +75 -17
  255. package/src/examples/ListExamples.tsx +288 -0
  256. package/src/examples/MenuExamples.tsx +144 -0
  257. package/src/examples/PopoverExamples.tsx +69 -73
  258. package/src/examples/ProgressExamples.tsx +137 -0
  259. package/src/examples/RadioButtonExamples.tsx +161 -0
  260. package/src/examples/SVGImageExamples.tsx +19 -17
  261. package/src/examples/ScreenExamples.tsx +31 -31
  262. package/src/examples/SelectExamples.tsx +67 -67
  263. package/src/examples/SkeletonExamples.tsx +206 -0
  264. package/src/examples/SliderExamples.tsx +200 -0
  265. package/src/examples/SwitchExamples.tsx +182 -0
  266. package/src/examples/TabBarExamples.tsx +143 -0
  267. package/src/examples/TableExamples.tsx +280 -0
  268. package/src/examples/TextAreaExamples.tsx +173 -0
  269. package/src/examples/TextExamples.tsx +28 -32
  270. package/src/examples/ThemeExtensionExamples.tsx +10 -10
  271. package/src/examples/TooltipExamples.tsx +126 -0
  272. package/src/examples/VideoExamples.tsx +144 -0
  273. package/src/examples/ViewExamples.tsx +64 -56
  274. package/src/examples/index.ts +17 -3
  275. package/src/hooks/useMergeRefs.ts +16 -0
  276. package/src/hooks/useSmartPosition.native.ts +169 -0
  277. package/src/index.native.ts +80 -9
  278. package/src/index.ts +71 -1
  279. package/src/internal/BoundedModalContent.native.tsx +58 -0
  280. package/src/internal/PositionedPortal.tsx +254 -0
  281. package/src/internal/SafeAreaDebugOverlay.native.tsx +173 -0
  282. package/src/unistyles.d.ts +6 -0
  283. package/src/utils/buildSizeVariants.ts +16 -0
  284. package/src/utils/deepMerge.ts +43 -0
  285. package/src/utils/positionUtils.native.ts +280 -0
  286. package/src/utils/styleHelpers.ts +48 -0
  287. package/LLM-ACCESS-GUIDE.md +0 -143
  288. package/src/ActivityIndicator/README.md +0 -132
  289. package/src/Avatar/README.md +0 -139
  290. package/src/Badge/README.md +0 -170
  291. package/src/Button/Button.types.ts +0 -12
  292. package/src/Button/README.md +0 -262
  293. package/src/Card/README.md +0 -258
  294. package/src/Checkbox/README.md +0 -102
  295. package/src/Dialog/README.md +0 -210
  296. package/src/Divider/README.md +0 -108
  297. package/src/Icon/README.md +0 -81
  298. package/src/Input/README.md +0 -100
  299. package/src/SVGImage/README.md +0 -209
  300. package/src/Screen/README.md +0 -86
  301. package/src/Select/README.md +0 -166
  302. package/src/Text/README.md +0 -94
  303. package/src/View/README.md +0 -107
  304. package/src/examples/AllExamples.tsx +0 -88
  305. package/src/examples/README.md +0 -136
  306. package/src/examples/ValidationExamples.tsx +0 -95
  307. package/src/examples/extendedTheme.ts +0 -329
  308. package/src/theme/breakpoints.ts +0 -8
  309. package/src/theme/colorResolver.ts +0 -218
  310. package/src/theme/colors.ts +0 -315
  311. package/src/theme/defaultThemes.ts +0 -326
  312. package/src/theme/index.ts +0 -188
  313. package/src/theme/themeBuilder.ts +0 -602
  314. package/src/theme/unistyles.d.ts +0 -6
  315. package/src/theme/variantHelpers.ts +0 -584
  316. package/src/theme/variants.ts +0 -56
@@ -1,602 +1,280 @@
1
1
  import { StyleSheet } from 'react-native-unistyles';
2
+ import { Theme, Intent, CompoundVariants} from '@idealyst/theme';
2
3
 
3
- export const dividerStyles = StyleSheet.create((theme) => ({
4
- divider: {
5
- backgroundColor: theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db',
6
-
7
- variants: {
8
- orientation: {
9
- horizontal: {
10
- width: '100%',
11
- height: 1,
12
- flexDirection: 'row',
13
- },
14
- vertical: {
15
- width: 1,
16
- height: '100%',
17
- flexDirection: 'column',
18
- },
19
- },
20
- thickness: {
21
- thin: {
22
- // Handled by orientation compound variants
23
- },
24
- medium: {
25
- // Handled by orientation compound variants
26
- },
27
- thick: {
28
- // Handled by orientation compound variants
29
- },
30
- },
31
- variant: {
32
- solid: {
33
- // Default solid style
34
- },
35
- dashed: {
36
- // React Native: handled by component logic with segments
37
- backgroundColor: 'transparent',
38
-
39
- _web: {
40
- border: 'none',
41
- backgroundColor: 'transparent',
42
- },
43
- },
44
- dotted: {
45
- // React Native: handled by component logic with segments
46
- backgroundColor: 'transparent',
47
-
48
- _web: {
49
- border: 'none',
50
- backgroundColor: 'transparent',
51
- },
52
- },
53
- },
54
- intent: {
55
- primary: {
56
- backgroundColor: theme.intents?.primary?.main || '#3b82f6',
57
- },
58
- secondary: {
59
- backgroundColor: theme.colors?.border?.primary || theme.palettes?.gray?.[200] || '#e5e7eb',
60
- },
61
- neutral: {
62
- backgroundColor: theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db',
63
- },
64
- success: {
65
- backgroundColor: theme.intents?.success?.main || '#22c55e',
66
- },
67
- error: {
68
- backgroundColor: theme.intents?.error?.main || '#ef4444',
69
- },
70
- warning: {
71
- backgroundColor: theme.intents?.warning?.main || '#f59e0b',
72
- },
73
- info: {
74
- backgroundColor: theme.intents?.info?.main || '#06b6d4',
75
- },
76
- },
77
- length: {
78
- full: {
79
- // Default full length
80
- },
81
- auto: {
82
- // Auto length handled by parent container
83
- },
84
- },
85
- spacing: {
86
- none: {
87
- margin: 0,
88
- },
89
- small: {
90
- // Handled by orientation compound variants
91
- },
92
- medium: {
93
- // Handled by orientation compound variants
94
- },
95
- large: {
96
- // Handled by orientation compound variants
97
- },
98
- },
99
- },
100
-
101
- compoundVariants: [
102
- // Horizontal thickness variants
103
- {
104
- orientation: 'horizontal',
105
- thickness: 'thin',
106
- styles: {
107
- height: 1,
108
- },
109
- },
110
- {
111
- orientation: 'horizontal',
112
- thickness: 'medium',
113
- styles: {
114
- height: 2,
115
- },
116
- },
117
- {
118
- orientation: 'horizontal',
119
- thickness: 'thick',
120
- styles: {
121
- height: 4,
122
- },
123
- },
124
- // Vertical thickness variants
125
- {
126
- orientation: 'vertical',
127
- thickness: 'thin',
128
- styles: {
129
- width: 1,
130
- },
131
- },
132
- {
133
- orientation: 'vertical',
134
- thickness: 'medium',
135
- styles: {
136
- width: 2,
137
- },
138
- },
139
- {
140
- orientation: 'vertical',
141
- thickness: 'thick',
142
- styles: {
143
- width: 4,
144
- },
145
- },
146
- // Horizontal spacing variants
147
- {
148
- orientation: 'horizontal',
149
- spacing: 'small',
150
- styles: {
151
- marginVertical: theme.spacing?.sm || 8,
152
- },
153
- },
154
- {
155
- orientation: 'horizontal',
156
- spacing: 'medium',
157
- styles: {
158
- marginVertical: theme.spacing?.md || 12,
159
- },
160
- },
161
- {
162
- orientation: 'horizontal',
163
- spacing: 'large',
164
- styles: {
165
- marginVertical: theme.spacing?.lg || 16,
166
- },
167
- },
168
- // Vertical spacing variants
169
- {
170
- orientation: 'vertical',
171
- spacing: 'small',
172
- styles: {
173
- marginHorizontal: theme.spacing?.sm || 8,
174
- },
175
- },
176
- {
177
- orientation: 'vertical',
178
- spacing: 'medium',
179
- styles: {
180
- marginHorizontal: theme.spacing?.md || 12,
181
- },
182
- },
183
- {
184
- orientation: 'vertical',
185
- spacing: 'large',
186
- styles: {
187
- marginHorizontal: theme.spacing?.lg || 16,
188
- },
189
- },
190
- // Dashed variant compound styles (web-only, RN handled by component)
191
- {
192
- variant: 'dashed',
193
- orientation: 'horizontal',
194
- styles: {
195
- _web: {
196
- borderTop: `1px dashed ${theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
197
- borderLeft: 'none',
198
- },
199
- },
200
- },
201
- {
202
- variant: 'dashed',
203
- orientation: 'vertical',
204
- styles: {
205
- _web: {
206
- borderLeft: `1px dashed ${theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
207
- borderTop: 'none',
208
- },
209
- },
210
- },
211
- // Dotted variant compound styles (web-only, RN handled by component)
212
- {
213
- variant: 'dotted',
214
- orientation: 'horizontal',
215
- styles: {
216
- _web: {
217
- borderTop: `1px dotted ${theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
218
- borderLeft: 'none',
219
- },
220
- },
221
- },
222
- {
223
- variant: 'dotted',
224
- orientation: 'vertical',
225
- styles: {
226
- _web: {
227
- borderLeft: `1px dotted ${theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db'}`,
228
- borderTop: 'none',
229
- },
230
- },
231
- },
232
- // Intent color compounds for dashed variant
233
- {
234
- variant: 'dashed',
235
- intent: 'primary',
236
- orientation: 'horizontal',
237
- styles: {
238
- borderTopColor: theme.intents?.primary?.main || '#3b82f6',
239
-
240
- _web: {
241
- borderTop: `1px dashed ${theme.intents?.primary?.main || '#3b82f6'}`,
242
- },
243
- },
244
- },
245
- {
246
- variant: 'dashed',
247
- intent: 'primary',
248
- orientation: 'vertical',
249
- styles: {
250
- borderLeftColor: theme.intents?.primary?.main || '#3b82f6',
251
-
252
- _web: {
253
- borderLeft: `1px dashed ${theme.intents?.primary?.main || '#3b82f6'}`,
254
- },
255
- },
256
- },
257
- {
258
- variant: 'dashed',
259
- intent: 'success',
260
- orientation: 'horizontal',
261
- styles: {
262
- borderTopColor: theme.intents?.success?.main || '#22c55e',
263
-
264
- _web: {
265
- borderTop: `1px dashed ${theme.intents?.success?.main || '#22c55e'}`,
266
- },
267
- },
268
- },
269
- {
270
- variant: 'dashed',
271
- intent: 'success',
272
- orientation: 'vertical',
273
- styles: {
274
- borderLeftColor: theme.intents?.success?.main || '#22c55e',
275
-
276
- _web: {
277
- borderLeft: `1px dashed ${theme.intents?.success?.main || '#22c55e'}`,
278
- },
279
- },
280
- },
281
- {
282
- variant: 'dashed',
283
- intent: 'error',
284
- orientation: 'horizontal',
285
- styles: {
286
- borderTopColor: theme.intents?.error?.main || '#ef4444',
287
-
288
- _web: {
289
- borderTop: `1px dashed ${theme.intents?.error?.main || '#ef4444'}`,
290
- },
291
- },
292
- },
293
- {
294
- variant: 'dashed',
295
- intent: 'error',
296
- orientation: 'vertical',
297
- styles: {
298
- borderLeftColor: theme.intents?.error?.main || '#ef4444',
299
-
300
- _web: {
301
- borderLeft: `1px dashed ${theme.intents?.error?.main || '#ef4444'}`,
302
- },
303
- },
304
- },
305
- {
306
- variant: 'dashed',
307
- intent: 'warning',
308
- orientation: 'horizontal',
309
- styles: {
310
- borderTopColor: theme.intents?.warning?.main || '#f59e0b',
311
-
312
- _web: {
313
- borderTop: `1px dashed ${theme.intents?.warning?.main || '#f59e0b'}`,
314
- },
315
- },
316
- },
317
- {
318
- variant: 'dashed',
319
- intent: 'warning',
320
- orientation: 'vertical',
321
- styles: {
322
- borderLeftColor: theme.intents?.warning?.main || '#f59e0b',
323
-
324
- _web: {
325
- borderLeft: `1px dashed ${theme.intents?.warning?.main || '#f59e0b'}`,
326
- },
327
- },
328
- },
329
- {
330
- variant: 'dashed',
331
- intent: 'info',
332
- orientation: 'horizontal',
333
- styles: {
334
- borderTopColor: theme.intents?.info?.main || '#06b6d4',
335
-
336
- _web: {
337
- borderTop: `1px dashed ${theme.intents?.info?.main || '#06b6d4'}`,
338
- },
339
- },
340
- },
341
- {
342
- variant: 'dashed',
343
- intent: 'info',
344
- orientation: 'vertical',
345
- styles: {
346
- borderLeftColor: theme.intents?.info?.main || '#06b6d4',
347
-
348
- _web: {
349
- borderLeft: `1px dashed ${theme.intents?.info?.main || '#06b6d4'}`,
350
- },
351
- },
352
- },
353
- // Intent color compounds for dotted variant
354
- {
355
- variant: 'dotted',
356
- intent: 'primary',
357
- orientation: 'horizontal',
358
- styles: {
359
- borderTopColor: theme.intents?.primary?.main || '#3b82f6',
360
-
361
- _web: {
362
- borderTop: `1px dotted ${theme.intents?.primary?.main || '#3b82f6'}`,
363
- },
364
- },
365
- },
366
- {
367
- variant: 'dotted',
368
- intent: 'primary',
369
- orientation: 'vertical',
370
- styles: {
371
- borderLeftColor: theme.intents?.primary?.main || '#3b82f6',
372
-
373
- _web: {
374
- borderLeft: `1px dotted ${theme.intents?.primary?.main || '#3b82f6'}`,
375
- },
376
- },
377
- },
378
- {
379
- variant: 'dotted',
380
- intent: 'success',
381
- orientation: 'horizontal',
382
- styles: {
383
- borderTopColor: theme.intents?.success?.main || '#22c55e',
384
-
385
- _web: {
386
- borderTop: `1px dotted ${theme.intents?.success?.main || '#22c55e'}`,
387
- },
388
- },
389
- },
390
- {
391
- variant: 'dotted',
392
- intent: 'success',
393
- orientation: 'vertical',
394
- styles: {
395
- borderLeftColor: theme.intents?.success?.main || '#22c55e',
396
-
397
- _web: {
398
- borderLeft: `1px dotted ${theme.intents?.success?.main || '#22c55e'}`,
399
- },
400
- },
401
- },
402
- {
403
- variant: 'dotted',
404
- intent: 'error',
405
- orientation: 'horizontal',
406
- styles: {
407
- borderTopColor: theme.intents?.error?.main || '#ef4444',
408
-
409
- _web: {
410
- borderTop: `1px dotted ${theme.intents?.error?.main || '#ef4444'}`,
411
- },
412
- },
413
- },
414
- {
415
- variant: 'dotted',
416
- intent: 'error',
417
- orientation: 'vertical',
418
- styles: {
419
- borderLeftColor: theme.intents?.error?.main || '#ef4444',
420
-
421
- _web: {
422
- borderLeft: `1px dotted ${theme.intents?.error?.main || '#ef4444'}`,
423
- },
424
- },
425
- },
426
- {
427
- variant: 'dotted',
428
- intent: 'warning',
429
- orientation: 'horizontal',
430
- styles: {
431
- borderTopColor: theme.intents?.warning?.main || '#f59e0b',
432
-
433
- _web: {
434
- borderTop: `1px dotted ${theme.intents?.warning?.main || '#f59e0b'}`,
435
- },
436
- },
437
- },
438
- {
439
- variant: 'dotted',
440
- intent: 'warning',
441
- orientation: 'vertical',
442
- styles: {
443
- borderLeftColor: theme.intents?.warning?.main || '#f59e0b',
444
-
445
- _web: {
446
- borderLeft: `1px dotted ${theme.intents?.warning?.main || '#f59e0b'}`,
447
- },
448
- },
449
- },
450
- {
451
- variant: 'dotted',
452
- intent: 'info',
453
- orientation: 'horizontal',
454
- styles: {
455
- borderTopColor: theme.intents?.info?.main || '#06b6d4',
456
-
457
- _web: {
458
- borderTop: `1px dotted ${theme.intents?.info?.main || '#06b6d4'}`,
459
- },
460
- },
461
- },
462
- {
463
- variant: 'dotted',
464
- intent: 'info',
465
- orientation: 'vertical',
466
- styles: {
467
- borderLeftColor: theme.intents?.info?.main || '#06b6d4',
468
-
469
- _web: {
470
- borderLeft: `1px dotted ${theme.intents?.info?.main || '#06b6d4'}`,
471
- },
472
- },
473
- },
474
- ],
475
- },
476
-
477
- // Container for dividers with content
478
- container: {
479
- alignItems: 'center',
480
- justifyContent: 'center',
481
-
482
- variants: {
483
- orientation: {
484
- horizontal: {
485
- flexDirection: 'row',
486
- width: '100%',
487
- },
488
- vertical: {
489
- flexDirection: 'column',
490
- height: '100%',
491
- },
492
- },
493
- spacing: {
494
- none: {
495
- gap: 0,
496
- },
497
- small: {
498
- gap: theme.spacing?.sm || 8,
499
- },
500
- medium: {
501
- gap: theme.spacing?.md || 12,
502
- },
503
- large: {
504
- gap: theme.spacing?.lg || 16,
4
+ type DividerOrientation = 'horizontal' | 'vertical';
5
+ type DividerThickness = 'thin' | 'md' | 'thick';
6
+ type DividerType = 'solid' | 'dashed' | 'dotted';
7
+ type DividerIntent = Intent | 'secondary' | 'neutral' | 'info';
8
+ type DividerLength = 'full' | 'auto';
9
+ type DividerSpacing = 'none' | 'sm' | 'md' | 'lg';
10
+
11
+ type DividerVariants = {
12
+ orientation: DividerOrientation;
13
+ thickness: DividerThickness;
14
+ type: DividerType;
15
+ intent: DividerIntent;
16
+ length: DividerLength;
17
+ spacing: DividerSpacing;
18
+ }
19
+
20
+ function getIntentColor(theme: Theme, intent: DividerIntent): string {
21
+ if (intent === 'secondary') return theme.colors.border.primary;
22
+ if (intent === 'neutral') return theme.colors.border.secondary;
23
+ if (intent === 'info') return theme.intents.primary.primary;
24
+ return theme.intents[intent as Intent].primary;
25
+ }
26
+
27
+ function createDividerCompoundVariants(theme: Theme) {
28
+ const variants: CompoundVariants<keyof DividerVariants> = [];
29
+
30
+ variants.push(
31
+ { orientation: 'horizontal', thickness: 'thin', styles: { height: 1 } },
32
+ { orientation: 'horizontal', thickness: 'md', styles: { height: 2 } },
33
+ { orientation: 'horizontal', thickness: 'thick', styles: { height: 4 } }
34
+ );
35
+
36
+ variants.push(
37
+ { orientation: 'vertical', thickness: 'thin', styles: { width: 1 } },
38
+ { orientation: 'vertical', thickness: 'md', styles: { width: 2 } },
39
+ { orientation: 'vertical', thickness: 'thick', styles: { width: 4 } }
40
+ );
41
+
42
+ variants.push(
43
+ { orientation: 'horizontal', spacing: 'sm', styles: { marginVertical: 8 } },
44
+ { orientation: 'horizontal', spacing: 'md', styles: { marginVertical: 16 } },
45
+ { orientation: 'horizontal', spacing: 'lg', styles: { marginVertical: 24 } }
46
+ );
47
+
48
+ variants.push(
49
+ { orientation: 'vertical', spacing: 'sm', styles: { marginHorizontal: 8 } },
50
+ { orientation: 'vertical', spacing: 'md', styles: { marginHorizontal: 16 } },
51
+ { orientation: 'vertical', spacing: 'lg', styles: { marginHorizontal: 24 } }
52
+ );
53
+
54
+ const borderColor = theme.colors.border.secondary;
55
+ variants.push(
56
+ {
57
+ type: 'dashed',
58
+ orientation: 'horizontal',
59
+ styles: {
60
+ _web: {
61
+ borderTop: `1px dashed ${borderColor}`,
62
+ borderLeft: 'none',
63
+ },
64
+ },
65
+ },
66
+ {
67
+ type: 'dashed',
68
+ orientation: 'vertical',
69
+ styles: {
70
+ _web: {
71
+ borderLeft: `1px dashed ${borderColor}`,
72
+ borderTop: 'none',
73
+ },
74
+ },
75
+ }
76
+ );
77
+
78
+ variants.push(
79
+ {
80
+ type: 'dotted',
81
+ orientation: 'horizontal',
82
+ styles: {
83
+ _web: {
84
+ borderTop: `1px dotted ${borderColor}`,
85
+ borderLeft: 'none',
86
+ },
87
+ },
88
+ },
89
+ {
90
+ type: 'dotted',
91
+ orientation: 'vertical',
92
+ styles: {
93
+ _web: {
94
+ borderLeft: `1px dotted ${borderColor}`,
95
+ borderTop: 'none',
96
+ },
97
+ },
98
+ }
99
+ );
100
+
101
+ const intents: DividerIntent[] = ['primary', 'success', 'error', 'warning', 'info'];
102
+ for (const intent of intents) {
103
+ const color = getIntentColor(theme, intent);
104
+
105
+ variants.push({
106
+ type: 'dashed',
107
+ intent: intent,
108
+ orientation: 'horizontal',
109
+ styles: {
110
+ borderTopColor: color,
111
+ _web: { borderTop: `1px dashed ${color}` },
112
+ },
113
+ });
114
+
115
+ variants.push({
116
+ type: 'dashed',
117
+ intent: intent,
118
+ orientation: 'vertical',
119
+ styles: {
120
+ borderLeftColor: color,
121
+ _web: { borderLeft: `1px dashed ${color}` },
122
+ },
123
+ });
124
+
125
+ variants.push({
126
+ type: 'dotted',
127
+ intent: intent,
128
+ orientation: 'horizontal',
129
+ styles: {
130
+ borderTopColor: color,
131
+ _web: { borderTop: `1px dotted ${color}` },
132
+ },
133
+ });
134
+
135
+ variants.push({
136
+ type: 'dotted',
137
+ intent: intent,
138
+ orientation: 'vertical',
139
+ styles: {
140
+ borderLeftColor: color,
141
+ _web: { borderLeft: `1px dotted ${color}` },
142
+ },
143
+ });
144
+ }
145
+
146
+ return variants;
147
+ }
148
+
149
+ function createLineCompoundVariants(): CompoundVariants<keyof DividerVariants> {
150
+ return [
151
+ { orientation: 'horizontal', thickness: 'thin', styles: { height: 1 } },
152
+ { orientation: 'horizontal', thickness: 'md', styles: { height: 2 } },
153
+ { orientation: 'horizontal', thickness: 'thick', styles: { height: 4 } },
154
+ { orientation: 'vertical', thickness: 'thin', styles: { width: 1 } },
155
+ { orientation: 'vertical', thickness: 'md', styles: { width: 2 } },
156
+ { orientation: 'vertical', thickness: 'thick', styles: { width: 4 } },
157
+ ] as const;
158
+ }
159
+
160
+ // Styles are inlined here instead of in @idealyst/theme because Unistyles' Babel
161
+ // transform on native cannot resolve function calls to extract variant structures.
162
+ export const dividerStyles = StyleSheet.create((theme: Theme) => {
163
+ return {
164
+ divider: {
165
+ backgroundColor: theme.colors.border.secondary,
166
+ variants: {
167
+ orientation: {
168
+ horizontal: {
169
+ width: '100%',
170
+ height: 1,
171
+ flexDirection: 'row',
172
+ },
173
+ vertical: {
174
+ width: 1,
175
+ height: '100%',
176
+ flexDirection: 'column',
177
+ },
178
+ },
179
+ thickness: {
180
+ thin: {},
181
+ md: {},
182
+ thick: {},
183
+ },
184
+ type: {
185
+ solid: {},
186
+ dashed: {
187
+ backgroundColor: 'transparent',
188
+ _web: {
189
+ border: 'none',
190
+ backgroundColor: 'transparent',
191
+ },
192
+ },
193
+ dotted: {
194
+ backgroundColor: 'transparent',
195
+ _web: {
196
+ border: 'none',
197
+ backgroundColor: 'transparent',
198
+ },
199
+ },
200
+ },
201
+ intent: {
202
+ primary: { backgroundColor: theme.intents.primary.primary },
203
+ secondary: { backgroundColor: theme.colors.border.primary },
204
+ neutral: { backgroundColor: theme.colors.border.secondary },
205
+ success: { backgroundColor: theme.intents.success.primary },
206
+ error: { backgroundColor: theme.intents.error.primary },
207
+ warning: { backgroundColor: theme.intents.warning.primary },
208
+ info: { backgroundColor: theme.intents.primary.primary },
209
+ },
210
+ length: {
211
+ full: {},
212
+ auto: {},
213
+ },
214
+ spacing: {
215
+ none: { margin: 0 },
216
+ sm: {},
217
+ md: {},
218
+ lg: {},
219
+ },
220
+ },
221
+ compoundVariants: createDividerCompoundVariants(theme),
222
+ } as const,
223
+ container: {
224
+ alignItems: 'center',
225
+ justifyContent: 'center',
226
+ display: 'flex',
227
+ variants: {
228
+ orientation: {
229
+ horizontal: {
230
+ flexDirection: 'row',
231
+ width: '100%',
232
+ },
233
+ vertical: {
234
+ flexDirection: 'column',
235
+ height: '100%',
236
+ },
237
+ },
238
+ spacing: {
239
+ none: { gap: 0 },
240
+ xs: { gap: 4 },
241
+ sm: { gap: 8 },
242
+ md: { gap: 16 },
243
+ lg: { gap: 24 },
244
+ xl: { gap: 32 },
245
+ },
505
246
  },
506
- },
507
247
  },
508
- },
509
-
510
- // Content styling for dividers with children
511
- content: {
512
- backgroundColor: theme.colors?.surface?.primary || '#ffffff',
513
- color: theme.colors?.text?.secondary || theme.palettes?.gray?.[600] || '#4b5563',
514
- fontSize: theme.typography?.fontSize?.sm || 14,
515
-
516
- variants: {
517
- orientation: {
518
- horizontal: {
519
- paddingHorizontal: theme.spacing?.sm || 8,
520
- },
521
- vertical: {
522
- paddingVertical: theme.spacing?.sm || 8,
248
+ content: {
249
+ backgroundColor: theme.colors.surface.primary,
250
+ color: theme.colors.text.secondary,
251
+ fontSize: 14,
252
+ variants: {
253
+ orientation: {
254
+ horizontal: {
255
+ paddingHorizontal: 8,
256
+ },
257
+ vertical: {
258
+ paddingVertical: 8,
259
+ },
260
+ },
523
261
  },
524
- },
525
262
  },
526
- },
527
-
528
- // Line segments for dividers with content
529
- line: {
530
- backgroundColor: theme.colors?.border?.secondary || theme.palettes?.gray?.[300] || '#d1d5db',
531
- flex: 1,
532
-
533
- variants: {
534
- orientation: {
535
- horizontal: {
536
- height: 1,
537
- },
538
- vertical: {
539
- width: 1,
540
- },
541
- },
542
- thickness: {
543
- thin: {
544
- // Handled by orientation compound variants
545
- },
546
- medium: {
547
- // Handled by orientation compound variants
548
- },
549
- thick: {
550
- // Handled by orientation compound variants
551
- },
552
- },
263
+ line: {
264
+ backgroundColor: theme.colors.border.secondary,
265
+ flex: 1,
266
+ variants: {
267
+ orientation: {
268
+ horizontal: { height: 1 },
269
+ vertical: { width: 1 },
270
+ },
271
+ thickness: {
272
+ thin: {},
273
+ md: {},
274
+ thick: {},
275
+ },
276
+ },
277
+ compoundVariants: createLineCompoundVariants(),
553
278
  },
554
-
555
- compoundVariants: [
556
- // Horizontal thickness for line segments
557
- {
558
- orientation: 'horizontal',
559
- thickness: 'thin',
560
- styles: {
561
- height: 1,
562
- },
563
- },
564
- {
565
- orientation: 'horizontal',
566
- thickness: 'medium',
567
- styles: {
568
- height: 2,
569
- },
570
- },
571
- {
572
- orientation: 'horizontal',
573
- thickness: 'thick',
574
- styles: {
575
- height: 4,
576
- },
577
- },
578
- // Vertical thickness for line segments
579
- {
580
- orientation: 'vertical',
581
- thickness: 'thin',
582
- styles: {
583
- width: 1,
584
- },
585
- },
586
- {
587
- orientation: 'vertical',
588
- thickness: 'medium',
589
- styles: {
590
- width: 2,
591
- },
592
- },
593
- {
594
- orientation: 'vertical',
595
- thickness: 'thick',
596
- styles: {
597
- width: 4,
598
- },
599
- },
600
- ],
601
- },
602
- }));
279
+ };
280
+ });