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/cjs/Stack/StackItem.js
CHANGED
|
@@ -18,28 +18,22 @@ const StackItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
18
18
|
const {
|
|
19
19
|
as,
|
|
20
20
|
classPrefix = 'stack-item',
|
|
21
|
-
style,
|
|
22
21
|
className,
|
|
23
22
|
alignSelf,
|
|
24
|
-
|
|
25
|
-
grow,
|
|
26
|
-
shrink,
|
|
27
|
-
order,
|
|
28
|
-
basis,
|
|
23
|
+
self = alignSelf,
|
|
29
24
|
...rest
|
|
30
25
|
} = props;
|
|
31
26
|
const {
|
|
32
27
|
withPrefix,
|
|
33
|
-
merge
|
|
34
|
-
cssVar
|
|
28
|
+
merge
|
|
35
29
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
36
30
|
const classes = merge(className, withPrefix());
|
|
37
|
-
const styles = (0, _utils.mergeStyles)(style, cssVar('align-self', alignSelf), cssVar('order', order), cssVar('flex', flex), cssVar('grow', grow), cssVar('shrink', shrink), cssVar('basis', basis));
|
|
38
31
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
39
32
|
as: as,
|
|
40
33
|
ref: ref,
|
|
41
34
|
className: classes,
|
|
42
|
-
|
|
35
|
+
self: self,
|
|
36
|
+
paddingTop: 0
|
|
43
37
|
}, rest));
|
|
44
38
|
});
|
|
45
39
|
StackItem.displayName = 'StackItem';
|
package/cjs/Steps/StepItem.js
CHANGED
|
@@ -41,10 +41,7 @@ const StepItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
41
41
|
withPrefix,
|
|
42
42
|
prefix
|
|
43
43
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
44
|
-
const classes = merge(className, withPrefix(
|
|
45
|
-
custom: icon,
|
|
46
|
-
[`status-${status}`]: status
|
|
47
|
-
}));
|
|
44
|
+
const classes = merge(className, withPrefix());
|
|
48
45
|
const iconNode = icon ? /*#__PURE__*/_react.default.createElement("span", {
|
|
49
46
|
className: prefix('icon')
|
|
50
47
|
}, icon) : /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -52,16 +49,18 @@ const StepItem = (0, _utils.forwardRef)((props, ref) => {
|
|
|
52
49
|
[`icon-${status}`]: status
|
|
53
50
|
})
|
|
54
51
|
}, status ? (_STEP_STATUS_ICON$sta = STEP_STATUS_ICON[status]) !== null && _STEP_STATUS_ICON$sta !== void 0 ? _STEP_STATUS_ICON$sta : stepNumber : stepNumber);
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
|
|
56
53
|
ref: ref,
|
|
57
54
|
className: classes,
|
|
58
55
|
style: (0, _utils.mergeStyles)({
|
|
59
56
|
width: itemWidth
|
|
60
|
-
}, style)
|
|
61
|
-
|
|
57
|
+
}, style),
|
|
58
|
+
"data-status": status,
|
|
59
|
+
"data-custom-icon": !!icon
|
|
60
|
+
}, rest), /*#__PURE__*/_react.default.createElement("div", {
|
|
62
61
|
className: prefix('tail')
|
|
63
62
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className: prefix(
|
|
63
|
+
className: prefix('icon-wrapper')
|
|
65
64
|
}, iconNode), /*#__PURE__*/_react.default.createElement("div", {
|
|
66
65
|
className: prefix('content')
|
|
67
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
package/cjs/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/cjs/Steps/Steps.js
CHANGED
|
@@ -5,11 +5,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _StepItem = _interopRequireDefault(require("./StepItem"));
|
|
10
10
|
var _Box = _interopRequireDefault(require("../internals/Box"));
|
|
11
11
|
var _utils = require("../internals/utils");
|
|
12
12
|
var _hooks = require("../internals/hooks");
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
14
|
const Subcomponents = {
|
|
14
15
|
Item: _StepItem.default
|
|
15
16
|
};
|
|
@@ -36,46 +37,43 @@ const Steps = (0, _utils.forwardRef)((props, ref) => {
|
|
|
36
37
|
} = propsWithDefaults;
|
|
37
38
|
const {
|
|
38
39
|
merge,
|
|
39
|
-
prefix,
|
|
40
40
|
withPrefix
|
|
41
41
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
status: 'wait',
|
|
57
|
-
style: horizontal ? itemStyles : undefined,
|
|
58
|
-
...item.props
|
|
59
|
-
};
|
|
42
|
+
const classes = merge(className, withPrefix());
|
|
43
|
+
const items = (0, _react.useMemo)(() => {
|
|
44
|
+
const count = _utils.rch.count(children);
|
|
45
|
+
return _utils.rch.mapCloneElement(children, (item, index) => {
|
|
46
|
+
const itemStyles = {
|
|
47
|
+
flexBasis: index < count - 1 ? `${100 / (count - 1)}%` : undefined,
|
|
48
|
+
maxWidth: index === count - 1 ? `${100 / count}%` : undefined
|
|
49
|
+
};
|
|
50
|
+
const itemProps = {
|
|
51
|
+
stepNumber: index + 1,
|
|
52
|
+
status: 'wait',
|
|
53
|
+
style: !vertical ? itemStyles : undefined,
|
|
54
|
+
...item.props
|
|
55
|
+
};
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
// fix tail color
|
|
58
|
+
if (currentStatus === 'error' && index === current - 1) {
|
|
59
|
+
itemProps['data-next-error'] = true;
|
|
60
|
+
}
|
|
61
|
+
if (!item.props.status) {
|
|
62
|
+
if (index === current) {
|
|
63
|
+
itemProps.status = currentStatus;
|
|
64
|
+
} else if (index < current) {
|
|
65
|
+
itemProps.status = 'finish';
|
|
66
|
+
}
|
|
71
67
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
68
|
+
return itemProps;
|
|
69
|
+
});
|
|
70
|
+
}, [children, current, currentStatus, vertical]);
|
|
75
71
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
76
72
|
as: as,
|
|
77
73
|
ref: ref,
|
|
78
|
-
className: classes
|
|
74
|
+
className: classes,
|
|
75
|
+
"data-size": small ? 'small' : undefined,
|
|
76
|
+
"data-direction": vertical ? 'vertical' : 'horizontal'
|
|
79
77
|
}, rest), items);
|
|
80
78
|
}, Subcomponents);
|
|
81
79
|
Steps.displayName = 'Steps';
|
package/cjs/Tabs/Tabs.js
CHANGED
|
@@ -22,7 +22,7 @@ function getFocusableTabs(tablist) {
|
|
|
22
22
|
}
|
|
23
23
|
function getFocusedTab(tablist) {
|
|
24
24
|
const tabs = getFocusableTabs(tablist);
|
|
25
|
-
return tabs.find(tab => tab.getAttribute('aria-selected'));
|
|
25
|
+
return tabs.find(tab => tab.getAttribute('aria-selected') === 'true');
|
|
26
26
|
}
|
|
27
27
|
function nextItem(tablist) {
|
|
28
28
|
if (!tablist) {
|
package/cjs/Tag/Tag.js
CHANGED
|
@@ -43,14 +43,17 @@ const Tag = (0, _utils.forwardRef)((props, ref) => {
|
|
|
43
43
|
prefix,
|
|
44
44
|
merge
|
|
45
45
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
46
|
-
const classes = merge(className, withPrefix(
|
|
46
|
+
const classes = merge(className, withPrefix());
|
|
47
47
|
const styles = (0, _react.useMemo)(() => (0, _utils.mergeStyles)(style, (0, _utils.createColorVariables)(color, '--rs-tag-bg', '--rs-tag-text')), [style, color]);
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement(_Box.default, (0, _extends2.default)({
|
|
49
49
|
as: as,
|
|
50
50
|
ref: ref,
|
|
51
51
|
className: classes,
|
|
52
52
|
style: styles
|
|
53
|
-
}, rest
|
|
53
|
+
}, rest, {
|
|
54
|
+
"data-size": size,
|
|
55
|
+
"data-color": (0, _utils.isPresetColor)(color) ? color : undefined
|
|
56
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
54
57
|
className: prefix`text`
|
|
55
58
|
}, children), closable && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
|
|
56
59
|
className: prefix`icon-close`,
|
package/cjs/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/cjs/Toggle/Toggle.js
CHANGED
|
@@ -49,11 +49,7 @@ const Toggle = (0, _utils.forwardRef)((props, ref) => {
|
|
|
49
49
|
withPrefix,
|
|
50
50
|
prefix
|
|
51
51
|
} = (0, _hooks.useStyles)(classPrefix);
|
|
52
|
-
const classes = merge(className, withPrefix(
|
|
53
|
-
checked,
|
|
54
|
-
disabled,
|
|
55
|
-
loading
|
|
56
|
-
}));
|
|
52
|
+
const classes = merge(className, withPrefix({}));
|
|
57
53
|
const inner = checked ? checkedChildren : unCheckedChildren;
|
|
58
54
|
const innerLabel = checked ? locale === null || locale === void 0 ? void 0 : locale.on : locale === null || locale === void 0 ? void 0 : locale.off;
|
|
59
55
|
const labelId = (0, _hooks.useUniqueId)('rs-label');
|
|
@@ -77,7 +73,12 @@ const Toggle = (0, _utils.forwardRef)((props, ref) => {
|
|
|
77
73
|
as: as,
|
|
78
74
|
ref: ref,
|
|
79
75
|
className: classes,
|
|
80
|
-
"data-placement": labelPlacement
|
|
76
|
+
"data-placement": labelPlacement,
|
|
77
|
+
"data-color": color,
|
|
78
|
+
"data-size": size,
|
|
79
|
+
"data-checked": checked,
|
|
80
|
+
"data-loading": loading,
|
|
81
|
+
"data-disabled": disabled
|
|
81
82
|
}, restProps), /*#__PURE__*/_react.default.createElement("input", (0, _extends2.default)({}, htmlInputProps, {
|
|
82
83
|
ref: inputRef,
|
|
83
84
|
type: "checkbox",
|
package/cjs/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/cjs/internals/Box/Box.js
CHANGED
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
10
10
|
var _forwardRef = require("../utils/react/forwardRef");
|
|
11
11
|
var _utils = require("./utils");
|
|
12
|
-
var
|
|
12
|
+
var _styledSystem = require("../styled-system");
|
|
13
13
|
/**
|
|
14
14
|
* Box component is the base component for all components,
|
|
15
15
|
* providing shorthand for style properties.
|
|
@@ -28,9 +28,9 @@ const Box = (0, _forwardRef.forwardRef)((props, ref) => {
|
|
|
28
28
|
} = props;
|
|
29
29
|
const boxProps = (0, _utils.extractBoxProps)(rest);
|
|
30
30
|
const domProps = (0, _utils.omitBoxProps)(rest);
|
|
31
|
-
const boxCSSVars = (0,
|
|
31
|
+
const boxCSSVars = (0, _styledSystem.getCSSVariables)(boxProps, '--rs-box-');
|
|
32
32
|
const isBox = !(0, _isEmpty.default)(boxCSSVars) || showFrom || hideFrom;
|
|
33
|
-
const styled = (0,
|
|
33
|
+
const styled = (0, _styledSystem.useStyled)({
|
|
34
34
|
cssVars: boxCSSVars,
|
|
35
35
|
className,
|
|
36
36
|
style,
|
|
@@ -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 {};
|
|
@@ -1,56 +1,39 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
exports.__esModule = true;
|
|
5
|
-
exports.omitBoxProps = exports.
|
|
6
|
+
exports.omitBoxProps = exports.extractBoxProps = void 0;
|
|
7
|
+
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
8
|
+
var _styledSystem = require("../styled-system");
|
|
6
9
|
var _utils = require("../utils");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Mapping for margin properties to their CSS style equivalents
|
|
20
|
-
const marginStyleMap = {
|
|
21
|
-
m: 'margin',
|
|
22
|
-
mt: 'marginTop',
|
|
23
|
-
mb: 'marginBottom',
|
|
24
|
-
ml: 'marginLeft',
|
|
25
|
-
mr: 'marginRight',
|
|
26
|
-
mx: 'marginInline',
|
|
27
|
-
my: 'marginBlock'
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// Mapping for size properties to their CSS style equivalents
|
|
31
|
-
const sizeStyleMap = {
|
|
32
|
-
w: 'width',
|
|
33
|
-
h: 'height',
|
|
34
|
-
minw: 'minWidth',
|
|
35
|
-
maxw: 'maxWidth',
|
|
36
|
-
minh: 'minHeight',
|
|
37
|
-
maxh: 'maxHeight'
|
|
10
|
+
const getUsedPropKeys = () => {
|
|
11
|
+
const propSet = new Set();
|
|
12
|
+
Object.entries(_styledSystem.cssSystemPropAlias).forEach(([key, prop]) => {
|
|
13
|
+
const {
|
|
14
|
+
property
|
|
15
|
+
} = prop;
|
|
16
|
+
const propName = (0, _camelCase.default)(property);
|
|
17
|
+
propSet.add(key);
|
|
18
|
+
propSet.add(propName);
|
|
19
|
+
});
|
|
20
|
+
return Array.from(propSet);
|
|
38
21
|
};
|
|
39
22
|
|
|
40
|
-
// Derive box property keys from style mappings
|
|
41
|
-
const boxPropKeys = [...Object.keys(paddingStyleMap), ...Object.keys(marginStyleMap), ...Object.keys(sizeStyleMap), 'bd', 'bg', 'c', 'display', 'rounded', 'shadow'];
|
|
42
|
-
|
|
43
23
|
/**
|
|
44
24
|
* Extract box properties from props
|
|
45
25
|
* @param props Original props object
|
|
46
26
|
* @returns Object containing only box properties
|
|
47
27
|
*/
|
|
48
28
|
const extractBoxProps = props => {
|
|
29
|
+
const boxPropKeys = getUsedPropKeys();
|
|
49
30
|
const boxProps = {};
|
|
50
31
|
|
|
51
32
|
// Extract only box related properties
|
|
52
|
-
|
|
53
|
-
if (key
|
|
33
|
+
Object.keys(props).forEach(key => {
|
|
34
|
+
if (boxPropKeys.includes(key) && props[key] !== undefined) {
|
|
35
|
+
boxProps[key] = props[key];
|
|
36
|
+
} else if ((0, _utils.isCSSProperty)(key)) {
|
|
54
37
|
boxProps[key] = props[key];
|
|
55
38
|
}
|
|
56
39
|
});
|
|
@@ -64,6 +47,7 @@ const extractBoxProps = props => {
|
|
|
64
47
|
*/
|
|
65
48
|
exports.extractBoxProps = extractBoxProps;
|
|
66
49
|
const omitBoxProps = props => {
|
|
50
|
+
const boxPropKeys = getUsedPropKeys();
|
|
67
51
|
const filteredProps = {};
|
|
68
52
|
|
|
69
53
|
// Copy all properties except box related ones
|
|
@@ -74,192 +58,4 @@ const omitBoxProps = props => {
|
|
|
74
58
|
});
|
|
75
59
|
return filteredProps;
|
|
76
60
|
};
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Checks if a value is a responsive value object
|
|
80
|
-
* @param value - Value to check
|
|
81
|
-
* @returns True if the value is a responsive value object
|
|
82
|
-
*/
|
|
83
|
-
exports.omitBoxProps = omitBoxProps;
|
|
84
|
-
function isResponsiveValue(value) {
|
|
85
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value) && Object.keys(value).some(key => _constants.BREAKPOINTS.includes(key));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Process a value that might be a responsive value
|
|
90
|
-
* @param value - Value to process
|
|
91
|
-
* @param processor - Function to process non-responsive values
|
|
92
|
-
* @returns Processed value or responsive object with processed values
|
|
93
|
-
*/
|
|
94
|
-
function processResponsiveValue(value, processor) {
|
|
95
|
-
if (value === undefined) {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
if (isResponsiveValue(value)) {
|
|
99
|
-
const result = {};
|
|
100
|
-
Object.entries(value).forEach(([breakpoint, val]) => {
|
|
101
|
-
if (val !== undefined) {
|
|
102
|
-
const processed = processor(val);
|
|
103
|
-
if (processed !== undefined) {
|
|
104
|
-
result[breakpoint] = processed;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
return Object.keys(result).length > 0 ? result : undefined;
|
|
109
|
-
}
|
|
110
|
-
return processor(value);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Type for CSS variable values that can be string, number, or responsive values
|
|
114
|
-
|
|
115
|
-
// Silence ESLint warnings for unused parameters in forEach callbacks
|
|
116
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Converts layout properties to CSS variables with abbreviated names
|
|
120
|
-
* @param props Object containing layout properties
|
|
121
|
-
* @returns Object with CSS variables
|
|
122
|
-
*/
|
|
123
|
-
const getBoxCSSVariables = props => {
|
|
124
|
-
const cssVars = {};
|
|
125
|
-
const prefix = `--rs-box-`;
|
|
126
|
-
|
|
127
|
-
// Process padding properties
|
|
128
|
-
Object.keys(paddingStyleMap).forEach(propKey => {
|
|
129
|
-
if (props[propKey] !== undefined) {
|
|
130
|
-
cssVars[`${prefix}${propKey}`] = processResponsiveValue(props[propKey], val => (0, _utils.getCssValue)(val));
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// Process margin properties
|
|
135
|
-
Object.keys(marginStyleMap).forEach(propKey => {
|
|
136
|
-
if (props[propKey] !== undefined) {
|
|
137
|
-
cssVars[`${prefix}${propKey}`] = processResponsiveValue(props[propKey], val => (0, _utils.getCssValue)(val));
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
// Process size properties
|
|
142
|
-
Object.keys(sizeStyleMap).forEach(propKey => {
|
|
143
|
-
if (props[propKey] !== undefined) {
|
|
144
|
-
cssVars[`${prefix}${propKey}`] = processResponsiveValue(props[propKey], val => (0, _utils.getCssValue)(val));
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
if (props.bd !== undefined) {
|
|
148
|
-
cssVars[`${prefix}bd`] = processResponsiveValue(props.bd, val => (0, _utils.getCssValue)(val));
|
|
149
|
-
}
|
|
150
|
-
if (props.display !== undefined) {
|
|
151
|
-
cssVars[`${prefix}display`] = processResponsiveValue(props.display, val => val);
|
|
152
|
-
}
|
|
153
|
-
if (props.c !== undefined) {
|
|
154
|
-
cssVars[`${prefix}c`] = processResponsiveValue(props.c, val => (0, _utils.getColorVar)(val));
|
|
155
|
-
}
|
|
156
|
-
if (props.bg !== undefined) {
|
|
157
|
-
cssVars[`${prefix}bg`] = processResponsiveValue(props.bg, val => (0, _utils.getColorVar)(val));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Handle special cases for rounded and shadow
|
|
161
|
-
if (props.rounded !== undefined) {
|
|
162
|
-
const processRounded = val => {
|
|
163
|
-
const result = (0, _utils.getSizeStyle)(val, 'box', 'rounded');
|
|
164
|
-
return result ? result : undefined;
|
|
165
|
-
};
|
|
166
|
-
if (isResponsiveValue(props.rounded)) {
|
|
167
|
-
// Handle responsive rounded values
|
|
168
|
-
const responsiveRounded = {};
|
|
169
|
-
Object.entries(props.rounded).forEach(([breakpoint, val]) => {
|
|
170
|
-
if (val !== undefined) {
|
|
171
|
-
const styleObj = processRounded(val);
|
|
172
|
-
if (styleObj) {
|
|
173
|
-
responsiveRounded[breakpoint] = styleObj;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
// For each CSS variable key in the rounded styles, create a responsive value
|
|
179
|
-
const processedKeys = new Set();
|
|
180
|
-
Object.entries(responsiveRounded).forEach(([_breakpoint, styleObj]) => {
|
|
181
|
-
if (styleObj) {
|
|
182
|
-
Object.entries(styleObj).forEach(([key, _value]) => {
|
|
183
|
-
processedKeys.add(key);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
processedKeys.forEach(key => {
|
|
188
|
-
const responsiveValue = {};
|
|
189
|
-
Object.entries(responsiveRounded).forEach(([breakpoint, styleObj]) => {
|
|
190
|
-
if (styleObj && styleObj[key] !== undefined) {
|
|
191
|
-
// Ensure we're only using string values for CSS variables
|
|
192
|
-
const value = styleObj[key];
|
|
193
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
194
|
-
responsiveValue[breakpoint] = value;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
if (Object.keys(responsiveValue).length > 0) {
|
|
199
|
-
cssVars[key] = responsiveValue;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
} else {
|
|
203
|
-
// Handle non-responsive rounded value
|
|
204
|
-
const styleObj = processRounded(props.rounded);
|
|
205
|
-
if (styleObj) {
|
|
206
|
-
Object.entries(styleObj).forEach(([key, value]) => {
|
|
207
|
-
cssVars[key] = value;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (props.shadow !== undefined) {
|
|
213
|
-
const processShadow = val => {
|
|
214
|
-
const result = (0, _utils.getSizeStyle)(val, 'box', 'shadow');
|
|
215
|
-
return result ? result : undefined;
|
|
216
|
-
};
|
|
217
|
-
if (isResponsiveValue(props.shadow)) {
|
|
218
|
-
// Handle responsive shadow values
|
|
219
|
-
const responsiveShadow = {};
|
|
220
|
-
Object.entries(props.shadow).forEach(([breakpoint, val]) => {
|
|
221
|
-
if (val !== undefined) {
|
|
222
|
-
const styleObj = processShadow(val);
|
|
223
|
-
if (styleObj) {
|
|
224
|
-
responsiveShadow[breakpoint] = styleObj;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
// For each CSS variable key in the shadow styles, create a responsive value
|
|
230
|
-
const processedKeys = new Set();
|
|
231
|
-
Object.entries(responsiveShadow).forEach(([_breakpoint, styleObj]) => {
|
|
232
|
-
if (styleObj) {
|
|
233
|
-
Object.entries(styleObj).forEach(([key, _value]) => {
|
|
234
|
-
processedKeys.add(key);
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
processedKeys.forEach(key => {
|
|
239
|
-
const responsiveValue = {};
|
|
240
|
-
Object.entries(responsiveShadow).forEach(([breakpoint, styleObj]) => {
|
|
241
|
-
if (styleObj && styleObj[key] !== undefined) {
|
|
242
|
-
// Ensure we're only using string values for CSS variables
|
|
243
|
-
const value = styleObj[key];
|
|
244
|
-
if (typeof value === 'string' || typeof value === 'number') {
|
|
245
|
-
responsiveValue[breakpoint] = value;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
if (Object.keys(responsiveValue).length > 0) {
|
|
250
|
-
cssVars[key] = responsiveValue;
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
} else {
|
|
254
|
-
// Handle non-responsive shadow value
|
|
255
|
-
const styleObj = processShadow(props.shadow);
|
|
256
|
-
if (styleObj) {
|
|
257
|
-
Object.entries(styleObj).forEach(([key, value]) => {
|
|
258
|
-
cssVars[key] = value;
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return cssVars;
|
|
264
|
-
};
|
|
265
|
-
exports.getBoxCSSVariables = getBoxCSSVariables;
|
|
61
|
+
exports.omitBoxProps = omitBoxProps;
|
|
@@ -5,7 +5,7 @@ import type { PropsWithoutChange, FormControlBaseProps, Size } from '../types';
|
|
|
5
5
|
export interface InputBaseLocaleType {
|
|
6
6
|
unfilled: string;
|
|
7
7
|
}
|
|
8
|
-
export interface InputBaseCommonProps extends BoxProps, PropsWithoutChange<FormControlBaseProps> {
|
|
8
|
+
export interface InputBaseCommonProps extends Omit<BoxProps, 'height' | 'width'>, PropsWithoutChange<FormControlBaseProps> {
|
|
9
9
|
/** A component can have different sizes */
|
|
10
10
|
size?: Size;
|
|
11
11
|
/** The HTML input id */
|