@flipova/foundation 2.4.4 → 3.0.0-alpha.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.
Files changed (402) hide show
  1. package/CHANGES.md +66 -0
  2. package/COMPONENTS.md +102 -0
  3. package/DOCS.md +261 -0
  4. package/LICENSE +1 -1
  5. package/README.md +169 -118
  6. package/components/contract/index.ts +3 -0
  7. package/components/contract/recipes/accordion.ts +42 -0
  8. package/components/contract/recipes/avatar.ts +41 -0
  9. package/components/contract/recipes/badge.ts +46 -0
  10. package/components/contract/recipes/button.ts +58 -0
  11. package/components/contract/recipes/calendar.ts +118 -0
  12. package/components/contract/recipes/card.ts +21 -0
  13. package/components/contract/recipes/checkbox.ts +33 -0
  14. package/components/contract/recipes/divider.ts +9 -0
  15. package/components/contract/recipes/fab.ts +31 -0
  16. package/components/contract/recipes/feedback.ts +66 -0
  17. package/components/contract/recipes/formcontrol.ts +16 -0
  18. package/components/contract/recipes/heading.ts +16 -0
  19. package/components/contract/recipes/icon.ts +40 -0
  20. package/components/contract/recipes/index.ts +30 -0
  21. package/components/contract/recipes/input.ts +39 -0
  22. package/components/contract/recipes/layout.ts +44 -0
  23. package/components/contract/recipes/link.ts +6 -0
  24. package/components/contract/recipes/modal.ts +40 -0
  25. package/components/contract/recipes/overlay.ts +250 -0
  26. package/components/contract/recipes/progress.ts +27 -0
  27. package/components/contract/recipes/radio.ts +39 -0
  28. package/components/contract/recipes/select.ts +63 -0
  29. package/components/contract/recipes/skeleton.ts +25 -0
  30. package/components/contract/recipes/slider.ts +50 -0
  31. package/components/contract/recipes/spinner.ts +12 -0
  32. package/components/contract/recipes/switch.ts +26 -0
  33. package/components/contract/recipes/table.ts +37 -0
  34. package/components/contract/recipes/tabs.ts +31 -0
  35. package/components/contract/recipes/text.ts +12 -0
  36. package/components/contract/recipes/textarea.ts +37 -0
  37. package/components/contract/recipes/util.ts +15 -0
  38. package/components/contract/theme.ts +116 -0
  39. package/components/contract/types.ts +598 -0
  40. package/components/providers/css-vars.ts +43 -0
  41. package/components/providers/flipova/components/Accordion.tsx +41 -0
  42. package/components/providers/flipova/components/ActionSheet.tsx +34 -0
  43. package/components/providers/flipova/components/Alert.tsx +15 -0
  44. package/components/providers/flipova/components/AlertDialog.tsx +31 -0
  45. package/components/providers/flipova/components/Avatar.tsx +30 -0
  46. package/components/providers/flipova/components/Badge.tsx +14 -0
  47. package/components/providers/flipova/components/BottomSheet.tsx +24 -0
  48. package/components/providers/flipova/components/Box.tsx +1 -0
  49. package/components/providers/flipova/components/Button.tsx +31 -0
  50. package/components/providers/flipova/components/Calendar.tsx +85 -0
  51. package/components/providers/flipova/components/Card.tsx +13 -0
  52. package/components/providers/flipova/components/Center.tsx +11 -0
  53. package/components/providers/flipova/components/Checkbox.tsx +24 -0
  54. package/components/providers/flipova/components/DateTimePicker.tsx +45 -0
  55. package/components/providers/flipova/components/Divider.tsx +9 -0
  56. package/components/providers/flipova/components/Drawer.tsx +18 -0
  57. package/components/providers/flipova/components/Fab.tsx +22 -0
  58. package/components/providers/flipova/components/FlatList.tsx +1 -0
  59. package/components/providers/flipova/components/FormControl.tsx +27 -0
  60. package/components/providers/flipova/components/Grid.tsx +18 -0
  61. package/components/providers/flipova/components/HStack.tsx +13 -0
  62. package/components/providers/flipova/components/Heading.tsx +19 -0
  63. package/components/providers/flipova/components/Icon.tsx +20 -0
  64. package/components/providers/flipova/components/Image.tsx +1 -0
  65. package/components/providers/flipova/components/ImageBackground.tsx +1 -0
  66. package/components/providers/flipova/components/ImageViewer.tsx +25 -0
  67. package/components/providers/flipova/components/Input.tsx +29 -0
  68. package/components/providers/flipova/components/InputAccessoryView.tsx +1 -0
  69. package/components/providers/flipova/components/KeyboardAvoidingView.tsx +1 -0
  70. package/components/providers/flipova/components/Link.tsx +21 -0
  71. package/components/providers/flipova/components/LiquidGlass.tsx +13 -0
  72. package/components/providers/flipova/components/Menu.tsx +43 -0
  73. package/components/providers/flipova/components/Modal.tsx +24 -0
  74. package/components/providers/flipova/components/Popover.tsx +23 -0
  75. package/components/providers/flipova/components/Portal.tsx +42 -0
  76. package/components/providers/flipova/components/Pressable.tsx +1 -0
  77. package/components/providers/flipova/components/Progress.tsx +22 -0
  78. package/components/providers/flipova/components/RadioGroup.tsx +36 -0
  79. package/components/providers/flipova/components/RefreshControl.tsx +1 -0
  80. package/components/providers/flipova/components/SafeAreaView.tsx +1 -0
  81. package/components/providers/flipova/components/ScrollView.tsx +1 -0
  82. package/components/providers/flipova/components/SectionList.tsx +1 -0
  83. package/components/providers/flipova/components/Select.tsx +61 -0
  84. package/components/providers/flipova/components/Skeleton.tsx +25 -0
  85. package/components/providers/flipova/components/Slider.tsx +52 -0
  86. package/components/providers/flipova/components/Spinner.tsx +19 -0
  87. package/components/providers/flipova/components/StatusBar.tsx +1 -0
  88. package/components/providers/flipova/components/Switch.tsx +21 -0
  89. package/components/providers/flipova/components/Table.tsx +33 -0
  90. package/components/providers/flipova/components/Tabs.tsx +39 -0
  91. package/components/providers/flipova/components/Text.tsx +13 -0
  92. package/components/providers/flipova/components/Textarea.tsx +28 -0
  93. package/components/providers/flipova/components/Toast.tsx +28 -0
  94. package/components/providers/flipova/components/Tooltip.tsx +34 -0
  95. package/components/providers/flipova/components/VStack.tsx +13 -0
  96. package/components/providers/flipova/components/View.tsx +1 -0
  97. package/components/providers/flipova/components/VirtualizedList.tsx +1 -0
  98. package/components/providers/flipova/index.tsx +189 -0
  99. package/components/providers/gluestack/index.tsx +226 -0
  100. package/components/providers/gluestack/more.tsx +151 -0
  101. package/components/{ui → providers/gluestack/ui}/accordion/index.tsx +2 -2
  102. package/components/{ui → providers/gluestack/ui}/actionsheet/index.tsx +15 -15
  103. package/components/{ui → providers/gluestack/ui}/alert/index.tsx +1 -1
  104. package/components/{ui → providers/gluestack/ui}/alert-dialog/index.tsx +3 -3
  105. package/components/{ui → providers/gluestack/ui}/badge/index.tsx +2 -2
  106. package/components/{ui → providers/gluestack/ui}/bottomsheet/index.tsx +11 -10
  107. package/components/{ui → providers/gluestack/ui}/box/index.tsx +4 -1
  108. package/components/{ui → providers/gluestack/ui}/button/index.tsx +1 -1
  109. package/components/{ui → providers/gluestack/ui}/calendar/index.tsx +4 -4
  110. package/components/{ui → providers/gluestack/ui}/card/index.tsx +1 -1
  111. package/components/{ui → providers/gluestack/ui}/center/index.tsx +1 -1
  112. package/components/{ui → providers/gluestack/ui}/checkbox/index.tsx +9 -8
  113. package/components/{ui → providers/gluestack/ui}/date-time-picker/index.tsx +4 -4
  114. package/components/providers/gluestack/ui/date-time-picker/index.web.tsx +197 -0
  115. package/components/{ui → providers/gluestack/ui}/divider/index.tsx +1 -1
  116. package/components/{ui → providers/gluestack/ui}/drawer/index.tsx +2 -2
  117. package/components/{ui → providers/gluestack/ui}/fab/index.tsx +1 -1
  118. package/components/{ui → providers/gluestack/ui}/form-control/index.tsx +3 -3
  119. package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/config.ts +1 -62
  120. package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.js +1 -1
  121. package/components/{ui → providers/gluestack/ui}/grid/index.tsx +3 -3
  122. package/components/{ui → providers/gluestack/ui}/heading/index.tsx +7 -7
  123. package/components/{ui → providers/gluestack/ui}/hstack/index.tsx +1 -1
  124. package/components/{ui → providers/gluestack/ui}/icon/index.tsx +1 -1
  125. package/components/{ui → providers/gluestack/ui}/image/index.tsx +0 -1
  126. package/components/{ui → providers/gluestack/ui}/image-viewer/index.tsx +96 -99
  127. package/components/providers/gluestack/ui/index.ts +58 -0
  128. package/components/{ui → providers/gluestack/ui}/input/index.tsx +1 -1
  129. package/components/{ui → providers/gluestack/ui}/link/index.tsx +2 -2
  130. package/components/{ui → providers/gluestack/ui}/liquid-glass/index.tsx +2 -2
  131. package/components/{ui → providers/gluestack/ui}/menu/index.tsx +5 -4
  132. package/components/{ui → providers/gluestack/ui}/modal/index.tsx +19 -17
  133. package/components/{ui → providers/gluestack/ui}/popover/index.tsx +4 -4
  134. package/components/{ui → providers/gluestack/ui}/portal/index.tsx +1 -1
  135. package/components/{ui → providers/gluestack/ui}/progress/index.tsx +2 -2
  136. package/components/{ui → providers/gluestack/ui}/radio/index.tsx +1 -1
  137. package/components/{ui → providers/gluestack/ui}/select/index.tsx +8 -12
  138. package/components/{ui → providers/gluestack/ui}/select/select-actionsheet.tsx +13 -13
  139. package/components/{ui → providers/gluestack/ui}/skeleton/index.tsx +2 -2
  140. package/components/{ui → providers/gluestack/ui}/slider/index.tsx +1 -1
  141. package/components/{ui → providers/gluestack/ui}/spinner/index.tsx +2 -2
  142. package/components/{ui → providers/gluestack/ui}/table/index.tsx +33 -33
  143. package/components/{ui → providers/gluestack/ui}/tabs/TabsAnimatedIndicator.tsx +1 -1
  144. package/components/{ui → providers/gluestack/ui}/tabs/index.tsx +2 -2
  145. package/components/{ui → providers/gluestack/ui}/text/index.tsx +1 -1
  146. package/components/{ui → providers/gluestack/ui}/toast/index.tsx +4 -4
  147. package/components/{ui → providers/gluestack/ui}/tooltip/index.tsx +1 -1
  148. package/components/{ui → providers/gluestack/ui}/vstack/index.tsx +1 -1
  149. package/components/providers/index.ts +2 -0
  150. package/components/providers/paper/index.tsx +449 -0
  151. package/components/providers/provider.tsx +80 -0
  152. package/components/providers/reusables/classes.ts +163 -0
  153. package/components/providers/reusables/index.tsx +289 -0
  154. package/components/providers/rn-base/Box.tsx +7 -0
  155. package/components/providers/rn-base/FlatList.tsx +16 -0
  156. package/components/providers/rn-base/Image.tsx +18 -0
  157. package/components/providers/rn-base/ImageBackground.tsx +11 -0
  158. package/components/providers/rn-base/InputAccessoryView.tsx +9 -0
  159. package/components/providers/rn-base/KeyboardAvoidingView.tsx +15 -0
  160. package/components/providers/rn-base/Pressable.tsx +19 -0
  161. package/components/providers/rn-base/RefreshControl.tsx +16 -0
  162. package/components/providers/rn-base/SafeAreaView.tsx +11 -0
  163. package/components/providers/rn-base/ScrollView.tsx +11 -0
  164. package/components/providers/rn-base/SectionList.tsx +22 -0
  165. package/components/providers/rn-base/StatusBar.tsx +17 -0
  166. package/components/providers/rn-base/View.tsx +7 -0
  167. package/components/providers/rn-base/VirtualizedList.tsx +18 -0
  168. package/components/providers/rn-base/index.tsx +64 -0
  169. package/components/providers/tamagui/index.tsx +375 -0
  170. package/components/providers/types.ts +17 -0
  171. package/components/theme/design-theme.ts +230 -0
  172. package/components/ui/create.tsx +14 -0
  173. package/components/ui/index.ts +68 -58
  174. package/components/ui/resolve.ts +40 -0
  175. package/design/canonical.index.txt +2 -16
  176. package/design/manifest.xml +4 -3
  177. package/design/schema.xsd +44 -434
  178. package/design/themes.xml +7 -177
  179. package/design/tools/{npm.js → cli.js} +173 -73
  180. package/design/tools/gui/index.html +998 -0
  181. package/design/tools/lib/check.js +533 -0
  182. package/design/tools/lib/contract.js +23 -0
  183. package/design/tools/lib/edit.js +166 -0
  184. package/design/tools/lib/generate.js +465 -0
  185. package/design/tools/lib/gui.js +614 -0
  186. package/design/tools/lib/lint.js +139 -0
  187. package/design/tools/lib/registry.js +135 -0
  188. package/design/tools/lib/util.js +53 -0
  189. package/design/tools/lib/xml.js +257 -0
  190. package/design/tools/lib/xsd.js +408 -0
  191. package/dist/chunk-2QM2ZUDS.mjs +1308 -0
  192. package/dist/chunk-2QM2ZUDS.mjs.map +1 -0
  193. package/dist/chunk-2T2TCUYF.js +1371 -0
  194. package/dist/chunk-2T2TCUYF.js.map +1 -0
  195. package/dist/chunk-6UKTC4KF.js +43 -0
  196. package/dist/chunk-6UKTC4KF.js.map +1 -0
  197. package/dist/chunk-6Z4WRTI4.mjs +37 -0
  198. package/dist/chunk-6Z4WRTI4.mjs.map +1 -0
  199. package/dist/chunk-G3K6J5KY.js +157 -0
  200. package/dist/chunk-G3K6J5KY.js.map +1 -0
  201. package/dist/chunk-GM45RCSI.mjs +96 -0
  202. package/dist/chunk-GM45RCSI.mjs.map +1 -0
  203. package/dist/chunk-GQJLHH2P.mjs +3 -0
  204. package/dist/chunk-GQJLHH2P.mjs.map +1 -0
  205. package/dist/chunk-ICNR56VP.js +1653 -0
  206. package/dist/chunk-ICNR56VP.js.map +1 -0
  207. package/dist/chunk-J5LGTIGS.mjs +9 -0
  208. package/dist/chunk-J5LGTIGS.mjs.map +1 -0
  209. package/dist/chunk-LRPZLF2K.mjs +30 -0
  210. package/dist/chunk-LRPZLF2K.mjs.map +1 -0
  211. package/dist/chunk-OC4MXNXU.js +32 -0
  212. package/dist/chunk-OC4MXNXU.js.map +1 -0
  213. package/dist/chunk-PZ5AY32C.js +11 -0
  214. package/dist/chunk-PZ5AY32C.js.map +1 -0
  215. package/dist/chunk-RWVTZUEG.js +161 -0
  216. package/dist/chunk-RWVTZUEG.js.map +1 -0
  217. package/dist/chunk-V473I5XQ.js +4 -0
  218. package/dist/chunk-V473I5XQ.js.map +1 -0
  219. package/dist/chunk-V4ULAISZ.js +915 -0
  220. package/dist/chunk-V4ULAISZ.js.map +1 -0
  221. package/dist/chunk-WRJERTJS.mjs +145 -0
  222. package/dist/chunk-WRJERTJS.mjs.map +1 -0
  223. package/dist/chunk-YIBPE3KQ.mjs +864 -0
  224. package/dist/chunk-YIBPE3KQ.mjs.map +1 -0
  225. package/dist/chunk-YUAQIZPN.mjs +1556 -0
  226. package/dist/chunk-YUAQIZPN.mjs.map +1 -0
  227. package/dist/contract/index.d.mts +304 -0
  228. package/dist/contract/index.d.ts +304 -0
  229. package/dist/contract/index.js +256 -0
  230. package/dist/contract/index.js.map +1 -0
  231. package/dist/contract/index.mjs +3 -0
  232. package/dist/contract/index.mjs.map +1 -0
  233. package/dist/index.d.mts +4 -40
  234. package/dist/index.d.ts +4 -40
  235. package/dist/index.js +73 -992
  236. package/dist/index.mjs +2 -1
  237. package/dist/providers/flipova/index.d.mts +133 -0
  238. package/dist/providers/flipova/index.d.ts +133 -0
  239. package/dist/providers/flipova/index.js +249 -0
  240. package/dist/providers/flipova/index.js.map +1 -0
  241. package/dist/providers/flipova/index.mjs +4 -0
  242. package/dist/providers/flipova/index.mjs.map +1 -0
  243. package/dist/providers/gluestack/index.d.mts +7 -0
  244. package/dist/providers/gluestack/index.d.ts +7 -0
  245. package/dist/providers/gluestack/index.js +240 -0
  246. package/dist/providers/gluestack/index.js.map +1 -0
  247. package/dist/providers/gluestack/index.mjs +238 -0
  248. package/dist/providers/gluestack/index.mjs.map +1 -0
  249. package/dist/providers/gluestack/ui/index.d.mts +3472 -0
  250. package/dist/providers/gluestack/ui/index.d.ts +3472 -0
  251. package/dist/{chunk-LCTFQJZM.js → providers/gluestack/ui/index.js} +860 -2297
  252. package/dist/providers/gluestack/ui/index.js.map +1 -0
  253. package/dist/{chunk-2R66P5X5.mjs → providers/gluestack/ui/index.mjs} +468 -2062
  254. package/dist/providers/gluestack/ui/index.mjs.map +1 -0
  255. package/dist/providers/index.d.mts +37 -0
  256. package/dist/providers/index.d.ts +37 -0
  257. package/dist/providers/index.js +28 -0
  258. package/dist/providers/index.js.map +1 -0
  259. package/dist/providers/index.mjs +3 -0
  260. package/dist/providers/index.mjs.map +1 -0
  261. package/dist/providers/paper/index.d.mts +30 -0
  262. package/dist/providers/paper/index.d.ts +30 -0
  263. package/dist/providers/paper/index.js +362 -0
  264. package/dist/providers/paper/index.js.map +1 -0
  265. package/dist/providers/paper/index.mjs +353 -0
  266. package/dist/providers/paper/index.mjs.map +1 -0
  267. package/dist/providers/reusables/index.d.mts +60 -0
  268. package/dist/providers/reusables/index.d.ts +60 -0
  269. package/dist/providers/reusables/index.js +348 -0
  270. package/dist/providers/reusables/index.js.map +1 -0
  271. package/dist/providers/reusables/index.mjs +311 -0
  272. package/dist/providers/reusables/index.mjs.map +1 -0
  273. package/dist/providers/tamagui/index.d.mts +15 -0
  274. package/dist/providers/tamagui/index.d.ts +15 -0
  275. package/dist/providers/tamagui/index.js +275 -0
  276. package/dist/providers/tamagui/index.js.map +1 -0
  277. package/dist/providers/tamagui/index.mjs +270 -0
  278. package/dist/providers/tamagui/index.mjs.map +1 -0
  279. package/dist/theme-BznFrVT1.d.mts +566 -0
  280. package/dist/theme-BznFrVT1.d.ts +566 -0
  281. package/dist/types-C7P80VKR.d.ts +22 -0
  282. package/dist/types-Tspvmask.d.mts +22 -0
  283. package/dist/ui/index.d.mts +190 -7017
  284. package/dist/ui/index.d.ts +190 -7017
  285. package/dist/ui/index.js +73 -992
  286. package/dist/ui/index.mjs +2 -1
  287. package/package.json +136 -35
  288. package/components/ui/date-time-picker/index.web.tsx +0 -195
  289. package/design/documentation.xml +0 -607
  290. package/design/tools/design.js +0 -188
  291. package/design/tools/requirements.txt +0 -35
  292. package/design/tools/sources/.checker/__init__.py +0 -81
  293. package/design/tools/sources/.checker/checks.py +0 -198
  294. package/design/tools/sources/.checker/cli.py +0 -154
  295. package/design/tools/sources/.checker/io.py +0 -242
  296. package/design/tools/sources/.checker/model.py +0 -144
  297. package/design/tools/sources/.checker/registry.py +0 -115
  298. package/design/tools/sources/.checker/report.py +0 -21
  299. package/design/tools/sources/.docgen/__init__.py +0 -45
  300. package/design/tools/sources/.docgen/cli.py +0 -101
  301. package/design/tools/sources/.docgen/model.py +0 -147
  302. package/design/tools/sources/.docgen/reference.py +0 -97
  303. package/design/tools/sources/.docgen/site.py +0 -145
  304. package/design/tools/sources/.docgen/xsddoc.py +0 -329
  305. package/design/tools/sources/.generate/__init__.py +0 -35
  306. package/design/tools/sources/.generate/cli.py +0 -76
  307. package/design/tools/sources/.generate/common.py +0 -33
  308. package/design/tools/sources/.generate/config.py +0 -177
  309. package/design/tools/sources/.generate/model.py +0 -51
  310. package/design/tools/sources/.generate/tokens.py +0 -141
  311. package/design/tools/sources/.linter/__init__.py +0 -9
  312. package/design/tools/sources/.linter/cli.py +0 -44
  313. package/design/tools/sources/.linter/discovery.py +0 -30
  314. package/design/tools/sources/.linter/errors.py +0 -45
  315. package/design/tools/sources/.linter/linter.py +0 -68
  316. package/design/tools/sources/.xmleditor/__init__.py +0 -74
  317. package/design/tools/sources/.xmleditor/blocks.py +0 -185
  318. package/design/tools/sources/.xmleditor/cli.py +0 -141
  319. package/design/tools/sources/.xmleditor/editor.py +0 -906
  320. package/design/tools/sources/.xmleditor/model.py +0 -708
  321. package/design/tools/sources/.xmleditor/widgets.py +0 -1832
  322. package/design/tools/sources/.xmleditor/xsdmodel.py +0 -753
  323. package/design/tools/sources/checker.py +0 -55
  324. package/design/tools/sources/docgen.py +0 -66
  325. package/design/tools/sources/generate.py +0 -48
  326. package/design/tools/sources/linter.py +0 -54
  327. package/design/tools/sources/ruff.toml +0 -12
  328. package/design/tools/sources/xmleditor.py +0 -62
  329. package/design/tools/unix/_venv_python.sh +0 -16
  330. package/design/tools/unix/check.sh +0 -13
  331. package/design/tools/unix/doc.sh +0 -14
  332. package/design/tools/unix/gen.sh +0 -14
  333. package/design/tools/unix/lint.sh +0 -10
  334. package/design/tools/unix/run.sh +0 -20
  335. package/design/tools/unix/verify.sh +0 -12
  336. package/design/tools/unix/xmledit.sh +0 -12
  337. package/design/tools/windows/check.cmd +0 -12
  338. package/design/tools/windows/doc.cmd +0 -12
  339. package/design/tools/windows/gen.cmd +0 -11
  340. package/design/tools/windows/lint.cmd +0 -9
  341. package/design/tools/windows/run.cmd +0 -26
  342. package/design/tools/windows/verify.cmd +0 -10
  343. package/design/tools/windows/xmledit.cmd +0 -10
  344. package/dist/chunk-2R66P5X5.mjs.map +0 -1
  345. package/dist/chunk-LCTFQJZM.js.map +0 -1
  346. /package/components/{ui → providers/gluestack/ui}/accordion/ANIMATION_CUSTOMIZATION.md +0 -0
  347. /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedHeight.tsx +0 -0
  348. /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedIcon.tsx +0 -0
  349. /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedHeight.tsx +0 -0
  350. /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedIcon.tsx +0 -0
  351. /package/components/{ui → providers/gluestack/ui}/accordion/MIGRATION_SUMMARY.md +0 -0
  352. /package/components/{ui → providers/gluestack/ui}/accordion/USAGE_EXAMPLE.tsx +0 -0
  353. /package/components/{ui → providers/gluestack/ui}/accordion/animation-config.ts +0 -0
  354. /package/components/{ui → providers/gluestack/ui}/avatar/index.tsx +0 -0
  355. /package/components/{ui → providers/gluestack/ui}/box/index.web.tsx +0 -0
  356. /package/components/{ui → providers/gluestack/ui}/box/styles.tsx +0 -0
  357. /package/components/{ui → providers/gluestack/ui}/calendar/creator.tsx +0 -0
  358. /package/components/{ui → providers/gluestack/ui}/calendar/styles.tsx +0 -0
  359. /package/components/{ui → providers/gluestack/ui}/card/index.web.tsx +0 -0
  360. /package/components/{ui → providers/gluestack/ui}/card/styles.tsx +0 -0
  361. /package/components/{ui → providers/gluestack/ui}/center/index.web.tsx +0 -0
  362. /package/components/{ui → providers/gluestack/ui}/center/styles.tsx +0 -0
  363. /package/components/{ui → providers/gluestack/ui}/date-time-picker/creator.tsx +0 -0
  364. /package/components/{ui → providers/gluestack/ui}/date-time-picker/styles.tsx +0 -0
  365. /package/components/{ui → providers/gluestack/ui}/flat-list/index.tsx +0 -0
  366. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.tsx +0 -0
  367. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.web.tsx +0 -0
  368. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/script.ts +0 -0
  369. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/theme-context.ts +0 -0
  370. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.d.ts +0 -0
  371. /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/useGluestackColors.ts +0 -0
  372. /package/components/{ui → providers/gluestack/ui}/grid/index.web.tsx +0 -0
  373. /package/components/{ui → providers/gluestack/ui}/grid/styles.tsx +0 -0
  374. /package/components/{ui → providers/gluestack/ui}/heading/index.web.tsx +0 -0
  375. /package/components/{ui → providers/gluestack/ui}/heading/styles.tsx +0 -0
  376. /package/components/{ui → providers/gluestack/ui}/hstack/index.web.tsx +0 -0
  377. /package/components/{ui → providers/gluestack/ui}/hstack/styles.tsx +0 -0
  378. /package/components/{ui → providers/gluestack/ui}/icon/index.web.tsx +0 -0
  379. /package/components/{ui → providers/gluestack/ui}/image-background/index.tsx +0 -0
  380. /package/components/{ui → providers/gluestack/ui}/image-viewer/index.web.tsx +0 -0
  381. /package/components/{ui → providers/gluestack/ui}/input-accessory-view/index.tsx +0 -0
  382. /package/components/{ui → providers/gluestack/ui}/keyboard-avoiding-view/index.tsx +0 -0
  383. /package/components/{ui → providers/gluestack/ui}/pressable/index.tsx +0 -0
  384. /package/components/{ui → providers/gluestack/ui}/refresh-control/index.tsx +0 -0
  385. /package/components/{ui → providers/gluestack/ui}/safe-area-view/index.tsx +0 -0
  386. /package/components/{ui → providers/gluestack/ui}/scroll-view/index.tsx +0 -0
  387. /package/components/{ui → providers/gluestack/ui}/section-list/index.tsx +0 -0
  388. /package/components/{ui → providers/gluestack/ui}/skeleton/index.web.tsx +0 -0
  389. /package/components/{ui → providers/gluestack/ui}/skeleton/styles.tsx +0 -0
  390. /package/components/{ui → providers/gluestack/ui}/status-bar/index.tsx +0 -0
  391. /package/components/{ui → providers/gluestack/ui}/switch/index.tsx +0 -0
  392. /package/components/{ui → providers/gluestack/ui}/table/index.web.tsx +0 -0
  393. /package/components/{ui → providers/gluestack/ui}/table/styles.tsx +0 -0
  394. /package/components/{ui → providers/gluestack/ui}/tabs/animation-config.ts +0 -0
  395. /package/components/{ui → providers/gluestack/ui}/tabs/creator.tsx +0 -0
  396. /package/components/{ui → providers/gluestack/ui}/text/index.web.tsx +0 -0
  397. /package/components/{ui → providers/gluestack/ui}/text/styles.tsx +0 -0
  398. /package/components/{ui → providers/gluestack/ui}/textarea/index.tsx +0 -0
  399. /package/components/{ui → providers/gluestack/ui}/view/index.tsx +0 -0
  400. /package/components/{ui → providers/gluestack/ui}/virtualized-list/index.tsx +0 -0
  401. /package/components/{ui → providers/gluestack/ui}/vstack/index.web.tsx +0 -0
  402. /package/components/{ui → providers/gluestack/ui}/vstack/styles.tsx +0 -0
@@ -0,0 +1,21 @@
1
+ import { type ResolvedTheme } from '../theme';
2
+ import type { CardProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ export function cardRecipe({ size = 'default' }: CardProps, t: ResolvedTheme): Style {
6
+ const sh = t.scale.shadows.sm;
7
+ return {
8
+ flexDirection: 'column',
9
+ backgroundColor: t.colors.card,
10
+ borderWidth: 1,
11
+ borderColor: t.colors.border,
12
+ borderRadius: px(t, 'radii', 'xl'),
13
+ padding: px(t, 'spacing', size === 'sm' ? '3' : '4'),
14
+ gap: px(t, 'spacing', size === 'sm' ? '3' : '6'),
15
+ shadowColor: sh.color,
16
+ shadowOffset: { width: sh.offsetX, height: sh.offsetY },
17
+ shadowOpacity: sh.opacity,
18
+ shadowRadius: sh.radius,
19
+ elevation: sh.elevation,
20
+ };
21
+ }
@@ -0,0 +1,33 @@
1
+ import { withAlpha, type ResolvedTheme } from '../theme';
2
+ import type { CheckboxProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ export interface CheckboxRecipe {
6
+ row: Style;
7
+ box: Style;
8
+ mark: { color: string; fontSize: number };
9
+ label: Style;
10
+ }
11
+
12
+ export function checkboxRecipe(
13
+ { checked = false, disabled = false, invalid = false }: CheckboxProps,
14
+ t: ResolvedTheme,
15
+ ): CheckboxRecipe {
16
+ const c = t.colors;
17
+ const size = px(t, 'spacing', '5');
18
+ return {
19
+ row: { flexDirection: 'row', alignItems: 'center', gap: px(t, 'spacing', '2'), opacity: disabled ? 0.4 : 1 },
20
+ box: {
21
+ width: size,
22
+ height: size,
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ borderRadius: px(t, 'radii', 'sm'),
26
+ borderWidth: 1,
27
+ borderColor: invalid ? withAlpha(c.destructive, 0.6) : checked ? c.primary : c.input,
28
+ backgroundColor: checked ? c.primary : 'transparent',
29
+ },
30
+ mark: { color: c.primaryForeground, fontSize: px(t, 'fontSizes', 'xs') },
31
+ label: { color: c.foreground, fontSize: px(t, 'fontSizes', 'sm') },
32
+ };
33
+ }
@@ -0,0 +1,9 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { DividerProps } from '../types';
3
+ import type { Style } from './util';
4
+
5
+ export function dividerRecipe({ orientation = 'horizontal' }: DividerProps, t: ResolvedTheme): Style {
6
+ return orientation === 'vertical'
7
+ ? { width: 1, alignSelf: 'stretch', backgroundColor: t.colors.border }
8
+ : { height: 1, width: '100%', backgroundColor: t.colors.border };
9
+ }
@@ -0,0 +1,31 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { FabProps } from '../types';
3
+ import { px, weight, type Style } from './util';
4
+
5
+ export function fabRecipe({ label }: FabProps, t: ResolvedTheme): { container: Style; label: Style; icon: Style } {
6
+ const c = t.colors;
7
+ const sh = t.scale.shadows.lg;
8
+ const size = px(t, 'spacing', '14');
9
+ return {
10
+ container: {
11
+ position: 'absolute',
12
+ right: px(t, 'spacing', '4'),
13
+ bottom: px(t, 'spacing', '4'),
14
+ flexDirection: 'row',
15
+ alignItems: 'center',
16
+ justifyContent: 'center',
17
+ gap: px(t, 'spacing', '2'),
18
+ height: size,
19
+ ...(label ? { paddingHorizontal: px(t, 'spacing', '5') } : { width: size }),
20
+ borderRadius: px(t, 'radii', 'full'),
21
+ backgroundColor: c.primary,
22
+ shadowColor: sh.color,
23
+ shadowOffset: { width: sh.offsetX, height: sh.offsetY },
24
+ shadowOpacity: sh.opacity,
25
+ shadowRadius: sh.radius,
26
+ elevation: sh.elevation,
27
+ },
28
+ label: { color: c.primaryForeground, fontSize: px(t, 'fontSizes', 'sm'), fontWeight: weight(t, 'medium') },
29
+ icon: { color: c.primaryForeground, fontSize: px(t, 'fontSizes', 'xl') },
30
+ };
31
+ }
@@ -0,0 +1,66 @@
1
+ import { withAlpha, type ResolvedTheme } from '../theme';
2
+ import type { AlertProps, FeedbackVariant, ToastProps } from '../types';
3
+ import { px, weight, type Style } from './util';
4
+
5
+ /** The registry colour a feedback variant stands for. */
6
+ export function feedbackColor(variant: FeedbackVariant | 'default', t: ResolvedTheme): string {
7
+ const c = t.colors;
8
+ return { info: c.info, success: c.success, warning: c.warning, error: c.error, default: c.border }[variant];
9
+ }
10
+
11
+ export interface FeedbackRecipe {
12
+ container: Style;
13
+ title: Style;
14
+ body: Style;
15
+ /** the colour of the leading bar */
16
+ accent: string;
17
+ }
18
+
19
+ export function alertRecipe({ variant = 'info' }: AlertProps, t: ResolvedTheme): FeedbackRecipe {
20
+ const accent = feedbackColor(variant, t);
21
+ return {
22
+ accent,
23
+ container: {
24
+ width: '100%',
25
+ gap: px(t, 'spacing', '1'),
26
+ padding: px(t, 'spacing', '4'),
27
+ borderRadius: px(t, 'radii', 'lg'),
28
+ borderWidth: 1,
29
+ borderColor: withAlpha(accent, 0.4),
30
+ borderLeftWidth: 4,
31
+ borderLeftColor: accent,
32
+ backgroundColor: withAlpha(accent, 0.1),
33
+ },
34
+ title: { color: t.colors.foreground, fontSize: px(t, 'fontSizes', 'sm'), fontWeight: weight(t, 'semibold') },
35
+ body: { color: t.colors.foreground, fontSize: px(t, 'fontSizes', 'sm') },
36
+ };
37
+ }
38
+
39
+ export function toastRecipe({ variant = 'default' }: ToastProps, t: ResolvedTheme): FeedbackRecipe {
40
+ const c = t.colors;
41
+ const accent = feedbackColor(variant, t);
42
+ const sh = t.scale.shadows.lg;
43
+ return {
44
+ accent,
45
+ container: {
46
+ minWidth: px(t, 'spacing', '40') + px(t, 'spacing', '24'),
47
+ flexDirection: 'row',
48
+ alignItems: 'flex-start',
49
+ gap: px(t, 'spacing', '3'),
50
+ padding: px(t, 'spacing', '4'),
51
+ borderRadius: px(t, 'radii', 'lg'),
52
+ borderWidth: 1,
53
+ borderColor: c.border,
54
+ borderLeftWidth: 4,
55
+ borderLeftColor: accent,
56
+ backgroundColor: c.popover,
57
+ shadowColor: sh.color,
58
+ shadowOffset: { width: sh.offsetX, height: sh.offsetY },
59
+ shadowOpacity: sh.opacity,
60
+ shadowRadius: sh.radius,
61
+ elevation: sh.elevation,
62
+ },
63
+ title: { color: c.popoverForeground, fontSize: px(t, 'fontSizes', 'sm'), fontWeight: weight(t, 'semibold') },
64
+ body: { color: c.mutedForeground, fontSize: px(t, 'fontSizes', 'sm') },
65
+ };
66
+ }
@@ -0,0 +1,16 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import { px, weight, type Style } from './util';
3
+
4
+ export function formControlRecipe(
5
+ disabled: boolean,
6
+ t: ResolvedTheme,
7
+ ): { root: Style; label: Style; required: Style; helper: Style; error: Style } {
8
+ const c = t.colors;
9
+ return {
10
+ root: { gap: px(t, 'spacing', '1.5'), opacity: disabled ? 0.5 : 1 },
11
+ label: { color: c.foreground, fontSize: px(t, 'fontSizes', 'sm'), fontWeight: weight(t, 'medium') },
12
+ required: { color: c.destructive },
13
+ helper: { color: c.mutedForeground, fontSize: px(t, 'fontSizes', 'xs') },
14
+ error: { color: c.destructive, fontSize: px(t, 'fontSizes', 'xs') },
15
+ };
16
+ }
@@ -0,0 +1,16 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { HeadingProps } from '../types';
3
+ import { px, weight, type Style } from './util';
4
+
5
+ const SIZE = { 1: '4xl', 2: '3xl', 3: '2xl', 4: 'xl', 5: 'lg', 6: 'md' } as const;
6
+
7
+ export function headingRecipe({ level = 2 }: HeadingProps, t: ResolvedTheme): Style {
8
+ const fontSize = px(t, 'fontSizes', SIZE[level]);
9
+ return {
10
+ color: t.colors.foreground,
11
+ fontSize,
12
+ fontWeight: weight(t, level <= 4 ? 'bold' : 'semibold'),
13
+ // tighter tracking on the large levels, expressed (as the registry does) as a fraction of the size
14
+ letterSpacing: level <= 2 ? Math.round(fontSize * t.scale.letterSpacings.tight * 100) / 100 : 0,
15
+ };
16
+ }
@@ -0,0 +1,40 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { IconColor, IconName, IconProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ export const GLYPHS: Record<IconName, string> = {
6
+ check: '✓',
7
+ close: '✕',
8
+ 'chevron-up': '▴',
9
+ 'chevron-down': '▾',
10
+ 'chevron-left': '◂',
11
+ 'chevron-right': '▸',
12
+ plus: '+',
13
+ minus: '−',
14
+ search: '⌕',
15
+ info: 'ⓘ',
16
+ warning: '⚠',
17
+ star: '★',
18
+ menu: '☰',
19
+ dot: '●',
20
+ };
21
+
22
+ export function iconColor(color: IconColor, t: ResolvedTheme): string {
23
+ const c = t.colors;
24
+ return {
25
+ foreground: c.foreground,
26
+ muted: c.mutedForeground,
27
+ primary: c.primary,
28
+ destructive: c.destructive,
29
+ success: c.success,
30
+ warning: c.warning,
31
+ info: c.info,
32
+ }[color];
33
+ }
34
+
35
+ export function iconRecipe(
36
+ { name, size = 'md', color = 'foreground' }: IconProps,
37
+ t: ResolvedTheme,
38
+ ): { glyph: string; style: Style } {
39
+ return { glyph: GLYPHS[name], style: { color: iconColor(color, t), fontSize: px(t, 'fontSizes', size) } };
40
+ }
@@ -0,0 +1,30 @@
1
+ export type { Style } from './util';
2
+ export * from './button';
3
+ export * from './text';
4
+ export * from './heading';
5
+ export * from './input';
6
+ export * from './textarea';
7
+ export * from './select';
8
+ export * from './checkbox';
9
+ export * from './radio';
10
+ export * from './switch';
11
+ export * from './card';
12
+ export * from './badge';
13
+ export * from './avatar';
14
+ export * from './divider';
15
+ export * from './modal';
16
+ export * from './tabs';
17
+ export * from './feedback';
18
+ export * from './progress';
19
+ export * from './skeleton';
20
+ export * from './spinner';
21
+ export * from './layout';
22
+ export * from './icon';
23
+ export * from './link';
24
+ export * from './accordion';
25
+ export * from './overlay';
26
+ export * from './slider';
27
+ export * from './formcontrol';
28
+ export * from './fab';
29
+ export * from './table';
30
+ export * from './calendar';
@@ -0,0 +1,39 @@
1
+ import { withAlpha, type ResolvedTheme } from '../theme';
2
+ import type { InputProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ export interface InputRecipe {
6
+ container: Style;
7
+ field: Style;
8
+ placeholderTextColor: string;
9
+ /** border colour when focused, for providers that render focus themselves */
10
+ focusBorderColor: string;
11
+ }
12
+
13
+ export function inputRecipe({ disabled = false, invalid = false }: InputProps, t: ResolvedTheme): InputRecipe {
14
+ const c = t.colors;
15
+ return {
16
+ container: {
17
+ height: px(t, 'spacing', '9'),
18
+ width: '100%',
19
+ flexDirection: 'row',
20
+ alignItems: 'center',
21
+ gap: px(t, 'spacing', '2'),
22
+ paddingHorizontal: px(t, 'spacing', '3'),
23
+ borderRadius: px(t, 'radii', 'md'),
24
+ borderWidth: 1,
25
+ borderColor: invalid ? withAlpha(c.destructive, 0.4) : c.border,
26
+ backgroundColor: 'transparent',
27
+ opacity: disabled ? 0.5 : 1,
28
+ },
29
+ field: {
30
+ flex: 1,
31
+ height: '100%',
32
+ color: c.foreground,
33
+ fontSize: px(t, 'fontSizes', 'sm'),
34
+ paddingVertical: px(t, 'spacing', '1'),
35
+ },
36
+ placeholderTextColor: c.mutedForeground,
37
+ focusBorderColor: c.ring,
38
+ };
39
+ }
@@ -0,0 +1,44 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { GridProps, ImageProps, StackProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ export const DEFAULT_SPACE = '2';
6
+
7
+ /** gap of a stack / grid, from a spacing step */
8
+ export function stackRecipe(
9
+ direction: 'row' | 'column',
10
+ { space = DEFAULT_SPACE }: StackProps,
11
+ t: ResolvedTheme,
12
+ ): Style {
13
+ return { flexDirection: direction, gap: px(t, 'spacing', space) };
14
+ }
15
+
16
+ export function centerRecipe(): Style {
17
+ return { alignItems: 'center', justifyContent: 'center' };
18
+ }
19
+
20
+ export function gridRecipe(
21
+ { columns = 2, space = DEFAULT_SPACE }: GridProps,
22
+ t: ResolvedTheme,
23
+ ): { container: Style; cell: Style } {
24
+ const gap = px(t, 'spacing', space);
25
+ const n = Math.max(1, Math.floor(columns));
26
+ // each cell takes an equal share of the row, minus its share of the gaps
27
+ return {
28
+ container: { flexDirection: 'row', flexWrap: 'wrap', gap },
29
+ cell: {
30
+ flexGrow: 0,
31
+ flexShrink: 0,
32
+ flexBasis: `${(100 / n).toFixed(4)}%`,
33
+ maxWidth: `calc(${(100 / n).toFixed(4)}% - ${(gap * (n - 1)) / n}px)`,
34
+ },
35
+ };
36
+ }
37
+
38
+ export function imageRecipe({ width, height, radius }: ImageProps, t: ResolvedTheme): Style {
39
+ const s: Style = {};
40
+ if (width !== undefined) s.width = width;
41
+ if (height !== undefined) s.height = height;
42
+ if (radius) s.borderRadius = px(t, 'radii', radius);
43
+ return s;
44
+ }
@@ -0,0 +1,6 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import { px, type Style } from './util';
3
+
4
+ export function linkRecipe(t: ResolvedTheme): Style {
5
+ return { color: t.colors.primary, fontSize: px(t, 'fontSizes', 'md'), textDecorationLine: 'underline' };
6
+ }
@@ -0,0 +1,40 @@
1
+ import { withAlpha, type ResolvedTheme } from '../theme';
2
+ import type { ModalProps } from '../types';
3
+ import { px, weight, type Style } from './util';
4
+
5
+ export interface ModalRecipe {
6
+ backdrop: Style;
7
+ panel: Style;
8
+ title: Style;
9
+ }
10
+
11
+ export function modalRecipe(_p: ModalProps, t: ResolvedTheme): ModalRecipe {
12
+ const c = t.colors;
13
+ const sh = t.scale.shadows.lg;
14
+ return {
15
+ // the scrim is the shadow colour of the registry (black in the starter), not a literal
16
+ backdrop: {
17
+ flex: 1,
18
+ alignItems: 'center',
19
+ justifyContent: 'center',
20
+ padding: px(t, 'spacing', '4'),
21
+ backgroundColor: withAlpha(sh.color, 0.5),
22
+ },
23
+ panel: {
24
+ width: '100%',
25
+ maxWidth: px(t, 'spacing', '48') * 2.5,
26
+ gap: px(t, 'spacing', '4'),
27
+ padding: px(t, 'spacing', '6'),
28
+ backgroundColor: c.popover,
29
+ borderRadius: px(t, 'radii', 'xl'),
30
+ borderWidth: 1,
31
+ borderColor: c.border,
32
+ shadowColor: sh.color,
33
+ shadowOffset: { width: sh.offsetX, height: sh.offsetY },
34
+ shadowOpacity: sh.opacity,
35
+ shadowRadius: sh.radius,
36
+ elevation: sh.elevation,
37
+ },
38
+ title: { color: c.popoverForeground, fontSize: px(t, 'fontSizes', 'lg'), fontWeight: weight(t, 'semibold') },
39
+ };
40
+ }
@@ -0,0 +1,250 @@
1
+ import { withAlpha, type ResolvedTheme } from '../theme';
2
+ import { px, weight, type Style } from './util';
3
+
4
+ const shadow = (t: ResolvedTheme, key: 'md' | 'lg' | 'xl'): Style => {
5
+ const sh = t.scale.shadows[key];
6
+ return {
7
+ shadowColor: sh.color,
8
+ shadowOffset: { width: sh.offsetX, height: sh.offsetY },
9
+ shadowOpacity: sh.opacity,
10
+ shadowRadius: sh.radius,
11
+ elevation: sh.elevation,
12
+ };
13
+ };
14
+
15
+ /** the surface every floating panel shares: popover colour, border, radius, shadow */
16
+ function surface(t: ResolvedTheme, radius: string, sh: 'md' | 'lg' | 'xl'): Style {
17
+ return {
18
+ backgroundColor: t.colors.popover,
19
+ borderWidth: 1,
20
+ borderColor: t.colors.border,
21
+ borderRadius: px(t, 'radii', radius),
22
+ ...shadow(t, sh),
23
+ };
24
+ }
25
+
26
+ /** the dim layer behind a modal surface: the registry's shadow colour, not a literal */
27
+ export const scrim = (t: ResolvedTheme): string => withAlpha(t.scale.shadows.lg.color, 0.5);
28
+
29
+ export function popoverRecipe(t: ResolvedTheme): { panel: Style } {
30
+ return {
31
+ panel: {
32
+ ...surface(t, 'md', 'md'),
33
+ position: 'absolute',
34
+ top: '100%',
35
+ left: 0,
36
+ marginTop: px(t, 'spacing', '1'),
37
+ minWidth: px(t, 'spacing', '48'),
38
+ padding: px(t, 'spacing', '3'),
39
+ gap: px(t, 'spacing', '2'),
40
+ zIndex: t.scale.zIndex.popover,
41
+ },
42
+ };
43
+ }
44
+
45
+ export function tooltipRecipe(t: ResolvedTheme): { bubble: Style; label: Style } {
46
+ return {
47
+ bubble: {
48
+ position: 'absolute',
49
+ bottom: '100%',
50
+ alignSelf: 'center',
51
+ marginBottom: px(t, 'spacing', '1'),
52
+ paddingHorizontal: px(t, 'spacing', '2'),
53
+ paddingVertical: px(t, 'spacing', '1'),
54
+ borderRadius: px(t, 'radii', 'sm'),
55
+ backgroundColor: t.colors.foreground,
56
+ zIndex: t.scale.zIndex.tooltip,
57
+ },
58
+ label: { color: t.colors.background, fontSize: px(t, 'fontSizes', 'xs') },
59
+ };
60
+ }
61
+
62
+ export interface MenuRecipe {
63
+ panel: Style;
64
+ item: (disabled: boolean) => Style;
65
+ label: (destructive: boolean) => Style;
66
+ }
67
+
68
+ export function menuRecipe(t: ResolvedTheme): MenuRecipe {
69
+ const c = t.colors;
70
+ return {
71
+ panel: {
72
+ ...surface(t, 'md', 'md'),
73
+ position: 'absolute',
74
+ top: '100%',
75
+ left: 0,
76
+ marginTop: px(t, 'spacing', '1'),
77
+ minWidth: px(t, 'spacing', '40'),
78
+ padding: px(t, 'spacing', '1'),
79
+ zIndex: t.scale.zIndex.dropdown,
80
+ },
81
+ item: (disabled) => ({
82
+ paddingHorizontal: px(t, 'spacing', '2'),
83
+ paddingVertical: px(t, 'spacing', '1.5'),
84
+ borderRadius: px(t, 'radii', 'sm'),
85
+ opacity: disabled ? 0.4 : 1,
86
+ }),
87
+ label: (destructive) => ({
88
+ color: destructive ? c.destructive : c.popoverForeground,
89
+ fontSize: px(t, 'fontSizes', 'sm'),
90
+ }),
91
+ };
92
+ }
93
+
94
+ export interface SheetRecipe {
95
+ backdrop: Style;
96
+ panel: Style;
97
+ title: Style;
98
+ handle: Style;
99
+ action: Style;
100
+ actionLabel: (destructive: boolean) => Style;
101
+ cancel: Style;
102
+ cancelLabel: Style;
103
+ }
104
+
105
+ /** action sheet and bottom sheet: a panel that sticks to the bottom edge */
106
+ export function sheetRecipe(t: ResolvedTheme): SheetRecipe {
107
+ const c = t.colors;
108
+ return {
109
+ backdrop: { flex: 1, justifyContent: 'flex-end', backgroundColor: scrim(t) },
110
+ panel: {
111
+ ...surface(t, 'xl', 'xl'),
112
+ borderBottomLeftRadius: 0,
113
+ borderBottomRightRadius: 0,
114
+ width: '100%',
115
+ padding: px(t, 'spacing', '4'),
116
+ gap: px(t, 'spacing', '2'),
117
+ },
118
+ title: {
119
+ color: c.mutedForeground,
120
+ fontSize: px(t, 'fontSizes', 'sm'),
121
+ textAlign: 'center',
122
+ paddingVertical: px(t, 'spacing', '1'),
123
+ },
124
+ handle: {
125
+ alignSelf: 'center',
126
+ width: px(t, 'spacing', '10'),
127
+ height: px(t, 'spacing', '1'),
128
+ borderRadius: px(t, 'radii', 'full'),
129
+ backgroundColor: c.border,
130
+ marginBottom: px(t, 'spacing', '2'),
131
+ },
132
+ action: {
133
+ paddingVertical: px(t, 'spacing', '3'),
134
+ alignItems: 'center',
135
+ borderRadius: px(t, 'radii', 'md'),
136
+ backgroundColor: c.muted,
137
+ },
138
+ actionLabel: (destructive) => ({
139
+ color: destructive ? c.destructive : c.foreground,
140
+ fontSize: px(t, 'fontSizes', 'md'),
141
+ fontWeight: weight(t, 'medium'),
142
+ }),
143
+ cancel: {
144
+ paddingVertical: px(t, 'spacing', '3'),
145
+ alignItems: 'center',
146
+ borderRadius: px(t, 'radii', 'md'),
147
+ borderWidth: 1,
148
+ borderColor: c.border,
149
+ },
150
+ cancelLabel: { color: c.foreground, fontSize: px(t, 'fontSizes', 'md') },
151
+ };
152
+ }
153
+
154
+ export interface AlertDialogRecipe {
155
+ backdrop: Style;
156
+ panel: Style;
157
+ title: Style;
158
+ description: Style;
159
+ actions: Style;
160
+ }
161
+
162
+ export function alertDialogRecipe(t: ResolvedTheme): AlertDialogRecipe {
163
+ const c = t.colors;
164
+ return {
165
+ backdrop: {
166
+ flex: 1,
167
+ alignItems: 'center',
168
+ justifyContent: 'center',
169
+ padding: px(t, 'spacing', '4'),
170
+ backgroundColor: scrim(t),
171
+ },
172
+ panel: {
173
+ ...surface(t, 'xl', 'lg'),
174
+ width: '100%',
175
+ maxWidth: px(t, 'spacing', '48') * 2,
176
+ padding: px(t, 'spacing', '6'),
177
+ gap: px(t, 'spacing', '2'),
178
+ },
179
+ title: { color: c.popoverForeground, fontSize: px(t, 'fontSizes', 'lg'), fontWeight: weight(t, 'semibold') },
180
+ description: { color: c.mutedForeground, fontSize: px(t, 'fontSizes', 'sm') },
181
+ actions: {
182
+ flexDirection: 'row',
183
+ justifyContent: 'flex-end',
184
+ gap: px(t, 'spacing', '2'),
185
+ marginTop: px(t, 'spacing', '4'),
186
+ },
187
+ };
188
+ }
189
+
190
+ export function drawerRecipe(side: 'left' | 'right', t: ResolvedTheme): { backdrop: Style; panel: Style } {
191
+ return {
192
+ backdrop: {
193
+ flex: 1,
194
+ flexDirection: 'row',
195
+ justifyContent: side === 'left' ? 'flex-start' : 'flex-end',
196
+ backgroundColor: scrim(t),
197
+ },
198
+ panel: {
199
+ ...surface(t, 'none', 'xl'),
200
+ height: '100%',
201
+ width: px(t, 'spacing', '48') * 1.5,
202
+ maxWidth: '85%',
203
+ padding: px(t, 'spacing', '4'),
204
+ gap: px(t, 'spacing', '2'),
205
+ borderWidth: 0,
206
+ [side === 'left' ? 'borderRightWidth' : 'borderLeftWidth']: 1,
207
+ },
208
+ };
209
+ }
210
+
211
+ export function imageViewerRecipe(t: ResolvedTheme): {
212
+ backdrop: Style;
213
+ image: Style;
214
+ close: Style;
215
+ closeLabel: Style;
216
+ } {
217
+ return {
218
+ backdrop: {
219
+ flex: 1,
220
+ alignItems: 'center',
221
+ justifyContent: 'center',
222
+ backgroundColor: withAlpha(t.scale.shadows.lg.color, 0.92),
223
+ },
224
+ image: { width: '100%', height: '80%' },
225
+ close: {
226
+ position: 'absolute',
227
+ top: px(t, 'spacing', '10'),
228
+ right: px(t, 'spacing', '4'),
229
+ width: px(t, 'spacing', '10'),
230
+ height: px(t, 'spacing', '10'),
231
+ alignItems: 'center',
232
+ justifyContent: 'center',
233
+ borderRadius: px(t, 'radii', 'full'),
234
+ backgroundColor: withAlpha(t.colors.background, 0.2),
235
+ },
236
+ closeLabel: { color: t.colors.background, fontSize: px(t, 'fontSizes', 'lg') },
237
+ };
238
+ }
239
+
240
+ /** A translucent surface: the card colour at partial opacity over whatever is behind it. */
241
+ export function liquidGlassRecipe(t: ResolvedTheme): Style {
242
+ return {
243
+ backgroundColor: withAlpha(t.colors.card, 0.6),
244
+ borderWidth: 1,
245
+ borderColor: withAlpha(t.colors.border, 0.6),
246
+ borderRadius: px(t, 'radii', 'xl'),
247
+ padding: px(t, 'spacing', '4'),
248
+ ...shadow(t, 'md'),
249
+ };
250
+ }
@@ -0,0 +1,27 @@
1
+ import type { ResolvedTheme } from '../theme';
2
+ import type { ProgressProps } from '../types';
3
+ import { px, type Style } from './util';
4
+
5
+ const HEIGHT = { sm: '1', md: '2', lg: '3' } as const;
6
+
7
+ export interface ProgressRecipe {
8
+ track: Style;
9
+ bar: Style;
10
+ /** the value, clamped to 0..100 */
11
+ value: number;
12
+ }
13
+
14
+ export function progressRecipe({ value, size = 'md' }: ProgressProps, t: ResolvedTheme): ProgressRecipe {
15
+ const pct = Math.min(100, Math.max(0, Number.isFinite(value) ? value : 0));
16
+ return {
17
+ value: pct,
18
+ track: {
19
+ width: '100%',
20
+ height: px(t, 'spacing', HEIGHT[size]),
21
+ borderRadius: px(t, 'radii', 'full'),
22
+ overflow: 'hidden',
23
+ backgroundColor: t.colors.muted,
24
+ },
25
+ bar: { width: `${pct}%`, height: '100%', borderRadius: px(t, 'radii', 'full'), backgroundColor: t.colors.primary },
26
+ };
27
+ }