pixelize-native-library 1.2.0 → 1.3.0
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/COMPONENT-GOTCHAS.md +309 -0
- package/DESIGN-GUIDE.md +215 -0
- package/README.md +44 -0
- package/lib/module/core/MODULE.md +23 -16
- package/lib/module/core/a11y/MODULE.md +7 -7
- package/lib/module/core/a11y/touchTarget.js +6 -0
- package/lib/module/core/blur/blur.js +17 -0
- package/lib/module/core/blur/index.js +4 -0
- package/lib/module/core/device/MODULE.md +5 -8
- package/lib/module/core/gradient/AccentGradientFill.js +83 -0
- package/lib/module/core/gradient/ShimmerGradientFill.js +79 -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 +8 -0
- package/lib/module/core/gradient/withAlpha.js +19 -0
- package/lib/module/core/haptics/MODULE.md +8 -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/heading/MODULE.md +1 -1
- package/lib/module/core/icon/MODULE.md +22 -23
- package/lib/module/core/icon/icons/building-2.js +1 -1
- package/lib/module/core/icon/icons/trash.js +1 -1
- package/lib/module/core/icon/icons/trending-up.js +10 -0
- package/lib/module/core/icon/resolve.js +2 -0
- package/lib/module/core/list/VirtualList.js +16 -3
- package/lib/module/core/media/expoImage.js +6 -0
- package/lib/module/core/motion/MODULE.md +25 -16
- package/lib/module/core/motion/animatedComponents.js +8 -0
- package/lib/module/core/motion/config.js +4 -1
- package/lib/module/core/motion/index.js +4 -1
- package/lib/module/core/motion/motionAnimation.js +87 -0
- package/lib/module/core/motion/presets.js +81 -81
- package/lib/module/core/motion/reanimatedEasing.js +19 -0
- package/lib/module/core/motion/useAnimatedValue.js +2 -14
- package/lib/module/core/motion/useMotion.js +19 -20
- package/lib/module/core/motion/usePressState.js +140 -0
- package/lib/module/core/overlay/MODULE.md +17 -0
- package/lib/module/core/overlay/ModalPortalContext.js +8 -0
- package/lib/module/core/overlay/index.js +5 -0
- package/lib/module/core/overlay/renderWebPortal.js +6 -0
- package/lib/module/core/overlay/renderWebPortal.web.js +8 -0
- package/lib/module/core/screen-scroll/ScreenScrollContext.js +9 -0
- package/lib/module/core/screen-scroll/index.js +4 -0
- package/lib/module/core/slot/MODULE.md +9 -0
- package/lib/module/core/slot/index.js +4 -0
- package/lib/module/core/slot/nodeSlot.js +21 -0
- package/lib/module/core/style/focusRing.js +37 -0
- package/lib/module/core/style/index.js +2 -1
- package/lib/module/core/style/radius.js +4 -0
- package/lib/module/index.js +24 -4
- package/lib/module/modules/accordion/Accordion.js +115 -153
- package/lib/module/modules/accordion/Accordion.variants.js +6 -7
- package/lib/module/modules/accordion/AccordionProps.js +4 -0
- package/lib/module/modules/accordion/MODULE.md +15 -23
- package/lib/module/modules/alert-dialog/AlertDialog.js +25 -7
- package/lib/module/modules/alert-dialog/AlertDialog.variants.js +4 -0
- package/lib/module/modules/alert-dialog/AlertDialogProps.js +4 -0
- package/lib/module/modules/alert-dialog/MODULE.md +2 -1
- package/lib/module/modules/app-bar/AppBar.js +27 -22
- package/lib/module/modules/app-bar/AppBar.variants.js +6 -2
- package/lib/module/modules/app-bar/AppBarProps.js +4 -0
- package/lib/module/modules/app-bar/MODULE.md +1 -1
- package/lib/module/modules/app-switcher/AppSwitcher.js +30 -0
- package/lib/module/modules/app-switcher/AppSwitcherProps.js +4 -0
- package/lib/module/modules/app-switcher/MODULE.md +14 -0
- package/lib/module/modules/app-switcher/index.js +4 -0
- package/lib/module/modules/appearance-settings/AppearanceSettings.js +58 -0
- package/lib/module/modules/appearance-settings/AppearanceSettingsProps.js +4 -0
- package/lib/module/modules/appearance-settings/MODULE.md +9 -0
- package/lib/module/modules/appearance-settings/index.js +4 -0
- package/lib/module/modules/avatar/Avatar.js +7 -1
- package/lib/module/modules/avatar/Avatar.variants.js +3 -1
- package/lib/module/modules/avatar/AvatarProps.js +4 -0
- package/lib/module/modules/avatar/MODULE.md +3 -3
- 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/AvatarGroupProps.js +4 -0
- package/lib/module/modules/avatar-group/MODULE.md +17 -0
- package/lib/module/modules/backdrop/Backdrop.js +38 -0
- package/lib/module/modules/backdrop/BackdropProps.js +4 -0
- package/lib/module/modules/backdrop/MODULE.md +11 -0
- package/lib/module/modules/backdrop/index.js +4 -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/BadgeProps.js +4 -0
- package/lib/module/modules/badge/MODULE.md +11 -9
- package/lib/module/modules/banner/Banner.js +106 -60
- package/lib/module/modules/banner/Banner.variants.js +5 -3
- package/lib/module/modules/banner/BannerProps.js +4 -0
- package/lib/module/modules/banner/MODULE.md +27 -33
- package/lib/module/modules/bottom-nav/BottomNav.js +6 -3
- package/lib/module/modules/bottom-nav/BottomNav.variants.js +11 -12
- package/lib/module/modules/bottom-nav/BottomNavIconWithBadge.js +18 -19
- package/lib/module/modules/bottom-nav/BottomNavOverflowSheet.js +35 -10
- package/lib/module/modules/bottom-nav/BottomNavProps.js +4 -0
- package/lib/module/modules/bottom-nav/BottomNavTab.js +38 -15
- package/lib/module/modules/bottom-nav/MODULE.md +14 -5
- package/lib/module/modules/bottom-sheet/BottomSheet.js +49 -13
- package/lib/module/modules/bottom-sheet/BottomSheet.variants.js +15 -5
- package/lib/module/modules/bottom-sheet/BottomSheetProps.js +4 -0
- package/lib/module/modules/bottom-sheet/MODULE.md +24 -3
- package/lib/module/modules/breadcrumbs/Breadcrumbs.js +54 -0
- package/lib/module/modules/breadcrumbs/Breadcrumbs.variants.js +28 -0
- package/lib/module/modules/breadcrumbs/BreadcrumbsProps.js +4 -0
- package/lib/module/modules/breadcrumbs/MODULE.md +13 -0
- package/lib/module/modules/breadcrumbs/index.js +4 -0
- package/lib/module/modules/button/Button.js +89 -101
- package/lib/module/modules/button/Button.variants.js +14 -17
- package/lib/module/modules/button/ButtonProps.js +4 -0
- package/lib/module/modules/button/MODULE.md +11 -10
- package/lib/module/modules/button-group/ButtonGroup.js +38 -38
- package/lib/module/modules/button-group/ButtonGroup.variants.js +23 -50
- package/lib/module/modules/button-group/ButtonGroupProps.js +4 -0
- package/lib/module/modules/button-group/MODULE.md +27 -32
- package/lib/module/modules/card/Card.js +140 -19
- package/lib/module/modules/card/Card.variants.js +1 -0
- package/lib/module/modules/card/CardProps.js +4 -0
- package/lib/module/modules/card/MODULE.md +17 -12
- package/lib/module/modules/charts/BarChart.js +35 -18
- package/lib/module/modules/charts/BarChartProps.js +4 -0
- package/lib/module/modules/charts/BarList.js +33 -19
- package/lib/module/modules/charts/BarListProps.js +4 -0
- package/lib/module/modules/charts/ChartLegendProps.js +4 -0
- package/lib/module/modules/charts/Charts.variants.js +69 -3
- package/lib/module/modules/charts/DonutChart.js +12 -6
- package/lib/module/modules/charts/DonutChartProps.js +4 -0
- package/lib/module/modules/charts/LineChart.js +8 -5
- package/lib/module/modules/charts/LineChartProps.js +4 -0
- package/lib/module/modules/charts/MODULE.md +33 -20
- package/lib/module/modules/charts/PieChart.js +19 -8
- package/lib/module/modules/charts/PieChartProps.js +4 -0
- package/lib/module/modules/charts/Sparkline.js +4 -2
- package/lib/module/modules/charts/SparklineProps.js +4 -0
- package/lib/module/modules/checkbox/Checkbox.js +30 -28
- package/lib/module/modules/checkbox/Checkbox.variants.js +4 -2
- package/lib/module/modules/checkbox/CheckboxProps.js +4 -0
- package/lib/module/modules/checkbox/MODULE.md +17 -6
- package/lib/module/modules/chip/Chip.js +116 -54
- package/lib/module/modules/chip/Chip.variants.js +18 -5
- package/lib/module/modules/chip/ChipGroup.js +16 -5
- package/lib/module/modules/chip/ChipGroupProps.js +4 -0
- package/lib/module/modules/chip/ChipProps.js +4 -0
- package/lib/module/modules/chip/MODULE.md +8 -8
- package/lib/module/modules/combobox/Combobox.js +111 -78
- package/lib/module/modules/combobox/Combobox.variants.js +24 -10
- package/lib/module/modules/combobox/ComboboxProps.js +4 -0
- package/lib/module/modules/combobox/MODULE.md +14 -10
- package/lib/module/modules/composer/Composer.js +20 -11
- package/lib/module/modules/composer/Composer.variants.js +2 -0
- package/lib/module/modules/composer/ComposerProps.js +4 -0
- package/lib/module/modules/composer/MODULE.md +7 -2
- package/lib/module/modules/copy-button/CopyButton.js +35 -9
- package/lib/module/modules/copy-button/CopyButton.variants.js +7 -4
- package/lib/module/modules/copy-button/CopyButtonProps.js +4 -0
- package/lib/module/modules/copy-button/MODULE.md +11 -8
- package/lib/module/modules/data-table/DataTable.js +37 -14
- package/lib/module/modules/data-table/DataTable.variants.js +5 -4
- package/lib/module/modules/data-table/DataTableProps.js +4 -0
- package/lib/module/modules/data-table/MODULE.md +6 -10
- package/lib/module/modules/date-picker/Calendar.js +78 -29
- package/lib/module/modules/date-picker/CalendarProps.js +4 -0
- package/lib/module/modules/date-picker/DatePicker.variants.js +26 -10
- package/lib/module/modules/date-picker/DatePickerProps.js +4 -0
- package/lib/module/modules/date-picker/DateRangePickerProps.js +4 -0
- package/lib/module/modules/date-picker/MODULE.md +29 -11
- package/lib/module/modules/date-picker/PickerField.js +13 -4
- package/lib/module/modules/date-picker/PickerFieldProps.js +4 -0
- package/lib/module/modules/date-picker/PickerShell.js +23 -12
- package/lib/module/modules/date-picker/PickerShellProps.js +4 -0
- package/lib/module/modules/date-picker/TimePicker.js +15 -19
- package/lib/module/modules/date-picker/TimePickerProps.js +4 -0
- package/lib/module/modules/description-list/DescriptionList.js +90 -0
- package/lib/module/modules/description-list/DescriptionList.variants.js +63 -0
- package/lib/module/modules/description-list/DescriptionListProps.js +4 -0
- package/lib/module/modules/description-list/MODULE.md +15 -0
- package/lib/module/modules/description-list/index.js +4 -0
- package/lib/module/modules/divider/Divider.variants.js +6 -5
- package/lib/module/modules/divider/DividerProps.js +4 -0
- package/lib/module/modules/divider/MODULE.md +1 -6
- package/lib/module/modules/document-viewer/DocumentViewer.js +35 -0
- package/lib/module/modules/document-viewer/DocumentViewerProps.js +4 -0
- package/lib/module/modules/document-viewer/MODULE.md +12 -0
- package/lib/module/modules/document-viewer/index.js +4 -0
- package/lib/module/modules/drawer/Drawer.js +62 -45
- package/lib/module/modules/drawer/Drawer.variants.js +4 -4
- package/lib/module/modules/drawer/DrawerProps.js +4 -0
- package/lib/module/modules/drawer/MODULE.md +14 -21
- package/lib/module/modules/empty-state/EmptyState.js +19 -29
- package/lib/module/modules/empty-state/EmptyState.variants.js +7 -0
- package/lib/module/modules/empty-state/EmptyStateProps.js +4 -0
- package/lib/module/modules/empty-state/MODULE.md +5 -9
- package/lib/module/modules/fab/Fab.js +47 -69
- package/lib/module/modules/fab/Fab.variants.js +25 -5
- package/lib/module/modules/fab/FabGroup.js +113 -89
- package/lib/module/modules/fab/FabGroupProps.js +4 -0
- package/lib/module/modules/fab/FabProps.js +4 -0
- package/lib/module/modules/fab/MODULE.md +17 -11
- package/lib/module/modules/field-select-modal/FieldSelectModal.js +52 -0
- package/lib/module/modules/field-select-modal/FieldSelectModalProps.js +4 -0
- package/lib/module/modules/field-select-modal/MODULE.md +13 -0
- package/lib/module/modules/field-select-modal/index.js +4 -0
- package/lib/module/modules/file-grid/FileGrid.js +31 -16
- package/lib/module/modules/file-grid/FileGrid.variants.js +2 -2
- package/lib/module/modules/file-grid/FileGridProps.js +4 -0
- package/lib/module/modules/file-grid/MODULE.md +29 -4
- package/lib/module/modules/file-upload/FileUpload.js +56 -15
- package/lib/module/modules/file-upload/FileUpload.variants.js +3 -1
- package/lib/module/modules/file-upload/FileUploadProps.js +4 -0
- package/lib/module/modules/file-upload/MODULE.md +10 -12
- package/lib/module/modules/filter-bar/FilterBar.js +68 -0
- package/lib/module/modules/filter-bar/FilterBarProps.js +4 -0
- package/lib/module/modules/filter-bar/MODULE.md +16 -0
- package/lib/module/modules/filter-bar/index.js +4 -0
- package/lib/module/modules/filter-sheet/FilterChip.js +13 -4
- package/lib/module/modules/filter-sheet/FilterChipProps.js +4 -0
- package/lib/module/modules/filter-sheet/FilterSheet.js +19 -14
- package/lib/module/modules/filter-sheet/FilterSheet.variants.js +2 -3
- package/lib/module/modules/filter-sheet/FilterSheetBody.js +39 -17
- package/lib/module/modules/filter-sheet/FilterSheetProps.js +2 -0
- package/lib/module/modules/filter-sheet/MODULE.md +4 -4
- package/lib/module/modules/folder-row/FolderRow.js +33 -19
- package/lib/module/modules/folder-row/FolderRow.variants.js +4 -2
- package/lib/module/modules/folder-row/FolderRowProps.js +4 -0
- package/lib/module/modules/folder-row/MODULE.md +6 -4
- package/lib/module/modules/form-field/FormField.js +9 -4
- package/lib/module/modules/form-field/FormFieldProps.js +4 -0
- package/lib/module/modules/form-field/MODULE.md +2 -7
- package/lib/module/modules/gantt/Gantt.js +52 -14
- package/lib/module/modules/gantt/Gantt.variants.js +47 -3
- package/lib/module/modules/gantt/GanttProps.js +4 -0
- package/lib/module/modules/gantt/MODULE.md +14 -4
- package/lib/module/modules/image-viewer/ImageViewer.js +37 -6
- package/lib/module/modules/image-viewer/ImageViewerProps.js +4 -0
- package/lib/module/modules/image-viewer/MODULE.md +7 -1
- package/lib/module/modules/input/Input.js +75 -27
- package/lib/module/modules/input/Input.variants.js +10 -10
- package/lib/module/modules/input/InputProps.js +4 -0
- package/lib/module/modules/input/MODULE.md +9 -14
- package/lib/module/modules/key-value/KeyValue.js +36 -0
- package/lib/module/modules/key-value/KeyValueProps.js +4 -0
- package/lib/module/modules/key-value/MODULE.md +16 -0
- package/lib/module/modules/key-value/index.js +4 -0
- package/lib/module/modules/limit-reached-modal/LimitReachedModalProps.js +4 -0
- package/lib/module/modules/limit-reached-modal/MODULE.md +1 -6
- package/lib/module/modules/list-item/ListItem.js +60 -27
- package/lib/module/modules/list-item/ListItem.variants.js +11 -2
- package/lib/module/modules/list-item/ListItemProps.js +4 -0
- package/lib/module/modules/list-item/MODULE.md +14 -10
- package/lib/module/modules/list-screen/ListScreen.js +63 -0
- package/lib/module/modules/list-screen/ListScreenProps.js +4 -0
- package/lib/module/modules/list-screen/MODULE.md +12 -0
- package/lib/module/modules/list-screen/index.js +4 -0
- package/lib/module/modules/markdown/MODULE.md +6 -5
- package/lib/module/modules/markdown/Markdown.js +57 -22
- package/lib/module/modules/markdown/Markdown.variants.js +2 -1
- package/lib/module/modules/markdown/MarkdownProps.js +4 -0
- package/lib/module/modules/menu/MODULE.md +11 -7
- package/lib/module/modules/menu/Menu.js +149 -76
- package/lib/module/modules/menu/Menu.variants.js +5 -5
- package/lib/module/modules/menu/MenuProps.js +4 -0
- package/lib/module/modules/message-bubble/MODULE.md +7 -3
- 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/message-bubble/MessageBubbleProps.js +4 -0
- package/lib/module/modules/modal/MODULE.md +63 -89
- package/lib/module/modules/modal/Modal.js +168 -47
- package/lib/module/modules/modal/Modal.variants.js +2 -2
- package/lib/module/modules/modal/ModalPortalContext.js +1 -22
- package/lib/module/modules/modal/ModalPortalProvider.js +1 -1
- package/lib/module/modules/modal/ModalPortalProviderProps.js +4 -0
- package/lib/module/modules/modal/ModalProps.js +4 -0
- package/lib/module/modules/modal/renderWebPortal.js +1 -15
- package/lib/module/modules/modal/renderWebPortal.web.js +1 -21
- package/lib/module/modules/more-items/MODULE.md +3 -0
- package/lib/module/modules/more-items/MoreItems.js +16 -7
- package/lib/module/modules/more-items/MoreItems.variants.js +6 -2
- package/lib/module/modules/more-items/MoreItemsProps.js +4 -0
- package/lib/module/modules/multi-select/MODULE.md +5 -6
- package/lib/module/modules/multi-select/MultiSelect.js +61 -24
- package/lib/module/modules/multi-select/MultiSelect.variants.js +8 -4
- package/lib/module/modules/multi-select/MultiSelectProps.js +4 -0
- package/lib/module/modules/notification-bell/MODULE.md +8 -0
- package/lib/module/modules/notification-bell/NotificationBell.js +43 -0
- package/lib/module/modules/notification-bell/NotificationBellProps.js +4 -0
- package/lib/module/modules/notification-bell/index.js +4 -0
- package/lib/module/modules/number-input/MODULE.md +10 -14
- package/lib/module/modules/number-input/NumberInput.js +100 -85
- package/lib/module/modules/number-input/NumberInput.variants.js +11 -10
- package/lib/module/modules/number-input/NumberInputProps.js +4 -0
- package/lib/module/modules/org-switcher/MODULE.md +13 -8
- package/lib/module/modules/org-switcher/OrgSwitcher.js +34 -21
- package/lib/module/modules/org-switcher/OrgSwitcher.variants.js +8 -4
- package/lib/module/modules/org-switcher/OrgSwitcherProps.js +4 -0
- package/lib/module/modules/pagination/MODULE.md +4 -7
- package/lib/module/modules/pagination/Pagination.js +97 -48
- package/lib/module/modules/pagination/Pagination.variants.js +6 -4
- package/lib/module/modules/pagination/PaginationControls.js +58 -36
- package/lib/module/modules/pagination/PaginationProps.js +4 -0
- package/lib/module/modules/person-chip/MODULE.md +11 -0
- package/lib/module/modules/person-chip/PersonChip.js +65 -0
- package/lib/module/modules/person-chip/PersonChipProps.js +4 -0
- package/lib/module/modules/person-chip/index.js +4 -0
- package/lib/module/modules/pin-input/MODULE.md +12 -19
- package/lib/module/modules/pin-input/PinInput.js +10 -3
- package/lib/module/modules/pin-input/PinInput.variants.js +4 -4
- package/lib/module/modules/pin-input/PinInputProps.js +4 -0
- package/lib/module/modules/plan-badge/MODULE.md +4 -0
- package/lib/module/modules/plan-badge/PlanBadge.js +25 -0
- package/lib/module/modules/plan-badge/PlanBadgeProps.js +4 -0
- package/lib/module/modules/plan-badge/index.js +4 -0
- package/lib/module/modules/plan-pill/MODULE.md +4 -0
- package/lib/module/modules/plan-pill/PlanPill.js +24 -0
- package/lib/module/modules/plan-pill/PlanPillProps.js +4 -0
- package/lib/module/modules/plan-pill/index.js +4 -0
- package/lib/module/modules/progress-bar/MODULE.md +12 -14
- package/lib/module/modules/progress-bar/ProgressBar.js +28 -36
- package/lib/module/modules/progress-bar/ProgressBarProps.js +4 -0
- package/lib/module/modules/radio-group/MODULE.md +7 -13
- package/lib/module/modules/radio-group/RadioGroup.js +125 -65
- package/lib/module/modules/radio-group/RadioGroup.variants.js +4 -4
- package/lib/module/modules/radio-group/RadioGroupProps.js +4 -0
- package/lib/module/modules/reorder/MODULE.md +7 -9
- package/lib/module/modules/reorder/Reorder.js +12 -6
- package/lib/module/modules/reorder/Reorder.variants.js +7 -6
- package/lib/module/modules/reorder/ReorderProps.js +4 -0
- package/lib/module/modules/rich-text/MODULE.md +5 -3
- package/lib/module/modules/rich-text/RichText.js +42 -22
- package/lib/module/modules/rich-text/RichTextProps.js +4 -0
- package/lib/module/modules/rich-text-editor/MODULE.md +8 -15
- package/lib/module/modules/rich-text-editor/RichTextEditor.js +13 -5
- package/lib/module/modules/rich-text-editor/RichTextEditor.variants.js +9 -6
- package/lib/module/modules/rich-text-editor/RichTextEditorProps.js +4 -0
- package/lib/module/modules/save-bar/MODULE.md +3 -0
- package/lib/module/modules/save-bar/SaveBar.js +49 -0
- package/lib/module/modules/save-bar/SaveBarProps.js +4 -0
- package/lib/module/modules/save-bar/index.js +4 -0
- package/lib/module/modules/screen/MODULE.md +14 -5
- package/lib/module/modules/screen/Screen.js +109 -33
- package/lib/module/modules/screen/Screen.variants.js +18 -0
- package/lib/module/modules/screen/ScreenProps.js +4 -0
- package/lib/module/modules/search-bar/MODULE.md +9 -8
- package/lib/module/modules/search-bar/SearchBar.js +49 -27
- package/lib/module/modules/search-bar/SearchBar.variants.js +13 -12
- package/lib/module/modules/search-bar/SearchBarProps.js +4 -0
- package/lib/module/modules/section/MODULE.md +3 -1
- package/lib/module/modules/section/Section.js +14 -16
- package/lib/module/modules/section/Section.variants.js +1 -6
- package/lib/module/modules/section/SectionProps.js +4 -0
- package/lib/module/modules/section-list/MODULE.md +21 -1
- package/lib/module/modules/section-list/SectionListProps.js +4 -0
- package/lib/module/modules/segmented-control/MODULE.md +30 -26
- package/lib/module/modules/segmented-control/SegmentedControl.js +124 -70
- package/lib/module/modules/segmented-control/SegmentedControl.variants.js +11 -43
- package/lib/module/modules/segmented-control/SegmentedControlProps.js +4 -0
- package/lib/module/modules/select/MODULE.md +34 -10
- package/lib/module/modules/select/Select.js +74 -34
- package/lib/module/modules/select/Select.variants.js +39 -16
- package/lib/module/modules/select/SelectProps.js +4 -0
- package/lib/module/modules/setting-row/MODULE.md +8 -0
- package/lib/module/modules/setting-row/SettingRow.js +50 -0
- package/lib/module/modules/setting-row/SettingRowProps.js +4 -0
- package/lib/module/modules/setting-row/index.js +4 -0
- package/lib/module/modules/settings-section/MODULE.md +7 -0
- package/lib/module/modules/settings-section/SettingsSection.js +37 -0
- package/lib/module/modules/settings-section/SettingsSectionProps.js +4 -0
- package/lib/module/modules/settings-section/index.js +4 -0
- package/lib/module/modules/skeleton/MODULE.md +25 -28
- package/lib/module/modules/skeleton/Skeleton.js +54 -53
- package/lib/module/modules/skeleton/Skeleton.variants.js +11 -74
- package/lib/module/modules/skeleton/SkeletonProps.js +4 -0
- package/lib/module/modules/slider/MODULE.md +4 -1
- package/lib/module/modules/slider/Slider.js +7 -6
- package/lib/module/modules/slider/Slider.variants.js +4 -2
- package/lib/module/modules/slider/SliderProps.js +4 -0
- package/lib/module/modules/spinner/MODULE.md +3 -2
- package/lib/module/modules/spinner/SpinnerProps.js +4 -0
- package/lib/module/modules/stage-progress/MODULE.md +32 -14
- package/lib/module/modules/stage-progress/StageProgress.js +136 -59
- package/lib/module/modules/stage-progress/StageProgress.variants.js +57 -20
- package/lib/module/modules/stage-progress/StageProgressProps.js +4 -0
- package/lib/module/modules/stat-grid/MODULE.md +11 -0
- package/lib/module/modules/stat-grid/StatGrid.js +34 -0
- package/lib/module/modules/stat-grid/StatGridProps.js +4 -0
- package/lib/module/modules/stat-grid/index.js +4 -0
- package/lib/module/modules/stat-tile/MODULE.md +14 -1
- package/lib/module/modules/stat-tile/StatTile.js +51 -21
- package/lib/module/modules/stat-tile/StatTile.variants.js +7 -0
- package/lib/module/modules/stat-tile/StatTileProps.js +4 -0
- package/lib/module/modules/state-block/MODULE.md +12 -3
- package/lib/module/modules/state-block/StateBlock.js +54 -41
- package/lib/module/modules/state-block/StateBlock.variants.js +7 -0
- package/lib/module/modules/state-block/StateBlockProps.js +4 -0
- package/lib/module/modules/stepper/MODULE.md +2 -0
- package/lib/module/modules/stepper/Stepper.js +22 -21
- package/lib/module/modules/stepper/Stepper.variants.js +2 -0
- package/lib/module/modules/stepper/StepperProps.js +4 -0
- package/lib/module/modules/surface/MODULE.md +57 -0
- package/lib/module/modules/surface/Surface.js +47 -0
- package/lib/module/modules/surface/Surface.variants.js +33 -0
- package/lib/module/modules/surface/SurfaceProps.js +4 -0
- package/lib/module/modules/surface/index.js +4 -0
- package/lib/module/modules/swipeable-row/MODULE.md +12 -2
- package/lib/module/modules/swipeable-row/SwipeableRow.js +57 -13
- package/lib/module/modules/swipeable-row/SwipeableRowProps.js +4 -0
- package/lib/module/modules/switch/MODULE.md +7 -2
- package/lib/module/modules/switch/Switch.js +49 -9
- package/lib/module/modules/switch/Switch.variants.js +2 -3
- package/lib/module/modules/switch/SwitchProps.js +4 -0
- package/lib/module/modules/tabs/MODULE.md +11 -14
- package/lib/module/modules/tabs/Tabs.js +115 -51
- package/lib/module/modules/tabs/Tabs.variants.js +6 -6
- package/lib/module/modules/tabs/TabsProps.js +4 -0
- package/lib/module/modules/text/MODULE.md +25 -14
- package/lib/module/modules/text/Text.js +18 -6
- package/lib/module/modules/text/Text.variants.js +116 -44
- package/lib/module/modules/text/TextProps.js +4 -0
- package/lib/module/modules/textarea/MODULE.md +12 -16
- package/lib/module/modules/textarea/Textarea.js +15 -12
- package/lib/module/modules/textarea/Textarea.variants.js +6 -2
- package/lib/module/modules/textarea/TextareaProps.js +4 -0
- package/lib/module/modules/timeline/MODULE.md +8 -17
- package/lib/module/modules/timeline/Timeline.js +79 -22
- package/lib/module/modules/timeline/Timeline.variants.js +2 -0
- package/lib/module/modules/timeline/TimelineProps.js +4 -0
- package/lib/module/modules/toast/MODULE.md +15 -18
- package/lib/module/modules/toast/Toast.js +75 -55
- package/lib/module/modules/toast/Toast.variants.js +7 -5
- package/lib/module/modules/tooltip/MODULE.md +22 -22
- package/lib/module/modules/tooltip/Tooltip.js +77 -16
- package/lib/module/modules/tooltip/Tooltip.variants.js +8 -1
- package/lib/module/modules/tooltip/TooltipProps.js +4 -0
- package/lib/module/modules/typing-indicator/MODULE.md +1 -1
- package/lib/module/modules/typing-indicator/TypingIndicator.js +78 -51
- package/lib/module/modules/typing-indicator/TypingIndicatorProps.js +4 -0
- package/lib/module/modules/upgrade-button/MODULE.md +3 -0
- package/lib/module/modules/upgrade-button/UpgradeButton.js +23 -0
- package/lib/module/modules/upgrade-button/UpgradeButtonProps.js +4 -0
- package/lib/module/modules/upgrade-button/index.js +4 -0
- package/lib/module/theme/MODULE.md +5 -1
- package/lib/module/theme/platform/MODULE.md +16 -8
- package/lib/module/theme/platform/elevation.native.js +1 -51
- 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 +18 -5
- package/lib/module/theme/tokens/MODULE.md +36 -28
- package/lib/module/theme/tokens/THEME-CONTRACT.md +187 -0
- package/lib/module/theme/tokens/assertPalette.js +29 -0
- package/lib/module/theme/tokens/brands/emerald/palette.light.js +12 -9
- package/lib/module/theme/tokens/brands/lavender/palette.light.js +7 -6
- package/lib/module/theme/tokens/brands/meadow/palette.light.js +9 -8
- package/lib/module/theme/tokens/brands/radiant/palette.light.js +10 -9
- package/lib/module/theme/tokens/brands/rosewood/palette.light.js +10 -9
- package/lib/module/theme/tokens/brands/skyline/palette.light.js +9 -8
- package/lib/module/theme/tokens/brands/slate/palette.light.js +11 -13
- 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/accentText.js +10 -1
- package/lib/module/theme/tokens/builders/buildBrandScale.js +42 -0
- 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/gradientInk.js +23 -0
- package/lib/module/theme/tokens/builders/liftToContrast.js +44 -0
- package/lib/module/theme/tokens/builders/paletteFromAccent.js +30 -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/skeletonShimmer.js +22 -0
- package/lib/module/theme/tokens/builders/surfaceRungs.js +44 -0
- package/lib/module/theme/tokens/index.js +8 -0
- package/lib/module/theme/tokens/primitives/controlSizes.js +16 -0
- package/lib/module/theme/tokens/primitives/index.js +1 -0
- package/lib/module/theme/tokens/roles/index.js +7 -0
- package/lib/typescript/core/a11y/touchTarget.d.ts +4 -0
- package/lib/typescript/core/blur/blur.d.ts +14 -0
- package/lib/typescript/core/blur/index.d.ts +3 -0
- package/lib/typescript/core/gradient/AccentGradientFill.d.ts +7 -0
- package/lib/typescript/core/gradient/ShimmerGradientFill.d.ts +8 -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 +6 -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/list/VirtualList.d.ts +6 -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/animatedComponents.d.ts +4 -0
- package/lib/typescript/core/motion/config.d.ts +2 -1
- package/lib/typescript/core/motion/index.d.ts +5 -1
- package/lib/typescript/core/motion/motionAnimation.d.ts +12 -0
- package/lib/typescript/core/motion/presets.d.ts +5 -36
- package/lib/typescript/core/motion/reanimatedEasing.d.ts +4 -0
- package/lib/typescript/core/motion/useAnimatedValue.d.ts +2 -10
- package/lib/typescript/core/motion/useMotion.d.ts +4 -13
- package/lib/typescript/core/motion/usePressState.d.ts +20 -0
- package/lib/typescript/core/overlay/ModalPortalContext.d.ts +2 -0
- package/lib/typescript/core/overlay/index.d.ts +3 -0
- package/lib/typescript/core/overlay/renderWebPortal.d.ts +3 -0
- package/lib/typescript/core/overlay/renderWebPortal.web.d.ts +3 -0
- package/lib/typescript/core/screen-scroll/ScreenScrollContext.d.ts +8 -0
- package/lib/typescript/core/screen-scroll/index.d.ts +3 -0
- package/lib/typescript/core/slot/index.d.ts +2 -0
- package/lib/typescript/core/slot/nodeSlot.d.ts +5 -0
- package/lib/typescript/core/style/focusRing.d.ts +10 -0
- package/lib/typescript/core/style/index.d.ts +2 -1
- package/lib/typescript/core/style/radius.d.ts +2 -0
- package/lib/typescript/index.d.ts +52 -12
- package/lib/typescript/modules/accordion/Accordion.d.ts +2 -37
- package/lib/typescript/modules/accordion/Accordion.variants.d.ts +4 -5
- package/lib/typescript/modules/accordion/AccordionProps.d.ts +49 -0
- package/lib/typescript/modules/accordion/index.d.ts +1 -1
- package/lib/typescript/modules/alert-dialog/AlertDialog.d.ts +2 -15
- package/lib/typescript/modules/alert-dialog/AlertDialog.variants.d.ts +1 -0
- package/lib/typescript/modules/alert-dialog/AlertDialogProps.d.ts +20 -0
- package/lib/typescript/modules/alert-dialog/index.d.ts +1 -1
- package/lib/typescript/modules/app-bar/AppBar.d.ts +1 -20
- package/lib/typescript/modules/app-bar/AppBar.variants.d.ts +4 -0
- package/lib/typescript/modules/app-bar/AppBarProps.d.ts +25 -0
- package/lib/typescript/modules/app-bar/index.d.ts +1 -1
- package/lib/typescript/modules/app-switcher/AppSwitcher.d.ts +3 -0
- package/lib/typescript/modules/app-switcher/AppSwitcherProps.d.ts +17 -0
- package/lib/typescript/modules/app-switcher/index.d.ts +3 -0
- package/lib/typescript/modules/appearance-settings/AppearanceSettings.d.ts +3 -0
- package/lib/typescript/modules/appearance-settings/AppearanceSettingsProps.d.ts +15 -0
- package/lib/typescript/modules/appearance-settings/index.d.ts +3 -0
- package/lib/typescript/modules/avatar/Avatar.d.ts +2 -33
- package/lib/typescript/modules/avatar/Avatar.variants.d.ts +3 -1
- package/lib/typescript/modules/avatar/AvatarProps.d.ts +23 -0
- package/lib/typescript/modules/avatar/index.d.ts +1 -1
- package/lib/typescript/modules/avatar-group/AvatarGroup.d.ts +5 -20
- package/lib/typescript/modules/avatar-group/AvatarGroup.variants.d.ts +19 -0
- package/lib/typescript/modules/avatar-group/AvatarGroupProps.d.ts +27 -0
- package/lib/typescript/modules/avatar-group/index.d.ts +1 -1
- package/lib/typescript/modules/backdrop/Backdrop.d.ts +3 -0
- package/lib/typescript/modules/backdrop/BackdropProps.d.ts +11 -0
- package/lib/typescript/modules/backdrop/index.d.ts +3 -0
- package/lib/typescript/modules/badge/Badge.d.ts +2 -14
- package/lib/typescript/modules/badge/BadgeProps.d.ts +17 -0
- package/lib/typescript/modules/badge/index.d.ts +1 -1
- package/lib/typescript/modules/banner/Banner.d.ts +1 -20
- package/lib/typescript/modules/banner/Banner.variants.d.ts +2 -0
- package/lib/typescript/modules/banner/BannerProps.d.ts +29 -0
- package/lib/typescript/modules/banner/index.d.ts +2 -1
- package/lib/typescript/modules/bottom-nav/BottomNav.d.ts +1 -34
- package/lib/typescript/modules/bottom-nav/BottomNav.variants.d.ts +3 -4
- package/lib/typescript/modules/bottom-nav/BottomNavProps.d.ts +29 -0
- package/lib/typescript/modules/bottom-nav/index.d.ts +2 -1
- package/lib/typescript/modules/bottom-sheet/BottomSheet.d.ts +1 -13
- package/lib/typescript/modules/bottom-sheet/BottomSheet.variants.d.ts +3 -1
- package/lib/typescript/modules/bottom-sheet/BottomSheetProps.d.ts +17 -0
- package/lib/typescript/modules/bottom-sheet/index.d.ts +1 -1
- package/lib/typescript/modules/breadcrumbs/Breadcrumbs.d.ts +3 -0
- package/lib/typescript/modules/breadcrumbs/Breadcrumbs.variants.d.ts +6 -0
- package/lib/typescript/modules/breadcrumbs/BreadcrumbsProps.d.ts +18 -0
- package/lib/typescript/modules/breadcrumbs/index.d.ts +3 -0
- package/lib/typescript/modules/button/Button.d.ts +1 -60
- package/lib/typescript/modules/button/Button.variants.d.ts +11 -15
- package/lib/typescript/modules/button/ButtonProps.d.ts +47 -0
- package/lib/typescript/modules/button/index.d.ts +1 -1
- package/lib/typescript/modules/button-group/ButtonGroup.d.ts +2 -36
- package/lib/typescript/modules/button-group/ButtonGroup.variants.d.ts +24 -59
- package/lib/typescript/modules/button-group/ButtonGroupProps.d.ts +21 -0
- package/lib/typescript/modules/button-group/index.d.ts +1 -1
- package/lib/typescript/modules/card/Card.d.ts +4 -15
- package/lib/typescript/modules/card/CardProps.d.ts +27 -0
- package/lib/typescript/modules/card/index.d.ts +1 -1
- package/lib/typescript/modules/charts/BarChart.d.ts +1 -24
- package/lib/typescript/modules/charts/BarChartProps.d.ts +36 -0
- package/lib/typescript/modules/charts/BarList.d.ts +1 -16
- package/lib/typescript/modules/charts/BarListProps.d.ts +22 -0
- package/lib/typescript/modules/charts/ChartLegend.d.ts +2 -14
- package/lib/typescript/modules/charts/ChartLegendProps.d.ts +19 -0
- package/lib/typescript/modules/charts/Charts.variants.d.ts +31 -1
- package/lib/typescript/modules/charts/DonutChart.d.ts +1 -19
- package/lib/typescript/modules/charts/DonutChartProps.d.ts +27 -0
- package/lib/typescript/modules/charts/LineChart.d.ts +1 -28
- package/lib/typescript/modules/charts/LineChartProps.d.ts +40 -0
- package/lib/typescript/modules/charts/PieChart.d.ts +1 -16
- package/lib/typescript/modules/charts/PieChartProps.d.ts +24 -0
- package/lib/typescript/modules/charts/Sparkline.d.ts +1 -11
- package/lib/typescript/modules/charts/SparklineProps.d.ts +17 -0
- package/lib/typescript/modules/charts/index.d.ts +6 -6
- package/lib/typescript/modules/checkbox/Checkbox.d.ts +1 -33
- package/lib/typescript/modules/checkbox/Checkbox.variants.d.ts +2 -1
- package/lib/typescript/modules/checkbox/CheckboxProps.d.ts +27 -0
- package/lib/typescript/modules/checkbox/index.d.ts +1 -1
- package/lib/typescript/modules/chip/Chip.d.ts +1 -28
- package/lib/typescript/modules/chip/Chip.variants.d.ts +8 -3
- package/lib/typescript/modules/chip/ChipGroup.d.ts +1 -14
- package/lib/typescript/modules/chip/ChipGroupProps.d.ts +16 -0
- package/lib/typescript/modules/chip/ChipProps.d.ts +27 -0
- package/lib/typescript/modules/chip/index.d.ts +3 -3
- package/lib/typescript/modules/combobox/Combobox.d.ts +2 -45
- package/lib/typescript/modules/combobox/Combobox.variants.d.ts +20 -5
- package/lib/typescript/modules/combobox/ComboboxProps.d.ts +40 -0
- package/lib/typescript/modules/combobox/index.d.ts +1 -1
- package/lib/typescript/modules/composer/Composer.d.ts +1 -18
- package/lib/typescript/modules/composer/ComposerProps.d.ts +20 -0
- package/lib/typescript/modules/composer/index.d.ts +1 -1
- package/lib/typescript/modules/copy-button/CopyButton.d.ts +1 -15
- package/lib/typescript/modules/copy-button/CopyButton.variants.d.ts +2 -1
- package/lib/typescript/modules/copy-button/CopyButtonProps.d.ts +18 -0
- package/lib/typescript/modules/copy-button/index.d.ts +1 -1
- package/lib/typescript/modules/data-table/DataTable.d.ts +2 -31
- package/lib/typescript/modules/data-table/DataTable.variants.d.ts +3 -2
- package/lib/typescript/modules/data-table/DataTableProps.d.ts +43 -0
- package/lib/typescript/modules/data-table/index.d.ts +1 -1
- package/lib/typescript/modules/date-picker/Calendar.d.ts +1 -23
- package/lib/typescript/modules/date-picker/CalendarProps.d.ts +31 -0
- package/lib/typescript/modules/date-picker/DatePicker.d.ts +1 -27
- package/lib/typescript/modules/date-picker/DatePicker.variants.d.ts +17 -4
- package/lib/typescript/modules/date-picker/DatePickerProps.d.ts +33 -0
- package/lib/typescript/modules/date-picker/DateRangePicker.d.ts +1 -23
- package/lib/typescript/modules/date-picker/DateRangePickerProps.d.ts +27 -0
- package/lib/typescript/modules/date-picker/PickerField.d.ts +1 -17
- package/lib/typescript/modules/date-picker/PickerFieldProps.d.ts +19 -0
- package/lib/typescript/modules/date-picker/PickerShell.d.ts +1 -12
- package/lib/typescript/modules/date-picker/PickerShellProps.d.ts +16 -0
- package/lib/typescript/modules/date-picker/TimePicker.d.ts +2 -16
- package/lib/typescript/modules/date-picker/TimePickerProps.d.ts +14 -0
- package/lib/typescript/modules/date-picker/index.d.ts +4 -4
- package/lib/typescript/modules/description-list/DescriptionList.d.ts +8 -0
- package/lib/typescript/modules/description-list/DescriptionList.variants.d.ts +29 -0
- package/lib/typescript/modules/description-list/DescriptionListProps.d.ts +23 -0
- package/lib/typescript/modules/description-list/index.d.ts +4 -0
- package/lib/typescript/modules/divider/Divider.d.ts +1 -8
- package/lib/typescript/modules/divider/Divider.variants.d.ts +4 -4
- package/lib/typescript/modules/divider/DividerProps.d.ts +11 -0
- package/lib/typescript/modules/divider/index.d.ts +1 -1
- package/lib/typescript/modules/document-viewer/DocumentViewer.d.ts +3 -0
- package/lib/typescript/modules/document-viewer/DocumentViewerProps.d.ts +13 -0
- package/lib/typescript/modules/document-viewer/index.d.ts +3 -0
- package/lib/typescript/modules/drawer/Drawer.d.ts +2 -7
- package/lib/typescript/modules/drawer/DrawerProps.d.ts +9 -0
- package/lib/typescript/modules/drawer/index.d.ts +1 -1
- package/lib/typescript/modules/empty-state/EmptyState.d.ts +1 -15
- package/lib/typescript/modules/empty-state/EmptyState.variants.d.ts +1 -0
- package/lib/typescript/modules/empty-state/EmptyStateProps.d.ts +24 -0
- package/lib/typescript/modules/empty-state/index.d.ts +1 -1
- package/lib/typescript/modules/fab/Fab.d.ts +1 -51
- package/lib/typescript/modules/fab/Fab.variants.d.ts +5 -2
- package/lib/typescript/modules/fab/FabGroup.d.ts +1 -34
- package/lib/typescript/modules/fab/FabGroupProps.d.ts +34 -0
- package/lib/typescript/modules/fab/FabProps.d.ts +50 -0
- package/lib/typescript/modules/fab/index.d.ts +2 -2
- package/lib/typescript/modules/field-select-modal/FieldSelectModal.d.ts +3 -0
- package/lib/typescript/modules/field-select-modal/FieldSelectModalProps.d.ts +20 -0
- package/lib/typescript/modules/field-select-modal/index.d.ts +3 -0
- package/lib/typescript/modules/file-grid/FileGrid.d.ts +1 -18
- package/lib/typescript/modules/file-grid/FileGridProps.d.ts +23 -0
- package/lib/typescript/modules/file-grid/index.d.ts +1 -1
- package/lib/typescript/modules/file-upload/FileUpload.d.ts +1 -27
- package/lib/typescript/modules/file-upload/FileUploadProps.d.ts +27 -0
- package/lib/typescript/modules/file-upload/index.d.ts +1 -1
- package/lib/typescript/modules/filter-bar/FilterBar.d.ts +3 -0
- package/lib/typescript/modules/filter-bar/FilterBarProps.d.ts +17 -0
- package/lib/typescript/modules/filter-bar/index.d.ts +3 -0
- package/lib/typescript/modules/filter-sheet/FilterChip.d.ts +1 -9
- package/lib/typescript/modules/filter-sheet/FilterChipProps.d.ts +11 -0
- package/lib/typescript/modules/filter-sheet/FilterSheet.d.ts +1 -32
- package/lib/typescript/modules/filter-sheet/FilterSheet.variants.d.ts +2 -1
- package/lib/typescript/modules/filter-sheet/FilterSheetBody.d.ts +1 -1
- package/lib/typescript/modules/filter-sheet/FilterSheetProps.d.ts +36 -0
- package/lib/typescript/modules/filter-sheet/filterSheet.helpers.d.ts +1 -1
- package/lib/typescript/modules/filter-sheet/index.d.ts +2 -2
- package/lib/typescript/modules/folder-row/FolderRow.d.ts +1 -19
- package/lib/typescript/modules/folder-row/FolderRowProps.d.ts +17 -0
- package/lib/typescript/modules/folder-row/index.d.ts +1 -1
- package/lib/typescript/modules/form-field/FormField.d.ts +2 -17
- package/lib/typescript/modules/form-field/FormFieldProps.d.ts +23 -0
- package/lib/typescript/modules/form-field/index.d.ts +1 -1
- package/lib/typescript/modules/gantt/Gantt.d.ts +2 -9
- package/lib/typescript/modules/gantt/Gantt.variants.d.ts +29 -2
- package/lib/typescript/modules/gantt/GanttProps.d.ts +13 -0
- package/lib/typescript/modules/gantt/index.d.ts +1 -1
- package/lib/typescript/modules/image-viewer/ImageViewer.d.ts +2 -15
- package/lib/typescript/modules/image-viewer/ImageViewerProps.d.ts +16 -0
- package/lib/typescript/modules/image-viewer/index.d.ts +2 -1
- package/lib/typescript/modules/input/Input.d.ts +2 -30
- package/lib/typescript/modules/input/Input.variants.d.ts +8 -8
- package/lib/typescript/modules/input/InputProps.d.ts +43 -0
- package/lib/typescript/modules/input/index.d.ts +1 -1
- package/lib/typescript/modules/key-value/KeyValue.d.ts +3 -0
- package/lib/typescript/modules/key-value/KeyValueProps.d.ts +11 -0
- package/lib/typescript/modules/key-value/index.d.ts +3 -0
- package/lib/typescript/modules/limit-reached-modal/LimitReachedModal.d.ts +1 -17
- package/lib/typescript/modules/limit-reached-modal/LimitReachedModalProps.d.ts +24 -0
- package/lib/typescript/modules/limit-reached-modal/index.d.ts +1 -1
- package/lib/typescript/modules/list-item/ListItem.d.ts +3 -17
- package/lib/typescript/modules/list-item/ListItem.variants.d.ts +137 -1
- package/lib/typescript/modules/list-item/ListItemProps.d.ts +22 -0
- package/lib/typescript/modules/list-item/index.d.ts +1 -1
- package/lib/typescript/modules/list-screen/ListScreen.d.ts +5 -0
- package/lib/typescript/modules/list-screen/ListScreenProps.d.ts +17 -0
- package/lib/typescript/modules/list-screen/index.d.ts +3 -0
- package/lib/typescript/modules/markdown/Markdown.d.ts +8 -8
- package/lib/typescript/modules/markdown/MarkdownProps.d.ts +12 -0
- package/lib/typescript/modules/markdown/index.d.ts +1 -1
- package/lib/typescript/modules/menu/Menu.d.ts +2 -19
- package/lib/typescript/modules/menu/Menu.variants.d.ts +2 -1
- package/lib/typescript/modules/menu/MenuProps.d.ts +26 -0
- package/lib/typescript/modules/menu/index.d.ts +1 -1
- package/lib/typescript/modules/message-bubble/MessageBubble.d.ts +3 -11
- package/lib/typescript/modules/message-bubble/MessageBubble.variants.d.ts +1 -2
- package/lib/typescript/modules/message-bubble/MessageBubbleProps.d.ts +12 -0
- package/lib/typescript/modules/message-bubble/index.d.ts +1 -1
- package/lib/typescript/modules/modal/Modal.d.ts +2 -10
- package/lib/typescript/modules/modal/ModalPortalContext.d.ts +1 -1
- package/lib/typescript/modules/modal/ModalPortalProvider.d.ts +2 -12
- package/lib/typescript/modules/modal/ModalPortalProviderProps.d.ts +8 -0
- package/lib/typescript/modules/modal/ModalProps.d.ts +22 -0
- package/lib/typescript/modules/modal/index.d.ts +2 -2
- package/lib/typescript/modules/modal/renderWebPortal.d.ts +1 -14
- package/lib/typescript/modules/modal/renderWebPortal.web.d.ts +1 -18
- package/lib/typescript/modules/more-items/MoreItems.d.ts +2 -10
- package/lib/typescript/modules/more-items/MoreItems.variants.d.ts +3 -1
- package/lib/typescript/modules/more-items/MoreItemsProps.d.ts +14 -0
- package/lib/typescript/modules/more-items/index.d.ts +1 -1
- package/lib/typescript/modules/multi-select/MultiSelect.d.ts +1 -19
- package/lib/typescript/modules/multi-select/MultiSelect.variants.d.ts +2 -1
- package/lib/typescript/modules/multi-select/MultiSelectProps.d.ts +29 -0
- package/lib/typescript/modules/multi-select/index.d.ts +1 -1
- package/lib/typescript/modules/notification-bell/NotificationBell.d.ts +3 -0
- package/lib/typescript/modules/notification-bell/NotificationBellProps.d.ts +10 -0
- package/lib/typescript/modules/notification-bell/index.d.ts +3 -0
- package/lib/typescript/modules/number-input/NumberInput.d.ts +1 -26
- package/lib/typescript/modules/number-input/NumberInput.variants.d.ts +9 -8
- package/lib/typescript/modules/number-input/NumberInputProps.d.ts +23 -0
- package/lib/typescript/modules/number-input/index.d.ts +1 -1
- package/lib/typescript/modules/org-switcher/OrgSwitcher.d.ts +1 -24
- package/lib/typescript/modules/org-switcher/OrgSwitcher.variants.d.ts +2 -1
- package/lib/typescript/modules/org-switcher/OrgSwitcherProps.d.ts +29 -0
- package/lib/typescript/modules/org-switcher/index.d.ts +1 -1
- package/lib/typescript/modules/pagination/Pagination.d.ts +1 -26
- package/lib/typescript/modules/pagination/Pagination.variants.d.ts +2 -1
- package/lib/typescript/modules/pagination/PaginationControls.d.ts +1 -4
- package/lib/typescript/modules/pagination/PaginationProps.d.ts +28 -0
- package/lib/typescript/modules/pagination/index.d.ts +1 -1
- package/lib/typescript/modules/person-chip/PersonChip.d.ts +3 -0
- package/lib/typescript/modules/person-chip/PersonChipProps.d.ts +17 -0
- package/lib/typescript/modules/person-chip/index.d.ts +3 -0
- package/lib/typescript/modules/pin-input/PinInput.d.ts +1 -32
- package/lib/typescript/modules/pin-input/PinInput.variants.d.ts +2 -2
- package/lib/typescript/modules/pin-input/PinInputProps.d.ts +26 -0
- package/lib/typescript/modules/pin-input/index.d.ts +1 -1
- package/lib/typescript/modules/plan-badge/PlanBadge.d.ts +3 -0
- package/lib/typescript/modules/plan-badge/PlanBadgeProps.d.ts +10 -0
- package/lib/typescript/modules/plan-badge/index.d.ts +3 -0
- package/lib/typescript/modules/plan-pill/PlanPill.d.ts +3 -0
- package/lib/typescript/modules/plan-pill/PlanPillProps.d.ts +10 -0
- package/lib/typescript/modules/plan-pill/index.d.ts +3 -0
- package/lib/typescript/modules/progress-bar/ProgressBar.d.ts +1 -13
- package/lib/typescript/modules/progress-bar/ProgressBarProps.d.ts +16 -0
- package/lib/typescript/modules/progress-bar/index.d.ts +1 -1
- package/lib/typescript/modules/radio-group/RadioGroup.d.ts +2 -22
- package/lib/typescript/modules/radio-group/RadioGroup.variants.d.ts +2 -2
- package/lib/typescript/modules/radio-group/RadioGroupProps.d.ts +21 -0
- package/lib/typescript/modules/radio-group/index.d.ts +1 -1
- package/lib/typescript/modules/reorder/Reorder.d.ts +2 -14
- package/lib/typescript/modules/reorder/Reorder.variants.d.ts +2 -2
- package/lib/typescript/modules/reorder/ReorderProps.d.ts +19 -0
- package/lib/typescript/modules/reorder/index.d.ts +1 -1
- package/lib/typescript/modules/rich-text/RichText.d.ts +2 -10
- package/lib/typescript/modules/rich-text/RichTextProps.d.ts +15 -0
- package/lib/typescript/modules/rich-text/index.d.ts +1 -1
- package/lib/typescript/modules/rich-text-editor/RichTextEditor.d.ts +1 -45
- package/lib/typescript/modules/rich-text-editor/RichTextEditorProps.d.ts +40 -0
- package/lib/typescript/modules/rich-text-editor/index.d.ts +1 -1
- package/lib/typescript/modules/save-bar/SaveBar.d.ts +3 -0
- package/lib/typescript/modules/save-bar/SaveBarProps.d.ts +18 -0
- package/lib/typescript/modules/save-bar/index.d.ts +3 -0
- package/lib/typescript/modules/screen/Screen.d.ts +2 -31
- package/lib/typescript/modules/screen/Screen.variants.d.ts +4 -0
- package/lib/typescript/modules/screen/ScreenProps.d.ts +35 -0
- package/lib/typescript/modules/screen/index.d.ts +1 -1
- package/lib/typescript/modules/search-bar/SearchBar.d.ts +2 -28
- package/lib/typescript/modules/search-bar/SearchBar.variants.d.ts +8 -9
- package/lib/typescript/modules/search-bar/SearchBarProps.d.ts +30 -0
- package/lib/typescript/modules/search-bar/index.d.ts +1 -1
- package/lib/typescript/modules/section/Section.d.ts +1 -8
- package/lib/typescript/modules/section/Section.variants.d.ts +0 -3
- package/lib/typescript/modules/section/SectionProps.d.ts +11 -0
- package/lib/typescript/modules/section/index.d.ts +1 -1
- package/lib/typescript/modules/section-list/SectionList.d.ts +1 -19
- package/lib/typescript/modules/section-list/SectionListProps.d.ts +24 -0
- package/lib/typescript/modules/section-list/index.d.ts +1 -1
- package/lib/typescript/modules/segmented-control/SegmentedControl.d.ts +2 -41
- package/lib/typescript/modules/segmented-control/SegmentedControl.variants.d.ts +5 -44
- package/lib/typescript/modules/segmented-control/SegmentedControlProps.d.ts +29 -0
- package/lib/typescript/modules/segmented-control/index.d.ts +1 -1
- package/lib/typescript/modules/select/Select.d.ts +5 -13
- package/lib/typescript/modules/select/Select.variants.d.ts +24 -10
- package/lib/typescript/modules/select/SelectProps.d.ts +25 -0
- package/lib/typescript/modules/select/index.d.ts +3 -2
- package/lib/typescript/modules/setting-row/SettingRow.d.ts +3 -0
- package/lib/typescript/modules/setting-row/SettingRowProps.d.ts +14 -0
- package/lib/typescript/modules/setting-row/index.d.ts +3 -0
- package/lib/typescript/modules/settings-section/SettingsSection.d.ts +3 -0
- package/lib/typescript/modules/settings-section/SettingsSectionProps.d.ts +11 -0
- package/lib/typescript/modules/settings-section/index.d.ts +3 -0
- package/lib/typescript/modules/skeleton/Skeleton.d.ts +3 -28
- package/lib/typescript/modules/skeleton/Skeleton.variants.d.ts +8 -66
- package/lib/typescript/modules/skeleton/SkeletonProps.d.ts +18 -0
- package/lib/typescript/modules/skeleton/index.d.ts +1 -1
- package/lib/typescript/modules/slider/Slider.d.ts +1 -24
- package/lib/typescript/modules/slider/Slider.variants.d.ts +2 -1
- package/lib/typescript/modules/slider/SliderProps.d.ts +27 -0
- package/lib/typescript/modules/slider/index.d.ts +1 -1
- package/lib/typescript/modules/spinner/Spinner.d.ts +1 -11
- package/lib/typescript/modules/spinner/SpinnerProps.d.ts +15 -0
- package/lib/typescript/modules/spinner/index.d.ts +1 -1
- package/lib/typescript/modules/stage-progress/StageProgress.d.ts +1 -12
- package/lib/typescript/modules/stage-progress/StageProgress.variants.d.ts +31 -10
- package/lib/typescript/modules/stage-progress/StageProgressProps.d.ts +22 -0
- package/lib/typescript/modules/stage-progress/index.d.ts +1 -1
- package/lib/typescript/modules/stat-grid/StatGrid.d.ts +3 -0
- package/lib/typescript/modules/stat-grid/StatGridProps.d.ts +15 -0
- package/lib/typescript/modules/stat-grid/index.d.ts +3 -0
- package/lib/typescript/modules/stat-tile/StatTile.d.ts +1 -14
- package/lib/typescript/modules/stat-tile/StatTile.variants.d.ts +3 -0
- package/lib/typescript/modules/stat-tile/StatTileProps.d.ts +25 -0
- package/lib/typescript/modules/stat-tile/index.d.ts +1 -1
- package/lib/typescript/modules/state-block/StateBlock.d.ts +1 -28
- package/lib/typescript/modules/state-block/StateBlock.variants.d.ts +1 -0
- package/lib/typescript/modules/state-block/StateBlockProps.d.ts +36 -0
- package/lib/typescript/modules/state-block/index.d.ts +1 -1
- package/lib/typescript/modules/stepper/Stepper.d.ts +3 -11
- package/lib/typescript/modules/stepper/Stepper.variants.d.ts +2 -0
- package/lib/typescript/modules/stepper/StepperProps.d.ts +12 -0
- package/lib/typescript/modules/stepper/index.d.ts +2 -1
- package/lib/typescript/modules/surface/Surface.d.ts +6 -0
- package/lib/typescript/modules/surface/Surface.variants.d.ts +15 -0
- package/lib/typescript/modules/surface/SurfaceProps.d.ts +17 -0
- package/lib/typescript/modules/surface/index.d.ts +4 -0
- package/lib/typescript/modules/swipeable-row/SwipeableRow.d.ts +1 -19
- package/lib/typescript/modules/swipeable-row/SwipeableRowProps.d.ts +22 -0
- package/lib/typescript/modules/swipeable-row/index.d.ts +1 -1
- package/lib/typescript/modules/switch/Switch.d.ts +1 -14
- package/lib/typescript/modules/switch/Switch.variants.d.ts +2 -2
- package/lib/typescript/modules/switch/SwitchProps.d.ts +20 -0
- package/lib/typescript/modules/switch/index.d.ts +1 -1
- package/lib/typescript/modules/tabs/Tabs.d.ts +1 -17
- package/lib/typescript/modules/tabs/Tabs.variants.d.ts +2 -3
- package/lib/typescript/modules/tabs/TabsProps.d.ts +29 -0
- package/lib/typescript/modules/tabs/index.d.ts +1 -1
- package/lib/typescript/modules/text/Text.d.ts +1 -20
- package/lib/typescript/modules/text/Text.variants.d.ts +14 -11
- package/lib/typescript/modules/text/TextProps.d.ts +35 -0
- package/lib/typescript/modules/text/index.d.ts +1 -1
- package/lib/typescript/modules/textarea/Textarea.d.ts +1 -19
- package/lib/typescript/modules/textarea/Textarea.variants.d.ts +2 -1
- package/lib/typescript/modules/textarea/TextareaProps.d.ts +23 -0
- package/lib/typescript/modules/textarea/index.d.ts +1 -1
- package/lib/typescript/modules/timeline/Timeline.d.ts +1 -16
- package/lib/typescript/modules/timeline/Timeline.variants.d.ts +2 -0
- package/lib/typescript/modules/timeline/TimelineProps.d.ts +37 -0
- package/lib/typescript/modules/timeline/index.d.ts +1 -1
- package/lib/typescript/modules/toast/Toast.variants.d.ts +4 -3
- package/lib/typescript/modules/tooltip/Tooltip.d.ts +1 -25
- package/lib/typescript/modules/tooltip/Tooltip.variants.d.ts +7 -0
- package/lib/typescript/modules/tooltip/TooltipProps.d.ts +27 -0
- package/lib/typescript/modules/tooltip/index.d.ts +1 -1
- package/lib/typescript/modules/typing-indicator/TypingIndicator.d.ts +5 -14
- package/lib/typescript/modules/typing-indicator/TypingIndicatorProps.d.ts +11 -0
- package/lib/typescript/modules/typing-indicator/index.d.ts +1 -1
- package/lib/typescript/modules/upgrade-button/UpgradeButton.d.ts +3 -0
- package/lib/typescript/modules/upgrade-button/UpgradeButtonProps.d.ts +11 -0
- package/lib/typescript/modules/upgrade-button/index.d.ts +3 -0
- package/lib/typescript/test/motionJest.d.ts +12 -0
- package/lib/typescript/theme/index.d.ts +1 -1
- package/lib/typescript/theme/platform/elevation.native.d.ts +1 -31
- 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/accentText.d.ts +3 -0
- package/lib/typescript/theme/tokens/builders/buildBrandScale.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/finalizePalette.d.ts +4 -0
- package/lib/typescript/theme/tokens/builders/gradientInk.d.ts +9 -0
- package/lib/typescript/theme/tokens/builders/liftToContrast.d.ts +9 -0
- package/lib/typescript/theme/tokens/builders/paletteFromAccent.d.ts +3 -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/skeletonShimmer.d.ts +9 -0
- package/lib/typescript/theme/tokens/builders/surfaceRungs.d.ts +12 -0
- package/lib/typescript/theme/tokens/index.d.ts +8 -0
- package/lib/typescript/theme/tokens/primitives/controlSizes.d.ts +6 -0
- package/lib/typescript/theme/tokens/primitives/index.d.ts +2 -0
- package/lib/typescript/theme/tokens/roles/index.d.ts +3 -0
- package/lib/typescript/theme/tokens/types.d.ts +10 -9
- package/package.json +114 -5
- package/registry.json +114 -14
- package/lib/module/core/style/useThemedStyles.js +0 -8
- package/lib/module/test/mocks/flashList.js +0 -5
- package/lib/module/test/perfHelpers.js +0 -18
- package/lib/typescript/core/style/useThemedStyles.d.ts +0 -5
- package/lib/typescript/test/mocks/flashList.d.ts +0 -3
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
# swipeable-row/
|
|
1
|
+
# swipeable-row/ — a row with swipe-to-reveal actions
|
|
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`
|
|
@@ -115,6 +122,9 @@ Known gaps:
|
|
|
115
122
|
- `SwipeableRow.render.test.tsx` — the accessibility-action contract, the hidden trays, and the tap
|
|
116
123
|
affordance: hidden-from-AT wrapper + `pointerEvents="box-none"`, the single-action direct-press
|
|
117
124
|
path, the multi-action `Menu` path (real rendered items, real dispatch to the pressed action's own
|
|
118
|
-
`onPress`), and the button's own rendered touch-target size.
|
|
125
|
+
`onPress`), and the button's own rendered touch-target size. Uses the root Jest Reanimated mock so
|
|
126
|
+
the composed `Menu` sheet's `interpolate` path is covered without a duplicate mock.
|
|
119
127
|
- `SwipeableRow.motion.test.tsx` — both halves of the reduce-motion contract, with
|
|
120
128
|
`withSpring`/`withTiming` mocked (a shared value written as a plain number proves nothing tweened).
|
|
129
|
+
|
|
130
|
+
Uses `scheduleOnRN` from `react-native-worklets` where JS thread callbacks are required.
|
|
@@ -16,12 +16,18 @@
|
|
|
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
|
+
import { renderNodeSlot } from "../../core/slot/index.js";
|
|
20
21
|
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
|
21
22
|
import Animated, { cancelAnimation, useAnimatedStyle, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
|
|
23
|
+
import { scheduleOnRN } from "react-native-worklets";
|
|
24
|
+
import { useReducedMotion } from "../../core/a11y/index.js";
|
|
25
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
22
26
|
import { Icon } from "../../core/icon/index.js";
|
|
23
27
|
import { useMotion } from "../../core/motion/index.js";
|
|
28
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
24
29
|
import { useTheme } from "../../theme/hooks.js";
|
|
30
|
+
import { rippleColor, stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
25
31
|
import { Button } from "../button/index.js";
|
|
26
32
|
import { Menu } from "../menu/index.js";
|
|
27
33
|
import { resolveSwipeableActionTone, SWIPE_ACTION_WIDTH, swipeableActionButtonStructure, swipeableActionFocusRingStructure, swipeableActionsStructure, swipeableMoreAffordanceStructure, swipeableRowStructure } from "./SwipeableRow.variants.js";
|
|
@@ -29,6 +35,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
29
35
|
const ICON_STROKE = 2;
|
|
30
36
|
const ICON_SIZE = 18;
|
|
31
37
|
const NO_ACTIONS = [];
|
|
38
|
+
const AnimatedActionPressable = Animated.createAnimatedComponent(Pressable);
|
|
32
39
|
export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
33
40
|
children,
|
|
34
41
|
leftActions = NO_ACTIONS,
|
|
@@ -37,10 +44,21 @@ export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
|
37
44
|
testID
|
|
38
45
|
}) {
|
|
39
46
|
const theme = useTheme();
|
|
47
|
+
const childrenSlotStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.regular), {
|
|
48
|
+
color: theme.colors.fg.default,
|
|
49
|
+
fontSize: theme.fontSizes.md
|
|
50
|
+
}], [theme]);
|
|
40
51
|
const motion = useMotion();
|
|
52
|
+
const haptics = useHaptics();
|
|
53
|
+
const reducedMotion = useReducedMotion();
|
|
41
54
|
const translateX = useSharedValue(0);
|
|
55
|
+
/** `-1` = right tray open, `0` = closed, `1` = left tray open. */
|
|
56
|
+
const openState = useSharedValue(0);
|
|
42
57
|
const leftWidth = leftActions.length * SWIPE_ACTION_WIDTH;
|
|
43
58
|
const rightWidth = rightActions.length * SWIPE_ACTION_WIDTH;
|
|
59
|
+
const fireSnapHaptic = useCallback(() => {
|
|
60
|
+
if (!reducedMotion) haptics.selection();
|
|
61
|
+
}, [haptics, reducedMotion]);
|
|
44
62
|
const spring = motion.spring("snappy");
|
|
45
63
|
const settleMs = motion.duration("fast");
|
|
46
64
|
const animated = motion.enabled;
|
|
@@ -65,8 +83,13 @@ export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
|
65
83
|
|
|
66
84
|
const openLeft = translateX.value > leftWidth / 2;
|
|
67
85
|
const openRight = translateX.value < -rightWidth / 2;
|
|
86
|
+
const next = openLeft ? 1 : openRight ? -1 : 0;
|
|
68
87
|
settle(openLeft ? leftWidth : openRight ? -rightWidth : 0);
|
|
69
|
-
|
|
88
|
+
if (next !== openState.value) {
|
|
89
|
+
openState.value = next;
|
|
90
|
+
scheduleOnRN(fireSnapHaptic);
|
|
91
|
+
}
|
|
92
|
+
}), [leftWidth, rightWidth, settle, translateX, openState, fireSnapHaptic]);
|
|
70
93
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
71
94
|
transform: [{
|
|
72
95
|
translateX: translateX.value
|
|
@@ -169,7 +192,7 @@ export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
|
169
192
|
gesture: pan,
|
|
170
193
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
171
194
|
style: contentStyle,
|
|
172
|
-
children: children
|
|
195
|
+
children: renderNodeSlot(children, childrenSlotStyle)
|
|
173
196
|
})
|
|
174
197
|
}), hasActions &&
|
|
175
198
|
/*#__PURE__*/
|
|
@@ -180,10 +203,11 @@ export const SwipeableRow = /*#__PURE__*/memo(function SwipeableRow({
|
|
|
180
203
|
// actions rather than a needed one. See MODULE.md "Tap affordance" for the full reasoning.
|
|
181
204
|
_jsx(View, {
|
|
182
205
|
testID: testID === undefined ? undefined : `${testID}-more-affordance`,
|
|
183
|
-
pointerEvents: "box-none",
|
|
184
206
|
accessibilityElementsHidden: true,
|
|
185
207
|
importantForAccessibility: "no-hide-descendants",
|
|
186
|
-
style: moreAffordanceStyle,
|
|
208
|
+
style: [moreAffordanceStyle, {
|
|
209
|
+
pointerEvents: "box-none"
|
|
210
|
+
}],
|
|
187
211
|
children: orderedActions.length === 1 ? soleActionButton : /*#__PURE__*/_jsx(Menu, {
|
|
188
212
|
testID: testID === undefined ? undefined : `${testID}-more-menu`,
|
|
189
213
|
items: menuItems,
|
|
@@ -200,6 +224,7 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
200
224
|
}) {
|
|
201
225
|
const colors = useMemo(() => resolveSwipeableActionTone(theme.colors, action.tone ?? "accent"), [theme, action.tone]);
|
|
202
226
|
const [focused, setFocused] = useState(false);
|
|
227
|
+
const press = usePressState(false);
|
|
203
228
|
const handlePress = useCallback(() => onRun(action.id), [onRun, action.id]);
|
|
204
229
|
const handleFocus = useCallback(() => setFocused(true), []);
|
|
205
230
|
const handleBlur = useCallback(() => setFocused(false), []);
|
|
@@ -213,23 +238,37 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
213
238
|
const focusRingStyle = useMemo(() => [swipeableActionFocusRingStructure(theme), {
|
|
214
239
|
borderColor: theme.colors.border.focus
|
|
215
240
|
}], [theme]);
|
|
216
|
-
|
|
241
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
242
|
+
backgroundColor: stateLayerScrim(theme.mode)
|
|
243
|
+
}), [theme.mode]);
|
|
244
|
+
const androidRipple = useMemo(() => Platform.OS === "android" ? {
|
|
245
|
+
color: rippleColor(theme.mode),
|
|
246
|
+
borderless: false
|
|
247
|
+
} : undefined, [theme.mode]);
|
|
248
|
+
return /*#__PURE__*/_jsxs(AnimatedActionPressable, {
|
|
217
249
|
testID: testID,
|
|
218
250
|
accessibilityRole: "button",
|
|
219
251
|
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.
|
|
252
|
+
// RNW ignores the tray's a11y-hiding props, so this stays a reachable tab stop otherwise.
|
|
223
253
|
,
|
|
224
254
|
tabIndex: -1,
|
|
225
255
|
onPress: handlePress,
|
|
256
|
+
onPressIn: press.handlers.onPressIn,
|
|
257
|
+
onPressOut: press.handlers.onPressOut,
|
|
258
|
+
onLayout: press.onLayout,
|
|
226
259
|
onFocus: handleFocus,
|
|
227
260
|
onBlur: handleBlur,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
261
|
+
android_ripple: androidRipple,
|
|
262
|
+
style: [buttonStyle, styles.overflowHidden, press.animatedStyle],
|
|
263
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
264
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle, {
|
|
265
|
+
pointerEvents: 'none'
|
|
266
|
+
}]
|
|
267
|
+
}), focused && /*#__PURE__*/_jsx(View, {
|
|
231
268
|
testID: testID === undefined ? undefined : `${testID}-focus-ring`,
|
|
232
|
-
style: focusRingStyle
|
|
269
|
+
style: [focusRingStyle, {
|
|
270
|
+
pointerEvents: 'none'
|
|
271
|
+
}]
|
|
233
272
|
}), action.icon ? /*#__PURE__*/_jsx(Icon, {
|
|
234
273
|
name: action.icon,
|
|
235
274
|
size: ICON_SIZE,
|
|
@@ -241,4 +280,9 @@ const SwipeableAction = /*#__PURE__*/memo(function SwipeableAction({
|
|
|
241
280
|
})]
|
|
242
281
|
});
|
|
243
282
|
});
|
|
283
|
+
const styles = StyleSheet.create({
|
|
284
|
+
overflowHidden: {
|
|
285
|
+
overflow: "hidden"
|
|
286
|
+
}
|
|
287
|
+
});
|
|
244
288
|
//# sourceMappingURL=SwipeableRow.js.map
|
|
@@ -21,9 +21,12 @@ two colours onto ROLE tokens and leaves sizing/animation to RN.
|
|
|
21
21
|
| `value` | `boolean` | — | Required. Controlled — RN's own controlled-component contract. |
|
|
22
22
|
| `onValueChange` | `(value: boolean) => void` | — | Required. |
|
|
23
23
|
| `disabled` | `boolean` | `false` | Blocks toggling; RN renders its own native disabled treatment. |
|
|
24
|
-
| `accessibilityLabel` | `string` | — | **Required**
|
|
24
|
+
| `accessibilityLabel` | `string` | — | **Required always** (type-level). `label` defaults from it when omitted. |
|
|
25
|
+
| `label` | `string` | — | Visible label; when set, the row wrapper takes `${testID}-row`. |
|
|
26
|
+
| `description` | `string` | — | Muted helper under `label`. |
|
|
27
|
+
| `errorText` | `string` | — | Danger caption under `label`. |
|
|
25
28
|
| `style` | `LayoutStyle` | — | Layout-only, outermost, applied exactly once. |
|
|
26
|
-
| `testID` | `string` | — | |
|
|
29
|
+
| `testID` | `string` | — | On the inner `<Switch>`; `${testID}-row` on the row wrapper when `label` is set, so `getByTestId(testID)` resolves to one node. |
|
|
27
30
|
|
|
28
31
|
No `size` prop — RN's `Switch` is a native primitive with an intrinsic size that doesn't scale
|
|
29
32
|
cleanly. No `variant`/`tone` either: a switch has exactly one on/off visual language, so there is
|
|
@@ -77,3 +80,5 @@ Wrapped in `React.memo` (repo-wide re-render audit, 2026-07-17 — see root `CLA
|
|
|
77
80
|
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
78
81
|
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
79
82
|
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
83
|
+
|
|
84
|
+
Toggling fires `useHaptics().selection()` alongside `onValueChange`.
|
|
@@ -7,38 +7,55 @@
|
|
|
7
7
|
* to RN — which is also why there is no `size` prop.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { memo } from "react";
|
|
11
|
-
import { Switch as RNSwitch } from "react-native";
|
|
10
|
+
import { memo, useCallback, useMemo } from "react";
|
|
11
|
+
import { Switch as RNSwitch, View } from "react-native";
|
|
12
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
13
|
+
import { useTheme } from "../../theme/hooks.js";
|
|
12
14
|
import { useThemeColors } from "../../theme/hooks.js";
|
|
15
|
+
import { Text } from "../text/index.js";
|
|
13
16
|
import { resolveSwitchAccessibility, resolveSwitchColors, SWITCH_HIT_SLOP } from "./Switch.variants.js";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
18
|
export const Switch = /*#__PURE__*/memo(function Switch({
|
|
16
19
|
value,
|
|
17
20
|
onValueChange,
|
|
18
21
|
disabled = false,
|
|
19
22
|
accessibilityLabel,
|
|
23
|
+
label,
|
|
24
|
+
description,
|
|
25
|
+
errorText,
|
|
20
26
|
style,
|
|
21
27
|
testID
|
|
22
28
|
}) {
|
|
23
|
-
|
|
24
|
-
// `placeholderTextColor` — so colour is resolved via `useThemeColors()`, not `useTheme().colors`.
|
|
29
|
+
const theme = useTheme();
|
|
25
30
|
const colors = useThemeColors();
|
|
31
|
+
const haptics = useHaptics();
|
|
26
32
|
const {
|
|
27
33
|
trackOff,
|
|
28
34
|
trackOn,
|
|
29
35
|
thumbColor
|
|
30
36
|
} = resolveSwitchColors(colors);
|
|
37
|
+
const resolvedLabel = label ?? accessibilityLabel;
|
|
31
38
|
const a11y = resolveSwitchAccessibility({
|
|
32
39
|
value,
|
|
33
40
|
disabled
|
|
34
41
|
});
|
|
35
|
-
|
|
42
|
+
const rowStyle = useMemo(() => ({
|
|
43
|
+
flexDirection: "row",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "space-between",
|
|
46
|
+
gap: theme.space[3]
|
|
47
|
+
}), [theme]);
|
|
48
|
+
const handleValueChange = useCallback(next => {
|
|
49
|
+
haptics.selection();
|
|
50
|
+
onValueChange(next);
|
|
51
|
+
}, [haptics, onValueChange]);
|
|
52
|
+
const control = /*#__PURE__*/_jsx(RNSwitch, {
|
|
36
53
|
testID: testID,
|
|
37
54
|
value: value,
|
|
38
|
-
onValueChange:
|
|
55
|
+
onValueChange: handleValueChange,
|
|
39
56
|
disabled: disabled,
|
|
40
57
|
accessibilityRole: a11y.accessibilityRole,
|
|
41
|
-
accessibilityLabel:
|
|
58
|
+
accessibilityLabel: resolvedLabel,
|
|
42
59
|
accessibilityState: a11y.accessibilityState,
|
|
43
60
|
trackColor: {
|
|
44
61
|
false: trackOff,
|
|
@@ -47,7 +64,30 @@ export const Switch = /*#__PURE__*/memo(function Switch({
|
|
|
47
64
|
thumbColor: thumbColor,
|
|
48
65
|
ios_backgroundColor: trackOff,
|
|
49
66
|
hitSlop: SWITCH_HIT_SLOP,
|
|
50
|
-
style: style
|
|
67
|
+
style: label === undefined ? style : undefined
|
|
68
|
+
});
|
|
69
|
+
if (label === undefined) return control;
|
|
70
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
71
|
+
testID: testID ? `${testID}-row` : undefined,
|
|
72
|
+
style: [rowStyle, style],
|
|
73
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
74
|
+
style: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
gap: theme.space[1]
|
|
77
|
+
},
|
|
78
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
79
|
+
variant: "body-sm",
|
|
80
|
+
children: label
|
|
81
|
+
}), description ? /*#__PURE__*/_jsx(Text, {
|
|
82
|
+
variant: "caption",
|
|
83
|
+
color: "muted",
|
|
84
|
+
children: description
|
|
85
|
+
}) : null, errorText ? /*#__PURE__*/_jsx(Text, {
|
|
86
|
+
variant: "caption",
|
|
87
|
+
color: "danger",
|
|
88
|
+
children: errorText
|
|
89
|
+
}) : null]
|
|
90
|
+
}), control]
|
|
51
91
|
});
|
|
52
92
|
});
|
|
53
93
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* measuring real palettes instead of eyeballing a hex.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { MIN_TOUCH_TARGET } from "../../core/a11y/touchTarget.js";
|
|
9
10
|
/**
|
|
10
11
|
* Maps the switch's track + thumb onto ROLE colours — never a hardcoded hex, so it's guaranteed
|
|
11
12
|
* legible in both modes and can never be an off-palette value an app invented.
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
* non-text UI surface), while `bg.canvas` clears ≥3:1 against BOTH `trackOff` and `trackOn` on
|
|
18
19
|
* every brand × mode — see `__tests__/Switch.test.ts`.
|
|
19
20
|
*/
|
|
21
|
+
export { MIN_TOUCH_TARGET };
|
|
20
22
|
export function resolveSwitchColors(colors) {
|
|
21
23
|
return {
|
|
22
24
|
trackOff: colors.border.interactive,
|
|
@@ -47,9 +49,6 @@ export function resolveSwitchAccessibility(input) {
|
|
|
47
49
|
};
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
/** WCAG 2.5.5 (AAA) / HIG floor every interactive control is held to — same constant as `Button`. */
|
|
51
|
-
export const MIN_TOUCH_TARGET = 44;
|
|
52
|
-
|
|
53
52
|
/**
|
|
54
53
|
* RN's `Switch` has no `size` prop (a native intrinsic control doesn't scale cleanly), so its
|
|
55
54
|
* visual height is a platform constant rather than something this library chooses. 31 is iOS's
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# tabs/ — a single-select strip with a sliding active indicator
|
|
2
2
|
|
|
3
|
-
`Tabs` renders
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
`Tabs` renders the tab strip and, optionally, panel content: pass `panels` keyed by tab `value` and
|
|
4
|
+
it renders the active one below the strip. Omit `panels` and it is strip-only — content switching
|
|
5
|
+
stays the consumer's job. There is no separate `TabPanel` component.
|
|
6
6
|
|
|
7
7
|
## Files
|
|
8
8
|
|
|
@@ -18,12 +18,14 @@ from panel content and keeping this component simple and composable.
|
|
|
18
18
|
|
|
19
19
|
| Prop | Type | Default | Notes |
|
|
20
20
|
|------|------|---------|-------|
|
|
21
|
-
| `items` | `{ label: string; value: string; icon?: IconName }[]` | — | Rendered in order. `label` is always required — there is no icon-only tab, so there is no a11y trap to type-enforce against here. |
|
|
21
|
+
| `items` | `{ label: string; value: string; icon?: IconName; count?: number }[]` | — | Rendered in order. `label` is always required — there is no icon-only tab, so there is no a11y trap to type-enforce against here. `count` renders a `Badge` beside the label. |
|
|
22
22
|
| `value` | `string` | — | The active item's `value`. |
|
|
23
23
|
| `onValueChange` | `(value: string) => void` | — | Fires with the pressed tab's `value`. |
|
|
24
24
|
| `size` | `sm \| md \| lg` | `md` | 36 / 44 / 52 dp visual height; `sm` reaches 44 via `hitSlop`. |
|
|
25
|
+
| `panels` | `Partial<Record<string, ReactNode>>` | — | Panel content keyed by tab `value`. Omitted means strip-only. |
|
|
26
|
+
| `lazyPanels` | `boolean` | `true` | A panel mounts on first visit and stays mounted; `false` renders only the active panel. |
|
|
25
27
|
| `style` | `LayoutStyle` | — | Layout-only, outermost (the container `View`), applied exactly once, last. |
|
|
26
|
-
| `testID` | `string` | — | Container's testID; each tab gets `` `${testID}-${item.value}` `` (and `` `-focus-ring` `` under it while focused),
|
|
28
|
+
| `testID` | `string` | — | Container's testID; each tab gets `` `${testID}-${item.value}` `` (and `` `-focus-ring` `` under it while focused), the indicator gets `` `${testID}-indicator` `` and the panel host `` `${testID}-panels` ``, when set. |
|
|
27
29
|
|
|
28
30
|
No per-item `disabled` and no `tone` — every active label + indicator is the same accent role,
|
|
29
31
|
every inactive label is the same neutral `fg.muted`. Same reasoning as `RadioGroup`: a single-
|
|
@@ -57,14 +59,14 @@ purpose control has no closed union of appearances to resolve.
|
|
|
57
59
|
- **2.3.3** — the indicator's movement is two `Animated.Value`s (`translateX`, `scaleX`) driven off
|
|
58
60
|
each tab's own `onLayout` measurement. When `useMotion().enabled` is false (reduced motion or the
|
|
59
61
|
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.
|
|
62
|
+
in the render tests by spying on `Animated.timing` and asserting it isn't called. Tab presses use
|
|
63
|
+
`usePressState` (scale + state-layer overlay) and fire `useHaptics().selection()`.
|
|
61
64
|
|
|
62
65
|
## Indicator motion (transform-only, native driver)
|
|
63
66
|
|
|
64
67
|
The indicator is a **1dp-wide bar** (`TABS_INDICATOR_UNIT_WIDTH`) stretched by an animated `scaleX`
|
|
65
|
-
and positioned by an animated `translateX`.
|
|
66
|
-
`useNativeDriver: false` and a layout pass per frame
|
|
67
|
-
native driver, so the strip now animates entirely off the JS thread.
|
|
68
|
+
and positioned by an animated `translateX`. Only `opacity`/`transform` run on the native driver, so
|
|
69
|
+
animating `left`/`width` instead would force `useNativeDriver: false` and a layout pass per frame.
|
|
68
70
|
|
|
69
71
|
Geometry: RN scales around the element's centre, so for a tab measured at `{x, width}` the targets
|
|
70
72
|
are `translateX = x + width / 2 - 0.5` and `scaleX = width`. The structural resolver carries **no**
|
|
@@ -107,8 +109,3 @@ private, memo'd `TabStripItem`: the strip passes primitives plus the two stable
|
|
|
107
109
|
arrays, so a selection change re-renders the two affected tabs rather than the whole strip. The
|
|
108
110
|
indicator's structural style, the root style array and the resolved colours are memoized.
|
|
109
111
|
|
|
110
|
-
## Modernization (v1.0.7)
|
|
111
|
-
|
|
112
|
-
- Theme imports decoupled to `theme/hooks`; optional peers (reanimated, gesture-handler, flash-list) load at runtime.
|
|
113
|
-
- List-heavy surfaces use `VirtualList` with device-tier window sizing where applicable.
|
|
114
|
-
- `React.memo` + stable callbacks retained; render-item/key-extractor hoisted per ESLint perf rules.
|
|
@@ -16,13 +16,20 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
19
|
-
import {
|
|
19
|
+
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
20
|
+
import Reanimated, { useAnimatedStyle } from "react-native-reanimated";
|
|
20
21
|
import { Icon } from "../../core/icon/index.js";
|
|
21
|
-
import {
|
|
22
|
+
import { motionParallel, useMotion, useAnimatedValue } from "../../core/motion/index.js";
|
|
23
|
+
import { useHaptics } from "../../core/haptics/index.js";
|
|
24
|
+
import { usePressState } from "../../core/motion/usePressState.js";
|
|
25
|
+
import { renderNodeSlot } from "../../core/slot/index.js";
|
|
26
|
+
import { stateLayerScrim } from "../../theme/platform/stateLayer.native.js";
|
|
22
27
|
import { useTheme } from "../../theme/hooks.js";
|
|
28
|
+
import { Badge } from "../badge/index.js";
|
|
23
29
|
import { resolveTabAccessibility, resolveTabsColors, tabItemStructure, tabsFocusRingStructure, tabsIndicatorStructure, tabsStripStructure, TABS_INDICATOR_UNIT_WIDTH, TABS_SIZES } from "./Tabs.variants.js";
|
|
24
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
31
|
const ICON_STROKE = 2;
|
|
32
|
+
const AnimatedPressable = Reanimated.createAnimatedComponent(Pressable);
|
|
26
33
|
/** Centre of the 1dp bar in its own untransformed box — `scaleX` grows around it, not from the left. */
|
|
27
34
|
const INDICATOR_ORIGIN = TABS_INDICATOR_UNIT_WIDTH / 2;
|
|
28
35
|
const TabStripItem = /*#__PURE__*/memo(function TabStripItem({
|
|
@@ -31,54 +38,69 @@ const TabStripItem = /*#__PURE__*/memo(function TabStripItem({
|
|
|
31
38
|
size,
|
|
32
39
|
theme,
|
|
33
40
|
labelColor,
|
|
34
|
-
pressedColor,
|
|
35
41
|
hitSlop,
|
|
36
42
|
fontSize,
|
|
37
43
|
iconSize,
|
|
38
44
|
onPress,
|
|
39
45
|
onLayout,
|
|
46
|
+
hapticsSelection,
|
|
40
47
|
testID
|
|
41
48
|
}) {
|
|
42
49
|
const a11y = resolveTabAccessibility({
|
|
43
50
|
selected
|
|
44
51
|
});
|
|
45
|
-
|
|
46
|
-
// one item instead of the strip (same reasoning `BottomNavTab` documents).
|
|
52
|
+
const press = usePressState(false);
|
|
47
53
|
const [focused, setFocused] = useState(false);
|
|
48
|
-
const handlePress = useCallback(() =>
|
|
49
|
-
|
|
54
|
+
const handlePress = useCallback(() => {
|
|
55
|
+
hapticsSelection();
|
|
56
|
+
onPress(item.value);
|
|
57
|
+
}, [hapticsSelection, onPress, item.value]);
|
|
58
|
+
const handleLayout = useCallback(event => {
|
|
59
|
+
press.onLayout(event);
|
|
60
|
+
onLayout(item.value, event);
|
|
61
|
+
}, [onLayout, item.value, press]);
|
|
50
62
|
const handleFocus = useCallback(() => setFocused(true), []);
|
|
51
63
|
const handleBlur = useCallback(() => setFocused(false), []);
|
|
52
64
|
const focusRingStyle = useMemo(() => [tabsFocusRingStructure(theme), {
|
|
53
65
|
borderColor: theme.colors.border.focus
|
|
54
66
|
}], [theme]);
|
|
55
|
-
const
|
|
56
|
-
backgroundColor: pressedColor
|
|
57
|
-
}), [pressedColor]);
|
|
58
|
-
const itemStyle = useCallback(({
|
|
59
|
-
pressed
|
|
60
|
-
}) => [tabItemStructure(theme, {
|
|
67
|
+
const itemStyle = useMemo(() => [tabItemStructure(theme, {
|
|
61
68
|
size
|
|
62
|
-
}),
|
|
63
|
-
|
|
69
|
+
}), {
|
|
70
|
+
overflow: "hidden"
|
|
71
|
+
}, press.animatedStyle], [theme, size, press.animatedStyle]);
|
|
72
|
+
const overlayStaticStyle = useMemo(() => ({
|
|
73
|
+
backgroundColor: stateLayerScrim(theme.mode),
|
|
74
|
+
borderRadius: theme.radii.md,
|
|
75
|
+
borderCurve: "continuous"
|
|
76
|
+
}), [theme.mode, theme.radii.md]);
|
|
77
|
+
const labelStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights[selected ? "semibold" : "medium"]), {
|
|
64
78
|
fontSize,
|
|
65
79
|
color: labelColor
|
|
66
|
-
}], [theme, fontSize, labelColor]);
|
|
67
|
-
return /*#__PURE__*/_jsxs(
|
|
80
|
+
}], [theme, fontSize, labelColor, selected]);
|
|
81
|
+
return /*#__PURE__*/_jsxs(AnimatedPressable, {
|
|
68
82
|
testID: testID,
|
|
69
83
|
accessibilityRole: a11y.accessibilityRole,
|
|
70
84
|
"aria-selected": a11y["aria-selected"],
|
|
71
85
|
accessibilityLabel: item.label,
|
|
72
86
|
onPress: handlePress,
|
|
73
87
|
onLayout: handleLayout,
|
|
88
|
+
onPressIn: press.handlers.onPressIn,
|
|
89
|
+
onPressOut: press.handlers.onPressOut,
|
|
74
90
|
onFocus: handleFocus,
|
|
75
91
|
onBlur: handleBlur,
|
|
76
92
|
hitSlop: hitSlop,
|
|
77
93
|
style: itemStyle,
|
|
78
|
-
children: [
|
|
79
|
-
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Reanimated.View, {
|
|
95
|
+
testID: testID ? `${testID}-press-overlay` : undefined,
|
|
96
|
+
style: [StyleSheet.absoluteFill, overlayStaticStyle, press.overlayStyle, {
|
|
97
|
+
pointerEvents: 'none'
|
|
98
|
+
}]
|
|
99
|
+
}), focused && /*#__PURE__*/_jsx(View, {
|
|
80
100
|
testID: testID ? `${testID}-focus-ring` : undefined,
|
|
81
|
-
style: focusRingStyle
|
|
101
|
+
style: [focusRingStyle, {
|
|
102
|
+
pointerEvents: 'none'
|
|
103
|
+
}]
|
|
82
104
|
}), item.icon !== undefined && /*#__PURE__*/_jsx(Icon, {
|
|
83
105
|
name: item.icon,
|
|
84
106
|
size: iconSize,
|
|
@@ -88,7 +110,11 @@ const TabStripItem = /*#__PURE__*/memo(function TabStripItem({
|
|
|
88
110
|
numberOfLines: 1,
|
|
89
111
|
style: labelStyle,
|
|
90
112
|
children: item.label
|
|
91
|
-
})
|
|
113
|
+
}), item.count !== undefined && item.count > 0 ? /*#__PURE__*/_jsx(Badge, {
|
|
114
|
+
label: String(item.count),
|
|
115
|
+
size: "sm",
|
|
116
|
+
tone: "neutral"
|
|
117
|
+
}) : null]
|
|
92
118
|
});
|
|
93
119
|
});
|
|
94
120
|
export const Tabs = /*#__PURE__*/memo(function Tabs({
|
|
@@ -96,11 +122,14 @@ export const Tabs = /*#__PURE__*/memo(function Tabs({
|
|
|
96
122
|
value,
|
|
97
123
|
onValueChange,
|
|
98
124
|
size = "md",
|
|
125
|
+
panels,
|
|
126
|
+
lazyPanels = true,
|
|
99
127
|
style,
|
|
100
128
|
testID
|
|
101
129
|
}) {
|
|
102
130
|
const theme = useTheme();
|
|
103
131
|
const motion = useMotion();
|
|
132
|
+
const haptics = useHaptics();
|
|
104
133
|
const colors = useMemo(() => resolveTabsColors(theme.colors), [theme.colors]);
|
|
105
134
|
const spec = TABS_SIZES[size];
|
|
106
135
|
const [layouts, setLayouts] = useState({});
|
|
@@ -131,46 +160,81 @@ export const Tabs = /*#__PURE__*/memo(function Tabs({
|
|
|
131
160
|
const toX = activeLayout.x + activeLayout.width / 2 - INDICATOR_ORIGIN;
|
|
132
161
|
const toScaleX = activeLayout.width / TABS_INDICATOR_UNIT_WIDTH;
|
|
133
162
|
if (!motion.enabled) {
|
|
134
|
-
indicatorX.
|
|
135
|
-
indicatorScaleX.
|
|
163
|
+
indicatorX.value = toX;
|
|
164
|
+
indicatorScaleX.value = toScaleX;
|
|
136
165
|
return;
|
|
137
166
|
}
|
|
138
|
-
running.current =
|
|
167
|
+
running.current = motionParallel(motion.timing(indicatorX, toX), motion.timing(indicatorScaleX, toScaleX));
|
|
139
168
|
running.current.start();
|
|
140
169
|
return () => running.current?.stop();
|
|
141
170
|
}, [activeLayout, motion, indicatorX, indicatorScaleX]);
|
|
142
171
|
useEffect(() => () => running.current?.stop(), []);
|
|
143
|
-
const
|
|
144
|
-
backgroundColor: colors.indicator
|
|
172
|
+
const indicatorStatic = useMemo(() => [tabsIndicatorStructure(theme), {
|
|
173
|
+
backgroundColor: colors.indicator
|
|
174
|
+
}], [theme, colors.indicator]);
|
|
175
|
+
const indicatorMotion = useAnimatedStyle(() => ({
|
|
145
176
|
transform: [{
|
|
146
|
-
translateX: indicatorX
|
|
177
|
+
translateX: indicatorX.value
|
|
147
178
|
}, {
|
|
148
|
-
scaleX: indicatorScaleX
|
|
179
|
+
scaleX: indicatorScaleX.value
|
|
149
180
|
}]
|
|
150
|
-
}
|
|
151
|
-
const rootStyle = useMemo(() => [tabsStripStructure(theme)
|
|
181
|
+
}));
|
|
182
|
+
const rootStyle = useMemo(() => [tabsStripStructure(theme)], [theme]);
|
|
183
|
+
const outerStyle = useMemo(() => [style], [style]);
|
|
184
|
+
const [mountedPanelKeys, setMountedPanelKeys] = useState(() => new Set([value]));
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
if (panels === undefined) return;
|
|
187
|
+
if (!lazyPanels) return;
|
|
188
|
+
setMountedPanelKeys(prev => {
|
|
189
|
+
if (prev.has(value)) return prev;
|
|
190
|
+
const next = new Set(prev);
|
|
191
|
+
next.add(value);
|
|
192
|
+
return next;
|
|
193
|
+
});
|
|
194
|
+
}, [value, panels, lazyPanels]);
|
|
195
|
+
const panelKeys = useMemo(() => {
|
|
196
|
+
if (panels === undefined) return [];
|
|
197
|
+
if (!lazyPanels) return [value];
|
|
198
|
+
return [...mountedPanelKeys];
|
|
199
|
+
}, [panels, lazyPanels, value, mountedPanelKeys]);
|
|
200
|
+
const panelTextStyle = useMemo(() => [theme.fontStyleForWeight(theme.fontWeights.regular), {
|
|
201
|
+
color: theme.colors.fg.default,
|
|
202
|
+
fontSize: theme.fontSizes.md
|
|
203
|
+
}], [theme]);
|
|
152
204
|
return /*#__PURE__*/_jsxs(View, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
205
|
+
style: outerStyle,
|
|
206
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
207
|
+
testID: testID,
|
|
208
|
+
accessibilityRole: "tablist",
|
|
209
|
+
style: rootStyle,
|
|
210
|
+
children: [/*#__PURE__*/_jsx(Reanimated.View, {
|
|
211
|
+
testID: testID ? `${testID}-indicator` : undefined,
|
|
212
|
+
style: [indicatorStatic, indicatorMotion, {
|
|
213
|
+
pointerEvents: 'none'
|
|
214
|
+
}]
|
|
215
|
+
}), items.map(item => /*#__PURE__*/_jsx(TabStripItem, {
|
|
216
|
+
item: item,
|
|
217
|
+
selected: item.value === value,
|
|
218
|
+
size: size,
|
|
219
|
+
theme: theme,
|
|
220
|
+
labelColor: item.value === value ? colors.activeLabel : colors.inactiveLabel,
|
|
221
|
+
hitSlop: spec.hitSlop,
|
|
222
|
+
fontSize: spec.fontSize,
|
|
223
|
+
iconSize: spec.iconSize,
|
|
224
|
+
onPress: onValueChange,
|
|
225
|
+
onLayout: handleTabLayout,
|
|
226
|
+
hapticsSelection: haptics.selection,
|
|
227
|
+
testID: testID ? `${testID}-${item.value}` : undefined
|
|
228
|
+
}, item.value))]
|
|
229
|
+
}), panels !== undefined ? /*#__PURE__*/_jsx(View, {
|
|
230
|
+
testID: testID ? `${testID}-panels` : undefined,
|
|
231
|
+
children: panelKeys.map(key => /*#__PURE__*/_jsx(View, {
|
|
232
|
+
testID: testID ? `${testID}-panel-${key}` : undefined,
|
|
233
|
+
accessibilityElementsHidden: key !== value,
|
|
234
|
+
importantForAccessibility: key !== value ? "no-hide-descendants" : undefined,
|
|
235
|
+
children: renderNodeSlot(panels[key], panelTextStyle)
|
|
236
|
+
}, key))
|
|
237
|
+
}) : null]
|
|
174
238
|
});
|
|
175
239
|
});
|
|
176
240
|
//# sourceMappingURL=Tabs.js.map
|