@opensite/ui 2.1.3 → 2.1.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.
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
2
+ import { FormEngineProps } from '@page-speed/forms/integration';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-DmVsuoHE.js';
4
4
  import 'react/jsx-runtime';
5
5
  import './blocks-XLPGq8A5.js';
@@ -46,15 +46,9 @@ interface ContactFaqProps {
46
46
  */
47
47
  faqHeading?: React.ReactNode;
48
48
  /**
49
- * Array of form field configurations
50
- * If not provided, defaults to: name, email, subject, message
49
+ * Full form engine setup and props
51
50
  */
52
- formFields?: FormFieldConfig[];
53
- /**
54
- * Success message to display after form submission
55
- * @default "Thank you! Your message has been sent successfully."
56
- */
57
- successMessage?: React.ReactNode;
51
+ formEngineSetup?: FormEngineProps;
58
52
  /**
59
53
  * Additional CSS classes for the section
60
54
  */
@@ -87,14 +81,6 @@ interface ContactFaqProps {
87
81
  * Additional CSS classes for the form heading
88
82
  */
89
83
  formHeadingClassName?: string;
90
- /**
91
- * Additional CSS classes for the form
92
- */
93
- formClassName?: string;
94
- /**
95
- * Additional CSS classes for the submit button
96
- */
97
- submitClassName?: string;
98
84
  /**
99
85
  * Additional CSS classes for the FAQ heading
100
86
  */
@@ -123,14 +109,6 @@ interface ContactFaqProps {
123
109
  * Additional CSS classes for the two-column grid wrapper
124
110
  */
125
111
  gridClassName?: string;
126
- /**
127
- * Additional CSS classes for the success message
128
- */
129
- successMessageClassName?: string;
130
- /**
131
- * Additional CSS classes for the error message
132
- */
133
- errorMessageClassName?: string;
134
112
  /**
135
113
  * Background style for the section
136
114
  */
@@ -147,26 +125,10 @@ interface ContactFaqProps {
147
125
  * Pattern overlay opacity (0-1)
148
126
  */
149
127
  patternOpacity?: number;
150
- /**
151
- * Form configuration for PageSpeed forms
152
- */
153
- formConfig?: PageSpeedFormConfig;
154
- /**
155
- * Custom submit handler
156
- */
157
- onSubmit?: (values: Record<string, any>) => void | Promise<void>;
158
- /**
159
- * Success callback
160
- */
161
- onSuccess?: (data: unknown) => void;
162
- /**
163
- * Error callback
164
- */
165
- onError?: (error: Error) => void;
166
128
  }
167
129
  /**
168
130
  * ContactFaq - FAQ contact form with flexible field configuration
169
131
  */
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;
132
+ declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, items, itemsSlot, faqHeading, formEngineSetup, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formHeadingClassName, faqHeadingClassName, faqContainerClassName, accordionClassName, accordionItemClassName, accordionTriggerClassName, accordionContentClassName, gridClassName, background, spacing, pattern, patternOpacity, }: ContactFaqProps): React.JSX.Element;
171
133
 
172
134
  export { ContactFaq, type ContactFaqProps, type FaqItem };
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- import React, { useMemo } from 'react';
3
- import { useFileUpload, FormEngine } from '@page-speed/forms/integration';
2
+ import * as React3 from 'react';
3
+ import React3__default, { useMemo } from 'react';
4
+ import { FormEngine } from '@page-speed/forms/integration';
4
5
  import { clsx } from 'clsx';
5
6
  import { twMerge } from 'tailwind-merge';
6
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -107,7 +108,7 @@ var maxWidthStyles = {
107
108
  "4xl": "max-w-[1536px]",
108
109
  full: "max-w-full"
109
110
  };
110
- var Container = React.forwardRef(
111
+ var Container = React3__default.forwardRef(
111
112
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
112
113
  const Component = as;
113
114
  return /* @__PURE__ */ jsx(
@@ -412,7 +413,7 @@ var spacingStyles = {
412
413
  };
413
414
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
414
415
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
415
- var Section = React.forwardRef(
416
+ var Section = React3__default.forwardRef(
416
417
  ({
417
418
  id,
418
419
  title,
@@ -473,6 +474,14 @@ var Section = React.forwardRef(
473
474
  }
474
475
  );
475
476
  Section.displayName = "Section";
477
+ var DEFAULT_STYLE_RULES = {
478
+ formContainer: "",
479
+ fieldsContainer: "",
480
+ fieldClassName: "",
481
+ formClassName: "space-y-6",
482
+ successMessageClassName: "text-green-600 dark:text-green-400 mt-4 p-3 rounded-md bg-green-50 dark:bg-green-950/20",
483
+ errorMessageClassName: "text-red-600 dark:text-red-400 mt-4 p-3 rounded-md bg-red-50 dark:bg-red-950/20"
484
+ };
476
485
  var DEFAULT_FORM_FIELDS = [
477
486
  {
478
487
  name: "name",
@@ -517,8 +526,7 @@ function ContactFaq({
517
526
  items,
518
527
  itemsSlot,
519
528
  faqHeading,
520
- formFields = DEFAULT_FORM_FIELDS,
521
- successMessage = "Thank you! Your message has been sent successfully.",
529
+ formEngineSetup,
522
530
  className,
523
531
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
524
532
  headerClassName,
@@ -527,7 +535,6 @@ function ContactFaq({
527
535
  cardClassName,
528
536
  cardContentClassName,
529
537
  formHeadingClassName,
530
- formClassName,
531
538
  faqHeadingClassName,
532
539
  faqContainerClassName,
533
540
  accordionClassName,
@@ -535,25 +542,28 @@ function ContactFaq({
535
542
  accordionTriggerClassName,
536
543
  accordionContentClassName,
537
544
  gridClassName,
538
- successMessageClassName,
539
- errorMessageClassName,
540
545
  background,
541
546
  spacing = "py-8 md:py-32",
542
547
  pattern,
543
- patternOpacity,
544
- formConfig,
545
- onSubmit,
546
- onSuccess,
547
- onError
548
+ patternOpacity
548
549
  }) {
549
- const {
550
- uploadTokens,
551
- uploadProgress,
552
- isUploading,
553
- uploadFiles,
554
- removeFile,
555
- resetUpload
556
- } = useFileUpload({ onError });
550
+ const formStyleRules = React3.useMemo(() => {
551
+ return {
552
+ formContainer: formEngineSetup?.formLayoutSettings?.styleRules?.formContainer ?? DEFAULT_STYLE_RULES.formContainer,
553
+ fieldsContainer: formEngineSetup?.formLayoutSettings?.styleRules?.fieldsContainer ?? DEFAULT_STYLE_RULES.fieldsContainer,
554
+ fieldClassName: formEngineSetup?.formLayoutSettings?.styleRules?.fieldClassName ?? DEFAULT_STYLE_RULES.fieldClassName,
555
+ formClassName: formEngineSetup?.formLayoutSettings?.styleRules?.formClassName ?? DEFAULT_STYLE_RULES.formClassName,
556
+ successMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.successMessageClassName ?? DEFAULT_STYLE_RULES.successMessageClassName,
557
+ errorMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.errorMessageClassName ?? DEFAULT_STYLE_RULES.errorMessageClassName
558
+ };
559
+ }, [formEngineSetup?.formLayoutSettings?.styleRules]);
560
+ const formFields = React3.useMemo(() => {
561
+ if (formEngineSetup && formEngineSetup?.fields && formEngineSetup?.fields?.length > 0) {
562
+ return formEngineSetup.fields;
563
+ } else {
564
+ return DEFAULT_FORM_FIELDS;
565
+ }
566
+ }, [formEngineSetup?.fields]);
557
567
  const hasFaqItems = itemsSlot || items && items.length > 0;
558
568
  const faqContent = useMemo(() => {
559
569
  if (itemsSlot) return itemsSlot;
@@ -648,40 +658,25 @@ function ContactFaq({
648
658
  children: formHeading
649
659
  }
650
660
  ) : /* @__PURE__ */ jsx("div", { className: formHeadingClassName, children: formHeading })),
651
- /* @__PURE__ */ jsx(
661
+ formEngineSetup ? /* @__PURE__ */ jsx(
652
662
  FormEngine,
653
663
  {
654
- api: formConfig,
655
- fields: formFields,
664
+ ...formEngineSetup,
656
665
  formLayoutSettings: {
666
+ ...formEngineSetup.formLayoutSettings,
657
667
  formLayout: "standard",
658
668
  submitButtonSetup: {
669
+ ...formEngineSetup.formLayoutSettings?.submitButtonSetup,
659
670
  submitLabel: /* @__PURE__ */ jsxs(Fragment, { children: [
660
671
  buttonIcon,
661
672
  buttonText
662
673
  ] })
663
674
  },
664
- styleRules: {
665
- formClassName: cn("space-y-6", formClassName),
666
- successMessageClassName,
667
- errorMessageClassName
668
- }
669
- },
670
- successMessage,
671
- onSubmit,
672
- onSuccess: (data) => {
673
- resetUpload();
674
- onSuccess?.(data);
675
+ styleRules: formStyleRules
675
676
  },
676
- onError,
677
- resetOnSuccess: formConfig?.resetOnSuccess !== false,
678
- uploadTokens,
679
- uploadProgress,
680
- onFileUpload: uploadFiles,
681
- onFileRemove: removeFile,
682
- isUploading
677
+ fields: formFields
683
678
  }
684
- )
679
+ ) : null
685
680
  ] }) }),
686
681
  hasFaqItems && /* @__PURE__ */ jsxs("div", { className: cn("relative", faqContainerClassName), children: [
687
682
  faqHeading && (typeof faqHeading === "string" ? /* @__PURE__ */ jsx(
@@ -1,15 +1,31 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
+ var React3 = require('react');
4
5
  var integration = require('@page-speed/forms/integration');
5
6
  var clsx = require('clsx');
6
7
  var tailwindMerge = require('tailwind-merge');
7
8
  var jsxRuntime = require('react/jsx-runtime');
8
- var React = require('react');
9
9
 
10
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
11
27
 
12
- var React__default = /*#__PURE__*/_interopDefault(React);
28
+ var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
13
29
 
14
30
  // components/blocks/contact/contact-vendor.tsx
15
31
  function cn(...inputs) {
@@ -47,7 +63,7 @@ var maxWidthStyles = {
47
63
  "4xl": "max-w-[1536px]",
48
64
  full: "max-w-full"
49
65
  };
50
- var Container = React__default.default.forwardRef(
66
+ var Container = React3__namespace.default.forwardRef(
51
67
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
52
68
  const Component = as;
53
69
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -352,7 +368,7 @@ var spacingStyles = {
352
368
  };
353
369
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
354
370
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
355
- var Section = React__default.default.forwardRef(
371
+ var Section = React3__namespace.default.forwardRef(
356
372
  ({
357
373
  id,
358
374
  title,
@@ -413,6 +429,14 @@ var Section = React__default.default.forwardRef(
413
429
  }
414
430
  );
415
431
  Section.displayName = "Section";
432
+ var DEFAULT_STYLE_RULES = {
433
+ formContainer: "",
434
+ fieldsContainer: "",
435
+ fieldClassName: "",
436
+ formClassName: "space-y-6",
437
+ successMessageClassName: "text-green-600 dark:text-green-400 mt-4 p-3 rounded-md bg-green-50 dark:bg-green-950/20",
438
+ errorMessageClassName: "text-red-600 dark:text-red-400 mt-4 p-3 rounded-md bg-red-50 dark:bg-red-950/20"
439
+ };
416
440
  var DEFAULT_FORM_FIELDS = [
417
441
  {
418
442
  name: "first_name",
@@ -459,40 +483,36 @@ var DEFAULT_FORM_FIELDS = [
459
483
  function ContactVendor({
460
484
  heading,
461
485
  description,
462
- buttonText = "Submit",
463
- buttonIcon,
464
- actions,
465
- actionsSlot,
466
- formFields = DEFAULT_FORM_FIELDS,
467
- successMessage = "Thank you! Your message has been sent successfully.",
468
486
  className,
487
+ formEngineSetup,
469
488
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
470
489
  headerClassName,
471
490
  headingClassName,
472
491
  descriptionClassName,
473
492
  cardClassName,
474
493
  cardContentClassName,
475
- formClassName,
476
- submitClassName,
477
- successMessageClassName,
478
- errorMessageClassName,
479
- background = "white",
494
+ background,
480
495
  spacing = "xl",
481
496
  pattern,
482
- patternOpacity = 0.1,
483
- formConfig,
484
- onSubmit,
485
- onSuccess,
486
- onError
497
+ patternOpacity = 0.1
487
498
  }) {
488
- const {
489
- uploadTokens,
490
- uploadProgress,
491
- isUploading,
492
- uploadFiles,
493
- removeFile,
494
- resetUpload
495
- } = integration.useFileUpload({ onError });
499
+ const formStyleRules = React3__namespace.useMemo(() => {
500
+ return {
501
+ formContainer: formEngineSetup?.formLayoutSettings?.styleRules?.formContainer ?? DEFAULT_STYLE_RULES.formContainer,
502
+ fieldsContainer: formEngineSetup?.formLayoutSettings?.styleRules?.fieldsContainer ?? DEFAULT_STYLE_RULES.fieldsContainer,
503
+ fieldClassName: formEngineSetup?.formLayoutSettings?.styleRules?.fieldClassName ?? DEFAULT_STYLE_RULES.fieldClassName,
504
+ formClassName: formEngineSetup?.formLayoutSettings?.styleRules?.formClassName ?? DEFAULT_STYLE_RULES.formClassName,
505
+ successMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.successMessageClassName ?? DEFAULT_STYLE_RULES.successMessageClassName,
506
+ errorMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.errorMessageClassName ?? DEFAULT_STYLE_RULES.errorMessageClassName
507
+ };
508
+ }, [formEngineSetup?.formLayoutSettings?.styleRules]);
509
+ const formFields = React3__namespace.useMemo(() => {
510
+ if (formEngineSetup && formEngineSetup?.fields && formEngineSetup?.fields?.length > 0) {
511
+ return formEngineSetup.fields;
512
+ } else {
513
+ return DEFAULT_FORM_FIELDS;
514
+ }
515
+ }, [formEngineSetup?.fields]);
496
516
  return /* @__PURE__ */ jsxRuntime.jsx(
497
517
  Section,
498
518
  {
@@ -513,7 +533,7 @@ function ContactVendor({
513
533
  ),
514
534
  children: heading
515
535
  }
516
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
536
+ ) : heading),
517
537
  description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
518
538
  "p",
519
539
  {
@@ -523,42 +543,19 @@ function ContactVendor({
523
543
  ),
524
544
  children: description
525
545
  }
526
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
546
+ ) : description)
527
547
  ] }),
528
- /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
548
+ /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: formEngineSetup ? /* @__PURE__ */ jsxRuntime.jsx(
529
549
  integration.FormEngine,
530
550
  {
531
- api: formConfig,
532
- fields: formFields,
551
+ ...formEngineSetup,
533
552
  formLayoutSettings: {
534
- formLayout: "standard",
535
- submitButtonSetup: {
536
- submitLabel: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
537
- buttonIcon,
538
- buttonText
539
- ] })
540
- },
541
- styleRules: {
542
- formClassName: cn("space-y-4", formClassName),
543
- successMessageClassName,
544
- errorMessageClassName
545
- }
546
- },
547
- successMessage,
548
- onSubmit,
549
- onSuccess: (data) => {
550
- resetUpload();
551
- onSuccess?.(data);
553
+ ...formEngineSetup.formLayoutSettings,
554
+ styleRules: formStyleRules
552
555
  },
553
- onError,
554
- resetOnSuccess: formConfig?.resetOnSuccess !== false,
555
- uploadTokens,
556
- uploadProgress,
557
- onFileUpload: uploadFiles,
558
- onFileRemove: removeFile,
559
- isUploading
556
+ fields: formFields
560
557
  }
561
- ) }) })
558
+ ) : null }) })
562
559
  ] })
563
560
  }
564
561
  );
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
2
+ import { FormEngineProps } 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';
@@ -12,24 +12,6 @@ interface ContactVendorProps {
12
12
  heading?: React.ReactNode;
13
13
  /** Description text below heading */
14
14
  description?: React.ReactNode;
15
- /** Submit button text */
16
- buttonText?: string;
17
- /** Icon to display in submit button */
18
- buttonIcon?: React.ReactNode;
19
- /** Array of action configurations for custom buttons */
20
- actions?: ActionConfig[];
21
- /** Custom slot for rendering actions (overrides actions array) */
22
- actionsSlot?: React.ReactNode;
23
- /**
24
- * Array of form field configurations
25
- * If not provided, defaults to: first_name, last_name, email, phone, message
26
- */
27
- formFields?: FormFieldConfig[];
28
- /**
29
- * Success message to display after form submission
30
- * @default "Thank you! Your message has been sent successfully."
31
- */
32
- successMessage?: React.ReactNode;
33
15
  /** Additional CSS classes for the section */
34
16
  className?: string;
35
17
  /** Additional CSS classes for the container */
@@ -44,14 +26,6 @@ interface ContactVendorProps {
44
26
  cardClassName?: string;
45
27
  /** Additional CSS classes for the card content */
46
28
  cardContentClassName?: string;
47
- /** Additional CSS classes for the form */
48
- formClassName?: string;
49
- /** Additional CSS classes for the submit button */
50
- submitClassName?: string;
51
- /** Additional CSS classes for the success message */
52
- successMessageClassName?: string;
53
- /** Additional CSS classes for the error message */
54
- errorMessageClassName?: string;
55
29
  /**
56
30
  * Background style for the section
57
31
  */
@@ -68,14 +42,10 @@ interface ContactVendorProps {
68
42
  * Pattern overlay opacity (0-1)
69
43
  */
70
44
  patternOpacity?: number;
71
- /** Form configuration for PageSpeed forms */
72
- formConfig?: PageSpeedFormConfig;
73
- /** Custom submit handler */
74
- onSubmit?: (values: Record<string, any>) => void | Promise<void>;
75
- /** Success callback */
76
- onSuccess?: (data: unknown) => void;
77
- /** Error callback */
78
- onError?: (error: Error) => void;
45
+ /**
46
+ * Full form engine setup and props
47
+ */
48
+ formEngineSetup?: FormEngineProps;
79
49
  }
80
50
  /**
81
51
  * ContactVendor - Contact form with flexible field configuration
@@ -88,6 +58,6 @@ interface ContactVendorProps {
88
58
  * />
89
59
  * ```
90
60
  */
91
- declare function ContactVendor({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactVendorProps): React.JSX.Element;
61
+ declare function ContactVendor({ heading, description, className, formEngineSetup, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, background, spacing, pattern, patternOpacity, }: ContactVendorProps): React.JSX.Element;
92
62
 
93
63
  export { ContactVendor, type ContactVendorProps };
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
2
+ import { FormEngineProps } from '@page-speed/forms/integration';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-DmVsuoHE.js';
4
- import { A as ActionConfig } from './blocks-XLPGq8A5.js';
5
4
  import 'react/jsx-runtime';
5
+ import './blocks-XLPGq8A5.js';
6
6
  import 'class-variance-authority';
7
7
  import './button-variants-CdNtNOuP.js';
8
8
  import 'class-variance-authority/types';
@@ -12,24 +12,6 @@ interface ContactVendorProps {
12
12
  heading?: React.ReactNode;
13
13
  /** Description text below heading */
14
14
  description?: React.ReactNode;
15
- /** Submit button text */
16
- buttonText?: string;
17
- /** Icon to display in submit button */
18
- buttonIcon?: React.ReactNode;
19
- /** Array of action configurations for custom buttons */
20
- actions?: ActionConfig[];
21
- /** Custom slot for rendering actions (overrides actions array) */
22
- actionsSlot?: React.ReactNode;
23
- /**
24
- * Array of form field configurations
25
- * If not provided, defaults to: first_name, last_name, email, phone, message
26
- */
27
- formFields?: FormFieldConfig[];
28
- /**
29
- * Success message to display after form submission
30
- * @default "Thank you! Your message has been sent successfully."
31
- */
32
- successMessage?: React.ReactNode;
33
15
  /** Additional CSS classes for the section */
34
16
  className?: string;
35
17
  /** Additional CSS classes for the container */
@@ -44,14 +26,6 @@ interface ContactVendorProps {
44
26
  cardClassName?: string;
45
27
  /** Additional CSS classes for the card content */
46
28
  cardContentClassName?: string;
47
- /** Additional CSS classes for the form */
48
- formClassName?: string;
49
- /** Additional CSS classes for the submit button */
50
- submitClassName?: string;
51
- /** Additional CSS classes for the success message */
52
- successMessageClassName?: string;
53
- /** Additional CSS classes for the error message */
54
- errorMessageClassName?: string;
55
29
  /**
56
30
  * Background style for the section
57
31
  */
@@ -68,14 +42,10 @@ interface ContactVendorProps {
68
42
  * Pattern overlay opacity (0-1)
69
43
  */
70
44
  patternOpacity?: number;
71
- /** Form configuration for PageSpeed forms */
72
- formConfig?: PageSpeedFormConfig;
73
- /** Custom submit handler */
74
- onSubmit?: (values: Record<string, any>) => void | Promise<void>;
75
- /** Success callback */
76
- onSuccess?: (data: unknown) => void;
77
- /** Error callback */
78
- onError?: (error: Error) => void;
45
+ /**
46
+ * Full form engine setup and props
47
+ */
48
+ formEngineSetup?: FormEngineProps;
79
49
  }
80
50
  /**
81
51
  * ContactVendor - Contact form with flexible field configuration
@@ -88,6 +58,6 @@ interface ContactVendorProps {
88
58
  * />
89
59
  * ```
90
60
  */
91
- declare function ContactVendor({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactVendorProps): React.JSX.Element;
61
+ declare function ContactVendor({ heading, description, className, formEngineSetup, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, background, spacing, pattern, patternOpacity, }: ContactVendorProps): React.JSX.Element;
92
62
 
93
63
  export { ContactVendor, type ContactVendorProps };