@ringcentral/juno 2.0.0-rc.0 → 2.0.3-beta.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 (95) hide show
  1. package/README.md +3 -2
  2. package/components/Avatar/Avatar.js +36 -32
  3. package/components/Buttons/Button/Button.js +11 -7
  4. package/components/Buttons/IconButton/IconButton.js +5 -3
  5. package/components/Buttons/SplitButton/SplitButton.js +2 -1
  6. package/components/DetachedWindow/DetachedWindow.d.ts +1 -7
  7. package/components/DetachedWindow/DetachedWindow.js +8 -6
  8. package/components/Dialer/DialPad/utils/useKeyAudio.js +4 -4
  9. package/components/Dialog/Dialog.js +11 -7
  10. package/components/Downshift/Downshift.js +116 -109
  11. package/components/Downshift/SuggestionList/SuggestionList.d.ts +7 -1
  12. package/components/Downshift/SuggestionList/SuggestionList.js +13 -5
  13. package/components/Downshift/utils/useDownshiftError.js +2 -1
  14. package/components/Forms/Checkbox/Checkbox.js +11 -7
  15. package/components/Forms/Picker/DatePicker/DatePicker.js +21 -17
  16. package/components/Forms/TextField/TextField.js +26 -22
  17. package/components/Icon/Icon.js +41 -37
  18. package/components/Icon/utils/IconUtils.js +24 -16
  19. package/components/Link/Link.js +16 -12
  20. package/components/List/ListItem/ListItem.js +16 -12
  21. package/components/List/ListItemText/ListItemText.js +21 -17
  22. package/components/Loading/Loading.js +6 -4
  23. package/components/Menu/MenuItem/MenuItem.js +6 -4
  24. package/components/PortalHost/PortalManager/PortalManager.js +24 -16
  25. package/components/Snackbar/SnackbarContent/SnackbarContent.js +11 -7
  26. package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +11 -8
  27. package/components/Tag/Tag.js +11 -7
  28. package/components/Text/Text.js +1 -2
  29. package/components/Text/TextWithEllipsis.js +7 -4
  30. package/components/TextWithHighlight/TextWithHighlight.js +7 -4
  31. package/components/TextWithLink/TextWithLink.js +7 -4
  32. package/components/TextWithTooltip/TextWithTooltip.js +7 -4
  33. package/components/Thumbnail/Thumbnail.js +16 -12
  34. package/components/Tooltip/Tooltip.js +17 -11
  35. package/components/VirtualizedMenu/VirtualizedMenuList.js +8 -10
  36. package/es6/README.md +3 -2
  37. package/es6/components/Avatar/Avatar.js +37 -33
  38. package/es6/components/Buttons/Button/Button.js +12 -8
  39. package/es6/components/Buttons/IconButton/IconButton.js +6 -4
  40. package/es6/components/Buttons/SplitButton/SplitButton.js +2 -1
  41. package/es6/components/DetachedWindow/DetachedWindow.js +8 -6
  42. package/es6/components/Dialer/DialPad/utils/useKeyAudio.js +4 -4
  43. package/es6/components/Dialog/Dialog.js +12 -8
  44. package/es6/components/Downshift/Downshift.js +117 -110
  45. package/es6/components/Downshift/SuggestionList/SuggestionList.js +13 -5
  46. package/es6/components/Downshift/utils/useDownshiftError.js +3 -2
  47. package/es6/components/Forms/Checkbox/Checkbox.js +12 -8
  48. package/es6/components/Forms/Picker/DatePicker/DatePicker.js +22 -18
  49. package/es6/components/Forms/TextField/TextField.js +27 -23
  50. package/es6/components/Icon/Icon.js +42 -38
  51. package/es6/components/Icon/utils/IconUtils.js +24 -16
  52. package/es6/components/Link/Link.js +17 -13
  53. package/es6/components/List/ListItem/ListItem.js +17 -13
  54. package/es6/components/List/ListItemText/ListItemText.js +22 -18
  55. package/es6/components/Loading/Loading.js +6 -4
  56. package/es6/components/Menu/MenuItem/MenuItem.js +6 -4
  57. package/es6/components/PortalHost/PortalManager/PortalManager.js +24 -16
  58. package/es6/components/Snackbar/SnackbarContent/SnackbarContent.js +12 -8
  59. package/es6/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +12 -9
  60. package/es6/components/Tag/Tag.js +12 -8
  61. package/es6/components/Text/Text.js +1 -2
  62. package/es6/components/Text/TextWithEllipsis.js +7 -4
  63. package/es6/components/TextWithHighlight/TextWithHighlight.js +7 -4
  64. package/es6/components/TextWithLink/TextWithLink.js +7 -4
  65. package/es6/components/TextWithTooltip/TextWithTooltip.js +7 -4
  66. package/es6/components/Thumbnail/Thumbnail.js +17 -13
  67. package/es6/components/Tooltip/Tooltip.js +18 -12
  68. package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +9 -11
  69. package/es6/foundation/config.js +77 -57
  70. package/es6/foundation/hooks/useAudio/useAudio.js +1 -1
  71. package/es6/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
  72. package/es6/foundation/styles/opacity.js +6 -4
  73. package/es6/foundation/theme/useThemeProps.js +1 -1
  74. package/es6/foundation/utils/clearReactReferencesInNode.js +9 -7
  75. package/es6/foundation/utils/hasValue.js +1 -1
  76. package/es6/foundation/utils/index.js +0 -1
  77. package/es6/foundation/utils/isShowJunoWarning.js +0 -2
  78. package/es6/foundation/utils/withDeprecatedCheck.js +14 -15
  79. package/foundation/config.d.ts +23 -13
  80. package/foundation/config.js +78 -58
  81. package/foundation/hooks/useAudio/useAudio.d.ts +1 -1
  82. package/foundation/hooks/useAudio/useAudio.js +1 -1
  83. package/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
  84. package/foundation/styles/opacity.js +6 -4
  85. package/foundation/theme/useThemeProps.d.ts +1 -1
  86. package/foundation/theme/useThemeProps.js +1 -1
  87. package/foundation/utils/clearReactReferencesInNode.js +9 -7
  88. package/foundation/utils/hasValue.js +1 -1
  89. package/foundation/utils/index.d.ts +0 -1
  90. package/foundation/utils/index.js +0 -1
  91. package/foundation/utils/isShowJunoWarning.d.ts +0 -1
  92. package/foundation/utils/isShowJunoWarning.js +0 -4
  93. package/foundation/utils/withDeprecatedCheck.d.ts +2 -2
  94. package/foundation/utils/withDeprecatedCheck.js +14 -15
  95. package/package.json +2 -2
package/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Juno
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@ringcentral/juno/latest.svg)](https://www.npmjs.com/package/@ringcentral/juno)
4
-
5
4
  [![NPM beta version](https://img.shields.io/npm/v/@ringcentral/juno/beta.svg)](https://www.npmjs.com/package/@ringcentral/juno?activeTab=versions)
6
5
 
6
+ [![NPM version](https://img.shields.io/npm/v/@ringcentral/juno-icon/beta.svg)](https://www.npmjs.com/package/@ringcentral/juno-icon)
7
+
7
8
  Ringcentral React Component library, make your app have the same user experience as Ringcentral Apps.
8
9
 
9
10
  base on [MATERIAL-UI](https://material-ui.com/).
10
11
 
11
- Explore Juno with the [interactive live Storybook instance](https://develop-rcui-int.fiji.gliprc.com/).
12
+ Explore Juno with the [interactive live Storybook instance](https://ringcentral.github.io/juno/).
12
13
 
13
14
  View in [Codesandbox Example](https://codesandbox.io/s/4j370).
14
15
 
@@ -12,6 +12,41 @@ var utils_1 = require("./utils");
12
12
  var _RcAvatar = react_1.forwardRef(function (inProps, ref) {
13
13
  // change default unClickable to here, prevent warning
14
14
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcAvatar' });
15
+ if (process.env.NODE_ENV !== 'production') {
16
+ // eslint-disable-next-line react-hooks/rules-of-hooks
17
+ foundation_1.useDeprecatedCheck(RcAvatar, inProps, [
18
+ {
19
+ prop: 'customColor',
20
+ time: '2021-3',
21
+ comment: "if 'true', will just use color value, use `color` directly ",
22
+ },
23
+ {
24
+ prop: 'unClickable',
25
+ time: '2021-3',
26
+ comment: "force set avatar clickable, default is true, please use clickable to set clickable ",
27
+ },
28
+ {
29
+ prop: 'isMember',
30
+ time: '2021-3',
31
+ comment: "not used, just keep type temp ",
32
+ },
33
+ {
34
+ prop: 'displayName',
35
+ time: '2021-3',
36
+ comment: "not used, just keep type temp ",
37
+ },
38
+ {
39
+ prop: 'alt',
40
+ time: '2021-3',
41
+ comment: "alt for img, just use `<img src /> in children or imgProps for apply alt` ",
42
+ },
43
+ {
44
+ prop: 'tooltip',
45
+ time: '2021-3',
46
+ comment: "support tooltip for avatar, use title to replace ",
47
+ },
48
+ ]);
49
+ }
15
50
  var presenceOrigin = props.presenceOrigin, idProps = props.id, size = props.size, classes = props.classes, color = props.color, children = props.children, _clickable = props.clickable, onClick = props.onClick, mask = props.mask, presence = props.presence, customColor = props.customColor, tooltip = props.tooltip, iconSize = props.iconSize, iconSymbol = props.iconSymbol, srcProp = props.src, altProp = props.alt, Img = props.Img, imgProps = props.imgProps, presenceProps = props.presenceProps, displayName = props.displayName, rest = tslib_1.__rest(props, ["presenceOrigin", "id", "size", "classes", "color", "children", "clickable", "onClick", "mask", "presence", "customColor", "tooltip", "iconSize", "iconSymbol", "src", "alt", "Img", "imgProps", "presenceProps", "displayName"]);
16
51
  var unClickable = props.unClickable;
17
52
  unClickable = unClickable !== null && unClickable !== void 0 ? unClickable : true;
@@ -96,38 +131,7 @@ var _RcAvatar = react_1.forwardRef(function (inProps, ref) {
96
131
  avatar,
97
132
  presenceChildren));
98
133
  });
99
- var RcAvatar = foundation_1.styled(foundation_1.withDeprecatedCheck(Tooltip_1.withTooltip(_RcAvatar), [
100
- {
101
- prop: 'customColor',
102
- time: '2021-3',
103
- comment: "if 'true', will just use color value, use `color` directly ",
104
- },
105
- {
106
- prop: 'unClickable',
107
- time: '2021-3',
108
- comment: "force set avatar clickable, default is true, please use clickable to set clickable ",
109
- },
110
- {
111
- prop: 'isMember',
112
- time: '2021-3',
113
- comment: "not used, just keep type temp ",
114
- },
115
- {
116
- prop: 'displayName',
117
- time: '2021-3',
118
- comment: "not used, just keep type temp ",
119
- },
120
- {
121
- prop: 'alt',
122
- time: '2021-3',
123
- comment: "alt for img, just use `<img src /> in children or imgProps for apply alt` ",
124
- },
125
- {
126
- prop: 'tooltip',
127
- time: '2021-3',
128
- comment: "support tooltip for avatar, use title to replace ",
129
- },
130
- ], 'RcAvatar'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
134
+ var RcAvatar = foundation_1.styled(Tooltip_1.withTooltip(_RcAvatar))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
131
135
  RcAvatar.defaultProps = {
132
136
  size: 'medium',
133
137
  presenceOrigin: {
@@ -13,6 +13,16 @@ var utils_2 = require("./utils");
13
13
  var _RcButton = react_1.forwardRef(function (inProps, ref) {
14
14
  var _a, _b;
15
15
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcButton' });
16
+ if (process.env.NODE_ENV !== 'production') {
17
+ // eslint-disable-next-line react-hooks/rules-of-hooks
18
+ foundation_1.useDeprecatedCheck(RcButton, props, [
19
+ {
20
+ prop: 'IconProps',
21
+ time: '2021-4',
22
+ comment: "@deprecated Icon, please use startIcon with `<RcIcon />` */",
23
+ },
24
+ ]);
25
+ }
16
26
  var childrenProp = props.children, classesProp = props.classes, startIconProp = props.startIcon, endIconProp = props.endIcon, loading = props.loading, loadingMode = props.loadingMode, disabled = props.disabled, IconProps = props.IconProps, size = props.size, color = props.color, CircularProgressProps = props.CircularProgressProps, variant = props.variant, disabledVariant = props.disabledVariant, radius = props.radius, keepElevation = props.keepElevation, rest = tslib_1.__rest(props, ["children", "classes", "startIcon", "endIcon", "loading", "loadingMode", "disabled", "IconProps", "size", "color", "CircularProgressProps", "variant", "disabledVariant", "radius", "keepElevation"]);
17
27
  var theme = foundation_1.useTheme();
18
28
  var innerRef = react_1.useRef(null);
@@ -85,13 +95,7 @@ var _RcButton = react_1.forwardRef(function (inProps, ref) {
85
95
  return (react_1.default.createElement(Button_1.default, tslib_1.__assign({ ref: buttonRef, disabled: disabled || loading, variant: isPlain ? undefined : variant, disableRipple: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.props) === null || _a === void 0 ? void 0 : _a.MuiButton) === null || _b === void 0 ? void 0 : _b.disableRipple) || isPlain, startIcon: startIcon, endIcon: endIcon, classes: classes }, rest), loading && isReplace ? loadingElm : childrenProp));
86
96
  });
87
97
  /** @release */
88
- var RcButton = foundation_1.styled(foundation_1.withDeprecatedCheck(Tooltip_1.withTooltip(_RcButton), [
89
- {
90
- prop: 'IconProps',
91
- time: '2021-4',
92
- comment: "@deprecated Icon, please use startIcon with `<RcIcon />` */",
93
- },
94
- ], 'RcButton'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.buttonStyle);
98
+ var RcButton = foundation_1.styled(Tooltip_1.withTooltip(_RcButton))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.buttonStyle);
95
99
  exports.RcButton = RcButton;
96
100
  RcButton.defaultProps = {
97
101
  size: 'large',
@@ -13,6 +13,10 @@ var utils_1 = require("./utils");
13
13
  var _RcIconButton = react_1.memo(react_1.forwardRef(function (inProps, ref) {
14
14
  var _a;
15
15
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcIconButton' });
16
+ if (process.env.NODE_ENV !== 'production') {
17
+ // eslint-disable-next-line react-hooks/rules-of-hooks
18
+ foundation_1.useDeprecatedCheck(RcIconButton, props, IconButtonProps_1.rcIconButtonWarning);
19
+ }
16
20
  var _b = props.buttonRef, buttonRef = _b === void 0 ? ref : _b, className = props.className, classes = props.classes, children = props.children, title = props.title, symbol = props.symbol, disabled = props.disabled, invisible = props.invisible, type = props.type, loading = props.loading, TouchRippleProps = props.TouchRippleProps, variant = props.variant, CircularProgressProps = props.CircularProgressProps, color = props.color, shouldPersistBg = props.shouldPersistBg, stretchIcon = props.stretchIcon, iconColor = props.iconColor, iconSize = props.iconSize, disableTouchRipple = props.disableTouchRipple, useColorWhenDisabled = props.useColorWhenDisabled, size = props.size, radius = props.radius, elevation = props.elevation, activeElevation = props.activeElevation, aRef = props.aRef, tooltipTitle = props.tooltipTitle, tooltipForceHide = props.tooltipForceHide, disableToolTip = props.disableToolTip, alwaysEnableTooltip = props.alwaysEnableTooltip, tooltipPlacement = props.tooltipPlacement, ariaLabel = props.ariaLabel, popperProps = props.popperProps, externalLink = props.externalLink, download = props.download, autoFocus = props.autoFocus, href = props.href, rest = tslib_1.__rest(props, ["buttonRef", "className", "classes", "children", "title", "symbol", "disabled", "invisible", "type", "loading", "TouchRippleProps", "variant", "CircularProgressProps", "color", "shouldPersistBg", "stretchIcon", "iconColor", "iconSize", "disableTouchRipple", "useColorWhenDisabled", "size", "radius", "elevation", "activeElevation", "aRef", "tooltipTitle", "tooltipForceHide", "disableToolTip", "alwaysEnableTooltip", "tooltipPlacement", "ariaLabel", "popperProps", "externalLink", "download", "autoFocus", "href"]);
17
21
  var theme = foundation_1.useTheme();
18
22
  var isOutline = variant === 'outline';
@@ -44,9 +48,7 @@ var _RcIconButton = react_1.memo(react_1.forwardRef(function (inProps, ref) {
44
48
  }
45
49
  return iconButton;
46
50
  }));
47
- var RcIconButton = foundation_1.styled(foundation_1.withDeprecatedCheck(Tooltip_1.withTooltip(_RcIconButton),
48
- // TODO remove when ready
49
- IconButtonProps_1.rcIconButtonWarning, 'RcIconButton'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.iconButtonStyle);
51
+ var RcIconButton = foundation_1.styled(Tooltip_1.withTooltip(_RcIconButton))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.iconButtonStyle);
50
52
  exports.RcIconButton = RcIconButton;
51
53
  RcIconButton.displayName = 'RcIconButton';
52
54
  RcIconButton.defaultProps = {
@@ -61,7 +61,8 @@ var _RcSplitButton = react_1.forwardRef(function (inProps, ref) {
61
61
  };
62
62
  }, [color, loading, toButtonSize, type, variant]);
63
63
  var _j = react_1.useMemo(function () {
64
- if (!(childrenProp instanceof Array)) {
64
+ if (process.env.NODE_ENV !== 'production' &&
65
+ !(childrenProp instanceof Array)) {
65
66
  foundation_1.logInDev({
66
67
  component: 'RcSplitButton',
67
68
  message: 'children must be implement with RcSplitButtonChildrenProps[]',
@@ -31,12 +31,6 @@ declare type RcDetachedWindowProps = {
31
31
  * The following values are supported: https://www.w3schools.com/jsref/met_win_open.asp
32
32
  */
33
33
  specs?: string;
34
- /**
35
- * `Optional`. Specifies whether the URL creates a new entry or replaces the current entry in the history list. The following values are supported:
36
- * - `true` - URL replaces the current document in the history list
37
- * - `false` - URL creates a new entry in the history list
38
- */
39
- replace?: boolean;
40
34
  /** title for that new window */
41
35
  title?: string;
42
36
  /** trigger when window `onload` */
@@ -63,7 +57,7 @@ declare type RcDetachedWindowProps = {
63
57
  </RcDetachedWindow>
64
58
  * ```
65
59
  */
66
- getWindow?: (props: Pick<RcDetachedWindowProps, 'url' | 'name' | 'specs' | 'replace' | 'title'>) => Window | undefined | null;
60
+ getWindow?: (props: Pick<RcDetachedWindowProps, 'url' | 'name' | 'specs' | 'title'>) => Window | undefined | null;
67
61
  };
68
62
  declare type RcDetachedWindowRef = {
69
63
  /** target opened window, only can get after `onload` */
@@ -15,7 +15,7 @@ var utils_2 = require("./utils");
15
15
  */
16
16
  var RcDetachedWindow = react_1.memo(react_1.forwardRef(function (inProps, ref) {
17
17
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcDetachedWindow' });
18
- var childrenProp = props.children, onBeforeunload = props.onBeforeunload, onUnload = props.onUnload, onload = props.onload, title = props.title, url = props.url, name = props.name, specs = props.specs, replace = props.replace, open = props.open, onOpen = props.onOpen, getWindow = props.getWindow, keep = props.keep;
18
+ var childrenProp = props.children, onBeforeunload = props.onBeforeunload, onUnload = props.onUnload, onload = props.onload, title = props.title, url = props.url, name = props.name, specs = props.specs, open = props.open, onOpen = props.onOpen, getWindow = props.getWindow, keep = props.keep;
19
19
  var _a = tslib_1.__read(react_1.useState(), 2), externalWindow = _a[0], setExternalWindow = _a[1];
20
20
  var isCloseByWindowExitRef = react_1.useRef(false);
21
21
  var innerRef = react_1.useRef(null);
@@ -38,13 +38,15 @@ var RcDetachedWindow = react_1.memo(react_1.forwardRef(function (inProps, ref) {
38
38
  });
39
39
  var openWindow = foundation_1.useEventCallback(function () {
40
40
  var newWindow = getWindow
41
- ? getWindow({ url: url, name: name, specs: specs, replace: replace, title: title })
41
+ ? getWindow({ url: url, name: name, specs: specs, title: title })
42
42
  : utils_2.openExternalWindow(props);
43
43
  if (!newWindow) {
44
- foundation_1.logInDev({
45
- component: 'RcDetachedWindow',
46
- message: 'Please check your window instance, that `window.open` should not trigger by another window',
47
- });
44
+ if (process.env.NODE_ENV !== 'production') {
45
+ foundation_1.logInDev({
46
+ component: 'RcDetachedWindow',
47
+ message: 'Please check your window instance, that `window.open` should not trigger by another window',
48
+ });
49
+ }
48
50
  return;
49
51
  }
50
52
  if (title)
@@ -27,10 +27,10 @@ exports.useKeyAudio = function (_a) {
27
27
  case 2:
28
28
  audio.currentTime = 0;
29
29
  audio.src = src;
30
- lastPlayRef.current = audio
31
- .play()
32
- .catch(function (reason) {
33
- return foundation_1.logInDev({ component: 'RcDialerPad', message: reason });
30
+ lastPlayRef.current = audio.play().catch(function (reason) {
31
+ if (process.env.NODE_ENV !== 'production') {
32
+ foundation_1.logInDev({ component: 'RcDialerPad', message: reason });
33
+ }
34
34
  });
35
35
  return [2 /*return*/];
36
36
  }
@@ -11,6 +11,16 @@ var DialogContext_1 = require("./utils/DialogContext");
11
11
  exports.RcDialogContext = DialogContext_1.RcDialogContext;
12
12
  var _RcDialog = react_1.forwardRef(function (inProps, ref) {
13
13
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcDialog' });
14
+ if (process.env.NODE_ENV !== 'production') {
15
+ // eslint-disable-next-line react-hooks/rules-of-hooks
16
+ foundation_1.useDeprecatedCheck(RcDialog, props, [
17
+ {
18
+ prop: 'size',
19
+ time: '2021-11',
20
+ comment: "\n * please use `maxWidth` and `fullScreen` directly\n *\n * - 'fullScreen' => false\n * - 'large' => `md`\n * - 'medium' => `sm`\n * - 'small' => `xs`\n * - 'xsmall' => no longer exist, should custom by yourself\n */",
21
+ },
22
+ ]);
23
+ }
14
24
  var classesProp = props.classes, _a = props.size, size = _a === void 0 ? 'medium' : _a, maxWidthProp = props.maxWidth, _b = props.fullWidth, fullWidth = _b === void 0 ? true : _b, childrenSize = props.childrenSize, children = props.children, TransitionPropsProp = props.TransitionProps, rest = tslib_1.__rest(props, ["classes", "size", "maxWidth", "fullWidth", "childrenSize", "children", "TransitionProps"]);
15
25
  var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcDialogClasses, classesProp); }, [classesProp]);
16
26
  var externalWindow = foundation_1.useRcPortalWindowContext().externalWindow;
@@ -38,13 +48,7 @@ var _RcDialog = react_1.forwardRef(function (inProps, ref) {
38
48
  return (react_1.default.createElement(Dialog_1.default, tslib_1.__assign({ ref: ref, fullWidth: fullWidth, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, maxWidth: maxWidth, fullScreen: size === 'fullScreen' ? true : undefined, classes: classes, TransitionProps: TransitionProps }, rest),
39
49
  react_1.default.createElement(DialogContext_1.RcDialogContext.Provider, { value: contextValue }, children)));
40
50
  });
41
- var RcDialog = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcDialog, [
42
- {
43
- prop: 'size',
44
- time: '2021-11',
45
- comment: "\n * please use `maxWidth` and `fullScreen` directly\n *\n * - 'fullScreen' => false\n * - 'large' => `md`\n * - 'medium' => `sm`\n * - 'small' => `xs`\n * - 'xsmall' => no longer exist, should custom by yourself\n */",
46
- },
47
- ], 'RcDialog'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.DialogStyle);
51
+ var RcDialog = foundation_1.styled(_RcDialog)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.DialogStyle);
48
52
  exports.RcDialog = RcDialog;
49
53
  RcDialog.defaultProps = {};
50
54
  RcDialog.displayName = 'RcDialog';
@@ -14,6 +14,116 @@ var utils_1 = require("./utils");
14
14
  exports.RcDownshiftDefaultFilterOptions = utils_1.RcDownshiftDefaultFilterOptions;
15
15
  var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
16
16
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcDownshift' });
17
+ if (process.env.NODE_ENV !== 'production') {
18
+ // eslint-disable-next-line react-hooks/rules-of-hooks
19
+ foundation_1.useDeprecatedCheck(RcDownshift, props, [
20
+ {
21
+ prop: 'onSelectChange',
22
+ time: '2021-10',
23
+ comment: "@deprecated should use `onChange` */",
24
+ },
25
+ {
26
+ prop: 'suggestionItems',
27
+ time: '2021-10',
28
+ comment: "@deprecated should use `options` to replace */",
29
+ },
30
+ {
31
+ prop: 'selectedItems',
32
+ time: '2021-10',
33
+ comment: "@deprecated not need any more */",
34
+ },
35
+ {
36
+ prop: 'itemToString',
37
+ time: '2021-10',
38
+ comment: "@deprecated use `getOptionLabel` to replace that */",
39
+ },
40
+ {
41
+ prop: 'MenuItem',
42
+ time: '2021-10',
43
+ comment: "@deprecated should use `renderOption` to replace that */",
44
+ },
45
+ {
46
+ prop: 'minRowHeight',
47
+ time: '2021-10',
48
+ comment: "@deprecated suggestion list row min height for virtual list */",
49
+ },
50
+ {
51
+ prop: 'enableFreeChips',
52
+ time: '2021-10',
53
+ comment: "@deprecated enable free chip mode, should use `freeSolo` to replace that */",
54
+ },
55
+ {
56
+ prop: 'inputLabel',
57
+ time: '2021-10',
58
+ comment: "@deprecated please use `label` to replace that */",
59
+ },
60
+ {
61
+ prop: 'inputPlaceholder',
62
+ time: '2021-10',
63
+ comment: "@deprecated input element placeholder attribute */",
64
+ },
65
+ {
66
+ prop: 'maxLength',
67
+ time: '2021-10',
68
+ comment: "@deprecated input element maxlength, please use `TextFieldProps.inputProps.maxLength` */",
69
+ },
70
+ {
71
+ prop: 'screenReader',
72
+ time: '2021-10',
73
+ comment: "@deprecated should use `screenReaderProps` */",
74
+ },
75
+ {
76
+ prop: 'automationId',
77
+ time: '2021-10',
78
+ comment: "@deprecated wrapper automationId, should use `data-test-automation-id` directly */",
79
+ },
80
+ {
81
+ prop: 'InputItem',
82
+ time: '2021-10',
83
+ comment: "@deprecated just use the `renderTags` to render whole tags */",
84
+ },
85
+ {
86
+ prop: 'emailError',
87
+ time: '2021-10',
88
+ comment: "@deprecated please calculate error outside by your self with `renderTags`, or prepare ready items with error field */",
89
+ },
90
+ {
91
+ prop: 'errorSelectedItems',
92
+ time: '2021-10',
93
+ comment: "@deprecated please calculate error outside by your self with `renderTags`, or prepare ready items with error field */",
94
+ },
95
+ {
96
+ prop: 'nameError',
97
+ time: '2021-10',
98
+ comment: "@deprecated replace to `error` */",
99
+ },
100
+ {
101
+ prop: 'keyToChips',
102
+ time: '2021-10',
103
+ comment: "@deprecated rename to `keyToTags` */",
104
+ },
105
+ {
106
+ prop: 'limitOfFreeChips',
107
+ time: '2021-10',
108
+ comment: "@deprecated should use `max` */",
109
+ },
110
+ {
111
+ prop: 'enableAutoTransform',
112
+ time: '2021-10',
113
+ comment: "@deprecated should use `autoSelect` */",
114
+ },
115
+ {
116
+ prop: 'messageRef',
117
+ time: '2021-10',
118
+ comment: "@deprecated should use `inputRef` */",
119
+ },
120
+ {
121
+ prop: 'TextFieldProps',
122
+ time: '2021-10',
123
+ comment: "@deprecated TextField props */",
124
+ },
125
+ ]);
126
+ }
17
127
  var theme = foundation_1.useTheme();
18
128
  var _a = props.itemToString, itemToString = _a === void 0 ? utils_1.DEFAULT_GET_OPTION_LABEL : _a, _b = props.keyToChips, keyToChips = _b === void 0 ? utils_1.DEFAULT_KEY_TO_CHIPS : _b, _c = props.limitOfFreeChips, limitOfFreeChips = _c === void 0 ? utils_1.DEFAULT_LIMIT_CHIPS : _c, minRowHeight = props.minRowHeight, suggestionItems = props.suggestionItems, messageRef = props.messageRef, MenuItem = props.MenuItem, inputLabel = props.inputLabel, nameError = props.nameError, maxLength = props.maxLength, InputItem = props.InputItem, emailError = props.emailError, autoSwitchEmail = props.autoSwitchEmail, enableFreeChips = props.enableFreeChips, inputPlaceholder = props.inputPlaceholder, errorSelectedItems = props.errorSelectedItems, enableAutoTransform = props.enableAutoTransform, allowPlainHelperText = props.allowPlainHelperText, TextFieldProps = props.TextFieldProps, selectedItemsProp = props.selectedItems, automationId = props.automationId, screenReader = props.screenReader, onSelectChange = props.onSelectChange, variant = props.variant, groupExpanded = props.groupExpanded, groupDefaultExpanded = props.groupDefaultExpanded, _d = props.groupVariant, groupVariant = _d === void 0 ? 'normal' : _d, getExpandIconProps = props.getExpandIconProps, groupBy = props.groupBy, _e = props.value, valueProp = _e === void 0 ? selectedItemsProp : _e, _f = props.autoHighlight, autoHighlight = _f === void 0 ? true : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? true : _g, _h = props.clearBtn, clearBtn = _h === void 0 ? false : _h, _j = props.toggleButton, toggleButton = _j === void 0 ? false : _j, _k = props.multiple, multiple = _k === void 0 ? false : _k, clearButtonProps = props.clearButtonProps, onClear = props.onClear, ToggleButtonProps = props.ToggleButtonProps, inputValueProp = props.inputValue, onKeyDownProp = props.onKeyDown, helperTextProp = props.helperText, options = props.options, openOnFocus = props.openOnFocus, _l = props.getOptionLabel, getOptionLabel = _l === void 0 ? itemToString : _l, renderInput = props.renderInput, _m = props.label, label = _m === void 0 ? inputLabel : _m, _o = props.inputRef, inputRefProp = _o === void 0 ? messageRef : _o, _p = props.error, error = _p === void 0 ? nameError : _p, _q = props.placeholder, placeholder = _q === void 0 ? inputPlaceholder : _q, _r = props.freeSolo, freeSolo = _r === void 0 ? enableFreeChips : _r, _s = props.keyToTags, keyToTags = _s === void 0 ? keyToChips : _s, _t = props.maxFreeSolo, maxFreeSolo = _t === void 0 ? limitOfFreeChips : _t, SuggestionListProps = props.SuggestionListProps, _u = props.autoSelect, autoSelect = _u === void 0 ? enableAutoTransform : _u, PopperProps = props.PopperProps, initialIsOpen = props.initialIsOpen, disabled = props.disabled, requiredProp = props.required, _v = props.defaultIsOpen, defaultIsOpen = _v === void 0 ? openOnFocus : _v, _w = props.disableCloseOnSelect, disableCloseOnSelect = _w === void 0 ? defaultIsOpen : _w, _x = props.onChange, onChangeProp = _x === void 0 ? onSelectChange : _x, onInputChangeProp = props.onInputChange, onMaxFreeSolo = props.onMaxFreeSolo, FormHelperTextPropsProp = props.FormHelperTextProps, action = props.action, filterOptions = props.filterOptions, renderOption = props.renderOption, renderTags = props.renderTags, getOptionDisabled = props.getOptionDisabled, renderGroup = props.renderGroup, onGroupExpanded = props.onGroupExpanded, renderNoOptions = props.renderNoOptions, InputPropsProp = props.InputProps, debug = props.debug, disabledItemsHighlightable = props.disabledItemsHighlightable, openProp = props.open, onOpen = props.onOpen, onClose = props.onClose, focused = props.focused, color = props.color, rest = tslib_1.__rest(props, ["itemToString", "keyToChips", "limitOfFreeChips", "minRowHeight", "suggestionItems", "messageRef", "MenuItem", "inputLabel", "nameError", "maxLength", "InputItem", "emailError", "autoSwitchEmail", "enableFreeChips", "inputPlaceholder", "errorSelectedItems", "enableAutoTransform", "allowPlainHelperText", "TextFieldProps", "selectedItems", "automationId", "screenReader", "onSelectChange", "variant", "groupExpanded", "groupDefaultExpanded", "groupVariant", "getExpandIconProps", "groupBy", "value", "autoHighlight", "fullWidth", "clearBtn", "toggleButton", "multiple", "clearButtonProps", "onClear", "ToggleButtonProps", "inputValue", "onKeyDown", "helperText", "options", "openOnFocus", "getOptionLabel", "renderInput", "label", "inputRef", "error", "placeholder", "freeSolo", "keyToTags", "maxFreeSolo", "SuggestionListProps", "autoSelect", "PopperProps", "initialIsOpen", "disabled", "required", "defaultIsOpen", "disableCloseOnSelect", "onChange", "onInputChange", "onMaxFreeSolo", "FormHelperTextProps", "action", "filterOptions", "renderOption", "renderTags", "getOptionDisabled", "renderGroup", "onGroupExpanded", "renderNoOptions", "InputProps", "debug", "disabledItemsHighlightable", "open", "onOpen", "onClose", "focused", "color"]);
19
129
  var _y = tslib_1.__read(react_1.useState('bottom'), 2), position = _y[0], setPosition = _y[1];
@@ -24,7 +134,10 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
24
134
  // * if that have pass old suggestionItems mean that use old logic
25
135
  var isNew = !suggestionItems;
26
136
  var oneOfTagError = false;
27
- utils_1.useDownshiftError({ isNew: isNew, MenuItem: MenuItem, InputItem: InputItem });
137
+ if (process.env.NODE_ENV !== 'production') {
138
+ // eslint-disable-next-line react-hooks/rules-of-hooks
139
+ utils_1.useDownshiftError({ isNew: isNew, MenuItem: MenuItem, InputItem: InputItem });
140
+ }
28
141
  var required = requiredProp || (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.required);
29
142
  var _z = utils_1.useDownshift({
30
143
  focused: focused,
@@ -184,116 +297,10 @@ var _RcDownshift = react_1.memo(react_1.forwardRef(function (inProps, ref) {
184
297
  }
185
298
  },
186
299
  } }, getPopperProps(PopperProps)),
187
- isOpen && (react_1.default.createElement(SuggestionList_1.RcSuggestionList, tslib_1.__assign({ highlightedIndex: highlightedIndex, optionsGroupList: optionsGroupList, options: optionItems, groupVariant: groupVariant, groupExpanded: groupExpanded, renderGroup: renderGroup, MenuItem: MenuItem, renderOption: renderOption, inputValue: inputValue, getItemProps: getItemProps, getMenuProps: getMenuProps, changeHighlightedIndexReason: changeHighlightedIndexReason, getOptionDisabled: getOptionDisabled, isKeepHighlightedIndex: isKeepHighlightedIndex, onUpdatePopper: handleUpdatePopper, maxContainerHeight: 180, getOptionLabel: getOptionLabel }, SuggestionListProps))),
300
+ isOpen && (react_1.default.createElement(SuggestionList_1.RcSuggestionList, tslib_1.__assign({ highlightedIndex: highlightedIndex, optionsGroupList: optionsGroupList, options: optionItems, groupVariant: groupVariant, groupExpanded: groupExpanded, renderGroup: renderGroup, MenuItem: MenuItem, renderOption: renderOption, inputValue: inputValue, getItemProps: getItemProps, getMenuProps: getMenuProps, changeHighlightedIndexReason: changeHighlightedIndexReason, getOptionDisabled: getOptionDisabled, isKeepHighlightedIndex: isKeepHighlightedIndex, onUpdatePopper: handleUpdatePopper, maxContainerHeight: 180, getOptionLabel: getOptionLabel, position: "unset" }, SuggestionListProps))),
188
301
  isRenderNoOptions && (renderNoOptions === null || renderNoOptions === void 0 ? void 0 : renderNoOptions(getNoOptionsProps, noOptionItem)))));
189
302
  }));
190
- var RcDownshift = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcDownshift, [
191
- {
192
- prop: 'onSelectChange',
193
- time: '2021-10',
194
- comment: "@deprecated should use `onChange` */",
195
- },
196
- {
197
- prop: 'suggestionItems',
198
- time: '2021-10',
199
- comment: "@deprecated should use `options` to replace */",
200
- },
201
- {
202
- prop: 'selectedItems',
203
- time: '2021-10',
204
- comment: "@deprecated not need any more */",
205
- },
206
- {
207
- prop: 'itemToString',
208
- time: '2021-10',
209
- comment: "@deprecated use `getOptionLabel` to replace that */",
210
- },
211
- {
212
- prop: 'MenuItem',
213
- time: '2021-10',
214
- comment: "@deprecated should use `renderOption` to replace that */",
215
- },
216
- {
217
- prop: 'minRowHeight',
218
- time: '2021-10',
219
- comment: "@deprecated suggestion list row min height for virtual list */",
220
- },
221
- {
222
- prop: 'enableFreeChips',
223
- time: '2021-10',
224
- comment: "@deprecated enable free chip mode, should use `freeSolo` to replace that */",
225
- },
226
- {
227
- prop: 'inputLabel',
228
- time: '2021-10',
229
- comment: "@deprecated please use `label` to replace that */",
230
- },
231
- {
232
- prop: 'inputPlaceholder',
233
- time: '2021-10',
234
- comment: "@deprecated input element placeholder attribute */",
235
- },
236
- {
237
- prop: 'maxLength',
238
- time: '2021-10',
239
- comment: "@deprecated input element maxlength, please use `TextFieldProps.inputProps.maxLength` */",
240
- },
241
- {
242
- prop: 'screenReader',
243
- time: '2021-10',
244
- comment: "@deprecated should use `screenReaderProps` */",
245
- },
246
- {
247
- prop: 'automationId',
248
- time: '2021-10',
249
- comment: "@deprecated wrapper automationId, should use `data-test-automation-id` directly */",
250
- },
251
- {
252
- prop: 'InputItem',
253
- time: '2021-10',
254
- comment: "@deprecated just use the `renderTags` to render whole tags */",
255
- },
256
- {
257
- prop: 'emailError',
258
- time: '2021-10',
259
- comment: "@deprecated please calculate error outside by your self with `renderTags`, or prepare ready items with error field */",
260
- },
261
- {
262
- prop: 'errorSelectedItems',
263
- time: '2021-10',
264
- comment: "@deprecated please calculate error outside by your self with `renderTags`, or prepare ready items with error field */",
265
- },
266
- {
267
- prop: 'nameError',
268
- time: '2021-10',
269
- comment: "@deprecated replace to `error` */",
270
- },
271
- {
272
- prop: 'keyToChips',
273
- time: '2021-10',
274
- comment: "@deprecated rename to `keyToTags` */",
275
- },
276
- {
277
- prop: 'limitOfFreeChips',
278
- time: '2021-10',
279
- comment: "@deprecated should use `max` */",
280
- },
281
- {
282
- prop: 'enableAutoTransform',
283
- time: '2021-10',
284
- comment: "@deprecated should use `autoSelect` */",
285
- },
286
- {
287
- prop: 'messageRef',
288
- time: '2021-10',
289
- comment: "@deprecated should use `inputRef` */",
290
- },
291
- {
292
- prop: 'TextFieldProps',
293
- time: '2021-10',
294
- comment: "@deprecated TextField props */",
295
- },
296
- ], 'RcDownshift'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.DownshiftStyle);
303
+ var RcDownshift = foundation_1.styled(_RcDownshift)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.DownshiftStyle);
297
304
  RcDownshift.defaultProps = {};
298
305
  RcDownshift.displayName = 'RcDownshift';
299
306
  var ExportType = RcDownshift;