@dmsi/wedgekit-react 0.0.231 → 0.0.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{chunk-A76MF7ZO.js → chunk-3M23BFB4.js} +2 -2
  2. package/dist/chunk-SQJ7MWY7.js +493 -0
  3. package/dist/chunk-VZVPD3XK.js +1182 -0
  4. package/dist/components/CalendarRange.cjs +4066 -224
  5. package/dist/components/CalendarRange.css +4831 -0
  6. package/dist/components/CalendarRange.js +23 -1
  7. package/dist/components/DateInput.cjs +3668 -326
  8. package/dist/components/DateInput.css +4831 -0
  9. package/dist/components/DateInput.js +20 -3
  10. package/dist/components/DateRangeInput.cjs +3668 -326
  11. package/dist/components/DateRangeInput.css +4831 -0
  12. package/dist/components/DateRangeInput.js +20 -3
  13. package/dist/components/FilterGroup.js +5 -5
  14. package/dist/components/MobileDataGrid.js +3 -3
  15. package/dist/components/Modal.js +4 -4
  16. package/dist/components/ModalButtons.js +2 -2
  17. package/dist/components/ModalHeader.js +2 -2
  18. package/dist/components/NavigationTab.js +2 -2
  19. package/dist/components/NavigationTabs.js +2 -2
  20. package/dist/components/Notification.js +3 -3
  21. package/dist/components/OptionPill.js +2 -2
  22. package/dist/components/PDFViewer.js +6 -6
  23. package/dist/components/Stepper.js +3 -3
  24. package/dist/components/Toast.js +3 -3
  25. package/dist/components/Upload.js +3 -3
  26. package/dist/components/index.css +3 -0
  27. package/dist/components/index.js +8 -1138
  28. package/dist/index.css +3 -0
  29. package/package.json +1 -1
  30. package/src/components/CalendarRange.tsx +316 -165
  31. package/dist/chunk-SE5DM2IJ.js +0 -350
  32. package/dist/{chunk-ED7FXZRX.js → chunk-BW2MWMVM.js} +3 -3
  33. package/dist/{chunk-FYW64H7N.js → chunk-JFPRYMID.js} +3 -3
  34. package/dist/{chunk-A5ROZWIH.js → chunk-R4H6D4SZ.js} +3 -3
  35. package/dist/{chunk-47KTDBGA.js → chunk-T7UCZWWK.js} +3 -3
@@ -64,7 +64,7 @@ __export(CalendarRange_exports, {
64
64
  isWeekend: () => isWeekend
65
65
  });
66
66
  module.exports = __toCommonJS(CalendarRange_exports);
67
- var import_clsx3 = __toESM(require("clsx"), 1);
67
+ var import_clsx22 = __toESM(require("clsx"), 1);
68
68
 
69
69
  // src/classNames.ts
70
70
  var import_clsx = __toESM(require("clsx"), 1);
@@ -125,112 +125,3817 @@ var typography = {
125
125
  "leading-caption-mobile desktop:leading-caption-desktop"
126
126
  )
127
127
  };
128
- var baseTransition = (0, import_clsx.default)(
129
- "transition-colors duration-100 ease-in-out"
130
- );
131
- var componentGap = (0, import_clsx.default)(
132
- "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
133
- );
134
- var paddingUsingComponentGap = (0, import_clsx.default)(
135
- "p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
136
- );
137
- var paddingXUsingLayoutGroupGap = (0, import_clsx.default)(
138
- "px-mobile-layout-group-gap desktop:px-desktop-layout-group-gap compact:px-desktop-compact-layout-group-gap"
139
- );
140
- var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
141
- "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
142
- );
143
- var componentPadding = (0, import_clsx.default)(
144
- "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
145
- );
146
- var componentPaddingBottom = (0, import_clsx.default)(
147
- "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
148
- );
149
- var componentPaddingX = (0, import_clsx.default)(
150
- "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding"
151
- );
152
- var componentPaddingY = (0, import_clsx.default)(
153
- "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
154
- );
155
- var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
156
- "px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
157
- );
158
- var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
159
- "py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
160
- );
161
- var componentPaddingMinusBorder = (0, import_clsx.default)(
162
- "p-[calc(var(--spacing-mobile-component-padding)_-_1px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_1px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_1px)]"
163
- );
164
- var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
165
- "p-[calc(var(--spacing-mobile-component-padding)_-_2px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_2px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_2px)]"
166
- );
167
- var layoutPaddding = (0, import_clsx.default)(
168
- "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding"
169
- );
170
- var layoutPaddingBottom = (0, import_clsx.default)(
171
- "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
172
- );
173
- var layoutPaddingY = (0, import_clsx.default)(
174
- "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
175
- );
176
- var containerPaddingX = (0, import_clsx.default)(
177
- "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
178
- );
179
- var containerPaddingY = (0, import_clsx.default)(
180
- "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
181
- );
182
- var layoutGroupGapPaddingY = (0, import_clsx.default)(
183
- "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
184
- );
185
- var layoutGroupGap = (0, import_clsx.default)(
186
- "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
187
- );
188
- var layoutGap = (0, import_clsx.default)(
189
- "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
190
- );
191
- var gapUsingContainerPadding = (0, import_clsx.default)(
192
- "gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
193
- );
128
+ var baseTransition = (0, import_clsx.default)(
129
+ "transition-colors duration-100 ease-in-out"
130
+ );
131
+ var componentGap = (0, import_clsx.default)(
132
+ "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
133
+ );
134
+ var paddingUsingComponentGap = (0, import_clsx.default)(
135
+ "p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
136
+ );
137
+ var paddingXUsingLayoutGroupGap = (0, import_clsx.default)(
138
+ "px-mobile-layout-group-gap desktop:px-desktop-layout-group-gap compact:px-desktop-compact-layout-group-gap"
139
+ );
140
+ var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
141
+ "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
142
+ );
143
+ var componentPadding = (0, import_clsx.default)(
144
+ "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
145
+ );
146
+ var componentPaddingBottom = (0, import_clsx.default)(
147
+ "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
148
+ );
149
+ var componentPaddingX = (0, import_clsx.default)(
150
+ "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding"
151
+ );
152
+ var componentPaddingY = (0, import_clsx.default)(
153
+ "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
154
+ );
155
+ var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
156
+ "px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
157
+ );
158
+ var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
159
+ "py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
160
+ );
161
+ var componentPaddingMinusBorder = (0, import_clsx.default)(
162
+ "p-[calc(var(--spacing-mobile-component-padding)_-_1px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_1px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_1px)]"
163
+ );
164
+ var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
165
+ "p-[calc(var(--spacing-mobile-component-padding)_-_2px)] desktop:p-[calc(var(--spacing-desktop-component-padding)_-_2px)] compact:p-[calc(var(--spacing-desktop-compact-component-padding)_-_2px)]"
166
+ );
167
+ var layoutPaddding = (0, import_clsx.default)(
168
+ "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding"
169
+ );
170
+ var layoutPaddingBottom = (0, import_clsx.default)(
171
+ "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
172
+ );
173
+ var layoutPaddingY = (0, import_clsx.default)(
174
+ "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
175
+ );
176
+ var containerPaddingX = (0, import_clsx.default)(
177
+ "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
178
+ );
179
+ var containerPaddingY = (0, import_clsx.default)(
180
+ "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
181
+ );
182
+ var layoutGroupGapPaddingY = (0, import_clsx.default)(
183
+ "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
184
+ );
185
+ var layoutGroupGap = (0, import_clsx.default)(
186
+ "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
187
+ );
188
+ var layoutGap = (0, import_clsx.default)(
189
+ "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
190
+ );
191
+ var gapUsingContainerPadding = (0, import_clsx.default)(
192
+ "gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
193
+ );
194
+
195
+ // src/components/Icon.tsx
196
+ var import_clsx2 = __toESM(require("clsx"), 1);
197
+ var import_jsx_runtime = require("react/jsx-runtime");
198
+ function Icon(_a) {
199
+ var _b = _a, {
200
+ name,
201
+ size = 24,
202
+ variant = "outline",
203
+ testid
204
+ } = _b, props = __objRest(_b, [
205
+ "name",
206
+ "size",
207
+ "variant",
208
+ "testid"
209
+ ]);
210
+ const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
211
+ const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
212
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
213
+ "span",
214
+ __spreadProps(__spreadValues({}, props), {
215
+ "data-testid": testid,
216
+ className: (0, import_clsx2.default)(
217
+ "icon",
218
+ `icon-${size}`,
219
+ // size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
220
+ props.className
221
+ ),
222
+ style: __spreadValues({
223
+ fontVariationSettings: variantStyle + `, ${weightStyle}`
224
+ }, props.style),
225
+ children: name
226
+ })
227
+ );
228
+ }
229
+
230
+ // src/components/CalendarRange.tsx
231
+ var import_react19 = __toESM(require("react"), 1);
232
+ var import_polyfill = require("@js-temporal/polyfill");
233
+
234
+ // src/components/DataGridCell.tsx
235
+ var import_sortable = require("@dnd-kit/sortable");
236
+
237
+ // ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
238
+ var import_react = require("react");
239
+ var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
240
+ var CSS = /* @__PURE__ */ Object.freeze({
241
+ Translate: {
242
+ toString(transform) {
243
+ if (!transform) {
244
+ return;
245
+ }
246
+ const {
247
+ x,
248
+ y
249
+ } = transform;
250
+ return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
251
+ }
252
+ },
253
+ Scale: {
254
+ toString(transform) {
255
+ if (!transform) {
256
+ return;
257
+ }
258
+ const {
259
+ scaleX,
260
+ scaleY
261
+ } = transform;
262
+ return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
263
+ }
264
+ },
265
+ Transform: {
266
+ toString(transform) {
267
+ if (!transform) {
268
+ return;
269
+ }
270
+ return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
271
+ }
272
+ },
273
+ Transition: {
274
+ toString(_ref) {
275
+ let {
276
+ property,
277
+ duration,
278
+ easing
279
+ } = _ref;
280
+ return property + " " + duration + "ms " + easing;
281
+ }
282
+ }
283
+ });
284
+
285
+ // src/components/DataGridCell.tsx
286
+ var import_clsx8 = __toESM(require("clsx"), 1);
287
+ var import_react11 = require("react");
288
+
289
+ // src/components/MenuOption.tsx
290
+ var import_clsx5 = __toESM(require("clsx"), 1);
291
+ var import_react6 = require("react");
292
+
293
+ // src/components/Label.tsx
294
+ var import_clsx3 = __toESM(require("clsx"), 1);
295
+ var import_jsx_runtime2 = require("react/jsx-runtime");
296
+ var Label = (_a) => {
297
+ var _b = _a, {
298
+ as = "span",
299
+ padded,
300
+ className,
301
+ color,
302
+ align,
303
+ id,
304
+ testid
305
+ } = _b, props = __objRest(_b, [
306
+ "as",
307
+ "padded",
308
+ "className",
309
+ "color",
310
+ "align",
311
+ "id",
312
+ "testid"
313
+ ]);
314
+ const Element = as;
315
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
316
+ Element,
317
+ __spreadProps(__spreadValues({
318
+ id,
319
+ "data-testid": testid,
320
+ className: (0, import_clsx3.default)(
321
+ typography.label,
322
+ align === "left" && "text-left",
323
+ align === "center" && "text-center",
324
+ align === "right" && "text-right",
325
+ className,
326
+ padded && componentPaddingXUsingComponentGap
327
+ )
328
+ }, props), {
329
+ style: __spreadProps(__spreadValues({}, props.style), {
330
+ color: color ? `var(--color-${color})` : void 0
331
+ })
332
+ })
333
+ );
334
+ };
335
+ Label.displayName = "Label";
336
+
337
+ // src/components/Paragraph.tsx
338
+ var import_clsx4 = __toESM(require("clsx"), 1);
339
+ var import_jsx_runtime3 = require("react/jsx-runtime");
340
+ var Paragraph = (_a) => {
341
+ var _b = _a, {
342
+ className,
343
+ color,
344
+ padded,
345
+ align = "left",
346
+ tall,
347
+ addOverflow,
348
+ children,
349
+ as = "p",
350
+ id,
351
+ testid
352
+ } = _b, props = __objRest(_b, [
353
+ "className",
354
+ "color",
355
+ "padded",
356
+ "align",
357
+ "tall",
358
+ "addOverflow",
359
+ "children",
360
+ "as",
361
+ "id",
362
+ "testid"
363
+ ]);
364
+ const Element = as;
365
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
366
+ Element,
367
+ __spreadProps(__spreadValues({
368
+ id,
369
+ "data-testid": testid
370
+ }, props), {
371
+ className: (0, import_clsx4.default)(
372
+ typography.paragraph,
373
+ className,
374
+ padded && componentPaddingXUsingComponentGap,
375
+ align === "left" && "text-left",
376
+ align === "center" && "text-center",
377
+ align === "right" && "text-right",
378
+ tall && "!leading-6",
379
+ addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
380
+ ),
381
+ style: __spreadProps(__spreadValues({}, props.style), {
382
+ color: color ? `var(--color-${color})` : void 0
383
+ }),
384
+ children
385
+ })
386
+ );
387
+ };
388
+ Paragraph.displayName = "Paragraph";
389
+
390
+ // src/hooks/useKeydown.ts
391
+ var import_react2 = require("react");
392
+
393
+ // src/hooks/useInfiniteScroll.tsx
394
+ var import_react3 = require("react");
395
+ function useInfiniteScroll({
396
+ containerRef,
397
+ onLoadMore,
398
+ isLoading,
399
+ offset = 50,
400
+ enabled = true
401
+ // ✅ Add this
402
+ }) {
403
+ (0, import_react3.useEffect)(() => {
404
+ if (!enabled) return;
405
+ const handleScroll = () => {
406
+ const el2 = containerRef.current;
407
+ if (!el2 || isLoading) return;
408
+ const { scrollTop, scrollHeight, clientHeight } = el2;
409
+ const isNearBottom = scrollTop + clientHeight >= scrollHeight - offset;
410
+ if (isNearBottom) {
411
+ onLoadMore();
412
+ }
413
+ };
414
+ const el = containerRef.current;
415
+ if (el) el.addEventListener("scroll", handleScroll);
416
+ return () => {
417
+ if (el) el.removeEventListener("scroll", handleScroll);
418
+ };
419
+ }, [containerRef, onLoadMore, isLoading, offset, enabled]);
420
+ }
421
+
422
+ // src/hooks/useMatchesMedia.ts
423
+ var import_react4 = require("react");
424
+ var useMatchesMedia = (query) => {
425
+ const [matches, setMatches] = (0, import_react4.useState)();
426
+ (0, import_react4.useLayoutEffect)(() => {
427
+ const mediaQueryList = window.matchMedia(query);
428
+ const listener = () => setMatches(mediaQueryList.matches);
429
+ listener();
430
+ mediaQueryList.addEventListener("change", listener);
431
+ return () => mediaQueryList.removeEventListener("change", listener);
432
+ }, [query]);
433
+ return matches;
434
+ };
435
+ var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
436
+
437
+ // src/utils/formatting.tsx
438
+ function getDecimalPlaceholder(decimals) {
439
+ if (!decimals || decimals <= 0) {
440
+ return {};
441
+ }
442
+ return {
443
+ placeholder: `0.${"0".repeat(decimals)}`
444
+ };
445
+ }
446
+ function formatDecimalValue(value, decimals) {
447
+ if (!value || value === "") {
448
+ return "";
449
+ }
450
+ const numValue = typeof value === "string" ? parseFloat(value) : value;
451
+ if (isNaN(numValue)) {
452
+ return "";
453
+ }
454
+ if (!decimals || decimals <= 0) {
455
+ return String(Math.round(numValue));
456
+ }
457
+ return numValue.toFixed(decimals);
458
+ }
459
+ function formatCurrencyDisplay(value) {
460
+ if (!value || value === "") {
461
+ return "";
462
+ }
463
+ const parts = value.split(".");
464
+ const integerPart = parts[0];
465
+ const decimalPart = parts[1];
466
+ const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
467
+ return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
468
+ }
469
+
470
+ // src/utils/mergeObjectArrays.ts
471
+ function mergeObjectArrays(arr1, arr2) {
472
+ const maxLength = Math.max(arr1.length, arr2.length);
473
+ return Array.from(
474
+ { length: maxLength },
475
+ (_, i) => __spreadValues(__spreadValues({}, arr1[i] || {}), arr2[i] || {})
476
+ );
477
+ }
478
+
479
+ // src/utils.ts
480
+ function findDocumentRoot(element) {
481
+ if (typeof window === "undefined" || typeof document === "undefined") {
482
+ throw new Error(
483
+ "findDocumentRoot can only be used in a browser environment."
484
+ );
485
+ }
486
+ if (!element || !(element instanceof Node)) {
487
+ return window.document.body;
488
+ }
489
+ let currentElement = element;
490
+ while (currentElement && currentElement.parentNode) {
491
+ if (currentElement.parentNode === document) {
492
+ return document.body;
493
+ } else if (currentElement.parentNode instanceof DocumentFragment) {
494
+ return currentElement.parentNode;
495
+ } else {
496
+ currentElement = currentElement.parentNode;
497
+ }
498
+ }
499
+ return window.document.body;
500
+ }
501
+
502
+ // src/hooks/useTableLayout.ts
503
+ var import_react5 = require("react");
504
+ function useTableLayout(initialColumns, key) {
505
+ const [columns, setColumns] = (0, import_react5.useState)(initialColumns);
506
+ const [isReady, setIsReady] = (0, import_react5.useState)(false);
507
+ const renderCountRef = (0, import_react5.useRef)(0);
508
+ const handleSaveLayout = (0, import_react5.useCallback)(
509
+ (setter, _internal) => {
510
+ if (!isReady && !_internal || !key) return;
511
+ setColumns((prevColumns) => {
512
+ const newColumns = typeof setter === "function" ? setter(prevColumns) : setter;
513
+ if (JSON.stringify(newColumns) === JSON.stringify(prevColumns) && !_internal)
514
+ return prevColumns;
515
+ localStorage.setItem(`${key}-tableLayout`, JSON.stringify(newColumns));
516
+ return newColumns;
517
+ });
518
+ },
519
+ [isReady, key]
520
+ );
521
+ (0, import_react5.useEffect)(() => {
522
+ if (!key) return setIsReady(true);
523
+ if (renderCountRef.current > 1) {
524
+ throw new Error(
525
+ `useTableLayout should only be called once per component render cycle.
526
+ ${renderCountRef.current} Renders detected.
527
+ Check dependency stability`
528
+ );
529
+ }
530
+ renderCountRef.current += 1;
531
+ const savedLayout = localStorage.getItem(`${key}-tableLayout`);
532
+ if (savedLayout) {
533
+ handleSaveLayout(
534
+ mergeObjectArrays(
535
+ initialColumns,
536
+ JSON.parse(savedLayout)
537
+ ),
538
+ true
539
+ );
540
+ }
541
+ if (!savedLayout) handleSaveLayout(initialColumns, true);
542
+ setIsReady(true);
543
+ return () => {
544
+ renderCountRef.current = 0;
545
+ };
546
+ }, [handleSaveLayout, initialColumns, key]);
547
+ return { columns, setColumns: handleSaveLayout, isReady };
548
+ }
549
+
550
+ // src/components/MenuOption.tsx
551
+ var import_jsx_runtime4 = require("react/jsx-runtime");
552
+ var MenuOption = ({
553
+ id,
554
+ testid,
555
+ children,
556
+ disabled = false,
557
+ variant = "normal",
558
+ value,
559
+ before,
560
+ after,
561
+ subMenu,
562
+ onClick,
563
+ selected,
564
+ ref,
565
+ onSubMenuHover,
566
+ onSubMenuLeave,
567
+ onSubMenuEnter,
568
+ toggleMenu,
569
+ subMenuLevel = 1,
570
+ currentSubMenuLevel,
571
+ closeSubMenuLevel,
572
+ activeMenu,
573
+ mobilePositionTo,
574
+ highlightMatchingText = false,
575
+ menuValue,
576
+ onMouseMove
577
+ }) => {
578
+ const uniqueId = (0, import_react6.useId)();
579
+ const internalRef = (0, import_react6.useRef)(null);
580
+ const actualRef = ref || internalRef;
581
+ const menuId = (0, import_react6.useRef)(`menu-${uniqueId}`);
582
+ const isMobile = useMatchesMobile();
583
+ const handleMouseEnter = () => {
584
+ if (subMenu && onSubMenuHover && !disabled) {
585
+ onSubMenuHover(menuId.current, subMenuLevel);
586
+ }
587
+ };
588
+ const handleMouseLeave = () => {
589
+ if (subMenu && onSubMenuLeave && !disabled) {
590
+ onSubMenuLeave(subMenuLevel);
591
+ }
592
+ };
593
+ const handleMouseMove = () => {
594
+ if (subMenu && onMouseMove && !disabled) {
595
+ onMouseMove();
596
+ }
597
+ };
598
+ const handleSubMenuEnter = () => {
599
+ if (onSubMenuEnter) {
600
+ onSubMenuEnter();
601
+ }
602
+ };
603
+ const additionalAttributes = {
604
+ "data-selected": selected || null
605
+ };
606
+ const svgStyles = (0, import_clsx5.default)(
607
+ "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
608
+ );
609
+ const textLabelStyles = (0, import_clsx5.default)("w-full whitespace-nowrap !leading-6");
610
+ const normalStyles = variant === "normal" && !disabled && (0, import_clsx5.default)(
611
+ "bg-transparent text-text-primary-normal",
612
+ "hover:bg-background-action-secondary-hover",
613
+ "focus:bg-background-action-secondary-hover",
614
+ "data-selected:bg-background-action-secondary-hover",
615
+ "active:bg-background-action-secondary-active"
616
+ );
617
+ const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx5.default)("text-text-primary-disabled");
618
+ const actionStyles = variant === "action" && !disabled && (0, import_clsx5.default)(
619
+ "text-action-400 bg-transparent",
620
+ "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
621
+ "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
622
+ "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
623
+ "active:bg-background-action-secondary-active active:text-text-action-active"
624
+ );
625
+ const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx5.default)("text-text-action-disabled");
626
+ const disabledStyles = disabled && (0, import_clsx5.default)("bg-transparent cursor-default pointer-events-none");
627
+ const processChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
628
+ const renderChildren = typeof children === "object" ? children : variant === "action" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Label, { padded: true, className: textLabelStyles, children: processChildren }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Paragraph, { padded: true, className: textLabelStyles, children: processChildren });
629
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
630
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
631
+ "div",
632
+ __spreadProps(__spreadValues({
633
+ id,
634
+ "data-testid": testid,
635
+ ref: actualRef,
636
+ className: (0, import_clsx5.default)(
637
+ "flex items-center cursor-pointer w-full text-left relative outline-none",
638
+ svgStyles,
639
+ componentGap,
640
+ componentPadding,
641
+ baseTransition,
642
+ normalStyles,
643
+ normalDisabledStyles,
644
+ actionStyles,
645
+ actionDisabledStyles,
646
+ disabledStyles
647
+ ),
648
+ "data-value": value || children,
649
+ onClick: () => {
650
+ onClick == null ? void 0 : onClick(menuId.current, value || children);
651
+ if (subMenu) {
652
+ toggleMenu(menuId.current, subMenuLevel);
653
+ }
654
+ },
655
+ onMouseEnter: handleMouseEnter,
656
+ onMouseLeave: handleMouseLeave,
657
+ onMouseMove: handleMouseMove
658
+ }, additionalAttributes), {
659
+ tabIndex: -1,
660
+ role: "menuitem",
661
+ "aria-haspopup": subMenu ? "menu" : void 0,
662
+ children: [
663
+ before && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "shrink-0 flex items-center", children: before }),
664
+ renderChildren,
665
+ renderAfterProp()
666
+ ]
667
+ })
668
+ ),
669
+ subMenu && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
670
+ "div",
671
+ {
672
+ onMouseEnter: handleSubMenuEnter,
673
+ onMouseLeave: handleMouseLeave,
674
+ "data-submenu-parent": menuId.current,
675
+ "data-menu-level": subMenuLevel + 1,
676
+ children: subMenu({
677
+ menuId: menuId.current,
678
+ positionTo: actualRef,
679
+ mobilePositionTo,
680
+ position: "right",
681
+ subMenuLevel,
682
+ mobileBackMenuOption,
683
+ mobileHide: isMobile && activeMenu !== menuId.current
684
+ })
685
+ }
686
+ )
687
+ ] });
688
+ function renderAfterProp() {
689
+ if (after) {
690
+ return after;
691
+ }
692
+ if (subMenu && after !== null) {
693
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chevron_right" });
694
+ }
695
+ }
696
+ function mobileBackMenuOption() {
697
+ if (!isMobile) {
698
+ return;
699
+ }
700
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
701
+ MenuOption,
702
+ {
703
+ id: id ? `${id}-back` : void 0,
704
+ testid: testid ? `${testid}-back` : void 0,
705
+ onClick: () => {
706
+ closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
707
+ },
708
+ variant: "action",
709
+ before: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chevron_left" }),
710
+ children: "Back"
711
+ }
712
+ );
713
+ }
714
+ };
715
+ MenuOption.displayName = "MenuOption";
716
+ function highlightMatch(text, searchValue) {
717
+ if (!searchValue || !searchValue.trim()) {
718
+ return text;
719
+ }
720
+ const regex = new RegExp(
721
+ `(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
722
+ "gi"
723
+ );
724
+ const parts = text.split(regex);
725
+ return parts.map(
726
+ (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "font-bold", children: part }, index) : part
727
+ );
728
+ }
729
+
730
+ // src/components/Menu.tsx
731
+ var import_clsx6 = __toESM(require("clsx"), 1);
732
+ var import_react8 = require("react");
733
+ var import_react_dom = require("react-dom");
734
+
735
+ // src/components/useMenuSystem.tsx
736
+ var import_react7 = require("react");
737
+ function useSubMenuSystem(mobilePositionTo) {
738
+ const [activeMenus, setActiveMenus] = (0, import_react7.useState)(
739
+ {}
740
+ );
741
+ const [activeMenu, setActiveMenu] = (0, import_react7.useState)("");
742
+ const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react7.useState)(
743
+ null
744
+ );
745
+ const menuRootRef = (0, import_react7.useRef)(null);
746
+ const subMenuRefs = (0, import_react7.useRef)({});
747
+ const hoverTimeoutRef = (0, import_react7.useRef)(null);
748
+ const closeTimeoutRef = (0, import_react7.useRef)(null);
749
+ const mouseStopTimeoutRef = (0, import_react7.useRef)(null);
750
+ const isMouseMovingRef = (0, import_react7.useRef)(false);
751
+ const pendingOpenActionRef = (0, import_react7.useRef)(null);
752
+ const pendingCloseActionRef = (0, import_react7.useRef)(null);
753
+ const isMobile = useMatchesMobile();
754
+ const toggleMenu = (menuId, level) => {
755
+ if (closeTimeoutRef.current) {
756
+ clearTimeout(closeTimeoutRef.current);
757
+ closeTimeoutRef.current = null;
758
+ }
759
+ setActiveMenu(menuId);
760
+ setCurrentSubMenuLevel(level);
761
+ setActiveMenus((prev) => {
762
+ const newActiveMenus = __spreadValues({}, prev);
763
+ if (newActiveMenus[level] === menuId) {
764
+ delete newActiveMenus[level];
765
+ } else {
766
+ newActiveMenus[level] = menuId;
767
+ }
768
+ Object.keys(newActiveMenus).forEach((key) => {
769
+ if (Number(key) > level) {
770
+ delete newActiveMenus[Number(key)];
771
+ }
772
+ });
773
+ return newActiveMenus;
774
+ });
775
+ };
776
+ const openMenu = (menuId, level) => {
777
+ if (closeTimeoutRef.current) {
778
+ clearTimeout(closeTimeoutRef.current);
779
+ closeTimeoutRef.current = null;
780
+ }
781
+ setActiveMenus((prev) => {
782
+ const newActiveMenus = __spreadValues({}, prev);
783
+ newActiveMenus[level] = menuId;
784
+ Object.keys(newActiveMenus).forEach((key) => {
785
+ if (Number(key) > level) {
786
+ delete newActiveMenus[Number(key)];
787
+ }
788
+ });
789
+ return newActiveMenus;
790
+ });
791
+ };
792
+ const executePendingActions = (0, import_react7.useCallback)(() => {
793
+ if (pendingCloseActionRef.current) {
794
+ pendingCloseActionRef.current();
795
+ pendingCloseActionRef.current = null;
796
+ }
797
+ if (pendingOpenActionRef.current) {
798
+ pendingOpenActionRef.current();
799
+ pendingOpenActionRef.current = null;
800
+ }
801
+ }, []);
802
+ const openMenuWithDelay = (menuId, level, delay = 150) => {
803
+ if (isMobile) {
804
+ return;
805
+ }
806
+ pendingOpenActionRef.current = () => {
807
+ if (hoverTimeoutRef.current) {
808
+ clearTimeout(hoverTimeoutRef.current);
809
+ }
810
+ hoverTimeoutRef.current = setTimeout(() => {
811
+ openMenu(menuId, level);
812
+ }, delay);
813
+ };
814
+ if (!isMouseMovingRef.current) {
815
+ executePendingActions();
816
+ }
817
+ };
818
+ const closeMenuWithDelay = (level, delay = 500) => {
819
+ if (isMobile) {
820
+ return;
821
+ }
822
+ pendingCloseActionRef.current = () => {
823
+ if (hoverTimeoutRef.current) {
824
+ clearTimeout(hoverTimeoutRef.current);
825
+ hoverTimeoutRef.current = null;
826
+ }
827
+ closeTimeoutRef.current = setTimeout(() => {
828
+ closeSubMenuLevel(level);
829
+ }, delay);
830
+ };
831
+ if (!isMouseMovingRef.current) {
832
+ executePendingActions();
833
+ }
834
+ };
835
+ const handleMouseMove = () => {
836
+ isMouseMovingRef.current = true;
837
+ if (mouseStopTimeoutRef.current) {
838
+ clearTimeout(mouseStopTimeoutRef.current);
839
+ }
840
+ mouseStopTimeoutRef.current = setTimeout(() => {
841
+ isMouseMovingRef.current = false;
842
+ executePendingActions();
843
+ }, 200);
844
+ };
845
+ const cancelCloseTimeout = () => {
846
+ if (isMobile) {
847
+ return;
848
+ }
849
+ if (mouseStopTimeoutRef.current) {
850
+ clearTimeout(mouseStopTimeoutRef.current);
851
+ mouseStopTimeoutRef.current = null;
852
+ isMouseMovingRef.current = false;
853
+ }
854
+ };
855
+ const closeSubMenuLevel = (level) => {
856
+ setActiveMenus((prev) => {
857
+ const newActiveMenus = __spreadValues({}, prev);
858
+ delete newActiveMenus[level];
859
+ Object.keys(newActiveMenus).forEach((key) => {
860
+ if (Number(key) >= level) {
861
+ delete newActiveMenus[Number(key)];
862
+ }
863
+ });
864
+ if (isMobile) {
865
+ const newSubMenuLevel = level - 1;
866
+ setCurrentSubMenuLevel(newSubMenuLevel);
867
+ const newActiveMenu = newActiveMenus[newSubMenuLevel];
868
+ if (Object.keys(newActiveMenus).length > 0 && newActiveMenu) {
869
+ setActiveMenu(newActiveMenu);
870
+ }
871
+ }
872
+ return newActiveMenus;
873
+ });
874
+ };
875
+ const registerSubMenu = (id, element) => {
876
+ subMenuRefs.current[id] = element;
877
+ };
878
+ const isMenuActive = (menuId, level) => {
879
+ return activeMenus[level] === menuId;
880
+ };
881
+ (0, import_react7.useEffect)(() => {
882
+ const handleClickOutside = (event) => {
883
+ var _a;
884
+ if (Object.keys(activeMenus).length === 0) return;
885
+ const target = event.target;
886
+ if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
887
+ const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
888
+ const submenuEl = subMenuRefs.current[id];
889
+ return submenuEl == null ? void 0 : submenuEl.contains(target);
890
+ });
891
+ if (!isInsideActiveSubmenu) {
892
+ setActiveMenus({});
893
+ }
894
+ };
895
+ document.addEventListener("mousedown", handleClickOutside);
896
+ return () => {
897
+ document.removeEventListener("mousedown", handleClickOutside);
898
+ };
899
+ }, [activeMenus]);
900
+ (0, import_react7.useEffect)(() => {
901
+ return () => {
902
+ if (hoverTimeoutRef.current) {
903
+ clearTimeout(hoverTimeoutRef.current);
904
+ }
905
+ if (closeTimeoutRef.current) {
906
+ clearTimeout(closeTimeoutRef.current);
907
+ }
908
+ };
909
+ }, []);
910
+ const getAllFocusableMenuElements = () => {
911
+ const elements = [];
912
+ if (menuRootRef.current) {
913
+ elements.push(
914
+ ...Array.from(menuRootRef.current.children)
915
+ );
916
+ }
917
+ Object.values(activeMenus).forEach((menuId) => {
918
+ const submenuEl = subMenuRefs.current[menuId];
919
+ if (submenuEl) {
920
+ elements.push(...Array.from(submenuEl.children));
921
+ }
922
+ });
923
+ return elements;
924
+ };
925
+ const findCurrentMenuLevel = (element) => {
926
+ let current = element.parentElement;
927
+ while (current) {
928
+ const level = current.getAttribute("data-menu-level");
929
+ if (level !== null) {
930
+ return parseInt(level, 10);
931
+ }
932
+ current = current.parentElement;
933
+ }
934
+ return 0;
935
+ };
936
+ const getMenuElementsAtLevel = (level) => {
937
+ var _a;
938
+ if (level === 0 && menuRootRef.current) {
939
+ return Array.from(menuRootRef.current.children);
940
+ }
941
+ const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
942
+ const submenuEl = subMenuRefs.current[id];
943
+ return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
944
+ })) == null ? void 0 : _a[1];
945
+ if (menuId) {
946
+ const submenuEl = subMenuRefs.current[menuId];
947
+ if (submenuEl) {
948
+ return Array.from(submenuEl.children);
949
+ }
950
+ }
951
+ return [];
952
+ };
953
+ return {
954
+ menuRootRef,
955
+ activeMenus,
956
+ openMenu,
957
+ isMenuActive,
958
+ registerSubMenu,
959
+ closeSubMenuLevel,
960
+ getAllFocusableMenuElements,
961
+ findCurrentMenuLevel,
962
+ getMenuElementsAtLevel,
963
+ mobileHide: isMobile && Object.keys(activeMenus).length > 0,
964
+ listeners: {
965
+ onSubMenuHover: openMenuWithDelay,
966
+ onSubMenuLeave: closeMenuWithDelay,
967
+ onSubMenuEnter: cancelCloseTimeout,
968
+ onMouseMove: handleMouseMove,
969
+ toggleMenu,
970
+ mobilePositionTo,
971
+ activeMenu,
972
+ currentSubMenuLevel,
973
+ closeSubMenuLevel
974
+ }
975
+ };
976
+ }
977
+ function useMenuPosition(elementRef, position = "bottom", options) {
978
+ const [menuPosition, setMenuPosition] = (0, import_react7.useState)({
979
+ top: 0,
980
+ left: 0,
981
+ minWidth: 0
982
+ });
983
+ const isMobile = options == null ? void 0 : options.isMobile;
984
+ const updatePosition = (0, import_react7.useCallback)(() => {
985
+ var _a, _b, _c;
986
+ if (!(elementRef == null ? void 0 : elementRef.current)) return;
987
+ const triggerRect = elementRef.current.getBoundingClientRect();
988
+ const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
989
+ const viewportWidth = window.innerWidth;
990
+ const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
991
+ const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
992
+ let top = 0;
993
+ let left = 0;
994
+ if (position === "bottom" || position === "bottom-right") {
995
+ top = triggerRect.top + triggerRect.height + topOffset;
996
+ } else {
997
+ top = triggerRect.top;
998
+ }
999
+ if (position === "bottom") {
1000
+ left = triggerRect.left + window.scrollX;
1001
+ } else if (position === "bottom-right") {
1002
+ left = triggerRect.right + window.scrollX - menuWidth;
1003
+ } else if (position === "right") {
1004
+ if (isMobile) {
1005
+ left = triggerRect.left + window.scrollX;
1006
+ } else {
1007
+ left = triggerRect.right + window.scrollX;
1008
+ }
1009
+ }
1010
+ const overflowsRightViewport = left + menuWidth > viewportWidth;
1011
+ if (overflowsRightViewport) {
1012
+ const newLeft = triggerRect.left - menuWidth;
1013
+ const overflowsLeftViewport = newLeft < 0;
1014
+ if (overflowsLeftViewport) {
1015
+ left = (viewportWidth - menuWidth) / 2;
1016
+ } else {
1017
+ left = newLeft;
1018
+ }
1019
+ }
1020
+ if (isMobile && position === "right") {
1021
+ top = triggerRect.top + triggerRect.height + topOffset;
1022
+ }
1023
+ if (isMobile && menuWidth > viewportWidth) {
1024
+ left = 0;
1025
+ }
1026
+ setMenuPosition({
1027
+ top,
1028
+ left,
1029
+ minWidth: triggerRect.width
1030
+ });
1031
+ }, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
1032
+ (0, import_react7.useEffect)(() => {
1033
+ if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
1034
+ const handleClickOutside = (event) => {
1035
+ var _a, _b, _c, _d, _e;
1036
+ const target = event.target;
1037
+ if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
1038
+ if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
1039
+ if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
1040
+ var _a2;
1041
+ return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
1042
+ }))
1043
+ return;
1044
+ (_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
1045
+ };
1046
+ document.addEventListener("mousedown", handleClickOutside);
1047
+ return () => {
1048
+ document.removeEventListener("mousedown", handleClickOutside);
1049
+ };
1050
+ }, [
1051
+ options,
1052
+ elementRef,
1053
+ options == null ? void 0 : options.isOpen,
1054
+ options == null ? void 0 : options.setIsOpen,
1055
+ options == null ? void 0 : options.menuRef,
1056
+ options == null ? void 0 : options.additionalRefs
1057
+ ]);
1058
+ (0, import_react7.useEffect)(() => {
1059
+ updatePosition();
1060
+ const resizeObserver = new ResizeObserver(updatePosition);
1061
+ if (elementRef == null ? void 0 : elementRef.current) {
1062
+ resizeObserver.observe(elementRef.current);
1063
+ }
1064
+ window.addEventListener("scroll", updatePosition);
1065
+ window.addEventListener("resize", updatePosition);
1066
+ return () => {
1067
+ resizeObserver.disconnect();
1068
+ window.removeEventListener("scroll", updatePosition);
1069
+ window.removeEventListener("resize", updatePosition);
1070
+ };
1071
+ }, [elementRef, updatePosition]);
1072
+ return { menuPosition, updatePosition };
1073
+ }
1074
+
1075
+ // src/components/Menu.tsx
1076
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1077
+ var Menu = (_a) => {
1078
+ var _b = _a, {
1079
+ id,
1080
+ testid,
1081
+ children,
1082
+ className,
1083
+ ref,
1084
+ positionTo,
1085
+ mobilePositionTo,
1086
+ show,
1087
+ setShow,
1088
+ position = "bottom",
1089
+ maxHeight: customMaxHeight,
1090
+ topOffset,
1091
+ mobileBackMenuOption,
1092
+ mobileHide,
1093
+ useDefaultMinWidth,
1094
+ autoFocusOff,
1095
+ menuName,
1096
+ calculateMinMaxHeight
1097
+ } = _b, props = __objRest(_b, [
1098
+ "id",
1099
+ "testid",
1100
+ "children",
1101
+ "className",
1102
+ "ref",
1103
+ "positionTo",
1104
+ "mobilePositionTo",
1105
+ "show",
1106
+ "setShow",
1107
+ "position",
1108
+ "maxHeight",
1109
+ "topOffset",
1110
+ "mobileBackMenuOption",
1111
+ "mobileHide",
1112
+ "useDefaultMinWidth",
1113
+ "autoFocusOff",
1114
+ "menuName",
1115
+ "calculateMinMaxHeight"
1116
+ ]);
1117
+ const internalRef = (0, import_react8.useRef)(null);
1118
+ const actualRef = ref || internalRef;
1119
+ const [maxHeight, setMaxHeight] = (0, import_react8.useState)("180px");
1120
+ const isMobile = useMatchesMobile();
1121
+ const { menuPosition, updatePosition } = useMenuPosition(
1122
+ isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
1123
+ position,
1124
+ {
1125
+ isOpen: show,
1126
+ setIsOpen: setShow,
1127
+ menuRef: internalRef,
1128
+ topOffset,
1129
+ isMobile: !!(isMobile && mobilePositionTo)
1130
+ }
1131
+ );
1132
+ (0, import_react8.useEffect)(() => {
1133
+ if (calculateMinMaxHeight) {
1134
+ return;
1135
+ }
1136
+ const raf = requestAnimationFrame(() => {
1137
+ if (!actualRef.current || customMaxHeight) {
1138
+ return;
1139
+ }
1140
+ if (actualRef.current.childElementCount > 4) {
1141
+ let accumulatedHeight = 0;
1142
+ Array.from(actualRef.current.children).forEach((child, index) => {
1143
+ if (index >= 5) {
1144
+ return;
1145
+ }
1146
+ accumulatedHeight += child.clientHeight;
1147
+ });
1148
+ accumulatedHeight = accumulatedHeight / 5 * 4.5;
1149
+ setMaxHeight(`${accumulatedHeight}px`);
1150
+ }
1151
+ });
1152
+ return () => {
1153
+ cancelAnimationFrame(raf);
1154
+ };
1155
+ }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1156
+ (0, import_react8.useEffect)(() => {
1157
+ if (!calculateMinMaxHeight) {
1158
+ return;
1159
+ }
1160
+ if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
1161
+ const positionToRect = positionTo.current.getBoundingClientRect();
1162
+ const offsetInPx = 16;
1163
+ const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
1164
+ setMaxHeight(`${calculatedMaxHeight}px`);
1165
+ }
1166
+ }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1167
+ (0, import_react8.useEffect)(() => {
1168
+ if (!show) {
1169
+ return;
1170
+ }
1171
+ initializeMenuFocus();
1172
+ updatePosition();
1173
+ }, [show, updatePosition]);
1174
+ (0, import_react8.useEffect)(() => {
1175
+ if (!show || !setShow) {
1176
+ return;
1177
+ }
1178
+ const handleEscapeKey = (event) => {
1179
+ var _a2;
1180
+ if (event.key !== "Escape") {
1181
+ return;
1182
+ }
1183
+ setShow(false);
1184
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.focus();
1185
+ };
1186
+ document.addEventListener("keydown", handleEscapeKey);
1187
+ return () => {
1188
+ document.removeEventListener("keydown", handleEscapeKey);
1189
+ };
1190
+ }, [show, setShow, positionTo]);
1191
+ return show && (0, import_react_dom.createPortal)(
1192
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1193
+ "div",
1194
+ __spreadProps(__spreadValues({
1195
+ id,
1196
+ "data-testid": testid,
1197
+ ref: setRefs,
1198
+ className: (0, import_clsx6.default)(
1199
+ "shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
1200
+ "fixed",
1201
+ "z-50",
1202
+ "max-w-screen",
1203
+ mobileHide && "opacity-0 pointer-events-none",
1204
+ className
1205
+ )
1206
+ }, props), {
1207
+ style: __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props.style), {
1208
+ maxHeight: customMaxHeight || maxHeight
1209
+ }), menuPosition), {
1210
+ minWidth: useDefaultMinWidth ? "212px" : menuPosition.minWidth
1211
+ }),
1212
+ onKeyDown: handleKeydown,
1213
+ onMouseDown: stopPropagation,
1214
+ onMouseUp: stopPropagation,
1215
+ onTouchStart: stopPropagation,
1216
+ onTouchEnd: stopPropagation,
1217
+ tabIndex: -1,
1218
+ "data-menu": menuName != null ? menuName : "",
1219
+ children: [
1220
+ mobileBackMenuOption == null ? void 0 : mobileBackMenuOption(),
1221
+ children
1222
+ ]
1223
+ })
1224
+ ),
1225
+ findDocumentRoot(internalRef.current)
1226
+ );
1227
+ function handleKeydown(e) {
1228
+ var _a2, _b2;
1229
+ if (!internalRef.current) {
1230
+ return;
1231
+ }
1232
+ if (e.key !== "Escape") {
1233
+ e.stopPropagation();
1234
+ }
1235
+ const menuOptions = Array.from(
1236
+ internalRef.current.querySelectorAll('[role="menuitem"]')
1237
+ );
1238
+ if (menuOptions.length === 0) {
1239
+ return;
1240
+ }
1241
+ let currentIndex = -1;
1242
+ const focusedElement = document.activeElement;
1243
+ for (let i = 0; i < menuOptions.length; i++) {
1244
+ if (menuOptions[i] === focusedElement) {
1245
+ currentIndex = i;
1246
+ break;
1247
+ }
1248
+ }
1249
+ switch (e.key) {
1250
+ case "ArrowDown": {
1251
+ e.preventDefault();
1252
+ const nextIndex = currentIndex < menuOptions.length - 1 ? currentIndex + 1 : 0;
1253
+ menuOptions[nextIndex].focus();
1254
+ break;
1255
+ }
1256
+ case "ArrowUp": {
1257
+ e.preventDefault();
1258
+ const prevIndex = currentIndex > 0 ? currentIndex - 1 : menuOptions.length - 1;
1259
+ menuOptions[prevIndex].focus();
1260
+ break;
1261
+ }
1262
+ case "Home":
1263
+ e.preventDefault();
1264
+ menuOptions[0].focus();
1265
+ break;
1266
+ case "End":
1267
+ e.preventDefault();
1268
+ menuOptions[menuOptions.length - 1].focus();
1269
+ break;
1270
+ case "Enter":
1271
+ case " ":
1272
+ case "ArrowRight":
1273
+ e.preventDefault();
1274
+ if (currentIndex >= 0) {
1275
+ menuOptions[currentIndex].click();
1276
+ }
1277
+ break;
1278
+ case "ArrowLeft":
1279
+ e.preventDefault();
1280
+ (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.click();
1281
+ (_b2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _b2.focus();
1282
+ break;
1283
+ }
1284
+ }
1285
+ function initializeMenuFocus() {
1286
+ var _a2, _b2, _c;
1287
+ if (!autoFocusOff) {
1288
+ (_a2 = internalRef.current) == null ? void 0 : _a2.focus();
1289
+ }
1290
+ const selectedOption = (_b2 = internalRef.current) == null ? void 0 : _b2.querySelector(
1291
+ "[data-selected]"
1292
+ );
1293
+ const firstMenuItem = (_c = internalRef.current) == null ? void 0 : _c.querySelector(
1294
+ '[role="menuitem"]'
1295
+ );
1296
+ const targetElement = selectedOption || firstMenuItem;
1297
+ if (!targetElement) {
1298
+ return;
1299
+ }
1300
+ targetElement.scrollIntoView({
1301
+ block: "nearest",
1302
+ behavior: "instant"
1303
+ });
1304
+ if (autoFocusOff) {
1305
+ return;
1306
+ }
1307
+ requestAnimationFrame(() => {
1308
+ targetElement.focus();
1309
+ });
1310
+ }
1311
+ function setRefs(node) {
1312
+ internalRef.current = node;
1313
+ if (ref) {
1314
+ if (typeof ref === "function") {
1315
+ ref(node);
1316
+ } else {
1317
+ ref.current = node;
1318
+ }
1319
+ }
1320
+ }
1321
+ function stopPropagation(e) {
1322
+ e.stopPropagation();
1323
+ }
1324
+ };
1325
+ Menu.displayName = "Menu";
1326
+
1327
+ // src/components/Search.tsx
1328
+ var import_react10 = require("react");
1329
+
1330
+ // src/components/Input.tsx
1331
+ var import_react9 = require("react");
1332
+ var import_clsx7 = __toESM(require("clsx"), 1);
1333
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1334
+ var InputBase = (_a) => {
1335
+ var _b = _a, {
1336
+ id,
1337
+ testid,
1338
+ before,
1339
+ after,
1340
+ type,
1341
+ label,
1342
+ error,
1343
+ className,
1344
+ align = "left",
1345
+ caption,
1346
+ required,
1347
+ selectOnFocus,
1348
+ removeRoundness,
1349
+ inputContainerRef,
1350
+ removeBorder,
1351
+ wrapperClassName,
1352
+ focus,
1353
+ secondaryIconColor,
1354
+ fullWidth = true
1355
+ } = _b, props = __objRest(_b, [
1356
+ "id",
1357
+ "testid",
1358
+ "before",
1359
+ "after",
1360
+ "type",
1361
+ "label",
1362
+ "error",
1363
+ "className",
1364
+ "align",
1365
+ "caption",
1366
+ "required",
1367
+ "selectOnFocus",
1368
+ "removeRoundness",
1369
+ "inputContainerRef",
1370
+ "removeBorder",
1371
+ "wrapperClassName",
1372
+ "focus",
1373
+ "secondaryIconColor",
1374
+ "fullWidth"
1375
+ ]);
1376
+ const attributes = {
1377
+ "data-error": error && !focus || null,
1378
+ "data-focus": focus || null
1379
+ };
1380
+ const inputRef = (0, import_react9.useRef)(null);
1381
+ const inputId = id ? `${id}-input` : void 0;
1382
+ (0, import_react9.useEffect)(() => {
1383
+ var _a2;
1384
+ const input = inputRef.current;
1385
+ const focusHandler = () => {
1386
+ input == null ? void 0 : input.select();
1387
+ };
1388
+ if (selectOnFocus) {
1389
+ (_a2 = inputRef.current) == null ? void 0 : _a2.addEventListener("focus", focusHandler);
1390
+ return () => {
1391
+ input == null ? void 0 : input.removeEventListener("focus", focusHandler);
1392
+ };
1393
+ }
1394
+ }, [selectOnFocus]);
1395
+ const inputBaseClass = (0, import_clsx7.default)(
1396
+ fullWidth ? "w-full" : "w-fit",
1397
+ "flex flex-row items-center",
1398
+ "bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
1399
+ componentGap,
1400
+ baseTransition,
1401
+ "outline-transparent outline-2 -outline-offset-2",
1402
+ componentPaddingMinusBorder,
1403
+ !removeRoundness && "rounded-base",
1404
+ !removeBorder && "border border-border-primary-normal",
1405
+ "relative"
1406
+ );
1407
+ const inputFocusClass = (0, import_clsx7.default)(
1408
+ "has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
1409
+ );
1410
+ const inputDisabledClass = (0, import_clsx7.default)(
1411
+ "has-disabled:bg-background-action-secondary-disabled"
1412
+ );
1413
+ const inputReadOnlyClass = (0, import_clsx7.default)(
1414
+ "has-[input:not(:disabled):read-only]:outline-none has-[input:not(:disabled):read-only]:bg-transparent has-[input:not(:disabled):read-only]:border-transparent has-[input:not(:disabled):read-only]:pl-0"
1415
+ );
1416
+ const inputInvalidClass = (0, import_clsx7.default)(
1417
+ "has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
1418
+ );
1419
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1420
+ "label",
1421
+ {
1422
+ id,
1423
+ "data-testid": testid,
1424
+ htmlFor: inputId,
1425
+ ref: inputContainerRef,
1426
+ className: (0, import_clsx7.default)(
1427
+ "w-full flex flex-col",
1428
+ "block",
1429
+ "text-text-primary-normal has-disabled:text-text-primary-disabled",
1430
+ componentGap
1431
+ ),
1432
+ style: __spreadValues({}, props.style),
1433
+ children: [
1434
+ label && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_clsx7.default)("flex items-center", componentGap), children: [
1435
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1436
+ Label,
1437
+ {
1438
+ id: id ? `${id}-label` : void 0,
1439
+ color: error ? "text-primary-error" : void 0,
1440
+ className: (0, import_clsx7.default)(
1441
+ props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
1442
+ ),
1443
+ children: label
1444
+ }
1445
+ ),
1446
+ required && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1447
+ "span",
1448
+ {
1449
+ className: (0, import_clsx7.default)(typography.label, "text-text-critical-normal"),
1450
+ children: "*"
1451
+ }
1452
+ )
1453
+ ] }),
1454
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1455
+ "div",
1456
+ {
1457
+ className: (0, import_clsx7.default)(
1458
+ inputBaseClass,
1459
+ !props.disabled && inputInvalidClass,
1460
+ inputFocusClass,
1461
+ inputDisabledClass,
1462
+ inputReadOnlyClass,
1463
+ wrapperClassName
1464
+ ),
1465
+ children: [
1466
+ before,
1467
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1468
+ "input",
1469
+ __spreadProps(__spreadValues(__spreadValues({
1470
+ ref: (el) => {
1471
+ inputRef.current = el;
1472
+ },
1473
+ type,
1474
+ required
1475
+ }, props), attributes), {
1476
+ id: inputId,
1477
+ "data-testid": testid ? `${testid}-input` : void 0,
1478
+ className: (0, import_clsx7.default)(
1479
+ "flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
1480
+ "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
1481
+ "placeholder:text-text-secondary-normal disabled:text-text-secondary-disabled",
1482
+ align === "right" && "text-right",
1483
+ align === "center" && "text-center",
1484
+ componentPaddingXUsingComponentGap,
1485
+ typography.paragraph,
1486
+ className,
1487
+ props.readOnly && !props.disabled && "!px-0"
1488
+ )
1489
+ })
1490
+ ),
1491
+ secondaryIconColor ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "contents text-text-secondary-normal", children: after }) : after
1492
+ ]
1493
+ }
1494
+ ),
1495
+ caption && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1496
+ "div",
1497
+ {
1498
+ id: id ? `${id}-caption` : void 0,
1499
+ "data-testid": testid ? `${testid}-caption` : void 0,
1500
+ children: caption
1501
+ }
1502
+ )
1503
+ ]
1504
+ }
1505
+ );
1506
+ };
1507
+ var Input = (_a) => {
1508
+ var _b = _a, {
1509
+ variant = "default",
1510
+ decimals,
1511
+ uom,
1512
+ removeSearchIcon,
1513
+ value: propValue,
1514
+ onChange,
1515
+ onBlur,
1516
+ onClear,
1517
+ id,
1518
+ testid
1519
+ } = _b, props = __objRest(_b, [
1520
+ "variant",
1521
+ "decimals",
1522
+ "uom",
1523
+ "removeSearchIcon",
1524
+ "value",
1525
+ "onChange",
1526
+ "onBlur",
1527
+ "onClear",
1528
+ "id",
1529
+ "testid"
1530
+ ]);
1531
+ const [internalValue, setInternalValue] = (0, import_react9.useState)("");
1532
+ const [displayValue, setDisplayValue] = (0, import_react9.useState)("");
1533
+ (0, import_react9.useEffect)(() => {
1534
+ var _a2;
1535
+ const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
1536
+ setInternalValue(stringValue);
1537
+ setDisplayValue(stringValue);
1538
+ }, [propValue]);
1539
+ (0, import_react9.useEffect)(() => {
1540
+ var _a2;
1541
+ if (variant !== "currency") {
1542
+ return;
1543
+ }
1544
+ const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
1545
+ if (!stringValue) {
1546
+ return;
1547
+ }
1548
+ const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
1549
+ setInternalValue(formatted);
1550
+ setDisplayValue(formatCurrencyDisplay(formatted));
1551
+ }, []);
1552
+ const getInputProps = () => {
1553
+ var _a2;
1554
+ const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
1555
+ id
1556
+ }), getDecimalPlaceholder(decimals)), {
1557
+ value: propValue
1558
+ });
1559
+ switch (variant) {
1560
+ case "search":
1561
+ return __spreadProps(__spreadValues({}, baseProps), {
1562
+ placeholder: (_a2 = props.placeholder) != null ? _a2 : "Search",
1563
+ className: "!mr-6",
1564
+ value: displayValue
1565
+ });
1566
+ case "finder":
1567
+ return baseProps;
1568
+ case "currency":
1569
+ return __spreadProps(__spreadValues({}, baseProps), {
1570
+ align: "right",
1571
+ type: "text",
1572
+ value: displayValue
1573
+ });
1574
+ case "percentage":
1575
+ case "uom":
1576
+ return __spreadProps(__spreadValues({}, baseProps), {
1577
+ type: "number",
1578
+ align: "right"
1579
+ });
1580
+ default:
1581
+ return baseProps;
1582
+ }
1583
+ };
1584
+ const getBeforeElement = () => {
1585
+ if (props.before) return props.before;
1586
+ switch (variant) {
1587
+ case "search":
1588
+ return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "search" }) }) : null;
1589
+ case "currency":
1590
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "attach_money" }) });
1591
+ default:
1592
+ return null;
1593
+ }
1594
+ };
1595
+ const getAfterElement = () => {
1596
+ if (props.after) return props.after;
1597
+ switch (variant) {
1598
+ case "search": {
1599
+ const hasValue = displayValue.length > 0;
1600
+ return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1601
+ Icon,
1602
+ {
1603
+ id: id ? `${id}-clear-button` : void 0,
1604
+ testid: testid ? `${testid}-clear-button` : void 0,
1605
+ name: "close",
1606
+ onClick: handleSearchReset,
1607
+ className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
1608
+ }
1609
+ ) : null;
1610
+ }
1611
+ case "finder":
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "search" });
1613
+ case "uom":
1614
+ return uom ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-text-secondary-normal uppercase", children: uom.slice(0, 4) }) : null;
1615
+ case "percentage":
1616
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { name: "percent" }) });
1617
+ default:
1618
+ return null;
1619
+ }
1620
+ };
1621
+ const handleSearchReset = () => {
1622
+ setInternalValue("");
1623
+ setDisplayValue("");
1624
+ if (onChange) {
1625
+ const syntheticEvent = {
1626
+ target: { value: "" }
1627
+ };
1628
+ if (typeof onChange === "function") {
1629
+ onChange(syntheticEvent);
1630
+ }
1631
+ }
1632
+ onClear == null ? void 0 : onClear();
1633
+ };
1634
+ const handleChange = (e) => {
1635
+ const rawValue = e.target.value;
1636
+ if (variant === "currency") {
1637
+ const raw = rawValue.replace(/,/g, "");
1638
+ if (raw === "") {
1639
+ setInternalValue("");
1640
+ setDisplayValue("");
1641
+ if (onChange) {
1642
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1643
+ target: __spreadProps(__spreadValues({}, e.target), { value: "" })
1644
+ });
1645
+ onChange(syntheticEvent);
1646
+ }
1647
+ return;
1648
+ }
1649
+ const regex = /^\d*\.?\d*$/;
1650
+ if (!regex.test(raw)) return;
1651
+ const parts = raw.split(".");
1652
+ const currentDecimals = decimals != null ? decimals : 2;
1653
+ if (parts.length === 2 && parts[1].length > currentDecimals) return;
1654
+ setInternalValue(raw);
1655
+ setDisplayValue(formatCurrencyDisplay(raw));
1656
+ const asNumber = Number(raw);
1657
+ if (!isNaN(asNumber) && onChange) {
1658
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1659
+ target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1660
+ });
1661
+ onChange(syntheticEvent);
1662
+ }
1663
+ return;
1664
+ }
1665
+ setInternalValue(rawValue);
1666
+ setDisplayValue(rawValue);
1667
+ if (typeof onChange === "function") {
1668
+ onChange(e);
1669
+ }
1670
+ };
1671
+ const handleBlur = (e) => {
1672
+ if (!internalValue) {
1673
+ return;
1674
+ }
1675
+ if (variant === "currency") {
1676
+ const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
1677
+ setInternalValue(formatted);
1678
+ setDisplayValue(formatCurrencyDisplay(formatted));
1679
+ const asNumber = Number(formatted);
1680
+ if (!isNaN(asNumber) && onChange) {
1681
+ const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1682
+ target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1683
+ });
1684
+ onChange(syntheticEvent);
1685
+ }
1686
+ } else if (variant === "uom" || variant === "percentage") {
1687
+ const formattedValue = formatDecimalValue(e.target.value, decimals);
1688
+ e.target.value = formattedValue;
1689
+ }
1690
+ onBlur == null ? void 0 : onBlur(e);
1691
+ };
1692
+ const inputProps = getInputProps();
1693
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1694
+ InputBase,
1695
+ __spreadProps(__spreadValues({}, inputProps), {
1696
+ before: getBeforeElement(),
1697
+ after: getAfterElement(),
1698
+ onChange: handleChange,
1699
+ onBlur: handleBlur,
1700
+ testid
1701
+ })
1702
+ );
1703
+ };
1704
+ Input.displayName = "Input";
1705
+ var Finder = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "finder" }));
1706
+ var UOM = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "uom" }));
1707
+ var Currency = (props) => {
1708
+ var _a;
1709
+ const handleCurrencyChange = (e) => {
1710
+ var _a2;
1711
+ (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
1712
+ };
1713
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1714
+ Input,
1715
+ __spreadProps(__spreadValues({}, props), {
1716
+ variant: "currency",
1717
+ decimals: (_a = props.decimals) != null ? _a : 2,
1718
+ onChange: handleCurrencyChange
1719
+ })
1720
+ );
1721
+ };
1722
+ var Percentage = (props) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "percentage" }));
1723
+ Finder.displayName = "Finder";
1724
+ UOM.displayName = "UOM";
1725
+ Currency.displayName = "Currency";
1726
+ Percentage.displayName = "Percentage";
1727
+
1728
+ // src/components/Search.tsx
1729
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1730
+ var Search = (_a) => {
1731
+ var _b = _a, {
1732
+ id,
1733
+ testid,
1734
+ label,
1735
+ error,
1736
+ children,
1737
+ readOnly,
1738
+ renderMenu,
1739
+ onClick,
1740
+ wrapperClassName,
1741
+ removeRoundness
1742
+ } = _b, props = __objRest(_b, [
1743
+ "id",
1744
+ "testid",
1745
+ "label",
1746
+ "error",
1747
+ "children",
1748
+ "readOnly",
1749
+ "renderMenu",
1750
+ "onClick",
1751
+ "wrapperClassName",
1752
+ "removeRoundness"
1753
+ ]);
1754
+ const inputRef = (0, import_react10.useRef)(null);
1755
+ const inputContainerRef = (0, import_react10.useRef)(null);
1756
+ const preventFocusOnInitialRender = (0, import_react10.useRef)(true);
1757
+ const [show, setShow] = (0, import_react10.useState)(false);
1758
+ const [clearing, setClearing] = (0, import_react10.useState)(false);
1759
+ const uniqueId = (0, import_react10.useId)();
1760
+ const searchMenuName = `search-menu-${uniqueId}`;
1761
+ (0, import_react10.useEffect)(() => {
1762
+ var _a2;
1763
+ if (preventFocusOnInitialRender.current) {
1764
+ preventFocusOnInitialRender.current = false;
1765
+ return;
1766
+ }
1767
+ (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
1768
+ }, [props.value]);
1769
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1770
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1771
+ Input,
1772
+ __spreadValues({
1773
+ id,
1774
+ testid,
1775
+ variant: "search",
1776
+ inputContainerRef,
1777
+ ref: inputRef,
1778
+ label,
1779
+ wrapperClassName,
1780
+ onClick: (e) => {
1781
+ if (props.disabled || readOnly) {
1782
+ return;
1783
+ }
1784
+ if (clearing) {
1785
+ setClearing(false);
1786
+ return;
1787
+ }
1788
+ onClick == null ? void 0 : onClick(e);
1789
+ setShow(!show);
1790
+ },
1791
+ onClear: () => {
1792
+ setClearing(true);
1793
+ },
1794
+ onKeyDown: (e) => {
1795
+ setShow(true);
1796
+ if (["ArrowUp", "ArrowDown"].includes(e.key)) {
1797
+ e.preventDefault();
1798
+ const menu = document.querySelector(
1799
+ `[data-menu="${searchMenuName}"]`
1800
+ );
1801
+ const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
1802
+ if (selectedMenuOption) {
1803
+ const allMenuOptions = Array.from(
1804
+ (menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []
1805
+ );
1806
+ const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
1807
+ let targetOption;
1808
+ if (e.key === "ArrowDown") {
1809
+ targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
1810
+ } else {
1811
+ targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
1812
+ }
1813
+ targetOption == null ? void 0 : targetOption.focus();
1814
+ } else {
1815
+ const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
1816
+ '[role="menuitem"]:last-child'
1817
+ );
1818
+ toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
1819
+ }
1820
+ }
1821
+ },
1822
+ error,
1823
+ readOnly,
1824
+ removeRoundness,
1825
+ focus: renderMenu && show
1826
+ }, props)
1827
+ ),
1828
+ renderMenu ? renderMenu({
1829
+ id: id ? `${id}-menu` : void 0,
1830
+ testid: testid ? `${testid}-menu` : void 0,
1831
+ positionTo: inputContainerRef,
1832
+ show,
1833
+ setShow,
1834
+ topOffset: props.caption ? -16 : null,
1835
+ autoFocusOff: true,
1836
+ menuName: searchMenuName
1837
+ }) : children
1838
+ ] });
1839
+ };
1840
+ Search.displayName = "Search";
1841
+
1842
+ // src/components/DataGridCell.tsx
1843
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1844
+ var DataGridCell = (0, import_react11.memo)(
1845
+ (_a) => {
1846
+ var _b = _a, {
1847
+ id,
1848
+ type = "default",
1849
+ component = "static",
1850
+ children,
1851
+ className,
1852
+ locked = false,
1853
+ noPadding = false,
1854
+ paddedLeft = false,
1855
+ style,
1856
+ onClick,
1857
+ onRightClick,
1858
+ error,
1859
+ warning,
1860
+ center,
1861
+ width,
1862
+ minWidth,
1863
+ testid
1864
+ } = _b, props = __objRest(_b, [
1865
+ "id",
1866
+ "type",
1867
+ "component",
1868
+ "children",
1869
+ "className",
1870
+ "locked",
1871
+ "noPadding",
1872
+ "paddedLeft",
1873
+ "style",
1874
+ "onClick",
1875
+ "onRightClick",
1876
+ "error",
1877
+ "warning",
1878
+ "center",
1879
+ "width",
1880
+ "minWidth",
1881
+ "testid"
1882
+ ]);
1883
+ const Element = type === "header" ? "th" : "td";
1884
+ const timerRef = (0, import_react11.useRef)(null);
1885
+ const [isGrabbing, setIsGrabbing] = (0, import_react11.useState)(false);
1886
+ const [isPointerPressed, setIsPointerPressed] = (0, import_react11.useState)(false);
1887
+ (0, import_react11.useEffect)(() => {
1888
+ return () => {
1889
+ if (timerRef.current) {
1890
+ clearTimeout(timerRef.current);
1891
+ timerRef.current = null;
1892
+ }
1893
+ };
1894
+ }, []);
1895
+ const handlePointerDown = (_event) => {
1896
+ setIsPointerPressed(true);
1897
+ timerRef.current = window.setTimeout(() => {
1898
+ setIsGrabbing(true);
1899
+ }, 500);
1900
+ };
1901
+ const handlePointerUp = (event) => {
1902
+ if (timerRef.current) {
1903
+ clearTimeout(timerRef.current);
1904
+ timerRef.current = null;
1905
+ }
1906
+ const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
1907
+ if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
1908
+ onClick(event);
1909
+ }
1910
+ if (rightClick && onRightClick) {
1911
+ onRightClick();
1912
+ }
1913
+ setIsGrabbing(false);
1914
+ setIsPointerPressed(false);
1915
+ };
1916
+ const handlePointerLeave = () => {
1917
+ if (timerRef.current) {
1918
+ clearTimeout(timerRef.current);
1919
+ timerRef.current = null;
1920
+ }
1921
+ };
1922
+ const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
1923
+ const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
1924
+ const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && (0, import_clsx8.default)("border-r");
1925
+ const buttonComponentStyles = component === "button" && (0, import_clsx8.default)("border-r border-b border-border-primary-normal");
1926
+ const iconComponentStyles = component === "icon" && (0, import_clsx8.default)("border-l");
1927
+ const cellClasses = (0, import_clsx8.default)(
1928
+ headerTypeStyles,
1929
+ buttonComponentStyles,
1930
+ headerBgStyles,
1931
+ lockedHeaderBgStyles,
1932
+ iconComponentStyles,
1933
+ className,
1934
+ "flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
1935
+ "focus-within:!z-10",
1936
+ "overflow-x-hidden",
1937
+ "overflow-y-hidden",
1938
+ component === "input" && "border",
1939
+ component === "input" && !error && !warning && "border-border-primary-normal",
1940
+ component === "input" && error && "border-border-primary-error",
1941
+ component === "input" && warning && "border-background-warning-normal",
1942
+ !["button", "icon"].includes(component) && !noPadding && componentPadding,
1943
+ paddedLeft && "pl-2",
1944
+ component === "icon" && "border-l",
1945
+ isGrabbing && "!cursor-grabbing",
1946
+ component === "checkbox" || center && "justify-center"
1947
+ );
1948
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1949
+ Element,
1950
+ __spreadProps(__spreadValues({
1951
+ id,
1952
+ "data-testid": testid,
1953
+ className: (0, import_clsx8.default)("flex h-10", !width && "flex-1"),
1954
+ style: { width, minWidth }
1955
+ }, props), {
1956
+ "data-theme": type === "header" && !locked ? "brand" : void 0,
1957
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1958
+ "div",
1959
+ {
1960
+ className: cellClasses,
1961
+ style: __spreadValues({}, style),
1962
+ onMouseDown: handlePointerDown,
1963
+ onMouseUp: handlePointerUp,
1964
+ onMouseLeave: handlePointerLeave,
1965
+ onTouchStart: handlePointerDown,
1966
+ onTouchEnd: handlePointerUp,
1967
+ onTouchCancel: handlePointerLeave,
1968
+ onContextMenu: (e) => e.preventDefault(),
1969
+ children
1970
+ }
1971
+ )
1972
+ })
1973
+ );
1974
+ }
1975
+ );
1976
+ DataGridCell.displayName = "DataGridCell";
1977
+ function DataCellHeader(_a) {
1978
+ var _b = _a, {
1979
+ header,
1980
+ children,
1981
+ setNodeRef,
1982
+ node,
1983
+ id,
1984
+ testid,
1985
+ useMenuDefaultMinWidth
1986
+ } = _b, props = __objRest(_b, [
1987
+ "header",
1988
+ "children",
1989
+ "setNodeRef",
1990
+ "node",
1991
+ "id",
1992
+ "testid",
1993
+ "useMenuDefaultMinWidth"
1994
+ ]);
1995
+ var _a2;
1996
+ const [showMenu, setShowMenu] = (0, import_react11.useState)(false);
1997
+ const [filter, setFilter] = (0, import_react11.useState)(
1998
+ (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
1999
+ );
2000
+ const ref = (0, import_react11.useRef)(null);
2001
+ const predeterminedPinned = (0, import_react11.useRef)(false);
2002
+ const { column, getContext } = header;
2003
+ const { id: columnId, setFilterValue } = column;
2004
+ const {
2005
+ menuRootRef,
2006
+ isMenuActive,
2007
+ registerSubMenu,
2008
+ listeners: subMenuListeners,
2009
+ mobileHide
2010
+ } = useSubMenuSystem(node ? node : ref);
2011
+ (0, import_react11.useEffect)(() => {
2012
+ var _a3, _b2, _c;
2013
+ const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
2014
+ const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
2015
+ const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
2016
+ predeterminedPinned.current = [...left, ...right].includes(columnId);
2017
+ }, [columnId, getContext]);
2018
+ (0, import_react11.useEffect)(() => {
2019
+ const handler = setTimeout(() => {
2020
+ setFilterValue(filter);
2021
+ }, 500);
2022
+ return () => {
2023
+ clearTimeout(handler);
2024
+ };
2025
+ }, [filter, setFilterValue]);
2026
+ const style = __spreadValues({
2027
+ position: "relative",
2028
+ whiteSpace: "nowrap",
2029
+ minWidth: header.column.getSize(),
2030
+ "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
2031
+ "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
2032
+ "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
2033
+ }, props.style);
2034
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2035
+ DataGridCell,
2036
+ __spreadProps(__spreadValues({
2037
+ id,
2038
+ testid,
2039
+ ref: setNodeRef ? setNodeRef : ref,
2040
+ type: "header",
2041
+ component: "header",
2042
+ style,
2043
+ minWidth: `${header.column.getSize()}px`,
2044
+ onClick: header.column.getToggleSortingHandler(),
2045
+ onRightClick: () => setShowMenu(!showMenu)
2046
+ }, props), {
2047
+ children: [
2048
+ children,
2049
+ header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2050
+ Menu,
2051
+ {
2052
+ id: id ? `${id}-menu` : void 0,
2053
+ testid: testid ? `${testid}-menu` : void 0,
2054
+ ref: menuRootRef,
2055
+ positionTo: node ? node : ref,
2056
+ show: showMenu,
2057
+ setShow: setShowMenu,
2058
+ mobileHide,
2059
+ useDefaultMinWidth: useMenuDefaultMinWidth,
2060
+ children: [
2061
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2062
+ MenuOption,
2063
+ __spreadProps(__spreadValues({
2064
+ id: id ? `${id}-filter-option` : void 0,
2065
+ testid: testid ? `${testid}-filter-option` : void 0
2066
+ }, subMenuListeners), {
2067
+ subMenu: (_b2) => {
2068
+ var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
2069
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2070
+ Menu,
2071
+ __spreadProps(__spreadValues({
2072
+ id: id ? `${id}-filter-submenu` : void 0,
2073
+ testid: testid ? `${testid}-filter-submenu` : void 0
2074
+ }, props2), {
2075
+ show: isMenuActive(menuId, subMenuLevel),
2076
+ ref: (el) => {
2077
+ registerSubMenu(menuId, el);
2078
+ },
2079
+ useDefaultMinWidth: useMenuDefaultMinWidth,
2080
+ children: [
2081
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: (0, import_clsx8.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2082
+ Search,
2083
+ {
2084
+ id: id ? `${id}-filter-search` : void 0,
2085
+ testid: testid ? `${testid}-filter-search` : void 0,
2086
+ onChange: (event) => {
2087
+ setFilter(event.target.value);
2088
+ },
2089
+ onKeyDown: (event) => {
2090
+ if ([" ", "Space"].includes(event.key)) {
2091
+ event.stopPropagation();
2092
+ }
2093
+ },
2094
+ value: filter != null ? filter : ""
2095
+ }
2096
+ ) }),
2097
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2098
+ MenuOption,
2099
+ {
2100
+ id: id ? `${id}-filter-contains` : void 0,
2101
+ testid: testid ? `${testid}-filter-contains` : void 0,
2102
+ onClick: handleFilterFnChange,
2103
+ before: menuOptionIcon("includesString"),
2104
+ children: "Contains"
2105
+ }
2106
+ ),
2107
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2108
+ MenuOption,
2109
+ {
2110
+ id: id ? `${id}-filter-startswith` : void 0,
2111
+ testid: testid ? `${testid}-filter-startswith` : void 0,
2112
+ onClick: handleFilterFnChange,
2113
+ before: menuOptionIcon("startsWith"),
2114
+ children: "Starts with"
2115
+ }
2116
+ ),
2117
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2118
+ MenuOption,
2119
+ {
2120
+ id: id ? `${id}-filter-endswith` : void 0,
2121
+ testid: testid ? `${testid}-filter-endswith` : void 0,
2122
+ onClick: handleFilterFnChange,
2123
+ before: menuOptionIcon("endsWith"),
2124
+ children: "Ends with"
2125
+ }
2126
+ )
2127
+ ]
2128
+ })
2129
+ );
2130
+ },
2131
+ children: "Filter"
2132
+ })
2133
+ ),
2134
+ !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2135
+ MenuOption,
2136
+ __spreadProps(__spreadValues({
2137
+ onClick: () => {
2138
+ setShowMenu(!showMenu);
2139
+ }
2140
+ }, subMenuListeners), {
2141
+ subMenu: (_d) => {
2142
+ var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
2143
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
2144
+ Menu,
2145
+ __spreadProps(__spreadValues({}, props2), {
2146
+ show: isMenuActive(menuId, subMenuLevel),
2147
+ ref: (el) => {
2148
+ registerSubMenu(menuId, el);
2149
+ },
2150
+ children: [
2151
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2152
+ MenuOption,
2153
+ {
2154
+ selected: header.column.getIsPinned() === "left",
2155
+ onClick: () => {
2156
+ if (header.column.getIsPinned() === "left") {
2157
+ header.column.pin(false);
2158
+ } else {
2159
+ header.column.pin("left");
2160
+ }
2161
+ },
2162
+ after: header.column.getIsPinned() === "left" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "check" }),
2163
+ children: "Left"
2164
+ }
2165
+ ),
2166
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2167
+ MenuOption,
2168
+ {
2169
+ selected: header.column.getIsPinned() === "right",
2170
+ onClick: () => {
2171
+ if (header.column.getIsPinned() === "right") {
2172
+ header.column.pin(false);
2173
+ } else {
2174
+ header.column.pin("right");
2175
+ }
2176
+ },
2177
+ after: header.column.getIsPinned() === "right" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { name: "check" }),
2178
+ children: "Right"
2179
+ }
2180
+ )
2181
+ ]
2182
+ })
2183
+ );
2184
+ },
2185
+ children: `Freeze [${header.column.columnDef.header}]`
2186
+ })
2187
+ )
2188
+ ]
2189
+ }
2190
+ )
2191
+ ]
2192
+ })
2193
+ );
2194
+ function menuOptionIcon(value) {
2195
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2196
+ Icon,
2197
+ {
2198
+ name: "check",
2199
+ className: (0, import_clsx8.default)(
2200
+ header.column.columnDef.filterFn !== value && "text-transparent"
2201
+ )
2202
+ }
2203
+ );
2204
+ }
2205
+ function handleFilterFnChange(_id, value) {
2206
+ let filterFn = "includesString";
2207
+ const currentFilterFn = header.column.columnDef.filterFn;
2208
+ if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
2209
+ filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
2210
+ }
2211
+ if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
2212
+ filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
2213
+ }
2214
+ if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
2215
+ filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
2216
+ }
2217
+ header.column.columnDef.filterFn = filterFn;
2218
+ header.column.setFilterValue(filter);
2219
+ }
2220
+ }
2221
+ DataCellHeader.displayName = "DataCellHeader";
2222
+ function DraggableCellHeader(_a) {
2223
+ var _b = _a, {
2224
+ header,
2225
+ children
2226
+ } = _b, props = __objRest(_b, [
2227
+ "header",
2228
+ "children"
2229
+ ]);
2230
+ const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
2231
+ id: header.column.id
2232
+ });
2233
+ const style = {
2234
+ opacity: isDragging ? 0.8 : 1,
2235
+ position: "relative",
2236
+ transform: CSS.Translate.toString(transform),
2237
+ transition: "width transform 0.2s ease-in-out",
2238
+ whiteSpace: "nowrap",
2239
+ zIndex: isDragging ? 1 : 0,
2240
+ "--color-text-primary-normal": "var(--color-action-000)",
2241
+ "--color-icon-on-action-primary-normal": "var(--color-action-000)",
2242
+ userSelect: "none"
2243
+ };
2244
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2245
+ DataCellHeader,
2246
+ __spreadProps(__spreadValues(__spreadValues(__spreadValues({
2247
+ header,
2248
+ setNodeRef,
2249
+ node,
2250
+ style
2251
+ }, props), attributes), listeners), {
2252
+ children
2253
+ })
2254
+ );
2255
+ }
2256
+ DraggableCellHeader.displayName = "DraggableCellHeader";
2257
+ function DragAlongCell(_a) {
2258
+ var _b = _a, {
2259
+ cell,
2260
+ children
2261
+ } = _b, props = __objRest(_b, [
2262
+ "cell",
2263
+ "children"
2264
+ ]);
2265
+ const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
2266
+ id: cell.column.id
2267
+ });
2268
+ const style = {
2269
+ opacity: isDragging ? 0.8 : 1,
2270
+ position: "relative",
2271
+ transform: CSS.Translate.toString(transform),
2272
+ transition: "width transform 0.2s ease-in-out",
2273
+ minWidth: cell.column.getSize(),
2274
+ zIndex: isDragging ? 1 : 0
2275
+ };
2276
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
2277
+ }
2278
+ DragAlongCell.displayName = "DragAlongCell";
2279
+
2280
+ // src/components/DataGrid/index.tsx
2281
+ var import_react16 = __toESM(require("react"), 1);
2282
+ var import_react_table3 = require("@tanstack/react-table");
2283
+ var import_core = require("@dnd-kit/core");
2284
+ var import_sortable2 = require("@dnd-kit/sortable");
2285
+ var import_modifiers = require("@dnd-kit/modifiers");
2286
+ var import_react_virtual2 = require("@tanstack/react-virtual");
2287
+ var import_clsx13 = __toESM(require("clsx"), 1);
2288
+
2289
+ // src/components/DataGrid/PinnedColumns.tsx
2290
+ var import_react_table2 = require("@tanstack/react-table");
2291
+ var import_clsx12 = __toESM(require("clsx"), 1);
2292
+
2293
+ // src/components/DataGrid/utils.tsx
2294
+ var import_clsx9 = __toESM(require("clsx"), 1);
2295
+ var import_jsx_runtime9 = require("react/jsx-runtime");
2296
+ function getSortIcon(sort, nextSort = false) {
2297
+ const iconClassName = (0, import_clsx9.default)(
2298
+ "text-icon-on-action-primary-normal",
2299
+ nextSort && "hidden group-hover:block"
2300
+ );
2301
+ if (sort === "asc")
2302
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_upward" });
2303
+ if (sort === "desc")
2304
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { size: 16, className: iconClassName, name: "arrow_downward" });
2305
+ return null;
2306
+ }
2307
+
2308
+ // src/components/DataGrid/PinnedColumns.tsx
2309
+ var import_react15 = __toESM(require("react"), 1);
2310
+
2311
+ // src/components/DataGrid/TableBody/index.tsx
2312
+ var import_react_virtual = require("@tanstack/react-virtual");
2313
+ var import_clsx11 = __toESM(require("clsx"), 1);
2314
+
2315
+ // src/components/DataGrid/TableBody/TableBodyRow.tsx
2316
+ var import_clsx10 = __toESM(require("clsx"), 1);
2317
+ var import_react_table = require("@tanstack/react-table");
2318
+ var import_react12 = __toESM(require("react"), 1);
2319
+ var import_jsx_runtime10 = require("react/jsx-runtime");
2320
+ function TableBodyRow({
2321
+ id,
2322
+ testid,
2323
+ columnVirtualizer,
2324
+ row,
2325
+ // rowVirtualizer,
2326
+ virtualPaddingLeft,
2327
+ virtualPaddingRight,
2328
+ virtualRow,
2329
+ showFilterRow,
2330
+ enableColumnSelector = false,
2331
+ locked,
2332
+ pinDirection
2333
+ }) {
2334
+ var _a;
2335
+ let visibleCells;
2336
+ if (locked) {
2337
+ visibleCells = pinDirection === "left" ? row.getLeftVisibleCells() : row.getRightVisibleCells();
2338
+ } else {
2339
+ visibleCells = row.getCenterVisibleCells();
2340
+ }
2341
+ const virtualColumns = (_a = columnVirtualizer == null ? void 0 : columnVirtualizer.getVirtualItems()) != null ? _a : [];
2342
+ const columns = locked ? visibleCells : virtualColumns;
2343
+ const isError = typeof row.original === "object" && row.original !== null && "rowState" in row.original && row.original.rowState === "error";
2344
+ const CellElement = locked ? DataGridCell : DragAlongCell;
2345
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2346
+ "tr",
2347
+ {
2348
+ className: (0, import_clsx10.default)(
2349
+ "min-h-10",
2350
+ "transition-colors hover:bg-background-action-secondary-hover",
2351
+ row.getIsSelected() && "!bg-background-action-secondary-hover",
2352
+ isError && "!bg-background-action-critical-secondary-hover",
2353
+ showFilterRow ? "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal" : "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal"
2354
+ ),
2355
+ id: id ? `${id}-row-${row.id}` : void 0,
2356
+ "data-testid": testid ? `${testid}-row-${row.id}` : void 0,
2357
+ style: {
2358
+ display: "flex",
2359
+ position: "absolute",
2360
+ transform: `translateY(${showFilterRow ? virtualRow.start + 40 : virtualRow.start}px)`,
2361
+ width: "100%"
2362
+ },
2363
+ children: [
2364
+ !locked && virtualPaddingLeft ? (
2365
+ // fake empty column to the left for virtualization scroll padding
2366
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { style: { display: "flex", width: virtualPaddingLeft } })
2367
+ ) : null,
2368
+ columns.map((column) => {
2369
+ var _a2, _b;
2370
+ const cell = locked ? column : visibleCells[column.index];
2371
+ if (!cell) {
2372
+ return;
2373
+ }
2374
+ const cellAlignment = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.align;
2375
+ const cellValue = cell.getValue();
2376
+ return ((_b = cell.column.columnDef.meta) == null ? void 0 : _b.useCustomRenderer) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react12.default.Fragment, { children: (0, import_react_table.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2377
+ CellElement,
2378
+ {
2379
+ id: id ? `${id}-row-${row.id}-cell-${cell.id}` : void 0,
2380
+ testid: testid ? `${testid}-row-${row.id}-cell-${cell.id}` : void 0,
2381
+ cell,
2382
+ className: (0, import_clsx10.default)(
2383
+ cellAlignment ? {
2384
+ "justify-start": cellAlignment === "left",
2385
+ "justify-end": cellAlignment === "right"
2386
+ } : {
2387
+ "justify-end": typeof cellValue === "number"
2388
+ }
2389
+ ),
2390
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2391
+ Tooltip,
2392
+ {
2393
+ id: id ? `${id}-tooltip-${cell.id}` : void 0,
2394
+ testid: testid ? `${testid}-tooltip-${cell.id}` : void 0,
2395
+ showOnTruncation: true,
2396
+ message: cellValue,
2397
+ position: "bottom",
2398
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Paragraph, { addOverflow: true, tall: true, children: cellValue })
2399
+ }
2400
+ )
2401
+ },
2402
+ cell.id
2403
+ );
2404
+ }),
2405
+ !locked && virtualPaddingRight ? (
2406
+ // fake empty column to the right for virtualization scroll padding
2407
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { style: { display: "flex", width: virtualPaddingRight } })
2408
+ ) : null,
2409
+ enableColumnSelector && !locked && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: "p-2", style: { width: "48.8px" } })
2410
+ ]
2411
+ },
2412
+ row.id
2413
+ );
2414
+ }
2415
+
2416
+ // src/components/DataGrid/TableBody/LoadingCell.tsx
2417
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2418
+ function LoadingCell({
2419
+ id,
2420
+ testid,
2421
+ column
2422
+ }) {
2423
+ const key = `loading-${column.id}`;
2424
+ if (column.cell === "checkbox") {
2425
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Checkbox, { id: id ? `${id}-${key}-checkbox` : void 0, testid: testid ? `${testid}-${key}-checkbox` : void 0, disabled: true }) }, key);
2426
+ }
2427
+ if (column.cell === "input") {
2428
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2429
+ DataGridCell,
2430
+ {
2431
+ id: id ? `${id}-${key}` : void 0,
2432
+ testid: testid ? `${testid}-${key}` : void 0,
2433
+ component: "input",
2434
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2435
+ Input,
2436
+ {
2437
+ id: id ? `${id}-${key}-input` : void 0,
2438
+ testid: testid ? `${testid}-${key}-input` : void 0,
2439
+ align: "left",
2440
+ disabled: true,
2441
+ wrapperClassName: "!rounded-none !border-0"
2442
+ }
2443
+ )
2444
+ },
2445
+ key
2446
+ );
2447
+ }
2448
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DataGridCell, { id: id ? `${id}-${key}` : void 0, testid: testid ? `${testid}-${key}` : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "bg-linear-270 to-neutral-300/[24%] from-neutral-300/[12%] rounded-xs w-full max-w-25 h-6" }) }, key);
2449
+ }
2450
+
2451
+ // src/components/DataGrid/TableBody/index.tsx
2452
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2453
+ function TableBody({
2454
+ id,
2455
+ testid,
2456
+ columnVirtualizer,
2457
+ table,
2458
+ tableContainerRef,
2459
+ virtualPaddingLeft,
2460
+ virtualPaddingRight,
2461
+ pagination,
2462
+ isLoadingMore,
2463
+ hasMore,
2464
+ showFilterRow,
2465
+ enableColumnSelector = false,
2466
+ locked,
2467
+ pinDirection
2468
+ }) {
2469
+ const { rows } = table.getRowModel();
2470
+ const rowVirtualizer = (0, import_react_virtual.useVirtualizer)({
2471
+ count: rows.length,
2472
+ estimateSize: () => 40,
2473
+ getScrollElement: () => tableContainerRef.current,
2474
+ overscan: 8
2475
+ });
2476
+ const virtualRows = rowVirtualizer.getVirtualItems();
2477
+ const CellElement = locked ? DataGridCell : DragAlongCell;
2478
+ let headerGroups;
2479
+ if (pinDirection === "left") {
2480
+ headerGroups = table.getLeftHeaderGroups();
2481
+ } else if (pinDirection === "right") {
2482
+ headerGroups = table.getRightHeaderGroups();
2483
+ } else {
2484
+ headerGroups = table.getCenterHeaderGroups();
2485
+ }
2486
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2487
+ "tbody",
2488
+ {
2489
+ className: (0, import_clsx11.default)(locked ? "shadow-16" : ""),
2490
+ style: {
2491
+ display: "grid",
2492
+ height: `${showFilterRow ? rowVirtualizer.getTotalSize() + 40 : rowVirtualizer.getTotalSize()}px`,
2493
+ // tells scrollbar how big the table is
2494
+ position: "relative"
2495
+ // needed for absolute positioning of rows
2496
+ },
2497
+ children: [
2498
+ showFilterRow && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2499
+ "tr",
2500
+ {
2501
+ style: {
2502
+ display: "flex",
2503
+ position: "sticky",
2504
+ top: "40px",
2505
+ width: "100%",
2506
+ height: "40px",
2507
+ zIndex: 10
2508
+ },
2509
+ className: "even:bg-background-grouped-primary-normal odd:bg-background-grouped-secondary-normal",
2510
+ "data-testid": testid ? `${testid}-filter-row` : void 0,
2511
+ children: headerGroups.flatMap(
2512
+ (x) => x.headers.map((header) => {
2513
+ var _a, _b, _c, _d, _e;
2514
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2515
+ CellElement,
2516
+ {
2517
+ id: id ? `${id}-filter-cell-${header.id}` : void 0,
2518
+ testid: testid ? `${testid}-filter-cell-${header.id}` : void 0,
2519
+ noPadding: true,
2520
+ cell: header,
2521
+ width: ((_a = header.column.columnDef.meta) == null ? void 0 : _a.headerWidth) || (locked ? `${header.column.getSize()}px` : ""),
2522
+ children: header.column.getCanFilter() && ((_e = (_c = (_b = header.column.columnDef.meta) == null ? void 0 : _b.filterRowCell) == null ? void 0 : _c.call(_b, {
2523
+ header,
2524
+ table
2525
+ })) != null ? _e : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2526
+ Search,
2527
+ {
2528
+ id: id ? `${id}-filter-search-${header.id}` : void 0,
2529
+ testid: testid ? `${testid}-filter-search-${header.id}` : void 0,
2530
+ removeRoundness: true,
2531
+ onChange: (e) => header.column.setFilterValue(e.target.value),
2532
+ value: (_d = header.column.getFilterValue()) != null ? _d : "",
2533
+ placeholder: "",
2534
+ removeSearchIcon: true
2535
+ }
2536
+ ))
2537
+ },
2538
+ header.id
2539
+ );
2540
+ })
2541
+ )
2542
+ }
2543
+ ),
2544
+ virtualRows.map((virtualRow) => {
2545
+ const row = rows[virtualRow.index];
2546
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2547
+ TableBodyRow,
2548
+ {
2549
+ id,
2550
+ testid,
2551
+ columnVirtualizer,
2552
+ row,
2553
+ rowVirtualizer,
2554
+ virtualPaddingLeft,
2555
+ virtualPaddingRight,
2556
+ virtualRow,
2557
+ showFilterRow,
2558
+ enableColumnSelector,
2559
+ locked,
2560
+ pinDirection
2561
+ },
2562
+ row.id
2563
+ );
2564
+ }),
2565
+ !pagination && isLoadingMore && hasMore && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2566
+ "tr",
2567
+ {
2568
+ style: {
2569
+ display: "flex",
2570
+ position: "absolute",
2571
+ width: "100%",
2572
+ transform: `translateY(${virtualRows[virtualRows.length - 1].start + 40}px)`
2573
+ },
2574
+ className: "odd:bg-background-grouped-primary-normal even:bg-background-grouped-secondary-normal",
2575
+ children: table.getAllLeafColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2576
+ LoadingCell,
2577
+ {
2578
+ id,
2579
+ testid,
2580
+ column: column.columnDef
2581
+ },
2582
+ column.id
2583
+ ))
2584
+ }
2585
+ )
2586
+ ]
2587
+ }
2588
+ );
2589
+ }
2590
+
2591
+ // src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
2592
+ var import_react14 = require("react");
2593
+
2594
+ // src/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.tsx
2595
+ var import_react13 = require("react");
2596
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2597
+ function ColumnSelectorMenuOption({
2598
+ id,
2599
+ testid,
2600
+ column,
2601
+ toggleColumnVisibility
2602
+ }) {
2603
+ const [isVisible, setIsVisible] = (0, import_react13.useState)(column.getIsVisible());
2604
+ const label = typeof column.columnDef.header === "string" ? column.columnDef.header : null;
2605
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MenuOption, { id, testid, selected: isVisible, defaultChecked: isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2606
+ Checkbox,
2607
+ {
2608
+ id: id ? `${id}-checkbox` : void 0,
2609
+ testid: testid ? `${testid}-checkbox` : void 0,
2610
+ label: label != null ? label : "Unknown",
2611
+ checked: isVisible,
2612
+ onChange: (e) => {
2613
+ setIsVisible(e.target.checked);
2614
+ toggleColumnVisibility(column.id, e.target.checked);
2615
+ }
2616
+ }
2617
+ ) });
2618
+ }
2619
+
2620
+ // src/components/DataGrid/ColumnSelectorHeaderCell/index.tsx
2621
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2622
+ function ColumnSelectorHeaderCell({
2623
+ id,
2624
+ testid,
2625
+ table,
2626
+ toggleColumnVisibility,
2627
+ resetColumnVisibility
2628
+ }) {
2629
+ const ref = (0, import_react14.useRef)(null);
2630
+ const [show, setShow] = (0, import_react14.useState)(false);
2631
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2632
+ DataGridCell,
2633
+ {
2634
+ id,
2635
+ testid,
2636
+ width: "48px",
2637
+ type: "header",
2638
+ color: "text-secondary-normal",
2639
+ ref,
2640
+ children: [
2641
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2642
+ Button,
2643
+ {
2644
+ id: id ? `${id}-button` : void 0,
2645
+ testid: testid ? `${testid}-button` : void 0,
2646
+ onClick: () => setShow((prev) => !prev),
2647
+ variant: "navigation",
2648
+ iconOnly: true,
2649
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "tune" })
2650
+ }
2651
+ ),
2652
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2653
+ Menu,
2654
+ {
2655
+ id: id ? `${id}-menu` : void 0,
2656
+ testid: testid ? `${testid}-menu` : void 0,
2657
+ positionTo: ref,
2658
+ position: "bottom-right",
2659
+ show,
2660
+ setShow,
2661
+ calculateMinMaxHeight: true,
2662
+ children: [
2663
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2664
+ Button,
2665
+ {
2666
+ id: id ? `${id}-reset-button` : void 0,
2667
+ testid: testid ? `${testid}-reset-button` : void 0,
2668
+ variant: "tertiary",
2669
+ onClick: () => {
2670
+ resetColumnVisibility();
2671
+ setShow(false);
2672
+ },
2673
+ children: "Reset to default"
2674
+ }
2675
+ ),
2676
+ table.getAllColumns().filter((x) => {
2677
+ var _a;
2678
+ return (_a = x.columnDef.meta) == null ? void 0 : _a.inVisibilityMenu;
2679
+ }).map((column) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2680
+ ColumnSelectorMenuOption,
2681
+ {
2682
+ id: id ? `${id}-option-${column.id}` : void 0,
2683
+ testid: testid ? `${testid}-option-${column.id}` : void 0,
2684
+ column,
2685
+ toggleColumnVisibility
2686
+ },
2687
+ column.id
2688
+ ))
2689
+ ]
2690
+ }
2691
+ )
2692
+ ]
2693
+ }
2694
+ );
2695
+ }
2696
+
2697
+ // src/components/DataGrid/PinnedColumns.tsx
2698
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2699
+ function PinnedColumns(_a) {
2700
+ var _b = _a, {
2701
+ id,
2702
+ pinDirection = "left",
2703
+ table,
2704
+ centerHeader,
2705
+ allSelectedAcrossPages,
2706
+ someSelectedAcrossPages,
2707
+ toggleSelectAllAcrossPages,
2708
+ testid,
2709
+ enableColumnSelector,
2710
+ toggleColumnVisibility,
2711
+ resetColumnVisibility
2712
+ } = _b, props = __objRest(_b, [
2713
+ "id",
2714
+ "pinDirection",
2715
+ "table",
2716
+ "centerHeader",
2717
+ "allSelectedAcrossPages",
2718
+ "someSelectedAcrossPages",
2719
+ "toggleSelectAllAcrossPages",
2720
+ "testid",
2721
+ "enableColumnSelector",
2722
+ "toggleColumnVisibility",
2723
+ "resetColumnVisibility"
2724
+ ]);
2725
+ var _a2;
2726
+ const headerGroups = pinDirection === "left" ? table.getLeftHeaderGroups() : table.getRightHeaderGroups();
2727
+ const pinnedTestId = testid ? `${pinDirection}-pinned-${testid}` : void 0;
2728
+ const hasAnyHeaders = ((_a2 = headerGroups[0]) == null ? void 0 : _a2.headers.length) > 0;
2729
+ if (!hasAnyHeaders && !enableColumnSelector) return;
2730
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2731
+ "table",
2732
+ {
2733
+ className: (0, import_clsx12.default)(
2734
+ "flex flex-col min-h-min sticky z-20",
2735
+ pinDirection === "left" ? "left-0" : "right-0"
2736
+ ),
2737
+ "data-testid": pinnedTestId,
2738
+ children: [
2739
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: "sticky top-0 z-20 grid", children: headerGroups.map((headerGroup) => {
2740
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2741
+ "tr",
2742
+ {
2743
+ "data-testid": pinnedTestId ? `${pinnedTestId}-header-row-${headerGroup.id}` : void 0,
2744
+ className: "flex w-full",
2745
+ children: [
2746
+ headerGroup.headers.map((header) => {
2747
+ var _a3, _b2, _c;
2748
+ if (!header) {
2749
+ return;
2750
+ }
2751
+ if (typeof header.column.columnDef.header === "string") {
2752
+ const customHeaderWidth = (_a3 = header.column.columnDef.meta) == null ? void 0 : _a3.headerWidth;
2753
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2754
+ DataCellHeader,
2755
+ {
2756
+ locked: true,
2757
+ testid: pinnedTestId ? `${pinnedTestId}-header-${header.id}` : void 0,
2758
+ header,
2759
+ center: centerHeader,
2760
+ width: customHeaderWidth,
2761
+ className: (0, import_clsx12.default)(
2762
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
2763
+ "group"
2764
+ ),
2765
+ children: [
2766
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
2767
+ getSortIcon(header.column.getIsSorted()),
2768
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(header.column.getNextSortingOrder(), true),
2769
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
2770
+ !((_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.locked) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2771
+ "div",
2772
+ {
2773
+ onDoubleClick: (e) => {
2774
+ e.stopPropagation();
2775
+ header.column.resetSize();
2776
+ },
2777
+ onMouseDown: (e) => {
2778
+ e.stopPropagation();
2779
+ header.getResizeHandler()(e);
2780
+ },
2781
+ onTouchStart: (e) => {
2782
+ e.stopPropagation();
2783
+ header.getResizeHandler()(e);
2784
+ },
2785
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
2786
+ }
2787
+ )
2788
+ ]
2789
+ },
2790
+ header.id
2791
+ );
2792
+ }
2793
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.default.Fragment, { children: ((_c = header.column.columnDef.meta) == null ? void 0 : _c.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DataGridCell, { type: "header", component: "checkbox", locked: true, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2794
+ Checkbox,
2795
+ {
2796
+ checked: allSelectedAcrossPages,
2797
+ indeterminate: someSelectedAcrossPages,
2798
+ onChange: toggleSelectAllAcrossPages
2799
+ }
2800
+ ) }) : (0, import_react_table2.flexRender)(
2801
+ header.column.columnDef.header,
2802
+ header.getContext()
2803
+ ) }, header.id);
2804
+ }),
2805
+ enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2806
+ ColumnSelectorHeaderCell,
2807
+ {
2808
+ id: id ? `${id}-column-selector` : void 0,
2809
+ testid: testid ? `${testid}-column-selector` : void 0,
2810
+ table,
2811
+ toggleColumnVisibility: toggleColumnVisibility != null ? toggleColumnVisibility : () => {
2812
+ },
2813
+ resetColumnVisibility: resetColumnVisibility != null ? resetColumnVisibility : () => {
2814
+ }
2815
+ }
2816
+ )
2817
+ ]
2818
+ },
2819
+ headerGroup.id
2820
+ );
2821
+ }) }),
2822
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2823
+ TableBody,
2824
+ __spreadProps(__spreadValues({
2825
+ testid: pinnedTestId
2826
+ }, props), {
2827
+ table,
2828
+ locked: !enableColumnSelector,
2829
+ pinDirection
2830
+ })
2831
+ )
2832
+ ]
2833
+ }
2834
+ );
2835
+ }
2836
+
2837
+ // static/no-results-image.png
2838
+ var no_results_image_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAMPWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbQAAlJCb4JIDSAlhBZAehFshCRAKDEGgoodWVRwLahYwIauiih2QOyInUWx9wURFWVdLNiVNymg677yvck3M3/+OfOfM+fOLQOA+kmuWJyDagCQK8qXxIYEMMYmpzBITwEFkOEPBd5cXp6YFR0dAWAZ7P9e3t0EiKy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+9+rSAj+z1/ZiFkTcEIACBwAR2LT+tgmqCsyhafdQE5ePFi7yHAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABCAAAQg4J/D/AQUY8n0knD4qAAAAAElFTkSuQmCC";
2839
+
2840
+ // src/components/DataGrid/index.tsx
2841
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2842
+ var PAGE_SIZE_OPTIONS = [5, 10, 15, 20, 25, 30, 35];
2843
+ var NO_RESULTS_HEIGHT = "h-[185px]";
2844
+ function DataGrid({
2845
+ id,
2846
+ rowIdAccessor,
2847
+ testid,
2848
+ data,
2849
+ columns,
2850
+ status,
2851
+ isLoadingMore = false,
2852
+ onLoadMore,
2853
+ pagination,
2854
+ showFilterRow = false,
2855
+ hasMore = false,
2856
+ sorting: externalSorting,
2857
+ onSortingChange,
2858
+ columnFilters: externalColumnFilters,
2859
+ onColumnFiltersChange,
2860
+ rowSelection: externalRowSelection,
2861
+ onRowSelectionChange,
2862
+ filteredSortedData,
2863
+ totalRowCount,
2864
+ hideStatusBar,
2865
+ centerHeader,
2866
+ enableColumnSelector,
2867
+ predeterminedLeftPins = [],
2868
+ predeterminedRightPins = [],
2869
+ useMenuDefaultMinWidth
2870
+ }) {
2871
+ var _a, _b, _c, _d, _e, _f, _g;
2872
+ const [localSorting, setLocalSorting] = (0, import_react16.useState)([]);
2873
+ const [localColumnFilters, setLocalColumnFilters] = (0, import_react16.useState)([]);
2874
+ const [localRowSelection, setLocalRowSelection] = (0, import_react16.useState)({});
2875
+ const { columns: tableColumns, setColumns: setTableColumns } = useTableLayout(columns, id != null ? id : testid);
2876
+ const [columnOrder, setColumnOrder] = (0, import_react16.useState)(
2877
+ tableColumns.map((c) => c.id)
2878
+ );
2879
+ const [columnVisibility, setColumnVisibility] = (0, import_react16.useState)(
2880
+ Object.fromEntries(
2881
+ tableColumns.filter((column) => !!column.id).map((column) => {
2882
+ var _a2, _b2;
2883
+ return [column.id, (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true];
2884
+ })
2885
+ )
2886
+ );
2887
+ const resetColumnVisibility = (0, import_react16.useCallback)(
2888
+ (updateOrder) => {
2889
+ setColumnVisibility(
2890
+ Object.fromEntries(
2891
+ tableColumns.filter((column) => !!column.id).map((column) => {
2892
+ var _a2, _b2;
2893
+ return [column.id, (_b2 = (_a2 = column.meta) == null ? void 0 : _a2.visible) != null ? _b2 : true];
2894
+ })
2895
+ )
2896
+ );
2897
+ if (updateOrder) setColumnOrder(tableColumns.map((c) => c.id));
2898
+ },
2899
+ [tableColumns]
2900
+ );
2901
+ (0, import_react16.useEffect)(() => {
2902
+ resetColumnVisibility(true);
2903
+ }, [resetColumnVisibility]);
2904
+ const sortingState = pagination ? externalSorting != null ? externalSorting : localSorting : localSorting;
2905
+ const setSortingState = pagination ? (updaterOrValue) => {
2906
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(
2907
+ externalSorting != null ? externalSorting : []
2908
+ ) : updaterOrValue;
2909
+ (onSortingChange != null ? onSortingChange : setLocalSorting)(value);
2910
+ } : setLocalSorting;
2911
+ const columnFilterState = pagination ? externalColumnFilters != null ? externalColumnFilters : localColumnFilters : localColumnFilters;
2912
+ const setColumnFilterState = pagination ? (updaterOrValue) => {
2913
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalColumnFilters != null ? externalColumnFilters : []) : updaterOrValue;
2914
+ (onColumnFiltersChange != null ? onColumnFiltersChange : setLocalColumnFilters)(value);
2915
+ } : setLocalColumnFilters;
2916
+ const rowSelection = externalRowSelection != null ? externalRowSelection : localRowSelection;
2917
+ const setRowSelection = (0, import_react16.useCallback)(
2918
+ (updaterOrValue) => {
2919
+ if (pagination) {
2920
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
2921
+ (onRowSelectionChange != null ? onRowSelectionChange : setLocalRowSelection)(value);
2922
+ } else if (externalRowSelection && onRowSelectionChange) {
2923
+ const value = typeof updaterOrValue === "function" ? updaterOrValue(externalRowSelection != null ? externalRowSelection : {}) : updaterOrValue;
2924
+ onRowSelectionChange(value);
2925
+ } else {
2926
+ setLocalRowSelection(updaterOrValue);
2927
+ }
2928
+ },
2929
+ [externalRowSelection, onRowSelectionChange, pagination]
2930
+ );
2931
+ const dndId = (0, import_react16.useId)();
2932
+ const containerRef = import_react16.default.useRef(null);
2933
+ const toggleColumnVisibility = (0, import_react16.useCallback)(
2934
+ (columnId, isVisible) => {
2935
+ setTableColumns((prev) => {
2936
+ const persistedIndex = prev.findIndex((col) => col.id === columnId);
2937
+ if (persistedIndex !== -1) {
2938
+ prev[persistedIndex].meta = __spreadProps(__spreadValues({}, prev[persistedIndex].meta), {
2939
+ visible: isVisible
2940
+ });
2941
+ }
2942
+ return [...prev];
2943
+ }, true);
2944
+ },
2945
+ [setTableColumns]
2946
+ );
2947
+ const table = (0, import_react_table3.useReactTable)({
2948
+ columns: tableColumns,
2949
+ data,
2950
+ getCoreRowModel: (0, import_react_table3.getCoreRowModel)(),
2951
+ getSortedRowModel: (0, import_react_table3.getSortedRowModel)(),
2952
+ getFilteredRowModel: (0, import_react_table3.getFilteredRowModel)(),
2953
+ columnResizeMode: "onChange",
2954
+ getRowId: rowIdAccessor ? (row) => String(row[rowIdAccessor]) : (row, index) => {
2955
+ var _a2;
2956
+ return String((_a2 = row.id) != null ? _a2 : index + 1);
2957
+ },
2958
+ state: {
2959
+ columnOrder,
2960
+ sorting: sortingState,
2961
+ columnFilters: columnFilterState,
2962
+ rowSelection,
2963
+ columnVisibility
2964
+ },
2965
+ initialState: {
2966
+ columnPinning: {
2967
+ left: predeterminedLeftPins,
2968
+ right: predeterminedRightPins
2969
+ }
2970
+ },
2971
+ enableColumnPinning: (predeterminedLeftPins == null ? void 0 : predeterminedLeftPins.length) > 0 || predeterminedRightPins.length > 0,
2972
+ onColumnOrderChange: setColumnOrder,
2973
+ onSortingChange: adaptTableStateSetter(setSortingState),
2974
+ onColumnFiltersChange: adaptTableStateSetter(setColumnFilterState),
2975
+ onRowSelectionChange: adaptTableStateSetter(setRowSelection),
2976
+ filterFns: {
2977
+ startsWith: (row, columnId, filterValue) => {
2978
+ const cellValue = row == null ? void 0 : row.getValue(columnId);
2979
+ if (!cellValue || !filterValue) {
2980
+ return true;
2981
+ }
2982
+ return String(cellValue).toLowerCase().startsWith(String(filterValue).toLowerCase());
2983
+ },
2984
+ endsWith: (row, columnId, filterValue) => {
2985
+ const cellValue = row == null ? void 0 : row.getValue(columnId);
2986
+ if (!cellValue || !filterValue) {
2987
+ return true;
2988
+ }
2989
+ return String(cellValue).toLowerCase().endsWith(String(filterValue).toLowerCase());
2990
+ }
2991
+ }
2992
+ });
2993
+ const allRowIds = pagination ? (_a = filteredSortedData == null ? void 0 : filteredSortedData.map((row) => String(row.id))) != null ? _a : [] : Array.from(
2994
+ { length: totalRowCount != null ? totalRowCount : data.length },
2995
+ (_, i) => String(i + 1)
2996
+ );
2997
+ const allSelectedAcrossPages = allRowIds.every(
2998
+ (rowId) => rowSelection[rowId]
2999
+ );
3000
+ const someSelectedAcrossPages = !allSelectedAcrossPages && allRowIds.some((rowId) => rowSelection[rowId]);
3001
+ const toggleSelectAllAcrossPages = () => {
3002
+ setRowSelection((prev) => {
3003
+ const isSelecting = !allSelectedAcrossPages;
3004
+ if (isSelecting) {
3005
+ const newSelection = {};
3006
+ for (const rowId of allRowIds) {
3007
+ newSelection[rowId] = true;
3008
+ }
3009
+ return __spreadValues(__spreadValues({}, prev), newSelection);
3010
+ } else {
3011
+ const updatedSelection = __spreadValues({}, prev);
3012
+ for (const rowId of allRowIds) {
3013
+ delete updatedSelection[rowId];
3014
+ }
3015
+ return updatedSelection;
3016
+ }
3017
+ });
3018
+ };
3019
+ useInfiniteScroll({
3020
+ containerRef,
3021
+ onLoadMore: onLoadMore != null ? onLoadMore : () => {
3022
+ },
3023
+ isLoading: isLoadingMore,
3024
+ enabled: !pagination
3025
+ });
3026
+ const handleDragEnd = (event) => {
3027
+ const { active, over } = event;
3028
+ if (active && over && active.id !== over.id) {
3029
+ setColumnOrder((prev) => {
3030
+ const oldIndex = prev.indexOf(active.id);
3031
+ const newIndex = prev.indexOf(over.id);
3032
+ const newOrder = (0, import_sortable2.arrayMove)(prev, oldIndex, newIndex);
3033
+ setTableColumns((prev2) => {
3034
+ const res = newOrder.map((id2) => prev2.find((col) => col.id === id2)).filter(Boolean);
3035
+ return res;
3036
+ });
3037
+ return newOrder;
3038
+ });
3039
+ }
3040
+ };
3041
+ const sensors = (0, import_core.useSensors)(
3042
+ (0, import_core.useSensor)(import_core.MouseSensor),
3043
+ (0, import_core.useSensor)(import_core.TouchSensor),
3044
+ (0, import_core.useSensor)(import_core.KeyboardSensor)
3045
+ );
3046
+ const visibleColumns = table.getVisibleLeafColumns();
3047
+ const columnVirtualizer = (0, import_react_virtual2.useVirtualizer)({
3048
+ count: visibleColumns.length,
3049
+ estimateSize: (index) => visibleColumns[index].getSize(),
3050
+ //estimate width of each column for accurate scrollbar dragging
3051
+ getScrollElement: () => containerRef.current,
3052
+ horizontal: true,
3053
+ overscan: 8
3054
+ //how many columns to render on each side off screen each way
3055
+ });
3056
+ const virtualColumns = columnVirtualizer.getVirtualItems();
3057
+ let virtualPaddingLeft;
3058
+ let virtualPaddingRight;
3059
+ if (columnVirtualizer && (virtualColumns == null ? void 0 : virtualColumns.length)) {
3060
+ virtualPaddingLeft = (_c = (_b = virtualColumns[0]) == null ? void 0 : _b.start) != null ? _c : 0;
3061
+ virtualPaddingRight = columnVirtualizer.getTotalSize() - ((_e = (_d = virtualColumns[virtualColumns.length - 1]) == null ? void 0 : _d.end) != null ? _e : 0);
3062
+ }
3063
+ const empty = table.getRowModel().rows.length === 0;
3064
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3065
+ import_core.DndContext,
3066
+ {
3067
+ id: dndId,
3068
+ collisionDetection: import_core.closestCenter,
3069
+ modifiers: [import_modifiers.restrictToHorizontalAxis],
3070
+ onDragEnd: handleDragEnd,
3071
+ sensors,
3072
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3073
+ import_sortable2.SortableContext,
3074
+ {
3075
+ items: columnOrder,
3076
+ strategy: import_sortable2.horizontalListSortingStrategy,
3077
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3078
+ "div",
3079
+ {
3080
+ id,
3081
+ "data-testid": testid,
3082
+ className: "flex flex-col flex-1 h-full w-full rounded border border-border-primary-normal overflow-hidden text-text-primary-normal",
3083
+ children: [
3084
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3085
+ "div",
3086
+ {
3087
+ className: (0, import_clsx13.default)(
3088
+ "flex overflow-auto scrollbar-thin relative contain-paint will-change-transform",
3089
+ empty ? "overflow-y-hidden" : "min-h-[120px]"
3090
+ ),
3091
+ ref: containerRef,
3092
+ children: [
3093
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3094
+ PinnedColumns,
3095
+ {
3096
+ testid,
3097
+ pinDirection: "left",
3098
+ table,
3099
+ tableContainerRef: containerRef,
3100
+ pagination,
3101
+ isLoadingMore,
3102
+ hasMore,
3103
+ showFilterRow
3104
+ }
3105
+ ),
3106
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { className: "flex-1 flex flex-col min-h-min", children: [
3107
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { className: "sticky top-0 z-10 grid", children: table.getCenterHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3108
+ "tr",
3109
+ {
3110
+ "data-testid": testid ? `${testid}-header-row-${headerGroup.id}` : void 0,
3111
+ className: "flex w-full",
3112
+ children: [
3113
+ virtualPaddingLeft ? (
3114
+ // fake empty column to the left for virtualization scroll padding
3115
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3116
+ "th",
3117
+ {
3118
+ style: { display: "flex", width: virtualPaddingLeft }
3119
+ }
3120
+ )
3121
+ ) : null,
3122
+ virtualColumns.map((virtualColumn) => {
3123
+ var _a2, _b2, _c2, _d2, _e2;
3124
+ const header = headerGroup.headers[virtualColumn.index];
3125
+ if (!header) {
3126
+ return;
3127
+ }
3128
+ if (typeof header.column.columnDef.header === "string") {
3129
+ const cellValue = (_a2 = table.getRowModel().rows[0]) == null ? void 0 : _a2.getValue(header.column.id);
3130
+ const cellAlignment = ((_c2 = (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.align) != null ? _c2 : cellValue === "number") ? "right" : "left";
3131
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3132
+ DraggableCellHeader,
3133
+ {
3134
+ id: id ? `${id}-header-${header.id}` : void 0,
3135
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
3136
+ header,
3137
+ locked: (_d2 = header.column.columnDef.meta) == null ? void 0 : _d2.locked,
3138
+ center: centerHeader,
3139
+ className: (0, import_clsx13.default)(
3140
+ header.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
3141
+ "group",
3142
+ cellAlignment ? {
3143
+ "justify-start": cellAlignment === "left",
3144
+ "justify-end": cellAlignment === "right"
3145
+ } : {
3146
+ "justify-end": typeof cellValue === "number"
3147
+ }
3148
+ ),
3149
+ useMenuDefaultMinWidth,
3150
+ children: [
3151
+ cellAlignment === "left" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
3152
+ getSortIcon(header.column.getIsSorted()),
3153
+ !header.column.getIsSorted() && header.column.getCanSort() && getSortIcon(
3154
+ header.column.getNextSortingOrder(),
3155
+ true
3156
+ ),
3157
+ header.column.getSortIndex() !== -1 && table.getState().sorting.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.getSortIndex() + 1 }),
3158
+ cellAlignment === "right" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { tall: true, children: header.column.columnDef.header }),
3159
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3160
+ "div",
3161
+ {
3162
+ onDoubleClick: (e) => {
3163
+ e.stopPropagation();
3164
+ header.column.resetSize();
3165
+ },
3166
+ onMouseDown: (e) => {
3167
+ e.stopPropagation();
3168
+ header.getResizeHandler()(e);
3169
+ },
3170
+ onTouchStart: (e) => {
3171
+ e.stopPropagation();
3172
+ header.getResizeHandler()(e);
3173
+ },
3174
+ className: "absolute right-0 inset-y-0 w-px bg-black cursor-col-resize"
3175
+ }
3176
+ )
3177
+ ]
3178
+ },
3179
+ header.id
3180
+ );
3181
+ }
3182
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.default.Fragment, { children: ((_e2 = header.column.columnDef.meta) == null ? void 0 : _e2.checkbox) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3183
+ DataGridCell,
3184
+ {
3185
+ id: id ? `${id}-header-${header.id}` : void 0,
3186
+ testid: testid ? `${testid}-header-${header.id}` : void 0,
3187
+ type: "header",
3188
+ component: "checkbox",
3189
+ locked: true,
3190
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3191
+ Checkbox,
3192
+ {
3193
+ id: id ? `${id}-select-all-checkbox` : void 0,
3194
+ testid: testid ? `${testid}-select-all-checkbox` : void 0,
3195
+ checked: allSelectedAcrossPages,
3196
+ indeterminate: someSelectedAcrossPages,
3197
+ onChange: toggleSelectAllAcrossPages
3198
+ }
3199
+ )
3200
+ }
3201
+ ) : (0, import_react_table3.flexRender)(
3202
+ header.column.columnDef.header,
3203
+ header.getContext()
3204
+ ) }, header.id);
3205
+ }),
3206
+ virtualPaddingRight ? (
3207
+ //fake empty column to the right for virtualization scroll padding
3208
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3209
+ "th",
3210
+ {
3211
+ style: { display: "flex", width: virtualPaddingRight }
3212
+ }
3213
+ )
3214
+ ) : null
3215
+ ]
3216
+ },
3217
+ headerGroup.id
3218
+ )) }),
3219
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3220
+ TableBody,
3221
+ {
3222
+ id,
3223
+ testid,
3224
+ columnVirtualizer,
3225
+ table,
3226
+ tableContainerRef: containerRef,
3227
+ virtualPaddingLeft,
3228
+ virtualPaddingRight,
3229
+ pagination,
3230
+ isLoadingMore,
3231
+ hasMore,
3232
+ showFilterRow,
3233
+ enableColumnSelector
3234
+ }
3235
+ )
3236
+ ] }),
3237
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3238
+ PinnedColumns,
3239
+ {
3240
+ id,
3241
+ enableColumnSelector,
3242
+ toggleColumnVisibility,
3243
+ resetColumnVisibility,
3244
+ testid,
3245
+ pinDirection: "right",
3246
+ table,
3247
+ tableContainerRef: containerRef,
3248
+ pagination,
3249
+ isLoadingMore,
3250
+ hasMore,
3251
+ showFilterRow
3252
+ }
3253
+ )
3254
+ ]
3255
+ }
3256
+ ),
3257
+ empty && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3258
+ "div",
3259
+ {
3260
+ className: (0, import_clsx13.default)(
3261
+ NO_RESULTS_HEIGHT,
3262
+ "flex flex-col items-center justify-center",
3263
+ componentGap,
3264
+ componentPadding
3265
+ ),
3266
+ "data-testid": testid ? `${testid}-no-results` : void 0,
3267
+ children: [
3268
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3269
+ "img",
3270
+ {
3271
+ src: (_g = (_f = no_results_image_default) == null ? void 0 : _f.src) != null ? _g : no_results_image_default,
3272
+ alt: "No Results",
3273
+ className: "h-30 opacity-20",
3274
+ width: 120,
3275
+ height: 120
3276
+ }
3277
+ ),
3278
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Subheader, { color: "text-secondary-normal", children: "No Results" }),
3279
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Paragraph, { color: "text-secondary-normal", children: "To view results, enter or update your search criteria." })
3280
+ ]
3281
+ }
3282
+ ),
3283
+ !hideStatusBar && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "p-2 pt-[7px] border-t border-border-primary-normal h-full min-h-[34px]", children: [
3284
+ pagination && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex justify-between items-center", children: [
3285
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-1 w-min", children: [
3286
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3287
+ Select,
3288
+ {
3289
+ id: id ? `${id}-pagesize-select` : void 0,
3290
+ testid: testid ? `${testid}-pagesize-select` : void 0,
3291
+ wrapperClassName: "!w-20",
3292
+ value: pagination.pageSize.toString(),
3293
+ onChange: (e) => {
3294
+ var _a2;
3295
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, Number(e.target.value));
3296
+ },
3297
+ renderMenu: (props) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3298
+ Menu,
3299
+ __spreadProps(__spreadValues({}, props), {
3300
+ id: id ? `${id}-pagesize-menu` : void 0,
3301
+ testid: testid ? `${testid}-pagesize-menu` : void 0,
3302
+ children: PAGE_SIZE_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3303
+ MenuOption,
3304
+ {
3305
+ id: id ? `${id}-pagesize-option-${option}` : void 0,
3306
+ selected: pagination.pageSize === option,
3307
+ onClick: () => {
3308
+ var _a2;
3309
+ return (_a2 = pagination.onPageSizeChange) == null ? void 0 : _a2.call(pagination, option);
3310
+ },
3311
+ children: option
3312
+ },
3313
+ option
3314
+ ))
3315
+ })
3316
+ )
3317
+ }
3318
+ ),
3319
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Label, { children: "Per Page" })
3320
+ ] }),
3321
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-2", children: [
3322
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3323
+ Button,
3324
+ {
3325
+ id: id ? `${id}-prev-page-button` : void 0,
3326
+ testid: testid ? `${testid}-prev-page-button` : void 0,
3327
+ iconOnly: true,
3328
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron_left" }),
3329
+ onClick: () => pagination.onPageChange(pagination.pageIndex - 1),
3330
+ variant: "tertiary",
3331
+ disabled: pagination.pageIndex === 0
3332
+ }
3333
+ ),
3334
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Paragraph, { children: [
3335
+ pagination.pageIndex * pagination.pageSize + 1,
3336
+ " -",
3337
+ " ",
3338
+ Math.min(
3339
+ (pagination.pageIndex + 1) * pagination.pageSize,
3340
+ pagination.total
3341
+ ),
3342
+ " ",
3343
+ "of ",
3344
+ pagination.total
3345
+ ] }),
3346
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3347
+ Button,
3348
+ {
3349
+ id: id ? `${id}-next-page-button` : void 0,
3350
+ testid: testid ? `${testid}-next-page-button` : void 0,
3351
+ iconOnly: true,
3352
+ leftIcon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { name: "chevron_right" }),
3353
+ onClick: () => pagination.onPageChange(pagination.pageIndex + 1),
3354
+ variant: "tertiary",
3355
+ disabled: (pagination.pageIndex + 1) * pagination.pageSize >= pagination.total
3356
+ }
3357
+ )
3358
+ ] })
3359
+ ] }),
3360
+ status && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3361
+ Paragraph,
3362
+ {
3363
+ testid: testid ? `${testid}-status-text` : void 0,
3364
+ children: status
3365
+ }
3366
+ )
3367
+ ] })
3368
+ ]
3369
+ }
3370
+ )
3371
+ }
3372
+ )
3373
+ }
3374
+ );
3375
+ }
3376
+ DataGrid.displayName = "DataGrid";
3377
+ function adaptTableStateSetter(setter) {
3378
+ return (valueOrFn) => {
3379
+ setter(
3380
+ (prev) => typeof valueOrFn === "function" ? valueOrFn(prev) : valueOrFn
3381
+ );
3382
+ };
3383
+ }
3384
+
3385
+ // src/components/Select.tsx
3386
+ var import_react17 = require("react");
3387
+ var import_clsx14 = __toESM(require("clsx"), 1);
3388
+ var import_jsx_runtime17 = require("react/jsx-runtime");
3389
+ var Select = (_a) => {
3390
+ var _b = _a, {
3391
+ id,
3392
+ testid,
3393
+ label,
3394
+ error,
3395
+ children,
3396
+ readOnly,
3397
+ renderMenu,
3398
+ onClick,
3399
+ className,
3400
+ wrapperClassName,
3401
+ removeRoundness,
3402
+ displayValue,
3403
+ value
3404
+ } = _b, props = __objRest(_b, [
3405
+ "id",
3406
+ "testid",
3407
+ "label",
3408
+ "error",
3409
+ "children",
3410
+ "readOnly",
3411
+ "renderMenu",
3412
+ "onClick",
3413
+ "className",
3414
+ "wrapperClassName",
3415
+ "removeRoundness",
3416
+ "displayValue",
3417
+ "value"
3418
+ ]);
3419
+ var _a2;
3420
+ const inputRef = (0, import_react17.useRef)(null);
3421
+ const inputContainerRef = (0, import_react17.useRef)(null);
3422
+ const preventFocusOnInitialRender = (0, import_react17.useRef)(true);
3423
+ const [show, setShow] = (0, import_react17.useState)(false);
3424
+ (0, import_react17.useEffect)(() => {
3425
+ var _a3;
3426
+ if (preventFocusOnInitialRender.current) {
3427
+ preventFocusOnInitialRender.current = false;
3428
+ return;
3429
+ }
3430
+ (_a3 = inputRef.current) == null ? void 0 : _a3.focus();
3431
+ }, [value]);
3432
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
3433
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3434
+ InputBase,
3435
+ __spreadProps(__spreadValues({
3436
+ id,
3437
+ testid,
3438
+ inputContainerRef,
3439
+ ref: inputRef,
3440
+ label,
3441
+ after: !readOnly && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3442
+ "span",
3443
+ {
3444
+ className: (0, import_clsx14.default)(
3445
+ props.disabled ? "text-icon-action-primary-disabled" : "text-icon-action-primary-normal",
3446
+ "contents"
3447
+ ),
3448
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { name: "keyboard_arrow_down" })
3449
+ }
3450
+ ),
3451
+ maxLength: 0,
3452
+ className: (0, import_clsx14.default)("!caret-transparent !cursor-default", className),
3453
+ wrapperClassName,
3454
+ onKeyDown: (e) => {
3455
+ const openKeys = ["Enter", "Space", " "];
3456
+ if (openKeys.includes(e.key)) {
3457
+ e.preventDefault();
3458
+ e.target.click();
3459
+ }
3460
+ },
3461
+ onClick: (e) => {
3462
+ if (props.disabled || readOnly) {
3463
+ return;
3464
+ }
3465
+ setShow(!show);
3466
+ onClick == null ? void 0 : onClick(e);
3467
+ },
3468
+ error,
3469
+ readOnly,
3470
+ removeRoundness,
3471
+ focus: show,
3472
+ onChange: (e) => {
3473
+ var _a3;
3474
+ return (_a3 = props.onChange) == null ? void 0 : _a3.call(props, e);
3475
+ }
3476
+ }, props), {
3477
+ value: (_a2 = displayValue != null ? displayValue : value) != null ? _a2 : props.onChange ? "" : void 0
3478
+ })
3479
+ ),
3480
+ renderMenu ? renderMenu({
3481
+ id: id ? `${id}-menu` : void 0,
3482
+ positionTo: inputContainerRef,
3483
+ show,
3484
+ setShow,
3485
+ topOffset: props.caption ? -16 : null
3486
+ }) : children
3487
+ ] });
3488
+ };
3489
+ Select.displayName = "Select";
194
3490
 
195
- // src/components/Icon.tsx
196
- var import_clsx2 = __toESM(require("clsx"), 1);
197
- var import_jsx_runtime = require("react/jsx-runtime");
198
- function Icon(_a) {
3491
+ // src/components/Subheader.tsx
3492
+ var import_clsx15 = __toESM(require("clsx"), 1);
3493
+ var import_jsx_runtime18 = require("react/jsx-runtime");
3494
+ var Subheader = (_a) => {
199
3495
  var _b = _a, {
200
- name,
201
- size = 24,
202
- variant = "outline",
3496
+ className,
3497
+ children,
3498
+ as = "span",
3499
+ align,
3500
+ color,
3501
+ tall,
3502
+ id,
203
3503
  testid
204
3504
  } = _b, props = __objRest(_b, [
205
- "name",
206
- "size",
207
- "variant",
3505
+ "className",
3506
+ "children",
3507
+ "as",
3508
+ "align",
3509
+ "color",
3510
+ "tall",
3511
+ "id",
208
3512
  "testid"
209
3513
  ]);
210
- const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
211
- const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
212
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
213
- "span",
214
- __spreadProps(__spreadValues({}, props), {
3514
+ const Element = as;
3515
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3516
+ Element,
3517
+ __spreadProps(__spreadValues({
3518
+ id,
215
3519
  "data-testid": testid,
216
- className: (0, import_clsx2.default)(
217
- "icon",
218
- `icon-${size}`,
219
- // size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
220
- props.className
3520
+ className: (0, import_clsx15.default)(
3521
+ typography.subheader,
3522
+ className,
3523
+ align === "left" && "text-left",
3524
+ align === "center" && "text-center",
3525
+ align === "right" && "text-right",
3526
+ tall && "!leading-6"
221
3527
  ),
222
- style: __spreadValues({
223
- fontVariationSettings: variantStyle + `, ${weightStyle}`
224
- }, props.style),
225
- children: name
3528
+ style: __spreadProps(__spreadValues({}, props.style), {
3529
+ color: color ? `var(--color-${color})` : void 0
3530
+ })
3531
+ }, props), {
3532
+ children
226
3533
  })
227
3534
  );
228
- }
3535
+ };
3536
+ Subheader.displayName = "Subheader";
3537
+
3538
+ // src/components/Checkbox.tsx
3539
+ var import_clsx16 = __toESM(require("clsx"), 1);
3540
+ var import_jsx_runtime19 = require("react/jsx-runtime");
3541
+ var Checkbox = (_a) => {
3542
+ var _b = _a, {
3543
+ label,
3544
+ error,
3545
+ disabled,
3546
+ readOnly,
3547
+ checked,
3548
+ onChange,
3549
+ indeterminate,
3550
+ paragraphClassName,
3551
+ id,
3552
+ testid
3553
+ } = _b, props = __objRest(_b, [
3554
+ "label",
3555
+ "error",
3556
+ "disabled",
3557
+ "readOnly",
3558
+ "checked",
3559
+ "onChange",
3560
+ "indeterminate",
3561
+ "paragraphClassName",
3562
+ "id",
3563
+ "testid"
3564
+ ]);
3565
+ const selected = indeterminate || checked;
3566
+ const normalClassName = (0, import_clsx16.default)(
3567
+ !selected && !error && !disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-normal peer-hover:border-border-action-hover peer-hover:bg-background-action-secondary-hover peer-active:border-border-action-active peer-active:bg-background-action-secondary-active"
3568
+ );
3569
+ const normalSelectedClassName = (0, import_clsx16.default)(
3570
+ selected && !error && !disabled && !readOnly && "bg-background-action-primary-normal border-background-action-primary-normal peer-hover:bg-background-action-primary-hover peer-hover:border-background-action-primary-hover peer-active:bg-background-action-primary-active peer-active:border-background-action-primary-active"
3571
+ );
3572
+ const errorClassName = (0, import_clsx16.default)(
3573
+ error && !selected && "bg-background-action-critical-secondary-normal border-border-action-critical-normal peer-hover:border-border-action-critical-hover peer-hover:bg-background-action-critical-secondary-hover peer-active:border-border-action-critical-active peer-active:bg-background-action-secondary-active"
3574
+ );
3575
+ const errorSelectedClassName = (0, import_clsx16.default)(
3576
+ error && selected && "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal peer-hover:bg-background-action-critical-primary-hover peer-hover:border-background-action-critical-primary-hover peer-active:bg-background-action-critical-primary-active peer-active:border-background-action-critical-primary-active"
3577
+ );
3578
+ const disabledClassName = (0, import_clsx16.default)(
3579
+ disabled && !readOnly && "border-border-primary-normal bg-background-action-secondary-disabled peer-checked:bg-icon-on-action-primary-disabled peer-checked:border-icon-on-action-primary-disabled"
3580
+ );
3581
+ const readOnlyClassName = (0, import_clsx16.default)(
3582
+ readOnly && "border-transparent bg-transparent peer-checked:bg-transparent peer-checked:border-transparent"
3583
+ );
3584
+ const checkColor = (0, import_clsx16.default)(
3585
+ selected && !disabled && !readOnly && "color-icon-on-action-primary-normal peer-hover:color-icon-on-action-primary-hover peer-active:color-icon-on-action-primary-active",
3586
+ selected && disabled && "color-background-action-primary-disabled"
3587
+ );
3588
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3589
+ "label",
3590
+ {
3591
+ id,
3592
+ "data-testid": testid,
3593
+ htmlFor: id ? `${id}-input` : void 0,
3594
+ className: (0, import_clsx16.default)(
3595
+ "flex items-center",
3596
+ componentGap,
3597
+ (disabled || readOnly && error || readOnly) && "cursor-default",
3598
+ !(readOnly && error) && !disabled && !readOnly && "cursor-pointer"
3599
+ ),
3600
+ children: [
3601
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative", children: [
3602
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3603
+ "input",
3604
+ __spreadValues({
3605
+ id: id ? `${id}-input` : void 0,
3606
+ "data-testid": testid ? `${testid}-input` : void 0,
3607
+ type: "checkbox",
3608
+ className: "sr-only peer",
3609
+ disabled,
3610
+ checked: selected,
3611
+ onChange: handleOnChange,
3612
+ "data-indeterminate": indeterminate
3613
+ }, props)
3614
+ ),
3615
+ error && (readOnly || disabled) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: (0, import_clsx16.default)("size-6", "flex items-center justify-center"), children: selected ? indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "question_mark" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "close" }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3616
+ "div",
3617
+ {
3618
+ className: (0, import_clsx16.default)(
3619
+ "size-6 border rounded-base",
3620
+ "flex items-center justify-center",
3621
+ baseTransition,
3622
+ normalClassName,
3623
+ normalSelectedClassName,
3624
+ errorClassName,
3625
+ errorSelectedClassName,
3626
+ disabledClassName,
3627
+ readOnlyClassName,
3628
+ checkColor
3629
+ ),
3630
+ children: selected ? indeterminate ? readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "question_mark" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "remove", className: "pointer-events-none" }) }) : readOnly ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-success-400 contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check" }) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-on-action-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "check", className: "pointer-events-none" }) }) : readOnly && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { name: "close" }) })
3631
+ }
3632
+ )
3633
+ ] }),
3634
+ label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3635
+ Paragraph,
3636
+ {
3637
+ id: id ? `${id}-label` : void 0,
3638
+ testid: testid ? `${testid}-label` : void 0,
3639
+ as: "span",
3640
+ padded: true,
3641
+ className: (0, import_clsx16.default)(
3642
+ "text-nowrap",
3643
+ disabled && !error && "!text-text-primary-disabled",
3644
+ error && !disabled && !readOnly && "!text-text-primary-error",
3645
+ paragraphClassName
3646
+ ),
3647
+ children: label
3648
+ }
3649
+ )
3650
+ ]
3651
+ }
3652
+ );
3653
+ function handleOnChange(e) {
3654
+ if (disabled || readOnly || readOnly && error || !onChange) {
3655
+ return;
3656
+ }
3657
+ onChange(e);
3658
+ }
3659
+ };
3660
+ Checkbox.displayName = "Checkbox";
3661
+
3662
+ // src/components/Button.tsx
3663
+ var import_clsx17 = __toESM(require("clsx"), 1);
3664
+ var import_jsx_runtime20 = require("react/jsx-runtime");
3665
+ var Button = (_a) => {
3666
+ var _b = _a, {
3667
+ variant = "primary",
3668
+ as = "button",
3669
+ block,
3670
+ leftIcon,
3671
+ rightIcon,
3672
+ className,
3673
+ classNameLabel,
3674
+ disabled = false,
3675
+ children,
3676
+ iconOnly = false,
3677
+ colorClassName,
3678
+ href,
3679
+ id,
3680
+ testid
3681
+ } = _b, props = __objRest(_b, [
3682
+ "variant",
3683
+ "as",
3684
+ "block",
3685
+ "leftIcon",
3686
+ "rightIcon",
3687
+ "className",
3688
+ "classNameLabel",
3689
+ "disabled",
3690
+ "children",
3691
+ "iconOnly",
3692
+ "colorClassName",
3693
+ "href",
3694
+ "id",
3695
+ "testid"
3696
+ ]);
3697
+ const primaryVariantStyles = variant === "primary" && (0, import_clsx17.default)(
3698
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
3699
+ "bg-background-action-primary-normal border-background-action-primary-normal",
3700
+ "hover:bg-background-action-primary-hover hover:border-background-action-primary-hover",
3701
+ "focus:bg-background-action-primary-hover focus:border-background-action-primary-hover focus:outline-0",
3702
+ "active:bg-background-action-primary-active active:border-background-action-primary-active",
3703
+ "disabled:bg-background-action-primary-disabled disabled:border-background-action-primary-disabled disabled:text-text-on-action-primary-disabled"
3704
+ );
3705
+ const secondaryVariantStyles = variant === "secondary" && (0, import_clsx17.default)(
3706
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3707
+ "bg-background-action-secondary-normal border-border-action-normal",
3708
+ "hover:bg-background-action-secondary-hover hover:border-border-action-hover hover:text-text-action-primary-hover",
3709
+ "focus:bg-background-action-secondary-hover focus:border-border-action-hover focus:text-text-action-primary-hover focus:outline-0",
3710
+ "active:bg-background-action-secondary-active active:border-border-action-active active:text-text-action-primary-active",
3711
+ "disabled:bg-background-action-primary-disabled disabled:border-border-action-disabled disabled:text-text-action-primary-disabled"
3712
+ );
3713
+ const tertiaryVariantStyles = variant === "tertiary" && (0, import_clsx17.default)(
3714
+ "bg-transparent border-transparent",
3715
+ iconOnly ? (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-icon-action-primary-normal" : (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3716
+ "bg-transparent border-transparent",
3717
+ "hover:bg-background-action-secondary-hover hover:border-background-action-secondary-hover hover:text-text-action-primary-hover",
3718
+ "focus:bg-background-action-secondary-hover focus:border-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
3719
+ "active:bg-background-action-secondary-active active:border-transparent active:text-text-action-primary-active",
3720
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-primary-disabled"
3721
+ );
3722
+ const primaryCriticalVariantStyles = variant === "primary-critical" && (0, import_clsx17.default)(
3723
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
3724
+ "bg-background-action-critical-primary-normal border-background-action-critical-primary-normal",
3725
+ "hover:bg-background-action-critical-primary-hover hover:border-background-action-critical-primary-hover",
3726
+ "focus:bg-background-action-critical-primary-hover focus:border-background-action-critical-primary-hover focus:outline-0",
3727
+ "active:bg-background-action-critical-primary-active active:border-background-action-critical-primary-active",
3728
+ "disabled:bg-background-action-critical-primary-disabled disabled:border-background-action-critical-primary-disabled disabled:text-text-on-action-primary-disabled"
3729
+ );
3730
+ const secondaryCriticalVariantStyles = variant === "secondary-critical" && (0, import_clsx17.default)(
3731
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
3732
+ "bg-background-action-critical-secondary-normal border-border-action-critical-normal",
3733
+ "hover:bg-background-action-critical-secondary-hover hover:border-border-action-critical-hover hover:text-text-action-critical-hover",
3734
+ "focus:bg-background-action-critical-secondary-hover focus:border-border-action-critical-hover focus:text-text-action-critical-hover focus:outline-0",
3735
+ "active:bg-background-action-critical-secondary-active active:border-border-action-critical-active active:text-text-action-critical-active",
3736
+ "disabled:bg-background-action-critical-disabled disabled:border-border-action-critical-disabled disabled:text-text-action-critical-disabled"
3737
+ );
3738
+ const tertiaryCriticalVariantStyles = variant === "tertiary-critical" && (0, import_clsx17.default)(
3739
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-critical-normal",
3740
+ "bg-transparent border-transparent text-text-action-critical-normal",
3741
+ "hover:bg-background-action-critical-secondary-hover hover:border-background-action-critical-secondary-hover hover:text-text-action-critical-hover",
3742
+ "focus:bg-background-action-critical-secondary-hover focus:border-background-action-critical-secondary-hover focus:text-text-action-critical-hover focus:outline-0",
3743
+ "active:bg-background-action-critical-secondary-active active:border-background-action-critical-secondary-active active:text-text-action-critical-active",
3744
+ "disabled:bg-transparent disabled:border-transparent disabled:text-text-action-critical-disabled"
3745
+ );
3746
+ const navigationVarianStyles = variant === "navigation" && (0, import_clsx17.default)(
3747
+ (colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-action-primary-normal",
3748
+ "bg-transparent",
3749
+ "hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover",
3750
+ "focus:bg-background-action-secondary-hover focus:text-text-action-primary-hover focus:outline-0",
3751
+ "active:bg-background-action-secondary-active active:text-text-action-primary-active",
3752
+ "disabled:bg-transparent disabled:text-text-on-action-primary-disabled",
3753
+ "flex-col",
3754
+ paddingUsingComponentGap
3755
+ );
3756
+ const notNavigationVariantStyles = variant !== "navigation" && (0, import_clsx17.default)("border-2 flex-row", componentPaddingMinus2pxBorder, componentGap);
3757
+ const buttonClasses = (0, import_clsx17.default)(
3758
+ disabled ? "cursor-default" : "cursor-pointer",
3759
+ block ? "w-full" : "w-fit",
3760
+ baseTransition,
3761
+ "rounded-sm whitespace-nowrap inline-flex items-center justify-center group/btn",
3762
+ primaryVariantStyles,
3763
+ secondaryVariantStyles,
3764
+ tertiaryVariantStyles,
3765
+ primaryCriticalVariantStyles,
3766
+ secondaryCriticalVariantStyles,
3767
+ tertiaryCriticalVariantStyles,
3768
+ navigationVarianStyles,
3769
+ notNavigationVariantStyles,
3770
+ className
3771
+ );
3772
+ const labelClasses = (0, import_clsx17.default)(
3773
+ "min-h-6 flex items-center justify-center",
3774
+ classNameLabel,
3775
+ componentPaddingXUsingComponentGap,
3776
+ typography.buttonLabel
3777
+ );
3778
+ const Element = href && !as ? "a" : as;
3779
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3780
+ Element,
3781
+ __spreadProps(__spreadValues({
3782
+ id,
3783
+ "data-testid": testid,
3784
+ type: Element === "button" ? "button" : void 0,
3785
+ className: buttonClasses
3786
+ }, props), {
3787
+ onClick: props.onClick,
3788
+ disabled,
3789
+ href,
3790
+ "data-theme": variant === "navigation" ? "brand" : void 0,
3791
+ children: [
3792
+ leftIcon && leftIcon,
3793
+ !iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { id: id ? `${id}-label` : void 0, "data-testid": testid ? `${testid}-label` : void 0, className: labelClasses, children }),
3794
+ rightIcon && rightIcon
3795
+ ]
3796
+ })
3797
+ );
3798
+ };
3799
+ Button.displayName = "Button";
3800
+
3801
+ // src/components/Tooltip.tsx
3802
+ var import_clsx18 = __toESM(require("clsx"), 1);
3803
+ var import_react18 = require("react");
3804
+ var import_react_dom2 = require("react-dom");
3805
+ var import_jsx_runtime21 = require("react/jsx-runtime");
3806
+ var Tooltip = ({
3807
+ id,
3808
+ testid,
3809
+ message,
3810
+ position = "top",
3811
+ children,
3812
+ showOnTruncation = false,
3813
+ offset = 8,
3814
+ keepHidden = false
3815
+ }) => {
3816
+ const ref = (0, import_react18.useRef)(null);
3817
+ const tooltipRef = (0, import_react18.useRef)(null);
3818
+ const [tooltipPosition, setTooltipPosition] = (0, import_react18.useState)({ top: 0, left: 0 });
3819
+ const [isVisible, setIsVisible] = (0, import_react18.useState)(false);
3820
+ const [removeOpacity, setRemoveOpacity] = (0, import_react18.useState)(false);
3821
+ const updatePosition = () => {
3822
+ if (!ref.current || !tooltipRef.current) return;
3823
+ const rect = ref.current.getBoundingClientRect();
3824
+ const tooltipRect = tooltipRef.current.getBoundingClientRect();
3825
+ let top = 0;
3826
+ let left = 0;
3827
+ switch (position) {
3828
+ case "top":
3829
+ top = rect.top - tooltipRect.height - offset;
3830
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
3831
+ break;
3832
+ case "bottom":
3833
+ top = rect.bottom + offset;
3834
+ left = rect.left + rect.width / 2 - tooltipRect.width / 2;
3835
+ break;
3836
+ case "left":
3837
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
3838
+ left = rect.left - tooltipRect.width - offset;
3839
+ break;
3840
+ case "right":
3841
+ top = rect.top + rect.height / 2 - tooltipRect.height / 2;
3842
+ left = rect.right + offset;
3843
+ break;
3844
+ }
3845
+ setTooltipPosition({ top, left });
3846
+ requestAnimationFrame(() => {
3847
+ setRemoveOpacity(true);
3848
+ });
3849
+ };
3850
+ const handleMouseEnter = () => {
3851
+ if (!showOnTruncation || checkForTextTruncation()) {
3852
+ setIsVisible(true);
3853
+ }
3854
+ };
3855
+ const handleMouseLeave = () => {
3856
+ setIsVisible(false);
3857
+ setRemoveOpacity(false);
3858
+ };
3859
+ (0, import_react18.useEffect)(() => {
3860
+ if (isVisible && tooltipRef.current) {
3861
+ requestAnimationFrame(() => {
3862
+ updatePosition();
3863
+ });
3864
+ }
3865
+ }, [isVisible]);
3866
+ (0, import_react18.useEffect)(() => {
3867
+ if (isVisible) {
3868
+ window.addEventListener("resize", updatePosition);
3869
+ return () => window.removeEventListener("resize", updatePosition);
3870
+ }
3871
+ }, [isVisible]);
3872
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3873
+ "div",
3874
+ {
3875
+ id,
3876
+ "data-testid": testid,
3877
+ ref,
3878
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center",
3879
+ onMouseEnter: handleMouseEnter,
3880
+ onMouseLeave: handleMouseLeave,
3881
+ children: [
3882
+ children,
3883
+ !keepHidden && isVisible && typeof document !== "undefined" && (0, import_react_dom2.createPortal)(
3884
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3885
+ "div",
3886
+ {
3887
+ id: id ? `${id}-message` : void 0,
3888
+ "data-testid": testid ? `${testid}-message` : void 0,
3889
+ ref: tooltipRef,
3890
+ style: {
3891
+ position: "fixed",
3892
+ top: `${tooltipPosition.top}px`,
3893
+ left: `${tooltipPosition.left}px`,
3894
+ zIndex: 9999
3895
+ },
3896
+ className: (0, import_clsx18.default)(
3897
+ typography.caption,
3898
+ "bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
3899
+ componentPadding,
3900
+ !removeOpacity && "opacity-0"
3901
+ ),
3902
+ children: message
3903
+ }
3904
+ ),
3905
+ document.body
3906
+ )
3907
+ ]
3908
+ }
3909
+ );
3910
+ function checkForTextTruncation() {
3911
+ if (showOnTruncation && ref.current) {
3912
+ const paragraph = ref.current.querySelector("p");
3913
+ if (paragraph) {
3914
+ const isTruncated = paragraph.scrollWidth > paragraph.clientWidth;
3915
+ return isTruncated;
3916
+ }
3917
+ }
3918
+ return false;
3919
+ }
3920
+ };
3921
+ Tooltip.displayName = "Tooltip";
3922
+
3923
+ // src/components/Accordion.tsx
3924
+ var import_clsx21 = __toESM(require("clsx"), 1);
3925
+
3926
+ // src/components/Card.tsx
3927
+ var import_clsx19 = __toESM(require("clsx"), 1);
3928
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3929
+
3930
+ // src/components/Stack.tsx
3931
+ var import_clsx20 = __toESM(require("clsx"), 1);
3932
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3933
+
3934
+ // src/components/Accordion.tsx
3935
+ var import_jsx_runtime24 = require("react/jsx-runtime");
229
3936
 
230
3937
  // src/components/CalendarRange.tsx
231
- var import_react = __toESM(require("react"), 1);
232
- var import_polyfill = require("@js-temporal/polyfill");
233
- var import_jsx_runtime2 = require("react/jsx-runtime");
3938
+ var import_jsx_runtime25 = require("react/jsx-runtime");
234
3939
  function isWeekend(date) {
235
3940
  return date.dayOfWeek === 6 || date.dayOfWeek === 7;
236
3941
  }
@@ -268,12 +3973,12 @@ function DateCell(_a) {
268
3973
  "id",
269
3974
  "testid"
270
3975
  ]);
271
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
3976
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
272
3977
  "span",
273
3978
  __spreadProps(__spreadValues({}, props), {
274
3979
  id,
275
3980
  "data-testid": testid,
276
- className: (0, import_clsx3.default)(
3981
+ className: (0, import_clsx22.default)(
277
3982
  "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
278
3983
  typography.caption,
279
3984
  cellPadding,
@@ -343,20 +4048,20 @@ function CalendarRange({
343
4048
  const fromDate = parseDate(from);
344
4049
  const toDate = parseDate(to);
345
4050
  const today = import_polyfill.Temporal.Now.plainDateISO();
346
- const [baseMonth, setBaseMonth] = (0, import_react.useState)(
4051
+ const [baseMonth, setBaseMonth] = (0, import_react19.useState)(
347
4052
  fromDate != null ? fromDate : today.with({ day: 1 })
348
4053
  );
349
- const [selecting, setSelecting] = (0, import_react.useState)("from");
350
- const [pendingFrom, setPendingFrom] = (0, import_react.useState)(void 0);
351
- const [hoveredDate, setHoveredDate] = (0, import_react.useState)(void 0);
352
- (0, import_react.useEffect)(() => {
4054
+ const [selecting, setSelecting] = (0, import_react19.useState)("from");
4055
+ const [pendingFrom, setPendingFrom] = (0, import_react19.useState)(void 0);
4056
+ const [hoveredDate, setHoveredDate] = (0, import_react19.useState)(void 0);
4057
+ (0, import_react19.useEffect)(() => {
353
4058
  if (fromDate) {
354
4059
  setBaseMonth(fromDate.with({ day: 1 }));
355
4060
  } else if (toDate) {
356
4061
  setBaseMonth(toDate.with({ day: 1 }));
357
4062
  }
358
4063
  }, [from, to]);
359
- (0, import_react.useEffect)(() => {
4064
+ (0, import_react19.useEffect)(() => {
360
4065
  if (fromDate && toDate) {
361
4066
  setSelecting("from");
362
4067
  setPendingFrom(void 0);
@@ -375,6 +4080,18 @@ function CalendarRange({
375
4080
  date: monthDate
376
4081
  };
377
4082
  }
4083
+ function getMonthDataWith(monthOffset) {
4084
+ const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
4085
+ const days = monthDate.daysInMonth;
4086
+ const firstDayOffset = monthDate.dayOfWeek % 7;
4087
+ return {
4088
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
4089
+ year: monthDate.year,
4090
+ days,
4091
+ firstDayOffset,
4092
+ date: monthDate
4093
+ };
4094
+ }
378
4095
  function handleDayClick(date) {
379
4096
  if (isDateAvailable && !isDateAvailable(date)) return;
380
4097
  if (mode === "single" && disableRange) {
@@ -410,12 +4127,12 @@ function CalendarRange({
410
4127
  }
411
4128
  return false;
412
4129
  }
413
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
4130
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
414
4131
  "div",
415
4132
  {
416
4133
  id,
417
4134
  "data-testid": testid,
418
- className: (0, import_clsx3.default)(
4135
+ className: (0, import_clsx22.default)(
419
4136
  "relative bg-background-grouped-primary-normal rounded-base w-fit",
420
4137
  layoutPaddding,
421
4138
  layoutGap,
@@ -423,137 +4140,262 @@ function CalendarRange({
423
4140
  // baseTransition,
424
4141
  "overflow-hidden"
425
4142
  ),
426
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
4143
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
427
4144
  "div",
428
4145
  {
429
- className: (0, import_clsx3.default)(
4146
+ className: (0, import_clsx22.default)(
430
4147
  "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
431
4148
  layoutGap
432
4149
  ),
433
4150
  children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
434
- const month = getMonthData(offset);
435
- const totalCells = 42;
436
- const emptyCells = month.firstDayOffset;
437
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react.default.Fragment, { children: [
438
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
439
- "div",
440
- {
441
- className: (0, import_clsx3.default)("flex flex-col"),
442
- children: [
443
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
444
- "div",
445
- {
446
- className: (0, import_clsx3.default)(
447
- "flex flex-row items-center justify-between",
448
- typography.label,
449
- "text-text-action-primary-normal"
450
- ),
451
- children: [
452
- idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
453
- "button",
454
- {
455
- id: id ? `${id}-prev-month-button` : void 0,
456
- "data-testid": testid ? `${testid}-prev-month-button` : void 0,
457
- type: "button",
458
- className: (0, import_clsx3.default)(
459
- "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
460
- componentPadding
461
- ),
462
- "aria-label": "Previous month",
463
- onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
464
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { name: "chevron_left", size: 24 })
465
- }
466
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: (0, import_clsx3.default)(componentPadding, "mr-1") }),
467
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
468
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] truncate", children: month.name }),
469
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] px-1 truncate", children: month.year })
470
- ] }),
471
- (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
472
- "button",
473
- {
474
- id: id ? `${id}-next-month-button` : void 0,
475
- "data-testid": testid ? `${testid}-next-month-button` : void 0,
476
- type: "button",
477
- className: (0, import_clsx3.default)(
478
- "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
479
- componentPadding
480
- ),
481
- "aria-label": "Next month",
482
- onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
483
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { name: "chevron_right", size: 24 })
484
- }
485
- ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: (0, import_clsx3.default)(componentPadding, "ml-1") })
486
- ]
487
- }
488
- ),
489
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_clsx3.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
490
- "span",
491
- {
492
- className: (0, import_clsx3.default)(
493
- typography.caption,
494
- "text-text-secondary-normal text-center",
495
- "w-10"
496
- ),
497
- children: d
498
- },
499
- d
500
- )) }),
501
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_clsx3.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
502
- const day = i - emptyCells + 1;
503
- const date = month.date.with({ day: 1 }).add({
504
- days: i - emptyCells
505
- });
506
- const isInMonth = day > 0 && day <= month.days;
507
- const isToday = isInMonth && date.equals(today);
508
- const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
509
- const inRange = isInMonth && isInRange(date);
510
- const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
511
- const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
512
- const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
513
- const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
514
- const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
515
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
516
- DateCell,
517
- {
518
- id: id ? `${id}-date-${date.toString()}` : void 0,
519
- testid: testid ? `${testid}-date-${date.toString()}` : void 0,
520
- date,
521
- isInMonth: !!isInMonth,
522
- isToday: !!isToday,
523
- isSelected: !!isSelected,
524
- inRange: !!inRange,
525
- isDisabled: !!isDisabled,
526
- onClick: () => handleDayClick(date),
527
- onMouseEnter: () => setHoveredDate(date),
528
- onMouseLeave: () => setHoveredDate(void 0),
529
- isRangeStart: !!isRangeStart,
530
- isRangeEnd: !!isRangeEnd,
531
- isRangeDisabled: mode === "single" && disableRange,
532
- cellPadding: componentPadding
533
- },
534
- i
535
- );
536
- }) })
537
- ]
538
- }
539
- ),
540
- mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
541
- "div",
542
- {
543
- className: (0, import_clsx3.default)(
544
- "self-stretch bg-border-primary-normal rounded-base",
545
- // 1px width, full height, matches Figma divider
546
- "w-px"
547
- )
548
- }
549
- )
550
- ] }, month.name + month.year);
4151
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4152
+ CalendarPane,
4153
+ {
4154
+ getMonthData,
4155
+ getMonthDataWith,
4156
+ offset,
4157
+ idx,
4158
+ id,
4159
+ testid,
4160
+ baseMonth,
4161
+ setBaseMonth,
4162
+ mode,
4163
+ pendingFrom,
4164
+ weekDays,
4165
+ fromDate,
4166
+ toDate,
4167
+ isDateAvailable,
4168
+ disableRange,
4169
+ hoveredDate,
4170
+ isInRange,
4171
+ today,
4172
+ setHoveredDate,
4173
+ handleDayClick
4174
+ },
4175
+ idx
4176
+ );
551
4177
  })
552
4178
  }
553
4179
  )
554
4180
  }
555
4181
  );
556
4182
  }
4183
+ function CalendarPane({
4184
+ getMonthData,
4185
+ getMonthDataWith,
4186
+ offset,
4187
+ idx,
4188
+ id,
4189
+ testid,
4190
+ baseMonth,
4191
+ setBaseMonth,
4192
+ mode,
4193
+ pendingFrom,
4194
+ weekDays,
4195
+ fromDate,
4196
+ toDate,
4197
+ isDateAvailable,
4198
+ disableRange,
4199
+ hoveredDate,
4200
+ isInRange,
4201
+ today,
4202
+ setHoveredDate,
4203
+ handleDayClick
4204
+ }) {
4205
+ const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
4206
+ const years = Array.from({ length: 100 }).map(
4207
+ (_, i) => baseMonth.year - 50 + i
4208
+ );
4209
+ const [monthMenuOpen, setMonthMenuOpen] = (0, import_react19.useState)(false);
4210
+ const [yearMenuOpen, setYearMenuOpen] = (0, import_react19.useState)(false);
4211
+ const monthMenuRef = (0, import_react19.useRef)(null);
4212
+ const yearMenuRef = (0, import_react19.useRef)(null);
4213
+ const month = getMonthData(offset);
4214
+ const totalCells = 42;
4215
+ const emptyCells = month.firstDayOffset;
4216
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react19.default.Fragment, { children: [
4217
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4218
+ "div",
4219
+ {
4220
+ className: (0, import_clsx22.default)("flex flex-col"),
4221
+ children: [
4222
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4223
+ "div",
4224
+ {
4225
+ className: (0, import_clsx22.default)(
4226
+ "flex flex-row items-center justify-between",
4227
+ typography.label,
4228
+ "text-text-action-primary-normal"
4229
+ ),
4230
+ children: [
4231
+ idx === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4232
+ "button",
4233
+ {
4234
+ id: id ? `${id}-prev-month-button` : void 0,
4235
+ "data-testid": testid ? `${testid}-prev-month-button` : void 0,
4236
+ type: "button",
4237
+ className: (0, import_clsx22.default)(
4238
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4239
+ componentPadding
4240
+ ),
4241
+ "aria-label": "Previous month",
4242
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
4243
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron_left", size: 24 })
4244
+ }
4245
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_clsx22.default)(componentPadding, "mr-1") }),
4246
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-desktop-compact-component-padding", children: [
4247
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4248
+ "button",
4249
+ {
4250
+ ref: (el) => {
4251
+ monthMenuRef.current = el;
4252
+ },
4253
+ type: "button",
4254
+ onClick: () => {
4255
+ setMonthMenuOpen(true);
4256
+ setYearMenuOpen(false);
4257
+ },
4258
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4259
+ children: month.name
4260
+ }
4261
+ ),
4262
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4263
+ Menu,
4264
+ {
4265
+ show: monthMenuOpen,
4266
+ positionTo: monthMenuRef,
4267
+ setShow: () => setMonthMenuOpen(false),
4268
+ children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4269
+ MenuOption,
4270
+ {
4271
+ selected: baseMonth.month === x + 1,
4272
+ onClick: () => {
4273
+ setBaseMonth(baseMonth.with({ month: x + 1 }));
4274
+ setMonthMenuOpen(false);
4275
+ },
4276
+ children: m.name
4277
+ },
4278
+ m.name
4279
+ ))
4280
+ }
4281
+ ),
4282
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4283
+ "button",
4284
+ {
4285
+ ref: (el) => {
4286
+ yearMenuRef.current = el;
4287
+ },
4288
+ type: "button",
4289
+ onClick: () => {
4290
+ setYearMenuOpen(true);
4291
+ setMonthMenuOpen(false);
4292
+ },
4293
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
4294
+ children: month.year
4295
+ }
4296
+ ),
4297
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4298
+ Menu,
4299
+ {
4300
+ show: yearMenuOpen,
4301
+ positionTo: yearMenuRef,
4302
+ setShow: () => setYearMenuOpen(false),
4303
+ children: years.map((y) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4304
+ MenuOption,
4305
+ {
4306
+ selected: baseMonth.year === y,
4307
+ onClick: () => {
4308
+ setBaseMonth(baseMonth.with({ year: y }));
4309
+ setYearMenuOpen(false);
4310
+ },
4311
+ children: y
4312
+ },
4313
+ y
4314
+ ))
4315
+ }
4316
+ )
4317
+ ] }),
4318
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4319
+ "button",
4320
+ {
4321
+ id: id ? `${id}-next-month-button` : void 0,
4322
+ "data-testid": testid ? `${testid}-next-month-button` : void 0,
4323
+ type: "button",
4324
+ className: (0, import_clsx22.default)(
4325
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
4326
+ componentPadding
4327
+ ),
4328
+ "aria-label": "Next month",
4329
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
4330
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { name: "chevron_right", size: 24 })
4331
+ }
4332
+ ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: (0, import_clsx22.default)(componentPadding, "ml-1") })
4333
+ ]
4334
+ }
4335
+ ),
4336
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx22.default)("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4337
+ "span",
4338
+ {
4339
+ className: (0, import_clsx22.default)(
4340
+ typography.caption,
4341
+ "text-text-secondary-normal text-center",
4342
+ "w-10"
4343
+ ),
4344
+ children: d
4345
+ },
4346
+ d
4347
+ )) }),
4348
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx22.default)("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
4349
+ const day = i - emptyCells + 1;
4350
+ const date = month.date.with({ day: 1 }).add({
4351
+ days: i - emptyCells
4352
+ });
4353
+ const isInMonth = day > 0 && day <= month.days;
4354
+ const isToday = isInMonth && date.equals(today);
4355
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
4356
+ const inRange = isInMonth && isInRange(date);
4357
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
4358
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
4359
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && import_polyfill.Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
4360
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
4361
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
4362
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4363
+ DateCell,
4364
+ {
4365
+ id: id ? `${id}-date-${date.toString()}` : void 0,
4366
+ testid: testid ? `${testid}-date-${date.toString()}` : void 0,
4367
+ date,
4368
+ isInMonth: !!isInMonth,
4369
+ isToday: !!isToday,
4370
+ isSelected: !!isSelected,
4371
+ inRange: !!inRange,
4372
+ isDisabled: !!isDisabled,
4373
+ onClick: () => handleDayClick(date),
4374
+ onMouseEnter: () => setHoveredDate(date),
4375
+ onMouseLeave: () => setHoveredDate(void 0),
4376
+ isRangeStart: !!isRangeStart,
4377
+ isRangeEnd: !!isRangeEnd,
4378
+ isRangeDisabled: mode === "single" && disableRange,
4379
+ cellPadding: componentPadding
4380
+ },
4381
+ i
4382
+ );
4383
+ }) })
4384
+ ]
4385
+ }
4386
+ ),
4387
+ mode === "double" && idx === 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4388
+ "div",
4389
+ {
4390
+ className: (0, import_clsx22.default)(
4391
+ "self-stretch bg-border-primary-normal rounded-base",
4392
+ // 1px width, full height, matches Figma divider
4393
+ "w-px"
4394
+ )
4395
+ }
4396
+ )
4397
+ ] }, month.name + month.year);
4398
+ }
557
4399
  var CalendarRange_default = CalendarRange;
558
4400
  // Annotate the CommonJS export names for ESM import in node:
559
4401
  0 && (module.exports = {