@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,18 @@
1
+ import { jsxs as a } from "react/jsx-runtime";
2
+ import { Paragraph as i } from "../../Paragraph.js";
3
+ import { formatDate as l } from "../../../utils/date.js";
4
+ function f(o) {
5
+ const { column: t, data: e } = o;
6
+ let r;
7
+ return t.id && (r = e[t.id], t.meta?.format === "date" && typeof r == "string" && (r = l(r))), /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-2 flex-1", children: [
8
+ /* @__PURE__ */ a(i, { color: "text-secondary-normal", className: "text-left", children: [
9
+ t.header?.toString(),
10
+ ":"
11
+ ] }),
12
+ " ",
13
+ r || null
14
+ ] });
15
+ }
16
+ export {
17
+ f as MobileDataGridColumn
18
+ };
@@ -0,0 +1,130 @@
1
+ import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
+ import { Icon as C } from "../../Icon.js";
3
+ import { Paragraph as x } from "../../Paragraph.js";
4
+ import { Stack as t } from "../../Stack.js";
5
+ import { useGridContext as $ } from "../GridContextProvider/useGridContext.js";
6
+ import { Checkbox as k } from "../../Checkbox.js";
7
+ import { clsx as z } from "../../../node_modules/clsx/dist/clsx.js";
8
+ import { MobileDataGridColumn as v } from "./MobileDataGridColumn.js";
9
+ import { Subheader as G } from "../../Subheader.js";
10
+ import { layoutGroupGap as N, layoutPaddingX as P, paddingYUsingLayoutGroupGap as S } from "../../../classNames.js";
11
+ function L({
12
+ renderLink: c,
13
+ renderChevron: g = !0,
14
+ data: i,
15
+ enableRowSelection: h,
16
+ selected: p,
17
+ rowActions: l,
18
+ index: u
19
+ }) {
20
+ const m = $(), { id: a, testid: d, visibleColumns: f, getId: s, handleRowSelect: b, openRowDetail: y } = m;
21
+ return /* @__PURE__ */ n(
22
+ "li",
23
+ {
24
+ id: a ? `${a}-card-${s(i)}` : void 0,
25
+ "data-testid": d ? `${d}-card-${s(i)}` : void 0,
26
+ className: z(
27
+ "flex flex-col",
28
+ "last:rounded-b",
29
+ "hover:bg-action-100 cursor-pointer list-none",
30
+ p ? "bg-action-100" : u % 2 === 0 ? "bg-background-grouped-primary-normal" : "bg-background-grouped-secondary-normal",
31
+ N,
32
+ P,
33
+ S
34
+ ),
35
+ onClick: (e) => {
36
+ const r = e.target.tagName;
37
+ r === "INPUT" || r === "SELECT" || r === "BUTTON" || r === "TEXTAREA" || y(i);
38
+ },
39
+ children: [
40
+ /* @__PURE__ */ n(t, { sizing: "component", children: [
41
+ /* @__PURE__ */ n(t, { horizontal: !0, horizontalMobile: !0, items: "center", justify: "between", children: [
42
+ h && /* @__PURE__ */ o(
43
+ t,
44
+ {
45
+ sizing: "component",
46
+ padding: !0,
47
+ width: "fit",
48
+ style: { paddingLeft: 0, paddingRight: 8 },
49
+ onClick: (e) => e.stopPropagation(),
50
+ children: /* @__PURE__ */ o(
51
+ k,
52
+ {
53
+ id: a ? `${a}-${s(i)}-select-checkbox` : void 0,
54
+ testid: d ? `${d}-${s(i)}-select-checkbox` : void 0,
55
+ checked: p,
56
+ onChange: () => b(i)
57
+ }
58
+ )
59
+ }
60
+ ),
61
+ /* @__PURE__ */ o(
62
+ t,
63
+ {
64
+ sizing: "component",
65
+ padding: !0,
66
+ onClick: (e) => e.stopPropagation(),
67
+ style: { paddingInline: 0 },
68
+ children: c ? c(i) : /* @__PURE__ */ o(G, { children: String(i[m.primaryKey] ?? "") })
69
+ }
70
+ ),
71
+ /* @__PURE__ */ o(
72
+ t,
73
+ {
74
+ horizontal: !0,
75
+ horizontalMobile: !0,
76
+ items: "center",
77
+ justify: "end",
78
+ sizing: "component",
79
+ onClick: (e) => e.stopPropagation(),
80
+ children: l && (typeof l == "function" ? l(i) : l)
81
+ }
82
+ )
83
+ ] }),
84
+ /* @__PURE__ */ o(t, { sizing: "layout-group", children: f.filter((e) => e.meta?.visible !== !1 && !e.id?.startsWith("__")).map(
85
+ (e, r) => e.meta?.useCustomRenderer && e.meta.mobileCell && e.id ? /* @__PURE__ */ n(
86
+ "div",
87
+ {
88
+ className: "grid grid-cols-2 gap-2 items-center flex-1",
89
+ children: [
90
+ /* @__PURE__ */ n(
91
+ x,
92
+ {
93
+ color: "text-secondary-normal",
94
+ className: "text-left",
95
+ children: [
96
+ e.header?.toString(),
97
+ ":"
98
+ ]
99
+ }
100
+ ),
101
+ " ",
102
+ /* @__PURE__ */ o(
103
+ e.meta.mobileCell,
104
+ {
105
+ column: e,
106
+ row: i,
107
+ cellValue: i[e.id]
108
+ }
109
+ )
110
+ ]
111
+ },
112
+ `${e.id}-${r}`
113
+ ) : /* @__PURE__ */ o(
114
+ v,
115
+ {
116
+ column: e,
117
+ data: i
118
+ },
119
+ `${e.id}-${r}`
120
+ )
121
+ ) })
122
+ ] }),
123
+ g && /* @__PURE__ */ o(t, { items: "center", justify: "center", horizontal: !0, horizontalMobile: !0, children: /* @__PURE__ */ o("span", { className: "text-icon-primary-normal", children: /* @__PURE__ */ o(C, { name: "keyboard_arrow_down" }) }) })
124
+ ]
125
+ }
126
+ );
127
+ }
128
+ export {
129
+ L as MobileDataGridCard
130
+ };
@@ -0,0 +1,67 @@
1
+ import { jsx as e, jsxs as p } from "react/jsx-runtime";
2
+ import { Checkbox as u } from "../Checkbox.js";
3
+ import { Heading3 as g } from "../Heading.js";
4
+ import { Stack as c } from "../Stack.js";
5
+ import { Theme as b } from "../Theme.js";
6
+ import { ColumnSelector as x } from "./ColumnSelector/index.js";
7
+ import { useGridContext as y } from "./GridContextProvider/useGridContext.js";
8
+ function j({
9
+ header: t,
10
+ enableColumnSelector: a,
11
+ enableRowSelection: m
12
+ }) {
13
+ const l = y(), {
14
+ id: r,
15
+ testid: o,
16
+ selectedRowIds: i,
17
+ data: d,
18
+ primaryKey: n,
19
+ columns: s,
20
+ handleRowSelectAll: h
21
+ } = l;
22
+ return typeof t > "u" && !n ? null : typeof t == "function" ? /* @__PURE__ */ e(t, { ...l }) : typeof t == "string" || n ? /* @__PURE__ */ e(
23
+ "div",
24
+ {
25
+ id: r ? `${r}-header` : void 0,
26
+ "data-testid": o ? `${o}-header` : void 0,
27
+ className: "sticky top-0",
28
+ children: /* @__PURE__ */ e(b, { theme: "brand", children: /* @__PURE__ */ p(
29
+ c,
30
+ {
31
+ horizontal: !0,
32
+ horizontalMobile: !0,
33
+ items: "center",
34
+ justify: "between",
35
+ backgroundColor: "background-primary-normal",
36
+ children: [
37
+ m && /* @__PURE__ */ e("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit self-stretch flex items-center", children: /* @__PURE__ */ e(
38
+ u,
39
+ {
40
+ id: r ? `${r}-select-all-checkbox` : void 0,
41
+ testid: o ? `${o}-select-all-checkbox` : void 0,
42
+ checked: i.length === d.length,
43
+ indeterminate: !!i.length && i.length !== d.length,
44
+ onChange: h
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ e(
48
+ c,
49
+ {
50
+ horizontal: !0,
51
+ horizontalMobile: !0,
52
+ items: "center",
53
+ sizing: "component",
54
+ padding: !0,
55
+ children: /* @__PURE__ */ e(g, { as: "span", color: "text-primary-normal", children: typeof t == "string" ? t : s.find((f) => f.id === n)?.header?.toString() })
56
+ }
57
+ ),
58
+ a && /* @__PURE__ */ e(x, {})
59
+ ]
60
+ }
61
+ ) })
62
+ }
63
+ ) : null;
64
+ }
65
+ export {
66
+ j as MobileDataGridHeader
67
+ };
@@ -0,0 +1,42 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { Paragraph as l } from "../../Paragraph.js";
3
+ import { Stack as d } from "../../Stack.js";
4
+ import { useGridContext as m } from "../GridContextProvider/useGridContext.js";
5
+ import { MobileDataGridColumn as n } from "../MobileDataGridCard/MobileDataGridColumn.js";
6
+ function h() {
7
+ const a = m(), { columns: s, currentRow: r } = a;
8
+ return r ? /* @__PURE__ */ e(d, { sizing: "layout-group", children: s.filter((t) => !t.id?.startsWith("__")).map(
9
+ (t, i) => t.meta?.useCustomRenderer && t.meta.mobileCell && t.id ? /* @__PURE__ */ o(
10
+ "div",
11
+ {
12
+ className: "grid grid-cols-2 gap-2 items-center flex-1",
13
+ children: [
14
+ /* @__PURE__ */ o(l, { color: "text-secondary-normal", className: "text-left", children: [
15
+ t.header?.toString(),
16
+ ":"
17
+ ] }),
18
+ " ",
19
+ /* @__PURE__ */ e(
20
+ t.meta.mobileCell,
21
+ {
22
+ column: t,
23
+ row: r,
24
+ cellValue: r?.[t.id]
25
+ }
26
+ )
27
+ ]
28
+ },
29
+ `${t.id}-${i}`
30
+ ) : /* @__PURE__ */ e(
31
+ n,
32
+ {
33
+ column: t,
34
+ data: r
35
+ },
36
+ `${t.id}-${i}`
37
+ )
38
+ ) }) : null;
39
+ }
40
+ export {
41
+ h as ModalContent
42
+ };
@@ -0,0 +1,58 @@
1
+ import { jsx as o, jsxs as a } from "react/jsx-runtime";
2
+ import { Button as r } from "../../Button.js";
3
+ import { Heading2 as m } from "../../Heading.js";
4
+ import { Icon as d } from "../../Icon.js";
5
+ import { Modal as u } from "../../Modal.js";
6
+ import { Stack as f } from "../../Stack.js";
7
+ import { useGridContext as p } from "../GridContextProvider/useGridContext.js";
8
+ import { ModalContent as h } from "./ModalContent.js";
9
+ function I() {
10
+ const n = p(), {
11
+ id: t,
12
+ testid: i,
13
+ isRowDetailOpen: l,
14
+ currentRow: s,
15
+ primaryKey: c,
16
+ closeRowDetail: e
17
+ } = n;
18
+ return /* @__PURE__ */ o(
19
+ u,
20
+ {
21
+ open: l,
22
+ onClose: e,
23
+ hideCloseIcon: !0,
24
+ size: "medium",
25
+ className: "!p-0",
26
+ headerIcon: /* @__PURE__ */ a(
27
+ f,
28
+ {
29
+ horizontal: !0,
30
+ horizontalMobile: !0,
31
+ items: "center",
32
+ justify: "between",
33
+ width: "full",
34
+ children: [
35
+ /* @__PURE__ */ o(m, { children: s?.[c ?? "id"] ?? "Grid Detail" }),
36
+ /* @__PURE__ */ o(
37
+ r,
38
+ {
39
+ id: t ? `${t}-close-button` : void 0,
40
+ testid: i ? `${i}-close-button` : void 0,
41
+ iconOnly: !0,
42
+ variant: "tertiary",
43
+ onClick: e,
44
+ leftIcon: /* @__PURE__ */ o("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ o(d, { name: "close", size: 24 }) })
45
+ }
46
+ )
47
+ ]
48
+ }
49
+ ),
50
+ customActions: /* @__PURE__ */ o(r, { onClick: e, className: "w-full", children: "Close" }),
51
+ showButtons: !0,
52
+ children: /* @__PURE__ */ o("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ o(h, {}) })
53
+ }
54
+ );
55
+ }
56
+ export {
57
+ I as RowDetailModalProvider
58
+ };
@@ -0,0 +1,28 @@
1
+ function p(d, r) {
2
+ const { type: t, payload: i } = r;
3
+ let e = null;
4
+ switch (r.type === "INSERT" && r.pos === "INDEX" && (e = r.index), r.type === "UPDATE" && (e = r.index ?? d.filter(({ id: n }) => !!n).findIndex(({ id: n }) => n === r.id)), t) {
5
+ case "SET":
6
+ return [...i];
7
+ case "UPDATE":
8
+ if (typeof e != "number" || e < 0)
9
+ throw new Error("action.(id | index) must be provided.");
10
+ return [
11
+ ...d.slice(0, e),
12
+ {
13
+ ...d[e],
14
+ ...i,
15
+ meta: {
16
+ ...d[e].meta ?? {},
17
+ ...i.meta ?? {}
18
+ }
19
+ },
20
+ ...d.slice(e + 1)
21
+ ];
22
+ default:
23
+ throw new Error("Action type not implemented.");
24
+ }
25
+ }
26
+ export {
27
+ p as dataGridReducer
28
+ };
@@ -0,0 +1,78 @@
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import { MobileDataGridHeader as x } from "./MobileDataGridHeader.js";
3
+ import { GridContextProvider as y } from "./GridContextProvider/index.js";
4
+ import { RowDetailModalProvider as D } from "./RowDetailModalProvider/index.js";
5
+ import { ColumnList as G } from "./ColumnList.js";
6
+ import { Stack as M } from "../Stack.js";
7
+ function L(i) {
8
+ const {
9
+ columns: t,
10
+ data: d,
11
+ renderLink: n,
12
+ renderChevron: l,
13
+ getId: m,
14
+ id: a,
15
+ testid: f,
16
+ enableColumnSelector: s,
17
+ enableRowSelection: e,
18
+ header: h,
19
+ withBorder: u = !0,
20
+ footer: c,
21
+ onRowSelect: p,
22
+ numberOfColumnsToShow: w,
23
+ primaryKey: b,
24
+ hideHeader: v,
25
+ rowActions: C,
26
+ rounded: S = !0
27
+ } = i;
28
+ return /* @__PURE__ */ o(
29
+ y,
30
+ {
31
+ initialColumns: t,
32
+ id: a,
33
+ testid: f,
34
+ data: d,
35
+ getId: m,
36
+ onRowSelect: p,
37
+ numberOfColumnsToShow: w,
38
+ primaryKey: b,
39
+ children: [
40
+ /* @__PURE__ */ o(
41
+ M,
42
+ {
43
+ height: "full",
44
+ rounded: S,
45
+ overflowX: "hidden",
46
+ overflowY: "hidden",
47
+ className: u ? "border border-border-primary-normal" : void 0,
48
+ children: [
49
+ !v && /* @__PURE__ */ r(
50
+ x,
51
+ {
52
+ header: h,
53
+ enableColumnSelector: s,
54
+ enableRowSelection: e
55
+ }
56
+ ),
57
+ /* @__PURE__ */ r(
58
+ G,
59
+ {
60
+ withBorder: !1,
61
+ renderLink: n,
62
+ renderChevron: l,
63
+ enableRowSelection: e,
64
+ footer: c,
65
+ rowActions: C
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ ),
71
+ /* @__PURE__ */ r(D, {})
72
+ ]
73
+ }
74
+ );
75
+ }
76
+ export {
77
+ L as MobileDataGrid
78
+ };
@@ -0,0 +1,173 @@
1
+ "use client";
2
+ import { jsxs as a, Fragment as N, jsx as n } from "react/jsx-runtime";
3
+ import { useState as g, useRef as $, useLayoutEffect as I, useEffect as w } from "react";
4
+ import { createPortal as j } from "react-dom";
5
+ import { NestedMenu as A } from "./NestedMenu.js";
6
+ import { MenuOption as D } from "./MenuOption.js";
7
+ import { Icon as m } from "./Icon.js";
8
+ import { Stack as k } from "./Stack.js";
9
+ import { Button as H } from "./Button.js";
10
+ import { Heading1 as L } from "./Heading.js";
11
+ import { Theme as R } from "./Theme.js";
12
+ import { useMounted as X } from "../hooks/useMounted.js";
13
+ import { useKeydown as Y } from "../hooks/useKeydown.js";
14
+ import { findDocumentRoot as K } from "../utils.js";
15
+ import { clsx as v } from "../node_modules/clsx/dist/clsx.js";
16
+ function te({
17
+ id: c,
18
+ testid: o,
19
+ currentMenu: i,
20
+ open: r,
21
+ onClose: l,
22
+ onNavigate: h,
23
+ direction: b = "left",
24
+ footer: E,
25
+ hideFooterOnSubMenu: x = !1,
26
+ theme: C = "brand",
27
+ pinnedSubMenuEntry: M
28
+ }) {
29
+ const [s, d] = g(
30
+ null
31
+ ), [y, u] = g(0), z = X(), p = $(null), S = {
32
+ transform: r ? "translateX(0)" : b === "right" ? "translateX(100%)" : "translateX(-100%)"
33
+ };
34
+ I(() => {
35
+ r && (d(null), u(0));
36
+ }, [r]), Y(
37
+ {
38
+ ArrowUp: () => {
39
+ const e = i.subEntries?.length || 0;
40
+ e !== 0 && u((t) => t <= 0 ? e - 1 : t - 1);
41
+ },
42
+ ArrowDown: () => {
43
+ const e = i.subEntries?.length || 0;
44
+ e !== 0 && u((t) => t >= e - 1 ? 0 : t + 1);
45
+ },
46
+ "Enter/Space": () => {
47
+ const e = (i.subEntries || [])[y];
48
+ e && f(
49
+ e,
50
+ e.subEntries?.length ? "subEntry" : e.onClick ? "onClick" : void 0
51
+ );
52
+ }
53
+ },
54
+ r && !s
55
+ ), w(() => {
56
+ if (!r) return;
57
+ const e = window.scrollY, t = document.body;
58
+ return t.style.position = "fixed", t.style.top = `-${e}px`, t.style.left = "0", t.style.right = "0", t.style.overflow = "hidden", t.style.width = "100%", () => {
59
+ t.style.position = "", t.style.top = "", t.style.left = "", t.style.right = "", t.style.overflow = "", t.style.width = "", window.scrollTo(0, e);
60
+ };
61
+ }, [r]), w(() => {
62
+ const e = (t) => {
63
+ t.key === "Escape" && l();
64
+ };
65
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
66
+ }, [l]);
67
+ function f(e, t) {
68
+ if (!e) {
69
+ d(null);
70
+ return;
71
+ }
72
+ if (e.subEntries?.length && t !== "onClick") {
73
+ d(e);
74
+ return;
75
+ }
76
+ if (e.onClick && t === "onClick") {
77
+ h?.(e), e.onClick();
78
+ return;
79
+ }
80
+ e.url && (h?.(e), l());
81
+ }
82
+ return z ? j(
83
+ /* @__PURE__ */ a(N, { children: [
84
+ /* @__PURE__ */ n(
85
+ "div",
86
+ {
87
+ className: v(
88
+ "fixed inset-0 z-40 bg-black/50",
89
+ "transition-opacity duration-300",
90
+ r ? "opacity-100" : "opacity-0 pointer-events-none"
91
+ ),
92
+ onClick: l,
93
+ "aria-hidden": "true"
94
+ }
95
+ ),
96
+ /* @__PURE__ */ a(
97
+ "div",
98
+ {
99
+ id: c,
100
+ "data-testid": o,
101
+ ref: p,
102
+ role: "dialog",
103
+ "aria-modal": "true",
104
+ className: v(
105
+ "fixed top-0 z-50 h-dvh w-full max-w-sm flex flex-col",
106
+ "bg-background-grouped-primary-normal overflow-hidden",
107
+ "transition-transform duration-300 ease-in-out",
108
+ b === "right" ? "right-0" : "left-0"
109
+ ),
110
+ style: S,
111
+ children: [
112
+ /* @__PURE__ */ n(R, { theme: C, children: /* @__PURE__ */ a(
113
+ k,
114
+ {
115
+ horizontal: !0,
116
+ horizontalMobile: !0,
117
+ padding: !0,
118
+ sizing: "layout",
119
+ items: "center",
120
+ justify: "between",
121
+ backgroundColor: "background-primary-normal",
122
+ children: [
123
+ /* @__PURE__ */ n(L, { color: "text-primary-normal", children: s?.label ?? i.label }),
124
+ /* @__PURE__ */ n(
125
+ H,
126
+ {
127
+ id: c ? `${c}-close-button` : void 0,
128
+ testid: o ? `${o}-close-button` : void 0,
129
+ iconOnly: !0,
130
+ leftIcon: /* @__PURE__ */ n(m, { className: "icon", name: "close", size: 24 }),
131
+ variant: "tertiary",
132
+ onClick: l
133
+ }
134
+ )
135
+ ]
136
+ }
137
+ ) }),
138
+ /* @__PURE__ */ a(k, { justify: "between", overflowY: "auto", grow: !0, children: [
139
+ /* @__PURE__ */ n("div", { className: "my-4", children: s ? /* @__PURE__ */ n(
140
+ A,
141
+ {
142
+ testid: o ? `${o}-nested-menu` : void 0,
143
+ currentMenu: s,
144
+ onMenuClick: f,
145
+ pinnedEntry: M
146
+ }
147
+ ) : (i.subEntries ?? []).map((e, t) => /* @__PURE__ */ n(
148
+ D,
149
+ {
150
+ testid: o ? `${o}-${e.id}` : void 0,
151
+ selected: y === t,
152
+ onClick: () => f(
153
+ e,
154
+ e.subEntries?.length ? "subEntry" : e.onClick ? "onClick" : void 0
155
+ ),
156
+ before: e.icon ? /* @__PURE__ */ n(m, { name: e.icon }) : void 0,
157
+ after: e.subEntries?.length ? /* @__PURE__ */ n(m, { name: "chevron_right", className: "icon", size: 24 }) : void 0,
158
+ children: e.label
159
+ },
160
+ e.id
161
+ )) }),
162
+ (!x || !s) && E
163
+ ] })
164
+ ]
165
+ }
166
+ )
167
+ ] }),
168
+ K(p.current)
169
+ ) : null;
170
+ }
171
+ export {
172
+ te as MobileNavMenu
173
+ };