dune-react 0.0.7 → 0.0.9
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/components/puck-base/article-card.js +1 -1
- package/dist/components/puck-base/button.d.ts +1 -0
- package/dist/components/puck-base/button.js +1 -0
- package/dist/components/puck-base/container.d.ts +7 -1
- package/dist/components/puck-base/container.js +2 -1
- package/dist/components/puck-base/content.d.ts +1 -4
- package/dist/components/puck-base/content.js +15 -17
- package/dist/components/puck-base/core/types.d.ts +2 -2
- package/dist/components/puck-base/editor-context.d.ts +12 -0
- package/dist/components/puck-base/fields/auto-field.d.ts +1 -0
- package/dist/components/puck-base/fields/auto-field.js +131 -49
- package/dist/components/puck-base/gradient-text.js +12 -3
- package/dist/components/puck-block/banner-sections/announcement-banner-1/announcement-banner.js +1 -1
- package/dist/components/puck-block/contact-sections/api/form-leads.d.ts +16 -0
- package/dist/components/puck-block/contact-sections/api/form-leads.js +25 -0
- package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.js +27 -11
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.d.ts +26 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +229 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/index.d.ts +5 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/index.js +72 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.d.ts +29 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.js +245 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/index.d.ts +5 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/index.js +101 -0
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +9 -8
- package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +3 -3
- package/dist/components/puck-block/cta-sections/gradient-cta-1/index.js +4 -4
- package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.js +5 -4
- package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +6 -5
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.d.ts +16 -0
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.js +56 -0
- package/dist/components/puck-block/faq-sections/faq-2/index.d.ts +5 -0
- package/dist/components/puck-block/faq-sections/faq-2/index.js +62 -0
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.d.ts +3 -4
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.js +13 -3
- package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +34 -14
- package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.js +2 -8
- package/dist/components/puck-block/feature-sections/product-features-1/product-features.js +5 -25
- package/dist/components/puck-block/gallery-sections/gallery-1/gallery.js +3 -2
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.d.ts +14 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +88 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/index.d.ts +5 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/index.js +44 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.d.ts +17 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.js +121 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/index.d.ts +5 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/index.js +60 -0
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +6 -1
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +56 -20
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +12 -1
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +9 -6
- package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +4 -4
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +4 -1
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +60 -62
- package/dist/components/puck-block/index.d.ts +15 -0
- package/dist/components/puck-block/location-sections/location-1/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-1/index.js +103 -0
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +27 -0
- package/dist/components/puck-block/location-sections/location-1/location.js +143 -0
- package/dist/components/puck-block/location-sections/location-2/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-2/index.js +111 -0
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +25 -0
- package/dist/components/puck-block/location-sections/location-2/location.js +136 -0
- package/dist/components/puck-block/location-sections/location-3/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-3/index.js +83 -0
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +22 -0
- package/dist/components/puck-block/location-sections/location-3/location.js +129 -0
- package/dist/components/puck-block/metrics-sections/stats-2/index.d.ts +5 -0
- package/dist/components/puck-block/metrics-sections/stats-2/index.js +77 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.d.ts +16 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +59 -0
- package/dist/components/puck-block/metrics-sections/stats-3/index.d.ts +5 -0
- package/dist/components/puck-block/metrics-sections/stats-3/index.js +94 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.d.ts +17 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +60 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/index.d.ts +5 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/index.js +152 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.d.ts +24 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.js +68 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.d.ts +20 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.js +73 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/index.d.ts +5 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/index.js +74 -0
- package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +2 -8
- package/dist/components/puck-block/team-sections/team-grid-1/team-grid.js +4 -24
- package/dist/components/puck-block/team-sections/team-grid-2/index.d.ts +5 -0
- package/dist/components/puck-block/team-sections/team-grid-2/index.js +63 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.d.ts +21 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.js +46 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/index.d.ts +5 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/index.js +54 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.d.ts +21 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.js +107 -0
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +2 -1
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.d.ts +5 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.js +50 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.d.ts +15 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.js +57 -0
- package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.js +3 -2
- package/dist/components/puck-block/text-sections/articles-1/articles.d.ts +1 -0
- package/dist/components/puck-block/text-sections/articles-1/articles.js +19 -6
- package/dist/components/puck-block/text-sections/articles-1/index.js +16 -4
- package/dist/components/puck-block/text-sections/content-section-1/content-section.js +5 -4
- package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +3 -2
- package/dist/components/shadcn/navigation-menu.d.ts +1 -1
- package/dist/components/shadcn/navigation-menu.js +33 -0
- package/dist/index.js +104 -74
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { paddingDefaults, backgroundColor, sectionStyle, padding } from "../../../puck-base/core/fields.js";
|
|
2
|
+
import { Gallery2 } from "./gallery-2.js";
|
|
3
|
+
const defaultImage = {
|
|
4
|
+
src: "https://dummyimage.com/1400x700/f5f4f4/101010.png&text=Gallery+Image",
|
|
5
|
+
alt: "Gallery image"
|
|
6
|
+
};
|
|
7
|
+
const conf = {
|
|
8
|
+
fields: {
|
|
9
|
+
heading: {
|
|
10
|
+
type: "text",
|
|
11
|
+
contentEditable: true
|
|
12
|
+
},
|
|
13
|
+
description: {
|
|
14
|
+
type: "textarea",
|
|
15
|
+
contentEditable: true
|
|
16
|
+
},
|
|
17
|
+
images: {
|
|
18
|
+
type: "array",
|
|
19
|
+
max: 10,
|
|
20
|
+
getItemSummary: (item, index = 0) => item.alt || `Image ${index + 1}`,
|
|
21
|
+
arrayFields: {
|
|
22
|
+
src: { type: "image", label: "图片" },
|
|
23
|
+
alt: { type: "text", label: "Alt Text" }
|
|
24
|
+
},
|
|
25
|
+
defaultItemProps: defaultImage
|
|
26
|
+
},
|
|
27
|
+
padding,
|
|
28
|
+
sectionStyle,
|
|
29
|
+
backgroundColor
|
|
30
|
+
},
|
|
31
|
+
defaultProps: {
|
|
32
|
+
heading: "Real transformations from real training",
|
|
33
|
+
description: "Watch how customized programs and one-on-one coaching help clients reach their fitness goals. Every session is built around your needs.",
|
|
34
|
+
images: Array.from({ length: 3 }).map((_, i) => ({
|
|
35
|
+
...defaultImage,
|
|
36
|
+
alt: `Gallery image ${i + 1}`
|
|
37
|
+
})),
|
|
38
|
+
padding: paddingDefaults
|
|
39
|
+
},
|
|
40
|
+
render: Gallery2
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
conf
|
|
44
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
|
+
export interface Gallery3Image {
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
caption?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Gallery3Props {
|
|
8
|
+
padding?: CompoundContainerProps["padding"];
|
|
9
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
10
|
+
backgroundColor?: string;
|
|
11
|
+
heading?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
images?: Gallery3Image[];
|
|
14
|
+
showCaptions?: boolean;
|
|
15
|
+
gap?: "sm" | "md" | "lg";
|
|
16
|
+
}
|
|
17
|
+
export declare const Gallery3: ({ padding, sectionStyle, backgroundColor, heading, description, images, showCaptions, gap, }: Gallery3Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
3
|
+
import { CompoundImage } from "../../../puck-base/image.js";
|
|
4
|
+
import { cn } from "../../../../utils/css-utils.js";
|
|
5
|
+
const gapClasses = {
|
|
6
|
+
sm: "gap-2",
|
|
7
|
+
md: "gap-3",
|
|
8
|
+
lg: "gap-5"
|
|
9
|
+
};
|
|
10
|
+
function ImageCard({
|
|
11
|
+
image,
|
|
12
|
+
index,
|
|
13
|
+
showCaption,
|
|
14
|
+
className
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: cn(
|
|
20
|
+
// [&>span] targets the span wrapper that withEditable inserts in editor mode
|
|
21
|
+
"group relative overflow-hidden rounded-2xl bg-muted [&>span]:h-full [&>span]:w-full",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
children: [
|
|
25
|
+
!image.src && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: image.alt ?? `Image ${index + 1}` }) }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
CompoundImage,
|
|
28
|
+
{
|
|
29
|
+
src: image.src || "",
|
|
30
|
+
alt: image.alt ?? `Gallery image ${index + 1}`,
|
|
31
|
+
className: "h-full w-full object-cover transition-transform duration-500 ease-out group-hover:scale-105"
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
showCaption && image.caption && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-end bg-gradient-to-t from-black/65 via-black/10 to-transparent p-5 opacity-0 transition-all duration-300 group-hover:opacity-100", children: /* @__PURE__ */ jsx("p", { className: "translate-y-2 text-sm font-medium text-white transition-transform duration-300 group-hover:translate-y-0", children: image.caption }) })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const Gallery3 = ({
|
|
40
|
+
padding,
|
|
41
|
+
sectionStyle,
|
|
42
|
+
backgroundColor,
|
|
43
|
+
heading,
|
|
44
|
+
description,
|
|
45
|
+
images = [],
|
|
46
|
+
showCaptions = true,
|
|
47
|
+
gap = "md"
|
|
48
|
+
}) => {
|
|
49
|
+
const gc = gapClasses[gap] ?? gapClasses.md;
|
|
50
|
+
const [img1, img2, img3, ...rest] = images;
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
CompoundContainer,
|
|
53
|
+
{
|
|
54
|
+
padding,
|
|
55
|
+
sectionStyle,
|
|
56
|
+
backgroundColor,
|
|
57
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8 lg:gap-12", children: [
|
|
58
|
+
(heading || description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: heading && /* @__PURE__ */ jsx("h2", { className: "text-4xl font-bold tracking-tight text-foreground lg:text-5xl", children: heading }) }),
|
|
60
|
+
description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-base leading-relaxed text-muted-foreground lg:text-right", children: description })
|
|
61
|
+
] }),
|
|
62
|
+
images.length > 0 && /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", gc), children: [
|
|
63
|
+
img1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
64
|
+
/* @__PURE__ */ jsx("div", { className: cn("flex flex-col lg:hidden", gc), children: [img1, img2, img3].filter(Boolean).map((img, i) => /* @__PURE__ */ jsx("div", { className: "aspect-[4/3]", children: /* @__PURE__ */ jsx(
|
|
65
|
+
ImageCard,
|
|
66
|
+
{
|
|
67
|
+
image: img,
|
|
68
|
+
index: i,
|
|
69
|
+
showCaption: showCaptions,
|
|
70
|
+
className: "h-full"
|
|
71
|
+
}
|
|
72
|
+
) }, i)) }),
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: cn("hidden h-[520px] lg:flex", gc), children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
ImageCard,
|
|
76
|
+
{
|
|
77
|
+
image: img1,
|
|
78
|
+
index: 0,
|
|
79
|
+
showCaption: showCaptions,
|
|
80
|
+
className: "basis-[58%] shrink-0"
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
(img2 || img3) && /* @__PURE__ */ jsxs("div", { className: cn("flex flex-1 flex-col", gc), children: [
|
|
84
|
+
img2 && /* @__PURE__ */ jsx(
|
|
85
|
+
ImageCard,
|
|
86
|
+
{
|
|
87
|
+
image: img2,
|
|
88
|
+
index: 1,
|
|
89
|
+
showCaption: showCaptions,
|
|
90
|
+
className: "flex-1"
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
img3 && /* @__PURE__ */ jsx(
|
|
94
|
+
ImageCard,
|
|
95
|
+
{
|
|
96
|
+
image: img3,
|
|
97
|
+
index: 2,
|
|
98
|
+
showCaption: showCaptions,
|
|
99
|
+
className: "flex-1"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] })
|
|
103
|
+
] })
|
|
104
|
+
] }),
|
|
105
|
+
rest.length > 0 && /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-2 lg:grid-cols-3", gc), children: rest.map((img, idx) => /* @__PURE__ */ jsx("div", { className: "aspect-[4/3]", children: /* @__PURE__ */ jsx(
|
|
106
|
+
ImageCard,
|
|
107
|
+
{
|
|
108
|
+
image: img,
|
|
109
|
+
index: idx + 3,
|
|
110
|
+
showCaption: showCaptions,
|
|
111
|
+
className: "h-full"
|
|
112
|
+
}
|
|
113
|
+
) }, idx + 3)) })
|
|
114
|
+
] })
|
|
115
|
+
] })
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
Gallery3
|
|
121
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { paddingDefaults, backgroundColor, sectionStyle, padding, getPlaceholderImageUrl } from "../../../puck-base/core/fields.js";
|
|
2
|
+
import { Gallery3 } from "./gallery-3.js";
|
|
3
|
+
const makeDefaultImage = (i) => ({
|
|
4
|
+
src: getPlaceholderImageUrl("1200x800", `Gallery Image ${i + 1}`),
|
|
5
|
+
alt: `Gallery image ${i + 1}`,
|
|
6
|
+
caption: ""
|
|
7
|
+
});
|
|
8
|
+
const conf = {
|
|
9
|
+
fields: {
|
|
10
|
+
heading: {
|
|
11
|
+
type: "text",
|
|
12
|
+
contentEditable: true
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: "textarea",
|
|
16
|
+
contentEditable: true
|
|
17
|
+
},
|
|
18
|
+
images: {
|
|
19
|
+
type: "array",
|
|
20
|
+
max: 9,
|
|
21
|
+
getItemSummary: (item, index = 0) => item.alt || `Image ${index + 1}`,
|
|
22
|
+
arrayFields: {
|
|
23
|
+
src: { type: "image", label: "图片" },
|
|
24
|
+
alt: { type: "text", label: "Alt Text" },
|
|
25
|
+
caption: { type: "text", label: "Caption" }
|
|
26
|
+
},
|
|
27
|
+
defaultItemProps: makeDefaultImage(0)
|
|
28
|
+
},
|
|
29
|
+
showCaptions: {
|
|
30
|
+
type: "radio",
|
|
31
|
+
options: [
|
|
32
|
+
{ label: "显示", value: true },
|
|
33
|
+
{ label: "隐藏", value: false }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
gap: {
|
|
37
|
+
type: "radio",
|
|
38
|
+
options: [
|
|
39
|
+
{ label: "紧凑", value: "sm" },
|
|
40
|
+
{ label: "默认", value: "md" },
|
|
41
|
+
{ label: "宽松", value: "lg" }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
padding,
|
|
45
|
+
sectionStyle,
|
|
46
|
+
backgroundColor
|
|
47
|
+
},
|
|
48
|
+
defaultProps: {
|
|
49
|
+
heading: "Crafted with intention",
|
|
50
|
+
description: "A curated selection of moments that define our work and vision.",
|
|
51
|
+
images: Array.from({ length: 6 }, (_, i) => makeDefaultImage(i)),
|
|
52
|
+
showCaptions: true,
|
|
53
|
+
gap: "md",
|
|
54
|
+
padding: paddingDefaults
|
|
55
|
+
},
|
|
56
|
+
render: Gallery3
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
conf
|
|
60
|
+
};
|
|
@@ -12,5 +12,10 @@ export interface FullscreenHeroProps {
|
|
|
12
12
|
variant: string;
|
|
13
13
|
};
|
|
14
14
|
buttons?: CompoundButtonProps[];
|
|
15
|
+
backgroundImage?: {
|
|
16
|
+
src: string;
|
|
17
|
+
alt?: string;
|
|
18
|
+
} | string;
|
|
19
|
+
overlay?: "none" | "dark" | "gradient";
|
|
15
20
|
}
|
|
16
|
-
export declare const FullscreenHero: ({ padding, sectionStyle, backgroundColor, heading, description, badge, buttons, }: FullscreenHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const FullscreenHero: ({ padding, sectionStyle, backgroundColor, heading, description, badge, buttons, backgroundImage, overlay, }: FullscreenHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { jsxs,
|
|
2
|
-
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { CompoundContainer, SECTION_STYLE_VARS } from "../../../puck-base/container.js";
|
|
3
3
|
import { CompoundButton } from "../../../puck-base/button.js";
|
|
4
|
+
import { CompoundImage } from "../../../puck-base/image.js";
|
|
5
|
+
import { cn } from "../../../../utils/css-utils.js";
|
|
6
|
+
const overlayStyles = {
|
|
7
|
+
dark: "bg-black/55",
|
|
8
|
+
gradient: "bg-gradient-to-t from-black/80 to-black/10"
|
|
9
|
+
};
|
|
4
10
|
const FullscreenHero = ({
|
|
5
11
|
padding,
|
|
6
12
|
sectionStyle = "dark",
|
|
@@ -8,25 +14,55 @@ const FullscreenHero = ({
|
|
|
8
14
|
heading = "",
|
|
9
15
|
description,
|
|
10
16
|
badge,
|
|
11
|
-
buttons
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
buttons,
|
|
18
|
+
backgroundImage,
|
|
19
|
+
overlay = "dark"
|
|
20
|
+
}) => {
|
|
21
|
+
const bgSrc = typeof backgroundImage === "string" ? backgroundImage : backgroundImage == null ? void 0 : backgroundImage.src;
|
|
22
|
+
const bgAlt = typeof backgroundImage === "string" ? "" : (backgroundImage == null ? void 0 : backgroundImage.alt) ?? "";
|
|
23
|
+
if (!bgSrc) {
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
CompoundContainer,
|
|
26
|
+
{
|
|
27
|
+
padding,
|
|
28
|
+
sectionStyle,
|
|
29
|
+
backgroundColor,
|
|
30
|
+
className: "min-h-[100vh] flex flex-col justify-end",
|
|
31
|
+
children: /* @__PURE__ */ jsx(Content, { badge, heading, description, buttons })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
const { top = "large", bottom = "large" } = padding ?? {};
|
|
36
|
+
const styleVars = sectionStyle && sectionStyle !== "default" && sectionStyle !== "custom" ? SECTION_STYLE_VARS[sectionStyle] : {};
|
|
37
|
+
return /* @__PURE__ */ jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: cn(
|
|
41
|
+
"relative w-full min-h-[100vh] flex flex-col justify-end overflow-hidden bg-background text-foreground",
|
|
42
|
+
{ "pt-20 lg:pt-40": top === "large", "pb-20 lg:pb-40": bottom === "large" },
|
|
43
|
+
{ "pt-15 lg:pt-30": top === "medium", "pb-15 lg:pb-30": bottom === "medium" },
|
|
44
|
+
{ "pt-10 lg:pt-20": top === "small", "pb-10 lg:pb-20": bottom === "small" }
|
|
45
|
+
),
|
|
46
|
+
style: { ...styleVars, ...backgroundColor ? { backgroundColor } : {} },
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 [&>span]:h-full [&>span]:w-full", children: /* @__PURE__ */ jsx(CompoundImage, { src: bgSrc, alt: bgAlt, className: "h-full w-full object-cover" }) }),
|
|
49
|
+
overlay !== "none" && /* @__PURE__ */ jsx("div", { className: cn("absolute inset-0", overlayStyles[overlay] ?? overlayStyles.dark) }),
|
|
50
|
+
/* @__PURE__ */ jsx("div", { className: "container mx-auto relative z-50", children: /* @__PURE__ */ jsx(Content, { badge, heading, description, buttons }) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
function Content({ badge, heading, description, buttons }) {
|
|
56
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
57
|
+
badge && /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary mb-6 inline-block rounded-full px-3 py-1 text-xs font-medium", children: badge.label }),
|
|
58
|
+
/* @__PURE__ */ jsx("h1", { className: "font-serif text-5xl md:text-7xl lg:text-8xl font-medium leading-[0.95] mb-8 max-w-[800px] text-foreground", children: heading }),
|
|
59
|
+
/* @__PURE__ */ jsx("hr", { className: "w-full my-4 border-foreground/20" }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start md:items-end gap-6 mt-4", children: [
|
|
61
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-base leading-relaxed max-w-lg", children: description }),
|
|
62
|
+
buttons && buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: buttons.map((btn, i) => /* @__PURE__ */ jsx(CompoundButton, { ...btn }, i)) })
|
|
63
|
+
] })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
30
66
|
export {
|
|
31
67
|
FullscreenHero
|
|
32
68
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { paddingDefaults, padding, backgroundColor, sectionStyle, contentFields } from "../../../puck-base/core/fields.js";
|
|
1
|
+
import { paddingDefaults, padding, backgroundColor, sectionStyle, backgroundImage, contentFields } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { FullscreenHero } from "./fullscreen-hero.js";
|
|
3
3
|
const conf = {
|
|
4
4
|
fields: {
|
|
@@ -12,6 +12,16 @@ const conf = {
|
|
|
12
12
|
contentEditable: true
|
|
13
13
|
},
|
|
14
14
|
buttons: contentFields.buttons,
|
|
15
|
+
backgroundImage,
|
|
16
|
+
overlay: {
|
|
17
|
+
type: "select",
|
|
18
|
+
label: "Overlay",
|
|
19
|
+
options: [
|
|
20
|
+
{ label: "None", value: "none" },
|
|
21
|
+
{ label: "Dark", value: "dark" },
|
|
22
|
+
{ label: "Gradient", value: "gradient" }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
15
25
|
sectionStyle,
|
|
16
26
|
backgroundColor,
|
|
17
27
|
padding
|
|
@@ -20,6 +30,7 @@ const conf = {
|
|
|
20
30
|
heading: "Your bold headline here.",
|
|
21
31
|
description: "A compelling description that supports your headline and encourages visitors to take action.",
|
|
22
32
|
sectionStyle: "dark",
|
|
33
|
+
overlay: "dark",
|
|
23
34
|
buttons: [
|
|
24
35
|
{
|
|
25
36
|
label: "Get Started",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
|
-
import {
|
|
2
|
+
import { CompoundContentProps } from "@/components/puck-base/content";
|
|
3
3
|
export interface GradientHeroProps extends CompoundContentProps {
|
|
4
4
|
padding?: CompoundContainerProps["padding"];
|
|
5
5
|
gradientFrom?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
3
|
+
import { CompoundButton } from "../../../puck-base/button.js";
|
|
3
4
|
import { GradientText } from "../../../puck-base/gradient-text.js";
|
|
4
5
|
const GradientHero = ({
|
|
5
6
|
padding,
|
|
@@ -7,8 +8,8 @@ const GradientHero = ({
|
|
|
7
8
|
heading = "",
|
|
8
9
|
description,
|
|
9
10
|
buttons,
|
|
10
|
-
gradientFrom = "
|
|
11
|
-
gradientTo = "
|
|
11
|
+
gradientFrom = "var(--primary)",
|
|
12
|
+
gradientTo = "var(--chart-2)"
|
|
12
13
|
}) => /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle: "dark", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-4xl text-center", children: [
|
|
13
14
|
badge && /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary mb-6 inline-block rounded-full px-3 py-1 text-xs font-medium", children: badge.label }),
|
|
14
15
|
/* @__PURE__ */ jsx(
|
|
@@ -23,11 +24,13 @@ const GradientHero = ({
|
|
|
23
24
|
),
|
|
24
25
|
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mx-auto mb-8 max-w-2xl text-lg md:text-xl", children: description }),
|
|
25
26
|
buttons && buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex justify-center gap-4", children: buttons.map((btn, i) => /* @__PURE__ */ jsx(
|
|
26
|
-
|
|
27
|
+
CompoundButton,
|
|
27
28
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
label: btn.label,
|
|
30
|
+
url: btn.url,
|
|
31
|
+
variant: btn.variant,
|
|
32
|
+
size: btn.size,
|
|
33
|
+
icon: btn.icon
|
|
31
34
|
},
|
|
32
35
|
i
|
|
33
36
|
)) })
|
|
@@ -6,12 +6,12 @@ const conf = {
|
|
|
6
6
|
gradientFrom: {
|
|
7
7
|
type: "text",
|
|
8
8
|
label: "Gradient Start",
|
|
9
|
-
ai: { instructions: "Use
|
|
9
|
+
ai: { instructions: "Use a CSS variable from the template theme, e.g. 'var(--primary)', 'var(--chart-1)'. Also accepts oklch format." }
|
|
10
10
|
},
|
|
11
11
|
gradientTo: {
|
|
12
12
|
type: "text",
|
|
13
13
|
label: "Gradient End",
|
|
14
|
-
ai: { instructions: "Use
|
|
14
|
+
ai: { instructions: "Use a CSS variable from the template theme, e.g. 'var(--chart-2)', 'var(--accent)'. Also accepts oklch format." }
|
|
15
15
|
},
|
|
16
16
|
padding
|
|
17
17
|
},
|
|
@@ -22,8 +22,8 @@ const conf = {
|
|
|
22
22
|
buttons: [
|
|
23
23
|
{ label: "Get Started Free", icon: "move-right", variant: "default" }
|
|
24
24
|
],
|
|
25
|
-
gradientFrom: "
|
|
26
|
-
gradientTo: "
|
|
25
|
+
gradientFrom: "var(--primary)",
|
|
26
|
+
gradientTo: "var(--chart-2)",
|
|
27
27
|
padding: paddingDefaults
|
|
28
28
|
},
|
|
29
29
|
render: GradientHero
|
|
@@ -9,7 +9,10 @@ export interface ImageHeroProps {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
badge?: CompoundBadgeProps;
|
|
11
11
|
buttons?: CompoundButtonProps[];
|
|
12
|
-
backgroundImage?:
|
|
12
|
+
backgroundImage?: {
|
|
13
|
+
src: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
} | string;
|
|
13
16
|
overlay?: "none" | "dark" | "gradient";
|
|
14
17
|
align?: "left" | "center";
|
|
15
18
|
minHeight?: "medium" | "large" | "full";
|
|
@@ -2,10 +2,11 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
3
3
|
import { CompoundBadge } from "../../../puck-base/badge.js";
|
|
4
4
|
import { CompoundButton } from "../../../puck-base/button.js";
|
|
5
|
+
import { CompoundImage } from "../../../puck-base/image.js";
|
|
5
6
|
import { cn } from "../../../../utils/css-utils.js";
|
|
6
7
|
const overlayStyles = {
|
|
7
|
-
dark: "bg-
|
|
8
|
-
gradient: "bg-gradient-to-t from-
|
|
8
|
+
dark: "bg-black/55",
|
|
9
|
+
gradient: "bg-gradient-to-t from-black/80 to-black/20"
|
|
9
10
|
};
|
|
10
11
|
const minHeightStyles = {
|
|
11
12
|
medium: "min-h-[400px] md:min-h-[500px]",
|
|
@@ -24,69 +25,66 @@ const ImageHero = ({
|
|
|
24
25
|
overlay = "dark",
|
|
25
26
|
align = "center",
|
|
26
27
|
minHeight = "large"
|
|
27
|
-
}) =>
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"img",
|
|
37
|
-
{
|
|
38
|
-
src: backgroundImage,
|
|
39
|
-
alt: "",
|
|
40
|
-
className: "absolute inset-0 h-full w-full object-cover"
|
|
41
|
-
}
|
|
28
|
+
}) => {
|
|
29
|
+
const bgSrc = typeof backgroundImage === "string" ? backgroundImage : backgroundImage == null ? void 0 : backgroundImage.src;
|
|
30
|
+
const bgAlt = typeof backgroundImage === "string" ? "" : (backgroundImage == null ? void 0 : backgroundImage.alt) ?? "";
|
|
31
|
+
return /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle, backgroundColor, children: /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: cn(
|
|
35
|
+
"relative flex items-center overflow-hidden rounded-2xl",
|
|
36
|
+
minHeightStyles[minHeight] ?? minHeightStyles.large
|
|
42
37
|
),
|
|
43
|
-
|
|
44
|
-
"div",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
badge && /* @__PURE__ */ jsx(
|
|
62
|
-
CompoundBadge,
|
|
63
|
-
{
|
|
64
|
-
label: badge.label,
|
|
65
|
-
variant: badge.variant,
|
|
66
|
-
url: badge.url
|
|
67
|
-
}
|
|
38
|
+
children: [
|
|
39
|
+
bgSrc && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 [&>span]:h-full [&>span]:w-full", children: /* @__PURE__ */ jsx(CompoundImage, { src: bgSrc, alt: bgAlt, className: "h-full w-full object-cover" }) }),
|
|
40
|
+
overlay !== "none" && /* @__PURE__ */ jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: cn(
|
|
44
|
+
"absolute inset-0",
|
|
45
|
+
overlayStyles[overlay] ?? overlayStyles.dark
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: cn(
|
|
53
|
+
"relative z-50 flex w-full flex-col gap-6 px-8 py-16 md:px-16",
|
|
54
|
+
align === "center" && "items-center text-center",
|
|
55
|
+
align === "left" && "items-start text-left"
|
|
68
56
|
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(button, index) => button.label ? /* @__PURE__ */ jsx(
|
|
73
|
-
CompoundButton,
|
|
57
|
+
children: [
|
|
58
|
+
badge && /* @__PURE__ */ jsx(
|
|
59
|
+
CompoundBadge,
|
|
74
60
|
{
|
|
75
|
-
label:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
) :
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
61
|
+
label: badge.label,
|
|
62
|
+
variant: badge.variant,
|
|
63
|
+
url: badge.url
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
heading && /* @__PURE__ */ jsx("h1", { className: "text-white max-w-3xl text-4xl font-bold tracking-tight md:text-6xl lg:text-7xl", children: heading }),
|
|
67
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-white/80 max-w-2xl text-lg md:text-xl", children: description }),
|
|
68
|
+
Array.isArray(buttons) && buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-4", children: buttons.map(
|
|
69
|
+
(button, index) => button.label ? /* @__PURE__ */ jsx(
|
|
70
|
+
CompoundButton,
|
|
71
|
+
{
|
|
72
|
+
label: button.label,
|
|
73
|
+
url: button.url,
|
|
74
|
+
variant: button.variant,
|
|
75
|
+
size: button.size,
|
|
76
|
+
icon: button.icon
|
|
77
|
+
},
|
|
78
|
+
index
|
|
79
|
+
) : null
|
|
80
|
+
) })
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
) });
|
|
87
|
+
};
|
|
90
88
|
export {
|
|
91
89
|
ImageHero
|
|
92
90
|
};
|