@oliasoft-open-source/react-ui-library 5.10.0-beta-4 → 5.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.
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import { TbAlertTriangle, TbArrowDown, TbArrowLeft, TbArrowRight, TbArrowUp, TbA
5
5
  import { VscCollapseAll, VscExpandAll } from "react-icons/vsc";
6
6
  import { AiOutlineMinusSquare, AiOutlinePlusSquare } from "react-icons/ai";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
+ import { CSSTransition } from "react-transition-group";
8
9
  import ResizeObserver$1 from "resize-observer-polyfill";
9
10
  import { Arrow, mergeRefs, useHover, useLayer, useMousePositionAsTrigger } from "react-laag";
10
11
  import { cloneDeep, cloneDeepWith, debounce, every, get, isArray, isBoolean, isEmpty, isEqual, isFunction, isNil, isNumber, isObject, isPlainObject, isString, keys, noop, set, toLower, toNumber, values } from "es-toolkit/compat";
@@ -50,8 +51,8 @@ let TriggerType = /* @__PURE__ */ function(e) {
50
51
  return e.TEXT = "text", e.RADIO = "radio", e.CHECKBOX = "checkbox", e;
51
52
  }({});
52
53
  var chevron_module_default = {
53
- chevron: "_chevron_1kw4m_1",
54
- expanded: "_expanded_1kw4m_9"
54
+ chevron: "_chevron_dd6mn_1",
55
+ expanded: "_expanded_dd6mn_9"
55
56
  };
56
57
  const DisabledContext = React.createContext(!1);
57
58
  var icon_module_default = {
@@ -253,22 +254,57 @@ var accordion_module_default = {
253
254
  expanded: "_expanded_15p8j_36",
254
255
  padding: "_padding_15p8j_44",
255
256
  squareBottom: "_squareBottom_15p8j_47"
256
- };
257
- const AccordionBase = ({ heading: e, expanded: t = !1, bordered: n = !1, padding: r = !0, children: i, squareBottom: a = !1, onClick: o, testId: s }) => /* @__PURE__ */ jsxs("div", {
258
- className: cx(accordion_module_default.accordion, n ? accordion_module_default.bordered : "", t ? accordion_module_default.expanded : "", a ? accordion_module_default.squareBottom : ""),
259
- children: [/* @__PURE__ */ jsxs("div", {
260
- className: cx(accordion_module_default.accordionHeader, o ? accordion_module_default.clickable : ""),
261
- onClick: o,
262
- "data-testid": s,
263
- children: [/* @__PURE__ */ jsx(Chevron, { expanded: t }), /* @__PURE__ */ jsx("div", {
264
- className: accordion_module_default.heading,
265
- children: e
257
+ }, collapse_module_default = {
258
+ collapse: "_collapse_1m1n2_5",
259
+ enter: "_enter_1m1n2_9",
260
+ enterActive: "_enterActive_1m1n2_12",
261
+ exit: "_exit_1m1n2_15",
262
+ exitActive: "_exitActive_1m1n2_18",
263
+ collapseInner: "_collapseInner_1m1n2_21"
264
+ };
265
+ const Collapse = ({ children: e, expanded: t }) => {
266
+ let n = useRef(null);
267
+ return /* @__PURE__ */ jsx(CSSTransition, {
268
+ nodeRef: n,
269
+ in: t,
270
+ timeout: 100,
271
+ classNames: {
272
+ enter: collapse_module_default.enter,
273
+ enterActive: collapse_module_default.enterActive,
274
+ exit: collapse_module_default.exit,
275
+ exitActive: collapse_module_default.exitActive
276
+ },
277
+ unmountOnExit: !0,
278
+ children: /* @__PURE__ */ jsx("div", {
279
+ ref: n,
280
+ className: collapse_module_default.collapse,
281
+ children: /* @__PURE__ */ jsx("div", {
282
+ className: collapse_module_default.collapseInner,
283
+ children: /* @__PURE__ */ jsx("div", { children: t && e })
284
+ })
285
+ })
286
+ });
287
+ }, AccordionBase = ({ heading: e, expanded: t = !1, bordered: n = !1, padding: r = !0, children: i, squareBottom: a = !1, onClick: o, testId: s }) => {
288
+ let c = t && !!i;
289
+ return /* @__PURE__ */ jsxs("div", {
290
+ className: cx(accordion_module_default.accordion, n ? accordion_module_default.bordered : "", t ? accordion_module_default.expanded : "", a ? accordion_module_default.squareBottom : ""),
291
+ children: [/* @__PURE__ */ jsxs("div", {
292
+ className: cx(accordion_module_default.accordionHeader, o ? accordion_module_default.clickable : ""),
293
+ onClick: o,
294
+ "data-testid": s,
295
+ children: [/* @__PURE__ */ jsx(Chevron, { expanded: t }), /* @__PURE__ */ jsx("div", {
296
+ className: accordion_module_default.heading,
297
+ children: e
298
+ })]
299
+ }), /* @__PURE__ */ jsx(Collapse, {
300
+ expanded: c,
301
+ children: /* @__PURE__ */ jsx("div", {
302
+ className: cx(accordion_module_default.accordionContent, n && r ? accordion_module_default.padding : ""),
303
+ children: i
304
+ })
266
305
  })]
267
- }), t && i && /* @__PURE__ */ jsx("div", {
268
- className: cx(accordion_module_default.accordionContent, n && r ? accordion_module_default.padding : ""),
269
- children: i
270
- })]
271
- }), AccordionManaged = ({ heading: t, bordered: n, padding: r, expanded: i = !1, children: a, testId: o }) => {
306
+ });
307
+ }, AccordionManaged = ({ heading: t, bordered: n, padding: r, expanded: i = !1, children: a, testId: o }) => {
272
308
  let [s, c] = React.useState(i);
273
309
  return /* @__PURE__ */ jsx(AccordionBase, {
274
310
  heading: t,
@@ -586,35 +622,37 @@ var actions_module_default = {
586
622
  actionComponentContainer: "_actionComponentContainer_1t7vd_14",
587
623
  active: "_active_1t7vd_36"
588
624
  }, menu_module_default = {
589
- wrapper: "_wrapper_9g7i6_1",
590
- layer: "_layer_9g7i6_5",
591
- layerContainer: "_layerContainer_9g7i6_8",
592
- nested: "_nested_9g7i6_24",
593
- fileInput: "_fileInput_9g7i6_36",
594
- trigger: "_trigger_9g7i6_41",
595
- middleAlignedInline: "_middleAlignedInline_9g7i6_50",
596
- heading: "_heading_9g7i6_56",
597
- headingIcon: "_headingIcon_9g7i6_62",
598
- clickable: "_clickable_9g7i6_69",
599
- option: "_option_9g7i6_73",
600
- active: "_active_9g7i6_92",
601
- disabled: "_disabled_9g7i6_97",
602
- selected: "_selected_9g7i6_101",
603
- optionContent: "_optionContent_9g7i6_108",
604
- inline: "_inline_9g7i6_112",
605
- icon: "_icon_9g7i6_117",
606
- check: "_check_9g7i6_118",
607
- text: "_text_9g7i6_144",
608
- label: "_label_9g7i6_149",
609
- description: "_description_9g7i6_160",
610
- arrow: "_arrow_9g7i6_164",
611
- divider: "_divider_9g7i6_168",
612
- deprecatedSemanticIcon: "_deprecatedSemanticIcon_9g7i6_172",
613
- buttonLabel: "_buttonLabel_9g7i6_180",
614
- buttonCaret: "_buttonCaret_9g7i6_186",
615
- component: "_component_9g7i6_190",
616
- right: "_right_9g7i6_196",
617
- actions: "_actions_9g7i6_201"
625
+ wrapper: "_wrapper_15ymr_1",
626
+ layer: "_layer_15ymr_5",
627
+ layerContainer: "_layerContainer_15ymr_8",
628
+ enter: "_enter_15ymr_24",
629
+ enterActive: "_enterActive_15ymr_28",
630
+ nested: "_nested_15ymr_33",
631
+ fileInput: "_fileInput_15ymr_54",
632
+ trigger: "_trigger_15ymr_59",
633
+ middleAlignedInline: "_middleAlignedInline_15ymr_68",
634
+ heading: "_heading_15ymr_74",
635
+ headingIcon: "_headingIcon_15ymr_80",
636
+ clickable: "_clickable_15ymr_87",
637
+ option: "_option_15ymr_91",
638
+ active: "_active_15ymr_110",
639
+ disabled: "_disabled_15ymr_115",
640
+ selected: "_selected_15ymr_119",
641
+ optionContent: "_optionContent_15ymr_126",
642
+ inline: "_inline_15ymr_130",
643
+ icon: "_icon_15ymr_135",
644
+ check: "_check_15ymr_136",
645
+ text: "_text_15ymr_162",
646
+ label: "_label_15ymr_167",
647
+ description: "_description_15ymr_178",
648
+ arrow: "_arrow_15ymr_182",
649
+ divider: "_divider_15ymr_186",
650
+ deprecatedSemanticIcon: "_deprecatedSemanticIcon_15ymr_190",
651
+ buttonLabel: "_buttonLabel_15ymr_198",
652
+ buttonCaret: "_buttonCaret_15ymr_204",
653
+ component: "_component_15ymr_208",
654
+ right: "_right_15ymr_214",
655
+ actions: "_actions_15ymr_219"
618
656
  };
619
657
  const Heading$3 = ({ label: e, onClick: t, icon: n, testId: r }) => /* @__PURE__ */ jsxs("div", {
620
658
  onClick: (e) => e.stopPropagation(),
@@ -978,69 +1016,82 @@ var isMenuEmpty = (e) => {
978
1016
  }), y]
979
1017
  });
980
1018
  };
981
- const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badgeDot: i = !1, loading: a = !1, isNested: o = !1, closeOnOptionClick: c = !0, closeParent: l, tree: u, path: d, groupOrder: f, overflowContainer: p = !0, maxHeight: h, testId: g, open: _, setOpen: v, tooltip: y, error: b, warning: x, selected: S, tabIndex: C, active: w }) => {
982
- let T = useContext(DisabledContext), { label: E, title: D, trigger: O, fullHeightTrigger: k, colored: A, small: j, sections: M, component: N, placement: P, showAllButton: F, possiblePlacements: I = ["bottom-start", "top-start"] } = e, [L, R] = isBoolean(_) && isFunction(v) ? [_, v] : useState(!1), z = () => R(!1), B = () => R(!0), { triggerProps: V, layerProps: H, renderLayer: U } = useLayer({
983
- isOpen: L,
984
- ...placementOptions$1(P, o),
985
- possiblePlacements: I,
1019
+ const DropDownMenu = ({ menu: e, width: t, disabled: n = !1, badgeTitle: r, badgeDot: i = !1, loading: a = !1, isNested: o = !1, closeOnOptionClick: c = !0, closeParent: l, tree: u, path: d, groupOrder: f, overflowContainer: h = !0, maxHeight: g, testId: _, open: v, setOpen: y, tooltip: b, error: x, warning: S, selected: C, tabIndex: w, active: T }) => {
1020
+ let E = useContext(DisabledContext), D = useRef(null), { label: O, title: k, trigger: A, fullHeightTrigger: j, colored: M, small: N, sections: P, component: F, placement: I, showAllButton: L, possiblePlacements: R = ["bottom-start", "top-start"] } = e, [z, B] = isBoolean(v) && isFunction(y) ? [v, y] : useState(!1), V = () => B(!1), H = () => B(!0), { triggerProps: U, layerProps: W, renderLayer: G } = useLayer({
1021
+ isOpen: z,
1022
+ ...placementOptions$1(I, o),
1023
+ possiblePlacements: R,
986
1024
  ResizeObserver: ResizeObserver$1,
987
- onOutsideClick: z,
988
- overflowContainer: p,
989
- onParentClose: z
990
- }), W = n || isMenuEmpty(e) || T;
991
- return registerClose(u, d, z), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Trigger$1, {
992
- ref: V.ref,
993
- isDisabled: W,
1025
+ onOutsideClick: V,
1026
+ overflowContainer: h,
1027
+ onParentClose: V
1028
+ }), K = n || isMenuEmpty(e) || E;
1029
+ return registerClose(u, d, V), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Trigger$1, {
1030
+ ref: U.ref,
1031
+ isDisabled: K,
994
1032
  badgeTitle: r,
995
1033
  badgeDot: i,
996
1034
  loading: a,
997
1035
  width: t,
998
- fullHeight: k,
999
- trigger: O,
1000
- label: E,
1001
- title: D,
1036
+ fullHeight: j,
1037
+ trigger: A,
1038
+ label: O,
1039
+ title: k,
1002
1040
  onClickTrigger: () => {
1003
- if (!W) {
1004
- if (L) {
1005
- z();
1041
+ if (!K) {
1042
+ if (z) {
1043
+ V();
1006
1044
  return;
1007
1045
  }
1008
1046
  siblings(u, d).forEach((e) => {
1009
1047
  e.close && e.close();
1010
- }), B();
1048
+ }), H();
1011
1049
  }
1012
1050
  },
1013
- colored: A,
1014
- small: j,
1051
+ colored: M,
1052
+ small: N,
1015
1053
  isNested: o,
1016
- component: N,
1054
+ component: F,
1017
1055
  groupOrder: f,
1018
- isOpen: L,
1019
- active: w,
1020
- tooltip: y,
1021
- error: b,
1022
- warning: x,
1023
- testId: g,
1024
- selected: S,
1025
- tabIndex: C
1026
- }), L && U(/* @__PURE__ */ jsx("div", {
1027
- ...H,
1028
- className: menu_module_default.layerContainer,
1029
- "data-testid": e.testId,
1030
- onClick: (e) => e.stopPropagation(),
1031
- children: /* @__PURE__ */ jsx(Layer$2, {
1032
- sections: M,
1033
- isNested: o,
1034
- width: t,
1035
- closeOnOptionClick: c,
1036
- close: l || z,
1037
- tree: u,
1038
- path: d,
1039
- maxHeight: h,
1040
- showAllButton: F,
1041
- testId: g && `${g}-layer`
1042
- })
1043
- }))] });
1056
+ isOpen: z,
1057
+ active: T,
1058
+ tooltip: b,
1059
+ error: x,
1060
+ warning: S,
1061
+ testId: _,
1062
+ selected: C,
1063
+ tabIndex: w
1064
+ }), /* @__PURE__ */ jsx(CSSTransition, {
1065
+ nodeRef: D,
1066
+ in: z,
1067
+ timeout: 100,
1068
+ classNames: {
1069
+ enter: menu_module_default.enter,
1070
+ enterActive: menu_module_default.enterActive
1071
+ },
1072
+ unmountOnExit: !0,
1073
+ children: /* @__PURE__ */ jsx(Fragment$1, { children: z && G(/* @__PURE__ */ jsx("div", {
1074
+ ...W,
1075
+ ref: (e) => {
1076
+ D.current = e, W.ref(e);
1077
+ },
1078
+ className: menu_module_default.layerContainer,
1079
+ "data-testid": e.testId,
1080
+ onClick: (e) => e.stopPropagation(),
1081
+ children: /* @__PURE__ */ jsx(Layer$2, {
1082
+ sections: P,
1083
+ isNested: o,
1084
+ width: t,
1085
+ closeOnOptionClick: c,
1086
+ close: l || V,
1087
+ tree: u,
1088
+ path: d,
1089
+ maxHeight: g,
1090
+ showAllButton: L,
1091
+ testId: _ && `${_}-layer`
1092
+ })
1093
+ })) })
1094
+ })] });
1044
1095
  }, Menu = (e) => e.contextMenu ? /* @__PURE__ */ jsx(ContextMenu, {
1045
1096
  ...e,
1046
1097
  tree: {},
@@ -1710,22 +1761,38 @@ const FileInput = ({ label: e = "Select", loading: t = !1, placeholder: n = "No
1710
1761
  }, [e]), n ? createPortal(t, n) : null;
1711
1762
  };
1712
1763
  var modal_module_default = {
1713
- wrapper: "_wrapper_sb0hc_1",
1714
- contentContainer: "_contentContainer_sb0hc_15",
1715
- centered: "_centered_sb0hc_24",
1716
- newLine: "_newLine_sb0hc_28"
1717
- }, Wrapper = ({ children: e }) => {
1718
- let t = useRef(null);
1764
+ wrapper: "_wrapper_1sv3a_1",
1765
+ enter: "_enter_1sv3a_15",
1766
+ enterActive: "_enterActive_1sv3a_18",
1767
+ exit: "_exit_1sv3a_22",
1768
+ exitActive: "_exitActive_1sv3a_25",
1769
+ contentContainer: "_contentContainer_1sv3a_29",
1770
+ centered: "_centered_1sv3a_52",
1771
+ newLine: "_newLine_1sv3a_56"
1772
+ }, Wrapper = ({ children: e, visible: t }) => {
1773
+ let n = useRef(null);
1719
1774
  return useEffect(() => {
1720
- if (t.current) {
1721
- let e = t.current.querySelector("[tabindex=\"0\"]");
1722
- e ? e.focus() : t.current.focus();
1775
+ if (n.current) {
1776
+ let e = n.current.querySelector("[tabindex=\"0\"]");
1777
+ e ? e.focus() : n.current.focus();
1723
1778
  }
1724
- }, []), /* @__PURE__ */ jsx("div", {
1725
- ref: t,
1726
- tabIndex: -1,
1727
- className: cx(modal_module_default.wrapper),
1728
- children: e
1779
+ }, []), /* @__PURE__ */ jsx(CSSTransition, {
1780
+ nodeRef: n,
1781
+ in: t,
1782
+ timeout: 100,
1783
+ classNames: {
1784
+ enter: modal_module_default.enter,
1785
+ enterActive: modal_module_default.enterActive,
1786
+ exit: modal_module_default.exit,
1787
+ exitActive: modal_module_default.exitActive
1788
+ },
1789
+ unmountOnExit: !0,
1790
+ children: /* @__PURE__ */ jsx("div", {
1791
+ ref: n,
1792
+ tabIndex: -1,
1793
+ className: cx(modal_module_default.wrapper),
1794
+ children: t && e
1795
+ })
1729
1796
  });
1730
1797
  }, Content$2 = ({ children: e, width: t, centered: n }) => /* @__PURE__ */ jsx("div", {
1731
1798
  className: cx(modal_module_default.contentContainer, n ? modal_module_default.centered : ""),
@@ -1744,14 +1811,17 @@ const Modal = ({ children: e, visible: t = !1, centered: n = !1, width: r = "100
1744
1811
  t && i && i();
1745
1812
  }, [t, i]), useKeyboardEvent("Escape", () => {
1746
1813
  t && a && a();
1747
- }, [t, a]), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Portal, {
1814
+ }, [t, a]), /* @__PURE__ */ jsx(Portal, {
1748
1815
  id: o,
1749
- children: t ? /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(Content$2, {
1750
- width: r,
1751
- centered: n,
1752
- children: e
1753
- }) }) : null
1754
- }) });
1816
+ children: /* @__PURE__ */ jsx(Wrapper, {
1817
+ visible: t,
1818
+ children: /* @__PURE__ */ jsx(Content$2, {
1819
+ width: r,
1820
+ centered: n,
1821
+ children: e
1822
+ })
1823
+ })
1824
+ });
1755
1825
  };
1756
1826
  var progress_bar_module_default = {
1757
1827
  progress: "_progress_23ror_1",
@@ -1966,10 +2036,13 @@ var reducer$1 = (e, t) => {
1966
2036
  className: cx(message_module_default.legendToggle),
1967
2037
  onClick: n,
1968
2038
  children: t ? "Hide details" : "Show details"
1969
- }), t ? /* @__PURE__ */ jsx("div", {
1970
- className: message_module_default.detailsText,
1971
- children: e
1972
- }) : null] }), DialogIcon = ({ type: e }) => {
2039
+ }), /* @__PURE__ */ jsx(Collapse, {
2040
+ expanded: t,
2041
+ children: /* @__PURE__ */ jsx("div", {
2042
+ className: message_module_default.detailsText,
2043
+ children: e
2044
+ })
2045
+ })] }), DialogIcon = ({ type: e }) => {
1973
2046
  switch (e) {
1974
2047
  case MessageType.SUCCESS: return /* @__PURE__ */ jsx(Icon, {
1975
2048
  icon: IconType.SUCCESS,
@@ -2154,20 +2227,22 @@ const useWindowWidth = () => {
2154
2227
  }), []), e;
2155
2228
  };
2156
2229
  var custom_select_module_default = {
2157
- layerContainer: "_layerContainer_41zze_1",
2158
- layer: "_layer_41zze_1",
2159
- small: "_small_41zze_23",
2160
- heading: "_heading_41zze_26",
2161
- option: "_option_41zze_27",
2162
- message: "_message_41zze_28",
2163
- focused: "_focused_41zze_67",
2164
- selected: "_selected_41zze_71",
2165
- disabled: "_disabled_41zze_74",
2166
- check: "_check_41zze_78",
2167
- optionContent: "_optionContent_41zze_95",
2168
- label: "_label_41zze_100",
2169
- icon: "_icon_41zze_107",
2170
- details: "_details_41zze_112"
2230
+ layerContainer: "_layerContainer_q5iac_1",
2231
+ layer: "_layer_q5iac_1",
2232
+ enter: "_enter_q5iac_14",
2233
+ enterActive: "_enterActive_q5iac_18",
2234
+ small: "_small_q5iac_32",
2235
+ heading: "_heading_q5iac_35",
2236
+ option: "_option_q5iac_36",
2237
+ message: "_message_q5iac_37",
2238
+ focused: "_focused_q5iac_76",
2239
+ selected: "_selected_q5iac_80",
2240
+ disabled: "_disabled_q5iac_83",
2241
+ check: "_check_q5iac_87",
2242
+ optionContent: "_optionContent_q5iac_104",
2243
+ label: "_label_q5iac_109",
2244
+ icon: "_icon_q5iac_116",
2245
+ details: "_details_q5iac_121"
2171
2246
  };
2172
2247
  const Heading$2 = ({ label: e }) => /* @__PURE__ */ jsx("div", {
2173
2248
  onClick: (e) => e.stopPropagation(),
@@ -2659,7 +2734,7 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2659
2734
  triggerBounds: k
2660
2735
  };
2661
2736
  }, CustomSelect = (e) => {
2662
- let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: c, onCreate: l = null, placeholder: u = "", small: d = !1, tabIndex: m = 0, onFocus: h = () => {}, onBlur: g = () => {}, searchable: _ = !0, clearable: v = !1, maxTooltipWidth: y, closeOnOptionActionClick: b, isInTable: x = !1, groupOrder: S, firstSelectedOptionIndex: C = 0, right: w = !1, testId: T = void 0 } = e, E = useContext(DisabledContext), D = l !== null, O = useRef(null), [k, A] = useFocus(), j = useFontsReady(), [M, N] = useReducer(reducer, {
2737
+ let { multi: t = !1, disabled: n = !1, error: r = null, warning: i = null, tooltip: a = null, options: o, selectedOptions: c, onCreate: l = null, placeholder: u = "", small: d = !1, tabIndex: m = 0, onFocus: h = () => {}, onBlur: g = () => {}, searchable: _ = !0, clearable: v = !1, maxTooltipWidth: y, closeOnOptionActionClick: b, isInTable: x = !1, groupOrder: S, firstSelectedOptionIndex: C = 0, right: w = !1, testId: T = void 0 } = e, E = useContext(DisabledContext), D = l !== null, O = useRef(null), k = useRef(null), [A, j] = useFocus(), M = useFontsReady(), [N, P] = useReducer(reducer, {
2663
2738
  options: o,
2664
2739
  firstSelectedOptionIndex: C
2665
2740
  }, ({ options: e }) => ({
@@ -2668,29 +2743,29 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2668
2743
  layerFocus: initialLayerFocus(e, C ?? 0),
2669
2744
  triggerFocus: initialTriggerFocus,
2670
2745
  isLayerOpen: !1
2671
- })), { getTriggerWidth: P, onKeyEvent: F, clearAllIsFocused: I, triggerProps: L, onClickTrigger: R, onChangeSearch: z, onClickDeselectOption: B, onClickClearAll: V, renderLayer: H, layerProps: U, closeLayer: W, onSelectOption: G, getLayerWidth: K, triggerBounds: q } = useCustomSelectLogic({
2746
+ })), { getTriggerWidth: F, onKeyEvent: I, clearAllIsFocused: L, triggerProps: R, onClickTrigger: z, onChangeSearch: B, onClickDeselectOption: V, onClickClearAll: H, renderLayer: U, layerProps: W, closeLayer: G, onSelectOption: K, getLayerWidth: q, triggerBounds: Ld } = useCustomSelectLogic({
2672
2747
  ...e,
2673
- state: M,
2674
- dispatch: N,
2675
- setTriggerFocus: A,
2748
+ state: N,
2749
+ dispatch: P,
2750
+ setTriggerFocus: j,
2676
2751
  disabledContext: E,
2677
- isFontLoaded: j,
2752
+ isFontLoaded: M,
2678
2753
  createAble: D,
2679
2754
  listRef: O
2680
2755
  });
2681
2756
  return /* @__PURE__ */ jsxs("div", {
2682
- style: { width: P() },
2757
+ style: { width: F() },
2683
2758
  onKeyDown: (e) => {
2684
- Object.values(EventKey).includes(e.key) && F(e.key, e);
2759
+ Object.values(EventKey).includes(e.key) && I(e.key, e);
2685
2760
  },
2686
2761
  children: [/* @__PURE__ */ jsx(Trigger, {
2687
2762
  selectedOptions: c,
2688
- searchValue: M.searchValue,
2689
- isOpen: M.isLayerOpen,
2690
- focusedSelectedOptionIndex: M.triggerFocus.currentOption,
2691
- clearAllIsFocused: I,
2763
+ searchValue: N.searchValue,
2764
+ isOpen: N.isLayerOpen,
2765
+ focusedSelectedOptionIndex: N.triggerFocus.currentOption,
2766
+ clearAllIsFocused: L,
2692
2767
  searchable: _,
2693
- triggerRef: mergeRefs(k, L.ref),
2768
+ triggerRef: mergeRefs(A, R.ref),
2694
2769
  error: r,
2695
2770
  warning: i,
2696
2771
  tooltip: a,
@@ -2699,10 +2774,10 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2699
2774
  disabled: n || E,
2700
2775
  clearable: v,
2701
2776
  tabIndex: m,
2702
- onClickTrigger: R,
2703
- onChangeSearch: z,
2704
- onClickDeselect: B,
2705
- onClickClear: V,
2777
+ onClickTrigger: z,
2778
+ onChangeSearch: B,
2779
+ onClickDeselect: V,
2780
+ onClickClear: H,
2706
2781
  onFocus: h,
2707
2782
  onBlur: g,
2708
2783
  groupOrder: S,
@@ -2710,27 +2785,40 @@ const useCustomSelectLogic = ({ state: e, dispatch: t, options: n, setTriggerFoc
2710
2785
  placeholder: u,
2711
2786
  right: w,
2712
2787
  testId: T
2713
- }), M.isLayerOpen && H(/* @__PURE__ */ jsx("div", {
2714
- ...U,
2715
- className: custom_select_module_default.layerContainer,
2716
- children: /* @__PURE__ */ jsx(Layer$1, {
2717
- listRef: O,
2718
- isMulti: t,
2719
- sections: M.visibleOptions,
2720
- selectedOptions: c,
2721
- onSelectOption: (e, n) => {
2722
- G(e, n, t ? void 0 : W);
2723
- },
2724
- closeLayer: () => {
2725
- b && W();
2788
+ }), /* @__PURE__ */ jsx(CSSTransition, {
2789
+ nodeRef: k,
2790
+ in: N.isLayerOpen,
2791
+ timeout: 100,
2792
+ classNames: {
2793
+ enter: custom_select_module_default.enter,
2794
+ enterActive: custom_select_module_default.enterActive
2795
+ },
2796
+ unmountOnExit: !0,
2797
+ children: /* @__PURE__ */ jsx(Fragment$1, { children: N.isLayerOpen && U(/* @__PURE__ */ jsx("div", {
2798
+ ...W,
2799
+ ref: (e) => {
2800
+ k.current = e, W.ref(e);
2726
2801
  },
2727
- width: K(q),
2728
- small: d,
2729
- focusedOptionIndex: M.layerFocus.current,
2730
- firstSelectedOptionIndex: C ?? 0,
2731
- testId: T && `${T}-layer`
2732
- })
2733
- }))]
2802
+ className: custom_select_module_default.layerContainer,
2803
+ children: /* @__PURE__ */ jsx(Layer$1, {
2804
+ listRef: O,
2805
+ isMulti: t,
2806
+ sections: N.visibleOptions,
2807
+ selectedOptions: c,
2808
+ onSelectOption: (e, n) => {
2809
+ K(e, n, t ? void 0 : G);
2810
+ },
2811
+ closeLayer: () => {
2812
+ b && G();
2813
+ },
2814
+ width: q(Ld),
2815
+ small: d,
2816
+ focusedOptionIndex: N.layerFocus.current,
2817
+ firstSelectedOptionIndex: C ?? 0,
2818
+ testId: T && `${T}-layer`
2819
+ })
2820
+ })) })
2821
+ })]
2734
2822
  });
2735
2823
  }, isEmptyNullOrUndefined = (e) => e == null || e === "", isNumericLike = (e) => /^-?\d+(\.\d+)?$/.test(e.trim()), isMulti = (e) => e instanceof Array, standardizeOptions = (e, t) => t && Array.isArray(e) ? e.map((e) => typeof e == "string" || typeof e == "number" ? {
2736
2824
  label: e,
@@ -3327,52 +3415,67 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3327
3415
  });
3328
3416
  }, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions });
3329
3417
  var popover_module_default = {
3330
- toggleBox: "_toggleBox_lhie5_1",
3331
- fullWidthStyleFix: "_fullWidthStyleFix_lhie5_8",
3332
- dismiss: "_dismiss_lhie5_13"
3333
- };
3334
- const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p }) => {
3335
- let h = useContext(DisabledContext), [_, v] = f === void 0 ? useState(!1) : [f, p], y = () => {
3336
- !u && !h && v && v(!1);
3337
- }, b = () => {
3338
- u || h || v && v(!_);
3418
+ toggleBox: "_toggleBox_rwod1_1",
3419
+ enter: "_enter_rwod1_8",
3420
+ enterActive: "_enterActive_rwod1_12",
3421
+ fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
3422
+ dismiss: "_dismiss_rwod1_22"
3423
+ };
3424
+ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: h }) => {
3425
+ let _ = useContext(DisabledContext), v = useRef(null), [y, b] = f === void 0 ? useState(!1) : [f, h], x = () => {
3426
+ !u && !_ && b && b(!1);
3427
+ }, S = () => {
3428
+ u || _ || b && b(!y);
3339
3429
  };
3340
3430
  useEffect(() => {
3341
- (u || h) && y();
3342
- }, [u, h]);
3343
- let { renderLayer: x, arrowProps: S, layerProps: C, triggerProps: w } = useLayer({
3344
- isOpen: _,
3431
+ (u || _) && x();
3432
+ }, [u, _]);
3433
+ let { renderLayer: C, arrowProps: w, layerProps: T, triggerProps: E } = useLayer({
3434
+ isOpen: y,
3345
3435
  placement: r,
3346
3436
  auto: !0,
3347
3437
  triggerOffset: 6,
3348
- onOutsideClick: i ? y : void 0,
3438
+ onOutsideClick: i ? x : void 0,
3349
3439
  ResizeObserver: ResizeObserver$1,
3350
3440
  overflowContainer: d
3351
3441
  });
3352
3442
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
3353
- ref: w.ref,
3354
- onClick: b,
3443
+ ref: E.ref,
3444
+ onClick: S,
3355
3445
  "data-testid": l,
3356
3446
  children: t
3357
- }), _ && x(/* @__PURE__ */ jsxs("div", {
3358
- className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
3359
- ...C,
3360
- children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: y }) : n, o && /* @__PURE__ */ jsx("div", {
3361
- className: popover_module_default.dismiss,
3362
- children: /* @__PURE__ */ jsx(Button, {
3363
- small: !0,
3364
- round: !0,
3365
- onClick: y,
3366
- icon: IconType.CLOSE
3367
- })
3368
- })] }), /* @__PURE__ */ jsx(Arrow, {
3369
- ...S,
3370
- backgroundColor: "var(--color-background-layer)",
3371
- borderColor: "var(--color-border)",
3372
- borderWidth: 1,
3373
- size: 6
3374
- })]
3375
- }))] });
3447
+ }), /* @__PURE__ */ jsx(CSSTransition, {
3448
+ nodeRef: v,
3449
+ in: y,
3450
+ timeout: 100,
3451
+ classNames: {
3452
+ enter: popover_module_default.enter,
3453
+ enterActive: popover_module_default.enterActive
3454
+ },
3455
+ unmountOnExit: !0,
3456
+ children: /* @__PURE__ */ jsx(Fragment$1, { children: y && C(/* @__PURE__ */ jsxs("div", {
3457
+ className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
3458
+ ...T,
3459
+ ref: (e) => {
3460
+ v.current = e, T.ref(e);
3461
+ },
3462
+ children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: x }) : n, o && /* @__PURE__ */ jsx("div", {
3463
+ className: popover_module_default.dismiss,
3464
+ children: /* @__PURE__ */ jsx(Button, {
3465
+ small: !0,
3466
+ round: !0,
3467
+ onClick: x,
3468
+ icon: IconType.CLOSE
3469
+ })
3470
+ })] }), /* @__PURE__ */ jsx(Arrow, {
3471
+ ...w,
3472
+ backgroundColor: "var(--color-background-layer)",
3473
+ borderColor: "var(--color-border)",
3474
+ borderWidth: 1,
3475
+ size: 6
3476
+ })]
3477
+ })) })
3478
+ })] });
3376
3479
  }, CellHelpIcon = ({ cell: e }) => {
3377
3480
  let { helpIcon: t } = e;
3378
3481
  return t ? /* @__PURE__ */ jsx("div", {
@@ -5324,13 +5427,19 @@ const ToggleNarrow = ({ toggleNarrow: e, onClickToggleNarrow: t }) => e ? /* @__
5324
5427
  }, MetaCount = ({ item: e }) => e.metaCount === void 0 ? null : /* @__PURE__ */ jsx(Badge, {
5325
5428
  color: "rgba(0,0,0,0.25)",
5326
5429
  title: e.metaCount
5327
- }), ItemContent = ({ item: e, expanding: t }) => t && e.active && e.content ? /* @__PURE__ */ jsx("div", {
5328
- className: list_module_default.itemContent,
5329
- onClick: (e) => {
5430
+ }), ItemContent = ({ item: e, expanding: t }) => {
5431
+ let n = (e) => {
5330
5432
  e.preventDefault(), e.stopPropagation();
5331
- },
5332
- children: e.content
5333
- }) : null, ListSubheading = forwardRef(({ item: e, index: t }, n) => {
5433
+ }, r = !!t && !!e.active && !!e.content;
5434
+ return /* @__PURE__ */ jsx(Collapse, {
5435
+ expanded: r,
5436
+ children: /* @__PURE__ */ jsx("div", {
5437
+ className: list_module_default.itemContent,
5438
+ onClick: n,
5439
+ children: e.content
5440
+ })
5441
+ });
5442
+ }, ListSubheading = forwardRef(({ item: e, index: t }, n) => {
5334
5443
  let r = useContext(DisabledContext), { actions: i, disabled: a, expanded: o, onClick: c, title: l, name: u, icon: d, testId: f } = e;
5335
5444
  return /* @__PURE__ */ jsx("div", {
5336
5445
  ref: (e) => {
@@ -6611,7 +6720,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6611
6720
  } : {
6612
6721
  value: G,
6613
6722
  unit: U
6614
- }), Pd = k || K?.value === void 0, [J, Fd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Id = !!(O || n), Y = C && C.find((e) => {
6723
+ }), Ld = k || K?.value === void 0, [J, Rd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), zd = !!(O || n), Y = C && C.find((e) => {
6615
6724
  if (!e?.value) return;
6616
6725
  if (E) return E === e.valueKey;
6617
6726
  let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
@@ -6620,7 +6729,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6620
6729
  toUnit: t
6621
6730
  });
6622
6731
  return withUnit(n, t) === e.value;
6623
- }), Ld = () => {
6732
+ }), Bd = () => {
6624
6733
  let e = l ?? "", t = K.unit;
6625
6734
  if (checkConversion({
6626
6735
  value: e,
@@ -6634,7 +6743,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6634
6743
  return null;
6635
6744
  }
6636
6745
  } else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
6637
- }, Rd = (t) => {
6746
+ }, Vd = (t) => {
6638
6747
  let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, K?.unit || ""), s = A ? withUnit(convertAndGetValue(o, B), B) : o;
6639
6748
  h({ target: {
6640
6749
  value: s,
@@ -6647,7 +6756,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6647
6756
  }), R(() => {
6648
6757
  r.selectionStart = a, r.selectionEnd = a;
6649
6758
  });
6650
- }, zd = (e, t) => {
6759
+ }, Hd = (e, t) => {
6651
6760
  t === K.unit || isNaN(Number(e)) || (q({
6652
6761
  value: e,
6653
6762
  unit: t
@@ -6678,7 +6787,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6678
6787
  e !== void 0 && q({
6679
6788
  value: e,
6680
6789
  unit: t
6681
- }), C && Fd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6790
+ }), C && Rd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6682
6791
  }
6683
6792
  }, [
6684
6793
  U,
@@ -6686,7 +6795,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6686
6795
  i,
6687
6796
  T
6688
6797
  ]);
6689
- let X = Ld(), Z = label(K.unit) || K.unit || "", Bd = p || !X || X && X.length === 1, Q = getStringName(e), $, Vd = (t) => {
6798
+ let X = Bd(), Z = label(K.unit) || K.unit || "", Ud = p || !X || X && X.length === 1, Q = getStringName(e), $, Wd = (t) => {
6690
6799
  let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
6691
6800
  if (checkConversion({
6692
6801
  value: r,
@@ -6706,7 +6815,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6706
6815
  type: MenuType.OPTION,
6707
6816
  inline: !0,
6708
6817
  onClick: () => {
6709
- validateNumber(i).valid && !n && (Fd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6818
+ validateNumber(i).valid && !n && (Rd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6710
6819
  value: r,
6711
6820
  name: typeof e == "string" ? e : e?.fieldName || "",
6712
6821
  predefinedSelected: !0,
@@ -6733,10 +6842,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6733
6842
  label: "Custom",
6734
6843
  selected: J === PredefinedOptionsMenuState.CUSTOM
6735
6844
  }], C?.length) {
6736
- let e = C.map(Vd);
6845
+ let e = C.map(Wd);
6737
6846
  $ = [...$, ...e];
6738
6847
  }
6739
- let Hd = (e) => {
6848
+ let Gd = (e) => {
6740
6849
  if (isValueWithUnit(e)) {
6741
6850
  let t = getUnit(e), { value: n } = safeConvertValue({
6742
6851
  value: e,
@@ -6748,7 +6857,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6748
6857
  return n;
6749
6858
  }
6750
6859
  return e;
6751
- }, Ud = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Wd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6860
+ }, Kd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, qd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6752
6861
  return /* @__PURE__ */ jsx("div", {
6753
6862
  className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
6754
6863
  children: /* @__PURE__ */ jsxs(InputGroup, {
@@ -6780,31 +6889,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6780
6889
  name: Q,
6781
6890
  testId: x,
6782
6891
  disabled: n,
6783
- placeholder: Hd(t),
6892
+ placeholder: Gd(t),
6784
6893
  value: K.value,
6785
- onChange: Rd,
6894
+ onChange: Vd,
6786
6895
  onFocus: v,
6787
6896
  error: i === null ? void 0 : i,
6788
6897
  warning: S === null ? void 0 : S,
6789
6898
  left: a,
6790
- allowEmpty: Pd,
6899
+ allowEmpty: Ld,
6791
6900
  validationCallback: (e, t) => D(Q, t),
6792
6901
  enableCosmeticRounding: j,
6793
6902
  enableDisplayRounding: M,
6794
6903
  roundDisplayValue: N,
6795
- groupOrder: Ud,
6796
- disableInternalErrorValidationMessages: Id,
6904
+ groupOrder: Kd,
6905
+ disableInternalErrorValidationMessages: zd,
6797
6906
  small: o,
6798
6907
  selectOnFocus: P,
6799
6908
  tooltip: I
6800
6909
  }, Q)
6801
6910
  }),
6802
- Z && (Bd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6803
- groupOrder: Wd,
6911
+ Z && (Ud || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6912
+ groupOrder: qd,
6804
6913
  small: o,
6805
6914
  children: Z
6806
6915
  }) : /* @__PURE__ */ jsx(Menu, {
6807
- groupOrder: Wd,
6916
+ groupOrder: qd,
6808
6917
  maxHeight: 380,
6809
6918
  disabled: r,
6810
6919
  testId: x && `${x}-menu`,
@@ -6820,7 +6929,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6820
6929
  label: j ? safeRoundNumbers(i) : i,
6821
6930
  inline: !0,
6822
6931
  onClick: (n) => {
6823
- n.stopPropagation(), zd(e, t);
6932
+ n.stopPropagation(), Hd(e, t);
6824
6933
  },
6825
6934
  description: r,
6826
6935
  selected: r === Z,
@@ -8720,4 +8829,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
8720
8829
  }
8721
8830
  });
8722
8831
  };
8723
- export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
8832
+ export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };