dune-react 0.0.8 → 0.0.10
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.js +2 -1
- 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/fields.d.ts +1 -127
- package/dist/components/puck-base/core/fields.js +1 -76
- package/dist/components/puck-base/core/styles.d.ts +1877 -0
- package/dist/components/puck-base/core/styles.js +286 -0
- package/dist/components/puck-base/core/types.d.ts +2 -2
- package/dist/components/puck-base/core/with-editable.d.ts +4 -1
- package/dist/components/puck-base/core/with-editable.js +51 -27
- package/dist/components/puck-base/editor-context.d.ts +8 -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.d.ts +9 -7
- package/dist/components/puck-block/banner-sections/announcement-banner-1/announcement-banner.js +11 -8
- package/dist/components/puck-block/banner-sections/announcement-banner-1/index.js +19 -37
- package/dist/components/puck-block/banner-sections/marquee-1/index.js +26 -24
- package/dist/components/puck-block/banner-sections/marquee-1/marquee.d.ts +9 -9
- package/dist/components/puck-block/banner-sections/marquee-1/marquee.js +28 -21
- package/dist/components/puck-block/banner-sections/props.d.ts +22 -0
- 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.d.ts +13 -4
- package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.js +122 -121
- package/dist/components/puck-block/contact-sections/contact-us-1/index.js +87 -7
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.d.ts +30 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +234 -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 +74 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.d.ts +32 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.js +250 -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 +114 -0
- package/dist/components/puck-block/contact-sections/props.d.ts +65 -0
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.d.ts +12 -9
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +28 -30
- package/dist/components/puck-block/cta-sections/banner-cta-1/index.js +23 -25
- package/dist/components/puck-block/cta-sections/cta-1/cta.d.ts +6 -4
- package/dist/components/puck-block/cta-sections/cta-1/cta.js +5 -7
- package/dist/components/puck-block/cta-sections/cta-1/index.js +5 -9
- package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.d.ts +10 -10
- package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +24 -20
- package/dist/components/puck-block/cta-sections/gradient-cta-1/index.js +36 -29
- package/dist/components/puck-block/cta-sections/newsletter-signup-1/index.js +13 -5
- package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.d.ts +7 -3
- package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.js +36 -32
- package/dist/components/puck-block/cta-sections/promo-section-1/index.js +4 -5
- package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.d.ts +6 -4
- package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +94 -79
- package/dist/components/puck-block/cta-sections/props.d.ts +47 -0
- package/dist/components/puck-block/faq-sections/accordion-1/accordion.d.ts +6 -4
- package/dist/components/puck-block/faq-sections/accordion-1/accordion.js +39 -33
- package/dist/components/puck-block/faq-sections/accordion-1/index.js +3 -5
- package/dist/components/puck-block/faq-sections/faq-1/faq.d.ts +9 -7
- package/dist/components/puck-block/faq-sections/faq-1/faq.js +50 -44
- package/dist/components/puck-block/faq-sections/faq-1/index.js +12 -14
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.d.ts +18 -0
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.js +54 -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 +61 -0
- package/dist/components/puck-block/faq-sections/props.d.ts +30 -0
- package/dist/components/puck-block/feature-sections/bento-1/bento.d.ts +6 -4
- package/dist/components/puck-block/feature-sections/bento-1/bento.js +2 -4
- package/dist/components/puck-block/feature-sections/bento-1/index.js +4 -5
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.d.ts +8 -7
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.js +15 -7
- package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +37 -18
- package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.d.ts +6 -4
- package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.js +4 -12
- package/dist/components/puck-block/feature-sections/feature-showcase-1/index.js +4 -5
- package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.d.ts +6 -4
- package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.js +59 -53
- package/dist/components/puck-block/feature-sections/icon-grid-1/index.js +7 -8
- package/dist/components/puck-block/feature-sections/product-features-1/index.js +4 -5
- package/dist/components/puck-block/feature-sections/product-features-1/product-features.d.ts +6 -4
- package/dist/components/puck-block/feature-sections/product-features-1/product-features.js +7 -29
- package/dist/components/puck-block/feature-sections/props.d.ts +48 -0
- package/dist/components/puck-block/footer-sections/footer-1/footer.d.ts +5 -3
- package/dist/components/puck-block/footer-sections/footer-1/footer.js +6 -6
- package/dist/components/puck-block/footer-sections/footer-1/index.js +3 -5
- package/dist/components/puck-block/footer-sections/props.d.ts +31 -0
- package/dist/components/puck-block/gallery-sections/gallery-1/gallery.d.ts +9 -7
- package/dist/components/puck-block/gallery-sections/gallery-1/gallery.js +49 -40
- package/dist/components/puck-block/gallery-sections/gallery-1/index.js +32 -34
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.d.ts +16 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +86 -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 +42 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.d.ts +19 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.js +119 -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 +59 -0
- package/dist/components/puck-block/gallery-sections/props.d.ts +26 -0
- package/dist/components/puck-block/header-sections/header-1/header.d.ts +7 -5
- package/dist/components/puck-block/header-sections/header-1/header.js +8 -9
- package/dist/components/puck-block/header-sections/header-1/index.d.ts +1 -1
- package/dist/components/puck-block/header-sections/header-1/index.js +13 -12
- package/dist/components/puck-block/header-sections/props.d.ts +41 -0
- package/dist/components/puck-block/header-sections/sticky-nav-1/index.js +12 -12
- package/dist/components/puck-block/header-sections/sticky-nav-1/sticky-nav.d.ts +8 -6
- package/dist/components/puck-block/header-sections/sticky-nav-1/sticky-nav.js +5 -5
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +11 -4
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +60 -23
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +18 -6
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.d.ts +9 -5
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +37 -24
- package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +18 -15
- package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.d.ts +7 -6
- package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.js +7 -10
- package/dist/components/puck-block/hero-sections/grid-hero-1/index.js +43 -11
- package/dist/components/puck-block/hero-sections/hero-1/hero.d.ts +6 -4
- package/dist/components/puck-block/hero-sections/hero-1/hero.js +5 -7
- package/dist/components/puck-block/hero-sections/hero-1/index.js +4 -4
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +14 -8
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +64 -60
- package/dist/components/puck-block/hero-sections/image-hero-1/index.js +16 -34
- package/dist/components/puck-block/hero-sections/props.d.ts +71 -0
- package/dist/components/puck-block/hero-sections/split-hero-1/index.js +6 -5
- package/dist/components/puck-block/hero-sections/split-hero-1/split-hero.d.ts +8 -8
- package/dist/components/puck-block/hero-sections/split-hero-1/split-hero.js +48 -47
- package/dist/components/puck-block/hero-sections/video-hero-1/index.js +4 -3
- package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.d.ts +6 -2
- package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +30 -22
- 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 +108 -0
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +28 -0
- package/dist/components/puck-block/location-sections/location-1/location.js +137 -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 +123 -0
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +30 -0
- package/dist/components/puck-block/location-sections/location-2/location.js +131 -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 +84 -0
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +24 -0
- package/dist/components/puck-block/location-sections/location-3/location.js +127 -0
- package/dist/components/puck-block/location-sections/props.d.ts +45 -0
- package/dist/components/puck-block/metrics-sections/props.d.ts +43 -0
- package/dist/components/puck-block/metrics-sections/stats-1/index.js +6 -7
- package/dist/components/puck-block/metrics-sections/stats-1/stats.d.ts +7 -5
- package/dist/components/puck-block/metrics-sections/stats-1/stats.js +61 -55
- 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 +76 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.d.ts +18 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +57 -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 +86 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.d.ts +18 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +56 -0
- package/dist/components/puck-block/pricing-sections/comparison-1/comparison.d.ts +7 -5
- package/dist/components/puck-block/pricing-sections/comparison-1/comparison.js +45 -39
- package/dist/components/puck-block/pricing-sections/comparison-1/index.js +5 -7
- package/dist/components/puck-block/pricing-sections/pricing-1/index.js +10 -11
- package/dist/components/puck-block/pricing-sections/pricing-1/pricing.d.ts +8 -6
- package/dist/components/puck-block/pricing-sections/pricing-1/pricing.js +47 -35
- 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 +151 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.d.ts +26 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.js +71 -0
- package/dist/components/puck-block/pricing-sections/props.d.ts +46 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.d.ts +22 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.js +71 -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 +73 -0
- package/dist/components/puck-block/showcase-sections/case-study-1/case-study.d.ts +6 -2
- package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +30 -28
- package/dist/components/puck-block/showcase-sections/case-study-1/index.js +4 -3
- package/dist/components/puck-block/showcase-sections/props.d.ts +48 -0
- package/dist/components/puck-block/showcase-sections/step-by-step-1/index.js +3 -5
- package/dist/components/puck-block/showcase-sections/step-by-step-1/step-by-step.d.ts +6 -4
- package/dist/components/puck-block/showcase-sections/step-by-step-1/step-by-step.js +38 -41
- package/dist/components/puck-block/team-sections/props.d.ts +39 -0
- package/dist/components/puck-block/team-sections/team-grid-1/index.js +4 -5
- package/dist/components/puck-block/team-sections/team-grid-1/team-grid.d.ts +6 -4
- package/dist/components/puck-block/team-sections/team-grid-1/team-grid.js +27 -41
- 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 +62 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.d.ts +23 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.js +44 -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 +53 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.d.ts +23 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.js +105 -0
- package/dist/components/puck-block/testimonial-sections/customers-1/customers.d.ts +9 -7
- package/dist/components/puck-block/testimonial-sections/customers-1/customers.js +8 -11
- package/dist/components/puck-block/testimonial-sections/customers-1/index.js +17 -17
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/index.js +15 -12
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.d.ts +7 -3
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +34 -24
- 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 +51 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.d.ts +17 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.js +55 -0
- package/dist/components/puck-block/testimonial-sections/props.d.ts +34 -0
- package/dist/components/puck-block/testimonial-sections/review-section-1/index.js +16 -15
- package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.d.ts +8 -6
- package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.js +25 -19
- package/dist/components/puck-block/testimonial-sections/testimonials-1/index.js +17 -17
- package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.d.ts +8 -6
- package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.js +76 -63
- package/dist/components/puck-block/text-sections/articles-1/articles.d.ts +7 -4
- package/dist/components/puck-block/text-sections/articles-1/articles.js +42 -22
- package/dist/components/puck-block/text-sections/articles-1/index.js +31 -19
- package/dist/components/puck-block/text-sections/content-section-1/content-section.d.ts +7 -5
- package/dist/components/puck-block/text-sections/content-section-1/content-section.js +11 -12
- package/dist/components/puck-block/text-sections/content-section-1/index.js +14 -14
- package/dist/components/puck-block/text-sections/props.d.ts +58 -0
- package/dist/components/puck-block/text-sections/rich-text-1/index.js +13 -15
- package/dist/components/puck-block/text-sections/rich-text-1/rich-text.d.ts +7 -5
- package/dist/components/puck-block/text-sections/rich-text-1/rich-text.js +11 -11
- package/dist/components/puck-block/text-sections/tab-section-1/index.js +4 -5
- package/dist/components/puck-block/text-sections/tab-section-1/tab-section.d.ts +6 -4
- package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +6 -7
- package/dist/components/puck-block/text-sections/timeline-1/index.js +3 -5
- package/dist/components/puck-block/text-sections/timeline-1/timeline.d.ts +6 -4
- package/dist/components/puck-block/text-sections/timeline-1/timeline.js +3 -5
- package/dist/components/puck-block/text-sections/two-column-1/index.js +4 -6
- package/dist/components/puck-block/text-sections/two-column-1/two-column.d.ts +6 -4
- package/dist/components/puck-block/text-sections/two-column-1/two-column.js +5 -7
- package/dist/components/shadcn/navigation-menu.d.ts +1 -1
- package/dist/components/shadcn/navigation-menu.js +33 -0
- package/dist/index.js +106 -75
- package/package.json +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
heading,
|
|
41
|
+
description,
|
|
42
|
+
images = [],
|
|
43
|
+
showCaptions = true,
|
|
44
|
+
styles
|
|
45
|
+
}) => {
|
|
46
|
+
const gap = (styles == null ? void 0 : styles.gap) ?? "md";
|
|
47
|
+
const gc = gapClasses[gap] ?? gapClasses.md;
|
|
48
|
+
const [img1, img2, img3, ...rest] = images;
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
CompoundContainer,
|
|
51
|
+
{
|
|
52
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
53
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
54
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
55
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8 lg:gap-12", children: [
|
|
56
|
+
(heading || description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between", children: [
|
|
57
|
+
/* @__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 }) }),
|
|
58
|
+
description && /* @__PURE__ */ jsx("p", { className: "max-w-sm text-base leading-relaxed text-muted-foreground lg:text-right", children: description })
|
|
59
|
+
] }),
|
|
60
|
+
images.length > 0 && /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", gc), children: [
|
|
61
|
+
img1 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
/* @__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(
|
|
63
|
+
ImageCard,
|
|
64
|
+
{
|
|
65
|
+
image: img,
|
|
66
|
+
index: i,
|
|
67
|
+
showCaption: showCaptions,
|
|
68
|
+
className: "h-full"
|
|
69
|
+
}
|
|
70
|
+
) }, i)) }),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: cn("hidden h-[520px] lg:flex", gc), children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
ImageCard,
|
|
74
|
+
{
|
|
75
|
+
image: img1,
|
|
76
|
+
index: 0,
|
|
77
|
+
showCaption: showCaptions,
|
|
78
|
+
className: "basis-[58%] shrink-0"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
(img2 || img3) && /* @__PURE__ */ jsxs("div", { className: cn("flex flex-1 flex-col", gc), children: [
|
|
82
|
+
img2 && /* @__PURE__ */ jsx(
|
|
83
|
+
ImageCard,
|
|
84
|
+
{
|
|
85
|
+
image: img2,
|
|
86
|
+
index: 1,
|
|
87
|
+
showCaption: showCaptions,
|
|
88
|
+
className: "flex-1"
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
img3 && /* @__PURE__ */ jsx(
|
|
92
|
+
ImageCard,
|
|
93
|
+
{
|
|
94
|
+
image: img3,
|
|
95
|
+
index: 2,
|
|
96
|
+
showCaption: showCaptions,
|
|
97
|
+
className: "flex-1"
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] })
|
|
101
|
+
] })
|
|
102
|
+
] }),
|
|
103
|
+
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(
|
|
104
|
+
ImageCard,
|
|
105
|
+
{
|
|
106
|
+
image: img,
|
|
107
|
+
index: idx + 3,
|
|
108
|
+
showCaption: showCaptions,
|
|
109
|
+
className: "h-full"
|
|
110
|
+
}
|
|
111
|
+
) }, idx + 3)) })
|
|
112
|
+
] })
|
|
113
|
+
] })
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
Gallery3
|
|
119
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getPlaceholderImageUrl } from "../../../puck-base/core/fields.js";
|
|
2
|
+
import { Gallery3 } from "./gallery-3.js";
|
|
3
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
4
|
+
const makeDefaultImage = (i) => ({
|
|
5
|
+
src: getPlaceholderImageUrl("1200x800", `Gallery Image ${i + 1}`),
|
|
6
|
+
alt: `Gallery image ${i + 1}`,
|
|
7
|
+
caption: ""
|
|
8
|
+
});
|
|
9
|
+
const conf = {
|
|
10
|
+
fields: {
|
|
11
|
+
heading: {
|
|
12
|
+
type: "text",
|
|
13
|
+
contentEditable: true
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: "textarea",
|
|
17
|
+
contentEditable: true
|
|
18
|
+
},
|
|
19
|
+
images: {
|
|
20
|
+
type: "array",
|
|
21
|
+
max: 9,
|
|
22
|
+
getItemSummary: (item, index = 0) => item.alt || `Image ${index + 1}`,
|
|
23
|
+
arrayFields: {
|
|
24
|
+
src: { type: "image", label: "图片" },
|
|
25
|
+
alt: { type: "text", label: "Alt Text" },
|
|
26
|
+
caption: { type: "text", label: "Caption" }
|
|
27
|
+
},
|
|
28
|
+
defaultItemProps: makeDefaultImage(0)
|
|
29
|
+
},
|
|
30
|
+
showCaptions: {
|
|
31
|
+
type: "radio",
|
|
32
|
+
options: [
|
|
33
|
+
{ label: "显示", value: true },
|
|
34
|
+
{ label: "隐藏", value: false }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
styles: createStylesField({
|
|
38
|
+
gap: {
|
|
39
|
+
type: "radio",
|
|
40
|
+
options: [
|
|
41
|
+
{ label: "紧凑", value: "sm" },
|
|
42
|
+
{ label: "默认", value: "md" },
|
|
43
|
+
{ label: "宽松", value: "lg" }
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
})
|
|
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
|
+
styles: createStylesDefaults({ gap: "md" })
|
|
54
|
+
},
|
|
55
|
+
render: Gallery3
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
conf
|
|
59
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type GalleryVariant = "gallery-1" | "gallery-2" | "gallery-3";
|
|
2
|
+
type GalleryPadding = {
|
|
3
|
+
top?: "none" | "small" | "medium" | "large";
|
|
4
|
+
bottom?: "none" | "small" | "medium" | "large";
|
|
5
|
+
};
|
|
6
|
+
type GallerySectionStyle = "default" | "dark" | "muted" | "inverted" | "custom";
|
|
7
|
+
type GalleryImage = {
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
caption?: string;
|
|
11
|
+
};
|
|
12
|
+
type GallerySectionProps = {
|
|
13
|
+
variant?: GalleryVariant;
|
|
14
|
+
heading?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
images?: GalleryImage[];
|
|
17
|
+
showCaptions?: boolean;
|
|
18
|
+
styles?: {
|
|
19
|
+
padding?: GalleryPadding;
|
|
20
|
+
sectionStyle?: GallerySectionStyle;
|
|
21
|
+
backgroundColor?: string;
|
|
22
|
+
columns?: 2 | 3 | 4;
|
|
23
|
+
gap?: "sm" | "md" | "lg";
|
|
24
|
+
aspectRatio?: "square" | "landscape" | "auto";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -24,10 +24,12 @@ type NavigationItem = NavigationLink & {
|
|
|
24
24
|
};
|
|
25
25
|
export interface HeaderProps extends ILayoutProps {
|
|
26
26
|
companyName: string;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
navigation?: NavigationItem[];
|
|
28
|
+
actions?: SecondaryNavigationItem[];
|
|
29
|
+
styles?: {
|
|
30
|
+
sectionStyle?: "default" | "dark" | "muted" | "inverted";
|
|
31
|
+
backgroundColor?: string;
|
|
32
|
+
};
|
|
31
33
|
}
|
|
32
|
-
export declare const Header: ({ companyName,
|
|
34
|
+
export declare const Header: ({ companyName, navigation, actions, styles, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
35
|
export {};
|
|
@@ -29,24 +29,23 @@ const HEADER_SECTION_VARS = {
|
|
|
29
29
|
};
|
|
30
30
|
const Header = ({
|
|
31
31
|
companyName,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
backgroundColor
|
|
32
|
+
navigation,
|
|
33
|
+
actions,
|
|
34
|
+
styles
|
|
36
35
|
}) => {
|
|
37
36
|
const [isOpen, setOpen] = useState(false);
|
|
38
|
-
const sectionVars = sectionStyle && sectionStyle !== "default" ? HEADER_SECTION_VARS[sectionStyle] ?? {} : {};
|
|
37
|
+
const sectionVars = (styles == null ? void 0 : styles.sectionStyle) && styles.sectionStyle !== "default" ? HEADER_SECTION_VARS[styles.sectionStyle] ?? {} : {};
|
|
39
38
|
return /* @__PURE__ */ jsx(ErrorBoundary, { children: /* @__PURE__ */ jsx(
|
|
40
39
|
"header",
|
|
41
40
|
{
|
|
42
41
|
className: cn("bg-background text-foreground sticky top-0 left-0 z-40 w-full"),
|
|
43
42
|
style: {
|
|
44
|
-
...backgroundColor ? { backgroundColor } : {},
|
|
43
|
+
...(styles == null ? void 0 : styles.backgroundColor) ? { backgroundColor: styles.backgroundColor } : {},
|
|
45
44
|
...sectionVars
|
|
46
45
|
},
|
|
47
46
|
children: /* @__PURE__ */ jsxs("div", { className: "relative container mx-auto flex min-h-20 flex-row items-center gap-4 lg:grid lg:grid-cols-[auto_1fr_auto]", children: [
|
|
48
47
|
/* @__PURE__ */ jsx("div", { className: "flex lg:justify-start", children: /* @__PURE__ */ jsx("p", { className: "font-semibold whitespace-nowrap", children: companyName }) }),
|
|
49
|
-
/* @__PURE__ */ jsx("div", { className: "hidden flex-row items-center justify-center gap-4 lg:flex", children: Array.isArray(
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "hidden flex-row items-center justify-center gap-4 lg:flex", children: Array.isArray(navigation) && navigation.length > 0 ? /* @__PURE__ */ jsx(NavigationMenu, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(NavigationMenuList, { className: "flex flex-row justify-center gap-4", children: navigation.map((item, index) => {
|
|
50
49
|
var _a, _b;
|
|
51
50
|
return /* @__PURE__ */ jsx(NavigationMenuItem, { children: item.url ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(NavigationMenuLink, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
52
51
|
CompoundButton,
|
|
@@ -98,7 +97,7 @@ const Header = ({
|
|
|
98
97
|
] }) })
|
|
99
98
|
] }) }, index);
|
|
100
99
|
}) }) }) : null }),
|
|
101
|
-
/* @__PURE__ */ jsx("div", { className: "flex w-full justify-end gap-4", children:
|
|
100
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-full justify-end gap-4", children: actions == null ? void 0 : actions.map((item, index) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
102
101
|
/* @__PURE__ */ jsx(
|
|
103
102
|
CompoundButton,
|
|
104
103
|
{
|
|
@@ -125,7 +124,7 @@ const Header = ({
|
|
|
125
124
|
children: isOpen ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(Menu, { className: "h-5 w-5" })
|
|
126
125
|
}
|
|
127
126
|
),
|
|
128
|
-
isOpen && /* @__PURE__ */ jsx("div", { className: "bg-background absolute top-20 right-0 container flex w-full flex-col gap-8 border-t py-4 shadow-lg", children:
|
|
127
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: "bg-background absolute top-20 right-0 container flex w-full flex-col gap-8 border-t py-4 shadow-lg", children: navigation == null ? void 0 : navigation.map((item, index) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
129
128
|
item.url ? /* @__PURE__ */ jsxs(
|
|
130
129
|
"a",
|
|
131
130
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentConfig } from "@puckeditor/core";
|
|
2
2
|
import { HeaderProps } from "./header";
|
|
3
3
|
export type { HeaderProps };
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const defaultNavigationItems: ({
|
|
5
5
|
label: string;
|
|
6
6
|
url: string;
|
|
7
7
|
description: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { Header } from "./header.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
3
|
+
import { actionDefaults, button, action } from "../../../puck-base/core/fields.js";
|
|
4
|
+
import { createStylesField } from "../../../puck-base/core/styles.js";
|
|
5
|
+
const defaultNavigationItems = [
|
|
4
6
|
{
|
|
5
7
|
label: "Home",
|
|
6
8
|
url: "/",
|
|
@@ -73,7 +75,7 @@ const defaultPrimaryNavigationItems = [
|
|
|
73
75
|
]
|
|
74
76
|
}
|
|
75
77
|
];
|
|
76
|
-
const
|
|
78
|
+
const defaultActionItems = [
|
|
77
79
|
{
|
|
78
80
|
label: "Book a demo",
|
|
79
81
|
url: "#",
|
|
@@ -105,8 +107,8 @@ const conf = {
|
|
|
105
107
|
label: "company name",
|
|
106
108
|
type: "text"
|
|
107
109
|
},
|
|
108
|
-
|
|
109
|
-
label: "
|
|
110
|
+
navigation: {
|
|
111
|
+
label: "navigation",
|
|
110
112
|
type: "array",
|
|
111
113
|
max: 4,
|
|
112
114
|
getItemSummary: (item, index = 0) => item.label || `Link ${index + 1}`,
|
|
@@ -142,8 +144,8 @@ const conf = {
|
|
|
142
144
|
items: []
|
|
143
145
|
}
|
|
144
146
|
},
|
|
145
|
-
|
|
146
|
-
label: "
|
|
147
|
+
actions: {
|
|
148
|
+
label: "actions",
|
|
147
149
|
type: "array",
|
|
148
150
|
max: 4,
|
|
149
151
|
getItemSummary: (item, index = 0) => item.label || `Link ${index}`,
|
|
@@ -179,13 +181,12 @@ const conf = {
|
|
|
179
181
|
isHiddenOnMobile: "true"
|
|
180
182
|
}
|
|
181
183
|
},
|
|
182
|
-
|
|
183
|
-
backgroundColor
|
|
184
|
+
styles: createStylesField()
|
|
184
185
|
},
|
|
185
186
|
defaultProps: {
|
|
186
187
|
companyName: "TWBlocks",
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
navigation: defaultNavigationItems,
|
|
189
|
+
actions: defaultActionItems,
|
|
189
190
|
__metadata: {
|
|
190
191
|
type: "layout"
|
|
191
192
|
}
|
|
@@ -194,5 +195,5 @@ const conf = {
|
|
|
194
195
|
};
|
|
195
196
|
export {
|
|
196
197
|
conf as default,
|
|
197
|
-
|
|
198
|
+
defaultNavigationItems
|
|
198
199
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type HeaderVariant = "header-1" | "sticky-nav-1";
|
|
2
|
+
type HeaderPadding = {
|
|
3
|
+
top?: "none" | "small" | "medium" | "large";
|
|
4
|
+
bottom?: "none" | "small" | "medium" | "large";
|
|
5
|
+
};
|
|
6
|
+
type HeaderSectionStyle = "default" | "dark" | "muted" | "inverted" | "custom";
|
|
7
|
+
type HeaderButton = {
|
|
8
|
+
label: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
action?: string;
|
|
11
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive";
|
|
12
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
13
|
+
icon?: string;
|
|
14
|
+
divider?: boolean;
|
|
15
|
+
isHiddenOnMobile?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type HeaderNavigationItem = {
|
|
18
|
+
label: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
cta?: HeaderButton;
|
|
22
|
+
items?: Array<{
|
|
23
|
+
label: string;
|
|
24
|
+
url: string;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
type HeaderSectionProps = {
|
|
28
|
+
variant?: HeaderVariant;
|
|
29
|
+
__metadata?: {
|
|
30
|
+
type: "layout";
|
|
31
|
+
};
|
|
32
|
+
companyName?: string;
|
|
33
|
+
logo?: string;
|
|
34
|
+
navigation?: HeaderNavigationItem[];
|
|
35
|
+
actions?: HeaderButton[];
|
|
36
|
+
styles?: {
|
|
37
|
+
padding?: HeaderPadding;
|
|
38
|
+
sectionStyle?: HeaderSectionStyle;
|
|
39
|
+
backgroundColor?: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { backgroundColor, sectionStyle } from "../../../puck-base/core/fields.js";
|
|
2
1
|
import { StickyNav } from "./sticky-nav.js";
|
|
2
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
3
3
|
const conf = {
|
|
4
4
|
fields: {
|
|
5
5
|
logo: { type: "text", contentEditable: true },
|
|
6
|
-
|
|
6
|
+
navigation: {
|
|
7
7
|
type: "array",
|
|
8
8
|
max: 8,
|
|
9
9
|
getItemSummary: (item, i = 0) => item.label || `Link ${i + 1}`,
|
|
10
|
-
arrayFields: { label: { type: "text" },
|
|
11
|
-
defaultItemProps: { label: "Link",
|
|
10
|
+
arrayFields: { label: { type: "text" }, url: { type: "text" } },
|
|
11
|
+
defaultItemProps: { label: "Link", url: "#" }
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
backgroundColor
|
|
13
|
+
styles: createStylesField()
|
|
15
14
|
},
|
|
16
15
|
defaultProps: {
|
|
17
16
|
logo: "Brand",
|
|
18
|
-
|
|
19
|
-
{ label: "Features",
|
|
20
|
-
{ label: "Pricing",
|
|
21
|
-
{ label: "About",
|
|
22
|
-
{ label: "Contact",
|
|
23
|
-
]
|
|
17
|
+
navigation: [
|
|
18
|
+
{ label: "Features", url: "#features" },
|
|
19
|
+
{ label: "Pricing", url: "#pricing" },
|
|
20
|
+
{ label: "About", url: "#about" },
|
|
21
|
+
{ label: "Contact", url: "#contact" }
|
|
22
|
+
],
|
|
23
|
+
styles: createStylesDefaults()
|
|
24
24
|
},
|
|
25
25
|
render: StickyNav
|
|
26
26
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
2
|
export interface StickyNavProps {
|
|
3
|
-
|
|
4
|
-
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
5
|
-
backgroundColor?: string;
|
|
6
|
-
links?: Array<{
|
|
3
|
+
navigation?: Array<{
|
|
7
4
|
label: string;
|
|
8
|
-
|
|
5
|
+
url: string;
|
|
9
6
|
}>;
|
|
10
7
|
logo?: string;
|
|
8
|
+
styles?: {
|
|
9
|
+
padding?: CompoundContainerProps["padding"];
|
|
10
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
};
|
|
11
13
|
}
|
|
12
|
-
export declare const StickyNav: ({
|
|
14
|
+
export declare const StickyNav: ({ navigation, logo, styles }: StickyNavProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -19,22 +19,22 @@ const NAV_SECTION_VARS = {
|
|
|
19
19
|
"--border": "oklch(0.87 0 0)"
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
const StickyNav = ({
|
|
23
|
-
const sectionVars = sectionStyle && sectionStyle !== "default" ? NAV_SECTION_VARS[sectionStyle] ?? {} : {};
|
|
22
|
+
const StickyNav = ({ navigation = [], logo, styles }) => {
|
|
23
|
+
const sectionVars = (styles == null ? void 0 : styles.sectionStyle) && styles.sectionStyle !== "default" ? NAV_SECTION_VARS[styles.sectionStyle] ?? {} : {};
|
|
24
24
|
return /* @__PURE__ */ jsx(
|
|
25
25
|
"nav",
|
|
26
26
|
{
|
|
27
27
|
className: "bg-background/80 border-border sticky top-0 z-50 border-b backdrop-blur-md",
|
|
28
28
|
style: {
|
|
29
|
-
...backgroundColor ? { backgroundColor } : {},
|
|
29
|
+
...(styles == null ? void 0 : styles.backgroundColor) ? { backgroundColor: styles.backgroundColor } : {},
|
|
30
30
|
...sectionVars
|
|
31
31
|
},
|
|
32
32
|
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto flex h-14 max-w-7xl items-center justify-between px-4 sm:px-6 lg:px-8", children: [
|
|
33
33
|
/* @__PURE__ */ jsx("span", { className: "text-foreground text-lg font-bold", children: logo || "Brand" }),
|
|
34
|
-
/* @__PURE__ */ jsx("div", { className: "hidden gap-6 md:flex", children:
|
|
34
|
+
/* @__PURE__ */ jsx("div", { className: "hidden gap-6 md:flex", children: navigation.map((link, i) => /* @__PURE__ */ jsx(
|
|
35
35
|
"a",
|
|
36
36
|
{
|
|
37
|
-
href: link.
|
|
37
|
+
href: link.url || "#",
|
|
38
38
|
className: "text-muted-foreground hover:text-foreground text-sm transition-colors",
|
|
39
39
|
children: link.label
|
|
40
40
|
},
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
2
|
import { CompoundButtonProps } from "@/components/puck-base/button";
|
|
3
3
|
export interface FullscreenHeroProps {
|
|
4
|
-
padding?: CompoundContainerProps["padding"];
|
|
5
|
-
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
6
|
-
backgroundColor?: string;
|
|
7
4
|
heading?: string;
|
|
8
5
|
description?: string;
|
|
9
6
|
badge?: {
|
|
@@ -12,5 +9,15 @@ export interface FullscreenHeroProps {
|
|
|
12
9
|
variant: string;
|
|
13
10
|
};
|
|
14
11
|
buttons?: CompoundButtonProps[];
|
|
12
|
+
backgroundImage?: {
|
|
13
|
+
src: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
} | string;
|
|
16
|
+
styles?: {
|
|
17
|
+
padding?: CompoundContainerProps["padding"];
|
|
18
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
overlay?: "none" | "dark" | "gradient";
|
|
21
|
+
};
|
|
15
22
|
}
|
|
16
|
-
export declare const FullscreenHero: ({
|
|
23
|
+
export declare const FullscreenHero: ({ heading, description, badge, buttons, backgroundImage, styles, }: FullscreenHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +1,69 @@
|
|
|
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
|
-
padding,
|
|
6
|
-
sectionStyle = "dark",
|
|
7
|
-
backgroundColor,
|
|
8
11
|
heading = "",
|
|
9
12
|
description,
|
|
10
13
|
badge,
|
|
11
|
-
buttons
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
buttons,
|
|
15
|
+
backgroundImage,
|
|
16
|
+
styles
|
|
17
|
+
}) => {
|
|
18
|
+
const sectionStyle = (styles == null ? void 0 : styles.sectionStyle) ?? "dark";
|
|
19
|
+
const overlay = (styles == null ? void 0 : styles.overlay) ?? "dark";
|
|
20
|
+
const backgroundColor = styles == null ? void 0 : styles.backgroundColor;
|
|
21
|
+
const padding = styles == null ? void 0 : styles.padding;
|
|
22
|
+
const bgSrc = typeof backgroundImage === "string" ? backgroundImage : backgroundImage == null ? void 0 : backgroundImage.src;
|
|
23
|
+
const bgAlt = typeof backgroundImage === "string" ? "" : (backgroundImage == null ? void 0 : backgroundImage.alt) ?? "";
|
|
24
|
+
if (!bgSrc) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
CompoundContainer,
|
|
27
|
+
{
|
|
28
|
+
padding,
|
|
29
|
+
sectionStyle,
|
|
30
|
+
backgroundColor,
|
|
31
|
+
className: "min-h-[100vh] flex flex-col justify-end",
|
|
32
|
+
children: /* @__PURE__ */ jsx(Content, { badge, heading, description, buttons })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
28
35
|
}
|
|
29
|
-
|
|
36
|
+
const { top = "large", bottom = "large" } = padding ?? {};
|
|
37
|
+
const styleVars = sectionStyle && sectionStyle !== "default" && sectionStyle !== "custom" ? SECTION_STYLE_VARS[sectionStyle] : {};
|
|
38
|
+
return /* @__PURE__ */ jsxs(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: cn(
|
|
42
|
+
"relative w-full min-h-[100vh] flex flex-col justify-end overflow-hidden bg-background text-foreground",
|
|
43
|
+
{ "pt-20 lg:pt-40": top === "large", "pb-20 lg:pb-40": bottom === "large" },
|
|
44
|
+
{ "pt-15 lg:pt-30": top === "medium", "pb-15 lg:pb-30": bottom === "medium" },
|
|
45
|
+
{ "pt-10 lg:pt-20": top === "small", "pb-10 lg:pb-20": bottom === "small" }
|
|
46
|
+
),
|
|
47
|
+
style: { ...styleVars, ...backgroundColor ? { backgroundColor } : {} },
|
|
48
|
+
children: [
|
|
49
|
+
/* @__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" }) }),
|
|
50
|
+
overlay !== "none" && /* @__PURE__ */ jsx("div", { className: cn("absolute inset-0", overlayStyles[overlay] ?? overlayStyles.dark) }),
|
|
51
|
+
/* @__PURE__ */ jsx("div", { className: "container mx-auto relative z-50", children: /* @__PURE__ */ jsx(Content, { badge, heading, description, buttons }) })
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
function Content({ badge, heading, description, buttons }) {
|
|
57
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
|
+
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 }),
|
|
59
|
+
/* @__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 }),
|
|
60
|
+
/* @__PURE__ */ jsx("hr", { className: "w-full my-4 border-foreground/20" }),
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start md:items-end gap-6 mt-4", children: [
|
|
62
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-base leading-relaxed max-w-lg", children: description }),
|
|
63
|
+
buttons && buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex gap-4", children: buttons.map((btn, i) => /* @__PURE__ */ jsx(CompoundButton, { ...btn }, i)) })
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
30
67
|
export {
|
|
31
68
|
FullscreenHero
|
|
32
69
|
};
|