@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.
- package/CHANGES.md +66 -0
- package/COMPONENTS.md +102 -0
- package/DOCS.md +261 -0
- package/LICENSE +1 -1
- package/README.md +169 -118
- package/components/contract/index.ts +3 -0
- package/components/contract/recipes/accordion.ts +42 -0
- package/components/contract/recipes/avatar.ts +41 -0
- package/components/contract/recipes/badge.ts +46 -0
- package/components/contract/recipes/button.ts +58 -0
- package/components/contract/recipes/calendar.ts +118 -0
- package/components/contract/recipes/card.ts +21 -0
- package/components/contract/recipes/checkbox.ts +33 -0
- package/components/contract/recipes/divider.ts +9 -0
- package/components/contract/recipes/fab.ts +31 -0
- package/components/contract/recipes/feedback.ts +66 -0
- package/components/contract/recipes/formcontrol.ts +16 -0
- package/components/contract/recipes/heading.ts +16 -0
- package/components/contract/recipes/icon.ts +40 -0
- package/components/contract/recipes/index.ts +30 -0
- package/components/contract/recipes/input.ts +39 -0
- package/components/contract/recipes/layout.ts +44 -0
- package/components/contract/recipes/link.ts +6 -0
- package/components/contract/recipes/modal.ts +40 -0
- package/components/contract/recipes/overlay.ts +250 -0
- package/components/contract/recipes/progress.ts +27 -0
- package/components/contract/recipes/radio.ts +39 -0
- package/components/contract/recipes/select.ts +63 -0
- package/components/contract/recipes/skeleton.ts +25 -0
- package/components/contract/recipes/slider.ts +50 -0
- package/components/contract/recipes/spinner.ts +12 -0
- package/components/contract/recipes/switch.ts +26 -0
- package/components/contract/recipes/table.ts +37 -0
- package/components/contract/recipes/tabs.ts +31 -0
- package/components/contract/recipes/text.ts +12 -0
- package/components/contract/recipes/textarea.ts +37 -0
- package/components/contract/recipes/util.ts +15 -0
- package/components/contract/theme.ts +116 -0
- package/components/contract/types.ts +598 -0
- package/components/providers/css-vars.ts +43 -0
- package/components/providers/flipova/components/Accordion.tsx +41 -0
- package/components/providers/flipova/components/ActionSheet.tsx +34 -0
- package/components/providers/flipova/components/Alert.tsx +15 -0
- package/components/providers/flipova/components/AlertDialog.tsx +31 -0
- package/components/providers/flipova/components/Avatar.tsx +30 -0
- package/components/providers/flipova/components/Badge.tsx +14 -0
- package/components/providers/flipova/components/BottomSheet.tsx +24 -0
- package/components/providers/flipova/components/Box.tsx +1 -0
- package/components/providers/flipova/components/Button.tsx +31 -0
- package/components/providers/flipova/components/Calendar.tsx +85 -0
- package/components/providers/flipova/components/Card.tsx +13 -0
- package/components/providers/flipova/components/Center.tsx +11 -0
- package/components/providers/flipova/components/Checkbox.tsx +24 -0
- package/components/providers/flipova/components/DateTimePicker.tsx +45 -0
- package/components/providers/flipova/components/Divider.tsx +9 -0
- package/components/providers/flipova/components/Drawer.tsx +18 -0
- package/components/providers/flipova/components/Fab.tsx +22 -0
- package/components/providers/flipova/components/FlatList.tsx +1 -0
- package/components/providers/flipova/components/FormControl.tsx +27 -0
- package/components/providers/flipova/components/Grid.tsx +18 -0
- package/components/providers/flipova/components/HStack.tsx +13 -0
- package/components/providers/flipova/components/Heading.tsx +19 -0
- package/components/providers/flipova/components/Icon.tsx +20 -0
- package/components/providers/flipova/components/Image.tsx +1 -0
- package/components/providers/flipova/components/ImageBackground.tsx +1 -0
- package/components/providers/flipova/components/ImageViewer.tsx +25 -0
- package/components/providers/flipova/components/Input.tsx +29 -0
- package/components/providers/flipova/components/InputAccessoryView.tsx +1 -0
- package/components/providers/flipova/components/KeyboardAvoidingView.tsx +1 -0
- package/components/providers/flipova/components/Link.tsx +21 -0
- package/components/providers/flipova/components/LiquidGlass.tsx +13 -0
- package/components/providers/flipova/components/Menu.tsx +43 -0
- package/components/providers/flipova/components/Modal.tsx +24 -0
- package/components/providers/flipova/components/Popover.tsx +23 -0
- package/components/providers/flipova/components/Portal.tsx +42 -0
- package/components/providers/flipova/components/Pressable.tsx +1 -0
- package/components/providers/flipova/components/Progress.tsx +22 -0
- package/components/providers/flipova/components/RadioGroup.tsx +36 -0
- package/components/providers/flipova/components/RefreshControl.tsx +1 -0
- package/components/providers/flipova/components/SafeAreaView.tsx +1 -0
- package/components/providers/flipova/components/ScrollView.tsx +1 -0
- package/components/providers/flipova/components/SectionList.tsx +1 -0
- package/components/providers/flipova/components/Select.tsx +61 -0
- package/components/providers/flipova/components/Skeleton.tsx +25 -0
- package/components/providers/flipova/components/Slider.tsx +52 -0
- package/components/providers/flipova/components/Spinner.tsx +19 -0
- package/components/providers/flipova/components/StatusBar.tsx +1 -0
- package/components/providers/flipova/components/Switch.tsx +21 -0
- package/components/providers/flipova/components/Table.tsx +33 -0
- package/components/providers/flipova/components/Tabs.tsx +39 -0
- package/components/providers/flipova/components/Text.tsx +13 -0
- package/components/providers/flipova/components/Textarea.tsx +28 -0
- package/components/providers/flipova/components/Toast.tsx +28 -0
- package/components/providers/flipova/components/Tooltip.tsx +34 -0
- package/components/providers/flipova/components/VStack.tsx +13 -0
- package/components/providers/flipova/components/View.tsx +1 -0
- package/components/providers/flipova/components/VirtualizedList.tsx +1 -0
- package/components/providers/flipova/index.tsx +189 -0
- package/components/providers/gluestack/index.tsx +226 -0
- package/components/providers/gluestack/more.tsx +151 -0
- package/components/{ui → providers/gluestack/ui}/accordion/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/actionsheet/index.tsx +15 -15
- package/components/{ui → providers/gluestack/ui}/alert/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/alert-dialog/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/badge/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/bottomsheet/index.tsx +11 -10
- package/components/{ui → providers/gluestack/ui}/box/index.tsx +4 -1
- package/components/{ui → providers/gluestack/ui}/button/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/calendar/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/card/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/center/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/checkbox/index.tsx +9 -8
- package/components/{ui → providers/gluestack/ui}/date-time-picker/index.tsx +4 -4
- package/components/providers/gluestack/ui/date-time-picker/index.web.tsx +197 -0
- package/components/{ui → providers/gluestack/ui}/divider/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/drawer/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/fab/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/form-control/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/config.ts +1 -62
- package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.js +1 -1
- package/components/{ui → providers/gluestack/ui}/grid/index.tsx +3 -3
- package/components/{ui → providers/gluestack/ui}/heading/index.tsx +7 -7
- package/components/{ui → providers/gluestack/ui}/hstack/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/icon/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/image/index.tsx +0 -1
- package/components/{ui → providers/gluestack/ui}/image-viewer/index.tsx +96 -99
- package/components/providers/gluestack/ui/index.ts +58 -0
- package/components/{ui → providers/gluestack/ui}/input/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/link/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/liquid-glass/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/menu/index.tsx +5 -4
- package/components/{ui → providers/gluestack/ui}/modal/index.tsx +19 -17
- package/components/{ui → providers/gluestack/ui}/popover/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/portal/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/progress/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/radio/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/select/index.tsx +8 -12
- package/components/{ui → providers/gluestack/ui}/select/select-actionsheet.tsx +13 -13
- package/components/{ui → providers/gluestack/ui}/skeleton/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/slider/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/spinner/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/table/index.tsx +33 -33
- package/components/{ui → providers/gluestack/ui}/tabs/TabsAnimatedIndicator.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/tabs/index.tsx +2 -2
- package/components/{ui → providers/gluestack/ui}/text/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/toast/index.tsx +4 -4
- package/components/{ui → providers/gluestack/ui}/tooltip/index.tsx +1 -1
- package/components/{ui → providers/gluestack/ui}/vstack/index.tsx +1 -1
- package/components/providers/index.ts +2 -0
- package/components/providers/paper/index.tsx +449 -0
- package/components/providers/provider.tsx +80 -0
- package/components/providers/reusables/classes.ts +163 -0
- package/components/providers/reusables/index.tsx +289 -0
- package/components/providers/rn-base/Box.tsx +7 -0
- package/components/providers/rn-base/FlatList.tsx +16 -0
- package/components/providers/rn-base/Image.tsx +18 -0
- package/components/providers/rn-base/ImageBackground.tsx +11 -0
- package/components/providers/rn-base/InputAccessoryView.tsx +9 -0
- package/components/providers/rn-base/KeyboardAvoidingView.tsx +15 -0
- package/components/providers/rn-base/Pressable.tsx +19 -0
- package/components/providers/rn-base/RefreshControl.tsx +16 -0
- package/components/providers/rn-base/SafeAreaView.tsx +11 -0
- package/components/providers/rn-base/ScrollView.tsx +11 -0
- package/components/providers/rn-base/SectionList.tsx +22 -0
- package/components/providers/rn-base/StatusBar.tsx +17 -0
- package/components/providers/rn-base/View.tsx +7 -0
- package/components/providers/rn-base/VirtualizedList.tsx +18 -0
- package/components/providers/rn-base/index.tsx +64 -0
- package/components/providers/tamagui/index.tsx +375 -0
- package/components/providers/types.ts +17 -0
- package/components/theme/design-theme.ts +230 -0
- package/components/ui/create.tsx +14 -0
- package/components/ui/index.ts +68 -58
- package/components/ui/resolve.ts +40 -0
- package/design/canonical.index.txt +2 -16
- package/design/manifest.xml +4 -3
- package/design/schema.xsd +44 -434
- package/design/themes.xml +7 -177
- package/design/tools/{npm.js → cli.js} +173 -73
- package/design/tools/gui/index.html +998 -0
- package/design/tools/lib/check.js +533 -0
- package/design/tools/lib/contract.js +23 -0
- package/design/tools/lib/edit.js +166 -0
- package/design/tools/lib/generate.js +465 -0
- package/design/tools/lib/gui.js +614 -0
- package/design/tools/lib/lint.js +139 -0
- package/design/tools/lib/registry.js +135 -0
- package/design/tools/lib/util.js +53 -0
- package/design/tools/lib/xml.js +257 -0
- package/design/tools/lib/xsd.js +408 -0
- package/dist/chunk-2QM2ZUDS.mjs +1308 -0
- package/dist/chunk-2QM2ZUDS.mjs.map +1 -0
- package/dist/chunk-2T2TCUYF.js +1371 -0
- package/dist/chunk-2T2TCUYF.js.map +1 -0
- package/dist/chunk-6UKTC4KF.js +43 -0
- package/dist/chunk-6UKTC4KF.js.map +1 -0
- package/dist/chunk-6Z4WRTI4.mjs +37 -0
- package/dist/chunk-6Z4WRTI4.mjs.map +1 -0
- package/dist/chunk-G3K6J5KY.js +157 -0
- package/dist/chunk-G3K6J5KY.js.map +1 -0
- package/dist/chunk-GM45RCSI.mjs +96 -0
- package/dist/chunk-GM45RCSI.mjs.map +1 -0
- package/dist/chunk-GQJLHH2P.mjs +3 -0
- package/dist/chunk-GQJLHH2P.mjs.map +1 -0
- package/dist/chunk-ICNR56VP.js +1653 -0
- package/dist/chunk-ICNR56VP.js.map +1 -0
- package/dist/chunk-J5LGTIGS.mjs +9 -0
- package/dist/chunk-J5LGTIGS.mjs.map +1 -0
- package/dist/chunk-LRPZLF2K.mjs +30 -0
- package/dist/chunk-LRPZLF2K.mjs.map +1 -0
- package/dist/chunk-OC4MXNXU.js +32 -0
- package/dist/chunk-OC4MXNXU.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +11 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-RWVTZUEG.js +161 -0
- package/dist/chunk-RWVTZUEG.js.map +1 -0
- package/dist/chunk-V473I5XQ.js +4 -0
- package/dist/chunk-V473I5XQ.js.map +1 -0
- package/dist/chunk-V4ULAISZ.js +915 -0
- package/dist/chunk-V4ULAISZ.js.map +1 -0
- package/dist/chunk-WRJERTJS.mjs +145 -0
- package/dist/chunk-WRJERTJS.mjs.map +1 -0
- package/dist/chunk-YIBPE3KQ.mjs +864 -0
- package/dist/chunk-YIBPE3KQ.mjs.map +1 -0
- package/dist/chunk-YUAQIZPN.mjs +1556 -0
- package/dist/chunk-YUAQIZPN.mjs.map +1 -0
- package/dist/contract/index.d.mts +304 -0
- package/dist/contract/index.d.ts +304 -0
- package/dist/contract/index.js +256 -0
- package/dist/contract/index.js.map +1 -0
- package/dist/contract/index.mjs +3 -0
- package/dist/contract/index.mjs.map +1 -0
- package/dist/index.d.mts +4 -40
- package/dist/index.d.ts +4 -40
- package/dist/index.js +73 -992
- package/dist/index.mjs +2 -1
- package/dist/providers/flipova/index.d.mts +133 -0
- package/dist/providers/flipova/index.d.ts +133 -0
- package/dist/providers/flipova/index.js +249 -0
- package/dist/providers/flipova/index.js.map +1 -0
- package/dist/providers/flipova/index.mjs +4 -0
- package/dist/providers/flipova/index.mjs.map +1 -0
- package/dist/providers/gluestack/index.d.mts +7 -0
- package/dist/providers/gluestack/index.d.ts +7 -0
- package/dist/providers/gluestack/index.js +240 -0
- package/dist/providers/gluestack/index.js.map +1 -0
- package/dist/providers/gluestack/index.mjs +238 -0
- package/dist/providers/gluestack/index.mjs.map +1 -0
- package/dist/providers/gluestack/ui/index.d.mts +3472 -0
- package/dist/providers/gluestack/ui/index.d.ts +3472 -0
- package/dist/{chunk-LCTFQJZM.js → providers/gluestack/ui/index.js} +860 -2297
- package/dist/providers/gluestack/ui/index.js.map +1 -0
- package/dist/{chunk-2R66P5X5.mjs → providers/gluestack/ui/index.mjs} +468 -2062
- package/dist/providers/gluestack/ui/index.mjs.map +1 -0
- package/dist/providers/index.d.mts +37 -0
- package/dist/providers/index.d.ts +37 -0
- package/dist/providers/index.js +28 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +3 -0
- package/dist/providers/index.mjs.map +1 -0
- package/dist/providers/paper/index.d.mts +30 -0
- package/dist/providers/paper/index.d.ts +30 -0
- package/dist/providers/paper/index.js +362 -0
- package/dist/providers/paper/index.js.map +1 -0
- package/dist/providers/paper/index.mjs +353 -0
- package/dist/providers/paper/index.mjs.map +1 -0
- package/dist/providers/reusables/index.d.mts +60 -0
- package/dist/providers/reusables/index.d.ts +60 -0
- package/dist/providers/reusables/index.js +348 -0
- package/dist/providers/reusables/index.js.map +1 -0
- package/dist/providers/reusables/index.mjs +311 -0
- package/dist/providers/reusables/index.mjs.map +1 -0
- package/dist/providers/tamagui/index.d.mts +15 -0
- package/dist/providers/tamagui/index.d.ts +15 -0
- package/dist/providers/tamagui/index.js +275 -0
- package/dist/providers/tamagui/index.js.map +1 -0
- package/dist/providers/tamagui/index.mjs +270 -0
- package/dist/providers/tamagui/index.mjs.map +1 -0
- package/dist/theme-BznFrVT1.d.mts +566 -0
- package/dist/theme-BznFrVT1.d.ts +566 -0
- package/dist/types-C7P80VKR.d.ts +22 -0
- package/dist/types-Tspvmask.d.mts +22 -0
- package/dist/ui/index.d.mts +190 -7017
- package/dist/ui/index.d.ts +190 -7017
- package/dist/ui/index.js +73 -992
- package/dist/ui/index.mjs +2 -1
- package/package.json +136 -35
- package/components/ui/date-time-picker/index.web.tsx +0 -195
- package/design/documentation.xml +0 -607
- package/design/tools/design.js +0 -188
- package/design/tools/requirements.txt +0 -35
- package/design/tools/sources/.checker/__init__.py +0 -81
- package/design/tools/sources/.checker/checks.py +0 -198
- package/design/tools/sources/.checker/cli.py +0 -154
- package/design/tools/sources/.checker/io.py +0 -242
- package/design/tools/sources/.checker/model.py +0 -144
- package/design/tools/sources/.checker/registry.py +0 -115
- package/design/tools/sources/.checker/report.py +0 -21
- package/design/tools/sources/.docgen/__init__.py +0 -45
- package/design/tools/sources/.docgen/cli.py +0 -101
- package/design/tools/sources/.docgen/model.py +0 -147
- package/design/tools/sources/.docgen/reference.py +0 -97
- package/design/tools/sources/.docgen/site.py +0 -145
- package/design/tools/sources/.docgen/xsddoc.py +0 -329
- package/design/tools/sources/.generate/__init__.py +0 -35
- package/design/tools/sources/.generate/cli.py +0 -76
- package/design/tools/sources/.generate/common.py +0 -33
- package/design/tools/sources/.generate/config.py +0 -177
- package/design/tools/sources/.generate/model.py +0 -51
- package/design/tools/sources/.generate/tokens.py +0 -141
- package/design/tools/sources/.linter/__init__.py +0 -9
- package/design/tools/sources/.linter/cli.py +0 -44
- package/design/tools/sources/.linter/discovery.py +0 -30
- package/design/tools/sources/.linter/errors.py +0 -45
- package/design/tools/sources/.linter/linter.py +0 -68
- package/design/tools/sources/.xmleditor/__init__.py +0 -74
- package/design/tools/sources/.xmleditor/blocks.py +0 -185
- package/design/tools/sources/.xmleditor/cli.py +0 -141
- package/design/tools/sources/.xmleditor/editor.py +0 -906
- package/design/tools/sources/.xmleditor/model.py +0 -708
- package/design/tools/sources/.xmleditor/widgets.py +0 -1832
- package/design/tools/sources/.xmleditor/xsdmodel.py +0 -753
- package/design/tools/sources/checker.py +0 -55
- package/design/tools/sources/docgen.py +0 -66
- package/design/tools/sources/generate.py +0 -48
- package/design/tools/sources/linter.py +0 -54
- package/design/tools/sources/ruff.toml +0 -12
- package/design/tools/sources/xmleditor.py +0 -62
- package/design/tools/unix/_venv_python.sh +0 -16
- package/design/tools/unix/check.sh +0 -13
- package/design/tools/unix/doc.sh +0 -14
- package/design/tools/unix/gen.sh +0 -14
- package/design/tools/unix/lint.sh +0 -10
- package/design/tools/unix/run.sh +0 -20
- package/design/tools/unix/verify.sh +0 -12
- package/design/tools/unix/xmledit.sh +0 -12
- package/design/tools/windows/check.cmd +0 -12
- package/design/tools/windows/doc.cmd +0 -12
- package/design/tools/windows/gen.cmd +0 -11
- package/design/tools/windows/lint.cmd +0 -9
- package/design/tools/windows/run.cmd +0 -26
- package/design/tools/windows/verify.cmd +0 -10
- package/design/tools/windows/xmledit.cmd +0 -10
- package/dist/chunk-2R66P5X5.mjs.map +0 -1
- package/dist/chunk-LCTFQJZM.js.map +0 -1
- /package/components/{ui → providers/gluestack/ui}/accordion/ANIMATION_CUSTOMIZATION.md +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedHeight.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AccordionAnimatedIcon.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedHeight.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/AnimatedIcon.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/MIGRATION_SUMMARY.md +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/USAGE_EXAMPLE.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/accordion/animation-config.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/avatar/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/box/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/box/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/calendar/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/calendar/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/card/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/card/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/center/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/center/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/date-time-picker/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/date-time-picker/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/flat-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/script.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/theme-context.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/tokens.d.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/gluestack-ui-provider/useGluestackColors.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/grid/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/grid/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/heading/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/heading/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/hstack/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/hstack/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/icon/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/image-background/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/image-viewer/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/input-accessory-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/keyboard-avoiding-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/pressable/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/refresh-control/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/safe-area-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/scroll-view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/section-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/skeleton/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/skeleton/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/status-bar/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/switch/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/table/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/table/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/tabs/animation-config.ts +0 -0
- /package/components/{ui → providers/gluestack/ui}/tabs/creator.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/text/index.web.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/text/styles.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/textarea/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/view/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/virtualized-list/index.tsx +0 -0
- /package/components/{ui → providers/gluestack/ui}/vstack/index.web.tsx +0 -0
- /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,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;
|