rsuite 6.0.0-canary-20250315 → 6.0.0-canary-20250319
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/Accordion/styles/index.css +2 -1
- package/AutoComplete/styles/index.css +2 -1
- package/Box/styles/index.css +40 -40
- package/ButtonToolbar/styles/index.css +4 -0
- package/ButtonToolbar/styles/index.less +5 -0
- package/Card/styles/index.css +2 -1
- package/Cascader/styles/index.css +2 -1
- package/CheckPicker/styles/index.css +2 -1
- package/CheckTree/styles/index.css +4 -3
- package/CheckTree/styles/index.less +1 -1
- package/CheckTreePicker/styles/index.css +4 -3
- package/DatePicker/styles/index.css +2 -1
- package/DateRangePicker/styles/index.css +2 -1
- package/Drawer/styles/index.css +2 -1
- package/Dropdown/styles/index.css +2 -1
- package/InlineEdit/styles/index.css +2 -1
- package/InputPicker/styles/index.css +2 -1
- package/List/styles/index.css +2 -1
- package/Modal/styles/index.css +2 -1
- package/MultiCascadeTree/styles/index.css +2 -1
- package/MultiCascader/styles/index.css +2 -1
- package/Nav/styles/index.css +3 -2
- package/Navbar/styles/index.css +2 -1
- package/Notification/styles/index.css +2 -1
- package/Pagination/styles/index.css +2 -1
- package/Panel/styles/index.css +2 -1
- package/RadioTile/styles/index.css +4 -0
- package/RadioTile/styles/index.less +4 -1
- package/SelectPicker/styles/index.css +2 -1
- package/Sidebar/styles/index.css +4 -0
- package/Sidebar/styles/index.less +8 -1
- package/Tabs/styles/index.css +3 -2
- package/TagInput/styles/index.css +2 -1
- package/TagPicker/styles/index.css +2 -1
- package/Text/styles/index.css +12 -31
- package/Text/styles/index.less +5 -7
- package/TimePicker/styles/index.css +2 -1
- package/TimeRangePicker/styles/index.css +2 -1
- package/Tree/styles/indent-line.less +1 -1
- package/Tree/styles/index.css +4 -3
- package/TreePicker/styles/index.css +4 -3
- package/cjs/Affix/Affix.d.ts +3 -2
- package/cjs/Affix/Affix.js +5 -2
- package/cjs/AutoComplete/AutoComplete.d.ts +3 -2
- package/cjs/AutoComplete/AutoComplete.js +4 -2
- package/cjs/Avatar/Avatar.d.ts +3 -2
- package/cjs/AvatarGroup/AvatarGroup.d.ts +3 -2
- package/cjs/AvatarGroup/AvatarGroup.js +4 -2
- package/cjs/Badge/Badge.d.ts +3 -2
- package/cjs/Badge/Badge.js +6 -3
- package/cjs/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/cjs/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/cjs/Breadcrumb/BreadcrumbItem.js +4 -2
- package/cjs/Button/Button.d.ts +3 -2
- package/cjs/Button/Button.js +8 -14
- package/cjs/ButtonGroup/ButtonGroup.d.ts +3 -2
- package/cjs/ButtonGroup/ButtonGroup.js +5 -2
- package/cjs/ButtonToolbar/ButtonToolbar.d.ts +1 -2
- package/cjs/ButtonToolbar/ButtonToolbar.js +4 -7
- package/cjs/Calendar/Calendar.d.ts +2 -2
- package/cjs/Calendar/Calendar.js +7 -6
- package/cjs/Card/Card.d.ts +5 -14
- package/cjs/Card/Card.js +4 -2
- package/cjs/Card/CardBody.d.ts +1 -4
- package/cjs/Card/CardBody.js +0 -0
- package/cjs/Card/CardFooter.d.ts +1 -4
- package/cjs/Card/CardFooter.js +0 -0
- package/cjs/Card/CardHeader.d.ts +1 -4
- package/cjs/Card/CardHeader.js +0 -0
- package/cjs/CardGroup/CardGroup.d.ts +2 -2
- package/cjs/CardGroup/CardGroup.js +4 -2
- package/cjs/Carousel/Carousel.d.ts +2 -2
- package/cjs/Carousel/Carousel.js +5 -2
- package/cjs/CascadeTree/CascadeTree.js +4 -2
- package/cjs/CascadeTree/types.d.ts +3 -2
- package/cjs/Cascader/Cascader.d.ts +1 -1
- package/cjs/Cascader/Cascader.js +4 -2
- package/cjs/CheckPicker/CheckPicker.js +4 -2
- package/cjs/CheckTree/CheckTreeView.js +4 -2
- package/cjs/CheckTreePicker/CheckTreePicker.js +4 -2
- package/cjs/Checkbox/Checkbox.d.ts +3 -2
- package/cjs/Checkbox/Checkbox.js +8 -3
- package/cjs/CheckboxGroup/CheckboxGroup.d.ts +3 -2
- package/cjs/CheckboxGroup/CheckboxGroup.js +5 -2
- package/cjs/Container/Container.d.ts +2 -2
- package/cjs/Container/Container.js +5 -2
- package/cjs/Content/Content.d.ts +1 -4
- package/cjs/Content/Content.js +0 -0
- package/cjs/DatePicker/DatePicker.js +4 -2
- package/cjs/DateRangePicker/DateRangePicker.js +4 -2
- package/cjs/Divider/Divider.d.ts +3 -2
- package/cjs/Drawer/Drawer.d.ts +2 -4
- package/cjs/Drawer/DrawerActions.d.ts +1 -3
- package/cjs/Drawer/DrawerActions.js +0 -0
- package/cjs/Drawer/DrawerBody.d.ts +1 -1
- package/cjs/Dropdown/DropdownItem.d.ts +3 -2
- package/cjs/Dropdown/DropdownItem.js +2 -2
- package/cjs/Footer/Footer.d.ts +1 -4
- package/cjs/Footer/Footer.js +0 -0
- package/cjs/Grid/Col.d.ts +3 -2
- package/cjs/Grid/Col.js +5 -2
- package/cjs/Grid/Grid.d.ts +2 -2
- package/cjs/Grid/Grid.js +5 -2
- package/cjs/Grid/Row.d.ts +3 -2
- package/cjs/Grid/Row.js +8 -4
- package/cjs/Header/Header.d.ts +1 -4
- package/cjs/Header/Header.js +0 -0
- package/cjs/Heading/Heading.d.ts +2 -2
- package/cjs/Heading/Heading.js +4 -2
- package/cjs/HeadingGroup/HeadingGroup.d.ts +1 -4
- package/cjs/HeadingGroup/HeadingGroup.js +0 -0
- package/cjs/Highlight/Highlight.d.ts +2 -2
- package/cjs/Highlight/Highlight.js +4 -2
- package/cjs/Image/Image.d.ts +2 -2
- package/cjs/Image/Image.js +8 -8
- package/cjs/Image/ImageWrapper.d.ts +3 -4
- package/cjs/Image/ImageWrapper.js +0 -0
- package/cjs/InlineEdit/InlineEdit.d.ts +2 -2
- package/cjs/InlineEdit/InlineEdit.js +4 -2
- package/cjs/Input/Input.d.ts +3 -2
- package/cjs/Input/Input.js +5 -2
- package/cjs/InputGroup/InputGroup.d.ts +3 -2
- package/cjs/InputGroup/InputGroup.js +5 -2
- package/cjs/InputGroup/InputGroupAddon.d.ts +2 -2
- package/cjs/InputGroup/InputGroupAddon.js +5 -2
- package/cjs/InputNumber/InputNumber.d.ts +3 -2
- package/cjs/InputNumber/InputNumber.js +5 -2
- package/cjs/InputPicker/InputPicker.d.ts +2 -2
- package/cjs/InputPicker/InputPicker.js +14 -5
- package/cjs/Kbd/Kbd.d.ts +3 -2
- package/cjs/Kbd/Kbd.js +5 -2
- package/cjs/List/List.d.ts +2 -2
- package/cjs/List/List.js +6 -5
- package/cjs/List/ListItem.d.ts +2 -2
- package/cjs/List/ListItem.js +6 -5
- package/cjs/Loader/Loader.d.ts +3 -2
- package/cjs/Loader/Loader.js +6 -5
- package/cjs/Menu/Menu.d.ts +3 -2
- package/cjs/Menu/Menu.js +5 -1
- package/cjs/Menu/MenuItem.d.ts +3 -2
- package/cjs/Menu/MenuItem.js +2 -2
- package/cjs/Menu/MenuSeparator.d.ts +2 -2
- package/cjs/Menu/MenuSeparator.js +6 -4
- package/cjs/Message/Message.d.ts +3 -2
- package/cjs/Message/Message.js +4 -2
- package/cjs/Modal/Modal.d.ts +2 -4
- package/cjs/Modal/ModalBody.d.ts +3 -3
- package/cjs/Modal/ModalBody.js +5 -2
- package/cjs/Modal/ModalDialog.d.ts +3 -2
- package/cjs/Modal/ModalDialog.js +4 -2
- package/cjs/Modal/ModalFooter.d.ts +1 -3
- package/cjs/Modal/ModalHeader.d.ts +2 -2
- package/cjs/Modal/ModalHeader.js +5 -2
- package/cjs/Modal/ModalTitle.js +4 -2
- package/cjs/MultiCascadeTree/MultiCascadeTree.js +4 -2
- package/cjs/MultiCascadeTree/types.d.ts +2 -2
- package/cjs/MultiCascader/MultiCascader.js +4 -2
- package/cjs/Nav/Nav.d.ts +3 -2
- package/cjs/Nav/Nav.js +7 -3
- package/cjs/Nav/NavDropdown.d.ts +4 -3
- package/cjs/Nav/NavDropdown.js +4 -2
- package/cjs/Nav/NavDropdownItem.d.ts +3 -2
- package/cjs/Nav/NavDropdownItem.js +4 -4
- package/cjs/Nav/NavDropdownToggle.d.ts +4 -3
- package/cjs/Nav/NavDropdownToggle.js +5 -2
- package/cjs/Nav/NavItem.d.ts +3 -2
- package/cjs/Nav/NavItem.js +4 -2
- package/cjs/Navbar/Navbar.d.ts +4 -8
- package/cjs/Navbar/Navbar.js +5 -2
- package/cjs/Navbar/NavbarBrand.d.ts +1 -5
- package/cjs/Navbar/NavbarBrand.js +0 -0
- package/cjs/Navbar/NavbarContent.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +2 -1
- package/cjs/Navbar/NavbarDropdown.js +4 -2
- package/cjs/Navbar/NavbarDropdownItem.d.ts +4 -3
- package/cjs/Navbar/NavbarDropdownItem.js +7 -7
- package/cjs/Navbar/NavbarDropdownToggle.d.ts +4 -3
- package/cjs/Navbar/NavbarDropdownToggle.js +5 -2
- package/cjs/Navbar/NavbarItem.d.ts +3 -2
- package/cjs/Navbar/NavbarItem.js +5 -3
- package/cjs/Notification/Notification.d.ts +3 -2
- package/cjs/Notification/Notification.js +4 -2
- package/cjs/Pagination/Pagination.d.ts +3 -2
- package/cjs/Pagination/Pagination.js +5 -3
- package/cjs/Pagination/PaginationGroup.js +4 -2
- package/cjs/Panel/Panel.d.ts +3 -2
- package/cjs/Panel/Panel.js +5 -3
- package/cjs/Panel/PanelBody.d.ts +1 -1
- package/cjs/Panel/PanelBody.js +1 -1
- package/cjs/Panel/PanelHeader.d.ts +2 -2
- package/cjs/Panel/PanelHeader.js +4 -2
- package/cjs/PanelGroup/PanelGroup.d.ts +2 -2
- package/cjs/PanelGroup/PanelGroup.js +5 -2
- package/cjs/Placeholder/PlaceholderGraph.d.ts +2 -2
- package/cjs/Placeholder/PlaceholderGraph.js +8 -8
- package/cjs/Placeholder/PlaceholderGrid.d.ts +2 -2
- package/cjs/Placeholder/PlaceholderGrid.js +8 -8
- package/cjs/Placeholder/PlaceholderParagraph.d.ts +2 -2
- package/cjs/Placeholder/PlaceholderParagraph.js +8 -8
- package/cjs/Popover/Popover.d.ts +2 -2
- package/cjs/Popover/Popover.js +6 -5
- package/cjs/Progress/ProgressCircle.d.ts +2 -2
- package/cjs/Progress/ProgressCircle.js +4 -2
- package/cjs/Progress/ProgressLine.d.ts +2 -2
- package/cjs/Progress/ProgressLine.js +4 -2
- package/cjs/Radio/Radio.d.ts +3 -2
- package/cjs/Radio/Radio.js +8 -5
- package/cjs/RadioGroup/RadioGroup.d.ts +3 -2
- package/cjs/RadioGroup/RadioGroup.js +4 -2
- package/cjs/RadioTile/RadioTile.d.ts +4 -5
- package/cjs/RadioTile/RadioTile.js +6 -8
- package/cjs/RadioTileGroup/RadioTileGroup.d.ts +3 -2
- package/cjs/RadioTileGroup/RadioTileGroup.js +6 -5
- package/cjs/RangeSlider/RangeSlider.js +5 -3
- package/cjs/Rate/Character.d.ts +2 -2
- package/cjs/Rate/Character.js +5 -3
- package/cjs/Rate/Rate.d.ts +3 -2
- package/cjs/Rate/Rate.js +4 -2
- package/cjs/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/cjs/SafeAnchor/SafeAnchor.js +4 -2
- package/cjs/SelectPicker/SelectPicker.js +4 -2
- package/cjs/Sidebar/Sidebar.d.ts +2 -2
- package/cjs/Sidebar/Sidebar.js +7 -10
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +4 -3
- package/cjs/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.d.ts +3 -2
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.js +2 -2
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.d.ts +3 -2
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.js +6 -5
- package/cjs/Sidenav/Sidenav.d.ts +6 -14
- package/cjs/Sidenav/Sidenav.js +5 -2
- package/cjs/Sidenav/SidenavBody.d.ts +1 -3
- package/cjs/Sidenav/SidenavBody.js +0 -0
- package/cjs/Sidenav/SidenavDropdown.d.ts +4 -7
- package/cjs/Sidenav/SidenavDropdown.js +7 -5
- package/cjs/Sidenav/SidenavDropdownCollapse.d.ts +2 -2
- package/cjs/Sidenav/SidenavDropdownCollapse.js +4 -1
- package/cjs/Sidenav/SidenavDropdownItem.d.ts +3 -2
- package/cjs/Sidenav/SidenavDropdownItem.js +7 -7
- package/cjs/Sidenav/SidenavFooter.d.ts +1 -3
- package/cjs/Sidenav/SidenavGroupLabel.d.ts +1 -3
- package/cjs/Sidenav/SidenavHeader.d.ts +1 -3
- package/cjs/Sidenav/SidenavHeader.js +0 -0
- package/cjs/Sidenav/SidenavItem.d.ts +3 -2
- package/cjs/Sidenav/SidenavItem.js +7 -4
- package/cjs/Sidenav/SidenavToggle.d.ts +2 -2
- package/cjs/Sidenav/SidenavToggle.js +6 -4
- package/cjs/Slider/Graduated.d.ts +2 -2
- package/cjs/Slider/Graduated.js +8 -4
- package/cjs/Slider/Handle.d.ts +2 -2
- package/cjs/Slider/Handle.js +4 -2
- package/cjs/Slider/Mark.d.ts +2 -2
- package/cjs/Slider/Mark.js +4 -2
- package/cjs/Slider/ProgressBar.d.ts +2 -2
- package/cjs/Slider/ProgressBar.js +8 -4
- package/cjs/Slider/Slider.d.ts +3 -2
- package/cjs/Slider/Slider.js +7 -5
- package/cjs/Stack/Stack.js +0 -1
- package/cjs/Stack/StackItem.d.ts +2 -2
- package/cjs/Stack/StackItem.js +4 -2
- package/cjs/Stat/Stat.d.ts +4 -10
- package/cjs/Stat/Stat.js +4 -2
- package/cjs/Stat/StatHelpText.d.ts +1 -4
- package/cjs/Stat/StatHelpText.js +0 -0
- package/cjs/Stat/StatLabel.d.ts +2 -2
- package/cjs/Stat/StatLabel.js +4 -2
- package/cjs/Stat/StatTrend.d.ts +2 -2
- package/cjs/Stat/StatTrend.js +4 -2
- package/cjs/Stat/StatValue.d.ts +2 -2
- package/cjs/Stat/StatValue.js +4 -2
- package/cjs/Stat/StatValueUnit.d.ts +1 -4
- package/cjs/Stat/StatValueUnit.js +0 -0
- package/cjs/StatGroup/StatGroup.d.ts +2 -2
- package/cjs/StatGroup/StatGroup.js +4 -2
- package/cjs/Steps/Steps.d.ts +2 -2
- package/cjs/Steps/Steps.js +5 -3
- package/cjs/Tabs/TabPanel.d.ts +2 -2
- package/cjs/Tabs/TabPanel.js +4 -2
- package/cjs/Tabs/Tabs.d.ts +2 -2
- package/cjs/Tabs/Tabs.js +4 -2
- package/cjs/Tag/Tag.d.ts +3 -2
- package/cjs/Tag/Tag.js +4 -2
- package/cjs/TagGroup/TagGroup.d.ts +1 -3
- package/cjs/TagGroup/TagGroup.js +0 -0
- package/cjs/Text/Text.d.ts +4 -4
- package/cjs/Text/Text.js +10 -21
- package/cjs/Timeline/Timeline.d.ts +2 -2
- package/cjs/Timeline/Timeline.js +5 -3
- package/cjs/Timeline/TimelineItem.d.ts +2 -2
- package/cjs/Timeline/TimelineItem.js +5 -3
- package/cjs/Toggle/Toggle.d.ts +3 -2
- package/cjs/Toggle/Toggle.js +5 -3
- package/cjs/Tooltip/Tooltip.d.ts +3 -2
- package/cjs/Tooltip/Tooltip.js +4 -2
- package/cjs/Tree/Tree.d.ts +1 -1
- package/cjs/Tree/TreeNode.d.ts +2 -2
- package/cjs/Tree/TreeNode.js +6 -4
- package/cjs/Tree/TreeView.js +4 -2
- package/cjs/Tree/types.d.ts +2 -2
- package/cjs/TreePicker/TreePicker.d.ts +1 -1
- package/cjs/TreePicker/TreePicker.js +4 -2
- package/cjs/Uploader/UploadFileItem.d.ts +2 -2
- package/cjs/Uploader/UploadFileItem.js +11 -4
- package/cjs/Uploader/Uploader.d.ts +2 -2
- package/cjs/Uploader/Uploader.js +4 -2
- package/cjs/VisuallyHidden/VisuallyHidden.d.ts +1 -4
- package/cjs/VisuallyHidden/VisuallyHidden.js +0 -0
- package/cjs/internals/Box/Box.d.ts +12 -8
- package/cjs/internals/Box/Box.js +16 -14
- package/cjs/internals/Box/utils.js +5 -5
- package/cjs/internals/Menu/useRenderMenuItem.d.ts +1 -1
- package/cjs/internals/Menu/useRenderMenuItem.js +17 -8
- package/cjs/internals/Overlay/Modal.d.ts +3 -2
- package/cjs/internals/Overlay/Modal.js +5 -2
- package/cjs/internals/Picker/PickerToggle.d.ts +1 -1
- package/cjs/internals/Picker/ToggleButton.d.ts +2 -2
- package/cjs/internals/Picker/ToggleButton.js +0 -0
- package/cjs/internals/Picker/hooks/useCombobox.d.ts +1 -1
- package/cjs/internals/Plaintext/Plaintext.d.ts +2 -2
- package/cjs/internals/Plaintext/Plaintext.js +4 -2
- package/cjs/internals/Tree/TreeView.d.ts +2 -2
- package/cjs/internals/Tree/TreeView.js +4 -2
- package/cjs/internals/types/picker.d.ts +2 -2
- package/cjs/internals/utils/colours.d.ts +1 -1
- package/cjs/internals/utils/createComponent.d.ts +4 -3
- package/cjs/internals/utils/createComponent.js +8 -5
- package/cjs/internals/utils/sizes.d.ts +4 -1
- package/cjs/internals/utils/sizes.js +9 -3
- package/cjs/internals/utils/style-sheet/css.d.ts +1 -1
- package/cjs/internals/utils/style-sheet/css.js +4 -1
- package/cjs/internals/utils/style-sheet/styles.d.ts +2 -2
- package/cjs/internals/utils/style-sheet/styles.js +6 -6
- package/dist/rsuite-no-reset-rtl.css +75 -70
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +75 -70
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +75 -70
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +75 -70
- package/dist/rsuite.js +130 -130
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Affix/Affix.d.ts +3 -2
- package/esm/Affix/Affix.js +5 -2
- package/esm/AutoComplete/AutoComplete.d.ts +3 -2
- package/esm/AutoComplete/AutoComplete.js +4 -2
- package/esm/Avatar/Avatar.d.ts +3 -2
- package/esm/AvatarGroup/AvatarGroup.d.ts +3 -2
- package/esm/AvatarGroup/AvatarGroup.js +4 -2
- package/esm/Badge/Badge.d.ts +3 -2
- package/esm/Badge/Badge.js +6 -3
- package/esm/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/esm/Breadcrumb/BreadcrumbItem.d.ts +2 -2
- package/esm/Breadcrumb/BreadcrumbItem.js +4 -2
- package/esm/Button/Button.d.ts +3 -2
- package/esm/Button/Button.js +8 -14
- package/esm/ButtonGroup/ButtonGroup.d.ts +3 -2
- package/esm/ButtonGroup/ButtonGroup.js +5 -2
- package/esm/ButtonToolbar/ButtonToolbar.d.ts +1 -2
- package/esm/ButtonToolbar/ButtonToolbar.js +4 -7
- package/esm/Calendar/Calendar.d.ts +2 -2
- package/esm/Calendar/Calendar.js +7 -6
- package/esm/Card/Card.d.ts +5 -14
- package/esm/Card/Card.js +4 -2
- package/esm/Card/CardBody.d.ts +1 -4
- package/esm/Card/CardBody.js +0 -0
- package/esm/Card/CardFooter.d.ts +1 -4
- package/esm/Card/CardFooter.js +0 -0
- package/esm/Card/CardHeader.d.ts +1 -4
- package/esm/Card/CardHeader.js +0 -0
- package/esm/CardGroup/CardGroup.d.ts +2 -2
- package/esm/CardGroup/CardGroup.js +4 -2
- package/esm/Carousel/Carousel.d.ts +2 -2
- package/esm/Carousel/Carousel.js +5 -2
- package/esm/CascadeTree/CascadeTree.js +4 -2
- package/esm/CascadeTree/types.d.ts +3 -2
- package/esm/Cascader/Cascader.d.ts +1 -1
- package/esm/Cascader/Cascader.js +4 -2
- package/esm/CheckPicker/CheckPicker.js +4 -2
- package/esm/CheckTree/CheckTreeView.js +4 -2
- package/esm/CheckTreePicker/CheckTreePicker.js +4 -2
- package/esm/Checkbox/Checkbox.d.ts +3 -2
- package/esm/Checkbox/Checkbox.js +8 -3
- package/esm/CheckboxGroup/CheckboxGroup.d.ts +3 -2
- package/esm/CheckboxGroup/CheckboxGroup.js +5 -2
- package/esm/Container/Container.d.ts +2 -2
- package/esm/Container/Container.js +5 -2
- package/esm/Content/Content.d.ts +1 -4
- package/esm/Content/Content.js +0 -0
- package/esm/DatePicker/DatePicker.js +4 -2
- package/esm/DateRangePicker/DateRangePicker.js +4 -2
- package/esm/Divider/Divider.d.ts +3 -2
- package/esm/Drawer/Drawer.d.ts +2 -4
- package/esm/Drawer/DrawerActions.d.ts +1 -3
- package/esm/Drawer/DrawerActions.js +0 -0
- package/esm/Drawer/DrawerBody.d.ts +1 -1
- package/esm/Dropdown/DropdownItem.d.ts +3 -2
- package/esm/Dropdown/DropdownItem.js +2 -2
- package/esm/Footer/Footer.d.ts +1 -4
- package/esm/Footer/Footer.js +0 -0
- package/esm/Grid/Col.d.ts +3 -2
- package/esm/Grid/Col.js +5 -2
- package/esm/Grid/Grid.d.ts +2 -2
- package/esm/Grid/Grid.js +5 -2
- package/esm/Grid/Row.d.ts +3 -2
- package/esm/Grid/Row.js +8 -4
- package/esm/Header/Header.d.ts +1 -4
- package/esm/Header/Header.js +0 -0
- package/esm/Heading/Heading.d.ts +2 -2
- package/esm/Heading/Heading.js +4 -2
- package/esm/HeadingGroup/HeadingGroup.d.ts +1 -4
- package/esm/HeadingGroup/HeadingGroup.js +0 -0
- package/esm/Highlight/Highlight.d.ts +2 -2
- package/esm/Highlight/Highlight.js +4 -2
- package/esm/Image/Image.d.ts +2 -2
- package/esm/Image/Image.js +8 -8
- package/esm/Image/ImageWrapper.d.ts +3 -4
- package/esm/Image/ImageWrapper.js +0 -0
- package/esm/InlineEdit/InlineEdit.d.ts +2 -2
- package/esm/InlineEdit/InlineEdit.js +4 -2
- package/esm/Input/Input.d.ts +3 -2
- package/esm/Input/Input.js +5 -2
- package/esm/InputGroup/InputGroup.d.ts +3 -2
- package/esm/InputGroup/InputGroup.js +5 -2
- package/esm/InputGroup/InputGroupAddon.d.ts +2 -2
- package/esm/InputGroup/InputGroupAddon.js +5 -2
- package/esm/InputNumber/InputNumber.d.ts +3 -2
- package/esm/InputNumber/InputNumber.js +5 -2
- package/esm/InputPicker/InputPicker.d.ts +2 -2
- package/esm/InputPicker/InputPicker.js +14 -5
- package/esm/Kbd/Kbd.d.ts +3 -2
- package/esm/Kbd/Kbd.js +5 -2
- package/esm/List/List.d.ts +2 -2
- package/esm/List/List.js +6 -5
- package/esm/List/ListItem.d.ts +2 -2
- package/esm/List/ListItem.js +6 -5
- package/esm/Loader/Loader.d.ts +3 -2
- package/esm/Loader/Loader.js +6 -5
- package/esm/Menu/Menu.d.ts +3 -2
- package/esm/Menu/Menu.js +5 -1
- package/esm/Menu/MenuItem.d.ts +3 -2
- package/esm/Menu/MenuItem.js +2 -2
- package/esm/Menu/MenuSeparator.d.ts +2 -2
- package/esm/Menu/MenuSeparator.js +6 -4
- package/esm/Message/Message.d.ts +3 -2
- package/esm/Message/Message.js +4 -2
- package/esm/Modal/Modal.d.ts +2 -4
- package/esm/Modal/ModalBody.d.ts +3 -3
- package/esm/Modal/ModalBody.js +5 -2
- package/esm/Modal/ModalDialog.d.ts +3 -2
- package/esm/Modal/ModalDialog.js +4 -2
- package/esm/Modal/ModalFooter.d.ts +1 -3
- package/esm/Modal/ModalHeader.d.ts +2 -2
- package/esm/Modal/ModalHeader.js +5 -2
- package/esm/Modal/ModalTitle.js +4 -2
- package/esm/MultiCascadeTree/MultiCascadeTree.js +4 -2
- package/esm/MultiCascadeTree/types.d.ts +2 -2
- package/esm/MultiCascader/MultiCascader.js +4 -2
- package/esm/Nav/Nav.d.ts +3 -2
- package/esm/Nav/Nav.js +7 -3
- package/esm/Nav/NavDropdown.d.ts +4 -3
- package/esm/Nav/NavDropdown.js +4 -2
- package/esm/Nav/NavDropdownItem.d.ts +3 -2
- package/esm/Nav/NavDropdownItem.js +4 -4
- package/esm/Nav/NavDropdownToggle.d.ts +4 -3
- package/esm/Nav/NavDropdownToggle.js +5 -2
- package/esm/Nav/NavItem.d.ts +3 -2
- package/esm/Nav/NavItem.js +4 -2
- package/esm/Navbar/Navbar.d.ts +4 -8
- package/esm/Navbar/Navbar.js +5 -2
- package/esm/Navbar/NavbarBrand.d.ts +1 -5
- package/esm/Navbar/NavbarBrand.js +0 -0
- package/esm/Navbar/NavbarContent.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +2 -1
- package/esm/Navbar/NavbarDropdown.js +4 -2
- package/esm/Navbar/NavbarDropdownItem.d.ts +4 -3
- package/esm/Navbar/NavbarDropdownItem.js +7 -7
- package/esm/Navbar/NavbarDropdownToggle.d.ts +4 -3
- package/esm/Navbar/NavbarDropdownToggle.js +5 -2
- package/esm/Navbar/NavbarItem.d.ts +3 -2
- package/esm/Navbar/NavbarItem.js +5 -3
- package/esm/Notification/Notification.d.ts +3 -2
- package/esm/Notification/Notification.js +4 -2
- package/esm/Pagination/Pagination.d.ts +3 -2
- package/esm/Pagination/Pagination.js +5 -3
- package/esm/Pagination/PaginationGroup.js +4 -2
- package/esm/Panel/Panel.d.ts +3 -2
- package/esm/Panel/Panel.js +5 -3
- package/esm/Panel/PanelBody.d.ts +1 -1
- package/esm/Panel/PanelBody.js +1 -1
- package/esm/Panel/PanelHeader.d.ts +2 -2
- package/esm/Panel/PanelHeader.js +4 -2
- package/esm/PanelGroup/PanelGroup.d.ts +2 -2
- package/esm/PanelGroup/PanelGroup.js +5 -2
- package/esm/Placeholder/PlaceholderGraph.d.ts +2 -2
- package/esm/Placeholder/PlaceholderGraph.js +8 -8
- package/esm/Placeholder/PlaceholderGrid.d.ts +2 -2
- package/esm/Placeholder/PlaceholderGrid.js +8 -8
- package/esm/Placeholder/PlaceholderParagraph.d.ts +2 -2
- package/esm/Placeholder/PlaceholderParagraph.js +8 -8
- package/esm/Popover/Popover.d.ts +2 -2
- package/esm/Popover/Popover.js +6 -5
- package/esm/Progress/ProgressCircle.d.ts +2 -2
- package/esm/Progress/ProgressCircle.js +4 -2
- package/esm/Progress/ProgressLine.d.ts +2 -2
- package/esm/Progress/ProgressLine.js +4 -2
- package/esm/Radio/Radio.d.ts +3 -2
- package/esm/Radio/Radio.js +8 -5
- package/esm/RadioGroup/RadioGroup.d.ts +3 -2
- package/esm/RadioGroup/RadioGroup.js +4 -2
- package/esm/RadioTile/RadioTile.d.ts +4 -5
- package/esm/RadioTile/RadioTile.js +6 -8
- package/esm/RadioTileGroup/RadioTileGroup.d.ts +3 -2
- package/esm/RadioTileGroup/RadioTileGroup.js +6 -5
- package/esm/RangeSlider/RangeSlider.js +5 -3
- package/esm/Rate/Character.d.ts +2 -2
- package/esm/Rate/Character.js +5 -3
- package/esm/Rate/Rate.d.ts +3 -2
- package/esm/Rate/Rate.js +4 -2
- package/esm/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/esm/SafeAnchor/SafeAnchor.js +4 -2
- package/esm/SelectPicker/SelectPicker.js +4 -2
- package/esm/Sidebar/Sidebar.d.ts +2 -2
- package/esm/Sidebar/Sidebar.js +8 -11
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +4 -3
- package/esm/Sidenav/ExpandedSidenavDropdown.js +6 -6
- package/esm/Sidenav/ExpandedSidenavDropdownItem.d.ts +3 -2
- package/esm/Sidenav/ExpandedSidenavDropdownItem.js +2 -2
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.d.ts +3 -2
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.js +6 -5
- package/esm/Sidenav/Sidenav.d.ts +6 -14
- package/esm/Sidenav/Sidenav.js +5 -2
- package/esm/Sidenav/SidenavBody.d.ts +1 -3
- package/esm/Sidenav/SidenavBody.js +0 -0
- package/esm/Sidenav/SidenavDropdown.d.ts +4 -7
- package/esm/Sidenav/SidenavDropdown.js +7 -5
- package/esm/Sidenav/SidenavDropdownCollapse.d.ts +2 -2
- package/esm/Sidenav/SidenavDropdownCollapse.js +4 -1
- package/esm/Sidenav/SidenavDropdownItem.d.ts +3 -2
- package/esm/Sidenav/SidenavDropdownItem.js +7 -7
- package/esm/Sidenav/SidenavFooter.d.ts +1 -3
- package/esm/Sidenav/SidenavGroupLabel.d.ts +1 -3
- package/esm/Sidenav/SidenavHeader.d.ts +1 -3
- package/esm/Sidenav/SidenavHeader.js +0 -0
- package/esm/Sidenav/SidenavItem.d.ts +3 -2
- package/esm/Sidenav/SidenavItem.js +7 -4
- package/esm/Sidenav/SidenavToggle.d.ts +2 -2
- package/esm/Sidenav/SidenavToggle.js +7 -5
- package/esm/Slider/Graduated.d.ts +2 -2
- package/esm/Slider/Graduated.js +8 -4
- package/esm/Slider/Handle.d.ts +2 -2
- package/esm/Slider/Handle.js +4 -2
- package/esm/Slider/Mark.d.ts +2 -2
- package/esm/Slider/Mark.js +4 -2
- package/esm/Slider/ProgressBar.d.ts +2 -2
- package/esm/Slider/ProgressBar.js +8 -4
- package/esm/Slider/Slider.d.ts +3 -2
- package/esm/Slider/Slider.js +7 -5
- package/esm/Stack/Stack.js +0 -1
- package/esm/Stack/StackItem.d.ts +2 -2
- package/esm/Stack/StackItem.js +4 -2
- package/esm/Stat/Stat.d.ts +4 -10
- package/esm/Stat/Stat.js +4 -2
- package/esm/Stat/StatHelpText.d.ts +1 -4
- package/esm/Stat/StatHelpText.js +0 -0
- package/esm/Stat/StatLabel.d.ts +2 -2
- package/esm/Stat/StatLabel.js +4 -2
- package/esm/Stat/StatTrend.d.ts +2 -2
- package/esm/Stat/StatTrend.js +4 -2
- package/esm/Stat/StatValue.d.ts +2 -2
- package/esm/Stat/StatValue.js +4 -2
- package/esm/Stat/StatValueUnit.d.ts +1 -4
- package/esm/Stat/StatValueUnit.js +0 -0
- package/esm/StatGroup/StatGroup.d.ts +2 -2
- package/esm/StatGroup/StatGroup.js +4 -2
- package/esm/Steps/Steps.d.ts +2 -2
- package/esm/Steps/Steps.js +5 -3
- package/esm/Tabs/TabPanel.d.ts +2 -2
- package/esm/Tabs/TabPanel.js +4 -2
- package/esm/Tabs/Tabs.d.ts +2 -2
- package/esm/Tabs/Tabs.js +4 -2
- package/esm/Tag/Tag.d.ts +3 -2
- package/esm/Tag/Tag.js +4 -2
- package/esm/TagGroup/TagGroup.d.ts +1 -3
- package/esm/TagGroup/TagGroup.js +0 -0
- package/esm/Text/Text.d.ts +4 -4
- package/esm/Text/Text.js +11 -20
- package/esm/Timeline/Timeline.d.ts +2 -2
- package/esm/Timeline/Timeline.js +5 -3
- package/esm/Timeline/TimelineItem.d.ts +2 -2
- package/esm/Timeline/TimelineItem.js +5 -3
- package/esm/Toggle/Toggle.d.ts +3 -2
- package/esm/Toggle/Toggle.js +5 -3
- package/esm/Tooltip/Tooltip.d.ts +3 -2
- package/esm/Tooltip/Tooltip.js +4 -2
- package/esm/Tree/Tree.d.ts +1 -1
- package/esm/Tree/TreeNode.d.ts +2 -2
- package/esm/Tree/TreeNode.js +6 -4
- package/esm/Tree/TreeView.js +4 -2
- package/esm/Tree/types.d.ts +2 -2
- package/esm/TreePicker/TreePicker.d.ts +1 -1
- package/esm/TreePicker/TreePicker.js +4 -2
- package/esm/Uploader/UploadFileItem.d.ts +2 -2
- package/esm/Uploader/UploadFileItem.js +11 -4
- package/esm/Uploader/Uploader.d.ts +2 -2
- package/esm/Uploader/Uploader.js +4 -2
- package/esm/VisuallyHidden/VisuallyHidden.d.ts +1 -4
- package/esm/VisuallyHidden/VisuallyHidden.js +0 -0
- package/esm/internals/Box/Box.d.ts +12 -8
- package/esm/internals/Box/Box.js +16 -14
- package/esm/internals/Box/utils.js +5 -5
- package/esm/internals/Menu/useRenderMenuItem.d.ts +1 -1
- package/esm/internals/Menu/useRenderMenuItem.js +16 -8
- package/esm/internals/Overlay/Modal.d.ts +3 -2
- package/esm/internals/Overlay/Modal.js +5 -2
- package/esm/internals/Picker/PickerToggle.d.ts +1 -1
- package/esm/internals/Picker/ToggleButton.d.ts +2 -2
- package/esm/internals/Picker/ToggleButton.js +0 -0
- package/esm/internals/Picker/hooks/useCombobox.d.ts +1 -1
- package/esm/internals/Plaintext/Plaintext.d.ts +2 -2
- package/esm/internals/Plaintext/Plaintext.js +4 -2
- package/esm/internals/Tree/TreeView.d.ts +2 -2
- package/esm/internals/Tree/TreeView.js +4 -2
- package/esm/internals/types/picker.d.ts +2 -2
- package/esm/internals/utils/colours.d.ts +1 -1
- package/esm/internals/utils/createComponent.d.ts +4 -3
- package/esm/internals/utils/createComponent.js +7 -4
- package/esm/internals/utils/sizes.d.ts +4 -1
- package/esm/internals/utils/sizes.js +9 -3
- package/esm/internals/utils/style-sheet/css.d.ts +1 -1
- package/esm/internals/utils/style-sheet/css.js +3 -1
- package/esm/internals/utils/style-sheet/styles.d.ts +2 -2
- package/esm/internals/utils/style-sheet/styles.js +6 -6
- package/internals/Box/styles/index.less +57 -136
- package/package.json +1 -1
- package/styles/color-modes/dark.less +1 -1
- package/styles/color-modes/light.less +1 -1
- package/styles/root.less +10 -6
- package/toaster/styles/index.css +2 -1
- package/useToaster/styles/index.css +2 -1
package/esm/Tooltip/Tooltip.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
+
import Box from "../internals/Box/index.js";
|
|
4
5
|
import { forwardRef, mergeStyles } from "../internals/utils/index.js";
|
|
5
6
|
import { useStyles } from "../internals/hooks/index.js";
|
|
6
7
|
import { useCustom } from "../CustomProvider/index.js";
|
|
@@ -14,7 +15,7 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
14
15
|
propsWithDefaults
|
|
15
16
|
} = useCustom('Tooltip', props);
|
|
16
17
|
const {
|
|
17
|
-
as
|
|
18
|
+
as,
|
|
18
19
|
className,
|
|
19
20
|
classPrefix = 'tooltip',
|
|
20
21
|
children,
|
|
@@ -33,7 +34,8 @@ const Tooltip = forwardRef((props, ref) => {
|
|
|
33
34
|
const styles = useMemo(() => mergeStyles(style, {
|
|
34
35
|
['--rs-opacity']: visible ? 1 : undefined
|
|
35
36
|
}), [visible, style]);
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
38
|
+
as: as,
|
|
37
39
|
role: "tooltip"
|
|
38
40
|
}, rest, {
|
|
39
41
|
ref: ref,
|
package/esm/Tree/Tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TreeViewProps } from './TreeView';
|
|
2
2
|
import type { TreeExtraProps, WithTreeDragProps } from './types';
|
|
3
3
|
export interface TreeProps<T = string | number | null> extends WithTreeDragProps<TreeViewProps<T>>, TreeExtraProps {
|
|
4
4
|
/**
|
package/esm/Tree/TreeNode.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { TreeNode as TreeNodeData } from '../internals/Tree/types';
|
|
4
4
|
export type DragStatus = 'drag-over' | 'drag-over-top' | 'drag-over-bottom';
|
|
5
5
|
interface TreeDragEventProps {
|
|
@@ -31,7 +31,7 @@ interface TreeDragEventProps {
|
|
|
31
31
|
/**
|
|
32
32
|
* Props for the TreeNode component.
|
|
33
33
|
*/
|
|
34
|
-
export interface TreeNodeProps extends
|
|
34
|
+
export interface TreeNodeProps extends BoxProps, TreeDragEventProps {
|
|
35
35
|
/**
|
|
36
36
|
* The layer of the node in the tree hierarchy.
|
|
37
37
|
*/
|
package/esm/Tree/TreeNode.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import TreeNodeToggle from "./TreeNodeToggle.js";
|
|
5
|
+
import Box from "../internals/Box/index.js";
|
|
5
6
|
import { forwardRef, mergeRefs, stringifyReactNode, mergeStyles } from "../internals/utils/index.js";
|
|
6
7
|
import { useFocusVirtualListItem, useStyles, useEventCallback } from "../internals/hooks/index.js";
|
|
7
8
|
import { useTreeContextProps } from "../internals/Tree/TreeProvider.js";
|
|
@@ -14,7 +15,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
14
15
|
|
|
15
16
|
const TreeNode = forwardRef((props, ref) => {
|
|
16
17
|
const {
|
|
17
|
-
as
|
|
18
|
+
as,
|
|
18
19
|
label,
|
|
19
20
|
layer,
|
|
20
21
|
active,
|
|
@@ -101,9 +102,10 @@ const TreeNode = forwardRef((props, ref) => {
|
|
|
101
102
|
}));
|
|
102
103
|
const treeItemRef = useFocusVirtualListItem(focus);
|
|
103
104
|
const styles = virtualized ? mergeStyles(style, indentTreeNode(rtl, layer - 1)) : style;
|
|
104
|
-
return visible ? /*#__PURE__*/React.createElement(
|
|
105
|
-
|
|
105
|
+
return visible ? /*#__PURE__*/React.createElement(Box, _extends({
|
|
106
|
+
as: as,
|
|
106
107
|
role: "treeitem",
|
|
108
|
+
ref: mergeRefs(treeItemRef, ref),
|
|
107
109
|
tabIndex: -1,
|
|
108
110
|
"aria-expanded": expanded,
|
|
109
111
|
"aria-label": labelStr,
|
|
@@ -123,7 +125,7 @@ const TreeNode = forwardRef((props, ref) => {
|
|
|
123
125
|
onDragLeave: handleDragLeave,
|
|
124
126
|
onDragEnd: handleDragEnd,
|
|
125
127
|
onDrop: handleDrop
|
|
126
|
-
}), /*#__PURE__*/React.createElement(TreeNodeToggle, {
|
|
128
|
+
}, rest), /*#__PURE__*/React.createElement(TreeNodeToggle, {
|
|
127
129
|
"aria-label": (expanded ? 'Collapse' : 'Expand') + ` ${labelStr}`,
|
|
128
130
|
data: nodeData,
|
|
129
131
|
loading: loading,
|
package/esm/Tree/TreeView.js
CHANGED
|
@@ -10,6 +10,7 @@ import useFocusTree from "./hooks/useFocusTree.js";
|
|
|
10
10
|
import useVirtualizedTreeData from "./hooks/useVirtualizedTreeData.js";
|
|
11
11
|
import useTreeNodeProps from "./hooks/useTreeNodeProps.js";
|
|
12
12
|
import SearchBox from "../internals/SearchBox/index.js";
|
|
13
|
+
import Box from "../internals/Box/index.js";
|
|
13
14
|
import { List, AutoSizer, defaultItemSize } from "../internals/Windowing/index.js";
|
|
14
15
|
import { forwardRef } from "../internals/utils/index.js";
|
|
15
16
|
import { getPathTowardsItem, getKeyParentMap } from "../internals/Tree/utils/index.js";
|
|
@@ -29,7 +30,7 @@ import { useCustom } from "../CustomProvider/index.js";
|
|
|
29
30
|
|
|
30
31
|
const TreeView = forwardRef((props, ref) => {
|
|
31
32
|
const {
|
|
32
|
-
as
|
|
33
|
+
as,
|
|
33
34
|
data = [],
|
|
34
35
|
style,
|
|
35
36
|
showIndentLine,
|
|
@@ -250,7 +251,8 @@ const TreeView = forwardRef((props, ref) => {
|
|
|
250
251
|
virtualized
|
|
251
252
|
}), className);
|
|
252
253
|
const formattedNodes = getFormattedNodes(renderNode);
|
|
253
|
-
return /*#__PURE__*/React.createElement(
|
|
254
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
255
|
+
as: as,
|
|
254
256
|
ref: ref,
|
|
255
257
|
className: classes,
|
|
256
258
|
style: style
|
package/esm/Tree/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { ListProps } from '../internals/Windowing';
|
|
4
4
|
import type { TreeNode } from '../internals/Tree/types';
|
|
5
5
|
/**
|
|
@@ -80,7 +80,7 @@ export type WithTreeDragProps<P> = P & TreeDragProps;
|
|
|
80
80
|
/**
|
|
81
81
|
* Represents the props for the Tree component.
|
|
82
82
|
*/
|
|
83
|
-
export interface TreeViewBaseProps<V = string | number, T = TreeNode> extends
|
|
83
|
+
export interface TreeViewBaseProps<V = string | number, T = TreeNode> extends BoxProps {
|
|
84
84
|
/**
|
|
85
85
|
* The height of the tree.
|
|
86
86
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TreeViewProps } from '../Tree/TreeView';
|
|
3
3
|
import { PickerLocale } from '../locales';
|
|
4
4
|
import { PickerToggleProps } from '../internals/Picker';
|
|
5
5
|
import { TreeNode } from '../internals/Tree/types';
|
|
@@ -10,6 +10,7 @@ import useFlattenTree from "../Tree/hooks/useFlattenTree.js";
|
|
|
10
10
|
import useFocusState from "./hooks/useFocusState.js";
|
|
11
11
|
import useExpandTree from "../Tree/hooks/useExpandTree.js";
|
|
12
12
|
import TreeView from "../Tree/TreeView.js";
|
|
13
|
+
import Box from "../internals/Box/index.js";
|
|
13
14
|
import { useStyles, useControlled, useEventCallback } from "../internals/hooks/index.js";
|
|
14
15
|
import { forwardRef, createChainedFunction, mergeRefs } from "../internals/utils/index.js";
|
|
15
16
|
import { getActiveItem, getTreeActiveNode } from "../Tree/utils/index.js";
|
|
@@ -26,7 +27,7 @@ const TreePicker = forwardRef((props, ref) => {
|
|
|
26
27
|
propsWithDefaults
|
|
27
28
|
} = useCustom('TreePicker', props);
|
|
28
29
|
const {
|
|
29
|
-
as
|
|
30
|
+
as,
|
|
30
31
|
appearance = 'default',
|
|
31
32
|
classPrefix = 'picker',
|
|
32
33
|
cleanable = true,
|
|
@@ -260,7 +261,8 @@ const TreePicker = forwardRef((props, ref) => {
|
|
|
260
261
|
ref: trigger,
|
|
261
262
|
placement: placement,
|
|
262
263
|
speaker: renderTreeView
|
|
263
|
-
}, triggerProps), /*#__PURE__*/React.createElement(
|
|
264
|
+
}, triggerProps), /*#__PURE__*/React.createElement(Box, {
|
|
265
|
+
as: as,
|
|
264
266
|
className: classes,
|
|
265
267
|
style: style,
|
|
266
268
|
ref: root
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { BoxProps } from '../internals/Box';
|
|
2
3
|
import type { FileType } from './Uploader';
|
|
3
|
-
import type { WithAsProps } from '../internals/types';
|
|
4
4
|
import type { UploaderLocale } from '../locales';
|
|
5
|
-
export interface UploadFileItemProps extends
|
|
5
|
+
export interface UploadFileItemProps extends BoxProps {
|
|
6
6
|
file: FileType;
|
|
7
7
|
listType?: 'text' | 'picture-text' | 'picture';
|
|
8
8
|
disabled?: boolean;
|
|
@@ -4,6 +4,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
4
4
|
import Attachment from '@rsuite/icons/Attachment';
|
|
5
5
|
import Reload from '@rsuite/icons/Reload';
|
|
6
6
|
import CloseButton from "../internals/CloseButton/index.js";
|
|
7
|
+
import Box from "../internals/Box/index.js";
|
|
7
8
|
import { forwardRef } from "../internals/utils/index.js";
|
|
8
9
|
import { useStyles } from "../internals/hooks/index.js";
|
|
9
10
|
import { previewFile } from "./utils/previewFile.js";
|
|
@@ -31,7 +32,7 @@ export const formatSize = function (size) {
|
|
|
31
32
|
};
|
|
32
33
|
const UploadFileItem = forwardRef((props, ref) => {
|
|
33
34
|
const {
|
|
34
|
-
as
|
|
35
|
+
as,
|
|
35
36
|
disabled,
|
|
36
37
|
allowReupload = true,
|
|
37
38
|
file,
|
|
@@ -237,18 +238,24 @@ const UploadFileItem = forwardRef((props, ref) => {
|
|
|
237
238
|
}, renderFileInfo ? renderFileInfo(file, fileElement) : fileElement, renderErrorStatus(), renderFileSize()));
|
|
238
239
|
};
|
|
239
240
|
if (listType === 'picture') {
|
|
240
|
-
return /*#__PURE__*/React.createElement(
|
|
241
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
242
|
+
as: as
|
|
243
|
+
}, rest, {
|
|
241
244
|
ref: ref,
|
|
242
245
|
className: classes
|
|
243
246
|
}), renderIcon(), renderPreview(), renderErrorStatus(), renderRemoveButton());
|
|
244
247
|
}
|
|
245
248
|
if (listType === 'picture-text') {
|
|
246
|
-
return /*#__PURE__*/React.createElement(
|
|
249
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
250
|
+
as: as
|
|
251
|
+
}, rest, {
|
|
247
252
|
ref: ref,
|
|
248
253
|
className: classes
|
|
249
254
|
}), renderIcon(), renderPreview(), renderFilePanel(), renderProgressBar(), renderRemoveButton());
|
|
250
255
|
}
|
|
251
|
-
return /*#__PURE__*/React.createElement(
|
|
256
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
257
|
+
as: as
|
|
258
|
+
}, rest, {
|
|
252
259
|
ref: ref,
|
|
253
260
|
className: classes
|
|
254
261
|
}), renderIcon(), renderFilePanel(), renderProgressBar(), renderRemoveButton());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ErrorStatus } from './utils/ajaxUpload';
|
|
3
3
|
import { UploadTriggerProps } from './UploadTrigger';
|
|
4
|
-
import
|
|
4
|
+
import { BoxProps } from '../internals/Box';
|
|
5
5
|
import type { UploaderLocale } from '../locales';
|
|
6
6
|
export interface FileType {
|
|
7
7
|
/** File Name */
|
|
@@ -21,7 +21,7 @@ export interface UploaderInstance {
|
|
|
21
21
|
root: HTMLElement;
|
|
22
22
|
start: (file?: FileType) => void;
|
|
23
23
|
}
|
|
24
|
-
export interface UploaderProps extends
|
|
24
|
+
export interface UploaderProps extends BoxProps, Omit<UploadTriggerProps, 'onChange' | 'onError' | 'onProgress'> {
|
|
25
25
|
/**
|
|
26
26
|
* Custom ref for Uploader
|
|
27
27
|
*/
|
package/esm/Uploader/Uploader.js
CHANGED
|
@@ -6,6 +6,7 @@ import FileItem from "./UploadFileItem.js";
|
|
|
6
6
|
import Plaintext from "../internals/Plaintext/index.js";
|
|
7
7
|
import ajaxUpload from "./utils/ajaxUpload.js";
|
|
8
8
|
import UploadTrigger from "./UploadTrigger.js";
|
|
9
|
+
import Box from "../internals/Box/index.js";
|
|
9
10
|
import { forwardRef, guid } from "../internals/utils/index.js";
|
|
10
11
|
import { useStyles, useWillUnmount, useEventCallback } from "../internals/hooks/index.js";
|
|
11
12
|
import { useCustom } from "../CustomProvider/index.js";
|
|
@@ -92,7 +93,7 @@ const Uploader = forwardRef((props, ref) => {
|
|
|
92
93
|
propsWithDefaults
|
|
93
94
|
} = useCustom('Uploader', props);
|
|
94
95
|
const {
|
|
95
|
-
as
|
|
96
|
+
as,
|
|
96
97
|
classPrefix = 'uploader',
|
|
97
98
|
className,
|
|
98
99
|
listType = 'text',
|
|
@@ -382,7 +383,8 @@ const Uploader = forwardRef((props, ref) => {
|
|
|
382
383
|
if (listType === 'picture') {
|
|
383
384
|
renderList.reverse();
|
|
384
385
|
}
|
|
385
|
-
return /*#__PURE__*/React.createElement(
|
|
386
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
387
|
+
as: as,
|
|
386
388
|
ref: rootRef,
|
|
387
389
|
className: classes,
|
|
388
390
|
style: style
|
|
@@ -6,8 +6,5 @@ export type VisuallyHiddenProps = ComponentProps;
|
|
|
6
6
|
* @version 5.52.0
|
|
7
7
|
* @see https://rsuitejs.com/components/visually-hidden/
|
|
8
8
|
*/
|
|
9
|
-
declare const VisuallyHidden: import("../internals/types").InternalRefForwardingComponent<"span", Partial<
|
|
10
|
-
name: string;
|
|
11
|
-
componentAs: "span";
|
|
12
|
-
}>, never> & Record<string, never>;
|
|
9
|
+
declare const VisuallyHidden: import("../internals/types").InternalRefForwardingComponent<"span", Partial<ComponentProps>, never> & Record<string, never>;
|
|
13
10
|
export default VisuallyHidden;
|
|
File without changes
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { CSSProperties as CSS } from 'react';
|
|
2
2
|
import type { WithAsProps, Breakpoints, ColorScheme, Size } from '../types';
|
|
3
3
|
export interface BoxProps extends WithAsProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
-
/** Breakpoint below which the component is hidden with `display: none` */
|
|
7
|
-
visible?: Breakpoints;
|
|
4
|
+
/** Breakpoint below which the component is shown with `display: block` */
|
|
5
|
+
showFrom?: Breakpoints;
|
|
8
6
|
/** Breakpoint above which the component is hidden with `display: none` */
|
|
9
|
-
|
|
7
|
+
hideFrom?: Breakpoints;
|
|
10
8
|
/** Display property */
|
|
11
9
|
display?: CSS['display'];
|
|
12
10
|
/** Padding */
|
|
@@ -29,15 +27,21 @@ export interface BoxProps extends WithAsProps {
|
|
|
29
27
|
w?: CSS['width'];
|
|
30
28
|
h?: CSS['height'];
|
|
31
29
|
/** Box Color */
|
|
32
|
-
|
|
30
|
+
c?: ColorScheme | CSS['color'];
|
|
31
|
+
/** Box Border */
|
|
32
|
+
bd?: CSS['border'];
|
|
33
33
|
/** Box Background */
|
|
34
34
|
bg?: ColorScheme | CSS['backgroundColor'];
|
|
35
35
|
/** Box Border Radius */
|
|
36
36
|
rounded?: Size | CSS['borderRadius'] | 'full';
|
|
37
|
-
/** Box Border */
|
|
38
|
-
border?: CSS['border'];
|
|
39
37
|
/** Box Shadow */
|
|
40
38
|
shadow?: Size | CSS['boxShadow'];
|
|
41
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Box component is the base component for all components,
|
|
42
|
+
* providing shorthand for style properties.
|
|
43
|
+
*
|
|
44
|
+
* @see https://rsuitejs.com/components/box
|
|
45
|
+
*/
|
|
42
46
|
declare const Box: import("../types").InternalRefForwardingComponent<"div", BoxProps, never> & Record<string, never>;
|
|
43
47
|
export default Box;
|
package/esm/internals/Box/Box.js
CHANGED
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import isEmpty from 'lodash/isEmpty';
|
|
5
|
+
import { mergeStyles } from "../utils/index.js";
|
|
6
|
+
import { forwardRef } from "../utils/forwardRef.js";
|
|
6
7
|
import { getBoxCSSVariables, extractBoxProps, omitBoxProps } from "./utils.js";
|
|
8
|
+
/**
|
|
9
|
+
* Box component is the base component for all components,
|
|
10
|
+
* providing shorthand for style properties.
|
|
11
|
+
*
|
|
12
|
+
* @see https://rsuitejs.com/components/box
|
|
13
|
+
*/
|
|
7
14
|
const Box = forwardRef((props, ref) => {
|
|
8
15
|
const {
|
|
9
16
|
as: Component = 'div',
|
|
10
|
-
classPrefix = 'box',
|
|
11
17
|
className,
|
|
12
18
|
children,
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
showFrom,
|
|
20
|
+
hideFrom,
|
|
15
21
|
style,
|
|
16
22
|
...rest
|
|
17
23
|
} = props;
|
|
18
24
|
const boxProps = extractBoxProps(rest);
|
|
19
25
|
const domProps = omitBoxProps(rest);
|
|
20
|
-
const {
|
|
21
|
-
merge,
|
|
22
|
-
withPrefix
|
|
23
|
-
} = useStyles(classPrefix);
|
|
24
|
-
const classes = merge(className, withPrefix({
|
|
25
|
-
[`visible-from-${visible}`]: visible,
|
|
26
|
-
[`hidden-from-${hidden}`]: hidden
|
|
27
|
-
}));
|
|
28
26
|
const boxCSSVars = getBoxCSSVariables(boxProps);
|
|
29
27
|
const boxStyle = mergeStyles(style, boxCSSVars);
|
|
28
|
+
const isBox = !isEmpty(boxCSSVars) || showFrom || hideFrom;
|
|
30
29
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
31
30
|
ref: ref,
|
|
32
|
-
|
|
31
|
+
"data-rs": isBox ? 'box' : undefined,
|
|
32
|
+
"data-visible-from": showFrom,
|
|
33
|
+
"data-hidden-from": hideFrom,
|
|
34
|
+
className: className,
|
|
33
35
|
style: boxStyle
|
|
34
36
|
}, domProps), children);
|
|
35
37
|
});
|
|
@@ -30,7 +30,7 @@ const sizeStyleMap = {
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
// Derive box property keys from style mappings
|
|
33
|
-
const boxPropKeys = [...Object.keys(paddingStyleMap), ...Object.keys(marginStyleMap), ...Object.keys(sizeStyleMap), '
|
|
33
|
+
const boxPropKeys = [...Object.keys(paddingStyleMap), ...Object.keys(marginStyleMap), ...Object.keys(sizeStyleMap), 'bd', 'bg', 'c', 'display', 'rounded', 'shadow'];
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Extract box properties from props
|
|
@@ -94,14 +94,14 @@ export const getBoxCSSVariables = props => {
|
|
|
94
94
|
cssVars[`--rs-box-${propKey}`] = getCssValue(props[propKey]);
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
if (props.
|
|
98
|
-
cssVars['--rs-box-
|
|
97
|
+
if (props.bd !== undefined) {
|
|
98
|
+
cssVars['--rs-box-bd'] = getCssValue(props.bd);
|
|
99
99
|
}
|
|
100
100
|
if (props.display !== undefined) {
|
|
101
101
|
cssVars['--rs-box-display'] = props.display;
|
|
102
102
|
}
|
|
103
|
-
if (props.
|
|
104
|
-
cssVars['--rs-box-
|
|
103
|
+
if (props.c !== undefined) {
|
|
104
|
+
cssVars['--rs-box-c'] = getColorVar(props.c);
|
|
105
105
|
}
|
|
106
106
|
if (props.bg !== undefined) {
|
|
107
107
|
cssVars['--rs-box-bg'] = getColorVar(props.bg);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare function useRenderMenuItem(
|
|
2
|
+
export declare function useRenderMenuItem(as: React.ElementType): (props: any, overrideAs?: React.ElementType) => React.JSX.Element;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
3
|
import React, { useCallback } from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import Box from "../Box/index.js";
|
|
5
|
+
export function useRenderMenuItem(as) {
|
|
6
|
+
return useCallback((props, overrideAs) => {
|
|
7
|
+
if (as === 'li') {
|
|
8
|
+
if (overrideAs) {
|
|
7
9
|
return /*#__PURE__*/React.createElement("li", {
|
|
8
10
|
role: "none presentation"
|
|
9
|
-
}, /*#__PURE__*/React.createElement(
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
12
|
+
as: overrideAs
|
|
13
|
+
}, props)));
|
|
10
14
|
}
|
|
11
|
-
return /*#__PURE__*/React.createElement(
|
|
15
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
16
|
+
as: as
|
|
17
|
+
}, props));
|
|
12
18
|
}
|
|
13
19
|
return /*#__PURE__*/React.createElement("li", {
|
|
14
20
|
role: "none presentation"
|
|
15
|
-
}, /*#__PURE__*/React.createElement(
|
|
16
|
-
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
22
|
+
as: as
|
|
23
|
+
}, props)));
|
|
24
|
+
}, [as]);
|
|
17
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
import type { AnimationEventProps } from '../types';
|
|
4
|
+
export interface BaseModalProps extends Omit<BoxProps, 'children'>, AnimationEventProps {
|
|
4
5
|
/** Animation-related properties */
|
|
5
6
|
animationProps?: any;
|
|
6
7
|
/** Primary content */
|
|
@@ -6,6 +6,7 @@ import contains from 'dom-lib/contains';
|
|
|
6
6
|
import on from 'dom-lib/on';
|
|
7
7
|
import ModalManager from "./ModalManager.js";
|
|
8
8
|
import Fade from "../../Animation/Fade.js";
|
|
9
|
+
import Box from "../Box/index.js";
|
|
9
10
|
import { OverlayProvider } from "./OverlayProvider.js";
|
|
10
11
|
import { KEY_VALUES } from "../constants/index.js";
|
|
11
12
|
import { usePortal, useWillUnmount, useEventCallback } from "../hooks/index.js";
|
|
@@ -39,7 +40,7 @@ const useModalManager = () => {
|
|
|
39
40
|
};
|
|
40
41
|
const Modal = forwardRef((props, ref) => {
|
|
41
42
|
const {
|
|
42
|
-
as
|
|
43
|
+
as,
|
|
43
44
|
children,
|
|
44
45
|
transition: Transition,
|
|
45
46
|
dialogTransitionTimeout,
|
|
@@ -208,7 +209,9 @@ const Modal = forwardRef((props, ref) => {
|
|
|
208
209
|
}), children) : children;
|
|
209
210
|
return /*#__PURE__*/React.createElement(OverlayProvider, {
|
|
210
211
|
overlayContainer: overlayContainer
|
|
211
|
-
}, /*#__PURE__*/React.createElement(Portal, null, backdrop && renderBackdrop(), /*#__PURE__*/React.createElement(
|
|
212
|
+
}, /*#__PURE__*/React.createElement(Portal, null, backdrop && renderBackdrop(), /*#__PURE__*/React.createElement(Box, _extends({
|
|
213
|
+
as: as
|
|
214
|
+
}, rest, {
|
|
212
215
|
ref: mergeRefs(modal.setDialogRef, ref),
|
|
213
216
|
style: style,
|
|
214
217
|
className: className,
|
|
@@ -31,5 +31,5 @@ export interface PickerToggleProps<T = OptionValue> extends ToggleButtonProps {
|
|
|
31
31
|
focusItemValue?: T | null;
|
|
32
32
|
onClean?: (event: React.MouseEvent) => void;
|
|
33
33
|
}
|
|
34
|
-
declare const PickerToggle: import("../types").InternalRefForwardingComponent<React.ForwardRefExoticComponent<
|
|
34
|
+
declare const PickerToggle: import("../types").InternalRefForwardingComponent<React.ForwardRefExoticComponent<ToggleButtonProps & React.RefAttributes<HTMLDivElement>>, PickerToggleProps<OptionValue>, never> & Record<string, never>;
|
|
35
35
|
export default PickerToggle;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ButtonProps } from '../../Button';
|
|
3
|
-
export type ToggleButtonProps = ButtonProps
|
|
4
|
-
declare const ToggleButton: React.ForwardRefExoticComponent<
|
|
3
|
+
export type ToggleButtonProps = Omit<ButtonProps, 'color'>;
|
|
4
|
+
declare const ToggleButton: React.ForwardRefExoticComponent<ToggleButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default ToggleButton;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare function useCombobox(): {
|
|
2
2
|
id: string | undefined;
|
|
3
|
-
popupType: "dialog" | "menu" | "
|
|
3
|
+
popupType: "dialog" | "menu" | "grid" | "listbox" | "tree" | undefined;
|
|
4
4
|
multiple: boolean | undefined;
|
|
5
5
|
placement: import("../../types").Placement | undefined;
|
|
6
6
|
labelId: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
3
|
type LocaleKey = 'unfilled' | 'notSelected' | 'notUploaded';
|
|
4
|
-
export interface PlaintextProps extends
|
|
4
|
+
export interface PlaintextProps extends BoxProps {
|
|
5
5
|
placeholder?: React.ReactNode;
|
|
6
6
|
localeKey?: LocaleKey;
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import Box from "../Box/index.js";
|
|
4
5
|
import { forwardRef } from "../utils/index.js";
|
|
5
6
|
import { useStyles } from "../hooks/index.js";
|
|
6
7
|
import { useCustom } from "../../CustomProvider/index.js";
|
|
@@ -13,7 +14,7 @@ const Plaintext = forwardRef((props, ref) => {
|
|
|
13
14
|
getLocale
|
|
14
15
|
} = useCustom();
|
|
15
16
|
const {
|
|
16
|
-
as
|
|
17
|
+
as,
|
|
17
18
|
classPrefix = 'plaintext',
|
|
18
19
|
className,
|
|
19
20
|
children,
|
|
@@ -28,7 +29,8 @@ const Plaintext = forwardRef((props, ref) => {
|
|
|
28
29
|
const classes = merge(className, withPrefix({
|
|
29
30
|
empty: !children
|
|
30
31
|
}));
|
|
31
|
-
return /*#__PURE__*/React.createElement(
|
|
32
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
33
|
+
as: as,
|
|
32
34
|
role: "text"
|
|
33
35
|
}, rest, {
|
|
34
36
|
ref: ref,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
interface TreeViewProps extends
|
|
2
|
+
import { BoxProps } from '../Box';
|
|
3
|
+
interface TreeViewProps extends BoxProps, React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
treeRootClassName: string;
|
|
5
5
|
multiselectable?: boolean;
|
|
6
6
|
height?: number;
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import useCombobox from "../Picker/hooks/useCombobox.js";
|
|
5
5
|
import ScrollView from "../ScrollView/index.js";
|
|
6
|
+
import Box from "../Box/index.js";
|
|
6
7
|
import { useTreeContextProps } from "./TreeProvider.js";
|
|
7
8
|
import { forwardRef } from "../utils/index.js";
|
|
8
9
|
const ScrollShadowView = forwardRef((props, ref) => {
|
|
@@ -32,14 +33,15 @@ const TreeView = forwardRef((props, ref) => {
|
|
|
32
33
|
} = useCombobox();
|
|
33
34
|
|
|
34
35
|
// If the tree is virtualized, the scroll shadow is not needed.
|
|
35
|
-
const
|
|
36
|
+
const treeAs = scrollShadow && !virtualized ? ScrollShadowView : as;
|
|
36
37
|
|
|
37
38
|
// If the tree is virtualized, the height is not needed.
|
|
38
39
|
const viewStyles = {
|
|
39
40
|
height: virtualized ? undefined : height,
|
|
40
41
|
...style
|
|
41
42
|
};
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
+
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
44
|
+
as: treeAs,
|
|
43
45
|
role: "tree",
|
|
44
46
|
style: viewStyles,
|
|
45
47
|
id: id ? `${id}-${popupType}` : undefined,
|
|
@@ -3,7 +3,7 @@ import type { Placement } from './placement';
|
|
|
3
3
|
import type { ToArray } from './utils';
|
|
4
4
|
import type { FormControlBaseProps } from './form';
|
|
5
5
|
import type { AnimationEventProps } from './animation';
|
|
6
|
-
import type {
|
|
6
|
+
import type { BoxProps } from '../Box';
|
|
7
7
|
import type { Size } from './sizes';
|
|
8
8
|
import type { PickerHandle } from '../Picker/types';
|
|
9
9
|
export interface Option<T = number | string> extends Record<string, any> {
|
|
@@ -90,7 +90,7 @@ export interface DataProps<TData> {
|
|
|
90
90
|
*/
|
|
91
91
|
childrenKey?: string;
|
|
92
92
|
}
|
|
93
|
-
export interface PickerBaseProps<L = any> extends PopupProps,
|
|
93
|
+
export interface PickerBaseProps<L = any> extends PopupProps, BoxProps, AnimationEventProps {
|
|
94
94
|
id?: string;
|
|
95
95
|
/**
|
|
96
96
|
* Custom Ref for the picker
|
|
@@ -7,7 +7,7 @@ import { Color } from '../types/colours';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare const getColorVar: (color: Color | string | undefined) => string | undefined;
|
|
9
9
|
export declare const isPresetColor: (color?: Color | React.CSSProperties['color']) => boolean;
|
|
10
|
-
export declare const getColorStyle: (value?: import("csstype").Property.Color | undefined,
|
|
10
|
+
export declare const getColorStyle: (value?: import("csstype").Property.Color | undefined, name?: string | undefined, prop?: string) => {
|
|
11
11
|
[x: string]: string | (string & {}) | undefined;
|
|
12
12
|
} | undefined;
|
|
13
13
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
export type ComponentProps =
|
|
2
|
+
import Box, { BoxProps } from '../Box/Box';
|
|
3
|
+
export type ComponentProps = BoxProps & React.HTMLAttributes<HTMLDivElement>;
|
|
4
4
|
interface Props<T extends React.ElementType> extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
5
|
name: string;
|
|
6
6
|
componentAs?: T;
|
|
@@ -8,6 +8,7 @@ interface Props<T extends React.ElementType> extends React.HTMLAttributes<HTMLDi
|
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Create a component with `classPrefix` and `as` attributes.
|
|
11
|
+
* By default, the component is based on Box component and inherits all Box props.
|
|
11
12
|
*/
|
|
12
|
-
export declare function createComponent<T extends React.ElementType =
|
|
13
|
+
export declare function createComponent<T extends React.ElementType = typeof Box, P = ComponentProps>({ name, componentAs, componentClassPrefix, ...defaultProps }: Props<T> & Partial<P>): import("../types").InternalRefForwardingComponent<T, Partial<P>, never> & Record<string, never>;
|
|
13
14
|
export default createComponent;
|