dune-react 0.0.22 → 0.0.24
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/image.js +1 -1
- package/dist/components/puck-block/banner-sections/css-marquee-banner/css-marquee-banner.js +13 -13
- package/dist/components/puck-block/banner-sections/dual-row-marquee/dual-row-marquee.js +77 -53
- package/dist/components/puck-block/banner-sections/scroll-driven-marquee/scroll-driven-marquee.js +8 -6
- package/dist/components/puck-block/banner-sections/scroll-parallax-text/scroll-parallax-text.js +3 -1
- package/dist/components/puck-block/contact-sections/contact-cards-grid/contact-cards-grid.js +1 -1
- package/dist/components/puck-block/contact-sections/form-with-media/form-with-media.js +1 -1
- package/dist/components/puck-block/contact-sections/header-form-cards/header-form-cards.js +1 -1
- package/dist/components/puck-block/contact-sections/header-info-fullwidth/header-info-fullwidth.js +2 -2
- package/dist/components/puck-block/contact-sections/info-cards-media/info-cards-media.js +2 -2
- package/dist/components/puck-block/contact-sections/split-info-form/split-info-form.js +1 -1
- package/dist/components/puck-block/contact-sections/tab-locations/tab-locations.js +71 -55
- package/dist/components/puck-block/cta-sections/mouse-track-cta/mouse-track-cta.js +4 -4
- package/dist/components/puck-block/cta-sections/side-media-cta/side-media-cta.js +1 -1
- package/dist/components/puck-block/cta-sections/text-block-cta/text-block-cta.js +2 -2
- package/dist/components/puck-block/feature-sections/feature-cards-grid/component.js +1 -1
- package/dist/components/puck-block/feature-sections/feature-list-split/component.js +1 -1
- package/dist/components/puck-block/feature-sections/tab-feature/component.js +4 -4
- package/dist/components/puck-block/feature-sections/text-media-split/component.js +1 -1
- package/dist/components/puck-block/footer-sections/centered-minimal-footer/centered-minimal-footer.js +72 -18
- package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.d.ts +79 -0
- package/dist/components/puck-block/footer-sections/centered-minimal-footer/index.js +43 -1
- package/dist/components/puck-block/footer-sections/compact-newsletter-footer/index.d.ts +41 -0
- package/dist/components/puck-block/footer-sections/contact-links-footer/contact-links-footer.js +4 -3
- package/dist/components/puck-block/footer-sections/contact-links-footer/index.d.ts +86 -0
- package/dist/components/puck-block/footer-sections/contact-links-footer/index.js +1 -1
- package/dist/components/puck-block/footer-sections/cta-links-footer/cta-links-footer.js +3 -2
- package/dist/components/puck-block/footer-sections/cta-links-footer/index.d.ts +37 -0
- package/dist/components/puck-block/footer-sections/cta-links-footer/index.js +1 -1
- package/dist/components/puck-block/footer-sections/links-newsletter-footer/index.d.ts +54 -0
- package/dist/components/puck-block/footer-sections/newsletter-links-footer/index.d.ts +41 -0
- package/dist/components/puck-block/footer-sections/newsletter-top-links-footer/index.d.ts +54 -0
- package/dist/components/puck-block/footer-sections/props.d.ts +3 -0
- package/dist/components/puck-block/gallery-sections/fullscreen-portfolio/fullscreen-portfolio.js +1 -1
- package/dist/components/puck-block/gallery-sections/image-carousel/index.d.ts +14 -1
- package/dist/components/puck-block/gallery-sections/interactive-portfolio/interactive-portfolio.js +166 -105
- package/dist/components/puck-block/gallery-sections/masonry-grid/index.d.ts +17 -1
- package/dist/components/puck-block/gallery-sections/masonry-grid/masonry-grid.js +56 -31
- package/dist/components/puck-block/gallery-sections/portfolio-cards/index.d.ts +17 -1
- package/dist/components/puck-block/gallery-sections/portfolio-cards/portfolio-cards.js +41 -13
- package/dist/components/puck-block/gallery-sections/portfolio-divider/portfolio-divider.js +1 -1
- package/dist/components/puck-block/gallery-sections/props.d.ts +42 -3
- package/dist/components/puck-block/gallery-sections/props.js +24 -6
- package/dist/components/puck-block/gallery-sections/scroll-parallax/scroll-parallax.js +71 -22
- package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/scroll-parallax-portfolio.js +284 -159
- package/dist/components/puck-block/gallery-sections/split-carousel/index.d.ts +11 -1
- package/dist/components/puck-block/gallery-sections/static-grid/index.d.ts +17 -1
- package/dist/components/puck-block/header-sections/centered-navbar/centered-navbar.js +95 -14
- package/dist/components/puck-block/header-sections/drawer-navbar/drawer-navbar.js +4 -3
- package/dist/components/puck-block/header-sections/floating-bordered-navbar/floating-bordered-navbar.js +5 -4
- package/dist/components/puck-block/header-sections/fullscreen-overlay-navbar/fullscreen-overlay-navbar.js +4 -3
- package/dist/components/puck-block/header-sections/mega-menu-navbar/mega-menu-navbar.js +3 -2
- package/dist/components/puck-block/header-sections/props.d.ts +3 -0
- package/dist/components/puck-block/header-sections/standard-navbar/standard-navbar.js +3 -2
- package/dist/components/puck-block/hero-sections/carousel-hero/component.js +3 -3
- package/dist/components/puck-block/hero-sections/column-scroll-hero/component.js +8 -8
- package/dist/components/puck-block/hero-sections/dual-marquee-hero/component.js +6 -6
- package/dist/components/puck-block/hero-sections/fullscreen-video-hero/component.js +1 -1
- package/dist/components/puck-block/hero-sections/grid-expand-hero/component.js +26 -17
- package/dist/components/puck-block/hero-sections/grid-expand-hero/index.d.ts +17 -1
- package/dist/components/puck-block/hero-sections/horizontal-marquee-hero/component.js +3 -3
- package/dist/components/puck-block/hero-sections/inline-image-hero/inline-image-hero.js +59 -28
- package/dist/components/puck-block/hero-sections/mouse-track-hero/component.js +60 -19
- package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.d.ts +17 -1
- package/dist/components/puck-block/hero-sections/multi-image-grid-hero/multi-image-grid-hero.js +2 -2
- package/dist/components/puck-block/hero-sections/overlapping-image-hero/overlapping-image-hero.js +3 -3
- package/dist/components/puck-block/hero-sections/parallax-images-hero/component.js +18 -6
- package/dist/components/puck-block/hero-sections/props.d.ts +34 -2
- package/dist/components/puck-block/hero-sections/props.js +18 -4
- package/dist/components/puck-block/hero-sections/scatter-parallax-hero/component.js +9 -7
- package/dist/components/puck-block/hero-sections/scroll-expand-video-hero/component.js +7 -5
- package/dist/components/puck-block/hero-sections/scroll-zoom-hero/component.js +5 -3
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/component.js +1 -1
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.d.ts +13 -5
- package/dist/components/puck-block/hero-sections/sticky-expand-hero/index.js +2 -2
- package/dist/components/puck-block/hero-sections/sticky-video-hero/component.js +2 -2
- package/dist/components/puck-block/hero-sections/tab-hero/component.js +5 -5
- package/dist/components/puck-block/hero-sections/three-image-parallax-hero/component.js +3 -3
- package/dist/components/puck-block/hero-sections/vertical-gallery-hero/component.js +6 -6
- package/dist/components/puck-block/hero-sections/zoom-grid-hero/component.js +14 -12
- package/dist/components/puck-block/index.d.ts +1 -0
- package/dist/components/puck-block/location-sections/index.d.ts +3 -0
- package/dist/components/puck-block/location-sections/location-1/index.js +102 -0
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +0 -3
- package/dist/components/puck-block/location-sections/location-1/location.js +139 -0
- package/dist/components/puck-block/location-sections/location-2/index.js +126 -0
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +0 -3
- package/dist/components/puck-block/location-sections/location-2/location.js +133 -0
- package/dist/components/puck-block/location-sections/location-3/index.js +109 -0
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +0 -3
- package/dist/components/puck-block/location-sections/location-3/location.js +140 -0
- package/dist/components/puck-block/location-sections/props.d.ts +0 -3
- package/dist/components/puck-block/metrics-sections/center-media-stats/center-media-stats.js +1 -1
- package/dist/components/puck-block/metrics-sections/header-stats-row/header-stats-row.js +1 -1
- package/dist/components/puck-block/metrics-sections/mixed-grid-stats/mixed-grid-stats.js +2 -2
- package/dist/components/puck-block/metrics-sections/split-stats/split-stats.js +1 -1
- package/dist/components/puck-block/metrics-sections/tab-stats/tab-stats.js +4 -4
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/component.js +134 -33
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.d.ts +47 -0
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/index.js +34 -0
- package/dist/components/puck-block/pricing-sections/split-pricing/component.js +3 -3
- package/dist/components/puck-block/pricing-sections/tab-pricing-grid/component.js +86 -40
- package/dist/components/puck-block/pricing-sections/tab-single-pricing/component.js +1 -1
- package/dist/components/puck-block/registry.generated.d.ts +501 -12
- package/dist/components/puck-block/registry.generated.js +157 -138
- package/dist/components/puck-block/showcase-sections/tab-timeline/component.js +2 -2
- package/dist/components/puck-block/testimonial-sections/bento-testimonial/component.js +157 -83
- package/dist/components/puck-block/testimonial-sections/centered-testimonial/component.js +71 -28
- package/dist/components/puck-block/testimonial-sections/image-testimonial/component.js +66 -29
- package/dist/components/puck-block/testimonial-sections/image-testimonial-carousel/component.js +1 -1
- package/dist/components/puck-block/testimonial-sections/tab-testimonial/component.js +6 -6
- package/dist/components/puck-block/testimonial-sections/testimonial-card-grid/component.js +2 -2
- package/dist/components/puck-block/testimonial-sections/testimonial-carousel/component.js +1 -1
- package/dist/components/puck-block/text-sections/prose-content/component.js +1 -1
- package/dist/components/puck-block/text-sections/side-media-content/component.js +1 -1
- package/dist/components/puck-block/text-sections/sticky-text-multi-image/component.js +3 -3
- package/dist/components/puck-core/core/props/form.js +25 -1
- package/dist/components/puck-core/core/props/media.js +6 -1
- package/dist/components/puck-core/fields/array-field.d.ts +7 -0
- package/dist/components/puck-core/fields/array-field.js +229 -0
- package/dist/components/puck-core/fields/auto-field.js +11 -0
- package/dist/components/puck-core/fields/image-upload-field.js +1 -1
- package/dist/components/puck-core/fields/index.d.ts +1 -0
- package/dist/components/puck-core/fields/location-field.js +4 -1
- package/dist/components/puck-core/fields/object-field.js +1 -1
- package/dist/index.js +6 -0
- package/dist/node_modules/.pnpm/@dnd-kit_accessibility@3.1.1_react@19.2.4/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +59 -0
- package/dist/node_modules/.pnpm/@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@dnd-kit/core/dist/core.esm.js +3093 -0
- package/dist/node_modules/.pnpm/@dnd-kit_sortable@10.0.0_@dnd-kit_core@6.3.1_react-dom@19.2.4_react@19.2.4__react@19.2.4__react@19.2.4/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +592 -0
- package/dist/node_modules/.pnpm/@dnd-kit_utilities@3.2.2_react@19.2.4/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +301 -0
- package/package.json +7 -1
|
@@ -91,14 +91,22 @@ declare const conf: {
|
|
|
91
91
|
readonly instructions: "Buttons must use the same size";
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
|
|
95
|
-
type: "
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
alt
|
|
94
|
+
images: {
|
|
95
|
+
readonly type: "array";
|
|
96
|
+
readonly max: 10;
|
|
97
|
+
readonly getItemSummary: (item: {
|
|
98
|
+
alt?: string;
|
|
99
|
+
}, index?: number) => string;
|
|
100
|
+
readonly arrayFields: {
|
|
101
|
+
readonly src: import("@puckeditor/core").Field<string>;
|
|
102
|
+
readonly alt: {
|
|
99
103
|
type: "text";
|
|
100
104
|
};
|
|
101
105
|
};
|
|
106
|
+
readonly defaultItemProps: {
|
|
107
|
+
alt: string;
|
|
108
|
+
src: string;
|
|
109
|
+
};
|
|
102
110
|
};
|
|
103
111
|
};
|
|
104
112
|
defaultProps: StickyExpandHeroProps;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { StickyExpandHero, StickyExpandHeroDefaults } from "./component.js";
|
|
2
2
|
import { descriptionField, headingField } from "../../../puck-core/core/props/content.js";
|
|
3
3
|
import { buttonsField } from "../../../puck-core/core/props/interactive.js";
|
|
4
|
-
import {
|
|
4
|
+
import { imagesField } from "../../../puck-core/core/props/media.js";
|
|
5
5
|
const conf = {
|
|
6
6
|
fields: {
|
|
7
7
|
heading: headingField,
|
|
8
8
|
description: descriptionField,
|
|
9
9
|
buttons: buttonsField,
|
|
10
|
-
|
|
10
|
+
images: imagesField
|
|
11
11
|
},
|
|
12
12
|
defaultProps: StickyExpandHeroDefaults,
|
|
13
13
|
render: StickyExpandHero
|
|
@@ -208,11 +208,11 @@ const StickyVideoHeroDefaults = {
|
|
|
208
208
|
video: "https://www.youtube.com/embed/8DKLYsikxTs?si=Ch9W0KrDWWUiCMMW",
|
|
209
209
|
images: [{
|
|
210
210
|
src: "https://picsum.photos/seed/hero-video/1200/800",
|
|
211
|
-
alt: "
|
|
211
|
+
alt: "Placeholder image"
|
|
212
212
|
}],
|
|
213
213
|
videoImage: {
|
|
214
214
|
src: "https://picsum.photos/seed/hero-video/1200/800",
|
|
215
|
-
alt: "
|
|
215
|
+
alt: "Placeholder image"
|
|
216
216
|
},
|
|
217
217
|
styles: { variant: "centered" }
|
|
218
218
|
};
|
|
@@ -31,7 +31,7 @@ const TabHero = (props) => {
|
|
|
31
31
|
{
|
|
32
32
|
value: trigger.value,
|
|
33
33
|
onClick: () => setActiveTab(trigger.value),
|
|
34
|
-
className: "relative flex-1 whitespace-
|
|
34
|
+
className: "relative flex-1 whitespace-nowrap border-0 bg-transparent px-4 py-4 text-center text-neutral-light duration-0 data-[state=active]:bg-transparent data-[state=active]:text-neutral-white sm:px-8 md:min-w-32",
|
|
35
35
|
children: [
|
|
36
36
|
/* @__PURE__ */ jsx("span", { children: trigger.text }),
|
|
37
37
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 top-auto h-1 w-full bg-white/20", children: /* @__PURE__ */ jsx(
|
|
@@ -108,7 +108,7 @@ const TabHeroDefaults = {
|
|
|
108
108
|
buttons: [{ label: "Button" }, { label: "Button", variant: "secondary" }],
|
|
109
109
|
image: {
|
|
110
110
|
src: "https://picsum.photos/seed/hero-landscape/1200/800",
|
|
111
|
-
alt: "
|
|
111
|
+
alt: "Placeholder image 1"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
{
|
|
@@ -118,7 +118,7 @@ const TabHeroDefaults = {
|
|
|
118
118
|
buttons: [{ label: "Button" }, { label: "Button", variant: "secondary" }],
|
|
119
119
|
image: {
|
|
120
120
|
src: "https://picsum.photos/seed/hero-landscape/1200/800",
|
|
121
|
-
alt: "
|
|
121
|
+
alt: "Placeholder image 2"
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
{
|
|
@@ -128,7 +128,7 @@ const TabHeroDefaults = {
|
|
|
128
128
|
buttons: [{ label: "Button" }, { label: "Button", variant: "secondary" }],
|
|
129
129
|
image: {
|
|
130
130
|
src: "https://picsum.photos/seed/hero-landscape/1200/800",
|
|
131
|
-
alt: "
|
|
131
|
+
alt: "Placeholder image 3"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
{
|
|
@@ -138,7 +138,7 @@ const TabHeroDefaults = {
|
|
|
138
138
|
buttons: [{ label: "Button" }, { label: "Button", variant: "secondary" }],
|
|
139
139
|
image: {
|
|
140
140
|
src: "https://picsum.photos/seed/hero-landscape/1200/800",
|
|
141
|
-
alt: "
|
|
141
|
+
alt: "Placeholder image 4"
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
]
|
|
@@ -159,15 +159,15 @@ const ThreeImageParallaxHeroDefaults = {
|
|
|
159
159
|
buttons: [{ label: "Button" }, { label: "Button", variant: "secondary" }],
|
|
160
160
|
imageLeft: {
|
|
161
161
|
src: "https://picsum.photos/seed/hero-portrait/800/1200",
|
|
162
|
-
alt: "
|
|
162
|
+
alt: "Placeholder image 1"
|
|
163
163
|
},
|
|
164
164
|
imageCenter: {
|
|
165
165
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
166
|
-
alt: "
|
|
166
|
+
alt: "Placeholder image 2"
|
|
167
167
|
},
|
|
168
168
|
imageRight: {
|
|
169
169
|
src: "https://picsum.photos/seed/hero-portrait/800/1200",
|
|
170
|
-
alt: "
|
|
170
|
+
alt: "Placeholder image 3"
|
|
171
171
|
},
|
|
172
172
|
styles: {
|
|
173
173
|
textAlign: "left",
|
|
@@ -74,27 +74,27 @@ const VerticalGalleryHeroDefaults = {
|
|
|
74
74
|
images: [
|
|
75
75
|
{
|
|
76
76
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
77
|
-
alt: "
|
|
77
|
+
alt: "Placeholder image 1"
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
81
|
-
alt: "
|
|
81
|
+
alt: "Placeholder image 2"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
85
|
-
alt: "
|
|
85
|
+
alt: "Placeholder image 3"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
89
|
-
alt: "
|
|
89
|
+
alt: "Placeholder image 4"
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
92
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
93
|
-
alt: "
|
|
93
|
+
alt: "Placeholder image 5"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
97
|
-
alt: "
|
|
97
|
+
alt: "Placeholder image 6"
|
|
98
98
|
}
|
|
99
99
|
]
|
|
100
100
|
};
|
|
@@ -6,6 +6,7 @@ import { CompoundButton } from "../../../puck-base/button.js";
|
|
|
6
6
|
import { CompoundImage } from "../../../puck-base/image.js";
|
|
7
7
|
import { SectionWrapper } from "../../../puck-core/section-wrapper.js";
|
|
8
8
|
import { useScrollContainer } from "../../../../hooks/use-scroll-container.js";
|
|
9
|
+
import { useEditorContext } from "../../../puck-core/core/context/editor-context.js";
|
|
9
10
|
import { useScroll, useTransform, motion } from "framer-motion";
|
|
10
11
|
const ZoomGridHero = (props) => {
|
|
11
12
|
const { heading, description, buttons = [], images = [], styles } = {
|
|
@@ -13,6 +14,7 @@ const ZoomGridHero = (props) => {
|
|
|
13
14
|
...props
|
|
14
15
|
};
|
|
15
16
|
const { className: sectionClassName, style: sectionStyle, css } = styles ?? {};
|
|
17
|
+
const { isEditor } = useEditorContext();
|
|
16
18
|
const sectionRef = useRef(null);
|
|
17
19
|
const [scrollContainerRef] = useScrollContainer(sectionRef);
|
|
18
20
|
const { scrollYProgress } = useScroll(
|
|
@@ -26,7 +28,7 @@ const ZoomGridHero = (props) => {
|
|
|
26
28
|
motion.div,
|
|
27
29
|
{
|
|
28
30
|
className: "flex h-full items-center justify-center",
|
|
29
|
-
style: { opacity: opacityContent },
|
|
31
|
+
style: { opacity: isEditor ? 1 : opacityContent },
|
|
30
32
|
children: /* @__PURE__ */ jsx("div", { className: "px-[5%] py-8 md:py-12 lg:py-14", children: /* @__PURE__ */ jsxs("div", { className: "relative z-10 mx-auto max-w-lg text-center", children: [
|
|
31
33
|
/* @__PURE__ */ jsx("h1", { className: "mb-5 text-6xl font-bold text-text-alternative md:mb-6 md:text-9xl lg:text-10xl", children: heading }),
|
|
32
34
|
/* @__PURE__ */ jsx("p", { className: "text-text-alternative md:text-md", children: description }),
|
|
@@ -39,13 +41,13 @@ const ZoomGridHero = (props) => {
|
|
|
39
41
|
motion.div,
|
|
40
42
|
{
|
|
41
43
|
className: "absolute inset-0 z-10 bg-black/50",
|
|
42
|
-
style: { opacity: opacityOverlay }
|
|
44
|
+
style: { opacity: isEditor ? 0 : opacityOverlay }
|
|
43
45
|
}
|
|
44
46
|
),
|
|
45
47
|
/* @__PURE__ */ jsx(
|
|
46
48
|
motion.div,
|
|
47
49
|
{
|
|
48
|
-
style: { scale },
|
|
50
|
+
style: { scale: isEditor ? 1 : scale },
|
|
49
51
|
className: "grid size-full auto-cols-fr grid-cols-1 gap-x-4 gap-y-4 md:grid-cols-3",
|
|
50
52
|
children: images.map((image, index) => /* @__PURE__ */ jsx(
|
|
51
53
|
"div",
|
|
@@ -77,39 +79,39 @@ const ZoomGridHeroDefaults = {
|
|
|
77
79
|
images: [
|
|
78
80
|
{
|
|
79
81
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
80
|
-
alt: "
|
|
82
|
+
alt: "Placeholder image 1"
|
|
81
83
|
},
|
|
82
84
|
{
|
|
83
85
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
84
|
-
alt: "
|
|
86
|
+
alt: "Placeholder image 2"
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
88
|
-
alt: "
|
|
90
|
+
alt: "Placeholder image 3"
|
|
89
91
|
},
|
|
90
92
|
{
|
|
91
93
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
92
|
-
alt: "
|
|
94
|
+
alt: "Placeholder image 4"
|
|
93
95
|
},
|
|
94
96
|
{
|
|
95
97
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
96
|
-
alt: "
|
|
98
|
+
alt: "Placeholder image 5"
|
|
97
99
|
},
|
|
98
100
|
{
|
|
99
101
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
100
|
-
alt: "
|
|
102
|
+
alt: "Placeholder image 6"
|
|
101
103
|
},
|
|
102
104
|
{
|
|
103
105
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
104
|
-
alt: "
|
|
106
|
+
alt: "Placeholder image 7"
|
|
105
107
|
},
|
|
106
108
|
{
|
|
107
109
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
108
|
-
alt: "
|
|
110
|
+
alt: "Placeholder image 8"
|
|
109
111
|
},
|
|
110
112
|
{
|
|
111
113
|
src: "https://picsum.photos/seed/hero-square/1200/1200",
|
|
112
|
-
alt: "
|
|
114
|
+
alt: "Placeholder image 9"
|
|
113
115
|
}
|
|
114
116
|
]
|
|
115
117
|
};
|
|
@@ -13,5 +13,6 @@ export * from "./text-sections";
|
|
|
13
13
|
export * from "./showcase-sections";
|
|
14
14
|
export * from "./team-sections";
|
|
15
15
|
export * from "./footer-sections";
|
|
16
|
+
export * from "./location-sections";
|
|
16
17
|
export { confMap, categories, sectionsMap, buildComponents, getComponentDefaultProps } from "./registry.generated";
|
|
17
18
|
export type { ComponentName, ComponentProps } from "./registry.generated";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { LocationSection } from "./location.js";
|
|
2
|
+
import { locationDefaults, locationField } from "../../../puck-core/core/props/form.js";
|
|
3
|
+
import { buttonField } from "../../../puck-core/core/props/interactive.js";
|
|
4
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-core/core/styles.js";
|
|
5
|
+
const locationButtonFields = {
|
|
6
|
+
...buttonField.objectFields,
|
|
7
|
+
colorMode: {
|
|
8
|
+
type: "select",
|
|
9
|
+
options: [
|
|
10
|
+
{ label: "Theme", value: "theme" },
|
|
11
|
+
{ label: "Custom", value: "custom" }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
backgroundColor: { type: "text" },
|
|
15
|
+
textColor: { type: "text" }
|
|
16
|
+
};
|
|
17
|
+
const locationButtonDefaults = {
|
|
18
|
+
label: "Button",
|
|
19
|
+
variant: "default",
|
|
20
|
+
size: "default",
|
|
21
|
+
icon: "none",
|
|
22
|
+
colorMode: "theme"
|
|
23
|
+
};
|
|
24
|
+
const conf = {
|
|
25
|
+
fields: {
|
|
26
|
+
heading: { type: "textarea", contentEditable: true },
|
|
27
|
+
description: { type: "textarea", contentEditable: true },
|
|
28
|
+
contentAlign: {
|
|
29
|
+
type: "radio",
|
|
30
|
+
label: "Text Align",
|
|
31
|
+
options: [
|
|
32
|
+
{ label: "Left", value: "left" },
|
|
33
|
+
{ label: "Right", value: "right" }
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
contentPosition: {
|
|
37
|
+
type: "radio",
|
|
38
|
+
label: "Layout",
|
|
39
|
+
options: [
|
|
40
|
+
{ label: "Text Left / Map Right", value: "left" },
|
|
41
|
+
{ label: "Map Left / Text Right", value: "right" }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
location: locationField,
|
|
45
|
+
mapStyle: {
|
|
46
|
+
type: "radio",
|
|
47
|
+
label: "Map Style",
|
|
48
|
+
options: [
|
|
49
|
+
{ label: "Default", value: "default" },
|
|
50
|
+
{ label: "Grayscale", value: "grayscale" },
|
|
51
|
+
{ label: "Dark", value: "dark" }
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
mapTint: {
|
|
55
|
+
type: "radio",
|
|
56
|
+
label: "Map Tint",
|
|
57
|
+
options: [
|
|
58
|
+
{ label: "Theme", value: "theme" },
|
|
59
|
+
{ label: "None", value: "none" }
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
buttons: {
|
|
63
|
+
type: "array",
|
|
64
|
+
max: 3,
|
|
65
|
+
getItemSummary: (item, index = 0) => item.label || `Button ${index + 1}`,
|
|
66
|
+
arrayFields: locationButtonFields,
|
|
67
|
+
defaultItemProps: locationButtonDefaults
|
|
68
|
+
},
|
|
69
|
+
styles: createStylesField()
|
|
70
|
+
},
|
|
71
|
+
defaultProps: {
|
|
72
|
+
heading: "Our Offices",
|
|
73
|
+
description: "We have offices around the globe. Visit us or get in touch with a local team near you.",
|
|
74
|
+
contentAlign: "left",
|
|
75
|
+
contentPosition: "left",
|
|
76
|
+
location: locationDefaults,
|
|
77
|
+
mapStyle: "grayscale",
|
|
78
|
+
mapTint: "theme",
|
|
79
|
+
buttons: [
|
|
80
|
+
{
|
|
81
|
+
label: "Contact us",
|
|
82
|
+
variant: "default",
|
|
83
|
+
size: "default",
|
|
84
|
+
icon: "none",
|
|
85
|
+
colorMode: "theme"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: "Get directions",
|
|
89
|
+
variant: "secondary",
|
|
90
|
+
size: "default",
|
|
91
|
+
icon: "none",
|
|
92
|
+
colorMode: "theme"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
styles: createStylesDefaults()
|
|
96
|
+
},
|
|
97
|
+
render: LocationSection
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
conf,
|
|
101
|
+
conf as default
|
|
102
|
+
};
|
|
@@ -18,9 +18,6 @@ export interface LocationSectionProps {
|
|
|
18
18
|
mapTint?: "none" | "theme";
|
|
19
19
|
buttons?: LocationButton[];
|
|
20
20
|
styles?: {
|
|
21
|
-
className?: string;
|
|
22
|
-
style?: Record<string, unknown>;
|
|
23
|
-
css?: string;
|
|
24
21
|
padding?: CompoundContainerProps["padding"];
|
|
25
22
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
26
23
|
backgroundColor?: string;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CompoundContainer } from "../../../puck-base/container.js";
|
|
3
|
+
import { CompoundButton } from "../../../puck-base/button.js";
|
|
4
|
+
import { cn } from "../../../../utils/css-utils.js";
|
|
5
|
+
import { getMapEmbedUrl } from "../../../puck-core/core/props/form.js";
|
|
6
|
+
const LocationActionButton = ({
|
|
7
|
+
label,
|
|
8
|
+
url,
|
|
9
|
+
action,
|
|
10
|
+
variant = "default",
|
|
11
|
+
size = "default",
|
|
12
|
+
icon = "none",
|
|
13
|
+
colorMode = "theme",
|
|
14
|
+
backgroundColor,
|
|
15
|
+
textColor
|
|
16
|
+
}) => {
|
|
17
|
+
if (!label) return null;
|
|
18
|
+
const useCustomColors = colorMode === "custom";
|
|
19
|
+
const styleVars = {
|
|
20
|
+
...useCustomColors && backgroundColor ? { "--location-btn-bg": backgroundColor } : {},
|
|
21
|
+
...useCustomColors && textColor ? { "--location-btn-text": textColor } : {}
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsx("span", { style: Object.keys(styleVars).length ? styleVars : void 0, children: /* @__PURE__ */ jsx(
|
|
24
|
+
CompoundButton,
|
|
25
|
+
{
|
|
26
|
+
label,
|
|
27
|
+
action: action ?? (url ? /^https?:\/\//i.test(url) ? { type: "external", externalUrl: url } : { type: "page", pageUrl: url } : void 0),
|
|
28
|
+
variant,
|
|
29
|
+
size,
|
|
30
|
+
icon,
|
|
31
|
+
className: cn(
|
|
32
|
+
"rounded-3xl !h-auto !px-5 !py-2.5 !text-sm !font-medium transition-opacity hover:opacity-90",
|
|
33
|
+
useCustomColors && backgroundColor && "!border-[var(--location-btn-bg)] !bg-[var(--location-btn-bg)] hover:!bg-[var(--location-btn-bg)]",
|
|
34
|
+
useCustomColors && textColor && "!text-[var(--location-btn-text)]"
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
};
|
|
39
|
+
const MAP_STYLE_FILTERS = {
|
|
40
|
+
default: "",
|
|
41
|
+
grayscale: "grayscale(45%) contrast(1.06) brightness(0.98) saturate(0.9)",
|
|
42
|
+
dark: "grayscale(100%) invert(1) contrast(1.1) brightness(0.8)"
|
|
43
|
+
};
|
|
44
|
+
const LocationSection = ({
|
|
45
|
+
heading,
|
|
46
|
+
description,
|
|
47
|
+
contentAlign = "left",
|
|
48
|
+
contentPosition = "left",
|
|
49
|
+
location: loc,
|
|
50
|
+
mapStyle = "default",
|
|
51
|
+
mapTint = "theme",
|
|
52
|
+
buttons = [],
|
|
53
|
+
styles
|
|
54
|
+
}) => {
|
|
55
|
+
const isTextRight = contentAlign === "right";
|
|
56
|
+
const isContentRight = contentPosition === "right";
|
|
57
|
+
const showMapTint = mapTint === "theme";
|
|
58
|
+
const mapEmbedUrl = loc && loc.lat !== 0 ? getMapEmbedUrl(loc) : void 0;
|
|
59
|
+
const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
CompoundContainer,
|
|
62
|
+
{
|
|
63
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
64
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
65
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
66
|
+
className: "relative overflow-hidden",
|
|
67
|
+
children: /* @__PURE__ */ jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: cn(
|
|
71
|
+
"grid grid-cols-1 items-center gap-10 lg:grid-cols-2 lg:gap-12",
|
|
72
|
+
isContentRight && "lg:[direction:rtl] lg:[&>*]:[direction:ltr]"
|
|
73
|
+
),
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-full", children: /* @__PURE__ */ jsxs(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: cn(
|
|
79
|
+
"flex w-full min-w-0 flex-col justify-center gap-6",
|
|
80
|
+
isTextRight ? "items-end text-right" : "items-start text-left"
|
|
81
|
+
),
|
|
82
|
+
children: [
|
|
83
|
+
heading && /* @__PURE__ */ jsx("div", { className: "flex w-full flex-col gap-3", children: /* @__PURE__ */ jsx("h2", { className: "text-foreground whitespace-pre-line font-serif text-4xl leading-tight tracking-tighter md:text-6xl", children: heading }) }),
|
|
84
|
+
description ? /* @__PURE__ */ jsx(
|
|
85
|
+
"p",
|
|
86
|
+
{
|
|
87
|
+
className: cn(
|
|
88
|
+
"text-muted-foreground max-w-xl text-lg leading-relaxed tracking-tight",
|
|
89
|
+
isTextRight && "ml-auto"
|
|
90
|
+
),
|
|
91
|
+
children: description
|
|
92
|
+
}
|
|
93
|
+
) : null,
|
|
94
|
+
buttons.some((button) => button == null ? void 0 : button.label) && /* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: cn(
|
|
98
|
+
"grid grid-cols-1 gap-4 sm:flex sm:flex-row",
|
|
99
|
+
isTextRight ? "items-end sm:justify-end" : "items-start sm:justify-start"
|
|
100
|
+
),
|
|
101
|
+
children: buttons.map((button, index) => /* @__PURE__ */ jsx(LocationActionButton, { ...button }, index))
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
) }),
|
|
107
|
+
/* @__PURE__ */ jsx("div", { className: "h-[320px] w-full overflow-hidden md:h-[400px] lg:h-[460px]", children: /* @__PURE__ */ jsxs("div", { className: "relative h-full w-full overflow-hidden rounded-3xl", children: [
|
|
108
|
+
mapEmbedUrl ? /* @__PURE__ */ jsx(
|
|
109
|
+
"iframe",
|
|
110
|
+
{
|
|
111
|
+
src: mapEmbedUrl,
|
|
112
|
+
title: (loc == null ? void 0 : loc.address) || "Google Maps",
|
|
113
|
+
className: "h-full w-full border-0",
|
|
114
|
+
loading: "lazy",
|
|
115
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
116
|
+
allowFullScreen: true,
|
|
117
|
+
style: mapFilter ? { filter: mapFilter } : void 0
|
|
118
|
+
}
|
|
119
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: "Map address not configured" }),
|
|
120
|
+
showMapTint ? /* @__PURE__ */ jsx(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
className: "bg-primary pointer-events-none absolute inset-0",
|
|
124
|
+
style: {
|
|
125
|
+
opacity: 0.2,
|
|
126
|
+
mixBlendMode: "color"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
) : null
|
|
130
|
+
] }) })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
LocationSection
|
|
139
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Location2 } from "./location.js";
|
|
2
|
+
import { buttonField } from "../../../puck-core/core/props/interactive.js";
|
|
3
|
+
import { locationField } from "../../../puck-core/core/props/form.js";
|
|
4
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-core/core/styles.js";
|
|
5
|
+
const locationButtonFields = {
|
|
6
|
+
...buttonField.objectFields,
|
|
7
|
+
colorMode: {
|
|
8
|
+
type: "select",
|
|
9
|
+
options: [
|
|
10
|
+
{ label: "Theme", value: "theme" },
|
|
11
|
+
{ label: "Custom", value: "custom" }
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
backgroundColor: { type: "text" },
|
|
15
|
+
textColor: { type: "text" }
|
|
16
|
+
};
|
|
17
|
+
const locationButtonDefaults = {
|
|
18
|
+
label: "Button",
|
|
19
|
+
variant: "default",
|
|
20
|
+
size: "default",
|
|
21
|
+
icon: "none",
|
|
22
|
+
colorMode: "theme"
|
|
23
|
+
};
|
|
24
|
+
const location2ExtraStyleFields = {
|
|
25
|
+
cardStyle: {
|
|
26
|
+
type: "radio",
|
|
27
|
+
label: "Card Style",
|
|
28
|
+
options: [
|
|
29
|
+
{ label: "Solid", value: "solid" },
|
|
30
|
+
{ label: "Glass", value: "glass" }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
sectionHeight: {
|
|
34
|
+
type: "radio",
|
|
35
|
+
label: "Section Height",
|
|
36
|
+
options: [
|
|
37
|
+
{ label: "Compact", value: "sm" },
|
|
38
|
+
{ label: "Medium", value: "md" },
|
|
39
|
+
{ label: "Tall", value: "lg" }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const conf = {
|
|
44
|
+
fields: {
|
|
45
|
+
heading: { type: "textarea", contentEditable: true },
|
|
46
|
+
description: { type: "textarea", contentEditable: true },
|
|
47
|
+
displayAddress: {
|
|
48
|
+
type: "textarea",
|
|
49
|
+
label: "Display Address",
|
|
50
|
+
contentEditable: true
|
|
51
|
+
},
|
|
52
|
+
contentPosition: {
|
|
53
|
+
type: "radio",
|
|
54
|
+
label: "Card Position",
|
|
55
|
+
options: [
|
|
56
|
+
{ label: "Left", value: "left" },
|
|
57
|
+
{ label: "Right", value: "right" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
location: locationField,
|
|
61
|
+
mapStyle: {
|
|
62
|
+
type: "radio",
|
|
63
|
+
label: "Map Style",
|
|
64
|
+
options: [
|
|
65
|
+
{ label: "Default", value: "default" },
|
|
66
|
+
{ label: "Grayscale", value: "grayscale" },
|
|
67
|
+
{ label: "Dark", value: "dark" }
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
mapTint: {
|
|
71
|
+
type: "radio",
|
|
72
|
+
label: "Map Tint",
|
|
73
|
+
options: [
|
|
74
|
+
{ label: "None", value: "none" },
|
|
75
|
+
{ label: "Theme", value: "theme" }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
buttons: {
|
|
79
|
+
type: "array",
|
|
80
|
+
max: 3,
|
|
81
|
+
getItemSummary: (item, index = 0) => item.label || `Button ${index + 1}`,
|
|
82
|
+
arrayFields: locationButtonFields,
|
|
83
|
+
defaultItemProps: locationButtonDefaults
|
|
84
|
+
},
|
|
85
|
+
styles: createStylesField(location2ExtraStyleFields)
|
|
86
|
+
},
|
|
87
|
+
defaultProps: {
|
|
88
|
+
heading: "Our Offices",
|
|
89
|
+
description: "Visit our headquarters in London or reach out to one of our regional offices worldwide.",
|
|
90
|
+
displayAddress: "10 Finsbury Square\nLondon, UK EC2A 1AF",
|
|
91
|
+
contentPosition: "left",
|
|
92
|
+
location: {
|
|
93
|
+
address: "London, United Kingdom",
|
|
94
|
+
lat: 51.5074,
|
|
95
|
+
lng: -0.1278,
|
|
96
|
+
zoom: 13
|
|
97
|
+
},
|
|
98
|
+
mapStyle: "grayscale",
|
|
99
|
+
mapTint: "none",
|
|
100
|
+
buttons: [
|
|
101
|
+
{
|
|
102
|
+
label: "Get Directions",
|
|
103
|
+
variant: "default",
|
|
104
|
+
size: "default",
|
|
105
|
+
icon: "none",
|
|
106
|
+
colorMode: "theme"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: "Call Us",
|
|
110
|
+
variant: "outline",
|
|
111
|
+
size: "default",
|
|
112
|
+
icon: "none",
|
|
113
|
+
colorMode: "theme"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
styles: createStylesDefaults({
|
|
117
|
+
cardStyle: "solid",
|
|
118
|
+
sectionHeight: "md"
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
render: Location2
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
conf,
|
|
125
|
+
conf as default
|
|
126
|
+
};
|
|
@@ -18,9 +18,6 @@ export interface Location2Props {
|
|
|
18
18
|
mapTint?: "none" | "theme";
|
|
19
19
|
buttons?: LocationButton[];
|
|
20
20
|
styles?: {
|
|
21
|
-
className?: string;
|
|
22
|
-
style?: Record<string, unknown>;
|
|
23
|
-
css?: string;
|
|
24
21
|
padding?: CompoundContainerProps["padding"];
|
|
25
22
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
26
23
|
backgroundColor?: string;
|