pixelize-native-library 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/module/core/MODULE.md +2 -1
- package/lib/module/core/gradient/AccentGradientFill.js +80 -0
- package/lib/module/core/gradient/darkenHex.js +13 -0
- package/lib/module/core/gradient/gradientStops.js +27 -0
- package/lib/module/core/gradient/index.js +7 -0
- package/lib/module/core/gradient/withAlpha.js +19 -0
- package/lib/module/core/haptics/MODULE.md +4 -0
- package/lib/module/core/haptics/context.js +7 -0
- package/lib/module/core/haptics/haptics.js +17 -0
- package/lib/module/core/haptics/index.js +6 -0
- package/lib/module/core/haptics/useHaptics.js +73 -0
- package/lib/module/core/icon/MODULE.md +16 -9
- package/lib/module/core/icon/icons/trending-up.js +10 -0
- package/lib/module/core/icon/resolve.js +2 -0
- package/lib/module/core/media/expoImage.js +6 -0
- package/lib/module/core/motion/MODULE.md +12 -12
- package/lib/module/core/motion/config.js +4 -1
- package/lib/module/core/motion/index.js +2 -1
- package/lib/module/core/motion/usePressState.js +145 -0
- package/lib/module/core/style/index.js +1 -0
- package/lib/module/core/style/radius.js +4 -0
- package/lib/module/index.js +1 -0
- package/lib/module/modules/accordion/Accordion.js +69 -49
- package/lib/module/modules/accordion/Accordion.variants.js +4 -3
- package/lib/module/modules/accordion/MODULE.md +2 -1
- package/lib/module/modules/alert-dialog/AlertDialog.js +6 -5
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js +4 -0
- package/lib/module/modules/app-bar/AppBar.js +6 -4
- package/lib/module/modules/app-bar/AppBar.variants.js +1 -2
- package/lib/module/modules/avatar/Avatar.js +7 -1
- package/lib/module/modules/avatar/Avatar.variants.js +1 -1
- package/lib/module/modules/avatar/MODULE.md +2 -2
- package/lib/module/modules/avatar-group/AvatarGroup.js +10 -6
- package/lib/module/modules/avatar-group/AvatarGroup.variants.js +23 -0
- package/lib/module/modules/avatar-group/MODULE.md +16 -0
- package/lib/module/modules/badge/Badge.js +11 -5
- package/lib/module/modules/badge/Badge.variants.js +2 -1
- package/lib/module/modules/badge/MODULE.md +5 -5
- package/lib/module/modules/banner/Banner.js +106 -60
- package/lib/module/modules/banner/Banner.variants.js +2 -2
- package/lib/module/modules/banner/MODULE.md +7 -2
- package/lib/module/modules/bottom-nav/BottomNav.js +6 -3
- package/lib/module/modules/bottom-nav/BottomNav.variants.js +9 -10
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js +28 -4
- package/lib/module/modules/bottom-nav/BottomNavTab.js +28 -4
- package/lib/module/modules/bottom-nav/MODULE.md +10 -1
- package/lib/module/modules/bottom-sheet/BottomSheet.js +20 -7
- package/lib/module/modules/bottom-sheet/BottomSheet.variants.js +15 -5
- package/lib/module/modules/bottom-sheet/MODULE.md +13 -2
- package/lib/module/modules/button/Button.js +87 -101
- package/lib/module/modules/button/Button.variants.js +8 -7
- package/lib/module/modules/button/MODULE.md +6 -0
- package/lib/module/modules/button-group/ButtonGroup.js +36 -37
- package/lib/module/modules/button-group/ButtonGroup.variants.js +21 -46
- package/lib/module/modules/button-group/MODULE.md +25 -30
- package/lib/module/modules/card/Card.js +117 -19
- package/lib/module/modules/card/Card.variants.js +1 -0
- package/lib/module/modules/card/MODULE.md +13 -10
- package/lib/module/modules/charts/BarChart.js +29 -14
- package/lib/module/modules/charts/BarList.js +31 -18
- package/lib/module/modules/charts/Charts.variants.js +66 -2
- package/lib/module/modules/charts/DonutChart.js +9 -4
- package/lib/module/modules/charts/LineChart.js +5 -3
- package/lib/module/modules/charts/MODULE.md +24 -11
- package/lib/module/modules/charts/PieChart.js +13 -4
- package/lib/module/modules/charts/Sparkline.js +4 -2
- package/lib/module/modules/checkbox/Checkbox.js +10 -2
- package/lib/module/modules/checkbox/MODULE.md +5 -0
- package/lib/module/modules/chip/Chip.js +83 -38
- package/lib/module/modules/chip/Chip.variants.js +15 -3
- package/lib/module/modules/chip/MODULE.md +6 -4
- package/lib/module/modules/combobox/Combobox.js +93 -57
- package/lib/module/modules/combobox/Combobox.variants.js +22 -7
- package/lib/module/modules/combobox/MODULE.md +14 -4
- package/lib/module/modules/composer/Composer.js +9 -2
- package/lib/module/modules/composer/Composer.variants.js +2 -0
- package/lib/module/modules/composer/MODULE.md +5 -0
- package/lib/module/modules/copy-button/CopyButton.js +22 -4
- package/lib/module/modules/copy-button/CopyButton.variants.js +4 -2
- package/lib/module/modules/copy-button/MODULE.md +5 -0
- package/lib/module/modules/data-table/DataTable.js +28 -9
- package/lib/module/modules/data-table/DataTable.variants.js +3 -2
- package/lib/module/modules/data-table/MODULE.md +1 -0
- package/lib/module/modules/date-picker/Calendar.js +75 -29
- package/lib/module/modules/date-picker/DatePicker.variants.js +24 -9
- package/lib/module/modules/date-picker/MODULE.md +25 -4
- package/lib/module/modules/date-picker/PickerField.js +13 -4
- package/lib/module/modules/date-picker/PickerShell.js +2 -0
- package/lib/module/modules/date-picker/TimePicker.js +13 -18
- package/lib/module/modules/divider/Divider.variants.js +6 -5
- package/lib/module/modules/divider/MODULE.md +2 -0
- package/lib/module/modules/drawer/Drawer.js +20 -8
- package/lib/module/modules/drawer/Drawer.variants.js +4 -4
- package/lib/module/modules/drawer/MODULE.md +3 -0
- package/lib/module/modules/empty-state/EmptyState.js +18 -29
- package/lib/module/modules/empty-state/EmptyState.variants.js +7 -0
- package/lib/module/modules/empty-state/MODULE.md +1 -0
- package/lib/module/modules/fab/Fab.js +41 -61
- package/lib/module/modules/fab/Fab.variants.js +15 -1
- package/lib/module/modules/fab/FabGroup.js +84 -57
- package/lib/module/modules/fab/MODULE.md +19 -6
- package/lib/module/modules/file-grid/FileGrid.js +30 -16
- package/lib/module/modules/file-grid/FileGrid.variants.js +2 -2
- package/lib/module/modules/file-grid/MODULE.md +3 -1
- package/lib/module/modules/file-upload/FileUpload.variants.js +3 -1
- package/lib/module/modules/file-upload/MODULE.md +2 -0
- package/lib/module/modules/filter-sheet/FilterChip.js +11 -3
- package/lib/module/modules/filter-sheet/FilterSheetBody.js +15 -3
- package/lib/module/modules/filter-sheet/MODULE.md +9 -0
- package/lib/module/modules/folder-row/FolderRow.js +29 -17
- package/lib/module/modules/folder-row/FolderRow.variants.js +4 -2
- package/lib/module/modules/folder-row/MODULE.md +2 -1
- package/lib/module/modules/gantt/Gantt.js +30 -9
- package/lib/module/modules/gantt/Gantt.variants.js +36 -0
- package/lib/module/modules/gantt/MODULE.md +11 -1
- package/lib/module/modules/image-viewer/ImageViewer.js +35 -5
- package/lib/module/modules/image-viewer/MODULE.md +6 -0
- package/lib/module/modules/input/Input.js +20 -7
- package/lib/module/modules/input/Input.variants.js +8 -7
- package/lib/module/modules/input/MODULE.md +2 -0
- package/lib/module/modules/list-item/ListItem.js +48 -26
- package/lib/module/modules/list-item/ListItem.variants.js +11 -2
- package/lib/module/modules/list-item/MODULE.md +2 -3
- package/lib/module/modules/markdown/MODULE.md +8 -1
- package/lib/module/modules/markdown/Markdown.js +57 -22
- package/lib/module/modules/markdown/Markdown.variants.js +2 -1
- package/lib/module/modules/menu/MODULE.md +11 -0
- package/lib/module/modules/menu/Menu.js +99 -40
- package/lib/module/modules/menu/Menu.variants.js +3 -3
- package/lib/module/modules/message-bubble/MODULE.md +4 -1
- package/lib/module/modules/message-bubble/MessageBubble.js +4 -5
- package/lib/module/modules/message-bubble/MessageBubble.variants.js +5 -5
- package/lib/module/modules/modal/MODULE.md +11 -0
- package/lib/module/modules/modal/Modal.js +87 -35
- package/lib/module/modules/modal/Modal.variants.js +2 -2
- package/lib/module/modules/more-items/MODULE.md +5 -0
- package/lib/module/modules/more-items/MoreItems.js +7 -1
- package/lib/module/modules/more-items/MoreItems.variants.js +4 -1
- package/lib/module/modules/multi-select/MODULE.md +5 -0
- package/lib/module/modules/multi-select/MultiSelect.js +23 -1
- package/lib/module/modules/multi-select/MultiSelect.variants.js +4 -2
- package/lib/module/modules/number-input/MODULE.md +2 -1
- package/lib/module/modules/number-input/NumberInput.js +97 -84
- package/lib/module/modules/number-input/NumberInput.variants.js +9 -6
- package/lib/module/modules/org-switcher/MODULE.md +13 -1
- package/lib/module/modules/org-switcher/OrgSwitcher.js +13 -2
- package/lib/module/modules/org-switcher/OrgSwitcher.variants.js +4 -2
- package/lib/module/modules/pagination/MODULE.md +2 -2
- package/lib/module/modules/pagination/Pagination.js +76 -37
- package/lib/module/modules/pagination/Pagination.variants.js +4 -2
- package/lib/module/modules/pagination/PaginationControls.js +55 -35
- package/lib/module/modules/pin-input/MODULE.md +5 -1
- package/lib/module/modules/pin-input/PinInput.js +9 -2
- package/lib/module/modules/pin-input/PinInput.variants.js +2 -1
- package/lib/module/modules/radio-group/MODULE.md +2 -2
- package/lib/module/modules/radio-group/RadioGroup.js +122 -63
- package/lib/module/modules/radio-group/RadioGroup.variants.js +2 -1
- package/lib/module/modules/reorder/MODULE.md +2 -0
- package/lib/module/modules/reorder/Reorder.js +4 -3
- package/lib/module/modules/reorder/Reorder.variants.js +4 -2
- package/lib/module/modules/rich-text/MODULE.md +3 -1
- package/lib/module/modules/rich-text/RichText.js +42 -22
- package/lib/module/modules/rich-text-editor/MODULE.md +4 -1
- package/lib/module/modules/rich-text-editor/RichTextEditor.js +8 -1
- package/lib/module/modules/rich-text-editor/RichTextEditor.variants.js +9 -6
- package/lib/module/modules/screen/MODULE.md +7 -0
- package/lib/module/modules/screen/Screen.js +50 -17
- package/lib/module/modules/screen/Screen.variants.js +18 -0
- package/lib/module/modules/search-bar/MODULE.md +1 -0
- package/lib/module/modules/search-bar/SearchBar.js +46 -26
- package/lib/module/modules/search-bar/SearchBar.variants.js +11 -8
- package/lib/module/modules/section/MODULE.md +2 -0
- package/lib/module/modules/section/Section.js +8 -15
- package/lib/module/modules/section/Section.variants.js +1 -6
- package/lib/module/modules/segmented-control/MODULE.md +3 -1
- package/lib/module/modules/segmented-control/SegmentedControl.js +110 -46
- package/lib/module/modules/segmented-control/SegmentedControl.variants.js +3 -2
- package/lib/module/modules/select/MODULE.md +26 -5
- package/lib/module/modules/select/Select.js +39 -12
- package/lib/module/modules/select/Select.variants.js +36 -12
- package/lib/module/modules/skeleton/MODULE.md +23 -27
- package/lib/module/modules/skeleton/Skeleton.js +46 -51
- package/lib/module/modules/skeleton/Skeleton.variants.js +17 -75
- package/lib/module/modules/slider/MODULE.md +2 -0
- package/lib/module/modules/slider/Slider.js +2 -1
- package/lib/module/modules/stage-progress/MODULE.md +12 -8
- package/lib/module/modules/stage-progress/StageProgress.js +94 -47
- package/lib/module/modules/stage-progress/StageProgress.variants.js +17 -12
- package/lib/module/modules/stat-tile/MODULE.md +2 -0
- package/lib/module/modules/stat-tile/StatTile.js +15 -10
- package/lib/module/modules/stat-tile/StatTile.variants.js +2 -0
- package/lib/module/modules/state-block/MODULE.md +3 -0
- package/lib/module/modules/state-block/StateBlock.js +11 -6
- package/lib/module/modules/state-block/StateBlock.variants.js +7 -0
- package/lib/module/modules/surface/MODULE.md +59 -0
- package/lib/module/modules/surface/Surface.js +42 -0
- package/lib/module/modules/surface/Surface.variants.js +33 -0
- package/lib/module/modules/surface/index.js +4 -0
- package/lib/module/modules/swipeable-row/MODULE.md +9 -0
- package/lib/module/modules/swipeable-row/SwipeableRow.js +28 -7
- package/lib/module/modules/switch/MODULE.md +2 -0
- package/lib/module/modules/switch/Switch.js +8 -2
- package/lib/module/modules/tabs/MODULE.md +2 -1
- package/lib/module/modules/tabs/Tabs.js +37 -18
- package/lib/module/modules/tabs/Tabs.variants.js +4 -2
- package/lib/module/modules/text/MODULE.md +5 -2
- package/lib/module/modules/text/Text.js +18 -6
- package/lib/module/modules/text/Text.variants.js +108 -44
- package/lib/module/modules/textarea/MODULE.md +2 -0
- package/lib/module/modules/textarea/Textarea.js +3 -2
- package/lib/module/modules/textarea/Textarea.variants.js +2 -1
- package/lib/module/modules/toast/MODULE.md +8 -4
- package/lib/module/modules/toast/Toast.js +31 -13
- package/lib/module/modules/toast/Toast.variants.js +5 -0
- package/lib/module/modules/tooltip/MODULE.md +15 -11
- package/lib/module/modules/tooltip/Tooltip.js +41 -9
- package/lib/module/modules/tooltip/Tooltip.variants.js +8 -1
- package/lib/module/theme/MODULE.md +3 -1
- package/lib/module/theme/platform/MODULE.md +14 -2
- package/lib/module/theme/platform/elevation.native.js +0 -44
- package/lib/module/theme/platform/floatingSurface.native.js +75 -0
- package/lib/module/theme/platform/highlight.native.js +59 -0
- package/lib/module/theme/platform/index.js +5 -0
- package/lib/module/theme/platform/motion.native.js +31 -11
- package/lib/module/theme/platform/stateLayer.native.js +14 -0
- package/lib/module/theme/platform/surfaces.native.js +11 -0
- package/lib/module/theme/provider/PixelizeProvider.js +12 -5
- package/lib/module/theme/tokens/MODULE.md +32 -28
- package/lib/module/theme/tokens/THEME-CONTRACT.md +137 -0
- package/lib/module/theme/tokens/assertPalette.js +29 -0
- package/lib/module/theme/tokens/brands/emerald/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/lavender/palette.light.js +3 -2
- package/lib/module/theme/tokens/brands/meadow/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/radiant/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/skyline/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/slate/palette.light.js +8 -10
- package/lib/module/theme/tokens/brands/storefront/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/zinc/palette.dark.js +3 -2
- package/lib/module/theme/tokens/brands/zinc/palette.light.js +3 -2
- package/lib/module/theme/tokens/builders/buildDarkPalette.js +3 -2
- package/lib/module/theme/tokens/builders/finalizePalette.js +34 -0
- package/lib/module/theme/tokens/builders/liftToContrast.js +44 -0
- package/lib/module/theme/tokens/builders/placeholderInk.js +22 -0
- package/lib/module/theme/tokens/builders/semanticText.js +14 -0
- package/lib/module/theme/tokens/builders/surfaceRungs.js +44 -0
- package/lib/module/theme/tokens/index.js +5 -0
- package/lib/module/theme/tokens/roles/index.js +5 -0
- package/lib/typescript/core/gradient/AccentGradientFill.d.ts +7 -0
- package/lib/typescript/core/gradient/darkenHex.d.ts +2 -0
- package/lib/typescript/core/gradient/gradientStops.d.ts +10 -0
- package/lib/typescript/core/gradient/index.d.ts +5 -0
- package/lib/typescript/core/gradient/withAlpha.d.ts +2 -0
- package/lib/typescript/core/haptics/context.d.ts +3 -0
- package/lib/typescript/core/haptics/haptics.d.ts +33 -0
- package/lib/typescript/core/haptics/index.d.ts +6 -0
- package/lib/typescript/core/haptics/useHaptics.d.ts +12 -0
- package/lib/typescript/core/icon/icons/trending-up.d.ts +3 -0
- package/lib/typescript/core/icon/names.d.ts +1 -1
- package/lib/typescript/core/media/expoImage.d.ts +15 -6
- package/lib/typescript/core/media/pickers.d.ts +5 -5
- package/lib/typescript/core/motion/config.d.ts +2 -1
- package/lib/typescript/core/motion/index.d.ts +3 -1
- package/lib/typescript/core/motion/usePressState.d.ts +21 -0
- package/lib/typescript/core/style/index.d.ts +1 -0
- package/lib/typescript/core/style/radius.d.ts +2 -0
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts +2 -2
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts +1 -0
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts +1 -1
- package/lib/typescript/modules/avatar-group/AvatarGroup.d.ts +4 -2
- package/lib/typescript/modules/avatar-group/AvatarGroup.variants.d.ts +19 -0
- package/lib/typescript/modules/banner/Banner.d.ts +2 -0
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts +1 -3
- package/lib/typescript/modules/bottom-sheet/BottomSheet.variants.d.ts +3 -1
- package/lib/typescript/modules/button/Button.d.ts +0 -25
- package/lib/typescript/modules/button/Button.variants.d.ts +6 -6
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts +0 -19
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts +22 -56
- package/lib/typescript/modules/card/Card.d.ts +7 -5
- package/lib/typescript/modules/charts/Charts.variants.d.ts +29 -1
- package/lib/typescript/modules/chip/Chip.d.ts +3 -1
- package/lib/typescript/modules/chip/Chip.variants.d.ts +6 -2
- package/lib/typescript/modules/chip/index.d.ts +1 -1
- package/lib/typescript/modules/combobox/Combobox.variants.d.ts +17 -4
- package/lib/typescript/modules/data-table/DataTable.variants.d.ts +1 -1
- package/lib/typescript/modules/date-picker/DatePicker.variants.d.ts +15 -3
- package/lib/typescript/modules/date-picker/TimePicker.d.ts +1 -7
- package/lib/typescript/modules/divider/Divider.variants.d.ts +4 -4
- package/lib/typescript/modules/empty-state/EmptyState.d.ts +2 -0
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts +1 -0
- package/lib/typescript/modules/fab/Fab.variants.d.ts +2 -0
- package/lib/typescript/modules/folder-row/FolderRow.d.ts +0 -8
- package/lib/typescript/modules/gantt/Gantt.variants.d.ts +21 -0
- package/lib/typescript/modules/input/Input.variants.d.ts +6 -6
- package/lib/typescript/modules/list-item/ListItem.d.ts +1 -5
- package/lib/typescript/modules/list-item/ListItem.variants.d.ts +137 -1
- package/lib/typescript/modules/markdown/Markdown.d.ts +7 -0
- package/lib/typescript/modules/message-bubble/MessageBubble.d.ts +2 -2
- package/lib/typescript/modules/message-bubble/MessageBubble.variants.d.ts +1 -2
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts +7 -5
- package/lib/typescript/modules/pagination/PaginationControls.d.ts +1 -4
- package/lib/typescript/modules/reorder/Reorder.d.ts +1 -1
- package/lib/typescript/modules/screen/Screen.d.ts +3 -9
- package/lib/typescript/modules/screen/Screen.variants.d.ts +4 -0
- package/lib/typescript/modules/search-bar/SearchBar.variants.d.ts +6 -6
- package/lib/typescript/modules/section/Section.variants.d.ts +0 -3
- package/lib/typescript/modules/segmented-control/SegmentedControl.variants.d.ts +1 -1
- package/lib/typescript/modules/select/Select.d.ts +4 -1
- package/lib/typescript/modules/select/Select.variants.d.ts +22 -8
- package/lib/typescript/modules/select/index.d.ts +1 -1
- package/lib/typescript/modules/skeleton/Skeleton.d.ts +3 -18
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts +12 -68
- package/lib/typescript/modules/stage-progress/StageProgress.variants.d.ts +15 -6
- package/lib/typescript/modules/state-block/StateBlock.d.ts +4 -0
- package/lib/typescript/modules/state-block/StateBlock.variants.d.ts +1 -0
- package/lib/typescript/modules/surface/Surface.d.ts +19 -0
- package/lib/typescript/modules/surface/Surface.variants.d.ts +15 -0
- package/lib/typescript/modules/surface/index.d.ts +4 -0
- package/lib/typescript/modules/text/Text.d.ts +8 -4
- package/lib/typescript/modules/text/Text.variants.d.ts +14 -11
- package/lib/typescript/modules/toast/Toast.variants.d.ts +2 -0
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts +7 -0
- package/lib/typescript/theme/index.d.ts +1 -1
- package/lib/typescript/theme/platform/elevation.native.d.ts +0 -30
- package/lib/typescript/theme/platform/floatingSurface.native.d.ts +10 -0
- package/lib/typescript/theme/platform/highlight.native.d.ts +17 -0
- package/lib/typescript/theme/platform/index.d.ts +9 -0
- package/lib/typescript/theme/platform/motion.native.d.ts +33 -13
- package/lib/typescript/theme/platform/stateLayer.native.d.ts +11 -0
- package/lib/typescript/theme/platform/surfaces.native.d.ts +8 -0
- package/lib/typescript/theme/provider/PixelizeProvider.d.ts +1 -1
- package/lib/typescript/theme/provider/types.d.ts +8 -0
- package/lib/typescript/theme/tokens/assertPalette.d.ts +10 -0
- package/lib/typescript/theme/tokens/brands/emerald/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/lavender/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/meadow/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/radiant/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/rosewood/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/skyline/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/slate/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/storefront/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/brands/zinc/palette.light.d.ts +4 -3
- package/lib/typescript/theme/tokens/builders/finalizePalette.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/liftToContrast.d.ts +9 -0
- package/lib/typescript/theme/tokens/builders/placeholderInk.d.ts +13 -0
- package/lib/typescript/theme/tokens/builders/semanticText.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/surfaceRungs.d.ts +12 -0
- package/lib/typescript/theme/tokens/index.d.ts +5 -0
- package/lib/typescript/theme/tokens/roles/index.d.ts +1 -0
- package/lib/typescript/theme/tokens/types.d.ts +8 -7
- package/package.json +10 -2
- package/registry.json +5 -0
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { memo, useMemo, useState } from "react";
|
|
4
4
|
import { StyleSheet, View } from "react-native";
|
|
5
5
|
import Svg, { Circle, Line, Path, Text as SvgText } from "react-native-svg";
|
|
6
|
+
import { useDeviceTier } from "../../core/device/index.js";
|
|
6
7
|
import { useTheme } from "../../theme/hooks.js";
|
|
7
8
|
import { ChartLegend } from "./ChartLegend.js";
|
|
8
|
-
import { buildAreaPath, buildLinePath, categoricalColorAt, decimateSeries, defaultNumberFormatter, describeMarker, niceScale, resolveChartAxisColors, resolveLineDomain, resolveSeriesPoints, scaleValue, seriesDashAt, seriesShapeAt, summarizeLineChart } from "./Charts.variants.js";
|
|
9
|
+
import { buildAreaPath, buildLinePath, categoricalColorAt, decimateSeries, defaultNumberFormatter, describeMarker, maxRenderedPoints, niceScale, resolveChartAxisColors, resolveLineDomain, resolveSeriesPoints, scaleValue, seriesDashAt, seriesShapeAt, summarizeLineChart } from "./Charts.variants.js";
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
const Y_AXIS_WIDTH = 40;
|
|
11
12
|
const X_AXIS_HEIGHT = 24;
|
|
@@ -33,6 +34,7 @@ export const LineChart = /*#__PURE__*/memo(function LineChart({
|
|
|
33
34
|
const theme = useTheme();
|
|
34
35
|
const axisColors = useMemo(() => resolveChartAxisColors(theme.colors), [theme.colors]);
|
|
35
36
|
const [width, setWidth] = useState(0);
|
|
37
|
+
const tier = useDeviceTier();
|
|
36
38
|
const onLayout = event => {
|
|
37
39
|
setWidth(event.nativeEvent.layout.width);
|
|
38
40
|
};
|
|
@@ -40,8 +42,8 @@ export const LineChart = /*#__PURE__*/memo(function LineChart({
|
|
|
40
42
|
const plotHeight = Math.max(0, height - X_AXIS_HEIGHT - PLOT_TOP);
|
|
41
43
|
const decimatedSeries = useMemo(() => series.map(s => ({
|
|
42
44
|
...s,
|
|
43
|
-
data: decimateSeries(s.data, datumY)
|
|
44
|
-
})), [series]);
|
|
45
|
+
data: decimateSeries(s.data, datumY, maxRenderedPoints(tier))
|
|
46
|
+
})), [series, tier]);
|
|
45
47
|
const {
|
|
46
48
|
plotted,
|
|
47
49
|
paths,
|
|
@@ -31,7 +31,9 @@ breakdowns have no closed-union role) — a deliberate, documented exception to
|
|
|
31
31
|
`centerLabel?`, `centerSublabel?`, `showLegend?` (true — **new**), `style?`, `testID?`. Non-finite /
|
|
32
32
|
≤ 0 segment values are dropped; with no valid segments only the `bg.sunken` track ring renders.
|
|
33
33
|
`segment.label` (previously accepted but silently dropped) now renders as a legend row, falling
|
|
34
|
-
back to `"Segment N"` when omitted; the legend is skipped for 0–1 valid segments.
|
|
34
|
+
back to `"Segment N"` when omitted; the legend is skipped for 0–1 valid segments. Each legend row
|
|
35
|
+
also carries a knocked-out shape keyed off the segment's own index in `segments[]`, same as
|
|
36
|
+
`PieChart`.
|
|
35
37
|
|
|
36
38
|
**Sparkline** — `data: number[]`, `width?` (120), `height?` (32),
|
|
37
39
|
`tone?: accent | neutral | success | warning | danger | info` (accent), `style?`, `testID?`.
|
|
@@ -134,8 +136,9 @@ shape/dash channels (`seriesShapeAt`/`seriesDashAt`) wrap the same way, by the s
|
|
|
134
136
|
- Segment/bar/series `color` values come from the consumer — contrast of consumer-picked colors
|
|
135
137
|
against the canvas is the consumer's to verify (documented exception to the closed-union rule).
|
|
136
138
|
`DonutChart.segments[].color` is required and consumer-supplied (unlike the other three charts'
|
|
137
|
-
ramp-defaulted `color`)
|
|
138
|
-
|
|
139
|
+
ramp-defaulted `color`); its ring separator stays a track-coloured gap (the ring segments are
|
|
140
|
+
strokes on one shared circle, not independent filled paths — see "Design decisions"), but the
|
|
141
|
+
legend now carries a shape per segment's own index in `segments[]`, same as `PieChart`.
|
|
139
142
|
- LineChart's x-axis labels are taken from the longest (decimated) series and positioned by raw
|
|
140
143
|
index; a series with dropped non-finite points can drift slightly out of alignment with the
|
|
141
144
|
shared x-axis, and a decimated series labels only the samples it kept.
|
|
@@ -159,18 +162,28 @@ shape/dash channels (`seriesShapeAt`/`seriesDashAt`) wrap the same way, by the s
|
|
|
159
162
|
styles hoisted out of the row loop; a per-row inline closure or a per-row `variants(theme)` call
|
|
160
163
|
would defeat their memo. `ChartLegend`'s entry array is built inside each chart's own `useMemo`
|
|
161
164
|
(keyed on `series`/`segments`/`showLegend`/`theme.colors`), never a fresh literal per render.
|
|
162
|
-
- **
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- **Decimation** (`LineChart`, `Sparkline`): a series longer than `
|
|
165
|
+
- **Android ripple** — `BarPressTarget`/`WedgePressTarget` take `android_ripple` (`borderless: false`)
|
|
166
|
+
computed once per chart (`androidRipple`, `useMemo` on `theme.mode`, `Platform.OS === "android"`
|
|
167
|
+
gated) and passed down per target, rather than re-resolved per row. Each target's absolutely
|
|
168
|
+
positioned box also gained `overflow: "hidden"` so the ripple clips to it instead of spilling past
|
|
169
|
+
the invisible press area.
|
|
170
|
+
- **Decimation** (`LineChart`, `Sparkline`): a series longer than a `useDeviceTier()`-scaled
|
|
171
|
+
`maxRenderedPoints` (80/140/200, low/mid/high — `MAX_RENDERED_POINTS_HIGH` equals the pre-existing
|
|
172
|
+
fixed `MAX_RENDERED_POINTS`, still exported for a caller that decimates without a tier in hand) is
|
|
168
173
|
downsampled inside the same `useMemo`, before any geometry, so it costs nothing on re-render —
|
|
169
174
|
1,000 samples otherwise means 1,000 svg nodes. Min/max bucketing: both endpoints plus each
|
|
170
175
|
bucket's lowest and highest sample, in original order, so a one-sample spike survives (plain
|
|
171
176
|
stride sampling would drop it). Output is ≤ the threshold; below it the input array is returned
|
|
172
|
-
as-is.
|
|
173
|
-
|
|
177
|
+
as-is. A point costs one svg node against a `BarChart` category's three (bar, label, press
|
|
178
|
+
target), so the same per-tier node budget affords more points than categories at the same tier.
|
|
179
|
+
- **`BarChart` category cap:** an unbounded `data` array otherwise means unbounded svg nodes — one
|
|
180
|
+
bar, one label and one press target per category. Above a `useDeviceTier()`-scaled
|
|
181
|
+
`maxRenderedCategories` (60/120/200, low/mid/high — same worst-case scale as `MAX_RENDERED_POINTS`),
|
|
182
|
+
`decimateCategories` stride-samples down to the cap inside the same `useMemo`, first/last category
|
|
183
|
+
always kept, so the shown categories stay spread across the full range rather than clustered at one
|
|
184
|
+
end. Below the cap the input array is returned as-is (byte-identical to the pre-cap behavior).
|
|
185
|
+
- **`BarList` windowing:** rows render through `VirtualList` (`itemHeight={BAR_LIST_ROW_HEIGHT}`)
|
|
186
|
+
instead of a raw `.map()`, so an unbounded `items` array no longer mounts every row up front.
|
|
174
187
|
|
|
175
188
|
## Modernization (v1.0.7)
|
|
176
189
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { memo, useCallback, useMemo } from "react";
|
|
4
|
-
import { Pressable, StyleSheet, View } from "react-native";
|
|
4
|
+
import { Platform, Pressable, StyleSheet, View } from "react-native";
|
|
5
5
|
import Svg, { Circle, Path } from "react-native-svg";
|
|
6
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
6
7
|
import { useTheme } from "../../theme/hooks.js";
|
|
7
8
|
import { ChartLegend } from "./ChartLegend.js";
|
|
8
9
|
import { SEGMENT_SEPARATOR_WIDTH, describeWedge, hitSlopFor, resolvePieWedges, resolveWedgeBoundingBox, seriesShapeAt, summarizePieChart } from "./Charts.variants.js";
|
|
@@ -12,7 +13,8 @@ const WedgePressTarget = /*#__PURE__*/memo(function WedgePressTarget({
|
|
|
12
13
|
box,
|
|
13
14
|
label,
|
|
14
15
|
testID,
|
|
15
|
-
onPress
|
|
16
|
+
onPress,
|
|
17
|
+
androidRipple
|
|
16
18
|
}) {
|
|
17
19
|
const press = useCallback(() => onPress(index), [onPress, index]);
|
|
18
20
|
const frame = useMemo(() => ({
|
|
@@ -20,7 +22,8 @@ const WedgePressTarget = /*#__PURE__*/memo(function WedgePressTarget({
|
|
|
20
22
|
left: box.x,
|
|
21
23
|
top: box.y,
|
|
22
24
|
width: box.width,
|
|
23
|
-
height: box.height
|
|
25
|
+
height: box.height,
|
|
26
|
+
overflow: "hidden"
|
|
24
27
|
}), [box]);
|
|
25
28
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
26
29
|
testID: testID,
|
|
@@ -28,6 +31,7 @@ const WedgePressTarget = /*#__PURE__*/memo(function WedgePressTarget({
|
|
|
28
31
|
accessibilityLabel: label,
|
|
29
32
|
hitSlop: hitSlopFor(box.width, box.height),
|
|
30
33
|
onPress: press,
|
|
34
|
+
android_ripple: androidRipple,
|
|
31
35
|
style: frame
|
|
32
36
|
});
|
|
33
37
|
});
|
|
@@ -76,6 +80,10 @@ export const PieChart = /*#__PURE__*/memo(function PieChart({
|
|
|
76
80
|
width: size,
|
|
77
81
|
height: size
|
|
78
82
|
}), [size]);
|
|
83
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
84
|
+
color: rippleColor(theme.mode),
|
|
85
|
+
borderless: false
|
|
86
|
+
} : undefined, [theme.mode]);
|
|
79
87
|
return /*#__PURE__*/_jsxs(View, {
|
|
80
88
|
testID: testID,
|
|
81
89
|
style: [styles.container, style],
|
|
@@ -122,7 +130,8 @@ export const PieChart = /*#__PURE__*/memo(function PieChart({
|
|
|
122
130
|
index: index,
|
|
123
131
|
box: target.box,
|
|
124
132
|
label: target.label,
|
|
125
|
-
onPress: pressSegment
|
|
133
|
+
onPress: pressSegment,
|
|
134
|
+
androidRipple: androidRipple
|
|
126
135
|
}, index))
|
|
127
136
|
})]
|
|
128
137
|
}), /*#__PURE__*/_jsx(ChartLegend, {
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import Svg, { Path } from "react-native-svg";
|
|
6
|
+
import { useDeviceTier } from "../../core/device/index.js";
|
|
6
7
|
import { useTheme } from "../../theme/hooks.js";
|
|
7
|
-
import { decimateSeries, resolveSparklineTone } from "./Charts.variants.js";
|
|
8
|
+
import { decimateSeries, maxRenderedPoints, resolveSparklineTone } from "./Charts.variants.js";
|
|
8
9
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
const STROKE_WIDTH = 2;
|
|
10
11
|
const AREA_OPACITY = 0.15;
|
|
@@ -45,7 +46,8 @@ export const Sparkline = /*#__PURE__*/memo(function Sparkline({
|
|
|
45
46
|
}) {
|
|
46
47
|
const theme = useTheme();
|
|
47
48
|
const stroke = resolveSparklineTone(theme.colors, tone);
|
|
48
|
-
const
|
|
49
|
+
const tier = useDeviceTier();
|
|
50
|
+
const paths = useMemo(() => buildPaths(decimateSeries(data, sampleValue, maxRenderedPoints(tier)), width, height), [data, width, height, tier]);
|
|
49
51
|
return /*#__PURE__*/_jsx(View, {
|
|
50
52
|
testID: testID,
|
|
51
53
|
accessibilityElementsHidden: true,
|
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { memo, useCallback, useEffect, useMemo, useRef } from "react";
|
|
14
|
-
import { Animated, Pressable, StyleSheet, Text, View } from "react-native";
|
|
14
|
+
import { Animated, Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
15
15
|
import { useSpaceActivation } from "../../core/a11y/keyboard";
|
|
16
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
16
17
|
import { Icon } from "../../core/icon/index.js";
|
|
17
18
|
import { useAnimatedValue, useMotion, usePressMotion } from "../../core/motion/index.js";
|
|
19
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
18
20
|
import { useTheme } from "../../theme/hooks.js";
|
|
19
21
|
import { CHECKBOX_SIZES, checkboxBoxStructure, checkboxRowStructure, resolveCheckboxAccessibility, resolveCheckboxColors } from "./Checkbox.variants.js";
|
|
20
22
|
|
|
@@ -46,6 +48,7 @@ function CheckboxImpl(props) {
|
|
|
46
48
|
} = props;
|
|
47
49
|
const theme = useTheme();
|
|
48
50
|
const motion = useMotion();
|
|
51
|
+
const haptics = useHaptics();
|
|
49
52
|
const press = usePressMotion(disabled);
|
|
50
53
|
const spec = CHECKBOX_SIZES[size];
|
|
51
54
|
const colors = resolveCheckboxColors(theme.colors);
|
|
@@ -95,8 +98,9 @@ function CheckboxImpl(props) {
|
|
|
95
98
|
}, []);
|
|
96
99
|
const handlePress = useCallback(() => {
|
|
97
100
|
if (disabled) return;
|
|
101
|
+
haptics.selection();
|
|
98
102
|
onCheckedChange(!checked);
|
|
99
|
-
}, [disabled, onCheckedChange, checked]);
|
|
103
|
+
}, [disabled, haptics, onCheckedChange, checked]);
|
|
100
104
|
|
|
101
105
|
// Space is the checkbox's PRIMARY key, but RNW only presses on Space for `role="button"` — see
|
|
102
106
|
// `core/a11y/keyboard.web.ts`. No-op on native.
|
|
@@ -143,6 +147,10 @@ function CheckboxImpl(props) {
|
|
|
143
147
|
onFocus: handleFocus,
|
|
144
148
|
onBlur: handleBlur,
|
|
145
149
|
hitSlop: spec.hitSlop,
|
|
150
|
+
android_ripple: Platform.OS === "android" && !disabled ? {
|
|
151
|
+
color: rippleColor(theme.mode),
|
|
152
|
+
borderless: false
|
|
153
|
+
} : undefined,
|
|
146
154
|
style: rootStyle,
|
|
147
155
|
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
148
156
|
testID: "checkbox-row",
|
|
@@ -101,3 +101,8 @@ Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLA
|
|
|
101
101
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
102
102
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
103
103
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
104
|
+
- **Round 5 (Android parity)** — `Checkbox` had no `android_ripple` while its sibling `RadioGroup`
|
|
105
|
+
already did, so the two controls in the same family felt different on Android. The row `Pressable`
|
|
106
|
+
now gets `android_ripple` (`borderless: false`), gated on `Platform.OS === "android" && !disabled`.
|
|
107
|
+
|
|
108
|
+
Checkbox press uses `usePressState` and `useHaptics().selection()`.
|
|
@@ -9,20 +9,29 @@
|
|
|
9
9
|
* target, never icon-only (`label` is required).
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { memo, useMemo } from "react";
|
|
13
|
-
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
12
|
+
import { memo, useCallback, useMemo } from "react";
|
|
13
|
+
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
14
|
+
import Animated from "react-native-reanimated";
|
|
14
15
|
import { removeAccessibilityLabel } from "../../core/a11y/labels.js";
|
|
16
|
+
import { AccentGradientFill } from "../../core/gradient/index.js";
|
|
17
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
15
18
|
import { Icon } from "../../core/icon/index.js";
|
|
19
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
16
20
|
import { MediaImage } from "../../core/media/index.js";
|
|
21
|
+
import { rippleColor as androidRippleColor, stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
22
|
+
import { elevation, floatingSurfaceStyle, highlight } from "../../theme/platform/index.js";
|
|
23
|
+
import { elevation as elevationTokens } from "../../theme/tokens/primitives/index.js";
|
|
17
24
|
import { useTheme } from "../../theme/hooks.js";
|
|
18
|
-
import { CHIP_AVATAR_SIZE, CHIP_REMOVE_HIT_SLOP, CHIP_REMOVE_ICON_SIZE, chipRemoveSlotStructure, chipRemoveTouchStructure, CHIP_SIZES, chipStructure,
|
|
25
|
+
import { CHIP_AVATAR_SIZE, CHIP_REMOVE_HIT_SLOP, CHIP_REMOVE_ICON_SIZE, chipRemoveSlotStructure, chipRemoveTouchStructure, CHIP_SIZES, chipStructure, resolveChipAccessibility, resolveChipColors } from "./Chip.variants.js";
|
|
19
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
27
|
const ICON_STROKE = 2;
|
|
28
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
21
29
|
export const Chip = /*#__PURE__*/memo(function Chip(props) {
|
|
22
30
|
const {
|
|
23
31
|
label,
|
|
24
32
|
variant = "subtle",
|
|
25
33
|
tone = "neutral",
|
|
34
|
+
customColors,
|
|
26
35
|
size = "md",
|
|
27
36
|
selected = false,
|
|
28
37
|
onPress,
|
|
@@ -34,22 +43,52 @@ export const Chip = /*#__PURE__*/memo(function Chip(props) {
|
|
|
34
43
|
testID
|
|
35
44
|
} = props;
|
|
36
45
|
const theme = useTheme();
|
|
46
|
+
const haptics = useHaptics();
|
|
37
47
|
const spec = CHIP_SIZES[size];
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
48
|
+
const colors = resolveChipColors(theme.colors, tone, variant, selected, customColors);
|
|
49
|
+
const press = usePressState(disabled);
|
|
50
|
+
const removePress = usePressState(disabled);
|
|
41
51
|
const a11y = resolveChipAccessibility({
|
|
42
52
|
selected: props.selected,
|
|
43
53
|
disabled
|
|
44
54
|
});
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
const handlePress = useCallback(() => {
|
|
56
|
+
haptics.selection();
|
|
57
|
+
onPress?.();
|
|
58
|
+
}, [haptics, onPress]);
|
|
59
|
+
const overlayColor = useMemo(() => stateLayerScrim(theme.mode), [theme.mode]);
|
|
60
|
+
const selectedDepth = useMemo(() => {
|
|
61
|
+
if (!selected) return undefined;
|
|
62
|
+
highlight("subtle", theme.mode);
|
|
63
|
+
elevation(elevationTokens.sm);
|
|
64
|
+
void theme.elevatedSurfaces;
|
|
65
|
+
return floatingSurfaceStyle(theme, "sm");
|
|
66
|
+
}, [selected, theme]);
|
|
67
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
68
|
+
backgroundColor: overlayColor,
|
|
69
|
+
borderRadius: theme.radii.full,
|
|
70
|
+
borderCurve: "continuous"
|
|
71
|
+
}), [overlayColor, theme.radii.full]);
|
|
72
|
+
const androidRipple = useMemo(() => {
|
|
73
|
+
if (Platform.OS !== "android" || disabled) return undefined;
|
|
74
|
+
return {
|
|
75
|
+
color: androidRippleColor(theme.mode),
|
|
76
|
+
borderless: false
|
|
77
|
+
};
|
|
78
|
+
}, [disabled, theme.mode]);
|
|
79
|
+
const removeRipple = useMemo(() => {
|
|
80
|
+
if (Platform.OS !== "android" || disabled) return undefined;
|
|
81
|
+
return {
|
|
82
|
+
color: androidRippleColor(theme.mode),
|
|
83
|
+
borderless: true
|
|
84
|
+
};
|
|
85
|
+
}, [disabled, theme.mode]);
|
|
48
86
|
const avatarBox = CHIP_AVATAR_SIZE[size];
|
|
49
87
|
const avatarStyle = useMemo(() => ({
|
|
50
88
|
width: avatarBox,
|
|
51
89
|
height: avatarBox,
|
|
52
90
|
borderRadius: theme.radii.full,
|
|
91
|
+
borderCurve: "continuous",
|
|
53
92
|
overflow: "hidden"
|
|
54
93
|
}), [avatarBox, theme.radii.full]);
|
|
55
94
|
const leading = avatarUri !== undefined ? /*#__PURE__*/_jsx(MediaImage, {
|
|
@@ -70,7 +109,7 @@ export const Chip = /*#__PURE__*/memo(function Chip(props) {
|
|
|
70
109
|
strokeWidth: ICON_STROKE
|
|
71
110
|
}) : null;
|
|
72
111
|
const removable = onRemove !== undefined;
|
|
73
|
-
const chip = /*#__PURE__*/_jsxs(
|
|
112
|
+
const chip = /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
74
113
|
testID: testID,
|
|
75
114
|
accessibilityRole: a11y.accessibilityRole,
|
|
76
115
|
accessibilityLabel: label,
|
|
@@ -78,25 +117,32 @@ export const Chip = /*#__PURE__*/memo(function Chip(props) {
|
|
|
78
117
|
"aria-pressed": a11y["aria-pressed"],
|
|
79
118
|
accessibilityState: a11y.accessibilityState,
|
|
80
119
|
disabled: a11y.disabled,
|
|
81
|
-
onPress: a11y.disabled ? undefined : onPress,
|
|
120
|
+
onPress: a11y.disabled ? undefined : onPress === undefined ? undefined : handlePress,
|
|
121
|
+
onPressIn: press.handlers.onPressIn,
|
|
122
|
+
onPressOut: press.handlers.onPressOut,
|
|
123
|
+
onLayout: press.onLayout,
|
|
82
124
|
hitSlop: spec.hitSlop,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}) => [chipStructure(theme, {
|
|
125
|
+
android_ripple: androidRipple,
|
|
126
|
+
style: [chipStructure(theme, {
|
|
86
127
|
size,
|
|
87
128
|
variant
|
|
88
129
|
}), {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
130
|
+
borderColor: colors.border,
|
|
131
|
+
overflow: "hidden"
|
|
132
|
+
}, !selected && {
|
|
133
|
+
backgroundColor: colors.background
|
|
134
|
+
}, selectedDepth, removable ? chipRemoveSlotStructure(theme, {
|
|
92
135
|
size
|
|
93
|
-
}) : null,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
136
|
+
}) : null, press.animatedStyle, removable ? null : disabled && styles.dimmed, removable ? null : style],
|
|
137
|
+
children: [selected && /*#__PURE__*/_jsx(AccentGradientFill, {
|
|
138
|
+
color: colors.background
|
|
139
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
140
|
+
pointerEvents: "none",
|
|
141
|
+
testID: testID ? `${testID}-press-overlay` : undefined,
|
|
142
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
143
|
+
}), leading, /*#__PURE__*/_jsx(Text, {
|
|
98
144
|
numberOfLines: 1,
|
|
99
|
-
style: [theme.fontStyleForWeight(theme.fontWeights
|
|
145
|
+
style: [theme.fontStyleForWeight(theme.fontWeights[selected ? "semibold" : "medium"]), {
|
|
100
146
|
fontSize: spec.fontSize,
|
|
101
147
|
color: colors.text,
|
|
102
148
|
flexShrink: 1
|
|
@@ -117,39 +163,38 @@ export const Chip = /*#__PURE__*/memo(function Chip(props) {
|
|
|
117
163
|
_jsxs(View, {
|
|
118
164
|
hitSlop: spec.hitSlop,
|
|
119
165
|
style: [disabled && styles.dimmed, style],
|
|
120
|
-
children: [chip, /*#__PURE__*/
|
|
166
|
+
children: [chip, /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
121
167
|
testID: testID ? `${testID}-remove` : undefined,
|
|
122
168
|
accessibilityRole: "button",
|
|
123
169
|
accessibilityLabel: removeAccessibilityLabel(label),
|
|
124
170
|
disabled: disabled,
|
|
125
171
|
onPress: disabled ? undefined : onRemove,
|
|
172
|
+
onPressIn: removePress.handlers.onPressIn,
|
|
173
|
+
onPressOut: removePress.handlers.onPressOut,
|
|
174
|
+
onLayout: removePress.onLayout,
|
|
126
175
|
hitSlop: CHIP_REMOVE_HIT_SLOP,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}) => [chipRemoveTouchStructure(theme, {
|
|
176
|
+
android_ripple: removeRipple,
|
|
177
|
+
style: [chipRemoveTouchStructure(theme, {
|
|
130
178
|
size
|
|
131
|
-
}),
|
|
132
|
-
|
|
179
|
+
}), {
|
|
180
|
+
overflow: "hidden"
|
|
181
|
+
}, removePress.animatedStyle],
|
|
182
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
183
|
+
pointerEvents: "none",
|
|
184
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, removePress.overlayStyle]
|
|
185
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
133
186
|
name: "x",
|
|
134
187
|
size: CHIP_REMOVE_ICON_SIZE,
|
|
135
188
|
color: colors.text,
|
|
136
189
|
strokeWidth: ICON_STROKE
|
|
137
|
-
})
|
|
190
|
+
})]
|
|
138
191
|
})]
|
|
139
192
|
})
|
|
140
193
|
);
|
|
141
194
|
});
|
|
142
195
|
const styles = StyleSheet.create({
|
|
143
|
-
// A disabled control is exempt from the contrast minimum (WCAG 1.4.3), so a uniform dim is
|
|
144
|
-
// correct — same precedent Button/Select/Badge use.
|
|
145
196
|
dimmed: {
|
|
146
197
|
opacity: 0.5
|
|
147
|
-
},
|
|
148
|
-
// Filled (solid/selected) chips dim on press instead of swapping to `bg.sunken`: replacing a
|
|
149
|
-
// coloured fill with a flat neutral tint would erase the tone/selection cue for the moment a
|
|
150
|
-
// finger is down. See `resolveChipPressedBackground`'s own comment for the non-filled case.
|
|
151
|
-
filledPressed: {
|
|
152
|
-
opacity: 0.85
|
|
153
198
|
}
|
|
154
199
|
});
|
|
155
200
|
//# sourceMappingURL=Chip.js.map
|
|
@@ -67,7 +67,19 @@ export const CHIP_REMOVE_HIT_SLOP = slopFor(CHIP_REMOVE_TOUCH_BOX);
|
|
|
67
67
|
* documents (`StatusColors.border` clears neither 3:1 against the canvas nor against its own
|
|
68
68
|
* `subtle` fill, on any brand × mode).
|
|
69
69
|
*/
|
|
70
|
-
function resolveChipToneColors(colors, tone) {
|
|
70
|
+
function resolveChipToneColors(colors, tone, customColors) {
|
|
71
|
+
if (tone === "custom") {
|
|
72
|
+
if (!customColors) {
|
|
73
|
+
throw new Error('Chip tone="custom" requires customColors={{ bg, fg }}.');
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
solidFill: customColors.bg,
|
|
77
|
+
onSolid: customColors.fg,
|
|
78
|
+
mutedText: customColors.fg,
|
|
79
|
+
subtleFill: customColors.bg,
|
|
80
|
+
border: customColors.fg
|
|
81
|
+
};
|
|
82
|
+
}
|
|
71
83
|
switch (tone) {
|
|
72
84
|
case "accent":
|
|
73
85
|
return {
|
|
@@ -105,8 +117,8 @@ function resolveChipToneColors(colors, tone) {
|
|
|
105
117
|
* pair `variant="solid"` reads — so "selected outline chip" and "solid chip" render identically
|
|
106
118
|
* instead of introducing a third, separately-measured filled pairing.
|
|
107
119
|
*/
|
|
108
|
-
export function resolveChipColors(colors, tone, variant, selected) {
|
|
109
|
-
const t = resolveChipToneColors(colors, tone);
|
|
120
|
+
export function resolveChipColors(colors, tone, variant, selected, customColors) {
|
|
121
|
+
const t = resolveChipToneColors(colors, tone, customColors);
|
|
110
122
|
if (selected || variant === "solid") {
|
|
111
123
|
return {
|
|
112
124
|
background: t.solidFill,
|
|
@@ -31,7 +31,8 @@ independent select; `QuickChip` is select-only, unexported). `Chip` generalises
|
|
|
31
31
|
|------|------|---------|-------|
|
|
32
32
|
| `label` | `string` | — | Required. A chip is never icon-only. |
|
|
33
33
|
| `variant` | `solid \| outline \| subtle` | `subtle` | |
|
|
34
|
-
| `tone` | `accent \| neutral \| success \| warning \| danger \| info` | `neutral` | |
|
|
34
|
+
| `tone` | `accent \| neutral \| success \| warning \| danger \| info \| custom` | `neutral` | |
|
|
35
|
+
| `customColors` | `{ bg, fg }` | — | Required when `tone="custom"`. Same contract as `Badge`. |
|
|
35
36
|
| `size` | `sm \| md` | `md` | 28 / 32 dp visual height; both reach 44dp via `hitSlop`. |
|
|
36
37
|
| `selected` | `boolean` | `false` | Renders the filled/accented look regardless of `variant`. Only exposed as toggle state (`aria-pressed` + `accessibilityState.selected`) when the caller passes it — see Accessibility contract. |
|
|
37
38
|
| `onPress` | `() => void` | — | |
|
|
@@ -145,12 +146,13 @@ independent select; `QuickChip` is select-only, unexported). `Chip` generalises
|
|
|
145
146
|
## Performance
|
|
146
147
|
|
|
147
148
|
Both `Chip` and `ChipGroup` are wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see
|
|
148
|
-
root `CLAUDE.md`).
|
|
149
|
-
|
|
150
|
-
and Menu's own row `style` callbacks already establish.
|
|
149
|
+
root `CLAUDE.md`). Chip and its remove affordance both use `usePressState` (scale + state-layer
|
|
150
|
+
overlay); filled chips also dim via `press.overlayStyle` instead of swapping to `bg.sunken`.
|
|
151
151
|
|
|
152
152
|
## Modernization (v1.0.7)
|
|
153
153
|
|
|
154
154
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
155
155
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
156
156
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
157
|
+
- **Round 5 (Android parity)** — the remove control (icon-only, circular) now gets its own
|
|
158
|
+
`borderless: true` ripple, split from the pill's own `borderless: false` ripple.
|