@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
@@ -62,9 +62,9 @@ __export(TableBodyRow_exports, {
62
62
  TableBodyRow: () => TableBodyRow
63
63
  });
64
64
  module.exports = __toCommonJS(TableBodyRow_exports);
65
- var import_clsx37 = __toESM(require("clsx"), 1);
65
+ var import_clsx39 = __toESM(require("clsx"), 1);
66
66
  var import_react_table3 = require("@tanstack/react-table");
67
- var import_react36 = __toESM(require("react"), 1);
67
+ var import_react39 = __toESM(require("react"), 1);
68
68
 
69
69
  // src/components/DataGridCell.tsx
70
70
  var import_sortable = require("@dnd-kit/sortable");
@@ -475,6 +475,76 @@ function formatCurrencyDisplay(value) {
475
475
  }
476
476
 
477
477
  // src/utils/date.ts
478
+ function parseInputDate(input) {
479
+ const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
480
+ if (!match) {
481
+ return null;
482
+ }
483
+ const [, month, day, year] = match;
484
+ const paddedMonth = month.padStart(2, "0");
485
+ const paddedDay = day.padStart(2, "0");
486
+ return `${year}-${paddedMonth}-${paddedDay}`;
487
+ }
488
+ function isValidDate(dateString) {
489
+ const date = new Date(dateString);
490
+ return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
491
+ }
492
+ function formatInputValue(value) {
493
+ const digits = value.replace(/\D/g, "");
494
+ if (digits.length < 2) {
495
+ return digits;
496
+ }
497
+ if (digits.length >= 4) {
498
+ return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
499
+ }
500
+ return `${digits.slice(0, 2)}/${digits.slice(2)}`;
501
+ }
502
+ function isDigit(character) {
503
+ return /\d/.test(character);
504
+ }
505
+ function isSlash(character) {
506
+ return character === "/";
507
+ }
508
+ function countDigitsUpToCursor(value, cursorPosition) {
509
+ let digitCount = 0;
510
+ for (let i = 0; i < cursorPosition && i < value.length; i++) {
511
+ if (!isDigit(value[i])) {
512
+ continue;
513
+ }
514
+ digitCount++;
515
+ }
516
+ return digitCount;
517
+ }
518
+ function findPositionAfterDigitCount(formattedValue, targetDigitCount) {
519
+ let currentDigitCount = 0;
520
+ for (let i = 0; i < formattedValue.length; i++) {
521
+ if (!isDigit(formattedValue[i])) {
522
+ continue;
523
+ }
524
+ currentDigitCount++;
525
+ if (currentDigitCount !== targetDigitCount) {
526
+ continue;
527
+ }
528
+ const positionAfterDigit = i + 1;
529
+ const nextCharacter = formattedValue[positionAfterDigit];
530
+ if (nextCharacter && isSlash(nextCharacter)) {
531
+ return positionAfterDigit + 1;
532
+ }
533
+ return positionAfterDigit;
534
+ }
535
+ return formattedValue.length;
536
+ }
537
+ function calculateCursorPosition(originalValue, formattedValue, originalPosition) {
538
+ const targetDigitCount = countDigitsUpToCursor(
539
+ originalValue,
540
+ originalPosition
541
+ );
542
+ const newPosition = findPositionAfterDigitCount(
543
+ formattedValue,
544
+ targetDigitCount
545
+ );
546
+ return Math.min(newPosition, formattedValue.length);
547
+ }
478
548
  function parseDateParts(dateString) {
479
549
  const [yearStr, monthStr, dayStr] = dateString.split("-");
480
550
  if (!yearStr || !monthStr || !dayStr) {
@@ -3955,23 +4025,718 @@ var Tooltip = ({
3955
4025
  };
3956
4026
  Tooltip.displayName = "Tooltip";
3957
4027
 
3958
- // src/components/Accordion.tsx
3959
- var import_clsx20 = __toESM(require("clsx"), 1);
4028
+ // src/components/DateInput.tsx
4029
+ var import_react19 = require("react");
4030
+ var import_react_dom3 = require("react-dom");
3960
4031
 
3961
- // src/components/Card.tsx
4032
+ // src/components/CalendarRange.tsx
3962
4033
  var import_clsx18 = __toESM(require("clsx"), 1);
4034
+ var import_react18 = __toESM(require("react"), 1);
4035
+ var import_polyfill = require("@js-temporal/polyfill");
3963
4036
  var import_jsx_runtime21 = require("react/jsx-runtime");
4037
+ function DateCell(_a) {
4038
+ var _b = _a, {
4039
+ date,
4040
+ isInMonth,
4041
+ isToday,
4042
+ isSelected,
4043
+ inRange,
4044
+ isDisabled,
4045
+ isRangeStart,
4046
+ isRangeEnd,
4047
+ onClick,
4048
+ onMouseEnter,
4049
+ onMouseLeave,
4050
+ cellPadding = "",
4051
+ isRangeDisabled = false,
4052
+ id,
4053
+ testid
4054
+ } = _b, props = __objRest(_b, [
4055
+ "date",
4056
+ "isInMonth",
4057
+ "isToday",
4058
+ "isSelected",
4059
+ "inRange",
4060
+ "isDisabled",
4061
+ "isRangeStart",
4062
+ "isRangeEnd",
4063
+ "onClick",
4064
+ "onMouseEnter",
4065
+ "onMouseLeave",
4066
+ "cellPadding",
4067
+ "isRangeDisabled",
4068
+ "id",
4069
+ "testid"
4070
+ ]);
4071
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4072
+ "span",
4073
+ __spreadProps(__spreadValues({}, props), {
4074
+ id,
4075
+ "data-testid": testid,
4076
+ className: (0, import_clsx18.default)(
4077
+ "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
4078
+ typography.caption,
4079
+ cellPadding,
4080
+ !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
4081
+ !isInMonth && "border-transparent",
4082
+ // Today: subtle border ring
4083
+ isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
4084
+ // Selected: Figma blue, white text, strong shadow
4085
+ isSelected && "bg-action-400 text-white border-action-400 z-10",
4086
+ !isSelected && !inRange && "rounded-base",
4087
+ // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
4088
+ (isRangeDisabled || !inRange && isSelected) && "rounded-base",
4089
+ inRange && isSelected && "hover:border-action-500",
4090
+ // In range: Figma light blue background
4091
+ inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
4092
+ // Disabled: Figma gray, no pointer, no hover
4093
+ isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
4094
+ "text-text-primary-normal cursor-pointer",
4095
+ // Figma hover: blue bg, blue text (or red text if selected)
4096
+ isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
4097
+ // Figma active: darker blue bg, white text
4098
+ "active:bg-action-300 active:text-white",
4099
+ // Figma focus: ring
4100
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
4101
+ ],
4102
+ isRangeStart && "rounded-l",
4103
+ isRangeEnd && "rounded-r"
4104
+ ),
4105
+ tabIndex: isDisabled ? -1 : 0,
4106
+ "aria-disabled": isDisabled,
4107
+ onClick: () => !isDisabled && isInMonth && onClick(),
4108
+ onMouseEnter: () => isInMonth && onMouseEnter(),
4109
+ onMouseLeave: () => isInMonth && onMouseLeave(),
4110
+ children: isInMonth ? date.day : ""
4111
+ })
4112
+ );
4113
+ }
4114
+ function CalendarRange({
4115
+ from,
4116
+ to,
4117
+ onChange,
4118
+ isDateAvailable,
4119
+ mode = "double",
4120
+ cardStyle = false,
4121
+ disableRange = false,
4122
+ id,
4123
+ testid
4124
+ }) {
4125
+ const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
4126
+ const parseDate = (d) => {
4127
+ if (!d) {
4128
+ return void 0;
4129
+ }
4130
+ try {
4131
+ if (typeof d === "number") {
4132
+ return import_polyfill.Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
4133
+ }
4134
+ if (typeof d === "string") {
4135
+ return import_polyfill.Temporal.PlainDate.from(d);
4136
+ }
4137
+ return void 0;
4138
+ } catch (error) {
4139
+ console.error("Invalid date format:", d, error);
4140
+ return import_polyfill.Temporal.Now.plainDateISO();
4141
+ }
4142
+ };
4143
+ const fromDate = parseDate(from);
4144
+ const toDate = parseDate(to);
4145
+ const today = import_polyfill.Temporal.Now.plainDateISO();
4146
+ const [baseMonth, setBaseMonth] = (0, import_react18.useState)(
4147
+ fromDate != null ? fromDate : today.with({ day: 1 })
4148
+ );
4149
+ const [selecting, setSelecting] = (0, import_react18.useState)("from");
4150
+ const [pendingFrom, setPendingFrom] = (0, import_react18.useState)(void 0);
4151
+ const [hoveredDate, setHoveredDate] = (0, import_react18.useState)(void 0);
4152
+ (0, import_react18.useEffect)(() => {
4153
+ if (fromDate) {
4154
+ setBaseMonth(fromDate.with({ day: 1 }));
4155
+ } else if (toDate) {
4156
+ setBaseMonth(toDate.with({ day: 1 }));
4157
+ }
4158
+ }, [from, to]);
4159
+ (0, import_react18.useEffect)(() => {
4160
+ if (fromDate && toDate) {
4161
+ setSelecting("from");
4162
+ setPendingFrom(void 0);
4163
+ setHoveredDate(void 0);
4164
+ }
4165
+ }, [from, to]);
4166
+ function getMonthData(monthOffset) {
4167
+ const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
4168
+ const days = monthDate.daysInMonth;
4169
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4170
+ return {
4171
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4172
+ year: monthDate.year,
4173
+ days,
4174
+ firstDayOffset,
4175
+ date: monthDate
4176
+ };
4177
+ }
4178
+ function getMonthDataWith(monthOffset) {
4179
+ const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
4180
+ const days = monthDate.daysInMonth;
4181
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4182
+ return {
4183
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4184
+ year: monthDate.year,
4185
+ days,
4186
+ firstDayOffset,
4187
+ date: monthDate
4188
+ };
4189
+ }
4190
+ function handleDayClick(date) {
4191
+ if (isDateAvailable && !isDateAvailable(date)) return;
4192
+ if (mode === "single" && disableRange) {
4193
+ if (onChange) {
4194
+ onChange(date.toString(), date.toString());
4195
+ }
4196
+ return;
4197
+ }
4198
+ if (selecting === "from") {
4199
+ setPendingFrom(date);
4200
+ setSelecting("to");
4201
+ setHoveredDate(void 0);
4202
+ } else if (pendingFrom) {
4203
+ if (onChange) {
4204
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
4205
+ onChange(start.toString(), end.toString());
4206
+ }
4207
+ setPendingFrom(void 0);
4208
+ setSelecting("from");
4209
+ setHoveredDate(void 0);
4210
+ }
4211
+ }
4212
+ function isInRange(date) {
4213
+ if (mode === "single" && disableRange) {
4214
+ return false;
4215
+ }
4216
+ if (pendingFrom && selecting === "to" && hoveredDate) {
4217
+ const [start, end] = import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
4218
+ return import_polyfill.Temporal.PlainDate.compare(date, start) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, end) <= 0;
4219
+ }
4220
+ if (!pendingFrom && fromDate && toDate) {
4221
+ return import_polyfill.Temporal.PlainDate.compare(date, fromDate) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, toDate) <= 0;
4222
+ }
4223
+ return false;
4224
+ }
4225
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4226
+ "div",
4227
+ {
4228
+ id,
4229
+ "data-testid": testid,
4230
+ className: (0, import_clsx18.default)(
4231
+ "relative bg-background-grouped-primary-normal rounded-base w-fit",
4232
+ layoutPaddding,
4233
+ layoutGap,
4234
+ cardStyle && "shadow-4",
4235
+ // baseTransition,
4236
+ "overflow-hidden"
4237
+ ),
4238
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4239
+ "div",
4240
+ {
4241
+ className: (0, import_clsx18.default)(
4242
+ "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
4243
+ layoutGap
4244
+ ),
4245
+ children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
4246
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4247
+ CalendarPane,
4248
+ {
4249
+ getMonthData,
4250
+ getMonthDataWith,
4251
+ offset,
4252
+ idx,
4253
+ id,
4254
+ testid,
4255
+ baseMonth,
4256
+ setBaseMonth,
4257
+ mode,
4258
+ pendingFrom,
4259
+ weekDays,
4260
+ fromDate,
4261
+ toDate,
4262
+ isDateAvailable,
4263
+ disableRange,
4264
+ hoveredDate,
4265
+ isInRange,
4266
+ today,
4267
+ setHoveredDate,
4268
+ handleDayClick
4269
+ },
4270
+ idx
4271
+ );
4272
+ })
4273
+ }
4274
+ )
4275
+ }
4276
+ );
4277
+ }
4278
+ function CalendarPane({
4279
+ getMonthData,
4280
+ getMonthDataWith,
4281
+ offset,
4282
+ idx,
4283
+ id,
4284
+ testid,
4285
+ baseMonth,
4286
+ setBaseMonth,
4287
+ mode,
4288
+ pendingFrom,
4289
+ weekDays,
4290
+ fromDate,
4291
+ toDate,
4292
+ isDateAvailable,
4293
+ disableRange,
4294
+ hoveredDate,
4295
+ isInRange,
4296
+ today,
4297
+ setHoveredDate,
4298
+ handleDayClick
4299
+ }) {
4300
+ const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
4301
+ const years = Array.from({ length: 100 }).map(
4302
+ (_, i) => baseMonth.year - 50 + i
4303
+ );
4304
+ const [monthMenuOpen, setMonthMenuOpen] = (0, import_react18.useState)(false);
4305
+ const [yearMenuOpen, setYearMenuOpen] = (0, import_react18.useState)(false);
4306
+ const monthMenuRef = (0, import_react18.useRef)(null);
4307
+ const yearMenuRef = (0, import_react18.useRef)(null);
4308
+ const month = getMonthData(offset);
4309
+ const totalCells = 42;
4310
+ const emptyCells = month.firstDayOffset;
4311
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react18.default.Fragment, { children: [
4312
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4313
+ "div",
4314
+ {
4315
+ className: (0, import_clsx18.default)("flex flex-col"),
4316
+ children: [
4317
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4318
+ "div",
4319
+ {
4320
+ className: (0, import_clsx18.default)(
4321
+ "flex flex-row items-center justify-between",
4322
+ typography.label,
4323
+ "text-text-action-primary-normal"
4324
+ ),
4325
+ children: [
4326
+ idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4327
+ "button",
4328
+ {
4329
+ id: id ? `${id}-prev-month-button` : void 0,
4330
+ "data-testid": testid ? `${testid}-prev-month-button` : void 0,
4331
+ type: "button",
4332
+ className: (0, import_clsx18.default)(
4333
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4334
+ componentPadding
4335
+ ),
4336
+ "aria-label": "Previous month",
4337
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
4338
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { name: "chevron_left", size: 24 })
4339
+ }
4340
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_clsx18.default)(componentPadding, "mr-1") }),
4341
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
4342
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4343
+ "button",
4344
+ {
4345
+ ref: (el) => {
4346
+ monthMenuRef.current = el;
4347
+ },
4348
+ type: "button",
4349
+ onClick: () => {
4350
+ setMonthMenuOpen(true);
4351
+ setYearMenuOpen(false);
4352
+ },
4353
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4354
+ children: month.name
4355
+ }
4356
+ ),
4357
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4358
+ Menu,
4359
+ {
4360
+ show: monthMenuOpen,
4361
+ positionTo: monthMenuRef,
4362
+ setShow: () => setMonthMenuOpen(false),
4363
+ children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4364
+ MenuOption,
4365
+ {
4366
+ selected: baseMonth.month === x + 1,
4367
+ onClick: () => {
4368
+ setBaseMonth(baseMonth.with({ month: x + 1 }));
4369
+ setMonthMenuOpen(false);
4370
+ },
4371
+ children: m.name
4372
+ },
4373
+ m.name
4374
+ ))
4375
+ }
4376
+ ),
4377
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4378
+ "button",
4379
+ {
4380
+ ref: (el) => {
4381
+ yearMenuRef.current = el;
4382
+ },
4383
+ type: "button",
4384
+ onClick: () => {
4385
+ setYearMenuOpen(true);
4386
+ setMonthMenuOpen(false);
4387
+ },
4388
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4389
+ children: month.year
4390
+ }
4391
+ ),
4392
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4393
+ Menu,
4394
+ {
4395
+ show: yearMenuOpen,
4396
+ positionTo: yearMenuRef,
4397
+ setShow: () => setYearMenuOpen(false),
4398
+ children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4399
+ MenuOption,
4400
+ {
4401
+ selected: baseMonth.year === y,
4402
+ onClick: () => {
4403
+ setBaseMonth(baseMonth.with({ year: y }));
4404
+ setYearMenuOpen(false);
4405
+ },
4406
+ children: y
4407
+ },
4408
+ y
4409
+ ))
4410
+ }
4411
+ )
4412
+ ] }),
4413
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4414
+ "button",
4415
+ {
4416
+ id: id ? `${id}-next-month-button` : void 0,
4417
+ "data-testid": testid ? `${testid}-next-month-button` : void 0,
4418
+ type: "button",
4419
+ className: (0, import_clsx18.default)(
4420
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4421
+ componentPadding
4422
+ ),
4423
+ "aria-label": "Next month",
4424
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
4425
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { name: "chevron_right", size: 24 })
4426
+ }
4427
+ ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: (0, import_clsx18.default)(componentPadding, "ml-1") })
4428
+ ]
4429
+ }
4430
+ ),
4431
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_clsx18.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4432
+ "span",
4433
+ {
4434
+ className: (0, import_clsx18.default)(
4435
+ typography.caption,
4436
+ "text-text-secondary-normal text-center",
4437
+ "w-10"
4438
+ ),
4439
+ children: d
4440
+ },
4441
+ d
4442
+ )) }),
4443
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: (0, import_clsx18.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
4444
+ const day = i - emptyCells + 1;
4445
+ const date = month.date.with({ day: 1 }).add({
4446
+ days: i - emptyCells
4447
+ });
4448
+ const isInMonth = day > 0 && day <= month.days;
4449
+ const isToday = isInMonth && date.equals(today);
4450
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
4451
+ const inRange = isInMonth && isInRange(date);
4452
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
4453
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
4454
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
4455
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
4456
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
4457
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4458
+ DateCell,
4459
+ {
4460
+ id: id ? `${id}-date-${date.toString()}` : void 0,
4461
+ testid: testid ? `${testid}-date-${date.toString()}` : void 0,
4462
+ date,
4463
+ isInMonth: !!isInMonth,
4464
+ isToday: !!isToday,
4465
+ isSelected: !!isSelected,
4466
+ inRange: !!inRange,
4467
+ isDisabled: !!isDisabled,
4468
+ onClick: () => handleDayClick(date),
4469
+ onMouseEnter: () => setHoveredDate(date),
4470
+ onMouseLeave: () => setHoveredDate(void 0),
4471
+ isRangeStart: !!isRangeStart,
4472
+ isRangeEnd: !!isRangeEnd,
4473
+ isRangeDisabled: mode === "single" && disableRange,
4474
+ cellPadding: componentPadding
4475
+ },
4476
+ i
4477
+ );
4478
+ }) })
4479
+ ]
4480
+ }
4481
+ ),
4482
+ mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4483
+ "div",
4484
+ {
4485
+ className: (0, import_clsx18.default)(
4486
+ "self-stretch bg-border-primary-normal rounded-base",
4487
+ // 1px width, full height, matches Figma divider
4488
+ "w-px"
4489
+ )
4490
+ }
4491
+ )
4492
+ ] }, month.name + month.year);
4493
+ }
3964
4494
 
3965
- // src/components/Stack.tsx
3966
- var import_clsx19 = __toESM(require("clsx"), 1);
4495
+ // src/components/DateInput.tsx
3967
4496
  var import_jsx_runtime22 = require("react/jsx-runtime");
4497
+ var DateInput = (_a) => {
4498
+ var _b = _a, {
4499
+ id,
4500
+ testid,
4501
+ value,
4502
+ onChange,
4503
+ placeholder = "MM/DD/YYYY",
4504
+ disabled,
4505
+ readOnly = false,
4506
+ label
4507
+ } = _b, props = __objRest(_b, [
4508
+ "id",
4509
+ "testid",
4510
+ "value",
4511
+ "onChange",
4512
+ "placeholder",
4513
+ "disabled",
4514
+ "readOnly",
4515
+ "label"
4516
+ ]);
4517
+ const [visible, setVisible] = (0, import_react19.useState)(false);
4518
+ const [inputValue, setInputValue] = (0, import_react19.useState)("");
4519
+ const [isTyping, setIsTyping] = (0, import_react19.useState)(false);
4520
+ const popoverRef = (0, import_react19.useRef)(null);
4521
+ const triggerRef = (0, import_react19.useRef)(null);
4522
+ const rootRef = (0, import_react19.useRef)(null);
4523
+ const [calendarPosition, setCalendarPosition] = (0, import_react19.useState)({
4524
+ top: 0,
4525
+ left: 0,
4526
+ width: 0
4527
+ });
4528
+ const [from, to] = [value, ""];
4529
+ (0, import_react19.useEffect)(() => {
4530
+ if (!isTyping) {
4531
+ setInputValue(formatDisplayValue(from));
4532
+ }
4533
+ }, [from, isTyping]);
4534
+ (0, import_react19.useLayoutEffect)(() => {
4535
+ if (visible) {
4536
+ updatePosition();
4537
+ }
4538
+ }, [visible]);
4539
+ const updatePosition = () => {
4540
+ if (rootRef.current) {
4541
+ const rect = rootRef.current.getBoundingClientRect();
4542
+ setCalendarPosition({
4543
+ top: rect.bottom + window.scrollY,
4544
+ left: rect.left + window.scrollX,
4545
+ width: rect.width
4546
+ });
4547
+ }
4548
+ };
4549
+ (0, import_react19.useEffect)(() => {
4550
+ updatePosition();
4551
+ const resizeObserver = new ResizeObserver(updatePosition);
4552
+ if (triggerRef.current) {
4553
+ resizeObserver.observe(triggerRef.current);
4554
+ }
4555
+ window.addEventListener("scroll", updatePosition);
4556
+ return () => {
4557
+ resizeObserver.disconnect();
4558
+ window.removeEventListener("scroll", updatePosition);
4559
+ };
4560
+ }, []);
4561
+ (0, import_react19.useEffect)(() => {
4562
+ const handleKeyDown2 = (event) => {
4563
+ var _a2;
4564
+ if (event.key === "Escape" && popoverRef.current) {
4565
+ setVisible(false);
4566
+ (_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
4567
+ }
4568
+ };
4569
+ document.addEventListener("keydown", handleKeyDown2);
4570
+ return () => {
4571
+ document.removeEventListener("keydown", handleKeyDown2);
4572
+ };
4573
+ });
4574
+ (0, import_react19.useEffect)(() => {
4575
+ const handleClickOutside = (event) => {
4576
+ if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
4577
+ setVisible(false);
4578
+ }
4579
+ };
4580
+ document.addEventListener("mousedown", handleClickOutside);
4581
+ return () => {
4582
+ document.removeEventListener("mousedown", handleClickOutside);
4583
+ };
4584
+ }, []);
4585
+ function handleDateChange(fromValue) {
4586
+ onChange(fromValue);
4587
+ setVisible(false);
4588
+ setIsTyping(false);
4589
+ }
4590
+ const handleFocus = () => {
4591
+ if (readOnly) return;
4592
+ setVisible(true);
4593
+ };
4594
+ const handleClick = () => {
4595
+ handleFocus();
4596
+ };
4597
+ const handleInputChange = (event) => {
4598
+ if (readOnly) return;
4599
+ const rawValue = event.target.value;
4600
+ const cursorPosition = event.target.selectionStart || 0;
4601
+ setIsTyping(true);
4602
+ const formattedValue = formatInputValue(rawValue);
4603
+ setInputValue(formattedValue);
4604
+ requestAnimationFrame(() => {
4605
+ if (triggerRef.current) {
4606
+ const newPosition = calculateCursorPosition(
4607
+ rawValue,
4608
+ formattedValue,
4609
+ cursorPosition
4610
+ );
4611
+ triggerRef.current.setSelectionRange(newPosition, newPosition);
4612
+ }
4613
+ });
4614
+ const parsedDate = parseInputDate(formattedValue);
4615
+ if (parsedDate && isValidDate(parsedDate)) {
4616
+ onChange(parsedDate);
4617
+ }
4618
+ };
4619
+ const handleBlur = () => {
4620
+ setIsTyping(false);
4621
+ const parsedDate = parseInputDate(inputValue);
4622
+ if (!parsedDate || !isValidDate(parsedDate)) {
4623
+ setInputValue(formatDisplayValue(from));
4624
+ }
4625
+ };
4626
+ const handleKeyDown = (event) => {
4627
+ if (event.key === "Backspace") {
4628
+ const input = event.target;
4629
+ const cursorPosition = input.selectionStart || 0;
4630
+ const value2 = input.value;
4631
+ if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
4632
+ event.preventDefault();
4633
+ const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
4634
+ const formattedValue = formatInputValue(newValue);
4635
+ setInputValue(formattedValue);
4636
+ requestAnimationFrame(() => {
4637
+ if (triggerRef.current) {
4638
+ const newPosition = Math.max(0, cursorPosition - 2);
4639
+ triggerRef.current.setSelectionRange(newPosition, newPosition);
4640
+ }
4641
+ });
4642
+ setIsTyping(true);
4643
+ return;
4644
+ }
4645
+ }
4646
+ if (event.key === "Enter") {
4647
+ const parsedDate = parseInputDate(inputValue);
4648
+ if (parsedDate && isValidDate(parsedDate)) {
4649
+ onChange(parsedDate);
4650
+ setVisible(false);
4651
+ setIsTyping(false);
4652
+ }
4653
+ }
4654
+ };
4655
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative", children: [
4656
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4657
+ InputBase,
4658
+ __spreadProps(__spreadValues({
4659
+ id,
4660
+ testid,
4661
+ ref: (el) => {
4662
+ triggerRef.current = el;
4663
+ }
4664
+ }, props), {
4665
+ wrapperRef: rootRef,
4666
+ value: inputValue,
4667
+ placeholder,
4668
+ disabled,
4669
+ readOnly,
4670
+ after: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "calendar_month" }),
4671
+ onFocus: handleFocus,
4672
+ onClick: handleClick,
4673
+ onChange: handleInputChange,
4674
+ onBlur: handleBlur,
4675
+ onKeyDown: handleKeyDown,
4676
+ label,
4677
+ secondaryIconColor: true
4678
+ })
4679
+ ),
4680
+ visible && !readOnly && (0, import_react_dom3.createPortal)(
4681
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4682
+ "div",
4683
+ {
4684
+ ref: (el) => {
4685
+ popoverRef.current = el;
4686
+ },
4687
+ className: "absolute z-40 bg-white",
4688
+ style: {
4689
+ top: `${calendarPosition.top + 4}px`,
4690
+ left: `${calendarPosition.left}px`,
4691
+ minWidth: `${calendarPosition.width}px`
4692
+ },
4693
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4694
+ CalendarRange,
4695
+ {
4696
+ id: id ? `${id}-calendar` : void 0,
4697
+ testid: testid ? `${testid}-calendar` : void 0,
4698
+ from,
4699
+ to: to || from,
4700
+ onChange: handleDateChange,
4701
+ cardStyle: true,
4702
+ mode: "single",
4703
+ disableRange: true
4704
+ }
4705
+ )
4706
+ }
4707
+ ),
4708
+ findDocumentRoot(popoverRef.current)
4709
+ )
4710
+ ] });
4711
+ };
4712
+ DateInput.displayName = "DateInput";
4713
+ function formatDisplayValue(from) {
4714
+ if (!from) {
4715
+ return "";
4716
+ }
4717
+ if (!isValidDate(from)) {
4718
+ return "";
4719
+ }
4720
+ return formatDate(from);
4721
+ }
3968
4722
 
3969
4723
  // src/components/Accordion.tsx
4724
+ var import_clsx21 = __toESM(require("clsx"), 1);
4725
+
4726
+ // src/components/Card.tsx
4727
+ var import_clsx19 = __toESM(require("clsx"), 1);
3970
4728
  var import_jsx_runtime23 = require("react/jsx-runtime");
3971
4729
 
3972
- // src/components/Heading.tsx
3973
- var import_clsx21 = __toESM(require("clsx"), 1);
4730
+ // src/components/Stack.tsx
4731
+ var import_clsx20 = __toESM(require("clsx"), 1);
3974
4732
  var import_jsx_runtime24 = require("react/jsx-runtime");
4733
+
4734
+ // src/components/Accordion.tsx
4735
+ var import_jsx_runtime25 = require("react/jsx-runtime");
4736
+
4737
+ // src/components/Heading.tsx
4738
+ var import_clsx22 = __toESM(require("clsx"), 1);
4739
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3975
4740
  var Heading = (_a) => {
3976
4741
  var _b = _a, {
3977
4742
  className,
@@ -3994,12 +4759,12 @@ var Heading = (_a) => {
3994
4759
  ]);
3995
4760
  const defaultElement = variant === "heading1" ? "h1" : variant === "heading2" ? "h2" : "h3";
3996
4761
  const Element = as != null ? as : defaultElement;
3997
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4762
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3998
4763
  Element,
3999
4764
  __spreadProps(__spreadValues({
4000
4765
  id,
4001
4766
  "data-testid": testid,
4002
- className: (0, import_clsx21.default)(
4767
+ className: (0, import_clsx22.default)(
4003
4768
  typography[variant],
4004
4769
  className,
4005
4770
  align === "left" && "text-left",
@@ -4015,43 +4780,43 @@ var Heading = (_a) => {
4015
4780
  );
4016
4781
  };
4017
4782
  Heading.displayName = "Heading";
4018
- var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
4019
- var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
4020
- var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
4783
+ var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
4784
+ var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
4785
+ var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
4021
4786
  Heading1.displayName = "Heading1";
4022
4787
  Heading2.displayName = "Heading2";
4023
4788
  Heading3.displayName = "Heading3";
4024
4789
 
4025
4790
  // src/components/Theme.tsx
4026
- var import_jsx_runtime25 = require("react/jsx-runtime");
4791
+ var import_jsx_runtime27 = require("react/jsx-runtime");
4027
4792
 
4028
4793
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
4029
- var import_react20 = require("react");
4794
+ var import_react22 = require("react");
4030
4795
 
4031
4796
  // src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
4032
- var import_react19 = require("react");
4797
+ var import_react21 = require("react");
4033
4798
 
4034
4799
  // src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
4035
- var import_react18 = require("react");
4036
- var GridContext = (0, import_react18.createContext)(null);
4800
+ var import_react20 = require("react");
4801
+ var GridContext = (0, import_react20.createContext)(null);
4037
4802
 
4038
4803
  // src/components/MobileDataGrid/ColumnSelector/index.tsx
4039
- var import_jsx_runtime26 = require("react/jsx-runtime");
4804
+ var import_jsx_runtime28 = require("react/jsx-runtime");
4040
4805
 
4041
4806
  // src/components/MobileDataGrid/MobileDataGridHeader.tsx
4042
- var import_jsx_runtime27 = require("react/jsx-runtime");
4807
+ var import_jsx_runtime29 = require("react/jsx-runtime");
4043
4808
 
4044
4809
  // src/components/MobileDataGrid/GridContextProvider/index.tsx
4045
- var import_react21 = require("react");
4046
- var import_jsx_runtime28 = require("react/jsx-runtime");
4810
+ var import_react23 = require("react");
4811
+ var import_jsx_runtime30 = require("react/jsx-runtime");
4047
4812
 
4048
4813
  // src/components/Modal.tsx
4049
- var import_clsx26 = __toESM(require("clsx"), 1);
4050
- var import_react23 = require("react");
4814
+ var import_clsx27 = __toESM(require("clsx"), 1);
4815
+ var import_react25 = require("react");
4051
4816
 
4052
4817
  // src/components/ModalHeader.tsx
4053
- var import_clsx22 = __toESM(require("clsx"), 1);
4054
- var import_jsx_runtime29 = require("react/jsx-runtime");
4818
+ var import_clsx23 = __toESM(require("clsx"), 1);
4819
+ var import_jsx_runtime31 = require("react/jsx-runtime");
4055
4820
  var ModalHeader = ({
4056
4821
  title,
4057
4822
  hideCloseIcon,
@@ -4062,12 +4827,12 @@ var ModalHeader = ({
4062
4827
  testid,
4063
4828
  headerClassname
4064
4829
  }) => {
4065
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4830
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
4066
4831
  "div",
4067
4832
  {
4068
4833
  id,
4069
4834
  "data-testid": testid,
4070
- className: (0, import_clsx22.default)(
4835
+ className: (0, import_clsx23.default)(
4071
4836
  "flex justify-between items-center",
4072
4837
  headerIconAlign === "center" && "justify-center",
4073
4838
  headerIconAlign === "right" && "justify-end",
@@ -4077,9 +4842,9 @@ var ModalHeader = ({
4077
4842
  headerClassname
4078
4843
  ),
4079
4844
  children: [
4080
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: (0, import_clsx22.default)("flex items-center flex-1", layoutGroupGap), children: [
4845
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_clsx23.default)("flex items-center flex-1", layoutGroupGap), children: [
4081
4846
  headerIcon,
4082
- title && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4847
+ title && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4083
4848
  Heading2,
4084
4849
  {
4085
4850
  id: id ? `${id}-title` : void 0,
@@ -4089,7 +4854,7 @@ var ModalHeader = ({
4089
4854
  }
4090
4855
  )
4091
4856
  ] }),
4092
- !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4857
+ !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4093
4858
  Button,
4094
4859
  {
4095
4860
  id: id ? `${id}-close-button` : void 0,
@@ -4097,7 +4862,7 @@ var ModalHeader = ({
4097
4862
  iconOnly: true,
4098
4863
  variant: "tertiary",
4099
4864
  onClick: onClose,
4100
- 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 }) })
4865
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "close", size: 24 }) })
4101
4866
  }
4102
4867
  )
4103
4868
  ]
@@ -4107,20 +4872,20 @@ var ModalHeader = ({
4107
4872
  ModalHeader.displayName = "ModalHeader";
4108
4873
 
4109
4874
  // src/components/ModalContent.tsx
4110
- var import_clsx23 = __toESM(require("clsx"), 1);
4111
- var import_jsx_runtime30 = require("react/jsx-runtime");
4875
+ var import_clsx24 = __toESM(require("clsx"), 1);
4876
+ var import_jsx_runtime32 = require("react/jsx-runtime");
4112
4877
  function ModalContent({
4113
4878
  fixedHeightScrolling,
4114
4879
  children,
4115
4880
  id,
4116
4881
  testid
4117
4882
  }) {
4118
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4883
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4119
4884
  "div",
4120
4885
  {
4121
4886
  id,
4122
4887
  "data-testid": testid,
4123
- className: (0, import_clsx23.default)(
4888
+ className: (0, import_clsx24.default)(
4124
4889
  "flex-grow desktop:flex-grow-0",
4125
4890
  layoutPaddding,
4126
4891
  fixedHeightScrolling && "overflow-auto"
@@ -4132,8 +4897,8 @@ function ModalContent({
4132
4897
  ModalContent.displayName = "ModalContent";
4133
4898
 
4134
4899
  // src/components/ModalButtons.tsx
4135
- var import_clsx24 = __toESM(require("clsx"), 1);
4136
- var import_jsx_runtime31 = require("react/jsx-runtime");
4900
+ var import_clsx25 = __toESM(require("clsx"), 1);
4901
+ var import_jsx_runtime33 = require("react/jsx-runtime");
4137
4902
  var ModalButtons = ({
4138
4903
  onClose,
4139
4904
  onContinue,
@@ -4141,36 +4906,36 @@ var ModalButtons = ({
4141
4906
  id,
4142
4907
  testid
4143
4908
  }) => {
4144
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4909
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4145
4910
  "div",
4146
4911
  {
4147
4912
  id,
4148
4913
  "data-testid": testid,
4149
- className: (0, import_clsx24.default)(
4914
+ className: (0, import_clsx25.default)(
4150
4915
  "border-t border-neutral-300 flex justify-end",
4151
4916
  layoutPaddding,
4152
4917
  layoutGroupGap
4153
4918
  ),
4154
- children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
4155
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4919
+ children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
4920
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4156
4921
  Button,
4157
4922
  {
4158
4923
  id: id ? `${id}-close-button` : void 0,
4159
4924
  testid: testid ? `${testid}-close-button` : void 0,
4160
4925
  variant: "secondary",
4161
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "close", size: 24 }),
4926
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "close", size: 24 }),
4162
4927
  onClick: onClose,
4163
4928
  className: "max-sm:w-full",
4164
4929
  children: "Close"
4165
4930
  }
4166
4931
  ),
4167
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
4932
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
4168
4933
  Button,
4169
4934
  {
4170
4935
  id: id ? `${id}-continue-button` : void 0,
4171
4936
  testid: testid ? `${testid}-continue-button` : void 0,
4172
4937
  variant: "primary",
4173
- leftIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "check", size: 24 }),
4938
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon, { name: "check", size: 24 }),
4174
4939
  className: "max-sm:w-full",
4175
4940
  onClick: onContinue,
4176
4941
  children: "Continue"
@@ -4183,8 +4948,8 @@ var ModalButtons = ({
4183
4948
  ModalButtons.displayName = "ModalButtons";
4184
4949
 
4185
4950
  // src/components/ModalScrim.tsx
4186
- var import_clsx25 = __toESM(require("clsx"), 1);
4187
- var import_jsx_runtime32 = require("react/jsx-runtime");
4951
+ var import_clsx26 = __toESM(require("clsx"), 1);
4952
+ var import_jsx_runtime34 = require("react/jsx-runtime");
4188
4953
  var ModalScrim = ({
4189
4954
  show = false,
4190
4955
  size = "small",
@@ -4194,12 +4959,12 @@ var ModalScrim = ({
4194
4959
  id,
4195
4960
  testid
4196
4961
  }) => {
4197
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
4962
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
4198
4963
  "div",
4199
4964
  {
4200
4965
  id,
4201
4966
  "data-testid": testid,
4202
- className: (0, import_clsx25.default)(
4967
+ className: (0, import_clsx26.default)(
4203
4968
  "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",
4204
4969
  !show && " pointer-events-none",
4205
4970
  size === "small" && "p-4",
@@ -4215,14 +4980,14 @@ var ModalScrim = ({
4215
4980
  ModalScrim.displayName = "ModalScrim";
4216
4981
 
4217
4982
  // src/components/Modal.tsx
4218
- var import_react_dom3 = require("react-dom");
4983
+ var import_react_dom4 = require("react-dom");
4219
4984
  var import_react_use = require("react-use");
4220
4985
 
4221
4986
  // src/components/useMounted.tsx
4222
- var import_react22 = require("react");
4987
+ var import_react24 = require("react");
4223
4988
  var useMounted = () => {
4224
- const [isMounted, setIsMounted] = (0, import_react22.useState)(false);
4225
- (0, import_react22.useEffect)(() => {
4989
+ const [isMounted, setIsMounted] = (0, import_react24.useState)(false);
4990
+ (0, import_react24.useEffect)(() => {
4226
4991
  setIsMounted(true);
4227
4992
  return () => setIsMounted(false);
4228
4993
  }, []);
@@ -4230,7 +4995,7 @@ var useMounted = () => {
4230
4995
  };
4231
4996
 
4232
4997
  // src/components/Modal.tsx
4233
- var import_jsx_runtime33 = require("react/jsx-runtime");
4998
+ var import_jsx_runtime35 = require("react/jsx-runtime");
4234
4999
  var fadeInScale = (element, duration = 300) => element.animate(
4235
5000
  [
4236
5001
  { opacity: 0, transform: "scale(0.95)" },
@@ -4314,12 +5079,12 @@ var Modal = ({
4314
5079
  }) => {
4315
5080
  var _a;
4316
5081
  const mounted = useMounted();
4317
- const modalRef = (0, import_react23.useRef)(null);
4318
- const bgRef = (0, import_react23.useRef)(null);
5082
+ const modalRef = (0, import_react25.useRef)(null);
5083
+ const bgRef = (0, import_react25.useRef)(null);
4319
5084
  const wasOpen = (0, import_react_use.usePrevious)(open);
4320
5085
  const isMobile = useMatchesMobile();
4321
5086
  const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
4322
- (0, import_react23.useEffect)(() => {
5087
+ (0, import_react25.useEffect)(() => {
4323
5088
  if (!mounted) return;
4324
5089
  if (!modalRef.current || !bgRef.current) {
4325
5090
  console.error("Modal or background reference is not set.");
@@ -4339,7 +5104,7 @@ var Modal = ({
4339
5104
  bgFadeIn(bgRef.current);
4340
5105
  }
4341
5106
  }, [mounted, onClose, open, wasOpen]);
4342
- const handleKeyDown = (0, import_react23.useCallback)(
5107
+ const handleKeyDown = (0, import_react25.useCallback)(
4343
5108
  (e) => {
4344
5109
  if (e.key === "Escape") {
4345
5110
  if (onClose) {
@@ -4350,12 +5115,12 @@ var Modal = ({
4350
5115
  },
4351
5116
  [onClose]
4352
5117
  );
4353
- const handleClose = (0, import_react23.useCallback)(() => {
5118
+ const handleClose = (0, import_react25.useCallback)(() => {
4354
5119
  if (onClose) {
4355
5120
  onClose();
4356
5121
  }
4357
5122
  }, [onClose]);
4358
- (0, import_react23.useEffect)(() => {
5123
+ (0, import_react25.useEffect)(() => {
4359
5124
  if (open) {
4360
5125
  document.addEventListener("keyup", handleKeyDown);
4361
5126
  }
@@ -4363,7 +5128,7 @@ var Modal = ({
4363
5128
  document.removeEventListener("keyup", handleKeyDown);
4364
5129
  };
4365
5130
  }, [open, handleKeyDown]);
4366
- (0, import_react23.useEffect)(() => {
5131
+ (0, import_react25.useEffect)(() => {
4367
5132
  if (!open) return;
4368
5133
  const scrollY = window.scrollY;
4369
5134
  const body = document.body;
@@ -4384,7 +5149,7 @@ var Modal = ({
4384
5149
  };
4385
5150
  }, [open]);
4386
5151
  const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
4387
- const backgroundClickHandler = (0, import_react23.useCallback)(
5152
+ const backgroundClickHandler = (0, import_react25.useCallback)(
4388
5153
  (e) => {
4389
5154
  const target = e.target;
4390
5155
  const currentTarget = e.currentTarget;
@@ -4401,8 +5166,8 @@ var Modal = ({
4401
5166
  if (!mounted) {
4402
5167
  return null;
4403
5168
  }
4404
- return (0, import_react_dom3.createPortal)(
4405
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5169
+ return (0, import_react_dom4.createPortal)(
5170
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4406
5171
  ModalScrim,
4407
5172
  {
4408
5173
  id: id ? `${id}-scrim` : void 0,
@@ -4411,13 +5176,13 @@ var Modal = ({
4411
5176
  ref: bgRef,
4412
5177
  show: open,
4413
5178
  onClick: backgroundClickHandler,
4414
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
5179
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
4415
5180
  "div",
4416
5181
  {
4417
5182
  id,
4418
5183
  "data-testid": testid,
4419
5184
  ref: modalRef,
4420
- className: (0, import_clsx26.default)(
5185
+ className: (0, import_clsx27.default)(
4421
5186
  "shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
4422
5187
  computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
4423
5188
  className,
@@ -4426,7 +5191,7 @@ var Modal = ({
4426
5191
  ),
4427
5192
  onClick: (e) => e.stopPropagation(),
4428
5193
  children: [
4429
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5194
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4430
5195
  ModalHeader,
4431
5196
  {
4432
5197
  id: id ? `${id}-header` : void 0,
@@ -4439,7 +5204,7 @@ var Modal = ({
4439
5204
  headerClassname
4440
5205
  }
4441
5206
  ),
4442
- children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5207
+ children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4443
5208
  ModalContent,
4444
5209
  {
4445
5210
  id: id ? `${id}-content` : void 0,
@@ -4448,7 +5213,7 @@ var Modal = ({
4448
5213
  children
4449
5214
  }
4450
5215
  ) : children,
4451
- showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5216
+ showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
4452
5217
  ModalButtons,
4453
5218
  {
4454
5219
  id: id ? `${id}-buttons` : void 0,
@@ -4469,51 +5234,51 @@ var Modal = ({
4469
5234
  Modal.displayName = "Modal";
4470
5235
 
4471
5236
  // src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
4472
- var import_jsx_runtime34 = require("react/jsx-runtime");
5237
+ var import_jsx_runtime36 = require("react/jsx-runtime");
4473
5238
 
4474
5239
  // src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
4475
- var import_jsx_runtime35 = require("react/jsx-runtime");
5240
+ var import_jsx_runtime37 = require("react/jsx-runtime");
4476
5241
 
4477
5242
  // src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
4478
- var import_jsx_runtime36 = require("react/jsx-runtime");
5243
+ var import_jsx_runtime38 = require("react/jsx-runtime");
4479
5244
 
4480
5245
  // src/components/MobileDataGrid/ColumnList.tsx
4481
- var import_clsx28 = __toESM(require("clsx"), 1);
5246
+ var import_clsx29 = __toESM(require("clsx"), 1);
4482
5247
 
4483
5248
  // src/components/MobileDataGrid/MobileDataGridCard/index.tsx
4484
- var import_clsx27 = __toESM(require("clsx"), 1);
4485
- var import_jsx_runtime37 = require("react/jsx-runtime");
5249
+ var import_clsx28 = __toESM(require("clsx"), 1);
5250
+ var import_jsx_runtime39 = require("react/jsx-runtime");
4486
5251
 
4487
5252
  // src/components/MobileDataGrid/ColumnList.tsx
4488
- var import_jsx_runtime38 = require("react/jsx-runtime");
5253
+ var import_jsx_runtime40 = require("react/jsx-runtime");
4489
5254
 
4490
5255
  // src/components/MobileDataGrid/index.tsx
4491
- var import_jsx_runtime39 = require("react/jsx-runtime");
5256
+ var import_jsx_runtime41 = require("react/jsx-runtime");
4492
5257
 
4493
5258
  // src/components/ProductImagePreview/Thumbnail.tsx
4494
- var import_react25 = require("react");
5259
+ var import_react27 = require("react");
4495
5260
 
4496
5261
  // src/components/ImagePlaceholder.tsx
4497
- var import_react24 = require("react");
4498
- var import_jsx_runtime40 = require("react/jsx-runtime");
5262
+ var import_react26 = require("react");
5263
+ var import_jsx_runtime42 = require("react/jsx-runtime");
4499
5264
 
4500
5265
  // src/components/ProductImagePreview/Thumbnail.tsx
4501
- var import_jsx_runtime41 = require("react/jsx-runtime");
5266
+ var import_jsx_runtime43 = require("react/jsx-runtime");
4502
5267
 
4503
5268
  // src/components/Grid.tsx
4504
- var import_clsx29 = __toESM(require("clsx"), 1);
4505
- var import_jsx_runtime42 = require("react/jsx-runtime");
5269
+ var import_clsx30 = __toESM(require("clsx"), 1);
5270
+ var import_jsx_runtime44 = require("react/jsx-runtime");
4506
5271
 
4507
5272
  // src/components/ProductImagePreview/ProductPrimaryImage.tsx
4508
- var import_react26 = require("react");
4509
- var import_jsx_runtime43 = require("react/jsx-runtime");
5273
+ var import_react28 = require("react");
5274
+ var import_jsx_runtime45 = require("react/jsx-runtime");
4510
5275
 
4511
5276
  // src/components/ProductImagePreview/ZoomWindow.tsx
4512
- var import_react27 = require("react");
5277
+ var import_react29 = require("react");
4513
5278
 
4514
5279
  // src/components/Surface.tsx
4515
- var import_clsx30 = __toESM(require("clsx"), 1);
4516
- var import_jsx_runtime44 = require("react/jsx-runtime");
5280
+ var import_clsx31 = __toESM(require("clsx"), 1);
5281
+ var import_jsx_runtime46 = require("react/jsx-runtime");
4517
5282
  var Surface = (_a) => {
4518
5283
  var _b = _a, {
4519
5284
  children,
@@ -4526,11 +5291,11 @@ var Surface = (_a) => {
4526
5291
  "elevation",
4527
5292
  "id"
4528
5293
  ]);
4529
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
5294
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
4530
5295
  "div",
4531
5296
  __spreadProps(__spreadValues({
4532
5297
  id,
4533
- className: (0, import_clsx30.default)(
5298
+ className: (0, import_clsx31.default)(
4534
5299
  "rounded-base",
4535
5300
  {
4536
5301
  "shadow-2": elevation === 2,
@@ -4547,43 +5312,43 @@ var Surface = (_a) => {
4547
5312
  Surface.displayName = "Surface";
4548
5313
 
4549
5314
  // src/components/ProductImagePreview/ZoomWindow.tsx
4550
- var import_jsx_runtime45 = require("react/jsx-runtime");
5315
+ var import_jsx_runtime47 = require("react/jsx-runtime");
4551
5316
 
4552
5317
  // src/components/ProductImagePreview/CarouselPagination.tsx
4553
- var import_clsx31 = require("clsx");
4554
- var import_jsx_runtime46 = require("react/jsx-runtime");
5318
+ var import_clsx32 = require("clsx");
5319
+ var import_jsx_runtime48 = require("react/jsx-runtime");
4555
5320
 
4556
5321
  // src/components/ProductImagePreview/MobileImageCarousel.tsx
4557
- var import_react28 = require("react");
4558
- var import_jsx_runtime47 = require("react/jsx-runtime");
5322
+ var import_react30 = require("react");
5323
+ var import_jsx_runtime49 = require("react/jsx-runtime");
4559
5324
 
4560
5325
  // src/components/ProductImagePreview/useProductImagePreview.ts
4561
- var import_react29 = require("react");
5326
+ var import_react31 = require("react");
4562
5327
 
4563
5328
  // src/components/ProductImagePreview/index.tsx
4564
- var import_jsx_runtime48 = require("react/jsx-runtime");
5329
+ var import_jsx_runtime50 = require("react/jsx-runtime");
4565
5330
 
4566
5331
  // src/components/CompactImagesPreview.tsx
4567
- var import_react30 = require("react");
4568
- var import_clsx32 = __toESM(require("clsx"), 1);
4569
- var import_jsx_runtime49 = require("react/jsx-runtime");
5332
+ var import_react32 = require("react");
5333
+ var import_clsx33 = __toESM(require("clsx"), 1);
5334
+ var import_jsx_runtime51 = require("react/jsx-runtime");
4570
5335
 
4571
5336
  // src/components/SimpleTable.tsx
4572
- var import_clsx33 = __toESM(require("clsx"), 1);
4573
- var import_jsx_runtime50 = require("react/jsx-runtime");
5337
+ var import_clsx34 = __toESM(require("clsx"), 1);
5338
+ var import_jsx_runtime52 = require("react/jsx-runtime");
4574
5339
 
4575
5340
  // src/components/PDFViewer/index.tsx
4576
- var import_react33 = require("react");
5341
+ var import_react35 = require("react");
4577
5342
 
4578
5343
  // src/components/PDFViewer/PDFElement.tsx
4579
5344
  var import_react_pdf2 = require("@mikecousins/react-pdf");
4580
- var import_react32 = require("react");
5345
+ var import_react34 = require("react");
4581
5346
 
4582
5347
  // src/components/Spinner.tsx
4583
- var import_jsx_runtime51 = require("react/jsx-runtime");
5348
+ var import_jsx_runtime53 = require("react/jsx-runtime");
4584
5349
  var Spinner = ({ size = "small", testid }) => {
4585
5350
  const dimension = size === "large" ? 48 : 24;
4586
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
5351
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
4587
5352
  "svg",
4588
5353
  {
4589
5354
  "data-testid": testid,
@@ -4595,14 +5360,14 @@ var Spinner = ({ size = "small", testid }) => {
4595
5360
  className: "spinner",
4596
5361
  "aria-label": "Loading",
4597
5362
  children: [
4598
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
4599
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
4600
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
4601
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
4602
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
4603
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
4604
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
4605
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
5363
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
5364
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
5365
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
5366
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
5367
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
5368
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
5369
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
5370
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
4606
5371
  ]
4607
5372
  }
4608
5373
  );
@@ -4611,31 +5376,31 @@ Spinner.displayName = "Spinner";
4611
5376
 
4612
5377
  // src/components/PDFViewer/PDFPage.tsx
4613
5378
  var import_react_pdf = require("@mikecousins/react-pdf");
4614
- var import_react31 = require("react");
4615
- var import_jsx_runtime52 = require("react/jsx-runtime");
5379
+ var import_react33 = require("react");
5380
+ var import_jsx_runtime54 = require("react/jsx-runtime");
4616
5381
 
4617
5382
  // src/components/PDFViewer/PDFElement.tsx
4618
- var import_clsx34 = __toESM(require("clsx"), 1);
4619
- var import_jsx_runtime53 = require("react/jsx-runtime");
5383
+ var import_clsx35 = __toESM(require("clsx"), 1);
5384
+ var import_jsx_runtime55 = require("react/jsx-runtime");
4620
5385
 
4621
5386
  // src/components/PDFViewer/DownloadIcon.tsx
4622
- var import_jsx_runtime54 = require("react/jsx-runtime");
5387
+ var import_jsx_runtime56 = require("react/jsx-runtime");
4623
5388
 
4624
5389
  // src/components/PDFViewer/PDFNavigation.tsx
4625
- var import_jsx_runtime55 = require("react/jsx-runtime");
5390
+ var import_jsx_runtime57 = require("react/jsx-runtime");
4626
5391
 
4627
5392
  // src/components/PDFViewer/index.tsx
4628
- var import_jsx_runtime56 = require("react/jsx-runtime");
5393
+ var import_jsx_runtime58 = require("react/jsx-runtime");
4629
5394
 
4630
5395
  // src/components/ListGroup.tsx
4631
- var import_react34 = require("react");
4632
- var import_clsx35 = __toESM(require("clsx"), 1);
4633
- var import_jsx_runtime57 = require("react/jsx-runtime");
5396
+ var import_react36 = require("react");
5397
+ var import_clsx36 = __toESM(require("clsx"), 1);
5398
+ var import_jsx_runtime59 = require("react/jsx-runtime");
4634
5399
 
4635
5400
  // src/components/Pagination.tsx
4636
- var import_react35 = require("react");
4637
- var import_clsx36 = __toESM(require("clsx"), 1);
4638
- var import_jsx_runtime58 = require("react/jsx-runtime");
5401
+ var import_react37 = require("react");
5402
+ var import_clsx37 = __toESM(require("clsx"), 1);
5403
+ var import_jsx_runtime60 = require("react/jsx-runtime");
4639
5404
  var Pagination = ({
4640
5405
  totalPages,
4641
5406
  currentPage,
@@ -4645,7 +5410,7 @@ var Pagination = ({
4645
5410
  className,
4646
5411
  disabled
4647
5412
  }) => {
4648
- const goTo = (0, import_react35.useCallback)(
5413
+ const goTo = (0, import_react37.useCallback)(
4649
5414
  (page) => {
4650
5415
  if (disabled) return;
4651
5416
  onPageChange(page);
@@ -4662,7 +5427,7 @@ var Pagination = ({
4662
5427
  goTo(currentPage + 1);
4663
5428
  }
4664
5429
  };
4665
- const pageTokens = (0, import_react35.useMemo)(() => {
5430
+ const pageTokens = (0, import_react37.useMemo)(() => {
4666
5431
  if (totalPages <= 5) {
4667
5432
  return Array.from({ length: totalPages }, (_, i) => i + 1);
4668
5433
  }
@@ -4699,7 +5464,7 @@ var Pagination = ({
4699
5464
  return tokens;
4700
5465
  }, [totalPages, currentPage]);
4701
5466
  if (totalPages <= 1) return null;
4702
- const buttonClass = (0, import_clsx36.default)(
5467
+ const buttonClass = (0, import_clsx37.default)(
4703
5468
  "cursor-pointer disabled:cursor-default",
4704
5469
  paddingUsingComponentGap,
4705
5470
  "w-8 h-8",
@@ -4710,14 +5475,14 @@ var Pagination = ({
4710
5475
  "focus:bg-background-grouped-secondary-normal focus:outline-0",
4711
5476
  "disabled:bg-transparent disabled:text-text-action-primary-disabled"
4712
5477
  );
4713
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5478
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
4714
5479
  "nav",
4715
5480
  {
4716
5481
  id,
4717
5482
  "data-testid": testid,
4718
5483
  "aria-label": "Pagination",
4719
5484
  onKeyDown: handleKey,
4720
- className: (0, import_clsx36.default)(
5485
+ className: (0, import_clsx37.default)(
4721
5486
  "flex items-center",
4722
5487
  "border border-border-primary-normal",
4723
5488
  "bg-background-grouped-primary-normal",
@@ -4725,19 +5490,19 @@ var Pagination = ({
4725
5490
  className
4726
5491
  ),
4727
5492
  children: [
4728
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5493
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4729
5494
  "button",
4730
5495
  {
4731
5496
  disabled: disabled || currentPage <= 1,
4732
5497
  "aria-label": "Previous page",
4733
5498
  onClick: () => goTo(currentPage - 1),
4734
- className: (0, import_clsx36.default)(buttonClass, "border-r-1 border-border-primary-normal"),
4735
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "keyboard_arrow_left" })
5499
+ className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
5500
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "keyboard_arrow_left" })
4736
5501
  }
4737
5502
  ),
4738
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { className: (0, import_clsx36.default)("flex items-center"), children: pageTokens.map((token, index) => {
5503
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
4739
5504
  if (token === "ellipsis") {
4740
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5505
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4741
5506
  "li",
4742
5507
  {
4743
5508
  className: "w-8 h-8 select-none text-text-action-primary-disabled",
@@ -4747,29 +5512,29 @@ var Pagination = ({
4747
5512
  );
4748
5513
  }
4749
5514
  const selected = token === currentPage;
4750
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5515
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4751
5516
  "button",
4752
5517
  {
4753
5518
  "aria-label": `Page ${token}`,
4754
5519
  "aria-current": selected ? "page" : void 0,
4755
5520
  disabled,
4756
5521
  onClick: () => goTo(token),
4757
- className: (0, import_clsx36.default)(
5522
+ className: (0, import_clsx37.default)(
4758
5523
  buttonClass,
4759
5524
  selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
4760
5525
  ),
4761
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Subheader, { align: "center", weight: "bold", children: token })
5526
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Subheader, { align: "center", weight: "bold", children: token })
4762
5527
  }
4763
5528
  ) }, token);
4764
5529
  }) }),
4765
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5530
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
4766
5531
  "button",
4767
5532
  {
4768
5533
  disabled: disabled || currentPage >= totalPages,
4769
5534
  "aria-label": "Next page",
4770
5535
  onClick: () => goTo(currentPage + 1),
4771
- className: (0, import_clsx36.default)(buttonClass, "border-l-1 border-border-primary-normal"),
4772
- children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "keyboard_arrow_right" })
5536
+ className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
5537
+ children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon, { name: "keyboard_arrow_right" })
4773
5538
  }
4774
5539
  )
4775
5540
  ]
@@ -4779,13 +5544,18 @@ var Pagination = ({
4779
5544
  Pagination.displayName = "Pagination";
4780
5545
 
4781
5546
  // src/components/SkeletonParagraph.tsx
4782
- var import_jsx_runtime59 = require("react/jsx-runtime");
5547
+ var import_jsx_runtime61 = require("react/jsx-runtime");
4783
5548
 
4784
5549
  // src/components/EmptyCartIcon.tsx
4785
- var import_jsx_runtime60 = require("react/jsx-runtime");
5550
+ var import_jsx_runtime62 = require("react/jsx-runtime");
5551
+
5552
+ // src/components/Alert.tsx
5553
+ var import_clsx38 = __toESM(require("clsx"), 1);
5554
+ var import_react38 = require("react");
5555
+ var import_jsx_runtime63 = require("react/jsx-runtime");
4786
5556
 
4787
5557
  // src/components/DataGrid/TableBody/TableBodyRow.tsx
4788
- var import_jsx_runtime61 = require("react/jsx-runtime");
5558
+ var import_jsx_runtime64 = require("react/jsx-runtime");
4789
5559
  var valueFormatters = {
4790
5560
  date: (value) => typeof value === "string" ? formatDate(value) : "",
4791
5561
  currency: (value) => formatCurrencyDisplay(value)
@@ -4818,10 +5588,10 @@ function TableBodyRow({
4818
5588
  const columns = locked ? visibleCells : virtualColumns;
4819
5589
  const isError = typeof row.original === "object" && row.original !== null && "rowState" in row.original && row.original.rowState === "error";
4820
5590
  const CellElement = locked ? DataGridCell : DragAlongCell;
4821
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
5591
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
4822
5592
  "tr",
4823
5593
  {
4824
- className: (0, import_clsx37.default)(
5594
+ className: (0, import_clsx39.default)(
4825
5595
  "min-h-10",
4826
5596
  "transition-colors hover:bg-background-action-secondary-hover",
4827
5597
  row.getIsSelected() && "!bg-background-action-secondary-hover",
@@ -4839,7 +5609,7 @@ function TableBodyRow({
4839
5609
  children: [
4840
5610
  !locked && virtualPaddingLeft ? (
4841
5611
  // fake empty column to the left for virtualization scroll padding
4842
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
5612
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
4843
5613
  ) : null,
4844
5614
  columns.map((column) => {
4845
5615
  var _a2, _b, _c, _d;
@@ -4850,17 +5620,17 @@ function TableBodyRow({
4850
5620
  const cellFormat = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.format;
4851
5621
  const cellValue = cellFormat && isValueFormatterKey(cellFormat) ? valueFormatters[cellFormat](cell.getValue()) : cell.getValue();
4852
5622
  const cellAlignment = (_c = (_b = cell.column.columnDef.meta) == null ? void 0 : _b.align) != null ? _c : typeof cellValue === "number" ? "right" : "left";
4853
- return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_react36.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5623
+ return ((_d = cell.column.columnDef.meta) == null ? void 0 : _d.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react39.default.Fragment, { children: (0, import_react_table3.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4854
5624
  CellElement,
4855
5625
  {
4856
5626
  id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
4857
5627
  testid: testid ? `${testid}-row-${row.id}-cell-${cell.id}` : void 0,
4858
5628
  cell,
4859
- className: (0, import_clsx37.default)({
5629
+ className: (0, import_clsx39.default)({
4860
5630
  "justify-start": cellAlignment === "left",
4861
5631
  "justify-end": cellAlignment === "right"
4862
5632
  }),
4863
- children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5633
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
4864
5634
  Tooltip,
4865
5635
  {
4866
5636
  id: id ? `${id}-tooltip-${cell.id}` : void 0,
@@ -4868,7 +5638,7 @@ function TableBodyRow({
4868
5638
  showOnTruncation: true,
4869
5639
  message: cellValue,
4870
5640
  position: "bottom",
4871
- children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
5641
+ children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
4872
5642
  }
4873
5643
  )
4874
5644
  },
@@ -4877,7 +5647,7 @@ function TableBodyRow({
4877
5647
  }),
4878
5648
  !locked && virtualPaddingRight ? (
4879
5649
  // fake empty column to the right for virtualization scroll padding
4880
- /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
5650
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
4881
5651
  ) : null
4882
5652
  ]
4883
5653
  },