@dmsi/wedgekit-react 1.0.1 → 2.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 (282) hide show
  1. package/dist/classNames.d.ts +1 -0
  2. package/dist/classNames.d.ts.map +1 -1
  3. package/dist/classNames.js +150 -0
  4. package/dist/components/AccessCard.js +63 -0
  5. package/dist/components/AccessCardGroup.js +73 -0
  6. package/dist/components/AccessChangerTabItem.js +51 -0
  7. package/dist/components/Accordion.js +99 -0
  8. package/dist/components/Alert.d.ts.map +1 -1
  9. package/dist/components/Alert.js +78 -0
  10. package/dist/components/Breadcrumbs.js +111 -0
  11. package/dist/components/Button.js +137 -0
  12. package/dist/components/CalendarRange.js +405 -0
  13. package/dist/components/Caption.js +99 -0
  14. package/dist/components/Card.js +50 -0
  15. package/dist/components/Checkbox.js +108 -0
  16. package/dist/components/CompactImagesPreview.d.ts.map +1 -1
  17. package/dist/components/CompactImagesPreview.js +120 -0
  18. package/dist/components/ContentTab.js +68 -0
  19. package/dist/components/ContentTabs.js +96 -0
  20. package/dist/components/DMSiLogo.js +54 -0
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
  22. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
  23. package/dist/components/DataGrid/PinnedColumns.d.ts +9 -2
  24. package/dist/components/DataGrid/PinnedColumns.d.ts.map +1 -1
  25. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  26. package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts +18 -0
  27. package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts.map +1 -0
  28. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  29. package/dist/components/DataGrid/SummaryRow/aggregations.d.ts +39 -0
  30. package/dist/components/DataGrid/SummaryRow/aggregations.d.ts.map +1 -0
  31. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  32. package/dist/components/DataGrid/SummaryRow/index.d.ts +18 -0
  33. package/dist/components/DataGrid/SummaryRow/index.d.ts.map +1 -0
  34. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  35. package/dist/components/DataGrid/TableBody/GroupRow.d.ts +18 -0
  36. package/dist/components/DataGrid/TableBody/GroupRow.d.ts.map +1 -0
  37. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  38. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  39. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts +3 -2
  40. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts.map +1 -1
  41. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  42. package/dist/components/DataGrid/TableBody/index.d.ts +3 -1
  43. package/dist/components/DataGrid/TableBody/index.d.ts.map +1 -1
  44. package/dist/components/DataGrid/TableBody/index.js +161 -0
  45. package/dist/components/DataGrid/index.d.ts +1 -1
  46. package/dist/components/DataGrid/index.d.ts.map +1 -1
  47. package/dist/components/DataGrid/index.js +696 -0
  48. package/dist/components/DataGrid/types.d.ts +141 -1
  49. package/dist/components/DataGrid/types.d.ts.map +1 -1
  50. package/dist/components/DataGrid/utils.d.ts +2 -0
  51. package/dist/components/DataGrid/utils.d.ts.map +1 -1
  52. package/dist/components/DataGrid/utils.js +20 -0
  53. package/dist/components/DataGridCell.d.ts +5 -2
  54. package/dist/components/DataGridCell.d.ts.map +1 -1
  55. package/dist/components/DataGridCell.js +412 -0
  56. package/dist/components/DataTable.js +700 -0
  57. package/dist/components/DateInput.js +193 -0
  58. package/dist/components/DateRangeInput.js +368 -0
  59. package/dist/components/DebugJson.js +28 -0
  60. package/dist/components/Display.js +46 -0
  61. package/dist/components/EditingContext.js +34 -0
  62. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  63. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  64. package/dist/components/EmblaCarousel/index.js +153 -0
  65. package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
  66. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
  67. package/dist/components/EmptyCartIcon.js +25 -0
  68. package/dist/components/FilterGroup.d.ts +5 -3
  69. package/dist/components/FilterGroup.d.ts.map +1 -1
  70. package/dist/components/FilterGroup.js +198 -0
  71. package/dist/components/FullViewportBox.js +19 -0
  72. package/dist/components/Grid.js +54 -0
  73. package/dist/components/Heading.js +50 -0
  74. package/dist/components/HorizontalDivider.js +20 -0
  75. package/dist/components/Icon.d.ts +5 -2
  76. package/dist/components/Icon.d.ts.map +1 -1
  77. package/dist/components/Icon.js +73 -0
  78. package/dist/components/ImagePlaceholder.js +22 -0
  79. package/dist/components/Input.d.ts +11 -9
  80. package/dist/components/Input.d.ts.map +1 -1
  81. package/dist/components/Input.js +469 -0
  82. package/dist/components/InputGroup.js +45 -0
  83. package/dist/components/Label.js +37 -0
  84. package/dist/components/Link.js +69 -0
  85. package/dist/components/List.js +12 -0
  86. package/dist/components/ListGroup.d.ts.map +1 -1
  87. package/dist/components/ListGroup.js +54 -0
  88. package/dist/components/LiveChatComponent.js +25 -0
  89. package/dist/components/LoadingScrim.js +22 -0
  90. package/dist/components/LogoAgilityTopBar.js +90 -0
  91. package/dist/components/LogoDMSiTopBar.js +54 -0
  92. package/dist/components/LogoMillworkTopBar.js +196 -0
  93. package/dist/components/MainBar.js +58 -0
  94. package/dist/components/MaxViewportBox.js +19 -0
  95. package/dist/components/Menu.d.ts.map +1 -1
  96. package/dist/components/Menu.js +202 -0
  97. package/dist/components/MenuOption.js +161 -0
  98. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  99. package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
  100. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  101. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  102. package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
  103. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
  104. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  105. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts +2 -1
  106. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts.map +1 -1
  107. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  108. package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts.map +1 -1
  109. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  110. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  111. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts.map +1 -1
  112. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  113. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  114. package/dist/components/MobileDataGrid/index.d.ts +1 -1
  115. package/dist/components/MobileDataGrid/index.d.ts.map +1 -1
  116. package/dist/components/MobileDataGrid/index.js +78 -0
  117. package/dist/components/MobileNavMenu.d.ts.map +1 -1
  118. package/dist/components/MobileNavMenu.js +173 -0
  119. package/dist/components/Modal.d.ts +1 -2
  120. package/dist/components/Modal.d.ts.map +1 -1
  121. package/dist/components/Modal.js +201 -0
  122. package/dist/components/ModalButtons.d.ts.map +1 -1
  123. package/dist/components/ModalButtons.js +57 -0
  124. package/dist/components/ModalContent.d.ts +1 -2
  125. package/dist/components/ModalContent.d.ts.map +1 -1
  126. package/dist/components/ModalContent.js +24 -0
  127. package/dist/components/ModalHeader.js +74 -0
  128. package/dist/components/ModalScrim.js +32 -0
  129. package/dist/components/NavigationTab.js +72 -0
  130. package/dist/components/NavigationTabs.js +45 -0
  131. package/dist/components/NestedMenu.d.ts.map +1 -1
  132. package/dist/components/NestedMenu.js +119 -0
  133. package/dist/components/Notification.js +91 -0
  134. package/dist/components/OptionPill.d.ts +2 -1
  135. package/dist/components/OptionPill.d.ts.map +1 -1
  136. package/dist/components/OptionPill.js +103 -0
  137. package/dist/components/OrderCheckIcon.js +28 -0
  138. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  139. package/dist/components/PDFViewer/PDFElement.js +77 -0
  140. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  141. package/dist/components/PDFViewer/PDFPage.js +28 -0
  142. package/dist/components/PDFViewer/index.d.ts.map +1 -1
  143. package/dist/components/PDFViewer/index.js +124 -0
  144. package/dist/components/Pagination.d.ts.map +1 -1
  145. package/dist/components/Pagination.js +117 -0
  146. package/dist/components/Paragraph.js +43 -0
  147. package/dist/components/Password.js +47 -0
  148. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  149. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts +2 -1
  150. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
  151. package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
  152. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts +2 -1
  153. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
  154. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
  155. package/dist/components/ProductImagePreview/Thumbnail.d.ts +2 -1
  156. package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
  157. package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
  158. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  159. package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
  160. package/dist/components/ProductImagePreview/index.js +189 -0
  161. package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
  162. package/dist/components/ProjectBar.d.ts +1 -1
  163. package/dist/components/ProjectBar.js +54 -0
  164. package/dist/components/Radio.js +113 -0
  165. package/dist/components/Search.js +89 -0
  166. package/dist/components/SearchResultImage/index.js +26 -0
  167. package/dist/components/Select.js +122 -0
  168. package/dist/components/SideMenu.js +24 -0
  169. package/dist/components/SideMenuGroup.js +80 -0
  170. package/dist/components/SideMenuItem.js +79 -0
  171. package/dist/components/SimpleTable.js +60 -0
  172. package/dist/components/SkeletonParagraph.js +24 -0
  173. package/dist/components/Spinner.d.ts +1 -1
  174. package/dist/components/Spinner.d.ts.map +1 -1
  175. package/dist/components/Spinner.js +30 -0
  176. package/dist/components/Stack.js +174 -0
  177. package/dist/components/StatusPill.js +44 -0
  178. package/dist/components/Stepper.js +138 -0
  179. package/dist/components/Subheader.d.ts +2 -1
  180. package/dist/components/Subheader.d.ts.map +1 -1
  181. package/dist/components/Subheader.js +41 -0
  182. package/dist/components/Surface.js +30 -0
  183. package/dist/components/Swatch.js +1498 -0
  184. package/dist/components/Textarea.js +106 -0
  185. package/dist/components/Theme.d.ts +1 -1
  186. package/dist/components/Theme.d.ts.map +1 -1
  187. package/dist/components/Theme.js +25 -0
  188. package/dist/components/Time.d.ts +2 -1
  189. package/dist/components/Time.d.ts.map +1 -1
  190. package/dist/components/Time.js +225 -0
  191. package/dist/components/Toast.d.ts +4 -3
  192. package/dist/components/Toast.d.ts.map +1 -1
  193. package/dist/components/Toast.js +170 -0
  194. package/dist/components/Tooltip.js +102 -0
  195. package/dist/components/TopBar.d.ts.map +1 -1
  196. package/dist/components/TopBar.js +119 -0
  197. package/dist/components/Upload.js +107 -0
  198. package/dist/components/WorldpayIframe.d.ts.map +1 -1
  199. package/dist/components/WorldpayIframe.js +19 -0
  200. package/dist/hooks/useEditCell.js +23 -0
  201. package/dist/hooks/useInfiniteScroll.js +25 -0
  202. package/dist/hooks/useKeydown.js +20 -0
  203. package/dist/hooks/useMatchesMedia.js +15 -0
  204. package/dist/hooks/useMenuSystem.js +186 -0
  205. package/dist/hooks/useMounted.js +9 -0
  206. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  207. package/dist/hooks/useTableLayout/storage.js +64 -0
  208. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  209. package/dist/index.js +249 -52864
  210. package/dist/lib/loadFonts.js +11 -0
  211. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  212. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  213. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  214. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  215. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  216. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  217. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  218. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  219. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  220. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  221. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  222. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  223. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  224. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  225. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  226. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  227. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  228. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  229. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  230. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  231. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  232. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  233. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  234. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  235. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  236. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  237. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  238. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  239. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  240. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  241. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  242. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  243. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  244. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  245. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  246. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  247. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  248. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  249. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  250. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  251. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  252. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  253. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  254. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  255. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  256. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  257. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  258. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  259. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  260. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  261. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  262. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  263. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  264. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  265. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  266. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  267. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  268. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  269. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  270. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  271. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  272. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  273. package/dist/static/no-results-image.png.js +4 -0
  274. package/dist/styles.css +1 -1
  275. package/dist/utils/date-patch-dashes.js +28 -0
  276. package/dist/utils/date.js +95 -0
  277. package/dist/utils/formatting.js +22 -0
  278. package/dist/utils/index.js +4 -0
  279. package/dist/utils/mergeObjectArrays.js +18 -0
  280. package/dist/utils.js +20 -0
  281. package/package.json +1 -1
  282. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsxs as L, jsx as $ } from "react/jsx-runtime";
3
+ import { clsx as q } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useRef as g, useState as d, useEffect as v } from "react";
5
+ import { createPortal as z } from "react-dom";
6
+ import { typography as F, componentPadding as j } from "../classNames.js";
7
+ import { useMatchesMobile as A } from "../hooks/useMatchesMedia.js";
8
+ function W({
9
+ id: c,
10
+ testid: l,
11
+ message: b,
12
+ position: w = "top",
13
+ children: x,
14
+ showOnTruncation: p = !1,
15
+ offset: s = 8,
16
+ keepHidden: y = !1
17
+ }) {
18
+ const o = g(null), a = g(null), [f, M] = d({ top: 0, left: 0 }), [i, m] = d(!1), [R, h] = d(!1), u = () => {
19
+ if (!o.current || !a.current) return;
20
+ const e = o.current.getBoundingClientRect(), t = a.current.getBoundingClientRect();
21
+ let n = 0, r = 0;
22
+ switch (w) {
23
+ case "top":
24
+ n = e.top - t.height - s, r = e.left + e.width / 2 - t.width / 2;
25
+ break;
26
+ case "bottom":
27
+ n = e.bottom + s, r = e.left + e.width / 2 - t.width / 2;
28
+ break;
29
+ case "left":
30
+ n = e.top + e.height / 2 - t.height / 2, r = e.left - t.width - s;
31
+ break;
32
+ case "right":
33
+ n = e.top + e.height / 2 - t.height / 2, r = e.right + s;
34
+ break;
35
+ }
36
+ M({ top: n, left: r }), requestAnimationFrame(() => {
37
+ h(!0);
38
+ });
39
+ }, k = () => {
40
+ (!p || T()) && m(!0);
41
+ }, E = () => {
42
+ m(!1), h(!1);
43
+ };
44
+ v(() => {
45
+ i && a.current && requestAnimationFrame(() => {
46
+ u();
47
+ });
48
+ }, [i]), v(() => {
49
+ if (i)
50
+ return window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
51
+ }, [i]);
52
+ const P = A();
53
+ return /* @__PURE__ */ L(
54
+ "div",
55
+ {
56
+ id: c,
57
+ "data-testid": l,
58
+ ref: o,
59
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
60
+ onMouseEnter: k,
61
+ onMouseLeave: E,
62
+ children: [
63
+ x,
64
+ !y && i && !P && typeof document < "u" && z(
65
+ /* @__PURE__ */ $(
66
+ "div",
67
+ {
68
+ id: c ? `${c}-message` : void 0,
69
+ "data-testid": l ? `${l}-message` : void 0,
70
+ ref: a,
71
+ style: {
72
+ position: "fixed",
73
+ top: `${f.top}px`,
74
+ left: `${f.left}px`,
75
+ zIndex: 9999
76
+ },
77
+ className: q(
78
+ F.caption,
79
+ "bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
80
+ j,
81
+ !R && "opacity-0"
82
+ ),
83
+ children: b
84
+ }
85
+ ),
86
+ document.body
87
+ )
88
+ ]
89
+ }
90
+ );
91
+ function T() {
92
+ if (p && o.current) {
93
+ const e = o.current.querySelector("p, a");
94
+ if (e)
95
+ return e.scrollWidth > e.clientWidth;
96
+ }
97
+ return !1;
98
+ }
99
+ }
100
+ export {
101
+ W as Tooltip
102
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../src/components/TopBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlD,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAA8B,EAC9B,EAAE,EACF,MAAM,EACN,GAAG,KAAK,EACT,EAAE,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,2CAqEhD;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,SAA8B,EAC9B,EAAE,EACF,MAAM,EACN,SAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAuBA"}
1
+ {"version":3,"file":"TopBar.d.ts","sourceRoot":"","sources":["../../src/components/TopBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlD,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAA8B,EAC9B,EAAE,EACF,MAAM,EACN,GAAG,KAAK,EACT,EAAE,WAAW,GAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,2CAwEhD;AAED,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,SAA8B,EAC9B,EAAE,EACF,MAAM,EACN,SAAe,EACf,GAAG,KAAK,EACT,EAAE,WAAW,GAAG;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,2CAyBA"}
@@ -0,0 +1,119 @@
1
+ import { jsx as e, jsxs as t, Fragment as x } from "react/jsx-runtime";
2
+ import { clsx as i } from "../node_modules/clsx/dist/clsx.js";
3
+ import { gapUsingContainerPadding as g, layoutGap as s, layoutGroupGap as c, containerPaddingX as k, layoutPaddingY as v } from "../classNames.js";
4
+ import { LogoDMSiTopBar as h } from "./LogoDMSiTopBar.js";
5
+ function y({
6
+ left: d,
7
+ right: a,
8
+ topNavLinks: r,
9
+ mobileLeft: n,
10
+ mobileRight: l,
11
+ brandLogo: o = /* @__PURE__ */ e(h, {}),
12
+ id: p,
13
+ testid: m,
14
+ ...f
15
+ }) {
16
+ const u = i("bg-background-primary-normal");
17
+ return /* @__PURE__ */ t(
18
+ "div",
19
+ {
20
+ id: p,
21
+ "data-testid": m,
22
+ className: i(
23
+ "flex items-center justify-between",
24
+ k,
25
+ v,
26
+ s,
27
+ u
28
+ ),
29
+ ...f,
30
+ children: [
31
+ d && /* @__PURE__ */ e(
32
+ "div",
33
+ {
34
+ className: i(
35
+ "hidden desktop:flex items-center",
36
+ g
37
+ ),
38
+ children: d
39
+ }
40
+ ),
41
+ (a || r) && /* @__PURE__ */ t(
42
+ "div",
43
+ {
44
+ className: i(
45
+ "hidden desktop:flex items-center shrink-0 ml-auto",
46
+ "[&>a]:leading-6",
47
+ s
48
+ ),
49
+ children: [
50
+ r,
51
+ r && a && /* @__PURE__ */ e("div", { className: "h-6 border-r border-border-primary-normal" }),
52
+ a
53
+ ]
54
+ }
55
+ ),
56
+ n && /* @__PURE__ */ t(
57
+ "div",
58
+ {
59
+ className: i("flex items-center desktop:hidden", c),
60
+ children: [
61
+ n,
62
+ /* @__PURE__ */ e(
63
+ "a",
64
+ {
65
+ href: "/",
66
+ "data-testid": m ? `${m}-mobile-brand-logo-link` : "main-nav-mobile-logo",
67
+ className: "grow max-w-100 h-auto max-h-18 *:max-h-[inherit]",
68
+ children: o && o
69
+ }
70
+ )
71
+ ]
72
+ }
73
+ ),
74
+ l && /* @__PURE__ */ e(
75
+ "div",
76
+ {
77
+ className: i("flex items-center desktop:hidden", c),
78
+ children: l
79
+ }
80
+ )
81
+ ]
82
+ }
83
+ );
84
+ }
85
+ function j({
86
+ left: d,
87
+ brandLogo: a = /* @__PURE__ */ e(h, {}),
88
+ id: r,
89
+ testid: n,
90
+ brandHref: l = "/",
91
+ ...o
92
+ }) {
93
+ return /* @__PURE__ */ e(
94
+ y,
95
+ {
96
+ ...o,
97
+ id: r,
98
+ testid: n,
99
+ brandLogo: a,
100
+ left: /* @__PURE__ */ t(x, { children: [
101
+ /* @__PURE__ */ e(
102
+ "a",
103
+ {
104
+ id: r ? `${r}-brand-logo-link` : void 0,
105
+ "data-testid": n ? `${n}-brand-logo-link` : "main-nav-desktop-logo",
106
+ href: l,
107
+ className: "grow w-full h-18 *:max-h-[inherit]",
108
+ children: a && a
109
+ }
110
+ ),
111
+ d
112
+ ] })
113
+ }
114
+ );
115
+ }
116
+ export {
117
+ j as TopBar,
118
+ y as TopBarBase
119
+ };
@@ -0,0 +1,107 @@
1
+ import { jsxs as i, jsx as t, Fragment as l } from "react/jsx-runtime";
2
+ import { clsx as x } from "../node_modules/clsx/dist/clsx.js";
3
+ import { forwardRef as y } from "react";
4
+ import { componentGap as h } from "../classNames.js";
5
+ import { Icon as s } from "./Icon.js";
6
+ import { Paragraph as g } from "./Paragraph.js";
7
+ import { Button as v } from "./Button.js";
8
+ import { Stack as b } from "./Stack.js";
9
+ import { Spinner as j } from "./Spinner.js";
10
+ const B = y(
11
+ function(d, m) {
12
+ const {
13
+ isLoading: a,
14
+ style: c,
15
+ errorText: r,
16
+ text: p = "Upload your file",
17
+ value: o,
18
+ onRemove: f,
19
+ testid: e,
20
+ ...u
21
+ } = d;
22
+ return /* @__PURE__ */ i(
23
+ "label",
24
+ {
25
+ style: {
26
+ ...c
27
+ },
28
+ className: x(
29
+ "border border-dashed border-border-primary-normal",
30
+ "flex flex-col items-center justify-center",
31
+ "p-6",
32
+ "cursor-pointer",
33
+ "relative",
34
+ "w-full h-[166px] desktop:w-[340px] desktop:h-[190px]",
35
+ h
36
+ ),
37
+ "data-testid": e,
38
+ children: [
39
+ /* @__PURE__ */ t(
40
+ "input",
41
+ {
42
+ ...u,
43
+ ref: m,
44
+ type: "file",
45
+ className: "sr-only",
46
+ "data-testid": e ? `${e}-file-input` : void 0
47
+ }
48
+ ),
49
+ a && /* @__PURE__ */ t(
50
+ b,
51
+ {
52
+ centered: !0,
53
+ items: "center",
54
+ justify: "center",
55
+ sizing: "container",
56
+ padding: !0,
57
+ children: /* @__PURE__ */ t(j, { size: "large" })
58
+ }
59
+ ),
60
+ !o && !a && /* @__PURE__ */ i(l, { children: [
61
+ /* @__PURE__ */ t(
62
+ s,
63
+ {
64
+ testid: e ? `${e}-icon` : void 0,
65
+ name: "cloud_upload",
66
+ className: "text-icon-primary-normal"
67
+ }
68
+ ),
69
+ /* @__PURE__ */ t(
70
+ g,
71
+ {
72
+ testid: e ? `${e}-text` : void 0,
73
+ color: r ? "text-primary-error" : "text-secondary-normal",
74
+ children: r || p
75
+ }
76
+ )
77
+ ] }),
78
+ o && /* @__PURE__ */ i(l, { children: [
79
+ /* @__PURE__ */ t(
80
+ "img",
81
+ {
82
+ "data-testid": e ? `${e}-uploaded-image` : void 0,
83
+ src: o,
84
+ alt: "",
85
+ className: "absolute inset-0 object-contain object-center max-h-full max-w-full self-center justify-self-center"
86
+ }
87
+ ),
88
+ /* @__PURE__ */ t("div", { className: "absolute right-2 top-2", children: /* @__PURE__ */ t(
89
+ v,
90
+ {
91
+ testid: e ? `${e}-remove-image-button` : void 0,
92
+ onClick: (n) => {
93
+ n.preventDefault(), n.stopPropagation(), f?.();
94
+ },
95
+ iconOnly: !0,
96
+ leftIcon: /* @__PURE__ */ t(s, { name: "delete" })
97
+ }
98
+ ) })
99
+ ] })
100
+ ]
101
+ }
102
+ );
103
+ }
104
+ );
105
+ export {
106
+ B as Upload
107
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"WorldpayIframe.d.ts","sourceRoot":"","sources":["../../src/components/WorldpayIframe.tsx"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,MAAM,GACP,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,2CAQA"}
1
+ {"version":3,"file":"WorldpayIframe.d.ts","sourceRoot":"","sources":["../../src/components/WorldpayIframe.tsx"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,MAAM,GACP,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,2CASA"}
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ function r({
4
+ url: o,
5
+ testid: a
6
+ }) {
7
+ return /* @__PURE__ */ l(
8
+ "iframe",
9
+ {
10
+ "data-testid": a,
11
+ src: o,
12
+ sandbox: "allow-same-origin allow-forms allow-scripts allow-popups allow-top-navigation",
13
+ style: { width: "100%", height: "100%", flex: 1 }
14
+ }
15
+ );
16
+ }
17
+ export {
18
+ r as WorldpayIframe
19
+ };
@@ -0,0 +1,23 @@
1
+ import { useState as n, useRef as a } from "react";
2
+ function l(o) {
3
+ const [u, s] = n(o), [i, e] = n(!1), t = a(null);
4
+ function c() {
5
+ e(!0), requestAnimationFrame(() => {
6
+ t.current?.focus();
7
+ });
8
+ }
9
+ function r() {
10
+ e(!1);
11
+ }
12
+ return {
13
+ value: u,
14
+ setValue: s,
15
+ isEdit: i,
16
+ inputRef: t,
17
+ changeToEditMode: c,
18
+ changeToViewMode: r
19
+ };
20
+ }
21
+ export {
22
+ l as useEditCell
23
+ };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { useEffect as m } from "react";
3
+ function v({
4
+ containerRef: r,
5
+ onLoadMore: e,
6
+ isLoading: l,
7
+ offset: c = 50,
8
+ enabled: o = !0
9
+ }) {
10
+ m(() => {
11
+ if (!o) return;
12
+ const n = () => {
13
+ const s = r.current;
14
+ if (!s || l) return;
15
+ const { scrollTop: i, scrollHeight: u, clientHeight: f } = s;
16
+ i + f >= u - c && e();
17
+ }, t = r.current;
18
+ return t && t.addEventListener("scroll", n), () => {
19
+ t && t.removeEventListener("scroll", n);
20
+ };
21
+ }, [r, e, l, c, o]);
22
+ }
23
+ export {
24
+ v as useInfiniteScroll
25
+ };
@@ -0,0 +1,20 @@
1
+ import { useEffect as o } from "react";
2
+ function d(r, u) {
3
+ function t(e) {
4
+ !Object.keys(r).includes(e.key) && !Object.keys(r).join("").includes("/") || Object.entries(r).forEach(([n, i]) => {
5
+ if (!(e.key !== n && !n.includes("/"))) {
6
+ if (n.includes("/") && n.replace("Space", " ").split("/").includes(e.key)) {
7
+ e.preventDefault(), i(e);
8
+ return;
9
+ }
10
+ e.key === n && (e.preventDefault(), i(e));
11
+ }
12
+ });
13
+ }
14
+ o(() => u ? (document.addEventListener("keydown", t), () => {
15
+ document.removeEventListener("keydown", t);
16
+ }) : document.removeEventListener("keydown", t), [r, u]);
17
+ }
18
+ export {
19
+ d as useKeydown
20
+ };
@@ -0,0 +1,15 @@
1
+ import { useState as c, useLayoutEffect as r } from "react";
2
+ function i(n) {
3
+ const [s, a] = c();
4
+ return r(() => {
5
+ const e = window.matchMedia(n), t = () => a(e.matches);
6
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
7
+ }, [n]), s;
8
+ }
9
+ function u() {
10
+ return i("(width < 48rem)");
11
+ }
12
+ export {
13
+ i as useMatchesMedia,
14
+ u as useMatchesMobile
15
+ };
@@ -0,0 +1,186 @@
1
+ "use client";
2
+ import { useState as O, useCallback as y, useEffect as L, useRef as M } from "react";
3
+ import { useMatchesMobile as P } from "./useMatchesMedia.js";
4
+ function Y(l) {
5
+ const [o, n] = O(
6
+ {}
7
+ ), [g, A] = O(""), [w, m] = O(
8
+ null
9
+ ), u = M(null), a = M({}), i = M(null), c = M(null), h = M(null), d = M(!1), f = M(null), E = M(null), v = P(), R = (t, e) => {
10
+ c.current && (clearTimeout(c.current), c.current = null), A(t), m(e), n((r) => {
11
+ const s = { ...r };
12
+ return s[e] === t ? delete s[e] : s[e] = t, Object.keys(s).forEach((b) => {
13
+ Number(b) > e && delete s[Number(b)];
14
+ }), s;
15
+ });
16
+ }, T = (t, e) => {
17
+ c.current && (clearTimeout(c.current), c.current = null), n((r) => {
18
+ const s = { ...r };
19
+ return s[e] = t, Object.keys(s).forEach((b) => {
20
+ Number(b) > e && delete s[Number(b)];
21
+ }), s;
22
+ });
23
+ }, p = y(() => {
24
+ E.current && (E.current(), E.current = null), f.current && (f.current(), f.current = null);
25
+ }, []), C = (t, e, r = 150) => {
26
+ v || (f.current = () => {
27
+ i.current && clearTimeout(i.current), i.current = setTimeout(() => {
28
+ T(t, e);
29
+ }, r);
30
+ }, d.current || p());
31
+ }, j = (t, e = 500) => {
32
+ v || (E.current = () => {
33
+ i.current && (clearTimeout(i.current), i.current = null), c.current = setTimeout(() => {
34
+ S(t);
35
+ }, e);
36
+ }, d.current || p());
37
+ }, W = () => {
38
+ d.current = !0, h.current && clearTimeout(h.current), h.current = setTimeout(() => {
39
+ d.current = !1, p();
40
+ }, 200);
41
+ }, I = () => {
42
+ v || h.current && (clearTimeout(h.current), h.current = null, d.current = !1);
43
+ }, S = (t) => {
44
+ n((e) => {
45
+ const r = { ...e };
46
+ if (delete r[t], Object.keys(r).forEach((s) => {
47
+ Number(s) >= t && delete r[Number(s)];
48
+ }), v) {
49
+ const s = t - 1;
50
+ m(s);
51
+ const b = r[s];
52
+ Object.keys(r).length > 0 && b && A(b);
53
+ }
54
+ return r;
55
+ });
56
+ }, k = (t, e) => {
57
+ a.current[t] = e;
58
+ }, N = (t, e) => o[e] === t;
59
+ return L(() => {
60
+ const t = (e) => {
61
+ if (Object.keys(o).length === 0) return;
62
+ const r = e.target;
63
+ if (u.current?.contains(r)) return;
64
+ Object.values(o).some((b) => a.current[b]?.contains(r)) || n({});
65
+ };
66
+ return document.addEventListener("mousedown", t), () => {
67
+ document.removeEventListener("mousedown", t);
68
+ };
69
+ }, [o]), L(() => () => {
70
+ i.current && clearTimeout(i.current), c.current && clearTimeout(c.current);
71
+ }, []), {
72
+ menuRootRef: u,
73
+ activeMenus: o,
74
+ openMenu: T,
75
+ isMenuActive: N,
76
+ registerSubMenu: k,
77
+ closeSubMenuLevel: S,
78
+ getAllFocusableMenuElements: () => {
79
+ const t = [];
80
+ return u.current && t.push(
81
+ ...Array.from(u.current.children)
82
+ ), Object.values(o).forEach((e) => {
83
+ const r = a.current[e];
84
+ r && t.push(...Array.from(r.children));
85
+ }), t;
86
+ },
87
+ findCurrentMenuLevel: (t) => {
88
+ let e = t.parentElement;
89
+ for (; e; ) {
90
+ const r = e.getAttribute("data-menu-level");
91
+ if (r !== null)
92
+ return parseInt(r, 10);
93
+ e = e.parentElement;
94
+ }
95
+ return 0;
96
+ },
97
+ getMenuElementsAtLevel: (t) => {
98
+ if (t === 0 && u.current)
99
+ return Array.from(u.current.children);
100
+ const e = Object.entries(o).find(([, r]) => {
101
+ const s = a.current[r];
102
+ return s && s.getAttribute("data-menu-level") === t.toString();
103
+ })?.[1];
104
+ if (e) {
105
+ const r = a.current[e];
106
+ if (r)
107
+ return Array.from(r.children);
108
+ }
109
+ return [];
110
+ },
111
+ mobileHide: v && Object.keys(o).length > 0,
112
+ listeners: {
113
+ onSubMenuHover: C,
114
+ onSubMenuLeave: j,
115
+ onSubMenuEnter: I,
116
+ onMouseMove: W,
117
+ toggleMenu: R,
118
+ mobilePositionTo: l,
119
+ activeMenu: g,
120
+ currentSubMenuLevel: w,
121
+ closeSubMenuLevel: S
122
+ }
123
+ };
124
+ }
125
+ function q(l, o = "bottom", n) {
126
+ const [g, A] = O({
127
+ top: 0,
128
+ left: 0,
129
+ minWidth: 0
130
+ }), w = n?.isMobile, m = y(() => {
131
+ if (!l?.current) return;
132
+ const u = l.current.getBoundingClientRect(), a = n?.menuRef?.current?.getBoundingClientRect(), i = window.innerWidth, c = a?.width || u.width, h = n?.topOffset ?? 4;
133
+ let d = 0, f = 0;
134
+ if (o === "bottom" || o === "bottom-right" ? d = u.top + u.height + h : d = u.top, o === "bottom" ? f = u.left : o === "bottom-right" ? f = u.right - c : o === "right" && (w ? f = u.left : f = u.right), f + c > i) {
135
+ const v = u.left - c;
136
+ v < 0 ? f = (i - c) / 2 : f = v;
137
+ }
138
+ w && o === "right" && (d = u.top + u.height + h), w && c > i && (f = 0), A({
139
+ top: d,
140
+ left: f,
141
+ minWidth: u.width
142
+ });
143
+ }, [l, o, n?.menuRef, n?.topOffset, w]);
144
+ return L(() => {
145
+ if (!n?.isOpen || !n?.setIsOpen) return;
146
+ const u = (a) => {
147
+ const i = a.target;
148
+ l.current?.contains(i) || n.menuRef?.current?.contains(i) || n.additionalRefs?.some((c) => c.current?.contains(i)) || n.setIsOpen?.(!1);
149
+ };
150
+ return document.addEventListener("mousedown", u), () => {
151
+ document.removeEventListener("mousedown", u);
152
+ };
153
+ }, [
154
+ n,
155
+ l,
156
+ n?.isOpen,
157
+ n?.setIsOpen,
158
+ n?.menuRef,
159
+ n?.additionalRefs
160
+ ]), L(() => {
161
+ m();
162
+ const u = new ResizeObserver(m);
163
+ l?.current && u.observe(l.current), window.addEventListener("scroll", m);
164
+ const a = () => {
165
+ n?.setIsOpen?.(!1);
166
+ }, i = z(l.current);
167
+ return i.forEach((c) => c.addEventListener("scroll", a)), window.addEventListener("resize", m), () => {
168
+ u.disconnect(), window.removeEventListener("scroll", m), i.forEach((c) => c.removeEventListener("scroll", a)), window.removeEventListener("resize", m);
169
+ };
170
+ }, [l, m]), { menuPosition: g, updatePosition: m };
171
+ }
172
+ function z(l) {
173
+ if (!l)
174
+ return [];
175
+ const o = [];
176
+ let n = l.parentElement;
177
+ for (; n; ) {
178
+ const g = window.getComputedStyle(n).overflowY;
179
+ (g === "auto" || g === "scroll") && o.push(n), n = n.parentElement;
180
+ }
181
+ return o;
182
+ }
183
+ export {
184
+ q as useMenuPosition,
185
+ Y as useSubMenuSystem
186
+ };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { useState as u, useEffect as s } from "react";
3
+ function o() {
4
+ const [t, e] = u(!1);
5
+ return s(() => (e(!0), () => e(!1)), []), t;
6
+ }
7
+ export {
8
+ o as useMounted
9
+ };