@flipova/foundation 2.4.3 → 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 +142 -38
  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,22 @@
1
+ import React from 'react';
2
+ import { SectionList as RNSectionList, Text } from 'react-native';
3
+ import { headingRecipe, type SectionListProps } from '../../contract';
4
+ import { useResolvedTheme } from '../provider';
5
+
6
+ export function SectionList(p: SectionListProps) {
7
+ const t = useResolvedTheme();
8
+ const head = headingRecipe({ level: 4 }, t);
9
+ return (
10
+ <RNSectionList
11
+ testID={p.testID}
12
+ sections={p.sections}
13
+ keyExtractor={p.keyExtractor ?? ((_, i) => String(i))}
14
+ renderItem={({ item, index }) => <>{p.renderItem(item, index)}</>}
15
+ renderSectionHeader={({ section }) => (
16
+ <Text accessibilityRole="header" style={head as never}>
17
+ {section.title}
18
+ </Text>
19
+ )}
20
+ />
21
+ );
22
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { StatusBar as RNStatusBar } from 'react-native';
3
+ import type { StatusBarProps } from '../../contract';
4
+ import { useResolvedTheme } from '../provider';
5
+
6
+ export function StatusBar({ style = 'auto' }: StatusBarProps) {
7
+ const t = useResolvedTheme();
8
+ const bar =
9
+ style === 'auto'
10
+ ? t.mode === 'dark'
11
+ ? 'light-content'
12
+ : 'dark-content'
13
+ : style === 'light'
14
+ ? 'light-content'
15
+ : 'dark-content';
16
+ return <RNStatusBar barStyle={bar} />;
17
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View as RNView } from 'react-native';
3
+ import type { ViewProps } from '../../contract';
4
+
5
+ export function View({ children, testID }: ViewProps) {
6
+ return <RNView testID={testID}>{children}</RNView>;
7
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { VirtualizedList as RNVirtualizedList } from 'react-native';
3
+ import type { VirtualizedListProps } from '../../contract';
4
+
5
+ export function VirtualizedList(p: VirtualizedListProps) {
6
+ return (
7
+ <RNVirtualizedList
8
+ testID={p.testID}
9
+ data={p.data}
10
+ horizontal={p.horizontal}
11
+ getItem={(data: unknown[], index: number) => data[index]}
12
+ getItemCount={(data: unknown[]) => data.length}
13
+ keyExtractor={p.keyExtractor ?? ((_: unknown, i: number) => String(i))}
14
+ renderItem={({ item, index }: { item: unknown; index: number }) => <>{p.renderItem(item, index)}</>}
15
+ ListEmptyComponent={p.empty ? <>{p.empty}</> : undefined}
16
+ />
17
+ );
18
+ }
@@ -0,0 +1,64 @@
1
+ /** React Native's own components, shared by every provider: no library replaces them, so each adapter serves these. */
2
+ export { Box } from './Box';
3
+ export { View } from './View';
4
+ export { ScrollView } from './ScrollView';
5
+ export { FlatList } from './FlatList';
6
+ export { VirtualizedList } from './VirtualizedList';
7
+ export { SectionList } from './SectionList';
8
+ export { SafeAreaView } from './SafeAreaView';
9
+ export { KeyboardAvoidingView } from './KeyboardAvoidingView';
10
+ export { StatusBar } from './StatusBar';
11
+ export { RefreshControl } from './RefreshControl';
12
+ export { InputAccessoryView } from './InputAccessoryView';
13
+ export { Image } from './Image';
14
+ export { ImageBackground } from './ImageBackground';
15
+ export { Pressable } from './Pressable';
16
+ import type { ProviderComponents } from '../../contract';
17
+ import { Box } from './Box';
18
+ import { View } from './View';
19
+ import { ScrollView } from './ScrollView';
20
+ import { FlatList } from './FlatList';
21
+ import { VirtualizedList } from './VirtualizedList';
22
+ import { SectionList } from './SectionList';
23
+ import { SafeAreaView } from './SafeAreaView';
24
+ import { KeyboardAvoidingView } from './KeyboardAvoidingView';
25
+ import { StatusBar } from './StatusBar';
26
+ import { RefreshControl } from './RefreshControl';
27
+ import { InputAccessoryView } from './InputAccessoryView';
28
+ import { Image } from './Image';
29
+ import { ImageBackground } from './ImageBackground';
30
+ import { Pressable } from './Pressable';
31
+
32
+ export const RN_BASE_NAMES = [
33
+ 'Box',
34
+ 'View',
35
+ 'ScrollView',
36
+ 'FlatList',
37
+ 'VirtualizedList',
38
+ 'SectionList',
39
+ 'SafeAreaView',
40
+ 'KeyboardAvoidingView',
41
+ 'StatusBar',
42
+ 'RefreshControl',
43
+ 'InputAccessoryView',
44
+ 'Image',
45
+ 'ImageBackground',
46
+ 'Pressable',
47
+ ] as const;
48
+
49
+ export const rnBase: ProviderComponents = {
50
+ Box,
51
+ View,
52
+ ScrollView,
53
+ FlatList,
54
+ VirtualizedList,
55
+ SectionList,
56
+ SafeAreaView,
57
+ KeyboardAvoidingView,
58
+ StatusBar,
59
+ RefreshControl,
60
+ InputAccessoryView,
61
+ Image,
62
+ ImageBackground,
63
+ Pressable,
64
+ };
@@ -0,0 +1,375 @@
1
+ import React from 'react';
2
+ import { Image, Switch as RNSwitch, TextInput } from 'react-native';
3
+ import { TamaguiProvider, Text as TText, View as TView, createTamagui, createTokens, styled } from '@tamagui/core';
4
+ import type {
5
+ FormControlProps,
6
+ IconProps,
7
+ LinkProps,
8
+ LiquidGlassProps,
9
+ AvatarProps,
10
+ CheckboxProps,
11
+ ProgressProps,
12
+ BoxProps,
13
+ CenterProps,
14
+ DividerProps,
15
+ HeadingProps,
16
+ HStackProps,
17
+ VStackProps,
18
+ ViewProps,
19
+ BadgeProps,
20
+ ButtonProps,
21
+ CardProps,
22
+ InputProps,
23
+ ProviderComponents,
24
+ ResolvedTheme,
25
+ SwitchProps,
26
+ TextProps,
27
+ } from '../../contract';
28
+ import { defaultRegistry, type ThemeRegistry } from '../../contract';
29
+ import {
30
+ formControlRecipe,
31
+ iconRecipe,
32
+ linkRecipe,
33
+ liquidGlassRecipe,
34
+ avatarRecipe,
35
+ checkboxRecipe,
36
+ initialsOf,
37
+ progressRecipe,
38
+ badgeRecipe,
39
+ buttonRecipe,
40
+ cardRecipe,
41
+ centerRecipe,
42
+ dividerRecipe,
43
+ headingRecipe,
44
+ inputRecipe,
45
+ stackRecipe,
46
+ switchRecipe,
47
+ textRecipe,
48
+ } from '../../contract';
49
+ import { useResolvedTheme } from '../provider';
50
+ import { rnBase } from '../rn-base';
51
+ import { defineAdapter } from '../types';
52
+
53
+ /** Tamagui refuses token names that are CSS-wide keywords (`none`...): those are renamed here, and only here. */
54
+ export const TAMAGUI_RENAMES: Record<string, string> = { none: 'zero' };
55
+ const rename = (scale: Record<string, number>) =>
56
+ Object.fromEntries(Object.entries(scale).map(([k, v]) => [TAMAGUI_RENAMES[k] ?? k, v]));
57
+ const numeric = (scale: Record<string, number>) => Object.fromEntries(Object.entries(scale).map(([k, v]) => [k, v]));
58
+
59
+ /**
60
+ * The registry as a Tamagui configuration: tokens from the scales, one Tamagui theme per registry theme (colour roles
61
+ * become `$primary`, `$cardForeground`...). Nothing in it is written by hand.
62
+ */
63
+ export function buildTamaguiConfig(designTheme: ThemeRegistry = defaultRegistry) {
64
+ const tokens = createTokens({
65
+ color: Object.fromEntries(Object.entries(Object.values(designTheme.themes)[0].colors).map(([k, v]) => [k, v])),
66
+ space: { ...numeric(designTheme.scale.spacing) },
67
+ size: { ...numeric(designTheme.scale.spacing) },
68
+ radius: { ...rename(designTheme.scale.radii) },
69
+ zIndex: { 0: 0 },
70
+ } as never);
71
+ const themes = Object.fromEntries(Object.entries(designTheme.themes).map(([id, t]) => [id, { ...t.colors }]));
72
+ return createTamagui({
73
+ tokens,
74
+ themes,
75
+ fonts: {
76
+ body: {
77
+ family: (designTheme.scale.fontFamilies.system ?? Object.values(designTheme.scale.fontFamilies)[0]).native,
78
+ size: numeric(designTheme.scale.fontSizes),
79
+ lineHeight: numeric(designTheme.scale.fontSizes),
80
+ weight: { 4: '400' },
81
+ letterSpacing: { 4: 0 },
82
+ },
83
+ } as never,
84
+ settings: { defaultFont: 'body' } as never,
85
+ } as never);
86
+ }
87
+
88
+ export const tamaguiConfig = buildTamaguiConfig();
89
+
90
+ const configs = new WeakMap<ThemeRegistry, ReturnType<typeof buildTamaguiConfig>>();
91
+ function configFor(registry: ThemeRegistry) {
92
+ let c = configs.get(registry);
93
+ if (!c) configs.set(registry, (c = buildTamaguiConfig(registry)));
94
+ return c;
95
+ }
96
+
97
+ // Styled primitives. Colours are theme roles ('$primary'), so switching theme re-resolves them.
98
+ const Btn = styled(TView, {
99
+ name: 'FlipovaButton',
100
+ flexDirection: 'row',
101
+ alignItems: 'center',
102
+ justifyContent: 'center',
103
+ borderRadius: '$md',
104
+ gap: '$2',
105
+ } as never);
106
+ const Surface = styled(TView, { name: 'FlipovaSurface' } as never);
107
+ const Label = styled(TText, { name: 'FlipovaLabel' } as never);
108
+
109
+ /** Tamagui resolves `$token` strings through the theme; recipes already hold final values, which Tamagui passes through. */
110
+ function Button(p: ButtonProps) {
111
+ const t = useResolvedTheme();
112
+ const r = buttonRecipe(p, t);
113
+ return (
114
+ <Btn
115
+ {...({
116
+ style: r.container,
117
+ disabled: !!(p.disabled || p.loading),
118
+ onPress: p.onPress,
119
+ role: 'button',
120
+ focusable: true,
121
+ accessibilityLabel: p.accessibilityLabel,
122
+ testID: p.testID,
123
+ } as object)}
124
+ >
125
+ {typeof p.children === 'string' ? <Label {...({ style: r.label } as object)}>{p.children}</Label> : p.children}
126
+ </Btn>
127
+ );
128
+ }
129
+
130
+ function Text(p: TextProps) {
131
+ const t = useResolvedTheme();
132
+ return (
133
+ <Label {...({ style: textRecipe(p, t), numberOfLines: p.isTruncated ? 1 : undefined, testID: p.testID } as object)}>
134
+ {p.children}
135
+ </Label>
136
+ );
137
+ }
138
+
139
+ function Input(p: InputProps) {
140
+ const t = useResolvedTheme();
141
+ const r = inputRecipe(p, t);
142
+ return (
143
+ <Surface {...({ style: r.container } as object)}>
144
+ <TextInput
145
+ style={r.field as object}
146
+ value={p.value}
147
+ defaultValue={p.defaultValue}
148
+ placeholder={p.placeholder}
149
+ placeholderTextColor={r.placeholderTextColor}
150
+ onChangeText={p.onChangeText}
151
+ editable={!p.disabled}
152
+ secureTextEntry={p.secureTextEntry}
153
+ accessibilityLabel={p.accessibilityLabel}
154
+ testID={p.testID}
155
+ />
156
+ </Surface>
157
+ );
158
+ }
159
+
160
+ function Card(p: CardProps) {
161
+ const t = useResolvedTheme();
162
+ return <Surface {...({ style: cardRecipe(p, t), testID: p.testID } as object)}>{p.children}</Surface>;
163
+ }
164
+
165
+ function Badge(p: BadgeProps) {
166
+ const t = useResolvedTheme();
167
+ const r = badgeRecipe(p, t);
168
+ return (
169
+ <Surface {...({ style: r.container, testID: p.testID } as object)}>
170
+ <Label {...({ style: r.label } as object)}>{p.children}</Label>
171
+ </Surface>
172
+ );
173
+ }
174
+
175
+ function Switch(p: SwitchProps) {
176
+ const t = useResolvedTheme();
177
+ const r = switchRecipe(p, t);
178
+ return (
179
+ <RNSwitch
180
+ value={!!p.value}
181
+ onValueChange={p.onValueChange}
182
+ disabled={p.disabled}
183
+ trackColor={{ true: r.trackOn, false: r.trackOff }}
184
+ thumbColor={r.thumb}
185
+ style={{ opacity: r.opacity, transform: [{ scale: r.scale }] }}
186
+ accessibilityLabel={p.accessibilityLabel}
187
+ testID={p.testID}
188
+ />
189
+ );
190
+ }
191
+
192
+ // ---- layout and text primitives Tamagui really has (View / Text), styled from the recipes ----------------------------
193
+
194
+ const box = (style: object | undefined, p: { testID?: string; children?: React.ReactNode }) => (
195
+ <Surface {...({ style, testID: p.testID } as object)}>{p.children}</Surface>
196
+ );
197
+ const Box = (p: BoxProps) => box(undefined, p);
198
+ const View = (p: ViewProps) => box(undefined, p);
199
+ const Center = (p: CenterProps) => box(centerRecipe(), p);
200
+ function HStack(p: HStackProps) {
201
+ return box(stackRecipe('row', p, useResolvedTheme()), p);
202
+ }
203
+ function VStack(p: VStackProps) {
204
+ return box(stackRecipe('column', p, useResolvedTheme()), p);
205
+ }
206
+ function Divider(p: DividerProps) {
207
+ return box(dividerRecipe(p, useResolvedTheme()), p);
208
+ }
209
+ function Heading(p: HeadingProps) {
210
+ const t = useResolvedTheme();
211
+ return (
212
+ <Label
213
+ {...({
214
+ role: 'heading',
215
+ style: headingRecipe(p, t),
216
+ numberOfLines: p.isTruncated ? 1 : undefined,
217
+ testID: p.testID,
218
+ } as object)}
219
+ >
220
+ {p.children}
221
+ </Label>
222
+ );
223
+ }
224
+
225
+ function Checkbox(p: CheckboxProps) {
226
+ const r = checkboxRecipe(p, useResolvedTheme());
227
+ return (
228
+ <Surface
229
+ {...({
230
+ role: 'checkbox',
231
+ 'aria-checked': !!p.checked,
232
+ 'aria-disabled': !!p.disabled,
233
+ 'aria-label': p.accessibilityLabel ?? p.label,
234
+ style: r.row,
235
+ onPress: p.disabled ? undefined : () => p.onCheckedChange?.(!p.checked),
236
+ testID: p.testID,
237
+ } as object)}
238
+ >
239
+ <Surface {...({ style: r.box } as object)}>
240
+ {p.checked ? <Label {...({ style: r.mark } as object)}>✓</Label> : null}
241
+ </Surface>
242
+ {p.label ? <Label {...({ style: r.label } as object)}>{p.label}</Label> : null}
243
+ </Surface>
244
+ );
245
+ }
246
+
247
+ function Avatar(p: AvatarProps) {
248
+ const r = avatarRecipe(p, useResolvedTheme());
249
+ return (
250
+ <Surface
251
+ {...({
252
+ role: 'img',
253
+ 'aria-label': p.accessibilityLabel ?? p.name,
254
+ style: r.container,
255
+ testID: p.testID,
256
+ } as object)}
257
+ >
258
+ {p.source ? (
259
+ <Image source={{ uri: p.source }} style={r.image as never} />
260
+ ) : (
261
+ <Label {...({ style: r.initials } as object)}>{initialsOf(p.name)}</Label>
262
+ )}
263
+ </Surface>
264
+ );
265
+ }
266
+
267
+ function Progress(p: ProgressProps) {
268
+ const r = progressRecipe(p, useResolvedTheme());
269
+ return (
270
+ <Surface
271
+ {...({
272
+ role: 'progressbar',
273
+ 'aria-valuemin': 0,
274
+ 'aria-valuemax': 100,
275
+ 'aria-valuenow': r.value,
276
+ 'aria-label': p.accessibilityLabel,
277
+ style: r.track,
278
+ testID: p.testID,
279
+ } as object)}
280
+ >
281
+ <Surface {...({ style: r.bar } as object)} />
282
+ </Surface>
283
+ );
284
+ }
285
+
286
+ function Icon(p: IconProps) {
287
+ const r = iconRecipe(p, useResolvedTheme());
288
+ return (
289
+ <Label
290
+ {...({
291
+ style: r.style,
292
+ 'aria-label': p.accessibilityLabel,
293
+ 'aria-hidden': p.accessibilityLabel ? undefined : true,
294
+ testID: p.testID,
295
+ } as object)}
296
+ >
297
+ {r.glyph}
298
+ </Label>
299
+ );
300
+ }
301
+
302
+ function Link(p: LinkProps) {
303
+ const t = useResolvedTheme();
304
+ return (
305
+ <Label {...({ role: 'link', style: linkRecipe(t), onPress: p.onPress, testID: p.testID } as object)}>
306
+ {p.children}
307
+ </Label>
308
+ );
309
+ }
310
+
311
+ function LiquidGlass(p: LiquidGlassProps) {
312
+ return box(liquidGlassRecipe(useResolvedTheme()), p);
313
+ }
314
+
315
+ function FormControl(p: FormControlProps) {
316
+ const r = formControlRecipe(!!p.disabled, useResolvedTheme());
317
+ return (
318
+ <Surface {...({ style: r.root, testID: p.testID } as object)}>
319
+ {p.label ? (
320
+ <Label {...({ style: r.label } as object)}>
321
+ {p.label}
322
+ {p.required ? <Label {...({ style: r.required } as object)}> *</Label> : null}
323
+ </Label>
324
+ ) : null}
325
+ {p.children}
326
+ {p.error ? (
327
+ <Label {...({ role: 'alert', style: r.error } as object)}>{p.error}</Label>
328
+ ) : p.helper ? (
329
+ <Label {...({ style: r.helper } as object)}>{p.helper}</Label>
330
+ ) : null}
331
+ </Surface>
332
+ );
333
+ }
334
+
335
+ const components: ProviderComponents = {
336
+ ...rnBase,
337
+ Button,
338
+ Text,
339
+ Input,
340
+ Card,
341
+ Badge,
342
+ Switch,
343
+ Box,
344
+ View,
345
+ Center,
346
+ HStack,
347
+ VStack,
348
+ Divider,
349
+ Heading,
350
+ Checkbox,
351
+ Avatar,
352
+ Progress,
353
+ Icon,
354
+ Link,
355
+ LiquidGlass,
356
+ FormControl,
357
+ };
358
+
359
+ export const tamagui = defineAdapter({
360
+ name: 'tamagui',
361
+ Provider: ({
362
+ theme,
363
+ registry,
364
+ children,
365
+ }: {
366
+ theme: ResolvedTheme;
367
+ registry: ThemeRegistry;
368
+ children?: React.ReactNode;
369
+ }) => (
370
+ <TamaguiProvider config={configFor(registry)} defaultTheme={theme.id}>
371
+ {children}
372
+ </TamaguiProvider>
373
+ ),
374
+ components,
375
+ });
@@ -0,0 +1,17 @@
1
+ import type { ComponentType, ReactNode } from 'react';
2
+ import type { ProviderComponents, ProviderName, ResolvedTheme, ThemeRegistry } from '../contract';
3
+
4
+ /**
5
+ * A provider adapter: the component library a theme is rendered with. The app picks one and the rest of its code
6
+ * only ever talks to the contract (`import { Button } from '@flipova/foundation/ui'`), so switching library is a
7
+ * one-line change.
8
+ */
9
+ export interface ProviderAdapter {
10
+ name: ProviderName;
11
+ /** Mounts the library's own provider (Paper's PaperProvider, Tamagui's TamaguiProvider, ...) for this theme. */
12
+ Provider: ComponentType<{ theme: ResolvedTheme; registry: ThemeRegistry; children?: ReactNode }>;
13
+ /** The components the library really has. Any missing one is served by the flipova provider (see ui/). */
14
+ components: ProviderComponents;
15
+ }
16
+
17
+ export const defineAdapter = (adapter: ProviderAdapter): ProviderAdapter => adapter;