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
|
@@ -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;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CompoundButton } from "../../../puck-base/button.js";
|
|
3
|
+
import { cn } from "../../../../utils/css-utils.js";
|
|
4
|
+
import { getMapEmbedUrl } from "../../../puck-core/core/props/form.js";
|
|
5
|
+
const ActionButton = ({
|
|
6
|
+
label,
|
|
7
|
+
url,
|
|
8
|
+
action,
|
|
9
|
+
variant = "default",
|
|
10
|
+
size = "default",
|
|
11
|
+
icon = "none",
|
|
12
|
+
colorMode = "theme",
|
|
13
|
+
backgroundColor,
|
|
14
|
+
textColor
|
|
15
|
+
}) => {
|
|
16
|
+
if (!label) return null;
|
|
17
|
+
const useCustomColors = colorMode === "custom";
|
|
18
|
+
const styleVars = {
|
|
19
|
+
...useCustomColors && backgroundColor ? { "--loc2-btn-bg": backgroundColor } : {},
|
|
20
|
+
...useCustomColors && textColor ? { "--loc2-btn-text": textColor } : {}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx("span", { style: Object.keys(styleVars).length ? styleVars : void 0, children: /* @__PURE__ */ jsx(
|
|
23
|
+
CompoundButton,
|
|
24
|
+
{
|
|
25
|
+
label,
|
|
26
|
+
action: action ?? (url ? /^https?:\/\//i.test(url) ? { type: "external", externalUrl: url } : { type: "page", pageUrl: url } : void 0),
|
|
27
|
+
variant,
|
|
28
|
+
size,
|
|
29
|
+
icon,
|
|
30
|
+
className: cn(
|
|
31
|
+
"transition-opacity hover:opacity-90",
|
|
32
|
+
useCustomColors && backgroundColor && "!border-[var(--loc2-btn-bg)] !bg-[var(--loc2-btn-bg)] hover:!bg-[var(--loc2-btn-bg)]",
|
|
33
|
+
useCustomColors && textColor && "!text-[var(--loc2-btn-text)]"
|
|
34
|
+
)
|
|
35
|
+
}
|
|
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
|
+
};
|
|
43
|
+
const Location2 = ({
|
|
44
|
+
heading,
|
|
45
|
+
description,
|
|
46
|
+
displayAddress,
|
|
47
|
+
contentPosition = "left",
|
|
48
|
+
location: loc,
|
|
49
|
+
mapStyle = "default",
|
|
50
|
+
mapTint = "none",
|
|
51
|
+
buttons = [],
|
|
52
|
+
styles
|
|
53
|
+
}) => {
|
|
54
|
+
const isRight = contentPosition === "right";
|
|
55
|
+
const isGlass = (styles == null ? void 0 : styles.cardStyle) === "glass";
|
|
56
|
+
const showMapTint = mapTint === "theme";
|
|
57
|
+
const mapEmbedUrl = loc && loc.lat !== 0 ? getMapEmbedUrl(loc) : void 0;
|
|
58
|
+
const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
|
|
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]";
|
|
60
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full overflow-hidden", heightClass), children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
|
|
62
|
+
mapEmbedUrl ? /* @__PURE__ */ jsx(
|
|
63
|
+
"iframe",
|
|
64
|
+
{
|
|
65
|
+
src: mapEmbedUrl,
|
|
66
|
+
title: (loc == null ? void 0 : loc.address) || "Google Maps",
|
|
67
|
+
className: "h-full w-full border-0",
|
|
68
|
+
loading: "lazy",
|
|
69
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
70
|
+
allowFullScreen: true,
|
|
71
|
+
style: mapFilter ? { filter: mapFilter } : void 0
|
|
72
|
+
}
|
|
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" }),
|
|
74
|
+
showMapTint && /* @__PURE__ */ jsx(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: "bg-primary pointer-events-none absolute inset-0",
|
|
78
|
+
style: {
|
|
79
|
+
opacity: 0.15,
|
|
80
|
+
mixBlendMode: "color"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: "relative z-10 flex h-full w-full items-center px-6 md:px-12 lg:px-16", children: /* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: cn(
|
|
89
|
+
"w-full max-w-sm lg:max-w-md xl:max-w-lg",
|
|
90
|
+
isRight && "ml-auto"
|
|
91
|
+
),
|
|
92
|
+
children: /* @__PURE__ */ jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: cn(
|
|
96
|
+
"rounded-2xl p-8 shadow-xl",
|
|
97
|
+
isGlass ? "border border-white/20 bg-background/75 backdrop-blur-md backdrop-saturate-150" : "bg-background"
|
|
98
|
+
),
|
|
99
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
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 }) }),
|
|
101
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm leading-relaxed", children: description }),
|
|
102
|
+
displayAddress && /* @__PURE__ */ jsxs("div", { className: "text-foreground flex items-start gap-2 text-sm", children: [
|
|
103
|
+
/* @__PURE__ */ jsxs(
|
|
104
|
+
"svg",
|
|
105
|
+
{
|
|
106
|
+
className: "text-primary mt-0.5 shrink-0",
|
|
107
|
+
width: "14",
|
|
108
|
+
height: "14",
|
|
109
|
+
viewBox: "0 0 24 24",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
strokeWidth: "2",
|
|
113
|
+
strokeLinecap: "round",
|
|
114
|
+
strokeLinejoin: "round",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }),
|
|
117
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-pre-line", children: displayAddress })
|
|
122
|
+
] }),
|
|
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)) })
|
|
124
|
+
] })
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
) })
|
|
129
|
+
] });
|
|
130
|
+
};
|
|
131
|
+
export {
|
|
132
|
+
Location2
|
|
133
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Location3 } from "./location.js";
|
|
2
|
+
import { locationField } from "../../../puck-core/core/props/form.js";
|
|
3
|
+
import { createStylesDefaults, createStylesField } from "../../../puck-core/core/styles.js";
|
|
4
|
+
const defaultLocationEntry = {
|
|
5
|
+
name: "San Francisco, CA",
|
|
6
|
+
location: {
|
|
7
|
+
address: "123 Market Street, San Francisco, CA 94105",
|
|
8
|
+
lat: 37.7749,
|
|
9
|
+
lng: -122.4194,
|
|
10
|
+
zoom: 14
|
|
11
|
+
},
|
|
12
|
+
phone: "+1 (415) 555-0100",
|
|
13
|
+
hours: "Mon–Fri: 9am–6pm\nSat: 10am–4pm"
|
|
14
|
+
};
|
|
15
|
+
const location3ExtraStyleFields = {
|
|
16
|
+
mapHeight: {
|
|
17
|
+
type: "radio",
|
|
18
|
+
label: "Map Height",
|
|
19
|
+
options: [
|
|
20
|
+
{ label: "Compact", value: "sm" },
|
|
21
|
+
{ label: "Medium", value: "md" },
|
|
22
|
+
{ label: "Tall", value: "lg" }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
columns: {
|
|
26
|
+
type: "radio",
|
|
27
|
+
label: "Grid Columns",
|
|
28
|
+
options: [
|
|
29
|
+
{ label: "2 Columns", value: "2" },
|
|
30
|
+
{ label: "3 Columns", value: "3" }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const conf = {
|
|
35
|
+
fields: {
|
|
36
|
+
heading: { type: "textarea", contentEditable: true },
|
|
37
|
+
description: { type: "textarea", contentEditable: true },
|
|
38
|
+
mapLocation: { ...locationField, 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
|
+
},
|
|
48
|
+
locations: {
|
|
49
|
+
type: "array",
|
|
50
|
+
min: 1,
|
|
51
|
+
max: 6,
|
|
52
|
+
getItemSummary: (item, index = 0) => item.name || `Location ${index + 1}`,
|
|
53
|
+
arrayFields: {
|
|
54
|
+
name: { type: "text", contentEditable: true },
|
|
55
|
+
location: locationField,
|
|
56
|
+
phone: { type: "text" },
|
|
57
|
+
hours: { type: "textarea", label: "Business Hours" },
|
|
58
|
+
directionsLabel: { type: "text", label: "Directions Button Label" }
|
|
59
|
+
},
|
|
60
|
+
defaultItemProps: defaultLocationEntry
|
|
61
|
+
},
|
|
62
|
+
styles: createStylesField(location3ExtraStyleFields)
|
|
63
|
+
},
|
|
64
|
+
defaultProps: {
|
|
65
|
+
heading: "Our Offices",
|
|
66
|
+
description: "We have teams around the world ready to help you succeed.",
|
|
67
|
+
mapLocation: {
|
|
68
|
+
address: "New York, NY, United States",
|
|
69
|
+
lat: 40.7128,
|
|
70
|
+
lng: -74.006,
|
|
71
|
+
zoom: 11
|
|
72
|
+
},
|
|
73
|
+
mapStyle: "grayscale",
|
|
74
|
+
locations: [
|
|
75
|
+
defaultLocationEntry,
|
|
76
|
+
{
|
|
77
|
+
name: "London, UK",
|
|
78
|
+
location: {
|
|
79
|
+
address: "10 Finsbury Square, London, EC2A 1AF",
|
|
80
|
+
lat: 51.5207,
|
|
81
|
+
lng: -0.0876,
|
|
82
|
+
zoom: 14
|
|
83
|
+
},
|
|
84
|
+
phone: "+44 20 7946 0200",
|
|
85
|
+
hours: "Mon–Fri: 9am–6pm\nSat: 10am–3pm"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "Tokyo, Japan",
|
|
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
|
+
},
|
|
95
|
+
phone: "+81 3-1234-5678",
|
|
96
|
+
hours: "Mon–Fri: 9am–6pm"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
styles: createStylesDefaults({
|
|
100
|
+
mapHeight: "md",
|
|
101
|
+
columns: "3"
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
render: Location3
|
|
105
|
+
};
|
|
106
|
+
export {
|
|
107
|
+
conf,
|
|
108
|
+
conf as default
|
|
109
|
+
};
|
|
@@ -16,9 +16,6 @@ export interface Location3Props {
|
|
|
16
16
|
mapStyle?: "default" | "grayscale" | "dark";
|
|
17
17
|
locations: LocationEntry[];
|
|
18
18
|
styles?: {
|
|
19
|
-
className?: string;
|
|
20
|
-
style?: Record<string, unknown>;
|
|
21
|
-
css?: string;
|
|
22
19
|
padding?: CompoundContainerProps["padding"];
|
|
23
20
|
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
24
21
|
backgroundColor?: string;
|
|
@@ -0,0 +1,140 @@
|
|
|
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, getDirectionsUrl } from "../../../puck-core/core/props/form.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
|
+
};
|
|
11
|
+
const Location3 = ({
|
|
12
|
+
heading,
|
|
13
|
+
description,
|
|
14
|
+
mapLocation,
|
|
15
|
+
mapStyle = "default",
|
|
16
|
+
locations = [],
|
|
17
|
+
styles
|
|
18
|
+
}) => {
|
|
19
|
+
const mapEmbedUrl = mapLocation && mapLocation.lat !== 0 ? getMapEmbedUrl(mapLocation) : void 0;
|
|
20
|
+
const mapFilter = MAP_STYLE_FILTERS[mapStyle] || "";
|
|
21
|
+
const mapHeight = (styles == null ? void 0 : styles.mapHeight) ?? "md";
|
|
22
|
+
const columns = (styles == null ? void 0 : styles.columns) ?? "3";
|
|
23
|
+
const mapHeightClass = mapHeight === "sm" ? "h-[220px] md:h-[260px]" : mapHeight === "lg" ? "h-[360px] md:h-[440px]" : "h-[280px] md:h-[340px]";
|
|
24
|
+
const colClass = columns === "2" ? "sm:grid-cols-2" : "sm:grid-cols-2 lg:grid-cols-3";
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
CompoundContainer,
|
|
27
|
+
{
|
|
28
|
+
padding: styles == null ? void 0 : styles.padding,
|
|
29
|
+
sectionStyle: styles == null ? void 0 : styles.sectionStyle,
|
|
30
|
+
backgroundColor: styles == null ? void 0 : styles.backgroundColor,
|
|
31
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-10", children: [
|
|
32
|
+
(heading || description) && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 text-center", children: [
|
|
33
|
+
heading && /* @__PURE__ */ jsx("h2", { className: "text-foreground whitespace-pre-line font-serif text-3xl leading-tight tracking-tighter md:text-5xl", children: heading }),
|
|
34
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-xl text-base leading-relaxed", children: description })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden rounded-2xl", mapHeightClass), children: mapEmbedUrl ? /* @__PURE__ */ jsx(
|
|
37
|
+
"iframe",
|
|
38
|
+
{
|
|
39
|
+
src: mapEmbedUrl,
|
|
40
|
+
title: (mapLocation == null ? void 0 : mapLocation.address) || "Google Maps",
|
|
41
|
+
className: "h-full w-full border-0",
|
|
42
|
+
loading: "lazy",
|
|
43
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
44
|
+
allowFullScreen: true,
|
|
45
|
+
style: mapFilter ? { filter: mapFilter } : void 0
|
|
46
|
+
}
|
|
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" }) }),
|
|
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,
|
|
118
|
+
{
|
|
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"
|
|
127
|
+
}
|
|
128
|
+
) })
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
i
|
|
132
|
+
);
|
|
133
|
+
}) })
|
|
134
|
+
] })
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
export {
|
|
139
|
+
Location3
|
|
140
|
+
};
|
|
@@ -33,9 +33,6 @@ export type LocationSectionProps = {
|
|
|
33
33
|
contentAlign?: "left" | "right";
|
|
34
34
|
columns?: "2" | "3";
|
|
35
35
|
styles?: {
|
|
36
|
-
className?: string;
|
|
37
|
-
style?: React.CSSProperties;
|
|
38
|
-
css?: string;
|
|
39
36
|
padding?: LocationPadding;
|
|
40
37
|
sectionStyle?: LocationSectionStyle;
|
|
41
38
|
backgroundColor?: string;
|
|
@@ -30,7 +30,7 @@ const TabStats = (props) => {
|
|
|
30
30
|
TabsContent,
|
|
31
31
|
{
|
|
32
32
|
value: tab.value,
|
|
33
|
-
className: "
|
|
33
|
+
className: "animate-tabs",
|
|
34
34
|
children: /* @__PURE__ */ jsxs("div", { className: "relative size-full", children: [
|
|
35
35
|
tab.image && /* @__PURE__ */ jsx(
|
|
36
36
|
CompoundImage,
|