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
@@ -67,16 +67,15 @@ const NavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
67
67
  active,
68
68
  ...menuitem
69
69
  }, menuitemRef) => {
70
- const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix({
71
- 'with-icon': icon,
72
- open,
73
- active: selected,
74
- disabled,
75
- focus: active
76
- }));
70
+ const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
77
71
  return /*#__PURE__*/React.createElement("div", _extends({
78
72
  ref: mergeRefs(buttonRef, menuitemRef),
79
73
  className: classes,
74
+ "data-open": open,
75
+ "data-focus": active,
76
+ "data-active": selected,
77
+ "data-disabled": disabled,
78
+ "data-with-icon": icon,
80
79
  "data-event-key": eventKey,
81
80
  "data-event-key-type": typeof eventKey
82
81
  }, menuitem, omit(menuButtonProps, ['role'])), icon && /*#__PURE__*/React.cloneElement(icon, {
@@ -102,14 +101,12 @@ const NavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
102
101
  open,
103
102
  ...menuContainer
104
103
  }, menuContainerRef) => {
105
- const classes = mergeItemClassNames(className, withItemClassPrefix({
106
- disabled,
107
- open,
108
- submenu: true
109
- }));
104
+ const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
110
105
  return /*#__PURE__*/React.createElement("li", _extends({
111
106
  ref: mergeRefs(ref, menuContainerRef),
112
- className: classes
107
+ className: classes,
108
+ "data-open": open,
109
+ "data-disabled": disabled
113
110
  }, menuContainer));
114
111
  });
115
112
  });
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '../internals/Box';
2
+ import { BaseBoxProps } from '../internals/Box';
3
3
  import type { HTMLPropsWithoutSelect } from '../internals/types';
4
4
  import type { IconProps } from '@rsuite/icons/Icon';
5
- export interface NavItemProps<T = string | number> extends BoxProps, HTMLPropsWithoutSelect {
5
+ export interface NavItemProps<T = string | number> extends BaseBoxProps, HTMLPropsWithoutSelect {
6
6
  /** Activation status */
7
7
  active?: boolean;
8
8
  /** Disabled status */
@@ -52,10 +52,7 @@ const NavItem = forwardRef((props, ref) => {
52
52
  merge,
53
53
  prefix
54
54
  } = useStyles(classPrefix);
55
- const classes = merge(className, withPrefix({
56
- active,
57
- disabled
58
- }));
55
+ const classes = merge(className, withPrefix());
59
56
  const handleClick = useCallback(event => {
60
57
  if (!disabled) {
61
58
  emitSelect(event);
@@ -80,13 +77,14 @@ const NavItem = forwardRef((props, ref) => {
80
77
  return /*#__PURE__*/React.createElement(Box, _extends({
81
78
  as: as,
82
79
  ref: ref,
83
- tabIndex: disabled ? -1 : undefined
84
- }, rest, {
80
+ tabIndex: disabled ? -1 : undefined,
85
81
  className: classes,
86
82
  onClick: handleClick,
87
83
  style: style,
88
- "aria-selected": active || undefined
89
- }), icon && /*#__PURE__*/React.cloneElement(icon, {
84
+ "aria-selected": active || undefined,
85
+ "data-active": active || undefined,
86
+ "data-disabled": disabled
87
+ }, rest), icon && /*#__PURE__*/React.cloneElement(icon, {
90
88
  className: classNames(prefix('icon'), icon.props.className)
91
89
  }), children, /*#__PURE__*/React.createElement(Ripple, null));
92
90
  });
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import React, { useMemo } from 'react';
3
+ import React, { useMemo, useState } from 'react';
4
4
  import NavbarBrand from "./NavbarBrand.js";
5
5
  import NavbarContent from "./NavbarContent.js";
6
6
  import NavbarToggle from "./NavbarToggle.js";
@@ -36,8 +36,8 @@ const Navbar = forwardRef((props, ref) => {
36
36
  withPrefix,
37
37
  merge
38
38
  } = useStyles(classPrefix);
39
- const classes = merge(className, withPrefix(appearance));
40
- const [open, setOpen] = React.useState(false);
39
+ const classes = merge(className, withPrefix());
40
+ const [open, setOpen] = useState(false);
41
41
  const handleToggle = useEventCallback(nextOpen => {
42
42
  setOpen(nextOpen);
43
43
  onDrawerOpenChange === null || onDrawerOpenChange === void 0 || onDrawerOpenChange(nextOpen);
@@ -52,11 +52,11 @@ const Navbar = forwardRef((props, ref) => {
52
52
  return /*#__PURE__*/React.createElement(NavbarContext.Provider, {
53
53
  value: context
54
54
  }, /*#__PURE__*/React.createElement(Box, _extends({
55
- as: as
56
- }, rest, {
55
+ as: as,
57
56
  ref: ref,
58
- className: classes
59
- })));
57
+ className: classes,
58
+ "data-appearance": appearance
59
+ }, rest)));
60
60
  }, Subcomponents);
61
61
  Navbar.displayName = 'Navbar';
62
62
  export default Navbar;
@@ -3,7 +3,7 @@ import { BoxProps } from '../internals/Box';
3
3
  import type { PlacementCorners, WithAsProps } from '../internals/types';
4
4
  import type { IconProps } from '@rsuite/icons/Icon';
5
5
  export type NavbarDropdownTrigger = 'click' | 'hover' | 'contextMenu';
6
- export interface NavbarDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'onToggle' | 'title'> {
6
+ export interface NavbarDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'onToggle' | 'title' | 'color'> {
7
7
  /** Define the title as a submenu */
8
8
  title?: React.ReactNode;
9
9
  /** Set the icon */
@@ -65,15 +65,14 @@ const NavbarDropdown = forwardRef((props, ref) => {
65
65
  open,
66
66
  ...props
67
67
  }, containerRef) => {
68
- const classes = merge(className, withPrefix({
69
- disabled,
70
- open
71
- }));
68
+ const classes = merge(className, withPrefix());
72
69
  return /*#__PURE__*/React.createElement(Box, _extends({
73
70
  as: as,
74
71
  ref: mergeRefs(ref, containerRef),
75
72
  className: classes,
76
73
  style: style,
74
+ "data-open": open,
75
+ "data-disabled": disabled,
77
76
  "data-placement": kebabPlace(placement)
78
77
  }, props), /*#__PURE__*/React.createElement(Disclosure.Button, null, (buttonProps, buttonRef) => /*#__PURE__*/React.createElement(NavbarDropdownToggle, _extends({
79
78
  ref: buttonRef,
@@ -69,13 +69,13 @@ const NavbarDropdownItem = forwardRef((props, ref) => {
69
69
  });
70
70
  }
71
71
  const classes = merge(className, withPrefix({
72
- 'with-icon': icon,
73
- disabled,
74
72
  divider,
75
- panel,
76
- active: selected
73
+ panel
77
74
  }));
78
75
  const dataAttributes = {
76
+ 'data-active': selected,
77
+ 'data-with-icon': !!icon,
78
+ 'data-disabled': disabled,
79
79
  'data-event-key': eventKey
80
80
  };
81
81
  if (!isNil(eventKey) && typeof eventKey !== 'string') {
@@ -71,24 +71,21 @@ const NavbarDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
71
71
  open,
72
72
  ...props
73
73
  }, containerRef) => {
74
- const classes = mergeItemClassNames(className, withItemClassPrefix({
75
- disabled,
76
- open,
77
- submenu: true
78
- }));
74
+ const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
79
75
  return /*#__PURE__*/React.createElement("li", _extends({
80
76
  ref: mergeRefs(ref, containerRef),
81
- className: classes
77
+ className: classes,
78
+ "data-open": open,
79
+ "data-disabled": disabled
82
80
  }, props), /*#__PURE__*/React.createElement(Disclosure.Button, null, ({
83
81
  open,
84
82
  ...buttonProps
85
83
  }, buttonRef) => {
86
- const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix({
87
- 'with-icon': icon,
88
- open,
89
- disabled
90
- }));
84
+ const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
91
85
  const dataAttributes = {
86
+ 'data-open': open,
87
+ 'data-disabled': disabled,
88
+ 'data-with-icon': !!icon,
92
89
  'data-event-key': eventKey
93
90
  };
94
91
  if (!isNil(eventKey) && typeof eventKey !== 'string') {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../internals/Box';
3
3
  import type { SanitizedInputProps, FormControlBaseProps, AppearanceType, BasicSize } from '../internals/types';
4
- export interface NumberInputProps<T = number | string | null> extends Omit<SanitizedInputProps, 'value' | 'defaultValue' | 'prefix'>, BoxProps, FormControlBaseProps<T> {
4
+ export interface NumberInputProps<T = number | string | null> extends Omit<SanitizedInputProps, 'value' | 'defaultValue' | 'prefix'>, Omit<BoxProps, 'height' | 'width'>, FormControlBaseProps<T> {
5
5
  /**
6
6
  * Button can have different appearances
7
7
  */
@@ -183,11 +183,12 @@ const Pagination = forwardRef((props, ref) => {
183
183
  }, last === true ? icons.last : last)
184
184
  });
185
185
  };
186
- const classes = merge(className, withPrefix(size));
186
+ const classes = merge(className, withPrefix());
187
187
  return /*#__PURE__*/React.createElement(Box, _extends({
188
188
  as: as,
189
189
  ref: ref,
190
- className: classes
190
+ className: classes,
191
+ "data-size": size
191
192
  }, rest), renderFirst(), renderPrev(), renderPageButtons(), renderNext(), renderLast());
192
193
  });
193
194
  Pagination.displayName = 'Pagination';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import type { WithAsProps, HTMLPropsWithoutSelect } from '../internals/types';
3
- export interface PaginationButtonProps<T = number | string> extends WithAsProps, HTMLPropsWithoutSelect<HTMLButtonElement, React.ButtonHTMLAttributes<HTMLButtonElement>> {
2
+ import { ButtonProps } from '../Button';
3
+ export interface PaginationButtonProps<T = number | string> extends Omit<ButtonProps, 'onSelect'> {
4
4
  /** The value of the current option */
5
5
  eventKey: T;
6
6
  /** A button can show it is currently unable to be interacted with */
@@ -18,5 +18,5 @@ export interface PaginationButtonProps<T = number | string> extends WithAsProps,
18
18
  * PaginationButton component for pagination navigation.
19
19
  * Renders a button that can be used in pagination contexts.
20
20
  */
21
- declare const PaginationButton: import("../internals/types").InternalRefForwardingComponent<"button", PaginationButtonProps<string | number>, never> & Record<string, never>;
21
+ declare const PaginationButton: import("../internals/types").InternalRefForwardingComponent<import("../internals/types").InternalRefForwardingComponent<"button", ButtonProps, never> & Record<string, never>, PaginationButtonProps<string | number>, never> & Record<string, never>;
22
22
  export default PaginationButton;
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import React, { useMemo } from 'react';
3
+ import React from 'react';
4
4
  import Button from "../Button/index.js";
5
5
  import { useStyles, useEventCallback } from "../internals/hooks/index.js";
6
6
  import { forwardRef } from "../internals/utils/index.js";
@@ -10,7 +10,7 @@ import { forwardRef } from "../internals/utils/index.js";
10
10
  */
11
11
  const PaginationButton = forwardRef((props, ref) => {
12
12
  const {
13
- as: Component = Button,
13
+ as,
14
14
  active,
15
15
  disabled,
16
16
  className,
@@ -25,10 +25,7 @@ const PaginationButton = forwardRef((props, ref) => {
25
25
  merge,
26
26
  withPrefix
27
27
  } = useStyles(classPrefix);
28
- const classes = merge(className, withPrefix({
29
- active,
30
- disabled
31
- }));
28
+ const classes = merge(className, withPrefix());
32
29
  const handleClick = useEventCallback(event => {
33
30
  if (disabled) {
34
31
  return;
@@ -40,21 +37,17 @@ const PaginationButton = forwardRef((props, ref) => {
40
37
  onSelect(eventKey, event);
41
38
  }
42
39
  });
43
-
44
- // Determine props to pass based on component type
45
- const asProps = useMemo(() => Component !== Button && typeof Component !== 'string' ? {
46
- eventKey,
47
- active,
48
- role: 'button'
49
- } : {}, [Component, eventKey, active]);
50
- return /*#__PURE__*/React.createElement(Component, _extends({}, rest, asProps, {
40
+ return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
41
+ as: as,
51
42
  disabled: disabled,
52
43
  onClick: handleClick,
53
44
  ref: ref,
54
45
  className: classes,
55
- role: "button",
46
+ appearance: "subtle",
56
47
  "aria-disabled": disabled,
57
- "aria-current": active ? 'page' : undefined
48
+ "aria-current": active ? 'page' : undefined,
49
+ active: active,
50
+ "data-event-key": eventKey
58
51
  }), children);
59
52
  });
60
53
  PaginationButton.displayName = 'PaginationButton';
@@ -53,7 +53,7 @@ const PaginationGroup = forwardRef((props, ref) => {
53
53
  const [limit, setLimit] = useControlled(limitProp, 30);
54
54
  const [activePage, setActivePage] = useControlled(activePageProp, 1);
55
55
  const pages = Math.floor(total / limit) + (total % limit ? 1 : 0);
56
- const classes = merge(className, withPrefix(size));
56
+ const classes = merge(className, withPrefix());
57
57
  const {
58
58
  getLocale
59
59
  } = useCustom();
@@ -78,6 +78,7 @@ const PaginationGroup = forwardRef((props, ref) => {
78
78
  as: as,
79
79
  ref: ref,
80
80
  className: classes,
81
+ "data-size": size,
81
82
  style: style
82
83
  }, layout.map((key, index) => {
83
84
  const onlyKey = `${key}${index}`;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../internals/Box';
3
- export interface PanelHeaderProps extends BoxProps, React.HTMLAttributes<HTMLHeadingElement> {
3
+ export interface PanelHeaderProps extends BoxProps, Omit<React.HTMLAttributes<HTMLHeadingElement>, 'color'> {
4
4
  caretAs?: React.ElementType;
5
5
  collapsible?: boolean;
6
6
  disabled?: boolean;
@@ -51,11 +51,7 @@ const Radio = forwardRef((props, ref) => {
51
51
  withPrefix,
52
52
  prefix
53
53
  } = useStyles(classPrefix);
54
- const classes = merge(className, withPrefix(color, {
55
- inline,
56
- disabled,
57
- checked
58
- }));
54
+ const classes = merge(className, withPrefix());
59
55
  const [htmlInputProps, restProps] = partitionHTMLProps(rest);
60
56
  const handleChange = useEventCallback(event => {
61
57
  if (disabled || readOnly) {
@@ -100,7 +96,11 @@ const Radio = forwardRef((props, ref) => {
100
96
  as: as,
101
97
  ref: ref,
102
98
  onClick: onClick,
103
- className: classes
99
+ className: classes,
100
+ "data-color": color,
101
+ "data-checked": checked,
102
+ "data-disabled": disabled,
103
+ "data-inline": inline
104
104
  }, restProps), /*#__PURE__*/React.createElement("div", {
105
105
  className: prefix`checker`
106
106
  }, children ? /*#__PURE__*/React.createElement("label", {
@@ -35,9 +35,7 @@ const RadioGroup = forwardRef((props, ref) => {
35
35
  merge,
36
36
  withPrefix
37
37
  } = useStyles(classPrefix);
38
- const classes = merge(className, withPrefix(appearance, {
39
- inline
40
- }));
38
+ const classes = merge(className, withPrefix());
41
39
  const [value, setValue, isControlled] = useControlled(valueProp, defaultValue);
42
40
  const handleChange = useEventCallback((nextValue, event) => {
43
41
  setValue(nextValue);
@@ -63,7 +61,9 @@ const RadioGroup = forwardRef((props, ref) => {
63
61
  role: "radiogroup"
64
62
  }, rest, {
65
63
  ref: ref,
66
- className: classes
64
+ className: classes,
65
+ "data-inline": inline,
66
+ "data-appearance": appearance
67
67
  }), children));
68
68
  });
69
69
  RadioGroup.displayName = 'RadioGroup';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BoxProps } from '../internals/Box';
3
3
  import type { PlacementCorners } from '../internals/types';
4
4
  import type { IconProps } from '@rsuite/icons/Icon';
5
- export interface SidenavDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title'> {
5
+ export interface SidenavDropdownProps<T = any> extends BoxProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title' | 'color'> {
6
6
  /** Define the title as a submenu */
7
7
  title?: React.ReactNode;
8
8
  /** Set the icon */
@@ -48,7 +48,7 @@ const Sidenav = forwardRef((props, ref) => {
48
48
  merge,
49
49
  withPrefix
50
50
  } = useStyles(classPrefix);
51
- const classes = merge(className, withPrefix(appearance));
51
+ const classes = merge(className, withPrefix());
52
52
  const handleOpenChange = useCallback((eventKey, event) => {
53
53
  const find = key => shallowEqual(key, eventKey);
54
54
  const nextOpenKeys = [...openKeys];
@@ -86,7 +86,8 @@ const Sidenav = forwardRef((props, ref) => {
86
86
  as: as
87
87
  }, rest, transitionRest, {
88
88
  ref: mergeRefs(ref, transitionRef),
89
- className: merge(classes, className)
89
+ className: merge(classes, className),
90
+ "data-appearance": appearance
90
91
  }));
91
92
  }));
92
93
  }, Subcomponents);
@@ -146,16 +146,14 @@ const SidenavDropdown = forwardRef((props, ref) => {
146
146
  open,
147
147
  ...menuContainer
148
148
  }, menuContainerRef) => {
149
- const classes = merge(className, withPrefix({
150
- disabled,
151
- open,
152
- submenu: true
153
- }));
149
+ const classes = merge(className, withPrefix('submenu'));
154
150
  return /*#__PURE__*/React.createElement(Box, _extends({
155
151
  as: as,
156
152
  ref: mergeRefs(ref, menuContainerRef),
157
153
  className: classes,
158
154
  style: style,
155
+ "data-open": open,
156
+ "data-disabled": disabled,
159
157
  "data-placement": kebabPlace(placement),
160
158
  "data-active-descendant": hasSelectedItems
161
159
  }, menuContainer, pick(toggleProps, ['data-testid'])));
@@ -85,14 +85,14 @@ const SidenavDropdownItem = forwardRef((props, ref) => {
85
85
  ...menuitem
86
86
  }, menuitemRef) => {
87
87
  const classes = merge(className, withPrefix({
88
- 'with-icon': icon,
89
- active: selected,
90
- disabled,
91
- focus: active,
92
88
  divider,
93
89
  panel
94
90
  }));
95
91
  const dataAttributes = {
92
+ 'data-active': selected,
93
+ 'data-disabled': disabled,
94
+ 'data-focus': active,
95
+ 'data-with-icon': !!icon,
96
96
  'data-event-key': eventKey
97
97
  };
98
98
  if (!isNil(eventKey) && typeof eventKey !== 'string') {
@@ -82,16 +82,15 @@ const SidenavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
82
82
  active,
83
83
  ...menuitem
84
84
  }, menuitemRef) => {
85
- const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix({
86
- 'with-icon': icon,
87
- open,
88
- active: selected,
89
- disabled,
90
- focus: active
91
- }));
85
+ const classes = mergeItemClassNames(className, prefixItemClassName`toggle`, withItemClassPrefix());
92
86
  return /*#__PURE__*/React.createElement("div", _extends({
93
87
  ref: mergeRefs(buttonRef, menuitemRef),
94
88
  className: classes,
89
+ "data-open": open,
90
+ "data-disabled": disabled,
91
+ "data-active": selected,
92
+ "data-focus": active,
93
+ "data-with-icon": icon,
95
94
  "data-event-key": eventKey,
96
95
  "data-event-key-type": typeof eventKey
97
96
  }, menuitem, omit(menuButtonProps, ['role'])), icon && /*#__PURE__*/React.cloneElement(icon, {
@@ -116,14 +115,12 @@ const SidenavDropdownMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
116
115
  open,
117
116
  ...menuContainer
118
117
  }, menuContainerRef) => {
119
- const classes = mergeItemClassNames(className, withItemClassPrefix({
120
- disabled,
121
- open,
122
- submenu: true
123
- }));
118
+ const classes = mergeItemClassNames(className, withItemClassPrefix('submenu'));
124
119
  return /*#__PURE__*/React.createElement("li", _extends({
125
120
  ref: mergeRefs(ref, menuContainerRef),
126
- className: classes
121
+ className: classes,
122
+ "data-open": open,
123
+ "data-disabled": disabled
127
124
  }, menuContainer));
128
125
  });
129
126
  });
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { BoxProps } from '../internals/Box';
2
+ import { BaseBoxProps } from '../internals/Box';
3
3
  import type { HTMLPropsWithoutSelect } from '../internals/types';
4
4
  import type { IconProps } from '@rsuite/icons/Icon';
5
5
  /**
6
6
  * Props of SidenavItem component
7
7
  */
8
- export interface SidenavItemProps<T = any> extends BoxProps, HTMLPropsWithoutSelect {
8
+ export interface SidenavItemProps<T = any> extends BaseBoxProps, HTMLPropsWithoutSelect {
9
9
  /**
10
10
  * Whether the item is activated
11
11
  */
@@ -86,11 +86,7 @@ const SidenavItem = forwardRef((props, ref) => {
86
86
  active,
87
87
  ...menuitem
88
88
  }, menuitemRef) => {
89
- const classes = merge(className, withPrefix({
90
- focus: active,
91
- active: selected,
92
- disabled
93
- }));
89
+ const classes = merge(className, withPrefix());
94
90
 
95
91
  // Show tooltip when inside a collapse <Sidenav>
96
92
  return /*#__PURE__*/React.createElement(Box, _extends({
@@ -98,6 +94,9 @@ const SidenavItem = forwardRef((props, ref) => {
98
94
  ref: mergeRefs(mergeRefs(ref, menuitemRef), triggerRef),
99
95
  disabled: as === SafeAnchor ? disabled : undefined,
100
96
  className: classes,
97
+ "data-active": selected,
98
+ "data-disabled": disabled,
99
+ "data-focus": active,
101
100
  "data-event-key": eventKey
102
101
  }, omit(rest, ['divider', 'panel']), triggerProps, menuitem, {
103
102
  onMouseOver: createChainedFunction(menuitem.onMouseOver, triggerProps.onMouseOver),
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { BoxProps } from '../internals/Box';
3
- export interface HandleProps extends BoxProps, React.HTMLAttributes<HTMLDivElement> {
3
+ export interface HandleProps extends Omit<BoxProps, 'color' | 'position' | 'height' | 'width'>, React.HTMLAttributes<HTMLDivElement> {
4
4
  disabled?: boolean;
5
5
  vertical?: boolean;
6
6
  tooltip?: boolean;
@@ -1,25 +1,9 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import { BoxProps } from '../internals/Box';
3
3
  import type { WithResponsive } from '../internals/types';
4
- interface DeprecatedStackProps {
5
- /**
6
- * Define the alignment of the children in the stack on the inline axis
7
- * @deprecated Use `justify` instead
8
- */
9
- justifyContent?: CSSProperties['justifyContent'];
10
- /**
11
- * Define the alignment of the children in the stack on the cross axis
12
- * @deprecated Use `align` instead
13
- */
14
- alignItems?: CSSProperties['alignItems'];
15
- }
16
- export interface StackProps extends BoxProps, DeprecatedStackProps {
17
- /** Define the alignment of the children in the stack on the cross axis */
18
- align?: CSSProperties['alignItems'];
4
+ export interface StackProps extends BoxProps {
19
5
  /** The direction of the children in the stack */
20
6
  direction?: WithResponsive<CSSProperties['flexDirection']>;
21
- /** Define the alignment of the children in the stack on the inline axis */
22
- justify?: CSSProperties['justifyContent'];
23
7
  /** Add an element between each child */
24
8
  divider?: React.ReactNode;
25
9
  /** Define whether the children in the stack are forced onto one line or can wrap onto multiple lines */
@@ -34,15 +34,14 @@ const Stack = forwardRef((props, ref) => {
34
34
  merge,
35
35
  responsive
36
36
  } = useStyles(classPrefix);
37
- const baseClasses = merge(className, withPrefix({
38
- wrap
39
- }), ...responsive(direction));
37
+ const baseClasses = merge(className, withPrefix(), ...responsive(direction));
40
38
  const filteredChildren = React.Children.toArray(children);
41
39
  const childCount = filteredChildren.length;
42
40
  return /*#__PURE__*/React.createElement(Box, _extends({
43
41
  as: as,
44
42
  ref: ref,
45
- className: baseClasses
43
+ className: baseClasses,
44
+ "data-wrap": wrap
46
45
  }, rest), filteredChildren.map((child, index) => /*#__PURE__*/React.createElement(React.Fragment, {
47
46
  key: index
48
47
  }, child, index < childCount - 1 && divider)));
@@ -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.
@@ -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, mergeStyles } from "../internals/utils/index.js";
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
- flex,
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
- style: styles
30
+ self: self,
31
+ paddingTop: 0
38
32
  }, rest));
39
33
  });
40
34
  StackItem.displayName = 'StackItem';