@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
|
@@ -44,11 +44,13 @@ type ITableDataProps = React.ComponentProps<typeof View | typeof Text> & {
|
|
|
44
44
|
};
|
|
45
45
|
type ITableCaptionProps = React.ComponentProps<typeof ExpoTCaption>;
|
|
46
46
|
|
|
47
|
-
const Table = React.forwardRef<React.ComponentRef<typeof ExpoTable>, ITableProps>(
|
|
48
|
-
|
|
49
|
-
})
|
|
47
|
+
const Table: any = React.forwardRef<React.ComponentRef<typeof ExpoTable>, ITableProps>(
|
|
48
|
+
({ className, ...props }, ref) => {
|
|
49
|
+
return <ExpoTable ref={ref as any} className={tableStyle({ class: className })} {...props} />;
|
|
50
|
+
},
|
|
51
|
+
);
|
|
50
52
|
|
|
51
|
-
const TableHeader = React.forwardRef<React.ComponentRef<typeof ExpoTHead>, ITableHeaderProps>(function TableHeader(
|
|
53
|
+
const TableHeader: any = React.forwardRef<React.ComponentRef<typeof ExpoTHead>, ITableHeaderProps>(function TableHeader(
|
|
52
54
|
{ className, ...props },
|
|
53
55
|
ref,
|
|
54
56
|
) {
|
|
@@ -59,19 +61,19 @@ const TableHeader = React.forwardRef<React.ComponentRef<typeof ExpoTHead>, ITabl
|
|
|
59
61
|
}, []);
|
|
60
62
|
return (
|
|
61
63
|
<TableHeaderContext.Provider value={contextValue}>
|
|
62
|
-
<ExpoTHead ref={ref} className={tableHeaderStyle({ class: className })} {...props} />
|
|
64
|
+
<ExpoTHead ref={ref as any} className={tableHeaderStyle({ class: className })} {...props} />
|
|
63
65
|
</TableHeaderContext.Provider>
|
|
64
66
|
);
|
|
65
67
|
});
|
|
66
68
|
|
|
67
|
-
const TableBody = React.forwardRef<React.ComponentRef<typeof ExpoTBody>, ITableBodyProps>(function TableBody(
|
|
69
|
+
const TableBody: any = React.forwardRef<React.ComponentRef<typeof ExpoTBody>, ITableBodyProps>(function TableBody(
|
|
68
70
|
{ className, ...props },
|
|
69
71
|
ref,
|
|
70
72
|
) {
|
|
71
|
-
return <ExpoTBody ref={ref} className={tableBodyStyle({ class: className })} {...props} />;
|
|
73
|
+
return <ExpoTBody ref={ref as any} className={tableBodyStyle({ class: className })} {...props} />;
|
|
72
74
|
});
|
|
73
75
|
|
|
74
|
-
const TableFooter = React.forwardRef<React.ComponentRef<typeof ExpoTFoot>, ITableFooterProps>(function TableFooter(
|
|
76
|
+
const TableFooter: any = React.forwardRef<React.ComponentRef<typeof ExpoTFoot>, ITableFooterProps>(function TableFooter(
|
|
75
77
|
{ className, ...props },
|
|
76
78
|
ref,
|
|
77
79
|
) {
|
|
@@ -82,23 +84,22 @@ const TableFooter = React.forwardRef<React.ComponentRef<typeof ExpoTFoot>, ITabl
|
|
|
82
84
|
}, []);
|
|
83
85
|
return (
|
|
84
86
|
<TableFooterContext.Provider value={contextValue}>
|
|
85
|
-
<ExpoTFoot ref={ref} className={tableFooterStyle({ class: className })} {...props} />
|
|
87
|
+
<ExpoTFoot ref={ref as any} className={tableFooterStyle({ class: className })} {...props} />
|
|
86
88
|
</TableFooterContext.Provider>
|
|
87
89
|
);
|
|
88
90
|
});
|
|
89
91
|
|
|
90
|
-
const TableHead = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableHeadProps>(
|
|
91
|
-
{ useRNView = false, className, ...props },
|
|
92
|
-
|
|
93
|
-
) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
92
|
+
const TableHead: any = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableHeadProps>(
|
|
93
|
+
function TableHead({ useRNView = false, className, ...props }, ref) {
|
|
94
|
+
if (useRNView) {
|
|
95
|
+
return <View ref={ref as any} className={tableHeadStyle({ class: className })} {...props} />;
|
|
96
|
+
} else {
|
|
97
|
+
return <Text ref={ref as any} className={tableHeadStyle({ class: className })} {...(props as any)} />;
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
);
|
|
100
101
|
|
|
101
|
-
const TableRow = React.forwardRef<React.ComponentRef<typeof ExpoTR>, ITableRowProps>(function TableRow(
|
|
102
|
+
const TableRow: any = React.forwardRef<React.ComponentRef<typeof ExpoTR>, ITableRowProps>(function TableRow(
|
|
102
103
|
{ className, ...props },
|
|
103
104
|
ref,
|
|
104
105
|
) {
|
|
@@ -107,7 +108,7 @@ const TableRow = React.forwardRef<React.ComponentRef<typeof ExpoTR>, ITableRowPr
|
|
|
107
108
|
|
|
108
109
|
return (
|
|
109
110
|
<ExpoTR
|
|
110
|
-
ref={ref}
|
|
111
|
+
ref={ref as any}
|
|
111
112
|
className={tableRowStyleStyle({
|
|
112
113
|
isHeaderRow,
|
|
113
114
|
isFooterRow,
|
|
@@ -118,20 +119,19 @@ const TableRow = React.forwardRef<React.ComponentRef<typeof ExpoTR>, ITableRowPr
|
|
|
118
119
|
);
|
|
119
120
|
});
|
|
120
121
|
|
|
121
|
-
const TableData = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableDataProps>(
|
|
122
|
-
{ useRNView = false, className, ...props },
|
|
123
|
-
|
|
124
|
-
) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
});
|
|
122
|
+
const TableData: any = React.forwardRef<React.ComponentRef<typeof View | typeof Text>, ITableDataProps>(
|
|
123
|
+
function TableData({ useRNView = false, className, ...props }, ref) {
|
|
124
|
+
if (useRNView) {
|
|
125
|
+
return <View ref={ref as any} className={tableDataStyle({ class: className })} {...props} />;
|
|
126
|
+
} else {
|
|
127
|
+
return <Text ref={ref as any} className={tableDataStyle({ class: className })} {...(props as any)} />;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
);
|
|
131
131
|
|
|
132
|
-
const TableCaption = React.forwardRef<React.ComponentRef<typeof ExpoTCaption>, ITableCaptionProps>(
|
|
132
|
+
const TableCaption: any = React.forwardRef<React.ComponentRef<typeof ExpoTCaption>, ITableCaptionProps>(
|
|
133
133
|
({ className, ...props }, ref) => {
|
|
134
|
-
return <ExpoTCaption ref={ref} className={tableCaptionStyle({ class: className })} {...props} />;
|
|
134
|
+
return <ExpoTCaption ref={ref as any} className={tableCaptionStyle({ class: className })} {...props} />;
|
|
135
135
|
},
|
|
136
136
|
);
|
|
137
137
|
|
|
@@ -21,7 +21,7 @@ interface TabsAnimatedIndicatorProps {
|
|
|
21
21
|
className?: string;
|
|
22
22
|
style?: any;
|
|
23
23
|
}
|
|
24
|
-
Platform.OS === 'web' ? cssInterop(Animated.View, { className: { target: 'style' } }) : Animated.View;
|
|
24
|
+
Platform.OS === 'web' ? (cssInterop as any)(Animated.View, { className: { target: 'style' } }) : Animated.View;
|
|
25
25
|
const isWeb = Platform.OS === 'web';
|
|
26
26
|
|
|
27
27
|
export const TabsAnimatedIndicator = React.forwardRef<any, TabsAnimatedIndicatorProps>(
|
|
@@ -17,7 +17,7 @@ import { TabsAnimatedIndicator } from './TabsAnimatedIndicator';
|
|
|
17
17
|
const SCOPE = 'TABS';
|
|
18
18
|
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
19
19
|
const AnimatedFlatList = Animated.createAnimatedComponent(FlatList);
|
|
20
|
-
Platform.OS === 'web' ? cssInterop(AnimatedView, { className: { target: 'style' } }) : AnimatedView;
|
|
20
|
+
Platform.OS === 'web' ? (cssInterop as any)(AnimatedView, { className: { target: 'style' } }) : AnimatedView;
|
|
21
21
|
/** Styles */
|
|
22
22
|
|
|
23
23
|
const tabsStyle = tva({
|
|
@@ -85,7 +85,7 @@ const UITabs = createTabs({
|
|
|
85
85
|
Indicator: View,
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
cssInterop(PrimitiveIcon, {
|
|
88
|
+
(cssInterop as any)(PrimitiveIcon, {
|
|
89
89
|
className: {
|
|
90
90
|
target: 'style',
|
|
91
91
|
nativeStyleToProp: {
|
|
@@ -6,7 +6,7 @@ import { textStyle } from './styles';
|
|
|
6
6
|
|
|
7
7
|
type ITextProps = React.ComponentProps<typeof RNText> & VariantProps<typeof textStyle>;
|
|
8
8
|
|
|
9
|
-
const Text = React.forwardRef<React.ComponentRef<typeof RNText>, ITextProps>(function Text(
|
|
9
|
+
const Text: any = React.forwardRef<React.ComponentRef<typeof RNText>, ITextProps>(function Text(
|
|
10
10
|
{ className, isTruncated, bold, underline, strikeThrough, size = 'md', sub, italic, highlight, ...props },
|
|
11
11
|
ref,
|
|
12
12
|
) {
|
|
@@ -9,7 +9,7 @@ import Animated, { SlideInUp } from 'react-native-reanimated';
|
|
|
9
9
|
const useToast = createToastHook(View);
|
|
10
10
|
const SCOPE = 'TOAST';
|
|
11
11
|
const AnimatedView = Animated.createAnimatedComponent(View);
|
|
12
|
-
cssInterop(AnimatedView, { className: 'style' });
|
|
12
|
+
(cssInterop as any)(AnimatedView, { className: 'style' });
|
|
13
13
|
const toastStyle = tva({
|
|
14
14
|
base: 'p-4 m-1 rounded-md gap-1 web:pointer-events-auto border-border',
|
|
15
15
|
variants: {
|
|
@@ -161,7 +161,7 @@ const toastDescriptionStyle = tva({
|
|
|
161
161
|
},
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
-
const Root = withStyleContext(AnimatedView, SCOPE);
|
|
164
|
+
const Root: any = withStyleContext(AnimatedView, SCOPE);
|
|
165
165
|
type IToastProps = React.ComponentProps<typeof Root> & {
|
|
166
166
|
className?: string;
|
|
167
167
|
} & VariantProps<typeof toastStyle>;
|
|
@@ -185,7 +185,7 @@ type IToastTitleProps = React.ComponentProps<typeof Text> & {
|
|
|
185
185
|
className?: string;
|
|
186
186
|
} & VariantProps<typeof toastTitleStyle>;
|
|
187
187
|
|
|
188
|
-
const ToastTitle = React.forwardRef<React.ComponentRef<typeof Text>, IToastTitleProps>(function ToastTitle(
|
|
188
|
+
const ToastTitle: any = React.forwardRef<React.ComponentRef<typeof Text>, IToastTitleProps>(function ToastTitle(
|
|
189
189
|
{ className, size = 'md', children, ...props },
|
|
190
190
|
ref,
|
|
191
191
|
) {
|
|
@@ -221,7 +221,7 @@ type IToastDescriptionProps = React.ComponentProps<typeof Text> & {
|
|
|
221
221
|
className?: string;
|
|
222
222
|
} & VariantProps<typeof toastDescriptionStyle>;
|
|
223
223
|
|
|
224
|
-
const ToastDescription = React.forwardRef<React.ComponentRef<typeof Text>, IToastDescriptionProps>(
|
|
224
|
+
const ToastDescription: any = React.forwardRef<React.ComponentRef<typeof Text>, IToastDescriptionProps>(
|
|
225
225
|
function ToastDescription({ className, size = 'md', ...props }, ref) {
|
|
226
226
|
const { variant: parentVariant } = useStyleContext(SCOPE);
|
|
227
227
|
return (
|
|
@@ -20,7 +20,7 @@ export const UITooltip = createTooltip({
|
|
|
20
20
|
AnimatePresence: AnimatePresence,
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
cssInterop(MotionView, { className: 'style' });
|
|
23
|
+
(cssInterop as any)(MotionView, { className: 'style' });
|
|
24
24
|
|
|
25
25
|
const tooltipStyle = tva({
|
|
26
26
|
base: 'w-full h-full web:pointer-events-none',
|
|
@@ -6,7 +6,7 @@ import { vstackStyle } from './styles';
|
|
|
6
6
|
|
|
7
7
|
type IVStackProps = React.ComponentProps<typeof View> & VariantProps<typeof vstackStyle>;
|
|
8
8
|
|
|
9
|
-
const VStack = React.forwardRef<React.ComponentRef<typeof View>, IVStackProps>(function VStack(
|
|
9
|
+
const VStack: any = React.forwardRef<React.ComponentRef<typeof View>, IVStackProps>(function VStack(
|
|
10
10
|
{ className, space, reversed, ...props },
|
|
11
11
|
ref,
|
|
12
12
|
) {
|
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
ActivityIndicator as PaperActivityIndicator,
|
|
5
|
+
Dialog as PaperDialog,
|
|
6
|
+
List as PaperList,
|
|
7
|
+
Avatar as PaperAvatar,
|
|
8
|
+
Checkbox as PaperCheckbox,
|
|
9
|
+
Button as PaperButton,
|
|
10
|
+
Divider as PaperDivider,
|
|
11
|
+
FAB as PaperFab,
|
|
12
|
+
ProgressBar as PaperProgressBar,
|
|
13
|
+
Portal as PaperPortal,
|
|
14
|
+
Card as PaperCard,
|
|
15
|
+
MD3DarkTheme,
|
|
16
|
+
MD3LightTheme,
|
|
17
|
+
PaperProvider,
|
|
18
|
+
Switch as PaperSwitch,
|
|
19
|
+
Text as PaperText,
|
|
20
|
+
TextInput as PaperTextInput,
|
|
21
|
+
type MD3Theme,
|
|
22
|
+
} from 'react-native-paper';
|
|
23
|
+
import {
|
|
24
|
+
accordionRecipe,
|
|
25
|
+
alertDialogRecipe,
|
|
26
|
+
type AccordionProps,
|
|
27
|
+
type AlertDialogProps,
|
|
28
|
+
avatarRecipe,
|
|
29
|
+
checkboxRecipe,
|
|
30
|
+
initialsOf,
|
|
31
|
+
type AvatarProps,
|
|
32
|
+
type CheckboxProps,
|
|
33
|
+
dividerRecipe,
|
|
34
|
+
fabRecipe,
|
|
35
|
+
headingRecipe,
|
|
36
|
+
iconRecipe,
|
|
37
|
+
progressRecipe,
|
|
38
|
+
spinnerRecipe,
|
|
39
|
+
textareaRecipe,
|
|
40
|
+
type DividerProps,
|
|
41
|
+
type FabProps,
|
|
42
|
+
type HeadingProps,
|
|
43
|
+
type PortalProps,
|
|
44
|
+
type ProgressProps,
|
|
45
|
+
type SpinnerProps,
|
|
46
|
+
type TextareaProps,
|
|
47
|
+
badgeRecipe,
|
|
48
|
+
buttonRecipe,
|
|
49
|
+
cardRecipe,
|
|
50
|
+
inputRecipe,
|
|
51
|
+
switchRecipe,
|
|
52
|
+
textRecipe,
|
|
53
|
+
type BadgeProps,
|
|
54
|
+
type ButtonProps,
|
|
55
|
+
type CardProps,
|
|
56
|
+
type InputProps,
|
|
57
|
+
type ProviderComponents,
|
|
58
|
+
type ResolvedTheme,
|
|
59
|
+
type SwitchProps,
|
|
60
|
+
type TextProps,
|
|
61
|
+
} from '../../contract';
|
|
62
|
+
import { useResolvedTheme } from '../provider';
|
|
63
|
+
import { rnBase } from '../rn-base';
|
|
64
|
+
import { defineAdapter } from '../types';
|
|
65
|
+
|
|
66
|
+
/** The registry theme, spelled as a Material 3 theme: every colour role comes from the registry, never from Paper's palette. */
|
|
67
|
+
export function paperTheme(t: ResolvedTheme): MD3Theme {
|
|
68
|
+
const base = t.mode === 'dark' ? MD3DarkTheme : MD3LightTheme;
|
|
69
|
+
const c = t.colors;
|
|
70
|
+
return {
|
|
71
|
+
...base,
|
|
72
|
+
roundness: t.scale.radii.md,
|
|
73
|
+
colors: {
|
|
74
|
+
...base.colors,
|
|
75
|
+
primary: c.primary,
|
|
76
|
+
onPrimary: c.primaryForeground,
|
|
77
|
+
secondary: c.secondary,
|
|
78
|
+
onSecondary: c.secondaryForeground,
|
|
79
|
+
error: c.destructive,
|
|
80
|
+
onError: c.destructiveForeground,
|
|
81
|
+
background: c.background,
|
|
82
|
+
onBackground: c.foreground,
|
|
83
|
+
surface: c.card,
|
|
84
|
+
onSurface: c.cardForeground,
|
|
85
|
+
surfaceVariant: c.muted,
|
|
86
|
+
onSurfaceVariant: c.mutedForeground,
|
|
87
|
+
outline: c.border,
|
|
88
|
+
outlineVariant: c.input,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The props handed to Paper are computed by plain functions so that what Paper receives can be checked against the
|
|
94
|
+
// recipes without rendering anything (see providers.test.tsx).
|
|
95
|
+
|
|
96
|
+
export function paperButtonProps(p: ButtonProps, t: ResolvedTheme) {
|
|
97
|
+
const r = buttonRecipe(p, t);
|
|
98
|
+
const { backgroundColor, borderRadius, opacity, borderWidth, borderColor, ...inner } = r.container;
|
|
99
|
+
const variant = p.variant ?? 'default';
|
|
100
|
+
return {
|
|
101
|
+
mode: (variant === 'outline' ? 'outlined' : variant === 'ghost' || variant === 'link' ? 'text' : 'contained') as
|
|
102
|
+
'outlined' | 'text' | 'contained',
|
|
103
|
+
buttonColor: backgroundColor as string,
|
|
104
|
+
textColor: r.label.color as string,
|
|
105
|
+
style: { borderRadius, opacity, ...(borderWidth ? { borderWidth, borderColor } : {}), minWidth: 0 } as ViewStyle,
|
|
106
|
+
contentStyle: inner as ViewStyle,
|
|
107
|
+
labelStyle: { ...r.label, marginVertical: 0, marginHorizontal: 0, letterSpacing: 0 } as TextStyle,
|
|
108
|
+
disabled: !!(p.disabled || p.loading),
|
|
109
|
+
loading: p.loading,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function paperSwitchProps(p: SwitchProps, t: ResolvedTheme) {
|
|
114
|
+
const r = switchRecipe(p, t);
|
|
115
|
+
return { color: r.trackOn, style: { opacity: r.opacity, transform: [{ scale: r.scale }] } };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function Button(p: ButtonProps) {
|
|
119
|
+
const t = useResolvedTheme();
|
|
120
|
+
const { style, contentStyle, labelStyle, ...rest } = paperButtonProps(p, t);
|
|
121
|
+
return (
|
|
122
|
+
<PaperButton
|
|
123
|
+
{...rest}
|
|
124
|
+
style={style}
|
|
125
|
+
contentStyle={contentStyle}
|
|
126
|
+
labelStyle={labelStyle}
|
|
127
|
+
onPress={p.onPress}
|
|
128
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
129
|
+
testID={p.testID}
|
|
130
|
+
>
|
|
131
|
+
{p.children}
|
|
132
|
+
</PaperButton>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function Text(p: TextProps) {
|
|
137
|
+
const t = useResolvedTheme();
|
|
138
|
+
return (
|
|
139
|
+
<PaperText style={textRecipe(p, t) as object} numberOfLines={p.isTruncated ? 1 : undefined} testID={p.testID}>
|
|
140
|
+
{p.children}
|
|
141
|
+
</PaperText>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function Input(p: InputProps) {
|
|
146
|
+
const t = useResolvedTheme();
|
|
147
|
+
const r = inputRecipe(p, t);
|
|
148
|
+
return (
|
|
149
|
+
<PaperTextInput
|
|
150
|
+
mode="outlined"
|
|
151
|
+
value={p.value}
|
|
152
|
+
defaultValue={p.defaultValue}
|
|
153
|
+
placeholder={p.placeholder}
|
|
154
|
+
onChangeText={p.onChangeText}
|
|
155
|
+
disabled={p.disabled}
|
|
156
|
+
error={p.invalid}
|
|
157
|
+
secureTextEntry={p.secureTextEntry}
|
|
158
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
159
|
+
testID={p.testID}
|
|
160
|
+
placeholderTextColor={r.placeholderTextColor}
|
|
161
|
+
outlineColor={r.container.borderColor as string}
|
|
162
|
+
activeOutlineColor={r.focusBorderColor}
|
|
163
|
+
textColor={r.field.color as string}
|
|
164
|
+
outlineStyle={{
|
|
165
|
+
borderRadius: r.container.borderRadius as number,
|
|
166
|
+
borderWidth: r.container.borderWidth as number,
|
|
167
|
+
}}
|
|
168
|
+
style={{
|
|
169
|
+
height: r.container.height as number,
|
|
170
|
+
backgroundColor: 'transparent',
|
|
171
|
+
opacity: r.container.opacity as number,
|
|
172
|
+
fontSize: r.field.fontSize as number,
|
|
173
|
+
}}
|
|
174
|
+
contentStyle={{ paddingHorizontal: r.container.paddingHorizontal as number }}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function Card(p: CardProps) {
|
|
180
|
+
const t = useResolvedTheme();
|
|
181
|
+
return (
|
|
182
|
+
<PaperCard mode="outlined" style={cardRecipe(p, t) as object} testID={p.testID}>
|
|
183
|
+
{p.children}
|
|
184
|
+
</PaperCard>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function Badge(p: BadgeProps) {
|
|
189
|
+
const t = useResolvedTheme();
|
|
190
|
+
const r = badgeRecipe(p, t);
|
|
191
|
+
return (
|
|
192
|
+
<View style={r.container as object} testID={p.testID}>
|
|
193
|
+
<PaperText style={r.label as object}>{p.children}</PaperText>
|
|
194
|
+
</View>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function Switch(p: SwitchProps) {
|
|
199
|
+
const t = useResolvedTheme();
|
|
200
|
+
const { color, style } = paperSwitchProps(p, t);
|
|
201
|
+
return (
|
|
202
|
+
<PaperSwitch
|
|
203
|
+
value={!!p.value}
|
|
204
|
+
onValueChange={p.onValueChange}
|
|
205
|
+
disabled={p.disabled}
|
|
206
|
+
color={color}
|
|
207
|
+
style={style}
|
|
208
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
209
|
+
testID={p.testID}
|
|
210
|
+
/>
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// ---- the rest of what Paper really has ------------------------------------------------------------------------------
|
|
215
|
+
|
|
216
|
+
function Heading(p: HeadingProps) {
|
|
217
|
+
const t = useResolvedTheme();
|
|
218
|
+
return (
|
|
219
|
+
<PaperText
|
|
220
|
+
accessibilityRole="header"
|
|
221
|
+
style={headingRecipe(p, t) as object}
|
|
222
|
+
numberOfLines={p.isTruncated ? 1 : undefined}
|
|
223
|
+
testID={p.testID}
|
|
224
|
+
>
|
|
225
|
+
{p.children}
|
|
226
|
+
</PaperText>
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function Divider(p: DividerProps) {
|
|
231
|
+
const t = useResolvedTheme();
|
|
232
|
+
return <PaperDivider style={dividerRecipe(p, t) as object} testID={p.testID} />;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function Spinner(p: SpinnerProps) {
|
|
236
|
+
const t = useResolvedTheme();
|
|
237
|
+
const r = spinnerRecipe(p, t);
|
|
238
|
+
return (
|
|
239
|
+
<PaperActivityIndicator
|
|
240
|
+
animating
|
|
241
|
+
color={r.color}
|
|
242
|
+
size={r.size}
|
|
243
|
+
style={{ transform: [{ scale: r.scale }] }}
|
|
244
|
+
accessibilityLabel={p.accessibilityLabel ?? 'Loading'}
|
|
245
|
+
testID={p.testID}
|
|
246
|
+
/>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function Progress(p: ProgressProps) {
|
|
251
|
+
const t = useResolvedTheme();
|
|
252
|
+
const r = progressRecipe(p, t);
|
|
253
|
+
return (
|
|
254
|
+
<PaperProgressBar
|
|
255
|
+
progress={r.value / 100}
|
|
256
|
+
color={r.bar.backgroundColor as string}
|
|
257
|
+
style={{
|
|
258
|
+
height: r.track.height as number,
|
|
259
|
+
borderRadius: r.track.borderRadius as number,
|
|
260
|
+
backgroundColor: r.track.backgroundColor as string,
|
|
261
|
+
}}
|
|
262
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
263
|
+
testID={p.testID}
|
|
264
|
+
/>
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function Textarea(p: TextareaProps) {
|
|
269
|
+
const t = useResolvedTheme();
|
|
270
|
+
const r = textareaRecipe(p, t);
|
|
271
|
+
return (
|
|
272
|
+
<PaperTextInput
|
|
273
|
+
mode="outlined"
|
|
274
|
+
multiline
|
|
275
|
+
numberOfLines={p.rows ?? 4}
|
|
276
|
+
value={p.value}
|
|
277
|
+
defaultValue={p.defaultValue}
|
|
278
|
+
placeholder={p.placeholder}
|
|
279
|
+
onChangeText={p.onChangeText}
|
|
280
|
+
disabled={p.disabled}
|
|
281
|
+
error={p.invalid}
|
|
282
|
+
placeholderTextColor={r.placeholderTextColor}
|
|
283
|
+
outlineColor={r.field.borderColor as string}
|
|
284
|
+
activeOutlineColor={r.focusBorderColor}
|
|
285
|
+
textColor={r.field.color as string}
|
|
286
|
+
outlineStyle={{ borderRadius: r.field.borderRadius as number, borderWidth: r.field.borderWidth as number }}
|
|
287
|
+
style={{
|
|
288
|
+
minHeight: r.field.minHeight as number,
|
|
289
|
+
backgroundColor: 'transparent',
|
|
290
|
+
opacity: r.field.opacity as number,
|
|
291
|
+
fontSize: r.field.fontSize as number,
|
|
292
|
+
}}
|
|
293
|
+
accessibilityLabel={p.accessibilityLabel}
|
|
294
|
+
testID={p.testID}
|
|
295
|
+
/>
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function Fab(p: FabProps) {
|
|
300
|
+
const t = useResolvedTheme();
|
|
301
|
+
const r = fabRecipe(p, t);
|
|
302
|
+
return (
|
|
303
|
+
<PaperFab
|
|
304
|
+
icon={() => <PaperText style={r.icon as object}>{iconRecipe({ name: p.icon ?? 'plus' }, t).glyph}</PaperText>}
|
|
305
|
+
label={p.label}
|
|
306
|
+
onPress={p.onPress}
|
|
307
|
+
color={r.label.color as string}
|
|
308
|
+
style={{
|
|
309
|
+
position: 'absolute',
|
|
310
|
+
right: r.container.right as number,
|
|
311
|
+
bottom: r.container.bottom as number,
|
|
312
|
+
backgroundColor: r.container.backgroundColor as string,
|
|
313
|
+
borderRadius: r.container.borderRadius as number,
|
|
314
|
+
}}
|
|
315
|
+
accessibilityLabel={p.accessibilityLabel ?? p.label ?? 'Action'}
|
|
316
|
+
testID={p.testID}
|
|
317
|
+
/>
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
const Portal = (p: PortalProps) => <PaperPortal>{p.children}</PaperPortal>;
|
|
322
|
+
|
|
323
|
+
function Checkbox(p: CheckboxProps) {
|
|
324
|
+
const t = useResolvedTheme();
|
|
325
|
+
const r = checkboxRecipe(p, t);
|
|
326
|
+
return (
|
|
327
|
+
<View style={r.row as object} testID={p.testID}>
|
|
328
|
+
<PaperCheckbox
|
|
329
|
+
status={p.checked ? 'checked' : 'unchecked'}
|
|
330
|
+
onPress={() => p.onCheckedChange?.(!p.checked)}
|
|
331
|
+
disabled={p.disabled}
|
|
332
|
+
color={t.colors.primary}
|
|
333
|
+
uncheckedColor={r.box.borderColor as string}
|
|
334
|
+
aria-label={p.accessibilityLabel ?? p.label}
|
|
335
|
+
/>
|
|
336
|
+
{p.label ? <PaperText style={r.label as object}>{p.label}</PaperText> : null}
|
|
337
|
+
</View>
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function Avatar(p: AvatarProps) {
|
|
342
|
+
const t = useResolvedTheme();
|
|
343
|
+
const r = avatarRecipe(p, t);
|
|
344
|
+
const size = r.container.width as number;
|
|
345
|
+
return p.source ? (
|
|
346
|
+
<PaperAvatar.Image
|
|
347
|
+
size={size}
|
|
348
|
+
source={{ uri: p.source }}
|
|
349
|
+
accessibilityLabel={p.accessibilityLabel ?? p.name}
|
|
350
|
+
testID={p.testID}
|
|
351
|
+
/>
|
|
352
|
+
) : (
|
|
353
|
+
<PaperAvatar.Text
|
|
354
|
+
size={size}
|
|
355
|
+
label={initialsOf(p.name)}
|
|
356
|
+
color={r.initials.color as string}
|
|
357
|
+
style={{ backgroundColor: r.container.backgroundColor as string }}
|
|
358
|
+
labelStyle={{ fontSize: r.initials.fontSize as number }}
|
|
359
|
+
accessibilityLabel={p.accessibilityLabel ?? p.name}
|
|
360
|
+
testID={p.testID}
|
|
361
|
+
/>
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
function AlertDialog(p: AlertDialogProps) {
|
|
366
|
+
const t = useResolvedTheme();
|
|
367
|
+
const r = alertDialogRecipe(t);
|
|
368
|
+
return (
|
|
369
|
+
<PaperPortal>
|
|
370
|
+
<PaperDialog
|
|
371
|
+
visible={p.visible}
|
|
372
|
+
onDismiss={p.onCancel}
|
|
373
|
+
style={{ backgroundColor: r.panel.backgroundColor as string, borderRadius: r.panel.borderRadius as number }}
|
|
374
|
+
testID={p.testID}
|
|
375
|
+
>
|
|
376
|
+
<PaperDialog.Title style={r.title as object}>{p.title}</PaperDialog.Title>
|
|
377
|
+
{p.description ? (
|
|
378
|
+
<PaperDialog.Content>
|
|
379
|
+
<PaperText style={r.description as object}>{p.description}</PaperText>
|
|
380
|
+
</PaperDialog.Content>
|
|
381
|
+
) : null}
|
|
382
|
+
<PaperDialog.Actions>
|
|
383
|
+
<PaperButton textColor={t.colors.foreground} onPress={p.onCancel}>
|
|
384
|
+
{p.cancelLabel ?? 'Cancel'}
|
|
385
|
+
</PaperButton>
|
|
386
|
+
<PaperButton textColor={p.destructive ? t.colors.destructive : t.colors.primary} onPress={p.onConfirm}>
|
|
387
|
+
{p.confirmLabel ?? 'Confirm'}
|
|
388
|
+
</PaperButton>
|
|
389
|
+
</PaperDialog.Actions>
|
|
390
|
+
</PaperDialog>
|
|
391
|
+
</PaperPortal>
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
function Accordion({ items, type = 'single', value, defaultValue = [], onValueChange, testID }: AccordionProps) {
|
|
396
|
+
const t = useResolvedTheme();
|
|
397
|
+
const r = accordionRecipe(t);
|
|
398
|
+
const [inner, setInner] = React.useState<string[]>(defaultValue);
|
|
399
|
+
const open = value ?? inner;
|
|
400
|
+
const toggle = (key: string) => {
|
|
401
|
+
const next = open.includes(key) ? open.filter((k) => k !== key) : type === 'single' ? [key] : [...open, key];
|
|
402
|
+
if (value === undefined) setInner(next);
|
|
403
|
+
onValueChange?.(next);
|
|
404
|
+
};
|
|
405
|
+
return (
|
|
406
|
+
<View style={r.container as object} testID={testID}>
|
|
407
|
+
{items.map((it) => (
|
|
408
|
+
<PaperList.Accordion
|
|
409
|
+
key={it.key}
|
|
410
|
+
id={it.key}
|
|
411
|
+
title={it.title}
|
|
412
|
+
expanded={open.includes(it.key)}
|
|
413
|
+
onPress={() => (it.disabled ? undefined : toggle(it.key))}
|
|
414
|
+
titleStyle={r.title as object}
|
|
415
|
+
style={{ backgroundColor: 'transparent', opacity: it.disabled ? 0.4 : 1 }}
|
|
416
|
+
>
|
|
417
|
+
<View style={r.content as object}>{it.content}</View>
|
|
418
|
+
</PaperList.Accordion>
|
|
419
|
+
))}
|
|
420
|
+
</View>
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
const components: ProviderComponents = {
|
|
425
|
+
...rnBase,
|
|
426
|
+
Button,
|
|
427
|
+
Text,
|
|
428
|
+
Input,
|
|
429
|
+
Card,
|
|
430
|
+
Badge,
|
|
431
|
+
Switch,
|
|
432
|
+
Heading,
|
|
433
|
+
Divider,
|
|
434
|
+
Spinner,
|
|
435
|
+
Progress,
|
|
436
|
+
Textarea,
|
|
437
|
+
Fab,
|
|
438
|
+
Portal,
|
|
439
|
+
Checkbox,
|
|
440
|
+
Avatar,
|
|
441
|
+
AlertDialog,
|
|
442
|
+
Accordion,
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
export const paper = defineAdapter({
|
|
446
|
+
name: 'paper',
|
|
447
|
+
Provider: ({ theme, children }) => <PaperProvider theme={paperTheme(theme)}>{children}</PaperProvider>,
|
|
448
|
+
components,
|
|
449
|
+
});
|