pixelize-native-library 1.0.6
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/README.md +34 -0
- package/lib/module/core/MODULE.md +94 -0
- package/lib/module/core/a11y/MODULE.md +22 -0
- package/lib/module/core/a11y/index.js +26 -0
- package/lib/module/core/a11y/index.js.map +1 -0
- package/lib/module/core/icon/MODULE.md +35 -0
- package/lib/module/core/icon/index.js +92 -0
- package/lib/module/core/icon/index.js.map +1 -0
- package/lib/module/core/style/index.js +4 -0
- package/lib/module/core/style/index.js.map +1 -0
- package/lib/module/core/style/layoutStyle.js +4 -0
- package/lib/module/core/style/layoutStyle.js.map +1 -0
- package/lib/module/core/style/variants.js +115 -0
- package/lib/module/core/style/variants.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/modules/accordion/Accordion.js +194 -0
- package/lib/module/modules/accordion/Accordion.js.map +1 -0
- package/lib/module/modules/accordion/Accordion.variants.js +143 -0
- package/lib/module/modules/accordion/Accordion.variants.js.map +1 -0
- package/lib/module/modules/accordion/MODULE.md +97 -0
- package/lib/module/modules/accordion/index.js +10 -0
- package/lib/module/modules/accordion/index.js.map +1 -0
- package/lib/module/modules/alert-dialog/AlertDialog.js +62 -0
- package/lib/module/modules/alert-dialog/AlertDialog.js.map +1 -0
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js +44 -0
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js.map +1 -0
- package/lib/module/modules/alert-dialog/MODULE.md +81 -0
- package/lib/module/modules/alert-dialog/index.js +10 -0
- package/lib/module/modules/alert-dialog/index.js.map +1 -0
- package/lib/module/modules/avatar/Avatar.js +57 -0
- package/lib/module/modules/avatar/Avatar.js.map +1 -0
- package/lib/module/modules/avatar/Avatar.variants.js +127 -0
- package/lib/module/modules/avatar/Avatar.variants.js.map +1 -0
- package/lib/module/modules/avatar/MODULE.md +76 -0
- package/lib/module/modules/avatar/index.js +12 -0
- package/lib/module/modules/avatar/index.js.map +1 -0
- package/lib/module/modules/badge/Badge.js +56 -0
- package/lib/module/modules/badge/Badge.js.map +1 -0
- package/lib/module/modules/badge/Badge.variants.js +124 -0
- package/lib/module/modules/badge/Badge.variants.js.map +1 -0
- package/lib/module/modules/badge/MODULE.md +82 -0
- package/lib/module/modules/badge/index.js +12 -0
- package/lib/module/modules/badge/index.js.map +1 -0
- package/lib/module/modules/bottom-nav/BottomNav.js +257 -0
- package/lib/module/modules/bottom-nav/BottomNav.js.map +1 -0
- package/lib/module/modules/bottom-nav/BottomNav.search.js +153 -0
- package/lib/module/modules/bottom-nav/BottomNav.search.js.map +1 -0
- package/lib/module/modules/bottom-nav/BottomNav.variants.js +164 -0
- package/lib/module/modules/bottom-nav/BottomNav.variants.js.map +1 -0
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js +297 -0
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js.map +1 -0
- package/lib/module/modules/bottom-nav/MODULE.md +198 -0
- package/lib/module/modules/bottom-nav/index.js +16 -0
- package/lib/module/modules/bottom-nav/index.js.map +1 -0
- package/lib/module/modules/button/Button.js +173 -0
- package/lib/module/modules/button/Button.js.map +1 -0
- package/lib/module/modules/button/Button.variants.js +173 -0
- package/lib/module/modules/button/Button.variants.js.map +1 -0
- package/lib/module/modules/button/MODULE.md +87 -0
- package/lib/module/modules/button/index.js +12 -0
- package/lib/module/modules/button/index.js.map +1 -0
- package/lib/module/modules/button-group/ButtonGroup.js +106 -0
- package/lib/module/modules/button-group/ButtonGroup.js.map +1 -0
- package/lib/module/modules/button-group/ButtonGroup.variants.js +220 -0
- package/lib/module/modules/button-group/ButtonGroup.variants.js.map +1 -0
- package/lib/module/modules/button-group/MODULE.md +129 -0
- package/lib/module/modules/button-group/index.js +11 -0
- package/lib/module/modules/button-group/index.js.map +1 -0
- package/lib/module/modules/card/Card.js +39 -0
- package/lib/module/modules/card/Card.js.map +1 -0
- package/lib/module/modules/card/Card.variants.js +75 -0
- package/lib/module/modules/card/Card.variants.js.map +1 -0
- package/lib/module/modules/card/MODULE.md +81 -0
- package/lib/module/modules/card/index.js +10 -0
- package/lib/module/modules/card/index.js.map +1 -0
- package/lib/module/modules/checkbox/Checkbox.js +115 -0
- package/lib/module/modules/checkbox/Checkbox.js.map +1 -0
- package/lib/module/modules/checkbox/Checkbox.variants.js +122 -0
- package/lib/module/modules/checkbox/Checkbox.variants.js.map +1 -0
- package/lib/module/modules/checkbox/MODULE.md +76 -0
- package/lib/module/modules/checkbox/index.js +11 -0
- package/lib/module/modules/checkbox/index.js.map +1 -0
- package/lib/module/modules/divider/Divider.js +35 -0
- package/lib/module/modules/divider/Divider.js.map +1 -0
- package/lib/module/modules/divider/Divider.variants.js +51 -0
- package/lib/module/modules/divider/Divider.variants.js.map +1 -0
- package/lib/module/modules/divider/MODULE.md +61 -0
- package/lib/module/modules/divider/index.js +10 -0
- package/lib/module/modules/divider/index.js.map +1 -0
- package/lib/module/modules/drawer/Drawer.js +171 -0
- package/lib/module/modules/drawer/Drawer.js.map +1 -0
- package/lib/module/modules/drawer/Drawer.variants.js +118 -0
- package/lib/module/modules/drawer/Drawer.variants.js.map +1 -0
- package/lib/module/modules/drawer/MODULE.md +161 -0
- package/lib/module/modules/drawer/index.js +10 -0
- package/lib/module/modules/drawer/index.js.map +1 -0
- package/lib/module/modules/empty-state/EmptyState.js +79 -0
- package/lib/module/modules/empty-state/EmptyState.js.map +1 -0
- package/lib/module/modules/empty-state/EmptyState.variants.js +54 -0
- package/lib/module/modules/empty-state/EmptyState.variants.js.map +1 -0
- package/lib/module/modules/empty-state/MODULE.md +78 -0
- package/lib/module/modules/empty-state/index.js +13 -0
- package/lib/module/modules/empty-state/index.js.map +1 -0
- package/lib/module/modules/file-upload/FileUpload.js +132 -0
- package/lib/module/modules/file-upload/FileUpload.js.map +1 -0
- package/lib/module/modules/file-upload/FileUpload.variants.js +179 -0
- package/lib/module/modules/file-upload/FileUpload.variants.js.map +1 -0
- package/lib/module/modules/file-upload/MODULE.md +130 -0
- package/lib/module/modules/file-upload/index.js +10 -0
- package/lib/module/modules/file-upload/index.js.map +1 -0
- package/lib/module/modules/filter-sheet/FilterChip.js +79 -0
- package/lib/module/modules/filter-sheet/FilterChip.js.map +1 -0
- package/lib/module/modules/filter-sheet/FilterSheet.js +98 -0
- package/lib/module/modules/filter-sheet/FilterSheet.js.map +1 -0
- package/lib/module/modules/filter-sheet/FilterSheet.variants.js +156 -0
- package/lib/module/modules/filter-sheet/FilterSheet.variants.js.map +1 -0
- package/lib/module/modules/filter-sheet/FilterSheetBody.js +175 -0
- package/lib/module/modules/filter-sheet/FilterSheetBody.js.map +1 -0
- package/lib/module/modules/filter-sheet/MODULE.md +115 -0
- package/lib/module/modules/filter-sheet/filterSheet.helpers.js +90 -0
- package/lib/module/modules/filter-sheet/filterSheet.helpers.js.map +1 -0
- package/lib/module/modules/filter-sheet/index.js +14 -0
- package/lib/module/modules/filter-sheet/index.js.map +1 -0
- package/lib/module/modules/input/Input.js +132 -0
- package/lib/module/modules/input/Input.js.map +1 -0
- package/lib/module/modules/input/Input.variants.js +122 -0
- package/lib/module/modules/input/Input.variants.js.map +1 -0
- package/lib/module/modules/input/MODULE.md +97 -0
- package/lib/module/modules/input/index.js +13 -0
- package/lib/module/modules/input/index.js.map +1 -0
- package/lib/module/modules/menu/MODULE.md +103 -0
- package/lib/module/modules/menu/Menu.js +128 -0
- package/lib/module/modules/menu/Menu.js.map +1 -0
- package/lib/module/modules/menu/Menu.variants.js +75 -0
- package/lib/module/modules/menu/Menu.variants.js.map +1 -0
- package/lib/module/modules/menu/index.js +12 -0
- package/lib/module/modules/menu/index.js.map +1 -0
- package/lib/module/modules/modal/MODULE.md +138 -0
- package/lib/module/modules/modal/Modal.js +101 -0
- package/lib/module/modules/modal/Modal.js.map +1 -0
- package/lib/module/modules/modal/Modal.variants.js +92 -0
- package/lib/module/modules/modal/Modal.variants.js.map +1 -0
- package/lib/module/modules/modal/ModalPortalContext.js +25 -0
- package/lib/module/modules/modal/ModalPortalContext.js.map +1 -0
- package/lib/module/modules/modal/ModalPortalProvider.js +22 -0
- package/lib/module/modules/modal/ModalPortalProvider.js.map +1 -0
- package/lib/module/modules/modal/index.js +16 -0
- package/lib/module/modules/modal/index.js.map +1 -0
- package/lib/module/modules/modal/renderWebPortal.js +18 -0
- package/lib/module/modules/modal/renderWebPortal.js.map +1 -0
- package/lib/module/modules/modal/renderWebPortal.web.js +24 -0
- package/lib/module/modules/modal/renderWebPortal.web.js.map +1 -0
- package/lib/module/modules/multi-select/MODULE.md +100 -0
- package/lib/module/modules/multi-select/MultiSelect.js +204 -0
- package/lib/module/modules/multi-select/MultiSelect.js.map +1 -0
- package/lib/module/modules/multi-select/MultiSelect.variants.js +195 -0
- package/lib/module/modules/multi-select/MultiSelect.variants.js.map +1 -0
- package/lib/module/modules/multi-select/index.js +11 -0
- package/lib/module/modules/multi-select/index.js.map +1 -0
- package/lib/module/modules/number-input/MODULE.md +108 -0
- package/lib/module/modules/number-input/NumberInput.js +253 -0
- package/lib/module/modules/number-input/NumberInput.js.map +1 -0
- package/lib/module/modules/number-input/NumberInput.variants.js +200 -0
- package/lib/module/modules/number-input/NumberInput.variants.js.map +1 -0
- package/lib/module/modules/number-input/index.js +12 -0
- package/lib/module/modules/number-input/index.js.map +1 -0
- package/lib/module/modules/pin-input/MODULE.md +134 -0
- package/lib/module/modules/pin-input/PinInput.js +158 -0
- package/lib/module/modules/pin-input/PinInput.js.map +1 -0
- package/lib/module/modules/pin-input/PinInput.variants.js +183 -0
- package/lib/module/modules/pin-input/PinInput.variants.js.map +1 -0
- package/lib/module/modules/pin-input/index.js +11 -0
- package/lib/module/modules/pin-input/index.js.map +1 -0
- package/lib/module/modules/progress-bar/MODULE.md +101 -0
- package/lib/module/modules/progress-bar/ProgressBar.js +102 -0
- package/lib/module/modules/progress-bar/ProgressBar.js.map +1 -0
- package/lib/module/modules/progress-bar/ProgressBar.variants.js +151 -0
- package/lib/module/modules/progress-bar/ProgressBar.variants.js.map +1 -0
- package/lib/module/modules/progress-bar/index.js +12 -0
- package/lib/module/modules/progress-bar/index.js.map +1 -0
- package/lib/module/modules/radio-group/MODULE.md +75 -0
- package/lib/module/modules/radio-group/RadioGroup.js +87 -0
- package/lib/module/modules/radio-group/RadioGroup.js.map +1 -0
- package/lib/module/modules/radio-group/RadioGroup.variants.js +163 -0
- package/lib/module/modules/radio-group/RadioGroup.variants.js.map +1 -0
- package/lib/module/modules/radio-group/index.js +11 -0
- package/lib/module/modules/radio-group/index.js.map +1 -0
- package/lib/module/modules/reorder/MODULE.md +131 -0
- package/lib/module/modules/reorder/Reorder.js +291 -0
- package/lib/module/modules/reorder/Reorder.js.map +1 -0
- package/lib/module/modules/reorder/Reorder.variants.js +172 -0
- package/lib/module/modules/reorder/Reorder.variants.js.map +1 -0
- package/lib/module/modules/reorder/index.js +11 -0
- package/lib/module/modules/reorder/index.js.map +1 -0
- package/lib/module/modules/select/MODULE.md +91 -0
- package/lib/module/modules/select/Select.js +178 -0
- package/lib/module/modules/select/Select.js.map +1 -0
- package/lib/module/modules/select/Select.variants.js +146 -0
- package/lib/module/modules/select/Select.variants.js.map +1 -0
- package/lib/module/modules/select/index.js +10 -0
- package/lib/module/modules/select/index.js.map +1 -0
- package/lib/module/modules/skeleton/MODULE.md +87 -0
- package/lib/module/modules/skeleton/Skeleton.js +78 -0
- package/lib/module/modules/skeleton/Skeleton.js.map +1 -0
- package/lib/module/modules/skeleton/Skeleton.variants.js +145 -0
- package/lib/module/modules/skeleton/Skeleton.variants.js.map +1 -0
- package/lib/module/modules/skeleton/index.js +10 -0
- package/lib/module/modules/skeleton/index.js.map +1 -0
- package/lib/module/modules/slider/MODULE.md +95 -0
- package/lib/module/modules/slider/Slider.js +183 -0
- package/lib/module/modules/slider/Slider.js.map +1 -0
- package/lib/module/modules/slider/Slider.variants.js +258 -0
- package/lib/module/modules/slider/Slider.variants.js.map +1 -0
- package/lib/module/modules/slider/index.js +10 -0
- package/lib/module/modules/slider/index.js.map +1 -0
- package/lib/module/modules/spinner/MODULE.md +97 -0
- package/lib/module/modules/spinner/Spinner.js +58 -0
- package/lib/module/modules/spinner/Spinner.js.map +1 -0
- package/lib/module/modules/spinner/Spinner.variants.js +131 -0
- package/lib/module/modules/spinner/Spinner.variants.js.map +1 -0
- package/lib/module/modules/spinner/index.js +11 -0
- package/lib/module/modules/spinner/index.js.map +1 -0
- package/lib/module/modules/stepper/MODULE.md +88 -0
- package/lib/module/modules/stepper/Stepper.js +100 -0
- package/lib/module/modules/stepper/Stepper.js.map +1 -0
- package/lib/module/modules/stepper/Stepper.variants.js +146 -0
- package/lib/module/modules/stepper/Stepper.variants.js.map +1 -0
- package/lib/module/modules/stepper/index.js +10 -0
- package/lib/module/modules/stepper/index.js.map +1 -0
- package/lib/module/modules/switch/MODULE.md +65 -0
- package/lib/module/modules/switch/Switch.js +53 -0
- package/lib/module/modules/switch/Switch.js.map +1 -0
- package/lib/module/modules/switch/Switch.variants.js +61 -0
- package/lib/module/modules/switch/Switch.variants.js.map +1 -0
- package/lib/module/modules/switch/index.js +10 -0
- package/lib/module/modules/switch/index.js.map +1 -0
- package/lib/module/modules/tabs/MODULE.md +80 -0
- package/lib/module/modules/tabs/Tabs.js +127 -0
- package/lib/module/modules/tabs/Tabs.js.map +1 -0
- package/lib/module/modules/tabs/Tabs.variants.js +135 -0
- package/lib/module/modules/tabs/Tabs.variants.js.map +1 -0
- package/lib/module/modules/tabs/index.js +12 -0
- package/lib/module/modules/tabs/index.js.map +1 -0
- package/lib/module/modules/textarea/MODULE.md +91 -0
- package/lib/module/modules/textarea/Textarea.js +136 -0
- package/lib/module/modules/textarea/Textarea.js.map +1 -0
- package/lib/module/modules/textarea/Textarea.variants.js +113 -0
- package/lib/module/modules/textarea/Textarea.variants.js.map +1 -0
- package/lib/module/modules/textarea/index.js +10 -0
- package/lib/module/modules/textarea/index.js.map +1 -0
- package/lib/module/modules/timeline/MODULE.md +95 -0
- package/lib/module/modules/timeline/Timeline.js +92 -0
- package/lib/module/modules/timeline/Timeline.js.map +1 -0
- package/lib/module/modules/timeline/Timeline.variants.js +146 -0
- package/lib/module/modules/timeline/Timeline.variants.js.map +1 -0
- package/lib/module/modules/timeline/index.js +12 -0
- package/lib/module/modules/timeline/index.js.map +1 -0
- package/lib/module/modules/toast/MODULE.md +104 -0
- package/lib/module/modules/toast/Toast.js +178 -0
- package/lib/module/modules/toast/Toast.js.map +1 -0
- package/lib/module/modules/toast/Toast.variants.js +120 -0
- package/lib/module/modules/toast/Toast.variants.js.map +1 -0
- package/lib/module/modules/toast/index.js +13 -0
- package/lib/module/modules/toast/index.js.map +1 -0
- package/lib/module/modules/tooltip/MODULE.md +86 -0
- package/lib/module/modules/tooltip/Tooltip.js +115 -0
- package/lib/module/modules/tooltip/Tooltip.js.map +1 -0
- package/lib/module/modules/tooltip/Tooltip.variants.js +75 -0
- package/lib/module/modules/tooltip/Tooltip.variants.js.map +1 -0
- package/lib/module/modules/tooltip/index.js +10 -0
- package/lib/module/modules/tooltip/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/theme/MODULE.md +87 -0
- package/lib/module/theme/index.js +15 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/platform/MODULE.md +102 -0
- package/lib/module/theme/platform/colorScheme.native.js +24 -0
- package/lib/module/theme/platform/colorScheme.native.js.map +1 -0
- package/lib/module/theme/platform/elevation.native.js +75 -0
- package/lib/module/theme/platform/elevation.native.js.map +1 -0
- package/lib/module/theme/platform/fonts.native.js +58 -0
- package/lib/module/theme/platform/fonts.native.js.map +1 -0
- package/lib/module/theme/platform/index.js +14 -0
- package/lib/module/theme/platform/index.js.map +1 -0
- package/lib/module/theme/platform/units.native.js +18 -0
- package/lib/module/theme/platform/units.native.js.map +1 -0
- package/lib/module/theme/provider/PixelizeProvider.js +149 -0
- package/lib/module/theme/provider/PixelizeProvider.js.map +1 -0
- package/lib/module/theme/provider/colorModeStorage.js +63 -0
- package/lib/module/theme/provider/colorModeStorage.js.map +1 -0
- package/lib/module/theme/provider/index.js +8 -0
- package/lib/module/theme/provider/index.js.map +1 -0
- package/lib/module/theme/provider/useTheme.js +13 -0
- package/lib/module/theme/provider/useTheme.js.map +1 -0
- package/lib/module/theme/provider/useThemeColors.js +13 -0
- package/lib/module/theme/provider/useThemeColors.js.map +1 -0
- package/lib/module/theme/provider/useThemeMode.js +13 -0
- package/lib/module/theme/provider/useThemeMode.js.map +1 -0
- package/lib/module/theme/tokens/MODULE.md +102 -0
- package/lib/module/theme/tokens/brands/emerald/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/emerald/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/emerald/palette.light.js +125 -0
- package/lib/module/theme/tokens/brands/emerald/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/index.js +91 -0
- package/lib/module/theme/tokens/brands/index.js.map +1 -0
- package/lib/module/theme/tokens/brands/lavender/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/lavender/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/lavender/palette.light.js +376 -0
- package/lib/module/theme/tokens/brands/lavender/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/meadow/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/meadow/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/meadow/palette.light.js +126 -0
- package/lib/module/theme/tokens/brands/meadow/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/radiant/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/radiant/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/radiant/palette.light.js +125 -0
- package/lib/module/theme/tokens/brands/radiant/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/rosewood/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/rosewood/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js +125 -0
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/skyline/palette.dark.js +9 -0
- package/lib/module/theme/tokens/brands/skyline/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/skyline/palette.light.js +126 -0
- package/lib/module/theme/tokens/brands/skyline/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/slate/palette.dark.js +11 -0
- package/lib/module/theme/tokens/brands/slate/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/slate/palette.light.js +129 -0
- package/lib/module/theme/tokens/brands/slate/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/storefront/palette.dark.js +7 -0
- package/lib/module/theme/tokens/brands/storefront/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/storefront/palette.light.js +127 -0
- package/lib/module/theme/tokens/brands/storefront/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/brands/zinc/palette.dark.js +222 -0
- package/lib/module/theme/tokens/brands/zinc/palette.dark.js.map +1 -0
- package/lib/module/theme/tokens/brands/zinc/palette.light.js +393 -0
- package/lib/module/theme/tokens/brands/zinc/palette.light.js.map +1 -0
- package/lib/module/theme/tokens/builders/accentText.js +66 -0
- package/lib/module/theme/tokens/builders/accentText.js.map +1 -0
- package/lib/module/theme/tokens/builders/buildBrandTokens.js +38 -0
- package/lib/module/theme/tokens/builders/buildBrandTokens.js.map +1 -0
- package/lib/module/theme/tokens/builders/buildDarkPalette.js +300 -0
- package/lib/module/theme/tokens/builders/buildDarkPalette.js.map +1 -0
- package/lib/module/theme/tokens/builders/color.js +187 -0
- package/lib/module/theme/tokens/builders/color.js.map +1 -0
- package/lib/module/theme/tokens/index.js +27 -0
- package/lib/module/theme/tokens/index.js.map +1 -0
- package/lib/module/theme/tokens/primitives/borderWidths.js +16 -0
- package/lib/module/theme/tokens/primitives/borderWidths.js.map +1 -0
- package/lib/module/theme/tokens/primitives/breakpoints.js +18 -0
- package/lib/module/theme/tokens/primitives/breakpoints.js.map +1 -0
- package/lib/module/theme/tokens/primitives/elevation.js +95 -0
- package/lib/module/theme/tokens/primitives/elevation.js.map +1 -0
- package/lib/module/theme/tokens/primitives/fontSizes.js +22 -0
- package/lib/module/theme/tokens/primitives/fontSizes.js.map +1 -0
- package/lib/module/theme/tokens/primitives/fontWeights.js +23 -0
- package/lib/module/theme/tokens/primitives/fontWeights.js.map +1 -0
- package/lib/module/theme/tokens/primitives/index.js +14 -0
- package/lib/module/theme/tokens/primitives/index.js.map +1 -0
- package/lib/module/theme/tokens/primitives/letterSpacings.js +18 -0
- package/lib/module/theme/tokens/primitives/letterSpacings.js.map +1 -0
- package/lib/module/theme/tokens/primitives/lineHeights.js +21 -0
- package/lib/module/theme/tokens/primitives/lineHeights.js.map +1 -0
- package/lib/module/theme/tokens/primitives/radii.js +21 -0
- package/lib/module/theme/tokens/primitives/radii.js.map +1 -0
- package/lib/module/theme/tokens/primitives/sizes.js +34 -0
- package/lib/module/theme/tokens/primitives/sizes.js.map +1 -0
- package/lib/module/theme/tokens/primitives/space.js +30 -0
- package/lib/module/theme/tokens/primitives/space.js.map +1 -0
- package/lib/module/theme/tokens/primitives/zIndices.js +23 -0
- package/lib/module/theme/tokens/primitives/zIndices.js.map +1 -0
- package/lib/module/theme/tokens/roles/index.js +126 -0
- package/lib/module/theme/tokens/roles/index.js.map +1 -0
- package/lib/module/theme/tokens/types.js +2 -0
- package/lib/module/theme/tokens/types.js.map +1 -0
- package/lib/typescript/core/a11y/index.d.ts +7 -0
- package/lib/typescript/core/a11y/index.d.ts.map +1 -0
- package/lib/typescript/core/icon/index.d.ts +60 -0
- package/lib/typescript/core/icon/index.d.ts.map +1 -0
- package/lib/typescript/core/style/index.d.ts +4 -0
- package/lib/typescript/core/style/index.d.ts.map +1 -0
- package/lib/typescript/core/style/layoutStyle.d.ts +19 -0
- package/lib/typescript/core/style/layoutStyle.d.ts.map +1 -0
- package/lib/typescript/core/style/variants.d.ts +55 -0
- package/lib/typescript/core/style/variants.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +11 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/modules/accordion/Accordion.d.ts +57 -0
- package/lib/typescript/modules/accordion/Accordion.d.ts.map +1 -0
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts +131 -0
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts.map +1 -0
- package/lib/typescript/modules/accordion/index.d.ts +9 -0
- package/lib/typescript/modules/accordion/index.d.ts.map +1 -0
- package/lib/typescript/modules/alert-dialog/AlertDialog.d.ts +24 -0
- package/lib/typescript/modules/alert-dialog/AlertDialog.d.ts.map +1 -0
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts +29 -0
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts.map +1 -0
- package/lib/typescript/modules/alert-dialog/index.d.ts +9 -0
- package/lib/typescript/modules/alert-dialog/index.d.ts.map +1 -0
- package/lib/typescript/modules/avatar/Avatar.d.ts +30 -0
- package/lib/typescript/modules/avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts +123 -0
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts.map +1 -0
- package/lib/typescript/modules/avatar/index.d.ts +11 -0
- package/lib/typescript/modules/avatar/index.d.ts.map +1 -0
- package/lib/typescript/modules/badge/Badge.d.ts +19 -0
- package/lib/typescript/modules/badge/Badge.d.ts.map +1 -0
- package/lib/typescript/modules/badge/Badge.variants.d.ts +102 -0
- package/lib/typescript/modules/badge/Badge.variants.d.ts.map +1 -0
- package/lib/typescript/modules/badge/index.d.ts +10 -0
- package/lib/typescript/modules/badge/index.d.ts.map +1 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.d.ts +106 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.d.ts.map +1 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.search.d.ts +61 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.search.d.ts.map +1 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts +122 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts.map +1 -0
- package/lib/typescript/modules/bottom-nav/BottomNavOverflowSheet.d.ts +39 -0
- package/lib/typescript/modules/bottom-nav/BottomNavOverflowSheet.d.ts.map +1 -0
- package/lib/typescript/modules/bottom-nav/index.d.ts +12 -0
- package/lib/typescript/modules/bottom-nav/index.d.ts.map +1 -0
- package/lib/typescript/modules/button/Button.d.ts +43 -0
- package/lib/typescript/modules/button/Button.d.ts.map +1 -0
- package/lib/typescript/modules/button/Button.variants.d.ts +156 -0
- package/lib/typescript/modules/button/Button.variants.d.ts.map +1 -0
- package/lib/typescript/modules/button/index.d.ts +10 -0
- package/lib/typescript/modules/button/index.d.ts.map +1 -0
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts +37 -0
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts.map +1 -0
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts +217 -0
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts.map +1 -0
- package/lib/typescript/modules/button-group/index.d.ts +10 -0
- package/lib/typescript/modules/button-group/index.d.ts.map +1 -0
- package/lib/typescript/modules/card/Card.d.ts +20 -0
- package/lib/typescript/modules/card/Card.d.ts.map +1 -0
- package/lib/typescript/modules/card/Card.variants.d.ts +51 -0
- package/lib/typescript/modules/card/Card.variants.d.ts.map +1 -0
- package/lib/typescript/modules/card/index.d.ts +9 -0
- package/lib/typescript/modules/card/index.d.ts.map +1 -0
- package/lib/typescript/modules/checkbox/Checkbox.d.ts +43 -0
- package/lib/typescript/modules/checkbox/Checkbox.d.ts.map +1 -0
- package/lib/typescript/modules/checkbox/Checkbox.variants.d.ts +120 -0
- package/lib/typescript/modules/checkbox/Checkbox.variants.d.ts.map +1 -0
- package/lib/typescript/modules/checkbox/index.d.ts +10 -0
- package/lib/typescript/modules/checkbox/index.d.ts.map +1 -0
- package/lib/typescript/modules/divider/Divider.d.ts +18 -0
- package/lib/typescript/modules/divider/Divider.d.ts.map +1 -0
- package/lib/typescript/modules/divider/Divider.variants.d.ts +42 -0
- package/lib/typescript/modules/divider/Divider.variants.d.ts.map +1 -0
- package/lib/typescript/modules/divider/index.d.ts +9 -0
- package/lib/typescript/modules/divider/index.d.ts.map +1 -0
- package/lib/typescript/modules/drawer/Drawer.d.ts +44 -0
- package/lib/typescript/modules/drawer/Drawer.d.ts.map +1 -0
- package/lib/typescript/modules/drawer/Drawer.variants.d.ts +80 -0
- package/lib/typescript/modules/drawer/Drawer.variants.d.ts.map +1 -0
- package/lib/typescript/modules/drawer/index.d.ts +8 -0
- package/lib/typescript/modules/drawer/index.d.ts.map +1 -0
- package/lib/typescript/modules/empty-state/EmptyState.d.ts +29 -0
- package/lib/typescript/modules/empty-state/EmptyState.d.ts.map +1 -0
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts +43 -0
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts.map +1 -0
- package/lib/typescript/modules/empty-state/index.d.ts +10 -0
- package/lib/typescript/modules/empty-state/index.d.ts.map +1 -0
- package/lib/typescript/modules/file-upload/FileUpload.d.ts +44 -0
- package/lib/typescript/modules/file-upload/FileUpload.d.ts.map +1 -0
- package/lib/typescript/modules/file-upload/FileUpload.variants.d.ts +114 -0
- package/lib/typescript/modules/file-upload/FileUpload.variants.d.ts.map +1 -0
- package/lib/typescript/modules/file-upload/index.d.ts +9 -0
- package/lib/typescript/modules/file-upload/index.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/FilterChip.d.ts +25 -0
- package/lib/typescript/modules/filter-sheet/FilterChip.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/FilterSheet.d.ts +54 -0
- package/lib/typescript/modules/filter-sheet/FilterSheet.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/FilterSheet.variants.d.ts +98 -0
- package/lib/typescript/modules/filter-sheet/FilterSheet.variants.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/FilterSheetBody.d.ts +28 -0
- package/lib/typescript/modules/filter-sheet/FilterSheetBody.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/filterSheet.helpers.d.ts +45 -0
- package/lib/typescript/modules/filter-sheet/filterSheet.helpers.d.ts.map +1 -0
- package/lib/typescript/modules/filter-sheet/index.d.ts +12 -0
- package/lib/typescript/modules/filter-sheet/index.d.ts.map +1 -0
- package/lib/typescript/modules/input/Input.d.ts +33 -0
- package/lib/typescript/modules/input/Input.d.ts.map +1 -0
- package/lib/typescript/modules/input/Input.variants.d.ts +116 -0
- package/lib/typescript/modules/input/Input.variants.d.ts.map +1 -0
- package/lib/typescript/modules/input/index.d.ts +10 -0
- package/lib/typescript/modules/input/index.d.ts.map +1 -0
- package/lib/typescript/modules/menu/Menu.d.ts +43 -0
- package/lib/typescript/modules/menu/Menu.d.ts.map +1 -0
- package/lib/typescript/modules/menu/Menu.variants.d.ts +41 -0
- package/lib/typescript/modules/menu/Menu.variants.d.ts.map +1 -0
- package/lib/typescript/modules/menu/index.d.ts +10 -0
- package/lib/typescript/modules/menu/index.d.ts.map +1 -0
- package/lib/typescript/modules/modal/Modal.d.ts +32 -0
- package/lib/typescript/modules/modal/Modal.d.ts.map +1 -0
- package/lib/typescript/modules/modal/Modal.variants.d.ts +72 -0
- package/lib/typescript/modules/modal/Modal.variants.d.ts.map +1 -0
- package/lib/typescript/modules/modal/ModalPortalContext.d.ts +2 -0
- package/lib/typescript/modules/modal/ModalPortalContext.d.ts.map +1 -0
- package/lib/typescript/modules/modal/ModalPortalProvider.d.ts +21 -0
- package/lib/typescript/modules/modal/ModalPortalProvider.d.ts.map +1 -0
- package/lib/typescript/modules/modal/index.d.ts +16 -0
- package/lib/typescript/modules/modal/index.d.ts.map +1 -0
- package/lib/typescript/modules/modal/renderWebPortal.d.ts +15 -0
- package/lib/typescript/modules/modal/renderWebPortal.d.ts.map +1 -0
- package/lib/typescript/modules/modal/renderWebPortal.web.d.ts +19 -0
- package/lib/typescript/modules/modal/renderWebPortal.web.d.ts.map +1 -0
- package/lib/typescript/modules/multi-select/MultiSelect.d.ts +33 -0
- package/lib/typescript/modules/multi-select/MultiSelect.d.ts.map +1 -0
- package/lib/typescript/modules/multi-select/MultiSelect.variants.d.ts +149 -0
- package/lib/typescript/modules/multi-select/MultiSelect.variants.d.ts.map +1 -0
- package/lib/typescript/modules/multi-select/index.d.ts +10 -0
- package/lib/typescript/modules/multi-select/index.d.ts.map +1 -0
- package/lib/typescript/modules/number-input/NumberInput.d.ts +34 -0
- package/lib/typescript/modules/number-input/NumberInput.d.ts.map +1 -0
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts +170 -0
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts.map +1 -0
- package/lib/typescript/modules/number-input/index.d.ts +11 -0
- package/lib/typescript/modules/number-input/index.d.ts.map +1 -0
- package/lib/typescript/modules/pin-input/PinInput.d.ts +40 -0
- package/lib/typescript/modules/pin-input/PinInput.d.ts.map +1 -0
- package/lib/typescript/modules/pin-input/PinInput.variants.d.ts +164 -0
- package/lib/typescript/modules/pin-input/PinInput.variants.d.ts.map +1 -0
- package/lib/typescript/modules/pin-input/index.d.ts +10 -0
- package/lib/typescript/modules/pin-input/index.d.ts.map +1 -0
- package/lib/typescript/modules/progress-bar/ProgressBar.d.ts +21 -0
- package/lib/typescript/modules/progress-bar/ProgressBar.d.ts.map +1 -0
- package/lib/typescript/modules/progress-bar/ProgressBar.variants.d.ts +112 -0
- package/lib/typescript/modules/progress-bar/ProgressBar.variants.d.ts.map +1 -0
- package/lib/typescript/modules/progress-bar/index.d.ts +11 -0
- package/lib/typescript/modules/progress-bar/index.d.ts.map +1 -0
- package/lib/typescript/modules/radio-group/RadioGroup.d.ts +27 -0
- package/lib/typescript/modules/radio-group/RadioGroup.d.ts.map +1 -0
- package/lib/typescript/modules/radio-group/RadioGroup.variants.d.ts +142 -0
- package/lib/typescript/modules/radio-group/RadioGroup.variants.d.ts.map +1 -0
- package/lib/typescript/modules/radio-group/index.d.ts +10 -0
- package/lib/typescript/modules/radio-group/index.d.ts.map +1 -0
- package/lib/typescript/modules/reorder/Reorder.d.ts +43 -0
- package/lib/typescript/modules/reorder/Reorder.d.ts.map +1 -0
- package/lib/typescript/modules/reorder/Reorder.variants.d.ts +116 -0
- package/lib/typescript/modules/reorder/Reorder.variants.d.ts.map +1 -0
- package/lib/typescript/modules/reorder/index.d.ts +9 -0
- package/lib/typescript/modules/reorder/index.d.ts.map +1 -0
- package/lib/typescript/modules/select/Select.d.ts +31 -0
- package/lib/typescript/modules/select/Select.d.ts.map +1 -0
- package/lib/typescript/modules/select/Select.variants.d.ts +127 -0
- package/lib/typescript/modules/select/Select.variants.d.ts.map +1 -0
- package/lib/typescript/modules/select/index.d.ts +9 -0
- package/lib/typescript/modules/select/index.d.ts.map +1 -0
- package/lib/typescript/modules/skeleton/Skeleton.d.ts +27 -0
- package/lib/typescript/modules/skeleton/Skeleton.d.ts.map +1 -0
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts +119 -0
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts.map +1 -0
- package/lib/typescript/modules/skeleton/index.d.ts +9 -0
- package/lib/typescript/modules/skeleton/index.d.ts.map +1 -0
- package/lib/typescript/modules/slider/Slider.d.ts +44 -0
- package/lib/typescript/modules/slider/Slider.d.ts.map +1 -0
- package/lib/typescript/modules/slider/Slider.variants.d.ts +211 -0
- package/lib/typescript/modules/slider/Slider.variants.d.ts.map +1 -0
- package/lib/typescript/modules/slider/index.d.ts +9 -0
- package/lib/typescript/modules/slider/index.d.ts.map +1 -0
- package/lib/typescript/modules/spinner/Spinner.d.ts +19 -0
- package/lib/typescript/modules/spinner/Spinner.d.ts.map +1 -0
- package/lib/typescript/modules/spinner/Spinner.variants.d.ts +113 -0
- package/lib/typescript/modules/spinner/Spinner.variants.d.ts.map +1 -0
- package/lib/typescript/modules/spinner/index.d.ts +10 -0
- package/lib/typescript/modules/spinner/index.d.ts.map +1 -0
- package/lib/typescript/modules/stepper/Stepper.d.ts +26 -0
- package/lib/typescript/modules/stepper/Stepper.d.ts.map +1 -0
- package/lib/typescript/modules/stepper/Stepper.variants.d.ts +107 -0
- package/lib/typescript/modules/stepper/Stepper.variants.d.ts.map +1 -0
- package/lib/typescript/modules/stepper/index.d.ts +8 -0
- package/lib/typescript/modules/stepper/index.d.ts.map +1 -0
- package/lib/typescript/modules/switch/Switch.d.ts +22 -0
- package/lib/typescript/modules/switch/Switch.d.ts.map +1 -0
- package/lib/typescript/modules/switch/Switch.variants.d.ts +60 -0
- package/lib/typescript/modules/switch/Switch.variants.d.ts.map +1 -0
- package/lib/typescript/modules/switch/index.d.ts +8 -0
- package/lib/typescript/modules/switch/index.d.ts.map +1 -0
- package/lib/typescript/modules/tabs/Tabs.d.ts +31 -0
- package/lib/typescript/modules/tabs/Tabs.d.ts.map +1 -0
- package/lib/typescript/modules/tabs/Tabs.variants.d.ts +114 -0
- package/lib/typescript/modules/tabs/Tabs.variants.d.ts.map +1 -0
- package/lib/typescript/modules/tabs/index.d.ts +10 -0
- package/lib/typescript/modules/tabs/index.d.ts.map +1 -0
- package/lib/typescript/modules/textarea/Textarea.d.ts +25 -0
- package/lib/typescript/modules/textarea/Textarea.d.ts.map +1 -0
- package/lib/typescript/modules/textarea/Textarea.variants.d.ts +99 -0
- package/lib/typescript/modules/textarea/Textarea.variants.d.ts.map +1 -0
- package/lib/typescript/modules/textarea/index.d.ts +9 -0
- package/lib/typescript/modules/textarea/index.d.ts.map +1 -0
- package/lib/typescript/modules/timeline/Timeline.d.ts +28 -0
- package/lib/typescript/modules/timeline/Timeline.d.ts.map +1 -0
- package/lib/typescript/modules/timeline/Timeline.variants.d.ts +103 -0
- package/lib/typescript/modules/timeline/Timeline.variants.d.ts.map +1 -0
- package/lib/typescript/modules/timeline/index.d.ts +9 -0
- package/lib/typescript/modules/timeline/index.d.ts.map +1 -0
- package/lib/typescript/modules/toast/Toast.d.ts +38 -0
- package/lib/typescript/modules/toast/Toast.d.ts.map +1 -0
- package/lib/typescript/modules/toast/Toast.variants.d.ts +80 -0
- package/lib/typescript/modules/toast/Toast.variants.d.ts.map +1 -0
- package/lib/typescript/modules/toast/index.d.ts +12 -0
- package/lib/typescript/modules/toast/index.d.ts.map +1 -0
- package/lib/typescript/modules/tooltip/Tooltip.d.ts +31 -0
- package/lib/typescript/modules/tooltip/Tooltip.d.ts.map +1 -0
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts +52 -0
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts.map +1 -0
- package/lib/typescript/modules/tooltip/index.d.ts +9 -0
- package/lib/typescript/modules/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/theme/index.d.ts +11 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/platform/colorScheme.native.d.ts +12 -0
- package/lib/typescript/theme/platform/colorScheme.native.d.ts.map +1 -0
- package/lib/typescript/theme/platform/elevation.native.d.ts +35 -0
- package/lib/typescript/theme/platform/elevation.native.d.ts.map +1 -0
- package/lib/typescript/theme/platform/fonts.native.d.ts +41 -0
- package/lib/typescript/theme/platform/fonts.native.d.ts.map +1 -0
- package/lib/typescript/theme/platform/index.d.ts +15 -0
- package/lib/typescript/theme/platform/index.d.ts.map +1 -0
- package/lib/typescript/theme/platform/units.native.d.ts +13 -0
- package/lib/typescript/theme/platform/units.native.d.ts.map +1 -0
- package/lib/typescript/theme/provider/PixelizeProvider.d.ts +81 -0
- package/lib/typescript/theme/provider/PixelizeProvider.d.ts.map +1 -0
- package/lib/typescript/theme/provider/colorModeStorage.d.ts +43 -0
- package/lib/typescript/theme/provider/colorModeStorage.d.ts.map +1 -0
- package/lib/typescript/theme/provider/index.d.ts +8 -0
- package/lib/typescript/theme/provider/index.d.ts.map +1 -0
- package/lib/typescript/theme/provider/useTheme.d.ts +4 -0
- package/lib/typescript/theme/provider/useTheme.d.ts.map +1 -0
- package/lib/typescript/theme/provider/useThemeColors.d.ts +9 -0
- package/lib/typescript/theme/provider/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/theme/provider/useThemeMode.d.ts +4 -0
- package/lib/typescript/theme/provider/useThemeMode.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/index.d.ts +30 -0
- package/lib/typescript/theme/tokens/brands/index.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/lavender/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/lavender/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/lavender/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/lavender/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/meadow/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/meadow/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/meadow/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/meadow/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/radiant/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/radiant/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/radiant/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/radiant/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/rosewood/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/rosewood/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/rosewood/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/rosewood/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/skyline/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/skyline/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/skyline/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/skyline/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/slate/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/slate/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/slate/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/slate/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/storefront/palette.dark.d.ts +3 -0
- package/lib/typescript/theme/tokens/brands/storefront/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/storefront/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/storefront/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/zinc/palette.dark.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/zinc/palette.dark.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/brands/zinc/palette.light.d.ts +4 -0
- package/lib/typescript/theme/tokens/brands/zinc/palette.light.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/builders/accentText.d.ts +42 -0
- package/lib/typescript/theme/tokens/builders/accentText.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/builders/buildBrandTokens.d.ts +21 -0
- package/lib/typescript/theme/tokens/builders/buildBrandTokens.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/builders/buildDarkPalette.d.ts +13 -0
- package/lib/typescript/theme/tokens/builders/buildDarkPalette.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/builders/color.d.ts +59 -0
- package/lib/typescript/theme/tokens/builders/color.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/index.d.ts +21 -0
- package/lib/typescript/theme/tokens/index.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/borderWidths.d.ts +15 -0
- package/lib/typescript/theme/tokens/primitives/borderWidths.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/breakpoints.d.ts +17 -0
- package/lib/typescript/theme/tokens/primitives/breakpoints.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/elevation.d.ts +109 -0
- package/lib/typescript/theme/tokens/primitives/elevation.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/fontSizes.d.ts +21 -0
- package/lib/typescript/theme/tokens/primitives/fontSizes.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/fontWeights.d.ts +21 -0
- package/lib/typescript/theme/tokens/primitives/fontWeights.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/index.d.ts +23 -0
- package/lib/typescript/theme/tokens/primitives/index.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/letterSpacings.d.ts +17 -0
- package/lib/typescript/theme/tokens/primitives/letterSpacings.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/lineHeights.d.ts +20 -0
- package/lib/typescript/theme/tokens/primitives/lineHeights.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/radii.d.ts +20 -0
- package/lib/typescript/theme/tokens/primitives/radii.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/sizes.d.ts +33 -0
- package/lib/typescript/theme/tokens/primitives/sizes.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/space.d.ts +29 -0
- package/lib/typescript/theme/tokens/primitives/space.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/primitives/zIndices.d.ts +22 -0
- package/lib/typescript/theme/tokens/primitives/zIndices.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/roles/index.d.ts +68 -0
- package/lib/typescript/theme/tokens/roles/index.d.ts.map +1 -0
- package/lib/typescript/theme/tokens/types.d.ts +103 -0
- package/lib/typescript/theme/tokens/types.d.ts.map +1 -0
- package/package.json +259 -0
- package/registry.json +175 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# theme
|
|
2
|
+
|
|
3
|
+
The runtime theme layer: the provider that resolves a (brand, mode) into concrete values, and the
|
|
4
|
+
hooks components read. It sits on top of three siblings — `tokens/` (the copy-paste zone),
|
|
5
|
+
`tokens/roles/` (`roleColors`), and `platform/` (native-only rendering).
|
|
6
|
+
|
|
7
|
+
**`provider/` is NOT the copy-paste zone.** It imports from `react`, `react-native` (via `platform/`),
|
|
8
|
+
and holds React state — none of which may appear in `tokens/`. It mirrors web's `Theme/provider/`
|
|
9
|
+
in *shape and export names* (`PixelizeProvider`, `useThemeMode`), not byte-for-byte.
|
|
10
|
+
|
|
11
|
+
## Public surface (`pixelize-native-library/theme`)
|
|
12
|
+
|
|
13
|
+
| Export | Kind | Purpose |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `PixelizeProvider` | component | Wrap the app root once. |
|
|
16
|
+
| `useTheme()` | hook | Full resolved `Theme` (colours + scale + rendered elevation/fonts). |
|
|
17
|
+
| `useThemeColors()` | hook | `RoleColors` — resolved value strings. **The RN escape hatch.** |
|
|
18
|
+
| `useThemeMode()` | hook | `{ mode, resolvedMode, setMode, brand, setBrand }` for a switcher. |
|
|
19
|
+
| `createAsyncStorageAdapter(AsyncStorage)` | fn | Wrap the app's AsyncStorage into the storage adapter. |
|
|
20
|
+
| `themeNames`, `DEFAULT_THEME` | data | Brand catalogue for a picker (9 brands — roster + how to add one: `tokens/MODULE.md`). |
|
|
21
|
+
| `Theme`, `ThemeMode`, `ThemeModeValue`, `PixelizeProviderProps`, `RoleColors`, `ThemeName`, `ColorScheme`, `ColorModeStorageAdapter` | types | Annotation. |
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
25
|
+
import { PixelizeProvider, createAsyncStorageAdapter } from 'pixelize-native-library/theme';
|
|
26
|
+
|
|
27
|
+
<PixelizeProvider brand="zinc" mode="system" storage={createAsyncStorageAdapter(AsyncStorage)}>
|
|
28
|
+
<App />
|
|
29
|
+
</PixelizeProvider>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Props
|
|
33
|
+
|
|
34
|
+
- `brand?` — INITIAL brand; a persisted user choice wins over it. Default `zinc`. Still tracks a
|
|
35
|
+
changing prop value the same as before **until** `setBrand` is called once — after that the
|
|
36
|
+
provider owns it, matching `mode`'s "explicit choice wins" rule (kept for the pre-existing
|
|
37
|
+
fully-controlled-prop call sites; new code should prefer `setBrand`).
|
|
38
|
+
- `mode?` — INITIAL mode; a persisted user choice wins over it. Default `system`.
|
|
39
|
+
- `storage?` — persistence adapter; absent → in-memory + a dev warning (see below). Shared by both
|
|
40
|
+
`mode` and `brand`, under separate keys (`storageKey` / `brandStorageKey`).
|
|
41
|
+
- `interLoaded?` — has the app registered Inter (`useFonts`)? Default `false` → system font, which
|
|
42
|
+
always renders. Pass `interLoaded={fontsLoaded}` so `theme.fontStyleForWeight` uses Inter faces.
|
|
43
|
+
|
|
44
|
+
## Key behaviours
|
|
45
|
+
|
|
46
|
+
### `system` is the default and reacts live
|
|
47
|
+
`resolvedMode` derives from the OS via `platform/subscribeToSystemColorMode`, so a sunrise/sunset or
|
|
48
|
+
`Appearance.setColorScheme()` flips a `system` app immediately. A pinned `light`/`dark` ignores it.
|
|
49
|
+
|
|
50
|
+
### Persistence is optional, and degrades — never crashes
|
|
51
|
+
AsyncStorage is an optional peer this library never imports; the consumer passes their instance to
|
|
52
|
+
`createAsyncStorageAdapter`. With no adapter, mode and brand are each kept in a process-lifetime
|
|
53
|
+
memory map (survives a remount, not a cold restart) and a one-time dev `console.warn` explains how
|
|
54
|
+
to persist. The mount rehydrate is async and guarded per field (separate `userTouched` refs for
|
|
55
|
+
mode and brand): a late read never clobbers a choice the user already made, because `setMode`/
|
|
56
|
+
`setBrand` write on the action itself rather than in an effect.
|
|
57
|
+
|
|
58
|
+
### `useThemeColors()` — the escape hatch that matters on RN
|
|
59
|
+
Returns `RoleColors` as plain strings. `placeholderTextColor`, `android_ripple`, SVG `fill`, React
|
|
60
|
+
Navigation chrome and the splash background accept no token object and no style prop — they need a
|
|
61
|
+
resolved value. One source for every colour site is what deletes an app's `navColors.ts` and makes
|
|
62
|
+
its whole icon/chrome surface adapt to dark mode.
|
|
63
|
+
|
|
64
|
+
### Why two contexts
|
|
65
|
+
`ThemeContext` (heavy resolved `Theme`) is split from `ThemeModeContext` (the small mode triple).
|
|
66
|
+
Both provider values are memoised on their real inputs, so a mode flip recomputes the theme **once**
|
|
67
|
+
and re-renders each consumer once, and an OS change while the mode is pinned re-renders **nobody**
|
|
68
|
+
(both values stay reference-stable). A `useThemeMode()` reader is never invalidated by unrelated
|
|
69
|
+
theme-object churn, nor a `useTheme()` reader by mode-control churn.
|
|
70
|
+
|
|
71
|
+
### Elevation is rendered once
|
|
72
|
+
Elevation tokens carry no colour-mode variation, so the five levels are rendered to RN shadow props
|
|
73
|
+
at module load and shared by every theme (`theme.elevation.md`), not recomputed per brand/mode.
|
|
74
|
+
Rendering is platform-specific (`ios` / `web` / `default` for Android) — see
|
|
75
|
+
`src/theme/platform/MODULE.md` for the shape of each branch and why `web` needs its own case.
|
|
76
|
+
|
|
77
|
+
## Known gaps
|
|
78
|
+
- `useThemeMode()` exposes no `toggle`; a switcher does `setMode(resolvedMode === 'dark' ? 'light' : 'dark')`.
|
|
79
|
+
|
|
80
|
+
**2026-07-18 — brand now persists, matching web.** Web's `PixelizeThemeProvider` always persisted
|
|
81
|
+
both `mode` and `brand`; this provider only persisted `mode`, so a mobile brand switcher lost its
|
|
82
|
+
choice on every cold restart. Added `setBrand`/`brand` to `useThemeMode()`'s return value and a
|
|
83
|
+
second persisted-state slot (`brandStorageKey`, default `pixelize-native-library.brand`) alongside
|
|
84
|
+
mode's — same adapter, separate key, so a plain-string storage slot never has to encode two values.
|
|
85
|
+
Brand's existing fully-controlled-prop behavior (reactive to a changing `brand` prop, tested since
|
|
86
|
+
before persistence existed) is preserved on top rather than replaced — see the `brand?` prop note
|
|
87
|
+
above.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The `pixelize-native-library/theme` public surface — the provider, the three hooks, and the theme-side
|
|
5
|
+
* types a consumer annotates with. Design tokens themselves ship under `pixelize-native-library/tokens`;
|
|
6
|
+
* this subpath is intentionally the small, runtime-facing layer an app wires once at its root.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { PixelizeProvider, useTheme, useThemeColors, useThemeMode, createAsyncStorageAdapter } from "./provider/index.js";
|
|
10
|
+
|
|
11
|
+
// Resolved-colour types, for annotating a value pulled from `useThemeColors()`.
|
|
12
|
+
|
|
13
|
+
// The brand catalogue, for building a theme picker.
|
|
14
|
+
export { themeNames, DEFAULT_THEME } from "./tokens/brands/index.js";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PixelizeProvider","useTheme","useThemeColors","useThemeMode","createAsyncStorageAdapter","themeNames","DEFAULT_THEME"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA,SACEA,gBAAgB,EAChBC,QAAQ,EACRC,cAAc,EACdC,YAAY,EACZC,yBAAyB,QACpB,qBAAY;;AAUnB;;AAIA;AACA,SAASC,UAAU,EAAEC,aAAa,QAAQ,0BAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# theme/platform
|
|
2
|
+
|
|
3
|
+
Native implementations of everything the theme needs that a token file cannot hold — units,
|
|
4
|
+
shadows, font faces, and the system colour scheme.
|
|
5
|
+
|
|
6
|
+
**Never copied.** Web's `Theme/platform/` mirror exports the **same names** over CSS/DOM, which is
|
|
7
|
+
what makes the theme provider and module styles copy-pasteable between the repos. Renaming an
|
|
8
|
+
export here without renaming it there silently breaks that contract — the two files never import
|
|
9
|
+
each other, so nothing fails until a paste does.
|
|
10
|
+
|
|
11
|
+
This is also the reason `tokens/` stays unitless: `hairline` and Inter's face names are runtime
|
|
12
|
+
platform values, so the token says `1` / `600` and this layer resolves it.
|
|
13
|
+
|
|
14
|
+
## Exports (`platform/index.ts`)
|
|
15
|
+
|
|
16
|
+
| Export | Type | Notes |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| `rem(n)` | `number` | Identity — RN lengths are already DP. Web returns `n/16 + 'rem'`. |
|
|
19
|
+
| `hairline` | `number` | `StyleSheet.hairlineWidth` — density-dependent, resolved at runtime. |
|
|
20
|
+
| `elevation(token)` | `ElevationStyle` | `ElevationToken` → RN shadow style props. |
|
|
21
|
+
| `interFontFamilies` | `Record<FontWeightValue, string>` | Weight value (`'400'`…`'700'`) → Inter face name. |
|
|
22
|
+
| `systemFontFamily` | `string` | `System` (iOS) / `sans-serif` (Android). |
|
|
23
|
+
| `fontStyleForWeight(weight, interLoaded?)` | `FontStyleForWeight` | Weight value → `{fontFamily}` or system fallback. |
|
|
24
|
+
| `getSystemColorMode()` | `'light' \| 'dark'` | |
|
|
25
|
+
| `subscribeToSystemColorMode(cb)` | `() => void` | Returns an unsubscribe fn. |
|
|
26
|
+
|
|
27
|
+
Types: `ElevationStyle`, `FontWeightValue` (`= (typeof fontWeights)[keyof typeof fontWeights]`),
|
|
28
|
+
`FontStyleForWeight`, `ColorMode`.
|
|
29
|
+
|
|
30
|
+
## Key behaviours
|
|
31
|
+
|
|
32
|
+
### Elevation uses the legacy shadow props, not `boxShadow`
|
|
33
|
+
|
|
34
|
+
`boxShadow` is **New-Architecture-only**. Our peer range (RN >= 0.79) still allows
|
|
35
|
+
`newArchEnabled=false`, where `boxShadow` renders **nothing**. The legacy props map straight to the
|
|
36
|
+
platform APIs and are not deprecated, so they are the only both-arch path. Revisit only when the
|
|
37
|
+
peer floor is new-arch-only — `boxShadow` is strictly more capable (it is the only way to get
|
|
38
|
+
spread).
|
|
39
|
+
|
|
40
|
+
Per-platform, deliberately — **three** explicit `Platform.select` branches (`ios`, `web`,
|
|
41
|
+
`default` for Android). `web` must stay its own key: without one, `react-native-web` falls through
|
|
42
|
+
to `default` (the Android shape), whose only meaningful field — `elevation` — RNW silently ignores
|
|
43
|
+
(Android-only prop), so the shadow rendered as nothing at all. This shipped as a real bug once;
|
|
44
|
+
`platform/__tests__/elevation.test.ts` now pins all three shapes so it can't silently regress.
|
|
45
|
+
|
|
46
|
+
- **iOS** — `shadowColor` + `shadowOffset` + `shadowOpacity: 1` + `shadowRadius: blur / 2`.
|
|
47
|
+
- `blur / 2` because iOS renders a given `shadowRadius` heavier than the same CSS blur; an
|
|
48
|
+
unhalved radius reads darker and wider than the web token this mirrors.
|
|
49
|
+
- `shadowOpacity: 1` is not "fully opaque": iOS **multiplies** it by the colour's alpha, so `1`
|
|
50
|
+
lets `#rrggbbaa` carry translucency alone — one colour value, correct on both platforms. Also
|
|
51
|
+
note the prop **defaults to 0** (no shadow), so it must always be set.
|
|
52
|
+
- `shadowOffset` is always explicit because iOS defaults it to `(0, -3)`, not `(0, 0)`.
|
|
53
|
+
- **Web** — same shape as iOS (`shadowColor` + `shadowOffset` + `shadowOpacity: 1` +
|
|
54
|
+
`shadowRadius`), but **unhalved**: the iOS halving corrects an iOS-only rendering quirk, and the
|
|
55
|
+
token's `blur` already IS the original web/CSS value (see `tokens/primitives/elevation.ts`'s doc
|
|
56
|
+
comment), so it passes straight through. `react-native-web`'s style preprocessor converts these
|
|
57
|
+
legacy shadow props into a real CSS `box-shadow` — confirmed empirically via
|
|
58
|
+
`react-native-web/dist/cjs/exports/StyleSheet/preprocess`.
|
|
59
|
+
- **Android** — `elevation` + `shadowColor` only. Android ignores offset/opacity/radius, and tints
|
|
60
|
+
from `shadowColor` only on **API 28+** (below that the shadow is the platform default black).
|
|
61
|
+
A view also needs a **background colour** for `elevation` to cast anything.
|
|
62
|
+
|
|
63
|
+
**`spread` is dropped.** Neither platform exposes it through style props (RN implements it by
|
|
64
|
+
insetting a custom shadowPath). Keep mobile elevation tokens at `spread: 0` — a non-zero spread
|
|
65
|
+
renders on web and not here.
|
|
66
|
+
|
|
67
|
+
### Fonts are keyed by the weight value, and Inter is the app's job
|
|
68
|
+
|
|
69
|
+
The map is keyed by the **weight value** (`'400'`…`'700'`), not the token name (`regular`/`medium`/
|
|
70
|
+
`semibold`/`bold`). The value is what a copied web call passes (`fontStyleForWeight(fontWeights.semibold)`)
|
|
71
|
+
and what RN's `fontWeight` fallback needs verbatim, so one input drives both the family lookup and the
|
|
72
|
+
fallback. `FontWeightValue` is **derived from the token** (`(typeof fontWeights)[keyof typeof fontWeights]`),
|
|
73
|
+
so adding a weight to `fontWeights` fails the `satisfies Record<FontWeightValue, string>` until a face is
|
|
74
|
+
registered here — the map can never silently miss a weight.
|
|
75
|
+
|
|
76
|
+
With Inter loaded, `fontStyleForWeight` returns **`fontFamily` only** — the face is already the
|
|
77
|
+
target weight, and adding `fontWeight` makes Android synthesise a faux-bold on top of it. The
|
|
78
|
+
system fallback inverts this: one family, so `fontWeight` carries the weight.
|
|
79
|
+
|
|
80
|
+
`interLoaded` is passed in (from the theme provider) rather than detected — without expo-font there
|
|
81
|
+
is no way to ask whether a family registered, and an unregistered family degrades inconsistently
|
|
82
|
+
(silent fallback on Android, warnings on iOS).
|
|
83
|
+
|
|
84
|
+
**Consumer requirement:** the app registers the faces itself; this library takes **no font
|
|
85
|
+
dependency**. The `interFontFamilies` values are the exact keys expected:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
useFonts({ 'Inter-Regular': require('…'), 'Inter-SemiBold': require('…') /* … */ });
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Colour scheme
|
|
92
|
+
|
|
93
|
+
`Appearance.getColorScheme()` is nullable (`null` when the native Appearance module is unavailable)
|
|
94
|
+
and on RN 0.85+ can also report `'unspecified'`. Since the peer floor (`>=0.79`) spans both, the
|
|
95
|
+
getter and listener test `=== 'dark'` and floor everything else to `'light'`, mirroring web's
|
|
96
|
+
matchMedia which only asks "is it dark?". Read it per render, never cache: it changes at
|
|
97
|
+
sunrise/sunset and via `Appearance.setColorScheme()`.
|
|
98
|
+
|
|
99
|
+
## Known gaps
|
|
100
|
+
|
|
101
|
+
- `spread` unsupported (above).
|
|
102
|
+
- Android shadow tint requires API 28+; below that colour is ignored by the platform.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Appearance } from 'react-native';
|
|
4
|
+
/**
|
|
5
|
+
* `Appearance.getColorScheme()` is nullable — `null` when the native Appearance module is
|
|
6
|
+
* unavailable — and on RN 0.85+ can also report `'unspecified'`. Our peer floor spans both, so
|
|
7
|
+
* anything that isn't explicitly `'dark'` floors to light, mirroring web's matchMedia which only
|
|
8
|
+
* ever asks "is it dark?". Read it per render, never cache: it changes at sunrise/sunset and on
|
|
9
|
+
* `Appearance.setColorScheme()`.
|
|
10
|
+
*/
|
|
11
|
+
export function getSystemColorMode() {
|
|
12
|
+
return Appearance.getColorScheme() === 'dark' ? 'dark' : 'light';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Returns an unsubscribe fn. */
|
|
16
|
+
export function subscribeToSystemColorMode(callback) {
|
|
17
|
+
const subscription = Appearance.addChangeListener(({
|
|
18
|
+
colorScheme
|
|
19
|
+
}) => {
|
|
20
|
+
callback(colorScheme === 'dark' ? 'dark' : 'light');
|
|
21
|
+
});
|
|
22
|
+
return () => subscription.remove();
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=colorScheme.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Appearance","getSystemColorMode","getColorScheme","subscribeToSystemColorMode","callback","subscription","addChangeListener","colorScheme","remove"],"sourceRoot":"../../../../src","sources":["theme/platform/colorScheme.native.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAIzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAA,EAAc;EAC9C,OAAOD,UAAU,CAACE,cAAc,CAAC,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO;AAClE;;AAEA;AACA,OAAO,SAASC,0BAA0BA,CACxCC,QAAmC,EACvB;EACZ,MAAMC,YAAY,GAAGL,UAAU,CAACM,iBAAiB,CAAC,CAAC;IAAEC;EAAY,CAAC,KAAK;IACrEH,QAAQ,CAACG,WAAW,KAAK,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;EACrD,CAAC,CAAC;EACF,OAAO,MAAMF,YAAY,CAACG,MAAM,CAAC,CAAC;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The style props an elevation resolves to. A `Pick` rather than `ViewStyle` so a future RN
|
|
7
|
+
* shadow prop cannot silently widen what this function is allowed to emit.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Resolve an elevation token to RN style props.
|
|
12
|
+
*
|
|
13
|
+
* Uses the legacy shadow props over `boxShadow` because `boxShadow` is New-Architecture-only, and
|
|
14
|
+
* our peer range (RN >= 0.79) still lets a consumer ship `newArchEnabled=false` — on which
|
|
15
|
+
* `boxShadow` renders nothing at all. The legacy props map straight to the platform APIs and are
|
|
16
|
+
* not deprecated, so they are the only path that works on both architectures. react-native-web's
|
|
17
|
+
* style preprocessor converts these same legacy props into a real CSS `box-shadow`, so the `web`
|
|
18
|
+
* branch below rides that conversion rather than emitting `boxShadow` itself.
|
|
19
|
+
*
|
|
20
|
+
* An elevation token is a STACK of layers (web needs both an ambient and a contact shadow per
|
|
21
|
+
* step), but legacy RN shadow props can only express one. This renders `layers[0]` — the dominant
|
|
22
|
+
* layer — and drops the rest. That is an honest limit of the legacy path, not a token compromise:
|
|
23
|
+
* a future `boxShadow`-only resolver (new-arch-only consumers) can render every layer.
|
|
24
|
+
*
|
|
25
|
+
* `layer.spread` is dropped — neither legacy platform API exposes it (RN implements it by
|
|
26
|
+
* insetting a custom shadowPath). The ramp's `md`/`lg` carry a negative spread to tighten the
|
|
27
|
+
* shadow on web, so those two steps read marginally wider here. Accepted: honouring it would mean
|
|
28
|
+
* hand-drawing a shadow layer per view.
|
|
29
|
+
*
|
|
30
|
+
* Returns one of three shapes: `ios`, `android` (RN's `default` branch — Android reads the numeric
|
|
31
|
+
* `elevation` prop and ignores offset/opacity/radius), and `web`. `web` MUST stay its own explicit
|
|
32
|
+
* key: without it, react-native-web falls through to `default` (the Android shape), whose only
|
|
33
|
+
* meaningful field — `elevation` — react-native-web silently ignores (it is Android-only), so the
|
|
34
|
+
* shadow renders as nothing at all.
|
|
35
|
+
*/
|
|
36
|
+
export function elevation(token) {
|
|
37
|
+
const layer = token.layers[0];
|
|
38
|
+
return Platform.select({
|
|
39
|
+
ios: {
|
|
40
|
+
shadowColor: layer.color,
|
|
41
|
+
// Always explicit: iOS defaults shadowOffset to (0, -3), not (0, 0).
|
|
42
|
+
shadowOffset: {
|
|
43
|
+
width: layer.x,
|
|
44
|
+
height: layer.y
|
|
45
|
+
},
|
|
46
|
+
// iOS multiplies shadowOpacity by the colour's own alpha, so 1 lets #rrggbbaa carry the
|
|
47
|
+
// translucency by itself — and keeps one colour value correct on both platforms.
|
|
48
|
+
shadowOpacity: 1,
|
|
49
|
+
// Halved because iOS renders a given shadowRadius heavier than the same CSS blur, so an
|
|
50
|
+
// unhalved radius reads darker and wider than the web token this mirrors.
|
|
51
|
+
shadowRadius: layer.blur / 2
|
|
52
|
+
},
|
|
53
|
+
// Same legacy shadow-prop shape as iOS, but WITHOUT the halving above: that halving corrects
|
|
54
|
+
// for iOS rendering a given shadowRadius heavier than the same CSS blur, which is an iOS
|
|
55
|
+
// quirk, not a web one. The token's `blur` already IS the original web/CSS value (see
|
|
56
|
+
// `elevation.ts`'s doc comment), so it passes straight through as `shadowRadius` and
|
|
57
|
+
// react-native-web's preprocessor turns the whole set into a real CSS `box-shadow`.
|
|
58
|
+
web: {
|
|
59
|
+
shadowColor: layer.color,
|
|
60
|
+
shadowOffset: {
|
|
61
|
+
width: layer.x,
|
|
62
|
+
height: layer.y
|
|
63
|
+
},
|
|
64
|
+
shadowOpacity: 1,
|
|
65
|
+
shadowRadius: layer.blur
|
|
66
|
+
},
|
|
67
|
+
// Android draws the shadow from `elevation` alone; it ignores offset/opacity/radius and tints
|
|
68
|
+
// with shadowColor only on API 28+. Below that the shadow is the platform's default black.
|
|
69
|
+
default: {
|
|
70
|
+
shadowColor: layer.color,
|
|
71
|
+
elevation: token.android
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=elevation.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","elevation","token","layer","layers","select","ios","shadowColor","color","shadowOffset","width","x","height","y","shadowOpacity","shadowRadius","blur","web","default","android"],"sourceRoot":"../../../../src","sources":["theme/platform/elevation.native.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAIvC;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,KAAqB,EAAkB;EAC/D,MAAMC,KAAK,GAAGD,KAAK,CAACE,MAAM,CAAC,CAAC,CAAC;EAC7B,OAAOJ,QAAQ,CAACK,MAAM,CAAiB;IACrCC,GAAG,EAAE;MACHC,WAAW,EAAEJ,KAAK,CAACK,KAAK;MACxB;MACAC,YAAY,EAAE;QAAEC,KAAK,EAAEP,KAAK,CAACQ,CAAC;QAAEC,MAAM,EAAET,KAAK,CAACU;MAAE,CAAC;MACjD;MACA;MACAC,aAAa,EAAE,CAAC;MAChB;MACA;MACAC,YAAY,EAAEZ,KAAK,CAACa,IAAI,GAAG;IAC7B,CAAC;IACD;IACA;IACA;IACA;IACA;IACAC,GAAG,EAAE;MACHV,WAAW,EAAEJ,KAAK,CAACK,KAAK;MACxBC,YAAY,EAAE;QAAEC,KAAK,EAAEP,KAAK,CAACQ,CAAC;QAAEC,MAAM,EAAET,KAAK,CAACU;MAAE,CAAC;MACjDC,aAAa,EAAE,CAAC;MAChBC,YAAY,EAAEZ,KAAK,CAACa;IACtB,CAAC;IACD;IACA;IACAE,OAAO,EAAE;MACPX,WAAW,EAAEJ,KAAK,CAACK,KAAK;MACxBP,SAAS,EAAEC,KAAK,CAACiB;IACnB;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The weight VALUES the `fontWeights` tokens resolve to ('400'…'700') — which is exactly RN's own
|
|
7
|
+
* `fontWeight` string domain. Derived from the token so adding a weight there fails the `satisfies`
|
|
8
|
+
* below until a matching face is registered here.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** The style a weight resolves to. Never both keys at once — see `fontStyleForWeight`. */
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Keyed by the weight VALUE, not the token name, because the value is what a copied web call passes
|
|
15
|
+
* (`fontStyleForWeight(fontWeights.semibold)`) and what the `fontWeight` fallback below needs
|
|
16
|
+
* verbatim — one input serves the family lookup and the fallback.
|
|
17
|
+
*
|
|
18
|
+
* The values are the family names the consumer app registers with expo-font. Loading Inter is the
|
|
19
|
+
* app's job; this library takes no font dependency:
|
|
20
|
+
* useFonts({ 'Inter-Regular': require('…'), 'Inter-SemiBold': require('…'), … })
|
|
21
|
+
*/
|
|
22
|
+
export const interFontFamilies = {
|
|
23
|
+
'400': 'Inter-Regular',
|
|
24
|
+
'500': 'Inter-Medium',
|
|
25
|
+
'600': 'Inter-SemiBold',
|
|
26
|
+
'700': 'Inter-Bold'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** The platform's own UI font, used when the app has not registered Inter. */
|
|
30
|
+
export const systemFontFamily = Platform.select({
|
|
31
|
+
ios: 'System',
|
|
32
|
+
default: 'sans-serif'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a weight to a text style.
|
|
37
|
+
*
|
|
38
|
+
* With Inter loaded this returns `fontFamily` ONLY, deliberately omitting `fontWeight`: each Inter
|
|
39
|
+
* face already carries its weight, and pairing a weighted face with `fontWeight` makes Android
|
|
40
|
+
* synthesise a faux-bold on top of it. The system fallback is the reverse — one family, so the
|
|
41
|
+
* weight has to be carried by `fontWeight` (the token value is already the string RN expects).
|
|
42
|
+
*
|
|
43
|
+
* `interLoaded` is passed in from the theme provider, not detected: without expo-font there is no
|
|
44
|
+
* way to ask whether a family registered, and an unregistered family degrades inconsistently
|
|
45
|
+
* (silent fallback on Android, a warning on iOS).
|
|
46
|
+
*/
|
|
47
|
+
export function fontStyleForWeight(weight, interLoaded = true) {
|
|
48
|
+
if (!interLoaded) {
|
|
49
|
+
return {
|
|
50
|
+
fontFamily: systemFontFamily,
|
|
51
|
+
fontWeight: weight
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
fontFamily: interFontFamilies[weight]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=fonts.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","interFontFamilies","systemFontFamily","select","ios","default","fontStyleForWeight","weight","interLoaded","fontFamily","fontWeight"],"sourceRoot":"../../../../src","sources":["theme/platform/fonts.native.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;;AAIvC;AACA;AACA;AACA;AACA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAG;EAC/B,KAAK,EAAE,eAAe;EACtB,KAAK,EAAE,cAAc;EACrB,KAAK,EAAE,gBAAgB;EACvB,KAAK,EAAE;AACT,CAAoD;;AAEpD;AACA,OAAO,MAAMC,gBAAwB,GAAGF,QAAQ,CAACG,MAAM,CAAC;EACtDC,GAAG,EAAE,QAAQ;EACbC,OAAO,EAAE;AACX,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,MAAuB,EACvBC,WAAW,GAAG,IAAI,EACE;EACpB,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO;MAAEC,UAAU,EAAEP,gBAAgB;MAAEQ,UAAU,EAAEH;IAAO,CAAC;EAC7D;EACA,OAAO;IAAEE,UAAU,EAAER,iBAAiB,CAACM,MAAM;EAAE,CAAC;AAClD","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The platform seam. Web's mirror exports these same names over CSS/DOM, which is what lets the
|
|
5
|
+
* theme provider and every module's styles be copy-pasted between the repos unchanged.
|
|
6
|
+
*
|
|
7
|
+
* Imports are `.native`-suffixed on purpose: this package ships native only, so there is no `.ts`
|
|
8
|
+
* sibling for a bundler to choose between and nothing to resolve implicitly.
|
|
9
|
+
*/
|
|
10
|
+
export { rem, hairline } from "./units.native.js";
|
|
11
|
+
export { elevation } from "./elevation.native.js";
|
|
12
|
+
export { interFontFamilies, systemFontFamily, fontStyleForWeight } from "./fonts.native.js";
|
|
13
|
+
export { getSystemColorMode, subscribeToSystemColorMode } from "./colorScheme.native.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["rem","hairline","elevation","interFontFamilies","systemFontFamily","fontStyleForWeight","getSystemColorMode","subscribeToSystemColorMode"],"sourceRoot":"../../../../src","sources":["theme/platform/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,GAAG,EAAEC,QAAQ,QAAQ,mBAAgB;AAC9C,SAASC,SAAS,QAAQ,uBAAoB;AAE9C,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,kBAAkB,QAAQ,mBAAgB;AAExF,SAASC,kBAAkB,EAAEC,0BAA0B,QAAQ,yBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Identity on native: RN lengths are already density-independent pixels.
|
|
7
|
+
* It exists so theme code copied from web — which calls `rem(space[4])` — compiles unchanged
|
|
8
|
+
* here, where the web mirror returns `n / 16 + 'rem'`.
|
|
9
|
+
*/
|
|
10
|
+
export const rem = n => n;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The thinnest crisp line on this device, resolved at runtime from screen density.
|
|
14
|
+
* This is why `borderWidths` tokens stay plain numbers: a density-dependent value cannot live in
|
|
15
|
+
* the copy-paste zone, so the token says `1` and a border that wants a hairline reaches for this.
|
|
16
|
+
*/
|
|
17
|
+
export const hairline = StyleSheet.hairlineWidth;
|
|
18
|
+
//# sourceMappingURL=units.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","rem","n","hairline","hairlineWidth"],"sourceRoot":"../../../../src","sources":["theme/platform/units.native.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,GAAIC,CAAS,IAAaA,CAAC;;AAE3C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAgB,GAAGH,UAAU,CAACI,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { space, radii, fontSizes, fontWeights, lineHeights, letterSpacings, borderWidths, breakpoints, zIndices, elevation as elevationTokens, palettes, roleColors, DEFAULT_THEME } from "../tokens/index.js";
|
|
5
|
+
import { elevation as renderElevation, fontStyleForWeight, getSystemColorMode, subscribeToSystemColorMode } from "../platform/index.js";
|
|
6
|
+
import { DEFAULT_BRAND_STORAGE_NAMESPACE, DEFAULT_STORAGE_NAMESPACE, isThemeMode, isThemeName, memoryStorageAdapter } from "./colorModeStorage.js";
|
|
7
|
+
|
|
8
|
+
// A local declaration of RN's build-time global, so this file typechecks without depending on the
|
|
9
|
+
// react-native ambient types being loaded. In a module scope it shadows nothing; RN replaces it.
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The fully resolved theme for one (brand, resolvedMode): role colours resolved to plain strings,
|
|
13
|
+
* the unitless numeric scale, and the platform-rendered pieces a token cannot hold (RN shadow props,
|
|
14
|
+
* a font-style resolver). This is what `useTheme()` returns; component modules read it, never the
|
|
15
|
+
* raw palette directly.
|
|
16
|
+
*/
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
const DEFAULT_MODE = 'system';
|
|
19
|
+
|
|
20
|
+
// Elevation carries no colour-mode variation at the token layer, so every theme shares one rendered
|
|
21
|
+
// map instead of recomputing five shadow styles per brand/mode.
|
|
22
|
+
const RENDERED_ELEVATION = {
|
|
23
|
+
none: renderElevation(elevationTokens.none),
|
|
24
|
+
sm: renderElevation(elevationTokens.sm),
|
|
25
|
+
base: renderElevation(elevationTokens.base),
|
|
26
|
+
md: renderElevation(elevationTokens.md),
|
|
27
|
+
lg: renderElevation(elevationTokens.lg)
|
|
28
|
+
};
|
|
29
|
+
function buildTheme(brand, mode, interLoaded) {
|
|
30
|
+
const palette = palettes[brand][mode];
|
|
31
|
+
return {
|
|
32
|
+
brand,
|
|
33
|
+
mode,
|
|
34
|
+
colors: roleColors(palette),
|
|
35
|
+
palette,
|
|
36
|
+
space,
|
|
37
|
+
radii,
|
|
38
|
+
fontSizes,
|
|
39
|
+
fontWeights,
|
|
40
|
+
lineHeights,
|
|
41
|
+
letterSpacings,
|
|
42
|
+
borderWidths,
|
|
43
|
+
breakpoints,
|
|
44
|
+
zIndices,
|
|
45
|
+
elevation: RENDERED_ELEVATION,
|
|
46
|
+
fontStyleForWeight: weight => fontStyleForWeight(weight, interLoaded)
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Two contexts, on purpose. `ThemeContext` holds the heavy resolved `Theme`; `ThemeModeContext` holds
|
|
52
|
+
* the small mode-control triple. Both provider values are memoised on their true inputs, so:
|
|
53
|
+
* - a mode flip recomputes the theme exactly ONCE and re-renders each consumer once, and
|
|
54
|
+
* - an OS colour change while the mode is pinned (`resolvedMode` unchanged) keeps BOTH values
|
|
55
|
+
* reference-stable, so it re-renders nobody.
|
|
56
|
+
* Splitting also means a `useThemeMode()` reader isn't invalidated by unrelated theme-object churn
|
|
57
|
+
* and vice versa.
|
|
58
|
+
*/
|
|
59
|
+
export const ThemeContext = /*#__PURE__*/createContext(undefined);
|
|
60
|
+
export const ThemeModeContext = /*#__PURE__*/createContext(undefined);
|
|
61
|
+
export function PixelizeProvider({
|
|
62
|
+
children,
|
|
63
|
+
brand: brandProp = DEFAULT_THEME,
|
|
64
|
+
mode = DEFAULT_MODE,
|
|
65
|
+
storage: storageProp,
|
|
66
|
+
storageKey = DEFAULT_STORAGE_NAMESPACE,
|
|
67
|
+
brandStorageKey = DEFAULT_BRAND_STORAGE_NAMESPACE,
|
|
68
|
+
interLoaded = false
|
|
69
|
+
}) {
|
|
70
|
+
const storage = storageProp ?? memoryStorageAdapter;
|
|
71
|
+
const [modeState, setModeState] = useState(mode);
|
|
72
|
+
const [brandState, setBrandState] = useState(brandProp);
|
|
73
|
+
// Read the real OS value immediately — native has no hydration step to stay deterministic for.
|
|
74
|
+
const [systemMode, setSystemMode] = useState(getSystemColorMode);
|
|
75
|
+
|
|
76
|
+
// Once the user has chosen, a late async rehydrate must not clobber that fresh choice. Brand
|
|
77
|
+
// gets its own ref: touching one must never block the other's rehydrate.
|
|
78
|
+
const userTouched = useRef(false);
|
|
79
|
+
const userTouchedBrand = useRef(false);
|
|
80
|
+
useEffect(() => subscribeToSystemColorMode(setSystemMode), []);
|
|
81
|
+
|
|
82
|
+
// `mode` is intentionally initial-only (a controlled screen drives it through `setMode`, never
|
|
83
|
+
// by re-passing a prop), but `brand` already shipped as a fully-controlled prop before this
|
|
84
|
+
// provider owned any brand state — existing call sites (this repo's own example app included)
|
|
85
|
+
// re-render with a new `brand` value and expect the theme to follow. This keeps that contract
|
|
86
|
+
// alive on top of the new persisted/`setBrand` state: an unrelenting `brandProp` still drives
|
|
87
|
+
// `brandState`, but the moment `setBrand` is called even once, the provider is considered the
|
|
88
|
+
// owner and further `brandProp` changes are ignored — the same "explicit choice wins" rule
|
|
89
|
+
// `storage` rehydration already follows below.
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (userTouchedBrand.current) return;
|
|
92
|
+
setBrandState(brandProp);
|
|
93
|
+
}, [brandProp]);
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (storageProp) return;
|
|
96
|
+
if (typeof __DEV__ !== 'undefined' && !__DEV__) return;
|
|
97
|
+
console.warn('[pixelize-native-library] <PixelizeProvider> has no `storage` adapter, so the theme choice is ' + 'kept in memory and lost on app restart. Pass ' + 'storage={createAsyncStorageAdapter(AsyncStorage)} to persist it.');
|
|
98
|
+
}, [storageProp]);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
let cancelled = false;
|
|
101
|
+
Promise.resolve(storage.getItem(storageKey)).then(raw => {
|
|
102
|
+
if (cancelled || userTouched.current) return;
|
|
103
|
+
if (isThemeMode(raw)) setModeState(raw);
|
|
104
|
+
}).catch(() => {});
|
|
105
|
+
return () => {
|
|
106
|
+
cancelled = true;
|
|
107
|
+
};
|
|
108
|
+
}, [storage, storageKey]);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
let cancelled = false;
|
|
111
|
+
Promise.resolve(storage.getItem(brandStorageKey)).then(raw => {
|
|
112
|
+
if (cancelled || userTouchedBrand.current) return;
|
|
113
|
+
if (isThemeName(raw)) setBrandState(raw);
|
|
114
|
+
}).catch(() => {});
|
|
115
|
+
return () => {
|
|
116
|
+
cancelled = true;
|
|
117
|
+
};
|
|
118
|
+
}, [storage, brandStorageKey]);
|
|
119
|
+
|
|
120
|
+
// Write on the explicit action, not in an effect: it only ever persists a real user choice, so a
|
|
121
|
+
// mount default can't be written over the stored value before the rehydrate above has applied it.
|
|
122
|
+
const setMode = useCallback(next => {
|
|
123
|
+
userTouched.current = true;
|
|
124
|
+
setModeState(next);
|
|
125
|
+
Promise.resolve(storage.setItem(storageKey, next)).catch(() => {});
|
|
126
|
+
}, [storage, storageKey]);
|
|
127
|
+
const setBrand = useCallback(next => {
|
|
128
|
+
userTouchedBrand.current = true;
|
|
129
|
+
setBrandState(next);
|
|
130
|
+
Promise.resolve(storage.setItem(brandStorageKey, next)).catch(() => {});
|
|
131
|
+
}, [storage, brandStorageKey]);
|
|
132
|
+
const resolvedMode = modeState === 'system' ? systemMode : modeState;
|
|
133
|
+
const theme = useMemo(() => buildTheme(brandState, resolvedMode, interLoaded), [brandState, resolvedMode, interLoaded]);
|
|
134
|
+
const modeValue = useMemo(() => ({
|
|
135
|
+
mode: modeState,
|
|
136
|
+
resolvedMode,
|
|
137
|
+
setMode,
|
|
138
|
+
brand: brandState,
|
|
139
|
+
setBrand
|
|
140
|
+
}), [modeState, resolvedMode, setMode, brandState, setBrand]);
|
|
141
|
+
return /*#__PURE__*/_jsx(ThemeContext.Provider, {
|
|
142
|
+
value: theme,
|
|
143
|
+
children: /*#__PURE__*/_jsx(ThemeModeContext.Provider, {
|
|
144
|
+
value: modeValue,
|
|
145
|
+
children: children
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=PixelizeProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","useCallback","useEffect","useMemo","useRef","useState","space","radii","fontSizes","fontWeights","lineHeights","letterSpacings","borderWidths","breakpoints","zIndices","elevation","elevationTokens","palettes","roleColors","DEFAULT_THEME","renderElevation","fontStyleForWeight","getSystemColorMode","subscribeToSystemColorMode","DEFAULT_BRAND_STORAGE_NAMESPACE","DEFAULT_STORAGE_NAMESPACE","isThemeMode","isThemeName","memoryStorageAdapter","jsx","_jsx","DEFAULT_MODE","RENDERED_ELEVATION","none","sm","base","md","lg","buildTheme","brand","mode","interLoaded","palette","colors","weight","ThemeContext","undefined","ThemeModeContext","PixelizeProvider","children","brandProp","storage","storageProp","storageKey","brandStorageKey","modeState","setModeState","brandState","setBrandState","systemMode","setSystemMode","userTouched","userTouchedBrand","current","__DEV__","console","warn","cancelled","Promise","resolve","getItem","then","raw","catch","setMode","next","setItem","setBrand","resolvedMode","theme","modeValue","Provider","value"],"sourceRoot":"../../../../src","sources":["theme/provider/PixelizeProvider.tsx"],"mappings":"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","ignoreList":[]}
|