@knitui/components 0.14.0 → 1.0.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/README.md +2 -2
- package/lib/commonjs/Accordion/Accordion.js +78 -96
- package/lib/commonjs/Accordion/Accordion.js.map +1 -1
- package/lib/commonjs/ActionIcon/ActionIcon.js +127 -61
- package/lib/commonjs/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/commonjs/Affix/Affix.js +16 -20
- package/lib/commonjs/Affix/Affix.js.map +1 -1
- package/lib/commonjs/Alert/Alert.js +53 -53
- package/lib/commonjs/Alert/Alert.js.map +1 -1
- package/lib/commonjs/Anchor/Anchor.js +12 -15
- package/lib/commonjs/Anchor/Anchor.js.map +1 -1
- package/lib/commonjs/AngleSlider/AngleSlider.js +65 -37
- package/lib/commonjs/AngleSlider/AngleSlider.js.map +1 -1
- package/lib/commonjs/AspectRatio/AspectRatio.js +12 -15
- package/lib/commonjs/AspectRatio/AspectRatio.js.map +1 -1
- package/lib/commonjs/Autocomplete/Autocomplete.js +7 -3
- package/lib/commonjs/Autocomplete/Autocomplete.js.map +1 -1
- package/lib/commonjs/Avatar/Avatar.js +27 -24
- package/lib/commonjs/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/BackgroundImage/BackgroundImage.js +15 -6
- package/lib/commonjs/BackgroundImage/BackgroundImage.js.map +1 -1
- package/lib/commonjs/Badge/Badge.js +59 -48
- package/lib/commonjs/Badge/Badge.js.map +1 -1
- package/lib/commonjs/Blockquote/Blockquote.js +80 -79
- package/lib/commonjs/Blockquote/Blockquote.js.map +1 -1
- package/lib/commonjs/Box/Box.js +2 -2
- package/lib/commonjs/Box/Box.js.map +1 -1
- package/lib/commonjs/Breadcrumbs/Breadcrumbs.js +9 -9
- package/lib/commonjs/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/commonjs/Burger/Burger.js +31 -20
- package/lib/commonjs/Burger/Burger.js.map +1 -1
- package/lib/commonjs/Button/Button.js +104 -62
- package/lib/commonjs/Button/Button.js.map +1 -1
- package/lib/commonjs/Card/Card.js +49 -37
- package/lib/commonjs/Card/Card.js.map +1 -1
- package/lib/commonjs/Center/Center.js +2 -2
- package/lib/commonjs/Center/Center.js.map +1 -1
- package/lib/commonjs/Checkbox/CheckIcon.js +5 -4
- package/lib/commonjs/Checkbox/CheckIcon.js.map +1 -1
- package/lib/commonjs/Checkbox/Checkbox.js +98 -68
- package/lib/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/Chip/Chip.js +34 -67
- package/lib/commonjs/Chip/Chip.js.map +1 -1
- package/lib/commonjs/CloseButton/CloseButton.js +11 -4
- package/lib/commonjs/CloseButton/CloseButton.js.map +1 -1
- package/lib/commonjs/Code/Code.js +14 -10
- package/lib/commonjs/Code/Code.js.map +1 -1
- package/lib/commonjs/Collapse/Collapse.js +10 -4
- package/lib/commonjs/Collapse/Collapse.js.map +1 -1
- package/lib/commonjs/ColorInput/ColorInput.js +25 -20
- package/lib/commonjs/ColorInput/ColorInput.js.map +1 -1
- package/lib/commonjs/ColorPicker/ColorPicker.js +95 -83
- package/lib/commonjs/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/commonjs/ColorSwatch/ColorSwatch.js +12 -14
- package/lib/commonjs/ColorSwatch/ColorSwatch.js.map +1 -1
- package/lib/commonjs/Combobox/Combobox.js +194 -187
- package/lib/commonjs/Combobox/Combobox.js.map +1 -1
- package/lib/commonjs/Combobox/OptionsDropdown.js +12 -6
- package/lib/commonjs/Combobox/OptionsDropdown.js.map +1 -1
- package/lib/commonjs/Combobox/index.js +6 -0
- package/lib/commonjs/Combobox/index.js.map +1 -1
- package/lib/commonjs/Container/Container.js +12 -19
- package/lib/commonjs/Container/Container.js.map +1 -1
- package/lib/commonjs/Dialog/Dialog.js +15 -14
- package/lib/commonjs/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/Drawer/Drawer.js +51 -32
- package/lib/commonjs/Drawer/Drawer.js.map +1 -1
- package/lib/commonjs/Fieldset/Fieldset.js +26 -18
- package/lib/commonjs/Fieldset/Fieldset.js.map +1 -1
- package/lib/commonjs/FileButton/FileButton.js +5 -3
- package/lib/commonjs/FileButton/FileButton.js.map +1 -1
- package/lib/commonjs/Flex/Flex.js +24 -27
- package/lib/commonjs/Flex/Flex.js.map +1 -1
- package/lib/commonjs/FocusTrap/FocusTrap.js +4 -3
- package/lib/commonjs/FocusTrap/FocusTrap.js.map +1 -1
- package/lib/commonjs/Grid/Grid.js +21 -18
- package/lib/commonjs/Grid/Grid.js.map +1 -1
- package/lib/commonjs/Group/Group.js +3 -3
- package/lib/commonjs/Group/Group.js.map +1 -1
- package/lib/commonjs/Highlight/Highlight.js +2 -1
- package/lib/commonjs/Highlight/Highlight.js.map +1 -1
- package/lib/commonjs/HoverCard/HoverCard.js +6 -23
- package/lib/commonjs/HoverCard/HoverCard.js.map +1 -1
- package/lib/commonjs/Image/Image.native.js +1 -1
- package/lib/commonjs/Image/createImage.js +88 -56
- package/lib/commonjs/Image/createImage.js.map +1 -1
- package/lib/commonjs/Indicator/Indicator.js +36 -29
- package/lib/commonjs/Indicator/Indicator.js.map +1 -1
- package/lib/commonjs/Input/Input.js +87 -119
- package/lib/commonjs/Input/Input.js.map +1 -1
- package/lib/commonjs/Input/Input.native.js +40 -30
- package/lib/commonjs/Input/Input.native.js.map +1 -1
- package/lib/commonjs/Input/shared.js +148 -225
- package/lib/commonjs/Input/shared.js.map +1 -1
- package/lib/commonjs/InputBase/InputBase.js +2 -1
- package/lib/commonjs/InputBase/InputBase.js.map +1 -1
- package/lib/commonjs/Kbd/Kbd.js +12 -18
- package/lib/commonjs/Kbd/Kbd.js.map +1 -1
- package/lib/commonjs/KeyboardAvoidingView/KeyboardAvoidingView.native.js +2 -2
- package/lib/commonjs/KeyboardAvoidingView/KeyboardAvoidingView.native.js.map +1 -1
- package/lib/commonjs/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js +1 -1
- package/lib/commonjs/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js.map +1 -1
- package/lib/commonjs/List/List.js +10 -10
- package/lib/commonjs/List/List.js.map +1 -1
- package/lib/commonjs/Loader/Loader.js +31 -37
- package/lib/commonjs/Loader/Loader.js.map +1 -1
- package/lib/commonjs/LoadingOverlay/LoadingOverlay.js +2 -1
- package/lib/commonjs/LoadingOverlay/LoadingOverlay.js.map +1 -1
- package/lib/commonjs/Mark/Mark.js +12 -15
- package/lib/commonjs/Mark/Mark.js.map +1 -1
- package/lib/commonjs/Marquee/Marquee.js +66 -48
- package/lib/commonjs/Marquee/Marquee.js.map +1 -1
- package/lib/commonjs/MaskInput/MaskInput.js +2 -1
- package/lib/commonjs/MaskInput/MaskInput.js.map +1 -1
- package/lib/commonjs/Menu/Menu.js +84 -48
- package/lib/commonjs/Menu/Menu.js.map +1 -1
- package/lib/commonjs/Modal/Modal.js +34 -30
- package/lib/commonjs/Modal/Modal.js.map +1 -1
- package/lib/commonjs/Modal/drag/DragDismissHost.web.js +10 -6
- package/lib/commonjs/Modal/drag/DragDismissHost.web.js.map +1 -1
- package/lib/commonjs/Modal/drag/DragDismissOverlay.web.js +6 -8
- package/lib/commonjs/Modal/drag/DragDismissOverlay.web.js.map +1 -1
- package/lib/commonjs/Modal/drag/index.js.map +1 -1
- package/lib/commonjs/Modal/modal-base-inner.js +1 -1
- package/lib/commonjs/Modal/modal-base-inner.js.map +1 -1
- package/lib/commonjs/Modal/modal-base-inner.native.js +3 -2
- package/lib/commonjs/Modal/modal-base-inner.native.js.map +1 -1
- package/lib/commonjs/Modal/modal-base.js +22 -9
- package/lib/commonjs/Modal/modal-base.js.map +1 -1
- package/lib/commonjs/MultiSelect/MultiSelect.js +6 -2
- package/lib/commonjs/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/commonjs/NativeSelect/NativeSelect.js +25 -30
- package/lib/commonjs/NativeSelect/NativeSelect.js.map +1 -1
- package/lib/commonjs/NavLink/NavLink.js +63 -58
- package/lib/commonjs/NavLink/NavLink.js.map +1 -1
- package/lib/commonjs/Notification/Notification.js +28 -28
- package/lib/commonjs/Notification/Notification.js.map +1 -1
- package/lib/commonjs/NumberFormatter/NumberFormatter.js +2 -2
- package/lib/commonjs/NumberFormatter/NumberFormatter.js.map +1 -1
- package/lib/commonjs/NumberInput/NumberInput.js +46 -43
- package/lib/commonjs/NumberInput/NumberInput.js.map +1 -1
- package/lib/commonjs/Overlay/Overlay.js +18 -11
- package/lib/commonjs/Overlay/Overlay.js.map +1 -1
- package/lib/commonjs/Pagination/Pagination.js +125 -120
- package/lib/commonjs/Pagination/Pagination.js.map +1 -1
- package/lib/commonjs/Paper/Paper.js +7 -8
- package/lib/commonjs/Paper/Paper.js.map +1 -1
- package/lib/commonjs/Paragraph/Paragraph.js +7 -10
- package/lib/commonjs/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/PasswordInput/PasswordInput.js +3 -3
- package/lib/commonjs/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/commonjs/Pill/Pill.js +39 -33
- package/lib/commonjs/Pill/Pill.js.map +1 -1
- package/lib/commonjs/PillsInput/PillsInput.js +58 -31
- package/lib/commonjs/PillsInput/PillsInput.js.map +1 -1
- package/lib/commonjs/PinInput/PinInput.js +26 -20
- package/lib/commonjs/PinInput/PinInput.js.map +1 -1
- package/lib/commonjs/Popover/Popover.native.js +6 -2
- package/lib/commonjs/Popover/Popover.native.js.map +1 -1
- package/lib/commonjs/Popover/Popover.shared.js +33 -22
- package/lib/commonjs/Popover/Popover.shared.js.map +1 -1
- package/lib/commonjs/Progress/Progress.js +37 -26
- package/lib/commonjs/Progress/Progress.js.map +1 -1
- package/lib/commonjs/Radio/Radio.js +81 -93
- package/lib/commonjs/Radio/Radio.js.map +1 -1
- package/lib/commonjs/Radio/RadioIcon.js +4 -6
- package/lib/commonjs/Radio/RadioIcon.js.map +1 -1
- package/lib/commonjs/Rating/Rating.js +48 -38
- package/lib/commonjs/Rating/Rating.js.map +1 -1
- package/lib/commonjs/RollingNumber/RollingNumber.js +48 -24
- package/lib/commonjs/RollingNumber/RollingNumber.js.map +1 -1
- package/lib/commonjs/ScrollArea/ScrollArea.js +40 -37
- package/lib/commonjs/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/commonjs/ScrollArea/ScrollArea.native.js +21 -26
- package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/commonjs/SegmentedControl/SegmentedControl.js +106 -55
- package/lib/commonjs/SegmentedControl/SegmentedControl.js.map +1 -1
- package/lib/commonjs/Select/Select.js +7 -3
- package/lib/commonjs/Select/Select.js.map +1 -1
- package/lib/commonjs/Separator/Separator.js +47 -39
- package/lib/commonjs/Separator/Separator.js.map +1 -1
- package/lib/commonjs/SimpleGrid/SimpleGrid.js +12 -14
- package/lib/commonjs/SimpleGrid/SimpleGrid.js.map +1 -1
- package/lib/commonjs/Skeleton/Skeleton.js +39 -24
- package/lib/commonjs/Skeleton/Skeleton.js.map +1 -1
- package/lib/commonjs/Slider/Slider.js +308 -257
- package/lib/commonjs/Slider/Slider.js.map +1 -1
- package/lib/commonjs/Spacer/Spacer.js +15 -29
- package/lib/commonjs/Spacer/Spacer.js.map +1 -1
- package/lib/commonjs/Spoiler/Spoiler.js +16 -16
- package/lib/commonjs/Spoiler/Spoiler.js.map +1 -1
- package/lib/commonjs/Stack/Stack.js +3 -3
- package/lib/commonjs/Stack/Stack.js.map +1 -1
- package/lib/commonjs/Stepper/Stepper.js +96 -71
- package/lib/commonjs/Stepper/Stepper.js.map +1 -1
- package/lib/commonjs/Switch/Switch.js +71 -67
- package/lib/commonjs/Switch/Switch.js.map +1 -1
- package/lib/commonjs/Table/Table.js +96 -82
- package/lib/commonjs/Table/Table.js.map +1 -1
- package/lib/commonjs/TableOfContents/TableOfContents.js +94 -95
- package/lib/commonjs/TableOfContents/TableOfContents.js.map +1 -1
- package/lib/commonjs/Tabs/Tabs.js +71 -73
- package/lib/commonjs/Tabs/Tabs.js.map +1 -1
- package/lib/commonjs/TagsInput/TagsInput.js +19 -3
- package/lib/commonjs/TagsInput/TagsInput.js.map +1 -1
- package/lib/commonjs/Text/Text.js +29 -14
- package/lib/commonjs/Text/Text.js.map +1 -1
- package/lib/commonjs/TextInput/TextInput.js +2 -1
- package/lib/commonjs/TextInput/TextInput.js.map +1 -1
- package/lib/commonjs/Textarea/Textarea.js +1 -1
- package/lib/commonjs/Textarea/Textarea.js.map +1 -1
- package/lib/commonjs/ThemeIcon/ThemeIcon.js +9 -5
- package/lib/commonjs/ThemeIcon/ThemeIcon.js.map +1 -1
- package/lib/commonjs/Title/Title.js +49 -32
- package/lib/commonjs/Title/Title.js.map +1 -1
- package/lib/commonjs/Tooltip/Tooltip.js +43 -27
- package/lib/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/lib/commonjs/Transition/Transition.native.js +11 -10
- package/lib/commonjs/Transition/Transition.native.js.map +1 -1
- package/lib/commonjs/Transition/use-overlay-transition.native.js +2 -5
- package/lib/commonjs/Transition/use-overlay-transition.native.js.map +1 -1
- package/lib/commonjs/Tree/Tree.js +30 -34
- package/lib/commonjs/Tree/Tree.js.map +1 -1
- package/lib/commonjs/TreeSelect/TreeSelect.js +50 -26
- package/lib/commonjs/TreeSelect/TreeSelect.js.map +1 -1
- package/lib/commonjs/Typography/Typography.js +5 -7
- package/lib/commonjs/Typography/Typography.js.map +1 -1
- package/lib/commonjs/UnstyledButton/UnstyledButton.js +4 -4
- package/lib/commonjs/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/commonjs/VirtualList/VirtualList.js +23 -7
- package/lib/commonjs/VirtualList/VirtualList.js.map +1 -1
- package/lib/commonjs/VisuallyHidden/VisuallyHidden.js +7 -10
- package/lib/commonjs/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/lib/commonjs/control-system.js +7 -0
- package/lib/commonjs/control-system.js.map +1 -1
- package/lib/commonjs/index.js +6 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/internal/ControlIconProvider.js +1 -1
- package/lib/commonjs/internal/ControlIconProvider.js.map +1 -1
- package/lib/commonjs/internal/InlineControl.js +24 -29
- package/lib/commonjs/internal/InlineControl.js.map +1 -1
- package/lib/commonjs/internal/collapse-box.js +12 -10
- package/lib/commonjs/internal/collapse-box.js.map +1 -1
- package/lib/commonjs/internal/control-icon-size.js +5 -8
- package/lib/commonjs/internal/control-icon-size.js.map +1 -1
- package/lib/commonjs/internal/control-metrics.js +51 -51
- package/lib/commonjs/internal/control-metrics.js.map +1 -1
- package/lib/commonjs/internal/floating-arrow.js +43 -29
- package/lib/commonjs/internal/floating-arrow.js.map +1 -1
- package/lib/commonjs/internal/focus-ring.js +99 -0
- package/lib/commonjs/internal/focus-ring.js.map +1 -0
- package/lib/commonjs/internal/gradient-shared.js +7 -7
- package/lib/commonjs/internal/gradient-shared.js.map +1 -1
- package/lib/commonjs/internal/gradient.native.js +1 -1
- package/lib/commonjs/internal/motion.js +247 -359
- package/lib/commonjs/internal/motion.js.map +1 -1
- package/lib/commonjs/internal/resolve-theme-color.js +10 -10
- package/lib/commonjs/internal/resolve-theme-color.js.map +1 -1
- package/lib/commonjs/internal/style-props.js +510 -464
- package/lib/commonjs/internal/style-props.js.map +1 -1
- package/lib/commonjs/internal/theme-color-web.js +44 -26
- package/lib/commonjs/internal/theme-color-web.js.map +1 -1
- package/lib/commonjs/internal/use-icon-color.js +1 -1
- package/lib/commonjs/internal/use-icon-color.native.js +1 -1
- package/lib/commonjs/internal/use-slot-text-wrapper.js +1 -1
- package/lib/commonjs/internal/variant-colors.js +163 -229
- package/lib/commonjs/internal/variant-colors.js.map +1 -1
- package/lib/module/Accordion/Accordion.js +80 -98
- package/lib/module/Accordion/Accordion.js.map +1 -1
- package/lib/module/ActionIcon/ActionIcon.js +128 -62
- package/lib/module/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/module/Affix/Affix.js +17 -21
- package/lib/module/Affix/Affix.js.map +1 -1
- package/lib/module/Alert/Alert.js +54 -54
- package/lib/module/Alert/Alert.js.map +1 -1
- package/lib/module/Anchor/Anchor.js +13 -16
- package/lib/module/Anchor/Anchor.js.map +1 -1
- package/lib/module/AngleSlider/AngleSlider.js +66 -38
- package/lib/module/AngleSlider/AngleSlider.js.map +1 -1
- package/lib/module/AspectRatio/AspectRatio.js +10 -14
- package/lib/module/AspectRatio/AspectRatio.js.map +1 -1
- package/lib/module/Autocomplete/Autocomplete.js +8 -4
- package/lib/module/Autocomplete/Autocomplete.js.map +1 -1
- package/lib/module/Avatar/Avatar.js +29 -26
- package/lib/module/Avatar/Avatar.js.map +1 -1
- package/lib/module/BackgroundImage/BackgroundImage.js +16 -7
- package/lib/module/BackgroundImage/BackgroundImage.js.map +1 -1
- package/lib/module/Badge/Badge.js +61 -50
- package/lib/module/Badge/Badge.js.map +1 -1
- package/lib/module/Blockquote/Blockquote.js +82 -81
- package/lib/module/Blockquote/Blockquote.js.map +1 -1
- package/lib/module/Box/Box.js +2 -2
- package/lib/module/Box/Box.js.map +1 -1
- package/lib/module/Breadcrumbs/Breadcrumbs.js +10 -10
- package/lib/module/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/lib/module/Burger/Burger.js +32 -21
- package/lib/module/Burger/Burger.js.map +1 -1
- package/lib/module/Button/Button.js +105 -63
- package/lib/module/Button/Button.js.map +1 -1
- package/lib/module/Card/Card.js +51 -39
- package/lib/module/Card/Card.js.map +1 -1
- package/lib/module/Center/Center.js +3 -3
- package/lib/module/Center/Center.js.map +1 -1
- package/lib/module/Checkbox/CheckIcon.js +5 -4
- package/lib/module/Checkbox/CheckIcon.js.map +1 -1
- package/lib/module/Checkbox/Checkbox.js +100 -70
- package/lib/module/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/Chip/Chip.js +35 -68
- package/lib/module/Chip/Chip.js.map +1 -1
- package/lib/module/CloseButton/CloseButton.js +12 -5
- package/lib/module/CloseButton/CloseButton.js.map +1 -1
- package/lib/module/Code/Code.js +15 -11
- package/lib/module/Code/Code.js.map +1 -1
- package/lib/module/Collapse/Collapse.js +11 -5
- package/lib/module/Collapse/Collapse.js.map +1 -1
- package/lib/module/ColorInput/ColorInput.js +26 -21
- package/lib/module/ColorInput/ColorInput.js.map +1 -1
- package/lib/module/ColorPicker/ColorPicker.js +96 -84
- package/lib/module/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/module/ColorSwatch/ColorSwatch.js +13 -15
- package/lib/module/ColorSwatch/ColorSwatch.js.map +1 -1
- package/lib/module/Combobox/Combobox.js +194 -188
- package/lib/module/Combobox/Combobox.js.map +1 -1
- package/lib/module/Combobox/OptionsDropdown.js +13 -7
- package/lib/module/Combobox/OptionsDropdown.js.map +1 -1
- package/lib/module/Combobox/index.js +1 -1
- package/lib/module/Combobox/index.js.map +1 -1
- package/lib/module/Container/Container.js +12 -19
- package/lib/module/Container/Container.js.map +1 -1
- package/lib/module/Dialog/Dialog.js +16 -15
- package/lib/module/Dialog/Dialog.js.map +1 -1
- package/lib/module/Drawer/Drawer.js +53 -34
- package/lib/module/Drawer/Drawer.js.map +1 -1
- package/lib/module/Fieldset/Fieldset.js +27 -19
- package/lib/module/Fieldset/Fieldset.js.map +1 -1
- package/lib/module/FileButton/FileButton.js +5 -3
- package/lib/module/FileButton/FileButton.js.map +1 -1
- package/lib/module/Flex/Flex.js +24 -28
- package/lib/module/Flex/Flex.js.map +1 -1
- package/lib/module/FocusTrap/FocusTrap.js +4 -3
- package/lib/module/FocusTrap/FocusTrap.js.map +1 -1
- package/lib/module/Grid/Grid.js +22 -19
- package/lib/module/Grid/Grid.js.map +1 -1
- package/lib/module/Group/Group.js +4 -4
- package/lib/module/Group/Group.js.map +1 -1
- package/lib/module/Highlight/Highlight.js +2 -1
- package/lib/module/Highlight/Highlight.js.map +1 -1
- package/lib/module/HoverCard/HoverCard.js +8 -25
- package/lib/module/HoverCard/HoverCard.js.map +1 -1
- package/lib/module/Image/Image.native.js +1 -1
- package/lib/module/Image/createImage.js +88 -56
- package/lib/module/Image/createImage.js.map +1 -1
- package/lib/module/Indicator/Indicator.js +37 -30
- package/lib/module/Indicator/Indicator.js.map +1 -1
- package/lib/module/Input/Input.js +89 -121
- package/lib/module/Input/Input.js.map +1 -1
- package/lib/module/Input/Input.native.js +42 -32
- package/lib/module/Input/Input.native.js.map +1 -1
- package/lib/module/Input/shared.js +148 -225
- package/lib/module/Input/shared.js.map +1 -1
- package/lib/module/InputBase/InputBase.js +2 -1
- package/lib/module/InputBase/InputBase.js.map +1 -1
- package/lib/module/Kbd/Kbd.js +12 -18
- package/lib/module/Kbd/Kbd.js.map +1 -1
- package/lib/module/KeyboardAvoidingView/KeyboardAvoidingView.native.js +2 -2
- package/lib/module/KeyboardAvoidingView/KeyboardAvoidingView.native.js.map +1 -1
- package/lib/module/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js +1 -1
- package/lib/module/KeyboardAwareScrollView/KeyboardAwareScrollView.native.js.map +1 -1
- package/lib/module/List/List.js +11 -11
- package/lib/module/List/List.js.map +1 -1
- package/lib/module/Loader/Loader.js +33 -39
- package/lib/module/Loader/Loader.js.map +1 -1
- package/lib/module/LoadingOverlay/LoadingOverlay.js +2 -1
- package/lib/module/LoadingOverlay/LoadingOverlay.js.map +1 -1
- package/lib/module/Mark/Mark.js +11 -15
- package/lib/module/Mark/Mark.js.map +1 -1
- package/lib/module/Marquee/Marquee.js +66 -48
- package/lib/module/Marquee/Marquee.js.map +1 -1
- package/lib/module/MaskInput/MaskInput.js +2 -1
- package/lib/module/MaskInput/MaskInput.js.map +1 -1
- package/lib/module/Menu/Menu.js +86 -50
- package/lib/module/Menu/Menu.js.map +1 -1
- package/lib/module/Modal/Modal.js +35 -31
- package/lib/module/Modal/Modal.js.map +1 -1
- package/lib/module/Modal/drag/DragDismissHost.web.js +10 -6
- package/lib/module/Modal/drag/DragDismissHost.web.js.map +1 -1
- package/lib/module/Modal/drag/DragDismissOverlay.web.js +6 -8
- package/lib/module/Modal/drag/DragDismissOverlay.web.js.map +1 -1
- package/lib/module/Modal/drag/index.js +1 -1
- package/lib/module/Modal/drag/index.js.map +1 -1
- package/lib/module/Modal/modal-base-inner.js +1 -1
- package/lib/module/Modal/modal-base-inner.js.map +1 -1
- package/lib/module/Modal/modal-base-inner.native.js +3 -2
- package/lib/module/Modal/modal-base-inner.native.js.map +1 -1
- package/lib/module/Modal/modal-base.js +22 -9
- package/lib/module/Modal/modal-base.js.map +1 -1
- package/lib/module/MultiSelect/MultiSelect.js +7 -3
- package/lib/module/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/module/NativeSelect/NativeSelect.js +26 -31
- package/lib/module/NativeSelect/NativeSelect.js.map +1 -1
- package/lib/module/NavLink/NavLink.js +64 -59
- package/lib/module/NavLink/NavLink.js.map +1 -1
- package/lib/module/Notification/Notification.js +29 -29
- package/lib/module/Notification/Notification.js.map +1 -1
- package/lib/module/NumberFormatter/NumberFormatter.js +3 -3
- package/lib/module/NumberFormatter/NumberFormatter.js.map +1 -1
- package/lib/module/NumberInput/NumberInput.js +49 -46
- package/lib/module/NumberInput/NumberInput.js.map +1 -1
- package/lib/module/Overlay/Overlay.js +19 -12
- package/lib/module/Overlay/Overlay.js.map +1 -1
- package/lib/module/Pagination/Pagination.js +127 -122
- package/lib/module/Pagination/Pagination.js.map +1 -1
- package/lib/module/Paper/Paper.js +8 -9
- package/lib/module/Paper/Paper.js.map +1 -1
- package/lib/module/Paragraph/Paragraph.js +6 -10
- package/lib/module/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/PasswordInput/PasswordInput.js +4 -4
- package/lib/module/PasswordInput/PasswordInput.js.map +1 -1
- package/lib/module/Pill/Pill.js +40 -34
- package/lib/module/Pill/Pill.js.map +1 -1
- package/lib/module/PillsInput/PillsInput.js +59 -32
- package/lib/module/PillsInput/PillsInput.js.map +1 -1
- package/lib/module/PinInput/PinInput.js +27 -21
- package/lib/module/PinInput/PinInput.js.map +1 -1
- package/lib/module/Popover/Popover.native.js +6 -2
- package/lib/module/Popover/Popover.native.js.map +1 -1
- package/lib/module/Popover/Popover.shared.js +34 -23
- package/lib/module/Popover/Popover.shared.js.map +1 -1
- package/lib/module/Progress/Progress.js +39 -28
- package/lib/module/Progress/Progress.js.map +1 -1
- package/lib/module/Radio/Radio.js +83 -95
- package/lib/module/Radio/Radio.js.map +1 -1
- package/lib/module/Radio/RadioIcon.js +4 -6
- package/lib/module/Radio/RadioIcon.js.map +1 -1
- package/lib/module/Rating/Rating.js +50 -40
- package/lib/module/Rating/Rating.js.map +1 -1
- package/lib/module/RollingNumber/RollingNumber.js +49 -25
- package/lib/module/RollingNumber/RollingNumber.js.map +1 -1
- package/lib/module/ScrollArea/ScrollArea.js +41 -38
- package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/module/ScrollArea/ScrollArea.native.js +22 -27
- package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/module/SegmentedControl/SegmentedControl.js +108 -57
- package/lib/module/SegmentedControl/SegmentedControl.js.map +1 -1
- package/lib/module/Select/Select.js +8 -4
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Separator/Separator.js +49 -41
- package/lib/module/Separator/Separator.js.map +1 -1
- package/lib/module/SimpleGrid/SimpleGrid.js +14 -16
- package/lib/module/SimpleGrid/SimpleGrid.js.map +1 -1
- package/lib/module/Skeleton/Skeleton.js +40 -25
- package/lib/module/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/Slider/Slider.js +309 -258
- package/lib/module/Slider/Slider.js.map +1 -1
- package/lib/module/Spacer/Spacer.js +16 -29
- package/lib/module/Spacer/Spacer.js.map +1 -1
- package/lib/module/Spoiler/Spoiler.js +17 -17
- package/lib/module/Spoiler/Spoiler.js.map +1 -1
- package/lib/module/Stack/Stack.js +3 -3
- package/lib/module/Stack/Stack.js.map +1 -1
- package/lib/module/Stepper/Stepper.js +97 -72
- package/lib/module/Stepper/Stepper.js.map +1 -1
- package/lib/module/Switch/Switch.js +73 -69
- package/lib/module/Switch/Switch.js.map +1 -1
- package/lib/module/Table/Table.js +99 -85
- package/lib/module/Table/Table.js.map +1 -1
- package/lib/module/TableOfContents/TableOfContents.js +96 -97
- package/lib/module/TableOfContents/TableOfContents.js.map +1 -1
- package/lib/module/Tabs/Tabs.js +72 -74
- package/lib/module/Tabs/Tabs.js.map +1 -1
- package/lib/module/TagsInput/TagsInput.js +21 -5
- package/lib/module/TagsInput/TagsInput.js.map +1 -1
- package/lib/module/Text/Text.js +29 -14
- package/lib/module/Text/Text.js.map +1 -1
- package/lib/module/TextInput/TextInput.js +2 -1
- package/lib/module/TextInput/TextInput.js.map +1 -1
- package/lib/module/Textarea/Textarea.js +2 -2
- package/lib/module/Textarea/Textarea.js.map +1 -1
- package/lib/module/ThemeIcon/ThemeIcon.js +10 -6
- package/lib/module/ThemeIcon/ThemeIcon.js.map +1 -1
- package/lib/module/Title/Title.js +51 -34
- package/lib/module/Title/Title.js.map +1 -1
- package/lib/module/Tooltip/Tooltip.js +44 -28
- package/lib/module/Tooltip/Tooltip.js.map +1 -1
- package/lib/module/Transition/Transition.native.js +12 -11
- package/lib/module/Transition/Transition.native.js.map +1 -1
- package/lib/module/Transition/use-overlay-transition.native.js +3 -6
- package/lib/module/Transition/use-overlay-transition.native.js.map +1 -1
- package/lib/module/Tree/Tree.js +31 -35
- package/lib/module/Tree/Tree.js.map +1 -1
- package/lib/module/TreeSelect/TreeSelect.js +52 -28
- package/lib/module/TreeSelect/TreeSelect.js.map +1 -1
- package/lib/module/Typography/Typography.js +5 -7
- package/lib/module/Typography/Typography.js.map +1 -1
- package/lib/module/UnstyledButton/UnstyledButton.js +5 -5
- package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/module/VirtualList/VirtualList.js +23 -7
- package/lib/module/VirtualList/VirtualList.js.map +1 -1
- package/lib/module/VisuallyHidden/VisuallyHidden.js +6 -10
- package/lib/module/VisuallyHidden/VisuallyHidden.js.map +1 -1
- package/lib/module/control-system.js +5 -0
- package/lib/module/control-system.js.map +1 -1
- package/lib/module/index.js +8 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/internal/ControlIconProvider.js +1 -1
- package/lib/module/internal/ControlIconProvider.js.map +1 -1
- package/lib/module/internal/InlineControl.js +25 -30
- package/lib/module/internal/InlineControl.js.map +1 -1
- package/lib/module/internal/collapse-box.js +13 -11
- package/lib/module/internal/collapse-box.js.map +1 -1
- package/lib/module/internal/control-icon-size.js +5 -8
- package/lib/module/internal/control-icon-size.js.map +1 -1
- package/lib/module/internal/control-metrics.js +52 -52
- package/lib/module/internal/control-metrics.js.map +1 -1
- package/lib/module/internal/floating-arrow.js +44 -30
- package/lib/module/internal/floating-arrow.js.map +1 -1
- package/lib/module/internal/focus-ring.js +95 -0
- package/lib/module/internal/focus-ring.js.map +1 -0
- package/lib/module/internal/gradient-shared.js +7 -7
- package/lib/module/internal/gradient-shared.js.map +1 -1
- package/lib/module/internal/gradient.native.js +1 -1
- package/lib/module/internal/motion.js +245 -359
- package/lib/module/internal/motion.js.map +1 -1
- package/lib/module/internal/resolve-theme-color.js +10 -10
- package/lib/module/internal/resolve-theme-color.js.map +1 -1
- package/lib/module/internal/style-props.js +471 -459
- package/lib/module/internal/style-props.js.map +1 -1
- package/lib/module/internal/theme-color-web.js +45 -27
- package/lib/module/internal/theme-color-web.js.map +1 -1
- package/lib/module/internal/use-icon-color.js +1 -1
- package/lib/module/internal/use-icon-color.native.js +1 -1
- package/lib/module/internal/use-slot-text-wrapper.js +1 -1
- package/lib/module/internal/variant-colors.js +150 -228
- package/lib/module/internal/variant-colors.js.map +1 -1
- package/lib/typescript/Accordion/Accordion.d.ts +120 -74
- package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/ActionIcon/ActionIcon.d.ts +236 -94
- package/lib/typescript/ActionIcon/ActionIcon.d.ts.map +1 -1
- package/lib/typescript/Affix/Affix.d.ts +12 -7
- package/lib/typescript/Affix/Affix.d.ts.map +1 -1
- package/lib/typescript/Alert/Alert.d.ts +228 -68
- package/lib/typescript/Alert/Alert.d.ts.map +1 -1
- package/lib/typescript/Anchor/Anchor.d.ts +33 -24
- package/lib/typescript/Anchor/Anchor.d.ts.map +1 -1
- package/lib/typescript/AngleSlider/AngleSlider.d.ts +224 -66
- package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
- package/lib/typescript/AspectRatio/AspectRatio.d.ts +34 -14
- package/lib/typescript/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/lib/typescript/Autocomplete/Autocomplete.d.ts +30 -42
- package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/lib/typescript/Avatar/Avatar.d.ts +167 -191
- package/lib/typescript/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/BackgroundImage/BackgroundImage.d.ts +15 -10
- package/lib/typescript/BackgroundImage/BackgroundImage.d.ts.map +1 -1
- package/lib/typescript/Badge/Badge.d.ts +138 -62
- package/lib/typescript/Badge/Badge.d.ts.map +1 -1
- package/lib/typescript/Blockquote/Blockquote.d.ts +148 -50
- package/lib/typescript/Blockquote/Blockquote.d.ts.map +1 -1
- package/lib/typescript/Box/Box.d.ts +11 -3
- package/lib/typescript/Box/Box.d.ts.map +1 -1
- package/lib/typescript/Breadcrumbs/Breadcrumbs.d.ts +115 -35
- package/lib/typescript/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/lib/typescript/Burger/Burger.d.ts +124 -41
- package/lib/typescript/Burger/Burger.d.ts.map +1 -1
- package/lib/typescript/Button/Button.d.ts +236 -107
- package/lib/typescript/Button/Button.d.ts.map +1 -1
- package/lib/typescript/Card/Card.d.ts +79 -47
- package/lib/typescript/Card/Card.d.ts.map +1 -1
- package/lib/typescript/Center/Center.d.ts +13 -9
- package/lib/typescript/Center/Center.d.ts.map +1 -1
- package/lib/typescript/Checkbox/CheckIcon.d.ts +7 -3
- package/lib/typescript/Checkbox/CheckIcon.d.ts.map +1 -1
- package/lib/typescript/Checkbox/Checkbox.d.ts +79 -60
- package/lib/typescript/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/Chip/Chip.d.ts +140 -57
- package/lib/typescript/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/CloseButton/CloseButton.d.ts +85 -50
- package/lib/typescript/CloseButton/CloseButton.d.ts.map +1 -1
- package/lib/typescript/Code/Code.d.ts +31 -23
- package/lib/typescript/Code/Code.d.ts.map +1 -1
- package/lib/typescript/Collapse/Collapse.d.ts +44 -20
- package/lib/typescript/Collapse/Collapse.d.ts.map +1 -1
- package/lib/typescript/ColorInput/ColorInput.d.ts +15 -5
- package/lib/typescript/ColorInput/ColorInput.d.ts.map +1 -1
- package/lib/typescript/ColorPicker/ColorPicker.d.ts +72 -16
- package/lib/typescript/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/typescript/ColorSwatch/ColorSwatch.d.ts +59 -38
- package/lib/typescript/ColorSwatch/ColorSwatch.d.ts.map +1 -1
- package/lib/typescript/Combobox/Combobox.d.ts +183 -100
- package/lib/typescript/Combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/Combobox/OptionsDropdown.d.ts +6 -0
- package/lib/typescript/Combobox/OptionsDropdown.d.ts.map +1 -1
- package/lib/typescript/Combobox/index.d.ts +66 -86
- package/lib/typescript/Combobox/index.d.ts.map +1 -1
- package/lib/typescript/Container/Container.d.ts +3 -41
- package/lib/typescript/Container/Container.d.ts.map +1 -1
- package/lib/typescript/Dialog/Dialog.d.ts +79 -76
- package/lib/typescript/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/Drawer/Drawer.d.ts +115 -40
- package/lib/typescript/Drawer/Drawer.d.ts.map +1 -1
- package/lib/typescript/Fieldset/Fieldset.d.ts +91 -46
- package/lib/typescript/Fieldset/Fieldset.d.ts.map +1 -1
- package/lib/typescript/FileButton/FileButton.d.ts.map +1 -1
- package/lib/typescript/FileInput/FileInput.d.ts +1 -1
- package/lib/typescript/FileInput/FileInput.d.ts.map +1 -1
- package/lib/typescript/Flex/Flex.d.ts +28 -26
- package/lib/typescript/Flex/Flex.d.ts.map +1 -1
- package/lib/typescript/FocusTrap/FocusTrap.d.ts.map +1 -1
- package/lib/typescript/Grid/Grid.d.ts +56 -48
- package/lib/typescript/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/Group/Group.d.ts +21 -16
- package/lib/typescript/Group/Group.d.ts.map +1 -1
- package/lib/typescript/Highlight/Highlight.d.ts +1 -15
- package/lib/typescript/Highlight/Highlight.d.ts.map +1 -1
- package/lib/typescript/HoverCard/HoverCard.d.ts +9 -9
- package/lib/typescript/HoverCard/HoverCard.d.ts.map +1 -1
- package/lib/typescript/Image/Image.d.ts +46 -114
- package/lib/typescript/Image/Image.d.ts.map +1 -1
- package/lib/typescript/Image/Image.native.d.ts +47 -115
- package/lib/typescript/Image/Image.native.d.ts.map +1 -1
- package/lib/typescript/Image/createImage.d.ts +49 -357
- package/lib/typescript/Image/createImage.d.ts.map +1 -1
- package/lib/typescript/Image/types.d.ts +4 -1
- package/lib/typescript/Image/types.d.ts.map +1 -1
- package/lib/typescript/Indicator/Indicator.d.ts +122 -43
- package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
- package/lib/typescript/Input/Input.d.ts +131 -328
- package/lib/typescript/Input/Input.d.ts.map +1 -1
- package/lib/typescript/Input/Input.native.d.ts +150 -472
- package/lib/typescript/Input/Input.native.d.ts.map +1 -1
- package/lib/typescript/Input/shared.d.ts +290 -490
- package/lib/typescript/Input/shared.d.ts.map +1 -1
- package/lib/typescript/Input/types.d.ts +14 -1
- package/lib/typescript/Input/types.d.ts.map +1 -1
- package/lib/typescript/InputBase/InputBase.d.ts +1 -52
- package/lib/typescript/InputBase/InputBase.d.ts.map +1 -1
- package/lib/typescript/Kbd/Kbd.d.ts +21 -65
- package/lib/typescript/Kbd/Kbd.d.ts.map +1 -1
- package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.d.ts +2 -6
- package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.native.d.ts +7 -3
- package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.native.d.ts.map +1 -1
- package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +2 -6
- package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts.map +1 -1
- package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.native.d.ts +6 -2
- package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.native.d.ts.map +1 -1
- package/lib/typescript/List/List.d.ts +165 -63
- package/lib/typescript/List/List.d.ts.map +1 -1
- package/lib/typescript/Loader/Loader.d.ts +58 -28
- package/lib/typescript/Loader/Loader.d.ts.map +1 -1
- package/lib/typescript/LoadingOverlay/LoadingOverlay.d.ts +1 -9
- package/lib/typescript/LoadingOverlay/LoadingOverlay.d.ts.map +1 -1
- package/lib/typescript/Mark/Mark.d.ts +21 -65
- package/lib/typescript/Mark/Mark.d.ts.map +1 -1
- package/lib/typescript/Marquee/Marquee.d.ts +127 -44
- package/lib/typescript/Marquee/Marquee.d.ts.map +1 -1
- package/lib/typescript/MaskInput/MaskInput.d.ts +1 -51
- package/lib/typescript/MaskInput/MaskInput.d.ts.map +1 -1
- package/lib/typescript/Menu/Menu.d.ts +93 -105
- package/lib/typescript/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/Modal/Modal.d.ts +166 -91
- package/lib/typescript/Modal/Modal.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/DragDismissHost.web.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/DragDismissOverlay.web.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/index.d.ts +2 -2
- package/lib/typescript/Modal/drag/index.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/types.d.ts +14 -2
- package/lib/typescript/Modal/drag/types.d.ts.map +1 -1
- package/lib/typescript/Modal/modal-base-inner.d.ts +6 -2
- package/lib/typescript/Modal/modal-base-inner.d.ts.map +1 -1
- package/lib/typescript/Modal/modal-base-inner.native.d.ts +7 -3
- package/lib/typescript/Modal/modal-base-inner.native.d.ts.map +1 -1
- package/lib/typescript/Modal/modal-base.d.ts +2 -2
- package/lib/typescript/Modal/modal-base.d.ts.map +1 -1
- package/lib/typescript/MultiSelect/MultiSelect.d.ts +30 -50
- package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/lib/typescript/NativeSelect/NativeSelect.d.ts.map +1 -1
- package/lib/typescript/NativeSelect/NativeSelect.native.d.ts +1 -1
- package/lib/typescript/NativeSelect/NativeSelect.native.d.ts.map +1 -1
- package/lib/typescript/NavLink/NavLink.d.ts +245 -72
- package/lib/typescript/NavLink/NavLink.d.ts.map +1 -1
- package/lib/typescript/Notification/Notification.d.ts +230 -69
- package/lib/typescript/Notification/Notification.d.ts.map +1 -1
- package/lib/typescript/NumberFormatter/NumberFormatter.d.ts +24 -19
- package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
- package/lib/typescript/NumberInput/NumberInput.d.ts +91 -150
- package/lib/typescript/NumberInput/NumberInput.d.ts.map +1 -1
- package/lib/typescript/Overlay/Overlay.d.ts +17 -12
- package/lib/typescript/Overlay/Overlay.d.ts.map +1 -1
- package/lib/typescript/Pagination/Pagination.d.ts +43 -65
- package/lib/typescript/Pagination/Pagination.d.ts.map +1 -1
- package/lib/typescript/Paper/Paper.d.ts +19 -7
- package/lib/typescript/Paper/Paper.d.ts.map +1 -1
- package/lib/typescript/Paragraph/Paragraph.d.ts +23 -19
- package/lib/typescript/Paragraph/Paragraph.d.ts.map +1 -1
- package/lib/typescript/PasswordInput/PasswordInput.d.ts +110 -207
- package/lib/typescript/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/lib/typescript/Pill/Pill.d.ts +133 -95
- package/lib/typescript/Pill/Pill.d.ts.map +1 -1
- package/lib/typescript/PillsInput/PillsInput.d.ts +2 -2
- package/lib/typescript/PillsInput/PillsInput.d.ts.map +1 -1
- package/lib/typescript/PinInput/PinInput.d.ts +148 -297
- package/lib/typescript/PinInput/PinInput.d.ts.map +1 -1
- package/lib/typescript/Popover/Popover.native.d.ts.map +1 -1
- package/lib/typescript/Popover/Popover.shared.d.ts +15 -11
- package/lib/typescript/Popover/Popover.shared.d.ts.map +1 -1
- package/lib/typescript/Progress/Progress.d.ts +114 -65
- package/lib/typescript/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/Radio/Radio.d.ts +69 -80
- package/lib/typescript/Radio/Radio.d.ts.map +1 -1
- package/lib/typescript/Radio/RadioIcon.d.ts +5 -0
- package/lib/typescript/Radio/RadioIcon.d.ts.map +1 -1
- package/lib/typescript/Rating/Rating.d.ts +94 -44
- package/lib/typescript/Rating/Rating.d.ts.map +1 -1
- package/lib/typescript/RollingNumber/RollingNumber.d.ts +112 -32
- package/lib/typescript/RollingNumber/RollingNumber.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.d.ts +50 -10
- package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.native.d.ts +40 -8
- package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.shared.d.ts +2 -2
- package/lib/typescript/SegmentedControl/SegmentedControl.d.ts +148 -56
- package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/Select/Select.d.ts +31 -51
- package/lib/typescript/Select/Select.d.ts.map +1 -1
- package/lib/typescript/Separator/Separator.d.ts +124 -61
- package/lib/typescript/Separator/Separator.d.ts.map +1 -1
- package/lib/typescript/SimpleGrid/SimpleGrid.d.ts +15 -13
- package/lib/typescript/SimpleGrid/SimpleGrid.d.ts.map +1 -1
- package/lib/typescript/Skeleton/Skeleton.d.ts +18 -14
- package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/Slider/Slider.d.ts +425 -129
- package/lib/typescript/Slider/Slider.d.ts.map +1 -1
- package/lib/typescript/Spacer/Spacer.d.ts +10 -17
- package/lib/typescript/Spacer/Spacer.d.ts.map +1 -1
- package/lib/typescript/Spoiler/Spoiler.d.ts +88 -28
- package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
- package/lib/typescript/Stack/Stack.d.ts +17 -5
- package/lib/typescript/Stack/Stack.d.ts.map +1 -1
- package/lib/typescript/Stepper/Stepper.d.ts +433 -101
- package/lib/typescript/Stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/Switch/Switch.d.ts +157 -69
- package/lib/typescript/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/Table/Table.d.ts +151 -201
- package/lib/typescript/Table/Table.d.ts.map +1 -1
- package/lib/typescript/TableOfContents/TableOfContents.d.ts +116 -46
- package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
- package/lib/typescript/Tabs/Tabs.d.ts +138 -88
- package/lib/typescript/Tabs/Tabs.d.ts.map +1 -1
- package/lib/typescript/TagsInput/TagsInput.d.ts +30 -42
- package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
- package/lib/typescript/Text/Text.d.ts +22 -4
- package/lib/typescript/Text/Text.d.ts.map +1 -1
- package/lib/typescript/TextInput/TextInput.d.ts +1 -51
- package/lib/typescript/TextInput/TextInput.d.ts.map +1 -1
- package/lib/typescript/Textarea/Textarea.d.ts +1 -51
- package/lib/typescript/Textarea/Textarea.d.ts.map +1 -1
- package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +52 -39
- package/lib/typescript/ThemeIcon/ThemeIcon.d.ts.map +1 -1
- package/lib/typescript/Title/Title.d.ts +40 -25
- package/lib/typescript/Title/Title.d.ts.map +1 -1
- package/lib/typescript/Tooltip/Tooltip.d.ts +97 -41
- package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/Transition/Transition.native.d.ts.map +1 -1
- package/lib/typescript/Transition/use-overlay-transition.d.ts +1 -2
- package/lib/typescript/Transition/use-overlay-transition.d.ts.map +1 -1
- package/lib/typescript/Transition/use-overlay-transition.native.d.ts +3 -4
- package/lib/typescript/Transition/use-overlay-transition.native.d.ts.map +1 -1
- package/lib/typescript/Tree/Tree.d.ts +180 -50
- package/lib/typescript/Tree/Tree.d.ts.map +1 -1
- package/lib/typescript/TreeSelect/TreeSelect.d.ts +141 -182
- package/lib/typescript/TreeSelect/TreeSelect.d.ts.map +1 -1
- package/lib/typescript/Typography/Typography.d.ts +13 -7
- package/lib/typescript/Typography/Typography.d.ts.map +1 -1
- package/lib/typescript/UnstyledButton/UnstyledButton.d.ts +27 -20
- package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/VirtualList/VirtualList.d.ts.map +1 -1
- package/lib/typescript/VirtualList/VirtualList.shared.d.ts +1 -1
- package/lib/typescript/VirtualList/VirtualList.shared.d.ts.map +1 -1
- package/lib/typescript/VisuallyHidden/VisuallyHidden.d.ts +23 -19
- package/lib/typescript/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/lib/typescript/control-system.d.ts +3 -0
- package/lib/typescript/control-system.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/internal/InlineControl.d.ts +80 -22
- package/lib/typescript/internal/InlineControl.d.ts.map +1 -1
- package/lib/typescript/internal/collapse-box.d.ts +3 -3
- package/lib/typescript/internal/collapse-box.d.ts.map +1 -1
- package/lib/typescript/internal/collapse-box.shared.d.ts +1 -1
- package/lib/typescript/internal/control-icon-size.d.ts +4 -3
- package/lib/typescript/internal/control-icon-size.d.ts.map +1 -1
- package/lib/typescript/internal/control-metrics.d.ts +50 -50
- package/lib/typescript/internal/floating-arrow.d.ts +6 -7
- package/lib/typescript/internal/floating-arrow.d.ts.map +1 -1
- package/lib/typescript/internal/focus-ring.d.ts +94 -0
- package/lib/typescript/internal/focus-ring.d.ts.map +1 -0
- package/lib/typescript/internal/gradient-shared.d.ts +8 -8
- package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
- package/lib/typescript/internal/motion.d.ts +77 -67
- package/lib/typescript/internal/motion.d.ts.map +1 -1
- package/lib/typescript/internal/resolve-theme-color.d.ts +9 -8
- package/lib/typescript/internal/resolve-theme-color.d.ts.map +1 -1
- package/lib/typescript/internal/style-props.d.ts +490 -664
- package/lib/typescript/internal/style-props.d.ts.map +1 -1
- package/lib/typescript/internal/theme-color-web.d.ts.map +1 -1
- package/lib/typescript/internal/use-icon-color.d.ts +1 -1
- package/lib/typescript/internal/use-icon-color.native.d.ts +1 -1
- package/lib/typescript/internal/use-looping-animation.d.ts +10 -2
- package/lib/typescript/internal/use-looping-animation.d.ts.map +1 -1
- package/lib/typescript/internal/variant-colors.d.ts +191 -199
- package/lib/typescript/internal/variant-colors.d.ts.map +1 -1
- package/package.json +7 -6
- package/src/Accordion/Accordion.tsx +55 -47
- package/src/ActionIcon/ActionIcon.tsx +114 -57
- package/src/Affix/Affix.tsx +14 -25
- package/src/Alert/Alert.tsx +55 -42
- package/src/Anchor/Anchor.tsx +13 -12
- package/src/AngleSlider/AngleSlider.tsx +87 -63
- package/src/AspectRatio/AspectRatio.tsx +9 -12
- package/src/Autocomplete/Autocomplete.tsx +7 -2
- package/src/Avatar/Avatar.tsx +42 -34
- package/src/BackgroundImage/BackgroundImage.tsx +9 -6
- package/src/Badge/Badge.tsx +53 -28
- package/src/Blockquote/Blockquote.tsx +55 -45
- package/src/Box/Box.tsx +2 -2
- package/src/Breadcrumbs/Breadcrumbs.tsx +13 -11
- package/src/Burger/Burger.tsx +33 -24
- package/src/Button/Button.tsx +104 -78
- package/src/Card/Card.tsx +52 -44
- package/src/Center/Center.tsx +3 -3
- package/src/Checkbox/CheckIcon.tsx +8 -5
- package/src/Checkbox/Checkbox.tsx +97 -62
- package/src/Chip/Chip.tsx +50 -45
- package/src/CloseButton/CloseButton.tsx +30 -11
- package/src/Code/Code.tsx +15 -11
- package/src/Collapse/Collapse.tsx +11 -6
- package/src/ColorInput/ColorInput.tsx +30 -24
- package/src/ColorPicker/ColorPicker.tsx +78 -79
- package/src/ColorSwatch/ColorSwatch.tsx +11 -14
- package/src/Combobox/Combobox.tsx +174 -153
- package/src/Combobox/OptionsDropdown.tsx +15 -2
- package/src/Combobox/index.ts +1 -0
- package/src/Container/Container.tsx +11 -15
- package/src/Dialog/Dialog.tsx +26 -16
- package/src/Drawer/Drawer.tsx +51 -33
- package/src/Fieldset/Fieldset.tsx +25 -17
- package/src/FileButton/FileButton.tsx +4 -1
- package/src/Flex/Flex.tsx +24 -21
- package/src/FocusTrap/FocusTrap.tsx +4 -3
- package/src/Grid/Grid.tsx +24 -27
- package/src/Group/Group.tsx +4 -4
- package/src/Highlight/Highlight.tsx +2 -2
- package/src/HoverCard/HoverCard.tsx +17 -32
- package/src/Image/Image.native.tsx +1 -1
- package/src/Image/createImage.tsx +96 -63
- package/src/Image/types.ts +5 -1
- package/src/Indicator/Indicator.tsx +41 -32
- package/src/Input/Input.native.tsx +521 -501
- package/src/Input/Input.tsx +110 -156
- package/src/Input/shared.tsx +198 -291
- package/src/Input/types.ts +15 -0
- package/src/InputBase/InputBase.tsx +3 -1
- package/src/Kbd/Kbd.tsx +13 -15
- package/src/KeyboardAvoidingView/KeyboardAvoidingView.native.tsx +2 -2
- package/src/KeyboardAwareScrollView/KeyboardAwareScrollView.native.tsx +1 -1
- package/src/List/List.tsx +17 -11
- package/src/Loader/Loader.tsx +33 -37
- package/src/LoadingOverlay/LoadingOverlay.tsx +3 -2
- package/src/Mark/Mark.tsx +12 -12
- package/src/Marquee/Marquee.tsx +58 -46
- package/src/MaskInput/MaskInput.tsx +2 -1
- package/src/Menu/Menu.tsx +110 -45
- package/src/Modal/Modal.tsx +38 -31
- package/src/Modal/drag/DragDismissHost.web.tsx +2 -1
- package/src/Modal/drag/DragDismissOverlay.web.tsx +6 -1
- package/src/Modal/drag/index.ts +7 -2
- package/src/Modal/drag/types.ts +15 -3
- package/src/Modal/modal-base-inner.native.tsx +3 -2
- package/src/Modal/modal-base-inner.tsx +1 -1
- package/src/Modal/modal-base.tsx +10 -8
- package/src/MultiSelect/MultiSelect.tsx +6 -1
- package/src/NativeSelect/NativeSelect.tsx +21 -32
- package/src/NavLink/NavLink.tsx +54 -47
- package/src/Notification/Notification.tsx +31 -30
- package/src/NumberFormatter/NumberFormatter.tsx +4 -3
- package/src/NumberInput/NumberInput.tsx +52 -42
- package/src/Overlay/Overlay.tsx +18 -14
- package/src/Pagination/Pagination.tsx +142 -123
- package/src/Paper/Paper.tsx +8 -9
- package/src/Paragraph/Paragraph.tsx +7 -7
- package/src/PasswordInput/PasswordInput.tsx +67 -67
- package/src/Pill/Pill.tsx +42 -30
- package/src/PillsInput/PillsInput.tsx +60 -31
- package/src/PinInput/PinInput.tsx +31 -23
- package/src/Popover/Popover.native.tsx +3 -4
- package/src/Popover/Popover.shared.tsx +29 -24
- package/src/Progress/Progress.tsx +77 -64
- package/src/Radio/Radio.tsx +128 -122
- package/src/Radio/RadioIcon.tsx +4 -10
- package/src/Rating/Rating.tsx +63 -42
- package/src/RollingNumber/RollingNumber.tsx +60 -28
- package/src/ScrollArea/ScrollArea.native.tsx +28 -27
- package/src/ScrollArea/ScrollArea.shared.ts +2 -2
- package/src/ScrollArea/ScrollArea.tsx +35 -33
- package/src/SegmentedControl/SegmentedControl.tsx +98 -53
- package/src/Select/Select.tsx +7 -2
- package/src/Separator/Separator.tsx +43 -36
- package/src/SimpleGrid/SimpleGrid.tsx +23 -24
- package/src/Skeleton/Skeleton.tsx +35 -16
- package/src/Slider/Slider.tsx +303 -227
- package/src/Spacer/Spacer.tsx +17 -41
- package/src/Spoiler/Spoiler.tsx +19 -13
- package/src/Stack/Stack.tsx +3 -3
- package/src/Stepper/Stepper.tsx +89 -73
- package/src/Switch/Switch.tsx +87 -73
- package/src/Table/Table.tsx +100 -77
- package/src/TableOfContents/TableOfContents.tsx +80 -74
- package/src/Tabs/Tabs.tsx +78 -66
- package/src/TagsInput/TagsInput.tsx +35 -4
- package/src/Text/Text.tsx +25 -10
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Textarea/Textarea.tsx +2 -2
- package/src/ThemeIcon/ThemeIcon.tsx +37 -22
- package/src/Title/Title.tsx +48 -23
- package/src/Tooltip/Tooltip.tsx +50 -29
- package/src/Transition/Transition.native.tsx +16 -19
- package/src/Transition/use-overlay-transition.native.ts +6 -12
- package/src/Transition/use-overlay-transition.ts +2 -2
- package/src/Tree/Tree.tsx +39 -44
- package/src/TreeSelect/TreeSelect.tsx +49 -24
- package/src/Typography/Typography.tsx +5 -7
- package/src/UnstyledButton/UnstyledButton.tsx +6 -5
- package/src/VirtualList/VirtualList.shared.ts +1 -1
- package/src/VirtualList/VirtualList.tsx +18 -6
- package/src/VisuallyHidden/VisuallyHidden.tsx +7 -9
- package/src/control-system.ts +5 -0
- package/src/index.ts +30 -12
- package/src/internal/ControlIconProvider.tsx +1 -1
- package/src/internal/InlineControl.tsx +23 -27
- package/src/internal/collapse-box.shared.ts +1 -1
- package/src/internal/collapse-box.tsx +15 -11
- package/src/internal/control-icon-size.ts +5 -8
- package/src/internal/control-metrics.ts +52 -52
- package/src/internal/floating-arrow.tsx +48 -40
- package/src/internal/focus-ring.ts +92 -0
- package/src/internal/gradient-shared.ts +10 -10
- package/src/internal/gradient.native.tsx +1 -1
- package/src/internal/motion.ts +204 -244
- package/src/internal/resolve-theme-color.ts +10 -10
- package/src/internal/style-props.ts +545 -390
- package/src/internal/theme-color-web.ts +47 -27
- package/src/internal/use-icon-color.native.ts +1 -1
- package/src/internal/use-icon-color.ts +1 -1
- package/src/internal/use-slot-text-wrapper.tsx +1 -1
- package/src/internal/variant-colors.ts +187 -151
package/src/internal/motion.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The animation ERGONOMICS layer — the easy, configurable, preset-driven surface
|
|
3
3
|
* that sits on top of the primitive motion tokens in `@knitui/core` (`DURATIONS`,
|
|
4
|
-
* `
|
|
4
|
+
* `MOTION_PRESETS`) and the Tamagui v3 `transition` prop.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 1. {@link SCALES} / {@link DISTANCES} — the shared transform magnitudes (press
|
|
9
|
-
* dip, enter offsets) so no component hardcodes `0.97` / `8` / `30` again.
|
|
6
|
+
* 1. {@link SCALES} / {@link DISTANCES} / {@link ANGLES} — the shared transform
|
|
7
|
+
* magnitudes (press dip, enter offsets).
|
|
10
8
|
* 2. {@link motionPresets} + {@link useMotionPreset} — NAMED enter/exit recipes
|
|
11
|
-
* (`"pop"`, `"fade-up"`, …) that resolve to
|
|
12
|
-
* animated frame: `{ transition,
|
|
13
|
-
*
|
|
14
|
-
* whole integration. Reduced motion is honoured here, ONCE, for every consumer.
|
|
9
|
+
* (`"pop"`, `"fade-up"`, …) that resolve to v3 props you spread onto any
|
|
10
|
+
* animated frame: `{ transition, opacity: "enter:0 exit:0", y: "enter:30px
|
|
11
|
+
* exit:30px" }`. Reduced motion is honoured here, ONCE, for every consumer.
|
|
15
12
|
* 3. {@link usePressScale} / {@link useReducedTransition} — the reduced-motion-aware
|
|
16
13
|
* press-dip and in-place-transition helpers.
|
|
17
14
|
* 4. {@link MotionConfig} / {@link useMotionConfig} — an app- (or subtree-) wide
|
|
18
|
-
*
|
|
19
|
-
* `disabled` off-switch, so the whole system is tunable from one provider.
|
|
15
|
+
* `durationScale` speed knob and `disabled` off-switch the hooks read.
|
|
20
16
|
*
|
|
21
17
|
* Everything uses Tamagui's cross-platform shorthand transforms (`scale`, `x`,
|
|
22
|
-
* `y`, `rotate`)
|
|
23
|
-
*
|
|
24
|
-
* `Transition/transitions.ts` presets still carry.
|
|
18
|
+
* `y`, `rotate`) as v3 `enter:` / `exit:` clauses, so a preset renders the SAME
|
|
19
|
+
* on web and native. Exit clauses only play under `AnimatePresence`.
|
|
25
20
|
*/
|
|
26
21
|
import * as React from "react";
|
|
27
22
|
|
|
28
|
-
import { DURATIONS } from "@knitui/core";
|
|
29
23
|
import { useReducedMotion } from "@knitui/hooks";
|
|
30
24
|
|
|
31
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
presetDurationMs,
|
|
27
|
+
PRESS_SCALE,
|
|
28
|
+
toTransitionProperties,
|
|
29
|
+
type TransitionName,
|
|
30
|
+
type TransitionSpec,
|
|
31
|
+
type TransitionValue,
|
|
32
|
+
} from "./style-props";
|
|
32
33
|
|
|
33
34
|
/* -------------------------------------------------------------------------- */
|
|
34
35
|
/* Shared transform magnitudes */
|
|
@@ -37,7 +38,7 @@ import { type TransitionName, type TransitionValue } from "./style-props";
|
|
|
37
38
|
/** Dimensionless scale targets shared across animated components. */
|
|
38
39
|
export const SCALES = {
|
|
39
40
|
/** Tactile "shrink on press" — the 3% dip shared by interactive controls. */
|
|
40
|
-
press:
|
|
41
|
+
press: PRESS_SCALE,
|
|
41
42
|
/** Pop entry scale — eases UP into place from slightly smaller. */
|
|
42
43
|
pop: 0.9,
|
|
43
44
|
/** Zoom entry scale — eases DOWN into place from slightly larger. */
|
|
@@ -60,8 +61,7 @@ export const DISTANCES = {
|
|
|
60
61
|
enter: 16,
|
|
61
62
|
/** Fade-slide travel. */
|
|
62
63
|
fade: 30,
|
|
63
|
-
/** Pronounced slide — drawer-style edge motion
|
|
64
|
-
* `enterStyle`/`exitStyle` for a full-bleed off-screen slide). */
|
|
64
|
+
/** Pronounced slide — drawer-style edge motion. */
|
|
65
65
|
slide: 100,
|
|
66
66
|
} as const;
|
|
67
67
|
|
|
@@ -71,8 +71,9 @@ export const DISTANCES = {
|
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* A cross-platform animated style snapshot — Tamagui shorthand transform props
|
|
74
|
-
* plus opacity
|
|
75
|
-
* `
|
|
74
|
+
* plus opacity, as plain numbers / angle strings. A recipe's `enter` is the
|
|
75
|
+
* "from" state animated to rest; `exit` the "to" state on unmount (with
|
|
76
|
+
* `AnimatePresence`). Lengths (`x`, `y`) are px.
|
|
76
77
|
*/
|
|
77
78
|
export interface MotionStyle {
|
|
78
79
|
opacity?: number;
|
|
@@ -86,16 +87,22 @@ export interface MotionStyle {
|
|
|
86
87
|
skewY?: string;
|
|
87
88
|
}
|
|
88
89
|
|
|
90
|
+
/** The animated properties a {@link MotionStyle} can name. */
|
|
91
|
+
export type MotionProp = keyof MotionStyle;
|
|
92
|
+
|
|
89
93
|
/** A named or inline animation recipe. */
|
|
90
94
|
export interface MotionPreset {
|
|
91
|
-
/** Driver
|
|
95
|
+
/** Driver preset picking easing + duration. @default "fast" */
|
|
92
96
|
transition?: TransitionName;
|
|
93
97
|
/** The "from" state on enter — animates to the frame's resting style. */
|
|
94
|
-
|
|
98
|
+
enter?: MotionStyle;
|
|
95
99
|
/** The "to" state on exit — only animates when wrapped in `AnimatePresence`. */
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
|
|
100
|
+
exit?: MotionStyle;
|
|
101
|
+
/**
|
|
102
|
+
* Scope the transition to the changing properties (perf + keeps `top`/`left`
|
|
103
|
+
* instant): `["transform", "opacity"]` or `"transform, opacity"`.
|
|
104
|
+
*/
|
|
105
|
+
properties?: readonly string[] | string;
|
|
99
106
|
}
|
|
100
107
|
|
|
101
108
|
export type MotionPresetName =
|
|
@@ -120,167 +127,99 @@ export type MotionPresetName =
|
|
|
120
127
|
| "skew-up"
|
|
121
128
|
| "skew-down";
|
|
122
129
|
|
|
123
|
-
const OPACITY_ONLY =
|
|
124
|
-
const TRANSFORM_AND_OPACITY =
|
|
130
|
+
const OPACITY_ONLY = "opacity";
|
|
131
|
+
const TRANSFORM_AND_OPACITY = "transform, opacity";
|
|
132
|
+
|
|
133
|
+
/** A symmetric recipe: the same snapshot on enter and exit. */
|
|
134
|
+
const symmetric = (
|
|
135
|
+
transition: TransitionName,
|
|
136
|
+
snapshot: MotionStyle,
|
|
137
|
+
properties: string = TRANSFORM_AND_OPACITY,
|
|
138
|
+
): MotionPreset => ({ transition, enter: snapshot, exit: snapshot, properties });
|
|
125
139
|
|
|
126
140
|
/**
|
|
127
|
-
* The built-in enter/exit recipes. Each pairs a driver `transition`
|
|
128
|
-
* symmetric `
|
|
141
|
+
* The built-in enter/exit recipes. Each pairs a driver `transition` preset with a
|
|
142
|
+
* symmetric `enter`/`exit` snapshot and a `properties` scope. Values come from
|
|
129
143
|
* {@link SCALES}/{@link DISTANCES}, so retuning the feel is a one-line change.
|
|
130
144
|
*/
|
|
131
145
|
export const motionPresets: Record<MotionPresetName, MotionPreset> = {
|
|
132
|
-
fade: {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
"
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
"
|
|
145
|
-
transition: "fast",
|
|
146
|
-
enterStyle: { opacity: 0, y: -DISTANCES.fade },
|
|
147
|
-
exitStyle: { opacity: 0, y: -DISTANCES.fade },
|
|
148
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
149
|
-
},
|
|
150
|
-
"fade-left": {
|
|
151
|
-
transition: "fast",
|
|
152
|
-
enterStyle: { opacity: 0, x: DISTANCES.fade },
|
|
153
|
-
exitStyle: { opacity: 0, x: DISTANCES.fade },
|
|
154
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
155
|
-
},
|
|
156
|
-
"fade-right": {
|
|
157
|
-
transition: "fast",
|
|
158
|
-
enterStyle: { opacity: 0, x: -DISTANCES.fade },
|
|
159
|
-
exitStyle: { opacity: 0, x: -DISTANCES.fade },
|
|
160
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
161
|
-
},
|
|
162
|
-
pop: {
|
|
163
|
-
transition: "bouncy",
|
|
164
|
-
enterStyle: { opacity: 0, scale: SCALES.pop },
|
|
165
|
-
exitStyle: { opacity: 0, scale: SCALES.pop },
|
|
166
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
167
|
-
},
|
|
168
|
-
scale: {
|
|
169
|
-
transition: "fast",
|
|
170
|
-
enterStyle: { opacity: 0, scale: 0 },
|
|
171
|
-
exitStyle: { opacity: 0, scale: 0 },
|
|
172
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
173
|
-
},
|
|
174
|
-
"scale-y": {
|
|
175
|
-
transition: "fast",
|
|
176
|
-
enterStyle: { opacity: 0, scaleY: 0 },
|
|
177
|
-
exitStyle: { opacity: 0, scaleY: 0 },
|
|
178
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
179
|
-
},
|
|
180
|
-
"scale-x": {
|
|
181
|
-
transition: "fast",
|
|
182
|
-
enterStyle: { opacity: 0, scaleX: 0 },
|
|
183
|
-
exitStyle: { opacity: 0, scaleX: 0 },
|
|
184
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
185
|
-
},
|
|
186
|
-
"slide-up": {
|
|
187
|
-
transition: "medium",
|
|
188
|
-
enterStyle: { y: DISTANCES.slide },
|
|
189
|
-
exitStyle: { y: DISTANCES.slide },
|
|
190
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
191
|
-
},
|
|
192
|
-
"slide-down": {
|
|
193
|
-
transition: "medium",
|
|
194
|
-
enterStyle: { y: -DISTANCES.slide },
|
|
195
|
-
exitStyle: { y: -DISTANCES.slide },
|
|
196
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
197
|
-
},
|
|
198
|
-
"slide-left": {
|
|
199
|
-
transition: "medium",
|
|
200
|
-
enterStyle: { x: DISTANCES.slide },
|
|
201
|
-
exitStyle: { x: DISTANCES.slide },
|
|
202
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
203
|
-
},
|
|
204
|
-
"slide-right": {
|
|
205
|
-
transition: "medium",
|
|
206
|
-
enterStyle: { x: -DISTANCES.slide },
|
|
207
|
-
exitStyle: { x: -DISTANCES.slide },
|
|
208
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
209
|
-
},
|
|
146
|
+
fade: symmetric("fast", { opacity: 0 }, OPACITY_ONLY),
|
|
147
|
+
"fade-up": symmetric("fast", { opacity: 0, y: DISTANCES.fade }),
|
|
148
|
+
"fade-down": symmetric("fast", { opacity: 0, y: -DISTANCES.fade }),
|
|
149
|
+
"fade-left": symmetric("fast", { opacity: 0, x: DISTANCES.fade }),
|
|
150
|
+
"fade-right": symmetric("fast", { opacity: 0, x: -DISTANCES.fade }),
|
|
151
|
+
pop: symmetric("bouncy", { opacity: 0, scale: SCALES.pop }),
|
|
152
|
+
scale: symmetric("fast", { opacity: 0, scale: 0 }),
|
|
153
|
+
"scale-y": symmetric("fast", { opacity: 0, scaleY: 0 }),
|
|
154
|
+
"scale-x": symmetric("fast", { opacity: 0, scaleX: 0 }),
|
|
155
|
+
"slide-up": symmetric("medium", { y: DISTANCES.slide }),
|
|
156
|
+
"slide-down": symmetric("medium", { y: -DISTANCES.slide }),
|
|
157
|
+
"slide-left": symmetric("medium", { x: DISTANCES.slide }),
|
|
158
|
+
"slide-right": symmetric("medium", { x: -DISTANCES.slide }),
|
|
210
159
|
// Pop with a directional rise/drop — the bouncy spring + a nudge translate.
|
|
211
|
-
"pop-up": {
|
|
212
|
-
|
|
213
|
-
enterStyle: { opacity: 0, scale: SCALES.pop, y: DISTANCES.nudge },
|
|
214
|
-
exitStyle: { opacity: 0, scale: SCALES.pop, y: DISTANCES.nudge },
|
|
215
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
216
|
-
},
|
|
217
|
-
"pop-down": {
|
|
218
|
-
transition: "bouncy",
|
|
219
|
-
enterStyle: { opacity: 0, scale: SCALES.pop, y: -DISTANCES.nudge },
|
|
220
|
-
exitStyle: { opacity: 0, scale: SCALES.pop, y: -DISTANCES.nudge },
|
|
221
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
222
|
-
},
|
|
160
|
+
"pop-up": symmetric("bouncy", { opacity: 0, scale: SCALES.pop, y: DISTANCES.nudge }),
|
|
161
|
+
"pop-down": symmetric("bouncy", { opacity: 0, scale: SCALES.pop, y: -DISTANCES.nudge }),
|
|
223
162
|
// Eases DOWN into place from slightly larger (a "zoom in" settle).
|
|
224
|
-
zoom: {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
exitStyle: { opacity: 0, y: DISTANCES.nudge, rotate: `-${ANGLES.tilt}` },
|
|
236
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
237
|
-
},
|
|
238
|
-
"rotate-right": {
|
|
239
|
-
transition: "medium",
|
|
240
|
-
enterStyle: { opacity: 0, y: DISTANCES.nudge, rotate: ANGLES.tilt },
|
|
241
|
-
exitStyle: { opacity: 0, y: DISTANCES.nudge, rotate: ANGLES.tilt },
|
|
242
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
243
|
-
},
|
|
244
|
-
// Shear + slide. `skewX` is a shorthand transform prop, so it animates on native
|
|
245
|
-
// too (the legacy `Transition` skew presets are dropped by RN's string parser).
|
|
246
|
-
"skew-up": {
|
|
247
|
-
transition: "medium",
|
|
248
|
-
enterStyle: { opacity: 0, y: -DISTANCES.fade, skewX: ANGLES.skew },
|
|
249
|
-
exitStyle: { opacity: 0, y: -DISTANCES.fade, skewX: ANGLES.skew },
|
|
250
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
251
|
-
},
|
|
252
|
-
"skew-down": {
|
|
253
|
-
transition: "medium",
|
|
254
|
-
enterStyle: { opacity: 0, y: DISTANCES.fade, skewX: ANGLES.skew },
|
|
255
|
-
exitStyle: { opacity: 0, y: DISTANCES.fade, skewX: ANGLES.skew },
|
|
256
|
-
animateOnly: TRANSFORM_AND_OPACITY,
|
|
257
|
-
},
|
|
163
|
+
zoom: symmetric("medium", { opacity: 0, scale: SCALES.zoom }),
|
|
164
|
+
// Tilt + rise. `rotate` is a Tamagui shorthand transform: animates on web and native.
|
|
165
|
+
"rotate-left": symmetric("medium", {
|
|
166
|
+
opacity: 0,
|
|
167
|
+
y: DISTANCES.nudge,
|
|
168
|
+
rotate: `-${ANGLES.tilt}`,
|
|
169
|
+
}),
|
|
170
|
+
"rotate-right": symmetric("medium", { opacity: 0, y: DISTANCES.nudge, rotate: ANGLES.tilt }),
|
|
171
|
+
// Shear + slide. `skewX` is a shorthand transform prop, so it animates on native too.
|
|
172
|
+
"skew-up": symmetric("medium", { opacity: 0, y: -DISTANCES.fade, skewX: ANGLES.skew }),
|
|
173
|
+
"skew-down": symmetric("medium", { opacity: 0, y: DISTANCES.fade, skewX: ANGLES.skew }),
|
|
258
174
|
};
|
|
259
175
|
|
|
260
176
|
/* -------------------------------------------------------------------------- */
|
|
261
|
-
/*
|
|
177
|
+
/* Recipe → v3 clause props */
|
|
262
178
|
/* -------------------------------------------------------------------------- */
|
|
263
179
|
|
|
180
|
+
/** A v3 flat clause program (`"enter:0 exit:0"`). */
|
|
181
|
+
export type ClauseString = `${string}:${string}`;
|
|
182
|
+
|
|
183
|
+
/** The mount/unmount clauses a recipe compiles to — one flat value per property. */
|
|
184
|
+
export type MotionClauseProps = { [K in MotionProp]?: ClauseString };
|
|
185
|
+
|
|
186
|
+
const LENGTH_PROPS = new Set<MotionProp>(["x", "y"]);
|
|
187
|
+
|
|
188
|
+
/** One clause payload: lengths carry `px` (a bare number in a clause is unitless). */
|
|
189
|
+
const payload = (prop: MotionProp, value: number | string): string =>
|
|
190
|
+
typeof value === "number" && LENGTH_PROPS.has(prop) ? `${value}px` : `${value}`;
|
|
191
|
+
|
|
192
|
+
const compiledCache = new WeakMap<MotionPreset, MotionClauseProps>();
|
|
193
|
+
|
|
264
194
|
/**
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
195
|
+
* Compile a recipe's `enter` / `exit` snapshots to v3 clause props:
|
|
196
|
+
* `{ enter: { opacity: 0, y: 30 }, exit: { opacity: 0 } }` →
|
|
197
|
+
* `{ opacity: "enter:0 exit:0", y: "enter:30px" }`. Cached per recipe object, so
|
|
198
|
+
* the built-in (and any module-level) recipes compile once.
|
|
269
199
|
*/
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
};
|
|
200
|
+
export function compileMotion(recipe: MotionPreset): MotionClauseProps {
|
|
201
|
+
const hit = compiledCache.get(recipe);
|
|
202
|
+
if (hit) return hit;
|
|
203
|
+
const out: MotionClauseProps = {};
|
|
204
|
+
const add = (phase: "enter" | "exit", snapshot: MotionStyle | undefined) => {
|
|
205
|
+
if (!snapshot) return;
|
|
206
|
+
for (const prop of Object.keys(snapshot) as MotionProp[]) {
|
|
207
|
+
const value = snapshot[prop];
|
|
208
|
+
if (value === undefined) continue;
|
|
209
|
+
const clause = `${phase}:${payload(prop, value)}` as ClauseString;
|
|
210
|
+
const prev = out[prop];
|
|
211
|
+
out[prop] = prev ? (`${prev} ${clause}` as ClauseString) : clause;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
add("enter", recipe.enter);
|
|
215
|
+
add("exit", recipe.exit);
|
|
216
|
+
compiledCache.set(recipe, out);
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* -------------------------------------------------------------------------- */
|
|
221
|
+
/* Global motion config (provider) */
|
|
222
|
+
/* -------------------------------------------------------------------------- */
|
|
284
223
|
|
|
285
224
|
/** Resolved global motion config — what {@link useMotionConfig} returns. */
|
|
286
225
|
export interface MotionConfigValue {
|
|
@@ -334,34 +273,43 @@ export function useMotionConfig(): MotionConfigValue {
|
|
|
334
273
|
|
|
335
274
|
/**
|
|
336
275
|
* Apply the global motion config to a resolved transition: `null` when disabled;
|
|
337
|
-
* otherwise scale the duration by `durationScale
|
|
338
|
-
*
|
|
339
|
-
*
|
|
276
|
+
* otherwise scale the duration by `durationScale` — a preset name becomes
|
|
277
|
+
* `{ preset, duration }` with its base ms read from core's `MOTION_PRESETS` (the
|
|
278
|
+
* one motion table). A `null` value, a unit scale, or a spring preset (`bouncy` —
|
|
279
|
+
* no scalable duration) pass through unchanged.
|
|
340
280
|
*/
|
|
341
|
-
function applyMotionConfig(
|
|
281
|
+
export function applyMotionConfig(
|
|
282
|
+
value: TransitionValue,
|
|
283
|
+
config: MotionConfigValue,
|
|
284
|
+
): TransitionValue {
|
|
342
285
|
if (config.disabled) return null;
|
|
343
286
|
if (value == null || config.durationScale === 1) return value;
|
|
344
|
-
const
|
|
345
|
-
const baseMs =
|
|
346
|
-
if (baseMs == null) return value; // spring / unknown
|
|
347
|
-
return
|
|
287
|
+
const spec: TransitionSpec = typeof value === "string" ? { preset: value } : value;
|
|
288
|
+
const baseMs = spec.duration ?? (spec.preset ? presetDurationMs(spec.preset) : undefined);
|
|
289
|
+
if (baseMs == null) return value; // spring / unknown — nothing to scale
|
|
290
|
+
return { ...spec, duration: Math.max(0, Math.round(baseMs * config.durationScale)) };
|
|
348
291
|
}
|
|
349
292
|
|
|
293
|
+
/** A stable primitive key for a transition value (memo deps). */
|
|
294
|
+
const transitionKey = (value: TransitionValue): string | null => {
|
|
295
|
+
if (value == null || typeof value === "string") return value;
|
|
296
|
+
return JSON.stringify(value);
|
|
297
|
+
};
|
|
298
|
+
|
|
350
299
|
/* -------------------------------------------------------------------------- */
|
|
351
300
|
/* Resolver hook */
|
|
352
301
|
/* -------------------------------------------------------------------------- */
|
|
353
302
|
|
|
354
|
-
/**
|
|
355
|
-
|
|
356
|
-
|
|
303
|
+
/**
|
|
304
|
+
* The spreadable props {@link useMotionPreset} returns: the `transition` plus the
|
|
305
|
+
* recipe's mount/unmount clauses (`opacity: "enter:0 exit:0"`, …). Spread it LAST
|
|
306
|
+
* among the animated properties it names — a later `opacity`/`y` prop replaces the
|
|
307
|
+
* clause program (v3 has one value per property).
|
|
308
|
+
*/
|
|
309
|
+
export type ResolvedMotion = MotionClauseProps & {
|
|
310
|
+
/** Preset / object (or `null` to disable). */
|
|
357
311
|
transition: TransitionValue;
|
|
358
|
-
|
|
359
|
-
enterStyle?: MotionStyle;
|
|
360
|
-
/** "To" state on exit — spread onto the frame's `exitStyle` (needs AnimatePresence). */
|
|
361
|
-
exitStyle?: MotionStyle;
|
|
362
|
-
/** Driver scope — spread onto the frame's `animateOnly`. */
|
|
363
|
-
animateOnly?: string[];
|
|
364
|
-
}
|
|
312
|
+
};
|
|
365
313
|
|
|
366
314
|
export interface UseMotionPresetOptions {
|
|
367
315
|
/** Override the preset's driver key (easing + base duration). */
|
|
@@ -373,19 +321,20 @@ export interface UseMotionPresetOptions {
|
|
|
373
321
|
}
|
|
374
322
|
|
|
375
323
|
/** The inert (no-animation) result — reused so reduced-motion renders are stable. */
|
|
376
|
-
const INERT: ResolvedMotion = { transition: null };
|
|
324
|
+
const INERT: ResolvedMotion = Object.freeze({ transition: null });
|
|
377
325
|
|
|
378
326
|
/**
|
|
379
327
|
* Resolve a preset (by name, an inline {@link MotionPreset}, or `false`/`null` to
|
|
380
|
-
* disable) into
|
|
328
|
+
* disable) into v3 props to spread onto an animated frame. Honours the user's
|
|
381
329
|
* reduced-motion preference centrally: under reduced motion (or when disabled) it
|
|
382
|
-
* returns {@link INERT} — `transition: null` and no enter/exit
|
|
383
|
-
* frame appears instantly with no per-component guard.
|
|
330
|
+
* returns {@link INERT} — `transition: null` and no enter/exit clauses — so the
|
|
331
|
+
* frame appears instantly with no per-component guard. Memoised: the same inputs
|
|
332
|
+
* return the same object.
|
|
384
333
|
*
|
|
385
334
|
* ```tsx
|
|
386
335
|
* function Dialog({ animation = "fade-up", ...props }) {
|
|
387
336
|
* const motion = useMotionPreset(animation);
|
|
388
|
-
* return <Frame {...
|
|
337
|
+
* return <Frame {...props} {...motion} />; // configurable + reduced-motion safe
|
|
389
338
|
* }
|
|
390
339
|
* ```
|
|
391
340
|
*/
|
|
@@ -395,22 +344,21 @@ export function useMotionPreset(
|
|
|
395
344
|
): ResolvedMotion {
|
|
396
345
|
const reduced = useReducedMotion();
|
|
397
346
|
const config = useMotionConfig();
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
};
|
|
347
|
+
const inert = !preset || reduced || config.disabled || options.enabled === false;
|
|
348
|
+
const recipe = inert ? undefined : typeof preset === "string" ? motionPresets[preset] : preset;
|
|
349
|
+
const key = recipe ? (options.transition ?? recipe.transition ?? "fast") : undefined;
|
|
350
|
+
const properties = recipe?.properties;
|
|
351
|
+
const propertiesKey = properties === undefined ? undefined : toTransitionProperties(properties);
|
|
352
|
+
|
|
353
|
+
return React.useMemo<ResolvedMotion>(() => {
|
|
354
|
+
if (!recipe || !key) return INERT;
|
|
355
|
+
const spec: TransitionSpec = { preset: key };
|
|
356
|
+
if (options.duration != null) spec.duration = options.duration;
|
|
357
|
+
if (propertiesKey) spec.properties = propertiesKey;
|
|
358
|
+
const base: TransitionValue = spec.duration == null && spec.properties == null ? key : spec;
|
|
359
|
+
return { ...compileMotion(recipe), transition: applyMotionConfig(base, config) };
|
|
360
|
+
// `config` is a memoised context value; the recipe object is compiled once per identity.
|
|
361
|
+
}, [recipe, key, options.duration, propertiesKey, config]);
|
|
414
362
|
}
|
|
415
363
|
|
|
416
364
|
/* -------------------------------------------------------------------------- */
|
|
@@ -419,36 +367,33 @@ export function useMotionPreset(
|
|
|
419
367
|
|
|
420
368
|
/** The spreadable props {@link usePressScale} returns. */
|
|
421
369
|
export interface PressScaleResult {
|
|
422
|
-
/** Easing
|
|
370
|
+
/** Easing for the dip (`null` under reduced motion). */
|
|
423
371
|
transition: TransitionValue;
|
|
424
|
-
/** Neutralises the base `
|
|
425
|
-
|
|
372
|
+
/** Neutralises the base `scale: "press:0.97"` dip under reduced motion; absent otherwise. */
|
|
373
|
+
scale?: "press:1";
|
|
426
374
|
}
|
|
427
375
|
|
|
376
|
+
const PRESS_REDUCED: PressScaleResult = Object.freeze({ transition: null, scale: "press:1" });
|
|
377
|
+
|
|
428
378
|
/**
|
|
429
379
|
* Reduced-motion-aware press feedback for interactive controls (Button,
|
|
430
|
-
* ActionIcon, Chip, …). Pair with the static `pressScaleStyle`
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
* dip-free press when the user prefers reduced motion.
|
|
434
|
-
*
|
|
435
|
-
* Replaces the old `{...transitionProps("fast")}` at the press call site:
|
|
436
|
-
*
|
|
437
|
-
* ```tsx
|
|
438
|
-
* <Frame {...pressScaleStyle-in-base-config} {...usePressScale()} />
|
|
439
|
-
* ```
|
|
380
|
+
* ActionIcon, Chip, …). Pair with the static `pressScaleStyle` in the component's
|
|
381
|
+
* `styled()` base (the `scale: "press:0.97"` dip); THIS supplies the easing at
|
|
382
|
+
* render — collapsing to an instant, dip-free press under reduced motion.
|
|
440
383
|
*
|
|
441
|
-
* Normal: `{ transition: "fast" }
|
|
442
|
-
*
|
|
443
|
-
*
|
|
384
|
+
* Normal: `{ transition: "fast" }`. Reduced: `{ transition: null, scale:
|
|
385
|
+
* "press:1" }` — a call-site `press:` clause outranks the base one for that slot
|
|
386
|
+
* only, so the frame's resting `scale` and any variant press COLOUR stay intact.
|
|
444
387
|
*/
|
|
445
388
|
export function usePressScale(options: { transition?: TransitionName } = {}): PressScaleResult {
|
|
446
389
|
const reduced = useReducedMotion();
|
|
447
390
|
const config = useMotionConfig();
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
391
|
+
const off = reduced || config.disabled;
|
|
392
|
+
const name = options.transition ?? "fast";
|
|
393
|
+
return React.useMemo(
|
|
394
|
+
() => (off ? PRESS_REDUCED : { transition: applyMotionConfig(name, config) }),
|
|
395
|
+
[off, name, config],
|
|
396
|
+
);
|
|
452
397
|
}
|
|
453
398
|
|
|
454
399
|
/* -------------------------------------------------------------------------- */
|
|
@@ -457,23 +402,38 @@ export function usePressScale(options: { transition?: TransitionName } = {}): Pr
|
|
|
457
402
|
|
|
458
403
|
/**
|
|
459
404
|
* Reduced-motion-aware transition for IN-PLACE state changes — chevron rotation,
|
|
460
|
-
* thumb/indicator slide, scrollbar fade, color toggles
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
467
|
-
* Replaces the hand-written `transitionProps(reduced ? null : value)` idiom:
|
|
405
|
+
* thumb/indicator slide, scrollbar fade, color toggles. Pass the value you'd hand
|
|
406
|
+
* to the `transition` prop (a preset name, a `{ duration, easing }` object from
|
|
407
|
+
* `timedTransition`, or `null`), plus optional `properties` to scope it. Under
|
|
408
|
+
* reduced motion it returns `{ transition: null }`. Memoised on the VALUE (not
|
|
409
|
+
* its identity), so an inline object argument still yields a stable result —
|
|
410
|
+
* which also lets `scopeTransition(result, …)` hit its cache.
|
|
468
411
|
*
|
|
469
412
|
* ```tsx
|
|
470
413
|
* const fade = useReducedTransition("fast");
|
|
471
|
-
* <Thumb {...fade}
|
|
414
|
+
* <Thumb {...scopeTransition(fade, ["opacity"])} opacity={visible ? 1 : 0} />
|
|
472
415
|
* ```
|
|
473
416
|
*/
|
|
474
|
-
export function useReducedTransition(
|
|
417
|
+
export function useReducedTransition(
|
|
418
|
+
value: TransitionValue,
|
|
419
|
+
properties?: readonly string[] | string,
|
|
420
|
+
): { transition: TransitionValue } {
|
|
475
421
|
const reduced = useReducedMotion();
|
|
476
422
|
const config = useMotionConfig();
|
|
477
|
-
|
|
478
|
-
|
|
423
|
+
const valueKey = transitionKey(value);
|
|
424
|
+
const propertiesKey = properties === undefined ? undefined : toTransitionProperties(properties);
|
|
425
|
+
return React.useMemo(
|
|
426
|
+
() => {
|
|
427
|
+
if (reduced) return { transition: null };
|
|
428
|
+
const scoped: TransitionValue =
|
|
429
|
+
propertiesKey === undefined || value == null
|
|
430
|
+
? value
|
|
431
|
+
: typeof value === "string"
|
|
432
|
+
? { preset: value, properties: propertiesKey }
|
|
433
|
+
: { ...value, properties: propertiesKey };
|
|
434
|
+
return { transition: applyMotionConfig(scoped, config) };
|
|
435
|
+
},
|
|
436
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the value, not its identity
|
|
437
|
+
[reduced, valueKey, propertiesKey, config],
|
|
438
|
+
);
|
|
479
439
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { type useTheme, variableToString } from "@knitui/core";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Resolve a
|
|
5
|
-
* `react-native-svg` can paint
|
|
6
|
-
* `currentColor` itself. Cross-platform via Tamagui's
|
|
7
|
-
* web → `var(--
|
|
8
|
-
* (`variable.val`); both are valid SVG `fill`/`stroke` values.
|
|
4
|
+
* Resolve a theme colour NAME (`color9`, `blue9`, `borderColor`; or an
|
|
5
|
+
* already-concrete colour) to a value that `react-native-svg` can paint — it
|
|
6
|
+
* can't resolve theme keys or `currentColor` itself. Cross-platform via Tamagui's
|
|
7
|
+
* `variableToString`: web → `var(--color9)` (tracks the theme via CSS), native →
|
|
8
|
+
* the raw colour (`variable.val`); both are valid SVG `fill`/`stroke` values.
|
|
9
9
|
*
|
|
10
|
-
* THE single place icon
|
|
10
|
+
* THE single place icon colour resolution lives, shared by `ControlIconProvider`
|
|
11
11
|
* and the in-component glyph icons (Checkbox/Chip/Combobox chevron), so the
|
|
12
|
-
* (
|
|
13
|
-
*
|
|
12
|
+
* (name → concrete) rule can't drift between them. v3 has no `$` sigil: the
|
|
13
|
+
* active theme IS the oracle — a key it defines resolves, anything else (`#fff`,
|
|
14
|
+
* `rgb(…)`, an unknown name) passes through unchanged.
|
|
14
15
|
*/
|
|
15
16
|
export const resolveThemeColor = (theme: ReturnType<typeof useTheme>, color: string): string => {
|
|
16
|
-
const
|
|
17
|
-
const value = key ? theme[key as keyof typeof theme] : undefined;
|
|
17
|
+
const value = color ? theme[color as keyof typeof theme] : undefined;
|
|
18
18
|
return value ? variableToString(value) : color;
|
|
19
19
|
};
|