@enadhq/enad-react-sdk 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/storefront/blocks/card-video.mjs +1 -1
- package/dist/client/storefront/blocks/card-video.mjs.map +1 -1
- package/dist/client/storefront/blocks/gallery-with-link-blocks.d.ts.map +1 -1
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs +13 -5
- package/dist/client/storefront/blocks/gallery-with-link-blocks.mjs.map +1 -1
- package/dist/client/storefront/blocks/gallery.d.ts +10 -1
- package/dist/client/storefront/blocks/gallery.d.ts.map +1 -1
- package/dist/client/storefront/blocks/gallery.mjs +51 -27
- package/dist/client/storefront/blocks/gallery.mjs.map +1 -1
- package/dist/client/storefront/blocks/hero.d.ts +12 -1
- package/dist/client/storefront/blocks/hero.d.ts.map +1 -1
- package/dist/client/storefront/blocks/hero.mjs +143 -145
- package/dist/client/storefront/blocks/hero.mjs.map +1 -1
- package/dist/client/storefront/blocks/link-block-small.d.ts.map +1 -1
- package/dist/client/storefront/blocks/link-block-small.mjs +1 -1
- package/dist/client/storefront/blocks/link-block-small.mjs.map +1 -1
- package/dist/client/storefront/blocks/link-block.d.ts.map +1 -1
- package/dist/client/storefront/blocks/link-block.mjs +4 -4
- package/dist/client/storefront/blocks/link-block.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-card-parts.d.ts +1 -1
- package/dist/client/storefront/blocks/product-card-parts.d.ts.map +1 -1
- package/dist/client/storefront/blocks/product-card-parts.mjs +2 -2
- package/dist/client/storefront/blocks/product-card-parts.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-card.d.ts +10 -1
- package/dist/client/storefront/blocks/product-card.d.ts.map +1 -1
- package/dist/client/storefront/blocks/product-card.mjs +122 -116
- package/dist/client/storefront/blocks/product-card.mjs.map +1 -1
- package/dist/client/storefront/blocks/product-image.mjs +2 -2
- package/dist/client/storefront/blocks/product-image.mjs.map +1 -1
- package/dist/client/storefront/blocks/text-content-with-image.d.ts +14 -1
- package/dist/client/storefront/blocks/text-content-with-image.d.ts.map +1 -1
- package/dist/client/storefront/blocks/text-content-with-image.mjs +141 -164
- package/dist/client/storefront/blocks/text-content-with-image.mjs.map +1 -1
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts +5 -1
- package/dist/client/storefront/carousel/swipeable-carousel.d.ts.map +1 -1
- package/dist/client/storefront/carousel/swipeable-carousel.mjs +2 -1
- package/dist/client/storefront/carousel/swipeable-carousel.mjs.map +1 -1
- package/dist/client/storefront/components/product-recommendations.d.ts.map +1 -1
- package/dist/client/storefront/components/product-recommendations.mjs +29 -37
- package/dist/client/storefront/components/product-recommendations.mjs.map +1 -1
- package/dist/client/storefront/filters/filter-chip.d.ts +5 -2
- package/dist/client/storefront/filters/filter-chip.d.ts.map +1 -1
- package/dist/client/storefront/filters/filter-chip.mjs +5 -3
- package/dist/client/storefront/filters/filter-chip.mjs.map +1 -1
- package/dist/client/storefront/filters/filter-panel.mjs +1 -1
- package/dist/client/storefront/index.d.ts +12 -1
- package/dist/client/storefront/index.mjs +12 -1
- package/dist/client/storefront/layout/header.d.ts.map +1 -1
- package/dist/client/storefront/layout/header.mjs +1 -1
- package/dist/client/storefront/layout/header.mjs.map +1 -1
- package/dist/client/storefront/layout/mobile-menu-drawer.mjs +1 -1
- package/dist/client/storefront/primitives/block-heading.d.ts +40 -0
- package/dist/client/storefront/primitives/block-heading.d.ts.map +1 -0
- package/dist/client/storefront/primitives/block-heading.mjs +43 -0
- package/dist/client/storefront/primitives/block-heading.mjs.map +1 -0
- package/dist/client/storefront/primitives/cta-group.d.ts +25 -0
- package/dist/client/storefront/primitives/cta-group.d.ts.map +1 -0
- package/dist/client/storefront/primitives/cta-group.mjs +27 -0
- package/dist/client/storefront/primitives/cta-group.mjs.map +1 -0
- package/dist/client/storefront/primitives/image-with-hover.d.ts +18 -0
- package/dist/client/storefront/primitives/image-with-hover.d.ts.map +1 -0
- package/dist/client/storefront/primitives/image-with-hover.mjs +16 -0
- package/dist/client/storefront/primitives/image-with-hover.mjs.map +1 -0
- package/dist/client/storefront/primitives/index.d.ts +4 -1
- package/dist/client/storefront/primitives/index.mjs +4 -1
- package/dist/client/theme/apply.d.ts +1 -1
- package/dist/client/theme/apply.d.ts.map +1 -1
- package/dist/client/theme/apply.mjs +0 -12
- package/dist/client/theme/apply.mjs.map +1 -1
- package/dist/client/theme/cli.mjs +0 -16
- package/dist/client/theme/cli.mjs.map +1 -1
- package/dist/client/theme/codec.d.ts.map +1 -1
- package/dist/client/theme/codec.mjs +0 -2
- package/dist/client/theme/codec.mjs.map +1 -1
- package/dist/client/theme/defaults.d.ts +0 -2
- package/dist/client/theme/defaults.mjs +0 -2
- package/dist/client/theme/defaults.mjs.map +1 -1
- package/dist/client/ui/carousel.d.ts +9 -1
- package/dist/client/ui/carousel.d.ts.map +1 -1
- package/dist/client/ui/carousel.mjs +18 -2
- package/dist/client/ui/carousel.mjs.map +1 -1
- package/dist/client/ui-resolver/index.d.ts +2 -2
- package/dist/client/ui-resolver/index.mjs +2 -2
- package/dist/styles.css +1 -1
- package/package.json +3 -2
|
@@ -21,7 +21,7 @@ function CardVideo({ thumbnail, videoUrl, title, caption, aspectRatio = "16:9",
|
|
|
21
21
|
}) : /* @__PURE__ */ jsx("div", { className: "size-full bg-muted" }), /* @__PURE__ */ jsx("div", {
|
|
22
22
|
className: "absolute inset-0 flex items-center justify-center bg-black/20 transition-colors group-hover:bg-black/30",
|
|
23
23
|
children: /* @__PURE__ */ jsx("div", {
|
|
24
|
-
className: "flex size-14 items-center justify-center rounded-full bg-white/90 text-foreground
|
|
24
|
+
className: "flex size-14 items-center justify-center rounded-full bg-white/90 text-foreground",
|
|
25
25
|
children: /* @__PURE__ */ jsx(PlayIcon, { className: "ml-0.5 size-6 fill-current" })
|
|
26
26
|
})
|
|
27
27
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-video.mjs","names":[],"sources":["../../../../src/client/storefront/blocks/card-video.tsx"],"sourcesContent":["import * as React from \"react\"
|
|
1
|
+
{"version":3,"file":"card-video.mjs","names":[],"sources":["../../../../src/client/storefront/blocks/card-video.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { useIcon } from \"../../icons/icon-context\";\nimport { cn } from \"../../ui/utils\";\nimport type { CardVideoProps } from \"../types\";\n\nconst aspectClasses: Record<string, string> = {\n \"4:3\": \"aspect-[4/3]\",\n \"1:1\": \"aspect-square\",\n \"16:9\": \"aspect-video\",\n};\n\nfunction CardVideo({\n thumbnail,\n videoUrl,\n title,\n caption,\n aspectRatio = \"16:9\",\n className,\n}: CardVideoProps) {\n const PlayIcon = useIcon(\"play\");\n const card = (\n <div className={cn(\"group overflow-hidden\", className)}>\n <div className={cn(\"relative bg-muted\", aspectClasses[aspectRatio])}>\n {thumbnail?.src ? (\n <img\n src={thumbnail.src}\n alt={thumbnail.alt ?? title ?? \"\"}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"size-full bg-muted\" />\n )}\n\n {/* Play button overlay */}\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/20 transition-colors group-hover:bg-black/30\">\n <div className=\"flex size-14 items-center justify-center rounded-full bg-white/90 text-foreground\">\n <PlayIcon className=\"ml-0.5 size-6 fill-current\" />\n </div>\n </div>\n </div>\n\n {(title || caption) && (\n <div className=\"mt-3\">\n {title && <p className=\"text-sm font-medium text-foreground\">{title}</p>}\n {caption && <p className=\"mt-1 text-sm text-muted-foreground\">{caption}</p>}\n </div>\n )}\n </div>\n );\n\n if (videoUrl) {\n return (\n <a href={videoUrl} target=\"_blank\" rel=\"noopener noreferrer\" className=\"block\">\n {card}\n </a>\n );\n }\n\n return card;\n}\n\nexport { CardVideo, type CardVideoProps };\n"],"mappings":";;;;;AAKA,MAAM,gBAAwC;CAC5C,OAAO;CACP,OAAO;CACP,QAAQ;CACT;AAED,SAAS,UAAU,EACjB,WACA,UACA,OACA,SACA,cAAc,QACd,aACiB;CACjB,MAAM,WAAW,QAAQ,OAAO;CAChC,MAAM,OACJ,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAyB,UAAU;YAAtD,CACE,qBAAC,OAAD;GAAK,WAAW,GAAG,qBAAqB,cAAc,aAAa;aAAnE,CACG,WAAW,MACV,oBAAC,OAAD;IACE,KAAK,UAAU;IACf,KAAK,UAAU,OAAO,SAAS;IAC/B,WAAU;IACV,CAAA,GAEF,oBAAC,OAAD,EAAK,WAAU,sBAAuB,CAAA,EAIxC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,OAAD;KAAK,WAAU;eACb,oBAAC,UAAD,EAAU,WAAU,8BAA+B,CAAA;KAC/C,CAAA;IACF,CAAA,CACF;OAEJ,SAAS,YACT,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,SAAS,oBAAC,KAAD;IAAG,WAAU;cAAuC;IAAU,CAAA,EACvE,WAAW,oBAAC,KAAD;IAAG,WAAU;cAAsC;IAAY,CAAA,CACvE;KAEJ;;AAGR,KAAI,SACF,QACE,oBAAC,KAAD;EAAG,MAAM;EAAU,QAAO;EAAS,KAAI;EAAsB,WAAU;YACpE;EACC,CAAA;AAIR,QAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery-with-link-blocks.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/gallery-with-link-blocks.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"gallery-with-link-blocks.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/gallery-with-link-blocks.tsx"],"mappings":";;;;iBAKS,qBAAA,CAAA;EAAwB,OAAA;EAAS,QAAA;EAAU;AAAA,GAAa,0BAAA,GAA0B,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../ui/utils.mjs";
|
|
2
|
+
import { Carousel, CarouselContent, CarouselItem } from "../../ui-resolver/carousel.mjs";
|
|
2
3
|
import * as React$1 from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/client/storefront/blocks/gallery-with-link-blocks.tsx
|
|
@@ -17,11 +18,18 @@ function GalleryWithLinkBlocks({ heading, children, className }) {
|
|
|
17
18
|
children: heading
|
|
18
19
|
})
|
|
19
20
|
}), /* @__PURE__ */ jsx("div", {
|
|
20
|
-
className: "
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
className: "px-4 md:px-8",
|
|
22
|
+
children: /* @__PURE__ */ jsx(Carousel, {
|
|
23
|
+
opts: {
|
|
24
|
+
align: "start",
|
|
25
|
+
slidesToScroll: "auto",
|
|
26
|
+
containScroll: "trimSnaps"
|
|
27
|
+
},
|
|
28
|
+
children: /* @__PURE__ */ jsx(CarouselContent, { children: React$1.Children.map(children, (child, i) => /* @__PURE__ */ jsx(CarouselItem, {
|
|
29
|
+
className: "basis-auto w-52 sm:w-60 md:w-72 lg:w-80",
|
|
30
|
+
children: child
|
|
31
|
+
}, i)) })
|
|
32
|
+
})
|
|
25
33
|
})]
|
|
26
34
|
});
|
|
27
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery-with-link-blocks.mjs","names":["React"],"sources":["../../../../src/client/storefront/blocks/gallery-with-link-blocks.tsx"],"sourcesContent":["import * as React from \"react\"
|
|
1
|
+
{"version":3,"file":"gallery-with-link-blocks.mjs","names":["React"],"sources":["../../../../src/client/storefront/blocks/gallery-with-link-blocks.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\nimport { Carousel, CarouselContent, CarouselItem } from \"../../ui-resolver/carousel\";\nimport type { GalleryWithLinkBlocksProps } from \"../types\";\n\nfunction GalleryWithLinkBlocks({ heading, children, className }: GalleryWithLinkBlocksProps) {\n return (\n <section className={cn(\"py-12\", className)}>\n <div className=\"mx-auto max-w-7xl px-4 md:px-8\">\n {heading && (\n <h2\n className=\"mb-6 text-2xl font-heading text-foreground md:text-3xl\"\n style={\n {\n fontWeight: \"var(--enad-heading-weight)\",\n letterSpacing: \"var(--enad-heading-tracking)\",\n textTransform: \"var(--enad-heading-transform)\",\n } as unknown as React.CSSProperties\n }\n >\n {heading}\n </h2>\n )}\n </div>\n <div className=\"px-4 md:px-8\">\n <Carousel opts={{ align: \"start\", slidesToScroll: \"auto\", containScroll: \"trimSnaps\" }}>\n <CarouselContent>\n {React.Children.map(children, (child, i) => (\n <CarouselItem key={i} className=\"basis-auto w-52 sm:w-60 md:w-72 lg:w-80\">\n {child}\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </div>\n </section>\n );\n}\n\nexport { GalleryWithLinkBlocks, type GalleryWithLinkBlocksProps };\n"],"mappings":";;;;;AAKA,SAAS,sBAAsB,EAAE,SAAS,UAAU,aAAyC;AAC3F,QACE,qBAAC,WAAD;EAAS,WAAW,GAAG,SAAS,UAAU;YAA1C,CACE,oBAAC,OAAD;GAAK,WAAU;aACZ,WACC,oBAAC,MAAD;IACE,WAAU;IACV,OACE;KACE,YAAY;KACZ,eAAe;KACf,eAAe;KAChB;cAGF;IACE,CAAA;GAEH,CAAA,EACN,oBAAC,OAAD;GAAK,WAAU;aACb,oBAAC,UAAD;IAAU,MAAM;KAAE,OAAO;KAAS,gBAAgB;KAAQ,eAAe;KAAa;cACpF,oBAAC,iBAAD,EAAA,UACGA,QAAM,SAAS,IAAI,WAAW,OAAO,MACpC,oBAAC,cAAD;KAAsB,WAAU;eAC7B;KACY,EAFI,EAEJ,CACf,EACc,CAAA;IACT,CAAA;GACP,CAAA,CACE"}
|
|
@@ -2,6 +2,15 @@ import { GalleryProps } from "../types.js";
|
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/storefront/blocks/gallery.d.ts
|
|
5
|
+
declare const galleryRecipe: (props?: ({
|
|
6
|
+
layout?: "grid" | "masonry" | "filmstrip" | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
className?: Partial<Record<"grid" | "root" | "heading", string>> | undefined;
|
|
9
|
+
}) | undefined) => {
|
|
10
|
+
grid: string;
|
|
11
|
+
root: string;
|
|
12
|
+
heading: string;
|
|
13
|
+
};
|
|
5
14
|
declare function Gallery({
|
|
6
15
|
heading,
|
|
7
16
|
variant,
|
|
@@ -9,5 +18,5 @@ declare function Gallery({
|
|
|
9
18
|
className
|
|
10
19
|
}: GalleryProps): react_jsx_runtime0.JSX.Element | null;
|
|
11
20
|
//#endregion
|
|
12
|
-
export { Gallery, type GalleryProps };
|
|
21
|
+
export { Gallery, type GalleryProps, galleryRecipe };
|
|
13
22
|
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/gallery.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/gallery.tsx"],"mappings":";;;;cAOM,aAAA,GAAa,KAAA;;;cAqBjB,OAAA,CAAA,MAAA;AAAA;;;;;iBAQO,OAAA,CAAA;EAAU,OAAA;EAAS,OAAA;EAAS,QAAA;EAAU;AAAA,GAAa,YAAA,GAAY,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,54 +1,78 @@
|
|
|
1
1
|
import { cn } from "../../ui/utils.mjs";
|
|
2
|
+
import { defineSlotRecipe } from "../../ui-resolver/recipe.mjs";
|
|
3
|
+
import { useVariantDefault } from "../../ui-resolver/context.mjs";
|
|
4
|
+
import { Carousel, CarouselContent, CarouselItem } from "../../ui-resolver/carousel.mjs";
|
|
2
5
|
import * as React$1 from "react";
|
|
3
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
//#region src/client/storefront/blocks/gallery.tsx
|
|
5
|
-
|
|
8
|
+
const galleryRecipe = defineSlotRecipe({
|
|
9
|
+
slots: [
|
|
10
|
+
"root",
|
|
11
|
+
"heading",
|
|
12
|
+
"grid"
|
|
13
|
+
],
|
|
14
|
+
base: {
|
|
15
|
+
root: "px-4 py-12 md:px-8",
|
|
16
|
+
heading: "mb-6 text-2xl font-heading text-foreground md:text-3xl",
|
|
17
|
+
grid: ""
|
|
18
|
+
},
|
|
19
|
+
variants: { layout: {
|
|
20
|
+
grid: { grid: "grid gap-[var(--enad-gallery-gap,1rem)]" },
|
|
21
|
+
masonry: { grid: "columns-2 gap-[var(--enad-gallery-gap,1rem)] md:columns-3 [&>*]:mb-[var(--enad-gallery-gap,1rem)] [&>*]:break-inside-avoid" },
|
|
22
|
+
filmstrip: { grid: "flex gap-[var(--enad-gallery-gap,1rem)] overflow-x-auto snap-x snap-mandatory scrollbar-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&>*]:w-64 [&>*]:shrink-0 [&>*]:snap-start md:[&>*]:w-80" }
|
|
23
|
+
} },
|
|
24
|
+
defaultVariants: { layout: "grid" }
|
|
25
|
+
});
|
|
26
|
+
const headingStyle = {
|
|
27
|
+
fontWeight: "var(--enad-heading-weight)",
|
|
28
|
+
letterSpacing: "var(--enad-heading-tracking)",
|
|
29
|
+
textTransform: "var(--enad-heading-transform)"
|
|
30
|
+
};
|
|
31
|
+
function Gallery({ heading, variant, children, className }) {
|
|
32
|
+
const galleryDefault = useVariantDefault("gallery");
|
|
33
|
+
const layout = variant ?? galleryDefault ?? "grid";
|
|
6
34
|
const childCount = React$1.Children.count(children);
|
|
7
35
|
if (childCount === 0) return null;
|
|
36
|
+
const classes = galleryRecipe({ layout });
|
|
37
|
+
const gridColsClass = layout === "grid" ? childCount === 1 ? "grid-cols-1" : "grid-cols-2 md:grid-cols-3 lg:grid-cols-[repeat(var(--enad-gallery-columns,4),minmax(0,1fr))]" : "";
|
|
8
38
|
const headingEl = heading ? /* @__PURE__ */ jsx("h2", {
|
|
9
|
-
className:
|
|
10
|
-
style:
|
|
11
|
-
fontWeight: "var(--enad-heading-weight)",
|
|
12
|
-
letterSpacing: "var(--enad-heading-tracking)",
|
|
13
|
-
textTransform: "var(--enad-heading-transform)"
|
|
14
|
-
},
|
|
39
|
+
className: classes.heading,
|
|
40
|
+
style: headingStyle,
|
|
15
41
|
children: heading
|
|
16
42
|
}) : null;
|
|
17
|
-
if (
|
|
18
|
-
className: cn(
|
|
43
|
+
if (layout === "filmstrip") return /* @__PURE__ */ jsx("section", {
|
|
44
|
+
className: cn(classes.root, className),
|
|
19
45
|
children: /* @__PURE__ */ jsxs("div", {
|
|
20
46
|
className: "mx-auto max-w-7xl",
|
|
21
|
-
children: [headingEl, /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (variant === "filmstrip") return /* @__PURE__ */ jsx("section", {
|
|
28
|
-
className: cn("px-4 py-12 md:px-8", className),
|
|
29
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
30
|
-
className: "mx-auto max-w-7xl",
|
|
31
|
-
children: [headingEl, /* @__PURE__ */ jsx("div", {
|
|
32
|
-
role: "region",
|
|
47
|
+
children: [headingEl, /* @__PURE__ */ jsx(Carousel, {
|
|
48
|
+
opts: {
|
|
49
|
+
align: "start",
|
|
50
|
+
slidesToScroll: "auto",
|
|
51
|
+
containScroll: "trimSnaps"
|
|
52
|
+
},
|
|
33
53
|
"aria-label": heading ?? "Gallery",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
children: /* @__PURE__ */ jsx(CarouselContent, {
|
|
55
|
+
className: "-ml-[var(--enad-gallery-gap,1rem)]",
|
|
56
|
+
children: React$1.Children.map(children, (child, i) => /* @__PURE__ */ jsx(CarouselItem, {
|
|
57
|
+
className: "basis-auto pl-[var(--enad-gallery-gap,1rem)] w-64 md:w-80",
|
|
58
|
+
children: child
|
|
59
|
+
}, i))
|
|
60
|
+
})
|
|
37
61
|
})]
|
|
38
62
|
})
|
|
39
63
|
});
|
|
40
64
|
return /* @__PURE__ */ jsx("section", {
|
|
41
|
-
className: cn(
|
|
65
|
+
className: cn(classes.root, className),
|
|
42
66
|
children: /* @__PURE__ */ jsxs("div", {
|
|
43
67
|
className: "mx-auto max-w-7xl",
|
|
44
68
|
children: [headingEl, /* @__PURE__ */ jsx("div", {
|
|
45
|
-
className: cn(
|
|
69
|
+
className: cn(classes.grid, gridColsClass),
|
|
46
70
|
children
|
|
47
71
|
})]
|
|
48
72
|
})
|
|
49
73
|
});
|
|
50
74
|
}
|
|
51
75
|
//#endregion
|
|
52
|
-
export { Gallery };
|
|
76
|
+
export { Gallery, galleryRecipe };
|
|
53
77
|
|
|
54
78
|
//# sourceMappingURL=gallery.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.mjs","names":["React"],"sources":["../../../../src/client/storefront/blocks/gallery.tsx"],"sourcesContent":["import * as React from \"react\"
|
|
1
|
+
{"version":3,"file":"gallery.mjs","names":["React"],"sources":["../../../../src/client/storefront/blocks/gallery.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../ui/utils\";\nimport { Carousel, CarouselContent, CarouselItem } from \"../../ui-resolver/carousel\";\nimport { defineSlotRecipe } from \"../../ui-resolver/recipe\";\nimport { useVariantDefault } from \"../../ui-resolver/context\";\nimport type { GalleryProps } from \"../types\";\n\nconst galleryRecipe = defineSlotRecipe({\n slots: [\"root\", \"heading\", \"grid\"] as const,\n base: {\n root: \"px-4 py-12 md:px-8\",\n heading: \"mb-6 text-2xl font-heading text-foreground md:text-3xl\",\n grid: \"\",\n },\n variants: {\n layout: {\n grid: {\n grid: \"grid gap-[var(--enad-gallery-gap,1rem)]\",\n },\n masonry: {\n grid: \"columns-2 gap-[var(--enad-gallery-gap,1rem)] md:columns-3 [&>*]:mb-[var(--enad-gallery-gap,1rem)] [&>*]:break-inside-avoid\",\n },\n filmstrip: {\n grid: \"flex gap-[var(--enad-gallery-gap,1rem)] overflow-x-auto snap-x snap-mandatory scrollbar-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&>*]:w-64 [&>*]:shrink-0 [&>*]:snap-start md:[&>*]:w-80\",\n },\n },\n },\n defaultVariants: { layout: \"grid\" },\n});\n\nconst headingStyle = {\n fontWeight: \"var(--enad-heading-weight)\",\n letterSpacing: \"var(--enad-heading-tracking)\",\n textTransform: \"var(--enad-heading-transform)\",\n} as unknown as React.CSSProperties;\n\nfunction Gallery({ heading, variant, children, className }: GalleryProps) {\n const galleryDefault = useVariantDefault(\"gallery\");\n const layout = variant ?? galleryDefault ?? \"grid\";\n const childCount = React.Children.count(children);\n\n if (childCount === 0) return null;\n\n const classes = galleryRecipe({ layout });\n\n const gridColsClass =\n layout === \"grid\"\n ? childCount === 1\n ? \"grid-cols-1\"\n : \"grid-cols-2 md:grid-cols-3 lg:grid-cols-[repeat(var(--enad-gallery-columns,4),minmax(0,1fr))]\"\n : \"\";\n\n const headingEl = heading ? (\n <h2 className={classes.heading} style={headingStyle}>\n {heading}\n </h2>\n ) : null;\n\n if (layout === \"filmstrip\") {\n return (\n <section className={cn(classes.root, className)}>\n <div className=\"mx-auto max-w-7xl\">\n {headingEl}\n <Carousel\n opts={{ align: \"start\", slidesToScroll: \"auto\", containScroll: \"trimSnaps\" }}\n aria-label={heading ?? \"Gallery\"}\n >\n <CarouselContent className=\"-ml-[var(--enad-gallery-gap,1rem)]\">\n {React.Children.map(children, (child, i) => (\n <CarouselItem\n key={i}\n className=\"basis-auto pl-[var(--enad-gallery-gap,1rem)] w-64 md:w-80\"\n >\n {child}\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </div>\n </section>\n );\n }\n\n return (\n <section className={cn(classes.root, className)}>\n <div className=\"mx-auto max-w-7xl\">\n {headingEl}\n <div className={cn(classes.grid, gridColsClass)}>{children}</div>\n </div>\n </section>\n );\n}\n\nexport { Gallery, galleryRecipe, type GalleryProps };\n"],"mappings":";;;;;;;AAOA,MAAM,gBAAgB,iBAAiB;CACrC,OAAO;EAAC;EAAQ;EAAW;EAAO;CAClC,MAAM;EACJ,MAAM;EACN,SAAS;EACT,MAAM;EACP;CACD,UAAU,EACR,QAAQ;EACN,MAAM,EACJ,MAAM,2CACP;EACD,SAAS,EACP,MAAM,8HACP;EACD,WAAW,EACT,MAAM,6PACP;EACF,EACF;CACD,iBAAiB,EAAE,QAAQ,QAAQ;CACpC,CAAC;AAEF,MAAM,eAAe;CACnB,YAAY;CACZ,eAAe;CACf,eAAe;CAChB;AAED,SAAS,QAAQ,EAAE,SAAS,SAAS,UAAU,aAA2B;CACxE,MAAM,iBAAiB,kBAAkB,UAAU;CACnD,MAAM,SAAS,WAAW,kBAAkB;CAC5C,MAAM,aAAaA,QAAM,SAAS,MAAM,SAAS;AAEjD,KAAI,eAAe,EAAG,QAAO;CAE7B,MAAM,UAAU,cAAc,EAAE,QAAQ,CAAC;CAEzC,MAAM,gBACJ,WAAW,SACP,eAAe,IACb,gBACA,kGACF;CAEN,MAAM,YAAY,UAChB,oBAAC,MAAD;EAAI,WAAW,QAAQ;EAAS,OAAO;YACpC;EACE,CAAA,GACH;AAEJ,KAAI,WAAW,YACb,QACE,oBAAC,WAAD;EAAS,WAAW,GAAG,QAAQ,MAAM,UAAU;YAC7C,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,WACD,oBAAC,UAAD;IACE,MAAM;KAAE,OAAO;KAAS,gBAAgB;KAAQ,eAAe;KAAa;IAC5E,cAAY,WAAW;cAEvB,oBAAC,iBAAD;KAAiB,WAAU;eACxBA,QAAM,SAAS,IAAI,WAAW,OAAO,MACpC,oBAAC,cAAD;MAEE,WAAU;gBAET;MACY,EAJR,EAIQ,CACf;KACc,CAAA;IACT,CAAA,CACP;;EACE,CAAA;AAId,QACE,oBAAC,WAAD;EAAS,WAAW,GAAG,QAAQ,MAAM,UAAU;YAC7C,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,WACD,oBAAC,OAAD;IAAK,WAAW,GAAG,QAAQ,MAAM,cAAc;IAAG;IAAe,CAAA,CAC7D;;EACE,CAAA"}
|
|
@@ -2,7 +2,18 @@ import { HeroProps } from "../types.js";
|
|
|
2
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/client/storefront/blocks/hero.d.ts
|
|
5
|
+
declare const heroRecipe: (props?: ({
|
|
6
|
+
layout?: "overlay" | "minimal" | "split" | "banner" | "image-only" | undefined;
|
|
7
|
+
contentWidth?: "sm" | "md" | "lg" | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
className?: Partial<Record<"overlay" | "root" | "content" | "background", string>> | undefined;
|
|
10
|
+
}) | undefined) => {
|
|
11
|
+
overlay: string;
|
|
12
|
+
root: string;
|
|
13
|
+
content: string;
|
|
14
|
+
background: string;
|
|
15
|
+
};
|
|
5
16
|
declare function Hero(props: HeroProps): react_jsx_runtime0.JSX.Element;
|
|
6
17
|
//#endregion
|
|
7
|
-
export { Hero, type HeroProps };
|
|
18
|
+
export { Hero, type HeroProps, heroRecipe };
|
|
8
19
|
//# sourceMappingURL=hero.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hero.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/hero.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"hero.d.ts","names":[],"sources":["../../../../src/client/storefront/blocks/hero.tsx"],"mappings":";;;;cAkBM,UAAA,GAAU,KAAA;;;;cAoCd,OAAA,CAAA,MAAA;AAAA;;;;;;iBAgTO,IAAA,CAAK,KAAA,EAAO,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|