@ringcentral/juno 2.8.1 → 2.11.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 (90) hide show
  1. package/components/Buttons/IconButton/IconButton.js +5 -2
  2. package/components/Buttons/IconButton/styles/StyledIconButton.js +15 -7
  3. package/components/Dialer/DialPad/DialPad.d.ts +3 -3
  4. package/components/Dialer/DialPad/DialPad.js +2 -3
  5. package/components/Dialog/Dialog.js +4 -2
  6. package/components/Downshift/SuggestionList/SuggestionList.d.ts +3 -3
  7. package/components/Drawer/Drawer.js +8 -2
  8. package/components/Forms/TextField/TextField.d.ts +2 -2
  9. package/components/Forms/TextField/TextField.js +19 -4
  10. package/components/PortalHost/context/HasPortalParentContext.d.ts +3 -0
  11. package/components/PortalHost/context/HasPortalParentContext.js +9 -0
  12. package/components/PortalHost/utils/usePortalManagerWithID.js +5 -4
  13. package/components/Snackbar/Snackbar.js +3 -1
  14. package/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +17 -13
  15. package/components/VirtualizedMenu/VirtualizedMenu.js +4 -12
  16. package/components/Virtuoso/react-virtuoso/Grid.d.ts +28 -18
  17. package/components/Virtuoso/react-virtuoso/List.d.ts +487 -183
  18. package/components/Virtuoso/react-virtuoso/List.js +13 -2
  19. package/components/Virtuoso/react-virtuoso/Table.d.ts +434 -172
  20. package/components/Virtuoso/react-virtuoso/Table.js +14 -2
  21. package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +32 -16
  22. package/components/Virtuoso/react-virtuoso/components.d.ts +8 -0
  23. package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +3 -1
  24. package/components/Virtuoso/react-virtuoso/domIOSystem.js +4 -2
  25. package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +20 -10
  26. package/components/Virtuoso/react-virtuoso/followOutputSystem.js +1 -0
  27. package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +24 -14
  28. package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +4 -2
  29. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +2 -1
  30. package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +5 -10
  31. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +2 -1
  32. package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +16 -7
  33. package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +2 -2
  34. package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +24 -12
  35. package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +32 -16
  36. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +8 -4
  37. package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +1 -1
  38. package/components/Virtuoso/react-virtuoso/interfaces.d.ts +22 -5
  39. package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +24 -12
  40. package/components/Virtuoso/react-virtuoso/listSystem.d.ts +287 -146
  41. package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +32 -16
  42. package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +4 -2
  43. package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +4 -2
  44. package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +4 -2
  45. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +4 -2
  46. package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +5 -4
  47. package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +24 -12
  48. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +28 -14
  49. package/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +4 -0
  50. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +32 -16
  51. package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +12 -35
  52. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.d.ts +1 -0
  53. package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +7 -0
  54. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +6 -4
  55. package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +6 -2
  56. package/components/Virtuoso/utils/useHighlightScroll.js +1 -2
  57. package/es6/components/Buttons/IconButton/IconButton.js +5 -2
  58. package/es6/components/Buttons/IconButton/styles/StyledIconButton.js +16 -8
  59. package/es6/components/Dialer/DialPad/DialPad.js +3 -4
  60. package/es6/components/Dialog/Dialog.js +4 -2
  61. package/es6/components/Drawer/Drawer.js +8 -2
  62. package/es6/components/Forms/TextField/TextField.js +20 -5
  63. package/es6/components/PortalHost/context/HasPortalParentContext.js +6 -0
  64. package/es6/components/PortalHost/utils/usePortalManagerWithID.js +5 -4
  65. package/es6/components/Snackbar/Snackbar.js +3 -1
  66. package/es6/components/Tabs/Tabs/MoreMenuTabs/MoreMenuTabs.js +17 -13
  67. package/es6/components/VirtualizedMenu/VirtualizedMenu.js +6 -14
  68. package/es6/components/Virtuoso/react-virtuoso/List.js +14 -3
  69. package/es6/components/Virtuoso/react-virtuoso/Table.js +14 -2
  70. package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +4 -3
  71. package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +1 -0
  72. package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +5 -10
  73. package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +16 -7
  74. package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +2 -2
  75. package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +1 -1
  76. package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +5 -4
  77. package/es6/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +4 -0
  78. package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +12 -35
  79. package/es6/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +4 -0
  80. package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +6 -2
  81. package/es6/components/Virtuoso/utils/useHighlightScroll.js +1 -2
  82. package/es6/foundation/theme/assets/palette.light.json +3 -3
  83. package/es6/foundation/theme/createTheme.js +1 -1
  84. package/foundation/theme/ThemeHandler.d.ts +1 -1
  85. package/foundation/theme/ThemeSwitcherProvider/ThemeSwitcherProvider.d.ts +2 -2
  86. package/foundation/theme/assets/palette.light.json +3 -3
  87. package/foundation/theme/theme.type.d.ts +2 -2
  88. package/foundation/typings/deepPartial.d.ts +1 -3
  89. package/foundation/utils/deepmerge.d.ts +3 -2
  90. package/package.json +3 -2
@@ -15,7 +15,7 @@ var _RcIconButton = memo(forwardRef(function (inProps, ref) {
15
15
  // eslint-disable-next-line react-hooks/rules-of-hooks
16
16
  useDeprecatedCheck(RcIconButton, props, rcIconButtonWarning);
17
17
  }
18
- var _b = props.buttonRef, buttonRef = _b === void 0 ? ref : _b, IconProps = props.IconProps, className = props.className, classesProp = props.classes, children = props.children, title = props.title, disabledFakeBorder = props.disabledFakeBorder, 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 = __rest(props, ["buttonRef", "IconProps", "className", "classes", "children", "title", "disabledFakeBorder", "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"]);
18
+ var _b = props.buttonRef, buttonRef = _b === void 0 ? ref : _b, _c = props.IconProps, IconProps = _c === void 0 ? {} : _c, className = props.className, classesProp = props.classes, children = props.children, title = props.title, disabledFakeBorder = props.disabledFakeBorder, 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 = __rest(props, ["buttonRef", "IconProps", "className", "classes", "children", "title", "disabledFakeBorder", "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"]);
19
19
  var theme = useTheme();
20
20
  var isOutline = variant === 'outline';
21
21
  var isContained = variant === 'contained';
@@ -31,7 +31,10 @@ var _RcIconButton = memo(forwardRef(function (inProps, ref) {
31
31
  _a));
32
32
  var iconButton = (function () {
33
33
  var _a, _b;
34
- var icon = React.isValidElement(children) || children === '' ? children : (React.createElement(RcIcon, __assign({ symbol: symbol, className: classes.icon, loading: loading, size: "inherit", CircularProgressProps: CircularProgressProps }, IconProps), children));
34
+ // `color` already handle in StyledIconButton
35
+ // eslint-disable-next-line @typescript-eslint/no-shadow
36
+ var color = IconProps.color, IconPropsWithoutColor = __rest(IconProps, ["color"]);
37
+ var icon = React.isValidElement(children) || children === '' ? children : (React.createElement(RcIcon, __assign({ symbol: symbol, className: classes.icon, loading: loading, size: "inherit", CircularProgressProps: CircularProgressProps }, IconPropsWithoutColor), children));
35
38
  var iconButton = (React.createElement(RcButtonBase, __assign({ ref: buttonRef, disableRipple: ((_b = (_a = theme.props) === null || _a === void 0 ? void 0 : _a.MuiButtonBase) === null || _b === void 0 ? void 0 : _b.disableRipple) || isPlain, type: type, disabled: disabled, "aria-label": ariaLabel || tooltipTitle || title, title: title, "aria-disabled": disabled, className: IconClassName, TouchRippleProps: combineProps({
36
39
  classes: RcIconButtonTouchRippleClasses,
37
40
  }, TouchRippleProps) }, rest), icon));
@@ -1,5 +1,5 @@
1
1
  import { __makeTemplateObject } from "tslib";
2
- import { backgroundTransition, css, focusVisible, focusVisibleColor, getParsePaletteColor, nonTouchHoverMedia, palette2, paletteContrastText, px, radius, setOpacity, shadows, fakeBorder, } from '../../../../foundation';
2
+ import { backgroundTransition, css, focusVisible, focusVisibleColor, getParsePaletteColor, nonTouchHoverMedia, palette2, paletteContrastText, px, radius, setOpacity, shadows, fakeBorder, opacity, } from '../../../../foundation';
3
3
  import { RcIconButtonClasses, RcIconButtonFocusVisibleInsetSize, RcIconButtonSizes, RcIconButtonTouchRippleClasses, } from '../utils';
4
4
  export var getFocusVisibleInsetSize = function (_a) {
5
5
  var size = _a.size;
@@ -17,7 +17,8 @@ export var plainIconButtonFocusStyle = function (_a) {
17
17
  return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:after {\n content: '';\n position: absolute;\n ", ";\n box-shadow: 0 0 0 1px ", ";\n border-radius: ", ";\n pointer-events: none;\n z-index: 1;\n }\n"], ["\n &:after {\n content: '';\n position: absolute;\n ", ";\n box-shadow: 0 0 0 1px ", ";\n border-radius: ", ";\n pointer-events: none;\n z-index: 1;\n }\n"])), getFocusVisibleInsetSize, focusVisibleColor, radius(radiusProp));
18
18
  };
19
19
  export var iconButtonStyle = function (_a) {
20
- var variant = _a.variant, size = _a.size, stretchIcon = _a.stretchIcon, color = _a.color, disabled = _a.disabled, useColorWhenDisabled = _a.useColorWhenDisabled, shouldPersistBg = _a.shouldPersistBg, radiusProp = _a.radius, disableRipple = _a.disableRipple, elevation = _a.elevation, disabledFakeBorder = _a.disabledFakeBorder, activeElevation = _a.activeElevation;
20
+ var variant = _a.variant, size = _a.size, stretchIcon = _a.stretchIcon, color = _a.color, disabled = _a.disabled, useColorWhenDisabled = _a.useColorWhenDisabled, shouldPersistBg = _a.shouldPersistBg, radiusProp = _a.radius, disableRipple = _a.disableRipple, elevation = _a.elevation, disabledFakeBorder = _a.disabledFakeBorder, activeElevation = _a.activeElevation, _b = _a.IconProps, IconProps = _b === void 0 ? {} : _b;
21
+ var iconColor = IconProps.color;
21
22
  var iconSize = RcIconButtonSizes[size];
22
23
  var isCircle = ['plain', 'round', 'inverse', 'contained'].includes(variant);
23
24
  var isPlain = variant === 'plain';
@@ -26,7 +27,9 @@ export var iconButtonStyle = function (_a) {
26
27
  var isContained = variant === 'contained';
27
28
  var containerSize = px(isPlain ? iconSize : iconSize * 2);
28
29
  var mainColor = getParsePaletteColor(color);
29
- var mainColorContrast = paletteContrastText(mainColor);
30
+ var containedColor = iconColor
31
+ ? getParsePaletteColor(iconColor)
32
+ : paletteContrastText(mainColor);
30
33
  var currRadius = radiusProp || (isOutline ? 'lg' : isCircle ? 'circle' : 'zero');
31
34
  var persistBgColor = setOpacity(mainColor, isInverse ? '16' : '12');
32
35
  var defaultShadow = isContained ? shadows('1') : undefined;
@@ -38,12 +41,13 @@ export var iconButtonStyle = function (_a) {
38
41
  radius: currRadius,
39
42
  pseudo: true,
40
43
  });
41
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n width: ", ";\n height: ", ";\n color: ", ";\n border-radius: ", ";\n transition: ", ";\n cursor: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n ", ";\n\n font-size: ", ";\n\n ", " {\n &:hover {\n background-color: ", ";\n\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n }\n\n ", " {\n background-color: ", ";\n\n &:active {\n color: ", ";\n }\n\n ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n }\n\n &.", " {\n opacity: 0;\n visibility: hidden;\n width: 0;\n height: 0;\n }\n\n &.", " {\n border: 1px solid ", ";\n }\n\n &.", " {\n color: ", ";\n background-color: ", ";\n\n &:before {\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n border-radius: ", ";\n position: absolute;\n }\n\n ", ";\n\n ", " {\n &:hover {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n }\n\n ", " {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n\n &:active {\n ", "\n\n color: ", ";\n }\n }\n\n &.", " {\n ", ";\n }\n\n .", " {\n border-radius: 0;\n animation-name: none;\n opacity: 0;\n }\n\n ", "\n "], ["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n width: ", ";\n height: ", ";\n color: ", ";\n border-radius: ", ";\n transition: ", ";\n cursor: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n ",
44
+ return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n width: ", ";\n height: ", ";\n color: ", ";\n border-radius: ", ";\n transition: ", ";\n cursor: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n ", ";\n\n font-size: ", ";\n\n ", " {\n &:hover {\n background-color: ", ";\n\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n }\n\n ", " {\n background-color: ", ";\n\n &:active {\n color: ", ";\n }\n\n ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n color: ", ";\n\n background-color: ", ";\n }\n\n &.", " {\n opacity: 0;\n visibility: hidden;\n width: 0;\n height: 0;\n }\n\n &.", " {\n border: 1px solid ", ";\n }\n\n &.", " {\n color: ", ";\n background-color: ", ";\n\n &.", " {\n ", "\n }\n\n &:before {\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n border-radius: ", ";\n position: absolute;\n }\n\n ", ";\n\n ", " {\n &:hover {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n }\n\n ", " {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n\n &:active {\n ", "\n\n color: ", ";\n }\n }\n\n &.", " {\n ", ";\n }\n\n .", " {\n border-radius: 0;\n animation-name: none;\n opacity: 0;\n }\n\n ", "\n "], ["\n display: inline-flex;\n justify-content: center;\n align-items: center;\n\n width: ", ";\n height: ", ";\n color: ", ";\n border-radius: ", ";\n transition: ", ";\n cursor: ", ";\n background-color: ", ";\n box-shadow: ", ";\n\n ",
42
45
  ";\n\n font-size: ",
43
46
  ";\n\n ", " {\n &:hover {\n background-color: ",
44
47
  ";\n\n color: ", ";\n }\n }\n\n &:active {\n color: ", ";\n }\n\n ", " {\n background-color: ",
45
48
  ";\n\n &:active {\n color: ", ";\n }\n\n ", ";\n }\n\n &.", " {\n background-color: ", ";\n }\n\n &.", " {\n color: ",
46
- ";\n\n background-color: ", ";\n }\n\n &.", " {\n opacity: 0;\n visibility: hidden;\n width: 0;\n height: 0;\n }\n\n &.", " {\n border: 1px solid ", ";\n }\n\n &.", " {\n color: ", ";\n background-color: ", ";\n\n &:before {\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n border-radius: ", ";\n position: absolute;\n }\n\n ", ";\n\n ", " {\n &:hover {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n }\n\n ", " {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n\n &:active {\n ",
49
+ ";\n\n background-color: ", ";\n }\n\n &.", " {\n opacity: 0;\n visibility: hidden;\n width: 0;\n height: 0;\n }\n\n &.", " {\n border: 1px solid ", ";\n }\n\n &.", " {\n color: ", ";\n background-color: ", ";\n\n &.", " {\n ",
50
+ "\n }\n\n &:before {\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n border-radius: ", ";\n position: absolute;\n }\n\n ", ";\n\n ", " {\n &:hover {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n }\n\n ", " {\n &:before {\n background-color: ", ";\n }\n\n color: ", ";\n }\n\n &:active {\n ",
47
51
  "\n\n color: ", ";\n }\n }\n\n &.", " {\n ", ";\n }\n\n .", " {\n border-radius: 0;\n animation-name: none;\n opacity: 0;\n }\n\n "
48
52
  /**
49
53
  * that is equilateral triangle, the third Side length is
@@ -62,13 +66,17 @@ export var iconButtonStyle = function (_a) {
62
66
  ? 'transparent'
63
67
  : setOpacity(mainColor, isInverse ? '32' : '16'), setOpacity(mainColor, '88'), isPlain && plainIconButtonFocusStyle({ radius: currRadius }), RcIconButtonClasses.persistBg, persistBgColor, RcIconButtonClasses.disabled, useColorWhenDisabled
64
68
  ? setOpacity(mainColor, '32')
65
- : palette2('disabled', 'f02'), isInverse && setOpacity(mainColor, '12'), RcIconButtonClasses.invisible, RcIconButtonClasses.outline, palette2('neutral', 'l03'), RcIconButtonClasses.contained, mainColorContrast, mainColor, radiusValue, contrastColorBorder, nonTouchHoverMedia, setOpacity(mainColorContrast, '08'), mainColorContrast, focusVisible, setOpacity(mainColorContrast, '16'), mainColorContrast, disableRipple && css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &:before {\n background-color: ", ";\n }\n "], ["\n &:before {\n background-color: ", ";\n }\n "])), setOpacity(mainColorContrast, '24')), mainColorContrast, RcIconButtonClasses.inverse, contrastColorBorder, RcIconButtonTouchRippleClasses.ripplePulsate,
69
+ : palette2('disabled', 'f02'), isInverse && setOpacity(mainColor, '12'), RcIconButtonClasses.invisible, RcIconButtonClasses.outline, palette2('neutral', 'l03'), RcIconButtonClasses.contained, containedColor, mainColor, RcIconButtonClasses.disabled, function () {
70
+ if (useColorWhenDisabled)
71
+ return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n background-color: ", ";\n opacity: ", ";\n "], ["\n color: ", ";\n background-color: ", ";\n opacity: ", ";\n "])), containedColor, mainColor, opacity('32'));
72
+ return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), palette2('disabled', 'b01'), palette2('disabled', 'f01'));
73
+ }, radiusValue, contrastColorBorder, nonTouchHoverMedia, setOpacity(containedColor, '08'), containedColor, focusVisible, setOpacity(containedColor, '16'), containedColor, disableRipple && css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n &:before {\n background-color: ", ";\n }\n "], ["\n &:before {\n background-color: ", ";\n }\n "])), setOpacity(containedColor, '24')), containedColor, RcIconButtonClasses.inverse, contrastColorBorder, RcIconButtonTouchRippleClasses.ripplePulsate,
66
74
  /**
67
75
  * that is equilateral triangle, the third Side length is
68
76
  * Math.sqrt(2) = 1.414213562373095, so we scale that
69
77
  * to make that full with this square
70
78
  */
71
79
  !isPlain &&
72
- !['circle', 'round'].includes(currRadius) && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n .", " {\n transform: scale(1.41421357);\n }\n "], ["\n .", " {\n transform: scale(1.41421357);\n }\n "])), RcIconButtonTouchRippleClasses.child));
80
+ !['circle', 'round'].includes(currRadius) && css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n .", " {\n transform: scale(1.41421357);\n }\n "], ["\n .", " {\n transform: scale(1.41421357);\n }\n "])), RcIconButtonTouchRippleClasses.child));
73
81
  };
74
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
82
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -1,13 +1,12 @@
1
1
  import { __assign, __makeTemplateObject, __read, __rest, __values } from "tslib";
2
2
  import React, { forwardRef, useEffect, useImperativeHandle, useRef, } from 'react';
3
- import { styled, useDebounce, useEventCallback, useForkRef, useKeyboardMoveFocus, useOnlyOneFocusable, useThemeProps, } from '../../../foundation';
3
+ import { styled, useEventCallback, useForkRef, useKeyboardMoveFocus, useOnlyOneFocusable, useThemeProps, } from '../../../foundation';
4
4
  import { RcIconButtonClasses } from '../../Buttons/IconButton/utils';
5
5
  import { RcVisuallyHidden } from '../../VisuallyHidden';
6
6
  import { RcDialPadButton } from '../DialPadButton';
7
7
  import { useRcDialerContext } from '../utils';
8
8
  import { DialPadStyle } from './styles';
9
9
  import { ACCEPTABLE_KEYS, DIALER_PAD_ICONS, DIALER_PAD_PLUS, useKeyAudio, } from './utils';
10
- var DEBOUNCE_TIME = 30;
11
10
  var _RcDialPad = forwardRef(function (inProps, ref) {
12
11
  var props = useThemeProps({ props: inProps, name: 'RcDialPad' });
13
12
  var sounds = props.sounds, volume = props.volume, autoSize = props.autoSize, muted = props.muted, classes = props.classes, onChangeProp = props.onChange, longPressDelay = props.longPressDelay, action = props.action, persistBgTime = props.persistBgTime, control = props.control, getDialPadButtonProps = props.getDialPadButtonProps, _a = props.externalWindow, externalWindow = _a === void 0 ? window : _a, divProps = __rest(props, ["sounds", "volume", "autoSize", "muted", "classes", "onChange", "longPressDelay", "action", "persistBgTime", "control", "getDialPadButtonProps", "externalWindow"]);
@@ -61,7 +60,7 @@ var _RcDialPad = forwardRef(function (inProps, ref) {
61
60
  (_a = onInsertRef === null || onInsertRef === void 0 ? void 0 : onInsertRef.current) === null || _a === void 0 ? void 0 : _a.call(onInsertRef, value, reason);
62
61
  onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(value, reason);
63
62
  };
64
- var handleKeyboardEffect = useDebounce(function (value, isKeyup) {
63
+ var handleKeyboardEffect = useEventCallback(function (value, isKeyup) {
65
64
  var _a, _b;
66
65
  if (isKeyup) {
67
66
  handleChange(value, 'customKeyboard');
@@ -72,7 +71,7 @@ var _RcDialPad = forwardRef(function (inProps, ref) {
72
71
  (_b = hiddenRef.current) === null || _b === void 0 ? void 0 : _b.focus();
73
72
  }
74
73
  }
75
- }, DEBOUNCE_TIME);
74
+ });
76
75
  var handleKeyEffect = useEventCallback(function (value, reason) {
77
76
  handleChange(value, reason);
78
77
  });
@@ -6,6 +6,7 @@ import { useUnmountPortalHandler } from '../PortalHost';
6
6
  import { DialogStyle } from './styles';
7
7
  import { RcDialogClasses } from './utils';
8
8
  import { RcDialogContext } from './utils/DialogContext';
9
+ import { HasPortalParentProvider } from '../PortalHost/context/HasPortalParentContext';
9
10
  var _RcDialog = forwardRef(function (inProps, ref) {
10
11
  var props = useThemeProps({ props: inProps, name: 'RcDialog' });
11
12
  if (process.env.NODE_ENV !== 'production') {
@@ -42,8 +43,9 @@ var _RcDialog = forwardRef(function (inProps, ref) {
42
43
  var TransitionProps = __assign(__assign({
43
44
  // TODO: remove after upgrade to mui v5
44
45
  role: 'presentation' }, TransitionPropsProp), { onExited: onExited });
45
- return (React.createElement(MuiDialog, __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),
46
- React.createElement(RcDialogContext.Provider, { value: contextValue }, children)));
46
+ return (React.createElement(HasPortalParentProvider, null,
47
+ React.createElement(MuiDialog, __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),
48
+ React.createElement(RcDialogContext.Provider, { value: contextValue }, children))));
47
49
  });
48
50
  var RcDialog = styled(_RcDialog)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DialogStyle);
49
51
  RcDialog.defaultProps = {};
@@ -4,9 +4,11 @@ import MuiDrawer from '@material-ui/core/Drawer';
4
4
  import { combineClasses, combineProps, styled, useRcPortalWindowContext, useThemeProps, } from '../../foundation';
5
5
  import { DrawerStyle } from './styles';
6
6
  import { RcDrawerClasses } from './utils';
7
+ import { usePortalManagerWithID, useUnmountPortalHandler } from '../PortalHost';
8
+ import { HasPortalParentProvider } from '../PortalHost/context/HasPortalParentContext';
7
9
  var _RcDrawer = forwardRef(function (inProps, ref) {
8
10
  var props = useThemeProps({ props: inProps, name: 'RcDrawer' });
9
- var inlinePaper = props.inlinePaper, radius = props.radius, classesProp = props.classes, children = props.children, PaperPropsProp = props.PaperProps, onClose = props.onClose, rest = __rest(props, ["inlinePaper", "radius", "classes", "children", "PaperProps", "onClose"]);
11
+ var inlinePaper = props.inlinePaper, radius = props.radius, classesProp = props.classes, children = props.children, PaperPropsProp = props.PaperProps, onClose = props.onClose, SlidePropsProp = props.SlideProps, rest = __rest(props, ["inlinePaper", "radius", "classes", "children", "PaperProps", "onClose", "SlideProps"]);
10
12
  var externalWindow = useRcPortalWindowContext().externalWindow;
11
13
  var PaperProps = useMemo(function () {
12
14
  var _a;
@@ -23,7 +25,11 @@ var _RcDrawer = forwardRef(function (inProps, ref) {
23
25
  _a), PaperPropsProp);
24
26
  }, [PaperPropsProp, inlinePaper, onClose]);
25
27
  var classes = useMemo(function () { return combineClasses(RcDrawerClasses, classesProp); }, [classesProp]);
26
- return (React.createElement(MuiDrawer, __assign({}, rest, { ref: ref, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, classes: classes, onClose: onClose, PaperProps: PaperProps }), children));
28
+ var onExited = useUnmountPortalHandler(SlidePropsProp === null || SlidePropsProp === void 0 ? void 0 : SlidePropsProp.onExited);
29
+ var managerWithID = usePortalManagerWithID();
30
+ var SlideProps = __assign(__assign(__assign({}, SlidePropsProp), { onExited: onExited }), (managerWithID ? { appear: true } : {}));
31
+ return (React.createElement(HasPortalParentProvider, null,
32
+ React.createElement(MuiDrawer, __assign({}, rest, { ref: ref, container: externalWindow === null || externalWindow === void 0 ? void 0 : externalWindow.document.body, classes: classes, onClose: onClose, PaperProps: PaperProps, SlideProps: SlideProps }), children)));
27
33
  });
28
34
  var RcDrawer = styled(_RcDrawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), DrawerStyle);
29
35
  RcDrawer.defaultProps = {
@@ -2,11 +2,12 @@ import { __assign, __makeTemplateObject, __read, __rest } from "tslib";
2
2
  import React, { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
3
3
  import MuiTextField from '@material-ui/core/TextField';
4
4
  import { DeleteCircle } from '@ringcentral/juno-icon';
5
- import { clearReactReferencesInNode, combineClasses, combineProps, styled, useDeprecatedCheck, useEventCallback, useForkRef, useThemeProps, } from '../../../foundation';
5
+ import { clearReactReferencesInNode, combineClasses, combineProps, styled, useControlled, useDeprecatedCheck, useEventCallback, useForkRef, useThemeProps, } from '../../../foundation';
6
6
  import { useRcFormContext } from '../Form/Form/FormContext';
7
7
  import { ClearIconButton, TextFieldStyle } from './styles';
8
8
  import { RcOutlineTextFieldIconSizes, RcOutlineTextFieldInputClasses, RcTextFieldClasses, RcTextFieldFormHelperTextClasses, RcTextFieldInputClasses, RcTextFieldInputLabelClasses, } from './utils';
9
9
  var combineOutlineClasses = combineClasses(RcTextFieldInputClasses, RcOutlineTextFieldInputClasses);
10
+ var displayName = 'RcTextField';
10
11
  var _RcTextField = forwardRef(function (inProps, ref) {
11
12
  var props = useThemeProps({ props: inProps, name: 'RcTextField' });
12
13
  if (process.env.NODE_ENV !== 'production') {
@@ -38,7 +39,9 @@ var _RcTextField = forwardRef(function (inProps, ref) {
38
39
  // TODO: remove when remove focusOnMount
39
40
  _a = props.autoFocus,
40
41
  // TODO: remove when remove focusOnMount
41
- autoFocusProp = _a === void 0 ? focusOnMount : _a, InputPropsProp = props.InputProps, error = props.error, helperText = props.helperText, defaultValue = props.defaultValue, inputRefProp = props.inputRef, _b = props.autoSelect, autoSelect = _b === void 0 ? selectOnMount : _b, autoFocusDelay = props.autoFocusDelay, clearLabel = props.clearLabel, clearButtonProps = props.clearButtonProps, clearBtn = props.clearBtn, validate = props.validate, onChange = props.onChange, onBlur = props.onBlur, onFocus = props.onFocus, onClear = props.onClear, id = props.id,
42
+ autoFocusProp = _a === void 0 ? focusOnMount : _a, InputPropsProp = props.InputProps, error = props.error, helperText = props.helperText,
43
+ // no need assign to MuiTextField
44
+ defaultValue = props.defaultValue, inputRefProp = props.inputRef, _b = props.autoSelect, autoSelect = _b === void 0 ? selectOnMount : _b, autoFocusDelay = props.autoFocusDelay, clearLabel = props.clearLabel, clearButtonProps = props.clearButtonProps, clearBtn = props.clearBtn, validate = props.validate, onChange = props.onChange, onBlur = props.onBlur, onFocus = props.onFocus, onClear = props.onClear, id = props.id,
42
45
  // #region outline pick props
43
46
  variant = props.variant, radius = props.radius, size = props.size, align = props.align, textVariant = props.textVariant, gutterBottom = props.gutterBottom, color = props.color,
44
47
  // #endregion
@@ -161,10 +164,22 @@ var _RcTextField = forwardRef(function (inProps, ref) {
161
164
  };
162
165
  // eslint-disable-next-line react-hooks/exhaustive-deps
163
166
  }, []);
164
- return (React.createElement(MuiTextField, __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 })));
167
+ return (React.createElement(MuiTextField, __assign({}, rest, events, { id: id, value: valueProp, onChange: onChange, error: validate ? !!validateMessage : error, helperText: validateMessage || helperText, classes: classes, FormHelperTextProps: FormHelperTextProps, InputLabelProps: InputLabelProps, InputProps: InputProps, inputRef: inputRef, ref: ref })));
165
168
  });
166
169
  /** @release */
167
- var RcTextField = styled(_RcTextField)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TextFieldStyle);
170
+ var RcTextField = styled(_RcTextField).attrs(function (_a) {
171
+ var _b = _a.defaultValue, defaultValue = _b === void 0 ? '' : _b, valueProp = _a.value, onChangeProp = _a.onChange, rest = __rest(_a, ["defaultValue", "value", "onChange"]);
172
+ var _c = __read(useControlled({
173
+ default: defaultValue,
174
+ controlled: valueProp,
175
+ name: displayName,
176
+ }), 2), value = _c[0], setValue = _c[1];
177
+ var onChange = function (event) {
178
+ onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(event);
179
+ setValue(event.target.value);
180
+ };
181
+ return __assign(__assign({}, rest), { value: value, onChange: onChange });
182
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), TextFieldStyle);
168
183
  RcTextField.defaultProps = {
169
184
  clearBtn: true,
170
185
  variant: 'standard',
@@ -172,6 +187,6 @@ RcTextField.defaultProps = {
172
187
  size: 'medium',
173
188
  textVariant: 'subheading1',
174
189
  };
175
- RcTextField.displayName = 'RcTextField';
190
+ RcTextField.displayName = displayName;
176
191
  export { RcOutlineTextFieldIconSizes, RcTextField };
177
192
  var templateObject_1;
@@ -0,0 +1,6 @@
1
+ import React, { createContext } from 'react';
2
+ export var HasPortalParentContext = createContext(false);
3
+ export var HasPortalParentProvider = function (_a) {
4
+ var children = _a.children;
5
+ return (React.createElement(HasPortalParentContext.Provider, { value: true }, children));
6
+ };
@@ -1,10 +1,11 @@
1
1
  import { useContext } from 'react';
2
2
  import { PortalIDContext, PortalManagerContext } from '../context';
3
+ import { HasPortalParentContext } from '../context/HasPortalParentContext';
3
4
  export var usePortalManagerWithID = function () {
4
5
  var manager = useContext(PortalManagerContext);
5
6
  var id = useContext(PortalIDContext);
6
- if (manager && id !== undefined) {
7
- return { manager: manager, id: id };
8
- }
9
- return undefined;
7
+ var hasPortalParent = useContext(HasPortalParentContext);
8
+ if (hasPortalParent || !manager || id === undefined)
9
+ return undefined;
10
+ return { manager: manager, id: id };
10
11
  };
@@ -7,13 +7,15 @@ import { useUnmountPortalHandler } from '../PortalHost';
7
7
  import { RcSnackbarContent } from './SnackbarContent';
8
8
  import { SnackbarStyle } from './styles';
9
9
  import { RcSnackbarClasses } from './utils';
10
+ import { HasPortalParentProvider } from '../PortalHost/context/HasPortalParentContext';
10
11
  var _RcSnackbar = forwardRef(function (inProps, ref) {
11
12
  var props = useThemeProps({ props: inProps, name: 'RcSnackbar' });
12
13
  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
14
  var classes = useMemo(function () { return combineClasses(RcSnackbarClasses, classesProp); }, [classesProp]);
14
15
  var onExited = useUnmountPortalHandler(TransitionPropsProp === null || TransitionPropsProp === void 0 ? void 0 : TransitionPropsProp.onExited);
15
16
  var TransitionProps = __assign(__assign({}, TransitionPropsProp), { onExited: onExited });
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
+ return (React.createElement(HasPortalParentProvider, null,
18
+ 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
19
  });
18
20
  var RcSnackbar = styled(_RcSnackbar)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), SnackbarStyle);
19
21
  RcSnackbar.defaultProps = {
@@ -78,18 +78,14 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
78
78
  tabRefsMapRef.current = tabRefs_1;
79
79
  tabsTabChildRef.current = tabsTabDefaultChild_1;
80
80
  }
81
- // get real render size when render
82
- useEffect(function () {
83
- if (childrenProp === prevChildrenProp) {
84
- return;
85
- }
81
+ var updateAllTabsSize = function () {
86
82
  var tabRefsMap = tabRefsMapRef.current;
83
+ var allTabsSize = __assign({}, DEFAULT_SIZE);
87
84
  if (tabRefsMap && tabRefsMap.size !== 0) {
88
- var allTabsSize_1 = __assign({}, DEFAULT_SIZE);
89
85
  tabRefsMap.forEach(function (value, key) {
90
86
  var _a = getDomBoundingClientSize(value.ref.current), width = _a.width, height = _a.height;
91
- allTabsSize_1.width += width;
92
- allTabsSize_1.height += height;
87
+ allTabsSize.width += width;
88
+ allTabsSize.height += height;
93
89
  var newRef = {
94
90
  ref: value.ref,
95
91
  size: { width: width, height: height },
@@ -98,8 +94,16 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
98
94
  };
99
95
  tabRefsMap.set(key, newRef);
100
96
  });
101
- allTabsSizeRef.current = allTabsSize_1;
97
+ allTabsSizeRef.current = allTabsSize;
98
+ }
99
+ return allTabsSize;
100
+ };
101
+ // get real render size when render
102
+ useEffect(function () {
103
+ if (childrenProp === prevChildrenProp) {
104
+ return;
102
105
  }
106
+ updateAllTabsSize();
103
107
  var moreElm = moreTabRef === null || moreTabRef === void 0 ? void 0 : moreTabRef.current;
104
108
  if (moreElm) {
105
109
  var size = getDomBoundingClientSize(moreElm);
@@ -130,12 +134,12 @@ var _MoreMenuTabs = forwardRef(function (props, ref) {
130
134
  }
131
135
  };
132
136
  var computeWhetherToUseMoreMode = function (tabsSize, allTabsSize) {
133
- if (allTabsSize.width === 0 ||
134
- allTabsSize.height === 0 ||
135
- tabsSize.width === 0 ||
136
- tabsSize.height === 0) {
137
+ if (tabsSize.width === 0 || tabsSize.height === 0) {
137
138
  return false;
138
139
  }
140
+ if (allTabsSize.width === 0 || allTabsSize.height === 0) {
141
+ allTabsSize = updateAllTabsSize();
142
+ }
139
143
  if (!isVertical) {
140
144
  return allTabsSize.width > tabsSize.width;
141
145
  }
@@ -1,8 +1,9 @@
1
1
  import { __assign, __makeTemplateObject, __rest } from "tslib";
2
- import React, { forwardRef, useEffect, useMemo, useRef } from 'react';
2
+ import React, { forwardRef, useMemo, useRef } from 'react';
3
3
  import clsx from 'clsx';
4
- import { combineClasses, combineProps, styled, useEventCallback, useForceUpdate, useForkRef, useRcPortalWindowContext, useSleep, useThemeProps, } from '../../foundation';
4
+ import { combineClasses, combineProps, styled, useEventCallback, useForkRef, useRcPortalWindowContext, useThemeProps, } from '../../foundation';
5
5
  import { RcPopover } from '../Popover';
6
+ import { RcFade } from '../Transitions';
6
7
  import { VirtualizedMenuStyle } from './styles';
7
8
  import { RcVirtualizedMenuClasses } from './utils';
8
9
  import { RcVirtualizedMenuList, } from './VirtualizedMenuList';
@@ -48,18 +49,9 @@ var _RcVirtualizedMenu = forwardRef(function (inProps, ref) {
48
49
  }
49
50
  }
50
51
  });
51
- var forceUpdate = useForceUpdate();
52
- var sleep = useSleep().sleep;
53
- // TODO: fix that when that work
54
- useEffect(function () {
55
- if (open) {
56
- sleep(200).then(function () {
57
- forceUpdate();
58
- });
59
- }
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
- }, [open]);
62
- return (React.createElement(RcPopover, __assign({ ref: handleRef, container: document.body, classes: PopoverClasses, onClose: onClose, open: open, transitionDuration: transitionDuration, PaperProps: PaperProps, TransitionProps: TransitionProps }, rest),
52
+ return (React.createElement(RcPopover, __assign({ ref: handleRef, container: document.body, classes: PopoverClasses, onClose: onClose, open: open,
53
+ // FIXME: workaround for virtualized menu height incorrect issue
54
+ TransitionComponent: RcFade, transitionDuration: transitionDuration, PaperProps: PaperProps, TransitionProps: TransitionProps }, rest),
63
55
  React.createElement(RcVirtualizedMenuList, __assign({ position: "unset", action: menuListActionRef, autoFocus: autoFocus, autoFocusItem: autoFocusItem, maxHeight: maxHeight, variant: variant, onKeyDown: handleListKeyDown }, MenuListProps, { className: clsx(classes.list, MenuListProps.className) }), children)));
64
56
  });
65
57
  var RcVirtualizedMenu = styled(_RcVirtualizedMenu)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), VirtualizedMenuStyle);
@@ -2,7 +2,7 @@ var _a;
2
2
  import { __assign, __read, __rest } from "tslib";
3
3
  /* eslint-disable no-console */
4
4
  import * as React from 'react';
5
- import { createElement } from 'react';
5
+ import { createElement, } from 'react';
6
6
  import { systemToComponent } from '@virtuoso.dev/react-urx';
7
7
  import { compose, connect, distinctUntilChanged, getValue, map, noop, pipe, publish, statefulStream, statefulStreamFromEmitter, stream, subscribe, system, tup, withLatestFrom, } from '@virtuoso.dev/urx';
8
8
  import useChangedListContentsSizes from './hooks/useChangedChildSizes';
@@ -11,6 +11,7 @@ import useScrollTop from './hooks/useScrollTop';
11
11
  import useSize from './hooks/useSize';
12
12
  import useWindowViewportRectRef from './hooks/useWindowViewportRect';
13
13
  import { listSystem } from './listSystem';
14
+ import conditionalFlushSync from './utils/conditionalFlushSync';
14
15
  import { correctItemSize } from './utils/correctItemSize';
15
16
  import { positionStickyCssValue } from './utils/positionStickyCssValue';
16
17
  export function identity(value) {
@@ -122,10 +123,19 @@ var GROUP_STYLE = {
122
123
  zIndex: 1,
123
124
  overflowAnchor: 'none',
124
125
  };
126
+ var ITEM_STYLE = { overflowAnchor: 'none' };
125
127
  export var Items = React.memo(function VirtuosoItems(_a) {
126
128
  var _b = _a.showTopList, showTopList = _b === void 0 ? false : _b;
127
129
  var listState = useEmitterValue('listState');
128
- var deviation = useEmitterValue('deviation');
130
+ var _c = __read(React.useState(0), 2), deviation = _c[0], setDeviation = _c[1];
131
+ var react18ConcurrentRendering = useEmitterValue('react18ConcurrentRendering');
132
+ useEmitter('deviation', function (value) {
133
+ if (deviation !== value) {
134
+ conditionalFlushSync(react18ConcurrentRendering)(function () {
135
+ return setDeviation(value);
136
+ });
137
+ }
138
+ });
129
139
  var sizeRanges = usePublisher('sizeRanges');
130
140
  var useWindowScroll = useEmitterValue('useWindowScroll');
131
141
  var customScrollParent = useEmitterValue('customScrollParent');
@@ -174,7 +184,7 @@ export var Items = React.memo(function VirtuosoItems(_a) {
174
184
  if (item.type === 'group') {
175
185
  return createElement(GroupComponent, __assign(__assign({}, contextPropIfNotDomElement(GroupComponent, context)), { key: key, 'data-index': index, 'data-known-size': item.size, 'data-item-index': item.index, style: GROUP_STYLE }), groupContent(item.index));
176
186
  }
177
- return createElement(ItemComponent, __assign(__assign({}, contextPropIfNotDomElement(ItemComponent, context)), { key: key, 'data-index': index, 'data-known-size': item.size, 'data-item-index': item.index, 'data-item-group-index': item.groupIndex, style: { overflowAnchor: 'none' } }), hasGroups
187
+ return createElement(ItemComponent, __assign(__assign({}, contextPropIfNotDomElement(ItemComponent, context)), { key: key, 'data-index': index, 'data-known-size': item.size, 'data-item-index': item.index, 'data-item-group-index': item.groupIndex, style: ITEM_STYLE }), hasGroups
178
188
  ? itemContent(item.index, item.groupIndex, item.data, context)
179
189
  : itemContent(item.index, item.data, context));
180
190
  }));
@@ -330,6 +340,7 @@ export var List = (_a = systemToComponent(combinedSystem, {
330
340
  customScrollParent: 'customScrollParent',
331
341
  scrollerRef: 'scrollerRef',
332
342
  logLevel: 'logLevel',
343
+ react18ConcurrentRendering: 'react18ConcurrentRendering',
333
344
  // deprecated
334
345
  item: 'item',
335
346
  group: 'group',
@@ -9,6 +9,7 @@ import useSize from './hooks/useSize';
9
9
  import useWindowViewportRectRef from './hooks/useWindowViewportRect';
10
10
  import { buildScroller, buildWindowScroller, contextPropIfNotDomElement, identity, viewportStyle, } from './List';
11
11
  import { listSystem } from './listSystem';
12
+ import conditionalFlushSync from './utils/conditionalFlushSync';
12
13
  import { correctItemSize } from './utils/correctItemSize';
13
14
  var tableComponentPropsSystem = system(function () {
14
15
  var itemContent = statefulStream(function (index) { return React.createElement("td", null,
@@ -37,6 +38,7 @@ var tableComponentPropsSystem = system(function () {
37
38
  ScrollerComponent: distinctProp('Scroller', 'div'),
38
39
  EmptyPlaceholder: distinctProp('EmptyPlaceholder'),
39
40
  ScrollSeekPlaceholder: distinctProp('ScrollSeekPlaceholder'),
41
+ FillerRow: distinctProp('FillerRow'),
40
42
  };
41
43
  });
42
44
  var combinedSystem = system(function (_a) {
@@ -48,14 +50,22 @@ var DefaultScrollSeekPlaceholder = function (_a) {
48
50
  return (React.createElement("tr", null,
49
51
  React.createElement("td", { style: { height: height } })));
50
52
  };
51
- var FillerRow = function (_a) {
53
+ var DefaultFillerRow = function (_a) {
52
54
  var height = _a.height;
53
55
  return (React.createElement("tr", null,
54
56
  React.createElement("td", { style: { height: height, padding: 0, border: 0 } })));
55
57
  };
56
58
  export var Items = React.memo(function VirtuosoItems() {
57
59
  var listState = useEmitterValue('listState');
58
- var deviation = useEmitterValue('deviation');
60
+ var _a = __read(React.useState(0), 2), deviation = _a[0], setDeviation = _a[1];
61
+ var react18ConcurrentRendering = useEmitterValue('react18ConcurrentRendering');
62
+ useEmitter('deviation', function (value) {
63
+ if (deviation !== value) {
64
+ conditionalFlushSync(react18ConcurrentRendering)(function () {
65
+ return setDeviation(value);
66
+ });
67
+ }
68
+ });
59
69
  var sizeRanges = usePublisher('sizeRanges');
60
70
  var useWindowScroll = useEmitterValue('useWindowScroll');
61
71
  var customScrollParent = useEmitterValue('customScrollParent');
@@ -71,6 +81,7 @@ export var Items = React.memo(function VirtuosoItems() {
71
81
  var ref = useChangedListContentsSizes(sizeRanges, itemSize, trackItemSizes, scrollContainerStateCallback, log, customScrollParent);
72
82
  var EmptyPlaceholder = useEmitterValue('EmptyPlaceholder');
73
83
  var ScrollSeekPlaceholder = useEmitterValue('ScrollSeekPlaceholder') || DefaultScrollSeekPlaceholder;
84
+ var FillerRow = useEmitterValue('FillerRow') || DefaultFillerRow;
74
85
  var TableBodyComponent = useEmitterValue('TableBodyComponent');
75
86
  var TableRowComponent = useEmitterValue('TableRowComponent');
76
87
  var computeItemKey = useEmitterValue('computeItemKey');
@@ -155,6 +166,7 @@ export var Table = (_a = systemToComponent(combinedSystem, {
155
166
  customScrollParent: 'customScrollParent',
156
167
  scrollerRef: 'scrollerRef',
157
168
  logLevel: 'logLevel',
169
+ react18ConcurrentRendering: 'react18ConcurrentRendering',
158
170
  },
159
171
  methods: {
160
172
  scrollToIndex: 'scrollToIndex',
@@ -1,4 +1,3 @@
1
- import { __read } from "tslib";
2
1
  import * as u from '@virtuoso.dev/urx';
3
2
  export var domIOSystem = u.system(function () {
4
3
  var scrollContainerState = u.stream();
@@ -13,12 +12,13 @@ export var domIOSystem = u.system(function () {
13
12
  var scrollTo = u.stream();
14
13
  var scrollBy = u.stream();
15
14
  var scrollingInProgress = u.statefulStream(false);
15
+ var react18ConcurrentRendering = u.statefulStream(false);
16
16
  u.connect(u.pipe(scrollContainerState, u.map(function (_a) {
17
- var _b = __read(_a, 1), scrollTop = _b[0];
17
+ var scrollTop = _a.scrollTop;
18
18
  return scrollTop;
19
19
  })), scrollTop);
20
20
  u.connect(u.pipe(scrollContainerState, u.map(function (_a) {
21
- var _b = __read(_a, 2), scrollHeight = _b[1];
21
+ var scrollHeight = _a.scrollHeight;
22
22
  return scrollHeight;
23
23
  })), scrollHeight);
24
24
  u.connect(scrollTop, statefulScrollTop);
@@ -31,6 +31,7 @@ export var domIOSystem = u.system(function () {
31
31
  footerHeight: footerHeight,
32
32
  scrollHeight: scrollHeight,
33
33
  smoothScrollTargetReached: smoothScrollTargetReached,
34
+ react18ConcurrentRendering: react18ConcurrentRendering,
34
35
  // signals
35
36
  scrollTo: scrollTo,
36
37
  scrollBy: scrollBy,
@@ -1,4 +1,5 @@
1
1
  import { __read } from "tslib";
2
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
2
3
  import * as u from '@virtuoso.dev/urx';
3
4
  import { domIOSystem } from './domIOSystem';
4
5
  import { initialTopMostItemIndexSystem } from './initialTopMostItemIndexSystem';
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-continue */
2
1
  import { useRcPortalWindowContext } from '../../../../foundation';
3
2
  import { LogLevel } from '../loggerSystem';
4
3
  import useSize from './useSize';
@@ -17,15 +16,11 @@ export default function useChangedListContentsSizes(callback, itemSize, enabled,
17
16
  ? externalWindow.pageYOffset ||
18
17
  externalWindow.document.documentElement.scrollTop
19
18
  : scrollableElement.scrollTop;
20
- customScrollParent
21
- ? scrollContainerStateCallback([
22
- Math.max(scrollTop, 0),
23
- customScrollParent.scrollHeight,
24
- ])
25
- : scrollContainerStateCallback([
26
- Math.max(scrollTop, 0),
27
- scrollableElement.scrollHeight,
28
- ]);
19
+ scrollContainerStateCallback({
20
+ scrollTop: Math.max(scrollTop, 0),
21
+ scrollHeight: (customScrollParent !== null && customScrollParent !== void 0 ? customScrollParent : scrollableElement).scrollHeight,
22
+ viewportHeight: (customScrollParent !== null && customScrollParent !== void 0 ? customScrollParent : scrollableElement).offsetHeight,
23
+ });
29
24
  if (ranges !== null) {
30
25
  callback(ranges);
31
26
  }