@snowcone-app/ui 0.4.6 → 0.4.7
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +619 -598
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +313 -294
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/composed/HeroProductImage.tsx +10 -0
- package/src/index.ts +7 -0
- package/src/patterns/MockupBackground.tsx +43 -0
package/dist/index.js
CHANGED
|
@@ -9004,8 +9004,19 @@ var LoadingOverlayPrismCandyInline = memo2(
|
|
|
9004
9004
|
import { useRealtimeMockup as useRealtimeMockup3 } from "@snowcone-app/sdk/react";
|
|
9005
9005
|
import { getProduct as getProduct3, listProducts as listProducts4, getMockupUrl as getMockupUrl2 } from "@snowcone-app/sdk";
|
|
9006
9006
|
|
|
9007
|
-
// src/patterns/
|
|
9007
|
+
// src/patterns/MockupBackground.tsx
|
|
9008
|
+
import { createContext as createContext9, useContext as useContext7 } from "react";
|
|
9008
9009
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
9010
|
+
var MockupBackgroundContext = createContext9(void 0);
|
|
9011
|
+
function MockupBackground({ bg, children }) {
|
|
9012
|
+
return /* @__PURE__ */ jsx56(MockupBackgroundContext.Provider, { value: bg, children });
|
|
9013
|
+
}
|
|
9014
|
+
function useMockupBackgroundOptional() {
|
|
9015
|
+
return useContext7(MockupBackgroundContext);
|
|
9016
|
+
}
|
|
9017
|
+
|
|
9018
|
+
// src/patterns/ProductPageProvider.tsx
|
|
9019
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
9009
9020
|
function ProductPageProvider({
|
|
9010
9021
|
children,
|
|
9011
9022
|
productId,
|
|
@@ -9019,12 +9030,12 @@ function ProductPageProvider({
|
|
|
9019
9030
|
realtimeGrantUrl,
|
|
9020
9031
|
enablePriority = true
|
|
9021
9032
|
}) {
|
|
9022
|
-
let content = /* @__PURE__ */
|
|
9033
|
+
let content = /* @__PURE__ */ jsx57(Product, { productId, productData, children });
|
|
9023
9034
|
if (enablePriority) {
|
|
9024
|
-
content = /* @__PURE__ */
|
|
9035
|
+
content = /* @__PURE__ */ jsx57(MockupPriorityProvider, { children: content });
|
|
9025
9036
|
}
|
|
9026
9037
|
if (enableRealtime) {
|
|
9027
|
-
content = /* @__PURE__ */
|
|
9038
|
+
content = /* @__PURE__ */ jsx57(
|
|
9028
9039
|
RealtimeProvider,
|
|
9029
9040
|
{
|
|
9030
9041
|
wsUrl: realtimeWsUrl,
|
|
@@ -9034,7 +9045,7 @@ function ProductPageProvider({
|
|
|
9034
9045
|
}
|
|
9035
9046
|
);
|
|
9036
9047
|
}
|
|
9037
|
-
return /* @__PURE__ */
|
|
9048
|
+
return /* @__PURE__ */ jsx57(
|
|
9038
9049
|
Shop,
|
|
9039
9050
|
{
|
|
9040
9051
|
endpoint,
|
|
@@ -9054,14 +9065,14 @@ function ProductPageProviderMinimal({
|
|
|
9054
9065
|
shop,
|
|
9055
9066
|
initialArtwork
|
|
9056
9067
|
}) {
|
|
9057
|
-
return /* @__PURE__ */
|
|
9068
|
+
return /* @__PURE__ */ jsx57(
|
|
9058
9069
|
Shop,
|
|
9059
9070
|
{
|
|
9060
9071
|
endpoint,
|
|
9061
9072
|
mockupUrl,
|
|
9062
9073
|
shop,
|
|
9063
9074
|
initialArtwork,
|
|
9064
|
-
children: /* @__PURE__ */
|
|
9075
|
+
children: /* @__PURE__ */ jsx57(Product, { productId, productData, children })
|
|
9065
9076
|
}
|
|
9066
9077
|
);
|
|
9067
9078
|
}
|
|
@@ -9078,7 +9089,7 @@ import {
|
|
|
9078
9089
|
describeProductArtAlignment,
|
|
9079
9090
|
getSnapPoints
|
|
9080
9091
|
} from "@snowcone-app/sdk";
|
|
9081
|
-
import { Fragment as Fragment11, jsx as
|
|
9092
|
+
import { Fragment as Fragment11, jsx as jsx58, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9082
9093
|
function ArtAlignment({
|
|
9083
9094
|
src: propSrc,
|
|
9084
9095
|
artworkAspectRatio: propAspectRatio,
|
|
@@ -9416,7 +9427,7 @@ function ArtAlignment({
|
|
|
9416
9427
|
if (!descriptor) {
|
|
9417
9428
|
return null;
|
|
9418
9429
|
}
|
|
9419
|
-
return /* @__PURE__ */
|
|
9430
|
+
return /* @__PURE__ */ jsx58(
|
|
9420
9431
|
"div",
|
|
9421
9432
|
{
|
|
9422
9433
|
className: `relative ${className || ""}`,
|
|
@@ -9425,8 +9436,8 @@ function ArtAlignment({
|
|
|
9425
9436
|
width: "fit-content",
|
|
9426
9437
|
maxWidth: "100%"
|
|
9427
9438
|
},
|
|
9428
|
-
children: /* @__PURE__ */
|
|
9429
|
-
/* @__PURE__ */
|
|
9439
|
+
children: /* @__PURE__ */ jsx58("div", { className: "overflow-hidden p-1", children: /* @__PURE__ */ jsxs36("div", { ref: containerRef, className: "relative", style: containerStyle, children: [
|
|
9440
|
+
/* @__PURE__ */ jsx58(
|
|
9430
9441
|
"img",
|
|
9431
9442
|
{
|
|
9432
9443
|
ref: imageRef,
|
|
@@ -9452,8 +9463,8 @@ function ArtAlignment({
|
|
|
9452
9463
|
}
|
|
9453
9464
|
),
|
|
9454
9465
|
isReady && maskDimensions.width > 0 && /* @__PURE__ */ jsxs36(Fragment11, { children: [
|
|
9455
|
-
/* @__PURE__ */
|
|
9456
|
-
/* @__PURE__ */
|
|
9466
|
+
/* @__PURE__ */ jsx58("div", { style: overlayStyle }),
|
|
9467
|
+
/* @__PURE__ */ jsx58(
|
|
9457
9468
|
"img",
|
|
9458
9469
|
{
|
|
9459
9470
|
src: descriptor.src,
|
|
@@ -9481,7 +9492,7 @@ function ArtAlignment({
|
|
|
9481
9492
|
loading: "eager"
|
|
9482
9493
|
}
|
|
9483
9494
|
),
|
|
9484
|
-
/* @__PURE__ */
|
|
9495
|
+
/* @__PURE__ */ jsx58(
|
|
9485
9496
|
"div",
|
|
9486
9497
|
{
|
|
9487
9498
|
...bind(),
|
|
@@ -9499,7 +9510,7 @@ function ArtAlignment({
|
|
|
9499
9510
|
|
|
9500
9511
|
// src/composed/ArtworkCustomizer.tsx
|
|
9501
9512
|
import { useEffect as useEffect30 } from "react";
|
|
9502
|
-
import { jsx as
|
|
9513
|
+
import { jsx as jsx59, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
9503
9514
|
function ArtworkCustomizer(props) {
|
|
9504
9515
|
const designContext = useDesign();
|
|
9505
9516
|
const artwork = props.artwork || designContext.selectedArtwork;
|
|
@@ -9524,10 +9535,10 @@ function ArtworkCustomizer(props) {
|
|
|
9524
9535
|
useEffect30(() => {
|
|
9525
9536
|
}, [selectedPlacement]);
|
|
9526
9537
|
if (!artwork) {
|
|
9527
|
-
return /* @__PURE__ */
|
|
9538
|
+
return /* @__PURE__ */ jsx59("div", { className: `text-sm text-muted-foreground ${props.className || ""}`, children: "Select artwork to customize" });
|
|
9528
9539
|
}
|
|
9529
9540
|
if (artwork.type === "pattern") {
|
|
9530
|
-
return /* @__PURE__ */
|
|
9541
|
+
return /* @__PURE__ */ jsx59(
|
|
9531
9542
|
TileCount,
|
|
9532
9543
|
{
|
|
9533
9544
|
artwork,
|
|
@@ -9539,7 +9550,7 @@ function ArtworkCustomizer(props) {
|
|
|
9539
9550
|
}
|
|
9540
9551
|
const isCanvasEditorMode = props.mode === "canvas" || !!props.children && props.mode !== "alignment";
|
|
9541
9552
|
return /* @__PURE__ */ jsxs37("div", { className: "flex flex-col gap-4", children: [
|
|
9542
|
-
placements.length > 1 && /* @__PURE__ */
|
|
9553
|
+
placements.length > 1 && /* @__PURE__ */ jsx59("div", { className: "text-sm leading-relaxed", children: placements.map((p) => /* @__PURE__ */ jsx59(
|
|
9543
9554
|
"button",
|
|
9544
9555
|
{
|
|
9545
9556
|
onClick: () => setSelectedPlacement?.(p.label),
|
|
@@ -9548,7 +9559,7 @@ function ArtworkCustomizer(props) {
|
|
|
9548
9559
|
},
|
|
9549
9560
|
p.label
|
|
9550
9561
|
)) }),
|
|
9551
|
-
isColorPlacement ? /* @__PURE__ */
|
|
9562
|
+
isColorPlacement ? /* @__PURE__ */ jsx59(ColorPicker2, { placement: selectedPlacement }) : isFitMode ? null : /* @__PURE__ */ jsx59("div", { className: "relative", children: props.children || /* @__PURE__ */ jsx59(
|
|
9552
9563
|
ArtAlignment,
|
|
9553
9564
|
{
|
|
9554
9565
|
artwork: { src: artwork.src },
|
|
@@ -9569,7 +9580,7 @@ import {
|
|
|
9569
9580
|
Shapes as LucideShapes,
|
|
9570
9581
|
Upload as LucideUpload
|
|
9571
9582
|
} from "lucide-react";
|
|
9572
|
-
import { jsx as
|
|
9583
|
+
import { jsx as jsx60, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9573
9584
|
var ImageIcon = LucideImage;
|
|
9574
9585
|
var TypeIcon = LucideType;
|
|
9575
9586
|
var ShapesIcon = LucideShapes;
|
|
@@ -9581,28 +9592,28 @@ function CanvasEditor({
|
|
|
9581
9592
|
children
|
|
9582
9593
|
}) {
|
|
9583
9594
|
return /* @__PURE__ */ jsxs38("div", { className: "flex flex-col gap-6", children: [
|
|
9584
|
-
/* @__PURE__ */
|
|
9595
|
+
/* @__PURE__ */ jsx60("div", { className: "bg-background border-2 border-border rounded-lg aspect-square overflow-hidden relative", children: children || /* @__PURE__ */ jsx60("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ jsx60("div", { className: "text-muted-foreground text-sm", children: "No editor provided" }) }) }),
|
|
9585
9596
|
/* @__PURE__ */ jsxs38("div", { className: "flex items-center justify-center gap-8 py-2", children: [
|
|
9586
|
-
/* @__PURE__ */
|
|
9597
|
+
/* @__PURE__ */ jsx60(
|
|
9587
9598
|
"button",
|
|
9588
9599
|
{
|
|
9589
9600
|
onClick: onOpenImageGallery,
|
|
9590
9601
|
className: "flex flex-col items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",
|
|
9591
9602
|
"aria-label": "Open image gallery",
|
|
9592
|
-
children: /* @__PURE__ */
|
|
9603
|
+
children: /* @__PURE__ */ jsx60("div", { className: "w-10 h-10 flex items-center justify-center", children: /* @__PURE__ */ jsx60(ImageIcon, { className: "w-6 h-6" }) })
|
|
9593
9604
|
}
|
|
9594
9605
|
),
|
|
9595
|
-
/* @__PURE__ */
|
|
9606
|
+
/* @__PURE__ */ jsx60(
|
|
9596
9607
|
"button",
|
|
9597
9608
|
{
|
|
9598
9609
|
onClick: onOpenTypography,
|
|
9599
9610
|
className: "flex flex-col items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",
|
|
9600
9611
|
"aria-label": "Add text",
|
|
9601
|
-
children: /* @__PURE__ */
|
|
9612
|
+
children: /* @__PURE__ */ jsx60("div", { className: "w-10 h-10 flex items-center justify-center", children: /* @__PURE__ */ jsx60(TypeIcon, { className: "w-6 h-6" }) })
|
|
9602
9613
|
}
|
|
9603
9614
|
),
|
|
9604
|
-
/* @__PURE__ */
|
|
9605
|
-
/* @__PURE__ */
|
|
9615
|
+
/* @__PURE__ */ jsx60("button", { className: "flex flex-col items-center gap-2 text-muted-foreground hover:text-foreground transition-colors", children: /* @__PURE__ */ jsx60("div", { className: "w-10 h-10 flex items-center justify-center", children: /* @__PURE__ */ jsx60(ShapesIcon, { className: "w-6 h-6" }) }) }),
|
|
9616
|
+
/* @__PURE__ */ jsx60("button", { className: "flex flex-col items-center gap-2 text-muted-foreground hover:text-foreground transition-colors", children: /* @__PURE__ */ jsx60("div", { className: "w-10 h-10 flex items-center justify-center", children: /* @__PURE__ */ jsx60(UploadIcon, { className: "w-6 h-6" }) }) })
|
|
9606
9617
|
] })
|
|
9607
9618
|
] });
|
|
9608
9619
|
}
|
|
@@ -9659,7 +9670,7 @@ function useContainerWidth(containerRef, maxWidth = 3e3) {
|
|
|
9659
9670
|
}
|
|
9660
9671
|
|
|
9661
9672
|
// src/composed/HeroProductImage.tsx
|
|
9662
|
-
import { jsx as
|
|
9673
|
+
import { jsx as jsx61, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9663
9674
|
function slugifyPlacementKey(label) {
|
|
9664
9675
|
return label.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
9665
9676
|
}
|
|
@@ -9693,6 +9704,7 @@ function buildHeroMockupUrl(args) {
|
|
|
9693
9704
|
width: args.width,
|
|
9694
9705
|
view: args.mockupId,
|
|
9695
9706
|
variant: args.variantId,
|
|
9707
|
+
...args.bg ? { bg: args.bg } : {},
|
|
9696
9708
|
...snow.resolver ? { base: snow.resolver } : {}
|
|
9697
9709
|
});
|
|
9698
9710
|
}
|
|
@@ -9730,6 +9742,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
9730
9742
|
const shopContext = useShopOptional();
|
|
9731
9743
|
const realtimeContext = useRealtimeOptional();
|
|
9732
9744
|
const priorityContext = useMockupPriorityOptional();
|
|
9745
|
+
const mockupBg = useMockupBackgroundOptional();
|
|
9733
9746
|
const priorityContextRef = useRef23(priorityContext);
|
|
9734
9747
|
priorityContextRef.current = priorityContext;
|
|
9735
9748
|
const contextRef = useRef23(context);
|
|
@@ -9780,7 +9793,8 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
9780
9793
|
placements: allPlacements,
|
|
9781
9794
|
mockupId: actualMockupId,
|
|
9782
9795
|
variantId: actualGvid,
|
|
9783
|
-
width
|
|
9796
|
+
width,
|
|
9797
|
+
bg: mockupBg
|
|
9784
9798
|
});
|
|
9785
9799
|
}, [
|
|
9786
9800
|
realtimeUrl,
|
|
@@ -9790,6 +9804,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
9790
9804
|
actualProductId,
|
|
9791
9805
|
actualMockupId,
|
|
9792
9806
|
actualGvid,
|
|
9807
|
+
mockupBg,
|
|
9793
9808
|
product?.placements,
|
|
9794
9809
|
context?.product?.placements,
|
|
9795
9810
|
images,
|
|
@@ -10025,7 +10040,8 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10025
10040
|
placements: allPlacements,
|
|
10026
10041
|
mockupId: actualMockupId,
|
|
10027
10042
|
variantId: actualGvid,
|
|
10028
|
-
width
|
|
10043
|
+
width,
|
|
10044
|
+
bg: mockupBg
|
|
10029
10045
|
});
|
|
10030
10046
|
if (!url) return;
|
|
10031
10047
|
if (url === lastUrlRef.current) return;
|
|
@@ -10066,6 +10082,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10066
10082
|
actualProductId,
|
|
10067
10083
|
actualMockupId,
|
|
10068
10084
|
actualGvid,
|
|
10085
|
+
mockupBg,
|
|
10069
10086
|
images,
|
|
10070
10087
|
width,
|
|
10071
10088
|
effects,
|
|
@@ -10139,20 +10156,20 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10139
10156
|
}, []);
|
|
10140
10157
|
const handleLoaderExited = useCallback18(() => setLoaderMounted(false), []);
|
|
10141
10158
|
if (!hasArtwork) {
|
|
10142
|
-
return /* @__PURE__ */
|
|
10159
|
+
return /* @__PURE__ */ jsx61(
|
|
10143
10160
|
"div",
|
|
10144
10161
|
{
|
|
10145
10162
|
className: `bg-gray-100 flex items-center justify-center ${className || ""}`,
|
|
10146
10163
|
style,
|
|
10147
10164
|
children: /* @__PURE__ */ jsxs39("div", { className: "text-gray-400 text-center p-4", children: [
|
|
10148
|
-
/* @__PURE__ */
|
|
10165
|
+
/* @__PURE__ */ jsx61(
|
|
10149
10166
|
"svg",
|
|
10150
10167
|
{
|
|
10151
10168
|
className: "w-8 h-8 mx-auto mb-2",
|
|
10152
10169
|
fill: "none",
|
|
10153
10170
|
stroke: "currentColor",
|
|
10154
10171
|
viewBox: "0 0 24 24",
|
|
10155
|
-
children: /* @__PURE__ */
|
|
10172
|
+
children: /* @__PURE__ */ jsx61(
|
|
10156
10173
|
"path",
|
|
10157
10174
|
{
|
|
10158
10175
|
strokeLinecap: "round",
|
|
@@ -10163,18 +10180,18 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10163
10180
|
)
|
|
10164
10181
|
}
|
|
10165
10182
|
),
|
|
10166
|
-
/* @__PURE__ */
|
|
10183
|
+
/* @__PURE__ */ jsx61("p", { className: "text-xs", children: "No artwork" })
|
|
10167
10184
|
] })
|
|
10168
10185
|
}
|
|
10169
10186
|
);
|
|
10170
10187
|
}
|
|
10171
10188
|
if (error) {
|
|
10172
|
-
return /* @__PURE__ */
|
|
10189
|
+
return /* @__PURE__ */ jsx61(
|
|
10173
10190
|
"div",
|
|
10174
10191
|
{
|
|
10175
10192
|
className: `bg-red-50 flex items-center justify-center ${className || ""}`,
|
|
10176
10193
|
style,
|
|
10177
|
-
children: /* @__PURE__ */
|
|
10194
|
+
children: /* @__PURE__ */ jsx61("div", { className: "text-red-600 text-center p-4", children: /* @__PURE__ */ jsx61("p", { className: "text-xs", children: "Error loading" }) })
|
|
10178
10195
|
}
|
|
10179
10196
|
);
|
|
10180
10197
|
}
|
|
@@ -10186,7 +10203,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10186
10203
|
style,
|
|
10187
10204
|
"data-hero-image": "true",
|
|
10188
10205
|
children: [
|
|
10189
|
-
renderedUrl && !imgFailed && /* @__PURE__ */
|
|
10206
|
+
renderedUrl && !imgFailed && /* @__PURE__ */ jsx61(
|
|
10190
10207
|
"img",
|
|
10191
10208
|
{
|
|
10192
10209
|
alt: `Product mockup${placement ? ` - ${placement}` : ""}`,
|
|
@@ -10225,8 +10242,8 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10225
10242
|
}
|
|
10226
10243
|
}
|
|
10227
10244
|
),
|
|
10228
|
-
imgFailed && !prevUrl && /* @__PURE__ */
|
|
10229
|
-
realtimeContext?.renderError && /* @__PURE__ */
|
|
10245
|
+
imgFailed && !prevUrl && /* @__PURE__ */ jsx61("div", { className: "absolute inset-0 flex items-center justify-center bg-muted", children: /* @__PURE__ */ jsx61("p", { className: "text-muted-foreground text-xs", children: "Preview unavailable" }) }),
|
|
10246
|
+
realtimeContext?.renderError && /* @__PURE__ */ jsx61(
|
|
10230
10247
|
"div",
|
|
10231
10248
|
{
|
|
10232
10249
|
role: "alert",
|
|
@@ -10235,7 +10252,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10235
10252
|
children: `Render blocked: ${realtimeContext.renderError.code} \u2014 ${realtimeContext.renderError.message}`
|
|
10236
10253
|
}
|
|
10237
10254
|
),
|
|
10238
|
-
prevUrl && /* @__PURE__ */
|
|
10255
|
+
prevUrl && /* @__PURE__ */ jsx61(
|
|
10239
10256
|
"img",
|
|
10240
10257
|
{
|
|
10241
10258
|
alt: "",
|
|
@@ -10250,7 +10267,7 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10250
10267
|
onTransitionEnd: handleCrossfadeEnd
|
|
10251
10268
|
}
|
|
10252
10269
|
),
|
|
10253
|
-
loaderMounted && /* @__PURE__ */
|
|
10270
|
+
loaderMounted && /* @__PURE__ */ jsx61(
|
|
10254
10271
|
LoadingOverlayPrismCandyInline,
|
|
10255
10272
|
{
|
|
10256
10273
|
visible: !firstImageLoaded,
|
|
@@ -10264,16 +10281,16 @@ var HeroProductImage = memo3(function HeroProductImage2({
|
|
|
10264
10281
|
});
|
|
10265
10282
|
|
|
10266
10283
|
// src/composed/SafeImg.tsx
|
|
10267
|
-
import
|
|
10268
|
-
import { Fragment as Fragment12, jsx as
|
|
10269
|
-
var SafeImg =
|
|
10284
|
+
import React45, { useEffect as useEffect33, useState as useState32 } from "react";
|
|
10285
|
+
import { Fragment as Fragment12, jsx as jsx62 } from "react/jsx-runtime";
|
|
10286
|
+
var SafeImg = React45.forwardRef(
|
|
10270
10287
|
function SafeImg2({ fallback = null, onError, src, ...rest }, ref) {
|
|
10271
10288
|
const [failed, setFailed] = useState32(false);
|
|
10272
10289
|
useEffect33(() => {
|
|
10273
10290
|
setFailed(false);
|
|
10274
10291
|
}, [src]);
|
|
10275
|
-
if (failed) return /* @__PURE__ */
|
|
10276
|
-
return /* @__PURE__ */
|
|
10292
|
+
if (failed) return /* @__PURE__ */ jsx62(Fragment12, { children: fallback });
|
|
10293
|
+
return /* @__PURE__ */ jsx62(
|
|
10277
10294
|
"img",
|
|
10278
10295
|
{
|
|
10279
10296
|
...rest,
|
|
@@ -10312,7 +10329,7 @@ var { searchClient } = instantMeiliSearch(
|
|
|
10312
10329
|
|
|
10313
10330
|
// src/composed/search/SearchProvider.tsx
|
|
10314
10331
|
import { useEffect as useEffect34 } from "react";
|
|
10315
|
-
import { jsx as
|
|
10332
|
+
import { jsx as jsx63, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
10316
10333
|
function InitialSearchTrigger() {
|
|
10317
10334
|
const { refine } = useSearchBox();
|
|
10318
10335
|
useEffect34(() => {
|
|
@@ -10367,7 +10384,7 @@ function SearchProvider({
|
|
|
10367
10384
|
}
|
|
10368
10385
|
},
|
|
10369
10386
|
children: [
|
|
10370
|
-
/* @__PURE__ */
|
|
10387
|
+
/* @__PURE__ */ jsx63(
|
|
10371
10388
|
Configure,
|
|
10372
10389
|
{
|
|
10373
10390
|
hitsPerPage,
|
|
@@ -10376,7 +10393,7 @@ function SearchProvider({
|
|
|
10376
10393
|
attributesToRetrieve
|
|
10377
10394
|
}
|
|
10378
10395
|
),
|
|
10379
|
-
/* @__PURE__ */
|
|
10396
|
+
/* @__PURE__ */ jsx63(InitialSearchTrigger, {}),
|
|
10380
10397
|
children
|
|
10381
10398
|
]
|
|
10382
10399
|
}
|
|
@@ -10387,7 +10404,7 @@ function SearchProvider({
|
|
|
10387
10404
|
import { useSearchBox as useSearchBox2 } from "react-instantsearch";
|
|
10388
10405
|
import { Search, X } from "lucide-react";
|
|
10389
10406
|
import { useEffect as useEffect35, useRef as useRef24, useState as useState33 } from "react";
|
|
10390
|
-
import { jsx as
|
|
10407
|
+
import { jsx as jsx64, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
10391
10408
|
function SearchBox() {
|
|
10392
10409
|
const { query, refine, clear } = useSearchBox2();
|
|
10393
10410
|
const searchParams = useUiSearchParams();
|
|
@@ -10421,8 +10438,8 @@ function SearchBox() {
|
|
|
10421
10438
|
return () => clearTimeout(timer);
|
|
10422
10439
|
}
|
|
10423
10440
|
}, [searchParams, router]);
|
|
10424
|
-
return /* @__PURE__ */
|
|
10425
|
-
/* @__PURE__ */
|
|
10441
|
+
return /* @__PURE__ */ jsx64("form", { role: "search", onSubmit: (e) => e.preventDefault(), children: /* @__PURE__ */ jsxs41("div", { className: "relative", children: [
|
|
10442
|
+
/* @__PURE__ */ jsx64(
|
|
10426
10443
|
Input,
|
|
10427
10444
|
{
|
|
10428
10445
|
ref: inputRef,
|
|
@@ -10431,15 +10448,15 @@ function SearchBox() {
|
|
|
10431
10448
|
value: query,
|
|
10432
10449
|
onChange: (e) => refine(e.target.value),
|
|
10433
10450
|
placeholder: "Search products...",
|
|
10434
|
-
startContent: /* @__PURE__ */
|
|
10435
|
-
endContent: query ? /* @__PURE__ */
|
|
10451
|
+
startContent: /* @__PURE__ */ jsx64(Search, { className: "w-5 h-5", strokeWidth: 1.5, "aria-hidden": "true" }),
|
|
10452
|
+
endContent: query ? /* @__PURE__ */ jsx64(
|
|
10436
10453
|
"button",
|
|
10437
10454
|
{
|
|
10438
10455
|
type: "button",
|
|
10439
10456
|
onClick: clear,
|
|
10440
10457
|
className: "hover:text-foreground transition-colors",
|
|
10441
10458
|
"aria-label": "Clear search",
|
|
10442
|
-
children: /* @__PURE__ */
|
|
10459
|
+
children: /* @__PURE__ */ jsx64(X, { className: "w-4 h-4", strokeWidth: 2, "aria-hidden": "true" })
|
|
10443
10460
|
}
|
|
10444
10461
|
) : void 0,
|
|
10445
10462
|
"aria-label": "Search products",
|
|
@@ -10449,11 +10466,11 @@ function SearchBox() {
|
|
|
10449
10466
|
className: "[&::-webkit-search-cancel-button]:hidden [&::-webkit-search-decoration]:hidden"
|
|
10450
10467
|
}
|
|
10451
10468
|
),
|
|
10452
|
-
showShimmer && /* @__PURE__ */
|
|
10469
|
+
showShimmer && /* @__PURE__ */ jsx64(
|
|
10453
10470
|
"div",
|
|
10454
10471
|
{
|
|
10455
10472
|
className: "absolute inset-0 pointer-events-none rounded-input z-20 overflow-hidden",
|
|
10456
|
-
children: /* @__PURE__ */
|
|
10473
|
+
children: /* @__PURE__ */ jsx64(
|
|
10457
10474
|
"div",
|
|
10458
10475
|
{
|
|
10459
10476
|
className: "absolute inset-0",
|
|
@@ -10466,13 +10483,13 @@ function SearchBox() {
|
|
|
10466
10483
|
)
|
|
10467
10484
|
}
|
|
10468
10485
|
),
|
|
10469
|
-
/* @__PURE__ */
|
|
10486
|
+
/* @__PURE__ */ jsx64("style", { dangerouslySetInnerHTML: { __html: `
|
|
10470
10487
|
@keyframes searchShimmer {
|
|
10471
10488
|
0% { transform: translateX(-100%); }
|
|
10472
10489
|
100% { transform: translateX(100%); }
|
|
10473
10490
|
}
|
|
10474
10491
|
` } }),
|
|
10475
|
-
/* @__PURE__ */
|
|
10492
|
+
/* @__PURE__ */ jsx64("span", { id: descriptionId, className: "sr-only", children: "Search results will update as you type" })
|
|
10476
10493
|
] }) });
|
|
10477
10494
|
}
|
|
10478
10495
|
|
|
@@ -10480,7 +10497,7 @@ function SearchBox() {
|
|
|
10480
10497
|
import { Hits, useStats, useInstantSearch } from "react-instantsearch";
|
|
10481
10498
|
|
|
10482
10499
|
// src/composed/search/ProductHit.tsx
|
|
10483
|
-
import { jsx as
|
|
10500
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
10484
10501
|
function ProductHitComponent({
|
|
10485
10502
|
hit: product,
|
|
10486
10503
|
variant = "overlay"
|
|
@@ -10497,12 +10514,12 @@ function ProductHitComponent({
|
|
|
10497
10514
|
}
|
|
10498
10515
|
return "";
|
|
10499
10516
|
};
|
|
10500
|
-
return /* @__PURE__ */
|
|
10517
|
+
return /* @__PURE__ */ jsx65(
|
|
10501
10518
|
Product,
|
|
10502
10519
|
{
|
|
10503
10520
|
productId,
|
|
10504
10521
|
productData: product,
|
|
10505
|
-
children: /* @__PURE__ */
|
|
10522
|
+
children: /* @__PURE__ */ jsx65(
|
|
10506
10523
|
ProductCard,
|
|
10507
10524
|
{
|
|
10508
10525
|
variant,
|
|
@@ -10524,9 +10541,9 @@ function ProductHitComponent({
|
|
|
10524
10541
|
|
|
10525
10542
|
// src/composed/search/ProductGrid.tsx
|
|
10526
10543
|
import { useState as useState34, useEffect as useEffect36, useCallback as useCallback19 } from "react";
|
|
10527
|
-
import { jsx as
|
|
10544
|
+
import { jsx as jsx66, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10528
10545
|
function ProductGridSkeletonItem() {
|
|
10529
|
-
return /* @__PURE__ */
|
|
10546
|
+
return /* @__PURE__ */ jsx66("div", { className: "aspect-square bg-muted animate-pulse" });
|
|
10530
10547
|
}
|
|
10531
10548
|
function ProductGrid({
|
|
10532
10549
|
className = "",
|
|
@@ -10545,7 +10562,7 @@ function ProductGrid({
|
|
|
10545
10562
|
}, 1e3);
|
|
10546
10563
|
return () => clearTimeout(timer);
|
|
10547
10564
|
}, [nbHits]);
|
|
10548
|
-
const HitComponent = useCallback19(({ hit }) => /* @__PURE__ */
|
|
10565
|
+
const HitComponent = useCallback19(({ hit }) => /* @__PURE__ */ jsx66(
|
|
10549
10566
|
ProductHitComponent,
|
|
10550
10567
|
{
|
|
10551
10568
|
hit,
|
|
@@ -10553,9 +10570,9 @@ function ProductGrid({
|
|
|
10553
10570
|
}
|
|
10554
10571
|
), [variant]);
|
|
10555
10572
|
return /* @__PURE__ */ jsxs42("div", { className, children: [
|
|
10556
|
-
/* @__PURE__ */
|
|
10557
|
-
showSkeleton && /* @__PURE__ */
|
|
10558
|
-
/* @__PURE__ */
|
|
10573
|
+
/* @__PURE__ */ jsx66("div", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: announcement }),
|
|
10574
|
+
showSkeleton && /* @__PURE__ */ jsx66("div", { className: `grid ${gridClassName}`, children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ jsx66(ProductGridSkeletonItem, {}, i)) }),
|
|
10575
|
+
/* @__PURE__ */ jsx66("div", { className: showSkeleton ? "hidden" : "", children: /* @__PURE__ */ jsx66(
|
|
10559
10576
|
Hits,
|
|
10560
10577
|
{
|
|
10561
10578
|
hitComponent: HitComponent,
|
|
@@ -10574,7 +10591,7 @@ import { useState as useState36 } from "react";
|
|
|
10574
10591
|
|
|
10575
10592
|
// src/composed/search/FiltersButton.tsx
|
|
10576
10593
|
import { SlidersHorizontal as LucideSlidersHorizontal } from "lucide-react";
|
|
10577
|
-
import { jsx as
|
|
10594
|
+
import { jsx as jsx67, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10578
10595
|
var SlidersHorizontalIcon = LucideSlidersHorizontal;
|
|
10579
10596
|
function FiltersButton({
|
|
10580
10597
|
onClick,
|
|
@@ -10589,8 +10606,8 @@ function FiltersButton({
|
|
|
10589
10606
|
className,
|
|
10590
10607
|
"aria-label": "Open filters",
|
|
10591
10608
|
children: [
|
|
10592
|
-
/* @__PURE__ */
|
|
10593
|
-
/* @__PURE__ */
|
|
10609
|
+
/* @__PURE__ */ jsx67(SlidersHorizontalIcon, { className: "w-4 h-4" }),
|
|
10610
|
+
/* @__PURE__ */ jsx67("span", { children })
|
|
10594
10611
|
]
|
|
10595
10612
|
}
|
|
10596
10613
|
);
|
|
@@ -10601,7 +10618,7 @@ import { useRefinementList, useRange, useStats as useStats2 } from "react-instan
|
|
|
10601
10618
|
import { X as LucideX2, SlidersHorizontal as LucideSlidersHorizontal2 } from "lucide-react";
|
|
10602
10619
|
import { useState as useState35, useEffect as useEffect37 } from "react";
|
|
10603
10620
|
import * as Slider2 from "@radix-ui/react-slider";
|
|
10604
|
-
import { Fragment as Fragment13, jsx as
|
|
10621
|
+
import { Fragment as Fragment13, jsx as jsx68, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10605
10622
|
var XIcon2 = LucideX2;
|
|
10606
10623
|
function FiltersDrawer({ isOpen, onClose }) {
|
|
10607
10624
|
const [showCounts, setShowCounts] = useState35(false);
|
|
@@ -10627,7 +10644,7 @@ function FiltersDrawer({ isOpen, onClose }) {
|
|
|
10627
10644
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
10628
10645
|
}, [isOpen, onClose]);
|
|
10629
10646
|
return /* @__PURE__ */ jsxs44(Fragment13, { children: [
|
|
10630
|
-
/* @__PURE__ */
|
|
10647
|
+
/* @__PURE__ */ jsx68(
|
|
10631
10648
|
"div",
|
|
10632
10649
|
{
|
|
10633
10650
|
className: `fixed inset-0 bg-black/50 z-40 transition-opacity ${isOpen ? "opacity-100" : "opacity-0 pointer-events-none"}`,
|
|
@@ -10645,25 +10662,25 @@ function FiltersDrawer({ isOpen, onClose }) {
|
|
|
10645
10662
|
"aria-labelledby": "filters-drawer-title",
|
|
10646
10663
|
children: [
|
|
10647
10664
|
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between px-4 py-4", children: [
|
|
10648
|
-
/* @__PURE__ */
|
|
10649
|
-
/* @__PURE__ */
|
|
10665
|
+
/* @__PURE__ */ jsx68("h2", { id: "filters-drawer-title", className: "text-xl font-bold", children: "Filters" }),
|
|
10666
|
+
/* @__PURE__ */ jsx68(
|
|
10650
10667
|
"button",
|
|
10651
10668
|
{
|
|
10652
10669
|
onClick: onClose,
|
|
10653
10670
|
className: "p-2 hover:bg-foreground/5 rounded-full transition-colors",
|
|
10654
10671
|
"aria-label": "Close filters",
|
|
10655
|
-
children: /* @__PURE__ */
|
|
10672
|
+
children: /* @__PURE__ */ jsx68(XIcon2, { className: "w-5 h-5" })
|
|
10656
10673
|
}
|
|
10657
10674
|
)
|
|
10658
10675
|
] }),
|
|
10659
|
-
/* @__PURE__ */
|
|
10676
|
+
/* @__PURE__ */ jsx68("div", { className: "px-4 pb-4", children: /* @__PURE__ */ jsxs44("p", { className: "text-sm font-caption text-foreground/60", role: "status", "aria-live": "polite", children: [
|
|
10660
10677
|
nbHits.toLocaleString(),
|
|
10661
10678
|
" ",
|
|
10662
10679
|
nbHits === 1 ? "result" : "results"
|
|
10663
10680
|
] }) }),
|
|
10664
|
-
/* @__PURE__ */
|
|
10665
|
-
/* @__PURE__ */
|
|
10666
|
-
/* @__PURE__ */
|
|
10681
|
+
/* @__PURE__ */ jsx68("div", { className: "flex-1 overflow-y-auto px-4 pb-4", children: /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-8", children: [
|
|
10682
|
+
/* @__PURE__ */ jsx68(TagsSection, { showCounts, setShowCounts }),
|
|
10683
|
+
/* @__PURE__ */ jsx68(PriceSection, {})
|
|
10667
10684
|
] }) })
|
|
10668
10685
|
]
|
|
10669
10686
|
}
|
|
@@ -10689,8 +10706,8 @@ function TagsSection({
|
|
|
10689
10706
|
"aria-expanded": isExpanded,
|
|
10690
10707
|
"aria-controls": "tags-content",
|
|
10691
10708
|
children: [
|
|
10692
|
-
/* @__PURE__ */
|
|
10693
|
-
/* @__PURE__ */
|
|
10709
|
+
/* @__PURE__ */ jsx68("h3", { className: "text-base font-semibold text-primary", children: "Tags" }),
|
|
10710
|
+
/* @__PURE__ */ jsx68(
|
|
10694
10711
|
"svg",
|
|
10695
10712
|
{
|
|
10696
10713
|
className: `w-5 h-5 transition-transform text-foreground/40 group-hover:text-foreground/60 ${isExpanded ? "rotate-180" : ""}`,
|
|
@@ -10699,14 +10716,14 @@ function TagsSection({
|
|
|
10699
10716
|
stroke: "currentColor",
|
|
10700
10717
|
strokeWidth: 2.5,
|
|
10701
10718
|
"aria-hidden": "true",
|
|
10702
|
-
children: /* @__PURE__ */
|
|
10719
|
+
children: /* @__PURE__ */ jsx68("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
10703
10720
|
}
|
|
10704
10721
|
)
|
|
10705
10722
|
]
|
|
10706
10723
|
}
|
|
10707
10724
|
),
|
|
10708
10725
|
isExpanded && /* @__PURE__ */ jsxs44("div", { className: "space-y-4", id: "tags-content", children: [
|
|
10709
|
-
/* @__PURE__ */
|
|
10726
|
+
/* @__PURE__ */ jsx68("div", { className: "flex flex-wrap gap-2", role: "group", "aria-label": "Product tags filter", children: items.map((item) => /* @__PURE__ */ jsxs44(
|
|
10710
10727
|
"button",
|
|
10711
10728
|
{
|
|
10712
10729
|
onClick: () => refine(item.value),
|
|
@@ -10717,15 +10734,15 @@ function TagsSection({
|
|
|
10717
10734
|
"aria-label": `${item.isRefined ? "Remove" : "Apply"} ${item.label} filter${showCounts ? ` (${item.count} products)` : ""}`,
|
|
10718
10735
|
"aria-pressed": item.isRefined,
|
|
10719
10736
|
children: [
|
|
10720
|
-
/* @__PURE__ */
|
|
10721
|
-
showCounts && /* @__PURE__ */
|
|
10737
|
+
/* @__PURE__ */ jsx68("span", { "aria-hidden": "true", children: item.label }),
|
|
10738
|
+
showCounts && /* @__PURE__ */ jsx68("span", { className: `text-xs font-caption ${item.isRefined ? "opacity-80" : "opacity-60"}`, "aria-hidden": "true", children: item.count })
|
|
10722
10739
|
]
|
|
10723
10740
|
},
|
|
10724
10741
|
item.value
|
|
10725
10742
|
)) }),
|
|
10726
10743
|
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between pt-2", children: [
|
|
10727
|
-
/* @__PURE__ */
|
|
10728
|
-
/* @__PURE__ */
|
|
10744
|
+
/* @__PURE__ */ jsx68("span", { className: "text-sm font-label text-foreground/60", id: "show-counts-label", children: "Show counts" }),
|
|
10745
|
+
/* @__PURE__ */ jsx68(
|
|
10729
10746
|
"button",
|
|
10730
10747
|
{
|
|
10731
10748
|
onClick: () => setShowCounts(!showCounts),
|
|
@@ -10733,7 +10750,7 @@ function TagsSection({
|
|
|
10733
10750
|
role: "switch",
|
|
10734
10751
|
"aria-checked": showCounts,
|
|
10735
10752
|
"aria-labelledby": "show-counts-label",
|
|
10736
|
-
children: /* @__PURE__ */
|
|
10753
|
+
children: /* @__PURE__ */ jsx68(
|
|
10737
10754
|
"span",
|
|
10738
10755
|
{
|
|
10739
10756
|
className: `inline-block h-4 w-4 transform rounded-full bg-background shadow-sm transition-transform ${showCounts ? "translate-x-6" : "translate-x-1"}`,
|
|
@@ -10788,8 +10805,8 @@ function PriceSection() {
|
|
|
10788
10805
|
"aria-expanded": isExpanded,
|
|
10789
10806
|
"aria-controls": "price-content",
|
|
10790
10807
|
children: [
|
|
10791
|
-
/* @__PURE__ */
|
|
10792
|
-
/* @__PURE__ */
|
|
10808
|
+
/* @__PURE__ */ jsx68("h3", { className: "text-base font-semibold text-primary", children: "Price" }),
|
|
10809
|
+
/* @__PURE__ */ jsx68(
|
|
10793
10810
|
"svg",
|
|
10794
10811
|
{
|
|
10795
10812
|
className: `w-5 h-5 transition-transform text-foreground/40 group-hover:text-foreground/60 ${isExpanded ? "rotate-180" : ""}`,
|
|
@@ -10798,7 +10815,7 @@ function PriceSection() {
|
|
|
10798
10815
|
stroke: "currentColor",
|
|
10799
10816
|
strokeWidth: 2.5,
|
|
10800
10817
|
"aria-hidden": "true",
|
|
10801
|
-
children: /* @__PURE__ */
|
|
10818
|
+
children: /* @__PURE__ */ jsx68("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
|
|
10802
10819
|
}
|
|
10803
10820
|
)
|
|
10804
10821
|
]
|
|
@@ -10806,14 +10823,14 @@ function PriceSection() {
|
|
|
10806
10823
|
),
|
|
10807
10824
|
isExpanded && /* @__PURE__ */ jsxs44("div", { className: "space-y-6", id: "price-content", children: [
|
|
10808
10825
|
/* @__PURE__ */ jsxs44("div", { className: "flex items-center justify-between text-sm font-display", children: [
|
|
10809
|
-
/* @__PURE__ */
|
|
10810
|
-
/* @__PURE__ */
|
|
10826
|
+
/* @__PURE__ */ jsx68("span", { children: formatPrice2(localRange[0]) }),
|
|
10827
|
+
/* @__PURE__ */ jsx68("span", { className: "text-foreground/70", children: formatPrice2(localRange[1]) })
|
|
10811
10828
|
] }),
|
|
10812
|
-
/* @__PURE__ */
|
|
10829
|
+
/* @__PURE__ */ jsx68("div", { className: "relative h-24 flex items-end justify-between gap-0.5 px-1", "aria-hidden": "true", role: "presentation", children: [60, 40, 80, 50, 60, 30, 20, 15, 10, 5, 30, 20, 15, 10, 5, 3, 3, 60, 40].map((height, i) => {
|
|
10813
10830
|
const totalBars = 19;
|
|
10814
10831
|
const barPrice = rangeMin + (rangeMax - rangeMin) / totalBars * i;
|
|
10815
10832
|
const isInRange = barPrice >= localRange[0] && barPrice <= localRange[1];
|
|
10816
|
-
return /* @__PURE__ */
|
|
10833
|
+
return /* @__PURE__ */ jsx68(
|
|
10817
10834
|
"div",
|
|
10818
10835
|
{
|
|
10819
10836
|
className: `flex-1 rounded-t-sm transition-opacity ${isInRange ? "bg-foreground" : "bg-foreground/20"}`,
|
|
@@ -10822,7 +10839,7 @@ function PriceSection() {
|
|
|
10822
10839
|
i
|
|
10823
10840
|
);
|
|
10824
10841
|
}) }),
|
|
10825
|
-
/* @__PURE__ */
|
|
10842
|
+
/* @__PURE__ */ jsx68("div", { style: { touchAction: "none" }, className: "my-6", children: /* @__PURE__ */ jsxs44(
|
|
10826
10843
|
Slider2.Root,
|
|
10827
10844
|
{
|
|
10828
10845
|
className: "relative flex w-full touch-none select-none items-center",
|
|
@@ -10840,8 +10857,8 @@ function PriceSection() {
|
|
|
10840
10857
|
step: 1,
|
|
10841
10858
|
minStepsBetweenThumbs: 1,
|
|
10842
10859
|
children: [
|
|
10843
|
-
/* @__PURE__ */
|
|
10844
|
-
/* @__PURE__ */
|
|
10860
|
+
/* @__PURE__ */ jsx68(Slider2.Track, { className: "relative h-3 w-full grow overflow-hidden rounded-full bg-foreground/20", children: /* @__PURE__ */ jsx68(Slider2.Range, { className: "absolute h-full bg-foreground" }) }),
|
|
10861
|
+
/* @__PURE__ */ jsx68(
|
|
10845
10862
|
Slider2.Thumb,
|
|
10846
10863
|
{
|
|
10847
10864
|
className: "block h-6 w-6 rounded-full bg-background shadow transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing hover:scale-105 border-2 border-primary",
|
|
@@ -10855,7 +10872,7 @@ function PriceSection() {
|
|
|
10855
10872
|
"aria-valuetext": formatPrice2(localRange[0])
|
|
10856
10873
|
}
|
|
10857
10874
|
),
|
|
10858
|
-
/* @__PURE__ */
|
|
10875
|
+
/* @__PURE__ */ jsx68(
|
|
10859
10876
|
Slider2.Thumb,
|
|
10860
10877
|
{
|
|
10861
10878
|
className: "block h-6 w-6 rounded-full bg-background shadow transition-all focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary disabled:pointer-events-none disabled:opacity-50 cursor-grab active:cursor-grabbing hover:scale-105 border-2 border-primary",
|
|
@@ -10874,8 +10891,8 @@ function PriceSection() {
|
|
|
10874
10891
|
) }),
|
|
10875
10892
|
/* @__PURE__ */ jsxs44("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
10876
10893
|
/* @__PURE__ */ jsxs44("div", { children: [
|
|
10877
|
-
/* @__PURE__ */
|
|
10878
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ jsx68("label", { htmlFor: "price-min", className: "text-xs font-label text-foreground/60 mb-1.5 block", children: "Min" }),
|
|
10895
|
+
/* @__PURE__ */ jsx68(
|
|
10879
10896
|
"input",
|
|
10880
10897
|
{
|
|
10881
10898
|
id: "price-min",
|
|
@@ -10894,8 +10911,8 @@ function PriceSection() {
|
|
|
10894
10911
|
)
|
|
10895
10912
|
] }),
|
|
10896
10913
|
/* @__PURE__ */ jsxs44("div", { children: [
|
|
10897
|
-
/* @__PURE__ */
|
|
10898
|
-
/* @__PURE__ */
|
|
10914
|
+
/* @__PURE__ */ jsx68("label", { htmlFor: "price-max", className: "text-xs font-label text-foreground/60 mb-1.5 block", children: "Max" }),
|
|
10915
|
+
/* @__PURE__ */ jsx68(
|
|
10899
10916
|
"input",
|
|
10900
10917
|
{
|
|
10901
10918
|
id: "price-max",
|
|
@@ -10919,11 +10936,11 @@ function PriceSection() {
|
|
|
10919
10936
|
}
|
|
10920
10937
|
|
|
10921
10938
|
// src/composed/search/Filters.tsx
|
|
10922
|
-
import { Fragment as Fragment14, jsx as
|
|
10939
|
+
import { Fragment as Fragment14, jsx as jsx69, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
10923
10940
|
function Filters({ buttonClassName, buttonText }) {
|
|
10924
10941
|
const [isOpen, setIsOpen] = useState36(false);
|
|
10925
10942
|
return /* @__PURE__ */ jsxs45(Fragment14, { children: [
|
|
10926
|
-
/* @__PURE__ */
|
|
10943
|
+
/* @__PURE__ */ jsx69(
|
|
10927
10944
|
FiltersButton,
|
|
10928
10945
|
{
|
|
10929
10946
|
onClick: () => setIsOpen(true),
|
|
@@ -10931,14 +10948,14 @@ function Filters({ buttonClassName, buttonText }) {
|
|
|
10931
10948
|
children: buttonText
|
|
10932
10949
|
}
|
|
10933
10950
|
),
|
|
10934
|
-
/* @__PURE__ */
|
|
10951
|
+
/* @__PURE__ */ jsx69(FiltersDrawer, { isOpen, onClose: () => setIsOpen(false) })
|
|
10935
10952
|
] });
|
|
10936
10953
|
}
|
|
10937
10954
|
|
|
10938
10955
|
// src/composed/search/CurrentRefinements.tsx
|
|
10939
10956
|
import { useCurrentRefinements } from "react-instantsearch";
|
|
10940
10957
|
import { X as LucideX3 } from "lucide-react";
|
|
10941
|
-
import { jsx as
|
|
10958
|
+
import { jsx as jsx70, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10942
10959
|
var XIcon3 = LucideX3;
|
|
10943
10960
|
function CurrentRefinements() {
|
|
10944
10961
|
const { items, refine } = useCurrentRefinements();
|
|
@@ -10984,15 +11001,15 @@ function CurrentRefinements() {
|
|
|
10984
11001
|
if (allRefinements.length === 0) {
|
|
10985
11002
|
return null;
|
|
10986
11003
|
}
|
|
10987
|
-
return /* @__PURE__ */
|
|
11004
|
+
return /* @__PURE__ */ jsx70("div", { className: "flex flex-wrap items-center gap-2 mb-4 -mt-1", role: "group", "aria-label": "Active filters", children: allRefinements.map((refinement, index) => /* @__PURE__ */ jsxs46(
|
|
10988
11005
|
"button",
|
|
10989
11006
|
{
|
|
10990
11007
|
className: "bg-primary text-on-primary hover:bg-primary/90 inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-sm transition-colors",
|
|
10991
11008
|
onClick: () => refinement.refine(),
|
|
10992
11009
|
"aria-label": `Remove filter: ${refinement.displayLabel}`,
|
|
10993
11010
|
children: [
|
|
10994
|
-
/* @__PURE__ */
|
|
10995
|
-
/* @__PURE__ */
|
|
11011
|
+
/* @__PURE__ */ jsx70("span", { className: "truncate", children: refinement.displayLabel }),
|
|
11012
|
+
/* @__PURE__ */ jsx70(XIcon3, { className: "w-3 h-3" })
|
|
10996
11013
|
]
|
|
10997
11014
|
},
|
|
10998
11015
|
`${refinement.attribute}-${refinement.value}-${index}`
|
|
@@ -11021,7 +11038,7 @@ import { useState as useState39, useEffect as useEffect39 } from "react";
|
|
|
11021
11038
|
// src/composed/zoom/ZoomOverlay.tsx
|
|
11022
11039
|
import { useState as useState37, useCallback as useCallback20 } from "react";
|
|
11023
11040
|
import { Plus as LucidePlus2, Minus as LucideMinus2 } from "lucide-react";
|
|
11024
|
-
import { Fragment as Fragment15, jsx as
|
|
11041
|
+
import { Fragment as Fragment15, jsx as jsx71, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
11025
11042
|
var PlusIcon2 = LucidePlus2;
|
|
11026
11043
|
var MinusIcon2 = LucideMinus2;
|
|
11027
11044
|
function ZoomOverlay({
|
|
@@ -11081,8 +11098,8 @@ function ZoomOverlay({
|
|
|
11081
11098
|
const isHovered = hoveredImageIndex === imageIndex;
|
|
11082
11099
|
const cursorStyle = isLargeTouchDevice ? "pointer" : isTouchDevice ? "default" : "none";
|
|
11083
11100
|
return /* @__PURE__ */ jsxs47(Fragment15, { children: [
|
|
11084
|
-
/* @__PURE__ */
|
|
11085
|
-
/* @__PURE__ */
|
|
11101
|
+
/* @__PURE__ */ jsx71("div", { className: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", children: announcement }),
|
|
11102
|
+
/* @__PURE__ */ jsx71(
|
|
11086
11103
|
"div",
|
|
11087
11104
|
{
|
|
11088
11105
|
className,
|
|
@@ -11090,7 +11107,7 @@ function ZoomOverlay({
|
|
|
11090
11107
|
...style,
|
|
11091
11108
|
position: "relative"
|
|
11092
11109
|
},
|
|
11093
|
-
children: /* @__PURE__ */
|
|
11110
|
+
children: /* @__PURE__ */ jsx71(
|
|
11094
11111
|
"div",
|
|
11095
11112
|
{
|
|
11096
11113
|
style: {
|
|
@@ -11113,7 +11130,7 @@ function ZoomOverlay({
|
|
|
11113
11130
|
handleZoomClick(e);
|
|
11114
11131
|
}
|
|
11115
11132
|
},
|
|
11116
|
-
children: /* @__PURE__ */
|
|
11133
|
+
children: /* @__PURE__ */ jsx71(
|
|
11117
11134
|
"div",
|
|
11118
11135
|
{
|
|
11119
11136
|
style: {
|
|
@@ -11129,7 +11146,7 @@ function ZoomOverlay({
|
|
|
11129
11146
|
)
|
|
11130
11147
|
}
|
|
11131
11148
|
),
|
|
11132
|
-
isHovered && !isTouchDevice && /* @__PURE__ */
|
|
11149
|
+
isHovered && !isTouchDevice && /* @__PURE__ */ jsx71(
|
|
11133
11150
|
"div",
|
|
11134
11151
|
{
|
|
11135
11152
|
className: "fixed pointer-events-none z-50 hidden md:block",
|
|
@@ -11139,7 +11156,7 @@ function ZoomOverlay({
|
|
|
11139
11156
|
transform: "translate(-50%, -50%)"
|
|
11140
11157
|
},
|
|
11141
11158
|
"aria-hidden": "true",
|
|
11142
|
-
children: /* @__PURE__ */
|
|
11159
|
+
children: /* @__PURE__ */ jsx71("div", { className: "bg-white dark:bg-gray-800 rounded-full p-2 shadow-sm dark:shadow-gray-950/50", children: isZoomed ? /* @__PURE__ */ jsx71(
|
|
11143
11160
|
MinusIcon2,
|
|
11144
11161
|
{
|
|
11145
11162
|
size: 20,
|
|
@@ -11147,7 +11164,7 @@ function ZoomOverlay({
|
|
|
11147
11164
|
strokeWidth: 1.5,
|
|
11148
11165
|
"aria-hidden": "true"
|
|
11149
11166
|
}
|
|
11150
|
-
) : /* @__PURE__ */
|
|
11167
|
+
) : /* @__PURE__ */ jsx71(
|
|
11151
11168
|
PlusIcon2,
|
|
11152
11169
|
{
|
|
11153
11170
|
size: 20,
|
|
@@ -11175,7 +11192,7 @@ import {
|
|
|
11175
11192
|
TransformComponent as OriginalTransformComponent
|
|
11176
11193
|
} from "react-zoom-pan-pinch";
|
|
11177
11194
|
import { X as X2 } from "lucide-react";
|
|
11178
|
-
import { Fragment as Fragment16, jsx as
|
|
11195
|
+
import { Fragment as Fragment16, jsx as jsx72, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
11179
11196
|
var TransformWrapper = OriginalTransformWrapper;
|
|
11180
11197
|
var TransformComponent = OriginalTransformComponent;
|
|
11181
11198
|
var EnhancedImageViewer = ({
|
|
@@ -11315,12 +11332,12 @@ var EnhancedImageViewer = ({
|
|
|
11315
11332
|
);
|
|
11316
11333
|
if (!isMounted || !isClient) {
|
|
11317
11334
|
return createPortal3(
|
|
11318
|
-
/* @__PURE__ */
|
|
11335
|
+
/* @__PURE__ */ jsx72(
|
|
11319
11336
|
"div",
|
|
11320
11337
|
{
|
|
11321
11338
|
className: "fixed inset-0 bg-black flex items-center justify-center",
|
|
11322
11339
|
style: { zIndex: 999999 },
|
|
11323
|
-
children: /* @__PURE__ */
|
|
11340
|
+
children: /* @__PURE__ */ jsx72(
|
|
11324
11341
|
"div",
|
|
11325
11342
|
{
|
|
11326
11343
|
style: {
|
|
@@ -11345,7 +11362,7 @@ var EnhancedImageViewer = ({
|
|
|
11345
11362
|
"aria-modal": "true",
|
|
11346
11363
|
"aria-label": "Image viewer",
|
|
11347
11364
|
children: [
|
|
11348
|
-
/* @__PURE__ */
|
|
11365
|
+
/* @__PURE__ */ jsx72(
|
|
11349
11366
|
"button",
|
|
11350
11367
|
{
|
|
11351
11368
|
onClick: (e) => {
|
|
@@ -11371,10 +11388,10 @@ var EnhancedImageViewer = ({
|
|
|
11371
11388
|
touchAction: "manipulation",
|
|
11372
11389
|
marginBottom: "env(safe-area-inset-bottom, 0px)"
|
|
11373
11390
|
},
|
|
11374
|
-
children: /* @__PURE__ */
|
|
11391
|
+
children: /* @__PURE__ */ jsx72(X2, { className: "w-7 h-7", strokeWidth: 2.5 })
|
|
11375
11392
|
}
|
|
11376
11393
|
),
|
|
11377
|
-
/* @__PURE__ */
|
|
11394
|
+
/* @__PURE__ */ jsx72(
|
|
11378
11395
|
TransformWrapper,
|
|
11379
11396
|
{
|
|
11380
11397
|
initialScale: scale.initial,
|
|
@@ -11421,14 +11438,14 @@ var EnhancedImageViewer = ({
|
|
|
11421
11438
|
onTouchStart: handleTouchStart,
|
|
11422
11439
|
onTouchEnd: handleTouchEnd,
|
|
11423
11440
|
children: [
|
|
11424
|
-
/* @__PURE__ */
|
|
11441
|
+
/* @__PURE__ */ jsx72(
|
|
11425
11442
|
TransformComponent,
|
|
11426
11443
|
{
|
|
11427
11444
|
wrapperStyle: {
|
|
11428
11445
|
width: "100%",
|
|
11429
11446
|
height: "100%"
|
|
11430
11447
|
},
|
|
11431
|
-
children: /* @__PURE__ */
|
|
11448
|
+
children: /* @__PURE__ */ jsx72(
|
|
11432
11449
|
"div",
|
|
11433
11450
|
{
|
|
11434
11451
|
style: {
|
|
@@ -11439,7 +11456,7 @@ var EnhancedImageViewer = ({
|
|
|
11439
11456
|
alignItems: "center",
|
|
11440
11457
|
justifyContent: "center"
|
|
11441
11458
|
},
|
|
11442
|
-
children: /* @__PURE__ */
|
|
11459
|
+
children: /* @__PURE__ */ jsx72(
|
|
11443
11460
|
SafeImg,
|
|
11444
11461
|
{
|
|
11445
11462
|
ref: imgRef,
|
|
@@ -11461,7 +11478,7 @@ var EnhancedImageViewer = ({
|
|
|
11461
11478
|
}
|
|
11462
11479
|
),
|
|
11463
11480
|
/* @__PURE__ */ jsxs48("div", { className: "fixed bottom-5 left-0 right-0 z-50", children: [
|
|
11464
|
-
/* @__PURE__ */
|
|
11481
|
+
/* @__PURE__ */ jsx72("div", { className: "flex justify-center gap-2", children: (() => {
|
|
11465
11482
|
let currentIndex = propCurrentIndex !== void 0 ? propCurrentIndex : -1;
|
|
11466
11483
|
if (currentIndex === -1) {
|
|
11467
11484
|
currentIndex = images.findIndex(
|
|
@@ -11495,7 +11512,7 @@ var EnhancedImageViewer = ({
|
|
|
11495
11512
|
const nextIndex = findNextAvailableIndex(currentIndex, 1);
|
|
11496
11513
|
const prevIndex = findNextAvailableIndex(currentIndex, -1);
|
|
11497
11514
|
return /* @__PURE__ */ jsxs48(Fragment16, { children: [
|
|
11498
|
-
/* @__PURE__ */
|
|
11515
|
+
/* @__PURE__ */ jsx72(
|
|
11499
11516
|
"button",
|
|
11500
11517
|
{
|
|
11501
11518
|
onClick: () => {
|
|
@@ -11508,7 +11525,7 @@ var EnhancedImageViewer = ({
|
|
|
11508
11525
|
className: `w-10 h-10 rounded-full shadow-lg flex items-center justify-center transition-all duration-200 ${prevIndex === -1 ? "bg-white/40 text-black opacity-50 cursor-not-allowed" : "bg-white/90 hover:bg-white text-black"}`,
|
|
11509
11526
|
style: { touchAction: "manipulation" },
|
|
11510
11527
|
"aria-label": "Previous image",
|
|
11511
|
-
children: /* @__PURE__ */
|
|
11528
|
+
children: /* @__PURE__ */ jsx72(
|
|
11512
11529
|
"svg",
|
|
11513
11530
|
{
|
|
11514
11531
|
className: "w-4 h-4",
|
|
@@ -11516,7 +11533,7 @@ var EnhancedImageViewer = ({
|
|
|
11516
11533
|
stroke: "currentColor",
|
|
11517
11534
|
viewBox: "0 0 24 24",
|
|
11518
11535
|
"aria-hidden": "true",
|
|
11519
|
-
children: /* @__PURE__ */
|
|
11536
|
+
children: /* @__PURE__ */ jsx72(
|
|
11520
11537
|
"path",
|
|
11521
11538
|
{
|
|
11522
11539
|
strokeLinecap: "round",
|
|
@@ -11529,7 +11546,7 @@ var EnhancedImageViewer = ({
|
|
|
11529
11546
|
)
|
|
11530
11547
|
}
|
|
11531
11548
|
),
|
|
11532
|
-
/* @__PURE__ */
|
|
11549
|
+
/* @__PURE__ */ jsx72(
|
|
11533
11550
|
"button",
|
|
11534
11551
|
{
|
|
11535
11552
|
onClick: () => {
|
|
@@ -11542,7 +11559,7 @@ var EnhancedImageViewer = ({
|
|
|
11542
11559
|
className: `w-10 h-10 rounded-full shadow-lg flex items-center justify-center transition-all duration-200 ${nextIndex === -1 ? "bg-white/40 text-black opacity-50 cursor-not-allowed" : "bg-white/90 hover:bg-white text-black"}`,
|
|
11543
11560
|
style: { touchAction: "manipulation" },
|
|
11544
11561
|
"aria-label": "Next image",
|
|
11545
|
-
children: /* @__PURE__ */
|
|
11562
|
+
children: /* @__PURE__ */ jsx72(
|
|
11546
11563
|
"svg",
|
|
11547
11564
|
{
|
|
11548
11565
|
className: "w-4 h-4",
|
|
@@ -11550,7 +11567,7 @@ var EnhancedImageViewer = ({
|
|
|
11550
11567
|
stroke: "currentColor",
|
|
11551
11568
|
viewBox: "0 0 24 24",
|
|
11552
11569
|
"aria-hidden": "true",
|
|
11553
|
-
children: /* @__PURE__ */
|
|
11570
|
+
children: /* @__PURE__ */ jsx72(
|
|
11554
11571
|
"path",
|
|
11555
11572
|
{
|
|
11556
11573
|
strokeLinecap: "round",
|
|
@@ -11565,7 +11582,7 @@ var EnhancedImageViewer = ({
|
|
|
11565
11582
|
)
|
|
11566
11583
|
] });
|
|
11567
11584
|
})() }),
|
|
11568
|
-
/* @__PURE__ */
|
|
11585
|
+
/* @__PURE__ */ jsx72("div", { style: { position: "fixed", bottom: 20, left: 24, zIndex: 10, marginBottom: "env(safe-area-inset-bottom, 0px)" }, className: "h-10 px-3 rounded-full bg-white/90 text-black text-sm font-medium flex items-center justify-center shadow-lg", children: (() => {
|
|
11569
11586
|
const total = Math.max(images.length, 1);
|
|
11570
11587
|
const current = propCurrentIndex !== void 0 ? Math.min(propCurrentIndex + 1, total) : 1;
|
|
11571
11588
|
return `${current} / ${total}`;
|
|
@@ -11577,7 +11594,7 @@ var EnhancedImageViewer = ({
|
|
|
11577
11594
|
},
|
|
11578
11595
|
`${scale.initial}-${scale.min}-${scale.max}`
|
|
11579
11596
|
),
|
|
11580
|
-
/* @__PURE__ */
|
|
11597
|
+
/* @__PURE__ */ jsx72(
|
|
11581
11598
|
"div",
|
|
11582
11599
|
{
|
|
11583
11600
|
className: "absolute inset-0 bg-black",
|
|
@@ -11596,7 +11613,7 @@ var EnhancedImageViewer = ({
|
|
|
11596
11613
|
};
|
|
11597
11614
|
|
|
11598
11615
|
// src/composed/zoom/ResponsiveZoom.tsx
|
|
11599
|
-
import { Fragment as Fragment17, jsx as
|
|
11616
|
+
import { Fragment as Fragment17, jsx as jsx73, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
11600
11617
|
function ResponsiveZoom({
|
|
11601
11618
|
imageIndex,
|
|
11602
11619
|
children,
|
|
@@ -11638,7 +11655,7 @@ function ResponsiveZoom({
|
|
|
11638
11655
|
}
|
|
11639
11656
|
};
|
|
11640
11657
|
return /* @__PURE__ */ jsxs49(Fragment17, { children: [
|
|
11641
|
-
isTouchDevice ? /* @__PURE__ */
|
|
11658
|
+
isTouchDevice ? /* @__PURE__ */ jsx73(
|
|
11642
11659
|
"div",
|
|
11643
11660
|
{
|
|
11644
11661
|
className,
|
|
@@ -11655,7 +11672,7 @@ function ResponsiveZoom({
|
|
|
11655
11672
|
},
|
|
11656
11673
|
children
|
|
11657
11674
|
}
|
|
11658
|
-
) : /* @__PURE__ */
|
|
11675
|
+
) : /* @__PURE__ */ jsx73(
|
|
11659
11676
|
ZoomOverlay,
|
|
11660
11677
|
{
|
|
11661
11678
|
imageIndex,
|
|
@@ -11666,7 +11683,7 @@ function ResponsiveZoom({
|
|
|
11666
11683
|
children
|
|
11667
11684
|
}
|
|
11668
11685
|
),
|
|
11669
|
-
showEnhancedViewer && isTouchDevice && currentImageUrl && /* @__PURE__ */
|
|
11686
|
+
showEnhancedViewer && isTouchDevice && currentImageUrl && /* @__PURE__ */ jsx73(
|
|
11670
11687
|
EnhancedImageViewer,
|
|
11671
11688
|
{
|
|
11672
11689
|
imageUrl: currentImageUrl,
|
|
@@ -11697,7 +11714,7 @@ import {
|
|
|
11697
11714
|
useMemo as useMemo15,
|
|
11698
11715
|
memo as memo4
|
|
11699
11716
|
} from "react";
|
|
11700
|
-
import { jsx as
|
|
11717
|
+
import { jsx as jsx74, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
11701
11718
|
function StaticCarouselImage({
|
|
11702
11719
|
src,
|
|
11703
11720
|
alt,
|
|
@@ -11705,9 +11722,9 @@ function StaticCarouselImage({
|
|
|
11705
11722
|
}) {
|
|
11706
11723
|
const [failed, setFailed] = useState40(false);
|
|
11707
11724
|
if (failed || !src) {
|
|
11708
|
-
return /* @__PURE__ */
|
|
11725
|
+
return /* @__PURE__ */ jsx74("div", { className: `bg-muted ${className ?? ""}`, role: "img", "aria-label": alt });
|
|
11709
11726
|
}
|
|
11710
|
-
return /* @__PURE__ */
|
|
11727
|
+
return /* @__PURE__ */ jsx74(
|
|
11711
11728
|
"img",
|
|
11712
11729
|
{
|
|
11713
11730
|
src,
|
|
@@ -12197,14 +12214,14 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12197
12214
|
);
|
|
12198
12215
|
useEffect40(() => {
|
|
12199
12216
|
if (stickyHeroContext?.setCarouselIndicator && images.length > 1) {
|
|
12200
|
-
const indicator = /* @__PURE__ */
|
|
12217
|
+
const indicator = /* @__PURE__ */ jsx74(
|
|
12201
12218
|
"div",
|
|
12202
12219
|
{
|
|
12203
12220
|
className: "w-full",
|
|
12204
12221
|
role: "group",
|
|
12205
12222
|
"aria-label": "Product image navigation",
|
|
12206
12223
|
children: /* @__PURE__ */ jsxs50("div", { className: "relative h-1", children: [
|
|
12207
|
-
/* @__PURE__ */
|
|
12224
|
+
/* @__PURE__ */ jsx74("div", { className: "flex h-full", children: images.map((_, index) => /* @__PURE__ */ jsx74(
|
|
12208
12225
|
"button",
|
|
12209
12226
|
{
|
|
12210
12227
|
onClick: () => goToSlide(index),
|
|
@@ -12214,7 +12231,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12214
12231
|
},
|
|
12215
12232
|
index
|
|
12216
12233
|
)) }),
|
|
12217
|
-
/* @__PURE__ */
|
|
12234
|
+
/* @__PURE__ */ jsx74(
|
|
12218
12235
|
"div",
|
|
12219
12236
|
{
|
|
12220
12237
|
className: "absolute top-0 h-full bg-primary transition-all duration-300 ease-out",
|
|
@@ -12237,10 +12254,10 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12237
12254
|
};
|
|
12238
12255
|
}, [activeIndex, images.length, goToSlide, stickyHeroContext]);
|
|
12239
12256
|
if (!images || images.length === 0) {
|
|
12240
|
-
return /* @__PURE__ */
|
|
12257
|
+
return /* @__PURE__ */ jsx74("div", { className: "w-full aspect-video bg-muted rounded-lg" });
|
|
12241
12258
|
}
|
|
12242
12259
|
return /* @__PURE__ */ jsxs50("div", { className: `relative w-full h-full ${className}`, children: [
|
|
12243
|
-
/* @__PURE__ */
|
|
12260
|
+
/* @__PURE__ */ jsx74(
|
|
12244
12261
|
"div",
|
|
12245
12262
|
{
|
|
12246
12263
|
ref: carouselRef,
|
|
@@ -12258,7 +12275,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12258
12275
|
role: "region",
|
|
12259
12276
|
"aria-roledescription": "carousel",
|
|
12260
12277
|
"aria-label": "Product images",
|
|
12261
|
-
children: /* @__PURE__ */
|
|
12278
|
+
children: /* @__PURE__ */ jsx74(
|
|
12262
12279
|
"div",
|
|
12263
12280
|
{
|
|
12264
12281
|
className: `flex h-full ${isPeekReturning ? "transition-transform duration-300 ease-[cubic-bezier(0,0,0.2,1)]" : isPeeking ? "transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]" : isTransitioning || !isDragging ? "transition-transform duration-300 ease-[cubic-bezier(0.25,0.46,0.45,0.94)]" : ""}`,
|
|
@@ -12268,15 +12285,15 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12268
12285
|
children: images.map((image, index) => {
|
|
12269
12286
|
const DECODE_WINDOW = 1;
|
|
12270
12287
|
const isWithinDecodeWindow = Math.abs(index - activeIndex) <= DECODE_WINDOW;
|
|
12271
|
-
return /* @__PURE__ */
|
|
12288
|
+
return /* @__PURE__ */ jsx74(
|
|
12272
12289
|
"div",
|
|
12273
12290
|
{
|
|
12274
12291
|
className: "w-full h-full flex-shrink-0 relative select-none",
|
|
12275
|
-
children: !isWithinDecodeWindow ? /* @__PURE__ */
|
|
12292
|
+
children: !isWithinDecodeWindow ? /* @__PURE__ */ jsx74("div", { className: "w-full h-full bg-muted" }) : image.isPlaceholder ? (
|
|
12276
12293
|
// Rainbow prism loader (same as the /create route) instead of
|
|
12277
12294
|
// a flat pulse; fills this relative slide via inset:0.
|
|
12278
|
-
/* @__PURE__ */
|
|
12279
|
-
) : image.isRealMockup && currentArtwork ? /* @__PURE__ */
|
|
12295
|
+
/* @__PURE__ */ jsx74(LoadingOverlayPrismCandyInline, { visible: true, variant: "light" })
|
|
12296
|
+
) : image.isRealMockup && currentArtwork ? /* @__PURE__ */ jsx74(
|
|
12280
12297
|
HeroProductImage,
|
|
12281
12298
|
{
|
|
12282
12299
|
productId,
|
|
@@ -12288,7 +12305,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12288
12305
|
onUrlGenerated: image.mockupId ? (url) => handleUrlGenerated(image.mockupId, url) : void 0,
|
|
12289
12306
|
className: "w-full h-full object-cover cursor-pointer pointer-events-none"
|
|
12290
12307
|
}
|
|
12291
|
-
) : image.isRealMockup && !currentArtwork ? /* @__PURE__ */
|
|
12308
|
+
) : image.isRealMockup && !currentArtwork ? /* @__PURE__ */ jsx74(LoadingOverlayPrismCandyInline, { visible: true, variant: "light" }) : /* @__PURE__ */ jsx74(
|
|
12292
12309
|
StaticCarouselImage,
|
|
12293
12310
|
{
|
|
12294
12311
|
src: image.src,
|
|
@@ -12304,7 +12321,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12304
12321
|
)
|
|
12305
12322
|
}
|
|
12306
12323
|
),
|
|
12307
|
-
showIndicators && images.length > 1 && /* @__PURE__ */
|
|
12324
|
+
showIndicators && images.length > 1 && /* @__PURE__ */ jsx74(
|
|
12308
12325
|
"div",
|
|
12309
12326
|
{
|
|
12310
12327
|
ref: indicatorRef,
|
|
@@ -12313,7 +12330,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12313
12330
|
role: "group",
|
|
12314
12331
|
"aria-label": "Product image navigation",
|
|
12315
12332
|
children: /* @__PURE__ */ jsxs50("div", { className: "relative h-1", children: [
|
|
12316
|
-
/* @__PURE__ */
|
|
12333
|
+
/* @__PURE__ */ jsx74("div", { className: "flex h-full absolute inset-0", children: images.map((_, index) => /* @__PURE__ */ jsx74(
|
|
12317
12334
|
"button",
|
|
12318
12335
|
{
|
|
12319
12336
|
onClick: () => goToSlide(index),
|
|
@@ -12323,7 +12340,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12323
12340
|
},
|
|
12324
12341
|
index
|
|
12325
12342
|
)) }),
|
|
12326
|
-
/* @__PURE__ */
|
|
12343
|
+
/* @__PURE__ */ jsx74(
|
|
12327
12344
|
"div",
|
|
12328
12345
|
{
|
|
12329
12346
|
className: `absolute top-0 h-full bg-foreground ${isPeekReturning ? "transition-all duration-300 ease-[cubic-bezier(0,0,0.2,1)]" : isPeeking ? "transition-all duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]" : isDragging ? "" : "transition-all duration-300 ease-out"}`,
|
|
@@ -12358,7 +12375,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12358
12375
|
naturalHeight: img.naturalHeight
|
|
12359
12376
|
} : null;
|
|
12360
12377
|
}).filter((img) => img !== null);
|
|
12361
|
-
return /* @__PURE__ */
|
|
12378
|
+
return /* @__PURE__ */ jsx74(
|
|
12362
12379
|
EnhancedImageViewer,
|
|
12363
12380
|
{
|
|
12364
12381
|
imageUrl,
|
|
@@ -12398,7 +12415,7 @@ var MobileProductCarousel = memo4(function MobileProductCarousel2({
|
|
|
12398
12415
|
|
|
12399
12416
|
// src/composed/carousels/HeroCarousel.tsx
|
|
12400
12417
|
import { useState as useState41, useRef as useRef27, useCallback as useCallback23, useEffect as useEffect41 } from "react";
|
|
12401
|
-
import { jsx as
|
|
12418
|
+
import { jsx as jsx75, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
12402
12419
|
function HeroCarousel({
|
|
12403
12420
|
images,
|
|
12404
12421
|
currentIndex = 0,
|
|
@@ -12477,7 +12494,7 @@ function HeroCarousel({
|
|
|
12477
12494
|
};
|
|
12478
12495
|
}, [activeIndex, images.length, goToSlide, onImageTap]);
|
|
12479
12496
|
if (!images || images.length === 0) {
|
|
12480
|
-
return /* @__PURE__ */
|
|
12497
|
+
return /* @__PURE__ */ jsx75("div", { className: "w-full h-full bg-muted" });
|
|
12481
12498
|
}
|
|
12482
12499
|
return /* @__PURE__ */ jsxs51(
|
|
12483
12500
|
"div",
|
|
@@ -12490,7 +12507,7 @@ function HeroCarousel({
|
|
|
12490
12507
|
overflow: "hidden"
|
|
12491
12508
|
},
|
|
12492
12509
|
children: [
|
|
12493
|
-
/* @__PURE__ */
|
|
12510
|
+
/* @__PURE__ */ jsx75(
|
|
12494
12511
|
"div",
|
|
12495
12512
|
{
|
|
12496
12513
|
className: "flex h-full transition-transform duration-300 ease-out",
|
|
@@ -12501,14 +12518,14 @@ function HeroCarousel({
|
|
|
12501
12518
|
backfaceVisibility: "hidden",
|
|
12502
12519
|
WebkitBackfaceVisibility: "hidden"
|
|
12503
12520
|
},
|
|
12504
|
-
children: images.map((image, index) => /* @__PURE__ */
|
|
12521
|
+
children: images.map((image, index) => /* @__PURE__ */ jsx75(
|
|
12505
12522
|
"div",
|
|
12506
12523
|
{
|
|
12507
12524
|
className: "w-full h-full flex-shrink-0",
|
|
12508
12525
|
style: {
|
|
12509
12526
|
contain: "layout paint"
|
|
12510
12527
|
},
|
|
12511
|
-
children: image.isRealMockup && currentArtwork ? /* @__PURE__ */
|
|
12528
|
+
children: image.isRealMockup && currentArtwork ? /* @__PURE__ */ jsx75(
|
|
12512
12529
|
HeroProductImage,
|
|
12513
12530
|
{
|
|
12514
12531
|
productId,
|
|
@@ -12517,7 +12534,7 @@ function HeroCarousel({
|
|
|
12517
12534
|
mockupId: image.mockupId,
|
|
12518
12535
|
className: "w-full h-full object-cover"
|
|
12519
12536
|
}
|
|
12520
|
-
) : /* @__PURE__ */
|
|
12537
|
+
) : /* @__PURE__ */ jsx75(
|
|
12521
12538
|
"img",
|
|
12522
12539
|
{
|
|
12523
12540
|
src: image.src,
|
|
@@ -12534,12 +12551,12 @@ function HeroCarousel({
|
|
|
12534
12551
|
))
|
|
12535
12552
|
}
|
|
12536
12553
|
),
|
|
12537
|
-
images.length > 1 && /* @__PURE__ */
|
|
12554
|
+
images.length > 1 && /* @__PURE__ */ jsx75(
|
|
12538
12555
|
"div",
|
|
12539
12556
|
{
|
|
12540
12557
|
className: "absolute bottom-4 left-0 right-0 flex justify-center gap-2 z-10",
|
|
12541
12558
|
style: { contain: "layout style" },
|
|
12542
|
-
children: images.map((_, index) => /* @__PURE__ */
|
|
12559
|
+
children: images.map((_, index) => /* @__PURE__ */ jsx75(
|
|
12543
12560
|
"button",
|
|
12544
12561
|
{
|
|
12545
12562
|
onClick: () => goToSlide(index),
|
|
@@ -12557,7 +12574,7 @@ function HeroCarousel({
|
|
|
12557
12574
|
|
|
12558
12575
|
// src/composed/grids/MasonryGrid.tsx
|
|
12559
12576
|
import { useState as useState42, useEffect as useEffect42, useMemo as useMemo16 } from "react";
|
|
12560
|
-
import { Fragment as Fragment18, jsx as
|
|
12577
|
+
import { Fragment as Fragment18, jsx as jsx76 } from "react/jsx-runtime";
|
|
12561
12578
|
var BREAKPOINTS = {
|
|
12562
12579
|
sm: 640,
|
|
12563
12580
|
md: 768,
|
|
@@ -12629,24 +12646,24 @@ function MasonryGrid({
|
|
|
12629
12646
|
);
|
|
12630
12647
|
if (items.length === 0) {
|
|
12631
12648
|
if (emptyContent) {
|
|
12632
|
-
return /* @__PURE__ */
|
|
12649
|
+
return /* @__PURE__ */ jsx76(Fragment18, { children: emptyContent });
|
|
12633
12650
|
}
|
|
12634
12651
|
return null;
|
|
12635
12652
|
}
|
|
12636
|
-
return /* @__PURE__ */
|
|
12653
|
+
return /* @__PURE__ */ jsx76(
|
|
12637
12654
|
"div",
|
|
12638
12655
|
{
|
|
12639
12656
|
className: `flex ${className}`,
|
|
12640
12657
|
style: { gap: `${gap}px` },
|
|
12641
12658
|
role: "list",
|
|
12642
|
-
children: distributedColumns.map((columnItems, columnIndex) => /* @__PURE__ */
|
|
12659
|
+
children: distributedColumns.map((columnItems, columnIndex) => /* @__PURE__ */ jsx76(
|
|
12643
12660
|
"div",
|
|
12644
12661
|
{
|
|
12645
12662
|
className: "flex-1 flex flex-col",
|
|
12646
12663
|
style: { gap: `${gap}px` },
|
|
12647
12664
|
children: columnItems.map((item, itemIndex) => {
|
|
12648
12665
|
const originalIndex = itemIndex * columnCount + columnIndex;
|
|
12649
|
-
return /* @__PURE__ */
|
|
12666
|
+
return /* @__PURE__ */ jsx76("div", { role: "listitem", children: renderItem(item, originalIndex) }, originalIndex);
|
|
12650
12667
|
})
|
|
12651
12668
|
},
|
|
12652
12669
|
columnIndex
|
|
@@ -12745,7 +12762,7 @@ function useHeroZoomScales(config = {}) {
|
|
|
12745
12762
|
}
|
|
12746
12763
|
|
|
12747
12764
|
// src/layouts/hero-zoom/HeroZoomLayout.tsx
|
|
12748
|
-
import { jsx as
|
|
12765
|
+
import { jsx as jsx77, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
12749
12766
|
function HeroZoomLayout({
|
|
12750
12767
|
config = {},
|
|
12751
12768
|
header,
|
|
@@ -12918,8 +12935,8 @@ function HeroZoomLayout({
|
|
|
12918
12935
|
"--hero-zoom-final-transform": 1 / activeRender
|
|
12919
12936
|
},
|
|
12920
12937
|
children: [
|
|
12921
|
-
/* @__PURE__ */
|
|
12922
|
-
/* @__PURE__ */
|
|
12938
|
+
/* @__PURE__ */ jsx77("style", { dangerouslySetInnerHTML: { __html: scopedStyles } }),
|
|
12939
|
+
/* @__PURE__ */ jsx77(
|
|
12923
12940
|
"div",
|
|
12924
12941
|
{
|
|
12925
12942
|
style: {
|
|
@@ -12927,7 +12944,7 @@ function HeroZoomLayout({
|
|
|
12927
12944
|
}
|
|
12928
12945
|
}
|
|
12929
12946
|
),
|
|
12930
|
-
header && /* @__PURE__ */
|
|
12947
|
+
header && /* @__PURE__ */ jsx77(
|
|
12931
12948
|
"div",
|
|
12932
12949
|
{
|
|
12933
12950
|
ref: headerRef,
|
|
@@ -12940,7 +12957,7 @@ function HeroZoomLayout({
|
|
|
12940
12957
|
children: header
|
|
12941
12958
|
}
|
|
12942
12959
|
),
|
|
12943
|
-
/* @__PURE__ */
|
|
12960
|
+
/* @__PURE__ */ jsx77(
|
|
12944
12961
|
"div",
|
|
12945
12962
|
{
|
|
12946
12963
|
ref: imageContainerRef,
|
|
@@ -12960,7 +12977,7 @@ function HeroZoomLayout({
|
|
|
12960
12977
|
children: hero
|
|
12961
12978
|
}
|
|
12962
12979
|
),
|
|
12963
|
-
/* @__PURE__ */
|
|
12980
|
+
/* @__PURE__ */ jsx77("div", { className: "relative z-10", children })
|
|
12964
12981
|
]
|
|
12965
12982
|
}
|
|
12966
12983
|
);
|
|
@@ -12968,7 +12985,7 @@ function HeroZoomLayout({
|
|
|
12968
12985
|
|
|
12969
12986
|
// src/layouts/hero-zoom/HeroShrinkLayout.tsx
|
|
12970
12987
|
import { useEffect as useEffect45, useRef as useRef29, useState as useState44 } from "react";
|
|
12971
|
-
import { jsx as
|
|
12988
|
+
import { jsx as jsx78, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
12972
12989
|
var DEFAULT_CONFIG = {
|
|
12973
12990
|
aspectRatio: 16 / 9,
|
|
12974
12991
|
initialHeightPercent: 70,
|
|
@@ -13087,9 +13104,9 @@ function HeroShrinkLayout({
|
|
|
13087
13104
|
className: `relative min-h-screen ${className}`,
|
|
13088
13105
|
style: { ...style, ...cssVars },
|
|
13089
13106
|
children: [
|
|
13090
|
-
/* @__PURE__ */
|
|
13091
|
-
/* @__PURE__ */
|
|
13092
|
-
header && /* @__PURE__ */
|
|
13107
|
+
/* @__PURE__ */ jsx78("style", { dangerouslySetInnerHTML: { __html: scopedStyles } }),
|
|
13108
|
+
/* @__PURE__ */ jsx78("div", { style: { height: spacerHeight } }),
|
|
13109
|
+
header && /* @__PURE__ */ jsx78(
|
|
13093
13110
|
"div",
|
|
13094
13111
|
{
|
|
13095
13112
|
ref: headerRef,
|
|
@@ -13098,7 +13115,7 @@ function HeroShrinkLayout({
|
|
|
13098
13115
|
children: header
|
|
13099
13116
|
}
|
|
13100
13117
|
),
|
|
13101
|
-
/* @__PURE__ */
|
|
13118
|
+
/* @__PURE__ */ jsx78(
|
|
13102
13119
|
"div",
|
|
13103
13120
|
{
|
|
13104
13121
|
ref: heroRef,
|
|
@@ -13106,15 +13123,15 @@ function HeroShrinkLayout({
|
|
|
13106
13123
|
children: hero
|
|
13107
13124
|
}
|
|
13108
13125
|
),
|
|
13109
|
-
/* @__PURE__ */
|
|
13126
|
+
/* @__PURE__ */ jsx78("div", { className: "relative z-10 bg-background", children })
|
|
13110
13127
|
]
|
|
13111
13128
|
}
|
|
13112
13129
|
);
|
|
13113
13130
|
}
|
|
13114
13131
|
|
|
13115
13132
|
// src/layouts/pdp/ImageEdgeBlur.tsx
|
|
13116
|
-
import
|
|
13117
|
-
import { jsx as
|
|
13133
|
+
import React52 from "react";
|
|
13134
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
13118
13135
|
var BLUR_CONFIG = {
|
|
13119
13136
|
blur: 24,
|
|
13120
13137
|
crossfade: 68
|
|
@@ -13138,7 +13155,7 @@ var BLUR_LAYERS = [
|
|
|
13138
13155
|
{ blur: Math.round(BLUR_CONFIG.blur * 0.5), zone: 0.6 },
|
|
13139
13156
|
{ blur: BLUR_CONFIG.blur, zone: 1 }
|
|
13140
13157
|
];
|
|
13141
|
-
var ImageEdgeBlur =
|
|
13158
|
+
var ImageEdgeBlur = React52.memo(
|
|
13142
13159
|
function ImageEdgeBlur2({
|
|
13143
13160
|
imageSrc,
|
|
13144
13161
|
imageCapInfo,
|
|
@@ -13169,7 +13186,7 @@ var ImageEdgeBlur = React51.memo(
|
|
|
13169
13186
|
viewportWidth / LAYOUT_CONFIG2.IMAGE.ASPECT_RATIO,
|
|
13170
13187
|
maxWidthPx / LAYOUT_CONFIG2.IMAGE.ASPECT_RATIO
|
|
13171
13188
|
);
|
|
13172
|
-
return /* @__PURE__ */
|
|
13189
|
+
return /* @__PURE__ */ jsx79(
|
|
13173
13190
|
"div",
|
|
13174
13191
|
{
|
|
13175
13192
|
className: `absolute inset-0 pointer-events-none overflow-hidden ${className}`,
|
|
@@ -13177,7 +13194,7 @@ var ImageEdgeBlur = React51.memo(
|
|
|
13177
13194
|
children: BLUR_LAYERS.map((layer, index) => {
|
|
13178
13195
|
const layerMask = index === BLUR_LAYERS.length - 1 ? void 0 : `linear-gradient(to right, black 0%, black ${layer.zone * 100}%, transparent ${layer.zone * 100 + 10}%)`;
|
|
13179
13196
|
const blurScale = 1 + layer.blur * 3 / containerHeightPx;
|
|
13180
|
-
return /* @__PURE__ */
|
|
13197
|
+
return /* @__PURE__ */ jsx79(
|
|
13181
13198
|
"img",
|
|
13182
13199
|
{
|
|
13183
13200
|
src: imageSrc,
|
|
@@ -13224,7 +13241,7 @@ var ImageEdgeBlur = React51.memo(
|
|
|
13224
13241
|
);
|
|
13225
13242
|
|
|
13226
13243
|
// src/layouts/pdp/PDPLayout.tsx
|
|
13227
|
-
import { jsx as
|
|
13244
|
+
import { jsx as jsx80, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
13228
13245
|
function PDPLayout({
|
|
13229
13246
|
renderHeroImage,
|
|
13230
13247
|
renderContent,
|
|
@@ -13254,13 +13271,13 @@ function PDPLayout({
|
|
|
13254
13271
|
};
|
|
13255
13272
|
return /* @__PURE__ */ jsxs54("div", { className: `pdp-layout ${className}`, children: [
|
|
13256
13273
|
(isDesktop === false || isDesktop === null) && /* @__PURE__ */ jsxs54("div", { className: "md:hidden", children: [
|
|
13257
|
-
renderMobileCarousel && /* @__PURE__ */
|
|
13258
|
-
/* @__PURE__ */
|
|
13274
|
+
renderMobileCarousel && /* @__PURE__ */ jsx80("div", { className: "mobile-carousel-container", children: renderMobileCarousel({ images: carouselImages }) }),
|
|
13275
|
+
/* @__PURE__ */ jsx80("div", { className: "mobile-content p-4", children: renderContent(contentProps) })
|
|
13259
13276
|
] }),
|
|
13260
13277
|
(isDesktop === true || isDesktop === null) && /* @__PURE__ */ jsxs54("div", { className: "hidden md:block relative", children: [
|
|
13261
13278
|
/* @__PURE__ */ jsxs54("div", { className: "desktop-hero relative", children: [
|
|
13262
13279
|
renderHeroImage(heroProps),
|
|
13263
|
-
showEdgeBlur && blurImageSrc && isWideMonitor2 && /* @__PURE__ */
|
|
13280
|
+
showEdgeBlur && blurImageSrc && isWideMonitor2 && /* @__PURE__ */ jsx80(
|
|
13264
13281
|
ImageEdgeBlur,
|
|
13265
13282
|
{
|
|
13266
13283
|
imageSrc: blurImageSrc,
|
|
@@ -13271,7 +13288,7 @@ function PDPLayout({
|
|
|
13271
13288
|
}
|
|
13272
13289
|
)
|
|
13273
13290
|
] }),
|
|
13274
|
-
/* @__PURE__ */
|
|
13291
|
+
/* @__PURE__ */ jsx80(
|
|
13275
13292
|
"div",
|
|
13276
13293
|
{
|
|
13277
13294
|
className: "desktop-sidebar",
|
|
@@ -13288,8 +13305,8 @@ function PDPLayout({
|
|
|
13288
13305
|
}
|
|
13289
13306
|
|
|
13290
13307
|
// src/layouts/pdp/SimpleImageBlur.tsx
|
|
13291
|
-
import
|
|
13292
|
-
import { jsx as
|
|
13308
|
+
import React53 from "react";
|
|
13309
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
13293
13310
|
var BLUR_CONFIG2 = {
|
|
13294
13311
|
blur: 24,
|
|
13295
13312
|
crossfade: 60
|
|
@@ -13312,7 +13329,7 @@ function getFadeInMask(crossfadeWidth) {
|
|
|
13312
13329
|
black ${crossfadeWidth + 10}px
|
|
13313
13330
|
)`;
|
|
13314
13331
|
}
|
|
13315
|
-
var SimpleImageBlur =
|
|
13332
|
+
var SimpleImageBlur = React53.memo(function SimpleImageBlur2({
|
|
13316
13333
|
imageSrc,
|
|
13317
13334
|
width,
|
|
13318
13335
|
height = "100%",
|
|
@@ -13322,7 +13339,7 @@ var SimpleImageBlur = React52.memo(function SimpleImageBlur2({
|
|
|
13322
13339
|
if (!imageSrc || width <= 0) return null;
|
|
13323
13340
|
const fadeInMask = getFadeInMask(BLUR_CONFIG2.crossfade);
|
|
13324
13341
|
const extendedWidth = width + BLUR_CONFIG2.blur * 2;
|
|
13325
|
-
return /* @__PURE__ */
|
|
13342
|
+
return /* @__PURE__ */ jsx81(
|
|
13326
13343
|
"div",
|
|
13327
13344
|
{
|
|
13328
13345
|
className: `relative overflow-hidden ${className}`,
|
|
@@ -13335,7 +13352,7 @@ var SimpleImageBlur = React52.memo(function SimpleImageBlur2({
|
|
|
13335
13352
|
black 0%,
|
|
13336
13353
|
black ${layer.zone * 100}%,
|
|
13337
13354
|
transparent ${layer.zone * 100 + 10}%)`;
|
|
13338
|
-
return /* @__PURE__ */
|
|
13355
|
+
return /* @__PURE__ */ jsx81(
|
|
13339
13356
|
"img",
|
|
13340
13357
|
{
|
|
13341
13358
|
src: imageSrc,
|
|
@@ -13365,8 +13382,8 @@ var SimpleImageBlur = React52.memo(function SimpleImageBlur2({
|
|
|
13365
13382
|
});
|
|
13366
13383
|
|
|
13367
13384
|
// src/layouts/pdp/EdgeBlurBox.tsx
|
|
13368
|
-
import
|
|
13369
|
-
import { jsx as
|
|
13385
|
+
import React54 from "react";
|
|
13386
|
+
import { jsx as jsx82, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
13370
13387
|
var BLUR_CONFIG3 = {
|
|
13371
13388
|
blur: 24,
|
|
13372
13389
|
crossfade: 60
|
|
@@ -13390,7 +13407,7 @@ function getFadeOutMask(crossfadeWidth) {
|
|
|
13390
13407
|
transparent 100%
|
|
13391
13408
|
)`;
|
|
13392
13409
|
}
|
|
13393
|
-
var EdgeBlurBox =
|
|
13410
|
+
var EdgeBlurBox = React54.memo(function EdgeBlurBox2({
|
|
13394
13411
|
imageSrc,
|
|
13395
13412
|
width,
|
|
13396
13413
|
height = "100%",
|
|
@@ -13416,7 +13433,7 @@ var EdgeBlurBox = React53.memo(function EdgeBlurBox2({
|
|
|
13416
13433
|
overflow: hasOverlap ? "visible" : "hidden"
|
|
13417
13434
|
},
|
|
13418
13435
|
children: [
|
|
13419
|
-
/* @__PURE__ */
|
|
13436
|
+
/* @__PURE__ */ jsx82(
|
|
13420
13437
|
"div",
|
|
13421
13438
|
{
|
|
13422
13439
|
style: {
|
|
@@ -13430,7 +13447,7 @@ var EdgeBlurBox = React53.memo(function EdgeBlurBox2({
|
|
|
13430
13447
|
transparent ${100 - (layer.zone * 100 + 10)}%,
|
|
13431
13448
|
black ${100 - layer.zone * 100}%,
|
|
13432
13449
|
black 100%)`;
|
|
13433
|
-
return /* @__PURE__ */
|
|
13450
|
+
return /* @__PURE__ */ jsx82(
|
|
13434
13451
|
"img",
|
|
13435
13452
|
{
|
|
13436
13453
|
src: imageSrc,
|
|
@@ -13458,7 +13475,7 @@ var EdgeBlurBox = React53.memo(function EdgeBlurBox2({
|
|
|
13458
13475
|
})
|
|
13459
13476
|
}
|
|
13460
13477
|
),
|
|
13461
|
-
/* @__PURE__ */
|
|
13478
|
+
/* @__PURE__ */ jsx82(
|
|
13462
13479
|
"img",
|
|
13463
13480
|
{
|
|
13464
13481
|
src: imageSrc,
|
|
@@ -13486,8 +13503,8 @@ var EdgeBlurBox = React53.memo(function EdgeBlurBox2({
|
|
|
13486
13503
|
});
|
|
13487
13504
|
|
|
13488
13505
|
// src/layouts/pdp/ImageBlurExtension.tsx
|
|
13489
|
-
import
|
|
13490
|
-
import { jsx as
|
|
13506
|
+
import React55 from "react";
|
|
13507
|
+
import { jsx as jsx83, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
13491
13508
|
var BLUR_CONFIG4 = {
|
|
13492
13509
|
blur: 24,
|
|
13493
13510
|
crossfadeWidth: 80
|
|
@@ -13510,7 +13527,7 @@ function getFadeOutMask2(crossfadeWidth) {
|
|
|
13510
13527
|
transparent 100%
|
|
13511
13528
|
)`;
|
|
13512
13529
|
}
|
|
13513
|
-
var ImageBlurExtension =
|
|
13530
|
+
var ImageBlurExtension = React55.memo(function ImageBlurExtension2({
|
|
13514
13531
|
imageSrc,
|
|
13515
13532
|
width,
|
|
13516
13533
|
height,
|
|
@@ -13533,7 +13550,7 @@ var ImageBlurExtension = React54.memo(function ImageBlurExtension2({
|
|
|
13533
13550
|
height: heightValue
|
|
13534
13551
|
},
|
|
13535
13552
|
children: [
|
|
13536
|
-
BLUR_LAYERS4.map((layer, index) => /* @__PURE__ */
|
|
13553
|
+
BLUR_LAYERS4.map((layer, index) => /* @__PURE__ */ jsx83(
|
|
13537
13554
|
"img",
|
|
13538
13555
|
{
|
|
13539
13556
|
src: imageSrc,
|
|
@@ -13557,7 +13574,7 @@ var ImageBlurExtension = React54.memo(function ImageBlurExtension2({
|
|
|
13557
13574
|
},
|
|
13558
13575
|
`blur-${index}`
|
|
13559
13576
|
)),
|
|
13560
|
-
/* @__PURE__ */
|
|
13577
|
+
/* @__PURE__ */ jsx83(
|
|
13561
13578
|
"img",
|
|
13562
13579
|
{
|
|
13563
13580
|
src: imageSrc,
|
|
@@ -13585,23 +13602,23 @@ var ImageBlurExtension = React54.memo(function ImageBlurExtension2({
|
|
|
13585
13602
|
});
|
|
13586
13603
|
|
|
13587
13604
|
// src/design-system/ColorSwatch.tsx
|
|
13588
|
-
import { jsx as
|
|
13605
|
+
import { jsx as jsx84, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
13589
13606
|
function ColorTokenSwatch({ name, cssVar, className = "" }) {
|
|
13590
13607
|
return /* @__PURE__ */ jsxs57("div", { className: `flex flex-col gap-1 ${className}`, children: [
|
|
13591
|
-
/* @__PURE__ */
|
|
13608
|
+
/* @__PURE__ */ jsx84(
|
|
13592
13609
|
"div",
|
|
13593
13610
|
{
|
|
13594
13611
|
className: "h-16 w-full rounded-lg border border-border shadow-sm",
|
|
13595
13612
|
style: { backgroundColor: `var(${cssVar})` }
|
|
13596
13613
|
}
|
|
13597
13614
|
),
|
|
13598
|
-
/* @__PURE__ */
|
|
13599
|
-
/* @__PURE__ */
|
|
13615
|
+
/* @__PURE__ */ jsx84("div", { className: "text-sm font-medium text-foreground", children: name }),
|
|
13616
|
+
/* @__PURE__ */ jsx84("code", { className: "text-xs text-muted-foreground font-mono", children: cssVar })
|
|
13600
13617
|
] });
|
|
13601
13618
|
}
|
|
13602
13619
|
function ColorRow({ name, cssVar, description }) {
|
|
13603
13620
|
return /* @__PURE__ */ jsxs57("div", { className: "flex items-center gap-4 py-2", children: [
|
|
13604
|
-
/* @__PURE__ */
|
|
13621
|
+
/* @__PURE__ */ jsx84(
|
|
13605
13622
|
"div",
|
|
13606
13623
|
{
|
|
13607
13624
|
className: "h-10 w-10 rounded-lg border border-border shadow-sm flex-shrink-0",
|
|
@@ -13609,15 +13626,15 @@ function ColorRow({ name, cssVar, description }) {
|
|
|
13609
13626
|
}
|
|
13610
13627
|
),
|
|
13611
13628
|
/* @__PURE__ */ jsxs57("div", { className: "flex-1 min-w-0", children: [
|
|
13612
|
-
/* @__PURE__ */
|
|
13613
|
-
description && /* @__PURE__ */
|
|
13629
|
+
/* @__PURE__ */ jsx84("div", { className: "text-sm font-medium text-foreground", children: name }),
|
|
13630
|
+
description && /* @__PURE__ */ jsx84("div", { className: "text-xs text-muted-foreground", children: description })
|
|
13614
13631
|
] }),
|
|
13615
|
-
/* @__PURE__ */
|
|
13632
|
+
/* @__PURE__ */ jsx84("code", { className: "text-xs text-muted-foreground font-mono bg-muted px-2 py-1 rounded", children: cssVar })
|
|
13616
13633
|
] });
|
|
13617
13634
|
}
|
|
13618
13635
|
|
|
13619
13636
|
// src/design-system/ColorPalette.tsx
|
|
13620
|
-
import { jsx as
|
|
13637
|
+
import { jsx as jsx85, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
13621
13638
|
var COLOR_GROUPS = [
|
|
13622
13639
|
{
|
|
13623
13640
|
name: "Base",
|
|
@@ -13698,17 +13715,17 @@ var COLOR_GROUPS = [
|
|
|
13698
13715
|
}
|
|
13699
13716
|
];
|
|
13700
13717
|
function ColorPalette({ layout = "list", className = "" }) {
|
|
13701
|
-
return /* @__PURE__ */
|
|
13702
|
-
/* @__PURE__ */
|
|
13703
|
-
/* @__PURE__ */
|
|
13704
|
-
layout === "grid" ? /* @__PURE__ */
|
|
13718
|
+
return /* @__PURE__ */ jsx85("div", { className: `space-y-8 ${className}`, children: COLOR_GROUPS.map((group) => /* @__PURE__ */ jsxs58("section", { children: [
|
|
13719
|
+
/* @__PURE__ */ jsx85("h3", { className: "text-lg font-semibold text-foreground mb-1", children: group.name }),
|
|
13720
|
+
/* @__PURE__ */ jsx85("p", { className: "text-sm text-muted-foreground mb-4", children: group.description }),
|
|
13721
|
+
layout === "grid" ? /* @__PURE__ */ jsx85("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-4", children: group.colors.map((color) => /* @__PURE__ */ jsx85(
|
|
13705
13722
|
ColorTokenSwatch,
|
|
13706
13723
|
{
|
|
13707
13724
|
name: color.name,
|
|
13708
13725
|
cssVar: color.cssVar
|
|
13709
13726
|
},
|
|
13710
13727
|
color.cssVar
|
|
13711
|
-
)) }) : /* @__PURE__ */
|
|
13728
|
+
)) }) : /* @__PURE__ */ jsx85("div", { className: "bg-card rounded-lg border border-border p-4 divide-y divide-border", children: group.colors.map((color) => /* @__PURE__ */ jsx85(
|
|
13712
13729
|
ColorRow,
|
|
13713
13730
|
{
|
|
13714
13731
|
name: color.name,
|
|
@@ -13721,7 +13738,7 @@ function ColorPalette({ layout = "list", className = "" }) {
|
|
|
13721
13738
|
}
|
|
13722
13739
|
|
|
13723
13740
|
// src/design-system/TypographyScale.tsx
|
|
13724
|
-
import { jsx as
|
|
13741
|
+
import { jsx as jsx86, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
13725
13742
|
var FONT_SAMPLES = [
|
|
13726
13743
|
{
|
|
13727
13744
|
name: "Heading",
|
|
@@ -13755,14 +13772,14 @@ var FONT_SAMPLES = [
|
|
|
13755
13772
|
}
|
|
13756
13773
|
];
|
|
13757
13774
|
function TypographyScale({ className = "" }) {
|
|
13758
|
-
return /* @__PURE__ */
|
|
13775
|
+
return /* @__PURE__ */ jsx86("div", { className: `space-y-8 ${className}`, children: FONT_SAMPLES.map((font) => /* @__PURE__ */ jsxs59("section", { className: "bg-card rounded-lg border border-border p-6", children: [
|
|
13759
13776
|
/* @__PURE__ */ jsxs59("div", { className: "flex items-center justify-between mb-4", children: [
|
|
13760
|
-
/* @__PURE__ */
|
|
13761
|
-
/* @__PURE__ */
|
|
13777
|
+
/* @__PURE__ */ jsx86("h3", { className: "text-lg font-semibold text-foreground", children: font.name }),
|
|
13778
|
+
/* @__PURE__ */ jsx86("code", { className: "text-xs text-muted-foreground font-mono bg-muted px-2 py-1 rounded", children: font.cssVar })
|
|
13762
13779
|
] }),
|
|
13763
|
-
/* @__PURE__ */
|
|
13764
|
-
/* @__PURE__ */
|
|
13765
|
-
/* @__PURE__ */
|
|
13780
|
+
/* @__PURE__ */ jsx86("div", { className: "space-y-4", children: font.sizes.map((size) => /* @__PURE__ */ jsxs59("div", { className: "flex items-baseline gap-4", children: [
|
|
13781
|
+
/* @__PURE__ */ jsx86("span", { className: "text-xs text-muted-foreground w-20 flex-shrink-0", children: size }),
|
|
13782
|
+
/* @__PURE__ */ jsx86(
|
|
13766
13783
|
"p",
|
|
13767
13784
|
{
|
|
13768
13785
|
className: `${size} text-foreground`,
|
|
@@ -13781,8 +13798,8 @@ var RADIUS_SAMPLES = [
|
|
|
13781
13798
|
{ name: "Full", value: "9999px" }
|
|
13782
13799
|
];
|
|
13783
13800
|
function RadiusScale({ className = "" }) {
|
|
13784
|
-
return /* @__PURE__ */
|
|
13785
|
-
/* @__PURE__ */
|
|
13801
|
+
return /* @__PURE__ */ jsx86("div", { className: `space-y-4 ${className}`, children: /* @__PURE__ */ jsx86("div", { className: "grid grid-cols-5 gap-4", children: RADIUS_SAMPLES.map((radius) => /* @__PURE__ */ jsxs59("div", { className: "flex flex-col items-center gap-2", children: [
|
|
13802
|
+
/* @__PURE__ */ jsx86(
|
|
13786
13803
|
"div",
|
|
13787
13804
|
{
|
|
13788
13805
|
className: "h-16 w-16 bg-primary",
|
|
@@ -13791,14 +13808,14 @@ function RadiusScale({ className = "" }) {
|
|
|
13791
13808
|
}
|
|
13792
13809
|
}
|
|
13793
13810
|
),
|
|
13794
|
-
/* @__PURE__ */
|
|
13795
|
-
/* @__PURE__ */
|
|
13811
|
+
/* @__PURE__ */ jsx86("span", { className: "text-sm font-medium text-foreground", children: radius.name }),
|
|
13812
|
+
/* @__PURE__ */ jsx86("code", { className: "text-xs text-muted-foreground font-mono", children: radius.cssVar || radius.value })
|
|
13796
13813
|
] }, radius.name)) }) });
|
|
13797
13814
|
}
|
|
13798
13815
|
|
|
13799
13816
|
// src/design-system/ThemeSwitcher.tsx
|
|
13800
13817
|
import { useState as useState45, useEffect as useEffect46 } from "react";
|
|
13801
|
-
import { Fragment as Fragment19, jsx as
|
|
13818
|
+
import { Fragment as Fragment19, jsx as jsx87, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
13802
13819
|
function readThemeFromDOM() {
|
|
13803
13820
|
if (typeof document === "undefined") {
|
|
13804
13821
|
return { themeName: "Linear", isDark: false };
|
|
@@ -13866,35 +13883,35 @@ function ThemeSwitcher({ className = "", showBaseThemesOnly = true }) {
|
|
|
13866
13883
|
onClick: () => setIsOpen(!isOpen),
|
|
13867
13884
|
className: "flex items-center gap-2 px-4 py-2 bg-card border border-border rounded-lg hover:bg-muted transition-colors text-foreground",
|
|
13868
13885
|
children: [
|
|
13869
|
-
/* @__PURE__ */
|
|
13870
|
-
/* @__PURE__ */
|
|
13871
|
-
/* @__PURE__ */
|
|
13886
|
+
/* @__PURE__ */ jsx87("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx87("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" }) }),
|
|
13887
|
+
/* @__PURE__ */ jsx87("span", { className: "font-medium", children: currentTheme }),
|
|
13888
|
+
/* @__PURE__ */ jsx87("svg", { className: `w-4 h-4 transition-transform ${isOpen ? "rotate-180" : ""}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx87("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) })
|
|
13872
13889
|
]
|
|
13873
13890
|
}
|
|
13874
13891
|
),
|
|
13875
13892
|
isOpen && /* @__PURE__ */ jsxs60(Fragment19, { children: [
|
|
13876
|
-
/* @__PURE__ */
|
|
13893
|
+
/* @__PURE__ */ jsx87(
|
|
13877
13894
|
"div",
|
|
13878
13895
|
{
|
|
13879
13896
|
className: "fixed inset-0 z-40",
|
|
13880
13897
|
onClick: () => setIsOpen(false)
|
|
13881
13898
|
}
|
|
13882
13899
|
),
|
|
13883
|
-
/* @__PURE__ */
|
|
13900
|
+
/* @__PURE__ */ jsx87("div", { className: "absolute top-full left-0 mt-2 w-56 max-h-80 overflow-auto bg-card border border-border rounded-lg shadow-lg z-50", children: themes.map((theme) => /* @__PURE__ */ jsxs60(
|
|
13884
13901
|
"button",
|
|
13885
13902
|
{
|
|
13886
13903
|
onClick: () => handleThemeSelect(theme.name),
|
|
13887
13904
|
className: `w-full px-4 py-2 text-left hover:bg-muted transition-colors flex items-center gap-3 ${currentTheme === theme.name ? "bg-muted" : ""}`,
|
|
13888
13905
|
children: [
|
|
13889
|
-
/* @__PURE__ */
|
|
13906
|
+
/* @__PURE__ */ jsx87(
|
|
13890
13907
|
"div",
|
|
13891
13908
|
{
|
|
13892
13909
|
className: "w-4 h-4 rounded-full border border-border",
|
|
13893
13910
|
style: { backgroundColor: theme.primaryColor || "#888" }
|
|
13894
13911
|
}
|
|
13895
13912
|
),
|
|
13896
|
-
/* @__PURE__ */
|
|
13897
|
-
currentTheme === theme.name && /* @__PURE__ */
|
|
13913
|
+
/* @__PURE__ */ jsx87("span", { className: "text-foreground", children: theme.name }),
|
|
13914
|
+
currentTheme === theme.name && /* @__PURE__ */ jsx87("svg", { className: "w-4 h-4 ml-auto text-primary", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx87("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) })
|
|
13898
13915
|
]
|
|
13899
13916
|
},
|
|
13900
13917
|
theme.name
|
|
@@ -13909,10 +13926,10 @@ function ThemeSwitcher({ className = "", showBaseThemesOnly = true }) {
|
|
|
13909
13926
|
title: `Switch to ${isDark ? "light" : "dark"} mode`,
|
|
13910
13927
|
children: [
|
|
13911
13928
|
isDark ? /* @__PURE__ */ jsxs60("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [
|
|
13912
|
-
/* @__PURE__ */
|
|
13913
|
-
/* @__PURE__ */
|
|
13914
|
-
] }) : /* @__PURE__ */
|
|
13915
|
-
/* @__PURE__ */
|
|
13929
|
+
/* @__PURE__ */ jsx87("circle", { cx: "12", cy: "12", r: "5" }),
|
|
13930
|
+
/* @__PURE__ */ jsx87("path", { d: "M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" })
|
|
13931
|
+
] }) : /* @__PURE__ */ jsx87("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /* @__PURE__ */ jsx87("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }),
|
|
13932
|
+
/* @__PURE__ */ jsx87("span", { className: "text-sm", children: isDark ? "Light" : "Dark" })
|
|
13916
13933
|
]
|
|
13917
13934
|
}
|
|
13918
13935
|
)
|
|
@@ -13920,7 +13937,7 @@ function ThemeSwitcher({ className = "", showBaseThemesOnly = true }) {
|
|
|
13920
13937
|
}
|
|
13921
13938
|
|
|
13922
13939
|
// src/design-system/DesignSystemPage.tsx
|
|
13923
|
-
import { jsx as
|
|
13940
|
+
import { jsx as jsx88, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
13924
13941
|
function DesignSystemPage({
|
|
13925
13942
|
showThemeSwitcher = true,
|
|
13926
13943
|
showColors = true,
|
|
@@ -13931,28 +13948,28 @@ function DesignSystemPage({
|
|
|
13931
13948
|
className = ""
|
|
13932
13949
|
}) {
|
|
13933
13950
|
return /* @__PURE__ */ jsxs61("div", { className: `max-w-4xl mx-auto px-4 py-8 ${className}`, children: [
|
|
13934
|
-
/* @__PURE__ */
|
|
13951
|
+
/* @__PURE__ */ jsx88("header", { className: "mb-12", children: /* @__PURE__ */ jsxs61("div", { className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-4", children: [
|
|
13935
13952
|
/* @__PURE__ */ jsxs61("div", { children: [
|
|
13936
|
-
/* @__PURE__ */
|
|
13937
|
-
/* @__PURE__ */
|
|
13953
|
+
/* @__PURE__ */ jsx88("h1", { className: "text-4xl font-bold text-foreground mb-2", children: "Design System" }),
|
|
13954
|
+
/* @__PURE__ */ jsx88("p", { className: "text-lg text-muted-foreground", children: "Visual reference for theme tokens and styles" })
|
|
13938
13955
|
] }),
|
|
13939
|
-
showThemeSwitcher && /* @__PURE__ */
|
|
13956
|
+
showThemeSwitcher && /* @__PURE__ */ jsx88(ThemeSwitcher, {})
|
|
13940
13957
|
] }) }),
|
|
13941
13958
|
showColors && /* @__PURE__ */ jsxs61("section", { className: "mb-16", children: [
|
|
13942
|
-
/* @__PURE__ */
|
|
13943
|
-
/* @__PURE__ */
|
|
13959
|
+
/* @__PURE__ */ jsx88("h2", { className: "text-2xl font-semibold text-foreground mb-6 pb-2 border-b border-border", children: "Color Palette" }),
|
|
13960
|
+
/* @__PURE__ */ jsx88(ColorPalette, { layout: colorLayout })
|
|
13944
13961
|
] }),
|
|
13945
13962
|
showTypography && /* @__PURE__ */ jsxs61("section", { className: "mb-16", children: [
|
|
13946
|
-
/* @__PURE__ */
|
|
13947
|
-
/* @__PURE__ */
|
|
13963
|
+
/* @__PURE__ */ jsx88("h2", { className: "text-2xl font-semibold text-foreground mb-6 pb-2 border-b border-border", children: "Typography" }),
|
|
13964
|
+
/* @__PURE__ */ jsx88(TypographyScale, {})
|
|
13948
13965
|
] }),
|
|
13949
13966
|
showRadius && /* @__PURE__ */ jsxs61("section", { className: "mb-16", children: [
|
|
13950
|
-
/* @__PURE__ */
|
|
13951
|
-
/* @__PURE__ */
|
|
13967
|
+
/* @__PURE__ */ jsx88("h2", { className: "text-2xl font-semibold text-foreground mb-6 pb-2 border-b border-border", children: "Border Radius" }),
|
|
13968
|
+
/* @__PURE__ */ jsx88(RadiusScale, {})
|
|
13952
13969
|
] }),
|
|
13953
13970
|
showSpacing && /* @__PURE__ */ jsxs61("section", { className: "mb-16", children: [
|
|
13954
|
-
/* @__PURE__ */
|
|
13955
|
-
/* @__PURE__ */
|
|
13971
|
+
/* @__PURE__ */ jsx88("h2", { className: "text-2xl font-semibold text-foreground mb-6 pb-2 border-b border-border", children: "Spacing Scale" }),
|
|
13972
|
+
/* @__PURE__ */ jsx88(SpacingScale, {})
|
|
13956
13973
|
] })
|
|
13957
13974
|
] });
|
|
13958
13975
|
}
|
|
@@ -13967,21 +13984,21 @@ function SpacingScale() {
|
|
|
13967
13984
|
{ name: "12", value: "3rem" },
|
|
13968
13985
|
{ name: "16", value: "4rem" }
|
|
13969
13986
|
];
|
|
13970
|
-
return /* @__PURE__ */
|
|
13971
|
-
/* @__PURE__ */
|
|
13972
|
-
/* @__PURE__ */
|
|
13987
|
+
return /* @__PURE__ */ jsx88("div", { className: "space-y-2", children: spaces.map((space) => /* @__PURE__ */ jsxs61("div", { className: "flex items-center gap-4", children: [
|
|
13988
|
+
/* @__PURE__ */ jsx88("code", { className: "text-xs text-muted-foreground font-mono w-8", children: space.name }),
|
|
13989
|
+
/* @__PURE__ */ jsx88(
|
|
13973
13990
|
"div",
|
|
13974
13991
|
{
|
|
13975
13992
|
className: "h-4 bg-primary rounded",
|
|
13976
13993
|
style: { width: space.value }
|
|
13977
13994
|
}
|
|
13978
13995
|
),
|
|
13979
|
-
/* @__PURE__ */
|
|
13996
|
+
/* @__PURE__ */ jsx88("span", { className: "text-sm text-muted-foreground", children: space.value })
|
|
13980
13997
|
] }, space.name)) });
|
|
13981
13998
|
}
|
|
13982
13999
|
|
|
13983
14000
|
// src/personalization/PersonalizationProvider.tsx
|
|
13984
|
-
import
|
|
14001
|
+
import React56, {
|
|
13985
14002
|
useState as useState46,
|
|
13986
14003
|
useCallback as useCallback26,
|
|
13987
14004
|
useRef as useRef30,
|
|
@@ -13989,25 +14006,25 @@ import React55, {
|
|
|
13989
14006
|
} from "react";
|
|
13990
14007
|
|
|
13991
14008
|
// src/personalization/PersonalizationContext.ts
|
|
13992
|
-
import { createContext as
|
|
13993
|
-
var PersonalizationContext =
|
|
14009
|
+
import { createContext as createContext10, useContext as useContext8 } from "react";
|
|
14010
|
+
var PersonalizationContext = createContext10(null);
|
|
13994
14011
|
function usePersonalizationContext() {
|
|
13995
|
-
return
|
|
14012
|
+
return useContext8(PersonalizationContext);
|
|
13996
14013
|
}
|
|
13997
14014
|
|
|
13998
14015
|
// src/personalization/PersonalizationProvider.tsx
|
|
13999
|
-
import { Fragment as Fragment20, jsx as
|
|
14016
|
+
import { Fragment as Fragment20, jsx as jsx89, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
14000
14017
|
function createBridgeFromCanvas(canvasModule) {
|
|
14001
14018
|
const { useEditor, useCommands, useImageBinding } = canvasModule;
|
|
14002
14019
|
function TextBinder({ name, value }) {
|
|
14003
14020
|
const { elements } = useEditor();
|
|
14004
14021
|
const { executeElementUpdate } = useCommands();
|
|
14005
|
-
const elementsRef =
|
|
14022
|
+
const elementsRef = React56.useRef(elements);
|
|
14006
14023
|
elementsRef.current = elements;
|
|
14007
|
-
const executeRef =
|
|
14024
|
+
const executeRef = React56.useRef(executeElementUpdate);
|
|
14008
14025
|
executeRef.current = executeElementUpdate;
|
|
14009
|
-
const hasUserInput =
|
|
14010
|
-
|
|
14026
|
+
const hasUserInput = React56.useRef(false);
|
|
14027
|
+
React56.useEffect(() => {
|
|
14011
14028
|
if (value == null) return;
|
|
14012
14029
|
if (value === "" && !hasUserInput.current) return;
|
|
14013
14030
|
hasUserInput.current = true;
|
|
@@ -14025,12 +14042,12 @@ function createBridgeFromCanvas(canvasModule) {
|
|
|
14025
14042
|
function ColorBinder({ originalColor, newColor }) {
|
|
14026
14043
|
const { elements } = useEditor();
|
|
14027
14044
|
const { executeElementUpdate } = useCommands();
|
|
14028
|
-
const elementsRef =
|
|
14045
|
+
const elementsRef = React56.useRef(elements);
|
|
14029
14046
|
elementsRef.current = elements;
|
|
14030
|
-
const executeRef =
|
|
14047
|
+
const executeRef = React56.useRef(executeElementUpdate);
|
|
14031
14048
|
executeRef.current = executeElementUpdate;
|
|
14032
|
-
const appliedColorRef =
|
|
14033
|
-
|
|
14049
|
+
const appliedColorRef = React56.useRef(normalizeHex(originalColor));
|
|
14050
|
+
React56.useEffect(() => {
|
|
14034
14051
|
const normalizedNew = normalizeHex(newColor);
|
|
14035
14052
|
if (normalizedNew === appliedColorRef.current) return;
|
|
14036
14053
|
const matchColor = appliedColorRef.current;
|
|
@@ -14070,11 +14087,11 @@ function createBridgeFromCanvas(canvasModule) {
|
|
|
14070
14087
|
}
|
|
14071
14088
|
function ImageBinder({ name, value, fit = "cover" }) {
|
|
14072
14089
|
const { setImageUrl } = useImageBinding(name, { fit });
|
|
14073
|
-
const hasUserInput =
|
|
14090
|
+
const hasUserInput = React56.useRef(false);
|
|
14074
14091
|
const debouncedValue = useDebouncedValue(value, 500);
|
|
14075
|
-
const setImageUrlRef =
|
|
14092
|
+
const setImageUrlRef = React56.useRef(setImageUrl);
|
|
14076
14093
|
setImageUrlRef.current = setImageUrl;
|
|
14077
|
-
|
|
14094
|
+
React56.useEffect(() => {
|
|
14078
14095
|
if (debouncedValue == null) return;
|
|
14079
14096
|
if (debouncedValue === "" && !hasUserInput.current) return;
|
|
14080
14097
|
hasUserInput.current = true;
|
|
@@ -14084,15 +14101,15 @@ function createBridgeFromCanvas(canvasModule) {
|
|
|
14084
14101
|
return null;
|
|
14085
14102
|
}
|
|
14086
14103
|
return function PersonalizationBridge({ fields = [], values = {} } = {}) {
|
|
14087
|
-
return /* @__PURE__ */
|
|
14104
|
+
return /* @__PURE__ */ jsx89(Fragment20, { children: fields.map((field) => {
|
|
14088
14105
|
if (field.type === "text") {
|
|
14089
|
-
return /* @__PURE__ */
|
|
14106
|
+
return /* @__PURE__ */ jsx89(TextBinder, { name: field.name, value: values[field.name] ?? "" }, `text-${field.name}`);
|
|
14090
14107
|
}
|
|
14091
14108
|
if (field.type === "color") {
|
|
14092
|
-
return /* @__PURE__ */
|
|
14109
|
+
return /* @__PURE__ */ jsx89(ColorBinder, { originalColor: field.color, newColor: values[field.color] ?? field.color }, `color-${field.color}`);
|
|
14093
14110
|
}
|
|
14094
14111
|
if (field.type === "image") {
|
|
14095
|
-
return /* @__PURE__ */
|
|
14112
|
+
return /* @__PURE__ */ jsx89(ImageBinder, { name: field.name, value: values[field.name] ?? "", fit: field.fit ?? "cover" }, `image-${field.name}`);
|
|
14096
14113
|
}
|
|
14097
14114
|
return null;
|
|
14098
14115
|
}) });
|
|
@@ -14202,7 +14219,7 @@ function PersonalizationProvider({
|
|
|
14202
14219
|
setIsExporting(true);
|
|
14203
14220
|
}, []);
|
|
14204
14221
|
const shouldMountCanvas = CanvasComponent && BridgeComponent && canvasState?.elements && canvasState.elements.length > 0 && (!lazy || isActive);
|
|
14205
|
-
const contextValue =
|
|
14222
|
+
const contextValue = React56.useMemo(
|
|
14206
14223
|
() => ({
|
|
14207
14224
|
fields,
|
|
14208
14225
|
personValues,
|
|
@@ -14216,7 +14233,7 @@ function PersonalizationProvider({
|
|
|
14216
14233
|
[fields, personValues, updateField, isActive, isExporting, exportedBlobUrls, exportCount, reset]
|
|
14217
14234
|
);
|
|
14218
14235
|
return /* @__PURE__ */ jsxs62(PersonalizationContext.Provider, { value: contextValue, children: [
|
|
14219
|
-
shouldMountCanvas && CanvasComponent && BridgeComponent && /* @__PURE__ */
|
|
14236
|
+
shouldMountCanvas && CanvasComponent && BridgeComponent && /* @__PURE__ */ jsx89(
|
|
14220
14237
|
"div",
|
|
14221
14238
|
{
|
|
14222
14239
|
style: {
|
|
@@ -14229,7 +14246,7 @@ function PersonalizationProvider({
|
|
|
14229
14246
|
pointerEvents: "none"
|
|
14230
14247
|
},
|
|
14231
14248
|
"aria-hidden": true,
|
|
14232
|
-
children: /* @__PURE__ */
|
|
14249
|
+
children: /* @__PURE__ */ jsx89(
|
|
14233
14250
|
CanvasComponent,
|
|
14234
14251
|
{
|
|
14235
14252
|
initialElements: canvasState?.elements,
|
|
@@ -14249,7 +14266,7 @@ function PersonalizationProvider({
|
|
|
14249
14266
|
exportImageQuality: exportConfig?.imageQuality ?? 0.85,
|
|
14250
14267
|
onExport: handleExport,
|
|
14251
14268
|
onExportScheduled: handleExportScheduled,
|
|
14252
|
-
overlay: /* @__PURE__ */
|
|
14269
|
+
overlay: /* @__PURE__ */ jsx89(BridgeComponent, { fields, values: personValues })
|
|
14253
14270
|
}
|
|
14254
14271
|
)
|
|
14255
14272
|
},
|
|
@@ -14274,7 +14291,7 @@ function usePersonalizationOptional() {
|
|
|
14274
14291
|
}
|
|
14275
14292
|
|
|
14276
14293
|
// src/personalization/PersonalizationInputs.tsx
|
|
14277
|
-
import { jsx as
|
|
14294
|
+
import { jsx as jsx90, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
14278
14295
|
function PersonalizationInputs({
|
|
14279
14296
|
className,
|
|
14280
14297
|
inputClassName = "w-full px-4 py-3 rounded-lg border text-base text-foreground placeholder:text-muted-foreground bg-white/50 outline-none focus:ring-2 focus:ring-foreground/20",
|
|
@@ -14299,7 +14316,7 @@ function PersonalizationInputs({
|
|
|
14299
14316
|
}
|
|
14300
14317
|
};
|
|
14301
14318
|
return /* @__PURE__ */ jsxs63("div", { className: className || "flex flex-col gap-3", children: [
|
|
14302
|
-
textFields.map((field) => /* @__PURE__ */
|
|
14319
|
+
textFields.map((field) => /* @__PURE__ */ jsx90(
|
|
14303
14320
|
"input",
|
|
14304
14321
|
{
|
|
14305
14322
|
type: "text",
|
|
@@ -14314,7 +14331,7 @@ function PersonalizationInputs({
|
|
|
14314
14331
|
`text-${field.name}`
|
|
14315
14332
|
)),
|
|
14316
14333
|
colorFields.map((field) => /* @__PURE__ */ jsxs63("div", { className: "flex items-center gap-3", children: [
|
|
14317
|
-
/* @__PURE__ */
|
|
14334
|
+
/* @__PURE__ */ jsx90(
|
|
14318
14335
|
"input",
|
|
14319
14336
|
{
|
|
14320
14337
|
type: "color",
|
|
@@ -14323,9 +14340,9 @@ function PersonalizationInputs({
|
|
|
14323
14340
|
onChange: (e) => updateField(field.color, e.target.value)
|
|
14324
14341
|
}
|
|
14325
14342
|
),
|
|
14326
|
-
/* @__PURE__ */
|
|
14343
|
+
/* @__PURE__ */ jsx90("span", { className: "text-base text-muted-foreground", children: field.label })
|
|
14327
14344
|
] }, `color-${field.color}`)),
|
|
14328
|
-
imageFields.map((field) => /* @__PURE__ */
|
|
14345
|
+
imageFields.map((field) => /* @__PURE__ */ jsx90(
|
|
14329
14346
|
"input",
|
|
14330
14347
|
{
|
|
14331
14348
|
type: "text",
|
|
@@ -14533,6 +14550,7 @@ export {
|
|
|
14533
14550
|
LoadingOverlayPrismCandyInline,
|
|
14534
14551
|
MasonryGrid,
|
|
14535
14552
|
MobileProductCarousel,
|
|
14553
|
+
MockupBackground,
|
|
14536
14554
|
MockupPriorityProvider,
|
|
14537
14555
|
PDPLayout,
|
|
14538
14556
|
PersonalizationInputs,
|
|
@@ -14658,6 +14676,7 @@ export {
|
|
|
14658
14676
|
useIsolatedCanvas,
|
|
14659
14677
|
useLoadingOverlay,
|
|
14660
14678
|
useMediaQuery,
|
|
14679
|
+
useMockupBackgroundOptional,
|
|
14661
14680
|
useMockupPriority,
|
|
14662
14681
|
useMockupPriorityOptional,
|
|
14663
14682
|
usePersonalization,
|