@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
package/design/themes.xml
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!--
|
|
3
|
-
Flipova Foundation Themes
|
|
4
|
-
|
|
3
|
+
Flipova Foundation Themes: neutral starter
|
|
4
|
+
============================================
|
|
5
|
+
This file names no brand and no season: it is the starting point `npx flipova-design adopt`
|
|
6
|
+
copies into a project. Rename, add and recolour freely (a light/dark PAIR shares a `variant`);
|
|
7
|
+
the components read roles, never theme ids.
|
|
5
8
|
Namespace: urn:flipova:foundation:registry
|
|
6
9
|
Schema: flipova.foundation/registry/1
|
|
7
10
|
Schema Location: schema.xsd
|
|
@@ -12,8 +15,8 @@
|
|
|
12
15
|
A theme maps semantic roles to color token references. The role ids are the
|
|
13
16
|
gluestack-ui / nativewind CSS variable names (the part after the two-dash
|
|
14
17
|
prefix), so the design registry and the runtime theme config speak the same
|
|
15
|
-
language:
|
|
16
|
-
components/ui/gluestack-ui-provider/config.ts.
|
|
18
|
+
language: `flipova-design gen` turns this file into the CSS variables of
|
|
19
|
+
components/providers/gluestack/ui/gluestack-ui-provider/config.ts.
|
|
17
20
|
|
|
18
21
|
ROLE NAMING:
|
|
19
22
|
A role id is a CSS variable name without its two-dash prefix, e.g. the role
|
|
@@ -200,178 +203,5 @@
|
|
|
200
203
|
</role>
|
|
201
204
|
</roleMap>
|
|
202
205
|
</theme>
|
|
203
|
-
<!-- Spring variant: a seasonal light/dark PAIR. Same roles, seasonal
|
|
204
|
-
greens, so the app can offer it as a theme and still honour the
|
|
205
|
-
light/dark mode the user picked. -->
|
|
206
|
-
<theme id="spring-light" mode="light" variant="spring">
|
|
207
|
-
<roleMap>
|
|
208
|
-
<role id="background">
|
|
209
|
-
<ref>$ref.tokens.color.success.50</ref>
|
|
210
|
-
</role>
|
|
211
|
-
<role id="foreground">
|
|
212
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
213
|
-
</role>
|
|
214
|
-
<role id="card">
|
|
215
|
-
<ref>$ref.tokens.color.white</ref>
|
|
216
|
-
</role>
|
|
217
|
-
<role id="card-foreground">
|
|
218
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
219
|
-
</role>
|
|
220
|
-
<role id="popover">
|
|
221
|
-
<ref>$ref.tokens.color.white</ref>
|
|
222
|
-
</role>
|
|
223
|
-
<role id="popover-foreground">
|
|
224
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
225
|
-
</role>
|
|
226
|
-
<role id="primary">
|
|
227
|
-
<ref>$ref.tokens.color.success.600</ref>
|
|
228
|
-
</role>
|
|
229
|
-
<role id="primary-foreground">
|
|
230
|
-
<ref>$ref.tokens.color.white</ref>
|
|
231
|
-
</role>
|
|
232
|
-
<role id="secondary">
|
|
233
|
-
<ref>$ref.tokens.color.success.500</ref>
|
|
234
|
-
</role>
|
|
235
|
-
<role id="secondary-foreground">
|
|
236
|
-
<ref>$ref.tokens.color.white</ref>
|
|
237
|
-
</role>
|
|
238
|
-
<role id="muted">
|
|
239
|
-
<ref>$ref.tokens.color.success.100</ref>
|
|
240
|
-
</role>
|
|
241
|
-
<role id="muted-foreground">
|
|
242
|
-
<ref>$ref.tokens.color.success.700</ref>
|
|
243
|
-
</role>
|
|
244
|
-
<role id="accent">
|
|
245
|
-
<ref>$ref.tokens.color.success.200</ref>
|
|
246
|
-
</role>
|
|
247
|
-
<role id="accent-foreground">
|
|
248
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
249
|
-
</role>
|
|
250
|
-
<role id="destructive">
|
|
251
|
-
<ref>$ref.tokens.color.error.600</ref>
|
|
252
|
-
</role>
|
|
253
|
-
<role id="destructive-foreground">
|
|
254
|
-
<ref>$ref.tokens.color.white</ref>
|
|
255
|
-
</role>
|
|
256
|
-
<role id="border">
|
|
257
|
-
<ref>$ref.tokens.color.success.200</ref>
|
|
258
|
-
</role>
|
|
259
|
-
<role id="input">
|
|
260
|
-
<ref>$ref.tokens.color.success.200</ref>
|
|
261
|
-
</role>
|
|
262
|
-
<role id="ring">
|
|
263
|
-
<ref>$ref.tokens.color.success.400</ref>
|
|
264
|
-
</role>
|
|
265
|
-
<role id="success">
|
|
266
|
-
<ref>$ref.tokens.color.success.600</ref>
|
|
267
|
-
</role>
|
|
268
|
-
<role id="success-foreground">
|
|
269
|
-
<ref>$ref.tokens.color.white</ref>
|
|
270
|
-
</role>
|
|
271
|
-
<role id="warning">
|
|
272
|
-
<ref>$ref.tokens.color.warning.600</ref>
|
|
273
|
-
</role>
|
|
274
|
-
<role id="warning-foreground">
|
|
275
|
-
<ref>$ref.tokens.color.white</ref>
|
|
276
|
-
</role>
|
|
277
|
-
<role id="error">
|
|
278
|
-
<ref>$ref.tokens.color.error.600</ref>
|
|
279
|
-
</role>
|
|
280
|
-
<role id="error-foreground">
|
|
281
|
-
<ref>$ref.tokens.color.white</ref>
|
|
282
|
-
</role>
|
|
283
|
-
<role id="info">
|
|
284
|
-
<ref>$ref.tokens.color.info.600</ref>
|
|
285
|
-
</role>
|
|
286
|
-
<role id="info-foreground">
|
|
287
|
-
<ref>$ref.tokens.color.white</ref>
|
|
288
|
-
</role>
|
|
289
|
-
</roleMap>
|
|
290
|
-
</theme>
|
|
291
|
-
<theme id="spring-dark" mode="dark" variant="spring">
|
|
292
|
-
<roleMap>
|
|
293
|
-
<role id="background">
|
|
294
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
295
|
-
</role>
|
|
296
|
-
<role id="foreground">
|
|
297
|
-
<ref>$ref.tokens.color.success.50</ref>
|
|
298
|
-
</role>
|
|
299
|
-
<role id="card">
|
|
300
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
301
|
-
</role>
|
|
302
|
-
<role id="card-foreground">
|
|
303
|
-
<ref>$ref.tokens.color.success.50</ref>
|
|
304
|
-
</role>
|
|
305
|
-
<role id="popover">
|
|
306
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
307
|
-
</role>
|
|
308
|
-
<role id="popover-foreground">
|
|
309
|
-
<ref>$ref.tokens.color.success.50</ref>
|
|
310
|
-
</role>
|
|
311
|
-
<role id="primary">
|
|
312
|
-
<ref>$ref.tokens.color.success.400</ref>
|
|
313
|
-
</role>
|
|
314
|
-
<role id="primary-foreground">
|
|
315
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
316
|
-
</role>
|
|
317
|
-
<role id="secondary">
|
|
318
|
-
<ref>$ref.tokens.color.success.300</ref>
|
|
319
|
-
</role>
|
|
320
|
-
<role id="secondary-foreground">
|
|
321
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
322
|
-
</role>
|
|
323
|
-
<role id="muted">
|
|
324
|
-
<ref>$ref.tokens.color.success.900</ref>
|
|
325
|
-
</role>
|
|
326
|
-
<role id="muted-foreground">
|
|
327
|
-
<ref>$ref.tokens.color.success.200</ref>
|
|
328
|
-
</role>
|
|
329
|
-
<role id="accent">
|
|
330
|
-
<ref>$ref.tokens.color.success.800</ref>
|
|
331
|
-
</role>
|
|
332
|
-
<role id="accent-foreground">
|
|
333
|
-
<ref>$ref.tokens.color.success.50</ref>
|
|
334
|
-
</role>
|
|
335
|
-
<role id="destructive">
|
|
336
|
-
<ref>$ref.tokens.color.error.500</ref>
|
|
337
|
-
</role>
|
|
338
|
-
<role id="destructive-foreground">
|
|
339
|
-
<ref>$ref.tokens.color.white</ref>
|
|
340
|
-
</role>
|
|
341
|
-
<role id="border">
|
|
342
|
-
<ref>$ref.tokens.color.success.800</ref>
|
|
343
|
-
</role>
|
|
344
|
-
<role id="input">
|
|
345
|
-
<ref>$ref.tokens.color.success.800</ref>
|
|
346
|
-
</role>
|
|
347
|
-
<role id="ring">
|
|
348
|
-
<ref>$ref.tokens.color.success.300</ref>
|
|
349
|
-
</role>
|
|
350
|
-
<role id="success">
|
|
351
|
-
<ref>$ref.tokens.color.success.400</ref>
|
|
352
|
-
</role>
|
|
353
|
-
<role id="success-foreground">
|
|
354
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
355
|
-
</role>
|
|
356
|
-
<role id="warning">
|
|
357
|
-
<ref>$ref.tokens.color.warning.400</ref>
|
|
358
|
-
</role>
|
|
359
|
-
<role id="warning-foreground">
|
|
360
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
361
|
-
</role>
|
|
362
|
-
<role id="error">
|
|
363
|
-
<ref>$ref.tokens.color.error.400</ref>
|
|
364
|
-
</role>
|
|
365
|
-
<role id="error-foreground">
|
|
366
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
367
|
-
</role>
|
|
368
|
-
<role id="info">
|
|
369
|
-
<ref>$ref.tokens.color.info.400</ref>
|
|
370
|
-
</role>
|
|
371
|
-
<role id="info-foreground">
|
|
372
|
-
<ref>$ref.tokens.color.success.950</ref>
|
|
373
|
-
</role>
|
|
374
|
-
</roleMap>
|
|
375
|
-
</theme>
|
|
376
206
|
</items>
|
|
377
207
|
</themes>
|
|
@@ -1,51 +1,45 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* flipova-design — the design toolchain of @flipova/foundation. Node only, no dependency.
|
|
4
4
|
*
|
|
5
|
-
* Design philosophy: the registries live in the INSTALLED package, never in the
|
|
6
|
-
* consumer project. `npx flipova-design` therefore drives the tooling that
|
|
7
|
-
* already sits in `node_modules/@flipova/foundation/design`, and only injects
|
|
8
|
-
* the app-level wiring (Tailwind / PostCSS / global CSS + npm scripts) into the
|
|
9
|
-
* project.
|
|
10
|
-
*
|
|
11
|
-
* Usage:
|
|
12
5
|
* npx flipova-design init inject app-level wiring (never overwrites)
|
|
13
6
|
* npx flipova-design init --force overwrite the injected files
|
|
14
|
-
* npx flipova-design
|
|
7
|
+
* npx flipova-design adopt copy the registries into the project (it then owns its design system)
|
|
8
|
+
* npx flipova-design gui [--port N] [--no-open] edit the registries visually (local, nothing leaves the machine)
|
|
15
9
|
* npx flipova-design where print the resolved paths (diagnostics)
|
|
16
|
-
* npx flipova-design gen [--check]
|
|
17
|
-
* npx flipova-design check
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
10
|
+
* npx flipova-design gen [--check|--list] compile tokens/themes -> config.ts + tokens.js
|
|
11
|
+
* npx flipova-design check [--list-rules] [--sync-version] [-v] determinism rules + XSD
|
|
12
|
+
* npx flipova-design verify the committed canonical index matches the registries
|
|
13
|
+
* npx flipova-design canonical re-emit design/canonical.index.txt
|
|
14
|
+
* npx flipova-design lint XSD-validate every registry file
|
|
15
|
+
* npx flipova-design pipeline gen, check, verify, lint
|
|
22
16
|
*
|
|
23
|
-
*
|
|
24
|
-
* `node_modules/@flipova/foundation/components/ui/gluestack-ui-provider/*` -- the
|
|
25
|
-
* exact files consumed by `@flipova/foundation/tokens` and `@flipova/foundation/ui`.
|
|
17
|
+
* Registry resolution: <project>/design/manifest.xml when present (the project adopted them), else the installed package.
|
|
26
18
|
*/
|
|
27
19
|
'use strict';
|
|
28
20
|
|
|
29
|
-
const { spawnSync } = require('child_process');
|
|
30
21
|
const fs = require('fs');
|
|
31
22
|
const path = require('path');
|
|
32
23
|
|
|
33
24
|
const PACKAGE_ROOT = path.resolve(__dirname, '..', '..');
|
|
34
25
|
const PACKAGE_DESIGN = path.join(PACKAGE_ROOT, 'design');
|
|
35
|
-
const TOOL = path.join(PACKAGE_DESIGN, 'tools', 'design.js');
|
|
36
26
|
const PROJECT_ROOT = process.cwd();
|
|
37
27
|
const PROJECT_DESIGN = path.join(PROJECT_ROOT, 'design');
|
|
38
28
|
|
|
39
|
-
/* ------------------------------------------------------------------ *
|
|
40
|
-
* Resolution
|
|
41
|
-
* ------------------------------------------------------------------ */
|
|
42
|
-
|
|
43
29
|
function resolution() {
|
|
44
30
|
const override = fs.existsSync(path.join(PROJECT_DESIGN, 'manifest.xml'));
|
|
45
31
|
return {
|
|
46
32
|
override,
|
|
47
|
-
designDir:
|
|
48
|
-
|
|
33
|
+
designDir: process.env.FOUNDATION_DESIGN_DIR
|
|
34
|
+
? path.resolve(process.env.FOUNDATION_DESIGN_DIR)
|
|
35
|
+
: override
|
|
36
|
+
? PROJECT_DESIGN
|
|
37
|
+
: PACKAGE_DESIGN,
|
|
38
|
+
outputRoot: process.env.FOUNDATION_PROJECT_ROOT
|
|
39
|
+
? path.resolve(process.env.FOUNDATION_PROJECT_ROOT)
|
|
40
|
+
: override
|
|
41
|
+
? PROJECT_ROOT
|
|
42
|
+
: PACKAGE_ROOT,
|
|
49
43
|
};
|
|
50
44
|
}
|
|
51
45
|
|
|
@@ -56,9 +50,6 @@ function readPackageVersion() {
|
|
|
56
50
|
return 'unknown';
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
|
-
/* ------------------------------------------------------------------ *
|
|
60
|
-
* Injected app-level files (never copied registries)
|
|
61
|
-
* ------------------------------------------------------------------ */
|
|
62
53
|
|
|
63
54
|
const TAILWIND_CONFIG = `// tailwind.config.js
|
|
64
55
|
// Injected by \`npx flipova-design init\` -- safe to edit, safe to regenerate.
|
|
@@ -107,7 +98,6 @@ const NPM_SCRIPTS = {
|
|
|
107
98
|
'design:verify': 'flipova-design verify',
|
|
108
99
|
'design:canonical': 'flipova-design canonical',
|
|
109
100
|
'design:lint': 'flipova-design lint',
|
|
110
|
-
'design:doc': 'flipova-design doc',
|
|
111
101
|
'design:pipeline': 'flipova-design pipeline',
|
|
112
102
|
};
|
|
113
103
|
|
|
@@ -171,7 +161,7 @@ function inject(force) {
|
|
|
171
161
|
injectScripts(force, created, skipped);
|
|
172
162
|
|
|
173
163
|
const { override, designDir, outputRoot } = resolution();
|
|
174
|
-
const artifacts = path.join(outputRoot, 'components', 'ui', 'gluestack-ui-provider');
|
|
164
|
+
const artifacts = path.join(outputRoot, 'components', 'providers', 'gluestack', 'ui', 'gluestack-ui-provider');
|
|
175
165
|
|
|
176
166
|
process.stdout.write(`Flipova Foundation ${readPackageVersion()}\n`);
|
|
177
167
|
process.stdout.write(` registries : ${designDir}${override ? ' (project override)' : ' (from node_modules)'}\n`);
|
|
@@ -196,7 +186,6 @@ const REGISTRY_FILES = [
|
|
|
196
186
|
'schema.xsd',
|
|
197
187
|
'tokens.xml',
|
|
198
188
|
'themes.xml',
|
|
199
|
-
'documentation.xml',
|
|
200
189
|
// The emitted index of the registries: without it `verify` reports the copy as
|
|
201
190
|
// drifting, which is the opposite of what adopting them should feel like.
|
|
202
191
|
'canonical.index.txt',
|
|
@@ -205,18 +194,38 @@ const REGISTRY_FILES = [
|
|
|
205
194
|
const ADOPTED_OUTPUTS = {
|
|
206
195
|
gluestackConfig: 'theme/config.ts',
|
|
207
196
|
gluestackTokens: 'theme/tokens.js',
|
|
197
|
+
designTheme: 'theme/design-theme.ts',
|
|
208
198
|
};
|
|
209
199
|
|
|
210
200
|
const PROVIDER = `// theme/provider.tsx
|
|
211
201
|
// Generated by \`npx flipova-design adopt\` -- safe to edit.
|
|
212
202
|
//
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
|
|
203
|
+
// Your themes live in design/*.xml; \`npm run design:gen\` turns them into ./design-theme.ts (components) and
|
|
204
|
+
// ./config.ts + ./tokens.js (Tailwind / NativeWind). This provider hands them to the components.
|
|
205
|
+
//
|
|
206
|
+
// To change the component library, change the next two lines only:
|
|
207
|
+
// flipova (default) | gluestack | reusables | paper | tamagui -> '@flipova/foundation/providers/<name>'
|
|
208
|
+
import { FlipovaProvider } from '@flipova/foundation';
|
|
209
|
+
import { flipova } from '@flipova/foundation/providers/flipova';
|
|
210
|
+
import type { ReactNode } from 'react';
|
|
211
|
+
import { designTheme } from './design-theme';
|
|
212
|
+
|
|
213
|
+
export function AppThemeProvider({
|
|
214
|
+
children,
|
|
215
|
+
mode = 'system',
|
|
216
|
+
variant,
|
|
217
|
+
}: {
|
|
218
|
+
children?: ReactNode;
|
|
219
|
+
mode?: 'light' | 'dark' | 'system';
|
|
220
|
+
variant?: string;
|
|
221
|
+
}) {
|
|
222
|
+
return (
|
|
223
|
+
<FlipovaProvider adapter={flipova} theme={designTheme} mode={mode} variant={variant}>
|
|
224
|
+
{children}
|
|
225
|
+
</FlipovaProvider>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
218
228
|
|
|
219
|
-
export const AppThemeProvider = createGluestackUIProvider(theme);
|
|
220
229
|
export default AppThemeProvider;
|
|
221
230
|
`;
|
|
222
231
|
|
|
@@ -250,7 +259,7 @@ function adopt(force) {
|
|
|
250
259
|
const manifestPath = path.join(PROJECT_DESIGN, 'manifest.xml');
|
|
251
260
|
const manifest = fs.readFileSync(manifestPath, 'utf8');
|
|
252
261
|
const rewritten = manifest.replace(
|
|
253
|
-
/<(gluestackConfig|gluestackTokens)>[^<]*<\/\1>/g,
|
|
262
|
+
/<(gluestackConfig|gluestackTokens|designTheme)>[^<]*<\/\1>/g,
|
|
254
263
|
(line, kind) => `<${kind}>${ADOPTED_OUTPUTS[kind]}</${kind}>`,
|
|
255
264
|
);
|
|
256
265
|
if (rewritten !== manifest) {
|
|
@@ -272,12 +281,64 @@ function adopt(force) {
|
|
|
272
281
|
for (const what of created) process.stdout.write(` created : ${what}\n`);
|
|
273
282
|
process.stdout.write('\nNext steps:\n');
|
|
274
283
|
process.stdout.write(' 1. edit design/tokens.xml and design/themes.xml - that is now your design system\n');
|
|
275
|
-
process.stdout.write('
|
|
284
|
+
process.stdout.write(' (or visually: npx flipova-design gui)\n');
|
|
285
|
+
process.stdout.write(' 2. npm run design:gen -> theme/design-theme.ts + theme/config.ts + theme/tokens.js\n');
|
|
276
286
|
process.stdout.write(" 3. tailwind.config.js -> require('./theme/tokens')\n");
|
|
277
287
|
process.stdout.write(' 4. wrap the app in <AppThemeProvider mode="system"> from ./theme/provider\n');
|
|
278
288
|
process.stdout.write(' 5. npm run design:verify -> the registries are in step with the artifacts\n');
|
|
279
289
|
}
|
|
280
290
|
|
|
291
|
+
/** `gui`: adopt the registries when the project has none yet, then serve the editor. Resolves when the server stops. */
|
|
292
|
+
function gui(args) {
|
|
293
|
+
const { override } = resolution();
|
|
294
|
+
if (!override && !process.env.FOUNDATION_DESIGN_DIR) {
|
|
295
|
+
process.stdout.write(
|
|
296
|
+
'This project has not adopted the design registries yet: adopting the neutral starter first.\n',
|
|
297
|
+
);
|
|
298
|
+
adopt(false);
|
|
299
|
+
}
|
|
300
|
+
const { designDir, outputRoot } = resolution();
|
|
301
|
+
const at = args.indexOf('--port');
|
|
302
|
+
const port = at >= 0 ? Number(args[at + 1]) : 0;
|
|
303
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
304
|
+
process.stderr.write('--port expects a number between 0 and 65535\n');
|
|
305
|
+
return 2;
|
|
306
|
+
}
|
|
307
|
+
require('./lib/gui')
|
|
308
|
+
.start({ designDir, outputRoot, port })
|
|
309
|
+
.then(({ url, close }) => {
|
|
310
|
+
if (!args.includes('--no-open')) openBrowser(url);
|
|
311
|
+
process.stdout.write('Press Ctrl+C to stop.\n');
|
|
312
|
+
process.once('SIGINT', () => close().then(() => process.exit(0)));
|
|
313
|
+
})
|
|
314
|
+
.catch((e) => {
|
|
315
|
+
process.stderr.write(`gui: ${e.message}\n`);
|
|
316
|
+
process.exitCode = 1;
|
|
317
|
+
});
|
|
318
|
+
return undefined;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Best effort: the URL is printed anyway. */
|
|
322
|
+
function openBrowser(url) {
|
|
323
|
+
const { spawn } = require('child_process');
|
|
324
|
+
// Only the local console is ever opened: a loopback http(s) address with no space or shell character in it.
|
|
325
|
+
if (!/^https?:\/\/(127\.0\.0\.1|localhost|\[::1\])(:\d+)?(\/[\w\-./?=&%#]*)?$/.test(String(url))) return;
|
|
326
|
+
const [cmd, ...a] =
|
|
327
|
+
process.platform === 'darwin'
|
|
328
|
+
? ['open', url]
|
|
329
|
+
: process.platform === 'win32'
|
|
330
|
+
? ['rundll32', 'url.dll,FileProtocolHandler', url]
|
|
331
|
+
: ['xdg-open', url];
|
|
332
|
+
try {
|
|
333
|
+
// nosemgrep: javascript.lang.security.detect-child-process.detect-child-process -- url validated above (loopback only), no shell
|
|
334
|
+
spawn(cmd, a, { stdio: 'ignore', detached: true, shell: false })
|
|
335
|
+
.on('error', () => {})
|
|
336
|
+
.unref();
|
|
337
|
+
} catch (_) {
|
|
338
|
+
/* no browser: use the printed link */
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
281
342
|
function printWhere() {
|
|
282
343
|
const { override, designDir, outputRoot } = resolution();
|
|
283
344
|
process.stdout.write(`package ${PACKAGE_ROOT}\n`);
|
|
@@ -287,59 +348,98 @@ function printWhere() {
|
|
|
287
348
|
process.stdout.write(
|
|
288
349
|
override
|
|
289
350
|
? `artifacts ${path.join(outputRoot, 'theme')} (owned by this project)\n`
|
|
290
|
-
: `artifacts ${path.join(outputRoot, 'components', '
|
|
351
|
+
: `artifacts ${path.join(outputRoot, 'components', 'theme')} (+ components/providers/gluestack/ui/gluestack-ui-provider)\n`,
|
|
291
352
|
);
|
|
292
|
-
process.stdout.write(`tool ${
|
|
293
|
-
process.stdout.write(`python ${process.env.FOUNDATION_PYTHON || '(auto-detect)'}\n`);
|
|
353
|
+
process.stdout.write(`tool ${__filename}\n`);
|
|
294
354
|
}
|
|
295
355
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
process.exit(2);
|
|
300
|
-
}
|
|
356
|
+
// --- commands ----------------------------------------------------------------------------------------------------
|
|
357
|
+
|
|
358
|
+
function tool(command, args) {
|
|
301
359
|
const { designDir, outputRoot } = resolution();
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
360
|
+
const manifest = path.join(designDir, 'manifest.xml');
|
|
361
|
+
const schema = path.join(designDir, 'schema.xsd');
|
|
362
|
+
const flag = (f) => args.includes(f);
|
|
363
|
+
switch (command) {
|
|
364
|
+
case 'gen':
|
|
365
|
+
return require('./lib/generate').run({
|
|
366
|
+
root: outputRoot,
|
|
367
|
+
manifest,
|
|
368
|
+
check: flag('--check'),
|
|
369
|
+
list: flag('--list'),
|
|
370
|
+
});
|
|
371
|
+
case 'check':
|
|
372
|
+
return require('./lib/check').run({
|
|
373
|
+
root: outputRoot,
|
|
374
|
+
manifest,
|
|
375
|
+
schema,
|
|
376
|
+
check: true,
|
|
377
|
+
listRules: flag('--list-rules'),
|
|
378
|
+
syncVersion: flag('--sync-version'),
|
|
379
|
+
verbose: flag('--verbose') || flag('-v'),
|
|
380
|
+
});
|
|
381
|
+
case 'verify':
|
|
382
|
+
return require('./lib/check').run({
|
|
383
|
+
root: outputRoot,
|
|
384
|
+
manifest,
|
|
385
|
+
check: false,
|
|
386
|
+
verifyCanonical: true,
|
|
387
|
+
outFile: path.join(designDir, 'canonical.index.txt'),
|
|
388
|
+
});
|
|
389
|
+
case 'canonical':
|
|
390
|
+
return require('./lib/check').run({
|
|
391
|
+
root: outputRoot,
|
|
392
|
+
manifest,
|
|
393
|
+
check: false,
|
|
394
|
+
emitCanonical: true,
|
|
395
|
+
outFile: path.join(designDir, 'canonical.index.txt'),
|
|
396
|
+
});
|
|
397
|
+
case 'lint':
|
|
398
|
+
return require('./lib/lint').run({ schema, manifest, dir: designDir, verbose: flag('--verbose') || flag('-v') });
|
|
399
|
+
case 'pipeline': {
|
|
400
|
+
for (const step of ['gen', 'check', 'verify', 'lint']) {
|
|
401
|
+
const code = tool(step, args);
|
|
402
|
+
if (code !== 0) return code;
|
|
403
|
+
}
|
|
404
|
+
return 0;
|
|
405
|
+
}
|
|
406
|
+
default:
|
|
407
|
+
return null;
|
|
315
408
|
}
|
|
316
|
-
process.exit(result.status == null ? 1 : result.status);
|
|
317
409
|
}
|
|
318
410
|
|
|
319
411
|
function main() {
|
|
320
|
-
const
|
|
321
|
-
const command = argv[0];
|
|
322
|
-
const args = argv.slice(1);
|
|
323
|
-
|
|
412
|
+
const [command, ...args] = process.argv.slice(2);
|
|
324
413
|
if (command === 'init' || command === 'inject') {
|
|
325
414
|
inject(args.includes('--force'));
|
|
326
|
-
|
|
415
|
+
return 0;
|
|
327
416
|
}
|
|
328
417
|
if (command === 'where') {
|
|
329
418
|
printWhere();
|
|
330
|
-
|
|
419
|
+
return 0;
|
|
331
420
|
}
|
|
332
421
|
if (command === 'adopt') {
|
|
333
422
|
adopt(args.includes('--force'));
|
|
334
|
-
|
|
423
|
+
return 0;
|
|
335
424
|
}
|
|
425
|
+
if (command === 'gui') return gui(args);
|
|
336
426
|
if (command === undefined) {
|
|
427
|
+
process.stderr.write('Usage: npx flipova-design <init|adopt|gui|where|gen|check|verify|canonical|lint|pipeline>\n');
|
|
428
|
+
return 2;
|
|
429
|
+
}
|
|
430
|
+
const code = tool(command, args);
|
|
431
|
+
if (code === null) {
|
|
337
432
|
process.stderr.write(
|
|
338
|
-
|
|
433
|
+
`Unknown command: ${command}\nAvailable: init, inject, adopt, gui, where, gen, check, verify, canonical, lint, pipeline\n`,
|
|
339
434
|
);
|
|
340
|
-
|
|
435
|
+
return 2;
|
|
341
436
|
}
|
|
342
|
-
|
|
437
|
+
return code;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if (require.main === module) {
|
|
441
|
+
const code = main();
|
|
442
|
+
if (code !== undefined) process.exitCode = code;
|
|
343
443
|
}
|
|
344
444
|
|
|
345
|
-
main
|
|
445
|
+
module.exports = { main, tool, resolution };
|