@dmsi/wedgekit-react 0.0.369 → 0.0.371

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 (205) hide show
  1. package/dist/{chunk-RLLQRVM7.js → chunk-2H35FETR.js} +18 -10
  2. package/dist/chunk-2IKT6IHB.js +190 -0
  3. package/dist/chunk-4UNWXB4A.js +89 -0
  4. package/dist/chunk-5IFPG6TS.js +17 -0
  5. package/dist/{chunk-6GAYJCFE.js → chunk-6DPFKSCT.js} +1 -1
  6. package/dist/{chunk-ZFOANBWG.js → chunk-AG43RS4Q.js} +2 -1
  7. package/dist/chunk-AJ5M6MVX.js +7 -0
  8. package/dist/chunk-AT4AWD6B.js +44 -0
  9. package/dist/chunk-BQNPOGD5.js +105 -0
  10. package/dist/chunk-CQFPNZTN.js +172 -0
  11. package/dist/chunk-EJSPFQCY.js +29 -0
  12. package/dist/chunk-ER6RCOH3.js +97 -0
  13. package/dist/{chunk-4VER5OEU.js → chunk-FBE2HGEF.js} +35 -11
  14. package/dist/chunk-HPQWEZJL.js +45 -0
  15. package/dist/{chunk-URCLLHO5.js → chunk-IBX6DVHU.js} +376 -102
  16. package/dist/{chunk-I3WFZOFY.js → chunk-J5V2JRIK.js} +1 -1
  17. package/dist/chunk-JGJUVJKD.js +283 -0
  18. package/dist/chunk-KEMCFN4U.js +78 -0
  19. package/dist/chunk-M6TSTDNZ.js +22 -0
  20. package/dist/chunk-M7INAUAJ.js +140 -0
  21. package/dist/chunk-MBZ55T2D.js +51 -0
  22. package/dist/chunk-N6PNLLNS.js +77 -0
  23. package/dist/{chunk-ZA5E7ZYM.js → chunk-NXGUDYRR.js} +1 -1
  24. package/dist/chunk-P36QKH26.js +143 -0
  25. package/dist/chunk-PTRZHGHA.js +89 -0
  26. package/dist/chunk-QVWYTQKL.js +29 -0
  27. package/dist/{chunk-6CPGOW6J.js → chunk-T36HX6QY.js} +6 -4
  28. package/dist/chunk-U6PUOGG4.js +114 -0
  29. package/dist/{chunk-NQXZBWDZ.js → chunk-V6U7LU6M.js} +15 -6
  30. package/dist/chunk-VJVY6NPF.js +32 -0
  31. package/dist/chunk-VVXPGI2P.js +61 -0
  32. package/dist/{chunk-ARQBSR3I.js → chunk-YCKRVNJ3.js} +4 -4
  33. package/dist/chunk-YYHQLQDQ.js +68 -0
  34. package/dist/components/Accordion.cjs +47 -14
  35. package/dist/components/Accordion.js +2 -2
  36. package/dist/components/CalendarRange.cjs +700 -46
  37. package/dist/components/CalendarRange.css +186 -3
  38. package/dist/components/CalendarRange.js +43 -11
  39. package/dist/components/CompactImagesPreview.cjs +485 -0
  40. package/dist/components/CompactImagesPreview.js +13 -0
  41. package/dist/components/ContentTabs.cjs +3 -2
  42. package/dist/components/ContentTabs.js +3 -2
  43. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +4687 -0
  44. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +5051 -0
  45. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +62 -0
  46. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +4687 -0
  47. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +5051 -0
  48. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +62 -0
  49. package/dist/components/DataGrid/PinnedColumns.cjs +4687 -0
  50. package/dist/components/DataGrid/PinnedColumns.css +5051 -0
  51. package/dist/components/DataGrid/PinnedColumns.js +62 -0
  52. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +4689 -0
  53. package/dist/components/DataGrid/TableBody/LoadingCell.css +5051 -0
  54. package/dist/components/DataGrid/TableBody/LoadingCell.js +62 -0
  55. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +4689 -0
  56. package/dist/components/DataGrid/TableBody/TableBodyRow.css +5051 -0
  57. package/dist/components/DataGrid/TableBody/TableBodyRow.js +62 -0
  58. package/dist/components/DataGrid/TableBody/index.cjs +4689 -0
  59. package/dist/components/DataGrid/TableBody/index.css +5051 -0
  60. package/dist/components/DataGrid/TableBody/index.js +62 -0
  61. package/dist/components/DataGrid/index.cjs +4692 -0
  62. package/dist/components/DataGrid/index.css +5051 -0
  63. package/dist/components/DataGrid/index.js +65 -0
  64. package/dist/components/DataGrid/utils.cjs +4687 -0
  65. package/dist/components/DataGrid/utils.css +5051 -0
  66. package/dist/components/DataGrid/utils.js +62 -0
  67. package/dist/components/DataGridCell.js +6 -6
  68. package/dist/components/DateInput.cjs +721 -67
  69. package/dist/components/DateInput.css +186 -3
  70. package/dist/components/DateInput.js +45 -13
  71. package/dist/components/DateRangeInput.cjs +721 -67
  72. package/dist/components/DateRangeInput.css +186 -3
  73. package/dist/components/DateRangeInput.js +45 -13
  74. package/dist/components/FilterGroup.js +3 -3
  75. package/dist/components/Grid.cjs +3 -1
  76. package/dist/components/Grid.js +3 -92
  77. package/dist/components/ImagePlaceholder.cjs +65 -0
  78. package/dist/components/ImagePlaceholder.js +7 -0
  79. package/dist/components/Input.js +2 -2
  80. package/dist/components/MenuOption.js +2 -2
  81. package/dist/components/MobileDataGrid/ColumnList.cjs +845 -0
  82. package/dist/components/MobileDataGrid/ColumnList.js +17 -0
  83. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +4797 -0
  84. package/dist/components/MobileDataGrid/ColumnSelector/index.css +5051 -0
  85. package/dist/components/MobileDataGrid/ColumnSelector/index.js +62 -0
  86. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.cjs +31 -0
  87. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +7 -0
  88. package/dist/components/MobileDataGrid/GridContextProvider/index.cjs +177 -0
  89. package/dist/components/MobileDataGrid/GridContextProvider/index.js +8 -0
  90. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.cjs +269 -0
  91. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +9 -0
  92. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +790 -0
  93. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +16 -0
  94. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +5059 -0
  95. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +5051 -0
  96. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +62 -0
  97. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +509 -0
  98. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +13 -0
  99. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +1261 -0
  100. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +27 -0
  101. package/dist/components/MobileDataGrid/index.cjs +5521 -0
  102. package/dist/components/MobileDataGrid/index.css +5051 -0
  103. package/dist/components/MobileDataGrid/index.js +62 -0
  104. package/dist/components/Modal.cjs +24 -13
  105. package/dist/components/Modal.js +3 -3
  106. package/dist/components/ModalHeader.cjs +6 -4
  107. package/dist/components/ModalHeader.js +1 -1
  108. package/dist/components/ModalScrim.cjs +2 -1
  109. package/dist/components/ModalScrim.js +1 -1
  110. package/dist/components/NestedMenu.js +4 -4
  111. package/dist/components/Notification.cjs +15 -6
  112. package/dist/components/Notification.js +1 -1
  113. package/dist/components/PDFViewer/DownloadIcon.cjs +394 -0
  114. package/dist/components/PDFViewer/DownloadIcon.js +10 -0
  115. package/dist/components/PDFViewer/PDFElement.cjs +515 -0
  116. package/dist/components/PDFViewer/PDFElement.js +11 -0
  117. package/dist/components/{MobileDataGrid.cjs → PDFViewer/PDFNavigation.cjs} +318 -402
  118. package/dist/components/PDFViewer/PDFNavigation.js +13 -0
  119. package/dist/components/PDFViewer/PDFPage.cjs +56 -0
  120. package/dist/components/PDFViewer/PDFPage.js +7 -0
  121. package/dist/components/{PDFViewer.cjs → PDFViewer/index.cjs} +290 -202
  122. package/dist/components/PDFViewer/index.js +29 -0
  123. package/dist/components/Password.js +2 -2
  124. package/dist/components/ProductImagePreview/CarouselPagination.cjs +75 -0
  125. package/dist/components/ProductImagePreview/CarouselPagination.js +7 -0
  126. package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +214 -0
  127. package/dist/components/ProductImagePreview/MobileImageCarousel.js +7 -0
  128. package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +255 -0
  129. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +9 -0
  130. package/dist/components/ProductImagePreview/Thumbnail.cjs +105 -0
  131. package/dist/components/ProductImagePreview/Thumbnail.js +8 -0
  132. package/dist/components/ProductImagePreview/ZoomWindow.cjs +198 -0
  133. package/dist/components/ProductImagePreview/ZoomWindow.js +8 -0
  134. package/dist/components/ProductImagePreview/index.cjs +1369 -0
  135. package/dist/components/ProductImagePreview/index.js +22 -0
  136. package/dist/components/Search.js +3 -3
  137. package/dist/components/Select.js +3 -3
  138. package/dist/components/SideMenuGroup.cjs +15 -6
  139. package/dist/components/SideMenuGroup.js +1 -1
  140. package/dist/components/SideMenuItem.cjs +15 -6
  141. package/dist/components/SideMenuItem.js +1 -1
  142. package/dist/components/SkeletonParagraph.cjs +33 -0
  143. package/dist/components/SkeletonParagraph.js +10 -0
  144. package/dist/components/Stack.cjs +15 -6
  145. package/dist/components/Stack.js +1 -1
  146. package/dist/components/Stepper.cjs +61 -53
  147. package/dist/components/Stepper.js +63 -55
  148. package/dist/components/Surface.js +3 -39
  149. package/dist/components/Swatch.cjs +15 -6
  150. package/dist/components/Swatch.js +4 -4
  151. package/dist/components/Time.cjs +15 -6
  152. package/dist/components/Time.js +5 -5
  153. package/dist/components/Upload.cjs +15 -6
  154. package/dist/components/Upload.js +1 -1
  155. package/dist/components/index.cjs +2559 -14
  156. package/dist/components/index.css +186 -3
  157. package/dist/components/index.js +57 -14
  158. package/dist/index.css +186 -3
  159. package/package.json +1 -1
  160. package/src/components/Accordion.tsx +23 -4
  161. package/src/components/CompactImagesPreview.tsx +99 -0
  162. package/src/components/ContentTabs.tsx +3 -1
  163. package/src/components/DataGrid/types.ts +5 -0
  164. package/src/components/Grid.tsx +2 -0
  165. package/src/components/ImagePlaceholder.tsx +22 -0
  166. package/src/components/MobileDataGrid/ColumnList.tsx +66 -0
  167. package/src/components/MobileDataGrid/ColumnSelector/index.tsx +97 -0
  168. package/src/components/MobileDataGrid/GridContextProvider/GridContext.tsx +25 -0
  169. package/src/components/MobileDataGrid/GridContextProvider/index.tsx +132 -0
  170. package/src/components/MobileDataGrid/GridContextProvider/useGridContext.ts +10 -0
  171. package/src/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.tsx +20 -0
  172. package/src/components/MobileDataGrid/MobileDataGridCard/index.tsx +129 -0
  173. package/src/components/MobileDataGrid/MobileDataGridHeader.tsx +80 -0
  174. package/src/components/MobileDataGrid/RowDetailModalProvider/ModalContent.tsx +42 -0
  175. package/src/components/MobileDataGrid/RowDetailModalProvider/index.tsx +68 -0
  176. package/src/components/MobileDataGrid/dataGridReducer.ts +55 -0
  177. package/src/components/MobileDataGrid/index.tsx +92 -0
  178. package/src/components/MobileDataGrid/types.ts +4 -0
  179. package/src/components/Modal.tsx +31 -12
  180. package/src/components/ModalButtons.tsx +1 -1
  181. package/src/components/ModalHeader.tsx +5 -2
  182. package/src/components/ModalScrim.tsx +3 -2
  183. package/src/components/PDFViewer/DownloadIcon.tsx +22 -0
  184. package/src/components/PDFViewer/PDFElement.tsx +90 -0
  185. package/src/components/PDFViewer/PDFNavigation.tsx +68 -0
  186. package/src/components/PDFViewer/PDFPage.tsx +34 -0
  187. package/src/components/PDFViewer/index.tsx +128 -0
  188. package/src/components/ProductImagePreview/CarouselPagination.tsx +54 -0
  189. package/src/components/ProductImagePreview/MobileImageCarousel.tsx +226 -0
  190. package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +218 -0
  191. package/src/components/ProductImagePreview/Thumbnail.tsx +49 -0
  192. package/src/components/ProductImagePreview/ZoomWindow.tsx +136 -0
  193. package/src/components/ProductImagePreview/index.tsx +182 -0
  194. package/src/components/ProductImagePreview/useProductImagePreview.ts +211 -0
  195. package/src/components/SkeletonParagraph.tsx +5 -0
  196. package/src/components/Stack.tsx +29 -6
  197. package/src/components/Stepper.tsx +5 -1
  198. package/src/components/index.ts +4 -0
  199. package/src/types.ts +2 -1
  200. package/dist/components/MobileDataGrid.js +0 -150
  201. package/dist/components/PDFViewer.js +0 -250
  202. package/src/components/MobileDataGrid.tsx +0 -163
  203. package/src/components/PDFViewer.tsx +0 -264
  204. package/dist/{chunk-OXSBIBGT.js → chunk-CKQNJNU3.js} +3 -3
  205. package/dist/{chunk-RJUN52HJ.js → chunk-ZL5X7KP6.js} +3 -3
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ import {
3
+ PDFViewer
4
+ } from "../../chunk-U6PUOGG4.js";
5
+ import "../../chunk-EJSPFQCY.js";
6
+ import "../../chunk-4UNWXB4A.js";
7
+ import "../../chunk-N6PNLLNS.js";
8
+ import "../../chunk-VJVY6NPF.js";
9
+ import "../../chunk-2H35FETR.js";
10
+ import "../../chunk-4RJKB7LC.js";
11
+ import "../../chunk-XM7IQHBU.js";
12
+ import "../../chunk-FRHPFACM.js";
13
+ import "../../chunk-T36HX6QY.js";
14
+ import "../../chunk-AG43RS4Q.js";
15
+ import "../../chunk-SBRRNFOP.js";
16
+ import "../../chunk-EU73QPW7.js";
17
+ import "../../chunk-JUJBS4ZV.js";
18
+ import "../../chunk-VXWSAIB5.js";
19
+ import "../../chunk-TYTD4FLW.js";
20
+ import "../../chunk-5UH6QUFB.js";
21
+ import "../../chunk-V6U7LU6M.js";
22
+ import "../../chunk-OGIFIPKH.js";
23
+ import "../../chunk-NKUETCDA.js";
24
+ import "../../chunk-WWAPK5PH.js";
25
+ import "../../chunk-6CTCHYIS.js";
26
+ import "../../chunk-ORMEWXMH.js";
27
+ export {
28
+ PDFViewer
29
+ };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import {
3
3
  InputBase
4
- } from "../chunk-RJUN52HJ.js";
5
- import "../chunk-5UH6QUFB.js";
4
+ } from "../chunk-ZL5X7KP6.js";
6
5
  import "../chunk-7CS736EF.js";
6
+ import "../chunk-5UH6QUFB.js";
7
7
  import {
8
8
  Icon
9
9
  } from "../chunk-NKUETCDA.js";
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/ProductImagePreview/CarouselPagination.tsx
21
+ var CarouselPagination_exports = {};
22
+ __export(CarouselPagination_exports, {
23
+ CarouselPagination: () => CarouselPagination
24
+ });
25
+ module.exports = __toCommonJS(CarouselPagination_exports);
26
+ var import_clsx = require("clsx");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function CarouselPagination({
29
+ images,
30
+ currentIndex,
31
+ onSelect,
32
+ className
33
+ }) {
34
+ if (!(images == null ? void 0 : images.length)) return null;
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
36
+ "div",
37
+ {
38
+ className: (0, import_clsx.clsx)(
39
+ "flex items-center justify-center w-full px-4 md:hidden",
40
+ className
41
+ ),
42
+ "aria-label": "Image navigation",
43
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
44
+ "div",
45
+ {
46
+ className: "grid gap-2 place-items-center",
47
+ style: {
48
+ gridTemplateColumns: `repeat(${Math.min(images.length, 8)}, 1fr)`
49
+ },
50
+ role: "tablist",
51
+ children: images.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
52
+ "button",
53
+ {
54
+ type: "button",
55
+ onClick: () => onSelect(index),
56
+ className: (0, import_clsx.clsx)(
57
+ "w-4 h-4 transition-all duration-200 focus:outline-none",
58
+ index === currentIndex ? "ring-2 ring-brand-400" : "ring ring-neutral-300"
59
+ ),
60
+ "aria-label": `Go to image ${index + 1}`,
61
+ role: "tab",
62
+ "aria-selected": index === currentIndex,
63
+ tabIndex: index === currentIndex ? 0 : -1
64
+ },
65
+ index
66
+ ))
67
+ }
68
+ )
69
+ }
70
+ );
71
+ }
72
+ // Annotate the CommonJS export names for ESM import in node:
73
+ 0 && (module.exports = {
74
+ CarouselPagination
75
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ CarouselPagination
3
+ } from "../../chunk-MBZ55T2D.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ CarouselPagination
7
+ };
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/components/ProductImagePreview/MobileImageCarousel.tsx
21
+ var MobileImageCarousel_exports = {};
22
+ __export(MobileImageCarousel_exports, {
23
+ MobileImageCarousel: () => MobileImageCarousel
24
+ });
25
+ module.exports = __toCommonJS(MobileImageCarousel_exports);
26
+ var import_react = require("react");
27
+ var import_jsx_runtime = require("react/jsx-runtime");
28
+ function MobileImageCarousel({
29
+ images,
30
+ currentIndex,
31
+ width = 483,
32
+ height = 483,
33
+ onChangeIndex,
34
+ className = ""
35
+ }) {
36
+ const containerRef = (0, import_react.useRef)(null);
37
+ const [isDragging, setIsDragging] = (0, import_react.useState)(false);
38
+ const [startX, setStartX] = (0, import_react.useState)(0);
39
+ const [currentTranslate, setCurrentTranslate] = (0, import_react.useState)(0);
40
+ const [prevTranslate, setPrevTranslate] = (0, import_react.useState)(0);
41
+ const [containerWidth, setContainerWidth] = (0, import_react.useState)(width);
42
+ const imageSize = Math.min(containerWidth * 0.6, height * 0.6);
43
+ const gap = 16;
44
+ const getTranslateX = (0, import_react.useCallback)(
45
+ (index) => {
46
+ const containerCenter = containerWidth / 2;
47
+ const imageCenter = imageSize / 2;
48
+ const totalOffset = index * (imageSize + gap);
49
+ return containerCenter - imageCenter - totalOffset;
50
+ },
51
+ [containerWidth, imageSize, gap]
52
+ );
53
+ (0, import_react.useEffect)(() => {
54
+ const translateX = getTranslateX(currentIndex);
55
+ setCurrentTranslate(translateX);
56
+ setPrevTranslate(translateX);
57
+ }, [currentIndex, getTranslateX]);
58
+ (0, import_react.useEffect)(() => {
59
+ const updateContainerWidth = () => {
60
+ if (containerRef.current) {
61
+ const rect = containerRef.current.getBoundingClientRect();
62
+ setContainerWidth(rect.width);
63
+ }
64
+ };
65
+ updateContainerWidth();
66
+ const resizeObserver = new ResizeObserver(updateContainerWidth);
67
+ if (containerRef.current) {
68
+ resizeObserver.observe(containerRef.current);
69
+ }
70
+ return () => resizeObserver.disconnect();
71
+ }, []);
72
+ const handleStart = (0, import_react.useCallback)((clientX) => {
73
+ setIsDragging(true);
74
+ setStartX(clientX);
75
+ }, []);
76
+ const handleMove = (0, import_react.useCallback)(
77
+ (clientX) => {
78
+ if (!isDragging) return;
79
+ const currentPosition = clientX;
80
+ const diff = currentPosition - startX;
81
+ setCurrentTranslate(prevTranslate + diff);
82
+ },
83
+ [isDragging, startX, prevTranslate]
84
+ );
85
+ const handleEnd = (0, import_react.useCallback)(() => {
86
+ if (!isDragging) return;
87
+ setIsDragging(false);
88
+ const moved = currentTranslate - prevTranslate;
89
+ const threshold = imageSize / 3;
90
+ let newIndex = currentIndex;
91
+ if (moved > threshold && currentIndex > 0) {
92
+ newIndex = currentIndex - 1;
93
+ } else if (moved < -threshold && currentIndex < images.length - 1) {
94
+ newIndex = currentIndex + 1;
95
+ }
96
+ if (newIndex !== currentIndex) {
97
+ onChangeIndex(newIndex);
98
+ } else {
99
+ setCurrentTranslate(prevTranslate);
100
+ }
101
+ }, [
102
+ isDragging,
103
+ currentTranslate,
104
+ prevTranslate,
105
+ currentIndex,
106
+ imageSize,
107
+ images.length,
108
+ onChangeIndex
109
+ ]);
110
+ const handleMouseDown = (e) => {
111
+ e.preventDefault();
112
+ handleStart(e.clientX);
113
+ };
114
+ const handleMouseMove = (e) => {
115
+ e.preventDefault();
116
+ handleMove(e.clientX);
117
+ };
118
+ const handleMouseUp = () => {
119
+ handleEnd();
120
+ };
121
+ const handleMouseLeave = () => {
122
+ handleEnd();
123
+ };
124
+ const handleTouchStart = (e) => {
125
+ handleStart(e.touches[0].clientX);
126
+ };
127
+ const handleTouchMove = (e) => {
128
+ handleMove(e.touches[0].clientX);
129
+ };
130
+ const handleTouchEnd = () => {
131
+ handleEnd();
132
+ };
133
+ const handleImageClick = (0, import_react.useCallback)(
134
+ (index) => {
135
+ if (!isDragging && index !== currentIndex) {
136
+ onChangeIndex(index);
137
+ }
138
+ },
139
+ [isDragging, currentIndex, onChangeIndex]
140
+ );
141
+ if (!images.length) return null;
142
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `md:hidden w-full ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
143
+ "div",
144
+ {
145
+ ref: containerRef,
146
+ className: "relative overflow-hidden cursor-grab active:cursor-grabbing select-none w-full",
147
+ style: {
148
+ height: imageSize
149
+ },
150
+ onMouseDown: handleMouseDown,
151
+ onMouseMove: handleMouseMove,
152
+ onMouseUp: handleMouseUp,
153
+ onMouseLeave: handleMouseLeave,
154
+ onTouchStart: handleTouchStart,
155
+ onTouchMove: handleTouchMove,
156
+ onTouchEnd: handleTouchEnd,
157
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
158
+ "div",
159
+ {
160
+ className: "flex items-center",
161
+ style: {
162
+ transform: `translateX(${currentTranslate}px)`,
163
+ transition: isDragging ? "none" : "transform 0.3s ease-out",
164
+ gap: `${gap}px`
165
+ },
166
+ children: images.map((image, index) => {
167
+ const isActive = index === currentIndex;
168
+ const distance = Math.abs(index - currentIndex);
169
+ const shouldRender = distance <= 2;
170
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
171
+ "div",
172
+ {
173
+ className: "flex-shrink-0 transition-opacity duration-300",
174
+ style: {
175
+ width: imageSize,
176
+ height: imageSize,
177
+ opacity: isActive ? 1 : Math.max(0.3, 1 - distance * 0.3)
178
+ },
179
+ onClick: () => handleImageClick(index),
180
+ children: shouldRender ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
181
+ "img",
182
+ {
183
+ src: image.src,
184
+ alt: image.alt || `Product image ${index + 1}`,
185
+ className: "w-full h-full object-cover",
186
+ draggable: false,
187
+ loading: distance <= 1 ? "eager" : "lazy",
188
+ style: {
189
+ aspectRatio: "1 / 1"
190
+ }
191
+ }
192
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
193
+ "div",
194
+ {
195
+ className: "w-full h-full bg-neutral-100 rounded-md border border-gray-200",
196
+ style: {
197
+ aspectRatio: "1 / 1"
198
+ },
199
+ "aria-hidden": "true"
200
+ }
201
+ )
202
+ },
203
+ image.src + index
204
+ );
205
+ })
206
+ }
207
+ )
208
+ }
209
+ ) });
210
+ }
211
+ // Annotate the CommonJS export names for ESM import in node:
212
+ 0 && (module.exports = {
213
+ MobileImageCarousel
214
+ });
@@ -0,0 +1,7 @@
1
+ import {
2
+ MobileImageCarousel
3
+ } from "../../chunk-2IKT6IHB.js";
4
+ import "../../chunk-ORMEWXMH.js";
5
+ export {
6
+ MobileImageCarousel
7
+ };
@@ -0,0 +1,255 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23
+ var __export = (target, all) => {
24
+ for (var name in all)
25
+ __defProp(target, name, { get: all[name], enumerable: true });
26
+ };
27
+ var __copyProps = (to, from, except, desc) => {
28
+ if (from && typeof from === "object" || typeof from === "function") {
29
+ for (let key of __getOwnPropNames(from))
30
+ if (!__hasOwnProp.call(to, key) && key !== except)
31
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
32
+ }
33
+ return to;
34
+ };
35
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+
37
+ // src/components/ProductImagePreview/ProductPrimaryImage.tsx
38
+ var ProductPrimaryImage_exports = {};
39
+ __export(ProductPrimaryImage_exports, {
40
+ ProductPrimaryImage: () => ProductPrimaryImage
41
+ });
42
+ module.exports = __toCommonJS(ProductPrimaryImage_exports);
43
+ var import_react2 = require("react");
44
+
45
+ // src/components/Spinner.tsx
46
+ var import_jsx_runtime = require("react/jsx-runtime");
47
+ var Spinner = ({ size = "small", testid }) => {
48
+ const dimension = size === "large" ? 48 : 24;
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
50
+ "svg",
51
+ {
52
+ "data-testid": testid,
53
+ width: dimension,
54
+ height: dimension,
55
+ viewBox: "0 0 24 24",
56
+ xmlns: "http://www.w3.org/2000/svg",
57
+ fill: "#1D1E1E",
58
+ className: "spinner",
59
+ "aria-label": "Loading",
60
+ children: [
61
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "4", r: "2", opacity: "1" }),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "17.666", cy: "6.334", r: "2", opacity: "0.125" }),
63
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "20", cy: "12", r: "2", opacity: "0.25" }),
64
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "17.666", cy: "17.666", r: "2", opacity: "0.375" }),
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "20", r: "2", opacity: "0.5" }),
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "6.334", cy: "17.666", r: "2", opacity: "0.625" }),
67
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "4", cy: "12", r: "2", opacity: "0.75" }),
68
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "6.334", cy: "6.334", r: "2", opacity: "0.875" })
69
+ ]
70
+ }
71
+ );
72
+ };
73
+ Spinner.displayName = "Spinner";
74
+
75
+ // src/components/ImagePlaceholder.tsx
76
+ var import_react = require("react");
77
+ var import_jsx_runtime2 = require("react/jsx-runtime");
78
+ function ImagePlaceholder(props) {
79
+ const clipId = (0, import_react.useId)();
80
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
81
+ "svg",
82
+ __spreadProps(__spreadValues({
83
+ xmlns: "http://www.w3.org/2000/svg",
84
+ width: 242,
85
+ height: 243,
86
+ fill: "none"
87
+ }, props), {
88
+ children: [
89
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { width: props.width, height: props.width, fill: "#F7F7F7", rx: 2 }) }),
90
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("clipPath", { id: clipId, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { width: props.width, height: props.width, fill: "#fff", rx: 2 }) }) })
91
+ ]
92
+ })
93
+ );
94
+ }
95
+
96
+ // src/components/ProductImagePreview/ProductPrimaryImage.tsx
97
+ var import_jsx_runtime3 = require("react/jsx-runtime");
98
+ function ProductPrimaryImage({
99
+ image,
100
+ width,
101
+ height,
102
+ zoomEnabled = false,
103
+ zoomLensSize = 140,
104
+ scrollToZoomEnabled = false,
105
+ className = "",
106
+ isPlaceholder = false,
107
+ onZoomPositionChange,
108
+ onScrollZoom
109
+ }) {
110
+ const containerRef = (0, import_react2.useRef)(null);
111
+ const lastPointRef = (0, import_react2.useRef)(null);
112
+ const rafRef = (0, import_react2.useRef)(null);
113
+ const [active, setActive] = (0, import_react2.useState)(false);
114
+ const [, forceRerender] = (0, import_react2.useState)(0);
115
+ const [imageLoading, setImageLoading] = (0, import_react2.useState)(true);
116
+ const [imageError, setImageError] = (0, import_react2.useState)(false);
117
+ const imageSrc = (0, import_react2.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
118
+ const schedule = () => {
119
+ if (rafRef.current != null) return;
120
+ rafRef.current = requestAnimationFrame(() => {
121
+ rafRef.current = null;
122
+ forceRerender((n) => n + 1);
123
+ });
124
+ };
125
+ const handlePointerEnter = (0, import_react2.useCallback)(() => {
126
+ if (!zoomEnabled) return;
127
+ setActive(true);
128
+ const el = containerRef.current;
129
+ if (el) {
130
+ const r = el.getBoundingClientRect();
131
+ const pt2 = lastPointRef.current;
132
+ onZoomPositionChange == null ? void 0 : onZoomPositionChange(
133
+ pt2 ? __spreadProps(__spreadValues({}, pt2), { w: r.width, h: r.height, lensSize: zoomLensSize }) : null,
134
+ true
135
+ );
136
+ }
137
+ }, [zoomEnabled, onZoomPositionChange, zoomLensSize]);
138
+ const handlePointerLeave = (0, import_react2.useCallback)(() => {
139
+ if (!zoomEnabled) return;
140
+ setActive(false);
141
+ lastPointRef.current = null;
142
+ onZoomPositionChange == null ? void 0 : onZoomPositionChange(null, false);
143
+ }, [zoomEnabled, onZoomPositionChange]);
144
+ const handlePointerMove = (0, import_react2.useCallback)(
145
+ (e) => {
146
+ if (!zoomEnabled || !active) return;
147
+ if (e.pointerType === "touch") return;
148
+ const el = containerRef.current;
149
+ if (!el) return;
150
+ const rect = el.getBoundingClientRect();
151
+ const rawX = (e.clientX - rect.left) / rect.width;
152
+ const rawY = (e.clientY - rect.top) / rect.height;
153
+ const size = zoomLensSize != null ? zoomLensSize : 140;
154
+ const left = Math.max(
155
+ 0,
156
+ Math.min(rect.width - size, rawX * rect.width - size / 2)
157
+ );
158
+ const top = Math.max(
159
+ 0,
160
+ Math.min(rect.height - size, rawY * rect.height - size / 2)
161
+ );
162
+ const centerXNorm = (left + size / 2) / rect.width;
163
+ const centerYNorm = (top + size / 2) / rect.height;
164
+ lastPointRef.current = {
165
+ x: centerXNorm,
166
+ y: centerYNorm
167
+ };
168
+ schedule();
169
+ onZoomPositionChange == null ? void 0 : onZoomPositionChange(
170
+ lastPointRef.current ? __spreadProps(__spreadValues({}, lastPointRef.current), {
171
+ w: rect.width,
172
+ h: rect.height,
173
+ lensSize: zoomLensSize
174
+ }) : null,
175
+ true
176
+ );
177
+ },
178
+ [zoomEnabled, active, onZoomPositionChange, zoomLensSize]
179
+ );
180
+ (0, import_react2.useEffect)(() => {
181
+ const container = containerRef.current;
182
+ if (!container || !scrollToZoomEnabled) return;
183
+ const handleNativeWheel = (e) => {
184
+ e.preventDefault();
185
+ e.stopPropagation();
186
+ if (!zoomEnabled || !active) return;
187
+ const delta = e.deltaY > 0 ? -0.2 : 0.2;
188
+ onScrollZoom == null ? void 0 : onScrollZoom(delta);
189
+ };
190
+ container.addEventListener("wheel", handleNativeWheel, { passive: false });
191
+ return () => {
192
+ container.removeEventListener("wheel", handleNativeWheel);
193
+ };
194
+ }, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
195
+ if (!image && !isPlaceholder) return null;
196
+ const pt = lastPointRef.current;
197
+ let lensStyle;
198
+ if (pt && active && zoomEnabled) {
199
+ const size = zoomLensSize;
200
+ const leftRaw = pt.x * width - size / 2;
201
+ const topRaw = pt.y * height - size / 2;
202
+ lensStyle = {
203
+ width: size,
204
+ height: size,
205
+ left: Math.max(0, Math.min(width - size, leftRaw)),
206
+ top: Math.max(0, Math.min(height - size, topRaw))
207
+ };
208
+ }
209
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
210
+ "div",
211
+ {
212
+ ref: containerRef,
213
+ className: [
214
+ "relative overflow-hidden bg-white rounded flex items-center justify-center select-none",
215
+ zoomEnabled ? "cursor-crosshair" : "",
216
+ className
217
+ ].join(" "),
218
+ style: { maxWidth: width, maxHeight: height, aspectRatio: "1 / 1" },
219
+ onPointerEnter: handlePointerEnter,
220
+ onPointerLeave: handlePointerLeave,
221
+ onPointerMove: handlePointerMove,
222
+ children: [
223
+ imageLoading && !imageError && !isPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute inset-0 flex items-center justify-center bg-neutral-50", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Spinner, { size: "small" }) }),
224
+ isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
225
+ "img",
226
+ {
227
+ src: imageSrc,
228
+ alt: (image == null ? void 0 : image.alt) || "Product image",
229
+ className: "object-cover w-full h-full select-none",
230
+ draggable: false,
231
+ loading: "lazy",
232
+ onLoad: () => setImageLoading(false),
233
+ onError: () => {
234
+ setImageLoading(false);
235
+ setImageError(true);
236
+ }
237
+ },
238
+ imageSrc
239
+ ),
240
+ zoomEnabled && active && lensStyle && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
241
+ "div",
242
+ {
243
+ "aria-hidden": true,
244
+ className: "absolute pointer-events-none border border-white/70 shadow-[0_0_0_1px_rgba(0,0,0,0.15)] rounded-md bg-white/10 backdrop-blur-[1px]",
245
+ style: lensStyle
246
+ }
247
+ )
248
+ ]
249
+ }
250
+ );
251
+ }
252
+ // Annotate the CommonJS export names for ESM import in node:
253
+ 0 && (module.exports = {
254
+ ProductPrimaryImage
255
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ ProductPrimaryImage
3
+ } from "../../chunk-CQFPNZTN.js";
4
+ import "../../chunk-SBRRNFOP.js";
5
+ import "../../chunk-QVWYTQKL.js";
6
+ import "../../chunk-ORMEWXMH.js";
7
+ export {
8
+ ProductPrimaryImage
9
+ };