@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.
@@ -14,8 +14,8 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
14
14
  import { Icon } from '@page-speed/icon';
15
15
  import { usePlatformFromUrl } from '@opensite/hooks/usePlatformFromUrl';
16
16
  import * as TabsPrimitive from '@radix-ui/react-tabs';
17
- import { Form, useForm, Field } from '@page-speed/forms';
18
17
  import { useFileUpload, useContactForm, DynamicFormField, submitPageSpeedForm, PageSpeedFormSubmissionError, isValidEmail } from '@page-speed/forms/integration';
18
+ import { Form, useForm, Field } from '@page-speed/forms';
19
19
  import { TextInput as TextInput$1 } from '@page-speed/forms/inputs';
20
20
 
21
21
  // components/ui/container.tsx
@@ -2579,6 +2579,70 @@ function CommunityInitiatives({
2579
2579
  }
2580
2580
  );
2581
2581
  }
2582
+ var MOBILE_CLASSES = {
2583
+ "fit-left": "items-start md:items-center",
2584
+ "fit-center": "items-center",
2585
+ "fit-right": "items-end md:items-center",
2586
+ "full-left": "items-stretch md:items-center",
2587
+ "full-center": "items-stretch md:items-center",
2588
+ "full-right": "items-stretch md:items-center"
2589
+ };
2590
+ function BlockActions({
2591
+ mobileConfig,
2592
+ actionsClassName,
2593
+ verticalSpacing = "mt-4 md:mt-8",
2594
+ actions,
2595
+ actionsSlot
2596
+ }) {
2597
+ const width = mobileConfig?.width ?? "full";
2598
+ const position = mobileConfig?.position ?? "center";
2599
+ const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
2600
+ if (actionsSlot) {
2601
+ return /* @__PURE__ */ jsx("div", { children: actionsSlot });
2602
+ } else if (actions && actions?.length > 0) {
2603
+ return /* @__PURE__ */ jsx(
2604
+ "div",
2605
+ {
2606
+ className: cn(
2607
+ "flex flex-col md:flex-row flex-wrap gap-4",
2608
+ mobileLayoutClass,
2609
+ actionsClassName,
2610
+ verticalSpacing
2611
+ ),
2612
+ children: actions.map((action, index) => /* @__PURE__ */ jsx(ActionComponent, { action }, index))
2613
+ }
2614
+ );
2615
+ } else {
2616
+ return null;
2617
+ }
2618
+ }
2619
+ function ActionComponent({ action }) {
2620
+ const {
2621
+ label,
2622
+ icon,
2623
+ iconAfter,
2624
+ children,
2625
+ href,
2626
+ onClick,
2627
+ className: actionClassName,
2628
+ ...pressableProps
2629
+ } = action;
2630
+ return /* @__PURE__ */ jsx(
2631
+ Pressable,
2632
+ {
2633
+ href,
2634
+ onClick,
2635
+ asButton: action.asButton ?? true,
2636
+ className: actionClassName,
2637
+ ...pressableProps,
2638
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2639
+ icon,
2640
+ label,
2641
+ iconAfter
2642
+ ] })
2643
+ }
2644
+ );
2645
+ }
2582
2646
  function AboutCultureTabs({
2583
2647
  badgeText,
2584
2648
  heading,
@@ -2592,7 +2656,7 @@ function AboutCultureTabs({
2592
2656
  ctaImages,
2593
2657
  ctaImagesSlot,
2594
2658
  className,
2595
- containerClassName,
2659
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
2596
2660
  headerClassName,
2597
2661
  badgeClassName,
2598
2662
  headingClassName,
@@ -2604,45 +2668,33 @@ function AboutCultureTabs({
2604
2668
  actionsClassName,
2605
2669
  optixFlowConfig,
2606
2670
  background,
2607
- spacing,
2671
+ spacing = "xl",
2608
2672
  pattern,
2609
2673
  patternOpacity
2610
2674
  }) {
2611
2675
  const resolvedAspects = aspects ?? [];
2612
- const [activeTab, setActiveTab] = React4.useState(resolvedAspects[0]?.id || "");
2613
- const actionsContent = useMemo(() => {
2614
- if (actionsSlot) return actionsSlot;
2615
- if (!actions || actions.length === 0) return null;
2616
- return actions.map((action, index) => {
2617
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
2618
- return /* @__PURE__ */ jsx(
2619
- Pressable,
2620
- {
2621
- asButton: true,
2622
- className: actionClassName,
2623
- ...pressableProps,
2624
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2625
- icon,
2626
- label,
2627
- iconAfter
2628
- ] })
2629
- },
2630
- index
2631
- );
2632
- });
2633
- }, [actionsSlot, actions]);
2676
+ const [activeTab, setActiveTab] = React4.useState(
2677
+ resolvedAspects[0]?.id || ""
2678
+ );
2634
2679
  const ctaImagesContent = useMemo(() => {
2635
2680
  if (ctaImagesSlot) return ctaImagesSlot;
2636
2681
  if (!ctaImages || ctaImages.length === 0) return null;
2637
- return ctaImages.map((src, i) => /* @__PURE__ */ jsx("div", { className: "relative aspect-square overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
2638
- Img,
2682
+ return ctaImages.map((src, i) => /* @__PURE__ */ jsx(
2683
+ "div",
2639
2684
  {
2640
- src,
2641
- alt: "Team culture",
2642
- className: "h-full w-full object-cover",
2643
- optixFlowConfig
2644
- }
2645
- ) }, i));
2685
+ className: "relative aspect-square overflow-hidden rounded-md",
2686
+ children: /* @__PURE__ */ jsx(
2687
+ Img,
2688
+ {
2689
+ src,
2690
+ alt: "Team culture",
2691
+ className: "h-full w-full object-cover",
2692
+ optixFlowConfig
2693
+ }
2694
+ )
2695
+ },
2696
+ i
2697
+ ));
2646
2698
  }, [ctaImagesSlot, ctaImages, optixFlowConfig]);
2647
2699
  return /* @__PURE__ */ jsxs(
2648
2700
  Section,
@@ -2651,14 +2703,32 @@ function AboutCultureTabs({
2651
2703
  spacing,
2652
2704
  pattern,
2653
2705
  patternOpacity,
2654
- className: cn(className),
2706
+ className,
2655
2707
  containerClassName,
2656
2708
  children: [
2657
- /* @__PURE__ */ jsxs("div", { className: cn("mx-auto mb-12 max-w-3xl space-y-4 text-center", headerClassName), children: [
2658
- badgeText && (typeof badgeText === "string" ? /* @__PURE__ */ jsx("div", { className: cn("inline-block rounded-lg bg-primary/10 px-3 py-1 text-sm", getAccentColor(background), badgeClassName), children: badgeText }) : /* @__PURE__ */ jsx("div", { className: badgeClassName, children: badgeText })),
2659
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsx("h2", { className: cn("text-3xl font-bold tracking-tight md:text-4xl", headingClassName), children: heading }) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
2660
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn(getTextColor(background, "muted"), descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
2661
- ] }),
2709
+ /* @__PURE__ */ jsxs(
2710
+ "div",
2711
+ {
2712
+ className: cn(
2713
+ "mx-auto mb-12 max-w-full md:max-w-md space-y-4 text-center flex flex-col items-center justify-center",
2714
+ headerClassName
2715
+ ),
2716
+ children: [
2717
+ badgeText && (typeof badgeText === "string" ? /* @__PURE__ */ jsx(Badge, { className: cn("px-3 py-1", badgeClassName), children: badgeText }) : badgeText),
2718
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
2719
+ "h2",
2720
+ {
2721
+ className: cn(
2722
+ "text-3xl font-bold tracking-tight md:text-4xl text-pretty",
2723
+ headingClassName
2724
+ ),
2725
+ children: heading
2726
+ }
2727
+ ) : heading),
2728
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-balance", descriptionClassName), children: description }) : description)
2729
+ ]
2730
+ }
2731
+ ),
2662
2732
  aspectsSlot ? aspectsSlot : resolvedAspects.length > 0 ? /* @__PURE__ */ jsxs(
2663
2733
  Tabs,
2664
2734
  {
@@ -2671,80 +2741,103 @@ function AboutCultureTabs({
2671
2741
  TabsTrigger,
2672
2742
  {
2673
2743
  value: aspect.id,
2674
- className: cn("px-3 py-2.5", `data-[state=active]:${getAccentColor(background)}`, "data-[state=active]:text-primary-foreground"),
2744
+ className: cn("px-3 py-2.5"),
2675
2745
  children: aspect.title
2676
2746
  },
2677
2747
  aspect.id
2678
2748
  )) }) }),
2679
- resolvedAspects.map((aspect) => /* @__PURE__ */ jsxs(TabsContent, { value: aspect.id, className: "space-y-8", children: [
2680
- /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
2681
- /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2682
- /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold tracking-tight", children: aspect.title }),
2683
- /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed", getTextColor(background, "muted")), children: aspect.description })
2684
- ] }),
2685
- /* @__PURE__ */ jsx(Card, { className: "border-0 bg-gradient-to-br from-primary/5 to-primary/10 p-0", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-6 pt-6", children: [
2686
- /* @__PURE__ */ jsx(
2687
- DynamicIcon,
2688
- {
2689
- name: "lucide/quote",
2690
- size: 32,
2691
- className: cn(getAccentColor(background), "opacity-40")
2692
- }
2693
- ),
2694
- /* @__PURE__ */ jsxs("p", { className: cn("italic", getTextColor(background, "muted")), children: [
2695
- '"',
2696
- aspect.testimonial.quote,
2697
- '"'
2749
+ resolvedAspects.map((aspect) => /* @__PURE__ */ jsxs(
2750
+ TabsContent,
2751
+ {
2752
+ value: aspect.id,
2753
+ className: "space-y-8",
2754
+ children: [
2755
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
2756
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2757
+ /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold tracking-tight", children: aspect.title }),
2758
+ /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed"), children: aspect.description })
2759
+ ] }),
2760
+ /* @__PURE__ */ jsx(Card, { className: "border-0 p-0", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-6 pt-6", children: [
2761
+ /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/quote", size: 32 }),
2762
+ /* @__PURE__ */ jsxs("p", { className: "italic", children: [
2763
+ '"',
2764
+ aspect.testimonial.quote,
2765
+ '"'
2766
+ ] }),
2767
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pt-2", children: [
2768
+ /* @__PURE__ */ jsx("div", { className: "relative h-10 w-10 overflow-hidden rounded-full", children: /* @__PURE__ */ jsx(
2769
+ Img,
2770
+ {
2771
+ src: aspect.testimonial.avatar,
2772
+ alt: aspect.testimonial.author,
2773
+ className: "h-full w-full object-cover",
2774
+ optixFlowConfig
2775
+ }
2776
+ ) }),
2777
+ /* @__PURE__ */ jsxs("div", { children: [
2778
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: aspect.testimonial.author }),
2779
+ /* @__PURE__ */ jsx("p", { className: "text-xs", children: aspect.testimonial.role })
2780
+ ] })
2781
+ ] })
2782
+ ] }) })
2698
2783
  ] }),
2699
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pt-2", children: [
2700
- /* @__PURE__ */ jsx("div", { className: "relative h-10 w-10 overflow-hidden rounded-full", children: /* @__PURE__ */ jsx(
2701
- Img,
2702
- {
2703
- src: aspect.testimonial.avatar,
2704
- alt: aspect.testimonial.author,
2705
- className: "h-full w-full object-cover",
2706
- optixFlowConfig
2707
- }
2708
- ) }),
2709
- /* @__PURE__ */ jsxs("div", { children: [
2710
- /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: aspect.testimonial.author }),
2711
- /* @__PURE__ */ jsx("p", { className: cn("text-xs", getTextColor(background, "muted")), children: aspect.testimonial.role })
2712
- ] })
2713
- ] })
2714
- ] }) })
2715
- ] }),
2716
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: aspect.images.map((image, idx) => /* @__PURE__ */ jsx(
2717
- "div",
2718
- {
2719
- className: "relative aspect-[4/3] overflow-hidden rounded-lg",
2720
- children: /* @__PURE__ */ jsx(
2721
- Img,
2784
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: aspect.images.map((image, idx) => /* @__PURE__ */ jsx(
2785
+ "div",
2722
2786
  {
2723
- src: image,
2724
- alt: `${aspect.title} culture`,
2725
- className: "h-full w-full transform object-cover transition-transform duration-500 hover:scale-105",
2726
- optixFlowConfig
2727
- }
2728
- )
2729
- },
2730
- idx
2731
- )) })
2732
- ] }, aspect.id))
2787
+ className: "relative aspect-4/3 overflow-hidden rounded-lg",
2788
+ children: /* @__PURE__ */ jsx(
2789
+ Img,
2790
+ {
2791
+ src: image,
2792
+ alt: `${aspect.title} culture`,
2793
+ className: "h-full w-full transform object-cover transition-transform duration-500 hover:scale-105",
2794
+ optixFlowConfig
2795
+ }
2796
+ )
2797
+ },
2798
+ idx
2799
+ )) })
2800
+ ]
2801
+ },
2802
+ aspect.id
2803
+ ))
2733
2804
  ]
2734
2805
  }
2735
2806
  ) : null,
2736
- /* @__PURE__ */ jsxs("div", { className: cn("relative mt-16 rounded-xl border bg-background p-8 md:p-12", ctaClassName), children: [
2737
- /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-8 md:grid-cols-2", children: [
2738
- /* @__PURE__ */ jsxs("div", { children: [
2739
- ctaHeading && (typeof ctaHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: cn("mb-4 text-2xl font-bold", ctaHeadingClassName), children: ctaHeading }) : /* @__PURE__ */ jsx("div", { className: cn("mb-4", ctaHeadingClassName), children: ctaHeading })),
2740
- ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mb-6", getTextColor(background, "muted"), ctaDescriptionClassName), children: ctaDescription }) : /* @__PURE__ */ jsx("div", { className: cn("mb-6", ctaDescriptionClassName), children: ctaDescription })),
2741
- (actionsSlot || actions && actions.length > 0) && /* @__PURE__ */ jsx("div", { className: cn("flex gap-4", actionsClassName), children: actionsContent })
2742
- ] }),
2743
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: ctaImagesContent })
2744
- ] }),
2745
- /* @__PURE__ */ jsx("div", { className: "absolute -left-5 -top-5 h-10 w-10 rounded-full bg-primary/10" }),
2746
- /* @__PURE__ */ jsx("div", { className: "absolute -bottom-5 -right-5 h-10 w-10 rounded-full bg-primary/10" })
2747
- ] })
2807
+ /* @__PURE__ */ jsxs(
2808
+ "div",
2809
+ {
2810
+ className: cn(
2811
+ "relative mt-16 rounded-xl border p-8 md:p-12",
2812
+ ctaClassName
2813
+ ),
2814
+ children: [
2815
+ /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-8 md:grid-cols-2", children: [
2816
+ /* @__PURE__ */ jsxs("div", { children: [
2817
+ ctaHeading && (typeof ctaHeading === "string" ? /* @__PURE__ */ jsx(
2818
+ "h3",
2819
+ {
2820
+ className: cn("mb-4 text-2xl font-bold", ctaHeadingClassName),
2821
+ children: ctaHeading
2822
+ }
2823
+ ) : ctaHeading),
2824
+ ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mb-6", ctaDescriptionClassName), children: ctaDescription }) : ctaDescription),
2825
+ /* @__PURE__ */ jsx(
2826
+ BlockActions,
2827
+ {
2828
+ actions,
2829
+ actionsSlot,
2830
+ actionsClassName
2831
+ }
2832
+ )
2833
+ ] }),
2834
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: ctaImagesContent })
2835
+ ] }),
2836
+ /* @__PURE__ */ jsx("div", { className: "absolute -left-5 -top-5 h-10 w-10 rounded-full bg-primary/10" }),
2837
+ /* @__PURE__ */ jsx("div", { className: "absolute -bottom-5 -right-5 h-10 w-10 rounded-full bg-primary/10" })
2838
+ ]
2839
+ }
2840
+ )
2748
2841
  ]
2749
2842
  }
2750
2843
  );
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var React = require('react');
4
+ var React3 = require('react');
5
5
  var integration = require('@page-speed/forms/integration');
6
6
  var clsx = require('clsx');
7
7
  var tailwindMerge = require('tailwind-merge');
@@ -9,8 +9,6 @@ var jsxRuntime = require('react/jsx-runtime');
9
9
  var AccordionPrimitive = require('@radix-ui/react-accordion');
10
10
  var icon = require('@page-speed/icon');
11
11
 
12
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
-
14
12
  function _interopNamespace(e) {
15
13
  if (e && e.__esModule) return e;
16
14
  var n = Object.create(null);
@@ -29,7 +27,7 @@ function _interopNamespace(e) {
29
27
  return Object.freeze(n);
30
28
  }
31
29
 
32
- var React__default = /*#__PURE__*/_interopDefault(React);
30
+ var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
33
31
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
34
32
 
35
33
  // components/blocks/contact/contact-faq.tsx
@@ -132,7 +130,7 @@ var maxWidthStyles = {
132
130
  "4xl": "max-w-[1536px]",
133
131
  full: "max-w-full"
134
132
  };
135
- var Container = React__default.default.forwardRef(
133
+ var Container = React3__namespace.default.forwardRef(
136
134
  ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
137
135
  const Component = as;
138
136
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -437,7 +435,7 @@ var spacingStyles = {
437
435
  };
438
436
  var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
439
437
  var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
440
- var Section = React__default.default.forwardRef(
438
+ var Section = React3__namespace.default.forwardRef(
441
439
  ({
442
440
  id,
443
441
  title,
@@ -498,6 +496,14 @@ var Section = React__default.default.forwardRef(
498
496
  }
499
497
  );
500
498
  Section.displayName = "Section";
499
+ var DEFAULT_STYLE_RULES = {
500
+ formContainer: "",
501
+ fieldsContainer: "",
502
+ fieldClassName: "",
503
+ formClassName: "space-y-6",
504
+ successMessageClassName: "text-green-600 dark:text-green-400 mt-4 p-3 rounded-md bg-green-50 dark:bg-green-950/20",
505
+ errorMessageClassName: "text-red-600 dark:text-red-400 mt-4 p-3 rounded-md bg-red-50 dark:bg-red-950/20"
506
+ };
501
507
  var DEFAULT_FORM_FIELDS = [
502
508
  {
503
509
  name: "name",
@@ -542,8 +548,7 @@ function ContactFaq({
542
548
  items,
543
549
  itemsSlot,
544
550
  faqHeading,
545
- formFields = DEFAULT_FORM_FIELDS,
546
- successMessage = "Thank you! Your message has been sent successfully.",
551
+ formEngineSetup,
547
552
  className,
548
553
  containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
549
554
  headerClassName,
@@ -552,7 +557,6 @@ function ContactFaq({
552
557
  cardClassName,
553
558
  cardContentClassName,
554
559
  formHeadingClassName,
555
- formClassName,
556
560
  faqHeadingClassName,
557
561
  faqContainerClassName,
558
562
  accordionClassName,
@@ -560,27 +564,30 @@ function ContactFaq({
560
564
  accordionTriggerClassName,
561
565
  accordionContentClassName,
562
566
  gridClassName,
563
- successMessageClassName,
564
- errorMessageClassName,
565
567
  background,
566
568
  spacing = "py-8 md:py-32",
567
569
  pattern,
568
- patternOpacity,
569
- formConfig,
570
- onSubmit,
571
- onSuccess,
572
- onError
570
+ patternOpacity
573
571
  }) {
574
- const {
575
- uploadTokens,
576
- uploadProgress,
577
- isUploading,
578
- uploadFiles,
579
- removeFile,
580
- resetUpload
581
- } = integration.useFileUpload({ onError });
572
+ const formStyleRules = React3__namespace.useMemo(() => {
573
+ return {
574
+ formContainer: formEngineSetup?.formLayoutSettings?.styleRules?.formContainer ?? DEFAULT_STYLE_RULES.formContainer,
575
+ fieldsContainer: formEngineSetup?.formLayoutSettings?.styleRules?.fieldsContainer ?? DEFAULT_STYLE_RULES.fieldsContainer,
576
+ fieldClassName: formEngineSetup?.formLayoutSettings?.styleRules?.fieldClassName ?? DEFAULT_STYLE_RULES.fieldClassName,
577
+ formClassName: formEngineSetup?.formLayoutSettings?.styleRules?.formClassName ?? DEFAULT_STYLE_RULES.formClassName,
578
+ successMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.successMessageClassName ?? DEFAULT_STYLE_RULES.successMessageClassName,
579
+ errorMessageClassName: formEngineSetup?.formLayoutSettings?.styleRules?.errorMessageClassName ?? DEFAULT_STYLE_RULES.errorMessageClassName
580
+ };
581
+ }, [formEngineSetup?.formLayoutSettings?.styleRules]);
582
+ const formFields = React3__namespace.useMemo(() => {
583
+ if (formEngineSetup && formEngineSetup?.fields && formEngineSetup?.fields?.length > 0) {
584
+ return formEngineSetup.fields;
585
+ } else {
586
+ return DEFAULT_FORM_FIELDS;
587
+ }
588
+ }, [formEngineSetup?.fields]);
582
589
  const hasFaqItems = itemsSlot || items && items.length > 0;
583
- const faqContent = React.useMemo(() => {
590
+ const faqContent = React3.useMemo(() => {
584
591
  if (itemsSlot) return itemsSlot;
585
592
  if (!items || items.length === 0) return null;
586
593
  return /* @__PURE__ */ jsxRuntime.jsx(Accordion, { type: "single", collapsible: true, className: accordionClassName, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
@@ -673,40 +680,25 @@ function ContactFaq({
673
680
  children: formHeading
674
681
  }
675
682
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: formHeadingClassName, children: formHeading })),
676
- /* @__PURE__ */ jsxRuntime.jsx(
683
+ formEngineSetup ? /* @__PURE__ */ jsxRuntime.jsx(
677
684
  integration.FormEngine,
678
685
  {
679
- api: formConfig,
680
- fields: formFields,
686
+ ...formEngineSetup,
681
687
  formLayoutSettings: {
688
+ ...formEngineSetup.formLayoutSettings,
682
689
  formLayout: "standard",
683
690
  submitButtonSetup: {
691
+ ...formEngineSetup.formLayoutSettings?.submitButtonSetup,
684
692
  submitLabel: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
685
693
  buttonIcon,
686
694
  buttonText
687
695
  ] })
688
696
  },
689
- styleRules: {
690
- formClassName: cn("space-y-6", formClassName),
691
- successMessageClassName,
692
- errorMessageClassName
693
- }
694
- },
695
- successMessage,
696
- onSubmit,
697
- onSuccess: (data) => {
698
- resetUpload();
699
- onSuccess?.(data);
697
+ styleRules: formStyleRules
700
698
  },
701
- onError,
702
- resetOnSuccess: formConfig?.resetOnSuccess !== false,
703
- uploadTokens,
704
- uploadProgress,
705
- onFileUpload: uploadFiles,
706
- onFileRemove: removeFile,
707
- isUploading
699
+ fields: formFields
708
700
  }
709
- )
701
+ ) : null
710
702
  ] }) }),
711
703
  hasFaqItems && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", faqContainerClassName), children: [
712
704
  faqHeading && (typeof faqHeading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -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-r_NhxVet.cjs';
4
4
  import 'react/jsx-runtime';
5
5
  import './blocks-DP3Vofl4.cjs';
@@ -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 };