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.
Files changed (30) hide show
  1. package/dist/components/puck-base/core/fields.d.ts +23 -0
  2. package/dist/components/puck-base/core/fields.js +24 -15
  3. package/dist/components/puck-base/core/styles.d.ts +1 -5
  4. package/dist/components/puck-base/core/styles.js +1 -5
  5. package/dist/components/puck-base/core/with-editable.js +2 -2
  6. package/dist/components/puck-base/editor-context.d.ts +2 -0
  7. package/dist/components/puck-base/fields/index.d.ts +1 -0
  8. package/dist/components/puck-base/fields/location-field.d.ts +44 -0
  9. package/dist/components/puck-base/fields/location-field.js +207 -0
  10. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +3 -3
  11. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +57 -11
  12. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +4 -4
  13. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +3 -3
  14. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +4 -3
  15. package/dist/components/puck-block/hero-sections/image-hero-1/index.js +3 -10
  16. package/dist/components/puck-block/hero-sections/props.d.ts +1 -3
  17. package/dist/components/puck-block/hero-sections/video-hero-1/index.js +3 -3
  18. package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.d.ts +4 -4
  19. package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +32 -29
  20. package/dist/components/puck-block/location-sections/location-1/index.js +17 -22
  21. package/dist/components/puck-block/location-sections/location-1/location.d.ts +5 -7
  22. package/dist/components/puck-block/location-sections/location-1/location.js +15 -12
  23. package/dist/components/puck-block/location-sections/location-2/index.js +28 -24
  24. package/dist/components/puck-block/location-sections/location-2/location.d.ts +6 -8
  25. package/dist/components/puck-block/location-sections/location-2/location.js +18 -15
  26. package/dist/components/puck-block/location-sections/location-3/index.js +43 -20
  27. package/dist/components/puck-block/location-sections/location-3/location.d.ts +5 -6
  28. package/dist/components/puck-block/location-sections/location-3/location.js +96 -86
  29. package/dist/components/puck-block/location-sections/props.d.ts +9 -10
  30. package/package.json +3 -2
@@ -1,4 +1,4 @@
1
- import { image, contentFields } from "../../../puck-base/core/fields.js";
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
- posterImage: image,
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
- posterImage: { 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" },
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
- posterImage?: {
5
+ images?: {
6
6
  src: string;
7
- alt: string;
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, posterImage, styles, }: VideoHeroProps) => import("react/jsx-runtime").JSX.Element;
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
- posterImage,
10
+ images,
11
11
  styles
12
- }) => /* @__PURE__ */ jsx(
13
- CompoundContainer,
14
- {
15
- padding: styles == null ? void 0 : styles.padding,
16
- sectionStyle: styles == null ? void 0 : styles.sectionStyle,
17
- backgroundColor: styles == null ? void 0 : styles.backgroundColor,
18
- children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 items-center gap-12 lg:grid-cols-2", children: [
19
- /* @__PURE__ */ jsx(
20
- CompoundContent,
21
- {
22
- badge,
23
- heading,
24
- description,
25
- buttons
26
- }
27
- ),
28
- /* @__PURE__ */ jsx("div", { className: "border-border/20 overflow-hidden rounded-xl border bg-black/50", children: videoUrl ? /* @__PURE__ */ jsx(
29
- "video",
30
- {
31
- src: videoUrl,
32
- poster: posterImage == null ? void 0 : posterImage.src,
33
- controls: true,
34
- className: "aspect-video w-full object-cover"
35
- }
36
- ) : /* @__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: "▶" }) }) }) })
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
  };
@@ -1,4 +1,4 @@
1
- import { button } from "../../../puck-base/core/fields.js";
1
+ import { locationDefaults, button, location } from "../../../puck-base/core/fields.js";
2
2
  import { LocationSection } from "./location.js";
3
3
  import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
4
4
  const locationButtonFields = {
@@ -40,26 +40,24 @@ const conf = {
40
40
  { label: "Map Left / Text Right", value: "right" }
41
41
  ]
42
42
  },
43
- mapEmbedUrl: { type: "text", label: "Google Map Embed URL" },
44
- mapTitle: { type: "text", label: "Map Title" },
45
- mapFilter: { type: "text", label: "Map Filter (CSS)" },
46
- mapTintMode: {
47
- type: "select",
48
- label: "Map Tint Mode",
43
+ location,
44
+ mapStyle: {
45
+ type: "radio",
46
+ label: "Map Style",
47
+ options: [
48
+ { label: "Default", value: "default" },
49
+ { label: "Grayscale", value: "grayscale" },
50
+ { label: "Dark", value: "dark" }
51
+ ]
52
+ },
53
+ mapTint: {
54
+ type: "radio",
55
+ label: "Map Tint",
49
56
  options: [
50
57
  { label: "Theme", value: "theme" },
51
- { label: "Custom", value: "custom" },
52
58
  { label: "None", value: "none" }
53
59
  ]
54
60
  },
55
- mapTintColor: { type: "text", label: "Map Tint Color" },
56
- mapTintOpacity: {
57
- type: "number",
58
- label: "Map Tint Opacity",
59
- min: 0,
60
- max: 1,
61
- step: 0.01
62
- },
63
61
  buttons: {
64
62
  type: "array",
65
63
  max: 3,
@@ -74,12 +72,9 @@ const conf = {
74
72
  description: "We have offices around the globe. Visit us or get in touch with a local team near you.",
75
73
  contentAlign: "left",
76
74
  contentPosition: "left",
77
- mapEmbedUrl: "https://maps.google.com/maps?q=San%20Francisco%2C%20California%2C%20United%20States&z=13&t=m&output=embed",
78
- mapTitle: "Google Maps",
79
- mapFilter: "grayscale(45%) contrast(1.06) brightness(0.98) saturate(0.9)",
80
- mapTintMode: "theme",
81
- mapTintColor: "var(--primary)",
82
- mapTintOpacity: 0.21,
75
+ location: locationDefaults,
76
+ mapStyle: "grayscale",
77
+ mapTint: "theme",
83
78
  buttons: [
84
79
  {
85
80
  label: "Contact us",
@@ -1,5 +1,6 @@
1
1
  import { CompoundContainerProps } from "@/components/puck-base/container";
2
2
  import { CompoundButtonProps } from "@/components/puck-base/button";
3
+ import type { MapLocation } from "@/components/puck-base/core/fields";
3
4
  interface LocationButton extends Omit<CompoundButtonProps, "label"> {
4
5
  label?: string;
5
6
  url?: string;
@@ -12,12 +13,9 @@ export interface LocationSectionProps {
12
13
  description?: string;
13
14
  contentAlign?: "left" | "right";
14
15
  contentPosition?: "left" | "right";
15
- mapEmbedUrl?: string;
16
- mapTitle?: string;
17
- mapFilter?: string;
18
- mapTintMode?: "theme" | "custom" | "none";
19
- mapTintColor?: string;
20
- mapTintOpacity?: number;
16
+ location?: MapLocation;
17
+ mapStyle?: "default" | "grayscale" | "dark";
18
+ mapTint?: "none" | "theme";
21
19
  buttons?: LocationButton[];
22
20
  styles?: {
23
21
  padding?: CompoundContainerProps["padding"];
@@ -25,5 +23,5 @@ export interface LocationSectionProps {
25
23
  backgroundColor?: string;
26
24
  };
27
25
  }
28
- export declare const LocationSection: ({ heading, description, contentAlign, contentPosition, mapEmbedUrl, mapTitle, mapFilter, mapTintMode, mapTintColor, mapTintOpacity, buttons, styles, }: LocationSectionProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const LocationSection: ({ heading, description, contentAlign, contentPosition, location: loc, mapStyle, mapTint, buttons, styles, }: LocationSectionProps) => import("react/jsx-runtime").JSX.Element;
29
27
  export {};
@@ -2,6 +2,7 @@ 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 } from "../../../puck-base/core/fields.js";
5
6
  const LocationActionButton = ({
6
7
  label,
7
8
  url,
@@ -35,24 +36,27 @@ const LocationActionButton = ({
35
36
  }
36
37
  ) });
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
+ };
38
44
  const LocationSection = ({
39
45
  heading,
40
46
  description,
41
47
  contentAlign = "left",
42
48
  contentPosition = "left",
43
- mapEmbedUrl,
44
- mapTitle = "Google Maps",
45
- mapFilter,
46
- mapTintMode = "theme",
47
- mapTintColor,
48
- mapTintOpacity = 0.2,
49
+ location: loc,
50
+ mapStyle = "default",
51
+ mapTint = "theme",
49
52
  buttons = [],
50
53
  styles
51
54
  }) => {
52
55
  const isTextRight = contentAlign === "right";
53
56
  const isContentRight = contentPosition === "right";
54
- const showMapTint = mapTintMode !== "none" && mapTintOpacity > 0;
55
- const mapTintBackgroundColor = mapTintMode === "custom" ? mapTintColor || void 0 : void 0;
57
+ const showMapTint = mapTint === "theme";
58
+ const mapEmbedUrl = loc && loc.lat !== 0 ? getMapEmbedUrl(loc) : void 0;
59
+ const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
56
60
  return /* @__PURE__ */ jsx(
57
61
  CompoundContainer,
58
62
  {
@@ -105,12 +109,12 @@ const LocationSection = ({
105
109
  "iframe",
106
110
  {
107
111
  src: mapEmbedUrl,
108
- title: mapTitle,
112
+ title: (loc == null ? void 0 : loc.address) || "Google Maps",
109
113
  className: "h-full w-full border-0",
110
114
  loading: "lazy",
111
115
  referrerPolicy: "no-referrer-when-downgrade",
112
116
  allowFullScreen: true,
113
- style: { filter: mapFilter }
117
+ style: mapFilter ? { filter: mapFilter } : void 0
114
118
  }
115
119
  ) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: "Map address not configured" }),
116
120
  showMapTint ? /* @__PURE__ */ jsx(
@@ -118,8 +122,7 @@ const LocationSection = ({
118
122
  {
119
123
  className: "bg-primary pointer-events-none absolute inset-0",
120
124
  style: {
121
- backgroundColor: mapTintBackgroundColor,
122
- opacity: mapTintOpacity,
125
+ opacity: 0.2,
123
126
  mixBlendMode: "color"
124
127
  }
125
128
  }
@@ -1,4 +1,4 @@
1
- import { button } from "../../../puck-base/core/fields.js";
1
+ import { button, location } from "../../../puck-base/core/fields.js";
2
2
  import { Location2 } from "./location.js";
3
3
  import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
4
4
  const locationButtonFields = {
@@ -43,7 +43,11 @@ const conf = {
43
43
  fields: {
44
44
  heading: { type: "textarea", contentEditable: true },
45
45
  description: { type: "textarea", contentEditable: true },
46
- address: { type: "textarea", label: "Address", contentEditable: true },
46
+ displayAddress: {
47
+ type: "textarea",
48
+ label: "Display Address",
49
+ contentEditable: true
50
+ },
47
51
  contentPosition: {
48
52
  type: "radio",
49
53
  label: "Card Position",
@@ -52,26 +56,24 @@ const conf = {
52
56
  { label: "Right", value: "right" }
53
57
  ]
54
58
  },
55
- mapEmbedUrl: { type: "text", label: "Google Map Embed URL" },
56
- mapTitle: { type: "text", label: "Map Title" },
57
- mapFilter: { type: "text", label: "Map Filter (CSS)" },
58
- mapTintMode: {
59
- type: "select",
59
+ location,
60
+ mapStyle: {
61
+ type: "radio",
62
+ label: "Map Style",
63
+ options: [
64
+ { label: "Default", value: "default" },
65
+ { label: "Grayscale", value: "grayscale" },
66
+ { label: "Dark", value: "dark" }
67
+ ]
68
+ },
69
+ mapTint: {
70
+ type: "radio",
60
71
  label: "Map Tint",
61
72
  options: [
62
73
  { label: "None", value: "none" },
63
- { label: "Theme", value: "theme" },
64
- { label: "Custom", value: "custom" }
74
+ { label: "Theme", value: "theme" }
65
75
  ]
66
76
  },
67
- mapTintColor: { type: "text", label: "Map Tint Color" },
68
- mapTintOpacity: {
69
- type: "number",
70
- label: "Map Tint Opacity",
71
- min: 0,
72
- max: 1,
73
- step: 0.01
74
- },
75
77
  buttons: {
76
78
  type: "array",
77
79
  max: 3,
@@ -84,14 +86,16 @@ const conf = {
84
86
  defaultProps: {
85
87
  heading: "Our Offices",
86
88
  description: "Visit our headquarters in London or reach out to one of our regional offices worldwide.",
87
- address: "10 Finsbury Square\nLondon, UK EC2A 1AF",
89
+ displayAddress: "10 Finsbury Square\nLondon, UK EC2A 1AF",
88
90
  contentPosition: "left",
89
- mapEmbedUrl: "https://maps.google.com/maps?q=London%2C%20United%20Kingdom&z=13&t=m&output=embed",
90
- mapTitle: "Google Maps",
91
- mapFilter: "grayscale(40%) contrast(1.05) brightness(1.0) saturate(0.85)",
92
- mapTintMode: "none",
93
- mapTintColor: "var(--primary)",
94
- mapTintOpacity: 0.15,
91
+ location: {
92
+ address: "London, United Kingdom",
93
+ lat: 51.5074,
94
+ lng: -0.1278,
95
+ zoom: 13
96
+ },
97
+ mapStyle: "grayscale",
98
+ mapTint: "none",
95
99
  buttons: [
96
100
  {
97
101
  label: "Get Directions",
@@ -1,5 +1,6 @@
1
1
  import { CompoundContainerProps } from "@/components/puck-base/container";
2
2
  import { CompoundButtonProps } from "@/components/puck-base/button";
3
+ import type { MapLocation } from "@/components/puck-base/core/fields";
3
4
  interface LocationButton extends Omit<CompoundButtonProps, "label"> {
4
5
  label?: string;
5
6
  url?: string;
@@ -10,14 +11,11 @@ interface LocationButton extends Omit<CompoundButtonProps, "label"> {
10
11
  export interface Location2Props {
11
12
  heading?: string;
12
13
  description?: string;
13
- address?: string;
14
+ displayAddress?: string;
14
15
  contentPosition?: "left" | "right";
15
- mapEmbedUrl?: string;
16
- mapTitle?: string;
17
- mapFilter?: string;
18
- mapTintMode?: "none" | "theme" | "custom";
19
- mapTintColor?: string;
20
- mapTintOpacity?: number;
16
+ location?: MapLocation;
17
+ mapStyle?: "default" | "grayscale" | "dark";
18
+ mapTint?: "none" | "theme";
21
19
  buttons?: LocationButton[];
22
20
  styles?: {
23
21
  padding?: CompoundContainerProps["padding"];
@@ -27,5 +25,5 @@ export interface Location2Props {
27
25
  sectionHeight?: "sm" | "md" | "lg";
28
26
  };
29
27
  }
30
- export declare const Location2: ({ heading, description, address, contentPosition, mapEmbedUrl, mapTitle, mapFilter, mapTintMode, mapTintColor, mapTintOpacity, buttons, styles, }: Location2Props) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const Location2: ({ heading, description, displayAddress, contentPosition, location: loc, mapStyle, mapTint, buttons, styles, }: Location2Props) => import("react/jsx-runtime").JSX.Element;
31
29
  export {};
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { CompoundButton } from "../../../puck-base/button.js";
3
3
  import { cn } from "../../../../utils/css-utils.js";
4
+ import { getMapEmbedUrl } from "../../../puck-base/core/fields.js";
4
5
  const ActionButton = ({
5
6
  label,
6
7
  url,
@@ -34,24 +35,27 @@ const ActionButton = ({
34
35
  }
35
36
  ) });
36
37
  };
38
+ const MAP_STYLE_FILTERS = {
39
+ default: "",
40
+ grayscale: "grayscale(40%) contrast(1.05) brightness(1.0) saturate(0.85)",
41
+ dark: "grayscale(100%) invert(1) contrast(1.1) brightness(0.8)"
42
+ };
37
43
  const Location2 = ({
38
44
  heading,
39
45
  description,
40
- address,
46
+ displayAddress,
41
47
  contentPosition = "left",
42
- mapEmbedUrl,
43
- mapTitle = "Google Maps",
44
- mapFilter,
45
- mapTintMode = "none",
46
- mapTintColor,
47
- mapTintOpacity = 0.15,
48
+ location: loc,
49
+ mapStyle = "default",
50
+ mapTint = "none",
48
51
  buttons = [],
49
52
  styles
50
53
  }) => {
51
54
  const isRight = contentPosition === "right";
52
55
  const isGlass = (styles == null ? void 0 : styles.cardStyle) === "glass";
53
- const showMapTint = mapTintMode !== "none" && mapTintOpacity > 0;
54
- const tintColor = mapTintMode === "custom" ? mapTintColor || void 0 : void 0;
56
+ const showMapTint = mapTint === "theme";
57
+ const mapEmbedUrl = loc && loc.lat !== 0 ? getMapEmbedUrl(loc) : void 0;
58
+ const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
55
59
  const heightClass = (styles == null ? void 0 : styles.sectionHeight) === "sm" ? "h-[480px]" : (styles == null ? void 0 : styles.sectionHeight) === "lg" ? "h-[75vh] min-h-[520px]" : "h-[600px]";
56
60
  return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full overflow-hidden", heightClass), children: [
57
61
  /* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
@@ -59,12 +63,12 @@ const Location2 = ({
59
63
  "iframe",
60
64
  {
61
65
  src: mapEmbedUrl,
62
- title: mapTitle,
66
+ title: (loc == null ? void 0 : loc.address) || "Google Maps",
63
67
  className: "h-full w-full border-0",
64
68
  loading: "lazy",
65
69
  referrerPolicy: "no-referrer-when-downgrade",
66
70
  allowFullScreen: true,
67
- style: { filter: mapFilter }
71
+ style: mapFilter ? { filter: mapFilter } : void 0
68
72
  }
69
73
  ) : /* @__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" }),
70
74
  showMapTint && /* @__PURE__ */ jsx(
@@ -72,8 +76,7 @@ const Location2 = ({
72
76
  {
73
77
  className: "bg-primary pointer-events-none absolute inset-0",
74
78
  style: {
75
- backgroundColor: tintColor,
76
- opacity: mapTintOpacity,
79
+ opacity: 0.15,
77
80
  mixBlendMode: "color"
78
81
  }
79
82
  }
@@ -96,7 +99,7 @@ const Location2 = ({
96
99
  children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
97
100
  heading && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsx("h2", { className: "text-foreground whitespace-pre-line font-serif text-3xl leading-tight tracking-tighter md:text-4xl", children: heading }) }),
98
101
  description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm leading-relaxed", children: description }),
99
- address && /* @__PURE__ */ jsxs("div", { className: "text-foreground flex items-start gap-2 text-sm", children: [
102
+ displayAddress && /* @__PURE__ */ jsxs("div", { className: "text-foreground flex items-start gap-2 text-sm", children: [
100
103
  /* @__PURE__ */ jsxs(
101
104
  "svg",
102
105
  {
@@ -115,7 +118,7 @@ const Location2 = ({
115
118
  ]
116
119
  }
117
120
  ),
118
- /* @__PURE__ */ jsx("span", { className: "whitespace-pre-line", children: address })
121
+ /* @__PURE__ */ jsx("span", { className: "whitespace-pre-line", children: displayAddress })
119
122
  ] }),
120
123
  buttons.some((button) => button == null ? void 0 : button.label) && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3 pt-1", children: buttons.map((button, index) => /* @__PURE__ */ jsx(ActionButton, { ...button }, index)) })
121
124
  ] })
@@ -1,11 +1,16 @@
1
+ import { location } from "../../../puck-base/core/fields.js";
1
2
  import { Location3 } from "./location.js";
2
3
  import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
3
- const defaultLocation = {
4
+ const defaultLocationEntry = {
4
5
  name: "San Francisco, CA",
5
- address: "123 Market Street\nSan Francisco, CA 94105",
6
+ location: {
7
+ address: "123 Market Street, San Francisco, CA 94105",
8
+ lat: 37.7749,
9
+ lng: -122.4194,
10
+ zoom: 14
11
+ },
6
12
  phone: "+1 (415) 555-0100",
7
- hours: "Mon–Fri: 9am–6pm\nSat: 10am–4pm",
8
- directionsUrl: "https://maps.google.com"
13
+ hours: "Mon–Fri: 9am–6pm\nSat: 10am–4pm"
9
14
  };
10
15
  const location3ExtraStyleFields = {
11
16
  mapHeight: {
@@ -30,9 +35,16 @@ const conf = {
30
35
  fields: {
31
36
  heading: { type: "textarea", contentEditable: true },
32
37
  description: { type: "textarea", contentEditable: true },
33
- mapEmbedUrl: { type: "text", label: "Google Map Embed URL" },
34
- mapTitle: { type: "text", label: "Map Title" },
35
- mapFilter: { type: "text", label: "Map Filter (CSS)" },
38
+ mapLocation: { ...location, label: "Map Location" },
39
+ mapStyle: {
40
+ type: "radio",
41
+ label: "Map Style",
42
+ options: [
43
+ { label: "Default", value: "default" },
44
+ { label: "Grayscale", value: "grayscale" },
45
+ { label: "Dark", value: "dark" }
46
+ ]
47
+ },
36
48
  locations: {
37
49
  type: "array",
38
50
  min: 1,
@@ -40,37 +52,48 @@ const conf = {
40
52
  getItemSummary: (item, index = 0) => item.name || `Location ${index + 1}`,
41
53
  arrayFields: {
42
54
  name: { type: "text", contentEditable: true },
43
- address: { type: "textarea", contentEditable: true },
55
+ location,
44
56
  phone: { type: "text" },
45
57
  hours: { type: "textarea", label: "Business Hours" },
46
- directionsUrl: { type: "text", label: "Directions URL" },
47
58
  directionsLabel: { type: "text", label: "Directions Button Label" }
48
59
  },
49
- defaultItemProps: defaultLocation
60
+ defaultItemProps: defaultLocationEntry
50
61
  },
51
62
  styles: createStylesField(location3ExtraStyleFields)
52
63
  },
53
64
  defaultProps: {
54
65
  heading: "Our Offices",
55
66
  description: "We have teams around the world ready to help you succeed.",
56
- mapEmbedUrl: "https://maps.google.com/maps?q=New%20York%2C%20NY%2C%20United%20States&z=11&t=m&output=embed",
57
- mapTitle: "Google Maps",
58
- mapFilter: "grayscale(35%) contrast(1.05) brightness(1.0)",
67
+ mapLocation: {
68
+ address: "New York, NY, United States",
69
+ lat: 40.7128,
70
+ lng: -74.006,
71
+ zoom: 11
72
+ },
73
+ mapStyle: "grayscale",
59
74
  locations: [
60
- defaultLocation,
75
+ defaultLocationEntry,
61
76
  {
62
77
  name: "London, UK",
63
- address: "10 Finsbury Square\nLondon, EC2A 1AF",
78
+ location: {
79
+ address: "10 Finsbury Square, London, EC2A 1AF",
80
+ lat: 51.5207,
81
+ lng: -0.0876,
82
+ zoom: 14
83
+ },
64
84
  phone: "+44 20 7946 0200",
65
- hours: "Mon–Fri: 9am–6pm\nSat: 10am–3pm",
66
- directionsUrl: "https://maps.google.com"
85
+ hours: "Mon–Fri: 9am–6pm\nSat: 10am–3pm"
67
86
  },
68
87
  {
69
88
  name: "Tokyo, Japan",
70
- address: "1-1-2 Marunouchi\nChiyoda-ku, Tokyo 100-0005",
89
+ location: {
90
+ address: "1-1-2 Marunouchi, Chiyoda-ku, Tokyo 100-0005",
91
+ lat: 35.6812,
92
+ lng: 139.7671,
93
+ zoom: 14
94
+ },
71
95
  phone: "+81 3-1234-5678",
72
- hours: "Mon–Fri: 9am–6pm",
73
- directionsUrl: "https://maps.google.com"
96
+ hours: "Mon–Fri: 9am–6pm"
74
97
  }
75
98
  ],
76
99
  styles: createStylesDefaults({
@@ -1,20 +1,19 @@
1
1
  import { CompoundContainerProps } from "@/components/puck-base/container";
2
2
  import type { Action } from "@/components/puck-base/core/types";
3
+ import type { MapLocation } from "@/components/puck-base/core/fields";
3
4
  export interface LocationEntry {
4
5
  name: string;
5
- address?: string;
6
+ location?: MapLocation;
6
7
  phone?: string;
7
8
  hours?: string;
8
- directionsUrl?: string;
9
9
  directionsLabel?: string;
10
10
  directionsAction?: Action;
11
11
  }
12
12
  export interface Location3Props {
13
13
  heading?: string;
14
14
  description?: string;
15
- mapEmbedUrl?: string;
16
- mapTitle?: string;
17
- mapFilter?: string;
15
+ mapLocation?: MapLocation;
16
+ mapStyle?: "default" | "grayscale" | "dark";
18
17
  locations: LocationEntry[];
19
18
  styles?: {
20
19
  padding?: CompoundContainerProps["padding"];
@@ -24,4 +23,4 @@ export interface Location3Props {
24
23
  columns?: "2" | "3";
25
24
  };
26
25
  }
27
- export declare const Location3: ({ heading, description, mapEmbedUrl, mapTitle, mapFilter, locations, styles, }: Location3Props) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const Location3: ({ heading, description, mapLocation, mapStyle, locations, styles, }: Location3Props) => import("react/jsx-runtime").JSX.Element;