@opensite/ui 1.7.5 → 1.7.6

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,18 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { P as PageSpeedFormConfig } from './forms-BCcwNFhk.cjs';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bz_A5vLU.cjs';
4
+ import { F as FormFieldConfig } from './form-field-types-BYdJNOsW.cjs';
4
5
  import { A as ActionConfig } from './blocks-Cohq4eio.cjs';
5
6
  import 'react/jsx-runtime';
6
7
  import 'class-variance-authority';
7
8
  import './button-variants-lRElsmTc.cjs';
8
9
  import 'class-variance-authority/types';
9
10
 
10
- interface ContactFaqFormValues {
11
- name: string;
12
- email: string;
13
- subject: string;
14
- message: string;
15
- }
16
11
  interface FaqItem {
17
12
  id: string;
18
13
  question: React.ReactNode;
@@ -59,6 +54,21 @@ interface ContactFaqProps {
59
54
  * Heading for the FAQ section
60
55
  */
61
56
  faqHeading?: React.ReactNode;
57
+ /**
58
+ * Array of form field configurations
59
+ * If not provided, defaults to: name, email, subject, message
60
+ */
61
+ formFields?: FormFieldConfig[];
62
+ /**
63
+ * Success message to display after form submission
64
+ * @default "Thank you! Your message has been sent successfully."
65
+ */
66
+ successMessage?: React.ReactNode;
67
+ /**
68
+ * Error message to display if submission fails
69
+ * @default "There was an error sending your message. Please try again."
70
+ */
71
+ errorMessage?: React.ReactNode;
62
72
  /**
63
73
  * Additional CSS classes for the section
64
74
  */
@@ -127,6 +137,14 @@ interface ContactFaqProps {
127
137
  * Additional CSS classes for the two-column grid wrapper
128
138
  */
129
139
  gridClassName?: string;
140
+ /**
141
+ * Additional CSS classes for the success message
142
+ */
143
+ successMessageClassName?: string;
144
+ /**
145
+ * Additional CSS classes for the error message
146
+ */
147
+ errorMessageClassName?: string;
130
148
  /**
131
149
  * Background style for the section
132
150
  */
@@ -150,7 +168,7 @@ interface ContactFaqProps {
150
168
  /**
151
169
  * Custom submit handler
152
170
  */
153
- onSubmit?: (values: ContactFaqFormValues) => void | Promise<void>;
171
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
154
172
  /**
155
173
  * Success callback
156
174
  */
@@ -161,16 +179,8 @@ interface ContactFaqProps {
161
179
  onError?: (error: Error) => void;
162
180
  }
163
181
  /**
164
- * ContactFaq - FAQ contact form for questions not answered in FAQ section.
165
- *
166
- * @example
167
- * ```tsx
168
- * <ContactFaq
169
- * heading="Still need help?"
170
- * formConfig={{ endpoint: "/api/contact", format: "json" }}
171
- * />
172
- * ```
182
+ * ContactFaq - FAQ contact form with flexible field configuration
173
183
  */
174
- declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, actions, actionsSlot, items, itemsSlot, faqHeading, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formHeadingClassName, formClassName, submitClassName, faqHeadingClassName, faqContainerClassName, accordionClassName, accordionItemClassName, accordionTriggerClassName, accordionContentClassName, gridClassName, background, spacing, containerClassName, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactFaqProps): React.JSX.Element;
184
+ declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, actions, actionsSlot, items, itemsSlot, faqHeading, formFields, successMessage, errorMessage, 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;
175
185
 
176
186
  export { ContactFaq, type ContactFaqProps, type FaqItem };
@@ -1,18 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { P as PageSpeedFormConfig } from './forms-BCcwNFhk.js';
3
3
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bi_ClKrO.js';
4
+ import { F as FormFieldConfig } from './form-field-types-BYdJNOsW.js';
4
5
  import { A as ActionConfig } from './blocks-k17uluAz.js';
5
6
  import 'react/jsx-runtime';
6
7
  import 'class-variance-authority';
7
8
  import './button-variants-lRElsmTc.js';
8
9
  import 'class-variance-authority/types';
9
10
 
10
- interface ContactFaqFormValues {
11
- name: string;
12
- email: string;
13
- subject: string;
14
- message: string;
15
- }
16
11
  interface FaqItem {
17
12
  id: string;
18
13
  question: React.ReactNode;
@@ -59,6 +54,21 @@ interface ContactFaqProps {
59
54
  * Heading for the FAQ section
60
55
  */
61
56
  faqHeading?: React.ReactNode;
57
+ /**
58
+ * Array of form field configurations
59
+ * If not provided, defaults to: name, email, subject, message
60
+ */
61
+ formFields?: FormFieldConfig[];
62
+ /**
63
+ * Success message to display after form submission
64
+ * @default "Thank you! Your message has been sent successfully."
65
+ */
66
+ successMessage?: React.ReactNode;
67
+ /**
68
+ * Error message to display if submission fails
69
+ * @default "There was an error sending your message. Please try again."
70
+ */
71
+ errorMessage?: React.ReactNode;
62
72
  /**
63
73
  * Additional CSS classes for the section
64
74
  */
@@ -127,6 +137,14 @@ interface ContactFaqProps {
127
137
  * Additional CSS classes for the two-column grid wrapper
128
138
  */
129
139
  gridClassName?: string;
140
+ /**
141
+ * Additional CSS classes for the success message
142
+ */
143
+ successMessageClassName?: string;
144
+ /**
145
+ * Additional CSS classes for the error message
146
+ */
147
+ errorMessageClassName?: string;
130
148
  /**
131
149
  * Background style for the section
132
150
  */
@@ -150,7 +168,7 @@ interface ContactFaqProps {
150
168
  /**
151
169
  * Custom submit handler
152
170
  */
153
- onSubmit?: (values: ContactFaqFormValues) => void | Promise<void>;
171
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
154
172
  /**
155
173
  * Success callback
156
174
  */
@@ -161,16 +179,8 @@ interface ContactFaqProps {
161
179
  onError?: (error: Error) => void;
162
180
  }
163
181
  /**
164
- * ContactFaq - FAQ contact form for questions not answered in FAQ section.
165
- *
166
- * @example
167
- * ```tsx
168
- * <ContactFaq
169
- * heading="Still need help?"
170
- * formConfig={{ endpoint: "/api/contact", format: "json" }}
171
- * />
172
- * ```
182
+ * ContactFaq - FAQ contact form with flexible field configuration
173
183
  */
174
- declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, actions, actionsSlot, items, itemsSlot, faqHeading, className, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formHeadingClassName, formClassName, submitClassName, faqHeadingClassName, faqContainerClassName, accordionClassName, accordionItemClassName, accordionTriggerClassName, accordionContentClassName, gridClassName, background, spacing, containerClassName, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactFaqProps): React.JSX.Element;
184
+ declare function ContactFaq({ heading, description, formHeading, buttonText, buttonIcon, actions, actionsSlot, items, itemsSlot, faqHeading, formFields, successMessage, errorMessage, 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;
175
185
 
176
186
  export { ContactFaq, type ContactFaqProps, type FaqItem };