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