@dmsi/wedgekit-react 2.0.0 → 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 (210) 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.js +405 -0
  10. package/dist/components/Caption.js +99 -0
  11. package/dist/components/Card.js +50 -0
  12. package/dist/components/Checkbox.js +108 -0
  13. package/dist/components/CompactImagesPreview.js +120 -0
  14. package/dist/components/ContentTab.js +68 -0
  15. package/dist/components/ContentTabs.js +96 -0
  16. package/dist/components/DMSiLogo.js +54 -0
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
  18. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
  19. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  20. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  21. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  22. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  23. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  24. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  26. package/dist/components/DataGrid/TableBody/index.js +161 -0
  27. package/dist/components/DataGrid/index.js +696 -0
  28. package/dist/components/DataGrid/utils.js +20 -0
  29. package/dist/components/DataGridCell.js +412 -0
  30. package/dist/components/DataTable.js +700 -0
  31. package/dist/components/DateInput.js +193 -0
  32. package/dist/components/DateRangeInput.js +368 -0
  33. package/dist/components/DebugJson.js +28 -0
  34. package/dist/components/Display.js +46 -0
  35. package/dist/components/EditingContext.js +34 -0
  36. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  37. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  38. package/dist/components/EmblaCarousel/index.js +153 -0
  39. package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
  40. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
  41. package/dist/components/EmptyCartIcon.js +25 -0
  42. package/dist/components/FilterGroup.js +198 -0
  43. package/dist/components/FullViewportBox.js +19 -0
  44. package/dist/components/Grid.js +54 -0
  45. package/dist/components/Heading.js +50 -0
  46. package/dist/components/HorizontalDivider.js +20 -0
  47. package/dist/components/Icon.js +73 -0
  48. package/dist/components/ImagePlaceholder.js +22 -0
  49. package/dist/components/Input.js +469 -0
  50. package/dist/components/InputGroup.js +45 -0
  51. package/dist/components/Label.js +37 -0
  52. package/dist/components/Link.js +69 -0
  53. package/dist/components/List.js +12 -0
  54. package/dist/components/ListGroup.js +54 -0
  55. package/dist/components/LiveChatComponent.js +25 -0
  56. package/dist/components/LoadingScrim.js +22 -0
  57. package/dist/components/LogoAgilityTopBar.js +90 -0
  58. package/dist/components/LogoDMSiTopBar.js +54 -0
  59. package/dist/components/LogoMillworkTopBar.js +196 -0
  60. package/dist/components/MainBar.js +58 -0
  61. package/dist/components/MaxViewportBox.js +19 -0
  62. package/dist/components/Menu.js +202 -0
  63. package/dist/components/MenuOption.js +161 -0
  64. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  65. package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
  66. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  67. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  68. package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
  69. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
  70. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  71. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  72. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  73. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  74. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  75. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  76. package/dist/components/MobileDataGrid/index.js +78 -0
  77. package/dist/components/MobileNavMenu.js +173 -0
  78. package/dist/components/Modal.js +201 -0
  79. package/dist/components/ModalButtons.js +57 -0
  80. package/dist/components/ModalContent.js +24 -0
  81. package/dist/components/ModalHeader.js +74 -0
  82. package/dist/components/ModalScrim.js +32 -0
  83. package/dist/components/NavigationTab.js +72 -0
  84. package/dist/components/NavigationTabs.js +45 -0
  85. package/dist/components/NestedMenu.js +119 -0
  86. package/dist/components/Notification.js +91 -0
  87. package/dist/components/OptionPill.js +103 -0
  88. package/dist/components/OrderCheckIcon.js +28 -0
  89. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  90. package/dist/components/PDFViewer/PDFElement.js +77 -0
  91. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  92. package/dist/components/PDFViewer/PDFPage.js +28 -0
  93. package/dist/components/PDFViewer/index.js +124 -0
  94. package/dist/components/Pagination.js +117 -0
  95. package/dist/components/Paragraph.js +43 -0
  96. package/dist/components/Password.js +47 -0
  97. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  98. package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
  99. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
  100. package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
  101. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  102. package/dist/components/ProductImagePreview/index.js +189 -0
  103. package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
  104. package/dist/components/ProjectBar.js +54 -0
  105. package/dist/components/Radio.js +113 -0
  106. package/dist/components/Search.js +89 -0
  107. package/dist/components/SearchResultImage/index.js +26 -0
  108. package/dist/components/Select.js +122 -0
  109. package/dist/components/SideMenu.js +24 -0
  110. package/dist/components/SideMenuGroup.js +80 -0
  111. package/dist/components/SideMenuItem.js +79 -0
  112. package/dist/components/SimpleTable.js +60 -0
  113. package/dist/components/SkeletonParagraph.js +24 -0
  114. package/dist/components/Spinner.js +30 -0
  115. package/dist/components/Stack.js +174 -0
  116. package/dist/components/StatusPill.js +44 -0
  117. package/dist/components/Stepper.js +138 -0
  118. package/dist/components/Subheader.js +41 -0
  119. package/dist/components/Surface.js +30 -0
  120. package/dist/components/Swatch.js +1498 -0
  121. package/dist/components/Textarea.js +106 -0
  122. package/dist/components/Theme.js +25 -0
  123. package/dist/components/Time.js +225 -0
  124. package/dist/components/Toast.js +170 -0
  125. package/dist/components/Tooltip.js +102 -0
  126. package/dist/components/TopBar.js +119 -0
  127. package/dist/components/Upload.js +107 -0
  128. package/dist/components/WorldpayIframe.js +19 -0
  129. package/dist/hooks/useEditCell.js +23 -0
  130. package/dist/hooks/useInfiniteScroll.js +25 -0
  131. package/dist/hooks/useKeydown.js +20 -0
  132. package/dist/hooks/useMatchesMedia.js +15 -0
  133. package/dist/hooks/useMenuSystem.js +186 -0
  134. package/dist/hooks/useMounted.js +9 -0
  135. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  136. package/dist/hooks/useTableLayout/storage.js +64 -0
  137. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  138. package/dist/index.js +249 -53839
  139. package/dist/lib/loadFonts.js +11 -0
  140. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  141. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  142. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  143. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  144. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  145. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  146. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  147. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  148. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  149. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  150. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  151. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  152. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  153. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  154. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  155. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  156. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  157. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  158. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  159. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  160. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  161. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  162. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  163. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  164. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  165. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  166. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  167. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  168. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  169. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  170. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  171. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  172. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  173. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  174. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  175. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  176. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  177. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  178. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  179. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  180. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  181. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  182. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  183. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  184. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  185. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  186. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  187. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  188. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  189. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  190. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  191. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  192. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  193. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  194. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  195. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  196. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  197. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  198. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  199. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  200. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  201. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  202. package/dist/static/no-results-image.png.js +4 -0
  203. package/dist/utils/date-patch-dashes.js +28 -0
  204. package/dist/utils/date.js +95 -0
  205. package/dist/utils/formatting.js +22 -0
  206. package/dist/utils/index.js +4 -0
  207. package/dist/utils/mergeObjectArrays.js +18 -0
  208. package/dist/utils.js +20 -0
  209. package/package.json +1 -1
  210. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,201 @@
1
+ "use client";
2
+ import { jsx as m, jsxs as I } from "react/jsx-runtime";
3
+ import { clsx as L } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useRef as x, useEffect as w, useCallback as y } from "react";
5
+ import { ModalHeader as O } from "./ModalHeader.js";
6
+ import { ModalContent as Y } from "./ModalContent.js";
7
+ import { ModalButtons as K } from "./ModalButtons.js";
8
+ import { ModalScrim as q } from "./ModalScrim.js";
9
+ import { createPortal as B } from "react-dom";
10
+ import { findDocumentRoot as G } from "../utils.js";
11
+ import { useMounted as J } from "../hooks/useMounted.js";
12
+ import N from "../node_modules/react-use/esm/usePrevious.js";
13
+ const Q = (e, t = 300) => e.animate(
14
+ [
15
+ { opacity: 0, transform: "scale(0.95)" },
16
+ { opacity: 1, transform: "scale(1)" }
17
+ ],
18
+ {
19
+ duration: t,
20
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)",
21
+ fill: "both"
22
+ }
23
+ ), U = (e, t = 200) => e.animate(
24
+ [
25
+ { opacity: 1, transform: "scale(1)" },
26
+ { opacity: 0, transform: "scale(0.95)" }
27
+ ],
28
+ {
29
+ duration: t,
30
+ easing: "ease-in-out",
31
+ fill: "both"
32
+ }
33
+ ), V = (e, t = 300) => e.animate([{ opacity: 0 }, { opacity: 1 }], {
34
+ duration: t,
35
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)",
36
+ fill: "both"
37
+ }), W = (e, t = 200) => e.animate([{ opacity: 1 }, { opacity: 0 }], {
38
+ duration: t,
39
+ easing: "ease-in-out",
40
+ fill: "both"
41
+ }), X = (e, t) => {
42
+ let a = 0;
43
+ e.forEach((r) => {
44
+ r.onfinish = () => {
45
+ a += 1, a === e.length && t();
46
+ };
47
+ });
48
+ }, $ = {
49
+ small: {
50
+ sizeClass: "h-fit max-h-dvh desktop:max-w-120 rounded-sm"
51
+ },
52
+ medium: {
53
+ sizeClass: "desktop:max-w-180 w-screen desktop:h-fit h-dvh desktop:w-full max-w-240 desktop:rounded-sm"
54
+ },
55
+ large: {
56
+ sizeClass: "desktop:max-w-240 w-screen desktop:h-fit h-dvh desktop:w-full max-w-240 desktop:rounded-sm"
57
+ },
58
+ "x-large": {
59
+ sizeClass: "desktop:max-w-300 w-screen desktop:h-fit h-dvh desktop:w-full max-w-240 desktop:rounded-sm"
60
+ },
61
+ screen: {
62
+ sizeClass: "w-screen h-dvh max-w-screen !rounded-none"
63
+ }
64
+ };
65
+ function ce({
66
+ id: e,
67
+ testid: t,
68
+ title: a,
69
+ open: r = !1,
70
+ size: l = "small",
71
+ className: g,
72
+ children: u,
73
+ onClose: n,
74
+ onContinue: M,
75
+ closeOnBackdropClick: v = !0,
76
+ showButtons: z = !1,
77
+ hideCloseIcon: C = !1,
78
+ headerIcon: A,
79
+ headerIconAlign: E,
80
+ headerIconClassname: P,
81
+ customActions: k,
82
+ headerClassname: R,
83
+ customFooter: D,
84
+ noWrapper: F,
85
+ titleAs: S,
86
+ mobileButtonStack: T = !1
87
+ }) {
88
+ const p = J(), c = x(null), i = x(null), d = N(r);
89
+ w(() => {
90
+ if (p) {
91
+ if (!c.current || !i.current) {
92
+ console.error("Modal or background reference is not set.");
93
+ return;
94
+ }
95
+ if (d !== void 0)
96
+ if (d && !r) {
97
+ const s = U(c.current), o = W(i.current);
98
+ X([s, o], () => {
99
+ n && n();
100
+ });
101
+ } else !d && r && (Q(c.current), V(i.current));
102
+ }
103
+ }, [p, n, r, d]);
104
+ const h = y(
105
+ (s) => {
106
+ s.key === "Escape" && n && (s.preventDefault(), n());
107
+ },
108
+ [n]
109
+ ), f = y(() => {
110
+ n && n();
111
+ }, [n]);
112
+ w(() => (r && document.addEventListener("keyup", h), () => {
113
+ document.removeEventListener("keyup", h);
114
+ }), [r, h]), w(() => {
115
+ if (!r) return;
116
+ const s = window.scrollY, o = document.body;
117
+ return o.style.position = "fixed", o.style.top = `-${s}px`, o.style.left = "0", o.style.right = "0", o.style.overflow = "hidden", o.style.width = "100%", () => {
118
+ o.style.position = "", o.style.top = "", o.style.left = "", o.style.right = "", o.style.overflow = "", o.style.width = "", window.scrollTo(0, s);
119
+ };
120
+ }, [r]);
121
+ const { sizeClass: j } = $[l] ?? $.small, H = y(
122
+ (s) => {
123
+ const o = s.target, b = s.currentTarget;
124
+ if (b.contains(o) && b !== o) {
125
+ s.stopPropagation();
126
+ return;
127
+ }
128
+ r && v && f();
129
+ },
130
+ [r, v, f]
131
+ );
132
+ return p ? B(
133
+ /* @__PURE__ */ m(
134
+ q,
135
+ {
136
+ id: e ? `${e}-scrim` : void 0,
137
+ testid: t ? `${t}-scrim` : void 0,
138
+ size: l,
139
+ ref: i,
140
+ show: r,
141
+ onClick: H,
142
+ children: /* @__PURE__ */ I(
143
+ "div",
144
+ {
145
+ id: e,
146
+ "data-testid": t,
147
+ ref: c,
148
+ className: L(
149
+ "shadow-md flex flex-col overflow-hidden w-full opacity-0",
150
+ l !== "screen" && "desktop:max-h-[calc(100vh-32px)] desktop:h-auto",
151
+ g,
152
+ !g?.includes("bg-") && "bg-background-grouped-primary-normal",
153
+ j
154
+ ),
155
+ onClick: (s) => s.stopPropagation(),
156
+ children: [
157
+ /* @__PURE__ */ m(
158
+ O,
159
+ {
160
+ id: e ? `${e}-header` : void 0,
161
+ testid: t ? `${t}-header` : void 0,
162
+ title: a,
163
+ onClose: f,
164
+ hideCloseIcon: C,
165
+ headerIcon: A,
166
+ headerIconAlign: E,
167
+ headerClassname: R,
168
+ headerIconClassname: P,
169
+ titleAs: S
170
+ }
171
+ ),
172
+ u && (l !== "screen" || F) ? /* @__PURE__ */ m(
173
+ Y,
174
+ {
175
+ id: e ? `${e}-content` : void 0,
176
+ testid: t ? `${t}-content` : void 0,
177
+ children: u
178
+ }
179
+ ) : u,
180
+ z ? D ? k : /* @__PURE__ */ m(
181
+ K,
182
+ {
183
+ id: e ? `${e}-buttons` : void 0,
184
+ testid: t ? `${t}-buttons` : void 0,
185
+ onClose: f,
186
+ onContinue: M,
187
+ customActions: k,
188
+ mobileButtonStack: T
189
+ }
190
+ ) : null
191
+ ]
192
+ }
193
+ )
194
+ }
195
+ ),
196
+ G(i.current)
197
+ ) : null;
198
+ }
199
+ export {
200
+ ce as Modal
201
+ };
@@ -0,0 +1,57 @@
1
+ import { jsx as e, jsxs as m, Fragment as s } from "react/jsx-runtime";
2
+ import { clsx as u } from "../node_modules/clsx/dist/clsx.js";
3
+ import { Button as r } from "./Button.js";
4
+ import { Icon as l } from "./Icon.js";
5
+ import { layoutPaddding as d, layoutGroupGap as f } from "../classNames.js";
6
+ function y({
7
+ onClose: a,
8
+ onContinue: i,
9
+ customActions: t,
10
+ id: o,
11
+ testid: n,
12
+ mobileButtonStack: c = !1
13
+ }) {
14
+ return /* @__PURE__ */ e(
15
+ "div",
16
+ {
17
+ id: o,
18
+ "data-testid": n,
19
+ className: u(
20
+ "border-t border-neutral-300 flex",
21
+ !t && "justify-end",
22
+ c && "flex-col",
23
+ d,
24
+ f
25
+ ),
26
+ children: t ?? /* @__PURE__ */ m(s, { children: [
27
+ /* @__PURE__ */ e(
28
+ r,
29
+ {
30
+ id: o ? `${o}-close-button` : void 0,
31
+ testid: n ? `${n}-close-button` : void 0,
32
+ variant: "secondary",
33
+ leftIcon: /* @__PURE__ */ e(l, { name: "close", size: 24 }),
34
+ onClick: a,
35
+ className: "max-sm:w-full",
36
+ children: "Close"
37
+ }
38
+ ),
39
+ /* @__PURE__ */ e(
40
+ r,
41
+ {
42
+ id: o ? `${o}-continue-button` : void 0,
43
+ testid: n ? `${n}-continue-button` : void 0,
44
+ variant: "primary",
45
+ leftIcon: /* @__PURE__ */ e(l, { name: "check", size: 24 }),
46
+ className: "max-sm:w-full",
47
+ onClick: i,
48
+ children: "Continue"
49
+ }
50
+ )
51
+ ] })
52
+ }
53
+ );
54
+ }
55
+ export {
56
+ y as ModalButtons
57
+ };
@@ -0,0 +1,24 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { clsx as i } from "../node_modules/clsx/dist/clsx.js";
3
+ import { layoutPaddding as m } from "../classNames.js";
4
+ function f({
5
+ children: o,
6
+ id: t,
7
+ testid: r
8
+ }) {
9
+ return /* @__PURE__ */ a(
10
+ "div",
11
+ {
12
+ id: t,
13
+ "data-testid": r,
14
+ className: i(
15
+ "flex-grow min-h-0 overflow-y-auto",
16
+ m
17
+ ),
18
+ children: o
19
+ }
20
+ );
21
+ }
22
+ export {
23
+ f as ModalContent
24
+ };
@@ -0,0 +1,74 @@
1
+ import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
+ import { Heading2 as y } from "./Heading.js";
3
+ import { Button as v } from "./Button.js";
4
+ import { Icon as x } from "./Icon.js";
5
+ import { layoutGroupGap as l, layoutPaddding as j } from "../classNames.js";
6
+ import { clsx as r } from "../node_modules/clsx/dist/clsx.js";
7
+ function k({
8
+ title: n,
9
+ hideCloseIcon: a,
10
+ headerIcon: c,
11
+ headerIconAlign: o,
12
+ onClose: m,
13
+ id: t,
14
+ testid: e,
15
+ headerClassname: f,
16
+ titleAs: d,
17
+ headerIconClassname: u
18
+ }) {
19
+ const p = d || y;
20
+ return /* @__PURE__ */ s(
21
+ "div",
22
+ {
23
+ id: t,
24
+ "data-testid": e,
25
+ className: r(
26
+ "flex items-center",
27
+ o === void 0 && "justify-between",
28
+ o === "center" && "justify-center",
29
+ o === "right" && "justify-end",
30
+ o === "left" && "justify-start",
31
+ j,
32
+ l,
33
+ f
34
+ ),
35
+ children: [
36
+ /* @__PURE__ */ s("div", { className: r("flex items-center flex-1", l), children: [
37
+ c,
38
+ n && /* @__PURE__ */ i(
39
+ p,
40
+ {
41
+ id: t ? `${t}-title` : void 0,
42
+ testid: e ? `${e}-title` : void 0,
43
+ as: "p",
44
+ children: n
45
+ }
46
+ )
47
+ ] }),
48
+ !a && /* @__PURE__ */ i(
49
+ v,
50
+ {
51
+ id: t ? `${t}-close-button` : void 0,
52
+ testid: e ? `${e}-close-button` : void 0,
53
+ iconOnly: !0,
54
+ variant: "tertiary",
55
+ onClick: m,
56
+ leftIcon: /* @__PURE__ */ i(
57
+ "span",
58
+ {
59
+ className: r(
60
+ "contents",
61
+ u ?? "text-icon-primary-normal"
62
+ ),
63
+ children: /* @__PURE__ */ i(x, { name: "close", size: 24 })
64
+ }
65
+ )
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ export {
73
+ k as ModalHeader
74
+ };
@@ -0,0 +1,32 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { clsx as p } from "../node_modules/clsx/dist/clsx.js";
3
+ function d({
4
+ show: t = !1,
5
+ size: o = "small",
6
+ children: e,
7
+ onClick: n,
8
+ ref: i,
9
+ id: r,
10
+ testid: a
11
+ }) {
12
+ return /* @__PURE__ */ s(
13
+ "div",
14
+ {
15
+ id: r,
16
+ "data-testid": a,
17
+ className: p(
18
+ "overflow-y-auto h-dvh transition-[visibility,opacity,background] ease-in-out duration-100 grid place-content-center group bg-neutral-600/50 fixed opacity-0",
19
+ !t && " pointer-events-none",
20
+ o === "small" && "p-4",
21
+ o === "screen" ? "desktop:p-0" : "desktop:p-4",
22
+ "inset-0 z-50"
23
+ ),
24
+ onMouseDown: n,
25
+ ref: i,
26
+ children: e
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ d as ModalScrim
32
+ };
@@ -0,0 +1,72 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { clsx as a } from "../node_modules/clsx/dist/clsx.js";
3
+ import { Button as y } from "./Button.js";
4
+ import { Icon as u } from "./Icon.js";
5
+ function C({
6
+ id: r,
7
+ testid: e,
8
+ label: i,
9
+ onClick: c,
10
+ selected: o = !1,
11
+ className: d,
12
+ disabled: s = !1,
13
+ href: t,
14
+ ...m
15
+ }) {
16
+ const l = a(
17
+ // "!text-text-on-action-primary-hover", // use this once semantic tokens are available
18
+ "!text-brand-text-on-action-primary-hover",
19
+ // "hover:!text-text-on-action-primary-hover", // use this once semantic tokens are available
20
+ "hover:!text-brand-text-on-action-primary-hover",
21
+ // "active:!text-text-on-action-primary-active", // use this once semantic tokens are available
22
+ "active:!text-brand-text-on-action-primary-active",
23
+ "disabled:!text-brand-text-on-action-primary-disabled"
24
+ ), p = a(
25
+ "disabled:!bg-background-on-action-primary-disabled disabled:pointer-events-none"
26
+ ), b = a(
27
+ "p-mobile-component-padding desktop:p-desktop-component-padding compact:p-desktop-compact-component-padding"
28
+ ), v = a(
29
+ "!bg-brand-200",
30
+ "hover:!bg-background-on-action-primary-normal",
31
+ // "hover:!bg-background-action-primary-normal", // use this once semantic tokens are available
32
+ "active:!bg-background-on-action-primary-active",
33
+ // "active:!bg-background-action-primary-active", // use this once semantic tokens are available
34
+ "shadow-nav-tab"
35
+ ), g = a(
36
+ "!bg-neutral-000",
37
+ "hover:!bg-background-on-action-primary-normal",
38
+ "active:!bg-background-on-action-primary-active"
39
+ ), x = {
40
+ "--color-text-on-action-primary-hover": "var(--color-brand-500)",
41
+ "--color-text-on-action-primary-active": "var(--color-brand-300)"
42
+ };
43
+ return /* @__PURE__ */ n(
44
+ y,
45
+ {
46
+ id: r,
47
+ testid: e,
48
+ variant: "tertiary-critical",
49
+ colorClassName: l,
50
+ className: a(
51
+ "!border-0 !rounded-b-none h-10 min-w-20 relative",
52
+ b,
53
+ p,
54
+ !o && v,
55
+ o && g,
56
+ d
57
+ ),
58
+ style: x,
59
+ classNameLabel: "px-1",
60
+ rightIcon: /* @__PURE__ */ n(u, { name: "close", size: 16 }),
61
+ onClick: c,
62
+ disabled: s,
63
+ ...m,
64
+ as: t ? "a" : void 0,
65
+ href: t,
66
+ children: i
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ C as NavigationTab
72
+ };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
3
+ import { clsx as v } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useState as h } from "react";
5
+ import { NavigationTab as p } from "./NavigationTab.js";
6
+ import { componentGap as x } from "../classNames.js";
7
+ function g({
8
+ id: d,
9
+ testid: t,
10
+ tabs: i,
11
+ onTabChange: l,
12
+ colorPrimitives: c = "dmsi"
13
+ }) {
14
+ const [n, s] = h(i[0]?.id ?? ""), a = (e) => {
15
+ s(e), l?.(e);
16
+ }, r = i.find((e) => e.id === n)?.content, m = i.find((e) => e.id === n)?.href;
17
+ return /* @__PURE__ */ f("div", { id: d, "data-testid": t, children: [
18
+ /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
19
+ "div",
20
+ {
21
+ className: v(
22
+ "flex items-center relative overflow-x-auto overflow-y-hidden",
23
+ x
24
+ ),
25
+ children: i.map((e) => /* @__PURE__ */ o(
26
+ p,
27
+ {
28
+ id: d ? `${d}-tab-${e.id}` : void 0,
29
+ testid: t ? `${t}-tab-${e.id}` : void 0,
30
+ label: e.label,
31
+ selected: n === e.id,
32
+ onClick: () => a(e.id),
33
+ colorPrimitives: c,
34
+ href: e.href
35
+ },
36
+ e.id
37
+ ))
38
+ }
39
+ ) }),
40
+ r && !m && /* @__PURE__ */ o("div", { className: "mt-2", children: r })
41
+ ] });
42
+ }
43
+ export {
44
+ g as NavigationTabs
45
+ };
@@ -0,0 +1,119 @@
1
+ "use client";
2
+ import { jsxs as x, jsx as o } from "react/jsx-runtime";
3
+ import C, { useMemo as g, useState as _, useEffect as y } from "react";
4
+ import { Icon as E } from "./Icon.js";
5
+ import { MenuOption as d } from "./MenuOption.js";
6
+ import { useKeydown as w } from "../hooks/useKeydown.js";
7
+ function O(m) {
8
+ const { onMenuClick: h, currentMenu: n, testid: t, pinnedEntry: i, disabled: r = !1 } = m, s = g(() => {
9
+ const e = [];
10
+ return n.removeBackOption || e.push("back"), i && e.push("pinned"), (n.subEntries || []).forEach((l, v) => {
11
+ l.children == null && e.push(v);
12
+ }), e;
13
+ }, [n, i]), b = s.findIndex((e) => typeof e == "number"), c = b >= 0 ? b : 0, [f, a] = _(c);
14
+ y(() => {
15
+ a(c);
16
+ }, [n.id, c]);
17
+ const p = (e) => f >= 0 && s[f] === e;
18
+ function k() {
19
+ i && (i.onClick ? i.onClick() : i.url && h(
20
+ { id: "__pinned__", label: i.label, url: i.url },
21
+ "url"
22
+ ));
23
+ }
24
+ w(
25
+ {
26
+ Escape: () => {
27
+ r || (a(c), u(null, !0));
28
+ },
29
+ ArrowUp: () => {
30
+ r || s.length === 0 || a(
31
+ (e) => e <= 0 ? s.length - 1 : e - 1
32
+ );
33
+ },
34
+ ArrowDown: () => {
35
+ r || s.length === 0 || a(
36
+ (e) => e >= s.length - 1 ? 0 : e + 1
37
+ );
38
+ },
39
+ // "Space" is replaced with " " to handle spacebar.
40
+ "Enter/Space": () => {
41
+ if (r) return;
42
+ const e = s[f];
43
+ if (e === "back") {
44
+ u(n.previousMenu ?? null, !0), n.previousMenu?.previousMenu || a(c);
45
+ return;
46
+ }
47
+ if (e === "pinned") {
48
+ k();
49
+ return;
50
+ }
51
+ const l = (n.subEntries || [])[e];
52
+ l && M(l);
53
+ },
54
+ Backspace: () => {
55
+ r || (u(n.previousMenu ?? null, !0), n.previousMenu?.previousMenu || a(c));
56
+ }
57
+ },
58
+ !0
59
+ );
60
+ function u(e, l = !1, v) {
61
+ h(
62
+ e && { ...e, ...!l && { previousMenu: n } },
63
+ v
64
+ );
65
+ }
66
+ function M(e) {
67
+ e.subEntries?.length ? u(e, !1, "subEntry") : e.onClick ? u(e, !1, "onClick") : u(e);
68
+ }
69
+ return /* @__PURE__ */ x("div", { className: "flex flex-col w-full", children: [
70
+ !n.removeBackOption && /* @__PURE__ */ o(
71
+ d,
72
+ {
73
+ testid: t ? `${t}-back` : void 0,
74
+ variant: "action",
75
+ disabled: r,
76
+ before: /* @__PURE__ */ o(E, { name: "chevron_left", className: "icon", size: 24 }),
77
+ onClick: () => u(n.previousMenu ?? null, !0),
78
+ selected: p("back"),
79
+ children: n.previousMenu ? n.previousMenu.label : "Main Menu"
80
+ }
81
+ ),
82
+ n.title && /* @__PURE__ */ o(
83
+ d,
84
+ {
85
+ variant: "action",
86
+ disabled: r,
87
+ testid: t ? `${t}-title` : void 0,
88
+ children: n.title
89
+ }
90
+ ),
91
+ i && /* @__PURE__ */ o(
92
+ d,
93
+ {
94
+ testid: t ? `${t}-pinned-entry` : void 0,
95
+ variant: "action",
96
+ disabled: r,
97
+ selected: p("pinned"),
98
+ onClick: k,
99
+ children: i.label
100
+ }
101
+ ),
102
+ (n.subEntries || []).map((e, l) => e.children == null ? /* @__PURE__ */ o(
103
+ d,
104
+ {
105
+ testid: t ? `${t}-${e.label}` : void 0,
106
+ variant: "normal",
107
+ disabled: r || e.disabled,
108
+ onClick: () => M(e),
109
+ after: e.subEntries?.length ? /* @__PURE__ */ o(E, { name: "chevron_right", className: "icon", size: 24 }) : void 0,
110
+ selected: p(l),
111
+ children: e.label
112
+ },
113
+ e.id
114
+ ) : /* @__PURE__ */ o(C.Fragment, { children: e.children }, e.id))
115
+ ] });
116
+ }
117
+ export {
118
+ O as NestedMenu
119
+ };