@flipova/foundation 2.4.4 → 3.0.0-beta.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,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal as RNModal, Pressable, Text } from 'react-native';
|
|
3
|
+
import { modalRecipe, type ModalProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Modal(p: ModalProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = modalRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<RNModal transparent animationType="fade" visible={p.visible} onRequestClose={p.onClose} testID={p.testID}>
|
|
11
|
+
<Pressable accessibilityLabel="Close" onPress={p.onClose} style={r.backdrop as never}>
|
|
12
|
+
{/* a press inside the panel must not reach the backdrop */}
|
|
13
|
+
<Pressable accessible={false} onPress={() => {}} style={r.panel as never}>
|
|
14
|
+
{p.title ? (
|
|
15
|
+
<Text accessibilityRole="header" style={r.title as never}>
|
|
16
|
+
{p.title}
|
|
17
|
+
</Text>
|
|
18
|
+
) : null}
|
|
19
|
+
{p.children}
|
|
20
|
+
</Pressable>
|
|
21
|
+
</Pressable>
|
|
22
|
+
</RNModal>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
|
+
import { popoverRecipe, type PopoverProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Popover({ trigger, open, onOpenChange, children, testID }: PopoverProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = popoverRecipe(t);
|
|
9
|
+
const [inner, setInner] = useState(false);
|
|
10
|
+
const isOpen = open ?? inner;
|
|
11
|
+
const set = (v: boolean) => {
|
|
12
|
+
if (open === undefined) setInner(v);
|
|
13
|
+
onOpenChange?.(v);
|
|
14
|
+
};
|
|
15
|
+
return (
|
|
16
|
+
<View testID={testID} style={{ position: 'relative', alignSelf: 'flex-start' }}>
|
|
17
|
+
<Pressable accessibilityRole="button" aria-expanded={isOpen} onPress={() => set(!isOpen)}>
|
|
18
|
+
{trigger}
|
|
19
|
+
</Pressable>
|
|
20
|
+
{isOpen ? <View style={r.panel as never}>{children}</View> : null}
|
|
21
|
+
</View>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { createContext, useContext, useEffect, useId, useState, type ReactNode } from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { PortalProps } from '../../../contract';
|
|
4
|
+
|
|
5
|
+
interface Host {
|
|
6
|
+
set(id: string, node: ReactNode): void;
|
|
7
|
+
remove(id: string): void;
|
|
8
|
+
}
|
|
9
|
+
const HostContext = createContext<Host | null>(null);
|
|
10
|
+
|
|
11
|
+
/** Mounted once by the flipova Provider: whatever <Portal> receives is drawn here, above the rest of the tree. */
|
|
12
|
+
export function PortalHost({ children }: { children?: ReactNode }) {
|
|
13
|
+
const [nodes, setNodes] = useState<Array<[string, ReactNode]>>([]);
|
|
14
|
+
const [host] = useState<Host>(() => ({
|
|
15
|
+
set: (id, node) =>
|
|
16
|
+
setNodes((all) =>
|
|
17
|
+
all.some(([k]) => k === id) ? all.map((e) => (e[0] === id ? [id, node] : e)) : [...all, [id, node]],
|
|
18
|
+
),
|
|
19
|
+
remove: (id) => setNodes((all) => all.filter(([k]) => k !== id)),
|
|
20
|
+
}));
|
|
21
|
+
return (
|
|
22
|
+
<HostContext.Provider value={host}>
|
|
23
|
+
{children}
|
|
24
|
+
<View pointerEvents="box-none" style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}>
|
|
25
|
+
{nodes.map(([id, node]) => (
|
|
26
|
+
<React.Fragment key={id}>{node}</React.Fragment>
|
|
27
|
+
))}
|
|
28
|
+
</View>
|
|
29
|
+
</HostContext.Provider>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function Portal({ children }: PortalProps) {
|
|
34
|
+
const host = useContext(HostContext);
|
|
35
|
+
const id = useId();
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
host?.set(id, children);
|
|
38
|
+
});
|
|
39
|
+
useEffect(() => () => host?.remove(id), [host, id]);
|
|
40
|
+
// without a host (no provider mounted) the children stay where they are
|
|
41
|
+
return host ? null : <>{children}</>;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Pressable } from '../../rn-base';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { progressRecipe, type ProgressProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Progress(p: ProgressProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = progressRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<View
|
|
11
|
+
accessibilityRole="progressbar"
|
|
12
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
13
|
+
aria-valuemin={0}
|
|
14
|
+
aria-valuemax={100}
|
|
15
|
+
aria-valuenow={r.value}
|
|
16
|
+
style={r.track as never}
|
|
17
|
+
testID={p.testID}
|
|
18
|
+
>
|
|
19
|
+
<View style={r.bar as never} />
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { radioRecipe, type RadioGroupProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function RadioGroup(p: RadioGroupProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = radioRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<View
|
|
11
|
+
accessibilityRole="radiogroup"
|
|
12
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
13
|
+
style={r.group as never}
|
|
14
|
+
testID={p.testID}
|
|
15
|
+
>
|
|
16
|
+
{p.options.map((o) => {
|
|
17
|
+
const selected = o.value === p.value;
|
|
18
|
+
const off = !!(p.disabled || o.disabled);
|
|
19
|
+
return (
|
|
20
|
+
<Pressable
|
|
21
|
+
key={o.value}
|
|
22
|
+
accessibilityRole="radio"
|
|
23
|
+
aria-checked={selected}
|
|
24
|
+
aria-disabled={off}
|
|
25
|
+
disabled={off}
|
|
26
|
+
onPress={() => p.onValueChange?.(o.value)}
|
|
27
|
+
style={r.row as never}
|
|
28
|
+
>
|
|
29
|
+
<View style={r.circle(selected) as never}>{selected ? <View style={r.dot as never} /> : null}</View>
|
|
30
|
+
<Text style={r.label as never}>{o.label}</Text>
|
|
31
|
+
</Pressable>
|
|
32
|
+
);
|
|
33
|
+
})}
|
|
34
|
+
</View>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RefreshControl } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SafeAreaView } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScrollView } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SectionList } from '../../rn-base';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, ScrollView, Text, View } from 'react-native';
|
|
3
|
+
import { selectRecipe, type SelectProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
/** A trigger and an inline list: no native picker, so it looks and behaves the same everywhere. */
|
|
7
|
+
export function Select(p: SelectProps) {
|
|
8
|
+
const t = useResolvedTheme();
|
|
9
|
+
const r = selectRecipe(p, t);
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
const current = p.options.find((o) => o.value === p.value);
|
|
12
|
+
return (
|
|
13
|
+
<View testID={p.testID}>
|
|
14
|
+
<Pressable
|
|
15
|
+
accessibilityRole="combobox"
|
|
16
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
17
|
+
aria-expanded={open}
|
|
18
|
+
aria-disabled={!!p.disabled}
|
|
19
|
+
disabled={p.disabled}
|
|
20
|
+
onPress={() => setOpen((o) => !o)}
|
|
21
|
+
style={[r.trigger, open ? { borderColor: r.focusBorderColor } : null] as never}
|
|
22
|
+
>
|
|
23
|
+
<Text style={[r.triggerLabel, current ? null : { color: r.placeholderColor }] as never} numberOfLines={1}>
|
|
24
|
+
{current ? current.label : (p.placeholder ?? '')}
|
|
25
|
+
</Text>
|
|
26
|
+
<Text style={{ color: r.placeholderColor }}>{open ? '▴' : '▾'}</Text>
|
|
27
|
+
</Pressable>
|
|
28
|
+
{open ? (
|
|
29
|
+
<View style={r.menu as never}>
|
|
30
|
+
<ScrollView>
|
|
31
|
+
{p.options.map((o) => {
|
|
32
|
+
const selected = o.value === p.value;
|
|
33
|
+
return (
|
|
34
|
+
<Pressable
|
|
35
|
+
key={o.value}
|
|
36
|
+
accessibilityRole="menuitem"
|
|
37
|
+
aria-selected={selected}
|
|
38
|
+
aria-disabled={!!o.disabled}
|
|
39
|
+
disabled={o.disabled}
|
|
40
|
+
onPress={() => {
|
|
41
|
+
p.onValueChange?.(o.value);
|
|
42
|
+
setOpen(false);
|
|
43
|
+
}}
|
|
44
|
+
style={
|
|
45
|
+
[
|
|
46
|
+
r.option,
|
|
47
|
+
selected ? r.optionSelected : null,
|
|
48
|
+
o.disabled ? { opacity: r.disabledOptionOpacity } : null,
|
|
49
|
+
] as never
|
|
50
|
+
}
|
|
51
|
+
>
|
|
52
|
+
<Text style={[r.optionLabel, selected ? r.optionLabelSelected : null] as never}>{o.label}</Text>
|
|
53
|
+
</Pressable>
|
|
54
|
+
);
|
|
55
|
+
})}
|
|
56
|
+
</ScrollView>
|
|
57
|
+
</View>
|
|
58
|
+
) : null}
|
|
59
|
+
</View>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
import { skeletonRecipe, type SkeletonProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Skeleton(p: SkeletonProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = skeletonRecipe(p, t);
|
|
9
|
+
const opacity = useRef(new Animated.Value(1)).current;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const loop = Animated.loop(
|
|
12
|
+
Animated.sequence([
|
|
13
|
+
Animated.timing(opacity, {
|
|
14
|
+
toValue: r.pulse.minOpacity,
|
|
15
|
+
duration: r.pulse.durationMs / 2,
|
|
16
|
+
useNativeDriver: true,
|
|
17
|
+
}),
|
|
18
|
+
Animated.timing(opacity, { toValue: 1, duration: r.pulse.durationMs / 2, useNativeDriver: true }),
|
|
19
|
+
]),
|
|
20
|
+
);
|
|
21
|
+
loop.start();
|
|
22
|
+
return () => loop.stop();
|
|
23
|
+
}, [opacity, r.pulse.minOpacity, r.pulse.durationMs]);
|
|
24
|
+
return <Animated.View accessibilityRole="none" aria-busy style={[r.block, { opacity }] as never} testID={p.testID} />;
|
|
25
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { PanResponder, View, type LayoutChangeEvent } from 'react-native';
|
|
3
|
+
import { sliderFraction, sliderRecipe, sliderValue, type SliderProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Slider(p: SliderProps) {
|
|
7
|
+
const { value, onValueChange, min = 0, max = 100, step = 1, disabled, accessibilityLabel, testID } = p;
|
|
8
|
+
const t = useResolvedTheme();
|
|
9
|
+
const r = sliderRecipe(p, t);
|
|
10
|
+
const [width, setWidth] = useState(0);
|
|
11
|
+
const live = useRef({ width, min, max, step, disabled, onValueChange });
|
|
12
|
+
live.current = { width, min, max, step, disabled, onValueChange };
|
|
13
|
+
|
|
14
|
+
const move = (x: number) => {
|
|
15
|
+
const c = live.current;
|
|
16
|
+
if (c.disabled || !c.width) return;
|
|
17
|
+
c.onValueChange?.(sliderValue(x / c.width, c.min, c.max, c.step));
|
|
18
|
+
};
|
|
19
|
+
const pan = useRef(
|
|
20
|
+
PanResponder.create({
|
|
21
|
+
onStartShouldSetPanResponder: () => !live.current.disabled,
|
|
22
|
+
onMoveShouldSetPanResponder: () => !live.current.disabled,
|
|
23
|
+
onPanResponderGrant: (e) => move(e.nativeEvent.locationX),
|
|
24
|
+
onPanResponderMove: (e) => move(e.nativeEvent.locationX),
|
|
25
|
+
}),
|
|
26
|
+
).current;
|
|
27
|
+
|
|
28
|
+
const f = sliderFraction(value, min, max);
|
|
29
|
+
const adjust = (dir: 1 | -1) =>
|
|
30
|
+
!disabled && onValueChange?.(sliderValue(sliderFraction(value + dir * step, min, max), min, max, step));
|
|
31
|
+
return (
|
|
32
|
+
<View
|
|
33
|
+
testID={testID}
|
|
34
|
+
accessibilityRole="adjustable"
|
|
35
|
+
accessibilityLabel={accessibilityLabel}
|
|
36
|
+
aria-valuemin={min}
|
|
37
|
+
aria-valuemax={max}
|
|
38
|
+
aria-valuenow={value}
|
|
39
|
+
aria-disabled={disabled || undefined}
|
|
40
|
+
accessibilityActions={[{ name: 'increment' }, { name: 'decrement' }]}
|
|
41
|
+
onAccessibilityAction={(e) => adjust(e.nativeEvent.actionName === 'increment' ? 1 : -1)}
|
|
42
|
+
onLayout={(e: LayoutChangeEvent) => setWidth(e.nativeEvent.layout.width)}
|
|
43
|
+
style={r.root as never}
|
|
44
|
+
{...pan.panHandlers}
|
|
45
|
+
>
|
|
46
|
+
<View style={r.track as never}>
|
|
47
|
+
<View style={[r.filled as never, { width: `${f * 100}%` }]} />
|
|
48
|
+
</View>
|
|
49
|
+
<View style={[r.thumb as never, { left: Math.max(0, f * (width - r.thumbSize)) }]} />
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator } from 'react-native';
|
|
3
|
+
import { spinnerRecipe, type SpinnerProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Spinner(p: SpinnerProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = spinnerRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<ActivityIndicator
|
|
11
|
+
size={r.size}
|
|
12
|
+
color={r.color}
|
|
13
|
+
accessibilityRole="progressbar"
|
|
14
|
+
accessibilityLabel={p.accessibilityLabel ?? 'Loading'}
|
|
15
|
+
style={{ transform: [{ scale: r.scale }] }}
|
|
16
|
+
testID={p.testID}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusBar } from '../../rn-base';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Switch as RNSwitch } from 'react-native';
|
|
3
|
+
import { switchRecipe, type SwitchProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Switch(p: SwitchProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = switchRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<RNSwitch
|
|
11
|
+
value={!!p.value}
|
|
12
|
+
onValueChange={p.onValueChange}
|
|
13
|
+
disabled={p.disabled}
|
|
14
|
+
trackColor={{ true: r.trackOn, false: r.trackOff }}
|
|
15
|
+
thumbColor={r.thumb}
|
|
16
|
+
style={{ opacity: r.opacity, transform: [{ scale: r.scale }] }}
|
|
17
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
18
|
+
testID={p.testID}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { tableRecipe, type TableProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
const cell = (node: React.ReactNode, style: object) =>
|
|
7
|
+
typeof node === 'string' || typeof node === 'number' ? <Text style={style as never}>{node}</Text> : node;
|
|
8
|
+
|
|
9
|
+
export function Table({ columns, rows, caption, testID }: TableProps) {
|
|
10
|
+
const t = useResolvedTheme();
|
|
11
|
+
const r = tableRecipe(t);
|
|
12
|
+
return (
|
|
13
|
+
<View testID={testID} accessibilityRole={'table' as never} style={r.container as never}>
|
|
14
|
+
{caption ? <Text style={r.caption as never}>{caption}</Text> : null}
|
|
15
|
+
<View style={r.headRow as never}>
|
|
16
|
+
{columns.map((c) => (
|
|
17
|
+
<View key={c.key} style={r.head(c.align) as never}>
|
|
18
|
+
<Text style={r.headLabel as never}>{c.label}</Text>
|
|
19
|
+
</View>
|
|
20
|
+
))}
|
|
21
|
+
</View>
|
|
22
|
+
{rows.map((row, i) => (
|
|
23
|
+
<View key={i} style={r.row(i === rows.length - 1) as never}>
|
|
24
|
+
{columns.map((c) => (
|
|
25
|
+
<View key={c.key} style={r.cell(c.align) as never}>
|
|
26
|
+
{cell(row[c.key], r.cellLabel)}
|
|
27
|
+
</View>
|
|
28
|
+
))}
|
|
29
|
+
</View>
|
|
30
|
+
))}
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { tabsRecipe, type TabsProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
/** Controlled with `value`, or uncontrolled (starts on the first enabled tab). */
|
|
7
|
+
export function Tabs(p: TabsProps) {
|
|
8
|
+
const t = useResolvedTheme();
|
|
9
|
+
const r = tabsRecipe(p, t);
|
|
10
|
+
const [inner, setInner] = useState(() => p.tabs.find((x) => !x.disabled)?.key);
|
|
11
|
+
const active = p.value ?? inner;
|
|
12
|
+
const current = p.tabs.find((x) => x.key === active);
|
|
13
|
+
return (
|
|
14
|
+
<View testID={p.testID}>
|
|
15
|
+
<View accessibilityRole="tablist" style={r.list as never}>
|
|
16
|
+
{p.tabs.map((tab) => {
|
|
17
|
+
const on = tab.key === active;
|
|
18
|
+
return (
|
|
19
|
+
<Pressable
|
|
20
|
+
key={tab.key}
|
|
21
|
+
accessibilityRole="tab"
|
|
22
|
+
aria-selected={on}
|
|
23
|
+
aria-disabled={!!tab.disabled}
|
|
24
|
+
disabled={tab.disabled}
|
|
25
|
+
onPress={() => {
|
|
26
|
+
setInner(tab.key);
|
|
27
|
+
p.onValueChange?.(tab.key);
|
|
28
|
+
}}
|
|
29
|
+
style={r.tab(on, !!tab.disabled) as never}
|
|
30
|
+
>
|
|
31
|
+
<Text style={r.label(on) as never}>{tab.label}</Text>
|
|
32
|
+
</Pressable>
|
|
33
|
+
);
|
|
34
|
+
})}
|
|
35
|
+
</View>
|
|
36
|
+
{current?.content != null ? <View style={r.panel as never}>{current.content}</View> : null}
|
|
37
|
+
</View>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text as RNText } from 'react-native';
|
|
3
|
+
import { textRecipe, type TextProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Text(p: TextProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<RNText style={textRecipe(p, t) as never} numberOfLines={p.isTruncated ? 1 : undefined} testID={p.testID}>
|
|
10
|
+
{p.children}
|
|
11
|
+
</RNText>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { TextInput } from 'react-native';
|
|
3
|
+
import { textareaRecipe, type TextareaProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Textarea(p: TextareaProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = textareaRecipe(p, t);
|
|
9
|
+
const [focused, setFocused] = useState(false);
|
|
10
|
+
return (
|
|
11
|
+
<TextInput
|
|
12
|
+
multiline
|
|
13
|
+
numberOfLines={p.rows ?? 4}
|
|
14
|
+
style={[r.field, focused ? { borderColor: r.focusBorderColor } : null] as never}
|
|
15
|
+
value={p.value}
|
|
16
|
+
defaultValue={p.defaultValue}
|
|
17
|
+
placeholder={p.placeholder}
|
|
18
|
+
placeholderTextColor={r.placeholderTextColor}
|
|
19
|
+
onChangeText={p.onChangeText}
|
|
20
|
+
editable={!p.disabled}
|
|
21
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
22
|
+
aria-invalid={p.invalid || undefined}
|
|
23
|
+
onFocus={() => setFocused(true)}
|
|
24
|
+
onBlur={() => setFocused(false)}
|
|
25
|
+
testID={p.testID}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { toastRecipe, type ToastProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
/** The toast itself; where and when it appears (a queue, a timer) is up to the app. */
|
|
7
|
+
export function Toast(p: ToastProps) {
|
|
8
|
+
const t = useResolvedTheme();
|
|
9
|
+
const r = toastRecipe(p, t);
|
|
10
|
+
return (
|
|
11
|
+
<View accessibilityRole="alert" accessibilityLiveRegion="polite" style={r.container as never} testID={p.testID}>
|
|
12
|
+
<View style={{ flex: 1, gap: t.scale.spacing['0.5'] }}>
|
|
13
|
+
{p.title ? <Text style={r.title as never}>{p.title}</Text> : null}
|
|
14
|
+
{p.description ? <Text style={r.body as never}>{p.description}</Text> : null}
|
|
15
|
+
</View>
|
|
16
|
+
{p.onClose ? (
|
|
17
|
+
<Pressable
|
|
18
|
+
accessibilityRole="button"
|
|
19
|
+
accessibilityLabel="Dismiss"
|
|
20
|
+
onPress={p.onClose}
|
|
21
|
+
hitSlop={t.scale.spacing['2']}
|
|
22
|
+
>
|
|
23
|
+
<Text style={r.body as never}>✕</Text>
|
|
24
|
+
</Pressable>
|
|
25
|
+
) : null}
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { tooltipRecipe, type TooltipProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
/** Shown on hover / focus (web) or on long press (native). */
|
|
7
|
+
export function Tooltip({ content, children, testID }: TooltipProps) {
|
|
8
|
+
const t = useResolvedTheme();
|
|
9
|
+
const r = tooltipRecipe(t);
|
|
10
|
+
const [show, setShow] = useState(false);
|
|
11
|
+
const web = {
|
|
12
|
+
onHoverIn: () => setShow(true),
|
|
13
|
+
onHoverOut: () => setShow(false),
|
|
14
|
+
onFocus: () => setShow(true),
|
|
15
|
+
onBlur: () => setShow(false),
|
|
16
|
+
};
|
|
17
|
+
return (
|
|
18
|
+
<View testID={testID} style={{ position: 'relative', alignSelf: 'flex-start' }}>
|
|
19
|
+
<Pressable
|
|
20
|
+
{...(web as object)}
|
|
21
|
+
onLongPress={() => setShow(true)}
|
|
22
|
+
onPressOut={() => setShow(false)}
|
|
23
|
+
aria-describedby={show ? 'tooltip' : undefined}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</Pressable>
|
|
27
|
+
{show ? (
|
|
28
|
+
<View accessibilityRole={'tooltip' as never} style={r.bubble as never}>
|
|
29
|
+
<Text style={r.label as never}>{content}</Text>
|
|
30
|
+
</View>
|
|
31
|
+
) : null}
|
|
32
|
+
</View>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { stackRecipe, type VStackProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function VStack(p: VStackProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<View testID={p.testID} style={stackRecipe('column', p, t) as never}>
|
|
10
|
+
{p.children}
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { View } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VirtualizedList } from '../../rn-base';
|