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