@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,190 @@
1
+ "use client";
2
+ import { jsx as r, jsxs as v } from "react/jsx-runtime";
3
+ import { Thumbnail as x } from "./Thumbnail.js";
4
+ import { Stack as $ } from "../Stack.js";
5
+ import { Grid as D } from "../Grid.js";
6
+ import { ProductPrimaryImage as G } from "./ProductPrimaryImage.js";
7
+ import { ZoomWindow as K } from "./ZoomWindow.js";
8
+ import { CarouselPagination as L } from "./CarouselPagination.js";
9
+ import { MobileImageCarousel as U } from "./MobileImageCarousel.js";
10
+ import { useMatchesMobile as V } from "../../hooks/useMatchesMedia.js";
11
+ import { useState as q, useMemo as P, useCallback as B, useEffect as H } from "react";
12
+ import { useProductImagePreview as J } from "./useProductImagePreview.js";
13
+ const y = "/placeholder.svg";
14
+ function Q(c) {
15
+ const a = c?.trim();
16
+ return !!a && a !== y && !a.endsWith("/placeholder.svg") && !a.includes("/placeholder.svg?");
17
+ }
18
+ function me(c) {
19
+ const {
20
+ width: a = 483,
21
+ height: d = 483,
22
+ thumbsPerRow: h = 4,
23
+ zoomEnabled: g = !1,
24
+ scrollToZoomEnabled: u = !1,
25
+ images: l,
26
+ currentIndex: z,
27
+ onChangeIndex: w,
28
+ zoomLensSize: E,
29
+ zoomFactor: S = 2,
30
+ zoomWindowScaleFactor: C = 2.5,
31
+ zoomWindowOffset: Z = 10,
32
+ testid: k
33
+ } = c, [f, p] = q([]), F = P(
34
+ () => l.map((e) => e.src).join("|"),
35
+ [l]
36
+ ), t = P(
37
+ () => l.filter(
38
+ (e) => Q(e.src) && f.indexOf(e.src) === -1
39
+ ),
40
+ [f, l]
41
+ ), n = B((e) => {
42
+ e && p(
43
+ (o) => o.indexOf(e) >= 0 ? o : [...o, e]
44
+ );
45
+ }, []);
46
+ H(() => {
47
+ p([]);
48
+ }, [F]);
49
+ const i = V(), {
50
+ zoomPoint: W,
51
+ zoomActive: T,
52
+ currentZoomFactor: j,
53
+ primaryImagePosition: M,
54
+ safeIndex: m,
55
+ active: I,
56
+ primaryImageRef: N,
57
+ handleSelect: s,
58
+ handleZoomPositionChange: A,
59
+ handleScrollZoom: O
60
+ } = J({
61
+ images: t,
62
+ currentIndex: z,
63
+ zoomEnabled: g,
64
+ zoomFactor: S,
65
+ scrollToZoomEnabled: u,
66
+ onChangeIndex: w,
67
+ isMobile: i
68
+ });
69
+ if (typeof i > "u") return null;
70
+ if (i && !t.length)
71
+ return /* @__PURE__ */ r(
72
+ "img",
73
+ {
74
+ src: y,
75
+ alt: "Placeholder Image",
76
+ draggable: !1,
77
+ loading: "eager",
78
+ style: {
79
+ aspectRatio: "1 / 1",
80
+ objectFit: "cover",
81
+ height: "100%",
82
+ width: "100%"
83
+ }
84
+ }
85
+ );
86
+ const b = g && !i, R = t.length > 1;
87
+ return /* @__PURE__ */ v(
88
+ $,
89
+ {
90
+ sizing: "layout-group",
91
+ style: { width: a, position: "relative" },
92
+ testid: k,
93
+ children: [
94
+ /* @__PURE__ */ r("div", { className: "hidden md:block", children: /* @__PURE__ */ v("div", { className: "flex gap-4 items-start", children: [
95
+ /* @__PURE__ */ r("div", { ref: N, children: /* @__PURE__ */ r(
96
+ G,
97
+ {
98
+ image: I,
99
+ width: a,
100
+ height: d,
101
+ zoomEnabled: b,
102
+ zoomLensSize: E,
103
+ scrollToZoomEnabled: u && !i,
104
+ onZoomPositionChange: A,
105
+ onScrollZoom: O,
106
+ isPlaceholder: t.length === 0,
107
+ onImageError: n
108
+ }
109
+ ) }),
110
+ b && /* @__PURE__ */ r(
111
+ K,
112
+ {
113
+ image: I,
114
+ width: a,
115
+ height: d,
116
+ pointer: W,
117
+ active: T,
118
+ zoomFactor: j,
119
+ scaleFactor: C,
120
+ primaryImagePosition: M,
121
+ offset: Z
122
+ }
123
+ )
124
+ ] }) }),
125
+ i && /* @__PURE__ */ r(
126
+ U,
127
+ {
128
+ images: t,
129
+ currentIndex: m,
130
+ width: a,
131
+ height: d,
132
+ onChangeIndex: s,
133
+ onImageError: n
134
+ }
135
+ ),
136
+ R && /* @__PURE__ */ r("div", { className: "hidden md:block", children: t.length <= 3 ? /* @__PURE__ */ r(
137
+ "div",
138
+ {
139
+ className: "flex justify-center gap-4",
140
+ style: { width: "100%", maxWidth: a },
141
+ "aria-label": "Product image thumbnails",
142
+ children: t.map((e, o) => /* @__PURE__ */ r("div", { style: { maxWidth: "115px" }, children: /* @__PURE__ */ r(
143
+ x,
144
+ {
145
+ src: e.src,
146
+ alt: e.alt || `Thumbnail ${o + 1}`,
147
+ isActive: o === m,
148
+ onClick: () => s(o),
149
+ onImageError: n
150
+ }
151
+ ) }, e.src + o))
152
+ }
153
+ ) : /* @__PURE__ */ r(
154
+ D,
155
+ {
156
+ sizing: "layout-group",
157
+ "aria-label": "Product image thumbnails",
158
+ style: {
159
+ width: "100%",
160
+ maxWidth: a
161
+ },
162
+ columns: h > 12 ? 12 : h < 1 ? 1 : h,
163
+ children: t.map((e, o) => /* @__PURE__ */ r(
164
+ x,
165
+ {
166
+ src: e.src,
167
+ alt: e.alt || `Thumbnail ${o + 1}`,
168
+ isActive: o === m,
169
+ onClick: () => s(o),
170
+ onImageError: n
171
+ },
172
+ e.src + o
173
+ ))
174
+ }
175
+ ) }),
176
+ /* @__PURE__ */ r(
177
+ L,
178
+ {
179
+ images: t,
180
+ currentIndex: m,
181
+ onSelect: s
182
+ }
183
+ )
184
+ ]
185
+ }
186
+ );
187
+ }
188
+ export {
189
+ me as ProductImagePreview
190
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"useProductImagePreview.d.ts","sourceRoot":"","sources":["../../../src/components/ProductImagePreview/useProductImagePreview.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AAE7C,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAEzC,SAAS,EAAE;QACT,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAGxC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAGxD,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,wBAAwB,EAAE,CACxB,CAAC,EAAE;QACD,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,EACR,MAAM,EAAE,OAAO,KACZ,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,4BAA4B,CA4J9B"}
1
+ {"version":3,"file":"useProductImagePreview.d.ts","sourceRoot":"","sources":["../../../src/components/ProductImagePreview/useProductImagePreview.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,GAAG,CAAC;AAE7C,MAAM,MAAM,2BAA2B,GAAG;IACxC,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAEzC,SAAS,EAAE;QACT,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,CAAC;IACT,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAGxC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAGxD,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,wBAAwB,EAAE,CACxB,CAAC,EAAE;QACD,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,IAAI,EACR,MAAM,EAAE,OAAO,KACZ,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,4BAA4B,CA4J9B"}
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { useMemo as O, useState as u, useRef as P, useEffect as Z, useCallback as i } from "react";
3
+ function B(b) {
4
+ const {
5
+ images: o,
6
+ currentIndex: m,
7
+ zoomEnabled: E = !1,
8
+ zoomFactor: d = 2,
9
+ scrollToZoomEnabled: p = !1,
10
+ onChangeIndex: s,
11
+ isMobile: a = !1
12
+ } = b, r = !!o?.length, n = r && m >= 0 && m < o.length ? m : 0, x = O(() => r ? o[n] : void 0, [r, o, n]), [z, F] = u(null), [C, R] = u(!1), [f, g] = u(d), [A, L] = u(null), v = P(null), l = P(null), h = E && !a, w = p && !a;
13
+ Z(() => {
14
+ if (!h) return;
15
+ const e = () => {
16
+ const t = v.current;
17
+ if (!t) return;
18
+ const c = () => {
19
+ t && L(t.getBoundingClientRect());
20
+ };
21
+ c();
22
+ const I = new ResizeObserver(c);
23
+ I.observe(t), window.addEventListener("scroll", c), window.addEventListener("resize", c), l.current = () => {
24
+ I.disconnect(), window.removeEventListener("scroll", c), window.removeEventListener("resize", c);
25
+ };
26
+ };
27
+ if (v.current)
28
+ e();
29
+ else {
30
+ const t = requestAnimationFrame(e);
31
+ return () => cancelAnimationFrame(t);
32
+ }
33
+ return () => {
34
+ l.current && (l.current(), l.current = null);
35
+ };
36
+ }, [h]);
37
+ const M = i(
38
+ (e) => {
39
+ e !== n && s(e);
40
+ },
41
+ [n, s]
42
+ ), S = i(() => {
43
+ if (!r) return;
44
+ const e = (n + 1) % o.length;
45
+ s(e);
46
+ }, [r, n, o.length, s]), y = i(() => {
47
+ if (!r) return;
48
+ const e = n === 0 ? o.length - 1 : n - 1;
49
+ s(e);
50
+ }, [r, n, o.length, s]), T = i(
51
+ (e, t) => {
52
+ a || (F(e), R(t));
53
+ },
54
+ [a]
55
+ ), k = i(
56
+ (e) => {
57
+ if (!w) return;
58
+ const t = Math.max(1, Math.min(5, f + e));
59
+ g(t);
60
+ },
61
+ [w, f]
62
+ );
63
+ return Z(() => {
64
+ g(d);
65
+ }, [d]), {
66
+ // State
67
+ zoomPoint: z,
68
+ zoomActive: C,
69
+ currentZoomFactor: f,
70
+ primaryImagePosition: A,
71
+ hasImages: r,
72
+ safeIndex: n,
73
+ active: x,
74
+ // Refs
75
+ primaryImageRef: v,
76
+ // Handlers
77
+ handleSelect: M,
78
+ handleZoomPositionChange: T,
79
+ handleScrollZoom: k,
80
+ handleNext: S,
81
+ handlePrevious: y
82
+ };
83
+ }
84
+ export {
85
+ B as useProductImagePreview
86
+ };
@@ -0,0 +1,54 @@
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import { clsx as r } from "../node_modules/clsx/dist/clsx.js";
3
+ import { layoutGroupGap as a, paddingYUsingLayoutGroupGap as s, containerPaddingX as p, layoutGap as v } from "../classNames.js";
4
+ import { useMatchesMobile as u } from "../hooks/useMatchesMedia.js";
5
+ import "react";
6
+ function g({
7
+ left: c,
8
+ right: e,
9
+ mobileLeft: i,
10
+ mobileRight: l,
11
+ id: t,
12
+ testid: n
13
+ }) {
14
+ const d = u() ? {
15
+ "--color-background-primary-normal": "var(--color-brand-400)",
16
+ "--color-background-action-primary-normal": "var(--color-neutral-000)",
17
+ "--color-background-action-primary-hover": "var(--color-critical-100)",
18
+ "--color-background-action-primary-active": "var(--color-neutral-200)",
19
+ "--color-background-action-secondary-normal": "var(--color-brand-400)",
20
+ "--color-background-action-secondary-hover": "var(--color-critical-100)",
21
+ "--color-text-on-action-primary-normal": "var(--color-brand-400)",
22
+ "--color-text-primary-normal": "var(--color-neutral-000)",
23
+ "--color-text-action-primary-normal": "var(--color-neutral-000)",
24
+ "--color-text-action-primary-hover": "var(--color-critical-500)",
25
+ "--color-text-action-primary-active": "var(--color-critical-300)",
26
+ "--color-border-action-normal": "var(--color-neutral-000)",
27
+ "--color-border-action-hover": "var(--color-critical-500)",
28
+ "--color-border-action-active": "var(--color-critical-300)"
29
+ } : {};
30
+ return /* @__PURE__ */ m(
31
+ "div",
32
+ {
33
+ id: t,
34
+ "data-testid": n,
35
+ style: { ...d },
36
+ className: r(
37
+ "flex items-center justify-between",
38
+ "bg-background-primary-normal text-text-primary-normal",
39
+ s,
40
+ p,
41
+ v
42
+ ),
43
+ children: [
44
+ /* @__PURE__ */ o("div", { className: r("hidden desktop:block flex-1 leading-[1]"), children: c }),
45
+ /* @__PURE__ */ o("div", { className: r("hidden desktop:flex items-center", a), children: e }),
46
+ /* @__PURE__ */ o("div", { className: r("flex flex-col desktop:hidden"), children: i }),
47
+ /* @__PURE__ */ o("div", { className: r("flex items-center desktop:hidden", a), children: l })
48
+ ]
49
+ }
50
+ );
51
+ }
52
+ export {
53
+ g as ProjectBar
54
+ };
@@ -0,0 +1,113 @@
1
+ "use client";
2
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
3
+ import { clsx as r } from "../node_modules/clsx/dist/clsx.js";
4
+ import { baseTransition as x, componentGap as g } from "../classNames.js";
5
+ import { Paragraph as f } from "./Paragraph.js";
6
+ function $({
7
+ className: i,
8
+ label: s,
9
+ error: c,
10
+ disabled: e,
11
+ checked: l,
12
+ readOnly: n,
13
+ id: p,
14
+ testid: a,
15
+ ...v
16
+ }) {
17
+ const t = p, b = e ? "text-primary-disabled" : c ? "text-primary-error" : "text-primary-normal", h = r(
18
+ !c && !e && "border-border-primary-normal peer-hover:border-border-action-hover peer-hover:bg-background-action-secondary-hover peer-focus:border-border-action-hover peer-focus:bg-background-action-secondary-hover peer-active:border-border-action-active peer-active:bg-background-action-secondary-active peer-checked:border-0 peer-checked:bg-background-action-secondary-hover"
19
+ ), y = r(
20
+ c && !e && "border-border-action-critical-normal peer-hover:border-border-action-critical-hover peer-hover:bg-background-action-critical-secondary-hover peer-focus:border-border-action-critical-hover peer-focus:bg-background-action-critical-secondary-hover peer-active:border-border-action-critical-active peer-active:bg-background-action-secondary-active peer-checked:bg-background-action-critical-secondary-hover peer-checked:border-0 "
21
+ ), m = r(
22
+ e && "peer-disabled:bg-background-action-secondary-disabled peer-disabled:border-border-primary-normal peer-checked:border-0"
23
+ ), u = r(
24
+ n && "peer-read-only:bg-background-action-secondary-disabled peer-read-only:border-border-primary-normal peer-checked:border-0"
25
+ );
26
+ return /* @__PURE__ */ d(
27
+ "label",
28
+ {
29
+ htmlFor: t,
30
+ "data-testid": a,
31
+ className: r(
32
+ "flex items-center",
33
+ g,
34
+ e ? "cursor-default" : "cursor-pointer",
35
+ i
36
+ ),
37
+ children: [
38
+ /* @__PURE__ */ d("div", { className: "relative", children: [
39
+ /* @__PURE__ */ o(
40
+ "input",
41
+ {
42
+ id: t,
43
+ "data-testid": a ? `${a}-input` : void 0,
44
+ type: "radio",
45
+ className: "sr-only peer",
46
+ disabled: e,
47
+ checked: l,
48
+ readOnly: n,
49
+ ...v
50
+ }
51
+ ),
52
+ /* @__PURE__ */ o(
53
+ "div",
54
+ {
55
+ className: r(
56
+ "size-6 rounded-full border flex items-center justify-center",
57
+ x,
58
+ h,
59
+ y,
60
+ m,
61
+ u
62
+ ),
63
+ children: l && /* @__PURE__ */ o(
64
+ k,
65
+ {
66
+ className: r(
67
+ "transition-colors",
68
+ !c && !e && "text-icon-on-action-secondary-normal hover:text-icon-on-action-secondary-hover active:text-icon-on-action-secondary-active peer-hover:text-icon-on-action-secondary-hover peer-focus:text-icon-on-action-secondary-hover peer-active:text-icon-on-action-secondary-active",
69
+ c && !e && "text-icon-action-critical-secondary-normal hover:text-icon-action-critical-secondary-hover active:text-icon-action-critical-secondary-active peer-hover:text-icon-action-critical-secondary-hover peer-focus:text-icon-action-critical-secondary-hover peer-active:text-icon-action-critical-secondary-active",
70
+ e && "text-icon-on-action-secondary-disabled",
71
+ n && "text-icon-on-action-secondary-disabled"
72
+ )
73
+ }
74
+ )
75
+ }
76
+ )
77
+ ] }),
78
+ s && /* @__PURE__ */ o(f, { id: t ? `${t}-label` : void 0, testid: a ? `${a}-label` : void 0, padded: !0, color: b, children: s })
79
+ ]
80
+ }
81
+ );
82
+ }
83
+ function k({ className: i }) {
84
+ return /* @__PURE__ */ d(
85
+ "svg",
86
+ {
87
+ className: i,
88
+ xmlns: "http://www.w3.org/2000/svg",
89
+ width: "24",
90
+ height: "24",
91
+ viewBox: "0 0 24 24",
92
+ fill: "none",
93
+ children: [
94
+ /* @__PURE__ */ o(
95
+ "rect",
96
+ {
97
+ x: "1",
98
+ y: "1",
99
+ width: "22",
100
+ height: "22",
101
+ rx: "11",
102
+ stroke: "currentColor",
103
+ strokeWidth: "2"
104
+ }
105
+ ),
106
+ /* @__PURE__ */ o("rect", { x: "4", y: "4", width: "16", height: "16", rx: "8", fill: "currentColor" })
107
+ ]
108
+ }
109
+ );
110
+ }
111
+ export {
112
+ $ as Radio
113
+ };
@@ -0,0 +1,89 @@
1
+ "use client";
2
+ import { jsxs as k, Fragment as C, jsx as R } from "react/jsx-runtime";
3
+ import { useRef as a, useState as S, useId as $, useEffect as M } from "react";
4
+ import { Input as j } from "./Input.js";
5
+ function T({
6
+ id: r,
7
+ testid: u,
8
+ label: q,
9
+ error: v,
10
+ children: A,
11
+ readOnly: f,
12
+ renderMenu: s,
13
+ onClick: F,
14
+ wrapperClassName: I,
15
+ removeRoundness: g,
16
+ autocompletePadding: x = !1,
17
+ ...n
18
+ }) {
19
+ const m = a(null), d = a(null), p = a(!0), [c, l] = S(!1), [D, w] = S(!1), h = `search-menu-${$()}`;
20
+ return M(() => {
21
+ if (p.current) {
22
+ p.current = !1;
23
+ return;
24
+ }
25
+ m.current?.focus();
26
+ }, [n.value]), /* @__PURE__ */ k(C, { children: [
27
+ /* @__PURE__ */ R(
28
+ j,
29
+ {
30
+ id: r,
31
+ testid: u,
32
+ variant: "search",
33
+ inputContainerRef: d,
34
+ ref: m,
35
+ label: q,
36
+ wrapperClassName: I,
37
+ autocompletePadding: x,
38
+ onClick: (t) => {
39
+ if (!(n.disabled || f)) {
40
+ if (D) {
41
+ w(!1);
42
+ return;
43
+ }
44
+ F?.(t), l(!c);
45
+ }
46
+ },
47
+ onClear: () => {
48
+ w(!0);
49
+ },
50
+ onKeyDown: (t) => {
51
+ if (l(!0), ["ArrowUp", "ArrowDown"].includes(t.key)) {
52
+ t.preventDefault();
53
+ const o = document.querySelector(
54
+ `[data-menu="${h}"]`
55
+ ), y = o?.querySelector("[data-selected]");
56
+ if (y) {
57
+ const e = Array.from(
58
+ o?.querySelectorAll('[role="menuitem"]') || []
59
+ ), O = e.indexOf(y);
60
+ let i;
61
+ t.key === "ArrowDown" ? i = e[O + 1] || e[0] : i = e[O - 1] || e[e.length - 1], i?.focus();
62
+ } else
63
+ (t.key === "ArrowDown" ? o?.querySelector('[role="menuitem"]') : o?.querySelector(
64
+ '[role="menuitem"]:last-child'
65
+ ))?.focus();
66
+ }
67
+ },
68
+ error: v,
69
+ readOnly: f,
70
+ removeRoundness: g,
71
+ isFocused: s && c,
72
+ ...n
73
+ }
74
+ ),
75
+ s ? s({
76
+ id: r ? `${r}-menu` : void 0,
77
+ testid: u ? `${u}-menu` : void 0,
78
+ positionTo: d,
79
+ show: c,
80
+ setShow: l,
81
+ topOffset: n.caption ? -16 : null,
82
+ autoFocusOff: !0,
83
+ menuName: h
84
+ }) : A
85
+ ] });
86
+ }
87
+ export {
88
+ T as Search
89
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResultImage/index.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAU,EACV,MAAW,EACX,GAAG,EACH,GAAG,GACJ,EAAE,sBAAsB,2CAsBxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SearchResultImage/index.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAChC,KAAU,EACV,MAAW,EACX,GAAG,EACH,GAAG,GACJ,EAAE,sBAAsB,2CAsBxB"}
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as r, Fragment as n } from "react/jsx-runtime";
3
+ import { useState as s } from "react";
4
+ import { ImagePlaceholder as g } from "../ImagePlaceholder.js";
5
+ function u({
6
+ width: e = 20,
7
+ height: o = 20,
8
+ src: a,
9
+ alt: l
10
+ }) {
11
+ const [m, t] = s(!1);
12
+ return /* @__PURE__ */ r(n, { children: m || !a ? /* @__PURE__ */ r(g, { width: e, height: o }) : /* @__PURE__ */ r(
13
+ "img",
14
+ {
15
+ src: a,
16
+ alt: l,
17
+ width: e,
18
+ height: o,
19
+ draggable: !1,
20
+ loading: "lazy",
21
+ onError: () => t(!0)
22
+ }
23
+ ) });
24
+ }
25
+ export {
26
+ u as SearchResultImage
27
+ };
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import { jsxs as L, Fragment as U, jsx as p } from "react/jsx-runtime";
3
+ import { useRef as f, useState as w, useId as _, useEffect as z, useCallback as G } from "react";
4
+ import { InputBase as H } from "./Input.js";
5
+ import { Icon as J } from "./Icon.js";
6
+ import { clsx as x } from "../node_modules/clsx/dist/clsx.js";
7
+ function b({
8
+ id: l,
9
+ testid: I,
10
+ label: Q,
11
+ error: T,
12
+ children: C,
13
+ readOnly: m,
14
+ renderMenu: k,
15
+ onClick: R,
16
+ className: F,
17
+ wrapperClassName: K,
18
+ removeRoundness: N,
19
+ displayValue: B,
20
+ value: O,
21
+ searchable: r,
22
+ onChange: A,
23
+ ...a
24
+ }) {
25
+ const S = f(null), y = f(null), [t, $] = w(!1), [h, v] = w(""), g = `select-menu-${_()}`, u = f(""), c = f(null), [j, d] = w("");
26
+ z(() => {
27
+ r && t && S.current?.focus();
28
+ }, [r, t]);
29
+ const E = G(() => {
30
+ y.current?.querySelector("input")?.focus();
31
+ }, []);
32
+ function i(e) {
33
+ $(e), e || (v(""), d(""), u.current = "", c.current && clearTimeout(c.current), r && requestAnimationFrame(E));
34
+ }
35
+ const s = r && t;
36
+ return /* @__PURE__ */ L(U, { children: [
37
+ /* @__PURE__ */ p(
38
+ H,
39
+ {
40
+ id: l,
41
+ testid: I,
42
+ inputContainerRef: y,
43
+ ref: S,
44
+ label: Q,
45
+ after: !m && /* @__PURE__ */ p(
46
+ "span",
47
+ {
48
+ className: x(
49
+ a.disabled ? "text-icon-action-primary-disabled" : "text-icon-action-primary-normal",
50
+ "contents"
51
+ ),
52
+ children: /* @__PURE__ */ p(J, { name: "keyboard_arrow_down" })
53
+ }
54
+ ),
55
+ maxLength: s ? void 0 : 0,
56
+ className: x(!s && "!caret-transparent !cursor-default", F),
57
+ wrapperClassName: K,
58
+ onKeyDown: (e) => {
59
+ if (s && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
60
+ e.preventDefault();
61
+ const n = document.querySelector(
62
+ `[data-menu="${g}"]`
63
+ ), D = n?.querySelector("[data-selected]");
64
+ if (D) {
65
+ const o = Array.from(
66
+ n?.querySelectorAll('[role="menuitem"]') ?? []
67
+ ), q = o.indexOf(D);
68
+ (e.key === "ArrowDown" ? o[q + 1] ?? o[0] : o[q - 1] ?? o[o.length - 1])?.focus();
69
+ } else
70
+ (e.key === "ArrowDown" ? n?.querySelector('[role="menuitem"]') : n?.querySelector('[role="menuitem"]:last-child'))?.focus();
71
+ return;
72
+ }
73
+ if (!t && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
74
+ e.preventDefault(), i(!0);
75
+ return;
76
+ }
77
+ if (!t && (e.key === " " || e.key === "Enter")) {
78
+ e.preventDefault(), e.target.click();
79
+ return;
80
+ }
81
+ if (t && !r && e.key === " " && !u.current) {
82
+ e.preventDefault(), i(!1);
83
+ return;
84
+ }
85
+ if (!r && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {
86
+ e.preventDefault(), c.current && clearTimeout(c.current);
87
+ const n = u.current + e.key.toLowerCase();
88
+ u.current = n, c.current = setTimeout(() => {
89
+ u.current = "", d("");
90
+ }, 1e3), d(n), t || i(!0);
91
+ }
92
+ },
93
+ onClick: (e) => {
94
+ a.disabled || m || (i(!t), R?.(e));
95
+ },
96
+ error: T,
97
+ readOnly: m,
98
+ removeRoundness: N,
99
+ isFocused: t,
100
+ ...a,
101
+ onChange: (e) => {
102
+ s && v(e.target.value), A?.(e);
103
+ },
104
+ value: s ? h : B ?? O ?? (A ? "" : void 0)
105
+ }
106
+ ),
107
+ k ? k({
108
+ id: l ? `${l}-menu` : void 0,
109
+ positionTo: y,
110
+ show: t,
111
+ setShow: i,
112
+ topOffset: a.caption ? -16 : null,
113
+ searchQuery: r ? h : void 0,
114
+ autoFocusOff: r ? !0 : void 0,
115
+ menuName: g,
116
+ typeAheadQuery: r ? void 0 : j || void 0
117
+ }) : C
118
+ ] });
119
+ }
120
+ export {
121
+ b as Select
122
+ };