@dmsi/wedgekit-react 0.0.231 → 0.0.233

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