@dmsi/wedgekit-react 0.0.387 → 0.0.389

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 (113) hide show
  1. package/dist/{chunk-PH76F7QS.js → chunk-2HMCS25C.js} +1 -1
  2. package/dist/{chunk-HPQWEZJL.js → chunk-3X3Y4TMS.js} +7 -2
  3. package/dist/{chunk-3XOYPT5O.js → chunk-44TDIHUP.js} +1 -1
  4. package/dist/{chunk-F4CV7SBS.js → chunk-6I5LZ2ZC.js} +2 -2
  5. package/dist/{chunk-2FADUKPP.js → chunk-AA6GE3TH.js} +1 -1
  6. package/dist/{chunk-DCCTNHNL.js → chunk-ERW5DEIO.js} +1 -1
  7. package/dist/{chunk-4LXG6QNT.js → chunk-EZCH4PQS.js} +2 -1
  8. package/dist/{chunk-CQFPNZTN.js → chunk-G5DEC7H3.js} +15 -5
  9. package/dist/{chunk-MX57T3HP.js → chunk-GB4ZTUQV.js} +8 -4
  10. package/dist/{chunk-TPXHOAY3.js → chunk-JIMJIJOF.js} +2 -2
  11. package/dist/{chunk-R4SFLYOZ.js → chunk-KZZKQLKF.js} +1 -1
  12. package/dist/{chunk-KKESN5SF.js → chunk-LCJZRP5S.js} +11 -2
  13. package/dist/{chunk-GNHKKYCY.js → chunk-LLZ3SSZJ.js} +2 -2
  14. package/dist/{chunk-A7CEYUVE.js → chunk-LZGYABCX.js} +3 -3
  15. package/dist/{chunk-FSLETAX4.js → chunk-MQX7GFLX.js} +11 -4
  16. package/dist/{chunk-2T2GISEG.js → chunk-OW3WN3JV.js} +3 -3
  17. package/dist/components/Accordion.cjs +10 -5
  18. package/dist/components/Accordion.js +3 -3
  19. package/dist/components/CalendarRange.cjs +24 -21
  20. package/dist/components/CalendarRange.css +18 -0
  21. package/dist/components/CalendarRange.js +15 -15
  22. package/dist/components/Card.cjs +2 -1
  23. package/dist/components/Card.js +1 -1
  24. package/dist/components/CompactImagesPreview.cjs +18 -7
  25. package/dist/components/CompactImagesPreview.js +2 -2
  26. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +14 -11
  27. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +18 -0
  28. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
  29. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +17 -14
  30. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +18 -0
  31. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
  32. package/dist/components/DataGrid/PinnedColumns.cjs +19 -16
  33. package/dist/components/DataGrid/PinnedColumns.css +18 -0
  34. package/dist/components/DataGrid/PinnedColumns.js +15 -15
  35. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +12 -9
  36. package/dist/components/DataGrid/TableBody/LoadingCell.css +18 -0
  37. package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
  38. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +14 -11
  39. package/dist/components/DataGrid/TableBody/TableBodyRow.css +18 -0
  40. package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
  41. package/dist/components/DataGrid/TableBody/index.cjs +14 -11
  42. package/dist/components/DataGrid/TableBody/index.css +18 -0
  43. package/dist/components/DataGrid/TableBody/index.js +15 -15
  44. package/dist/components/DataGrid/index.cjs +36 -33
  45. package/dist/components/DataGrid/index.css +18 -0
  46. package/dist/components/DataGrid/index.js +15 -15
  47. package/dist/components/DataGrid/utils.cjs +12 -9
  48. package/dist/components/DataGrid/utils.css +18 -0
  49. package/dist/components/DataGrid/utils.js +15 -15
  50. package/dist/components/DateInput.cjs +37 -34
  51. package/dist/components/DateInput.css +18 -0
  52. package/dist/components/DateInput.js +15 -15
  53. package/dist/components/DateRangeInput.cjs +37 -34
  54. package/dist/components/DateRangeInput.css +18 -0
  55. package/dist/components/DateRangeInput.js +15 -15
  56. package/dist/components/FilterGroup.cjs +11 -2
  57. package/dist/components/FilterGroup.js +1 -1
  58. package/dist/components/MobileDataGrid/ColumnList.cjs +8 -4
  59. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  60. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +16 -13
  61. package/dist/components/MobileDataGrid/ColumnSelector/index.css +18 -0
  62. package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
  63. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +8 -4
  64. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  65. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +24 -17
  66. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +18 -0
  67. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
  68. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +8 -4
  69. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
  70. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +8 -4
  71. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +3 -3
  72. package/dist/components/MobileDataGrid/index.cjs +50 -43
  73. package/dist/components/MobileDataGrid/index.css +18 -0
  74. package/dist/components/MobileDataGrid/index.js +15 -15
  75. package/dist/components/Notification.cjs +8 -4
  76. package/dist/components/Notification.js +1 -1
  77. package/dist/components/OptionPill.cjs +11 -2
  78. package/dist/components/OptionPill.js +1 -1
  79. package/dist/components/PDFViewer/PDFElement.cjs +8 -4
  80. package/dist/components/PDFViewer/PDFElement.js +2 -2
  81. package/dist/components/PDFViewer/PDFNavigation.cjs +8 -4
  82. package/dist/components/PDFViewer/PDFNavigation.js +2 -2
  83. package/dist/components/PDFViewer/index.cjs +8 -4
  84. package/dist/components/PDFViewer/index.js +4 -4
  85. package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +15 -5
  86. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +1 -1
  87. package/dist/components/ProductImagePreview/Thumbnail.cjs +7 -2
  88. package/dist/components/ProductImagePreview/Thumbnail.js +1 -1
  89. package/dist/components/ProductImagePreview/index.cjs +84 -63
  90. package/dist/components/ProductImagePreview/index.js +4 -4
  91. package/dist/components/SideMenuGroup.cjs +8 -4
  92. package/dist/components/SideMenuGroup.js +1 -1
  93. package/dist/components/SideMenuItem.cjs +8 -4
  94. package/dist/components/SideMenuItem.js +1 -1
  95. package/dist/components/Stack.cjs +8 -4
  96. package/dist/components/Stack.js +1 -1
  97. package/dist/components/Swatch.cjs +8 -4
  98. package/dist/components/Swatch.js +1 -1
  99. package/dist/components/Time.cjs +8 -4
  100. package/dist/components/Time.js +1 -1
  101. package/dist/components/Upload.cjs +8 -4
  102. package/dist/components/Upload.js +1 -1
  103. package/dist/components/index.cjs +100 -71
  104. package/dist/components/index.css +18 -0
  105. package/dist/components/index.js +15 -15
  106. package/dist/index.css +18 -0
  107. package/package.json +1 -1
  108. package/src/components/Card.tsx +15 -4
  109. package/src/components/CompactImagesPreview.tsx +10 -3
  110. package/src/components/OptionPill.tsx +13 -1
  111. package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +16 -5
  112. package/src/components/ProductImagePreview/Thumbnail.tsx +7 -1
  113. package/src/components/Stack.tsx +4 -0
@@ -143,7 +143,7 @@ function ProductPrimaryImage({
143
143
  }, [zoomEnabled, onZoomPositionChange]);
144
144
  const handlePointerMove = (0, import_react2.useCallback)(
145
145
  (e) => {
146
- if (!zoomEnabled || !active) return;
146
+ if (!zoomEnabled || !active || imageError) return;
147
147
  if (e.pointerType === "touch") return;
148
148
  const el = containerRef.current;
149
149
  if (!el) return;
@@ -175,7 +175,7 @@ function ProductPrimaryImage({
175
175
  true
176
176
  );
177
177
  },
178
- [zoomEnabled, active, onZoomPositionChange, zoomLensSize]
178
+ [zoomEnabled, active, imageError, zoomLensSize, onZoomPositionChange]
179
179
  );
180
180
  (0, import_react2.useEffect)(() => {
181
181
  const container = containerRef.current;
@@ -192,6 +192,10 @@ function ProductPrimaryImage({
192
192
  container.removeEventListener("wheel", handleNativeWheel);
193
193
  };
194
194
  }, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
195
+ (0, import_react2.useEffect)(() => {
196
+ setImageLoading(true);
197
+ setImageError(false);
198
+ }, [image]);
195
199
  if (!image && !isPlaceholder) return null;
196
200
  const pt = lastPointRef.current;
197
201
  let lensStyle;
@@ -215,7 +219,13 @@ function ProductPrimaryImage({
215
219
  zoomEnabled ? "cursor-crosshair" : "",
216
220
  className
217
221
  ].join(" "),
218
- style: { maxWidth: width, maxHeight: height, aspectRatio: "1 / 1" },
222
+ style: {
223
+ maxWidth: width,
224
+ maxHeight: height,
225
+ minWidth: width,
226
+ minHeight: height,
227
+ aspectRatio: "1 / 1"
228
+ },
219
229
  onPointerEnter: handlePointerEnter,
220
230
  onPointerLeave: handlePointerLeave,
221
231
  onPointerMove: handlePointerMove,
@@ -224,9 +234,9 @@ function ProductPrimaryImage({
224
234
  isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
225
235
  "img",
226
236
  {
227
- src: imageSrc,
237
+ src: imageError ? "/placeholder.svg" : imageSrc,
228
238
  alt: (image == null ? void 0 : image.alt) || "Product image",
229
- className: "object-cover w-full h-full select-none",
239
+ className: "object-cover min-w-full min-h-full select-none",
230
240
  draggable: false,
231
241
  loading: "lazy",
232
242
  onLoad: () => setImageLoading(false),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ProductPrimaryImage
3
- } from "../../chunk-CQFPNZTN.js";
3
+ } from "../../chunk-G5DEC7H3.js";
4
4
  import "../../chunk-SBRRNFOP.js";
5
5
  import "../../chunk-QVWYTQKL.js";
6
6
  import "../../chunk-ORMEWXMH.js";
@@ -40,6 +40,7 @@ __export(Thumbnail_exports, {
40
40
  Thumbnail: () => Thumbnail
41
41
  });
42
42
  module.exports = __toCommonJS(Thumbnail_exports);
43
+ var import_react2 = require("react");
43
44
 
44
45
  // src/components/ImagePlaceholder.tsx
45
46
  var import_react = require("react");
@@ -73,6 +74,7 @@ function Thumbnail({
73
74
  onClick,
74
75
  isPlaceholder = false
75
76
  }) {
77
+ const [imageError, setImageError] = (0, import_react2.useState)(false);
76
78
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
77
79
  "button",
78
80
  {
@@ -89,11 +91,14 @@ function Thumbnail({
89
91
  children: isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ImagePlaceholder, { width: 115, height: 115 }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
90
92
  "img",
91
93
  {
92
- src,
94
+ src: imageError ? "/placeholder.svg" : src,
93
95
  alt,
94
96
  className: "object-cover w-full h-full select-none",
95
97
  draggable: false,
96
- loading: "lazy"
98
+ loading: "lazy",
99
+ onError: () => {
100
+ setImageError(true);
101
+ }
97
102
  }
98
103
  )
99
104
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Thumbnail
3
- } from "../../chunk-HPQWEZJL.js";
3
+ } from "../../chunk-3X3Y4TMS.js";
4
4
  import "../../chunk-QVWYTQKL.js";
5
5
  import "../../chunk-ORMEWXMH.js";
6
6
  export {
@@ -63,6 +63,9 @@ __export(ProductImagePreview_exports, {
63
63
  });
64
64
  module.exports = __toCommonJS(ProductImagePreview_exports);
65
65
 
66
+ // src/components/ProductImagePreview/Thumbnail.tsx
67
+ var import_react2 = require("react");
68
+
66
69
  // src/components/ImagePlaceholder.tsx
67
70
  var import_react = require("react");
68
71
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -95,6 +98,7 @@ function Thumbnail({
95
98
  onClick,
96
99
  isPlaceholder = false
97
100
  }) {
101
+ const [imageError, setImageError] = (0, import_react2.useState)(false);
98
102
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
99
103
  "button",
100
104
  {
@@ -111,11 +115,14 @@ function Thumbnail({
111
115
  children: isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ImagePlaceholder, { width: 115, height: 115 }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
112
116
  "img",
113
117
  {
114
- src,
118
+ src: imageError ? "/placeholder.svg" : src,
115
119
  alt,
116
120
  className: "object-cover w-full h-full select-none",
117
121
  draggable: false,
118
- loading: "lazy"
122
+ loading: "lazy",
123
+ onError: () => {
124
+ setImageError(true);
125
+ }
119
126
  }
120
127
  )
121
128
  }
@@ -320,7 +327,8 @@ var Stack = (_a) => {
320
327
  marginBottom,
321
328
  testid,
322
329
  bottom,
323
- zIndex
330
+ zIndex,
331
+ flexWrap
324
332
  } = _b, props = __objRest(_b, [
325
333
  "children",
326
334
  "items",
@@ -359,9 +367,10 @@ var Stack = (_a) => {
359
367
  "marginBottom",
360
368
  "testid",
361
369
  "bottom",
362
- "zIndex"
370
+ "zIndex",
371
+ "flexWrap"
363
372
  ]);
364
- var _a2, _b2, _c, _d, _e, _f;
373
+ var _a2, _b2, _c, _d, _e, _f, _g;
365
374
  const flexClassNames = getFlexClassNames({ items, justify, grow });
366
375
  const gapClassNames = useGapClassNames(sizing);
367
376
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -388,7 +397,9 @@ var Stack = (_a) => {
388
397
  borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
389
398
  marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
390
399
  zIndex: zIndex !== void 0 ? zIndex : void 0,
391
- gap: (_f = props.style) == null ? void 0 : _f.gap
400
+ flexWrap,
401
+ paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
402
+ gap: (_g = props.style) == null ? void 0 : _g.gap
392
403
  },
393
404
  className: (0, import_clsx2.default)(
394
405
  "scrollbar-thin",
@@ -436,7 +447,7 @@ var Stack = (_a) => {
436
447
  };
437
448
 
438
449
  // src/components/Grid.tsx
439
- var import_react2 = require("react");
450
+ var import_react3 = require("react");
440
451
  var import_clsx3 = __toESM(require("clsx"), 1);
441
452
  var import_jsx_runtime4 = require("react/jsx-runtime");
442
453
  var COLUMNS_WITH_SIDE_MENU_MAP = {
@@ -505,7 +516,7 @@ var Grid = ({
505
516
  testid,
506
517
  style
507
518
  }) => {
508
- const childCount = import_react2.Children.count(children);
519
+ const childCount = import_react3.Children.count(children);
509
520
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
510
521
  "div",
511
522
  {
@@ -530,7 +541,7 @@ var Grid = ({
530
541
  };
531
542
 
532
543
  // src/components/ProductImagePreview/ProductPrimaryImage.tsx
533
- var import_react3 = require("react");
544
+ var import_react4 = require("react");
534
545
 
535
546
  // src/components/Spinner.tsx
536
547
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -576,14 +587,14 @@ function ProductPrimaryImage({
576
587
  onZoomPositionChange,
577
588
  onScrollZoom
578
589
  }) {
579
- const containerRef = (0, import_react3.useRef)(null);
580
- const lastPointRef = (0, import_react3.useRef)(null);
581
- const rafRef = (0, import_react3.useRef)(null);
582
- const [active, setActive] = (0, import_react3.useState)(false);
583
- const [, forceRerender] = (0, import_react3.useState)(0);
584
- const [imageLoading, setImageLoading] = (0, import_react3.useState)(true);
585
- const [imageError, setImageError] = (0, import_react3.useState)(false);
586
- const imageSrc = (0, import_react3.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
590
+ const containerRef = (0, import_react4.useRef)(null);
591
+ const lastPointRef = (0, import_react4.useRef)(null);
592
+ const rafRef = (0, import_react4.useRef)(null);
593
+ const [active, setActive] = (0, import_react4.useState)(false);
594
+ const [, forceRerender] = (0, import_react4.useState)(0);
595
+ const [imageLoading, setImageLoading] = (0, import_react4.useState)(true);
596
+ const [imageError, setImageError] = (0, import_react4.useState)(false);
597
+ const imageSrc = (0, import_react4.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
587
598
  const schedule = () => {
588
599
  if (rafRef.current != null) return;
589
600
  rafRef.current = requestAnimationFrame(() => {
@@ -591,7 +602,7 @@ function ProductPrimaryImage({
591
602
  forceRerender((n) => n + 1);
592
603
  });
593
604
  };
594
- const handlePointerEnter = (0, import_react3.useCallback)(() => {
605
+ const handlePointerEnter = (0, import_react4.useCallback)(() => {
595
606
  if (!zoomEnabled) return;
596
607
  setActive(true);
597
608
  const el = containerRef.current;
@@ -604,15 +615,15 @@ function ProductPrimaryImage({
604
615
  );
605
616
  }
606
617
  }, [zoomEnabled, onZoomPositionChange, zoomLensSize]);
607
- const handlePointerLeave = (0, import_react3.useCallback)(() => {
618
+ const handlePointerLeave = (0, import_react4.useCallback)(() => {
608
619
  if (!zoomEnabled) return;
609
620
  setActive(false);
610
621
  lastPointRef.current = null;
611
622
  onZoomPositionChange == null ? void 0 : onZoomPositionChange(null, false);
612
623
  }, [zoomEnabled, onZoomPositionChange]);
613
- const handlePointerMove = (0, import_react3.useCallback)(
624
+ const handlePointerMove = (0, import_react4.useCallback)(
614
625
  (e) => {
615
- if (!zoomEnabled || !active) return;
626
+ if (!zoomEnabled || !active || imageError) return;
616
627
  if (e.pointerType === "touch") return;
617
628
  const el = containerRef.current;
618
629
  if (!el) return;
@@ -644,9 +655,9 @@ function ProductPrimaryImage({
644
655
  true
645
656
  );
646
657
  },
647
- [zoomEnabled, active, onZoomPositionChange, zoomLensSize]
658
+ [zoomEnabled, active, imageError, zoomLensSize, onZoomPositionChange]
648
659
  );
649
- (0, import_react3.useEffect)(() => {
660
+ (0, import_react4.useEffect)(() => {
650
661
  const container = containerRef.current;
651
662
  if (!container || !scrollToZoomEnabled) return;
652
663
  const handleNativeWheel = (e) => {
@@ -661,6 +672,10 @@ function ProductPrimaryImage({
661
672
  container.removeEventListener("wheel", handleNativeWheel);
662
673
  };
663
674
  }, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
675
+ (0, import_react4.useEffect)(() => {
676
+ setImageLoading(true);
677
+ setImageError(false);
678
+ }, [image]);
664
679
  if (!image && !isPlaceholder) return null;
665
680
  const pt = lastPointRef.current;
666
681
  let lensStyle;
@@ -684,7 +699,13 @@ function ProductPrimaryImage({
684
699
  zoomEnabled ? "cursor-crosshair" : "",
685
700
  className
686
701
  ].join(" "),
687
- style: { maxWidth: width, maxHeight: height, aspectRatio: "1 / 1" },
702
+ style: {
703
+ maxWidth: width,
704
+ maxHeight: height,
705
+ minWidth: width,
706
+ minHeight: height,
707
+ aspectRatio: "1 / 1"
708
+ },
688
709
  onPointerEnter: handlePointerEnter,
689
710
  onPointerLeave: handlePointerLeave,
690
711
  onPointerMove: handlePointerMove,
@@ -693,9 +714,9 @@ function ProductPrimaryImage({
693
714
  isPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
694
715
  "img",
695
716
  {
696
- src: imageSrc,
717
+ src: imageError ? "/placeholder.svg" : imageSrc,
697
718
  alt: (image == null ? void 0 : image.alt) || "Product image",
698
- className: "object-cover w-full h-full select-none",
719
+ className: "object-cover min-w-full min-h-full select-none",
699
720
  draggable: false,
700
721
  loading: "lazy",
701
722
  onLoad: () => setImageLoading(false),
@@ -720,7 +741,7 @@ function ProductPrimaryImage({
720
741
  }
721
742
 
722
743
  // src/components/ProductImagePreview/ZoomWindow.tsx
723
- var import_react4 = require("react");
744
+ var import_react5 = require("react");
724
745
 
725
746
  // src/components/Surface.tsx
726
747
  var import_clsx4 = __toESM(require("clsx"), 1);
@@ -771,7 +792,7 @@ function ZoomWindow({
771
792
  offset = 10,
772
793
  className = ""
773
794
  }) {
774
- const imageSrc = (0, import_react4.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
795
+ const imageSrc = (0, import_react5.useMemo)(() => image == null ? void 0 : image.src, [image == null ? void 0 : image.src]);
775
796
  if (!image || !active || !pointer) return null;
776
797
  const zoomWindowSize = pointer.lensSize * scaleFactor;
777
798
  const baseW = pointer.w || width;
@@ -900,7 +921,7 @@ function CarouselPagination({
900
921
  }
901
922
 
902
923
  // src/components/ProductImagePreview/MobileImageCarousel.tsx
903
- var import_react5 = require("react");
924
+ var import_react6 = require("react");
904
925
  var import_jsx_runtime10 = require("react/jsx-runtime");
905
926
  function MobileImageCarousel({
906
927
  images,
@@ -910,15 +931,15 @@ function MobileImageCarousel({
910
931
  onChangeIndex,
911
932
  className = ""
912
933
  }) {
913
- const containerRef = (0, import_react5.useRef)(null);
914
- const [isDragging, setIsDragging] = (0, import_react5.useState)(false);
915
- const [startX, setStartX] = (0, import_react5.useState)(0);
916
- const [currentTranslate, setCurrentTranslate] = (0, import_react5.useState)(0);
917
- const [prevTranslate, setPrevTranslate] = (0, import_react5.useState)(0);
918
- const [containerWidth, setContainerWidth] = (0, import_react5.useState)(width);
934
+ const containerRef = (0, import_react6.useRef)(null);
935
+ const [isDragging, setIsDragging] = (0, import_react6.useState)(false);
936
+ const [startX, setStartX] = (0, import_react6.useState)(0);
937
+ const [currentTranslate, setCurrentTranslate] = (0, import_react6.useState)(0);
938
+ const [prevTranslate, setPrevTranslate] = (0, import_react6.useState)(0);
939
+ const [containerWidth, setContainerWidth] = (0, import_react6.useState)(width);
919
940
  const imageSize = Math.min(containerWidth * 0.6, height * 0.6);
920
941
  const gap = 16;
921
- const getTranslateX = (0, import_react5.useCallback)(
942
+ const getTranslateX = (0, import_react6.useCallback)(
922
943
  (index) => {
923
944
  const containerCenter = containerWidth / 2;
924
945
  const imageCenter = imageSize / 2;
@@ -927,12 +948,12 @@ function MobileImageCarousel({
927
948
  },
928
949
  [containerWidth, imageSize, gap]
929
950
  );
930
- (0, import_react5.useEffect)(() => {
951
+ (0, import_react6.useEffect)(() => {
931
952
  const translateX = getTranslateX(currentIndex);
932
953
  setCurrentTranslate(translateX);
933
954
  setPrevTranslate(translateX);
934
955
  }, [currentIndex, getTranslateX]);
935
- (0, import_react5.useEffect)(() => {
956
+ (0, import_react6.useEffect)(() => {
936
957
  const updateContainerWidth = () => {
937
958
  if (containerRef.current) {
938
959
  const rect = containerRef.current.getBoundingClientRect();
@@ -946,11 +967,11 @@ function MobileImageCarousel({
946
967
  }
947
968
  return () => resizeObserver.disconnect();
948
969
  }, []);
949
- const handleStart = (0, import_react5.useCallback)((clientX) => {
970
+ const handleStart = (0, import_react6.useCallback)((clientX) => {
950
971
  setIsDragging(true);
951
972
  setStartX(clientX);
952
973
  }, []);
953
- const handleMove = (0, import_react5.useCallback)(
974
+ const handleMove = (0, import_react6.useCallback)(
954
975
  (clientX) => {
955
976
  if (!isDragging) return;
956
977
  const currentPosition = clientX;
@@ -959,7 +980,7 @@ function MobileImageCarousel({
959
980
  },
960
981
  [isDragging, startX, prevTranslate]
961
982
  );
962
- const handleEnd = (0, import_react5.useCallback)(() => {
983
+ const handleEnd = (0, import_react6.useCallback)(() => {
963
984
  if (!isDragging) return;
964
985
  setIsDragging(false);
965
986
  const moved = currentTranslate - prevTranslate;
@@ -1007,7 +1028,7 @@ function MobileImageCarousel({
1007
1028
  const handleTouchEnd = () => {
1008
1029
  handleEnd();
1009
1030
  };
1010
- const handleImageClick = (0, import_react5.useCallback)(
1031
+ const handleImageClick = (0, import_react6.useCallback)(
1011
1032
  (index) => {
1012
1033
  if (!isDragging && index !== currentIndex) {
1013
1034
  onChangeIndex(index);
@@ -1087,16 +1108,16 @@ function MobileImageCarousel({
1087
1108
  }
1088
1109
 
1089
1110
  // src/hooks/useKeydown.ts
1090
- var import_react6 = require("react");
1111
+ var import_react7 = require("react");
1091
1112
 
1092
1113
  // src/hooks/useInfiniteScroll.tsx
1093
- var import_react7 = require("react");
1114
+ var import_react8 = require("react");
1094
1115
 
1095
1116
  // src/hooks/useMatchesMedia.ts
1096
- var import_react8 = require("react");
1117
+ var import_react9 = require("react");
1097
1118
  var useMatchesMedia = (query) => {
1098
- const [matches, setMatches] = (0, import_react8.useState)();
1099
- (0, import_react8.useLayoutEffect)(() => {
1119
+ const [matches, setMatches] = (0, import_react9.useState)();
1120
+ (0, import_react9.useLayoutEffect)(() => {
1100
1121
  const mediaQueryList = window.matchMedia(query);
1101
1122
  const listener = () => setMatches(mediaQueryList.matches);
1102
1123
  listener();
@@ -1108,10 +1129,10 @@ var useMatchesMedia = (query) => {
1108
1129
  var useMatchesMobile = () => useMatchesMedia("(width < 48rem)");
1109
1130
 
1110
1131
  // src/hooks/useTableLayout.ts
1111
- var import_react9 = require("react");
1132
+ var import_react10 = require("react");
1112
1133
 
1113
1134
  // src/components/ProductImagePreview/useProductImagePreview.ts
1114
- var import_react10 = require("react");
1135
+ var import_react11 = require("react");
1115
1136
  function useProductImagePreview(props) {
1116
1137
  const {
1117
1138
  images,
@@ -1124,18 +1145,18 @@ function useProductImagePreview(props) {
1124
1145
  } = props;
1125
1146
  const hasImages = !!(images == null ? void 0 : images.length);
1126
1147
  const safeIndex = hasImages && currentIndex >= 0 && currentIndex < images.length ? currentIndex : 0;
1127
- const active = (0, import_react10.useMemo)(() => {
1148
+ const active = (0, import_react11.useMemo)(() => {
1128
1149
  return hasImages ? images[safeIndex] : void 0;
1129
1150
  }, [hasImages, images, safeIndex]);
1130
- const [zoomPoint, setZoomPoint] = (0, import_react10.useState)(null);
1131
- const [zoomActive, setZoomActive] = (0, import_react10.useState)(false);
1132
- const [currentZoomFactor, setCurrentZoomFactor] = (0, import_react10.useState)(zoomFactor);
1133
- const [primaryImagePosition, setPrimaryImagePosition] = (0, import_react10.useState)(null);
1134
- const primaryImageRef = (0, import_react10.useRef)(null);
1135
- const cleanupRef = (0, import_react10.useRef)(null);
1151
+ const [zoomPoint, setZoomPoint] = (0, import_react11.useState)(null);
1152
+ const [zoomActive, setZoomActive] = (0, import_react11.useState)(false);
1153
+ const [currentZoomFactor, setCurrentZoomFactor] = (0, import_react11.useState)(zoomFactor);
1154
+ const [primaryImagePosition, setPrimaryImagePosition] = (0, import_react11.useState)(null);
1155
+ const primaryImageRef = (0, import_react11.useRef)(null);
1156
+ const cleanupRef = (0, import_react11.useRef)(null);
1136
1157
  const effectiveZoomEnabled = zoomEnabled && !isMobile;
1137
1158
  const effectiveScrollToZoomEnabled = scrollToZoomEnabled && !isMobile;
1138
- (0, import_react10.useEffect)(() => {
1159
+ (0, import_react11.useEffect)(() => {
1139
1160
  if (!effectiveZoomEnabled) return;
1140
1161
  const setupTracking = () => {
1141
1162
  const element = primaryImageRef.current;
@@ -1169,24 +1190,24 @@ function useProductImagePreview(props) {
1169
1190
  }
1170
1191
  };
1171
1192
  }, [effectiveZoomEnabled]);
1172
- const handleSelect = (0, import_react10.useCallback)(
1193
+ const handleSelect = (0, import_react11.useCallback)(
1173
1194
  (idx) => {
1174
1195
  if (idx === safeIndex) return;
1175
1196
  onChangeIndex(idx);
1176
1197
  },
1177
1198
  [safeIndex, onChangeIndex]
1178
1199
  );
1179
- const handleNext = (0, import_react10.useCallback)(() => {
1200
+ const handleNext = (0, import_react11.useCallback)(() => {
1180
1201
  if (!hasImages) return;
1181
1202
  const nextIndex = (safeIndex + 1) % images.length;
1182
1203
  onChangeIndex(nextIndex);
1183
1204
  }, [hasImages, safeIndex, images.length, onChangeIndex]);
1184
- const handlePrevious = (0, import_react10.useCallback)(() => {
1205
+ const handlePrevious = (0, import_react11.useCallback)(() => {
1185
1206
  if (!hasImages) return;
1186
1207
  const previousIndex = safeIndex === 0 ? images.length - 1 : safeIndex - 1;
1187
1208
  onChangeIndex(previousIndex);
1188
1209
  }, [hasImages, safeIndex, images.length, onChangeIndex]);
1189
- const handleZoomPositionChange = (0, import_react10.useCallback)(
1210
+ const handleZoomPositionChange = (0, import_react11.useCallback)(
1190
1211
  (p, active2) => {
1191
1212
  if (isMobile) return;
1192
1213
  setZoomPoint(p);
@@ -1194,7 +1215,7 @@ function useProductImagePreview(props) {
1194
1215
  },
1195
1216
  [isMobile]
1196
1217
  );
1197
- const handleScrollZoom = (0, import_react10.useCallback)(
1218
+ const handleScrollZoom = (0, import_react11.useCallback)(
1198
1219
  (delta) => {
1199
1220
  if (!effectiveScrollToZoomEnabled) return;
1200
1221
  const newZoomFactor = Math.max(1, Math.min(5, currentZoomFactor + delta));
@@ -1202,7 +1223,7 @@ function useProductImagePreview(props) {
1202
1223
  },
1203
1224
  [effectiveScrollToZoomEnabled, currentZoomFactor]
1204
1225
  );
1205
- (0, import_react10.useEffect)(() => {
1226
+ (0, import_react11.useEffect)(() => {
1206
1227
  setCurrentZoomFactor(zoomFactor);
1207
1228
  }, [zoomFactor]);
1208
1229
  return {
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ProductImagePreview
3
- } from "../../chunk-A7CEYUVE.js";
4
- import "../../chunk-CQFPNZTN.js";
5
- import "../../chunk-HPQWEZJL.js";
3
+ } from "../../chunk-LZGYABCX.js";
4
+ import "../../chunk-G5DEC7H3.js";
5
+ import "../../chunk-3X3Y4TMS.js";
6
6
  import "../../chunk-BQNPOGD5.js";
7
7
  import "../../chunk-MBZ55T2D.js";
8
8
  import "../../chunk-2IKT6IHB.js";
@@ -14,7 +14,7 @@ import "../../chunk-MYKYZHEO.js";
14
14
  import "../../chunk-VXWSAIB5.js";
15
15
  import "../../chunk-TYTD4FLW.js";
16
16
  import "../../chunk-5UH6QUFB.js";
17
- import "../../chunk-MX57T3HP.js";
17
+ import "../../chunk-GB4ZTUQV.js";
18
18
  import "../../chunk-6CTCHYIS.js";
19
19
  import "../../chunk-ORMEWXMH.js";
20
20
  export {
@@ -308,7 +308,8 @@ var Stack = (_a) => {
308
308
  marginBottom,
309
309
  testid,
310
310
  bottom,
311
- zIndex
311
+ zIndex,
312
+ flexWrap
312
313
  } = _b, props = __objRest(_b, [
313
314
  "children",
314
315
  "items",
@@ -347,9 +348,10 @@ var Stack = (_a) => {
347
348
  "marginBottom",
348
349
  "testid",
349
350
  "bottom",
350
- "zIndex"
351
+ "zIndex",
352
+ "flexWrap"
351
353
  ]);
352
- var _a2, _b2, _c, _d, _e, _f;
354
+ var _a2, _b2, _c, _d, _e, _f, _g;
353
355
  const flexClassNames = getFlexClassNames({ items, justify, grow });
354
356
  const gapClassNames = useGapClassNames(sizing);
355
357
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
@@ -376,7 +378,9 @@ var Stack = (_a) => {
376
378
  borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
377
379
  marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
378
380
  zIndex: zIndex !== void 0 ? zIndex : void 0,
379
- gap: (_f = props.style) == null ? void 0 : _f.gap
381
+ flexWrap,
382
+ paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
383
+ gap: (_g = props.style) == null ? void 0 : _g.gap
380
384
  },
381
385
  className: (0, import_clsx3.default)(
382
386
  "scrollbar-thin",
@@ -4,7 +4,7 @@ import {
4
4
  } from "../chunk-7CS736EF.js";
5
5
  import {
6
6
  Stack
7
- } from "../chunk-MX57T3HP.js";
7
+ } from "../chunk-GB4ZTUQV.js";
8
8
  import {
9
9
  Icon
10
10
  } from "../chunk-NKUETCDA.js";
@@ -260,7 +260,8 @@ var Stack = (_a) => {
260
260
  marginBottom,
261
261
  testid,
262
262
  bottom,
263
- zIndex
263
+ zIndex,
264
+ flexWrap
264
265
  } = _b, props = __objRest(_b, [
265
266
  "children",
266
267
  "items",
@@ -299,9 +300,10 @@ var Stack = (_a) => {
299
300
  "marginBottom",
300
301
  "testid",
301
302
  "bottom",
302
- "zIndex"
303
+ "zIndex",
304
+ "flexWrap"
303
305
  ]);
304
- var _a2, _b2, _c, _d, _e, _f;
306
+ var _a2, _b2, _c, _d, _e, _f, _g;
305
307
  const flexClassNames = getFlexClassNames({ items, justify, grow });
306
308
  const gapClassNames = useGapClassNames(sizing);
307
309
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -328,7 +330,9 @@ var Stack = (_a) => {
328
330
  borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
329
331
  marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
330
332
  zIndex: zIndex !== void 0 ? zIndex : void 0,
331
- gap: (_f = props.style) == null ? void 0 : _f.gap
333
+ flexWrap,
334
+ paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
335
+ gap: (_g = props.style) == null ? void 0 : _g.gap
332
336
  },
333
337
  className: (0, import_clsx2.default)(
334
338
  "scrollbar-thin",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Stack
3
- } from "../chunk-MX57T3HP.js";
3
+ } from "../chunk-GB4ZTUQV.js";
4
4
  import {
5
5
  Paragraph
6
6
  } from "../chunk-OGIFIPKH.js";
@@ -259,7 +259,8 @@ var Stack = (_a) => {
259
259
  marginBottom,
260
260
  testid,
261
261
  bottom,
262
- zIndex
262
+ zIndex,
263
+ flexWrap
263
264
  } = _b, props = __objRest(_b, [
264
265
  "children",
265
266
  "items",
@@ -298,9 +299,10 @@ var Stack = (_a) => {
298
299
  "marginBottom",
299
300
  "testid",
300
301
  "bottom",
301
- "zIndex"
302
+ "zIndex",
303
+ "flexWrap"
302
304
  ]);
303
- var _a2, _b2, _c, _d, _e, _f;
305
+ var _a2, _b2, _c, _d, _e, _f, _g;
304
306
  const flexClassNames = getFlexClassNames({ items, justify, grow });
305
307
  const gapClassNames = useGapClassNames(sizing);
306
308
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -327,7 +329,9 @@ var Stack = (_a) => {
327
329
  borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
328
330
  marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
329
331
  zIndex: zIndex !== void 0 ? zIndex : void 0,
330
- gap: (_f = props.style) == null ? void 0 : _f.gap
332
+ flexWrap,
333
+ paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
334
+ gap: (_g = props.style) == null ? void 0 : _g.gap
331
335
  },
332
336
  className: (0, import_clsx2.default)(
333
337
  "scrollbar-thin",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Stack
3
- } from "../chunk-MX57T3HP.js";
3
+ } from "../chunk-GB4ZTUQV.js";
4
4
  import "../chunk-6CTCHYIS.js";
5
5
  import "../chunk-ORMEWXMH.js";
6
6
  export {