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
|
@@ -6,10 +6,66 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { memo, useCallback, useMemo, useState } from "react";
|
|
9
|
-
import { Pressable, Text, View } from "react-native";
|
|
9
|
+
import { Platform, Pressable, Text, View } from "react-native";
|
|
10
|
+
import Animated from "react-native-reanimated";
|
|
11
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
12
|
+
import { rippleColor } from "../../theme/platform/stateLayer.native.js";
|
|
10
13
|
import { useTheme } from "../../theme/hooks.js";
|
|
11
14
|
import { resolveActiveStageIndex, resolveStageAccessibilityLabel, resolveStageAccessibilityState, resolveStageProgressAccessibility, resolveStageProgressColors, resolveStageState, stageBarStructure, stageFocusRingStructure, stagePillStructure, stageProgressRowStructure, stageStepperCircleStructure, STAGE_PILL_HIT_SLOP, STAGE_STEPPER_HIT_SLOP } from "./StageProgress.variants.js";
|
|
12
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
|
|
17
|
+
function fillFor(state, palette) {
|
|
18
|
+
if (state === "active") return palette.activeFill;
|
|
19
|
+
return state === "completed" ? palette.completedFill : palette.upcomingFill;
|
|
20
|
+
}
|
|
21
|
+
function textFor(state, palette) {
|
|
22
|
+
if (state === "active") return palette.activeText;
|
|
23
|
+
return state === "completed" ? palette.completedText : palette.upcomingText;
|
|
24
|
+
}
|
|
25
|
+
const StagePressable = /*#__PURE__*/memo(function StagePressable({
|
|
26
|
+
disabled,
|
|
27
|
+
a11yLabel,
|
|
28
|
+
a11yState,
|
|
29
|
+
hitSlop,
|
|
30
|
+
focusRingStyle,
|
|
31
|
+
focusRingTestID,
|
|
32
|
+
focused,
|
|
33
|
+
onPress,
|
|
34
|
+
onFocus,
|
|
35
|
+
onBlur,
|
|
36
|
+
children
|
|
37
|
+
}) {
|
|
38
|
+
const theme = useTheme();
|
|
39
|
+
const press = usePressState(disabled);
|
|
40
|
+
const androidRipple = useMemo(() => {
|
|
41
|
+
if (Platform.OS !== "android" || disabled) return undefined;
|
|
42
|
+
return {
|
|
43
|
+
color: rippleColor(theme.mode),
|
|
44
|
+
borderless: true
|
|
45
|
+
};
|
|
46
|
+
}, [theme.mode, disabled]);
|
|
47
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
48
|
+
accessibilityRole: "button",
|
|
49
|
+
accessibilityLabel: a11yLabel,
|
|
50
|
+
"aria-current": a11yState["aria-current"],
|
|
51
|
+
accessibilityState: a11yState.accessibilityState,
|
|
52
|
+
"aria-disabled": a11yState["aria-disabled"],
|
|
53
|
+
hitSlop: hitSlop,
|
|
54
|
+
android_ripple: androidRipple,
|
|
55
|
+
onPress: onPress,
|
|
56
|
+
onPressIn: press.handlers.onPressIn,
|
|
57
|
+
onPressOut: press.handlers.onPressOut,
|
|
58
|
+
onLayout: press.onLayout,
|
|
59
|
+
onFocus: onFocus,
|
|
60
|
+
onBlur: onBlur,
|
|
61
|
+
style: press.animatedStyle,
|
|
62
|
+
children: [focused && /*#__PURE__*/_jsx(View, {
|
|
63
|
+
pointerEvents: "none",
|
|
64
|
+
testID: focusRingTestID,
|
|
65
|
+
style: focusRingStyle
|
|
66
|
+
}), children]
|
|
67
|
+
});
|
|
68
|
+
});
|
|
13
69
|
export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
14
70
|
stages,
|
|
15
71
|
value,
|
|
@@ -22,8 +78,7 @@ export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
|
22
78
|
const theme = useTheme();
|
|
23
79
|
const palette = resolveStageProgressColors(theme.colors);
|
|
24
80
|
const activeIndex = resolveActiveStageIndex(stages, value);
|
|
25
|
-
// Which interactive stage holds keyboard/AT focus
|
|
26
|
-
// stage can be focused, and the stages are rendered inline (a hook per stage is not an option).
|
|
81
|
+
// Which interactive stage holds keyboard/AT focus — one value, since only one stage can be focused.
|
|
27
82
|
const [focusedStageId, setFocusedStageId] = useState(null);
|
|
28
83
|
const handlePress = useCallback((stageId, disabled) => {
|
|
29
84
|
if (readOnly || disabled || onStagePress === undefined) return;
|
|
@@ -33,13 +88,12 @@ export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
|
33
88
|
if (variant === "bar") {
|
|
34
89
|
return stages.map((stage, index) => {
|
|
35
90
|
const state = resolveStageState(index, activeIndex, true);
|
|
36
|
-
const fill = state === "active" ? palette.activeFill : state === "completed" ? palette.completedFill : palette.upcomingFill;
|
|
37
91
|
// No label per segment: the container announces the whole track as one progressbar
|
|
38
92
|
// (`resolveStageProgressAccessibility`), so a per-segment label would read four times over.
|
|
39
93
|
return /*#__PURE__*/_jsx(View, {
|
|
40
94
|
testID: testID ? `${testID}-bar-${stage.id}` : undefined,
|
|
41
95
|
style: [stageBarStructure(theme), {
|
|
42
|
-
backgroundColor:
|
|
96
|
+
backgroundColor: fillFor(state, palette)
|
|
43
97
|
}]
|
|
44
98
|
}, stage.id);
|
|
45
99
|
});
|
|
@@ -47,22 +101,20 @@ export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
|
47
101
|
if (variant === "stepper") {
|
|
48
102
|
return stages.map((stage, index) => {
|
|
49
103
|
const state = resolveStageState(index, activeIndex, true);
|
|
50
|
-
const fill = state === "active" ? palette.activeFill : state === "completed" ? palette.completedFill : palette.upcomingFill;
|
|
51
|
-
const text = state === "active" ? palette.activeText : state === "completed" ? palette.completedText : palette.upcomingText;
|
|
52
104
|
const node = /*#__PURE__*/_jsxs(View, {
|
|
53
105
|
style: {
|
|
54
106
|
alignItems: "center",
|
|
55
107
|
minWidth: 64
|
|
56
108
|
},
|
|
57
109
|
children: [/*#__PURE__*/_jsx(View, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
110
|
+
testID: testID ? `${testID}-stepper-${stage.id}` : undefined,
|
|
111
|
+
style: [stageStepperCircleStructure(theme), theme.elevation.sm, {
|
|
112
|
+
backgroundColor: fillFor(state, palette)
|
|
61
113
|
}],
|
|
62
114
|
children: /*#__PURE__*/_jsx(Text, {
|
|
63
115
|
style: [theme.fontStyleForWeight(theme.fontWeights.semibold), {
|
|
64
116
|
fontSize: theme.fontSizes.sm,
|
|
65
|
-
color:
|
|
117
|
+
color: textFor(state, palette)
|
|
66
118
|
}],
|
|
67
119
|
children: index + 1
|
|
68
120
|
})
|
|
@@ -81,46 +133,42 @@ export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
|
81
133
|
if (readOnly || stage.disabled) return /*#__PURE__*/_jsx(View, {
|
|
82
134
|
accessible: true,
|
|
83
135
|
accessibilityLabel: a11yLabel,
|
|
84
|
-
"aria-
|
|
136
|
+
"aria-current": a11yState["aria-current"],
|
|
137
|
+
accessibilityState: a11yState.accessibilityState,
|
|
85
138
|
"aria-disabled": a11yState["aria-disabled"],
|
|
86
139
|
children: node
|
|
87
140
|
}, stage.id);
|
|
88
|
-
return /*#__PURE__*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"aria-disabled": a11yState["aria-disabled"],
|
|
141
|
+
return /*#__PURE__*/_jsx(StagePressable, {
|
|
142
|
+
disabled: false,
|
|
143
|
+
a11yLabel: a11yLabel,
|
|
144
|
+
a11yState: a11yState,
|
|
93
145
|
hitSlop: STAGE_STEPPER_HIT_SLOP,
|
|
146
|
+
focused: focusedStageId === stage.id,
|
|
147
|
+
focusRingTestID: testID ? `${testID}-focus-ring-${stage.id}` : undefined,
|
|
148
|
+
focusRingStyle: [stageFocusRingStructure(theme, {
|
|
149
|
+
variant: "stepper"
|
|
150
|
+
}), {
|
|
151
|
+
borderColor: theme.colors.border.focus
|
|
152
|
+
}],
|
|
94
153
|
onPress: () => handlePress(stage.id, stage.disabled),
|
|
95
154
|
onFocus: () => setFocusedStageId(stage.id),
|
|
96
155
|
onBlur: () => setFocusedStageId(current => current === stage.id ? null : current),
|
|
97
|
-
children:
|
|
98
|
-
pointerEvents: "none",
|
|
99
|
-
testID: testID ? `${testID}-focus-ring-${stage.id}` : undefined,
|
|
100
|
-
style: [stageFocusRingStructure(theme, {
|
|
101
|
-
variant: "stepper"
|
|
102
|
-
}), {
|
|
103
|
-
borderColor: theme.colors.border.focus
|
|
104
|
-
}]
|
|
105
|
-
}), node]
|
|
156
|
+
children: node
|
|
106
157
|
}, stage.id);
|
|
107
158
|
});
|
|
108
159
|
}
|
|
109
160
|
return stages.map((stage, index) => {
|
|
110
161
|
const state = resolveStageState(index, activeIndex, true);
|
|
111
|
-
const fill = state === "active" ? palette.activeFill : state === "completed" ? palette.completedFill : palette.upcomingFill;
|
|
112
|
-
const text = state === "active" ? palette.activeText : state === "completed" ? palette.completedText : palette.upcomingText;
|
|
113
162
|
const pill = /*#__PURE__*/_jsx(View, {
|
|
114
163
|
testID: testID ? `${testID}-pill-${stage.id}` : undefined,
|
|
115
|
-
style: [stagePillStructure(theme), {
|
|
116
|
-
backgroundColor:
|
|
117
|
-
borderColor: palette.track
|
|
164
|
+
style: [stagePillStructure(theme), theme.elevation.sm, {
|
|
165
|
+
backgroundColor: fillFor(state, palette)
|
|
118
166
|
}],
|
|
119
167
|
children: /*#__PURE__*/_jsx(Text, {
|
|
120
168
|
numberOfLines: 1,
|
|
121
169
|
style: [theme.fontStyleForWeight(theme.fontWeights.semibold), {
|
|
122
170
|
fontSize: theme.fontSizes.sm,
|
|
123
|
-
color:
|
|
171
|
+
color: textFor(state, palette)
|
|
124
172
|
}],
|
|
125
173
|
children: stage.label
|
|
126
174
|
})
|
|
@@ -130,28 +178,27 @@ export const StageProgress = /*#__PURE__*/memo(function StageProgress({
|
|
|
130
178
|
if (readOnly || stage.disabled) return /*#__PURE__*/_jsx(View, {
|
|
131
179
|
accessible: true,
|
|
132
180
|
accessibilityLabel: a11yLabel,
|
|
133
|
-
"aria-
|
|
181
|
+
"aria-current": a11yState["aria-current"],
|
|
182
|
+
accessibilityState: a11yState.accessibilityState,
|
|
134
183
|
"aria-disabled": a11yState["aria-disabled"],
|
|
135
184
|
children: pill
|
|
136
185
|
}, stage.id);
|
|
137
|
-
return /*#__PURE__*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
"aria-disabled": a11yState["aria-disabled"],
|
|
186
|
+
return /*#__PURE__*/_jsx(StagePressable, {
|
|
187
|
+
disabled: false,
|
|
188
|
+
a11yLabel: a11yLabel,
|
|
189
|
+
a11yState: a11yState,
|
|
142
190
|
hitSlop: STAGE_PILL_HIT_SLOP,
|
|
191
|
+
focused: focusedStageId === stage.id,
|
|
192
|
+
focusRingTestID: testID ? `${testID}-focus-ring-${stage.id}` : undefined,
|
|
193
|
+
focusRingStyle: [stageFocusRingStructure(theme, {
|
|
194
|
+
variant: "pill"
|
|
195
|
+
}), {
|
|
196
|
+
borderColor: theme.colors.border.focus
|
|
197
|
+
}],
|
|
143
198
|
onPress: () => handlePress(stage.id, stage.disabled),
|
|
144
199
|
onFocus: () => setFocusedStageId(stage.id),
|
|
145
200
|
onBlur: () => setFocusedStageId(current => current === stage.id ? null : current),
|
|
146
|
-
children:
|
|
147
|
-
pointerEvents: "none",
|
|
148
|
-
testID: testID ? `${testID}-focus-ring-${stage.id}` : undefined,
|
|
149
|
-
style: [stageFocusRingStructure(theme, {
|
|
150
|
-
variant: "pill"
|
|
151
|
-
}), {
|
|
152
|
-
borderColor: theme.colors.border.focus
|
|
153
|
-
}]
|
|
154
|
-
}), pill]
|
|
201
|
+
children: pill
|
|
155
202
|
}, stage.id);
|
|
156
203
|
});
|
|
157
204
|
}, [stages, variant, activeIndex, palette, theme, testID, readOnly, handlePress, focusedStageId]);
|
|
@@ -55,13 +55,16 @@ export function resolveStageAccessibilityLabel(label, state) {
|
|
|
55
55
|
return `${label}, ${STATE_SUFFIX[state]}`;
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
* Flat `aria
|
|
59
|
-
*
|
|
60
|
-
* nothing at all on web.
|
|
58
|
+
* Flat `aria-current` for web + explicit `accessibilityState` for native — see the field comments
|
|
59
|
+
* above for why this pair (not a single flat prop) is required here specifically.
|
|
61
60
|
*/
|
|
62
61
|
export function resolveStageAccessibilityState(state, disabled) {
|
|
62
|
+
const active = state === "active";
|
|
63
63
|
return {
|
|
64
|
-
"aria-
|
|
64
|
+
"aria-current": active ? "step" : undefined,
|
|
65
|
+
accessibilityState: {
|
|
66
|
+
selected: active
|
|
67
|
+
},
|
|
65
68
|
"aria-disabled": disabled === true
|
|
66
69
|
};
|
|
67
70
|
}
|
|
@@ -90,8 +93,7 @@ export function resolveStageProgressColors(colors) {
|
|
|
90
93
|
completedFill: colors.status.success.subtle,
|
|
91
94
|
completedText: colors.status.success.text,
|
|
92
95
|
upcomingFill: colors.bg.sunken,
|
|
93
|
-
upcomingText: colors.fg.muted
|
|
94
|
-
track: colors.border.default
|
|
96
|
+
upcomingText: colors.fg.muted
|
|
95
97
|
};
|
|
96
98
|
}
|
|
97
99
|
export const stageProgressRowStructure = createThemedVariants(theme => ({
|
|
@@ -107,7 +109,7 @@ export const stagePillStructure = createThemedVariants(theme => ({
|
|
|
107
109
|
paddingHorizontal: theme.space[3],
|
|
108
110
|
paddingVertical: theme.space[2],
|
|
109
111
|
borderRadius: theme.radii.full,
|
|
110
|
-
|
|
112
|
+
borderCurve: "continuous",
|
|
111
113
|
minWidth: 72,
|
|
112
114
|
minHeight: STAGE_PILL_MIN_HEIGHT,
|
|
113
115
|
alignItems: "center",
|
|
@@ -133,10 +135,12 @@ export const stageFocusRingStructure = createThemedVariants(theme => ({
|
|
|
133
135
|
variants: {
|
|
134
136
|
variant: {
|
|
135
137
|
pill: {
|
|
136
|
-
borderRadius: theme.radii.full
|
|
138
|
+
borderRadius: theme.radii.full,
|
|
139
|
+
borderCurve: "continuous"
|
|
137
140
|
},
|
|
138
141
|
stepper: {
|
|
139
|
-
borderRadius: theme.radii.
|
|
142
|
+
borderRadius: theme.radii.md,
|
|
143
|
+
borderCurve: "continuous"
|
|
140
144
|
}
|
|
141
145
|
}
|
|
142
146
|
},
|
|
@@ -148,7 +152,8 @@ export const stageBarStructure = createThemedVariants(theme => ({
|
|
|
148
152
|
base: {
|
|
149
153
|
flex: 1,
|
|
150
154
|
height: 8,
|
|
151
|
-
borderRadius: theme.radii.full
|
|
155
|
+
borderRadius: theme.radii.full,
|
|
156
|
+
borderCurve: "continuous"
|
|
152
157
|
}
|
|
153
158
|
}));
|
|
154
159
|
export const stageStepperCircleStructure = createThemedVariants(theme => ({
|
|
@@ -156,9 +161,9 @@ export const stageStepperCircleStructure = createThemedVariants(theme => ({
|
|
|
156
161
|
width: STAGE_STEPPER_CIRCLE,
|
|
157
162
|
height: STAGE_STEPPER_CIRCLE,
|
|
158
163
|
borderRadius: theme.radii.full,
|
|
164
|
+
borderCurve: "continuous",
|
|
159
165
|
alignItems: "center",
|
|
160
|
-
justifyContent: "center"
|
|
161
|
-
borderWidth: theme.borderWidths.thin
|
|
166
|
+
justifyContent: "center"
|
|
162
167
|
}
|
|
163
168
|
}));
|
|
164
169
|
//# sourceMappingURL=StageProgress.variants.js.map
|
|
@@ -49,3 +49,5 @@ Wrapped in `React.memo`; the Pressable style function is `useCallback`'d.
|
|
|
49
49
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
50
50
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
51
51
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
52
|
+
|
|
53
|
+
- **Round 2 visual** — radii retarget (`radii.md`/`lg`/`xl`/`full`), `borderCurve: continuous` on md+ corners; floating surfaces wire platform elevation/highlight where applicable.
|
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { memo, useEffect, useMemo, useRef } from "react";
|
|
9
|
-
import { Animated, Pressable, Text, View } from "react-native";
|
|
9
|
+
import { Animated, Pressable, Text as RNText, View } from "react-native";
|
|
10
10
|
import { useAnimatedValue, useMotion, usePressMotion } from "../../core/motion/index.js";
|
|
11
11
|
import { useTheme } from "../../theme/hooks.js";
|
|
12
12
|
import { Skeleton } from "../skeleton/index.js";
|
|
13
|
+
import { resolveTextStyle } from "../text/Text.variants.js";
|
|
13
14
|
import { resolveStatTileAccessibility, resolveStatTileColors, statTileBodyStructure, statTileIconStructure, statTileStructure } from "./StatTile.variants.js";
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
16
|
const VALUE_SKELETON_WIDTH = 72;
|
|
@@ -65,16 +66,20 @@ export const StatTile = /*#__PURE__*/memo(function StatTile({
|
|
|
65
66
|
backgroundColor: tileColors.iconFill
|
|
66
67
|
}], [theme, tileColors]);
|
|
67
68
|
const bodyStyle = useMemo(() => statTileBodyStructure(theme), [theme]);
|
|
68
|
-
const
|
|
69
|
-
|
|
69
|
+
const labelTypography = useMemo(() => resolveTextStyle(theme, "caption", {
|
|
70
|
+
color: "muted",
|
|
71
|
+
weight: "medium"
|
|
72
|
+
}), [theme]);
|
|
73
|
+
const labelStyle = useMemo(() => [labelTypography, {
|
|
70
74
|
color: tileColors.label
|
|
71
|
-
}], [
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
}], [labelTypography, tileColors.label]);
|
|
76
|
+
const valueTypography = useMemo(() => resolveTextStyle(theme, "title", {
|
|
77
|
+
weight: "semibold"
|
|
78
|
+
}), [theme]);
|
|
79
|
+
const valueStyle = useMemo(() => [valueTypography, {
|
|
80
|
+
color: tileColors.valueColor,
|
|
76
81
|
opacity: valueOpacity
|
|
77
|
-
}], [
|
|
82
|
+
}], [valueTypography, tileColors.valueColor, valueOpacity]);
|
|
78
83
|
const body = /*#__PURE__*/_jsxs(_Fragment, {
|
|
79
84
|
children: [icon !== undefined && /*#__PURE__*/_jsx(View, {
|
|
80
85
|
testID: testID === undefined ? undefined : `${testID}-icon`,
|
|
@@ -82,7 +87,7 @@ export const StatTile = /*#__PURE__*/memo(function StatTile({
|
|
|
82
87
|
children: icon
|
|
83
88
|
}), /*#__PURE__*/_jsxs(View, {
|
|
84
89
|
style: bodyStyle,
|
|
85
|
-
children: [/*#__PURE__*/_jsx(
|
|
90
|
+
children: [/*#__PURE__*/_jsx(RNText, {
|
|
86
91
|
numberOfLines: 1,
|
|
87
92
|
style: labelStyle,
|
|
88
93
|
children: label
|
|
@@ -36,6 +36,7 @@ export const statTileStructure = createThemedVariants(theme => ({
|
|
|
36
36
|
alignItems: "center",
|
|
37
37
|
columnGap: theme.space[3],
|
|
38
38
|
borderRadius: theme.radii.lg,
|
|
39
|
+
borderCurve: "continuous",
|
|
39
40
|
padding: theme.space[4]
|
|
40
41
|
}
|
|
41
42
|
}));
|
|
@@ -44,6 +45,7 @@ export const statTileIconStructure = createThemedVariants(theme => ({
|
|
|
44
45
|
width: theme.space[10],
|
|
45
46
|
height: theme.space[10],
|
|
46
47
|
borderRadius: theme.radii.md,
|
|
48
|
+
borderCurve: "continuous",
|
|
47
49
|
alignItems: "center",
|
|
48
50
|
justifyContent: "center"
|
|
49
51
|
}
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
| `message` | `string` | — | Optional muted caption below the spinner. |
|
|
22
22
|
| `size` | `SpinnerSize` | `"md"` | Forwarded to `Spinner`. |
|
|
23
23
|
| `tone` | `SpinnerTone` | `"accent"` | Forwarded to `Spinner`. |
|
|
24
|
+
| `fill` | `boolean` | `false` | `flex: 1` + centred — fills a list/screen slot without a wrapper. |
|
|
25
|
+
| `visible` | `boolean` | `true` | Fades/slides out when `false`. |
|
|
24
26
|
| `style` | `LayoutStyle` | — | Layout-only, outermost, last. |
|
|
25
27
|
| `testID` | `string` | — | Forwarded to the outermost `View`. |
|
|
26
28
|
|
|
@@ -32,6 +34,7 @@
|
|
|
32
34
|
| `title` | `string` | — | Required. Bold, centred. |
|
|
33
35
|
| `description` | `string` | — | Optional. Muted, centred. |
|
|
34
36
|
| `action` | `{ label; onPress }` | — | Optional retry via `Button` (`tone="accent" variant="solid"`). |
|
|
37
|
+
| `fill` | `boolean` | `false` | `flex: 1` + centred — fills a list/screen slot without a wrapper. |
|
|
35
38
|
| `style` | `LayoutStyle` | — | Layout-only, outermost, last. |
|
|
36
39
|
| `testID` | `string` | — | Forwarded to the outermost `View`. |
|
|
37
40
|
|
|
@@ -22,14 +22,15 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { memo, useMemo } from "react";
|
|
25
|
-
import {
|
|
25
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
26
|
+
import Reanimated, { FadeInDown, ReduceMotion } from "react-native-reanimated";
|
|
26
27
|
import { useAnnounce } from "../../core/a11y/index.js";
|
|
27
28
|
import { Icon } from "../../core/icon/index.js";
|
|
28
29
|
import { useEnterExit } from "../../core/motion/index.js";
|
|
29
30
|
import { useTheme } from "../../theme/hooks.js";
|
|
30
31
|
import { Button } from "../button/index.js";
|
|
31
32
|
import { Spinner } from "../spinner/index.js";
|
|
32
|
-
import { ERROR_STATE_ICON_SIZE, errorStateStructure, loadingStateStructure, resolveErrorStateAnnouncement, resolveErrorStateColors, resolveLoadingStateColors } from "./StateBlock.variants.js";
|
|
33
|
+
import { ERROR_STATE_ICON_SIZE, errorStateStructure, loadingStateStructure, resolveErrorStateAnnouncement, resolveErrorStateColors, resolveLoadingStateColors, stateBlockFillStructure } from "./StateBlock.variants.js";
|
|
33
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
34
35
|
const ICON_STROKE = 1.5;
|
|
35
36
|
const DEFAULT_ERROR_ICON = "circle-alert";
|
|
@@ -37,6 +38,7 @@ export const LoadingState = /*#__PURE__*/memo(function LoadingState({
|
|
|
37
38
|
message,
|
|
38
39
|
size = "md",
|
|
39
40
|
tone = "accent",
|
|
41
|
+
fill = false,
|
|
40
42
|
visible = true,
|
|
41
43
|
style,
|
|
42
44
|
testID
|
|
@@ -49,13 +51,14 @@ export const LoadingState = /*#__PURE__*/memo(function LoadingState({
|
|
|
49
51
|
useAnnounce(visible ? message : undefined);
|
|
50
52
|
|
|
51
53
|
// `style` stays last; the enter/exit style holds only opacity/transform, which `LayoutStyle` cannot name.
|
|
52
|
-
const rootStyle = useMemo(() => [loadingStateStructure(theme), enterExit.style, style], [theme, enterExit.style, style]);
|
|
54
|
+
const rootStyle = useMemo(() => [loadingStateStructure(theme), fill && stateBlockFillStructure(theme), enterExit.style, style], [theme, fill, enterExit.style, style]);
|
|
53
55
|
const messageStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.regular), styles.text, {
|
|
54
56
|
fontSize: theme.fontSizes.sm,
|
|
55
57
|
color: colors.message
|
|
56
58
|
}], [theme, colors]);
|
|
57
59
|
if (!enterExit.mounted) return null;
|
|
58
|
-
return /*#__PURE__*/_jsxs(
|
|
60
|
+
return /*#__PURE__*/_jsxs(Reanimated.View, {
|
|
61
|
+
entering: FadeInDown.springify().reduceMotion(ReduceMotion.System),
|
|
59
62
|
testID: testID,
|
|
60
63
|
style: rootStyle,
|
|
61
64
|
children: [/*#__PURE__*/_jsx(Spinner, {
|
|
@@ -73,6 +76,7 @@ export const ErrorState = /*#__PURE__*/memo(function ErrorState({
|
|
|
73
76
|
title,
|
|
74
77
|
description,
|
|
75
78
|
action,
|
|
79
|
+
fill = false,
|
|
76
80
|
visible = true,
|
|
77
81
|
style,
|
|
78
82
|
testID
|
|
@@ -85,7 +89,7 @@ export const ErrorState = /*#__PURE__*/memo(function ErrorState({
|
|
|
85
89
|
useAnnounce(visible ? resolveErrorStateAnnouncement(title, description) : undefined);
|
|
86
90
|
|
|
87
91
|
// `style` stays last; the enter/exit style holds only opacity/transform, which `LayoutStyle` cannot name.
|
|
88
|
-
const rootStyle = useMemo(() => [errorStateStructure(theme), enterExit.style, style], [theme, enterExit.style, style]);
|
|
92
|
+
const rootStyle = useMemo(() => [errorStateStructure(theme), fill && stateBlockFillStructure(theme), enterExit.style, style], [theme, fill, enterExit.style, style]);
|
|
89
93
|
const titleStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.bold), styles.text, {
|
|
90
94
|
fontSize: theme.fontSizes.lg,
|
|
91
95
|
color: colors.title
|
|
@@ -95,7 +99,8 @@ export const ErrorState = /*#__PURE__*/memo(function ErrorState({
|
|
|
95
99
|
color: colors.description
|
|
96
100
|
}], [theme, colors]);
|
|
97
101
|
if (!enterExit.mounted) return null;
|
|
98
|
-
return /*#__PURE__*/_jsxs(
|
|
102
|
+
return /*#__PURE__*/_jsxs(Reanimated.View, {
|
|
103
|
+
entering: FadeInDown.springify().reduceMotion(ReduceMotion.System),
|
|
99
104
|
testID: testID,
|
|
100
105
|
style: rootStyle,
|
|
101
106
|
children: [/*#__PURE__*/_jsx(View, {
|
|
@@ -52,4 +52,11 @@ export const errorStateStructure = createThemedVariants(theme => ({
|
|
|
52
52
|
rowGap: theme.space[3]
|
|
53
53
|
}
|
|
54
54
|
}));
|
|
55
|
+
export const stateBlockFillStructure = createThemedVariants(_theme => ({
|
|
56
|
+
base: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
alignSelf: "stretch",
|
|
59
|
+
width: "100%"
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
55
62
|
//# sourceMappingURL=StateBlock.variants.js.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# surface/ — the primitive every other container is built on
|
|
2
|
+
|
|
3
|
+
`Surface` is a themed box: a background role, an optional border role, a radius token, a padding
|
|
4
|
+
token and an elevation rung. It renders no text, takes no press hook, and adds no semantics — where
|
|
5
|
+
`Card` is an opinionated container with variants, `Surface` is the unopinionated one you reach for
|
|
6
|
+
when the composition is yours.
|
|
7
|
+
|
|
8
|
+
## Files
|
|
9
|
+
|
|
10
|
+
| File | Role |
|
|
11
|
+
|------|------|
|
|
12
|
+
| `Surface.tsx` | The component. Resolves colours, padding and elevation, applies inline over structure, `style` last. |
|
|
13
|
+
| `Surface.variants.ts` | Pure resolvers (`resolveSurfaceColors`, `resolveSurfacePadding`, `resolveSurfaceElevation`) + `surfaceStructure`. No React. |
|
|
14
|
+
| `index.ts` | Public surface: `Surface`, `SurfaceProps`, and the role/token aliases. |
|
|
15
|
+
| `__tests__/Surface.test.ts` | Pure: background and border roles map, unset roles are omitted. |
|
|
16
|
+
| `__tests__/Surface.render.test.tsx` | Render: children compose, `testID` forwards, consumer `style` applies last. |
|
|
17
|
+
| `__tests__/SurfaceElevation.test.tsx` | Pure: the `ElevationLevel` → `FloatingLevel` mapping, including the two rungs the platform layer does not implement. |
|
|
18
|
+
|
|
19
|
+
## Props
|
|
20
|
+
|
|
21
|
+
| Prop | Type | Default | Notes |
|
|
22
|
+
|------|------|---------|-------|
|
|
23
|
+
| `background` | `BgRole` | — | Any `colors.bg.*` role. Omitted means transparent. |
|
|
24
|
+
| `border` | `BorderRole` | — | Any `colors.border.*` role. Omitted means no border. |
|
|
25
|
+
| `radius` | `RadiusToken` | — | A `theme.radii` key. |
|
|
26
|
+
| `elevation` | `ElevationLevel` | — | See below — the union is wider than the platform layer implements. |
|
|
27
|
+
| `padding` | `SpaceToken` | — | A `theme.space` key. |
|
|
28
|
+
| `style` | `LayoutStyle` | — | Layout only, applied last, exactly once. |
|
|
29
|
+
|
|
30
|
+
## `elevation` spans a wider union than the platform implements
|
|
31
|
+
|
|
32
|
+
`SurfaceProps.elevation` is typed `ElevationLevel` — `none | sm | base | md | lg`, the full primitive
|
|
33
|
+
ladder. `floatingSurface.native.ts` implements `FloatingLevel`, which is only `sm | md | lg`. Two
|
|
34
|
+
rungs therefore have no direct platform equivalent and `resolveSurfaceElevation` maps them
|
|
35
|
+
explicitly through `SURFACE_FLOATING_LEVEL`:
|
|
36
|
+
|
|
37
|
+
| `elevation` | Renders as |
|
|
38
|
+
|---|---|
|
|
39
|
+
| unset | no shadow, no tonal lift |
|
|
40
|
+
| `none` | no shadow, no tonal lift — the same as unset, stated explicitly |
|
|
41
|
+
| `base` | the `sm` rung — the lightest implemented shadow |
|
|
42
|
+
| `sm` / `md` / `lg` | themselves |
|
|
43
|
+
|
|
44
|
+
`base` rounds **down** to `sm` rather than up to `md`: it sits between the two on the primitive
|
|
45
|
+
ladder, and under-shadowing a surface is the recoverable error. `SURFACE_FLOATING_LEVEL` is declared
|
|
46
|
+
`satisfies Record<Exclude<ElevationLevel, "none">, FloatingLevel>`, so adding a rung to the primitive
|
|
47
|
+
ladder is a type error here until it is mapped — the mapping cannot silently fall through again.
|
|
48
|
+
|
|
49
|
+
## Known gaps
|
|
50
|
+
|
|
51
|
+
`elevation="none"` and `elevation="base"` both previously resolved to `lg`, the heaviest shadow in
|
|
52
|
+
the ladder — a ternary whose `else` branch caught every unhandled rung. Asking a surface to be flat
|
|
53
|
+
gave it the most pronounced shadow available. `__tests__/SurfaceElevation.test.tsx` pins each rung so
|
|
54
|
+
the fall-through cannot return.
|
|
55
|
+
|
|
56
|
+
## Performance
|
|
57
|
+
|
|
58
|
+
`Surface` is `React.memo`'d and resolves its root style through a `useMemo` keyed on the theme and
|
|
59
|
+
every appearance prop. The resolvers in `Surface.variants.ts` stay pure and hook-free.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo, useMemo } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { useTheme } from "../../theme/hooks.js";
|
|
6
|
+
import { resolveSurfaceColors, resolveSurfaceElevation, resolveSurfacePadding, surfaceStructure } from "./Surface.variants.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
function SurfaceImpl({
|
|
9
|
+
background,
|
|
10
|
+
border,
|
|
11
|
+
radius,
|
|
12
|
+
elevation,
|
|
13
|
+
padding,
|
|
14
|
+
children,
|
|
15
|
+
style,
|
|
16
|
+
testID
|
|
17
|
+
}) {
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const rootStyle = useMemo(() => {
|
|
20
|
+
const colors = resolveSurfaceColors(theme.colors, background, border);
|
|
21
|
+
const pad = resolveSurfacePadding(theme, padding);
|
|
22
|
+
const shadow = resolveSurfaceElevation(theme, elevation);
|
|
23
|
+
return [surfaceStructure(theme), colors.background !== undefined && {
|
|
24
|
+
backgroundColor: colors.background
|
|
25
|
+
}, border !== undefined && {
|
|
26
|
+
borderColor: colors.border,
|
|
27
|
+
borderWidth: theme.borderWidths.thin
|
|
28
|
+
}, radius !== undefined && {
|
|
29
|
+
borderRadius: theme.radii[radius]
|
|
30
|
+
}, pad !== undefined && {
|
|
31
|
+
padding: pad
|
|
32
|
+
}, shadow, style];
|
|
33
|
+
}, [theme, background, border, radius, elevation, padding, style]);
|
|
34
|
+
return /*#__PURE__*/_jsx(View, {
|
|
35
|
+
testID: testID,
|
|
36
|
+
style: rootStyle,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export const Surface = /*#__PURE__*/memo(SurfaceImpl);
|
|
41
|
+
export const Box = Surface;
|
|
42
|
+
//# sourceMappingURL=Surface.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createThemedVariants } from "../../core/style/index.js";
|
|
4
|
+
import { floatingBackground, floatingSurfaceStyle } from "../../theme/platform/floatingSurface.native.js";
|
|
5
|
+
export function resolveSurfaceColors(colors, background, border) {
|
|
6
|
+
return {
|
|
7
|
+
background: background === undefined ? undefined : colors.bg[background],
|
|
8
|
+
border: border === undefined ? undefined : colors.border[border]
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function resolveSurfacePadding(theme, padding) {
|
|
12
|
+
return padding === undefined ? undefined : theme.space[padding];
|
|
13
|
+
}
|
|
14
|
+
const SURFACE_FLOATING_LEVEL = {
|
|
15
|
+
sm: "sm",
|
|
16
|
+
base: "sm",
|
|
17
|
+
md: "md",
|
|
18
|
+
lg: "lg"
|
|
19
|
+
};
|
|
20
|
+
export function resolveSurfaceElevation(theme, elevation) {
|
|
21
|
+
if (elevation === undefined || elevation === "none") return undefined;
|
|
22
|
+
const level = SURFACE_FLOATING_LEVEL[elevation];
|
|
23
|
+
return {
|
|
24
|
+
backgroundColor: floatingBackground(theme, level),
|
|
25
|
+
...floatingSurfaceStyle(theme, level)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export const surfaceStructure = createThemedVariants(_theme => ({
|
|
29
|
+
base: {
|
|
30
|
+
borderCurve: "continuous"
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
//# sourceMappingURL=Surface.variants.js.map
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Swipe-to-reveal row actions via gesture-handler + reanimated.
|
|
4
4
|
|
|
5
|
+
## Round 5 tonal
|
|
6
|
+
|
|
7
|
+
No decorative container border here — `swipeableRowStructure` was already borderless; the only
|
|
8
|
+
border is the real focus ring (kept). Action buttons gained `usePressState`'s scale/opacity + overlay
|
|
9
|
+
feedback and `android_ripple`, matching `Button`/`BottomNavTab` — previously a plain `Pressable` with
|
|
10
|
+
no press feedback at all.
|
|
11
|
+
|
|
5
12
|
## Motion contract
|
|
6
13
|
|
|
7
14
|
- The row follows the finger on the **UI thread**: a single `Gesture.Pan()` writes a `translateX`
|
|
@@ -118,3 +125,5 @@ Known gaps:
|
|
|
118
125
|
`onPress`), and the button's own rendered touch-target size.
|
|
119
126
|
- `SwipeableRow.motion.test.tsx` — both halves of the reduce-motion contract, with
|
|
120
127
|
`withSpring`/`withTiming` mocked (a shared value written as a plain number proves nothing tweened).
|
|
128
|
+
|
|
129
|
+
Uses `scheduleOnRN` from `react-native-worklets` where JS thread callbacks are required.
|