@knitui/components 0.5.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/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/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/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/Tooltip/Tooltip.js +27 -5
- package/lib/commonjs/Tooltip/Tooltip.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/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/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/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/Tooltip/Tooltip.js +27 -5
- package/lib/module/Tooltip/Tooltip.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/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/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/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/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/Title/Title.d.ts +3 -3
- package/lib/typescript/Tooltip/Tooltip.d.ts.map +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 +4 -4
- package/src/Accordion/Accordion.tsx +6 -2
- package/src/Alert/Alert.tsx +43 -22
- package/src/AngleSlider/AngleSlider.tsx +73 -21
- package/src/Autocomplete/Autocomplete.tsx +74 -55
- package/src/Badge/Badge.tsx +6 -8
- package/src/Button/Button.tsx +17 -3
- 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 +38 -25
- package/src/Combobox/Combobox.tsx +10 -6
- package/src/Combobox/OptionsDropdown.tsx +6 -1
- 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/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/Tooltip/Tooltip.tsx +33 -7
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
import { withStaticProperties } from "@knitui/core";
|
|
4
|
-
import { useUncontrolled } from "@knitui/hooks";
|
|
4
|
+
import { useCallbackRef, useUncontrolled } from "@knitui/hooks";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Combobox,
|
|
@@ -149,11 +149,6 @@ interface TagsInputContextValue {
|
|
|
149
149
|
clearButtonProps?: Partial<ComboboxClearButtonProps>;
|
|
150
150
|
/** Controls how the clear button coexists with the trigger's right section. */
|
|
151
151
|
clearSectionMode?: "clear" | "default" | "rightSection" | "both";
|
|
152
|
-
/** Trigger props the sugar wrapper assembled (chrome, ref). */
|
|
153
|
-
triggerProps?: Partial<TagsInputFieldProps> & {
|
|
154
|
-
placeholder?: string;
|
|
155
|
-
ref?: React.Ref<TagsInputRef>;
|
|
156
|
-
};
|
|
157
152
|
// Event/behaviour handlers consumed by TagsInput.Trigger.
|
|
158
153
|
onClear: () => void;
|
|
159
154
|
removeTag: (index: number) => void;
|
|
@@ -174,6 +169,90 @@ const useTagsInputContext = (): TagsInputContextValue => {
|
|
|
174
169
|
return ctx;
|
|
175
170
|
};
|
|
176
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Trigger props the sugar wrapper assembled (chrome, ref). Rebuilt every render
|
|
174
|
+
* (`...inputProps` is a rest spread, so its identity can never be preserved), which
|
|
175
|
+
* is why it rides its OWN context: `TagsInput.Trigger` is the only consumer, while
|
|
176
|
+
* the option rows consume `TagsInputContext`.
|
|
177
|
+
*/
|
|
178
|
+
type TagsInputFunneledTriggerProps = Partial<TagsInputFieldProps> & {
|
|
179
|
+
placeholder?: string;
|
|
180
|
+
ref?: React.Ref<TagsInputRef>;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const TagsInputTriggerPropsContext = React.createContext<TagsInputFunneledTriggerProps | undefined>(
|
|
184
|
+
undefined,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
/** Shared empty funnel for the composable path (no sugar wrapper above). */
|
|
188
|
+
const EMPTY_TRIGGER_PROPS: TagsInputFunneledTriggerProps = {};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The slice of Root state a tag CHIP needs — deliberately WITHOUT `search`, so
|
|
192
|
+
* typing in the field cannot re-render the tag chips through context. The search
|
|
193
|
+
* text lives on `TagsInputContext`, which the trigger/field consume; the chips
|
|
194
|
+
* subscribe here instead and `React.memo` on `{ value, index }` then actually holds.
|
|
195
|
+
*/
|
|
196
|
+
interface TagsInputChipContextValue {
|
|
197
|
+
pillSize: PillProps["size"];
|
|
198
|
+
disabled?: boolean;
|
|
199
|
+
readOnly?: boolean;
|
|
200
|
+
renderPill?: ComboboxRenderPill;
|
|
201
|
+
styles?: SlotStyles<TagsInputStyles>;
|
|
202
|
+
removeTag: (index: number) => void;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const TagsInputChipContext = React.createContext<TagsInputChipContextValue | null>(null);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* One tag chip in the data-driven `TagsInput.Trigger` row, memoized on
|
|
209
|
+
* `{ value, index }`. Reads `TagsInputChipContext` (no `search`) and gets a
|
|
210
|
+
* `useCallbackRef`-stable `removeTag`, so a keystroke no longer rebuilds every chip's
|
|
211
|
+
* `Pill` + `CloseButton` + icon SVG — previously keystroke latency scaled with the
|
|
212
|
+
* number of tags, each chip also getting a brand-new `onRemove` closure.
|
|
213
|
+
*/
|
|
214
|
+
const TagsInputChip = React.memo(function TagsInputChip({
|
|
215
|
+
value: item,
|
|
216
|
+
index,
|
|
217
|
+
}: {
|
|
218
|
+
value: string;
|
|
219
|
+
index: number;
|
|
220
|
+
}) {
|
|
221
|
+
const ctx = React.useContext(TagsInputChipContext);
|
|
222
|
+
if (!ctx) {
|
|
223
|
+
throw new Error("TagsInput chips must be rendered inside <TagsInput.Root>");
|
|
224
|
+
}
|
|
225
|
+
const { removeTag } = ctx;
|
|
226
|
+
const s = slotStyles<TagsInputStyles>(ctx.styles, TAGS_INPUT_SLOT_KEYS, "TagsInput");
|
|
227
|
+
const handleRemove = React.useCallback(() => removeTag(index), [removeTag, index]);
|
|
228
|
+
|
|
229
|
+
// A custom `renderPill` REPLACES the built-in chip (Mantine parity).
|
|
230
|
+
if (ctx.renderPill) {
|
|
231
|
+
return (
|
|
232
|
+
<>
|
|
233
|
+
{ctx.renderPill({
|
|
234
|
+
option: { value: item, label: item },
|
|
235
|
+
value: item,
|
|
236
|
+
onRemove: handleRemove,
|
|
237
|
+
disabled: ctx.disabled || ctx.readOnly,
|
|
238
|
+
})}
|
|
239
|
+
</>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<Pill
|
|
245
|
+
{...s.get("pill")}
|
|
246
|
+
size={ctx.pillSize}
|
|
247
|
+
withRemoveButton={!ctx.readOnly}
|
|
248
|
+
disabled={ctx.disabled}
|
|
249
|
+
onRemove={handleRemove}
|
|
250
|
+
>
|
|
251
|
+
{item}
|
|
252
|
+
</Pill>
|
|
253
|
+
);
|
|
254
|
+
});
|
|
255
|
+
|
|
177
256
|
/* -------------------------------------------------------------------------- */
|
|
178
257
|
/* TagsInput.Root — the free-text tag-list state machine */
|
|
179
258
|
/* -------------------------------------------------------------------------- */
|
|
@@ -276,7 +355,7 @@ export interface TagsInputRootProps {
|
|
|
276
355
|
* `<TagsInput.Trigger>` with your own props instead.
|
|
277
356
|
* @internal
|
|
278
357
|
*/
|
|
279
|
-
__triggerProps?:
|
|
358
|
+
__triggerProps?: TagsInputFunneledTriggerProps;
|
|
280
359
|
}
|
|
281
360
|
|
|
282
361
|
function TagsInputRoot(props: TagsInputRootProps) {
|
|
@@ -361,88 +440,66 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
361
440
|
// filter memo and scopes the behaviour to actual input changes.
|
|
362
441
|
const selectFirstPending = React.useRef(false);
|
|
363
442
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
443
|
+
// Every handler in this Root is `useCallbackRef`-stable (identity fixed, latest
|
|
444
|
+
// closure — the ref is refreshed after every commit, and events always fire after
|
|
445
|
+
// a commit). That is what lets the context memo below actually HIT: with fresh
|
|
446
|
+
// closures it either had to be invalidated every render (re-rendering every option
|
|
447
|
+
// row AND every tag chip, since context propagation walks past `React.memo`) or it
|
|
448
|
+
// would have served stale callbacks. `handleSubmit` additionally lands on
|
|
449
|
+
// `<Combobox onOptionSubmit>`, a dep of Combobox's OWN context memo.
|
|
450
|
+
const isDup = useCallbackRef((tag: string, current: string[]) =>
|
|
451
|
+
isDuplicate
|
|
452
|
+
? isDuplicate(tag, current)
|
|
453
|
+
: current.some((t) => t.toLowerCase() === tag.toLowerCase()),
|
|
370
454
|
);
|
|
371
455
|
|
|
372
|
-
const addTag =
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
},
|
|
388
|
-
[
|
|
389
|
-
allowDuplicates,
|
|
390
|
-
isDup,
|
|
391
|
-
_value,
|
|
392
|
-
onDuplicate,
|
|
393
|
-
maxTags,
|
|
394
|
-
onMaxTags,
|
|
395
|
-
setValue,
|
|
396
|
-
setSearch,
|
|
397
|
-
clearSearchOnChange,
|
|
398
|
-
],
|
|
399
|
-
);
|
|
456
|
+
const addTag = useCallbackRef((raw: string) => {
|
|
457
|
+
const tag = raw.trim();
|
|
458
|
+
if (tag.length === 0) return;
|
|
459
|
+
if (!allowDuplicates && isDup(tag, _value)) {
|
|
460
|
+
onDuplicate?.(tag);
|
|
461
|
+
setSearch("");
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
if (_value.length >= maxTags) {
|
|
465
|
+
onMaxTags?.(tag);
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
setValue([..._value, tag]);
|
|
469
|
+
if (clearSearchOnChange) setSearch("");
|
|
470
|
+
});
|
|
400
471
|
|
|
401
472
|
// Commit a batch of tags in ONE pass — merges into the current value honouring
|
|
402
473
|
// `maxTags` + duplicates, then `setValue` once. Used by the split-on-key and
|
|
403
474
|
// split-on-paste paths (a per-tag `addTag` loop would read the render-time `_value`
|
|
404
475
|
// for every call, so only the last tag would survive).
|
|
405
|
-
const commitTags =
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
if (!allowDuplicates && isDup(tag, merged)) {
|
|
416
|
-
onDuplicate?.(tag);
|
|
417
|
-
continue;
|
|
418
|
-
}
|
|
419
|
-
merged.push(tag);
|
|
476
|
+
const commitTags = useCallbackRef((tags: string[]) => {
|
|
477
|
+
const merged = _value.slice();
|
|
478
|
+
for (const raw of tags) {
|
|
479
|
+
const tag = raw.trim();
|
|
480
|
+
if (tag.length === 0) continue;
|
|
481
|
+
if (merged.length >= maxTags) {
|
|
482
|
+
onMaxTags?.(tag);
|
|
483
|
+
break;
|
|
420
484
|
}
|
|
421
|
-
if (
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
onDuplicate,
|
|
431
|
-
setValue,
|
|
432
|
-
clearSearchOnChange,
|
|
433
|
-
setSearch,
|
|
434
|
-
],
|
|
435
|
-
);
|
|
485
|
+
if (!allowDuplicates && isDup(tag, merged)) {
|
|
486
|
+
onDuplicate?.(tag);
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
merged.push(tag);
|
|
490
|
+
}
|
|
491
|
+
if (merged.length !== _value.length) setValue(merged);
|
|
492
|
+
if (clearSearchOnChange) setSearch("");
|
|
493
|
+
});
|
|
436
494
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
);
|
|
495
|
+
// Stable so each chip's `onRemove` closure is stable too (it used to depend on
|
|
496
|
+
// `_value`, giving every chip a fresh callback on every render).
|
|
497
|
+
const removeTag = useCallbackRef((index: number) => {
|
|
498
|
+
const next = _value.slice();
|
|
499
|
+
const [removed] = next.splice(index, 1);
|
|
500
|
+
setValue(next);
|
|
501
|
+
if (removed != null) onRemove?.(removed);
|
|
502
|
+
});
|
|
446
503
|
|
|
447
504
|
const suggestions = React.useMemo(() => filterPickedTags(parsed, _value), [parsed, _value]);
|
|
448
505
|
const filterFn = filter ?? defaultOptionsFilter;
|
|
@@ -475,15 +532,12 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
475
532
|
setActiveValue(flatOptions[nextIndex].value);
|
|
476
533
|
};
|
|
477
534
|
|
|
478
|
-
const handleSubmit =
|
|
479
|
-
(optionValue
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
[onOptionSubmit, addTag],
|
|
484
|
-
);
|
|
535
|
+
const handleSubmit = useCallbackRef((optionValue: string) => {
|
|
536
|
+
onOptionSubmit?.(optionValue);
|
|
537
|
+
addTag(optionValue);
|
|
538
|
+
});
|
|
485
539
|
|
|
486
|
-
const handleKeyDown
|
|
540
|
+
const handleKeyDown = useCallbackRef<[React.KeyboardEvent<HTMLInputElement>], void>((event) => {
|
|
487
541
|
if (disabled || readOnly) return;
|
|
488
542
|
const trimmed = search.trim();
|
|
489
543
|
|
|
@@ -531,9 +585,9 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
531
585
|
break;
|
|
532
586
|
}
|
|
533
587
|
onKeyDown?.(event);
|
|
534
|
-
};
|
|
588
|
+
});
|
|
535
589
|
|
|
536
|
-
const handleChange
|
|
590
|
+
const handleChange = useCallbackRef<[React.ChangeEvent<HTMLInputElement>], void>((event) => {
|
|
537
591
|
const newSearch = event.currentTarget.value;
|
|
538
592
|
setSearch(newSearch);
|
|
539
593
|
if (newSearch.length > 0) {
|
|
@@ -542,12 +596,12 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
542
596
|
combobox.closeDropdown();
|
|
543
597
|
}
|
|
544
598
|
if (selectFirstOptionOnChange) selectFirstPending.current = true;
|
|
545
|
-
};
|
|
599
|
+
});
|
|
546
600
|
|
|
547
601
|
// Split a pasted string into tags on `splitChars` (combined with any pending search),
|
|
548
602
|
// mirroring Mantine's paste behaviour. Web-only: native `TextInput` has no paste event
|
|
549
603
|
// in this path, so a multi-value paste lands as one tag (the documented web-functional model).
|
|
550
|
-
const handlePaste
|
|
604
|
+
const handlePaste = useCallbackRef<[React.ClipboardEvent<HTMLInputElement>], void>((event) => {
|
|
551
605
|
onPaste?.(event);
|
|
552
606
|
if (disabled || readOnly) return;
|
|
553
607
|
const pasted = event.clipboardData?.getData("text/plain") ?? "";
|
|
@@ -555,24 +609,24 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
555
609
|
if (tags.length === 0) return;
|
|
556
610
|
event.preventDefault();
|
|
557
611
|
commitTags(tags);
|
|
558
|
-
};
|
|
612
|
+
});
|
|
559
613
|
|
|
560
|
-
const handleFocus
|
|
614
|
+
const handleFocus = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
|
|
561
615
|
onFocus?.(event);
|
|
562
|
-
};
|
|
616
|
+
});
|
|
563
617
|
|
|
564
|
-
const handleBlur
|
|
618
|
+
const handleBlur = useCallbackRef<[React.FocusEvent<HTMLInputElement>], void>((event) => {
|
|
565
619
|
combobox.closeDropdown();
|
|
566
620
|
if (acceptValueOnBlur) addTag(search);
|
|
567
621
|
else setSearch("");
|
|
568
622
|
onBlur?.(event);
|
|
569
|
-
};
|
|
623
|
+
});
|
|
570
624
|
|
|
571
|
-
const handleClear =
|
|
625
|
+
const handleClear = useCallbackRef(() => {
|
|
572
626
|
setValue([]);
|
|
573
627
|
setSearch("");
|
|
574
628
|
onClear?.();
|
|
575
|
-
}
|
|
629
|
+
});
|
|
576
630
|
|
|
577
631
|
const canClear = clearable && _value.length > 0 && !disabled && !readOnly;
|
|
578
632
|
|
|
@@ -597,7 +651,6 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
597
651
|
styles,
|
|
598
652
|
clearButtonProps,
|
|
599
653
|
clearSectionMode,
|
|
600
|
-
triggerProps: __triggerProps,
|
|
601
654
|
onClear: handleClear,
|
|
602
655
|
removeTag,
|
|
603
656
|
onChangeText: handleChange,
|
|
@@ -606,9 +659,9 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
606
659
|
onBlur: handleBlur,
|
|
607
660
|
onPaste: handlePaste,
|
|
608
661
|
}),
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
|
|
662
|
+
// Deps are COMPLETE: every handler above is `useCallbackRef`-stable, so this memo
|
|
663
|
+
// genuinely hits. `__triggerProps` is deliberately absent — it rides its own
|
|
664
|
+
// context (it is rebuilt every render and only the Trigger reads it).
|
|
612
665
|
[
|
|
613
666
|
combobox,
|
|
614
667
|
size,
|
|
@@ -629,28 +682,43 @@ function TagsInputRoot(props: TagsInputRootProps) {
|
|
|
629
682
|
styles,
|
|
630
683
|
clearButtonProps,
|
|
631
684
|
clearSectionMode,
|
|
632
|
-
__triggerProps,
|
|
633
685
|
removeTag,
|
|
686
|
+
handleClear,
|
|
687
|
+
handleChange,
|
|
688
|
+
handleKeyDown,
|
|
689
|
+
handleFocus,
|
|
690
|
+
handleBlur,
|
|
691
|
+
handlePaste,
|
|
634
692
|
],
|
|
635
693
|
);
|
|
636
694
|
|
|
695
|
+
// Chip-only slice: no `search`, so typing cannot re-render the tag chips.
|
|
696
|
+
const chipCtx = React.useMemo<TagsInputChipContextValue>(
|
|
697
|
+
() => ({ pillSize, disabled, readOnly, renderPill, styles, removeTag }),
|
|
698
|
+
[pillSize, disabled, readOnly, renderPill, styles, removeTag],
|
|
699
|
+
);
|
|
700
|
+
|
|
637
701
|
const s = slotStyles<TagsInputStyles>(styles, TAGS_INPUT_SLOT_KEYS, "TagsInput");
|
|
638
702
|
|
|
639
703
|
return (
|
|
640
704
|
<TagsInputContext.Provider value={ctx}>
|
|
641
|
-
<
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
705
|
+
<TagsInputChipContext.Provider value={chipCtx}>
|
|
706
|
+
<TagsInputTriggerPropsContext.Provider value={__triggerProps}>
|
|
707
|
+
<Combobox
|
|
708
|
+
position="bottom"
|
|
709
|
+
width="target"
|
|
710
|
+
// Deprecated `comboboxProps` alias merged OVER the `root` slot sugar
|
|
711
|
+
// ("explicit beats sugar").
|
|
712
|
+
{...s.merge("root", comboboxProps)}
|
|
713
|
+
store={combobox}
|
|
714
|
+
onOptionSubmit={handleSubmit}
|
|
715
|
+
size={size}
|
|
716
|
+
readOnly={readOnly}
|
|
717
|
+
>
|
|
718
|
+
{children}
|
|
719
|
+
</Combobox>
|
|
720
|
+
</TagsInputTriggerPropsContext.Provider>
|
|
721
|
+
</TagsInputChipContext.Provider>
|
|
654
722
|
</TagsInputContext.Provider>
|
|
655
723
|
);
|
|
656
724
|
}
|
|
@@ -721,7 +789,7 @@ const TagsInputTrigger = React.forwardRef<TagsInputRef, TagsInputTriggerProps>(
|
|
|
721
789
|
// so a composable caller and the sugar caller resolve to the same trigger.
|
|
722
790
|
// Explicit props on `<TagsInput.Trigger>` win over the funneled ones, which in
|
|
723
791
|
// turn win over the `trigger` slot sugar.
|
|
724
|
-
const funneled =
|
|
792
|
+
const funneled = React.useContext(TagsInputTriggerPropsContext) ?? EMPTY_TRIGGER_PROPS;
|
|
725
793
|
const { placeholder: funneledPlaceholder, ref: funneledRef, ...funneledRest } = funneled;
|
|
726
794
|
|
|
727
795
|
const {
|
|
@@ -754,28 +822,12 @@ const TagsInputTrigger = React.forwardRef<TagsInputRef, TagsInputTriggerProps>(
|
|
|
754
822
|
mode: ctx.clearSectionMode,
|
|
755
823
|
});
|
|
756
824
|
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
onRemove: () => ctx.removeTag(index),
|
|
764
|
-
disabled: ctx.disabled || ctx.readOnly,
|
|
765
|
-
})}
|
|
766
|
-
</React.Fragment>
|
|
767
|
-
) : (
|
|
768
|
-
<TagsInputPill
|
|
769
|
-
key={`${item}-${index}`}
|
|
770
|
-
size={ctx.pillSize}
|
|
771
|
-
withRemoveButton={!ctx.readOnly}
|
|
772
|
-
disabled={ctx.disabled}
|
|
773
|
-
onRemove={() => ctx.removeTag(index)}
|
|
774
|
-
>
|
|
775
|
-
{item}
|
|
776
|
-
</TagsInputPill>
|
|
777
|
-
),
|
|
778
|
-
);
|
|
825
|
+
// `TagsInputChip` is memoized on `{ value, index }` and subscribes to the
|
|
826
|
+
// search-free chip context, so a keystroke re-renders the field but skips every
|
|
827
|
+
// chip. (The `renderPill` hatch and the `pill` slot sugar both live inside it.)
|
|
828
|
+
const pills = ctx.value.map((item, index) => (
|
|
829
|
+
<TagsInputChip key={`${item}-${index}`} value={item} index={index} />
|
|
830
|
+
));
|
|
779
831
|
|
|
780
832
|
return (
|
|
781
833
|
<Combobox.Target>
|
|
@@ -1059,7 +1111,7 @@ const TagsInputComponent = React.forwardRef<TagsInputRef, TagsInputProps>(
|
|
|
1059
1111
|
|
|
1060
1112
|
// The remaining chrome props are funneled to `TagsInput.Trigger` via Root context
|
|
1061
1113
|
// so the sugar path and the composable path converge on the same trigger element.
|
|
1062
|
-
const triggerProps:
|
|
1114
|
+
const triggerProps: TagsInputFunneledTriggerProps = {
|
|
1063
1115
|
...inputProps,
|
|
1064
1116
|
placeholder,
|
|
1065
1117
|
// Forward ONLY the field-chrome slots to the trigger's `PillsInput` →
|
package/src/Tooltip/Tooltip.tsx
CHANGED
|
@@ -68,13 +68,27 @@ export interface TooltipEvents {
|
|
|
68
68
|
/* Styled label frame */
|
|
69
69
|
/* -------------------------------------------------------------------------- */
|
|
70
70
|
|
|
71
|
+
/*
|
|
72
|
+
* RAMP NOTE (`$colorN` steps below are MIRRORED, i.e. `13 - n`)
|
|
73
|
+
* ------------------------------------------------------------
|
|
74
|
+
* `name: "Tooltip"` collides with an `inverse`-templated entry in Tamagui's
|
|
75
|
+
* (deprecated) `defaultComponentThemes`. Until `core/config/themes.ts` set
|
|
76
|
+
* `componentThemes: false`, this frame — and `TooltipText` inside it — resolved
|
|
77
|
+
* against a `<scheme>_Tooltip` theme whose whole `$color1…$color12` ramp was
|
|
78
|
+
* reversed, so the authored `$color9` fill actually painted step 4 and the
|
|
79
|
+
* authored `$color1` label actually painted step 12. The steps are written
|
|
80
|
+
* pre-mirrored here so the tooltip keeps its shipped light-chip appearance now
|
|
81
|
+
* that nothing flips the ramp under it. Restoring the canonical filled pairing
|
|
82
|
+
* (`$color9` fill + `$color1` label) is a deliberate design change — see the
|
|
83
|
+
* changeset.
|
|
84
|
+
*/
|
|
71
85
|
const TooltipLabelFrame = styled(Box, {
|
|
72
86
|
name: "Tooltip",
|
|
73
87
|
// `fixed` is web-only viewport positioning; React Native supports only
|
|
74
88
|
// `absolute`/`relative`/`static`. Pick the platform-correct value (mirrors
|
|
75
89
|
// Popover.Dropdown) so the label isn't laid out in normal flow on native.
|
|
76
90
|
position: isWeb ? ("fixed" as const) : ("absolute" as const),
|
|
77
|
-
backgroundColor: "$
|
|
91
|
+
backgroundColor: "$color4",
|
|
78
92
|
paddingVertical: "$xxs",
|
|
79
93
|
paddingHorizontal: "$xs",
|
|
80
94
|
borderRadius: "$sm",
|
|
@@ -94,7 +108,8 @@ const TooltipLabelFrame = styled(Box, {
|
|
|
94
108
|
|
|
95
109
|
const TooltipText = styled(Text, {
|
|
96
110
|
name: "TooltipText",
|
|
97
|
-
|
|
111
|
+
// MIRRORED step — renders inside `TooltipLabelFrame`. See the RAMP NOTE above.
|
|
112
|
+
color: "$color12",
|
|
98
113
|
fontSize: "$sm",
|
|
99
114
|
});
|
|
100
115
|
|
|
@@ -346,12 +361,23 @@ function TooltipTarget({ children, refProp: refPropOverride }: TooltipTargetProp
|
|
|
346
361
|
const mergedRef = useMergedRef<TamaguiElement>(ctx.setReferenceRef, childRef);
|
|
347
362
|
|
|
348
363
|
const child = children as React.ReactElement<InteractionProps>;
|
|
349
|
-
const handlers = buildTargetHandlers(child.props, ctx);
|
|
350
364
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
365
|
+
// Memoised on the child's props + the target context. A Tooltip re-renders on
|
|
366
|
+
// every position update while open, and each of those rebuilt 2–5 handler
|
|
367
|
+
// closures and cloned a NEW element for the trigger — re-rendering the whole
|
|
368
|
+
// trigger subtree. `children` is a prop, so its identity is stable across
|
|
369
|
+
// Tooltip's own state churn; when nothing the clone depends on changed, the
|
|
370
|
+
// memo returns the SAME element and React skips the subtree entirely.
|
|
371
|
+
const handlers = React.useMemo(() => buildTargetHandlers(child.props, ctx), [child.props, ctx]);
|
|
372
|
+
|
|
373
|
+
return React.useMemo(
|
|
374
|
+
() =>
|
|
375
|
+
React.cloneElement(child, {
|
|
376
|
+
[refProp]: mergedRef,
|
|
377
|
+
...handlers,
|
|
378
|
+
} as Partial<InteractionProps> & React.Attributes),
|
|
379
|
+
[child, refProp, mergedRef, handlers],
|
|
380
|
+
);
|
|
355
381
|
}
|
|
356
382
|
|
|
357
383
|
const TooltipBase = TooltipLabelFrame.styleable<TooltipProps>(function Tooltip(props, ref) {
|
package/src/Tree/Tree.tsx
CHANGED
|
@@ -237,7 +237,10 @@ const TreeNode = React.memo(function TreeNode(props: TreeNodePartProps) {
|
|
|
237
237
|
|
|
238
238
|
const hasChildren = Array.isArray(node.children) && node.children.length > 0;
|
|
239
239
|
const expanded = controller.expandedState[node.value] ?? false;
|
|
240
|
-
|
|
240
|
+
// `Set` lookup, not an `Array.includes` scan — this runs once per rendered node,
|
|
241
|
+
// so the scan made selection O(nodes × selected) per render. See `selectedLookup`
|
|
242
|
+
// in `use-tree.ts`.
|
|
243
|
+
const selected = controller.isNodeSelected(node.value);
|
|
241
244
|
|
|
242
245
|
const handlePress = React.useCallback(() => {
|
|
243
246
|
if (hasChildren && expandOnClick) {
|