@opensite/ui 1.9.8 → 2.0.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.
- package/dist/contact-demo.cjs +106 -406
- package/dist/contact-demo.d.cts +36 -111
- package/dist/contact-demo.d.ts +36 -111
- package/dist/contact-demo.js +108 -405
- package/dist/contact-emergency.cjs +129 -158
- package/dist/contact-emergency.d.cts +23 -12
- package/dist/contact-emergency.d.ts +23 -12
- package/dist/contact-emergency.js +131 -159
- package/dist/contact-event.cjs +106 -147
- package/dist/contact-event.d.cts +36 -66
- package/dist/contact-event.d.ts +36 -66
- package/dist/contact-event.js +108 -148
- package/dist/contact-feedback.cjs +109 -102
- package/dist/contact-feedback.d.cts +36 -63
- package/dist/contact-feedback.d.ts +36 -63
- package/dist/contact-feedback.js +111 -103
- package/dist/contact-fitness.cjs +107 -148
- package/dist/contact-fitness.d.cts +36 -66
- package/dist/contact-fitness.d.ts +36 -66
- package/dist/contact-fitness.js +109 -149
- package/dist/contact-guest.cjs +107 -148
- package/dist/contact-guest.d.cts +35 -65
- package/dist/contact-guest.d.ts +35 -65
- package/dist/contact-guest.js +109 -149
- package/dist/contact-image.cjs +108 -149
- package/dist/contact-image.d.cts +35 -65
- package/dist/contact-image.d.ts +35 -65
- package/dist/contact-image.js +110 -150
- package/dist/contact-insurance.cjs +107 -148
- package/dist/contact-insurance.d.cts +36 -66
- package/dist/contact-insurance.d.ts +36 -66
- package/dist/contact-insurance.js +109 -149
- package/dist/contact-interview.cjs +106 -147
- package/dist/contact-interview.d.cts +20 -12
- package/dist/contact-interview.d.ts +20 -12
- package/dist/contact-interview.js +108 -148
- package/dist/contact-locations.cjs +106 -147
- package/dist/contact-locations.d.cts +21 -13
- package/dist/contact-locations.d.ts +21 -13
- package/dist/contact-locations.js +108 -148
- package/dist/contact-maintenance.cjs +103 -143
- package/dist/contact-maintenance.d.cts +21 -13
- package/dist/contact-maintenance.d.ts +21 -13
- package/dist/contact-maintenance.js +105 -144
- package/dist/contact-map.cjs +103 -143
- package/dist/contact-map.d.cts +20 -12
- package/dist/contact-map.d.ts +20 -12
- package/dist/contact-map.js +105 -144
- package/dist/contact-minimal.cjs +126 -242
- package/dist/contact-minimal.d.cts +36 -70
- package/dist/contact-minimal.d.ts +36 -70
- package/dist/contact-minimal.js +128 -243
- package/dist/contact-moving.cjs +103 -143
- package/dist/contact-moving.d.cts +20 -12
- package/dist/contact-moving.d.ts +20 -12
- package/dist/contact-moving.js +105 -144
- package/dist/contact-multistep.cjs +104 -144
- package/dist/contact-multistep.d.cts +21 -13
- package/dist/contact-multistep.d.ts +21 -13
- package/dist/contact-multistep.js +106 -145
- package/dist/contact-partnership.cjs +103 -143
- package/dist/contact-partnership.d.cts +19 -11
- package/dist/contact-partnership.d.ts +19 -11
- package/dist/contact-partnership.js +105 -144
- package/dist/contact-press.cjs +144 -150
- package/dist/contact-press.d.cts +21 -13
- package/dist/contact-press.d.ts +21 -13
- package/dist/contact-press.js +146 -151
- package/dist/contact-quote.cjs +144 -150
- package/dist/contact-quote.d.cts +19 -11
- package/dist/contact-quote.d.ts +19 -11
- package/dist/contact-quote.js +146 -151
- package/dist/contact-referral.cjs +144 -150
- package/dist/contact-referral.d.cts +20 -12
- package/dist/contact-referral.d.ts +20 -12
- package/dist/contact-referral.js +146 -151
- package/dist/contact-report.cjs +144 -150
- package/dist/contact-report.d.cts +21 -13
- package/dist/contact-report.d.ts +21 -13
- package/dist/contact-report.js +146 -151
- package/dist/contact-reservation.cjs +144 -150
- package/dist/contact-reservation.d.cts +20 -12
- package/dist/contact-reservation.d.ts +20 -12
- package/dist/contact-reservation.js +146 -151
- package/dist/contact-retreat.cjs +144 -150
- package/dist/contact-retreat.d.cts +21 -13
- package/dist/contact-retreat.d.ts +21 -13
- package/dist/contact-retreat.js +146 -151
- package/dist/contact-rsvp.cjs +144 -150
- package/dist/contact-rsvp.d.cts +20 -12
- package/dist/contact-rsvp.d.ts +20 -12
- package/dist/contact-rsvp.js +146 -151
- package/dist/contact-sales.cjs +131 -146
- package/dist/contact-sales.d.cts +34 -65
- package/dist/contact-sales.d.ts +34 -65
- package/dist/contact-sales.js +133 -147
- package/dist/contact-schedule.cjs +144 -150
- package/dist/contact-schedule.d.cts +20 -12
- package/dist/contact-schedule.d.ts +20 -12
- package/dist/contact-schedule.js +146 -151
- package/dist/contact-sponsorship.cjs +144 -150
- package/dist/contact-sponsorship.d.cts +21 -13
- package/dist/contact-sponsorship.d.ts +21 -13
- package/dist/contact-sponsorship.js +146 -151
- package/dist/contact-support.cjs +147 -120
- package/dist/contact-support.d.cts +21 -12
- package/dist/contact-support.d.ts +21 -12
- package/dist/contact-support.js +149 -121
- package/dist/contact-tenant.cjs +144 -150
- package/dist/contact-tenant.d.cts +20 -12
- package/dist/contact-tenant.d.ts +20 -12
- package/dist/contact-tenant.js +146 -151
- package/dist/contact-vendor.cjs +144 -150
- package/dist/contact-vendor.d.cts +20 -12
- package/dist/contact-vendor.d.ts +20 -12
- package/dist/contact-vendor.js +146 -151
- package/dist/contact-volunteer.cjs +144 -150
- package/dist/contact-volunteer.d.cts +20 -12
- package/dist/contact-volunteer.d.ts +20 -12
- package/dist/contact-volunteer.js +146 -151
- package/dist/contact-warranty.cjs +144 -150
- package/dist/contact-warranty.d.cts +20 -12
- package/dist/contact-warranty.d.ts +20 -12
- package/dist/contact-warranty.js +146 -151
- package/dist/contact-wedding.cjs +144 -150
- package/dist/contact-wedding.d.cts +20 -12
- package/dist/contact-wedding.d.ts +20 -12
- package/dist/contact-wedding.js +146 -151
- package/dist/registry.cjs +5791 -5883
- package/dist/registry.js +4527 -4619
- package/package.json +2 -2
package/dist/contact-sales.cjs
CHANGED
|
@@ -3,13 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var forms = require('@page-speed/forms');
|
|
6
|
-
var
|
|
6
|
+
var integration = require('@page-speed/forms/integration');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var tailwindMerge = require('tailwind-merge');
|
|
9
9
|
var classVarianceAuthority = require('class-variance-authority');
|
|
10
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
11
|
-
var LabelPrimitive = require('@radix-ui/react-label');
|
|
12
|
-
var integration = require('@page-speed/forms/integration');
|
|
13
11
|
|
|
14
12
|
function _interopNamespace(e) {
|
|
15
13
|
if (e && e.__esModule) return e;
|
|
@@ -30,11 +28,8 @@ function _interopNamespace(e) {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
-
var LabelPrimitive__namespace = /*#__PURE__*/_interopNamespace(LabelPrimitive);
|
|
34
31
|
|
|
35
32
|
// components/blocks/contact/contact-sales.tsx
|
|
36
|
-
var TextInput = inputs.TextInput;
|
|
37
|
-
var TextArea = inputs.TextArea;
|
|
38
33
|
function cn(...inputs) {
|
|
39
34
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
40
35
|
}
|
|
@@ -479,22 +474,6 @@ function CardContent({ className, ...props }) {
|
|
|
479
474
|
}
|
|
480
475
|
);
|
|
481
476
|
}
|
|
482
|
-
function Label({
|
|
483
|
-
className,
|
|
484
|
-
...props
|
|
485
|
-
}) {
|
|
486
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
487
|
-
LabelPrimitive__namespace.Root,
|
|
488
|
-
{
|
|
489
|
-
"data-slot": "label",
|
|
490
|
-
className: cn(
|
|
491
|
-
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
492
|
-
className
|
|
493
|
-
),
|
|
494
|
-
...props
|
|
495
|
-
}
|
|
496
|
-
);
|
|
497
|
-
}
|
|
498
477
|
var maxWidthStyles = {
|
|
499
478
|
sm: "max-w-screen-sm",
|
|
500
479
|
md: "max-w-screen-md",
|
|
@@ -870,15 +849,60 @@ var Section = React__namespace.default.forwardRef(
|
|
|
870
849
|
}
|
|
871
850
|
);
|
|
872
851
|
Section.displayName = "Section";
|
|
852
|
+
var DEFAULT_FORM_FIELDS = [
|
|
853
|
+
{
|
|
854
|
+
name: "first_name",
|
|
855
|
+
type: "text",
|
|
856
|
+
label: "First Name",
|
|
857
|
+
placeholder: "John",
|
|
858
|
+
required: true,
|
|
859
|
+
columnSpan: 6
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
name: "last_name",
|
|
863
|
+
type: "text",
|
|
864
|
+
label: "Last Name",
|
|
865
|
+
placeholder: "Doe",
|
|
866
|
+
required: true,
|
|
867
|
+
columnSpan: 6
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
name: "email",
|
|
871
|
+
type: "email",
|
|
872
|
+
label: "Email",
|
|
873
|
+
placeholder: "john@example.com",
|
|
874
|
+
required: true,
|
|
875
|
+
columnSpan: 12
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "phone",
|
|
879
|
+
type: "tel",
|
|
880
|
+
label: "Phone",
|
|
881
|
+
placeholder: "+1 (555) 000-0000",
|
|
882
|
+
required: true,
|
|
883
|
+
columnSpan: 12
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "message",
|
|
887
|
+
type: "textarea",
|
|
888
|
+
label: "Message",
|
|
889
|
+
placeholder: "Your message...",
|
|
890
|
+
required: true,
|
|
891
|
+
rows: 4,
|
|
892
|
+
columnSpan: 12
|
|
893
|
+
}
|
|
894
|
+
];
|
|
873
895
|
function ContactSales({
|
|
874
896
|
heading,
|
|
875
897
|
description,
|
|
876
|
-
buttonText,
|
|
898
|
+
buttonText = "Submit",
|
|
877
899
|
buttonIcon,
|
|
878
900
|
actions,
|
|
879
901
|
actionsSlot,
|
|
902
|
+
formFields = DEFAULT_FORM_FIELDS,
|
|
903
|
+
successMessage = "Thank you! Your message has been sent successfully.",
|
|
880
904
|
className,
|
|
881
|
-
containerClassName,
|
|
905
|
+
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
882
906
|
headerClassName,
|
|
883
907
|
headingClassName,
|
|
884
908
|
descriptionClassName,
|
|
@@ -886,6 +910,8 @@ function ContactSales({
|
|
|
886
910
|
cardContentClassName,
|
|
887
911
|
formClassName,
|
|
888
912
|
submitClassName,
|
|
913
|
+
successMessageClassName,
|
|
914
|
+
errorMessageClassName,
|
|
889
915
|
background = "white",
|
|
890
916
|
spacing = "xl",
|
|
891
917
|
pattern,
|
|
@@ -895,60 +921,38 @@ function ContactSales({
|
|
|
895
921
|
onSuccess,
|
|
896
922
|
onError
|
|
897
923
|
}) {
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
return void 0;
|
|
914
|
-
},
|
|
915
|
-
phone: (value) => !value ? "Phone is required" : void 0,
|
|
916
|
-
message: (value) => !value ? "Message is required" : void 0
|
|
924
|
+
const {
|
|
925
|
+
uploadTokens,
|
|
926
|
+
uploadProgress,
|
|
927
|
+
isUploading,
|
|
928
|
+
uploadFiles,
|
|
929
|
+
removeFile,
|
|
930
|
+
resetUpload
|
|
931
|
+
} = integration.useFileUpload({ onError });
|
|
932
|
+
const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
|
|
933
|
+
formFields,
|
|
934
|
+
formConfig,
|
|
935
|
+
onSubmit,
|
|
936
|
+
onSuccess: (data) => {
|
|
937
|
+
resetUpload();
|
|
938
|
+
onSuccess?.(data);
|
|
917
939
|
},
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
return;
|
|
922
|
-
}
|
|
923
|
-
try {
|
|
924
|
-
let result;
|
|
925
|
-
if (shouldAutoSubmit) {
|
|
926
|
-
result = await integration.submitPageSpeedForm(values, formConfig);
|
|
927
|
-
}
|
|
928
|
-
if (onSubmit) {
|
|
929
|
-
await onSubmit(values);
|
|
930
|
-
}
|
|
931
|
-
if (shouldAutoSubmit || onSubmit) {
|
|
932
|
-
if (formConfig?.resetOnSuccess !== false) {
|
|
933
|
-
helpers.resetForm();
|
|
934
|
-
}
|
|
935
|
-
onSuccess?.(result);
|
|
936
|
-
}
|
|
937
|
-
} catch (error) {
|
|
938
|
-
if (error instanceof integration.PageSpeedFormSubmissionError && error.formErrors) {
|
|
939
|
-
helpers.setErrors(error.formErrors);
|
|
940
|
-
}
|
|
941
|
-
onError?.(error);
|
|
942
|
-
throw error;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
940
|
+
onError,
|
|
941
|
+
resetOnSuccess: formConfig?.resetOnSuccess !== false,
|
|
942
|
+
uploadTokens
|
|
945
943
|
});
|
|
946
|
-
const
|
|
947
|
-
const actionsContent = React__namespace.useMemo(() => {
|
|
944
|
+
const actionsContent = React.useMemo(() => {
|
|
948
945
|
if (actionsSlot) return actionsSlot;
|
|
949
946
|
if (actions && actions.length > 0) {
|
|
950
947
|
return actions.map((action, index) => {
|
|
951
|
-
const {
|
|
948
|
+
const {
|
|
949
|
+
label,
|
|
950
|
+
icon,
|
|
951
|
+
iconAfter,
|
|
952
|
+
children,
|
|
953
|
+
className: actionClassName,
|
|
954
|
+
...pressableProps
|
|
955
|
+
} = action;
|
|
952
956
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
953
957
|
Pressable,
|
|
954
958
|
{
|
|
@@ -975,89 +979,70 @@ function ContactSales({
|
|
|
975
979
|
pattern,
|
|
976
980
|
patternOpacity,
|
|
977
981
|
className: cn("py-12", className),
|
|
978
|
-
|
|
982
|
+
containerClassName,
|
|
983
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto max-w-4xl", children: [
|
|
979
984
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("mb-10 text-center", headerClassName), children: [
|
|
980
|
-
heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
981
|
-
|
|
985
|
+
heading && (typeof heading === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
"h2",
|
|
987
|
+
{
|
|
988
|
+
className: cn(
|
|
989
|
+
"mb-3 text-3xl font-bold tracking-tight text-balance",
|
|
990
|
+
headingClassName
|
|
991
|
+
),
|
|
992
|
+
children: heading
|
|
993
|
+
}
|
|
994
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: headingClassName, children: heading })),
|
|
995
|
+
description && (typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
996
|
+
"p",
|
|
997
|
+
{
|
|
998
|
+
className: cn(
|
|
999
|
+
"leading-relaxed text-balance",
|
|
1000
|
+
descriptionClassName
|
|
1001
|
+
),
|
|
1002
|
+
children: description
|
|
1003
|
+
}
|
|
1004
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: descriptionClassName, children: description }))
|
|
982
1005
|
] }),
|
|
983
1006
|
/* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("mx-auto max-w-xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
984
1007
|
forms.Form,
|
|
985
1008
|
{
|
|
986
1009
|
form,
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1010
|
+
notificationConfig: {
|
|
1011
|
+
submissionError,
|
|
1012
|
+
successMessage
|
|
1013
|
+
},
|
|
1014
|
+
styleConfig: {
|
|
1015
|
+
formClassName: cn("space-y-4", formClassName),
|
|
1016
|
+
successMessageClassName,
|
|
1017
|
+
errorMessageClassName
|
|
1018
|
+
},
|
|
1019
|
+
formConfig: {
|
|
1020
|
+
endpoint: formConfig?.endpoint,
|
|
1021
|
+
method: formMethod,
|
|
1022
|
+
submissionConfig: formConfig?.submissionConfig
|
|
1023
|
+
},
|
|
1024
|
+
onNewSubmission: () => {
|
|
1025
|
+
resetUpload();
|
|
1026
|
+
resetSubmissionState();
|
|
1027
|
+
},
|
|
990
1028
|
children: [
|
|
991
|
-
/* @__PURE__ */ jsxRuntime.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
...field,
|
|
998
|
-
id: "first-name",
|
|
999
|
-
placeholder: "John",
|
|
1000
|
-
error: meta.touched && !!meta.error,
|
|
1001
|
-
"aria-label": "First Name"
|
|
1002
|
-
}
|
|
1003
|
-
)
|
|
1004
|
-
] }) }),
|
|
1005
|
-
/* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "last_name", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1006
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "last-name", children: "Last Name" }),
|
|
1007
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1008
|
-
TextInput,
|
|
1029
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-12 gap-6", children: formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1030
|
+
"div",
|
|
1031
|
+
{
|
|
1032
|
+
className: integration.getColumnSpanClass(field.columnSpan),
|
|
1033
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1034
|
+
integration.DynamicFormField,
|
|
1009
1035
|
{
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1036
|
+
field,
|
|
1037
|
+
uploadProgress,
|
|
1038
|
+
onFileUpload: uploadFiles,
|
|
1039
|
+
onFileRemove: removeFile,
|
|
1040
|
+
isUploading
|
|
1015
1041
|
}
|
|
1016
1042
|
)
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "email", children: "Email" }),
|
|
1021
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1022
|
-
TextInput,
|
|
1023
|
-
{
|
|
1024
|
-
...field,
|
|
1025
|
-
id: "email",
|
|
1026
|
-
type: "email",
|
|
1027
|
-
placeholder: "john@example.com",
|
|
1028
|
-
error: meta.touched && !!meta.error,
|
|
1029
|
-
"aria-label": "Email"
|
|
1030
|
-
}
|
|
1031
|
-
)
|
|
1032
|
-
] }) }),
|
|
1033
|
-
/* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "phone", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1034
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "phone", children: "Phone" }),
|
|
1035
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
|
-
TextInput,
|
|
1037
|
-
{
|
|
1038
|
-
...field,
|
|
1039
|
-
id: "phone",
|
|
1040
|
-
type: "tel",
|
|
1041
|
-
placeholder: "+1 (555) 000-0000",
|
|
1042
|
-
error: meta.touched && !!meta.error,
|
|
1043
|
-
"aria-label": "Phone"
|
|
1044
|
-
}
|
|
1045
|
-
)
|
|
1046
|
-
] }) }),
|
|
1047
|
-
/* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "message", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1048
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { htmlFor: "message", children: "Message" }),
|
|
1049
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1050
|
-
TextArea,
|
|
1051
|
-
{
|
|
1052
|
-
...field,
|
|
1053
|
-
id: "message",
|
|
1054
|
-
placeholder: "Your message...",
|
|
1055
|
-
rows: 4,
|
|
1056
|
-
error: meta.touched && !!meta.error,
|
|
1057
|
-
"aria-label": "Message"
|
|
1058
|
-
}
|
|
1059
|
-
)
|
|
1060
|
-
] }) }),
|
|
1043
|
+
},
|
|
1044
|
+
field.name
|
|
1045
|
+
)) }),
|
|
1061
1046
|
actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1062
1047
|
Pressable,
|
|
1063
1048
|
{
|
package/dist/contact-sales.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PageSpeedFormConfig } from '@page-speed/forms/integration';
|
|
2
|
+
import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
|
|
3
3
|
import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bz_A5vLU.cjs';
|
|
4
4
|
import { A as ActionConfig } from './blocks-Cohq4eio.cjs';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -7,74 +7,51 @@ import 'class-variance-authority';
|
|
|
7
7
|
import './button-variants-lRElsmTc.cjs';
|
|
8
8
|
import 'class-variance-authority/types';
|
|
9
9
|
|
|
10
|
-
interface ContactSalesFormValues {
|
|
11
|
-
first_name: string;
|
|
12
|
-
last_name: string;
|
|
13
|
-
email: string;
|
|
14
|
-
phone: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
10
|
interface ContactSalesProps {
|
|
18
|
-
/**
|
|
19
|
-
* Main heading content
|
|
20
|
-
*/
|
|
11
|
+
/** Main heading text */
|
|
21
12
|
heading?: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Description text below heading
|
|
24
|
-
*/
|
|
13
|
+
/** Description text below heading */
|
|
25
14
|
description?: React.ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Submit button text
|
|
28
|
-
*/
|
|
15
|
+
/** Submit button text */
|
|
29
16
|
buttonText?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Submit button icon (displayed before text)
|
|
32
|
-
*/
|
|
17
|
+
/** Icon to display in submit button */
|
|
33
18
|
buttonIcon?: React.ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* Array of action configurations for additional buttons
|
|
36
|
-
*/
|
|
19
|
+
/** Array of action configurations for custom buttons */
|
|
37
20
|
actions?: ActionConfig[];
|
|
38
|
-
/**
|
|
39
|
-
* Custom slot for rendering actions (overrides actions array and default submit)
|
|
40
|
-
*/
|
|
21
|
+
/** Custom slot for rendering actions (overrides actions array) */
|
|
41
22
|
actionsSlot?: React.ReactNode;
|
|
42
23
|
/**
|
|
43
|
-
*
|
|
24
|
+
* Array of form field configurations
|
|
25
|
+
* If not provided, defaults to: first_name, last_name, email, phone, message
|
|
44
26
|
*/
|
|
45
|
-
|
|
27
|
+
formFields?: FormFieldConfig[];
|
|
46
28
|
/**
|
|
47
|
-
*
|
|
29
|
+
* Success message to display after form submission
|
|
30
|
+
* @default "Thank you! Your message has been sent successfully."
|
|
48
31
|
*/
|
|
32
|
+
successMessage?: React.ReactNode;
|
|
33
|
+
/** Additional CSS classes for the section */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Additional CSS classes for the container */
|
|
49
36
|
containerClassName?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Additional CSS classes for the header wrapper
|
|
52
|
-
*/
|
|
37
|
+
/** Additional CSS classes for the header */
|
|
53
38
|
headerClassName?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Additional CSS classes for the heading
|
|
56
|
-
*/
|
|
39
|
+
/** Additional CSS classes for the heading */
|
|
57
40
|
headingClassName?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Additional CSS classes for the description
|
|
60
|
-
*/
|
|
41
|
+
/** Additional CSS classes for the description */
|
|
61
42
|
descriptionClassName?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Additional CSS classes for the card
|
|
64
|
-
*/
|
|
43
|
+
/** Additional CSS classes for the card */
|
|
65
44
|
cardClassName?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Additional CSS classes for the card content
|
|
68
|
-
*/
|
|
45
|
+
/** Additional CSS classes for the card content */
|
|
69
46
|
cardContentClassName?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Additional CSS classes for the form
|
|
72
|
-
*/
|
|
47
|
+
/** Additional CSS classes for the form */
|
|
73
48
|
formClassName?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Additional CSS classes for the submit button
|
|
76
|
-
*/
|
|
49
|
+
/** Additional CSS classes for the submit button */
|
|
77
50
|
submitClassName?: string;
|
|
51
|
+
/** Additional CSS classes for the success message */
|
|
52
|
+
successMessageClassName?: string;
|
|
53
|
+
/** Additional CSS classes for the error message */
|
|
54
|
+
errorMessageClassName?: string;
|
|
78
55
|
/**
|
|
79
56
|
* Background style for the section
|
|
80
57
|
*/
|
|
@@ -91,25 +68,17 @@ interface ContactSalesProps {
|
|
|
91
68
|
* Pattern overlay opacity (0-1)
|
|
92
69
|
*/
|
|
93
70
|
patternOpacity?: number;
|
|
94
|
-
/**
|
|
95
|
-
* Form submission configuration
|
|
96
|
-
*/
|
|
71
|
+
/** Form configuration for PageSpeed forms */
|
|
97
72
|
formConfig?: PageSpeedFormConfig;
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onSubmit?: (values: ContactSalesFormValues) => void | Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Success callback after submission
|
|
104
|
-
*/
|
|
73
|
+
/** Custom submit handler */
|
|
74
|
+
onSubmit?: (values: Record<string, any>) => void | Promise<void>;
|
|
75
|
+
/** Success callback */
|
|
105
76
|
onSuccess?: (data: unknown) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Error callback if submission fails
|
|
108
|
-
*/
|
|
77
|
+
/** Error callback */
|
|
109
78
|
onError?: (error: Error) => void;
|
|
110
79
|
}
|
|
111
80
|
/**
|
|
112
|
-
* ContactSales - Contact form with
|
|
81
|
+
* ContactSales - Contact form with flexible field configuration
|
|
113
82
|
*
|
|
114
83
|
* @example
|
|
115
84
|
* ```tsx
|
|
@@ -119,6 +88,6 @@ interface ContactSalesProps {
|
|
|
119
88
|
* />
|
|
120
89
|
* ```
|
|
121
90
|
*/
|
|
122
|
-
declare function ContactSales({ heading, description, buttonText, buttonIcon, actions, actionsSlot, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactSalesProps): React.JSX.Element;
|
|
91
|
+
declare function ContactSales({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactSalesProps): React.JSX.Element;
|
|
123
92
|
|
|
124
93
|
export { ContactSales, type ContactSalesProps };
|
package/dist/contact-sales.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { PageSpeedFormConfig } from '@page-speed/forms/integration';
|
|
2
|
+
import { FormFieldConfig, PageSpeedFormConfig } from '@page-speed/forms/integration';
|
|
3
3
|
import { f as SectionBackground, g as SectionSpacing, t as PatternName } from './community-initiatives-Bi_ClKrO.js';
|
|
4
4
|
import { A as ActionConfig } from './blocks-k17uluAz.js';
|
|
5
5
|
import 'react/jsx-runtime';
|
|
@@ -7,74 +7,51 @@ import 'class-variance-authority';
|
|
|
7
7
|
import './button-variants-lRElsmTc.js';
|
|
8
8
|
import 'class-variance-authority/types';
|
|
9
9
|
|
|
10
|
-
interface ContactSalesFormValues {
|
|
11
|
-
first_name: string;
|
|
12
|
-
last_name: string;
|
|
13
|
-
email: string;
|
|
14
|
-
phone: string;
|
|
15
|
-
message: string;
|
|
16
|
-
}
|
|
17
10
|
interface ContactSalesProps {
|
|
18
|
-
/**
|
|
19
|
-
* Main heading content
|
|
20
|
-
*/
|
|
11
|
+
/** Main heading text */
|
|
21
12
|
heading?: React.ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Description text below heading
|
|
24
|
-
*/
|
|
13
|
+
/** Description text below heading */
|
|
25
14
|
description?: React.ReactNode;
|
|
26
|
-
/**
|
|
27
|
-
* Submit button text
|
|
28
|
-
*/
|
|
15
|
+
/** Submit button text */
|
|
29
16
|
buttonText?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Submit button icon (displayed before text)
|
|
32
|
-
*/
|
|
17
|
+
/** Icon to display in submit button */
|
|
33
18
|
buttonIcon?: React.ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* Array of action configurations for additional buttons
|
|
36
|
-
*/
|
|
19
|
+
/** Array of action configurations for custom buttons */
|
|
37
20
|
actions?: ActionConfig[];
|
|
38
|
-
/**
|
|
39
|
-
* Custom slot for rendering actions (overrides actions array and default submit)
|
|
40
|
-
*/
|
|
21
|
+
/** Custom slot for rendering actions (overrides actions array) */
|
|
41
22
|
actionsSlot?: React.ReactNode;
|
|
42
23
|
/**
|
|
43
|
-
*
|
|
24
|
+
* Array of form field configurations
|
|
25
|
+
* If not provided, defaults to: first_name, last_name, email, phone, message
|
|
44
26
|
*/
|
|
45
|
-
|
|
27
|
+
formFields?: FormFieldConfig[];
|
|
46
28
|
/**
|
|
47
|
-
*
|
|
29
|
+
* Success message to display after form submission
|
|
30
|
+
* @default "Thank you! Your message has been sent successfully."
|
|
48
31
|
*/
|
|
32
|
+
successMessage?: React.ReactNode;
|
|
33
|
+
/** Additional CSS classes for the section */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Additional CSS classes for the container */
|
|
49
36
|
containerClassName?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Additional CSS classes for the header wrapper
|
|
52
|
-
*/
|
|
37
|
+
/** Additional CSS classes for the header */
|
|
53
38
|
headerClassName?: string;
|
|
54
|
-
/**
|
|
55
|
-
* Additional CSS classes for the heading
|
|
56
|
-
*/
|
|
39
|
+
/** Additional CSS classes for the heading */
|
|
57
40
|
headingClassName?: string;
|
|
58
|
-
/**
|
|
59
|
-
* Additional CSS classes for the description
|
|
60
|
-
*/
|
|
41
|
+
/** Additional CSS classes for the description */
|
|
61
42
|
descriptionClassName?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Additional CSS classes for the card
|
|
64
|
-
*/
|
|
43
|
+
/** Additional CSS classes for the card */
|
|
65
44
|
cardClassName?: string;
|
|
66
|
-
/**
|
|
67
|
-
* Additional CSS classes for the card content
|
|
68
|
-
*/
|
|
45
|
+
/** Additional CSS classes for the card content */
|
|
69
46
|
cardContentClassName?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Additional CSS classes for the form
|
|
72
|
-
*/
|
|
47
|
+
/** Additional CSS classes for the form */
|
|
73
48
|
formClassName?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Additional CSS classes for the submit button
|
|
76
|
-
*/
|
|
49
|
+
/** Additional CSS classes for the submit button */
|
|
77
50
|
submitClassName?: string;
|
|
51
|
+
/** Additional CSS classes for the success message */
|
|
52
|
+
successMessageClassName?: string;
|
|
53
|
+
/** Additional CSS classes for the error message */
|
|
54
|
+
errorMessageClassName?: string;
|
|
78
55
|
/**
|
|
79
56
|
* Background style for the section
|
|
80
57
|
*/
|
|
@@ -91,25 +68,17 @@ interface ContactSalesProps {
|
|
|
91
68
|
* Pattern overlay opacity (0-1)
|
|
92
69
|
*/
|
|
93
70
|
patternOpacity?: number;
|
|
94
|
-
/**
|
|
95
|
-
* Form submission configuration
|
|
96
|
-
*/
|
|
71
|
+
/** Form configuration for PageSpeed forms */
|
|
97
72
|
formConfig?: PageSpeedFormConfig;
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onSubmit?: (values: ContactSalesFormValues) => void | Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Success callback after submission
|
|
104
|
-
*/
|
|
73
|
+
/** Custom submit handler */
|
|
74
|
+
onSubmit?: (values: Record<string, any>) => void | Promise<void>;
|
|
75
|
+
/** Success callback */
|
|
105
76
|
onSuccess?: (data: unknown) => void;
|
|
106
|
-
/**
|
|
107
|
-
* Error callback if submission fails
|
|
108
|
-
*/
|
|
77
|
+
/** Error callback */
|
|
109
78
|
onError?: (error: Error) => void;
|
|
110
79
|
}
|
|
111
80
|
/**
|
|
112
|
-
* ContactSales - Contact form with
|
|
81
|
+
* ContactSales - Contact form with flexible field configuration
|
|
113
82
|
*
|
|
114
83
|
* @example
|
|
115
84
|
* ```tsx
|
|
@@ -119,6 +88,6 @@ interface ContactSalesProps {
|
|
|
119
88
|
* />
|
|
120
89
|
* ```
|
|
121
90
|
*/
|
|
122
|
-
declare function ContactSales({ heading, description, buttonText, buttonIcon, actions, actionsSlot, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactSalesProps): React.JSX.Element;
|
|
91
|
+
declare function ContactSales({ heading, description, buttonText, buttonIcon, actions, actionsSlot, formFields, successMessage, className, containerClassName, headerClassName, headingClassName, descriptionClassName, cardClassName, cardContentClassName, formClassName, submitClassName, successMessageClassName, errorMessageClassName, background, spacing, pattern, patternOpacity, formConfig, onSubmit, onSuccess, onError, }: ContactSalesProps): React.JSX.Element;
|
|
123
92
|
|
|
124
93
|
export { ContactSales, type ContactSalesProps };
|