@dmsi/wedgekit-react 0.0.231 → 0.0.232

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