dune-react 0.0.9 → 0.0.11
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 +0 -1
- package/dist/components/puck-base/button.js +5 -4
- package/dist/components/puck-base/card.js +0 -1
- package/dist/components/puck-base/content.js +0 -1
- package/dist/components/puck-base/core/fields.d.ts +2 -150
- package/dist/components/puck-base/core/fields.js +7 -83
- package/dist/components/puck-base/core/styles.d.ts +1946 -0
- package/dist/components/puck-base/core/styles.js +250 -0
- package/dist/components/puck-base/core/with-editable.d.ts +5 -7
- package/dist/components/puck-base/core/with-editable.js +69 -64
- package/dist/components/puck-base/{action-field.d.ts → fields/action-field.d.ts} +1 -1
- package/dist/components/puck-base/{action-field.js → fields/action-field.js} +91 -16
- package/dist/components/puck-base/fields/auto-field.d.ts +0 -1
- package/dist/components/puck-base/fields/auto-field.js +2 -90
- package/dist/components/puck-base/form.js +0 -1
- package/dist/components/puck-base/index.d.ts +1 -1
- package/dist/components/puck-base/navigation-menu.d.ts +18 -0
- package/dist/components/puck-base/navigation-menu.js +202 -0
- 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/contact-us-1/contact-us.d.ts +13 -4
- package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.js +114 -105
- 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 +15 -11
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +27 -22
- package/dist/components/puck-block/contact-sections/contact-us-2/index.js +54 -52
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.d.ts +15 -12
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.js +29 -24
- package/dist/components/puck-block/contact-sections/contact-us-3/index.js +73 -60
- 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 +13 -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 +48 -22
- 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 +35 -32
- package/dist/components/puck-block/cta-sections/promo-section-1/index.js +5 -7
- 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 +93 -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 +44 -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 +6 -4
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.js +4 -6
- package/dist/components/puck-block/faq-sections/faq-2/index.js +4 -5
- 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 +6 -4
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.js +2 -4
- package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +4 -7
- 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 +2 -4
- 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 +2 -4
- 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 +48 -40
- package/dist/components/puck-block/gallery-sections/gallery-1/index.js +33 -35
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.d.ts +6 -4
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +19 -13
- package/dist/components/puck-block/gallery-sections/gallery-2/index.js +4 -6
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.d.ts +7 -5
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.js +5 -7
- package/dist/components/puck-block/gallery-sections/gallery-3/index.js +13 -14
- package/dist/components/puck-block/gallery-sections/props.d.ts +26 -0
- package/dist/components/puck-block/header-sections/header-1/header.d.ts +11 -6
- package/dist/components/puck-block/header-sections/header-1/header.js +34 -28
- 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 +26 -30
- 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 +7 -5
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +19 -5
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +17 -17
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.d.ts +8 -4
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +36 -26
- package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +19 -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 +8 -11
- 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 +6 -8
- 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 +9 -7
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +65 -59
- package/dist/components/puck-block/hero-sections/image-hero-1/index.js +35 -36
- 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/location-sections/location-1/index.js +44 -42
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +8 -6
- package/dist/components/puck-block/location-sections/location-1/location.js +8 -15
- package/dist/components/puck-block/location-sections/location-2/index.js +66 -57
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +12 -6
- package/dist/components/puck-block/location-sections/location-2/location.js +8 -14
- package/dist/components/puck-block/location-sections/location-3/index.js +25 -24
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +10 -6
- package/dist/components/puck-block/location-sections/location-3/location.js +12 -11
- 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.js +4 -7
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.d.ts +6 -4
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +4 -7
- package/dist/components/puck-block/metrics-sections/stats-3/index.js +19 -29
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.d.ts +7 -6
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +22 -13
- 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 -13
- 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.js +7 -12
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.d.ts +6 -4
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.js +60 -57
- 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 +7 -5
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.js +8 -10
- package/dist/components/puck-block/showcase-sections/before-after-1/index.js +6 -8
- 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 +29 -21
- 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 +5 -6
- 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 +23 -17
- package/dist/components/puck-block/team-sections/team-grid-2/index.js +4 -7
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.d.ts +6 -4
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.js +5 -7
- package/dist/components/puck-block/team-sections/team-profiles-1/index.js +4 -5
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.d.ts +6 -4
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.js +5 -7
- 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 +33 -24
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.js +17 -16
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.d.ts +6 -4
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.js +5 -7
- package/dist/components/puck-block/testimonial-sections/props.d.ts +34 -0
- package/dist/components/puck-block/testimonial-sections/review-section-1/index.js +17 -16
- 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 +22 -17
- 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 +100 -67
- package/dist/components/puck-block/text-sections/articles-1/articles.d.ts +7 -5
- package/dist/components/puck-block/text-sections/articles-1/articles.js +41 -34
- package/dist/components/puck-block/text-sections/articles-1/index.js +24 -25
- 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 +6 -9
- package/dist/components/puck-block/text-sections/content-section-1/index.js +14 -16
- 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 +10 -8
- 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.js +8 -33
- package/dist/index.js +3 -2
- package/package.json +2 -2
|
@@ -7,33 +7,42 @@ import { Avatar, AvatarImage, AvatarFallback } from "../../../shadcn/avatar.js";
|
|
|
7
7
|
import { usePrefersReducedMotion } from "../../../../hooks/use-prefers-reduced-motion.js";
|
|
8
8
|
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
9
9
|
const Testimonials = ({
|
|
10
|
-
layout,
|
|
11
|
-
padding,
|
|
12
|
-
sectionStyle,
|
|
13
|
-
backgroundColor,
|
|
14
10
|
heading,
|
|
15
|
-
testimonials
|
|
11
|
+
items: testimonials,
|
|
12
|
+
styles
|
|
16
13
|
}) => {
|
|
17
14
|
var _a;
|
|
18
15
|
const [api, setApi] = useState();
|
|
19
16
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
20
17
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
21
18
|
useEffect(() => {
|
|
22
|
-
if (!api || prefersReducedMotion) {
|
|
19
|
+
if (!api || prefersReducedMotion || (styles == null ? void 0 : styles.layout) === "quote") {
|
|
23
20
|
return;
|
|
24
21
|
}
|
|
25
|
-
setTimeout(() => {
|
|
22
|
+
const timer = setTimeout(() => {
|
|
26
23
|
if (api.selectedScrollSnap() + 1 === api.scrollSnapList().length) {
|
|
27
24
|
setCurrentIndex(0);
|
|
28
25
|
api.scrollTo(0);
|
|
29
26
|
} else {
|
|
30
27
|
api.scrollNext();
|
|
31
|
-
setCurrentIndex(
|
|
28
|
+
setCurrentIndex((prev) => prev + 1);
|
|
32
29
|
}
|
|
33
30
|
}, 4e3);
|
|
34
|
-
|
|
31
|
+
return () => clearTimeout(timer);
|
|
32
|
+
}, [api, currentIndex, prefersReducedMotion, styles == null ? void 0 : styles.layout]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if ((styles == null ? void 0 : styles.layout) !== "quote" || prefersReducedMotion) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const count = (testimonials ?? []).length;
|
|
38
|
+
if (count <= 1) return;
|
|
39
|
+
const timer = setTimeout(() => {
|
|
40
|
+
setCurrentIndex((prev) => (prev + 1) % count);
|
|
41
|
+
}, 5e3);
|
|
42
|
+
return () => clearTimeout(timer);
|
|
43
|
+
}, [currentIndex, prefersReducedMotion, styles == null ? void 0 : styles.layout, testimonials]);
|
|
35
44
|
const items = testimonials ?? [];
|
|
36
|
-
if (layout === "quote") {
|
|
45
|
+
if ((styles == null ? void 0 : styles.layout) === "quote") {
|
|
37
46
|
const safeIndex = items.length > 0 ? currentIndex % items.length : 0;
|
|
38
47
|
const testimonial = items[safeIndex];
|
|
39
48
|
const prev = () => {
|
|
@@ -42,66 +51,90 @@ const Testimonials = ({
|
|
|
42
51
|
const next = () => {
|
|
43
52
|
setCurrentIndex((i) => (i + 1) % items.length);
|
|
44
53
|
};
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
onClick: prev,
|
|
60
|
-
className: "rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors",
|
|
61
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5" })
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
"button",
|
|
66
|
-
{
|
|
67
|
-
onClick: next,
|
|
68
|
-
className: "rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors",
|
|
69
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5" })
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] })
|
|
73
|
-
] }) });
|
|
74
|
-
}
|
|
75
|
-
return /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle, backgroundColor, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-10", children: [
|
|
76
|
-
/* @__PURE__ */ jsx("h2", { className: "font-regular text-start text-3xl tracking-tighter md:text-5xl lg:max-w-xl", children: heading }),
|
|
77
|
-
/* @__PURE__ */ jsx(Carousel, { setApi, className: "w-full", children: /* @__PURE__ */ jsx(CarouselContent, { children: items.map((testimonial, index) => {
|
|
78
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
79
|
-
return /* @__PURE__ */ jsx(CarouselItem, { className: "me-4 lg:basis-1/2", children: /* @__PURE__ */ jsxs("div", { className: "bg-muted flex aspect-video h-full flex-col justify-between rounded-md p-6 lg:col-span-2", children: [
|
|
80
|
-
/* @__PURE__ */ jsx(User, { className: "h-8 w-8 stroke-1" }),
|
|
81
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
82
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
83
|
-
/* @__PURE__ */ jsx("h3", { className: "text-xl tracking-tight", children: testimonial.title }),
|
|
84
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-xs text-base", children: testimonial.quote })
|
|
85
|
-
] }),
|
|
86
|
-
/* @__PURE__ */ jsxs("p", { className: "flex flex-row items-center gap-2 text-sm", children: [
|
|
87
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "By" }),
|
|
88
|
-
" ",
|
|
89
|
-
/* @__PURE__ */ jsxs(Avatar, { className: "h-6 w-6", children: [
|
|
90
|
-
/* @__PURE__ */ jsx(
|
|
91
|
-
AvatarImage,
|
|
92
|
-
{
|
|
93
|
-
src: (_b = (_a2 = testimonial.author) == null ? void 0 : _a2.image) == null ? void 0 : _b.src,
|
|
94
|
-
alt: (_d = (_c = testimonial.author) == null ? void 0 : _c.image) == null ? void 0 : _d.alt
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
/* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(((_e = testimonial.author) == null ? void 0 : _e.name) ?? "") })
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
CompoundContainer,
|
|
56
|
+
{
|
|
57
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
58
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
59
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
60
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center py-12", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium uppercase tracking-widest text-muted-foreground", children: heading }),
|
|
62
|
+
testimonial && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63
|
+
/* @__PURE__ */ jsxs("h2", { className: "font-serif text-2xl font-bold italic md:text-4xl max-w-4xl mx-auto mt-6", children: [
|
|
64
|
+
"“",
|
|
65
|
+
testimonial.quote,
|
|
66
|
+
"”"
|
|
98
67
|
] }),
|
|
99
|
-
/* @__PURE__ */ jsx("
|
|
68
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-4", children: (_a = testimonial.author) == null ? void 0 : _a.name })
|
|
69
|
+
] }),
|
|
70
|
+
items.length > 1 && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-4 mt-8", children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
"button",
|
|
73
|
+
{
|
|
74
|
+
onClick: (e) => {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
prev();
|
|
77
|
+
},
|
|
78
|
+
style: { pointerEvents: "auto" },
|
|
79
|
+
className: "relative z-10 rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors cursor-pointer",
|
|
80
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5", style: { pointerEvents: "none" } })
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
"button",
|
|
85
|
+
{
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
next();
|
|
89
|
+
},
|
|
90
|
+
style: { pointerEvents: "auto" },
|
|
91
|
+
className: "relative z-10 rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors cursor-pointer",
|
|
92
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5", style: { pointerEvents: "none" } })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
100
95
|
] })
|
|
101
96
|
] })
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return /* @__PURE__ */ jsx(
|
|
101
|
+
CompoundContainer,
|
|
102
|
+
{
|
|
103
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
104
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
105
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
106
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-10", children: [
|
|
107
|
+
/* @__PURE__ */ jsx("h2", { className: "font-regular text-start text-3xl tracking-tighter md:text-5xl lg:max-w-xl", children: heading }),
|
|
108
|
+
/* @__PURE__ */ jsx(Carousel, { setApi, className: "w-full", children: /* @__PURE__ */ jsx(CarouselContent, { children: items.map((testimonial, index) => {
|
|
109
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
110
|
+
return /* @__PURE__ */ jsx(CarouselItem, { className: "me-4 lg:basis-1/2", children: /* @__PURE__ */ jsxs("div", { className: "bg-muted flex aspect-video h-full flex-col justify-between rounded-md p-6 lg:col-span-2", children: [
|
|
111
|
+
/* @__PURE__ */ jsx(User, { className: "h-8 w-8 stroke-1" }),
|
|
112
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
114
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl tracking-tight", children: testimonial.title }),
|
|
115
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-xs text-base", children: testimonial.quote })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsxs("p", { className: "flex flex-row items-center gap-2 text-sm", children: [
|
|
118
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "By" }),
|
|
119
|
+
" ",
|
|
120
|
+
/* @__PURE__ */ jsxs(Avatar, { className: "h-6 w-6", children: [
|
|
121
|
+
/* @__PURE__ */ jsx(
|
|
122
|
+
AvatarImage,
|
|
123
|
+
{
|
|
124
|
+
src: (_b = (_a2 = testimonial.author) == null ? void 0 : _a2.image) == null ? void 0 : _b.src,
|
|
125
|
+
alt: (_d = (_c = testimonial.author) == null ? void 0 : _c.image) == null ? void 0 : _d.alt
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(((_e = testimonial.author) == null ? void 0 : _e.name) ?? "") })
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ jsx("span", { children: (_f = testimonial.author) == null ? void 0 : _f.name })
|
|
131
|
+
] })
|
|
132
|
+
] })
|
|
133
|
+
] }) }, index);
|
|
134
|
+
}) }) })
|
|
135
|
+
] })
|
|
136
|
+
}
|
|
137
|
+
);
|
|
105
138
|
};
|
|
106
139
|
function getInitials(name, maxInitials) {
|
|
107
140
|
if (!name) {
|
|
@@ -2,13 +2,15 @@ import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
|
2
2
|
import { CompoundButtonProps } from "@/components/puck-base/button";
|
|
3
3
|
import { PuckComponent, Slot } from "@puckeditor/core";
|
|
4
4
|
export interface ArticlesProps {
|
|
5
|
-
padding?: CompoundContainerProps["padding"];
|
|
6
|
-
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
7
|
-
backgroundColor?: string;
|
|
8
5
|
eyebrow?: string;
|
|
9
6
|
heading?: string;
|
|
10
|
-
|
|
11
|
-
columns?: 2 | 3 | 4;
|
|
7
|
+
buttons?: CompoundButtonProps[];
|
|
12
8
|
cards?: Slot;
|
|
9
|
+
styles?: {
|
|
10
|
+
padding?: CompoundContainerProps["padding"];
|
|
11
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
columns?: 2 | 3 | 4;
|
|
14
|
+
};
|
|
13
15
|
}
|
|
14
16
|
export declare const Articles: PuckComponent<ArticlesProps>;
|
|
@@ -3,43 +3,50 @@ import { CompoundContainer } from "../../../puck-base/container.js";
|
|
|
3
3
|
import { CompoundButton } from "../../../puck-base/button.js";
|
|
4
4
|
import { cn } from "../../../../utils/css-utils.js";
|
|
5
5
|
const Articles = ({
|
|
6
|
-
padding,
|
|
7
|
-
sectionStyle,
|
|
8
|
-
backgroundColor,
|
|
9
6
|
eyebrow,
|
|
10
7
|
heading,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
buttons,
|
|
9
|
+
cards: Cards,
|
|
10
|
+
styles
|
|
14
11
|
}) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
12
|
+
var _a;
|
|
13
|
+
const columns = (styles == null ? void 0 : styles.columns) ?? 3;
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
CompoundContainer,
|
|
16
|
+
{
|
|
17
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
18
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
19
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-10 flex w-full flex-col gap-6 sm:flex-row sm:items-end sm:justify-between", children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
23
|
+
eyebrow && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium tracking-wide uppercase", children: eyebrow }),
|
|
24
|
+
heading && /* @__PURE__ */ jsx("h2", { className: "font-serif font-regular max-w-xl text-3xl tracking-tighter md:text-4xl", children: heading })
|
|
25
|
+
] }),
|
|
26
|
+
((_a = buttons == null ? void 0 : buttons[0]) == null ? void 0 : _a.label) ? /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(
|
|
27
|
+
CompoundButton,
|
|
28
|
+
{
|
|
29
|
+
label: buttons[0].label,
|
|
30
|
+
action: buttons[0].action,
|
|
31
|
+
variant: buttons[0].variant,
|
|
32
|
+
size: buttons[0].size,
|
|
33
|
+
icon: buttons[0].icon
|
|
34
|
+
}
|
|
35
|
+
) }) : null
|
|
36
|
+
] }),
|
|
37
|
+
Cards && /* @__PURE__ */ jsx(
|
|
38
|
+
Cards,
|
|
39
|
+
{
|
|
40
|
+
className: cn("grid grid-cols-1 gap-8", {
|
|
41
|
+
"sm:grid-cols-2": columns === 2,
|
|
42
|
+
"sm:grid-cols-2 lg:grid-cols-3": columns === 3,
|
|
43
|
+
"sm:grid-cols-2 lg:grid-cols-4": columns === 4
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
43
50
|
};
|
|
44
51
|
export {
|
|
45
52
|
Articles
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buttons, heading, image16x9Placeholder, cards } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { Articles } from "./articles.js";
|
|
3
|
-
|
|
4
|
-
label: "",
|
|
5
|
-
url: "",
|
|
6
|
-
variant: "default",
|
|
7
|
-
size: "default",
|
|
8
|
-
icon: "none"
|
|
9
|
-
};
|
|
3
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
10
4
|
const { icon: defaultIcon, ...defaultCardProps } = cards.defaultItemProps;
|
|
11
5
|
const defaultCard = {
|
|
12
6
|
...defaultCardProps,
|
|
@@ -16,38 +10,43 @@ const conf = {
|
|
|
16
10
|
fields: {
|
|
17
11
|
eyebrow: { type: "text", contentEditable: true },
|
|
18
12
|
heading,
|
|
19
|
-
|
|
20
|
-
columns: {
|
|
21
|
-
type: "radio",
|
|
22
|
-
options: [
|
|
23
|
-
{ label: "2", value: 2 },
|
|
24
|
-
{ label: "3", value: 3 },
|
|
25
|
-
{ label: "4", value: 4 }
|
|
26
|
-
]
|
|
27
|
-
},
|
|
13
|
+
buttons,
|
|
28
14
|
cards: {
|
|
29
15
|
type: "slot",
|
|
30
16
|
allow: ["ArticleCard"]
|
|
31
17
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
18
|
+
styles: createStylesField({
|
|
19
|
+
columns: {
|
|
20
|
+
type: "radio",
|
|
21
|
+
options: [
|
|
22
|
+
{ label: "2", value: 2 },
|
|
23
|
+
{ label: "3", value: 3 },
|
|
24
|
+
{ label: "4", value: 4 }
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
})
|
|
35
28
|
},
|
|
36
29
|
defaultProps: {
|
|
37
|
-
padding: paddingDefaults,
|
|
38
30
|
eyebrow: "Latest News",
|
|
39
31
|
heading: "Stories worth reading",
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
buttons: [
|
|
33
|
+
{
|
|
34
|
+
label: "",
|
|
35
|
+
variant: "default",
|
|
36
|
+
size: "default",
|
|
37
|
+
icon: "none"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
42
40
|
cards: Array.from({ length: 3 }).map((_, index) => ({
|
|
43
41
|
type: "ArticleCard",
|
|
44
42
|
props: {
|
|
45
43
|
...defaultCard,
|
|
46
44
|
heading: `Article ${index + 1}`,
|
|
47
45
|
description: "A short summary of this article goes here.",
|
|
48
|
-
button: { label: "",
|
|
46
|
+
button: { label: "", variant: "link", size: "default", icon: "move-right" }
|
|
49
47
|
}
|
|
50
|
-
}))
|
|
48
|
+
})),
|
|
49
|
+
styles: createStylesDefaults({ columns: 3 })
|
|
51
50
|
},
|
|
52
51
|
render: Articles
|
|
53
52
|
};
|
|
@@ -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 ContentSectionProps {
|
|
4
|
-
padding?: CompoundContainerProps["padding"];
|
|
5
|
-
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
6
|
-
backgroundColor?: string;
|
|
7
4
|
heading?: string;
|
|
8
5
|
eyebrow?: string;
|
|
9
6
|
description?: string;
|
|
@@ -14,7 +11,12 @@ export interface ContentSectionProps {
|
|
|
14
11
|
};
|
|
15
12
|
imagePosition?: "left" | "right" | "below" | "none";
|
|
16
13
|
layout?: "centered" | "split" | "prose";
|
|
17
|
-
dividers?: "none" | "both" | "top" | "bottom";
|
|
18
14
|
buttons?: CompoundButtonProps[];
|
|
15
|
+
styles?: {
|
|
16
|
+
padding?: CompoundContainerProps["padding"];
|
|
17
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
18
|
+
backgroundColor?: string;
|
|
19
|
+
dividers?: "none" | "both" | "top" | "bottom";
|
|
20
|
+
};
|
|
19
21
|
}
|
|
20
|
-
export declare const ContentSection: ({
|
|
22
|
+
export declare const ContentSection: ({ heading, eyebrow, description, content, image, imagePosition, layout, buttons, styles, }: ContentSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -27,7 +27,6 @@ const TextBlock = ({
|
|
|
27
27
|
CompoundButton,
|
|
28
28
|
{
|
|
29
29
|
label: button.label,
|
|
30
|
-
url: button.url,
|
|
31
30
|
action: button.action,
|
|
32
31
|
variant: button.variant,
|
|
33
32
|
size: button.size,
|
|
@@ -48,9 +47,6 @@ const ImageBlock = ({ image }) => /* @__PURE__ */ jsx("div", { className: "bg-mu
|
|
|
48
47
|
}
|
|
49
48
|
) : /* @__PURE__ */ jsx("div", { className: "flex aspect-[4/3] w-full items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: "Content Image" }) }) });
|
|
50
49
|
const ContentSection = ({
|
|
51
|
-
padding,
|
|
52
|
-
sectionStyle,
|
|
53
|
-
backgroundColor,
|
|
54
50
|
heading,
|
|
55
51
|
eyebrow,
|
|
56
52
|
description,
|
|
@@ -58,11 +54,12 @@ const ContentSection = ({
|
|
|
58
54
|
image,
|
|
59
55
|
imagePosition = "right",
|
|
60
56
|
layout = "centered",
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
buttons,
|
|
58
|
+
styles
|
|
63
59
|
}) => {
|
|
60
|
+
const dividers = (styles == null ? void 0 : styles.dividers) ?? "none";
|
|
64
61
|
if (layout === "prose") {
|
|
65
|
-
return /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle, backgroundColor, children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl", children: /* @__PURE__ */ jsx(
|
|
62
|
+
return /* @__PURE__ */ jsx(CompoundContainer, { padding: styles == null ? void 0 : styles.padding, sectionStyle: styles == null ? void 0 : styles.sectionStyle, backgroundColor: styles == null ? void 0 : styles.backgroundColor, children: /* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl", children: /* @__PURE__ */ jsx(
|
|
66
63
|
TextBlock,
|
|
67
64
|
{
|
|
68
65
|
eyebrow,
|
|
@@ -76,7 +73,7 @@ const ContentSection = ({
|
|
|
76
73
|
}
|
|
77
74
|
if (layout === "split" || imagePosition === "left" || imagePosition === "right") {
|
|
78
75
|
const showImage2 = imagePosition !== "none" && (image == null ? void 0 : image.src);
|
|
79
|
-
return /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle, backgroundColor, children: /* @__PURE__ */ jsxs(
|
|
76
|
+
return /* @__PURE__ */ jsx(CompoundContainer, { padding: styles == null ? void 0 : styles.padding, sectionStyle: styles == null ? void 0 : styles.sectionStyle, backgroundColor: styles == null ? void 0 : styles.backgroundColor, children: /* @__PURE__ */ jsxs(
|
|
80
77
|
"div",
|
|
81
78
|
{
|
|
82
79
|
className: cn(
|
|
@@ -100,7 +97,7 @@ const ContentSection = ({
|
|
|
100
97
|
) });
|
|
101
98
|
}
|
|
102
99
|
const showImage = imagePosition !== "none" && (image == null ? void 0 : image.src);
|
|
103
|
-
return /* @__PURE__ */ jsxs(CompoundContainer, { padding, sectionStyle, backgroundColor, children: [
|
|
100
|
+
return /* @__PURE__ */ jsxs(CompoundContainer, { padding: styles == null ? void 0 : styles.padding, sectionStyle: styles == null ? void 0 : styles.sectionStyle, backgroundColor: styles == null ? void 0 : styles.backgroundColor, children: [
|
|
104
101
|
(dividers === "both" || dividers === "top") && /* @__PURE__ */ jsx("hr", { className: "mb-12 border-foreground/15" }),
|
|
105
102
|
/* @__PURE__ */ jsx("div", { className: "mx-auto max-w-3xl", children: /* @__PURE__ */ jsx(
|
|
106
103
|
TextBlock,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { image16x9Placeholder, buttons, image } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { ContentSection } from "./content-section.js";
|
|
3
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
3
4
|
const conf = {
|
|
4
5
|
fields: {
|
|
5
6
|
eyebrow: { type: "text" },
|
|
@@ -24,19 +25,18 @@ const conf = {
|
|
|
24
25
|
{ label: "Prose", value: "prose" }
|
|
25
26
|
]
|
|
26
27
|
},
|
|
27
|
-
dividers: {
|
|
28
|
-
type: "radio",
|
|
29
|
-
options: [
|
|
30
|
-
{ label: "None", value: "none" },
|
|
31
|
-
{ label: "Top", value: "top" },
|
|
32
|
-
{ label: "Bottom", value: "bottom" },
|
|
33
|
-
{ label: "Both", value: "both" }
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
28
|
buttons,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
styles: createStylesField({
|
|
30
|
+
dividers: {
|
|
31
|
+
type: "radio",
|
|
32
|
+
options: [
|
|
33
|
+
{ label: "None", value: "none" },
|
|
34
|
+
{ label: "Top", value: "top" },
|
|
35
|
+
{ label: "Bottom", value: "bottom" },
|
|
36
|
+
{ label: "Both", value: "both" }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
40
|
},
|
|
41
41
|
defaultProps: {
|
|
42
42
|
eyebrow: "Why choose us",
|
|
@@ -49,20 +49,18 @@ const conf = {
|
|
|
49
49
|
buttons: [
|
|
50
50
|
{
|
|
51
51
|
label: "Get started",
|
|
52
|
-
url: "#",
|
|
53
52
|
variant: "default",
|
|
54
53
|
size: "lg",
|
|
55
54
|
icon: "none"
|
|
56
55
|
},
|
|
57
56
|
{
|
|
58
57
|
label: "Learn more",
|
|
59
|
-
url: "#",
|
|
60
58
|
variant: "outline",
|
|
61
59
|
size: "lg",
|
|
62
60
|
icon: "none"
|
|
63
61
|
}
|
|
64
62
|
],
|
|
65
|
-
|
|
63
|
+
styles: createStylesDefaults({ dividers: "none" })
|
|
66
64
|
},
|
|
67
65
|
render: ContentSection
|
|
68
66
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
type TextVariant = "articles-1" | "content-section-1" | "rich-text-1" | "tab-section-1" | "timeline-1" | "two-column-1";
|
|
2
|
+
type TextPadding = {
|
|
3
|
+
top?: "none" | "small" | "medium" | "large";
|
|
4
|
+
bottom?: "none" | "small" | "medium" | "large";
|
|
5
|
+
};
|
|
6
|
+
type TextSectionStyle = "default" | "dark" | "muted" | "inverted" | "custom";
|
|
7
|
+
type TextButton = {
|
|
8
|
+
label: string;
|
|
9
|
+
url?: string;
|
|
10
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive";
|
|
11
|
+
size?: "default" | "sm" | "lg" | "icon";
|
|
12
|
+
icon?: string;
|
|
13
|
+
};
|
|
14
|
+
type TextBadge = {
|
|
15
|
+
label: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
variant?: "default" | "secondary" | "destructive" | "outline";
|
|
18
|
+
};
|
|
19
|
+
type TextImage = {
|
|
20
|
+
src: string;
|
|
21
|
+
alt?: string;
|
|
22
|
+
aspectRatio?: "16x9" | "1x1";
|
|
23
|
+
};
|
|
24
|
+
type TextTab = {
|
|
25
|
+
label: string;
|
|
26
|
+
content: string;
|
|
27
|
+
image?: TextImage;
|
|
28
|
+
};
|
|
29
|
+
type TextTimelineItem = {
|
|
30
|
+
title: string;
|
|
31
|
+
description: string;
|
|
32
|
+
date?: string;
|
|
33
|
+
};
|
|
34
|
+
type TextSectionProps = {
|
|
35
|
+
variant?: TextVariant;
|
|
36
|
+
badge?: TextBadge;
|
|
37
|
+
eyebrow?: string;
|
|
38
|
+
heading?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
content?: string;
|
|
41
|
+
buttons?: TextButton[];
|
|
42
|
+
image?: TextImage;
|
|
43
|
+
images?: TextImage[];
|
|
44
|
+
imagePosition?: "left" | "right" | "below" | "none";
|
|
45
|
+
layout?: "centered" | "split" | "prose" | "text-start" | "text-end";
|
|
46
|
+
cards?: unknown;
|
|
47
|
+
tabs?: TextTab[];
|
|
48
|
+
items?: TextTimelineItem[];
|
|
49
|
+
styles?: {
|
|
50
|
+
padding?: TextPadding;
|
|
51
|
+
sectionStyle?: TextSectionStyle;
|
|
52
|
+
backgroundColor?: string;
|
|
53
|
+
columns?: 2 | 3 | 4;
|
|
54
|
+
dividers?: "none" | "both" | "top" | "bottom";
|
|
55
|
+
maxWidth?: "sm" | "md" | "lg" | "full";
|
|
56
|
+
border?: boolean;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { paddingDefaults, backgroundColor, sectionStyle, padding } from "../../../puck-base/core/fields.js";
|
|
2
1
|
import { RichText } from "./rich-text.js";
|
|
2
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
3
3
|
const conf = {
|
|
4
4
|
fields: {
|
|
5
5
|
content: {
|
|
@@ -9,23 +9,21 @@ const conf = {
|
|
|
9
9
|
instructions: "Write rich HTML content with headings, paragraphs, lists, and links."
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
backgroundColor
|
|
12
|
+
styles: createStylesField({
|
|
13
|
+
maxWidth: {
|
|
14
|
+
type: "select",
|
|
15
|
+
options: [
|
|
16
|
+
{ label: "Small", value: "sm" },
|
|
17
|
+
{ label: "Medium", value: "md" },
|
|
18
|
+
{ label: "Large", value: "lg" },
|
|
19
|
+
{ label: "Full Width", value: "full" }
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
})
|
|
24
23
|
},
|
|
25
24
|
defaultProps: {
|
|
26
25
|
content: "<h2>About Us</h2><p>We are a team of passionate builders creating tools that empower everyone to build beautiful websites.</p><p>Our mission is to make web design accessible to everyone.</p>",
|
|
27
|
-
maxWidth: "md"
|
|
28
|
-
padding: paddingDefaults
|
|
26
|
+
styles: createStylesDefaults({ maxWidth: "md" })
|
|
29
27
|
},
|
|
30
28
|
render: RichText
|
|
31
29
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
2
|
export interface RichTextProps {
|
|
3
|
-
padding?: CompoundContainerProps["padding"];
|
|
4
|
-
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
5
|
-
backgroundColor?: string;
|
|
6
3
|
content?: string;
|
|
7
|
-
|
|
4
|
+
styles?: {
|
|
5
|
+
padding?: CompoundContainerProps["padding"];
|
|
6
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
maxWidth?: "sm" | "md" | "lg" | "full";
|
|
9
|
+
};
|
|
8
10
|
}
|
|
9
|
-
export declare const RichText: ({
|
|
11
|
+
export declare const RichText: ({ content, styles, }: RichTextProps) => import("react/jsx-runtime").JSX.Element;
|