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.
Files changed (247) hide show
  1. package/AutoComplete/styles/index.css +156 -161
  2. package/AvatarGroup/styles/index.css +1 -10
  3. package/Badge/styles/index.css +21 -21
  4. package/Button/styles/index.css +78 -63
  5. package/ButtonGroup/styles/index.css +15 -12
  6. package/ButtonToolbar/styles/index.css +1 -10
  7. package/CHANGELOG.md +9 -0
  8. package/Calendar/styles/index.css +92 -67
  9. package/Card/styles/index.css +7 -7
  10. package/CascadeTree/styles/index.css +8 -9
  11. package/Cascader/styles/index.css +160 -164
  12. package/CheckPicker/styles/index.css +173 -178
  13. package/CheckTree/styles/index.css +175 -180
  14. package/CheckTreePicker/styles/index.css +175 -180
  15. package/Checkbox/styles/index.css +21 -28
  16. package/CheckboxGroup/styles/index.css +1 -1
  17. package/DateInput/styles/index.css +8 -18
  18. package/DatePicker/styles/index.css +173 -168
  19. package/DateRangeInput/styles/index.css +8 -18
  20. package/DateRangePicker/styles/index.css +173 -168
  21. package/Dropdown/styles/index.css +110 -94
  22. package/IconButton/styles/index.css +95 -79
  23. package/InlineEdit/styles/index.css +12 -19
  24. package/Input/styles/index.css +8 -18
  25. package/InputGroup/styles/index.css +31 -38
  26. package/InputNumber/styles/index.css +115 -100
  27. package/InputPicker/styles/index.css +156 -161
  28. package/List/styles/index.css +10 -10
  29. package/Loader/styles/index.css +16 -16
  30. package/Menu/styles/index.css +2 -2
  31. package/Message/styles/index.css +2 -2
  32. package/MultiCascadeTree/styles/index.css +178 -191
  33. package/MultiCascader/styles/index.css +178 -200
  34. package/Nav/styles/index.css +162 -146
  35. package/Navbar/styles/index.css +140 -124
  36. package/NumberInput/styles/index.css +115 -100
  37. package/Pagination/styles/index.css +177 -200
  38. package/PasswordInput/styles/index.css +36 -43
  39. package/PinInput/styles/index.css +12 -22
  40. package/Radio/styles/index.css +22 -29
  41. package/RadioGroup/styles/index.css +11 -11
  42. package/SelectPicker/styles/index.css +156 -161
  43. package/Sidenav/styles/index.css +122 -129
  44. package/Stack/styles/index.css +1 -10
  45. package/Stat/styles/index.css +95 -79
  46. package/Steps/styles/index.css +26 -25
  47. package/Table/styles/index.css +11 -0
  48. package/Tabs/styles/index.css +162 -146
  49. package/Tag/styles/index.css +112 -96
  50. package/TagInput/styles/index.css +174 -179
  51. package/TagPicker/styles/index.css +174 -179
  52. package/TimePicker/styles/index.css +173 -168
  53. package/TimeRangePicker/styles/index.css +173 -168
  54. package/Toggle/styles/index.css +27 -30
  55. package/Tree/styles/index.css +157 -162
  56. package/TreePicker/styles/index.css +157 -162
  57. package/Uploader/styles/index.css +94 -65
  58. package/cjs/Badge/Badge.js +16 -11
  59. package/cjs/Breadcrumb/Breadcrumb.d.ts +2 -2
  60. package/cjs/Button/Button.js +9 -7
  61. package/cjs/ButtonGroup/ButtonGroup.js +7 -7
  62. package/cjs/Card/Card.js +6 -6
  63. package/cjs/Checkbox/Checkbox.js +6 -7
  64. package/cjs/CheckboxGroup/CheckboxGroup.js +3 -4
  65. package/cjs/Dropdown/Dropdown.js +3 -4
  66. package/cjs/Dropdown/DropdownItem.js +4 -4
  67. package/cjs/Dropdown/DropdownMenu.js +9 -10
  68. package/cjs/FormControl/FormControl.d.ts +1 -1
  69. package/cjs/FormControlLabel/FormControlLabel.d.ts +1 -1
  70. package/cjs/FormHelpText/FormHelpText.d.ts +1 -1
  71. package/cjs/IconButton/IconButton.d.ts +1 -1
  72. package/cjs/IconButton/IconButton.js +9 -9
  73. package/cjs/Image/Image.d.ts +1 -1
  74. package/cjs/InlineEdit/InlineEdit.js +3 -2
  75. package/cjs/InputGroup/InputGroup.js +12 -14
  76. package/cjs/InputGroup/InputGroupAddon.d.ts +2 -2
  77. package/cjs/InputPicker/InputAutosize.js +4 -6
  78. package/cjs/List/List.d.ts +1 -1
  79. package/cjs/List/List.js +7 -8
  80. package/cjs/List/ListItem.d.ts +2 -2
  81. package/cjs/List/ListItem.js +4 -4
  82. package/cjs/Loader/Loader.js +8 -7
  83. package/cjs/Menu/MenuSeparator.d.ts +2 -2
  84. package/cjs/Nav/Nav.d.ts +2 -2
  85. package/cjs/Nav/Nav.js +12 -13
  86. package/cjs/Nav/NavDropdownItem.js +4 -4
  87. package/cjs/Nav/NavDropdownMenu.js +10 -13
  88. package/cjs/Nav/NavItem.d.ts +2 -2
  89. package/cjs/Nav/NavItem.js +6 -8
  90. package/cjs/Navbar/Navbar.js +6 -6
  91. package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
  92. package/cjs/Navbar/NavbarDropdown.js +3 -4
  93. package/cjs/Navbar/NavbarDropdownItem.js +4 -4
  94. package/cjs/Navbar/NavbarDropdownMenu.js +8 -11
  95. package/cjs/NumberInput/NumberInput.d.ts +1 -1
  96. package/cjs/Pagination/Pagination.js +3 -2
  97. package/cjs/Pagination/PaginationButton.d.ts +3 -3
  98. package/cjs/Pagination/PaginationButton.js +9 -17
  99. package/cjs/Pagination/PaginationGroup.js +2 -1
  100. package/cjs/Panel/PanelHeader.d.ts +1 -1
  101. package/cjs/Radio/Radio.js +6 -6
  102. package/cjs/RadioGroup/RadioGroup.js +4 -4
  103. package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
  104. package/cjs/Sidenav/Sidenav.js +3 -2
  105. package/cjs/Sidenav/SidenavDropdown.js +3 -5
  106. package/cjs/Sidenav/SidenavDropdownItem.js +4 -4
  107. package/cjs/Sidenav/SidenavDropdownMenu.js +10 -13
  108. package/cjs/Sidenav/SidenavItem.d.ts +2 -2
  109. package/cjs/Sidenav/SidenavItem.js +4 -5
  110. package/cjs/Slider/Handle.d.ts +1 -1
  111. package/cjs/Stack/Stack.d.ts +1 -17
  112. package/cjs/Stack/Stack.js +3 -4
  113. package/cjs/Stack/StackItem.d.ts +4 -5
  114. package/cjs/Stack/StackItem.js +4 -10
  115. package/cjs/Steps/StepItem.js +7 -8
  116. package/cjs/Steps/Steps.d.ts +2 -1
  117. package/cjs/Steps/Steps.js +32 -34
  118. package/cjs/Tabs/Tabs.js +1 -1
  119. package/cjs/Tag/Tag.js +5 -2
  120. package/cjs/Toggle/Toggle.d.ts +1 -1
  121. package/cjs/Toggle/Toggle.js +7 -6
  122. package/cjs/Tree/types.d.ts +2 -2
  123. package/cjs/Uploader/Uploader.d.ts +2 -2
  124. package/cjs/internals/Box/Box.d.ts +1 -0
  125. package/cjs/internals/Box/index.d.ts +1 -1
  126. package/cjs/internals/Box/utils.js +5 -4
  127. package/cjs/internals/InputBase/InputBase.d.ts +1 -1
  128. package/cjs/internals/InputBase/InputBase.js +3 -2
  129. package/cjs/internals/Menu/MenuItem.js +1 -1
  130. package/cjs/internals/Overlay/Modal.d.ts +1 -1
  131. package/cjs/internals/Picker/PickerToggle.js +2 -4
  132. package/cjs/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
  133. package/cjs/internals/Tree/TreeView.d.ts +2 -2
  134. package/cjs/internals/hooks/useCustom.js +24 -7
  135. package/cjs/internals/styled-system/css-alias.d.ts +7 -0
  136. package/cjs/internals/styled-system/css-alias.js +391 -0
  137. package/cjs/internals/styled-system/css-properties.d.ts +6 -0
  138. package/cjs/internals/styled-system/css-properties.js +30 -0
  139. package/cjs/internals/styled-system/index.d.ts +1 -1
  140. package/cjs/internals/styled-system/index.js +4 -4
  141. package/cjs/internals/styled-system/responsive.d.ts +0 -4
  142. package/cjs/internals/styled-system/responsive.js +12 -33
  143. package/cjs/internals/styled-system/types.d.ts +59 -5
  144. package/cjs/internals/styled-system/useStyled.js +3 -3
  145. package/cjs/internals/types/html.d.ts +6 -6
  146. package/cjs/internals/types/picker.d.ts +1 -1
  147. package/dist/rsuite-no-reset.css +641 -641
  148. package/dist/rsuite-no-reset.min.css +1 -1
  149. package/dist/rsuite.css +641 -641
  150. package/dist/rsuite.js +60 -60
  151. package/dist/rsuite.min.css +1 -1
  152. package/dist/rsuite.min.js +1 -1
  153. package/dist/rsuite.min.js.map +1 -1
  154. package/esm/Badge/Badge.js +16 -11
  155. package/esm/Breadcrumb/Breadcrumb.d.ts +2 -2
  156. package/esm/Button/Button.js +9 -7
  157. package/esm/ButtonGroup/ButtonGroup.js +7 -7
  158. package/esm/Card/Card.js +6 -6
  159. package/esm/Checkbox/Checkbox.js +6 -7
  160. package/esm/CheckboxGroup/CheckboxGroup.js +3 -4
  161. package/esm/Dropdown/Dropdown.js +3 -4
  162. package/esm/Dropdown/DropdownItem.js +4 -4
  163. package/esm/Dropdown/DropdownMenu.js +9 -10
  164. package/esm/FormControl/FormControl.d.ts +1 -1
  165. package/esm/FormControlLabel/FormControlLabel.d.ts +1 -1
  166. package/esm/FormHelpText/FormHelpText.d.ts +1 -1
  167. package/esm/IconButton/IconButton.d.ts +1 -1
  168. package/esm/IconButton/IconButton.js +9 -9
  169. package/esm/Image/Image.d.ts +1 -1
  170. package/esm/InlineEdit/InlineEdit.js +3 -2
  171. package/esm/InputGroup/InputGroup.js +12 -14
  172. package/esm/InputGroup/InputGroupAddon.d.ts +2 -2
  173. package/esm/InputPicker/InputAutosize.js +4 -6
  174. package/esm/List/List.d.ts +1 -1
  175. package/esm/List/List.js +7 -8
  176. package/esm/List/ListItem.d.ts +2 -2
  177. package/esm/List/ListItem.js +4 -4
  178. package/esm/Loader/Loader.js +8 -7
  179. package/esm/Menu/MenuSeparator.d.ts +2 -2
  180. package/esm/Nav/Nav.d.ts +2 -2
  181. package/esm/Nav/Nav.js +12 -13
  182. package/esm/Nav/NavDropdownItem.js +4 -4
  183. package/esm/Nav/NavDropdownMenu.js +10 -13
  184. package/esm/Nav/NavItem.d.ts +2 -2
  185. package/esm/Nav/NavItem.js +6 -8
  186. package/esm/Navbar/Navbar.js +7 -7
  187. package/esm/Navbar/NavbarDropdown.d.ts +1 -1
  188. package/esm/Navbar/NavbarDropdown.js +3 -4
  189. package/esm/Navbar/NavbarDropdownItem.js +4 -4
  190. package/esm/Navbar/NavbarDropdownMenu.js +8 -11
  191. package/esm/NumberInput/NumberInput.d.ts +1 -1
  192. package/esm/Pagination/Pagination.js +3 -2
  193. package/esm/Pagination/PaginationButton.d.ts +3 -3
  194. package/esm/Pagination/PaginationButton.js +9 -16
  195. package/esm/Pagination/PaginationGroup.js +2 -1
  196. package/esm/Panel/PanelHeader.d.ts +1 -1
  197. package/esm/Radio/Radio.js +6 -6
  198. package/esm/RadioGroup/RadioGroup.js +4 -4
  199. package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
  200. package/esm/Sidenav/Sidenav.js +3 -2
  201. package/esm/Sidenav/SidenavDropdown.js +3 -5
  202. package/esm/Sidenav/SidenavDropdownItem.js +4 -4
  203. package/esm/Sidenav/SidenavDropdownMenu.js +10 -13
  204. package/esm/Sidenav/SidenavItem.d.ts +2 -2
  205. package/esm/Sidenav/SidenavItem.js +4 -5
  206. package/esm/Slider/Handle.d.ts +1 -1
  207. package/esm/Stack/Stack.d.ts +1 -17
  208. package/esm/Stack/Stack.js +3 -4
  209. package/esm/Stack/StackItem.d.ts +4 -5
  210. package/esm/Stack/StackItem.js +5 -11
  211. package/esm/Steps/StepItem.js +7 -8
  212. package/esm/Steps/Steps.d.ts +2 -1
  213. package/esm/Steps/Steps.js +31 -34
  214. package/esm/Tabs/Tabs.js +1 -1
  215. package/esm/Tag/Tag.js +5 -2
  216. package/esm/Toggle/Toggle.d.ts +1 -1
  217. package/esm/Toggle/Toggle.js +7 -6
  218. package/esm/Tree/types.d.ts +2 -2
  219. package/esm/Uploader/Uploader.d.ts +2 -2
  220. package/esm/internals/Box/Box.d.ts +1 -0
  221. package/esm/internals/Box/index.d.ts +1 -1
  222. package/esm/internals/Box/utils.js +6 -5
  223. package/esm/internals/InputBase/InputBase.d.ts +1 -1
  224. package/esm/internals/InputBase/InputBase.js +3 -2
  225. package/esm/internals/Menu/MenuItem.js +1 -1
  226. package/esm/internals/Overlay/Modal.d.ts +1 -1
  227. package/esm/internals/Picker/PickerToggle.js +2 -4
  228. package/esm/internals/SafeAnchor/SafeAnchor.d.ts +2 -2
  229. package/esm/internals/Tree/TreeView.d.ts +2 -2
  230. package/esm/internals/hooks/useCustom.js +24 -7
  231. package/esm/internals/styled-system/css-alias.d.ts +7 -0
  232. package/esm/internals/styled-system/css-alias.js +387 -0
  233. package/esm/internals/styled-system/css-properties.d.ts +6 -0
  234. package/esm/internals/styled-system/css-properties.js +26 -0
  235. package/esm/internals/styled-system/index.d.ts +1 -1
  236. package/esm/internals/styled-system/index.js +1 -1
  237. package/esm/internals/styled-system/responsive.d.ts +0 -4
  238. package/esm/internals/styled-system/responsive.js +11 -31
  239. package/esm/internals/styled-system/types.d.ts +59 -5
  240. package/esm/internals/styled-system/useStyled.js +3 -3
  241. package/esm/internals/types/html.d.ts +6 -6
  242. package/esm/internals/types/picker.d.ts +1 -1
  243. package/package.json +1 -1
  244. package/cjs/internals/styled-system/css-property.d.ts +0 -6
  245. package/cjs/internals/styled-system/css-property.js +0 -289
  246. package/esm/internals/styled-system/css-property.d.ts +0 -6
  247. package/esm/internals/styled-system/css-property.js +0 -285
@@ -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({}, rest, {
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
- }), /*#__PURE__*/React.createElement("div", {
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(['icon-wrapper', icon ? 'custom-icon' : ''])
58
+ className: prefix('icon-wrapper')
60
59
  }, iconNode), /*#__PURE__*/React.createElement("div", {
61
60
  className: prefix('content')
62
61
  }, /*#__PURE__*/React.createElement("div", {
@@ -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", import("./StepItem").StepItemProps, never> & Record<string, never>;
22
+ Item: import("../internals/types").InternalRefForwardingComponent<"div", StepItemProps, never> & Record<string, never>;
22
23
  };
23
24
  export default Steps;
@@ -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 horizontal = !vertical;
38
- const classes = merge(className, withPrefix({
39
- small,
40
- vertical,
41
- horizontal: !vertical
42
- }));
43
- const count = rch.count(children);
44
- const items = rch.mapCloneElement(children, (item, index) => {
45
- const itemStyles = {
46
- flexBasis: index < count - 1 ? `${100 / (count - 1)}%` : undefined,
47
- maxWidth: index === count - 1 ? `${100 / count}%` : undefined
48
- };
49
- const itemProps = {
50
- stepNumber: index + 1,
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
- // fix tail color
57
- if (currentStatus === 'error' && index === current - 1) {
58
- itemProps.className = prefix('next-error');
59
- }
60
- if (!item.props.status) {
61
- if (index === current) {
62
- itemProps.status = currentStatus;
63
- itemProps.className = merge(itemProps.className, prefix('item-active'));
64
- } else if (index < current) {
65
- itemProps.status = 'finish';
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
- return itemProps;
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(size, isPresetColor(color) && color));
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), /*#__PURE__*/React.createElement("span", {
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`,
@@ -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
  */
@@ -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(size, color, {
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",
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { BoxProps } from '../internals/Box';
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 BoxProps {
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 { BoxProps } from '../internals/Box';
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 BoxProps, Omit<UploadTriggerProps, 'onChange' | 'onError' | 'onProgress'> {
24
+ export interface UploaderProps extends BaseBoxProps, Omit<UploadTriggerProps, 'onChange' | 'onError' | 'onProgress'> {
25
25
  /**
26
26
  * Custom ref for Uploader
27
27
  */
@@ -6,6 +6,7 @@ export interface BoxProps extends WithAsProps, CSSSystemProps {
6
6
  /** Breakpoint above which the component is hidden with `display: none` */
7
7
  hideFrom?: Breakpoints;
8
8
  }
9
+ export type BaseBoxProps = Omit<BoxProps, 'color'>;
9
10
  /**
10
11
  * Box component is the base component for all components,
11
12
  * providing shorthand for style properties.
@@ -1,4 +1,4 @@
1
1
  import Box from './Box';
2
- export type { BoxProps } from './Box';
2
+ export type { BoxProps, BaseBoxProps } from './Box';
3
3
  export { Box };
4
4
  export default Box;
@@ -1,17 +1,18 @@
1
1
  'use client';
2
2
  import camelCase from 'lodash/camelCase';
3
- import flatten from 'lodash/flatten';
4
- import { cssPropertyMap } from "../styled-system/index.js";
3
+ import { cssSystemPropAlias } from "../styled-system/index.js";
5
4
  import { isCSSProperty } from "../utils/index.js";
6
5
  const getUsedPropKeys = () => {
7
- const boxPropKeys = Object.entries(cssPropertyMap).map(([key, prop]) => {
6
+ const propSet = new Set();
7
+ Object.entries(cssSystemPropAlias).forEach(([key, prop]) => {
8
8
  const {
9
9
  property
10
10
  } = prop;
11
11
  const propName = camelCase(property);
12
- return [key, propName];
12
+ propSet.add(key);
13
+ propSet.add(propName);
13
14
  });
14
- return flatten(boxPropKeys);
15
+ return Array.from(propSet);
15
16
  };
16
17
 
17
18
  /**
@@ -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 */
@@ -52,7 +52,7 @@ const InputBase = forwardRef((props, ref) => {
52
52
  withPrefix,
53
53
  merge
54
54
  } = useStyles(classPrefix || 'input');
55
- const classes = merge(className, withPrefix(size, {
55
+ const classes = merge(className, withPrefix({
56
56
  plaintext
57
57
  }));
58
58
 
@@ -82,7 +82,8 @@ const InputBase = forwardRef((props, ref) => {
82
82
  defaultValue: defaultValue,
83
83
  disabled: disabled,
84
84
  readOnly: readOnly,
85
- placeholder: placeholder
85
+ placeholder: placeholder,
86
+ "data-size": size
86
87
  }, inputProps, eventProps, rest));
87
88
  });
88
89
  InputBase.displayName = 'InputBase';
@@ -83,7 +83,7 @@ function MenuItem(props) {
83
83
  role: 'menuitem',
84
84
  // fixme Only use `aria-checked` on menuitemradio and menuitemcheckbox
85
85
  'aria-checked': selected || undefined,
86
- 'aria-disabled': disabled,
86
+ 'aria-disabled': disabled || undefined,
87
87
  tabIndex: -1,
88
88
  onClick: handleClick,
89
89
  // render props
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../Box';
3
3
  import type { AnimationEventProps } from '../types';
4
- export interface BaseModalProps extends Omit<BoxProps, 'children'>, AnimationEventProps {
4
+ export interface BaseModalProps extends Omit<BoxProps, 'children' | 'transition' | 'color' | 'overflow'>, AnimationEventProps {
5
5
  /** Animation-related properties */
6
6
  animationProps?: any;
7
7
  /** Primary content */
@@ -103,9 +103,7 @@ const PickerToggle = forwardRef((props, ref) => {
103
103
  id: labelId
104
104
  }, label)), /*#__PURE__*/React.createElement(Stack.Item, {
105
105
  grow: 1,
106
- style: {
107
- overflow: 'hidden'
108
- }
106
+ overflow: "hidden"
109
107
  }, /*#__PURE__*/React.createElement("input", {
110
108
  readOnly: true,
111
109
  "aria-hidden": true,
@@ -113,7 +111,7 @@ const PickerToggle = forwardRef((props, ref) => {
113
111
  "data-testid": "picker-toggle-input",
114
112
  name: name,
115
113
  value: inputValue,
116
- className: prefix('textbox', 'read-only'),
114
+ className: prefix('textbox'),
117
115
  style: {
118
116
  pointerEvents: 'none'
119
117
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '../Box';
3
- export interface SafeAnchorProps extends BoxProps, React.HTMLAttributes<HTMLElement> {
2
+ import { BaseBoxProps } from '../Box';
3
+ export interface SafeAnchorProps extends BaseBoxProps, React.HTMLAttributes<HTMLElement> {
4
4
  /** Link specified url */
5
5
  href?: string;
6
6
  /** A link can show it is currently unable to be interacted with */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '../Box';
3
- interface TreeViewProps extends BoxProps, React.HTMLAttributes<HTMLDivElement> {
2
+ import { BaseBoxProps } from '../Box';
3
+ interface TreeViewProps extends BaseBoxProps, React.HTMLAttributes<HTMLDivElement> {
4
4
  treeRootClassName: string;
5
5
  multiselectable?: boolean;
6
6
  height?: number;
@@ -7,12 +7,29 @@ import { CustomContext } from "../Provider/CustomContext.js";
7
7
  function getDefaultRTL() {
8
8
  return typeof document !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
9
9
  }
10
- function toLocaleKey(componentName) {
11
- const Picker = ['Cascader', 'CheckTreePicker', 'MultiCascader', 'SelectPicker', 'TreePicker', 'CheckPicker', 'CheckTreePicker'];
12
- if (Picker.includes(componentName)) {
13
- return 'Combobox';
14
- }
15
- return componentName;
10
+
11
+ /**
12
+ * Maps a component name to its corresponding locale key
13
+ * @param componentName - The name of the component
14
+ * @returns The locale key for the component
15
+ */
16
+ function getComponentLocaleKey(componentName) {
17
+ // Define mappings for components that share locale keys
18
+ const localeKeyMappings = {
19
+ // All picker components use the Combobox locale
20
+ Cascader: 'Combobox',
21
+ CheckTreePicker: 'Combobox',
22
+ MultiCascader: 'Combobox',
23
+ SelectPicker: 'Combobox',
24
+ TreePicker: 'Combobox',
25
+ CheckPicker: 'Combobox',
26
+ // Time components use date components locales
27
+ TimePicker: 'DatePicker',
28
+ TimeRangePicker: 'DateRangePicker'
29
+ };
30
+
31
+ // Return the mapped locale key or the component name itself if no mapping exists
32
+ return localeKeyMappings[componentName] || componentName;
16
33
  }
17
34
 
18
35
  /**
@@ -57,7 +74,7 @@ export function useCustom(componentName, componentProps) {
57
74
  //Memoize the global default props based on component name
58
75
  const globalDefaultProps = ((_components$component = components[componentName]) === null || _components$component === void 0 ? void 0 : _components$component.defaultProps) || {};
59
76
  const mergedProps = assign({}, globalDefaultProps, restProps);
60
- const localeKey = toLocaleKey(componentName);
77
+ const localeKey = getComponentLocaleKey(componentName);
61
78
 
62
79
  // If the default locale has the component name, then merge the locale.
63
80
  if (Object.keys(enGB).includes(localeKey)) {
@@ -0,0 +1,7 @@
1
+ import type { CSSSystemProps, CSSProperty } from './types';
2
+ /**
3
+ * CSS Property Alias
4
+ * This type maps all the CSS properties defined in cssSystemPropAlias to their corresponding React CSS types
5
+ */
6
+ export declare const cssSystemPropAlias: Partial<Record<keyof CSSSystemProps, CSSProperty>>;
7
+ export type CSSSystemPropKey = keyof typeof cssSystemPropAlias;