@knitui/components 0.4.0 → 0.6.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/lib/commonjs/Accordion/Accordion.js +10 -6
- package/lib/commonjs/Accordion/Accordion.js.map +1 -1
- package/lib/commonjs/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/commonjs/Alert/Alert.js +31 -11
- package/lib/commonjs/Alert/Alert.js.map +1 -1
- package/lib/commonjs/AngleSlider/AngleSlider.js +55 -17
- package/lib/commonjs/AngleSlider/AngleSlider.js.map +1 -1
- package/lib/commonjs/Autocomplete/Autocomplete.js +53 -33
- package/lib/commonjs/Autocomplete/Autocomplete.js.map +1 -1
- package/lib/commonjs/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/Badge/Badge.js +6 -9
- package/lib/commonjs/Badge/Badge.js.map +1 -1
- package/lib/commonjs/Button/Button.js +22 -6
- package/lib/commonjs/Button/Button.js.map +1 -1
- package/lib/commonjs/Card/Card.js +13 -4
- package/lib/commonjs/Card/Card.js.map +1 -1
- package/lib/commonjs/Checkbox/CheckIcon.js +10 -6
- package/lib/commonjs/Checkbox/CheckIcon.js.map +1 -1
- package/lib/commonjs/Checkbox/Checkbox.js +9 -2
- package/lib/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/Chip/Chip.js +15 -16
- package/lib/commonjs/Chip/Chip.js.map +1 -1
- package/lib/commonjs/CloseButton/CloseButton.js +2 -2
- package/lib/commonjs/CloseButton/CloseButton.js.map +1 -1
- package/lib/commonjs/ColorInput/ColorInput.js +12 -4
- package/lib/commonjs/ColorInput/ColorInput.js.map +1 -1
- package/lib/commonjs/ColorPicker/ColorPicker.js +32 -24
- package/lib/commonjs/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/commonjs/Combobox/Combobox.js +11 -6
- package/lib/commonjs/Combobox/Combobox.js.map +1 -1
- package/lib/commonjs/Combobox/OptionsDropdown.js +6 -2
- package/lib/commonjs/Combobox/OptionsDropdown.js.map +1 -1
- package/lib/commonjs/Group/Group.js +19 -11
- package/lib/commonjs/Group/Group.js.map +1 -1
- package/lib/commonjs/Highlight/Highlight.js +30 -10
- package/lib/commonjs/Highlight/Highlight.js.map +1 -1
- package/lib/commonjs/HoverCard/HoverCard.js +23 -10
- package/lib/commonjs/HoverCard/HoverCard.js.map +1 -1
- package/lib/commonjs/Indicator/Indicator.js +5 -1
- package/lib/commonjs/Indicator/Indicator.js.map +1 -1
- package/lib/commonjs/Input/Input.js +30 -12
- package/lib/commonjs/Input/Input.js.map +1 -1
- package/lib/commonjs/Input/shared.js +18 -8
- package/lib/commonjs/Input/shared.js.map +1 -1
- package/lib/commonjs/Loader/Loader.js +18 -10
- package/lib/commonjs/Loader/Loader.js.map +1 -1
- package/lib/commonjs/Menu/Menu.js +6 -7
- package/lib/commonjs/Menu/Menu.js.map +1 -1
- package/lib/commonjs/MultiSelect/MultiSelect.js +112 -47
- package/lib/commonjs/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/commonjs/Notification/Notification.js +31 -11
- package/lib/commonjs/Notification/Notification.js.map +1 -1
- package/lib/commonjs/NumberFormatter/NumberFormatter.js +48 -11
- package/lib/commonjs/NumberFormatter/NumberFormatter.js.map +1 -1
- package/lib/commonjs/Paper/Paper.js +8 -8
- package/lib/commonjs/Paper/Paper.js.map +1 -1
- package/lib/commonjs/Pill/Pill.js +6 -8
- package/lib/commonjs/Pill/Pill.js.map +1 -1
- package/lib/commonjs/PinInput/PinInput.js.map +1 -1
- package/lib/commonjs/Progress/Progress.js +4 -1
- package/lib/commonjs/Progress/Progress.js.map +1 -1
- package/lib/commonjs/RollingNumber/RollingNumber.js +30 -13
- package/lib/commonjs/RollingNumber/RollingNumber.js.map +1 -1
- package/lib/commonjs/RollingNumber/rolling-number-utils.js +27 -5
- package/lib/commonjs/RollingNumber/rolling-number-utils.js.map +1 -1
- package/lib/commonjs/ScrollArea/ScrollArea.js +131 -41
- package/lib/commonjs/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/commonjs/ScrollArea/ScrollArea.native.js +128 -40
- package/lib/commonjs/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/commonjs/SegmentedControl/SegmentedControl.js +4 -1
- package/lib/commonjs/SegmentedControl/SegmentedControl.js.map +1 -1
- package/lib/commonjs/Select/Select.js +64 -35
- package/lib/commonjs/Select/Select.js.map +1 -1
- package/lib/commonjs/Skeleton/Skeleton.js +6 -2
- package/lib/commonjs/Skeleton/Skeleton.js.map +1 -1
- package/lib/commonjs/Slider/Slider.js +136 -83
- package/lib/commonjs/Slider/Slider.js.map +1 -1
- package/lib/commonjs/Spoiler/Spoiler.js +22 -2
- package/lib/commonjs/Spoiler/Spoiler.js.map +1 -1
- package/lib/commonjs/Stepper/Stepper.js +2 -2
- package/lib/commonjs/Stepper/Stepper.js.map +1 -1
- package/lib/commonjs/Switch/Switch.js +18 -7
- package/lib/commonjs/Switch/Switch.js.map +1 -1
- package/lib/commonjs/Table/Table.js +91 -28
- package/lib/commonjs/Table/Table.js.map +1 -1
- package/lib/commonjs/TableOfContents/TableOfContents.js +4 -1
- package/lib/commonjs/TableOfContents/TableOfContents.js.map +1 -1
- package/lib/commonjs/TagsInput/TagsInput.js +138 -55
- package/lib/commonjs/TagsInput/TagsInput.js.map +1 -1
- package/lib/commonjs/ThemeIcon/ThemeIcon.js.map +1 -1
- package/lib/commonjs/Title/Title.js.map +1 -1
- package/lib/commonjs/Tooltip/Tooltip.js +27 -5
- package/lib/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/lib/commonjs/Transition/use-transition.js.map +1 -1
- package/lib/commonjs/Tree/Tree.js +4 -1
- package/lib/commonjs/Tree/Tree.js.map +1 -1
- package/lib/commonjs/Tree/tree-data.js +58 -23
- package/lib/commonjs/Tree/tree-data.js.map +1 -1
- package/lib/commonjs/Tree/use-tree.js +33 -4
- package/lib/commonjs/Tree/use-tree.js.map +1 -1
- package/lib/commonjs/TreeSelect/TreeSelect.js +70 -30
- package/lib/commonjs/TreeSelect/TreeSelect.js.map +1 -1
- package/lib/commonjs/Typography/Typography.js +10 -10
- package/lib/commonjs/Typography/Typography.js.map +1 -1
- package/lib/commonjs/UnstyledButton/UnstyledButton.js +8 -3
- package/lib/commonjs/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/commonjs/VirtualList/VirtualList.js +71 -13
- package/lib/commonjs/VirtualList/VirtualList.js.map +1 -1
- package/lib/commonjs/floating/platform.js +28 -1
- package/lib/commonjs/floating/platform.js.map +1 -1
- package/lib/commonjs/floating/use-position.js +33 -1
- package/lib/commonjs/floating/use-position.js.map +1 -1
- package/lib/commonjs/internal/ControlIconProvider.js +20 -15
- package/lib/commonjs/internal/ControlIconProvider.js.map +1 -1
- package/lib/commonjs/internal/gradient-shared.js +9 -5
- package/lib/commonjs/internal/gradient-shared.js.map +1 -1
- package/lib/commonjs/internal/gradient.js +21 -9
- package/lib/commonjs/internal/gradient.js.map +1 -1
- package/lib/commonjs/internal/gradient.native.js +36 -10
- package/lib/commonjs/internal/gradient.native.js.map +1 -1
- package/lib/commonjs/internal/render-text-child.js +30 -2
- package/lib/commonjs/internal/render-text-child.js.map +1 -1
- package/lib/commonjs/internal/style-props.js +17 -5
- package/lib/commonjs/internal/style-props.js.map +1 -1
- package/lib/commonjs/internal/theme-color-web.js +46 -0
- package/lib/commonjs/internal/theme-color-web.js.map +1 -0
- package/lib/commonjs/internal/use-icon-color.js +33 -0
- package/lib/commonjs/internal/use-icon-color.js.map +1 -0
- package/lib/commonjs/internal/use-icon-color.native.js +23 -0
- package/lib/commonjs/internal/use-icon-color.native.js.map +1 -0
- package/lib/commonjs/internal/use-looping-animation.js +7 -3
- package/lib/commonjs/internal/use-looping-animation.js.map +1 -1
- package/lib/commonjs/internal/use-looping-animation.native.js +9 -1
- package/lib/commonjs/internal/use-looping-animation.native.js.map +1 -1
- package/lib/commonjs/internal/use-looping-animation.shared.js +33 -0
- package/lib/commonjs/internal/use-looping-animation.shared.js.map +1 -1
- package/lib/commonjs/internal/use-slot-text-wrapper.js +36 -5
- package/lib/commonjs/internal/use-slot-text-wrapper.js.map +1 -1
- package/lib/module/Accordion/Accordion.js +9 -5
- package/lib/module/Accordion/Accordion.js.map +1 -1
- package/lib/module/ActionIcon/ActionIcon.js.map +1 -1
- package/lib/module/Alert/Alert.js +31 -11
- package/lib/module/Alert/Alert.js.map +1 -1
- package/lib/module/AngleSlider/AngleSlider.js +55 -17
- package/lib/module/AngleSlider/AngleSlider.js.map +1 -1
- package/lib/module/Autocomplete/Autocomplete.js +54 -34
- package/lib/module/Autocomplete/Autocomplete.js.map +1 -1
- package/lib/module/Avatar/Avatar.js.map +1 -1
- package/lib/module/Badge/Badge.js +6 -9
- package/lib/module/Badge/Badge.js.map +1 -1
- package/lib/module/Button/Button.js +23 -7
- package/lib/module/Button/Button.js.map +1 -1
- package/lib/module/Card/Card.js +13 -4
- package/lib/module/Card/Card.js.map +1 -1
- package/lib/module/Checkbox/CheckIcon.js +9 -5
- package/lib/module/Checkbox/CheckIcon.js.map +1 -1
- package/lib/module/Checkbox/Checkbox.js +9 -2
- package/lib/module/Checkbox/Checkbox.js.map +1 -1
- package/lib/module/Chip/Chip.js +15 -16
- package/lib/module/Chip/Chip.js.map +1 -1
- package/lib/module/CloseButton/CloseButton.js +1 -1
- package/lib/module/CloseButton/CloseButton.js.map +1 -1
- package/lib/module/ColorInput/ColorInput.js +12 -4
- package/lib/module/ColorInput/ColorInput.js.map +1 -1
- package/lib/module/ColorPicker/ColorPicker.js +32 -24
- package/lib/module/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/module/Combobox/Combobox.js +11 -6
- package/lib/module/Combobox/Combobox.js.map +1 -1
- package/lib/module/Combobox/OptionsDropdown.js +6 -2
- package/lib/module/Combobox/OptionsDropdown.js.map +1 -1
- package/lib/module/Group/Group.js +19 -11
- package/lib/module/Group/Group.js.map +1 -1
- package/lib/module/Highlight/Highlight.js +30 -10
- package/lib/module/Highlight/Highlight.js.map +1 -1
- package/lib/module/HoverCard/HoverCard.js +23 -10
- package/lib/module/HoverCard/HoverCard.js.map +1 -1
- package/lib/module/Indicator/Indicator.js +5 -1
- package/lib/module/Indicator/Indicator.js.map +1 -1
- package/lib/module/Input/Input.js +32 -14
- package/lib/module/Input/Input.js.map +1 -1
- package/lib/module/Input/shared.js +19 -9
- package/lib/module/Input/shared.js.map +1 -1
- package/lib/module/Loader/Loader.js +18 -10
- package/lib/module/Loader/Loader.js.map +1 -1
- package/lib/module/Menu/Menu.js +6 -7
- package/lib/module/Menu/Menu.js.map +1 -1
- package/lib/module/MultiSelect/MultiSelect.js +113 -48
- package/lib/module/MultiSelect/MultiSelect.js.map +1 -1
- package/lib/module/Notification/Notification.js +31 -11
- package/lib/module/Notification/Notification.js.map +1 -1
- package/lib/module/NumberFormatter/NumberFormatter.js +48 -11
- package/lib/module/NumberFormatter/NumberFormatter.js.map +1 -1
- package/lib/module/Paper/Paper.js +7 -8
- package/lib/module/Paper/Paper.js.map +1 -1
- package/lib/module/Pill/Pill.js +6 -8
- package/lib/module/Pill/Pill.js.map +1 -1
- package/lib/module/PinInput/PinInput.js.map +1 -1
- package/lib/module/Progress/Progress.js +4 -1
- package/lib/module/Progress/Progress.js.map +1 -1
- package/lib/module/RollingNumber/RollingNumber.js +30 -13
- package/lib/module/RollingNumber/RollingNumber.js.map +1 -1
- package/lib/module/RollingNumber/rolling-number-utils.js +27 -5
- package/lib/module/RollingNumber/rolling-number-utils.js.map +1 -1
- package/lib/module/ScrollArea/ScrollArea.js +133 -43
- package/lib/module/ScrollArea/ScrollArea.js.map +1 -1
- package/lib/module/ScrollArea/ScrollArea.native.js +128 -40
- package/lib/module/ScrollArea/ScrollArea.native.js.map +1 -1
- package/lib/module/SegmentedControl/SegmentedControl.js +4 -1
- package/lib/module/SegmentedControl/SegmentedControl.js.map +1 -1
- package/lib/module/Select/Select.js +65 -36
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Skeleton/Skeleton.js +6 -2
- package/lib/module/Skeleton/Skeleton.js.map +1 -1
- package/lib/module/Slider/Slider.js +137 -84
- package/lib/module/Slider/Slider.js.map +1 -1
- package/lib/module/Spoiler/Spoiler.js +23 -3
- package/lib/module/Spoiler/Spoiler.js.map +1 -1
- package/lib/module/Stepper/Stepper.js +1 -1
- package/lib/module/Stepper/Stepper.js.map +1 -1
- package/lib/module/Switch/Switch.js +18 -7
- package/lib/module/Switch/Switch.js.map +1 -1
- package/lib/module/Table/Table.js +91 -28
- package/lib/module/Table/Table.js.map +1 -1
- package/lib/module/TableOfContents/TableOfContents.js +5 -2
- package/lib/module/TableOfContents/TableOfContents.js.map +1 -1
- package/lib/module/TagsInput/TagsInput.js +140 -57
- package/lib/module/TagsInput/TagsInput.js.map +1 -1
- package/lib/module/ThemeIcon/ThemeIcon.js.map +1 -1
- package/lib/module/Title/Title.js.map +1 -1
- package/lib/module/Tooltip/Tooltip.js +27 -5
- package/lib/module/Tooltip/Tooltip.js.map +1 -1
- package/lib/module/Transition/use-transition.js.map +1 -1
- package/lib/module/Tree/Tree.js +4 -1
- package/lib/module/Tree/Tree.js.map +1 -1
- package/lib/module/Tree/tree-data.js +57 -23
- package/lib/module/Tree/tree-data.js.map +1 -1
- package/lib/module/Tree/use-tree.js +34 -5
- package/lib/module/Tree/use-tree.js.map +1 -1
- package/lib/module/TreeSelect/TreeSelect.js +72 -32
- package/lib/module/TreeSelect/TreeSelect.js.map +1 -1
- package/lib/module/Typography/Typography.js +9 -10
- package/lib/module/Typography/Typography.js.map +1 -1
- package/lib/module/UnstyledButton/UnstyledButton.js +9 -4
- package/lib/module/UnstyledButton/UnstyledButton.js.map +1 -1
- package/lib/module/VirtualList/VirtualList.js +71 -13
- package/lib/module/VirtualList/VirtualList.js.map +1 -1
- package/lib/module/floating/platform.js +28 -1
- package/lib/module/floating/platform.js.map +1 -1
- package/lib/module/floating/use-position.js +33 -1
- package/lib/module/floating/use-position.js.map +1 -1
- package/lib/module/internal/ControlIconProvider.js +18 -13
- package/lib/module/internal/ControlIconProvider.js.map +1 -1
- package/lib/module/internal/gradient-shared.js +9 -5
- package/lib/module/internal/gradient-shared.js.map +1 -1
- package/lib/module/internal/gradient.js +22 -9
- package/lib/module/internal/gradient.js.map +1 -1
- package/lib/module/internal/gradient.native.js +36 -10
- package/lib/module/internal/gradient.native.js.map +1 -1
- package/lib/module/internal/render-text-child.js +30 -2
- package/lib/module/internal/render-text-child.js.map +1 -1
- package/lib/module/internal/style-props.js +16 -4
- package/lib/module/internal/style-props.js.map +1 -1
- package/lib/module/internal/theme-color-web.js +42 -0
- package/lib/module/internal/theme-color-web.js.map +1 -0
- package/lib/module/internal/use-icon-color.js +29 -0
- package/lib/module/internal/use-icon-color.js.map +1 -0
- package/lib/module/internal/use-icon-color.native.js +19 -0
- package/lib/module/internal/use-icon-color.native.js.map +1 -0
- package/lib/module/internal/use-looping-animation.js +8 -4
- package/lib/module/internal/use-looping-animation.js.map +1 -1
- package/lib/module/internal/use-looping-animation.native.js +10 -2
- package/lib/module/internal/use-looping-animation.native.js.map +1 -1
- package/lib/module/internal/use-looping-animation.shared.js +31 -0
- package/lib/module/internal/use-looping-animation.shared.js.map +1 -1
- package/lib/module/internal/use-slot-text-wrapper.js +37 -5
- package/lib/module/internal/use-slot-text-wrapper.js.map +1 -1
- package/lib/typescript/Accordion/Accordion.d.ts +11 -11
- package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/ActionIcon/ActionIcon.d.ts +7 -7
- package/lib/typescript/ActionIcon/ActionIcon.d.ts.map +1 -1
- package/lib/typescript/Alert/Alert.d.ts +7 -7
- package/lib/typescript/Alert/Alert.d.ts.map +1 -1
- package/lib/typescript/Anchor/Anchor.d.ts +3 -3
- package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
- package/lib/typescript/Autocomplete/Autocomplete.d.ts +16 -42
- package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/lib/typescript/Avatar/Avatar.d.ts +21 -21
- package/lib/typescript/Avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/Badge/Badge.d.ts +7 -7
- package/lib/typescript/Badge/Badge.d.ts.map +1 -1
- package/lib/typescript/Button/Button.d.ts +7 -7
- package/lib/typescript/Button/Button.d.ts.map +1 -1
- package/lib/typescript/Card/Card.d.ts.map +1 -1
- package/lib/typescript/Checkbox/CheckIcon.d.ts.map +1 -1
- package/lib/typescript/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/CloseButton/CloseButton.d.ts +7 -7
- package/lib/typescript/ColorInput/ColorInput.d.ts.map +1 -1
- package/lib/typescript/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/lib/typescript/Combobox/Combobox.d.ts +2 -2
- package/lib/typescript/Combobox/Combobox.d.ts.map +1 -1
- package/lib/typescript/Combobox/OptionsDropdown.d.ts.map +1 -1
- package/lib/typescript/Combobox/index.d.ts +2 -2
- package/lib/typescript/Dialog/Dialog.d.ts +6 -6
- package/lib/typescript/Fieldset/Fieldset.d.ts +7 -7
- package/lib/typescript/FileButton/FileButton.types.d.ts.map +1 -1
- package/lib/typescript/Flex/Flex.d.ts +3 -3
- package/lib/typescript/Group/Group.d.ts +3 -3
- package/lib/typescript/Group/Group.d.ts.map +1 -1
- package/lib/typescript/Highlight/Highlight.d.ts.map +1 -1
- package/lib/typescript/HoverCard/HoverCard.d.ts +1 -1
- package/lib/typescript/HoverCard/HoverCard.d.ts.map +1 -1
- package/lib/typescript/Image/Image.d.ts +14 -14
- package/lib/typescript/Image/createImage.d.ts +17 -17
- package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
- package/lib/typescript/Input/Input.d.ts +13 -13
- package/lib/typescript/Input/Input.d.ts.map +1 -1
- package/lib/typescript/Input/Input.native.d.ts +16 -16
- package/lib/typescript/Input/shared.d.ts +10 -10
- package/lib/typescript/Input/shared.d.ts.map +1 -1
- package/lib/typescript/InputBase/InputBase.d.ts +2 -2
- package/lib/typescript/Kbd/Kbd.d.ts +1 -1
- package/lib/typescript/Loader/Loader.d.ts.map +1 -1
- package/lib/typescript/Mark/Mark.d.ts +1 -1
- package/lib/typescript/MaskInput/MaskInput.d.ts +2 -2
- package/lib/typescript/Menu/Menu.d.ts +1 -1
- package/lib/typescript/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/Modal/Modal.d.ts +6 -6
- package/lib/typescript/MultiSelect/MultiSelect.d.ts +15 -60
- package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/lib/typescript/NavLink/NavLink.d.ts +7 -7
- package/lib/typescript/Notification/Notification.d.ts.map +1 -1
- package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
- package/lib/typescript/NumberInput/NumberInput.d.ts +5 -5
- package/lib/typescript/Paper/Paper.d.ts +8 -40
- package/lib/typescript/Paper/Paper.d.ts.map +1 -1
- package/lib/typescript/PasswordInput/PasswordInput.d.ts +11 -11
- package/lib/typescript/Pill/Pill.d.ts +15 -15
- package/lib/typescript/Pill/Pill.d.ts.map +1 -1
- package/lib/typescript/PinInput/PinInput.d.ts +13 -13
- package/lib/typescript/PinInput/PinInput.d.ts.map +1 -1
- package/lib/typescript/Popover/Popover.shared.d.ts +3 -3
- package/lib/typescript/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/Radio/Radio.d.ts +8 -8
- package/lib/typescript/RollingNumber/RollingNumber.d.ts.map +1 -1
- package/lib/typescript/RollingNumber/rolling-number-utils.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/lib/typescript/ScrollArea/ScrollArea.native.d.ts.map +1 -1
- package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/Select/Select.d.ts +20 -49
- package/lib/typescript/Select/Select.d.ts.map +1 -1
- package/lib/typescript/Separator/Separator.d.ts +9 -9
- package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/Slider/Slider.d.ts.map +1 -1
- package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
- package/lib/typescript/Switch/Switch.d.ts +14 -3
- package/lib/typescript/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/Table/Table.d.ts +18 -12
- package/lib/typescript/Table/Table.d.ts.map +1 -1
- package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
- package/lib/typescript/Tabs/Tabs.d.ts +12 -12
- package/lib/typescript/TagsInput/TagsInput.d.ts +13 -47
- package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
- package/lib/typescript/TextInput/TextInput.d.ts +2 -2
- package/lib/typescript/Textarea/Textarea.d.ts +2 -2
- package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +7 -7
- package/lib/typescript/ThemeIcon/ThemeIcon.d.ts.map +1 -1
- package/lib/typescript/Title/Title.d.ts +3 -3
- package/lib/typescript/Title/Title.d.ts.map +1 -1
- package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/Transition/use-transition.d.ts.map +1 -1
- package/lib/typescript/Tree/Tree.d.ts +1 -1
- package/lib/typescript/Tree/Tree.d.ts.map +1 -1
- package/lib/typescript/Tree/tree-data.d.ts +7 -0
- package/lib/typescript/Tree/tree-data.d.ts.map +1 -1
- package/lib/typescript/Tree/use-tree.d.ts +5 -0
- package/lib/typescript/Tree/use-tree.d.ts.map +1 -1
- package/lib/typescript/TreeSelect/TreeSelect.d.ts +21 -47
- package/lib/typescript/TreeSelect/TreeSelect.d.ts.map +1 -1
- package/lib/typescript/Typography/Typography.d.ts +8 -8
- package/lib/typescript/Typography/Typography.d.ts.map +1 -1
- package/lib/typescript/UnstyledButton/UnstyledButton.d.ts.map +1 -1
- package/lib/typescript/VirtualList/VirtualList.d.ts.map +1 -1
- package/lib/typescript/floating/platform.d.ts +11 -0
- package/lib/typescript/floating/platform.d.ts.map +1 -1
- package/lib/typescript/floating/use-position.d.ts.map +1 -1
- package/lib/typescript/internal/ControlIconProvider.d.ts +1 -1
- package/lib/typescript/internal/ControlIconProvider.d.ts.map +1 -1
- package/lib/typescript/internal/gradient-shared.d.ts +7 -4
- package/lib/typescript/internal/gradient-shared.d.ts.map +1 -1
- package/lib/typescript/internal/gradient.d.ts +18 -0
- package/lib/typescript/internal/gradient.d.ts.map +1 -1
- package/lib/typescript/internal/gradient.native.d.ts.map +1 -1
- package/lib/typescript/internal/render-text-child.d.ts +11 -0
- package/lib/typescript/internal/render-text-child.d.ts.map +1 -1
- package/lib/typescript/internal/style-props.d.ts +17 -0
- package/lib/typescript/internal/style-props.d.ts.map +1 -1
- package/lib/typescript/internal/theme-color-web.d.ts +2 -0
- package/lib/typescript/internal/theme-color-web.d.ts.map +1 -0
- package/lib/typescript/internal/use-icon-color.d.ts +25 -0
- package/lib/typescript/internal/use-icon-color.d.ts.map +1 -0
- package/lib/typescript/internal/use-icon-color.native.d.ts +11 -0
- package/lib/typescript/internal/use-icon-color.native.d.ts.map +1 -0
- package/lib/typescript/internal/use-looping-animation.d.ts.map +1 -1
- package/lib/typescript/internal/use-looping-animation.native.d.ts.map +1 -1
- package/lib/typescript/internal/use-looping-animation.shared.d.ts +30 -3
- package/lib/typescript/internal/use-looping-animation.shared.d.ts.map +1 -1
- package/lib/typescript/internal/use-slot-text-wrapper.d.ts +0 -20
- package/lib/typescript/internal/use-slot-text-wrapper.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/Accordion/Accordion.tsx +6 -2
- package/src/ActionIcon/ActionIcon.tsx +1 -8
- package/src/Alert/Alert.tsx +44 -29
- package/src/AngleSlider/AngleSlider.tsx +73 -21
- package/src/Autocomplete/Autocomplete.tsx +74 -55
- package/src/Avatar/Avatar.tsx +1 -7
- package/src/Badge/Badge.tsx +7 -16
- package/src/Button/Button.tsx +18 -11
- package/src/Card/Card.tsx +11 -3
- package/src/Checkbox/CheckIcon.tsx +9 -5
- package/src/Checkbox/Checkbox.tsx +8 -1
- package/src/Chip/Chip.tsx +15 -22
- package/src/CloseButton/CloseButton.tsx +1 -1
- package/src/ColorInput/ColorInput.tsx +15 -4
- package/src/ColorPicker/ColorPicker.tsx +39 -27
- package/src/Combobox/Combobox.tsx +10 -6
- package/src/Combobox/OptionsDropdown.tsx +6 -1
- package/src/FileButton/FileButton.types.ts +2 -11
- package/src/Group/Group.tsx +21 -10
- package/src/Highlight/Highlight.tsx +42 -7
- package/src/HoverCard/HoverCard.tsx +48 -31
- package/src/Indicator/Indicator.tsx +4 -0
- package/src/Input/Input.tsx +31 -16
- package/src/Input/shared.tsx +20 -4
- package/src/Loader/Loader.tsx +14 -4
- package/src/Menu/Menu.tsx +6 -8
- package/src/MultiSelect/MultiSelect.tsx +140 -85
- package/src/Notification/Notification.tsx +43 -22
- package/src/NumberFormatter/NumberFormatter.tsx +66 -11
- package/src/Paper/Paper.tsx +8 -6
- package/src/Pill/Pill.tsx +6 -9
- package/src/PinInput/PinInput.tsx +1 -8
- package/src/Progress/Progress.tsx +3 -0
- package/src/RollingNumber/RollingNumber.tsx +43 -21
- package/src/RollingNumber/rolling-number-utils.ts +28 -5
- package/src/ScrollArea/ScrollArea.native.tsx +142 -49
- package/src/ScrollArea/ScrollArea.tsx +140 -47
- package/src/SegmentedControl/SegmentedControl.tsx +12 -1
- package/src/Select/Select.tsx +90 -67
- package/src/Skeleton/Skeleton.tsx +5 -1
- package/src/Slider/Slider.tsx +157 -61
- package/src/Spoiler/Spoiler.tsx +22 -10
- package/src/Stepper/Stepper.tsx +1 -1
- package/src/Switch/Switch.tsx +20 -9
- package/src/Table/Table.tsx +89 -33
- package/src/TableOfContents/TableOfContents.tsx +5 -1
- package/src/TagsInput/TagsInput.tsx +193 -141
- package/src/ThemeIcon/ThemeIcon.tsx +1 -8
- package/src/Title/Title.tsx +1 -13
- package/src/Tooltip/Tooltip.tsx +33 -7
- package/src/Transition/use-transition.ts +1 -6
- package/src/Tree/Tree.tsx +4 -1
- package/src/Tree/tree-data.ts +74 -26
- package/src/Tree/use-tree.ts +52 -7
- package/src/TreeSelect/TreeSelect.tsx +96 -64
- package/src/Typography/Typography.tsx +9 -8
- package/src/UnstyledButton/UnstyledButton.tsx +12 -5
- package/src/VirtualList/VirtualList.tsx +82 -18
- package/src/floating/platform.ts +29 -1
- package/src/floating/use-position.tsx +38 -1
- package/src/internal/ControlIconProvider.tsx +17 -12
- package/src/internal/gradient-shared.ts +9 -5
- package/src/internal/gradient.native.tsx +29 -5
- package/src/internal/gradient.tsx +22 -7
- package/src/internal/render-text-child.tsx +30 -2
- package/src/internal/style-props.ts +20 -4
- package/src/internal/theme-color-web.ts +40 -0
- package/src/internal/use-icon-color.native.ts +17 -0
- package/src/internal/use-icon-color.ts +26 -0
- package/src/internal/use-looping-animation.native.tsx +10 -2
- package/src/internal/use-looping-animation.shared.ts +38 -3
- package/src/internal/use-looping-animation.tsx +8 -4
- package/src/internal/use-slot-text-wrapper.tsx +39 -5
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { themeColorToCssVar } from "./theme-color-web";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Resolve a control's icon colour token to something `react-native-svg` (native)
|
|
5
|
+
* or CSS (web) can paint — WEB implementation (`use-icon-color.native.ts` is the
|
|
6
|
+
* native twin).
|
|
7
|
+
*
|
|
8
|
+
* On web this needs no theme at all: a `$token` maps to its CSS custom property
|
|
9
|
+
* by pure string transform (see `theme-color-web.ts`). That matters a lot here,
|
|
10
|
+
* because `ControlIconProvider` is instantiated once per control SECTION — a
|
|
11
|
+
* Button with a left and a right section mounts two, on top of its own frame, at
|
|
12
|
+
* 16 JSX sites across 11 components. Every one of those used to call `useTheme()`,
|
|
13
|
+
* which means:
|
|
14
|
+
*
|
|
15
|
+
* - a `useThemeWithState` per section (useId + useRef + useReducer + a DEP-LESS
|
|
16
|
+
* `useEffect` that fires after every render — 100 icon sites = 100 effect fires
|
|
17
|
+
* per render pass plus 100 global listener entries), and
|
|
18
|
+
* - on native, `variableToString` reads `variable.val`, which trips Tamagui's
|
|
19
|
+
* theme proxy `track(key)` and makes every icon-bearing control a theme
|
|
20
|
+
* SUBSCRIBER.
|
|
21
|
+
*
|
|
22
|
+
* The subscription is only actually needed on native (where the concrete colour
|
|
23
|
+
* value has to be read out of the active theme); on web the CSS variable tracks
|
|
24
|
+
* the theme by itself.
|
|
25
|
+
*/
|
|
26
|
+
export const useIconColor = (token: string): string => themeColorToCssVar(token);
|
|
@@ -11,7 +11,7 @@ import Animated, {
|
|
|
11
11
|
|
|
12
12
|
import { useReducedMotion } from "@knitui/hooks";
|
|
13
13
|
|
|
14
|
-
import { type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
|
|
14
|
+
import { isMotionActive, type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
|
|
15
15
|
|
|
16
16
|
export type {
|
|
17
17
|
LoopMotion,
|
|
@@ -64,8 +64,16 @@ const EASE_IN_OUT: Easer = Easing.bezier(0.42, 0, 0.58, 1);
|
|
|
64
64
|
* rotate), `pulse` (alternating opacity), `shimmer` (repeating translate offset).
|
|
65
65
|
*/
|
|
66
66
|
export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
|
|
67
|
-
const
|
|
67
|
+
const reducedPreference = useReducedMotion();
|
|
68
68
|
const resolved = resolveMotion(motion);
|
|
69
|
+
// A loop that is disabled (its style is never rendered) or visually inert (zero
|
|
70
|
+
// travel) must not be scheduled: `withRepeat` runs FOREVER, and every live loop
|
|
71
|
+
// re-evaluates its worklet and pushes a props update on the UI thread every
|
|
72
|
+
// frame. A screen full of `Skeleton`s, or a single `Loader` (which declares a
|
|
73
|
+
// spin + three pulses but renders one of them), otherwise paid for animations
|
|
74
|
+
// nothing displays. Folding it into `reduced` keeps the static-frame branch below
|
|
75
|
+
// as the single "not animating" path.
|
|
76
|
+
const reduced = reducedPreference || !isMotionActive(motion, resolved);
|
|
69
77
|
|
|
70
78
|
// `progress` runs 0→1 forever; the worklet interpolates per motion kind. For
|
|
71
79
|
// `pulse` we set `reverse=true` so each cycle ping-pongs (a seamless throb).
|
|
@@ -13,8 +13,25 @@ import { DURATIONS } from "@knitui/core";
|
|
|
13
13
|
* two implementations can never drift.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Fields every motion accepts. `enabled` is the perf-critical one: a loop is a
|
|
18
|
+
* PERMANENT animation (a compositor `@keyframes` on web, a `withRepeat` on
|
|
19
|
+
* reanimated's UI thread on native), so an instance whose loop is never rendered
|
|
20
|
+
* must not schedule one. Components declare their hooks unconditionally (stable
|
|
21
|
+
* hook order across variant changes) — e.g. `Loader` declares a spin + three
|
|
22
|
+
* pulses but renders only one of them, `Skeleton`/`Indicator` declare a pulse they
|
|
23
|
+
* only use when `animate`/`processing` — so without this gate every instance paid
|
|
24
|
+
* for up to four forever-running animations that nothing displays. Pass the same
|
|
25
|
+
* condition that decides whether the returned `style` is actually spread.
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
export interface LoopMotionBase {
|
|
29
|
+
/** Schedule the loop at all. `false` → a static first frame, no animation. */
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
16
33
|
/** A continuous 360° rotation (the `Loader` oval, `Indicator` processing ring). */
|
|
17
|
-
export interface SpinMotion {
|
|
34
|
+
export interface SpinMotion extends LoopMotionBase {
|
|
18
35
|
kind: "spin";
|
|
19
36
|
/** One full revolution, ms. @default 1000 */
|
|
20
37
|
durationMs?: number;
|
|
@@ -25,7 +42,7 @@ export interface SpinMotion {
|
|
|
25
42
|
* (`Skeleton` shimmer-lite, `Indicator` processing dot). Alternates direction so
|
|
26
43
|
* the loop is seamless without a snap.
|
|
27
44
|
*/
|
|
28
|
-
export interface PulseMotion {
|
|
45
|
+
export interface PulseMotion extends LoopMotionBase {
|
|
29
46
|
kind: "pulse";
|
|
30
47
|
/** One half-cycle (full→min OR min→full), ms. @default 600 */
|
|
31
48
|
durationMs?: number;
|
|
@@ -39,7 +56,7 @@ export interface PulseMotion {
|
|
|
39
56
|
* axis, then snaps back (the repeated copies make the snap invisible). Linear so
|
|
40
57
|
* the speed is constant.
|
|
41
58
|
*/
|
|
42
|
-
export interface ShimmerMotion {
|
|
59
|
+
export interface ShimmerMotion extends LoopMotionBase {
|
|
43
60
|
kind: "shimmer";
|
|
44
61
|
/** One full slide of `distance`, ms. @default 1000 */
|
|
45
62
|
durationMs?: number;
|
|
@@ -78,3 +95,21 @@ export function resolveMotion(motion: LoopMotion): ResolvedMotion {
|
|
|
78
95
|
};
|
|
79
96
|
}
|
|
80
97
|
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Whether a resolved motion would actually MOVE anything. A zero-duration loop,
|
|
101
|
+
* or a `shimmer` with no travel, paints an identical frame forever — scheduling it
|
|
102
|
+
* costs a compositor animation (web) / a per-frame UI-thread worklet (native) for
|
|
103
|
+
* no visual result, so both platform files treat it as static. This is why callers
|
|
104
|
+
* can express "not animating right now" as `distance: 0` (`Progress`, `Marquee`
|
|
105
|
+
* before measurement) and pay nothing for it.
|
|
106
|
+
*/
|
|
107
|
+
export function isMotionInert(motion: ResolvedMotion): boolean {
|
|
108
|
+
if (motion.durationMs <= 0) return true;
|
|
109
|
+
return motion.kind === "shimmer" && motion.distance === 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Whether the loop should be scheduled: explicitly enabled AND visually moving. */
|
|
113
|
+
export function isMotionActive(motion: LoopMotion, resolved: ResolvedMotion): boolean {
|
|
114
|
+
return (motion.enabled ?? true) && !isMotionInert(resolved);
|
|
115
|
+
}
|
|
@@ -4,7 +4,7 @@ import { useReducedMotion } from "@knitui/hooks";
|
|
|
4
4
|
|
|
5
5
|
import { Box } from "../Box";
|
|
6
6
|
import { injectKeyframes } from "./keyframes-web";
|
|
7
|
-
import { type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
|
|
7
|
+
import { isMotionActive, type LoopMotion, resolveMotion } from "./use-looping-animation.shared";
|
|
8
8
|
|
|
9
9
|
export type {
|
|
10
10
|
LoopMotion,
|
|
@@ -109,13 +109,17 @@ function staticStyle(motion: ReturnType<typeof resolveMotion>): LoopStyle["style
|
|
|
109
109
|
export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
|
|
110
110
|
const reduced = useReducedMotion();
|
|
111
111
|
const resolved = resolveMotion(motion);
|
|
112
|
+
// A disabled or non-moving loop must not run: a live `@keyframes` animation keeps
|
|
113
|
+
// a compositor animation alive per element for a frame that never changes (an
|
|
114
|
+
// un-`animated` Progress stripe row, a `Loader`'s three unused pulses).
|
|
115
|
+
const active = !reduced && isMotionActive(motion, resolved);
|
|
112
116
|
|
|
113
117
|
// Inject during render (idempotent) so the rule exists before first paint.
|
|
114
118
|
const { name, body, timing, alternate } = keyframesFor(resolved);
|
|
115
|
-
if (
|
|
119
|
+
if (active) injectKeyframes(name, body);
|
|
116
120
|
|
|
117
121
|
return React.useMemo<LoopStyle>(() => {
|
|
118
|
-
if (
|
|
122
|
+
if (!active) return { style: staticStyle(resolved) };
|
|
119
123
|
return {
|
|
120
124
|
style: {
|
|
121
125
|
animationName: name,
|
|
@@ -128,5 +132,5 @@ export function useLoopingAnimation(motion: LoopMotion): LoopStyle {
|
|
|
128
132
|
// `resolved` is recomputed each render but value-stable per motion shape; the
|
|
129
133
|
// primitive deps are what actually change the returned style.
|
|
130
134
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
131
|
-
}, [
|
|
135
|
+
}, [active, name, timing, alternate, resolved.durationMs]);
|
|
132
136
|
}
|
|
@@ -12,23 +12,57 @@ import * as React from "react";
|
|
|
12
12
|
*
|
|
13
13
|
* Pass the component's own styled text element (`BlockquoteText`,
|
|
14
14
|
* `BreadcrumbLabel`, `ButtonText`, …) plus the resolved `styles` slot props (the
|
|
15
|
-
* `slotStyles(...).get("...")` value
|
|
16
|
-
* caller's `styles` prop is stable). When there are no slot props the base
|
|
15
|
+
* `slotStyles(...).get("...")` value). When there are no slot props the base
|
|
17
16
|
* `Component` is returned unwrapped, matching the historical
|
|
18
17
|
* `slot ? (p) => <El {...slot} {...p}/> : El` idiom.
|
|
19
18
|
*
|
|
19
|
+
* The slot props are compared by SHALLOW VALUE, not by identity. Keying the memo
|
|
20
|
+
* on identity looked correct but defeated the hook's entire purpose: the
|
|
21
|
+
* documented, idiomatic call is an inline literal —
|
|
22
|
+
* `styles={{ label: { color: "$red9" } }}` — which is a new object on every
|
|
23
|
+
* render, so the memo never hit, the wrapper was a new component type every
|
|
24
|
+
* render, and React unmounted and remounted the wrapped text on every render.
|
|
25
|
+
* That is precisely the failure this hook exists to prevent, and it only showed
|
|
26
|
+
* up for the callers who passed `styles` at all.
|
|
27
|
+
*
|
|
20
28
|
* (`Tabs` keeps its own `useCallback` wrapper because it also binds dynamic
|
|
21
29
|
* `active`/`variant`/`size` props; this hook covers the slot-only sites.)
|
|
22
30
|
*/
|
|
31
|
+
/** Own enumerable keys compared with `Object.is` — one level deep, no recursion. */
|
|
32
|
+
function shallowEqualProps(a: object | undefined, b: object | undefined): boolean {
|
|
33
|
+
if (a === b) return true;
|
|
34
|
+
if (!a || !b) return false;
|
|
35
|
+
const aKeys = Object.keys(a) as (keyof typeof a)[];
|
|
36
|
+
const bKeys = Object.keys(b);
|
|
37
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
38
|
+
for (const key of aKeys) {
|
|
39
|
+
if (!Object.is(a[key], b[key])) return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Hold `slotProps` at a stable reference while its shallow value is unchanged, so
|
|
46
|
+
* an inline literal doesn't invalidate the wrapper memo below. Same stable-ref
|
|
47
|
+
* shape the carousel uses for its inline `modeConfig`.
|
|
48
|
+
*/
|
|
49
|
+
function useShallowStable<T extends object | undefined>(value: T): T {
|
|
50
|
+
const ref = React.useRef(value);
|
|
51
|
+
if (!shallowEqualProps(ref.current, value)) ref.current = value;
|
|
52
|
+
return ref.current;
|
|
53
|
+
}
|
|
54
|
+
|
|
23
55
|
export function useSlotTextWrapper<P extends { children?: React.ReactNode }>(
|
|
24
56
|
Component: React.ComponentType<P>,
|
|
25
57
|
slotProps: Partial<P> | undefined,
|
|
26
58
|
): React.ComponentType<{ children: React.ReactNode }> {
|
|
59
|
+
const stableSlotProps = useShallowStable(slotProps);
|
|
60
|
+
|
|
27
61
|
return React.useMemo(() => {
|
|
28
|
-
if (!
|
|
62
|
+
if (!stableSlotProps) return Component as React.ComponentType<{ children: React.ReactNode }>;
|
|
29
63
|
const Wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
30
|
-
<Component {...(
|
|
64
|
+
<Component {...(stableSlotProps as P)}>{children}</Component>
|
|
31
65
|
);
|
|
32
66
|
return Wrapper;
|
|
33
|
-
}, [Component,
|
|
67
|
+
}, [Component, stableSlotProps]);
|
|
34
68
|
}
|