rsuite 6.0.0-canary-2025031415 → 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 +53 -91
- package/ButtonToolbar/styles/index.css +4 -0
- package/ButtonToolbar/styles/index.less +5 -0
- package/CHANGELOG.md +9 -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/Popover/styles/index.css +1 -1
- package/Popover/styles/index.less +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/Navbar/NavbarMegaMenu.js +7 -5
- 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/UploadTrigger.d.ts +3 -1
- package/cjs/Uploader/UploadTrigger.js +18 -11
- package/cjs/Uploader/Uploader.d.ts +3 -3
- 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 +13 -9
- package/cjs/internals/Box/Box.js +17 -17
- 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 +89 -122
- 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 +89 -122
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +89 -122
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +89 -122
- package/dist/rsuite.js +132 -132
- 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/Navbar/NavbarMegaMenu.js +7 -5
- 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/UploadTrigger.d.ts +3 -1
- package/esm/Uploader/UploadTrigger.js +18 -11
- package/esm/Uploader/Uploader.d.ts +3 -3
- 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 +13 -9
- package/esm/internals/Box/Box.js +17 -17
- 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 +54 -168
- 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
|
@@ -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
|
*/
|
|
@@ -33,7 +33,7 @@ export interface UploaderProps extends WithAsProps, Omit<UploadTriggerProps, 'on
|
|
|
33
33
|
/** Automatically upload files after selecting them */
|
|
34
34
|
autoUpload?: boolean;
|
|
35
35
|
/** Primary content */
|
|
36
|
-
children?: React.
|
|
36
|
+
children?: React.ReactElement;
|
|
37
37
|
/** List of uploaded files */
|
|
38
38
|
defaultFileList?: FileType[];
|
|
39
39
|
/** List of uploaded files (Controlled) */
|
package/cjs/Uploader/Uploader.js
CHANGED
|
@@ -11,6 +11,7 @@ var _UploadFileItem = _interopRequireDefault(require("./UploadFileItem"));
|
|
|
11
11
|
var _Plaintext = _interopRequireDefault(require("../internals/Plaintext"));
|
|
12
12
|
var _ajaxUpload = _interopRequireDefault(require("./utils/ajaxUpload"));
|
|
13
13
|
var _UploadTrigger = _interopRequireDefault(require("./UploadTrigger"));
|
|
14
|
+
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
14
15
|
var _utils = require("../internals/utils");
|
|
15
16
|
var _hooks = require("../internals/hooks");
|
|
16
17
|
var _CustomProvider = require("../CustomProvider");
|
|
@@ -98,7 +99,7 @@ const Uploader = (0, _utils.forwardRef)((props, ref) => {
|
|
|
98
99
|
propsWithDefaults
|
|
99
100
|
} = (0, _CustomProvider.useCustom)('Uploader', props);
|
|
100
101
|
const {
|
|
101
|
-
as
|
|
102
|
+
as,
|
|
102
103
|
classPrefix = 'uploader',
|
|
103
104
|
className,
|
|
104
105
|
listType = 'text',
|
|
@@ -388,7 +389,8 @@ const Uploader = (0, _utils.forwardRef)((props, ref) => {
|
|
|
388
389
|
if (listType === 'picture') {
|
|
389
390
|
renderList.reverse();
|
|
390
391
|
}
|
|
391
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
392
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
|
393
|
+
as: as,
|
|
392
394
|
ref: rootRef,
|
|
393
395
|
className: classes,
|
|
394
396
|
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
|
-
/**
|
|
7
|
-
|
|
8
|
-
/** Hide element */
|
|
9
|
-
hidden?: Breakpoints;
|
|
4
|
+
/** Breakpoint below which the component is shown with `display: block` */
|
|
5
|
+
showFrom?: Breakpoints;
|
|
6
|
+
/** Breakpoint above which the component is hidden with `display: none` */
|
|
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/cjs/internals/Box/Box.js
CHANGED
|
@@ -6,37 +6,37 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
10
|
var _utils = require("../utils");
|
|
10
|
-
var
|
|
11
|
+
var _forwardRef = require("../utils/forwardRef");
|
|
11
12
|
var _utils2 = require("./utils");
|
|
12
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Box component is the base component for all components,
|
|
15
|
+
* providing shorthand for style properties.
|
|
16
|
+
*
|
|
17
|
+
* @see https://rsuitejs.com/components/box
|
|
18
|
+
*/
|
|
19
|
+
const Box = (0, _forwardRef.forwardRef)((props, ref) => {
|
|
13
20
|
const {
|
|
14
21
|
as: Component = 'div',
|
|
15
|
-
classPrefix = 'box',
|
|
16
22
|
className,
|
|
17
23
|
children,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
hidden,
|
|
24
|
+
showFrom,
|
|
25
|
+
hideFrom,
|
|
21
26
|
style,
|
|
22
27
|
...rest
|
|
23
28
|
} = props;
|
|
24
29
|
const boxProps = (0, _utils2.extractBoxProps)(rest);
|
|
25
30
|
const domProps = (0, _utils2.omitBoxProps)(rest);
|
|
26
|
-
const {
|
|
27
|
-
merge,
|
|
28
|
-
withPrefix
|
|
29
|
-
} = (0, _hooks.useStyles)(classPrefix);
|
|
30
|
-
const classes = merge(className, withPrefix({
|
|
31
|
-
[`visible-${visible}`]: visible,
|
|
32
|
-
[`hidden-${hidden}`]: hidden
|
|
33
|
-
}));
|
|
34
31
|
const boxCSSVars = (0, _utils2.getBoxCSSVariables)(boxProps);
|
|
35
32
|
const boxStyle = (0, _utils.mergeStyles)(style, boxCSSVars);
|
|
36
|
-
const
|
|
37
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
33
|
+
const isBox = !(0, _isEmpty.default)(boxCSSVars) || showFrom || hideFrom;
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
38
35
|
ref: ref,
|
|
39
|
-
|
|
36
|
+
"data-rs": isBox ? 'box' : undefined,
|
|
37
|
+
"data-visible-from": showFrom,
|
|
38
|
+
"data-hidden-from": hideFrom,
|
|
39
|
+
className: className,
|
|
40
40
|
style: boxStyle
|
|
41
41
|
}, domProps), children);
|
|
42
42
|
});
|
|
@@ -33,7 +33,7 @@ const sizeStyleMap = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// Derive box property keys from style mappings
|
|
36
|
-
const boxPropKeys = [...Object.keys(paddingStyleMap), ...Object.keys(marginStyleMap), ...Object.keys(sizeStyleMap), '
|
|
36
|
+
const boxPropKeys = [...Object.keys(paddingStyleMap), ...Object.keys(marginStyleMap), ...Object.keys(sizeStyleMap), 'bd', 'bg', 'c', 'display', 'rounded', 'shadow'];
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Extract box properties from props
|
|
@@ -99,14 +99,14 @@ const getBoxCSSVariables = props => {
|
|
|
99
99
|
cssVars[`--rs-box-${propKey}`] = (0, _utils.getCssValue)(props[propKey]);
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
|
-
if (props.
|
|
103
|
-
cssVars['--rs-box-
|
|
102
|
+
if (props.bd !== undefined) {
|
|
103
|
+
cssVars['--rs-box-bd'] = (0, _utils.getCssValue)(props.bd);
|
|
104
104
|
}
|
|
105
105
|
if (props.display !== undefined) {
|
|
106
106
|
cssVars['--rs-box-display'] = props.display;
|
|
107
107
|
}
|
|
108
|
-
if (props.
|
|
109
|
-
cssVars['--rs-box-
|
|
108
|
+
if (props.c !== undefined) {
|
|
109
|
+
cssVars['--rs-box-c'] = (0, _utils.getColorVar)(props.c);
|
|
110
110
|
}
|
|
111
111
|
if (props.bg !== undefined) {
|
|
112
112
|
cssVars['--rs-box-bg'] = (0, _utils.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,23 +1,32 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
exports.__esModule = true;
|
|
5
6
|
exports.useRenderMenuItem = useRenderMenuItem;
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
6
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../Box"));
|
|
7
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
8
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
9
|
-
function useRenderMenuItem(
|
|
10
|
-
return (0, _react.useCallback)((props,
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
12
|
+
function useRenderMenuItem(as) {
|
|
13
|
+
return (0, _react.useCallback)((props, overrideAs) => {
|
|
14
|
+
if (as === 'li') {
|
|
15
|
+
if (overrideAs) {
|
|
13
16
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
14
17
|
role: "none presentation"
|
|
15
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
19
|
+
as: overrideAs
|
|
20
|
+
}, props)));
|
|
16
21
|
}
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
23
|
+
as: as
|
|
24
|
+
}, props));
|
|
18
25
|
}
|
|
19
26
|
return /*#__PURE__*/_react.default.createElement("li", {
|
|
20
27
|
role: "none presentation"
|
|
21
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
22
|
-
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
29
|
+
as: as
|
|
30
|
+
}, props)));
|
|
31
|
+
}, [as]);
|
|
23
32
|
}
|
|
@@ -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 */
|
|
@@ -11,6 +11,7 @@ var _contains = _interopRequireDefault(require("dom-lib/contains"));
|
|
|
11
11
|
var _on = _interopRequireDefault(require("dom-lib/on"));
|
|
12
12
|
var _ModalManager = _interopRequireDefault(require("./ModalManager"));
|
|
13
13
|
var _Fade = _interopRequireDefault(require("../../Animation/Fade"));
|
|
14
|
+
var _Box = _interopRequireDefault(require("../Box"));
|
|
14
15
|
var _OverlayProvider = require("./OverlayProvider");
|
|
15
16
|
var _constants = require("../constants");
|
|
16
17
|
var _hooks = require("../hooks");
|
|
@@ -46,7 +47,7 @@ const useModalManager = () => {
|
|
|
46
47
|
};
|
|
47
48
|
const Modal = (0, _utils.forwardRef)((props, ref) => {
|
|
48
49
|
const {
|
|
49
|
-
as
|
|
50
|
+
as,
|
|
50
51
|
children,
|
|
51
52
|
transition: Transition,
|
|
52
53
|
dialogTransitionTimeout,
|
|
@@ -215,7 +216,9 @@ const Modal = (0, _utils.forwardRef)((props, ref) => {
|
|
|
215
216
|
}), children) : children;
|
|
216
217
|
return /*#__PURE__*/_react.default.createElement(_OverlayProvider.OverlayProvider, {
|
|
217
218
|
overlayContainer: overlayContainer
|
|
218
|
-
}, /*#__PURE__*/_react.default.createElement(Portal, null, backdrop && renderBackdrop(), /*#__PURE__*/_react.default.createElement(
|
|
219
|
+
}, /*#__PURE__*/_react.default.createElement(Portal, null, backdrop && renderBackdrop(), /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
220
|
+
as: as
|
|
221
|
+
}, rest, {
|
|
219
222
|
ref: (0, _utils.mergeRefs)(modal.setDialogRef, ref),
|
|
220
223
|
style: style,
|
|
221
224
|
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
|
}
|
|
@@ -6,6 +6,7 @@ exports.__esModule = true;
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Box = _interopRequireDefault(require("../Box"));
|
|
9
10
|
var _utils = require("../utils");
|
|
10
11
|
var _hooks = require("../hooks");
|
|
11
12
|
var _CustomProvider = require("../../CustomProvider");
|
|
@@ -18,7 +19,7 @@ const Plaintext = (0, _utils.forwardRef)((props, ref) => {
|
|
|
18
19
|
getLocale
|
|
19
20
|
} = (0, _CustomProvider.useCustom)();
|
|
20
21
|
const {
|
|
21
|
-
as
|
|
22
|
+
as,
|
|
22
23
|
classPrefix = 'plaintext',
|
|
23
24
|
className,
|
|
24
25
|
children,
|
|
@@ -33,7 +34,8 @@ const Plaintext = (0, _utils.forwardRef)((props, ref) => {
|
|
|
33
34
|
const classes = merge(className, withPrefix({
|
|
34
35
|
empty: !children
|
|
35
36
|
}));
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
38
|
+
as: as,
|
|
37
39
|
role: "text"
|
|
38
40
|
}, rest, {
|
|
39
41
|
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;
|
|
@@ -8,6 +8,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _useCombobox = _interopRequireDefault(require("../Picker/hooks/useCombobox"));
|
|
10
10
|
var _ScrollView = _interopRequireDefault(require("../ScrollView"));
|
|
11
|
+
var _Box = _interopRequireDefault(require("../Box"));
|
|
11
12
|
var _TreeProvider = require("./TreeProvider");
|
|
12
13
|
var _utils = require("../utils");
|
|
13
14
|
const ScrollShadowView = (0, _utils.forwardRef)((props, ref) => {
|
|
@@ -37,14 +38,15 @@ const TreeView = (0, _utils.forwardRef)((props, ref) => {
|
|
|
37
38
|
} = (0, _useCombobox.default)();
|
|
38
39
|
|
|
39
40
|
// If the tree is virtualized, the scroll shadow is not needed.
|
|
40
|
-
const
|
|
41
|
+
const treeAs = scrollShadow && !virtualized ? ScrollShadowView : as;
|
|
41
42
|
|
|
42
43
|
// If the tree is virtualized, the height is not needed.
|
|
43
44
|
const viewStyles = {
|
|
44
45
|
height: virtualized ? undefined : height,
|
|
45
46
|
...style
|
|
46
47
|
};
|
|
47
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
49
|
+
as: treeAs,
|
|
48
50
|
role: "tree",
|
|
49
51
|
style: viewStyles,
|
|
50
52
|
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;
|
|
@@ -8,11 +8,13 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _kebabCase = _interopRequireDefault(require("lodash/kebabCase"));
|
|
11
|
+
var _Box = _interopRequireDefault(require("../Box/Box"));
|
|
11
12
|
var _hooks = require("../hooks");
|
|
12
|
-
var
|
|
13
|
+
var _forwardRef = require("./forwardRef");
|
|
13
14
|
var _CustomProvider = require("../../CustomProvider");
|
|
14
15
|
/**
|
|
15
16
|
* Create a component with `classPrefix` and `as` attributes.
|
|
17
|
+
* By default, the component is based on Box component and inherits all Box props.
|
|
16
18
|
*/
|
|
17
19
|
function createComponent(_ref) {
|
|
18
20
|
let {
|
|
@@ -21,12 +23,12 @@ function createComponent(_ref) {
|
|
|
21
23
|
componentClassPrefix,
|
|
22
24
|
...defaultProps
|
|
23
25
|
} = _ref;
|
|
24
|
-
const Component = (0,
|
|
26
|
+
const Component = (0, _forwardRef.forwardRef)((props, ref) => {
|
|
25
27
|
const {
|
|
26
28
|
propsWithDefaults
|
|
27
29
|
} = (0, _CustomProvider.useCustom)(name, props);
|
|
28
30
|
const {
|
|
29
|
-
as
|
|
31
|
+
as,
|
|
30
32
|
classPrefix = componentClassPrefix || (0, _kebabCase.default)(name),
|
|
31
33
|
className,
|
|
32
34
|
role,
|
|
@@ -37,10 +39,11 @@ function createComponent(_ref) {
|
|
|
37
39
|
merge
|
|
38
40
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
39
41
|
const classes = merge(className, withPrefix());
|
|
40
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({}, defaultProps, rest, {
|
|
41
43
|
role: role,
|
|
42
44
|
ref: ref,
|
|
43
|
-
className: classes
|
|
45
|
+
className: classes,
|
|
46
|
+
as: as || componentAs || 'div'
|
|
44
47
|
}));
|
|
45
48
|
});
|
|
46
49
|
Component.displayName = name;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { SizeEnum } from '../types';
|
|
2
2
|
export declare const isPresetSize: (size?: SizeEnum | number | string | null) => boolean;
|
|
3
|
-
export declare const getSizeStyle: (value?: string | number | undefined,
|
|
3
|
+
export declare const getSizeStyle: (value?: string | number | undefined, name?: string | undefined, prop?: string) => {
|
|
4
|
+
[x: string]: string | number | undefined;
|
|
5
|
+
} | undefined;
|
|
6
|
+
export declare const getLineHeightStyle: (value?: string | number | undefined, name?: string | undefined, prop?: string) => {
|
|
4
7
|
[x: string]: string | number | undefined;
|
|
5
8
|
} | undefined;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.isPresetSize = exports.getSizeStyle = void 0;
|
|
5
|
+
exports.isPresetSize = exports.getSizeStyle = exports.getLineHeightStyle = void 0;
|
|
6
6
|
var _types = require("../types");
|
|
7
7
|
var _styleSheet = require("./style-sheet");
|
|
8
8
|
const isPresetSize = size => {
|
|
9
9
|
if (!size) {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
|
-
const presetSizes = [...Object.values(_types.SizeEnum), 'full'];
|
|
12
|
+
const presetSizes = [...Object.values(_types.SizeEnum), ...Object.values(_types.TypographySizeEnum), 'full'];
|
|
13
13
|
return presetSizes.includes(size);
|
|
14
14
|
};
|
|
15
15
|
exports.isPresetSize = isPresetSize;
|
|
@@ -18,4 +18,10 @@ const sizeConfig = {
|
|
|
18
18
|
presetChecker: isPresetSize,
|
|
19
19
|
valueTransformer: _styleSheet.getCssValue
|
|
20
20
|
};
|
|
21
|
-
const getSizeStyle = exports.getSizeStyle = (0, _styleSheet.createStyleGetter)(sizeConfig);
|
|
21
|
+
const getSizeStyle = exports.getSizeStyle = (0, _styleSheet.createStyleGetter)(sizeConfig);
|
|
22
|
+
const lineHeightConfig = {
|
|
23
|
+
prop: 'line-height',
|
|
24
|
+
presetChecker: isPresetSize,
|
|
25
|
+
valueTransformer: value => isPresetSize(value) ? value : null
|
|
26
|
+
};
|
|
27
|
+
const getLineHeightStyle = exports.getLineHeightStyle = (0, _styleSheet.createStyleGetter)(lineHeightConfig);
|
|
@@ -7,7 +7,7 @@ export declare function getCssValue(value?: number | string | null, unit?: strin
|
|
|
7
7
|
/**
|
|
8
8
|
* Merge multiple style objects, filtering out undefined values
|
|
9
9
|
*/
|
|
10
|
-
export declare function mergeStyles(...styles: (StyleProperties | undefined | null)[]): React.CSSProperties;
|
|
10
|
+
export declare function mergeStyles(...styles: (StyleProperties | undefined | null)[]): React.CSSProperties | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* Create CSS variables for offset positioning
|
|
13
13
|
*/
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
exports.__esModule = true;
|
|
5
6
|
exports.createOffsetStyles = createOffsetStyles;
|
|
6
7
|
exports.getCssValue = getCssValue;
|
|
7
8
|
exports.mergeStyles = mergeStyles;
|
|
9
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
10
|
/**
|
|
9
11
|
* Processes and returns a value suitable for CSS (with a unit).
|
|
10
12
|
*/
|
|
@@ -37,13 +39,14 @@ function mergeStyles() {
|
|
|
37
39
|
for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
40
|
styles[_key] = arguments[_key];
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
const mergedStyles = styles === null || styles === void 0 ? void 0 : styles.filter(Boolean).reduce((acc, style) => {
|
|
41
43
|
if (!style) return acc;
|
|
42
44
|
return {
|
|
43
45
|
...acc,
|
|
44
46
|
...style
|
|
45
47
|
};
|
|
46
48
|
}, {});
|
|
49
|
+
return (0, _isEmpty.default)(mergedStyles) ? undefined : mergedStyles;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
/**
|
|
@@ -9,8 +9,8 @@ interface StylePropConfig<T = StyleValue> {
|
|
|
9
9
|
presetChecker?: PresetChecker<T>;
|
|
10
10
|
valueTransformer?: ValueTransformer<T>;
|
|
11
11
|
}
|
|
12
|
-
export declare const createStyleValueSetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T | undefined,
|
|
13
|
-
export declare const createStyleGetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T | undefined,
|
|
12
|
+
export declare const createStyleValueSetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T | undefined, name?: string, prop?: string) => string | T | undefined;
|
|
13
|
+
export declare const createStyleGetter: <T = string | number>(config: StylePropConfig<T>) => (value?: T | undefined, name?: string, prop?: string) => {
|
|
14
14
|
[x: string]: string | T | undefined;
|
|
15
15
|
} | undefined;
|
|
16
16
|
export {};
|
|
@@ -9,15 +9,15 @@ const createStyleValueSetter = config => {
|
|
|
9
9
|
presetChecker,
|
|
10
10
|
useGlobalVar
|
|
11
11
|
} = config;
|
|
12
|
-
return function (value,
|
|
12
|
+
return function (value, name, prop) {
|
|
13
13
|
if (prop === void 0) {
|
|
14
14
|
prop = config.prop;
|
|
15
15
|
}
|
|
16
|
-
if (typeof value === 'undefined' || !
|
|
16
|
+
if (typeof value === 'undefined' || !name) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
if (presetChecker !== null && presetChecker !== void 0 && presetChecker(value)) {
|
|
20
|
-
return useGlobalVar ? `var(--rs-${prop}-${value})` : `var(--rs-${
|
|
20
|
+
return useGlobalVar ? `var(--rs-${prop}-${value})` : `var(--rs-${name}-${prop}-${value})`;
|
|
21
21
|
} else if (Array.isArray(value)) {
|
|
22
22
|
// If value is an array, join it with spaces,
|
|
23
23
|
// .eg, gap=[10, 20] -> '10px 20px'
|
|
@@ -29,15 +29,15 @@ const createStyleValueSetter = config => {
|
|
|
29
29
|
exports.createStyleValueSetter = createStyleValueSetter;
|
|
30
30
|
const createStyleGetter = config => {
|
|
31
31
|
const setValue = createStyleValueSetter(config);
|
|
32
|
-
return function (value,
|
|
32
|
+
return function (value, name, prop) {
|
|
33
33
|
if (prop === void 0) {
|
|
34
34
|
prop = config.prop;
|
|
35
35
|
}
|
|
36
|
-
if (typeof value === 'undefined' || !
|
|
36
|
+
if (typeof value === 'undefined' || !name) {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
|
-
[`--rs-${
|
|
40
|
+
[`--rs-${name}-${prop}`]: setValue(value, name, prop)
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
};
|