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
|
+
# button/ — the reference component
|
|
2
|
+
|
|
3
|
+
`Button` is the most-repeated shape in the audited apps (81 raw `TouchableOpacity` in crm-mobile,
|
|
4
|
+
**155** in ecommerce-mobile — with three different style-key sets for the *same* add-to-cart button —
|
|
5
|
+
and 195 web usages). It is also the **reference module**: the other 16 components copy its structure.
|
|
6
|
+
|
|
7
|
+
## Files
|
|
8
|
+
|
|
9
|
+
| File | Role |
|
|
10
|
+
|------|------|
|
|
11
|
+
| `Button.tsx` | The component. Composition, a11y wiring, press feedback, focus ring, loading/disabled. |
|
|
12
|
+
| `Button.variants.ts` | Pure resolvers (`BUTTON_SIZES`, `resolveButtonTone`, `resolveButtonAccessibility`) + the themed structural variant resolver `buttonStructure`. No React, no lucide. |
|
|
13
|
+
| `index.ts` | Public surface: `Button`, `ButtonProps`, the closed unions, `IconName` (re-exported from `core/icon`). |
|
|
14
|
+
| `__tests__/Button.test.ts` | Pure: WCAG contrast (all brands × modes) + touch target + a11y contract. |
|
|
15
|
+
| `__tests__/Button.render.test.tsx` | Render: variants, press blocking, busy, icon-only name. |
|
|
16
|
+
|
|
17
|
+
## Props
|
|
18
|
+
|
|
19
|
+
| Prop | Type | Default | Notes |
|
|
20
|
+
|------|------|---------|-------|
|
|
21
|
+
| `variant` | `solid \| outline \| ghost \| link` | `solid` | Closed union. |
|
|
22
|
+
| `size` | `sm \| md \| lg` | `md` | 32 / 40 / 48 dp; short sizes reach 44 via `hitSlop`. |
|
|
23
|
+
| `tone` | `accent \| neutral \| danger` | `accent` | Closed union — see below. |
|
|
24
|
+
| `label` | `string` | — | Required unless icon-only. |
|
|
25
|
+
| `icon` | `IconName` | — | A NAME, never a `ReactNode`. Deep-imported lucide glyph. |
|
|
26
|
+
| `iconPosition` | `leading \| trailing` | `leading` | |
|
|
27
|
+
| `loading` | `boolean` | `false` | Spinner + `busy`; blocks press. |
|
|
28
|
+
| `disabled` | `boolean` | `false` | Dimmed; blocks press. |
|
|
29
|
+
| `fullWidth` | `boolean` | `false` | `alignSelf: stretch`. |
|
|
30
|
+
| `onPress` | `() => void` | — | Gated off while disabled/loading. |
|
|
31
|
+
| `accessibilityLabel` | `string` | `label` | **Required** when icon-only (type-enforced). |
|
|
32
|
+
| `style` | `LayoutStyle` | — | Layout-only, outermost, applied exactly once, last. |
|
|
33
|
+
|
|
34
|
+
`ButtonProps` is a discriminated union: a labelled button OR an icon-only button (`label?: never` +
|
|
35
|
+
required `accessibilityLabel`). It is impossible to ship an unlabelled icon button — web's single
|
|
36
|
+
worst a11y trap (its tooltip was the only label on icon-only buttons in 22 files; tooltips don't
|
|
37
|
+
exist on touch).
|
|
38
|
+
|
|
39
|
+
## Accessibility contract (WCAG)
|
|
40
|
+
|
|
41
|
+
- **2.5.x target size** — every size reaches ≥ 44 dp; short sizes keep their height and grow the
|
|
42
|
+
touch area with `hitSlop`. The target grows, the control never shrinks.
|
|
43
|
+
- **1.4.3** — the label uses the DERIVED `accent.onSolid` / `status.*.onSolid` (the label lives with
|
|
44
|
+
its fill), never a hardcoded white. Measured ≥ 4.5:1 for every tone × variant × brand × mode.
|
|
45
|
+
- **1.4.11** — the outline boundary is `border.interactive` (≥ 3:1), never the decorative
|
|
46
|
+
`border.default`.
|
|
47
|
+
- **2.4.7 / 2.4.11** — a visible focus ring (`border.focus`) appears on keyboard / external-keyboard /
|
|
48
|
+
AT focus (`onFocus`/`onBlur`). It sits a small gap OUTSIDE the control, on the canvas, because
|
|
49
|
+
`border.focus` is the role token proven ≥ 3:1 against the canvas (over a solid fill it could fail).
|
|
50
|
+
- **1.4.1** — `loading` is announced via `accessibilityState.busy`, not conveyed by the spinner alone
|
|
51
|
+
(the label stays visible; the spinner is hidden from AT).
|
|
52
|
+
- **2.3.3** — the press fade is suppressed when the OS reduce-motion setting is on.
|
|
53
|
+
- `accessibilityRole="button"`, `accessibilityState` for disabled/busy, `accessibilityLabel ?? label`.
|
|
54
|
+
|
|
55
|
+
## Why `tone` is a union, not a `color`
|
|
56
|
+
|
|
57
|
+
A `color?: string` prop hands the token system back to the app — the exact regression that put 618
|
|
58
|
+
hardcoded hexes across 171 colours into crm-mobile. `tone` maps to ROLE colours
|
|
59
|
+
(`resolveButtonTone`), so every colour a button can show is guaranteed legible in both modes and can
|
|
60
|
+
never be an off-palette value. `neutral` is monochrome high-emphasis (`fg.default` fill, `bg.canvas`
|
|
61
|
+
label); `accent`/`danger` map to the accent and danger roles.
|
|
62
|
+
|
|
63
|
+
## Patterns the other 16 must copy
|
|
64
|
+
|
|
65
|
+
1. **Structure vs colour split.** Static/theme-numeric structure (height, padding, radius, border
|
|
66
|
+
*width*) → `createThemedVariants` (registered once per theme). Colour → resolved from role tokens
|
|
67
|
+
per `tone`, applied inline. Press → one animated state-layer overlay; focus → one `border.focus`
|
|
68
|
+
ring offset onto the canvas (never over the fill, where its ≥ 3:1 isn't guaranteed).
|
|
69
|
+
2. **Pure, testable resolvers** in `*.variants.ts` (no React/lucide) so the WCAG + behaviour contract
|
|
70
|
+
is unit-tested by measuring real palettes — never eyeballed.
|
|
71
|
+
3. **Closed unions only** (`variant`/`size`/`tone`), `icon` as a NAME, `style: LayoutStyle` last and
|
|
72
|
+
once, no `{...rest}`, internals never receive consumer style.
|
|
73
|
+
4. **Type-enforced a11y** — make the unlabelled-icon-button state unrepresentable.
|
|
74
|
+
|
|
75
|
+
## Known gaps
|
|
76
|
+
|
|
77
|
+
- Render tests need `@testing-library/react-native` + a react-native jest preset (dependency-pending).
|
|
78
|
+
|
|
79
|
+
## Resolved (were orchestrator flags, now done)
|
|
80
|
+
|
|
81
|
+
- Icon plumbing hoisted to `src/core/icon/` (deps `lucide-react-native` + `react-native-svg` added
|
|
82
|
+
as optional peers); `Button.tsx` and `index.ts` import from there.
|
|
83
|
+
- `useReducedMotion` hoisted to `src/core/a11y/`.
|
|
84
|
+
|
|
85
|
+
## Performance
|
|
86
|
+
|
|
87
|
+
Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`) — renamed to `ButtonImpl` internally, exported as `Button = memo(ButtonImpl)`. Its one child, `Icon`, only ever receives primitives — nothing to memoize.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `pixelize-native-library/button`. Value exports and type exports are split for
|
|
5
|
+
* `verbatimModuleSyntax`. The visual/behaviour resolvers (`resolveButtonTone`, `BUTTON_SIZES`, …)
|
|
6
|
+
* stay internal — a consumer configures a Button through its props, never by importing its internals.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { Button } from "./Button.js";
|
|
10
|
+
|
|
11
|
+
// Re-exported so a caller can type an `icon` prop without a separate import from `core/icon`.
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Button"],"sourceRoot":"../../../../src","sources":["modules/button/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,aAAU;;AAKjC","ignoreList":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ButtonGroup — a segmented single-choice control. Visually connected segments sharing one outer
|
|
5
|
+
* border and a divider line between adjacent segments, NOT a row of standalone `Button`s — that
|
|
6
|
+
* connected/segmented treatment is a different structural shape than Button's own pill/rect
|
|
7
|
+
* variants, so this is a standalone sibling (it never imports `../button`). The border/divider is
|
|
8
|
+
* drawn PER SEGMENT, not once on the container: every edge that touches the selected segment omits
|
|
9
|
+
* the stroke (see `resolveButtonGroupSegmentEdgeColors` — WCAG 1.4.11) and relies on the selected
|
|
10
|
+
* fill's own contrast against the canvas instead.
|
|
11
|
+
*
|
|
12
|
+
* One component owns the whole group, same as `RadioGroup`: each segment carries its own
|
|
13
|
+
* `accessibilityRole="radio"` + `accessibilityState.checked`, and the container carries
|
|
14
|
+
* `accessibilityRole="radiogroup"` so assistive tech announces the grouping without collapsing the
|
|
15
|
+
* individually-focusable segments into one.
|
|
16
|
+
*
|
|
17
|
+
* No animation anywhere (selection is a conditional fill, not a slide or a fade), so — like
|
|
18
|
+
* `RadioGroup` — there is nothing here for `useReducedMotion` (WCAG 2.3.3) to gate.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { memo } from "react";
|
|
22
|
+
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
23
|
+
import { useTheme } from "../../theme/index.js";
|
|
24
|
+
import { BUTTON_GROUP_SIZES, buttonGroupSegmentStructure, buttonGroupStructure, resolveButtonGroupColors, resolveButtonGroupSegmentAccessibility, resolveButtonGroupSegmentEdgeColors, resolveButtonGroupSegmentHitSlop } from "./ButtonGroup.variants.js";
|
|
25
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
function ButtonGroupImpl({
|
|
27
|
+
options,
|
|
28
|
+
value,
|
|
29
|
+
onValueChange,
|
|
30
|
+
size = "md",
|
|
31
|
+
disabled = false,
|
|
32
|
+
style,
|
|
33
|
+
testID
|
|
34
|
+
}) {
|
|
35
|
+
const theme = useTheme();
|
|
36
|
+
const colors = resolveButtonGroupColors(theme.colors);
|
|
37
|
+
const fontSize = BUTTON_GROUP_SIZES[size].fontSize;
|
|
38
|
+
const lastIndex = options.length - 1;
|
|
39
|
+
return /*#__PURE__*/_jsx(View, {
|
|
40
|
+
testID: testID,
|
|
41
|
+
accessibilityRole: "radiogroup",
|
|
42
|
+
style: [buttonGroupStructure(theme), style],
|
|
43
|
+
children: options.map((option, index) => {
|
|
44
|
+
const selected = option.value === value;
|
|
45
|
+
const isFirst = index === 0;
|
|
46
|
+
const isLast = index === lastIndex;
|
|
47
|
+
const nextSelected = !isLast && options[index + 1]?.value === value;
|
|
48
|
+
const a11y = resolveButtonGroupSegmentAccessibility({
|
|
49
|
+
selected,
|
|
50
|
+
disabled
|
|
51
|
+
});
|
|
52
|
+
const edges = resolveButtonGroupSegmentEdgeColors(colors, {
|
|
53
|
+
selected,
|
|
54
|
+
nextSelected
|
|
55
|
+
});
|
|
56
|
+
const hitSlop = resolveButtonGroupSegmentHitSlop(size, {
|
|
57
|
+
isFirst,
|
|
58
|
+
isLast
|
|
59
|
+
});
|
|
60
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
61
|
+
testID: testID ? `${testID}-${option.value}` : undefined,
|
|
62
|
+
accessibilityRole: a11y.accessibilityRole,
|
|
63
|
+
accessibilityState: a11y.accessibilityState,
|
|
64
|
+
accessibilityLabel: option.label,
|
|
65
|
+
disabled: a11y.disabled,
|
|
66
|
+
onPress: disabled ? undefined : () => onValueChange(option.value),
|
|
67
|
+
hitSlop: hitSlop,
|
|
68
|
+
style: ({
|
|
69
|
+
pressed
|
|
70
|
+
}) => [buttonGroupSegmentStructure(theme, {
|
|
71
|
+
size,
|
|
72
|
+
first: isFirst ? "on" : "off",
|
|
73
|
+
last: isLast ? "on" : "off"
|
|
74
|
+
}), {
|
|
75
|
+
borderTopColor: edges.top,
|
|
76
|
+
borderBottomColor: edges.bottom,
|
|
77
|
+
borderLeftColor: edges.left,
|
|
78
|
+
borderRightColor: edges.right
|
|
79
|
+
}, selected ? {
|
|
80
|
+
backgroundColor: colors.selectedFill
|
|
81
|
+
} : pressed && !disabled && {
|
|
82
|
+
backgroundColor: colors.pressedFill
|
|
83
|
+
}, disabled && styles.dimmed],
|
|
84
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
85
|
+
numberOfLines: 1,
|
|
86
|
+
style: [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
87
|
+
fontSize,
|
|
88
|
+
color: selected ? colors.onSelectedFill : colors.label
|
|
89
|
+
}],
|
|
90
|
+
children: option.label
|
|
91
|
+
})
|
|
92
|
+
}, option.value);
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const styles = StyleSheet.create({
|
|
97
|
+
// A disabled segment is exempt from the contrast minimum (WCAG 1.4.3), so a uniform dim is correct.
|
|
98
|
+
dimmed: {
|
|
99
|
+
opacity: 0.5
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// A consumer's screen re-renders far more often than ButtonGroup's own props change — memo is
|
|
104
|
+
// near-free insurance for a design-system primitive (see CLAUDE.md "Performance" section).
|
|
105
|
+
export const ButtonGroup = /*#__PURE__*/memo(ButtonGroupImpl);
|
|
106
|
+
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","Pressable","StyleSheet","Text","View","useTheme","BUTTON_GROUP_SIZES","buttonGroupSegmentStructure","buttonGroupStructure","resolveButtonGroupColors","resolveButtonGroupSegmentAccessibility","resolveButtonGroupSegmentEdgeColors","resolveButtonGroupSegmentHitSlop","jsx","_jsx","ButtonGroupImpl","options","value","onValueChange","size","disabled","style","testID","theme","colors","fontSize","lastIndex","length","accessibilityRole","children","map","option","index","selected","isFirst","isLast","nextSelected","a11y","edges","hitSlop","undefined","accessibilityState","accessibilityLabel","label","onPress","pressed","first","last","borderTopColor","top","borderBottomColor","bottom","borderLeftColor","left","borderRightColor","right","backgroundColor","selectedFill","pressedFill","styles","dimmed","numberOfLines","fontStyleForWeight","fontWeights","medium","color","onSelectedFill","create","opacity","ButtonGroup"],"sourceRoot":"../../../../src","sources":["modules/button-group/ButtonGroup.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ButtonGroup's style + behaviour resolution — pure, React/lucide-free, same split as Button:
|
|
5
|
+
* - STRUCTURE (segment height/padding, and — per segment — the top/bottom/left/right border
|
|
6
|
+
* WIDTHS and corner radii) lives in the `createThemedVariants` resolvers below, registered once
|
|
7
|
+
* per (theme, size) — never rebuilt per render.
|
|
8
|
+
* - COLOUR is resolved from the theme's ROLE colours (`resolveButtonGroupColors`), never a raw hex:
|
|
9
|
+
* the selected segment is always the accent role, the shared outline/divider is always the
|
|
10
|
+
* neutral interactive outline (WCAG 1.4.11), same token used by Button's outline border.
|
|
11
|
+
* - `resolveButtonGroupSegmentEdgeColors` decides, PER EDGE OF PER SEGMENT, whether that edge draws
|
|
12
|
+
* the outline/divider stroke at all (see the WCAG 1.4.11 note on `resolveButtonGroupColors`).
|
|
13
|
+
* - `resolveButtonGroupSegmentHitSlop` decides, PER EDGE OF PER SEGMENT, how far the touch target
|
|
14
|
+
* expands (see the touch-target note below `BUTTON_GROUP_SIZES`).
|
|
15
|
+
* - `resolveButtonGroupSegmentAccessibility` derives the per-segment a11y surface purely, mirroring
|
|
16
|
+
* `resolveRadioRowAccessibility` — this is a single-choice value selector, not a set of tabs.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { compositeOver } from "../../theme/tokens/builders/color.js";
|
|
20
|
+
import { createThemedVariants } from "../../core/style/index.js";
|
|
21
|
+
/** Same floor as Button/RadioGroup/Tabs — 44dp (WCAG 2.5.5 / HIG). Duplicated, not imported: modules
|
|
22
|
+
* stay isolated. */
|
|
23
|
+
export const MIN_TOUCH_TARGET = 44;
|
|
24
|
+
const slopFor = height => Math.max(0, Math.ceil((MIN_TOUCH_TARGET - height) / 2));
|
|
25
|
+
/**
|
|
26
|
+
* ButtonGroup-specific dimensions. Kept a plain constant — no theme dependency — so the hit-target
|
|
27
|
+
* test can assert `height + 2·hitSlop ≥ 44` without a provider, same as `BUTTON_SIZES`.
|
|
28
|
+
*/
|
|
29
|
+
export const BUTTON_GROUP_SIZES = {
|
|
30
|
+
sm: {
|
|
31
|
+
height: 32,
|
|
32
|
+
fontSize: 14,
|
|
33
|
+
hitSlop: slopFor(32)
|
|
34
|
+
},
|
|
35
|
+
md: {
|
|
36
|
+
height: 40,
|
|
37
|
+
fontSize: 16,
|
|
38
|
+
hitSlop: slopFor(40)
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
// Fixed-alpha overlay composited onto `bg.sunken`, using `bg.canvas` as the overlay colour — NOT
|
|
42
|
+
// `fg.default` (Skeleton's pulse / Button's press-scrim precedent). `fg.default` was tried first and
|
|
43
|
+
// measured BACKWARDS for this pairing: it exists to read at high contrast against a background, which
|
|
44
|
+
// on every brand × mode puts it in the same luminance neighbourhood `accent.solid` already occupies
|
|
45
|
+
// (dark-on-light in light mode, light-on-dark in dark mode) — compositing it onto `sunken` pulls the
|
|
46
|
+
// result TOWARD `accent.solid`, monotonically lowering contrast at every alpha tried, never raising it.
|
|
47
|
+
// `bg.canvas` is the correct direction because it is already the more extreme background rung in
|
|
48
|
+
// exactly the direction that clears `accent.solid` — lighter than `sunken` in light mode, darker than
|
|
49
|
+
// `sunken` in dark mode — the same relationship this module already relies on for `accent.solid`
|
|
50
|
+
// clearing 3:1 against `bg.canvas` on all 16 brand × mode combinations (see `ButtonGroupColors.outline`
|
|
51
|
+
// above). Nudging `sunken` toward `canvas` moves the boundary pairing toward that already-safe
|
|
52
|
+
// relationship without an `if (dark)` branch. 0x4d / 0xff ≈ 30% — measured (see `ButtonGroup.test.ts`)
|
|
53
|
+
// to clear the worst case (rosewood light, was 2.99:1) to 3.08:1, with every other combination well
|
|
54
|
+
// clear and the unselected label still ≥ 4.5:1 on it (worst case 5.88:1, radiant light).
|
|
55
|
+
const PRESSED_FILL_OVERLAY_ALPHA_HEX = "4d";
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Maps the group's fixed visual roles onto ROLE colours — never a hardcoded hex. There is no
|
|
59
|
+
* per-segment `tone`: the selected fill is always the accent role and the outline is always the
|
|
60
|
+
* neutral interactive outline, so — like `RadioGroup` — this is pure indirection, not a union to
|
|
61
|
+
* resolve.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveButtonGroupColors(colors) {
|
|
64
|
+
return {
|
|
65
|
+
selectedFill: colors.accent.solid,
|
|
66
|
+
onSelectedFill: colors.accent.onSolid,
|
|
67
|
+
label: colors.fg.default,
|
|
68
|
+
// `bg.sunken` (a pale neutral tint), NOT `bg.hover`: measured, `bg.hover`'s saturated mid-tone
|
|
69
|
+
// drops the brand-tinted `fg.default` label below 4.5:1 on several brands — same class of bug
|
|
70
|
+
// Button's "neutral" tone and RadioGroup's pressed row document fixing the same way. Composited
|
|
71
|
+
// with a small `bg.canvas` overlay (see `PRESSED_FILL_OVERLAY_ALPHA_HEX` above) so it also clears
|
|
72
|
+
// 3:1 against `selectedFill` — the boundary a segment adjacent to the selected one actually draws
|
|
73
|
+
// while being pressed.
|
|
74
|
+
pressedFill: compositeOver(`${colors.bg.canvas}${PRESSED_FILL_OVERLAY_ALPHA_HEX}`, colors.bg.sunken),
|
|
75
|
+
outline: colors.border.interactive
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The value RN treats as "draw nothing" for a border edge — 0 width would also work, but keeping
|
|
80
|
+
* the WIDTH constant (see `buttonGroupSegmentStructure`) and only swapping the COLOUR avoids a
|
|
81
|
+
* layout shift when a segment's selection changes. */
|
|
82
|
+
const OMITTED_EDGE = "transparent";
|
|
83
|
+
/**
|
|
84
|
+
* Per-edge, per-segment outline colour — the WCAG 1.4.11 fix. An edge draws the shared `outline`
|
|
85
|
+
* colour only when BOTH sides of it are unselected; any edge touching the selected segment is
|
|
86
|
+
* `transparent` instead, so the selected fill's own contrast against the canvas (or, for the
|
|
87
|
+
* divider case, against the neighbour's transparent/canvas background) is what marks the boundary.
|
|
88
|
+
*/
|
|
89
|
+
export function resolveButtonGroupSegmentEdgeColors(colors, input) {
|
|
90
|
+
const own = input.selected ? OMITTED_EDGE : colors.outline;
|
|
91
|
+
const right = input.selected || input.nextSelected ? OMITTED_EDGE : colors.outline;
|
|
92
|
+
return {
|
|
93
|
+
top: own,
|
|
94
|
+
bottom: own,
|
|
95
|
+
left: own,
|
|
96
|
+
right
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Per-edge, per-segment hitSlop — the touch-target fix. Vertical expansion is symmetric and safe on
|
|
101
|
+
* every segment (nothing else in the group sits above/below a segment). Horizontal expansion is
|
|
102
|
+
* granted ONLY on a segment's TRUE outer edge — the group's own left edge on the first segment, its
|
|
103
|
+
* own right edge on the last — and is exactly 0 on every edge shared with a neighbour.
|
|
104
|
+
*
|
|
105
|
+
* Segments in this control render flush against each other (by design — "one connected control",
|
|
106
|
+
* see `ButtonGroup.tsx`), so a symmetric hitSlop on every segment would expand INTO the adjacent
|
|
107
|
+
* segment on every internal edge. React Native's own documented hitSlop behaviour never clips to a
|
|
108
|
+
* sibling's bounds and resolves overlapping siblings' hitSlop to whichever renders LATER (the higher
|
|
109
|
+
* `options` index), not whichever is visually closer to the tap — so a tap near an internal divider,
|
|
110
|
+
* still visually inside the earlier segment, would fire the LATER segment's `onValueChange`. Zeroing
|
|
111
|
+
* the internal edges removes the overlap entirely instead of merely shrinking it.
|
|
112
|
+
*
|
|
113
|
+
* Because horizontal hitSlop can no longer safely pad an internal segment's touch width, the ≥44dp
|
|
114
|
+
* floor for those segments is met by `buttonGroupSegmentStructure`'s own `minWidth`, not by hitSlop.
|
|
115
|
+
*/
|
|
116
|
+
export function resolveButtonGroupSegmentHitSlop(size, position) {
|
|
117
|
+
const slop = BUTTON_GROUP_SIZES[size].hitSlop;
|
|
118
|
+
return {
|
|
119
|
+
top: slop,
|
|
120
|
+
bottom: slop,
|
|
121
|
+
left: position.isFirst ? slop : 0,
|
|
122
|
+
right: position.isLast ? slop : 0
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Derives one segment's accessibility surface purely, mirroring `resolveRadioRowAccessibility`:
|
|
127
|
+
* `accessibilityRole="radio"` + `accessibilityState.checked` (NOT `role="tab"`/`.selected` — a tab
|
|
128
|
+
* switches content panels, which this control does not do; it is the same single-choice value
|
|
129
|
+
* selector shape `RadioGroup` already uses, just drawn as connected segments instead of rows).
|
|
130
|
+
*/
|
|
131
|
+
export function resolveButtonGroupSegmentAccessibility(input) {
|
|
132
|
+
return {
|
|
133
|
+
accessibilityRole: "radio",
|
|
134
|
+
accessibilityState: {
|
|
135
|
+
checked: input.selected,
|
|
136
|
+
disabled: input.disabled
|
|
137
|
+
},
|
|
138
|
+
disabled: input.disabled
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The container — a clipping rect only. `overflow: hidden` + `borderRadius` clips every segment's
|
|
144
|
+
* fill (and the outer segments' square corners) to this single rounded outline, so the selected
|
|
145
|
+
* segment never shows a corner poking past the shared shape — the visual mechanism that makes this
|
|
146
|
+
* read as ONE connected control rather than a row of standalone buttons. It carries NO border of its
|
|
147
|
+
* own: the outer border is drawn by the first/last segments themselves (see
|
|
148
|
+
* `buttonGroupSegmentStructure`), because only a per-segment border can be selectively omitted where
|
|
149
|
+
* it touches the selected segment (WCAG 1.4.11) — a single container-wide border is one colour for
|
|
150
|
+
* its entire perimeter and cannot vary by which segment it runs along.
|
|
151
|
+
*/
|
|
152
|
+
export const buttonGroupStructure = createThemedVariants(theme => ({
|
|
153
|
+
base: {
|
|
154
|
+
flexDirection: "row",
|
|
155
|
+
borderRadius: theme.radii.base,
|
|
156
|
+
overflow: "hidden"
|
|
157
|
+
}
|
|
158
|
+
}));
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* One segment's layout. `minWidth: MIN_TOUCH_TARGET` is the real ≥44dp touch-target floor for the
|
|
162
|
+
* WIDTH axis — horizontal hitSlop can no longer safely pad an internal segment (see
|
|
163
|
+
* `resolveButtonGroupSegmentHitSlop`), so the rendered node itself must never shrink narrower than
|
|
164
|
+
* 44dp, for a realistic 2–4 option row at either size. `height` is fixed (not a minimum) so the
|
|
165
|
+
* vertical hitSlop math holds against what actually renders.
|
|
166
|
+
*
|
|
167
|
+
* Every segment structurally carries a top, bottom, and right border (thin width) — the right one is
|
|
168
|
+
* the divider on every segment except the last, where it is instead that segment's own outer right
|
|
169
|
+
* edge. Only the FIRST segment gets a left border and left-corner radii (the group's own outer left
|
|
170
|
+
* edge); only the LAST segment gets right-corner radii (matching the container's own `borderRadius`,
|
|
171
|
+
* so that segment's own border curves rather than being clipped into an L by the container). Border
|
|
172
|
+
* WIDTHS are structural and constant; COLOURS (drawn vs `transparent`) are resolved per render by
|
|
173
|
+
* `resolveButtonGroupSegmentEdgeColors` and applied inline over this.
|
|
174
|
+
*/
|
|
175
|
+
export const buttonGroupSegmentStructure = createThemedVariants(theme => ({
|
|
176
|
+
base: {
|
|
177
|
+
flex: 1,
|
|
178
|
+
minWidth: MIN_TOUCH_TARGET,
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
justifyContent: "center",
|
|
181
|
+
borderTopWidth: theme.borderWidths.thin,
|
|
182
|
+
borderBottomWidth: theme.borderWidths.thin,
|
|
183
|
+
borderRightWidth: theme.borderWidths.thin
|
|
184
|
+
},
|
|
185
|
+
variants: {
|
|
186
|
+
size: {
|
|
187
|
+
sm: {
|
|
188
|
+
height: BUTTON_GROUP_SIZES.sm.height,
|
|
189
|
+
paddingHorizontal: theme.space[2]
|
|
190
|
+
},
|
|
191
|
+
md: {
|
|
192
|
+
height: BUTTON_GROUP_SIZES.md.height,
|
|
193
|
+
paddingHorizontal: theme.space[3]
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
first: {
|
|
197
|
+
on: {
|
|
198
|
+
borderLeftWidth: theme.borderWidths.thin,
|
|
199
|
+
borderTopLeftRadius: theme.radii.base,
|
|
200
|
+
borderBottomLeftRadius: theme.radii.base
|
|
201
|
+
},
|
|
202
|
+
off: {
|
|
203
|
+
borderLeftWidth: 0
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
last: {
|
|
207
|
+
on: {
|
|
208
|
+
borderTopRightRadius: theme.radii.base,
|
|
209
|
+
borderBottomRightRadius: theme.radii.base
|
|
210
|
+
},
|
|
211
|
+
off: {}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
defaultVariants: {
|
|
215
|
+
size: "md",
|
|
216
|
+
first: "off",
|
|
217
|
+
last: "off"
|
|
218
|
+
}
|
|
219
|
+
}));
|
|
220
|
+
//# sourceMappingURL=ButtonGroup.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["compositeOver","createThemedVariants","MIN_TOUCH_TARGET","slopFor","height","Math","max","ceil","BUTTON_GROUP_SIZES","sm","fontSize","hitSlop","md","PRESSED_FILL_OVERLAY_ALPHA_HEX","resolveButtonGroupColors","colors","selectedFill","accent","solid","onSelectedFill","onSolid","label","fg","default","pressedFill","bg","canvas","sunken","outline","border","interactive","OMITTED_EDGE","resolveButtonGroupSegmentEdgeColors","input","own","selected","right","nextSelected","top","bottom","left","resolveButtonGroupSegmentHitSlop","size","position","slop","isFirst","isLast","resolveButtonGroupSegmentAccessibility","accessibilityRole","accessibilityState","checked","disabled","buttonGroupStructure","theme","base","flexDirection","borderRadius","radii","overflow","buttonGroupSegmentStructure","flex","minWidth","alignItems","justifyContent","borderTopWidth","borderWidths","thin","borderBottomWidth","borderRightWidth","variants","paddingHorizontal","space","first","on","borderLeftWidth","borderTopLeftRadius","borderBottomLeftRadius","off","last","borderTopRightRadius","borderBottomRightRadius","defaultVariants"],"sourceRoot":"../../../../src","sources":["modules/button-group/ButtonGroup.variants.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# button-group/ — a segmented single-choice control
|
|
2
|
+
|
|
3
|
+
Visually connected segments sharing one outer border and a divider line between adjacent
|
|
4
|
+
segments — NOT a row of standalone `Button`s. One component owns the whole group, same shape as
|
|
5
|
+
`radio-group/`: each segment carries its own `accessibilityRole="radio"`; the container carries
|
|
6
|
+
`accessibilityRole="radiogroup"` so assistive tech announces the grouping without collapsing the
|
|
7
|
+
individually-focusable segments into one. The border/divider is drawn PER SEGMENT (never once on
|
|
8
|
+
the container) so it can be selectively omitted where it touches the selected segment — see
|
|
9
|
+
**1.4.11** below.
|
|
10
|
+
|
|
11
|
+
## Files
|
|
12
|
+
|
|
13
|
+
| File | Role |
|
|
14
|
+
|------|------|
|
|
15
|
+
| `ButtonGroup.tsx` | The component. Segment composition, press wiring, a11y wiring. |
|
|
16
|
+
| `ButtonGroup.variants.ts` | Pure resolvers (`BUTTON_GROUP_SIZES`, `resolveButtonGroupColors`, `resolveButtonGroupSegmentEdgeColors`, `resolveButtonGroupSegmentHitSlop`, `resolveButtonGroupSegmentAccessibility`) + the themed structural resolvers (`buttonGroupStructure`, `buttonGroupSegmentStructure`). No React, no lucide. |
|
|
17
|
+
| `index.ts` | Public surface: `ButtonGroup`, `ButtonGroupProps`, `ButtonGroupOption`, `ButtonGroupSize`. |
|
|
18
|
+
| `__tests__/ButtonGroup.test.ts` | Pure: WCAG contrast (selected label, unselected label resting + pressed, every per-segment boundary pairing — all brands × modes × first/middle/last selected) + touch target (vertical hitSlop math + per-edge hitSlop decision) + a11y contract. |
|
|
19
|
+
| `__tests__/ButtonGroup.render.test.tsx` | Render: selection, press blocking when disabled, per-segment a11y state, the ACTUAL rendered border colours per edge, the ACTUAL rendered hitSlop object, the ACTUAL rendered `minWidth`. |
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
| Prop | Type | Default | Notes |
|
|
24
|
+
|------|------|---------|-------|
|
|
25
|
+
| `options` | `{ label: string; value: string }[]` | — | Rendered in order, each `flex: 1` (equal width). |
|
|
26
|
+
| `value` | `string` | — | The selected option's `value`. |
|
|
27
|
+
| `onValueChange` | `(value: string) => void` | — | Fires with the pressed option's `value`; gated off while `disabled`. |
|
|
28
|
+
| `disabled` | `boolean` | `false` | Dims every segment and blocks all presses (whole-group only — no per-option `disabled`). |
|
|
29
|
+
| `size` | `sm \| md` | `md` | 32 / 40 dp fixed segment height (matches Button's `sm`/`md`); both reach 44dp via `hitSlop`. |
|
|
30
|
+
| `style` | `LayoutStyle` | — | Layout-only, outermost (the container `View`), applied exactly once, last. |
|
|
31
|
+
| `testID` | `string` | — | Container's testID; each segment gets `` `${testID}-${option.value}` `` when set. |
|
|
32
|
+
|
|
33
|
+
No `tone`/`variant` union and no `icon` — this is a single-purpose control, not a closed union of
|
|
34
|
+
appearances. The selected fill is always `accent.solid`; the shared outline/divider is always
|
|
35
|
+
`border.interactive`. That is the whole reason there is no `color`/`tone` prop to resolve.
|
|
36
|
+
|
|
37
|
+
## Accessibility contract (WCAG)
|
|
38
|
+
|
|
39
|
+
- **4.1.2** — `accessibilityRole="radio"` per segment, `accessibilityState={ checked, disabled }`
|
|
40
|
+
(NOT `role="tab"`/`.selected` — a tab switches content panels, which this control does not do; it
|
|
41
|
+
is the same single-choice value selector shape `RadioGroup` already uses, just drawn as connected
|
|
42
|
+
segments instead of rows); `accessibilityRole="radiogroup"` on the container.
|
|
43
|
+
- **2.5.x target size** — every segment reaches ≥ 44dp on BOTH axes, but not through one flat
|
|
44
|
+
`hitSlop`:
|
|
45
|
+
- **Vertical** — symmetric `hitSlop` on every segment (32dp/40dp visual height + 6/2dp slop = 44dp).
|
|
46
|
+
Safe on every segment: nothing else in the group sits above/below it. `height` is fixed (not
|
|
47
|
+
`minHeight`) so the math matches what actually renders — the same class of bug that silently
|
|
48
|
+
broke Input's 44dp target in Wave 1.
|
|
49
|
+
- **Horizontal** — segments render flush against each other (no gap — that's what makes this read
|
|
50
|
+
as one connected control), so a symmetric hitSlop would expand INTO the neighbouring segment.
|
|
51
|
+
React Native never clips hitSlop to a sibling's bounds and resolves overlapping siblings' hitSlop
|
|
52
|
+
to whichever renders LATER (the higher `options` index), not whichever is visually closer to the
|
|
53
|
+
tap — so a flat hitSlop handed a tap near an internal divider, still visually inside the earlier
|
|
54
|
+
segment, to the WRONG segment. Fixed: `resolveButtonGroupSegmentHitSlop` gives horizontal
|
|
55
|
+
expansion ONLY to a segment's TRUE outer edge (the group's own left edge on the first segment,
|
|
56
|
+
its own right edge on the last) and exactly 0 on every edge shared with a neighbour — eliminating
|
|
57
|
+
the overlap instead of tuning it smaller. Because horizontal hitSlop can no longer pad an internal
|
|
58
|
+
segment's touch width, `buttonGroupSegmentStructure` gives every segment a structural
|
|
59
|
+
`minWidth: 44` so the ACTUAL rendered node clears the floor on its own, for a realistic 2–4 option
|
|
60
|
+
row at either size (verified in `ButtonGroup.render.test.tsx`, not just arithmetic).
|
|
61
|
+
- **1.4.3** — selected label uses the DERIVED `accent.onSolid` (never a hardcoded white), measured
|
|
62
|
+
≥ 4.5:1 against `accent.solid`. Unselected label is `fg.default`, measured ≥ 4.5:1 against both the
|
|
63
|
+
canvas (resting) and `bg.sunken` (pressed) — NOT `bg.hover`, whose saturated mid-tone was measured
|
|
64
|
+
to drop the brand-tinted label below 4.5:1 on several brands, the same class of bug Button's
|
|
65
|
+
"neutral" tone and RadioGroup's pressed row document fixing the same way.
|
|
66
|
+
- **1.4.11** — the shared `outline` token (`border.interactive`) clears 3:1 against `bg.canvas` on
|
|
67
|
+
every brand × mode, but measured against a SELECTED segment's `accent.solid` fill it FAILS 3:1 on
|
|
68
|
+
15 of 16 brand × mode combinations (some catastrophically: slate light 1.00, emerald light 1.02).
|
|
69
|
+
Because `value` is required, some segment is always selected — that adjacency is every render, not
|
|
70
|
+
an edge case, and it previously went unmeasured (the shipped test only checked outline-vs-canvas).
|
|
71
|
+
Fixed: `resolveButtonGroupSegmentEdgeColors` computes, per edge of per segment, whether that edge
|
|
72
|
+
touches the selected segment; any edge that does gets `transparent` instead of `outline`, and the
|
|
73
|
+
boundary there is served instead by the selected fill's own contrast against the canvas —
|
|
74
|
+
`accent.solid` clears 3:1 against `bg.canvas` on all 16 brand × mode combinations (worst case
|
|
75
|
+
3.24:1, emerald light) — the same mechanism every other solid-fill component in this library
|
|
76
|
+
already relies on. `ButtonGroup.test.ts` measures every actually-rendered boundary pairing (not
|
|
77
|
+
just the easy outline-vs-canvas one) for first/middle/last selected × all 8 brands × both modes.
|
|
78
|
+
- **2.3.3** — n/a: nothing here animates. Selection is a conditional fill (not a slide or a fade), so
|
|
79
|
+
there is no transition for `useReducedMotion` to gate — same as `RadioGroup`.
|
|
80
|
+
- Disabled segments are exempt from the contrast minimum (WCAG 1.4.3), so the uniform `opacity: 0.5`
|
|
81
|
+
dim is correct, same as Button/RadioGroup.
|
|
82
|
+
|
|
83
|
+
## Patterns (copied from Button / RadioGroup)
|
|
84
|
+
|
|
85
|
+
1. **Structure vs colour split.** Segment height/padding/`minWidth` and every border's *width* are
|
|
86
|
+
`createThemedVariants` (registered once per `(theme, size)`); the container's `borderRadius` is a
|
|
87
|
+
theme-scaled constant in the same resolver family. Colour (`selectedFill`, `label`, `pressedFill`,
|
|
88
|
+
and — per edge, per segment — `outline` vs `transparent`) is resolved by `resolveButtonGroupColors`
|
|
89
|
+
/ `resolveButtonGroupSegmentEdgeColors` from role tokens and applied inline over the structural
|
|
90
|
+
style.
|
|
91
|
+
2. **One connected control, not N buttons — and the border lives on the segments, not the container.**
|
|
92
|
+
The container is only a clipping rect (`overflow: 'hidden'` + `borderRadius`, no border of its
|
|
93
|
+
own): it clips a filled end segment's square corner into the shared rounded shape. Every segment
|
|
94
|
+
structurally carries its own top/bottom/right border; the right one is the divider on every
|
|
95
|
+
segment except the last, where it is instead that segment's own outer right edge; only the FIRST
|
|
96
|
+
segment gets a left border + left-corner radii, only the LAST gets right-corner radii. A single
|
|
97
|
+
container-wide border could never be selectively omitted per segment (one colour for its whole
|
|
98
|
+
perimeter), which is exactly why 1.4.11 shipped broken the first time — moving the border onto the
|
|
99
|
+
segments is what makes the WCAG fix possible at all.
|
|
100
|
+
3. **Pure, testable resolvers** in `ButtonGroup.variants.ts` (no React) so the WCAG + behaviour
|
|
101
|
+
contract is unit-tested against the real palettes — never eyeballed.
|
|
102
|
+
4. **No `{...rest}`, `style` once on the outermost node**, no icon (per spec), no import from
|
|
103
|
+
`../button` — the connected/segmented visual treatment is a different structural shape than
|
|
104
|
+
Button's own pill/rect variants.
|
|
105
|
+
5. **Defence-in-depth press gating** — `onPress` is `undefined` while `disabled`, on top of the
|
|
106
|
+
`Pressable` `disabled` prop.
|
|
107
|
+
|
|
108
|
+
## Known gaps
|
|
109
|
+
|
|
110
|
+
- No visible keyboard-focus ring (Button's `border.focus` ring pattern, WCAG 2.4.7) — left out of v1
|
|
111
|
+
for the same reason `RadioGroup` left it out: touch is the primary input surface for this control.
|
|
112
|
+
The same `onFocus`/`onBlur` + `border.focus` pattern from `Button.tsx` would extend cleanly here if
|
|
113
|
+
a future task needs it for external-keyboard / RN Web use.
|
|
114
|
+
|
|
115
|
+
### Resolved — the adjacent-pressed-segment boundary (WCAG 1.4.11)
|
|
116
|
+
|
|
117
|
+
The omitted-divider boundary (fill vs canvas) was originally verified only against the neighbour's
|
|
118
|
+
RESTING background. When the segment immediately next to the selected one is actively pressed, the
|
|
119
|
+
boundary that actually renders there is `selectedFill` vs that neighbour's `pressedFill`, not vs
|
|
120
|
+
canvas — plain `bg.sunken` measured 2.99:1 against `selectedFill` on rosewood light, under the 3:1
|
|
121
|
+
floor. Fixed: `pressedFill` is now `bg.sunken` composited with a small fixed-alpha `bg.canvas` overlay
|
|
122
|
+
(`PRESSED_FILL_OVERLAY_ALPHA_HEX` in `ButtonGroup.variants.ts`) — nudging it toward the same
|
|
123
|
+
already-proven-safe `bg.canvas` relationship `accent.solid` relies on elsewhere in this module, without
|
|
124
|
+
an `if (dark)` branch. Worst case now 3.08:1 (rosewood light); the unselected label stays ≥ 4.5:1 on it
|
|
125
|
+
(worst case 5.88:1). Measured for all 8 brands × both modes in `ButtonGroup.test.ts`.
|
|
126
|
+
|
|
127
|
+
## Performance
|
|
128
|
+
|
|
129
|
+
Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`) — renamed to `ButtonGroupImpl` internally, exported as `ButtonGroup = memo(ButtonGroupImpl)`. The `options.map()` hands every per-row prop to host elements (`Pressable`/`Text`/`View`), never a library child component, so no `useCallback`/`useMemo` was needed.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `pixelize-native-library/button-group`. Value exports and type exports are split for
|
|
5
|
+
* `verbatimModuleSyntax`. The visual/behaviour resolvers (`resolveButtonGroupColors`,
|
|
6
|
+
* `BUTTON_GROUP_SIZES`, …) stay internal — a consumer configures a ButtonGroup through its props,
|
|
7
|
+
* never by importing its internals.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { ButtonGroup } from "./ButtonGroup.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ButtonGroup"],"sourceRoot":"../../../../src","sources":["modules/button-group/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Card — a plain container for grouping content. No interaction, no text of its own: `children` is
|
|
5
|
+
* ordinary composition (a consumer places `Text`, `Button`, whatever it needs inside), so there is
|
|
6
|
+
* nothing here for `accessibilityRole` to announce — the container is intentionally invisible to
|
|
7
|
+
* assistive tech and its children carry their own semantics, exactly like a plain `View` would.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { memo } from "react";
|
|
11
|
+
import { View } from "react-native";
|
|
12
|
+
import { useTheme } from "../../theme/index.js";
|
|
13
|
+
import { cardStructure, resolveCardVariant } from "./Card.variants.js";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
function CardImpl({
|
|
16
|
+
variant = "elevated",
|
|
17
|
+
children,
|
|
18
|
+
style,
|
|
19
|
+
testID
|
|
20
|
+
}) {
|
|
21
|
+
const theme = useTheme();
|
|
22
|
+
const variantColors = resolveCardVariant(theme.colors, variant);
|
|
23
|
+
return /*#__PURE__*/_jsx(View, {
|
|
24
|
+
testID: testID,
|
|
25
|
+
style: [cardStructure(theme, {
|
|
26
|
+
variant
|
|
27
|
+
}), {
|
|
28
|
+
backgroundColor: variantColors.background
|
|
29
|
+
}, variantColors.border !== undefined && {
|
|
30
|
+
borderColor: variantColors.border
|
|
31
|
+
}, variant === "elevated" && theme.elevation.md, style],
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// A consumer's screen re-renders far more often than Card's own props change — memo is near-free
|
|
37
|
+
// insurance for a design-system primitive (see CLAUDE.md "Performance" section).
|
|
38
|
+
export const Card = /*#__PURE__*/memo(CardImpl);
|
|
39
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","View","useTheme","cardStructure","resolveCardVariant","jsx","_jsx","CardImpl","variant","children","style","testID","theme","variantColors","colors","backgroundColor","background","border","undefined","borderColor","elevation","md","Card"],"sourceRoot":"../../../../src","sources":["modules/card/Card.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,IAAI,QAAQ,cAAc;AAGnC,SAASC,QAAQ,QAAQ,sBAAa;AAEtC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWpE,SAASC,QAAQA,CAAC;EAAEC,OAAO,GAAG,UAAU;EAAEC,QAAQ;EAAEC,KAAK;EAAEC;AAAkB,CAAC,EAAE;EAC9E,MAAMC,KAAK,GAAGV,QAAQ,CAAC,CAAC;EACxB,MAAMW,aAAa,GAAGT,kBAAkB,CAACQ,KAAK,CAACE,MAAM,EAAEN,OAAO,CAAC;EAE/D,oBACEF,IAAA,CAACL,IAAI;IACHU,MAAM,EAAEA,MAAO;IACfD,KAAK,EAAE,CACLP,aAAa,CAACS,KAAK,EAAE;MAAEJ;IAAQ,CAAC,CAAC,EACjC;MAAEO,eAAe,EAAEF,aAAa,CAACG;IAAW,CAAC,EAC7CH,aAAa,CAACI,MAAM,KAAKC,SAAS,IAAI;MAAEC,WAAW,EAAEN,aAAa,CAACI;IAAO,CAAC,EAC3ET,OAAO,KAAK,UAAU,IAAII,KAAK,CAACQ,SAAS,CAACC,EAAE,EAC5CX,KAAK,CACL;IAAAD,QAAA,EAEDA;EAAQ,CACL,CAAC;AAEX;;AAEA;AACA;AACA,OAAO,MAAMa,IAAI,gBAAGtB,IAAI,CAACO,QAAQ,CAAC","ignoreList":[]}
|