@opensite/ui 1.8.2 → 1.8.4

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 (171) hide show
  1. package/dist/about-story-gallery.cjs +3 -30
  2. package/dist/about-story-gallery.d.cts +1 -1
  3. package/dist/about-story-gallery.d.ts +1 -1
  4. package/dist/about-story-gallery.js +3 -30
  5. package/dist/components.d.cts +1 -1
  6. package/dist/components.d.ts +1 -1
  7. package/dist/contact-callback.cjs +526 -273
  8. package/dist/contact-callback.d.cts +39 -59
  9. package/dist/contact-callback.d.ts +39 -59
  10. package/dist/contact-callback.js +528 -274
  11. package/dist/contact-card.cjs +459 -183
  12. package/dist/contact-card.d.cts +26 -49
  13. package/dist/contact-card.d.ts +26 -49
  14. package/dist/contact-card.js +461 -183
  15. package/dist/contact-careers.cjs +614 -510
  16. package/dist/contact-careers.d.cts +32 -55
  17. package/dist/contact-careers.d.ts +32 -55
  18. package/dist/contact-careers.js +616 -510
  19. package/dist/contact-catering.cjs +507 -501
  20. package/dist/contact-catering.d.cts +27 -61
  21. package/dist/contact-catering.d.ts +27 -61
  22. package/dist/contact-catering.js +509 -500
  23. package/dist/contact-consultation.cjs +484 -253
  24. package/dist/contact-consultation.d.cts +29 -56
  25. package/dist/contact-consultation.d.ts +29 -56
  26. package/dist/contact-consultation.js +486 -253
  27. package/dist/contact-dark.cjs +296 -296
  28. package/dist/contact-dark.d.cts +1 -1
  29. package/dist/contact-dark.d.ts +1 -1
  30. package/dist/contact-dark.js +297 -296
  31. package/dist/contact-demo.d.cts +1 -1
  32. package/dist/contact-demo.d.ts +1 -1
  33. package/dist/contact-emergency.d.cts +1 -1
  34. package/dist/contact-emergency.d.ts +1 -1
  35. package/dist/contact-event.d.cts +1 -1
  36. package/dist/contact-event.d.ts +1 -1
  37. package/dist/contact-faq.cjs +247 -250
  38. package/dist/contact-faq.d.cts +1 -1
  39. package/dist/contact-faq.d.ts +1 -1
  40. package/dist/contact-faq.js +248 -250
  41. package/dist/contact-feedback.d.cts +1 -1
  42. package/dist/contact-feedback.d.ts +1 -1
  43. package/dist/contact-fitness.d.cts +1 -1
  44. package/dist/contact-fitness.d.ts +1 -1
  45. package/dist/contact-guest.d.cts +1 -1
  46. package/dist/contact-guest.d.ts +1 -1
  47. package/dist/contact-image.d.cts +1 -1
  48. package/dist/contact-image.d.ts +1 -1
  49. package/dist/contact-insurance.d.cts +1 -1
  50. package/dist/contact-insurance.d.ts +1 -1
  51. package/dist/contact-interview.d.cts +1 -1
  52. package/dist/contact-interview.d.ts +1 -1
  53. package/dist/contact-locations.d.cts +1 -1
  54. package/dist/contact-locations.d.ts +1 -1
  55. package/dist/contact-maintenance.d.cts +1 -1
  56. package/dist/contact-maintenance.d.ts +1 -1
  57. package/dist/contact-map.d.cts +1 -1
  58. package/dist/contact-map.d.ts +1 -1
  59. package/dist/contact-minimal.d.cts +1 -1
  60. package/dist/contact-minimal.d.ts +1 -1
  61. package/dist/contact-moving.d.cts +1 -1
  62. package/dist/contact-moving.d.ts +1 -1
  63. package/dist/contact-multistep.d.cts +1 -1
  64. package/dist/contact-multistep.d.ts +1 -1
  65. package/dist/contact-partnership.d.cts +1 -1
  66. package/dist/contact-partnership.d.ts +1 -1
  67. package/dist/contact-photography.cjs +247 -250
  68. package/dist/contact-photography.d.cts +1 -1
  69. package/dist/contact-photography.d.ts +1 -1
  70. package/dist/contact-photography.js +248 -250
  71. package/dist/contact-press.d.cts +1 -1
  72. package/dist/contact-press.d.ts +1 -1
  73. package/dist/contact-quote.d.cts +1 -1
  74. package/dist/contact-quote.d.ts +1 -1
  75. package/dist/contact-referral.d.cts +1 -1
  76. package/dist/contact-referral.d.ts +1 -1
  77. package/dist/contact-report.d.cts +1 -1
  78. package/dist/contact-report.d.ts +1 -1
  79. package/dist/contact-reservation.d.cts +1 -1
  80. package/dist/contact-reservation.d.ts +1 -1
  81. package/dist/contact-retreat.d.cts +1 -1
  82. package/dist/contact-retreat.d.ts +1 -1
  83. package/dist/contact-rsvp.d.cts +1 -1
  84. package/dist/contact-rsvp.d.ts +1 -1
  85. package/dist/contact-sales.d.cts +1 -1
  86. package/dist/contact-sales.d.ts +1 -1
  87. package/dist/contact-schedule.d.cts +1 -1
  88. package/dist/contact-schedule.d.ts +1 -1
  89. package/dist/contact-sponsorship.d.cts +1 -1
  90. package/dist/contact-sponsorship.d.ts +1 -1
  91. package/dist/contact-support.d.cts +1 -1
  92. package/dist/contact-support.d.ts +1 -1
  93. package/dist/contact-tenant.d.cts +1 -1
  94. package/dist/contact-tenant.d.ts +1 -1
  95. package/dist/contact-vendor.d.cts +1 -1
  96. package/dist/contact-vendor.d.ts +1 -1
  97. package/dist/contact-volunteer.d.cts +1 -1
  98. package/dist/contact-volunteer.d.ts +1 -1
  99. package/dist/contact-warranty.d.cts +1 -1
  100. package/dist/contact-warranty.d.ts +1 -1
  101. package/dist/contact-wedding.d.cts +1 -1
  102. package/dist/contact-wedding.d.ts +1 -1
  103. package/dist/cta-app-download-newsletter.d.cts +1 -1
  104. package/dist/cta-app-download-newsletter.d.ts +1 -1
  105. package/dist/cta-newsletter-features.d.cts +1 -1
  106. package/dist/cta-newsletter-features.d.ts +1 -1
  107. package/dist/footer-accordion-social.d.cts +1 -1
  108. package/dist/footer-accordion-social.d.ts +1 -1
  109. package/dist/footer-newsletter-contact.d.cts +1 -1
  110. package/dist/footer-newsletter-contact.d.ts +1 -1
  111. package/dist/footer-newsletter-minimal.d.cts +1 -1
  112. package/dist/footer-newsletter-minimal.d.ts +1 -1
  113. package/dist/footer-split-image-accordion.d.cts +1 -1
  114. package/dist/footer-split-image-accordion.d.ts +1 -1
  115. package/dist/{forms-nGgHUTBw.d.cts → forms-CStlFhnh.d.cts} +41 -0
  116. package/dist/{forms-nGgHUTBw.d.ts → forms-CStlFhnh.d.ts} +41 -0
  117. package/dist/hero-conversation-intelligence.cjs +1 -2
  118. package/dist/hero-conversation-intelligence.d.cts +1 -5
  119. package/dist/hero-conversation-intelligence.d.ts +1 -5
  120. package/dist/hero-conversation-intelligence.js +1 -2
  121. package/dist/hero-conversion-video-play.cjs +2 -2
  122. package/dist/hero-conversion-video-play.js +2 -2
  123. package/dist/hero-design-system-3d.cjs +162 -82
  124. package/dist/hero-design-system-3d.js +162 -82
  125. package/dist/hero-ecommerce-product-showcase.cjs +103 -81
  126. package/dist/hero-ecommerce-product-showcase.d.cts +5 -1
  127. package/dist/hero-ecommerce-product-showcase.d.ts +5 -1
  128. package/dist/hero-ecommerce-product-showcase.js +103 -81
  129. package/dist/hero-floating-images.cjs +1 -1
  130. package/dist/hero-floating-images.js +1 -1
  131. package/dist/hero-hiring-animated-text.cjs +4 -4
  132. package/dist/hero-hiring-animated-text.js +4 -4
  133. package/dist/hero-minimal-centered-dark.cjs +111 -82
  134. package/dist/hero-minimal-centered-dark.d.cts +1 -1
  135. package/dist/hero-minimal-centered-dark.d.ts +1 -1
  136. package/dist/hero-minimal-centered-dark.js +111 -82
  137. package/dist/hero-mobile-app-download.cjs +1 -1
  138. package/dist/hero-mobile-app-download.js +1 -1
  139. package/dist/hero-overlay-cta-grid.cjs +1 -1
  140. package/dist/hero-overlay-cta-grid.js +1 -1
  141. package/dist/hero-spiral-pattern-cards.cjs +1 -1
  142. package/dist/hero-spiral-pattern-cards.js +1 -1
  143. package/dist/hero-startup-launch-cta.cjs +1 -1
  144. package/dist/hero-startup-launch-cta.js +1 -1
  145. package/dist/hero-stats-social-proof.cjs +106 -90
  146. package/dist/hero-stats-social-proof.js +106 -90
  147. package/dist/hero-testimonial-image-grid.cjs +1 -1
  148. package/dist/hero-testimonial-image-grid.js +1 -1
  149. package/dist/hero-therapy-testimonial-grid.cjs +1 -1
  150. package/dist/hero-therapy-testimonial-grid.js +1 -1
  151. package/dist/hero-ui-library-showcase.cjs +63 -15
  152. package/dist/hero-ui-library-showcase.d.cts +5 -1
  153. package/dist/hero-ui-library-showcase.d.ts +5 -1
  154. package/dist/hero-ui-library-showcase.js +63 -15
  155. package/dist/index.cjs +44 -6
  156. package/dist/index.d.cts +3 -2
  157. package/dist/index.d.ts +3 -2
  158. package/dist/index.js +44 -6
  159. package/dist/link-page-newsletter-social.d.cts +1 -1
  160. package/dist/link-page-newsletter-social.d.ts +1 -1
  161. package/dist/offer-modal-membership-image.d.cts +1 -1
  162. package/dist/offer-modal-membership-image.d.ts +1 -1
  163. package/dist/offer-modal-newsletter-discount.d.cts +1 -1
  164. package/dist/offer-modal-newsletter-discount.d.ts +1 -1
  165. package/dist/offer-modal-sheet-newsletter.d.cts +1 -1
  166. package/dist/offer-modal-sheet-newsletter.d.ts +1 -1
  167. package/dist/registry.cjs +14465 -14767
  168. package/dist/registry.js +12664 -12966
  169. package/dist/resource-list-hero-filter.d.cts +1 -1
  170. package/dist/resource-list-hero-filter.d.ts +1 -1
  171. package/package.json +3 -3
@@ -868,10 +868,11 @@ function HeroUiLibraryShowcase({
868
868
  image,
869
869
  imageSlot,
870
870
  background,
871
- spacing,
871
+ spacing = "pt-28 pb-8 md:pt-32 md:pb-32",
872
872
  pattern,
873
873
  patternOpacity,
874
874
  className,
875
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
875
876
  headerClassName,
876
877
  headingClassName,
877
878
  descriptionClassName,
@@ -882,7 +883,14 @@ function HeroUiLibraryShowcase({
882
883
  if (actionsSlot) return actionsSlot;
883
884
  if (!actions || actions.length === 0) return null;
884
885
  return actions.map((action, index) => {
885
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
886
+ const {
887
+ label,
888
+ icon,
889
+ iconAfter,
890
+ children,
891
+ className: actionClassName,
892
+ ...pressableProps
893
+ } = action;
886
894
  return /* @__PURE__ */ jsxRuntime.jsx(
887
895
  Pressable,
888
896
  {
@@ -920,7 +928,11 @@ function HeroUiLibraryShowcase({
920
928
  {
921
929
  src: image.src,
922
930
  alt: image.alt,
923
- className: cn("size-full object-cover", imageClassName, image.className),
931
+ className: cn(
932
+ "size-full object-cover",
933
+ imageClassName,
934
+ image.className
935
+ ),
924
936
  optixFlowConfig
925
937
  }
926
938
  ) }) });
@@ -928,19 +940,55 @@ function HeroUiLibraryShowcase({
928
940
  return /* @__PURE__ */ jsxRuntime.jsxs(
929
941
  Section,
930
942
  {
931
- className: cn(
932
- "container mx-auto mt-32 flex flex-col items-center gap-20 bg-background md:gap-40 md:text-center",
933
- className
934
- ),
943
+ background,
944
+ spacing,
945
+ pattern,
946
+ patternOpacity,
947
+ className,
948
+ containerClassName,
935
949
  children: [
936
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-10 md:items-center", headerClassName), children: [
937
- renderLogo,
938
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-[880px] flex-col items-center gap-6", children: [
939
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl", headingClassName), children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: heading }) }) : /* @__PURE__ */ jsxRuntime.jsx("h1", { className: cn("text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl", headingClassName), children: heading })),
940
- description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-xl", getTextColor(background, "muted"), descriptionClassName), children: description }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
941
- ] }),
942
- renderActions
943
- ] }),
950
+ /* @__PURE__ */ jsxRuntime.jsxs(
951
+ "div",
952
+ {
953
+ className: cn("flex flex-col gap-10 md:items-center", headerClassName),
954
+ children: [
955
+ renderLogo,
956
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-w-[880px] flex-col items-center gap-6", children: [
957
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
958
+ "h1",
959
+ {
960
+ className: cn(
961
+ "text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl",
962
+ headingClassName
963
+ ),
964
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: heading })
965
+ }
966
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
967
+ "h1",
968
+ {
969
+ className: cn(
970
+ "text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl",
971
+ headingClassName
972
+ ),
973
+ children: heading
974
+ }
975
+ )),
976
+ description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
977
+ "p",
978
+ {
979
+ className: cn(
980
+ "text-xl",
981
+ getTextColor(background, "muted"),
982
+ descriptionClassName
983
+ ),
984
+ children: description
985
+ }
986
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
987
+ ] }),
988
+ renderActions
989
+ ]
990
+ }
991
+ ),
944
992
  renderImage
945
993
  ]
946
994
  }
@@ -58,6 +58,10 @@ interface HeroUiLibraryShowcaseProps {
58
58
  * Additional CSS classes for the section
59
59
  */
60
60
  className?: string;
61
+ /**
62
+ * Additional CSS classes for the container
63
+ */
64
+ containerClassName?: string;
61
65
  /**
62
66
  * Additional CSS classes for the header area
63
67
  */
@@ -79,6 +83,6 @@ interface HeroUiLibraryShowcaseProps {
79
83
  */
80
84
  optixFlowConfig?: OptixFlowConfig;
81
85
  }
82
- declare function HeroUiLibraryShowcase({ logo, logoSlot, heading, description, actions, actionsSlot, image, imageSlot, background, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, imageClassName, optixFlowConfig, }: HeroUiLibraryShowcaseProps): React.JSX.Element;
86
+ declare function HeroUiLibraryShowcase({ logo, logoSlot, heading, description, actions, actionsSlot, image, imageSlot, background, spacing, pattern, patternOpacity, className, containerClassName, headerClassName, headingClassName, descriptionClassName, imageClassName, optixFlowConfig, }: HeroUiLibraryShowcaseProps): React.JSX.Element;
83
87
 
84
88
  export { HeroUiLibraryShowcase, type HeroUiLibraryShowcaseProps };
@@ -58,6 +58,10 @@ interface HeroUiLibraryShowcaseProps {
58
58
  * Additional CSS classes for the section
59
59
  */
60
60
  className?: string;
61
+ /**
62
+ * Additional CSS classes for the container
63
+ */
64
+ containerClassName?: string;
61
65
  /**
62
66
  * Additional CSS classes for the header area
63
67
  */
@@ -79,6 +83,6 @@ interface HeroUiLibraryShowcaseProps {
79
83
  */
80
84
  optixFlowConfig?: OptixFlowConfig;
81
85
  }
82
- declare function HeroUiLibraryShowcase({ logo, logoSlot, heading, description, actions, actionsSlot, image, imageSlot, background, spacing, pattern, patternOpacity, className, headerClassName, headingClassName, descriptionClassName, imageClassName, optixFlowConfig, }: HeroUiLibraryShowcaseProps): React.JSX.Element;
86
+ declare function HeroUiLibraryShowcase({ logo, logoSlot, heading, description, actions, actionsSlot, image, imageSlot, background, spacing, pattern, patternOpacity, className, containerClassName, headerClassName, headingClassName, descriptionClassName, imageClassName, optixFlowConfig, }: HeroUiLibraryShowcaseProps): React.JSX.Element;
83
87
 
84
88
  export { HeroUiLibraryShowcase, type HeroUiLibraryShowcaseProps };
@@ -846,10 +846,11 @@ function HeroUiLibraryShowcase({
846
846
  image,
847
847
  imageSlot,
848
848
  background,
849
- spacing,
849
+ spacing = "pt-28 pb-8 md:pt-32 md:pb-32",
850
850
  pattern,
851
851
  patternOpacity,
852
852
  className,
853
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
853
854
  headerClassName,
854
855
  headingClassName,
855
856
  descriptionClassName,
@@ -860,7 +861,14 @@ function HeroUiLibraryShowcase({
860
861
  if (actionsSlot) return actionsSlot;
861
862
  if (!actions || actions.length === 0) return null;
862
863
  return actions.map((action, index) => {
863
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
864
+ const {
865
+ label,
866
+ icon,
867
+ iconAfter,
868
+ children,
869
+ className: actionClassName,
870
+ ...pressableProps
871
+ } = action;
864
872
  return /* @__PURE__ */ jsx(
865
873
  Pressable,
866
874
  {
@@ -898,7 +906,11 @@ function HeroUiLibraryShowcase({
898
906
  {
899
907
  src: image.src,
900
908
  alt: image.alt,
901
- className: cn("size-full object-cover", imageClassName, image.className),
909
+ className: cn(
910
+ "size-full object-cover",
911
+ imageClassName,
912
+ image.className
913
+ ),
902
914
  optixFlowConfig
903
915
  }
904
916
  ) }) });
@@ -906,19 +918,55 @@ function HeroUiLibraryShowcase({
906
918
  return /* @__PURE__ */ jsxs(
907
919
  Section,
908
920
  {
909
- className: cn(
910
- "container mx-auto mt-32 flex flex-col items-center gap-20 bg-background md:gap-40 md:text-center",
911
- className
912
- ),
921
+ background,
922
+ spacing,
923
+ pattern,
924
+ patternOpacity,
925
+ className,
926
+ containerClassName,
913
927
  children: [
914
- /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-10 md:items-center", headerClassName), children: [
915
- renderLogo,
916
- /* @__PURE__ */ jsxs("div", { className: "flex max-w-[880px] flex-col items-center gap-6", children: [
917
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsx("h1", { className: cn("text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl", headingClassName), children: /* @__PURE__ */ jsx("p", { children: heading }) }) : /* @__PURE__ */ jsx("h1", { className: cn("text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl", headingClassName), children: heading })),
918
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-xl", getTextColor(background, "muted"), descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
919
- ] }),
920
- renderActions
921
- ] }),
928
+ /* @__PURE__ */ jsxs(
929
+ "div",
930
+ {
931
+ className: cn("flex flex-col gap-10 md:items-center", headerClassName),
932
+ children: [
933
+ renderLogo,
934
+ /* @__PURE__ */ jsxs("div", { className: "flex max-w-[880px] flex-col items-center gap-6", children: [
935
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
936
+ "h1",
937
+ {
938
+ className: cn(
939
+ "text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl",
940
+ headingClassName
941
+ ),
942
+ children: /* @__PURE__ */ jsx("p", { children: heading })
943
+ }
944
+ ) : /* @__PURE__ */ jsx(
945
+ "h1",
946
+ {
947
+ className: cn(
948
+ "text-4xl tracking-tighter capitalize md:text-5xl lg:text-6xl",
949
+ headingClassName
950
+ ),
951
+ children: heading
952
+ }
953
+ )),
954
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx(
955
+ "p",
956
+ {
957
+ className: cn(
958
+ "text-xl",
959
+ getTextColor(background, "muted"),
960
+ descriptionClassName
961
+ ),
962
+ children: description
963
+ }
964
+ ) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
965
+ ] }),
966
+ renderActions
967
+ ]
968
+ }
969
+ ),
922
970
  renderImage
923
971
  ]
924
972
  }
package/dist/index.cjs CHANGED
@@ -5401,8 +5401,36 @@ function useContactForm(options) {
5401
5401
  resetOnSuccess = true,
5402
5402
  uploadTokens = []
5403
5403
  } = options;
5404
- const [isSubmitted, setIsSubmitted] = React4.useState(false);
5405
5404
  const [submissionError, setSubmissionError] = React4.useState(null);
5405
+ const submissionConfig = formConfig?.submissionConfig;
5406
+ const redirectUrl = submissionConfig?.redirectUrl;
5407
+ const redirectNavigation = useNavigation({ href: redirectUrl });
5408
+ const resetSubmissionState = React4.useCallback(() => {
5409
+ setSubmissionError(null);
5410
+ }, []);
5411
+ const performRedirect = React4.useCallback(() => {
5412
+ if (!redirectUrl || typeof window === "undefined") {
5413
+ return;
5414
+ }
5415
+ const navigate = () => {
5416
+ if (redirectNavigation.shouldUseRouter && redirectNavigation.normalizedHref) {
5417
+ const handler = window.__opensiteNavigationHandler;
5418
+ if (typeof handler === "function") {
5419
+ try {
5420
+ const handled = handler(redirectNavigation.normalizedHref, void 0);
5421
+ if (handled !== false) {
5422
+ return;
5423
+ }
5424
+ } catch (error) {
5425
+ console.error("Internal redirect handler failed:", error);
5426
+ }
5427
+ }
5428
+ }
5429
+ const destination = redirectNavigation.normalizedHref || redirectUrl;
5430
+ window.location.assign(destination);
5431
+ };
5432
+ window.setTimeout(navigate, 150);
5433
+ }, [redirectNavigation, redirectUrl]);
5406
5434
  const form = forms.useForm({
5407
5435
  initialValues: React4.useMemo(
5408
5436
  () => generateInitialValues(formFields),
@@ -5413,7 +5441,7 @@ function useContactForm(options) {
5413
5441
  [formFields]
5414
5442
  ),
5415
5443
  onSubmit: async (values, helpers) => {
5416
- setSubmissionError(null);
5444
+ resetSubmissionState();
5417
5445
  const shouldAutoSubmit = Boolean(formConfig?.endpoint);
5418
5446
  if (!shouldAutoSubmit && !onSubmit) {
5419
5447
  return;
@@ -5433,12 +5461,21 @@ function useContactForm(options) {
5433
5461
  await onSubmit(submissionValues);
5434
5462
  }
5435
5463
  if (shouldAutoSubmit || onSubmit) {
5436
- setIsSubmitted(true);
5464
+ try {
5465
+ await submissionConfig?.handleFormSubmission?.({
5466
+ formData: submissionValues,
5467
+ responseData: result
5468
+ });
5469
+ } catch (callbackError) {
5470
+ console.error("handleFormSubmission callback failed:", callbackError);
5471
+ }
5437
5472
  if (resetOnSuccess) {
5438
5473
  helpers.resetForm();
5439
5474
  }
5440
5475
  onSuccess?.(result);
5441
- setTimeout(() => setIsSubmitted(false), 1e4);
5476
+ if (submissionConfig?.behavior === "redirect" && submissionConfig.redirectUrl) {
5477
+ performRedirect();
5478
+ }
5442
5479
  }
5443
5480
  } catch (error) {
5444
5481
  if (error instanceof PageSpeedFormSubmissionError && error.formErrors) {
@@ -5453,9 +5490,10 @@ function useContactForm(options) {
5453
5490
  const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
5454
5491
  return {
5455
5492
  form,
5456
- isSubmitted,
5493
+ isSubmitted: form.status === "success",
5457
5494
  submissionError,
5458
- formMethod
5495
+ formMethod,
5496
+ resetSubmissionState
5459
5497
  };
5460
5498
  }
5461
5499
 
package/dist/index.d.cts CHANGED
@@ -32,8 +32,8 @@ export { LinkType, UseNavigationArgs, UseNavigationReturn, useNavigation } from
32
32
  export { BorderColorVariant, NestedCardBgOptions, NestedCardVariant, TextColorVariant, cn, getAccentColor, getBorderColor, getNestedCardBg, getNestedCardTextColor, getTextColor } from './utils.cjs';
33
33
  import { F as FormFieldConfig } from './form-field-types-flMXhIjG.cjs';
34
34
  export { c as FormFieldType, S as SelectOption, g as generateInitialValues, a as generateValidationSchema, b as getColumnSpanClass } from './form-field-types-flMXhIjG.cjs';
35
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.cjs';
36
- export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-nGgHUTBw.cjs';
35
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.cjs';
36
+ export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-CStlFhnh.cjs';
37
37
  import { useForm } from '@page-speed/forms';
38
38
  export { SocialPlatformName } from '@opensite/hooks/usePlatformFromUrl';
39
39
  export { A as ActionConfig, c as AuthorInfo, h as BlockActionProps, f as BlockBaseProps, j as BlockBlogProps, g as BlockContentProps, i as BlockLogoProps, B as BlogPostItem, b as BreadcrumbItem, D as DetailItem, F as FeatureItem, I as ImageItem, L as LogoItem, N as NavLinkItem, O as OptixFlowConfig, d as OutcomeItem, e as SectionItem, a as SocialLinkItem, S as StatItem, T as TestimonialItem } from './blocks-rgCERYOC.cjs';
@@ -109,6 +109,7 @@ interface UseContactFormReturn {
109
109
  isSubmitted: boolean;
110
110
  submissionError: string | null;
111
111
  formMethod: "get" | "post";
112
+ resetSubmissionState: () => void;
112
113
  }
113
114
  /**
114
115
  * Hook for managing contact form state and submission
package/dist/index.d.ts CHANGED
@@ -32,8 +32,8 @@ export { LinkType, UseNavigationArgs, UseNavigationReturn, useNavigation } from
32
32
  export { BorderColorVariant, NestedCardBgOptions, NestedCardVariant, TextColorVariant, cn, getAccentColor, getBorderColor, getNestedCardBg, getNestedCardTextColor, getTextColor } from './utils.js';
33
33
  import { F as FormFieldConfig } from './form-field-types-flMXhIjG.js';
34
34
  export { c as FormFieldType, S as SelectOption, g as generateInitialValues, a as generateValidationSchema, b as getColumnSpanClass } from './form-field-types-flMXhIjG.js';
35
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.js';
36
- export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-nGgHUTBw.js';
35
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.js';
36
+ export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-CStlFhnh.js';
37
37
  import { useForm } from '@page-speed/forms';
38
38
  export { SocialPlatformName } from '@opensite/hooks/usePlatformFromUrl';
39
39
  export { A as ActionConfig, c as AuthorInfo, h as BlockActionProps, f as BlockBaseProps, j as BlockBlogProps, g as BlockContentProps, i as BlockLogoProps, B as BlogPostItem, b as BreadcrumbItem, D as DetailItem, F as FeatureItem, I as ImageItem, L as LogoItem, N as NavLinkItem, O as OptixFlowConfig, d as OutcomeItem, e as SectionItem, a as SocialLinkItem, S as StatItem, T as TestimonialItem } from './blocks-ClXAGlHQ.js';
@@ -109,6 +109,7 @@ interface UseContactFormReturn {
109
109
  isSubmitted: boolean;
110
110
  submissionError: string | null;
111
111
  formMethod: "get" | "post";
112
+ resetSubmissionState: () => void;
112
113
  }
113
114
  /**
114
115
  * Hook for managing contact form state and submission
package/dist/index.js CHANGED
@@ -5378,8 +5378,36 @@ function useContactForm(options) {
5378
5378
  resetOnSuccess = true,
5379
5379
  uploadTokens = []
5380
5380
  } = options;
5381
- const [isSubmitted, setIsSubmitted] = useState(false);
5382
5381
  const [submissionError, setSubmissionError] = useState(null);
5382
+ const submissionConfig = formConfig?.submissionConfig;
5383
+ const redirectUrl = submissionConfig?.redirectUrl;
5384
+ const redirectNavigation = useNavigation({ href: redirectUrl });
5385
+ const resetSubmissionState = useCallback(() => {
5386
+ setSubmissionError(null);
5387
+ }, []);
5388
+ const performRedirect = useCallback(() => {
5389
+ if (!redirectUrl || typeof window === "undefined") {
5390
+ return;
5391
+ }
5392
+ const navigate = () => {
5393
+ if (redirectNavigation.shouldUseRouter && redirectNavigation.normalizedHref) {
5394
+ const handler = window.__opensiteNavigationHandler;
5395
+ if (typeof handler === "function") {
5396
+ try {
5397
+ const handled = handler(redirectNavigation.normalizedHref, void 0);
5398
+ if (handled !== false) {
5399
+ return;
5400
+ }
5401
+ } catch (error) {
5402
+ console.error("Internal redirect handler failed:", error);
5403
+ }
5404
+ }
5405
+ }
5406
+ const destination = redirectNavigation.normalizedHref || redirectUrl;
5407
+ window.location.assign(destination);
5408
+ };
5409
+ window.setTimeout(navigate, 150);
5410
+ }, [redirectNavigation, redirectUrl]);
5383
5411
  const form = useForm({
5384
5412
  initialValues: useMemo(
5385
5413
  () => generateInitialValues(formFields),
@@ -5390,7 +5418,7 @@ function useContactForm(options) {
5390
5418
  [formFields]
5391
5419
  ),
5392
5420
  onSubmit: async (values, helpers) => {
5393
- setSubmissionError(null);
5421
+ resetSubmissionState();
5394
5422
  const shouldAutoSubmit = Boolean(formConfig?.endpoint);
5395
5423
  if (!shouldAutoSubmit && !onSubmit) {
5396
5424
  return;
@@ -5410,12 +5438,21 @@ function useContactForm(options) {
5410
5438
  await onSubmit(submissionValues);
5411
5439
  }
5412
5440
  if (shouldAutoSubmit || onSubmit) {
5413
- setIsSubmitted(true);
5441
+ try {
5442
+ await submissionConfig?.handleFormSubmission?.({
5443
+ formData: submissionValues,
5444
+ responseData: result
5445
+ });
5446
+ } catch (callbackError) {
5447
+ console.error("handleFormSubmission callback failed:", callbackError);
5448
+ }
5414
5449
  if (resetOnSuccess) {
5415
5450
  helpers.resetForm();
5416
5451
  }
5417
5452
  onSuccess?.(result);
5418
- setTimeout(() => setIsSubmitted(false), 1e4);
5453
+ if (submissionConfig?.behavior === "redirect" && submissionConfig.redirectUrl) {
5454
+ performRedirect();
5455
+ }
5419
5456
  }
5420
5457
  } catch (error) {
5421
5458
  if (error instanceof PageSpeedFormSubmissionError && error.formErrors) {
@@ -5430,9 +5467,10 @@ function useContactForm(options) {
5430
5467
  const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
5431
5468
  return {
5432
5469
  form,
5433
- isSubmitted,
5470
+ isSubmitted: form.status === "success",
5434
5471
  submissionError,
5435
- formMethod
5472
+ formMethod,
5473
+ resetSubmissionState
5436
5474
  };
5437
5475
  }
5438
5476
 
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.cjs';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.cjs';
3
3
  import { f as SectionBackground, g as SectionSpacing, s as PatternName } from './community-initiatives-k1_FqqBQ.cjs';
4
4
  import { I as ImageItem, A as ActionConfig, a as SocialLinkItem, O as OptixFlowConfig } from './blocks-rgCERYOC.cjs';
5
5
  import '@page-speed/forms/integration';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.js';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.js';
3
3
  import { f as SectionBackground, g as SectionSpacing, s as PatternName } from './community-initiatives-AwBlQu1a.js';
4
4
  import { I as ImageItem, A as ActionConfig, a as SocialLinkItem, O as OptixFlowConfig } from './blocks-ClXAGlHQ.js';
5
5
  import '@page-speed/forms/integration';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.cjs';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.cjs';
3
3
  import { f as SectionBackground } from './community-initiatives-k1_FqqBQ.cjs';
4
4
  import { I as ImageItem, O as OptixFlowConfig } from './blocks-rgCERYOC.cjs';
5
5
  import '@page-speed/forms/integration';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.js';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.js';
3
3
  import { f as SectionBackground } from './community-initiatives-AwBlQu1a.js';
4
4
  import { I as ImageItem, O as OptixFlowConfig } from './blocks-ClXAGlHQ.js';
5
5
  import '@page-speed/forms/integration';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.cjs';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.cjs';
3
3
  import { f as SectionBackground } from './community-initiatives-k1_FqqBQ.cjs';
4
4
  import '@page-speed/forms/integration';
5
5
  import 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.js';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.js';
3
3
  import { f as SectionBackground } from './community-initiatives-AwBlQu1a.js';
4
4
  import '@page-speed/forms/integration';
5
5
  import 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.cjs';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.cjs';
3
3
  import { f as SectionBackground } from './community-initiatives-k1_FqqBQ.cjs';
4
4
  import { L as LogoItem, I as ImageItem, O as OptixFlowConfig } from './blocks-rgCERYOC.cjs';
5
5
  import '@page-speed/forms/integration';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { P as PageSpeedFormConfig } from './forms-nGgHUTBw.js';
2
+ import { P as PageSpeedFormConfig } from './forms-CStlFhnh.js';
3
3
  import { f as SectionBackground } from './community-initiatives-AwBlQu1a.js';
4
4
  import { L as LogoItem, I as ImageItem, O as OptixFlowConfig } from './blocks-ClXAGlHQ.js';
5
5
  import '@page-speed/forms/integration';