@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,106 @@
1
+ "use client";
2
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
3
+ import { clsx as a } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useState as p, useRef as y, useEffect as g } from "react";
5
+ import { componentPaddingMinusBorder as v, baseTransition as w, typography as f, componentGap as C } from "../classNames.js";
6
+ const B = a(
7
+ "w-full min-h-19",
8
+ "rounded-base border border-border-primary-normal bg-background-primary-normal caret-text-action-normal",
9
+ "outline-transparent outline-2 -outline-offset-2",
10
+ v,
11
+ w
12
+ ), F = a(
13
+ "has-[[data-error]]:border-transparent has-[[data-error]]:not-focus-within:outline-border-primary-error has-[[data-error]]:not-focus-within:outline-1"
14
+ ), k = a(
15
+ "has-[[data-focus]]:border-transparent has-[[data-focus]]:outline-border-primary-focus focus-within:border-transparent focus-within:outline-border-primary-focus"
16
+ ), E = a(
17
+ "has-disabled:bg-background-action-secondary-disabled"
18
+ ), N = a(
19
+ "has-[textarea:not(:disabled):read-only]:outline-none has-[textarea:not(:disabled):read-only]:bg-transparent has-[textarea:not(:disabled):read-only]:border-transparent has-[textarea:not(:disabled):read-only]:pl-0"
20
+ );
21
+ function T({
22
+ id: t,
23
+ testid: o,
24
+ label: s,
25
+ error: m,
26
+ caption: d,
27
+ selectOnFocus: l,
28
+ ...e
29
+ }) {
30
+ const [i, c] = p(!1), u = y(null);
31
+ g(() => {
32
+ const r = u.current, b = () => {
33
+ r?.select();
34
+ };
35
+ if (l)
36
+ return r?.addEventListener("focus", b), () => {
37
+ r?.removeEventListener("focus", b);
38
+ };
39
+ }, [l]);
40
+ const x = {
41
+ "data-error": m && !i || null,
42
+ "data-focus": i || null
43
+ };
44
+ return /* @__PURE__ */ h(
45
+ "label",
46
+ {
47
+ htmlFor: t,
48
+ className: a(
49
+ "flex flex-col w-full",
50
+ "text-text-primary-normal has-disabled:text-text-primary-disabled",
51
+ !e.disabled && !e.readOnly && "has-[[data-error]]:text-text-primary-error",
52
+ C
53
+ ),
54
+ children: [
55
+ s && /* @__PURE__ */ n(
56
+ "span",
57
+ {
58
+ className: a(
59
+ f.label,
60
+ "text-inherit",
61
+ e.disabled || e.readOnly ? "cursor-default" : "cursor-pointer",
62
+ "inline-block"
63
+ ),
64
+ children: s
65
+ }
66
+ ),
67
+ /* @__PURE__ */ n(
68
+ "textarea",
69
+ {
70
+ ...e,
71
+ ...x,
72
+ id: t,
73
+ "data-testid": o,
74
+ ref: u,
75
+ className: a(
76
+ "disabled:text-text-primary-disabled",
77
+ f.paragraph,
78
+ B,
79
+ F,
80
+ k,
81
+ E,
82
+ N
83
+ ),
84
+ onFocus: (r) => {
85
+ e.onFocus?.(r), c(!0);
86
+ },
87
+ onBlur: (r) => {
88
+ e.onBlur?.(r), c(!1);
89
+ }
90
+ }
91
+ ),
92
+ d && /* @__PURE__ */ n(
93
+ "div",
94
+ {
95
+ id: t ? `${t}-caption` : void 0,
96
+ "data-testid": o ? `${o}-caption` : void 0,
97
+ children: d
98
+ }
99
+ )
100
+ ]
101
+ }
102
+ );
103
+ }
104
+ export {
105
+ T as Textarea
106
+ };
@@ -0,0 +1,25 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ function s({
3
+ theme: e,
4
+ children: r,
5
+ id: a,
6
+ testid: n,
7
+ ref: t
8
+ }) {
9
+ return /* @__PURE__ */ m(
10
+ "div",
11
+ {
12
+ id: a,
13
+ "data-testid": n,
14
+ className: "contents",
15
+ "data-theme": e,
16
+ ref: (i) => {
17
+ t && (t.current = i);
18
+ },
19
+ children: r
20
+ }
21
+ );
22
+ }
23
+ export {
24
+ s as Theme
25
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../src/components/Time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAS/E,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,IAAI,CACN,cAAc,CAAC,OAAO,CAAC,EACvB,MAAM,GAAG,UAAU,GAAG,yBAAyB,GAAG,IAAI,CACvD,CAAC;AAOF,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAc,EAAE,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAiYnG"}
1
+ {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../src/components/Time.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAS/E,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,IAAI,CACN,cAAc,CAAC,OAAO,CAAC,EACvB,MAAM,GAAG,UAAU,GAAG,yBAAyB,GAAG,IAAI,CACvD,CAAC;AAOF,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAc,EAAE,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAiYnG"}
@@ -0,0 +1,226 @@
1
+ "use client";
2
+ import { jsxs as L, jsx as l } from "react/jsx-runtime";
3
+ import { useState as v, useRef as w, useEffect as A } from "react";
4
+ import { InputBase as Q } from "./Input.js";
5
+ import { createPortal as W } from "react-dom";
6
+ import { clsx as R } from "../node_modules/clsx/dist/clsx.js";
7
+ import { componentPadding as Z, typography as ee } from "../classNames.js";
8
+ import { Icon as te } from "./Icon.js";
9
+ import { findDocumentRoot as re } from "../utils.js";
10
+ import { Stack as ne } from "./Stack.js";
11
+ const U = "overflow-auto max-h-full py-4 no-scrollbar w-12 desktop:w-10";
12
+ function he({ onChange: P, format: V = "12h", id: a, testid: f, wrapperClassName: $, ...c }) {
13
+ const [i, h] = v(!1), [T, j] = v(!1), y = w(null), D = w(null), x = w(null), [N, H] = v({ top: 0, left: 0, width: 0 }), [s, k] = v(null), [p, I] = v(null), [d, S] = v(null), [X, O] = v(""), C = w(/* @__PURE__ */ new Set()), n = V === "12h", b = s && p ? n ? d ? `${s}:${p} ${d}` : `${s}:${p}` : `${s}:${p}` : "", Y = () => {
14
+ const r = y.current?.parentElement ?? D.current;
15
+ if (r) {
16
+ const e = r.getBoundingClientRect();
17
+ H({
18
+ top: e.bottom + window.scrollY + 4,
19
+ left: e.left + window.scrollX,
20
+ width: e.width
21
+ });
22
+ }
23
+ };
24
+ A(() => {
25
+ i && Y();
26
+ }, [i, n]), A(() => {
27
+ i && n && d === null && S("AM");
28
+ }, [i, n, d]), A(() => {
29
+ const r = (e) => {
30
+ y.current && x.current && !y.current.contains(e.target) && !x.current.contains(e.target) && h(!1);
31
+ };
32
+ return i && document.addEventListener("mousedown", r), () => {
33
+ document.removeEventListener("mousedown", r);
34
+ };
35
+ }, [i, n]), A(() => {
36
+ b && T && (O(b), P?.({
37
+ target: { value: b }
38
+ }));
39
+ }, [b, T, P]);
40
+ const _ = () => {
41
+ !c.disabled && !c.readOnly && (j(!0), h(!0), C.current = /* @__PURE__ */ new Set(), n && d === null && S("AM"));
42
+ }, z = (r, e) => {
43
+ r === "hour" && k(e), r === "minute" && I(e), r === "meridiem" && S(e), C.current.add(r), setTimeout(() => {
44
+ (n ? ["hour", "minute", "meridiem"] : ["hour", "minute"]).every((o) => C.current.has(o)) && h(!1);
45
+ }, 100);
46
+ };
47
+ A(() => {
48
+ !i && b && O(b);
49
+ }, [i, b]);
50
+ const G = (r) => {
51
+ const e = r.target.value.toUpperCase().replace(/[^0-9:APM ]/gi, "").trim();
52
+ O(e), e === "" && (k(null), I(null), S(null), h(!0), C.current = /* @__PURE__ */ new Set());
53
+ const t = e.match(
54
+ n ? /^(\d{1,2}):(\d{2})\s*(AM|PM)$/i : /^(\d{1,2}):(\d{2})$/
55
+ );
56
+ if (t) {
57
+ const [, o, u, M] = t, m = parseInt(o, 10), F = parseInt(u, 10);
58
+ if (m >= 0 && m <= 23 && F >= 0 && F <= 59) {
59
+ let E;
60
+ const K = F.toString().padStart(2, "0");
61
+ let B = M;
62
+ n ? (E = (m % 12 || 12).toString().padStart(2, "0"), m > 12 && (B = "PM"), k(E), I(K), B && S(B)) : (E = m.toString().padStart(2, "0"), k(E), I(K));
63
+ }
64
+ }
65
+ P?.(r);
66
+ }, g = {
67
+ hour: w(null),
68
+ minute: w(null),
69
+ meridiem: w(null)
70
+ }, J = (r) => {
71
+ if (r.key === "Enter") {
72
+ h(!1);
73
+ return;
74
+ }
75
+ if (r.key !== "ArrowUp" && r.key !== "ArrowDown") return;
76
+ r.preventDefault();
77
+ let e, t, o;
78
+ if (s === null || p === null || n && d === null) {
79
+ const m = /* @__PURE__ */ new Date();
80
+ e = m.getHours(), t = Math.round(m.getMinutes() / 5) * 5, t === 60 && (t = 0, e += 1), n ? (o = e >= 12 ? "PM" : "AM", e = e % 12 || 12) : o = "AM";
81
+ } else
82
+ e = parseInt(s, 10), t = parseInt(p, 10), o = d || "AM";
83
+ const u = 5, M = t % u;
84
+ t += r.key === "ArrowDown" ? M === 0 ? u : u - M : -(M === 0 ? u : M), t >= 60 ? (t -= 60, e += 1) : t < 0 && (t += 60, e -= 1), n ? e > 12 ? (e = 1, o = o === "AM" ? "PM" : "AM") : e <= 0 && (e = 12, o = o === "AM" ? "PM" : "AM") : e = (e + 24) % 24, k(e.toString().padStart(2, "0")), I(t.toString().padStart(2, "0")), n && S(o);
85
+ };
86
+ A(() => {
87
+ i && setTimeout(() => {
88
+ g.hour.current?.scrollIntoView({
89
+ block: "nearest",
90
+ behavior: "instant"
91
+ }), g.minute.current?.scrollIntoView({
92
+ block: "nearest",
93
+ behavior: "instant"
94
+ }), n && g.meridiem.current?.scrollIntoView({
95
+ block: "nearest",
96
+ behavior: "instant"
97
+ });
98
+ }, 0);
99
+ }, [
100
+ i,
101
+ n,
102
+ g.hour,
103
+ g.minute,
104
+ g.meridiem
105
+ ]);
106
+ const q = (r, e) => r.map((t) => {
107
+ const o = e === "hour" && t === s || e === "minute" && t === p || e === "meridiem" && t === d;
108
+ return /* @__PURE__ */ l(
109
+ oe,
110
+ {
111
+ id: a ? `${a}-${e}-${t}` : void 0,
112
+ testid: f ? `${f}-${e}-${t}` : void 0,
113
+ selected: o,
114
+ ref: o ? (u) => {
115
+ g[e].current = u;
116
+ } : null,
117
+ onClick: () => z(e, t),
118
+ className: R(Z, "cursor-pointer", ee.caption),
119
+ children: t
120
+ },
121
+ t
122
+ );
123
+ });
124
+ return /* @__PURE__ */ L("div", { className: R("relative max-w-38", $), children: [
125
+ /* @__PURE__ */ l(
126
+ Q,
127
+ {
128
+ ...c,
129
+ id: a,
130
+ testid: f,
131
+ ref: y,
132
+ inputContainerRef: D,
133
+ value: X,
134
+ placeholder: n ? "hh:mm am" : "hh:mm",
135
+ after: /* @__PURE__ */ l("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ l(te, { name: "schedule" }) }),
136
+ onFocus: _,
137
+ caption: c.caption,
138
+ onChange: G,
139
+ onKeyDown: J,
140
+ type: "text"
141
+ }
142
+ ),
143
+ i && W(
144
+ /* @__PURE__ */ l(
145
+ ne,
146
+ {
147
+ id: a ? `${a}-timepicker` : void 0,
148
+ elevation: 4,
149
+ height: 240,
150
+ position: "absolute",
151
+ backgroundColor: "background-grouped-primary-normal",
152
+ overflowX: "hidden",
153
+ overflowY: "hidden",
154
+ zIndex: 50,
155
+ top: N.top,
156
+ left: N.left,
157
+ width: "fit",
158
+ rounded: !0,
159
+ children: /* @__PURE__ */ L("div", { ref: x, className: "px-4 flex justify-center h-60", children: [
160
+ /* @__PURE__ */ l("div", { className: R(U), children: q(
161
+ Array.from(
162
+ { length: n ? 12 : 24 },
163
+ (r, e) => (e + (n ? 1 : 0)).toString().padStart(2, "0")
164
+ ),
165
+ "hour"
166
+ ) }),
167
+ /* @__PURE__ */ l("div", { className: R(U), children: q(
168
+ Array.from(
169
+ { length: 12 },
170
+ (r, e) => (e * 5).toString().padStart(2, "0")
171
+ ),
172
+ "minute"
173
+ ) }),
174
+ n && /* @__PURE__ */ l("div", { className: "py-4 w-12 desktop:w-10", children: q(["AM", "PM"], "meridiem") })
175
+ ] })
176
+ }
177
+ ),
178
+ re(x.current)
179
+ )
180
+ ] });
181
+ }
182
+ function oe({
183
+ id: P,
184
+ testid: V,
185
+ selected: a = !1,
186
+ start: f = !1,
187
+ intermediate: $ = !1,
188
+ end: c = !1,
189
+ today: i = !1,
190
+ disabled: h = !1,
191
+ onClick: T,
192
+ onHover: j,
193
+ onKeyDown: y,
194
+ children: D,
195
+ className: x,
196
+ ref: N,
197
+ ...H
198
+ }) {
199
+ return /* @__PURE__ */ l(
200
+ "button",
201
+ {
202
+ id: P,
203
+ "data-testid": V,
204
+ onPointerOver: j,
205
+ onClick: T,
206
+ onKeyDown: y,
207
+ disabled: h,
208
+ ref: N,
209
+ className: R(
210
+ "w-full aspect-square flex items-center justify-center",
211
+ !a && !f && !$ && !c && !i && "text-text-primary-normal hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover active:text-text-action-primary-active disabled:text-text-primary-disabled disabled:pointer-events-none rounded",
212
+ i && !a && !f && !$ && !c && "rounded-full border border-border-primary-normal hover:bg-background-action-secondary-hover hover:text-text-action-primary-hover active:text-text-action-primary-active disabled:text-text-primary-disabled",
213
+ a && "text-text-on-action-primary-normal bg-background-action-primary-normal hover:bg-background-action-primary-hover active:bg-background-action-primary-active disabled:text-text-primary-disabled disabled:bg-neutral-200 rounded",
214
+ f && "bg-background-action-primary-normal hover:bg-background-action-primary-hover active:bg-background-action-primary-active disabled:text-text-primary-disabled disabled:bg-neutral-200 rounded-l",
215
+ c && "bg-background-action-primary-normal hover:bg-background-action-primary-hover active:bg-background-action-primary-active disabled:text-text-primary-disabled disabled:bg-neutral-200 rounded-r",
216
+ $ && "bg-action-100 border-y border-action-400",
217
+ x
218
+ ),
219
+ ...H,
220
+ children: D
221
+ }
222
+ );
223
+ }
224
+ export {
225
+ he as Time
226
+ };
@@ -0,0 +1,170 @@
1
+ "use client";
2
+ import { jsxs as p, jsx as o } from "react/jsx-runtime";
3
+ import { clsx as h } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useRef as m, useEffect as b } from "react";
5
+ import { useMatchesMobile as E } from "../hooks/useMatchesMedia.js";
6
+ import { Heading3 as B } from "./Heading.js";
7
+ import { Paragraph as O } from "./Paragraph.js";
8
+ import { Icon as d } from "./Icon.js";
9
+ import { Button as z } from "./Button.js";
10
+ import { createRoot as L } from "react-dom/client";
11
+ import { componentGap as Y, layoutGroupGap as M, componentPadding as D } from "../classNames.js";
12
+ const R = {
13
+ success: {
14
+ className: "border-background-success-normal",
15
+ icon: /* @__PURE__ */ o("span", { className: "text-icon-success-normal contents", children: /* @__PURE__ */ o(d, { name: "check_circle", size: 24 }) })
16
+ },
17
+ warning: {
18
+ className: "border-background-warning-normal",
19
+ icon: /* @__PURE__ */ o("span", { className: "text-icon-warning-normal contents", children: /* @__PURE__ */ o(d, { name: "warning", size: 24 }) })
20
+ },
21
+ error: {
22
+ className: "border-border-action-critical-normal",
23
+ icon: /* @__PURE__ */ o("span", { className: "text-icon-critical-normal contents", children: /* @__PURE__ */ o(d, { name: "error", size: 24 }) })
24
+ },
25
+ info: {
26
+ className: "border-border-action-normal",
27
+ icon: /* @__PURE__ */ o("span", { className: "text-icon-on-action-secondary-normal contents", children: /* @__PURE__ */ o(d, { name: "info", size: 24 }) })
28
+ }
29
+ }, U = 8e3, G = 50, H = 50, P = (e, n = !1, r = U, t = G, a = H) => {
30
+ const s = t + r + a, c = e.getBoundingClientRect(), i = n ? -(c.top + 16) : window.innerHeight - c.bottom + 16;
31
+ return e.animate(
32
+ [
33
+ { opacity: 0, transform: `translateY(${i}px)`, offset: 0 },
34
+ { opacity: 1, transform: "translateY(0)", offset: t / s },
35
+ { opacity: 1, transform: "translateY(0)", offset: (t + r) / s },
36
+ { opacity: 0, transform: `translateY(${i}px)`, offset: 1 }
37
+ ],
38
+ {
39
+ duration: s,
40
+ easing: "cubic-bezier(0.4, 0, 0.2, 1)",
41
+ fill: "both"
42
+ }
43
+ );
44
+ }, y = "toast-root";
45
+ function S() {
46
+ const r = `${window.matchMedia("(width < 48rem)").matches ? "fixed top-mobile-container-padding left-1/2 -translate-x-1/2 items-center" : "fixed bottom-desktop-container-padding right-desktop-container-padding items-end"} z-50 flex flex-col gap-4 pointer-events-none`;
47
+ let t = document.getElementById(y);
48
+ return t || (t = document.createElement("div"), t.id = y, document.body.appendChild(t)), t.className = r, t;
49
+ }
50
+ function V({
51
+ id: e,
52
+ testid: n,
53
+ variant: r = "success",
54
+ title: t,
55
+ message: a,
56
+ show: s = !1,
57
+ showToast: c = !1,
58
+ // deprecated
59
+ onClose: i,
60
+ viewButtonLink: I,
61
+ viewButtonLabel: A = "View",
62
+ showViewButton: T = !1,
63
+ ...v
64
+ }) {
65
+ const u = m(null), l = m(null), f = E(), g = m(i);
66
+ b(() => {
67
+ g.current = i;
68
+ }, [i]);
69
+ const N = m(f);
70
+ b(() => {
71
+ N.current = f;
72
+ }, [f]);
73
+ const w = m(!1);
74
+ b(() => {
75
+ if (s && !c) {
76
+ if (u.current) {
77
+ const x = P(u.current, N.current === !0);
78
+ l.current = x, x.onfinish = () => {
79
+ g.current?.();
80
+ };
81
+ }
82
+ return () => {
83
+ l.current?.cancel();
84
+ };
85
+ }
86
+ }, [s, c]);
87
+ const _ = () => {
88
+ w.current = !0, l.current?.pause();
89
+ }, $ = () => {
90
+ w.current = !1, l.current?.playState === "paused" && l.current.play();
91
+ }, { className: k, icon: C } = R[r] ?? R.success;
92
+ return s ? /* @__PURE__ */ p(
93
+ "div",
94
+ {
95
+ id: e,
96
+ "data-testid": n,
97
+ ref: u,
98
+ onMouseEnter: _,
99
+ onMouseLeave: $,
100
+ className: h(
101
+ "flex items-start border-2 rounded-sm bg-background-grouped-primary-normal shadow-16 cursor-pointer pointer-events-auto transition-colors w-fit",
102
+ D,
103
+ M,
104
+ k
105
+ ),
106
+ ...v,
107
+ style: v.style,
108
+ children: [
109
+ C,
110
+ /* @__PURE__ */ p("div", { className: h("flex items-center", M), children: [
111
+ /* @__PURE__ */ p("div", { className: h("flex flex-col w-68", Y), children: [
112
+ t && /* @__PURE__ */ o(
113
+ B,
114
+ {
115
+ testid: n ? `${n}-title` : void 0,
116
+ id: e ? `${e}-title` : void 0,
117
+ children: t
118
+ }
119
+ ),
120
+ a && /* @__PURE__ */ o(
121
+ O,
122
+ {
123
+ testid: n ? `${n}-message` : void 0,
124
+ id: e ? `${e}-message` : void 0,
125
+ children: a
126
+ }
127
+ )
128
+ ] }),
129
+ T && /* @__PURE__ */ o(
130
+ z,
131
+ {
132
+ id: e ? `${e}-view-button` : void 0,
133
+ testid: n ? `${n}-view-button` : void 0,
134
+ variant: "tertiary",
135
+ href: I,
136
+ children: A
137
+ }
138
+ )
139
+ ] })
140
+ ]
141
+ }
142
+ ) : null;
143
+ }
144
+ function te(e) {
145
+ const n = S(), r = document.createElement("div");
146
+ n.appendChild(r);
147
+ const t = L(r), a = () => {
148
+ t.unmount(), r.remove();
149
+ };
150
+ t.render(
151
+ /* @__PURE__ */ o(
152
+ V,
153
+ {
154
+ id: e.id,
155
+ testid: e.testid,
156
+ show: !0,
157
+ onClose: a,
158
+ variant: e.variant,
159
+ title: e.title,
160
+ message: e.message,
161
+ showViewButton: e.showViewButton,
162
+ viewButtonLink: e.viewButtonLink
163
+ }
164
+ )
165
+ );
166
+ }
167
+ export {
168
+ V as Toast,
169
+ te as createToast
170
+ };
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsxs as L, jsx as $ } from "react/jsx-runtime";
3
+ import { clsx as q } from "../node_modules/clsx/dist/clsx.js";
4
+ import { useRef as g, useState as d, useEffect as v } from "react";
5
+ import { createPortal as z } from "react-dom";
6
+ import { typography as F, componentPadding as j } from "../classNames.js";
7
+ import { useMatchesMobile as A } from "../hooks/useMatchesMedia.js";
8
+ function W({
9
+ id: c,
10
+ testid: l,
11
+ message: b,
12
+ position: w = "top",
13
+ children: x,
14
+ showOnTruncation: p = !1,
15
+ offset: s = 8,
16
+ keepHidden: y = !1
17
+ }) {
18
+ const o = g(null), a = g(null), [f, M] = d({ top: 0, left: 0 }), [i, m] = d(!1), [R, h] = d(!1), u = () => {
19
+ if (!o.current || !a.current) return;
20
+ const e = o.current.getBoundingClientRect(), t = a.current.getBoundingClientRect();
21
+ let n = 0, r = 0;
22
+ switch (w) {
23
+ case "top":
24
+ n = e.top - t.height - s, r = e.left + e.width / 2 - t.width / 2;
25
+ break;
26
+ case "bottom":
27
+ n = e.bottom + s, r = e.left + e.width / 2 - t.width / 2;
28
+ break;
29
+ case "left":
30
+ n = e.top + e.height / 2 - t.height / 2, r = e.left - t.width - s;
31
+ break;
32
+ case "right":
33
+ n = e.top + e.height / 2 - t.height / 2, r = e.right + s;
34
+ break;
35
+ }
36
+ M({ top: n, left: r }), requestAnimationFrame(() => {
37
+ h(!0);
38
+ });
39
+ }, k = () => {
40
+ (!p || T()) && m(!0);
41
+ }, E = () => {
42
+ m(!1), h(!1);
43
+ };
44
+ v(() => {
45
+ i && a.current && requestAnimationFrame(() => {
46
+ u();
47
+ });
48
+ }, [i]), v(() => {
49
+ if (i)
50
+ return window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
51
+ }, [i]);
52
+ const P = A();
53
+ return /* @__PURE__ */ L(
54
+ "div",
55
+ {
56
+ id: c,
57
+ "data-testid": l,
58
+ ref: o,
59
+ className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
60
+ onMouseEnter: k,
61
+ onMouseLeave: E,
62
+ children: [
63
+ x,
64
+ !y && i && !P && typeof document < "u" && z(
65
+ /* @__PURE__ */ $(
66
+ "div",
67
+ {
68
+ id: c ? `${c}-message` : void 0,
69
+ "data-testid": l ? `${l}-message` : void 0,
70
+ ref: a,
71
+ style: {
72
+ position: "fixed",
73
+ top: `${f.top}px`,
74
+ left: `${f.left}px`,
75
+ zIndex: 9999
76
+ },
77
+ className: q(
78
+ F.caption,
79
+ "bg-neutral-500 text-neutral-100 rounded whitespace-nowrap shadow-2 pointer-events-none transition-opacity duration-100 ease-in-out",
80
+ j,
81
+ !R && "opacity-0"
82
+ ),
83
+ children: b
84
+ }
85
+ ),
86
+ document.body
87
+ )
88
+ ]
89
+ }
90
+ );
91
+ function T() {
92
+ if (p && o.current) {
93
+ const e = o.current.querySelector("p, a");
94
+ if (e)
95
+ return e.scrollWidth > e.clientWidth;
96
+ }
97
+ return !1;
98
+ }
99
+ }
100
+ export {
101
+ W as Tooltip
102
+ };