@dmsi/wedgekit-react 0.0.369 → 0.0.371

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