dune-react 0.0.23 → 0.0.25
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/dual-row-marquee/dual-row-marquee.js +77 -53
- package/dist/components/puck-block/contact-sections/tab-locations/tab-locations.js +71 -55
- package/dist/components/puck-block/feature-sections/tab-feature/component.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 +165 -104
- 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 +40 -12
- package/dist/components/puck-block/gallery-sections/props.d.ts +31 -2
- package/dist/components/puck-block/gallery-sections/props.js +17 -4
- package/dist/components/puck-block/gallery-sections/scroll-parallax/scroll-parallax.js +68 -37
- package/dist/components/puck-block/gallery-sections/scroll-parallax-portfolio/scroll-parallax-portfolio.js +308 -151
- 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 +94 -14
- package/dist/components/puck-block/hero-sections/grid-expand-hero/index.d.ts +17 -1
- package/dist/components/puck-block/hero-sections/inline-image-hero/inline-image-hero.js +59 -28
- package/dist/components/puck-block/hero-sections/multi-image-grid-hero/index.d.ts +17 -1
- 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/tab-hero/component.js +1 -1
- 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/tab-stats/tab-stats.js +1 -1
- package/dist/components/puck-block/pricing-sections/pricing-comparison-table/component.js +134 -33
- 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 +228 -6
- package/dist/components/puck-block/registry.generated.js +157 -138
- package/dist/components/puck-block/showcase-sections/tab-timeline/component.js +1 -1
- 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 +4 -4
- 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-core/core/props/form.js +25 -1
- package/dist/components/puck-core/fields/location-field.js +4 -1
- package/dist/index.js +6 -0
- package/package.json +4 -1
|
@@ -7,25 +7,105 @@ import { motion } from "framer-motion";
|
|
|
7
7
|
import { cn } from "../../../../utils/css-utils.js";
|
|
8
8
|
import { SectionWrapper } from "../../../puck-core/section-wrapper.js";
|
|
9
9
|
const CenteredNavbar = (props) => {
|
|
10
|
-
const { logo, navLinks, buttons, styles } = {
|
|
11
|
-
|
|
10
|
+
const { logo, navLinks, buttons, styles } = {
|
|
11
|
+
...CenteredNavbarDefaults,
|
|
12
|
+
...props
|
|
13
|
+
};
|
|
14
|
+
const {
|
|
15
|
+
className: sectionClassName,
|
|
16
|
+
style: sectionStyle,
|
|
17
|
+
css
|
|
18
|
+
} = styles ?? {};
|
|
12
19
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
SectionWrapper,
|
|
22
|
+
{
|
|
23
|
+
className: cn(
|
|
24
|
+
"z-[999] flex w-full items-center border-b border-border-primary bg-background-primary lg:min-h-18 lg:px-[5%]",
|
|
25
|
+
sectionClassName
|
|
26
|
+
),
|
|
27
|
+
style: sectionStyle,
|
|
28
|
+
css,
|
|
29
|
+
children: /* @__PURE__ */ jsxs("div", { className: "mx-auto size-full lg:grid lg:grid-cols-[0.375fr_1fr_0.375fr] lg:items-center lg:justify-between lg:gap-4", children: [
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-h-16 items-center justify-between px-[5%] md:min-h-18 lg:min-h-full lg:px-0", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("a", { href: logo == null ? void 0 : logo.url, children: /* @__PURE__ */ jsx(
|
|
32
|
+
CompoundImage,
|
|
33
|
+
{
|
|
34
|
+
src: logo == null ? void 0 : logo.src,
|
|
35
|
+
alt: logo == null ? void 0 : logo.alt,
|
|
36
|
+
className: "h-9 w-auto"
|
|
37
|
+
}
|
|
38
|
+
) }),
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 lg:hidden", children: [
|
|
40
|
+
/* @__PURE__ */ jsx("div", { children: buttons == null ? void 0 : buttons.map((b, i) => /* @__PURE__ */ jsx(
|
|
41
|
+
Button,
|
|
42
|
+
{
|
|
43
|
+
className: "w-full px-4 py-1",
|
|
44
|
+
variant: b.variant,
|
|
45
|
+
size: b.size,
|
|
46
|
+
children: b.label
|
|
47
|
+
},
|
|
48
|
+
i
|
|
49
|
+
)) }),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
className: "-mr-2 flex size-12 flex-col items-center justify-center",
|
|
54
|
+
onClick: () => setIsMobileMenuOpen((prev) => !prev),
|
|
55
|
+
children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { className: "my-[3px] h-0.5 w-6 bg-black" }, i))
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
motion.div,
|
|
62
|
+
{
|
|
63
|
+
variants: {
|
|
64
|
+
open: { height: "var(--height-open, 100dvh)" },
|
|
65
|
+
close: { height: "var(--height-closed, 0)" }
|
|
66
|
+
},
|
|
67
|
+
animate: isMobileMenuOpen ? "open" : "close",
|
|
68
|
+
initial: "close",
|
|
69
|
+
transition: { duration: 0.4 },
|
|
70
|
+
className: "overflow-hidden px-[5%] text-center lg:flex lg:items-center lg:justify-center lg:px-0 lg:[--height-closed:auto] lg:[--height-open:auto]",
|
|
71
|
+
children: navLinks == null ? void 0 : navLinks.map((navLink, index) => /* @__PURE__ */ jsx(
|
|
72
|
+
"a",
|
|
73
|
+
{
|
|
74
|
+
href: navLink.url,
|
|
75
|
+
className: "block py-3 text-md first:pt-7 lg:px-4 lg:py-2 lg:text-base first:lg:pt-2",
|
|
76
|
+
children: navLink.title
|
|
77
|
+
},
|
|
78
|
+
index
|
|
79
|
+
))
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsx("div", { className: "hidden justify-self-end gap-2 lg:flex", children: buttons == null ? void 0 : buttons.map((b, i) => /* @__PURE__ */ jsx(
|
|
83
|
+
Button,
|
|
84
|
+
{
|
|
85
|
+
className: "px-6 py-2",
|
|
86
|
+
variant: b.variant,
|
|
87
|
+
size: b.size,
|
|
88
|
+
children: b.label
|
|
89
|
+
},
|
|
90
|
+
i
|
|
91
|
+
)) })
|
|
19
92
|
] })
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ jsx("div", { className: "hidden justify-self-end lg:block", children: buttons == null ? void 0 : buttons.map((b, i) => /* @__PURE__ */ jsx(Button, { className: "px-6 py-2", variant: b.variant, size: b.size, children: b.label }, i)) })
|
|
23
|
-
] }) });
|
|
93
|
+
}
|
|
94
|
+
);
|
|
24
95
|
};
|
|
25
96
|
const CenteredNavbarDefaults = {
|
|
26
97
|
__metadata: { type: "header" },
|
|
27
|
-
logo: {
|
|
28
|
-
|
|
98
|
+
logo: {
|
|
99
|
+
url: "#",
|
|
100
|
+
src: "https://file.springbrand.ai/web_assets/template-logo.svg",
|
|
101
|
+
alt: "Logo image"
|
|
102
|
+
},
|
|
103
|
+
navLinks: [
|
|
104
|
+
{ title: "Link One", url: "#" },
|
|
105
|
+
{ title: "Link Two", url: "#" },
|
|
106
|
+
{ title: "Link Three", url: "#" },
|
|
107
|
+
{ title: "Link Four", url: "#" }
|
|
108
|
+
],
|
|
29
109
|
button: { label: "Button", size: "sm" },
|
|
30
110
|
buttons: [{ label: "Button", size: "sm" }],
|
|
31
111
|
styles: {}
|
|
@@ -145,8 +145,24 @@ declare const conf: {
|
|
|
145
145
|
}];
|
|
146
146
|
};
|
|
147
147
|
gridRatio: {
|
|
148
|
-
readonly type: "
|
|
148
|
+
readonly type: "select";
|
|
149
149
|
readonly label: "Grid Ratio";
|
|
150
|
+
readonly options: readonly [{
|
|
151
|
+
readonly label: "25% / 50% / 25%";
|
|
152
|
+
readonly value: "25%_50%_25%";
|
|
153
|
+
}, {
|
|
154
|
+
readonly label: "32% / 36% / 32%";
|
|
155
|
+
readonly value: "32%_36%_32%";
|
|
156
|
+
}, {
|
|
157
|
+
readonly label: "33% / 33% / 33%";
|
|
158
|
+
readonly value: "33%_34%_33%";
|
|
159
|
+
}, {
|
|
160
|
+
readonly label: "20% / 60% / 20%";
|
|
161
|
+
readonly value: "20%_60%_20%";
|
|
162
|
+
}, {
|
|
163
|
+
readonly label: "40% / 30% / 30%";
|
|
164
|
+
readonly value: "40%_30%_30%";
|
|
165
|
+
}];
|
|
150
166
|
};
|
|
151
167
|
};
|
|
152
168
|
};
|
|
@@ -3,51 +3,82 @@ import { CompoundButton } from "../../../puck-base/button.js";
|
|
|
3
3
|
import { SectionWrapper } from "../../../puck-core/section-wrapper.js";
|
|
4
4
|
import { cn } from "../../../../utils/css-utils.js";
|
|
5
5
|
const InlineImageHero = (props) => {
|
|
6
|
-
const {
|
|
6
|
+
const {
|
|
7
|
+
headers = [],
|
|
8
|
+
description,
|
|
9
|
+
buttons = [],
|
|
10
|
+
styles: rawStyles
|
|
11
|
+
} = {
|
|
7
12
|
...InlineImageHeroDefaults,
|
|
8
13
|
...props
|
|
9
14
|
};
|
|
10
|
-
const {
|
|
15
|
+
const {
|
|
16
|
+
className: sectionClassName,
|
|
17
|
+
style: sectionStyle,
|
|
18
|
+
css,
|
|
19
|
+
textAlign
|
|
20
|
+
} = rawStyles ?? {};
|
|
11
21
|
const isCenter = textAlign === "center";
|
|
12
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
-
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
SectionWrapper,
|
|
14
24
|
{
|
|
15
|
-
className:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
className: cn(
|
|
26
|
+
"relative px-[5%] py-8 md:py-12 lg:py-14",
|
|
27
|
+
sectionClassName
|
|
28
|
+
),
|
|
29
|
+
style: sectionStyle,
|
|
30
|
+
css,
|
|
31
|
+
children: /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: `container max-w-xl overflow-hidden${isCenter ? " text-center" : ""}`,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx("h1", { className: "mb-5 text-3xl font-bold leading-[1.2] sm:text-6xl md:mb-6 md:text-9xl lg:text-[5rem]", children: headers.map((header, index) => /* @__PURE__ */ jsx("span", { children: header.bgUrl ? /* @__PURE__ */ jsx(
|
|
37
|
+
"span",
|
|
38
|
+
{
|
|
39
|
+
className: "bg-no-repeat pr-16 [background-position-x:100%] [background-position-y:center] [background-size:auto_80%] sm:pr-[5.75rem] md:pr-[7.5rem] lg:pr-[11.5rem]",
|
|
40
|
+
style: {
|
|
41
|
+
backgroundImage: `url('${header.bgUrl}')`
|
|
42
|
+
},
|
|
43
|
+
children: header.heading
|
|
44
|
+
}
|
|
45
|
+
) : " " + header.heading + " " }, index)) }),
|
|
46
|
+
/* @__PURE__ */ jsx("p", { className: "md:text-md", children: description }),
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: `mt-6 flex${isCenter ? " items-center justify-center" : ""} gap-x-4 md:mt-8`,
|
|
51
|
+
children: buttons.map((button, index) => /* @__PURE__ */ jsx(
|
|
52
|
+
CompoundButton,
|
|
53
|
+
{
|
|
54
|
+
label: button.label,
|
|
55
|
+
variant: button.variant,
|
|
56
|
+
size: button.size,
|
|
57
|
+
action: button.action,
|
|
58
|
+
icon: button.icon
|
|
59
|
+
},
|
|
60
|
+
index
|
|
61
|
+
))
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
)
|
|
36
67
|
}
|
|
37
|
-
)
|
|
68
|
+
);
|
|
38
69
|
};
|
|
39
70
|
const InlineImageHeroDefaults = {
|
|
40
71
|
headers: [
|
|
41
72
|
{
|
|
42
73
|
heading: "Long",
|
|
43
|
-
bgUrl: "https://
|
|
74
|
+
bgUrl: "https://file.springbrand.ai/web_assets/template-logo.svg"
|
|
44
75
|
},
|
|
45
76
|
{
|
|
46
77
|
heading: "heading is what you see here in this"
|
|
47
78
|
},
|
|
48
79
|
{
|
|
49
80
|
heading: "header",
|
|
50
|
-
bgUrl: "https://
|
|
81
|
+
bgUrl: "https://file.springbrand.ai/web_assets/template-logo.svg"
|
|
51
82
|
},
|
|
52
83
|
{
|
|
53
84
|
heading: "section"
|
|
@@ -143,8 +143,24 @@ declare const conf: {
|
|
|
143
143
|
}[];
|
|
144
144
|
};
|
|
145
145
|
imageGridRatio: {
|
|
146
|
-
readonly type: "
|
|
146
|
+
readonly type: "select";
|
|
147
147
|
readonly label: "Image Grid Ratio";
|
|
148
|
+
readonly options: readonly [{
|
|
149
|
+
readonly label: "3:1 (宽主图 + 窄侧图)";
|
|
150
|
+
readonly value: "1fr_0.33fr";
|
|
151
|
+
}, {
|
|
152
|
+
readonly label: "1:1 (等宽)";
|
|
153
|
+
readonly value: "1fr_1fr";
|
|
154
|
+
}, {
|
|
155
|
+
readonly label: "2:1";
|
|
156
|
+
readonly value: "2fr_1fr";
|
|
157
|
+
}, {
|
|
158
|
+
readonly label: "1:2";
|
|
159
|
+
readonly value: "1fr_2fr";
|
|
160
|
+
}, {
|
|
161
|
+
readonly label: "3:2";
|
|
162
|
+
readonly value: "3fr_2fr";
|
|
163
|
+
}];
|
|
148
164
|
};
|
|
149
165
|
};
|
|
150
166
|
};
|
|
@@ -157,8 +157,24 @@ export declare const heroStyleFields: {
|
|
|
157
157
|
}];
|
|
158
158
|
};
|
|
159
159
|
readonly imageGridRatio: {
|
|
160
|
-
readonly type: "
|
|
160
|
+
readonly type: "select";
|
|
161
161
|
readonly label: "Image Grid Ratio";
|
|
162
|
+
readonly options: readonly [{
|
|
163
|
+
readonly label: "3:1 (宽主图 + 窄侧图)";
|
|
164
|
+
readonly value: "1fr_0.33fr";
|
|
165
|
+
}, {
|
|
166
|
+
readonly label: "1:1 (等宽)";
|
|
167
|
+
readonly value: "1fr_1fr";
|
|
168
|
+
}, {
|
|
169
|
+
readonly label: "2:1";
|
|
170
|
+
readonly value: "2fr_1fr";
|
|
171
|
+
}, {
|
|
172
|
+
readonly label: "1:2";
|
|
173
|
+
readonly value: "1fr_2fr";
|
|
174
|
+
}, {
|
|
175
|
+
readonly label: "3:2";
|
|
176
|
+
readonly value: "3fr_2fr";
|
|
177
|
+
}];
|
|
162
178
|
};
|
|
163
179
|
readonly overlapStyle: {
|
|
164
180
|
readonly type: "radio";
|
|
@@ -197,8 +213,24 @@ export declare const heroStyleFields: {
|
|
|
197
213
|
}];
|
|
198
214
|
};
|
|
199
215
|
readonly gridRatio: {
|
|
200
|
-
readonly type: "
|
|
216
|
+
readonly type: "select";
|
|
201
217
|
readonly label: "Grid Ratio";
|
|
218
|
+
readonly options: readonly [{
|
|
219
|
+
readonly label: "25% / 50% / 25%";
|
|
220
|
+
readonly value: "25%_50%_25%";
|
|
221
|
+
}, {
|
|
222
|
+
readonly label: "32% / 36% / 32%";
|
|
223
|
+
readonly value: "32%_36%_32%";
|
|
224
|
+
}, {
|
|
225
|
+
readonly label: "33% / 33% / 33%";
|
|
226
|
+
readonly value: "33%_34%_33%";
|
|
227
|
+
}, {
|
|
228
|
+
readonly label: "20% / 60% / 20%";
|
|
229
|
+
readonly value: "20%_60%_20%";
|
|
230
|
+
}, {
|
|
231
|
+
readonly label: "40% / 30% / 30%";
|
|
232
|
+
readonly value: "40%_30%_30%";
|
|
233
|
+
}];
|
|
202
234
|
};
|
|
203
235
|
};
|
|
204
236
|
/** 将 HeroSectionBaseProps 与组件特有字段合并,生成最终 Props */
|
|
@@ -35,8 +35,15 @@ const heroStyleFields = {
|
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
imageGridRatio: {
|
|
38
|
-
type: "
|
|
39
|
-
label: "Image Grid Ratio"
|
|
38
|
+
type: "select",
|
|
39
|
+
label: "Image Grid Ratio",
|
|
40
|
+
options: [
|
|
41
|
+
{ label: "3:1 (宽主图 + 窄侧图)", value: "1fr_0.33fr" },
|
|
42
|
+
{ label: "1:1 (等宽)", value: "1fr_1fr" },
|
|
43
|
+
{ label: "2:1", value: "2fr_1fr" },
|
|
44
|
+
{ label: "1:2", value: "1fr_2fr" },
|
|
45
|
+
{ label: "3:2", value: "3fr_2fr" }
|
|
46
|
+
]
|
|
40
47
|
},
|
|
41
48
|
overlapStyle: {
|
|
42
49
|
type: "radio",
|
|
@@ -64,8 +71,15 @@ const heroStyleFields = {
|
|
|
64
71
|
]
|
|
65
72
|
},
|
|
66
73
|
gridRatio: {
|
|
67
|
-
type: "
|
|
68
|
-
label: "Grid Ratio"
|
|
74
|
+
type: "select",
|
|
75
|
+
label: "Grid Ratio",
|
|
76
|
+
options: [
|
|
77
|
+
{ label: "25% / 50% / 25%", value: "25%_50%_25%" },
|
|
78
|
+
{ label: "32% / 36% / 32%", value: "32%_36%_32%" },
|
|
79
|
+
{ label: "33% / 33% / 33%", value: "33%_34%_33%" },
|
|
80
|
+
{ label: "20% / 60% / 20%", value: "20%_60%_20%" },
|
|
81
|
+
{ label: "40% / 30% / 30%", value: "40%_30%_30%" }
|
|
82
|
+
]
|
|
69
83
|
}
|
|
70
84
|
};
|
|
71
85
|
export {
|
|
@@ -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(
|
|
@@ -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
|
+
};
|