@knitui/components 0.14.0 → 1.1.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 +128 -62
- package/lib/commonjs/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/commonjs/Affix/Affix.js +17 -21
- package/lib/commonjs/Affix/Affix.js.map +1 -1
- package/lib/commonjs/Alert/Alert.js +54 -54
- 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 +28 -25
- 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 +60 -49
- 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 +105 -63
- 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 +12 -5
- 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 +54 -35
- 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.js +4 -1
- package/lib/commonjs/Modal/drag/DragDismissHost.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.js +4 -1
- package/lib/commonjs/Modal/drag/DragDismissOverlay.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/drag/useDragDismiss.js +83 -67
- package/lib/commonjs/Modal/drag/useDragDismiss.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 +24 -11
- 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 +40 -34
- 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 +34 -23
- package/lib/commonjs/Popover/Popover.shared.js.map +1 -1
- package/lib/commonjs/Portal/OverlayHost.js.map +1 -1
- package/lib/commonjs/Portal/OverlayPortal.js +33 -0
- package/lib/commonjs/Portal/OverlayPortal.js.map +1 -0
- package/lib/commonjs/Portal/index.js +7 -0
- package/lib/commonjs/Portal/index.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 +46 -41
- 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 +10 -6
- 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 +44 -28
- 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 +12 -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 +18 -8
- package/lib/commonjs/internal/gradient-shared.js.map +1 -1
- package/lib/commonjs/internal/gradient.js +6 -0
- package/lib/commonjs/internal/gradient.js.map +1 -1
- package/lib/commonjs/internal/gradient.native.js +7 -1
- package/lib/commonjs/internal/gradient.native.js.map +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-looping-animation.native.js +1 -1
- package/lib/commonjs/internal/use-looping-animation.native.js.map +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 +130 -64
- package/lib/module/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/module/Affix/Affix.js +19 -23
- package/lib/module/Affix/Affix.js.map +1 -1
- package/lib/module/Alert/Alert.js +56 -56
- 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 +31 -28
- 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 +63 -52
- 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 +107 -65
- 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 +14 -7
- 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 +56 -37
- 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.js +4 -1
- package/lib/module/Modal/drag/DragDismissHost.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.js +4 -1
- package/lib/module/Modal/drag/DragDismissOverlay.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/drag/useDragDismiss.js +84 -68
- package/lib/module/Modal/drag/useDragDismiss.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 +25 -12
- 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 +42 -36
- 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 +36 -25
- package/lib/module/Popover/Popover.shared.js.map +1 -1
- package/lib/module/Portal/OverlayHost.js.map +1 -1
- package/lib/module/Portal/OverlayPortal.js +28 -0
- package/lib/module/Portal/OverlayPortal.js.map +1 -0
- package/lib/module/Portal/index.js +4 -0
- package/lib/module/Portal/index.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 +48 -43
- 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 +12 -8
- 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 +46 -30
- 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 +9 -5
- 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 +16 -7
- package/lib/module/internal/gradient-shared.js.map +1 -1
- package/lib/module/internal/gradient.js +2 -0
- package/lib/module/internal/gradient.js.map +1 -1
- package/lib/module/internal/gradient.native.js +3 -1
- package/lib/module/internal/gradient.native.js.map +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-looping-animation.native.js +1 -1
- package/lib/module/internal/use-looping-animation.native.js.map +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 +174 -198
- 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 +53 -121
- package/lib/typescript/Image/Image.d.ts.map +1 -1
- package/lib/typescript/Image/Image.native.d.ts +54 -122
- package/lib/typescript/Image/Image.native.d.ts.map +1 -1
- package/lib/typescript/Image/createImage.d.ts +56 -364
- 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 +13 -15
- 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.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/DragDismissHost.web.d.ts.map +1 -1
- package/lib/typescript/Modal/drag/DragDismissOverlay.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/drag/useDragDismiss.d.ts +2 -2
- package/lib/typescript/Modal/drag/useDragDismiss.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/Portal/OverlayHost.d.ts +2 -2
- package/lib/typescript/Portal/OverlayHost.d.ts.map +1 -1
- package/lib/typescript/Portal/OverlayPortal.d.ts +19 -0
- package/lib/typescript/Portal/OverlayPortal.d.ts.map +1 -0
- package/lib/typescript/Portal/index.d.ts +4 -0
- package/lib/typescript/Portal/index.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 +3 -2
- 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 +9 -8
- package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
- package/lib/typescript/internal/gradient.d.ts +1 -0
- package/lib/typescript/internal/gradient.d.ts.map +1 -1
- package/lib/typescript/internal/gradient.native.d.ts +1 -0
- package/lib/typescript/internal/gradient.native.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/use-looping-animation.native.d.ts +2 -2
- package/lib/typescript/internal/use-looping-animation.native.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 +14 -13
- package/src/Accordion/Accordion.tsx +55 -47
- package/src/ActionIcon/ActionIcon.tsx +116 -59
- package/src/Affix/Affix.tsx +16 -27
- package/src/Alert/Alert.tsx +57 -44
- 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 +44 -36
- package/src/BackgroundImage/BackgroundImage.tsx +9 -6
- package/src/Badge/Badge.tsx +55 -30
- 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 +106 -80
- 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 +32 -13
- 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 +536 -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 +34 -33
- 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.tsx +10 -5
- package/src/Modal/drag/DragDismissHost.web.tsx +2 -1
- package/src/Modal/drag/DragDismissOverlay.tsx +9 -5
- 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/drag/useDragDismiss.ts +29 -21
- 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 +14 -12
- 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 +44 -32
- 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 +32 -27
- package/src/Portal/OverlayHost.tsx +4 -4
- package/src/Portal/OverlayPortal.tsx +26 -0
- package/src/Portal/index.ts +4 -0
- 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 +66 -59
- 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 +38 -23
- package/src/Title/Title.tsx +48 -23
- package/src/Tooltip/Tooltip.tsx +53 -32
- 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 +32 -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 +23 -10
- package/src/internal/gradient.native.tsx +2 -1
- package/src/internal/gradient.tsx +1 -0
- 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-looping-animation.native.tsx +2 -2
- package/src/internal/use-slot-text-wrapper.tsx +1 -1
- package/src/internal/variant-colors.ts +187 -151
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type RadiusTokens,
|
|
7
|
-
styled,
|
|
8
|
-
withStaticProperties,
|
|
9
|
-
} from "@knitui/core";
|
|
10
|
-
|
|
11
|
-
import { Box } from "../Box";
|
|
3
|
+
import { type GetProps, isWeb, type RadiusTokens, withStaticProperties } from "@knitui/core";
|
|
4
|
+
|
|
5
|
+
import { type Box } from "../Box";
|
|
12
6
|
import { type Placement } from "../floating";
|
|
13
7
|
import {
|
|
14
8
|
type ArrowPosition,
|
|
@@ -18,10 +12,15 @@ import {
|
|
|
18
12
|
import { type FloatingOffset } from "../internal/floating-offset";
|
|
19
13
|
import { type MotionPresetName } from "../internal/motion";
|
|
20
14
|
import { useOverlayChrome } from "../internal/overlay-chrome";
|
|
21
|
-
import { hoverProps, shadowVariant } from "../internal/style-props";
|
|
15
|
+
import { hoverProps, type shadowVariant } from "../internal/style-props";
|
|
22
16
|
import { type SlotStyles } from "../internal/styles";
|
|
23
17
|
import { type OverlayProps } from "../Overlay";
|
|
24
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
Popover,
|
|
20
|
+
type PopoverDropdownProps,
|
|
21
|
+
type PopoverDropdownStyle,
|
|
22
|
+
type PopoverProps,
|
|
23
|
+
} from "../Popover";
|
|
25
24
|
import { type OverlayTransitionConfig } from "../Transition/use-overlay-transition";
|
|
26
25
|
|
|
27
26
|
export type HoverCardPosition = Placement;
|
|
@@ -62,24 +61,6 @@ const useHoverCardContext = (): HoverCardContextValue => {
|
|
|
62
61
|
return ctx;
|
|
63
62
|
};
|
|
64
63
|
|
|
65
|
-
/* -------------------------------------------------------------------------- */
|
|
66
|
-
/* Styled dropdown frame */
|
|
67
|
-
/* -------------------------------------------------------------------------- */
|
|
68
|
-
|
|
69
|
-
const HoverCardDropdownFrame = styled(Box, {
|
|
70
|
-
name: "HoverCardDropdown",
|
|
71
|
-
// `fixed` is viewport-relative positioning that only exists on web; React
|
|
72
|
-
// Native supports `absolute`/`relative`/`static` only. The instance mirrors
|
|
73
|
-
// Popover/Tooltip and uses the platform-correct value.
|
|
74
|
-
position: isWeb ? ("fixed" as const) : ("absolute" as const),
|
|
75
|
-
padding: "$md",
|
|
76
|
-
|
|
77
|
-
variants: {
|
|
78
|
-
hidden: { true: { display: "none" } },
|
|
79
|
-
shadow: shadowVariant,
|
|
80
|
-
} as const,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
64
|
/**
|
|
84
65
|
* The appearance-only subset of {@link FloatingArrowProps} a consumer may style
|
|
85
66
|
* via the `arrow` slot. The positioning-driven props stay internally controlled.
|
|
@@ -102,7 +83,7 @@ export interface HoverCardStyles {
|
|
|
102
83
|
/** Props spread onto the `Overlay` scrim (under `overlayProps`). */
|
|
103
84
|
overlay?: Partial<OverlayProps>;
|
|
104
85
|
/** Props spread onto the dropdown frame (`HoverCard.Dropdown`). */
|
|
105
|
-
dropdown?:
|
|
86
|
+
dropdown?: PopoverDropdownStyle;
|
|
106
87
|
/** Appearance props for the arrow; positioning stays internal. */
|
|
107
88
|
arrow?: FloatingArrowStyle;
|
|
108
89
|
}
|
|
@@ -410,7 +391,11 @@ function HoverCardTarget({ children, refProp = "ref" }: HoverCardTargetProps) {
|
|
|
410
391
|
/* Dropdown */
|
|
411
392
|
/* -------------------------------------------------------------------------- */
|
|
412
393
|
|
|
413
|
-
|
|
394
|
+
/**
|
|
395
|
+
* `HoverCard.Dropdown` renders through `Popover.Dropdown` (positioning, portal,
|
|
396
|
+
* theme, arrow, transition), so it takes exactly that part's props.
|
|
397
|
+
*/
|
|
398
|
+
export type HoverCardDropdownProps = PopoverDropdownProps;
|
|
414
399
|
|
|
415
400
|
function HoverCardDropdown({ children, ...rest }: HoverCardDropdownProps) {
|
|
416
401
|
const ctx = useHoverCardContext();
|
|
@@ -421,7 +406,7 @@ function HoverCardDropdown({ children, ...rest }: HoverCardDropdownProps) {
|
|
|
421
406
|
// top: keep the card open while the pointer is over the dropdown.
|
|
422
407
|
return (
|
|
423
408
|
<Popover.Dropdown
|
|
424
|
-
padding="
|
|
409
|
+
padding="md"
|
|
425
410
|
// Keep open while the pointer is over the dropdown.
|
|
426
411
|
{...hoverProps({ onHoverIn: ctx.cancel, onHoverOut: ctx.closeDropdown })}
|
|
427
412
|
{...rest}
|
|
@@ -14,7 +14,7 @@ import { objectFitToContentFit } from "./shared";
|
|
|
14
14
|
* `cachePolicy`, `tintColor`, `blurRadius`, `priority`, …) it adds the unified,
|
|
15
15
|
* Mantine-compatible API: `src`, `fit`/`objectFit` (→ `contentFit`),
|
|
16
16
|
* `objectPosition` (→ `contentPosition`), `radius`, `fallbackSrc`, plus Tamagui
|
|
17
|
-
* styling props (`w`, `h`, `bg`,
|
|
17
|
+
* styling props (`w`, `h`, `bg`, token names). expo-image's static methods
|
|
18
18
|
* (`Image.prefetch`, `Image.clearMemoryCache`, …) are forwarded as-is.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
@@ -3,15 +3,18 @@ import type { ComponentProps, ComponentType } from "react";
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
type GetProps,
|
|
6
|
-
getTokenValue,
|
|
7
6
|
isWeb,
|
|
7
|
+
resolveToken,
|
|
8
|
+
styleable,
|
|
8
9
|
styled,
|
|
9
10
|
View,
|
|
10
11
|
withStaticProperties,
|
|
11
12
|
} from "@knitui/core";
|
|
12
13
|
import { useCallbackRef, useMergedRef } from "@knitui/hooks";
|
|
13
14
|
|
|
15
|
+
import { shadowVariant } from "../internal/style-props";
|
|
14
16
|
import { slotStyles, type SlotStyles } from "../internal/styles";
|
|
17
|
+
import { themeColorToCssVar } from "../internal/theme-color-web";
|
|
15
18
|
import {
|
|
16
19
|
attachImageStatics,
|
|
17
20
|
normalizeContentPosition,
|
|
@@ -42,19 +45,14 @@ type ImageLoadLikeEvent = {
|
|
|
42
45
|
};
|
|
43
46
|
};
|
|
44
47
|
type ComponentWithImageStatics = Partial<ImageType>;
|
|
45
|
-
type TokenValueInput = Parameters<typeof getTokenValue>[0];
|
|
46
48
|
type ImageLoadEvent = Parameters<NonNullable<ImageProps["onLoad"]>>[0];
|
|
47
49
|
type ImageErrorEvent = Parameters<NonNullable<ImageProps["onError"]>>[0];
|
|
48
50
|
|
|
49
|
-
// Radius/size token keys, matching the canonical set in internal/style-props.
|
|
50
|
-
// Missing keys silently drop to no-radius, so this must stay in sync.
|
|
51
|
-
const SIZE_KEYS = new Set(["xxs", "xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
52
|
-
|
|
53
51
|
/**
|
|
54
52
|
* Internal alias the unified `transition` prop is forwarded under. expo-image's
|
|
55
|
-
* `transition` (a numeric fade duration / config) collides with Tamagui
|
|
53
|
+
* `transition` (a numeric fade duration / config) collides with Tamagui's
|
|
56
54
|
* reserved `transition` animation prop: Tamagui treats ANY component where
|
|
57
|
-
* `"transition" in props` as animated (
|
|
55
|
+
* `"transition" in props` as animated (v3 still does) and
|
|
58
56
|
* engages its animation driver. On web that driver calls `getComputedStyle(host)`,
|
|
59
57
|
* but the backing expo-image host ref is not a DOM `Element`, so it throws
|
|
60
58
|
* ("parameter 1 is not of type 'Element'") and blanks the tree. We therefore
|
|
@@ -171,10 +169,6 @@ export const resolveRadiusValue = (
|
|
|
171
169
|
): unknown => {
|
|
172
170
|
if (typeof value === "number" || value == null) return value;
|
|
173
171
|
|
|
174
|
-
if (typeof value === "object" && "isVar" in value && "val" in value) {
|
|
175
|
-
return resolveRadiusValue(value.val, dimensions);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
172
|
if (typeof value !== "string") return value;
|
|
179
173
|
|
|
180
174
|
// Percentages (e.g. "50%" for circular avatars). expo-image's web build
|
|
@@ -195,13 +189,43 @@ export const resolveRadiusValue = (
|
|
|
195
189
|
return basis !== undefined ? basis * fraction : 9999;
|
|
196
190
|
}
|
|
197
191
|
|
|
198
|
-
|
|
199
|
-
|
|
192
|
+
// A radius token (`"md"`, `"radius.md"`) resolves through the active config.
|
|
193
|
+
const token = resolveToken(value, "radius");
|
|
194
|
+
if (token !== undefined) return token;
|
|
200
195
|
|
|
201
196
|
const numericValue = Number.parseFloat(value);
|
|
202
197
|
return Number.isFinite(numericValue) ? numericValue : undefined;
|
|
203
198
|
};
|
|
204
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Colour style props (longhand or the kit's shorthand) that v3 drops when it
|
|
202
|
+
* styles a NON-Tamagui host such as the image backend: theme names
|
|
203
|
+
* (`bg="color3"`) never reach the DOM. On web they are lifted into the inline
|
|
204
|
+
* style as the theme's CSS variable (theme-free, follows theme changes).
|
|
205
|
+
*/
|
|
206
|
+
const COLOR_STYLE_KEYS: Readonly<Record<string, string>> = {
|
|
207
|
+
bg: "backgroundColor",
|
|
208
|
+
backgroundColor: "backgroundColor",
|
|
209
|
+
borderColor: "borderColor",
|
|
210
|
+
borderTopColor: "borderTopColor",
|
|
211
|
+
borderRightColor: "borderRightColor",
|
|
212
|
+
borderBottomColor: "borderBottomColor",
|
|
213
|
+
borderLeftColor: "borderLeftColor",
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/** Web: pull theme-name colour props out of `rest` into an inline style block. */
|
|
217
|
+
function liftWebColors(rest: Record<string, unknown>): Record<string, string> | undefined {
|
|
218
|
+
if (!isWeb) return undefined;
|
|
219
|
+
let lifted: Record<string, string> | undefined;
|
|
220
|
+
for (const key in COLOR_STYLE_KEYS) {
|
|
221
|
+
const value = rest[key];
|
|
222
|
+
if (typeof value !== "string") continue;
|
|
223
|
+
(lifted ??= {})[COLOR_STYLE_KEYS[key]!] = themeColorToCssVar(value);
|
|
224
|
+
delete rest[key];
|
|
225
|
+
}
|
|
226
|
+
return lifted;
|
|
227
|
+
}
|
|
228
|
+
|
|
205
229
|
/** Frames `useWebCachedImageLoad` waits for the backend to put its `<img>` in the DOM. */
|
|
206
230
|
const CACHED_LOAD_MAX_FRAMES = 10;
|
|
207
231
|
|
|
@@ -282,10 +306,14 @@ function useWebCachedImageLoad(
|
|
|
282
306
|
return { ref, onLoad: isWeb && onLoad ? handleLoad : onLoad };
|
|
283
307
|
}
|
|
284
308
|
|
|
285
|
-
/**
|
|
309
|
+
/**
|
|
310
|
+
* Resolve a size-token dimension (`"md"`) to its raw value, passing numbers and
|
|
311
|
+
* CSS lengths (`"100%"`, `"auto"`) through. The raw value both sizes the frame
|
|
312
|
+
* and, when numeric, becomes the backend source's intrinsic width/height.
|
|
313
|
+
*/
|
|
286
314
|
const resolveDimension = (value: ImageDimension): ImageDimension =>
|
|
287
|
-
typeof value === "string"
|
|
288
|
-
? (
|
|
315
|
+
typeof value === "string"
|
|
316
|
+
? ((resolveToken(value, "size") as ImageDimension | undefined) ?? value)
|
|
289
317
|
: value;
|
|
290
318
|
|
|
291
319
|
/**
|
|
@@ -349,7 +377,7 @@ type ImageContextValue = {
|
|
|
349
377
|
*
|
|
350
378
|
* You then get every expo-image prop (transition, placeholder, cachePolicy, …)
|
|
351
379
|
* plus the unified API (`src`, `fit`/`objectFit`, `objectPosition`, `radius`,
|
|
352
|
-
* `fallbackSrc`) and Tamagui styling (`w`, `h`, `bg`,
|
|
380
|
+
* `fallbackSrc`) and Tamagui styling (`w`, `h`, `bg`, token names like `"md"`).
|
|
353
381
|
* <Image src="https://example.com/photo.jpg" fit="cover" transition={300} radius="md" />
|
|
354
382
|
*
|
|
355
383
|
* @example
|
|
@@ -402,7 +430,11 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
402
430
|
const StyledImage = styled(
|
|
403
431
|
BaseComponent,
|
|
404
432
|
{
|
|
405
|
-
|
|
433
|
+
displayName: "Image",
|
|
434
|
+
variants: {
|
|
435
|
+
// The shared elevation ladder (`shadow="md"`), as on `Box`.
|
|
436
|
+
shadow: shadowVariant,
|
|
437
|
+
} as const,
|
|
406
438
|
},
|
|
407
439
|
{
|
|
408
440
|
inlineProps: inlinePropsSet,
|
|
@@ -417,14 +449,40 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
417
449
|
const ImageContext = React.createContext<ImageContextValue | undefined>(undefined);
|
|
418
450
|
|
|
419
451
|
/**
|
|
420
|
-
* The
|
|
421
|
-
* `
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
452
|
+
* The unified-API props: the engine's own surface plus an optional per-slot
|
|
453
|
+
* `styles` map and the legacy `fallbackProps` (both target the backing image).
|
|
454
|
+
*/
|
|
455
|
+
type SugarProps = CombinedProps & {
|
|
456
|
+
/** Per-slot style sugar — props spread onto the matching part. */
|
|
457
|
+
styles?: SlotStyles<ImageStyles>;
|
|
458
|
+
/** Props spread onto the backing image (alias for `styles.image`). */
|
|
459
|
+
fallbackProps?: Partial<ImageProps>;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* The backing image — the engine, and also the public `Image` itself (the
|
|
464
|
+
* sugar used to be a separate wrapper; folding it in saves one component
|
|
465
|
+
* layer per image, which adds up in long lists). Resolves the unified API
|
|
466
|
+
* (`src`/`fit`/`radius`/`fallbackSrc`/`objectPosition`) and the
|
|
467
|
+
* cross-platform load/error events, then renders through the Tamagui-styled
|
|
468
|
+
* wrapper. When rendered under an `Image.Root` it reads/updates the shared
|
|
469
|
+
* fallback state via context; standalone it owns its own state via
|
|
470
|
+
* `useImageFallback`.
|
|
425
471
|
*/
|
|
426
|
-
const ImagePart =
|
|
427
|
-
const
|
|
472
|
+
const ImagePart = styleable<SugarProps>(StyledImage, function Image(incomingProps, ref) {
|
|
473
|
+
const { styles, fallbackProps, ...direct } = incomingProps as SugarProps;
|
|
474
|
+
// Engine props win over the per-slot sugar (explicit beats sugar); the image
|
|
475
|
+
// slot and the legacy `fallbackProps` are the same target. Only allocate a
|
|
476
|
+
// merged object when either sugar is present.
|
|
477
|
+
const props = (
|
|
478
|
+
styles || fallbackProps
|
|
479
|
+
? {
|
|
480
|
+
...slotStyles<ImageStyles>(styles, IMAGE_SLOT_KEYS, "Image").get("image"),
|
|
481
|
+
...fallbackProps,
|
|
482
|
+
...direct,
|
|
483
|
+
}
|
|
484
|
+
: direct
|
|
485
|
+
) as CombinedProps;
|
|
428
486
|
const {
|
|
429
487
|
src,
|
|
430
488
|
source,
|
|
@@ -472,6 +530,8 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
472
530
|
const incomingStyle = Array.isArray(rest.style)
|
|
473
531
|
? Object.assign({}, ...rest.style.flat())
|
|
474
532
|
: rest.style;
|
|
533
|
+
// `rest` is this render's own object (a destructuring rest), safe to edit.
|
|
534
|
+
const liftedColors = liftWebColors(rest as Record<string, unknown>);
|
|
475
535
|
|
|
476
536
|
const resolvedBorderRadius = resolveRadiusValue(radius ?? borderRadius, {
|
|
477
537
|
width: resolvedWidth,
|
|
@@ -506,6 +566,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
506
566
|
...rest,
|
|
507
567
|
source: finalSource,
|
|
508
568
|
style: {
|
|
569
|
+
...liftedColors,
|
|
509
570
|
...incomingStyle,
|
|
510
571
|
...(resolvedBorderRadius !== undefined && { borderRadius: resolvedBorderRadius }),
|
|
511
572
|
...(resolvedWidth !== undefined && { width: resolvedWidth }),
|
|
@@ -587,11 +648,11 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
587
648
|
};
|
|
588
649
|
|
|
589
650
|
const RootFrame = styled(View, {
|
|
590
|
-
|
|
651
|
+
displayName: "ImageRoot",
|
|
591
652
|
position: "relative",
|
|
592
653
|
});
|
|
593
654
|
|
|
594
|
-
const Root =
|
|
655
|
+
const Root = styleable<RootProps>(RootFrame, (props, ref) => {
|
|
595
656
|
// Split children out at runtime without forming `CombinedProps & {children}`
|
|
596
657
|
// — that intersection overflows the checker (TS2590). The remaining props are
|
|
597
658
|
// the unified image API, re-typed for the `.src`/`.source` reads below.
|
|
@@ -635,7 +696,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
635
696
|
* (and no usable `fallbackSrc` rendered). Layers absolutely over the image.
|
|
636
697
|
*/
|
|
637
698
|
const FallbackFrame = styled(View, {
|
|
638
|
-
|
|
699
|
+
displayName: "ImageFallback",
|
|
639
700
|
position: "absolute",
|
|
640
701
|
top: 0,
|
|
641
702
|
left: 0,
|
|
@@ -645,7 +706,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
645
706
|
justifyContent: "center",
|
|
646
707
|
});
|
|
647
708
|
|
|
648
|
-
const Fallback =
|
|
709
|
+
const Fallback = styleable<GetProps<typeof FallbackFrame>>(FallbackFrame, (props, ref) => {
|
|
649
710
|
const ctx = React.useContext(ImageContext);
|
|
650
711
|
if (ctx && !ctx.errored) return null;
|
|
651
712
|
return <FallbackFrame ref={ref} {...props} />;
|
|
@@ -656,7 +717,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
656
717
|
* displayed and has not errored. Layers absolutely over the image.
|
|
657
718
|
*/
|
|
658
719
|
const PlaceholderFrame = styled(View, {
|
|
659
|
-
|
|
720
|
+
displayName: "ImagePlaceholder",
|
|
660
721
|
position: "absolute",
|
|
661
722
|
top: 0,
|
|
662
723
|
left: 0,
|
|
@@ -666,7 +727,8 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
666
727
|
justifyContent: "center",
|
|
667
728
|
});
|
|
668
729
|
|
|
669
|
-
const Placeholder =
|
|
730
|
+
const Placeholder = styleable<GetProps<typeof PlaceholderFrame>>(
|
|
731
|
+
PlaceholderFrame,
|
|
670
732
|
(props, ref) => {
|
|
671
733
|
const ctx = React.useContext(ImageContext);
|
|
672
734
|
if (ctx && (ctx.loaded || ctx.errored)) return null;
|
|
@@ -679,7 +741,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
679
741
|
* captions). Unlike `Fallback`/`Placeholder` it does not depend on load state.
|
|
680
742
|
*/
|
|
681
743
|
const Overlay = styled(View, {
|
|
682
|
-
|
|
744
|
+
displayName: "ImageOverlay",
|
|
683
745
|
position: "absolute",
|
|
684
746
|
top: 0,
|
|
685
747
|
left: 0,
|
|
@@ -687,36 +749,7 @@ export function createImage<C extends ComponentType<Record<string, unknown>>>(
|
|
|
687
749
|
bottom: 0,
|
|
688
750
|
});
|
|
689
751
|
|
|
690
|
-
|
|
691
|
-
* The unified-API sugar. Thin wrapper over the engine: it accepts the classic
|
|
692
|
-
* `<Image src=… fallbackSrc=… />` surface (rendering the backing image
|
|
693
|
-
* directly so the host `<img>` stays the queryable/ref'd element), plus an
|
|
694
|
-
* optional per-slot `styles` map and `fallbackProps`. For multi-layer
|
|
695
|
-
* composition use the `Image.Root` + parts form.
|
|
696
|
-
*/
|
|
697
|
-
type SugarProps = CombinedProps & {
|
|
698
|
-
/** Per-slot style sugar — props spread onto the matching part. */
|
|
699
|
-
styles?: SlotStyles<ImageStyles>;
|
|
700
|
-
/** Props spread onto the backing image (alias for `styles.image`). */
|
|
701
|
-
fallbackProps?: Partial<ImageProps>;
|
|
702
|
-
};
|
|
703
|
-
|
|
704
|
-
const ImageComponent = StyledImage.styleable<SugarProps>((incomingProps, ref) => {
|
|
705
|
-
const { styles, fallbackProps, ...rest } = incomingProps as SugarProps;
|
|
706
|
-
const s = slotStyles<ImageStyles>(styles, IMAGE_SLOT_KEYS, "Image");
|
|
707
|
-
// Engine props win over the per-slot sugar (explicit beats sugar); the
|
|
708
|
-
// image slot and the legacy `fallbackProps` are the same target.
|
|
709
|
-
return (
|
|
710
|
-
<ImagePartLoose
|
|
711
|
-
ref={ref}
|
|
712
|
-
{...s.get("image")}
|
|
713
|
-
{...fallbackProps}
|
|
714
|
-
{...(rest as CombinedProps)}
|
|
715
|
-
/>
|
|
716
|
-
);
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
const ImageWithParts = withStaticProperties(ImageComponent, {
|
|
752
|
+
const ImageWithParts = withStaticProperties(ImagePart, {
|
|
720
753
|
Root,
|
|
721
754
|
Image: ImagePart,
|
|
722
755
|
Fallback,
|
package/src/Image/types.ts
CHANGED
|
@@ -8,6 +8,8 @@ import type {
|
|
|
8
8
|
|
|
9
9
|
import type { TamaguiElement, ViewProps } from "@knitui/core";
|
|
10
10
|
|
|
11
|
+
import type { ShadowKey } from "../internal/style-props";
|
|
12
|
+
|
|
11
13
|
/** CSS `object-fit` values — identical to expo-image's `contentFit` enum. */
|
|
12
14
|
export type ImageObjectFit = "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
13
15
|
/** CSS `object-position` value — accepts expo-image's richer `ImageContentPosition`. */
|
|
@@ -78,7 +80,7 @@ type ForwardedExpoProps = Pick<
|
|
|
78
80
|
|
|
79
81
|
/**
|
|
80
82
|
* Props for the cross-platform `Image`. Combines:
|
|
81
|
-
* - Tamagui `ViewProps` for styling (width, height, bg, margins,
|
|
83
|
+
* - Tamagui `ViewProps` for styling (width, height, bg, margins, token names…),
|
|
82
84
|
* - the forwarded expo-image surface (`ForwardedExpoProps`),
|
|
83
85
|
* - Mantine-compatible aliases (`fit`, `radius`, `fallbackSrc`, `src`),
|
|
84
86
|
* - cross-platform-normalised `onLoad`/`onError` handlers.
|
|
@@ -90,6 +92,8 @@ export type ImageProps = Omit<ViewProps, "transition"> &
|
|
|
90
92
|
* Mirrors Mantine's `radius` prop.
|
|
91
93
|
*/
|
|
92
94
|
radius?: string | number;
|
|
95
|
+
/** Elevation from the shared shadow ladder (`"xs"`…`"xxl"`), as on `Box`. */
|
|
96
|
+
shadow?: ShadowKey;
|
|
93
97
|
/**
|
|
94
98
|
* How the image should be resized to fit its container. Mantine-compatible
|
|
95
99
|
* alias for `contentFit`/`objectFit`.
|
|
@@ -3,7 +3,8 @@ import * as React from "react";
|
|
|
3
3
|
import {
|
|
4
4
|
DURATIONS,
|
|
5
5
|
type GetProps,
|
|
6
|
-
|
|
6
|
+
resolveToken,
|
|
7
|
+
styleable,
|
|
7
8
|
styled,
|
|
8
9
|
withStaticProperties,
|
|
9
10
|
} from "@knitui/core";
|
|
@@ -17,9 +18,8 @@ import { Text } from "../Text";
|
|
|
17
18
|
|
|
18
19
|
export type IndicatorSize = SizeKey;
|
|
19
20
|
type IndicatorOffsetToken = "0" | IndicatorSize;
|
|
20
|
-
type IndicatorOffset = number | IndicatorOffsetToken |
|
|
21
|
+
type IndicatorOffset = number | IndicatorOffsetToken | `${IndicatorOffsetToken}`;
|
|
21
22
|
type IndicatorOffsetObject = { x: IndicatorOffset; y: IndicatorOffset };
|
|
22
|
-
type TokenValueInput = Parameters<typeof getTokenValue>[0];
|
|
23
23
|
|
|
24
24
|
const DEFAULT_SIZE: IndicatorSize = "xxs";
|
|
25
25
|
const SIZE_KEYS = new Set<IndicatorSize>(["xxs", "xs", "sm", "md", "lg", "xl", "xxl"]);
|
|
@@ -46,7 +46,7 @@ export type IndicatorPosition =
|
|
|
46
46
|
/**
|
|
47
47
|
* Overlays a small dot or label badge on a corner/edge of its children —
|
|
48
48
|
* mirrors Mantine's `Indicator`. Accent comes from the `theme` prop + palette
|
|
49
|
-
* ramp (
|
|
49
|
+
* ramp (`color9` fill, `color1` contrast text), never a Mantine `color` prop.
|
|
50
50
|
* `position`/`offset`/`size`/`radius`/`withBorder`/`disabled`/`inline`/`label`/
|
|
51
51
|
* `processing` mirror Mantine's surface. On anchored edges the dot sits at the
|
|
52
52
|
* corner where it's defined and pokes out a few pixels past it (not centered on
|
|
@@ -54,7 +54,7 @@ export type IndicatorPosition =
|
|
|
54
54
|
* works on web AND native (no web-only `%` transforms).
|
|
55
55
|
*/
|
|
56
56
|
const IndicatorContainer = styled(Box, {
|
|
57
|
-
|
|
57
|
+
displayName: "Indicator",
|
|
58
58
|
position: "relative",
|
|
59
59
|
// Hug the wrapped content so the dot anchors to the child's box, not the row.
|
|
60
60
|
alignSelf: "flex-start",
|
|
@@ -71,20 +71,20 @@ const IndicatorContainer = styled(Box, {
|
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
const IndicatorDot = styled(Box, {
|
|
74
|
-
|
|
74
|
+
displayName: "IndicatorDot",
|
|
75
75
|
position: "absolute",
|
|
76
76
|
zIndex: 1,
|
|
77
77
|
alignItems: "center",
|
|
78
78
|
justifyContent: "center",
|
|
79
|
-
backgroundColor: "
|
|
79
|
+
backgroundColor: "color9",
|
|
80
80
|
borderRadius: 999,
|
|
81
81
|
borderWidth: 0,
|
|
82
|
-
borderColor: "
|
|
82
|
+
borderColor: "background",
|
|
83
83
|
variants: {
|
|
84
84
|
radius: radiusVariant,
|
|
85
85
|
/** Pad into a pill once there's a label to show. */
|
|
86
86
|
withLabel: {
|
|
87
|
-
true: { width: "auto", paddingHorizontal: "
|
|
87
|
+
true: { width: "auto", paddingHorizontal: "xxs" },
|
|
88
88
|
},
|
|
89
89
|
/** Ring in the page background so the dot reads against the target. */
|
|
90
90
|
withBorder: {
|
|
@@ -94,9 +94,7 @@ const IndicatorDot = styled(Box, {
|
|
|
94
94
|
disabled: {
|
|
95
95
|
true: { display: "none" },
|
|
96
96
|
},
|
|
97
|
-
size:
|
|
98
|
-
...squareSizeVariantFallthrough,
|
|
99
|
-
},
|
|
97
|
+
size: squareSizeVariantFallthrough,
|
|
100
98
|
} as const,
|
|
101
99
|
|
|
102
100
|
defaultVariants: { size: DEFAULT_SIZE },
|
|
@@ -109,16 +107,16 @@ const IndicatorDot = styled(Box, {
|
|
|
109
107
|
* on a single node clashes (`Invalid value passed to shareableViewDescriptors`).
|
|
110
108
|
* `asLoopHost` makes this a reanimated host on native (identity on web); the opacity
|
|
111
109
|
* composes down onto the dot, so the whole badge throbs. It stays a Tamagui `Box`
|
|
112
|
-
* (not the raw `LoopView`) so the
|
|
110
|
+
* (not the raw `LoopView`) so the token inset/offset values (`top="sm"`) still resolve.
|
|
113
111
|
*/
|
|
114
112
|
const IndicatorAnchor = asLoopHost(Box);
|
|
115
113
|
|
|
116
114
|
const IndicatorLabel = styled(Text, {
|
|
117
|
-
|
|
118
|
-
color: "
|
|
119
|
-
fontSize: "
|
|
115
|
+
displayName: "IndicatorLabel",
|
|
116
|
+
color: "color1",
|
|
117
|
+
fontSize: "xxs",
|
|
120
118
|
fontWeight: "700",
|
|
121
|
-
lineHeight: "
|
|
119
|
+
lineHeight: "xxs",
|
|
122
120
|
numberOfLines: 1,
|
|
123
121
|
userSelect: "none",
|
|
124
122
|
});
|
|
@@ -176,16 +174,21 @@ function resolveInset(
|
|
|
176
174
|
function resolveNumericSize(size: IndicatorSize | number | (string & {})): number | null {
|
|
177
175
|
if (typeof size === "number") return size;
|
|
178
176
|
if (!SIZE_KEYS.has(size as IndicatorSize)) return null;
|
|
179
|
-
const value =
|
|
177
|
+
const value = resolveToken(size, "size");
|
|
180
178
|
return typeof value === "number" ? value : null;
|
|
181
179
|
}
|
|
182
180
|
|
|
181
|
+
/**
|
|
182
|
+
* An offset is a px number or a bare space-token name (`"sm"`), which the inset
|
|
183
|
+
* style prop resolves itself. `"0"` is the zero inset, not a token.
|
|
184
|
+
*/
|
|
183
185
|
function resolveOffset(offset: IndicatorOffset): BoxProps["top"] {
|
|
184
|
-
if (typeof offset === "number") return offset;
|
|
185
|
-
|
|
186
|
-
return `$${offset}` as BoxProps["top"];
|
|
186
|
+
if (typeof offset === "number" || offset === "0") return Number(offset);
|
|
187
|
+
return offset;
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
const LABEL_WIDTH = { width: "auto" } as const;
|
|
191
|
+
|
|
189
192
|
function isOffsetObject(offset: IndicatorProps["offset"]): offset is IndicatorOffsetObject {
|
|
190
193
|
return typeof offset === "object" && offset != null;
|
|
191
194
|
}
|
|
@@ -194,8 +197,8 @@ function isOffsetObject(offset: IndicatorProps["offset"]): offset is IndicatorOf
|
|
|
194
197
|
* Named slots for {@link IndicatorStyles} (Pillar B / `internal/styles.ts`).
|
|
195
198
|
* Gives prop-API callers (who pass `label`/`size`/… rather than composing the
|
|
196
199
|
* parts) a handle on the dot and label. Each key maps to the props of the styled
|
|
197
|
-
* part it targets — `styles={{ dot: { backgroundColor: "
|
|
198
|
-
* `<Indicator.Dot backgroundColor="
|
|
200
|
+
* part it targets — `styles={{ dot: { backgroundColor: "red9" } }}` is sugar for
|
|
201
|
+
* `<Indicator.Dot backgroundColor="red9" />`.
|
|
199
202
|
*/
|
|
200
203
|
export interface IndicatorStyles {
|
|
201
204
|
/** Props spread onto the container that wraps the children (`.Frame`). */
|
|
@@ -231,7 +234,7 @@ export interface IndicatorProps extends Omit<
|
|
|
231
234
|
radius?: number | string;
|
|
232
235
|
/** Content inside the indicator (turns the dot into a pill badge). */
|
|
233
236
|
label?: React.ReactNode;
|
|
234
|
-
/** Adds a
|
|
237
|
+
/** Adds a `background` ring so the dot separates from the target. */
|
|
235
238
|
withBorder?: boolean;
|
|
236
239
|
/** Hide the indicator while still rendering children. */
|
|
237
240
|
disabled?: boolean;
|
|
@@ -245,12 +248,12 @@ export interface IndicatorProps extends Omit<
|
|
|
245
248
|
zIndex?: number;
|
|
246
249
|
/**
|
|
247
250
|
* Accepted for Mantine parity. Text already contrasts the accent fill via the
|
|
248
|
-
* ramp (
|
|
251
|
+
* ramp (`color1` on `color9`), so this is effectively always on.
|
|
249
252
|
*/
|
|
250
253
|
autoContrast?: boolean;
|
|
251
254
|
}
|
|
252
255
|
|
|
253
|
-
const IndicatorBase =
|
|
256
|
+
const IndicatorBase = styleable<IndicatorProps>(IndicatorContainer, function Indicator(props, ref) {
|
|
254
257
|
const {
|
|
255
258
|
children,
|
|
256
259
|
position = "top-end",
|
|
@@ -268,7 +271,7 @@ const IndicatorBase = IndicatorContainer.styleable<IndicatorProps>(function Indi
|
|
|
268
271
|
styles,
|
|
269
272
|
...rest
|
|
270
273
|
} = props;
|
|
271
|
-
void autoContrast; // contrast comes from the ramp (
|
|
274
|
+
void autoContrast; // contrast comes from the ramp (color1 on color9).
|
|
272
275
|
|
|
273
276
|
// Per-slot style sugar, distributed onto the parts below.
|
|
274
277
|
const s = slotStyles<IndicatorStyles>(styles, INDICATOR_SLOT_KEYS, "Indicator");
|
|
@@ -294,7 +297,12 @@ const IndicatorBase = IndicatorContainer.styleable<IndicatorProps>(function Indi
|
|
|
294
297
|
|
|
295
298
|
const offsetX = isOffsetObject(offset) ? offset.x : offset;
|
|
296
299
|
const offsetY = isOffsetObject(offset) ? offset.y : offset;
|
|
297
|
-
|
|
300
|
+
// Memoised: the inset object is handed to the anchor's style props, so a fresh
|
|
301
|
+
// object per render would defeat Tamagui's style caches.
|
|
302
|
+
const inset = React.useMemo(
|
|
303
|
+
() => resolveInset(position, size, offsetX, offsetY),
|
|
304
|
+
[position, size, offsetX, offsetY],
|
|
305
|
+
);
|
|
298
306
|
|
|
299
307
|
const hasLabel = label != null && label !== "";
|
|
300
308
|
const hideZero = !showZero && (label === 0 || label === "0");
|
|
@@ -325,7 +333,7 @@ const IndicatorBase = IndicatorContainer.styleable<IndicatorProps>(function Indi
|
|
|
325
333
|
disabled={disabled}
|
|
326
334
|
withBorder={withBorder}
|
|
327
335
|
withLabel={hasLabel}
|
|
328
|
-
radius
|
|
336
|
+
{...(radius !== undefined ? { radius } : null)}
|
|
329
337
|
size={size}
|
|
330
338
|
// Sit in the anchor's flow — the anchor owns the absolute corner
|
|
331
339
|
// placement, so the dot drops its styled `position: absolute`.
|
|
@@ -333,9 +341,10 @@ const IndicatorBase = IndicatorContainer.styleable<IndicatorProps>(function Indi
|
|
|
333
341
|
// `size` and `withLabel` both set `width`; `size` (the fixed square)
|
|
334
342
|
// would otherwise win and clip a multi-character label. Force `auto`
|
|
335
343
|
// when labelled so the pill grows to its text — `minWidth`/`height`
|
|
336
|
-
// from `size` still keep a bare dot circular.
|
|
337
|
-
width={
|
|
338
|
-
|
|
344
|
+
// from `size` still keep a bare dot circular. Conditional spread: an
|
|
345
|
+
// explicit `width={undefined}` would CLEAR the size variant's width.
|
|
346
|
+
{...(hasLabel ? LABEL_WIDTH : null)}
|
|
347
|
+
// The one-shot scale-in entrance is a v3 `enter:` clause transition,
|
|
339
348
|
// safe on this node now that the reanimated loop lives on the anchor.
|
|
340
349
|
{...entrance}
|
|
341
350
|
>
|