@opensite/ui 2.1.2 → 2.1.3

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.
@@ -2,15 +2,15 @@
2
2
  'use strict';
3
3
 
4
4
  var React = require('react');
5
- var forms = require('@page-speed/forms');
6
5
  var integration = require('@page-speed/forms/integration');
7
6
  var clsx = require('clsx');
8
7
  var tailwindMerge = require('tailwind-merge');
9
- var classVarianceAuthority = require('class-variance-authority');
10
8
  var jsxRuntime = require('react/jsx-runtime');
11
9
  var AccordionPrimitive = require('@radix-ui/react-accordion');
12
10
  var icon = require('@page-speed/icon');
13
11
 
12
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
+
14
14
  function _interopNamespace(e) {
15
15
  if (e && e.__esModule) return e;
16
16
  var n = Object.create(null);
@@ -29,431 +29,13 @@ function _interopNamespace(e) {
29
29
  return Object.freeze(n);
30
30
  }
31
31
 
32
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
32
+ var React__default = /*#__PURE__*/_interopDefault(React);
33
33
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
34
34
 
35
35
  // components/blocks/contact/contact-faq.tsx
36
36
  function cn(...inputs) {
37
37
  return tailwindMerge.twMerge(clsx.clsx(inputs));
38
38
  }
39
- function normalizePhoneNumber(input) {
40
- const trimmed = input.trim();
41
- if (trimmed.toLowerCase().startsWith("tel:")) {
42
- return trimmed;
43
- }
44
- const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
45
- if (match) {
46
- const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
47
- const extension = match[3];
48
- const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
49
- const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
50
- return `tel:${withExtension}`;
51
- }
52
- const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
53
- return `tel:${cleaned}`;
54
- }
55
- function normalizeEmail(input) {
56
- const trimmed = input.trim();
57
- if (trimmed.toLowerCase().startsWith("mailto:")) {
58
- return trimmed;
59
- }
60
- return `mailto:${trimmed}`;
61
- }
62
- function isEmail(input) {
63
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
64
- return emailRegex.test(input.trim());
65
- }
66
- function isPhoneNumber(input) {
67
- const trimmed = input.trim();
68
- if (trimmed.toLowerCase().startsWith("tel:")) {
69
- return true;
70
- }
71
- const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
72
- return phoneRegex.test(trimmed);
73
- }
74
- function isInternalUrl(href) {
75
- if (typeof window === "undefined") {
76
- return href.startsWith("/") && !href.startsWith("//");
77
- }
78
- const trimmed = href.trim();
79
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
80
- return true;
81
- }
82
- try {
83
- const url = new URL(trimmed, window.location.href);
84
- const currentOrigin = window.location.origin;
85
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
86
- return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
87
- } catch {
88
- return false;
89
- }
90
- }
91
- function toRelativePath(href) {
92
- if (typeof window === "undefined") {
93
- return href;
94
- }
95
- const trimmed = href.trim();
96
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
97
- return trimmed;
98
- }
99
- try {
100
- const url = new URL(trimmed, window.location.href);
101
- const currentOrigin = window.location.origin;
102
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
103
- if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
104
- return url.pathname + url.search + url.hash;
105
- }
106
- } catch {
107
- }
108
- return trimmed;
109
- }
110
- function useNavigation({
111
- href,
112
- onClick
113
- } = {}) {
114
- const linkType = React__namespace.useMemo(() => {
115
- if (!href || href.trim() === "") {
116
- return onClick ? "none" : "none";
117
- }
118
- const trimmed = href.trim();
119
- if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
120
- return "mailto";
121
- }
122
- if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
123
- return "tel";
124
- }
125
- if (isInternalUrl(trimmed)) {
126
- return "internal";
127
- }
128
- try {
129
- new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
130
- return "external";
131
- } catch {
132
- return "internal";
133
- }
134
- }, [href, onClick]);
135
- const normalizedHref = React__namespace.useMemo(() => {
136
- if (!href || href.trim() === "") {
137
- return void 0;
138
- }
139
- const trimmed = href.trim();
140
- switch (linkType) {
141
- case "tel":
142
- return normalizePhoneNumber(trimmed);
143
- case "mailto":
144
- return normalizeEmail(trimmed);
145
- case "internal":
146
- return toRelativePath(trimmed);
147
- case "external":
148
- return trimmed;
149
- default:
150
- return trimmed;
151
- }
152
- }, [href, linkType]);
153
- const target = React__namespace.useMemo(() => {
154
- switch (linkType) {
155
- case "external":
156
- return "_blank";
157
- case "internal":
158
- return "_self";
159
- case "mailto":
160
- case "tel":
161
- return void 0;
162
- default:
163
- return void 0;
164
- }
165
- }, [linkType]);
166
- const rel = React__namespace.useMemo(() => {
167
- if (linkType === "external") {
168
- return "noopener noreferrer";
169
- }
170
- return void 0;
171
- }, [linkType]);
172
- const isExternal = linkType === "external";
173
- const isInternal = linkType === "internal";
174
- const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
175
- const handleClick = React__namespace.useCallback(
176
- (event) => {
177
- if (onClick) {
178
- try {
179
- onClick(event);
180
- } catch (error) {
181
- console.error("Error in user onClick handler:", error);
182
- }
183
- }
184
- if (event.defaultPrevented) {
185
- return;
186
- }
187
- if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
188
- !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
189
- if (typeof window !== "undefined") {
190
- const handler = window.__opensiteNavigationHandler;
191
- if (typeof handler === "function") {
192
- try {
193
- const handled = handler(normalizedHref, event.nativeEvent || event);
194
- if (handled !== false) {
195
- event.preventDefault();
196
- }
197
- } catch (error) {
198
- console.error("Error in navigation handler:", error);
199
- }
200
- }
201
- }
202
- }
203
- },
204
- [onClick, shouldUseRouter, normalizedHref]
205
- );
206
- return {
207
- linkType,
208
- normalizedHref,
209
- target,
210
- rel,
211
- isExternal,
212
- isInternal,
213
- shouldUseRouter,
214
- handleClick
215
- };
216
- }
217
- var baseStyles = [
218
- // Layout
219
- "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
220
- // Typography - using CSS variables with sensible defaults
221
- "font-[var(--button-font-family,inherit)]",
222
- "font-[var(--button-font-weight,500)]",
223
- "tracking-[var(--button-letter-spacing,0)]",
224
- "leading-[var(--button-line-height,1.25)]",
225
- "[text-transform:var(--button-text-transform,none)]",
226
- "text-sm",
227
- // Border radius
228
- "rounded-[var(--button-radius,var(--radius,0.375rem))]",
229
- // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
230
- "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
231
- // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
232
- "[box-shadow:var(--button-shadow,none)]",
233
- "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
234
- // Disabled state
235
- "disabled:pointer-events-none disabled:opacity-50",
236
- // SVG handling
237
- "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
238
- // Focus styles
239
- "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
240
- // Invalid state
241
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
242
- ].join(" ");
243
- var buttonVariants = classVarianceAuthority.cva(baseStyles, {
244
- variants: {
245
- variant: {
246
- // Default (Primary) variant - full customization
247
- default: [
248
- "bg-[var(--button-default-bg,hsl(var(--primary)))]",
249
- "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
250
- "border-[length:var(--button-default-border-width,0px)]",
251
- "border-[color:var(--button-default-border,transparent)]",
252
- "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
253
- "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
254
- "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
255
- "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
256
- "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
257
- ].join(" "),
258
- // Destructive variant - full customization
259
- destructive: [
260
- "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
261
- "text-[var(--button-destructive-fg,white)]",
262
- "border-[length:var(--button-destructive-border-width,0px)]",
263
- "border-[color:var(--button-destructive-border,transparent)]",
264
- "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
265
- "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
266
- "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
267
- "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
268
- "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
269
- "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
270
- "dark:bg-destructive/60"
271
- ].join(" "),
272
- // Outline variant - full customization with proper border handling
273
- outline: [
274
- "bg-[var(--button-outline-bg,hsl(var(--background)))]",
275
- "text-[var(--button-outline-fg,inherit)]",
276
- "border-[length:var(--button-outline-border-width,1px)]",
277
- "border-[color:var(--button-outline-border,hsl(var(--border)))]",
278
- "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
279
- "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
280
- "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
281
- "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
282
- "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
283
- "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
284
- ].join(" "),
285
- // Secondary variant - full customization
286
- secondary: [
287
- "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
288
- "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
289
- "border-[length:var(--button-secondary-border-width,0px)]",
290
- "border-[color:var(--button-secondary-border,transparent)]",
291
- "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
292
- "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
293
- "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
294
- "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
295
- "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
296
- ].join(" "),
297
- // Ghost variant - full customization
298
- ghost: [
299
- "bg-[var(--button-ghost-bg,transparent)]",
300
- "text-[var(--button-ghost-fg,inherit)]",
301
- "border-[length:var(--button-ghost-border-width,0px)]",
302
- "border-[color:var(--button-ghost-border,transparent)]",
303
- "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
304
- "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
305
- "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
306
- "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
307
- "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
308
- "dark:hover:bg-accent/50"
309
- ].join(" "),
310
- // Link variant - full customization
311
- link: [
312
- "bg-[var(--button-link-bg,transparent)]",
313
- "text-[var(--button-link-fg,hsl(var(--primary)))]",
314
- "border-[length:var(--button-link-border-width,0px)]",
315
- "border-[color:var(--button-link-border,transparent)]",
316
- "[box-shadow:var(--button-link-shadow,none)]",
317
- "hover:bg-[var(--button-link-hover-bg,transparent)]",
318
- "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
319
- "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
320
- "underline-offset-4 hover:underline"
321
- ].join(" ")
322
- },
323
- size: {
324
- default: [
325
- "h-[var(--button-height-md,2.25rem)]",
326
- "px-[var(--button-padding-x-md,1rem)]",
327
- "py-[var(--button-padding-y-md,0.5rem)]",
328
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
329
- ].join(" "),
330
- sm: [
331
- "h-[var(--button-height-sm,2rem)]",
332
- "px-[var(--button-padding-x-sm,0.75rem)]",
333
- "py-[var(--button-padding-y-sm,0.25rem)]",
334
- "gap-1.5",
335
- "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
336
- ].join(" "),
337
- md: [
338
- "h-[var(--button-height-md,2.25rem)]",
339
- "px-[var(--button-padding-x-md,1rem)]",
340
- "py-[var(--button-padding-y-md,0.5rem)]",
341
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
342
- ].join(" "),
343
- lg: [
344
- "h-[var(--button-height-lg,2.5rem)]",
345
- "px-[var(--button-padding-x-lg,1.5rem)]",
346
- "py-[var(--button-padding-y-lg,0.5rem)]",
347
- "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
348
- ].join(" "),
349
- icon: "size-[var(--button-height-md,2.25rem)]",
350
- "icon-sm": "size-[var(--button-height-sm,2rem)]",
351
- "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
352
- }
353
- },
354
- defaultVariants: {
355
- variant: "default",
356
- size: "default"
357
- }
358
- });
359
- var Pressable = React__namespace.forwardRef(
360
- ({
361
- children,
362
- className,
363
- href,
364
- onClick,
365
- variant,
366
- size,
367
- asButton = false,
368
- fallbackComponentType = "span",
369
- componentType,
370
- "aria-label": ariaLabel,
371
- "aria-describedby": ariaDescribedby,
372
- id,
373
- ...props
374
- }, ref) => {
375
- const navigation = useNavigation({ href, onClick });
376
- const {
377
- normalizedHref,
378
- target,
379
- rel,
380
- linkType,
381
- isInternal,
382
- handleClick
383
- } = navigation;
384
- const shouldRenderLink = normalizedHref && linkType !== "none";
385
- const shouldRenderButton = !shouldRenderLink && onClick;
386
- const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
387
- const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
388
- const shouldApplyButtonStyles = asButton || variant || size;
389
- const combinedClassName = cn(
390
- shouldApplyButtonStyles && buttonVariants({ variant, size }),
391
- className
392
- );
393
- const dataProps = Object.fromEntries(
394
- Object.entries(props).filter(([key]) => key.startsWith("data-"))
395
- );
396
- const buttonDataAttributes = shouldApplyButtonStyles ? {
397
- "data-slot": "button",
398
- "data-variant": variant ?? "default",
399
- "data-size": size ?? "default"
400
- } : {};
401
- const commonProps = {
402
- className: combinedClassName,
403
- onClick: handleClick,
404
- "aria-label": ariaLabel,
405
- "aria-describedby": ariaDescribedby,
406
- id,
407
- ...dataProps,
408
- ...buttonDataAttributes
409
- };
410
- if (finalComponentType === "a" && shouldRenderLink) {
411
- return /* @__PURE__ */ jsxRuntime.jsx(
412
- "a",
413
- {
414
- ref,
415
- href: normalizedHref,
416
- target,
417
- rel,
418
- ...commonProps,
419
- ...props,
420
- children
421
- }
422
- );
423
- }
424
- if (finalComponentType === "button") {
425
- return /* @__PURE__ */ jsxRuntime.jsx(
426
- "button",
427
- {
428
- ref,
429
- type: props.type || "button",
430
- ...commonProps,
431
- ...props,
432
- children
433
- }
434
- );
435
- }
436
- if (finalComponentType === "div") {
437
- return /* @__PURE__ */ jsxRuntime.jsx(
438
- "div",
439
- {
440
- ref,
441
- ...commonProps,
442
- children
443
- }
444
- );
445
- }
446
- return /* @__PURE__ */ jsxRuntime.jsx(
447
- "span",
448
- {
449
- ref,
450
- ...commonProps,
451
- children
452
- }
453
- );
454
- }
455
- );
456
- Pressable.displayName = "Pressable";
457
39
  function Card({ className, ...props }) {
458
40
  return /* @__PURE__ */ jsxRuntime.jsx(
459
41
  "div",
@@ -550,7 +132,7 @@ var maxWidthStyles = {
550
132
  "4xl": "max-w-[1536px]",
551
133
  full: "max-w-full"
552
134
  };
553
- var Container = React__namespace.default.forwardRef(
135
+ var Container = React__default.default.forwardRef(
554
136
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
555
137
  const Component = as;
556
138
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -855,7 +437,7 @@ var spacingStyles = {
855
437
  };
856
438
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
857
439
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
858
- var Section = React__namespace.default.forwardRef(
440
+ var Section = React__default.default.forwardRef(
859
441
  ({
860
442
  id,
861
443
  title,
@@ -957,8 +539,6 @@ function ContactFaq({
957
539
  formHeading,
958
540
  buttonText = "Submit",
959
541
  buttonIcon,
960
- actions,
961
- actionsSlot,
962
542
  items,
963
543
  itemsSlot,
964
544
  faqHeading,
@@ -973,7 +553,6 @@ function ContactFaq({
973
553
  cardContentClassName,
974
554
  formHeadingClassName,
975
555
  formClassName,
976
- submitClassName,
977
556
  faqHeadingClassName,
978
557
  faqContainerClassName,
979
558
  accordionClassName,
@@ -1000,48 +579,6 @@ function ContactFaq({
1000
579
  removeFile,
1001
580
  resetUpload
1002
581
  } = integration.useFileUpload({ onError });
1003
- const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
1004
- formFields,
1005
- formConfig,
1006
- onSubmit,
1007
- onSuccess: (data) => {
1008
- resetUpload();
1009
- onSuccess?.(data);
1010
- },
1011
- onError,
1012
- resetOnSuccess: formConfig?.resetOnSuccess !== false,
1013
- uploadTokens
1014
- });
1015
- const actionsContent = React.useMemo(() => {
1016
- if (actionsSlot) return actionsSlot;
1017
- if (actions && actions.length > 0) {
1018
- return actions.map((action, index) => {
1019
- const {
1020
- label,
1021
- icon,
1022
- iconAfter,
1023
- children,
1024
- className: actionClassName,
1025
- ...pressableProps
1026
- } = action;
1027
- return /* @__PURE__ */ jsxRuntime.jsx(
1028
- Pressable,
1029
- {
1030
- asButton: true,
1031
- className: actionClassName,
1032
- ...pressableProps,
1033
- children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1034
- icon,
1035
- label,
1036
- iconAfter
1037
- ] })
1038
- },
1039
- index
1040
- );
1041
- });
1042
- }
1043
- return null;
1044
- }, [actionsSlot, actions]);
1045
582
  const hasFaqItems = itemsSlot || items && items.length > 0;
1046
583
  const faqContent = React.useMemo(() => {
1047
584
  if (itemsSlot) return itemsSlot;
@@ -1102,7 +639,7 @@ function ContactFaq({
1102
639
  ),
1103
640
  children: heading
1104
641
  }
1105
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
642
+ ) : heading),
1106
643
  description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1107
644
  "p",
1108
645
  {
@@ -1112,7 +649,7 @@ function ContactFaq({
1112
649
  ),
1113
650
  children: description
1114
651
  }
1115
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
652
+ ) : description)
1116
653
  ]
1117
654
  }
1118
655
  ),
@@ -1136,62 +673,38 @@ function ContactFaq({
1136
673
  children: formHeading
1137
674
  }
1138
675
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: formHeadingClassName, children: formHeading })),
1139
- /* @__PURE__ */ jsxRuntime.jsxs(
1140
- forms.Form,
676
+ /* @__PURE__ */ jsxRuntime.jsx(
677
+ integration.FormEngine,
1141
678
  {
1142
- form,
1143
- notificationConfig: {
1144
- submissionError,
1145
- successMessage
1146
- },
1147
- styleConfig: {
1148
- formClassName: cn("space-y-6", formClassName),
1149
- successMessageClassName,
1150
- errorMessageClassName
1151
- },
1152
- formConfig: {
1153
- endpoint: formConfig?.endpoint,
1154
- method: formMethod,
1155
- submissionConfig: formConfig?.submissionConfig
679
+ api: formConfig,
680
+ fields: formFields,
681
+ formLayoutSettings: {
682
+ formLayout: "standard",
683
+ submitButtonSetup: {
684
+ submitLabel: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
685
+ buttonIcon,
686
+ buttonText
687
+ ] })
688
+ },
689
+ styleRules: {
690
+ formClassName: cn("space-y-6", formClassName),
691
+ successMessageClassName,
692
+ errorMessageClassName
693
+ }
1156
694
  },
1157
- onNewSubmission: () => {
695
+ successMessage,
696
+ onSubmit,
697
+ onSuccess: (data) => {
1158
698
  resetUpload();
1159
- resetSubmissionState();
699
+ onSuccess?.(data);
1160
700
  },
1161
- children: [
1162
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-12 gap-6", children: formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
1163
- "div",
1164
- {
1165
- className: integration.getColumnSpanClass(field.columnSpan),
1166
- children: /* @__PURE__ */ jsxRuntime.jsx(
1167
- integration.DynamicFormField,
1168
- {
1169
- field,
1170
- uploadProgress,
1171
- onFileUpload: uploadFiles,
1172
- onFileRemove: removeFile,
1173
- isUploading
1174
- }
1175
- )
1176
- },
1177
- field.name
1178
- )) }),
1179
- actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxRuntime.jsxs(
1180
- Pressable,
1181
- {
1182
- componentType: "button",
1183
- type: "submit",
1184
- className: cn("w-full", submitClassName),
1185
- size: "lg",
1186
- asButton: true,
1187
- disabled: form.isSubmitting,
1188
- children: [
1189
- buttonIcon,
1190
- buttonText
1191
- ]
1192
- }
1193
- )
1194
- ]
701
+ onError,
702
+ resetOnSuccess: formConfig?.resetOnSuccess !== false,
703
+ uploadTokens,
704
+ uploadProgress,
705
+ onFileUpload: uploadFiles,
706
+ onFileRemove: removeFile,
707
+ isUploading
1195
708
  }
1196
709
  )
1197
710
  ] }) }),
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-r_NhxVet.cjs';
4
- import { A as ActionConfig } from './blocks-DP3Vofl4.cjs';
5
4
  import 'react/jsx-runtime';
5
+ import './blocks-DP3Vofl4.cjs';
6
6
  import 'class-variance-authority';
7
7
  import './button-variants-CdNtNOuP.cjs';
8
8
  import 'class-variance-authority/types';
@@ -33,14 +33,6 @@ interface ContactFaqProps {
33
33
  * Icon to display in submit button
34
34
  */
35
35
  buttonIcon?: React.ReactNode;
36
- /**
37
- * Array of action configurations for custom buttons
38
- */
39
- actions?: ActionConfig[];
40
- /**
41
- * Custom slot for rendering actions (overrides actions array)
42
- */
43
- actionsSlot?: React.ReactNode;
44
36
  /**
45
37
  * Array of FAQ items to display alongside the contact form
46
38
  */
@@ -175,6 +167,6 @@ interface ContactFaqProps {
175
167
  /**
176
168
  * ContactFaq - FAQ contact form with flexible field configuration
177
169
  */
178
- declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, actions, actionsSlot, items, itemsSlot, faqHeading, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formHeadingClassName, formClassName, submitClassName, faqHeadingClassName, faqContainerClassName, accordionClassName, accordionItemClassName, accordionTriggerClassName, accordionContentClassName, gridClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactFaqProps): React.JSX.Element;
170
+ declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, items, itemsSlot, faqHeading, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formHeadingClassName, formClassName, faqHeadingClassName, faqContainerClassName, accordionClassName, accordionItemClassName, accordionTriggerClassName, accordionContentClassName, gridClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactFaqProps): React.JSX.Element;
179
171
 
180
172
  export { ContactFaq, type ContactFaqProps, type FaqItem };