@dmsi/wedgekit-react 2.0.0 → 2.0.2

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 (235) hide show
  1. package/dist/classNames.js +150 -0
  2. package/dist/components/AccessCard.js +63 -0
  3. package/dist/components/AccessCardGroup.js +73 -0
  4. package/dist/components/AccessChangerTabItem.js +51 -0
  5. package/dist/components/Accordion.js +99 -0
  6. package/dist/components/Alert.js +78 -0
  7. package/dist/components/Breadcrumbs.js +111 -0
  8. package/dist/components/Button.js +137 -0
  9. package/dist/components/CalendarRange.d.ts.map +1 -1
  10. package/dist/components/CalendarRange.js +406 -0
  11. package/dist/components/Caption.js +99 -0
  12. package/dist/components/Card.js +50 -0
  13. package/dist/components/Checkbox.js +108 -0
  14. package/dist/components/CompactImagesPreview.d.ts.map +1 -1
  15. package/dist/components/CompactImagesPreview.js +121 -0
  16. package/dist/components/ContentTab.js +68 -0
  17. package/dist/components/ContentTabs.js +96 -0
  18. package/dist/components/DMSiLogo.js +54 -0
  19. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -1
  20. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +28 -0
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -1
  22. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +80 -0
  23. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  24. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  25. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  26. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  27. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  28. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  29. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  30. package/dist/components/DataGrid/TableBody/index.js +161 -0
  31. package/dist/components/DataGrid/index.js +696 -0
  32. package/dist/components/DataGrid/utils.js +20 -0
  33. package/dist/components/DataGridCell.js +412 -0
  34. package/dist/components/DataTable.js +700 -0
  35. package/dist/components/DateInput.d.ts.map +1 -1
  36. package/dist/components/DateInput.js +194 -0
  37. package/dist/components/DateRangeInput.d.ts.map +1 -1
  38. package/dist/components/DateRangeInput.js +369 -0
  39. package/dist/components/DebugJson.js +28 -0
  40. package/dist/components/Display.js +46 -0
  41. package/dist/components/EditingContext.js +34 -0
  42. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  43. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  44. package/dist/components/EmblaCarousel/index.d.ts.map +1 -1
  45. package/dist/components/EmblaCarousel/index.js +154 -0
  46. package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -1
  47. package/dist/components/EmblaCarousel/usePrevNextButtons.js +22 -0
  48. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -1
  49. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +16 -0
  50. package/dist/components/EmptyCartIcon.js +25 -0
  51. package/dist/components/FilterGroup.js +198 -0
  52. package/dist/components/FullViewportBox.js +19 -0
  53. package/dist/components/Grid.js +54 -0
  54. package/dist/components/Heading.js +50 -0
  55. package/dist/components/HorizontalDivider.js +20 -0
  56. package/dist/components/Icon.js +73 -0
  57. package/dist/components/ImagePlaceholder.d.ts.map +1 -1
  58. package/dist/components/ImagePlaceholder.js +23 -0
  59. package/dist/components/Input.js +469 -0
  60. package/dist/components/InputGroup.js +45 -0
  61. package/dist/components/Label.js +37 -0
  62. package/dist/components/Link.js +69 -0
  63. package/dist/components/List.js +12 -0
  64. package/dist/components/ListGroup.d.ts.map +1 -1
  65. package/dist/components/ListGroup.js +55 -0
  66. package/dist/components/LiveChatComponent.js +25 -0
  67. package/dist/components/LoadingScrim.js +22 -0
  68. package/dist/components/LogoAgilityTopBar.js +90 -0
  69. package/dist/components/LogoDMSiTopBar.js +54 -0
  70. package/dist/components/LogoMillworkTopBar.js +196 -0
  71. package/dist/components/MainBar.js +58 -0
  72. package/dist/components/MaxViewportBox.js +19 -0
  73. package/dist/components/Menu.js +202 -0
  74. package/dist/components/MenuOption.js +161 -0
  75. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  76. package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -1
  77. package/dist/components/MobileDataGrid/ColumnSelector/index.js +101 -0
  78. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  79. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  80. package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -1
  81. package/dist/components/MobileDataGrid/GridContextProvider/index.js +81 -0
  82. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -1
  83. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +12 -0
  84. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  85. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  86. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  87. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  88. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  89. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  90. package/dist/components/MobileDataGrid/index.js +78 -0
  91. package/dist/components/MobileNavMenu.js +173 -0
  92. package/dist/components/Modal.js +201 -0
  93. package/dist/components/ModalButtons.js +57 -0
  94. package/dist/components/ModalContent.js +24 -0
  95. package/dist/components/ModalHeader.js +74 -0
  96. package/dist/components/ModalScrim.js +32 -0
  97. package/dist/components/NavigationTab.js +72 -0
  98. package/dist/components/NavigationTabs.js +45 -0
  99. package/dist/components/NestedMenu.js +119 -0
  100. package/dist/components/Notification.js +91 -0
  101. package/dist/components/OptionPill.js +103 -0
  102. package/dist/components/OrderCheckIcon.js +28 -0
  103. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  104. package/dist/components/PDFViewer/PDFElement.js +77 -0
  105. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  106. package/dist/components/PDFViewer/PDFPage.js +28 -0
  107. package/dist/components/PDFViewer/index.js +124 -0
  108. package/dist/components/Pagination.js +117 -0
  109. package/dist/components/Paragraph.js +43 -0
  110. package/dist/components/Password.js +47 -0
  111. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  112. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
  113. package/dist/components/ProductImagePreview/MobileImageCarousel.js +147 -0
  114. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
  115. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +139 -0
  116. package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
  117. package/dist/components/ProductImagePreview/Thumbnail.js +47 -0
  118. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  119. package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
  120. package/dist/components/ProductImagePreview/index.js +190 -0
  121. package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -1
  122. package/dist/components/ProductImagePreview/useProductImagePreview.js +86 -0
  123. package/dist/components/ProjectBar.js +54 -0
  124. package/dist/components/Radio.js +113 -0
  125. package/dist/components/Search.js +89 -0
  126. package/dist/components/SearchResultImage/index.d.ts.map +1 -1
  127. package/dist/components/SearchResultImage/index.js +27 -0
  128. package/dist/components/Select.js +122 -0
  129. package/dist/components/SideMenu.js +24 -0
  130. package/dist/components/SideMenuGroup.js +80 -0
  131. package/dist/components/SideMenuItem.js +79 -0
  132. package/dist/components/SimpleTable.js +60 -0
  133. package/dist/components/SkeletonParagraph.js +24 -0
  134. package/dist/components/Spinner.js +30 -0
  135. package/dist/components/Stack.js +174 -0
  136. package/dist/components/StatusPill.js +44 -0
  137. package/dist/components/Stepper.js +138 -0
  138. package/dist/components/Subheader.js +41 -0
  139. package/dist/components/Surface.js +30 -0
  140. package/dist/components/Swatch.js +1498 -0
  141. package/dist/components/Textarea.js +106 -0
  142. package/dist/components/Theme.js +25 -0
  143. package/dist/components/Time.d.ts.map +1 -1
  144. package/dist/components/Time.js +226 -0
  145. package/dist/components/Toast.js +170 -0
  146. package/dist/components/Tooltip.js +102 -0
  147. package/dist/components/TopBar.js +119 -0
  148. package/dist/components/Upload.js +107 -0
  149. package/dist/components/WorldpayIframe.js +19 -0
  150. package/dist/hooks/useEditCell.d.ts.map +1 -1
  151. package/dist/hooks/useEditCell.js +24 -0
  152. package/dist/hooks/useInfiniteScroll.js +25 -0
  153. package/dist/hooks/useKeydown.d.ts.map +1 -1
  154. package/dist/hooks/useKeydown.js +21 -0
  155. package/dist/hooks/useMatchesMedia.d.ts.map +1 -1
  156. package/dist/hooks/useMatchesMedia.js +16 -0
  157. package/dist/hooks/useMenuSystem.js +186 -0
  158. package/dist/hooks/useMounted.js +9 -0
  159. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  160. package/dist/hooks/useTableLayout/storage.js +64 -0
  161. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  162. package/dist/index.js +249 -53839
  163. package/dist/lib/loadFonts.js +11 -0
  164. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  165. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  166. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  167. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  168. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  169. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  170. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  171. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  172. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  173. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  174. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  175. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  176. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  177. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  178. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  179. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  180. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  181. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  182. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  183. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  184. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  185. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  186. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  187. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  188. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  189. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  190. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  191. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  192. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  193. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  194. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  195. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  196. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  197. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  198. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  199. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  200. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  201. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  202. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  203. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  204. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  205. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  206. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  207. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  208. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  209. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  210. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  211. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  212. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  213. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  214. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  215. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  216. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  217. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  218. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  219. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  220. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  221. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  222. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  223. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  224. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  225. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  226. package/dist/static/no-results-image.png.js +4 -0
  227. package/dist/utils/date-patch-dashes.js +28 -0
  228. package/dist/utils/date.js +95 -0
  229. package/dist/utils/formatting.js +22 -0
  230. package/dist/utils/index.d.ts +1 -1
  231. package/dist/utils/index.js +4 -0
  232. package/dist/utils/mergeObjectArrays.js +18 -0
  233. package/dist/utils.js +20 -0
  234. package/package.json +1 -1
  235. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,91 @@
1
+ "use client";
2
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
3
+ import { clsx as w } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useState as z } from "react";
5
+ import { Button as v } from "./Button.js";
6
+ import { Paragraph as s } from "./Paragraph.js";
7
+ import { Heading3 as j } from "./Heading.js";
8
+ import { Icon as o } from "./Icon.js";
9
+ import { Stack as m } from "./Stack.js";
10
+ const p = {
11
+ success: {
12
+ className: "border-success-400",
13
+ icon: /* @__PURE__ */ e("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ e(o, { name: "check_circle", size: 24 }) })
14
+ },
15
+ warning: {
16
+ className: "border-warning-400",
17
+ icon: /* @__PURE__ */ e("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ e(o, { name: "warning", size: 24 }) })
18
+ },
19
+ error: {
20
+ className: "border-critical-400",
21
+ icon: /* @__PURE__ */ e("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ e(o, { name: "error", size: 24 }) })
22
+ },
23
+ info: {
24
+ className: "border-action-400",
25
+ icon: /* @__PURE__ */ e("span", { className: "text-icon-on-action-secondary-normal contents", children: /* @__PURE__ */ e(o, { name: "info", size: 24 }) })
26
+ }
27
+ };
28
+ function O({
29
+ id: t,
30
+ testid: a,
31
+ variant: d = "success",
32
+ title: i,
33
+ message: c,
34
+ enableMessage: u = !0,
35
+ description: r,
36
+ enableDescription: f = !1,
37
+ disclaimer: l,
38
+ enableDisclaimer: h = !1,
39
+ card: g = !1,
40
+ ...b
41
+ }) {
42
+ const [y, N] = z(!0), { className: x, icon: k } = p[d] ?? p.success;
43
+ return y ? /* @__PURE__ */ n(
44
+ "div",
45
+ {
46
+ id: t,
47
+ "data-testid": a,
48
+ className: w(
49
+ "flex gap-mobile-layout-gap desktop:gap-desktop-layout-gap compact:gap-desktop-compact-layout-gap justify-between items-center border-2 rounded-sm w-full p-mobile-layout-padding desktop:p-desktop-layout-padding compact:p-desktop-compact-layout-padding bg-white max-w-240",
50
+ x,
51
+ g && "shadow-4"
52
+ ),
53
+ ...b,
54
+ children: [
55
+ /* @__PURE__ */ n(
56
+ m,
57
+ {
58
+ horizontal: !0,
59
+ horizontalMobile: !0,
60
+ items: "start",
61
+ justify: "start",
62
+ sizing: "layout",
63
+ children: [
64
+ k,
65
+ /* @__PURE__ */ n(m, { elevation: 0, items: "start", justify: "start", sizing: "component", children: [
66
+ i && /* @__PURE__ */ e(j, { as: "h3", children: i }),
67
+ c && u && /* @__PURE__ */ e(s, { as: "p", children: c }),
68
+ r && f && /* @__PURE__ */ e(s, { as: "p", children: r }),
69
+ l && h && /* @__PURE__ */ e(s, { as: "p", children: l })
70
+ ] })
71
+ ]
72
+ }
73
+ ),
74
+ /* @__PURE__ */ e(
75
+ v,
76
+ {
77
+ id: t ? `${t}-close-button` : void 0,
78
+ testid: a ? `${a}-close-button` : void 0,
79
+ iconOnly: !0,
80
+ variant: "tertiary",
81
+ onClick: () => N(!1),
82
+ leftIcon: /* @__PURE__ */ e(o, { name: "close", size: 24 })
83
+ }
84
+ )
85
+ ]
86
+ }
87
+ ) : null;
88
+ }
89
+ export {
90
+ O as Notification
91
+ };
@@ -0,0 +1,103 @@
1
+ import { jsxs as h, jsx as d } from "react/jsx-runtime";
2
+ import { clsx as n } from "../node_modules/clsx/dist/clsx.js";
3
+ import { componentPadding as y, componentPaddingYUsingComponentGap as k, componentPaddingMinusBorder as w, componentGap as C, baseTransition as N } from "../classNames.js";
4
+ import { Button as O } from "./Button.js";
5
+ import { Label as P } from "./Label.js";
6
+ import { Icon as $ } from "./Icon.js";
7
+ function L({
8
+ id: e,
9
+ testid: o,
10
+ selected: a = !1,
11
+ onClick: l,
12
+ onRemove: i,
13
+ removable: r = !1,
14
+ active: c = !1,
15
+ disabled: t = !1,
16
+ nowrap: s = !1,
17
+ children: p,
18
+ className: m,
19
+ ...b
20
+ }) {
21
+ const u = {
22
+ "data-disabled": t || null,
23
+ "data-selected": a || null,
24
+ "data-active": c || null
25
+ }, f = n(
26
+ {
27
+ // Base interactive (only when not disabled)
28
+ "hover:border-border-action-hover active:border-border-action-active": !t,
29
+ // Disabled base
30
+ "data-disabled:cursor-default data-disabled:border-border-primary-normal": t,
31
+ // Active (Figma: filled blue background, white text)
32
+ "data-active:bg-background-action-primary-normal data-active:text-white data-active:border-transparent": c && !a,
33
+ // Selected (filled style) overrides background & border, but keeps outline interaction chain.
34
+ "data-selected:border-transparent data-selected:bg-background-action-secondary-hover data-selected:outline-border-action-normal data-selected:hover:outline-border-action-hover data-selected:active:outline-border-action-active": a,
35
+ // Disabled + Selected combination
36
+ "data-selected:data-disabled:bg-background-action-secondary-disabled data-selected:data-disabled:border-border-action-disabled data-selected:data-disabled:outline-transparent": t && a
37
+ },
38
+ !r && y,
39
+ r && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding"
40
+ ), v = n(
41
+ !t && "text-text-primary-normal",
42
+ t && !a && "text-text-primary-disabled",
43
+ t && a && "text-text-on-action-primary-disabled"
44
+ );
45
+ return /* @__PURE__ */ h(
46
+ "div",
47
+ {
48
+ id: e,
49
+ "data-testid": o,
50
+ onClick: x,
51
+ ...b,
52
+ ...u,
53
+ className: n(
54
+ "flex items-center justify-between cursor-pointer w-fit",
55
+ s && "shrink-0 whitespace-nowrap",
56
+ "border border-border-primary-normal rounded-base",
57
+ "outline-2 outline-transparent -outline-offset-2",
58
+ C,
59
+ N,
60
+ f,
61
+ m,
62
+ v
63
+ ),
64
+ children: [
65
+ /* @__PURE__ */ d(
66
+ P,
67
+ {
68
+ id: e ? `${e}-label` : void 0,
69
+ testid: o ? `${o}-label` : void 0,
70
+ padded: !0,
71
+ className: k,
72
+ children: p
73
+ }
74
+ ),
75
+ r && /* @__PURE__ */ d(
76
+ O,
77
+ {
78
+ id: e ? `${e}-remove-button` : void 0,
79
+ testid: o ? `${o}-remove-button` : void 0,
80
+ onClick: g,
81
+ disabled: t,
82
+ className: n(
83
+ "mx-0 h-full w-10 !border-0",
84
+ w
85
+ ),
86
+ iconOnly: !0,
87
+ variant: "tertiary",
88
+ leftIcon: /* @__PURE__ */ d($, { name: "close", size: 16 })
89
+ }
90
+ )
91
+ ]
92
+ }
93
+ );
94
+ function x() {
95
+ t || l?.();
96
+ }
97
+ function g() {
98
+ !r || !i || i();
99
+ }
100
+ }
101
+ export {
102
+ L as OptionPill
103
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as C } from "react/jsx-runtime";
2
+ function r({
3
+ testid: t,
4
+ ...e
5
+ }) {
6
+ return /* @__PURE__ */ C(
7
+ "svg",
8
+ {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ viewBox: "0 0 37 36",
11
+ fill: "none",
12
+ width: 37,
13
+ height: 36,
14
+ "data-testid": t,
15
+ ...e,
16
+ children: /* @__PURE__ */ C(
17
+ "path",
18
+ {
19
+ d: "M18.457 3.00024C19.6493 3.01827 20.8644 3.13827 22.0283 3.41724C22.8321 3.61234 23.3287 4.42237 23.1337 5.22778C22.9402 6.03178 22.1252 6.5272 21.3242 6.33521C20.3928 6.11026 19.4046 6.01526 18.4658 6.00024C15.2603 6.00924 12.2492 7.26586 9.99018 9.53833C7.72976 11.8108 6.49103 14.829 6.49995 18.0344C6.50895 21.2399 7.7656 24.2495 10.038 26.51C12.303 28.7615 15.3065 30.0002 18.4999 30.0002H18.5341C21.7396 29.9912 24.7507 28.7346 27.0097 26.4622C29.2701 24.1882 30.5089 21.1714 30.4999 17.9661C30.4984 17.1382 31.1673 16.4629 31.9951 16.4612H31.9999C32.8263 16.4612 33.4982 17.13 33.4999 17.9563C33.5119 21.9627 31.9625 25.7354 29.1367 28.5764C26.3123 31.4173 22.5503 32.9881 18.5439 33.0002H18.4999C14.5086 33.0002 10.7542 31.4523 7.92378 28.637C5.08288 25.8126 3.51206 22.0505 3.49995 18.0442C3.48795 14.0363 5.03742 10.265 7.86323 7.42407C10.6877 4.58307 14.4505 3.01224 18.457 3.00024ZM27.872 9.51196C28.418 8.89248 29.3642 8.82637 29.9882 9.37231C30.6107 9.91681 30.6739 10.8645 30.1279 11.4885L19.6279 23.4885C19.3549 23.8004 18.9652 23.9852 18.5498 24.0002H18.4999C18.1025 24.0002 17.7214 23.8428 17.4394 23.5608L12.9394 19.0608C12.3529 18.4743 12.353 17.5262 12.9394 16.9397C13.5259 16.3532 14.474 16.3532 15.0605 16.9397L18.4267 20.3059L27.872 9.51196Z",
20
+ fill: "#1D1E1E"
21
+ }
22
+ )
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ r as OrderCheckIcon
28
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { Button as m } from "../Button.js";
3
+ import { Icon as e } from "../Icon.js";
4
+ import { Tooltip as a } from "../Tooltip.js";
5
+ function f({
6
+ onClick: t,
7
+ isDownloading: n,
8
+ testid: r,
9
+ colorClassName: i
10
+ }) {
11
+ return /* @__PURE__ */ o(a, { message: "Download", position: "bottom", children: /* @__PURE__ */ o(
12
+ m,
13
+ {
14
+ testid: r,
15
+ iconOnly: !0,
16
+ variant: "tertiary",
17
+ colorClassName: i,
18
+ leftIcon: /* @__PURE__ */ o(e, { name: n ? "cached" : "download" }),
19
+ onClick: t
20
+ }
21
+ ) });
22
+ }
23
+ export {
24
+ f as DownloadIcon
25
+ };
@@ -0,0 +1,77 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { usePdf as p } from "../../node_modules/@mikecousins/react-pdf/dist/index.js";
3
+ import { useRef as c } from "react";
4
+ import { Spinner as s } from "../Spinner.js";
5
+ import { Stack as f } from "../Stack.js";
6
+ import { PdfPage as u } from "./PDFPage.js";
7
+ import { clsx as m } from "../../node_modules/clsx/dist/clsx.js";
8
+ function w({
9
+ b64: n,
10
+ testid: r,
11
+ isMobile: a,
12
+ error: o
13
+ }) {
14
+ const i = c(null), { pdfDocument: d } = p({
15
+ file: `data:application/pdf;base64,${n}`,
16
+ workerSrc: "/scripts/pdf.worker.min.mjs",
17
+ scale: a ? 1 : 1.3,
18
+ canvasRef: i
19
+ }), l = new Array(d?.numPages ?? 1).fill(null);
20
+ return /* @__PURE__ */ e(
21
+ "div",
22
+ {
23
+ className: "flex flex-col space-y-4",
24
+ style: a ? void 0 : {
25
+ minHeight: 871,
26
+ minWidth: 654
27
+ },
28
+ children: d && n && !o ? /* @__PURE__ */ e(f, { sizing: "layout-group", children: l.length > 1 ? l.map((g, t) => /* @__PURE__ */ e(
29
+ "div",
30
+ {
31
+ className: m(
32
+ "flex justify-center border-border-primary-normal",
33
+ a ? "border-0" : "border"
34
+ ),
35
+ children: /* @__PURE__ */ e(
36
+ u,
37
+ {
38
+ testid: r ? `${r}-pdf_page_${t + 1}` : void 0,
39
+ file: `data:application/pdf;base64,${n}`,
40
+ pageNumber: t + 1
41
+ }
42
+ )
43
+ },
44
+ `${r}-pdf-page-${t + 1}`
45
+ )) : /* @__PURE__ */ e(
46
+ "div",
47
+ {
48
+ className: m(
49
+ "flex justify-center border-border-primary-normal",
50
+ a ? "border-0" : "border"
51
+ ),
52
+ children: /* @__PURE__ */ e(
53
+ "canvas",
54
+ {
55
+ "data-testid": r ? `${r}-pdf-content` : void 0,
56
+ ref: i,
57
+ style: { width: "100%", height: "auto" }
58
+ }
59
+ )
60
+ }
61
+ ) }) : /* @__PURE__ */ e(
62
+ f,
63
+ {
64
+ justify: "center",
65
+ items: "center",
66
+ height: "full",
67
+ flexGrow: 1,
68
+ "data-testid": r ? `${r}-pdf-${o ? "error" : "loading"}` : void 0,
69
+ children: o || /* @__PURE__ */ e(s, { size: "large" })
70
+ }
71
+ )
72
+ }
73
+ );
74
+ }
75
+ export {
76
+ w as PDFElement
77
+ };
@@ -0,0 +1,64 @@
1
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
+ import { Button as o } from "../Button.js";
3
+ import { Heading3 as h } from "../Heading.js";
4
+ import { Icon as a } from "../Icon.js";
5
+ import { Paragraph as u } from "../Paragraph.js";
6
+ import { Stack as c } from "../Stack.js";
7
+ function k({
8
+ currentIndex: d,
9
+ total: l,
10
+ onPrev: m,
11
+ onNext: p,
12
+ disablePrev: f,
13
+ disableNext: s,
14
+ extraActions: e,
15
+ testid: i,
16
+ fileName: t
17
+ }) {
18
+ return /* @__PURE__ */ r("div", { className: "w-full", children: /* @__PURE__ */ n(
19
+ c,
20
+ {
21
+ horizontal: !0,
22
+ items: "center",
23
+ justify: "between",
24
+ sizing: "layout-group",
25
+ testid: i ? `${i}-pdf-navigation` : void 0,
26
+ children: [
27
+ /* @__PURE__ */ n(c, { horizontal: !0, items: "center", children: [
28
+ /* @__PURE__ */ r(
29
+ o,
30
+ {
31
+ iconOnly: !0,
32
+ variant: "tertiary",
33
+ onClick: m,
34
+ leftIcon: /* @__PURE__ */ r(a, { name: "chevron_backward" }),
35
+ disabled: f,
36
+ testid: i ? `${i}-pdf-file-previous-button` : void 0
37
+ }
38
+ ),
39
+ /* @__PURE__ */ n(h, { className: "text-text-primary-normal whitespace-nowrap", children: [
40
+ d + 1,
41
+ " / ",
42
+ l
43
+ ] }),
44
+ /* @__PURE__ */ r(
45
+ o,
46
+ {
47
+ iconOnly: !0,
48
+ variant: "tertiary",
49
+ onClick: p,
50
+ rightIcon: /* @__PURE__ */ r(a, { name: "chevron_forward" }),
51
+ disabled: s,
52
+ testid: i ? `${i}-pdf-file-next-button` : void 0
53
+ }
54
+ ),
55
+ /* @__PURE__ */ r(u, { children: t?.endsWith(".pdf") ? t : `${t}.pdf` })
56
+ ] }),
57
+ e && /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: e })
58
+ ]
59
+ }
60
+ ) });
61
+ }
62
+ export {
63
+ k as PdfNavigation
64
+ };
@@ -0,0 +1,28 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { usePdf as a } from "../../node_modules/@mikecousins/react-pdf/dist/index.js";
3
+ import { useRef as i } from "react";
4
+ function p({
5
+ file: t,
6
+ pageNumber: e,
7
+ testid: o,
8
+ isMobile: s
9
+ }) {
10
+ const r = i(null), { pdfDocument: f } = a({
11
+ file: t,
12
+ page: e,
13
+ canvasRef: r,
14
+ workerSrc: "/scripts/pdf.worker.min.mjs",
15
+ scale: s ? 1 : 1.3
16
+ });
17
+ return f ? /* @__PURE__ */ n(
18
+ "canvas",
19
+ {
20
+ ref: r,
21
+ "data-testid": o,
22
+ style: { width: "100%", height: "auto" }
23
+ }
24
+ ) : null;
25
+ }
26
+ export {
27
+ p as PdfPage
28
+ };
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ import { jsx as r, jsxs as P } from "react/jsx-runtime";
3
+ import { useState as f, useCallback as D } from "react";
4
+ import { Modal as I } from "../Modal.js";
5
+ import { PDFElement as F } from "./PDFElement.js";
6
+ import { DownloadIcon as L } from "./DownloadIcon.js";
7
+ import { PdfNavigation as R } from "./PDFNavigation.js";
8
+ import { Link as U } from "../Link.js";
9
+ import { Stack as A } from "../Stack.js";
10
+ import { Caption as j } from "../Caption.js";
11
+ function G(h) {
12
+ const {
13
+ isOpen: p,
14
+ onClose: u,
15
+ encodedPdfs: e,
16
+ customActions: s,
17
+ testid: a,
18
+ isMobile: t,
19
+ title: b,
20
+ customFooter: m = !1,
21
+ withPagination: w = !0,
22
+ error: g,
23
+ showMobileDownload: k = !1
24
+ } = h, [o, c] = f(0), [v, d] = f(!1), x = D(() => {
25
+ if (d(!0), e[o].downloadURL && !e[o].base64) {
26
+ const i = document.createElement("a");
27
+ i.href = e[o].downloadURL || "", i.target = "_blank", i.rel = "noopener noreferrer", document.body.appendChild(i), i.click(), document.body.removeChild(i), d(!1);
28
+ return;
29
+ }
30
+ const n = document.createElement("a"), l = e[o];
31
+ if (!l) {
32
+ d(!1);
33
+ return;
34
+ }
35
+ n.href = l.base64 ? `data:application/pdf;base64,${l.base64}` : l.downloadURL || "", n.download = l.fileName.endsWith(".pdf") ? l.fileName : `${l.fileName}.pdf`, document.body.appendChild(n), n.click(), document.body.removeChild(n), d(!1);
36
+ }, [o, e]);
37
+ if (!e.length) return null;
38
+ function C() {
39
+ o < e.length - 1 && c((n) => n + 1);
40
+ }
41
+ function N() {
42
+ o > 0 && c((n) => n - 1);
43
+ }
44
+ function y() {
45
+ c(0), d(!1), u();
46
+ }
47
+ return /* @__PURE__ */ r(
48
+ I,
49
+ {
50
+ testid: a,
51
+ open: p,
52
+ customFooter: m,
53
+ onClose: y,
54
+ noWrapper: !0,
55
+ closeOnBackdropClick: !1,
56
+ showButtons: t ? m && !!s : !!e.length,
57
+ customActions: e.length && !t && w ? /* @__PURE__ */ r(
58
+ R,
59
+ {
60
+ testid: a,
61
+ currentIndex: o,
62
+ total: e.length,
63
+ onPrev: N,
64
+ onNext: C,
65
+ disablePrev: o === 0,
66
+ disableNext: o === e.length - 1,
67
+ extraActions: s,
68
+ fileName: e[o].fileName
69
+ }
70
+ ) : s,
71
+ headerIconAlign: "right",
72
+ headerIcon: !t || k ? /* @__PURE__ */ r(
73
+ L,
74
+ {
75
+ testid: a ? `${a}-download-icon` : void 0,
76
+ onClick: x,
77
+ isDownloading: v,
78
+ colorClassName: t ? "text-white" : void 0
79
+ }
80
+ ) : void 0,
81
+ title: t ? b ?? e[o].fileName : void 0,
82
+ size: t ? "screen" : "large",
83
+ headerClassname: "bg-brand-400 desktop:bg-background-grouped-primary-normal p-mobile-layout-padding text-brand-text-action-primary-normal",
84
+ headerIconClassname: "text-white desktop:text-icon-primary-normal",
85
+ children: !e[o].base64 && e[o].downloadURL ? /* @__PURE__ */ P(
86
+ A,
87
+ {
88
+ sizing: "layout",
89
+ justify: "center",
90
+ items: "center",
91
+ height: "full",
92
+ flexGrow: 1,
93
+ style: t ? void 0 : {
94
+ minHeight: "77dvh",
95
+ minWidth: "30dvw"
96
+ },
97
+ children: [
98
+ /* @__PURE__ */ r(j, { children: "No preview available for this document. Please follow the link below to download." }),
99
+ /* @__PURE__ */ r(
100
+ U,
101
+ {
102
+ href: e[o].downloadURL,
103
+ target: "_blank",
104
+ rel: "noopener noreferrer",
105
+ children: e[o].fileName || "Download PDF"
106
+ }
107
+ )
108
+ ]
109
+ }
110
+ ) : /* @__PURE__ */ r(
111
+ F,
112
+ {
113
+ testid: a,
114
+ b64: e[o].base64,
115
+ isMobile: t,
116
+ error: g
117
+ }
118
+ )
119
+ }
120
+ );
121
+ }
122
+ export {
123
+ G as PDFViewer
124
+ };
@@ -0,0 +1,117 @@
1
+ import { jsxs as g, jsx as n } from "react/jsx-runtime";
2
+ import { useCallback as w, useMemo as k } from "react";
3
+ import { clsx as t } from "../node_modules/clsx/dist/clsx.js";
4
+ import { Icon as f } from "./Icon.js";
5
+ import { paddingUsingComponentGap as N } from "../classNames.js";
6
+ import { Subheader as $ } from "./Subheader.js";
7
+ function S({
8
+ totalPages: o,
9
+ currentPage: e,
10
+ onPageChange: u,
11
+ id: h,
12
+ testid: d,
13
+ className: y,
14
+ disabled: s
15
+ }) {
16
+ const m = w(
17
+ (r) => {
18
+ s || u(r);
19
+ },
20
+ [u, s]
21
+ ), x = (r) => {
22
+ s || (r.key === "ArrowLeft" ? (r.preventDefault(), m(e - 1)) : r.key === "ArrowRight" && (r.preventDefault(), m(e + 1)));
23
+ }, v = k(() => {
24
+ if (o <= 5)
25
+ return Array.from({ length: o }, (a, l) => l + 1);
26
+ const r = /* @__PURE__ */ new Set();
27
+ r.add(1), r.add(o), e <= 3 ? (r.add(2), r.add(3), r.add(4)) : e >= o - 2 ? (r.add(o - 1), r.add(o - 2), r.add(o - 3)) : (r.add(e - 1), r.add(e), r.add(e + 1));
28
+ const b = Array.from(r).sort((a, l) => a - l), i = [];
29
+ for (let a = 0; a < b.length; a++) {
30
+ const l = b[a], p = b[a - 1];
31
+ a > 0 && (l - p === 2 ? i.push(p + 1) : l - p > 2 && i.push("ellipsis")), i.push(l);
32
+ }
33
+ return i;
34
+ }, [o, e]);
35
+ if (o <= 1) return null;
36
+ const c = t(
37
+ "cursor-pointer disabled:cursor-default",
38
+ N,
39
+ "w-8 h-8",
40
+ "flex items-center justify-center",
41
+ "bg-transparent",
42
+ "box-content",
43
+ "hover:bg-background-grouped-secondary-normal",
44
+ "focus:bg-background-grouped-secondary-normal focus:outline-0",
45
+ "disabled:bg-transparent disabled:text-text-action-primary-disabled"
46
+ );
47
+ return /* @__PURE__ */ g(
48
+ "nav",
49
+ {
50
+ id: h,
51
+ "data-testid": d,
52
+ "aria-label": "Pagination",
53
+ onKeyDown: x,
54
+ className: t(
55
+ "flex items-center",
56
+ "border border-border-primary-normal",
57
+ "bg-background-grouped-primary-normal",
58
+ "rounded-sm",
59
+ y
60
+ ),
61
+ children: [
62
+ /* @__PURE__ */ n(
63
+ "button",
64
+ {
65
+ "data-testid": d ? `${d}-previous-button` : void 0,
66
+ disabled: s || e <= 1,
67
+ "aria-label": "Previous page",
68
+ onClick: () => m(e - 1),
69
+ className: t(c, "border-r-1 border-border-primary-normal"),
70
+ children: /* @__PURE__ */ n(f, { name: "keyboard_arrow_left" })
71
+ }
72
+ ),
73
+ /* @__PURE__ */ n("ul", { className: t("flex items-center"), children: v.map((r, b) => {
74
+ if (r === "ellipsis")
75
+ return /* @__PURE__ */ n(
76
+ "li",
77
+ {
78
+ className: "w-8 h-8 select-none text-text-action-primary-disabled",
79
+ children: "…"
80
+ },
81
+ `ellipsis-${b}`
82
+ );
83
+ const i = r === e;
84
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
85
+ "button",
86
+ {
87
+ "data-testid": d ? `${d}-page-${r}-button` : void 0,
88
+ "aria-label": `Page ${r}`,
89
+ "aria-current": i ? "page" : void 0,
90
+ disabled: s,
91
+ onClick: () => m(r),
92
+ className: t(
93
+ c,
94
+ i && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
95
+ ),
96
+ children: /* @__PURE__ */ n($, { align: "center", weight: "bold", children: r })
97
+ }
98
+ ) }, r);
99
+ }) }),
100
+ /* @__PURE__ */ n(
101
+ "button",
102
+ {
103
+ "data-testid": d ? `${d}-next-button` : void 0,
104
+ disabled: s || e >= o,
105
+ "aria-label": "Next page",
106
+ onClick: () => m(e + 1),
107
+ className: t(c, "border-l-1 border-border-primary-normal"),
108
+ children: /* @__PURE__ */ n(f, { name: "keyboard_arrow_right" })
109
+ }
110
+ )
111
+ ]
112
+ }
113
+ );
114
+ }
115
+ export {
116
+ S as Pagination
117
+ };