@dmsi/wedgekit-react 0.0.231 → 0.0.233

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 (143) hide show
  1. package/dist/{chunk-FYW64H7N.js → chunk-3FOAGRIY.js} +3 -3
  2. package/dist/{chunk-BHJNYWQG.js → chunk-4AHS4CVA.js} +1 -1
  3. package/dist/{chunk-RDLEIAQU.js → chunk-6CTCHYIS.js} +5 -0
  4. package/dist/{chunk-2VRZB2A4.js → chunk-6ZYTR6DU.js} +1 -1
  5. package/dist/{chunk-CJELWEO2.js → chunk-7KLALK3J.js} +1 -1
  6. package/dist/{chunk-E3UOI2D2.js → chunk-DXVLA32J.js} +2 -2
  7. package/dist/{chunk-SYEJVSE4.js → chunk-FRHPFACM.js} +1 -1
  8. package/dist/{chunk-KGVKHWUK.js → chunk-FS2RQE55.js} +1 -1
  9. package/dist/{chunk-REOLWEZG.js → chunk-KEDK5EWD.js} +1 -1
  10. package/dist/{chunk-SK742QNF.js → chunk-KNP4LUFA.js} +1 -1
  11. package/dist/{chunk-A76MF7ZO.js → chunk-MQXOQL3T.js} +3 -3
  12. package/dist/{chunk-ARC7FOL2.js → chunk-NWELJDBW.js} +3 -3
  13. package/dist/{chunk-47KTDBGA.js → chunk-OGMN5SHL.js} +4 -4
  14. package/dist/{chunk-7BBXPM5C.js → chunk-OP5XCT3L.js} +1 -1
  15. package/dist/{chunk-BOWQUDUU.js → chunk-QA3KMRA6.js} +1 -1
  16. package/dist/{chunk-3WNXMCZV.js → chunk-QQ5G773N.js} +1 -1
  17. package/dist/{chunk-LPQ4QMAV.js → chunk-R2FGTCOY.js} +1 -1
  18. package/dist/{chunk-QHHNFGEX.js → chunk-RJBKI53P.js} +3 -3
  19. package/dist/{chunk-ED7FXZRX.js → chunk-UVG2TKTG.js} +5 -5
  20. package/dist/chunk-VDO7VGAD.js +1182 -0
  21. package/dist/{chunk-Q7ETEWBW.js → chunk-VGPOI7UP.js} +3 -3
  22. package/dist/{chunk-CJVTFYI4.js → chunk-VP7HJX24.js} +1 -1
  23. package/dist/{chunk-A5ROZWIH.js → chunk-VR7X3NMG.js} +5 -5
  24. package/dist/chunk-X73BO77J.js +493 -0
  25. package/dist/{chunk-XQILVD56.js → chunk-XO6PXENP.js} +1 -1
  26. package/dist/{chunk-5JVMULVC.js → chunk-YCKRRAJA.js} +2 -2
  27. package/dist/components/AccessChangerTabItem.cjs +5 -0
  28. package/dist/components/AccessChangerTabItem.js +2 -2
  29. package/dist/components/Accordion.cjs +5 -0
  30. package/dist/components/Accordion.js +4 -4
  31. package/dist/components/Breadcrumbs.cjs +15 -4
  32. package/dist/components/Breadcrumbs.js +12 -6
  33. package/dist/components/Button.cjs +5 -0
  34. package/dist/components/Button.js +2 -2
  35. package/dist/components/CalendarRange.cjs +4071 -224
  36. package/dist/components/CalendarRange.css +4830 -0
  37. package/dist/components/CalendarRange.js +24 -2
  38. package/dist/components/Caption.cjs +5 -0
  39. package/dist/components/Caption.js +1 -1
  40. package/dist/components/Checkbox.cjs +5 -0
  41. package/dist/components/Checkbox.js +3 -3
  42. package/dist/components/ContentTab.cjs +5 -0
  43. package/dist/components/ContentTab.js +3 -3
  44. package/dist/components/ContentTabs.cjs +5 -0
  45. package/dist/components/ContentTabs.js +3 -3
  46. package/dist/components/DataGridCell.cjs +5 -0
  47. package/dist/components/DataGridCell.js +7 -7
  48. package/dist/components/DateInput.cjs +3673 -326
  49. package/dist/components/DateInput.css +4830 -0
  50. package/dist/components/DateInput.js +23 -6
  51. package/dist/components/DateRangeInput.cjs +3673 -326
  52. package/dist/components/DateRangeInput.css +4830 -0
  53. package/dist/components/DateRangeInput.js +23 -6
  54. package/dist/components/Display.cjs +5 -0
  55. package/dist/components/Display.js +2 -2
  56. package/dist/components/FilterGroup.cjs +5 -0
  57. package/dist/components/FilterGroup.js +11 -11
  58. package/dist/components/Heading.cjs +5 -0
  59. package/dist/components/Heading.js +2 -2
  60. package/dist/components/Input.cjs +5 -0
  61. package/dist/components/Input.js +3 -3
  62. package/dist/components/InputGroup.cjs +5 -0
  63. package/dist/components/InputGroup.js +2 -2
  64. package/dist/components/Label.cjs +5 -0
  65. package/dist/components/Label.js +2 -2
  66. package/dist/components/Link.cjs +5 -0
  67. package/dist/components/Link.js +2 -2
  68. package/dist/components/MainBar.cjs +5 -0
  69. package/dist/components/MainBar.js +1 -1
  70. package/dist/components/MenuOption.cjs +5 -0
  71. package/dist/components/MenuOption.js +4 -4
  72. package/dist/components/MobileDataGrid.cjs +5 -0
  73. package/dist/components/MobileDataGrid.js +7 -7
  74. package/dist/components/Modal.cjs +5 -0
  75. package/dist/components/Modal.js +7 -7
  76. package/dist/components/ModalButtons.cjs +5 -0
  77. package/dist/components/ModalButtons.js +3 -3
  78. package/dist/components/ModalContent.cjs +5 -0
  79. package/dist/components/ModalContent.js +2 -2
  80. package/dist/components/ModalHeader.cjs +5 -0
  81. package/dist/components/ModalHeader.js +4 -4
  82. package/dist/components/NavigationTab.cjs +5 -0
  83. package/dist/components/NavigationTab.js +3 -3
  84. package/dist/components/NavigationTabs.cjs +5 -0
  85. package/dist/components/NavigationTabs.js +3 -3
  86. package/dist/components/NestedMenu.cjs +5 -0
  87. package/dist/components/NestedMenu.js +4 -4
  88. package/dist/components/Notification.cjs +5 -0
  89. package/dist/components/Notification.js +7 -7
  90. package/dist/components/OptionPill.cjs +5 -0
  91. package/dist/components/OptionPill.js +4 -4
  92. package/dist/components/PDFViewer.cjs +5 -0
  93. package/dist/components/PDFViewer.js +11 -11
  94. package/dist/components/Paragraph.cjs +5 -0
  95. package/dist/components/Paragraph.js +2 -2
  96. package/dist/components/Password.cjs +5 -0
  97. package/dist/components/Password.js +3 -3
  98. package/dist/components/ProjectBar.cjs +5 -0
  99. package/dist/components/ProjectBar.js +1 -1
  100. package/dist/components/Radio.cjs +5 -0
  101. package/dist/components/Radio.js +2 -2
  102. package/dist/components/Search.cjs +5 -0
  103. package/dist/components/Search.js +4 -4
  104. package/dist/components/Select.cjs +5 -0
  105. package/dist/components/Select.js +4 -4
  106. package/dist/components/SideMenuGroup.cjs +5 -0
  107. package/dist/components/SideMenuGroup.js +3 -3
  108. package/dist/components/SideMenuItem.cjs +5 -0
  109. package/dist/components/SideMenuItem.js +3 -3
  110. package/dist/components/Stack.cjs +5 -0
  111. package/dist/components/Stack.js +2 -2
  112. package/dist/components/StatusPill.cjs +5 -0
  113. package/dist/components/StatusPill.js +2 -2
  114. package/dist/components/Stepper.cjs +5 -0
  115. package/dist/components/Stepper.js +6 -6
  116. package/dist/components/Subheader.cjs +5 -0
  117. package/dist/components/Subheader.js +2 -2
  118. package/dist/components/Swatch.cjs +5 -0
  119. package/dist/components/Swatch.js +5 -5
  120. package/dist/components/Textarea.cjs +5 -0
  121. package/dist/components/Textarea.js +1 -1
  122. package/dist/components/Time.cjs +5 -0
  123. package/dist/components/Time.js +4 -4
  124. package/dist/components/Toast.cjs +5 -0
  125. package/dist/components/Toast.js +6 -6
  126. package/dist/components/Tooltip.cjs +5 -0
  127. package/dist/components/Tooltip.js +2 -2
  128. package/dist/components/TopBar.cjs +5 -0
  129. package/dist/components/TopBar.js +1 -1
  130. package/dist/components/Upload.cjs +5 -0
  131. package/dist/components/Upload.js +6 -6
  132. package/dist/components/index.cjs +5 -0
  133. package/dist/components/index.css +15 -13
  134. package/dist/components/index.js +20 -1150
  135. package/dist/index.css +15 -13
  136. package/package.json +1 -1
  137. package/src/classNames.ts +9 -3
  138. package/src/components/Breadcrumbs.tsx +13 -6
  139. package/src/components/CalendarRange.tsx +316 -165
  140. package/src/components/Link.tsx +1 -1
  141. package/src/components/Stack.tsx +1 -1
  142. package/src/index.css +4 -2
  143. package/dist/chunk-SE5DM2IJ.js +0 -350
@@ -62,8 +62,8 @@ __export(DateRangeInput_exports, {
62
62
  DateRangeInput: () => DateRangeInput
63
63
  });
64
64
  module.exports = __toCommonJS(DateRangeInput_exports);
65
- var import_react3 = require("react");
66
- var import_react_dom = require("react-dom");
65
+ var import_react20 = require("react");
66
+ var import_react_dom3 = require("react-dom");
67
67
 
68
68
  // src/components/Input.tsx
69
69
  var import_react = require("react");
@@ -126,6 +126,11 @@ var typography = {
126
126
  "font-sans font-normal",
127
127
  "text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
128
128
  "leading-caption-mobile desktop:leading-caption-desktop"
129
+ ),
130
+ breadcrumb: (0, import_clsx.default)(
131
+ "font-sans font-normal",
132
+ "text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
133
+ "leading-mobile-breadcrumb desktop:leading-desktop-breadcrumb"
129
134
  )
130
135
  };
131
136
  var baseTransition = (0, import_clsx.default)(
@@ -704,331 +709,169 @@ Currency.displayName = "Currency";
704
709
  Percentage.displayName = "Percentage";
705
710
 
706
711
  // src/components/CalendarRange.tsx
707
- var import_clsx5 = __toESM(require("clsx"), 1);
708
- var import_react2 = __toESM(require("react"), 1);
712
+ var import_clsx22 = __toESM(require("clsx"), 1);
713
+ var import_react19 = __toESM(require("react"), 1);
709
714
  var import_polyfill = require("@js-temporal/polyfill");
715
+
716
+ // src/components/DataGridCell.tsx
717
+ var import_sortable = require("@dnd-kit/sortable");
718
+
719
+ // ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
720
+ var import_react2 = require("react");
721
+ var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
722
+ var CSS = /* @__PURE__ */ Object.freeze({
723
+ Translate: {
724
+ toString(transform) {
725
+ if (!transform) {
726
+ return;
727
+ }
728
+ const {
729
+ x,
730
+ y
731
+ } = transform;
732
+ return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
733
+ }
734
+ },
735
+ Scale: {
736
+ toString(transform) {
737
+ if (!transform) {
738
+ return;
739
+ }
740
+ const {
741
+ scaleX,
742
+ scaleY
743
+ } = transform;
744
+ return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
745
+ }
746
+ },
747
+ Transform: {
748
+ toString(transform) {
749
+ if (!transform) {
750
+ return;
751
+ }
752
+ return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
753
+ }
754
+ },
755
+ Transition: {
756
+ toString(_ref) {
757
+ let {
758
+ property,
759
+ duration,
760
+ easing
761
+ } = _ref;
762
+ return property + " " + duration + "ms " + easing;
763
+ }
764
+ }
765
+ });
766
+
767
+ // src/components/DataGridCell.tsx
768
+ var import_clsx8 = __toESM(require("clsx"), 1);
769
+ var import_react11 = require("react");
770
+
771
+ // src/components/MenuOption.tsx
772
+ var import_clsx6 = __toESM(require("clsx"), 1);
773
+ var import_react7 = require("react");
774
+
775
+ // src/components/Paragraph.tsx
776
+ var import_clsx5 = __toESM(require("clsx"), 1);
710
777
  var import_jsx_runtime4 = require("react/jsx-runtime");
711
- function DateCell(_a) {
778
+ var Paragraph = (_a) => {
712
779
  var _b = _a, {
713
- date,
714
- isInMonth,
715
- isToday,
716
- isSelected,
717
- inRange,
718
- isDisabled,
719
- isRangeStart,
720
- isRangeEnd,
721
- onClick,
722
- onMouseEnter,
723
- onMouseLeave,
724
- cellPadding = "",
725
- isRangeDisabled = false,
780
+ className,
781
+ color,
782
+ padded,
783
+ align = "left",
784
+ tall,
785
+ addOverflow,
786
+ children,
787
+ as = "p",
726
788
  id,
727
789
  testid
728
790
  } = _b, props = __objRest(_b, [
729
- "date",
730
- "isInMonth",
731
- "isToday",
732
- "isSelected",
733
- "inRange",
734
- "isDisabled",
735
- "isRangeStart",
736
- "isRangeEnd",
737
- "onClick",
738
- "onMouseEnter",
739
- "onMouseLeave",
740
- "cellPadding",
741
- "isRangeDisabled",
791
+ "className",
792
+ "color",
793
+ "padded",
794
+ "align",
795
+ "tall",
796
+ "addOverflow",
797
+ "children",
798
+ "as",
742
799
  "id",
743
800
  "testid"
744
801
  ]);
802
+ const Element = as;
745
803
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
746
- "span",
747
- __spreadProps(__spreadValues({}, props), {
804
+ Element,
805
+ __spreadProps(__spreadValues({
748
806
  id,
749
- "data-testid": testid,
807
+ "data-testid": testid
808
+ }, props), {
750
809
  className: (0, import_clsx5.default)(
751
- "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
752
- typography.caption,
753
- cellPadding,
754
- !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
755
- !isInMonth && "border-transparent",
756
- // Today: subtle border ring
757
- isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
758
- // Selected: Figma blue, white text, strong shadow
759
- isSelected && "bg-action-400 text-white border-action-400 z-10",
760
- !isSelected && !inRange && "rounded-base",
761
- // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
762
- (isRangeDisabled || !inRange && isSelected) && "rounded-base",
763
- inRange && isSelected && "hover:border-action-500",
764
- // In range: Figma light blue background
765
- inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
766
- // Disabled: Figma gray, no pointer, no hover
767
- isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
768
- "text-text-primary-normal cursor-pointer",
769
- // Figma hover: blue bg, blue text (or red text if selected)
770
- isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
771
- // Figma active: darker blue bg, white text
772
- "active:bg-action-300 active:text-white",
773
- // Figma focus: ring
774
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
775
- ],
776
- isRangeStart && "rounded-l",
777
- isRangeEnd && "rounded-r"
810
+ typography.paragraph,
811
+ className,
812
+ padded && componentPaddingXUsingComponentGap,
813
+ align === "left" && "text-left",
814
+ align === "center" && "text-center",
815
+ align === "right" && "text-right",
816
+ tall && "!leading-6",
817
+ addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
778
818
  ),
779
- tabIndex: isDisabled ? -1 : 0,
780
- "aria-disabled": isDisabled,
781
- onClick: () => !isDisabled && isInMonth && onClick(),
782
- onMouseEnter: () => isInMonth && onMouseEnter(),
783
- onMouseLeave: () => isInMonth && onMouseLeave(),
784
- children: isInMonth ? date.day : ""
819
+ style: __spreadProps(__spreadValues({}, props.style), {
820
+ color: color ? `var(--color-${color})` : void 0
821
+ }),
822
+ children
785
823
  })
786
824
  );
787
- }
788
- function CalendarRange({
789
- from,
790
- to,
791
- onChange,
792
- isDateAvailable,
793
- mode = "double",
794
- cardStyle = false,
795
- disableRange = false,
796
- id,
797
- testid
825
+ };
826
+ Paragraph.displayName = "Paragraph";
827
+
828
+ // src/hooks/useKeydown.ts
829
+ var import_react3 = require("react");
830
+
831
+ // src/hooks/useInfiniteScroll.tsx
832
+ var import_react4 = require("react");
833
+ function useInfiniteScroll({
834
+ containerRef,
835
+ onLoadMore,
836
+ isLoading,
837
+ offset = 50,
838
+ enabled = true
839
+ // ✅ Add this
798
840
  }) {
799
- const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
800
- const parseDate = (d) => {
801
- if (!d) {
802
- return void 0;
803
- }
804
- try {
805
- if (typeof d === "number") {
806
- return import_polyfill.Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
807
- }
808
- if (typeof d === "string") {
809
- return import_polyfill.Temporal.PlainDate.from(d);
841
+ (0, import_react4.useEffect)(() => {
842
+ if (!enabled) return;
843
+ const handleScroll = () => {
844
+ const el2 = containerRef.current;
845
+ if (!el2 || isLoading) return;
846
+ const { scrollTop, scrollHeight, clientHeight } = el2;
847
+ const isNearBottom = scrollTop + clientHeight >= scrollHeight - offset;
848
+ if (isNearBottom) {
849
+ onLoadMore();
810
850
  }
811
- return void 0;
812
- } catch (error) {
813
- console.error("Invalid date format:", d, error);
814
- return import_polyfill.Temporal.Now.plainDateISO();
815
- }
816
- };
817
- const fromDate = parseDate(from);
818
- const toDate = parseDate(to);
819
- const today = import_polyfill.Temporal.Now.plainDateISO();
820
- const [baseMonth, setBaseMonth] = (0, import_react2.useState)(
821
- fromDate != null ? fromDate : today.with({ day: 1 })
822
- );
823
- const [selecting, setSelecting] = (0, import_react2.useState)("from");
824
- const [pendingFrom, setPendingFrom] = (0, import_react2.useState)(void 0);
825
- const [hoveredDate, setHoveredDate] = (0, import_react2.useState)(void 0);
826
- (0, import_react2.useEffect)(() => {
827
- if (fromDate) {
828
- setBaseMonth(fromDate.with({ day: 1 }));
829
- } else if (toDate) {
830
- setBaseMonth(toDate.with({ day: 1 }));
831
- }
832
- }, [from, to]);
833
- (0, import_react2.useEffect)(() => {
834
- if (fromDate && toDate) {
835
- setSelecting("from");
836
- setPendingFrom(void 0);
837
- setHoveredDate(void 0);
838
- }
839
- }, [from, to]);
840
- function getMonthData(monthOffset) {
841
- const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
842
- const days = monthDate.daysInMonth;
843
- const firstDayOffset = monthDate.dayOfWeek % 7;
844
- return {
845
- name: monthDate.toLocaleString("en-US", { month: "long" }),
846
- year: monthDate.year,
847
- days,
848
- firstDayOffset,
849
- date: monthDate
850
851
  };
851
- }
852
- function handleDayClick(date) {
853
- if (isDateAvailable && !isDateAvailable(date)) return;
854
- if (mode === "single" && disableRange) {
855
- if (onChange) {
856
- onChange(date.toString(), date.toString());
857
- }
858
- return;
859
- }
860
- if (selecting === "from") {
861
- setPendingFrom(date);
862
- setSelecting("to");
863
- setHoveredDate(void 0);
864
- } else if (pendingFrom) {
865
- if (onChange) {
866
- const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
867
- onChange(start.toString(), end.toString());
868
- }
869
- setPendingFrom(void 0);
870
- setSelecting("from");
871
- setHoveredDate(void 0);
872
- }
873
- }
874
- function isInRange(date) {
875
- if (mode === "single" && disableRange) {
876
- return false;
877
- }
878
- if (pendingFrom && selecting === "to" && hoveredDate) {
879
- const [start, end] = import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
880
- return import_polyfill.Temporal.PlainDate.compare(date, start) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, end) <= 0;
881
- }
882
- if (!pendingFrom && fromDate && toDate) {
883
- return import_polyfill.Temporal.PlainDate.compare(date, fromDate) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, toDate) <= 0;
884
- }
885
- return false;
886
- }
887
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
888
- "div",
889
- {
890
- id,
891
- "data-testid": testid,
892
- className: (0, import_clsx5.default)(
893
- "relative bg-background-grouped-primary-normal rounded-base w-fit",
894
- layoutPaddding,
895
- layoutGap,
896
- cardStyle && "shadow-4",
897
- // baseTransition,
898
- "overflow-hidden"
899
- ),
900
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
901
- "div",
902
- {
903
- className: (0, import_clsx5.default)(
904
- "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
905
- layoutGap
906
- ),
907
- children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
908
- const month = getMonthData(offset);
909
- const totalCells = 42;
910
- const emptyCells = month.firstDayOffset;
911
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react2.default.Fragment, { children: [
912
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
913
- "div",
914
- {
915
- className: (0, import_clsx5.default)("flex flex-col"),
916
- children: [
917
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
918
- "div",
919
- {
920
- className: (0, import_clsx5.default)(
921
- "flex flex-row items-center justify-between",
922
- typography.label,
923
- "text-text-action-primary-normal"
924
- ),
925
- children: [
926
- idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
927
- "button",
928
- {
929
- id: id ? `${id}-prev-month-button` : void 0,
930
- "data-testid": testid ? `${testid}-prev-month-button` : void 0,
931
- type: "button",
932
- className: (0, import_clsx5.default)(
933
- "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
934
- componentPadding
935
- ),
936
- "aria-label": "Previous month",
937
- onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
938
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chevron_left", size: 24 })
939
- }
940
- ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: (0, import_clsx5.default)(componentPadding, "mr-1") }),
941
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
942
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] truncate", children: month.name }),
943
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] px-1 truncate", children: month.year })
944
- ] }),
945
- (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
946
- "button",
947
- {
948
- id: id ? `${id}-next-month-button` : void 0,
949
- "data-testid": testid ? `${testid}-next-month-button` : void 0,
950
- type: "button",
951
- className: (0, import_clsx5.default)(
952
- "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
953
- componentPadding
954
- ),
955
- "aria-label": "Next month",
956
- onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
957
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chevron_right", size: 24 })
958
- }
959
- ) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: (0, import_clsx5.default)(componentPadding, "ml-1") })
960
- ]
961
- }
962
- ),
963
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx5.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
964
- "span",
965
- {
966
- className: (0, import_clsx5.default)(
967
- typography.caption,
968
- "text-text-secondary-normal text-center",
969
- "w-10"
970
- ),
971
- children: d
972
- },
973
- d
974
- )) }),
975
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx5.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
976
- const day = i - emptyCells + 1;
977
- const date = month.date.with({ day: 1 }).add({
978
- days: i - emptyCells
979
- });
980
- const isInMonth = day > 0 && day <= month.days;
981
- const isToday = isInMonth && date.equals(today);
982
- const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
983
- const inRange = isInMonth && isInRange(date);
984
- const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
985
- const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
986
- const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
987
- const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
988
- const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
989
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
990
- DateCell,
991
- {
992
- id: id ? `${id}-date-${date.toString()}` : void 0,
993
- testid: testid ? `${testid}-date-${date.toString()}` : void 0,
994
- date,
995
- isInMonth: !!isInMonth,
996
- isToday: !!isToday,
997
- isSelected: !!isSelected,
998
- inRange: !!inRange,
999
- isDisabled: !!isDisabled,
1000
- onClick: () => handleDayClick(date),
1001
- onMouseEnter: () => setHoveredDate(date),
1002
- onMouseLeave: () => setHoveredDate(void 0),
1003
- isRangeStart: !!isRangeStart,
1004
- isRangeEnd: !!isRangeEnd,
1005
- isRangeDisabled: mode === "single" && disableRange,
1006
- cellPadding: componentPadding
1007
- },
1008
- i
1009
- );
1010
- }) })
1011
- ]
1012
- }
1013
- ),
1014
- mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1015
- "div",
1016
- {
1017
- className: (0, import_clsx5.default)(
1018
- "self-stretch bg-border-primary-normal rounded-base",
1019
- // 1px width, full height, matches Figma divider
1020
- "w-px"
1021
- )
1022
- }
1023
- )
1024
- ] }, month.name + month.year);
1025
- })
1026
- }
1027
- )
1028
- }
1029
- );
852
+ const el = containerRef.current;
853
+ if (el) el.addEventListener("scroll", handleScroll);
854
+ return () => {
855
+ if (el) el.removeEventListener("scroll", handleScroll);
856
+ };
857
+ }, [containerRef, onLoadMore, isLoading, offset, enabled]);
1030
858
  }
1031
859
 
860
+ // src/hooks/useMatchesMedia.ts
861
+ var import_react5 = require("react");
862
+ var useMatchesMedia = (query) => {
863
+ const [matches, setMatches] = (0, import_react5.useState)();
864
+ (0, import_react5.useLayoutEffect)(() => {
865
+ const mediaQueryList = window.matchMedia(query);
866
+ const listener = () => setMatches(mediaQueryList.matches);
867
+ listener();
868
+ mediaQueryList.addEventListener("change", listener);
869
+ return () => mediaQueryList.removeEventListener("change", listener);
870
+ }, [query]);
871
+ return matches;
872
+ };
873
+ var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
874
+
1032
875
  // src/utils/date.ts
1033
876
  function parseInputDate(input) {
1034
877
  const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
@@ -1155,6 +998,15 @@ function isValidDateRangeOrder(fromDate, toDate) {
1155
998
  return to >= from;
1156
999
  }
1157
1000
 
1001
+ // src/utils/mergeObjectArrays.ts
1002
+ function mergeObjectArrays(arr1, arr2) {
1003
+ const maxLength = Math.max(arr1.length, arr2.length);
1004
+ return Array.from(
1005
+ { length: maxLength },
1006
+ (_, i) => __spreadValues(__spreadValues({}, arr1[i] || {}), arr2[i] || {})
1007
+ );
1008
+ }
1009
+
1158
1010
  // src/utils.ts
1159
1011
  function findDocumentRoot(element) {
1160
1012
  if (typeof window === "undefined" || typeof document === "undefined") {
@@ -1178,8 +1030,3503 @@ function findDocumentRoot(element) {
1178
1030
  return window.document.body;
1179
1031
  }
1180
1032
 
1181
- // src/components/DateRangeInput.tsx
1182
- var import_jsx_runtime5 = require("react/jsx-runtime");
1033
+ // src/hooks/useTableLayout.ts
1034
+ var import_react6 = require("react");
1035
+ function useTableLayout(initialColumns, key) {
1036
+ const [columns, setColumns] = (0, import_react6.useState)(initialColumns);
1037
+ const [isReady, setIsReady] = (0, import_react6.useState)(false);
1038
+ const renderCountRef = (0, import_react6.useRef)(0);
1039
+ const handleSaveLayout = (0, import_react6.useCallback)(
1040
+ (setter, _internal) => {
1041
+ if (!isReady && !_internal || !key) return;
1042
+ setColumns((prevColumns) => {
1043
+ const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
1044
+ if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
1045
+ return prevColumns;
1046
+ localStorage.setItem(`${key}-tableLayout`, JSON.stringify(newColumns));
1047
+ return newColumns;
1048
+ });
1049
+ },
1050
+ [isReady, key]
1051
+ );
1052
+ (0, import_react6.useEffect)(() => {
1053
+ if (!key) return setIsReady(true);
1054
+ if (renderCountRef.current > 1) {
1055
+ throw new Error(
1056
+ `useTableLayout should only be called once per component render cycle.
1057
+ ${renderCountRef.current} Renders detected.
1058
+ Check dependency stability`
1059
+ );
1060
+ }
1061
+ renderCountRef.current += 1;
1062
+ const savedLayout = localStorage.getItem(`${key}-tableLayout`);
1063
+ if (savedLayout) {
1064
+ handleSaveLayout(
1065
+ mergeObjectArrays(
1066
+ initialColumns,
1067
+ JSON.parse(savedLayout)
1068
+ ),
1069
+ true
1070
+ );
1071
+ }
1072
+ if (!savedLayout) handleSaveLayout(initialColumns, true);
1073
+ setIsReady(true);
1074
+ return () => {
1075
+ renderCountRef.current = 0;
1076
+ };
1077
+ }, [handleSaveLayout, initialColumns, key]);
1078
+ return { columns, setColumns: handleSaveLayout, isReady };
1079
+ }
1080
+
1081
+ // src/components/MenuOption.tsx
1082
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1083
+ var MenuOption = ({
1084
+ id,
1085
+ testid,
1086
+ children,
1087
+ disabled = false,
1088
+ variant = "normal",
1089
+ value,
1090
+ before,
1091
+ after,
1092
+ subMenu,
1093
+ onClick,
1094
+ selected,
1095
+ ref,
1096
+ onSubMenuHover,
1097
+ onSubMenuLeave,
1098
+ onSubMenuEnter,
1099
+ toggleMenu,
1100
+ subMenuLevel = 1,
1101
+ currentSubMenuLevel,
1102
+ closeSubMenuLevel,
1103
+ activeMenu,
1104
+ mobilePositionTo,
1105
+ highlightMatchingText = false,
1106
+ menuValue,
1107
+ onMouseMove
1108
+ }) => {
1109
+ const uniqueId = (0, import_react7.useId)();
1110
+ const internalRef = (0, import_react7.useRef)(null);
1111
+ const actualRef = ref || internalRef;
1112
+ const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
1113
+ const isMobile = useMatchesMobile();
1114
+ const handleMouseEnter = () => {
1115
+ if (subMenu && onSubMenuHover && !disabled) {
1116
+ onSubMenuHover(menuId.current, subMenuLevel);
1117
+ }
1118
+ };
1119
+ const handleMouseLeave = () => {
1120
+ if (subMenu && onSubMenuLeave && !disabled) {
1121
+ onSubMenuLeave(subMenuLevel);
1122
+ }
1123
+ };
1124
+ const handleMouseMove = () => {
1125
+ if (subMenu && onMouseMove && !disabled) {
1126
+ onMouseMove();
1127
+ }
1128
+ };
1129
+ const handleSubMenuEnter = () => {
1130
+ if (onSubMenuEnter) {
1131
+ onSubMenuEnter();
1132
+ }
1133
+ };
1134
+ const additionalAttributes = {
1135
+ "data-selected": selected || null
1136
+ };
1137
+ const svgStyles = (0, import_clsx6.default)(
1138
+ "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
1139
+ );
1140
+ const textLabelStyles = (0, import_clsx6.default)("w-full whitespace-nowrap !leading-6");
1141
+ const normalStyles = variant === "normal" && !disabled && (0, import_clsx6.default)(
1142
+ "bg-transparent text-text-primary-normal",
1143
+ "hover:bg-background-action-secondary-hover",
1144
+ "focus:bg-background-action-secondary-hover",
1145
+ "data-selected:bg-background-action-secondary-hover",
1146
+ "active:bg-background-action-secondary-active"
1147
+ );
1148
+ const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx6.default)("text-text-primary-disabled");
1149
+ const actionStyles = variant === "action" && !disabled && (0, import_clsx6.default)(
1150
+ "text-action-400 bg-transparent",
1151
+ "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
1152
+ "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
1153
+ "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
1154
+ "active:bg-background-action-secondary-active active:text-text-action-active"
1155
+ );
1156
+ const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx6.default)("text-text-action-disabled");
1157
+ const disabledStyles = disabled && (0, import_clsx6.default)("bg-transparent cursor-default pointer-events-none");
1158
+ const processChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
1159
+ const renderChildren = typeof children === "object" ? children : variant === "action" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { padded: true, className: textLabelStyles, children: processChildren }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Paragraph, { padded: true, className: textLabelStyles, children: processChildren });
1160
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
1161
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1162
+ "div",
1163
+ __spreadProps(__spreadValues({
1164
+ id,
1165
+ "data-testid": testid,
1166
+ ref: actualRef,
1167
+ className: (0, import_clsx6.default)(
1168
+ "flex items-center cursor-pointer w-full text-left relative outline-none",
1169
+ svgStyles,
1170
+ componentGap,
1171
+ componentPadding,
1172
+ baseTransition,
1173
+ normalStyles,
1174
+ normalDisabledStyles,
1175
+ actionStyles,
1176
+ actionDisabledStyles,
1177
+ disabledStyles
1178
+ ),
1179
+ "data-value": value || children,
1180
+ onClick: () => {
1181
+ onClick == null ? void 0 : onClick(menuId.current, value || children);
1182
+ if (subMenu) {
1183
+ toggleMenu(menuId.current, subMenuLevel);
1184
+ }
1185
+ },
1186
+ onMouseEnter: handleMouseEnter,
1187
+ onMouseLeave: handleMouseLeave,
1188
+ onMouseMove: handleMouseMove
1189
+ }, additionalAttributes), {
1190
+ tabIndex: -1,
1191
+ role: "menuitem",
1192
+ "aria-haspopup": subMenu ? "menu" : void 0,
1193
+ children: [
1194
+ before && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "shrink-0 flex items-center", children: before }),
1195
+ renderChildren,
1196
+ renderAfterProp()
1197
+ ]
1198
+ })
1199
+ ),
1200
+ subMenu && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1201
+ "div",
1202
+ {
1203
+ onMouseEnter: handleSubMenuEnter,
1204
+ onMouseLeave: handleMouseLeave,
1205
+ "data-submenu-parent": menuId.current,
1206
+ "data-menu-level": subMenuLevel + 1,
1207
+ children: subMenu({
1208
+ menuId: menuId.current,
1209
+ positionTo: actualRef,
1210
+ mobilePositionTo,
1211
+ position: "right",
1212
+ subMenuLevel,
1213
+ mobileBackMenuOption,
1214
+ mobileHide: isMobile && activeMenu !== menuId.current
1215
+ })
1216
+ }
1217
+ )
1218
+ ] });
1219
+ function renderAfterProp() {
1220
+ if (after) {
1221
+ return after;
1222
+ }
1223
+ if (subMenu && after !== null) {
1224
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_right" });
1225
+ }
1226
+ }
1227
+ function mobileBackMenuOption() {
1228
+ if (!isMobile) {
1229
+ return;
1230
+ }
1231
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1232
+ MenuOption,
1233
+ {
1234
+ id: id ? `${id}-back` : void 0,
1235
+ testid: testid ? `${testid}-back` : void 0,
1236
+ onClick: () => {
1237
+ closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
1238
+ },
1239
+ variant: "action",
1240
+ before: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_left" }),
1241
+ children: "Back"
1242
+ }
1243
+ );
1244
+ }
1245
+ };
1246
+ MenuOption.displayName = "MenuOption";
1247
+ function highlightMatch(text, searchValue) {
1248
+ if (!searchValue || !searchValue.trim()) {
1249
+ return text;
1250
+ }
1251
+ const regex = new RegExp(
1252
+ `(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
1253
+ "gi"
1254
+ );
1255
+ const parts = text.split(regex);
1256
+ return parts.map(
1257
+ (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-bold", children: part }, index) : part
1258
+ );
1259
+ }
1260
+
1261
+ // src/components/Menu.tsx
1262
+ var import_clsx7 = __toESM(require("clsx"), 1);
1263
+ var import_react9 = require("react");
1264
+ var import_react_dom = require("react-dom");
1265
+
1266
+ // src/components/useMenuSystem.tsx
1267
+ var import_react8 = require("react");
1268
+ function useSubMenuSystem(mobilePositionTo) {
1269
+ const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
1270
+ {}
1271
+ );
1272
+ const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
1273
+ const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
1274
+ null
1275
+ );
1276
+ const menuRootRef = (0, import_react8.useRef)(null);
1277
+ const subMenuRefs = (0, import_react8.useRef)({});
1278
+ const hoverTimeoutRef = (0, import_react8.useRef)(null);
1279
+ const closeTimeoutRef = (0, import_react8.useRef)(null);
1280
+ const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
1281
+ const isMouseMovingRef = (0, import_react8.useRef)(false);
1282
+ const pendingOpenActionRef = (0, import_react8.useRef)(null);
1283
+ const pendingCloseActionRef = (0, import_react8.useRef)(null);
1284
+ const isMobile = useMatchesMobile();
1285
+ const toggleMenu = (menuId, level) => {
1286
+ if (closeTimeoutRef.current) {
1287
+ clearTimeout(closeTimeoutRef.current);
1288
+ closeTimeoutRef.current = null;
1289
+ }
1290
+ setActiveMenu(menuId);
1291
+ setCurrentSubMenuLevel(level);
1292
+ setActiveMenus((prev) => {
1293
+ const newActiveMenus = __spreadValues({}, prev);
1294
+ if (newActiveMenus[level] === menuId) {
1295
+ delete newActiveMenus[level];
1296
+ } else {
1297
+ newActiveMenus[level] = menuId;
1298
+ }
1299
+ Object.keys(newActiveMenus).forEach((key) => {
1300
+ if (Number(key) > level) {
1301
+ delete newActiveMenus[Number(key)];
1302
+ }
1303
+ });
1304
+ return newActiveMenus;
1305
+ });
1306
+ };
1307
+ const openMenu = (menuId, level) => {
1308
+ if (closeTimeoutRef.current) {
1309
+ clearTimeout(closeTimeoutRef.current);
1310
+ closeTimeoutRef.current = null;
1311
+ }
1312
+ setActiveMenus((prev) => {
1313
+ const newActiveMenus = __spreadValues({}, prev);
1314
+ newActiveMenus[level] = menuId;
1315
+ Object.keys(newActiveMenus).forEach((key) => {
1316
+ if (Number(key) > level) {
1317
+ delete newActiveMenus[Number(key)];
1318
+ }
1319
+ });
1320
+ return newActiveMenus;
1321
+ });
1322
+ };
1323
+ const executePendingActions = (0, import_react8.useCallback)(() => {
1324
+ if (pendingCloseActionRef.current) {
1325
+ pendingCloseActionRef.current();
1326
+ pendingCloseActionRef.current = null;
1327
+ }
1328
+ if (pendingOpenActionRef.current) {
1329
+ pendingOpenActionRef.current();
1330
+ pendingOpenActionRef.current = null;
1331
+ }
1332
+ }, []);
1333
+ const openMenuWithDelay = (menuId, level, delay = 150) => {
1334
+ if (isMobile) {
1335
+ return;
1336
+ }
1337
+ pendingOpenActionRef.current = () => {
1338
+ if (hoverTimeoutRef.current) {
1339
+ clearTimeout(hoverTimeoutRef.current);
1340
+ }
1341
+ hoverTimeoutRef.current = setTimeout(() => {
1342
+ openMenu(menuId, level);
1343
+ }, delay);
1344
+ };
1345
+ if (!isMouseMovingRef.current) {
1346
+ executePendingActions();
1347
+ }
1348
+ };
1349
+ const closeMenuWithDelay = (level, delay = 500) => {
1350
+ if (isMobile) {
1351
+ return;
1352
+ }
1353
+ pendingCloseActionRef.current = () => {
1354
+ if (hoverTimeoutRef.current) {
1355
+ clearTimeout(hoverTimeoutRef.current);
1356
+ hoverTimeoutRef.current = null;
1357
+ }
1358
+ closeTimeoutRef.current = setTimeout(() => {
1359
+ closeSubMenuLevel(level);
1360
+ }, delay);
1361
+ };
1362
+ if (!isMouseMovingRef.current) {
1363
+ executePendingActions();
1364
+ }
1365
+ };
1366
+ const handleMouseMove = () => {
1367
+ isMouseMovingRef.current = true;
1368
+ if (mouseStopTimeoutRef.current) {
1369
+ clearTimeout(mouseStopTimeoutRef.current);
1370
+ }
1371
+ mouseStopTimeoutRef.current = setTimeout(() => {
1372
+ isMouseMovingRef.current = false;
1373
+ executePendingActions();
1374
+ }, 200);
1375
+ };
1376
+ const cancelCloseTimeout = () => {
1377
+ if (isMobile) {
1378
+ return;
1379
+ }
1380
+ if (mouseStopTimeoutRef.current) {
1381
+ clearTimeout(mouseStopTimeoutRef.current);
1382
+ mouseStopTimeoutRef.current = null;
1383
+ isMouseMovingRef.current = false;
1384
+ }
1385
+ };
1386
+ const closeSubMenuLevel = (level) => {
1387
+ setActiveMenus((prev) => {
1388
+ const newActiveMenus = __spreadValues({}, prev);
1389
+ delete newActiveMenus[level];
1390
+ Object.keys(newActiveMenus).forEach((key) => {
1391
+ if (Number(key) >= level) {
1392
+ delete newActiveMenus[Number(key)];
1393
+ }
1394
+ });
1395
+ if (isMobile) {
1396
+ const newSubMenuLevel = level - 1;
1397
+ setCurrentSubMenuLevel(newSubMenuLevel);
1398
+ const newActiveMenu = newActiveMenus[newSubMenuLevel];
1399
+ if (Object.keys(newActiveMenus).length > 0 && newActiveMenu) {
1400
+ setActiveMenu(newActiveMenu);
1401
+ }
1402
+ }
1403
+ return newActiveMenus;
1404
+ });
1405
+ };
1406
+ const registerSubMenu = (id, element) => {
1407
+ subMenuRefs.current[id] = element;
1408
+ };
1409
+ const isMenuActive = (menuId, level) => {
1410
+ return activeMenus[level] === menuId;
1411
+ };
1412
+ (0, import_react8.useEffect)(() => {
1413
+ const handleClickOutside = (event) => {
1414
+ var _a;
1415
+ if (Object.keys(activeMenus).length === 0) return;
1416
+ const target = event.target;
1417
+ if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
1418
+ const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
1419
+ const submenuEl = subMenuRefs.current[id];
1420
+ return submenuEl == null ? void 0 : submenuEl.contains(target);
1421
+ });
1422
+ if (!isInsideActiveSubmenu) {
1423
+ setActiveMenus({});
1424
+ }
1425
+ };
1426
+ document.addEventListener("mousedown", handleClickOutside);
1427
+ return () => {
1428
+ document.removeEventListener("mousedown", handleClickOutside);
1429
+ };
1430
+ }, [activeMenus]);
1431
+ (0, import_react8.useEffect)(() => {
1432
+ return () => {
1433
+ if (hoverTimeoutRef.current) {
1434
+ clearTimeout(hoverTimeoutRef.current);
1435
+ }
1436
+ if (closeTimeoutRef.current) {
1437
+ clearTimeout(closeTimeoutRef.current);
1438
+ }
1439
+ };
1440
+ }, []);
1441
+ const getAllFocusableMenuElements = () => {
1442
+ const elements = [];
1443
+ if (menuRootRef.current) {
1444
+ elements.push(
1445
+ ...Array.from(menuRootRef.current.children)
1446
+ );
1447
+ }
1448
+ Object.values(activeMenus).forEach((menuId) => {
1449
+ const submenuEl = subMenuRefs.current[menuId];
1450
+ if (submenuEl) {
1451
+ elements.push(...Array.from(submenuEl.children));
1452
+ }
1453
+ });
1454
+ return elements;
1455
+ };
1456
+ const findCurrentMenuLevel = (element) => {
1457
+ let current = element.parentElement;
1458
+ while (current) {
1459
+ const level = current.getAttribute("data-menu-level");
1460
+ if (level !== null) {
1461
+ return parseInt(level, 10);
1462
+ }
1463
+ current = current.parentElement;
1464
+ }
1465
+ return 0;
1466
+ };
1467
+ const getMenuElementsAtLevel = (level) => {
1468
+ var _a;
1469
+ if (level === 0 && menuRootRef.current) {
1470
+ return Array.from(menuRootRef.current.children);
1471
+ }
1472
+ const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
1473
+ const submenuEl = subMenuRefs.current[id];
1474
+ return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
1475
+ })) == null ? void 0 : _a[1];
1476
+ if (menuId) {
1477
+ const submenuEl = subMenuRefs.current[menuId];
1478
+ if (submenuEl) {
1479
+ return Array.from(submenuEl.children);
1480
+ }
1481
+ }
1482
+ return [];
1483
+ };
1484
+ return {
1485
+ menuRootRef,
1486
+ activeMenus,
1487
+ openMenu,
1488
+ isMenuActive,
1489
+ registerSubMenu,
1490
+ closeSubMenuLevel,
1491
+ getAllFocusableMenuElements,
1492
+ findCurrentMenuLevel,
1493
+ getMenuElementsAtLevel,
1494
+ mobileHide: isMobile && Object.keys(activeMenus).length > 0,
1495
+ listeners: {
1496
+ onSubMenuHover: openMenuWithDelay,
1497
+ onSubMenuLeave: closeMenuWithDelay,
1498
+ onSubMenuEnter: cancelCloseTimeout,
1499
+ onMouseMove: handleMouseMove,
1500
+ toggleMenu,
1501
+ mobilePositionTo,
1502
+ activeMenu,
1503
+ currentSubMenuLevel,
1504
+ closeSubMenuLevel
1505
+ }
1506
+ };
1507
+ }
1508
+ function useMenuPosition(elementRef, position = "bottom", options) {
1509
+ const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
1510
+ top: 0,
1511
+ left: 0,
1512
+ minWidth: 0
1513
+ });
1514
+ const isMobile = options == null ? void 0 : options.isMobile;
1515
+ const updatePosition = (0, import_react8.useCallback)(() => {
1516
+ var _a, _b, _c;
1517
+ if (!(elementRef == null ? void 0 : elementRef.current)) return;
1518
+ const triggerRect = elementRef.current.getBoundingClientRect();
1519
+ const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
1520
+ const viewportWidth = window.innerWidth;
1521
+ const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
1522
+ const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
1523
+ let top = 0;
1524
+ let left = 0;
1525
+ if (position === "bottom" || position === "bottom-right") {
1526
+ top = triggerRect.top + triggerRect.height + topOffset;
1527
+ } else {
1528
+ top = triggerRect.top;
1529
+ }
1530
+ if (position === "bottom") {
1531
+ left = triggerRect.left + window.scrollX;
1532
+ } else if (position === "bottom-right") {
1533
+ left = triggerRect.right + window.scrollX - menuWidth;
1534
+ } else if (position === "right") {
1535
+ if (isMobile) {
1536
+ left = triggerRect.left + window.scrollX;
1537
+ } else {
1538
+ left = triggerRect.right + window.scrollX;
1539
+ }
1540
+ }
1541
+ const overflowsRightViewport = left + menuWidth > viewportWidth;
1542
+ if (overflowsRightViewport) {
1543
+ const newLeft = triggerRect.left - menuWidth;
1544
+ const overflowsLeftViewport = newLeft < 0;
1545
+ if (overflowsLeftViewport) {
1546
+ left = (viewportWidth - menuWidth) / 2;
1547
+ } else {
1548
+ left = newLeft;
1549
+ }
1550
+ }
1551
+ if (isMobile && position === "right") {
1552
+ top = triggerRect.top + triggerRect.height + topOffset;
1553
+ }
1554
+ if (isMobile && menuWidth > viewportWidth) {
1555
+ left = 0;
1556
+ }
1557
+ setMenuPosition({
1558
+ top,
1559
+ left,
1560
+ minWidth: triggerRect.width
1561
+ });
1562
+ }, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
1563
+ (0, import_react8.useEffect)(() => {
1564
+ if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
1565
+ const handleClickOutside = (event) => {
1566
+ var _a, _b, _c, _d, _e;
1567
+ const target = event.target;
1568
+ if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
1569
+ if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
1570
+ if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
1571
+ var _a2;
1572
+ return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
1573
+ }))
1574
+ return;
1575
+ (_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
1576
+ };
1577
+ document.addEventListener("mousedown", handleClickOutside);
1578
+ return () => {
1579
+ document.removeEventListener("mousedown", handleClickOutside);
1580
+ };
1581
+ }, [
1582
+ options,
1583
+ elementRef,
1584
+ options == null ? void 0 : options.isOpen,
1585
+ options == null ? void 0 : options.setIsOpen,
1586
+ options == null ? void 0 : options.menuRef,
1587
+ options == null ? void 0 : options.additionalRefs
1588
+ ]);
1589
+ (0, import_react8.useEffect)(() => {
1590
+ updatePosition();
1591
+ const resizeObserver = new ResizeObserver(updatePosition);
1592
+ if (elementRef == null ? void 0 : elementRef.current) {
1593
+ resizeObserver.observe(elementRef.current);
1594
+ }
1595
+ window.addEventListener("scroll", updatePosition);
1596
+ window.addEventListener("resize", updatePosition);
1597
+ return () => {
1598
+ resizeObserver.disconnect();
1599
+ window.removeEventListener("scroll", updatePosition);
1600
+ window.removeEventListener("resize", updatePosition);
1601
+ };
1602
+ }, [elementRef, updatePosition]);
1603
+ return { menuPosition, updatePosition };
1604
+ }
1605
+
1606
+ // src/components/Menu.tsx
1607
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1608
+ var Menu = (_a) => {
1609
+ var _b = _a, {
1610
+ id,
1611
+ testid,
1612
+ children,
1613
+ className,
1614
+ ref,
1615
+ positionTo,
1616
+ mobilePositionTo,
1617
+ show,
1618
+ setShow,
1619
+ position = "bottom",
1620
+ maxHeight: customMaxHeight,
1621
+ topOffset,
1622
+ mobileBackMenuOption,
1623
+ mobileHide,
1624
+ useDefaultMinWidth,
1625
+ autoFocusOff,
1626
+ menuName,
1627
+ calculateMinMaxHeight
1628
+ } = _b, props = __objRest(_b, [
1629
+ "id",
1630
+ "testid",
1631
+ "children",
1632
+ "className",
1633
+ "ref",
1634
+ "positionTo",
1635
+ "mobilePositionTo",
1636
+ "show",
1637
+ "setShow",
1638
+ "position",
1639
+ "maxHeight",
1640
+ "topOffset",
1641
+ "mobileBackMenuOption",
1642
+ "mobileHide",
1643
+ "useDefaultMinWidth",
1644
+ "autoFocusOff",
1645
+ "menuName",
1646
+ "calculateMinMaxHeight"
1647
+ ]);
1648
+ const internalRef = (0, import_react9.useRef)(null);
1649
+ const actualRef = ref || internalRef;
1650
+ const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
1651
+ const isMobile = useMatchesMobile();
1652
+ const { menuPosition, updatePosition } = useMenuPosition(
1653
+ isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
1654
+ position,
1655
+ {
1656
+ isOpen: show,
1657
+ setIsOpen: setShow,
1658
+ menuRef: internalRef,
1659
+ topOffset,
1660
+ isMobile: !!(isMobile && mobilePositionTo)
1661
+ }
1662
+ );
1663
+ (0, import_react9.useEffect)(() => {
1664
+ if (calculateMinMaxHeight) {
1665
+ return;
1666
+ }
1667
+ const raf = requestAnimationFrame(() => {
1668
+ if (!actualRef.current || customMaxHeight) {
1669
+ return;
1670
+ }
1671
+ if (actualRef.current.childElementCount > 4) {
1672
+ let accumulatedHeight = 0;
1673
+ Array.from(actualRef.current.children).forEach((child, index) => {
1674
+ if (index >= 5) {
1675
+ return;
1676
+ }
1677
+ accumulatedHeight += child.clientHeight;
1678
+ });
1679
+ accumulatedHeight = accumulatedHeight / 5 * 4.5;
1680
+ setMaxHeight(`${accumulatedHeight}px`);
1681
+ }
1682
+ });
1683
+ return () => {
1684
+ cancelAnimationFrame(raf);
1685
+ };
1686
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1687
+ (0, import_react9.useEffect)(() => {
1688
+ if (!calculateMinMaxHeight) {
1689
+ return;
1690
+ }
1691
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
1692
+ const positionToRect = positionTo.current.getBoundingClientRect();
1693
+ const offsetInPx = 16;
1694
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
1695
+ setMaxHeight(`${calculatedMaxHeight}px`);
1696
+ }
1697
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1698
+ (0, import_react9.useEffect)(() => {
1699
+ if (!show) {
1700
+ return;
1701
+ }
1702
+ initializeMenuFocus();
1703
+ updatePosition();
1704
+ }, [show, updatePosition]);
1705
+ (0, import_react9.useEffect)(() => {
1706
+ if (!show || !setShow) {
1707
+ return;
1708
+ }
1709
+ const handleEscapeKey = (event) => {
1710
+ var _a2;
1711
+ if (event.key !== "Escape") {
1712
+ return;
1713
+ }
1714
+ setShow(false);
1715
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.focus();
1716
+ };
1717
+ document.addEventListener("keydown", handleEscapeKey);
1718
+ return () => {
1719
+ document.removeEventListener("keydown", handleEscapeKey);
1720
+ };
1721
+ }, [show, setShow, positionTo]);
1722
+ return show && (0, import_react_dom.createPortal)(
1723
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1724
+ "div",
1725
+ __spreadProps(__spreadValues({
1726
+ id,
1727
+ "data-testid": testid,
1728
+ ref: setRefs,
1729
+ className: (0, import_clsx7.default)(
1730
+ "shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
1731
+ "fixed",
1732
+ "z-50",
1733
+ "max-w-screen",
1734
+ mobileHide && "opacity-0 pointer-events-none",
1735
+ className
1736
+ )
1737
+ }, props), {
1738
+ style: __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props.style), {
1739
+ maxHeight: customMaxHeight || maxHeight
1740
+ }), menuPosition), {
1741
+ minWidth: useDefaultMinWidth ? "212px" : menuPosition.minWidth
1742
+ }),
1743
+ onKeyDown: handleKeydown,
1744
+ onMouseDown: stopPropagation,
1745
+ onMouseUp: stopPropagation,
1746
+ onTouchStart: stopPropagation,
1747
+ onTouchEnd: stopPropagation,
1748
+ tabIndex: -1,
1749
+ "data-menu": menuName != null ? menuName : "",
1750
+ children: [
1751
+ mobileBackMenuOption == null ? void 0 : mobileBackMenuOption(),
1752
+ children
1753
+ ]
1754
+ })
1755
+ ),
1756
+ findDocumentRoot(internalRef.current)
1757
+ );
1758
+ function handleKeydown(e) {
1759
+ var _a2, _b2;
1760
+ if (!internalRef.current) {
1761
+ return;
1762
+ }
1763
+ if (e.key !== "Escape") {
1764
+ e.stopPropagation();
1765
+ }
1766
+ const menuOptions = Array.from(
1767
+ internalRef.current.querySelectorAll('[role="menuitem"]')
1768
+ );
1769
+ if (menuOptions.length === 0) {
1770
+ return;
1771
+ }
1772
+ let currentIndex = -1;
1773
+ const focusedElement = document.activeElement;
1774
+ for (let i = 0; i < menuOptions.length; i++) {
1775
+ if (menuOptions[i] === focusedElement) {
1776
+ currentIndex = i;
1777
+ break;
1778
+ }
1779
+ }
1780
+ switch (e.key) {
1781
+ case "ArrowDown": {
1782
+ e.preventDefault();
1783
+ const nextIndex = currentIndex < menuOptions.length - 1 ? currentIndex + 1 : 0;
1784
+ menuOptions[nextIndex].focus();
1785
+ break;
1786
+ }
1787
+ case "ArrowUp": {
1788
+ e.preventDefault();
1789
+ const prevIndex = currentIndex > 0 ? currentIndex - 1 : menuOptions.length - 1;
1790
+ menuOptions[prevIndex].focus();
1791
+ break;
1792
+ }
1793
+ case "Home":
1794
+ e.preventDefault();
1795
+ menuOptions[0].focus();
1796
+ break;
1797
+ case "End":
1798
+ e.preventDefault();
1799
+ menuOptions[menuOptions.length - 1].focus();
1800
+ break;
1801
+ case "Enter":
1802
+ case " ":
1803
+ case "ArrowRight":
1804
+ e.preventDefault();
1805
+ if (currentIndex >= 0) {
1806
+ menuOptions[currentIndex].click();
1807
+ }
1808
+ break;
1809
+ case "ArrowLeft":
1810
+ e.preventDefault();
1811
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.click();
1812
+ (_b2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _b2.focus();
1813
+ break;
1814
+ }
1815
+ }
1816
+ function initializeMenuFocus() {
1817
+ var _a2, _b2, _c;
1818
+ if (!autoFocusOff) {
1819
+ (_a2 = internalRef.current) == null ? void 0 : _a2.focus();
1820
+ }
1821
+ const selectedOption = (_b2 = internalRef.current) == null ? void 0 : _b2.querySelector(
1822
+ "[data-selected]"
1823
+ );
1824
+ const firstMenuItem = (_c = internalRef.current) == null ? void 0 : _c.querySelector(
1825
+ '[role="menuitem"]'
1826
+ );
1827
+ const targetElement = selectedOption || firstMenuItem;
1828
+ if (!targetElement) {
1829
+ return;
1830
+ }
1831
+ targetElement.scrollIntoView({
1832
+ block: "nearest",
1833
+ behavior: "instant"
1834
+ });
1835
+ if (autoFocusOff) {
1836
+ return;
1837
+ }
1838
+ requestAnimationFrame(() => {
1839
+ targetElement.focus();
1840
+ });
1841
+ }
1842
+ function setRefs(node) {
1843
+ internalRef.current = node;
1844
+ if (ref) {
1845
+ if (typeof ref === "function") {
1846
+ ref(node);
1847
+ } else {
1848
+ ref.current = node;
1849
+ }
1850
+ }
1851
+ }
1852
+ function stopPropagation(e) {
1853
+ e.stopPropagation();
1854
+ }
1855
+ };
1856
+ Menu.displayName = "Menu";
1857
+
1858
+ // src/components/Search.tsx
1859
+ var import_react10 = require("react");
1860
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1861
+ var Search = (_a) => {
1862
+ var _b = _a, {
1863
+ id,
1864
+ testid,
1865
+ label,
1866
+ error,
1867
+ children,
1868
+ readOnly,
1869
+ renderMenu,
1870
+ onClick,
1871
+ wrapperClassName,
1872
+ removeRoundness
1873
+ } = _b, props = __objRest(_b, [
1874
+ "id",
1875
+ "testid",
1876
+ "label",
1877
+ "error",
1878
+ "children",
1879
+ "readOnly",
1880
+ "renderMenu",
1881
+ "onClick",
1882
+ "wrapperClassName",
1883
+ "removeRoundness"
1884
+ ]);
1885
+ const inputRef = (0, import_react10.useRef)(null);
1886
+ const inputContainerRef = (0, import_react10.useRef)(null);
1887
+ const preventFocusOnInitialRender = (0, import_react10.useRef)(true);
1888
+ const [show, setShow] = (0, import_react10.useState)(false);
1889
+ const [clearing, setClearing] = (0, import_react10.useState)(false);
1890
+ const uniqueId = (0, import_react10.useId)();
1891
+ const searchMenuName = `search-menu-${uniqueId}`;
1892
+ (0, import_react10.useEffect)(() => {
1893
+ var _a2;
1894
+ if (preventFocusOnInitialRender.current) {
1895
+ preventFocusOnInitialRender.current = false;
1896
+ return;
1897
+ }
1898
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1899
+ }, [props.value]);
1900
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1901
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1902
+ Input,
1903
+ __spreadValues({
1904
+ id,
1905
+ testid,
1906
+ variant: "search",
1907
+ inputContainerRef,
1908
+ ref: inputRef,
1909
+ label,
1910
+ wrapperClassName,
1911
+ onClick: (e) => {
1912
+ if (props.disabled || readOnly) {
1913
+ return;
1914
+ }
1915
+ if (clearing) {
1916
+ setClearing(false);
1917
+ return;
1918
+ }
1919
+ onClick == null ? void 0 : onClick(e);
1920
+ setShow(!show);
1921
+ },
1922
+ onClear: () => {
1923
+ setClearing(true);
1924
+ },
1925
+ onKeyDown: (e) => {
1926
+ setShow(true);
1927
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
1928
+ e.preventDefault();
1929
+ const menu = document.querySelector(
1930
+ `[data-menu="${searchMenuName}"]`
1931
+ );
1932
+ const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
1933
+ if (selectedMenuOption) {
1934
+ const allMenuOptions = Array.from(
1935
+ (menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []
1936
+ );
1937
+ const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
1938
+ let targetOption;
1939
+ if (e.key === "ArrowDown") {
1940
+ targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
1941
+ } else {
1942
+ targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
1943
+ }
1944
+ targetOption == null ? void 0 : targetOption.focus();
1945
+ } else {
1946
+ const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
1947
+ '[role="menuitem"]:last-child'
1948
+ );
1949
+ toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
1950
+ }
1951
+ }
1952
+ },
1953
+ error,
1954
+ readOnly,
1955
+ removeRoundness,
1956
+ focus: renderMenu && show
1957
+ }, props)
1958
+ ),
1959
+ renderMenu ? renderMenu({
1960
+ id: id ? `${id}-menu` : void 0,
1961
+ testid: testid ? `${testid}-menu` : void 0,
1962
+ positionTo: inputContainerRef,
1963
+ show,
1964
+ setShow,
1965
+ topOffset: props.caption ? -16 : null,
1966
+ autoFocusOff: true,
1967
+ menuName: searchMenuName
1968
+ }) : children
1969
+ ] });
1970
+ };
1971
+ Search.displayName = "Search";
1972
+
1973
+ // src/components/DataGridCell.tsx
1974
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1975
+ var DataGridCell = (0, import_react11.memo)(
1976
+ (_a) => {
1977
+ var _b = _a, {
1978
+ id,
1979
+ type = "default",
1980
+ component = "static",
1981
+ children,
1982
+ className,
1983
+ locked = false,
1984
+ noPadding = false,
1985
+ paddedLeft = false,
1986
+ style,
1987
+ onClick,
1988
+ onRightClick,
1989
+ error,
1990
+ warning,
1991
+ center,
1992
+ width,
1993
+ minWidth,
1994
+ testid
1995
+ } = _b, props = __objRest(_b, [
1996
+ "id",
1997
+ "type",
1998
+ "component",
1999
+ "children",
2000
+ "className",
2001
+ "locked",
2002
+ "noPadding",
2003
+ "paddedLeft",
2004
+ "style",
2005
+ "onClick",
2006
+ "onRightClick",
2007
+ "error",
2008
+ "warning",
2009
+ "center",
2010
+ "width",
2011
+ "minWidth",
2012
+ "testid"
2013
+ ]);
2014
+ const Element = type === "header" ? "th" : "td";
2015
+ const timerRef = (0, import_react11.useRef)(null);
2016
+ const [isGrabbing, setIsGrabbing] = (0, import_react11.useState)(false);
2017
+ const [isPointerPressed, setIsPointerPressed] = (0, import_react11.useState)(false);
2018
+ (0, import_react11.useEffect)(() => {
2019
+ return () => {
2020
+ if (timerRef.current) {
2021
+ clearTimeout(timerRef.current);
2022
+ timerRef.current = null;
2023
+ }
2024
+ };
2025
+ }, []);
2026
+ const handlePointerDown = (_event) => {
2027
+ setIsPointerPressed(true);
2028
+ timerRef.current = window.setTimeout(() => {
2029
+ setIsGrabbing(true);
2030
+ }, 500);
2031
+ };
2032
+ const handlePointerUp = (event) => {
2033
+ if (timerRef.current) {
2034
+ clearTimeout(timerRef.current);
2035
+ timerRef.current = null;
2036
+ }
2037
+ const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
2038
+ if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
2039
+ onClick(event);
2040
+ }
2041
+ if (rightClick && onRightClick) {
2042
+ onRightClick();
2043
+ }
2044
+ setIsGrabbing(false);
2045
+ setIsPointerPressed(false);
2046
+ };
2047
+ const handlePointerLeave = () => {
2048
+ if (timerRef.current) {
2049
+ clearTimeout(timerRef.current);
2050
+ timerRef.current = null;
2051
+ }
2052
+ };
2053
+ const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
2054
+ const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
2055
+ const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && (0, import_clsx8.default)("border-r");
2056
+ const buttonComponentStyles = component === "button" && (0, import_clsx8.default)("border-r border-b border-border-primary-normal");
2057
+ const iconComponentStyles = component === "icon" && (0, import_clsx8.default)("border-l");
2058
+ const cellClasses = (0, import_clsx8.default)(
2059
+ headerTypeStyles,
2060
+ buttonComponentStyles,
2061
+ headerBgStyles,
2062
+ lockedHeaderBgStyles,
2063
+ iconComponentStyles,
2064
+ className,
2065
+ "flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
2066
+ "focus-within:!z-10",
2067
+ "overflow-x-hidden",
2068
+ "overflow-y-hidden",
2069
+ component === "input" && "border",
2070
+ component === "input" && !error && !warning && "border-border-primary-normal",
2071
+ component === "input" && error && "border-border-primary-error",
2072
+ component === "input" && warning && "border-background-warning-normal",
2073
+ !["button", "icon"].includes(component) && !noPadding && componentPadding,
2074
+ paddedLeft && "pl-2",
2075
+ component === "icon" && "border-l",
2076
+ isGrabbing && "!cursor-grabbing",
2077
+ component === "checkbox" || center && "justify-center"
2078
+ );
2079
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2080
+ Element,
2081
+ __spreadProps(__spreadValues({
2082
+ id,
2083
+ "data-testid": testid,
2084
+ className: (0, import_clsx8.default)("flex h-10", !width && "flex-1"),
2085
+ style: { width, minWidth }
2086
+ }, props), {
2087
+ "data-theme": type === "header" && !locked ? "brand" : void 0,
2088
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2089
+ "div",
2090
+ {
2091
+ className: cellClasses,
2092
+ style: __spreadValues({}, style),
2093
+ onMouseDown: handlePointerDown,
2094
+ onMouseUp: handlePointerUp,
2095
+ onMouseLeave: handlePointerLeave,
2096
+ onTouchStart: handlePointerDown,
2097
+ onTouchEnd: handlePointerUp,
2098
+ onTouchCancel: handlePointerLeave,
2099
+ onContextMenu: (e) => e.preventDefault(),
2100
+ children
2101
+ }
2102
+ )
2103
+ })
2104
+ );
2105
+ }
2106
+ );
2107
+ DataGridCell.displayName = "DataGridCell";
2108
+ function DataCellHeader(_a) {
2109
+ var _b = _a, {
2110
+ header,
2111
+ children,
2112
+ setNodeRef,
2113
+ node,
2114
+ id,
2115
+ testid,
2116
+ useMenuDefaultMinWidth
2117
+ } = _b, props = __objRest(_b, [
2118
+ "header",
2119
+ "children",
2120
+ "setNodeRef",
2121
+ "node",
2122
+ "id",
2123
+ "testid",
2124
+ "useMenuDefaultMinWidth"
2125
+ ]);
2126
+ var _a2;
2127
+ const [showMenu, setShowMenu] = (0, import_react11.useState)(false);
2128
+ const [filter, setFilter] = (0, import_react11.useState)(
2129
+ (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
2130
+ );
2131
+ const ref = (0, import_react11.useRef)(null);
2132
+ const predeterminedPinned = (0, import_react11.useRef)(false);
2133
+ const { column, getContext } = header;
2134
+ const { id: columnId, setFilterValue } = column;
2135
+ const {
2136
+ menuRootRef,
2137
+ isMenuActive,
2138
+ registerSubMenu,
2139
+ listeners: subMenuListeners,
2140
+ mobileHide
2141
+ } = useSubMenuSystem(node ? node : ref);
2142
+ (0, import_react11.useEffect)(() => {
2143
+ var _a3, _b2, _c;
2144
+ const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
2145
+ const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
2146
+ const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
2147
+ predeterminedPinned.current = [...left, ...right].includes(columnId);
2148
+ }, [columnId, getContext]);
2149
+ (0, import_react11.useEffect)(() => {
2150
+ const handler = setTimeout(() => {
2151
+ setFilterValue(filter);
2152
+ }, 500);
2153
+ return () => {
2154
+ clearTimeout(handler);
2155
+ };
2156
+ }, [filter, setFilterValue]);
2157
+ const style = __spreadValues({
2158
+ position: "relative",
2159
+ whiteSpace: "nowrap",
2160
+ minWidth: header.column.getSize(),
2161
+ "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
2162
+ "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
2163
+ "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
2164
+ }, props.style);
2165
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2166
+ DataGridCell,
2167
+ __spreadProps(__spreadValues({
2168
+ id,
2169
+ testid,
2170
+ ref: setNodeRef ? setNodeRef : ref,
2171
+ type: "header",
2172
+ component: "header",
2173
+ style,
2174
+ minWidth: `${header.column.getSize()}px`,
2175
+ onClick: header.column.getToggleSortingHandler(),
2176
+ onRightClick: () => setShowMenu(!showMenu)
2177
+ }, props), {
2178
+ children: [
2179
+ children,
2180
+ header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2181
+ Menu,
2182
+ {
2183
+ id: id ? `${id}-menu` : void 0,
2184
+ testid: testid ? `${testid}-menu` : void 0,
2185
+ ref: menuRootRef,
2186
+ positionTo: node ? node : ref,
2187
+ show: showMenu,
2188
+ setShow: setShowMenu,
2189
+ mobileHide,
2190
+ useDefaultMinWidth: useMenuDefaultMinWidth,
2191
+ children: [
2192
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2193
+ MenuOption,
2194
+ __spreadProps(__spreadValues({
2195
+ id: id ? `${id}-filter-option` : void 0,
2196
+ testid: testid ? `${testid}-filter-option` : void 0
2197
+ }, subMenuListeners), {
2198
+ subMenu: (_b2) => {
2199
+ var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
2200
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2201
+ Menu,
2202
+ __spreadProps(__spreadValues({
2203
+ id: id ? `${id}-filter-submenu` : void 0,
2204
+ testid: testid ? `${testid}-filter-submenu` : void 0
2205
+ }, props2), {
2206
+ show: isMenuActive(menuId, subMenuLevel),
2207
+ ref: (el) => {
2208
+ registerSubMenu(menuId, el);
2209
+ },
2210
+ useDefaultMinWidth: useMenuDefaultMinWidth,
2211
+ children: [
2212
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_clsx8.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2213
+ Search,
2214
+ {
2215
+ id: id ? `${id}-filter-search` : void 0,
2216
+ testid: testid ? `${testid}-filter-search` : void 0,
2217
+ onChange: (event) => {
2218
+ setFilter(event.target.value);
2219
+ },
2220
+ onKeyDown: (event) => {
2221
+ if ([" ", "Space"].includes(event.key)) {
2222
+ event.stopPropagation();
2223
+ }
2224
+ },
2225
+ value: filter != null ? filter : ""
2226
+ }
2227
+ ) }),
2228
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2229
+ MenuOption,
2230
+ {
2231
+ id: id ? `${id}-filter-contains` : void 0,
2232
+ testid: testid ? `${testid}-filter-contains` : void 0,
2233
+ onClick: handleFilterFnChange,
2234
+ before: menuOptionIcon("includesString"),
2235
+ children: "Contains"
2236
+ }
2237
+ ),
2238
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2239
+ MenuOption,
2240
+ {
2241
+ id: id ? `${id}-filter-startswith` : void 0,
2242
+ testid: testid ? `${testid}-filter-startswith` : void 0,
2243
+ onClick: handleFilterFnChange,
2244
+ before: menuOptionIcon("startsWith"),
2245
+ children: "Starts with"
2246
+ }
2247
+ ),
2248
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2249
+ MenuOption,
2250
+ {
2251
+ id: id ? `${id}-filter-endswith` : void 0,
2252
+ testid: testid ? `${testid}-filter-endswith` : void 0,
2253
+ onClick: handleFilterFnChange,
2254
+ before: menuOptionIcon("endsWith"),
2255
+ children: "Ends with"
2256
+ }
2257
+ )
2258
+ ]
2259
+ })
2260
+ );
2261
+ },
2262
+ children: "Filter"
2263
+ })
2264
+ ),
2265
+ !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2266
+ MenuOption,
2267
+ __spreadProps(__spreadValues({
2268
+ onClick: () => {
2269
+ setShowMenu(!showMenu);
2270
+ }
2271
+ }, subMenuListeners), {
2272
+ subMenu: (_d) => {
2273
+ var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
2274
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2275
+ Menu,
2276
+ __spreadProps(__spreadValues({}, props2), {
2277
+ show: isMenuActive(menuId, subMenuLevel),
2278
+ ref: (el) => {
2279
+ registerSubMenu(menuId, el);
2280
+ },
2281
+ children: [
2282
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2283
+ MenuOption,
2284
+ {
2285
+ selected: header.column.getIsPinned() === "left",
2286
+ onClick: () => {
2287
+ if (header.column.getIsPinned() === "left") {
2288
+ header.column.pin(false);
2289
+ } else {
2290
+ header.column.pin("left");
2291
+ }
2292
+ },
2293
+ after: header.column.getIsPinned() === "left" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "check" }),
2294
+ children: "Left"
2295
+ }
2296
+ ),
2297
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2298
+ MenuOption,
2299
+ {
2300
+ selected: header.column.getIsPinned() === "right",
2301
+ onClick: () => {
2302
+ if (header.column.getIsPinned() === "right") {
2303
+ header.column.pin(false);
2304
+ } else {
2305
+ header.column.pin("right");
2306
+ }
2307
+ },
2308
+ after: header.column.getIsPinned() === "right" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "check" }),
2309
+ children: "Right"
2310
+ }
2311
+ )
2312
+ ]
2313
+ })
2314
+ );
2315
+ },
2316
+ children: `Freeze [${header.column.columnDef.header}]`
2317
+ })
2318
+ )
2319
+ ]
2320
+ }
2321
+ )
2322
+ ]
2323
+ })
2324
+ );
2325
+ function menuOptionIcon(value) {
2326
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2327
+ Icon,
2328
+ {
2329
+ name: "check",
2330
+ className: (0, import_clsx8.default)(
2331
+ header.column.columnDef.filterFn !== value && "text-transparent"
2332
+ )
2333
+ }
2334
+ );
2335
+ }
2336
+ function handleFilterFnChange(_id, value) {
2337
+ let filterFn = "includesString";
2338
+ const currentFilterFn = header.column.columnDef.filterFn;
2339
+ if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
2340
+ filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
2341
+ }
2342
+ if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
2343
+ filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
2344
+ }
2345
+ if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
2346
+ filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
2347
+ }
2348
+ header.column.columnDef.filterFn = filterFn;
2349
+ header.column.setFilterValue(filter);
2350
+ }
2351
+ }
2352
+ DataCellHeader.displayName = "DataCellHeader";
2353
+ function DraggableCellHeader(_a) {
2354
+ var _b = _a, {
2355
+ header,
2356
+ children
2357
+ } = _b, props = __objRest(_b, [
2358
+ "header",
2359
+ "children"
2360
+ ]);
2361
+ const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
2362
+ id: header.column.id
2363
+ });
2364
+ const style = {
2365
+ opacity: isDragging ? 0.8 : 1,
2366
+ position: "relative",
2367
+ transform: CSS.Translate.toString(transform),
2368
+ transition: "width transform 0.2s ease-in-out",
2369
+ whiteSpace: "nowrap",
2370
+ zIndex: isDragging ? 1 : 0,
2371
+ "--color-text-primary-normal": "var(--color-action-000)",
2372
+ "--color-icon-on-action-primary-normal": "var(--color-action-000)",
2373
+ userSelect: "none"
2374
+ };
2375
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2376
+ DataCellHeader,
2377
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues({
2378
+ header,
2379
+ setNodeRef,
2380
+ node,
2381
+ style
2382
+ }, props), attributes), listeners), {
2383
+ children
2384
+ })
2385
+ );
2386
+ }
2387
+ DraggableCellHeader.displayName = "DraggableCellHeader";
2388
+ function DragAlongCell(_a) {
2389
+ var _b = _a, {
2390
+ cell,
2391
+ children
2392
+ } = _b, props = __objRest(_b, [
2393
+ "cell",
2394
+ "children"
2395
+ ]);
2396
+ const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
2397
+ id: cell.column.id
2398
+ });
2399
+ const style = {
2400
+ opacity: isDragging ? 0.8 : 1,
2401
+ position: "relative",
2402
+ transform: CSS.Translate.toString(transform),
2403
+ transition: "width transform 0.2s ease-in-out",
2404
+ minWidth: cell.column.getSize(),
2405
+ zIndex: isDragging ? 1 : 0
2406
+ };
2407
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
2408
+ }
2409
+ DragAlongCell.displayName = "DragAlongCell";
2410
+
2411
+ // src/components/DataGrid/index.tsx
2412
+ var import_react16 = __toESM(require("react"), 1);
2413
+ var import_react_table3 = require("@tanstack/react-table");
2414
+ var import_core = require("@dnd-kit/core");
2415
+ var import_sortable2 = require("@dnd-kit/sortable");
2416
+ var import_modifiers = require("@dnd-kit/modifiers");
2417
+ var import_react_virtual2 = require("@tanstack/react-virtual");
2418
+ var import_clsx13 = __toESM(require("clsx"), 1);
2419
+
2420
+ // src/components/DataGrid/PinnedColumns.tsx
2421
+ var import_react_table2 = require("@tanstack/react-table");
2422
+ var import_clsx12 = __toESM(require("clsx"), 1);
2423
+
2424
+ // src/components/DataGrid/utils.tsx
2425
+ var import_clsx9 = __toESM(require("clsx"), 1);
2426
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2427
+ function getSortIcon(sort, nextSort = false) {
2428
+ const iconClassName = (0, import_clsx9.default)(
2429
+ "text-icon-on-action-primary-normal",
2430
+ nextSort && "hidden group-hover:block"
2431
+ );
2432
+ if (sort === "asc")
2433
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_upward" });
2434
+ if (sort === "desc")
2435
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_downward" });
2436
+ return null;
2437
+ }
2438
+
2439
+ // src/components/DataGrid/PinnedColumns.tsx
2440
+ var import_react15 = __toESM(require("react"), 1);
2441
+
2442
+ // src/components/DataGrid/TableBody/index.tsx
2443
+ var import_react_virtual = require("@tanstack/react-virtual");
2444
+ var import_clsx11 = __toESM(require("clsx"), 1);
2445
+
2446
+ // src/components/DataGrid/TableBody/TableBodyRow.tsx
2447
+ var import_clsx10 = __toESM(require("clsx"), 1);
2448
+ var import_react_table = require("@tanstack/react-table");
2449
+ var import_react12 = __toESM(require("react"), 1);
2450
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2451
+ function TableBodyRow({
2452
+ id,
2453
+ testid,
2454
+ columnVirtualizer,
2455
+ row,
2456
+ // rowVirtualizer,
2457
+ virtualPaddingLeft,
2458
+ virtualPaddingRight,
2459
+ virtualRow,
2460
+ showFilterRow,
2461
+ enableColumnSelector = false,
2462
+ locked,
2463
+ pinDirection
2464
+ }) {
2465
+ var _a;
2466
+ let visibleCells;
2467
+ if (locked) {
2468
+ visibleCells = pinDirection === "left" ? row.getLeftVisibleCells() : row.getRightVisibleCells();
2469
+ } else {
2470
+ visibleCells = row.getCenterVisibleCells();
2471
+ }
2472
+ const virtualColumns = (_a = columnVirtualizer == null ? void 0 : columnVirtualizer.getVirtualItems()) != null ? _a : [];
2473
+ const columns = locked ? visibleCells : virtualColumns;
2474
+ const isError = typeof row.original === "object" && row.original !== null && "rowState" in row.original && row.original.rowState === "error";
2475
+ const CellElement = locked ? DataGridCell : DragAlongCell;
2476
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2477
+ "tr",
2478
+ {
2479
+ className: (0, import_clsx10.default)(
2480
+ "min-h-10",
2481
+ "transition-colors hover:bg-background-action-secondary-hover",
2482
+ row.getIsSelected() && "!bg-background-action-secondary-hover",
2483
+ isError && "!bg-background-action-critical-secondary-hover",
2484
+ showFilterRow ? "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal" : "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
2485
+ ),
2486
+ id: id ? `${id}-row-${row.id}` : void 0,
2487
+ "data-testid": testid ? `${testid}-row-${row.id}` : void 0,
2488
+ style: {
2489
+ display: "flex",
2490
+ position: "absolute",
2491
+ transform: `translateY(${showFilterRow ? virtualRow.start + 40 : virtualRow.start}px)`,
2492
+ width: "100%"
2493
+ },
2494
+ children: [
2495
+ !locked && virtualPaddingLeft ? (
2496
+ // fake empty column to the left for virtualization scroll padding
2497
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
2498
+ ) : null,
2499
+ columns.map((column) => {
2500
+ var _a2, _b;
2501
+ const cell = locked ? column : visibleCells[column.index];
2502
+ if (!cell) {
2503
+ return;
2504
+ }
2505
+ const cellAlignment = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.align;
2506
+ const cellValue = cell.getValue();
2507
+ return ((_b = cell.column.columnDef.meta) == null ? void 0 : _b.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2508
+ CellElement,
2509
+ {
2510
+ id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
2511
+ testid: testid ? `${testid}-row-${row.id}-cell-${cell.id}` : void 0,
2512
+ cell,
2513
+ className: (0, import_clsx10.default)(
2514
+ cellAlignment ? {
2515
+ "justify-start": cellAlignment === "left",
2516
+ "justify-end": cellAlignment === "right"
2517
+ } : {
2518
+ "justify-end": typeof cellValue === "number"
2519
+ }
2520
+ ),
2521
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2522
+ Tooltip,
2523
+ {
2524
+ id: id ? `${id}-tooltip-${cell.id}` : void 0,
2525
+ testid: testid ? `${testid}-tooltip-${cell.id}` : void 0,
2526
+ showOnTruncation: true,
2527
+ message: cellValue,
2528
+ position: "bottom",
2529
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
2530
+ }
2531
+ )
2532
+ },
2533
+ cell.id
2534
+ );
2535
+ }),
2536
+ !locked && virtualPaddingRight ? (
2537
+ // fake empty column to the right for virtualization scroll padding
2538
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
2539
+ ) : null,
2540
+ enableColumnSelector && !locked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: "p-2", style: { width: "48.8px" } })
2541
+ ]
2542
+ },
2543
+ row.id
2544
+ );
2545
+ }
2546
+
2547
+ // src/components/DataGrid/TableBody/LoadingCell.tsx
2548
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2549
+ function LoadingCell({
2550
+ id,
2551
+ testid,
2552
+ column
2553
+ }) {
2554
+ const key = `loading-${column.id}`;
2555
+ if (column.cell === "checkbox") {
2556
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Checkbox, { id: id ? `${id}-${key}-checkbox` : void 0, testid: testid ? `${testid}-${key}-checkbox` : void 0, disabled: true }) }, key);
2557
+ }
2558
+ if (column.cell === "input") {
2559
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2560
+ DataGridCell,
2561
+ {
2562
+ id: id ? `${id}-${key}` : void 0,
2563
+ testid: testid ? `${testid}-${key}` : void 0,
2564
+ component: "input",
2565
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2566
+ Input,
2567
+ {
2568
+ id: id ? `${id}-${key}-input` : void 0,
2569
+ testid: testid ? `${testid}-${key}-input` : void 0,
2570
+ align: "left",
2571
+ disabled: true,
2572
+ wrapperClassName: "!rounded-none !border-0"
2573
+ }
2574
+ )
2575
+ },
2576
+ key
2577
+ );
2578
+ }
2579
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
2580
+ }
2581
+
2582
+ // src/components/DataGrid/TableBody/index.tsx
2583
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2584
+ function TableBody({
2585
+ id,
2586
+ testid,
2587
+ columnVirtualizer,
2588
+ table,
2589
+ tableContainerRef,
2590
+ virtualPaddingLeft,
2591
+ virtualPaddingRight,
2592
+ pagination,
2593
+ isLoadingMore,
2594
+ hasMore,
2595
+ showFilterRow,
2596
+ enableColumnSelector = false,
2597
+ locked,
2598
+ pinDirection
2599
+ }) {
2600
+ const { rows } = table.getRowModel();
2601
+ const rowVirtualizer = (0, import_react_virtual.useVirtualizer)({
2602
+ count: rows.length,
2603
+ estimateSize: () => 40,
2604
+ getScrollElement: () => tableContainerRef.current,
2605
+ overscan: 8
2606
+ });
2607
+ const virtualRows = rowVirtualizer.getVirtualItems();
2608
+ const CellElement = locked ? DataGridCell : DragAlongCell;
2609
+ let headerGroups;
2610
+ if (pinDirection === "left") {
2611
+ headerGroups = table.getLeftHeaderGroups();
2612
+ } else if (pinDirection === "right") {
2613
+ headerGroups = table.getRightHeaderGroups();
2614
+ } else {
2615
+ headerGroups = table.getCenterHeaderGroups();
2616
+ }
2617
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2618
+ "tbody",
2619
+ {
2620
+ className: (0, import_clsx11.default)(locked ? "shadow-16" : ""),
2621
+ style: {
2622
+ display: "grid",
2623
+ height: `${showFilterRow ? rowVirtualizer.getTotalSize() + 40 : rowVirtualizer.getTotalSize()}px`,
2624
+ // tells scrollbar how big the table is
2625
+ position: "relative"
2626
+ // needed for absolute positioning of rows
2627
+ },
2628
+ children: [
2629
+ showFilterRow && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2630
+ "tr",
2631
+ {
2632
+ style: {
2633
+ display: "flex",
2634
+ position: "sticky",
2635
+ top: "40px",
2636
+ width: "100%",
2637
+ height: "40px",
2638
+ zIndex: 10
2639
+ },
2640
+ className: "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal",
2641
+ "data-testid": testid ? `${testid}-filter-row` : void 0,
2642
+ children: headerGroups.flatMap(
2643
+ (x) => x.headers.map((header) => {
2644
+ var _a, _b, _c, _d, _e;
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2646
+ CellElement,
2647
+ {
2648
+ id: id ? `${id}-filter-cell-${header.id}` : void 0,
2649
+ testid: testid ? `${testid}-filter-cell-${header.id}` : void 0,
2650
+ noPadding: true,
2651
+ cell: header,
2652
+ width: ((_a = header.column.columnDef.meta) == null ? void 0 : _a.headerWidth) || (locked ? `${header.column.getSize()}px` : ""),
2653
+ children: header.column.getCanFilter() && ((_e = (_c = (_b = header.column.columnDef.meta) == null ? void 0 : _b.filterRowCell) == null ? void 0 : _c.call(_b, {
2654
+ header,
2655
+ table
2656
+ })) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2657
+ Search,
2658
+ {
2659
+ id: id ? `${id}-filter-search-${header.id}` : void 0,
2660
+ testid: testid ? `${testid}-filter-search-${header.id}` : void 0,
2661
+ removeRoundness: true,
2662
+ onChange: (e) => header.column.setFilterValue(e.target.value),
2663
+ value: (_d = header.column.getFilterValue()) != null ? _d : "",
2664
+ placeholder: "",
2665
+ removeSearchIcon: true
2666
+ }
2667
+ ))
2668
+ },
2669
+ header.id
2670
+ );
2671
+ })
2672
+ )
2673
+ }
2674
+ ),
2675
+ virtualRows.map((virtualRow) => {
2676
+ const row = rows[virtualRow.index];
2677
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2678
+ TableBodyRow,
2679
+ {
2680
+ id,
2681
+ testid,
2682
+ columnVirtualizer,
2683
+ row,
2684
+ rowVirtualizer,
2685
+ virtualPaddingLeft,
2686
+ virtualPaddingRight,
2687
+ virtualRow,
2688
+ showFilterRow,
2689
+ enableColumnSelector,
2690
+ locked,
2691
+ pinDirection
2692
+ },
2693
+ row.id
2694
+ );
2695
+ }),
2696
+ !pagination && isLoadingMore && hasMore && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2697
+ "tr",
2698
+ {
2699
+ style: {
2700
+ display: "flex",
2701
+ position: "absolute",
2702
+ width: "100%",
2703
+ transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
2704
+ },
2705
+ className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
2706
+ children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2707
+ LoadingCell,
2708
+ {
2709
+ id,
2710
+ testid,
2711
+ column: column.columnDef
2712
+ },
2713
+ column.id
2714
+ ))
2715
+ }
2716
+ )
2717
+ ]
2718
+ }
2719
+ );
2720
+ }
2721
+
2722
+ // src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
2723
+ var import_react14 = require("react");
2724
+
2725
+ // src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
2726
+ var import_react13 = require("react");
2727
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2728
+ function ColumnSelectorMenuOption({
2729
+ id,
2730
+ testid,
2731
+ column,
2732
+ toggleColumnVisibility
2733
+ }) {
2734
+ const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
2735
+ const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
2736
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuOption, { id, testid, selected: isVisible, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2737
+ Checkbox,
2738
+ {
2739
+ id: id ? `${id}-checkbox` : void 0,
2740
+ testid: testid ? `${testid}-checkbox` : void 0,
2741
+ label: label != null ? label : "Unknown",
2742
+ checked: isVisible,
2743
+ onChange: (e) => {
2744
+ setIsVisible(e.target.checked);
2745
+ toggleColumnVisibility(column.id, e.target.checked);
2746
+ }
2747
+ }
2748
+ ) });
2749
+ }
2750
+
2751
+ // src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
2752
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2753
+ function ColumnSelectorHeaderCell({
2754
+ id,
2755
+ testid,
2756
+ table,
2757
+ toggleColumnVisibility,
2758
+ resetColumnVisibility
2759
+ }) {
2760
+ const ref = (0, import_react14.useRef)(null);
2761
+ const [show, setShow] = (0, import_react14.useState)(false);
2762
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2763
+ DataGridCell,
2764
+ {
2765
+ id,
2766
+ testid,
2767
+ width: "48px",
2768
+ type: "header",
2769
+ color: "text-secondary-normal",
2770
+ ref,
2771
+ children: [
2772
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2773
+ Button,
2774
+ {
2775
+ id: id ? `${id}-button` : void 0,
2776
+ testid: testid ? `${testid}-button` : void 0,
2777
+ onClick: () => setShow((prev) => !prev),
2778
+ variant: "navigation",
2779
+ iconOnly: true,
2780
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "tune" })
2781
+ }
2782
+ ),
2783
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2784
+ Menu,
2785
+ {
2786
+ id: id ? `${id}-menu` : void 0,
2787
+ testid: testid ? `${testid}-menu` : void 0,
2788
+ positionTo: ref,
2789
+ position: "bottom-right",
2790
+ show,
2791
+ setShow,
2792
+ calculateMinMaxHeight: true,
2793
+ children: [
2794
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2795
+ Button,
2796
+ {
2797
+ id: id ? `${id}-reset-button` : void 0,
2798
+ testid: testid ? `${testid}-reset-button` : void 0,
2799
+ variant: "tertiary",
2800
+ onClick: () => {
2801
+ resetColumnVisibility();
2802
+ setShow(false);
2803
+ },
2804
+ children: "Reset to default"
2805
+ }
2806
+ ),
2807
+ table.getAllColumns().filter((x) => {
2808
+ var _a;
2809
+ return (_a = x.columnDef.meta) == null ? void 0 : _a.inVisibilityMenu;
2810
+ }).map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2811
+ ColumnSelectorMenuOption,
2812
+ {
2813
+ id: id ? `${id}-option-${column.id}` : void 0,
2814
+ testid: testid ? `${testid}-option-${column.id}` : void 0,
2815
+ column,
2816
+ toggleColumnVisibility
2817
+ },
2818
+ column.id
2819
+ ))
2820
+ ]
2821
+ }
2822
+ )
2823
+ ]
2824
+ }
2825
+ );
2826
+ }
2827
+
2828
+ // src/components/DataGrid/PinnedColumns.tsx
2829
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2830
+ function PinnedColumns(_a) {
2831
+ var _b = _a, {
2832
+ id,
2833
+ pinDirection = "left",
2834
+ table,
2835
+ centerHeader,
2836
+ allSelectedAcrossPages,
2837
+ someSelectedAcrossPages,
2838
+ toggleSelectAllAcrossPages,
2839
+ testid,
2840
+ enableColumnSelector,
2841
+ toggleColumnVisibility,
2842
+ resetColumnVisibility
2843
+ } = _b, props = __objRest(_b, [
2844
+ "id",
2845
+ "pinDirection",
2846
+ "table",
2847
+ "centerHeader",
2848
+ "allSelectedAcrossPages",
2849
+ "someSelectedAcrossPages",
2850
+ "toggleSelectAllAcrossPages",
2851
+ "testid",
2852
+ "enableColumnSelector",
2853
+ "toggleColumnVisibility",
2854
+ "resetColumnVisibility"
2855
+ ]);
2856
+ var _a2;
2857
+ const headerGroups = pinDirection === "left" ? table.getLeftHeaderGroups() : table.getRightHeaderGroups();
2858
+ const pinnedTestId = testid ? `${pinDirection}-pinned-${testid}` : void 0;
2859
+ const hasAnyHeaders = ((_a2 = headerGroups[0]) == null ? void 0 : _a2.headers.length) > 0;
2860
+ if (!hasAnyHeaders && !enableColumnSelector) return;
2861
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2862
+ "table",
2863
+ {
2864
+ className: (0, import_clsx12.default)(
2865
+ "flex flex-col min-h-min sticky z-20",
2866
+ pinDirection === "left" ? "left-0" : "right-0"
2867
+ ),
2868
+ "data-testid": pinnedTestId,
2869
+ children: [
2870
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: "sticky top-0 z-20 grid", children: headerGroups.map((headerGroup) => {
2871
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2872
+ "tr",
2873
+ {
2874
+ "data-testid": pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : void 0,
2875
+ className: "flex w-full",
2876
+ children: [
2877
+ headerGroup.headers.map((header) => {
2878
+ var _a3, _b2, _c;
2879
+ if (!header) {
2880
+ return;
2881
+ }
2882
+ if (typeof header.column.columnDef.header === "string") {
2883
+ const customHeaderWidth = (_a3 = header.column.columnDef.meta) == null ? void 0 : _a3.headerWidth;
2884
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2885
+ DataCellHeader,
2886
+ {
2887
+ locked: true,
2888
+ testid: pinnedTestId ? `${pinnedTestId}-header-${header.id}` : void 0,
2889
+ header,
2890
+ center: centerHeader,
2891
+ width: customHeaderWidth,
2892
+ className: (0, import_clsx12.default)(
2893
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
2894
+ "group"
2895
+ ),
2896
+ children: [
2897
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
2898
+ getSortIcon(header.column.getIsSorted()),
2899
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(header.column.getNextSortingOrder(), true),
2900
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
2901
+ !((_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2902
+ "div",
2903
+ {
2904
+ onDoubleClick: (e) => {
2905
+ e.stopPropagation();
2906
+ header.column.resetSize();
2907
+ },
2908
+ onMouseDown: (e) => {
2909
+ e.stopPropagation();
2910
+ header.getResizeHandler()(e);
2911
+ },
2912
+ onTouchStart: (e) => {
2913
+ e.stopPropagation();
2914
+ header.getResizeHandler()(e);
2915
+ },
2916
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
2917
+ }
2918
+ )
2919
+ ]
2920
+ },
2921
+ header.id
2922
+ );
2923
+ }
2924
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.default.Fragment, { children: ((_c = header.column.columnDef.meta) == null ? void 0 : _c.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2925
+ Checkbox,
2926
+ {
2927
+ checked: allSelectedAcrossPages,
2928
+ indeterminate: someSelectedAcrossPages,
2929
+ onChange: toggleSelectAllAcrossPages
2930
+ }
2931
+ ) }) : (0, import_react_table2.flexRender)(
2932
+ header.column.columnDef.header,
2933
+ header.getContext()
2934
+ ) }, header.id);
2935
+ }),
2936
+ enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2937
+ ColumnSelectorHeaderCell,
2938
+ {
2939
+ id: id ? `${id}-column-selector` : void 0,
2940
+ testid: testid ? `${testid}-column-selector` : void 0,
2941
+ table,
2942
+ toggleColumnVisibility: toggleColumnVisibility != null ? toggleColumnVisibility : () => {
2943
+ },
2944
+ resetColumnVisibility: resetColumnVisibility != null ? resetColumnVisibility : () => {
2945
+ }
2946
+ }
2947
+ )
2948
+ ]
2949
+ },
2950
+ headerGroup.id
2951
+ );
2952
+ }) }),
2953
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2954
+ TableBody,
2955
+ __spreadProps(__spreadValues({
2956
+ testid: pinnedTestId
2957
+ }, props), {
2958
+ table,
2959
+ locked: !enableColumnSelector,
2960
+ pinDirection
2961
+ })
2962
+ )
2963
+ ]
2964
+ }
2965
+ );
2966
+ }
2967
+
2968
+ // static/no-results-image.png
2969
+ var no_results_image_default = "data:image/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q9aQ20XHFjScviFpZANYMy8GPCt8hAIQGAQAa0Qhui3tNq6M0iTER7+xghlUER+BOS4L1p6zZIChJctvWLpJUup5V1T4CNL71i6fJres9fPLCEQgAAEhhJQ//e3ln7UI6NP7Jn/a+kfLbnvkwgAetRw5Y9Mzf5vW1JQ0AQKi0j02fcWL7R4/we75+0l9+maGpFeLy19aAmBAAQgMAYB9XUzS39u6aUNBWpi8gtL/2zJ/cDf2EIA0JDgNSYB7a+9+rSAj+z1/ZiFkTcEIACBwAR2LT+tgmqCsyhafdQE5ePFi7yHAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQg4J/D/AQUY8n0knD4qAAAAAElFTkSuQmCC";
2970
+
2971
+ // src/components/DataGrid/index.tsx
2972
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2973
+ var PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
2974
+ var NO_RESULTS_HEIGHT = "h-[185px]";
2975
+ function DataGrid({
2976
+ id,
2977
+ rowIdAccessor,
2978
+ testid,
2979
+ data,
2980
+ columns,
2981
+ status,
2982
+ isLoadingMore = false,
2983
+ onLoadMore,
2984
+ pagination,
2985
+ showFilterRow = false,
2986
+ hasMore = false,
2987
+ sorting: externalSorting,
2988
+ onSortingChange,
2989
+ columnFilters: externalColumnFilters,
2990
+ onColumnFiltersChange,
2991
+ rowSelection: externalRowSelection,
2992
+ onRowSelectionChange,
2993
+ filteredSortedData,
2994
+ totalRowCount,
2995
+ hideStatusBar,
2996
+ centerHeader,
2997
+ enableColumnSelector,
2998
+ predeterminedLeftPins = [],
2999
+ predeterminedRightPins = [],
3000
+ useMenuDefaultMinWidth
3001
+ }) {
3002
+ var _a, _b, _c, _d, _e, _f, _g;
3003
+ const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
3004
+ const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
3005
+ const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
3006
+ const { columns: tableColumns, setColumns: setTableColumns } = useTableLayout(columns, id != null ? id : testid);
3007
+ const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
3008
+ tableColumns.map((c) => c.id)
3009
+ );
3010
+ const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
3011
+ Object.fromEntries(
3012
+ tableColumns.filter((column) => !!column.id).map((column) => {
3013
+ var _a2, _b2;
3014
+ return [column.id, (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true];
3015
+ })
3016
+ )
3017
+ );
3018
+ const resetColumnVisibility = (0, import_react16.useCallback)(
3019
+ (updateOrder) => {
3020
+ setColumnVisibility(
3021
+ Object.fromEntries(
3022
+ tableColumns.filter((column) => !!column.id).map((column) => {
3023
+ var _a2, _b2;
3024
+ return [column.id, (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true];
3025
+ })
3026
+ )
3027
+ );
3028
+ if (updateOrder) setColumnOrder(tableColumns.map((c) => c.id));
3029
+ },
3030
+ [tableColumns]
3031
+ );
3032
+ (0, import_react16.useEffect)(() => {
3033
+ resetColumnVisibility(true);
3034
+ }, [resetColumnVisibility]);
3035
+ const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
3036
+ const setSortingState = pagination ? (updaterOrValue) => {
3037
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(
3038
+ externalSorting != null ? externalSorting : []
3039
+ ) : updaterOrValue;
3040
+ (onSortingChange != null ? onSortingChange : setLocalSorting)(value);
3041
+ } : setLocalSorting;
3042
+ const columnFilterState = pagination ? externalColumnFilters != null ? externalColumnFilters : localColumnFilters : localColumnFilters;
3043
+ const setColumnFilterState = pagination ? (updaterOrValue) => {
3044
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalColumnFilters != null ? externalColumnFilters : []) : updaterOrValue;
3045
+ (onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
3046
+ } : setLocalColumnFilters;
3047
+ const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
3048
+ const setRowSelection = (0, import_react16.useCallback)(
3049
+ (updaterOrValue) => {
3050
+ if (pagination) {
3051
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
3052
+ (onRowSelectionChange != null ? onRowSelectionChange : setLocalRowSelection)(value);
3053
+ } else if (externalRowSelection && onRowSelectionChange) {
3054
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
3055
+ onRowSelectionChange(value);
3056
+ } else {
3057
+ setLocalRowSelection(updaterOrValue);
3058
+ }
3059
+ },
3060
+ [externalRowSelection, onRowSelectionChange, pagination]
3061
+ );
3062
+ const dndId = (0, import_react16.useId)();
3063
+ const containerRef = import_react16.default.useRef(null);
3064
+ const toggleColumnVisibility = (0, import_react16.useCallback)(
3065
+ (columnId, isVisible) => {
3066
+ setTableColumns((prev) => {
3067
+ const persistedIndex = prev.findIndex((col) => col.id === columnId);
3068
+ if (persistedIndex !== -1) {
3069
+ prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
3070
+ visible: isVisible
3071
+ });
3072
+ }
3073
+ return [...prev];
3074
+ }, true);
3075
+ },
3076
+ [setTableColumns]
3077
+ );
3078
+ const table = (0, import_react_table3.useReactTable)({
3079
+ columns: tableColumns,
3080
+ data,
3081
+ getCoreRowModel: (0, import_react_table3.getCoreRowModel)(),
3082
+ getSortedRowModel: (0, import_react_table3.getSortedRowModel)(),
3083
+ getFilteredRowModel: (0, import_react_table3.getFilteredRowModel)(),
3084
+ columnResizeMode: "onChange",
3085
+ getRowId: rowIdAccessor ? (row) => String(row[rowIdAccessor]) : (row, index) => {
3086
+ var _a2;
3087
+ return String((_a2 = row.id) != null ? _a2 : index + 1);
3088
+ },
3089
+ state: {
3090
+ columnOrder,
3091
+ sorting: sortingState,
3092
+ columnFilters: columnFilterState,
3093
+ rowSelection,
3094
+ columnVisibility
3095
+ },
3096
+ initialState: {
3097
+ columnPinning: {
3098
+ left: predeterminedLeftPins,
3099
+ right: predeterminedRightPins
3100
+ }
3101
+ },
3102
+ enableColumnPinning: (predeterminedLeftPins == null ? void 0 : predeterminedLeftPins.length) > 0 || predeterminedRightPins.length > 0,
3103
+ onColumnOrderChange: setColumnOrder,
3104
+ onSortingChange: adaptTableStateSetter(setSortingState),
3105
+ onColumnFiltersChange: adaptTableStateSetter(setColumnFilterState),
3106
+ onRowSelectionChange: adaptTableStateSetter(setRowSelection),
3107
+ filterFns: {
3108
+ startsWith: (row, columnId, filterValue) => {
3109
+ const cellValue = row == null ? void 0 : row.getValue(columnId);
3110
+ if (!cellValue || !filterValue) {
3111
+ return true;
3112
+ }
3113
+ return String(cellValue).toLowerCase().startsWith(String(filterValue).toLowerCase());
3114
+ },
3115
+ endsWith: (row, columnId, filterValue) => {
3116
+ const cellValue = row == null ? void 0 : row.getValue(columnId);
3117
+ if (!cellValue || !filterValue) {
3118
+ return true;
3119
+ }
3120
+ return String(cellValue).toLowerCase().endsWith(String(filterValue).toLowerCase());
3121
+ }
3122
+ }
3123
+ });
3124
+ const allRowIds = pagination ? (_a = filteredSortedData == null ? void 0 : filteredSortedData.map((row) => String(row.id))) != null ? _a : [] : Array.from(
3125
+ { length: totalRowCount != null ? totalRowCount : data.length },
3126
+ (_, i) => String(i + 1)
3127
+ );
3128
+ const allSelectedAcrossPages = allRowIds.every(
3129
+ (rowId) => rowSelection[rowId]
3130
+ );
3131
+ const someSelectedAcrossPages = !allSelectedAcrossPages && allRowIds.some((rowId) => rowSelection[rowId]);
3132
+ const toggleSelectAllAcrossPages = () => {
3133
+ setRowSelection((prev) => {
3134
+ const isSelecting = !allSelectedAcrossPages;
3135
+ if (isSelecting) {
3136
+ const newSelection = {};
3137
+ for (const rowId of allRowIds) {
3138
+ newSelection[rowId] = true;
3139
+ }
3140
+ return __spreadValues(__spreadValues({}, prev), newSelection);
3141
+ } else {
3142
+ const updatedSelection = __spreadValues({}, prev);
3143
+ for (const rowId of allRowIds) {
3144
+ delete updatedSelection[rowId];
3145
+ }
3146
+ return updatedSelection;
3147
+ }
3148
+ });
3149
+ };
3150
+ useInfiniteScroll({
3151
+ containerRef,
3152
+ onLoadMore: onLoadMore != null ? onLoadMore : () => {
3153
+ },
3154
+ isLoading: isLoadingMore,
3155
+ enabled: !pagination
3156
+ });
3157
+ const handleDragEnd = (event) => {
3158
+ const { active, over } = event;
3159
+ if (active && over && active.id !== over.id) {
3160
+ setColumnOrder((prev) => {
3161
+ const oldIndex = prev.indexOf(active.id);
3162
+ const newIndex = prev.indexOf(over.id);
3163
+ const newOrder = (0, import_sortable2.arrayMove)(prev, oldIndex, newIndex);
3164
+ setTableColumns((prev2) => {
3165
+ const res = newOrder.map((id2) => prev2.find((col) => col.id === id2)).filter(Boolean);
3166
+ return res;
3167
+ });
3168
+ return newOrder;
3169
+ });
3170
+ }
3171
+ };
3172
+ const sensors = (0, import_core.useSensors)(
3173
+ (0, import_core.useSensor)(import_core.MouseSensor),
3174
+ (0, import_core.useSensor)(import_core.TouchSensor),
3175
+ (0, import_core.useSensor)(import_core.KeyboardSensor)
3176
+ );
3177
+ const visibleColumns = table.getVisibleLeafColumns();
3178
+ const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
3179
+ count: visibleColumns.length,
3180
+ estimateSize: (index) => visibleColumns[index].getSize(),
3181
+ //estimate width of each column for accurate scrollbar dragging
3182
+ getScrollElement: () => containerRef.current,
3183
+ horizontal: true,
3184
+ overscan: 8
3185
+ //how many columns to render on each side off screen each way
3186
+ });
3187
+ const virtualColumns = columnVirtualizer.getVirtualItems();
3188
+ let virtualPaddingLeft;
3189
+ let virtualPaddingRight;
3190
+ if (columnVirtualizer && (virtualColumns == null ? void 0 : virtualColumns.length)) {
3191
+ virtualPaddingLeft = (_c = (_b = virtualColumns[0]) == null ? void 0 : _b.start) != null ? _c : 0;
3192
+ virtualPaddingRight = columnVirtualizer.getTotalSize() - ((_e = (_d = virtualColumns[virtualColumns.length - 1]) == null ? void 0 : _d.end) != null ? _e : 0);
3193
+ }
3194
+ const empty = table.getRowModel().rows.length === 0;
3195
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3196
+ import_core.DndContext,
3197
+ {
3198
+ id: dndId,
3199
+ collisionDetection: import_core.closestCenter,
3200
+ modifiers: [import_modifiers.restrictToHorizontalAxis],
3201
+ onDragEnd: handleDragEnd,
3202
+ sensors,
3203
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3204
+ import_sortable2.SortableContext,
3205
+ {
3206
+ items: columnOrder,
3207
+ strategy: import_sortable2.horizontalListSortingStrategy,
3208
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3209
+ "div",
3210
+ {
3211
+ id,
3212
+ "data-testid": testid,
3213
+ className: "flex flex-col flex-1 h-full w-full rounded border border-border-primary-normal overflow-hidden text-text-primary-normal",
3214
+ children: [
3215
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3216
+ "div",
3217
+ {
3218
+ className: (0, import_clsx13.default)(
3219
+ "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
3220
+ empty ? "overflow-y-hidden" : "min-h-[120px]"
3221
+ ),
3222
+ ref: containerRef,
3223
+ children: [
3224
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3225
+ PinnedColumns,
3226
+ {
3227
+ testid,
3228
+ pinDirection: "left",
3229
+ table,
3230
+ tableContainerRef: containerRef,
3231
+ pagination,
3232
+ isLoadingMore,
3233
+ hasMore,
3234
+ showFilterRow
3235
+ }
3236
+ ),
3237
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { className: "flex-1 flex flex-col min-h-min", children: [
3238
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { className: "sticky top-0 z-10 grid", children: table.getCenterHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3239
+ "tr",
3240
+ {
3241
+ "data-testid": testid ? `${testid}-header-row-${headerGroup.id}` : void 0,
3242
+ className: "flex w-full",
3243
+ children: [
3244
+ virtualPaddingLeft ? (
3245
+ // fake empty column to the left for virtualization scroll padding
3246
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3247
+ "th",
3248
+ {
3249
+ style: { display: "flex", width: virtualPaddingLeft }
3250
+ }
3251
+ )
3252
+ ) : null,
3253
+ virtualColumns.map((virtualColumn) => {
3254
+ var _a2, _b2, _c2, _d2, _e2;
3255
+ const header = headerGroup.headers[virtualColumn.index];
3256
+ if (!header) {
3257
+ return;
3258
+ }
3259
+ if (typeof header.column.columnDef.header === "string") {
3260
+ const cellValue = (_a2 = table.getRowModel().rows[0]) == null ? void 0 : _a2.getValue(header.column.id);
3261
+ const cellAlignment = ((_c2 = (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.align) != null ? _c2 : cellValue === "number") ? "right" : "left";
3262
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3263
+ DraggableCellHeader,
3264
+ {
3265
+ id: id ? `${id}-header-${header.id}` : void 0,
3266
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
3267
+ header,
3268
+ locked: (_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.locked,
3269
+ center: centerHeader,
3270
+ className: (0, import_clsx13.default)(
3271
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
3272
+ "group",
3273
+ cellAlignment ? {
3274
+ "justify-start": cellAlignment === "left",
3275
+ "justify-end": cellAlignment === "right"
3276
+ } : {
3277
+ "justify-end": typeof cellValue === "number"
3278
+ }
3279
+ ),
3280
+ useMenuDefaultMinWidth,
3281
+ children: [
3282
+ cellAlignment === "left" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
3283
+ getSortIcon(header.column.getIsSorted()),
3284
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
3285
+ header.column.getNextSortingOrder(),
3286
+ true
3287
+ ),
3288
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
3289
+ cellAlignment === "right" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
3290
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3291
+ "div",
3292
+ {
3293
+ onDoubleClick: (e) => {
3294
+ e.stopPropagation();
3295
+ header.column.resetSize();
3296
+ },
3297
+ onMouseDown: (e) => {
3298
+ e.stopPropagation();
3299
+ header.getResizeHandler()(e);
3300
+ },
3301
+ onTouchStart: (e) => {
3302
+ e.stopPropagation();
3303
+ header.getResizeHandler()(e);
3304
+ },
3305
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
3306
+ }
3307
+ )
3308
+ ]
3309
+ },
3310
+ header.id
3311
+ );
3312
+ }
3313
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3314
+ DataGridCell,
3315
+ {
3316
+ id: id ? `${id}-header-${header.id}` : void 0,
3317
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
3318
+ type: "header",
3319
+ component: "checkbox",
3320
+ locked: true,
3321
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3322
+ Checkbox,
3323
+ {
3324
+ id: id ? `${id}-select-all-checkbox` : void 0,
3325
+ testid: testid ? `${testid}-select-all-checkbox` : void 0,
3326
+ checked: allSelectedAcrossPages,
3327
+ indeterminate: someSelectedAcrossPages,
3328
+ onChange: toggleSelectAllAcrossPages
3329
+ }
3330
+ )
3331
+ }
3332
+ ) : (0, import_react_table3.flexRender)(
3333
+ header.column.columnDef.header,
3334
+ header.getContext()
3335
+ ) }, header.id);
3336
+ }),
3337
+ virtualPaddingRight ? (
3338
+ //fake empty column to the right for virtualization scroll padding
3339
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3340
+ "th",
3341
+ {
3342
+ style: { display: "flex", width: virtualPaddingRight }
3343
+ }
3344
+ )
3345
+ ) : null
3346
+ ]
3347
+ },
3348
+ headerGroup.id
3349
+ )) }),
3350
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3351
+ TableBody,
3352
+ {
3353
+ id,
3354
+ testid,
3355
+ columnVirtualizer,
3356
+ table,
3357
+ tableContainerRef: containerRef,
3358
+ virtualPaddingLeft,
3359
+ virtualPaddingRight,
3360
+ pagination,
3361
+ isLoadingMore,
3362
+ hasMore,
3363
+ showFilterRow,
3364
+ enableColumnSelector
3365
+ }
3366
+ )
3367
+ ] }),
3368
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3369
+ PinnedColumns,
3370
+ {
3371
+ id,
3372
+ enableColumnSelector,
3373
+ toggleColumnVisibility,
3374
+ resetColumnVisibility,
3375
+ testid,
3376
+ pinDirection: "right",
3377
+ table,
3378
+ tableContainerRef: containerRef,
3379
+ pagination,
3380
+ isLoadingMore,
3381
+ hasMore,
3382
+ showFilterRow
3383
+ }
3384
+ )
3385
+ ]
3386
+ }
3387
+ ),
3388
+ empty && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3389
+ "div",
3390
+ {
3391
+ className: (0, import_clsx13.default)(
3392
+ NO_RESULTS_HEIGHT,
3393
+ "flex flex-col items-center justify-center",
3394
+ componentGap,
3395
+ componentPadding
3396
+ ),
3397
+ "data-testid": testid ? `${testid}-no-results` : void 0,
3398
+ children: [
3399
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3400
+ "img",
3401
+ {
3402
+ src: (_g = (_f = no_results_image_default) == null ? void 0 : _f.src) != null ? _g : no_results_image_default,
3403
+ alt: "No Results",
3404
+ className: "h-30 opacity-20",
3405
+ width: 120,
3406
+ height: 120
3407
+ }
3408
+ ),
3409
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { color: "text-secondary-normal", children: "No Results" }),
3410
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Paragraph, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
3411
+ ]
3412
+ }
3413
+ ),
3414
+ !hideStatusBar && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "p-2 pt-[7px] border-t border-border-primary-normal h-full min-h-[34px]", children: [
3415
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex justify-between items-center", children: [
3416
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-1 w-min", children: [
3417
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3418
+ Select,
3419
+ {
3420
+ id: id ? `${id}-pagesize-select` : void 0,
3421
+ testid: testid ? `${testid}-pagesize-select` : void 0,
3422
+ wrapperClassName: "!w-20",
3423
+ value: pagination.pageSize.toString(),
3424
+ onChange: (e) => {
3425
+ var _a2;
3426
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, Number(e.target.value));
3427
+ },
3428
+ renderMenu: (props) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3429
+ Menu,
3430
+ __spreadProps(__spreadValues({}, props), {
3431
+ id: id ? `${id}-pagesize-menu` : void 0,
3432
+ testid: testid ? `${testid}-pagesize-menu` : void 0,
3433
+ children: PAGE_SIZE_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3434
+ MenuOption,
3435
+ {
3436
+ id: id ? `${id}-pagesize-option-${option}` : void 0,
3437
+ selected: pagination.pageSize === option,
3438
+ onClick: () => {
3439
+ var _a2;
3440
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, option);
3441
+ },
3442
+ children: option
3443
+ },
3444
+ option
3445
+ ))
3446
+ })
3447
+ )
3448
+ }
3449
+ ),
3450
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label, { children: "Per Page" })
3451
+ ] }),
3452
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2", children: [
3453
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3454
+ Button,
3455
+ {
3456
+ id: id ? `${id}-prev-page-button` : void 0,
3457
+ testid: testid ? `${testid}-prev-page-button` : void 0,
3458
+ iconOnly: true,
3459
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron_left" }),
3460
+ onClick: () => pagination.onPageChange(pagination.pageIndex - 1),
3461
+ variant: "tertiary",
3462
+ disabled: pagination.pageIndex === 0
3463
+ }
3464
+ ),
3465
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Paragraph, { children: [
3466
+ pagination.pageIndex * pagination.pageSize + 1,
3467
+ " -",
3468
+ " ",
3469
+ Math.min(
3470
+ (pagination.pageIndex + 1) * pagination.pageSize,
3471
+ pagination.total
3472
+ ),
3473
+ " ",
3474
+ "of ",
3475
+ pagination.total
3476
+ ] }),
3477
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3478
+ Button,
3479
+ {
3480
+ id: id ? `${id}-next-page-button` : void 0,
3481
+ testid: testid ? `${testid}-next-page-button` : void 0,
3482
+ iconOnly: true,
3483
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron_right" }),
3484
+ onClick: () => pagination.onPageChange(pagination.pageIndex + 1),
3485
+ variant: "tertiary",
3486
+ disabled: (pagination.pageIndex + 1) * pagination.pageSize >= pagination.total
3487
+ }
3488
+ )
3489
+ ] })
3490
+ ] }),
3491
+ status && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3492
+ Paragraph,
3493
+ {
3494
+ testid: testid ? `${testid}-status-text` : void 0,
3495
+ children: status
3496
+ }
3497
+ )
3498
+ ] })
3499
+ ]
3500
+ }
3501
+ )
3502
+ }
3503
+ )
3504
+ }
3505
+ );
3506
+ }
3507
+ DataGrid.displayName = "DataGrid";
3508
+ function adaptTableStateSetter(setter) {
3509
+ return (valueOrFn) => {
3510
+ setter(
3511
+ (prev) => typeof valueOrFn === "function" ? valueOrFn(prev) : valueOrFn
3512
+ );
3513
+ };
3514
+ }
3515
+
3516
+ // src/components/Select.tsx
3517
+ var import_react17 = require("react");
3518
+ var import_clsx14 = __toESM(require("clsx"), 1);
3519
+ var import_jsx_runtime17 = require("react/jsx-runtime");
3520
+ var Select = (_a) => {
3521
+ var _b = _a, {
3522
+ id,
3523
+ testid,
3524
+ label,
3525
+ error,
3526
+ children,
3527
+ readOnly,
3528
+ renderMenu,
3529
+ onClick,
3530
+ className,
3531
+ wrapperClassName,
3532
+ removeRoundness,
3533
+ displayValue,
3534
+ value
3535
+ } = _b, props = __objRest(_b, [
3536
+ "id",
3537
+ "testid",
3538
+ "label",
3539
+ "error",
3540
+ "children",
3541
+ "readOnly",
3542
+ "renderMenu",
3543
+ "onClick",
3544
+ "className",
3545
+ "wrapperClassName",
3546
+ "removeRoundness",
3547
+ "displayValue",
3548
+ "value"
3549
+ ]);
3550
+ var _a2;
3551
+ const inputRef = (0, import_react17.useRef)(null);
3552
+ const inputContainerRef = (0, import_react17.useRef)(null);
3553
+ const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
3554
+ const [show, setShow] = (0, import_react17.useState)(false);
3555
+ (0, import_react17.useEffect)(() => {
3556
+ var _a3;
3557
+ if (preventFocusOnInitialRender.current) {
3558
+ preventFocusOnInitialRender.current = false;
3559
+ return;
3560
+ }
3561
+ (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
3562
+ }, [value]);
3563
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
3564
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3565
+ InputBase,
3566
+ __spreadProps(__spreadValues({
3567
+ id,
3568
+ testid,
3569
+ inputContainerRef,
3570
+ ref: inputRef,
3571
+ label,
3572
+ after: !readOnly && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3573
+ "span",
3574
+ {
3575
+ className: (0, import_clsx14.default)(
3576
+ props.disabled ? "text-icon-action-primary-disabled" : "text-icon-action-primary-normal",
3577
+ "contents"
3578
+ ),
3579
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { name: "keyboard_arrow_down" })
3580
+ }
3581
+ ),
3582
+ maxLength: 0,
3583
+ className: (0, import_clsx14.default)("!caret-transparent !cursor-default", className),
3584
+ wrapperClassName,
3585
+ onKeyDown: (e) => {
3586
+ const openKeys = ["Enter", "Space", " "];
3587
+ if (openKeys.includes(e.key)) {
3588
+ e.preventDefault();
3589
+ e.target.click();
3590
+ }
3591
+ },
3592
+ onClick: (e) => {
3593
+ if (props.disabled || readOnly) {
3594
+ return;
3595
+ }
3596
+ setShow(!show);
3597
+ onClick == null ? void 0 : onClick(e);
3598
+ },
3599
+ error,
3600
+ readOnly,
3601
+ removeRoundness,
3602
+ focus: show,
3603
+ onChange: (e) => {
3604
+ var _a3;
3605
+ return (_a3 = props.onChange) == null ? void 0 : _a3.call(props, e);
3606
+ }
3607
+ }, props), {
3608
+ value: (_a2 = displayValue != null ? displayValue : value) != null ? _a2 : props.onChange ? "" : void 0
3609
+ })
3610
+ ),
3611
+ renderMenu ? renderMenu({
3612
+ id: id ? `${id}-menu` : void 0,
3613
+ positionTo: inputContainerRef,
3614
+ show,
3615
+ setShow,
3616
+ topOffset: props.caption ? -16 : null
3617
+ }) : children
3618
+ ] });
3619
+ };
3620
+ Select.displayName = "Select";
3621
+
3622
+ // src/components/Subheader.tsx
3623
+ var import_clsx15 = __toESM(require("clsx"), 1);
3624
+ var import_jsx_runtime18 = require("react/jsx-runtime");
3625
+ var Subheader = (_a) => {
3626
+ var _b = _a, {
3627
+ className,
3628
+ children,
3629
+ as = "span",
3630
+ align,
3631
+ color,
3632
+ tall,
3633
+ id,
3634
+ testid
3635
+ } = _b, props = __objRest(_b, [
3636
+ "className",
3637
+ "children",
3638
+ "as",
3639
+ "align",
3640
+ "color",
3641
+ "tall",
3642
+ "id",
3643
+ "testid"
3644
+ ]);
3645
+ const Element = as;
3646
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3647
+ Element,
3648
+ __spreadProps(__spreadValues({
3649
+ id,
3650
+ "data-testid": testid,
3651
+ className: (0, import_clsx15.default)(
3652
+ typography.subheader,
3653
+ className,
3654
+ align === "left" && "text-left",
3655
+ align === "center" && "text-center",
3656
+ align === "right" && "text-right",
3657
+ tall && "!leading-6"
3658
+ ),
3659
+ style: __spreadProps(__spreadValues({}, props.style), {
3660
+ color: color ? `var(--color-${color})` : void 0
3661
+ })
3662
+ }, props), {
3663
+ children
3664
+ })
3665
+ );
3666
+ };
3667
+ Subheader.displayName = "Subheader";
3668
+
3669
+ // src/components/Checkbox.tsx
3670
+ var import_clsx16 = __toESM(require("clsx"), 1);
3671
+ var import_jsx_runtime19 = require("react/jsx-runtime");
3672
+ var Checkbox = (_a) => {
3673
+ var _b = _a, {
3674
+ label,
3675
+ error,
3676
+ disabled,
3677
+ readOnly,
3678
+ checked,
3679
+ onChange,
3680
+ indeterminate,
3681
+ paragraphClassName,
3682
+ id,
3683
+ testid
3684
+ } = _b, props = __objRest(_b, [
3685
+ "label",
3686
+ "error",
3687
+ "disabled",
3688
+ "readOnly",
3689
+ "checked",
3690
+ "onChange",
3691
+ "indeterminate",
3692
+ "paragraphClassName",
3693
+ "id",
3694
+ "testid"
3695
+ ]);
3696
+ const selected = indeterminate || checked;
3697
+ const normalClassName = (0, import_clsx16.default)(
3698
+ !selected && !error && !disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-normal peer-hover:border-border-action-hover peer-hover:bg-background-action-secondary-hover peer-active:border-border-action-active peer-active:bg-background-action-secondary-active"
3699
+ );
3700
+ const normalSelectedClassName = (0, import_clsx16.default)(
3701
+ selected && !error && !disabled && !readOnly && "bg-background-action-primary-normal border-background-action-primary-normal peer-hover:bg-background-action-primary-hover peer-hover:border-background-action-primary-hover peer-active:bg-background-action-primary-active peer-active:border-background-action-primary-active"
3702
+ );
3703
+ const errorClassName = (0, import_clsx16.default)(
3704
+ error && !selected && "bg-background-action-critical-secondary-normal border-border-action-critical-normal peer-hover:border-border-action-critical-hover peer-hover:bg-background-action-critical-secondary-hover peer-active:border-border-action-critical-active peer-active:bg-background-action-secondary-active"
3705
+ );
3706
+ const errorSelectedClassName = (0, import_clsx16.default)(
3707
+ error && selected && "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal peer-hover:bg-background-action-critical-primary-hover peer-hover:border-background-action-critical-primary-hover peer-active:bg-background-action-critical-primary-active peer-active:border-background-action-critical-primary-active"
3708
+ );
3709
+ const disabledClassName = (0, import_clsx16.default)(
3710
+ disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-disabled peer-checked:bg-icon-on-action-primary-disabled peer-checked:border-icon-on-action-primary-disabled"
3711
+ );
3712
+ const readOnlyClassName = (0, import_clsx16.default)(
3713
+ readOnly && "border-transparent bg-transparent peer-checked:bg-transparent peer-checked:border-transparent"
3714
+ );
3715
+ const checkColor = (0, import_clsx16.default)(
3716
+ selected && !disabled && !readOnly && "color-icon-on-action-primary-normal peer-hover:color-icon-on-action-primary-hover peer-active:color-icon-on-action-primary-active",
3717
+ selected && disabled && "color-background-action-primary-disabled"
3718
+ );
3719
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3720
+ "label",
3721
+ {
3722
+ id,
3723
+ "data-testid": testid,
3724
+ htmlFor: id ? `${id}-input` : void 0,
3725
+ className: (0, import_clsx16.default)(
3726
+ "flex items-center",
3727
+ componentGap,
3728
+ (disabled || readOnly && error || readOnly) && "cursor-default",
3729
+ !(readOnly && error) && !disabled && !readOnly && "cursor-pointer"
3730
+ ),
3731
+ children: [
3732
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative", children: [
3733
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3734
+ "input",
3735
+ __spreadValues({
3736
+ id: id ? `${id}-input` : void 0,
3737
+ "data-testid": testid ? `${testid}-input` : void 0,
3738
+ type: "checkbox",
3739
+ className: "sr-only peer",
3740
+ disabled,
3741
+ checked: selected,
3742
+ onChange: handleOnChange,
3743
+ "data-indeterminate": indeterminate
3744
+ }, props)
3745
+ ),
3746
+ error && (readOnly || disabled) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_clsx16.default)("size-6", "flex items-center justify-center"), children: selected ? indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "question_mark" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "close" }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3747
+ "div",
3748
+ {
3749
+ className: (0, import_clsx16.default)(
3750
+ "size-6 border rounded-base",
3751
+ "flex items-center justify-center",
3752
+ baseTransition,
3753
+ normalClassName,
3754
+ normalSelectedClassName,
3755
+ errorClassName,
3756
+ errorSelectedClassName,
3757
+ disabledClassName,
3758
+ readOnlyClassName,
3759
+ checkColor
3760
+ ),
3761
+ children: selected ? indeterminate ? readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "question_mark" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "remove", className: "pointer-events-none" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "close" }) })
3762
+ }
3763
+ )
3764
+ ] }),
3765
+ label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3766
+ Paragraph,
3767
+ {
3768
+ id: id ? `${id}-label` : void 0,
3769
+ testid: testid ? `${testid}-label` : void 0,
3770
+ as: "span",
3771
+ padded: true,
3772
+ className: (0, import_clsx16.default)(
3773
+ "text-nowrap",
3774
+ disabled && !error && "!text-text-primary-disabled",
3775
+ error && !disabled && !readOnly && "!text-text-primary-error",
3776
+ paragraphClassName
3777
+ ),
3778
+ children: label
3779
+ }
3780
+ )
3781
+ ]
3782
+ }
3783
+ );
3784
+ function handleOnChange(e) {
3785
+ if (disabled || readOnly || readOnly && error || !onChange) {
3786
+ return;
3787
+ }
3788
+ onChange(e);
3789
+ }
3790
+ };
3791
+ Checkbox.displayName = "Checkbox";
3792
+
3793
+ // src/components/Button.tsx
3794
+ var import_clsx17 = __toESM(require("clsx"), 1);
3795
+ var import_jsx_runtime20 = require("react/jsx-runtime");
3796
+ var Button = (_a) => {
3797
+ var _b = _a, {
3798
+ variant = "primary",
3799
+ as = "button",
3800
+ block,
3801
+ leftIcon,
3802
+ rightIcon,
3803
+ className,
3804
+ classNameLabel,
3805
+ disabled = false,
3806
+ children,
3807
+ iconOnly = false,
3808
+ colorClassName,
3809
+ href,
3810
+ id,
3811
+ testid
3812
+ } = _b, props = __objRest(_b, [
3813
+ "variant",
3814
+ "as",
3815
+ "block",
3816
+ "leftIcon",
3817
+ "rightIcon",
3818
+ "className",
3819
+ "classNameLabel",
3820
+ "disabled",
3821
+ "children",
3822
+ "iconOnly",
3823
+ "colorClassName",
3824
+ "href",
3825
+ "id",
3826
+ "testid"
3827
+ ]);
3828
+ const primaryVariantStyles = variant === "primary" && (0, import_clsx17.default)(
3829
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
3830
+ "bg-background-action-primary-normal border-background-action-primary-normal",
3831
+ "hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
3832
+ "focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
3833
+ "active:bg-background-action-primary-active active:border-background-action-primary-active",
3834
+ "disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled"
3835
+ );
3836
+ const secondaryVariantStyles = variant === "secondary" && (0, import_clsx17.default)(
3837
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3838
+ "bg-background-action-secondary-normal border-border-action-normal",
3839
+ "hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
3840
+ "focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
3841
+ "active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
3842
+ "disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled"
3843
+ );
3844
+ const tertiaryVariantStyles = variant === "tertiary" && (0, import_clsx17.default)(
3845
+ "bg-transparent border-transparent",
3846
+ iconOnly ? (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-icon-action-primary-normal" : (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3847
+ "bg-transparent border-transparent",
3848
+ "hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
3849
+ "focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
3850
+ "active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
3851
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
3852
+ );
3853
+ const primaryCriticalVariantStyles = variant === "primary-critical" && (0, import_clsx17.default)(
3854
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
3855
+ "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
3856
+ "hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
3857
+ "focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
3858
+ "active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
3859
+ "disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled"
3860
+ );
3861
+ const secondaryCriticalVariantStyles = variant === "secondary-critical" && (0, import_clsx17.default)(
3862
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
3863
+ "bg-background-action-critical-secondary-normal border-border-action-critical-normal",
3864
+ "hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
3865
+ "focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
3866
+ "active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
3867
+ "disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled"
3868
+ );
3869
+ const tertiaryCriticalVariantStyles = variant === "tertiary-critical" && (0, import_clsx17.default)(
3870
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
3871
+ "bg-transparent border-transparent text-text-action-critical-normal",
3872
+ "hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
3873
+ "focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
3874
+ "active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
3875
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled"
3876
+ );
3877
+ const navigationVarianStyles = variant === "navigation" && (0, import_clsx17.default)(
3878
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3879
+ "bg-transparent",
3880
+ "hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover",
3881
+ "focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
3882
+ "active:bg-background-action-secondary-active active:text-text-action-primary-active",
3883
+ "disabled:bg-transparent disabled:text-text-on-action-primary-disabled",
3884
+ "flex-col",
3885
+ paddingUsingComponentGap
3886
+ );
3887
+ const notNavigationVariantStyles = variant !== "navigation" && (0, import_clsx17.default)("border-2 flex-row", componentPaddingMinus2pxBorder, componentGap);
3888
+ const buttonClasses = (0, import_clsx17.default)(
3889
+ disabled ? "cursor-default" : "cursor-pointer",
3890
+ block ? "w-full" : "w-fit",
3891
+ baseTransition,
3892
+ "rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
3893
+ primaryVariantStyles,
3894
+ secondaryVariantStyles,
3895
+ tertiaryVariantStyles,
3896
+ primaryCriticalVariantStyles,
3897
+ secondaryCriticalVariantStyles,
3898
+ tertiaryCriticalVariantStyles,
3899
+ navigationVarianStyles,
3900
+ notNavigationVariantStyles,
3901
+ className
3902
+ );
3903
+ const labelClasses = (0, import_clsx17.default)(
3904
+ "min-h-6 flex items-center justify-center",
3905
+ classNameLabel,
3906
+ componentPaddingXUsingComponentGap,
3907
+ typography.buttonLabel
3908
+ );
3909
+ const Element = href && !as ? "a" : as;
3910
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3911
+ Element,
3912
+ __spreadProps(__spreadValues({
3913
+ id,
3914
+ "data-testid": testid,
3915
+ type: Element === "button" ? "button" : void 0,
3916
+ className: buttonClasses
3917
+ }, props), {
3918
+ onClick: props.onClick,
3919
+ disabled,
3920
+ href,
3921
+ "data-theme": variant === "navigation" ? "brand" : void 0,
3922
+ children: [
3923
+ leftIcon && leftIcon,
3924
+ !iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { id: id ? `${id}-label` : void 0, "data-testid": testid ? `${testid}-label` : void 0, className: labelClasses, children }),
3925
+ rightIcon && rightIcon
3926
+ ]
3927
+ })
3928
+ );
3929
+ };
3930
+ Button.displayName = "Button";
3931
+
3932
+ // src/components/Tooltip.tsx
3933
+ var import_clsx18 = __toESM(require("clsx"), 1);
3934
+ var import_react18 = require("react");
3935
+ var import_react_dom2 = require("react-dom");
3936
+ var import_jsx_runtime21 = require("react/jsx-runtime");
3937
+ var Tooltip = ({
3938
+ id,
3939
+ testid,
3940
+ message,
3941
+ position = "top",
3942
+ children,
3943
+ showOnTruncation = false,
3944
+ offset = 8,
3945
+ keepHidden = false
3946
+ }) => {
3947
+ const ref = (0, import_react18.useRef)(null);
3948
+ const tooltipRef = (0, import_react18.useRef)(null);
3949
+ const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
3950
+ const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
3951
+ const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
3952
+ const updatePosition = () => {
3953
+ if (!ref.current || !tooltipRef.current) return;
3954
+ const rect = ref.current.getBoundingClientRect();
3955
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
3956
+ let top = 0;
3957
+ let left = 0;
3958
+ switch (position) {
3959
+ case "top":
3960
+ top = rect.top - tooltipRect.height - offset;
3961
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
3962
+ break;
3963
+ case "bottom":
3964
+ top = rect.bottom + offset;
3965
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
3966
+ break;
3967
+ case "left":
3968
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
3969
+ left = rect.left - tooltipRect.width - offset;
3970
+ break;
3971
+ case "right":
3972
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
3973
+ left = rect.right + offset;
3974
+ break;
3975
+ }
3976
+ setTooltipPosition({ top, left });
3977
+ requestAnimationFrame(() => {
3978
+ setRemoveOpacity(true);
3979
+ });
3980
+ };
3981
+ const handleMouseEnter = () => {
3982
+ if (!showOnTruncation || checkForTextTruncation()) {
3983
+ setIsVisible(true);
3984
+ }
3985
+ };
3986
+ const handleMouseLeave = () => {
3987
+ setIsVisible(false);
3988
+ setRemoveOpacity(false);
3989
+ };
3990
+ (0, import_react18.useEffect)(() => {
3991
+ if (isVisible && tooltipRef.current) {
3992
+ requestAnimationFrame(() => {
3993
+ updatePosition();
3994
+ });
3995
+ }
3996
+ }, [isVisible]);
3997
+ (0, import_react18.useEffect)(() => {
3998
+ if (isVisible) {
3999
+ window.addEventListener("resize", updatePosition);
4000
+ return () => window.removeEventListener("resize", updatePosition);
4001
+ }
4002
+ }, [isVisible]);
4003
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4004
+ "div",
4005
+ {
4006
+ id,
4007
+ "data-testid": testid,
4008
+ ref,
4009
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center",
4010
+ onMouseEnter: handleMouseEnter,
4011
+ onMouseLeave: handleMouseLeave,
4012
+ children: [
4013
+ children,
4014
+ !keepHidden && isVisible && typeof document !== "undefined" && (0, import_react_dom2.createPortal)(
4015
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4016
+ "div",
4017
+ {
4018
+ id: id ? `${id}-message` : void 0,
4019
+ "data-testid": testid ? `${testid}-message` : void 0,
4020
+ ref: tooltipRef,
4021
+ style: {
4022
+ position: "fixed",
4023
+ top: `${tooltipPosition.top}px`,
4024
+ left: `${tooltipPosition.left}px`,
4025
+ zIndex: 9999
4026
+ },
4027
+ className: (0, import_clsx18.default)(
4028
+ typography.caption,
4029
+ "bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
4030
+ componentPadding,
4031
+ !removeOpacity && "opacity-0"
4032
+ ),
4033
+ children: message
4034
+ }
4035
+ ),
4036
+ document.body
4037
+ )
4038
+ ]
4039
+ }
4040
+ );
4041
+ function checkForTextTruncation() {
4042
+ if (showOnTruncation && ref.current) {
4043
+ const paragraph = ref.current.querySelector("p");
4044
+ if (paragraph) {
4045
+ const isTruncated = paragraph.scrollWidth > paragraph.clientWidth;
4046
+ return isTruncated;
4047
+ }
4048
+ }
4049
+ return false;
4050
+ }
4051
+ };
4052
+ Tooltip.displayName = "Tooltip";
4053
+
4054
+ // src/components/Accordion.tsx
4055
+ var import_clsx21 = __toESM(require("clsx"), 1);
4056
+
4057
+ // src/components/Card.tsx
4058
+ var import_clsx19 = __toESM(require("clsx"), 1);
4059
+ var import_jsx_runtime22 = require("react/jsx-runtime");
4060
+
4061
+ // src/components/Stack.tsx
4062
+ var import_clsx20 = __toESM(require("clsx"), 1);
4063
+ var import_jsx_runtime23 = require("react/jsx-runtime");
4064
+
4065
+ // src/components/Accordion.tsx
4066
+ var import_jsx_runtime24 = require("react/jsx-runtime");
4067
+
4068
+ // src/components/CalendarRange.tsx
4069
+ var import_jsx_runtime25 = require("react/jsx-runtime");
4070
+ function DateCell(_a) {
4071
+ var _b = _a, {
4072
+ date,
4073
+ isInMonth,
4074
+ isToday,
4075
+ isSelected,
4076
+ inRange,
4077
+ isDisabled,
4078
+ isRangeStart,
4079
+ isRangeEnd,
4080
+ onClick,
4081
+ onMouseEnter,
4082
+ onMouseLeave,
4083
+ cellPadding = "",
4084
+ isRangeDisabled = false,
4085
+ id,
4086
+ testid
4087
+ } = _b, props = __objRest(_b, [
4088
+ "date",
4089
+ "isInMonth",
4090
+ "isToday",
4091
+ "isSelected",
4092
+ "inRange",
4093
+ "isDisabled",
4094
+ "isRangeStart",
4095
+ "isRangeEnd",
4096
+ "onClick",
4097
+ "onMouseEnter",
4098
+ "onMouseLeave",
4099
+ "cellPadding",
4100
+ "isRangeDisabled",
4101
+ "id",
4102
+ "testid"
4103
+ ]);
4104
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4105
+ "span",
4106
+ __spreadProps(__spreadValues({}, props), {
4107
+ id,
4108
+ "data-testid": testid,
4109
+ className: (0, import_clsx22.default)(
4110
+ "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
4111
+ typography.caption,
4112
+ cellPadding,
4113
+ !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
4114
+ !isInMonth && "border-transparent",
4115
+ // Today: subtle border ring
4116
+ isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
4117
+ // Selected: Figma blue, white text, strong shadow
4118
+ isSelected && "bg-action-400 text-white border-action-400 z-10",
4119
+ !isSelected && !inRange && "rounded-base",
4120
+ // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
4121
+ (isRangeDisabled || !inRange && isSelected) && "rounded-base",
4122
+ inRange && isSelected && "hover:border-action-500",
4123
+ // In range: Figma light blue background
4124
+ inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
4125
+ // Disabled: Figma gray, no pointer, no hover
4126
+ isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
4127
+ "text-text-primary-normal cursor-pointer",
4128
+ // Figma hover: blue bg, blue text (or red text if selected)
4129
+ isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
4130
+ // Figma active: darker blue bg, white text
4131
+ "active:bg-action-300 active:text-white",
4132
+ // Figma focus: ring
4133
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
4134
+ ],
4135
+ isRangeStart && "rounded-l",
4136
+ isRangeEnd && "rounded-r"
4137
+ ),
4138
+ tabIndex: isDisabled ? -1 : 0,
4139
+ "aria-disabled": isDisabled,
4140
+ onClick: () => !isDisabled && isInMonth && onClick(),
4141
+ onMouseEnter: () => isInMonth && onMouseEnter(),
4142
+ onMouseLeave: () => isInMonth && onMouseLeave(),
4143
+ children: isInMonth ? date.day : ""
4144
+ })
4145
+ );
4146
+ }
4147
+ function CalendarRange({
4148
+ from,
4149
+ to,
4150
+ onChange,
4151
+ isDateAvailable,
4152
+ mode = "double",
4153
+ cardStyle = false,
4154
+ disableRange = false,
4155
+ id,
4156
+ testid
4157
+ }) {
4158
+ const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
4159
+ const parseDate = (d) => {
4160
+ if (!d) {
4161
+ return void 0;
4162
+ }
4163
+ try {
4164
+ if (typeof d === "number") {
4165
+ return import_polyfill.Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
4166
+ }
4167
+ if (typeof d === "string") {
4168
+ return import_polyfill.Temporal.PlainDate.from(d);
4169
+ }
4170
+ return void 0;
4171
+ } catch (error) {
4172
+ console.error("Invalid date format:", d, error);
4173
+ return import_polyfill.Temporal.Now.plainDateISO();
4174
+ }
4175
+ };
4176
+ const fromDate = parseDate(from);
4177
+ const toDate = parseDate(to);
4178
+ const today = import_polyfill.Temporal.Now.plainDateISO();
4179
+ const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
4180
+ fromDate != null ? fromDate : today.with({ day: 1 })
4181
+ );
4182
+ const [selecting, setSelecting] = (0, import_react19.useState)("from");
4183
+ const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
4184
+ const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
4185
+ (0, import_react19.useEffect)(() => {
4186
+ if (fromDate) {
4187
+ setBaseMonth(fromDate.with({ day: 1 }));
4188
+ } else if (toDate) {
4189
+ setBaseMonth(toDate.with({ day: 1 }));
4190
+ }
4191
+ }, [from, to]);
4192
+ (0, import_react19.useEffect)(() => {
4193
+ if (fromDate && toDate) {
4194
+ setSelecting("from");
4195
+ setPendingFrom(void 0);
4196
+ setHoveredDate(void 0);
4197
+ }
4198
+ }, [from, to]);
4199
+ function getMonthData(monthOffset) {
4200
+ const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
4201
+ const days = monthDate.daysInMonth;
4202
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4203
+ return {
4204
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4205
+ year: monthDate.year,
4206
+ days,
4207
+ firstDayOffset,
4208
+ date: monthDate
4209
+ };
4210
+ }
4211
+ function getMonthDataWith(monthOffset) {
4212
+ const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
4213
+ const days = monthDate.daysInMonth;
4214
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4215
+ return {
4216
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4217
+ year: monthDate.year,
4218
+ days,
4219
+ firstDayOffset,
4220
+ date: monthDate
4221
+ };
4222
+ }
4223
+ function handleDayClick(date) {
4224
+ if (isDateAvailable && !isDateAvailable(date)) return;
4225
+ if (mode === "single" && disableRange) {
4226
+ if (onChange) {
4227
+ onChange(date.toString(), date.toString());
4228
+ }
4229
+ return;
4230
+ }
4231
+ if (selecting === "from") {
4232
+ setPendingFrom(date);
4233
+ setSelecting("to");
4234
+ setHoveredDate(void 0);
4235
+ } else if (pendingFrom) {
4236
+ if (onChange) {
4237
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
4238
+ onChange(start.toString(), end.toString());
4239
+ }
4240
+ setPendingFrom(void 0);
4241
+ setSelecting("from");
4242
+ setHoveredDate(void 0);
4243
+ }
4244
+ }
4245
+ function isInRange(date) {
4246
+ if (mode === "single" && disableRange) {
4247
+ return false;
4248
+ }
4249
+ if (pendingFrom && selecting === "to" && hoveredDate) {
4250
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
4251
+ return import_polyfill.Temporal.PlainDate.compare(date, start) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, end) <= 0;
4252
+ }
4253
+ if (!pendingFrom && fromDate && toDate) {
4254
+ return import_polyfill.Temporal.PlainDate.compare(date, fromDate) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, toDate) <= 0;
4255
+ }
4256
+ return false;
4257
+ }
4258
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4259
+ "div",
4260
+ {
4261
+ id,
4262
+ "data-testid": testid,
4263
+ className: (0, import_clsx22.default)(
4264
+ "relative bg-background-grouped-primary-normal rounded-base w-fit",
4265
+ layoutPaddding,
4266
+ layoutGap,
4267
+ cardStyle && "shadow-4",
4268
+ // baseTransition,
4269
+ "overflow-hidden"
4270
+ ),
4271
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4272
+ "div",
4273
+ {
4274
+ className: (0, import_clsx22.default)(
4275
+ "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
4276
+ layoutGap
4277
+ ),
4278
+ children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
4279
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4280
+ CalendarPane,
4281
+ {
4282
+ getMonthData,
4283
+ getMonthDataWith,
4284
+ offset,
4285
+ idx,
4286
+ id,
4287
+ testid,
4288
+ baseMonth,
4289
+ setBaseMonth,
4290
+ mode,
4291
+ pendingFrom,
4292
+ weekDays,
4293
+ fromDate,
4294
+ toDate,
4295
+ isDateAvailable,
4296
+ disableRange,
4297
+ hoveredDate,
4298
+ isInRange,
4299
+ today,
4300
+ setHoveredDate,
4301
+ handleDayClick
4302
+ },
4303
+ idx
4304
+ );
4305
+ })
4306
+ }
4307
+ )
4308
+ }
4309
+ );
4310
+ }
4311
+ function CalendarPane({
4312
+ getMonthData,
4313
+ getMonthDataWith,
4314
+ offset,
4315
+ idx,
4316
+ id,
4317
+ testid,
4318
+ baseMonth,
4319
+ setBaseMonth,
4320
+ mode,
4321
+ pendingFrom,
4322
+ weekDays,
4323
+ fromDate,
4324
+ toDate,
4325
+ isDateAvailable,
4326
+ disableRange,
4327
+ hoveredDate,
4328
+ isInRange,
4329
+ today,
4330
+ setHoveredDate,
4331
+ handleDayClick
4332
+ }) {
4333
+ const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
4334
+ const years = Array.from({ length: 100 }).map(
4335
+ (_, i) => baseMonth.year - 50 + i
4336
+ );
4337
+ const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
4338
+ const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
4339
+ const monthMenuRef = (0, import_react19.useRef)(null);
4340
+ const yearMenuRef = (0, import_react19.useRef)(null);
4341
+ const month = getMonthData(offset);
4342
+ const totalCells = 42;
4343
+ const emptyCells = month.firstDayOffset;
4344
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react19.default.Fragment, { children: [
4345
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4346
+ "div",
4347
+ {
4348
+ className: (0, import_clsx22.default)("flex flex-col"),
4349
+ children: [
4350
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4351
+ "div",
4352
+ {
4353
+ className: (0, import_clsx22.default)(
4354
+ "flex flex-row items-center justify-between",
4355
+ typography.label,
4356
+ "text-text-action-primary-normal"
4357
+ ),
4358
+ children: [
4359
+ idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4360
+ "button",
4361
+ {
4362
+ id: id ? `${id}-prev-month-button` : void 0,
4363
+ "data-testid": testid ? `${testid}-prev-month-button` : void 0,
4364
+ type: "button",
4365
+ className: (0, import_clsx22.default)(
4366
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4367
+ componentPadding
4368
+ ),
4369
+ "aria-label": "Previous month",
4370
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
4371
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron_left", size: 24 })
4372
+ }
4373
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_clsx22.default)(componentPadding, "mr-1") }),
4374
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
4375
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4376
+ "button",
4377
+ {
4378
+ ref: (el) => {
4379
+ monthMenuRef.current = el;
4380
+ },
4381
+ type: "button",
4382
+ onClick: () => {
4383
+ setMonthMenuOpen(true);
4384
+ setYearMenuOpen(false);
4385
+ },
4386
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4387
+ children: month.name
4388
+ }
4389
+ ),
4390
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4391
+ Menu,
4392
+ {
4393
+ show: monthMenuOpen,
4394
+ positionTo: monthMenuRef,
4395
+ setShow: () => setMonthMenuOpen(false),
4396
+ children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4397
+ MenuOption,
4398
+ {
4399
+ selected: baseMonth.month === x + 1,
4400
+ onClick: () => {
4401
+ setBaseMonth(baseMonth.with({ month: x + 1 }));
4402
+ setMonthMenuOpen(false);
4403
+ },
4404
+ children: m.name
4405
+ },
4406
+ m.name
4407
+ ))
4408
+ }
4409
+ ),
4410
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4411
+ "button",
4412
+ {
4413
+ ref: (el) => {
4414
+ yearMenuRef.current = el;
4415
+ },
4416
+ type: "button",
4417
+ onClick: () => {
4418
+ setYearMenuOpen(true);
4419
+ setMonthMenuOpen(false);
4420
+ },
4421
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4422
+ children: month.year
4423
+ }
4424
+ ),
4425
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4426
+ Menu,
4427
+ {
4428
+ show: yearMenuOpen,
4429
+ positionTo: yearMenuRef,
4430
+ setShow: () => setYearMenuOpen(false),
4431
+ children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4432
+ MenuOption,
4433
+ {
4434
+ selected: baseMonth.year === y,
4435
+ onClick: () => {
4436
+ setBaseMonth(baseMonth.with({ year: y }));
4437
+ setYearMenuOpen(false);
4438
+ },
4439
+ children: y
4440
+ },
4441
+ y
4442
+ ))
4443
+ }
4444
+ )
4445
+ ] }),
4446
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4447
+ "button",
4448
+ {
4449
+ id: id ? `${id}-next-month-button` : void 0,
4450
+ "data-testid": testid ? `${testid}-next-month-button` : void 0,
4451
+ type: "button",
4452
+ className: (0, import_clsx22.default)(
4453
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4454
+ componentPadding
4455
+ ),
4456
+ "aria-label": "Next month",
4457
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
4458
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron_right", size: 24 })
4459
+ }
4460
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_clsx22.default)(componentPadding, "ml-1") })
4461
+ ]
4462
+ }
4463
+ ),
4464
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx22.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4465
+ "span",
4466
+ {
4467
+ className: (0, import_clsx22.default)(
4468
+ typography.caption,
4469
+ "text-text-secondary-normal text-center",
4470
+ "w-10"
4471
+ ),
4472
+ children: d
4473
+ },
4474
+ d
4475
+ )) }),
4476
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx22.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
4477
+ const day = i - emptyCells + 1;
4478
+ const date = month.date.with({ day: 1 }).add({
4479
+ days: i - emptyCells
4480
+ });
4481
+ const isInMonth = day > 0 && day <= month.days;
4482
+ const isToday = isInMonth && date.equals(today);
4483
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
4484
+ const inRange = isInMonth && isInRange(date);
4485
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
4486
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
4487
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
4488
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
4489
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
4490
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4491
+ DateCell,
4492
+ {
4493
+ id: id ? `${id}-date-${date.toString()}` : void 0,
4494
+ testid: testid ? `${testid}-date-${date.toString()}` : void 0,
4495
+ date,
4496
+ isInMonth: !!isInMonth,
4497
+ isToday: !!isToday,
4498
+ isSelected: !!isSelected,
4499
+ inRange: !!inRange,
4500
+ isDisabled: !!isDisabled,
4501
+ onClick: () => handleDayClick(date),
4502
+ onMouseEnter: () => setHoveredDate(date),
4503
+ onMouseLeave: () => setHoveredDate(void 0),
4504
+ isRangeStart: !!isRangeStart,
4505
+ isRangeEnd: !!isRangeEnd,
4506
+ isRangeDisabled: mode === "single" && disableRange,
4507
+ cellPadding: componentPadding
4508
+ },
4509
+ i
4510
+ );
4511
+ }) })
4512
+ ]
4513
+ }
4514
+ ),
4515
+ mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4516
+ "div",
4517
+ {
4518
+ className: (0, import_clsx22.default)(
4519
+ "self-stretch bg-border-primary-normal rounded-base",
4520
+ // 1px width, full height, matches Figma divider
4521
+ "w-px"
4522
+ )
4523
+ }
4524
+ )
4525
+ ] }, month.name + month.year);
4526
+ }
4527
+
4528
+ // src/components/DateRangeInput.tsx
4529
+ var import_jsx_runtime26 = require("react/jsx-runtime");
1183
4530
  var DateRangeInput = (_a) => {
1184
4531
  var _b = _a, {
1185
4532
  id,
@@ -1204,23 +4551,23 @@ var DateRangeInput = (_a) => {
1204
4551
  "disableRange",
1205
4552
  "label"
1206
4553
  ]);
1207
- const [visible, setVisible] = (0, import_react3.useState)(false);
1208
- const [inputValue, setInputValue] = (0, import_react3.useState)("");
1209
- const [isTyping, setIsTyping] = (0, import_react3.useState)(false);
1210
- const popoverRef = (0, import_react3.useRef)(null);
1211
- const triggerRef = (0, import_react3.useRef)(null);
1212
- const [calendarPosition, setCalendarPosition] = (0, import_react3.useState)({
4554
+ const [visible, setVisible] = (0, import_react20.useState)(false);
4555
+ const [inputValue, setInputValue] = (0, import_react20.useState)("");
4556
+ const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
4557
+ const popoverRef = (0, import_react20.useRef)(null);
4558
+ const triggerRef = (0, import_react20.useRef)(null);
4559
+ const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
1213
4560
  top: 0,
1214
4561
  left: 0,
1215
4562
  width: 0
1216
4563
  });
1217
4564
  const [from, to] = value.split("|");
1218
- (0, import_react3.useEffect)(() => {
4565
+ (0, import_react20.useEffect)(() => {
1219
4566
  if (!isTyping) {
1220
4567
  setInputValue(formatDisplayValue(from, to));
1221
4568
  }
1222
4569
  }, [from, to, isTyping, disableRange]);
1223
- (0, import_react3.useLayoutEffect)(() => {
4570
+ (0, import_react20.useLayoutEffect)(() => {
1224
4571
  if (visible) {
1225
4572
  updatePosition();
1226
4573
  }
@@ -1235,7 +4582,7 @@ var DateRangeInput = (_a) => {
1235
4582
  });
1236
4583
  }
1237
4584
  };
1238
- (0, import_react3.useEffect)(() => {
4585
+ (0, import_react20.useEffect)(() => {
1239
4586
  updatePosition();
1240
4587
  const resizeObserver = new ResizeObserver(updatePosition);
1241
4588
  if (triggerRef.current) {
@@ -1247,7 +4594,7 @@ var DateRangeInput = (_a) => {
1247
4594
  window.removeEventListener("scroll", updatePosition);
1248
4595
  };
1249
4596
  }, []);
1250
- (0, import_react3.useEffect)(() => {
4597
+ (0, import_react20.useEffect)(() => {
1251
4598
  const handleKeyDown2 = (event) => {
1252
4599
  var _a2;
1253
4600
  if (event.key === "Escape" && popoverRef.current) {
@@ -1260,7 +4607,7 @@ var DateRangeInput = (_a) => {
1260
4607
  document.removeEventListener("keydown", handleKeyDown2);
1261
4608
  };
1262
4609
  }, []);
1263
- (0, import_react3.useEffect)(() => {
4610
+ (0, import_react20.useEffect)(() => {
1264
4611
  const handleClickOutside = (event) => {
1265
4612
  if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
1266
4613
  setVisible(false);
@@ -1595,8 +4942,8 @@ var DateRangeInput = (_a) => {
1595
4942
  }
1596
4943
  }
1597
4944
  };
1598
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
1599
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4945
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "relative", children: [
4946
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1600
4947
  InputBase,
1601
4948
  __spreadProps(__spreadValues({
1602
4949
  id,
@@ -1609,7 +4956,7 @@ var DateRangeInput = (_a) => {
1609
4956
  placeholder: disableRange ? "MM/DD/YYYY" : placeholder,
1610
4957
  disabled,
1611
4958
  readOnly,
1612
- after: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "calendar_month" }),
4959
+ after: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Icon, { name: "calendar_month" }),
1613
4960
  onFocus: handleFocus,
1614
4961
  onClick: handleClick,
1615
4962
  onChange: handleInputChange,
@@ -1619,8 +4966,8 @@ var DateRangeInput = (_a) => {
1619
4966
  secondaryIconColor: true
1620
4967
  })
1621
4968
  ),
1622
- visible && !readOnly && (0, import_react_dom.createPortal)(
1623
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4969
+ visible && !readOnly && (0, import_react_dom3.createPortal)(
4970
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1624
4971
  "div",
1625
4972
  {
1626
4973
  ref: (el) => {
@@ -1632,7 +4979,7 @@ var DateRangeInput = (_a) => {
1632
4979
  left: `${calendarPosition.left - 4}px`,
1633
4980
  minWidth: `${calendarPosition.width}px`
1634
4981
  },
1635
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
4982
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1636
4983
  CalendarRange,
1637
4984
  {
1638
4985
  id: id ? `${id}-calendar` : void 0,