@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,193 @@
1
+ import { jsxs as F, jsx as f, Fragment as j } from "react/jsx-runtime";
2
+ import { useState as h, useRef as P, useEffect as R, useLayoutEffect as q } from "react";
3
+ import { createPortal as X } from "react-dom";
4
+ import { InputBase as G } from "./Input.js";
5
+ import { CalendarRange as U } from "./CalendarRange.js";
6
+ import { Icon as _ } from "./Icon.js";
7
+ import { findDocumentRoot as H } from "../utils.js";
8
+ import { isValidDate as g, calculateCursorPosition as J } from "../utils/date.js";
9
+ import { formatDateWithDashes as Q, formatInputValueWithDashes as B, parseInputDateWithDashes as b } from "../utils/date-patch-dashes.js";
10
+ import { marginTopUsingComponentGap as Z } from "../classNames.js";
11
+ function me({
12
+ id: o,
13
+ testid: w,
14
+ value: S,
15
+ onChange: D,
16
+ placeholder: T = "MM/DD/YYYY",
17
+ disabled: Y,
18
+ readOnly: d = !1,
19
+ label: M,
20
+ isDateAvailable: $,
21
+ disableManualInput: z,
22
+ theme: K,
23
+ ...W
24
+ }) {
25
+ const [v, s] = h(!1), [y, p] = h(""), [k, i] = h(!1), C = P(null), n = P(null), I = P(null), [E, A] = h({
26
+ top: 0,
27
+ left: 0,
28
+ width: 0
29
+ }), l = S;
30
+ R(() => {
31
+ k || p(L(l));
32
+ }, [l, k]), q(() => {
33
+ v && c();
34
+ }, [v]);
35
+ const c = () => {
36
+ if (I.current) {
37
+ const e = I.current.getBoundingClientRect();
38
+ A({
39
+ top: e.bottom + window.scrollY,
40
+ left: e.left + window.scrollX,
41
+ width: e.width
42
+ });
43
+ }
44
+ };
45
+ R(() => {
46
+ c();
47
+ const e = new ResizeObserver(c);
48
+ return n.current && e.observe(n.current), window.addEventListener("scroll", c), () => {
49
+ e.disconnect(), window.removeEventListener("scroll", c);
50
+ };
51
+ }, []), R(() => {
52
+ const e = (t) => {
53
+ t.key === "Escape" && C.current && (s(!1), n.current?.blur());
54
+ };
55
+ return document.addEventListener("keydown", e), () => {
56
+ document.removeEventListener("keydown", e);
57
+ };
58
+ });
59
+ function N(e) {
60
+ D(e), s(!1), i(!1);
61
+ }
62
+ const V = () => {
63
+ d || s(!0);
64
+ };
65
+ return /* @__PURE__ */ F("div", { className: "relative", children: [
66
+ /* @__PURE__ */ f(
67
+ G,
68
+ {
69
+ id: o,
70
+ testid: w,
71
+ ref: (e) => {
72
+ n.current = e;
73
+ },
74
+ ...W,
75
+ wrapperRef: I,
76
+ value: y,
77
+ placeholder: T,
78
+ disabled: Y,
79
+ readOnly: d,
80
+ after: /* @__PURE__ */ f(_, { name: "calendar_month" }),
81
+ onFocus: z ? (e) => {
82
+ e.preventDefault(), e.stopPropagation(), e.currentTarget.blur();
83
+ } : V,
84
+ onClick: () => {
85
+ V();
86
+ },
87
+ onChange: (e) => {
88
+ if (d) return;
89
+ const t = e.target.value, r = e.target.selectionStart || 0;
90
+ i(!0);
91
+ const a = B(t);
92
+ p(a), requestAnimationFrame(() => {
93
+ if (n.current) {
94
+ const m = J(
95
+ t,
96
+ a,
97
+ r
98
+ );
99
+ n.current.setSelectionRange(m, m);
100
+ }
101
+ });
102
+ const u = b(a);
103
+ u && g(u) && D(u);
104
+ },
105
+ onBlur: () => {
106
+ i(!1);
107
+ const e = b(y);
108
+ (!e || !g(e)) && p(L(l));
109
+ },
110
+ onKeyDown: (e) => {
111
+ if (e.key === "Backspace") {
112
+ const t = e.target, r = t.selectionStart || 0, a = t.value;
113
+ if (r > 0 && a[r - 1] === "/") {
114
+ e.preventDefault();
115
+ const u = a.slice(0, r - 2) + a.slice(r), m = B(u);
116
+ p(m), requestAnimationFrame(() => {
117
+ if (n.current) {
118
+ const x = Math.max(0, r - 2);
119
+ n.current.setSelectionRange(x, x);
120
+ }
121
+ }), i(!0);
122
+ return;
123
+ }
124
+ }
125
+ if (e.key === "Enter") {
126
+ const t = b(y);
127
+ t && g(t) && (D(t), s(!1), i(!1));
128
+ }
129
+ },
130
+ label: M,
131
+ secondaryIconColor: !0
132
+ }
133
+ ),
134
+ v && !d && X(
135
+ /* @__PURE__ */ F(j, { children: [
136
+ /* @__PURE__ */ f(
137
+ "div",
138
+ {
139
+ className: "fixed inset-0 z-30",
140
+ onClick: () => s(!1),
141
+ onMouseDown: (e) => {
142
+ e.preventDefault();
143
+ },
144
+ onWheel: (e) => {
145
+ const t = document.scrollingElement ?? document.documentElement;
146
+ t.scrollTop += e.deltaY, t.scrollLeft += e.deltaX;
147
+ },
148
+ onTouchMove: (e) => {
149
+ e.stopPropagation();
150
+ },
151
+ style: { touchAction: "pan-y pan-x" },
152
+ "aria-hidden": "true"
153
+ }
154
+ ),
155
+ /* @__PURE__ */ f(
156
+ "div",
157
+ {
158
+ ref: (e) => {
159
+ C.current = e;
160
+ },
161
+ className: `absolute z-50 ${Z}`,
162
+ "data-theme": K,
163
+ style: {
164
+ top: `${E.top}px`,
165
+ left: `${E.left}px`
166
+ },
167
+ children: /* @__PURE__ */ f(
168
+ U,
169
+ {
170
+ id: o ? `${o}-calendar` : void 0,
171
+ testid: w ? `${w}-calendar` : void 0,
172
+ from: l,
173
+ to: l,
174
+ onChange: N,
175
+ cardStyle: !0,
176
+ mode: "single",
177
+ disableRange: !0,
178
+ isDateAvailable: $
179
+ }
180
+ )
181
+ }
182
+ )
183
+ ] }),
184
+ H(C.current)
185
+ )
186
+ ] });
187
+ }
188
+ function L(o) {
189
+ return !o || !g(o) ? "" : Q(o);
190
+ }
191
+ export {
192
+ me as DateInput
193
+ };
@@ -0,0 +1,368 @@
1
+ import { jsxs as ht, Fragment as Dt, jsx as B } from "react/jsx-runtime";
2
+ import { useState as O, useRef as W, useEffect as K, useLayoutEffect as $t } from "react";
3
+ import { createPortal as wt } from "react-dom";
4
+ import { InputBase as gt } from "./Input.js";
5
+ import { CalendarRange as yt } from "./CalendarRange.js";
6
+ import { Icon as Pt } from "./Icon.js";
7
+ import { findDocumentRoot as St } from "../utils.js";
8
+ import { parseInputDate as d, isValidDate as g, formatDate as z, isValidDateRangeOrder as Vt, formatInputValue as H, calculateCursorPosition as Mt } from "../utils/date.js";
9
+ import { marginTopUsingComponentGap as Ft } from "../classNames.js";
10
+ import { useMatchesMobile as Yt } from "../hooks/useMatchesMedia.js";
11
+ function jt({
12
+ id: o,
13
+ testid: i,
14
+ value: V,
15
+ onChange: r,
16
+ placeholder: p = "MM/DD/YYYY - MM/DD/YYYY",
17
+ disabled: Y,
18
+ readOnly: y = !1,
19
+ single: k = !1,
20
+ disableRange: a = !1,
21
+ label: E,
22
+ isDateAvailable: $,
23
+ onPendingFromChange: Q,
24
+ theme: Z,
25
+ ...tt
26
+ }) {
27
+ const et = Yt(), [j, M] = O(!1), [v, u] = O(""), [X, h] = O(!1), A = W(null), N = W(null), l = W(null), [b, nt] = O({
28
+ top: 0,
29
+ left: 0,
30
+ width: 0
31
+ }), [q, L] = V.split("|");
32
+ K(() => {
33
+ if (!X) {
34
+ const t = J(q, L);
35
+ t && u(t);
36
+ }
37
+ }, [q, L, X, a]), $t(() => {
38
+ j && R();
39
+ }, [j]);
40
+ const R = () => {
41
+ if (N.current) {
42
+ const t = N.current.getBoundingClientRect();
43
+ nt({
44
+ top: t.bottom + window.scrollY,
45
+ left: t.left + window.scrollX,
46
+ width: t.width
47
+ });
48
+ }
49
+ };
50
+ K(() => {
51
+ R();
52
+ const t = new ResizeObserver(R);
53
+ return l.current && t.observe(l.current), window.addEventListener("scroll", R), () => {
54
+ t.disconnect(), window.removeEventListener("scroll", R);
55
+ };
56
+ }, []), K(() => {
57
+ const t = (e) => {
58
+ e.key === "Escape" && A.current && (M(!1), l.current?.blur());
59
+ };
60
+ return document.addEventListener("keydown", t), () => {
61
+ document.removeEventListener("keydown", t);
62
+ };
63
+ }, []), K(() => {
64
+ const t = (e) => {
65
+ A.current && !A.current.contains(e.target) && l.current && !l.current.contains(e.target) && M(!1);
66
+ };
67
+ return document.addEventListener("mousedown", t), () => {
68
+ document.removeEventListener("mousedown", t);
69
+ };
70
+ }, []);
71
+ function rt(t, e) {
72
+ r(a ? `${t}|${t}` : `${t}|${e}`), M(!1), h(!1);
73
+ }
74
+ const _ = () => {
75
+ y || M(!0);
76
+ }, st = () => {
77
+ _();
78
+ }, ot = (t) => {
79
+ if (y) return;
80
+ const e = t.target.value, s = t.target.selectionStart || 0;
81
+ if (ct(e)) {
82
+ it(e, s);
83
+ return;
84
+ }
85
+ h(!0);
86
+ const n = F(e), c = at(n, e) ? `${n} - ` : n;
87
+ u(c);
88
+ const f = lt(
89
+ e,
90
+ n,
91
+ c,
92
+ s
93
+ );
94
+ requestAnimationFrame(() => {
95
+ C(f);
96
+ }), ut(c);
97
+ }, ct = (t) => !a && t.includes("-") && !t.includes(" - "), it = (t, e) => {
98
+ const s = t.replace(/-/g, ""), n = F(s);
99
+ u(n), requestAnimationFrame(() => {
100
+ const c = Math.min(
101
+ e - 1,
102
+ n.length
103
+ );
104
+ C(c);
105
+ });
106
+ }, at = (t, e) => {
107
+ if (a || t.includes(" - ") || !t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/) || e.length !== t.length)
108
+ return !1;
109
+ const n = e.length - 1;
110
+ return !F(e.slice(0, n)).match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
111
+ }, lt = (t, e, s, n) => s !== e ? s.length : It(
112
+ t,
113
+ s,
114
+ n,
115
+ a
116
+ ), C = (t) => {
117
+ l.current && l.current.setSelectionRange(t, t);
118
+ }, ut = (t) => {
119
+ a ? ft(t) : dt(t);
120
+ }, ft = (t) => {
121
+ const e = d(t);
122
+ e && g(e) && r(`${e}|${e}`);
123
+ }, dt = (t) => {
124
+ if (t === "") {
125
+ r("");
126
+ return;
127
+ }
128
+ const e = t.match(/^(.+?)\s*-\s*(.+)$/);
129
+ e ? mt(e) : pt(t);
130
+ }, mt = (t) => {
131
+ const [, e, s] = t, n = d(e.trim()), c = d(s.trim());
132
+ n && c && T(n, c) && r(`${n}|${c}`);
133
+ }, pt = (t) => {
134
+ const e = d(t);
135
+ e && g(e) && r(`${e}|`);
136
+ };
137
+ return /* @__PURE__ */ ht(Dt, { children: [
138
+ /* @__PURE__ */ B(
139
+ gt,
140
+ {
141
+ id: o,
142
+ testid: i,
143
+ ref: (t) => {
144
+ l.current = t;
145
+ },
146
+ ...tt,
147
+ wrapperRef: N,
148
+ value: v,
149
+ placeholder: a ? "MM/DD/YYYY" : p,
150
+ disabled: Y,
151
+ readOnly: y,
152
+ after: /* @__PURE__ */ B(Pt, { name: "calendar_month" }),
153
+ onFocus: _,
154
+ onClick: st,
155
+ onChange: ot,
156
+ onBlur: () => {
157
+ if (h(!1), a) {
158
+ const t = d(v);
159
+ if (!t || !g(t)) {
160
+ const e = J(q, L);
161
+ u(e || "");
162
+ }
163
+ } else {
164
+ const t = v.match(/^(.+?)\s*-\s*(.+)$/);
165
+ if (t) {
166
+ const [, e, s] = t, n = d(e.trim()), c = d(s.trim());
167
+ (!n || !c || !T(n, c)) && (u(""), r(""));
168
+ } else if (v.includes(" - "))
169
+ u(""), r("");
170
+ else {
171
+ const e = d(v);
172
+ !e || g(e), u(""), r("");
173
+ }
174
+ }
175
+ },
176
+ onKeyDown: (t) => {
177
+ if (!a && t.key === "-") {
178
+ t.preventDefault();
179
+ return;
180
+ }
181
+ if (t.key === "Backspace") {
182
+ const e = t.target, s = e.selectionStart || 0, n = e.value;
183
+ if (s > 0 && n[s - 1] === "/") {
184
+ t.preventDefault();
185
+ const c = n.slice(0, s - 2) + n.slice(s), f = F(c);
186
+ u(f), requestAnimationFrame(() => {
187
+ if (l.current) {
188
+ const I = Math.max(0, s - 2);
189
+ l.current.setSelectionRange(I, I);
190
+ }
191
+ }), h(!0);
192
+ return;
193
+ }
194
+ if (!a && n.includes(" - ")) {
195
+ const c = n.indexOf(" - "), f = c, I = c + 3;
196
+ if (s >= f && s <= I) {
197
+ t.preventDefault();
198
+ const w = n.slice(0, f).trim(), P = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
199
+ if (P) {
200
+ const [, m, D, S] = P, G = S.slice(0, -1), U = `${m}/${D}/${G}`, x = F(U);
201
+ u(x), r(""), requestAnimationFrame(() => {
202
+ l.current && l.current.setSelectionRange(
203
+ x.length,
204
+ x.length
205
+ );
206
+ });
207
+ } else {
208
+ const m = F(w);
209
+ u(m);
210
+ const D = d(w);
211
+ D && g(D) ? r(`${D}|`) : r(""), requestAnimationFrame(() => {
212
+ if (l.current) {
213
+ const S = m.length;
214
+ l.current.setSelectionRange(S, S);
215
+ }
216
+ });
217
+ }
218
+ h(!0);
219
+ return;
220
+ }
221
+ if (s === I) {
222
+ t.preventDefault();
223
+ const w = n.slice(0, f).trim(), P = `${w} - `;
224
+ u(P);
225
+ const m = d(w);
226
+ m && g(m) && r(`${m}|`), requestAnimationFrame(() => {
227
+ l.current && l.current.setSelectionRange(
228
+ P.length,
229
+ P.length
230
+ );
231
+ }), h(!0);
232
+ return;
233
+ }
234
+ }
235
+ }
236
+ if (t.key === "Delete") {
237
+ const e = t.target, s = e.selectionStart || 0, n = e.value;
238
+ if (!a && n.includes(" - ")) {
239
+ const c = n.indexOf(" - "), f = c, I = c + 3;
240
+ if (s >= f && s <= I) {
241
+ t.preventDefault();
242
+ const w = n.slice(0, f).trim(), P = w.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);
243
+ if (P) {
244
+ const [, m, D, S] = P, G = S.slice(0, -1), U = `${m}/${D}/${G}`, x = F(U);
245
+ u(x), r(""), requestAnimationFrame(() => {
246
+ l.current && l.current.setSelectionRange(
247
+ x.length,
248
+ x.length
249
+ );
250
+ });
251
+ } else {
252
+ const m = F(w);
253
+ u(m);
254
+ const D = d(w);
255
+ D && g(D) ? r(`${D}|`) : r(""), requestAnimationFrame(() => {
256
+ if (l.current) {
257
+ const S = m.length;
258
+ l.current.setSelectionRange(S, S);
259
+ }
260
+ });
261
+ }
262
+ h(!0);
263
+ return;
264
+ }
265
+ }
266
+ }
267
+ if (t.key === "Enter")
268
+ if (a) {
269
+ const e = d(v);
270
+ e && g(e) && (r(`${e}|${e}`), M(!1), h(!1));
271
+ } else {
272
+ const e = v.match(/^(.+?)\s*-\s*(.+)$/);
273
+ if (e) {
274
+ const [, s, n] = e, c = d(s.trim()), f = d(n.trim());
275
+ c && f && T(c, f) ? (r(`${c}|${f}`), M(!1), h(!1)) : (u(""), r(""), M(!1), h(!1));
276
+ } else
277
+ u(""), r(""), M(!1), h(!1);
278
+ }
279
+ },
280
+ label: E,
281
+ secondaryIconColor: !0
282
+ }
283
+ ),
284
+ j && !y && wt(
285
+ /* @__PURE__ */ B(
286
+ "div",
287
+ {
288
+ ref: (t) => {
289
+ A.current = t;
290
+ },
291
+ className: `absolute z-40 ${Ft}`,
292
+ "data-theme": Z,
293
+ style: {
294
+ top: `${b.top}px`,
295
+ left: `${b.left}px`,
296
+ minWidth: `${b.width}px`
297
+ },
298
+ children: /* @__PURE__ */ B(
299
+ yt,
300
+ {
301
+ id: o ? `${o}-calendar` : void 0,
302
+ testid: i ? `${i}-calendar` : void 0,
303
+ from: q,
304
+ to: L,
305
+ onChange: rt,
306
+ cardStyle: !0,
307
+ mode: k || et ? "single" : "double",
308
+ disableRange: a,
309
+ isDateAvailable: $,
310
+ onPendingFromChange: Q
311
+ }
312
+ )
313
+ }
314
+ ),
315
+ St(A.current)
316
+ )
317
+ ] });
318
+ function F(t) {
319
+ return vt(t, a);
320
+ }
321
+ function J(t, e) {
322
+ return xt(t, e, a);
323
+ }
324
+ }
325
+ function T(o, i) {
326
+ return Vt(o, i);
327
+ }
328
+ function vt(o, i) {
329
+ if (i)
330
+ return H(o);
331
+ if (o.includes(" - ")) {
332
+ const [r, p] = o.split(" - "), Y = H(r), y = H(p || "");
333
+ return `${Y} - ${y}`;
334
+ }
335
+ const V = o.replace(/-/g, "");
336
+ return H(V);
337
+ }
338
+ function It(o, i, V, r) {
339
+ if (!r && i.includes(" - ")) {
340
+ const p = i.indexOf(" - "), Y = o.indexOf("-");
341
+ if (Y !== -1 && V > Y) {
342
+ const y = o.slice(Y + 1).replace(/\D/g, "").length, k = i.slice(p + 3);
343
+ let a = p + 3, E = 0;
344
+ for (let $ = 0; $ < k.length; $++) {
345
+ if (/\d/.test(k[$]) && (E++, E >= y)) {
346
+ $ + 1 < k.length && k[$ + 1] === "/" ? a = p + 3 + $ + 2 : a = p + 3 + $ + 1;
347
+ break;
348
+ }
349
+ E < y && (a = p + 3 + $ + 1);
350
+ }
351
+ return Math.min(a, i.length);
352
+ }
353
+ }
354
+ return Mt(
355
+ o,
356
+ i,
357
+ V
358
+ );
359
+ }
360
+ function xt(o, i, V) {
361
+ if (!o && !i)
362
+ return "";
363
+ const r = o ? g(o) : !1, p = i ? g(i) : !1;
364
+ return V ? r && o ? z(o) : "" : r && p && o && i && T(o, i) ? `${z(o)} - ${z(i)}` : r && !i && o ? `${z(o)} - ` : "";
365
+ }
366
+ export {
367
+ jt as DateRangeInput
368
+ };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsxs as l, jsx as n } from "react/jsx-runtime";
3
+ import { useState as d } from "react";
4
+ function p({ data: o, id: e }) {
5
+ const [r, t] = d(!1);
6
+ return process.env.NODE_ENV !== "development" ? null : /* @__PURE__ */ l(
7
+ "div",
8
+ {
9
+ id: e,
10
+ className: "p-2 rounded bg-neutral-100 border border-red-500 my-4",
11
+ children: [
12
+ /* @__PURE__ */ n(
13
+ "button",
14
+ {
15
+ id: e ? `${e}-toggle-button` : void 0,
16
+ onClick: () => t((s) => !s),
17
+ className: "px-4 py-2 border rounded bg-white",
18
+ children: r ? "Hide JSON" : "Show JSON"
19
+ }
20
+ ),
21
+ r && /* @__PURE__ */ n("pre", { className: "mt-4", children: JSON.stringify(o, null, 4) })
22
+ ]
23
+ }
24
+ );
25
+ }
26
+ export {
27
+ p as DebugJson
28
+ };
@@ -0,0 +1,46 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { clsx as y } from "../node_modules/clsx/dist/clsx.js";
3
+ import { typography as c } from "../classNames.js";
4
+ function a({
5
+ className: t,
6
+ children: o,
7
+ as: s,
8
+ color: l,
9
+ align: e,
10
+ variant: i = "display1",
11
+ id: m,
12
+ testid: p,
13
+ ...n
14
+ }) {
15
+ return /* @__PURE__ */ r(
16
+ s ?? (i === "display1" ? "h1" : "h2"),
17
+ {
18
+ id: m,
19
+ "data-testid": p,
20
+ className: y(
21
+ c[i],
22
+ t,
23
+ e === "left" && "text-left",
24
+ e === "center" && "text-center",
25
+ e === "right" && "text-right"
26
+ ),
27
+ style: {
28
+ ...n.style,
29
+ color: l ? `var(--color-${l})` : void 0
30
+ },
31
+ ...n,
32
+ children: o
33
+ }
34
+ );
35
+ }
36
+ function E(t) {
37
+ return /* @__PURE__ */ r(a, { ...t, variant: "display1" });
38
+ }
39
+ function v(t) {
40
+ return /* @__PURE__ */ r(a, { ...t, variant: "display2" });
41
+ }
42
+ export {
43
+ a as Display,
44
+ E as Display1,
45
+ v as Display2
46
+ };
@@ -0,0 +1,34 @@
1
+ "use client";
2
+ import { jsx as l } from "react/jsx-runtime";
3
+ import { createContext as m, useState as g, useContext as b } from "react";
4
+ const s = m(null), p = ({
5
+ data: e,
6
+ children: a
7
+ }) => {
8
+ const [u, r] = g(e), c = {
9
+ data: u,
10
+ setData: (t, i, o) => {
11
+ r((d) => {
12
+ const n = [...d], x = typeof n[t]?.[i] == "number" && !isNaN(Number(o)) ? Number(o) : o;
13
+ return n[t] = {
14
+ ...n[t],
15
+ [i]: x
16
+ }, n;
17
+ });
18
+ },
19
+ setBulkData: (t) => {
20
+ r(t);
21
+ }
22
+ };
23
+ return /* @__PURE__ */ l(s.Provider, { value: c, children: a });
24
+ }, D = () => {
25
+ const e = b(s);
26
+ if (!e)
27
+ throw new Error("useTableEditingContext must be used within EditingProvider");
28
+ return e;
29
+ };
30
+ export {
31
+ s as EditingContext,
32
+ p as EditingProvider,
33
+ D as useTableEditingContext
34
+ };