@dmsi/wedgekit-react 0.0.1277 → 1.0.1

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 (645) hide show
  1. package/README.md +4 -32
  2. package/dist/classNames.d.ts +41 -0
  3. package/dist/classNames.d.ts.map +1 -0
  4. package/dist/components/AccessCard.d.ts +14 -0
  5. package/dist/components/AccessCard.d.ts.map +1 -0
  6. package/dist/components/AccessCardGroup.d.ts +15 -0
  7. package/dist/components/AccessCardGroup.d.ts.map +1 -0
  8. package/dist/components/AccessChangerTabItem.d.ts +11 -0
  9. package/dist/components/AccessChangerTabItem.d.ts.map +1 -0
  10. package/dist/components/Accordion.d.ts +15 -0
  11. package/dist/components/Accordion.d.ts.map +1 -0
  12. package/dist/components/Alert.d.ts +13 -0
  13. package/dist/components/Alert.d.ts.map +1 -0
  14. package/dist/components/Breadcrumbs.d.ts +19 -0
  15. package/dist/components/Breadcrumbs.d.ts.map +1 -0
  16. package/dist/components/Button.d.ts +46 -0
  17. package/dist/components/Button.d.ts.map +1 -0
  18. package/dist/components/CalendarRange.d.ts +28 -0
  19. package/dist/components/CalendarRange.d.ts.map +1 -0
  20. package/dist/components/Caption.d.ts +15 -0
  21. package/dist/components/Caption.d.ts.map +1 -0
  22. package/dist/components/Card.d.ts +28 -0
  23. package/dist/components/Card.d.ts.map +1 -0
  24. package/dist/components/Checkbox.d.ts +12 -0
  25. package/dist/components/Checkbox.d.ts.map +1 -0
  26. package/dist/components/CompactImagesPreview.d.ts +25 -0
  27. package/dist/components/CompactImagesPreview.d.ts.map +1 -0
  28. package/dist/components/ContentTab.d.ts +12 -0
  29. package/dist/components/ContentTab.d.ts.map +1 -0
  30. package/dist/components/ContentTabs.d.ts +23 -0
  31. package/dist/components/ContentTabs.d.ts.map +1 -0
  32. package/dist/components/DMSiLogo.d.ts +2 -0
  33. package/dist/components/DMSiLogo.d.ts.map +1 -0
  34. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts +8 -0
  35. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -0
  36. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts +9 -0
  37. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -0
  38. package/dist/components/DataGrid/PinnedColumns.d.ts +26 -0
  39. package/dist/components/DataGrid/PinnedColumns.d.ts.map +1 -0
  40. package/dist/components/DataGrid/TableBody/LoadingCell.d.ts +7 -0
  41. package/dist/components/DataGrid/TableBody/LoadingCell.d.ts.map +1 -0
  42. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts +22 -0
  43. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts.map +1 -0
  44. package/dist/components/DataGrid/TableBody/index.d.ts +26 -0
  45. package/dist/components/DataGrid/TableBody/index.d.ts.map +1 -0
  46. package/dist/components/DataGrid/index.d.ts +5 -0
  47. package/dist/components/DataGrid/index.d.ts.map +1 -0
  48. package/dist/components/DataGrid/types.d.ts +74 -0
  49. package/dist/components/DataGrid/types.d.ts.map +1 -0
  50. package/dist/components/DataGrid/utils.d.ts +3 -0
  51. package/dist/components/DataGrid/utils.d.ts.map +1 -0
  52. package/dist/components/DataGridCell.d.ts +46 -0
  53. package/dist/components/DataGridCell.d.ts.map +1 -0
  54. package/dist/components/DataTable.d.ts +36 -0
  55. package/dist/components/DataTable.d.ts.map +1 -0
  56. package/dist/components/DateInput.d.ts +38 -0
  57. package/dist/components/DateInput.d.ts.map +1 -0
  58. package/dist/components/DateRangeInput.d.ts +36 -0
  59. package/dist/components/DateRangeInput.d.ts.map +1 -0
  60. package/dist/components/DebugJson.d.ts +5 -0
  61. package/dist/components/DebugJson.d.ts.map +1 -0
  62. package/dist/components/Display.d.ts +14 -0
  63. package/dist/components/Display.d.ts.map +1 -0
  64. package/dist/components/EditingContext.d.ts +14 -0
  65. package/dist/components/EditingContext.d.ts.map +1 -0
  66. package/dist/components/EmblaCarousel/ArrowButtons.d.ts +9 -0
  67. package/dist/components/EmblaCarousel/ArrowButtons.d.ts.map +1 -0
  68. package/dist/components/EmblaCarousel/SelectedSnapDisplay.d.ts +7 -0
  69. package/dist/components/EmblaCarousel/SelectedSnapDisplay.d.ts.map +1 -0
  70. package/dist/components/EmblaCarousel/index.d.ts +20 -0
  71. package/dist/components/EmblaCarousel/index.d.ts.map +1 -0
  72. package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts +10 -0
  73. package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -0
  74. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts +8 -0
  75. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -0
  76. package/dist/components/EmptyCartIcon.d.ts +2 -0
  77. package/dist/components/EmptyCartIcon.d.ts.map +1 -0
  78. package/dist/components/FilterGroup.d.ts +29 -0
  79. package/dist/components/FilterGroup.d.ts.map +1 -0
  80. package/dist/components/FullViewportBox.d.ts +6 -0
  81. package/dist/components/FullViewportBox.d.ts.map +1 -0
  82. package/dist/components/Grid.d.ts +22 -0
  83. package/dist/components/Grid.d.ts.map +1 -0
  84. package/dist/components/Heading.d.ts +15 -0
  85. package/dist/components/Heading.d.ts.map +1 -0
  86. package/dist/components/HorizontalDivider.d.ts +8 -0
  87. package/dist/components/HorizontalDivider.d.ts.map +1 -0
  88. package/dist/components/Icon.d.ts +11 -0
  89. package/dist/components/Icon.d.ts.map +1 -0
  90. package/dist/components/ImagePlaceholder.d.ts +3 -0
  91. package/dist/components/ImagePlaceholder.d.ts.map +1 -0
  92. package/dist/components/Input.d.ts +50 -0
  93. package/dist/components/Input.d.ts.map +1 -0
  94. package/dist/components/InputGroup.d.ts +12 -0
  95. package/dist/components/InputGroup.d.ts.map +1 -0
  96. package/dist/components/Label.d.ts +10 -0
  97. package/dist/components/Label.d.ts.map +1 -0
  98. package/dist/components/Link.d.ts +16 -0
  99. package/dist/components/Link.d.ts.map +1 -0
  100. package/dist/components/List.d.ts +7 -0
  101. package/dist/components/List.d.ts.map +1 -0
  102. package/dist/components/ListGroup.d.ts +26 -0
  103. package/dist/components/ListGroup.d.ts.map +1 -0
  104. package/dist/components/LiveChatComponent.d.ts +17 -0
  105. package/dist/components/LiveChatComponent.d.ts.map +1 -0
  106. package/dist/components/LoadingScrim.d.ts +14 -0
  107. package/dist/components/LoadingScrim.d.ts.map +1 -0
  108. package/dist/components/LogoAgilityTopBar.d.ts +2 -0
  109. package/dist/components/LogoAgilityTopBar.d.ts.map +1 -0
  110. package/dist/components/LogoDMSiTopBar.d.ts +2 -0
  111. package/dist/components/LogoDMSiTopBar.d.ts.map +1 -0
  112. package/dist/components/LogoMillworkTopBar.d.ts +2 -0
  113. package/dist/components/LogoMillworkTopBar.d.ts.map +1 -0
  114. package/dist/components/MainBar.d.ts +14 -0
  115. package/dist/components/MainBar.d.ts.map +1 -0
  116. package/dist/components/MaxViewportBox.d.ts +6 -0
  117. package/dist/components/MaxViewportBox.d.ts.map +1 -0
  118. package/dist/components/Menu.d.ts +23 -0
  119. package/dist/components/Menu.d.ts.map +1 -0
  120. package/dist/components/MenuOption.d.ts +65 -0
  121. package/dist/components/MenuOption.d.ts.map +1 -0
  122. package/dist/components/MobileDataGrid/ColumnList.d.ts +13 -0
  123. package/dist/components/MobileDataGrid/ColumnList.d.ts.map +1 -0
  124. package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts +2 -0
  125. package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -0
  126. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts +24 -0
  127. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -0
  128. package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts +15 -0
  129. package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -0
  130. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts +3 -0
  131. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -0
  132. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.d.ts +6 -0
  133. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.d.ts.map +1 -0
  134. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts +10 -0
  135. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts.map +1 -0
  136. package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts +7 -0
  137. package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts.map +1 -0
  138. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.d.ts +2 -0
  139. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.d.ts.map +1 -0
  140. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts +2 -0
  141. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts.map +1 -0
  142. package/dist/components/MobileDataGrid/dataGridReducer.d.ts +21 -0
  143. package/dist/components/MobileDataGrid/dataGridReducer.d.ts.map +1 -0
  144. package/dist/components/MobileDataGrid/index.d.ts +26 -0
  145. package/dist/components/MobileDataGrid/index.d.ts.map +1 -0
  146. package/dist/components/MobileDataGrid/types.d.ts +4 -0
  147. package/dist/components/MobileDataGrid/types.d.ts.map +1 -0
  148. package/dist/components/MobileNavMenu.d.ts +36 -0
  149. package/dist/components/MobileNavMenu.d.ts.map +1 -0
  150. package/dist/components/Modal.d.ts +30 -0
  151. package/dist/components/Modal.d.ts.map +1 -0
  152. package/dist/components/ModalButtons.d.ts +13 -0
  153. package/dist/components/ModalButtons.d.ts.map +1 -0
  154. package/dist/components/ModalContent.d.ts +7 -0
  155. package/dist/components/ModalContent.d.ts.map +1 -0
  156. package/dist/components/ModalHeader.d.ts +17 -0
  157. package/dist/components/ModalHeader.d.ts.map +1 -0
  158. package/dist/components/ModalScrim.d.ts +13 -0
  159. package/dist/components/ModalScrim.d.ts.map +1 -0
  160. package/dist/components/NavigationTab.d.ts +13 -0
  161. package/dist/components/NavigationTab.d.ts.map +1 -0
  162. package/dist/components/NavigationTabs.d.ts +18 -0
  163. package/dist/components/NavigationTabs.d.ts.map +1 -0
  164. package/dist/components/NestedMenu.d.ts +35 -0
  165. package/dist/components/NestedMenu.d.ts.map +1 -0
  166. package/dist/components/Notification.d.ts +17 -0
  167. package/dist/components/Notification.d.ts.map +1 -0
  168. package/dist/components/OptionPill.d.ts +14 -0
  169. package/dist/components/OptionPill.d.ts.map +1 -0
  170. package/dist/components/OrderCheckIcon.d.ts +5 -0
  171. package/dist/components/OrderCheckIcon.d.ts.map +1 -0
  172. package/dist/components/PDFViewer/DownloadIcon.d.ts +7 -0
  173. package/dist/components/PDFViewer/DownloadIcon.d.ts.map +1 -0
  174. package/dist/components/PDFViewer/PDFElement.d.ts +7 -0
  175. package/dist/components/PDFViewer/PDFElement.d.ts.map +1 -0
  176. package/dist/components/PDFViewer/PDFNavigation.d.ts +12 -0
  177. package/dist/components/PDFViewer/PDFNavigation.d.ts.map +1 -0
  178. package/dist/components/PDFViewer/PDFPage.d.ts +7 -0
  179. package/dist/components/PDFViewer/PDFPage.d.ts.map +1 -0
  180. package/dist/components/PDFViewer/index.d.ts +20 -0
  181. package/dist/components/PDFViewer/index.d.ts.map +1 -0
  182. package/dist/components/Pagination.d.ts +14 -0
  183. package/dist/components/Pagination.d.ts.map +1 -0
  184. package/dist/components/Paragraph.d.ts +10 -0
  185. package/dist/components/Paragraph.d.ts.map +1 -0
  186. package/dist/components/Password.d.ts +4 -0
  187. package/dist/components/Password.d.ts.map +1 -0
  188. package/dist/components/ProductImagePreview/CarouselPagination.d.ts +9 -0
  189. package/dist/components/ProductImagePreview/CarouselPagination.d.ts.map +1 -0
  190. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts +11 -0
  191. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -0
  192. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts +22 -0
  193. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -0
  194. package/dist/components/ProductImagePreview/Thumbnail.d.ts +11 -0
  195. package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -0
  196. package/dist/components/ProductImagePreview/ZoomWindow.d.ts +22 -0
  197. package/dist/components/ProductImagePreview/ZoomWindow.d.ts.map +1 -0
  198. package/dist/components/ProductImagePreview/index.d.ts +23 -0
  199. package/dist/components/ProductImagePreview/index.d.ts.map +1 -0
  200. package/dist/components/ProductImagePreview/useProductImagePreview.d.ts +42 -0
  201. package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -0
  202. package/dist/components/ProjectBar.d.ts +12 -0
  203. package/dist/components/ProjectBar.d.ts.map +1 -0
  204. package/dist/components/Radio.d.ts +10 -0
  205. package/dist/components/Radio.d.ts.map +1 -0
  206. package/dist/components/Search.d.ts +20 -0
  207. package/dist/components/Search.d.ts.map +1 -0
  208. package/dist/components/SearchResultImage/index.d.ts +9 -0
  209. package/dist/components/SearchResultImage/index.d.ts.map +1 -0
  210. package/dist/components/Select.d.ts +22 -0
  211. package/dist/components/Select.d.ts.map +1 -0
  212. package/dist/components/SideMenu.d.ts +9 -0
  213. package/dist/components/SideMenu.d.ts.map +1 -0
  214. package/dist/components/SideMenuGroup.d.ts +11 -0
  215. package/dist/components/SideMenuGroup.d.ts.map +1 -0
  216. package/dist/components/SideMenuItem.d.ts +15 -0
  217. package/dist/components/SideMenuItem.d.ts.map +1 -0
  218. package/dist/components/SimpleTable.d.ts +11 -0
  219. package/dist/components/SimpleTable.d.ts.map +1 -0
  220. package/dist/components/SkeletonParagraph.d.ts +16 -0
  221. package/dist/components/SkeletonParagraph.d.ts.map +1 -0
  222. package/dist/components/Spinner.d.ts +7 -0
  223. package/dist/components/Spinner.d.ts.map +1 -0
  224. package/dist/components/Stack.d.ts +64 -0
  225. package/dist/components/Stack.d.ts.map +1 -0
  226. package/dist/components/StatusPill.d.ts +10 -0
  227. package/dist/components/StatusPill.d.ts.map +1 -0
  228. package/dist/components/Stepper.d.ts +26 -0
  229. package/dist/components/Stepper.d.ts.map +1 -0
  230. package/dist/components/Subheader.d.ts +10 -0
  231. package/dist/components/Subheader.d.ts.map +1 -0
  232. package/dist/components/Surface.d.ts +9 -0
  233. package/dist/components/Surface.d.ts.map +1 -0
  234. package/dist/components/Swatch.d.ts +13 -0
  235. package/dist/components/Swatch.d.ts.map +1 -0
  236. package/dist/components/Textarea.d.ts +12 -0
  237. package/dist/components/Textarea.d.ts.map +1 -0
  238. package/dist/components/Theme.d.ts +8 -0
  239. package/dist/components/Theme.d.ts.map +1 -0
  240. package/dist/components/Time.d.ts +13 -0
  241. package/dist/components/Time.d.ts.map +1 -0
  242. package/dist/components/Toast.d.ts +20 -0
  243. package/dist/components/Toast.d.ts.map +1 -0
  244. package/dist/components/Tooltip.d.ts +13 -0
  245. package/dist/components/Tooltip.d.ts.map +1 -0
  246. package/dist/components/TopBar.d.ts +20 -0
  247. package/dist/components/TopBar.d.ts.map +1 -0
  248. package/dist/components/Upload.d.ts +10 -0
  249. package/dist/components/Upload.d.ts.map +1 -0
  250. package/dist/components/WorldpayIframe.d.ts +5 -0
  251. package/dist/components/WorldpayIframe.d.ts.map +1 -0
  252. package/dist/hooks/index.d.ts +9 -0
  253. package/dist/hooks/index.d.ts.map +1 -0
  254. package/dist/hooks/useEditCell.d.ts +9 -0
  255. package/dist/hooks/useEditCell.d.ts.map +1 -0
  256. package/dist/hooks/useInfiniteScroll.d.ts +9 -0
  257. package/dist/hooks/useInfiniteScroll.d.ts.map +1 -0
  258. package/dist/hooks/useKeydown.d.ts +4 -0
  259. package/dist/hooks/useKeydown.d.ts.map +1 -0
  260. package/dist/hooks/useMatchesMedia.d.ts +3 -0
  261. package/dist/hooks/useMatchesMedia.d.ts.map +1 -0
  262. package/dist/hooks/useMenuSystem.d.ts +44 -0
  263. package/dist/hooks/useMenuSystem.d.ts.map +1 -0
  264. package/dist/hooks/useMounted.d.ts +2 -0
  265. package/dist/hooks/useMounted.d.ts.map +1 -0
  266. package/dist/hooks/useTableLayout/computeColumns.d.ts +49 -0
  267. package/dist/hooks/useTableLayout/computeColumns.d.ts.map +1 -0
  268. package/dist/hooks/useTableLayout/index.d.ts +3 -0
  269. package/dist/hooks/useTableLayout/index.d.ts.map +1 -0
  270. package/dist/hooks/useTableLayout/storage.d.ts +41 -0
  271. package/dist/hooks/useTableLayout/storage.d.ts.map +1 -0
  272. package/dist/hooks/useTableLayout/types.d.ts +56 -0
  273. package/dist/hooks/useTableLayout/types.d.ts.map +1 -0
  274. package/dist/hooks/useTableLayout/useTableLayout.d.ts +23 -0
  275. package/dist/hooks/useTableLayout/useTableLayout.d.ts.map +1 -0
  276. package/dist/index.d.ts +94 -0
  277. package/dist/index.d.ts.map +1 -0
  278. package/dist/index.js +52866 -0
  279. package/dist/lib/design-system.d.ts +3 -0
  280. package/dist/lib/design-system.d.ts.map +1 -0
  281. package/dist/lib/loadFonts.d.ts +2 -0
  282. package/dist/lib/loadFonts.d.ts.map +1 -0
  283. package/dist/pdf-l6QfMa5e.js +17649 -0
  284. package/dist/styles.css +1 -0
  285. package/dist/types.d.ts +33 -0
  286. package/dist/types.d.ts.map +1 -0
  287. package/dist/utils/date-patch-dashes.d.ts +17 -0
  288. package/dist/utils/date-patch-dashes.d.ts.map +1 -0
  289. package/dist/utils/date.d.ts +60 -0
  290. package/dist/utils/date.d.ts.map +1 -0
  291. package/dist/utils/formatting.d.ts +36 -0
  292. package/dist/utils/formatting.d.ts.map +1 -0
  293. package/dist/utils/index.d.ts +6 -0
  294. package/dist/utils/index.d.ts.map +1 -0
  295. package/dist/utils/mergeObjectArrays.d.ts +12 -0
  296. package/dist/utils/mergeObjectArrays.d.ts.map +1 -0
  297. package/dist/utils.d.ts +3 -0
  298. package/dist/utils.d.ts.map +1 -0
  299. package/package.json +17 -83
  300. package/dist/chunk-3DJWSTPS.js +0 -134
  301. package/dist/chunk-3JUIYULW.js +0 -231
  302. package/dist/chunk-3PIDINTF.js +0 -52
  303. package/dist/chunk-3UPUZBP5.js +0 -149
  304. package/dist/chunk-3V5OMIYB.js +0 -2376
  305. package/dist/chunk-4FUZDLWX.js +0 -112
  306. package/dist/chunk-4RJKB7LC.js +0 -14
  307. package/dist/chunk-4UGMSWWA.js +0 -57
  308. package/dist/chunk-5IFPG6TS.js +0 -17
  309. package/dist/chunk-5N32SQ3R.js +0 -99
  310. package/dist/chunk-5UH6QUFB.js +0 -38
  311. package/dist/chunk-6YUQCRMX.js +0 -32
  312. package/dist/chunk-75USUR3I.js +0 -27
  313. package/dist/chunk-7IPESTQS.js +0 -93
  314. package/dist/chunk-7MBRCM3M.js +0 -66
  315. package/dist/chunk-7WDYXRMW.js +0 -110
  316. package/dist/chunk-7YA3TF73.js +0 -32
  317. package/dist/chunk-7Z3WINQ3.js +0 -59
  318. package/dist/chunk-7ZJIGTFN.js +0 -78
  319. package/dist/chunk-AJ5M6MVX.js +0 -7
  320. package/dist/chunk-AT4AWD6B.js +0 -44
  321. package/dist/chunk-BQNPOGD5.js +0 -105
  322. package/dist/chunk-BWPNXY7T.js +0 -78
  323. package/dist/chunk-CIYLALYO.js +0 -72
  324. package/dist/chunk-DNNX5EYX.js +0 -274
  325. package/dist/chunk-E3FOCECQ.js +0 -61
  326. package/dist/chunk-E7LGUC2B.js +0 -35
  327. package/dist/chunk-EWGHVZL5.js +0 -27
  328. package/dist/chunk-F4VE3THQ.js +0 -71
  329. package/dist/chunk-FXXRXLOL.js +0 -329
  330. package/dist/chunk-G242RHWI.js +0 -139
  331. package/dist/chunk-GOGNV5TF.js +0 -68
  332. package/dist/chunk-GYT5CL7R.js +0 -159
  333. package/dist/chunk-H36XCZ3O.js +0 -140
  334. package/dist/chunk-H5SHC4XZ.js +0 -586
  335. package/dist/chunk-HRPW6VXG.js +0 -110
  336. package/dist/chunk-J3HNYUSG.js +0 -34
  337. package/dist/chunk-J4IMVWT5.js +0 -183
  338. package/dist/chunk-JYECZBCJ.js +0 -154
  339. package/dist/chunk-K6RPFIMB.js +0 -77
  340. package/dist/chunk-KBIEWFQS.js +0 -27
  341. package/dist/chunk-KESCXOG3.js +0 -82
  342. package/dist/chunk-MBZ55T2D.js +0 -51
  343. package/dist/chunk-MVDGHWKO.js +0 -238
  344. package/dist/chunk-NAWP246H.js +0 -65
  345. package/dist/chunk-NKUETCDA.js +0 -44
  346. package/dist/chunk-NSZTJ5R4.js +0 -38
  347. package/dist/chunk-NT26ZKSI.js +0 -82
  348. package/dist/chunk-NW75QACN.js +0 -91
  349. package/dist/chunk-OM7QLLI2.js +0 -277
  350. package/dist/chunk-ORMEWXMH.js +0 -37
  351. package/dist/chunk-PE3EZP56.js +0 -373
  352. package/dist/chunk-QBIEU25R.js +0 -61
  353. package/dist/chunk-QG6NWMGA.js +0 -138
  354. package/dist/chunk-QVWYTQKL.js +0 -29
  355. package/dist/chunk-QW4AJ5FK.js +0 -483
  356. package/dist/chunk-RN465M4S.js +0 -142
  357. package/dist/chunk-SATCWGO7.js +0 -166
  358. package/dist/chunk-SBRRNFOP.js +0 -33
  359. package/dist/chunk-SJZNVG4N.js +0 -47
  360. package/dist/chunk-TBZ243DS.js +0 -173
  361. package/dist/chunk-UARCWLMD.js +0 -66
  362. package/dist/chunk-UFX5XIJL.js +0 -178
  363. package/dist/chunk-UZHBKSXJ.js +0 -87
  364. package/dist/chunk-VEEZ7VRJ.js +0 -137
  365. package/dist/chunk-VJVY6NPF.js +0 -32
  366. package/dist/chunk-VUKYIERA.js +0 -89
  367. package/dist/chunk-VXWSAIB5.js +0 -26
  368. package/dist/chunk-W5NXOJ4L.js +0 -104
  369. package/dist/chunk-WVGXD7HT.js +0 -19
  370. package/dist/chunk-WVUIIBRR.js +0 -51
  371. package/dist/chunk-X7BKBBIH.js +0 -114
  372. package/dist/chunk-XB2S2QMB.js +0 -67
  373. package/dist/chunk-Y5GD2FJA.js +0 -32
  374. package/dist/chunk-YKEPPS2I.js +0 -192
  375. package/dist/chunk-YULGJORA.js +0 -259
  376. package/dist/chunk-Z2HPSFEQ.js +0 -14
  377. package/dist/chunk-Z5YP2GI6.js +0 -142
  378. package/dist/chunk-ZRFXUER3.js +0 -468
  379. package/dist/components/AccessCard.cjs +0 -661
  380. package/dist/components/AccessCard.js +0 -13
  381. package/dist/components/AccessCardGroup.cjs +0 -365
  382. package/dist/components/AccessCardGroup.js +0 -11
  383. package/dist/components/AccessChangerTabItem.cjs +0 -352
  384. package/dist/components/AccessChangerTabItem.js +0 -75
  385. package/dist/components/Accordion.cjs +0 -680
  386. package/dist/components/Accordion.js +0 -13
  387. package/dist/components/Alert.cjs +0 -850
  388. package/dist/components/Alert.js +0 -14
  389. package/dist/components/Breadcrumbs.cjs +0 -456
  390. package/dist/components/Breadcrumbs.js +0 -125
  391. package/dist/components/Button.cjs +0 -401
  392. package/dist/components/Button.js +0 -9
  393. package/dist/components/CalendarRange.cjs +0 -6576
  394. package/dist/components/CalendarRange.css +0 -5549
  395. package/dist/components/CalendarRange.js +0 -78
  396. package/dist/components/Caption.cjs +0 -365
  397. package/dist/components/Caption.js +0 -9
  398. package/dist/components/Card.cjs +0 -128
  399. package/dist/components/Card.js +0 -7
  400. package/dist/components/Checkbox.cjs +0 -421
  401. package/dist/components/Checkbox.js +0 -11
  402. package/dist/components/CompactImagesPreview.cjs +0 -604
  403. package/dist/components/CompactImagesPreview.js +0 -14
  404. package/dist/components/ContentTab.cjs +0 -483
  405. package/dist/components/ContentTab.js +0 -11
  406. package/dist/components/ContentTabs.cjs +0 -599
  407. package/dist/components/ContentTabs.js +0 -125
  408. package/dist/components/DMSiLogo.cjs +0 -97
  409. package/dist/components/DMSiLogo.js +0 -60
  410. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +0 -6565
  411. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +0 -5549
  412. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +0 -74
  413. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +0 -6565
  414. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +0 -5549
  415. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +0 -74
  416. package/dist/components/DataGrid/PinnedColumns.cjs +0 -6565
  417. package/dist/components/DataGrid/PinnedColumns.css +0 -5549
  418. package/dist/components/DataGrid/PinnedColumns.js +0 -74
  419. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +0 -6567
  420. package/dist/components/DataGrid/TableBody/LoadingCell.css +0 -5549
  421. package/dist/components/DataGrid/TableBody/LoadingCell.js +0 -74
  422. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +0 -6567
  423. package/dist/components/DataGrid/TableBody/TableBodyRow.css +0 -5549
  424. package/dist/components/DataGrid/TableBody/TableBodyRow.js +0 -74
  425. package/dist/components/DataGrid/TableBody/index.cjs +0 -6567
  426. package/dist/components/DataGrid/TableBody/index.css +0 -5549
  427. package/dist/components/DataGrid/TableBody/index.js +0 -74
  428. package/dist/components/DataGrid/index.cjs +0 -6570
  429. package/dist/components/DataGrid/index.css +0 -5549
  430. package/dist/components/DataGrid/index.js +0 -77
  431. package/dist/components/DataGrid/utils.cjs +0 -6565
  432. package/dist/components/DataGrid/utils.css +0 -5549
  433. package/dist/components/DataGrid/utils.js +0 -74
  434. package/dist/components/DataGridCell.cjs +0 -2538
  435. package/dist/components/DataGridCell.js +0 -30
  436. package/dist/components/DataTable.cjs +0 -847
  437. package/dist/components/DataTable.js +0 -775
  438. package/dist/components/DateInput.cjs +0 -6567
  439. package/dist/components/DateInput.css +0 -5549
  440. package/dist/components/DateInput.js +0 -74
  441. package/dist/components/DateRangeInput.cjs +0 -7158
  442. package/dist/components/DateRangeInput.css +0 -5549
  443. package/dist/components/DateRangeInput.js +0 -652
  444. package/dist/components/DebugJson.cjs +0 -58
  445. package/dist/components/DebugJson.js +0 -35
  446. package/dist/components/Display.cjs +0 -263
  447. package/dist/components/Display.js +0 -12
  448. package/dist/components/EditingContext.cjs +0 -86
  449. package/dist/components/EditingContext.js +0 -12
  450. package/dist/components/EmblaCarousel/ArrowButtons.cjs +0 -151
  451. package/dist/components/EmblaCarousel/ArrowButtons.js +0 -9
  452. package/dist/components/EmblaCarousel/SelectedSnapDisplay.cjs +0 -38
  453. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +0 -7
  454. package/dist/components/EmblaCarousel/index.cjs +0 -420
  455. package/dist/components/EmblaCarousel/index.js +0 -12
  456. package/dist/components/EmptyCartIcon.cjs +0 -51
  457. package/dist/components/EmptyCartIcon.js +0 -7
  458. package/dist/components/FilterGroup.cjs +0 -1808
  459. package/dist/components/FilterGroup.js +0 -267
  460. package/dist/components/FooterBar.cjs +0 -64
  461. package/dist/components/FooterBar.js +0 -31
  462. package/dist/components/FullViewportBox.cjs +0 -60
  463. package/dist/components/FullViewportBox.js +0 -27
  464. package/dist/components/Grid.cjs +0 -135
  465. package/dist/components/Grid.js +0 -7
  466. package/dist/components/Heading.cjs +0 -267
  467. package/dist/components/Heading.js +0 -14
  468. package/dist/components/HorizontalDivider.cjs +0 -82
  469. package/dist/components/HorizontalDivider.js +0 -26
  470. package/dist/components/Icon.cjs +0 -101
  471. package/dist/components/Icon.js +0 -7
  472. package/dist/components/ImagePlaceholder.cjs +0 -65
  473. package/dist/components/ImagePlaceholder.js +0 -7
  474. package/dist/components/Input.cjs +0 -930
  475. package/dist/components/Input.js +0 -23
  476. package/dist/components/InputGroup.cjs +0 -307
  477. package/dist/components/InputGroup.js +0 -68
  478. package/dist/components/Label.cjs +0 -252
  479. package/dist/components/Label.js +0 -8
  480. package/dist/components/Link.cjs +0 -304
  481. package/dist/components/Link.js +0 -8
  482. package/dist/components/List.cjs +0 -39
  483. package/dist/components/List.js +0 -16
  484. package/dist/components/ListGroup.cjs +0 -568
  485. package/dist/components/ListGroup.js +0 -11
  486. package/dist/components/LiveChatComponent.cjs +0 -63
  487. package/dist/components/LiveChatComponent.js +0 -40
  488. package/dist/components/LoadingScrim.cjs +0 -90
  489. package/dist/components/LoadingScrim.js +0 -28
  490. package/dist/components/LogoAgilityTopBar.cjs +0 -133
  491. package/dist/components/LogoAgilityTopBar.js +0 -96
  492. package/dist/components/LogoDMSiTopBar.cjs +0 -97
  493. package/dist/components/LogoDMSiTopBar.js +0 -7
  494. package/dist/components/LogoMillworkTopBar.cjs +0 -239
  495. package/dist/components/LogoMillworkTopBar.js +0 -202
  496. package/dist/components/MainBar.cjs +0 -234
  497. package/dist/components/MainBar.js +0 -66
  498. package/dist/components/MaxViewportBox.cjs +0 -45
  499. package/dist/components/MaxViewportBox.js +0 -22
  500. package/dist/components/Menu.cjs +0 -505
  501. package/dist/components/Menu.js +0 -14
  502. package/dist/components/MenuOption.cjs +0 -695
  503. package/dist/components/MenuOption.js +0 -18
  504. package/dist/components/MobileDataGrid/ColumnList.cjs +0 -991
  505. package/dist/components/MobileDataGrid/ColumnList.css +0 -5549
  506. package/dist/components/MobileDataGrid/ColumnList.js +0 -20
  507. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +0 -6675
  508. package/dist/components/MobileDataGrid/ColumnSelector/index.css +0 -5549
  509. package/dist/components/MobileDataGrid/ColumnSelector/index.js +0 -74
  510. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.cjs +0 -31
  511. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +0 -7
  512. package/dist/components/MobileDataGrid/GridContextProvider/index.cjs +0 -186
  513. package/dist/components/MobileDataGrid/GridContextProvider/index.js +0 -8
  514. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +0 -333
  515. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +0 -12
  516. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +0 -907
  517. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +0 -19
  518. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +0 -6985
  519. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +0 -5549
  520. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +0 -74
  521. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +0 -620
  522. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +0 -16
  523. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +0 -1457
  524. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +0 -29
  525. package/dist/components/MobileDataGrid/index.cjs +0 -7496
  526. package/dist/components/MobileDataGrid/index.css +0 -5549
  527. package/dist/components/MobileDataGrid/index.js +0 -74
  528. package/dist/components/Modal.cjs +0 -995
  529. package/dist/components/Modal.js +0 -23
  530. package/dist/components/ModalButtons.cjs +0 -491
  531. package/dist/components/ModalButtons.js +0 -11
  532. package/dist/components/ModalContent.cjs +0 -204
  533. package/dist/components/ModalContent.js +0 -8
  534. package/dist/components/ModalHeader.cjs +0 -563
  535. package/dist/components/ModalHeader.js +0 -12
  536. package/dist/components/ModalScrim.cjs +0 -69
  537. package/dist/components/ModalScrim.js +0 -7
  538. package/dist/components/NavigationTab.cjs +0 -522
  539. package/dist/components/NavigationTab.js +0 -11
  540. package/dist/components/NavigationTabs.cjs +0 -572
  541. package/dist/components/NavigationTabs.js +0 -61
  542. package/dist/components/NestedMenu.cjs +0 -1275
  543. package/dist/components/NestedMenu.js +0 -164
  544. package/dist/components/Notification.cjs +0 -871
  545. package/dist/components/Notification.js +0 -126
  546. package/dist/components/OptionPill.cjs +0 -597
  547. package/dist/components/OptionPill.js +0 -12
  548. package/dist/components/OrderCheckIcon.cjs +0 -85
  549. package/dist/components/OrderCheckIcon.js +0 -7
  550. package/dist/components/PDFViewer/DownloadIcon.cjs +0 -618
  551. package/dist/components/PDFViewer/DownloadIcon.js +0 -17
  552. package/dist/components/PDFViewer/PDFElement.cjs +0 -571
  553. package/dist/components/PDFViewer/PDFElement.js +0 -11
  554. package/dist/components/PDFViewer/PDFNavigation.cjs +0 -828
  555. package/dist/components/PDFViewer/PDFNavigation.js +0 -14
  556. package/dist/components/PDFViewer/PDFPage.cjs +0 -56
  557. package/dist/components/PDFViewer/PDFPage.js +0 -7
  558. package/dist/components/PDFViewer/index.cjs +0 -1941
  559. package/dist/components/PDFViewer/index.js +0 -182
  560. package/dist/components/Pagination.cjs +0 -436
  561. package/dist/components/Pagination.js +0 -10
  562. package/dist/components/Paragraph.cjs +0 -261
  563. package/dist/components/Paragraph.js +0 -8
  564. package/dist/components/Password.cjs +0 -1130
  565. package/dist/components/Password.js +0 -75
  566. package/dist/components/ProductImagePreview/CarouselPagination.cjs +0 -75
  567. package/dist/components/ProductImagePreview/CarouselPagination.js +0 -7
  568. package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +0 -216
  569. package/dist/components/ProductImagePreview/MobileImageCarousel.js +0 -7
  570. package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +0 -214
  571. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +0 -7
  572. package/dist/components/ProductImagePreview/Thumbnail.cjs +0 -112
  573. package/dist/components/ProductImagePreview/Thumbnail.js +0 -8
  574. package/dist/components/ProductImagePreview/ZoomWindow.cjs +0 -198
  575. package/dist/components/ProductImagePreview/ZoomWindow.js +0 -8
  576. package/dist/components/ProductImagePreview/index.cjs +0 -1447
  577. package/dist/components/ProductImagePreview/index.js +0 -22
  578. package/dist/components/ProjectBar.cjs +0 -279
  579. package/dist/components/ProjectBar.js +0 -71
  580. package/dist/components/Radio.cjs +0 -386
  581. package/dist/components/Radio.js +0 -10
  582. package/dist/components/Search.cjs +0 -1040
  583. package/dist/components/Search.js +0 -14
  584. package/dist/components/SearchResultImage/index.cjs +0 -92
  585. package/dist/components/SearchResultImage/index.js +0 -8
  586. package/dist/components/Select.cjs +0 -1019
  587. package/dist/components/Select.js +0 -14
  588. package/dist/components/SideMenu.cjs +0 -61
  589. package/dist/components/SideMenu.js +0 -28
  590. package/dist/components/SideMenuGroup.cjs +0 -593
  591. package/dist/components/SideMenuGroup.js +0 -97
  592. package/dist/components/SideMenuItem.cjs +0 -568
  593. package/dist/components/SideMenuItem.js +0 -95
  594. package/dist/components/SimpleTable.cjs +0 -547
  595. package/dist/components/SimpleTable.js +0 -10
  596. package/dist/components/SkeletonParagraph.cjs +0 -51
  597. package/dist/components/SkeletonParagraph.js +0 -7
  598. package/dist/components/Spinner.cjs +0 -57
  599. package/dist/components/Spinner.js +0 -7
  600. package/dist/components/Stack.cjs +0 -434
  601. package/dist/components/Stack.js +0 -8
  602. package/dist/components/StatusPill.cjs +0 -303
  603. package/dist/components/StatusPill.js +0 -64
  604. package/dist/components/Stepper.cjs +0 -1485
  605. package/dist/components/Stepper.js +0 -239
  606. package/dist/components/Subheader.cjs +0 -255
  607. package/dist/components/Subheader.js +0 -8
  608. package/dist/components/Surface.cjs +0 -101
  609. package/dist/components/Surface.js +0 -7
  610. package/dist/components/Swatch.cjs +0 -2089
  611. package/dist/components/Swatch.js +0 -1513
  612. package/dist/components/Textarea.cjs +0 -330
  613. package/dist/components/Textarea.js +0 -136
  614. package/dist/components/Theme.cjs +0 -51
  615. package/dist/components/Theme.js +0 -7
  616. package/dist/components/Time.cjs +0 -1518
  617. package/dist/components/Time.js +0 -373
  618. package/dist/components/Toast.cjs +0 -764
  619. package/dist/components/Toast.js +0 -243
  620. package/dist/components/Tooltip.cjs +0 -337
  621. package/dist/components/Tooltip.js +0 -14
  622. package/dist/components/TopBar.cjs +0 -392
  623. package/dist/components/TopBar.js +0 -148
  624. package/dist/components/Upload.cjs +0 -823
  625. package/dist/components/Upload.js +0 -132
  626. package/dist/components/WorldpayIframe.cjs +0 -45
  627. package/dist/components/WorldpayIframe.js +0 -22
  628. package/dist/components/index.cjs +0 -9461
  629. package/dist/components/index.css +0 -5549
  630. package/dist/components/index.js +0 -174
  631. package/dist/components/useMenuSystem.cjs +0 -442
  632. package/dist/components/useMenuSystem.js +0 -15
  633. package/dist/components/useMounted.cjs +0 -39
  634. package/dist/components/useMounted.js +0 -8
  635. package/dist/fonts.css +0 -21
  636. package/dist/hooks/index.cjs +0 -523
  637. package/dist/hooks/index.js +0 -22
  638. package/dist/icons-light[FILL]-PPZXOLWS.woff2 +0 -0
  639. package/dist/icons-normal[FILL]-PPZXOLWS.woff2 +0 -0
  640. package/dist/index.css +0 -5527
  641. package/dist/open-sans-55T6A4JE.woff2 +0 -0
  642. package/dist/types.cjs +0 -18
  643. package/dist/types.js +0 -0
  644. package/dist/utils/index.cjs +0 -264
  645. package/dist/utils/index.js +0 -43
@@ -1,2538 +0,0 @@
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/DataGridCell.tsx
61
- var DataGridCell_exports = {};
62
- __export(DataGridCell_exports, {
63
- DataCellHeader: () => DataCellHeader,
64
- DataGridCell: () => DataGridCell,
65
- DragAlongCell: () => DragAlongCell,
66
- DraggableCellHeader: () => DraggableCellHeader
67
- });
68
- module.exports = __toCommonJS(DataGridCell_exports);
69
- var import_sortable = require("@dnd-kit/sortable");
70
-
71
- // ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
72
- var import_react = require("react");
73
- var canUseDOM = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
74
- var CSS = /* @__PURE__ */ Object.freeze({
75
- Translate: {
76
- toString(transform) {
77
- if (!transform) {
78
- return;
79
- }
80
- const {
81
- x,
82
- y
83
- } = transform;
84
- return "translate3d(" + (x ? Math.round(x) : 0) + "px, " + (y ? Math.round(y) : 0) + "px, 0)";
85
- }
86
- },
87
- Scale: {
88
- toString(transform) {
89
- if (!transform) {
90
- return;
91
- }
92
- const {
93
- scaleX,
94
- scaleY
95
- } = transform;
96
- return "scaleX(" + scaleX + ") scaleY(" + scaleY + ")";
97
- }
98
- },
99
- Transform: {
100
- toString(transform) {
101
- if (!transform) {
102
- return;
103
- }
104
- return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(" ");
105
- }
106
- },
107
- Transition: {
108
- toString(_ref) {
109
- let {
110
- property,
111
- duration,
112
- easing
113
- } = _ref;
114
- return property + " " + duration + "ms " + easing;
115
- }
116
- }
117
- });
118
-
119
- // src/components/DataGridCell.tsx
120
- var import_clsx9 = __toESM(require("clsx"), 1);
121
- var import_react12 = require("react");
122
-
123
- // src/classNames.ts
124
- var import_clsx = __toESM(require("clsx"), 1);
125
- var typography = {
126
- display1: (0, import_clsx.default)(
127
- "font-sans font-semibold",
128
- "text-display-1-mobile desktop:text-display-1-desktop compact:text-display-1-desktop-compact",
129
- "leading-display-1-mobile desktop:leading-display-1-desktop"
130
- ),
131
- display2: (0, import_clsx.default)(
132
- "font-sans font-bold",
133
- "text-display-2-mobile desktop:text-display-2-desktop compact:text-display-2-desktop-compact",
134
- "leading-display-2-mobile desktop:leading-display-2-desktop"
135
- ),
136
- heading1: (0, import_clsx.default)(
137
- "font-sans font-semibold",
138
- "text-heading-1-mobile desktop:text-heading-1-desktop compact:text-heading-1-desktop-compact",
139
- "leading-heading-1-mobile desktop:leading-heading-1-desktop"
140
- ),
141
- heading2: (0, import_clsx.default)(
142
- "font-sans font-normal",
143
- "text-heading-2-mobile desktop:text-heading-2-desktop compact:text-heading-2-desktop-compact",
144
- "leading-heading-2-mobile desktop:leading-heading-2-desktop"
145
- ),
146
- heading3: (0, import_clsx.default)(
147
- "font-sans font-semibold",
148
- "text-heading-3-mobile desktop:text-heading-3-desktop compact:text-heading-3-desktop-compact",
149
- "leading-heading-3-mobile desktop:leading-heading-3-desktop"
150
- ),
151
- subheader: (0, import_clsx.default)(
152
- "font-sans font-semibold",
153
- "text-subheader-mobile desktop:text-subheader-desktop compact:text-subheader-desktop-compact",
154
- "leading-subheader-mobile desktop:leading-subheader-desktop"
155
- ),
156
- link: (0, import_clsx.default)(
157
- "font-sans font-normal",
158
- "text-link-mobile desktop:text-link-desktop compact:text-link-desktop-compact",
159
- "leading-link-mobile desktop:leading-link-desktop"
160
- ),
161
- buttonLabel: (0, import_clsx.default)(
162
- "font-sans font-semibold",
163
- "text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
164
- "leading-label-mobile desktop:leading-label-desktop"
165
- ),
166
- label: (0, import_clsx.default)(
167
- "font-sans font-semibold",
168
- "text-label-mobile desktop:text-label-desktop compact:text-label-desktop-compact",
169
- "leading-label-mobile desktop:leading-label-desktop"
170
- ),
171
- paragraph: (0, import_clsx.default)(
172
- "font-sans font-normal",
173
- "text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
174
- "leading-paragraph-mobile desktop:leading-paragraph-desktop"
175
- ),
176
- caption: (0, import_clsx.default)(
177
- "font-sans font-normal",
178
- "text-caption-mobile desktop:text-caption-desktop compact:text-caption-desktop-compact",
179
- "leading-caption-mobile desktop:leading-caption-desktop"
180
- ),
181
- breadcrumb: (0, import_clsx.default)(
182
- "font-sans font-normal",
183
- "text-paragraph-mobile desktop:text-paragraph-desktop compact:text-paragraph-desktop-compact",
184
- "leading-mobile-breadcrumb desktop:leading-desktop-breadcrumb"
185
- )
186
- };
187
- var baseTransition = (0, import_clsx.default)(
188
- "transition-colors duration-100 ease-in-out"
189
- );
190
- var componentGap = (0, import_clsx.default)(
191
- "gap-mobile-component-gap desktop:gap-desktop-component-gap compact:gap-desktop-compact-component-gap"
192
- );
193
- var paddingUsingComponentGap = (0, import_clsx.default)(
194
- "p-mobile-component-gap desktop:p-desktop-component-gap compact:p-desktop-compact-component-gap"
195
- );
196
- var paddingXUsingLayoutGroupGap = (0, import_clsx.default)(
197
- "px-mobile-layout-group-gap desktop:px-desktop-layout-group-gap compact:px-desktop-compact-layout-group-gap"
198
- );
199
- var paddingYUsingLayoutGroupGap = (0, import_clsx.default)(
200
- "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
201
- );
202
- var componentPadding = (0, import_clsx.default)(
203
- "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
204
- );
205
- var componentPaddingBottom = (0, import_clsx.default)(
206
- "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding"
207
- );
208
- var componentPaddingX = (0, import_clsx.default)(
209
- "px-mobile-component-padding desktop:px-desktop-component-padding compact:px-desktop-compact-component-padding"
210
- );
211
- var componentPaddingY = (0, import_clsx.default)(
212
- "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding"
213
- );
214
- var componentPaddingXUsingComponentGap = (0, import_clsx.default)(
215
- "px-mobile-component-gap desktop:px-desktop-component-gap compact:px-desktop-compact-component-gap"
216
- );
217
- var componentPaddingYUsingComponentGap = (0, import_clsx.default)(
218
- "py-mobile-component-gap desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
219
- );
220
- var componentPaddingYUsingComponentGap2xMobile = (0, import_clsx.default)(
221
- "py-[calc(var(--spacing-mobile-component-gap)_+_8px)] desktop:py-desktop-component-gap compact:py-desktop-compact-component-gap"
222
- );
223
- var componentPaddingMinusBorder = (0, import_clsx.default)(
224
- "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)]"
225
- );
226
- var componentPaddingMinus2pxBorder = (0, import_clsx.default)(
227
- "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)]"
228
- );
229
- var componentPaddingMinusBorderDesktop = (0, import_clsx.default)(
230
- "p-[calc(var(--spacing-desktop-component-padding)_-_1px)]"
231
- );
232
- var layoutPaddding = (0, import_clsx.default)(
233
- "p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding"
234
- );
235
- var layoutPaddingBottom = (0, import_clsx.default)(
236
- "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding"
237
- );
238
- var layoutPaddingY = (0, import_clsx.default)(
239
- "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding"
240
- );
241
- var layoutPaddingX = (0, import_clsx.default)(
242
- "px-mobile-layout-padding desktop:px-desktop-layout-padding compact:px-desktop-compact-layout-padding"
243
- );
244
- var containerPaddingX = (0, import_clsx.default)(
245
- "px-mobile-container-padding desktop:px-desktop-container-padding compact:px-desktop-compact-container-padding"
246
- );
247
- var containerPaddingY = (0, import_clsx.default)(
248
- "py-mobile-container-padding desktop:py-desktop-container-padding compact:py-desktop-compact-container-padding"
249
- );
250
- var layoutGroupGapPaddingY = (0, import_clsx.default)(
251
- "py-mobile-layout-group-gap desktop:py-desktop-layout-group-gap compact:py-desktop-compact-layout-group-gap"
252
- );
253
- var layoutGroupGap = (0, import_clsx.default)(
254
- "gap-mobile-layout-group-gap desktop:gap-desktop-layout-group-gap compact:gap-desktop-compact-layout-group-gap"
255
- );
256
- var layoutGap = (0, import_clsx.default)(
257
- "gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap"
258
- );
259
- var gapUsingContainerPadding = (0, import_clsx.default)(
260
- "gap-mobile-container-padding desktop:gap-desktop-container-padding compact:gap-desktop-compact-container-padding"
261
- );
262
-
263
- // src/components/MenuOption.tsx
264
- var import_clsx6 = __toESM(require("clsx"), 1);
265
- var import_react7 = require("react");
266
-
267
- // src/components/Label.tsx
268
- var import_clsx2 = __toESM(require("clsx"), 1);
269
- var import_jsx_runtime = require("react/jsx-runtime");
270
- var Label = (_a) => {
271
- var _b = _a, {
272
- as = "span",
273
- padded,
274
- className,
275
- color,
276
- align,
277
- id,
278
- testid
279
- } = _b, props = __objRest(_b, [
280
- "as",
281
- "padded",
282
- "className",
283
- "color",
284
- "align",
285
- "id",
286
- "testid"
287
- ]);
288
- const Element = as;
289
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
290
- Element,
291
- __spreadProps(__spreadValues({
292
- id,
293
- "data-testid": testid,
294
- className: (0, import_clsx2.default)(
295
- typography.label,
296
- align === "left" && "text-left",
297
- align === "center" && "text-center",
298
- align === "right" && "text-right",
299
- className,
300
- padded && componentPaddingXUsingComponentGap
301
- )
302
- }, props), {
303
- style: __spreadProps(__spreadValues({}, props.style), {
304
- color: color ? `var(--color-${color})` : void 0
305
- })
306
- })
307
- );
308
- };
309
- Label.displayName = "Label";
310
-
311
- // src/components/Paragraph.tsx
312
- var import_clsx3 = __toESM(require("clsx"), 1);
313
- var import_jsx_runtime2 = require("react/jsx-runtime");
314
- var Paragraph = (_a) => {
315
- var _b = _a, {
316
- className,
317
- color,
318
- padded,
319
- align = "left",
320
- tall,
321
- addOverflow,
322
- children,
323
- as = "p",
324
- id,
325
- testid
326
- } = _b, props = __objRest(_b, [
327
- "className",
328
- "color",
329
- "padded",
330
- "align",
331
- "tall",
332
- "addOverflow",
333
- "children",
334
- "as",
335
- "id",
336
- "testid"
337
- ]);
338
- const Element = as;
339
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
340
- Element,
341
- __spreadProps(__spreadValues({
342
- id,
343
- "data-testid": testid
344
- }, props), {
345
- className: (0, import_clsx3.default)(
346
- typography.paragraph,
347
- className,
348
- padded && componentPaddingXUsingComponentGap,
349
- align === "left" && "text-left",
350
- align === "center" && "text-center",
351
- align === "right" && "text-right",
352
- tall && "!leading-6",
353
- addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
354
- ),
355
- style: __spreadProps(__spreadValues({}, props.style), {
356
- color: color ? `var(--color-${color})` : void 0
357
- }),
358
- children
359
- })
360
- );
361
- };
362
- Paragraph.displayName = "Paragraph";
363
-
364
- // src/components/Icon.tsx
365
- var import_clsx4 = __toESM(require("clsx"), 1);
366
- var import_jsx_runtime3 = require("react/jsx-runtime");
367
- function Icon(_a) {
368
- var _b = _a, {
369
- name,
370
- size = 24,
371
- variant = "outline",
372
- testid
373
- } = _b, props = __objRest(_b, [
374
- "name",
375
- "size",
376
- "variant",
377
- "testid"
378
- ]);
379
- const variantStyle = variant === "filled" ? '"FILL" 1' : '"FILL" 0';
380
- const weightStyle = size === 16 ? '"wght" 400' : '"wght" 300';
381
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
382
- "span",
383
- __spreadProps(__spreadValues({}, props), {
384
- "data-testid": testid,
385
- className: (0, import_clsx4.default)(
386
- "icon",
387
- `icon-${size}`,
388
- // size === 16 ? "font-normal" : "font-light", // size 16 font weight is not working as normal from before
389
- props.className
390
- ),
391
- style: __spreadValues({
392
- fontVariationSettings: variantStyle + `, ${weightStyle}`
393
- }, props.style),
394
- children: name
395
- })
396
- );
397
- }
398
-
399
- // src/hooks/useKeydown.ts
400
- var import_react2 = require("react");
401
-
402
- // src/hooks/useInfiniteScroll.tsx
403
- var import_react3 = require("react");
404
-
405
- // src/hooks/useMatchesMedia.ts
406
- var import_react4 = require("react");
407
- var useMatchesMedia = (query) => {
408
- const [matches, setMatches] = (0, import_react4.useState)();
409
- (0, import_react4.useLayoutEffect)(() => {
410
- const mediaQueryList = window.matchMedia(query);
411
- const listener = () => setMatches(mediaQueryList.matches);
412
- listener();
413
- mediaQueryList.addEventListener("change", listener);
414
- return () => mediaQueryList.removeEventListener("change", listener);
415
- }, [query]);
416
- return matches;
417
- };
418
- var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
419
-
420
- // src/hooks/useTableLayout/useTableLayout.ts
421
- var import_react5 = require("react");
422
-
423
- // src/utils/formatting.tsx
424
- function getDecimalPlaceholder(decimals) {
425
- if (!decimals || decimals <= 0) {
426
- return {};
427
- }
428
- return {
429
- placeholder: `0.${"0".repeat(decimals)}`
430
- };
431
- }
432
- function formatDecimalValue(value, decimals) {
433
- if (!value || value === "") {
434
- return "";
435
- }
436
- const numValue = typeof value === "string" ? parseFloat(value) : value;
437
- if (isNaN(numValue)) {
438
- return "";
439
- }
440
- if (!decimals || decimals <= 0) {
441
- return String(Math.round(numValue));
442
- }
443
- return numValue.toFixed(decimals);
444
- }
445
- function formatCurrencyDisplay(value) {
446
- if (!value || value === "") {
447
- return "";
448
- }
449
- const parts = value.split(".");
450
- const integerPart = parts[0];
451
- const decimalPart = parts[1];
452
- const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
453
- return decimalPart !== void 0 ? `${formattedInteger}.${decimalPart}` : formattedInteger;
454
- }
455
-
456
- // src/utils/index.ts
457
- var LocalStoragePrefixVersion = `dmsi-acc-v1.1.5`;
458
-
459
- // src/utils.ts
460
- function findDocumentRoot(element) {
461
- if (typeof window === "undefined" || typeof document === "undefined") {
462
- throw new Error(
463
- "findDocumentRoot can only be used in a browser environment."
464
- );
465
- }
466
- if (!element || !(element instanceof Node)) {
467
- return window.document.body;
468
- }
469
- let currentElement = element;
470
- while (currentElement && currentElement.parentNode) {
471
- if (currentElement.parentNode === document) {
472
- return document.body;
473
- } else if (currentElement.parentNode instanceof DocumentFragment) {
474
- return currentElement.parentNode;
475
- } else {
476
- currentElement = currentElement.parentNode;
477
- }
478
- }
479
- return window.document.body;
480
- }
481
-
482
- // src/hooks/useTableLayout/storage.ts
483
- var STORAGE_PREFIX = `${LocalStoragePrefixVersion}-tablePrefs`;
484
- var LEGACY_STORAGE_PREFIX = `${LocalStoragePrefixVersion}-tableLayout`;
485
-
486
- // src/hooks/useEditCell.tsx
487
- var import_react6 = require("react");
488
-
489
- // src/components/Caption.tsx
490
- var import_clsx5 = __toESM(require("clsx"), 1);
491
- var import_jsx_runtime4 = require("react/jsx-runtime");
492
- var Caption = (_a) => {
493
- var _b = _a, {
494
- className,
495
- children,
496
- as = "span",
497
- style = "default",
498
- color,
499
- align,
500
- id,
501
- testid,
502
- marginTopDesktop
503
- } = _b, props = __objRest(_b, [
504
- "className",
505
- "children",
506
- "as",
507
- "style",
508
- "color",
509
- "align",
510
- "id",
511
- "testid",
512
- "marginTopDesktop"
513
- ]);
514
- const Element = as;
515
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { id, "data-testid": testid, className: "flex gap-1", children: [
516
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
517
- WhichIcon,
518
- {
519
- id,
520
- testid,
521
- style,
522
- size: 16,
523
- className: "mt-[3px] desktop:mt-0"
524
- }
525
- ),
526
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
527
- Element,
528
- __spreadProps(__spreadValues({
529
- id: id ? `${id}-text` : void 0,
530
- "data-testid": testid ? `${testid}-text` : void 0,
531
- className: (0, import_clsx5.default)(
532
- typography.caption.replace("text-text-primary-normal", ""),
533
- (style === "default" || style === "info") && "text-text-secondary-normal",
534
- style === "success" && "text-text-success-normal",
535
- style === "warning" && "text-text-warning-normal",
536
- style === "error" && "text-text-critical-normal",
537
- align === "left" && "text-left",
538
- align === "center" && "text-center",
539
- align === "right" && "text-right",
540
- className,
541
- marginTopDesktop && `desktop:mt-px`
542
- )
543
- }, props), {
544
- style: {
545
- color: color ? `var(--color-${color})` : void 0
546
- },
547
- children
548
- })
549
- )
550
- ] });
551
- };
552
- var WhichIcon = ({
553
- style,
554
- size,
555
- className,
556
- id,
557
- testid
558
- }) => {
559
- if (style === "success") {
560
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
561
- Icon,
562
- {
563
- id: id ? `${id}-icon` : void 0,
564
- testid: testid ? `${testid}-icon` : void 0,
565
- className,
566
- name: "check_circle",
567
- size
568
- }
569
- ) });
570
- }
571
- if (style === "warning") {
572
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
573
- Icon,
574
- {
575
- id: id ? `${id}-icon` : void 0,
576
- testid: testid ? `${testid}-icon` : void 0,
577
- className,
578
- name: "warning",
579
- size
580
- }
581
- ) });
582
- }
583
- if (style === "error") {
584
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
585
- Icon,
586
- {
587
- id: id ? `${id}-icon` : void 0,
588
- testid: testid ? `${testid}-icon` : void 0,
589
- className,
590
- name: "info",
591
- size
592
- }
593
- ) });
594
- }
595
- if (style === "info") {
596
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
597
- Icon,
598
- {
599
- id: id ? `${id}-icon` : void 0,
600
- testid: testid ? `${testid}-icon` : void 0,
601
- className,
602
- name: "info",
603
- size
604
- }
605
- ) });
606
- }
607
- return null;
608
- };
609
- Caption.displayName = "Caption";
610
-
611
- // src/components/MenuOption.tsx
612
- var import_jsx_runtime5 = require("react/jsx-runtime");
613
- var MenuOption = ({
614
- id,
615
- testid,
616
- children,
617
- disabled = false,
618
- variant = "normal",
619
- value,
620
- before,
621
- after,
622
- subMenu,
623
- onClick,
624
- selected,
625
- ref,
626
- onSubMenuHover,
627
- onSubMenuLeave,
628
- onSubMenuEnter,
629
- toggleMenu,
630
- subMenuLevel = 1,
631
- currentSubMenuLevel,
632
- closeSubMenuLevel,
633
- activeMenu,
634
- mobilePositionTo,
635
- highlightMatchingText = false,
636
- menuValue,
637
- onMouseMove,
638
- onMouseEnter,
639
- onMouseLeave,
640
- small = false
641
- }) => {
642
- const uniqueId = (0, import_react7.useId)();
643
- const internalRef = (0, import_react7.useRef)(null);
644
- const actualRef = ref || internalRef;
645
- const menuId = (0, import_react7.useRef)(`menu-${uniqueId}`);
646
- const isMobile = useMatchesMobile();
647
- const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react7.useState)(false);
648
- const handleMouseEnter = () => {
649
- if (subMenu && onSubMenuHover && !disabled) {
650
- onSubMenuHover(menuId.current, subMenuLevel);
651
- }
652
- onMouseEnter == null ? void 0 : onMouseEnter();
653
- };
654
- const handleMouseLeave = () => {
655
- if (subMenu && onSubMenuLeave && !disabled) {
656
- onSubMenuLeave(subMenuLevel);
657
- }
658
- setIsSubMenuHovered(false);
659
- onMouseLeave == null ? void 0 : onMouseLeave();
660
- };
661
- const handleMouseMove = () => {
662
- if (subMenu && onMouseMove && !disabled) {
663
- onMouseMove();
664
- }
665
- };
666
- const handleSubMenuEnter = () => {
667
- if (onSubMenuEnter) {
668
- onSubMenuEnter();
669
- }
670
- setIsSubMenuHovered(true);
671
- };
672
- const additionalAttributes = {
673
- "data-selected": selected || null,
674
- "data-submenu-hovered": isSubMenuHovered || null
675
- };
676
- const svgStyles = (0, import_clsx6.default)(
677
- "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
678
- );
679
- const textLabelStyles = (0, import_clsx6.default)("w-full whitespace-nowrap !leading-6");
680
- const normalStyles = variant === "normal" && !disabled && (0, import_clsx6.default)(
681
- "bg-transparent text-text-primary-normal",
682
- "hover:bg-background-action-secondary-hover",
683
- "focus-visible:bg-background-action-secondary-hover",
684
- "data-selected:bg-background-action-secondary-hover",
685
- "data-submenu-hovered:bg-background-action-secondary-hover",
686
- "active:bg-background-action-secondary-active"
687
- );
688
- const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx6.default)("text-text-primary-disabled");
689
- const actionStyles = variant === "action" && !disabled && (0, import_clsx6.default)(
690
- "text-action-400 bg-transparent",
691
- "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
692
- "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
693
- "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
694
- "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
695
- "active:bg-background-action-secondary-active active:text-text-action-active"
696
- );
697
- const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx6.default)("text-text-action-disabled");
698
- const disabledStyles = disabled && (0, import_clsx6.default)("bg-transparent cursor-default pointer-events-none");
699
- const processChildren = typeof children === "string" && highlightMatchingText ? highlightMatch(children, menuValue) : children;
700
- const renderChildren = typeof children === "object" ? children : variant === "action" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label, { padded: true, className: textLabelStyles, children: processChildren }) : !small ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Paragraph, { padded: true, className: textLabelStyles, children: processChildren }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Caption, { padded: true, className: textLabelStyles, children: processChildren });
701
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
702
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
703
- "div",
704
- __spreadProps(__spreadValues({
705
- id,
706
- "data-testid": testid,
707
- ref: actualRef,
708
- className: (0, import_clsx6.default)(
709
- "flex cursor-pointer w-full text-left relative outline-none",
710
- svgStyles,
711
- small ? layoutGroupGap : componentGap,
712
- componentPadding,
713
- baseTransition,
714
- normalStyles,
715
- normalDisabledStyles,
716
- actionStyles,
717
- actionDisabledStyles,
718
- disabledStyles,
719
- { "items-center": !small }
720
- ),
721
- "data-value": value || children,
722
- onClick: () => {
723
- onClick == null ? void 0 : onClick(menuId.current, value || children);
724
- if (subMenu) {
725
- toggleMenu(menuId.current, subMenuLevel);
726
- }
727
- },
728
- onMouseEnter: handleMouseEnter,
729
- onMouseLeave: handleMouseLeave,
730
- onMouseMove: handleMouseMove
731
- }, additionalAttributes), {
732
- tabIndex: -1,
733
- role: "menuitem",
734
- "aria-haspopup": subMenu ? "menu" : void 0,
735
- children: [
736
- before && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx6.default)("shrink-0", { "items-center flex": !small }), children: before }),
737
- renderChildren,
738
- renderAfterProp()
739
- ]
740
- })
741
- ),
742
- subMenu && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
743
- "div",
744
- {
745
- onMouseEnter: handleSubMenuEnter,
746
- onMouseLeave: () => {
747
- handleMouseLeave();
748
- setIsSubMenuHovered(false);
749
- },
750
- "data-submenu-parent": menuId.current,
751
- "data-menu-level": subMenuLevel + 1,
752
- children: subMenu({
753
- menuId: menuId.current,
754
- positionTo: actualRef,
755
- mobilePositionTo,
756
- position: "right",
757
- subMenuLevel,
758
- mobileBackMenuOption,
759
- mobileHide: isMobile && activeMenu !== menuId.current,
760
- autoFocusOff: true
761
- })
762
- }
763
- )
764
- ] });
765
- function renderAfterProp() {
766
- if (after) {
767
- return after;
768
- }
769
- if (subMenu && after !== null) {
770
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_right" });
771
- }
772
- }
773
- function mobileBackMenuOption() {
774
- if (!isMobile) {
775
- return;
776
- }
777
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
778
- MenuOption,
779
- {
780
- id: id ? `${id}-back` : void 0,
781
- testid: testid ? `${testid}-back` : void 0,
782
- onClick: () => {
783
- closeSubMenuLevel == null ? void 0 : closeSubMenuLevel(currentSubMenuLevel != null ? currentSubMenuLevel : 0);
784
- },
785
- variant: "action",
786
- before: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chevron_left" }),
787
- children: "Back"
788
- }
789
- );
790
- }
791
- };
792
- MenuOption.displayName = "MenuOption";
793
- function highlightMatch(text, searchValue) {
794
- if (!searchValue || !searchValue.trim()) {
795
- return text;
796
- }
797
- const regex = new RegExp(
798
- `(${searchValue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
799
- "gi"
800
- );
801
- const parts = text.split(regex);
802
- return parts.map(
803
- (part, index) => regex.test(part) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-bold", children: part }, index) : part
804
- );
805
- }
806
-
807
- // src/components/Menu.tsx
808
- var import_clsx7 = __toESM(require("clsx"), 1);
809
- var import_react9 = require("react");
810
- var import_react_dom = require("react-dom");
811
-
812
- // src/components/useMenuSystem.tsx
813
- var import_react8 = require("react");
814
- function useSubMenuSystem(mobilePositionTo) {
815
- const [activeMenus, setActiveMenus] = (0, import_react8.useState)(
816
- {}
817
- );
818
- const [activeMenu, setActiveMenu] = (0, import_react8.useState)("");
819
- const [currentSubMenuLevel, setCurrentSubMenuLevel] = (0, import_react8.useState)(
820
- null
821
- );
822
- const menuRootRef = (0, import_react8.useRef)(null);
823
- const subMenuRefs = (0, import_react8.useRef)({});
824
- const hoverTimeoutRef = (0, import_react8.useRef)(null);
825
- const closeTimeoutRef = (0, import_react8.useRef)(null);
826
- const mouseStopTimeoutRef = (0, import_react8.useRef)(null);
827
- const isMouseMovingRef = (0, import_react8.useRef)(false);
828
- const pendingOpenActionRef = (0, import_react8.useRef)(null);
829
- const pendingCloseActionRef = (0, import_react8.useRef)(null);
830
- const isMobile = useMatchesMobile();
831
- const toggleMenu = (menuId, level) => {
832
- if (closeTimeoutRef.current) {
833
- clearTimeout(closeTimeoutRef.current);
834
- closeTimeoutRef.current = null;
835
- }
836
- setActiveMenu(menuId);
837
- setCurrentSubMenuLevel(level);
838
- setActiveMenus((prev) => {
839
- const newActiveMenus = __spreadValues({}, prev);
840
- if (newActiveMenus[level] === menuId) {
841
- delete newActiveMenus[level];
842
- } else {
843
- newActiveMenus[level] = menuId;
844
- }
845
- Object.keys(newActiveMenus).forEach((key) => {
846
- if (Number(key) > level) {
847
- delete newActiveMenus[Number(key)];
848
- }
849
- });
850
- return newActiveMenus;
851
- });
852
- };
853
- const openMenu = (menuId, level) => {
854
- if (closeTimeoutRef.current) {
855
- clearTimeout(closeTimeoutRef.current);
856
- closeTimeoutRef.current = null;
857
- }
858
- setActiveMenus((prev) => {
859
- const newActiveMenus = __spreadValues({}, prev);
860
- newActiveMenus[level] = menuId;
861
- Object.keys(newActiveMenus).forEach((key) => {
862
- if (Number(key) > level) {
863
- delete newActiveMenus[Number(key)];
864
- }
865
- });
866
- return newActiveMenus;
867
- });
868
- };
869
- const executePendingActions = (0, import_react8.useCallback)(() => {
870
- if (pendingCloseActionRef.current) {
871
- pendingCloseActionRef.current();
872
- pendingCloseActionRef.current = null;
873
- }
874
- if (pendingOpenActionRef.current) {
875
- pendingOpenActionRef.current();
876
- pendingOpenActionRef.current = null;
877
- }
878
- }, []);
879
- const openMenuWithDelay = (menuId, level, delay = 150) => {
880
- if (isMobile) {
881
- return;
882
- }
883
- pendingOpenActionRef.current = () => {
884
- if (hoverTimeoutRef.current) {
885
- clearTimeout(hoverTimeoutRef.current);
886
- }
887
- hoverTimeoutRef.current = setTimeout(() => {
888
- openMenu(menuId, level);
889
- }, delay);
890
- };
891
- if (!isMouseMovingRef.current) {
892
- executePendingActions();
893
- }
894
- };
895
- const closeMenuWithDelay = (level, delay = 500) => {
896
- if (isMobile) {
897
- return;
898
- }
899
- pendingCloseActionRef.current = () => {
900
- if (hoverTimeoutRef.current) {
901
- clearTimeout(hoverTimeoutRef.current);
902
- hoverTimeoutRef.current = null;
903
- }
904
- closeTimeoutRef.current = setTimeout(() => {
905
- closeSubMenuLevel(level);
906
- }, delay);
907
- };
908
- if (!isMouseMovingRef.current) {
909
- executePendingActions();
910
- }
911
- };
912
- const handleMouseMove = () => {
913
- isMouseMovingRef.current = true;
914
- if (mouseStopTimeoutRef.current) {
915
- clearTimeout(mouseStopTimeoutRef.current);
916
- }
917
- mouseStopTimeoutRef.current = setTimeout(() => {
918
- isMouseMovingRef.current = false;
919
- executePendingActions();
920
- }, 200);
921
- };
922
- const cancelCloseTimeout = () => {
923
- if (isMobile) {
924
- return;
925
- }
926
- if (mouseStopTimeoutRef.current) {
927
- clearTimeout(mouseStopTimeoutRef.current);
928
- mouseStopTimeoutRef.current = null;
929
- isMouseMovingRef.current = false;
930
- }
931
- };
932
- const closeSubMenuLevel = (level) => {
933
- setActiveMenus((prev) => {
934
- const newActiveMenus = __spreadValues({}, prev);
935
- delete newActiveMenus[level];
936
- Object.keys(newActiveMenus).forEach((key) => {
937
- if (Number(key) >= level) {
938
- delete newActiveMenus[Number(key)];
939
- }
940
- });
941
- if (isMobile) {
942
- const newSubMenuLevel = level - 1;
943
- setCurrentSubMenuLevel(newSubMenuLevel);
944
- const newActiveMenu = newActiveMenus[newSubMenuLevel];
945
- if (Object.keys(newActiveMenus).length > 0 && newActiveMenu) {
946
- setActiveMenu(newActiveMenu);
947
- }
948
- }
949
- return newActiveMenus;
950
- });
951
- };
952
- const registerSubMenu = (id, element) => {
953
- subMenuRefs.current[id] = element;
954
- };
955
- const isMenuActive = (menuId, level) => {
956
- return activeMenus[level] === menuId;
957
- };
958
- (0, import_react8.useEffect)(() => {
959
- const handleClickOutside = (event) => {
960
- var _a;
961
- if (Object.keys(activeMenus).length === 0) return;
962
- const target = event.target;
963
- if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
964
- const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
965
- const submenuEl = subMenuRefs.current[id];
966
- return submenuEl == null ? void 0 : submenuEl.contains(target);
967
- });
968
- if (!isInsideActiveSubmenu) {
969
- setActiveMenus({});
970
- }
971
- };
972
- document.addEventListener("mousedown", handleClickOutside);
973
- return () => {
974
- document.removeEventListener("mousedown", handleClickOutside);
975
- };
976
- }, [activeMenus]);
977
- (0, import_react8.useEffect)(() => {
978
- return () => {
979
- if (hoverTimeoutRef.current) {
980
- clearTimeout(hoverTimeoutRef.current);
981
- }
982
- if (closeTimeoutRef.current) {
983
- clearTimeout(closeTimeoutRef.current);
984
- }
985
- };
986
- }, []);
987
- const getAllFocusableMenuElements = () => {
988
- const elements = [];
989
- if (menuRootRef.current) {
990
- elements.push(
991
- ...Array.from(menuRootRef.current.children)
992
- );
993
- }
994
- Object.values(activeMenus).forEach((menuId) => {
995
- const submenuEl = subMenuRefs.current[menuId];
996
- if (submenuEl) {
997
- elements.push(...Array.from(submenuEl.children));
998
- }
999
- });
1000
- return elements;
1001
- };
1002
- const findCurrentMenuLevel = (element) => {
1003
- let current = element.parentElement;
1004
- while (current) {
1005
- const level = current.getAttribute("data-menu-level");
1006
- if (level !== null) {
1007
- return parseInt(level, 10);
1008
- }
1009
- current = current.parentElement;
1010
- }
1011
- return 0;
1012
- };
1013
- const getMenuElementsAtLevel = (level) => {
1014
- var _a;
1015
- if (level === 0 && menuRootRef.current) {
1016
- return Array.from(menuRootRef.current.children);
1017
- }
1018
- const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
1019
- const submenuEl = subMenuRefs.current[id];
1020
- return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
1021
- })) == null ? void 0 : _a[1];
1022
- if (menuId) {
1023
- const submenuEl = subMenuRefs.current[menuId];
1024
- if (submenuEl) {
1025
- return Array.from(submenuEl.children);
1026
- }
1027
- }
1028
- return [];
1029
- };
1030
- return {
1031
- menuRootRef,
1032
- activeMenus,
1033
- openMenu,
1034
- isMenuActive,
1035
- registerSubMenu,
1036
- closeSubMenuLevel,
1037
- getAllFocusableMenuElements,
1038
- findCurrentMenuLevel,
1039
- getMenuElementsAtLevel,
1040
- mobileHide: isMobile && Object.keys(activeMenus).length > 0,
1041
- listeners: {
1042
- onSubMenuHover: openMenuWithDelay,
1043
- onSubMenuLeave: closeMenuWithDelay,
1044
- onSubMenuEnter: cancelCloseTimeout,
1045
- onMouseMove: handleMouseMove,
1046
- toggleMenu,
1047
- mobilePositionTo,
1048
- activeMenu,
1049
- currentSubMenuLevel,
1050
- closeSubMenuLevel
1051
- }
1052
- };
1053
- }
1054
- function useMenuPosition(elementRef, position = "bottom", options) {
1055
- const [menuPosition, setMenuPosition] = (0, import_react8.useState)({
1056
- top: 0,
1057
- left: 0,
1058
- minWidth: 0
1059
- });
1060
- const isMobile = options == null ? void 0 : options.isMobile;
1061
- const updatePosition = (0, import_react8.useCallback)(() => {
1062
- var _a, _b, _c;
1063
- if (!(elementRef == null ? void 0 : elementRef.current)) return;
1064
- const triggerRect = elementRef.current.getBoundingClientRect();
1065
- const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
1066
- const viewportWidth = window.innerWidth;
1067
- const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
1068
- const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
1069
- let top = 0;
1070
- let left = 0;
1071
- if (position === "bottom" || position === "bottom-right") {
1072
- top = triggerRect.top + triggerRect.height + topOffset;
1073
- } else {
1074
- top = triggerRect.top;
1075
- }
1076
- if (position === "bottom") {
1077
- left = triggerRect.left + window.scrollX;
1078
- } else if (position === "bottom-right") {
1079
- left = triggerRect.right + window.scrollX - menuWidth;
1080
- } else if (position === "right") {
1081
- if (isMobile) {
1082
- left = triggerRect.left + window.scrollX;
1083
- } else {
1084
- left = triggerRect.right + window.scrollX;
1085
- }
1086
- }
1087
- const overflowsRightViewport = left + menuWidth > viewportWidth;
1088
- if (overflowsRightViewport) {
1089
- const newLeft = triggerRect.left - menuWidth;
1090
- const overflowsLeftViewport = newLeft < 0;
1091
- if (overflowsLeftViewport) {
1092
- left = (viewportWidth - menuWidth) / 2;
1093
- } else {
1094
- left = newLeft;
1095
- }
1096
- }
1097
- if (isMobile && position === "right") {
1098
- top = triggerRect.top + triggerRect.height + topOffset;
1099
- }
1100
- if (isMobile && menuWidth > viewportWidth) {
1101
- left = 0;
1102
- }
1103
- setMenuPosition({
1104
- top,
1105
- left,
1106
- minWidth: triggerRect.width
1107
- });
1108
- }, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset, isMobile]);
1109
- (0, import_react8.useEffect)(() => {
1110
- if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
1111
- const handleClickOutside = (event) => {
1112
- var _a, _b, _c, _d, _e;
1113
- const target = event.target;
1114
- if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
1115
- if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
1116
- if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
1117
- var _a2;
1118
- return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
1119
- }))
1120
- return;
1121
- (_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
1122
- };
1123
- document.addEventListener("mousedown", handleClickOutside);
1124
- return () => {
1125
- document.removeEventListener("mousedown", handleClickOutside);
1126
- };
1127
- }, [
1128
- options,
1129
- elementRef,
1130
- options == null ? void 0 : options.isOpen,
1131
- options == null ? void 0 : options.setIsOpen,
1132
- options == null ? void 0 : options.menuRef,
1133
- options == null ? void 0 : options.additionalRefs
1134
- ]);
1135
- (0, import_react8.useEffect)(() => {
1136
- updatePosition();
1137
- const resizeObserver = new ResizeObserver(updatePosition);
1138
- if (elementRef == null ? void 0 : elementRef.current) {
1139
- resizeObserver.observe(elementRef.current);
1140
- }
1141
- window.addEventListener("scroll", updatePosition);
1142
- const hideMenuWhenParentIsScrolled = () => {
1143
- var _a;
1144
- (_a = options == null ? void 0 : options.setIsOpen) == null ? void 0 : _a.call(options, false);
1145
- };
1146
- const scrollableAncestors = getScrollableAncestors(elementRef.current);
1147
- scrollableAncestors.forEach((ancestor) => ancestor.addEventListener("scroll", hideMenuWhenParentIsScrolled));
1148
- window.addEventListener("resize", updatePosition);
1149
- return () => {
1150
- resizeObserver.disconnect();
1151
- window.removeEventListener("scroll", updatePosition);
1152
- scrollableAncestors.forEach((ancestor) => ancestor.removeEventListener("scroll", hideMenuWhenParentIsScrolled));
1153
- window.removeEventListener("resize", updatePosition);
1154
- };
1155
- }, [elementRef, updatePosition]);
1156
- return { menuPosition, updatePosition };
1157
- }
1158
- function getScrollableAncestors(element) {
1159
- if (!element) {
1160
- return [];
1161
- }
1162
- const scrollables = [];
1163
- let parent = element.parentElement;
1164
- while (parent) {
1165
- const overflowY = window.getComputedStyle(parent).overflowY;
1166
- if (overflowY === "auto" || overflowY === "scroll") {
1167
- scrollables.push(parent);
1168
- }
1169
- parent = parent.parentElement;
1170
- }
1171
- return scrollables;
1172
- }
1173
-
1174
- // src/components/Menu.tsx
1175
- var import_jsx_runtime6 = require("react/jsx-runtime");
1176
- var Menu = (_a) => {
1177
- var _b = _a, {
1178
- id,
1179
- testid,
1180
- children,
1181
- className,
1182
- ref,
1183
- positionTo,
1184
- mobilePositionTo,
1185
- show,
1186
- setShow,
1187
- position = "bottom",
1188
- maxHeight: customMaxHeight,
1189
- topOffset,
1190
- mobileBackMenuOption,
1191
- mobileHide,
1192
- useDefaultMinWidth,
1193
- autoFocusOff,
1194
- menuName,
1195
- calculateMinMaxHeight
1196
- } = _b, props = __objRest(_b, [
1197
- "id",
1198
- "testid",
1199
- "children",
1200
- "className",
1201
- "ref",
1202
- "positionTo",
1203
- "mobilePositionTo",
1204
- "show",
1205
- "setShow",
1206
- "position",
1207
- "maxHeight",
1208
- "topOffset",
1209
- "mobileBackMenuOption",
1210
- "mobileHide",
1211
- "useDefaultMinWidth",
1212
- "autoFocusOff",
1213
- "menuName",
1214
- "calculateMinMaxHeight"
1215
- ]);
1216
- const internalRef = (0, import_react9.useRef)(null);
1217
- const actualRef = ref || internalRef;
1218
- const [maxHeight, setMaxHeight] = (0, import_react9.useState)("180px");
1219
- const isMobile = useMatchesMobile();
1220
- const { menuPosition, updatePosition } = useMenuPosition(
1221
- isMobile && mobilePositionTo ? mobilePositionTo : positionTo,
1222
- position,
1223
- {
1224
- isOpen: show,
1225
- setIsOpen: setShow,
1226
- menuRef: internalRef,
1227
- topOffset,
1228
- isMobile: !!(isMobile && mobilePositionTo)
1229
- }
1230
- );
1231
- (0, import_react9.useEffect)(() => {
1232
- if (calculateMinMaxHeight) {
1233
- return;
1234
- }
1235
- const raf = requestAnimationFrame(() => {
1236
- if (!actualRef.current || customMaxHeight) {
1237
- return;
1238
- }
1239
- if (actualRef.current.childElementCount > 4) {
1240
- let accumulatedHeight = 0;
1241
- Array.from(actualRef.current.children).forEach((child, index) => {
1242
- if (index >= 5) {
1243
- return;
1244
- }
1245
- accumulatedHeight += child.clientHeight;
1246
- });
1247
- accumulatedHeight = accumulatedHeight / 5 * 4.5;
1248
- setMaxHeight(`${accumulatedHeight}px`);
1249
- }
1250
- });
1251
- return () => {
1252
- cancelAnimationFrame(raf);
1253
- };
1254
- }, [actualRef.current, customMaxHeight, calculateMinMaxHeight]);
1255
- (0, import_react9.useEffect)(() => {
1256
- if (!calculateMinMaxHeight) {
1257
- return;
1258
- }
1259
- if ((positionTo == null ? void 0 : positionTo.current) && actualRef.current) {
1260
- const positionToRect = positionTo.current.getBoundingClientRect();
1261
- const offsetInPx = 16;
1262
- const calculatedMaxHeight = window.innerHeight - positionToRect.bottom - offsetInPx;
1263
- setMaxHeight(`${calculatedMaxHeight}px`);
1264
- }
1265
- }, [actualRef.current, positionTo == null ? void 0 : positionTo.current, calculateMinMaxHeight]);
1266
- (0, import_react9.useEffect)(() => {
1267
- if (!show) {
1268
- return;
1269
- }
1270
- initializeMenuFocus();
1271
- updatePosition();
1272
- }, [show, updatePosition]);
1273
- (0, import_react9.useEffect)(() => {
1274
- if (!show || !setShow) {
1275
- return;
1276
- }
1277
- const handleEscapeKey = (event) => {
1278
- var _a2;
1279
- if (event.key !== "Escape") {
1280
- return;
1281
- }
1282
- setShow(false);
1283
- (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.focus();
1284
- };
1285
- document.addEventListener("keydown", handleEscapeKey);
1286
- return () => {
1287
- document.removeEventListener("keydown", handleEscapeKey);
1288
- };
1289
- }, [show, setShow, positionTo]);
1290
- return show && (0, import_react_dom.createPortal)(
1291
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1292
- "div",
1293
- __spreadProps(__spreadValues({
1294
- id,
1295
- "data-testid": testid,
1296
- ref: setRefs,
1297
- className: (0, import_clsx7.default)(
1298
- "shadow-4 rounded-base bg-background-grouped-primary-normal overflow-x-hidden overflow-y-auto flex flex-col outline-0",
1299
- "fixed",
1300
- "z-50",
1301
- "max-w-screen",
1302
- mobileHide && "opacity-0 pointer-events-none",
1303
- className
1304
- )
1305
- }, props), {
1306
- style: __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props.style), {
1307
- maxHeight: customMaxHeight || maxHeight
1308
- }), menuPosition), {
1309
- minWidth: useDefaultMinWidth ? "212px" : menuPosition.minWidth
1310
- }),
1311
- onKeyDown: handleKeydown,
1312
- onMouseDown: stopPropagation,
1313
- onMouseUp: stopPropagation,
1314
- onTouchStart: stopPropagation,
1315
- onTouchEnd: stopPropagation,
1316
- tabIndex: -1,
1317
- "data-menu": menuName != null ? menuName : "",
1318
- children: [
1319
- mobileBackMenuOption == null ? void 0 : mobileBackMenuOption(),
1320
- children
1321
- ]
1322
- })
1323
- ),
1324
- findDocumentRoot(internalRef.current)
1325
- );
1326
- function handleKeydown(e) {
1327
- var _a2, _b2;
1328
- if (!internalRef.current) {
1329
- return;
1330
- }
1331
- if (e.key !== "Escape") {
1332
- e.stopPropagation();
1333
- }
1334
- const menuOptions = Array.from(
1335
- internalRef.current.querySelectorAll('[role="menuitem"]')
1336
- );
1337
- if (menuOptions.length === 0) {
1338
- return;
1339
- }
1340
- let currentIndex = -1;
1341
- const focusedElement = document.activeElement;
1342
- for (let i = 0; i < menuOptions.length; i++) {
1343
- if (menuOptions[i] === focusedElement) {
1344
- currentIndex = i;
1345
- break;
1346
- }
1347
- }
1348
- switch (e.key) {
1349
- case "ArrowDown": {
1350
- e.preventDefault();
1351
- const nextIndex = currentIndex < menuOptions.length - 1 ? currentIndex + 1 : 0;
1352
- menuOptions[nextIndex].focus();
1353
- break;
1354
- }
1355
- case "ArrowUp": {
1356
- e.preventDefault();
1357
- const prevIndex = currentIndex > 0 ? currentIndex - 1 : menuOptions.length - 1;
1358
- menuOptions[prevIndex].focus();
1359
- break;
1360
- }
1361
- case "Home":
1362
- e.preventDefault();
1363
- menuOptions[0].focus();
1364
- break;
1365
- case "End":
1366
- e.preventDefault();
1367
- menuOptions[menuOptions.length - 1].focus();
1368
- break;
1369
- case "Enter":
1370
- case " ":
1371
- case "ArrowRight":
1372
- e.preventDefault();
1373
- if (currentIndex >= 0) {
1374
- menuOptions[currentIndex].click();
1375
- }
1376
- break;
1377
- case "ArrowLeft":
1378
- e.preventDefault();
1379
- (_a2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _a2.click();
1380
- (_b2 = positionTo == null ? void 0 : positionTo.current) == null ? void 0 : _b2.focus();
1381
- break;
1382
- }
1383
- }
1384
- function initializeMenuFocus() {
1385
- var _a2, _b2, _c;
1386
- if (!autoFocusOff) {
1387
- (_a2 = internalRef.current) == null ? void 0 : _a2.focus();
1388
- }
1389
- const selectedOption = (_b2 = internalRef.current) == null ? void 0 : _b2.querySelector(
1390
- "[data-selected]"
1391
- );
1392
- const firstMenuItem = (_c = internalRef.current) == null ? void 0 : _c.querySelector(
1393
- '[role="menuitem"]'
1394
- );
1395
- const targetElement = selectedOption || firstMenuItem;
1396
- if (!targetElement) {
1397
- return;
1398
- }
1399
- targetElement.scrollIntoView({
1400
- block: "nearest",
1401
- behavior: "instant"
1402
- });
1403
- if (autoFocusOff) {
1404
- return;
1405
- }
1406
- requestAnimationFrame(() => {
1407
- targetElement.focus();
1408
- });
1409
- }
1410
- function setRefs(node) {
1411
- internalRef.current = node;
1412
- if (ref) {
1413
- if (typeof ref === "function") {
1414
- ref(node);
1415
- } else {
1416
- ref.current = node;
1417
- }
1418
- }
1419
- }
1420
- function stopPropagation(e) {
1421
- e.stopPropagation();
1422
- }
1423
- };
1424
- Menu.displayName = "Menu";
1425
-
1426
- // src/components/Search.tsx
1427
- var import_react11 = require("react");
1428
-
1429
- // src/components/Input.tsx
1430
- var import_react10 = require("react");
1431
- var import_clsx8 = __toESM(require("clsx"), 1);
1432
- var import_jsx_runtime7 = require("react/jsx-runtime");
1433
- function hasEquivalentNumericValue(currentValue, nextValue) {
1434
- if (!currentValue || !nextValue) {
1435
- return false;
1436
- }
1437
- const currentNumericValue = Number(currentValue.replace(/,/g, ""));
1438
- const nextNumericValue = Number(nextValue.replace(/,/g, ""));
1439
- return !Number.isNaN(currentNumericValue) && !Number.isNaN(nextNumericValue) && currentNumericValue === nextNumericValue;
1440
- }
1441
- var InputBase = (_a) => {
1442
- var _b = _a, {
1443
- id,
1444
- testid,
1445
- before,
1446
- after,
1447
- rightAdornment,
1448
- type,
1449
- label,
1450
- error,
1451
- className,
1452
- align = "left",
1453
- caption,
1454
- required,
1455
- selectOnFocus,
1456
- removeRoundness,
1457
- inputContainerRef,
1458
- removeBorder,
1459
- wrapperClassName,
1460
- focus,
1461
- secondaryIconColor,
1462
- fullWidth = true,
1463
- width,
1464
- wrapperRef,
1465
- autocompletePadding = false
1466
- } = _b, props = __objRest(_b, [
1467
- "id",
1468
- "testid",
1469
- "before",
1470
- "after",
1471
- "rightAdornment",
1472
- "type",
1473
- "label",
1474
- "error",
1475
- "className",
1476
- "align",
1477
- "caption",
1478
- "required",
1479
- "selectOnFocus",
1480
- "removeRoundness",
1481
- "inputContainerRef",
1482
- "removeBorder",
1483
- "wrapperClassName",
1484
- "focus",
1485
- "secondaryIconColor",
1486
- "fullWidth",
1487
- "width",
1488
- "wrapperRef",
1489
- "autocompletePadding"
1490
- ]);
1491
- const attributes = {
1492
- "data-error": error && !focus || null,
1493
- "data-focus": focus || null
1494
- };
1495
- const inputRef = (0, import_react10.useRef)(null);
1496
- const inputId = id ? `${id}-input` : void 0;
1497
- (0, import_react10.useEffect)(() => {
1498
- var _a2;
1499
- const input = inputRef.current;
1500
- const focusHandler = () => {
1501
- input == null ? void 0 : input.select();
1502
- };
1503
- if (selectOnFocus) {
1504
- (_a2 = inputRef.current) == null ? void 0 : _a2.addEventListener("focus", focusHandler);
1505
- return () => {
1506
- input == null ? void 0 : input.removeEventListener("focus", focusHandler);
1507
- };
1508
- }
1509
- }, [selectOnFocus]);
1510
- const inputBaseClass = (0, import_clsx8.default)(
1511
- fullWidth ? "w-full" : "w-fit",
1512
- "flex flex-row items-center",
1513
- "bg-background-action-secondary-normal caret-icon-on-action-secondary-normal",
1514
- componentGap,
1515
- baseTransition,
1516
- "outline-transparent outline-2 -outline-offset-2",
1517
- !autocompletePadding && componentPaddingMinusBorder,
1518
- autocompletePadding && componentPaddingMinusBorderDesktop,
1519
- !removeRoundness && "rounded-base",
1520
- !removeBorder && "border border-border-primary-normal",
1521
- "relative"
1522
- );
1523
- const inputFocusClass = (0, import_clsx8.default)(
1524
- "has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
1525
- );
1526
- const inputDisabledClass = (0, import_clsx8.default)(
1527
- "has-disabled:bg-background-action-secondary-disabled"
1528
- );
1529
- const inputReadOnlyClass = (0, import_clsx8.default)(
1530
- "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"
1531
- );
1532
- const inputInvalidClass = (0, import_clsx8.default)(
1533
- "has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
1534
- );
1535
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1536
- "label",
1537
- {
1538
- id,
1539
- "data-testid": testid,
1540
- htmlFor: inputId,
1541
- ref: inputContainerRef,
1542
- className: (0, import_clsx8.default)(
1543
- "w-full flex flex-col",
1544
- "block",
1545
- "text-text-primary-normal has-disabled:text-text-primary-disabled",
1546
- componentGap
1547
- ),
1548
- style: __spreadValues({}, props.style),
1549
- children: [
1550
- label && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: (0, import_clsx8.default)("flex items-center", componentGap), children: [
1551
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1552
- Label,
1553
- {
1554
- id: id ? `${id}-label` : void 0,
1555
- color: error ? "text-primary-error" : void 0,
1556
- className: (0, import_clsx8.default)(
1557
- props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
1558
- ),
1559
- children: label
1560
- }
1561
- ),
1562
- required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1563
- "span",
1564
- {
1565
- className: (0, import_clsx8.default)(typography.label, "text-text-critical-normal"),
1566
- children: "*"
1567
- }
1568
- )
1569
- ] }),
1570
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1571
- "div",
1572
- {
1573
- className: (0, import_clsx8.default)(
1574
- inputBaseClass,
1575
- !props.disabled && inputInvalidClass,
1576
- inputFocusClass,
1577
- inputDisabledClass,
1578
- inputReadOnlyClass,
1579
- wrapperClassName
1580
- ),
1581
- ref: (el) => {
1582
- if (wrapperRef) {
1583
- wrapperRef.current = el;
1584
- }
1585
- },
1586
- children: [
1587
- before,
1588
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1589
- "input",
1590
- __spreadProps(__spreadValues(__spreadValues({
1591
- ref: (el) => {
1592
- inputRef.current = el;
1593
- },
1594
- type,
1595
- required
1596
- }, props), attributes), {
1597
- id: inputId,
1598
- "data-testid": testid ? `${testid}-input` : void 0,
1599
- className: (0, import_clsx8.default)(
1600
- "flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
1601
- "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
1602
- "placeholder:text-text-secondary-normal disabled:text-text-secondary-disabled",
1603
- align === "right" && "text-right",
1604
- align === "center" && "text-center",
1605
- componentPaddingXUsingComponentGap,
1606
- typography.paragraph,
1607
- className,
1608
- props.readOnly && !props.disabled && "!px-0"
1609
- ),
1610
- style: __spreadProps(__spreadValues({}, props.style), { width })
1611
- })
1612
- ),
1613
- secondaryIconColor ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "contents text-text-secondary-normal", children: after }) : after,
1614
- rightAdornment
1615
- ]
1616
- }
1617
- ),
1618
- caption && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1619
- "div",
1620
- {
1621
- id: id ? `${id}-caption` : void 0,
1622
- "data-testid": testid ? `${testid}-caption` : void 0,
1623
- children: caption
1624
- }
1625
- )
1626
- ]
1627
- }
1628
- );
1629
- };
1630
- var Input = (_a) => {
1631
- var _b = _a, {
1632
- variant = "default",
1633
- decimals,
1634
- uom,
1635
- currencyFormat = false,
1636
- formatOnBlur = false,
1637
- removeSearchIcon,
1638
- value: propValue,
1639
- onChange,
1640
- onBlur,
1641
- onClear,
1642
- id,
1643
- testid,
1644
- rightAdornment
1645
- } = _b, props = __objRest(_b, [
1646
- "variant",
1647
- "decimals",
1648
- "uom",
1649
- "currencyFormat",
1650
- "formatOnBlur",
1651
- "removeSearchIcon",
1652
- "value",
1653
- "onChange",
1654
- "onBlur",
1655
- "onClear",
1656
- "id",
1657
- "testid",
1658
- "rightAdornment"
1659
- ]);
1660
- const [internalValue, setInternalValue] = (0, import_react10.useState)("");
1661
- const [displayValue, setDisplayValue] = (0, import_react10.useState)("");
1662
- const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
1663
- const internalValueRef = (0, import_react10.useRef)("");
1664
- const setInputValues = (nextInternalValue, nextDisplayValue) => {
1665
- internalValueRef.current = nextInternalValue;
1666
- setInternalValue(nextInternalValue);
1667
- setDisplayValue(nextDisplayValue);
1668
- };
1669
- (0, import_react10.useEffect)(() => {
1670
- var _a2;
1671
- const stringValue = (_a2 = propValue == null ? void 0 : propValue.toString()) != null ? _a2 : "";
1672
- const shouldUseThousandsFormatting = variant === "currency" || variant === "uom" && currencyFormat;
1673
- if (!stringValue) {
1674
- setInputValues("", "");
1675
- return;
1676
- }
1677
- if (!shouldUseThousandsFormatting) {
1678
- setInputValues(stringValue, stringValue);
1679
- return;
1680
- }
1681
- if (isFocused && hasEquivalentNumericValue(internalValueRef.current, stringValue)) {
1682
- return;
1683
- }
1684
- if (formatOnBlur && isFocused) {
1685
- setInputValues(stringValue, stringValue);
1686
- return;
1687
- }
1688
- const formatted = formatDecimalValue(stringValue, decimals != null ? decimals : 2);
1689
- setInputValues(formatted, formatCurrencyDisplay(formatted));
1690
- }, [propValue, variant, currencyFormat, decimals, formatOnBlur, isFocused]);
1691
- const getInputProps = () => {
1692
- var _a2;
1693
- const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
1694
- id
1695
- }), getDecimalPlaceholder(decimals)), {
1696
- value: propValue
1697
- });
1698
- switch (variant) {
1699
- case "search":
1700
- return __spreadProps(__spreadValues({}, baseProps), {
1701
- placeholder: (_a2 = props.placeholder) != null ? _a2 : "Search",
1702
- className: "!mr-6",
1703
- value: displayValue
1704
- });
1705
- case "finder":
1706
- return baseProps;
1707
- case "currency":
1708
- return __spreadProps(__spreadValues({}, baseProps), {
1709
- align: "right",
1710
- type: "text",
1711
- inputMode: "decimal",
1712
- value: displayValue
1713
- });
1714
- case "percentage":
1715
- case "uom":
1716
- return __spreadProps(__spreadValues({}, baseProps), {
1717
- type: currencyFormat ? "text" : "number",
1718
- align: "right",
1719
- inputMode: currencyFormat ? "decimal" : void 0,
1720
- value: currencyFormat ? displayValue : propValue
1721
- });
1722
- default:
1723
- return baseProps;
1724
- }
1725
- };
1726
- const getBeforeElement = () => {
1727
- if (props.before) return props.before;
1728
- switch (variant) {
1729
- case "search":
1730
- return !removeSearchIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" }) }) : null;
1731
- case "currency":
1732
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) });
1733
- case "uom":
1734
- return currencyFormat ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "attach_money" }) }) : null;
1735
- default:
1736
- return null;
1737
- }
1738
- };
1739
- const getAfterElement = () => {
1740
- if (props.after) return props.after;
1741
- switch (variant) {
1742
- case "search": {
1743
- const hasValue = displayValue.length > 0;
1744
- return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1745
- Icon,
1746
- {
1747
- id: id ? `${id}-clear-button` : void 0,
1748
- testid: testid ? `${testid}-clear-button` : void 0,
1749
- name: "close",
1750
- onClick: handleSearchReset,
1751
- className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
1752
- }
1753
- ) : null;
1754
- }
1755
- case "finder":
1756
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "search" });
1757
- case "uom":
1758
- return uom ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Paragraph, { color: "text-secondary-normal", children: uom.toUpperCase() }) : null;
1759
- case "percentage":
1760
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { name: "percent" }) });
1761
- default:
1762
- return null;
1763
- }
1764
- };
1765
- const handleSearchReset = () => {
1766
- setInputValues("", "");
1767
- if (onChange) {
1768
- const syntheticEvent = {
1769
- target: { value: "" }
1770
- };
1771
- if (typeof onChange === "function") {
1772
- onChange(syntheticEvent);
1773
- }
1774
- }
1775
- onClear == null ? void 0 : onClear();
1776
- };
1777
- const handleChange = (e) => {
1778
- const rawValue = e.target.value;
1779
- const maxNumber = props.max != null ? Number(String(props.max).replace(/,/g, "")) : void 0;
1780
- if (variant === "currency") {
1781
- const raw = rawValue.replace(/,/g, "");
1782
- if (raw === "") {
1783
- setInputValues("", "");
1784
- if (onChange) {
1785
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1786
- target: __spreadProps(__spreadValues({}, e.target), { value: "" })
1787
- });
1788
- onChange(syntheticEvent);
1789
- }
1790
- return;
1791
- }
1792
- const regex = /^\d*\.?\d*$/;
1793
- if (!regex.test(raw)) return;
1794
- const parts = raw.split(".");
1795
- const currentDecimals = decimals != null ? decimals : 2;
1796
- if (parts.length === 2 && parts[1].length > currentDecimals) return;
1797
- const asNumber = Number(raw);
1798
- if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
1799
- const clamped = maxNumber;
1800
- const formattedClamped = formatDecimalValue(
1801
- clamped.toString(),
1802
- currentDecimals
1803
- );
1804
- setInputValues(
1805
- formattedClamped,
1806
- formatOnBlur ? formattedClamped : formatCurrencyDisplay(formattedClamped)
1807
- );
1808
- if (onChange) {
1809
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1810
- target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
1811
- });
1812
- onChange(syntheticEvent);
1813
- }
1814
- return;
1815
- }
1816
- setInputValues(raw, formatOnBlur ? raw : formatCurrencyDisplay(raw));
1817
- if (!isNaN(asNumber) && onChange) {
1818
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1819
- target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1820
- });
1821
- onChange(syntheticEvent);
1822
- }
1823
- return;
1824
- }
1825
- if (variant === "uom" && currencyFormat) {
1826
- const raw = rawValue.replace(/,/g, "");
1827
- if (raw === "") {
1828
- setInputValues("", "");
1829
- if (onChange) {
1830
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1831
- target: __spreadProps(__spreadValues({}, e.target), { value: "" })
1832
- });
1833
- onChange(syntheticEvent);
1834
- }
1835
- return;
1836
- }
1837
- const regex = /^\d*\.?\d*$/;
1838
- if (!regex.test(raw)) return;
1839
- const parts = raw.split(".");
1840
- const currentDecimals = decimals != null ? decimals : 2;
1841
- if (parts.length === 2 && parts[1].length > currentDecimals) return;
1842
- const asNumber = Number(raw);
1843
- if (!isNaN(asNumber) && maxNumber != null && asNumber > maxNumber) {
1844
- const clamped = maxNumber;
1845
- const formattedClamped = formatDecimalValue(
1846
- clamped.toString(),
1847
- currentDecimals
1848
- );
1849
- setInputValues(
1850
- formattedClamped,
1851
- formatCurrencyDisplay(formattedClamped)
1852
- );
1853
- if (onChange) {
1854
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1855
- target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
1856
- });
1857
- onChange(syntheticEvent);
1858
- }
1859
- return;
1860
- }
1861
- setInputValues(raw, formatCurrencyDisplay(raw));
1862
- if (!isNaN(asNumber) && onChange) {
1863
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1864
- target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1865
- });
1866
- onChange(syntheticEvent);
1867
- }
1868
- return;
1869
- }
1870
- if (variant === "uom" && e.target.type === "number") {
1871
- const numeric = Number(rawValue);
1872
- if (!isNaN(numeric) && maxNumber != null && numeric > maxNumber) {
1873
- const clamped = maxNumber;
1874
- const formattedClamped = formatDecimalValue(
1875
- clamped.toString(),
1876
- decimals != null ? decimals : 0
1877
- );
1878
- setInputValues(formattedClamped, formattedClamped);
1879
- if (typeof onChange === "function") {
1880
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1881
- target: __spreadProps(__spreadValues({}, e.target), { value: clamped.toString() })
1882
- });
1883
- onChange(syntheticEvent);
1884
- }
1885
- return;
1886
- }
1887
- setInputValues(rawValue, rawValue);
1888
- if (typeof onChange === "function") {
1889
- onChange(e);
1890
- }
1891
- return;
1892
- }
1893
- setInputValues(rawValue, rawValue);
1894
- if (typeof onChange === "function") {
1895
- onChange(e);
1896
- }
1897
- };
1898
- const handleBlur = (e) => {
1899
- setIsFocused(false);
1900
- if (!internalValue) {
1901
- onBlur == null ? void 0 : onBlur(e);
1902
- return;
1903
- }
1904
- if (variant === "currency") {
1905
- const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
1906
- setInputValues(formatted, formatCurrencyDisplay(formatted));
1907
- const asNumber = Number(formatted);
1908
- if (!isNaN(asNumber) && onChange) {
1909
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1910
- target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1911
- });
1912
- onChange(syntheticEvent);
1913
- }
1914
- } else if (variant === "uom") {
1915
- if (currencyFormat) {
1916
- const formatted = formatDecimalValue(internalValue, decimals != null ? decimals : 2);
1917
- setInputValues(formatted, formatCurrencyDisplay(formatted));
1918
- const asNumber = Number(formatted);
1919
- if (!isNaN(asNumber) && onChange) {
1920
- const syntheticEvent = __spreadProps(__spreadValues({}, e), {
1921
- target: __spreadProps(__spreadValues({}, e.target), { value: asNumber.toString() })
1922
- });
1923
- onChange(syntheticEvent);
1924
- }
1925
- } else {
1926
- const formattedValue = formatDecimalValue(e.target.value, decimals);
1927
- e.target.value = formattedValue;
1928
- }
1929
- }
1930
- onBlur == null ? void 0 : onBlur(e);
1931
- };
1932
- const handleFocus = (e) => {
1933
- var _a2;
1934
- setIsFocused(true);
1935
- (_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
1936
- };
1937
- const inputProps = getInputProps();
1938
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1939
- InputBase,
1940
- __spreadProps(__spreadValues({}, inputProps), {
1941
- before: getBeforeElement(),
1942
- after: getAfterElement(),
1943
- onFocus: handleFocus,
1944
- onChange: handleChange,
1945
- onBlur: handleBlur,
1946
- testid,
1947
- rightAdornment
1948
- })
1949
- );
1950
- };
1951
- Input.displayName = "Input";
1952
- var Finder = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "finder" }));
1953
- var UOM = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "uom" }));
1954
- var Currency = (props) => {
1955
- var _a;
1956
- const handleCurrencyChange = (e) => {
1957
- var _a2;
1958
- (_a2 = props.onChange) == null ? void 0 : _a2.call(props, e);
1959
- };
1960
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1961
- Input,
1962
- __spreadProps(__spreadValues({}, props), {
1963
- variant: "currency",
1964
- decimals: (_a = props.decimals) != null ? _a : 2,
1965
- onChange: handleCurrencyChange
1966
- })
1967
- );
1968
- };
1969
- var Percentage = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Input, __spreadProps(__spreadValues({}, props), { variant: "percentage" }));
1970
- Finder.displayName = "Finder";
1971
- UOM.displayName = "UOM";
1972
- Currency.displayName = "Currency";
1973
- Percentage.displayName = "Percentage";
1974
-
1975
- // src/components/Search.tsx
1976
- var import_jsx_runtime8 = require("react/jsx-runtime");
1977
- var Search = (_a) => {
1978
- var _b = _a, {
1979
- id,
1980
- testid,
1981
- label,
1982
- error,
1983
- children,
1984
- readOnly,
1985
- renderMenu,
1986
- onClick,
1987
- wrapperClassName,
1988
- removeRoundness,
1989
- autocompletePadding = false
1990
- } = _b, props = __objRest(_b, [
1991
- "id",
1992
- "testid",
1993
- "label",
1994
- "error",
1995
- "children",
1996
- "readOnly",
1997
- "renderMenu",
1998
- "onClick",
1999
- "wrapperClassName",
2000
- "removeRoundness",
2001
- "autocompletePadding"
2002
- ]);
2003
- const inputRef = (0, import_react11.useRef)(null);
2004
- const inputContainerRef = (0, import_react11.useRef)(null);
2005
- const preventFocusOnInitialRender = (0, import_react11.useRef)(true);
2006
- const [show, setShow] = (0, import_react11.useState)(false);
2007
- const [clearing, setClearing] = (0, import_react11.useState)(false);
2008
- const uniqueId = (0, import_react11.useId)();
2009
- const searchMenuName = `search-menu-${uniqueId}`;
2010
- (0, import_react11.useEffect)(() => {
2011
- var _a2;
2012
- if (preventFocusOnInitialRender.current) {
2013
- preventFocusOnInitialRender.current = false;
2014
- return;
2015
- }
2016
- (_a2 = inputRef.current) == null ? void 0 : _a2.focus();
2017
- }, [props.value]);
2018
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2019
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2020
- Input,
2021
- __spreadValues({
2022
- id,
2023
- testid,
2024
- variant: "search",
2025
- inputContainerRef,
2026
- ref: inputRef,
2027
- label,
2028
- wrapperClassName,
2029
- autocompletePadding,
2030
- onClick: (e) => {
2031
- if (props.disabled || readOnly) {
2032
- return;
2033
- }
2034
- if (clearing) {
2035
- setClearing(false);
2036
- return;
2037
- }
2038
- onClick == null ? void 0 : onClick(e);
2039
- setShow(!show);
2040
- },
2041
- onClear: () => {
2042
- setClearing(true);
2043
- },
2044
- onKeyDown: (e) => {
2045
- setShow(true);
2046
- if (["ArrowUp", "ArrowDown"].includes(e.key)) {
2047
- e.preventDefault();
2048
- const menu = document.querySelector(
2049
- `[data-menu="${searchMenuName}"]`
2050
- );
2051
- const selectedMenuOption = menu == null ? void 0 : menu.querySelector("[data-selected]");
2052
- if (selectedMenuOption) {
2053
- const allMenuOptions = Array.from(
2054
- (menu == null ? void 0 : menu.querySelectorAll('[role="menuitem"]')) || []
2055
- );
2056
- const currentIndex = allMenuOptions.indexOf(selectedMenuOption);
2057
- let targetOption;
2058
- if (e.key === "ArrowDown") {
2059
- targetOption = allMenuOptions[currentIndex + 1] || allMenuOptions[0];
2060
- } else {
2061
- targetOption = allMenuOptions[currentIndex - 1] || allMenuOptions[allMenuOptions.length - 1];
2062
- }
2063
- targetOption == null ? void 0 : targetOption.focus();
2064
- } else {
2065
- const toFocusMenuOption = e.key === "ArrowDown" ? menu == null ? void 0 : menu.querySelector('[role="menuitem"]') : menu == null ? void 0 : menu.querySelector(
2066
- '[role="menuitem"]:last-child'
2067
- );
2068
- toFocusMenuOption == null ? void 0 : toFocusMenuOption.focus();
2069
- }
2070
- }
2071
- },
2072
- error,
2073
- readOnly,
2074
- removeRoundness,
2075
- focus: renderMenu && show
2076
- }, props)
2077
- ),
2078
- renderMenu ? renderMenu({
2079
- id: id ? `${id}-menu` : void 0,
2080
- testid: testid ? `${testid}-menu` : void 0,
2081
- positionTo: inputContainerRef,
2082
- show,
2083
- setShow,
2084
- topOffset: props.caption ? -16 : null,
2085
- autoFocusOff: true,
2086
- menuName: searchMenuName
2087
- }) : children
2088
- ] });
2089
- };
2090
- Search.displayName = "Search";
2091
-
2092
- // src/components/DataGridCell.tsx
2093
- var import_jsx_runtime9 = require("react/jsx-runtime");
2094
- var DataGridCell = (0, import_react12.memo)(
2095
- (_a) => {
2096
- var _b = _a, {
2097
- id,
2098
- type = "default",
2099
- component = "static",
2100
- children,
2101
- className,
2102
- locked = false,
2103
- noPadding = false,
2104
- paddedLeft = false,
2105
- style,
2106
- onClick,
2107
- onRightClick,
2108
- error,
2109
- warning,
2110
- center,
2111
- width,
2112
- minWidth,
2113
- disabled,
2114
- testid
2115
- } = _b, props = __objRest(_b, [
2116
- "id",
2117
- "type",
2118
- "component",
2119
- "children",
2120
- "className",
2121
- "locked",
2122
- "noPadding",
2123
- "paddedLeft",
2124
- "style",
2125
- "onClick",
2126
- "onRightClick",
2127
- "error",
2128
- "warning",
2129
- "center",
2130
- "width",
2131
- "minWidth",
2132
- "disabled",
2133
- "testid"
2134
- ]);
2135
- const Element = type === "header" ? "th" : "td";
2136
- const timerRef = (0, import_react12.useRef)(null);
2137
- const [isGrabbing, setIsGrabbing] = (0, import_react12.useState)(false);
2138
- const [isPointerPressed, setIsPointerPressed] = (0, import_react12.useState)(false);
2139
- (0, import_react12.useEffect)(() => {
2140
- return () => {
2141
- if (timerRef.current) {
2142
- clearTimeout(timerRef.current);
2143
- timerRef.current = null;
2144
- }
2145
- };
2146
- }, []);
2147
- const handlePointerDown = (_event) => {
2148
- setIsPointerPressed(true);
2149
- timerRef.current = window.setTimeout(() => {
2150
- setIsGrabbing(true);
2151
- }, 500);
2152
- };
2153
- const handlePointerUp = (event) => {
2154
- if (timerRef.current) {
2155
- clearTimeout(timerRef.current);
2156
- timerRef.current = null;
2157
- }
2158
- const rightClick = event.nativeEvent instanceof MouseEvent && event.nativeEvent.button === 2;
2159
- if (!isGrabbing && onClick && !rightClick && isPointerPressed) {
2160
- onClick(event);
2161
- }
2162
- if (rightClick && onRightClick) {
2163
- onRightClick();
2164
- }
2165
- setIsGrabbing(false);
2166
- setIsPointerPressed(false);
2167
- };
2168
- const handlePointerLeave = () => {
2169
- if (timerRef.current) {
2170
- clearTimeout(timerRef.current);
2171
- timerRef.current = null;
2172
- }
2173
- };
2174
- const headerBgStyles = type === "header" && !locked && !["button"].includes(component) && "bg-brand-400 border-brand-200";
2175
- const lockedHeaderBgStyles = locked && !["button"].includes(component) && "bg-neutral-400 border-neutral-300";
2176
- const headerTypeStyles = type === "header" && component !== "button" && component !== "icon" && (0, import_clsx9.default)("border-r");
2177
- const buttonComponentStyles = component === "button" && (0, import_clsx9.default)("border-r border-b border-border-primary-normal");
2178
- const iconComponentStyles = component === "icon" && (0, import_clsx9.default)("border-l");
2179
- const cellClasses = (0, import_clsx9.default)(
2180
- headerTypeStyles,
2181
- buttonComponentStyles,
2182
- headerBgStyles,
2183
- lockedHeaderBgStyles,
2184
- iconComponentStyles,
2185
- className,
2186
- "flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
2187
- "focus-within:!z-10",
2188
- "overflow-x-hidden",
2189
- "overflow-y-hidden",
2190
- component === "input" && "border",
2191
- component === "input" && !error && !warning && "border-border-primary-normal",
2192
- component === "input" && error && "border-border-primary-error",
2193
- component === "input" && warning && "border-background-warning-normal",
2194
- !["button", "icon"].includes(component) && !noPadding && componentPadding,
2195
- paddedLeft && "pl-2",
2196
- component === "icon" && "border-l",
2197
- isGrabbing && "!cursor-grabbing",
2198
- component === "checkbox" || center && "justify-center",
2199
- disabled && "!text-text-primary-disabled"
2200
- );
2201
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2202
- Element,
2203
- __spreadProps(__spreadValues({
2204
- id,
2205
- "data-testid": testid,
2206
- className: (0, import_clsx9.default)("flex h-10", !width && "flex-1"),
2207
- style: { width, minWidth }
2208
- }, props), {
2209
- "data-theme": type === "header" && !locked ? "brand" : void 0,
2210
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2211
- "div",
2212
- {
2213
- className: cellClasses,
2214
- style: __spreadValues({}, style),
2215
- onMouseDown: handlePointerDown,
2216
- onMouseUp: handlePointerUp,
2217
- onMouseLeave: handlePointerLeave,
2218
- onTouchStart: handlePointerDown,
2219
- onTouchEnd: handlePointerUp,
2220
- onTouchCancel: handlePointerLeave,
2221
- onContextMenu: (e) => e.preventDefault(),
2222
- children
2223
- }
2224
- )
2225
- })
2226
- );
2227
- }
2228
- );
2229
- DataGridCell.displayName = "DataGridCell";
2230
- function DataCellHeader(_a) {
2231
- var _b = _a, {
2232
- header,
2233
- children,
2234
- setNodeRef,
2235
- node,
2236
- id,
2237
- testid,
2238
- useMenuDefaultMinWidth
2239
- } = _b, props = __objRest(_b, [
2240
- "header",
2241
- "children",
2242
- "setNodeRef",
2243
- "node",
2244
- "id",
2245
- "testid",
2246
- "useMenuDefaultMinWidth"
2247
- ]);
2248
- var _a2;
2249
- const [showMenu, setShowMenu] = (0, import_react12.useState)(false);
2250
- const [filter, setFilter] = (0, import_react12.useState)(
2251
- (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
2252
- );
2253
- const ref = (0, import_react12.useRef)(null);
2254
- const predeterminedPinned = (0, import_react12.useRef)(false);
2255
- const { column, getContext } = header;
2256
- const { id: columnId, setFilterValue } = column;
2257
- const {
2258
- menuRootRef,
2259
- isMenuActive,
2260
- registerSubMenu,
2261
- listeners: subMenuListeners,
2262
- mobileHide
2263
- } = useSubMenuSystem(node ? node : ref);
2264
- (0, import_react12.useEffect)(() => {
2265
- var _a3, _b2, _c;
2266
- const columnPinning = (_a3 = getContext().table.options.initialState) == null ? void 0 : _a3.columnPinning;
2267
- const left = (_b2 = columnPinning == null ? void 0 : columnPinning.left) != null ? _b2 : [];
2268
- const right = (_c = columnPinning == null ? void 0 : columnPinning.right) != null ? _c : [];
2269
- predeterminedPinned.current = [...left, ...right].includes(columnId);
2270
- }, [columnId, getContext]);
2271
- (0, import_react12.useEffect)(() => {
2272
- const handler = setTimeout(() => {
2273
- setFilterValue(filter);
2274
- }, 500);
2275
- return () => {
2276
- clearTimeout(handler);
2277
- };
2278
- }, [filter, setFilterValue]);
2279
- const style = __spreadValues({
2280
- position: "relative",
2281
- whiteSpace: "nowrap",
2282
- minWidth: header.column.getSize(),
2283
- "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
2284
- "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
2285
- "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
2286
- }, props.style);
2287
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2288
- DataGridCell,
2289
- __spreadProps(__spreadValues({
2290
- id,
2291
- testid,
2292
- ref: setNodeRef ? setNodeRef : ref,
2293
- type: "header",
2294
- component: "header",
2295
- style,
2296
- minWidth: `${header.column.getSize()}px`,
2297
- onClick: header.column.getToggleSortingHandler(),
2298
- onRightClick: () => setShowMenu(!showMenu)
2299
- }, props), {
2300
- children: [
2301
- children,
2302
- header.column.getCanFilter() && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2303
- Menu,
2304
- {
2305
- id: id ? `${id}-menu` : void 0,
2306
- testid: testid ? `${testid}-menu` : void 0,
2307
- ref: menuRootRef,
2308
- positionTo: node ? node : ref,
2309
- show: showMenu,
2310
- setShow: setShowMenu,
2311
- mobileHide,
2312
- useDefaultMinWidth: useMenuDefaultMinWidth,
2313
- children: [
2314
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2315
- MenuOption,
2316
- __spreadProps(__spreadValues({
2317
- id: id ? `${id}-filter-option` : void 0,
2318
- testid: testid ? `${testid}-filter-option` : void 0
2319
- }, subMenuListeners), {
2320
- subMenu: (_b2) => {
2321
- var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
2322
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2323
- Menu,
2324
- __spreadProps(__spreadValues({
2325
- id: id ? `${id}-filter-submenu` : void 0,
2326
- testid: testid ? `${testid}-filter-submenu` : void 0
2327
- }, props2), {
2328
- show: isMenuActive(menuId, subMenuLevel),
2329
- ref: (el) => {
2330
- registerSubMenu(menuId, el);
2331
- },
2332
- useDefaultMinWidth: useMenuDefaultMinWidth,
2333
- children: [
2334
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_clsx9.default)(paddingUsingComponentGap), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2335
- Search,
2336
- {
2337
- id: id ? `${id}-filter-search` : void 0,
2338
- testid: testid ? `${testid}-filter-search` : void 0,
2339
- onChange: (event) => {
2340
- setFilter(event.target.value);
2341
- },
2342
- onKeyDown: (event) => {
2343
- if ([" ", "Space"].includes(event.key)) {
2344
- event.stopPropagation();
2345
- }
2346
- },
2347
- value: filter != null ? filter : ""
2348
- }
2349
- ) }),
2350
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2351
- MenuOption,
2352
- {
2353
- id: id ? `${id}-filter-contains` : void 0,
2354
- testid: testid ? `${testid}-filter-contains` : void 0,
2355
- onClick: handleFilterFnChange,
2356
- before: menuOptionIcon("includesString"),
2357
- children: "Contains"
2358
- }
2359
- ),
2360
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2361
- MenuOption,
2362
- {
2363
- id: id ? `${id}-filter-startswith` : void 0,
2364
- testid: testid ? `${testid}-filter-startswith` : void 0,
2365
- onClick: handleFilterFnChange,
2366
- before: menuOptionIcon("startsWith"),
2367
- children: "Starts with"
2368
- }
2369
- ),
2370
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2371
- MenuOption,
2372
- {
2373
- id: id ? `${id}-filter-endswith` : void 0,
2374
- testid: testid ? `${testid}-filter-endswith` : void 0,
2375
- onClick: handleFilterFnChange,
2376
- before: menuOptionIcon("endsWith"),
2377
- children: "Ends with"
2378
- }
2379
- )
2380
- ]
2381
- })
2382
- );
2383
- },
2384
- children: "Filter"
2385
- })
2386
- ),
2387
- !predeterminedPinned.current && header.column.getCanPin() && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2388
- MenuOption,
2389
- __spreadProps(__spreadValues({
2390
- onClick: () => {
2391
- setShowMenu(!showMenu);
2392
- }
2393
- }, subMenuListeners), {
2394
- subMenu: (_d) => {
2395
- var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
2396
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2397
- Menu,
2398
- __spreadProps(__spreadValues({}, props2), {
2399
- show: isMenuActive(menuId, subMenuLevel),
2400
- ref: (el) => {
2401
- registerSubMenu(menuId, el);
2402
- },
2403
- children: [
2404
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2405
- MenuOption,
2406
- {
2407
- selected: header.column.getIsPinned() === "left",
2408
- onClick: () => {
2409
- if (header.column.getIsPinned() === "left") {
2410
- header.column.pin(false);
2411
- } else {
2412
- header.column.pin("left");
2413
- }
2414
- },
2415
- after: header.column.getIsPinned() === "left" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "check" }),
2416
- children: "Left"
2417
- }
2418
- ),
2419
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2420
- MenuOption,
2421
- {
2422
- selected: header.column.getIsPinned() === "right",
2423
- onClick: () => {
2424
- if (header.column.getIsPinned() === "right") {
2425
- header.column.pin(false);
2426
- } else {
2427
- header.column.pin("right");
2428
- }
2429
- },
2430
- after: header.column.getIsPinned() === "right" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { name: "check" }),
2431
- children: "Right"
2432
- }
2433
- )
2434
- ]
2435
- })
2436
- );
2437
- },
2438
- children: `Freeze [${header.column.columnDef.header}]`
2439
- })
2440
- )
2441
- ]
2442
- }
2443
- )
2444
- ]
2445
- })
2446
- );
2447
- function menuOptionIcon(value) {
2448
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2449
- Icon,
2450
- {
2451
- name: "check",
2452
- className: (0, import_clsx9.default)(
2453
- header.column.columnDef.filterFn !== value && "text-transparent"
2454
- )
2455
- }
2456
- );
2457
- }
2458
- function handleFilterFnChange(_id, value) {
2459
- let filterFn = "includesString";
2460
- const currentFilterFn = header.column.columnDef.filterFn;
2461
- if ((value == null ? void 0 : value.toLowerCase()) === "starts with") {
2462
- filterFn = currentFilterFn === "startsWith" ? "auto" : "startsWith";
2463
- }
2464
- if ((value == null ? void 0 : value.toLowerCase()) === "ends with") {
2465
- filterFn = currentFilterFn === "endsWith" ? "auto" : "endsWith";
2466
- }
2467
- if ((value == null ? void 0 : value.toLowerCase()) === "contains") {
2468
- filterFn = currentFilterFn === "includesString" ? "auto" : "includesString";
2469
- }
2470
- header.column.columnDef.filterFn = filterFn;
2471
- header.column.setFilterValue(filter);
2472
- }
2473
- }
2474
- DataCellHeader.displayName = "DataCellHeader";
2475
- function DraggableCellHeader(_a) {
2476
- var _b = _a, {
2477
- header,
2478
- children
2479
- } = _b, props = __objRest(_b, [
2480
- "header",
2481
- "children"
2482
- ]);
2483
- const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
2484
- id: header.column.id
2485
- });
2486
- const style = {
2487
- opacity: isDragging ? 0.8 : 1,
2488
- position: "relative",
2489
- transform: CSS.Translate.toString(transform),
2490
- transition: "width transform 0.2s ease-in-out",
2491
- whiteSpace: "nowrap",
2492
- zIndex: isDragging ? 1 : 0,
2493
- "--color-text-primary-normal": "var(--color-action-000)",
2494
- "--color-icon-on-action-primary-normal": "var(--color-action-000)",
2495
- userSelect: "none"
2496
- };
2497
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2498
- DataCellHeader,
2499
- __spreadProps(__spreadValues(__spreadValues(__spreadValues({
2500
- header,
2501
- setNodeRef,
2502
- node,
2503
- style
2504
- }, props), attributes), listeners), {
2505
- children
2506
- })
2507
- );
2508
- }
2509
- DraggableCellHeader.displayName = "DraggableCellHeader";
2510
- function DragAlongCell(_a) {
2511
- var _b = _a, {
2512
- cell,
2513
- children
2514
- } = _b, props = __objRest(_b, [
2515
- "cell",
2516
- "children"
2517
- ]);
2518
- const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
2519
- id: cell.column.id
2520
- });
2521
- const style = {
2522
- opacity: isDragging ? 0.8 : 1,
2523
- position: "relative",
2524
- transform: CSS.Translate.toString(transform),
2525
- transition: "width transform 0.2s ease-in-out",
2526
- minWidth: cell.column.getSize(),
2527
- zIndex: isDragging ? 1 : 0
2528
- };
2529
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
2530
- }
2531
- DragAlongCell.displayName = "DragAlongCell";
2532
- // Annotate the CommonJS export names for ESM import in node:
2533
- 0 && (module.exports = {
2534
- DataCellHeader,
2535
- DataGridCell,
2536
- DragAlongCell,
2537
- DraggableCellHeader
2538
- });