rsuite 6.0.0-canary-20241227 → 6.0.0-canary-20250103

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 (313) hide show
  1. package/AutoComplete/styles/index.css +8 -16
  2. package/Badge/styles/index.css +83 -17
  3. package/Badge/styles/index.less +68 -9
  4. package/Button/styles/index.css +5 -10
  5. package/Button/styles/mixin.less +1 -2
  6. package/CHANGELOG.md +18 -0
  7. package/Calendar/styles/index.css +6 -12
  8. package/Cascader/styles/index.css +8 -16
  9. package/CheckPicker/styles/index.css +8 -16
  10. package/CheckTree/styles/index.css +8 -16
  11. package/CheckTreePicker/styles/index.css +8 -16
  12. package/DatePicker/styles/index.css +9 -18
  13. package/DateRangePicker/styles/index.css +9 -18
  14. package/Dropdown/styles/index.css +5 -10
  15. package/IconButton/styles/index.css +7 -14
  16. package/InputGroup/styles/index.css +6 -12
  17. package/InputNumber/styles/index.css +6 -12
  18. package/InputPicker/styles/index.css +8 -16
  19. package/MultiCascadeTree/styles/index.css +8 -16
  20. package/MultiCascader/styles/index.css +8 -16
  21. package/Nav/styles/index.css +5 -10
  22. package/Navbar/styles/index.css +5 -10
  23. package/Pagination/styles/index.css +11 -22
  24. package/Rate/styles/index.css +16 -8
  25. package/Rate/styles/index.less +6 -2
  26. package/SelectPicker/styles/index.css +8 -16
  27. package/Stat/styles/index.css +7 -14
  28. package/Table/styles/index.css +2 -2
  29. package/Tabs/styles/index.css +5 -10
  30. package/Tag/styles/index.css +29 -21
  31. package/Tag/styles/index.less +6 -3
  32. package/TagInput/styles/index.css +8 -16
  33. package/TagPicker/styles/index.css +8 -16
  34. package/TimePicker/styles/index.css +9 -18
  35. package/TimeRangePicker/styles/index.css +9 -18
  36. package/Tree/styles/index.css +8 -16
  37. package/TreePicker/styles/index.css +8 -16
  38. package/Uploader/styles/index.css +7 -14
  39. package/cjs/Accordion/Accordion.js +1 -1
  40. package/cjs/AutoComplete/AutoComplete.d.ts +2 -2
  41. package/cjs/AutoComplete/Combobox.js +1 -1
  42. package/cjs/Badge/Badge.d.ts +40 -5
  43. package/cjs/Badge/Badge.js +30 -19
  44. package/cjs/Breadcrumb/Breadcrumb.js +1 -1
  45. package/cjs/Button/Button.d.ts +5 -1
  46. package/cjs/Button/Button.js +17 -3
  47. package/cjs/Card/Card.js +1 -1
  48. package/cjs/CascadeTree/utils.js +1 -1
  49. package/cjs/CustomProvider/CustomProvider.d.ts +12 -4
  50. package/cjs/CustomProvider/CustomProvider.js +4 -3
  51. package/cjs/DateInput/hooks/useDateInputState.js +10 -8
  52. package/cjs/DateInput/hooks/useKeyboardInputEvent.js +1 -0
  53. package/cjs/DatePicker/PredefinedRanges.js +1 -1
  54. package/cjs/DateRangePicker/DateRangePicker.js +1 -1
  55. package/cjs/Drawer/Drawer.d.ts +2 -2
  56. package/cjs/Drawer/Drawer.js +1 -1
  57. package/cjs/Drawer/DrawerBody.js +7 -5
  58. package/cjs/Drawer/DrawerFooter.js +7 -5
  59. package/cjs/Drawer/DrawerHeader.js +7 -5
  60. package/cjs/Drawer/DrawerTitle.js +7 -5
  61. package/cjs/Dropdown/Dropdown.d.ts +2 -2
  62. package/cjs/Dropdown/Dropdown.js +1 -1
  63. package/cjs/Dropdown/DropdownContext.d.ts +1 -1
  64. package/cjs/Dropdown/DropdownMenu.d.ts +2 -2
  65. package/cjs/Dropdown/DropdownToggle.d.ts +2 -2
  66. package/cjs/FlexboxGrid/FlexboxGrid.js +1 -1
  67. package/cjs/Form/Form.js +1 -1
  68. package/cjs/FormControl/FormControl.d.ts +2 -2
  69. package/cjs/FormErrorMessage/FormErrorMessage.d.ts +2 -2
  70. package/cjs/InlineEdit/EditableControls.js +1 -1
  71. package/cjs/InputGroup/InputGroup.js +1 -1
  72. package/cjs/InputNumber/InputNumber.js +1 -1
  73. package/cjs/InputPicker/InputPicker.js +0 -1
  74. package/cjs/InputPicker/TagList.js +1 -0
  75. package/cjs/InputPicker/TextBox.js +1 -0
  76. package/cjs/InputPicker/hooks/useMaxWidth.js +0 -1
  77. package/cjs/List/List.js +1 -1
  78. package/cjs/MaskedInput/MaskedInput.js +1 -0
  79. package/cjs/MaskedInput/conformToMask.js +0 -1
  80. package/cjs/Modal/Modal.js +1 -1
  81. package/cjs/Modal/utils.js +0 -1
  82. package/cjs/Nav/Nav.js +1 -1
  83. package/cjs/Nav/NavDropdown.d.ts +2 -2
  84. package/cjs/Nav/NavDropdown.js +1 -1
  85. package/cjs/Nav/NavDropdownToggle.d.ts +2 -2
  86. package/cjs/Navbar/Navbar.js +1 -1
  87. package/cjs/Navbar/NavbarDropdown.d.ts +2 -2
  88. package/cjs/Navbar/NavbarDropdown.js +1 -1
  89. package/cjs/Navbar/NavbarDropdownToggle.d.ts +2 -2
  90. package/cjs/Navbar/index.js +0 -0
  91. package/cjs/RangeSlider/RangeSlider.js +4 -4
  92. package/cjs/Rate/Character.js +6 -6
  93. package/cjs/Rate/Rate.d.ts +4 -4
  94. package/cjs/Rate/Rate.js +16 -15
  95. package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
  96. package/cjs/Sidenav/Sidenav.js +1 -1
  97. package/cjs/Sidenav/SidenavDropdown.d.ts +2 -2
  98. package/cjs/Sidenav/SidenavDropdown.js +1 -1
  99. package/cjs/Sidenav/SidenavDropdownToggle.d.ts +2 -2
  100. package/cjs/Stack/HStack.js +1 -1
  101. package/cjs/Stack/Stack.js +1 -1
  102. package/cjs/Stack/VStack.js +1 -1
  103. package/cjs/Stat/Stat.js +1 -1
  104. package/cjs/Steps/Steps.js +1 -1
  105. package/cjs/Table/Table.js +2 -2
  106. package/cjs/Tabs/Tabs.js +8 -9
  107. package/cjs/Tag/Tag.d.ts +2 -2
  108. package/cjs/Tag/Tag.js +12 -6
  109. package/cjs/Timeline/Timeline.js +8 -5
  110. package/cjs/Tooltip/Tooltip.d.ts +2 -2
  111. package/cjs/Tree/hooks/useFlattenTree.js +1 -3
  112. package/cjs/Tree/hooks/useFocusTree.js +0 -1
  113. package/cjs/Tree/hooks/useTreeSearch.js +0 -1
  114. package/cjs/Uploader/UploadTrigger.js +13 -28
  115. package/cjs/Uploader/utils/ajaxUpload.js +1 -1
  116. package/cjs/internals/Disclosure/Disclosure.js +1 -0
  117. package/cjs/internals/Menu/useMenu.js +51 -49
  118. package/cjs/internals/Overlay/Overlay.d.ts +2 -2
  119. package/cjs/internals/Overlay/OverlayTrigger.d.ts +2 -2
  120. package/cjs/internals/Overlay/Position.d.ts +2 -2
  121. package/cjs/internals/Overlay/positionUtils.d.ts +2 -2
  122. package/cjs/internals/Picker/PickerToggle.d.ts +2 -2
  123. package/cjs/internals/Picker/PickerToggleTrigger.d.ts +2 -2
  124. package/cjs/internals/Picker/hooks/useFocusItemValue.js +1 -1
  125. package/cjs/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
  126. package/cjs/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
  127. package/cjs/internals/Tree/TreeView.js +2 -1
  128. package/cjs/internals/Tree/utils/getPathTowardsItem.js +1 -1
  129. package/cjs/internals/Windowing/AutoSizer.js +1 -0
  130. package/cjs/internals/Windowing/List.js +2 -1
  131. package/cjs/internals/hooks/useClassNames.d.ts +1 -2
  132. package/cjs/internals/hooks/useClassNames.js +0 -2
  133. package/cjs/internals/hooks/usePortal.js +1 -1
  134. package/cjs/internals/hooks/useToggleCaret.d.ts +2 -2
  135. package/cjs/internals/hooks/useToggleCaret.js +1 -1
  136. package/cjs/internals/hooks/useUpdateEffect.js +0 -1
  137. package/cjs/internals/hooks/useWillUnmount.js +0 -2
  138. package/cjs/internals/symbols.d.ts +1 -0
  139. package/cjs/internals/symbols.js +3 -2
  140. package/cjs/internals/types/colours.d.ts +10 -0
  141. package/cjs/internals/types/colours.js +15 -0
  142. package/cjs/internals/types/index.d.ts +6 -7
  143. package/cjs/internals/types/index.js +13 -1
  144. package/cjs/internals/types/placement.d.ts +5 -0
  145. package/cjs/internals/types/placement.js +4 -0
  146. package/cjs/internals/utils/BrowserDetection.d.ts +0 -2
  147. package/cjs/internals/utils/BrowserDetection.js +2 -12
  148. package/cjs/internals/utils/ReactChildren.js +0 -2
  149. package/cjs/internals/utils/colours.d.ts +21 -0
  150. package/cjs/internals/utils/colours.js +86 -0
  151. package/cjs/internals/utils/css.d.ts +13 -1
  152. package/cjs/internals/utils/css.js +42 -3
  153. package/cjs/internals/utils/getDOMNode.js +2 -2
  154. package/cjs/internals/utils/getSafeRegExpString.js +2 -1
  155. package/cjs/internals/utils/index.d.ts +2 -2
  156. package/cjs/internals/utils/index.js +17 -9
  157. package/cjs/toaster/ToastContainer.d.ts +8 -8
  158. package/cjs/toaster/ToastContainer.js +39 -36
  159. package/cjs/toaster/render.d.ts +2 -0
  160. package/cjs/toaster/render.js +25 -0
  161. package/cjs/toaster/toaster.js +29 -19
  162. package/cjs/useMediaQuery/useMediaQuery.js +1 -3
  163. package/cjs/useToaster/useToaster.js +10 -5
  164. package/dist/rsuite-no-reset-rtl.css +143 -74
  165. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  166. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  167. package/dist/rsuite-no-reset.css +143 -74
  168. package/dist/rsuite-no-reset.min.css +1 -1
  169. package/dist/rsuite-no-reset.min.css.map +1 -1
  170. package/dist/rsuite-rtl.css +143 -74
  171. package/dist/rsuite-rtl.min.css +1 -1
  172. package/dist/rsuite-rtl.min.css.map +1 -1
  173. package/dist/rsuite.css +143 -74
  174. package/dist/rsuite.js +113 -91
  175. package/dist/rsuite.js.map +1 -1
  176. package/dist/rsuite.min.css +1 -1
  177. package/dist/rsuite.min.css.map +1 -1
  178. package/dist/rsuite.min.js +1 -1
  179. package/dist/rsuite.min.js.map +1 -1
  180. package/esm/Accordion/Accordion.js +1 -1
  181. package/esm/AutoComplete/AutoComplete.d.ts +2 -2
  182. package/esm/AutoComplete/Combobox.js +1 -1
  183. package/esm/Badge/Badge.d.ts +40 -5
  184. package/esm/Badge/Badge.js +28 -19
  185. package/esm/Breadcrumb/Breadcrumb.js +1 -1
  186. package/esm/Button/Button.d.ts +5 -1
  187. package/esm/Button/Button.js +18 -4
  188. package/esm/Card/Card.js +1 -1
  189. package/esm/CascadeTree/utils.js +1 -1
  190. package/esm/CustomProvider/CustomProvider.d.ts +12 -4
  191. package/esm/CustomProvider/CustomProvider.js +5 -4
  192. package/esm/DateInput/hooks/useDateInputState.js +10 -8
  193. package/esm/DateInput/hooks/useKeyboardInputEvent.js +1 -0
  194. package/esm/DatePicker/PredefinedRanges.js +1 -1
  195. package/esm/DateRangePicker/DateRangePicker.js +1 -1
  196. package/esm/Drawer/Drawer.d.ts +2 -2
  197. package/esm/Drawer/Drawer.js +1 -1
  198. package/esm/Drawer/DrawerBody.js +7 -5
  199. package/esm/Drawer/DrawerFooter.js +7 -5
  200. package/esm/Drawer/DrawerHeader.js +7 -5
  201. package/esm/Drawer/DrawerTitle.js +7 -5
  202. package/esm/Dropdown/Dropdown.d.ts +2 -2
  203. package/esm/Dropdown/Dropdown.js +1 -1
  204. package/esm/Dropdown/DropdownContext.d.ts +1 -1
  205. package/esm/Dropdown/DropdownMenu.d.ts +2 -2
  206. package/esm/Dropdown/DropdownToggle.d.ts +2 -2
  207. package/esm/FlexboxGrid/FlexboxGrid.js +1 -1
  208. package/esm/Form/Form.js +1 -1
  209. package/esm/FormControl/FormControl.d.ts +2 -2
  210. package/esm/FormErrorMessage/FormErrorMessage.d.ts +2 -2
  211. package/esm/InlineEdit/EditableControls.js +1 -1
  212. package/esm/InputGroup/InputGroup.js +1 -1
  213. package/esm/InputNumber/InputNumber.js +1 -1
  214. package/esm/InputPicker/InputPicker.js +0 -1
  215. package/esm/InputPicker/TagList.js +1 -0
  216. package/esm/InputPicker/TextBox.js +1 -0
  217. package/esm/InputPicker/hooks/useMaxWidth.js +0 -1
  218. package/esm/List/List.js +1 -1
  219. package/esm/MaskedInput/MaskedInput.js +1 -0
  220. package/esm/MaskedInput/conformToMask.js +0 -1
  221. package/esm/Modal/Modal.js +1 -1
  222. package/esm/Modal/utils.js +0 -1
  223. package/esm/Nav/Nav.js +1 -1
  224. package/esm/Nav/NavDropdown.d.ts +2 -2
  225. package/esm/Nav/NavDropdown.js +1 -1
  226. package/esm/Nav/NavDropdownToggle.d.ts +2 -2
  227. package/esm/Navbar/Navbar.js +1 -1
  228. package/esm/Navbar/NavbarDropdown.d.ts +2 -2
  229. package/esm/Navbar/NavbarDropdown.js +1 -1
  230. package/esm/Navbar/NavbarDropdownToggle.d.ts +2 -2
  231. package/esm/Navbar/index.js +0 -0
  232. package/esm/RangeSlider/RangeSlider.js +4 -4
  233. package/esm/Rate/Character.js +8 -8
  234. package/esm/Rate/Rate.d.ts +4 -4
  235. package/esm/Rate/Rate.js +19 -18
  236. package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +2 -2
  237. package/esm/Sidenav/Sidenav.js +1 -1
  238. package/esm/Sidenav/SidenavDropdown.d.ts +2 -2
  239. package/esm/Sidenav/SidenavDropdown.js +1 -1
  240. package/esm/Sidenav/SidenavDropdownToggle.d.ts +2 -2
  241. package/esm/Stack/HStack.js +1 -1
  242. package/esm/Stack/Stack.js +1 -1
  243. package/esm/Stack/VStack.js +1 -1
  244. package/esm/Stat/Stat.js +1 -1
  245. package/esm/Steps/Steps.js +1 -1
  246. package/esm/Table/Table.js +2 -2
  247. package/esm/Tabs/Tabs.js +8 -9
  248. package/esm/Tag/Tag.d.ts +2 -2
  249. package/esm/Tag/Tag.js +10 -6
  250. package/esm/Timeline/Timeline.js +8 -5
  251. package/esm/Tooltip/Tooltip.d.ts +2 -2
  252. package/esm/Tree/hooks/useFlattenTree.js +1 -3
  253. package/esm/Tree/hooks/useFocusTree.js +0 -1
  254. package/esm/Tree/hooks/useTreeSearch.js +0 -1
  255. package/esm/Uploader/UploadTrigger.js +15 -30
  256. package/esm/Uploader/utils/ajaxUpload.js +1 -1
  257. package/esm/internals/Disclosure/Disclosure.js +1 -0
  258. package/esm/internals/Menu/useMenu.js +51 -49
  259. package/esm/internals/Overlay/Overlay.d.ts +2 -2
  260. package/esm/internals/Overlay/OverlayTrigger.d.ts +2 -2
  261. package/esm/internals/Overlay/Position.d.ts +2 -2
  262. package/esm/internals/Overlay/positionUtils.d.ts +2 -2
  263. package/esm/internals/Picker/PickerToggle.d.ts +2 -2
  264. package/esm/internals/Picker/PickerToggleTrigger.d.ts +2 -2
  265. package/esm/internals/Picker/hooks/useFocusItemValue.js +1 -1
  266. package/esm/internals/Picker/hooks/usePickerClassName.d.ts +2 -2
  267. package/esm/internals/ScrollView/hooks/useScrollState.d.ts +1 -1
  268. package/esm/internals/Tree/TreeView.js +2 -1
  269. package/esm/internals/Tree/utils/getPathTowardsItem.js +1 -1
  270. package/esm/internals/Windowing/AutoSizer.js +1 -0
  271. package/esm/internals/Windowing/List.js +2 -1
  272. package/esm/internals/hooks/useClassNames.d.ts +1 -2
  273. package/esm/internals/hooks/useClassNames.js +0 -2
  274. package/esm/internals/hooks/usePortal.js +1 -1
  275. package/esm/internals/hooks/useToggleCaret.d.ts +2 -2
  276. package/esm/internals/hooks/useToggleCaret.js +1 -1
  277. package/esm/internals/hooks/useUpdateEffect.js +0 -1
  278. package/esm/internals/hooks/useWillUnmount.js +0 -2
  279. package/esm/internals/symbols.d.ts +1 -0
  280. package/esm/internals/symbols.js +2 -1
  281. package/esm/internals/types/colours.d.ts +10 -0
  282. package/esm/internals/types/colours.js +11 -0
  283. package/esm/internals/types/index.d.ts +6 -7
  284. package/esm/internals/types/index.js +6 -0
  285. package/esm/internals/types/placement.d.ts +5 -0
  286. package/esm/internals/types/placement.js +2 -0
  287. package/esm/internals/utils/BrowserDetection.d.ts +0 -2
  288. package/esm/internals/utils/BrowserDetection.js +1 -9
  289. package/esm/internals/utils/ReactChildren.js +0 -2
  290. package/esm/internals/utils/colours.d.ts +21 -0
  291. package/esm/internals/utils/colours.js +77 -0
  292. package/esm/internals/utils/css.d.ts +13 -1
  293. package/esm/internals/utils/css.js +40 -3
  294. package/esm/internals/utils/getDOMNode.js +1 -2
  295. package/esm/internals/utils/getSafeRegExpString.js +2 -1
  296. package/esm/internals/utils/index.d.ts +2 -2
  297. package/esm/internals/utils/index.js +3 -3
  298. package/esm/toaster/ToastContainer.d.ts +8 -8
  299. package/esm/toaster/ToastContainer.js +39 -37
  300. package/esm/toaster/render.d.ts +2 -0
  301. package/esm/toaster/render.js +21 -0
  302. package/esm/toaster/toaster.js +27 -18
  303. package/esm/useMediaQuery/useMediaQuery.js +1 -3
  304. package/esm/useToaster/useToaster.js +10 -5
  305. package/package.json +1 -1
  306. package/styles/color-modes/dark.less +1 -0
  307. package/styles/color-modes/high-contrast.less +1 -0
  308. package/styles/color-modes/light.less +1 -0
  309. package/styles/variables.less +1 -1
  310. package/cjs/internals/utils/render.d.ts +0 -7
  311. package/cjs/internals/utils/render.js +0 -26
  312. package/esm/internals/utils/render.d.ts +0 -7
  313. package/esm/internals/utils/render.js +0 -22
@@ -5,7 +5,7 @@ import CheckIcon from '@rsuite/icons/Check';
5
5
  import CloseIcon from '@rsuite/icons/Close';
6
6
  import IconButton from "../IconButton/index.js";
7
7
  import Stack from "../Stack/index.js";
8
- const EditableControls = /*#__PURE__*/React.forwardRef((props, ref) => {
8
+ const EditableControls = /*#__PURE__*/React.forwardRef(function EditableControls(props, ref) {
9
9
  const {
10
10
  onSave,
11
11
  onCancel,
@@ -10,7 +10,7 @@ export const InputGroupContext = /*#__PURE__*/React.createContext(null);
10
10
  * The `InputGroup` component is used to specify an input field with an add-on.
11
11
  * @see https://rsuitejs.com/components/input/#input-group
12
12
  */
13
- const InputGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
13
+ const InputGroup = /*#__PURE__*/React.forwardRef(function InputGroup(props, ref) {
14
14
  const {
15
15
  propsWithDefaults
16
16
  } = useCustom('InputGroup', props);
@@ -193,7 +193,7 @@ const InputNumber = /*#__PURE__*/React.forwardRef((props, ref) => {
193
193
  });
194
194
  const handleChange = useEventCallback((value, event) => {
195
195
  const separator = decimalSeparator || '.';
196
- const escapedSeparator = separator.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
196
+ const escapedSeparator = separator.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
197
197
  const regex = new RegExp(`^-?(?:\\d+)?(${escapedSeparator})?\\d*$`);
198
198
  if (!regex.test(value) && value !== '') {
199
199
  return;
@@ -186,7 +186,6 @@ const InputPicker = /*#__PURE__*/React.forwardRef((props, ref) => {
186
186
  useEffect(() => {
187
187
  var _triggerRef$current2, _triggerRef$current2$;
188
188
  (_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 || (_triggerRef$current2$ = _triggerRef$current2.updatePosition) === null || _triggerRef$current2$ === void 0 || _triggerRef$current2$.call(_triggerRef$current2);
189
- // eslint-disable-next-line react-hooks/exhaustive-deps
190
189
  }, [searchKeyword, value]);
191
190
  const getDataItem = value => {
192
191
  // Find active `MenuItem` by `value`
@@ -21,4 +21,5 @@ const TagList = /*#__PURE__*/React.forwardRef((props, ref) => {
21
21
  className: prefix`tag-list`
22
22
  }, rest), children);
23
23
  });
24
+ TagList.displayName = 'TagList';
24
25
  export default TagList;
@@ -39,4 +39,5 @@ const TextBox = /*#__PURE__*/React.forwardRef((props, ref) => {
39
39
  value: inputValue
40
40
  })));
41
41
  });
42
+ TextBox.displayName = 'TextBox';
42
43
  export default TextBox;
@@ -10,7 +10,6 @@ function useMaxWidth(triggerRef) {
10
10
  var _triggerRef$current2;
11
11
  setMaxWidth(getWidth((_triggerRef$current2 = triggerRef.current) === null || _triggerRef$current2 === void 0 ? void 0 : _triggerRef$current2.root));
12
12
  }
13
- // eslint-disable-next-line react-hooks/exhaustive-deps
14
13
  }, []);
15
14
  return maxWidth;
16
15
  }
package/esm/List/List.js CHANGED
@@ -11,7 +11,7 @@ import { useCustom } from "../CustomProvider/index.js";
11
11
  * The `List` component is used to specify the layout of the list.
12
12
  * @see https://rsuitejs.com/components/list
13
13
  */
14
- const List = /*#__PURE__*/React.forwardRef((props, ref) => {
14
+ const List = /*#__PURE__*/React.forwardRef(function List(props, ref) {
15
15
  const {
16
16
  propsWithDefaults
17
17
  } = useCustom('List', props);
@@ -16,4 +16,5 @@ const MaskedInput = /*#__PURE__*/React.forwardRef((props, ref) => {
16
16
  ref: ref
17
17
  }));
18
18
  });
19
+ MaskedInput.displayName = 'MaskedInput';
19
20
  export default MaskedInput;
@@ -127,7 +127,6 @@ export default function conformToMask(rawValue, mask, config) {
127
127
  // or we find at least one character that we can map.
128
128
  while (rawValueArr.length > 0) {
129
129
  // Let's retrieve the first user character in the queue of characters we have left
130
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
131
130
  const {
132
131
  char: rawValueChar,
133
132
  isNew
@@ -21,7 +21,7 @@ const modalSizes = ['xs', 'sm', 'md', 'lg', 'full'];
21
21
  * The `Modal` component is used to show content in a layer above the app.
22
22
  * @see https://rsuitejs.com/components/modal
23
23
  */
24
- const Modal = /*#__PURE__*/React.forwardRef((props, ref) => {
24
+ const Modal = /*#__PURE__*/React.forwardRef(function Modal(props, ref) {
25
25
  const {
26
26
  propsWithDefaults
27
27
  } = useCustom('Modal', props);
@@ -64,7 +64,6 @@ export const useBodyStyles = (ref, options) => {
64
64
  }, [overflow, prefix, ref, size, updateBodyStyles]);
65
65
  useEffect(() => {
66
66
  return onDestroyEvents;
67
- // eslint-disable-next-line react-hooks/exhaustive-deps
68
67
  }, []);
69
68
  return [overflow ? bodyStyles : null, onChangeBodyStyles, onDestroyEvents];
70
69
  };
package/esm/Nav/Nav.js CHANGED
@@ -17,7 +17,7 @@ import { useCustom } from "../CustomProvider/index.js";
17
17
  * The `Nav` component is used to create navigation links.
18
18
  * @see https://rsuitejs.com/components/nav
19
19
  */
20
- const Nav = /*#__PURE__*/React.forwardRef((props, ref) => {
20
+ const Nav = /*#__PURE__*/React.forwardRef(function Nav(props, ref) {
21
21
  const {
22
22
  propsWithDefaults
23
23
  } = useCustom('Nav', props);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
2
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
3
  import Button from '../Button';
4
4
  import NavDropdownItem from './NavDropdownItem';
5
5
  import NavDropdownMenu from './NavDropdownMenu';
@@ -13,7 +13,7 @@ export interface NavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLA
13
13
  /** Triggering events */
14
14
  trigger?: NavDropdownTrigger | readonly NavDropdownTrigger[];
15
15
  /** The placement of Menu */
16
- placement?: TypeAttributes.Placement8;
16
+ placement?: PlacementCorners;
17
17
  /** Whether or not component is disabled */
18
18
  disabled?: boolean;
19
19
  /** The style of the menu */
@@ -22,7 +22,7 @@ import NavDropdownToggle from "./NavDropdownToggle.js";
22
22
  * </Nav.Menu>
23
23
  * </Nav>
24
24
  */
25
- const NavDropdown = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const NavDropdown = /*#__PURE__*/React.forwardRef(function NavDropdown(props, ref) {
26
26
  const nav = useContext(NavContext);
27
27
  if (!nav) {
28
28
  throw new Error('<Nav.Dropdown> must be rendered within a <Nav> component.');
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
  import Button from '../Button';
3
- import { WithAsProps, RsRefForwardingComponent, TypeAttributes } from '../internals/types';
3
+ import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
4
4
  import { NavItemProps } from './NavItem';
5
5
  export interface NavDropdownToggleProps extends WithAsProps {
6
6
  icon?: NavItemProps['icon'];
7
7
  noCaret?: boolean;
8
8
  renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
9
- placement?: TypeAttributes.Placement8;
9
+ placement?: PlacementCorners;
10
10
  }
11
11
  /**
12
12
  * @private this component is not supposed to be used directly
@@ -11,7 +11,7 @@ export const NavbarContext = /*#__PURE__*/React.createContext(false);
11
11
  * The `Navbar` component is used to create a navigation header.
12
12
  * @see https://rsuitejs.com/components/navbar
13
13
  */
14
- const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
14
+ const Navbar = /*#__PURE__*/React.forwardRef(function Navbar(props, ref) {
15
15
  const {
16
16
  propsWithDefaults
17
17
  } = useCustom('Navbar', props);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
2
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
3
  import { IconProps } from '@rsuite/icons/Icon';
4
4
  import Button from '../Button';
5
5
  import NavDropdownItem from '../Nav/NavDropdownItem';
@@ -13,7 +13,7 @@ export interface NavbarDropdownProps<T = any> extends WithAsProps, Omit<React.HT
13
13
  /** Triggering events */
14
14
  trigger?: NavbarDropdownTrigger | readonly NavbarDropdownTrigger[];
15
15
  /** The placement of Menu */
16
- placement?: TypeAttributes.Placement8;
16
+ placement?: PlacementCorners;
17
17
  /** Whether or not component is disabled */
18
18
  disabled?: boolean;
19
19
  /** The style of the menu */
@@ -14,7 +14,7 @@ import NavbarDropdownToggle from "./NavbarDropdownToggle.js";
14
14
  /**
15
15
  * @private
16
16
  */
17
- const NavbarDropdown = /*#__PURE__*/React.forwardRef((props, ref) => {
17
+ const NavbarDropdown = /*#__PURE__*/React.forwardRef(function NavbarDropdown(props, ref) {
18
18
  const navbar = useContext(NavbarContext);
19
19
  if (!navbar) {
20
20
  throw new Error('<Navbar.Dropdown> should be used within a <Navbar> component.');
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import Button from '../Button';
3
- import { WithAsProps, RsRefForwardingComponent, TypeAttributes } from '../internals/types';
3
+ import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
4
4
  export interface NavbarDropdownToggleProps extends WithAsProps {
5
5
  noCaret?: boolean;
6
6
  renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
7
- placement?: TypeAttributes.Placement8;
7
+ placement?: PlacementCorners;
8
8
  }
9
9
  /**
10
10
  * @private this component is not supposed to be used directly
File without changes
@@ -81,7 +81,7 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
81
81
  }, [max, min]);
82
82
  const [value, setValue] = useControlled(getValidValue(valueProp), getValidValue(defaultValue));
83
83
 
84
- // The count of values ​​that can be entered.
84
+ // The count of values that can be entered.
85
85
  const count = useMemo(() => precisionMath((max - min) / step), [max, min, step]);
86
86
 
87
87
  // Get the height of the progress bar
@@ -184,10 +184,10 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
184
184
  }
185
185
  });
186
186
  const handleKeyDown = useEventCallback(event => {
187
- var _event$target;
187
+ const target = event.target;
188
188
  const {
189
189
  key
190
- } = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target['dataset'];
190
+ } = (target === null || target === void 0 ? void 0 : target.dataset) || {};
191
191
  const nextValue = [...value];
192
192
  const increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
193
193
  const decreaseKey = rtl ? 'ArrowRight' : 'ArrowLeft';
@@ -231,7 +231,7 @@ const RangeSlider = /*#__PURE__*/React.forwardRef((props, ref) => {
231
231
  let [start, end] = value;
232
232
  const v = getValueByPosition(event);
233
233
 
234
- // Judging that the current click value is closer to the values ​​of `start` and` end`.
234
+ // Judging that the current click value is closer to the values of `start` and `end`.
235
235
  if (Math.abs(start - v) < Math.abs(end - v)) {
236
236
  start = v;
237
237
  } else {
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import _isNil from "lodash/isNil";
4
- import React, { useCallback, useRef } from 'react';
3
+ import React, { useRef } from 'react';
5
4
  import contains from 'dom-lib/contains';
6
- import { useClassNames } from "../internals/hooks/index.js";
5
+ import isNil from 'lodash/isNil';
6
+ import { useClassNames, useEventCallback } from "../internals/hooks/index.js";
7
7
  const characterStatus = {
8
8
  [0]: 'empty',
9
9
  [0.5]: 'half',
@@ -30,13 +30,13 @@ const Character = /*#__PURE__*/React.forwardRef((props, ref) => {
30
30
  withClassPrefix
31
31
  } = useClassNames(classPrefix);
32
32
  const beforeRef = useRef(null);
33
- const classes = merge(className, withClassPrefix(!_isNil(status) && characterStatus[status]));
34
- const handleMouseMove = useCallback(event => {
33
+ const classes = merge(className, withClassPrefix(!isNil(status) && characterStatus[status]));
34
+ const handleMouseMove = useEventCallback(event => {
35
35
  onMouseMove === null || onMouseMove === void 0 || onMouseMove(getKey(beforeRef.current, event.target), event);
36
- }, [onMouseMove]);
37
- const handleClick = useCallback(event => {
36
+ });
37
+ const handleClick = useEventCallback(event => {
38
38
  onClick === null || onClick === void 0 || onClick(getKey(beforeRef.current, event.target), event);
39
- }, [onClick]);
39
+ });
40
40
  return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
41
41
  ref: ref,
42
42
  className: classes,
@@ -1,14 +1,14 @@
1
1
  import React from 'react';
2
- import type { WithAsProps, TypeAttributes, RsRefForwardingComponent, FormControlBaseProps } from '../internals/types';
2
+ import type { WithAsProps, Color, TypeAttributes, RsRefForwardingComponent, FormControlBaseProps } from '../internals/types';
3
3
  export interface RateProps<T = number> extends WithAsProps, FormControlBaseProps<T> {
4
4
  allowHalf?: boolean;
5
5
  character?: React.ReactNode;
6
6
  classPrefix?: string;
7
7
  cleanable?: boolean;
8
- /** A tate can have different sizes */
8
+ /** A rate can have different sizes */
9
9
  size?: TypeAttributes.Size;
10
- /** A tate can have different colors */
11
- color?: TypeAttributes.Color;
10
+ /** A rate can have different colors */
11
+ color?: Color | React.CSSProperties['color'];
12
12
  max?: number;
13
13
  vertical?: boolean;
14
14
  renderCharacter?: (value: number, index: number) => React.ReactNode;
package/esm/Rate/Rate.js CHANGED
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- import React, { useCallback, useEffect, useState } from 'react';
3
+ import React, { useEffect, useCallback, useState, useMemo } from 'react';
4
4
  import isNil from 'lodash/isNil';
5
5
  import Star from '@rsuite/icons/Star';
6
6
  import Character from "./Character.js";
7
7
  import Plaintext from "../internals/Plaintext/index.js";
8
8
  import { KEY_VALUES } from "../internals/constants/index.js";
9
- import { useControlled, useClassNames } from "../internals/hooks/index.js";
10
- import { shallowEqualArray } from "../internals/utils/index.js";
9
+ import { useControlled, useClassNames, useEventCallback } from "../internals/hooks/index.js";
10
+ import { shallowEqualArray, isPresetColor, createColorVariables, mergeStyles } from "../internals/utils/index.js";
11
11
  import { transformValueToCharacterMap, transformCharacterMapToValue } from "./utils.js";
12
12
  import { useCustom } from "../CustomProvider/index.js";
13
13
  /**
@@ -34,6 +34,7 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
34
34
  defaultValue = 0,
35
35
  cleanable = true,
36
36
  plaintext,
37
+ style,
37
38
  onChange,
38
39
  renderCharacter,
39
40
  onChangeActive,
@@ -49,23 +50,23 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
49
50
  merge,
50
51
  withClassPrefix
51
52
  } = useClassNames(classPrefix);
52
- const classes = merge(className, withClassPrefix(size, color, {
53
+ const classes = merge(className, withClassPrefix(size, isPresetColor(color) && color, {
53
54
  disabled,
54
55
  readonly: readOnly
55
56
  }));
57
+ const styles = useMemo(() => mergeStyles(style, createColorVariables(color, '--rs-rate-symbol-checked')), [style, color]);
56
58
  const resetCharacterMap = useCallback(() => {
57
59
  setCharacterMap(getCharacterMap());
58
60
  }, [getCharacterMap]);
59
61
  useEffect(() => {
60
62
  // Update characterMap when value is updated.
61
63
  setCharacterMap(getCharacterMap(valueProp));
62
- // eslint-disable-next-line react-hooks/exhaustive-deps
63
64
  }, [valueProp]);
64
- const handleMouseLeave = useCallback(event => {
65
+ const handleMouseLeave = useEventCallback(event => {
65
66
  resetCharacterMap();
66
67
  onChangeActive === null || onChangeActive === void 0 || onChangeActive(value, event);
67
- }, [onChangeActive, resetCharacterMap, value]);
68
- const handleChangeValue = useCallback((index, event) => {
68
+ });
69
+ const handleChangeValue = useEventCallback((index, event) => {
69
70
  let nextValue = transformCharacterMapToValue(characterMap);
70
71
  if (cleanable && value === nextValue && getCharacterMap(value)[index] === characterMap[index]) {
71
72
  nextValue = 0;
@@ -75,8 +76,8 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
75
76
  setCharacterMap(getCharacterMap(nextValue));
76
77
  onChange === null || onChange === void 0 || onChange(nextValue, event);
77
78
  }
78
- }, [characterMap, cleanable, getCharacterMap, onChange, setValue, value]);
79
- const handleKeyDown = useCallback((index, event) => {
79
+ });
80
+ const handleKeyDown = useEventCallback((index, event) => {
80
81
  const {
81
82
  key
82
83
  } = event;
@@ -90,8 +91,8 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
90
91
  if (key === KEY_VALUES.ENTER) {
91
92
  handleChangeValue(index, event);
92
93
  }
93
- }, [allowHalf, characterMap, getCharacterMap, handleChangeValue, max]);
94
- const handleChangeCharacterMap = useCallback((index, key, event) => {
94
+ });
95
+ const handleChangeCharacterMap = useEventCallback((index, key, event) => {
95
96
  const nextCharacterMap = characterMap.map((_item, i) => {
96
97
  if (i === index && key === 'before' && allowHalf) {
97
98
  return 0.5;
@@ -102,11 +103,11 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
102
103
  setCharacterMap(nextCharacterMap);
103
104
  onChangeActive === null || onChangeActive === void 0 || onChangeActive(transformCharacterMapToValue(nextCharacterMap), event);
104
105
  }
105
- }, [allowHalf, characterMap, onChangeActive]);
106
- const handleClick = useCallback((index, key, event) => {
106
+ });
107
+ const handleClick = useEventCallback((index, key, event) => {
107
108
  handleChangeCharacterMap(index, key, event);
108
109
  handleChangeValue(index, event);
109
- }, [handleChangeCharacterMap, handleChangeValue]);
110
+ });
110
111
  if (plaintext) {
111
112
  return /*#__PURE__*/React.createElement(Plaintext, {
112
113
  localeKey: "notSelected",
@@ -115,12 +116,12 @@ const Rate = /*#__PURE__*/React.forwardRef((props, ref) => {
115
116
  }
116
117
  return /*#__PURE__*/React.createElement(Component, _extends({
117
118
  role: "radiogroup",
118
- tabIndex: 0
119
- }, rest, {
119
+ tabIndex: 0,
120
120
  ref: ref,
121
121
  className: classes,
122
+ style: styles,
122
123
  onMouseLeave: handleMouseLeave
123
- }), characterMap.map((item, index) => /*#__PURE__*/React.createElement(Character, {
124
+ }, rest), characterMap.map((item, index) => /*#__PURE__*/React.createElement(Character, {
124
125
  role: "radio",
125
126
  "aria-posinset": index + 1,
126
127
  "aria-setsize": max,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
2
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
3
  import { IconProps } from '@rsuite/icons/Icon';
4
4
  export interface SidenavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLAttributes<HTMLElement>, 'onToggle' | 'title'> {
5
5
  /** Define the title as a submenu */
@@ -7,7 +7,7 @@ export interface SidenavDropdownProps<T = any> extends WithAsProps, Omit<React.H
7
7
  /** Set the icon */
8
8
  icon?: React.ReactElement<IconProps>;
9
9
  /** The placement of Menu */
10
- placement?: TypeAttributes.Placement8;
10
+ placement?: PlacementCorners;
11
11
  /** Whether or not component is disabled */
12
12
  disabled?: boolean;
13
13
  /** The style of the menu */
@@ -16,7 +16,7 @@ const emptyArray = [];
16
16
  * The `Sidenav` component is an encapsulation of the page sidebar `Nav`.
17
17
  * @see https://rsuitejs.com/components/sidenav/
18
18
  */
19
- const Sidenav = /*#__PURE__*/React.forwardRef((props, ref) => {
19
+ const Sidenav = /*#__PURE__*/React.forwardRef(function Sidenav(props, ref) {
20
20
  const {
21
21
  propsWithDefaults
22
22
  } = useCustom('Sidenav', props);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { TypeAttributes, WithAsProps, RsRefForwardingComponent } from '../internals/types';
2
+ import { PlacementCorners, WithAsProps, RsRefForwardingComponent } from '../internals/types';
3
3
  import { IconProps } from '@rsuite/icons/Icon';
4
4
  import Button from '../Button';
5
5
  import NavDropdownItem from '../Nav/NavDropdownItem';
@@ -13,7 +13,7 @@ export interface NavDropdownProps<T = any> extends WithAsProps, Omit<React.HTMLA
13
13
  /** Triggering events */
14
14
  trigger?: SidenavDropdownTrigger | readonly SidenavDropdownTrigger[];
15
15
  /** The placement of Menu */
16
- placement?: TypeAttributes.Placement8;
16
+ placement?: PlacementCorners;
17
17
  /** Whether or not component is disabled */
18
18
  disabled?: boolean;
19
19
  /** The style of the menu */
@@ -26,7 +26,7 @@ import { NavMenuContext } from "../Nav/NavMenu.js";
26
26
  * </Nav>
27
27
  * </Sidenav>
28
28
  */
29
- const SidenavDropdown = /*#__PURE__*/React.forwardRef((props, ref) => {
29
+ const SidenavDropdown = /*#__PURE__*/React.forwardRef(function SidenavDropdown(props, ref) {
30
30
  const sidenav = useContext(SidenavContext);
31
31
  const nav = useContext(NavContext);
32
32
  const navMenu = useContext(NavMenuContext);
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import Button from '../Button';
3
- import { WithAsProps, RsRefForwardingComponent, TypeAttributes } from '../internals/types';
3
+ import { WithAsProps, RsRefForwardingComponent, PlacementCorners } from '../internals/types';
4
4
  export interface SidenavDropdownToggleProps extends WithAsProps {
5
5
  noCaret?: boolean;
6
6
  renderToggle?: (props: WithAsProps, ref: React.Ref<any>) => any;
7
- placement?: TypeAttributes.Placement8;
7
+ placement?: PlacementCorners;
8
8
  }
9
9
  /**
10
10
  * @private this component is not supposed to be used directly
@@ -2,7 +2,7 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import Stack from "./Stack.js";
5
- const HStack = /*#__PURE__*/React.forwardRef((props, ref) => {
5
+ const HStack = /*#__PURE__*/React.forwardRef(function HStack(props, ref) {
6
6
  const {
7
7
  reverse,
8
8
  spacing = 6,
@@ -16,7 +16,7 @@ function isStackItem(child) {
16
16
  *
17
17
  * @see https://rsuitejs.com/components/stack
18
18
  */
19
- const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
19
+ const Stack = /*#__PURE__*/React.forwardRef(function Stack(props, ref) {
20
20
  const {
21
21
  propsWithDefaults
22
22
  } = useCustom('Stack', props);
@@ -2,7 +2,7 @@
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import Stack from "./Stack.js";
5
- const VStack = /*#__PURE__*/React.forwardRef((props, ref) => {
5
+ const VStack = /*#__PURE__*/React.forwardRef(function VStack(props, ref) {
6
6
  const {
7
7
  reverse,
8
8
  spacing = 6,
package/esm/Stat/Stat.js CHANGED
@@ -8,7 +8,7 @@ import StatHelpText from "./StatHelpText.js";
8
8
  import StatTrend from "./StatTrend.js";
9
9
  import { useClassNames } from "../internals/hooks/index.js";
10
10
  import { useCustom } from "../CustomProvider/index.js";
11
- const Stat = /*#__PURE__*/React.forwardRef((props, ref) => {
11
+ const Stat = /*#__PURE__*/React.forwardRef(function Stat(props, ref) {
12
12
  const {
13
13
  propsWithDefaults
14
14
  } = useCustom('Stat', props);
@@ -10,7 +10,7 @@ import { useCustom } from "../CustomProvider/index.js";
10
10
  *
11
11
  * @see https://rsuitejs.com/components/steps
12
12
  */
13
- const Steps = /*#__PURE__*/React.forwardRef((props, ref) => {
13
+ const Steps = /*#__PURE__*/React.forwardRef(function Steps(props, ref) {
14
14
  const {
15
15
  propsWithDefaults
16
16
  } = useCustom('Steps', props);
@@ -7,7 +7,7 @@ import TableColumn from "./TableColumn.js";
7
7
  import TableColumnGroup from "./TableColumnGroup.js";
8
8
  import { useCustom } from "../CustomProvider/index.js";
9
9
  import { Table as RsTable } from 'rsuite-table';
10
- const CustomTable = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const CustomTable = /*#__PURE__*/React.forwardRef(function Table(props, ref) {
11
11
  const {
12
12
  propsWithDefaults,
13
13
  rtl,
@@ -18,7 +18,7 @@ const CustomTable = /*#__PURE__*/React.forwardRef((props, ref) => {
18
18
  loadAnimation = true,
19
19
  ...rest
20
20
  } = propsWithDefaults;
21
- const locale = getLocale('Calendar', overrideLocale);
21
+ const locale = getLocale('common', overrideLocale);
22
22
  return /*#__PURE__*/React.createElement(RsTable, _extends({}, rest, {
23
23
  rtl: rtl,
24
24
  ref: ref,
package/esm/Tabs/Tabs.js CHANGED
@@ -105,7 +105,7 @@ const renderTabs = (children, tabPanelProps) => {
105
105
  * @version 5.53.0
106
106
  * @see https://rsuitejs.com/components/tabs
107
107
  */
108
- const Tabs = /*#__PURE__*/React.forwardRef((props, ref) => {
108
+ const Tabs = /*#__PURE__*/React.forwardRef(function Tabs(props, ref) {
109
109
  const {
110
110
  propsWithDefaults,
111
111
  rtl
@@ -163,16 +163,15 @@ const Tabs = /*#__PURE__*/React.forwardRef((props, ref) => {
163
163
  event.preventDefault();
164
164
  break;
165
165
  case 'End':
166
- const tabs = getFocusableTabs(tablistRef.current);
167
- item = tabs[tabs.length - 1];
168
- event.preventDefault();
169
- break;
166
+ {
167
+ const tabs = getFocusableTabs(tablistRef.current);
168
+ item = tabs[tabs.length - 1];
169
+ event.preventDefault();
170
+ break;
171
+ }
170
172
  }
171
173
  if (item) {
172
- var _item;
173
- const {
174
- eventKey
175
- } = (_item = item) === null || _item === void 0 ? void 0 : _item.dataset;
174
+ const eventKey = item ? item.dataset.eventKey : undefined;
176
175
  handleSelect(eventKey, event);
177
176
  item.focus();
178
177
  }
package/esm/Tag/Tag.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import type { WithAsProps, TypeAttributes, RsRefForwardingComponent } from '../internals/types';
2
+ import type { WithAsProps, Color, RsRefForwardingComponent } from '../internals/types';
3
3
  import type { CommonLocale } from '../locales';
4
4
  export interface TagProps extends WithAsProps {
5
5
  /** Different sizes */
6
6
  size?: 'lg' | 'md' | 'sm';
7
7
  /** A tag can have different colors */
8
- color?: TypeAttributes.Color;
8
+ color?: Color | React.CSSProperties['color'];
9
9
  /** Whether to close */
10
10
  closable?: boolean;
11
11
  /** The content of the component */