@dmsi/wedgekit-react 0.0.388 → 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.
- package/dist/{chunk-BPJR54VM.js → chunk-2HMCS25C.js} +5 -5
- package/dist/{chunk-HPQWEZJL.js → chunk-3X3Y4TMS.js} +7 -2
- package/dist/{chunk-QJTAFSQA.js → chunk-44TDIHUP.js} +3 -3
- package/dist/{chunk-5Z4ODAYB.js → chunk-6I5LZ2ZC.js} +6 -6
- package/dist/{chunk-KSAN4ZLA.js → chunk-AA6GE3TH.js} +1 -1
- package/dist/{chunk-E4AGWXFA.js → chunk-D6YCMQPO.js} +7 -7
- package/dist/{chunk-DCCTNHNL.js → chunk-ERW5DEIO.js} +1 -1
- package/dist/{chunk-4LXG6QNT.js → chunk-EZCH4PQS.js} +2 -1
- package/dist/{chunk-CQFPNZTN.js → chunk-G5DEC7H3.js} +15 -5
- package/dist/{chunk-MX57T3HP.js → chunk-GB4ZTUQV.js} +8 -4
- package/dist/{chunk-JRHYNZM6.js → chunk-JIMJIJOF.js} +4 -4
- package/dist/{chunk-QF654HYZ.js → chunk-KZZKQLKF.js} +3 -3
- package/dist/{chunk-4XTTJOQA.js → chunk-LCJZRP5S.js} +14 -5
- package/dist/{chunk-2XHBPMHQ.js → chunk-LLZ3SSZJ.js} +4 -4
- package/dist/{chunk-A7CEYUVE.js → chunk-LZGYABCX.js} +3 -3
- package/dist/{chunk-FSLETAX4.js → chunk-MQX7GFLX.js} +11 -4
- package/dist/{chunk-B6FYJZG7.js → chunk-OW3WN3JV.js} +15 -15
- package/dist/components/Accordion.cjs +10 -5
- package/dist/components/Accordion.js +3 -3
- package/dist/components/CalendarRange.cjs +24 -21
- package/dist/components/CalendarRange.css +18 -0
- package/dist/components/CalendarRange.js +25 -25
- package/dist/components/Card.cjs +2 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/CompactImagesPreview.cjs +18 -7
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +14 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +18 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +25 -25
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +17 -14
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +18 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +25 -25
- package/dist/components/DataGrid/PinnedColumns.cjs +19 -16
- package/dist/components/DataGrid/PinnedColumns.css +18 -0
- package/dist/components/DataGrid/PinnedColumns.js +25 -25
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +12 -9
- package/dist/components/DataGrid/TableBody/LoadingCell.css +18 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +25 -25
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +14 -11
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +18 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +25 -25
- package/dist/components/DataGrid/TableBody/index.cjs +14 -11
- package/dist/components/DataGrid/TableBody/index.css +18 -0
- package/dist/components/DataGrid/TableBody/index.js +25 -25
- package/dist/components/DataGrid/index.cjs +36 -33
- package/dist/components/DataGrid/index.css +18 -0
- package/dist/components/DataGrid/index.js +25 -25
- package/dist/components/DataGrid/utils.cjs +12 -9
- package/dist/components/DataGrid/utils.css +18 -0
- package/dist/components/DataGrid/utils.js +25 -25
- package/dist/components/DataGridCell.js +2 -2
- package/dist/components/DateInput.cjs +37 -34
- package/dist/components/DateInput.css +18 -0
- package/dist/components/DateInput.js +25 -25
- package/dist/components/DateRangeInput.cjs +37 -34
- package/dist/components/DateRangeInput.css +18 -0
- package/dist/components/DateRangeInput.js +25 -25
- package/dist/components/FilterGroup.cjs +11 -2
- package/dist/components/FilterGroup.js +8 -8
- package/dist/components/MobileDataGrid/ColumnList.cjs +8 -4
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +16 -13
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +18 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +25 -25
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +8 -4
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +24 -17
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +25 -25
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +8 -4
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +8 -4
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +8 -8
- package/dist/components/MobileDataGrid/index.cjs +50 -43
- package/dist/components/MobileDataGrid/index.css +18 -0
- package/dist/components/MobileDataGrid/index.js +25 -25
- package/dist/components/Modal.js +5 -5
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalHeader.js +2 -2
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.js +2 -2
- package/dist/components/Notification.cjs +8 -4
- package/dist/components/Notification.js +5 -5
- package/dist/components/OptionPill.cjs +11 -2
- package/dist/components/OptionPill.js +2 -2
- package/dist/components/PDFViewer/DownloadIcon.js +2 -2
- package/dist/components/PDFViewer/PDFElement.cjs +8 -4
- package/dist/components/PDFViewer/PDFElement.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.cjs +8 -4
- package/dist/components/PDFViewer/PDFNavigation.js +3 -3
- package/dist/components/PDFViewer/index.cjs +8 -4
- package/dist/components/PDFViewer/index.js +10 -10
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +15 -5
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.cjs +7 -2
- package/dist/components/ProductImagePreview/Thumbnail.js +1 -1
- package/dist/components/ProductImagePreview/index.cjs +84 -63
- package/dist/components/ProductImagePreview/index.js +4 -4
- package/dist/components/SideMenuGroup.cjs +8 -4
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +8 -4
- package/dist/components/SideMenuItem.js +3 -3
- package/dist/components/Stack.cjs +8 -4
- package/dist/components/Stack.js +1 -1
- package/dist/components/Stepper.js +3 -3
- package/dist/components/Swatch.cjs +8 -4
- package/dist/components/Swatch.js +3 -3
- package/dist/components/Time.cjs +8 -4
- package/dist/components/Time.js +1 -1
- package/dist/components/Toast.js +3 -3
- package/dist/components/Upload.cjs +8 -4
- package/dist/components/Upload.js +5 -5
- package/dist/components/index.cjs +100 -71
- package/dist/components/index.css +18 -0
- package/dist/components/index.js +31 -31
- package/dist/index.css +18 -0
- package/package.json +1 -1
- package/src/components/Card.tsx +15 -4
- package/src/components/CompactImagesPreview.tsx +10 -3
- package/src/components/OptionPill.tsx +13 -1
- package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +16 -5
- package/src/components/ProductImagePreview/Thumbnail.tsx +7 -1
- package/src/components/Stack.tsx +4 -0
- package/dist/{chunk-XFZRKXMV.js → chunk-EJSPFQCY.js} +3 -3
- package/dist/{chunk-YUBQJQ75.js → chunk-FHQL42YP.js} +3 -3
- package/dist/{chunk-EC7SC3MO.js → chunk-T36HX6QY.js} +3 -3
- package/dist/{chunk-77IGUML3.js → chunk-V47RTW7E.js} +3 -3
- package/dist/{chunk-5OPI4GTJ.js → chunk-XM7IQHBU.js} +3 -3
|
@@ -541,7 +541,8 @@ var Stack = (_a) => {
|
|
|
541
541
|
marginBottom,
|
|
542
542
|
testid,
|
|
543
543
|
bottom,
|
|
544
|
-
zIndex
|
|
544
|
+
zIndex,
|
|
545
|
+
flexWrap
|
|
545
546
|
} = _b, props = __objRest(_b, [
|
|
546
547
|
"children",
|
|
547
548
|
"items",
|
|
@@ -580,9 +581,10 @@ var Stack = (_a) => {
|
|
|
580
581
|
"marginBottom",
|
|
581
582
|
"testid",
|
|
582
583
|
"bottom",
|
|
583
|
-
"zIndex"
|
|
584
|
+
"zIndex",
|
|
585
|
+
"flexWrap"
|
|
584
586
|
]);
|
|
585
|
-
var _a2, _b2, _c, _d, _e, _f;
|
|
587
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
586
588
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
587
589
|
const gapClassNames = useGapClassNames(sizing);
|
|
588
590
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -609,7 +611,9 @@ var Stack = (_a) => {
|
|
|
609
611
|
borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
|
|
610
612
|
marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
|
|
611
613
|
zIndex: zIndex !== void 0 ? zIndex : void 0,
|
|
612
|
-
|
|
614
|
+
flexWrap,
|
|
615
|
+
paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
|
|
616
|
+
gap: (_g = props.style) == null ? void 0 : _g.gap
|
|
613
617
|
},
|
|
614
618
|
className: (0, import_clsx6.default)(
|
|
615
619
|
"scrollbar-thin",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PdfNavigation
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-2HMCS25C.js";
|
|
4
4
|
import "../../chunk-EU73QPW7.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-GB4ZTUQV.js";
|
|
6
6
|
import "../../chunk-OGIFIPKH.js";
|
|
7
|
-
import "../../chunk-MX57T3HP.js";
|
|
8
7
|
import "../../chunk-NKUETCDA.js";
|
|
8
|
+
import "../../chunk-WWAPK5PH.js";
|
|
9
9
|
import "../../chunk-6CTCHYIS.js";
|
|
10
10
|
import "../../chunk-ORMEWXMH.js";
|
|
11
11
|
export {
|
|
@@ -996,7 +996,8 @@ var Stack = (_a) => {
|
|
|
996
996
|
marginBottom,
|
|
997
997
|
testid,
|
|
998
998
|
bottom,
|
|
999
|
-
zIndex
|
|
999
|
+
zIndex,
|
|
1000
|
+
flexWrap
|
|
1000
1001
|
} = _b, props = __objRest(_b, [
|
|
1001
1002
|
"children",
|
|
1002
1003
|
"items",
|
|
@@ -1035,9 +1036,10 @@ var Stack = (_a) => {
|
|
|
1035
1036
|
"marginBottom",
|
|
1036
1037
|
"testid",
|
|
1037
1038
|
"bottom",
|
|
1038
|
-
"zIndex"
|
|
1039
|
+
"zIndex",
|
|
1040
|
+
"flexWrap"
|
|
1039
1041
|
]);
|
|
1040
|
-
var _a2, _b2, _c, _d, _e, _f;
|
|
1042
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
1041
1043
|
const flexClassNames = getFlexClassNames({ items, justify, grow });
|
|
1042
1044
|
const gapClassNames = useGapClassNames(sizing);
|
|
1043
1045
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -1064,7 +1066,9 @@ var Stack = (_a) => {
|
|
|
1064
1066
|
borderBlock: (_d = props.style) == null ? void 0 : _d.borderBlock,
|
|
1065
1067
|
marginInline: (_e = props.style) == null ? void 0 : _e.marginInline,
|
|
1066
1068
|
zIndex: zIndex !== void 0 ? zIndex : void 0,
|
|
1067
|
-
|
|
1069
|
+
flexWrap,
|
|
1070
|
+
paddingInline: (_f = props.style) == null ? void 0 : _f.paddingInline,
|
|
1071
|
+
gap: (_g = props.style) == null ? void 0 : _g.gap
|
|
1068
1072
|
},
|
|
1069
1073
|
className: (0, import_clsx10.default)(
|
|
1070
1074
|
"scrollbar-thin",
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
PDFViewer
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
4
|
+
} from "../../chunk-LLZ3SSZJ.js";
|
|
5
|
+
import "../../chunk-EJSPFQCY.js";
|
|
6
|
+
import "../../chunk-ERW5DEIO.js";
|
|
7
|
+
import "../../chunk-2HMCS25C.js";
|
|
8
8
|
import "../../chunk-VJVY6NPF.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-D6YCMQPO.js";
|
|
10
10
|
import "../../chunk-4RJKB7LC.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-AG43RS4Q.js";
|
|
13
|
-
import "../../chunk-5OPI4GTJ.js";
|
|
11
|
+
import "../../chunk-XM7IQHBU.js";
|
|
14
12
|
import "../../chunk-FRHPFACM.js";
|
|
13
|
+
import "../../chunk-T36HX6QY.js";
|
|
14
|
+
import "../../chunk-AG43RS4Q.js";
|
|
15
15
|
import "../../chunk-SBRRNFOP.js";
|
|
16
16
|
import "../../chunk-EU73QPW7.js";
|
|
17
|
-
import "../../chunk-WWAPK5PH.js";
|
|
18
17
|
import "../../chunk-MYKYZHEO.js";
|
|
19
18
|
import "../../chunk-VXWSAIB5.js";
|
|
20
19
|
import "../../chunk-TYTD4FLW.js";
|
|
21
20
|
import "../../chunk-5UH6QUFB.js";
|
|
21
|
+
import "../../chunk-GB4ZTUQV.js";
|
|
22
22
|
import "../../chunk-OGIFIPKH.js";
|
|
23
|
-
import "../../chunk-MX57T3HP.js";
|
|
24
23
|
import "../../chunk-NKUETCDA.js";
|
|
24
|
+
import "../../chunk-WWAPK5PH.js";
|
|
25
25
|
import "../../chunk-6CTCHYIS.js";
|
|
26
26
|
import "../../chunk-ORMEWXMH.js";
|
|
27
27
|
export {
|
|
@@ -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,
|
|
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: {
|
|
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),
|
|
@@ -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
|
}
|
|
@@ -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
|
-
|
|
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
|
|
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 =
|
|
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
|
|
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,
|
|
580
|
-
const lastPointRef = (0,
|
|
581
|
-
const rafRef = (0,
|
|
582
|
-
const [active, setActive] = (0,
|
|
583
|
-
const [, forceRerender] = (0,
|
|
584
|
-
const [imageLoading, setImageLoading] = (0,
|
|
585
|
-
const [imageError, setImageError] = (0,
|
|
586
|
-
const imageSrc = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
658
|
+
[zoomEnabled, active, imageError, zoomLensSize, onZoomPositionChange]
|
|
648
659
|
);
|
|
649
|
-
(0,
|
|
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: {
|
|
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
|
|
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,
|
|
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
|
|
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,
|
|
914
|
-
const [isDragging, setIsDragging] = (0,
|
|
915
|
-
const [startX, setStartX] = (0,
|
|
916
|
-
const [currentTranslate, setCurrentTranslate] = (0,
|
|
917
|
-
const [prevTranslate, setPrevTranslate] = (0,
|
|
918
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
970
|
+
const handleStart = (0, import_react6.useCallback)((clientX) => {
|
|
950
971
|
setIsDragging(true);
|
|
951
972
|
setStartX(clientX);
|
|
952
973
|
}, []);
|
|
953
|
-
const handleMove = (0,
|
|
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,
|
|
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,
|
|
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
|
|
1111
|
+
var import_react7 = require("react");
|
|
1091
1112
|
|
|
1092
1113
|
// src/hooks/useInfiniteScroll.tsx
|
|
1093
|
-
var
|
|
1114
|
+
var import_react8 = require("react");
|
|
1094
1115
|
|
|
1095
1116
|
// src/hooks/useMatchesMedia.ts
|
|
1096
|
-
var
|
|
1117
|
+
var import_react9 = require("react");
|
|
1097
1118
|
var useMatchesMedia = (query) => {
|
|
1098
|
-
const [matches, setMatches] = (0,
|
|
1099
|
-
(0,
|
|
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
|
|
1132
|
+
var import_react10 = require("react");
|
|
1112
1133
|
|
|
1113
1134
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
1114
|
-
var
|
|
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,
|
|
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,
|
|
1131
|
-
const [zoomActive, setZoomActive] = (0,
|
|
1132
|
-
const [currentZoomFactor, setCurrentZoomFactor] = (0,
|
|
1133
|
-
const [primaryImagePosition, setPrimaryImagePosition] = (0,
|
|
1134
|
-
const primaryImageRef = (0,
|
|
1135
|
-
const cleanupRef = (0,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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-
|
|
4
|
-
import "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
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-
|
|
17
|
+
import "../../chunk-GB4ZTUQV.js";
|
|
18
18
|
import "../../chunk-6CTCHYIS.js";
|
|
19
19
|
import "../../chunk-ORMEWXMH.js";
|
|
20
20
|
export {
|