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