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,103 @@
|
|
|
1
|
+
# menu/ — an anchored action list opened from a trigger, in RN's own Modal
|
|
2
|
+
|
|
3
|
+
`Menu` wraps a single trigger element (via `React.cloneElement`, never `{...rest}`) and reveals a
|
|
4
|
+
short list of actions in React Native's OWN `Modal` on press. Unlike `Select` (externally
|
|
5
|
+
controlled via `value`/`onValueChange`), Menu is self-contained: a transient action list manages
|
|
6
|
+
its own open/closed state.
|
|
7
|
+
|
|
8
|
+
The one deliberate exception to "own `Modal`, not the library's": on web, Menu reads
|
|
9
|
+
`../modal/ModalPortalContext` + `../modal/renderWebPortal` — the same web-portal-containment
|
|
10
|
+
mechanism `Modal` and `Select` use — so opening a `ModalPortalProvider` containing an app also
|
|
11
|
+
contains Menu's action sheet. See `../modal/MODULE.md`'s "Web portal mechanism" section for the
|
|
12
|
+
full explanation; this is a plain context + a stateless helper with no React-tree footprint of its
|
|
13
|
+
own, not a dependency on the `Modal` component.
|
|
14
|
+
|
|
15
|
+
## Files
|
|
16
|
+
|
|
17
|
+
| File | Role |
|
|
18
|
+
|------|------|
|
|
19
|
+
| `Menu.tsx` | The component. `cloneElement` trigger composition, `Modal` + backdrop + row list, open/close state. |
|
|
20
|
+
| `Menu.variants.ts` | Pure resolver (`resolveMenuItemColor`) + the themed structural resolvers (`menuOverlayStructure`, `menuSheetStructure`, `menuRowStructure`). No React, no lucide. |
|
|
21
|
+
| `index.ts` | Public surface: `Menu`, `MenuProps`, `MenuItem`, `MenuTriggerProps`, `MenuItemTone`, `IconName` (re-exported from `core/icon`). |
|
|
22
|
+
| `__tests__/Menu.test.ts` | Pure: WCAG contrast (all brands × modes) + touch target + the tone→role mapping. |
|
|
23
|
+
| `__tests__/Menu.render.test.tsx` | Render: open/close, trigger `onPress` chaining, disabled gating, item selection, backdrop dismiss, and the web-portal opt-in branch (mocking `renderWebPortal`). |
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Default | Notes |
|
|
28
|
+
|------|------|---------|-------|
|
|
29
|
+
| `trigger` | `ReactElement<MenuTriggerProps>` | — | Required. A single element accepting `onPress` (e.g. a `Button`). Cloned to chain its `onPress` with opening the menu. |
|
|
30
|
+
| `items` | `{ label: string; icon?: IconName; onPress: () => void; tone?: "default" \| "danger" }[]` | — | Required. Rendered in order; `danger` renders the row in `status.danger.text`. |
|
|
31
|
+
| `disabled` | `boolean` | `false` | Blocks the menu from opening. Does **not** restyle the trigger — see "Design decisions" below. |
|
|
32
|
+
| `testID` | `string` | — | Seeds `${testID}-backdrop` and `${testID}-item-${index}`. Not applied to the trigger — the trigger owns its own `testID`. |
|
|
33
|
+
|
|
34
|
+
No `style` prop — like Tooltip, Menu renders no sized node of its own for an app to place; the
|
|
35
|
+
trigger keeps whatever layout it already has. `variant`/`size` are also absent: Menu has one fixed
|
|
36
|
+
row size, since an action list's row height isn't a caller-facing choice.
|
|
37
|
+
|
|
38
|
+
## Accessibility contract (WCAG)
|
|
39
|
+
|
|
40
|
+
- **4.1.2 / semantics** — every row is `accessibilityRole="menuitem"`. The backdrop is
|
|
41
|
+
`accessible={false}` (same as Select's) so it isn't announced as a separate focusable element.
|
|
42
|
+
- **1.4.3** — every row's label is measured ≥ 4.5:1 against the sheet fill (`bg.surface`), for both
|
|
43
|
+
`default` (`fg.default`) and `danger` (`status.danger.text`) tones, across all 8 brands × both
|
|
44
|
+
modes.
|
|
45
|
+
- **1.4.11** — the row icon reuses the label's exact colour (never a separate lookup): since the
|
|
46
|
+
label already clears the stricter 4.5:1 text minimum, the icon clears its looser 3:1 non-text
|
|
47
|
+
minimum for free — the same reasoning Select's active-row check glyph relies on.
|
|
48
|
+
- **2.5.8 / 2.5.5 target size** — every row is a direct 44dp `minHeight` (a list row is already its
|
|
49
|
+
own full-width touch target, not a control that shrinks and needs `hitSlop`).
|
|
50
|
+
- **Icon-only rule (rule 5) does not apply** — every row always renders a visible `label` text; a
|
|
51
|
+
menu row is never icon-only.
|
|
52
|
+
- **2.3.3** — the menu's `animationType` is `"none"` instead of `"fade"` when `useReducedMotion()`
|
|
53
|
+
is true.
|
|
54
|
+
- Backdrop press closes the menu without calling any item's `onPress` — dismissal and selection are
|
|
55
|
+
two distinct code paths (`closeMenu` vs. `selectItem`), so a stray tap can never accidentally fire
|
|
56
|
+
an action.
|
|
57
|
+
|
|
58
|
+
## Patterns copied from Button / Select / Tooltip (the reference modules)
|
|
59
|
+
|
|
60
|
+
1. **Structure vs colour split** — sheet/row padding/radius via `createThemedVariants`; colour
|
|
61
|
+
resolved from `RoleColors` per `tone`, applied inline.
|
|
62
|
+
2. **Pure, testable resolver** in `Menu.variants.ts` — the WCAG contrast is unit-tested against real
|
|
63
|
+
palettes, never eyeballed.
|
|
64
|
+
3. **`React.cloneElement` composition, never `{...rest}`** — only `onPress` is injected into the
|
|
65
|
+
trigger, chained after any handler it already had (same technique as Tooltip's
|
|
66
|
+
`onLongPress`/`onPressOut` injection).
|
|
67
|
+
4. **RN's own `Modal`, not this library's** — same reasoning as Select: a quick transient overlay,
|
|
68
|
+
not a persistent app dialog with a title/children contract.
|
|
69
|
+
5. **Closed `tone` union** — `default | danger`, resolved from role colours, never a free-form
|
|
70
|
+
`color` prop.
|
|
71
|
+
|
|
72
|
+
## Design decisions specific to this module
|
|
73
|
+
|
|
74
|
+
- **`disabled` only blocks opening; it does not restyle the trigger.** Menu cannot reliably inject a
|
|
75
|
+
`disabled` prop into an arbitrary caller-supplied element (the same constraint Tooltip's own docs
|
|
76
|
+
note: a component that destructures its own explicit prop list simply drops an unknown injected
|
|
77
|
+
prop). If the trigger should also *look* disabled, pass `disabled` to the trigger itself.
|
|
78
|
+
- **The trigger's own `onPress` always fires, even while Menu is `disabled`.** Only the menu-opening
|
|
79
|
+
side is gated (inside `openMenu`); the trigger's existing handler is never suppressed, so Menu
|
|
80
|
+
never silently swallows a side effect the caller's trigger already relied on.
|
|
81
|
+
- **Menu does not inject `accessibilityState.expanded` onto the trigger** (unlike Select, whose
|
|
82
|
+
trigger *is* this library's own `Pressable`). Menu's trigger is caller-supplied and opaque; the
|
|
83
|
+
same constraint that stops the `disabled` injection above stops this too.
|
|
84
|
+
- **The sheet is centered, not a true measured anchor.** "Anchored" here means "attached to a
|
|
85
|
+
trigger", not "positioned at the trigger's exact on-screen coordinates" — a real measured anchor
|
|
86
|
+
would need a `ref`/`measure()` most trigger elements in this library don't forward (this
|
|
87
|
+
library's own `Button` isn't `forwardRef`). v1 reuses Select's exact overlay pattern (full-screen
|
|
88
|
+
scrim + centered sheet) rather than inventing an unmeasured guess at a position. A future
|
|
89
|
+
`Popover`-style module with real anchor measurement would be the place to fix this, not a prop
|
|
90
|
+
added here — the same deferral Tooltip's own docs make for its unmeasured bubble placement.
|
|
91
|
+
|
|
92
|
+
## Known gaps
|
|
93
|
+
|
|
94
|
+
- No measured anchor position (see above) — the sheet always centers, regardless of where the
|
|
95
|
+
trigger sits on screen.
|
|
96
|
+
- No submenu / nested items — v1 is a single flat action list, matching the spec this module was
|
|
97
|
+
built against.
|
|
98
|
+
- No keyboard/arrow-key navigation between rows (touch-only interaction model, same scope as
|
|
99
|
+
Select's option list).
|
|
100
|
+
|
|
101
|
+
## Performance
|
|
102
|
+
|
|
103
|
+
Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`). `openMenu`/`closeMenu` are `useCallback`'d, and the inline `onPress` previously injected into the caller-supplied `trigger` via `cloneElement` on every render is extracted to `handleTriggerPress` (`useCallback`, deps `[trigger, openMenu]`) — `trigger` is a consumer-supplied child (typically this library's own `Button`), so a fresh callback there would defeat its memo. `selectItem` and the per-row `onPress` stay inline: they go to `Pressable`/`Icon` (host elements / primitive props), not a memoized child.
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Menu — a small anchored action list opened from a caller-supplied trigger. Unlike Select (whose
|
|
5
|
+
* open/closed state is a `value`/`onValueChange` pair the caller owns), Menu is self-contained: a
|
|
6
|
+
* transient action list manages its own visibility, closing itself after every dismissal path.
|
|
7
|
+
*
|
|
8
|
+
* The trigger is composed via `React.cloneElement` — never `{...rest}` — injecting only `onPress`,
|
|
9
|
+
* chained after any handler the trigger already defined (the same "merge, never clobber" technique
|
|
10
|
+
* Tooltip uses for its child). The dropdown itself is React Native's OWN `Modal`, imported directly
|
|
11
|
+
* from `"react-native"` on purpose: this module must never depend on the library's own `Modal`
|
|
12
|
+
* COMPONENT — this library's own `Modal` (built in parallel elsewhere) is for persistent app
|
|
13
|
+
* dialogs with a title/children contract, not a quick transient overlay — the same distinction
|
|
14
|
+
* Select already draws for its own option list.
|
|
15
|
+
*
|
|
16
|
+
* The one deliberate exception is the web portal mechanism: `ModalPortalContext`/`renderWebPortal`
|
|
17
|
+
* are a plain context + a stateless helper with no React-tree footprint of their own (not the
|
|
18
|
+
* `Modal` component), so Menu reads the same ones `Modal.tsx` and `Select.tsx` read to stay
|
|
19
|
+
* consistent once a consumer opts in via `ModalPortalProvider` — see `../modal/ModalPortalContext.ts`.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { cloneElement, memo, useCallback, useContext, useState } from "react";
|
|
23
|
+
import { Modal, Platform, Pressable, ScrollView, StyleSheet, Text, View } from "react-native";
|
|
24
|
+
import { useReducedMotion } from "../../core/a11y/index.js";
|
|
25
|
+
import { Icon } from "../../core/icon/index.js";
|
|
26
|
+
import { useTheme } from "../../theme/index.js";
|
|
27
|
+
import { ModalPortalContext } from "../modal/ModalPortalContext.js";
|
|
28
|
+
import { renderWebPortal } from "../modal/renderWebPortal";
|
|
29
|
+
import { MENU_ROW_ICON_SIZE, menuOverlayStructure, menuRowStructure, menuSheetStructure, resolveMenuItemColor } from "./Menu.variants.js";
|
|
30
|
+
|
|
31
|
+
/** The subset of props Menu reads from / injects into its trigger child. */
|
|
32
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
33
|
+
const ICON_STROKE = 2;
|
|
34
|
+
// Decorative dismiss scrim behind the sheet — a design constant, not a role token: it is neither
|
|
35
|
+
// text nor an interactive boundary, so WCAG's contrast minimums don't apply to it.
|
|
36
|
+
const BACKDROP_SCRIM = "#00000099";
|
|
37
|
+
export const Menu = /*#__PURE__*/memo(function Menu({
|
|
38
|
+
trigger,
|
|
39
|
+
items,
|
|
40
|
+
disabled = false,
|
|
41
|
+
testID
|
|
42
|
+
}) {
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
const reducedMotion = useReducedMotion();
|
|
45
|
+
const portalContainer = useContext(ModalPortalContext);
|
|
46
|
+
const [open, setOpen] = useState(false);
|
|
47
|
+
const openMenu = useCallback(() => {
|
|
48
|
+
if (disabled) return;
|
|
49
|
+
setOpen(true);
|
|
50
|
+
}, [disabled]);
|
|
51
|
+
const closeMenu = useCallback(() => setOpen(false), []);
|
|
52
|
+
const selectItem = item => {
|
|
53
|
+
closeMenu();
|
|
54
|
+
item.onPress();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Passed to `trigger` — a consumer-supplied CHILD component (typically this library's own
|
|
58
|
+
// Button) — via cloneElement, so it is memoized like any other child-bound callback.
|
|
59
|
+
const handleTriggerPress = useCallback(event => {
|
|
60
|
+
trigger.props.onPress?.(event);
|
|
61
|
+
openMenu();
|
|
62
|
+
}, [trigger, openMenu]);
|
|
63
|
+
const clonedTrigger = /*#__PURE__*/cloneElement(trigger, {
|
|
64
|
+
onPress: handleTriggerPress
|
|
65
|
+
});
|
|
66
|
+
const sheet = /*#__PURE__*/_jsxs(_Fragment, {
|
|
67
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
68
|
+
testID: testID ? `${testID}-backdrop` : undefined,
|
|
69
|
+
accessible: false,
|
|
70
|
+
style: [StyleSheet.absoluteFill, {
|
|
71
|
+
backgroundColor: BACKDROP_SCRIM
|
|
72
|
+
}],
|
|
73
|
+
onPress: closeMenu
|
|
74
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
75
|
+
style: menuOverlayStructure(theme),
|
|
76
|
+
pointerEvents: "box-none",
|
|
77
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: [menuSheetStructure(theme), {
|
|
79
|
+
backgroundColor: theme.colors.bg.surface
|
|
80
|
+
}],
|
|
81
|
+
children: /*#__PURE__*/_jsx(ScrollView, {
|
|
82
|
+
bounces: false,
|
|
83
|
+
children: items.map((item, index) => {
|
|
84
|
+
const color = resolveMenuItemColor(theme.colors, item.tone ?? "default");
|
|
85
|
+
return /*#__PURE__*/_jsxs(Pressable, {
|
|
86
|
+
testID: testID ? `${testID}-item-${index}` : undefined,
|
|
87
|
+
accessibilityRole: "menuitem",
|
|
88
|
+
onPress: () => selectItem(item),
|
|
89
|
+
style: menuRowStructure(theme),
|
|
90
|
+
children: [item.icon !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
91
|
+
name: item.icon,
|
|
92
|
+
size: MENU_ROW_ICON_SIZE,
|
|
93
|
+
color: color,
|
|
94
|
+
strokeWidth: ICON_STROKE
|
|
95
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
96
|
+
numberOfLines: 1,
|
|
97
|
+
style: [theme.fontStyleForWeight(theme.fontWeights.regular), {
|
|
98
|
+
flex: 1,
|
|
99
|
+
fontSize: theme.fontSizes.md,
|
|
100
|
+
color
|
|
101
|
+
}],
|
|
102
|
+
children: item.label
|
|
103
|
+
})]
|
|
104
|
+
}, `${item.label}-${index}`);
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
})]
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Web portal opt-in — see Modal.tsx's identical branch + ModalPortalContext.ts. Every other case
|
|
112
|
+
// (native, or web with no ModalPortalProvider) renders through RN's own <Modal> below, unchanged.
|
|
113
|
+
const menu = Platform.OS === "web" && portalContainer != null ? open ? renderWebPortal(/*#__PURE__*/_jsx(View, {
|
|
114
|
+
style: StyleSheet.absoluteFill,
|
|
115
|
+
pointerEvents: "box-none",
|
|
116
|
+
children: sheet
|
|
117
|
+
}), portalContainer) : null : /*#__PURE__*/_jsx(Modal, {
|
|
118
|
+
visible: open,
|
|
119
|
+
transparent: true,
|
|
120
|
+
animationType: reducedMotion ? "none" : "fade",
|
|
121
|
+
onRequestClose: closeMenu,
|
|
122
|
+
children: sheet
|
|
123
|
+
});
|
|
124
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
125
|
+
children: [clonedTrigger, menu]
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=Menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cloneElement","memo","useCallback","useContext","useState","Modal","Platform","Pressable","ScrollView","StyleSheet","Text","View","useReducedMotion","Icon","useTheme","ModalPortalContext","renderWebPortal","MENU_ROW_ICON_SIZE","menuOverlayStructure","menuRowStructure","menuSheetStructure","resolveMenuItemColor","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ICON_STROKE","BACKDROP_SCRIM","Menu","trigger","items","disabled","testID","theme","reducedMotion","portalContainer","open","setOpen","openMenu","closeMenu","selectItem","item","onPress","handleTriggerPress","event","props","clonedTrigger","sheet","children","undefined","accessible","style","absoluteFill","backgroundColor","pointerEvents","colors","bg","surface","bounces","map","index","color","tone","accessibilityRole","icon","name","size","strokeWidth","numberOfLines","fontStyleForWeight","fontWeights","regular","flex","fontSize","fontSizes","md","label","menu","OS","visible","transparent","animationType","onRequestClose"],"sourceRoot":"../../../../src","sources":["modules/menu/Menu.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,IAAI,EAAEC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,OAAO;AAC7E,SAASC,KAAK,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAI7F,SAASC,gBAAgB,QAAQ,0BA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,KAAA,CAAAE,SAAA;IAAAuB,QAAA,GACGF,aAAa,EACb+B,IAAI;EAAA,CACL,CAAC;AAEP,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Menu's style + behaviour resolution — same split as Button/Select:
|
|
5
|
+
* - STRUCTURE (sizing/spacing off the theme scale) lives in the `createThemedVariants` resolvers
|
|
6
|
+
* below — static per (brand, mode), registered once.
|
|
7
|
+
* - COLOUR is resolved from the theme's ROLE colours (never a raw ramp, never a hardcoded hex) by
|
|
8
|
+
* `resolveMenuItemColor` — `tone` maps a row to `fg.default` or `status.danger.text`, the same
|
|
9
|
+
* reason Button's `tone` is a closed union instead of a `color` prop.
|
|
10
|
+
*
|
|
11
|
+
* Free of React, `lucide`, and any `Modal`/`Pressable` import, so the WCAG + touch-target tests
|
|
12
|
+
* import it directly (mocking only `react-native`'s `StyleSheet`, as `core/style` does).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { createThemedVariants } from "../../core/style/index.js";
|
|
16
|
+
/** Same touch-target floor as Button/Select (44dp — Apple HIG minimum, WCAG 2.5.5 AAA). */
|
|
17
|
+
export const MIN_TOUCH_TARGET = 44;
|
|
18
|
+
|
|
19
|
+
/** Row height is a direct `minHeight`, not a `hitSlop` expansion — a list row is already its own
|
|
20
|
+
* full-width touch target, the same choice `Select`'s option rows make (`SELECT_ROW_MIN_HEIGHT`). */
|
|
21
|
+
export const MENU_ROW_MIN_HEIGHT = MIN_TOUCH_TARGET;
|
|
22
|
+
|
|
23
|
+
/** The optional leading glyph's size. Fixed — Menu has no `size` prop (unlike Button/Select), since
|
|
24
|
+
* an action list's row height is not a caller-facing choice. */
|
|
25
|
+
export const MENU_ROW_ICON_SIZE = 18;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Maps a row's `tone` onto the theme's ROLE colours — the reason `tone` is a closed union and not a
|
|
29
|
+
* free-form `color` prop. The SAME colour drives both the label and the icon (like Select's active
|
|
30
|
+
* row): if the label clears the stricter 4.5:1 text minimum on the sheet fill, the icon clears its
|
|
31
|
+
* 3:1 non-text minimum for free.
|
|
32
|
+
*/
|
|
33
|
+
export function resolveMenuItemColor(colors, tone) {
|
|
34
|
+
switch (tone) {
|
|
35
|
+
case "danger":
|
|
36
|
+
return colors.status.danger.text;
|
|
37
|
+
case "default":
|
|
38
|
+
return colors.fg.default;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Structural styles only — layout, padding, radius, border WIDTH. No colours (those are resolved
|
|
44
|
+
* from `RoleColors` and applied inline), so this compiles once per theme identity via the themed
|
|
45
|
+
* resolver and never rebuilds per render.
|
|
46
|
+
*
|
|
47
|
+
* `justifyContent: "center"` mirrors Select's full-screen overlay + centered sheet — the same
|
|
48
|
+
* "transient overlay in RN's own Modal" pattern Select already established. See the "Known gaps"
|
|
49
|
+
* section of MODULE.md for why this is a centered sheet rather than a true measured anchor.
|
|
50
|
+
*/
|
|
51
|
+
export const menuOverlayStructure = createThemedVariants(theme => ({
|
|
52
|
+
base: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
justifyContent: "center",
|
|
55
|
+
paddingHorizontal: theme.space[6]
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
export const menuSheetStructure = createThemedVariants(theme => ({
|
|
59
|
+
base: {
|
|
60
|
+
borderRadius: theme.radii.base,
|
|
61
|
+
paddingVertical: theme.space[2],
|
|
62
|
+
maxHeight: 320,
|
|
63
|
+
...theme.elevation.lg
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
export const menuRowStructure = createThemedVariants(theme => ({
|
|
67
|
+
base: {
|
|
68
|
+
flexDirection: "row",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
minHeight: MENU_ROW_MIN_HEIGHT,
|
|
71
|
+
columnGap: theme.space[2],
|
|
72
|
+
paddingHorizontal: theme.space[4]
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
//# sourceMappingURL=Menu.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createThemedVariants","MIN_TOUCH_TARGET","MENU_ROW_MIN_HEIGHT","MENU_ROW_ICON_SIZE","resolveMenuItemColor","colors","tone","status","danger","text","fg","default","menuOverlayStructure","theme","base","flex","justifyContent","paddingHorizontal","space","menuSheetStructure","borderRadius","radii","paddingVertical","maxHeight","elevation","lg","menuRowStructure","flexDirection","alignItems","minHeight","columnGap"],"sourceRoot":"../../../../src","sources":["modules/menu/Menu.variants.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,oBAAoB,QAAQ,2BAAkB;AAIvD;AACA,OAAO,MAAMC,gBAAgB,GAAG,EAAE;;AAElC;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAGD,gBAAgB;;AAEnD;AACA;AACA,OAAO,MAAME,kBAAkB,GAAG,EAAE;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAACC,MAAkB,EAAEC,IAAkB,EAAU;EACnF,QAAQA,IAAI;IACV,KAAK,QAAQ;MACX,OAAOD,MAAM,CAACE,MAAM,CAACC,MAAM,CAACC,IAAI;IAClC,KAAK,SAAS;MACZ,OAAOJ,MAAM,CAACK,EAAE,CAACC,OAAO;EAC5B;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAGZ,oBAAoB,CAAEa,KAAY,KAAM;EAC1EC,IAAI,EAAE;IACJC,IAAI,EAAE,CAAC;IACPC,cAAc,EAAE,QAAQ;IACxBC,iBAAiB,EAAEJ,KAAK,CAACK,KAAK,CAAC,CAAC;EAClC;AACF,CAAC,CAAC,CAAC;AAEH,OAAO,MAAMC,kBAAkB,GAAGnB,oBAAoB,CAAEa,KAAY,KAAM;EACxEC,IAAI,EAAE;IACJM,YAAY,EAAEP,KAAK,CAACQ,KAAK,CAACP,IAAI;IAC9BQ,eAAe,EAAET,KAAK,CAACK,KAAK,CAAC,CAAC,CAAC;IAC/BK,SAAS,EAAE,GAAG;IACd,GAAGV,KAAK,CAACW,SAAS,CAACC;EACrB;AACF,CAAC,CAAC,CAAC;AAEH,OAAO,MAAMC,gBAAgB,GAAG1B,oBAAoB,CAAEa,KAAY,KAAM;EACtEC,IAAI,EAAE;IACJa,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE3B,mBAAmB;IAC9B4B,SAAS,EAAEjB,KAAK,CAACK,KAAK,CAAC,CAAC,CAAC;IACzBD,iBAAiB,EAAEJ,KAAK,CAACK,KAAK,CAAC,CAAC;EAClC;AACF,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `pixelize-native-library/menu`. Value exports and type exports are split for
|
|
5
|
+
* `verbatimModuleSyntax`. The resolvers (`resolveMenuItemColor`, `MENU_ROW_ICON_SIZE`, …) stay
|
|
6
|
+
* internal — a consumer configures a Menu through its props, never by importing its internals.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { Menu } from "./Menu.js";
|
|
10
|
+
|
|
11
|
+
// Re-exported so a caller can type an item's `icon` prop without a separate import from `core/icon`.
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Menu"],"sourceRoot":"../../../../src","sources":["modules/menu/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,WAAQ;;AAK7B","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# modal/ — the library's own dialog, built on React Native's `Modal`
|
|
2
|
+
|
|
3
|
+
`Modal` wraps React Native's own `<Modal>` (`transparent`, faded in unless the OS has reduced
|
|
4
|
+
motion on) with a dismissible backdrop scrim and a themed panel — `bg.surface`, `theme.radii.lg`,
|
|
5
|
+
`theme.elevation.lg` — capped to one of three closed widths. It is fully controlled: the caller
|
|
6
|
+
owns `visible` and reacts to `onRequestClose` (backdrop press, Android back button, iOS
|
|
7
|
+
VoiceOver's escape gesture via `onAccessibilityEscape`).
|
|
8
|
+
|
|
9
|
+
## Files
|
|
10
|
+
|
|
11
|
+
| File | Role |
|
|
12
|
+
|------|------|
|
|
13
|
+
| `Modal.tsx` | The component. RN `<Modal>` composition, backdrop, overlay, panel, title. Falls back to the web portal mechanism below when opted in. |
|
|
14
|
+
| `Modal.variants.ts` | Pure resolvers (`MODAL_SIZES`, `resolveModalPanelColors`, `resolveModalAnimationType`) + the themed structural resolvers (`modalOverlayStructure`, `modalPanelStructure`). No React, no lucide. Untouched by the web portal mechanism — see below. |
|
|
15
|
+
| `ModalPortalContext.ts` | The web-only portal-container `React.Context<unknown>`, default `null`. Read by `Modal`, `Select`, `MultiSelect`, and `Menu`. |
|
|
16
|
+
| `ModalPortalProvider.tsx` | Public provider wrapping `ModalPortalContext.Provider`. A consumer's opt-in API. |
|
|
17
|
+
| `renderWebPortal.ts` / `renderWebPortal.web.ts` | The platform-split portal renderer — see "Web portal mechanism" below. |
|
|
18
|
+
| `index.ts` | Public surface: `Modal`, `ModalProps`, `ModalSize`, `ModalPortalProvider`, `ModalPortalProviderProps`. |
|
|
19
|
+
| `__tests__/Modal.test.ts` | Pure: WCAG contrast (all brands × modes), size-cap sanity, reduced-motion contract. |
|
|
20
|
+
| `__tests__/Modal.render.test.tsx` | Render: visibility, title semantics, backdrop dismissal, and the web-portal opt-in branch (mocking `renderWebPortal`). |
|
|
21
|
+
| `__tests__/ModalPortalProvider.test.tsx` | The provider forwards `container` onto `ModalPortalContext`; an unwrapped tree reads the `null` default. |
|
|
22
|
+
| `__tests__/renderWebPortal.test.ts` / `renderWebPortal.web.test.ts` | Each platform file in isolation — the native file is always a no-op; the web file calls `ReactDOM.createPortal` with the exact children/container (mocked — no real DOM under Jest). |
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
| Prop | Type | Default | Notes |
|
|
27
|
+
|------|------|---------|-------|
|
|
28
|
+
| `visible` | `boolean` | — | Required. Fully controlled — no internal open state. |
|
|
29
|
+
| `onRequestClose` | `() => void` | — | Required. Fired by the backdrop press, Android hardware back, and iOS VoiceOver's escape gesture (`onAccessibilityEscape` on the panel). |
|
|
30
|
+
| `title` | `string` | — | Optional heading, rendered `accessibilityRole="header"`. |
|
|
31
|
+
| `children` | `ReactNode` | — | Required. Panel content. |
|
|
32
|
+
| `size` | `sm \| md \| lg` | `md` | Closed union — panel max width, reusing the shared `sizes` primitive (384/448/512dp). |
|
|
33
|
+
| `testID` | `string` | — | Also seeds `${testID}-backdrop` and `${testID}-panel`. |
|
|
34
|
+
|
|
35
|
+
No `style`/`containerStyle` — see "Why no `style`" below.
|
|
36
|
+
|
|
37
|
+
## Accessibility contract (WCAG)
|
|
38
|
+
|
|
39
|
+
- **iOS modal context** — the panel sets `accessibilityViewIsModal`, so VoiceOver constrains
|
|
40
|
+
navigation to the dialog's content while it's open.
|
|
41
|
+
- **1.4.3** — the title is measured ≥ 4.5:1 against the panel fill (`bg.surface`) for every brand ×
|
|
42
|
+
mode via `resolveModalPanelColors`.
|
|
43
|
+
- **2.3.3** — `resolveModalAnimationType(reducedMotion)` returns `"none"` instead of `"fade"` when
|
|
44
|
+
the OS reduce-motion setting is on.
|
|
45
|
+
- The title is `accessibilityRole="header"`, giving it heading semantics for screen readers.
|
|
46
|
+
- The backdrop is `accessible={false}` — a decorative dismiss target, not a focusable element (same
|
|
47
|
+
treatment as `Select`'s backdrop). It is never the *only* way to close: Android hardware back also
|
|
48
|
+
fires `onRequestClose`, and the panel's `onAccessibilityEscape={onRequestClose}` gives iOS
|
|
49
|
+
VoiceOver users a real two-finger-Z "escape" gesture to dismiss without hunting for the invisible
|
|
50
|
+
backdrop. (RN's `<Modal>` only treats a swipe as a dismiss when `allowSwipeDismissal` is passed —
|
|
51
|
+
this component doesn't set it — and `transparent` with no `presentationStyle` forces
|
|
52
|
+
`overFullScreen`, which has no native iOS swipe-to-dismiss gesture at all; `onAccessibilityEscape`
|
|
53
|
+
is the real, working native hook here, not a swipe.)
|
|
54
|
+
- No touch-target sizing needed: the only interactive surface is the full-screen backdrop, already
|
|
55
|
+
far larger than the 44dp floor.
|
|
56
|
+
|
|
57
|
+
## Why no `style`
|
|
58
|
+
|
|
59
|
+
Every other module's `style: LayoutStyle` places the component within a *parent's* layout flow
|
|
60
|
+
(margin, flex, alignSelf). `Modal` is presented through RN's own portal — there is no parent flow
|
|
61
|
+
to place it in, and its one real sizing lever (panel width) is already the closed `size` union. The
|
|
62
|
+
component spec omits `style` rather than including it as an unused escape hatch.
|
|
63
|
+
|
|
64
|
+
## Web portal mechanism (opt-in)
|
|
65
|
+
|
|
66
|
+
`react-native-web`'s own `<Modal>` unconditionally portals to `document.body`
|
|
67
|
+
(`ModalPortal.js` in the installed 0.21.2 does `document.body.appendChild(...)` then
|
|
68
|
+
`createPortal(children, elementRef.current)` — no `container`/`portalHost` prop exists to
|
|
69
|
+
override it, confirmed by reading the source). That's correct for a full app, but breaks visual
|
|
70
|
+
containment inside a fixed-size preview frame (`example/DeviceFrame.tsx`'s 390px phone card): the
|
|
71
|
+
overlay renders full-browser-viewport instead of clipped to the frame. Same problem, same fix, for
|
|
72
|
+
`Select`'s option sheet, `MultiSelect`'s option sheet, and `Menu`'s action sheet — all three render
|
|
73
|
+
their own RN `<Modal>` directly (never this module's `Modal` component) and read the identical
|
|
74
|
+
mechanism below.
|
|
75
|
+
|
|
76
|
+
- **`ModalPortalContext`** — a `React.Context<unknown>`, default `null`. `unknown` because this
|
|
77
|
+
package has no `"dom"` lib entry (native has no DOM) — a `HTMLElement` type here wouldn't
|
|
78
|
+
compile. Internal; a consumer never reads it directly.
|
|
79
|
+
- **`ModalPortalProvider`** — the public opt-in. `<ModalPortalProvider container={node}>` makes
|
|
80
|
+
every `Modal` / `AlertDialog` / `Select` / `MultiSelect` / `Menu` underneath portal into `node`
|
|
81
|
+
instead of `document.body`. Safe to mount unconditionally on every platform — there's no DOM to
|
|
82
|
+
portal into outside web, so `container` is simply never read off the context there.
|
|
83
|
+
- **`renderWebPortal.ts` (base) / `renderWebPortal.web.ts` (web)** — a Metro platform-extension
|
|
84
|
+
pair, same idea as `theme/platform/*.native.ts` but the other direction: the BASE file (no
|
|
85
|
+
suffix) is the safe default every platform except an actual web bundle resolves to (a pure
|
|
86
|
+
no-op — always returns `null`), and `renderWebPortal.web.ts` (the only file that imports
|
|
87
|
+
`react-dom`) is what an actual web bundle resolves to instead. Metro never resolves
|
|
88
|
+
`react-dom` for a native bundle, so it's never part of that dependency graph — verified via
|
|
89
|
+
`expo export --platform ios` vs `--platform web`, grepping each bundle for a marker string
|
|
90
|
+
unique to each file. Jest's `react-native` preset has no `web` haste platform either, so every
|
|
91
|
+
test also resolves the base file by default — this is why `Modal.render.test.tsx` /
|
|
92
|
+
`Select.render.test.tsx` / `MultiSelect.render.test.tsx` / `Menu.render.test.tsx` mock
|
|
93
|
+
`renderWebPortal` directly to exercise the opt-in branch, and `renderWebPortal.web.test.ts` is the
|
|
94
|
+
one place the real `ReactDOM.createPortal` call is verified (mocking `react-dom` itself — no real
|
|
95
|
+
DOM under Jest).
|
|
96
|
+
- **Backward compatibility (the hard bar):** `Platform.OS === "web" && portalContainer != null`
|
|
97
|
+
gates the whole mechanism — every existing consumer (native, or web with no provider) takes the
|
|
98
|
+
exact same code path as before this mechanism existed: RN's own `<Modal>`, untouched. Neither
|
|
99
|
+
`Modal.variants.ts` nor `Select.variants.ts`/`MultiSelect.variants.ts`/`Menu.variants.ts`'s
|
|
100
|
+
structural resolvers were touched — the portal path reproduces just the sizing RN's `<Modal>`
|
|
101
|
+
otherwise supplies (a `StyleSheet.absoluteFill` wrapper around the SAME backdrop+panel tree)
|
|
102
|
+
rather than changing the shared resolvers, so the default path's styles are provably unaffected.
|
|
103
|
+
- **Known simplification:** the portal path skips RN `<Modal>`'s open/close animation entirely
|
|
104
|
+
(mounts/unmounts on `visible`/`open` directly) — `resolveModalAnimationType`/reduced-motion only
|
|
105
|
+
apply to the RNModal path. Acceptable: the goal is containment, not animation fidelity, and this
|
|
106
|
+
only affects a consumer that has opted in.
|
|
107
|
+
- `react-dom` is an **optional peer dependency** (`peerDependenciesMeta.react-dom.optional`) —
|
|
108
|
+
only needed by an app that actually renders for web; native-only consumers never install it.
|
|
109
|
+
|
|
110
|
+
## Patterns copied from Button / Select (the reference modules)
|
|
111
|
+
|
|
112
|
+
1. **Structure vs colour split** — sizing/spacing/radius via `createThemedVariants`; colour
|
|
113
|
+
resolved from `RoleColors`, applied inline.
|
|
114
|
+
2. **Pure, testable resolvers** in `Modal.variants.ts` — WCAG contrast and the reduced-motion
|
|
115
|
+
contract are unit-tested against real palettes, never eyeballed.
|
|
116
|
+
3. **RN's own `<Modal>`, not a hand-rolled portal** — `transparent` + backdrop `Pressable` +
|
|
117
|
+
`pointerEvents="box-none"` overlay, the same shape `Select`'s option list uses (converged on
|
|
118
|
+
independently — this module owns none of that code, built in parallel).
|
|
119
|
+
4. **Closed `size` union** reusing the shared `sizes` primitive (384/448/512dp) instead of
|
|
120
|
+
Modal-local numbers — `theme/tokens/primitives/sizes.ts` is documented for exactly this case.
|
|
121
|
+
|
|
122
|
+
## Known gaps
|
|
123
|
+
|
|
124
|
+
- **No full focus trap.** iOS gets `accessibilityViewIsModal` (constrains VoiceOver to the panel).
|
|
125
|
+
Android has no JS-level equivalent for marking background siblings
|
|
126
|
+
`importantForAccessibility="no-hide-descendants"` from inside this component (that prop applies
|
|
127
|
+
to the element it's set on, not to arbitrary siblings elsewhere in the tree) — a full Android
|
|
128
|
+
focus trap needs the app root to cooperate. Out of scope for v1.
|
|
129
|
+
- **No built-in scrolling.** The panel caps at `maxHeight: "92%"` but does not wrap `children` in a
|
|
130
|
+
`ScrollView` — forcing one risks nested-`VirtualizedList` warnings if a consumer's content is
|
|
131
|
+
already scrollable. Tall content is the consumer's own `ScrollView`/`FlatList` to add.
|
|
132
|
+
- No close ("×") button — not in this module's prop contract; dismissal is backdrop press, Android
|
|
133
|
+
back, or iOS VoiceOver's escape gesture. A consumer wanting an explicit close control renders its
|
|
134
|
+
own `Button` (`icon="x"`) inside `children`.
|
|
135
|
+
|
|
136
|
+
## Performance
|
|
137
|
+
|
|
138
|
+
Both `Modal` and `ModalPortalProvider` are wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`). `Modal.tsx` has no `.map()` lists and no library child components (only RN host elements); `ModalPortalProvider` just passes `container`/`children` into a `Context.Provider` — nothing to memoize in either.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Modal — the library's own dialog, built ON TOP of React Native's `<Modal>` (`transparent`,
|
|
5
|
+
* `animationType` "fade" unless the OS has reduced motion on, in which case "none"). A full-screen
|
|
6
|
+
* backdrop scrim dismisses it on press; the panel sits on `bg.surface` with `theme.radii.lg` and
|
|
7
|
+
* `theme.elevation.lg`, capped to one of three closed widths (`size`).
|
|
8
|
+
*
|
|
9
|
+
* Fully controlled: the caller owns `visible` and reacts to `onRequestClose`, which fires from the
|
|
10
|
+
* backdrop press, the Android hardware back button, and — via `onAccessibilityEscape` on the panel
|
|
11
|
+
* — iOS VoiceOver's two-finger-Z escape gesture. (RN's `<Modal>` only fires `onRequestClose` from a
|
|
12
|
+
* swipe when `allowSwipeDismissal` is passed, which this component doesn't set, and `transparent`
|
|
13
|
+
* with no `presentationStyle` forces `overFullScreen`, which has no native swipe-to-dismiss gesture
|
|
14
|
+
* on iOS at all — so the VoiceOver escape hook is the real iOS-native path here, not a swipe.)
|
|
15
|
+
* Never from an internal open/close state.
|
|
16
|
+
*
|
|
17
|
+
* Web portal opt-in: when an ancestor renders `ModalPortalProvider` (web only), this bypasses RN's
|
|
18
|
+
* `<Modal>` and portals the SAME backdrop+panel tree into the provided container via
|
|
19
|
+
* `renderWebPortal` instead — see `ModalPortalContext.ts` for why. Every other case (native, or web
|
|
20
|
+
* with no provider — the default `ModalPortalContext` value is `null`) renders through RN's own
|
|
21
|
+
* `<Modal>`, byte-identical to before this mechanism existed.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { memo, useContext } from "react";
|
|
25
|
+
import { Modal as RNModal, Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
26
|
+
import { useReducedMotion } from "../../core/a11y/index.js";
|
|
27
|
+
import { useTheme } from "../../theme/index.js";
|
|
28
|
+
import { ModalPortalContext } from "./ModalPortalContext.js";
|
|
29
|
+
import { renderWebPortal } from "./renderWebPortal";
|
|
30
|
+
import { modalOverlayStructure, modalPanelStructure, resolveModalAnimationType, resolveModalPanelColors } from "./Modal.variants.js";
|
|
31
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
|
+
// Decorative dismiss scrim behind the panel — a design constant, not a role token: it is neither
|
|
33
|
+
// text nor an interactive boundary, so WCAG's contrast minimums don't apply to it. Same
|
|
34
|
+
// justification as Button's PRESS_SCRIM_DARK/LIGHT and Select's BACKDROP_SCRIM.
|
|
35
|
+
const MODAL_BACKDROP = "#00000080";
|
|
36
|
+
export const Modal = /*#__PURE__*/memo(function Modal({
|
|
37
|
+
visible,
|
|
38
|
+
onRequestClose,
|
|
39
|
+
title,
|
|
40
|
+
children,
|
|
41
|
+
size = "md",
|
|
42
|
+
testID
|
|
43
|
+
}) {
|
|
44
|
+
const theme = useTheme();
|
|
45
|
+
const reducedMotion = useReducedMotion();
|
|
46
|
+
const panelColors = resolveModalPanelColors(theme.colors);
|
|
47
|
+
const portalContainer = useContext(ModalPortalContext);
|
|
48
|
+
const overlay = /*#__PURE__*/_jsxs(_Fragment, {
|
|
49
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
50
|
+
testID: testID ? `${testID}-backdrop` : undefined,
|
|
51
|
+
accessible: false,
|
|
52
|
+
style: [StyleSheet.absoluteFill, {
|
|
53
|
+
backgroundColor: MODAL_BACKDROP
|
|
54
|
+
}],
|
|
55
|
+
onPress: onRequestClose
|
|
56
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
57
|
+
style: modalOverlayStructure(theme),
|
|
58
|
+
pointerEvents: "box-none",
|
|
59
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
60
|
+
testID: testID ? `${testID}-panel` : undefined,
|
|
61
|
+
accessibilityViewIsModal: true,
|
|
62
|
+
onAccessibilityEscape: onRequestClose,
|
|
63
|
+
style: [modalPanelStructure(theme, {
|
|
64
|
+
size
|
|
65
|
+
}), {
|
|
66
|
+
backgroundColor: panelColors.background
|
|
67
|
+
}],
|
|
68
|
+
children: [title !== undefined && /*#__PURE__*/_jsx(Text, {
|
|
69
|
+
accessibilityRole: "header",
|
|
70
|
+
style: [theme.fontStyleForWeight(theme.fontWeights.semibold), {
|
|
71
|
+
fontSize: theme.fontSizes.lg,
|
|
72
|
+
color: panelColors.title,
|
|
73
|
+
marginBottom: theme.space[3]
|
|
74
|
+
}],
|
|
75
|
+
children: title
|
|
76
|
+
}), children]
|
|
77
|
+
})
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
if (Platform.OS === "web" && portalContainer != null) {
|
|
81
|
+
if (!visible) return null;
|
|
82
|
+
// RN's own <Modal> supplies a `position: fixed`/full-screen ancestor for `overlay`'s children
|
|
83
|
+
// to size against (see ModalPortalContext.ts) — reproduce just that sizing here (never touching
|
|
84
|
+
// the shared `modalOverlayStructure`/`modalPanelStructure` resolvers the RNModal path below
|
|
85
|
+
// still uses untouched) so the same tree fills `portalContainer`'s bounds instead of the
|
|
86
|
+
// viewport.
|
|
87
|
+
return renderWebPortal(/*#__PURE__*/_jsx(View, {
|
|
88
|
+
style: StyleSheet.absoluteFill,
|
|
89
|
+
pointerEvents: "box-none",
|
|
90
|
+
children: overlay
|
|
91
|
+
}), portalContainer);
|
|
92
|
+
}
|
|
93
|
+
return /*#__PURE__*/_jsx(RNModal, {
|
|
94
|
+
visible: visible,
|
|
95
|
+
transparent: true,
|
|
96
|
+
animationType: resolveModalAnimationType(reducedMotion),
|
|
97
|
+
onRequestClose: onRequestClose,
|
|
98
|
+
children: overlay
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=Modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","useContext","Modal","RNModal","Platform","Pressable","StyleSheet","Text","View","useReducedMotion","useTheme","ModalPortalContext","renderWebPortal","modalOverlayStructure","modalPanelStructure","resolveModalAnimationType","resolveModalPanelColors","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MODAL_BACKDROP","visible","onRequestClose","title","children","size","testID","theme","reducedMotion","panelColors","colors","portalContainer","overlay","undefined","accessible","style","absoluteFill","backgroundColor","onPress","pointerEvents","accessibilityViewIsModal","onAccessibilityEscape","background","accessibilityRole","fontStyleForWeight","fontWeights","semibold","fontSize","fontSizes","lg","color","marginBottom","space","OS","transparent","animationType"],"sourceRoot":"../../../../src","sources":["modules/modal/Modal.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,EAAEC,UAAU,QAAQ,OAAO;AACxC,SAASC,KAAK,IAAIC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAE5F,SAASC,gBAAgB,QAAQ,0BAAiB;AAClD,SAASC,QAAQ,QAAQ,sBAAa;AAEtC,SAASC,kBAAkB,QAAQ,yBAAsB;AACzD,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SACEC,qBAAqB,EACrBC,mBAAmB,EACn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