rsuite 6.0.0-canary-20250624 → 6.0.0-canary-20250702
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/AutoComplete/styles/index.css +156 -161
- package/AvatarGroup/styles/index.css +1 -10
- package/Badge/styles/index.css +21 -21
- package/Button/styles/index.css +78 -63
- package/ButtonGroup/styles/index.css +15 -12
- package/ButtonToolbar/styles/index.css +1 -10
- package/CHANGELOG.md +9 -0
- package/Calendar/styles/index.css +92 -67
- package/Card/styles/index.css +7 -7
- package/CascadeTree/styles/index.css +8 -9
- package/Cascader/styles/index.css +160 -164
- package/CheckPicker/styles/index.css +173 -178
- package/CheckTree/styles/index.css +175 -180
- package/CheckTreePicker/styles/index.css +175 -180
- package/Checkbox/styles/index.css +21 -28
- package/CheckboxGroup/styles/index.css +1 -1
- package/DateInput/styles/index.css +8 -18
- package/DatePicker/styles/index.css +173 -168
- package/DateRangeInput/styles/index.css +8 -18
- package/DateRangePicker/styles/index.css +173 -168
- package/Dropdown/styles/index.css +110 -94
- package/IconButton/styles/index.css +95 -79
- package/InlineEdit/styles/index.css +12 -19
- package/Input/styles/index.css +8 -18
- package/InputGroup/styles/index.css +31 -38
- package/InputNumber/styles/index.css +115 -100
- package/InputPicker/styles/index.css +156 -161
- package/List/styles/index.css +10 -10
- package/Loader/styles/index.css +16 -16
- package/Menu/styles/index.css +2 -2
- package/Message/styles/index.css +2 -2
- package/MultiCascadeTree/styles/index.css +178 -191
- package/MultiCascader/styles/index.css +178 -200
- package/Nav/styles/index.css +162 -146
- package/Navbar/styles/index.css +140 -124
- package/NumberInput/styles/index.css +115 -100
- package/Pagination/styles/index.css +177 -200
- package/PasswordInput/styles/index.css +36 -43
- package/PinInput/styles/index.css +12 -22
- package/Radio/styles/index.css +22 -29
- package/RadioGroup/styles/index.css +11 -11
- package/SelectPicker/styles/index.css +156 -161
- package/Sidenav/styles/index.css +122 -129
- package/Stack/styles/index.css +1 -10
- package/Stat/styles/index.css +95 -79
- package/Steps/styles/index.css +26 -25
- package/Table/styles/index.css +11 -0
- package/Tabs/styles/index.css +162 -146
- package/Tag/styles/index.css +112 -96
- package/TagInput/styles/index.css +174 -179
- package/TagPicker/styles/index.css +174 -179
- package/TimePicker/styles/index.css +173 -168
- package/TimeRangePicker/styles/index.css +173 -168
- package/Toggle/styles/index.css +27 -30
- package/Tree/styles/index.css +157 -162
- package/TreePicker/styles/index.css +157 -162
- package/Uploader/styles/index.css +94 -65
- package/cjs/Badge/Badge.js +16 -11
- package/cjs/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/cjs/Button/Button.js +9 -7
- package/cjs/ButtonGroup/ButtonGroup.js +7 -7
- package/cjs/Card/Card.js +6 -6
- package/cjs/Checkbox/Checkbox.js +6 -7
- package/cjs/CheckboxGroup/CheckboxGroup.js +3 -4
- package/cjs/Dropdown/Dropdown.js +3 -4
- package/cjs/Dropdown/DropdownItem.js +4 -4
- package/cjs/Dropdown/DropdownMenu.js +9 -10
- package/cjs/FormControl/FormControl.d.ts +1 -1
- package/cjs/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/cjs/FormHelpText/FormHelpText.d.ts +1 -1
- package/cjs/IconButton/IconButton.d.ts +1 -1
- package/cjs/IconButton/IconButton.js +9 -9
- package/cjs/Image/Image.d.ts +1 -1
- package/cjs/InlineEdit/InlineEdit.js +3 -2
- package/cjs/InputGroup/InputGroup.js +12 -14
- package/cjs/InputGroup/InputGroupAddon.d.ts +2 -2
- package/cjs/InputPicker/InputAutosize.js +4 -6
- package/cjs/List/List.d.ts +1 -1
- package/cjs/List/List.js +7 -8
- package/cjs/List/ListItem.d.ts +2 -2
- package/cjs/List/ListItem.js +4 -4
- package/cjs/Loader/Loader.js +8 -7
- package/cjs/Menu/MenuSeparator.d.ts +2 -2
- package/cjs/Nav/Nav.d.ts +2 -2
- package/cjs/Nav/Nav.js +12 -13
- package/cjs/Nav/NavDropdownItem.js +4 -4
- package/cjs/Nav/NavDropdownMenu.js +10 -13
- package/cjs/Nav/NavItem.d.ts +2 -2
- package/cjs/Nav/NavItem.js +6 -8
- package/cjs/Navbar/Navbar.js +6 -6
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.js +3 -4
- package/cjs/Navbar/NavbarDropdownItem.js +4 -4
- package/cjs/Navbar/NavbarDropdownMenu.js +8 -11
- package/cjs/NumberInput/NumberInput.d.ts +1 -1
- package/cjs/Pagination/Pagination.js +3 -2
- package/cjs/Pagination/PaginationButton.d.ts +3 -3
- package/cjs/Pagination/PaginationButton.js +9 -17
- package/cjs/Pagination/PaginationGroup.js +2 -1
- package/cjs/Panel/PanelHeader.d.ts +1 -1
- package/cjs/Radio/Radio.js +6 -6
- package/cjs/RadioGroup/RadioGroup.js +4 -4
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/Sidenav.js +3 -2
- package/cjs/Sidenav/SidenavDropdown.js +3 -5
- package/cjs/Sidenav/SidenavDropdownItem.js +4 -4
- package/cjs/Sidenav/SidenavDropdownMenu.js +10 -13
- package/cjs/Sidenav/SidenavItem.d.ts +2 -2
- package/cjs/Sidenav/SidenavItem.js +4 -5
- package/cjs/Slider/Handle.d.ts +1 -1
- package/cjs/Stack/Stack.d.ts +1 -17
- package/cjs/Stack/Stack.js +3 -4
- package/cjs/Stack/StackItem.d.ts +4 -5
- package/cjs/Stack/StackItem.js +4 -10
- package/cjs/Steps/StepItem.js +7 -8
- package/cjs/Steps/Steps.d.ts +2 -1
- package/cjs/Steps/Steps.js +32 -34
- package/cjs/Tabs/Tabs.js +1 -1
- package/cjs/Tag/Tag.js +5 -2
- package/cjs/Toggle/Toggle.d.ts +1 -1
- package/cjs/Toggle/Toggle.js +7 -6
- package/cjs/Tree/types.d.ts +2 -2
- package/cjs/Uploader/Uploader.d.ts +2 -2
- package/cjs/internals/Box/Box.d.ts +1 -0
- package/cjs/internals/Box/index.d.ts +1 -1
- package/cjs/internals/Box/utils.js +5 -4
- package/cjs/internals/InputBase/InputBase.d.ts +1 -1
- package/cjs/internals/InputBase/InputBase.js +3 -2
- package/cjs/internals/Menu/MenuItem.js +1 -1
- package/cjs/internals/Overlay/Modal.d.ts +1 -1
- package/cjs/internals/Picker/PickerToggle.js +2 -4
- package/cjs/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/cjs/internals/Tree/TreeView.d.ts +2 -2
- package/cjs/internals/hooks/useCustom.js +24 -7
- package/cjs/internals/styled-system/css-alias.d.ts +7 -0
- package/cjs/internals/styled-system/css-alias.js +391 -0
- package/cjs/internals/styled-system/css-properties.d.ts +6 -0
- package/cjs/internals/styled-system/css-properties.js +30 -0
- package/cjs/internals/styled-system/index.d.ts +1 -1
- package/cjs/internals/styled-system/index.js +4 -4
- package/cjs/internals/styled-system/responsive.d.ts +0 -4
- package/cjs/internals/styled-system/responsive.js +12 -33
- package/cjs/internals/styled-system/types.d.ts +59 -5
- package/cjs/internals/styled-system/useStyled.js +3 -3
- package/cjs/internals/types/html.d.ts +6 -6
- package/cjs/internals/types/picker.d.ts +1 -1
- package/dist/rsuite-no-reset.css +641 -641
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite.css +641 -641
- package/dist/rsuite.js +60 -60
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Badge/Badge.js +16 -11
- package/esm/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/esm/Button/Button.js +9 -7
- package/esm/ButtonGroup/ButtonGroup.js +7 -7
- package/esm/Card/Card.js +6 -6
- package/esm/Checkbox/Checkbox.js +6 -7
- package/esm/CheckboxGroup/CheckboxGroup.js +3 -4
- package/esm/Dropdown/Dropdown.js +3 -4
- package/esm/Dropdown/DropdownItem.js +4 -4
- package/esm/Dropdown/DropdownMenu.js +9 -10
- package/esm/FormControl/FormControl.d.ts +1 -1
- package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
- package/esm/FormHelpText/FormHelpText.d.ts +1 -1
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/IconButton/IconButton.js +9 -9
- package/esm/Image/Image.d.ts +1 -1
- package/esm/InlineEdit/InlineEdit.js +3 -2
- package/esm/InputGroup/InputGroup.js +12 -14
- package/esm/InputGroup/InputGroupAddon.d.ts +2 -2
- package/esm/InputPicker/InputAutosize.js +4 -6
- package/esm/List/List.d.ts +1 -1
- package/esm/List/List.js +7 -8
- package/esm/List/ListItem.d.ts +2 -2
- package/esm/List/ListItem.js +4 -4
- package/esm/Loader/Loader.js +8 -7
- package/esm/Menu/MenuSeparator.d.ts +2 -2
- package/esm/Nav/Nav.d.ts +2 -2
- package/esm/Nav/Nav.js +12 -13
- package/esm/Nav/NavDropdownItem.js +4 -4
- package/esm/Nav/NavDropdownMenu.js +10 -13
- package/esm/Nav/NavItem.d.ts +2 -2
- package/esm/Nav/NavItem.js +6 -8
- package/esm/Navbar/Navbar.js +7 -7
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.js +3 -4
- package/esm/Navbar/NavbarDropdownItem.js +4 -4
- package/esm/Navbar/NavbarDropdownMenu.js +8 -11
- package/esm/NumberInput/NumberInput.d.ts +1 -1
- package/esm/Pagination/Pagination.js +3 -2
- package/esm/Pagination/PaginationButton.d.ts +3 -3
- package/esm/Pagination/PaginationButton.js +9 -16
- package/esm/Pagination/PaginationGroup.js +2 -1
- package/esm/Panel/PanelHeader.d.ts +1 -1
- package/esm/Radio/Radio.js +6 -6
- package/esm/RadioGroup/RadioGroup.js +4 -4
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/Sidenav.js +3 -2
- package/esm/Sidenav/SidenavDropdown.js +3 -5
- package/esm/Sidenav/SidenavDropdownItem.js +4 -4
- package/esm/Sidenav/SidenavDropdownMenu.js +10 -13
- package/esm/Sidenav/SidenavItem.d.ts +2 -2
- package/esm/Sidenav/SidenavItem.js +4 -5
- package/esm/Slider/Handle.d.ts +1 -1
- package/esm/Stack/Stack.d.ts +1 -17
- package/esm/Stack/Stack.js +3 -4
- package/esm/Stack/StackItem.d.ts +4 -5
- package/esm/Stack/StackItem.js +5 -11
- package/esm/Steps/StepItem.js +7 -8
- package/esm/Steps/Steps.d.ts +2 -1
- package/esm/Steps/Steps.js +31 -34
- package/esm/Tabs/Tabs.js +1 -1
- package/esm/Tag/Tag.js +5 -2
- package/esm/Toggle/Toggle.d.ts +1 -1
- package/esm/Toggle/Toggle.js +7 -6
- package/esm/Tree/types.d.ts +2 -2
- package/esm/Uploader/Uploader.d.ts +2 -2
- package/esm/internals/Box/Box.d.ts +1 -0
- package/esm/internals/Box/index.d.ts +1 -1
- package/esm/internals/Box/utils.js +6 -5
- package/esm/internals/InputBase/InputBase.d.ts +1 -1
- package/esm/internals/InputBase/InputBase.js +3 -2
- package/esm/internals/Menu/MenuItem.js +1 -1
- package/esm/internals/Overlay/Modal.d.ts +1 -1
- package/esm/internals/Picker/PickerToggle.js +2 -4
- package/esm/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
- package/esm/internals/Tree/TreeView.d.ts +2 -2
- package/esm/internals/hooks/useCustom.js +24 -7
- package/esm/internals/styled-system/css-alias.d.ts +7 -0
- package/esm/internals/styled-system/css-alias.js +387 -0
- package/esm/internals/styled-system/css-properties.d.ts +6 -0
- package/esm/internals/styled-system/css-properties.js +26 -0
- package/esm/internals/styled-system/index.d.ts +1 -1
- package/esm/internals/styled-system/index.js +1 -1
- package/esm/internals/styled-system/responsive.d.ts +0 -4
- package/esm/internals/styled-system/responsive.js +11 -31
- package/esm/internals/styled-system/types.d.ts +59 -5
- package/esm/internals/styled-system/useStyled.js +3 -3
- package/esm/internals/types/html.d.ts +6 -6
- package/esm/internals/types/picker.d.ts +1 -1
- package/package.json +1 -1
- package/cjs/internals/styled-system/css-property.d.ts +0 -6
- package/cjs/internals/styled-system/css-property.js +0 -289
- package/esm/internals/styled-system/css-property.d.ts +0 -6
- package/esm/internals/styled-system/css-property.js +0 -285
|
@@ -67,16 +67,15 @@ const NavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
67
67
|
active,
|
|
68
68
|
...menuitem
|
|
69
69
|
}, menuitemRef) => {
|
|
70
|
-
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix(
|
|
71
|
-
'with-icon': icon,
|
|
72
|
-
open,
|
|
73
|
-
active: selected,
|
|
74
|
-
disabled,
|
|
75
|
-
focus: active
|
|
76
|
-
}));
|
|
70
|
+
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
|
|
77
71
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
78
72
|
ref: mergeRefs(buttonRef, menuitemRef),
|
|
79
73
|
className: classes,
|
|
74
|
+
"data-open": open,
|
|
75
|
+
"data-focus": active,
|
|
76
|
+
"data-active": selected,
|
|
77
|
+
"data-disabled": disabled,
|
|
78
|
+
"data-with-icon": icon,
|
|
80
79
|
"data-event-key": eventKey,
|
|
81
80
|
"data-event-key-type": typeof eventKey
|
|
82
81
|
}, menuitem, omit(menuButtonProps, ['role'])), icon && /*#__PURE__*/React.cloneElement(icon, {
|
|
@@ -102,14 +101,12 @@ const NavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
102
101
|
open,
|
|
103
102
|
...menuContainer
|
|
104
103
|
}, menuContainerRef) => {
|
|
105
|
-
const classes = mergeItemClassNames(className, withItemClassPrefix(
|
|
106
|
-
disabled,
|
|
107
|
-
open,
|
|
108
|
-
submenu: true
|
|
109
|
-
}));
|
|
104
|
+
const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
|
|
110
105
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
111
106
|
ref: mergeRefs(ref, menuContainerRef),
|
|
112
|
-
className: classes
|
|
107
|
+
className: classes,
|
|
108
|
+
"data-open": open,
|
|
109
|
+
"data-disabled": disabled
|
|
113
110
|
}, menuContainer));
|
|
114
111
|
});
|
|
115
112
|
});
|
package/esm/Nav/NavItem.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseBoxProps } from '../internals/Box';
|
|
3
3
|
import type { HTMLPropsWithoutSelect } from '../internals/types';
|
|
4
4
|
import type { IconProps } from '@rsuite/icons/Icon';
|
|
5
|
-
export interface NavItemProps<T = string | number> extends
|
|
5
|
+
export interface NavItemProps<T = string | number> extends BaseBoxProps, HTMLPropsWithoutSelect {
|
|
6
6
|
/** Activation status */
|
|
7
7
|
active?: boolean;
|
|
8
8
|
/** Disabled status */
|
package/esm/Nav/NavItem.js
CHANGED
|
@@ -52,10 +52,7 @@ const NavItem = forwardRef((props, ref) => {
|
|
|
52
52
|
merge,
|
|
53
53
|
prefix
|
|
54
54
|
} = useStyles(classPrefix);
|
|
55
|
-
const classes = merge(className, withPrefix(
|
|
56
|
-
active,
|
|
57
|
-
disabled
|
|
58
|
-
}));
|
|
55
|
+
const classes = merge(className, withPrefix());
|
|
59
56
|
const handleClick = useCallback(event => {
|
|
60
57
|
if (!disabled) {
|
|
61
58
|
emitSelect(event);
|
|
@@ -80,13 +77,14 @@ const NavItem = forwardRef((props, ref) => {
|
|
|
80
77
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
81
78
|
as: as,
|
|
82
79
|
ref: ref,
|
|
83
|
-
tabIndex: disabled ? -1 : undefined
|
|
84
|
-
}, rest, {
|
|
80
|
+
tabIndex: disabled ? -1 : undefined,
|
|
85
81
|
className: classes,
|
|
86
82
|
onClick: handleClick,
|
|
87
83
|
style: style,
|
|
88
|
-
"aria-selected": active || undefined
|
|
89
|
-
|
|
84
|
+
"aria-selected": active || undefined,
|
|
85
|
+
"data-active": active || undefined,
|
|
86
|
+
"data-disabled": disabled
|
|
87
|
+
}, rest), icon && /*#__PURE__*/React.cloneElement(icon, {
|
|
90
88
|
className: classNames(prefix('icon'), icon.props.className)
|
|
91
89
|
}), children, /*#__PURE__*/React.createElement(Ripple, null));
|
|
92
90
|
});
|
package/esm/Navbar/Navbar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import React, { useMemo } from 'react';
|
|
3
|
+
import React, { useMemo, useState } from 'react';
|
|
4
4
|
import NavbarBrand from "./NavbarBrand.js";
|
|
5
5
|
import NavbarContent from "./NavbarContent.js";
|
|
6
6
|
import NavbarToggle from "./NavbarToggle.js";
|
|
@@ -36,8 +36,8 @@ const Navbar = forwardRef((props, ref) => {
|
|
|
36
36
|
withPrefix,
|
|
37
37
|
merge
|
|
38
38
|
} = useStyles(classPrefix);
|
|
39
|
-
const classes = merge(className, withPrefix(
|
|
40
|
-
const [open, setOpen] =
|
|
39
|
+
const classes = merge(className, withPrefix());
|
|
40
|
+
const [open, setOpen] = useState(false);
|
|
41
41
|
const handleToggle = useEventCallback(nextOpen => {
|
|
42
42
|
setOpen(nextOpen);
|
|
43
43
|
onDrawerOpenChange === null || onDrawerOpenChange === void 0 || onDrawerOpenChange(nextOpen);
|
|
@@ -52,11 +52,11 @@ const Navbar = forwardRef((props, ref) => {
|
|
|
52
52
|
return /*#__PURE__*/React.createElement(NavbarContext.Provider, {
|
|
53
53
|
value: context
|
|
54
54
|
}, /*#__PURE__*/React.createElement(Box, _extends({
|
|
55
|
-
as: as
|
|
56
|
-
}, rest, {
|
|
55
|
+
as: as,
|
|
57
56
|
ref: ref,
|
|
58
|
-
className: classes
|
|
59
|
-
|
|
57
|
+
className: classes,
|
|
58
|
+
"data-appearance": appearance
|
|
59
|
+
}, rest)));
|
|
60
60
|
}, Subcomponents);
|
|
61
61
|
Navbar.displayName = 'Navbar';
|
|
62
62
|
export default Navbar;
|
|
@@ -3,7 +3,7 @@ import { BoxProps } from '../internals/Box';
|
|
|
3
3
|
import type { PlacementCorners, WithAsProps } from '../internals/types';
|
|
4
4
|
import type { IconProps } from '@rsuite/icons/Icon';
|
|
5
5
|
export type NavbarDropdownTrigger = 'click' | 'hover' | 'contextMenu';
|
|
6
|
-
export interface NavbarDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'onToggle' | 'title'> {
|
|
6
|
+
export interface NavbarDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'onToggle' | 'title' | 'color'> {
|
|
7
7
|
/** Define the title as a submenu */
|
|
8
8
|
title?: React.ReactNode;
|
|
9
9
|
/** Set the icon */
|
|
@@ -65,15 +65,14 @@ const NavbarDropdown = forwardRef((props, ref) => {
|
|
|
65
65
|
open,
|
|
66
66
|
...props
|
|
67
67
|
}, containerRef) => {
|
|
68
|
-
const classes = merge(className, withPrefix(
|
|
69
|
-
disabled,
|
|
70
|
-
open
|
|
71
|
-
}));
|
|
68
|
+
const classes = merge(className, withPrefix());
|
|
72
69
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
73
70
|
as: as,
|
|
74
71
|
ref: mergeRefs(ref, containerRef),
|
|
75
72
|
className: classes,
|
|
76
73
|
style: style,
|
|
74
|
+
"data-open": open,
|
|
75
|
+
"data-disabled": disabled,
|
|
77
76
|
"data-placement": kebabPlace(placement)
|
|
78
77
|
}, props), /*#__PURE__*/React.createElement(Disclosure.Button, null, (buttonProps, buttonRef) => /*#__PURE__*/React.createElement(NavbarDropdownToggle, _extends({
|
|
79
78
|
ref: buttonRef,
|
|
@@ -69,13 +69,13 @@ const NavbarDropdownItem = forwardRef((props, ref) => {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
const classes = merge(className, withPrefix({
|
|
72
|
-
'with-icon': icon,
|
|
73
|
-
disabled,
|
|
74
72
|
divider,
|
|
75
|
-
panel
|
|
76
|
-
active: selected
|
|
73
|
+
panel
|
|
77
74
|
}));
|
|
78
75
|
const dataAttributes = {
|
|
76
|
+
'data-active': selected,
|
|
77
|
+
'data-with-icon': !!icon,
|
|
78
|
+
'data-disabled': disabled,
|
|
79
79
|
'data-event-key': eventKey
|
|
80
80
|
};
|
|
81
81
|
if (!isNil(eventKey) && typeof eventKey !== 'string') {
|
|
@@ -71,24 +71,21 @@ const NavbarDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
71
71
|
open,
|
|
72
72
|
...props
|
|
73
73
|
}, containerRef) => {
|
|
74
|
-
const classes = mergeItemClassNames(className, withItemClassPrefix(
|
|
75
|
-
disabled,
|
|
76
|
-
open,
|
|
77
|
-
submenu: true
|
|
78
|
-
}));
|
|
74
|
+
const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
|
|
79
75
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
80
76
|
ref: mergeRefs(ref, containerRef),
|
|
81
|
-
className: classes
|
|
77
|
+
className: classes,
|
|
78
|
+
"data-open": open,
|
|
79
|
+
"data-disabled": disabled
|
|
82
80
|
}, props), /*#__PURE__*/React.createElement(Disclosure.Button, null, ({
|
|
83
81
|
open,
|
|
84
82
|
...buttonProps
|
|
85
83
|
}, buttonRef) => {
|
|
86
|
-
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix(
|
|
87
|
-
'with-icon': icon,
|
|
88
|
-
open,
|
|
89
|
-
disabled
|
|
90
|
-
}));
|
|
84
|
+
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
|
|
91
85
|
const dataAttributes = {
|
|
86
|
+
'data-open': open,
|
|
87
|
+
'data-disabled': disabled,
|
|
88
|
+
'data-with-icon': !!icon,
|
|
92
89
|
'data-event-key': eventKey
|
|
93
90
|
};
|
|
94
91
|
if (!isNil(eventKey) && typeof eventKey !== 'string') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { SanitizedInputProps, FormControlBaseProps, AppearanceType, BasicSize } from '../internals/types';
|
|
4
|
-
export interface NumberInputProps<T = number | string | null> extends Omit<SanitizedInputProps, 'value' | 'defaultValue' | 'prefix'>, BoxProps, FormControlBaseProps<T> {
|
|
4
|
+
export interface NumberInputProps<T = number | string | null> extends Omit<SanitizedInputProps, 'value' | 'defaultValue' | 'prefix'>, Omit<BoxProps, 'height' | 'width'>, FormControlBaseProps<T> {
|
|
5
5
|
/**
|
|
6
6
|
* Button can have different appearances
|
|
7
7
|
*/
|
|
@@ -183,11 +183,12 @@ const Pagination = forwardRef((props, ref) => {
|
|
|
183
183
|
}, last === true ? icons.last : last)
|
|
184
184
|
});
|
|
185
185
|
};
|
|
186
|
-
const classes = merge(className, withPrefix(
|
|
186
|
+
const classes = merge(className, withPrefix());
|
|
187
187
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
188
188
|
as: as,
|
|
189
189
|
ref: ref,
|
|
190
|
-
className: classes
|
|
190
|
+
className: classes,
|
|
191
|
+
"data-size": size
|
|
191
192
|
}, rest), renderFirst(), renderPrev(), renderPageButtons(), renderNext(), renderLast());
|
|
192
193
|
});
|
|
193
194
|
Pagination.displayName = 'Pagination';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
export interface PaginationButtonProps<T = number | string> extends
|
|
2
|
+
import { ButtonProps } from '../Button';
|
|
3
|
+
export interface PaginationButtonProps<T = number | string> extends Omit<ButtonProps, 'onSelect'> {
|
|
4
4
|
/** The value of the current option */
|
|
5
5
|
eventKey: T;
|
|
6
6
|
/** A button can show it is currently unable to be interacted with */
|
|
@@ -18,5 +18,5 @@ export interface PaginationButtonProps<T = number | string> extends WithAsProps,
|
|
|
18
18
|
* PaginationButton component for pagination navigation.
|
|
19
19
|
* Renders a button that can be used in pagination contexts.
|
|
20
20
|
*/
|
|
21
|
-
declare const PaginationButton: import("../internals/types").InternalRefForwardingComponent<"button", PaginationButtonProps<string | number>, never> & Record<string, never>;
|
|
21
|
+
declare const PaginationButton: import("../internals/types").InternalRefForwardingComponent<import("../internals/types").InternalRefForwardingComponent<"button", ButtonProps, never> & Record<string, never>, PaginationButtonProps<string | number>, never> & Record<string, never>;
|
|
22
22
|
export default PaginationButton;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import React
|
|
3
|
+
import React from 'react';
|
|
4
4
|
import Button from "../Button/index.js";
|
|
5
5
|
import { useStyles, useEventCallback } from "../internals/hooks/index.js";
|
|
6
6
|
import { forwardRef } from "../internals/utils/index.js";
|
|
@@ -10,7 +10,7 @@ import { forwardRef } from "../internals/utils/index.js";
|
|
|
10
10
|
*/
|
|
11
11
|
const PaginationButton = forwardRef((props, ref) => {
|
|
12
12
|
const {
|
|
13
|
-
as
|
|
13
|
+
as,
|
|
14
14
|
active,
|
|
15
15
|
disabled,
|
|
16
16
|
className,
|
|
@@ -25,10 +25,7 @@ const PaginationButton = forwardRef((props, ref) => {
|
|
|
25
25
|
merge,
|
|
26
26
|
withPrefix
|
|
27
27
|
} = useStyles(classPrefix);
|
|
28
|
-
const classes = merge(className, withPrefix(
|
|
29
|
-
active,
|
|
30
|
-
disabled
|
|
31
|
-
}));
|
|
28
|
+
const classes = merge(className, withPrefix());
|
|
32
29
|
const handleClick = useEventCallback(event => {
|
|
33
30
|
if (disabled) {
|
|
34
31
|
return;
|
|
@@ -40,21 +37,17 @@ const PaginationButton = forwardRef((props, ref) => {
|
|
|
40
37
|
onSelect(eventKey, event);
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const asProps = useMemo(() => Component !== Button && typeof Component !== 'string' ? {
|
|
46
|
-
eventKey,
|
|
47
|
-
active,
|
|
48
|
-
role: 'button'
|
|
49
|
-
} : {}, [Component, eventKey, active]);
|
|
50
|
-
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, asProps, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
|
|
41
|
+
as: as,
|
|
51
42
|
disabled: disabled,
|
|
52
43
|
onClick: handleClick,
|
|
53
44
|
ref: ref,
|
|
54
45
|
className: classes,
|
|
55
|
-
|
|
46
|
+
appearance: "subtle",
|
|
56
47
|
"aria-disabled": disabled,
|
|
57
|
-
"aria-current": active ? 'page' : undefined
|
|
48
|
+
"aria-current": active ? 'page' : undefined,
|
|
49
|
+
active: active,
|
|
50
|
+
"data-event-key": eventKey
|
|
58
51
|
}), children);
|
|
59
52
|
});
|
|
60
53
|
PaginationButton.displayName = 'PaginationButton';
|
|
@@ -53,7 +53,7 @@ const PaginationGroup = forwardRef((props, ref) => {
|
|
|
53
53
|
const [limit, setLimit] = useControlled(limitProp, 30);
|
|
54
54
|
const [activePage, setActivePage] = useControlled(activePageProp, 1);
|
|
55
55
|
const pages = Math.floor(total / limit) + (total % limit ? 1 : 0);
|
|
56
|
-
const classes = merge(className, withPrefix(
|
|
56
|
+
const classes = merge(className, withPrefix());
|
|
57
57
|
const {
|
|
58
58
|
getLocale
|
|
59
59
|
} = useCustom();
|
|
@@ -78,6 +78,7 @@ const PaginationGroup = forwardRef((props, ref) => {
|
|
|
78
78
|
as: as,
|
|
79
79
|
ref: ref,
|
|
80
80
|
className: classes,
|
|
81
|
+
"data-size": size,
|
|
81
82
|
style: style
|
|
82
83
|
}, layout.map((key, index) => {
|
|
83
84
|
const onlyKey = `${key}${index}`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
|
-
export interface PanelHeaderProps extends BoxProps, React.HTMLAttributes<HTMLHeadingElement> {
|
|
3
|
+
export interface PanelHeaderProps extends BoxProps, Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'> {
|
|
4
4
|
caretAs?: React.ElementType;
|
|
5
5
|
collapsible?: boolean;
|
|
6
6
|
disabled?: boolean;
|
package/esm/Radio/Radio.js
CHANGED
|
@@ -51,11 +51,7 @@ const Radio = forwardRef((props, ref) => {
|
|
|
51
51
|
withPrefix,
|
|
52
52
|
prefix
|
|
53
53
|
} = useStyles(classPrefix);
|
|
54
|
-
const classes = merge(className, withPrefix(
|
|
55
|
-
inline,
|
|
56
|
-
disabled,
|
|
57
|
-
checked
|
|
58
|
-
}));
|
|
54
|
+
const classes = merge(className, withPrefix());
|
|
59
55
|
const [htmlInputProps, restProps] = partitionHTMLProps(rest);
|
|
60
56
|
const handleChange = useEventCallback(event => {
|
|
61
57
|
if (disabled || readOnly) {
|
|
@@ -100,7 +96,11 @@ const Radio = forwardRef((props, ref) => {
|
|
|
100
96
|
as: as,
|
|
101
97
|
ref: ref,
|
|
102
98
|
onClick: onClick,
|
|
103
|
-
className: classes
|
|
99
|
+
className: classes,
|
|
100
|
+
"data-color": color,
|
|
101
|
+
"data-checked": checked,
|
|
102
|
+
"data-disabled": disabled,
|
|
103
|
+
"data-inline": inline
|
|
104
104
|
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
105
105
|
className: prefix`checker`
|
|
106
106
|
}, children ? /*#__PURE__*/React.createElement("label", {
|
|
@@ -35,9 +35,7 @@ const RadioGroup = forwardRef((props, ref) => {
|
|
|
35
35
|
merge,
|
|
36
36
|
withPrefix
|
|
37
37
|
} = useStyles(classPrefix);
|
|
38
|
-
const classes = merge(className, withPrefix(
|
|
39
|
-
inline
|
|
40
|
-
}));
|
|
38
|
+
const classes = merge(className, withPrefix());
|
|
41
39
|
const [value, setValue, isControlled] = useControlled(valueProp, defaultValue);
|
|
42
40
|
const handleChange = useEventCallback((nextValue, event) => {
|
|
43
41
|
setValue(nextValue);
|
|
@@ -63,7 +61,9 @@ const RadioGroup = forwardRef((props, ref) => {
|
|
|
63
61
|
role: "radiogroup"
|
|
64
62
|
}, rest, {
|
|
65
63
|
ref: ref,
|
|
66
|
-
className: classes
|
|
64
|
+
className: classes,
|
|
65
|
+
"data-inline": inline,
|
|
66
|
+
"data-appearance": appearance
|
|
67
67
|
}), children));
|
|
68
68
|
});
|
|
69
69
|
RadioGroup.displayName = 'RadioGroup';
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { PlacementCorners } from '../internals/types';
|
|
4
4
|
import type { IconProps } from '@rsuite/icons/Icon';
|
|
5
|
-
export interface SidenavDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title'> {
|
|
5
|
+
export interface SidenavDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title' | 'color'> {
|
|
6
6
|
/** Define the title as a submenu */
|
|
7
7
|
title?: React.ReactNode;
|
|
8
8
|
/** Set the icon */
|
package/esm/Sidenav/Sidenav.js
CHANGED
|
@@ -48,7 +48,7 @@ const Sidenav = forwardRef((props, ref) => {
|
|
|
48
48
|
merge,
|
|
49
49
|
withPrefix
|
|
50
50
|
} = useStyles(classPrefix);
|
|
51
|
-
const classes = merge(className, withPrefix(
|
|
51
|
+
const classes = merge(className, withPrefix());
|
|
52
52
|
const handleOpenChange = useCallback((eventKey, event) => {
|
|
53
53
|
const find = key => shallowEqual(key, eventKey);
|
|
54
54
|
const nextOpenKeys = [...openKeys];
|
|
@@ -86,7 +86,8 @@ const Sidenav = forwardRef((props, ref) => {
|
|
|
86
86
|
as: as
|
|
87
87
|
}, rest, transitionRest, {
|
|
88
88
|
ref: mergeRefs(ref, transitionRef),
|
|
89
|
-
className: merge(classes, className)
|
|
89
|
+
className: merge(classes, className),
|
|
90
|
+
"data-appearance": appearance
|
|
90
91
|
}));
|
|
91
92
|
}));
|
|
92
93
|
}, Subcomponents);
|
|
@@ -146,16 +146,14 @@ const SidenavDropdown = forwardRef((props, ref) => {
|
|
|
146
146
|
open,
|
|
147
147
|
...menuContainer
|
|
148
148
|
}, menuContainerRef) => {
|
|
149
|
-
const classes = merge(className, withPrefix(
|
|
150
|
-
disabled,
|
|
151
|
-
open,
|
|
152
|
-
submenu: true
|
|
153
|
-
}));
|
|
149
|
+
const classes = merge(className, withPrefix('submenu'));
|
|
154
150
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
155
151
|
as: as,
|
|
156
152
|
ref: mergeRefs(ref, menuContainerRef),
|
|
157
153
|
className: classes,
|
|
158
154
|
style: style,
|
|
155
|
+
"data-open": open,
|
|
156
|
+
"data-disabled": disabled,
|
|
159
157
|
"data-placement": kebabPlace(placement),
|
|
160
158
|
"data-active-descendant": hasSelectedItems
|
|
161
159
|
}, menuContainer, pick(toggleProps, ['data-testid'])));
|
|
@@ -85,14 +85,14 @@ const SidenavDropdownItem = forwardRef((props, ref) => {
|
|
|
85
85
|
...menuitem
|
|
86
86
|
}, menuitemRef) => {
|
|
87
87
|
const classes = merge(className, withPrefix({
|
|
88
|
-
'with-icon': icon,
|
|
89
|
-
active: selected,
|
|
90
|
-
disabled,
|
|
91
|
-
focus: active,
|
|
92
88
|
divider,
|
|
93
89
|
panel
|
|
94
90
|
}));
|
|
95
91
|
const dataAttributes = {
|
|
92
|
+
'data-active': selected,
|
|
93
|
+
'data-disabled': disabled,
|
|
94
|
+
'data-focus': active,
|
|
95
|
+
'data-with-icon': !!icon,
|
|
96
96
|
'data-event-key': eventKey
|
|
97
97
|
};
|
|
98
98
|
if (!isNil(eventKey) && typeof eventKey !== 'string') {
|
|
@@ -82,16 +82,15 @@ const SidenavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
82
82
|
active,
|
|
83
83
|
...menuitem
|
|
84
84
|
}, menuitemRef) => {
|
|
85
|
-
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix(
|
|
86
|
-
'with-icon': icon,
|
|
87
|
-
open,
|
|
88
|
-
active: selected,
|
|
89
|
-
disabled,
|
|
90
|
-
focus: active
|
|
91
|
-
}));
|
|
85
|
+
const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
|
|
92
86
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
93
87
|
ref: mergeRefs(buttonRef, menuitemRef),
|
|
94
88
|
className: classes,
|
|
89
|
+
"data-open": open,
|
|
90
|
+
"data-disabled": disabled,
|
|
91
|
+
"data-active": selected,
|
|
92
|
+
"data-focus": active,
|
|
93
|
+
"data-with-icon": icon,
|
|
95
94
|
"data-event-key": eventKey,
|
|
96
95
|
"data-event-key-type": typeof eventKey
|
|
97
96
|
}, menuitem, omit(menuButtonProps, ['role'])), icon && /*#__PURE__*/React.cloneElement(icon, {
|
|
@@ -116,14 +115,12 @@ const SidenavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
116
115
|
open,
|
|
117
116
|
...menuContainer
|
|
118
117
|
}, menuContainerRef) => {
|
|
119
|
-
const classes = mergeItemClassNames(className, withItemClassPrefix(
|
|
120
|
-
disabled,
|
|
121
|
-
open,
|
|
122
|
-
submenu: true
|
|
123
|
-
}));
|
|
118
|
+
const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
|
|
124
119
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
125
120
|
ref: mergeRefs(ref, menuContainerRef),
|
|
126
|
-
className: classes
|
|
121
|
+
className: classes,
|
|
122
|
+
"data-open": open,
|
|
123
|
+
"data-disabled": disabled
|
|
127
124
|
}, menuContainer));
|
|
128
125
|
});
|
|
129
126
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseBoxProps } from '../internals/Box';
|
|
3
3
|
import type { HTMLPropsWithoutSelect } from '../internals/types';
|
|
4
4
|
import type { IconProps } from '@rsuite/icons/Icon';
|
|
5
5
|
/**
|
|
6
6
|
* Props of SidenavItem component
|
|
7
7
|
*/
|
|
8
|
-
export interface SidenavItemProps<T = any> extends
|
|
8
|
+
export interface SidenavItemProps<T = any> extends BaseBoxProps, HTMLPropsWithoutSelect {
|
|
9
9
|
/**
|
|
10
10
|
* Whether the item is activated
|
|
11
11
|
*/
|
|
@@ -86,11 +86,7 @@ const SidenavItem = forwardRef((props, ref) => {
|
|
|
86
86
|
active,
|
|
87
87
|
...menuitem
|
|
88
88
|
}, menuitemRef) => {
|
|
89
|
-
const classes = merge(className, withPrefix(
|
|
90
|
-
focus: active,
|
|
91
|
-
active: selected,
|
|
92
|
-
disabled
|
|
93
|
-
}));
|
|
89
|
+
const classes = merge(className, withPrefix());
|
|
94
90
|
|
|
95
91
|
// Show tooltip when inside a collapse <Sidenav>
|
|
96
92
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -98,6 +94,9 @@ const SidenavItem = forwardRef((props, ref) => {
|
|
|
98
94
|
ref: mergeRefs(mergeRefs(ref, menuitemRef), triggerRef),
|
|
99
95
|
disabled: as === SafeAnchor ? disabled : undefined,
|
|
100
96
|
className: classes,
|
|
97
|
+
"data-active": selected,
|
|
98
|
+
"data-disabled": disabled,
|
|
99
|
+
"data-focus": active,
|
|
101
100
|
"data-event-key": eventKey
|
|
102
101
|
}, omit(rest, ['divider', 'panel']), triggerProps, menuitem, {
|
|
103
102
|
onMouseOver: createChainedFunction(menuitem.onMouseOver, triggerProps.onMouseOver),
|
package/esm/Slider/Handle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
|
-
export interface HandleProps extends BoxProps, React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface HandleProps extends Omit<BoxProps, 'color' | 'position' | 'height' | 'width'>, React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
vertical?: boolean;
|
|
6
6
|
tooltip?: boolean;
|
package/esm/Stack/Stack.d.ts
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { WithResponsive } from '../internals/types';
|
|
4
|
-
interface
|
|
5
|
-
/**
|
|
6
|
-
* Define the alignment of the children in the stack on the inline axis
|
|
7
|
-
* @deprecated Use `justify` instead
|
|
8
|
-
*/
|
|
9
|
-
justifyContent?: CSSProperties['justifyContent'];
|
|
10
|
-
/**
|
|
11
|
-
* Define the alignment of the children in the stack on the cross axis
|
|
12
|
-
* @deprecated Use `align` instead
|
|
13
|
-
*/
|
|
14
|
-
alignItems?: CSSProperties['alignItems'];
|
|
15
|
-
}
|
|
16
|
-
export interface StackProps extends BoxProps, DeprecatedStackProps {
|
|
17
|
-
/** Define the alignment of the children in the stack on the cross axis */
|
|
18
|
-
align?: CSSProperties['alignItems'];
|
|
4
|
+
export interface StackProps extends BoxProps {
|
|
19
5
|
/** The direction of the children in the stack */
|
|
20
6
|
direction?: WithResponsive<CSSProperties['flexDirection']>;
|
|
21
|
-
/** Define the alignment of the children in the stack on the inline axis */
|
|
22
|
-
justify?: CSSProperties['justifyContent'];
|
|
23
7
|
/** Add an element between each child */
|
|
24
8
|
divider?: React.ReactNode;
|
|
25
9
|
/** Define whether the children in the stack are forced onto one line or can wrap onto multiple lines */
|
package/esm/Stack/Stack.js
CHANGED
|
@@ -34,15 +34,14 @@ const Stack = forwardRef((props, ref) => {
|
|
|
34
34
|
merge,
|
|
35
35
|
responsive
|
|
36
36
|
} = useStyles(classPrefix);
|
|
37
|
-
const baseClasses = merge(className, withPrefix(
|
|
38
|
-
wrap
|
|
39
|
-
}), ...responsive(direction));
|
|
37
|
+
const baseClasses = merge(className, withPrefix(), ...responsive(direction));
|
|
40
38
|
const filteredChildren = React.Children.toArray(children);
|
|
41
39
|
const childCount = filteredChildren.length;
|
|
42
40
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
43
41
|
as: as,
|
|
44
42
|
ref: ref,
|
|
45
|
-
className: baseClasses
|
|
43
|
+
className: baseClasses,
|
|
44
|
+
"data-wrap": wrap
|
|
46
45
|
}, rest), filteredChildren.map((child, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
47
46
|
key: index
|
|
48
47
|
}, child, index < childCount - 1 && divider)));
|
package/esm/Stack/StackItem.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
3
|
export interface StackItemProps extends BoxProps {
|
|
4
|
+
/**
|
|
5
|
+
* Define the alignment of the children in the stack on the cross axis
|
|
6
|
+
* @deprecated Use `self` instead
|
|
7
|
+
*/
|
|
4
8
|
alignSelf?: React.CSSProperties['alignSelf'];
|
|
5
|
-
flex?: React.CSSProperties['flex'];
|
|
6
|
-
grow?: React.CSSProperties['flexGrow'];
|
|
7
|
-
shrink?: React.CSSProperties['flexShrink'];
|
|
8
|
-
basis?: React.CSSProperties['flexBasis'];
|
|
9
|
-
order?: React.CSSProperties['order'];
|
|
10
9
|
}
|
|
11
10
|
/**
|
|
12
11
|
* The `Stack.Item` component is used to set the layout of the child element in the `Stack` component.
|
package/esm/Stack/StackItem.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import Box from "../internals/Box/index.js";
|
|
5
|
-
import { forwardRef
|
|
5
|
+
import { forwardRef } from "../internals/utils/index.js";
|
|
6
6
|
import { useStyles } from "../internals/hooks/index.js";
|
|
7
7
|
/**
|
|
8
8
|
* The `Stack.Item` component is used to set the layout of the child element in the `Stack` component.
|
|
@@ -13,28 +13,22 @@ const StackItem = forwardRef((props, ref) => {
|
|
|
13
13
|
const {
|
|
14
14
|
as,
|
|
15
15
|
classPrefix = 'stack-item',
|
|
16
|
-
style,
|
|
17
16
|
className,
|
|
18
17
|
alignSelf,
|
|
19
|
-
|
|
20
|
-
grow,
|
|
21
|
-
shrink,
|
|
22
|
-
order,
|
|
23
|
-
basis,
|
|
18
|
+
self = alignSelf,
|
|
24
19
|
...rest
|
|
25
20
|
} = props;
|
|
26
21
|
const {
|
|
27
22
|
withPrefix,
|
|
28
|
-
merge
|
|
29
|
-
cssVar
|
|
23
|
+
merge
|
|
30
24
|
} = useStyles(classPrefix);
|
|
31
25
|
const classes = merge(className, withPrefix());
|
|
32
|
-
const styles = mergeStyles(style, cssVar('align-self', alignSelf), cssVar('order', order), cssVar('flex', flex), cssVar('grow', grow), cssVar('shrink', shrink), cssVar('basis', basis));
|
|
33
26
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
34
27
|
as: as,
|
|
35
28
|
ref: ref,
|
|
36
29
|
className: classes,
|
|
37
|
-
|
|
30
|
+
self: self,
|
|
31
|
+
paddingTop: 0
|
|
38
32
|
}, rest));
|
|
39
33
|
});
|
|
40
34
|
StackItem.displayName = 'StackItem';
|