dune-react 0.0.9 → 0.0.10

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 (197) hide show
  1. package/dist/components/puck-base/button.js +2 -1
  2. package/dist/components/puck-base/core/fields.d.ts +1 -127
  3. package/dist/components/puck-base/core/fields.js +1 -76
  4. package/dist/components/puck-base/core/styles.d.ts +1877 -0
  5. package/dist/components/puck-base/core/styles.js +286 -0
  6. package/dist/components/puck-base/core/with-editable.d.ts +4 -1
  7. package/dist/components/puck-base/core/with-editable.js +51 -27
  8. package/dist/components/puck-block/banner-sections/announcement-banner-1/announcement-banner.d.ts +9 -7
  9. package/dist/components/puck-block/banner-sections/announcement-banner-1/announcement-banner.js +11 -8
  10. package/dist/components/puck-block/banner-sections/announcement-banner-1/index.js +19 -37
  11. package/dist/components/puck-block/banner-sections/marquee-1/index.js +26 -24
  12. package/dist/components/puck-block/banner-sections/marquee-1/marquee.d.ts +9 -9
  13. package/dist/components/puck-block/banner-sections/marquee-1/marquee.js +28 -21
  14. package/dist/components/puck-block/banner-sections/props.d.ts +22 -0
  15. package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.d.ts +13 -4
  16. package/dist/components/puck-block/contact-sections/contact-us-1/contact-us.js +114 -105
  17. package/dist/components/puck-block/contact-sections/contact-us-1/index.js +87 -7
  18. package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.d.ts +15 -11
  19. package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +27 -22
  20. package/dist/components/puck-block/contact-sections/contact-us-2/index.js +54 -52
  21. package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.d.ts +15 -12
  22. package/dist/components/puck-block/contact-sections/contact-us-3/contact-us-3.js +29 -24
  23. package/dist/components/puck-block/contact-sections/contact-us-3/index.js +73 -60
  24. package/dist/components/puck-block/contact-sections/props.d.ts +65 -0
  25. package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.d.ts +12 -9
  26. package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +27 -30
  27. package/dist/components/puck-block/cta-sections/banner-cta-1/index.js +23 -25
  28. package/dist/components/puck-block/cta-sections/cta-1/cta.d.ts +6 -4
  29. package/dist/components/puck-block/cta-sections/cta-1/cta.js +5 -7
  30. package/dist/components/puck-block/cta-sections/cta-1/index.js +5 -9
  31. package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.d.ts +10 -10
  32. package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +24 -20
  33. package/dist/components/puck-block/cta-sections/gradient-cta-1/index.js +36 -29
  34. package/dist/components/puck-block/cta-sections/newsletter-signup-1/index.js +13 -5
  35. package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.d.ts +7 -3
  36. package/dist/components/puck-block/cta-sections/newsletter-signup-1/newsletter-signup.js +35 -32
  37. package/dist/components/puck-block/cta-sections/promo-section-1/index.js +4 -5
  38. package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.d.ts +6 -4
  39. package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +93 -79
  40. package/dist/components/puck-block/cta-sections/props.d.ts +47 -0
  41. package/dist/components/puck-block/faq-sections/accordion-1/accordion.d.ts +6 -4
  42. package/dist/components/puck-block/faq-sections/accordion-1/accordion.js +39 -33
  43. package/dist/components/puck-block/faq-sections/accordion-1/index.js +3 -5
  44. package/dist/components/puck-block/faq-sections/faq-1/faq.d.ts +9 -7
  45. package/dist/components/puck-block/faq-sections/faq-1/faq.js +50 -44
  46. package/dist/components/puck-block/faq-sections/faq-1/index.js +12 -14
  47. package/dist/components/puck-block/faq-sections/faq-2/faq-2.d.ts +6 -4
  48. package/dist/components/puck-block/faq-sections/faq-2/faq-2.js +4 -6
  49. package/dist/components/puck-block/faq-sections/faq-2/index.js +4 -5
  50. package/dist/components/puck-block/faq-sections/props.d.ts +30 -0
  51. package/dist/components/puck-block/feature-sections/bento-1/bento.d.ts +6 -4
  52. package/dist/components/puck-block/feature-sections/bento-1/bento.js +2 -4
  53. package/dist/components/puck-block/feature-sections/bento-1/index.js +4 -5
  54. package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.d.ts +6 -4
  55. package/dist/components/puck-block/feature-sections/feature-cards-1/feature-cards.js +2 -4
  56. package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +4 -5
  57. package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.d.ts +6 -4
  58. package/dist/components/puck-block/feature-sections/feature-showcase-1/feature-showcase.js +2 -4
  59. package/dist/components/puck-block/feature-sections/feature-showcase-1/index.js +4 -5
  60. package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.d.ts +6 -4
  61. package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.js +59 -53
  62. package/dist/components/puck-block/feature-sections/icon-grid-1/index.js +7 -8
  63. package/dist/components/puck-block/feature-sections/product-features-1/index.js +4 -5
  64. package/dist/components/puck-block/feature-sections/product-features-1/product-features.d.ts +6 -4
  65. package/dist/components/puck-block/feature-sections/product-features-1/product-features.js +2 -4
  66. package/dist/components/puck-block/feature-sections/props.d.ts +48 -0
  67. package/dist/components/puck-block/footer-sections/footer-1/footer.d.ts +5 -3
  68. package/dist/components/puck-block/footer-sections/footer-1/footer.js +6 -6
  69. package/dist/components/puck-block/footer-sections/footer-1/index.js +3 -5
  70. package/dist/components/puck-block/footer-sections/props.d.ts +31 -0
  71. package/dist/components/puck-block/gallery-sections/gallery-1/gallery.d.ts +9 -7
  72. package/dist/components/puck-block/gallery-sections/gallery-1/gallery.js +48 -40
  73. package/dist/components/puck-block/gallery-sections/gallery-1/index.js +32 -34
  74. package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.d.ts +6 -4
  75. package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +5 -7
  76. package/dist/components/puck-block/gallery-sections/gallery-2/index.js +3 -5
  77. package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.d.ts +7 -5
  78. package/dist/components/puck-block/gallery-sections/gallery-3/gallery-3.js +5 -7
  79. package/dist/components/puck-block/gallery-sections/gallery-3/index.js +13 -14
  80. package/dist/components/puck-block/gallery-sections/props.d.ts +26 -0
  81. package/dist/components/puck-block/header-sections/header-1/header.d.ts +7 -5
  82. package/dist/components/puck-block/header-sections/header-1/header.js +8 -9
  83. package/dist/components/puck-block/header-sections/header-1/index.d.ts +1 -1
  84. package/dist/components/puck-block/header-sections/header-1/index.js +13 -12
  85. package/dist/components/puck-block/header-sections/props.d.ts +41 -0
  86. package/dist/components/puck-block/header-sections/sticky-nav-1/index.js +12 -12
  87. package/dist/components/puck-block/header-sections/sticky-nav-1/sticky-nav.d.ts +8 -6
  88. package/dist/components/puck-block/header-sections/sticky-nav-1/sticky-nav.js +5 -5
  89. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.d.ts +7 -5
  90. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +5 -4
  91. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +17 -16
  92. package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.d.ts +8 -4
  93. package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +36 -26
  94. package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +18 -15
  95. package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.d.ts +7 -6
  96. package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.js +7 -10
  97. package/dist/components/puck-block/hero-sections/grid-hero-1/index.js +43 -11
  98. package/dist/components/puck-block/hero-sections/hero-1/hero.d.ts +6 -4
  99. package/dist/components/puck-block/hero-sections/hero-1/hero.js +5 -7
  100. package/dist/components/puck-block/hero-sections/hero-1/index.js +4 -4
  101. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +10 -7
  102. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +65 -59
  103. package/dist/components/puck-block/hero-sections/image-hero-1/index.js +16 -34
  104. package/dist/components/puck-block/hero-sections/props.d.ts +71 -0
  105. package/dist/components/puck-block/hero-sections/split-hero-1/index.js +6 -5
  106. package/dist/components/puck-block/hero-sections/split-hero-1/split-hero.d.ts +8 -8
  107. package/dist/components/puck-block/hero-sections/split-hero-1/split-hero.js +48 -47
  108. package/dist/components/puck-block/hero-sections/video-hero-1/index.js +4 -3
  109. package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.d.ts +6 -2
  110. package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +30 -22
  111. package/dist/components/puck-block/location-sections/location-1/index.js +47 -42
  112. package/dist/components/puck-block/location-sections/location-1/location.d.ts +7 -6
  113. package/dist/components/puck-block/location-sections/location-1/location.js +7 -13
  114. package/dist/components/puck-block/location-sections/location-2/index.js +69 -57
  115. package/dist/components/puck-block/location-sections/location-2/location.d.ts +11 -6
  116. package/dist/components/puck-block/location-sections/location-2/location.js +7 -12
  117. package/dist/components/puck-block/location-sections/location-3/index.js +25 -24
  118. package/dist/components/puck-block/location-sections/location-3/location.d.ts +8 -6
  119. package/dist/components/puck-block/location-sections/location-3/location.js +7 -9
  120. package/dist/components/puck-block/location-sections/props.d.ts +45 -0
  121. package/dist/components/puck-block/metrics-sections/props.d.ts +43 -0
  122. package/dist/components/puck-block/metrics-sections/stats-1/index.js +6 -7
  123. package/dist/components/puck-block/metrics-sections/stats-1/stats.d.ts +7 -5
  124. package/dist/components/puck-block/metrics-sections/stats-1/stats.js +61 -55
  125. package/dist/components/puck-block/metrics-sections/stats-2/index.js +4 -5
  126. package/dist/components/puck-block/metrics-sections/stats-2/stats-2.d.ts +6 -4
  127. package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +4 -6
  128. package/dist/components/puck-block/metrics-sections/stats-3/index.js +21 -29
  129. package/dist/components/puck-block/metrics-sections/stats-3/stats-3.d.ts +7 -6
  130. package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +9 -13
  131. package/dist/components/puck-block/pricing-sections/comparison-1/comparison.d.ts +7 -5
  132. package/dist/components/puck-block/pricing-sections/comparison-1/comparison.js +45 -39
  133. package/dist/components/puck-block/pricing-sections/comparison-1/index.js +5 -7
  134. package/dist/components/puck-block/pricing-sections/pricing-1/index.js +10 -11
  135. package/dist/components/puck-block/pricing-sections/pricing-1/pricing.d.ts +8 -6
  136. package/dist/components/puck-block/pricing-sections/pricing-1/pricing.js +47 -35
  137. package/dist/components/puck-block/pricing-sections/pricing-2/index.js +7 -8
  138. package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.d.ts +6 -4
  139. package/dist/components/puck-block/pricing-sections/pricing-2/pricing-2.js +60 -57
  140. package/dist/components/puck-block/pricing-sections/props.d.ts +46 -0
  141. package/dist/components/puck-block/showcase-sections/before-after-1/before-after.d.ts +7 -5
  142. package/dist/components/puck-block/showcase-sections/before-after-1/before-after.js +8 -10
  143. package/dist/components/puck-block/showcase-sections/before-after-1/index.js +6 -7
  144. package/dist/components/puck-block/showcase-sections/case-study-1/case-study.d.ts +6 -2
  145. package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +29 -21
  146. package/dist/components/puck-block/showcase-sections/case-study-1/index.js +4 -3
  147. package/dist/components/puck-block/showcase-sections/props.d.ts +48 -0
  148. package/dist/components/puck-block/showcase-sections/step-by-step-1/index.js +3 -5
  149. package/dist/components/puck-block/showcase-sections/step-by-step-1/step-by-step.d.ts +6 -4
  150. package/dist/components/puck-block/showcase-sections/step-by-step-1/step-by-step.js +38 -41
  151. package/dist/components/puck-block/team-sections/props.d.ts +39 -0
  152. package/dist/components/puck-block/team-sections/team-grid-1/index.js +4 -5
  153. package/dist/components/puck-block/team-sections/team-grid-1/team-grid.d.ts +6 -4
  154. package/dist/components/puck-block/team-sections/team-grid-1/team-grid.js +23 -17
  155. package/dist/components/puck-block/team-sections/team-grid-2/index.js +4 -5
  156. package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.d.ts +6 -4
  157. package/dist/components/puck-block/team-sections/team-grid-2/team-grid-2.js +5 -7
  158. package/dist/components/puck-block/team-sections/team-profiles-1/index.js +4 -5
  159. package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.d.ts +6 -4
  160. package/dist/components/puck-block/team-sections/team-profiles-1/team-profiles.js +5 -7
  161. package/dist/components/puck-block/testimonial-sections/customers-1/customers.d.ts +9 -7
  162. package/dist/components/puck-block/testimonial-sections/customers-1/customers.js +8 -11
  163. package/dist/components/puck-block/testimonial-sections/customers-1/index.js +17 -17
  164. package/dist/components/puck-block/testimonial-sections/logo-marquee-1/index.js +15 -12
  165. package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.d.ts +7 -3
  166. package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +33 -24
  167. package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.js +17 -16
  168. package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.d.ts +6 -4
  169. package/dist/components/puck-block/testimonial-sections/logo-wall-1/logo-wall.js +5 -7
  170. package/dist/components/puck-block/testimonial-sections/props.d.ts +34 -0
  171. package/dist/components/puck-block/testimonial-sections/review-section-1/index.js +16 -15
  172. package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.d.ts +8 -6
  173. package/dist/components/puck-block/testimonial-sections/review-section-1/review-section.js +22 -17
  174. package/dist/components/puck-block/testimonial-sections/testimonials-1/index.js +17 -17
  175. package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.d.ts +8 -6
  176. package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.js +76 -63
  177. package/dist/components/puck-block/text-sections/articles-1/articles.d.ts +7 -5
  178. package/dist/components/puck-block/text-sections/articles-1/articles.js +41 -34
  179. package/dist/components/puck-block/text-sections/articles-1/index.js +24 -24
  180. package/dist/components/puck-block/text-sections/content-section-1/content-section.d.ts +7 -5
  181. package/dist/components/puck-block/text-sections/content-section-1/content-section.js +6 -8
  182. package/dist/components/puck-block/text-sections/content-section-1/index.js +14 -14
  183. package/dist/components/puck-block/text-sections/props.d.ts +58 -0
  184. package/dist/components/puck-block/text-sections/rich-text-1/index.js +13 -15
  185. package/dist/components/puck-block/text-sections/rich-text-1/rich-text.d.ts +7 -5
  186. package/dist/components/puck-block/text-sections/rich-text-1/rich-text.js +11 -11
  187. package/dist/components/puck-block/text-sections/tab-section-1/index.js +4 -5
  188. package/dist/components/puck-block/text-sections/tab-section-1/tab-section.d.ts +6 -4
  189. package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +3 -5
  190. package/dist/components/puck-block/text-sections/timeline-1/index.js +3 -5
  191. package/dist/components/puck-block/text-sections/timeline-1/timeline.d.ts +6 -4
  192. package/dist/components/puck-block/text-sections/timeline-1/timeline.js +3 -5
  193. package/dist/components/puck-block/text-sections/two-column-1/index.js +4 -6
  194. package/dist/components/puck-block/text-sections/two-column-1/two-column.d.ts +6 -4
  195. package/dist/components/puck-block/text-sections/two-column-1/two-column.js +5 -7
  196. package/dist/index.js +2 -1
  197. package/package.json +1 -1
@@ -6,32 +6,39 @@ const SPEED_DURATION = {
6
6
  fast: "15s"
7
7
  };
8
8
  const Marquee = ({
9
- padding,
10
- sectionStyle,
11
- backgroundColor,
12
9
  items = [],
13
- speed = "normal",
14
- variant = "default"
10
+ styles
15
11
  }) => {
16
- const textClass = variant === "outline" ? "text-transparent [-webkit-text-stroke:1px_currentColor]" : variant === "muted" ? "text-muted-foreground/30" : "text-foreground";
17
- return /* @__PURE__ */ jsx(CompoundContainer, { padding, sectionStyle, backgroundColor, children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx(
18
- "div",
12
+ const normalized = items.map((v) => typeof v === "string" ? v : (v == null ? void 0 : v.text) ?? "");
13
+ const speed = (styles == null ? void 0 : styles.speed) ?? "normal";
14
+ const tone = (styles == null ? void 0 : styles.tone) ?? "default";
15
+ const textClass = tone === "outline" ? "text-transparent [-webkit-text-stroke:1px_currentColor]" : tone === "muted" ? "text-muted-foreground/30" : "text-foreground";
16
+ return /* @__PURE__ */ jsx(
17
+ CompoundContainer,
19
18
  {
20
- className: "flex w-max animate-[marquee_var(--marquee-speed)_linear_infinite] items-center gap-8",
21
- style: { "--marquee-speed": SPEED_DURATION[speed] },
22
- children: [...items, ...items].map((item, i) => /* @__PURE__ */ jsxs(
23
- "span",
19
+ padding: styles == null ? void 0 : styles.padding,
20
+ sectionStyle: styles == null ? void 0 : styles.sectionStyle,
21
+ backgroundColor: styles == null ? void 0 : styles.backgroundColor,
22
+ children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx(
23
+ "div",
24
24
  {
25
- className: `font-serif text-4xl font-bold whitespace-nowrap md:text-6xl ${textClass}`,
26
- children: [
27
- item.text,
28
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/30 mx-4", children: "•" })
29
- ]
30
- },
31
- i
32
- ))
25
+ className: "flex w-max animate-[marquee_var(--marquee-speed)_linear_infinite] items-center gap-8",
26
+ style: { "--marquee-speed": SPEED_DURATION[speed] },
27
+ children: [...normalized, ...normalized].map((item, i) => /* @__PURE__ */ jsxs(
28
+ "span",
29
+ {
30
+ className: `font-serif text-4xl font-bold whitespace-nowrap md:text-6xl ${textClass}`,
31
+ children: [
32
+ item,
33
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/30 mx-4", children: "•" })
34
+ ]
35
+ },
36
+ i
37
+ ))
38
+ }
39
+ ) })
33
40
  }
34
- ) }) });
41
+ );
35
42
  };
36
43
  export {
37
44
  Marquee
@@ -0,0 +1,22 @@
1
+ type BannerVariant = "announcement-banner-1" | "marquee-1";
2
+ type BannerPadding = {
3
+ top?: "none" | "small" | "medium" | "large";
4
+ bottom?: "none" | "small" | "medium" | "large";
5
+ };
6
+ type BannerSectionStyle = "default" | "dark" | "muted" | "inverted" | "custom";
7
+ type BannerSectionProps = {
8
+ variant?: BannerVariant;
9
+ items?: string[];
10
+ linkLabel?: string;
11
+ linkUrl?: string;
12
+ styles?: {
13
+ padding?: BannerPadding;
14
+ sectionStyle?: BannerSectionStyle;
15
+ backgroundColor?: string;
16
+ textColor?: string;
17
+ align?: "left" | "center" | "right";
18
+ size?: "small" | "default";
19
+ speed?: "slow" | "normal" | "fast";
20
+ tone?: "default" | "outline" | "muted";
21
+ };
22
+ };
@@ -21,9 +21,18 @@ export interface ContactForm {
21
21
  };
22
22
  }
23
23
  export interface ContactUsProps extends CompoundContentProps {
24
- padding?: CompoundContainerProps["padding"];
25
- sectionStyle?: CompoundContainerProps["sectionStyle"];
26
- backgroundColor?: string;
27
- form?: ContactForm;
24
+ fields?: ContactFormField[];
25
+ action?: string;
26
+ method?: "get" | "post" | "dialog";
27
+ formTitle?: string;
28
+ submitLabel?: string;
29
+ submitVariant?: string;
30
+ submitSize?: string;
31
+ submitIcon?: string;
32
+ styles?: {
33
+ padding?: CompoundContainerProps["padding"];
34
+ sectionStyle?: CompoundContainerProps["sectionStyle"];
35
+ backgroundColor?: string;
36
+ };
28
37
  }
29
38
  export declare const ContactUs: (props: ContactUsProps) => import("react/jsx-runtime").JSX.Element;
@@ -18,9 +18,9 @@ const DEFAULT_FIELDS = [
18
18
  { label: "Message", name: "message", type: "textarea", required: true }
19
19
  ];
20
20
  const ContactUs = (props) => {
21
- var _a, _b, _c, _d, _e, _f;
21
+ var _a, _b, _c, _d;
22
22
  const { isEditor: isEditorMode, siteId, domain } = useEditorContext();
23
- const formFields = ((_b = (_a = props.form) == null ? void 0 : _a.fields) == null ? void 0 : _b.length) ? props.form.fields : DEFAULT_FIELDS;
23
+ const formFields = ((_a = props.fields) == null ? void 0 : _a.length) ? props.fields : DEFAULT_FIELDS;
24
24
  const [values, setValues] = useState({});
25
25
  const [submitting, setSubmitting] = useState(false);
26
26
  const setValue = (name, value) => setValues((prev) => ({ ...prev, [name]: value }));
@@ -46,114 +46,123 @@ const ContactUs = (props) => {
46
46
  setSubmitting(false);
47
47
  }
48
48
  };
49
- const submitLabel = ((_d = (_c = props.form) == null ? void 0 : _c.button) == null ? void 0 : _d.label) ?? "Send Message";
50
- const submitIcon = ((_f = (_e = props.form) == null ? void 0 : _e.button) == null ? void 0 : _f.icon) ?? "send";
51
- return /* @__PURE__ */ jsx(CompoundContainer, { padding: props.padding, sectionStyle: props.sectionStyle, backgroundColor: props.backgroundColor, className: props.className, children: /* @__PURE__ */ jsxs("div", { className: "grid lg:grid-cols-2 gap-10", children: [
52
- /* @__PURE__ */ jsx(
53
- CompoundContent,
54
- {
55
- badge: props.badge,
56
- heading: props.heading,
57
- description: props.description,
58
- features: props.features,
59
- buttons: props.buttons,
60
- alignContent: "start",
61
- spacing: "normal"
62
- }
63
- ),
64
- /* @__PURE__ */ jsx("div", { className: "justify-center flex items-center", children: /* @__PURE__ */ jsxs(
65
- "form",
66
- {
67
- className: "rounded-md max-w-md w-full flex flex-col border p-8 gap-4",
68
- onSubmit: handleSubmit,
69
- children: [
70
- formFields.reduce((rows, field, i) => {
71
- var _a2, _b2, _c2;
72
- const fieldEl = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
73
- /* @__PURE__ */ jsxs(Label, { htmlFor: `contact-${field.name}`, children: [
74
- field.label,
75
- field.required ? " *" : ""
76
- ] }),
77
- field.type === "textarea" ? /* @__PURE__ */ jsx(
78
- Textarea,
79
- {
80
- id: `contact-${field.name}`,
81
- value: values[field.name] ?? "",
82
- onChange: (e) => setValue(field.name, e.target.value),
83
- rows: 4,
84
- required: field.required
49
+ const submitLabel = props.submitLabel ?? "Send Message";
50
+ const submitIcon = props.submitIcon ?? "send";
51
+ return /* @__PURE__ */ jsx(
52
+ CompoundContainer,
53
+ {
54
+ padding: (_b = props.styles) == null ? void 0 : _b.padding,
55
+ sectionStyle: (_c = props.styles) == null ? void 0 : _c.sectionStyle,
56
+ backgroundColor: (_d = props.styles) == null ? void 0 : _d.backgroundColor,
57
+ className: props.className,
58
+ children: /* @__PURE__ */ jsxs("div", { className: "grid lg:grid-cols-2 gap-10", children: [
59
+ /* @__PURE__ */ jsx(
60
+ CompoundContent,
61
+ {
62
+ badge: props.badge,
63
+ heading: props.heading,
64
+ description: props.description,
65
+ features: props.features,
66
+ buttons: props.buttons,
67
+ alignContent: "start",
68
+ spacing: "normal"
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx("div", { className: "justify-center flex items-center", children: /* @__PURE__ */ jsxs(
72
+ "form",
73
+ {
74
+ className: "rounded-md max-w-md w-full flex flex-col border p-8 gap-4",
75
+ onSubmit: handleSubmit,
76
+ children: [
77
+ formFields.reduce((rows, field, i) => {
78
+ var _a2, _b2, _c2;
79
+ const fieldEl = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
80
+ /* @__PURE__ */ jsxs(Label, { htmlFor: `contact-${field.name}`, children: [
81
+ field.label,
82
+ field.required ? " *" : ""
83
+ ] }),
84
+ field.type === "textarea" ? /* @__PURE__ */ jsx(
85
+ Textarea,
86
+ {
87
+ id: `contact-${field.name}`,
88
+ value: values[field.name] ?? "",
89
+ onChange: (e) => setValue(field.name, e.target.value),
90
+ rows: 4,
91
+ required: field.required
92
+ }
93
+ ) : field.type === "select" ? /* @__PURE__ */ jsxs(
94
+ "select",
95
+ {
96
+ id: `contact-${field.name}`,
97
+ value: values[field.name] ?? "",
98
+ onChange: (e) => setValue(field.name, e.target.value),
99
+ className: "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
100
+ required: field.required,
101
+ children: [
102
+ /* @__PURE__ */ jsx("option", { value: "", children: "Select..." }),
103
+ (_a2 = field.options) == null ? void 0 : _a2.map((opt) => /* @__PURE__ */ jsx("option", { value: opt, children: opt }, opt))
104
+ ]
105
+ }
106
+ ) : /* @__PURE__ */ jsx(
107
+ Input,
108
+ {
109
+ id: `contact-${field.name}`,
110
+ type: field.type,
111
+ value: values[field.name] ?? "",
112
+ onChange: (e) => setValue(field.name, e.target.value),
113
+ required: field.required
114
+ }
115
+ )
116
+ ] }, field.name);
117
+ if (field.half && ((_b2 = formFields[i + 1]) == null ? void 0 : _b2.half)) {
118
+ return rows;
85
119
  }
86
- ) : field.type === "select" ? /* @__PURE__ */ jsxs(
87
- "select",
88
- {
89
- id: `contact-${field.name}`,
90
- value: values[field.name] ?? "",
91
- onChange: (e) => setValue(field.name, e.target.value),
92
- className: "border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
93
- required: field.required,
94
- children: [
95
- /* @__PURE__ */ jsx("option", { value: "", children: "Select..." }),
96
- (_a2 = field.options) == null ? void 0 : _a2.map((opt) => /* @__PURE__ */ jsx("option", { value: opt, children: opt }, opt))
97
- ]
120
+ if (field.half && i > 0 && ((_c2 = formFields[i - 1]) == null ? void 0 : _c2.half)) {
121
+ const prevField = formFields[i - 1];
122
+ const prevEl = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
123
+ /* @__PURE__ */ jsxs(Label, { htmlFor: `contact-${prevField.name}`, children: [
124
+ prevField.label,
125
+ prevField.required ? " *" : ""
126
+ ] }),
127
+ /* @__PURE__ */ jsx(
128
+ Input,
129
+ {
130
+ id: `contact-${prevField.name}`,
131
+ type: prevField.type,
132
+ value: values[prevField.name] ?? "",
133
+ onChange: (e) => setValue(prevField.name, e.target.value),
134
+ required: prevField.required
135
+ }
136
+ )
137
+ ] }, prevField.name);
138
+ rows.push(
139
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
140
+ prevEl,
141
+ fieldEl
142
+ ] }, `row-${prevField.name}-${field.name}`)
143
+ );
144
+ return rows;
98
145
  }
99
- ) : /* @__PURE__ */ jsx(
100
- Input,
146
+ rows.push(fieldEl);
147
+ return rows;
148
+ }, []),
149
+ /* @__PURE__ */ jsx(
150
+ CompoundButton,
101
151
  {
102
- id: `contact-${field.name}`,
103
- type: field.type,
104
- value: values[field.name] ?? "",
105
- onChange: (e) => setValue(field.name, e.target.value),
106
- required: field.required
152
+ label: submitting ? "Sending..." : submitLabel,
153
+ variant: props.submitVariant ?? "default",
154
+ size: props.submitSize ?? "default",
155
+ icon: submitting ? "loader" : submitIcon,
156
+ type: "submit",
157
+ disabled: submitting
107
158
  }
108
159
  )
109
- ] }, field.name);
110
- if (field.half && ((_b2 = formFields[i + 1]) == null ? void 0 : _b2.half)) {
111
- return rows;
112
- }
113
- if (field.half && i > 0 && ((_c2 = formFields[i - 1]) == null ? void 0 : _c2.half)) {
114
- const prevField = formFields[i - 1];
115
- const prevEl = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
116
- /* @__PURE__ */ jsxs(Label, { htmlFor: `contact-${prevField.name}`, children: [
117
- prevField.label,
118
- prevField.required ? " *" : ""
119
- ] }),
120
- /* @__PURE__ */ jsx(
121
- Input,
122
- {
123
- id: `contact-${prevField.name}`,
124
- type: prevField.type,
125
- value: values[prevField.name] ?? "",
126
- onChange: (e) => setValue(prevField.name, e.target.value),
127
- required: prevField.required
128
- }
129
- )
130
- ] }, prevField.name);
131
- rows.push(
132
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
133
- prevEl,
134
- fieldEl
135
- ] }, `row-${prevField.name}-${field.name}`)
136
- );
137
- return rows;
138
- }
139
- rows.push(fieldEl);
140
- return rows;
141
- }, []),
142
- /* @__PURE__ */ jsx(
143
- CompoundButton,
144
- {
145
- label: submitting ? "Sending..." : submitLabel,
146
- variant: "default",
147
- size: "default",
148
- icon: submitting ? "loader" : submitIcon,
149
- type: "submit",
150
- disabled: submitting
151
- }
152
- )
153
- ]
154
- }
155
- ) })
156
- ] }) });
160
+ ]
161
+ }
162
+ ) })
163
+ ] })
164
+ }
165
+ );
157
166
  };
158
167
  export {
159
168
  ContactUs
@@ -1,12 +1,82 @@
1
- import { paddingDefaults, formDefaults, backgroundColor, sectionStyle, padding, form, contentFieldsWithFeatures } from "../../../puck-base/core/fields.js";
1
+ import { icon, contentFieldsWithFeatures } from "../../../puck-base/core/fields.js";
2
2
  import { ContactUs } from "./contact-us.js";
3
+ import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
4
+ const fieldTypeOptions = [
5
+ "text",
6
+ "email",
7
+ "tel",
8
+ "number",
9
+ "date",
10
+ "url",
11
+ "file",
12
+ "textarea",
13
+ "select"
14
+ ].map((t) => ({ label: t, value: t }));
3
15
  const conf = {
4
16
  fields: {
5
17
  ...contentFieldsWithFeatures,
6
- form,
7
- padding,
8
- sectionStyle,
9
- backgroundColor
18
+ formTitle: { type: "text", contentEditable: true },
19
+ fields: {
20
+ type: "array",
21
+ max: 10,
22
+ getItemSummary: (item, i = 0) => item.label || `Field ${i + 1}`,
23
+ arrayFields: {
24
+ label: { type: "text", contentEditable: true },
25
+ name: { type: "text" },
26
+ type: { type: "select", options: fieldTypeOptions },
27
+ required: {
28
+ type: "radio",
29
+ options: [
30
+ { label: "Yes", value: true },
31
+ { label: "No", value: false }
32
+ ]
33
+ },
34
+ half: {
35
+ type: "radio",
36
+ options: [
37
+ { label: "Yes", value: true },
38
+ { label: "No", value: false }
39
+ ]
40
+ }
41
+ },
42
+ defaultItemProps: {
43
+ label: "Field",
44
+ name: "field",
45
+ type: "text"
46
+ }
47
+ },
48
+ action: { type: "text", label: "Submit URL" },
49
+ method: {
50
+ type: "select",
51
+ label: "Submit Method",
52
+ options: [
53
+ { label: "GET", value: "get" },
54
+ { label: "POST", value: "post" },
55
+ { label: "Dialog", value: "dialog" }
56
+ ]
57
+ },
58
+ submitLabel: { type: "text" },
59
+ submitVariant: {
60
+ type: "select",
61
+ options: [
62
+ { label: "Primary", value: "default" },
63
+ { label: "Secondary", value: "secondary" },
64
+ { label: "Outline", value: "outline" },
65
+ { label: "Ghost", value: "ghost" },
66
+ { label: "Link", value: "link" },
67
+ { label: "Destructive", value: "destructive" }
68
+ ]
69
+ },
70
+ submitSize: {
71
+ type: "select",
72
+ options: [
73
+ { label: "Default", value: "default" },
74
+ { label: "Small", value: "sm" },
75
+ { label: "Large", value: "lg" }
76
+ ]
77
+ },
78
+ submitIcon: icon,
79
+ styles: createStylesField()
10
80
  },
11
81
  defaultProps: {
12
82
  badge: {
@@ -24,8 +94,18 @@ const conf = {
24
94
  description: "We've made it easy to use and understand."
25
95
  })
26
96
  ),
27
- form: formDefaults,
28
- padding: paddingDefaults
97
+ fields: [
98
+ { label: "Name", name: "name", type: "text", required: true },
99
+ { label: "Email", name: "email", type: "email", required: true },
100
+ { label: "Phone", name: "phone", type: "tel" },
101
+ { label: "Company", name: "company", type: "text" },
102
+ { label: "Message", name: "message", type: "textarea", required: true }
103
+ ],
104
+ submitLabel: "Send Message",
105
+ submitVariant: "default",
106
+ submitSize: "default",
107
+ submitIcon: "send",
108
+ styles: createStylesDefaults()
29
109
  },
30
110
  render: ContactUs
31
111
  };
@@ -8,19 +8,23 @@ export interface ContactUs2Button {
8
8
  export interface ContactUs2Props {
9
9
  heading?: string;
10
10
  description?: string;
11
- nameLabel?: string;
12
- emailLabel?: string;
13
- phoneLabel?: string;
14
- companyLabel?: string;
15
- messageLabel?: string;
16
- button?: ContactUs2Button;
11
+ fields?: Array<{
12
+ label: string;
13
+ name: string;
14
+ }>;
15
+ submitLabel?: string;
16
+ submitVariant?: string;
17
+ submitSize?: string;
18
+ submitIcon?: string;
17
19
  image?: {
18
20
  src: string;
19
21
  alt: string;
20
22
  };
21
- imagePosition?: "start" | "end";
22
- padding?: CompoundContainerProps["padding"];
23
- sectionStyle?: CompoundContainerProps["sectionStyle"];
24
- backgroundColor?: string;
23
+ styles?: {
24
+ imagePosition?: "start" | "end";
25
+ padding?: CompoundContainerProps["padding"];
26
+ sectionStyle?: CompoundContainerProps["sectionStyle"];
27
+ backgroundColor?: string;
28
+ };
25
29
  }
26
- export declare const ContactUs2: ({ heading, description, nameLabel, emailLabel, phoneLabel, companyLabel, messageLabel, button, image, imagePosition, padding, sectionStyle, backgroundColor, }: ContactUs2Props) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const ContactUs2: ({ heading, description, fields, submitLabel, submitVariant, submitSize, submitIcon, image, styles, }: ContactUs2Props) => import("react/jsx-runtime").JSX.Element;
@@ -14,18 +14,23 @@ import { submitFormLead } from "../api/form-leads.js";
14
14
  const ContactUs2 = ({
15
15
  heading,
16
16
  description,
17
- nameLabel,
18
- emailLabel,
19
- phoneLabel = "Phone",
20
- companyLabel = "Company",
21
- messageLabel,
22
- button,
17
+ fields = [],
18
+ submitLabel,
19
+ submitVariant,
20
+ submitSize,
21
+ submitIcon,
23
22
  image,
24
- imagePosition = "end",
25
- padding,
26
- sectionStyle,
27
- backgroundColor
23
+ styles
28
24
  }) => {
25
+ var _a, _b, _c, _d, _e;
26
+ const labels = {
27
+ name: ((_a = fields.find((field) => field.name === "name")) == null ? void 0 : _a.label) ?? "Your Name",
28
+ email: ((_b = fields.find((field) => field.name === "email")) == null ? void 0 : _b.label) ?? "Email Address",
29
+ phone: ((_c = fields.find((field) => field.name === "phone")) == null ? void 0 : _c.label) ?? "Phone",
30
+ company: ((_d = fields.find((field) => field.name === "company")) == null ? void 0 : _d.label) ?? "Company",
31
+ message: ((_e = fields.find((field) => field.name === "message")) == null ? void 0 : _e.label) ?? "Tell us about your fitness goals"
32
+ };
33
+ const imagePosition = (styles == null ? void 0 : styles.imagePosition) ?? "end";
29
34
  const { isEditor: isEditorMode, siteId, domain } = useEditorContext();
30
35
  const [name, setName] = useState("");
31
36
  const [email, setEmail] = useState("");
@@ -71,7 +76,7 @@ const ContactUs2 = ({
71
76
  {
72
77
  htmlFor: "contact2-name",
73
78
  className: "text-sm font-medium text-foreground",
74
- children: nameLabel
79
+ children: labels.name
75
80
  }
76
81
  ),
77
82
  /* @__PURE__ */ jsx(
@@ -93,7 +98,7 @@ const ContactUs2 = ({
93
98
  {
94
99
  htmlFor: "contact2-email",
95
100
  className: "text-sm font-medium text-foreground",
96
- children: emailLabel
101
+ children: labels.email
97
102
  }
98
103
  ),
99
104
  /* @__PURE__ */ jsx(
@@ -115,7 +120,7 @@ const ContactUs2 = ({
115
120
  {
116
121
  htmlFor: "contact2-phone",
117
122
  className: "text-sm font-medium text-foreground",
118
- children: phoneLabel
123
+ children: labels.phone
119
124
  }
120
125
  ),
121
126
  /* @__PURE__ */ jsx(
@@ -136,7 +141,7 @@ const ContactUs2 = ({
136
141
  {
137
142
  htmlFor: "contact2-company",
138
143
  className: "text-sm font-medium text-foreground",
139
- children: companyLabel
144
+ children: labels.company
140
145
  }
141
146
  ),
142
147
  /* @__PURE__ */ jsx(
@@ -157,7 +162,7 @@ const ContactUs2 = ({
157
162
  {
158
163
  htmlFor: "contact2-message",
159
164
  className: "text-sm font-medium text-foreground",
160
- children: messageLabel
165
+ children: labels.message
161
166
  }
162
167
  ),
163
168
  /* @__PURE__ */ jsx(
@@ -175,10 +180,10 @@ const ContactUs2 = ({
175
180
  /* @__PURE__ */ jsx(
176
181
  CompoundButton,
177
182
  {
178
- label: submitting ? "Sending..." : (button == null ? void 0 : button.label) ?? "Send Message",
179
- variant: (button == null ? void 0 : button.variant) ?? "default",
180
- size: (button == null ? void 0 : button.size) ?? "default",
181
- icon: submitting ? "loader" : (button == null ? void 0 : button.icon) ?? "none",
183
+ label: submitting ? "Sending..." : submitLabel ?? "Send Message",
184
+ variant: submitVariant ?? "default",
185
+ size: submitSize ?? "default",
186
+ icon: submitting ? "loader" : submitIcon ?? "none",
182
187
  type: "submit",
183
188
  disabled: submitting
184
189
  }
@@ -205,9 +210,9 @@ const ContactUs2 = ({
205
210
  return /* @__PURE__ */ jsx(
206
211
  CompoundContainer,
207
212
  {
208
- padding,
209
- sectionStyle,
210
- backgroundColor,
213
+ padding: styles == null ? void 0 : styles.padding,
214
+ sectionStyle: styles == null ? void 0 : styles.sectionStyle,
215
+ backgroundColor: styles == null ? void 0 : styles.backgroundColor,
211
216
  children: /* @__PURE__ */ jsxs(
212
217
  "div",
213
218
  {