@opensite/ui 2.2.3 → 2.2.5

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 (149) hide show
  1. package/dist/about-culture-tabs.cjs +83 -17
  2. package/dist/about-culture-tabs.js +83 -17
  3. package/dist/components.cjs +83 -17
  4. package/dist/components.js +83 -17
  5. package/dist/contact-callback.cjs +38 -552
  6. package/dist/contact-callback.d.cts +6 -74
  7. package/dist/contact-callback.d.ts +6 -74
  8. package/dist/contact-callback.js +36 -535
  9. package/dist/contact-careers.cjs +19 -555
  10. package/dist/contact-careers.d.cts +6 -62
  11. package/dist/contact-careers.d.ts +6 -62
  12. package/dist/contact-careers.js +18 -539
  13. package/dist/contact-catering.cjs +19 -531
  14. package/dist/contact-catering.d.cts +6 -61
  15. package/dist/contact-catering.d.ts +6 -61
  16. package/dist/contact-catering.js +18 -515
  17. package/dist/contact-consultation.cjs +87 -543
  18. package/dist/contact-consultation.d.cts +6 -61
  19. package/dist/contact-consultation.d.ts +6 -61
  20. package/dist/contact-consultation.js +88 -544
  21. package/dist/contact-demo.cjs +20 -563
  22. package/dist/contact-demo.d.cts +10 -50
  23. package/dist/contact-demo.d.ts +10 -50
  24. package/dist/contact-demo.js +19 -547
  25. package/dist/contact-emergency.cjs +1 -1
  26. package/dist/contact-emergency.js +1 -1
  27. package/dist/contact-event.cjs +19 -562
  28. package/dist/contact-event.d.cts +10 -50
  29. package/dist/contact-event.d.ts +10 -50
  30. package/dist/contact-event.js +19 -547
  31. package/dist/contact-feedback.cjs +19 -562
  32. package/dist/contact-feedback.d.cts +10 -50
  33. package/dist/contact-feedback.d.ts +10 -50
  34. package/dist/contact-feedback.js +19 -547
  35. package/dist/contact-fitness.cjs +19 -562
  36. package/dist/contact-fitness.d.cts +10 -50
  37. package/dist/contact-fitness.d.ts +10 -50
  38. package/dist/contact-fitness.js +19 -547
  39. package/dist/contact-guest.cjs +19 -562
  40. package/dist/contact-guest.d.cts +10 -50
  41. package/dist/contact-guest.d.ts +10 -50
  42. package/dist/contact-guest.js +19 -547
  43. package/dist/contact-insurance.cjs +19 -562
  44. package/dist/contact-insurance.d.cts +10 -50
  45. package/dist/contact-insurance.d.ts +10 -50
  46. package/dist/contact-insurance.js +19 -547
  47. package/dist/contact-interview.cjs +19 -562
  48. package/dist/contact-interview.d.cts +11 -51
  49. package/dist/contact-interview.d.ts +11 -51
  50. package/dist/contact-interview.js +19 -547
  51. package/dist/contact-locations.cjs +19 -562
  52. package/dist/contact-locations.d.cts +11 -51
  53. package/dist/contact-locations.d.ts +11 -51
  54. package/dist/contact-locations.js +19 -547
  55. package/dist/contact-maintenance.cjs +19 -562
  56. package/dist/contact-maintenance.d.cts +10 -50
  57. package/dist/contact-maintenance.d.ts +10 -50
  58. package/dist/contact-maintenance.js +19 -547
  59. package/dist/contact-map.cjs +19 -562
  60. package/dist/contact-map.d.cts +11 -51
  61. package/dist/contact-map.d.ts +11 -51
  62. package/dist/contact-map.js +19 -547
  63. package/dist/contact-minimal.cjs +19 -562
  64. package/dist/contact-minimal.d.cts +10 -50
  65. package/dist/contact-minimal.d.ts +10 -50
  66. package/dist/contact-minimal.js +19 -547
  67. package/dist/contact-moving.cjs +19 -562
  68. package/dist/contact-moving.d.cts +11 -51
  69. package/dist/contact-moving.d.ts +11 -51
  70. package/dist/contact-moving.js +19 -547
  71. package/dist/contact-multistep.cjs +19 -562
  72. package/dist/contact-multistep.d.cts +11 -51
  73. package/dist/contact-multistep.d.ts +11 -51
  74. package/dist/contact-multistep.js +19 -547
  75. package/dist/contact-partnership.cjs +22 -565
  76. package/dist/contact-partnership.d.cts +10 -50
  77. package/dist/contact-partnership.d.ts +10 -50
  78. package/dist/contact-partnership.js +22 -550
  79. package/dist/contact-photography.cjs +19 -562
  80. package/dist/contact-photography.d.cts +7 -50
  81. package/dist/contact-photography.d.ts +7 -50
  82. package/dist/contact-photography.js +18 -546
  83. package/dist/contact-press.cjs +19 -562
  84. package/dist/contact-press.d.cts +10 -50
  85. package/dist/contact-press.d.ts +10 -50
  86. package/dist/contact-press.js +19 -547
  87. package/dist/contact-quote.cjs +19 -562
  88. package/dist/contact-quote.d.cts +11 -51
  89. package/dist/contact-quote.d.ts +11 -51
  90. package/dist/contact-quote.js +19 -547
  91. package/dist/contact-referral.cjs +19 -562
  92. package/dist/contact-referral.d.cts +10 -50
  93. package/dist/contact-referral.d.ts +10 -50
  94. package/dist/contact-referral.js +19 -547
  95. package/dist/contact-report.cjs +19 -562
  96. package/dist/contact-report.d.cts +10 -50
  97. package/dist/contact-report.d.ts +10 -50
  98. package/dist/contact-report.js +19 -547
  99. package/dist/contact-reservation.cjs +19 -562
  100. package/dist/contact-reservation.d.cts +10 -50
  101. package/dist/contact-reservation.d.ts +10 -50
  102. package/dist/contact-reservation.js +19 -547
  103. package/dist/contact-retreat.cjs +88 -567
  104. package/dist/contact-retreat.d.cts +11 -51
  105. package/dist/contact-retreat.d.ts +11 -51
  106. package/dist/contact-retreat.js +90 -569
  107. package/dist/contact-rsvp.cjs +19 -562
  108. package/dist/contact-rsvp.d.cts +11 -51
  109. package/dist/contact-rsvp.d.ts +11 -51
  110. package/dist/contact-rsvp.js +19 -547
  111. package/dist/contact-sales.cjs +19 -562
  112. package/dist/contact-sales.d.cts +10 -50
  113. package/dist/contact-sales.d.ts +10 -50
  114. package/dist/contact-sales.js +19 -547
  115. package/dist/contact-schedule.cjs +19 -562
  116. package/dist/contact-schedule.d.cts +11 -51
  117. package/dist/contact-schedule.d.ts +11 -51
  118. package/dist/contact-schedule.js +19 -547
  119. package/dist/contact-sponsorship.cjs +19 -562
  120. package/dist/contact-sponsorship.d.cts +11 -51
  121. package/dist/contact-sponsorship.d.ts +11 -51
  122. package/dist/contact-sponsorship.js +19 -547
  123. package/dist/contact-support.cjs +19 -562
  124. package/dist/contact-support.d.cts +11 -51
  125. package/dist/contact-support.d.ts +11 -51
  126. package/dist/contact-support.js +19 -547
  127. package/dist/contact-tenant.cjs +19 -562
  128. package/dist/contact-tenant.d.cts +11 -51
  129. package/dist/contact-tenant.d.ts +11 -51
  130. package/dist/contact-tenant.js +19 -547
  131. package/dist/contact-volunteer.cjs +19 -562
  132. package/dist/contact-volunteer.d.cts +11 -51
  133. package/dist/contact-volunteer.d.ts +11 -51
  134. package/dist/contact-volunteer.js +19 -547
  135. package/dist/contact-warranty.cjs +19 -562
  136. package/dist/contact-warranty.d.cts +10 -50
  137. package/dist/contact-warranty.d.ts +10 -50
  138. package/dist/contact-warranty.js +19 -547
  139. package/dist/contact-wedding.cjs +19 -562
  140. package/dist/contact-wedding.d.cts +10 -50
  141. package/dist/contact-wedding.d.ts +10 -50
  142. package/dist/contact-wedding.js +19 -547
  143. package/dist/hero-presentation-platform-video.cjs +76 -27
  144. package/dist/hero-presentation-platform-video.js +76 -27
  145. package/dist/index.cjs +83 -17
  146. package/dist/index.js +83 -17
  147. package/dist/registry.cjs +768 -4196
  148. package/dist/registry.js +769 -4197
  149. package/package.json +12 -2
@@ -1,435 +1,14 @@
1
1
  "use client";
2
- import * as React from 'react';
3
- import React__default, { useMemo } from 'react';
4
- import { Form } from '@page-speed/forms';
5
- import { useFileUpload, useContactForm, getColumnSpanClass, DynamicFormField } from '@page-speed/forms/integration';
2
+ import { FormEngine } from '@page-speed/forms/integration';
6
3
  import { clsx } from 'clsx';
7
4
  import { twMerge } from 'tailwind-merge';
8
- import { cva } from 'class-variance-authority';
9
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+ import React from 'react';
10
7
 
11
8
  // components/blocks/contact/contact-wedding.tsx
12
9
  function cn(...inputs) {
13
10
  return twMerge(clsx(inputs));
14
11
  }
15
- function normalizePhoneNumber(input) {
16
- const trimmed = input.trim();
17
- if (trimmed.toLowerCase().startsWith("tel:")) {
18
- return trimmed;
19
- }
20
- const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
21
- if (match) {
22
- const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
23
- const extension = match[3];
24
- const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
25
- const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
26
- return `tel:${withExtension}`;
27
- }
28
- const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
29
- return `tel:${cleaned}`;
30
- }
31
- function normalizeEmail(input) {
32
- const trimmed = input.trim();
33
- if (trimmed.toLowerCase().startsWith("mailto:")) {
34
- return trimmed;
35
- }
36
- return `mailto:${trimmed}`;
37
- }
38
- function isEmail(input) {
39
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
40
- return emailRegex.test(input.trim());
41
- }
42
- function isPhoneNumber(input) {
43
- const trimmed = input.trim();
44
- if (trimmed.toLowerCase().startsWith("tel:")) {
45
- return true;
46
- }
47
- const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
48
- return phoneRegex.test(trimmed);
49
- }
50
- function isInternalUrl(href) {
51
- if (typeof window === "undefined") {
52
- return href.startsWith("/") && !href.startsWith("//");
53
- }
54
- const trimmed = href.trim();
55
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
56
- return true;
57
- }
58
- try {
59
- const url = new URL(trimmed, window.location.href);
60
- const currentOrigin = window.location.origin;
61
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
62
- return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
63
- } catch {
64
- return false;
65
- }
66
- }
67
- function toRelativePath(href) {
68
- if (typeof window === "undefined") {
69
- return href;
70
- }
71
- const trimmed = href.trim();
72
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
73
- return trimmed;
74
- }
75
- try {
76
- const url = new URL(trimmed, window.location.href);
77
- const currentOrigin = window.location.origin;
78
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
79
- if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
80
- return url.pathname + url.search + url.hash;
81
- }
82
- } catch {
83
- }
84
- return trimmed;
85
- }
86
- function useNavigation({
87
- href,
88
- onClick
89
- } = {}) {
90
- const linkType = React.useMemo(() => {
91
- if (!href || href.trim() === "") {
92
- return onClick ? "none" : "none";
93
- }
94
- const trimmed = href.trim();
95
- if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
96
- return "mailto";
97
- }
98
- if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
99
- return "tel";
100
- }
101
- if (isInternalUrl(trimmed)) {
102
- return "internal";
103
- }
104
- try {
105
- new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
106
- return "external";
107
- } catch {
108
- return "internal";
109
- }
110
- }, [href, onClick]);
111
- const normalizedHref = React.useMemo(() => {
112
- if (!href || href.trim() === "") {
113
- return void 0;
114
- }
115
- const trimmed = href.trim();
116
- switch (linkType) {
117
- case "tel":
118
- return normalizePhoneNumber(trimmed);
119
- case "mailto":
120
- return normalizeEmail(trimmed);
121
- case "internal":
122
- return toRelativePath(trimmed);
123
- case "external":
124
- return trimmed;
125
- default:
126
- return trimmed;
127
- }
128
- }, [href, linkType]);
129
- const target = React.useMemo(() => {
130
- switch (linkType) {
131
- case "external":
132
- return "_blank";
133
- case "internal":
134
- return "_self";
135
- case "mailto":
136
- case "tel":
137
- return void 0;
138
- default:
139
- return void 0;
140
- }
141
- }, [linkType]);
142
- const rel = React.useMemo(() => {
143
- if (linkType === "external") {
144
- return "noopener noreferrer";
145
- }
146
- return void 0;
147
- }, [linkType]);
148
- const isExternal = linkType === "external";
149
- const isInternal = linkType === "internal";
150
- const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
151
- const handleClick = React.useCallback(
152
- (event) => {
153
- if (onClick) {
154
- try {
155
- onClick(event);
156
- } catch (error) {
157
- console.error("Error in user onClick handler:", error);
158
- }
159
- }
160
- if (event.defaultPrevented) {
161
- return;
162
- }
163
- if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
164
- !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
165
- if (typeof window !== "undefined") {
166
- const handler = window.__opensiteNavigationHandler;
167
- if (typeof handler === "function") {
168
- try {
169
- const handled = handler(normalizedHref, event.nativeEvent || event);
170
- if (handled !== false) {
171
- event.preventDefault();
172
- }
173
- } catch (error) {
174
- console.error("Error in navigation handler:", error);
175
- }
176
- }
177
- }
178
- }
179
- },
180
- [onClick, shouldUseRouter, normalizedHref]
181
- );
182
- return {
183
- linkType,
184
- normalizedHref,
185
- target,
186
- rel,
187
- isExternal,
188
- isInternal,
189
- shouldUseRouter,
190
- handleClick
191
- };
192
- }
193
- var baseStyles = [
194
- // Layout
195
- "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
196
- // Typography - using CSS variables with sensible defaults
197
- "font-[var(--button-font-family,inherit)]",
198
- "font-[var(--button-font-weight,500)]",
199
- "tracking-[var(--button-letter-spacing,0)]",
200
- "leading-[var(--button-line-height,1.25)]",
201
- "[text-transform:var(--button-text-transform,none)]",
202
- "text-sm",
203
- // Border radius
204
- "rounded-[var(--button-radius,var(--radius,0.375rem))]",
205
- // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
206
- "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
207
- // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
208
- "[box-shadow:var(--button-shadow,none)]",
209
- "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
210
- // Disabled state
211
- "disabled:pointer-events-none disabled:opacity-50",
212
- // SVG handling
213
- "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
214
- // Focus styles
215
- "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
216
- // Invalid state
217
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
218
- ].join(" ");
219
- var buttonVariants = cva(baseStyles, {
220
- variants: {
221
- variant: {
222
- // Default (Primary) variant - full customization
223
- default: [
224
- "bg-[var(--button-default-bg,hsl(var(--primary)))]",
225
- "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
226
- "border-[length:var(--button-default-border-width,0px)]",
227
- "border-[color:var(--button-default-border,transparent)]",
228
- "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
229
- "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
230
- "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
231
- "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
232
- "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
233
- ].join(" "),
234
- // Destructive variant - full customization
235
- destructive: [
236
- "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
237
- "text-[var(--button-destructive-fg,white)]",
238
- "border-[length:var(--button-destructive-border-width,0px)]",
239
- "border-[color:var(--button-destructive-border,transparent)]",
240
- "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
241
- "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
242
- "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
243
- "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
244
- "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
245
- "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
246
- "dark:bg-destructive/60"
247
- ].join(" "),
248
- // Outline variant - full customization with proper border handling
249
- outline: [
250
- "bg-[var(--button-outline-bg,hsl(var(--background)))]",
251
- "text-[var(--button-outline-fg,inherit)]",
252
- "border-[length:var(--button-outline-border-width,1px)]",
253
- "border-[color:var(--button-outline-border,hsl(var(--border)))]",
254
- "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
255
- "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
256
- "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
257
- "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
258
- "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
259
- "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
260
- ].join(" "),
261
- // Secondary variant - full customization
262
- secondary: [
263
- "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
264
- "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
265
- "border-[length:var(--button-secondary-border-width,0px)]",
266
- "border-[color:var(--button-secondary-border,transparent)]",
267
- "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
268
- "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
269
- "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
270
- "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
271
- "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
272
- ].join(" "),
273
- // Ghost variant - full customization
274
- ghost: [
275
- "bg-[var(--button-ghost-bg,transparent)]",
276
- "text-[var(--button-ghost-fg,inherit)]",
277
- "border-[length:var(--button-ghost-border-width,0px)]",
278
- "border-[color:var(--button-ghost-border,transparent)]",
279
- "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
280
- "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
281
- "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
282
- "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
283
- "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
284
- "dark:hover:bg-accent/50"
285
- ].join(" "),
286
- // Link variant - full customization
287
- link: [
288
- "bg-[var(--button-link-bg,transparent)]",
289
- "text-[var(--button-link-fg,hsl(var(--primary)))]",
290
- "border-[length:var(--button-link-border-width,0px)]",
291
- "border-[color:var(--button-link-border,transparent)]",
292
- "[box-shadow:var(--button-link-shadow,none)]",
293
- "hover:bg-[var(--button-link-hover-bg,transparent)]",
294
- "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
295
- "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
296
- "underline-offset-4 hover:underline"
297
- ].join(" ")
298
- },
299
- size: {
300
- default: [
301
- "h-[var(--button-height-md,2.25rem)]",
302
- "px-[var(--button-padding-x-md,1rem)]",
303
- "py-[var(--button-padding-y-md,0.5rem)]",
304
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
305
- ].join(" "),
306
- sm: [
307
- "h-[var(--button-height-sm,2rem)]",
308
- "px-[var(--button-padding-x-sm,0.75rem)]",
309
- "py-[var(--button-padding-y-sm,0.25rem)]",
310
- "gap-1.5",
311
- "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
312
- ].join(" "),
313
- md: [
314
- "h-[var(--button-height-md,2.25rem)]",
315
- "px-[var(--button-padding-x-md,1rem)]",
316
- "py-[var(--button-padding-y-md,0.5rem)]",
317
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
318
- ].join(" "),
319
- lg: [
320
- "h-[var(--button-height-lg,2.5rem)]",
321
- "px-[var(--button-padding-x-lg,1.5rem)]",
322
- "py-[var(--button-padding-y-lg,0.5rem)]",
323
- "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
324
- ].join(" "),
325
- icon: "size-[var(--button-height-md,2.25rem)]",
326
- "icon-sm": "size-[var(--button-height-sm,2rem)]",
327
- "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
328
- }
329
- },
330
- defaultVariants: {
331
- variant: "default",
332
- size: "default"
333
- }
334
- });
335
- var Pressable = React.forwardRef(
336
- ({
337
- children,
338
- className,
339
- href,
340
- onClick,
341
- variant,
342
- size,
343
- asButton = false,
344
- fallbackComponentType = "span",
345
- componentType,
346
- "aria-label": ariaLabel,
347
- "aria-describedby": ariaDescribedby,
348
- id,
349
- ...props
350
- }, ref) => {
351
- const navigation = useNavigation({ href, onClick });
352
- const {
353
- normalizedHref,
354
- target,
355
- rel,
356
- linkType,
357
- isInternal,
358
- handleClick
359
- } = navigation;
360
- const shouldRenderLink = normalizedHref && linkType !== "none";
361
- const shouldRenderButton = !shouldRenderLink && onClick;
362
- const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
363
- const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
364
- const shouldApplyButtonStyles = asButton || variant || size;
365
- const combinedClassName = cn(
366
- shouldApplyButtonStyles && buttonVariants({ variant, size }),
367
- className
368
- );
369
- const dataProps = Object.fromEntries(
370
- Object.entries(props).filter(([key]) => key.startsWith("data-"))
371
- );
372
- const buttonDataAttributes = shouldApplyButtonStyles ? {
373
- "data-slot": "button",
374
- "data-variant": variant ?? "default",
375
- "data-size": size ?? "default"
376
- } : {};
377
- const commonProps = {
378
- className: combinedClassName,
379
- onClick: handleClick,
380
- "aria-label": ariaLabel,
381
- "aria-describedby": ariaDescribedby,
382
- id,
383
- ...dataProps,
384
- ...buttonDataAttributes
385
- };
386
- if (finalComponentType === "a" && shouldRenderLink) {
387
- return /* @__PURE__ */ jsx(
388
- "a",
389
- {
390
- ref,
391
- href: normalizedHref,
392
- target,
393
- rel,
394
- ...commonProps,
395
- ...props,
396
- children
397
- }
398
- );
399
- }
400
- if (finalComponentType === "button") {
401
- return /* @__PURE__ */ jsx(
402
- "button",
403
- {
404
- ref,
405
- type: props.type || "button",
406
- ...commonProps,
407
- ...props,
408
- children
409
- }
410
- );
411
- }
412
- if (finalComponentType === "div") {
413
- return /* @__PURE__ */ jsx(
414
- "div",
415
- {
416
- ref,
417
- ...commonProps,
418
- children
419
- }
420
- );
421
- }
422
- return /* @__PURE__ */ jsx(
423
- "span",
424
- {
425
- ref,
426
- ...commonProps,
427
- children
428
- }
429
- );
430
- }
431
- );
432
- Pressable.displayName = "Pressable";
433
12
  function Card({ className, ...props }) {
434
13
  return /* @__PURE__ */ jsx(
435
14
  "div",
@@ -462,7 +41,7 @@ var maxWidthStyles = {
462
41
  "4xl": "max-w-[1536px]",
463
42
  full: "max-w-full"
464
43
  };
465
- var Container = React__default.forwardRef(
44
+ var Container = React.forwardRef(
466
45
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
467
46
  const Component = as;
468
47
  return /* @__PURE__ */ jsx(
@@ -767,7 +346,7 @@ var spacingStyles = {
767
346
  };
768
347
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
769
348
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
770
- var Section = React__default.forwardRef(
349
+ var Section = React.forwardRef(
771
350
  ({
772
351
  id,
773
352
  title,
@@ -828,6 +407,12 @@ var Section = React__default.forwardRef(
828
407
  }
829
408
  );
830
409
  Section.displayName = "Section";
410
+ var DEFAULT_STYLE_RULES = {
411
+ formContainer: "",
412
+ fieldsContainer: "",
413
+ fieldClassName: "",
414
+ formClassName: "space-y-6"
415
+ };
831
416
  var DEFAULT_FORM_FIELDS = [
832
417
  {
833
418
  name: "first_name",
@@ -874,82 +459,19 @@ var DEFAULT_FORM_FIELDS = [
874
459
  function ContactWedding({
875
460
  heading,
876
461
  description,
877
- buttonText = "Submit",
878
- buttonIcon,
879
- actions,
880
- actionsSlot,
881
- formFields = DEFAULT_FORM_FIELDS,
882
- successMessage = "Thank you! Your message has been sent successfully.",
883
462
  className,
463
+ formEngineSetup,
884
464
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
885
465
  headerClassName,
886
466
  headingClassName,
887
467
  descriptionClassName,
888
468
  cardClassName,
889
469
  cardContentClassName,
890
- formClassName,
891
- submitClassName,
892
- successMessageClassName,
893
- errorMessageClassName,
894
470
  background = "white",
895
471
  spacing = "xl",
896
472
  pattern,
897
- patternOpacity = 0.1,
898
- formConfig,
899
- onSubmit,
900
- onSuccess,
901
- onError
473
+ patternOpacity = 0.1
902
474
  }) {
903
- const {
904
- uploadTokens,
905
- uploadProgress,
906
- isUploading,
907
- uploadFiles,
908
- removeFile,
909
- resetUpload
910
- } = useFileUpload({ onError });
911
- const { form, submissionError, formMethod, resetSubmissionState } = useContactForm({
912
- formFields,
913
- formConfig,
914
- onSubmit,
915
- onSuccess: (data) => {
916
- resetUpload();
917
- onSuccess?.(data);
918
- },
919
- onError,
920
- resetOnSuccess: formConfig?.resetOnSuccess !== false,
921
- uploadTokens
922
- });
923
- const actionsContent = useMemo(() => {
924
- if (actionsSlot) return actionsSlot;
925
- if (actions && actions.length > 0) {
926
- return actions.map((action, index) => {
927
- const {
928
- label,
929
- icon,
930
- iconAfter,
931
- children,
932
- className: actionClassName,
933
- ...pressableProps
934
- } = action;
935
- return /* @__PURE__ */ jsx(
936
- Pressable,
937
- {
938
- asButton: true,
939
- className: actionClassName,
940
- ...pressableProps,
941
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
942
- icon,
943
- label,
944
- iconAfter
945
- ] })
946
- },
947
- index
948
- );
949
- });
950
- }
951
- return null;
952
- }, [actionsSlot, actions]);
953
475
  return /* @__PURE__ */ jsx(
954
476
  Section,
955
477
  {
@@ -982,64 +504,14 @@ function ContactWedding({
982
504
  }
983
505
  ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
984
506
  ] }),
985
- /* @__PURE__ */ jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxs(
986
- Form,
507
+ /* @__PURE__ */ jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: formEngineSetup ? /* @__PURE__ */ jsx(
508
+ FormEngine,
987
509
  {
988
- form,
989
- notificationConfig: {
990
- submissionError,
991
- successMessage
992
- },
993
- styleConfig: {
994
- formClassName: cn("space-y-4", formClassName),
995
- successMessageClassName,
996
- errorMessageClassName
997
- },
998
- formConfig: {
999
- endpoint: formConfig?.endpoint,
1000
- method: formMethod,
1001
- submissionConfig: formConfig?.submissionConfig
1002
- },
1003
- onNewSubmission: () => {
1004
- resetUpload();
1005
- resetSubmissionState();
1006
- },
1007
- children: [
1008
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-12 gap-6", children: formFields.map((field) => /* @__PURE__ */ jsx(
1009
- "div",
1010
- {
1011
- className: getColumnSpanClass(field.columnSpan),
1012
- children: /* @__PURE__ */ jsx(
1013
- DynamicFormField,
1014
- {
1015
- field,
1016
- uploadProgress,
1017
- onFileUpload: uploadFiles,
1018
- onFileRemove: removeFile,
1019
- isUploading
1020
- }
1021
- )
1022
- },
1023
- field.name
1024
- )) }),
1025
- actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxs(
1026
- Pressable,
1027
- {
1028
- componentType: "button",
1029
- type: "submit",
1030
- className: cn("w-full", submitClassName),
1031
- size: "lg",
1032
- asButton: true,
1033
- disabled: form.isSubmitting,
1034
- children: [
1035
- buttonIcon,
1036
- buttonText
1037
- ]
1038
- }
1039
- )
1040
- ]
510
+ formEngineSetup,
511
+ defaultFields: DEFAULT_FORM_FIELDS,
512
+ defaultStyleRules: DEFAULT_STYLE_RULES
1041
513
  }
1042
- ) }) })
514
+ ) : null }) })
1043
515
  ] })
1044
516
  }
1045
517
  );