rsuite 5.65.0 → 5.66.0

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 (107) hide show
  1. package/Accordion/styles/index.css +9 -9
  2. package/AutoComplete/styles/index.css +59 -55
  3. package/Avatar/styles/index.css +2 -2
  4. package/Breadcrumb/styles/index.css +4 -4
  5. package/Button/styles/index.css +20 -20
  6. package/CHANGELOG.md +27 -0
  7. package/Calendar/styles/index.css +32 -32
  8. package/Carousel/styles/index.css +4 -4
  9. package/CascadeTree/styles/index.css +9 -9
  10. package/Cascader/styles/index.css +63 -59
  11. package/CheckPicker/styles/index.css +61 -57
  12. package/CheckTree/styles/index.css +62 -58
  13. package/CheckTreePicker/styles/index.css +62 -58
  14. package/Checkbox/styles/index.css +6 -6
  15. package/DateInput/styles/index.css +11 -11
  16. package/DatePicker/styles/index.css +70 -66
  17. package/DateRangeInput/styles/index.css +11 -11
  18. package/DateRangePicker/styles/index.css +71 -67
  19. package/Divider/styles/index.css +1 -1
  20. package/Drawer/styles/index.css +7 -7
  21. package/Dropdown/styles/index.css +26 -26
  22. package/FormControlLabel/styles/index.css +2 -2
  23. package/FormHelpText/styles/index.css +2 -2
  24. package/IconButton/styles/index.css +21 -21
  25. package/InlineEdit/styles/index.css +1 -1
  26. package/Input/styles/index.css +11 -11
  27. package/InputGroup/styles/index.css +28 -28
  28. package/InputNumber/styles/index.css +34 -34
  29. package/InputPicker/styles/index.css +62 -58
  30. package/List/styles/index.css +3 -3
  31. package/Loader/styles/index.css +10 -6
  32. package/Loader/styles/index.less +4 -0
  33. package/Message/styles/index.css +12 -12
  34. package/Modal/styles/index.css +9 -9
  35. package/MultiCascadeTree/styles/index.css +64 -60
  36. package/MultiCascader/styles/index.css +64 -60
  37. package/Nav/styles/index.css +30 -30
  38. package/Navbar/styles/index.css +30 -30
  39. package/Notification/styles/index.css +6 -6
  40. package/Pagination/styles/index.css +69 -65
  41. package/Panel/styles/index.css +9 -9
  42. package/PanelGroup/styles/index.css +1 -1
  43. package/Placeholder/styles/index.css +3 -3
  44. package/Popover/styles/index.css +3 -3
  45. package/Progress/styles/index.css +4 -3
  46. package/Progress/styles/index.less +1 -0
  47. package/Radio/styles/index.css +6 -6
  48. package/RadioGroup/styles/index.css +5 -5
  49. package/RangeSlider/styles/index.css +12 -12
  50. package/Rate/styles/index.css +2 -2
  51. package/SelectPicker/styles/index.css +62 -58
  52. package/Sidenav/styles/index.css +12 -12
  53. package/Slider/styles/index.css +12 -12
  54. package/Steps/styles/index.css +8 -8
  55. package/Table/styles/index.css +9 -9
  56. package/Tabs/styles/index.css +30 -30
  57. package/Tag/styles/index.css +3 -3
  58. package/TagInput/styles/index.css +63 -59
  59. package/TagPicker/styles/index.css +63 -59
  60. package/Text/styles/index.css +5 -5
  61. package/Timeline/styles/index.css +1 -1
  62. package/Toggle/styles/index.css +9 -9
  63. package/Tooltip/styles/index.css +9 -9
  64. package/Tree/styles/index.css +9 -9
  65. package/TreePicker/styles/index.css +9 -9
  66. package/Uploader/styles/index.css +40 -40
  67. package/cjs/CheckTree/CheckTreeView.d.ts +4 -0
  68. package/cjs/CheckTreePicker/CheckTreePicker.js +1 -0
  69. package/cjs/Drawer/Drawer.js +1 -0
  70. package/cjs/FormControl/hooks/useField.d.ts +1 -1
  71. package/cjs/FormControl/hooks/useField.js +15 -5
  72. package/cjs/Loader/Loader.d.ts +1 -1
  73. package/cjs/Loader/Loader.js +1 -1
  74. package/cjs/Tree/TreeView.d.ts +4 -0
  75. package/cjs/TreePicker/TreePicker.js +1 -0
  76. package/cjs/internals/hooks/useCustom.js +1 -1
  77. package/cjs/internals/hooks/useIsomorphicLayoutEffect.js +1 -1
  78. package/dist/rsuite-no-reset-rtl.css +203 -198
  79. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  80. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  81. package/dist/rsuite-no-reset.css +203 -198
  82. package/dist/rsuite-no-reset.min.css +1 -1
  83. package/dist/rsuite-no-reset.min.css.map +1 -1
  84. package/dist/rsuite-rtl.css +205 -200
  85. package/dist/rsuite-rtl.min.css +1 -1
  86. package/dist/rsuite-rtl.min.css.map +1 -1
  87. package/dist/rsuite.css +205 -200
  88. package/dist/rsuite.js +11 -11
  89. package/dist/rsuite.min.css +1 -1
  90. package/dist/rsuite.min.css.map +1 -1
  91. package/dist/rsuite.min.js +1 -1
  92. package/dist/rsuite.min.js.map +1 -1
  93. package/esm/CheckTree/CheckTreeView.d.ts +4 -0
  94. package/esm/CheckTreePicker/CheckTreePicker.js +1 -0
  95. package/esm/Drawer/Drawer.js +1 -0
  96. package/esm/FormControl/hooks/useField.d.ts +1 -1
  97. package/esm/FormControl/hooks/useField.js +13 -3
  98. package/esm/Loader/Loader.d.ts +1 -1
  99. package/esm/Loader/Loader.js +1 -1
  100. package/esm/Tree/TreeView.d.ts +4 -0
  101. package/esm/TreePicker/TreePicker.js +1 -0
  102. package/esm/internals/hooks/useCustom.js +1 -1
  103. package/esm/internals/hooks/useIsomorphicLayoutEffect.js +1 -1
  104. package/package.json +1 -1
  105. package/styles/color-modes/light.less +2 -2
  106. package/styles/colors/light.less +6 -6
  107. package/styles/variables.less +1 -0
@@ -52,6 +52,10 @@ interface CheckTreeViewInnerProps<V = (string | number)[]> extends Omit<CheckTre
52
52
  * Flattened nodes.
53
53
  */
54
54
  flattenedNodes?: TreeNodeMap;
55
+ /**
56
+ * A collection of localized strings.
57
+ */
58
+ locale?: Record<string, string>;
55
59
  /**
56
60
  * Callback function triggered when an item is focused.
57
61
  */
@@ -215,6 +215,7 @@ var CheckTreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
215
215
  showIndentLine: showIndentLine,
216
216
  listProps: listProps,
217
217
  listRef: list,
218
+ locale: overrideLocale,
218
219
  searchBy: searchBy,
219
220
  searchable: searchable,
220
221
  searchKeyword: searchKeyword,
@@ -47,6 +47,7 @@ var Drawer = /*#__PURE__*/React.forwardRef(function (props, ref) {
47
47
  value: contextValue
48
48
  }, /*#__PURE__*/React.createElement(Modal, _extends({}, rest, {
49
49
  ref: ref,
50
+ overflow: false,
50
51
  classPrefix: classPrefix,
51
52
  className: classes,
52
53
  animation: animation,
@@ -10,7 +10,7 @@ interface FieldProps {
10
10
  }
11
11
  declare function useField(props: FieldProps): {
12
12
  fieldValue: any;
13
- fieldError: any;
13
+ fieldError: import("react").ReactNode;
14
14
  setFieldValue: (fieldName: string, fieldValue: any) => {
15
15
  [x: string]: any;
16
16
  };
@@ -4,6 +4,17 @@ import { useCallback, useMemo } from 'react';
4
4
  import get from 'lodash/get';
5
5
  import set from 'lodash/set';
6
6
  import { nameToPath } from "../utils.js";
7
+ function getErrorMessage(error) {
8
+ var _error$array;
9
+ /**
10
+ * When using some components as the field, such as TagInput, and using `ArrayType().of` as the validation rule,
11
+ * the error object won't contain the errorMessage directly. @see https://github.com/rsuite/rsuite/issues/3866
12
+ */
13
+ if (error !== null && error !== void 0 && error.array && ((_error$array = error.array) === null || _error$array === void 0 ? void 0 : _error$array.length) > 0) {
14
+ return error.array[0].errorMessage;
15
+ }
16
+ return error === null || error === void 0 ? void 0 : error.errorMessage;
17
+ }
7
18
  function useField(props) {
8
19
  var name = props.name,
9
20
  formValue = props.formValue,
@@ -23,14 +34,13 @@ function useField(props) {
23
34
  return errorMessage;
24
35
  }
25
36
  if (nestedField) {
26
- var _get;
27
- return (_get = get(formError, nameToPath(name))) === null || _get === void 0 ? void 0 : _get.errorMessage;
37
+ return getErrorMessage(get(formError, nameToPath(name)));
28
38
  }
29
39
  var fieldError = formError === null || formError === void 0 ? void 0 : formError[name];
30
40
  if (typeof fieldError === 'string') {
31
41
  return fieldError;
32
42
  }
33
- return fieldError === null || fieldError === void 0 ? void 0 : fieldError.errorMessage;
43
+ return getErrorMessage(fieldError);
34
44
  }, [errorFromContext, errorMessage, formError, name, nestedField]);
35
45
  var setFieldValue = useCallback(function (fieldName, fieldValue) {
36
46
  var _extends2;
@@ -12,7 +12,7 @@ export interface LoaderProps extends WithAsProps {
12
12
  /** Custom descriptive text */
13
13
  content?: React.ReactNode;
14
14
  /** The speed at which the loader rotates */
15
- speed?: 'normal' | 'fast' | 'slow';
15
+ speed?: 'normal' | 'fast' | 'slow' | 'paused';
16
16
  /** A loader can have different sizes */
17
17
  size?: TypeAttributes.Size;
18
18
  }
@@ -64,6 +64,6 @@ Loader.propTypes = {
64
64
  vertical: PropTypes.bool,
65
65
  content: PropTypes.node,
66
66
  size: oneOf(['lg', 'md', 'sm', 'xs']),
67
- speed: oneOf(['normal', 'fast', 'slow'])
67
+ speed: oneOf(['normal', 'fast', 'slow', 'paused'])
68
68
  };
69
69
  export default Loader;
@@ -44,6 +44,10 @@ interface TreeViewInnerProps<V = string | number | null> extends Omit<TreeViewPr
44
44
  * An array of values representing the loading nodes.
45
45
  */
46
46
  loadingNodeValues?: V[];
47
+ /**
48
+ * A collection of localized strings.
49
+ */
50
+ locale?: Record<string, string>;
47
51
  /**
48
52
  * A map of flattened nodes.
49
53
  */
@@ -220,6 +220,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
220
220
  flattenedNodes: flattenedNodes,
221
221
  listProps: listProps,
222
222
  listRef: list,
223
+ locale: overrideLocale,
223
224
  height: treeHeight,
224
225
  onExpand: handleExpandTreeNode,
225
226
  onSearch: onSearch,
@@ -11,7 +11,7 @@ var mergeObject = function mergeObject(list) {
11
11
  }, {});
12
12
  };
13
13
  var getDefaultRTL = function getDefaultRTL() {
14
- return typeof window !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
14
+ return typeof document !== 'undefined' && (document.body.getAttribute('dir') || document.dir) === 'rtl';
15
15
  };
16
16
 
17
17
  /**
@@ -1,4 +1,4 @@
1
1
  'use client';
2
2
  import { useEffect, useLayoutEffect } from 'react';
3
- export var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
3
+ export var useIsomorphicLayoutEffect = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
4
4
  export default useIsomorphicLayoutEffect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.65.0",
3
+ "version": "5.66.0",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -298,11 +298,11 @@
298
298
  --rs-rate-symbol-checked: var(--rs-blue-500);
299
299
 
300
300
  // Toggle
301
- --rs-toggle-bg: var(--rs-gray-300);
301
+ --rs-toggle-bg: var(--rs-gray-400);
302
302
  --rs-toggle-thumb: #fff;
303
303
  --rs-toggle-loader-ring: rgb(from var(--rs-gray-50) r g b / 30%);
304
304
  --rs-toggle-loader-rotor: var(--rs-gray-0);
305
- --rs-toggle-hover-bg: var(--rs-gray-400);
305
+ --rs-toggle-hover-bg: var(--rs-gray-500);
306
306
  --rs-toggle-disabled-bg: var(--rs-gray-200);
307
307
  --rs-toggle-disabled-thumb: #fff;
308
308
  --rs-toggle-checked-bg: var(--rs-primary-500);
@@ -18,12 +18,12 @@
18
18
  @B100: #f2f2f5;
19
19
  @B200: #e5e5ea;
20
20
  @B300: #d9d9d9;
21
- @B400: #c5c6c7;
22
- @B500: #a6a6a6;
23
- @B600: #8e8e93;
24
- @B700: #7a7a7a;
25
- @B800: #575757;
26
- @B900: #272c36;
21
+ @B400: #b6b7b8;
22
+ @B500: #939393;
23
+ @B600: #717273;
24
+ @B700: #575757;
25
+ @B800: #343434;
26
+ @B900: #121212;
27
27
 
28
28
  // Secondary palette
29
29
 
@@ -616,6 +616,7 @@
616
616
  @loader-duration-fast: 0.4s;
617
617
  @loader-duration-normal: 0.6s;
618
618
  @loader-duration-slow: 0.8s;
619
+ @loader-duration-paused: paused;
619
620
 
620
621
  // spacing
621
622
  @loader-content-spin-spacing-horizontal: 12px;