@ringcentral/juno 1.12.1-beta.5746-a8a4867a → 1.12.3

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 (173) hide show
  1. package/components/Buttons/Button/Button.d.ts +3 -3
  2. package/components/Buttons/Button/styles/StyledButton.js +4 -2
  3. package/components/Buttons/IconButton/IconButton.d.ts +1 -1
  4. package/components/Buttons/ToggleButton/ToggleButton.d.ts +1 -1
  5. package/components/Card/Card/Card.d.ts +2 -2
  6. package/components/Chip/Chip.d.ts +10 -3
  7. package/components/Chip/Chip.js +5 -3
  8. package/components/Chip/styles/ChipStyle.js +5 -4
  9. package/components/Chip/utils/ChipUtils.d.ts +1 -1
  10. package/components/Chip/utils/ChipUtils.js +1 -1
  11. package/components/Dialer/DialPad/index.d.ts +2 -0
  12. package/components/Dialer/DialPad/index.js +2 -0
  13. package/components/Dialer/DialTextField/DialTextField.d.ts +1 -1
  14. package/components/Dialog/Dialog.js +1 -1
  15. package/components/Downshift/Downshift.d.ts +21 -10
  16. package/components/Downshift/Downshift.js +15 -5
  17. package/components/Downshift/SuggestionList/SuggestionList.d.ts +2 -2
  18. package/components/Downshift/SuggestionList/SuggestionList.js +12 -6
  19. package/components/Downshift/SuggestionList/utils/index.d.ts +1 -0
  20. package/components/Downshift/SuggestionList/utils/index.js +1 -0
  21. package/components/Downshift/SuggestionList/utils/useSuggestionList.d.ts +298 -0
  22. package/components/Downshift/SuggestionList/utils/useSuggestionList.js +239 -0
  23. package/components/Downshift/styles/DownshiftStyle.d.ts +1 -1
  24. package/components/Downshift/styles/StyledTextField.d.ts +1 -1
  25. package/components/Downshift/utils/DownshiftUtils.d.ts +12 -0
  26. package/components/Downshift/utils/DownshiftUtils.js +19 -1
  27. package/components/Downshift/utils/SelectItem.d.ts +19 -0
  28. package/components/Downshift/utils/useDownshift.d.ts +5 -2
  29. package/components/Downshift/utils/useDownshift.interface.d.ts +5 -0
  30. package/components/Downshift/utils/useDownshift.js +31 -13
  31. package/components/Downshift/utils/useDownshiftGroup.d.ts +7 -7
  32. package/components/Downshift/utils/useDownshiftGroup.js +45 -19
  33. package/components/Forms/Checkbox/Checkbox.d.ts +1 -1
  34. package/components/Forms/Picker/DatePicker/styles/StyledDatePickerHeader.d.ts +1 -1
  35. package/components/Forms/Picker/TimePicker/NumberPicker.js +1 -3
  36. package/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +1 -1
  37. package/components/Forms/Picker/styles/StyledPickerTextField.d.ts +1 -1
  38. package/components/Forms/Radio/Radio.d.ts +1 -1
  39. package/components/Forms/Select/PlainSelect/PlainSelect.d.ts +1 -1
  40. package/components/Forms/Select/PlainSelect/PlainSelect.js +5 -4
  41. package/components/Forms/Select/PlainSelect/styles/StyledSelect.js +4 -3
  42. package/components/Forms/Select/Select.d.ts +2 -2
  43. package/components/Forms/Select/Select.js +2 -2
  44. package/components/Forms/Select/styles/StyledSelect.js +22 -18
  45. package/components/Forms/Select/utils/SelectInput/SelectInput.d.ts +1 -1
  46. package/components/Forms/TextField/TextField.d.ts +5 -3
  47. package/components/Forms/TextField/TextField.js +2 -2
  48. package/components/Forms/TextField/styles/ClearIconButton.d.ts +2 -2
  49. package/components/Forms/TextField/styles/OutlineTextFieldStyle.js +4 -2
  50. package/components/Forms/TextField/styles/TextFieldStyle.js +8 -4
  51. package/components/Forms/Textarea/Textarea.d.ts +1 -1
  52. package/components/Forms/Textarea/Textarea.js +8 -3
  53. package/components/Icon/assets/icon-Description.svg +5 -0
  54. package/components/Icon/assets/icon-poll.svg +5 -0
  55. package/components/Icon/assets/icon-poll_border.svg +5 -0
  56. package/components/Icon/icon-symbol.d.ts +1 -1
  57. package/components/Icon/icon-symbol.js +1 -1
  58. package/components/List/ListItem/ListItem.d.ts +1 -1
  59. package/components/Menu/MenuItem/MenuItem.d.ts +13 -5
  60. package/components/Menu/SubMenu/SubMenu.js +1 -1
  61. package/components/PopupBox/PopupBox.js +11 -3
  62. package/components/PortalHost/PortalManager/PortalManager.d.ts +2 -2
  63. package/components/PortalHost/PortalManager/PortalManager.js +9 -3
  64. package/components/PortalHost/PortalManager/types.d.ts +2 -1
  65. package/components/Snackbar/Snackbar.js +1 -1
  66. package/components/TablePagination/styles/TablePaginationStyle.d.ts +13 -5
  67. package/components/Tooltip/withTooltip/withTooltip.d.ts +6 -4
  68. package/components/Typography/Typography.d.ts +1 -1
  69. package/components/Virtuoso/react-virtuoso/Grid.d.ts +1 -1
  70. package/components/Virtuoso/react-virtuoso/List.d.ts +1 -1
  71. package/components/Virtuoso/utils/useHighlightScroll.d.ts +1 -1
  72. package/es6/components/Buttons/Button/styles/StyledButton.js +4 -2
  73. package/es6/components/Chip/Chip.js +6 -4
  74. package/es6/components/Chip/styles/ChipStyle.js +6 -5
  75. package/es6/components/Chip/utils/ChipUtils.js +1 -1
  76. package/es6/components/Dialer/DialPad/index.js +2 -0
  77. package/es6/components/Dialog/Dialog.js +2 -2
  78. package/es6/components/Downshift/Downshift.js +16 -7
  79. package/es6/components/Downshift/SuggestionList/SuggestionList.js +13 -7
  80. package/es6/components/Downshift/SuggestionList/utils/index.js +1 -0
  81. package/es6/components/Downshift/SuggestionList/utils/useSuggestionList.js +237 -0
  82. package/es6/components/Downshift/utils/DownshiftUtils.js +19 -1
  83. package/es6/components/Downshift/utils/useDownshift.js +31 -13
  84. package/es6/components/Downshift/utils/useDownshiftGroup.js +46 -20
  85. package/es6/components/Forms/Picker/TimePicker/NumberPicker.js +1 -3
  86. package/es6/components/Forms/Picker/TimePicker/utils/TimePickerHelper.js +1 -1
  87. package/es6/components/Forms/Select/PlainSelect/PlainSelect.js +5 -4
  88. package/es6/components/Forms/Select/PlainSelect/styles/StyledSelect.js +4 -3
  89. package/es6/components/Forms/Select/Select.js +2 -2
  90. package/es6/components/Forms/Select/styles/StyledSelect.js +24 -20
  91. package/es6/components/Forms/TextField/TextField.js +2 -2
  92. package/es6/components/Forms/TextField/styles/OutlineTextFieldStyle.js +5 -3
  93. package/es6/components/Forms/TextField/styles/TextFieldStyle.js +9 -5
  94. package/es6/components/Forms/Textarea/Textarea.js +8 -3
  95. package/es6/components/Icon/assets/icon-Description.svg +5 -0
  96. package/es6/components/Icon/assets/icon-poll.svg +5 -0
  97. package/es6/components/Icon/assets/icon-poll_border.svg +5 -0
  98. package/es6/components/Icon/icon-symbol.js +1 -1
  99. package/es6/components/Menu/SubMenu/SubMenu.js +1 -1
  100. package/es6/components/PopupBox/PopupBox.js +13 -5
  101. package/es6/components/PortalHost/PortalManager/PortalManager.js +9 -3
  102. package/es6/components/Snackbar/Snackbar.js +2 -2
  103. package/es6/foundation/hooks/index.js +1 -0
  104. package/es6/foundation/hooks/useAnnouncer/useAnnouncer.js +7 -0
  105. package/es6/foundation/hooks/useInterval/index.js +1 -0
  106. package/es6/foundation/hooks/useInterval/useInterval.js +86 -0
  107. package/es6/foundation/hooks/useKeyboardMoveFocus/useKeyboardMoveFocus.js +2 -1
  108. package/es6/icon/DefaultFile.js +1 -1
  109. package/es6/icon/DefaultGdrive.js +1 -1
  110. package/es6/icon/DefaultMusic.js +1 -1
  111. package/es6/icon/DefaultVideo.js +1 -1
  112. package/es6/icon/DeletedFile.js +1 -1
  113. package/es6/icon/Description.js +7 -0
  114. package/es6/icon/Doc.js +1 -1
  115. package/es6/icon/Excel.js +1 -1
  116. package/es6/icon/GifFile.js +1 -1
  117. package/es6/icon/GoogleDoc.js +1 -1
  118. package/es6/icon/GoogleSheet.js +1 -1
  119. package/es6/icon/GoogleSlide.js +1 -1
  120. package/es6/icon/ImageBroken.js +1 -1
  121. package/es6/icon/ImagePreview.js +1 -1
  122. package/es6/icon/MacKeynote.js +1 -1
  123. package/es6/icon/MacNumbers.js +1 -1
  124. package/es6/icon/MacPages.js +1 -1
  125. package/es6/icon/Pdf.js +1 -1
  126. package/es6/icon/Poll.js +7 -0
  127. package/es6/icon/PollBorder.js +7 -0
  128. package/es6/icon/Ppt.js +1 -1
  129. package/es6/icon/Zip.js +1 -1
  130. package/es6/icon/index.js +3 -0
  131. package/es6/icons/icon-Description.svg +5 -0
  132. package/es6/icons/icon-poll.svg +5 -0
  133. package/es6/icons/icon-poll_border.svg +5 -0
  134. package/foundation/hooks/index.d.ts +1 -0
  135. package/foundation/hooks/index.js +1 -0
  136. package/foundation/hooks/useAnnouncer/useAnnouncer.d.ts +7 -0
  137. package/foundation/hooks/useAnnouncer/useAnnouncer.js +7 -0
  138. package/foundation/hooks/useInterval/index.d.ts +1 -0
  139. package/foundation/hooks/useInterval/index.js +4 -0
  140. package/foundation/hooks/useInterval/useInterval.d.ts +43 -0
  141. package/foundation/hooks/useInterval/useInterval.js +88 -0
  142. package/foundation/hooks/useKeyboardMoveFocus/useKeyboardMoveFocus.js +2 -1
  143. package/icon/DefaultFile.js +1 -1
  144. package/icon/DefaultGdrive.js +1 -1
  145. package/icon/DefaultMusic.js +1 -1
  146. package/icon/DefaultVideo.js +1 -1
  147. package/icon/DeletedFile.js +1 -1
  148. package/icon/Description.d.ts +3 -0
  149. package/icon/Description.js +9 -0
  150. package/icon/Doc.js +1 -1
  151. package/icon/Excel.js +1 -1
  152. package/icon/GifFile.js +1 -1
  153. package/icon/GoogleDoc.js +1 -1
  154. package/icon/GoogleSheet.js +1 -1
  155. package/icon/GoogleSlide.js +1 -1
  156. package/icon/ImageBroken.js +1 -1
  157. package/icon/ImagePreview.js +1 -1
  158. package/icon/MacKeynote.js +1 -1
  159. package/icon/MacNumbers.js +1 -1
  160. package/icon/MacPages.js +1 -1
  161. package/icon/Pdf.js +1 -1
  162. package/icon/Poll.d.ts +3 -0
  163. package/icon/Poll.js +9 -0
  164. package/icon/PollBorder.d.ts +3 -0
  165. package/icon/PollBorder.js +9 -0
  166. package/icon/Ppt.js +1 -1
  167. package/icon/Zip.js +1 -1
  168. package/icon/index.d.ts +3 -0
  169. package/icon/index.js +6 -0
  170. package/icons/icon-Description.svg +5 -0
  171. package/icons/icon-poll.svg +5 -0
  172. package/icons/icon-poll_border.svg +5 -0
  173. package/package.json +3 -3
@@ -178,7 +178,7 @@ var _RcSubMenu = forwardRef(function (inProps, ref) {
178
178
  title,
179
179
  React.createElement(StyledListItemSecondaryAction, null,
180
180
  React.createElement(RcIcon, { size: "medium", color: "neutral.f04", symbol: ArrowRight }))),
181
- React.createElement(RcPopper, __assign({ role: "menu", id: popperId, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body }, restPopperProps, { ref: popperRef, open: open, anchorEl: anchorEl, transition: true, placement: "right-start", modifiers: modifiers, onKeyDown: handlePopperKeyDown, onMouseLeave: handlePopperMouseLeave }), function (_a) {
181
+ React.createElement(RcPopper, __assign({ role: "menu", id: popperId, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, placement: "right-start" }, restPopperProps, { ref: popperRef, open: open, anchorEl: anchorEl, transition: true, modifiers: modifiers, onKeyDown: handlePopperKeyDown, onMouseLeave: handlePopperMouseLeave }), function (_a) {
182
182
  var TransitionProps = _a.TransitionProps;
183
183
  return (React.createElement(StyledGrow, __assign({}, TransitionProps, { timeout: "auto" }),
184
184
  React.createElement(RcPaper, null,
@@ -1,6 +1,6 @@
1
1
  import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import React, { forwardRef, useMemo } from 'react';
3
- import { combineProps, styled, useThemeProps, } from '../../foundation';
2
+ import React, { forwardRef } from 'react';
3
+ import { styled, useEventCallback, useThemeProps, } from '../../foundation';
4
4
  import { RcButton } from '../Buttons/Button';
5
5
  import { RcDialog, RcDialogActions, RcDialogContent, RcDialogContentText, RcDialogTitle, } from '../Dialog';
6
6
  import { RcLoading } from '../Loading';
@@ -10,10 +10,18 @@ var _RcPopupBox = forwardRef(function (inProps, ref) {
10
10
  // ok btn
11
11
  confirmButtonText = props.confirmButtonText, confirmButtonProps = props.confirmButtonProps, onConfirm = props.onConfirm,
12
12
  // cancel btn
13
- cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = __rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "ActionsProps", "children", "onClose", "open"]);
13
+ cancelButtonText = props.cancelButtonText, cancelButtonProps = props.cancelButtonProps, onCancel = props.onCancel, TitleProps = props.TitleProps, ContentProps = props.ContentProps, disableBackdropClickProp = props.disableBackdropClick, ActionsProps = props.ActionsProps, children = props.children, onClose = props.onClose, open = props.open, rest = __rest(props, ["childrenSize", "title", "footer", "loadingOverlay", "loading", "confirmButtonText", "confirmButtonProps", "onConfirm", "cancelButtonText", "cancelButtonProps", "onCancel", "TitleProps", "ContentProps", "disableBackdropClick", "ActionsProps", "children", "onClose", "open"]);
14
14
  var isXsmall = childrenSize === 'small';
15
- var handleClose = useMemo(function () { return combineProps({ onClose: onCancel }, { onClose: onClose }); }, [onCancel, onClose]).onClose;
16
- return (React.createElement(RcDialog, __assign({ ref: ref, childrenSize: childrenSize, disableEscapeKeyDown: loading || loadingOverlay, disableBackdropClick: loading || loadingOverlay, onClose: handleClose, open: open }, rest),
15
+ var isLoading = loading || loadingOverlay;
16
+ var disableBackdropClick = disableBackdropClickProp !== null && disableBackdropClickProp !== void 0 ? disableBackdropClickProp : isLoading;
17
+ var handleClose = useEventCallback(function (e, reason) {
18
+ if (reason === 'backdropClick' && disableBackdropClick) {
19
+ return;
20
+ }
21
+ onClose === null || onClose === void 0 ? void 0 : onClose(e, reason);
22
+ onCancel === null || onCancel === void 0 ? void 0 : onCancel(e, reason);
23
+ });
24
+ return (React.createElement(RcDialog, __assign({ ref: ref, childrenSize: childrenSize, disableEscapeKeyDown: isLoading, onClose: handleClose, open: open }, rest),
17
25
  React.createElement(RcLoading, { loading: loadingOverlay },
18
26
  React.createElement(RcDialogTitle, __assign({ "data-test-automation-id": 'DialogTitle' }, TitleProps), title),
19
27
  React.createElement(RcDialogContent, __assign({ "data-test-automation-id": 'DialogContent' }, ContentProps), typeof children === 'string' ? (React.createElement(RcDialogContentText, null, children)) : (children)),
@@ -148,7 +148,7 @@ var PortalManager = /** @class */ (function (_super) {
148
148
  /**
149
149
  * update props by id, equal 'portalController.updateProps(newProps)'
150
150
  */
151
- PortalManager.prototype.updatePropsByID = function (id, props) {
151
+ PortalManager.prototype.updatePropsByID = function (id, propsOrHandler) {
152
152
  var portal = this.portalStore.get(id);
153
153
  if (!(portal === null || portal === void 0 ? void 0 : portal.open)) {
154
154
  logInDev({
@@ -157,6 +157,12 @@ var PortalManager = /** @class */ (function (_super) {
157
157
  });
158
158
  return;
159
159
  }
160
+ var props = (function () {
161
+ if (typeof propsOrHandler === 'function') {
162
+ return propsOrHandler(portal.props);
163
+ }
164
+ return propsOrHandler;
165
+ })();
160
166
  this.portalStore.addOrUpdate(__assign(__assign({}, portal), { props: props }));
161
167
  };
162
168
  PortalManager.prototype.onConnected = function () {
@@ -187,8 +193,8 @@ var PortalManager = /** @class */ (function (_super) {
187
193
  close: function (feedback) {
188
194
  _this.closeByID(id, feedback);
189
195
  },
190
- updateProps: function (newProps) {
191
- _this.updatePropsByID(id, newProps);
196
+ updateProps: function (propsOrHandler) {
197
+ _this.updatePropsByID(id, propsOrHandler);
192
198
  },
193
199
  data: data,
194
200
  get isOpened() {
@@ -2,7 +2,7 @@ import { __assign, __makeTemplateObject, __rest } from "tslib";
2
2
  import React, { forwardRef, useMemo } from 'react';
3
3
  import Slide from '@material-ui/core/Slide';
4
4
  import MuiSnackbar from '@material-ui/core/Snackbar';
5
- import { combineClasses, combineProps, styled, useThemeProps, } from '../../foundation';
5
+ import { combineClasses, styled, useThemeProps, } from '../../foundation';
6
6
  import { useUnmountPortalHandler } from '../PortalHost';
7
7
  import { RcSnackbarContent } from './SnackbarContent';
8
8
  import { SnackbarStyle } from './styles';
@@ -12,7 +12,7 @@ var _RcSnackbar = forwardRef(function (inProps, ref) {
12
12
  var classesProp = props.classes, size = props.size, type = props.type, message = props.message, action = props.action, ContentProps = props.ContentProps, children = props.children, TransitionPropsProp = props.TransitionProps, rest = __rest(props, ["classes", "size", "type", "message", "action", "ContentProps", "children", "TransitionProps"]);
13
13
  var classes = useMemo(function () { return combineClasses(RcSnackbarClasses, classesProp); }, [classesProp]);
14
14
  var onExited = useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
15
- var TransitionProps = useMemo(function () { return combineProps({ onExited: onExited }, TransitionPropsProp); }, [TransitionPropsProp, onExited]);
15
+ var TransitionProps = __assign(__assign({}, TransitionPropsProp), { onExited: onExited });
16
16
  return (React.createElement(MuiSnackbar, __assign({ ref: ref, classes: classes, TransitionProps: TransitionProps }, rest), children || (React.createElement(RcSnackbarContent, __assign({ size: size, type: type, message: message, action: action }, ContentProps)))));
17
17
  });
18
18
  var RcSnackbar = styled(_RcSnackbar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), SnackbarStyle);
@@ -9,6 +9,7 @@ export * from './useForceUpdate';
9
9
  export * from './useForkRef';
10
10
  export * from './useHiddenTabindex';
11
11
  export * from './useId';
12
+ export * from './useInterval';
12
13
  export * from './useKeyDownOnce';
13
14
  export * from './useKeyboardMoveFocus';
14
15
  export * from './useLongPress';
@@ -3,6 +3,13 @@ import { useId } from '../useId';
3
3
  export var visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n";
4
4
  /**
5
5
  * read announce when need read message.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * const announce = useAnnouncer('simpleId');
10
+ *
11
+ * announce(`You click "Announce" button`);
12
+ * ```
6
13
  */
7
14
  export var useAnnouncer = function (id) {
8
15
  var _id = useId(id ? "rc-announcer-" + id : 'rc-announcer', !id);
@@ -0,0 +1 @@
1
+ export * from './useInterval';
@@ -0,0 +1,86 @@
1
+ import { useEffect, useRef, useCallback } from 'react';
2
+ import { useEventCallback } from '../useEventCallback';
3
+ /**
4
+ * controllable interval, provide easy way to control interval
5
+ *
6
+ * - cancel: cancel current interval
7
+ * - pause: pause current interval
8
+ * - play: play current interval
9
+ * - getRunning: return current interval running state
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const { cancel, play, pause } = useInterval(() => {
14
+ * console.log('interval be triggered');
15
+ * }, 1000)
16
+ *
17
+ * // get current run times
18
+ * useInterval((times) => {
19
+ * console.log('current times start from 1', times);
20
+ * }, 2000)
21
+ *
22
+ * // not start interval immediately
23
+ * useInterval((times) => {
24
+ * console.log('current times start from 1', times);
25
+ * }, 2000, false)
26
+ * ```
27
+ */
28
+ export var useInterval = function (
29
+ /** callback with times, times start from 1 */
30
+ callback,
31
+ /** what delay time of that interval */
32
+ delay,
33
+ /** is that start interval immediately */
34
+ startImmediately) {
35
+ if (delay === void 0) { delay = 0; }
36
+ if (startImmediately === void 0) { startImmediately = true; }
37
+ var intervalRef = useRef();
38
+ var countRef = useRef(0);
39
+ var getRunning = useEventCallback(function () { return !!intervalRef.current; });
40
+ var savedCallback = useEventCallback(function (times) {
41
+ callback(times);
42
+ });
43
+ var pause = useCallback(function () {
44
+ if (intervalRef.current) {
45
+ clearInterval(intervalRef.current);
46
+ intervalRef.current = undefined;
47
+ }
48
+ }, []);
49
+ var cancel = useCallback(function () {
50
+ pause();
51
+ countRef.current = 0;
52
+ }, [pause]);
53
+ var play = useCallback(function () {
54
+ var isRunning = getRunning();
55
+ if (isRunning)
56
+ return;
57
+ intervalRef.current = window.setInterval(function () {
58
+ countRef.current++;
59
+ savedCallback(countRef.current);
60
+ }, delay);
61
+ }, [delay, getRunning, savedCallback]);
62
+ useEffect(function () {
63
+ if (startImmediately) {
64
+ play();
65
+ }
66
+ return function () { return cancel(); };
67
+ }, [cancel, play, startImmediately]);
68
+ return {
69
+ /**
70
+ * cancel current interval
71
+ */
72
+ cancel: cancel,
73
+ /**
74
+ * pause current interval
75
+ */
76
+ pause: pause,
77
+ /**
78
+ * play current interval
79
+ */
80
+ play: play,
81
+ /**
82
+ * return current interval running state
83
+ */
84
+ getRunning: getRunning,
85
+ };
86
+ };
@@ -56,7 +56,8 @@ export var useKeyboardMoveFocus = function (_a) {
56
56
  // * mean that item is disabled, use same direction find next
57
57
  else {
58
58
  // * find toIndex is same as current, mean that already find all
59
- if (toIndex === Math.max(focusedIndexRef.current, 0)) {
59
+ if (focusedIndexRef.current !== -1 &&
60
+ toIndex === Math.max(focusedIndexRef.current, 0)) {
60
61
  break;
61
62
  }
62
63
  currIndex = toIndex;
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DefaultFileD from './DefaultFileD';
5
5
  var DefaultFile = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DefaultGdriveD from './DefaultGdriveD';
5
5
  var DefaultGdrive = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DefaultMusicD from './DefaultMusicD';
5
5
  var DefaultMusic = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DefaultVideoD from './DefaultVideoD';
5
5
  var DefaultVideo = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DeletedFileD from './DeletedFileD';
5
5
  var DeletedFile = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -0,0 +1,7 @@
1
+ import { __assign } from "tslib";
2
+ import React, { forwardRef, memo } from 'react';
3
+ var Description = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ref: svgRef }, props),
4
+ React.createElement("path", { d: "M19.25 24c.414 0 .75.448.75 1s-.336 1-.75 1H2.75c-.414 0-.75-.448-.75-1s.336-1 .75-1h16.5zm9.583-9c.644 0 1.167.448 1.167 1s-.522 1-1.167 1H3.166c-.644 0-1.167-.448-1.167-1s.522-1 1.167-1h25.667zm0-9C29.477 6 30 6.448 30 7s-.522 1-1.167 1H3.166c-.644 0-1.167-.448-1.167-1s.522-1 1.167-1h25.667z" }))); }));
5
+ Description.displayName = 'Description';
6
+ Description['iconName'] = 'Description';
7
+ export default Description;
package/es6/icon/Doc.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import DocD from './DocD';
5
5
  var Doc = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
package/es6/icon/Excel.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import ExcelD from './ExcelD';
5
5
  var Excel = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import GifFileD from './GifFileD';
5
5
  var GifFile = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import GoogleDocD from './GoogleDocD';
5
5
  var GoogleDoc = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import GoogleSheetD from './GoogleSheetD';
5
5
  var GoogleSheet = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import GoogleSlideD from './GoogleSlideD';
5
5
  var GoogleSlide = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import ImageBrokenD from './ImageBrokenD';
5
5
  var ImageBroken = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import ImagePreviewD from './ImagePreviewD';
5
5
  var ImagePreview = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import MacKeynoteD from './MacKeynoteD';
5
5
  var MacKeynote = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import MacNumbersD from './MacNumbersD';
5
5
  var MacNumbers = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import MacPagesD from './MacPagesD';
5
5
  var MacPages = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
package/es6/icon/Pdf.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import PdfD from './PdfD';
5
5
  var Pdf = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
@@ -0,0 +1,7 @@
1
+ import { __assign } from "tslib";
2
+ import React, { forwardRef, memo } from 'react';
3
+ var Poll = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ref: svgRef }, props),
4
+ React.createElement("path", { d: "M25 5a2 2 0 012 2v18a2 2 0 01-2 2H7a2 2 0 01-2-2V7a2 2 0 012-2h18zm-14 8a1 1 0 00-1 1v7a1 1 0 002 0v-7a1 1 0 00-1-1zm5-3a1 1 0 00-1 1v10a1 1 0 002 0V11a1 1 0 00-1-1zm5 5a1 1 0 00-1 1v5a1 1 0 002 0v-5a1 1 0 00-1-1z" }))); }));
5
+ Poll.displayName = 'Poll';
6
+ Poll['iconName'] = 'poll';
7
+ export default Poll;
@@ -0,0 +1,7 @@
1
+ import { __assign } from "tslib";
2
+ import React, { forwardRef, memo } from 'react';
3
+ var PollBorder = memo(forwardRef(function (props, svgRef) { return (React.createElement("svg", __assign({ viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg", ref: svgRef }, props),
4
+ React.createElement("path", { d: "M25 5a2 2 0 012 2v18a2 2 0 01-2 2H7a2 2 0 01-2-2V7a2 2 0 012-2h18zm-1 2H8a1 1 0 00-.993.883L7 8v16a1 1 0 00.883.993L8 25h16a1 1 0 00.993-.883L25 24V8a1 1 0 00-1-1zm-13 6a1 1 0 011 1v7a1 1 0 01-2 0v-7a1 1 0 011-1zm5-3a1 1 0 011 1v10a1 1 0 01-2 0V11a1 1 0 011-1zm5 5a1 1 0 011 1v5a1 1 0 01-2 0v-5a1 1 0 011-1z" }))); }));
5
+ PollBorder.displayName = 'PollBorder';
6
+ PollBorder['iconName'] = 'poll_border';
7
+ export default PollBorder;
package/es6/icon/Ppt.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import PptD from './PptD';
5
5
  var Ppt = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
package/es6/icon/Zip.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __assign, __rest } from "tslib";
2
- import React, { forwardRef, memo } from 'react';
3
2
  import { useTheme } from '@material-ui/core';
3
+ import React, { forwardRef, memo } from 'react';
4
4
  import ZipD from './ZipD';
5
5
  var Zip = memo(forwardRef(function (inProps, svgRef) {
6
6
  var theme = useTheme();
package/es6/icon/index.js CHANGED
@@ -10,6 +10,7 @@ export { default as Svg8 } from './8';
10
10
  export { default as Svg9 } from './9';
11
11
  export { default as CompanySetupBorder } from './CompanySetupBorder';
12
12
  export { default as CompanySetup } from './CompanySetup';
13
+ export { default as Description } from './Description';
13
14
  export { default as Hud } from './Hud';
14
15
  export { default as Logout } from './Logout';
15
16
  export { default as NewEmail } from './NewEmail';
@@ -280,6 +281,8 @@ export { default as PlayBorder } from './PlayBorder';
280
281
  export { default as PlayCircle } from './PlayCircle';
281
282
  export { default as PlayCircleBorder } from './PlayCircleBorder';
282
283
  export { default as Play } from './Play';
284
+ export { default as PollBorder } from './PollBorder';
285
+ export { default as Poll } from './Poll';
283
286
  export { default as PoorConnection } from './PoorConnection';
284
287
  export { default as PptD } from './PptD';
285
288
  export { default as Ppt } from './Ppt';
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>Description</title>
4
+ <path d="M19.25 24c0.414 0 0.75 0.448 0.75 1s-0.336 1-0.75 1h-16.5c-0.414 0-0.75-0.448-0.75-1s0.336-1 0.75-1h16.5zM28.833 15c0.644 0 1.167 0.448 1.167 1s-0.522 1-1.167 1h-25.667c-0.644 0-1.167-0.448-1.167-1s0.522-1 1.167-1h25.667zM28.833 6c0.644 0 1.167 0.448 1.167 1s-0.522 1-1.167 1h-25.667c-0.644 0-1.167-0.448-1.167-1s0.522-1 1.167-1h25.667z"></path>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>poll</title>
4
+ <path d="M25 5c1.105 0 2 0.895 2 2v18c0 1.105-0.895 2-2 2h-18c-1.105 0-2-0.895-2-2v-18c0-1.105 0.895-2 2-2h18zM11 13c-0.552 0-1 0.448-1 1v0 7c0 0.552 0.448 1 1 1s1-0.448 1-1v0-7c0-0.552-0.448-1-1-1zM16 10c-0.552 0-1 0.448-1 1v0 10c0 0.552 0.448 1 1 1s1-0.448 1-1v0-10c0-0.552-0.448-1-1-1zM21 15c-0.552 0-1 0.448-1 1v0 5c0 0.552 0.448 1 1 1s1-0.448 1-1v0-5c0-0.552-0.448-1-1-1z"></path>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>poll_border</title>
4
+ <path d="M25 5c1.105 0 2 0.895 2 2v18c0 1.105-0.895 2-2 2h-18c-1.105 0-2-0.895-2-2v-18c0-1.105 0.895-2 2-2h18zM24 7h-16c-0.513 0-0.936 0.386-0.993 0.883l-0.007 0.117v16c0 0.513 0.386 0.936 0.883 0.993l0.117 0.007h16c0.513 0 0.936-0.386 0.993-0.883l0.007-0.117v-16c0-0.552-0.448-1-1-1zM11 13c0.552 0 1 0.448 1 1v7c0 0.552-0.448 1-1 1s-1-0.448-1-1v-7c0-0.552 0.448-1 1-1zM16 10c0.552 0 1 0.448 1 1v10c0 0.552-0.448 1-1 1s-1-0.448-1-1v-10c0-0.552 0.448-1 1-1zM21 15c0.552 0 1 0.448 1 1v5c0 0.552-0.448 1-1 1s-1-0.448-1-1v-5c0-0.552 0.448-1 1-1z"></path>
5
+ </svg>
@@ -9,6 +9,7 @@ export * from './useForceUpdate';
9
9
  export * from './useForkRef';
10
10
  export * from './useHiddenTabindex';
11
11
  export * from './useId';
12
+ export * from './useInterval';
12
13
  export * from './useKeyDownOnce';
13
14
  export * from './useKeyboardMoveFocus';
14
15
  export * from './useLongPress';
@@ -12,6 +12,7 @@ tslib_1.__exportStar(require("./useForceUpdate"), exports);
12
12
  tslib_1.__exportStar(require("./useForkRef"), exports);
13
13
  tslib_1.__exportStar(require("./useHiddenTabindex"), exports);
14
14
  tslib_1.__exportStar(require("./useId"), exports);
15
+ tslib_1.__exportStar(require("./useInterval"), exports);
15
16
  tslib_1.__exportStar(require("./useKeyDownOnce"), exports);
16
17
  tslib_1.__exportStar(require("./useKeyboardMoveFocus"), exports);
17
18
  tslib_1.__exportStar(require("./useLongPress"), exports);
@@ -1,5 +1,12 @@
1
1
  export declare const visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n";
2
2
  /**
3
3
  * read announce when need read message.
4
+ *
5
+ * @example
6
+ * ```ts
7
+ * const announce = useAnnouncer('simpleId');
8
+ *
9
+ * announce(`You click "Announce" button`);
10
+ * ```
4
11
  */
5
12
  export declare const useAnnouncer: (id?: string | undefined) => (message?: string | undefined) => void;
@@ -5,6 +5,13 @@ var useId_1 = require("../useId");
5
5
  exports.visuallyHiddenStyles = "\n clip-path: inset(100%);\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n";
6
6
  /**
7
7
  * read announce when need read message.
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const announce = useAnnouncer('simpleId');
12
+ *
13
+ * announce(`You click "Announce" button`);
14
+ * ```
8
15
  */
9
16
  exports.useAnnouncer = function (id) {
10
17
  var _id = useId_1.useId(id ? "rc-announcer-" + id : 'rc-announcer', !id);
@@ -0,0 +1 @@
1
+ export * from './useInterval';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./useInterval"), exports);
@@ -0,0 +1,43 @@
1
+ /**
2
+ * controllable interval, provide easy way to control interval
3
+ *
4
+ * - cancel: cancel current interval
5
+ * - pause: pause current interval
6
+ * - play: play current interval
7
+ * - getRunning: return current interval running state
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const { cancel, play, pause } = useInterval(() => {
12
+ * console.log('interval be triggered');
13
+ * }, 1000)
14
+ *
15
+ * // get current run times
16
+ * useInterval((times) => {
17
+ * console.log('current times start from 1', times);
18
+ * }, 2000)
19
+ *
20
+ * // not start interval immediately
21
+ * useInterval((times) => {
22
+ * console.log('current times start from 1', times);
23
+ * }, 2000, false)
24
+ * ```
25
+ */
26
+ export declare const useInterval: (callback: (times: number) => void, delay?: number, startImmediately?: boolean) => {
27
+ /**
28
+ * cancel current interval
29
+ */
30
+ cancel: () => void;
31
+ /**
32
+ * pause current interval
33
+ */
34
+ pause: () => void;
35
+ /**
36
+ * play current interval
37
+ */
38
+ play: () => void;
39
+ /**
40
+ * return current interval running state
41
+ */
42
+ getRunning: () => boolean;
43
+ };