@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.
- package/dist/about-story-gallery.cjs +3 -30
- package/dist/about-story-gallery.d.cts +1 -1
- package/dist/about-story-gallery.d.ts +1 -1
- package/dist/about-story-gallery.js +3 -30
- package/dist/components.d.cts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/contact-callback.cjs +526 -273
- package/dist/contact-callback.d.cts +39 -59
- package/dist/contact-callback.d.ts +39 -59
- package/dist/contact-callback.js +528 -274
- package/dist/contact-card.cjs +459 -183
- package/dist/contact-card.d.cts +26 -49
- package/dist/contact-card.d.ts +26 -49
- package/dist/contact-card.js +461 -183
- package/dist/contact-careers.cjs +614 -510
- package/dist/contact-careers.d.cts +32 -55
- package/dist/contact-careers.d.ts +32 -55
- package/dist/contact-careers.js +616 -510
- package/dist/contact-catering.cjs +507 -501
- package/dist/contact-catering.d.cts +27 -61
- package/dist/contact-catering.d.ts +27 -61
- package/dist/contact-catering.js +509 -500
- package/dist/contact-consultation.cjs +484 -253
- package/dist/contact-consultation.d.cts +29 -56
- package/dist/contact-consultation.d.ts +29 -56
- package/dist/contact-consultation.js +486 -253
- package/dist/contact-dark.cjs +296 -296
- package/dist/contact-dark.d.cts +1 -1
- package/dist/contact-dark.d.ts +1 -1
- package/dist/contact-dark.js +297 -296
- package/dist/contact-demo.d.cts +1 -1
- package/dist/contact-demo.d.ts +1 -1
- package/dist/contact-emergency.d.cts +1 -1
- package/dist/contact-emergency.d.ts +1 -1
- package/dist/contact-event.d.cts +1 -1
- package/dist/contact-event.d.ts +1 -1
- package/dist/contact-faq.cjs +247 -250
- package/dist/contact-faq.d.cts +1 -1
- package/dist/contact-faq.d.ts +1 -1
- package/dist/contact-faq.js +248 -250
- package/dist/contact-feedback.d.cts +1 -1
- package/dist/contact-feedback.d.ts +1 -1
- package/dist/contact-fitness.d.cts +1 -1
- package/dist/contact-fitness.d.ts +1 -1
- package/dist/contact-guest.d.cts +1 -1
- package/dist/contact-guest.d.ts +1 -1
- package/dist/contact-image.d.cts +1 -1
- package/dist/contact-image.d.ts +1 -1
- package/dist/contact-insurance.d.cts +1 -1
- package/dist/contact-insurance.d.ts +1 -1
- package/dist/contact-interview.d.cts +1 -1
- package/dist/contact-interview.d.ts +1 -1
- package/dist/contact-locations.d.cts +1 -1
- package/dist/contact-locations.d.ts +1 -1
- package/dist/contact-maintenance.d.cts +1 -1
- package/dist/contact-maintenance.d.ts +1 -1
- package/dist/contact-map.d.cts +1 -1
- package/dist/contact-map.d.ts +1 -1
- package/dist/contact-minimal.d.cts +1 -1
- package/dist/contact-minimal.d.ts +1 -1
- package/dist/contact-moving.d.cts +1 -1
- package/dist/contact-moving.d.ts +1 -1
- package/dist/contact-multistep.d.cts +1 -1
- package/dist/contact-multistep.d.ts +1 -1
- package/dist/contact-partnership.d.cts +1 -1
- package/dist/contact-partnership.d.ts +1 -1
- package/dist/contact-photography.cjs +247 -250
- package/dist/contact-photography.d.cts +1 -1
- package/dist/contact-photography.d.ts +1 -1
- package/dist/contact-photography.js +248 -250
- package/dist/contact-press.d.cts +1 -1
- package/dist/contact-press.d.ts +1 -1
- package/dist/contact-quote.d.cts +1 -1
- package/dist/contact-quote.d.ts +1 -1
- package/dist/contact-referral.d.cts +1 -1
- package/dist/contact-referral.d.ts +1 -1
- package/dist/contact-report.d.cts +1 -1
- package/dist/contact-report.d.ts +1 -1
- package/dist/contact-reservation.d.cts +1 -1
- package/dist/contact-reservation.d.ts +1 -1
- package/dist/contact-retreat.d.cts +1 -1
- package/dist/contact-retreat.d.ts +1 -1
- package/dist/contact-rsvp.d.cts +1 -1
- package/dist/contact-rsvp.d.ts +1 -1
- package/dist/contact-sales.d.cts +1 -1
- package/dist/contact-sales.d.ts +1 -1
- package/dist/contact-schedule.d.cts +1 -1
- package/dist/contact-schedule.d.ts +1 -1
- package/dist/contact-sponsorship.d.cts +1 -1
- package/dist/contact-sponsorship.d.ts +1 -1
- package/dist/contact-support.d.cts +1 -1
- package/dist/contact-support.d.ts +1 -1
- package/dist/contact-tenant.d.cts +1 -1
- package/dist/contact-tenant.d.ts +1 -1
- package/dist/contact-vendor.d.cts +1 -1
- package/dist/contact-vendor.d.ts +1 -1
- package/dist/contact-volunteer.d.cts +1 -1
- package/dist/contact-volunteer.d.ts +1 -1
- package/dist/contact-warranty.d.cts +1 -1
- package/dist/contact-warranty.d.ts +1 -1
- package/dist/contact-wedding.d.cts +1 -1
- package/dist/contact-wedding.d.ts +1 -1
- package/dist/cta-app-download-newsletter.d.cts +1 -1
- package/dist/cta-app-download-newsletter.d.ts +1 -1
- package/dist/cta-newsletter-features.d.cts +1 -1
- package/dist/cta-newsletter-features.d.ts +1 -1
- package/dist/footer-accordion-social.d.cts +1 -1
- package/dist/footer-accordion-social.d.ts +1 -1
- package/dist/footer-newsletter-contact.d.cts +1 -1
- package/dist/footer-newsletter-contact.d.ts +1 -1
- package/dist/footer-newsletter-minimal.d.cts +1 -1
- package/dist/footer-newsletter-minimal.d.ts +1 -1
- package/dist/footer-split-image-accordion.d.cts +1 -1
- package/dist/footer-split-image-accordion.d.ts +1 -1
- package/dist/{forms-nGgHUTBw.d.cts → forms-CStlFhnh.d.cts} +41 -0
- package/dist/{forms-nGgHUTBw.d.ts → forms-CStlFhnh.d.ts} +41 -0
- package/dist/hero-conversation-intelligence.cjs +1 -2
- package/dist/hero-conversation-intelligence.d.cts +1 -5
- package/dist/hero-conversation-intelligence.d.ts +1 -5
- package/dist/hero-conversation-intelligence.js +1 -2
- package/dist/hero-conversion-video-play.cjs +2 -2
- package/dist/hero-conversion-video-play.js +2 -2
- package/dist/hero-design-system-3d.cjs +162 -82
- package/dist/hero-design-system-3d.js +162 -82
- package/dist/hero-ecommerce-product-showcase.cjs +103 -81
- package/dist/hero-ecommerce-product-showcase.d.cts +5 -1
- package/dist/hero-ecommerce-product-showcase.d.ts +5 -1
- package/dist/hero-ecommerce-product-showcase.js +103 -81
- package/dist/hero-floating-images.cjs +1 -1
- package/dist/hero-floating-images.js +1 -1
- package/dist/hero-hiring-animated-text.cjs +4 -4
- package/dist/hero-hiring-animated-text.js +4 -4
- package/dist/hero-minimal-centered-dark.cjs +111 -82
- package/dist/hero-minimal-centered-dark.d.cts +1 -1
- package/dist/hero-minimal-centered-dark.d.ts +1 -1
- package/dist/hero-minimal-centered-dark.js +111 -82
- package/dist/hero-mobile-app-download.cjs +1 -1
- package/dist/hero-mobile-app-download.js +1 -1
- package/dist/hero-overlay-cta-grid.cjs +1 -1
- package/dist/hero-overlay-cta-grid.js +1 -1
- package/dist/hero-spiral-pattern-cards.cjs +1 -1
- package/dist/hero-spiral-pattern-cards.js +1 -1
- package/dist/hero-startup-launch-cta.cjs +1 -1
- package/dist/hero-startup-launch-cta.js +1 -1
- package/dist/hero-stats-social-proof.cjs +106 -90
- package/dist/hero-stats-social-proof.js +106 -90
- package/dist/hero-testimonial-image-grid.cjs +1 -1
- package/dist/hero-testimonial-image-grid.js +1 -1
- package/dist/hero-therapy-testimonial-grid.cjs +1 -1
- package/dist/hero-therapy-testimonial-grid.js +1 -1
- package/dist/hero-ui-library-showcase.cjs +63 -15
- package/dist/hero-ui-library-showcase.d.cts +5 -1
- package/dist/hero-ui-library-showcase.d.ts +5 -1
- package/dist/hero-ui-library-showcase.js +63 -15
- package/dist/index.cjs +44 -6
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +44 -6
- package/dist/link-page-newsletter-social.d.cts +1 -1
- package/dist/link-page-newsletter-social.d.ts +1 -1
- package/dist/offer-modal-membership-image.d.cts +1 -1
- package/dist/offer-modal-membership-image.d.ts +1 -1
- package/dist/offer-modal-newsletter-discount.d.cts +1 -1
- package/dist/offer-modal-newsletter-discount.d.ts +1 -1
- package/dist/offer-modal-sheet-newsletter.d.cts +1 -1
- package/dist/offer-modal-sheet-newsletter.d.ts +1 -1
- package/dist/registry.cjs +14465 -14767
- package/dist/registry.js +12664 -12966
- package/dist/resource-list-hero-filter.d.cts +1 -1
- package/dist/resource-list-hero-filter.d.ts +1 -1
- 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 {
|
|
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(
|
|
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
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
943
|
+
background,
|
|
944
|
+
spacing,
|
|
945
|
+
pattern,
|
|
946
|
+
patternOpacity,
|
|
947
|
+
className,
|
|
948
|
+
containerClassName,
|
|
935
949
|
children: [
|
|
936
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
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 {
|
|
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(
|
|
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
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
921
|
+
background,
|
|
922
|
+
spacing,
|
|
923
|
+
pattern,
|
|
924
|
+
patternOpacity,
|
|
925
|
+
className,
|
|
926
|
+
containerClassName,
|
|
913
927
|
children: [
|
|
914
|
-
/* @__PURE__ */ jsxs(
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
36
|
-
export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-
|
|
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-
|
|
36
|
-
export { b as PageSpeedFormMethod, a as PageSpeedFormSubmissionError, c as PageSpeedFormSubmissionFormat, i as isValidEmail, s as submitPageSpeedForm } from './forms-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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';
|