rsuite 5.0.0-beta.5 → 5.0.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 (194) hide show
  1. package/Animation/styles/index.less +16 -16
  2. package/Animation/styles/mixin.less +2 -2
  3. package/Button/styles/index.less +36 -1
  4. package/Button/styles/mixin.less +7 -1
  5. package/CHANGELOG.md +47 -4
  6. package/Calendar/styles/index.less +7 -1
  7. package/Checkbox/styles/index.less +18 -2
  8. package/DatePicker/styles/index.less +6 -2
  9. package/Drawer/styles/index.less +11 -2
  10. package/Drawer/styles/mixin.less +2 -2
  11. package/Dropdown/styles/index.less +4 -0
  12. package/Form/styles/mixin.less +6 -0
  13. package/InputGroup/styles/index.less +4 -0
  14. package/Message/styles/index.less +16 -0
  15. package/Modal/styles/index.less +3 -2
  16. package/Nav/styles/index.less +18 -2
  17. package/Navbar/styles/index.less +68 -34
  18. package/Notification/styles/index.less +9 -3
  19. package/Pagination/styles/index.less +12 -1
  20. package/Pagination/styles/mixin.less +7 -0
  21. package/Picker/styles/index.less +25 -3
  22. package/Picker/styles/mixin.less +7 -2
  23. package/Popover/styles/index.less +23 -30
  24. package/Popover/styles/mixins.less +72 -0
  25. package/README.md +4 -4
  26. package/Radio/styles/index.less +16 -0
  27. package/RadioGroup/styles/index.less +4 -0
  28. package/Rate/styles/index.less +13 -2
  29. package/Ripple/styles/index.less +8 -4
  30. package/Sidenav/styles/index.less +160 -47
  31. package/Table/styles/index.less +8 -0
  32. package/TagInput/package.json +7 -0
  33. package/TagInput/styles/index.less +13 -0
  34. package/Toggle/styles/index.less +29 -19
  35. package/Tooltip/styles/index.less +32 -38
  36. package/Tooltip/styles/mixins.less +72 -0
  37. package/Uploader/styles/index.less +11 -1
  38. package/cjs/@types/common.d.ts +2 -0
  39. package/cjs/Animation/Bounce.js +10 -4
  40. package/cjs/Animation/Collapse.d.ts +1 -48
  41. package/cjs/Animation/Collapse.js +60 -106
  42. package/cjs/Animation/Fade.js +10 -5
  43. package/cjs/Animation/Slide.js +8 -4
  44. package/cjs/Carousel/Carousel.d.ts +7 -0
  45. package/cjs/Carousel/Carousel.js +24 -11
  46. package/cjs/CheckTree/index.js +14 -5
  47. package/cjs/CheckTreePicker/CheckTreePicker.js +9 -5
  48. package/cjs/DatePicker/DatePicker.d.ts +5 -1
  49. package/cjs/DatePicker/DatePicker.js +2 -13
  50. package/cjs/DateRangePicker/Calendar.d.ts +2 -1
  51. package/cjs/DateRangePicker/Calendar.js +4 -3
  52. package/cjs/DateRangePicker/DateRangePicker.d.ts +1 -1
  53. package/cjs/DateRangePicker/DateRangePicker.js +58 -43
  54. package/cjs/DateRangePicker/utils.d.ts +1 -1
  55. package/cjs/DateRangePicker/utils.js +9 -5
  56. package/cjs/Dropdown/Dropdown.js +31 -18
  57. package/cjs/Dropdown/DropdownContext.d.ts +4 -1
  58. package/cjs/Dropdown/DropdownItem.js +31 -4
  59. package/cjs/Dropdown/DropdownState.d.ts +37 -0
  60. package/cjs/Dropdown/DropdownState.js +66 -0
  61. package/cjs/Dropdown/DropdownToggle.js +3 -6
  62. package/cjs/InputNumber/InputNumber.js +11 -10
  63. package/cjs/InputPicker/InputPicker.d.ts +16 -3
  64. package/cjs/InputPicker/InputPicker.js +85 -44
  65. package/cjs/List/ListItem.d.ts +1 -1
  66. package/cjs/Menu/MenuItem.js +1 -1
  67. package/cjs/MultiCascader/MultiCascader.js +4 -3
  68. package/cjs/Nav/NavItem.js +11 -63
  69. package/cjs/Navbar/NavbarItem.d.ts +19 -0
  70. package/cjs/Navbar/NavbarItem.js +93 -0
  71. package/cjs/Pagination/Pagination.js +1 -1
  72. package/cjs/Picker/PickerToggle.js +2 -2
  73. package/cjs/Picker/utils.d.ts +1 -1
  74. package/cjs/Picker/utils.js +26 -22
  75. package/cjs/Progress/ProgressCircle.js +15 -15
  76. package/cjs/SelectPicker/SelectPicker.d.ts +1 -3
  77. package/cjs/Sidenav/SidenavDropdown.js +6 -1
  78. package/cjs/Sidenav/SidenavItem.js +46 -12
  79. package/cjs/Slider/Slider.js +2 -1
  80. package/cjs/TagInput/index.d.ts +13 -0
  81. package/cjs/TagInput/index.js +58 -0
  82. package/cjs/TagPicker/index.d.ts +10 -2
  83. package/cjs/TagPicker/index.js +25 -6
  84. package/cjs/Tree/Tree.d.ts +0 -2
  85. package/cjs/Tree/Tree.js +13 -4
  86. package/cjs/Tree/TreeContext.d.ts +7 -0
  87. package/cjs/Tree/TreeContext.js +13 -0
  88. package/cjs/TreePicker/TreeNode.js +10 -3
  89. package/cjs/TreePicker/TreePicker.js +22 -10
  90. package/cjs/Uploader/UploadFileItem.d.ts +5 -0
  91. package/cjs/Uploader/UploadFileItem.js +4 -3
  92. package/cjs/Uploader/Uploader.d.ts +8 -3
  93. package/cjs/Uploader/Uploader.js +12 -6
  94. package/cjs/index.d.ts +2 -0
  95. package/cjs/index.js +5 -1
  96. package/cjs/utils/ajaxUpload.d.ts +5 -1
  97. package/cjs/utils/ajaxUpload.js +24 -13
  98. package/cjs/utils/constants.d.ts +1 -0
  99. package/cjs/utils/constants.js +1 -0
  100. package/cjs/utils/dateUtils.d.ts +1 -0
  101. package/cjs/utils/dateUtils.js +5 -1
  102. package/cjs/utils/useInternalId.d.ts +4 -0
  103. package/cjs/utils/useInternalId.js +24 -0
  104. package/cjs/utils/useUniqueId.d.ts +1 -1
  105. package/cjs/utils/useUniqueId.js +1 -1
  106. package/dist/rsuite-rtl.css +1614 -221
  107. package/dist/rsuite-rtl.min.css +1 -1
  108. package/dist/rsuite-rtl.min.css.map +1 -1
  109. package/dist/rsuite.css +1618 -221
  110. package/dist/rsuite.js +288 -288
  111. package/dist/rsuite.min.css +1 -1
  112. package/dist/rsuite.min.css.map +1 -1
  113. package/dist/rsuite.min.js +1 -1
  114. package/dist/rsuite.min.js.map +1 -1
  115. package/esm/@types/common.d.ts +2 -0
  116. package/esm/Animation/Bounce.js +8 -4
  117. package/esm/Animation/Collapse.d.ts +1 -48
  118. package/esm/Animation/Collapse.js +59 -104
  119. package/esm/Animation/Fade.js +8 -4
  120. package/esm/Animation/Slide.js +6 -3
  121. package/esm/Carousel/Carousel.d.ts +7 -0
  122. package/esm/Carousel/Carousel.js +25 -12
  123. package/esm/CheckTree/index.js +11 -5
  124. package/esm/CheckTreePicker/CheckTreePicker.js +8 -6
  125. package/esm/DatePicker/DatePicker.d.ts +5 -1
  126. package/esm/DatePicker/DatePicker.js +2 -13
  127. package/esm/DateRangePicker/Calendar.d.ts +2 -1
  128. package/esm/DateRangePicker/Calendar.js +4 -3
  129. package/esm/DateRangePicker/DateRangePicker.d.ts +1 -1
  130. package/esm/DateRangePicker/DateRangePicker.js +27 -12
  131. package/esm/DateRangePicker/utils.d.ts +1 -1
  132. package/esm/DateRangePicker/utils.js +7 -3
  133. package/esm/Dropdown/Dropdown.js +30 -19
  134. package/esm/Dropdown/DropdownContext.d.ts +4 -1
  135. package/esm/Dropdown/DropdownItem.js +30 -6
  136. package/esm/Dropdown/DropdownState.d.ts +37 -0
  137. package/esm/Dropdown/DropdownState.js +55 -0
  138. package/esm/Dropdown/DropdownToggle.js +3 -6
  139. package/esm/InputNumber/InputNumber.js +11 -10
  140. package/esm/InputPicker/InputPicker.d.ts +16 -3
  141. package/esm/InputPicker/InputPicker.js +84 -45
  142. package/esm/List/ListItem.d.ts +1 -1
  143. package/esm/Menu/MenuItem.js +1 -1
  144. package/esm/MultiCascader/MultiCascader.js +4 -3
  145. package/esm/Nav/NavItem.js +12 -61
  146. package/esm/Navbar/NavbarItem.d.ts +19 -0
  147. package/esm/Navbar/NavbarItem.js +73 -0
  148. package/esm/Pagination/Pagination.js +1 -1
  149. package/esm/Picker/PickerToggle.js +2 -2
  150. package/esm/Picker/utils.d.ts +1 -1
  151. package/esm/Picker/utils.js +26 -22
  152. package/esm/Progress/ProgressCircle.js +15 -15
  153. package/esm/SelectPicker/SelectPicker.d.ts +1 -3
  154. package/esm/Sidenav/SidenavDropdown.js +5 -1
  155. package/esm/Sidenav/SidenavItem.js +47 -13
  156. package/esm/Slider/Slider.js +2 -1
  157. package/esm/TagInput/index.d.ts +13 -0
  158. package/esm/TagInput/index.js +44 -0
  159. package/esm/TagPicker/index.d.ts +10 -2
  160. package/esm/TagPicker/index.js +23 -6
  161. package/esm/Tree/Tree.d.ts +0 -2
  162. package/esm/Tree/Tree.js +10 -4
  163. package/esm/Tree/TreeContext.d.ts +7 -0
  164. package/esm/Tree/TreeContext.js +3 -0
  165. package/esm/TreePicker/TreeNode.js +10 -4
  166. package/esm/TreePicker/TreePicker.js +23 -12
  167. package/esm/Uploader/UploadFileItem.d.ts +5 -0
  168. package/esm/Uploader/UploadFileItem.js +2 -3
  169. package/esm/Uploader/Uploader.d.ts +8 -3
  170. package/esm/Uploader/Uploader.js +12 -6
  171. package/esm/index.d.ts +2 -0
  172. package/esm/index.js +1 -0
  173. package/esm/utils/ajaxUpload.d.ts +5 -1
  174. package/esm/utils/ajaxUpload.js +24 -13
  175. package/esm/utils/constants.d.ts +1 -0
  176. package/esm/utils/constants.js +1 -0
  177. package/esm/utils/dateUtils.d.ts +1 -0
  178. package/esm/utils/dateUtils.js +1 -0
  179. package/esm/utils/useInternalId.d.ts +4 -0
  180. package/esm/utils/useInternalId.js +16 -0
  181. package/esm/utils/useUniqueId.d.ts +1 -1
  182. package/esm/utils/useUniqueId.js +1 -1
  183. package/package.json +4 -9
  184. package/styles/color-modes/dark.less +28 -5
  185. package/styles/color-modes/high-contrast.less +317 -0
  186. package/styles/color-modes/light.less +24 -1
  187. package/styles/color-modes.less +5 -0
  188. package/styles/colors/high-contrast.less +105 -0
  189. package/styles/index.less +1 -0
  190. package/styles/mixins/color-modes.less +6 -0
  191. package/styles/mixins/listbox.less +13 -1
  192. package/styles/mixins/menu.less +7 -0
  193. package/styles/mixins/utilities.less +9 -1
  194. package/styles/variables.less +11 -0
@@ -38,12 +38,17 @@ export interface UploaderProps extends WithAsProps {
38
38
  multiple?: boolean;
39
39
  /** Disabled upload button */
40
40
  disabled?: boolean;
41
+ /** Disabled file item */
42
+ disabledFileItem?: boolean;
43
+ /**
44
+ * If 'true', disable using a multipart form for file upload and instead stream the file.
45
+ * Some APIs (e.g. Amazon S3) may expect the file to be streamed rather than sent via a form. Defaults to false.
46
+ **/
47
+ disableMultipart?: boolean;
41
48
  /** Render the control as plain text */
42
49
  plaintext?: boolean;
43
50
  /** Make the control readonly */
44
51
  readOnly?: boolean;
45
- /** Disabled file item */
46
- disabledFileItem?: boolean;
47
52
  /** Upload the parameter name of the corresponding file */
48
53
  name?: string;
49
54
  /** Set upload timeout */
@@ -73,7 +78,7 @@ export interface UploaderProps extends WithAsProps {
73
78
  /** callback function that the upload queue has changed */
74
79
  onChange?: (fileList: FileType[]) => void;
75
80
  /** The callback function that starts the upload file */
76
- onUpload?: (file: FileType) => void;
81
+ onUpload?: (file: FileType, uploadData: any, xhr: XMLHttpRequest) => void;
77
82
  /** In the file list, for uploading failed files, click the callback function to upload */
78
83
  onReupload?: (file: FileType) => void;
79
84
  /** In the file list, click the callback function for the uploaded file */
@@ -130,6 +130,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
130
130
  action = props.action,
131
131
  headers = props.headers,
132
132
  withCredentials = props.withCredentials,
133
+ disableMultipart = props.disableMultipart,
133
134
  timeout = props.timeout,
134
135
  data = props.data,
135
136
  onRemove = props.onRemove,
@@ -143,7 +144,7 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
143
144
  onError = props.onError,
144
145
  onProgress = props.onProgress,
145
146
  onReupload = props.onReupload,
146
- rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "autoUpload", "action", "headers", "withCredentials", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
147
+ rest = _objectWithoutPropertiesLoose(props, ["as", "classPrefix", "className", "listType", "defaultFileList", "fileList", "fileListVisible", "locale", "style", "draggable", "name", "multiple", "disabled", "readOnly", "plaintext", "accept", "children", "toggleAs", "removable", "disabledFileItem", "maxPreviewFileSize", "autoUpload", "action", "headers", "withCredentials", "disableMultipart", "timeout", "data", "onRemove", "onUpload", "shouldUpload", "shouldQueueUpdate", "renderFileInfo", "onPreview", "onChange", "onSuccess", "onError", "onProgress", "onReupload"]);
147
148
 
148
149
  var _useClassNames = useClassNames(classPrefix),
149
150
  merge = _useClassNames.merge,
@@ -243,24 +244,28 @@ var Uploader = /*#__PURE__*/React.forwardRef(function (props, ref) {
243
244
  */
244
245
 
245
246
  var handleUploadFile = useCallback(function (file) {
246
- var xhr = ajaxUpload({
247
+ var _ajaxUpload = ajaxUpload({
247
248
  name: name,
248
249
  timeout: timeout,
249
250
  headers: headers,
250
251
  data: data,
251
252
  withCredentials: withCredentials,
253
+ disableMultipart: disableMultipart,
252
254
  file: file.blobFile,
253
255
  url: action,
254
256
  onError: handleAjaxUploadError.bind(null, file),
255
257
  onSuccess: handleAjaxUploadSuccess.bind(null, file),
256
258
  onProgress: handleAjaxUploadProgress.bind(null, file)
257
- });
259
+ }),
260
+ xhr = _ajaxUpload.xhr,
261
+ uploadData = _ajaxUpload.data;
262
+
258
263
  updateFileStatus(_extends({}, file, {
259
264
  status: 'uploading'
260
265
  }));
261
266
  xhrs.current[file.fileKey] = xhr;
262
- onUpload === null || onUpload === void 0 ? void 0 : onUpload(file);
263
- }, [action, data, handleAjaxUploadError, handleAjaxUploadProgress, handleAjaxUploadSuccess, headers, name, onUpload, timeout, updateFileStatus, withCredentials]);
267
+ onUpload === null || onUpload === void 0 ? void 0 : onUpload(file, uploadData, xhr);
268
+ }, [action, data, handleAjaxUploadError, handleAjaxUploadProgress, handleAjaxUploadSuccess, headers, name, onUpload, timeout, updateFileStatus, withCredentials, disableMultipart]);
264
269
  var handleAjaxUpload = useCallback(function () {
265
270
  fileList.current.forEach(function (file) {
266
271
  var checkState = shouldUpload === null || shouldUpload === void 0 ? void 0 : shouldUpload(file);
@@ -458,6 +463,7 @@ Uploader.propTypes = {
458
463
  renderFileInfo: PropTypes.func,
459
464
  removable: PropTypes.bool,
460
465
  fileListVisible: PropTypes.bool,
461
- draggable: PropTypes.bool
466
+ draggable: PropTypes.bool,
467
+ disableMultipart: PropTypes.bool
462
468
  };
463
469
  export default Uploader;
package/esm/index.d.ts CHANGED
@@ -74,6 +74,8 @@ export { default as InputPicker } from './InputPicker';
74
74
  export type { InputPickerProps } from './InputPicker';
75
75
  export { default as TagPicker } from './TagPicker';
76
76
  export type { TagPickerProps } from './TagPicker';
77
+ export { default as TagInput } from './TagInput';
78
+ export type { TagInputProps } from './TagInput';
77
79
  export { default as TreePicker } from './TreePicker';
78
80
  export type { TreePickerProps } from './TreePicker';
79
81
  export { default as CheckTreePicker } from './CheckTreePicker';
package/esm/index.js CHANGED
@@ -39,6 +39,7 @@ export { default as SelectPicker } from './SelectPicker';
39
39
  export { default as CheckPicker } from './CheckPicker';
40
40
  export { default as InputPicker } from './InputPicker';
41
41
  export { default as TagPicker } from './TagPicker';
42
+ export { default as TagInput } from './TagInput';
42
43
  export { default as TreePicker } from './TreePicker';
43
44
  export { default as CheckTreePicker } from './CheckTreePicker';
44
45
  export { default as Cascader } from './Cascader';
@@ -7,6 +7,7 @@ interface Options {
7
7
  timeout?: number;
8
8
  data?: any;
9
9
  withCredentials?: boolean;
10
+ disableMultipart?: boolean;
10
11
  headers?: any;
11
12
  file: File;
12
13
  url: string;
@@ -14,5 +15,8 @@ interface Options {
14
15
  onSuccess: (response: any, event: ProgressEvent, xhr: XMLHttpRequest) => void;
15
16
  onProgress: (percent: number, event: ProgressEvent, xhr: XMLHttpRequest) => void;
16
17
  }
17
- export default function ajaxUpload(options: Options): XMLHttpRequest;
18
+ export default function ajaxUpload(options: Options): {
19
+ xhr: XMLHttpRequest;
20
+ data: any;
21
+ };
18
22
  export {};
@@ -24,14 +24,22 @@ export default function ajaxUpload(options) {
24
24
  onProgress = options.onProgress,
25
25
  file = options.file,
26
26
  url = options.url,
27
- withCredentials = options.withCredentials;
27
+ withCredentials = options.withCredentials,
28
+ disableMultipart = options.disableMultipart;
28
29
  var xhr = new XMLHttpRequest();
29
- var formData = new FormData();
30
- formData.append(name, file, file.name);
30
+ var sendableData = null;
31
31
  xhr.open('POST', url, true);
32
- Object.keys(data).forEach(function (key) {
33
- return formData.append(key, data[key]);
34
- });
32
+
33
+ if (!disableMultipart) {
34
+ sendableData = new FormData();
35
+ sendableData.append(name, file, file.name);
36
+ Object.keys(data).forEach(function (key) {
37
+ return sendableData.append(key, data[key]);
38
+ });
39
+ } else {
40
+ sendableData = file;
41
+ }
42
+
35
43
  Object.keys(headers).forEach(function (key) {
36
44
  if (headers[key] !== null) {
37
45
  xhr.setRequestHeader(key, headers[key]);
@@ -46,7 +54,7 @@ export default function ajaxUpload(options) {
46
54
  xhr.timeout = timeout;
47
55
 
48
56
  xhr.ontimeout = function (event) {
49
- onError({
57
+ onError === null || onError === void 0 ? void 0 : onError({
50
58
  type: 'timeout'
51
59
  }, event, xhr);
52
60
  };
@@ -60,14 +68,14 @@ export default function ajaxUpload(options) {
60
68
  var resp = getResponse(xhr);
61
69
 
62
70
  if (xhr.status < 200 || xhr.status >= 300) {
63
- onError({
71
+ onError === null || onError === void 0 ? void 0 : onError({
64
72
  type: 'server_error',
65
73
  response: resp
66
74
  }, event, xhr);
67
75
  return;
68
76
  }
69
77
 
70
- onSuccess(resp, event, xhr);
78
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(resp, event, xhr);
71
79
  };
72
80
 
73
81
  if (xhr.upload) {
@@ -78,16 +86,19 @@ export default function ajaxUpload(options) {
78
86
  percent = event.loaded / event.total * 100;
79
87
  }
80
88
 
81
- onProgress(percent, event, xhr);
89
+ onProgress === null || onProgress === void 0 ? void 0 : onProgress(percent, event, xhr);
82
90
  };
83
91
  }
84
92
 
85
93
  xhr.onerror = function (event) {
86
- onError({
94
+ onError === null || onError === void 0 ? void 0 : onError({
87
95
  type: 'xhr_error'
88
96
  }, event, xhr);
89
97
  };
90
98
 
91
- xhr.send(formData);
92
- return xhr;
99
+ xhr.send(sendableData);
100
+ return {
101
+ xhr: xhr,
102
+ data: sendableData
103
+ };
93
104
  }
@@ -42,6 +42,7 @@ export declare const KEY_VALUES: {
42
42
  SPACE: string;
43
43
  BACKSPACE: string;
44
44
  DELETE: string;
45
+ COMMA: string;
45
46
  ESC: string;
46
47
  };
47
48
  export declare enum DATERANGE_DISABLED_TARGET {
@@ -52,6 +52,7 @@ export var KEY_VALUES = {
52
52
  // Editing Keys
53
53
  BACKSPACE: 'Backspace',
54
54
  DELETE: 'Delete',
55
+ COMMA: ',',
55
56
  // UI Keys
56
57
  ESC: 'Escape'
57
58
  };
@@ -19,6 +19,7 @@ export { default as isBefore } from 'date-fns/isBefore';
19
19
  export { default as isEqual } from 'date-fns/isEqual';
20
20
  export { default as isSameDay } from 'date-fns/isSameDay';
21
21
  export { default as isSameMonth } from 'date-fns/isSameMonth';
22
+ export { default as isSameSecond } from 'date-fns/isSameSecond';
22
23
  export { default as parse } from 'date-fns/parse';
23
24
  export { default as parseISO } from 'date-fns/parseISO';
24
25
  export { default as setDate } from 'date-fns/setDate';
@@ -26,6 +26,7 @@ export { default as isBefore } from 'date-fns/isBefore';
26
26
  export { default as isEqual } from 'date-fns/isEqual';
27
27
  export { default as isSameDay } from 'date-fns/isSameDay';
28
28
  export { default as isSameMonth } from 'date-fns/isSameMonth';
29
+ export { default as isSameSecond } from 'date-fns/isSameSecond';
29
30
  export { default as parse } from 'date-fns/parse';
30
31
  export { default as parseISO } from 'date-fns/parseISO';
31
32
  export { default as setDate } from 'date-fns/setDate';
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Used for generating unique ID for DOM elements
3
+ */
4
+ export default function useInternalId(prefix?: string): string;
@@ -0,0 +1,16 @@
1
+ import { useDebugValue, useRef } from 'react';
2
+ import uniqueId from 'lodash/uniqueId';
3
+ /**
4
+ * Used for generating unique ID for DOM elements
5
+ */
6
+
7
+ export default function useInternalId(prefix) {
8
+ var idRef = useRef();
9
+
10
+ if (!idRef.current) {
11
+ idRef.current = uniqueId("internal://" + prefix);
12
+ }
13
+
14
+ useDebugValue(idRef.current);
15
+ return idRef.current;
16
+ }
@@ -1,4 +1,4 @@
1
1
  /**
2
- * Used for generating unique ID for elements
2
+ * Used for generating unique ID for DOM elements
3
3
  */
4
4
  export default function useUniqueId(prefix?: string): string;
@@ -1,7 +1,7 @@
1
1
  import { useRef } from 'react';
2
2
  import uniqueId from 'lodash/uniqueId';
3
3
  /**
4
- * Used for generating unique ID for elements
4
+ * Used for generating unique ID for DOM elements
5
5
  */
6
6
 
7
7
  export default function useUniqueId(prefix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -39,8 +39,8 @@
39
39
  "prop-types": "^15.7.2",
40
40
  "react-text-mask": "^5.4.3",
41
41
  "react-virtualized": "^9.22.3",
42
- "rsuite-table": "^5.0.0-alpha.8",
43
- "schema-typed": "^2.0.0"
42
+ "rsuite-table": "^5.0.0",
43
+ "schema-typed": "^2.0.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.8.0",
@@ -57,10 +57,5 @@
57
57
  "dist/*",
58
58
  "*.less",
59
59
  "*.css"
60
- ],
61
- "husky": {
62
- "hooks": {
63
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
64
- }
65
- }
60
+ ]
66
61
  }
@@ -82,19 +82,19 @@
82
82
  --rs-message-success-header: #fff;
83
83
  --rs-message-success-text: #fff;
84
84
  --rs-message-success-icon: #fff;
85
- --rs-message-success-bg: @green;
85
+ --rs-message-success-bg: @green-500;
86
86
  --rs-message-info-header: #fff;
87
87
  --rs-message-info-text: #fff;
88
88
  --rs-message-info-icon: #fff;
89
- --rs-message-info-bg: @blue;
89
+ --rs-message-info-bg: @blue-500;
90
90
  --rs-message-warning-header: @B900;
91
91
  --rs-message-warning-text: @B900;
92
92
  --rs-message-warning-icon: @B900;
93
- --rs-message-warning-bg: @yellow;
93
+ --rs-message-warning-bg: @yellow-500;
94
94
  --rs-message-error-header: #fff;
95
95
  --rs-message-error-text: #fff;
96
96
  --rs-message-error-icon: #fff;
97
- --rs-message-error-bg: @red;
97
+ --rs-message-error-bg: @red-500;
98
98
 
99
99
  // Tooltip
100
100
  --rs-tooltip-bg: @B500;
@@ -159,6 +159,22 @@
159
159
  --rs-navbar-subtle-hover-bg: @B700;
160
160
  --rs-navbar-subtle-hover-text: @B050;
161
161
 
162
+ // Sidenav
163
+ --rs-sidenav-default-bg: @B800;
164
+ --rs-sidenav-default-text: @B200;
165
+ --rs-sidenav-default-selected-text: @H500;
166
+ --rs-sidenav-default-hover-bg: @B700;
167
+ --rs-sidenav-default-hover-text: @B050;
168
+ --rs-sidenav-inverse-bg: @H700;
169
+ --rs-sidenav-inverse-text: #fff;
170
+ --rs-sidenav-inverse-selected-bg: @H400;
171
+ --rs-sidenav-inverse-hover-bg: @H600;
172
+ --rs-sidenav-subtle-bg: transparent;
173
+ --rs-sidenav-subtle-text: @B200;
174
+ --rs-sidenav-subtle-selected-text: @H500;
175
+ --rs-sidenav-subtle-hover-bg: @B700;
176
+ --rs-sidenav-subtle-hover-text: @B050;
177
+
162
178
  // Input
163
179
  --rs-input-bg: @B800;
164
180
  --rs-input-focus-border: @H500;
@@ -184,6 +200,10 @@
184
200
  --rs-radio-checked-bg: @H500;
185
201
  --rs-radio-disabled-bg: @B500;
186
202
 
203
+ // Rate
204
+ --rs-rate-symbol: @B600;
205
+ --rs-rate-symbol-checked: @yellow-500;
206
+
187
207
  // Toggle
188
208
  --rs-toggle-bg: @B400;
189
209
  --rs-toggle-thumb: #fff;
@@ -191,6 +211,7 @@
191
211
  --rs-toggle-disabled-bg: @B600;
192
212
  --rs-toggle-disabled-thumb: @B500;
193
213
  --rs-toggle-checked-bg: @H700;
214
+ --rs-toggle-checked-thumb: #fff;
194
215
  --rs-toggle-checked-hover-bg: @H600;
195
216
  --rs-toggle-checked-disabled-bg: @H900;
196
217
  --rs-toggle-checked-disabled-thumb: @B300;
@@ -265,13 +286,15 @@
265
286
 
266
287
  // Picker
267
288
  --rs-picker-value: @H500;
268
- --rs-picker-count: @H700;
289
+ --rs-picker-count-bg: @H700;
290
+ --rs-picker-count-text: #fff;
269
291
 
270
292
  // Calendar
271
293
  --rs-calendar-today-bg: @H700;
272
294
  --rs-calendar-today-text: #fff;
273
295
  --rs-calendar-range-bg: fade(@H900, 50%);
274
296
  --rs-calendar-time-unit-bg: @B600;
297
+ --rs-calendar-date-selected-text: #fff;
275
298
 
276
299
  // Popover
277
300
  --rs-popover-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);