@knitui/components 0.5.0 → 0.6.1
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/color.js +8 -1
- package/lib/commonjs/internal/color.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/color.js +8 -1
- package/lib/module/internal/color.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 +15 -15
- package/lib/typescript/Accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/ActionIcon/ActionIcon.d.ts +13 -13
- package/lib/typescript/Alert/Alert.d.ts +19 -19
- package/lib/typescript/Alert/Alert.d.ts.map +1 -1
- package/lib/typescript/Anchor/Anchor.d.ts +9 -9
- package/lib/typescript/AngleSlider/AngleSlider.d.ts +8 -8
- package/lib/typescript/AngleSlider/AngleSlider.d.ts.map +1 -1
- package/lib/typescript/Autocomplete/Autocomplete.d.ts +18 -44
- package/lib/typescript/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/lib/typescript/Avatar/Avatar.d.ts +38 -38
- package/lib/typescript/Badge/Badge.d.ts +20 -20
- package/lib/typescript/Badge/Badge.d.ts.map +1 -1
- package/lib/typescript/Blockquote/Blockquote.d.ts +8 -8
- package/lib/typescript/Breadcrumbs/Breadcrumbs.d.ts +8 -8
- package/lib/typescript/Burger/Burger.d.ts +4 -4
- package/lib/typescript/Button/Button.d.ts +13 -13
- 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 +15 -15
- package/lib/typescript/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/CloseButton/CloseButton.d.ts +7 -7
- package/lib/typescript/Code/Code.d.ts +6 -6
- 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 +9 -9
- 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 +7 -7
- package/lib/typescript/Container/Container.d.ts +3 -3
- package/lib/typescript/Dialog/Dialog.d.ts +6 -6
- package/lib/typescript/Drawer/Drawer.d.ts +4 -4
- package/lib/typescript/Fieldset/Fieldset.d.ts +11 -11
- 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 +4 -4
- 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 +25 -25
- package/lib/typescript/Image/createImage.d.ts +36 -36
- package/lib/typescript/Indicator/Indicator.d.ts +4 -4
- package/lib/typescript/Indicator/Indicator.d.ts.map +1 -1
- package/lib/typescript/Input/Input.d.ts +61 -61
- package/lib/typescript/Input/Input.d.ts.map +1 -1
- package/lib/typescript/Input/Input.native.d.ts +79 -79
- package/lib/typescript/Input/shared.d.ts +66 -66
- package/lib/typescript/Input/shared.d.ts.map +1 -1
- package/lib/typescript/InputBase/InputBase.d.ts +4 -4
- package/lib/typescript/Kbd/Kbd.d.ts +23 -23
- package/lib/typescript/KeyboardAvoidingView/KeyboardAvoidingView.d.ts +1 -1
- package/lib/typescript/KeyboardAwareScrollView/KeyboardAwareScrollView.d.ts +1 -1
- package/lib/typescript/List/List.d.ts +14 -14
- package/lib/typescript/Loader/Loader.d.ts.map +1 -1
- package/lib/typescript/LoadingOverlay/LoadingOverlay.d.ts +2 -2
- package/lib/typescript/Mark/Mark.d.ts +23 -23
- package/lib/typescript/Marquee/Marquee.d.ts +4 -4
- package/lib/typescript/MaskInput/MaskInput.d.ts +4 -4
- package/lib/typescript/Menu/Menu.d.ts +28 -28
- package/lib/typescript/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/Modal/Modal.d.ts +10 -10
- package/lib/typescript/MultiSelect/MultiSelect.d.ts +17 -62
- package/lib/typescript/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/lib/typescript/NavLink/NavLink.d.ts +19 -19
- package/lib/typescript/Notification/Notification.d.ts +12 -12
- package/lib/typescript/Notification/Notification.d.ts.map +1 -1
- package/lib/typescript/NumberFormatter/NumberFormatter.d.ts +6 -6
- package/lib/typescript/NumberFormatter/NumberFormatter.d.ts.map +1 -1
- package/lib/typescript/NumberInput/NumberInput.d.ts +15 -15
- package/lib/typescript/Overlay/Overlay.d.ts +3 -3
- package/lib/typescript/Paper/Paper.d.ts +8 -40
- package/lib/typescript/Paper/Paper.d.ts.map +1 -1
- package/lib/typescript/Paragraph/Paragraph.d.ts +6 -6
- package/lib/typescript/PasswordInput/PasswordInput.d.ts +19 -19
- package/lib/typescript/Pill/Pill.d.ts +19 -19
- package/lib/typescript/Pill/Pill.d.ts.map +1 -1
- package/lib/typescript/PinInput/PinInput.d.ts +66 -66
- package/lib/typescript/Popover/Popover.shared.d.ts +3 -3
- package/lib/typescript/Progress/Progress.d.ts +4 -4
- package/lib/typescript/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/Radio/Radio.d.ts +8 -8
- package/lib/typescript/Rating/Rating.d.ts +2 -2
- package/lib/typescript/RollingNumber/RollingNumber.d.ts +4 -4
- 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 +4 -4
- package/lib/typescript/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/typescript/Select/Select.d.ts +22 -51
- package/lib/typescript/Select/Select.d.ts.map +1 -1
- package/lib/typescript/Separator/Separator.d.ts +13 -13
- package/lib/typescript/Skeleton/Skeleton.d.ts +3 -3
- package/lib/typescript/Skeleton/Skeleton.d.ts.map +1 -1
- package/lib/typescript/Slider/Slider.d.ts +12 -12
- package/lib/typescript/Slider/Slider.d.ts.map +1 -1
- package/lib/typescript/Spoiler/Spoiler.d.ts +4 -4
- package/lib/typescript/Spoiler/Spoiler.d.ts.map +1 -1
- package/lib/typescript/Stepper/Stepper.d.ts +16 -16
- package/lib/typescript/Switch/Switch.d.ts +18 -7
- package/lib/typescript/Switch/Switch.d.ts.map +1 -1
- package/lib/typescript/Table/Table.d.ts +59 -53
- package/lib/typescript/Table/Table.d.ts.map +1 -1
- package/lib/typescript/TableOfContents/TableOfContents.d.ts +4 -4
- package/lib/typescript/TableOfContents/TableOfContents.d.ts.map +1 -1
- package/lib/typescript/Tabs/Tabs.d.ts +15 -15
- package/lib/typescript/TagsInput/TagsInput.d.ts +15 -49
- package/lib/typescript/TagsInput/TagsInput.d.ts.map +1 -1
- package/lib/typescript/Text/Text.d.ts +2 -2
- package/lib/typescript/TextInput/TextInput.d.ts +4 -4
- package/lib/typescript/Textarea/Textarea.d.ts +4 -4
- package/lib/typescript/ThemeIcon/ThemeIcon.d.ts +7 -7
- package/lib/typescript/Title/Title.d.ts +9 -9
- package/lib/typescript/Tooltip/Tooltip.d.ts +4 -4
- package/lib/typescript/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/typescript/Tree/Tree.d.ts +8 -8
- 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 +36 -62
- 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/VisuallyHidden/VisuallyHidden.d.ts +6 -6
- 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/InlineControl.d.ts +6 -6
- package/lib/typescript/internal/color.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 +7 -7
- 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/color.ts +8 -1
- 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
package/src/Slider/Slider.tsx
CHANGED
|
@@ -199,10 +199,24 @@ const SliderTrackContainer = styled(Box, {
|
|
|
199
199
|
* the raw `SLIDER_TRACK` number alongside the matching centring offset — the
|
|
200
200
|
* shared `sliderTrackVariant` (which only sets `height`) can't express the
|
|
201
201
|
* vertical axis, so the local number map is the geometry source here. */
|
|
202
|
+
/*
|
|
203
|
+
* RAMP NOTE (`$colorN` steps below are MIRRORED, i.e. `13 - n`)
|
|
204
|
+
* ------------------------------------------------------------
|
|
205
|
+
* `SliderTrack` and `SliderThumb` collide by NAME with two entries in Tamagui's
|
|
206
|
+
* (deprecated) `defaultComponentThemes`, both templated `inverse`. Until
|
|
207
|
+
* `core/config/themes.ts` set `componentThemes: false` those frames — and every
|
|
208
|
+
* descendant, so `SliderBar` and `SliderLabelBubble` too — rendered inside a
|
|
209
|
+
* `<scheme>_SliderTrack` / `<scheme>_SliderThumb` theme whose ENTIRE `$color1…
|
|
210
|
+
* $color12` ramp was reversed. The steps here are therefore written pre-mirrored
|
|
211
|
+
* (`$color3` → `$color10`, `$color9` → `$color4`, `$color1` → `$color12`, …) so
|
|
212
|
+
* the slider keeps its shipped appearance now that the ramp is no longer flipped
|
|
213
|
+
* under it. See the changeset: un-mirroring these is a deliberate design change,
|
|
214
|
+
* not a cleanup.
|
|
215
|
+
*/
|
|
202
216
|
const SliderTrack = styled(Box, {
|
|
203
217
|
name: "SliderTrack",
|
|
204
218
|
position: "absolute",
|
|
205
|
-
backgroundColor: "$
|
|
219
|
+
backgroundColor: "$color10",
|
|
206
220
|
variants: { radius: radiusVariant } as const,
|
|
207
221
|
defaultVariants: { radius: "xl" },
|
|
208
222
|
});
|
|
@@ -211,7 +225,7 @@ const SliderTrack = styled(Box, {
|
|
|
211
225
|
const SliderBar = styled(Box, {
|
|
212
226
|
name: "SliderBar",
|
|
213
227
|
position: "absolute",
|
|
214
|
-
backgroundColor: "$
|
|
228
|
+
backgroundColor: "$color4",
|
|
215
229
|
variants: { radius: radiusVariant } as const,
|
|
216
230
|
defaultVariants: { radius: "xl" },
|
|
217
231
|
});
|
|
@@ -221,12 +235,12 @@ const SliderThumb = styled(Box, {
|
|
|
221
235
|
position: "absolute",
|
|
222
236
|
alignItems: "center",
|
|
223
237
|
justifyContent: "center",
|
|
224
|
-
backgroundColor: "$
|
|
238
|
+
backgroundColor: "$color12",
|
|
225
239
|
borderWidth: 2,
|
|
226
|
-
borderColor: "$
|
|
240
|
+
borderColor: "$color4",
|
|
227
241
|
borderRadius: 9999,
|
|
228
242
|
...webCursor("pointer"),
|
|
229
|
-
hoverStyle: { borderColor: "$
|
|
243
|
+
hoverStyle: { borderColor: "$color3" },
|
|
230
244
|
...focusRingStyle,
|
|
231
245
|
});
|
|
232
246
|
|
|
@@ -288,8 +302,10 @@ const SliderLabelBubble = styled(Text, {
|
|
|
288
302
|
paddingHorizontal: 6,
|
|
289
303
|
paddingVertical: 2,
|
|
290
304
|
borderRadius: "$sm",
|
|
291
|
-
|
|
292
|
-
|
|
305
|
+
// MIRRORED steps — this renders inside `SliderThumb`, which used to invert the
|
|
306
|
+
// whole ramp under it. See the RAMP NOTE above `SliderTrack`.
|
|
307
|
+
backgroundColor: "$color4",
|
|
308
|
+
color: "$color12",
|
|
293
309
|
fontSize: "$xs",
|
|
294
310
|
pointerEvents: "none",
|
|
295
311
|
// Force a single line cross-platform. Safe here (unlike inside the thumb)
|
|
@@ -340,6 +356,114 @@ const SLIDER_SLOT_KEYS = [
|
|
|
340
356
|
"label",
|
|
341
357
|
] as const satisfies readonly (keyof SliderStyles)[];
|
|
342
358
|
|
|
359
|
+
/* -------------------------------------------------------------------------- */
|
|
360
|
+
/* Marks — memoized subtree (shared by Slider + RangeSlider) */
|
|
361
|
+
/* -------------------------------------------------------------------------- */
|
|
362
|
+
|
|
363
|
+
interface SliderMarkItemProps {
|
|
364
|
+
/** Position along the track as a `0–100` percentage. */
|
|
365
|
+
markPct: number;
|
|
366
|
+
label?: React.ReactNode;
|
|
367
|
+
filled: boolean;
|
|
368
|
+
vertical: boolean;
|
|
369
|
+
markProps?: Partial<GetProps<typeof SliderMarkDot>>;
|
|
370
|
+
markLabelProps?: Partial<GetProps<typeof SliderMarkLabel>>;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* ONE mark dot (+ its optional label), memoized on its own props.
|
|
375
|
+
*
|
|
376
|
+
* The marks used to be re-mapped inline in the slider render body, so a drag —
|
|
377
|
+
* which calls `setValue` on every single pointermove — re-rendered 2–3 Tamagui
|
|
378
|
+
* frames per mark per frame (≈45 frames for a 20-mark slider). They can't be
|
|
379
|
+
* memoized as one opaque block keyed on `(marks, min, max, orientation)` alone,
|
|
380
|
+
* because `filled` genuinely depends on the live value: the mark palette is part
|
|
381
|
+
* of the value readout. So the memo is PER MARK instead — the parent
|
|
382
|
+
* `SliderMarks` re-maps cheaply (no styled components) on every value change, but
|
|
383
|
+
* only the 0–1 marks whose `filled` state actually FLIPPED re-render any frames.
|
|
384
|
+
* The visual result is byte-identical to the inline version.
|
|
385
|
+
*/
|
|
386
|
+
const SliderMarkItem = React.memo(function SliderMarkItem({
|
|
387
|
+
markPct,
|
|
388
|
+
label,
|
|
389
|
+
filled,
|
|
390
|
+
vertical,
|
|
391
|
+
markProps,
|
|
392
|
+
markLabelProps,
|
|
393
|
+
}: SliderMarkItemProps) {
|
|
394
|
+
const dotPos: Partial<BoxProps> = vertical
|
|
395
|
+
? { bottom: pct(markPct), left: "50%", marginLeft: -3, marginBottom: -3 }
|
|
396
|
+
: { left: pct(markPct), top: "50%", marginLeft: -3, marginTop: -3 };
|
|
397
|
+
const labelPos: Partial<BoxProps> = vertical
|
|
398
|
+
? { left: "100%", bottom: pct(markPct), marginLeft: 8, marginBottom: -8 }
|
|
399
|
+
: { top: "100%", left: pct(markPct), marginTop: 8, marginLeft: -12, minWidth: 24 };
|
|
400
|
+
return (
|
|
401
|
+
<>
|
|
402
|
+
<SliderMarkDot
|
|
403
|
+
filled={filled}
|
|
404
|
+
{...markProps}
|
|
405
|
+
{...(dotPos as GetProps<typeof SliderMarkDot>)}
|
|
406
|
+
/>
|
|
407
|
+
{label != null ? (
|
|
408
|
+
<SliderMarkLabel {...markLabelProps} {...(labelPos as GetProps<typeof SliderMarkLabel>)}>
|
|
409
|
+
{label}
|
|
410
|
+
</SliderMarkLabel>
|
|
411
|
+
) : null}
|
|
412
|
+
</>
|
|
413
|
+
);
|
|
414
|
+
});
|
|
415
|
+
|
|
416
|
+
interface SliderMarksProps {
|
|
417
|
+
marks: SliderMark[];
|
|
418
|
+
min: number;
|
|
419
|
+
max: number;
|
|
420
|
+
vertical: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Inclusive lower bound of the filled span. `-Infinity` for the single-value
|
|
423
|
+
* `Slider` (everything up to the thumb is filled); the lower thumb for
|
|
424
|
+
* `RangeSlider`.
|
|
425
|
+
*/
|
|
426
|
+
filledFrom: number;
|
|
427
|
+
/** Inclusive upper bound of the filled span. */
|
|
428
|
+
filledTo: number;
|
|
429
|
+
markProps?: Partial<GetProps<typeof SliderMarkDot>>;
|
|
430
|
+
markLabelProps?: Partial<GetProps<typeof SliderMarkLabel>>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* The marks layer. Memoized so a parent re-render that changes nothing about the
|
|
435
|
+
* marks (hover, focus, label-bubble visibility, a `styles` slot that isn't
|
|
436
|
+
* `mark`/`markLabel`) doesn't touch them at all; when the value DOES change, the
|
|
437
|
+
* per-mark memo above keeps the work proportional to the marks that actually
|
|
438
|
+
* changed rather than to the mark count.
|
|
439
|
+
*/
|
|
440
|
+
const SliderMarks = React.memo(function SliderMarks({
|
|
441
|
+
marks,
|
|
442
|
+
min,
|
|
443
|
+
max,
|
|
444
|
+
vertical,
|
|
445
|
+
filledFrom,
|
|
446
|
+
filledTo,
|
|
447
|
+
markProps,
|
|
448
|
+
markLabelProps,
|
|
449
|
+
}: SliderMarksProps) {
|
|
450
|
+
return (
|
|
451
|
+
<>
|
|
452
|
+
{marks.map((mark, index) => (
|
|
453
|
+
<SliderMarkItem
|
|
454
|
+
key={index}
|
|
455
|
+
markPct={valueToPct(mark.value, min, max)}
|
|
456
|
+
label={mark.label}
|
|
457
|
+
filled={mark.value >= filledFrom && mark.value <= filledTo}
|
|
458
|
+
vertical={vertical}
|
|
459
|
+
markProps={markProps}
|
|
460
|
+
markLabelProps={markLabelProps}
|
|
461
|
+
/>
|
|
462
|
+
))}
|
|
463
|
+
</>
|
|
464
|
+
);
|
|
465
|
+
});
|
|
466
|
+
|
|
343
467
|
/* -------------------------------------------------------------------------- */
|
|
344
468
|
/* Shared prop surface */
|
|
345
469
|
/* -------------------------------------------------------------------------- */
|
|
@@ -674,33 +798,19 @@ const SliderComponent = SliderRoot.styleable<SliderProps>(function Slider(props,
|
|
|
674
798
|
<SliderBar radius={radius} {...s.get("bar")} {...(fill as GetProps<typeof SliderBar>)} />
|
|
675
799
|
</SliderTrack>
|
|
676
800
|
|
|
677
|
-
{marks
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
{...s.get("mark")}
|
|
691
|
-
{...(dotPos as GetProps<typeof SliderMarkDot>)}
|
|
692
|
-
/>
|
|
693
|
-
{mark.label != null ? (
|
|
694
|
-
<SliderMarkLabel
|
|
695
|
-
{...s.get("markLabel")}
|
|
696
|
-
{...(labelPos as GetProps<typeof SliderMarkLabel>)}
|
|
697
|
-
>
|
|
698
|
-
{mark.label}
|
|
699
|
-
</SliderMarkLabel>
|
|
700
|
-
) : null}
|
|
701
|
-
</React.Fragment>
|
|
702
|
-
);
|
|
703
|
-
})}
|
|
801
|
+
{marks ? (
|
|
802
|
+
<SliderMarks
|
|
803
|
+
marks={marks}
|
|
804
|
+
min={dMin}
|
|
805
|
+
max={dMax}
|
|
806
|
+
vertical={vertical}
|
|
807
|
+
// Single thumb: everything at or below the value is filled.
|
|
808
|
+
filledFrom={-Infinity}
|
|
809
|
+
filledTo={current}
|
|
810
|
+
markProps={s.get("mark")}
|
|
811
|
+
markLabelProps={s.get("markLabel")}
|
|
812
|
+
/>
|
|
813
|
+
) : null}
|
|
704
814
|
|
|
705
815
|
<SliderThumb
|
|
706
816
|
width={knob.value}
|
|
@@ -1054,33 +1164,19 @@ const RangeSliderComponent = SliderRoot.styleable<RangeSliderProps>(
|
|
|
1054
1164
|
/>
|
|
1055
1165
|
</SliderTrack>
|
|
1056
1166
|
|
|
1057
|
-
{marks
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
{...s.get("mark")}
|
|
1071
|
-
{...(dotPos as GetProps<typeof SliderMarkDot>)}
|
|
1072
|
-
/>
|
|
1073
|
-
{mark.label != null ? (
|
|
1074
|
-
<SliderMarkLabel
|
|
1075
|
-
{...s.get("markLabel")}
|
|
1076
|
-
{...(labelPos as GetProps<typeof SliderMarkLabel>)}
|
|
1077
|
-
>
|
|
1078
|
-
{mark.label}
|
|
1079
|
-
</SliderMarkLabel>
|
|
1080
|
-
) : null}
|
|
1081
|
-
</React.Fragment>
|
|
1082
|
-
);
|
|
1083
|
-
})}
|
|
1167
|
+
{marks ? (
|
|
1168
|
+
<SliderMarks
|
|
1169
|
+
marks={marks}
|
|
1170
|
+
min={dMin}
|
|
1171
|
+
max={dMax}
|
|
1172
|
+
vertical={vertical}
|
|
1173
|
+
// Two thumbs: the span BETWEEN them is filled.
|
|
1174
|
+
filledFrom={valA}
|
|
1175
|
+
filledTo={valB}
|
|
1176
|
+
markProps={s.get("mark")}
|
|
1177
|
+
markLabelProps={s.get("markLabel")}
|
|
1178
|
+
/>
|
|
1179
|
+
) : null}
|
|
1084
1180
|
|
|
1085
1181
|
{renderThumb(0, valA, pctA)}
|
|
1086
1182
|
{renderThumb(1, valB, pctB)}
|
package/src/Spoiler/Spoiler.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
isWeb,
|
|
7
7
|
styled,
|
|
8
8
|
type TamaguiElement,
|
|
9
|
-
useTheme,
|
|
10
9
|
withStaticProperties,
|
|
11
10
|
} from "@knitui/core";
|
|
12
11
|
import { useElementSize, useId, useReducedMotion, useUncontrolled } from "@knitui/hooks";
|
|
@@ -16,6 +15,7 @@ import { CollapseBox } from "../internal/collapse-box";
|
|
|
16
15
|
import { renderTextChild } from "../internal/render-text-child";
|
|
17
16
|
import { webCursor } from "../internal/style-props";
|
|
18
17
|
import { slotStyles, type SlotStyles } from "../internal/styles";
|
|
18
|
+
import { themeColorToCssVar } from "../internal/theme-color-web";
|
|
19
19
|
import { Text } from "../Text";
|
|
20
20
|
|
|
21
21
|
/* -------------------------------------------------------------------------- */
|
|
@@ -46,6 +46,26 @@ const SpoilerControl = styled(Text, {
|
|
|
46
46
|
pressStyle: { opacity: 0.7 },
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* The collapsed-state bottom fade (web only — `isWeb` gates it below; native gets
|
|
51
|
+
* no `backgroundImage`). Built ONCE at module scope: the gradient fades into the
|
|
52
|
+
* theme's `background`, and on web a token maps to its CSS custom property by
|
|
53
|
+
* pure string transform (`theme-color-web.ts`), so the `var()` tracks the active
|
|
54
|
+
* theme by itself.
|
|
55
|
+
*
|
|
56
|
+
* Previously this read `theme.background?.val` per render, which cost a
|
|
57
|
+
* `useTheme()` (`useThemeWithState` = useId + useRef + useReducer + a DEP-LESS
|
|
58
|
+
* `useEffect` that fires after every render) and — because reading a field off
|
|
59
|
+
* Tamagui's theme proxy calls its `track()` — registered every `Spoiler` as a
|
|
60
|
+
* theme subscriber, including on native where the fade isn't even painted. The
|
|
61
|
+
* old `?? "#fff"` last resort survives as the CSS variable's own fallback.
|
|
62
|
+
*/
|
|
63
|
+
const SPOILER_FADE_BACKGROUND = (() => {
|
|
64
|
+
const backgroundVar = themeColorToCssVar("$background");
|
|
65
|
+
return backgroundVar.startsWith("var(") ? `${backgroundVar.slice(0, -1)}, #fff)` : backgroundVar;
|
|
66
|
+
})();
|
|
67
|
+
const SPOILER_FADE_GRADIENT = `linear-gradient(to bottom, transparent, ${SPOILER_FADE_BACKGROUND})`;
|
|
68
|
+
|
|
49
69
|
/* -------------------------------------------------------------------------- */
|
|
50
70
|
/* Types */
|
|
51
71
|
/* -------------------------------------------------------------------------- */
|
|
@@ -168,8 +188,6 @@ const SpoilerBase = SpoilerRoot.styleable<SpoilerProps>(function Spoiler(props,
|
|
|
168
188
|
// Animate the reveal unless reduced motion / a 0 duration asks us to snap.
|
|
169
189
|
const animate = transitionDuration > 0 && !reduced;
|
|
170
190
|
|
|
171
|
-
const theme = useTheme();
|
|
172
|
-
|
|
173
191
|
const ariaLabel = show ? hideAriaLabel : showAriaLabel;
|
|
174
192
|
|
|
175
193
|
const toggle = React.useCallback(() => {
|
|
@@ -202,13 +220,7 @@ const SpoilerBase = SpoilerRoot.styleable<SpoilerProps>(function Spoiler(props,
|
|
|
202
220
|
...(spoilerActive ? { "aria-labelledby": controlId } : {}),
|
|
203
221
|
};
|
|
204
222
|
|
|
205
|
-
const webFade: WebFadeProps = isWeb
|
|
206
|
-
? {
|
|
207
|
-
backgroundImage: `linear-gradient(to bottom, transparent, ${String(
|
|
208
|
-
theme.background?.val ?? "#fff",
|
|
209
|
-
)})`,
|
|
210
|
-
}
|
|
211
|
-
: {};
|
|
223
|
+
const webFade: WebFadeProps = isWeb ? { backgroundImage: SPOILER_FADE_GRADIENT } : {};
|
|
212
224
|
|
|
213
225
|
return (
|
|
214
226
|
<SpoilerRoot ref={ref} id={rootId} {...s.merge("root", rest)}>
|
package/src/Stepper/Stepper.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
|
|
3
3
|
import { createStyledContext, type GetProps, styled, withStaticProperties } from "@knitui/core";
|
|
4
|
-
import { IconCheck } from "@knitui/icons";
|
|
4
|
+
import { IconCheck } from "@knitui/icons/IconCheck";
|
|
5
5
|
|
|
6
6
|
import { Box } from "../Box";
|
|
7
7
|
import { ControlIconProvider } from "../internal/ControlIconProvider";
|
package/src/Switch/Switch.tsx
CHANGED
|
@@ -112,7 +112,7 @@ const SwitchTrack = styled(Box, {
|
|
|
112
112
|
},
|
|
113
113
|
} as const,
|
|
114
114
|
|
|
115
|
-
defaultVariants: { size: "
|
|
115
|
+
defaultVariants: { size: "sm", on: false },
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
const SwitchThumb = styled(Box, {
|
|
@@ -128,20 +128,31 @@ const SwitchThumb = styled(Box, {
|
|
|
128
128
|
size: thumbSizeVariant,
|
|
129
129
|
} as const,
|
|
130
130
|
|
|
131
|
-
defaultVariants: { size: "
|
|
131
|
+
defaultVariants: { size: "sm" },
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Small dot inside the thumb that echoes the track colour.
|
|
136
|
+
*
|
|
137
|
+
* RAMP NOTE: the `$colorN` steps here are MIRRORED (`13 - n`). This renders
|
|
138
|
+
* inside `SwitchThumb`, whose name collides with an `inverse`-templated entry in
|
|
139
|
+
* Tamagui's (deprecated) `defaultComponentThemes`; until
|
|
140
|
+
* `core/config/themes.ts` set `componentThemes: false`, the dot resolved its ramp
|
|
141
|
+
* from a `<scheme>_SwitchThumb` theme with `$color1…$color12` fully reversed
|
|
142
|
+
* (`$color5` → step 8, `$color9` → step 4). Written pre-mirrored so the dot keeps
|
|
143
|
+
* its shipped appearance. (`SwitchThumb` itself is safe: `$white` is a TOKEN, not
|
|
144
|
+
* a theme value, so no inversion ever reached it.)
|
|
145
|
+
*/
|
|
135
146
|
const ThumbIndicator = styled(Box, {
|
|
136
147
|
name: "SwitchThumbIndicator",
|
|
137
148
|
width: "40%",
|
|
138
149
|
height: "40%",
|
|
139
150
|
borderRadius: 999,
|
|
140
|
-
backgroundColor: "$
|
|
151
|
+
backgroundColor: "$color8",
|
|
141
152
|
...transitionProps("fast"),
|
|
142
153
|
...animateOnlyProps(["backgroundColor"]),
|
|
143
154
|
variants: {
|
|
144
|
-
on: { true: { backgroundColor: "$
|
|
155
|
+
on: { true: { backgroundColor: "$color4" } },
|
|
145
156
|
} as const,
|
|
146
157
|
});
|
|
147
158
|
|
|
@@ -240,7 +251,7 @@ export interface SwitchProps
|
|
|
240
251
|
onChange?: (checked: boolean) => void;
|
|
241
252
|
/** @deprecated Tamagui-style alias for {@link SwitchProps.onChange}. */
|
|
242
253
|
onCheckedChange?: (checked: boolean) => void;
|
|
243
|
-
/** Controls the size of every element. @default '
|
|
254
|
+
/** Controls the size of every element. @default 'sm' */
|
|
244
255
|
size?: SwitchSize;
|
|
245
256
|
/** Inner label shown in the track when unchecked. */
|
|
246
257
|
offLabel?: React.ReactNode;
|
|
@@ -303,7 +314,7 @@ const SwitchComponent = SwitchTrack.styleable<SwitchProps>(function Switch(props
|
|
|
303
314
|
|
|
304
315
|
const ctx = React.useContext(SwitchGroupContext);
|
|
305
316
|
const inGroup = ctx != null && value != null;
|
|
306
|
-
const size = sizeProp ?? ctx?.size ?? "
|
|
317
|
+
const size = sizeProp ?? ctx?.size ?? "sm";
|
|
307
318
|
|
|
308
319
|
// When the user prefers reduced motion, drop the thumb-slide + colour
|
|
309
320
|
// transitions to a null transition (instant). The slide stays transform-based
|
|
@@ -472,7 +483,7 @@ export interface SwitchGroupProps extends Omit<GetProps<typeof GroupFrame>, "onC
|
|
|
472
483
|
defaultValue?: string[];
|
|
473
484
|
/** Called with the next array of selected values. */
|
|
474
485
|
onChange?: (value: string[]) => void;
|
|
475
|
-
/** Size shared with every child switch. @default '
|
|
486
|
+
/** Size shared with every child switch. @default 'sm' */
|
|
476
487
|
size?: SwitchSize;
|
|
477
488
|
/** Group label rendered above the switches. */
|
|
478
489
|
label?: React.ReactNode;
|
|
@@ -497,7 +508,7 @@ const SwitchGroup = GroupFrame.styleable<SwitchGroupProps>(function SwitchGroup(
|
|
|
497
508
|
value,
|
|
498
509
|
defaultValue,
|
|
499
510
|
onChange,
|
|
500
|
-
size = "
|
|
511
|
+
size = "sm",
|
|
501
512
|
label,
|
|
502
513
|
description,
|
|
503
514
|
readOnly,
|
package/src/Table/Table.tsx
CHANGED
|
@@ -62,6 +62,21 @@ const useTableContext = (): TableContextValue => {
|
|
|
62
62
|
return ctx;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* 0-based body-row index, provided by `Table.Tbody` around each `Table.Tr`;
|
|
67
|
+
* `undefined` outside a striped body (head/foot rows never stripe).
|
|
68
|
+
*
|
|
69
|
+
* Position is passed down by context rather than by cloning every row/cell with
|
|
70
|
+
* an injected prop: cloning re-allocated one element per row AND per cell on
|
|
71
|
+
* every render (a 500x8 table = ~4.5k throwaway elements) and, because the clone
|
|
72
|
+
* always produced fresh props, it also defeated any bail-out on referentially
|
|
73
|
+
* stable children.
|
|
74
|
+
*/
|
|
75
|
+
const TableRowIndexContext = React.createContext<number | undefined>(undefined);
|
|
76
|
+
|
|
77
|
+
/** `true` for the leading cell of a row — gates the column divider border. */
|
|
78
|
+
const TableFirstCellContext = React.createContext(false);
|
|
79
|
+
|
|
65
80
|
/* -------------------------------------------------------------------------- */
|
|
66
81
|
/* Frames */
|
|
67
82
|
/* -------------------------------------------------------------------------- */
|
|
@@ -122,24 +137,19 @@ type CellFrameProps = Omit<GetProps<typeof CellFrame>, "columnBorder" | "header"
|
|
|
122
137
|
|
|
123
138
|
export interface TableCellProps extends CellFrameProps {}
|
|
124
139
|
|
|
125
|
-
interface InternalTableCellProps extends TableCellProps {
|
|
126
|
-
/** @internal first-cell flag injected by `Table.Tr` (gates column borders). */
|
|
127
|
-
__first?: boolean;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
140
|
function makeCell(header: boolean, role: NonNullable<BoxProps["role"]>, displayName: string) {
|
|
131
|
-
const Cell = CellFrame.styleable<
|
|
141
|
+
const Cell = CellFrame.styleable<TableCellProps>(function Cell(props, ref) {
|
|
132
142
|
const ctx = useTableContext();
|
|
133
|
-
const
|
|
143
|
+
const isFirst = React.useContext(TableFirstCellContext);
|
|
134
144
|
return (
|
|
135
145
|
<CellFrame
|
|
136
146
|
ref={ref}
|
|
137
147
|
role={role}
|
|
138
148
|
header={header}
|
|
139
|
-
columnBorder={ctx.withColumnBorders && !
|
|
149
|
+
columnBorder={ctx.withColumnBorders && !isFirst}
|
|
140
150
|
paddingHorizontal={toSpace(ctx.horizontalSpacing)}
|
|
141
151
|
paddingVertical={toSpace(ctx.verticalSpacing)}
|
|
142
|
-
{...
|
|
152
|
+
{...props}
|
|
143
153
|
/>
|
|
144
154
|
);
|
|
145
155
|
});
|
|
@@ -159,26 +169,61 @@ const TableTd = makeCell(false, "cell", "Table.Td");
|
|
|
159
169
|
|
|
160
170
|
export type TableTrProps = GetProps<typeof RowFrame>;
|
|
161
171
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Wraps a row's leading cell in `TableFirstCellContext` so column dividers only
|
|
174
|
+
* appear BETWEEN columns. Recurses through arrays and fragments the way
|
|
175
|
+
* `React.Children.map` flattens them, rebuilding only the branch that leads to
|
|
176
|
+
* the first cell — one extra element (plus one array copy) per row, instead of a
|
|
177
|
+
* clone of every cell. Returns `null` when the subtree renders no cell at all.
|
|
178
|
+
*
|
|
179
|
+
* Empty slots (`null` / `false` / `undefined`) are skipped rather than counted,
|
|
180
|
+
* so a conditionally rendered leading cell is still recognised as first — the
|
|
181
|
+
* old `__first: i === 0` flag counted them and mis-bordered that case.
|
|
182
|
+
*/
|
|
183
|
+
function markFirstCell(node: React.ReactNode): React.ReactNode | null {
|
|
184
|
+
if (Array.isArray(node)) {
|
|
185
|
+
for (let i = 0; i < node.length; i += 1) {
|
|
186
|
+
const marked = markFirstCell(node[i] as React.ReactNode);
|
|
187
|
+
if (marked !== null) {
|
|
188
|
+
const next = node.slice() as React.ReactNode[];
|
|
189
|
+
next[i] = marked;
|
|
190
|
+
return next;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (React.isValidElement(node)) {
|
|
197
|
+
if (node.type === React.Fragment) {
|
|
198
|
+
const props = node.props as { children?: React.ReactNode };
|
|
199
|
+
const inner = markFirstCell(props.children);
|
|
200
|
+
return inner === null ? node : React.cloneElement(node, undefined, inner);
|
|
201
|
+
}
|
|
202
|
+
return (
|
|
203
|
+
<TableFirstCellContext.Provider key={node.key ?? "first-cell"} value={true}>
|
|
204
|
+
{node}
|
|
205
|
+
</TableFirstCellContext.Provider>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// A text child occupies the leading slot but cannot carry the flag: nothing is
|
|
210
|
+
// marked, matching the old behavior. Empty slots keep the search going.
|
|
211
|
+
return node === null || node === undefined || typeof node === "boolean" ? null : node;
|
|
165
212
|
}
|
|
166
213
|
|
|
167
|
-
const TableTr = RowFrame.styleable<
|
|
214
|
+
const TableTr = RowFrame.styleable<TableTrProps>(function TableTr(props, ref) {
|
|
168
215
|
const ctx = useTableContext();
|
|
169
|
-
const
|
|
216
|
+
const rowIndex = React.useContext(TableRowIndexContext);
|
|
217
|
+
const { children, ...rest } = props;
|
|
170
218
|
|
|
171
219
|
const isStriped =
|
|
172
220
|
ctx.striped !== undefined &&
|
|
173
|
-
|
|
174
|
-
(ctx.striped === "odd" ?
|
|
175
|
-
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
? React.cloneElement(child, { __first: i === 0 })
|
|
180
|
-
: child,
|
|
181
|
-
);
|
|
221
|
+
rowIndex !== undefined &&
|
|
222
|
+
(ctx.striped === "odd" ? rowIndex % 2 === 0 : rowIndex % 2 === 1);
|
|
223
|
+
|
|
224
|
+
// Only the first cell needs flagging, and only when dividers are on at all —
|
|
225
|
+
// with `withColumnBorders` off the flag can never change a cell's styling.
|
|
226
|
+
const cells = ctx.withColumnBorders ? (markFirstCell(children) ?? children) : children;
|
|
182
227
|
|
|
183
228
|
return (
|
|
184
229
|
<RowFrame
|
|
@@ -211,18 +256,24 @@ const TableTfoot = RowGroup.styleable<TableTfootProps>(function TableTfoot(props
|
|
|
211
256
|
return <RowGroup ref={ref} role="rowgroup" {...props} />;
|
|
212
257
|
});
|
|
213
258
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
// Inject a row index so `Table.Tr` can stripe odd/even body rows.
|
|
259
|
+
/** Publishes a 0-based index to each `Table.Tr` child so it can stripe itself. */
|
|
260
|
+
function withRowIndices(children: React.ReactNode): React.ReactNode {
|
|
217
261
|
let rowIndex = 0;
|
|
218
|
-
|
|
219
|
-
if (React.isValidElement
|
|
220
|
-
const
|
|
262
|
+
return React.Children.map(children, (child) => {
|
|
263
|
+
if (React.isValidElement(child) && child.type === TableTr) {
|
|
264
|
+
const index = rowIndex;
|
|
221
265
|
rowIndex += 1;
|
|
222
|
-
return
|
|
266
|
+
return <TableRowIndexContext.Provider value={index}>{child}</TableRowIndexContext.Provider>;
|
|
223
267
|
}
|
|
224
268
|
return child;
|
|
225
269
|
});
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const TableTbody = RowGroup.styleable<TableTbodyProps>(function TableTbody(props, ref) {
|
|
273
|
+
const ctx = useTableContext();
|
|
274
|
+
const { children, ...rest } = props;
|
|
275
|
+
// Row indices only matter for striping — skip the walk entirely without it.
|
|
276
|
+
const rows = ctx.striped === undefined ? children : withRowIndices(children);
|
|
226
277
|
return (
|
|
227
278
|
<RowGroup ref={ref} role="rowgroup" {...rest}>
|
|
228
279
|
{rows}
|
|
@@ -389,9 +440,14 @@ const TableRoot = TableFrame.styleable<TableProps>(function Table(props, ref) {
|
|
|
389
440
|
|
|
390
441
|
return (
|
|
391
442
|
<TableContext.Provider value={ctx}>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
443
|
+
{/* Reset row/cell position so a table nested in a cell starts clean. */}
|
|
444
|
+
<TableRowIndexContext.Provider value={undefined}>
|
|
445
|
+
<TableFirstCellContext.Provider value={false}>
|
|
446
|
+
<TableFrame ref={ref} role="table" {...s.merge("table", rest)}>
|
|
447
|
+
{content}
|
|
448
|
+
</TableFrame>
|
|
449
|
+
</TableFirstCellContext.Provider>
|
|
450
|
+
</TableRowIndexContext.Provider>
|
|
395
451
|
</TableContext.Provider>
|
|
396
452
|
);
|
|
397
453
|
});
|
|
@@ -2,6 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
createStyledContext,
|
|
5
|
+
getLineHeight,
|
|
5
6
|
type GetProps,
|
|
6
7
|
getTokenValue,
|
|
7
8
|
type SpaceTokens,
|
|
@@ -138,9 +139,12 @@ const TocText = styled(Text, {
|
|
|
138
139
|
size: {
|
|
139
140
|
...fontSizeVariant,
|
|
140
141
|
...fontSizePassthroughVariant,
|
|
142
|
+
// A numeric size skips the font tokens, so pair it through the same ladder
|
|
143
|
+
// the tokens use (rather than a local ratio) or a custom size gets leading
|
|
144
|
+
// that doesn't match the equivalent `$token` step.
|
|
141
145
|
":number": (value: number) => ({
|
|
142
146
|
fontSize: value,
|
|
143
|
-
lineHeight:
|
|
147
|
+
lineHeight: getLineHeight(value),
|
|
144
148
|
}),
|
|
145
149
|
},
|
|
146
150
|
active: {
|