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,81 @@
|
|
|
1
|
+
# alert-dialog/ — a small confirm/alert dialog composed from Modal + Button
|
|
2
|
+
|
|
3
|
+
`AlertDialog` is a focused confirm/alert dialog, DELIBERATELY built by composing this library's
|
|
4
|
+
own, already-shipped `Modal` (backdrop, panel, dismissal, title contrast) and `Button` (tone,
|
|
5
|
+
press feedback, touch target) rather than reimplementing either from scratch. This module owns
|
|
6
|
+
exactly one thing of its own: which two actions appear and which tone the confirm action carries.
|
|
7
|
+
|
|
8
|
+
## Files
|
|
9
|
+
|
|
10
|
+
| File | Role |
|
|
11
|
+
|------|------|
|
|
12
|
+
| `AlertDialog.tsx` | The component. Composes `Modal` (title, dismissal) with a description `Text` and a two-`Button` action row. |
|
|
13
|
+
| `AlertDialog.variants.ts` | Pure resolvers: `resolveAlertDialogConfirmTone` (`tone` → `ButtonTone`) + the themed action-row layout (`alertDialogActionsStructure`). No React, no lucide. |
|
|
14
|
+
| `index.ts` | Public surface: `AlertDialog`, `AlertDialogProps`, `AlertDialogTone`. |
|
|
15
|
+
| `__tests__/AlertDialog.test.ts` | Pure: the tone-mapping resolver, plus the description text/foreground pairing this module renders itself (`fg.muted` on `bg.surface`) — measured for all brands × modes. |
|
|
16
|
+
| `__tests__/AlertDialog.render.test.tsx` | Render: visibility, labels (including the `"Cancel"` default), action wiring (`onConfirm`, `onCancel`/`onRequestClose` fallback, backdrop dismissal), that `tone` reaches the confirm Button's rendered fill, and the Cancel button's rendered outline/accent label + border clearing AA on `bg.surface` — measured off the mounted Cancel Button's actual style, for all brands × modes. |
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Notes |
|
|
21
|
+
|------|------|---------|-------|
|
|
22
|
+
| `visible` | `boolean` | — | Required. Forwarded to `Modal` — fully controlled, no internal open state. |
|
|
23
|
+
| `onRequestClose` | `() => void` | — | Required. Forwarded to `Modal` (backdrop press, Android back, iOS VoiceOver escape). Also the default `onCancel`. |
|
|
24
|
+
| `title` | `string` | — | Required. Forwarded to `Modal`'s `title` (rendered `accessibilityRole="header"` by Modal). |
|
|
25
|
+
| `description` | `string` | — | Optional body text below the title, above the actions. |
|
|
26
|
+
| `confirmLabel` | `string` | — | Required. Label of the confirm action. |
|
|
27
|
+
| `cancelLabel` | `string` | `"Cancel"` | Label of the cancel action. |
|
|
28
|
+
| `onConfirm` | `() => void` | — | Required. Wired to the confirm Button's `onPress`. |
|
|
29
|
+
| `onCancel` | `() => void` | `onRequestClose` | Wired to the cancel Button's `onPress`. Cancelling and dismissing mean the same thing unless overridden. |
|
|
30
|
+
| `tone` | `"default" \| "danger"` | `"default"` | Closed union. `"danger"` passes `tone="danger"` to the confirm `Button`, mirroring Button's own destructive-action tone; `"default"` maps to Button's own default (`"accent"`). |
|
|
31
|
+
| `testID` | `string` | — | Forwarded to `Modal` (seeds `${testID}-backdrop`/`${testID}-panel`) and also seeds `${testID}-cancel` / `${testID}-confirm` on the two actions. |
|
|
32
|
+
|
|
33
|
+
No `style` — same reasoning as `Modal` (see its "Why no `style`" section): there is no parent
|
|
34
|
+
layout flow to place a full-screen dialog within.
|
|
35
|
+
|
|
36
|
+
## Accessibility contract
|
|
37
|
+
|
|
38
|
+
The confirm action's *fill* (both tones) and the title are entirely `Modal`'s and `Button`'s own
|
|
39
|
+
already-measured surfaces (contrast, focus ring, touch targets, `busy`/`disabled` state — see their
|
|
40
|
+
MODULE.md files) — `Button.test.ts` measures `resolveButtonTone`'s `onFill`/`fill` pairing directly,
|
|
41
|
+
and that doesn't depend on what it's placed on. But the Cancel action is `variant="outline"`, whose
|
|
42
|
+
label/border sit on whatever background surrounds it rather than on a fill of their own — `Button`
|
|
43
|
+
only measures that pairing against `bg.canvas` (its own assumed resting background), while
|
|
44
|
+
AlertDialog places Cancel on Modal's panel (`bg.surface`) instead. That specific pairing needed its
|
|
45
|
+
own measurement, added here rather than assumed. What this module is responsible for, and tests:
|
|
46
|
+
|
|
47
|
+
- **1.4.3** — the description text (`fg.muted` on the panel's `bg.surface`) clears 4.5:1 for every
|
|
48
|
+
brand × mode — measured directly in `AlertDialog.test.ts` (this exact pairing is also proven at
|
|
49
|
+
the shared role layer in `theme/tokens/roles/__tests__/roleColors.test.ts`).
|
|
50
|
+
- **1.4.3 / 1.4.11** — the Cancel button's rendered label and border against the panel's `bg.surface`
|
|
51
|
+
clear 4.5:1 / 3:1 respectively, for every brand × mode — measured in `AlertDialog.render.test.tsx`
|
|
52
|
+
by mounting `<AlertDialog>` and reading `StyleSheet.flatten` off the actually-rendered Cancel
|
|
53
|
+
Button and its label `Text`, so a change to Button's tone mapping is caught here too, without this
|
|
54
|
+
module importing Button's internal `resolveButtonTone` resolver.
|
|
55
|
+
- **Dismissal semantics** — every one of Modal's dismissal paths (backdrop press, Android hardware
|
|
56
|
+
back, iOS VoiceOver escape) still resolves to `onRequestClose`, since `AlertDialog` never
|
|
57
|
+
intercepts it; only the cancel *action* gets the `onCancel` override.
|
|
58
|
+
- **Confirm vs. cancel are never confusable** — the confirm action is always `variant="solid"`
|
|
59
|
+
(filled, high-emphasis) and the cancel action is always `variant="outline"` (unfilled), so the
|
|
60
|
+
destructive/primary choice is never the visually quieter one.
|
|
61
|
+
|
|
62
|
+
## Patterns
|
|
63
|
+
|
|
64
|
+
1. **Compose, don't reimplement.** `Modal` and `Button` are stable, shipped modules; this component
|
|
65
|
+
is exactly the "compose existing exports" step the repo's component decision order describes —
|
|
66
|
+
no backdrop, panel, or press-feedback logic is duplicated here.
|
|
67
|
+
2. **Pure, testable tone mapping.** `resolveAlertDialogConfirmTone` is the one piece of this
|
|
68
|
+
module's own logic, kept free of React/lucide so it is unit-tested like every other resolver in
|
|
69
|
+
the library.
|
|
70
|
+
3. **Structure vs. colour split, even for a thin composing module.** The action row's layout lives
|
|
71
|
+
in `alertDialogActionsStructure` (`createThemedVariants`, registered once per theme); this module
|
|
72
|
+
applies no colour of its own beyond the one description-text lookup.
|
|
73
|
+
|
|
74
|
+
## Known gaps
|
|
75
|
+
|
|
76
|
+
- No built-in scrolling for a very long `description` — same known gap `Modal` documents for
|
|
77
|
+
`children` in general; a consumer with unusually long content composes `Modal` directly instead.
|
|
78
|
+
|
|
79
|
+
## Performance
|
|
80
|
+
|
|
81
|
+
Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`). No `useCallback`/`useMemo` needed: `cancelPress`/`onConfirm` are forwarded straight through to `Modal`/`Button` as direct prop references, never a freshly-created closure.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `pixelize-native-library/alert-dialog`. Value exports and type exports are split for
|
|
5
|
+
* `verbatimModuleSyntax`. The tone resolver and layout resolver stay internal — a consumer
|
|
6
|
+
* configures an AlertDialog through its props, never by importing its internals.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { AlertDialog } from "./AlertDialog.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AlertDialog"],"sourceRoot":"../../../../src","sources":["modules/alert-dialog/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,QAAQ,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Avatar — a circular identity glyph: a remote image, initials, or (with neither) a plain neutral
|
|
5
|
+
* placeholder. No press handling, no loading spinner, no animation — the simplest module in the
|
|
6
|
+
* library, which is exactly why its accessibility default differs from every sibling: an avatar
|
|
7
|
+
* usually sits beside a visible name, so `accessibilityLabel` is optional, not a required trap (see
|
|
8
|
+
* `Avatar.variants.ts` → `resolveAvatarAccessibility`).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { memo } from "react";
|
|
12
|
+
import { Image, StyleSheet, Text, View } from "react-native";
|
|
13
|
+
import { useTheme } from "../../theme/index.js";
|
|
14
|
+
import { AVATAR_SIZES, avatarStructure, resolveAvatarAccessibility, resolveAvatarColors } from "./Avatar.variants.js";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
export const Avatar = /*#__PURE__*/memo(function Avatar({
|
|
17
|
+
size = "md",
|
|
18
|
+
source,
|
|
19
|
+
initials,
|
|
20
|
+
accessibilityLabel,
|
|
21
|
+
style,
|
|
22
|
+
testID
|
|
23
|
+
}) {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
const spec = AVATAR_SIZES[size];
|
|
26
|
+
const colors = resolveAvatarColors(theme.colors);
|
|
27
|
+
const a11y = resolveAvatarAccessibility({
|
|
28
|
+
accessibilityLabel
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/_jsx(View, {
|
|
31
|
+
testID: testID,
|
|
32
|
+
accessible: a11y.accessible,
|
|
33
|
+
accessibilityRole: a11y.accessibilityRole,
|
|
34
|
+
accessibilityLabel: a11y.accessibilityLabel,
|
|
35
|
+
accessibilityElementsHidden: a11y.accessibilityElementsHidden,
|
|
36
|
+
importantForAccessibility: a11y.importantForAccessibility,
|
|
37
|
+
style: [avatarStructure(theme, {
|
|
38
|
+
size
|
|
39
|
+
}), {
|
|
40
|
+
backgroundColor: colors.containerBg
|
|
41
|
+
}, style],
|
|
42
|
+
children: source ? /*#__PURE__*/_jsx(Image, {
|
|
43
|
+
testID: testID === undefined ? undefined : `${testID}-image`,
|
|
44
|
+
source: source,
|
|
45
|
+
resizeMode: "cover",
|
|
46
|
+
style: StyleSheet.absoluteFill
|
|
47
|
+
}) : initials ? /*#__PURE__*/_jsx(Text, {
|
|
48
|
+
numberOfLines: 1,
|
|
49
|
+
style: [theme.fontStyleForWeight(theme.fontWeights.semibold), {
|
|
50
|
+
fontSize: spec.fontSize,
|
|
51
|
+
color: colors.initialsText
|
|
52
|
+
}],
|
|
53
|
+
children: initials.slice(0, 2)
|
|
54
|
+
}) : null
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=Avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","Image","StyleSheet","Text","View","useTheme","AVATAR_SIZES","avatarStructure","resolveAvatarAccessibility","resolveAvatarColors","jsx","_jsx","Avatar","size","source","initials","accessibilityLabel","style","testID","theme","spec","colors","a11y","accessible","accessibilityRole","accessibilityElementsHidden","importantForAccessibility","backgroundColor","containerBg","children","undefined","resizeMode","absoluteFill","numberOfLines","fontStyleForWeight","fontWeights","semibold","fontSize","color","initialsText","slice"],"sourceRoot":"../../../../src","sources":["modules/avatar/Avatar.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,KAAK,EAAEC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAG5D,SAASC,QAAQ,QAAQ,sBAAa;AAEtC,SACEC,YAAY,EACZC,eAAe,EACfC,0BAA0B,EAC1BC,mBAAmB,QACd,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAqB3B,OAAO,MAAMC,MAAM,gBAAGZ,IAAI,CAAC,SAASY,MAAMA,CAAC;EACzCC,IAAI,GAAG,IAAI;EACXC,MAAM;EACNC,QAAQ;EACRC,kBAAkB;EAClBC,KAAK;EACLC;AACW,CAAC,EAAE;EACd,MAAMC,KAAK,GAAGd,QAAQ,CAAC,CAAC;EACxB,MAAMe,IAAI,GAAGd,YAAY,CAACO,IAAI,CAAC;EAC/B,MAAMQ,MAAM,GAAGZ,mBAAmB,CAACU,KAAK,CAACE,MAAM,CAAC;EAChD,MAAMC,IAAI,GAAGd,0BAA0B,CAAC;IAAEQ;EAAmB,CAAC,CAAC;EAE/D,oBACEL,IAAA,CAACP,IAAI;IACHc,MAAM,EAAEA,MAAO;IACfK,UAAU,EAAED,IAAI,CAACC,UAAW;IAC5BC,iBAAiB,EAAEF,IAAI,CAACE,iBAAkB;IAC1CR,kBAAkB,EAAEM,IAAI,CAACN,kBAAmB;IAC5CS,2BAA2B,EAAEH,IAAI,CAACG,2BAA4B;IAC9DC,yBAAyB,EAAEJ,IAAI,CAACI,yBAA0B;IAC1DT,KAAK,EAAE,CAACV,eAAe,CAACY,KAAK,EAAE;MAAEN;IAAK,CAAC,CAAC,EAAE;MAAEc,eAAe,EAAEN,MAAM,CAACO;IAAY,CAAC,EAAEX,KAAK,CAAE;IAAAY,QAAA,EAEzFf,MAAM,gBACLH,IAAA,CAACV,KAAK;MACJiB,MAAM,EAAEA,MAAM,KAAKY,SAAS,GAAGA,SAAS,GAAG,GAAGZ,MAAM,QAAS;MAC7DJ,MAAM,EAAEA,MAAO;MACfiB,UAAU,EAAC,OAAO;MAClBd,KAAK,EAAEf,UAAU,CAAC8B;IAAa,CAChC,CAAC,GACAjB,QAAQ,gBACVJ,IAAA,CAACR,IAAI;MACH8B,aAAa,EAAE,CAAE;MACjBhB,KAAK,EAAE,CACLE,KAAK,CAACe,kBAAkB,CAACf,KAAK,CAACgB,WAAW,CAACC,QAAQ,CAAC,EACpD;QAAEC,QAAQ,EAAEjB,IAAI,CAACiB,QAAQ;QAAEC,KAAK,EAAEjB,MAAM,CAACkB;MAAa,CAAC,CACvD;MAAAV,QAAA,EAEDd,QAAQ,CAACyB,KAAK,CAAC,CAAC,EAAE,CAAC;IAAC,CACjB,CAAC,GACL;EAAI,CACJ,CAAC;AAEX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Avatar's style + colour resolution — the pure functions the component (and its tests) depend on,
|
|
5
|
+
* plus the themed structural variant resolver.
|
|
6
|
+
*
|
|
7
|
+
* The split every sibling module copies (see `Button.variants.ts`):
|
|
8
|
+
* - STRUCTURE (box diameter, radius) lives in the `createThemedVariants` resolver below — static
|
|
9
|
+
* per (brand, mode), registered once via `StyleSheet.create`.
|
|
10
|
+
* - COLOUR is resolved from the theme's ROLE colours (`resolveAvatarColors`), never a raw ramp,
|
|
11
|
+
* never a hardcoded hex. There is no `tone`/`color` prop to widen — an avatar has exactly one
|
|
12
|
+
* neutral identity, so the resolver takes no selector argument (same reasoning as
|
|
13
|
+
* `resolveCheckboxColors`).
|
|
14
|
+
* - ACCESSIBILITY prop derivation is `resolveAvatarAccessibility`, kept pure so the "decorative
|
|
15
|
+
* unless labelled" contract is unit-testable without rendering React Native.
|
|
16
|
+
*
|
|
17
|
+
* Free of React and of any lucide import, so the WCAG + behaviour tests import it directly (mocking
|
|
18
|
+
* only `react-native`'s `StyleSheet`, as `core/style` and `Button.variants.ts` do).
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { createThemedVariants } from "../../core/style/index.js";
|
|
22
|
+
/**
|
|
23
|
+
* Avatar-specific dimensions. Kept a plain constant — no theme dependency — same as `BUTTON_SIZES` /
|
|
24
|
+
* `CHECKBOX_SIZES`, so the render layer and tests share one source of truth for the diameter.
|
|
25
|
+
*
|
|
26
|
+
* Not a touch target: an avatar has no `onPress` in this contract, so the 44dp floor other
|
|
27
|
+
* interactive modules hold themselves to (see `Button`'s `MIN_TOUCH_TARGET`) does not apply here.
|
|
28
|
+
*/
|
|
29
|
+
export const AVATAR_SIZES = {
|
|
30
|
+
xs: {
|
|
31
|
+
box: 24,
|
|
32
|
+
fontSize: 12
|
|
33
|
+
},
|
|
34
|
+
sm: {
|
|
35
|
+
box: 32,
|
|
36
|
+
fontSize: 14
|
|
37
|
+
},
|
|
38
|
+
md: {
|
|
39
|
+
box: 40,
|
|
40
|
+
fontSize: 16
|
|
41
|
+
},
|
|
42
|
+
lg: {
|
|
43
|
+
box: 56,
|
|
44
|
+
fontSize: 20
|
|
45
|
+
},
|
|
46
|
+
xl: {
|
|
47
|
+
box: 72,
|
|
48
|
+
fontSize: 24
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Maps the avatar's fallback states onto role colours. There is no `tone`/`color` prop to widen —
|
|
53
|
+
* every colour an avatar can show is one of these role lookups, guaranteed legible in both modes and
|
|
54
|
+
* never an off-palette value an app invented (same reasoning as `resolveCheckboxColors`).
|
|
55
|
+
*/
|
|
56
|
+
export function resolveAvatarColors(colors) {
|
|
57
|
+
return {
|
|
58
|
+
containerBg: colors.bg.sunken,
|
|
59
|
+
initialsText: colors.fg.default
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Derives the accessibility surface once, purely, so the "decorative unless labelled" contract is
|
|
64
|
+
* testable without a renderer. Unlike `Button`'s icon-only shape or `Checkbox`'s unlabelled shape,
|
|
65
|
+
* `accessibilityLabel` is never required here (an avatar usually sits beside a visible name — see
|
|
66
|
+
* `AvatarProps`), so absence is a valid, common state, not a trap to close off:
|
|
67
|
+
* - no label → the avatar (image or initials) is purely decorative, hidden from assistive tech so a
|
|
68
|
+
* screen reader doesn't announce a bare, unexplained image/initials.
|
|
69
|
+
* - a label → exposed as a single `"image"`-role element carrying it; `accessible: true` groups the
|
|
70
|
+
* initials `Text` into that one element instead of letting it read separately.
|
|
71
|
+
*/
|
|
72
|
+
export function resolveAvatarAccessibility(input) {
|
|
73
|
+
const hasLabel = input.accessibilityLabel !== undefined && input.accessibilityLabel.length > 0;
|
|
74
|
+
return {
|
|
75
|
+
accessible: hasLabel,
|
|
76
|
+
accessibilityRole: hasLabel ? "image" : undefined,
|
|
77
|
+
accessibilityLabel: hasLabel ? input.accessibilityLabel : undefined,
|
|
78
|
+
accessibilityElementsHidden: !hasLabel,
|
|
79
|
+
importantForAccessibility: hasLabel ? "auto" : "no-hide-descendants"
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Structural styles only — diameter + the circular radius. No colours (those are state-driven and
|
|
85
|
+
* applied inline over this), so this compiles once per theme identity via the `WeakMap`-cached
|
|
86
|
+
* themed resolver and never rebuilds per render.
|
|
87
|
+
*
|
|
88
|
+
* `radii.full` (a finite 9999, not `Infinity` — RN rejects non-finite style values) clips a square
|
|
89
|
+
* box to a perfect circle regardless of its side length, so one token covers every size instead of
|
|
90
|
+
* each variant computing its own `box / 2`.
|
|
91
|
+
*/
|
|
92
|
+
export const avatarStructure = createThemedVariants(theme => ({
|
|
93
|
+
base: {
|
|
94
|
+
alignItems: "center",
|
|
95
|
+
justifyContent: "center",
|
|
96
|
+
overflow: "hidden",
|
|
97
|
+
borderRadius: theme.radii.full
|
|
98
|
+
},
|
|
99
|
+
variants: {
|
|
100
|
+
size: {
|
|
101
|
+
xs: {
|
|
102
|
+
width: AVATAR_SIZES.xs.box,
|
|
103
|
+
height: AVATAR_SIZES.xs.box
|
|
104
|
+
},
|
|
105
|
+
sm: {
|
|
106
|
+
width: AVATAR_SIZES.sm.box,
|
|
107
|
+
height: AVATAR_SIZES.sm.box
|
|
108
|
+
},
|
|
109
|
+
md: {
|
|
110
|
+
width: AVATAR_SIZES.md.box,
|
|
111
|
+
height: AVATAR_SIZES.md.box
|
|
112
|
+
},
|
|
113
|
+
lg: {
|
|
114
|
+
width: AVATAR_SIZES.lg.box,
|
|
115
|
+
height: AVATAR_SIZES.lg.box
|
|
116
|
+
},
|
|
117
|
+
xl: {
|
|
118
|
+
width: AVATAR_SIZES.xl.box,
|
|
119
|
+
height: AVATAR_SIZES.xl.box
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
defaultVariants: {
|
|
124
|
+
size: "md"
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
//# sourceMappingURL=Avatar.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createThemedVariants","AVATAR_SIZES","xs","box","fontSize","sm","md","lg","xl","resolveAvatarColors","colors","containerBg","bg","sunken","initialsText","fg","default","resolveAvatarAccessibility","input","hasLabel","accessibilityLabel","undefined","length","accessible","accessibilityRole","accessibilityElementsHidden","importantForAccessibility","avatarStructure","theme","base","alignItems","justifyContent","overflow","borderRadius","radii","full","variants","size","width","height","defaultVariants"],"sourceRoot":"../../../../src","sources":["modules/avatar/Avatar.variants.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,oBAAoB,QAAQ,2BAAkB;AAWvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAG;EAC1BC,EAAE,EAAE;IAAEC,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC7BC,EAAE,EAAE;IAAEF,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC7BE,EAAE,EAAE;IAAEH,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC7BG,EAAE,EAAE;IAAEJ,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC7BI,EAAE,EAAE;IAAEL,GAAG,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG;AAC9B,CAAuD;AASvD;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,mBAAmBA,CAACC,MAAkB,EAAgB;EACpE,OAAO;IACLC,WAAW,EAAED,MAAM,CAACE,EAAE,CAACC,MAAM;IAC7BC,YAAY,EAAEJ,MAAM,CAACK,EAAE,CAACC;EAC1B,CAAC;AACH;AAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,0BAA0BA,CAACC,KAA+B,EAA4B;EACpG,MAAMC,QAAQ,GAAGD,KAAK,CAACE,kBAAkB,KAAKC,SAAS,IAAIH,KAAK,CAACE,kBAAkB,CAACE,MAAM,GAAG,CAAC;EAC9F,OAAO;IACLC,UAAU,EAAEJ,QAAQ;IACpBK,iBAAiB,EAAEL,QAAQ,GAAG,OAAO,GAAGE,SAAS;IACjDD,kBAAkB,EAAED,QAAQ,GAAGD,KAAK,CAACE,kBAAkB,GAAGC,SAAS;IACnEI,2BAA2B,EAAE,CAACN,QAAQ;IACtCO,yBAAyB,EAAEP,QAAQ,GAAG,MAAM,GAAG;EACjD,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMQ,eAAe,GAAG3B,oBAAoB,CAAE4B,KAAY,KAAM;EACrEC,IAAI,EAAE;IACJC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAEL,KAAK,CAACM,KAAK,CAACC;EAC5B,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJnC,EAAE,EAAE;QAAEoC,KAAK,EAAErC,YAAY,CAACC,EAAE,CAACC,GAAG;QAAEoC,MAAM,EAAEtC,YAAY,CAACC,EAAE,CAACC;MAAI,CAAC;MAC/DE,EAAE,EAAE;QAAEiC,KAAK,EAAErC,YAAY,CAACI,EAAE,CAACF,GAAG;QAAEoC,MAAM,EAAEtC,YAAY,CAACI,EAAE,CAACF;MAAI,CAAC;MAC/DG,EAAE,EAAE;QAAEgC,KAAK,EAAErC,YAAY,CAACK,EAAE,CAACH,GAAG;QAAEoC,MAAM,EAAEtC,YAAY,CAACK,EAAE,CAACH;MAAI,CAAC;MAC/DI,EAAE,EAAE;QAAE+B,KAAK,EAAErC,YAAY,CAACM,EAAE,CAACJ,GAAG;QAAEoC,MAAM,EAAEtC,YAAY,CAACM,EAAE,CAACJ;MAAI,CAAC;MAC/DK,EAAE,EAAE;QAAE8B,KAAK,EAAErC,YAAY,CAACO,EAAE,CAACL,GAAG;QAAEoC,MAAM,EAAEtC,YAAY,CAACO,EAAE,CAACL;MAAI;IAChE;EACF,CAAC;EACDqC,eAAe,EAAE;IAAEH,IAAI,EAAE;EAAK;AAChC,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# avatar/ — a circular identity glyph (image, initials, or a plain placeholder)
|
|
2
|
+
|
|
3
|
+
`Avatar` is the simplest module in the library — no press handling, no loading state, no
|
|
4
|
+
animation — which is exactly why its accessibility default is the one place it deliberately
|
|
5
|
+
diverges from `Button`/`Checkbox`: an avatar is almost always rendered beside a visible name, so
|
|
6
|
+
`accessibilityLabel` is optional rather than a required trap.
|
|
7
|
+
|
|
8
|
+
## Files
|
|
9
|
+
|
|
10
|
+
| File | Role |
|
|
11
|
+
|------|------|
|
|
12
|
+
| `Avatar.tsx` | The component. Fallback precedence (image → initials → placeholder), a11y wiring. |
|
|
13
|
+
| `Avatar.variants.ts` | Pure resolvers (`AVATAR_SIZES`, `resolveAvatarColors`, `resolveAvatarAccessibility`) + the themed structural variant resolver `avatarStructure`. No React. |
|
|
14
|
+
| `index.ts` | Public surface: `Avatar`, `AvatarProps`, `AvatarSize`. |
|
|
15
|
+
| `__tests__/Avatar.test.ts` | Pure: WCAG contrast (all brands × modes) + the size scale + the a11y contract. |
|
|
16
|
+
| `__tests__/Avatar.render.test.tsx` | Render: fallback precedence, size scale, decorative-vs-labelled a11y. |
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
|
|
20
|
+
| Prop | Type | Default | Notes |
|
|
21
|
+
|------|------|---------|-------|
|
|
22
|
+
| `size` | `xs \| sm \| md \| lg \| xl` | `md` | Diameters 24 / 32 / 40 / 56 / 72 dp. |
|
|
23
|
+
| `source` | `{ uri: string }` | — | A remote image. Wins over `initials` when present. |
|
|
24
|
+
| `initials` | `string` | — | Shown when there is no `source`. Clipped to the first two characters. |
|
|
25
|
+
| `accessibilityLabel` | `string` | — | **Optional** — see Accessibility contract below. |
|
|
26
|
+
| `style` | `LayoutStyle` | — | Layout-only, outermost, applied exactly once, last. |
|
|
27
|
+
| `testID` | `string` | — | The image (when `source` is set) also gets `${testID}-image`. |
|
|
28
|
+
|
|
29
|
+
No `tone`/`color` prop: an avatar has exactly one neutral identity (`resolveAvatarColors`), the
|
|
30
|
+
same reasoning as `Checkbox`'s colour resolver — there is nothing for an app to widen.
|
|
31
|
+
|
|
32
|
+
## Accessibility contract (WCAG)
|
|
33
|
+
|
|
34
|
+
- **1.4.3** — initials text is `fg.default` on `bg.sunken`; measured ≥ 4.5:1 for every brand × mode
|
|
35
|
+
(`resolveAvatarColors`, tested in `Avatar.test.ts`).
|
|
36
|
+
- **Decorative by default, unlike `Button`'s icon-only shape.** `Button`/`Checkbox` make an
|
|
37
|
+
unlabelled interactive element a type error, because their label is the *only* carrier of
|
|
38
|
+
meaning for a screen-reader user. An avatar is not interactive and is almost always adjacent to
|
|
39
|
+
a visible name, so forcing a label here would just duplicate that name at every call site. When
|
|
40
|
+
`accessibilityLabel` is absent, the avatar (image, initials, or placeholder) is hidden from
|
|
41
|
+
assistive tech via `accessibilityElementsHidden` (iOS) + `importantForAccessibility="no-hide-
|
|
42
|
+
descendants"` (Android) — `resolveAvatarAccessibility` derives this purely, so the contract is
|
|
43
|
+
unit-tested without a renderer.
|
|
44
|
+
- When `accessibilityLabel` **is** given, the avatar is exposed as one `accessibilityRole="image"`
|
|
45
|
+
element carrying it (`accessible={true}` groups the initials `Text` into that single element
|
|
46
|
+
instead of letting it read separately).
|
|
47
|
+
- No touch target / focus-ring requirements: `Avatar` has no `onPress`, so the 44dp floor and
|
|
48
|
+
focus-ring pattern `Button`/`Checkbox` implement do not apply here.
|
|
49
|
+
|
|
50
|
+
## Patterns copied from `Button`/`Checkbox`
|
|
51
|
+
|
|
52
|
+
1. **Structure vs colour split.** Diameter + the circular radius → `createThemedVariants`
|
|
53
|
+
(`avatarStructure`, registered once per theme). Colour → resolved from role tokens
|
|
54
|
+
(`resolveAvatarColors`), applied inline.
|
|
55
|
+
2. **Pure, testable resolvers** in `Avatar.variants.ts` (no React) so the WCAG + accessibility
|
|
56
|
+
contract is unit-tested by measuring real palettes — never eyeballed.
|
|
57
|
+
3. **`radii.full` clips a circle for any diameter.** One token (a finite `9999`, not `Infinity` —
|
|
58
|
+
RN rejects non-finite style values) covers every size instead of each variant computing its own
|
|
59
|
+
`box / 2`.
|
|
60
|
+
4. **`style: LayoutStyle` last and once, no `{...rest}`** — internals never receive consumer style.
|
|
61
|
+
|
|
62
|
+
## Testing note — hidden elements and React Native Testing Library
|
|
63
|
+
|
|
64
|
+
Most render-test cases mount an *unlabelled* (decorative) avatar, which is correctly hidden from
|
|
65
|
+
assistive tech. RNTL's queries mirror a screen-reader user by default and skip hidden elements, so
|
|
66
|
+
those assertions pass `{ includeHiddenElements: true }` to still inspect content that is present in
|
|
67
|
+
the tree but intentionally unreachable by assistive tech — see `Avatar.render.test.tsx`.
|
|
68
|
+
|
|
69
|
+
## Known gaps
|
|
70
|
+
|
|
71
|
+
- No image-load-error / retry affordance in this v1 (not in the component's prop contract) — an
|
|
72
|
+
image that fails to load renders blank rather than falling back to initials.
|
|
73
|
+
|
|
74
|
+
## Performance
|
|
75
|
+
|
|
76
|
+
Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLAUDE.md`). No child library component receives a derived array/object/callback, so no `useCallback`/`useMemo` was needed.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public surface of `pixelize-native-library/avatar`. Value exports and type exports are split for
|
|
5
|
+
* `verbatimModuleSyntax`. The resolvers (`resolveAvatarColors`, `AVATAR_SIZES`, …) stay internal — a
|
|
6
|
+
* consumer configures an Avatar through its props, never by importing its internals.
|
|
7
|
+
*
|
|
8
|
+
* No `IconName` re-export here: unlike `Button`, Avatar takes no `icon` prop.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export { Avatar } from "./Avatar.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Avatar"],"sourceRoot":"../../../../src","sources":["modules/avatar/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,aAAU","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Badge — a non-interactive status/label chip. A `View`, never a `Pressable`: it carries no press,
|
|
5
|
+
* focus, loading, or disabled state, so it skips every interaction concern Button/Input have (no
|
|
6
|
+
* `hitSlop`, no focus ring, no reduced-motion — there is no animation to suppress).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { memo } from "react";
|
|
10
|
+
import { Text, View } from "react-native";
|
|
11
|
+
import { Icon } from "../../core/icon/index.js";
|
|
12
|
+
import { useTheme } from "../../theme/index.js";
|
|
13
|
+
import { BADGE_SIZES, badgeStructure, resolveBadgeAccessibility, resolveBadgeTone } from "./Badge.variants.js";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const ICON_STROKE = 2;
|
|
16
|
+
export const Badge = /*#__PURE__*/memo(function Badge({
|
|
17
|
+
tone = "accent",
|
|
18
|
+
size = "md",
|
|
19
|
+
label,
|
|
20
|
+
icon,
|
|
21
|
+
style,
|
|
22
|
+
testID
|
|
23
|
+
}) {
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
const spec = BADGE_SIZES[size];
|
|
26
|
+
const toneColors = resolveBadgeTone(theme.colors, tone);
|
|
27
|
+
const a11y = resolveBadgeAccessibility({
|
|
28
|
+
label
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
31
|
+
testID: testID,
|
|
32
|
+
accessible: a11y.accessible,
|
|
33
|
+
accessibilityRole: a11y.accessibilityRole,
|
|
34
|
+
accessibilityLabel: a11y.accessibilityLabel,
|
|
35
|
+
style: [badgeStructure(theme, {
|
|
36
|
+
size
|
|
37
|
+
}), {
|
|
38
|
+
backgroundColor: toneColors.fill,
|
|
39
|
+
borderColor: toneColors.border
|
|
40
|
+
}, style],
|
|
41
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
42
|
+
name: icon,
|
|
43
|
+
size: spec.iconSize,
|
|
44
|
+
color: toneColors.text,
|
|
45
|
+
strokeWidth: ICON_STROKE
|
|
46
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
47
|
+
numberOfLines: 1,
|
|
48
|
+
style: [theme.fontStyleForWeight(theme.fontWeights.semibold), {
|
|
49
|
+
fontSize: spec.fontSize,
|
|
50
|
+
color: toneColors.text
|
|
51
|
+
}],
|
|
52
|
+
children: label
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","Text","View","Icon","useTheme","BADGE_SIZES","badgeStructure","resolveBadgeAccessibility","resolveBadgeTone","jsx","_jsx","jsxs","_jsxs","ICON_STROKE","Badge","tone","size","label","icon","style","testID","theme","spec","toneColors","colors","a11y","accessible","accessibilityRole","accessibilityLabel","backgroundColor","fill","borderColor","border","children","name","iconSize","color","text","strokeWidth","numberOfLines","fontStyleForWeight","fontWeights","semibold","fontSize"],"sourceRoot":"../../../../src","sources":["modules/badge/Badge.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAEzC,SAASC,IAAI,QAAQ,0BAAiB;AAGtC,SAASC,QAAQ,QAAQ,sBAAa;AAEtC,SAASC,WAAW,EAAEC,cAAc,EAAEC,yBAAyB,EAAEC,gBAAgB,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAa5G,MAAMC,WAAW,GAAG,CAAC;AAErB,OAAO,MAAMC,KAAK,gBAAGd,IAAI,CAAC,SAASc,KAAKA,CAAC;EACvCC,IAAI,GAAG,QAAQ;EACfC,IAAI,GAAG,IAAI;EACXC,KAAK;EACLC,IAAI;EACJC,KAAK;EACLC;AACU,CAAC,EAAE;EACb,MAAMC,KAAK,GAAGjB,QAAQ,CAAC,CAAC;EACxB,MAAMkB,IAAI,GAAGjB,WAAW,CAACW,IAAI,CAAC;EAC9B,MAAMO,UAAU,GAAGf,gBAAgB,CAACa,KAAK,CAACG,MAAM,EAAET,IAAI,CAAC;EACvD,MAAMU,IAAI,GAAGlB,yBAAyB,CAAC;IAAEU;EAAM,CAAC,CAAC;EAEjD,oBACEL,KAAA,CAACV,IAAI;IACHkB,MAAM,EAAEA,MAAO;IACfM,UAAU,EAAED,IAAI,CAACC,UAAW;IAC5BC,iBAAiB,EAAEF,IAAI,CAACE,iBAAkB;IAC1CC,kBAAkB,EAAEH,IAAI,CAACG,kBAAmB;IAC5CT,KAAK,EAAE,CACLb,cAAc,CAACe,KAAK,EAAE;MAAEL;IAAK,CAAC,CAAC,EAC/B;MAAEa,eAAe,EAAEN,UAAU,CAACO,IAAI;MAAEC,WAAW,EAAER,UAAU,CAACS;IAAO,CAAC,EACpEb,KAAK,CACL;IAAAc,QAAA,GAEDf,IAAI,iBAAIR,IAAA,CAACP,IAAI;MAAC+B,IAAI,EAAEhB,IAAK;MAACF,IAAI,EAAEM,IAAI,CAACa,QAAS;MAACC,KAAK,EAAEb,UAAU,CAACc,IAAK;MAACC,WAAW,EAAEzB;IAAY,CAAE,CAAC,eACpGH,IAAA,CAACT,IAAI;MACHsC,aAAa,EAAE,CAAE;MACjBpB,KAAK,EAAE,CACLE,KAAK,CAACmB,kBAAkB,CAACnB,KAAK,CAACoB,WAAW,CAACC,QAAQ,CAAC,EACpD;QAAEC,QAAQ,EAAErB,IAAI,CAACqB,QAAQ;QAAEP,KAAK,EAAEb,UAAU,CAACc;MAAK,CAAC,CACnD;MAAAJ,QAAA,EAEDhB;IAAK,CACF,CAAC;EAAA,CACH,CAAC;AAEX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Badge's style resolution — same split as Button/Input:
|
|
5
|
+
* - STRUCTURE (height, padding, radius, border WIDTH) lives in the themed `badgeStructure`
|
|
6
|
+
* resolver, static per (brand, mode), registered once via `StyleSheet.create`.
|
|
7
|
+
* - COLOUR is `tone`-driven and resolved by `resolveBadgeTone` from the theme's ROLE colours,
|
|
8
|
+
* never a raw ramp and never a hardcoded hex.
|
|
9
|
+
*
|
|
10
|
+
* Free of React and of `lucide`, so the WCAG tests import it directly (mocking only
|
|
11
|
+
* `react-native`'s `StyleSheet`, as `core/style` does).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createThemedVariants } from "../../core/style/index.js";
|
|
15
|
+
|
|
16
|
+
/** `accent`/`neutral` are brand-driven emphasis; the rest mirror the theme's status roles. */
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Badge-specific dimensions — a chip is never a touch target (Badge is a `View`, not a
|
|
20
|
+
* `Pressable`), so there is no `hitSlop`/44dp floor here, unlike Button/Input. `fontSize`/`iconSize`
|
|
21
|
+
* sit on the same +2 icon-over-label offset Button uses, one step down its scale (12/14 vs 14/16).
|
|
22
|
+
*/
|
|
23
|
+
export const BADGE_SIZES = {
|
|
24
|
+
sm: {
|
|
25
|
+
height: 20,
|
|
26
|
+
fontSize: 12,
|
|
27
|
+
iconSize: 14
|
|
28
|
+
},
|
|
29
|
+
md: {
|
|
30
|
+
height: 24,
|
|
31
|
+
fontSize: 14,
|
|
32
|
+
iconSize: 16
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Maps a `tone` onto the theme's role colours — the reason the prop is a closed union and not
|
|
37
|
+
* `color?: string`. Every colour a Badge can show is one of these role lookups.
|
|
38
|
+
*
|
|
39
|
+
* `accent`/`neutral` mirror Button's tone shapes but always at the "subtle" emphasis (a badge is
|
|
40
|
+
* a passive label, never a filled call-to-action): `accent` tints toward the brand, `neutral` is
|
|
41
|
+
* the monochrome high-emphasis pairing (`bg.sunken` + `fg.default`), both bordered by the same
|
|
42
|
+
* `border.interactive` outline Button uses for its outline variant (measured ≥ 3:1 against the
|
|
43
|
+
* canvas AND against either subtle fill on all 8 brands × both modes — see `Badge.test.ts`).
|
|
44
|
+
*
|
|
45
|
+
* The four status tones deliberately do NOT read `StatusColors.border`: that field (`ramp[200]`)
|
|
46
|
+
* is documented as "decorative chip/badge outline", but measured, it clears neither 3:1 against
|
|
47
|
+
* the canvas nor against its own `subtle` fill on ANY brand × mode (as low as 1.26:1) — the same
|
|
48
|
+
* class of gap `Input.variants.ts` found and fixed for `danger` alone (reading `.solid` there
|
|
49
|
+
* instead). `.solid` does not generalise here: it clears 3:1 for `danger` but not for
|
|
50
|
+
* `success`/`warning`/`info` in light mode (as low as 1.84:1). `StatusColors.text` is the one
|
|
51
|
+
* field proven ≥ 3:1 against both the canvas and the subtle fill for EVERY status role, brand, and
|
|
52
|
+
* mode (it is picked by `readableOn` for ≥ 4.5:1 against `subtle`, which already implies ≥ 3:1,
|
|
53
|
+
* and measures ≥ 5.05:1 against the canvas incidentally) — so the border reuses it, giving a
|
|
54
|
+
* coloured outline that always matches the label, never an unreadable hairline.
|
|
55
|
+
*/
|
|
56
|
+
export function resolveBadgeTone(colors, tone) {
|
|
57
|
+
switch (tone) {
|
|
58
|
+
case "accent":
|
|
59
|
+
return {
|
|
60
|
+
fill: colors.accent.subtle,
|
|
61
|
+
text: colors.accent.text,
|
|
62
|
+
border: colors.border.interactive
|
|
63
|
+
};
|
|
64
|
+
case "neutral":
|
|
65
|
+
return {
|
|
66
|
+
fill: colors.bg.sunken,
|
|
67
|
+
text: colors.fg.default,
|
|
68
|
+
border: colors.border.interactive
|
|
69
|
+
};
|
|
70
|
+
default:
|
|
71
|
+
return statusTone(colors.status[tone]);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function statusTone(status) {
|
|
75
|
+
return {
|
|
76
|
+
fill: status.subtle,
|
|
77
|
+
text: status.text,
|
|
78
|
+
border: status.text
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Derives the accessibility surface once, purely, so it's testable without a renderer. A Badge is
|
|
83
|
+
* never interactive, so unlike Button/Input there is no `disabled`/`busy` state to report — just
|
|
84
|
+
* the single accessible name a screen reader announces for the whole chip.
|
|
85
|
+
*/
|
|
86
|
+
export function resolveBadgeAccessibility(input) {
|
|
87
|
+
return {
|
|
88
|
+
accessible: true,
|
|
89
|
+
accessibilityRole: "text",
|
|
90
|
+
accessibilityLabel: input.label
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Structural styles only — layout, height, padding, radius, border WIDTH. No colours (those are
|
|
96
|
+
* tone-driven and applied inline over this), so this compiles once per theme identity via the
|
|
97
|
+
* `WeakMap`-cached themed resolver and never rebuilds per render.
|
|
98
|
+
*/
|
|
99
|
+
export const badgeStructure = createThemedVariants(theme => ({
|
|
100
|
+
base: {
|
|
101
|
+
flexDirection: "row",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
justifyContent: "center",
|
|
104
|
+
columnGap: theme.space[1],
|
|
105
|
+
borderRadius: theme.radii.base,
|
|
106
|
+
borderWidth: theme.borderWidths.thin
|
|
107
|
+
},
|
|
108
|
+
variants: {
|
|
109
|
+
size: {
|
|
110
|
+
sm: {
|
|
111
|
+
height: BADGE_SIZES.sm.height,
|
|
112
|
+
paddingHorizontal: theme.space[2]
|
|
113
|
+
},
|
|
114
|
+
md: {
|
|
115
|
+
height: BADGE_SIZES.md.height,
|
|
116
|
+
paddingHorizontal: theme.space[3]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
defaultVariants: {
|
|
121
|
+
size: "md"
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
//# sourceMappingURL=Badge.variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createThemedVariants","BADGE_SIZES","sm","height","fontSize","iconSize","md","resolveBadgeTone","colors","tone","fill","accent","subtle","text","border","interactive","bg","sunken","fg","default","statusTone","status","resolveBadgeAccessibility","input","accessible","accessibilityRole","accessibilityLabel","label","badgeStructure","theme","base","flexDirection","alignItems","justifyContent","columnGap","space","borderRadius","radii","borderWidth","borderWidths","thin","variants","size","paddingHorizontal","defaultVariants"],"sourceRoot":"../../../../src","sources":["modules/badge/Badge.variants.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,oBAAoB,QAAQ,2BAAkB;;AAGvD;;AAYA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAG;EACzBC,EAAE,EAAE;IAAEC,MAAM,EAAE,EAAE;IAAEC,QAAQ,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG,CAAC;EAC9CC,EAAE,EAAE;IAAEH,MAAM,EAAE,EAAE;IAAEC,QAAQ,EAAE,EAAE;IAAEC,QAAQ,EAAE;EAAG;AAC/C,CAAqD;AAWrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAACC,MAAkB,EAAEC,IAAe,EAAmB;EACrF,QAAQA,IAAI;IACV,KAAK,QAAQ;MACX,OAAO;QAAEC,IAAI,EAAEF,MAAM,CAACG,MAAM,CAACC,MAAM;QAAEC,IAAI,EAAEL,MAAM,CAACG,MAAM,CAACE,IAAI;QAAEC,MAAM,EAAEN,MAAM,CAACM,MAAM,CAACC;MAAY,CAAC;IACpG,KAAK,SAAS;MACZ,OAAO;QAAEL,IAAI,EAAEF,MAAM,CAACQ,EAAE,CAACC,MAAM;QAAEJ,IAAI,EAAEL,MAAM,CAACU,EAAE,CAACC,OAAO;QAAEL,MAAM,EAAEN,MAAM,CAACM,MAAM,CAACC;MAAY,CAAC;IAC/F;MACE,OAAOK,UAAU,CAACZ,MAAM,CAACa,MAAM,CAACZ,IAAI,CAAC,CAAC;EAC1C;AACF;AAEA,SAASW,UAAUA,CAACC,MAAoB,EAAmB;EACzD,OAAO;IAAEX,IAAI,EAAEW,MAAM,CAACT,MAAM;IAAEC,IAAI,EAAEQ,MAAM,CAACR,IAAI;IAAEC,MAAM,EAAEO,MAAM,CAACR;EAAK,CAAC;AACxE;AAaA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,yBAAyBA,CAACC,KAA8B,EAA2B;EACjG,OAAO;IAAEC,UAAU,EAAE,IAAI;IAAEC,iBAAiB,EAAE,MAAM;IAAEC,kBAAkB,EAAEH,KAAK,CAACI;EAAM,CAAC;AACzF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG5B,oBAAoB,CAAE6B,KAAY,KAAM;EACpEC,IAAI,EAAE;IACJC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAEL,KAAK,CAACM,KAAK,CAAC,CAAC,CAAC;IACzBC,YAAY,EAAEP,KAAK,CAACQ,KAAK,CAACP,IAAI;IAC9BQ,WAAW,EAAET,KAAK,CAACU,YAAY,CAACC;EAClC,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJxC,EAAE,EAAE;QAAEC,MAAM,EAAEF,WAAW,CAACC,EAAE,CAACC,MAAM;QAAEwC,iBAAiB,EAAEd,KAAK,CAACM,KAAK,CAAC,CAAC;MAAE,CAAC;MACxE7B,EAAE,EAAE;QAAEH,MAAM,EAAEF,WAAW,CAACK,EAAE,CAACH,MAAM;QAAEwC,iBAAiB,EAAEd,KAAK,CAACM,KAAK,CAAC,CAAC;MAAE;IACzE;EACF,CAAC;EACDS,eAAe,EAAE;IAAEF,IAAI,EAAE;EAAK;AAChC,CAAC,CAAC,CAAC","ignoreList":[]}
|