dune-react 0.0.8 → 0.0.9
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/article-card.js +1 -1
- package/dist/components/puck-base/container.d.ts +7 -1
- package/dist/components/puck-base/container.js +2 -1
- package/dist/components/puck-base/content.d.ts +1 -4
- package/dist/components/puck-base/content.js +15 -17
- package/dist/components/puck-base/core/types.d.ts +2 -2
- package/dist/components/puck-base/editor-context.d.ts +8 -0
- package/dist/components/puck-base/fields/auto-field.d.ts +1 -0
- package/dist/components/puck-base/fields/auto-field.js +131 -49
- package/dist/components/puck-base/gradient-text.js +12 -3
- package/dist/components/puck-block/banner-sections/announcement-banner-1/announcement-banner.js +1 -1
- package/dist/components/puck-block/contact-sections/api/form-leads.d.ts +16 -0
- package/dist/components/puck-block/contact-sections/api/form-leads.js +25 -0
- package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.js +8 -16
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.d.ts +26 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +229 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/index.d.ts +5 -0
- package/dist/components/puck-block/contact-sections/contact-us-2/index.js +72 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.d.ts +29 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.js +245 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/index.d.ts +5 -0
- package/dist/components/puck-block/contact-sections/contact-us-3/index.js +101 -0
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +9 -8
- package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +3 -3
- package/dist/components/puck-block/cta-sections/gradient-cta-1/index.js +4 -4
- package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.js +5 -4
- package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +6 -5
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.d.ts +16 -0
- package/dist/components/puck-block/faq-sections/faq-2/faq-2.js +56 -0
- package/dist/components/puck-block/faq-sections/faq-2/index.d.ts +5 -0
- package/dist/components/puck-block/faq-sections/faq-2/index.js +62 -0
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.d.ts +3 -4
- package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.js +13 -3
- package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +34 -14
- package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.js +2 -8
- package/dist/components/puck-block/feature-sections/product-features-1/product-features.js +5 -25
- package/dist/components/puck-block/gallery-sections/gallery-1/gallery.js +3 -2
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.d.ts +14 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +88 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/index.d.ts +5 -0
- package/dist/components/puck-block/gallery-sections/gallery-2/index.js +44 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.d.ts +17 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.js +121 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/index.d.ts +5 -0
- package/dist/components/puck-block/gallery-sections/gallery-3/index.js +60 -0
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +6 -1
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +56 -20
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +12 -1
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.d.ts +1 -1
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +9 -6
- package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +4 -4
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +4 -1
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +60 -62
- package/dist/components/puck-block/index.d.ts +15 -0
- package/dist/components/puck-block/location-sections/location-1/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-1/index.js +103 -0
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +27 -0
- package/dist/components/puck-block/location-sections/location-1/location.js +143 -0
- package/dist/components/puck-block/location-sections/location-2/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-2/index.js +111 -0
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +25 -0
- package/dist/components/puck-block/location-sections/location-2/location.js +136 -0
- package/dist/components/puck-block/location-sections/location-3/index.d.ts +5 -0
- package/dist/components/puck-block/location-sections/location-3/index.js +83 -0
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +22 -0
- package/dist/components/puck-block/location-sections/location-3/location.js +129 -0
- package/dist/components/puck-block/metrics-sections/stats-2/index.d.ts +5 -0
- package/dist/components/puck-block/metrics-sections/stats-2/index.js +77 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.d.ts +16 -0
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +59 -0
- package/dist/components/puck-block/metrics-sections/stats-3/index.d.ts +5 -0
- package/dist/components/puck-block/metrics-sections/stats-3/index.js +94 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.d.ts +17 -0
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +60 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/index.d.ts +5 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/index.js +152 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.d.ts +24 -0
- package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.js +68 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.d.ts +20 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/before-after.js +73 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/index.d.ts +5 -0
- package/dist/components/puck-block/showcase-sections/before-after-1/index.js +74 -0
- package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +2 -8
- package/dist/components/puck-block/team-sections/team-grid-1/team-grid.js +4 -24
- package/dist/components/puck-block/team-sections/team-grid-2/index.d.ts +5 -0
- package/dist/components/puck-block/team-sections/team-grid-2/index.js +63 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.d.ts +21 -0
- package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.js +46 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/index.d.ts +5 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/index.js +54 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.d.ts +21 -0
- package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.js +107 -0
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +2 -1
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.d.ts +5 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.js +50 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.d.ts +15 -0
- package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.js +57 -0
- package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.js +3 -2
- package/dist/components/puck-block/text-sections/articles-1/articles.d.ts +1 -0
- package/dist/components/puck-block/text-sections/articles-1/articles.js +19 -6
- package/dist/components/puck-block/text-sections/articles-1/index.js +16 -4
- package/dist/components/puck-block/text-sections/content-section-1/content-section.js +5 -4
- package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +3 -2
- package/dist/components/shadcn/navigation-menu.d.ts +1 -1
- package/dist/components/shadcn/navigation-menu.js +33 -0
- package/dist/index.js +104 -74
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { conf as AnnouncementBannerConf, type AnnouncementBannerProps } from "./banner-sections/announcement-banner-1/index.tsx";
|
|
2
2
|
export { conf as MarqueeConf, type MarqueeProps } from "./banner-sections/marquee-1/index.tsx";
|
|
3
3
|
export { conf as ContactUsConf, type ContactUsProps } from "./contact-sections/contact-us-1/index.tsx";
|
|
4
|
+
export { conf as ContactUs2Conf, type ContactUs2Props } from "./contact-sections/contact-us-2/index.tsx";
|
|
5
|
+
export { conf as ContactUs3Conf, type ContactUs3Props } from "./contact-sections/contact-us-3/index.tsx";
|
|
4
6
|
export { conf as BannerCtaConf, type BannerCtaProps } from "./cta-sections/banner-cta-1/index.tsx";
|
|
5
7
|
export { conf as CtaConf, type CtaProps } from "./cta-sections/cta-1/index.tsx";
|
|
6
8
|
export { conf as GradientCtaConf, type GradientCtaProps } from "./cta-sections/gradient-cta-1/index.tsx";
|
|
@@ -8,6 +10,7 @@ export { conf as NewsletterSignupConf, type NewsletterSignupProps } from "./cta-
|
|
|
8
10
|
export { conf as PromoSectionConf, type PromoSectionProps } from "./cta-sections/promo-section-1/index.tsx";
|
|
9
11
|
export { conf as AccordionConf, type AccordionProps } from "./faq-sections/accordion-1/index.tsx";
|
|
10
12
|
export { conf as FaqConf, type FaqProps } from "./faq-sections/faq-1/index.tsx";
|
|
13
|
+
export { conf as Faq2Conf, type Faq2Props } from "./faq-sections/faq-2/index.tsx";
|
|
11
14
|
export { conf as BentoConf, type BentoProps } from "./feature-sections/bento-1/index.tsx";
|
|
12
15
|
export { conf as FeatureCardsConf, type FeatureCardsProps } from "./feature-sections/feature-cards-1/index.tsx";
|
|
13
16
|
export { conf as FeatureShowcaseConf, type FeatureShowcaseProps } from "./feature-sections/feature-showcase-1/index.tsx";
|
|
@@ -15,6 +18,8 @@ export { conf as IconGridConf, type IconGridProps } from "./feature-sections/ico
|
|
|
15
18
|
export { conf as ProductFeaturesConf, type ProductFeaturesProps } from "./feature-sections/product-features-1/index.tsx";
|
|
16
19
|
export { conf as FooterConf, type FooterProps } from "./footer-sections/footer-1/index.tsx";
|
|
17
20
|
export { conf as GalleryConf, type GalleryProps } from "./gallery-sections/gallery-1/index.tsx";
|
|
21
|
+
export { conf as Gallery2Conf, type Gallery2Props } from "./gallery-sections/gallery-2/index.tsx";
|
|
22
|
+
export { conf as Gallery3Conf, type Gallery3Props } from "./gallery-sections/gallery-3/index.tsx";
|
|
18
23
|
export { default as HeaderConf, type HeaderProps } from "./header-sections/header-1/index.tsx";
|
|
19
24
|
export { conf as StickyNavConf, type StickyNavProps } from "./header-sections/sticky-nav-1/index.tsx";
|
|
20
25
|
export { conf as FullscreenHeroConf, type FullscreenHeroProps } from "./hero-sections/fullscreen-hero-1/index.tsx";
|
|
@@ -24,15 +29,25 @@ export { conf as HeroConf, type HeroProps } from "./hero-sections/hero-1/index.t
|
|
|
24
29
|
export { conf as ImageHeroConf, type ImageHeroProps } from "./hero-sections/image-hero-1/index.tsx";
|
|
25
30
|
export { conf as SplitHeroConf, type SplitHeroProps } from "./hero-sections/split-hero-1/index.tsx";
|
|
26
31
|
export { conf as VideoHeroConf, type VideoHeroProps } from "./hero-sections/video-hero-1/index.tsx";
|
|
32
|
+
export { conf as LocationConf, type LocationSectionProps as LocationProps } from "./location-sections/location-1/index.tsx";
|
|
33
|
+
export { conf as Location2Conf, type Location2Props } from "./location-sections/location-2/index.tsx";
|
|
34
|
+
export { conf as Location3Conf, type Location3Props } from "./location-sections/location-3/index.tsx";
|
|
27
35
|
export { conf as StatsConf, type StatsProps } from "./metrics-sections/stats-1/index.tsx";
|
|
36
|
+
export { conf as Stats2Conf, type Stats2Props } from "./metrics-sections/stats-2/index.tsx";
|
|
37
|
+
export { conf as Stats3Conf, type Stats3Props } from "./metrics-sections/stats-3/index.tsx";
|
|
28
38
|
export { conf as ComparisonConf, type ComparisonProps } from "./pricing-sections/comparison-1/index.tsx";
|
|
29
39
|
export { conf as PricingConf, type PricingProps } from "./pricing-sections/pricing-1/index.tsx";
|
|
40
|
+
export { conf as Pricing2Conf, type Pricing2Props } from "./pricing-sections/pricing-2/index.tsx";
|
|
41
|
+
export { conf as BeforeAfterConf, type BeforeAfterProps } from "./showcase-sections/before-after-1/index.tsx";
|
|
30
42
|
export { conf as CaseStudyConf, type CaseStudyProps } from "./showcase-sections/case-study-1/index.tsx";
|
|
31
43
|
export { conf as StepByStepConf, type StepByStepProps } from "./showcase-sections/step-by-step-1/index.tsx";
|
|
32
44
|
export { conf as TeamGridConf, type TeamGridProps } from "./team-sections/team-grid-1/index.tsx";
|
|
45
|
+
export { conf as TeamGrid2Conf, type TeamGrid2Props } from "./team-sections/team-grid-2/index.tsx";
|
|
46
|
+
export { conf as TeamProfilesConf, type TeamProfilesProps } from "./team-sections/team-profiles-1/index.tsx";
|
|
33
47
|
export { conf as CustomersConf, type CustomersProps } from "./testimonial-sections/customers-1/index.tsx";
|
|
34
48
|
export { conf as LogoMarqueeConf, type LogoMarqueeProps } from "./testimonial-sections/logo-marquee-1/index.tsx";
|
|
35
49
|
export { conf as ReviewSectionConf, type ReviewSectionProps } from "./testimonial-sections/review-section-1/index.tsx";
|
|
50
|
+
export { conf as LogoWallConf, type LogoWall1Props as LogoWallProps } from "./testimonial-sections/logo-wall-1/index.tsx";
|
|
36
51
|
export { conf as TestimonialsConf, type TestimonialsProps } from "./testimonial-sections/testimonials-1/index.tsx";
|
|
37
52
|
export { conf as ArticlesConf, type ArticlesProps } from "./text-sections/articles-1/index.tsx";
|
|
38
53
|
export { conf as ContentSectionConf, type ContentSectionProps } from "./text-sections/content-section-1/index.tsx";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { paddingDefaults, backgroundColor, sectionStyle, padding, button } from "../../../puck-base/core/fields.js";
|
|
2
|
+
import { LocationSection } from "./location.js";
|
|
3
|
+
const locationButtonField = {
|
|
4
|
+
type: "object",
|
|
5
|
+
objectFields: {
|
|
6
|
+
...button.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
|
+
};
|
|
18
|
+
const conf = {
|
|
19
|
+
fields: {
|
|
20
|
+
heading: { type: "textarea", contentEditable: true },
|
|
21
|
+
description: { type: "textarea", contentEditable: true },
|
|
22
|
+
contentAlign: {
|
|
23
|
+
type: "radio",
|
|
24
|
+
label: "Text Align",
|
|
25
|
+
options: [
|
|
26
|
+
{ label: "Left", value: "left" },
|
|
27
|
+
{ label: "Right", value: "right" }
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
contentPosition: {
|
|
31
|
+
type: "radio",
|
|
32
|
+
label: "Layout",
|
|
33
|
+
options: [
|
|
34
|
+
{ label: "Text Left / Map Right", value: "left" },
|
|
35
|
+
{ label: "Map Left / Text Right", value: "right" }
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
mapEmbedUrl: { type: "text", label: "Google Map Embed URL" },
|
|
39
|
+
mapTitle: { type: "text", label: "Map Title" },
|
|
40
|
+
mapFilter: { type: "text", label: "Map Filter (CSS)" },
|
|
41
|
+
mapTintMode: {
|
|
42
|
+
type: "select",
|
|
43
|
+
label: "Map Tint Mode",
|
|
44
|
+
options: [
|
|
45
|
+
{ label: "Theme", value: "theme" },
|
|
46
|
+
{ label: "Custom", value: "custom" },
|
|
47
|
+
{ label: "None", value: "none" }
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
mapTintColor: { type: "text", label: "Map Tint Color" },
|
|
51
|
+
mapTintOpacity: {
|
|
52
|
+
type: "number",
|
|
53
|
+
label: "Map Tint Opacity",
|
|
54
|
+
min: 0,
|
|
55
|
+
max: 1,
|
|
56
|
+
step: 0.01
|
|
57
|
+
},
|
|
58
|
+
primaryButton: {
|
|
59
|
+
...locationButtonField,
|
|
60
|
+
label: "Primary Button"
|
|
61
|
+
},
|
|
62
|
+
secondaryButton: {
|
|
63
|
+
...locationButtonField,
|
|
64
|
+
label: "Secondary Button"
|
|
65
|
+
},
|
|
66
|
+
padding,
|
|
67
|
+
sectionStyle,
|
|
68
|
+
backgroundColor
|
|
69
|
+
},
|
|
70
|
+
defaultProps: {
|
|
71
|
+
heading: "Find us in\nLos Angeles",
|
|
72
|
+
description: "Located in the heart of Los Angeles, bblopo is easy to reach. Stop by to meet Yanxin and start your fitness journey today.",
|
|
73
|
+
contentAlign: "left",
|
|
74
|
+
contentPosition: "left",
|
|
75
|
+
mapEmbedUrl: "https://maps.google.com/maps?q=Los%20Angeles%2C%20California%2C%20United%20States&z=13&t=m&output=embed",
|
|
76
|
+
mapTitle: "Google Maps",
|
|
77
|
+
mapFilter: "grayscale(45%) contrast(1.06) brightness(0.98) saturate(0.9)",
|
|
78
|
+
mapTintMode: "theme",
|
|
79
|
+
mapTintColor: "var(--primary)",
|
|
80
|
+
mapTintOpacity: 0.21,
|
|
81
|
+
primaryButton: {
|
|
82
|
+
label: "Call to visit",
|
|
83
|
+
url: "tel:+12345678900",
|
|
84
|
+
variant: "default",
|
|
85
|
+
size: "default",
|
|
86
|
+
icon: "none",
|
|
87
|
+
colorMode: "theme"
|
|
88
|
+
},
|
|
89
|
+
secondaryButton: {
|
|
90
|
+
label: "Get directions",
|
|
91
|
+
url: "mailto:email@mybusiness.com",
|
|
92
|
+
variant: "secondary",
|
|
93
|
+
size: "default",
|
|
94
|
+
icon: "none",
|
|
95
|
+
colorMode: "theme"
|
|
96
|
+
},
|
|
97
|
+
padding: paddingDefaults
|
|
98
|
+
},
|
|
99
|
+
render: LocationSection
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
conf
|
|
103
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CompoundContainerProps } from "@/components/puck-base/container";
|
|
2
|
+
import { CompoundButtonProps } from "@/components/puck-base/button";
|
|
3
|
+
interface LocationButton extends Omit<CompoundButtonProps, "label"> {
|
|
4
|
+
label?: string;
|
|
5
|
+
colorMode?: "theme" | "custom";
|
|
6
|
+
backgroundColor?: string;
|
|
7
|
+
textColor?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LocationSectionProps {
|
|
10
|
+
padding?: CompoundContainerProps["padding"];
|
|
11
|
+
sectionStyle?: CompoundContainerProps["sectionStyle"];
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
heading?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
contentAlign?: "left" | "right";
|
|
16
|
+
contentPosition?: "left" | "right";
|
|
17
|
+
mapEmbedUrl?: string;
|
|
18
|
+
mapTitle?: string;
|
|
19
|
+
mapFilter?: string;
|
|
20
|
+
mapTintMode?: "theme" | "custom" | "none";
|
|
21
|
+
mapTintColor?: string;
|
|
22
|
+
mapTintOpacity?: number;
|
|
23
|
+
primaryButton?: LocationButton;
|
|
24
|
+
secondaryButton?: LocationButton;
|
|
25
|
+
}
|
|
26
|
+
export declare const LocationSection: ({ padding, sectionStyle, backgroundColor, heading, description, contentAlign, contentPosition, mapEmbedUrl, mapTitle, mapFilter, mapTintMode, mapTintColor, mapTintOpacity, primaryButton, secondaryButton, }: LocationSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
const LocationActionButton = ({
|
|
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 ? { "--location-btn-bg": backgroundColor } : {},
|
|
20
|
+
...useCustomColors && textColor ? { "--location-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
|
+
url,
|
|
27
|
+
action,
|
|
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 LocationSection = ({
|
|
40
|
+
padding,
|
|
41
|
+
sectionStyle,
|
|
42
|
+
backgroundColor,
|
|
43
|
+
heading,
|
|
44
|
+
description,
|
|
45
|
+
contentAlign = "left",
|
|
46
|
+
contentPosition = "left",
|
|
47
|
+
mapEmbedUrl,
|
|
48
|
+
mapTitle = "Google Maps",
|
|
49
|
+
mapFilter,
|
|
50
|
+
mapTintMode = "theme",
|
|
51
|
+
mapTintColor,
|
|
52
|
+
mapTintOpacity = 0.2,
|
|
53
|
+
primaryButton,
|
|
54
|
+
secondaryButton
|
|
55
|
+
}) => {
|
|
56
|
+
const isTextRight = contentAlign === "right";
|
|
57
|
+
const isContentRight = contentPosition === "right";
|
|
58
|
+
const showMapTint = mapTintMode !== "none" && mapTintOpacity > 0;
|
|
59
|
+
const mapTintBackgroundColor = mapTintMode === "custom" ? mapTintColor || void 0 : void 0;
|
|
60
|
+
return /* @__PURE__ */ jsx(
|
|
61
|
+
CompoundContainer,
|
|
62
|
+
{
|
|
63
|
+
padding,
|
|
64
|
+
sectionStyle,
|
|
65
|
+
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
|
+
((primaryButton == null ? void 0 : primaryButton.label) || (secondaryButton == null ? void 0 : secondaryButton.label)) && /* @__PURE__ */ jsxs(
|
|
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: [
|
|
102
|
+
/* @__PURE__ */ jsx(LocationActionButton, { ...primaryButton }),
|
|
103
|
+
/* @__PURE__ */ jsx(LocationActionButton, { ...secondaryButton })
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
) }),
|
|
110
|
+
/* @__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: [
|
|
111
|
+
mapEmbedUrl ? /* @__PURE__ */ jsx(
|
|
112
|
+
"iframe",
|
|
113
|
+
{
|
|
114
|
+
src: mapEmbedUrl,
|
|
115
|
+
title: mapTitle,
|
|
116
|
+
className: "h-full w-full border-0",
|
|
117
|
+
loading: "lazy",
|
|
118
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
119
|
+
allowFullScreen: true,
|
|
120
|
+
style: { filter: mapFilter }
|
|
121
|
+
}
|
|
122
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center bg-muted text-muted-foreground", children: "地图地址未配置" }),
|
|
123
|
+
showMapTint ? /* @__PURE__ */ jsx(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: "bg-primary pointer-events-none absolute inset-0",
|
|
127
|
+
style: {
|
|
128
|
+
backgroundColor: mapTintBackgroundColor,
|
|
129
|
+
opacity: mapTintOpacity,
|
|
130
|
+
mixBlendMode: "color"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
) : null
|
|
134
|
+
] }) })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
LocationSection
|
|
143
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { button } from "../../../puck-base/core/fields.js";
|
|
2
|
+
import { Location2 } from "./location.js";
|
|
3
|
+
const locationButtonField = {
|
|
4
|
+
type: "object",
|
|
5
|
+
objectFields: {
|
|
6
|
+
...button.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
|
+
};
|
|
18
|
+
const conf = {
|
|
19
|
+
fields: {
|
|
20
|
+
heading: { type: "textarea", contentEditable: true },
|
|
21
|
+
description: { type: "textarea", contentEditable: true },
|
|
22
|
+
address: { type: "textarea", label: "Address", contentEditable: true },
|
|
23
|
+
cardPosition: {
|
|
24
|
+
type: "radio",
|
|
25
|
+
label: "Card Position",
|
|
26
|
+
options: [
|
|
27
|
+
{ label: "Left", value: "left" },
|
|
28
|
+
{ label: "Right", value: "right" }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
cardStyle: {
|
|
32
|
+
type: "radio",
|
|
33
|
+
label: "Card Style",
|
|
34
|
+
options: [
|
|
35
|
+
{ label: "Solid", value: "solid" },
|
|
36
|
+
{ label: "Glass", value: "glass" }
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
sectionHeight: {
|
|
40
|
+
type: "radio",
|
|
41
|
+
label: "Section Height",
|
|
42
|
+
options: [
|
|
43
|
+
{ label: "Compact", value: "sm" },
|
|
44
|
+
{ label: "Medium", value: "md" },
|
|
45
|
+
{ label: "Tall", value: "lg" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
mapEmbedUrl: { type: "text", label: "Google Map Embed URL" },
|
|
49
|
+
mapTitle: { type: "text", label: "Map Title" },
|
|
50
|
+
mapFilter: { type: "text", label: "Map Filter (CSS)" },
|
|
51
|
+
mapTintMode: {
|
|
52
|
+
type: "select",
|
|
53
|
+
label: "Map Tint",
|
|
54
|
+
options: [
|
|
55
|
+
{ label: "None", value: "none" },
|
|
56
|
+
{ label: "Theme", value: "theme" },
|
|
57
|
+
{ label: "Custom", value: "custom" }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
mapTintColor: { type: "text", label: "Map Tint Color" },
|
|
61
|
+
mapTintOpacity: {
|
|
62
|
+
type: "number",
|
|
63
|
+
label: "Map Tint Opacity",
|
|
64
|
+
min: 0,
|
|
65
|
+
max: 1,
|
|
66
|
+
step: 0.01
|
|
67
|
+
},
|
|
68
|
+
primaryButton: {
|
|
69
|
+
...locationButtonField,
|
|
70
|
+
label: "Primary Button"
|
|
71
|
+
},
|
|
72
|
+
secondaryButton: {
|
|
73
|
+
...locationButtonField,
|
|
74
|
+
label: "Secondary Button"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultProps: {
|
|
78
|
+
heading: "Come visit\nus today",
|
|
79
|
+
description: "We're in the heart of the city, easy to reach by public transport or car. Drop by any time.",
|
|
80
|
+
address: "123 Main Street\nNew York, NY 10001",
|
|
81
|
+
cardPosition: "left",
|
|
82
|
+
cardStyle: "solid",
|
|
83
|
+
sectionHeight: "md",
|
|
84
|
+
mapEmbedUrl: "https://maps.google.com/maps?q=New%20York%2C%20NY%2C%20United%20States&z=13&t=m&output=embed",
|
|
85
|
+
mapTitle: "Google Maps",
|
|
86
|
+
mapFilter: "grayscale(40%) contrast(1.05) brightness(1.0) saturate(0.85)",
|
|
87
|
+
mapTintMode: "none",
|
|
88
|
+
mapTintColor: "var(--primary)",
|
|
89
|
+
mapTintOpacity: 0.15,
|
|
90
|
+
primaryButton: {
|
|
91
|
+
label: "Get Directions",
|
|
92
|
+
url: "https://maps.google.com",
|
|
93
|
+
variant: "default",
|
|
94
|
+
size: "default",
|
|
95
|
+
icon: "none",
|
|
96
|
+
colorMode: "theme"
|
|
97
|
+
},
|
|
98
|
+
secondaryButton: {
|
|
99
|
+
label: "Call Us",
|
|
100
|
+
url: "tel:+12345678900",
|
|
101
|
+
variant: "outline",
|
|
102
|
+
size: "default",
|
|
103
|
+
icon: "none",
|
|
104
|
+
colorMode: "theme"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
render: Location2
|
|
108
|
+
};
|
|
109
|
+
export {
|
|
110
|
+
conf
|
|
111
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CompoundButtonProps } from "@/components/puck-base/button";
|
|
2
|
+
interface LocationButton extends Omit<CompoundButtonProps, "label"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
colorMode?: "theme" | "custom";
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
textColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Location2Props {
|
|
9
|
+
heading?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
address?: string;
|
|
12
|
+
cardPosition?: "left" | "right";
|
|
13
|
+
cardStyle?: "solid" | "glass";
|
|
14
|
+
sectionHeight?: "sm" | "md" | "lg";
|
|
15
|
+
mapEmbedUrl?: string;
|
|
16
|
+
mapTitle?: string;
|
|
17
|
+
mapFilter?: string;
|
|
18
|
+
mapTintMode?: "none" | "theme" | "custom";
|
|
19
|
+
mapTintColor?: string;
|
|
20
|
+
mapTintOpacity?: number;
|
|
21
|
+
primaryButton?: LocationButton;
|
|
22
|
+
secondaryButton?: LocationButton;
|
|
23
|
+
}
|
|
24
|
+
export declare const Location2: ({ heading, description, address, cardPosition, cardStyle, sectionHeight, mapEmbedUrl, mapTitle, mapFilter, mapTintMode, mapTintColor, mapTintOpacity, primaryButton, secondaryButton, }: Location2Props) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
const ActionButton = ({
|
|
5
|
+
label,
|
|
6
|
+
url,
|
|
7
|
+
action,
|
|
8
|
+
variant = "default",
|
|
9
|
+
size = "default",
|
|
10
|
+
icon = "none",
|
|
11
|
+
colorMode = "theme",
|
|
12
|
+
backgroundColor,
|
|
13
|
+
textColor
|
|
14
|
+
}) => {
|
|
15
|
+
if (!label) return null;
|
|
16
|
+
const useCustomColors = colorMode === "custom";
|
|
17
|
+
const styleVars = {
|
|
18
|
+
...useCustomColors && backgroundColor ? { "--loc2-btn-bg": backgroundColor } : {},
|
|
19
|
+
...useCustomColors && textColor ? { "--loc2-btn-text": textColor } : {}
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ jsx("span", { style: Object.keys(styleVars).length ? styleVars : void 0, children: /* @__PURE__ */ jsx(
|
|
22
|
+
CompoundButton,
|
|
23
|
+
{
|
|
24
|
+
label,
|
|
25
|
+
url,
|
|
26
|
+
action,
|
|
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 Location2 = ({
|
|
39
|
+
heading,
|
|
40
|
+
description,
|
|
41
|
+
address,
|
|
42
|
+
cardPosition = "left",
|
|
43
|
+
cardStyle = "solid",
|
|
44
|
+
sectionHeight = "md",
|
|
45
|
+
mapEmbedUrl,
|
|
46
|
+
mapTitle = "Google Maps",
|
|
47
|
+
mapFilter,
|
|
48
|
+
mapTintMode = "none",
|
|
49
|
+
mapTintColor,
|
|
50
|
+
mapTintOpacity = 0.15,
|
|
51
|
+
primaryButton,
|
|
52
|
+
secondaryButton
|
|
53
|
+
}) => {
|
|
54
|
+
const isRight = cardPosition === "right";
|
|
55
|
+
const isGlass = cardStyle === "glass";
|
|
56
|
+
const showMapTint = mapTintMode !== "none" && mapTintOpacity > 0;
|
|
57
|
+
const tintColor = mapTintMode === "custom" ? mapTintColor || void 0 : void 0;
|
|
58
|
+
const heightClass = sectionHeight === "sm" ? "h-[480px]" : sectionHeight === "lg" ? "h-[75vh] min-h-[520px]" : "h-[600px]";
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full overflow-hidden", heightClass), children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "absolute inset-0", children: [
|
|
61
|
+
mapEmbedUrl ? /* @__PURE__ */ jsx(
|
|
62
|
+
"iframe",
|
|
63
|
+
{
|
|
64
|
+
src: mapEmbedUrl,
|
|
65
|
+
title: mapTitle,
|
|
66
|
+
className: "h-full w-full border-0",
|
|
67
|
+
loading: "lazy",
|
|
68
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
69
|
+
allowFullScreen: true,
|
|
70
|
+
style: { filter: mapFilter }
|
|
71
|
+
}
|
|
72
|
+
) : /* @__PURE__ */ jsx("div", { className: "bg-muted text-muted-foreground flex h-full w-full items-center justify-center text-sm", children: "地图地址未配置" }),
|
|
73
|
+
showMapTint && /* @__PURE__ */ jsx(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: "bg-primary pointer-events-none absolute inset-0",
|
|
77
|
+
style: {
|
|
78
|
+
backgroundColor: tintColor,
|
|
79
|
+
opacity: mapTintOpacity,
|
|
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
|
+
address && /* @__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: address })
|
|
122
|
+
] }),
|
|
123
|
+
((primaryButton == null ? void 0 : primaryButton.label) || (secondaryButton == null ? void 0 : secondaryButton.label)) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-3 pt-1", children: [
|
|
124
|
+
/* @__PURE__ */ jsx(ActionButton, { ...primaryButton }),
|
|
125
|
+
/* @__PURE__ */ jsx(ActionButton, { ...secondaryButton })
|
|
126
|
+
] })
|
|
127
|
+
] })
|
|
128
|
+
}
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
) })
|
|
132
|
+
] });
|
|
133
|
+
};
|
|
134
|
+
export {
|
|
135
|
+
Location2
|
|
136
|
+
};
|