@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.
- 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 +142 -38
- 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,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { alertRecipe, type AlertProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Alert(p: AlertProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = alertRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<View accessibilityRole="alert" style={r.container as never} testID={p.testID}>
|
|
11
|
+
{p.title ? <Text style={r.title as never}>{p.title}</Text> : null}
|
|
12
|
+
{typeof p.children === 'string' ? <Text style={r.body as never}>{p.children}</Text> : p.children}
|
|
13
|
+
</View>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal as RNModal, Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { alertDialogRecipe, buttonRecipe, type AlertDialogProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function AlertDialog(p: AlertDialogProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = alertDialogRecipe(t);
|
|
9
|
+
const cancel = buttonRecipe({ variant: 'outline' }, t);
|
|
10
|
+
const confirm = buttonRecipe({ variant: p.destructive ? 'destructive' : 'default' }, t);
|
|
11
|
+
return (
|
|
12
|
+
<RNModal transparent animationType="fade" visible={p.visible} onRequestClose={p.onCancel} testID={p.testID}>
|
|
13
|
+
<View style={r.backdrop as never}>
|
|
14
|
+
<View accessibilityRole={'alertdialog' as never} aria-modal style={r.panel as never}>
|
|
15
|
+
<Text accessibilityRole="header" style={r.title as never}>
|
|
16
|
+
{p.title}
|
|
17
|
+
</Text>
|
|
18
|
+
{p.description ? <Text style={r.description as never}>{p.description}</Text> : null}
|
|
19
|
+
<View style={r.actions as never}>
|
|
20
|
+
<Pressable accessibilityRole="button" onPress={p.onCancel} style={cancel.container as never}>
|
|
21
|
+
<Text style={cancel.label as never}>{p.cancelLabel ?? 'Cancel'}</Text>
|
|
22
|
+
</Pressable>
|
|
23
|
+
<Pressable accessibilityRole="button" onPress={p.onConfirm} style={confirm.container as never}>
|
|
24
|
+
<Text style={confirm.label as never}>{p.confirmLabel ?? 'Confirm'}</Text>
|
|
25
|
+
</Pressable>
|
|
26
|
+
</View>
|
|
27
|
+
</View>
|
|
28
|
+
</View>
|
|
29
|
+
</RNModal>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Image, Text, View } from 'react-native';
|
|
3
|
+
import { avatarRecipe, initialsOf, type AvatarProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Avatar(p: AvatarProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = avatarRecipe(p, t);
|
|
9
|
+
const [failed, setFailed] = useState(false);
|
|
10
|
+
const showImage = !!p.source && !failed;
|
|
11
|
+
return (
|
|
12
|
+
<View
|
|
13
|
+
accessibilityRole="image"
|
|
14
|
+
accessibilityLabel={p.accessibilityLabel ?? p.name}
|
|
15
|
+
style={r.container as never}
|
|
16
|
+
testID={p.testID}
|
|
17
|
+
>
|
|
18
|
+
{showImage ? (
|
|
19
|
+
<Image
|
|
20
|
+
source={{ uri: p.source }}
|
|
21
|
+
style={r.image as never}
|
|
22
|
+
onError={() => setFailed(true)}
|
|
23
|
+
accessibilityIgnoresInvertColors
|
|
24
|
+
/>
|
|
25
|
+
) : (
|
|
26
|
+
<Text style={r.initials as never}>{initialsOf(p.name)}</Text>
|
|
27
|
+
)}
|
|
28
|
+
</View>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { badgeRecipe, type BadgeProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Badge(p: BadgeProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = badgeRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<View style={r.container as never} testID={p.testID}>
|
|
11
|
+
<Text style={r.label as never}>{p.children}</Text>
|
|
12
|
+
</View>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal as RNModal, Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { sheetRecipe, type BottomSheetProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function BottomSheet({ visible, onClose, title, children, testID }: BottomSheetProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = sheetRecipe(t);
|
|
9
|
+
return (
|
|
10
|
+
<RNModal transparent animationType="slide" visible={visible} onRequestClose={onClose} testID={testID}>
|
|
11
|
+
<Pressable accessibilityLabel="Close" onPress={onClose} style={r.backdrop as never}>
|
|
12
|
+
<Pressable accessible={false} onPress={() => {}} style={r.panel as never}>
|
|
13
|
+
<View style={r.handle as never} />
|
|
14
|
+
{title ? (
|
|
15
|
+
<Text accessibilityRole="header" style={r.title as never}>
|
|
16
|
+
{title}
|
|
17
|
+
</Text>
|
|
18
|
+
) : null}
|
|
19
|
+
{children}
|
|
20
|
+
</Pressable>
|
|
21
|
+
</Pressable>
|
|
22
|
+
</RNModal>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Box } from '../../rn-base';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ActivityIndicator, Pressable, Text } from 'react-native';
|
|
3
|
+
import { buttonRecipe, type ButtonProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Button(p: ButtonProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = buttonRecipe(p, t);
|
|
9
|
+
const inactive = !!(p.disabled || p.loading);
|
|
10
|
+
return (
|
|
11
|
+
<Pressable
|
|
12
|
+
accessibilityRole="button"
|
|
13
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
14
|
+
aria-disabled={inactive}
|
|
15
|
+
aria-busy={!!p.loading}
|
|
16
|
+
disabled={inactive}
|
|
17
|
+
onPress={p.onPress}
|
|
18
|
+
testID={p.testID}
|
|
19
|
+
style={({ pressed }) => [r.container, pressed && !inactive ? { opacity: 0.85 } : null] as never}
|
|
20
|
+
>
|
|
21
|
+
{p.loading ? <ActivityIndicator size="small" color={r.spinner.color} /> : null}
|
|
22
|
+
{typeof p.children === 'string' || typeof p.children === 'number' ? (
|
|
23
|
+
<Text style={[r.label, p.variant === 'link' ? { textDecorationLine: 'underline' } : null] as never}>
|
|
24
|
+
{p.children}
|
|
25
|
+
</Text>
|
|
26
|
+
) : (
|
|
27
|
+
p.children
|
|
28
|
+
)}
|
|
29
|
+
</Pressable>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
calendarRecipe,
|
|
5
|
+
iconRecipe,
|
|
6
|
+
MONTHS,
|
|
7
|
+
monthGrid,
|
|
8
|
+
parseDate,
|
|
9
|
+
shiftMonth,
|
|
10
|
+
WEEKDAYS,
|
|
11
|
+
type CalendarProps,
|
|
12
|
+
} from '../../../contract';
|
|
13
|
+
import { useResolvedTheme } from '../../provider';
|
|
14
|
+
|
|
15
|
+
const initial = (p: CalendarProps): [number, number] => {
|
|
16
|
+
const m = /^(\d{4})-(\d{2})$/.exec(p.month ?? '');
|
|
17
|
+
if (m) return [Number(m[1]), Number(m[2])];
|
|
18
|
+
const d = parseDate(p.value);
|
|
19
|
+
if (d) return [d[0], d[1]];
|
|
20
|
+
const now = new Date();
|
|
21
|
+
return [now.getFullYear(), now.getMonth() + 1];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function Calendar(p: CalendarProps) {
|
|
25
|
+
const t = useResolvedTheme();
|
|
26
|
+
const r = calendarRecipe(t);
|
|
27
|
+
const [[y, m], setYm] = useState<[number, number]>(() => initial(p));
|
|
28
|
+
const start = p.weekStartsOn ?? 0;
|
|
29
|
+
const weekdays = [...WEEKDAYS.slice(start), ...WEEKDAYS.slice(0, start)];
|
|
30
|
+
const go = (by: number) => setYm(([yy, mm]) => shiftMonth(yy, mm, by));
|
|
31
|
+
return (
|
|
32
|
+
<View testID={p.testID} style={r.container as never}>
|
|
33
|
+
<View style={r.header as never}>
|
|
34
|
+
<Pressable
|
|
35
|
+
accessibilityRole="button"
|
|
36
|
+
accessibilityLabel="Previous month"
|
|
37
|
+
onPress={() => go(-1)}
|
|
38
|
+
style={r.nav as never}
|
|
39
|
+
>
|
|
40
|
+
<Text style={r.navLabel as never}>{iconRecipe({ name: 'chevron-left' }, t).glyph}</Text>
|
|
41
|
+
</Pressable>
|
|
42
|
+
<Text accessibilityRole="header" style={r.title as never}>
|
|
43
|
+
{MONTHS[m - 1]} {y}
|
|
44
|
+
</Text>
|
|
45
|
+
<Pressable
|
|
46
|
+
accessibilityRole="button"
|
|
47
|
+
accessibilityLabel="Next month"
|
|
48
|
+
onPress={() => go(1)}
|
|
49
|
+
style={r.nav as never}
|
|
50
|
+
>
|
|
51
|
+
<Text style={r.navLabel as never}>{iconRecipe({ name: 'chevron-right' }, t).glyph}</Text>
|
|
52
|
+
</Pressable>
|
|
53
|
+
</View>
|
|
54
|
+
<View style={r.weekRow as never}>
|
|
55
|
+
{weekdays.map((d) => (
|
|
56
|
+
<Text key={d} style={r.weekday as never}>
|
|
57
|
+
{d}
|
|
58
|
+
</Text>
|
|
59
|
+
))}
|
|
60
|
+
</View>
|
|
61
|
+
{monthGrid(y, m, p).map((week, wi) => (
|
|
62
|
+
<View key={wi} style={r.row as never}>
|
|
63
|
+
{week.map((c, ci) =>
|
|
64
|
+
c.date === null ? (
|
|
65
|
+
<View key={ci} style={r.day(false, true) as never} />
|
|
66
|
+
) : (
|
|
67
|
+
<Pressable
|
|
68
|
+
key={ci}
|
|
69
|
+
accessibilityRole="button"
|
|
70
|
+
accessibilityLabel={c.date}
|
|
71
|
+
aria-selected={c.date === p.value}
|
|
72
|
+
aria-disabled={c.disabled || undefined}
|
|
73
|
+
disabled={c.disabled}
|
|
74
|
+
onPress={() => p.onChange?.(c.date as string)}
|
|
75
|
+
style={r.day(c.date === p.value, c.disabled) as never}
|
|
76
|
+
>
|
|
77
|
+
<Text style={r.dayLabel(c.date === p.value, c.disabled) as never}>{c.day}</Text>
|
|
78
|
+
</Pressable>
|
|
79
|
+
),
|
|
80
|
+
)}
|
|
81
|
+
</View>
|
|
82
|
+
))}
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { cardRecipe, type CardProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Card(p: CardProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<View style={cardRecipe(p, t) as never} testID={p.testID}>
|
|
10
|
+
{p.children}
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { centerRecipe, type CenterProps } from '../../../contract';
|
|
4
|
+
|
|
5
|
+
export function Center({ children, testID }: CenterProps) {
|
|
6
|
+
return (
|
|
7
|
+
<View testID={testID} style={centerRecipe() as never}>
|
|
8
|
+
{children}
|
|
9
|
+
</View>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { checkboxRecipe, type CheckboxProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Checkbox(p: CheckboxProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = checkboxRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<Pressable
|
|
11
|
+
accessibilityRole="checkbox"
|
|
12
|
+
accessibilityLabel={p.accessibilityLabel ?? p.label}
|
|
13
|
+
aria-checked={!!p.checked}
|
|
14
|
+
aria-disabled={!!p.disabled}
|
|
15
|
+
disabled={p.disabled}
|
|
16
|
+
onPress={() => p.onCheckedChange?.(!p.checked)}
|
|
17
|
+
style={r.row as never}
|
|
18
|
+
testID={p.testID}
|
|
19
|
+
>
|
|
20
|
+
<View style={r.box as never}>{p.checked ? <Text style={r.mark as never}>✓</Text> : null}</View>
|
|
21
|
+
{p.label ? <Text style={r.label as never}>{p.label}</Text> : null}
|
|
22
|
+
</Pressable>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Modal as RNModal, Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { inputRecipe, modalRecipe, type DateTimePickerProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
import { Calendar } from './Calendar';
|
|
6
|
+
|
|
7
|
+
/** Date only ('YYYY-MM-DD'): a field that opens a calendar. */
|
|
8
|
+
export function DateTimePicker(p: DateTimePickerProps) {
|
|
9
|
+
const t = useResolvedTheme();
|
|
10
|
+
const field = inputRecipe({ disabled: p.disabled }, t);
|
|
11
|
+
const m = modalRecipe({ visible: true }, t);
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Pressable
|
|
16
|
+
testID={p.testID}
|
|
17
|
+
accessibilityRole="button"
|
|
18
|
+
accessibilityLabel={p.accessibilityLabel ?? p.placeholder ?? 'Pick a date'}
|
|
19
|
+
aria-disabled={p.disabled || undefined}
|
|
20
|
+
disabled={p.disabled}
|
|
21
|
+
onPress={() => setOpen(true)}
|
|
22
|
+
style={field.container as never}
|
|
23
|
+
>
|
|
24
|
+
<Text style={field.field as never}>{p.value || p.placeholder || 'YYYY-MM-DD'}</Text>
|
|
25
|
+
</Pressable>
|
|
26
|
+
<RNModal transparent animationType="fade" visible={open} onRequestClose={() => setOpen(false)}>
|
|
27
|
+
<Pressable accessibilityLabel="Close" onPress={() => setOpen(false)} style={m.backdrop as never}>
|
|
28
|
+
<Pressable accessible={false} onPress={() => {}}>
|
|
29
|
+
<View>
|
|
30
|
+
<Calendar
|
|
31
|
+
value={p.value}
|
|
32
|
+
min={p.min}
|
|
33
|
+
max={p.max}
|
|
34
|
+
onChange={(d) => {
|
|
35
|
+
p.onChange?.(d);
|
|
36
|
+
setOpen(false);
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
40
|
+
</Pressable>
|
|
41
|
+
</Pressable>
|
|
42
|
+
</RNModal>
|
|
43
|
+
</>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { dividerRecipe, type DividerProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Divider(p: DividerProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return <View accessibilityRole="none" style={dividerRecipe(p, t) as never} testID={p.testID} />;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Modal as RNModal, Pressable } from 'react-native';
|
|
3
|
+
import { drawerRecipe, type DrawerProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Drawer({ visible, onClose, side = 'left', children, testID }: DrawerProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = drawerRecipe(side, t);
|
|
9
|
+
return (
|
|
10
|
+
<RNModal transparent animationType="fade" visible={visible} onRequestClose={onClose} testID={testID}>
|
|
11
|
+
<Pressable accessibilityLabel="Close" onPress={onClose} style={r.backdrop as never}>
|
|
12
|
+
<Pressable accessible={false} onPress={() => {}} style={r.panel as never}>
|
|
13
|
+
{children}
|
|
14
|
+
</Pressable>
|
|
15
|
+
</Pressable>
|
|
16
|
+
</RNModal>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Pressable, Text } from 'react-native';
|
|
3
|
+
import { fabRecipe, iconRecipe, type FabProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Fab(p: FabProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = fabRecipe(p, t);
|
|
9
|
+
const glyph = iconRecipe({ name: p.icon ?? 'plus' }, t).glyph;
|
|
10
|
+
return (
|
|
11
|
+
<Pressable
|
|
12
|
+
testID={p.testID}
|
|
13
|
+
accessibilityRole="button"
|
|
14
|
+
accessibilityLabel={p.accessibilityLabel ?? p.label ?? 'Action'}
|
|
15
|
+
onPress={p.onPress}
|
|
16
|
+
style={r.container as never}
|
|
17
|
+
>
|
|
18
|
+
<Text style={r.icon as never}>{glyph}</Text>
|
|
19
|
+
{p.label ? <Text style={r.label as never}>{p.label}</Text> : null}
|
|
20
|
+
</Pressable>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FlatList } from '../../rn-base';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { formControlRecipe, type FormControlProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function FormControl(p: FormControlProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = formControlRecipe(!!p.disabled, t);
|
|
9
|
+
return (
|
|
10
|
+
<View testID={p.testID} style={r.root as never}>
|
|
11
|
+
{p.label ? (
|
|
12
|
+
<Text style={r.label as never}>
|
|
13
|
+
{p.label}
|
|
14
|
+
{p.required ? <Text style={r.required as never}> *</Text> : null}
|
|
15
|
+
</Text>
|
|
16
|
+
) : null}
|
|
17
|
+
{p.children}
|
|
18
|
+
{p.error ? (
|
|
19
|
+
<Text accessibilityRole="alert" style={r.error as never}>
|
|
20
|
+
{p.error}
|
|
21
|
+
</Text>
|
|
22
|
+
) : p.helper ? (
|
|
23
|
+
<Text style={r.helper as never}>{p.helper}</Text>
|
|
24
|
+
) : null}
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { gridRecipe, type GridProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Grid(p: GridProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = gridRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<View testID={p.testID} style={r.container as never}>
|
|
11
|
+
{React.Children.toArray(p.children).map((child, i) => (
|
|
12
|
+
<View key={i} style={r.cell as never}>
|
|
13
|
+
{child}
|
|
14
|
+
</View>
|
|
15
|
+
))}
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { stackRecipe, type HStackProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function HStack(p: HStackProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<View testID={p.testID} style={stackRecipe('row', p, t) as never}>
|
|
10
|
+
{p.children}
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { headingRecipe, type HeadingProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Heading(p: HeadingProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<Text
|
|
10
|
+
accessibilityRole="header"
|
|
11
|
+
aria-level={p.level ?? 2}
|
|
12
|
+
style={headingRecipe(p, t) as never}
|
|
13
|
+
numberOfLines={p.isTruncated ? 1 : undefined}
|
|
14
|
+
testID={p.testID}
|
|
15
|
+
>
|
|
16
|
+
{p.children}
|
|
17
|
+
</Text>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { iconRecipe, type IconProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Icon(p: IconProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = iconRecipe(p, t);
|
|
9
|
+
return (
|
|
10
|
+
<Text
|
|
11
|
+
testID={p.testID}
|
|
12
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
13
|
+
accessible={!!p.accessibilityLabel}
|
|
14
|
+
importantForAccessibility={p.accessibilityLabel ? 'yes' : 'no-hide-descendants'}
|
|
15
|
+
style={r.style as never}
|
|
16
|
+
>
|
|
17
|
+
{r.glyph}
|
|
18
|
+
</Text>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ImageBackground } from '../../rn-base';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, Modal as RNModal, Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { iconRecipe, imageViewerRecipe, type ImageViewerProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function ImageViewer({ visible, source, alt, onClose, testID }: ImageViewerProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = imageViewerRecipe(t);
|
|
9
|
+
return (
|
|
10
|
+
<RNModal transparent animationType="fade" visible={visible} onRequestClose={onClose} testID={testID}>
|
|
11
|
+
<View style={r.backdrop as never}>
|
|
12
|
+
<Image
|
|
13
|
+
source={{ uri: source }}
|
|
14
|
+
alt={alt}
|
|
15
|
+
accessibilityLabel={alt}
|
|
16
|
+
resizeMode="contain"
|
|
17
|
+
style={r.image as never}
|
|
18
|
+
/>
|
|
19
|
+
<Pressable accessibilityRole="button" accessibilityLabel="Close" onPress={onClose} style={r.close as never}>
|
|
20
|
+
<Text style={r.closeLabel as never}>{iconRecipe({ name: 'close' }, t).glyph}</Text>
|
|
21
|
+
</Pressable>
|
|
22
|
+
</View>
|
|
23
|
+
</RNModal>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { TextInput, View } from 'react-native';
|
|
3
|
+
import { inputRecipe, type InputProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Input(p: InputProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = inputRecipe(p, t);
|
|
9
|
+
const [focused, setFocused] = useState(false);
|
|
10
|
+
return (
|
|
11
|
+
<View style={[r.container, focused ? { borderColor: r.focusBorderColor } : null] as never}>
|
|
12
|
+
<TextInput
|
|
13
|
+
style={r.field as never}
|
|
14
|
+
value={p.value}
|
|
15
|
+
defaultValue={p.defaultValue}
|
|
16
|
+
placeholder={p.placeholder}
|
|
17
|
+
placeholderTextColor={r.placeholderTextColor}
|
|
18
|
+
onChangeText={p.onChangeText}
|
|
19
|
+
editable={!p.disabled}
|
|
20
|
+
secureTextEntry={p.secureTextEntry}
|
|
21
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
22
|
+
aria-invalid={p.invalid || undefined}
|
|
23
|
+
onFocus={() => setFocused(true)}
|
|
24
|
+
onBlur={() => setFocused(false)}
|
|
25
|
+
testID={p.testID}
|
|
26
|
+
/>
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InputAccessoryView } from '../../rn-base';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { KeyboardAvoidingView } from '../../rn-base';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Linking, Text } from 'react-native';
|
|
3
|
+
import { linkRecipe, type LinkProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Link({ href, onPress, children, testID }: LinkProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<Text
|
|
10
|
+
testID={testID}
|
|
11
|
+
accessibilityRole="link"
|
|
12
|
+
style={linkRecipe(t) as never}
|
|
13
|
+
onPress={() => {
|
|
14
|
+
onPress?.();
|
|
15
|
+
if (href) void Linking.openURL(href);
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</Text>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { liquidGlassRecipe, type LiquidGlassProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function LiquidGlass({ children, testID }: LiquidGlassProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
return (
|
|
9
|
+
<View testID={testID} style={liquidGlassRecipe(t) as never}>
|
|
10
|
+
{children}
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Pressable, Text, View } from 'react-native';
|
|
3
|
+
import { buttonRecipe, menuRecipe, type MenuProps } from '../../../contract';
|
|
4
|
+
import { useResolvedTheme } from '../../provider';
|
|
5
|
+
|
|
6
|
+
export function Menu({ label, items, testID }: MenuProps) {
|
|
7
|
+
const t = useResolvedTheme();
|
|
8
|
+
const r = menuRecipe(t);
|
|
9
|
+
const b = buttonRecipe({ variant: 'outline' }, t);
|
|
10
|
+
const [open, setOpen] = useState(false);
|
|
11
|
+
return (
|
|
12
|
+
<View testID={testID} style={{ position: 'relative', alignSelf: 'flex-start' }}>
|
|
13
|
+
<Pressable
|
|
14
|
+
accessibilityRole="button"
|
|
15
|
+
aria-haspopup="menu"
|
|
16
|
+
aria-expanded={open}
|
|
17
|
+
onPress={() => setOpen(!open)}
|
|
18
|
+
style={b.container as never}
|
|
19
|
+
>
|
|
20
|
+
<Text style={b.label as never}>{label}</Text>
|
|
21
|
+
</Pressable>
|
|
22
|
+
{open ? (
|
|
23
|
+
<View accessibilityRole={'menu' as never} style={r.panel as never}>
|
|
24
|
+
{items.map((it) => (
|
|
25
|
+
<Pressable
|
|
26
|
+
key={it.key}
|
|
27
|
+
accessibilityRole={'menuitem' as never}
|
|
28
|
+
aria-disabled={it.disabled || undefined}
|
|
29
|
+
disabled={it.disabled}
|
|
30
|
+
onPress={() => {
|
|
31
|
+
setOpen(false);
|
|
32
|
+
it.onSelect?.();
|
|
33
|
+
}}
|
|
34
|
+
style={r.item(!!it.disabled) as never}
|
|
35
|
+
>
|
|
36
|
+
<Text style={r.label(!!it.destructive) as never}>{it.label}</Text>
|
|
37
|
+
</Pressable>
|
|
38
|
+
))}
|
|
39
|
+
</View>
|
|
40
|
+
) : null}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
}
|