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
@@ -0,0 +1,286 @@
1
+ const paddingLevel = {
2
+ type: "select",
3
+ options: [
4
+ { label: "none", value: "none" },
5
+ { label: "small", value: "small" },
6
+ { label: "medium", value: "medium" },
7
+ { label: "large", value: "large" }
8
+ ],
9
+ ai: {
10
+ instructions: "Never select none as an option"
11
+ }
12
+ };
13
+ const padding = {
14
+ type: "object",
15
+ objectFields: {
16
+ top: paddingLevel,
17
+ bottom: paddingLevel
18
+ },
19
+ ai: {
20
+ exclude: true
21
+ }
22
+ };
23
+ const paddingDefaults = {
24
+ top: "medium",
25
+ bottom: "medium"
26
+ };
27
+ const sectionStyle = {
28
+ type: "select",
29
+ label: "Section Style",
30
+ options: [
31
+ { label: "Default", value: "default" },
32
+ { label: "Dark", value: "dark" },
33
+ { label: "Muted", value: "muted" },
34
+ { label: "Inverted", value: "inverted" },
35
+ { label: "Custom", value: "custom" }
36
+ ],
37
+ ai: {
38
+ instructions: "Match the section's background tone: use 'dark' for dark/black backgrounds, 'muted' for gray/subtle backgrounds, 'inverted' for full contrast reversal. Default for standard light backgrounds."
39
+ }
40
+ };
41
+ const sectionOverlay = {
42
+ type: "select",
43
+ label: "Overlay",
44
+ options: [
45
+ { label: "None", value: "none" },
46
+ { label: "Gradient Top", value: "gradient-top" },
47
+ { label: "Gradient Bottom", value: "gradient-bottom" },
48
+ { label: "Noise", value: "noise" }
49
+ ],
50
+ ai: {
51
+ instructions: "Use gradient overlays when the section has a background image that needs text contrast. Use noise for subtle texture."
52
+ }
53
+ };
54
+ const backgroundColor = {
55
+ type: "text",
56
+ label: "Background Color",
57
+ ai: {
58
+ instructions: "Set a custom background color in oklch format (e.g. 'oklch(0.2 0.05 260)'). Only use when sectionStyle is 'custom'."
59
+ }
60
+ };
61
+ const backgroundImage = {
62
+ type: "text",
63
+ label: "Background Image URL",
64
+ ai: {
65
+ instructions: "URL for a full-width background image behind the section.",
66
+ stream: false
67
+ }
68
+ };
69
+ const sectionBaseStyleFields = {
70
+ sectionStyle,
71
+ backgroundColor,
72
+ padding
73
+ };
74
+ const sectionBaseStyleDefaults = {
75
+ padding: paddingDefaults
76
+ };
77
+ function createStylesField(extraFields) {
78
+ return {
79
+ type: "object",
80
+ label: "Styles",
81
+ objectFields: {
82
+ ...sectionBaseStyleFields,
83
+ ...extraFields
84
+ }
85
+ };
86
+ }
87
+ function createStylesDefaults(extraDefaults) {
88
+ return {
89
+ ...sectionBaseStyleDefaults,
90
+ ...extraDefaults
91
+ };
92
+ }
93
+ const bannerExtraFields = {
94
+ textColor: {
95
+ type: "text",
96
+ label: "Text Color"
97
+ },
98
+ align: {
99
+ type: "radio",
100
+ options: [
101
+ { label: "Left", value: "left" },
102
+ { label: "Center", value: "center" },
103
+ { label: "Right", value: "right" }
104
+ ]
105
+ },
106
+ size: {
107
+ type: "radio",
108
+ options: [
109
+ { label: "Small", value: "small" },
110
+ { label: "Default", value: "default" }
111
+ ]
112
+ }
113
+ };
114
+ const bannerStylesField = createStylesField(bannerExtraFields);
115
+ const bannerStylesDefaults = createStylesDefaults();
116
+ const heroExtraFields = {
117
+ backgroundImage,
118
+ overlay: sectionOverlay,
119
+ align: {
120
+ type: "radio",
121
+ options: [
122
+ { label: "Left", value: "left" },
123
+ { label: "Center", value: "center" }
124
+ ]
125
+ },
126
+ minHeight: {
127
+ type: "select",
128
+ label: "Min Height",
129
+ options: [
130
+ { label: "Medium", value: "medium" },
131
+ { label: "Large", value: "large" },
132
+ { label: "Full", value: "full" }
133
+ ]
134
+ }
135
+ };
136
+ const heroStylesField = createStylesField(heroExtraFields);
137
+ const heroStylesDefaults = createStylesDefaults();
138
+ const ctaExtraFields = {
139
+ layout: {
140
+ type: "radio",
141
+ label: "Layout",
142
+ options: [
143
+ { label: "Contained", value: "contained" },
144
+ { label: "Full Bleed", value: "full-bleed" }
145
+ ]
146
+ }
147
+ };
148
+ createStylesField(ctaExtraFields);
149
+ createStylesDefaults();
150
+ const featureExtraFields = {
151
+ columns: {
152
+ type: "select",
153
+ label: "Columns",
154
+ options: [
155
+ { label: "2", value: 2 },
156
+ { label: "3", value: 3 },
157
+ { label: "4", value: 4 }
158
+ ]
159
+ }
160
+ };
161
+ createStylesField(featureExtraFields);
162
+ createStylesDefaults();
163
+ const faqExtraFields = {
164
+ layout: {
165
+ type: "radio",
166
+ label: "Layout",
167
+ options: [
168
+ { label: "Single Column", value: "single-col" },
169
+ { label: "Two Columns", value: "two-col" }
170
+ ]
171
+ }
172
+ };
173
+ createStylesField(faqExtraFields);
174
+ createStylesDefaults();
175
+ const galleryExtraFields = {
176
+ gap: {
177
+ type: "select",
178
+ label: "Gap",
179
+ options: [
180
+ { label: "Small", value: "sm" },
181
+ { label: "Medium", value: "md" },
182
+ { label: "Large", value: "lg" }
183
+ ]
184
+ }
185
+ };
186
+ createStylesField(galleryExtraFields);
187
+ createStylesDefaults();
188
+ const testimonialExtraFields = {
189
+ layout: {
190
+ type: "radio",
191
+ label: "Layout",
192
+ options: [
193
+ { label: "Cards", value: "cards" },
194
+ { label: "Quote", value: "quote" }
195
+ ]
196
+ }
197
+ };
198
+ createStylesField(
199
+ testimonialExtraFields
200
+ );
201
+ createStylesDefaults();
202
+ const showcaseExtraFields = {
203
+ layout: {
204
+ type: "select",
205
+ label: "Layout",
206
+ options: [
207
+ { label: "Horizontal", value: "horizontal" },
208
+ { label: "Vertical", value: "vertical" },
209
+ { label: "Numbered", value: "numbered" }
210
+ ]
211
+ }
212
+ };
213
+ createStylesField(showcaseExtraFields);
214
+ createStylesDefaults();
215
+ const textExtraFields = {
216
+ maxWidth: {
217
+ type: "select",
218
+ label: "Max Width",
219
+ options: [
220
+ { label: "Small", value: "sm" },
221
+ { label: "Medium", value: "md" },
222
+ { label: "Large", value: "lg" },
223
+ { label: "Full", value: "full" }
224
+ ]
225
+ }
226
+ };
227
+ createStylesField(textExtraFields);
228
+ createStylesDefaults();
229
+ const contactExtraFields = {
230
+ panelStyle: {
231
+ type: "select",
232
+ label: "Panel Style",
233
+ options: [
234
+ { label: "Default", value: "default" },
235
+ { label: "Card", value: "card" },
236
+ { label: "Flat", value: "flat" }
237
+ ]
238
+ }
239
+ };
240
+ createStylesField(contactExtraFields);
241
+ createStylesDefaults();
242
+ const locationExtraFields = {
243
+ mapHeight: {
244
+ type: "number",
245
+ label: "Map Height",
246
+ min: 200,
247
+ max: 800
248
+ },
249
+ mapFilter: {
250
+ type: "text",
251
+ label: "Map Filter (CSS)"
252
+ },
253
+ mapTintColor: {
254
+ type: "text",
255
+ label: "Map Tint Color"
256
+ }
257
+ };
258
+ createStylesField(locationExtraFields);
259
+ createStylesDefaults();
260
+ createStylesField();
261
+ createStylesDefaults();
262
+ createStylesField();
263
+ createStylesDefaults();
264
+ createStylesField();
265
+ createStylesDefaults();
266
+ createStylesField();
267
+ createStylesDefaults();
268
+ createStylesField();
269
+ createStylesDefaults();
270
+ export {
271
+ backgroundColor,
272
+ backgroundImage,
273
+ bannerStylesDefaults,
274
+ bannerStylesField,
275
+ createStylesDefaults,
276
+ createStylesField,
277
+ heroStylesDefaults,
278
+ heroStylesField,
279
+ padding,
280
+ paddingDefaults,
281
+ paddingLevel,
282
+ sectionBaseStyleDefaults,
283
+ sectionBaseStyleFields,
284
+ sectionOverlay,
285
+ sectionStyle
286
+ };
@@ -1,4 +1,4 @@
1
- import { type ComponentType } from 'react';
1
+ import { type ComponentType } from "react";
2
2
  interface EditableConfig {
3
3
  type: string;
4
4
  fields: Record<string, any>;
@@ -11,6 +11,9 @@ interface EditableConfig {
11
11
  * 2. 编辑模式下渲染原组件 + hover overlay
12
12
  * 3. 点击打开 Dialog,传递 onSave 回调
13
13
  * 4. 保存时用 dispatch 更新 Puck data
14
+ *
15
+ * Puck hooks (usePuckDispatch / usePuckAppState) 仅在 EditableInner 中调用,
16
+ * 确保非编辑模式(如 Storybook / 前台渲染)不会触发 "usePuck must be used inside <Puck>" 错误。
14
17
  */
15
18
  export declare function withEditable<P extends Record<string, any>>(Component: ComponentType<P>, config: EditableConfig): (props: P & {
16
19
  onEdit?: (props: P, onSave: (updated: Partial<P>) => void) => void;
@@ -8,20 +8,19 @@ import { useEditorContext } from "../editor-context.js";
8
8
  import set from "../../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/set.js";
9
9
  const BLOCK_LEVEL_TYPES = /* @__PURE__ */ new Set(["image"]);
10
10
  function withEditable(Component, config) {
11
- return function EditableComponent(props) {
12
- const { isEditor: isEditorMode } = useEditorContext();
11
+ function EditableInner(props) {
13
12
  const dispatch = usePuckDispatch();
14
13
  const appState = usePuckAppState();
15
14
  const wrapperRef = useRef(null);
16
15
  const isBlock = BLOCK_LEVEL_TYPES.has(config.type);
17
16
  useEffect(() => {
18
- if (!isEditorMode || !wrapperRef.current) return;
17
+ if (!wrapperRef.current) return;
19
18
  return registerOverlayPortal(wrapperRef.current, { disableDrag: true });
20
- }, [isEditorMode]);
19
+ }, []);
21
20
  const location = useMemo(() => {
22
- if (!isEditorMode || !(appState == null ? void 0 : appState.data)) return null;
21
+ if (!(appState == null ? void 0 : appState.data)) return null;
23
22
  return findPropsLocation(appState.data, props, config.fields);
24
- }, [isEditorMode, appState == null ? void 0 : appState.data, props]);
23
+ }, [appState == null ? void 0 : appState.data, props]);
25
24
  const handleSave = useCallback(
26
25
  (updated) => {
27
26
  if (!location) return;
@@ -52,34 +51,55 @@ function withEditable(Component, config) {
52
51
  },
53
52
  [props, handleSave]
54
53
  );
54
+ return /* @__PURE__ */ jsxs(
55
+ "span",
56
+ {
57
+ ref: wrapperRef,
58
+ className: isBlock ? "group relative block h-full w-full" : "group relative inline-flex",
59
+ children: [
60
+ /* @__PURE__ */ jsx(Component, { ...props }),
61
+ /* @__PURE__ */ jsx(
62
+ "span",
63
+ {
64
+ onClick: handleEdit,
65
+ className: "absolute inset-0 z-40 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
66
+ children: /* @__PURE__ */ jsx("span", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-black/50 shadow-md backdrop-blur-sm", children: /* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4 text-white" }) })
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ return function EditableComponent(props) {
74
+ const { isEditor: isEditorMode } = useEditorContext();
55
75
  if (!isEditorMode) {
56
76
  return /* @__PURE__ */ jsx(Component, { ...props });
57
77
  }
58
- return /* @__PURE__ */ jsxs("span", { ref: wrapperRef, className: isBlock ? "group relative block h-full w-full" : "group relative inline-flex", children: [
59
- /* @__PURE__ */ jsx(Component, { ...props }),
60
- /* @__PURE__ */ jsx(
61
- "span",
62
- {
63
- onClick: handleEdit,
64
- className: "absolute inset-0 z-40 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
65
- children: /* @__PURE__ */ jsx("span", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-black/50 shadow-md backdrop-blur-sm", children: /* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4 text-white" }) })
66
- }
67
- )
68
- ] });
78
+ return /* @__PURE__ */ jsx(EditableInner, { ...props });
69
79
  };
70
80
  }
71
81
  function findPropsLocation(data, targetProps, fields) {
72
82
  if (!data) return null;
73
83
  const content = Array.isArray(data.content) ? data.content : [];
74
84
  for (const component of content) {
75
- const result = searchInObject(component.props, targetProps, fields, component.props.id);
85
+ const result = searchInObject(
86
+ component.props,
87
+ targetProps,
88
+ fields,
89
+ component.props.id
90
+ );
76
91
  if (result) return result;
77
92
  }
78
93
  const zones = data.zones && typeof data.zones === "object" ? data.zones : {};
79
94
  for (const zoneKey of Object.keys(zones)) {
80
95
  const zoneComponents = Array.isArray(zones[zoneKey]) ? zones[zoneKey] : [];
81
96
  for (const component of zoneComponents) {
82
- const result = searchInObject(component.props, targetProps, fields, component.props.id);
97
+ const result = searchInObject(
98
+ component.props,
99
+ targetProps,
100
+ fields,
101
+ component.props.id
102
+ );
83
103
  if (result) return result;
84
104
  }
85
105
  }
@@ -117,18 +137,22 @@ function searchInObject(obj, targetProps, fields, componentId, currentPath = "")
117
137
  }
118
138
  function findComponentById(data, componentId) {
119
139
  const content = Array.isArray(data == null ? void 0 : data.content) ? data.content : [];
120
- const contentMatch = content.find((component) => {
121
- var _a;
122
- return ((_a = component == null ? void 0 : component.props) == null ? void 0 : _a.id) === componentId;
123
- });
140
+ const contentMatch = content.find(
141
+ (component) => {
142
+ var _a;
143
+ return ((_a = component == null ? void 0 : component.props) == null ? void 0 : _a.id) === componentId;
144
+ }
145
+ );
124
146
  if (contentMatch) return contentMatch;
125
147
  const zones = (data == null ? void 0 : data.zones) && typeof data.zones === "object" ? data.zones : {};
126
148
  for (const zoneKey of Object.keys(zones)) {
127
149
  const zoneComponents = Array.isArray(zones[zoneKey]) ? zones[zoneKey] : [];
128
- const zoneMatch = zoneComponents.find((component) => {
129
- var _a;
130
- return ((_a = component == null ? void 0 : component.props) == null ? void 0 : _a.id) === componentId;
131
- });
150
+ const zoneMatch = zoneComponents.find(
151
+ (component) => {
152
+ var _a;
153
+ return ((_a = component == null ? void 0 : component.props) == null ? void 0 : _a.id) === componentId;
154
+ }
155
+ );
132
156
  if (zoneMatch) return zoneMatch;
133
157
  }
134
158
  return null;
@@ -1,10 +1,12 @@
1
1
  export interface AnnouncementBannerProps {
2
- text: string;
3
- linkText?: string;
2
+ items?: string[];
3
+ linkLabel?: string;
4
4
  linkUrl?: string;
5
- backgroundColor?: string;
6
- textColor?: string;
7
- align?: "left" | "center" | "right";
8
- size?: "small" | "default";
5
+ styles?: {
6
+ backgroundColor?: string;
7
+ textColor?: string;
8
+ align?: "left" | "center" | "right";
9
+ size?: "small" | "default";
10
+ };
9
11
  }
10
- export declare const AnnouncementBanner: ({ text, linkText, linkUrl, backgroundColor, textColor, align, size, }: AnnouncementBannerProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const AnnouncementBanner: ({ items, linkLabel, linkUrl, styles, }: AnnouncementBannerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,14 +1,17 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../../../utils/css-utils.js";
3
3
  const AnnouncementBanner = ({
4
- text,
5
- linkText,
4
+ items = [],
5
+ linkLabel,
6
6
  linkUrl,
7
- backgroundColor = "var(--primary)",
8
- textColor,
9
- align = "center",
10
- size = "default"
7
+ styles
11
8
  }) => {
9
+ const normalized = items.map((v) => typeof v === "string" ? v : (v == null ? void 0 : v.text) ?? "");
10
+ const text = normalized[0] ?? "";
11
+ const backgroundColor = (styles == null ? void 0 : styles.backgroundColor) ?? "var(--primary)";
12
+ const textColor = styles == null ? void 0 : styles.textColor;
13
+ const align = (styles == null ? void 0 : styles.align) ?? "center";
14
+ const size = (styles == null ? void 0 : styles.size) ?? "default";
12
15
  const style = {
13
16
  ...backgroundColor ? { backgroundColor } : {},
14
17
  ...textColor ? { color: textColor } : {}
@@ -32,13 +35,13 @@ const AnnouncementBanner = ({
32
35
  }),
33
36
  children: [
34
37
  /* @__PURE__ */ jsx("span", { children: text }),
35
- linkText && linkUrl ? /* @__PURE__ */ jsxs(
38
+ linkLabel && linkUrl ? /* @__PURE__ */ jsxs(
36
39
  "a",
37
40
  {
38
41
  href: linkUrl,
39
42
  className: "underline underline-offset-2 opacity-90 hover:opacity-100",
40
43
  children: [
41
- linkText,
44
+ linkLabel,
42
45
  " →"
43
46
  ]
44
47
  }
@@ -1,47 +1,29 @@
1
1
  import { AnnouncementBanner } from "./announcement-banner.js";
2
+ import { bannerStylesDefaults, bannerStylesField } from "../../../puck-base/core/styles.js";
2
3
  const conf = {
3
4
  fields: {
4
- text: { type: "text", contentEditable: true },
5
- linkText: { type: "text" },
6
- linkUrl: { type: "text" },
7
- backgroundColor: {
8
- type: "text",
9
- label: "Background Color",
10
- ai: {
11
- instructions: "Use the exact background color from the original banner. Common examples: yellow (#FACC15), blue (#3B82F6), green (#22C55E), red (#EF4444), or any brand color. Use hex, rgb, or oklch format."
12
- }
13
- },
14
- textColor: {
15
- type: "text",
16
- label: "Text Color",
17
- ai: {
18
- instructions: "Set text color to contrast with the background. Usually black (#000) for light backgrounds or white (#fff) for dark backgrounds."
19
- }
20
- },
21
- align: {
22
- type: "radio",
23
- options: [
24
- { label: "Left", value: "left" },
25
- { label: "Center", value: "center" },
26
- { label: "Right", value: "right" }
27
- ]
5
+ items: {
6
+ type: "array",
7
+ max: 3,
8
+ getItemSummary: (item, i = 0) => (typeof item === "string" ? item : item == null ? void 0 : item.text) || `Item ${i + 1}`,
9
+ arrayFields: { text: { type: "text", contentEditable: true } },
10
+ defaultItemProps: { text: "Text" }
28
11
  },
29
- size: {
30
- type: "radio",
31
- options: [
32
- { label: "Small", value: "small" },
33
- { label: "Default", value: "default" }
34
- ]
35
- }
12
+ linkLabel: { type: "text" },
13
+ linkUrl: { type: "text" },
14
+ styles: bannerStylesField
36
15
  },
37
16
  defaultProps: {
38
- text: "New: Check out our latest update",
39
- linkText: "Learn more",
17
+ items: [{ text: "New: Check out our latest update" }],
18
+ linkLabel: "Learn more",
40
19
  linkUrl: "#",
41
- backgroundColor: "#FACC15",
42
- textColor: "#000000",
43
- align: "center",
44
- size: "default"
20
+ styles: {
21
+ ...bannerStylesDefaults,
22
+ backgroundColor: "#FACC15",
23
+ textColor: "#000000",
24
+ align: "center",
25
+ size: "default"
26
+ }
45
27
  },
46
28
  render: AnnouncementBanner
47
29
  };
@@ -1,33 +1,33 @@
1
- import { paddingDefaults, backgroundColor, sectionStyle, padding } from "../../../puck-base/core/fields.js";
2
1
  import { Marquee } from "./marquee.js";
2
+ import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
3
+ const marqueeStylesField = createStylesField({
4
+ speed: {
5
+ type: "radio",
6
+ options: [
7
+ { label: "Slow", value: "slow" },
8
+ { label: "Normal", value: "normal" },
9
+ { label: "Fast", value: "fast" }
10
+ ]
11
+ },
12
+ tone: {
13
+ type: "radio",
14
+ options: [
15
+ { label: "Default", value: "default" },
16
+ { label: "Outline", value: "outline" },
17
+ { label: "Muted", value: "muted" }
18
+ ]
19
+ }
20
+ });
3
21
  const conf = {
4
22
  fields: {
5
23
  items: {
6
24
  type: "array",
7
25
  max: 10,
8
- getItemSummary: (item, i = 0) => item.text || `Item ${i + 1}`,
26
+ getItemSummary: (item, i = 0) => (typeof item === "string" ? item : item == null ? void 0 : item.text) || `Item ${i + 1}`,
9
27
  arrayFields: { text: { type: "text" } },
10
28
  defaultItemProps: { text: "Text" }
11
29
  },
12
- speed: {
13
- type: "radio",
14
- options: [
15
- { label: "Slow", value: "slow" },
16
- { label: "Normal", value: "normal" },
17
- { label: "Fast", value: "fast" }
18
- ]
19
- },
20
- variant: {
21
- type: "radio",
22
- options: [
23
- { label: "Default", value: "default" },
24
- { label: "Outline", value: "outline" },
25
- { label: "Muted", value: "muted" }
26
- ]
27
- },
28
- padding,
29
- sectionStyle,
30
- backgroundColor
30
+ styles: marqueeStylesField
31
31
  },
32
32
  defaultProps: {
33
33
  items: [
@@ -36,9 +36,11 @@ const conf = {
36
36
  { text: "Performance" },
37
37
  { text: "Quality" }
38
38
  ],
39
- speed: "normal",
40
- variant: "default",
41
- padding: paddingDefaults
39
+ styles: {
40
+ ...createStylesDefaults(),
41
+ speed: "normal",
42
+ tone: "default"
43
+ }
42
44
  },
43
45
  render: Marquee
44
46
  };
@@ -1,12 +1,12 @@
1
1
  import { CompoundContainerProps } from "@/components/puck-base/container";
2
2
  export interface MarqueeProps {
3
- padding?: CompoundContainerProps["padding"];
4
- sectionStyle?: CompoundContainerProps["sectionStyle"];
5
- backgroundColor?: string;
6
- items?: Array<{
7
- text: string;
8
- }>;
9
- speed?: "slow" | "normal" | "fast";
10
- variant?: "default" | "outline" | "muted";
3
+ items?: string[];
4
+ styles?: {
5
+ padding?: CompoundContainerProps["padding"];
6
+ sectionStyle?: CompoundContainerProps["sectionStyle"];
7
+ backgroundColor?: string;
8
+ speed?: "slow" | "normal" | "fast";
9
+ tone?: "default" | "outline" | "muted";
10
+ };
11
11
  }
12
- export declare const Marquee: ({ padding, sectionStyle, backgroundColor, items, speed, variant, }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Marquee: ({ items, styles, }: MarqueeProps) => import("react/jsx-runtime").JSX.Element;