dune-react 0.0.16 → 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/fields.d.ts +23 -0
- package/dist/components/puck-base/core/fields.js +24 -15
- package/dist/components/puck-base/core/styles.d.ts +1 -5
- package/dist/components/puck-base/core/styles.js +1 -5
- package/dist/components/puck-base/core/with-editable.js +2 -2
- package/dist/components/puck-base/editor-context.d.ts +2 -0
- package/dist/components/puck-base/fields/index.d.ts +1 -0
- package/dist/components/puck-base/fields/location-field.d.ts +44 -0
- package/dist/components/puck-base/fields/location-field.js +207 -0
- 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/dist/components/puck-block/location-sections/location-1/index.js +17 -22
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +5 -7
- package/dist/components/puck-block/location-sections/location-1/location.js +15 -12
- package/dist/components/puck-block/location-sections/location-2/index.js +28 -24
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +6 -8
- package/dist/components/puck-block/location-sections/location-2/location.js +18 -15
- package/dist/components/puck-block/location-sections/location-3/index.js +43 -20
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +5 -6
- package/dist/components/puck-block/location-sections/location-3/location.js +96 -86
- package/dist/components/puck-block/location-sections/props.d.ts +9 -10
- package/package.json +3 -2
|
@@ -2,15 +2,22 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
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
|
+
import { getMapEmbedUrl, getDirectionsUrl } from "../../../puck-base/core/fields.js";
|
|
6
|
+
const MAP_STYLE_FILTERS = {
|
|
7
|
+
default: "",
|
|
8
|
+
grayscale: "grayscale(35%) contrast(1.05) brightness(1.0)",
|
|
9
|
+
dark: "grayscale(100%) invert(1) contrast(1.1) brightness(0.8)"
|
|
10
|
+
};
|
|
5
11
|
const Location3 = ({
|
|
6
12
|
heading,
|
|
7
13
|
description,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
mapFilter,
|
|
14
|
+
mapLocation,
|
|
15
|
+
mapStyle = "default",
|
|
11
16
|
locations = [],
|
|
12
17
|
styles
|
|
13
18
|
}) => {
|
|
19
|
+
const mapEmbedUrl = mapLocation && mapLocation.lat !== 0 ? getMapEmbedUrl(mapLocation) : void 0;
|
|
20
|
+
const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
|
|
14
21
|
const mapHeight = (styles == null ? void 0 : styles.mapHeight) ?? "md";
|
|
15
22
|
const columns = (styles == null ? void 0 : styles.columns) ?? "3";
|
|
16
23
|
const mapHeightClass = mapHeight === "sm" ? "h-[220px] md:h-[260px]" : mapHeight === "lg" ? "h-[360px] md:h-[440px]" : "h-[280px] md:h-[340px]";
|
|
@@ -30,97 +37,100 @@ const Location3 = ({
|
|
|
30
37
|
"iframe",
|
|
31
38
|
{
|
|
32
39
|
src: mapEmbedUrl,
|
|
33
|
-
title:
|
|
40
|
+
title: (mapLocation == null ? void 0 : mapLocation.address) || "Google Maps",
|
|
34
41
|
className: "h-full w-full border-0",
|
|
35
42
|
loading: "lazy",
|
|
36
43
|
referrerPolicy: "no-referrer-when-downgrade",
|
|
37
44
|
allowFullScreen: true,
|
|
38
|
-
style: { filter: mapFilter }
|
|
45
|
+
style: mapFilter ? { filter: mapFilter } : void 0
|
|
39
46
|
}
|
|
40
47
|
) : /* @__PURE__ */ jsx("div", { className: "bg-muted text-muted-foreground flex h-full w-full items-center justify-center text-sm", children: "Map address not configured" }) }),
|
|
41
|
-
locations.length > 0 && /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-1 gap-5", colClass), children: locations.map((loc, i) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
48
|
+
locations.length > 0 && /* @__PURE__ */ jsx("div", { className: cn("grid grid-cols-1 gap-5", colClass), children: locations.map((loc, i) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return /* @__PURE__ */ jsxs(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: "bg-card border-border flex flex-col gap-3 rounded-xl border p-6",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx("h3", { className: "text-foreground text-lg font-semibold", children: loc.name }),
|
|
56
|
+
((_a = loc.location) == null ? void 0 : _a.address) && /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-start gap-2 text-sm", children: [
|
|
57
|
+
/* @__PURE__ */ jsxs(
|
|
58
|
+
"svg",
|
|
59
|
+
{
|
|
60
|
+
className: "text-primary mt-0.5 shrink-0",
|
|
61
|
+
width: "14",
|
|
62
|
+
height: "14",
|
|
63
|
+
viewBox: "0 0 24 24",
|
|
64
|
+
fill: "none",
|
|
65
|
+
stroke: "currentColor",
|
|
66
|
+
strokeWidth: "2",
|
|
67
|
+
strokeLinecap: "round",
|
|
68
|
+
strokeLinejoin: "round",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsx("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }),
|
|
71
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-pre-line", children: loc.location.address })
|
|
76
|
+
] }),
|
|
77
|
+
loc.phone && /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
"svg",
|
|
80
|
+
{
|
|
81
|
+
className: "text-primary shrink-0",
|
|
82
|
+
width: "14",
|
|
83
|
+
height: "14",
|
|
84
|
+
viewBox: "0 0 24 24",
|
|
85
|
+
fill: "none",
|
|
86
|
+
stroke: "currentColor",
|
|
87
|
+
strokeWidth: "2",
|
|
88
|
+
strokeLinecap: "round",
|
|
89
|
+
strokeLinejoin: "round",
|
|
90
|
+
children: /* @__PURE__ */ jsx("path", { d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.69 14a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3.62 3h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 10.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 17.92Z" })
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsx("span", { children: loc.phone })
|
|
94
|
+
] }),
|
|
95
|
+
loc.hours && /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-start gap-2 text-sm", children: [
|
|
96
|
+
/* @__PURE__ */ jsxs(
|
|
97
|
+
"svg",
|
|
98
|
+
{
|
|
99
|
+
className: "text-primary mt-0.5 shrink-0",
|
|
100
|
+
width: "14",
|
|
101
|
+
height: "14",
|
|
102
|
+
viewBox: "0 0 24 24",
|
|
103
|
+
fill: "none",
|
|
104
|
+
stroke: "currentColor",
|
|
105
|
+
strokeWidth: "2",
|
|
106
|
+
strokeLinecap: "round",
|
|
107
|
+
strokeLinejoin: "round",
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
110
|
+
/* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-pre-line", children: loc.hours })
|
|
115
|
+
] }),
|
|
116
|
+
(loc.directionsAction || loc.location && loc.location.lat !== 0) && /* @__PURE__ */ jsx("div", { className: "mt-auto pt-2", children: /* @__PURE__ */ jsx(
|
|
117
|
+
CompoundButton,
|
|
89
118
|
{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
strokeLinejoin: "round",
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
101
|
-
/* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
|
|
102
|
-
]
|
|
119
|
+
label: loc.directionsLabel || "Get Directions",
|
|
120
|
+
action: loc.directionsAction ?? (loc.location ? {
|
|
121
|
+
type: "external",
|
|
122
|
+
externalUrl: getDirectionsUrl(loc.location)
|
|
123
|
+
} : void 0),
|
|
124
|
+
variant: "outline",
|
|
125
|
+
size: "sm",
|
|
126
|
+
icon: "map-pin"
|
|
103
127
|
}
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
label: loc.directionsLabel || "Get Directions",
|
|
111
|
-
action: loc.directionsAction ?? (loc.directionsUrl ? {
|
|
112
|
-
type: "external",
|
|
113
|
-
externalUrl: loc.directionsUrl
|
|
114
|
-
} : void 0),
|
|
115
|
-
variant: "outline",
|
|
116
|
-
size: "sm",
|
|
117
|
-
icon: "map-pin"
|
|
118
|
-
}
|
|
119
|
-
) })
|
|
120
|
-
]
|
|
121
|
-
},
|
|
122
|
-
i
|
|
123
|
-
)) })
|
|
128
|
+
) })
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
i
|
|
132
|
+
);
|
|
133
|
+
}) })
|
|
124
134
|
] })
|
|
125
135
|
}
|
|
126
136
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MapLocation } from "@/components/puck-base/core/fields";
|
|
1
2
|
type LocationVariant = "location-1" | "location-2" | "location-3";
|
|
2
3
|
type LocationPadding = {
|
|
3
4
|
top?: "none" | "small" | "medium" | "large";
|
|
@@ -13,22 +14,19 @@ type LocationButton = {
|
|
|
13
14
|
};
|
|
14
15
|
type LocationItem = {
|
|
15
16
|
name: string;
|
|
16
|
-
|
|
17
|
+
location?: MapLocation;
|
|
17
18
|
phone?: string;
|
|
18
19
|
hours?: string;
|
|
19
|
-
directionsUrl?: string;
|
|
20
20
|
};
|
|
21
|
-
type LocationSectionProps = {
|
|
21
|
+
export type LocationSectionProps = {
|
|
22
22
|
variant?: LocationVariant;
|
|
23
23
|
heading?: string;
|
|
24
24
|
description?: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
mapTintColor?: string;
|
|
31
|
-
mapTintOpacity?: number;
|
|
25
|
+
displayAddress?: string;
|
|
26
|
+
location?: MapLocation;
|
|
27
|
+
mapLocation?: MapLocation;
|
|
28
|
+
mapStyle?: "default" | "grayscale" | "dark";
|
|
29
|
+
mapTint?: "none" | "theme";
|
|
32
30
|
buttons?: LocationButton[];
|
|
33
31
|
locations?: LocationItem[];
|
|
34
32
|
contentPosition?: "left" | "right";
|
|
@@ -43,3 +41,4 @@ type LocationSectionProps = {
|
|
|
43
41
|
sectionHeight?: "sm" | "md" | "lg";
|
|
44
42
|
};
|
|
45
43
|
};
|
|
44
|
+
export {};
|
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,8 @@
|
|
|
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
|
+
"upload:previews": "tsx scripts/upload-previews-r2.ts"
|
|
20
21
|
},
|
|
21
22
|
"sideEffects": [
|
|
22
23
|
"*.css"
|