rsuite 6.0.0-canary-20250622 → 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/AutoComplete/AutoComplete.d.ts +1 -1
- package/cjs/AutoComplete/AutoComplete.js +1 -0
- 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/FormStack/FormStack.d.ts +0 -5
- package/cjs/FormStack/FormStack.js +1 -6
- 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/Progress/index.d.ts +1 -2
- package/cjs/Progress/index.js +0 -2
- 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 +3 -21
- package/cjs/Stack/Stack.js +3 -28
- 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 +4 -38
- package/cjs/internals/Box/Box.js +3 -3
- package/cjs/internals/Box/index.d.ts +1 -1
- package/cjs/internals/Box/utils.d.ts +0 -9
- package/cjs/internals/Box/utils.js +22 -226
- 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 +5 -0
- package/cjs/internals/styled-system/index.js +34 -0
- package/cjs/internals/styled-system/responsive.d.ts +26 -0
- package/cjs/internals/styled-system/responsive.js +118 -0
- package/cjs/internals/styled-system/types.d.ts +208 -0
- package/cjs/internals/styled-system/types.js +4 -0
- package/cjs/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
- package/cjs/internals/{hooks → styled-system}/useStyled.js +24 -84
- package/cjs/internals/types/html.d.ts +6 -6
- package/cjs/internals/types/picker.d.ts +2 -2
- package/cjs/internals/types/sizes.d.ts +2 -1
- package/cjs/internals/utils/colours.d.ts +1 -1
- package/cjs/internals/utils/colours.js +4 -4
- package/cjs/internals/utils/sizes.d.ts +1 -0
- package/cjs/internals/utils/sizes.js +8 -1
- package/cjs/internals/utils/style-sheet/css.d.ts +6 -0
- package/cjs/internals/utils/style-sheet/css.js +35 -0
- package/cjs/internals/utils/style-sheet/index.d.ts +0 -1
- package/cjs/internals/utils/style-sheet/index.js +0 -6
- package/cjs/internals/utils/style-sheet/responsive.d.ts +15 -0
- package/cjs/internals/utils/style-sheet/responsive.js +19 -0
- package/cjs/useMediaQuery/breakpoints.d.ts +6 -6
- package/cjs/useMediaQuery/breakpoints.js +27 -31
- package/cjs/useMediaQuery/types.d.ts +2 -2
- package/cjs/useMediaQuery/useMediaQuery.js +3 -13
- package/dist/rsuite-no-reset.css +641 -655
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite.css +641 -655
- package/dist/rsuite.js +128 -95
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/AutoComplete/AutoComplete.d.ts +1 -1
- package/esm/AutoComplete/AutoComplete.js +1 -0
- 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/FormStack/FormStack.d.ts +0 -5
- package/esm/FormStack/FormStack.js +2 -7
- 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/Progress/index.d.ts +1 -2
- package/esm/Progress/index.js +1 -2
- 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 +3 -21
- package/esm/Stack/Stack.js +3 -28
- 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 +4 -38
- package/esm/internals/Box/Box.js +3 -3
- package/esm/internals/Box/index.d.ts +1 -1
- package/esm/internals/Box/utils.d.ts +0 -9
- package/esm/internals/Box/utils.js +20 -224
- 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 +5 -0
- package/esm/internals/styled-system/index.js +6 -0
- package/esm/internals/styled-system/responsive.d.ts +26 -0
- package/esm/internals/styled-system/responsive.js +110 -0
- package/esm/internals/styled-system/types.d.ts +208 -0
- package/esm/internals/styled-system/types.js +2 -0
- package/esm/internals/{hooks → styled-system}/useStyled.d.ts +2 -6
- package/esm/internals/{hooks → styled-system}/useStyled.js +20 -79
- package/esm/internals/types/html.d.ts +6 -6
- package/esm/internals/types/picker.d.ts +2 -2
- package/esm/internals/types/sizes.d.ts +2 -1
- package/esm/internals/utils/colours.d.ts +1 -1
- package/esm/internals/utils/colours.js +2 -2
- package/esm/internals/utils/sizes.d.ts +1 -0
- package/esm/internals/utils/sizes.js +6 -0
- package/esm/internals/utils/style-sheet/css.d.ts +6 -0
- package/esm/internals/utils/style-sheet/css.js +34 -0
- package/esm/internals/utils/style-sheet/index.d.ts +0 -1
- package/esm/internals/utils/style-sheet/index.js +1 -2
- package/esm/internals/utils/style-sheet/responsive.d.ts +15 -0
- package/esm/internals/utils/style-sheet/responsive.js +19 -0
- package/esm/useMediaQuery/breakpoints.d.ts +6 -6
- package/esm/useMediaQuery/breakpoints.js +27 -31
- package/esm/useMediaQuery/types.d.ts +2 -2
- package/esm/useMediaQuery/useMediaQuery.js +2 -12
- package/package.json +1 -1
- /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
- /package/cjs/internals/{utils/style-sheet → styled-system}/style-manager.js +0 -0
- /package/esm/internals/{utils/style-sheet → styled-system}/style-manager.d.ts +0 -0
- /package/esm/internals/{utils/style-sheet → styled-system}/style-manager.js +0 -0
package/esm/Stack/Stack.d.ts
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
|
-
import type {
|
|
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'];
|
|
3
|
+
import type { WithResponsive } from '../internals/types';
|
|
4
|
+
export interface StackProps extends BoxProps {
|
|
19
5
|
/** The direction of the children in the stack */
|
|
20
|
-
direction?:
|
|
21
|
-
/** Define the alignment of the children in the stack on the inline axis */
|
|
22
|
-
justify?: CSSProperties['justifyContent'];
|
|
23
|
-
/** Define the spacing between immediate children */
|
|
24
|
-
spacing?: number | string | (number | string)[];
|
|
6
|
+
direction?: WithResponsive<CSSProperties['flexDirection']>;
|
|
25
7
|
/** Add an element between each child */
|
|
26
8
|
divider?: React.ReactNode;
|
|
27
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
|
@@ -3,10 +3,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import StackItem from "./StackItem.js";
|
|
5
5
|
import Box from "../internals/Box/index.js";
|
|
6
|
-
import { useStyled } from "../internals/hooks/useStyled.js";
|
|
7
6
|
import { forwardRef } from "../internals/utils/index.js";
|
|
8
7
|
import { useStyles, useCustom } from "../internals/hooks/index.js";
|
|
9
|
-
import { generateStackCssVars } from "./utils.js";
|
|
10
8
|
const Subcomponents = {
|
|
11
9
|
Item: StackItem
|
|
12
10
|
};
|
|
@@ -23,17 +21,11 @@ const Stack = forwardRef((props, ref) => {
|
|
|
23
21
|
} = useCustom('Stack', props);
|
|
24
22
|
const {
|
|
25
23
|
as,
|
|
26
|
-
alignItems,
|
|
27
|
-
align = alignItems,
|
|
28
24
|
classPrefix = 'stack',
|
|
29
25
|
className,
|
|
30
26
|
children,
|
|
31
27
|
direction,
|
|
32
|
-
justifyContent,
|
|
33
|
-
justify = justifyContent,
|
|
34
|
-
spacing,
|
|
35
28
|
divider,
|
|
36
|
-
style,
|
|
37
29
|
wrap,
|
|
38
30
|
...rest
|
|
39
31
|
} = propsWithDefaults;
|
|
@@ -42,31 +34,14 @@ const Stack = forwardRef((props, ref) => {
|
|
|
42
34
|
merge,
|
|
43
35
|
responsive
|
|
44
36
|
} = useStyles(classPrefix);
|
|
45
|
-
const baseClasses = merge(className, withPrefix(
|
|
46
|
-
wrap
|
|
47
|
-
}), ...responsive(direction));
|
|
48
|
-
|
|
49
|
-
// Generate CSS variables for Stack
|
|
50
|
-
const cssVars = generateStackCssVars({
|
|
51
|
-
spacing,
|
|
52
|
-
align,
|
|
53
|
-
justify
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// Use the useStyled hook to manage CSS variables
|
|
57
|
-
const styled = useStyled({
|
|
58
|
-
cssVars,
|
|
59
|
-
className: baseClasses,
|
|
60
|
-
style,
|
|
61
|
-
prefix: classPrefix
|
|
62
|
-
});
|
|
37
|
+
const baseClasses = merge(className, withPrefix(), ...responsive(direction));
|
|
63
38
|
const filteredChildren = React.Children.toArray(children);
|
|
64
39
|
const childCount = filteredChildren.length;
|
|
65
40
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
66
41
|
as: as,
|
|
67
42
|
ref: ref,
|
|
68
|
-
className:
|
|
69
|
-
|
|
43
|
+
className: baseClasses,
|
|
44
|
+
"data-wrap": wrap
|
|
70
45
|
}, rest), filteredChildren.map((child, index) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
71
46
|
key: index
|
|
72
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';
|
package/esm/Steps/StepItem.js
CHANGED
|
@@ -36,10 +36,7 @@ const StepItem = forwardRef((props, ref) => {
|
|
|
36
36
|
withPrefix,
|
|
37
37
|
prefix
|
|
38
38
|
} = useStyles(classPrefix);
|
|
39
|
-
const classes = merge(className, withPrefix(
|
|
40
|
-
custom: icon,
|
|
41
|
-
[`status-${status}`]: status
|
|
42
|
-
}));
|
|
39
|
+
const classes = merge(className, withPrefix());
|
|
43
40
|
const iconNode = icon ? /*#__PURE__*/React.createElement("span", {
|
|
44
41
|
className: prefix('icon')
|
|
45
42
|
}, icon) : /*#__PURE__*/React.createElement("span", {
|
|
@@ -47,16 +44,18 @@ const StepItem = forwardRef((props, ref) => {
|
|
|
47
44
|
[`icon-${status}`]: status
|
|
48
45
|
})
|
|
49
46
|
}, status ? (_STEP_STATUS_ICON$sta = STEP_STATUS_ICON[status]) !== null && _STEP_STATUS_ICON$sta !== void 0 ? _STEP_STATUS_ICON$sta : stepNumber : stepNumber);
|
|
50
|
-
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
47
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
51
48
|
ref: ref,
|
|
52
49
|
className: classes,
|
|
53
50
|
style: mergeStyles({
|
|
54
51
|
width: itemWidth
|
|
55
|
-
}, style)
|
|
56
|
-
|
|
52
|
+
}, style),
|
|
53
|
+
"data-status": status,
|
|
54
|
+
"data-custom-icon": !!icon
|
|
55
|
+
}, rest), /*#__PURE__*/React.createElement("div", {
|
|
57
56
|
className: prefix('tail')
|
|
58
57
|
}), /*#__PURE__*/React.createElement("div", {
|
|
59
|
-
className: prefix(
|
|
58
|
+
className: prefix('icon-wrapper')
|
|
60
59
|
}, iconNode), /*#__PURE__*/React.createElement("div", {
|
|
61
60
|
className: prefix('content')
|
|
62
61
|
}, /*#__PURE__*/React.createElement("div", {
|
package/esm/Steps/Steps.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { StepItemProps } from './StepItem';
|
|
2
3
|
import { BoxProps } from '../internals/Box';
|
|
3
4
|
export interface StepsProps extends BoxProps {
|
|
4
5
|
/** Vertical display */
|
|
@@ -18,6 +19,6 @@ export interface StepsProps extends BoxProps {
|
|
|
18
19
|
* @see https://rsuitejs.com/components/steps
|
|
19
20
|
*/
|
|
20
21
|
declare const Steps: import("../internals/types").InternalRefForwardingComponent<"div", StepsProps, never> & {
|
|
21
|
-
Item: import("../internals/types").InternalRefForwardingComponent<"div",
|
|
22
|
+
Item: import("../internals/types").InternalRefForwardingComponent<"div", StepItemProps, never> & Record<string, never>;
|
|
22
23
|
};
|
|
23
24
|
export default Steps;
|
package/esm/Steps/Steps.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
4
|
import StepItem from "./StepItem.js";
|
|
5
5
|
import Box from "../internals/Box/index.js";
|
|
6
6
|
import { forwardRef, rch } from "../internals/utils/index.js";
|
|
@@ -31,46 +31,43 @@ const Steps = forwardRef((props, ref) => {
|
|
|
31
31
|
} = propsWithDefaults;
|
|
32
32
|
const {
|
|
33
33
|
merge,
|
|
34
|
-
prefix,
|
|
35
34
|
withPrefix
|
|
36
35
|
} = useStyles(classPrefix);
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
status: 'wait',
|
|
52
|
-
style: horizontal ? itemStyles : undefined,
|
|
53
|
-
...item.props
|
|
54
|
-
};
|
|
36
|
+
const classes = merge(className, withPrefix());
|
|
37
|
+
const items = useMemo(() => {
|
|
38
|
+
const count = rch.count(children);
|
|
39
|
+
return rch.mapCloneElement(children, (item, index) => {
|
|
40
|
+
const itemStyles = {
|
|
41
|
+
flexBasis: index < count - 1 ? `${100 / (count - 1)}%` : undefined,
|
|
42
|
+
maxWidth: index === count - 1 ? `${100 / count}%` : undefined
|
|
43
|
+
};
|
|
44
|
+
const itemProps = {
|
|
45
|
+
stepNumber: index + 1,
|
|
46
|
+
status: 'wait',
|
|
47
|
+
style: !vertical ? itemStyles : undefined,
|
|
48
|
+
...item.props
|
|
49
|
+
};
|
|
55
50
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
// fix tail color
|
|
52
|
+
if (currentStatus === 'error' && index === current - 1) {
|
|
53
|
+
itemProps['data-next-error'] = true;
|
|
54
|
+
}
|
|
55
|
+
if (!item.props.status) {
|
|
56
|
+
if (index === current) {
|
|
57
|
+
itemProps.status = currentStatus;
|
|
58
|
+
} else if (index < current) {
|
|
59
|
+
itemProps.status = 'finish';
|
|
60
|
+
}
|
|
66
61
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
62
|
+
return itemProps;
|
|
63
|
+
});
|
|
64
|
+
}, [children, current, currentStatus, vertical]);
|
|
70
65
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
71
66
|
as: as,
|
|
72
67
|
ref: ref,
|
|
73
|
-
className: classes
|
|
68
|
+
className: classes,
|
|
69
|
+
"data-size": small ? 'small' : undefined,
|
|
70
|
+
"data-direction": vertical ? 'vertical' : 'horizontal'
|
|
74
71
|
}, rest), items);
|
|
75
72
|
}, Subcomponents);
|
|
76
73
|
Steps.displayName = 'Steps';
|
package/esm/Tabs/Tabs.js
CHANGED
|
@@ -18,7 +18,7 @@ function getFocusableTabs(tablist) {
|
|
|
18
18
|
}
|
|
19
19
|
function getFocusedTab(tablist) {
|
|
20
20
|
const tabs = getFocusableTabs(tablist);
|
|
21
|
-
return tabs.find(tab => tab.getAttribute('aria-selected'));
|
|
21
|
+
return tabs.find(tab => tab.getAttribute('aria-selected') === 'true');
|
|
22
22
|
}
|
|
23
23
|
function nextItem(tablist) {
|
|
24
24
|
if (!tablist) {
|
package/esm/Tag/Tag.js
CHANGED
|
@@ -37,14 +37,17 @@ const Tag = forwardRef((props, ref) => {
|
|
|
37
37
|
prefix,
|
|
38
38
|
merge
|
|
39
39
|
} = useStyles(classPrefix);
|
|
40
|
-
const classes = merge(className, withPrefix(
|
|
40
|
+
const classes = merge(className, withPrefix());
|
|
41
41
|
const styles = useMemo(() => mergeStyles(style, createColorVariables(color, '--rs-tag-bg', '--rs-tag-text')), [style, color]);
|
|
42
42
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
43
43
|
as: as,
|
|
44
44
|
ref: ref,
|
|
45
45
|
className: classes,
|
|
46
46
|
style: styles
|
|
47
|
-
}, rest
|
|
47
|
+
}, rest, {
|
|
48
|
+
"data-size": size,
|
|
49
|
+
"data-color": isPresetColor(color) ? color : undefined
|
|
50
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
48
51
|
className: prefix`text`
|
|
49
52
|
}, children), closable && /*#__PURE__*/React.createElement(CloseButton, {
|
|
50
53
|
className: prefix`icon-close`,
|
package/esm/Toggle/Toggle.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BoxProps } from '../internals/Box';
|
|
3
3
|
import type { SanitizedInputProps, Color, Size } from '../internals/types';
|
|
4
4
|
import type { ToggleLocale } from '../locales';
|
|
5
|
-
export interface ToggleProps extends BoxProps, SanitizedInputProps {
|
|
5
|
+
export interface ToggleProps extends Omit<BoxProps, 'height' | 'width'>, SanitizedInputProps {
|
|
6
6
|
/**
|
|
7
7
|
* The color of the toggle.
|
|
8
8
|
*/
|
package/esm/Toggle/Toggle.js
CHANGED
|
@@ -43,11 +43,7 @@ const Toggle = forwardRef((props, ref) => {
|
|
|
43
43
|
withPrefix,
|
|
44
44
|
prefix
|
|
45
45
|
} = useStyles(classPrefix);
|
|
46
|
-
const classes = merge(className, withPrefix(
|
|
47
|
-
checked,
|
|
48
|
-
disabled,
|
|
49
|
-
loading
|
|
50
|
-
}));
|
|
46
|
+
const classes = merge(className, withPrefix({}));
|
|
51
47
|
const inner = checked ? checkedChildren : unCheckedChildren;
|
|
52
48
|
const innerLabel = checked ? locale === null || locale === void 0 ? void 0 : locale.on : locale === null || locale === void 0 ? void 0 : locale.off;
|
|
53
49
|
const labelId = useUniqueId('rs-label');
|
|
@@ -71,7 +67,12 @@ const Toggle = forwardRef((props, ref) => {
|
|
|
71
67
|
as: as,
|
|
72
68
|
ref: ref,
|
|
73
69
|
className: classes,
|
|
74
|
-
"data-placement": labelPlacement
|
|
70
|
+
"data-placement": labelPlacement,
|
|
71
|
+
"data-color": color,
|
|
72
|
+
"data-size": size,
|
|
73
|
+
"data-checked": checked,
|
|
74
|
+
"data-loading": loading,
|
|
75
|
+
"data-disabled": disabled
|
|
75
76
|
}, restProps), /*#__PURE__*/React.createElement("input", _extends({}, htmlInputProps, {
|
|
76
77
|
ref: inputRef,
|
|
77
78
|
type: "checkbox",
|
package/esm/Tree/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { BaseBoxProps } from '../internals/Box';
|
|
3
3
|
import type { ListProps } from '../internals/Windowing';
|
|
4
4
|
import type { TreeNode } from '../internals/Tree/types';
|
|
5
5
|
/**
|
|
@@ -80,7 +80,7 @@ export type WithTreeDragProps<P> = P & TreeDragProps;
|
|
|
80
80
|
/**
|
|
81
81
|
* Represents the props for the Tree component.
|
|
82
82
|
*/
|
|
83
|
-
export interface TreeViewBaseProps<V = string | number, T = TreeNode> extends
|
|
83
|
+
export interface TreeViewBaseProps<V = string | number, T = TreeNode> extends BaseBoxProps {
|
|
84
84
|
/**
|
|
85
85
|
* The height of the tree.
|
|
86
86
|
*/
|
|
@@ -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 { BaseBoxProps } 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 BaseBoxProps, Omit<UploadTriggerProps, 'onChange' | 'onError' | 'onProgress'> {
|
|
25
25
|
/**
|
|
26
26
|
* Custom ref for Uploader
|
|
27
27
|
*/
|
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { WithAsProps, Breakpoints
|
|
3
|
-
export interface BoxProps extends WithAsProps {
|
|
1
|
+
import { CSSSystemProps } from '../styled-system';
|
|
2
|
+
import type { WithAsProps, Breakpoints } from '../types';
|
|
3
|
+
export interface BoxProps extends WithAsProps, CSSSystemProps {
|
|
4
4
|
/** Breakpoint below which the component is shown with `display: block` */
|
|
5
5
|
showFrom?: Breakpoints;
|
|
6
6
|
/** Breakpoint above which the component is hidden with `display: none` */
|
|
7
7
|
hideFrom?: Breakpoints;
|
|
8
|
-
/** Display property */
|
|
9
|
-
display?: CSS['display'] | ResponsiveValue<CSS['display']>;
|
|
10
|
-
/** Padding */
|
|
11
|
-
p?: CSS['padding'] | ResponsiveValue<CSS['padding']>;
|
|
12
|
-
pt?: CSS['paddingTop'] | ResponsiveValue<CSS['paddingTop']>;
|
|
13
|
-
pb?: CSS['paddingBottom'] | ResponsiveValue<CSS['paddingBottom']>;
|
|
14
|
-
pl?: CSS['paddingLeft'] | ResponsiveValue<CSS['paddingLeft']>;
|
|
15
|
-
pr?: CSS['paddingRight'] | ResponsiveValue<CSS['paddingRight']>;
|
|
16
|
-
px?: CSS['paddingInline'] | ResponsiveValue<CSS['paddingInline']>;
|
|
17
|
-
py?: CSS['paddingBlock'] | ResponsiveValue<CSS['paddingBlock']>;
|
|
18
|
-
/** Margin */
|
|
19
|
-
m?: CSS['margin'] | ResponsiveValue<CSS['margin']>;
|
|
20
|
-
mt?: CSS['marginTop'] | ResponsiveValue<CSS['marginTop']>;
|
|
21
|
-
mb?: CSS['marginBottom'] | ResponsiveValue<CSS['marginBottom']>;
|
|
22
|
-
ml?: CSS['marginLeft'] | ResponsiveValue<CSS['marginLeft']>;
|
|
23
|
-
mr?: CSS['marginRight'] | ResponsiveValue<CSS['marginRight']>;
|
|
24
|
-
mx?: CSS['marginInline'] | ResponsiveValue<CSS['marginInline']>;
|
|
25
|
-
my?: CSS['marginBlock'] | ResponsiveValue<CSS['marginBlock']>;
|
|
26
|
-
/** Box size */
|
|
27
|
-
w?: CSS['width'] | ResponsiveValue<CSS['width']>;
|
|
28
|
-
h?: CSS['height'] | ResponsiveValue<CSS['height']>;
|
|
29
|
-
minw?: CSS['minWidth'] | ResponsiveValue<CSS['minWidth']>;
|
|
30
|
-
maxw?: CSS['maxWidth'] | ResponsiveValue<CSS['maxWidth']>;
|
|
31
|
-
minh?: CSS['minHeight'] | ResponsiveValue<CSS['minHeight']>;
|
|
32
|
-
maxh?: CSS['maxHeight'] | ResponsiveValue<CSS['maxHeight']>;
|
|
33
|
-
/** Box Color */
|
|
34
|
-
c?: ColorScheme | CSS['color'] | ResponsiveValue<ColorScheme | CSS['color']>;
|
|
35
|
-
/** Box Border */
|
|
36
|
-
bd?: CSS['border'] | ResponsiveValue<CSS['border']>;
|
|
37
|
-
/** Box Background */
|
|
38
|
-
bg?: ColorScheme | CSS['backgroundColor'] | ResponsiveValue<ColorScheme | CSS['backgroundColor']>;
|
|
39
|
-
/** Box Border Radius */
|
|
40
|
-
rounded?: Size | CSS['borderRadius'] | 'full' | ResponsiveValue<Size | CSS['borderRadius'] | 'full'>;
|
|
41
|
-
/** Box Shadow */
|
|
42
|
-
shadow?: Size | CSS['boxShadow'] | ResponsiveValue<Size | CSS['boxShadow']>;
|
|
43
8
|
}
|
|
9
|
+
export type BaseBoxProps = Omit<BoxProps, 'color'>;
|
|
44
10
|
/**
|
|
45
11
|
* Box component is the base component for all components,
|
|
46
12
|
* providing shorthand for style properties.
|
package/esm/internals/Box/Box.js
CHANGED
|
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
import { forwardRef } from "../utils/react/forwardRef.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useStyled } from "../
|
|
6
|
+
import { extractBoxProps, omitBoxProps } from "./utils.js";
|
|
7
|
+
import { useStyled, getCSSVariables } from "../styled-system/index.js";
|
|
8
8
|
/**
|
|
9
9
|
* Box component is the base component for all components,
|
|
10
10
|
* providing shorthand for style properties.
|
|
@@ -23,7 +23,7 @@ const Box = forwardRef((props, ref) => {
|
|
|
23
23
|
} = props;
|
|
24
24
|
const boxProps = extractBoxProps(rest);
|
|
25
25
|
const domProps = omitBoxProps(rest);
|
|
26
|
-
const boxCSSVars =
|
|
26
|
+
const boxCSSVars = getCSSVariables(boxProps, '--rs-box-');
|
|
27
27
|
const isBox = !isEmpty(boxCSSVars) || showFrom || hideFrom;
|
|
28
28
|
const styled = useStyled({
|
|
29
29
|
cssVars: boxCSSVars,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ResponsiveValue } from '../types';
|
|
2
1
|
/**
|
|
3
2
|
* Extract box properties from props
|
|
4
3
|
* @param props Original props object
|
|
@@ -11,11 +10,3 @@ export declare const extractBoxProps: (props: Record<string, any>) => Record<str
|
|
|
11
10
|
* @returns New object without layout properties
|
|
12
11
|
*/
|
|
13
12
|
export declare const omitBoxProps: (props: Record<string, any>) => Record<string, any>;
|
|
14
|
-
type CSSVarValue = string | number | undefined | ResponsiveValue<string | number>;
|
|
15
|
-
/**
|
|
16
|
-
* Converts layout properties to CSS variables with abbreviated names
|
|
17
|
-
* @param props Object containing layout properties
|
|
18
|
-
* @returns Object with CSS variables
|
|
19
|
-
*/
|
|
20
|
-
export declare const getBoxCSSVariables: (props: Record<string, any>) => Record<string, CSSVarValue>;
|
|
21
|
-
export {};
|