@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.
- package/dist/{chunk-IG2YUDHI.js → chunk-24K4HHV5.js} +4 -4
- package/dist/{chunk-OEMLNGE2.js → chunk-4Q7T4GJ2.js} +2 -2
- package/dist/chunk-4UH72JT2.js +104 -0
- package/dist/{chunk-KJNK7KEV.js → chunk-QMSPTD6L.js} +1 -1
- package/dist/{chunk-GTPSPGSJ.js → chunk-WIDUWFLX.js} +761 -47
- package/dist/components/Accordion.js +2 -2
- package/dist/components/Alert.cjs +787 -0
- package/dist/components/Alert.js +13 -0
- package/dist/components/CalendarRange.cjs +465 -160
- package/dist/components/CalendarRange.css +3 -0
- package/dist/components/CalendarRange.js +19 -19
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +918 -148
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +3 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +19 -18
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +928 -158
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +3 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +19 -18
- package/dist/components/DataGrid/PinnedColumns.cjs +943 -173
- package/dist/components/DataGrid/PinnedColumns.css +3 -0
- package/dist/components/DataGrid/PinnedColumns.js +19 -18
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +919 -149
- package/dist/components/DataGrid/TableBody/LoadingCell.css +3 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +19 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +925 -155
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +3 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +19 -18
- package/dist/components/DataGrid/TableBody/index.cjs +940 -170
- package/dist/components/DataGrid/TableBody/index.css +3 -0
- package/dist/components/DataGrid/TableBody/index.js +19 -18
- package/dist/components/DataGrid/index.cjs +1029 -259
- package/dist/components/DataGrid/index.css +3 -0
- package/dist/components/DataGrid/index.js +19 -18
- package/dist/components/DataGrid/utils.cjs +919 -149
- package/dist/components/DataGrid/utils.css +3 -0
- package/dist/components/DataGrid/utils.js +19 -18
- package/dist/components/DataGridCell.js +2 -2
- package/dist/components/DateInput.cjs +70 -65
- package/dist/components/DateInput.css +3 -0
- package/dist/components/DateInput.js +25 -271
- package/dist/components/DateRangeInput.cjs +419 -184
- package/dist/components/DateRangeInput.css +3 -0
- package/dist/components/DateRangeInput.js +19 -19
- package/dist/components/FilterGroup.js +6 -6
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +925 -155
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +3 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +19 -18
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +923 -153
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +3 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +19 -18
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +6 -6
- package/dist/components/MobileDataGrid/index.cjs +973 -203
- package/dist/components/MobileDataGrid/index.css +3 -0
- package/dist/components/MobileDataGrid/index.js +19 -18
- package/dist/components/Modal.js +3 -3
- package/dist/components/Notification.js +3 -3
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.js +6 -6
- package/dist/components/SideMenuItem.js +3 -3
- package/dist/components/Swatch.js +3 -3
- package/dist/components/Upload.js +3 -3
- package/dist/components/index.cjs +1212 -363
- package/dist/components/index.css +3 -0
- package/dist/components/index.js +34 -28
- package/dist/index.css +3 -0
- package/package.json +1 -1
- package/src/components/Alert.tsx +81 -0
- package/src/components/index.ts +2 -0
- package/dist/chunk-X35NLL3N.js +0 -493
- package/dist/{chunk-IT4VFU6T.js → chunk-3DEYCNUE.js} +3 -3
- package/dist/{chunk-GTBGPBH6.js → chunk-B53XDCLO.js} +3 -3
- package/dist/{chunk-ZQSD74IJ.js → chunk-IY7SXEVY.js} +3 -3
- package/dist/{chunk-BFFNSUNS.js → chunk-QBSEKZWX.js} +3 -3
- package/dist/{chunk-NIWXVOBW.js → chunk-X67L3NZI.js} +3 -3
- package/dist/{chunk-TVXBP5CW.js → chunk-XIXQUEYC.js} +3 -3
|
@@ -60,6 +60,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
60
60
|
var components_exports = {};
|
|
61
61
|
__export(components_exports, {
|
|
62
62
|
Accordion: () => Accordion,
|
|
63
|
+
Alert: () => Alert,
|
|
63
64
|
Button: () => Button,
|
|
64
65
|
Card: () => Card,
|
|
65
66
|
Checkbox: () => Checkbox,
|
|
@@ -67,6 +68,7 @@ __export(components_exports, {
|
|
|
67
68
|
DataCellHeader: () => DataCellHeader,
|
|
68
69
|
DataGrid: () => DataGrid,
|
|
69
70
|
DataGridCell: () => DataGridCell,
|
|
71
|
+
DateInput: () => DateInput,
|
|
70
72
|
DragAlongCell: () => DragAlongCell,
|
|
71
73
|
DraggableCellHeader: () => DraggableCellHeader,
|
|
72
74
|
EmptyCartIcon: () => EmptyCartIcon,
|
|
@@ -499,6 +501,76 @@ function formatCurrencyDisplay(value) {
|
|
|
499
501
|
}
|
|
500
502
|
|
|
501
503
|
// src/utils/date.ts
|
|
504
|
+
function parseInputDate(input) {
|
|
505
|
+
const match = input.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
506
|
+
if (!match) {
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
const [, month, day, year] = match;
|
|
510
|
+
const paddedMonth = month.padStart(2, "0");
|
|
511
|
+
const paddedDay = day.padStart(2, "0");
|
|
512
|
+
return `${year}-${paddedMonth}-${paddedDay}`;
|
|
513
|
+
}
|
|
514
|
+
function isValidDate(dateString) {
|
|
515
|
+
const date = new Date(dateString);
|
|
516
|
+
return date instanceof Date && !isNaN(date.getTime()) && dateString === date.toISOString().split("T")[0];
|
|
517
|
+
}
|
|
518
|
+
function formatInputValue(value) {
|
|
519
|
+
const digits = value.replace(/\D/g, "");
|
|
520
|
+
if (digits.length < 2) {
|
|
521
|
+
return digits;
|
|
522
|
+
}
|
|
523
|
+
if (digits.length >= 4) {
|
|
524
|
+
return `${digits.slice(0, 2)}/${digits.slice(2, 4)}/${digits.slice(4, 8)}`;
|
|
525
|
+
}
|
|
526
|
+
return `${digits.slice(0, 2)}/${digits.slice(2)}`;
|
|
527
|
+
}
|
|
528
|
+
function isDigit(character) {
|
|
529
|
+
return /\d/.test(character);
|
|
530
|
+
}
|
|
531
|
+
function isSlash(character) {
|
|
532
|
+
return character === "/";
|
|
533
|
+
}
|
|
534
|
+
function countDigitsUpToCursor(value, cursorPosition) {
|
|
535
|
+
let digitCount = 0;
|
|
536
|
+
for (let i = 0; i < cursorPosition && i < value.length; i++) {
|
|
537
|
+
if (!isDigit(value[i])) {
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
digitCount++;
|
|
541
|
+
}
|
|
542
|
+
return digitCount;
|
|
543
|
+
}
|
|
544
|
+
function findPositionAfterDigitCount(formattedValue, targetDigitCount) {
|
|
545
|
+
let currentDigitCount = 0;
|
|
546
|
+
for (let i = 0; i < formattedValue.length; i++) {
|
|
547
|
+
if (!isDigit(formattedValue[i])) {
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
currentDigitCount++;
|
|
551
|
+
if (currentDigitCount !== targetDigitCount) {
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
const positionAfterDigit = i + 1;
|
|
555
|
+
const nextCharacter = formattedValue[positionAfterDigit];
|
|
556
|
+
if (nextCharacter && isSlash(nextCharacter)) {
|
|
557
|
+
return positionAfterDigit + 1;
|
|
558
|
+
}
|
|
559
|
+
return positionAfterDigit;
|
|
560
|
+
}
|
|
561
|
+
return formattedValue.length;
|
|
562
|
+
}
|
|
563
|
+
function calculateCursorPosition(originalValue, formattedValue, originalPosition) {
|
|
564
|
+
const targetDigitCount = countDigitsUpToCursor(
|
|
565
|
+
originalValue,
|
|
566
|
+
originalPosition
|
|
567
|
+
);
|
|
568
|
+
const newPosition = findPositionAfterDigitCount(
|
|
569
|
+
formattedValue,
|
|
570
|
+
targetDigitCount
|
|
571
|
+
);
|
|
572
|
+
return Math.min(newPosition, formattedValue.length);
|
|
573
|
+
}
|
|
502
574
|
function parseDateParts(dateString) {
|
|
503
575
|
const [yearStr, monthStr, dayStr] = dateString.split("-");
|
|
504
576
|
if (!yearStr || !monthStr || !dayStr) {
|
|
@@ -4083,12 +4155,707 @@ var Tooltip = ({
|
|
|
4083
4155
|
};
|
|
4084
4156
|
Tooltip.displayName = "Tooltip";
|
|
4085
4157
|
|
|
4086
|
-
// src/components/
|
|
4087
|
-
var
|
|
4158
|
+
// src/components/DateInput.tsx
|
|
4159
|
+
var import_react20 = require("react");
|
|
4160
|
+
var import_react_dom3 = require("react-dom");
|
|
4088
4161
|
|
|
4089
|
-
// src/components/
|
|
4162
|
+
// src/components/CalendarRange.tsx
|
|
4090
4163
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
4164
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
4165
|
+
var import_polyfill = require("@js-temporal/polyfill");
|
|
4091
4166
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
4167
|
+
function DateCell(_a) {
|
|
4168
|
+
var _b = _a, {
|
|
4169
|
+
date,
|
|
4170
|
+
isInMonth,
|
|
4171
|
+
isToday,
|
|
4172
|
+
isSelected,
|
|
4173
|
+
inRange,
|
|
4174
|
+
isDisabled,
|
|
4175
|
+
isRangeStart,
|
|
4176
|
+
isRangeEnd,
|
|
4177
|
+
onClick,
|
|
4178
|
+
onMouseEnter,
|
|
4179
|
+
onMouseLeave,
|
|
4180
|
+
cellPadding = "",
|
|
4181
|
+
isRangeDisabled = false,
|
|
4182
|
+
id,
|
|
4183
|
+
testid
|
|
4184
|
+
} = _b, props = __objRest(_b, [
|
|
4185
|
+
"date",
|
|
4186
|
+
"isInMonth",
|
|
4187
|
+
"isToday",
|
|
4188
|
+
"isSelected",
|
|
4189
|
+
"inRange",
|
|
4190
|
+
"isDisabled",
|
|
4191
|
+
"isRangeStart",
|
|
4192
|
+
"isRangeEnd",
|
|
4193
|
+
"onClick",
|
|
4194
|
+
"onMouseEnter",
|
|
4195
|
+
"onMouseLeave",
|
|
4196
|
+
"cellPadding",
|
|
4197
|
+
"isRangeDisabled",
|
|
4198
|
+
"id",
|
|
4199
|
+
"testid"
|
|
4200
|
+
]);
|
|
4201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4202
|
+
"span",
|
|
4203
|
+
__spreadProps(__spreadValues({}, props), {
|
|
4204
|
+
id,
|
|
4205
|
+
"data-testid": testid,
|
|
4206
|
+
className: (0, import_clsx19.default)(
|
|
4207
|
+
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
4208
|
+
typography.caption,
|
|
4209
|
+
cellPadding,
|
|
4210
|
+
!isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
|
|
4211
|
+
!isInMonth && "border-transparent",
|
|
4212
|
+
// Today: subtle border ring
|
|
4213
|
+
isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
|
|
4214
|
+
// Selected: Figma blue, white text, strong shadow
|
|
4215
|
+
isSelected && "bg-action-400 text-white border-action-400 z-10",
|
|
4216
|
+
!isSelected && !inRange && "rounded-base",
|
|
4217
|
+
// When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
|
|
4218
|
+
(isRangeDisabled || !inRange && isSelected) && "rounded-base",
|
|
4219
|
+
inRange && isSelected && "hover:border-action-500",
|
|
4220
|
+
// In range: Figma light blue background
|
|
4221
|
+
inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
|
|
4222
|
+
// Disabled: Figma gray, no pointer, no hover
|
|
4223
|
+
isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
|
|
4224
|
+
"text-text-primary-normal cursor-pointer",
|
|
4225
|
+
// Figma hover: blue bg, blue text (or red text if selected)
|
|
4226
|
+
isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
|
|
4227
|
+
// Figma active: darker blue bg, white text
|
|
4228
|
+
"active:bg-action-300 active:text-white",
|
|
4229
|
+
// Figma focus: ring
|
|
4230
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
|
|
4231
|
+
],
|
|
4232
|
+
isRangeStart && "rounded-l",
|
|
4233
|
+
isRangeEnd && "rounded-r"
|
|
4234
|
+
),
|
|
4235
|
+
tabIndex: isDisabled ? -1 : 0,
|
|
4236
|
+
"aria-disabled": isDisabled,
|
|
4237
|
+
onClick: () => !isDisabled && isInMonth && onClick(),
|
|
4238
|
+
onMouseEnter: () => isInMonth && onMouseEnter(),
|
|
4239
|
+
onMouseLeave: () => isInMonth && onMouseLeave(),
|
|
4240
|
+
children: isInMonth ? date.day : ""
|
|
4241
|
+
})
|
|
4242
|
+
);
|
|
4243
|
+
}
|
|
4244
|
+
function CalendarRange({
|
|
4245
|
+
from,
|
|
4246
|
+
to,
|
|
4247
|
+
onChange,
|
|
4248
|
+
isDateAvailable,
|
|
4249
|
+
mode = "double",
|
|
4250
|
+
cardStyle = false,
|
|
4251
|
+
disableRange = false,
|
|
4252
|
+
id,
|
|
4253
|
+
testid
|
|
4254
|
+
}) {
|
|
4255
|
+
const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
4256
|
+
const parseDate = (d) => {
|
|
4257
|
+
if (!d) {
|
|
4258
|
+
return void 0;
|
|
4259
|
+
}
|
|
4260
|
+
try {
|
|
4261
|
+
if (typeof d === "number") {
|
|
4262
|
+
return import_polyfill.Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
|
|
4263
|
+
}
|
|
4264
|
+
if (typeof d === "string") {
|
|
4265
|
+
return import_polyfill.Temporal.PlainDate.from(d);
|
|
4266
|
+
}
|
|
4267
|
+
return void 0;
|
|
4268
|
+
} catch (error) {
|
|
4269
|
+
console.error("Invalid date format:", d, error);
|
|
4270
|
+
return import_polyfill.Temporal.Now.plainDateISO();
|
|
4271
|
+
}
|
|
4272
|
+
};
|
|
4273
|
+
const fromDate = parseDate(from);
|
|
4274
|
+
const toDate = parseDate(to);
|
|
4275
|
+
const today = import_polyfill.Temporal.Now.plainDateISO();
|
|
4276
|
+
const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
|
|
4277
|
+
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
4278
|
+
);
|
|
4279
|
+
const [selecting, setSelecting] = (0, import_react19.useState)("from");
|
|
4280
|
+
const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
|
|
4281
|
+
const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
|
|
4282
|
+
(0, import_react19.useEffect)(() => {
|
|
4283
|
+
if (fromDate) {
|
|
4284
|
+
setBaseMonth(fromDate.with({ day: 1 }));
|
|
4285
|
+
} else if (toDate) {
|
|
4286
|
+
setBaseMonth(toDate.with({ day: 1 }));
|
|
4287
|
+
}
|
|
4288
|
+
}, [from, to]);
|
|
4289
|
+
(0, import_react19.useEffect)(() => {
|
|
4290
|
+
if (fromDate && toDate) {
|
|
4291
|
+
setSelecting("from");
|
|
4292
|
+
setPendingFrom(void 0);
|
|
4293
|
+
setHoveredDate(void 0);
|
|
4294
|
+
}
|
|
4295
|
+
}, [from, to]);
|
|
4296
|
+
function getMonthData(monthOffset) {
|
|
4297
|
+
const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
|
|
4298
|
+
const days = monthDate.daysInMonth;
|
|
4299
|
+
const firstDayOffset = monthDate.dayOfWeek % 7;
|
|
4300
|
+
return {
|
|
4301
|
+
name: monthDate.toLocaleString("en-US", { month: "long" }),
|
|
4302
|
+
year: monthDate.year,
|
|
4303
|
+
days,
|
|
4304
|
+
firstDayOffset,
|
|
4305
|
+
date: monthDate
|
|
4306
|
+
};
|
|
4307
|
+
}
|
|
4308
|
+
function getMonthDataWith(monthOffset) {
|
|
4309
|
+
const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
|
|
4310
|
+
const days = monthDate.daysInMonth;
|
|
4311
|
+
const firstDayOffset = monthDate.dayOfWeek % 7;
|
|
4312
|
+
return {
|
|
4313
|
+
name: monthDate.toLocaleString("en-US", { month: "long" }),
|
|
4314
|
+
year: monthDate.year,
|
|
4315
|
+
days,
|
|
4316
|
+
firstDayOffset,
|
|
4317
|
+
date: monthDate
|
|
4318
|
+
};
|
|
4319
|
+
}
|
|
4320
|
+
function handleDayClick(date) {
|
|
4321
|
+
if (isDateAvailable && !isDateAvailable(date)) return;
|
|
4322
|
+
if (mode === "single" && disableRange) {
|
|
4323
|
+
if (onChange) {
|
|
4324
|
+
onChange(date.toString(), date.toString());
|
|
4325
|
+
}
|
|
4326
|
+
return;
|
|
4327
|
+
}
|
|
4328
|
+
if (selecting === "from") {
|
|
4329
|
+
setPendingFrom(date);
|
|
4330
|
+
setSelecting("to");
|
|
4331
|
+
setHoveredDate(void 0);
|
|
4332
|
+
} else if (pendingFrom) {
|
|
4333
|
+
if (onChange) {
|
|
4334
|
+
const [start, end] = import_polyfill.Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
|
|
4335
|
+
onChange(start.toString(), end.toString());
|
|
4336
|
+
}
|
|
4337
|
+
setPendingFrom(void 0);
|
|
4338
|
+
setSelecting("from");
|
|
4339
|
+
setHoveredDate(void 0);
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
function isInRange(date) {
|
|
4343
|
+
if (mode === "single" && disableRange) {
|
|
4344
|
+
return false;
|
|
4345
|
+
}
|
|
4346
|
+
if (pendingFrom && selecting === "to" && hoveredDate) {
|
|
4347
|
+
const [start, end] = import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
|
|
4348
|
+
return import_polyfill.Temporal.PlainDate.compare(date, start) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, end) <= 0;
|
|
4349
|
+
}
|
|
4350
|
+
if (!pendingFrom && fromDate && toDate) {
|
|
4351
|
+
return import_polyfill.Temporal.PlainDate.compare(date, fromDate) >= 0 && import_polyfill.Temporal.PlainDate.compare(date, toDate) <= 0;
|
|
4352
|
+
}
|
|
4353
|
+
return false;
|
|
4354
|
+
}
|
|
4355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4356
|
+
"div",
|
|
4357
|
+
{
|
|
4358
|
+
id,
|
|
4359
|
+
"data-testid": testid,
|
|
4360
|
+
className: (0, import_clsx19.default)(
|
|
4361
|
+
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
4362
|
+
layoutPaddding,
|
|
4363
|
+
layoutGap,
|
|
4364
|
+
cardStyle && "shadow-4",
|
|
4365
|
+
// baseTransition,
|
|
4366
|
+
"overflow-hidden"
|
|
4367
|
+
),
|
|
4368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4369
|
+
"div",
|
|
4370
|
+
{
|
|
4371
|
+
className: (0, import_clsx19.default)(
|
|
4372
|
+
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
4373
|
+
layoutGap
|
|
4374
|
+
),
|
|
4375
|
+
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
4376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4377
|
+
CalendarPane,
|
|
4378
|
+
{
|
|
4379
|
+
getMonthData,
|
|
4380
|
+
getMonthDataWith,
|
|
4381
|
+
offset,
|
|
4382
|
+
idx,
|
|
4383
|
+
id,
|
|
4384
|
+
testid,
|
|
4385
|
+
baseMonth,
|
|
4386
|
+
setBaseMonth,
|
|
4387
|
+
mode,
|
|
4388
|
+
pendingFrom,
|
|
4389
|
+
weekDays,
|
|
4390
|
+
fromDate,
|
|
4391
|
+
toDate,
|
|
4392
|
+
isDateAvailable,
|
|
4393
|
+
disableRange,
|
|
4394
|
+
hoveredDate,
|
|
4395
|
+
isInRange,
|
|
4396
|
+
today,
|
|
4397
|
+
setHoveredDate,
|
|
4398
|
+
handleDayClick
|
|
4399
|
+
},
|
|
4400
|
+
idx
|
|
4401
|
+
);
|
|
4402
|
+
})
|
|
4403
|
+
}
|
|
4404
|
+
)
|
|
4405
|
+
}
|
|
4406
|
+
);
|
|
4407
|
+
}
|
|
4408
|
+
function CalendarPane({
|
|
4409
|
+
getMonthData,
|
|
4410
|
+
getMonthDataWith,
|
|
4411
|
+
offset,
|
|
4412
|
+
idx,
|
|
4413
|
+
id,
|
|
4414
|
+
testid,
|
|
4415
|
+
baseMonth,
|
|
4416
|
+
setBaseMonth,
|
|
4417
|
+
mode,
|
|
4418
|
+
pendingFrom,
|
|
4419
|
+
weekDays,
|
|
4420
|
+
fromDate,
|
|
4421
|
+
toDate,
|
|
4422
|
+
isDateAvailable,
|
|
4423
|
+
disableRange,
|
|
4424
|
+
hoveredDate,
|
|
4425
|
+
isInRange,
|
|
4426
|
+
today,
|
|
4427
|
+
setHoveredDate,
|
|
4428
|
+
handleDayClick
|
|
4429
|
+
}) {
|
|
4430
|
+
const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
4431
|
+
const years = Array.from({ length: 100 }).map(
|
|
4432
|
+
(_, i) => baseMonth.year - 50 + i
|
|
4433
|
+
);
|
|
4434
|
+
const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
|
|
4435
|
+
const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
|
|
4436
|
+
const monthMenuRef = (0, import_react19.useRef)(null);
|
|
4437
|
+
const yearMenuRef = (0, import_react19.useRef)(null);
|
|
4438
|
+
const month = getMonthData(offset);
|
|
4439
|
+
const totalCells = 42;
|
|
4440
|
+
const emptyCells = month.firstDayOffset;
|
|
4441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react19.default.Fragment, { children: [
|
|
4442
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4443
|
+
"div",
|
|
4444
|
+
{
|
|
4445
|
+
className: (0, import_clsx19.default)("flex flex-col"),
|
|
4446
|
+
children: [
|
|
4447
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
4448
|
+
"div",
|
|
4449
|
+
{
|
|
4450
|
+
className: (0, import_clsx19.default)(
|
|
4451
|
+
"flex flex-row items-center justify-between",
|
|
4452
|
+
typography.label,
|
|
4453
|
+
"text-text-action-primary-normal"
|
|
4454
|
+
),
|
|
4455
|
+
children: [
|
|
4456
|
+
idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4457
|
+
"button",
|
|
4458
|
+
{
|
|
4459
|
+
id: id ? `${id}-prev-month-button` : void 0,
|
|
4460
|
+
"data-testid": testid ? `${testid}-prev-month-button` : void 0,
|
|
4461
|
+
type: "button",
|
|
4462
|
+
className: (0, import_clsx19.default)(
|
|
4463
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
4464
|
+
componentPadding
|
|
4465
|
+
),
|
|
4466
|
+
"aria-label": "Previous month",
|
|
4467
|
+
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
4468
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "chevron_left", size: 24 })
|
|
4469
|
+
}
|
|
4470
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx19.default)(componentPadding, "mr-1") }),
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
|
|
4472
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4473
|
+
"button",
|
|
4474
|
+
{
|
|
4475
|
+
ref: (el) => {
|
|
4476
|
+
monthMenuRef.current = el;
|
|
4477
|
+
},
|
|
4478
|
+
type: "button",
|
|
4479
|
+
onClick: () => {
|
|
4480
|
+
setMonthMenuOpen(true);
|
|
4481
|
+
setYearMenuOpen(false);
|
|
4482
|
+
},
|
|
4483
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
|
|
4484
|
+
children: month.name
|
|
4485
|
+
}
|
|
4486
|
+
),
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4488
|
+
Menu,
|
|
4489
|
+
{
|
|
4490
|
+
show: monthMenuOpen,
|
|
4491
|
+
positionTo: monthMenuRef,
|
|
4492
|
+
setShow: () => setMonthMenuOpen(false),
|
|
4493
|
+
children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4494
|
+
MenuOption,
|
|
4495
|
+
{
|
|
4496
|
+
selected: baseMonth.month === x + 1,
|
|
4497
|
+
onClick: () => {
|
|
4498
|
+
setBaseMonth(baseMonth.with({ month: x + 1 }));
|
|
4499
|
+
setMonthMenuOpen(false);
|
|
4500
|
+
},
|
|
4501
|
+
children: m.name
|
|
4502
|
+
},
|
|
4503
|
+
m.name
|
|
4504
|
+
))
|
|
4505
|
+
}
|
|
4506
|
+
),
|
|
4507
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4508
|
+
"button",
|
|
4509
|
+
{
|
|
4510
|
+
ref: (el) => {
|
|
4511
|
+
yearMenuRef.current = el;
|
|
4512
|
+
},
|
|
4513
|
+
type: "button",
|
|
4514
|
+
onClick: () => {
|
|
4515
|
+
setYearMenuOpen(true);
|
|
4516
|
+
setMonthMenuOpen(false);
|
|
4517
|
+
},
|
|
4518
|
+
className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
|
|
4519
|
+
children: month.year
|
|
4520
|
+
}
|
|
4521
|
+
),
|
|
4522
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4523
|
+
Menu,
|
|
4524
|
+
{
|
|
4525
|
+
show: yearMenuOpen,
|
|
4526
|
+
positionTo: yearMenuRef,
|
|
4527
|
+
setShow: () => setYearMenuOpen(false),
|
|
4528
|
+
children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4529
|
+
MenuOption,
|
|
4530
|
+
{
|
|
4531
|
+
selected: baseMonth.year === y,
|
|
4532
|
+
onClick: () => {
|
|
4533
|
+
setBaseMonth(baseMonth.with({ year: y }));
|
|
4534
|
+
setYearMenuOpen(false);
|
|
4535
|
+
},
|
|
4536
|
+
children: y
|
|
4537
|
+
},
|
|
4538
|
+
y
|
|
4539
|
+
))
|
|
4540
|
+
}
|
|
4541
|
+
)
|
|
4542
|
+
] }),
|
|
4543
|
+
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4544
|
+
"button",
|
|
4545
|
+
{
|
|
4546
|
+
id: id ? `${id}-next-month-button` : void 0,
|
|
4547
|
+
"data-testid": testid ? `${testid}-next-month-button` : void 0,
|
|
4548
|
+
type: "button",
|
|
4549
|
+
className: (0, import_clsx19.default)(
|
|
4550
|
+
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
|
|
4551
|
+
componentPadding
|
|
4552
|
+
),
|
|
4553
|
+
"aria-label": "Next month",
|
|
4554
|
+
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
4555
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon, { name: "chevron_right", size: 24 })
|
|
4556
|
+
}
|
|
4557
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx19.default)(componentPadding, "ml-1") })
|
|
4558
|
+
]
|
|
4559
|
+
}
|
|
4560
|
+
),
|
|
4561
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx19.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4562
|
+
"span",
|
|
4563
|
+
{
|
|
4564
|
+
className: (0, import_clsx19.default)(
|
|
4565
|
+
typography.caption,
|
|
4566
|
+
"text-text-secondary-normal text-center",
|
|
4567
|
+
"w-10"
|
|
4568
|
+
),
|
|
4569
|
+
children: d
|
|
4570
|
+
},
|
|
4571
|
+
d
|
|
4572
|
+
)) }),
|
|
4573
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx19.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
4574
|
+
const day = i - emptyCells + 1;
|
|
4575
|
+
const date = month.date.with({ day: 1 }).add({
|
|
4576
|
+
days: i - emptyCells
|
|
4577
|
+
});
|
|
4578
|
+
const isInMonth = day > 0 && day <= month.days;
|
|
4579
|
+
const isToday = isInMonth && date.equals(today);
|
|
4580
|
+
const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
|
|
4581
|
+
const inRange = isInMonth && isInRange(date);
|
|
4582
|
+
const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
|
|
4583
|
+
const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
|
|
4584
|
+
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
4585
|
+
const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
4586
|
+
const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4588
|
+
DateCell,
|
|
4589
|
+
{
|
|
4590
|
+
id: id ? `${id}-date-${date.toString()}` : void 0,
|
|
4591
|
+
testid: testid ? `${testid}-date-${date.toString()}` : void 0,
|
|
4592
|
+
date,
|
|
4593
|
+
isInMonth: !!isInMonth,
|
|
4594
|
+
isToday: !!isToday,
|
|
4595
|
+
isSelected: !!isSelected,
|
|
4596
|
+
inRange: !!inRange,
|
|
4597
|
+
isDisabled: !!isDisabled,
|
|
4598
|
+
onClick: () => handleDayClick(date),
|
|
4599
|
+
onMouseEnter: () => setHoveredDate(date),
|
|
4600
|
+
onMouseLeave: () => setHoveredDate(void 0),
|
|
4601
|
+
isRangeStart: !!isRangeStart,
|
|
4602
|
+
isRangeEnd: !!isRangeEnd,
|
|
4603
|
+
isRangeDisabled: mode === "single" && disableRange,
|
|
4604
|
+
cellPadding: componentPadding
|
|
4605
|
+
},
|
|
4606
|
+
i
|
|
4607
|
+
);
|
|
4608
|
+
}) })
|
|
4609
|
+
]
|
|
4610
|
+
}
|
|
4611
|
+
),
|
|
4612
|
+
mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
4613
|
+
"div",
|
|
4614
|
+
{
|
|
4615
|
+
className: (0, import_clsx19.default)(
|
|
4616
|
+
"self-stretch bg-border-primary-normal rounded-base",
|
|
4617
|
+
// 1px width, full height, matches Figma divider
|
|
4618
|
+
"w-px"
|
|
4619
|
+
)
|
|
4620
|
+
}
|
|
4621
|
+
)
|
|
4622
|
+
] }, month.name + month.year);
|
|
4623
|
+
}
|
|
4624
|
+
|
|
4625
|
+
// src/components/DateInput.tsx
|
|
4626
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4627
|
+
var DateInput = (_a) => {
|
|
4628
|
+
var _b = _a, {
|
|
4629
|
+
id,
|
|
4630
|
+
testid,
|
|
4631
|
+
value,
|
|
4632
|
+
onChange,
|
|
4633
|
+
placeholder = "MM/DD/YYYY",
|
|
4634
|
+
disabled,
|
|
4635
|
+
readOnly = false,
|
|
4636
|
+
label
|
|
4637
|
+
} = _b, props = __objRest(_b, [
|
|
4638
|
+
"id",
|
|
4639
|
+
"testid",
|
|
4640
|
+
"value",
|
|
4641
|
+
"onChange",
|
|
4642
|
+
"placeholder",
|
|
4643
|
+
"disabled",
|
|
4644
|
+
"readOnly",
|
|
4645
|
+
"label"
|
|
4646
|
+
]);
|
|
4647
|
+
const [visible, setVisible] = (0, import_react20.useState)(false);
|
|
4648
|
+
const [inputValue, setInputValue] = (0, import_react20.useState)("");
|
|
4649
|
+
const [isTyping, setIsTyping] = (0, import_react20.useState)(false);
|
|
4650
|
+
const popoverRef = (0, import_react20.useRef)(null);
|
|
4651
|
+
const triggerRef = (0, import_react20.useRef)(null);
|
|
4652
|
+
const rootRef = (0, import_react20.useRef)(null);
|
|
4653
|
+
const [calendarPosition, setCalendarPosition] = (0, import_react20.useState)({
|
|
4654
|
+
top: 0,
|
|
4655
|
+
left: 0,
|
|
4656
|
+
width: 0
|
|
4657
|
+
});
|
|
4658
|
+
const [from, to] = [value, ""];
|
|
4659
|
+
(0, import_react20.useEffect)(() => {
|
|
4660
|
+
if (!isTyping) {
|
|
4661
|
+
setInputValue(formatDisplayValue(from));
|
|
4662
|
+
}
|
|
4663
|
+
}, [from, isTyping]);
|
|
4664
|
+
(0, import_react20.useLayoutEffect)(() => {
|
|
4665
|
+
if (visible) {
|
|
4666
|
+
updatePosition();
|
|
4667
|
+
}
|
|
4668
|
+
}, [visible]);
|
|
4669
|
+
const updatePosition = () => {
|
|
4670
|
+
if (rootRef.current) {
|
|
4671
|
+
const rect = rootRef.current.getBoundingClientRect();
|
|
4672
|
+
setCalendarPosition({
|
|
4673
|
+
top: rect.bottom + window.scrollY,
|
|
4674
|
+
left: rect.left + window.scrollX,
|
|
4675
|
+
width: rect.width
|
|
4676
|
+
});
|
|
4677
|
+
}
|
|
4678
|
+
};
|
|
4679
|
+
(0, import_react20.useEffect)(() => {
|
|
4680
|
+
updatePosition();
|
|
4681
|
+
const resizeObserver = new ResizeObserver(updatePosition);
|
|
4682
|
+
if (triggerRef.current) {
|
|
4683
|
+
resizeObserver.observe(triggerRef.current);
|
|
4684
|
+
}
|
|
4685
|
+
window.addEventListener("scroll", updatePosition);
|
|
4686
|
+
return () => {
|
|
4687
|
+
resizeObserver.disconnect();
|
|
4688
|
+
window.removeEventListener("scroll", updatePosition);
|
|
4689
|
+
};
|
|
4690
|
+
}, []);
|
|
4691
|
+
(0, import_react20.useEffect)(() => {
|
|
4692
|
+
const handleKeyDown2 = (event) => {
|
|
4693
|
+
var _a2;
|
|
4694
|
+
if (event.key === "Escape" && popoverRef.current) {
|
|
4695
|
+
setVisible(false);
|
|
4696
|
+
(_a2 = triggerRef.current) == null ? void 0 : _a2.blur();
|
|
4697
|
+
}
|
|
4698
|
+
};
|
|
4699
|
+
document.addEventListener("keydown", handleKeyDown2);
|
|
4700
|
+
return () => {
|
|
4701
|
+
document.removeEventListener("keydown", handleKeyDown2);
|
|
4702
|
+
};
|
|
4703
|
+
});
|
|
4704
|
+
(0, import_react20.useEffect)(() => {
|
|
4705
|
+
const handleClickOutside = (event) => {
|
|
4706
|
+
if (popoverRef.current && !popoverRef.current.contains(event.target) && triggerRef.current && !triggerRef.current.contains(event.target)) {
|
|
4707
|
+
setVisible(false);
|
|
4708
|
+
}
|
|
4709
|
+
};
|
|
4710
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
4711
|
+
return () => {
|
|
4712
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
4713
|
+
};
|
|
4714
|
+
}, []);
|
|
4715
|
+
function handleDateChange(fromValue) {
|
|
4716
|
+
onChange(fromValue);
|
|
4717
|
+
setVisible(false);
|
|
4718
|
+
setIsTyping(false);
|
|
4719
|
+
}
|
|
4720
|
+
const handleFocus = () => {
|
|
4721
|
+
if (readOnly) return;
|
|
4722
|
+
setVisible(true);
|
|
4723
|
+
};
|
|
4724
|
+
const handleClick = () => {
|
|
4725
|
+
handleFocus();
|
|
4726
|
+
};
|
|
4727
|
+
const handleInputChange = (event) => {
|
|
4728
|
+
if (readOnly) return;
|
|
4729
|
+
const rawValue = event.target.value;
|
|
4730
|
+
const cursorPosition = event.target.selectionStart || 0;
|
|
4731
|
+
setIsTyping(true);
|
|
4732
|
+
const formattedValue = formatInputValue(rawValue);
|
|
4733
|
+
setInputValue(formattedValue);
|
|
4734
|
+
requestAnimationFrame(() => {
|
|
4735
|
+
if (triggerRef.current) {
|
|
4736
|
+
const newPosition = calculateCursorPosition(
|
|
4737
|
+
rawValue,
|
|
4738
|
+
formattedValue,
|
|
4739
|
+
cursorPosition
|
|
4740
|
+
);
|
|
4741
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4742
|
+
}
|
|
4743
|
+
});
|
|
4744
|
+
const parsedDate = parseInputDate(formattedValue);
|
|
4745
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
4746
|
+
onChange(parsedDate);
|
|
4747
|
+
}
|
|
4748
|
+
};
|
|
4749
|
+
const handleBlur = () => {
|
|
4750
|
+
setIsTyping(false);
|
|
4751
|
+
const parsedDate = parseInputDate(inputValue);
|
|
4752
|
+
if (!parsedDate || !isValidDate(parsedDate)) {
|
|
4753
|
+
setInputValue(formatDisplayValue(from));
|
|
4754
|
+
}
|
|
4755
|
+
};
|
|
4756
|
+
const handleKeyDown = (event) => {
|
|
4757
|
+
if (event.key === "Backspace") {
|
|
4758
|
+
const input = event.target;
|
|
4759
|
+
const cursorPosition = input.selectionStart || 0;
|
|
4760
|
+
const value2 = input.value;
|
|
4761
|
+
if (cursorPosition > 0 && value2[cursorPosition - 1] === "/") {
|
|
4762
|
+
event.preventDefault();
|
|
4763
|
+
const newValue = value2.slice(0, cursorPosition - 2) + value2.slice(cursorPosition);
|
|
4764
|
+
const formattedValue = formatInputValue(newValue);
|
|
4765
|
+
setInputValue(formattedValue);
|
|
4766
|
+
requestAnimationFrame(() => {
|
|
4767
|
+
if (triggerRef.current) {
|
|
4768
|
+
const newPosition = Math.max(0, cursorPosition - 2);
|
|
4769
|
+
triggerRef.current.setSelectionRange(newPosition, newPosition);
|
|
4770
|
+
}
|
|
4771
|
+
});
|
|
4772
|
+
setIsTyping(true);
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4775
|
+
}
|
|
4776
|
+
if (event.key === "Enter") {
|
|
4777
|
+
const parsedDate = parseInputDate(inputValue);
|
|
4778
|
+
if (parsedDate && isValidDate(parsedDate)) {
|
|
4779
|
+
onChange(parsedDate);
|
|
4780
|
+
setVisible(false);
|
|
4781
|
+
setIsTyping(false);
|
|
4782
|
+
}
|
|
4783
|
+
}
|
|
4784
|
+
};
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "relative", children: [
|
|
4786
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4787
|
+
InputBase,
|
|
4788
|
+
__spreadProps(__spreadValues({
|
|
4789
|
+
id,
|
|
4790
|
+
testid,
|
|
4791
|
+
ref: (el) => {
|
|
4792
|
+
triggerRef.current = el;
|
|
4793
|
+
}
|
|
4794
|
+
}, props), {
|
|
4795
|
+
wrapperRef: rootRef,
|
|
4796
|
+
value: inputValue,
|
|
4797
|
+
placeholder,
|
|
4798
|
+
disabled,
|
|
4799
|
+
readOnly,
|
|
4800
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { name: "calendar_month" }),
|
|
4801
|
+
onFocus: handleFocus,
|
|
4802
|
+
onClick: handleClick,
|
|
4803
|
+
onChange: handleInputChange,
|
|
4804
|
+
onBlur: handleBlur,
|
|
4805
|
+
onKeyDown: handleKeyDown,
|
|
4806
|
+
label,
|
|
4807
|
+
secondaryIconColor: true
|
|
4808
|
+
})
|
|
4809
|
+
),
|
|
4810
|
+
visible && !readOnly && (0, import_react_dom3.createPortal)(
|
|
4811
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4812
|
+
"div",
|
|
4813
|
+
{
|
|
4814
|
+
ref: (el) => {
|
|
4815
|
+
popoverRef.current = el;
|
|
4816
|
+
},
|
|
4817
|
+
className: "absolute z-40 bg-white",
|
|
4818
|
+
style: {
|
|
4819
|
+
top: `${calendarPosition.top + 4}px`,
|
|
4820
|
+
left: `${calendarPosition.left}px`,
|
|
4821
|
+
minWidth: `${calendarPosition.width}px`
|
|
4822
|
+
},
|
|
4823
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
4824
|
+
CalendarRange,
|
|
4825
|
+
{
|
|
4826
|
+
id: id ? `${id}-calendar` : void 0,
|
|
4827
|
+
testid: testid ? `${testid}-calendar` : void 0,
|
|
4828
|
+
from,
|
|
4829
|
+
to: to || from,
|
|
4830
|
+
onChange: handleDateChange,
|
|
4831
|
+
cardStyle: true,
|
|
4832
|
+
mode: "single",
|
|
4833
|
+
disableRange: true
|
|
4834
|
+
}
|
|
4835
|
+
)
|
|
4836
|
+
}
|
|
4837
|
+
),
|
|
4838
|
+
findDocumentRoot(popoverRef.current)
|
|
4839
|
+
)
|
|
4840
|
+
] });
|
|
4841
|
+
};
|
|
4842
|
+
DateInput.displayName = "DateInput";
|
|
4843
|
+
function formatDisplayValue(from) {
|
|
4844
|
+
if (!from) {
|
|
4845
|
+
return "";
|
|
4846
|
+
}
|
|
4847
|
+
if (!isValidDate(from)) {
|
|
4848
|
+
return "";
|
|
4849
|
+
}
|
|
4850
|
+
return formatDate(from);
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4853
|
+
// src/components/Accordion.tsx
|
|
4854
|
+
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
4855
|
+
|
|
4856
|
+
// src/components/Card.tsx
|
|
4857
|
+
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
4858
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4092
4859
|
function Card(props) {
|
|
4093
4860
|
const _a = props, {
|
|
4094
4861
|
children,
|
|
@@ -4115,7 +4882,7 @@ function Card(props) {
|
|
|
4115
4882
|
]);
|
|
4116
4883
|
const CardComponent = props.as || "div";
|
|
4117
4884
|
const anyPaddingPropSpecified = padding !== void 0 || paddingX !== void 0 || paddingY !== void 0 || paddingBottom !== void 0 || paddingTop !== void 0 || paddingLeft !== void 0 || paddingRight !== void 0;
|
|
4118
|
-
const paddingClasses = (0,
|
|
4885
|
+
const paddingClasses = (0, import_clsx20.default)(
|
|
4119
4886
|
// Backward compatibility: if no new padding props provided keep existing class.
|
|
4120
4887
|
!anyPaddingPropSpecified && "p-desktop-layout-padding",
|
|
4121
4888
|
// New responsive spacing tokens (mirrors Stack for layout sizing)
|
|
@@ -4127,11 +4894,11 @@ function Card(props) {
|
|
|
4127
4894
|
paddingLeft && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
4128
4895
|
paddingRight && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding"
|
|
4129
4896
|
);
|
|
4130
|
-
return /* @__PURE__ */ (0,
|
|
4897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
4131
4898
|
CardComponent,
|
|
4132
4899
|
__spreadProps(__spreadValues({}, rest), {
|
|
4133
4900
|
"data-testid": testid,
|
|
4134
|
-
className: (0,
|
|
4901
|
+
className: (0, import_clsx20.default)(
|
|
4135
4902
|
"rounded-sm",
|
|
4136
4903
|
paddingClasses,
|
|
4137
4904
|
selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
|
|
@@ -4143,9 +4910,9 @@ function Card(props) {
|
|
|
4143
4910
|
}
|
|
4144
4911
|
|
|
4145
4912
|
// src/components/Stack.tsx
|
|
4146
|
-
var
|
|
4147
|
-
var
|
|
4148
|
-
var getFlexClassNames = ({ items, justify, grow }) => (0,
|
|
4913
|
+
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
4914
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4915
|
+
var getFlexClassNames = ({ items, justify, grow }) => (0, import_clsx21.default)(
|
|
4149
4916
|
"flex",
|
|
4150
4917
|
items === "start" && "items-start",
|
|
4151
4918
|
grow && "grow",
|
|
@@ -4161,7 +4928,7 @@ var getFlexClassNames = ({ items, justify, grow }) => (0, import_clsx20.default)
|
|
|
4161
4928
|
justify === "around" && "justify-around"
|
|
4162
4929
|
);
|
|
4163
4930
|
var useGapClassNames = (sizing) => {
|
|
4164
|
-
return (0,
|
|
4931
|
+
return (0, import_clsx21.default)(
|
|
4165
4932
|
sizing === "layout-group" && "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
|
|
4166
4933
|
sizing === "layout" && "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-compact-layout-gap",
|
|
4167
4934
|
sizing === "container" && "gap-mobile-container-gap desktop:gap-desktop-container-gap compact:gap-compact-container-gap",
|
|
@@ -4269,7 +5036,7 @@ var Stack = (_a) => {
|
|
|
4269
5036
|
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
4270
5037
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
4271
5038
|
const gapClassNames = useGapClassNames(sizing);
|
|
4272
|
-
return /* @__PURE__ */ (0,
|
|
5039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4273
5040
|
"div",
|
|
4274
5041
|
__spreadProps(__spreadValues({
|
|
4275
5042
|
id,
|
|
@@ -4301,7 +5068,7 @@ var Stack = (_a) => {
|
|
|
4301
5068
|
paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
|
|
4302
5069
|
gap: (_g = props.style) == null ? void 0 : _g.gap
|
|
4303
5070
|
},
|
|
4304
|
-
className: (0,
|
|
5071
|
+
className: (0, import_clsx21.default)(
|
|
4305
5072
|
"scrollbar-thin",
|
|
4306
5073
|
"max-w-screen",
|
|
4307
5074
|
width !== "fit" && "w-full",
|
|
@@ -4363,7 +5130,7 @@ var Stack = (_a) => {
|
|
|
4363
5130
|
};
|
|
4364
5131
|
|
|
4365
5132
|
// src/components/Accordion.tsx
|
|
4366
|
-
var
|
|
5133
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4367
5134
|
function Accordion(props) {
|
|
4368
5135
|
const {
|
|
4369
5136
|
isOpen,
|
|
@@ -4376,11 +5143,11 @@ function Accordion(props) {
|
|
|
4376
5143
|
const {
|
|
4377
5144
|
title,
|
|
4378
5145
|
before,
|
|
4379
|
-
after = /* @__PURE__ */ (0,
|
|
5146
|
+
after = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4380
5147
|
Icon,
|
|
4381
5148
|
{
|
|
4382
5149
|
name: "expand_more",
|
|
4383
|
-
className: (0,
|
|
5150
|
+
className: (0, import_clsx22.default)(
|
|
4384
5151
|
"text-icon-primary-normal transform transition-all duration-300 ease-in-out",
|
|
4385
5152
|
isOpen ? "rotate-180" : "rotate-0"
|
|
4386
5153
|
)
|
|
@@ -4393,10 +5160,10 @@ function Accordion(props) {
|
|
|
4393
5160
|
e.preventDefault();
|
|
4394
5161
|
onClick == null ? void 0 : onClick();
|
|
4395
5162
|
}
|
|
4396
|
-
return /* @__PURE__ */ (0,
|
|
5163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4397
5164
|
Card,
|
|
4398
5165
|
{
|
|
4399
|
-
className: (0,
|
|
5166
|
+
className: (0, import_clsx22.default)(
|
|
4400
5167
|
"overflow-hidden select-none",
|
|
4401
5168
|
{ "cursor-pointer": !disabled },
|
|
4402
5169
|
className
|
|
@@ -4405,7 +5172,7 @@ function Accordion(props) {
|
|
|
4405
5172
|
onClick: handleClick,
|
|
4406
5173
|
testid,
|
|
4407
5174
|
children: [
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
5175
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
4409
5176
|
Stack,
|
|
4410
5177
|
{
|
|
4411
5178
|
sizing: "component",
|
|
@@ -4414,9 +5181,9 @@ function Accordion(props) {
|
|
|
4414
5181
|
justify: "between",
|
|
4415
5182
|
items: "center",
|
|
4416
5183
|
children: [
|
|
4417
|
-
/* @__PURE__ */ (0,
|
|
5184
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Stack, { sizing: "layout-group", horizontal: true, items: titleAlign, children: [
|
|
4418
5185
|
before,
|
|
4419
|
-
typeof title === "string" ? /* @__PURE__ */ (0,
|
|
5186
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4420
5187
|
Paragraph,
|
|
4421
5188
|
{
|
|
4422
5189
|
testid: testid ? `${testid}-title` : void 0,
|
|
@@ -4429,18 +5196,18 @@ function Accordion(props) {
|
|
|
4429
5196
|
]
|
|
4430
5197
|
}
|
|
4431
5198
|
),
|
|
4432
|
-
/* @__PURE__ */ (0,
|
|
5199
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4433
5200
|
"div",
|
|
4434
5201
|
{
|
|
4435
|
-
className: (0,
|
|
5202
|
+
className: (0, import_clsx22.default)("grid transition-all duration-300 ease-in-out"),
|
|
4436
5203
|
style: {
|
|
4437
5204
|
gridTemplateRows: isOpen ? "1fr" : "0fr"
|
|
4438
5205
|
},
|
|
4439
5206
|
"data-testid": testid ? `${testid}-content-container` : void 0,
|
|
4440
|
-
children: /* @__PURE__ */ (0,
|
|
5207
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4441
5208
|
"div",
|
|
4442
5209
|
{
|
|
4443
|
-
className: (0,
|
|
5210
|
+
className: (0, import_clsx22.default)(
|
|
4444
5211
|
typography.paragraph,
|
|
4445
5212
|
"text-text-primary-normal desktop:pt-desktop-layout-gap",
|
|
4446
5213
|
"flex flex-col gap-desktop-layout-gap"
|
|
@@ -4457,8 +5224,8 @@ function Accordion(props) {
|
|
|
4457
5224
|
}
|
|
4458
5225
|
|
|
4459
5226
|
// src/components/Heading.tsx
|
|
4460
|
-
var
|
|
4461
|
-
var
|
|
5227
|
+
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
5228
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4462
5229
|
var Heading = (_a) => {
|
|
4463
5230
|
var _b = _a, {
|
|
4464
5231
|
className,
|
|
@@ -4481,12 +5248,12 @@ var Heading = (_a) => {
|
|
|
4481
5248
|
]);
|
|
4482
5249
|
const defaultElement = variant === "heading1" ? "h1" : variant === "heading2" ? "h2" : "h3";
|
|
4483
5250
|
const Element = as != null ? as : defaultElement;
|
|
4484
|
-
return /* @__PURE__ */ (0,
|
|
5251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4485
5252
|
Element,
|
|
4486
5253
|
__spreadProps(__spreadValues({
|
|
4487
5254
|
id,
|
|
4488
5255
|
"data-testid": testid,
|
|
4489
|
-
className: (0,
|
|
5256
|
+
className: (0, import_clsx23.default)(
|
|
4490
5257
|
typography[variant],
|
|
4491
5258
|
className,
|
|
4492
5259
|
align === "left" && "text-left",
|
|
@@ -4502,15 +5269,15 @@ var Heading = (_a) => {
|
|
|
4502
5269
|
);
|
|
4503
5270
|
};
|
|
4504
5271
|
Heading.displayName = "Heading";
|
|
4505
|
-
var Heading1 = (props) => /* @__PURE__ */ (0,
|
|
4506
|
-
var Heading2 = (props) => /* @__PURE__ */ (0,
|
|
4507
|
-
var Heading3 = (props) => /* @__PURE__ */ (0,
|
|
5272
|
+
var Heading1 = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading1" }));
|
|
5273
|
+
var Heading2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading2" }));
|
|
5274
|
+
var Heading3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, __spreadProps(__spreadValues({}, props), { variant: "heading3" }));
|
|
4508
5275
|
Heading1.displayName = "Heading1";
|
|
4509
5276
|
Heading2.displayName = "Heading2";
|
|
4510
5277
|
Heading3.displayName = "Heading3";
|
|
4511
5278
|
|
|
4512
5279
|
// src/components/Theme.tsx
|
|
4513
|
-
var
|
|
5280
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4514
5281
|
function Theme({
|
|
4515
5282
|
theme,
|
|
4516
5283
|
children,
|
|
@@ -4518,7 +5285,7 @@ function Theme({
|
|
|
4518
5285
|
testid,
|
|
4519
5286
|
ref
|
|
4520
5287
|
}) {
|
|
4521
|
-
return /* @__PURE__ */ (0,
|
|
5288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4522
5289
|
"div",
|
|
4523
5290
|
{
|
|
4524
5291
|
id,
|
|
@@ -4534,18 +5301,18 @@ function Theme({
|
|
|
4534
5301
|
}
|
|
4535
5302
|
|
|
4536
5303
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4537
|
-
var
|
|
5304
|
+
var import_react23 = require("react");
|
|
4538
5305
|
|
|
4539
5306
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4540
|
-
var
|
|
5307
|
+
var import_react22 = require("react");
|
|
4541
5308
|
|
|
4542
5309
|
// src/components/MobileDataGrid/GridContextProvider/GridContext.tsx
|
|
4543
|
-
var
|
|
4544
|
-
var GridContext = (0,
|
|
5310
|
+
var import_react21 = require("react");
|
|
5311
|
+
var GridContext = (0, import_react21.createContext)(null);
|
|
4545
5312
|
|
|
4546
5313
|
// src/components/MobileDataGrid/GridContextProvider/useGridContext.ts
|
|
4547
5314
|
function useGridContext() {
|
|
4548
|
-
const ctx = (0,
|
|
5315
|
+
const ctx = (0, import_react22.useContext)(GridContext);
|
|
4549
5316
|
if (!ctx) {
|
|
4550
5317
|
throw new Error("useGridContext must be used within GridContextProvider");
|
|
4551
5318
|
}
|
|
@@ -4553,11 +5320,11 @@ function useGridContext() {
|
|
|
4553
5320
|
}
|
|
4554
5321
|
|
|
4555
5322
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
4556
|
-
var
|
|
5323
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4557
5324
|
function ColumnSelector() {
|
|
4558
5325
|
const context = useGridContext();
|
|
4559
|
-
const ref = (0,
|
|
4560
|
-
const [show, setShow] = (0,
|
|
5326
|
+
const ref = (0, import_react23.useRef)(null);
|
|
5327
|
+
const [show, setShow] = (0, import_react23.useState)(false);
|
|
4561
5328
|
const {
|
|
4562
5329
|
columns,
|
|
4563
5330
|
id,
|
|
@@ -4568,13 +5335,13 @@ function ColumnSelector() {
|
|
|
4568
5335
|
resetColumnVisibility,
|
|
4569
5336
|
dispatch
|
|
4570
5337
|
} = context;
|
|
4571
|
-
const toggleColumnVisibility = (0,
|
|
5338
|
+
const toggleColumnVisibility = (0, import_react23.useCallback)(
|
|
4572
5339
|
(index, visible) => {
|
|
4573
5340
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
4574
5341
|
},
|
|
4575
5342
|
[dispatch]
|
|
4576
5343
|
);
|
|
4577
|
-
return /* @__PURE__ */ (0,
|
|
5344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4578
5345
|
"div",
|
|
4579
5346
|
{
|
|
4580
5347
|
id: id ? `${id}-column-selector` : void 0,
|
|
@@ -4582,7 +5349,7 @@ function ColumnSelector() {
|
|
|
4582
5349
|
className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
|
|
4583
5350
|
ref,
|
|
4584
5351
|
children: [
|
|
4585
|
-
/* @__PURE__ */ (0,
|
|
5352
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4586
5353
|
Button,
|
|
4587
5354
|
{
|
|
4588
5355
|
id: id ? `${id}-button` : void 0,
|
|
@@ -4591,10 +5358,10 @@ function ColumnSelector() {
|
|
|
4591
5358
|
variant: "navigation",
|
|
4592
5359
|
iconOnly: true,
|
|
4593
5360
|
size: 24,
|
|
4594
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5361
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon, { name: "tune" })
|
|
4595
5362
|
}
|
|
4596
5363
|
),
|
|
4597
|
-
/* @__PURE__ */ (0,
|
|
5364
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4598
5365
|
Menu,
|
|
4599
5366
|
{
|
|
4600
5367
|
id: id ? `${id}-menu` : void 0,
|
|
@@ -4605,7 +5372,7 @@ function ColumnSelector() {
|
|
|
4605
5372
|
setShow,
|
|
4606
5373
|
calculateMinMaxHeight: true,
|
|
4607
5374
|
children: [
|
|
4608
|
-
/* @__PURE__ */ (0,
|
|
5375
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4609
5376
|
Button,
|
|
4610
5377
|
{
|
|
4611
5378
|
id: id ? `${id}-reset-button` : void 0,
|
|
@@ -4623,11 +5390,11 @@ function ColumnSelector() {
|
|
|
4623
5390
|
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
4624
5391
|
}).map((column) => {
|
|
4625
5392
|
var _a, _b, _c;
|
|
4626
|
-
return /* @__PURE__ */ (0,
|
|
5393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4627
5394
|
MenuOption,
|
|
4628
5395
|
{
|
|
4629
5396
|
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
4630
|
-
children: /* @__PURE__ */ (0,
|
|
5397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4631
5398
|
Checkbox,
|
|
4632
5399
|
{
|
|
4633
5400
|
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
@@ -4657,7 +5424,7 @@ function ColumnSelector() {
|
|
|
4657
5424
|
}
|
|
4658
5425
|
|
|
4659
5426
|
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
4660
|
-
var
|
|
5427
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4661
5428
|
function MobileDataGridHeader({
|
|
4662
5429
|
header: Header,
|
|
4663
5430
|
enableColumnSelector,
|
|
@@ -4675,15 +5442,15 @@ function MobileDataGridHeader({
|
|
|
4675
5442
|
handleRowSelectAll
|
|
4676
5443
|
} = ctx;
|
|
4677
5444
|
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
4678
|
-
if (typeof Header === "function") return /* @__PURE__ */ (0,
|
|
5445
|
+
if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Header, __spreadValues({}, ctx));
|
|
4679
5446
|
if (typeof Header === "string" || primaryKey)
|
|
4680
|
-
return /* @__PURE__ */ (0,
|
|
5447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4681
5448
|
"div",
|
|
4682
5449
|
{
|
|
4683
5450
|
id: id ? `${id}-header` : void 0,
|
|
4684
5451
|
"data-testid": testid ? `${testid}-header` : void 0,
|
|
4685
5452
|
className: "sticky top-0",
|
|
4686
|
-
children: /* @__PURE__ */ (0,
|
|
5453
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4687
5454
|
Stack,
|
|
4688
5455
|
{
|
|
4689
5456
|
horizontal: true,
|
|
@@ -4692,7 +5459,7 @@ function MobileDataGridHeader({
|
|
|
4692
5459
|
justify: "between",
|
|
4693
5460
|
backgroundColor: "background-primary-normal",
|
|
4694
5461
|
children: [
|
|
4695
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
5462
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4696
5463
|
Checkbox,
|
|
4697
5464
|
{
|
|
4698
5465
|
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
@@ -4702,7 +5469,7 @@ function MobileDataGridHeader({
|
|
|
4702
5469
|
onChange: handleRowSelectAll
|
|
4703
5470
|
}
|
|
4704
5471
|
) }),
|
|
4705
|
-
/* @__PURE__ */ (0,
|
|
5472
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4706
5473
|
Stack,
|
|
4707
5474
|
{
|
|
4708
5475
|
horizontal: true,
|
|
@@ -4710,10 +5477,10 @@ function MobileDataGridHeader({
|
|
|
4710
5477
|
items: "center",
|
|
4711
5478
|
sizing: "component",
|
|
4712
5479
|
padding: true,
|
|
4713
|
-
children: /* @__PURE__ */ (0,
|
|
5480
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
|
|
4714
5481
|
}
|
|
4715
5482
|
),
|
|
4716
|
-
enableColumnSelector && /* @__PURE__ */ (0,
|
|
5483
|
+
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ColumnSelector, {})
|
|
4717
5484
|
]
|
|
4718
5485
|
}
|
|
4719
5486
|
) })
|
|
@@ -4722,7 +5489,7 @@ function MobileDataGridHeader({
|
|
|
4722
5489
|
}
|
|
4723
5490
|
|
|
4724
5491
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4725
|
-
var
|
|
5492
|
+
var import_react24 = require("react");
|
|
4726
5493
|
|
|
4727
5494
|
// src/components/MobileDataGrid/dataGridReducer.ts
|
|
4728
5495
|
function dataGridReducer(state, action) {
|
|
@@ -4752,7 +5519,7 @@ function dataGridReducer(state, action) {
|
|
|
4752
5519
|
}
|
|
4753
5520
|
|
|
4754
5521
|
// src/components/MobileDataGrid/GridContextProvider/index.tsx
|
|
4755
|
-
var
|
|
5522
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4756
5523
|
function GridContextProvider(props) {
|
|
4757
5524
|
const {
|
|
4758
5525
|
initialColumns,
|
|
@@ -4765,10 +5532,10 @@ function GridContextProvider(props) {
|
|
|
4765
5532
|
getId,
|
|
4766
5533
|
onRowSelect
|
|
4767
5534
|
} = props;
|
|
4768
|
-
const [columns, dispatch] = (0,
|
|
4769
|
-
const [selectedRowIds, setSelectedRowIds] = (0,
|
|
4770
|
-
const [currentRow, setCurrentRow] = (0,
|
|
4771
|
-
const resetColumnVisibility = (0,
|
|
5535
|
+
const [columns, dispatch] = (0, import_react24.useReducer)(dataGridReducer, initialColumns);
|
|
5536
|
+
const [selectedRowIds, setSelectedRowIds] = (0, import_react24.useState)([]);
|
|
5537
|
+
const [currentRow, setCurrentRow] = (0, import_react24.useState)(null);
|
|
5538
|
+
const resetColumnVisibility = (0, import_react24.useCallback)(() => {
|
|
4772
5539
|
const newColumns = columns.map((column) => {
|
|
4773
5540
|
var _a;
|
|
4774
5541
|
const initialColumn = initialColumns.find((c) => c.id === column.id);
|
|
@@ -4780,7 +5547,7 @@ function GridContextProvider(props) {
|
|
|
4780
5547
|
});
|
|
4781
5548
|
dispatch({ type: "SET", payload: newColumns });
|
|
4782
5549
|
}, [columns, initialColumns]);
|
|
4783
|
-
const handleRowSelect = (0,
|
|
5550
|
+
const handleRowSelect = (0, import_react24.useCallback)(
|
|
4784
5551
|
(item) => {
|
|
4785
5552
|
var _a;
|
|
4786
5553
|
const rowId = (_a = getId(item)) != null ? _a : "";
|
|
@@ -4791,7 +5558,7 @@ function GridContextProvider(props) {
|
|
|
4791
5558
|
},
|
|
4792
5559
|
[getId, onRowSelect, selectedRowIds]
|
|
4793
5560
|
);
|
|
4794
|
-
const handleRowSelectAll = (0,
|
|
5561
|
+
const handleRowSelectAll = (0, import_react24.useCallback)(() => {
|
|
4795
5562
|
setSelectedRowIds((prev) => {
|
|
4796
5563
|
if (prev.length === data.length) {
|
|
4797
5564
|
return [];
|
|
@@ -4799,13 +5566,13 @@ function GridContextProvider(props) {
|
|
|
4799
5566
|
return data.map(getId).filter((id2) => id2 !== void 0);
|
|
4800
5567
|
});
|
|
4801
5568
|
}, [data, getId]);
|
|
4802
|
-
const openRowDetail = (0,
|
|
5569
|
+
const openRowDetail = (0, import_react24.useCallback)((row) => {
|
|
4803
5570
|
setCurrentRow(row);
|
|
4804
5571
|
}, []);
|
|
4805
|
-
const closeRowDetail = (0,
|
|
5572
|
+
const closeRowDetail = (0, import_react24.useCallback)(() => {
|
|
4806
5573
|
setCurrentRow(null);
|
|
4807
5574
|
}, []);
|
|
4808
|
-
const visibleColumns = (0,
|
|
5575
|
+
const visibleColumns = (0, import_react24.useMemo)(() => {
|
|
4809
5576
|
const effectiveLimit = typeof numberOfColumnsToShow === "number" ? Math.max(numberOfColumnsToShow - 1, 0) : void 0;
|
|
4810
5577
|
if (primaryKey) {
|
|
4811
5578
|
const pkColumn = columns.find((col) => col.id === String(primaryKey));
|
|
@@ -4823,7 +5590,7 @@ function GridContextProvider(props) {
|
|
|
4823
5590
|
return ((_a = x.meta) == null ? void 0 : _a.visible) !== false;
|
|
4824
5591
|
}).slice(0, effectiveLimit);
|
|
4825
5592
|
}, [columns, numberOfColumnsToShow, primaryKey]);
|
|
4826
|
-
return /* @__PURE__ */ (0,
|
|
5593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4827
5594
|
GridContext.Provider,
|
|
4828
5595
|
{
|
|
4829
5596
|
value: {
|
|
@@ -4851,12 +5618,12 @@ function GridContextProvider(props) {
|
|
|
4851
5618
|
}
|
|
4852
5619
|
|
|
4853
5620
|
// src/components/Modal.tsx
|
|
4854
|
-
var
|
|
4855
|
-
var
|
|
5621
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
5622
|
+
var import_react26 = require("react");
|
|
4856
5623
|
|
|
4857
5624
|
// src/components/ModalHeader.tsx
|
|
4858
|
-
var
|
|
4859
|
-
var
|
|
5625
|
+
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
5626
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4860
5627
|
var ModalHeader = ({
|
|
4861
5628
|
title,
|
|
4862
5629
|
hideCloseIcon,
|
|
@@ -4867,12 +5634,12 @@ var ModalHeader = ({
|
|
|
4867
5634
|
testid,
|
|
4868
5635
|
headerClassname
|
|
4869
5636
|
}) => {
|
|
4870
|
-
return /* @__PURE__ */ (0,
|
|
5637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4871
5638
|
"div",
|
|
4872
5639
|
{
|
|
4873
5640
|
id,
|
|
4874
5641
|
"data-testid": testid,
|
|
4875
|
-
className: (0,
|
|
5642
|
+
className: (0, import_clsx24.default)(
|
|
4876
5643
|
"flex justify-between items-center",
|
|
4877
5644
|
headerIconAlign === "center" && "justify-center",
|
|
4878
5645
|
headerIconAlign === "right" && "justify-end",
|
|
@@ -4882,9 +5649,9 @@ var ModalHeader = ({
|
|
|
4882
5649
|
headerClassname
|
|
4883
5650
|
),
|
|
4884
5651
|
children: [
|
|
4885
|
-
/* @__PURE__ */ (0,
|
|
5652
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0, import_clsx24.default)("flex items-center flex-1", layoutGroupGap), children: [
|
|
4886
5653
|
headerIcon,
|
|
4887
|
-
title && /* @__PURE__ */ (0,
|
|
5654
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4888
5655
|
Heading2,
|
|
4889
5656
|
{
|
|
4890
5657
|
id: id ? `${id}-title` : void 0,
|
|
@@ -4894,7 +5661,7 @@ var ModalHeader = ({
|
|
|
4894
5661
|
}
|
|
4895
5662
|
)
|
|
4896
5663
|
] }),
|
|
4897
|
-
!hideCloseIcon && /* @__PURE__ */ (0,
|
|
5664
|
+
!hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4898
5665
|
Button,
|
|
4899
5666
|
{
|
|
4900
5667
|
id: id ? `${id}-close-button` : void 0,
|
|
@@ -4902,7 +5669,7 @@ var ModalHeader = ({
|
|
|
4902
5669
|
iconOnly: true,
|
|
4903
5670
|
variant: "tertiary",
|
|
4904
5671
|
onClick: onClose,
|
|
4905
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5672
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-brand-text-action-primary-normal desktop:text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { name: "close", size: 24 }) })
|
|
4906
5673
|
}
|
|
4907
5674
|
)
|
|
4908
5675
|
]
|
|
@@ -4912,20 +5679,20 @@ var ModalHeader = ({
|
|
|
4912
5679
|
ModalHeader.displayName = "ModalHeader";
|
|
4913
5680
|
|
|
4914
5681
|
// src/components/ModalContent.tsx
|
|
4915
|
-
var
|
|
4916
|
-
var
|
|
5682
|
+
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
5683
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4917
5684
|
function ModalContent({
|
|
4918
5685
|
fixedHeightScrolling,
|
|
4919
5686
|
children,
|
|
4920
5687
|
id,
|
|
4921
5688
|
testid
|
|
4922
5689
|
}) {
|
|
4923
|
-
return /* @__PURE__ */ (0,
|
|
5690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4924
5691
|
"div",
|
|
4925
5692
|
{
|
|
4926
5693
|
id,
|
|
4927
5694
|
"data-testid": testid,
|
|
4928
|
-
className: (0,
|
|
5695
|
+
className: (0, import_clsx25.default)(
|
|
4929
5696
|
"flex-grow desktop:flex-grow-0",
|
|
4930
5697
|
layoutPaddding,
|
|
4931
5698
|
fixedHeightScrolling && "overflow-auto"
|
|
@@ -4937,8 +5704,8 @@ function ModalContent({
|
|
|
4937
5704
|
ModalContent.displayName = "ModalContent";
|
|
4938
5705
|
|
|
4939
5706
|
// src/components/ModalButtons.tsx
|
|
4940
|
-
var
|
|
4941
|
-
var
|
|
5707
|
+
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
5708
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4942
5709
|
var ModalButtons = ({
|
|
4943
5710
|
onClose,
|
|
4944
5711
|
onContinue,
|
|
@@ -4946,36 +5713,36 @@ var ModalButtons = ({
|
|
|
4946
5713
|
id,
|
|
4947
5714
|
testid
|
|
4948
5715
|
}) => {
|
|
4949
|
-
return /* @__PURE__ */ (0,
|
|
5716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4950
5717
|
"div",
|
|
4951
5718
|
{
|
|
4952
5719
|
id,
|
|
4953
5720
|
"data-testid": testid,
|
|
4954
|
-
className: (0,
|
|
5721
|
+
className: (0, import_clsx26.default)(
|
|
4955
5722
|
"border-t border-neutral-300 flex justify-end",
|
|
4956
5723
|
layoutPaddding,
|
|
4957
5724
|
layoutGroupGap
|
|
4958
5725
|
),
|
|
4959
|
-
children: customActions != null ? customActions : /* @__PURE__ */ (0,
|
|
4960
|
-
/* @__PURE__ */ (0,
|
|
5726
|
+
children: customActions != null ? customActions : /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
5727
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4961
5728
|
Button,
|
|
4962
5729
|
{
|
|
4963
5730
|
id: id ? `${id}-close-button` : void 0,
|
|
4964
5731
|
testid: testid ? `${testid}-close-button` : void 0,
|
|
4965
5732
|
variant: "secondary",
|
|
4966
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5733
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "close", size: 24 }),
|
|
4967
5734
|
onClick: onClose,
|
|
4968
5735
|
className: "max-sm:w-full",
|
|
4969
5736
|
children: "Close"
|
|
4970
5737
|
}
|
|
4971
5738
|
),
|
|
4972
|
-
/* @__PURE__ */ (0,
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4973
5740
|
Button,
|
|
4974
5741
|
{
|
|
4975
5742
|
id: id ? `${id}-continue-button` : void 0,
|
|
4976
5743
|
testid: testid ? `${testid}-continue-button` : void 0,
|
|
4977
5744
|
variant: "primary",
|
|
4978
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5745
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { name: "check", size: 24 }),
|
|
4979
5746
|
className: "max-sm:w-full",
|
|
4980
5747
|
onClick: onContinue,
|
|
4981
5748
|
children: "Continue"
|
|
@@ -4988,8 +5755,8 @@ var ModalButtons = ({
|
|
|
4988
5755
|
ModalButtons.displayName = "ModalButtons";
|
|
4989
5756
|
|
|
4990
5757
|
// src/components/ModalScrim.tsx
|
|
4991
|
-
var
|
|
4992
|
-
var
|
|
5758
|
+
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
5759
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4993
5760
|
var ModalScrim = ({
|
|
4994
5761
|
show = false,
|
|
4995
5762
|
size = "small",
|
|
@@ -4999,12 +5766,12 @@ var ModalScrim = ({
|
|
|
4999
5766
|
id,
|
|
5000
5767
|
testid
|
|
5001
5768
|
}) => {
|
|
5002
|
-
return /* @__PURE__ */ (0,
|
|
5769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5003
5770
|
"div",
|
|
5004
5771
|
{
|
|
5005
5772
|
id,
|
|
5006
5773
|
"data-testid": testid,
|
|
5007
|
-
className: (0,
|
|
5774
|
+
className: (0, import_clsx27.default)(
|
|
5008
5775
|
"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",
|
|
5009
5776
|
!show && " pointer-events-none",
|
|
5010
5777
|
size === "small" && "p-4",
|
|
@@ -5020,14 +5787,14 @@ var ModalScrim = ({
|
|
|
5020
5787
|
ModalScrim.displayName = "ModalScrim";
|
|
5021
5788
|
|
|
5022
5789
|
// src/components/Modal.tsx
|
|
5023
|
-
var
|
|
5790
|
+
var import_react_dom4 = require("react-dom");
|
|
5024
5791
|
var import_react_use = require("react-use");
|
|
5025
5792
|
|
|
5026
5793
|
// src/components/useMounted.tsx
|
|
5027
|
-
var
|
|
5794
|
+
var import_react25 = require("react");
|
|
5028
5795
|
var useMounted = () => {
|
|
5029
|
-
const [isMounted, setIsMounted] = (0,
|
|
5030
|
-
(0,
|
|
5796
|
+
const [isMounted, setIsMounted] = (0, import_react25.useState)(false);
|
|
5797
|
+
(0, import_react25.useEffect)(() => {
|
|
5031
5798
|
setIsMounted(true);
|
|
5032
5799
|
return () => setIsMounted(false);
|
|
5033
5800
|
}, []);
|
|
@@ -5035,7 +5802,7 @@ var useMounted = () => {
|
|
|
5035
5802
|
};
|
|
5036
5803
|
|
|
5037
5804
|
// src/components/Modal.tsx
|
|
5038
|
-
var
|
|
5805
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5039
5806
|
var fadeInScale = (element, duration = 300) => element.animate(
|
|
5040
5807
|
[
|
|
5041
5808
|
{ opacity: 0, transform: "scale(0.95)" },
|
|
@@ -5119,12 +5886,12 @@ var Modal = ({
|
|
|
5119
5886
|
}) => {
|
|
5120
5887
|
var _a;
|
|
5121
5888
|
const mounted = useMounted();
|
|
5122
|
-
const modalRef = (0,
|
|
5123
|
-
const bgRef = (0,
|
|
5889
|
+
const modalRef = (0, import_react26.useRef)(null);
|
|
5890
|
+
const bgRef = (0, import_react26.useRef)(null);
|
|
5124
5891
|
const wasOpen = (0, import_react_use.usePrevious)(open);
|
|
5125
5892
|
const isMobile = useMatchesMobile();
|
|
5126
5893
|
const computedFixedHeightScrolling = isMobile || fixedHeightScrolling;
|
|
5127
|
-
(0,
|
|
5894
|
+
(0, import_react26.useEffect)(() => {
|
|
5128
5895
|
if (!mounted) return;
|
|
5129
5896
|
if (!modalRef.current || !bgRef.current) {
|
|
5130
5897
|
console.error("Modal or background reference is not set.");
|
|
@@ -5144,7 +5911,7 @@ var Modal = ({
|
|
|
5144
5911
|
bgFadeIn(bgRef.current);
|
|
5145
5912
|
}
|
|
5146
5913
|
}, [mounted, onClose, open, wasOpen]);
|
|
5147
|
-
const handleKeyDown = (0,
|
|
5914
|
+
const handleKeyDown = (0, import_react26.useCallback)(
|
|
5148
5915
|
(e) => {
|
|
5149
5916
|
if (e.key === "Escape") {
|
|
5150
5917
|
if (onClose) {
|
|
@@ -5155,12 +5922,12 @@ var Modal = ({
|
|
|
5155
5922
|
},
|
|
5156
5923
|
[onClose]
|
|
5157
5924
|
);
|
|
5158
|
-
const handleClose = (0,
|
|
5925
|
+
const handleClose = (0, import_react26.useCallback)(() => {
|
|
5159
5926
|
if (onClose) {
|
|
5160
5927
|
onClose();
|
|
5161
5928
|
}
|
|
5162
5929
|
}, [onClose]);
|
|
5163
|
-
(0,
|
|
5930
|
+
(0, import_react26.useEffect)(() => {
|
|
5164
5931
|
if (open) {
|
|
5165
5932
|
document.addEventListener("keyup", handleKeyDown);
|
|
5166
5933
|
}
|
|
@@ -5168,7 +5935,7 @@ var Modal = ({
|
|
|
5168
5935
|
document.removeEventListener("keyup", handleKeyDown);
|
|
5169
5936
|
};
|
|
5170
5937
|
}, [open, handleKeyDown]);
|
|
5171
|
-
(0,
|
|
5938
|
+
(0, import_react26.useEffect)(() => {
|
|
5172
5939
|
if (!open) return;
|
|
5173
5940
|
const scrollY = window.scrollY;
|
|
5174
5941
|
const body = document.body;
|
|
@@ -5189,7 +5956,7 @@ var Modal = ({
|
|
|
5189
5956
|
};
|
|
5190
5957
|
}, [open]);
|
|
5191
5958
|
const { sizeClass } = (_a = sizes[size]) != null ? _a : sizes.small;
|
|
5192
|
-
const backgroundClickHandler = (0,
|
|
5959
|
+
const backgroundClickHandler = (0, import_react26.useCallback)(
|
|
5193
5960
|
(e) => {
|
|
5194
5961
|
const target = e.target;
|
|
5195
5962
|
const currentTarget = e.currentTarget;
|
|
@@ -5206,8 +5973,8 @@ var Modal = ({
|
|
|
5206
5973
|
if (!mounted) {
|
|
5207
5974
|
return null;
|
|
5208
5975
|
}
|
|
5209
|
-
return (0,
|
|
5210
|
-
/* @__PURE__ */ (0,
|
|
5976
|
+
return (0, import_react_dom4.createPortal)(
|
|
5977
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5211
5978
|
ModalScrim,
|
|
5212
5979
|
{
|
|
5213
5980
|
id: id ? `${id}-scrim` : void 0,
|
|
@@ -5216,13 +5983,13 @@ var Modal = ({
|
|
|
5216
5983
|
ref: bgRef,
|
|
5217
5984
|
show: open,
|
|
5218
5985
|
onClick: backgroundClickHandler,
|
|
5219
|
-
children: /* @__PURE__ */ (0,
|
|
5986
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
5220
5987
|
"div",
|
|
5221
5988
|
{
|
|
5222
5989
|
id,
|
|
5223
5990
|
"data-testid": testid,
|
|
5224
5991
|
ref: modalRef,
|
|
5225
|
-
className: (0,
|
|
5992
|
+
className: (0, import_clsx28.default)(
|
|
5226
5993
|
"shadow-md rounded-sm flex flex-col overflow-hidden w-full opacity-0 h-fit",
|
|
5227
5994
|
computedFixedHeightScrolling && size !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
|
|
5228
5995
|
className,
|
|
@@ -5231,7 +5998,7 @@ var Modal = ({
|
|
|
5231
5998
|
),
|
|
5232
5999
|
onClick: (e) => e.stopPropagation(),
|
|
5233
6000
|
children: [
|
|
5234
|
-
/* @__PURE__ */ (0,
|
|
6001
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5235
6002
|
ModalHeader,
|
|
5236
6003
|
{
|
|
5237
6004
|
id: id ? `${id}-header` : void 0,
|
|
@@ -5244,7 +6011,7 @@ var Modal = ({
|
|
|
5244
6011
|
headerClassname
|
|
5245
6012
|
}
|
|
5246
6013
|
),
|
|
5247
|
-
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0,
|
|
6014
|
+
children && (size !== "screen" || noWrapper) ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5248
6015
|
ModalContent,
|
|
5249
6016
|
{
|
|
5250
6017
|
id: id ? `${id}-content` : void 0,
|
|
@@ -5253,7 +6020,7 @@ var Modal = ({
|
|
|
5253
6020
|
children
|
|
5254
6021
|
}
|
|
5255
6022
|
) : children,
|
|
5256
|
-
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0,
|
|
6023
|
+
showButtons ? customFooter ? customActions : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5257
6024
|
ModalButtons,
|
|
5258
6025
|
{
|
|
5259
6026
|
id: id ? `${id}-buttons` : void 0,
|
|
@@ -5274,12 +6041,12 @@ var Modal = ({
|
|
|
5274
6041
|
Modal.displayName = "Modal";
|
|
5275
6042
|
|
|
5276
6043
|
// src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx
|
|
5277
|
-
var
|
|
6044
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
5278
6045
|
function MobileDataGridColumn(props) {
|
|
5279
6046
|
var _a;
|
|
5280
6047
|
const { column, data } = props;
|
|
5281
|
-
return /* @__PURE__ */ (0,
|
|
5282
|
-
/* @__PURE__ */ (0,
|
|
6048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "grid grid-cols-2 gap-2 px-3 flex-1", children: [
|
|
6049
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5283
6050
|
(_a = column.header) == null ? void 0 : _a.toString(),
|
|
5284
6051
|
":"
|
|
5285
6052
|
] }),
|
|
@@ -5289,28 +6056,28 @@ function MobileDataGridColumn(props) {
|
|
|
5289
6056
|
}
|
|
5290
6057
|
|
|
5291
6058
|
// src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx
|
|
5292
|
-
var
|
|
6059
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5293
6060
|
function ModalContent2() {
|
|
5294
6061
|
const context = useGridContext();
|
|
5295
6062
|
const { columns, currentRow } = context;
|
|
5296
6063
|
if (!currentRow) return null;
|
|
5297
|
-
return /* @__PURE__ */ (0,
|
|
6064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Stack, { sizing: "layout-group", children: columns.filter((x) => {
|
|
5298
6065
|
var _a;
|
|
5299
6066
|
return !((_a = x.id) == null ? void 0 : _a.startsWith("__"));
|
|
5300
6067
|
}).map(
|
|
5301
6068
|
(column, index) => {
|
|
5302
6069
|
var _a, _b;
|
|
5303
|
-
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0,
|
|
6070
|
+
return ((_a = column.meta) == null ? void 0 : _a.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
5304
6071
|
"div",
|
|
5305
6072
|
{
|
|
5306
6073
|
className: "grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5307
6074
|
children: [
|
|
5308
|
-
/* @__PURE__ */ (0,
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Paragraph, { color: "text-secondary-normal", className: "text-left", children: [
|
|
5309
6076
|
(_b = column.header) == null ? void 0 : _b.toString(),
|
|
5310
6077
|
":"
|
|
5311
6078
|
] }),
|
|
5312
6079
|
" ",
|
|
5313
|
-
/* @__PURE__ */ (0,
|
|
6080
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5314
6081
|
column.meta.mobileCell,
|
|
5315
6082
|
{
|
|
5316
6083
|
column,
|
|
@@ -5321,7 +6088,7 @@ function ModalContent2() {
|
|
|
5321
6088
|
]
|
|
5322
6089
|
},
|
|
5323
6090
|
`${column.id}-${index}`
|
|
5324
|
-
) : /* @__PURE__ */ (0,
|
|
6091
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5325
6092
|
MobileDataGridColumn,
|
|
5326
6093
|
{
|
|
5327
6094
|
column,
|
|
@@ -5334,7 +6101,7 @@ function ModalContent2() {
|
|
|
5334
6101
|
}
|
|
5335
6102
|
|
|
5336
6103
|
// src/components/MobileDataGrid/RowDetailModalProvider/index.tsx
|
|
5337
|
-
var
|
|
6104
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
5338
6105
|
function RowDetailModalProvider() {
|
|
5339
6106
|
var _a;
|
|
5340
6107
|
const context = useGridContext();
|
|
@@ -5346,7 +6113,7 @@ function RowDetailModalProvider() {
|
|
|
5346
6113
|
primaryKey,
|
|
5347
6114
|
closeRowDetail
|
|
5348
6115
|
} = context;
|
|
5349
|
-
return /* @__PURE__ */ (0,
|
|
6116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5350
6117
|
Modal,
|
|
5351
6118
|
{
|
|
5352
6119
|
fixedHeightScrolling: true,
|
|
@@ -5355,7 +6122,7 @@ function RowDetailModalProvider() {
|
|
|
5355
6122
|
hideCloseIcon: true,
|
|
5356
6123
|
size: "medium",
|
|
5357
6124
|
className: "!p-0",
|
|
5358
|
-
headerIcon: /* @__PURE__ */ (0,
|
|
6125
|
+
headerIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
5359
6126
|
Stack,
|
|
5360
6127
|
{
|
|
5361
6128
|
horizontal: true,
|
|
@@ -5364,8 +6131,8 @@ function RowDetailModalProvider() {
|
|
|
5364
6131
|
justify: "between",
|
|
5365
6132
|
width: "full",
|
|
5366
6133
|
children: [
|
|
5367
|
-
/* @__PURE__ */ (0,
|
|
5368
|
-
/* @__PURE__ */ (0,
|
|
6134
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Heading2, { children: (_a = currentRow == null ? void 0 : currentRow[primaryKey != null ? primaryKey : "id"]) != null ? _a : "Grid Detail" }),
|
|
6135
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
5369
6136
|
Button,
|
|
5370
6137
|
{
|
|
5371
6138
|
id: id ? `${id}-open-in-new-button` : void 0,
|
|
@@ -5373,25 +6140,25 @@ function RowDetailModalProvider() {
|
|
|
5373
6140
|
iconOnly: true,
|
|
5374
6141
|
variant: "tertiary",
|
|
5375
6142
|
onClick: closeRowDetail,
|
|
5376
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
6143
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { name: "open_in_new", size: 24 }) })
|
|
5377
6144
|
}
|
|
5378
6145
|
)
|
|
5379
6146
|
]
|
|
5380
6147
|
}
|
|
5381
6148
|
),
|
|
5382
|
-
customActions: /* @__PURE__ */ (0,
|
|
6149
|
+
customActions: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { onClick: closeRowDetail, className: "w-full", children: "Close" }),
|
|
5383
6150
|
showButtons: true,
|
|
5384
|
-
children: /* @__PURE__ */ (0,
|
|
6151
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ModalContent2, {}) })
|
|
5385
6152
|
}
|
|
5386
6153
|
);
|
|
5387
6154
|
}
|
|
5388
6155
|
|
|
5389
6156
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5390
|
-
var
|
|
6157
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
5391
6158
|
|
|
5392
6159
|
// src/components/MobileDataGrid/MobileDataGridCard/index.tsx
|
|
5393
|
-
var
|
|
5394
|
-
var
|
|
6160
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
6161
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
5395
6162
|
function MobileDataGridCard({
|
|
5396
6163
|
renderLink,
|
|
5397
6164
|
renderChevron = true,
|
|
@@ -5403,27 +6170,27 @@ function MobileDataGridCard({
|
|
|
5403
6170
|
var _a;
|
|
5404
6171
|
const context = useGridContext();
|
|
5405
6172
|
const { id, testid, visibleColumns, getId, handleRowSelect, openRowDetail } = context;
|
|
5406
|
-
return /* @__PURE__ */ (0,
|
|
6173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5407
6174
|
"li",
|
|
5408
6175
|
{
|
|
5409
6176
|
id: id ? `${id}-card-${getId(data)}` : void 0,
|
|
5410
6177
|
"data-testid": testid ? `${testid}-card-${getId(data)}` : void 0,
|
|
5411
|
-
className: (0,
|
|
6178
|
+
className: (0, import_clsx29.default)(
|
|
5412
6179
|
"hover:bg-action-100 cursor-pointer list-none",
|
|
5413
6180
|
selected ? "bg-action-100" : "bg-background-grouped-primary-normal"
|
|
5414
6181
|
),
|
|
5415
6182
|
onClick: () => openRowDetail(data),
|
|
5416
6183
|
children: [
|
|
5417
|
-
/* @__PURE__ */ (0,
|
|
5418
|
-
/* @__PURE__ */ (0,
|
|
5419
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
6184
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Stack, { sizing: "component", children: [
|
|
6185
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(Stack, { horizontal: true, horizontalMobile: true, items: "center", justify: "between", children: [
|
|
6186
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5420
6187
|
Stack,
|
|
5421
6188
|
{
|
|
5422
6189
|
sizing: "component",
|
|
5423
6190
|
padding: true,
|
|
5424
6191
|
width: "fit",
|
|
5425
6192
|
onClick: (e) => e.stopPropagation(),
|
|
5426
|
-
children: /* @__PURE__ */ (0,
|
|
6193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5427
6194
|
Checkbox,
|
|
5428
6195
|
{
|
|
5429
6196
|
id: id ? `${id}-${getId(data)}-select-checkbox` : void 0,
|
|
@@ -5434,16 +6201,16 @@ function MobileDataGridCard({
|
|
|
5434
6201
|
)
|
|
5435
6202
|
}
|
|
5436
6203
|
),
|
|
5437
|
-
/* @__PURE__ */ (0,
|
|
6204
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5438
6205
|
Stack,
|
|
5439
6206
|
{
|
|
5440
6207
|
sizing: "component",
|
|
5441
6208
|
padding: true,
|
|
5442
6209
|
onClick: (e) => e.stopPropagation(),
|
|
5443
|
-
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0,
|
|
6210
|
+
children: renderLink ? renderLink(data) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Subheader, { children: String((_a = data[context.primaryKey]) != null ? _a : "") })
|
|
5444
6211
|
}
|
|
5445
6212
|
),
|
|
5446
|
-
/* @__PURE__ */ (0,
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5447
6214
|
Stack,
|
|
5448
6215
|
{
|
|
5449
6216
|
horizontal: true,
|
|
@@ -5456,18 +6223,18 @@ function MobileDataGridCard({
|
|
|
5456
6223
|
}
|
|
5457
6224
|
)
|
|
5458
6225
|
] }),
|
|
5459
|
-
/* @__PURE__ */ (0,
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Stack, { sizing: "layout-group", children: visibleColumns.filter((x) => {
|
|
5460
6227
|
var _a2, _b;
|
|
5461
6228
|
return ((_a2 = x.meta) == null ? void 0 : _a2.visible) !== false && !((_b = x.id) == null ? void 0 : _b.startsWith("__"));
|
|
5462
6229
|
}).map(
|
|
5463
6230
|
(column, index) => {
|
|
5464
6231
|
var _a2, _b;
|
|
5465
|
-
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0,
|
|
6232
|
+
return ((_a2 = column.meta) == null ? void 0 : _a2.useCustomRenderer) && column.meta.mobileCell && column.id ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5466
6233
|
"div",
|
|
5467
6234
|
{
|
|
5468
6235
|
className: "grid grid-cols-2 gap-2 px-3 items-center flex-1",
|
|
5469
6236
|
children: [
|
|
5470
|
-
/* @__PURE__ */ (0,
|
|
6237
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
5471
6238
|
Paragraph,
|
|
5472
6239
|
{
|
|
5473
6240
|
color: "text-secondary-normal",
|
|
@@ -5479,7 +6246,7 @@ function MobileDataGridCard({
|
|
|
5479
6246
|
}
|
|
5480
6247
|
),
|
|
5481
6248
|
" ",
|
|
5482
|
-
/* @__PURE__ */ (0,
|
|
6249
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5483
6250
|
column.meta.mobileCell,
|
|
5484
6251
|
{
|
|
5485
6252
|
column,
|
|
@@ -5490,7 +6257,7 @@ function MobileDataGridCard({
|
|
|
5490
6257
|
]
|
|
5491
6258
|
},
|
|
5492
6259
|
`${column.id}-${index}`
|
|
5493
|
-
) : /* @__PURE__ */ (0,
|
|
6260
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
5494
6261
|
MobileDataGridColumn,
|
|
5495
6262
|
{
|
|
5496
6263
|
column,
|
|
@@ -5501,14 +6268,14 @@ function MobileDataGridCard({
|
|
|
5501
6268
|
}
|
|
5502
6269
|
) })
|
|
5503
6270
|
] }),
|
|
5504
|
-
renderChevron && /* @__PURE__ */ (0,
|
|
6271
|
+
renderChevron && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Stack, { items: "center", justify: "center", horizontal: true, horizontalMobile: true, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { name: "keyboard_arrow_down" }) })
|
|
5505
6272
|
]
|
|
5506
6273
|
}
|
|
5507
6274
|
);
|
|
5508
6275
|
}
|
|
5509
6276
|
|
|
5510
6277
|
// src/components/MobileDataGrid/ColumnList.tsx
|
|
5511
|
-
var
|
|
6278
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
5512
6279
|
function ColumnList(props) {
|
|
5513
6280
|
const {
|
|
5514
6281
|
withBorder,
|
|
@@ -5520,19 +6287,19 @@ function ColumnList(props) {
|
|
|
5520
6287
|
} = props;
|
|
5521
6288
|
const ctx = useGridContext();
|
|
5522
6289
|
const { id, testid, data, getId, selectedRowIds } = ctx;
|
|
5523
|
-
return /* @__PURE__ */ (0,
|
|
6290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5524
6291
|
"div",
|
|
5525
6292
|
{
|
|
5526
|
-
className: (0,
|
|
6293
|
+
className: (0, import_clsx30.default)(
|
|
5527
6294
|
"flex flex-col flex-1 relative overflow-y-auto overflow-x-hidden",
|
|
5528
6295
|
!!Footer && "mb-20"
|
|
5529
6296
|
),
|
|
5530
|
-
children: /* @__PURE__ */ (0,
|
|
6297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
5531
6298
|
"ul",
|
|
5532
6299
|
{
|
|
5533
6300
|
id,
|
|
5534
6301
|
"data-testid": testid,
|
|
5535
|
-
className: (0,
|
|
6302
|
+
className: (0, import_clsx30.default)(
|
|
5536
6303
|
"rounded absolute top-0 left-0 w-full flex-1",
|
|
5537
6304
|
"divide-y divide-border-primary-normal",
|
|
5538
6305
|
withBorder && "border border-border-primary-normal"
|
|
@@ -5540,7 +6307,7 @@ function ColumnList(props) {
|
|
|
5540
6307
|
children: [
|
|
5541
6308
|
data.map((item) => {
|
|
5542
6309
|
const id2 = getId(item);
|
|
5543
|
-
return /* @__PURE__ */ (0,
|
|
6310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5544
6311
|
MobileDataGridCard,
|
|
5545
6312
|
{
|
|
5546
6313
|
data: item,
|
|
@@ -5553,7 +6320,7 @@ function ColumnList(props) {
|
|
|
5553
6320
|
id2
|
|
5554
6321
|
);
|
|
5555
6322
|
}),
|
|
5556
|
-
!!Footer && /* @__PURE__ */ (0,
|
|
6323
|
+
!!Footer && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fixed left-0 right-0 bottom-0 flex flex-col w-full min-h-20", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Footer, __spreadValues({}, ctx)) })
|
|
5557
6324
|
]
|
|
5558
6325
|
}
|
|
5559
6326
|
)
|
|
@@ -5562,7 +6329,7 @@ function ColumnList(props) {
|
|
|
5562
6329
|
}
|
|
5563
6330
|
|
|
5564
6331
|
// src/components/MobileDataGrid/index.tsx
|
|
5565
|
-
var
|
|
6332
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5566
6333
|
function MobileDataGrid(props) {
|
|
5567
6334
|
const {
|
|
5568
6335
|
columns,
|
|
@@ -5584,7 +6351,7 @@ function MobileDataGrid(props) {
|
|
|
5584
6351
|
rowActions,
|
|
5585
6352
|
rounded
|
|
5586
6353
|
} = props;
|
|
5587
|
-
return /* @__PURE__ */ (0,
|
|
6354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5588
6355
|
GridContextProvider,
|
|
5589
6356
|
{
|
|
5590
6357
|
initialColumns: columns,
|
|
@@ -5596,7 +6363,7 @@ function MobileDataGrid(props) {
|
|
|
5596
6363
|
numberOfColumnsToShow,
|
|
5597
6364
|
primaryKey,
|
|
5598
6365
|
children: [
|
|
5599
|
-
/* @__PURE__ */ (0,
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
5600
6367
|
Stack,
|
|
5601
6368
|
{
|
|
5602
6369
|
height: "full",
|
|
@@ -5604,7 +6371,7 @@ function MobileDataGrid(props) {
|
|
|
5604
6371
|
overflowX: "hidden",
|
|
5605
6372
|
overflowY: "hidden",
|
|
5606
6373
|
children: [
|
|
5607
|
-
!hideHeader && /* @__PURE__ */ (0,
|
|
6374
|
+
!hideHeader && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5608
6375
|
MobileDataGridHeader,
|
|
5609
6376
|
{
|
|
5610
6377
|
header,
|
|
@@ -5612,7 +6379,7 @@ function MobileDataGrid(props) {
|
|
|
5612
6379
|
enableRowSelection
|
|
5613
6380
|
}
|
|
5614
6381
|
),
|
|
5615
|
-
/* @__PURE__ */ (0,
|
|
6382
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
5616
6383
|
ColumnList,
|
|
5617
6384
|
{
|
|
5618
6385
|
withBorder,
|
|
@@ -5626,21 +6393,21 @@ function MobileDataGrid(props) {
|
|
|
5626
6393
|
]
|
|
5627
6394
|
}
|
|
5628
6395
|
),
|
|
5629
|
-
/* @__PURE__ */ (0,
|
|
6396
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(RowDetailModalProvider, {})
|
|
5630
6397
|
]
|
|
5631
6398
|
}
|
|
5632
6399
|
);
|
|
5633
6400
|
}
|
|
5634
6401
|
|
|
5635
6402
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5636
|
-
var
|
|
6403
|
+
var import_react28 = require("react");
|
|
5637
6404
|
|
|
5638
6405
|
// src/components/ImagePlaceholder.tsx
|
|
5639
|
-
var
|
|
5640
|
-
var
|
|
6406
|
+
var import_react27 = require("react");
|
|
6407
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
5641
6408
|
function ImagePlaceholder(props) {
|
|
5642
|
-
const clipId = (0,
|
|
5643
|
-
return /* @__PURE__ */ (0,
|
|
6409
|
+
const clipId = (0, import_react27.useId)();
|
|
6410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
5644
6411
|
"svg",
|
|
5645
6412
|
__spreadProps(__spreadValues({
|
|
5646
6413
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -5649,15 +6416,15 @@ function ImagePlaceholder(props) {
|
|
|
5649
6416
|
fill: "none"
|
|
5650
6417
|
}, props), {
|
|
5651
6418
|
children: [
|
|
5652
|
-
/* @__PURE__ */ (0,
|
|
5653
|
-
/* @__PURE__ */ (0,
|
|
6419
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("rect", { width: props.width, height: props.width, fill: "#F7F7F7", rx: 2 }) }),
|
|
6420
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("clipPath", { id: clipId, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("rect", { width: props.width, height: props.width, fill: "#fff", rx: 2 }) }) })
|
|
5654
6421
|
]
|
|
5655
6422
|
})
|
|
5656
6423
|
);
|
|
5657
6424
|
}
|
|
5658
6425
|
|
|
5659
6426
|
// src/components/ProductImagePreview/Thumbnail.tsx
|
|
5660
|
-
var
|
|
6427
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
5661
6428
|
function Thumbnail({
|
|
5662
6429
|
width,
|
|
5663
6430
|
height,
|
|
@@ -5667,8 +6434,8 @@ function Thumbnail({
|
|
|
5667
6434
|
onClick,
|
|
5668
6435
|
isPlaceholder = false
|
|
5669
6436
|
}) {
|
|
5670
|
-
const [imageError, setImageError] = (0,
|
|
5671
|
-
return /* @__PURE__ */ (0,
|
|
6437
|
+
const [imageError, setImageError] = (0, import_react28.useState)(false);
|
|
6438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5672
6439
|
"button",
|
|
5673
6440
|
{
|
|
5674
6441
|
type: "button",
|
|
@@ -5681,7 +6448,7 @@ function Thumbnail({
|
|
|
5681
6448
|
].join(" "),
|
|
5682
6449
|
style: { maxWidth: width, maxHeight: height, aspectRatio: "1 / 1" },
|
|
5683
6450
|
"aria-pressed": isActive && !isPlaceholder ? "true" : "false",
|
|
5684
|
-
children: isPlaceholder ? /* @__PURE__ */ (0,
|
|
6451
|
+
children: isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ImagePlaceholder, { width: 115, height: 115 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
5685
6452
|
"img",
|
|
5686
6453
|
{
|
|
5687
6454
|
src: imageError ? "/placeholder.svg" : src,
|
|
@@ -5699,8 +6466,8 @@ function Thumbnail({
|
|
|
5699
6466
|
}
|
|
5700
6467
|
|
|
5701
6468
|
// src/components/Grid.tsx
|
|
5702
|
-
var
|
|
5703
|
-
var
|
|
6469
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
6470
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5704
6471
|
var GAP_BY_SIZING = {
|
|
5705
6472
|
none: "gap-0",
|
|
5706
6473
|
"layout-group": "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-compact-layout-group-gap",
|
|
@@ -5748,14 +6515,14 @@ var Grid = (_a) => {
|
|
|
5748
6515
|
]);
|
|
5749
6516
|
var _a2, _b2;
|
|
5750
6517
|
const columnClasses = buildColumnClasses(columns, responsive);
|
|
5751
|
-
return /* @__PURE__ */ (0,
|
|
6518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
5752
6519
|
"div",
|
|
5753
6520
|
__spreadProps(__spreadValues({
|
|
5754
6521
|
id,
|
|
5755
6522
|
"data-testid": testid,
|
|
5756
6523
|
style
|
|
5757
6524
|
}, rest), {
|
|
5758
|
-
className: (0,
|
|
6525
|
+
className: (0, import_clsx31.default)(
|
|
5759
6526
|
"w-full grid",
|
|
5760
6527
|
(_a2 = GAP_BY_SIZING[sizing]) != null ? _a2 : GAP_BY_SIZING.container,
|
|
5761
6528
|
padding && ((_b2 = PADDING_BY_SIZING[sizing]) != null ? _b2 : PADDING_BY_SIZING.container),
|
|
@@ -5769,8 +6536,8 @@ var Grid = (_a) => {
|
|
|
5769
6536
|
};
|
|
5770
6537
|
|
|
5771
6538
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
5772
|
-
var
|
|
5773
|
-
var
|
|
6539
|
+
var import_react29 = require("react");
|
|
6540
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
5774
6541
|
var placeholderImageUri = "/placeholder.svg";
|
|
5775
6542
|
function ProductPrimaryImage({
|
|
5776
6543
|
image,
|
|
@@ -5784,12 +6551,12 @@ function ProductPrimaryImage({
|
|
|
5784
6551
|
onZoomPositionChange,
|
|
5785
6552
|
onScrollZoom
|
|
5786
6553
|
}) {
|
|
5787
|
-
const containerRef = (0,
|
|
5788
|
-
const lastPointRef = (0,
|
|
5789
|
-
const rafRef = (0,
|
|
5790
|
-
const [active, setActive] = (0,
|
|
5791
|
-
const [, forceRerender] = (0,
|
|
5792
|
-
const imageSrc = (0,
|
|
6554
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
6555
|
+
const lastPointRef = (0, import_react29.useRef)(null);
|
|
6556
|
+
const rafRef = (0, import_react29.useRef)(null);
|
|
6557
|
+
const [active, setActive] = (0, import_react29.useState)(false);
|
|
6558
|
+
const [, forceRerender] = (0, import_react29.useState)(0);
|
|
6559
|
+
const imageSrc = (0, import_react29.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
5793
6560
|
const schedule = () => {
|
|
5794
6561
|
if (rafRef.current != null) return;
|
|
5795
6562
|
rafRef.current = requestAnimationFrame(() => {
|
|
@@ -5797,7 +6564,7 @@ function ProductPrimaryImage({
|
|
|
5797
6564
|
forceRerender((n) => n + 1);
|
|
5798
6565
|
});
|
|
5799
6566
|
};
|
|
5800
|
-
const handlePointerEnter = (0,
|
|
6567
|
+
const handlePointerEnter = (0, import_react29.useCallback)(() => {
|
|
5801
6568
|
if (!zoomEnabled) return;
|
|
5802
6569
|
setActive(true);
|
|
5803
6570
|
const el = containerRef.current;
|
|
@@ -5810,13 +6577,13 @@ function ProductPrimaryImage({
|
|
|
5810
6577
|
);
|
|
5811
6578
|
}
|
|
5812
6579
|
}, [zoomEnabled, onZoomPositionChange, zoomLensSize]);
|
|
5813
|
-
const handlePointerLeave = (0,
|
|
6580
|
+
const handlePointerLeave = (0, import_react29.useCallback)(() => {
|
|
5814
6581
|
if (!zoomEnabled) return;
|
|
5815
6582
|
setActive(false);
|
|
5816
6583
|
lastPointRef.current = null;
|
|
5817
6584
|
onZoomPositionChange == null ? void 0 : onZoomPositionChange(null, false);
|
|
5818
6585
|
}, [zoomEnabled, onZoomPositionChange]);
|
|
5819
|
-
const handlePointerMove = (0,
|
|
6586
|
+
const handlePointerMove = (0, import_react29.useCallback)(
|
|
5820
6587
|
(e) => {
|
|
5821
6588
|
if (isPlaceholder) return;
|
|
5822
6589
|
if (!zoomEnabled || !active) return;
|
|
@@ -5853,7 +6620,7 @@ function ProductPrimaryImage({
|
|
|
5853
6620
|
},
|
|
5854
6621
|
[isPlaceholder, zoomEnabled, active, zoomLensSize, onZoomPositionChange]
|
|
5855
6622
|
);
|
|
5856
|
-
(0,
|
|
6623
|
+
(0, import_react29.useEffect)(() => {
|
|
5857
6624
|
const container = containerRef.current;
|
|
5858
6625
|
if (!container || !scrollToZoomEnabled) return;
|
|
5859
6626
|
const handleNativeWheel = (e) => {
|
|
@@ -5868,7 +6635,7 @@ function ProductPrimaryImage({
|
|
|
5868
6635
|
container.removeEventListener("wheel", handleNativeWheel);
|
|
5869
6636
|
};
|
|
5870
6637
|
}, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
|
|
5871
|
-
const handleImgError = (0,
|
|
6638
|
+
const handleImgError = (0, import_react29.useCallback)(
|
|
5872
6639
|
(e) => {
|
|
5873
6640
|
if (!placeholderImageUri) return;
|
|
5874
6641
|
const img = e.currentTarget;
|
|
@@ -5890,7 +6657,7 @@ function ProductPrimaryImage({
|
|
|
5890
6657
|
top: Math.max(0, Math.min(height - size, topRaw))
|
|
5891
6658
|
};
|
|
5892
6659
|
}
|
|
5893
|
-
return /* @__PURE__ */ (0,
|
|
6660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
5894
6661
|
"div",
|
|
5895
6662
|
{
|
|
5896
6663
|
ref: containerRef,
|
|
@@ -5910,7 +6677,7 @@ function ProductPrimaryImage({
|
|
|
5910
6677
|
onPointerLeave: handlePointerLeave,
|
|
5911
6678
|
onPointerMove: handlePointerMove,
|
|
5912
6679
|
children: [
|
|
5913
|
-
/* @__PURE__ */ (0,
|
|
6680
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5914
6681
|
"img",
|
|
5915
6682
|
{
|
|
5916
6683
|
src: imageSrc != null ? imageSrc : placeholderImageUri,
|
|
@@ -5922,7 +6689,7 @@ function ProductPrimaryImage({
|
|
|
5922
6689
|
},
|
|
5923
6690
|
imageSrc
|
|
5924
6691
|
),
|
|
5925
|
-
zoomEnabled && active && lensStyle && /* @__PURE__ */ (0,
|
|
6692
|
+
zoomEnabled && active && lensStyle && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
5926
6693
|
"div",
|
|
5927
6694
|
{
|
|
5928
6695
|
"aria-hidden": true,
|
|
@@ -5936,11 +6703,11 @@ function ProductPrimaryImage({
|
|
|
5936
6703
|
}
|
|
5937
6704
|
|
|
5938
6705
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5939
|
-
var
|
|
6706
|
+
var import_react30 = require("react");
|
|
5940
6707
|
|
|
5941
6708
|
// src/components/Surface.tsx
|
|
5942
|
-
var
|
|
5943
|
-
var
|
|
6709
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
6710
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5944
6711
|
var Surface = (_a) => {
|
|
5945
6712
|
var _b = _a, {
|
|
5946
6713
|
children,
|
|
@@ -5953,11 +6720,11 @@ var Surface = (_a) => {
|
|
|
5953
6720
|
"elevation",
|
|
5954
6721
|
"id"
|
|
5955
6722
|
]);
|
|
5956
|
-
return /* @__PURE__ */ (0,
|
|
6723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
5957
6724
|
"div",
|
|
5958
6725
|
__spreadProps(__spreadValues({
|
|
5959
6726
|
id,
|
|
5960
|
-
className: (0,
|
|
6727
|
+
className: (0, import_clsx32.default)(
|
|
5961
6728
|
"rounded-base",
|
|
5962
6729
|
{
|
|
5963
6730
|
"shadow-2": elevation === 2,
|
|
@@ -5974,7 +6741,7 @@ var Surface = (_a) => {
|
|
|
5974
6741
|
Surface.displayName = "Surface";
|
|
5975
6742
|
|
|
5976
6743
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
5977
|
-
var
|
|
6744
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
5978
6745
|
function ZoomWindow({
|
|
5979
6746
|
image,
|
|
5980
6747
|
width,
|
|
@@ -5987,7 +6754,7 @@ function ZoomWindow({
|
|
|
5987
6754
|
offset = 10,
|
|
5988
6755
|
className = ""
|
|
5989
6756
|
}) {
|
|
5990
|
-
const imageSrc = (0,
|
|
6757
|
+
const imageSrc = (0, import_react30.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
|
|
5991
6758
|
if (!image || !active || !pointer) return null;
|
|
5992
6759
|
const zoomWindowSize = pointer.lensSize * scaleFactor;
|
|
5993
6760
|
const baseW = pointer.w || width;
|
|
@@ -6032,7 +6799,7 @@ function ZoomWindow({
|
|
|
6032
6799
|
top
|
|
6033
6800
|
};
|
|
6034
6801
|
};
|
|
6035
|
-
return /* @__PURE__ */ (0,
|
|
6802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6036
6803
|
Surface,
|
|
6037
6804
|
{
|
|
6038
6805
|
elevation: 16,
|
|
@@ -6047,7 +6814,7 @@ function ZoomWindow({
|
|
|
6047
6814
|
userSelect: "none"
|
|
6048
6815
|
}, calculatePosition()),
|
|
6049
6816
|
"aria-hidden": true,
|
|
6050
|
-
children: /* @__PURE__ */ (0,
|
|
6817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
6051
6818
|
"img",
|
|
6052
6819
|
{
|
|
6053
6820
|
src: imageSrc,
|
|
@@ -6068,8 +6835,8 @@ function ZoomWindow({
|
|
|
6068
6835
|
}
|
|
6069
6836
|
|
|
6070
6837
|
// src/components/ProductImagePreview/CarouselPagination.tsx
|
|
6071
|
-
var
|
|
6072
|
-
var
|
|
6838
|
+
var import_clsx33 = require("clsx");
|
|
6839
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
6073
6840
|
function CarouselPagination({
|
|
6074
6841
|
images,
|
|
6075
6842
|
currentIndex,
|
|
@@ -6077,15 +6844,15 @@ function CarouselPagination({
|
|
|
6077
6844
|
className
|
|
6078
6845
|
}) {
|
|
6079
6846
|
if (!(images == null ? void 0 : images.length)) return null;
|
|
6080
|
-
return /* @__PURE__ */ (0,
|
|
6847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6081
6848
|
"div",
|
|
6082
6849
|
{
|
|
6083
|
-
className: (0,
|
|
6850
|
+
className: (0, import_clsx33.clsx)(
|
|
6084
6851
|
"flex items-center justify-center w-full px-4 md:hidden",
|
|
6085
6852
|
className
|
|
6086
6853
|
),
|
|
6087
6854
|
"aria-label": "Image navigation",
|
|
6088
|
-
children: /* @__PURE__ */ (0,
|
|
6855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6089
6856
|
"div",
|
|
6090
6857
|
{
|
|
6091
6858
|
className: "grid gap-2 place-items-center",
|
|
@@ -6093,12 +6860,12 @@ function CarouselPagination({
|
|
|
6093
6860
|
gridTemplateColumns: `repeat(${Math.min(images.length, 8)}, 1fr)`
|
|
6094
6861
|
},
|
|
6095
6862
|
role: "tablist",
|
|
6096
|
-
children: images.map((_, index) => /* @__PURE__ */ (0,
|
|
6863
|
+
children: images.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
6097
6864
|
"button",
|
|
6098
6865
|
{
|
|
6099
6866
|
type: "button",
|
|
6100
6867
|
onClick: () => onSelect(index),
|
|
6101
|
-
className: (0,
|
|
6868
|
+
className: (0, import_clsx33.clsx)(
|
|
6102
6869
|
"w-4 h-4 transition-all duration-200 focus:outline-none",
|
|
6103
6870
|
index === currentIndex ? "ring-2 ring-brand-400" : "ring ring-neutral-300"
|
|
6104
6871
|
),
|
|
@@ -6116,8 +6883,8 @@ function CarouselPagination({
|
|
|
6116
6883
|
}
|
|
6117
6884
|
|
|
6118
6885
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
6119
|
-
var
|
|
6120
|
-
var
|
|
6886
|
+
var import_react31 = require("react");
|
|
6887
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
6121
6888
|
function MobileImageCarousel({
|
|
6122
6889
|
images,
|
|
6123
6890
|
currentIndex,
|
|
@@ -6126,15 +6893,15 @@ function MobileImageCarousel({
|
|
|
6126
6893
|
onChangeIndex,
|
|
6127
6894
|
className = ""
|
|
6128
6895
|
}) {
|
|
6129
|
-
const containerRef = (0,
|
|
6130
|
-
const [isDragging, setIsDragging] = (0,
|
|
6131
|
-
const [startX, setStartX] = (0,
|
|
6132
|
-
const [currentTranslate, setCurrentTranslate] = (0,
|
|
6133
|
-
const [prevTranslate, setPrevTranslate] = (0,
|
|
6134
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
6896
|
+
const containerRef = (0, import_react31.useRef)(null);
|
|
6897
|
+
const [isDragging, setIsDragging] = (0, import_react31.useState)(false);
|
|
6898
|
+
const [startX, setStartX] = (0, import_react31.useState)(0);
|
|
6899
|
+
const [currentTranslate, setCurrentTranslate] = (0, import_react31.useState)(0);
|
|
6900
|
+
const [prevTranslate, setPrevTranslate] = (0, import_react31.useState)(0);
|
|
6901
|
+
const [containerWidth, setContainerWidth] = (0, import_react31.useState)(width);
|
|
6135
6902
|
const imageSize = Math.min(containerWidth * 0.6, height * 0.6);
|
|
6136
6903
|
const gap = 16;
|
|
6137
|
-
const getTranslateX = (0,
|
|
6904
|
+
const getTranslateX = (0, import_react31.useCallback)(
|
|
6138
6905
|
(index) => {
|
|
6139
6906
|
const containerCenter = containerWidth / 2;
|
|
6140
6907
|
const imageCenter = imageSize / 2;
|
|
@@ -6143,12 +6910,12 @@ function MobileImageCarousel({
|
|
|
6143
6910
|
},
|
|
6144
6911
|
[containerWidth, imageSize, gap]
|
|
6145
6912
|
);
|
|
6146
|
-
(0,
|
|
6913
|
+
(0, import_react31.useEffect)(() => {
|
|
6147
6914
|
const translateX = getTranslateX(currentIndex);
|
|
6148
6915
|
setCurrentTranslate(translateX);
|
|
6149
6916
|
setPrevTranslate(translateX);
|
|
6150
6917
|
}, [currentIndex, getTranslateX]);
|
|
6151
|
-
(0,
|
|
6918
|
+
(0, import_react31.useEffect)(() => {
|
|
6152
6919
|
const updateContainerWidth = () => {
|
|
6153
6920
|
if (containerRef.current) {
|
|
6154
6921
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -6162,11 +6929,11 @@ function MobileImageCarousel({
|
|
|
6162
6929
|
}
|
|
6163
6930
|
return () => resizeObserver.disconnect();
|
|
6164
6931
|
}, []);
|
|
6165
|
-
const handleStart = (0,
|
|
6932
|
+
const handleStart = (0, import_react31.useCallback)((clientX) => {
|
|
6166
6933
|
setIsDragging(true);
|
|
6167
6934
|
setStartX(clientX);
|
|
6168
6935
|
}, []);
|
|
6169
|
-
const handleMove = (0,
|
|
6936
|
+
const handleMove = (0, import_react31.useCallback)(
|
|
6170
6937
|
(clientX) => {
|
|
6171
6938
|
if (!isDragging) return;
|
|
6172
6939
|
const currentPosition = clientX;
|
|
@@ -6175,7 +6942,7 @@ function MobileImageCarousel({
|
|
|
6175
6942
|
},
|
|
6176
6943
|
[isDragging, startX, prevTranslate]
|
|
6177
6944
|
);
|
|
6178
|
-
const handleEnd = (0,
|
|
6945
|
+
const handleEnd = (0, import_react31.useCallback)(() => {
|
|
6179
6946
|
if (!isDragging) return;
|
|
6180
6947
|
setIsDragging(false);
|
|
6181
6948
|
const moved = currentTranslate - prevTranslate;
|
|
@@ -6223,7 +6990,7 @@ function MobileImageCarousel({
|
|
|
6223
6990
|
const handleTouchEnd = () => {
|
|
6224
6991
|
handleEnd();
|
|
6225
6992
|
};
|
|
6226
|
-
const handleImageClick = (0,
|
|
6993
|
+
const handleImageClick = (0, import_react31.useCallback)(
|
|
6227
6994
|
(index) => {
|
|
6228
6995
|
if (!isDragging && index !== currentIndex) {
|
|
6229
6996
|
onChangeIndex(index);
|
|
@@ -6232,7 +6999,7 @@ function MobileImageCarousel({
|
|
|
6232
6999
|
[isDragging, currentIndex, onChangeIndex]
|
|
6233
7000
|
);
|
|
6234
7001
|
if (!images.length) return null;
|
|
6235
|
-
return /* @__PURE__ */ (0,
|
|
7002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: `md:hidden w-full ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6236
7003
|
"div",
|
|
6237
7004
|
{
|
|
6238
7005
|
ref: containerRef,
|
|
@@ -6247,7 +7014,7 @@ function MobileImageCarousel({
|
|
|
6247
7014
|
onTouchStart: handleTouchStart,
|
|
6248
7015
|
onTouchMove: handleTouchMove,
|
|
6249
7016
|
onTouchEnd: handleTouchEnd,
|
|
6250
|
-
children: /* @__PURE__ */ (0,
|
|
7017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6251
7018
|
"div",
|
|
6252
7019
|
{
|
|
6253
7020
|
className: "flex items-center",
|
|
@@ -6260,7 +7027,7 @@ function MobileImageCarousel({
|
|
|
6260
7027
|
const isActive = index === currentIndex;
|
|
6261
7028
|
const distance = Math.abs(index - currentIndex);
|
|
6262
7029
|
const shouldRender = distance <= 2;
|
|
6263
|
-
return /* @__PURE__ */ (0,
|
|
7030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6264
7031
|
"div",
|
|
6265
7032
|
{
|
|
6266
7033
|
className: "flex-shrink-0 transition-opacity duration-300",
|
|
@@ -6270,7 +7037,7 @@ function MobileImageCarousel({
|
|
|
6270
7037
|
opacity: isActive ? 1 : Math.max(0.3, 1 - distance * 0.3)
|
|
6271
7038
|
},
|
|
6272
7039
|
onClick: () => handleImageClick(index),
|
|
6273
|
-
children: shouldRender ? /* @__PURE__ */ (0,
|
|
7040
|
+
children: shouldRender ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6274
7041
|
"img",
|
|
6275
7042
|
{
|
|
6276
7043
|
src: image.src,
|
|
@@ -6282,7 +7049,7 @@ function MobileImageCarousel({
|
|
|
6282
7049
|
aspectRatio: "1 / 1"
|
|
6283
7050
|
}
|
|
6284
7051
|
}
|
|
6285
|
-
) : /* @__PURE__ */ (0,
|
|
7052
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
6286
7053
|
"div",
|
|
6287
7054
|
{
|
|
6288
7055
|
className: "w-full h-full bg-neutral-100 rounded-md border border-gray-200",
|
|
@@ -6303,7 +7070,7 @@ function MobileImageCarousel({
|
|
|
6303
7070
|
}
|
|
6304
7071
|
|
|
6305
7072
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
6306
|
-
var
|
|
7073
|
+
var import_react32 = require("react");
|
|
6307
7074
|
function useProductImagePreview(props) {
|
|
6308
7075
|
const {
|
|
6309
7076
|
images,
|
|
@@ -6316,18 +7083,18 @@ function useProductImagePreview(props) {
|
|
|
6316
7083
|
} = props;
|
|
6317
7084
|
const hasImages = !!(images == null ? void 0 : images.length);
|
|
6318
7085
|
const safeIndex = hasImages && currentIndex >= 0 && currentIndex < images.length ? currentIndex : 0;
|
|
6319
|
-
const active = (0,
|
|
7086
|
+
const active = (0, import_react32.useMemo)(() => {
|
|
6320
7087
|
return hasImages ? images[safeIndex] : void 0;
|
|
6321
7088
|
}, [hasImages, images, safeIndex]);
|
|
6322
|
-
const [zoomPoint, setZoomPoint] = (0,
|
|
6323
|
-
const [zoomActive, setZoomActive] = (0,
|
|
6324
|
-
const [currentZoomFactor, setCurrentZoomFactor] = (0,
|
|
6325
|
-
const [primaryImagePosition, setPrimaryImagePosition] = (0,
|
|
6326
|
-
const primaryImageRef = (0,
|
|
6327
|
-
const cleanupRef = (0,
|
|
7089
|
+
const [zoomPoint, setZoomPoint] = (0, import_react32.useState)(null);
|
|
7090
|
+
const [zoomActive, setZoomActive] = (0, import_react32.useState)(false);
|
|
7091
|
+
const [currentZoomFactor, setCurrentZoomFactor] = (0, import_react32.useState)(zoomFactor);
|
|
7092
|
+
const [primaryImagePosition, setPrimaryImagePosition] = (0, import_react32.useState)(null);
|
|
7093
|
+
const primaryImageRef = (0, import_react32.useRef)(null);
|
|
7094
|
+
const cleanupRef = (0, import_react32.useRef)(null);
|
|
6328
7095
|
const effectiveZoomEnabled = zoomEnabled && !isMobile;
|
|
6329
7096
|
const effectiveScrollToZoomEnabled = scrollToZoomEnabled && !isMobile;
|
|
6330
|
-
(0,
|
|
7097
|
+
(0, import_react32.useEffect)(() => {
|
|
6331
7098
|
if (!effectiveZoomEnabled) return;
|
|
6332
7099
|
const setupTracking = () => {
|
|
6333
7100
|
const element = primaryImageRef.current;
|
|
@@ -6361,24 +7128,24 @@ function useProductImagePreview(props) {
|
|
|
6361
7128
|
}
|
|
6362
7129
|
};
|
|
6363
7130
|
}, [effectiveZoomEnabled]);
|
|
6364
|
-
const handleSelect = (0,
|
|
7131
|
+
const handleSelect = (0, import_react32.useCallback)(
|
|
6365
7132
|
(idx) => {
|
|
6366
7133
|
if (idx === safeIndex) return;
|
|
6367
7134
|
onChangeIndex(idx);
|
|
6368
7135
|
},
|
|
6369
7136
|
[safeIndex, onChangeIndex]
|
|
6370
7137
|
);
|
|
6371
|
-
const handleNext = (0,
|
|
7138
|
+
const handleNext = (0, import_react32.useCallback)(() => {
|
|
6372
7139
|
if (!hasImages) return;
|
|
6373
7140
|
const nextIndex = (safeIndex + 1) % images.length;
|
|
6374
7141
|
onChangeIndex(nextIndex);
|
|
6375
7142
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
6376
|
-
const handlePrevious = (0,
|
|
7143
|
+
const handlePrevious = (0, import_react32.useCallback)(() => {
|
|
6377
7144
|
if (!hasImages) return;
|
|
6378
7145
|
const previousIndex = safeIndex === 0 ? images.length - 1 : safeIndex - 1;
|
|
6379
7146
|
onChangeIndex(previousIndex);
|
|
6380
7147
|
}, [hasImages, safeIndex, images.length, onChangeIndex]);
|
|
6381
|
-
const handleZoomPositionChange = (0,
|
|
7148
|
+
const handleZoomPositionChange = (0, import_react32.useCallback)(
|
|
6382
7149
|
(p, active2) => {
|
|
6383
7150
|
if (isMobile) return;
|
|
6384
7151
|
setZoomPoint(p);
|
|
@@ -6386,7 +7153,7 @@ function useProductImagePreview(props) {
|
|
|
6386
7153
|
},
|
|
6387
7154
|
[isMobile]
|
|
6388
7155
|
);
|
|
6389
|
-
const handleScrollZoom = (0,
|
|
7156
|
+
const handleScrollZoom = (0, import_react32.useCallback)(
|
|
6390
7157
|
(delta) => {
|
|
6391
7158
|
if (!effectiveScrollToZoomEnabled) return;
|
|
6392
7159
|
const newZoomFactor = Math.max(1, Math.min(5, currentZoomFactor + delta));
|
|
@@ -6394,7 +7161,7 @@ function useProductImagePreview(props) {
|
|
|
6394
7161
|
},
|
|
6395
7162
|
[effectiveScrollToZoomEnabled, currentZoomFactor]
|
|
6396
7163
|
);
|
|
6397
|
-
(0,
|
|
7164
|
+
(0, import_react32.useEffect)(() => {
|
|
6398
7165
|
setCurrentZoomFactor(zoomFactor);
|
|
6399
7166
|
}, [zoomFactor]);
|
|
6400
7167
|
return {
|
|
@@ -6418,7 +7185,7 @@ function useProductImagePreview(props) {
|
|
|
6418
7185
|
}
|
|
6419
7186
|
|
|
6420
7187
|
// src/components/ProductImagePreview/index.tsx
|
|
6421
|
-
var
|
|
7188
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
6422
7189
|
var PLACEHOLDER_IMAGES = [
|
|
6423
7190
|
{ src: "", alt: "placeholder" },
|
|
6424
7191
|
{ src: "", alt: "placeholder" }
|
|
@@ -6461,9 +7228,9 @@ function ProductImagePreview(props) {
|
|
|
6461
7228
|
});
|
|
6462
7229
|
if (typeof isMobile === "undefined") return null;
|
|
6463
7230
|
const effectiveZoomEnabled = zoomEnabled && !isMobile;
|
|
6464
|
-
return /* @__PURE__ */ (0,
|
|
6465
|
-
/* @__PURE__ */ (0,
|
|
6466
|
-
/* @__PURE__ */ (0,
|
|
7231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Stack, { sizing: "layout", style: { width, position: "relative" }, children: [
|
|
7232
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "flex gap-4 items-start", children: [
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ref: primaryImageRef, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6467
7234
|
ProductPrimaryImage,
|
|
6468
7235
|
{
|
|
6469
7236
|
image: active,
|
|
@@ -6477,7 +7244,7 @@ function ProductImagePreview(props) {
|
|
|
6477
7244
|
isPlaceholder: images.length === 0
|
|
6478
7245
|
}
|
|
6479
7246
|
) }),
|
|
6480
|
-
effectiveZoomEnabled && /* @__PURE__ */ (0,
|
|
7247
|
+
effectiveZoomEnabled && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6481
7248
|
ZoomWindow,
|
|
6482
7249
|
{
|
|
6483
7250
|
image: active,
|
|
@@ -6492,7 +7259,7 @@ function ProductImagePreview(props) {
|
|
|
6492
7259
|
}
|
|
6493
7260
|
)
|
|
6494
7261
|
] }) }),
|
|
6495
|
-
/* @__PURE__ */ (0,
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6496
7263
|
MobileImageCarousel,
|
|
6497
7264
|
{
|
|
6498
7265
|
images,
|
|
@@ -6502,14 +7269,14 @@ function ProductImagePreview(props) {
|
|
|
6502
7269
|
onChangeIndex: handleSelect
|
|
6503
7270
|
}
|
|
6504
7271
|
),
|
|
6505
|
-
/* @__PURE__ */ (0,
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "hidden md:block", children: images.length <= 3 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6506
7273
|
"div",
|
|
6507
7274
|
{
|
|
6508
7275
|
className: "flex justify-center gap-4",
|
|
6509
7276
|
style: { width: "100%", maxWidth: width },
|
|
6510
7277
|
"aria-label": "Product image thumbnails",
|
|
6511
7278
|
children: (images.length === 0 ? PLACEHOLDER_IMAGES : images).map(
|
|
6512
|
-
(img, i) => /* @__PURE__ */ (0,
|
|
7279
|
+
(img, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { style: { maxWidth: "115px" }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6513
7280
|
Thumbnail,
|
|
6514
7281
|
{
|
|
6515
7282
|
src: img.src,
|
|
@@ -6521,7 +7288,7 @@ function ProductImagePreview(props) {
|
|
|
6521
7288
|
) }, img.src + i)
|
|
6522
7289
|
)
|
|
6523
7290
|
}
|
|
6524
|
-
) : /* @__PURE__ */ (0,
|
|
7291
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6525
7292
|
Grid,
|
|
6526
7293
|
{
|
|
6527
7294
|
sizing: "layout-group",
|
|
@@ -6532,7 +7299,7 @@ function ProductImagePreview(props) {
|
|
|
6532
7299
|
},
|
|
6533
7300
|
columns: thumbsPerRow > 12 ? 12 : thumbsPerRow < 1 ? 1 : thumbsPerRow,
|
|
6534
7301
|
children: (images.length === 0 ? PLACEHOLDER_IMAGES : images).map(
|
|
6535
|
-
(img, i) => /* @__PURE__ */ (0,
|
|
7302
|
+
(img, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6536
7303
|
Thumbnail,
|
|
6537
7304
|
{
|
|
6538
7305
|
src: img.src,
|
|
@@ -6546,7 +7313,7 @@ function ProductImagePreview(props) {
|
|
|
6546
7313
|
)
|
|
6547
7314
|
}
|
|
6548
7315
|
) }),
|
|
6549
|
-
/* @__PURE__ */ (0,
|
|
7316
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
6550
7317
|
CarouselPagination,
|
|
6551
7318
|
{
|
|
6552
7319
|
images,
|
|
@@ -6558,9 +7325,9 @@ function ProductImagePreview(props) {
|
|
|
6558
7325
|
}
|
|
6559
7326
|
|
|
6560
7327
|
// src/components/CompactImagesPreview.tsx
|
|
6561
|
-
var
|
|
6562
|
-
var
|
|
6563
|
-
var
|
|
7328
|
+
var import_react33 = require("react");
|
|
7329
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
7330
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
6564
7331
|
function CompactImagesPreview(props) {
|
|
6565
7332
|
const {
|
|
6566
7333
|
sources,
|
|
@@ -6577,7 +7344,7 @@ function CompactImagesPreview(props) {
|
|
|
6577
7344
|
} = props;
|
|
6578
7345
|
const isMobile = useMatchesMobile();
|
|
6579
7346
|
const imagesCount = sources.length;
|
|
6580
|
-
const handleImgError = (0,
|
|
7347
|
+
const handleImgError = (0, import_react33.useCallback)(
|
|
6581
7348
|
(e) => {
|
|
6582
7349
|
if (!placeholderImageUri2) return;
|
|
6583
7350
|
const img = e.currentTarget;
|
|
@@ -6587,7 +7354,7 @@ function CompactImagesPreview(props) {
|
|
|
6587
7354
|
},
|
|
6588
7355
|
[placeholderImageUri2, placeholderAlt]
|
|
6589
7356
|
);
|
|
6590
|
-
const handleThumbnailClick = (0,
|
|
7357
|
+
const handleThumbnailClick = (0, import_react33.useCallback)(
|
|
6591
7358
|
(newIndex) => {
|
|
6592
7359
|
if (newIndex === currentSourceIndex) return;
|
|
6593
7360
|
if (newIndex < 0 || newIndex >= imagesCount) return;
|
|
@@ -6596,7 +7363,7 @@ function CompactImagesPreview(props) {
|
|
|
6596
7363
|
[currentSourceIndex, onChangeSource, imagesCount]
|
|
6597
7364
|
);
|
|
6598
7365
|
if (!sources.length || currentSourceIndex >= sources.length || typeof isMobile === "undefined")
|
|
6599
|
-
return /* @__PURE__ */ (0,
|
|
7366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6600
7367
|
"img",
|
|
6601
7368
|
{
|
|
6602
7369
|
className: "object-center",
|
|
@@ -6613,11 +7380,11 @@ function CompactImagesPreview(props) {
|
|
|
6613
7380
|
}
|
|
6614
7381
|
);
|
|
6615
7382
|
const currentSource = sources[currentSourceIndex];
|
|
6616
|
-
return /* @__PURE__ */ (0,
|
|
6617
|
-
/* @__PURE__ */ (0,
|
|
7383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { sizing: "layout", children: [
|
|
7384
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6618
7385
|
"img",
|
|
6619
7386
|
{
|
|
6620
|
-
className: (0,
|
|
7387
|
+
className: (0, import_clsx34.default)("object-center", onMainImageClick && "cursor-pointer"),
|
|
6621
7388
|
style: {
|
|
6622
7389
|
width: isMobile ? "100%" : activeImageWidth,
|
|
6623
7390
|
height: activeImageHeight,
|
|
@@ -6630,18 +7397,18 @@ function CompactImagesPreview(props) {
|
|
|
6630
7397
|
onClick: onMainImageClick
|
|
6631
7398
|
}
|
|
6632
7399
|
),
|
|
6633
|
-
/* @__PURE__ */ (0,
|
|
7400
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "flex flex-row flex-wrap items-center gap-3", children: sources.slice(0, 4).map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6634
7401
|
"button",
|
|
6635
7402
|
{
|
|
6636
7403
|
onClick: (e) => {
|
|
6637
7404
|
e.preventDefault();
|
|
6638
7405
|
handleThumbnailClick(index);
|
|
6639
7406
|
},
|
|
6640
|
-
className: (0,
|
|
7407
|
+
className: (0, import_clsx34.default)(
|
|
6641
7408
|
"cursor-pointer",
|
|
6642
7409
|
currentSourceIndex === index && enableThumbnailBorder ? "ring-2 ring-offset-2 ring-brand-400 transition-discrete duration-300" : "ring-brand-400/0"
|
|
6643
7410
|
),
|
|
6644
|
-
children: /* @__PURE__ */ (0,
|
|
7411
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
6645
7412
|
"img",
|
|
6646
7413
|
{
|
|
6647
7414
|
src: source.uri,
|
|
@@ -6662,31 +7429,31 @@ function CompactImagesPreview(props) {
|
|
|
6662
7429
|
}
|
|
6663
7430
|
|
|
6664
7431
|
// src/components/SimpleTable.tsx
|
|
6665
|
-
var
|
|
6666
|
-
var
|
|
7432
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
7433
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
6667
7434
|
function SimpleTable({
|
|
6668
7435
|
columns,
|
|
6669
7436
|
data,
|
|
6670
7437
|
additionalRows
|
|
6671
7438
|
}) {
|
|
6672
7439
|
const allRows = additionalRows && additionalRows.length > 0 ? [...data, ...additionalRows] : data;
|
|
6673
|
-
return /* @__PURE__ */ (0,
|
|
6674
|
-
/* @__PURE__ */ (0,
|
|
7440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Stack, { elevation: 4, rounded: true, overflowX: "hidden", overflowY: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("table", { className: "w-full border-collapse text-left text-sm border overflow-hidden rounded border-border-primary-normal", children: [
|
|
7441
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("tr", { className: "bg-background-primary-normal divide-x divide-border-primary-normal", children: columns.map((column, index) => {
|
|
6675
7442
|
var _a, _b;
|
|
6676
|
-
return /* @__PURE__ */ (0,
|
|
7443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6677
7444
|
"th",
|
|
6678
7445
|
{
|
|
6679
7446
|
scope: "col",
|
|
6680
|
-
className: (0,
|
|
7447
|
+
className: (0, import_clsx35.default)(
|
|
6681
7448
|
"p-mobile-layout-padding desktop:p-desktop-layout-padding font-semibold text-text-primary-normal",
|
|
6682
7449
|
((_a = column.meta) == null ? void 0 : _a.headerWidth) ? column.meta.headerWidth : "w-2/3"
|
|
6683
7450
|
),
|
|
6684
|
-
children: /* @__PURE__ */ (0,
|
|
7451
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Subheader, { children: (_b = column.header) == null ? void 0 : _b.toString() })
|
|
6685
7452
|
},
|
|
6686
7453
|
index
|
|
6687
7454
|
);
|
|
6688
7455
|
}) }) }),
|
|
6689
|
-
/* @__PURE__ */ (0,
|
|
7456
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("tbody", { children: allRows.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6690
7457
|
"tr",
|
|
6691
7458
|
{
|
|
6692
7459
|
className: "border-t border-border-primary-normal divide-x divide-border-primary-normal",
|
|
@@ -6694,10 +7461,10 @@ function SimpleTable({
|
|
|
6694
7461
|
var _a;
|
|
6695
7462
|
const rawValue = column.id ? row[column.id] : null;
|
|
6696
7463
|
const cellValue = rawValue != null ? rawValue : null;
|
|
6697
|
-
return /* @__PURE__ */ (0,
|
|
7464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
6698
7465
|
"td",
|
|
6699
7466
|
{
|
|
6700
|
-
className: (0,
|
|
7467
|
+
className: (0, import_clsx35.default)(
|
|
6701
7468
|
"p-mobile-layout-padding desktop:p-desktop-layout-padding align-middle text-text-primary-normal",
|
|
6702
7469
|
(_a = column.meta) == null ? void 0 : _a.headerWidth
|
|
6703
7470
|
),
|
|
@@ -6713,17 +7480,17 @@ function SimpleTable({
|
|
|
6713
7480
|
}
|
|
6714
7481
|
|
|
6715
7482
|
// src/components/PDFViewer/index.tsx
|
|
6716
|
-
var
|
|
7483
|
+
var import_react36 = require("react");
|
|
6717
7484
|
|
|
6718
7485
|
// src/components/PDFViewer/PDFElement.tsx
|
|
6719
7486
|
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
6720
|
-
var
|
|
7487
|
+
var import_react35 = require("react");
|
|
6721
7488
|
|
|
6722
7489
|
// src/components/Spinner.tsx
|
|
6723
|
-
var
|
|
7490
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
6724
7491
|
var Spinner = ({ size = "small", testid }) => {
|
|
6725
7492
|
const dimension = size === "large" ? 48 : 24;
|
|
6726
|
-
return /* @__PURE__ */ (0,
|
|
7493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
6727
7494
|
"svg",
|
|
6728
7495
|
{
|
|
6729
7496
|
"data-testid": testid,
|
|
@@ -6735,14 +7502,14 @@ var Spinner = ({ size = "small", testid }) => {
|
|
|
6735
7502
|
className: "spinner",
|
|
6736
7503
|
"aria-label": "Loading",
|
|
6737
7504
|
children: [
|
|
6738
|
-
/* @__PURE__ */ (0,
|
|
6739
|
-
/* @__PURE__ */ (0,
|
|
6740
|
-
/* @__PURE__ */ (0,
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6742
|
-
/* @__PURE__ */ (0,
|
|
6743
|
-
/* @__PURE__ */ (0,
|
|
6744
|
-
/* @__PURE__ */ (0,
|
|
6745
|
-
/* @__PURE__ */ (0,
|
|
7505
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
|
|
7506
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
|
|
7507
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
|
|
7508
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
|
|
7509
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
|
|
7510
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
|
|
7511
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
|
|
7512
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
|
|
6746
7513
|
]
|
|
6747
7514
|
}
|
|
6748
7515
|
);
|
|
@@ -6751,15 +7518,15 @@ Spinner.displayName = "Spinner";
|
|
|
6751
7518
|
|
|
6752
7519
|
// src/components/PDFViewer/PDFPage.tsx
|
|
6753
7520
|
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
6754
|
-
var
|
|
6755
|
-
var
|
|
7521
|
+
var import_react34 = require("react");
|
|
7522
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
6756
7523
|
function PdfPage({
|
|
6757
7524
|
file,
|
|
6758
7525
|
pageNumber,
|
|
6759
7526
|
testid,
|
|
6760
7527
|
isMobile
|
|
6761
7528
|
}) {
|
|
6762
|
-
const canvasRef = (0,
|
|
7529
|
+
const canvasRef = (0, import_react34.useRef)(null);
|
|
6763
7530
|
const { pdfDocument } = (0, import_react_pdf.usePdf)({
|
|
6764
7531
|
file,
|
|
6765
7532
|
page: pageNumber,
|
|
@@ -6768,7 +7535,7 @@ function PdfPage({
|
|
|
6768
7535
|
scale: isMobile ? 1 : 1.3
|
|
6769
7536
|
});
|
|
6770
7537
|
if (!pdfDocument) return null;
|
|
6771
|
-
return /* @__PURE__ */ (0,
|
|
7538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
6772
7539
|
"canvas",
|
|
6773
7540
|
{
|
|
6774
7541
|
ref: canvasRef,
|
|
@@ -6779,8 +7546,8 @@ function PdfPage({
|
|
|
6779
7546
|
}
|
|
6780
7547
|
|
|
6781
7548
|
// src/components/PDFViewer/PDFElement.tsx
|
|
6782
|
-
var
|
|
6783
|
-
var
|
|
7549
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
7550
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
6784
7551
|
function PDFElement({
|
|
6785
7552
|
b64,
|
|
6786
7553
|
testid,
|
|
@@ -6788,7 +7555,7 @@ function PDFElement({
|
|
|
6788
7555
|
error
|
|
6789
7556
|
}) {
|
|
6790
7557
|
var _a;
|
|
6791
|
-
const canvasRef = (0,
|
|
7558
|
+
const canvasRef = (0, import_react35.useRef)(null);
|
|
6792
7559
|
const { pdfDocument } = (0, import_react_pdf2.usePdf)({
|
|
6793
7560
|
file: `data:application/pdf;base64,${b64}`,
|
|
6794
7561
|
workerSrc: "/scripts/pdf.worker.min.mjs",
|
|
@@ -6796,7 +7563,7 @@ function PDFElement({
|
|
|
6796
7563
|
canvasRef
|
|
6797
7564
|
});
|
|
6798
7565
|
const pagesArr = new Array((_a = pdfDocument == null ? void 0 : pdfDocument.numPages) != null ? _a : 1).fill(null);
|
|
6799
|
-
return /* @__PURE__ */ (0,
|
|
7566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6800
7567
|
"div",
|
|
6801
7568
|
{
|
|
6802
7569
|
className: "flex flex-col space-y-4",
|
|
@@ -6804,14 +7571,14 @@ function PDFElement({
|
|
|
6804
7571
|
minHeight: 871,
|
|
6805
7572
|
minWidth: 654
|
|
6806
7573
|
} : void 0,
|
|
6807
|
-
children: !!pdfDocument && !!b64 && !error ? /* @__PURE__ */ (0,
|
|
7574
|
+
children: !!pdfDocument && !!b64 && !error ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Stack, { sizing: "layout-group", children: pagesArr.length > 1 ? pagesArr.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6808
7575
|
"div",
|
|
6809
7576
|
{
|
|
6810
|
-
className: (0,
|
|
7577
|
+
className: (0, import_clsx36.default)(
|
|
6811
7578
|
"flex justify-center border-border-primary-normal",
|
|
6812
7579
|
isMobile ? "border-0" : "border"
|
|
6813
7580
|
),
|
|
6814
|
-
children: /* @__PURE__ */ (0,
|
|
7581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6815
7582
|
PdfPage,
|
|
6816
7583
|
{
|
|
6817
7584
|
testid: testid ? `${testid}-pdf_page_${i + 1}` : void 0,
|
|
@@ -6821,14 +7588,14 @@ function PDFElement({
|
|
|
6821
7588
|
)
|
|
6822
7589
|
},
|
|
6823
7590
|
`${testid}-pdf-page-${i + 1}`
|
|
6824
|
-
)) : /* @__PURE__ */ (0,
|
|
7591
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6825
7592
|
"div",
|
|
6826
7593
|
{
|
|
6827
|
-
className: (0,
|
|
7594
|
+
className: (0, import_clsx36.default)(
|
|
6828
7595
|
"flex justify-center border-border-primary-normal",
|
|
6829
7596
|
isMobile ? "border-0" : "border"
|
|
6830
7597
|
),
|
|
6831
|
-
children: /* @__PURE__ */ (0,
|
|
7598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6832
7599
|
"canvas",
|
|
6833
7600
|
{
|
|
6834
7601
|
"data-testid": testid ? `${testid}-pdf-content` : void 0,
|
|
@@ -6837,7 +7604,7 @@ function PDFElement({
|
|
|
6837
7604
|
}
|
|
6838
7605
|
)
|
|
6839
7606
|
}
|
|
6840
|
-
) }) : /* @__PURE__ */ (0,
|
|
7607
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
6841
7608
|
Stack,
|
|
6842
7609
|
{
|
|
6843
7610
|
justify: "center",
|
|
@@ -6845,7 +7612,7 @@ function PDFElement({
|
|
|
6845
7612
|
height: "full",
|
|
6846
7613
|
flexGrow: 1,
|
|
6847
7614
|
"data-testid": testid ? `${testid}-pdf-${error ? "error" : "loading"}` : void 0,
|
|
6848
|
-
children: error ? error : /* @__PURE__ */ (0,
|
|
7615
|
+
children: error ? error : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Spinner, { size: "large" })
|
|
6849
7616
|
}
|
|
6850
7617
|
)
|
|
6851
7618
|
}
|
|
@@ -6853,26 +7620,26 @@ function PDFElement({
|
|
|
6853
7620
|
}
|
|
6854
7621
|
|
|
6855
7622
|
// src/components/PDFViewer/DownloadIcon.tsx
|
|
6856
|
-
var
|
|
7623
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
6857
7624
|
function DownloadIcon({
|
|
6858
7625
|
onClick,
|
|
6859
7626
|
isDownloading,
|
|
6860
7627
|
testid
|
|
6861
7628
|
}) {
|
|
6862
|
-
return /* @__PURE__ */ (0,
|
|
7629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
6863
7630
|
Button,
|
|
6864
7631
|
{
|
|
6865
7632
|
testid,
|
|
6866
7633
|
iconOnly: true,
|
|
6867
7634
|
variant: "tertiary",
|
|
6868
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7635
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: isDownloading ? "cached" : "download" }),
|
|
6869
7636
|
onClick
|
|
6870
7637
|
}
|
|
6871
7638
|
);
|
|
6872
7639
|
}
|
|
6873
7640
|
|
|
6874
7641
|
// src/components/PDFViewer/PDFNavigation.tsx
|
|
6875
|
-
var
|
|
7642
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
6876
7643
|
function PdfNavigation({
|
|
6877
7644
|
currentIndex,
|
|
6878
7645
|
total,
|
|
@@ -6884,7 +7651,7 @@ function PdfNavigation({
|
|
|
6884
7651
|
testid,
|
|
6885
7652
|
fileName
|
|
6886
7653
|
}) {
|
|
6887
|
-
return /* @__PURE__ */ (0,
|
|
7654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
6888
7655
|
Stack,
|
|
6889
7656
|
{
|
|
6890
7657
|
horizontal: true,
|
|
@@ -6893,44 +7660,44 @@ function PdfNavigation({
|
|
|
6893
7660
|
sizing: "layout-group",
|
|
6894
7661
|
testid: testid ? `${testid}-pdf-navigation` : void 0,
|
|
6895
7662
|
children: [
|
|
6896
|
-
/* @__PURE__ */ (0,
|
|
6897
|
-
/* @__PURE__ */ (0,
|
|
7663
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { horizontal: true, items: "center", children: [
|
|
7664
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6898
7665
|
Button,
|
|
6899
7666
|
{
|
|
6900
7667
|
iconOnly: true,
|
|
6901
7668
|
variant: "tertiary",
|
|
6902
7669
|
onClick: onPrev,
|
|
6903
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
7670
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "chevron_backward" }),
|
|
6904
7671
|
disabled: disablePrev,
|
|
6905
7672
|
testid: testid ? `${testid}-pdf-file-previous-button` : void 0
|
|
6906
7673
|
}
|
|
6907
7674
|
),
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Heading3, { className: "text-text-primary-normal whitespace-nowrap", children: [
|
|
6909
7676
|
currentIndex + 1,
|
|
6910
7677
|
" / ",
|
|
6911
7678
|
total
|
|
6912
7679
|
] }),
|
|
6913
|
-
/* @__PURE__ */ (0,
|
|
7680
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
6914
7681
|
Button,
|
|
6915
7682
|
{
|
|
6916
7683
|
iconOnly: true,
|
|
6917
7684
|
variant: "tertiary",
|
|
6918
7685
|
onClick: onNext,
|
|
6919
|
-
rightIcon: /* @__PURE__ */ (0,
|
|
7686
|
+
rightIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "chevron_forward" }),
|
|
6920
7687
|
disabled: disableNext,
|
|
6921
7688
|
testid: testid ? `${testid}-pdf-file-next-button` : void 0
|
|
6922
7689
|
}
|
|
6923
7690
|
),
|
|
6924
|
-
/* @__PURE__ */ (0,
|
|
7691
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Paragraph, { children: (fileName == null ? void 0 : fileName.endsWith(".pdf")) ? fileName : `${fileName}.pdf` })
|
|
6925
7692
|
] }),
|
|
6926
|
-
extraActions && /* @__PURE__ */ (0,
|
|
7693
|
+
extraActions && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex items-center gap-2", children: extraActions })
|
|
6927
7694
|
]
|
|
6928
7695
|
}
|
|
6929
7696
|
) });
|
|
6930
7697
|
}
|
|
6931
7698
|
|
|
6932
7699
|
// src/components/PDFViewer/index.tsx
|
|
6933
|
-
var
|
|
7700
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
6934
7701
|
function PDFViewer(props) {
|
|
6935
7702
|
const {
|
|
6936
7703
|
isOpen,
|
|
@@ -6944,9 +7711,9 @@ function PDFViewer(props) {
|
|
|
6944
7711
|
withPagination = true,
|
|
6945
7712
|
error
|
|
6946
7713
|
} = props;
|
|
6947
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
6948
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
6949
|
-
const handleDownload = (0,
|
|
7714
|
+
const [currentIndex, setCurrentIndex] = (0, import_react36.useState)(0);
|
|
7715
|
+
const [isDownloading, setIsDownloading] = (0, import_react36.useState)(false);
|
|
7716
|
+
const handleDownload = (0, import_react36.useCallback)(() => {
|
|
6950
7717
|
setIsDownloading(true);
|
|
6951
7718
|
const link = document.createElement("a");
|
|
6952
7719
|
const currentPdf = encodedPdfs[currentIndex];
|
|
@@ -6977,7 +7744,7 @@ function PDFViewer(props) {
|
|
|
6977
7744
|
setIsDownloading(false);
|
|
6978
7745
|
onClose();
|
|
6979
7746
|
}
|
|
6980
|
-
return /* @__PURE__ */ (0,
|
|
7747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6981
7748
|
Modal,
|
|
6982
7749
|
{
|
|
6983
7750
|
testid,
|
|
@@ -6986,7 +7753,7 @@ function PDFViewer(props) {
|
|
|
6986
7753
|
onClose: handleClose,
|
|
6987
7754
|
noWrapper: true,
|
|
6988
7755
|
showButtons: isMobile && customFooter ? !!customActions : !!encodedPdfs.length,
|
|
6989
|
-
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ (0,
|
|
7756
|
+
customActions: !!encodedPdfs.length && !isMobile && withPagination ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
6990
7757
|
PdfNavigation,
|
|
6991
7758
|
{
|
|
6992
7759
|
testid,
|
|
@@ -7002,7 +7769,7 @@ function PDFViewer(props) {
|
|
|
7002
7769
|
) : customActions,
|
|
7003
7770
|
fixedHeightScrolling: true,
|
|
7004
7771
|
headerIconAlign: "right",
|
|
7005
|
-
headerIcon: !isMobile ? /* @__PURE__ */ (0,
|
|
7772
|
+
headerIcon: !isMobile ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7006
7773
|
DownloadIcon,
|
|
7007
7774
|
{
|
|
7008
7775
|
testid: testid ? `${testid}-download-icon` : void 0,
|
|
@@ -7013,7 +7780,7 @@ function PDFViewer(props) {
|
|
|
7013
7780
|
title: isMobile ? title != null ? title : encodedPdfs[currentIndex].fileName : void 0,
|
|
7014
7781
|
size: isMobile ? "screen" : "large",
|
|
7015
7782
|
headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
|
|
7016
|
-
children: /* @__PURE__ */ (0,
|
|
7783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
7017
7784
|
PDFElement,
|
|
7018
7785
|
{
|
|
7019
7786
|
testid,
|
|
@@ -7027,9 +7794,9 @@ function PDFViewer(props) {
|
|
|
7027
7794
|
}
|
|
7028
7795
|
|
|
7029
7796
|
// src/components/ListGroup.tsx
|
|
7030
|
-
var
|
|
7031
|
-
var
|
|
7032
|
-
var
|
|
7797
|
+
var import_react37 = require("react");
|
|
7798
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
7799
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7033
7800
|
function ListGroup({
|
|
7034
7801
|
title,
|
|
7035
7802
|
defaultOpen = false,
|
|
@@ -7040,7 +7807,7 @@ function ListGroup({
|
|
|
7040
7807
|
className,
|
|
7041
7808
|
children
|
|
7042
7809
|
}) {
|
|
7043
|
-
const [uncontrolledOpen, setUncontrolledOpen] = (0,
|
|
7810
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react37.useState)(defaultOpen);
|
|
7044
7811
|
const isControlled = controlledOpen !== void 0;
|
|
7045
7812
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
7046
7813
|
const toggle = () => {
|
|
@@ -7049,24 +7816,24 @@ function ListGroup({
|
|
|
7049
7816
|
if (!isControlled) setUncontrolledOpen(next);
|
|
7050
7817
|
onToggle == null ? void 0 : onToggle(next);
|
|
7051
7818
|
};
|
|
7052
|
-
return /* @__PURE__ */ (0,
|
|
7053
|
-
/* @__PURE__ */ (0,
|
|
7819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { "data-testid": testid, className: (0, import_clsx37.default)("rounded-sm", className), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Stack, { sizing: "layout", noGap: true, children: [
|
|
7820
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
7054
7821
|
"button",
|
|
7055
7822
|
{
|
|
7056
7823
|
type: "button",
|
|
7057
7824
|
onClick: toggle,
|
|
7058
|
-
className: (0,
|
|
7825
|
+
className: (0, import_clsx37.default)(
|
|
7059
7826
|
"w-full flex items-center justify-between text-left",
|
|
7060
7827
|
disabled && "opacity-50 cursor-not-allowed"
|
|
7061
7828
|
),
|
|
7062
7829
|
"aria-expanded": isOpen,
|
|
7063
7830
|
children: [
|
|
7064
|
-
/* @__PURE__ */ (0,
|
|
7065
|
-
/* @__PURE__ */ (0,
|
|
7831
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Label, { children: title }),
|
|
7832
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
7066
7833
|
Icon,
|
|
7067
7834
|
{
|
|
7068
7835
|
name: "expand_more",
|
|
7069
|
-
className: (0,
|
|
7836
|
+
className: (0, import_clsx37.default)(
|
|
7070
7837
|
"transition-transform duration-200",
|
|
7071
7838
|
isOpen ? "rotate-180" : "rotate-0"
|
|
7072
7839
|
)
|
|
@@ -7075,14 +7842,14 @@ function ListGroup({
|
|
|
7075
7842
|
]
|
|
7076
7843
|
}
|
|
7077
7844
|
),
|
|
7078
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7845
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Stack, { sizing: "layout", paddingTop: true, children })
|
|
7079
7846
|
] }) });
|
|
7080
7847
|
}
|
|
7081
7848
|
|
|
7082
7849
|
// src/components/Pagination.tsx
|
|
7083
|
-
var
|
|
7084
|
-
var
|
|
7085
|
-
var
|
|
7850
|
+
var import_react38 = require("react");
|
|
7851
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
7852
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7086
7853
|
var Pagination = ({
|
|
7087
7854
|
totalPages,
|
|
7088
7855
|
currentPage,
|
|
@@ -7092,7 +7859,7 @@ var Pagination = ({
|
|
|
7092
7859
|
className,
|
|
7093
7860
|
disabled
|
|
7094
7861
|
}) => {
|
|
7095
|
-
const goTo = (0,
|
|
7862
|
+
const goTo = (0, import_react38.useCallback)(
|
|
7096
7863
|
(page) => {
|
|
7097
7864
|
if (disabled) return;
|
|
7098
7865
|
onPageChange(page);
|
|
@@ -7109,7 +7876,7 @@ var Pagination = ({
|
|
|
7109
7876
|
goTo(currentPage + 1);
|
|
7110
7877
|
}
|
|
7111
7878
|
};
|
|
7112
|
-
const pageTokens = (0,
|
|
7879
|
+
const pageTokens = (0, import_react38.useMemo)(() => {
|
|
7113
7880
|
if (totalPages <= 5) {
|
|
7114
7881
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
7115
7882
|
}
|
|
@@ -7146,7 +7913,7 @@ var Pagination = ({
|
|
|
7146
7913
|
return tokens;
|
|
7147
7914
|
}, [totalPages, currentPage]);
|
|
7148
7915
|
if (totalPages <= 1) return null;
|
|
7149
|
-
const buttonClass = (0,
|
|
7916
|
+
const buttonClass = (0, import_clsx38.default)(
|
|
7150
7917
|
"cursor-pointer disabled:cursor-default",
|
|
7151
7918
|
paddingUsingComponentGap,
|
|
7152
7919
|
"w-8 h-8",
|
|
@@ -7157,14 +7924,14 @@ var Pagination = ({
|
|
|
7157
7924
|
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
7158
7925
|
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
7159
7926
|
);
|
|
7160
|
-
return /* @__PURE__ */ (0,
|
|
7927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
7161
7928
|
"nav",
|
|
7162
7929
|
{
|
|
7163
7930
|
id,
|
|
7164
7931
|
"data-testid": testid,
|
|
7165
7932
|
"aria-label": "Pagination",
|
|
7166
7933
|
onKeyDown: handleKey,
|
|
7167
|
-
className: (0,
|
|
7934
|
+
className: (0, import_clsx38.default)(
|
|
7168
7935
|
"flex items-center",
|
|
7169
7936
|
"border border-border-primary-normal",
|
|
7170
7937
|
"bg-background-grouped-primary-normal",
|
|
@@ -7172,19 +7939,19 @@ var Pagination = ({
|
|
|
7172
7939
|
className
|
|
7173
7940
|
),
|
|
7174
7941
|
children: [
|
|
7175
|
-
/* @__PURE__ */ (0,
|
|
7942
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7176
7943
|
"button",
|
|
7177
7944
|
{
|
|
7178
7945
|
disabled: disabled || currentPage <= 1,
|
|
7179
7946
|
"aria-label": "Previous page",
|
|
7180
7947
|
onClick: () => goTo(currentPage - 1),
|
|
7181
|
-
className: (0,
|
|
7182
|
-
children: /* @__PURE__ */ (0,
|
|
7948
|
+
className: (0, import_clsx38.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
7949
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
7183
7950
|
}
|
|
7184
7951
|
),
|
|
7185
|
-
/* @__PURE__ */ (0,
|
|
7952
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("ul", { className: (0, import_clsx38.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
7186
7953
|
if (token === "ellipsis") {
|
|
7187
|
-
return /* @__PURE__ */ (0,
|
|
7954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7188
7955
|
"li",
|
|
7189
7956
|
{
|
|
7190
7957
|
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
@@ -7194,29 +7961,29 @@ var Pagination = ({
|
|
|
7194
7961
|
);
|
|
7195
7962
|
}
|
|
7196
7963
|
const selected = token === currentPage;
|
|
7197
|
-
return /* @__PURE__ */ (0,
|
|
7964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7198
7965
|
"button",
|
|
7199
7966
|
{
|
|
7200
7967
|
"aria-label": `Page ${token}`,
|
|
7201
7968
|
"aria-current": selected ? "page" : void 0,
|
|
7202
7969
|
disabled,
|
|
7203
7970
|
onClick: () => goTo(token),
|
|
7204
|
-
className: (0,
|
|
7971
|
+
className: (0, import_clsx38.default)(
|
|
7205
7972
|
buttonClass,
|
|
7206
7973
|
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
7207
7974
|
),
|
|
7208
|
-
children: /* @__PURE__ */ (0,
|
|
7975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
7209
7976
|
}
|
|
7210
7977
|
) }, token);
|
|
7211
7978
|
}) }),
|
|
7212
|
-
/* @__PURE__ */ (0,
|
|
7979
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
7213
7980
|
"button",
|
|
7214
7981
|
{
|
|
7215
7982
|
disabled: disabled || currentPage >= totalPages,
|
|
7216
7983
|
"aria-label": "Next page",
|
|
7217
7984
|
onClick: () => goTo(currentPage + 1),
|
|
7218
|
-
className: (0,
|
|
7219
|
-
children: /* @__PURE__ */ (0,
|
|
7985
|
+
className: (0, import_clsx38.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
7986
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
7220
7987
|
}
|
|
7221
7988
|
)
|
|
7222
7989
|
]
|
|
@@ -7226,12 +7993,12 @@ var Pagination = ({
|
|
|
7226
7993
|
Pagination.displayName = "Pagination";
|
|
7227
7994
|
|
|
7228
7995
|
// src/components/SkeletonParagraph.tsx
|
|
7229
|
-
var
|
|
7996
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7230
7997
|
function SkeletonParagraph({
|
|
7231
7998
|
className = "",
|
|
7232
7999
|
heightClassName = "h-6"
|
|
7233
8000
|
}) {
|
|
7234
|
-
return /* @__PURE__ */ (0,
|
|
8001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7235
8002
|
"div",
|
|
7236
8003
|
{
|
|
7237
8004
|
"aria-label": "Loading content",
|
|
@@ -7242,9 +8009,9 @@ function SkeletonParagraph({
|
|
|
7242
8009
|
}
|
|
7243
8010
|
|
|
7244
8011
|
// src/components/EmptyCartIcon.tsx
|
|
7245
|
-
var
|
|
8012
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7246
8013
|
function EmptyCartIcon() {
|
|
7247
|
-
return /* @__PURE__ */ (0,
|
|
8014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
7248
8015
|
"svg",
|
|
7249
8016
|
{
|
|
7250
8017
|
width: "211",
|
|
@@ -7252,7 +8019,7 @@ function EmptyCartIcon() {
|
|
|
7252
8019
|
viewBox: "0 0 211 196",
|
|
7253
8020
|
fill: "none",
|
|
7254
8021
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7255
|
-
children: /* @__PURE__ */ (0,
|
|
8022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
7256
8023
|
"path",
|
|
7257
8024
|
{
|
|
7258
8025
|
"fill-rule": "evenodd",
|
|
@@ -7264,9 +8031,90 @@ function EmptyCartIcon() {
|
|
|
7264
8031
|
}
|
|
7265
8032
|
);
|
|
7266
8033
|
}
|
|
8034
|
+
|
|
8035
|
+
// src/components/Alert.tsx
|
|
8036
|
+
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
8037
|
+
var import_react39 = require("react");
|
|
8038
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
8039
|
+
function Alert(_a) {
|
|
8040
|
+
var _b = _a, {
|
|
8041
|
+
id,
|
|
8042
|
+
testId,
|
|
8043
|
+
variant,
|
|
8044
|
+
title,
|
|
8045
|
+
message,
|
|
8046
|
+
dismissible = false,
|
|
8047
|
+
onClose
|
|
8048
|
+
} = _b, rest = __objRest(_b, [
|
|
8049
|
+
"id",
|
|
8050
|
+
"testId",
|
|
8051
|
+
"variant",
|
|
8052
|
+
"title",
|
|
8053
|
+
"message",
|
|
8054
|
+
"dismissible",
|
|
8055
|
+
"onClose"
|
|
8056
|
+
]);
|
|
8057
|
+
const isError = variant === "error";
|
|
8058
|
+
const handleClose = (0, import_react39.useCallback)(() => {
|
|
8059
|
+
if (onClose) onClose();
|
|
8060
|
+
}, [onClose]);
|
|
8061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
8062
|
+
Stack,
|
|
8063
|
+
__spreadProps(__spreadValues({
|
|
8064
|
+
id,
|
|
8065
|
+
"data-testid": testId,
|
|
8066
|
+
sizing: "container",
|
|
8067
|
+
backgroundColor: "background-grouped-primary-normal",
|
|
8068
|
+
borderColor: "border-primary-normal",
|
|
8069
|
+
items: "start",
|
|
8070
|
+
elevation: 4,
|
|
8071
|
+
rounded: true,
|
|
8072
|
+
padding: true,
|
|
8073
|
+
horizontal: true,
|
|
8074
|
+
horizontalMobile: true
|
|
8075
|
+
}, rest), {
|
|
8076
|
+
children: [
|
|
8077
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8078
|
+
"div",
|
|
8079
|
+
{
|
|
8080
|
+
className: (0, import_clsx39.default)("min-w-[2px] min-h-full flex", {
|
|
8081
|
+
"bg-background-critical-normal": isError,
|
|
8082
|
+
"bg-background-warning-normal": !isError
|
|
8083
|
+
})
|
|
8084
|
+
}
|
|
8085
|
+
),
|
|
8086
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8087
|
+
"span",
|
|
8088
|
+
{
|
|
8089
|
+
className: (0, import_clsx39.default)({
|
|
8090
|
+
"text-icon-critical-normal": isError,
|
|
8091
|
+
"text-icon-warning-normal": !isError
|
|
8092
|
+
}),
|
|
8093
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "warning" })
|
|
8094
|
+
}
|
|
8095
|
+
),
|
|
8096
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Stack, { flexGrow: 1, sizing: "component", children: [
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Heading2, { children: title }),
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Paragraph, { children: message })
|
|
8099
|
+
] }),
|
|
8100
|
+
dismissible && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
8101
|
+
Button,
|
|
8102
|
+
{
|
|
8103
|
+
"aria-label": "Dismiss alert",
|
|
8104
|
+
iconOnly: true,
|
|
8105
|
+
variant: "tertiary",
|
|
8106
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Icon, { name: "close" }),
|
|
8107
|
+
onClick: handleClose
|
|
8108
|
+
}
|
|
8109
|
+
)
|
|
8110
|
+
]
|
|
8111
|
+
})
|
|
8112
|
+
);
|
|
8113
|
+
}
|
|
7267
8114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7268
8115
|
0 && (module.exports = {
|
|
7269
8116
|
Accordion,
|
|
8117
|
+
Alert,
|
|
7270
8118
|
Button,
|
|
7271
8119
|
Card,
|
|
7272
8120
|
Checkbox,
|
|
@@ -7274,6 +8122,7 @@ function EmptyCartIcon() {
|
|
|
7274
8122
|
DataCellHeader,
|
|
7275
8123
|
DataGrid,
|
|
7276
8124
|
DataGridCell,
|
|
8125
|
+
DateInput,
|
|
7277
8126
|
DragAlongCell,
|
|
7278
8127
|
DraggableCellHeader,
|
|
7279
8128
|
EmptyCartIcon,
|