@dmsi/wedgekit-react 0.0.1229 → 0.0.1230
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-YCDDBSVU.js → chunk-65HTZ3R2.js} +3 -1
- package/dist/{chunk-6R5GQV6W.js → chunk-ICJARSLG.js} +35 -11
- package/dist/{chunk-3X3Y4TMS.js → chunk-JRNU5BZ4.js} +3 -1
- package/dist/{chunk-2IKT6IHB.js → chunk-S4XW2XZW.js} +2 -0
- package/dist/{chunk-AJGTMNW5.js → chunk-XW4B4CUY.js} +59 -40
- package/dist/components/CalendarRange.cjs +26 -25
- package/dist/components/CalendarRange.js +5 -5
- package/dist/components/CompactImagesPreview.cjs +34 -10
- package/dist/components/CompactImagesPreview.js +1 -1
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +16 -15
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +5 -5
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +19 -18
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +5 -5
- package/dist/components/DataGrid/PinnedColumns.cjs +21 -20
- package/dist/components/DataGrid/PinnedColumns.js +5 -5
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +14 -13
- package/dist/components/DataGrid/TableBody/LoadingCell.js +5 -5
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +16 -15
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +5 -5
- package/dist/components/DataGrid/TableBody/index.cjs +16 -15
- package/dist/components/DataGrid/TableBody/index.js +5 -5
- package/dist/components/DataGrid/index.cjs +39 -38
- package/dist/components/DataGrid/index.js +5 -5
- package/dist/components/DataGrid/utils.cjs +14 -13
- package/dist/components/DataGrid/utils.js +5 -5
- package/dist/components/DateInput.cjs +38 -37
- package/dist/components/DateInput.js +5 -5
- package/dist/components/DateRangeInput.cjs +39 -38
- package/dist/components/DateRangeInput.js +5 -5
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +18 -17
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +5 -5
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +18 -17
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +41 -40
- package/dist/components/MobileDataGrid/index.js +5 -5
- package/dist/components/ProductImagePreview/MobileImageCarousel.cjs +2 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +1 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +3 -1
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +1 -1
- package/dist/components/ProductImagePreview/Thumbnail.cjs +3 -1
- package/dist/components/ProductImagePreview/Thumbnail.js +1 -1
- package/dist/components/ProductImagePreview/index.cjs +64 -39
- package/dist/components/ProductImagePreview/index.js +4 -4
- package/dist/components/index.cjs +138 -89
- package/dist/components/index.js +5 -5
- package/package.json +1 -1
|
@@ -7282,7 +7282,8 @@ function Thumbnail({
|
|
|
7282
7282
|
alt,
|
|
7283
7283
|
isActive,
|
|
7284
7284
|
onClick,
|
|
7285
|
-
isPlaceholder = false
|
|
7285
|
+
isPlaceholder = false,
|
|
7286
|
+
onImageError
|
|
7286
7287
|
}) {
|
|
7287
7288
|
const [imageError, setImageError] = (0, import_react29.useState)(false);
|
|
7288
7289
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
@@ -7307,6 +7308,7 @@ function Thumbnail({
|
|
|
7307
7308
|
draggable: false,
|
|
7308
7309
|
loading: "lazy",
|
|
7309
7310
|
onError: () => {
|
|
7311
|
+
onImageError == null ? void 0 : onImageError(src);
|
|
7310
7312
|
setImageError(true);
|
|
7311
7313
|
}
|
|
7312
7314
|
}
|
|
@@ -7397,6 +7399,7 @@ function ProductPrimaryImage({
|
|
|
7397
7399
|
scrollToZoomEnabled = false,
|
|
7398
7400
|
className = "",
|
|
7399
7401
|
isPlaceholder = false,
|
|
7402
|
+
onImageError,
|
|
7400
7403
|
onZoomPositionChange,
|
|
7401
7404
|
onScrollZoom
|
|
7402
7405
|
}) {
|
|
@@ -7486,12 +7489,13 @@ function ProductPrimaryImage({
|
|
|
7486
7489
|
}, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
|
|
7487
7490
|
const handleImgError = (0, import_react30.useCallback)(
|
|
7488
7491
|
(e) => {
|
|
7492
|
+
onImageError == null ? void 0 : onImageError(imageSrc);
|
|
7489
7493
|
if (!placeholderImageUri) return;
|
|
7490
7494
|
const img = e.currentTarget;
|
|
7491
7495
|
if (img.src === placeholderImageUri) return;
|
|
7492
7496
|
img.src = placeholderImageUri;
|
|
7493
7497
|
},
|
|
7494
|
-
[]
|
|
7498
|
+
[imageSrc, onImageError]
|
|
7495
7499
|
);
|
|
7496
7500
|
const pt = lastPointRef.current;
|
|
7497
7501
|
let lensStyle;
|
|
@@ -7740,6 +7744,7 @@ function MobileImageCarousel({
|
|
|
7740
7744
|
width = 483,
|
|
7741
7745
|
height = 483,
|
|
7742
7746
|
onChangeIndex,
|
|
7747
|
+
onImageError,
|
|
7743
7748
|
className = ""
|
|
7744
7749
|
}) {
|
|
7745
7750
|
const containerRef = (0, import_react32.useRef)(null);
|
|
@@ -7894,6 +7899,7 @@ function MobileImageCarousel({
|
|
|
7894
7899
|
className: "w-full h-full object-cover",
|
|
7895
7900
|
draggable: false,
|
|
7896
7901
|
loading: distance <= 1 ? "eager" : "lazy",
|
|
7902
|
+
onError: () => onImageError == null ? void 0 : onImageError(image.src),
|
|
7897
7903
|
style: {
|
|
7898
7904
|
aspectRatio: "1 / 1"
|
|
7899
7905
|
}
|
|
@@ -8034,12 +8040,13 @@ function useProductImagePreview(props) {
|
|
|
8034
8040
|
}
|
|
8035
8041
|
|
|
8036
8042
|
// src/components/ProductImagePreview/index.tsx
|
|
8043
|
+
var import_react34 = require("react");
|
|
8037
8044
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8038
8045
|
var placeholderImageUri2 = "/placeholder.svg";
|
|
8039
|
-
|
|
8040
|
-
|
|
8041
|
-
|
|
8042
|
-
|
|
8046
|
+
function hasValidImageSource(src) {
|
|
8047
|
+
const normalizedSrc = src == null ? void 0 : src.trim();
|
|
8048
|
+
return !!normalizedSrc && normalizedSrc !== placeholderImageUri2 && !normalizedSrc.endsWith("/placeholder.svg") && !normalizedSrc.includes("/placeholder.svg?");
|
|
8049
|
+
}
|
|
8043
8050
|
function ProductImagePreview(props) {
|
|
8044
8051
|
const {
|
|
8045
8052
|
width = 483,
|
|
@@ -8056,6 +8063,26 @@ function ProductImagePreview(props) {
|
|
|
8056
8063
|
zoomWindowOffset = 10,
|
|
8057
8064
|
testid
|
|
8058
8065
|
} = props;
|
|
8066
|
+
const [failedImageSources, setFailedImageSources] = (0, import_react34.useState)([]);
|
|
8067
|
+
const imageSourceKey = (0, import_react34.useMemo)(
|
|
8068
|
+
() => images.map((image) => image.src).join("|"),
|
|
8069
|
+
[images]
|
|
8070
|
+
);
|
|
8071
|
+
const validImages = (0, import_react34.useMemo)(
|
|
8072
|
+
() => images.filter(
|
|
8073
|
+
(image) => hasValidImageSource(image.src) && failedImageSources.indexOf(image.src) === -1
|
|
8074
|
+
),
|
|
8075
|
+
[failedImageSources, images]
|
|
8076
|
+
);
|
|
8077
|
+
const handleImageError = (0, import_react34.useCallback)((src) => {
|
|
8078
|
+
if (!src) return;
|
|
8079
|
+
setFailedImageSources(
|
|
8080
|
+
(previousSources) => previousSources.indexOf(src) >= 0 ? previousSources : [...previousSources, src]
|
|
8081
|
+
);
|
|
8082
|
+
}, []);
|
|
8083
|
+
(0, import_react34.useEffect)(() => {
|
|
8084
|
+
setFailedImageSources([]);
|
|
8085
|
+
}, [imageSourceKey]);
|
|
8059
8086
|
const isMobile = useMatchesMobile();
|
|
8060
8087
|
const {
|
|
8061
8088
|
zoomPoint,
|
|
@@ -8069,7 +8096,7 @@ function ProductImagePreview(props) {
|
|
|
8069
8096
|
handleZoomPositionChange,
|
|
8070
8097
|
handleScrollZoom
|
|
8071
8098
|
} = useProductImagePreview({
|
|
8072
|
-
images,
|
|
8099
|
+
images: validImages,
|
|
8073
8100
|
currentIndex,
|
|
8074
8101
|
zoomEnabled,
|
|
8075
8102
|
zoomFactor,
|
|
@@ -8078,7 +8105,7 @@ function ProductImagePreview(props) {
|
|
|
8078
8105
|
isMobile
|
|
8079
8106
|
});
|
|
8080
8107
|
if (typeof isMobile === "undefined") return null;
|
|
8081
|
-
if (isMobile && !
|
|
8108
|
+
if (isMobile && !validImages.length)
|
|
8082
8109
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8083
8110
|
"img",
|
|
8084
8111
|
{
|
|
@@ -8095,7 +8122,7 @@ function ProductImagePreview(props) {
|
|
|
8095
8122
|
}
|
|
8096
8123
|
);
|
|
8097
8124
|
const effectiveZoomEnabled = zoomEnabled && !isMobile;
|
|
8098
|
-
const showDesktopThumbnails =
|
|
8125
|
+
const showDesktopThumbnails = validImages.length > 1;
|
|
8099
8126
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
8100
8127
|
Stack,
|
|
8101
8128
|
{
|
|
@@ -8115,7 +8142,8 @@ function ProductImagePreview(props) {
|
|
|
8115
8142
|
scrollToZoomEnabled: scrollToZoomEnabled && !isMobile,
|
|
8116
8143
|
onZoomPositionChange: handleZoomPositionChange,
|
|
8117
8144
|
onScrollZoom: handleScrollZoom,
|
|
8118
|
-
isPlaceholder:
|
|
8145
|
+
isPlaceholder: validImages.length === 0,
|
|
8146
|
+
onImageError: handleImageError
|
|
8119
8147
|
}
|
|
8120
8148
|
) }),
|
|
8121
8149
|
effectiveZoomEnabled && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -8136,31 +8164,30 @@ function ProductImagePreview(props) {
|
|
|
8136
8164
|
isMobile && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8137
8165
|
MobileImageCarousel,
|
|
8138
8166
|
{
|
|
8139
|
-
images,
|
|
8167
|
+
images: validImages,
|
|
8140
8168
|
currentIndex: safeIndex,
|
|
8141
8169
|
width,
|
|
8142
8170
|
height,
|
|
8143
|
-
onChangeIndex: handleSelect
|
|
8171
|
+
onChangeIndex: handleSelect,
|
|
8172
|
+
onImageError: handleImageError
|
|
8144
8173
|
}
|
|
8145
8174
|
),
|
|
8146
|
-
showDesktopThumbnails && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "hidden md:block", children:
|
|
8175
|
+
showDesktopThumbnails && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "hidden md:block", children: validImages.length <= 3 ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8147
8176
|
"div",
|
|
8148
8177
|
{
|
|
8149
8178
|
className: "flex justify-center gap-4",
|
|
8150
8179
|
style: { width: "100%", maxWidth: width },
|
|
8151
8180
|
"aria-label": "Product image thumbnails",
|
|
8152
|
-
children: (
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
) }, img.src + i)
|
|
8163
|
-
)
|
|
8181
|
+
children: validImages.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { maxWidth: "115px" }, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8182
|
+
Thumbnail,
|
|
8183
|
+
{
|
|
8184
|
+
src: img.src,
|
|
8185
|
+
alt: img.alt || `Thumbnail ${i + 1}`,
|
|
8186
|
+
isActive: i === safeIndex,
|
|
8187
|
+
onClick: () => handleSelect(i),
|
|
8188
|
+
onImageError: handleImageError
|
|
8189
|
+
}
|
|
8190
|
+
) }, img.src + i))
|
|
8164
8191
|
}
|
|
8165
8192
|
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8166
8193
|
Grid,
|
|
@@ -8172,25 +8199,23 @@ function ProductImagePreview(props) {
|
|
|
8172
8199
|
maxWidth: width
|
|
8173
8200
|
},
|
|
8174
8201
|
columns: thumbsPerRow > 12 ? 12 : thumbsPerRow < 1 ? 1 : thumbsPerRow,
|
|
8175
|
-
children: (
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
)
|
|
8187
|
-
)
|
|
8202
|
+
children: validImages.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8203
|
+
Thumbnail,
|
|
8204
|
+
{
|
|
8205
|
+
src: img.src,
|
|
8206
|
+
alt: img.alt || `Thumbnail ${i + 1}`,
|
|
8207
|
+
isActive: i === safeIndex,
|
|
8208
|
+
onClick: () => handleSelect(i),
|
|
8209
|
+
onImageError: handleImageError
|
|
8210
|
+
},
|
|
8211
|
+
img.src + i
|
|
8212
|
+
))
|
|
8188
8213
|
}
|
|
8189
8214
|
) }),
|
|
8190
8215
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8191
8216
|
CarouselPagination,
|
|
8192
8217
|
{
|
|
8193
|
-
images,
|
|
8218
|
+
images: validImages,
|
|
8194
8219
|
currentIndex: safeIndex,
|
|
8195
8220
|
onSelect: handleSelect
|
|
8196
8221
|
}
|
|
@@ -8201,9 +8226,13 @@ function ProductImagePreview(props) {
|
|
|
8201
8226
|
}
|
|
8202
8227
|
|
|
8203
8228
|
// src/components/CompactImagesPreview.tsx
|
|
8204
|
-
var
|
|
8229
|
+
var import_react35 = require("react");
|
|
8205
8230
|
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
8206
8231
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
8232
|
+
function hasValidSourceUri(uri, placeholderImageUri3) {
|
|
8233
|
+
const normalizedUri = uri == null ? void 0 : uri.trim();
|
|
8234
|
+
return !!normalizedUri && normalizedUri !== placeholderImageUri3 && !normalizedUri.endsWith("/placeholder.svg") && !normalizedUri.includes("/placeholder.svg?");
|
|
8235
|
+
}
|
|
8207
8236
|
function CompactImagesPreview(props) {
|
|
8208
8237
|
const {
|
|
8209
8238
|
sources,
|
|
@@ -8220,18 +8249,38 @@ function CompactImagesPreview(props) {
|
|
|
8220
8249
|
testid
|
|
8221
8250
|
} = props;
|
|
8222
8251
|
const isMobile = useMatchesMobile();
|
|
8223
|
-
const
|
|
8224
|
-
const
|
|
8225
|
-
(
|
|
8252
|
+
const [failedSourceUris, setFailedSourceUris] = (0, import_react35.useState)([]);
|
|
8253
|
+
const sourceKey = (0, import_react35.useMemo)(
|
|
8254
|
+
() => sources.map((source) => source.uri).join("|"),
|
|
8255
|
+
[sources]
|
|
8256
|
+
);
|
|
8257
|
+
const validSources = (0, import_react35.useMemo)(
|
|
8258
|
+
() => sources.filter(
|
|
8259
|
+
(source) => hasValidSourceUri(source.uri, placeholderImageUri3) && failedSourceUris.indexOf(source.uri) === -1
|
|
8260
|
+
),
|
|
8261
|
+
[failedSourceUris, placeholderImageUri3, sources]
|
|
8262
|
+
);
|
|
8263
|
+
const imagesCount = validSources.length;
|
|
8264
|
+
const safeCurrentSourceIndex = currentSourceIndex >= 0 && currentSourceIndex < imagesCount ? currentSourceIndex : 0;
|
|
8265
|
+
(0, import_react35.useEffect)(() => {
|
|
8266
|
+
setFailedSourceUris([]);
|
|
8267
|
+
}, [sourceKey]);
|
|
8268
|
+
const handleImgError = (0, import_react35.useCallback)(
|
|
8269
|
+
(e, failedUri) => {
|
|
8270
|
+
if (failedUri) {
|
|
8271
|
+
setFailedSourceUris(
|
|
8272
|
+
(previousUris) => previousUris.indexOf(failedUri) >= 0 ? previousUris : [...previousUris, failedUri]
|
|
8273
|
+
);
|
|
8274
|
+
}
|
|
8226
8275
|
if (!placeholderImageUri3) return;
|
|
8227
8276
|
const img = e.currentTarget;
|
|
8228
8277
|
if (img.src === placeholderImageUri3) return;
|
|
8229
8278
|
img.src = placeholderImageUri3;
|
|
8230
8279
|
if (!img.alt) img.alt = placeholderAlt;
|
|
8231
8280
|
},
|
|
8232
|
-
[
|
|
8281
|
+
[placeholderAlt, placeholderImageUri3]
|
|
8233
8282
|
);
|
|
8234
|
-
const handleThumbnailClick = (0,
|
|
8283
|
+
const handleThumbnailClick = (0, import_react35.useCallback)(
|
|
8235
8284
|
(newIndex) => {
|
|
8236
8285
|
if (newIndex === currentSourceIndex) return;
|
|
8237
8286
|
if (newIndex < 0 || newIndex >= imagesCount) return;
|
|
@@ -8239,7 +8288,7 @@ function CompactImagesPreview(props) {
|
|
|
8239
8288
|
},
|
|
8240
8289
|
[currentSourceIndex, onChangeSource, imagesCount]
|
|
8241
8290
|
);
|
|
8242
|
-
if (!
|
|
8291
|
+
if (!validSources.length || typeof isMobile === "undefined")
|
|
8243
8292
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8244
8293
|
"img",
|
|
8245
8294
|
{
|
|
@@ -8253,11 +8302,11 @@ function CompactImagesPreview(props) {
|
|
|
8253
8302
|
},
|
|
8254
8303
|
src: placeholderImageUri3,
|
|
8255
8304
|
alt: placeholderAlt,
|
|
8256
|
-
onError: handleImgError,
|
|
8305
|
+
onError: (event) => handleImgError(event),
|
|
8257
8306
|
onClick: onMainImageClick
|
|
8258
8307
|
}
|
|
8259
8308
|
);
|
|
8260
|
-
const currentSource =
|
|
8309
|
+
const currentSource = validSources[safeCurrentSourceIndex];
|
|
8261
8310
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(Stack, { "data-testid": testid, sizing: "layout", children: [
|
|
8262
8311
|
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8263
8312
|
"img",
|
|
@@ -8272,11 +8321,11 @@ function CompactImagesPreview(props) {
|
|
|
8272
8321
|
},
|
|
8273
8322
|
src: currentSource.uri,
|
|
8274
8323
|
alt: currentSource.name,
|
|
8275
|
-
onError: handleImgError,
|
|
8324
|
+
onError: (event) => handleImgError(event, currentSource.uri),
|
|
8276
8325
|
onClick: onMainImageClick
|
|
8277
8326
|
}
|
|
8278
8327
|
),
|
|
8279
|
-
imagesCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-row flex-wrap items-center gap-3", children:
|
|
8328
|
+
imagesCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-row flex-wrap items-center gap-3", children: validSources.slice(0, 4).map((source, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8280
8329
|
"button",
|
|
8281
8330
|
{
|
|
8282
8331
|
"data-testid": testid ? `${testid}-thumbnail-${index}` : void 0,
|
|
@@ -8286,7 +8335,7 @@ function CompactImagesPreview(props) {
|
|
|
8286
8335
|
},
|
|
8287
8336
|
className: (0, import_clsx36.default)(
|
|
8288
8337
|
"cursor-pointer",
|
|
8289
|
-
|
|
8338
|
+
safeCurrentSourceIndex === index && enableThumbnailBorder ? "ring-2 ring-offset-2 ring-brand-400 transition-discrete duration-300" : "ring-brand-400/0"
|
|
8290
8339
|
),
|
|
8291
8340
|
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
8292
8341
|
"img",
|
|
@@ -8299,7 +8348,7 @@ function CompactImagesPreview(props) {
|
|
|
8299
8348
|
objectPosition: "center",
|
|
8300
8349
|
objectFit: "cover"
|
|
8301
8350
|
},
|
|
8302
|
-
onError: handleImgError
|
|
8351
|
+
onError: (event) => handleImgError(event, source.uri)
|
|
8303
8352
|
}
|
|
8304
8353
|
)
|
|
8305
8354
|
},
|
|
@@ -8371,7 +8420,7 @@ function SimpleTable({
|
|
|
8371
8420
|
}
|
|
8372
8421
|
|
|
8373
8422
|
// src/components/ListGroup.tsx
|
|
8374
|
-
var
|
|
8423
|
+
var import_react36 = require("react");
|
|
8375
8424
|
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
8376
8425
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8377
8426
|
function ListGroup({
|
|
@@ -8384,7 +8433,7 @@ function ListGroup({
|
|
|
8384
8433
|
className,
|
|
8385
8434
|
children
|
|
8386
8435
|
}) {
|
|
8387
|
-
const [uncontrolledOpen, setUncontrolledOpen] = (0,
|
|
8436
|
+
const [uncontrolledOpen, setUncontrolledOpen] = (0, import_react36.useState)(defaultOpen);
|
|
8388
8437
|
const isControlled = controlledOpen !== void 0;
|
|
8389
8438
|
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
8390
8439
|
const toggle = () => {
|
|
@@ -8424,7 +8473,7 @@ function ListGroup({
|
|
|
8424
8473
|
}
|
|
8425
8474
|
|
|
8426
8475
|
// src/components/Pagination.tsx
|
|
8427
|
-
var
|
|
8476
|
+
var import_react37 = require("react");
|
|
8428
8477
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
8429
8478
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8430
8479
|
var Pagination = ({
|
|
@@ -8436,7 +8485,7 @@ var Pagination = ({
|
|
|
8436
8485
|
className,
|
|
8437
8486
|
disabled
|
|
8438
8487
|
}) => {
|
|
8439
|
-
const goTo = (0,
|
|
8488
|
+
const goTo = (0, import_react37.useCallback)(
|
|
8440
8489
|
(page) => {
|
|
8441
8490
|
if (disabled) return;
|
|
8442
8491
|
onPageChange(page);
|
|
@@ -8453,7 +8502,7 @@ var Pagination = ({
|
|
|
8453
8502
|
goTo(currentPage + 1);
|
|
8454
8503
|
}
|
|
8455
8504
|
};
|
|
8456
|
-
const pageTokens = (0,
|
|
8505
|
+
const pageTokens = (0, import_react37.useMemo)(() => {
|
|
8457
8506
|
if (totalPages <= 5) {
|
|
8458
8507
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
8459
8508
|
}
|
|
@@ -8618,7 +8667,7 @@ function EmptyCartIcon() {
|
|
|
8618
8667
|
}
|
|
8619
8668
|
|
|
8620
8669
|
// src/components/SearchResultImage/index.tsx
|
|
8621
|
-
var
|
|
8670
|
+
var import_react38 = require("react");
|
|
8622
8671
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8623
8672
|
function SearchResultImage({
|
|
8624
8673
|
width = 20,
|
|
@@ -8626,7 +8675,7 @@ function SearchResultImage({
|
|
|
8626
8675
|
src,
|
|
8627
8676
|
alt
|
|
8628
8677
|
}) {
|
|
8629
|
-
const [imageError, setImageError] = (0,
|
|
8678
|
+
const [imageError, setImageError] = (0, import_react38.useState)(false);
|
|
8630
8679
|
const showPlaceholder = imageError || !src;
|
|
8631
8680
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_jsx_runtime60.Fragment, { children: showPlaceholder ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ImagePlaceholder, { width, height }) : /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8632
8681
|
"img",
|
|
@@ -8644,7 +8693,7 @@ function SearchResultImage({
|
|
|
8644
8693
|
|
|
8645
8694
|
// src/components/Alert.tsx
|
|
8646
8695
|
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
8647
|
-
var
|
|
8696
|
+
var import_react39 = require("react");
|
|
8648
8697
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8649
8698
|
function Alert(_a) {
|
|
8650
8699
|
var _b = _a, {
|
|
@@ -8665,7 +8714,7 @@ function Alert(_a) {
|
|
|
8665
8714
|
"onClose"
|
|
8666
8715
|
]);
|
|
8667
8716
|
const isError = variant === "error";
|
|
8668
|
-
const handleClose = (0,
|
|
8717
|
+
const handleClose = (0, import_react39.useCallback)(() => {
|
|
8669
8718
|
if (onClose) onClose();
|
|
8670
8719
|
}, [onClose]);
|
|
8671
8720
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
@@ -8752,11 +8801,11 @@ function OrderCheckIcon(_a) {
|
|
|
8752
8801
|
}
|
|
8753
8802
|
|
|
8754
8803
|
// src/components/EditingContext.tsx
|
|
8755
|
-
var
|
|
8804
|
+
var import_react40 = require("react");
|
|
8756
8805
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
8757
|
-
var EditingContext = (0,
|
|
8806
|
+
var EditingContext = (0, import_react40.createContext)(null);
|
|
8758
8807
|
var useTableEditingContext = () => {
|
|
8759
|
-
const context = (0,
|
|
8808
|
+
const context = (0, import_react40.useContext)(EditingContext);
|
|
8760
8809
|
if (!context) {
|
|
8761
8810
|
throw new Error("useTableEditingContext must be used within EditingProvider");
|
|
8762
8811
|
}
|
|
@@ -8957,7 +9006,7 @@ function AccessCard(props) {
|
|
|
8957
9006
|
|
|
8958
9007
|
// src/components/AccessCardGroup.tsx
|
|
8959
9008
|
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
8960
|
-
var
|
|
9009
|
+
var import_react41 = require("react");
|
|
8961
9010
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8962
9011
|
function AccessCardGroup(props) {
|
|
8963
9012
|
const {
|
|
@@ -8971,7 +9020,7 @@ function AccessCardGroup(props) {
|
|
|
8971
9020
|
testid,
|
|
8972
9021
|
unavailable
|
|
8973
9022
|
} = props;
|
|
8974
|
-
const [expand, setExpand] = (0,
|
|
9023
|
+
const [expand, setExpand] = (0, import_react41.useState)(expanded);
|
|
8975
9024
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { "data-testid": testid, className: "mb-mobile-layout-group-gap desktop:mb-desktop-layout-group-gap compact:mb-desktop-compact-layout-group-gap", children: [
|
|
8976
9025
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
8977
9026
|
"div",
|
|
@@ -9028,7 +9077,7 @@ function AccessCardGroup(props) {
|
|
|
9028
9077
|
}
|
|
9029
9078
|
|
|
9030
9079
|
// src/components/EmblaCarousel/index.tsx
|
|
9031
|
-
var
|
|
9080
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
9032
9081
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
|
|
9033
9082
|
var import_embla_carousel_autoplay = __toESM(require("embla-carousel-autoplay"), 1);
|
|
9034
9083
|
|
|
@@ -9044,15 +9093,15 @@ var SelectedSnapDisplay = (props) => {
|
|
|
9044
9093
|
};
|
|
9045
9094
|
|
|
9046
9095
|
// src/components/EmblaCarousel/useSelectedSnapDisplay.ts
|
|
9047
|
-
var
|
|
9096
|
+
var import_react42 = require("react");
|
|
9048
9097
|
var useSelectedSnapDisplay = (emblaApi) => {
|
|
9049
|
-
const [selectedSnap, setSelectedSnap] = (0,
|
|
9050
|
-
const [snapCount, setSnapCount] = (0,
|
|
9051
|
-
const updateScrollSnapState = (0,
|
|
9098
|
+
const [selectedSnap, setSelectedSnap] = (0, import_react42.useState)(0);
|
|
9099
|
+
const [snapCount, setSnapCount] = (0, import_react42.useState)(0);
|
|
9100
|
+
const updateScrollSnapState = (0, import_react42.useCallback)((emblaApi2) => {
|
|
9052
9101
|
setSnapCount(emblaApi2.snapList().length);
|
|
9053
9102
|
setSelectedSnap(emblaApi2.selectedSnap());
|
|
9054
9103
|
}, []);
|
|
9055
|
-
(0,
|
|
9104
|
+
(0, import_react42.useEffect)(() => {
|
|
9056
9105
|
if (!emblaApi) return;
|
|
9057
9106
|
updateScrollSnapState(emblaApi);
|
|
9058
9107
|
emblaApi.on("select", updateScrollSnapState);
|
|
@@ -9148,23 +9197,23 @@ var NextButton = (props) => {
|
|
|
9148
9197
|
};
|
|
9149
9198
|
|
|
9150
9199
|
// src/components/EmblaCarousel/usePrevNextButtons.ts
|
|
9151
|
-
var
|
|
9200
|
+
var import_react43 = require("react");
|
|
9152
9201
|
var usePrevNextButtons = (emblaApi) => {
|
|
9153
|
-
const [prevBtnDisabled, setPrevBtnDisabled] = (0,
|
|
9154
|
-
const [nextBtnDisabled, setNextBtnDisabled] = (0,
|
|
9155
|
-
const onPrevButtonClick = (0,
|
|
9202
|
+
const [prevBtnDisabled, setPrevBtnDisabled] = (0, import_react43.useState)(true);
|
|
9203
|
+
const [nextBtnDisabled, setNextBtnDisabled] = (0, import_react43.useState)(true);
|
|
9204
|
+
const onPrevButtonClick = (0, import_react43.useCallback)(() => {
|
|
9156
9205
|
if (!emblaApi) return;
|
|
9157
9206
|
emblaApi.goToPrev();
|
|
9158
9207
|
}, [emblaApi]);
|
|
9159
|
-
const onNextButtonClick = (0,
|
|
9208
|
+
const onNextButtonClick = (0, import_react43.useCallback)(() => {
|
|
9160
9209
|
if (!emblaApi) return;
|
|
9161
9210
|
emblaApi.goToNext();
|
|
9162
9211
|
}, [emblaApi]);
|
|
9163
|
-
const onSelect = (0,
|
|
9212
|
+
const onSelect = (0, import_react43.useCallback)((emblaApi2) => {
|
|
9164
9213
|
setPrevBtnDisabled(!emblaApi2.canGoToPrev());
|
|
9165
9214
|
setNextBtnDisabled(!emblaApi2.canGoToNext());
|
|
9166
9215
|
}, []);
|
|
9167
|
-
(0,
|
|
9216
|
+
(0, import_react43.useEffect)(() => {
|
|
9168
9217
|
if (!emblaApi) return;
|
|
9169
9218
|
onSelect(emblaApi);
|
|
9170
9219
|
emblaApi.on("reinit", onSelect).on("select", onSelect);
|
|
@@ -9194,11 +9243,11 @@ var EmblaCarousel = ({
|
|
|
9194
9243
|
options,
|
|
9195
9244
|
autoplay ? [autoplayPlugin] : []
|
|
9196
9245
|
);
|
|
9197
|
-
const emblaRootRef = (0,
|
|
9198
|
-
const [emblaHeight, setEmblaHeight] =
|
|
9246
|
+
const emblaRootRef = (0, import_react44.useRef)(null);
|
|
9247
|
+
const [emblaHeight, setEmblaHeight] = import_react44.default.useState(
|
|
9199
9248
|
void 0
|
|
9200
9249
|
);
|
|
9201
|
-
(0,
|
|
9250
|
+
(0, import_react44.useEffect)(() => {
|
|
9202
9251
|
if (!emblaApi || !leftRightChevrons) return;
|
|
9203
9252
|
const updateHeight = () => {
|
|
9204
9253
|
const selectedIndex = emblaApi.selectedSnap();
|
|
@@ -9214,7 +9263,7 @@ var EmblaCarousel = ({
|
|
|
9214
9263
|
emblaApi.off("reinit", updateHeight);
|
|
9215
9264
|
};
|
|
9216
9265
|
}, [emblaApi, leftRightChevrons]);
|
|
9217
|
-
(0,
|
|
9266
|
+
(0, import_react44.useEffect)(() => {
|
|
9218
9267
|
var _a, _b;
|
|
9219
9268
|
if (!emblaApi || !autoplay) return;
|
|
9220
9269
|
(_b = (_a = emblaApi.plugins()) == null ? void 0 : _a.autoplay) == null ? void 0 : _b.play();
|
|
@@ -9226,18 +9275,18 @@ var EmblaCarousel = ({
|
|
|
9226
9275
|
onNextButtonClick
|
|
9227
9276
|
} = usePrevNextButtons(emblaApi);
|
|
9228
9277
|
const { selectedSnap, snapCount } = useSelectedSnapDisplay(emblaApi);
|
|
9229
|
-
const tweenFactor = (0,
|
|
9230
|
-
const tweenNodes = (0,
|
|
9278
|
+
const tweenFactor = (0, import_react44.useRef)(0);
|
|
9279
|
+
const tweenNodes = (0, import_react44.useRef)([]);
|
|
9231
9280
|
const isMobile = useMatchesMobile();
|
|
9232
|
-
const setTweenNodes = (0,
|
|
9281
|
+
const setTweenNodes = (0, import_react44.useCallback)((api) => {
|
|
9233
9282
|
tweenNodes.current = api.slideNodes().map((slideNode) => {
|
|
9234
9283
|
return slideNode.querySelector(".embla__parallax__layer");
|
|
9235
9284
|
});
|
|
9236
9285
|
}, []);
|
|
9237
|
-
const setTweenFactor = (0,
|
|
9286
|
+
const setTweenFactor = (0, import_react44.useCallback)((api) => {
|
|
9238
9287
|
tweenFactor.current = TWEEN_FACTOR_BASE * api.snapList().length;
|
|
9239
9288
|
}, []);
|
|
9240
|
-
const tweenParallax = (0,
|
|
9289
|
+
const tweenParallax = (0, import_react44.useCallback)(
|
|
9241
9290
|
(api, event) => {
|
|
9242
9291
|
const engine = api.internalEngine();
|
|
9243
9292
|
const scrollProgress = api.scrollProgress();
|
|
@@ -9270,7 +9319,7 @@ var EmblaCarousel = ({
|
|
|
9270
9319
|
},
|
|
9271
9320
|
[]
|
|
9272
9321
|
);
|
|
9273
|
-
(0,
|
|
9322
|
+
(0, import_react44.useEffect)(() => {
|
|
9274
9323
|
if (!emblaApi || !isMobile) return;
|
|
9275
9324
|
setTweenNodes(emblaApi);
|
|
9276
9325
|
setTweenFactor(emblaApi);
|
package/dist/components/index.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
} from "../chunk-Y5GD2FJA.js";
|
|
12
12
|
import {
|
|
13
13
|
ProductImagePreview
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-XW4B4CUY.js";
|
|
15
15
|
import "../chunk-MBZ55T2D.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-S4XW2XZW.js";
|
|
17
|
+
import "../chunk-65HTZ3R2.js";
|
|
18
|
+
import "../chunk-JRNU5BZ4.js";
|
|
19
19
|
import "../chunk-BQNPOGD5.js";
|
|
20
20
|
import {
|
|
21
21
|
EmblaCarousel
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
} from "../chunk-I3W5K76C.js";
|
|
95
95
|
import {
|
|
96
96
|
CompactImagesPreview
|
|
97
|
-
} from "../chunk-
|
|
97
|
+
} from "../chunk-ICJARSLG.js";
|
|
98
98
|
import "../chunk-ZRFXUER3.js";
|
|
99
99
|
import "../chunk-WVGXD7HT.js";
|
|
100
100
|
import "../chunk-VXWSAIB5.js";
|