@true-engineering/true-react-common-ui-kit 3.25.1 → 3.26.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 (93) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +11 -0
  3. package/dist/components/Button/Button.d.ts +2 -2
  4. package/dist/components/WithPopup/WithPopup.d.ts +13 -14
  5. package/dist/components/WithPopup/WithPopup.styles.d.ts +1 -1
  6. package/dist/components/WithPopup/types.d.ts +11 -0
  7. package/dist/true-react-common-ui-kit.js +156 -105
  8. package/dist/true-react-common-ui-kit.js.map +1 -1
  9. package/dist/true-react-common-ui-kit.umd.cjs +154 -103
  10. package/dist/true-react-common-ui-kit.umd.cjs.map +1 -1
  11. package/dist/types.d.ts +20 -0
  12. package/package.json +1 -1
  13. package/src/components/AccountInfo/AccountInfo.stories.tsx +32 -32
  14. package/src/components/AccountInfo/AccountInfo.tsx +80 -80
  15. package/src/components/AddButton/AddButton.stories.tsx +21 -21
  16. package/src/components/AddButton/AddButton.tsx +52 -52
  17. package/src/components/Button/Button.tsx +129 -129
  18. package/src/components/Colors/Colors.stories.tsx +7 -7
  19. package/src/components/DateInput/DateInput.tsx +90 -90
  20. package/src/components/DateInput/constants.ts +2 -2
  21. package/src/components/Description/Description.stories.tsx +27 -27
  22. package/src/components/Description/Description.tsx +61 -61
  23. package/src/components/FiltersPane/components/FilterValueView/FilterValueView.tsx +166 -166
  24. package/src/components/FiltersPane/components/FilterWithDates/FilterWithDates.tsx +210 -210
  25. package/src/components/FiltersPane/components/FilterWithPeriod/FilterWithPeriod.tsx +177 -177
  26. package/src/components/Flag/Flag.stories.tsx +29 -29
  27. package/src/components/Flag/Flag.tsx +26 -26
  28. package/src/components/Flag/augment.d.ts +1 -1
  29. package/src/components/FlexibleTable/components/FlexibleTableCell/FlexibleTableCell.styles.ts +38 -38
  30. package/src/components/FlexibleTable/components/FlexibleTableRow/FlexibleTableRow.styles.ts +25 -25
  31. package/src/components/FlexibleTable/helpers.ts +13 -13
  32. package/src/components/Icon/Icon.stories.tsx +86 -86
  33. package/src/components/Icon/complexIcons/augment.d.ts +1 -1
  34. package/src/components/Icon/complexIcons/avatarGreen.svg +57 -57
  35. package/src/components/Icon/complexIcons/index.ts +1 -1
  36. package/src/components/IncrementInput/IncrementInput.tsx +105 -105
  37. package/src/components/Input/Input.tsx +297 -297
  38. package/src/components/Input/types.ts +32 -32
  39. package/src/components/List/List.stories.tsx +70 -70
  40. package/src/components/List/List.tsx +33 -33
  41. package/src/components/List/components/ListItem/ListItem.tsx +57 -57
  42. package/src/components/Modal/Modal.stories.tsx +105 -105
  43. package/src/components/MultiSelect/MultiSelect.stories.tsx +46 -46
  44. package/src/components/MultiSelect/MultiSelect.tsx +106 -106
  45. package/src/components/MultiSelect/components/MultiSelectInput/MultiSelectInput.tsx +53 -53
  46. package/src/components/NewMoreMenu/NewMoreMenu.tsx +8 -9
  47. package/src/components/Notification/Notification.stories.tsx +46 -46
  48. package/src/components/Notification/Notification.tsx +69 -69
  49. package/src/components/NumberInput/NumberInput.tsx +137 -137
  50. package/src/components/NumberInput/index.ts +1 -1
  51. package/src/components/PhoneInput/PhoneInput.tsx +214 -214
  52. package/src/components/PhoneInput/components/PhoneInputCountryList/PhoneInputCountryList.tsx +155 -155
  53. package/src/components/PhoneInput/types.ts +16 -16
  54. package/src/components/RadioButton/RadioButton.stories.tsx +46 -46
  55. package/src/components/RadioButton/RadioButton.tsx +57 -57
  56. package/src/components/ScrollIntoViewIfNeeded/index.ts +1 -1
  57. package/src/components/Select/Select.stories.tsx +235 -235
  58. package/src/components/Select/constants.ts +2 -2
  59. package/src/components/Select/types.ts +1 -1
  60. package/src/components/Selector/Selector.stories.tsx +62 -62
  61. package/src/components/Selector/Selector.tsx +115 -115
  62. package/src/components/Selector/index.ts +2 -2
  63. package/src/components/Selector/types.ts +12 -12
  64. package/src/components/Skeleton/Skeleton.stories.tsx +19 -19
  65. package/src/components/SmartInput/SmartInput.tsx +134 -134
  66. package/src/components/Status/Status.stories.tsx +73 -73
  67. package/src/components/Status/Status.styles.ts +143 -143
  68. package/src/components/Status/Status.tsx +49 -49
  69. package/src/components/Status/constants.ts +11 -11
  70. package/src/components/Status/index.ts +3 -3
  71. package/src/components/Status/types.ts +5 -5
  72. package/src/components/Switch/Switch.stories.tsx +40 -40
  73. package/src/components/Switch/Switch.tsx +75 -75
  74. package/src/components/TextWithInfo/TextWithInfo.stories.tsx +53 -53
  75. package/src/components/TextWithInfo/TextWithInfo.tsx +62 -62
  76. package/src/components/TextWithTooltip/TextWithTooltip.stories.tsx +58 -58
  77. package/src/components/ThemedPreloader/ThemedPreloader.stories.tsx +41 -41
  78. package/src/components/ThemedPreloader/ThemedPreloader.tsx +54 -54
  79. package/src/components/ThemedPreloader/components/DefaultPreloader/index.ts +1 -1
  80. package/src/components/Toaster/Toaster.stories.tsx +30 -30
  81. package/src/components/Tooltip/Tooltip.stories.tsx +19 -19
  82. package/src/components/Tooltip/Tooltip.tsx +35 -35
  83. package/src/components/Tooltip/types.ts +1 -1
  84. package/src/components/WithPopup/WithPopup.stories.tsx +36 -15
  85. package/src/components/WithPopup/WithPopup.styles.ts +6 -8
  86. package/src/components/WithPopup/WithPopup.tsx +64 -35
  87. package/src/components/WithPopup/types.ts +14 -0
  88. package/src/helpers/popper-helpers.ts +17 -17
  89. package/src/hooks/use-dropdown.ts +84 -84
  90. package/src/hooks/use-is-mounted.ts +15 -15
  91. package/src/theme/helpers.ts +76 -76
  92. package/src/types.ts +28 -0
  93. package/src/vite-env.d.ts +1 -1
@@ -1,6 +1,6 @@
1
1
  import React, { createContext, useRef, useEffect, useCallback, useState, useMemo, useContext, createElement, Fragment as Fragment$1, forwardRef, createRef, PureComponent, memo } from "react";
2
2
  import { createUseStyles } from "react-jss";
3
- import { mergeStyles, isNotEmpty, isArrayNotEmpty, isEmpty, isString, isStringNotEmpty, mergeRefs, addDataTestId, isReactNodeNotEmpty, addClickHandler, getTestId, getSelectKeyHandler, getArray, createFilter, isFunction as isFunction$1, isObject as isObject$1, getTransition, applyAction, indexMap, isNumberInteger, hasDuplicates } from "@true-engineering/true-react-platform-helpers";
3
+ import { mergeStyles, isNotEmpty, isArrayNotEmpty, isEmpty, isString, isStringNotEmpty, mergeRefs, addDataTestId, isReactNodeNotEmpty, addClickHandler, getTestId, getSelectKeyHandler, getArray, createFilter, isFunction as isFunction$1, applyAction, isObject as isObject$1, getTransition, indexMap, isNumberInteger, hasDuplicates, isArrayEmpty } from "@true-engineering/true-react-platform-helpers";
4
4
  import { CSSTransition } from "react-transition-group";
5
5
  import clsx from "clsx";
6
6
  import hexToRgba from "hex-to-rgba";
@@ -11,7 +11,7 @@ import { debounce as debounce$1 } from "ts-debounce";
11
11
  import scrollIntoViewIfNeeded from "scroll-into-view-if-needed";
12
12
  import ReactDatePicker from "react-datepicker";
13
13
  import { filesize } from "filesize";
14
- import { useFloating, offset as offset$2, flip as flip$2, autoUpdate, useHover, useClick, useDismiss, useInteractions, useTransitionStatus, FloatingPortal } from "@floating-ui/react";
14
+ import { useFloating, offset as offset$2, flip as flip$2, autoUpdate, useHover, safePolygon, useFocus, useClick, useDismiss, useInteractions, useTransitionStatus, FloatingPortal } from "@floating-ui/react";
15
15
  import { hasFlag } from "country-flag-icons";
16
16
  import { RemoveScroll } from "react-remove-scroll";
17
17
  var jsxRuntime = { exports: {} };
@@ -6668,63 +6668,63 @@ var useMergedRefs = function(refs) {
6668
6668
  return mergeRefs(refs);
6669
6669
  }, refs);
6670
6670
  };
6671
- const avatarGreen = ` <svg
6672
- width="100%"
6673
- height="100%"
6674
- viewBox="0 0 32 32"
6675
- fill="none"
6676
- xmlns="http://www.w3.org/2000/svg"
6677
- >
6678
- <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />
6679
- <mask
6680
- id="mask0_0_12744"
6681
- style="mask-type: 'alpha';"
6682
- maskUnits="userSpaceOnUse"
6683
- x="0"
6684
- y="0"
6685
- width="32"
6686
- height="32"
6687
- >
6688
- <circle cx="16" cy="16" r="16" fill="white" />
6689
- </mask>
6690
- <g mask="url(#mask0_0_12744)">
6691
- <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />
6692
- <mask
6693
- id="mask1_0_12744"
6694
- style="mask-type: 'alpha';"
6695
- maskUnits="userSpaceOnUse"
6696
- x="3"
6697
- y="16"
6698
- width="26"
6699
- height="26"
6700
- >
6701
- <circle cx="16" cy="29" r="13" fill="white" />
6702
- </mask>
6703
- <g mask="url(#mask1_0_12744)">
6704
- <ellipse
6705
- cx="16"
6706
- cy="17.5"
6707
- rx="6"
6708
- ry="7.5"
6709
- fill="#505F79"
6710
- fill-opacity="0.204983"
6711
- />
6712
- </g>
6713
- </g>
6714
- <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />
6715
- <defs>
6716
- <linearGradient
6717
- id="paint0_linear_0_12744"
6718
- x1="13.347"
6719
- y1="46.279"
6720
- x2="33.5318"
6721
- y2="30.8088"
6722
- gradientUnits="userSpaceOnUse"
6723
- >
6724
- <stop stop-color="#ABD229" />
6725
- <stop offset="1" stop-color="#9CD03F" />
6726
- </linearGradient>
6727
- </defs>
6671
+ const avatarGreen = ` <svg\r
6672
+ width="100%"\r
6673
+ height="100%"\r
6674
+ viewBox="0 0 32 32"\r
6675
+ fill="none"\r
6676
+ xmlns="http://www.w3.org/2000/svg"\r
6677
+ >\r
6678
+ <circle opacity="0.5" cx="16" cy="16" r="16" fill="#DDE3ED" />\r
6679
+ <mask\r
6680
+ id="mask0_0_12744"\r
6681
+ style="mask-type: 'alpha';"\r
6682
+ maskUnits="userSpaceOnUse"\r
6683
+ x="0"\r
6684
+ y="0"\r
6685
+ width="32"\r
6686
+ height="32"\r
6687
+ >\r
6688
+ <circle cx="16" cy="16" r="16" fill="white" />\r
6689
+ </mask>\r
6690
+ <g mask="url(#mask0_0_12744)">\r
6691
+ <circle cx="16" cy="29" r="13" fill="url(#paint0_linear_0_12744)" />\r
6692
+ <mask\r
6693
+ id="mask1_0_12744"\r
6694
+ style="mask-type: 'alpha';"\r
6695
+ maskUnits="userSpaceOnUse"\r
6696
+ x="3"\r
6697
+ y="16"\r
6698
+ width="26"\r
6699
+ height="26"\r
6700
+ >\r
6701
+ <circle cx="16" cy="29" r="13" fill="white" />\r
6702
+ </mask>\r
6703
+ <g mask="url(#mask1_0_12744)">\r
6704
+ <ellipse\r
6705
+ cx="16"\r
6706
+ cy="17.5"\r
6707
+ rx="6"\r
6708
+ ry="7.5"\r
6709
+ fill="#505F79"\r
6710
+ fill-opacity="0.204983"\r
6711
+ />\r
6712
+ </g>\r
6713
+ </g>\r
6714
+ <ellipse cx="16" cy="13" rx="6" ry="7" fill="white" />\r
6715
+ <defs>\r
6716
+ <linearGradient\r
6717
+ id="paint0_linear_0_12744"\r
6718
+ x1="13.347"\r
6719
+ y1="46.279"\r
6720
+ x2="33.5318"\r
6721
+ y2="30.8088"\r
6722
+ gradientUnits="userSpaceOnUse"\r
6723
+ >\r
6724
+ <stop stop-color="#ABD229" />\r
6725
+ <stop offset="1" stop-color="#9CD03F" />\r
6726
+ </linearGradient>\r
6727
+ </defs>\r
6728
6728
  </svg>`;
6729
6729
  const fileExcel = '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" fill="none">\r\n <rect width="20" height="20" rx="4" fill="#21A366"/>\r\n <rect width="20" height="20" rx="4" fill="url(#paint0_linear_0_16081)" style="mix-blend-mode:overlay"/>\r\n <path d="M8.00342 14.5244L10.0728 11.3062L12.1357 14.5244H14.4019L11.2217 9.73828L14.1162 5.21875H11.939L10.1108 8.2085L8.24463 5.21875H6.04834L8.93018 9.66846L5.75 14.5244H8.00342Z" fill="white"/>\r\n <defs>\r\n <linearGradient id="paint0_linear_0_16081" x1="-9.95187" y1="9.95187" x2="9.95187" y2="29.8556" gradientUnits="userSpaceOnUse">\r\n <stop stop-color="white" stop-opacity="0.245559"/>\r\n <stop offset="1" stop-opacity="0.498578"/>\r\n </linearGradient>\r\n </defs>\r\n</svg>';
6730
6730
  const fileImage = '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" fill="none">\r\n <rect width="20" height="20" rx="4" fill="#FF991F"/>\r\n <rect width="20" height="20" rx="4" fill="url(#paint0_linear_0_16103)" style="mix-blend-mode:overlay"/>\r\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3.90113 15C3.09595 15 2.62093 14.097 3.07709 13.4335L6.67606 8.19861C7.07341 7.62064 7.9268 7.62065 8.32414 8.19861L13.0001 15H3.90113Z" fill="white"/>\r\n <path fill-rule="evenodd" clip-rule="evenodd" d="M9.53962 15L12.7076 10.2481C13.1034 9.65434 13.9758 9.65434 14.3717 10.2481L16.5031 13.4453C16.9462 14.1099 16.4698 15 15.6711 15H9.53962Z" fill="white"/>\r\n <path d="M16.0001 5.5C16.0001 6.32843 15.3285 7 14.5001 7C13.6717 7 13.0001 6.32843 13.0001 5.5C13.0001 4.67157 13.6717 4 14.5001 4C15.3285 4 16.0001 4.67157 16.0001 5.5Z" fill="white"/>\r\n <defs>\r\n <linearGradient id="paint0_linear_0_16103" x1="-9.95187" y1="9.95187" x2="9.95187" y2="29.8556" gradientUnits="userSpaceOnUse">\r\n <stop stop-color="white" stop-opacity="0.245559"/>\r\n <stop offset="1" stop-opacity="0.498578"/>\r\n </linearGradient>\r\n </defs>\r\n</svg>';
@@ -8865,8 +8865,57 @@ function _object_spread_props$K(target, source) {
8865
8865
  }
8866
8866
  return target;
8867
8867
  }
8868
- var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
8869
- var _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "l" : _param_size, _param_view = param.view, view = _param_view === void 0 ? "primary" : _param_view, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? false : _param_isFullWidth, _param_isInline = param.isInline, isInline = _param_isInline === void 0 ? false : _param_isInline, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_shouldSkipTabNavigation = param.shouldSkipTabNavigation, shouldSkipTabNavigation = _param_shouldSkipTabNavigation === void 0 ? false : _param_shouldSkipTabNavigation, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, icon = param.icon, _param_iconPosition = param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "left" : _param_iconPosition, _param_preloaderType = param.preloaderType, preloaderType = _param_preloaderType === void 0 ? "dots" : _param_preloaderType, onClick = param.onClick, onMouseDown = param.onMouseDown;
8868
+ function _object_without_properties$g(source, excluded) {
8869
+ if (source == null)
8870
+ return {};
8871
+ var target = _object_without_properties_loose$g(source, excluded);
8872
+ var key, i;
8873
+ if (Object.getOwnPropertySymbols) {
8874
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
8875
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
8876
+ key = sourceSymbolKeys[i];
8877
+ if (excluded.indexOf(key) >= 0)
8878
+ continue;
8879
+ if (!Object.prototype.propertyIsEnumerable.call(source, key))
8880
+ continue;
8881
+ target[key] = source[key];
8882
+ }
8883
+ }
8884
+ return target;
8885
+ }
8886
+ function _object_without_properties_loose$g(source, excluded) {
8887
+ if (source == null)
8888
+ return {};
8889
+ var target = {};
8890
+ var sourceKeys = Object.keys(source);
8891
+ var key, i;
8892
+ for (i = 0; i < sourceKeys.length; i++) {
8893
+ key = sourceKeys[i];
8894
+ if (excluded.indexOf(key) >= 0)
8895
+ continue;
8896
+ target[key] = source[key];
8897
+ }
8898
+ return target;
8899
+ }
8900
+ var Button = /* @__PURE__ */ forwardRef(function(_param, ref) {
8901
+ var _param_type = _param.type, type = _param_type === void 0 ? "button" : _param_type, children = _param.children, _param_size = _param.size, size = _param_size === void 0 ? "l" : _param_size, _param_view = _param.view, view = _param_view === void 0 ? "primary" : _param_view, _param_isFullWidth = _param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? false : _param_isFullWidth, _param_isInline = _param.isInline, isInline = _param_isInline === void 0 ? false : _param_isInline, _param_isDisabled = _param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isActive = _param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isLoading = _param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_shouldSkipTabNavigation = _param.shouldSkipTabNavigation, shouldSkipTabNavigation = _param_shouldSkipTabNavigation === void 0 ? false : _param_shouldSkipTabNavigation, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, icon = _param.icon, _param_iconPosition = _param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "left" : _param_iconPosition, _param_preloaderType = _param.preloaderType, preloaderType = _param_preloaderType === void 0 ? "dots" : _param_preloaderType, interactions = _object_without_properties$g(_param, [
8902
+ "type",
8903
+ "children",
8904
+ "size",
8905
+ "view",
8906
+ "isFullWidth",
8907
+ "isInline",
8908
+ "isDisabled",
8909
+ "isActive",
8910
+ "isLoading",
8911
+ "shouldSkipTabNavigation",
8912
+ "data",
8913
+ "testId",
8914
+ "tweakStyles",
8915
+ "icon",
8916
+ "iconPosition",
8917
+ "preloaderType"
8918
+ ]);
8870
8919
  var classes = useStyles$N({
8871
8920
  theme: tweakStyles
8872
8921
  });
@@ -8885,10 +8934,8 @@ var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
8885
8934
  type,
8886
8935
  className: clsx(classes.root, classes[size], classes[view], (_obj2 = {}, _define_property$U(_obj2, classes.disabled, isDisabled), _define_property$U(_obj2, classes.fullWidth, isFullWidth), _define_property$U(_obj2, classes.inline, isInline), _define_property$U(_obj2, classes.active, isActive), _define_property$U(_obj2, classes.loading, isLoading), _define_property$U(_obj2, classes.onlyIcon, hasIcon && !hasChildren), _obj2)),
8887
8936
  tabIndex: shouldSkipTabNavigation ? -1 : void 0,
8888
- disabled: hasNoAction,
8889
- onClick: !hasNoAction ? onClick : void 0,
8890
- onMouseDown: !hasNoAction ? onMouseDown : void 0
8891
- }, addDataTestId(testId), addDataAttributes(data)), {
8937
+ disabled: hasNoAction
8938
+ }, interactions, addDataTestId(testId), addDataAttributes(data)), {
8892
8939
  children: [
8893
8940
  /* @__PURE__ */ jsxs("span", {
8894
8941
  className: clsx(classes.content, (_obj1 = {}, _define_property$U(_obj1, classes.iconFromRight, hasChildren && hasIcon && iconPosition === "right"), _define_property$U(_obj1, classes.iconFromLeft, hasChildren && hasIcon && iconPosition === "left"), _obj1)),
@@ -18850,17 +18897,16 @@ function FilterValueView(param) {
18850
18897
  }
18851
18898
  var DEFAULT_OFFSET = 6;
18852
18899
  var useStyles$n = createThemedStyles("WithPopup", {
18853
- root: {},
18854
- disabled: {
18855
- "& > $trigger": {
18856
- cursor: "default"
18857
- }
18858
- },
18859
18900
  trigger: {
18901
+ width: "fit-content",
18860
18902
  cursor: "pointer"
18861
18903
  },
18904
+ disabled: {
18905
+ cursor: "default"
18906
+ },
18862
18907
  popup: {
18863
- zIndex: 5
18908
+ zIndex: 5,
18909
+ outline: "none"
18864
18910
  },
18865
18911
  animationEnd: {},
18866
18912
  animationStart: {},
@@ -19003,7 +19049,7 @@ function _unsupported_iterable_to_array$9(o, minLen) {
19003
19049
  return _array_like_to_array$9(o, minLen);
19004
19050
  }
19005
19051
  var WithPopup = function(param) {
19006
- var trigger = param.trigger, children = param.children, _param_middlewares = param.middlewares, middlewares = _param_middlewares === void 0 ? [] : _param_middlewares, _param_eventType = param.eventType, eventType = _param_eventType === void 0 ? "click" : _param_eventType, _param_placement = param.placement, placement = _param_placement === void 0 ? eventType === "click" ? "bottom-end" : "top" : _param_placement, _param_shouldHideOnScroll = param.shouldHideOnScroll, shouldHideOnScroll = _param_shouldHideOnScroll === void 0 ? false : _param_shouldHideOnScroll, _param_shouldRenderInBody = param.shouldRenderInBody, shouldRenderInBody = _param_shouldRenderInBody === void 0 ? false : _param_shouldRenderInBody, _param_hoverDelay = param.hoverDelay, hoverDelay = _param_hoverDelay === void 0 ? 0 : _param_hoverDelay, _param_popupOffset = param.popupOffset, popupOffset = _param_popupOffset === void 0 ? DEFAULT_OFFSET : _param_popupOffset, _param_canBeFlipped = param.canBeFlipped, canBeFlipped = _param_canBeFlipped === void 0 ? false : _param_canBeFlipped, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, tweakStyles = param.tweakStyles, data = param.data, testId = param.testId, onToggle = param.onToggle;
19052
+ var trigger = param.trigger, children = param.children, _param_middlewares = param.middlewares, middlewares = _param_middlewares === void 0 ? [] : _param_middlewares, _param_eventType = param.eventType, eventType = _param_eventType === void 0 ? "click" : _param_eventType, _param_placement = param.placement, placement = _param_placement === void 0 ? eventType === "click" ? "bottom-end" : "top" : _param_placement, _param_hoverDelay = param.hoverDelay, hoverDelay = _param_hoverDelay === void 0 ? 0 : _param_hoverDelay, _param_popupOffset = param.popupOffset, popupOffset = _param_popupOffset === void 0 ? DEFAULT_OFFSET : _param_popupOffset, _param_shouldHideOnScroll = param.shouldHideOnScroll, shouldHideOnScroll = _param_shouldHideOnScroll === void 0 ? false : _param_shouldHideOnScroll, _param_shouldRenderInBody = param.shouldRenderInBody, shouldRenderInBody = _param_shouldRenderInBody === void 0 ? true : _param_shouldRenderInBody, _param_canBeFlipped = param.canBeFlipped, canBeFlipped = _param_canBeFlipped === void 0 ? true : _param_canBeFlipped, _param_isTriggerWrapped = param.isTriggerWrapped, isTriggerWrapped = _param_isTriggerWrapped === void 0 ? eventType === "hover" : _param_isTriggerWrapped, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, tweakStyles = param.tweakStyles, data = param.data, testId = param.testId, onToggle = param.onToggle;
19007
19053
  var classes = useStyles$n({
19008
19054
  theme: tweakStyles
19009
19055
  });
@@ -19011,12 +19057,12 @@ var WithPopup = function(param) {
19011
19057
  var handleToggle = function(isActive, event) {
19012
19058
  event === null || event === void 0 ? void 0 : event.stopPropagation();
19013
19059
  if (!isDisabled) {
19014
- onToggle === null || onToggle === void 0 ? void 0 : onToggle(isActive);
19060
+ onToggle === null || onToggle === void 0 ? void 0 : onToggle(isActive, event);
19015
19061
  setIsOpen(isActive);
19016
19062
  }
19017
19063
  };
19018
- var handleClose = function() {
19019
- handleToggle(false);
19064
+ var handleClose = function(event) {
19065
+ handleToggle(false, event);
19020
19066
  };
19021
19067
  var _useFloating = useFloating({
19022
19068
  open: isOpen,
@@ -19034,41 +19080,44 @@ var WithPopup = function(param) {
19034
19080
  delay: typeof hoverDelay === "number" ? {
19035
19081
  open: hoverDelay,
19036
19082
  close: 0
19037
- } : hoverDelay
19083
+ } : hoverDelay,
19084
+ handleClose: safePolygon()
19085
+ });
19086
+ var focus = useFocus(context, {
19087
+ enabled: eventType === "hover"
19038
19088
  });
19039
19089
  var click = useClick(context, {
19040
- enabled: eventType === "click",
19041
- toggle: false
19090
+ enabled: eventType === "click"
19042
19091
  });
19043
19092
  var dismiss = useDismiss(context, {
19044
19093
  enabled: eventType === "click",
19045
19094
  ancestorScroll: shouldHideOnScroll
19046
19095
  });
19047
- var getFloatingProps = useInteractions([
19096
+ var _useInteractions = useInteractions([
19048
19097
  hover,
19049
19098
  click,
19099
+ focus,
19050
19100
  dismiss
19051
- ]).getFloatingProps;
19101
+ ]), getFloatingProps = _useInteractions.getFloatingProps, getReferenceProps = _useInteractions.getReferenceProps;
19052
19102
  var _useTransitionStatus = useTransitionStatus(context, {
19053
19103
  duration: {
19054
19104
  close: 500
19055
19105
  }
19056
19106
  }), isMounted = _useTransitionStatus.isMounted, status = _useTransitionStatus.status;
19057
- return /* @__PURE__ */ jsxs("div", _object_spread_props$n(_object_spread$o({
19058
- ref: refs.setReference,
19059
- className: clsx(classes.root, _define_property$p({}, classes.disabled, isDisabled))
19060
- }, addDataTestId(testId), addDataAttributes(data)), {
19107
+ var referenceProps = getReferenceProps({
19108
+ ref: refs.setReference
19109
+ });
19110
+ var triggerElement = applyAction(trigger, _object_spread$o({
19111
+ isActive: isOpen,
19112
+ isDisabled
19113
+ }, !isTriggerWrapped ? referenceProps : void 0));
19114
+ return /* @__PURE__ */ jsxs(Fragment, {
19061
19115
  children: [
19062
- /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$o({
19063
- className: classes.trigger,
19064
- onClick: eventType === "click" ? function(e) {
19065
- return handleToggle(!isOpen, e);
19066
- } : void 0
19067
- }, addDataTestId(testId, "trigger")), {
19068
- children: isFunction$1(trigger) ? trigger({
19069
- isActive: isOpen
19070
- }) : trigger
19071
- })),
19116
+ isTriggerWrapped ? /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$o({
19117
+ className: clsx(classes.trigger, _define_property$p({}, classes.disabled, isDisabled))
19118
+ }, referenceProps, addDataTestId(testId), addDataAttributes(data)), {
19119
+ children: triggerElement
19120
+ })) : triggerElement,
19072
19121
  isMounted && /* @__PURE__ */ jsx(FloatingPortal, {
19073
19122
  root: !shouldRenderInBody ? refs.reference.current : void 0,
19074
19123
  children: /* @__PURE__ */ jsx("div", _object_spread_props$n(_object_spread$o({
@@ -19085,7 +19134,7 @@ var WithPopup = function(param) {
19085
19134
  }))
19086
19135
  })
19087
19136
  ]
19088
- }));
19137
+ });
19089
19138
  };
19090
19139
  var isContentNotEmpty = function(value) {
19091
19140
  if (Array.isArray(value)) {
@@ -31005,7 +31054,7 @@ function _object_without_properties_loose(source, excluded) {
31005
31054
  return target;
31006
31055
  }
31007
31056
  var NewMoreMenu = function(_param) {
31008
- var items = _param.items, _param_isDisabled = _param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_hasDefaultStateBackground = _param.hasDefaultStateBackground, hasDefaultStateBackground = _param_hasDefaultStateBackground === void 0 ? true : _param_hasDefaultStateBackground, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, props = _object_without_properties(_param, [
31057
+ var items = _param.items, _param_isDisabled = _param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_hasDefaultStateBackground = _param.hasDefaultStateBackground, hasDefaultStateBackground = _param_hasDefaultStateBackground === void 0 ? true : _param_hasDefaultStateBackground, data = _param.data, testId = _param.testId, tweakStyles = _param.tweakStyles, rest = _object_without_properties(_param, [
31009
31058
  "items",
31010
31059
  "isDisabled",
31011
31060
  "hasDefaultStateBackground",
@@ -31026,18 +31075,20 @@ var NewMoreMenu = function(_param) {
31026
31075
  className: "tweakList",
31027
31076
  currentComponentName: "NewMoreMenu"
31028
31077
  });
31029
- var isButtonDisabled = isDisabled || !isArrayNotEmpty(items);
31030
31078
  return /* @__PURE__ */ jsx(WithPopup, _object_spread_props(_object_spread({
31031
- isDisabled: isButtonDisabled,
31079
+ isDisabled: isDisabled || isArrayEmpty(items),
31032
31080
  tweakStyles: tweakWithPopupStyles
31033
- }, props), {
31034
- trigger: function(param) {
31035
- var isActive = param.isActive;
31081
+ }, rest), {
31082
+ trigger: function(_param2) {
31083
+ var isActive = _param2.isActive, isTriggerDisabled = _param2.isDisabled, props = _object_without_properties(_param2, [
31084
+ "isActive",
31085
+ "isDisabled"
31086
+ ]);
31036
31087
  var _obj2;
31037
31088
  return /* @__PURE__ */ jsx("button", _object_spread_props(_object_spread({
31038
- className: clsx(classes.button, (_obj2 = {}, _define_property(_obj2, classes.hasCircle, hasDefaultStateBackground), _define_property(_obj2, classes.disabled, isButtonDisabled), _define_property(_obj2, classes.active, isActive), _obj2)),
31039
- disabled: isButtonDisabled
31040
- }, addDataTestId(testId), addDataAttributes(data)), {
31089
+ className: clsx(classes.button, (_obj2 = {}, _define_property(_obj2, classes.hasCircle, hasDefaultStateBackground), _define_property(_obj2, classes.disabled, isTriggerDisabled), _define_property(_obj2, classes.active, isActive), _obj2)),
31090
+ disabled: isTriggerDisabled
31091
+ }, addDataTestId(testId), addDataAttributes(data), props), {
31041
31092
  children: /* @__PURE__ */ jsx("div", {
31042
31093
  className: classes.icon,
31043
31094
  children: /* @__PURE__ */ jsx(Icon, {