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
|
@@ -16,12 +16,14 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
19
|
-
import { Pressable, Text, View } from "react-native";
|
|
19
|
+
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
|
20
20
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
21
21
|
import Animated, { cancelAnimation, useAnimatedStyle, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
|
|
22
22
|
import { Icon } from "../../core/icon/index.js";
|
|
23
23
|
import { useMotion } from "../../core/motion/index.js";
|
|
24
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
24
25
|
import { useTheme } from "../../theme/hooks.js";
|
|
26
|
+
import { rippleColor, stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
25
27
|
import { Button } from "../button/index.js";
|
|
26
28
|
import { Menu } from "../menu/index.js";
|
|
27
29
|
import { resolveSwipeableActionTone, SWIPE_ACTION_WIDTH, swipeableActionButtonStructure, swipeableActionFocusRingStructure, swipeableActionsStructure, swipeableMoreAffordanceStructure, swipeableRowStructure } from "./SwipeableRow.variants.js";
|
|
@@ -29,6 +31,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
29
31
|
const ICON_STROKE = 2;
|
|
30
32
|
const ICON_SIZE = 18;
|
|
31
33
|
const NO_ACTIONS = [];
|
|
34
|
+
const AnimatedActionPressable = Animated.createAnimatedComponent(Pressable);
|
|
32
35
|
export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
33
36
|
children,
|
|
34
37
|
leftActions = NO_ACTIONS,
|
|
@@ -200,6 +203,7 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
200
203
|
}) {
|
|
201
204
|
const colors = useMemo(() => resolveSwipeableActionTone(theme.colors, action.tone ?? "accent"), [theme, action.tone]);
|
|
202
205
|
const [focused, setFocused] = useState(false);
|
|
206
|
+
const press = usePressState(false);
|
|
203
207
|
const handlePress = useCallback(() => onRun(action.id), [onRun, action.id]);
|
|
204
208
|
const handleFocus = useCallback(() => setFocused(true), []);
|
|
205
209
|
const handleBlur = useCallback(() => setFocused(false), []);
|
|
@@ -213,20 +217,32 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
213
217
|
const focusRingStyle = useMemo(() => [swipeableActionFocusRingStructure(theme), {
|
|
214
218
|
borderColor: theme.colors.border.focus
|
|
215
219
|
}], [theme]);
|
|
216
|
-
|
|
220
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
221
|
+
backgroundColor: stateLayerScrim(theme.mode)
|
|
222
|
+
}), [theme.mode]);
|
|
223
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
224
|
+
color: rippleColor(theme.mode),
|
|
225
|
+
borderless: false
|
|
226
|
+
} : undefined, [theme.mode]);
|
|
227
|
+
return /*#__PURE__*/_jsxs(AnimatedActionPressable, {
|
|
217
228
|
testID: testID,
|
|
218
229
|
accessibilityRole: "button",
|
|
219
230
|
accessibilityLabel: action.label
|
|
220
|
-
//
|
|
221
|
-
// react-native-web (zero occurrences in its dist), so the tray's buttons would otherwise be
|
|
222
|
-
// invisible tab stops painted over by the row's own content.
|
|
231
|
+
// RNW ignores the tray's a11y-hiding props, so this stays a reachable tab stop otherwise.
|
|
223
232
|
,
|
|
224
233
|
tabIndex: -1,
|
|
225
234
|
onPress: handlePress,
|
|
235
|
+
onPressIn: press.handlers.onPressIn,
|
|
236
|
+
onPressOut: press.handlers.onPressOut,
|
|
237
|
+
onLayout: press.onLayout,
|
|
226
238
|
onFocus: handleFocus,
|
|
227
239
|
onBlur: handleBlur,
|
|
228
|
-
|
|
229
|
-
|
|
240
|
+
android_ripple: androidRipple,
|
|
241
|
+
style: [buttonStyle, styles.overflowHidden, press.animatedStyle],
|
|
242
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
243
|
+
pointerEvents: "none",
|
|
244
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
245
|
+
}), focused && /*#__PURE__*/_jsx(View, {
|
|
230
246
|
pointerEvents: "none",
|
|
231
247
|
testID: testID === undefined ? undefined : `${testID}-focus-ring`,
|
|
232
248
|
style: focusRingStyle
|
|
@@ -241,4 +257,9 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
241
257
|
})]
|
|
242
258
|
});
|
|
243
259
|
});
|
|
260
|
+
const styles = StyleSheet.create({
|
|
261
|
+
overflowHidden: {
|
|
262
|
+
overflow: "hidden"
|
|
263
|
+
}
|
|
264
|
+
});
|
|
244
265
|
//# sourceMappingURL=SwipeableRow.js.map
|
|
@@ -77,3 +77,5 @@ Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLA
|
|
|
77
77
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
78
78
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
79
79
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
80
|
+
|
|
81
|
+
Toggle uses `usePressState` and `useHaptics().selection()` on press.
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
* to RN — which is also why there is no `size` prop.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { memo } from "react";
|
|
10
|
+
import { memo, useCallback } from "react";
|
|
11
11
|
import { Switch as RNSwitch } from "react-native";
|
|
12
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
12
13
|
import { useThemeColors } from "../../theme/hooks.js";
|
|
13
14
|
import { resolveSwitchAccessibility, resolveSwitchColors, SWITCH_HIT_SLOP } from "./Switch.variants.js";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -23,6 +24,7 @@ export const Switch = /*#__PURE__*/memo(function Switch({
|
|
|
23
24
|
// `trackColor`/`thumbColor` accept no token object — the same raw-string escape hatch as
|
|
24
25
|
// `placeholderTextColor` — so colour is resolved via `useThemeColors()`, not `useTheme().colors`.
|
|
25
26
|
const colors = useThemeColors();
|
|
27
|
+
const haptics = useHaptics();
|
|
26
28
|
const {
|
|
27
29
|
trackOff,
|
|
28
30
|
trackOn,
|
|
@@ -32,10 +34,14 @@ export const Switch = /*#__PURE__*/memo(function Switch({
|
|
|
32
34
|
value,
|
|
33
35
|
disabled
|
|
34
36
|
});
|
|
37
|
+
const handleValueChange = useCallback(next => {
|
|
38
|
+
haptics.selection();
|
|
39
|
+
onValueChange(next);
|
|
40
|
+
}, [haptics, onValueChange]);
|
|
35
41
|
return /*#__PURE__*/_jsx(RNSwitch, {
|
|
36
42
|
testID: testID,
|
|
37
43
|
value: value,
|
|
38
|
-
onValueChange:
|
|
44
|
+
onValueChange: handleValueChange,
|
|
39
45
|
disabled: disabled,
|
|
40
46
|
accessibilityRole: a11y.accessibilityRole,
|
|
41
47
|
accessibilityLabel: accessibilityLabel,
|
|
@@ -57,7 +57,8 @@ purpose control has no closed union of appearances to resolve.
|
|
|
57
57
|
- **2.3.3** — the indicator's movement is two `Animated.Value`s (`translateX`, `scaleX`) driven off
|
|
58
58
|
each tab's own `onLayout` measurement. When `useMotion().enabled` is false (reduced motion or the
|
|
59
59
|
global kill switch) they're set with `setValue` (an instant snap) instead of tweening — verified
|
|
60
|
-
in the render tests by spying on `Animated.timing` and asserting it isn't called.
|
|
60
|
+
in the render tests by spying on `Animated.timing` and asserting it isn't called. Tab presses use
|
|
61
|
+
`usePressState` (scale + state-layer overlay).
|
|
61
62
|
|
|
62
63
|
## Indicator motion (transform-only, native driver)
|
|
63
64
|
|
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
19
|
-
import { Animated, Pressable, Text, View } from "react-native";
|
|
19
|
+
import { Animated, Pressable, StyleSheet, Text, View } from "react-native";
|
|
20
|
+
import Reanimated from "react-native-reanimated";
|
|
20
21
|
import { Icon } from "../../core/icon/index.js";
|
|
21
22
|
import { useAnimatedValue, useMotion } from "../../core/motion/index.js";
|
|
23
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
24
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
25
|
+
import { stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
22
26
|
import { useTheme } from "../../theme/hooks.js";
|
|
23
27
|
import { resolveTabAccessibility, resolveTabsColors, tabItemStructure, tabsFocusRingStructure, tabsIndicatorStructure, tabsStripStructure, TABS_INDICATOR_UNIT_WIDTH, TABS_SIZES } from "./Tabs.variants.js";
|
|
24
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
29
|
const ICON_STROKE = 2;
|
|
30
|
+
const AnimatedPressable = Reanimated.createAnimatedComponent(Pressable);
|
|
26
31
|
/** Centre of the 1dp bar in its own untransformed box — `scaleX` grows around it, not from the left. */
|
|
27
32
|
const INDICATOR_ORIGIN = TABS_INDICATOR_UNIT_WIDTH / 2;
|
|
28
33
|
const TabStripItem = /*#__PURE__*/memo(function TabStripItem({
|
|
@@ -31,51 +36,64 @@ const TabStripItem = /*#__PURE__*/memo(function TabStripItem({
|
|
|
31
36
|
size,
|
|
32
37
|
theme,
|
|
33
38
|
labelColor,
|
|
34
|
-
pressedColor,
|
|
35
39
|
hitSlop,
|
|
36
40
|
fontSize,
|
|
37
41
|
iconSize,
|
|
38
42
|
onPress,
|
|
39
43
|
onLayout,
|
|
44
|
+
hapticsSelection,
|
|
40
45
|
testID
|
|
41
46
|
}) {
|
|
42
47
|
const a11y = resolveTabAccessibility({
|
|
43
48
|
selected
|
|
44
49
|
});
|
|
45
|
-
|
|
46
|
-
// one item instead of the strip (same reasoning `BottomNavTab` documents).
|
|
50
|
+
const press = usePressState(false);
|
|
47
51
|
const [focused, setFocused] = useState(false);
|
|
48
|
-
const handlePress = useCallback(() =>
|
|
49
|
-
|
|
52
|
+
const handlePress = useCallback(() => {
|
|
53
|
+
hapticsSelection();
|
|
54
|
+
onPress(item.value);
|
|
55
|
+
}, [hapticsSelection, onPress, item.value]);
|
|
56
|
+
const handleLayout = useCallback(event => {
|
|
57
|
+
press.onLayout(event);
|
|
58
|
+
onLayout(item.value, event);
|
|
59
|
+
}, [onLayout, item.value, press.onLayout]);
|
|
50
60
|
const handleFocus = useCallback(() => setFocused(true), []);
|
|
51
61
|
const handleBlur = useCallback(() => setFocused(false), []);
|
|
52
62
|
const focusRingStyle = useMemo(() => [tabsFocusRingStructure(theme), {
|
|
53
63
|
borderColor: theme.colors.border.focus
|
|
54
64
|
}], [theme]);
|
|
55
|
-
const
|
|
56
|
-
backgroundColor: pressedColor
|
|
57
|
-
}), [pressedColor]);
|
|
58
|
-
const itemStyle = useCallback(({
|
|
59
|
-
pressed
|
|
60
|
-
}) => [tabItemStructure(theme, {
|
|
65
|
+
const itemStyle = useMemo(() => [tabItemStructure(theme, {
|
|
61
66
|
size
|
|
62
|
-
}),
|
|
63
|
-
|
|
67
|
+
}), {
|
|
68
|
+
overflow: "hidden"
|
|
69
|
+
}, press.animatedStyle], [theme, size, press.animatedStyle]);
|
|
70
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
71
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
72
|
+
borderRadius: theme.radii.md,
|
|
73
|
+
borderCurve: "continuous"
|
|
74
|
+
}), [theme.mode, theme.radii.md]);
|
|
75
|
+
const labelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights[selected ? "semibold" : "medium"]), {
|
|
64
76
|
fontSize,
|
|
65
77
|
color: labelColor
|
|
66
|
-
}], [theme, fontSize, labelColor]);
|
|
67
|
-
return /*#__PURE__*/_jsxs(
|
|
78
|
+
}], [theme, fontSize, labelColor, selected]);
|
|
79
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
68
80
|
testID: testID,
|
|
69
81
|
accessibilityRole: a11y.accessibilityRole,
|
|
70
82
|
"aria-selected": a11y["aria-selected"],
|
|
71
83
|
accessibilityLabel: item.label,
|
|
72
84
|
onPress: handlePress,
|
|
73
85
|
onLayout: handleLayout,
|
|
86
|
+
onPressIn: press.handlers.onPressIn,
|
|
87
|
+
onPressOut: press.handlers.onPressOut,
|
|
74
88
|
onFocus: handleFocus,
|
|
75
89
|
onBlur: handleBlur,
|
|
76
90
|
hitSlop: hitSlop,
|
|
77
91
|
style: itemStyle,
|
|
78
|
-
children: [
|
|
92
|
+
children: [/*#__PURE__*/_jsx(Reanimated.View, {
|
|
93
|
+
pointerEvents: "none",
|
|
94
|
+
testID: testID ? `${testID}-press-overlay` : undefined,
|
|
95
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle]
|
|
96
|
+
}), focused && /*#__PURE__*/_jsx(View, {
|
|
79
97
|
pointerEvents: "none",
|
|
80
98
|
testID: testID ? `${testID}-focus-ring` : undefined,
|
|
81
99
|
style: focusRingStyle
|
|
@@ -101,6 +119,7 @@ export const Tabs = /*#__PURE__*/memo(function Tabs({
|
|
|
101
119
|
}) {
|
|
102
120
|
const theme = useTheme();
|
|
103
121
|
const motion = useMotion();
|
|
122
|
+
const haptics = useHaptics();
|
|
104
123
|
const colors = useMemo(() => resolveTabsColors(theme.colors), [theme.colors]);
|
|
105
124
|
const spec = TABS_SIZES[size];
|
|
106
125
|
const [layouts, setLayouts] = useState({});
|
|
@@ -163,12 +182,12 @@ export const Tabs = /*#__PURE__*/memo(function Tabs({
|
|
|
163
182
|
size: size,
|
|
164
183
|
theme: theme,
|
|
165
184
|
labelColor: item.value === value ? colors.activeLabel : colors.inactiveLabel,
|
|
166
|
-
pressedColor: colors.pressedTab,
|
|
167
185
|
hitSlop: spec.hitSlop,
|
|
168
186
|
fontSize: spec.fontSize,
|
|
169
187
|
iconSize: spec.iconSize,
|
|
170
188
|
onPress: onValueChange,
|
|
171
189
|
onLayout: handleTabLayout,
|
|
190
|
+
hapticsSelection: haptics.selection,
|
|
172
191
|
testID: testID ? `${testID}-${item.value}` : undefined
|
|
173
192
|
}, item.value))]
|
|
174
193
|
});
|
|
@@ -90,7 +90,8 @@ export const tabItemStructure = createThemedVariants(theme => ({
|
|
|
90
90
|
flexDirection: "row",
|
|
91
91
|
alignItems: "center",
|
|
92
92
|
justifyContent: "center",
|
|
93
|
-
borderRadius: theme.radii.
|
|
93
|
+
borderRadius: theme.radii.md,
|
|
94
|
+
borderCurve: "continuous"
|
|
94
95
|
},
|
|
95
96
|
variants: {
|
|
96
97
|
size: {
|
|
@@ -142,7 +143,8 @@ export const tabsFocusRingStructure = createThemedVariants(theme => ({
|
|
|
142
143
|
right: 0,
|
|
143
144
|
bottom: 0,
|
|
144
145
|
borderWidth: theme.borderWidths.thick,
|
|
145
|
-
borderRadius: theme.radii.
|
|
146
|
+
borderRadius: theme.radii.md,
|
|
147
|
+
borderCurve: "continuous"
|
|
146
148
|
}
|
|
147
149
|
}));
|
|
148
150
|
export const tabsIndicatorStructure = createThemedVariants(theme => ({
|
|
@@ -16,12 +16,15 @@ import { Text, Heading } from 'pixelize-native-library/text';
|
|
|
16
16
|
|
|
17
17
|
| `Text` variant | size | weight | colour role |
|
|
18
18
|
|---|---|---|---|
|
|
19
|
-
| `body` |
|
|
19
|
+
| `body` | 17 iOS / 16 Android | regular | `fg.default` |
|
|
20
20
|
| `body-sm` | `sm` | regular | `fg.default` |
|
|
21
21
|
| `caption` | `xs` | regular | `fg.muted` |
|
|
22
22
|
| `label` | `md` | semibold | `fg.default` |
|
|
23
23
|
| `label-sm` | `sm` | semibold | `fg.default` |
|
|
24
|
-
| `overline` | `xs` | bold | `fg.muted` |
|
|
24
|
+
| `overline` | `xs` | bold | `fg.muted` | uppercase + wider tracking |
|
|
25
|
+
|
|
26
|
+
Optional props (additive): `color` (`fg` role or `status` role), `align`, `weight`, `numberOfLines`.
|
|
27
|
+
Every variant resolves `lineHeight` (size + 5) and `letterSpacing` from theme tokens.
|
|
25
28
|
|
|
26
29
|
`Heading` reuses `label` / `label-sm` and overrides only the font size (`h1` `3xl` → `h4` `lg`). It
|
|
27
30
|
renders with `accessibilityRole="header"` **and `aria-level` derived 1:1 from `variant`**
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Text — typography primitive with a closed `variant` union. Replaces ad-hoc fontSize literals.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
3
|
import { memo, useMemo } from 'react';
|
|
8
4
|
import { Text as RNText } from 'react-native';
|
|
9
5
|
import { HeadingText } from "../../core/heading/index.js";
|
|
@@ -13,12 +9,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
9
|
export const Text = /*#__PURE__*/memo(function Text({
|
|
14
10
|
variant = 'body',
|
|
15
11
|
children,
|
|
12
|
+
color,
|
|
16
13
|
numberOfLines,
|
|
14
|
+
align,
|
|
15
|
+
weight,
|
|
17
16
|
style,
|
|
18
17
|
testID
|
|
19
18
|
}) {
|
|
20
19
|
const theme = useTheme();
|
|
21
|
-
const
|
|
20
|
+
const textOptions = useMemo(() => ({
|
|
21
|
+
color,
|
|
22
|
+
align,
|
|
23
|
+
weight
|
|
24
|
+
}), [color, align, weight]);
|
|
25
|
+
const rootStyle = useMemo(() => [resolveTextStyle(theme, variant, textOptions), style], [theme, variant, textOptions, style]);
|
|
22
26
|
return /*#__PURE__*/_jsx(RNText, {
|
|
23
27
|
testID: testID,
|
|
24
28
|
numberOfLines: numberOfLines,
|
|
@@ -29,12 +33,20 @@ export const Text = /*#__PURE__*/memo(function Text({
|
|
|
29
33
|
export const Heading = /*#__PURE__*/memo(function Heading({
|
|
30
34
|
variant = 'h2',
|
|
31
35
|
children,
|
|
36
|
+
color,
|
|
32
37
|
numberOfLines,
|
|
38
|
+
align,
|
|
39
|
+
weight,
|
|
33
40
|
style,
|
|
34
41
|
testID
|
|
35
42
|
}) {
|
|
36
43
|
const theme = useTheme();
|
|
37
|
-
const
|
|
44
|
+
const textOptions = useMemo(() => ({
|
|
45
|
+
color,
|
|
46
|
+
align,
|
|
47
|
+
weight
|
|
48
|
+
}), [color, align, weight]);
|
|
49
|
+
const rootStyle = useMemo(() => [resolveHeadingStyle(theme, variant, textOptions), style], [theme, variant, textOptions, style]);
|
|
38
50
|
return /*#__PURE__*/_jsx(HeadingText, {
|
|
39
51
|
testID: testID,
|
|
40
52
|
numberOfLines: numberOfLines,
|
|
@@ -1,63 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* `variant` is the level as well as the size. Without this, `react-native-web` renders every
|
|
5
|
-
* heading as `<h1>` (see `core/heading`).
|
|
6
|
-
*/
|
|
3
|
+
import { Platform } from 'react-native';
|
|
7
4
|
export const HEADING_LEVELS = {
|
|
8
5
|
h1: 1,
|
|
9
6
|
h2: 2,
|
|
10
7
|
h3: 3,
|
|
11
8
|
h4: 4
|
|
12
9
|
};
|
|
13
|
-
|
|
14
|
-
/** Runtime companion to `TextVariant`, so the WCAG test can enumerate every variant a consumer can pass. */
|
|
15
|
-
export const TEXT_VARIANTS = ['body', 'body-sm', 'caption', 'label', 'label-sm', 'overline'];
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The `fg` roles a text variant may bind to. `fg.subtle` is deliberately NOT one of them: it is the
|
|
19
|
-
* flat `gray[500]` rung tuned to the 3:1 non-text tier, and measures 3.19:1 against `bg.canvas` on
|
|
20
|
-
* emerald light — the exact defect `Timeline.test.ts` already documents. Text has no large-text
|
|
21
|
-
* exemption to fall back on (its smallest variants are `xs`), so the union is closed at the two
|
|
22
|
-
* derived, measured roles.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
export const HEADING_VARIANTS = {
|
|
26
|
-
h1: 'label',
|
|
27
|
-
h2: 'label',
|
|
28
|
-
h3: 'label-sm',
|
|
29
|
-
h4: 'label-sm'
|
|
30
|
-
};
|
|
10
|
+
export const TEXT_VARIANTS = ['display', 'title', 'heading', 'subheading', 'body', 'body-sm', 'caption', 'label', 'label-sm', 'overline'];
|
|
31
11
|
const VARIANT_CONFIG = {
|
|
12
|
+
display: {
|
|
13
|
+
fontSize: '4xl',
|
|
14
|
+
weight: 'bold',
|
|
15
|
+
color: 'default',
|
|
16
|
+
lineHeight: 40,
|
|
17
|
+
letterSpacing: -0.5
|
|
18
|
+
},
|
|
19
|
+
title: {
|
|
20
|
+
fontSize: '2xl',
|
|
21
|
+
weight: 'bold',
|
|
22
|
+
color: 'default',
|
|
23
|
+
lineHeight: 30,
|
|
24
|
+
letterSpacing: -0.3
|
|
25
|
+
},
|
|
26
|
+
heading: {
|
|
27
|
+
fontSize: 'xl',
|
|
28
|
+
weight: 'bold',
|
|
29
|
+
color: 'default',
|
|
30
|
+
lineHeight: 26,
|
|
31
|
+
letterSpacing: -0.2
|
|
32
|
+
},
|
|
33
|
+
subheading: {
|
|
34
|
+
fontSize: 'lg',
|
|
35
|
+
weight: 'semibold',
|
|
36
|
+
color: 'default',
|
|
37
|
+
lineHeight: 24,
|
|
38
|
+
letterSpacing: -0.1
|
|
39
|
+
},
|
|
32
40
|
body: {
|
|
33
|
-
fontSize: '
|
|
41
|
+
fontSize: 'body',
|
|
34
42
|
weight: 'regular',
|
|
35
|
-
color: 'default'
|
|
43
|
+
color: 'default',
|
|
44
|
+
lineHeight: 'body',
|
|
45
|
+
letterSpacing: 0
|
|
36
46
|
},
|
|
37
47
|
'body-sm': {
|
|
38
48
|
fontSize: 'sm',
|
|
39
49
|
weight: 'regular',
|
|
40
|
-
color: 'default'
|
|
50
|
+
color: 'default',
|
|
51
|
+
lineHeight: 20,
|
|
52
|
+
letterSpacing: 0
|
|
41
53
|
},
|
|
42
54
|
caption: {
|
|
43
55
|
fontSize: 'xs',
|
|
44
|
-
weight: '
|
|
45
|
-
color: 'muted'
|
|
56
|
+
weight: 'medium',
|
|
57
|
+
color: 'muted',
|
|
58
|
+
lineHeight: 16,
|
|
59
|
+
letterSpacing: 0.2
|
|
46
60
|
},
|
|
47
61
|
label: {
|
|
48
|
-
fontSize: '
|
|
62
|
+
fontSize: 'sm',
|
|
49
63
|
weight: 'semibold',
|
|
50
|
-
color: 'default'
|
|
64
|
+
color: 'default',
|
|
65
|
+
lineHeight: 20,
|
|
66
|
+
letterSpacing: 0
|
|
51
67
|
},
|
|
52
68
|
'label-sm': {
|
|
53
|
-
fontSize: '
|
|
69
|
+
fontSize: 'xs',
|
|
54
70
|
weight: 'semibold',
|
|
55
|
-
color: 'default'
|
|
71
|
+
color: 'default',
|
|
72
|
+
lineHeight: 16,
|
|
73
|
+
letterSpacing: 0
|
|
56
74
|
},
|
|
57
75
|
overline: {
|
|
58
76
|
fontSize: 'xs',
|
|
59
77
|
weight: 'bold',
|
|
60
|
-
color: 'muted'
|
|
78
|
+
color: 'muted',
|
|
79
|
+
lineHeight: 16,
|
|
80
|
+
letterSpacing: 1.2,
|
|
81
|
+
uppercase: true
|
|
61
82
|
}
|
|
62
83
|
};
|
|
63
84
|
const HEADING_OVERRIDES = {
|
|
@@ -74,25 +95,68 @@ const HEADING_OVERRIDES = {
|
|
|
74
95
|
fontSize: 'lg'
|
|
75
96
|
}
|
|
76
97
|
};
|
|
77
|
-
|
|
78
|
-
|
|
98
|
+
export const HEADING_VARIANTS = {
|
|
99
|
+
h1: 'title',
|
|
100
|
+
h2: 'heading',
|
|
101
|
+
h3: 'subheading',
|
|
102
|
+
h4: 'label'
|
|
103
|
+
};
|
|
104
|
+
function variantFontSize(theme, variant) {
|
|
105
|
+
const config = VARIANT_CONFIG[variant];
|
|
106
|
+
if (config.fontSize === 'body') {
|
|
107
|
+
return Platform.select({
|
|
108
|
+
ios: 17,
|
|
109
|
+
default: theme.fontSizes.md
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return theme.fontSizes[config.fontSize];
|
|
113
|
+
}
|
|
114
|
+
function variantLineHeight(_theme, variant, fontSize) {
|
|
115
|
+
const config = VARIANT_CONFIG[variant];
|
|
116
|
+
if (config.lineHeight === 'body') {
|
|
117
|
+
return fontSize + 6;
|
|
118
|
+
}
|
|
119
|
+
return config.lineHeight;
|
|
120
|
+
}
|
|
121
|
+
export function resolveTextColorFromRole(colors, role) {
|
|
122
|
+
if (role === 'default' || role === 'muted') {
|
|
123
|
+
return colors.fg[role];
|
|
124
|
+
}
|
|
125
|
+
return colors.status[role].text;
|
|
126
|
+
}
|
|
79
127
|
export function resolveTextColor(colors, variant) {
|
|
80
128
|
return colors.fg[VARIANT_CONFIG[variant].color];
|
|
81
129
|
}
|
|
82
|
-
export function resolveTextStyle(theme, variant) {
|
|
130
|
+
export function resolveTextStyle(theme, variant, options) {
|
|
83
131
|
const config = VARIANT_CONFIG[variant];
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
132
|
+
const fontSize = variantFontSize(theme, variant);
|
|
133
|
+
const weight = options?.weight ?? config.weight;
|
|
134
|
+
const color = options?.color !== undefined ? resolveTextColorFromRole(theme.colors, options.color) : resolveTextColor(theme.colors, variant);
|
|
135
|
+
const style = {
|
|
136
|
+
...theme.fontStyleForWeight(theme.fontWeights[weight]),
|
|
137
|
+
fontSize,
|
|
138
|
+
lineHeight: variantLineHeight(theme, variant, fontSize),
|
|
139
|
+
letterSpacing: config.letterSpacing,
|
|
140
|
+
color
|
|
88
141
|
};
|
|
142
|
+
if (options?.align !== undefined) {
|
|
143
|
+
style.textAlign = options.align;
|
|
144
|
+
}
|
|
145
|
+
if (config.uppercase) {
|
|
146
|
+
style.textTransform = 'uppercase';
|
|
147
|
+
}
|
|
148
|
+
return style;
|
|
89
149
|
}
|
|
90
|
-
export function resolveHeadingStyle(theme, variant) {
|
|
91
|
-
const base = resolveTextStyle(theme, HEADING_VARIANTS[variant]);
|
|
150
|
+
export function resolveHeadingStyle(theme, variant, options) {
|
|
151
|
+
const base = resolveTextStyle(theme, HEADING_VARIANTS[variant], options);
|
|
92
152
|
const override = HEADING_OVERRIDES[variant];
|
|
93
|
-
|
|
153
|
+
if (!override) return base;
|
|
154
|
+
const fontSize = theme.fontSizes[override.fontSize];
|
|
155
|
+
return {
|
|
94
156
|
...base,
|
|
95
|
-
fontSize
|
|
96
|
-
|
|
157
|
+
fontSize,
|
|
158
|
+
lineHeight: fontSize + (variant === 'h1' ? 6 : variant === 'h2' ? 6 : 4),
|
|
159
|
+
letterSpacing: variant === 'h1' ? -0.3 : variant === 'h2' ? -0.2 : -0.1
|
|
160
|
+
};
|
|
97
161
|
}
|
|
98
162
|
//# sourceMappingURL=Text.variants.js.map
|
|
@@ -105,3 +105,5 @@ Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLA
|
|
|
105
105
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
106
106
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
107
107
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
108
|
+
|
|
109
|
+
- **Round 2 visual** — radii retarget (`radii.md`/`lg`/`xl`/`full`), `borderCurve: continuous` on md+ corners; floating surfaces wire platform elevation/highlight where applicable.
|
|
@@ -98,7 +98,8 @@ export const Textarea = /*#__PURE__*/memo(function Textarea(props) {
|
|
|
98
98
|
bottom: -(FOCUS_RING_GAP + FOCUS_RING_WIDTH),
|
|
99
99
|
borderWidth: FOCUS_RING_WIDTH,
|
|
100
100
|
borderColor: theme.colors.border.focus,
|
|
101
|
-
borderRadius: theme.radii.
|
|
101
|
+
borderRadius: theme.radii.md + FOCUS_RING_GAP + FOCUS_RING_WIDTH,
|
|
102
|
+
borderCurve: "continuous"
|
|
102
103
|
}), [theme]);
|
|
103
104
|
const messageStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.regular), {
|
|
104
105
|
fontSize: theme.fontSizes.xs,
|
|
@@ -124,7 +125,7 @@ export const Textarea = /*#__PURE__*/memo(function Textarea(props) {
|
|
|
124
125
|
value: value,
|
|
125
126
|
onChangeText: onChangeText,
|
|
126
127
|
placeholder: placeholder,
|
|
127
|
-
placeholderTextColor: theme.colors.fg.
|
|
128
|
+
placeholderTextColor: theme.colors.fg.placeholder,
|
|
128
129
|
editable: !disabled,
|
|
129
130
|
multiline: true,
|
|
130
131
|
maxLength: maxLength,
|
|
@@ -86,7 +86,8 @@ export function resolveTextareaAccessibility(input) {
|
|
|
86
86
|
*/
|
|
87
87
|
export const textareaFieldStructure = createThemedVariants(theme => ({
|
|
88
88
|
base: {
|
|
89
|
-
borderRadius: theme.radii.
|
|
89
|
+
borderRadius: theme.radii.md,
|
|
90
|
+
borderCurve: "continuous",
|
|
90
91
|
borderWidth: theme.borderWidths.thin,
|
|
91
92
|
paddingHorizontal: theme.space[3],
|
|
92
93
|
paddingVertical: theme.space[2]
|
|
@@ -145,10 +145,10 @@ change can't silently reintroduce the gap.
|
|
|
145
145
|
`core/a11y` and re-export, once that edit lands, rather than leaving two near-identical stores.
|
|
146
146
|
- **No stacking queue.** `show()` while visible replaces the current toast; there is no multi-toast
|
|
147
147
|
queue in v1. Flagging for a future version if a consumer needs concurrent toasts.
|
|
148
|
-
- **
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
- **Top position has no safe-area inset awareness.** `position: "bottom"` now adds the same static
|
|
149
|
+
iOS home-indicator approximation Drawer/BottomSheet use (`resolveToastBottomInset`); `top` still
|
|
150
|
+
reads a fixed `theme.space[4]` with no notch awareness — a consumer on a notched device may want
|
|
151
|
+
its own top padding via screen-level layout until `react-native-safe-area-context` is a real peer.
|
|
152
152
|
- Render tests need `@testing-library/react-native` + a react-native jest preset (same
|
|
153
153
|
dependency-pending note as `Button.render.test.tsx`).
|
|
154
154
|
|
|
@@ -161,3 +161,7 @@ change can't silently reintroduce the gap.
|
|
|
161
161
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
162
162
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
163
163
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
164
|
+
|
|
165
|
+
Success/danger toasts fire `useHaptics().notification()` when a haptics module is registered.
|
|
166
|
+
|
|
167
|
+
- **Round 5 motion** — dropped the ad hoc reanimated `FadeInDown`/`FadeOut`/`LinearTransition` wrapper; `progress` already drove the card's own entrance+exit fade/slide, so the wrapper was pure duplication.
|