dune-react 0.0.18 → 0.0.19
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/core/with-editable.js +2 -2
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +3 -3
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +57 -11
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +4 -4
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +3 -3
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +4 -3
- package/dist/components/puck-block/hero-sections/image-hero-1/index.js +3 -10
- package/dist/components/puck-block/hero-sections/props.d.ts +1 -3
- package/dist/components/puck-block/hero-sections/video-hero-1/index.js +3 -3
- package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.d.ts +4 -4
- package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +32 -29
- package/package.json +2 -2
|
@@ -70,7 +70,7 @@ function withEditable(Component, config) {
|
|
|
70
70
|
if (isBlock) {
|
|
71
71
|
return /* @__PURE__ */ jsxs("span", { ref: wrapperRef, className: "group relative block h-full w-full", children: [
|
|
72
72
|
/* @__PURE__ */ jsx(Component, { ...props }),
|
|
73
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 z-
|
|
73
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 z-60 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
74
74
|
"span",
|
|
75
75
|
{
|
|
76
76
|
ref: portalRef,
|
|
@@ -84,7 +84,7 @@ function withEditable(Component, config) {
|
|
|
84
84
|
}
|
|
85
85
|
return /* @__PURE__ */ jsxs("span", { ref: wrapperRef, className: "group relative inline-flex", children: [
|
|
86
86
|
/* @__PURE__ */ jsx(Component, { ...props }),
|
|
87
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 z-
|
|
87
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 z-60 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ jsx(
|
|
88
88
|
"span",
|
|
89
89
|
{
|
|
90
90
|
onClick: handleEdit,
|
|
@@ -9,10 +9,10 @@ export interface FullscreenHeroProps {
|
|
|
9
9
|
variant: string;
|
|
10
10
|
};
|
|
11
11
|
buttons?: CompoundButtonProps[];
|
|
12
|
-
|
|
12
|
+
images?: {
|
|
13
13
|
src: string;
|
|
14
14
|
alt?: string;
|
|
15
|
-
}
|
|
15
|
+
}[];
|
|
16
16
|
styles?: {
|
|
17
17
|
padding?: CompoundContainerProps["padding"];
|
|
18
18
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
@@ -20,4 +20,4 @@ export interface FullscreenHeroProps {
|
|
|
20
20
|
overlay?: "none" | "dark" | "gradient";
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
export declare const FullscreenHero: ({ heading, description, badge, buttons,
|
|
23
|
+
export declare const FullscreenHero: ({ heading, description, badge, buttons, images, styles, }: FullscreenHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,15 +12,16 @@ const FullscreenHero = ({
|
|
|
12
12
|
description,
|
|
13
13
|
badge,
|
|
14
14
|
buttons,
|
|
15
|
-
|
|
15
|
+
images,
|
|
16
16
|
styles
|
|
17
17
|
}) => {
|
|
18
18
|
const sectionStyle = styles == null ? void 0 : styles.sectionStyle;
|
|
19
19
|
const overlay = (styles == null ? void 0 : styles.overlay) ?? "dark";
|
|
20
20
|
const backgroundColor = styles == null ? void 0 : styles.backgroundColor;
|
|
21
21
|
const padding = styles == null ? void 0 : styles.padding;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const bgImage = images == null ? void 0 : images[0];
|
|
23
|
+
const bgSrc = bgImage == null ? void 0 : bgImage.src;
|
|
24
|
+
const bgAlt = (bgImage == null ? void 0 : bgImage.alt) ?? "";
|
|
24
25
|
if (!bgSrc) {
|
|
25
26
|
return /* @__PURE__ */ jsx(
|
|
26
27
|
CompoundContainer,
|
|
@@ -29,7 +30,15 @@ const FullscreenHero = ({
|
|
|
29
30
|
sectionStyle,
|
|
30
31
|
backgroundColor,
|
|
31
32
|
className: "min-h-[100vh] flex flex-col justify-end",
|
|
32
|
-
children: /* @__PURE__ */ jsx(
|
|
33
|
+
children: /* @__PURE__ */ jsx(
|
|
34
|
+
Content,
|
|
35
|
+
{
|
|
36
|
+
badge,
|
|
37
|
+
heading,
|
|
38
|
+
description,
|
|
39
|
+
buttons
|
|
40
|
+
}
|
|
41
|
+
)
|
|
33
42
|
}
|
|
34
43
|
);
|
|
35
44
|
}
|
|
@@ -40,20 +49,57 @@ const FullscreenHero = ({
|
|
|
40
49
|
{
|
|
41
50
|
className: cn(
|
|
42
51
|
"relative w-full min-h-[100vh] flex flex-col justify-end overflow-hidden bg-background text-foreground",
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
{
|
|
53
|
+
"pt-20 lg:pt-40": top === "large",
|
|
54
|
+
"pb-20 lg:pb-40": bottom === "large"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"pt-15 lg:pt-30": top === "medium",
|
|
58
|
+
"pb-15 lg:pb-30": bottom === "medium"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"pt-10 lg:pt-20": top === "small",
|
|
62
|
+
"pb-10 lg:pb-20": bottom === "small"
|
|
63
|
+
}
|
|
46
64
|
),
|
|
47
65
|
style: { ...styleVars, ...backgroundColor ? { backgroundColor } : {} },
|
|
48
66
|
children: [
|
|
49
|
-
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 [&>span]:h-full [&>span]:w-full", children: /* @__PURE__ */ jsx(
|
|
50
|
-
|
|
51
|
-
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 [&>span]:h-full [&>span]:w-full", children: /* @__PURE__ */ jsx(
|
|
68
|
+
CompoundImage,
|
|
69
|
+
{
|
|
70
|
+
src: bgSrc,
|
|
71
|
+
alt: bgAlt,
|
|
72
|
+
className: "h-full w-full object-cover"
|
|
73
|
+
}
|
|
74
|
+
) }),
|
|
75
|
+
overlay !== "none" && /* @__PURE__ */ jsx(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: cn(
|
|
79
|
+
"absolute inset-0",
|
|
80
|
+
overlayStyles[overlay] ?? overlayStyles.dark
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "container mx-auto relative z-50", children: /* @__PURE__ */ jsx(
|
|
85
|
+
Content,
|
|
86
|
+
{
|
|
87
|
+
badge,
|
|
88
|
+
heading,
|
|
89
|
+
description,
|
|
90
|
+
buttons
|
|
91
|
+
}
|
|
92
|
+
) })
|
|
52
93
|
]
|
|
53
94
|
}
|
|
54
95
|
);
|
|
55
96
|
};
|
|
56
|
-
function Content({
|
|
97
|
+
function Content({
|
|
98
|
+
badge,
|
|
99
|
+
heading,
|
|
100
|
+
description,
|
|
101
|
+
buttons
|
|
102
|
+
}) {
|
|
57
103
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
58
104
|
badge && /* @__PURE__ */ jsx("span", { className: "bg-primary/10 text-primary mb-6 inline-block rounded-full px-3 py-1 text-xs font-medium", children: badge.label }),
|
|
59
105
|
/* @__PURE__ */ jsx("h1", { className: "font-serif text-5xl md:text-7xl lg:text-8xl font-medium leading-[0.95] mb-8 max-w-[800px] text-foreground", children: heading }),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { contentFields } from "../../../puck-base/core/fields.js";
|
|
1
|
+
import { images, contentFields } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { FullscreenHero } from "./fullscreen-hero.js";
|
|
3
|
-
import {
|
|
3
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
4
4
|
const conf = {
|
|
5
5
|
fields: {
|
|
6
6
|
badge: contentFields.badge,
|
|
@@ -13,7 +13,7 @@ const conf = {
|
|
|
13
13
|
contentEditable: true
|
|
14
14
|
},
|
|
15
15
|
buttons: contentFields.buttons,
|
|
16
|
-
|
|
16
|
+
images: { ...images, max: 1 },
|
|
17
17
|
styles: createStylesField({
|
|
18
18
|
overlay: {
|
|
19
19
|
type: "select",
|
|
@@ -37,7 +37,7 @@ const conf = {
|
|
|
37
37
|
icon: "none"
|
|
38
38
|
}
|
|
39
39
|
],
|
|
40
|
-
|
|
40
|
+
images: [{ src: "https://images.pexels.com/photos/924824/pexels-photo-924824.jpeg?auto=compress&cs=tinysrgb&w=1920", alt: "Hero background" }],
|
|
41
41
|
styles: createStylesDefaults({
|
|
42
42
|
sectionStyle: "dark",
|
|
43
43
|
overlay: "dark"
|
|
@@ -6,10 +6,10 @@ export interface ImageHeroProps {
|
|
|
6
6
|
description?: string;
|
|
7
7
|
badge?: CompoundBadgeProps;
|
|
8
8
|
buttons?: CompoundButtonProps[];
|
|
9
|
-
|
|
9
|
+
images?: {
|
|
10
10
|
src: string;
|
|
11
11
|
alt?: string;
|
|
12
|
-
}
|
|
12
|
+
}[];
|
|
13
13
|
styles?: {
|
|
14
14
|
padding?: CompoundContainerProps["padding"];
|
|
15
15
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
@@ -19,4 +19,4 @@ export interface ImageHeroProps {
|
|
|
19
19
|
minHeight?: "medium" | "large" | "full";
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export declare const ImageHero: ({ heading, description, badge, buttons,
|
|
22
|
+
export declare const ImageHero: ({ heading, description, badge, buttons, images, styles, }: ImageHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,14 +18,15 @@ const ImageHero = ({
|
|
|
18
18
|
description,
|
|
19
19
|
badge,
|
|
20
20
|
buttons,
|
|
21
|
-
|
|
21
|
+
images,
|
|
22
22
|
styles
|
|
23
23
|
}) => {
|
|
24
24
|
const overlay = (styles == null ? void 0 : styles.overlay) ?? "dark";
|
|
25
25
|
const align = (styles == null ? void 0 : styles.align) ?? "center";
|
|
26
26
|
const minHeight = (styles == null ? void 0 : styles.minHeight) ?? "large";
|
|
27
|
-
const
|
|
28
|
-
const
|
|
27
|
+
const bgImage = images == null ? void 0 : images[0];
|
|
28
|
+
const bgSrc = bgImage == null ? void 0 : bgImage.src;
|
|
29
|
+
const bgAlt = (bgImage == null ? void 0 : bgImage.alt) ?? "";
|
|
29
30
|
return /* @__PURE__ */ jsx(
|
|
30
31
|
CompoundContainer,
|
|
31
32
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buttons, badge } from "../../../puck-base/core/fields.js";
|
|
1
|
+
import { images, buttons, badge } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { heroStylesDefaults, createStylesField, sectionOverlay } from "../../../puck-base/core/styles.js";
|
|
3
3
|
import { ImageHero } from "./image-hero.js";
|
|
4
4
|
const imageHeroStylesField = createStylesField({
|
|
@@ -26,20 +26,13 @@ const conf = {
|
|
|
26
26
|
description: { type: "textarea", contentEditable: true },
|
|
27
27
|
badge,
|
|
28
28
|
buttons,
|
|
29
|
-
|
|
30
|
-
type: "text",
|
|
31
|
-
label: "Background Image URL",
|
|
32
|
-
ai: {
|
|
33
|
-
instructions: "URL for a full-width background image behind the section.",
|
|
34
|
-
stream: false
|
|
35
|
-
}
|
|
36
|
-
},
|
|
29
|
+
images: { ...images, max: 1 },
|
|
37
30
|
styles: imageHeroStylesField
|
|
38
31
|
},
|
|
39
32
|
defaultProps: {
|
|
40
33
|
heading: "Build something people want",
|
|
41
34
|
description: "A modern platform for teams who care about speed, quality, and customer experience.",
|
|
42
|
-
|
|
35
|
+
images: [{ src: "https://images.pexels.com/photos/3184291/pexels-photo-3184291.jpeg?auto=compress&cs=tinysrgb&w=1920", alt: "Hero background" }],
|
|
43
36
|
buttons: [
|
|
44
37
|
{
|
|
45
38
|
label: "Get Started",
|
|
@@ -37,9 +37,7 @@ type HeroSectionProps = {
|
|
|
37
37
|
spacing?: "tight" | "normal" | "relaxed";
|
|
38
38
|
align?: "left" | "center";
|
|
39
39
|
displaySize?: "default" | "display";
|
|
40
|
-
images?: HeroImage
|
|
41
|
-
backgroundImage?: HeroImage | string;
|
|
42
|
-
posterImage?: HeroImage;
|
|
40
|
+
images?: HeroImage[];
|
|
43
41
|
videoUrl?: string;
|
|
44
42
|
adjectives?: {
|
|
45
43
|
adjective: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { images, contentFields } from "../../../puck-base/core/fields.js";
|
|
2
2
|
import { VideoHero } from "./video-hero.js";
|
|
3
3
|
import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
|
|
4
4
|
const conf = {
|
|
@@ -9,14 +9,14 @@ const conf = {
|
|
|
9
9
|
label: "Video URL",
|
|
10
10
|
ai: { instructions: "Direct URL to an MP4 video" }
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
images: { ...images, max: 1 },
|
|
13
13
|
styles: createStylesField()
|
|
14
14
|
},
|
|
15
15
|
defaultProps: {
|
|
16
16
|
heading: "See what's possible",
|
|
17
17
|
description: "Watch how leading teams use our platform to ship 10x faster.",
|
|
18
18
|
buttons: [{ label: "Try It Free", icon: "move-right", variant: "default" }],
|
|
19
|
-
|
|
19
|
+
images: [{ src: "https://images.pexels.com/photos/6985132/pexels-photo-6985132.jpeg?auto=compress&cs=tinysrgb&w=1920", alt: "Dark gradient background for product demo preview" }],
|
|
20
20
|
styles: createStylesDefaults()
|
|
21
21
|
},
|
|
22
22
|
render: VideoHero
|
|
@@ -2,14 +2,14 @@ import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
|
2
2
|
import { CompoundContentProps } from "@/components/puck-base/content";
|
|
3
3
|
export interface VideoHeroProps extends CompoundContentProps {
|
|
4
4
|
videoUrl?: string;
|
|
5
|
-
|
|
5
|
+
images?: {
|
|
6
6
|
src: string;
|
|
7
|
-
alt
|
|
8
|
-
};
|
|
7
|
+
alt?: string;
|
|
8
|
+
}[];
|
|
9
9
|
styles?: {
|
|
10
10
|
padding?: CompoundContainerProps["padding"];
|
|
11
11
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
12
12
|
backgroundColor?: string;
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
export declare const VideoHero: ({ badge, heading, description, buttons, videoUrl,
|
|
15
|
+
export declare const VideoHero: ({ badge, heading, description, buttons, videoUrl, images, styles, }: VideoHeroProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,36 +7,39 @@ const VideoHero = ({
|
|
|
7
7
|
description,
|
|
8
8
|
buttons,
|
|
9
9
|
videoUrl,
|
|
10
|
-
|
|
10
|
+
images,
|
|
11
11
|
styles
|
|
12
|
-
}) =>
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
)
|
|
12
|
+
}) => {
|
|
13
|
+
var _a;
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
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: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 items-center gap-12 lg:grid-cols-2", children: [
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
CompoundContent,
|
|
23
|
+
{
|
|
24
|
+
badge,
|
|
25
|
+
heading,
|
|
26
|
+
description,
|
|
27
|
+
buttons
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "border-border/20 overflow-hidden rounded-xl border bg-black/50", children: videoUrl ? /* @__PURE__ */ jsx(
|
|
31
|
+
"video",
|
|
32
|
+
{
|
|
33
|
+
src: videoUrl,
|
|
34
|
+
poster: (_a = images == null ? void 0 : images[0]) == null ? void 0 : _a.src,
|
|
35
|
+
controls: true,
|
|
36
|
+
className: "aspect-video w-full object-cover"
|
|
37
|
+
}
|
|
38
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex aspect-video w-full items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "bg-primary/20 flex h-16 w-16 items-center justify-center rounded-full", children: /* @__PURE__ */ jsx("span", { className: "text-primary text-2xl", children: "▶" }) }) }) })
|
|
39
|
+
] })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
40
43
|
export {
|
|
41
44
|
VideoHero
|
|
42
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dune-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build-storybook": "storybook build && cp -r skills storybook-static/skills",
|
|
17
17
|
"deploy-storybook": "storybook-to-ghpages -- --existing-output-dir=storybook-static",
|
|
18
18
|
"ondeploy": "pnpm build-storybook && pnpm deploy-storybook",
|
|
19
|
-
"
|
|
19
|
+
"sync:downstream": "bash scripts/postpublish.sh",
|
|
20
20
|
"upload:previews": "tsx scripts/upload-previews-r2.ts"
|
|
21
21
|
},
|
|
22
22
|
"sideEffects": [
|