@axos-web-dev/shared-components 0.0.5 → 0.0.6
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.
|
@@ -9,6 +9,7 @@ export interface FormProps extends PropsWithChildren {
|
|
|
9
9
|
headline?: ReactNode;
|
|
10
10
|
disclosure?: ReactNode;
|
|
11
11
|
variant?: QuaternaryTypes;
|
|
12
|
+
validateEmail: (email: string) => Promise<boolean>;
|
|
12
13
|
callToAction: Omit<ChevronProps, "targetUrl">;
|
|
13
14
|
}
|
|
14
|
-
export declare const ScheduleCall: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const ScheduleCall: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, validateEmail, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,13 +24,14 @@ const ScheduleCall = ({
|
|
|
24
24
|
disclosure,
|
|
25
25
|
variant: fullVariant = "primary",
|
|
26
26
|
headline,
|
|
27
|
-
callToAction
|
|
27
|
+
callToAction,
|
|
28
|
+
validateEmail
|
|
28
29
|
}) => {
|
|
29
30
|
var _a, _b, _c, _d;
|
|
30
31
|
const schema = z.object({
|
|
31
32
|
firstName: z.string().trim().min(1, { message: "First Name is required." }),
|
|
32
33
|
lastName: z.string().trim().min(1, { message: "Last Name is required." }),
|
|
33
|
-
email: z.string().email({ message: "Email is required." }).refine(async (val) => await
|
|
34
|
+
email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
|
|
34
35
|
phone: z.string().regex(/[0-9]/).min(1, { message: "Phone is required." })
|
|
35
36
|
});
|
|
36
37
|
const methods = useForm({
|