@dmsi/wedgekit-react 0.0.475 → 0.0.477

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 (77) hide show
  1. package/dist/{chunk-IG2YUDHI.js → chunk-24K4HHV5.js} +4 -4
  2. package/dist/{chunk-OEMLNGE2.js → chunk-4Q7T4GJ2.js} +2 -2
  3. package/dist/chunk-4UH72JT2.js +104 -0
  4. package/dist/{chunk-KJNK7KEV.js → chunk-QMSPTD6L.js} +1 -1
  5. package/dist/{chunk-GTPSPGSJ.js → chunk-WIDUWFLX.js} +761 -47
  6. package/dist/components/Accordion.js +2 -2
  7. package/dist/components/Alert.cjs +787 -0
  8. package/dist/components/Alert.js +13 -0
  9. package/dist/components/CalendarRange.cjs +465 -160
  10. package/dist/components/CalendarRange.css +3 -0
  11. package/dist/components/CalendarRange.js +19 -19
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +918 -148
  13. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +3 -0
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +19 -18
  15. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +928 -158
  16. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +3 -0
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +19 -18
  18. package/dist/components/DataGrid/PinnedColumns.cjs +943 -173
  19. package/dist/components/DataGrid/PinnedColumns.css +3 -0
  20. package/dist/components/DataGrid/PinnedColumns.js +19 -18
  21. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +919 -149
  22. package/dist/components/DataGrid/TableBody/LoadingCell.css +3 -0
  23. package/dist/components/DataGrid/TableBody/LoadingCell.js +19 -18
  24. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +925 -155
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.css +3 -0
  26. package/dist/components/DataGrid/TableBody/TableBodyRow.js +19 -18
  27. package/dist/components/DataGrid/TableBody/index.cjs +940 -170
  28. package/dist/components/DataGrid/TableBody/index.css +3 -0
  29. package/dist/components/DataGrid/TableBody/index.js +19 -18
  30. package/dist/components/DataGrid/index.cjs +1029 -259
  31. package/dist/components/DataGrid/index.css +3 -0
  32. package/dist/components/DataGrid/index.js +19 -18
  33. package/dist/components/DataGrid/utils.cjs +919 -149
  34. package/dist/components/DataGrid/utils.css +3 -0
  35. package/dist/components/DataGrid/utils.js +19 -18
  36. package/dist/components/DataGridCell.js +2 -2
  37. package/dist/components/DateInput.cjs +70 -65
  38. package/dist/components/DateInput.css +3 -0
  39. package/dist/components/DateInput.js +25 -271
  40. package/dist/components/DateRangeInput.cjs +419 -184
  41. package/dist/components/DateRangeInput.css +3 -0
  42. package/dist/components/DateRangeInput.js +19 -19
  43. package/dist/components/FilterGroup.js +6 -6
  44. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  45. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +925 -155
  46. package/dist/components/MobileDataGrid/ColumnSelector/index.css +3 -0
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.js +19 -18
  48. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  49. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +923 -153
  50. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +3 -0
  51. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +19 -18
  52. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
  53. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
  54. package/dist/components/MobileDataGrid/index.cjs +973 -203
  55. package/dist/components/MobileDataGrid/index.css +3 -0
  56. package/dist/components/MobileDataGrid/index.js +19 -18
  57. package/dist/components/Modal.js +3 -3
  58. package/dist/components/Notification.js +3 -3
  59. package/dist/components/PDFViewer/PDFNavigation.js +2 -2
  60. package/dist/components/PDFViewer/index.js +6 -6
  61. package/dist/components/SideMenuItem.js +3 -3
  62. package/dist/components/Swatch.js +3 -3
  63. package/dist/components/Upload.js +3 -3
  64. package/dist/components/index.cjs +1212 -363
  65. package/dist/components/index.css +3 -0
  66. package/dist/components/index.js +34 -28
  67. package/dist/index.css +3 -0
  68. package/package.json +1 -1
  69. package/src/components/Alert.tsx +81 -0
  70. package/src/components/index.ts +2 -0
  71. package/dist/chunk-X35NLL3N.js +0 -493
  72. package/dist/{chunk-IT4VFU6T.js → chunk-3DEYCNUE.js} +3 -3
  73. package/dist/{chunk-GTBGPBH6.js → chunk-B53XDCLO.js} +3 -3
  74. package/dist/{chunk-ZQSD74IJ.js → chunk-IY7SXEVY.js} +3 -3
  75. package/dist/{chunk-BFFNSUNS.js → chunk-QBSEKZWX.js} +3 -3
  76. package/dist/{chunk-NIWXVOBW.js → chunk-X67L3NZI.js} +3 -3
  77. package/dist/{chunk-TVXBP5CW.js → chunk-XIXQUEYC.js} +3 -3
@@ -473,6 +473,76 @@ function formatCurrencyDisplay(value) {
473
473
  }
474
474
 
475
475
  // src/utils/date.ts
476
+ function parseInputDate(input) {
477
+ const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
478
+ if (!match) {
479
+ return null;
480
+ }
481
+ const [, month, day, year] = match;
482
+ const paddedMonth = month.padStart(2, "0");
483
+ const paddedDay = day.padStart(2, "0");
484
+ return `${year}-${paddedMonth}-${paddedDay}`;
485
+ }
486
+ function isValidDate(dateString) {
487
+ const date = new Date(dateString);
488
+ return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
489
+ }
490
+ function formatInputValue(value) {
491
+ const digits = value.replace(/\D/g, "");
492
+ if (digits.length < 2) {
493
+ return digits;
494
+ }
495
+ if (digits.length >= 4) {
496
+ return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
497
+ }
498
+ return `${digits.slice(0, 2)}/${digits.slice(2)}`;
499
+ }
500
+ function isDigit(character) {
501
+ return /\d/.test(character);
502
+ }
503
+ function isSlash(character) {
504
+ return character === "/";
505
+ }
506
+ function countDigitsUpToCursor(value, cursorPosition) {
507
+ let digitCount = 0;
508
+ for (let i = 0; i < cursorPosition && i < value.length; i++) {
509
+ if (!isDigit(value[i])) {
510
+ continue;
511
+ }
512
+ digitCount++;
513
+ }
514
+ return digitCount;
515
+ }
516
+ function findPositionAfterDigitCount(formattedValue, targetDigitCount) {
517
+ let currentDigitCount = 0;
518
+ for (let i = 0; i < formattedValue.length; i++) {
519
+ if (!isDigit(formattedValue[i])) {
520
+ continue;
521
+ }
522
+ currentDigitCount++;
523
+ if (currentDigitCount !== targetDigitCount) {
524
+ continue;
525
+ }
526
+ const positionAfterDigit = i + 1;
527
+ const nextCharacter = formattedValue[positionAfterDigit];
528
+ if (nextCharacter && isSlash(nextCharacter)) {
529
+ return positionAfterDigit + 1;
530
+ }
531
+ return positionAfterDigit;
532
+ }
533
+ return formattedValue.length;
534
+ }
535
+ function calculateCursorPosition(originalValue, formattedValue, originalPosition) {
536
+ const targetDigitCount = countDigitsUpToCursor(
537
+ originalValue,
538
+ originalPosition
539
+ );
540
+ const newPosition = findPositionAfterDigitCount(
541
+ formattedValue,
542
+ targetDigitCount
543
+ );
544
+ return Math.min(newPosition, formattedValue.length);
545
+ }
476
546
  function parseDateParts(dateString) {
477
547
  const [yearStr, monthStr, dayStr] = dateString.split("-");
478
548
  if (!yearStr || !monthStr || !dayStr) {
@@ -3774,23 +3844,718 @@ var Tooltip = ({
3774
3844
  };
3775
3845
  Tooltip.displayName = "Tooltip";
3776
3846
 
3777
- // src/components/Accordion.tsx
3778
- var import_clsx19 = __toESM(require("clsx"), 1);
3847
+ // src/components/DateInput.tsx
3848
+ var import_react19 = require("react");
3849
+ var import_react_dom3 = require("react-dom");
3779
3850
 
3780
- // src/components/Card.tsx
3851
+ // src/components/CalendarRange.tsx
3781
3852
  var import_clsx17 = __toESM(require("clsx"), 1);
3853
+ var import_react18 = __toESM(require("react"), 1);
3854
+ var import_polyfill = require("@js-temporal/polyfill");
3782
3855
  var import_jsx_runtime19 = require("react/jsx-runtime");
3856
+ function DateCell(_a) {
3857
+ var _b = _a, {
3858
+ date,
3859
+ isInMonth,
3860
+ isToday,
3861
+ isSelected,
3862
+ inRange,
3863
+ isDisabled,
3864
+ isRangeStart,
3865
+ isRangeEnd,
3866
+ onClick,
3867
+ onMouseEnter,
3868
+ onMouseLeave,
3869
+ cellPadding = "",
3870
+ isRangeDisabled = false,
3871
+ id,
3872
+ testid
3873
+ } = _b, props = __objRest(_b, [
3874
+ "date",
3875
+ "isInMonth",
3876
+ "isToday",
3877
+ "isSelected",
3878
+ "inRange",
3879
+ "isDisabled",
3880
+ "isRangeStart",
3881
+ "isRangeEnd",
3882
+ "onClick",
3883
+ "onMouseEnter",
3884
+ "onMouseLeave",
3885
+ "cellPadding",
3886
+ "isRangeDisabled",
3887
+ "id",
3888
+ "testid"
3889
+ ]);
3890
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3891
+ "span",
3892
+ __spreadProps(__spreadValues({}, props), {
3893
+ id,
3894
+ "data-testid": testid,
3895
+ className: (0, import_clsx17.default)(
3896
+ "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
3897
+ typography.caption,
3898
+ cellPadding,
3899
+ !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
3900
+ !isInMonth && "border-transparent",
3901
+ // Today: subtle border ring
3902
+ isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
3903
+ // Selected: Figma blue, white text, strong shadow
3904
+ isSelected && "bg-action-400 text-white border-action-400 z-10",
3905
+ !isSelected && !inRange && "rounded-base",
3906
+ // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
3907
+ (isRangeDisabled || !inRange && isSelected) && "rounded-base",
3908
+ inRange && isSelected && "hover:border-action-500",
3909
+ // In range: Figma light blue background
3910
+ inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
3911
+ // Disabled: Figma gray, no pointer, no hover
3912
+ isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
3913
+ "text-text-primary-normal cursor-pointer",
3914
+ // Figma hover: blue bg, blue text (or red text if selected)
3915
+ isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
3916
+ // Figma active: darker blue bg, white text
3917
+ "active:bg-action-300 active:text-white",
3918
+ // Figma focus: ring
3919
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
3920
+ ],
3921
+ isRangeStart && "rounded-l",
3922
+ isRangeEnd && "rounded-r"
3923
+ ),
3924
+ tabIndex: isDisabled ? -1 : 0,
3925
+ "aria-disabled": isDisabled,
3926
+ onClick: () => !isDisabled && isInMonth && onClick(),
3927
+ onMouseEnter: () => isInMonth && onMouseEnter(),
3928
+ onMouseLeave: () => isInMonth && onMouseLeave(),
3929
+ children: isInMonth ? date.day : ""
3930
+ })
3931
+ );
3932
+ }
3933
+ function CalendarRange({
3934
+ from,
3935
+ to,
3936
+ onChange,
3937
+ isDateAvailable,
3938
+ mode = "double",
3939
+ cardStyle = false,
3940
+ disableRange = false,
3941
+ id,
3942
+ testid
3943
+ }) {
3944
+ const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
3945
+ const parseDate = (d) => {
3946
+ if (!d) {
3947
+ return void 0;
3948
+ }
3949
+ try {
3950
+ if (typeof d === "number") {
3951
+ return import_polyfill.Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
3952
+ }
3953
+ if (typeof d === "string") {
3954
+ return import_polyfill.Temporal.PlainDate.from(d);
3955
+ }
3956
+ return void 0;
3957
+ } catch (error) {
3958
+ console.error("Invalid date format:", d, error);
3959
+ return import_polyfill.Temporal.Now.plainDateISO();
3960
+ }
3961
+ };
3962
+ const fromDate = parseDate(from);
3963
+ const toDate = parseDate(to);
3964
+ const today = import_polyfill.Temporal.Now.plainDateISO();
3965
+ const [baseMonth, setBaseMonth] = (0, import_react18.useState)(
3966
+ fromDate != null ? fromDate : today.with({ day: 1 })
3967
+ );
3968
+ const [selecting, setSelecting] = (0, import_react18.useState)("from");
3969
+ const [pendingFrom, setPendingFrom] = (0, import_react18.useState)(void 0);
3970
+ const [hoveredDate, setHoveredDate] = (0, import_react18.useState)(void 0);
3971
+ (0, import_react18.useEffect)(() => {
3972
+ if (fromDate) {
3973
+ setBaseMonth(fromDate.with({ day: 1 }));
3974
+ } else if (toDate) {
3975
+ setBaseMonth(toDate.with({ day: 1 }));
3976
+ }
3977
+ }, [from, to]);
3978
+ (0, import_react18.useEffect)(() => {
3979
+ if (fromDate && toDate) {
3980
+ setSelecting("from");
3981
+ setPendingFrom(void 0);
3982
+ setHoveredDate(void 0);
3983
+ }
3984
+ }, [from, to]);
3985
+ function getMonthData(monthOffset) {
3986
+ const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
3987
+ const days = monthDate.daysInMonth;
3988
+ const firstDayOffset = monthDate.dayOfWeek % 7;
3989
+ return {
3990
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
3991
+ year: monthDate.year,
3992
+ days,
3993
+ firstDayOffset,
3994
+ date: monthDate
3995
+ };
3996
+ }
3997
+ function getMonthDataWith(monthOffset) {
3998
+ const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
3999
+ const days = monthDate.daysInMonth;
4000
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4001
+ return {
4002
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4003
+ year: monthDate.year,
4004
+ days,
4005
+ firstDayOffset,
4006
+ date: monthDate
4007
+ };
4008
+ }
4009
+ function handleDayClick(date) {
4010
+ if (isDateAvailable && !isDateAvailable(date)) return;
4011
+ if (mode === "single" && disableRange) {
4012
+ if (onChange) {
4013
+ onChange(date.toString(), date.toString());
4014
+ }
4015
+ return;
4016
+ }
4017
+ if (selecting === "from") {
4018
+ setPendingFrom(date);
4019
+ setSelecting("to");
4020
+ setHoveredDate(void 0);
4021
+ } else if (pendingFrom) {
4022
+ if (onChange) {
4023
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
4024
+ onChange(start.toString(), end.toString());
4025
+ }
4026
+ setPendingFrom(void 0);
4027
+ setSelecting("from");
4028
+ setHoveredDate(void 0);
4029
+ }
4030
+ }
4031
+ function isInRange(date) {
4032
+ if (mode === "single" && disableRange) {
4033
+ return false;
4034
+ }
4035
+ if (pendingFrom && selecting === "to" && hoveredDate) {
4036
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
4037
+ return import_polyfill.Temporal.PlainDate.compare(date, start) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, end) <= 0;
4038
+ }
4039
+ if (!pendingFrom && fromDate && toDate) {
4040
+ return import_polyfill.Temporal.PlainDate.compare(date, fromDate) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, toDate) <= 0;
4041
+ }
4042
+ return false;
4043
+ }
4044
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4045
+ "div",
4046
+ {
4047
+ id,
4048
+ "data-testid": testid,
4049
+ className: (0, import_clsx17.default)(
4050
+ "relative bg-background-grouped-primary-normal rounded-base w-fit",
4051
+ layoutPaddding,
4052
+ layoutGap,
4053
+ cardStyle && "shadow-4",
4054
+ // baseTransition,
4055
+ "overflow-hidden"
4056
+ ),
4057
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4058
+ "div",
4059
+ {
4060
+ className: (0, import_clsx17.default)(
4061
+ "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
4062
+ layoutGap
4063
+ ),
4064
+ children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
4065
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4066
+ CalendarPane,
4067
+ {
4068
+ getMonthData,
4069
+ getMonthDataWith,
4070
+ offset,
4071
+ idx,
4072
+ id,
4073
+ testid,
4074
+ baseMonth,
4075
+ setBaseMonth,
4076
+ mode,
4077
+ pendingFrom,
4078
+ weekDays,
4079
+ fromDate,
4080
+ toDate,
4081
+ isDateAvailable,
4082
+ disableRange,
4083
+ hoveredDate,
4084
+ isInRange,
4085
+ today,
4086
+ setHoveredDate,
4087
+ handleDayClick
4088
+ },
4089
+ idx
4090
+ );
4091
+ })
4092
+ }
4093
+ )
4094
+ }
4095
+ );
4096
+ }
4097
+ function CalendarPane({
4098
+ getMonthData,
4099
+ getMonthDataWith,
4100
+ offset,
4101
+ idx,
4102
+ id,
4103
+ testid,
4104
+ baseMonth,
4105
+ setBaseMonth,
4106
+ mode,
4107
+ pendingFrom,
4108
+ weekDays,
4109
+ fromDate,
4110
+ toDate,
4111
+ isDateAvailable,
4112
+ disableRange,
4113
+ hoveredDate,
4114
+ isInRange,
4115
+ today,
4116
+ setHoveredDate,
4117
+ handleDayClick
4118
+ }) {
4119
+ const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
4120
+ const years = Array.from({ length: 100 }).map(
4121
+ (_, i) => baseMonth.year - 50 + i
4122
+ );
4123
+ const [monthMenuOpen, setMonthMenuOpen] = (0, import_react18.useState)(false);
4124
+ const [yearMenuOpen, setYearMenuOpen] = (0, import_react18.useState)(false);
4125
+ const monthMenuRef = (0, import_react18.useRef)(null);
4126
+ const yearMenuRef = (0, import_react18.useRef)(null);
4127
+ const month = getMonthData(offset);
4128
+ const totalCells = 42;
4129
+ const emptyCells = month.firstDayOffset;
4130
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react18.default.Fragment, { children: [
4131
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4132
+ "div",
4133
+ {
4134
+ className: (0, import_clsx17.default)("flex flex-col"),
4135
+ children: [
4136
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
4137
+ "div",
4138
+ {
4139
+ className: (0, import_clsx17.default)(
4140
+ "flex flex-row items-center justify-between",
4141
+ typography.label,
4142
+ "text-text-action-primary-normal"
4143
+ ),
4144
+ children: [
4145
+ idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4146
+ "button",
4147
+ {
4148
+ id: id ? `${id}-prev-month-button` : void 0,
4149
+ "data-testid": testid ? `${testid}-prev-month-button` : void 0,
4150
+ type: "button",
4151
+ className: (0, import_clsx17.default)(
4152
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4153
+ componentPadding
4154
+ ),
4155
+ "aria-label": "Previous month",
4156
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
4157
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "chevron_left", size: 24 })
4158
+ }
4159
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: (0, import_clsx17.default)(componentPadding, "mr-1") }),
4160
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
4161
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4162
+ "button",
4163
+ {
4164
+ ref: (el) => {
4165
+ monthMenuRef.current = el;
4166
+ },
4167
+ type: "button",
4168
+ onClick: () => {
4169
+ setMonthMenuOpen(true);
4170
+ setYearMenuOpen(false);
4171
+ },
4172
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4173
+ children: month.name
4174
+ }
4175
+ ),
4176
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4177
+ Menu,
4178
+ {
4179
+ show: monthMenuOpen,
4180
+ positionTo: monthMenuRef,
4181
+ setShow: () => setMonthMenuOpen(false),
4182
+ children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4183
+ MenuOption,
4184
+ {
4185
+ selected: baseMonth.month === x + 1,
4186
+ onClick: () => {
4187
+ setBaseMonth(baseMonth.with({ month: x + 1 }));
4188
+ setMonthMenuOpen(false);
4189
+ },
4190
+ children: m.name
4191
+ },
4192
+ m.name
4193
+ ))
4194
+ }
4195
+ ),
4196
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4197
+ "button",
4198
+ {
4199
+ ref: (el) => {
4200
+ yearMenuRef.current = el;
4201
+ },
4202
+ type: "button",
4203
+ onClick: () => {
4204
+ setYearMenuOpen(true);
4205
+ setMonthMenuOpen(false);
4206
+ },
4207
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4208
+ children: month.year
4209
+ }
4210
+ ),
4211
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4212
+ Menu,
4213
+ {
4214
+ show: yearMenuOpen,
4215
+ positionTo: yearMenuRef,
4216
+ setShow: () => setYearMenuOpen(false),
4217
+ children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4218
+ MenuOption,
4219
+ {
4220
+ selected: baseMonth.year === y,
4221
+ onClick: () => {
4222
+ setBaseMonth(baseMonth.with({ year: y }));
4223
+ setYearMenuOpen(false);
4224
+ },
4225
+ children: y
4226
+ },
4227
+ y
4228
+ ))
4229
+ }
4230
+ )
4231
+ ] }),
4232
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4233
+ "button",
4234
+ {
4235
+ id: id ? `${id}-next-month-button` : void 0,
4236
+ "data-testid": testid ? `${testid}-next-month-button` : void 0,
4237
+ type: "button",
4238
+ className: (0, import_clsx17.default)(
4239
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4240
+ componentPadding
4241
+ ),
4242
+ "aria-label": "Next month",
4243
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
4244
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "chevron_right", size: 24 })
4245
+ }
4246
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: (0, import_clsx17.default)(componentPadding, "ml-1") })
4247
+ ]
4248
+ }
4249
+ ),
4250
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_clsx17.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4251
+ "span",
4252
+ {
4253
+ className: (0, import_clsx17.default)(
4254
+ typography.caption,
4255
+ "text-text-secondary-normal text-center",
4256
+ "w-10"
4257
+ ),
4258
+ children: d
4259
+ },
4260
+ d
4261
+ )) }),
4262
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_clsx17.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
4263
+ const day = i - emptyCells + 1;
4264
+ const date = month.date.with({ day: 1 }).add({
4265
+ days: i - emptyCells
4266
+ });
4267
+ const isInMonth = day > 0 && day <= month.days;
4268
+ const isToday = isInMonth && date.equals(today);
4269
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
4270
+ const inRange = isInMonth && isInRange(date);
4271
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
4272
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
4273
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
4274
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
4275
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
4276
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4277
+ DateCell,
4278
+ {
4279
+ id: id ? `${id}-date-${date.toString()}` : void 0,
4280
+ testid: testid ? `${testid}-date-${date.toString()}` : void 0,
4281
+ date,
4282
+ isInMonth: !!isInMonth,
4283
+ isToday: !!isToday,
4284
+ isSelected: !!isSelected,
4285
+ inRange: !!inRange,
4286
+ isDisabled: !!isDisabled,
4287
+ onClick: () => handleDayClick(date),
4288
+ onMouseEnter: () => setHoveredDate(date),
4289
+ onMouseLeave: () => setHoveredDate(void 0),
4290
+ isRangeStart: !!isRangeStart,
4291
+ isRangeEnd: !!isRangeEnd,
4292
+ isRangeDisabled: mode === "single" && disableRange,
4293
+ cellPadding: componentPadding
4294
+ },
4295
+ i
4296
+ );
4297
+ }) })
4298
+ ]
4299
+ }
4300
+ ),
4301
+ mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
4302
+ "div",
4303
+ {
4304
+ className: (0, import_clsx17.default)(
4305
+ "self-stretch bg-border-primary-normal rounded-base",
4306
+ // 1px width, full height, matches Figma divider
4307
+ "w-px"
4308
+ )
4309
+ }
4310
+ )
4311
+ ] }, month.name + month.year);
4312
+ }
3783
4313
 
3784
- // src/components/Stack.tsx
3785
- var import_clsx18 = __toESM(require("clsx"), 1);
4314
+ // src/components/DateInput.tsx
3786
4315
  var import_jsx_runtime20 = require("react/jsx-runtime");
4316
+ var DateInput = (_a) => {
4317
+ var _b = _a, {
4318
+ id,
4319
+ testid,
4320
+ value,
4321
+ onChange,
4322
+ placeholder = "MM/DD/YYYY",
4323
+ disabled,
4324
+ readOnly = false,
4325
+ label
4326
+ } = _b, props = __objRest(_b, [
4327
+ "id",
4328
+ "testid",
4329
+ "value",
4330
+ "onChange",
4331
+ "placeholder",
4332
+ "disabled",
4333
+ "readOnly",
4334
+ "label"
4335
+ ]);
4336
+ const [visible, setVisible] = (0, import_react19.useState)(false);
4337
+ const [inputValue, setInputValue] = (0, import_react19.useState)("");
4338
+ const [isTyping, setIsTyping] = (0, import_react19.useState)(false);
4339
+ const popoverRef = (0, import_react19.useRef)(null);
4340
+ const triggerRef = (0, import_react19.useRef)(null);
4341
+ const rootRef = (0, import_react19.useRef)(null);
4342
+ const [calendarPosition, setCalendarPosition] = (0, import_react19.useState)({
4343
+ top: 0,
4344
+ left: 0,
4345
+ width: 0
4346
+ });
4347
+ const [from, to] = [value, ""];
4348
+ (0, import_react19.useEffect)(() => {
4349
+ if (!isTyping) {
4350
+ setInputValue(formatDisplayValue(from));
4351
+ }
4352
+ }, [from, isTyping]);
4353
+ (0, import_react19.useLayoutEffect)(() => {
4354
+ if (visible) {
4355
+ updatePosition();
4356
+ }
4357
+ }, [visible]);
4358
+ const updatePosition = () => {
4359
+ if (rootRef.current) {
4360
+ const rect = rootRef.current.getBoundingClientRect();
4361
+ setCalendarPosition({
4362
+ top: rect.bottom + window.scrollY,
4363
+ left: rect.left + window.scrollX,
4364
+ width: rect.width
4365
+ });
4366
+ }
4367
+ };
4368
+ (0, import_react19.useEffect)(() => {
4369
+ updatePosition();
4370
+ const resizeObserver = new ResizeObserver(updatePosition);
4371
+ if (triggerRef.current) {
4372
+ resizeObserver.observe(triggerRef.current);
4373
+ }
4374
+ window.addEventListener("scroll", updatePosition);
4375
+ return () => {
4376
+ resizeObserver.disconnect();
4377
+ window.removeEventListener("scroll", updatePosition);
4378
+ };
4379
+ }, []);
4380
+ (0, import_react19.useEffect)(() => {
4381
+ const handleKeyDown2 = (event) => {
4382
+ var _a2;
4383
+ if (event.key === "Escape" && popoverRef.current) {
4384
+ setVisible(false);
4385
+ (_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
4386
+ }
4387
+ };
4388
+ document.addEventListener("keydown", handleKeyDown2);
4389
+ return () => {
4390
+ document.removeEventListener("keydown", handleKeyDown2);
4391
+ };
4392
+ });
4393
+ (0, import_react19.useEffect)(() => {
4394
+ const handleClickOutside = (event) => {
4395
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
4396
+ setVisible(false);
4397
+ }
4398
+ };
4399
+ document.addEventListener("mousedown", handleClickOutside);
4400
+ return () => {
4401
+ document.removeEventListener("mousedown", handleClickOutside);
4402
+ };
4403
+ }, []);
4404
+ function handleDateChange(fromValue) {
4405
+ onChange(fromValue);
4406
+ setVisible(false);
4407
+ setIsTyping(false);
4408
+ }
4409
+ const handleFocus = () => {
4410
+ if (readOnly) return;
4411
+ setVisible(true);
4412
+ };
4413
+ const handleClick = () => {
4414
+ handleFocus();
4415
+ };
4416
+ const handleInputChange = (event) => {
4417
+ if (readOnly) return;
4418
+ const rawValue = event.target.value;
4419
+ const cursorPosition = event.target.selectionStart || 0;
4420
+ setIsTyping(true);
4421
+ const formattedValue = formatInputValue(rawValue);
4422
+ setInputValue(formattedValue);
4423
+ requestAnimationFrame(() => {
4424
+ if (triggerRef.current) {
4425
+ const newPosition = calculateCursorPosition(
4426
+ rawValue,
4427
+ formattedValue,
4428
+ cursorPosition
4429
+ );
4430
+ triggerRef.current.setSelectionRange(newPosition, newPosition);
4431
+ }
4432
+ });
4433
+ const parsedDate = parseInputDate(formattedValue);
4434
+ if (parsedDate && isValidDate(parsedDate)) {
4435
+ onChange(parsedDate);
4436
+ }
4437
+ };
4438
+ const handleBlur = () => {
4439
+ setIsTyping(false);
4440
+ const parsedDate = parseInputDate(inputValue);
4441
+ if (!parsedDate || !isValidDate(parsedDate)) {
4442
+ setInputValue(formatDisplayValue(from));
4443
+ }
4444
+ };
4445
+ const handleKeyDown = (event) => {
4446
+ if (event.key === "Backspace") {
4447
+ const input = event.target;
4448
+ const cursorPosition = input.selectionStart || 0;
4449
+ const value2 = input.value;
4450
+ if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
4451
+ event.preventDefault();
4452
+ const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
4453
+ const formattedValue = formatInputValue(newValue);
4454
+ setInputValue(formattedValue);
4455
+ requestAnimationFrame(() => {
4456
+ if (triggerRef.current) {
4457
+ const newPosition = Math.max(0, cursorPosition - 2);
4458
+ triggerRef.current.setSelectionRange(newPosition, newPosition);
4459
+ }
4460
+ });
4461
+ setIsTyping(true);
4462
+ return;
4463
+ }
4464
+ }
4465
+ if (event.key === "Enter") {
4466
+ const parsedDate = parseInputDate(inputValue);
4467
+ if (parsedDate && isValidDate(parsedDate)) {
4468
+ onChange(parsedDate);
4469
+ setVisible(false);
4470
+ setIsTyping(false);
4471
+ }
4472
+ }
4473
+ };
4474
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative", children: [
4475
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4476
+ InputBase,
4477
+ __spreadProps(__spreadValues({
4478
+ id,
4479
+ testid,
4480
+ ref: (el) => {
4481
+ triggerRef.current = el;
4482
+ }
4483
+ }, props), {
4484
+ wrapperRef: rootRef,
4485
+ value: inputValue,
4486
+ placeholder,
4487
+ disabled,
4488
+ readOnly,
4489
+ after: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "calendar_month" }),
4490
+ onFocus: handleFocus,
4491
+ onClick: handleClick,
4492
+ onChange: handleInputChange,
4493
+ onBlur: handleBlur,
4494
+ onKeyDown: handleKeyDown,
4495
+ label,
4496
+ secondaryIconColor: true
4497
+ })
4498
+ ),
4499
+ visible && !readOnly && (0, import_react_dom3.createPortal)(
4500
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4501
+ "div",
4502
+ {
4503
+ ref: (el) => {
4504
+ popoverRef.current = el;
4505
+ },
4506
+ className: "absolute z-40 bg-white",
4507
+ style: {
4508
+ top: `${calendarPosition.top + 4}px`,
4509
+ left: `${calendarPosition.left}px`,
4510
+ minWidth: `${calendarPosition.width}px`
4511
+ },
4512
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4513
+ CalendarRange,
4514
+ {
4515
+ id: id ? `${id}-calendar` : void 0,
4516
+ testid: testid ? `${testid}-calendar` : void 0,
4517
+ from,
4518
+ to: to || from,
4519
+ onChange: handleDateChange,
4520
+ cardStyle: true,
4521
+ mode: "single",
4522
+ disableRange: true
4523
+ }
4524
+ )
4525
+ }
4526
+ ),
4527
+ findDocumentRoot(popoverRef.current)
4528
+ )
4529
+ ] });
4530
+ };
4531
+ DateInput.displayName = "DateInput";
4532
+ function formatDisplayValue(from) {
4533
+ if (!from) {
4534
+ return "";
4535
+ }
4536
+ if (!isValidDate(from)) {
4537
+ return "";
4538
+ }
4539
+ return formatDate(from);
4540
+ }
3787
4541
 
3788
4542
  // src/components/Accordion.tsx
4543
+ var import_clsx20 = __toESM(require("clsx"), 1);
4544
+
4545
+ // src/components/Card.tsx
4546
+ var import_clsx18 = __toESM(require("clsx"), 1);
3789
4547
  var import_jsx_runtime21 = require("react/jsx-runtime");
3790
4548
 
3791
- // src/components/Heading.tsx
3792
- var import_clsx20 = __toESM(require("clsx"), 1);
4549
+ // src/components/Stack.tsx
4550
+ var import_clsx19 = __toESM(require("clsx"), 1);
3793
4551
  var import_jsx_runtime22 = require("react/jsx-runtime");
4552
+
4553
+ // src/components/Accordion.tsx
4554
+ var import_jsx_runtime23 = require("react/jsx-runtime");
4555
+
4556
+ // src/components/Heading.tsx
4557
+ var import_clsx21 = __toESM(require("clsx"), 1);
4558
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3794
4559
  var Heading = (_a) => {
3795
4560
  var _b = _a, {
3796
4561
  className,
@@ -3813,12 +4578,12 @@ var Heading = (_a) => {
3813
4578
  ]);
3814
4579
  const defaultElement = variant === "heading1" ? "h1" : variant === "heading2" ? "h2" : "h3";
3815
4580
  const Element = as != null ? as : defaultElement;
3816
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4581
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
3817
4582
  Element,
3818
4583
  __spreadProps(__spreadValues({
3819
4584
  id,
3820
4585
  "data-testid": testid,
3821
- className: (0, import_clsx20.default)(
4586
+ className: (0, import_clsx21.default)(
3822
4587
  typography[variant],
3823
4588
  className,
3824
4589
  align === "left" && "text-left",
@@ -3834,43 +4599,43 @@ var Heading = (_a) => {
3834
4599
  );
3835
4600
  };
3836
4601
  Heading.displayName = "Heading";
3837
- var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
3838
- var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
3839
- var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
4602
+ var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
4603
+ var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
4604
+ var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
3840
4605
  Heading1.displayName = "Heading1";
3841
4606
  Heading2.displayName = "Heading2";
3842
4607
  Heading3.displayName = "Heading3";
3843
4608
 
3844
4609
  // src/components/Theme.tsx
3845
- var import_jsx_runtime23 = require("react/jsx-runtime");
4610
+ var import_jsx_runtime25 = require("react/jsx-runtime");
3846
4611
 
3847
4612
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
3848
- var import_react20 = require("react");
4613
+ var import_react22 = require("react");
3849
4614
 
3850
4615
  // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
3851
- var import_react19 = require("react");
4616
+ var import_react21 = require("react");
3852
4617
 
3853
4618
  // src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
3854
- var import_react18 = require("react");
3855
- var GridContext = (0, import_react18.createContext)(null);
4619
+ var import_react20 = require("react");
4620
+ var GridContext = (0, import_react20.createContext)(null);
3856
4621
 
3857
4622
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
3858
- var import_jsx_runtime24 = require("react/jsx-runtime");
4623
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3859
4624
 
3860
4625
  // src/components/MobileDataGrid/MobileDataGridHeader.tsx
3861
- var import_jsx_runtime25 = require("react/jsx-runtime");
4626
+ var import_jsx_runtime27 = require("react/jsx-runtime");
3862
4627
 
3863
4628
  // src/components/MobileDataGrid/GridContextProvider/index.tsx
3864
- var import_react21 = require("react");
3865
- var import_jsx_runtime26 = require("react/jsx-runtime");
4629
+ var import_react23 = require("react");
4630
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3866
4631
 
3867
4632
  // src/components/Modal.tsx
3868
- var import_clsx25 = __toESM(require("clsx"), 1);
3869
- var import_react23 = require("react");
4633
+ var import_clsx26 = __toESM(require("clsx"), 1);
4634
+ var import_react25 = require("react");
3870
4635
 
3871
4636
  // src/components/ModalHeader.tsx
3872
- var import_clsx21 = __toESM(require("clsx"), 1);
3873
- var import_jsx_runtime27 = require("react/jsx-runtime");
4637
+ var import_clsx22 = __toESM(require("clsx"), 1);
4638
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3874
4639
  var ModalHeader = ({
3875
4640
  title,
3876
4641
  hideCloseIcon,
@@ -3881,12 +4646,12 @@ var ModalHeader = ({
3881
4646
  testid,
3882
4647
  headerClassname
3883
4648
  }) => {
3884
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4649
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3885
4650
  "div",
3886
4651
  {
3887
4652
  id,
3888
4653
  "data-testid": testid,
3889
- className: (0, import_clsx21.default)(
4654
+ className: (0, import_clsx22.default)(
3890
4655
  "flex justify-between items-center",
3891
4656
  headerIconAlign === "center" && "justify-center",
3892
4657
  headerIconAlign === "right" && "justify-end",
@@ -3896,9 +4661,9 @@ var ModalHeader = ({
3896
4661
  headerClassname
3897
4662
  ),
3898
4663
  children: [
3899
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_clsx21.default)("flex items-center flex-1", layoutGroupGap), children: [
4664
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: (0, import_clsx22.default)("flex items-center flex-1", layoutGroupGap), children: [
3900
4665
  headerIcon,
3901
- title && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4666
+ title && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3902
4667
  Heading2,
3903
4668
  {
3904
4669
  id: id ? `${id}-title` : void 0,
@@ -3908,7 +4673,7 @@ var ModalHeader = ({
3908
4673
  }
3909
4674
  )
3910
4675
  ] }),
3911
- !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4676
+ !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3912
4677
  Button,
3913
4678
  {
3914
4679
  id: id ? `${id}-close-button` : void 0,
@@ -3916,7 +4681,7 @@ var ModalHeader = ({
3916
4681
  iconOnly: true,
3917
4682
  variant: "tertiary",
3918
4683
  onClick: onClose,
3919
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: "close", size: 24 }) })
4684
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "close", size: 24 }) })
3920
4685
  }
3921
4686
  )
3922
4687
  ]
@@ -3926,20 +4691,20 @@ var ModalHeader = ({
3926
4691
  ModalHeader.displayName = "ModalHeader";
3927
4692
 
3928
4693
  // src/components/ModalContent.tsx
3929
- var import_clsx22 = __toESM(require("clsx"), 1);
3930
- var import_jsx_runtime28 = require("react/jsx-runtime");
4694
+ var import_clsx23 = __toESM(require("clsx"), 1);
4695
+ var import_jsx_runtime30 = require("react/jsx-runtime");
3931
4696
  function ModalContent({
3932
4697
  fixedHeightScrolling,
3933
4698
  children,
3934
4699
  id,
3935
4700
  testid
3936
4701
  }) {
3937
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
4702
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
3938
4703
  "div",
3939
4704
  {
3940
4705
  id,
3941
4706
  "data-testid": testid,
3942
- className: (0, import_clsx22.default)(
4707
+ className: (0, import_clsx23.default)(
3943
4708
  "flex-grow desktop:flex-grow-0",
3944
4709
  layoutPaddding,
3945
4710
  fixedHeightScrolling && "overflow-auto"
@@ -3951,8 +4716,8 @@ function ModalContent({
3951
4716
  ModalContent.displayName = "ModalContent";
3952
4717
 
3953
4718
  // src/components/ModalButtons.tsx
3954
- var import_clsx23 = __toESM(require("clsx"), 1);
3955
- var import_jsx_runtime29 = require("react/jsx-runtime");
4719
+ var import_clsx24 = __toESM(require("clsx"), 1);
4720
+ var import_jsx_runtime31 = require("react/jsx-runtime");
3956
4721
  var ModalButtons = ({
3957
4722
  onClose,
3958
4723
  onContinue,
@@ -3960,36 +4725,36 @@ var ModalButtons = ({
3960
4725
  id,
3961
4726
  testid
3962
4727
  }) => {
3963
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4728
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3964
4729
  "div",
3965
4730
  {
3966
4731
  id,
3967
4732
  "data-testid": testid,
3968
- className: (0, import_clsx23.default)(
4733
+ className: (0, import_clsx24.default)(
3969
4734
  "border-t border-neutral-300 flex justify-end",
3970
4735
  layoutPaddding,
3971
4736
  layoutGroupGap
3972
4737
  ),
3973
- children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
3974
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4738
+ children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4739
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3975
4740
  Button,
3976
4741
  {
3977
4742
  id: id ? `${id}-close-button` : void 0,
3978
4743
  testid: testid ? `${testid}-close-button` : void 0,
3979
4744
  variant: "secondary",
3980
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "close", size: 24 }),
4745
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "close", size: 24 }),
3981
4746
  onClick: onClose,
3982
4747
  className: "max-sm:w-full",
3983
4748
  children: "Close"
3984
4749
  }
3985
4750
  ),
3986
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4751
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
3987
4752
  Button,
3988
4753
  {
3989
4754
  id: id ? `${id}-continue-button` : void 0,
3990
4755
  testid: testid ? `${testid}-continue-button` : void 0,
3991
4756
  variant: "primary",
3992
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "check", size: 24 }),
4757
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "check", size: 24 }),
3993
4758
  className: "max-sm:w-full",
3994
4759
  onClick: onContinue,
3995
4760
  children: "Continue"
@@ -4002,8 +4767,8 @@ var ModalButtons = ({
4002
4767
  ModalButtons.displayName = "ModalButtons";
4003
4768
 
4004
4769
  // src/components/ModalScrim.tsx
4005
- var import_clsx24 = __toESM(require("clsx"), 1);
4006
- var import_jsx_runtime30 = require("react/jsx-runtime");
4770
+ var import_clsx25 = __toESM(require("clsx"), 1);
4771
+ var import_jsx_runtime32 = require("react/jsx-runtime");
4007
4772
  var ModalScrim = ({
4008
4773
  show = false,
4009
4774
  size = "small",
@@ -4013,12 +4778,12 @@ var ModalScrim = ({
4013
4778
  id,
4014
4779
  testid
4015
4780
  }) => {
4016
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4781
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4017
4782
  "div",
4018
4783
  {
4019
4784
  id,
4020
4785
  "data-testid": testid,
4021
- className: (0, import_clsx24.default)(
4786
+ className: (0, import_clsx25.default)(
4022
4787
  "overflow-y-auto h-screen transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center group bg-neutral-600/50 fixed opacity-0",
4023
4788
  !show && " pointer-events-none",
4024
4789
  size === "small" && "p-4",
@@ -4034,14 +4799,14 @@ var ModalScrim = ({
4034
4799
  ModalScrim.displayName = "ModalScrim";
4035
4800
 
4036
4801
  // src/components/Modal.tsx
4037
- var import_react_dom3 = require("react-dom");
4802
+ var import_react_dom4 = require("react-dom");
4038
4803
  var import_react_use = require("react-use");
4039
4804
 
4040
4805
  // src/components/useMounted.tsx
4041
- var import_react22 = require("react");
4806
+ var import_react24 = require("react");
4042
4807
  var useMounted = () => {
4043
- const [isMounted, setIsMounted] = (0, import_react22.useState)(false);
4044
- (0, import_react22.useEffect)(() => {
4808
+ const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
4809
+ (0, import_react24.useEffect)(() => {
4045
4810
  setIsMounted(true);
4046
4811
  return () => setIsMounted(false);
4047
4812
  }, []);
@@ -4049,7 +4814,7 @@ var useMounted = () => {
4049
4814
  };
4050
4815
 
4051
4816
  // src/components/Modal.tsx
4052
- var import_jsx_runtime31 = require("react/jsx-runtime");
4817
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4053
4818
  var fadeInScale = (element, duration = 300) => element.animate(
4054
4819
  [
4055
4820
  { opacity: 0, transform: "scale(0.95)" },
@@ -4133,12 +4898,12 @@ var Modal = ({
4133
4898
  }) => {
4134
4899
  var _a;
4135
4900
  const mounted = useMounted();
4136
- const modalRef = (0, import_react23.useRef)(null);
4137
- const bgRef = (0, import_react23.useRef)(null);
4901
+ const modalRef = (0, import_react25.useRef)(null);
4902
+ const bgRef = (0, import_react25.useRef)(null);
4138
4903
  const wasOpen = (0, import_react_use.usePrevious)(open);
4139
4904
  const isMobile = useMatchesMobile();
4140
4905
  const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
4141
- (0, import_react23.useEffect)(() => {
4906
+ (0, import_react25.useEffect)(() => {
4142
4907
  if (!mounted) return;
4143
4908
  if (!modalRef.current || !bgRef.current) {
4144
4909
  console.error("Modal or background reference is not set.");
@@ -4158,7 +4923,7 @@ var Modal = ({
4158
4923
  bgFadeIn(bgRef.current);
4159
4924
  }
4160
4925
  }, [mounted, onClose, open, wasOpen]);
4161
- const handleKeyDown = (0, import_react23.useCallback)(
4926
+ const handleKeyDown = (0, import_react25.useCallback)(
4162
4927
  (e) => {
4163
4928
  if (e.key === "Escape") {
4164
4929
  if (onClose) {
@@ -4169,12 +4934,12 @@ var Modal = ({
4169
4934
  },
4170
4935
  [onClose]
4171
4936
  );
4172
- const handleClose = (0, import_react23.useCallback)(() => {
4937
+ const handleClose = (0, import_react25.useCallback)(() => {
4173
4938
  if (onClose) {
4174
4939
  onClose();
4175
4940
  }
4176
4941
  }, [onClose]);
4177
- (0, import_react23.useEffect)(() => {
4942
+ (0, import_react25.useEffect)(() => {
4178
4943
  if (open) {
4179
4944
  document.addEventListener("keyup", handleKeyDown);
4180
4945
  }
@@ -4182,7 +4947,7 @@ var Modal = ({
4182
4947
  document.removeEventListener("keyup", handleKeyDown);
4183
4948
  };
4184
4949
  }, [open, handleKeyDown]);
4185
- (0, import_react23.useEffect)(() => {
4950
+ (0, import_react25.useEffect)(() => {
4186
4951
  if (!open) return;
4187
4952
  const scrollY = window.scrollY;
4188
4953
  const body = document.body;
@@ -4203,7 +4968,7 @@ var Modal = ({
4203
4968
  };
4204
4969
  }, [open]);
4205
4970
  const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
4206
- const backgroundClickHandler = (0, import_react23.useCallback)(
4971
+ const backgroundClickHandler = (0, import_react25.useCallback)(
4207
4972
  (e) => {
4208
4973
  const target = e.target;
4209
4974
  const currentTarget = e.currentTarget;
@@ -4220,8 +4985,8 @@ var Modal = ({
4220
4985
  if (!mounted) {
4221
4986
  return null;
4222
4987
  }
4223
- return (0, import_react_dom3.createPortal)(
4224
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4988
+ return (0, import_react_dom4.createPortal)(
4989
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4225
4990
  ModalScrim,
4226
4991
  {
4227
4992
  id: id ? `${id}-scrim` : void 0,
@@ -4230,13 +4995,13 @@ var Modal = ({
4230
4995
  ref: bgRef,
4231
4996
  show: open,
4232
4997
  onClick: backgroundClickHandler,
4233
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4998
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
4234
4999
  "div",
4235
5000
  {
4236
5001
  id,
4237
5002
  "data-testid": testid,
4238
5003
  ref: modalRef,
4239
- className: (0, import_clsx25.default)(
5004
+ className: (0, import_clsx26.default)(
4240
5005
  "shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
4241
5006
  computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
4242
5007
  className,
@@ -4245,7 +5010,7 @@ var Modal = ({
4245
5010
  ),
4246
5011
  onClick: (e) => e.stopPropagation(),
4247
5012
  children: [
4248
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5013
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4249
5014
  ModalHeader,
4250
5015
  {
4251
5016
  id: id ? `${id}-header` : void 0,
@@ -4258,7 +5023,7 @@ var Modal = ({
4258
5023
  headerClassname
4259
5024
  }
4260
5025
  ),
4261
- children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5026
+ children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4262
5027
  ModalContent,
4263
5028
  {
4264
5029
  id: id ? `${id}-content` : void 0,
@@ -4267,7 +5032,7 @@ var Modal = ({
4267
5032
  children
4268
5033
  }
4269
5034
  ) : children,
4270
- showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5035
+ showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4271
5036
  ModalButtons,
4272
5037
  {
4273
5038
  id: id ? `${id}-buttons` : void 0,
@@ -4288,51 +5053,51 @@ var Modal = ({
4288
5053
  Modal.displayName = "Modal";
4289
5054
 
4290
5055
  // src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
4291
- var import_jsx_runtime32 = require("react/jsx-runtime");
5056
+ var import_jsx_runtime34 = require("react/jsx-runtime");
4292
5057
 
4293
5058
  // src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
4294
- var import_jsx_runtime33 = require("react/jsx-runtime");
5059
+ var import_jsx_runtime35 = require("react/jsx-runtime");
4295
5060
 
4296
5061
  // src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
4297
- var import_jsx_runtime34 = require("react/jsx-runtime");
5062
+ var import_jsx_runtime36 = require("react/jsx-runtime");
4298
5063
 
4299
5064
  // src/components/MobileDataGrid/ColumnList.tsx
4300
- var import_clsx27 = __toESM(require("clsx"), 1);
5065
+ var import_clsx28 = __toESM(require("clsx"), 1);
4301
5066
 
4302
5067
  // src/components/MobileDataGrid/MobileDataGridCard/index.tsx
4303
- var import_clsx26 = __toESM(require("clsx"), 1);
4304
- var import_jsx_runtime35 = require("react/jsx-runtime");
5068
+ var import_clsx27 = __toESM(require("clsx"), 1);
5069
+ var import_jsx_runtime37 = require("react/jsx-runtime");
4305
5070
 
4306
5071
  // src/components/MobileDataGrid/ColumnList.tsx
4307
- var import_jsx_runtime36 = require("react/jsx-runtime");
5072
+ var import_jsx_runtime38 = require("react/jsx-runtime");
4308
5073
 
4309
5074
  // src/components/MobileDataGrid/index.tsx
4310
- var import_jsx_runtime37 = require("react/jsx-runtime");
5075
+ var import_jsx_runtime39 = require("react/jsx-runtime");
4311
5076
 
4312
5077
  // src/components/ProductImagePreview/Thumbnail.tsx
4313
- var import_react25 = require("react");
5078
+ var import_react27 = require("react");
4314
5079
 
4315
5080
  // src/components/ImagePlaceholder.tsx
4316
- var import_react24 = require("react");
4317
- var import_jsx_runtime38 = require("react/jsx-runtime");
5081
+ var import_react26 = require("react");
5082
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4318
5083
 
4319
5084
  // src/components/ProductImagePreview/Thumbnail.tsx
4320
- var import_jsx_runtime39 = require("react/jsx-runtime");
5085
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4321
5086
 
4322
5087
  // src/components/Grid.tsx
4323
- var import_clsx28 = __toESM(require("clsx"), 1);
4324
- var import_jsx_runtime40 = require("react/jsx-runtime");
5088
+ var import_clsx29 = __toESM(require("clsx"), 1);
5089
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4325
5090
 
4326
5091
  // src/components/ProductImagePreview/ProductPrimaryImage.tsx
4327
- var import_react26 = require("react");
4328
- var import_jsx_runtime41 = require("react/jsx-runtime");
5092
+ var import_react28 = require("react");
5093
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4329
5094
 
4330
5095
  // src/components/ProductImagePreview/ZoomWindow.tsx
4331
- var import_react27 = require("react");
5096
+ var import_react29 = require("react");
4332
5097
 
4333
5098
  // src/components/Surface.tsx
4334
- var import_clsx29 = __toESM(require("clsx"), 1);
4335
- var import_jsx_runtime42 = require("react/jsx-runtime");
5099
+ var import_clsx30 = __toESM(require("clsx"), 1);
5100
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4336
5101
  var Surface = (_a) => {
4337
5102
  var _b = _a, {
4338
5103
  children,
@@ -4345,11 +5110,11 @@ var Surface = (_a) => {
4345
5110
  "elevation",
4346
5111
  "id"
4347
5112
  ]);
4348
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
5113
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
4349
5114
  "div",
4350
5115
  __spreadProps(__spreadValues({
4351
5116
  id,
4352
- className: (0, import_clsx29.default)(
5117
+ className: (0, import_clsx30.default)(
4353
5118
  "rounded-base",
4354
5119
  {
4355
5120
  "shadow-2": elevation === 2,
@@ -4366,43 +5131,43 @@ var Surface = (_a) => {
4366
5131
  Surface.displayName = "Surface";
4367
5132
 
4368
5133
  // src/components/ProductImagePreview/ZoomWindow.tsx
4369
- var import_jsx_runtime43 = require("react/jsx-runtime");
5134
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4370
5135
 
4371
5136
  // src/components/ProductImagePreview/CarouselPagination.tsx
4372
- var import_clsx30 = require("clsx");
4373
- var import_jsx_runtime44 = require("react/jsx-runtime");
5137
+ var import_clsx31 = require("clsx");
5138
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4374
5139
 
4375
5140
  // src/components/ProductImagePreview/MobileImageCarousel.tsx
4376
- var import_react28 = require("react");
4377
- var import_jsx_runtime45 = require("react/jsx-runtime");
5141
+ var import_react30 = require("react");
5142
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4378
5143
 
4379
5144
  // src/components/ProductImagePreview/useProductImagePreview.ts
4380
- var import_react29 = require("react");
5145
+ var import_react31 = require("react");
4381
5146
 
4382
5147
  // src/components/ProductImagePreview/index.tsx
4383
- var import_jsx_runtime46 = require("react/jsx-runtime");
5148
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4384
5149
 
4385
5150
  // src/components/CompactImagesPreview.tsx
4386
- var import_react30 = require("react");
4387
- var import_clsx31 = __toESM(require("clsx"), 1);
4388
- var import_jsx_runtime47 = require("react/jsx-runtime");
5151
+ var import_react32 = require("react");
5152
+ var import_clsx32 = __toESM(require("clsx"), 1);
5153
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4389
5154
 
4390
5155
  // src/components/SimpleTable.tsx
4391
- var import_clsx32 = __toESM(require("clsx"), 1);
4392
- var import_jsx_runtime48 = require("react/jsx-runtime");
5156
+ var import_clsx33 = __toESM(require("clsx"), 1);
5157
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4393
5158
 
4394
5159
  // src/components/PDFViewer/index.tsx
4395
- var import_react33 = require("react");
5160
+ var import_react35 = require("react");
4396
5161
 
4397
5162
  // src/components/PDFViewer/PDFElement.tsx
4398
5163
  var import_react_pdf2 = require("@mikecousins/react-pdf");
4399
- var import_react32 = require("react");
5164
+ var import_react34 = require("react");
4400
5165
 
4401
5166
  // src/components/Spinner.tsx
4402
- var import_jsx_runtime49 = require("react/jsx-runtime");
5167
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4403
5168
  var Spinner = ({ size = "small", testid }) => {
4404
5169
  const dimension = size === "large" ? 48 : 24;
4405
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
5170
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
4406
5171
  "svg",
4407
5172
  {
4408
5173
  "data-testid": testid,
@@ -4414,14 +5179,14 @@ var Spinner = ({ size = "small", testid }) => {
4414
5179
  className: "spinner",
4415
5180
  "aria-label": "Loading",
4416
5181
  children: [
4417
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
4418
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
4419
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
4420
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
4421
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
4422
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
4423
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
4424
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
5182
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
5183
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
5184
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
5185
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
5186
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
5187
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
5188
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
5189
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
4425
5190
  ]
4426
5191
  }
4427
5192
  );
@@ -4430,31 +5195,31 @@ Spinner.displayName = "Spinner";
4430
5195
 
4431
5196
  // src/components/PDFViewer/PDFPage.tsx
4432
5197
  var import_react_pdf = require("@mikecousins/react-pdf");
4433
- var import_react31 = require("react");
4434
- var import_jsx_runtime50 = require("react/jsx-runtime");
5198
+ var import_react33 = require("react");
5199
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4435
5200
 
4436
5201
  // src/components/PDFViewer/PDFElement.tsx
4437
- var import_clsx33 = __toESM(require("clsx"), 1);
4438
- var import_jsx_runtime51 = require("react/jsx-runtime");
5202
+ var import_clsx34 = __toESM(require("clsx"), 1);
5203
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4439
5204
 
4440
5205
  // src/components/PDFViewer/DownloadIcon.tsx
4441
- var import_jsx_runtime52 = require("react/jsx-runtime");
5206
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4442
5207
 
4443
5208
  // src/components/PDFViewer/PDFNavigation.tsx
4444
- var import_jsx_runtime53 = require("react/jsx-runtime");
5209
+ var import_jsx_runtime55 = require("react/jsx-runtime");
4445
5210
 
4446
5211
  // src/components/PDFViewer/index.tsx
4447
- var import_jsx_runtime54 = require("react/jsx-runtime");
5212
+ var import_jsx_runtime56 = require("react/jsx-runtime");
4448
5213
 
4449
5214
  // src/components/ListGroup.tsx
4450
- var import_react34 = require("react");
4451
- var import_clsx34 = __toESM(require("clsx"), 1);
4452
- var import_jsx_runtime55 = require("react/jsx-runtime");
5215
+ var import_react36 = require("react");
5216
+ var import_clsx35 = __toESM(require("clsx"), 1);
5217
+ var import_jsx_runtime57 = require("react/jsx-runtime");
4453
5218
 
4454
5219
  // src/components/Pagination.tsx
4455
- var import_react35 = require("react");
4456
- var import_clsx35 = __toESM(require("clsx"), 1);
4457
- var import_jsx_runtime56 = require("react/jsx-runtime");
5220
+ var import_react37 = require("react");
5221
+ var import_clsx36 = __toESM(require("clsx"), 1);
5222
+ var import_jsx_runtime58 = require("react/jsx-runtime");
4458
5223
  var Pagination = ({
4459
5224
  totalPages,
4460
5225
  currentPage,
@@ -4464,7 +5229,7 @@ var Pagination = ({
4464
5229
  className,
4465
5230
  disabled
4466
5231
  }) => {
4467
- const goTo = (0, import_react35.useCallback)(
5232
+ const goTo = (0, import_react37.useCallback)(
4468
5233
  (page) => {
4469
5234
  if (disabled) return;
4470
5235
  onPageChange(page);
@@ -4481,7 +5246,7 @@ var Pagination = ({
4481
5246
  goTo(currentPage + 1);
4482
5247
  }
4483
5248
  };
4484
- const pageTokens = (0, import_react35.useMemo)(() => {
5249
+ const pageTokens = (0, import_react37.useMemo)(() => {
4485
5250
  if (totalPages <= 5) {
4486
5251
  return Array.from({ length: totalPages }, (_, i) => i + 1);
4487
5252
  }
@@ -4518,7 +5283,7 @@ var Pagination = ({
4518
5283
  return tokens;
4519
5284
  }, [totalPages, currentPage]);
4520
5285
  if (totalPages <= 1) return null;
4521
- const buttonClass = (0, import_clsx35.default)(
5286
+ const buttonClass = (0, import_clsx36.default)(
4522
5287
  "cursor-pointer disabled:cursor-default",
4523
5288
  paddingUsingComponentGap,
4524
5289
  "w-8 h-8",
@@ -4529,14 +5294,14 @@ var Pagination = ({
4529
5294
  "focus:bg-background-grouped-secondary-normal focus:outline-0",
4530
5295
  "disabled:bg-transparent disabled:text-text-action-primary-disabled"
4531
5296
  );
4532
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
5297
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
4533
5298
  "nav",
4534
5299
  {
4535
5300
  id,
4536
5301
  "data-testid": testid,
4537
5302
  "aria-label": "Pagination",
4538
5303
  onKeyDown: handleKey,
4539
- className: (0, import_clsx35.default)(
5304
+ className: (0, import_clsx36.default)(
4540
5305
  "flex items-center",
4541
5306
  "border border-border-primary-normal",
4542
5307
  "bg-background-grouped-primary-normal",
@@ -4544,19 +5309,19 @@ var Pagination = ({
4544
5309
  className
4545
5310
  ),
4546
5311
  children: [
4547
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5312
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4548
5313
  "button",
4549
5314
  {
4550
5315
  disabled: disabled || currentPage <= 1,
4551
5316
  "aria-label": "Previous page",
4552
5317
  onClick: () => goTo(currentPage - 1),
4553
- className: (0, import_clsx35.default)(buttonClass, "border-r-1 border-border-primary-normal"),
4554
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "keyboard_arrow_left" })
5318
+ className: (0, import_clsx36.default)(buttonClass, "border-r-1 border-border-primary-normal"),
5319
+ children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "keyboard_arrow_left" })
4555
5320
  }
4556
5321
  ),
4557
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { className: (0, import_clsx35.default)("flex items-center"), children: pageTokens.map((token, index) => {
5322
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: (0, import_clsx36.default)("flex items-center"), children: pageTokens.map((token, index) => {
4558
5323
  if (token === "ellipsis") {
4559
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5324
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4560
5325
  "li",
4561
5326
  {
4562
5327
  className: "w-8 h-8 select-none text-text-action-primary-disabled",
@@ -4566,29 +5331,29 @@ var Pagination = ({
4566
5331
  );
4567
5332
  }
4568
5333
  const selected = token === currentPage;
4569
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5334
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4570
5335
  "button",
4571
5336
  {
4572
5337
  "aria-label": `Page ${token}`,
4573
5338
  "aria-current": selected ? "page" : void 0,
4574
5339
  disabled,
4575
5340
  onClick: () => goTo(token),
4576
- className: (0, import_clsx35.default)(
5341
+ className: (0, import_clsx36.default)(
4577
5342
  buttonClass,
4578
5343
  selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
4579
5344
  ),
4580
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Subheader, { align: "center", weight: "bold", children: token })
5345
+ children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Subheader, { align: "center", weight: "bold", children: token })
4581
5346
  }
4582
5347
  ) }, token);
4583
5348
  }) }),
4584
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
5349
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
4585
5350
  "button",
4586
5351
  {
4587
5352
  disabled: disabled || currentPage >= totalPages,
4588
5353
  "aria-label": "Next page",
4589
5354
  onClick: () => goTo(currentPage + 1),
4590
- className: (0, import_clsx35.default)(buttonClass, "border-l-1 border-border-primary-normal"),
4591
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Icon, { name: "keyboard_arrow_right" })
5355
+ className: (0, import_clsx36.default)(buttonClass, "border-l-1 border-border-primary-normal"),
5356
+ children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "keyboard_arrow_right" })
4592
5357
  }
4593
5358
  )
4594
5359
  ]
@@ -4598,19 +5363,24 @@ var Pagination = ({
4598
5363
  Pagination.displayName = "Pagination";
4599
5364
 
4600
5365
  // src/components/SkeletonParagraph.tsx
4601
- var import_jsx_runtime57 = require("react/jsx-runtime");
5366
+ var import_jsx_runtime59 = require("react/jsx-runtime");
4602
5367
 
4603
5368
  // src/components/EmptyCartIcon.tsx
4604
- var import_jsx_runtime58 = require("react/jsx-runtime");
5369
+ var import_jsx_runtime60 = require("react/jsx-runtime");
4605
5370
 
4606
- // src/components/DataGrid/TableBody/index.tsx
5371
+ // src/components/Alert.tsx
4607
5372
  var import_clsx37 = __toESM(require("clsx"), 1);
5373
+ var import_react38 = require("react");
5374
+ var import_jsx_runtime61 = require("react/jsx-runtime");
5375
+
5376
+ // src/components/DataGrid/TableBody/index.tsx
5377
+ var import_clsx39 = __toESM(require("clsx"), 1);
4608
5378
 
4609
5379
  // src/components/DataGrid/TableBody/TableBodyRow.tsx
4610
- var import_clsx36 = __toESM(require("clsx"), 1);
5380
+ var import_clsx38 = __toESM(require("clsx"), 1);
4611
5381
  var import_react_table3 = require("@tanstack/react-table");
4612
- var import_react36 = __toESM(require("react"), 1);
4613
- var import_jsx_runtime59 = require("react/jsx-runtime");
5382
+ var import_react39 = __toESM(require("react"), 1);
5383
+ var import_jsx_runtime62 = require("react/jsx-runtime");
4614
5384
  var valueFormatters = {
4615
5385
  date: (value) => typeof value === "string" ? formatDate(value) : "",
4616
5386
  currency: (value) => formatCurrencyDisplay(value)
@@ -4643,10 +5413,10 @@ function TableBodyRow({
4643
5413
  const columns = locked ? visibleCells : virtualColumns;
4644
5414
  const isError = typeof row.original === "object" && row.original !== null && "rowState" in row.original && row.original.rowState === "error";
4645
5415
  const CellElement = locked ? DataGridCell : DragAlongCell;
4646
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
5416
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
4647
5417
  "tr",
4648
5418
  {
4649
- className: (0, import_clsx36.default)(
5419
+ className: (0, import_clsx38.default)(
4650
5420
  "min-h-10",
4651
5421
  "transition-colors hover:bg-background-action-secondary-hover",
4652
5422
  row.getIsSelected() && "!bg-background-action-secondary-hover",
@@ -4664,7 +5434,7 @@ function TableBodyRow({
4664
5434
  children: [
4665
5435
  !locked && virtualPaddingLeft ? (
4666
5436
  // fake empty column to the left for virtualization scroll padding
4667
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
5437
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
4668
5438
  ) : null,
4669
5439
  columns.map((column) => {
4670
5440
  var _a2, _b, _c, _d;
@@ -4675,17 +5445,17 @@ function TableBodyRow({
4675
5445
  const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
4676
5446
  const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
4677
5447
  const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
4678
- return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react36.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5448
+ return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react39.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
4679
5449
  CellElement,
4680
5450
  {
4681
5451
  id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
4682
5452
  testid: testid ? `${testid}-row-${row.id}-cell-${cell.id}` : void 0,
4683
5453
  cell,
4684
- className: (0, import_clsx36.default)({
5454
+ className: (0, import_clsx38.default)({
4685
5455
  "justify-start": cellAlignment === "left",
4686
5456
  "justify-end": cellAlignment === "right"
4687
5457
  }),
4688
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5458
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
4689
5459
  Tooltip,
4690
5460
  {
4691
5461
  id: id ? `${id}-tooltip-${cell.id}` : void 0,
@@ -4693,7 +5463,7 @@ function TableBodyRow({
4693
5463
  showOnTruncation: true,
4694
5464
  message: cellValue,
4695
5465
  position: "bottom",
4696
- children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
5466
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
4697
5467
  }
4698
5468
  )
4699
5469
  },
@@ -4702,7 +5472,7 @@ function TableBodyRow({
4702
5472
  }),
4703
5473
  !locked && virtualPaddingRight ? (
4704
5474
  // fake empty column to the right for virtualization scroll padding
4705
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
5475
+ /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
4706
5476
  ) : null
4707
5477
  ]
4708
5478
  },
@@ -4711,7 +5481,7 @@ function TableBodyRow({
4711
5481
  }
4712
5482
 
4713
5483
  // src/components/DataGrid/TableBody/LoadingCell.tsx
4714
- var import_jsx_runtime60 = require("react/jsx-runtime");
5484
+ var import_jsx_runtime63 = require("react/jsx-runtime");
4715
5485
  function LoadingCell({
4716
5486
  id,
4717
5487
  testid,
@@ -4719,16 +5489,16 @@ function LoadingCell({
4719
5489
  }) {
4720
5490
  const key = `loading-${column.id}`;
4721
5491
  if (column.cell === "checkbox") {
4722
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Checkbox, { id: id ? `${id}-${key}-checkbox` : void 0, testid: testid ? `${testid}-${key}-checkbox` : void 0, disabled: true }) }, key);
5492
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Checkbox, { id: id ? `${id}-${key}-checkbox` : void 0, testid: testid ? `${testid}-${key}-checkbox` : void 0, disabled: true }) }, key);
4723
5493
  }
4724
5494
  if (column.cell === "input") {
4725
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5495
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4726
5496
  DataGridCell,
4727
5497
  {
4728
5498
  id: id ? `${id}-${key}` : void 0,
4729
5499
  testid: testid ? `${testid}-${key}` : void 0,
4730
5500
  component: "input",
4731
- children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5501
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4732
5502
  Input,
4733
5503
  {
4734
5504
  id: id ? `${id}-${key}-input` : void 0,
@@ -4742,11 +5512,11 @@ function LoadingCell({
4742
5512
  key
4743
5513
  );
4744
5514
  }
4745
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
5515
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
4746
5516
  }
4747
5517
 
4748
5518
  // src/components/DataGrid/TableBody/index.tsx
4749
- var import_jsx_runtime61 = require("react/jsx-runtime");
5519
+ var import_jsx_runtime64 = require("react/jsx-runtime");
4750
5520
  function TableBody({
4751
5521
  id,
4752
5522
  testid,
@@ -4780,10 +5550,10 @@ function TableBody({
4780
5550
  } else {
4781
5551
  headerGroups = table.getCenterHeaderGroups();
4782
5552
  }
4783
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
5553
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4784
5554
  "tbody",
4785
5555
  {
4786
- className: (0, import_clsx37.default)(locked ? "shadow-16" : ""),
5556
+ className: (0, import_clsx39.default)(locked ? "shadow-16" : ""),
4787
5557
  style: {
4788
5558
  display: "grid",
4789
5559
  height: `${showFilterRow ? rowVirtualizer.getTotalSize() + 40 : rowVirtualizer.getTotalSize()}px`,
@@ -4792,7 +5562,7 @@ function TableBody({
4792
5562
  // needed for absolute positioning of rows
4793
5563
  },
4794
5564
  children: [
4795
- showFilterRow && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5565
+ showFilterRow && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4796
5566
  "tr",
4797
5567
  {
4798
5568
  style: {
@@ -4808,7 +5578,7 @@ function TableBody({
4808
5578
  children: headerGroups.flatMap(
4809
5579
  (x) => x.headers.map((header) => {
4810
5580
  var _a, _b, _c, _d, _e;
4811
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5581
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4812
5582
  CellElement,
4813
5583
  {
4814
5584
  id: id ? `${id}-filter-cell-${header.id}` : void 0,
@@ -4819,7 +5589,7 @@ function TableBody({
4819
5589
  children: header.column.getCanFilter() && ((_e = (_c = (_b = header.column.columnDef.meta) == null ? void 0 : _b.filterRowCell) == null ? void 0 : _c.call(_b, {
4820
5590
  header,
4821
5591
  table
4822
- })) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5592
+ })) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4823
5593
  Search,
4824
5594
  {
4825
5595
  id: id ? `${id}-filter-search-${header.id}` : void 0,
@@ -4840,7 +5610,7 @@ function TableBody({
4840
5610
  ),
4841
5611
  virtualRows.map((virtualRow) => {
4842
5612
  const row = rows[virtualRow.index];
4843
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5613
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4844
5614
  TableBodyRow,
4845
5615
  {
4846
5616
  id,
@@ -4859,7 +5629,7 @@ function TableBody({
4859
5629
  row.id
4860
5630
  );
4861
5631
  }),
4862
- !pagination && isLoadingMore && hasMore && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5632
+ !pagination && isLoadingMore && hasMore && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4863
5633
  "tr",
4864
5634
  {
4865
5635
  style: {
@@ -4869,7 +5639,7 @@ function TableBody({
4869
5639
  transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
4870
5640
  },
4871
5641
  className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
4872
- children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5642
+ children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4873
5643
  LoadingCell,
4874
5644
  {
4875
5645
  id,