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
|
@@ -8,15 +8,20 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { memo, useCallback, useMemo } from "react";
|
|
11
|
-
import { Pressable, Text, View } from "react-native";
|
|
11
|
+
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
12
|
+
import Animated from "react-native-reanimated";
|
|
12
13
|
import { Icon } from "../../core/icon/index.js";
|
|
14
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
13
15
|
import { VirtualList } from "../../core/list/index.js";
|
|
16
|
+
import { concentric } from "../../core/style/index.js";
|
|
17
|
+
import { rippleColor, stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
14
18
|
import { useTheme } from "../../theme/hooks.js";
|
|
15
19
|
import { fileGridCellStructure, fileGridRowHeight, fileGridRowStructure, resolveFileGridItemLabel } from "./FileGrid.variants.js";
|
|
16
20
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
21
|
const ICON_STROKE = 2;
|
|
18
22
|
const ICON_SIZE = 28;
|
|
19
23
|
const DEFAULT_ICON = "file-text";
|
|
24
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
20
25
|
function rowKeyExtractor(row) {
|
|
21
26
|
return row.key;
|
|
22
27
|
}
|
|
@@ -43,12 +48,8 @@ export const FileGrid = /*#__PURE__*/memo(function FileGrid({
|
|
|
43
48
|
const cellStyle = useMemo(() => [fileGridCellStructure(theme, {
|
|
44
49
|
columns
|
|
45
50
|
}), {
|
|
46
|
-
|
|
47
|
-
backgroundColor: theme.colors.bg.surface
|
|
51
|
+
backgroundColor: theme.colors.bg.raised
|
|
48
52
|
}], [theme, columns]);
|
|
49
|
-
const pressedStyle = useMemo(() => ({
|
|
50
|
-
backgroundColor: theme.colors.bg.sunken
|
|
51
|
-
}), [theme]);
|
|
52
53
|
const textStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
53
54
|
fontSize: theme.fontSizes.sm,
|
|
54
55
|
color: theme.colors.fg.default,
|
|
@@ -62,12 +63,11 @@ export const FileGrid = /*#__PURE__*/memo(function FileGrid({
|
|
|
62
63
|
row: row,
|
|
63
64
|
rowStyle: rowStyle,
|
|
64
65
|
cellStyle: cellStyle,
|
|
65
|
-
pressedStyle: pressedStyle,
|
|
66
66
|
textStyle: textStyle,
|
|
67
67
|
iconColor: theme.colors.accent.text,
|
|
68
68
|
onItemPress: onItemPress,
|
|
69
69
|
testID: testID
|
|
70
|
-
}), [rowStyle, cellStyle,
|
|
70
|
+
}), [rowStyle, cellStyle, textStyle, theme, onItemPress, testID]);
|
|
71
71
|
return /*#__PURE__*/_jsx(View, {
|
|
72
72
|
testID: testID,
|
|
73
73
|
style: style,
|
|
@@ -82,17 +82,23 @@ export const FileGrid = /*#__PURE__*/memo(function FileGrid({
|
|
|
82
82
|
const FileGridCell = /*#__PURE__*/memo(function FileGridCell({
|
|
83
83
|
item,
|
|
84
84
|
cellStyle,
|
|
85
|
-
pressedStyle,
|
|
86
85
|
textStyle,
|
|
87
86
|
iconColor,
|
|
88
87
|
onItemPress,
|
|
89
88
|
testID
|
|
90
89
|
}) {
|
|
90
|
+
const theme = useTheme();
|
|
91
|
+
const press = usePressState(onItemPress === undefined);
|
|
91
92
|
const handlePress = useCallback(() => onItemPress?.(item.id), [onItemPress, item.id]);
|
|
92
|
-
const pressableStyle = useCallback(({
|
|
93
|
-
pressed
|
|
94
|
-
}) => [cellStyle, pressed ? pressedStyle : null], [cellStyle, pressedStyle]);
|
|
95
93
|
const accessibleLabel = resolveFileGridItemLabel(item.label, item.typeLabel);
|
|
94
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
95
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
96
|
+
borderRadius: concentric(theme.radii.lg, theme.space[2]),
|
|
97
|
+
borderCurve: "continuous"
|
|
98
|
+
}), [theme.mode, theme.radii.lg, theme.space]);
|
|
99
|
+
const pressableStyle = useMemo(() => [cellStyle, {
|
|
100
|
+
overflow: "hidden"
|
|
101
|
+
}, press.animatedStyle], [cellStyle, press.animatedStyle]);
|
|
96
102
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
97
103
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
98
104
|
name: item.icon ?? DEFAULT_ICON,
|
|
@@ -114,20 +120,29 @@ const FileGridCell = /*#__PURE__*/memo(function FileGridCell({
|
|
|
114
120
|
children: content
|
|
115
121
|
});
|
|
116
122
|
}
|
|
117
|
-
return /*#__PURE__*/
|
|
123
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
118
124
|
testID: testID,
|
|
119
125
|
accessibilityRole: "button",
|
|
120
126
|
accessibilityLabel: accessibleLabel,
|
|
121
127
|
onPress: handlePress,
|
|
128
|
+
onPressIn: press.handlers.onPressIn,
|
|
129
|
+
onPressOut: press.handlers.onPressOut,
|
|
130
|
+
onLayout: press.onLayout,
|
|
131
|
+
android_ripple: Platform.OS === "android" ? {
|
|
132
|
+
color: rippleColor(theme.mode),
|
|
133
|
+
borderless: false
|
|
134
|
+
} : undefined,
|
|
122
135
|
style: pressableStyle,
|
|
123
|
-
children:
|
|
136
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
137
|
+
pointerEvents: "none",
|
|
138
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
139
|
+
}), content]
|
|
124
140
|
});
|
|
125
141
|
});
|
|
126
142
|
const FileGridRow = /*#__PURE__*/memo(function FileGridRow({
|
|
127
143
|
row,
|
|
128
144
|
rowStyle,
|
|
129
145
|
cellStyle,
|
|
130
|
-
pressedStyle,
|
|
131
146
|
textStyle,
|
|
132
147
|
iconColor,
|
|
133
148
|
onItemPress,
|
|
@@ -138,7 +153,6 @@ const FileGridRow = /*#__PURE__*/memo(function FileGridRow({
|
|
|
138
153
|
children: row.items.map(item => /*#__PURE__*/_jsx(FileGridCell, {
|
|
139
154
|
item: item,
|
|
140
155
|
cellStyle: cellStyle,
|
|
141
|
-
pressedStyle: pressedStyle,
|
|
142
156
|
textStyle: textStyle,
|
|
143
157
|
iconColor: iconColor,
|
|
144
158
|
onItemPress: onItemPress,
|
|
@@ -24,8 +24,8 @@ export const fileGridRowStructure = createThemedVariants(theme => ({
|
|
|
24
24
|
}));
|
|
25
25
|
export const fileGridCellStructure = createThemedVariants(theme => ({
|
|
26
26
|
base: {
|
|
27
|
-
borderRadius: theme.radii.
|
|
28
|
-
|
|
27
|
+
borderRadius: theme.radii.lg,
|
|
28
|
+
borderCurve: "continuous",
|
|
29
29
|
padding: theme.space[2],
|
|
30
30
|
alignItems: "center",
|
|
31
31
|
justifyContent: "center",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# file-grid/
|
|
2
2
|
|
|
3
|
-
Grid of file/folder cells with icon + label. `columns`: 2 | 3 | 4.
|
|
3
|
+
Grid of file/folder cells with icon + label. `columns`: 2 | 3 | 4. Cells are a tonal `bg.raised`
|
|
4
|
+
fill, no hairline border — the same borderless-tile treatment `Card`'s `elevated` variant uses.
|
|
4
5
|
|
|
5
6
|
## Accessibility contract (WCAG)
|
|
6
7
|
|
|
@@ -10,3 +11,4 @@ Grid of file/folder cells with icon + label. `columns`: 2 | 3 | 4.
|
|
|
10
11
|
`label` alone when the consumer names no type. Applies to both a pressable cell
|
|
11
12
|
(`accessibilityLabel`) and a read-only one (wrapped `accessible` + `accessibilityLabel`, which it
|
|
12
13
|
did not carry at all before).
|
|
14
|
+
- **Press feedback** — cells with `onPress` use `usePressState` (scale + state-layer overlay).
|
|
@@ -180,6 +180,7 @@ export const fileUploadProgressTrackStructure = createThemedVariants(theme => ({
|
|
|
180
180
|
alignSelf: "stretch",
|
|
181
181
|
height: 4,
|
|
182
182
|
borderRadius: theme.radii.full,
|
|
183
|
+
borderCurve: "continuous",
|
|
183
184
|
overflow: "hidden"
|
|
184
185
|
}
|
|
185
186
|
}));
|
|
@@ -214,7 +215,8 @@ export const fileUploadRowStructure = createThemedVariants(theme => ({
|
|
|
214
215
|
alignItems: "center",
|
|
215
216
|
columnGap: theme.space[2],
|
|
216
217
|
borderWidth: theme.borderWidths.thin,
|
|
217
|
-
borderRadius: theme.radii.
|
|
218
|
+
borderRadius: theme.radii.md,
|
|
219
|
+
borderCurve: "continuous",
|
|
218
220
|
paddingHorizontal: theme.space[3],
|
|
219
221
|
paddingVertical: theme.space[2]
|
|
220
222
|
}
|
|
@@ -146,3 +146,5 @@ Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLA
|
|
|
146
146
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
147
147
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
148
148
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
149
|
+
|
|
150
|
+
- **Round 2 visual** — radii retarget (`radii.md`/`lg`/`xl`/`full`), `borderCurve: continuous` on md+ corners; floating surfaces wire platform elevation/highlight where applicable.
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { memo, useMemo } from "react";
|
|
19
|
-
import { Animated, Pressable, Text, View } from "react-native";
|
|
19
|
+
import { Animated, Platform, Pressable, Text, View } from "react-native";
|
|
20
20
|
import { Icon } from "../../core/icon/index.js";
|
|
21
21
|
import { usePressMotion } from "../../core/motion/index.js";
|
|
22
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
22
23
|
import { useTheme } from "../../theme/hooks.js";
|
|
23
24
|
import { FILTER_CHIP_HIT_SLOP, FILTER_CHIP_ICON_SIZE, filterChipStructure, resolveFilterChipAccessibility, resolveFilterChipColors } from "./FilterSheet.variants.js";
|
|
24
25
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -45,6 +46,10 @@ export const FilterChip = /*#__PURE__*/memo(function FilterChip({
|
|
|
45
46
|
fontSize: theme.fontSizes.sm,
|
|
46
47
|
color: colors.text
|
|
47
48
|
}], [theme, colors]);
|
|
49
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
50
|
+
color: rippleColor(theme.mode),
|
|
51
|
+
borderless: false
|
|
52
|
+
} : undefined, [theme.mode]);
|
|
48
53
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
49
54
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
50
55
|
numberOfLines: 1,
|
|
@@ -75,9 +80,12 @@ export const FilterChip = /*#__PURE__*/memo(function FilterChip({
|
|
|
75
80
|
onPressIn: press.onPressIn,
|
|
76
81
|
onPressOut: press.onPressOut,
|
|
77
82
|
hitSlop: FILTER_CHIP_HIT_SLOP,
|
|
78
|
-
|
|
83
|
+
android_ripple: androidRipple,
|
|
84
|
+
style: [chipStyle, {
|
|
85
|
+
overflow: "hidden"
|
|
86
|
+
}, style],
|
|
79
87
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
80
|
-
style:
|
|
88
|
+
style: press.style,
|
|
81
89
|
children: content
|
|
82
90
|
})
|
|
83
91
|
});
|
|
@@ -19,8 +19,10 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
22
|
-
import { Animated, Pressable, StyleSheet, Text, useWindowDimensions, View } from "react-native";
|
|
22
|
+
import { Animated, Platform, Pressable, StyleSheet, Text, useWindowDimensions, View } from "react-native";
|
|
23
|
+
import Reanimated, { LinearTransition, ReduceMotion } from "react-native-reanimated";
|
|
23
24
|
import { useTheme } from "../../theme/hooks.js";
|
|
25
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
24
26
|
import { VirtualList } from "../../core/list/index.js";
|
|
25
27
|
import { usePressMotion } from "../../core/motion/index.js";
|
|
26
28
|
import { Accordion } from "../accordion/index.js";
|
|
@@ -196,9 +198,10 @@ const QuickChipRow = /*#__PURE__*/memo(function QuickChipRow({
|
|
|
196
198
|
}, [dimension.kind, value]);
|
|
197
199
|
const handleToggle = useCallback(optionValue => onToggle(dimension, optionValue), [onToggle, dimension]);
|
|
198
200
|
if (quickOptions.length === 0) return null;
|
|
199
|
-
return /*#__PURE__*/_jsx(View, {
|
|
201
|
+
return /*#__PURE__*/_jsx(Reanimated.View, {
|
|
200
202
|
testID: testID ? `${testID}-quick-${dimension.key}` : undefined,
|
|
201
203
|
style: rowStyle,
|
|
204
|
+
layout: LinearTransition.reduceMotion(ReduceMotion.System),
|
|
202
205
|
children: quickOptions.map(option => /*#__PURE__*/_jsx(QuickChip, {
|
|
203
206
|
label: option.label,
|
|
204
207
|
value: option.value,
|
|
@@ -230,6 +233,14 @@ const QuickChip = /*#__PURE__*/memo(function QuickChip({
|
|
|
230
233
|
fontSize: theme.fontSizes.sm,
|
|
231
234
|
color: colors.text
|
|
232
235
|
}], [theme, selected, colors]);
|
|
236
|
+
const chipStyle = useMemo(() => [styles.chip, {
|
|
237
|
+
borderRadius: theme.radii.full,
|
|
238
|
+
overflow: "hidden"
|
|
239
|
+
}], [theme.radii.full]);
|
|
240
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
241
|
+
color: rippleColor(theme.mode),
|
|
242
|
+
borderless: false
|
|
243
|
+
} : undefined, [theme.mode]);
|
|
233
244
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
234
245
|
testID: testID,
|
|
235
246
|
accessibilityRole: a11y.accessibilityRole,
|
|
@@ -240,7 +251,8 @@ const QuickChip = /*#__PURE__*/memo(function QuickChip({
|
|
|
240
251
|
onPress: handlePress,
|
|
241
252
|
onPressIn: press.onPressIn,
|
|
242
253
|
onPressOut: press.onPressOut,
|
|
243
|
-
|
|
254
|
+
android_ripple: androidRipple,
|
|
255
|
+
style: chipStyle,
|
|
244
256
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
245
257
|
style: [structure, {
|
|
246
258
|
backgroundColor: colors.background,
|
|
@@ -134,3 +134,12 @@ never a migration.
|
|
|
134
134
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
135
135
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
136
136
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
137
|
+
|
|
138
|
+
- **Round 2 visual** — radii retarget (`radii.md`/`lg`/`xl`/`full`), `borderCurve: continuous` on md+ corners; floating surfaces wire platform elevation/highlight where applicable.
|
|
139
|
+
- **Round 5 (Android parity)** — `FilterChip` and the quick-chip (`QuickChip`) both gained
|
|
140
|
+
`android_ripple` (`borderless: false`). `FilterChip` was restructured so its border/radius style
|
|
141
|
+
lives on the `Pressable` itself (matching `Chip`'s precedent) rather than an inner `Animated.View`,
|
|
142
|
+
with `overflow: "hidden"` added so the ripple clips to the chip shape. `QuickChip`'s `Pressable`
|
|
143
|
+
gained its own matching `borderRadius: theme.radii.full` + `overflow: "hidden"` for the same
|
|
144
|
+
reason — the pill radius otherwise lives only on its inner `Animated.View`, which the ripple (drawn
|
|
145
|
+
on the `Pressable`) doesn't clip against.
|
|
@@ -2,23 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* FolderRow — file-browser style row with optional leading icon and trailing meta text.
|
|
5
|
-
*
|
|
6
|
-
* It is rendered AS a list cell at scale, so it carries no mount animation and no loop: press
|
|
7
|
-
* feedback is a plain pressed background colour. Colours and style arrays are memoized so a
|
|
8
|
-
* parent re-render with unchanged props costs nothing.
|
|
9
|
-
*
|
|
10
|
-
* Keyboard/AT focus draws an INSET ring (WCAG 2.4.7) rather than the gap-outside ring `Button` uses
|
|
11
|
-
* — a full-bleed row's outset ring is clipped by the list it sits in.
|
|
12
5
|
*/
|
|
13
6
|
|
|
14
7
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
15
|
-
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
8
|
+
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
9
|
+
import Animated from "react-native-reanimated";
|
|
16
10
|
import { Icon } from "../../core/icon/index.js";
|
|
11
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
12
|
+
import { rippleColor, stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
17
13
|
import { useTheme } from "../../theme/hooks.js";
|
|
18
14
|
import { folderRowFocusRingStructure, folderRowStructure, resolveFolderRowAccessibleName, resolveFolderRowColors } from "./FolderRow.variants.js";
|
|
19
15
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
16
|
const ICON_STROKE = 2;
|
|
21
17
|
const ICON_SIZE = 22;
|
|
18
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
22
19
|
export const FolderRow = /*#__PURE__*/memo(function FolderRow({
|
|
23
20
|
title,
|
|
24
21
|
subtitle,
|
|
@@ -31,7 +28,7 @@ export const FolderRow = /*#__PURE__*/memo(function FolderRow({
|
|
|
31
28
|
const theme = useTheme();
|
|
32
29
|
const colors = useMemo(() => resolveFolderRowColors(theme.colors), [theme.colors]);
|
|
33
30
|
const structure = useMemo(() => folderRowStructure(theme), [theme]);
|
|
34
|
-
|
|
31
|
+
const press = usePressState(onPress === undefined);
|
|
35
32
|
const [focused, setFocused] = useState(false);
|
|
36
33
|
const titleStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.medium), {
|
|
37
34
|
fontSize: theme.fontSizes.md,
|
|
@@ -49,11 +46,15 @@ export const FolderRow = /*#__PURE__*/memo(function FolderRow({
|
|
|
49
46
|
const staticStyle = useMemo(() => [structure, {
|
|
50
47
|
backgroundColor: colors.background
|
|
51
48
|
}, style], [structure, colors, style]);
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
const pressableStyle = useMemo(() => [structure, {
|
|
50
|
+
backgroundColor: colors.background,
|
|
51
|
+
overflow: "hidden"
|
|
52
|
+
}, press.animatedStyle, style], [structure, colors, press.animatedStyle, style]);
|
|
53
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
54
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
55
|
+
borderRadius: theme.radii.lg,
|
|
56
|
+
borderCurve: "continuous"
|
|
57
|
+
}), [theme.mode, theme.radii.lg]);
|
|
57
58
|
const handleFocus = useCallback(() => setFocused(true), []);
|
|
58
59
|
const handleBlur = useCallback(() => setFocused(false), []);
|
|
59
60
|
const focusRingStyle = useMemo(() => [folderRowFocusRingStructure(theme), {
|
|
@@ -75,15 +76,26 @@ export const FolderRow = /*#__PURE__*/memo(function FolderRow({
|
|
|
75
76
|
children: body
|
|
76
77
|
});
|
|
77
78
|
}
|
|
78
|
-
return /*#__PURE__*/_jsxs(
|
|
79
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
79
80
|
testID: testID,
|
|
80
81
|
accessibilityRole: "button",
|
|
81
82
|
accessibilityLabel: accessibleName,
|
|
82
83
|
onPress: onPress,
|
|
84
|
+
onPressIn: press.handlers.onPressIn,
|
|
85
|
+
onPressOut: press.handlers.onPressOut,
|
|
86
|
+
onLayout: press.onLayout,
|
|
83
87
|
onFocus: handleFocus,
|
|
84
88
|
onBlur: handleBlur,
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
android_ripple: Platform.OS === "android" ? {
|
|
90
|
+
color: rippleColor(theme.mode),
|
|
91
|
+
borderless: false
|
|
92
|
+
} : undefined,
|
|
93
|
+
style: pressableStyle,
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
95
|
+
pointerEvents: "none",
|
|
96
|
+
testID: testID === undefined ? undefined : `${testID}-press-overlay`,
|
|
97
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
98
|
+
}), focused && /*#__PURE__*/_jsx(View, {
|
|
87
99
|
pointerEvents: "none",
|
|
88
100
|
testID: testID === undefined ? undefined : `${testID}-focus-ring`,
|
|
89
101
|
style: focusRingStyle
|
|
@@ -8,7 +8,8 @@ export const folderRowStructure = createThemedVariants(theme => ({
|
|
|
8
8
|
columnGap: theme.space[3],
|
|
9
9
|
paddingHorizontal: theme.space[3],
|
|
10
10
|
paddingVertical: theme.space[3],
|
|
11
|
-
borderRadius: theme.radii.
|
|
11
|
+
borderRadius: theme.radii.lg,
|
|
12
|
+
borderCurve: "continuous"
|
|
12
13
|
}
|
|
13
14
|
}));
|
|
14
15
|
|
|
@@ -26,7 +27,8 @@ export const folderRowFocusRingStructure = createThemedVariants(theme => ({
|
|
|
26
27
|
right: 0,
|
|
27
28
|
bottom: 0,
|
|
28
29
|
borderWidth: theme.borderWidths.thick,
|
|
29
|
-
borderRadius: theme.radii.
|
|
30
|
+
borderRadius: theme.radii.lg,
|
|
31
|
+
borderCurve: "continuous"
|
|
30
32
|
}
|
|
31
33
|
}));
|
|
32
34
|
/**
|
|
@@ -63,7 +63,8 @@ This row's per-render allocations are multiplied by the caller's row count, so:
|
|
|
63
63
|
`StyleSheet.create`. No style object is rebuilt per render.
|
|
64
64
|
- **No internal list** — nothing here to virtualize. Windowing is the caller's `FlatList`.
|
|
65
65
|
- **No mount animation, ever.** A per-row enter animation would run during the caller's scroll.
|
|
66
|
-
Press feedback
|
|
66
|
+
Press feedback uses `usePressState` (scale + state-layer overlay) plus the existing `bg.sunken`
|
|
67
|
+
background swap.
|
|
67
68
|
|
|
68
69
|
## Known gaps
|
|
69
70
|
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
13
|
-
import { Pressable, ScrollView, StyleSheet, Text, useWindowDimensions, View } from "react-native";
|
|
13
|
+
import { Platform, Pressable, ScrollView, StyleSheet, Text, useWindowDimensions, View } from "react-native";
|
|
14
|
+
import { useDeviceTier } from "../../core/device/index.js";
|
|
14
15
|
import { useTheme } from "../../theme/hooks.js";
|
|
15
|
-
import {
|
|
16
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
17
|
+
import { Button } from "../button/Button.js";
|
|
18
|
+
import { computeGanttModel, resolveGanttColors, resolveVisibleGanttLanes, GANTT_BAR_H, GANTT_BAR_HIT_SLOP, GANTT_LABEL_W, GANTT_ROW_H, MAX_RENDERED_LANES } from "./Gantt.variants.js";
|
|
16
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
20
|
const BAR_TOP = (GANTT_ROW_H - GANTT_BAR_H) / 2;
|
|
18
21
|
const BAR_RADIUS = 5;
|
|
@@ -44,9 +47,14 @@ const GanttLaneBar = /*#__PURE__*/memo(function GanttLaneBar({
|
|
|
44
47
|
complete,
|
|
45
48
|
ariaLabel,
|
|
46
49
|
colors,
|
|
50
|
+
mode,
|
|
47
51
|
onPress
|
|
48
52
|
}) {
|
|
49
53
|
const handlePress = useCallback(() => onPress?.(id), [onPress, id]);
|
|
54
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
55
|
+
color: rippleColor(mode),
|
|
56
|
+
borderless: false
|
|
57
|
+
} : undefined, [mode]);
|
|
50
58
|
const barColor = complete ? colors.barComplete : colors.bar;
|
|
51
59
|
const barStyle = useMemo(() => ({
|
|
52
60
|
position: "absolute",
|
|
@@ -73,6 +81,7 @@ const GanttLaneBar = /*#__PURE__*/memo(function GanttLaneBar({
|
|
|
73
81
|
accessibilityLabel: ariaLabel,
|
|
74
82
|
onPress: onPress === undefined ? undefined : handlePress,
|
|
75
83
|
hitSlop: GANTT_BAR_HIT_SLOP,
|
|
84
|
+
android_ripple: androidRipple,
|
|
76
85
|
style: barStyle,
|
|
77
86
|
children: !isMarker ? /*#__PURE__*/_jsx(View, {
|
|
78
87
|
pointerEvents: "none",
|
|
@@ -92,8 +101,13 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
92
101
|
width: winW
|
|
93
102
|
} = useWindowDimensions();
|
|
94
103
|
const [now] = useState(() => Date.now());
|
|
104
|
+
const tier = useDeviceTier();
|
|
105
|
+
const [expanded, setExpanded] = useState(false);
|
|
95
106
|
const model = useMemo(() => computeGanttModel(lanes, winW, now), [lanes, winW, now]);
|
|
96
107
|
const colors = useMemo(() => resolveGanttColors(theme.colors), [theme.colors]);
|
|
108
|
+
const maxLanes = MAX_RENDERED_LANES[tier];
|
|
109
|
+
const visible = useMemo(() => resolveVisibleGanttLanes(model, maxLanes, expanded), [model, maxLanes, expanded]);
|
|
110
|
+
const handleShowAll = useCallback(() => setExpanded(true), []);
|
|
97
111
|
const rootStyle = useMemo(() => [{
|
|
98
112
|
gap: theme.space[2]
|
|
99
113
|
}, style], [theme, style]);
|
|
@@ -119,13 +133,13 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
119
133
|
}], [theme, colors]);
|
|
120
134
|
const chartBodyStyle = useMemo(() => ({
|
|
121
135
|
width: model.chartWidth,
|
|
122
|
-
height:
|
|
123
|
-
}), [model.chartWidth,
|
|
136
|
+
height: visible.bodyHeight
|
|
137
|
+
}), [model.chartWidth, visible.bodyHeight]);
|
|
124
138
|
const todayStyle = useMemo(() => ({
|
|
125
139
|
left: model.todayX,
|
|
126
|
-
height:
|
|
140
|
+
height: visible.bodyHeight,
|
|
127
141
|
backgroundColor: colors.today
|
|
128
|
-
}), [model.todayX,
|
|
142
|
+
}), [model.todayX, visible.bodyHeight, colors.today]);
|
|
129
143
|
if (model.empty) {
|
|
130
144
|
return /*#__PURE__*/_jsx(View, {
|
|
131
145
|
testID: testID,
|
|
@@ -154,7 +168,7 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
154
168
|
children: [/*#__PURE__*/_jsx(View, {
|
|
155
169
|
"aria-hidden": true,
|
|
156
170
|
style: styles.labelColumn,
|
|
157
|
-
children:
|
|
171
|
+
children: visible.lanes.map(lane => /*#__PURE__*/_jsx(GanttLaneLabel, {
|
|
158
172
|
label: lane.label,
|
|
159
173
|
sublabel: lane.sublabel,
|
|
160
174
|
labelStyle: labelStyle,
|
|
@@ -166,7 +180,7 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
166
180
|
style: styles.chart,
|
|
167
181
|
children: /*#__PURE__*/_jsxs(View, {
|
|
168
182
|
style: chartBodyStyle,
|
|
169
|
-
children: [
|
|
183
|
+
children: [visible.lanes.map(lane => /*#__PURE__*/_jsx(GanttLaneBar, {
|
|
170
184
|
id: lane.id,
|
|
171
185
|
leftPx: lane.leftPx,
|
|
172
186
|
widthPx: lane.widthPx,
|
|
@@ -175,6 +189,7 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
175
189
|
complete: lane.complete,
|
|
176
190
|
ariaLabel: lane.ariaLabel,
|
|
177
191
|
colors: colors,
|
|
192
|
+
mode: theme.mode,
|
|
178
193
|
onPress: onLanePress
|
|
179
194
|
}, lane.id)), model.showToday ? /*#__PURE__*/_jsx(View, {
|
|
180
195
|
pointerEvents: "none",
|
|
@@ -182,7 +197,13 @@ export const Gantt = /*#__PURE__*/memo(function Gantt({
|
|
|
182
197
|
}) : null]
|
|
183
198
|
})
|
|
184
199
|
})]
|
|
185
|
-
})
|
|
200
|
+
}), visible.hiddenCount > 0 ? /*#__PURE__*/_jsx(Button, {
|
|
201
|
+
variant: "link",
|
|
202
|
+
size: "sm",
|
|
203
|
+
label: `Show all ${visible.totalCount} lanes`,
|
|
204
|
+
onPress: handleShowAll,
|
|
205
|
+
testID: testID ? `${testID}-show-all` : undefined
|
|
206
|
+
}) : null]
|
|
186
207
|
});
|
|
187
208
|
});
|
|
188
209
|
const styles = StyleSheet.create({
|
|
@@ -16,6 +16,18 @@ export const GANTT_PAD_MS = 2 * MS_PER_DAY;
|
|
|
16
16
|
|
|
17
17
|
/** WCAG 2.5.5 target size, the library-wide floor (`Tabs`/`Pagination`/`Reorder` all pin the same 44). */
|
|
18
18
|
export const MIN_TOUCH_TARGET = 44;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Lanes rendered before the "show all" affordance takes over — the same worst-case safety valve as
|
|
22
|
+
* `MAX_RENDERED_POINTS` in `Charts.variants.ts`, tier-scaled because a lane count this large comes
|
|
23
|
+
* from real ticket/epic data (this component's own documented origin), not a series a caller could
|
|
24
|
+
* decimate without losing rows a reader actually needs.
|
|
25
|
+
*/
|
|
26
|
+
export const MAX_RENDERED_LANES = {
|
|
27
|
+
low: 40,
|
|
28
|
+
mid: 80,
|
|
29
|
+
high: 150
|
|
30
|
+
};
|
|
19
31
|
const slopFor = dimension => Math.max(0, Math.ceil((MIN_TOUCH_TARGET - dimension) / 2));
|
|
20
32
|
|
|
21
33
|
/**
|
|
@@ -138,4 +150,28 @@ export function computeGanttModel(lanes, windowWidth, nowMs) {
|
|
|
138
150
|
rangeLabel: `${monthYear(domainStart)} – ${monthYear(domainEnd)}`
|
|
139
151
|
};
|
|
140
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Slices the already-laid-out lanes to `maxLanes` unless `expanded`. Safe to slice AFTER
|
|
155
|
+
* `computeGanttModel`: each lane's `leftPx`/`widthPx` is derived from the shared time domain, not
|
|
156
|
+
* from its position in the array, so dropping trailing lanes never shifts the ones kept. `bodyHeight`
|
|
157
|
+
* is recomputed for the slice so the chart body and the "today" line never overshoot the rendered rows.
|
|
158
|
+
*/
|
|
159
|
+
export function resolveVisibleGanttLanes(model, maxLanes, expanded) {
|
|
160
|
+
const total = model.lanes.length;
|
|
161
|
+
if (expanded || total <= maxLanes) {
|
|
162
|
+
return {
|
|
163
|
+
lanes: model.lanes,
|
|
164
|
+
bodyHeight: model.bodyHeight,
|
|
165
|
+
totalCount: total,
|
|
166
|
+
hiddenCount: 0
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const lanes = model.lanes.slice(0, maxLanes);
|
|
170
|
+
return {
|
|
171
|
+
lanes,
|
|
172
|
+
bodyHeight: GANTT_ROW_H * lanes.length,
|
|
173
|
+
totalCount: total,
|
|
174
|
+
hiddenCount: total - lanes.length
|
|
175
|
+
};
|
|
176
|
+
}
|
|
141
177
|
//# sourceMappingURL=Gantt.variants.js.map
|
|
@@ -42,7 +42,10 @@ observed ratio is in brackets.
|
|
|
42
42
|
duration, so growing it to 44dp would lie about the data. `GANTT_BAR_HIT_SLOP` widens the press target
|
|
43
43
|
instead — sized off the narrowest bar the layout can produce (`GANTT_MARKER_W`, 12dp), so every bar
|
|
44
44
|
clears `MIN_TOUCH_TARGET`. Vertical slop is capped so `GANTT_BAR_H + 2×top ≤ GANTT_ROW_H` and adjacent
|
|
45
|
-
rows' targets never overlap.
|
|
45
|
+
rows' targets never overlap. On Android the bar's `Pressable` also carries `android_ripple`
|
|
46
|
+
(`rippleColor(theme.mode)`, `borderless: false`) — `GanttLaneBar` takes a `mode: ColorScheme` prop
|
|
47
|
+
from `Gantt` to resolve it. This is unrelated to the bar's decorative hairline (see above), which is
|
|
48
|
+
untouched.
|
|
46
49
|
|
|
47
50
|
**1.3.1 — the pinned label column is decorative.** It used to be a second, un-hidden column of
|
|
48
51
|
`Text` nodes reading the same names the bars already carry inside their own composed
|
|
@@ -69,3 +72,10 @@ desyncs their vertical alignment, and the full-height "today" rule is absolutely
|
|
|
69
72
|
`bodyHeight`. The chart also has no bounded height of its own — it renders inside a consumer `ScrollView`,
|
|
70
73
|
where a nested `VirtualizedList` warns and windows nothing. Rows are cheap (one `Pressable` + one fill
|
|
71
74
|
`View`) and memo'd instead.
|
|
75
|
+
|
|
76
|
+
**`MAX_RENDERED_LANES` — a safety cap, not virtualization.** A `useDeviceTier()`-scaled cap (40/80/150
|
|
77
|
+
lanes, low/mid/high — same worst-case valve as `Charts.variants.ts`'s `MAX_RENDERED_POINTS`) slices the
|
|
78
|
+
already-laid-out lanes identically in both `.map()`s via `resolveVisibleGanttLanes`, so the two columns
|
|
79
|
+
stay in sync; past the cap a "Show all N lanes" `Button` reveals the rest on press. This bounds the
|
|
80
|
+
unbounded worst case (a large ticket/epic timeline on a low-end device) without windowing the common
|
|
81
|
+
case, so it doesn't reintroduce the desync problem above.
|