@opensite/ui 2.0.8 → 2.1.0

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 (43) hide show
  1. package/dist/hero-agency-animated-images.cjs +4 -4
  2. package/dist/hero-agency-animated-images.js +4 -4
  3. package/dist/hero-business-carousel-dots.cjs +46 -36
  4. package/dist/hero-business-carousel-dots.js +46 -36
  5. package/dist/hero-coming-soon-countdown.cjs +93 -54
  6. package/dist/hero-coming-soon-countdown.d.cts +31 -6
  7. package/dist/hero-coming-soon-countdown.d.ts +31 -6
  8. package/dist/hero-coming-soon-countdown.js +93 -54
  9. package/dist/hero-creative-studio-stacked.cjs +9 -6
  10. package/dist/hero-creative-studio-stacked.d.cts +5 -1
  11. package/dist/hero-creative-studio-stacked.d.ts +5 -1
  12. package/dist/hero-creative-studio-stacked.js +9 -6
  13. package/dist/hero-customer-support-layered.cjs +1 -1
  14. package/dist/hero-customer-support-layered.js +1 -1
  15. package/dist/hero-developer-tools-code.cjs +2 -2
  16. package/dist/hero-developer-tools-code.js +2 -2
  17. package/dist/hero-digital-agency-fullscreen.cjs +14 -12
  18. package/dist/hero-digital-agency-fullscreen.d.cts +1 -1
  19. package/dist/hero-digital-agency-fullscreen.d.ts +1 -1
  20. package/dist/hero-digital-agency-fullscreen.js +14 -12
  21. package/dist/hero-ecommerce-product-showcase.cjs +76 -57
  22. package/dist/hero-ecommerce-product-showcase.js +76 -57
  23. package/dist/hero-enterprise-security.cjs +81 -60
  24. package/dist/hero-enterprise-security.js +81 -60
  25. package/dist/hero-event-registration.cjs +43 -10
  26. package/dist/hero-event-registration.js +43 -10
  27. package/dist/hero-hiring-animated-text.cjs +661 -639
  28. package/dist/hero-hiring-animated-text.d.cts +1 -9
  29. package/dist/hero-hiring-animated-text.d.ts +1 -9
  30. package/dist/hero-hiring-animated-text.js +657 -635
  31. package/dist/hero-saas-dashboard-preview.cjs +88 -46
  32. package/dist/hero-saas-dashboard-preview.d.cts +34 -19
  33. package/dist/hero-saas-dashboard-preview.d.ts +34 -19
  34. package/dist/hero-saas-dashboard-preview.js +89 -47
  35. package/dist/hero-split-image-newsletter.cjs +91 -49
  36. package/dist/hero-split-image-newsletter.d.cts +33 -18
  37. package/dist/hero-split-image-newsletter.d.ts +33 -18
  38. package/dist/hero-split-image-newsletter.js +92 -50
  39. package/dist/hero-startup-launch-cta.cjs +2 -2
  40. package/dist/hero-startup-launch-cta.js +2 -2
  41. package/dist/registry.cjs +556 -345
  42. package/dist/registry.js +556 -345
  43. package/package.json +1 -1
@@ -8,6 +8,8 @@ var classVarianceAuthority = require('class-variance-authority');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
  var icon = require('@page-speed/icon');
10
10
  var img = require('@page-speed/img');
11
+ var forms = require('@page-speed/forms');
12
+ var integration = require('@page-speed/forms/integration');
11
13
 
12
14
  function _interopNamespace(e) {
13
15
  if (e && e.__esModule) return e;
@@ -455,22 +457,6 @@ var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
455
457
  function DynamicIcon({ apiKey, ...props }) {
456
458
  return /* @__PURE__ */ jsxRuntime.jsx(icon.Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
457
459
  }
458
- function Input({ className, type, ...props }) {
459
- return /* @__PURE__ */ jsxRuntime.jsx(
460
- "input",
461
- {
462
- type,
463
- "data-slot": "input",
464
- className: cn(
465
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
466
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
467
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
468
- className
469
- ),
470
- ...props
471
- }
472
- );
473
- }
474
460
  var maxWidthStyles = {
475
461
  sm: "max-w-screen-sm",
476
462
  md: "max-w-screen-md",
@@ -846,14 +832,31 @@ var Section = React__namespace.default.forwardRef(
846
832
  }
847
833
  );
848
834
  Section.displayName = "Section";
835
+ var DEFAULT_FORM_FIELDS = [
836
+ {
837
+ name: "email",
838
+ type: "email",
839
+ label: "Email Address",
840
+ placeholder: "Enter your email",
841
+ required: true,
842
+ columnSpan: 12
843
+ }
844
+ ];
849
845
  function HeroSaasDashboardPreview({
850
846
  badgeText,
851
847
  badgeIcon,
852
848
  badgeSlot,
853
849
  heading,
854
850
  description,
855
- emailForm,
856
- emailFormSlot,
851
+ formFields = DEFAULT_FORM_FIELDS,
852
+ formConfig,
853
+ onSubmit,
854
+ onSuccess,
855
+ onError,
856
+ successMessage,
857
+ buttonAction,
858
+ helperText,
859
+ formSlot,
857
860
  browserPreview,
858
861
  browserPreviewSlot,
859
862
  background,
@@ -868,6 +871,18 @@ function HeroSaasDashboardPreview({
868
871
  previewClassName,
869
872
  optixFlowConfig
870
873
  }) {
874
+ const { uploadTokens, uploadProgress, isUploading, uploadFiles, removeFile, resetUpload } = integration.useFileUpload({ onError });
875
+ const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
876
+ formFields,
877
+ formConfig,
878
+ onSubmit,
879
+ onSuccess: (data) => {
880
+ resetUpload();
881
+ onSuccess?.(data);
882
+ },
883
+ onError,
884
+ uploadTokens
885
+ });
871
886
  const renderBadge = React.useMemo(() => {
872
887
  if (badgeSlot) return badgeSlot;
873
888
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -883,33 +898,60 @@ function HeroSaasDashboardPreview({
883
898
  }
884
899
  );
885
900
  }, [badgeSlot, badgeIcon, badgeText]);
886
- const renderEmailForm = React.useMemo(() => {
887
- if (emailFormSlot) return emailFormSlot;
888
- if (!emailForm) return null;
889
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
890
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-10 flex flex-col items-center gap-4 sm:flex-row sm:justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-md items-center gap-2", children: [
891
- /* @__PURE__ */ jsxRuntime.jsx(
892
- Input,
893
- {
894
- type: "email",
895
- placeholder: emailForm.placeholder,
896
- className: "h-12 flex-1"
897
- }
898
- ),
899
- emailForm.action && /* @__PURE__ */ jsxRuntime.jsx(
900
- Pressable,
901
- {
902
- href: emailForm.action.href,
903
- asButton: true,
904
- variant: emailForm.action.variant,
905
- className: emailForm.action.className,
906
- children: emailForm.action.label
907
- }
908
- )
909
- ] }) }),
910
- emailForm.helperText && (typeof emailForm.helperText === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-4 text-sm", children: emailForm.helperText }) : emailForm.helperText)
911
- ] });
912
- }, [emailFormSlot, emailForm]);
901
+ const renderForm = React.useMemo(() => {
902
+ if (formSlot) return formSlot;
903
+ const defaultButtonAction = {
904
+ label: "Start Free Trial",
905
+ variant: "default",
906
+ className: "h-12"
907
+ };
908
+ const action = buttonAction || defaultButtonAction;
909
+ return /* @__PURE__ */ jsxRuntime.jsxs(
910
+ forms.Form,
911
+ {
912
+ form,
913
+ notificationConfig: {
914
+ submissionError,
915
+ successMessage
916
+ },
917
+ formConfig: {
918
+ endpoint: formConfig?.endpoint,
919
+ method: formMethod,
920
+ submissionConfig: formConfig?.submissionConfig
921
+ },
922
+ onNewSubmission: () => {
923
+ resetUpload();
924
+ resetSubmissionState();
925
+ },
926
+ children: [
927
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-10 flex flex-col items-center gap-4 sm:flex-row sm:justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full max-w-md items-center gap-2", children: [
928
+ formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
929
+ integration.DynamicFormField,
930
+ {
931
+ field,
932
+ uploadProgress,
933
+ onFileUpload: uploadFiles,
934
+ onFileRemove: removeFile,
935
+ isUploading
936
+ }
937
+ ) }, field.name)),
938
+ /* @__PURE__ */ jsxRuntime.jsx(
939
+ Pressable,
940
+ {
941
+ onClick: form.handleSubmit,
942
+ asButton: true,
943
+ variant: action.variant,
944
+ className: cn("h-12", action.className),
945
+ disabled: form.isSubmitting,
946
+ children: action.label
947
+ }
948
+ )
949
+ ] }) }),
950
+ helperText && (typeof helperText === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm text-center mt-4"), children: helperText }) : helperText)
951
+ ]
952
+ }
953
+ );
954
+ }, [formSlot, formFields, form, formConfig, formMethod, buttonAction, uploadProgress, uploadFiles, removeFile, isUploading, submissionError, successMessage, helperText, resetUpload, resetSubmissionState]);
913
955
  const renderBrowserPreview = React.useMemo(() => {
914
956
  if (browserPreviewSlot) return browserPreviewSlot;
915
957
  if (!browserPreview) return null;
@@ -993,7 +1035,7 @@ function HeroSaasDashboardPreview({
993
1035
  children: description
994
1036
  }
995
1037
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description })),
996
- renderEmailForm
1038
+ renderForm
997
1039
  ] }),
998
1040
  renderBrowserPreview
999
1041
  ] })
@@ -1,25 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bz_A5vLU.cjs';
3
+ import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
3
4
  import { A as ActionConfig, I as ImageItem, O as OptixFlowConfig } from './blocks-Cohq4eio.cjs';
4
5
  import 'react/jsx-runtime';
5
6
  import 'class-variance-authority';
6
7
  import './button-variants-lRElsmTc.cjs';
7
8
  import 'class-variance-authority/types';
8
9
 
9
- interface EmailFormConfig {
10
- /**
11
- * Input placeholder text
12
- */
13
- placeholder?: string;
14
- /**
15
- * Submit button action
16
- */
17
- action?: ActionConfig;
18
- /**
19
- * Helper text below form
20
- */
21
- helperText?: React.ReactNode;
22
- }
23
10
  interface BrowserPreviewConfig {
24
11
  /**
25
12
  * URL displayed in browser bar
@@ -52,13 +39,41 @@ interface HeroSaasDashboardPreviewProps {
52
39
  */
53
40
  description?: React.ReactNode;
54
41
  /**
55
- * Email form configuration
42
+ * Form field configuration
43
+ */
44
+ formFields?: FormFieldConfig[];
45
+ /**
46
+ * Form configuration for submission
47
+ */
48
+ formConfig?: PageSpeedFormConfig;
49
+ /**
50
+ * Custom submit handler
56
51
  */
57
- emailForm?: EmailFormConfig;
52
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
53
+ /**
54
+ * Success callback
55
+ */
56
+ onSuccess?: (data: unknown) => void;
57
+ /**
58
+ * Error callback
59
+ */
60
+ onError?: (error: Error) => void;
61
+ /**
62
+ * Success message to display
63
+ */
64
+ successMessage?: React.ReactNode;
65
+ /**
66
+ * Submit button configuration
67
+ */
68
+ buttonAction?: ActionConfig;
69
+ /**
70
+ * Helper text below form
71
+ */
72
+ helperText?: React.ReactNode;
58
73
  /**
59
- * Custom slot for email form (overrides emailForm prop)
74
+ * Custom slot for form (overrides form props)
60
75
  */
61
- emailFormSlot?: React.ReactNode;
76
+ formSlot?: React.ReactNode;
62
77
  /**
63
78
  * Browser preview configuration
64
79
  */
@@ -111,6 +126,6 @@ interface HeroSaasDashboardPreviewProps {
111
126
  */
112
127
  optixFlowConfig?: OptixFlowConfig;
113
128
  }
114
- declare function HeroSaasDashboardPreview({ badgeText, badgeIcon, badgeSlot, heading, description, emailForm, emailFormSlot, browserPreview, browserPreviewSlot, background, containerClassName, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, previewClassName, optixFlowConfig, }: HeroSaasDashboardPreviewProps): React.JSX.Element;
129
+ declare function HeroSaasDashboardPreview({ badgeText, badgeIcon, badgeSlot, heading, description, formFields, formConfig, onSubmit, onSuccess, onError, successMessage, buttonAction, helperText, formSlot, browserPreview, browserPreviewSlot, background, containerClassName, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, previewClassName, optixFlowConfig, }: HeroSaasDashboardPreviewProps): React.JSX.Element;
115
130
 
116
131
  export { HeroSaasDashboardPreview, type HeroSaasDashboardPreviewProps };
@@ -1,25 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bi_ClKrO.js';
3
+ import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
3
4
  import { A as ActionConfig, I as ImageItem, O as OptixFlowConfig } from './blocks-k17uluAz.js';
4
5
  import 'react/jsx-runtime';
5
6
  import 'class-variance-authority';
6
7
  import './button-variants-lRElsmTc.js';
7
8
  import 'class-variance-authority/types';
8
9
 
9
- interface EmailFormConfig {
10
- /**
11
- * Input placeholder text
12
- */
13
- placeholder?: string;
14
- /**
15
- * Submit button action
16
- */
17
- action?: ActionConfig;
18
- /**
19
- * Helper text below form
20
- */
21
- helperText?: React.ReactNode;
22
- }
23
10
  interface BrowserPreviewConfig {
24
11
  /**
25
12
  * URL displayed in browser bar
@@ -52,13 +39,41 @@ interface HeroSaasDashboardPreviewProps {
52
39
  */
53
40
  description?: React.ReactNode;
54
41
  /**
55
- * Email form configuration
42
+ * Form field configuration
43
+ */
44
+ formFields?: FormFieldConfig[];
45
+ /**
46
+ * Form configuration for submission
47
+ */
48
+ formConfig?: PageSpeedFormConfig;
49
+ /**
50
+ * Custom submit handler
56
51
  */
57
- emailForm?: EmailFormConfig;
52
+ onSubmit?: (values: Record<string, any>) => void | Promise<void>;
53
+ /**
54
+ * Success callback
55
+ */
56
+ onSuccess?: (data: unknown) => void;
57
+ /**
58
+ * Error callback
59
+ */
60
+ onError?: (error: Error) => void;
61
+ /**
62
+ * Success message to display
63
+ */
64
+ successMessage?: React.ReactNode;
65
+ /**
66
+ * Submit button configuration
67
+ */
68
+ buttonAction?: ActionConfig;
69
+ /**
70
+ * Helper text below form
71
+ */
72
+ helperText?: React.ReactNode;
58
73
  /**
59
- * Custom slot for email form (overrides emailForm prop)
74
+ * Custom slot for form (overrides form props)
60
75
  */
61
- emailFormSlot?: React.ReactNode;
76
+ formSlot?: React.ReactNode;
62
77
  /**
63
78
  * Browser preview configuration
64
79
  */
@@ -111,6 +126,6 @@ interface HeroSaasDashboardPreviewProps {
111
126
  */
112
127
  optixFlowConfig?: OptixFlowConfig;
113
128
  }
114
- declare function HeroSaasDashboardPreview({ badgeText, badgeIcon, badgeSlot, heading, description, emailForm, emailFormSlot, browserPreview, browserPreviewSlot, background, containerClassName, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, previewClassName, optixFlowConfig, }: HeroSaasDashboardPreviewProps): React.JSX.Element;
129
+ declare function HeroSaasDashboardPreview({ badgeText, badgeIcon, badgeSlot, heading, description, formFields, formConfig, onSubmit, onSuccess, onError, successMessage, buttonAction, helperText, formSlot, browserPreview, browserPreviewSlot, background, containerClassName, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, previewClassName, optixFlowConfig, }: HeroSaasDashboardPreviewProps): React.JSX.Element;
115
130
 
116
131
  export { HeroSaasDashboardPreview, type HeroSaasDashboardPreviewProps };
@@ -4,9 +4,11 @@ import React__default, { useMemo } from 'react';
4
4
  import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { cva } from 'class-variance-authority';
7
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+ import { jsx, jsxs } from 'react/jsx-runtime';
8
8
  import { Icon } from '@page-speed/icon';
9
9
  import { Img } from '@page-speed/img';
10
+ import { Form } from '@page-speed/forms';
11
+ import { useFileUpload, useContactForm, DynamicFormField } from '@page-speed/forms/integration';
10
12
 
11
13
  // components/blocks/hero/hero-saas-dashboard-preview.tsx
12
14
  function cn(...inputs) {
@@ -434,22 +436,6 @@ var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
434
436
  function DynamicIcon({ apiKey, ...props }) {
435
437
  return /* @__PURE__ */ jsx(Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
436
438
  }
437
- function Input({ className, type, ...props }) {
438
- return /* @__PURE__ */ jsx(
439
- "input",
440
- {
441
- type,
442
- "data-slot": "input",
443
- className: cn(
444
- "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
445
- "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
446
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
447
- className
448
- ),
449
- ...props
450
- }
451
- );
452
- }
453
439
  var maxWidthStyles = {
454
440
  sm: "max-w-screen-sm",
455
441
  md: "max-w-screen-md",
@@ -825,14 +811,31 @@ var Section = React__default.forwardRef(
825
811
  }
826
812
  );
827
813
  Section.displayName = "Section";
814
+ var DEFAULT_FORM_FIELDS = [
815
+ {
816
+ name: "email",
817
+ type: "email",
818
+ label: "Email Address",
819
+ placeholder: "Enter your email",
820
+ required: true,
821
+ columnSpan: 12
822
+ }
823
+ ];
828
824
  function HeroSaasDashboardPreview({
829
825
  badgeText,
830
826
  badgeIcon,
831
827
  badgeSlot,
832
828
  heading,
833
829
  description,
834
- emailForm,
835
- emailFormSlot,
830
+ formFields = DEFAULT_FORM_FIELDS,
831
+ formConfig,
832
+ onSubmit,
833
+ onSuccess,
834
+ onError,
835
+ successMessage,
836
+ buttonAction,
837
+ helperText,
838
+ formSlot,
836
839
  browserPreview,
837
840
  browserPreviewSlot,
838
841
  background,
@@ -847,6 +850,18 @@ function HeroSaasDashboardPreview({
847
850
  previewClassName,
848
851
  optixFlowConfig
849
852
  }) {
853
+ const { uploadTokens, uploadProgress, isUploading, uploadFiles, removeFile, resetUpload } = useFileUpload({ onError });
854
+ const { form, submissionError, formMethod, resetSubmissionState } = useContactForm({
855
+ formFields,
856
+ formConfig,
857
+ onSubmit,
858
+ onSuccess: (data) => {
859
+ resetUpload();
860
+ onSuccess?.(data);
861
+ },
862
+ onError,
863
+ uploadTokens
864
+ });
850
865
  const renderBadge = useMemo(() => {
851
866
  if (badgeSlot) return badgeSlot;
852
867
  return /* @__PURE__ */ jsxs(
@@ -862,33 +877,60 @@ function HeroSaasDashboardPreview({
862
877
  }
863
878
  );
864
879
  }, [badgeSlot, badgeIcon, badgeText]);
865
- const renderEmailForm = useMemo(() => {
866
- if (emailFormSlot) return emailFormSlot;
867
- if (!emailForm) return null;
868
- return /* @__PURE__ */ jsxs(Fragment, { children: [
869
- /* @__PURE__ */ jsx("div", { className: "mt-10 flex flex-col items-center gap-4 sm:flex-row sm:justify-center", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md items-center gap-2", children: [
870
- /* @__PURE__ */ jsx(
871
- Input,
872
- {
873
- type: "email",
874
- placeholder: emailForm.placeholder,
875
- className: "h-12 flex-1"
876
- }
877
- ),
878
- emailForm.action && /* @__PURE__ */ jsx(
879
- Pressable,
880
- {
881
- href: emailForm.action.href,
882
- asButton: true,
883
- variant: emailForm.action.variant,
884
- className: emailForm.action.className,
885
- children: emailForm.action.label
886
- }
887
- )
888
- ] }) }),
889
- emailForm.helperText && (typeof emailForm.helperText === "string" ? /* @__PURE__ */ jsx("p", { className: "mt-4 text-sm", children: emailForm.helperText }) : emailForm.helperText)
890
- ] });
891
- }, [emailFormSlot, emailForm]);
880
+ const renderForm = useMemo(() => {
881
+ if (formSlot) return formSlot;
882
+ const defaultButtonAction = {
883
+ label: "Start Free Trial",
884
+ variant: "default",
885
+ className: "h-12"
886
+ };
887
+ const action = buttonAction || defaultButtonAction;
888
+ return /* @__PURE__ */ jsxs(
889
+ Form,
890
+ {
891
+ form,
892
+ notificationConfig: {
893
+ submissionError,
894
+ successMessage
895
+ },
896
+ formConfig: {
897
+ endpoint: formConfig?.endpoint,
898
+ method: formMethod,
899
+ submissionConfig: formConfig?.submissionConfig
900
+ },
901
+ onNewSubmission: () => {
902
+ resetUpload();
903
+ resetSubmissionState();
904
+ },
905
+ children: [
906
+ /* @__PURE__ */ jsx("div", { className: "mt-10 flex flex-col items-center gap-4 sm:flex-row sm:justify-center", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-md items-center gap-2", children: [
907
+ formFields.map((field) => /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
908
+ DynamicFormField,
909
+ {
910
+ field,
911
+ uploadProgress,
912
+ onFileUpload: uploadFiles,
913
+ onFileRemove: removeFile,
914
+ isUploading
915
+ }
916
+ ) }, field.name)),
917
+ /* @__PURE__ */ jsx(
918
+ Pressable,
919
+ {
920
+ onClick: form.handleSubmit,
921
+ asButton: true,
922
+ variant: action.variant,
923
+ className: cn("h-12", action.className),
924
+ disabled: form.isSubmitting,
925
+ children: action.label
926
+ }
927
+ )
928
+ ] }) }),
929
+ helperText && (typeof helperText === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-sm text-center mt-4"), children: helperText }) : helperText)
930
+ ]
931
+ }
932
+ );
933
+ }, [formSlot, formFields, form, formConfig, formMethod, buttonAction, uploadProgress, uploadFiles, removeFile, isUploading, submissionError, successMessage, helperText, resetUpload, resetSubmissionState]);
892
934
  const renderBrowserPreview = useMemo(() => {
893
935
  if (browserPreviewSlot) return browserPreviewSlot;
894
936
  if (!browserPreview) return null;
@@ -972,7 +1014,7 @@ function HeroSaasDashboardPreview({
972
1014
  children: description
973
1015
  }
974
1016
  ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description })),
975
- renderEmailForm
1017
+ renderForm
976
1018
  ] }),
977
1019
  renderBrowserPreview
978
1020
  ] })