@ringcentral/juno 2.0.0-rc.0 → 2.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 (84) hide show
  1. package/README.md +2 -1
  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 +115 -108
  11. package/components/Downshift/utils/useDownshiftError.js +2 -1
  12. package/components/Forms/Checkbox/Checkbox.js +11 -7
  13. package/components/Forms/Picker/DatePicker/DatePicker.js +21 -17
  14. package/components/Forms/TextField/TextField.js +26 -22
  15. package/components/Icon/Icon.js +41 -37
  16. package/components/Icon/utils/IconUtils.js +24 -16
  17. package/components/Link/Link.js +16 -12
  18. package/components/List/ListItem/ListItem.js +16 -12
  19. package/components/List/ListItemText/ListItemText.js +21 -17
  20. package/components/Loading/Loading.js +6 -4
  21. package/components/Menu/MenuItem/MenuItem.js +6 -4
  22. package/components/PortalHost/PortalManager/PortalManager.js +24 -16
  23. package/components/Snackbar/SnackbarContent/SnackbarContent.js +11 -7
  24. package/components/Tag/Tag.js +11 -7
  25. package/components/Text/Text.js +1 -2
  26. package/components/Text/TextWithEllipsis.js +7 -4
  27. package/components/TextWithHighlight/TextWithHighlight.js +7 -4
  28. package/components/TextWithLink/TextWithLink.js +7 -4
  29. package/components/TextWithTooltip/TextWithTooltip.js +7 -4
  30. package/components/Thumbnail/Thumbnail.js +16 -12
  31. package/components/Tooltip/Tooltip.js +17 -11
  32. package/components/VirtualizedMenu/VirtualizedMenuList.js +8 -10
  33. package/es6/README.md +2 -1
  34. package/es6/components/Avatar/Avatar.js +37 -33
  35. package/es6/components/Buttons/Button/Button.js +12 -8
  36. package/es6/components/Buttons/IconButton/IconButton.js +6 -4
  37. package/es6/components/Buttons/SplitButton/SplitButton.js +2 -1
  38. package/es6/components/DetachedWindow/DetachedWindow.js +8 -6
  39. package/es6/components/Dialer/DialPad/utils/useKeyAudio.js +4 -4
  40. package/es6/components/Dialog/Dialog.js +12 -8
  41. package/es6/components/Downshift/Downshift.js +116 -109
  42. package/es6/components/Downshift/utils/useDownshiftError.js +3 -2
  43. package/es6/components/Forms/Checkbox/Checkbox.js +12 -8
  44. package/es6/components/Forms/Picker/DatePicker/DatePicker.js +22 -18
  45. package/es6/components/Forms/TextField/TextField.js +27 -23
  46. package/es6/components/Icon/Icon.js +42 -38
  47. package/es6/components/Icon/utils/IconUtils.js +24 -16
  48. package/es6/components/Link/Link.js +17 -13
  49. package/es6/components/List/ListItem/ListItem.js +17 -13
  50. package/es6/components/List/ListItemText/ListItemText.js +22 -18
  51. package/es6/components/Loading/Loading.js +6 -4
  52. package/es6/components/Menu/MenuItem/MenuItem.js +6 -4
  53. package/es6/components/PortalHost/PortalManager/PortalManager.js +24 -16
  54. package/es6/components/Snackbar/SnackbarContent/SnackbarContent.js +12 -8
  55. package/es6/components/Tag/Tag.js +12 -8
  56. package/es6/components/Text/Text.js +1 -2
  57. package/es6/components/Text/TextWithEllipsis.js +7 -4
  58. package/es6/components/TextWithHighlight/TextWithHighlight.js +7 -4
  59. package/es6/components/TextWithLink/TextWithLink.js +7 -4
  60. package/es6/components/TextWithTooltip/TextWithTooltip.js +7 -4
  61. package/es6/components/Thumbnail/Thumbnail.js +17 -13
  62. package/es6/components/Tooltip/Tooltip.js +18 -12
  63. package/es6/components/VirtualizedMenu/VirtualizedMenuList.js +9 -11
  64. package/es6/foundation/config.js +77 -57
  65. package/es6/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
  66. package/es6/foundation/styles/opacity.js +6 -4
  67. package/es6/foundation/utils/clearReactReferencesInNode.js +9 -7
  68. package/es6/foundation/utils/hasValue.js +1 -1
  69. package/es6/foundation/utils/index.js +0 -1
  70. package/es6/foundation/utils/isShowJunoWarning.js +0 -2
  71. package/es6/foundation/utils/withDeprecatedCheck.js +14 -15
  72. package/foundation/config.d.ts +23 -13
  73. package/foundation/config.js +78 -58
  74. package/foundation/hooks/useResizeObserver/useResizeObserver.js +10 -7
  75. package/foundation/styles/opacity.js +6 -4
  76. package/foundation/utils/clearReactReferencesInNode.js +9 -7
  77. package/foundation/utils/hasValue.js +1 -1
  78. package/foundation/utils/index.d.ts +0 -1
  79. package/foundation/utils/index.js +0 -1
  80. package/foundation/utils/isShowJunoWarning.d.ts +0 -1
  81. package/foundation/utils/isShowJunoWarning.js +0 -4
  82. package/foundation/utils/withDeprecatedCheck.d.ts +2 -2
  83. package/foundation/utils/withDeprecatedCheck.js +14 -15
  84. package/package.json +5 -5
@@ -12,6 +12,31 @@ exports.RcOutlineTextFieldIconSizes = utils_1.RcOutlineTextFieldIconSizes;
12
12
  var combineOutlineClasses = foundation_1.combineClasses(utils_1.RcTextFieldInputClasses, utils_1.RcOutlineTextFieldInputClasses);
13
13
  var _RcTextField = react_1.forwardRef(function (inProps, ref) {
14
14
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTextField' });
15
+ if (process.env.NODE_ENV !== 'production') {
16
+ // eslint-disable-next-line react-hooks/rules-of-hooks
17
+ foundation_1.useDeprecatedCheck(RcTextField, props, [
18
+ {
19
+ prop: 'focusOnMount',
20
+ time: '2021-4',
21
+ comment: "please use `autoFocus` to replace that",
22
+ },
23
+ {
24
+ prop: 'selectOnMount',
25
+ time: '2021-4',
26
+ comment: "please use `autoSelect` to replace that",
27
+ },
28
+ {
29
+ prop: 'clearLabel',
30
+ time: '2021-4',
31
+ comment: "clear button label, please use `clearButtonProps` with `title` replace that",
32
+ },
33
+ {
34
+ prop: 'clearAriaLabel',
35
+ time: '2021-4',
36
+ comment: "clear button aria-label, use `clearButtonProps` with `aria-label` replace that",
37
+ },
38
+ ]);
39
+ }
15
40
  var classesProp = props.classes, InputLabelPropsProp = props.InputLabelProps, FormHelperTextPropsProp = props.FormHelperTextProps, valueProp = props.value, focusOnMount = props.focusOnMount, selectOnMount = props.selectOnMount, clearAriaLabel = props.clearAriaLabel,
16
41
  // TODO: remove when remove focusOnMount
17
42
  _a = props.autoFocus,
@@ -142,28 +167,7 @@ var _RcTextField = react_1.forwardRef(function (inProps, ref) {
142
167
  return (react_1.default.createElement(TextField_1.default, tslib_1.__assign({}, rest, events, { id: id, value: valueProp, onChange: onChange, defaultValue: defaultValue, error: validate ? !!validateMessage : error, helperText: validateMessage || helperText, classes: classes, FormHelperTextProps: FormHelperTextProps, InputLabelProps: InputLabelProps, InputProps: InputProps, inputRef: inputRef, ref: ref })));
143
168
  });
144
169
  /** @release */
145
- var RcTextField = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcTextField, [
146
- {
147
- prop: 'focusOnMount',
148
- time: '2021-4',
149
- comment: "please use `autoFocus` to replace that",
150
- },
151
- {
152
- prop: 'selectOnMount',
153
- time: '2021-4',
154
- comment: "please use `autoSelect` to replace that",
155
- },
156
- {
157
- prop: 'clearLabel',
158
- time: '2021-4',
159
- comment: "clear button label, please use `clearButtonProps` with `title` replace that",
160
- },
161
- {
162
- prop: 'clearAriaLabel',
163
- time: '2021-4',
164
- comment: "clear button aria-label, use `clearButtonProps` with `aria-label` replace that",
165
- },
166
- ], 'RcTextField'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TextFieldStyle);
170
+ var RcTextField = foundation_1.styled(_RcTextField)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TextFieldStyle);
167
171
  exports.RcTextField = RcTextField;
168
172
  RcTextField.defaultProps = {
169
173
  clearBtn: true,
@@ -14,6 +14,46 @@ var IconService_1 = require("./utils/IconService");
14
14
  */
15
15
  var _RcIcon = react_1.memo(react_1.forwardRef(function (inProps, ref) {
16
16
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcIcon' });
17
+ if (process.env.NODE_ENV !== 'production') {
18
+ // eslint-disable-next-line react-hooks/rules-of-hooks
19
+ foundation_1.useDeprecatedCheck(RcIcon, props, [
20
+ {
21
+ prop: 'icon',
22
+ time: '2021-1',
23
+ comment: 'please use symbol to replace icon',
24
+ },
25
+ {
26
+ prop: 'children',
27
+ time: '2021-1',
28
+ comment: 'please use symbol to replace children',
29
+ },
30
+ {
31
+ prop: 'iconSize',
32
+ time: '2021-1',
33
+ comment: 'please use size',
34
+ },
35
+ {
36
+ prop: 'iconColor',
37
+ time: '2021-1',
38
+ comment: 'please use color',
39
+ },
40
+ {
41
+ prop: 'useLoading',
42
+ time: '2021-1',
43
+ comment: 'please use loading',
44
+ },
45
+ {
46
+ prop: 'loadingSize',
47
+ time: '2021-1',
48
+ comment: 'please use CircularProgressProps={{ size: 24 }} to set custom loading size',
49
+ },
50
+ {
51
+ prop: 'desc',
52
+ time: '2021-1',
53
+ comment: 'please use symbol',
54
+ },
55
+ ]);
56
+ }
17
57
  var loadingSize = props.loadingSize, useLoading = props.useLoading, iconColor = props.iconColor, iconSize = props.iconSize, icon = props.icon, desc = props.desc, className = props.className, _a = props.loading, loading = _a === void 0 ? useLoading : _a, CircularProgressProps = props.CircularProgressProps, symbol = props.symbol, children = props.children,
18
58
  // * pick props
19
59
  color = props.color, size = props.size, rest = tslib_1.__rest(props, ["loadingSize", "useLoading", "iconColor", "iconSize", "icon", "desc", "className", "loading", "CircularProgressProps", "symbol", "children", "color", "size"]);
@@ -63,43 +103,7 @@ var _RcIcon = react_1.memo(react_1.forwardRef(function (inProps, ref) {
63
103
  !!desc && react_1.default.createElement("title", null, desc),
64
104
  react_1.default.createElement("use", { xlinkHref: href, href: href }))))));
65
105
  }));
66
- var RcIcon = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcIcon, [
67
- {
68
- prop: 'icon',
69
- time: '2021-1',
70
- comment: 'please use symbol to replace icon',
71
- },
72
- {
73
- prop: 'children',
74
- time: '2021-1',
75
- comment: 'please use symbol to replace children',
76
- },
77
- {
78
- prop: 'iconSize',
79
- time: '2021-1',
80
- comment: 'please use size',
81
- },
82
- {
83
- prop: 'iconColor',
84
- time: '2021-1',
85
- comment: 'please use color',
86
- },
87
- {
88
- prop: 'useLoading',
89
- time: '2021-1',
90
- comment: 'please use loading',
91
- },
92
- {
93
- prop: 'loadingSize',
94
- time: '2021-1',
95
- comment: 'please use CircularProgressProps={{ size: 24 }} to set custom loading size',
96
- },
97
- {
98
- prop: 'desc',
99
- time: '2021-1',
100
- comment: 'please use symbol',
101
- },
102
- ], 'RcIcon'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.IconStyle);
106
+ var RcIcon = foundation_1.styled(_RcIcon)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.IconStyle);
103
107
  exports.RcIcon = RcIcon;
104
108
  RcIcon.defaultProps = {
105
109
  size: 'large',
@@ -14,28 +14,36 @@ exports.RcIconSizes = {
14
14
  function switchSize(size) {
15
15
  switch (size) {
16
16
  case 'extraSmall':
17
- foundation_1.logInDev({
18
- component: 'RcIcon',
19
- message: 'please change extraSmall to xsmall',
20
- });
17
+ if (process.env.NODE_ENV !== 'production') {
18
+ foundation_1.logInDev({
19
+ component: 'RcIcon',
20
+ message: 'please change extraSmall to xsmall',
21
+ });
22
+ }
21
23
  return 'xsmall';
22
24
  case 'moreLarge':
23
- foundation_1.logInDev({
24
- component: 'RcIcon',
25
- message: 'please change moreLarge to xlarge',
26
- });
25
+ if (process.env.NODE_ENV !== 'production') {
26
+ foundation_1.logInDev({
27
+ component: 'RcIcon',
28
+ message: 'please change moreLarge to xlarge',
29
+ });
30
+ }
27
31
  return 'xlarge';
28
32
  case 'mediumLarge':
29
- foundation_1.logInDev({
30
- component: 'RcIcon',
31
- message: 'please change mediumLarge to xxlarge',
32
- });
33
+ if (process.env.NODE_ENV !== 'production') {
34
+ foundation_1.logInDev({
35
+ component: 'RcIcon',
36
+ message: 'please change mediumLarge to xxlarge',
37
+ });
38
+ }
33
39
  return 'xxlarge';
34
40
  case 'extraLarge':
35
- foundation_1.logInDev({
36
- component: 'RcIcon',
37
- message: 'please change extraLarge to xxxlarge',
38
- });
41
+ if (process.env.NODE_ENV !== 'production') {
42
+ foundation_1.logInDev({
43
+ component: 'RcIcon',
44
+ message: 'please change extraLarge to xxxlarge',
45
+ });
46
+ }
39
47
  return 'xxxlarge';
40
48
  default:
41
49
  return size;
@@ -6,6 +6,21 @@ var foundation_1 = require("../../foundation");
6
6
  var styles_1 = require("./styles");
7
7
  var _RcLink = react_1.forwardRef(function (inProps, ref) {
8
8
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcLink' });
9
+ if (process.env.NODE_ENV !== 'production') {
10
+ // eslint-disable-next-line react-hooks/rules-of-hooks
11
+ foundation_1.useDeprecatedCheck(RcLink, props, [
12
+ {
13
+ prop: 'size',
14
+ time: '2021-4',
15
+ comment: "@deprecated size of Link, default is medium, please use variant directly\n * `small` => `caption1`\n * `medium` => `body1`\n * `large` => `headline1`\n */",
16
+ },
17
+ {
18
+ prop: 'handleOnClick',
19
+ time: '2021-4',
20
+ comment: "@deprecated use onClick replace that */",
21
+ },
22
+ ]);
23
+ }
9
24
  var _handleOnClick = props.handleOnClick, ComponentProp = props.Component, onKeyDown = props.onKeyDown, onClick = props.onClick, disabled = props.disabled, children = props.children, tabIndex = props.tabIndex, color = props.color, underline = props.underline, variant = props.variant, rest = tslib_1.__rest(props, ["handleOnClick", "Component", "onKeyDown", "onClick", "disabled", "children", "tabIndex", "color", "underline", "variant"]);
10
25
  // TODO: remove when handleOnClick removed
11
26
  var handleOnClick = _handleOnClick ? _handleOnClick : onClick;
@@ -20,18 +35,7 @@ var _RcLink = react_1.forwardRef(function (inProps, ref) {
20
35
  * @release
21
36
  * that onClick event will be trigger with `enter` like `<a>`, when have custom onKeydown event, that will be cover by outside
22
37
  * */
23
- var RcLink = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcLink, [
24
- {
25
- prop: 'size',
26
- time: '2021-4',
27
- comment: "@deprecated size of Link, default is medium, please use variant directly\n * `small` => `caption1`\n * `medium` => `body1`\n * `large` => `headline1`\n */",
28
- },
29
- {
30
- prop: 'handleOnClick',
31
- time: '2021-4',
32
- comment: "@deprecated use onClick replace that */",
33
- },
34
- ], 'RcLink'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.LinkStyle);
38
+ var RcLink = foundation_1.styled(_RcLink)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.LinkStyle);
35
39
  exports.RcLink = RcLink;
36
40
  RcLink.defaultProps = {
37
41
  variant: 'body1',
@@ -10,6 +10,21 @@ var styles_1 = require("./styles");
10
10
  var utils_1 = require("./utils");
11
11
  var _RcListItem = react_1.forwardRef(function (inProps, ref) {
12
12
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcListItem' });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ // eslint-disable-next-line react-hooks/rules-of-hooks
15
+ foundation_1.useDeprecatedCheck(RcListItem, props, [
16
+ {
17
+ prop: 'baseColor',
18
+ time: '2021-9',
19
+ comment: '@deprecated should use color directly',
20
+ },
21
+ {
22
+ prop: 'maxWidth',
23
+ time: '2021-4',
24
+ comment: 'recommend using classes to define',
25
+ },
26
+ ]);
27
+ }
13
28
  var classesProp = props.classes, color = props.color, TouchRipplePropsProp = props.TouchRippleProps, children = props.children, className = props.className, singleLine = props.singleLine, button = props.button, size = props.size, canHover = props.canHover, isInline = props.isInline, baseColor = props.baseColor, title = props.title, highlighted = props.highlighted, maxWidth = props.maxWidth, rest = tslib_1.__rest(props, ["classes", "color", "TouchRippleProps", "children", "className", "singleLine", "button", "size", "canHover", "isInline", "baseColor", "title", "highlighted", "maxWidth"]);
14
29
  var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcListItemClasses, classesProp); }, [classesProp]);
15
30
  var ListItemClassName = react_1.useMemo(function () {
@@ -28,18 +43,7 @@ var _RcListItem = react_1.forwardRef(function (inProps, ref) {
28
43
  }, [TouchRipplePropsProp, button]);
29
44
  return (react_1.default.createElement(ListItem_1.default, tslib_1.__assign({}, rest, additionProps, { ref: ref, title: typeof title === 'string' ? title : undefined, classes: classes, className: ListItemClassName, button: button }), children));
30
45
  });
31
- var RcListItem = foundation_1.styled(foundation_1.withDeprecatedCheck(Tooltip_1.withTooltip(_RcListItem), [
32
- {
33
- prop: 'baseColor',
34
- time: '2021-9',
35
- comment: '@deprecated should use color directly',
36
- },
37
- {
38
- prop: 'maxWidth',
39
- time: '2021-4',
40
- comment: 'recommend using classes to define',
41
- },
42
- ], 'RcListItem'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), styles_1.ListItemStyle);
46
+ var RcListItem = foundation_1.styled(Tooltip_1.withTooltip(_RcListItem))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", ";\n"], ["\n ", ";\n"])), styles_1.ListItemStyle);
43
47
  exports.RcListItem = RcListItem;
44
48
  RcListItem.defaultProps = {
45
49
  singleLine: false,
@@ -8,29 +8,33 @@ var styles_1 = require("./styles");
8
8
  var utils_1 = require("./utils");
9
9
  var _RcListItemText = react_1.forwardRef(function (inProps, ref) {
10
10
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcListItemText' });
11
+ if (process.env.NODE_ENV !== 'production') {
12
+ // eslint-disable-next-line react-hooks/rules-of-hooks
13
+ foundation_1.useDeprecatedCheck(RcListItemText, props, [
14
+ {
15
+ prop: 'primaryColor',
16
+ time: '2021-4',
17
+ comment: 'recommend use primaryTypographyProps color prop',
18
+ },
19
+ {
20
+ prop: 'alignCenter',
21
+ time: '2021-4',
22
+ comment: "recommend using classes to define it",
23
+ },
24
+ {
25
+ prop: 'lineThrough',
26
+ time: '2021-4',
27
+ comment: "recommend using classes to define it",
28
+ },
29
+ ]);
30
+ }
11
31
  var classesProp = props.classes, children = props.children, isEllipsis = props.isEllipsis, primaryTypographyPropsProp = props.primaryTypographyProps, secondaryTypographyPropsProp = props.secondaryTypographyProps, primaryColor = props.primaryColor, alignCenter = props.alignCenter, lineThrough = props.lineThrough, rest = tslib_1.__rest(props, ["classes", "children", "isEllipsis", "primaryTypographyProps", "secondaryTypographyProps", "primaryColor", "alignCenter", "lineThrough"]);
12
32
  var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcListItemTextClasses, classesProp); }, [classesProp]);
13
33
  var primaryTypographyProps = react_1.useMemo(function () { return foundation_1.omit(primaryTypographyPropsProp, ['color', 'variant']); }, [primaryTypographyPropsProp]);
14
34
  var secondaryTypographyProps = react_1.useMemo(function () { return foundation_1.omit(secondaryTypographyPropsProp, ['color', 'variant']); }, [secondaryTypographyPropsProp]);
15
35
  return (react_1.default.createElement(ListItemText_1.default, tslib_1.__assign({}, rest, { ref: ref, classes: classes, primaryTypographyProps: primaryTypographyProps, secondaryTypographyProps: secondaryTypographyProps }), children));
16
36
  });
17
- var RcListItemText = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcListItemText, [
18
- {
19
- prop: 'primaryColor',
20
- time: '2021-4',
21
- comment: 'recommend use primaryTypographyProps color prop',
22
- },
23
- {
24
- prop: 'alignCenter',
25
- time: '2021-4',
26
- comment: "recommend using classes to define it",
27
- },
28
- {
29
- prop: 'lineThrough',
30
- time: '2021-4',
31
- comment: "recommend using classes to define it",
32
- },
33
- ], 'RcListItemText'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ListItemTextStyle);
37
+ var RcListItemText = foundation_1.styled(_RcListItemText)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.ListItemTextStyle);
34
38
  exports.RcListItemText = RcListItemText;
35
39
  RcListItemText.defaultProps = {
36
40
  isEllipsis: true,
@@ -20,10 +20,12 @@ var RcLoading = function (inProps) {
20
20
  childrenWhenLoading.type !== react_1.default.Fragment) {
21
21
  return (react_1.default.createElement(Box_1.RcBox, { clone: true, display: "none" }, childrenWhenLoading));
22
22
  }
23
- foundation_1.logInDev({
24
- component: 'RcLoading',
25
- message: 'please confirm your children is a valid html element to set style, when you use `keepVisible=false`',
26
- });
23
+ if (process.env.NODE_ENV !== 'production') {
24
+ foundation_1.logInDev({
25
+ component: 'RcLoading',
26
+ message: 'please confirm your children is a valid html element to set style, when you use `keepVisible=false`',
27
+ });
28
+ }
27
29
  return childrenWhenLoading;
28
30
  };
29
31
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -52,10 +52,12 @@ var _RcMenuItem = react_1.forwardRef(function (inProps, ref) {
52
52
  return foundation_1.isRcElement(icon, ['RcListItemIcon']) ? (icon) : (react_1.default.createElement(ListItemIcon_1.RcListItemIcon, null, icon));
53
53
  }
54
54
  if (typeof icon === 'string') {
55
- foundation_1.logInDev({
56
- component: 'RcMenuItem',
57
- message: 'please use symbol to replace icon string',
58
- });
55
+ if (process.env.NODE_ENV !== 'production') {
56
+ foundation_1.logInDev({
57
+ component: 'RcMenuItem',
58
+ message: 'please use symbol to replace icon string',
59
+ });
60
+ }
59
61
  return (react_1.default.createElement(ListItemIcon_1.RcListItemIcon, null,
60
62
  react_1.default.createElement(Icon_1.RcIcon, { size: "small" }, icon)));
61
63
  }
@@ -33,10 +33,12 @@ var PortalManager = /** @class */ (function (_super) {
33
33
  var currPortal = this.portalStore.get(id);
34
34
  // portalWithSameID opened
35
35
  if (currPortal === null || currPortal === void 0 ? void 0 : currPortal.open) {
36
- foundation_1.logInDev({
37
- component: 'RcPortalHost',
38
- message: "open the portal with id('" + id + "') failed, this portal is already open",
39
- });
36
+ if (process.env.NODE_ENV !== 'production') {
37
+ foundation_1.logInDev({
38
+ component: 'RcPortalHost',
39
+ message: "open the portal with id('" + id + "') failed, this portal is already open",
40
+ });
41
+ }
40
42
  return currPortal.portalController;
41
43
  }
42
44
  var portalDescriptor = this.createPortalDescriptor({
@@ -120,10 +122,12 @@ var PortalManager = /** @class */ (function (_super) {
120
122
  PortalManager.prototype.closeByID = function (id, feedback) {
121
123
  var portal = this.portalStore.get(id);
122
124
  if (!(portal === null || portal === void 0 ? void 0 : portal.open)) {
123
- foundation_1.logInDev({
124
- component: 'RcPortalHost',
125
- message: 'close portal failed, this portal is already closed',
126
- });
125
+ if (process.env.NODE_ENV !== 'production') {
126
+ foundation_1.logInDev({
127
+ component: 'RcPortalHost',
128
+ message: 'close portal failed, this portal is already closed',
129
+ });
130
+ }
127
131
  return;
128
132
  }
129
133
  this._feedbackMap.set(portal.id, feedback);
@@ -139,10 +143,12 @@ var PortalManager = /** @class */ (function (_super) {
139
143
  PortalManager.prototype[types_1.UnmountSymbol] = function (id) {
140
144
  var portal = this.portalStore.get(id);
141
145
  if (!portal) {
142
- foundation_1.logInDev({
143
- component: 'RcPortalHost',
144
- message: 'unmount portal failed, this portal is already unmount',
145
- });
146
+ if (process.env.NODE_ENV !== 'production') {
147
+ foundation_1.logInDev({
148
+ component: 'RcPortalHost',
149
+ message: 'unmount portal failed, this portal is already unmount',
150
+ });
151
+ }
146
152
  return;
147
153
  }
148
154
  this.portalStore.delete(portal.id);
@@ -153,10 +159,12 @@ var PortalManager = /** @class */ (function (_super) {
153
159
  PortalManager.prototype.updatePropsByID = function (id, propsOrHandler) {
154
160
  var portal = this.portalStore.get(id);
155
161
  if (!(portal === null || portal === void 0 ? void 0 : portal.open)) {
156
- foundation_1.logInDev({
157
- component: 'RcPortalHost',
158
- message: 'update props failed, this portal is already closed',
159
- });
162
+ if (process.env.NODE_ENV !== 'production') {
163
+ foundation_1.logInDev({
164
+ component: 'RcPortalHost',
165
+ message: 'update props failed, this portal is already closed',
166
+ });
167
+ }
160
168
  return;
161
169
  }
162
170
  var props = (function () {
@@ -10,6 +10,16 @@ var utils_1 = require("./utils");
10
10
  /** @release */
11
11
  var _RcSnackbarContent = react_1.forwardRef(function (inProps, ref) {
12
12
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcSnackbarContent' });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ // eslint-disable-next-line react-hooks/rules-of-hooks
15
+ foundation_1.useDeprecatedCheck(RcSnackbarContent, props, [
16
+ {
17
+ prop: 'ariaLabel',
18
+ time: '2021-3',
19
+ comment: "please use `aria-label` directly ",
20
+ },
21
+ ]);
22
+ }
13
23
  var classesProp = props.classes, loading = props.loading, size = props.size, messageAlign = props.messageAlign, type = props.type, fullWidth = props.fullWidth, actionProp = props.action, rest = tslib_1.__rest(props, ["classes", "loading", "size", "messageAlign", "type", "fullWidth", "action"]);
14
24
  var classes = react_1.useMemo(function () { return foundation_1.combineClasses(utils_1.RcSnackbarContentClasses, classesProp); }, [classesProp]);
15
25
  var action = react_1.useMemo(function () {
@@ -30,13 +40,7 @@ var _RcSnackbarContent = react_1.forwardRef(function (inProps, ref) {
30
40
  }, [actionProp, size]);
31
41
  return (react_1.default.createElement(SnackbarContent_1.default, tslib_1.__assign({}, rest, { ref: ref, classes: classes, action: loading ? (react_1.default.createElement(CircularProgress_1.RcCircularProgress, { color: "inherit", size: utils_1.RcSnackbarContentLoadingSizes[size] })) : (action) })));
32
42
  });
33
- var RcSnackbarContent = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcSnackbarContent, [
34
- {
35
- prop: 'ariaLabel',
36
- time: '2021-3',
37
- comment: "please use `aria-label` directly ",
38
- },
39
- ], 'RcSnackbarContent'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.snackbarContentStyle);
43
+ var RcSnackbarContent = foundation_1.styled(_RcSnackbarContent)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.snackbarContentStyle);
40
44
  exports.RcSnackbarContent = RcSnackbarContent;
41
45
  RcSnackbarContent.defaultProps = {
42
46
  type: 'success',
@@ -6,16 +6,20 @@ var foundation_1 = require("../../foundation");
6
6
  var styles_1 = require("./styles");
7
7
  var _RcTag = react_1.memo(react_1.forwardRef(function (inProps, ref) {
8
8
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcTag' });
9
+ if (process.env.NODE_ENV !== 'production') {
10
+ // eslint-disable-next-line react-hooks/rules-of-hooks
11
+ foundation_1.useDeprecatedCheck(RcTag, props, [
12
+ {
13
+ prop: 'content',
14
+ comment: 'you should replace with children',
15
+ time: '2021-1',
16
+ },
17
+ ]);
18
+ }
9
19
  var color = props.color, children = props.children, content = props.content, textColor = props.textColor, borderColor = props.borderColor, radius = props.radius, rest = tslib_1.__rest(props, ["color", "children", "content", "textColor", "borderColor", "radius"]);
10
20
  return (react_1.default.createElement("span", tslib_1.__assign({}, rest, { ref: ref }), content || children));
11
21
  }));
12
- var RcTag = foundation_1.styled(foundation_1.withDeprecatedCheck(_RcTag, [
13
- {
14
- prop: 'content',
15
- comment: 'you should replace with children',
16
- time: '2021-1',
17
- },
18
- ]))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TagStyle);
22
+ var RcTag = foundation_1.styled(_RcTag)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), styles_1.TagStyle);
19
23
  exports.RcTag = RcTag;
20
24
  RcTag.defaultProps = {
21
25
  color: 'highlight.b03',
@@ -29,8 +29,7 @@ var _RcText = react_1.forwardRef(function (inProps, ref) {
29
29
  }, [TooltipPropsProp, isShowTitle]);
30
30
  return (react_1.default.createElement(Typography_1.RcTypography, tslib_1.__assign({ ref: textRef, title: isShowTitle || useRcTooltip // * if useRcTooltip always keep title pass into
31
31
  ? // * if user pass title, use title first
32
- title || (isString_1.default(children) ? children : undefined)
33
- : undefined, TooltipProps: TooltipProps, useRcTooltip: useRcTooltip, variant: highlight ? 'inherit' : undefined, component: highlight ? 'span' : undefined, className: className }, rest), children));
32
+ title !== null && title !== void 0 ? title : (isString_1.default(children) ? children : undefined) : undefined, TooltipProps: TooltipProps, useRcTooltip: useRcTooltip, variant: highlight ? 'inherit' : undefined, component: highlight ? 'span' : undefined, className: className }, rest), children));
34
33
  });
35
34
  /**
36
35
  * `RcText` will auto add title with children when that children is string
@@ -6,10 +6,13 @@ var core_1 = require("@material-ui/core");
6
6
  var foundation_1 = require("../../foundation");
7
7
  var styled_components_1 = tslib_1.__importDefault(require("../../foundation/styled-components"));
8
8
  var _RcTextWithEllipsis = react_1.forwardRef(function (props, ref) {
9
- foundation_1.useDeprecatedLog({
10
- component: 'RcTextWithEllipsis',
11
- message: 'should not use that, just use `RcText` with `titleWhenOverflow` and `flexFull`',
12
- });
9
+ if (process.env.NODE_ENV !== 'production') {
10
+ // eslint-disable-next-line react-hooks/rules-of-hooks
11
+ foundation_1.useDeprecatedLog({
12
+ component: 'RcTextWithEllipsis',
13
+ message: 'should not use that, just use `RcText` with `titleWhenOverflow` and `flexFull`',
14
+ });
15
+ }
13
16
  return react_1.default.createElement(core_1.Typography, tslib_1.__assign({}, props, { ref: ref }));
14
17
  });
15
18
  /** @deprecated should not use that, just use `RcText` with `titleWhenOverflow` and `flexFull` */
@@ -7,10 +7,13 @@ var styled_components_1 = tslib_1.__importDefault(require("../../foundation/styl
7
7
  var StyledSpan = styled_components_1.default.span(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n a {\n color: inherit;\n }\n"], ["\n color: ", ";\n background-color: ", ";\n a {\n color: inherit;\n }\n"])), foundation_1.palette2('highlight', 'f01'), foundation_1.palette2('highlight', 'b02'));
8
8
  /** @deprecated should not use that, just use RcText with `highlight` */
9
9
  var RcTextWithHighlight = function (props) {
10
- foundation_1.useDeprecatedLog({
11
- component: 'RcTextWithHighlight',
12
- message: 'should not use that, just use RcText with `highlight`',
13
- });
10
+ if (process.env.NODE_ENV !== 'production') {
11
+ // eslint-disable-next-line react-hooks/rules-of-hooks
12
+ foundation_1.useDeprecatedLog({
13
+ component: 'RcTextWithHighlight',
14
+ message: 'should not use that, just use RcText with `highlight`',
15
+ });
16
+ }
14
17
  return react_1.default.createElement(StyledSpan, tslib_1.__assign({ className: "highlight-term" }, props));
15
18
  };
16
19
  exports.RcTextWithHighlight = RcTextWithHighlight;
@@ -9,10 +9,13 @@ var Link_1 = require("../Link");
9
9
  var TipsText = styled_components_1.default(Typography_1.default)(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n && {\n color: ", ";\n ", ";\n * {\n ", ";\n }\n }\n"], ["\n && {\n color: ", ";\n ", ";\n * {\n ", ";\n }\n }\n"])), foundation_1.palette2('neutral', 'f04'), foundation_1.typography('caption1'), foundation_1.typography('caption1'));
10
10
  /** @deprecated please don't use that component, just use RcText and RcLink directly */
11
11
  var RcTextWithLink = react_1.memo(function (props) {
12
- foundation_1.useDeprecatedLog({
13
- component: 'RcTextWithLink',
14
- message: "please don't use that component, just use `RcText` and RcLink directly",
15
- });
12
+ if (process.env.NODE_ENV !== 'production') {
13
+ // eslint-disable-next-line react-hooks/rules-of-hooks
14
+ foundation_1.useDeprecatedLog({
15
+ component: 'RcTextWithLink',
16
+ message: "please don't use that component, just use `RcText` and RcLink directly",
17
+ });
18
+ }
16
19
  var text = props.text, linkText = props.linkText, onClick = props.onClick, TypographyProps = props.TypographyProps, RcLinkProps = props.RcLinkProps;
17
20
  var textProps;
18
21
  if (TypographyProps) {
@@ -10,10 +10,13 @@ var StyledText = foundation_1.styled.span(templateObject_1 || (templateObject_1
10
10
  });
11
11
  /** @deprecated please don't use that component, just use `RcText` with `title` directly */
12
12
  var RcTextWithTooltip = function (props) {
13
- foundation_1.useDeprecatedLog({
14
- component: 'RcTextWithTooltip',
15
- message: "please don't use that component, just use `RcText` with `title` directly",
16
- });
13
+ if (process.env.NODE_ENV !== 'production') {
14
+ // eslint-disable-next-line react-hooks/rules-of-hooks
15
+ foundation_1.useDeprecatedLog({
16
+ component: 'RcTextWithTooltip',
17
+ message: "please don't use that component, just use `RcText` with `title` directly",
18
+ });
19
+ }
17
20
  var tooltip = props.tooltip, children = props.children, _a = props.textColor, textColor = _a === void 0 ? ['neutral', 'f06'] : _a;
18
21
  var ref = react_1.useRef(null);
19
22
  var _b = tslib_1.__read(react_1.useState(false), 2), showTooltip = _b[0], setShowTooltip = _b[1];
@@ -7,21 +7,25 @@ var Icon_1 = require("../Icon");
7
7
  var styles_1 = require("./styles");
8
8
  var _RcThumbnail = react_1.forwardRef(function (inProps, ref) {
9
9
  var props = foundation_1.useThemeProps({ props: inProps, name: 'RcThumbnail' });
10
+ if (process.env.NODE_ENV !== 'production') {
11
+ // eslint-disable-next-line react-hooks/rules-of-hooks
12
+ foundation_1.useDeprecatedCheck(RcThumbnail, props, [
13
+ {
14
+ prop: 'iconType',
15
+ time: '2021-2',
16
+ comment: 'Please use symbol to set icon',
17
+ },
18
+ {
19
+ prop: 'url',
20
+ time: '2021-2',
21
+ comment: 'Please use src to set url',
22
+ },
23
+ ]);
24
+ }
10
25
  var url = props.url, _a = props.src, src = _a === void 0 ? url : _a, iconType = props.iconType, size = props.size, symbol = props.symbol, rest = tslib_1.__rest(props, ["url", "src", "iconType", "size", "symbol"]);
11
26
  return (react_1.default.createElement(react_1.default.Fragment, null, src ? (react_1.default.createElement(styles_1.StyledThumbnail, tslib_1.__assign({ ref: ref, src: src, size: size, "data-test-automation-id": "thumbnail" }, rest))) : (react_1.default.createElement(Icon_1.RcIcon, tslib_1.__assign({ ref: ref, "data-test-automation-id": "iconThumbnail" }, rest, { size: size === 'small' ? 'small' : 'xxxlarge', symbol: symbol }), iconType))));
12
27
  });
13
- var RcThumbnail = foundation_1.styled(foundation_1.withDeprecatedCheck(react_1.memo(_RcThumbnail), [
14
- {
15
- prop: 'iconType',
16
- time: '2021-2',
17
- comment: 'Please use symbol to set icon',
18
- },
19
- {
20
- prop: 'url',
21
- time: '2021-2',
22
- comment: 'Please use src to set url',
23
- },
24
- ], 'RcThumbnail'))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
28
+ var RcThumbnail = foundation_1.styled(react_1.memo(_RcThumbnail))(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject([""], [""])));
25
29
  exports.RcThumbnail = RcThumbnail;
26
30
  RcThumbnail.defaultProps = {
27
31
  size: 'large',