@axos-web-dev/shared-components 0.0.119 → 0.0.120
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/ATMLocator/ATMLocator.js +1 -0
- package/dist/Article/Article.js +8 -4
- package/dist/Button/Button.js +3 -2
- package/dist/Calculators/Calculator.js +1 -0
- package/dist/Carousel/index.js +5 -4
- package/dist/Chevron/index.js +3 -2
- package/dist/Comparison/Comparison.js +1 -0
- package/dist/FaqAccordion/index.js +1 -0
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +4 -3
- package/dist/Forms/ContactUsBusiness.js +4 -3
- package/dist/Forms/ContactUsNMLSId.js +4 -3
- package/dist/Forms/DealerServices.d.ts +1 -1
- package/dist/Forms/DealerServices.js +12 -8
- package/dist/Forms/EmailOnly.js +4 -3
- package/dist/Forms/ScheduleCall.js +1 -0
- package/dist/Forms/ScheduleCallPremier.js +1 -0
- package/dist/Forms/SuccesForm.js +1 -0
- package/dist/Hyperlink/index.js +4 -3
- package/dist/ImageLink/ImageLink.js +1 -0
- package/dist/ImageLink/ImageLinkSet.d.ts +1 -0
- package/dist/ImageLink/ImageLinkSet.js +3 -1
- package/dist/ImageLink/index.js +4 -3
- package/dist/Input/InputProps.d.ts +0 -6
- package/dist/Insight/Featured/CategorySelector.js +1 -0
- package/dist/Insight/Featured/Featured.js +5 -4
- package/dist/Modal/Modal.js +4 -3
- package/dist/NavigationMenu/AxosBank/NavData.js +4 -3
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +4 -3
- package/dist/NavigationMenu/AxosBank/index.js +1 -0
- package/dist/SetContainer/SetContainer.js +1 -0
- package/dist/VideoTile/VideoInit.js +2 -1
- package/dist/VideoWrapper/index.js +1 -0
- package/dist/assets/PageNavItem/PageNavItem.css +1 -0
- package/dist/assets/PageNavSet/PageNavigationSet.css +1 -1
- package/dist/assets/SetContainer/SetContainer.css +0 -1
- package/dist/assets/Table/Table.css +8 -4
- package/dist/assets/VideoTile/VideoTile.css +5 -0
- package/dist/utils/allowedAxosDomains.js +2 -1
- package/package.json +17 -17
- package/dist/Forms/BlendPurchase.d.ts +0 -11
- package/dist/Forms/BlendPurchase.js +0 -215
- package/dist/Forms/BlendRefinance.d.ts +0 -11
- package/dist/Forms/BlendRefinance.js +0 -215
- package/dist/Input/DatePicker.css.d.ts +0 -1
- package/dist/Input/DatePicker.css.js +0 -6
- package/dist/Input/Datepicker.d.ts +0 -3
- package/dist/Input/Datepicker.js +0 -47
- package/dist/Input/InputDate.css.d.ts +0 -6
- package/dist/Input/InputDate.css.js +0 -15
- package/dist/Input/InputDate.d.ts +0 -3
- package/dist/Input/InputDate.js +0 -47
- package/dist/assets/Input/DatePicker.css +0 -95
- package/dist/assets/Input/InputDate.css +0 -39
|
@@ -226,10 +226,10 @@ tr:last-child td {
|
|
|
226
226
|
min-width: unset;
|
|
227
227
|
width: 100%;
|
|
228
228
|
}
|
|
229
|
-
tr:has(> :last-child:nth-child(-n + 3)) td {
|
|
229
|
+
._1nivbwe13 tr:has(> :last-child:nth-child(-n + 3)) td {
|
|
230
230
|
width: 33%;
|
|
231
231
|
}
|
|
232
|
-
tr:has(> :last-child:nth-child(-n + 3)) th {
|
|
232
|
+
._1nivbwe13 tr:has(> :last-child:nth-child(-n + 3)) th {
|
|
233
233
|
width: 33%;
|
|
234
234
|
}
|
|
235
235
|
tr:has(> :last-child:nth-child(-n + 3)) td:first-child {
|
|
@@ -305,14 +305,18 @@ main > div:nth-last-child(2) > ._1nivbwe0 {
|
|
|
305
305
|
overflow: auto;
|
|
306
306
|
width: auto;
|
|
307
307
|
}
|
|
308
|
-
|
|
308
|
+
._1nivbwe13 tr:has(> :last-child:nth-child(-n + 3)) td {
|
|
309
|
+
width: 30%;
|
|
310
|
+
}
|
|
311
|
+
tr:has(> :last-child:nth-child(-n + 3)) td {
|
|
309
312
|
font-size: 14px;
|
|
310
313
|
min-width: unset;
|
|
314
|
+
}
|
|
315
|
+
._1nivbwe13 tr:has(> :last-child:nth-child(-n + 3)) th {
|
|
311
316
|
width: 30%;
|
|
312
317
|
}
|
|
313
318
|
tr:has(> :last-child:nth-child(-n + 3)) th {
|
|
314
319
|
min-width: unset;
|
|
315
|
-
width: 30%;
|
|
316
320
|
}
|
|
317
321
|
tr:has(> :last-child:nth-child(-n + 3)) td:first-child {
|
|
318
322
|
box-shadow: none;
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
text-align: center;
|
|
15
15
|
font-family: var(--header-font-family);
|
|
16
16
|
height: 64px;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
display: -webkit-box;
|
|
20
|
+
-webkit-line-clamp: 2;
|
|
21
|
+
-webkit-box-orient: vertical;
|
|
17
22
|
}
|
|
18
23
|
._16puo4g3 {
|
|
19
24
|
font-size: 18px;
|
|
@@ -17,7 +17,8 @@ const moreDomains = {
|
|
|
17
17
|
"{INVESTORS}": process.env.INVESTORS_URL || "https://investors.axosfinancial.com",
|
|
18
18
|
"{OBAXB}": process.env.ONLINEBANKING_URL || "https://onlinebanking.axosbank.com",
|
|
19
19
|
"{UNVENROLLMENT}": process.env.UNVENROLLMENT_URL || "https://enroll.axosbank.com",
|
|
20
|
-
"{AUTOAXB}": "https://auto.axosbank.com/partner/axos-purchase/AU"
|
|
20
|
+
"{AUTOAXB}": "https://auto.axosbank.com/partner/axos-purchase/AU",
|
|
21
|
+
"{COMMERCIALPORTAL}": process.env.COMMERCIALPORTAL_URL || "https://portals.axosbank.com/"
|
|
21
22
|
};
|
|
22
23
|
const isAllowedUrl = (url) => {
|
|
23
24
|
const uri = new URL(url, location.href);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axos-web-dev/shared-components",
|
|
3
3
|
"description": "Axos shared components library for web.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.120",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@hookform/resolvers": "^3.9.0",
|
|
32
|
-
"@react-input/mask": "^1.2.
|
|
33
|
-
"@react-input/number-format": "^1.0.
|
|
34
|
-
"@storybook/icons": "^1.2.
|
|
35
|
-
"@storybook/preview-api": "^8.
|
|
32
|
+
"@react-input/mask": "^1.2.8",
|
|
33
|
+
"@react-input/number-format": "^1.0.28",
|
|
34
|
+
"@storybook/icons": "^1.2.10",
|
|
35
|
+
"@storybook/preview-api": "^8.3.0",
|
|
36
36
|
"@types/iframe-resizer": "3.5.13",
|
|
37
|
-
"@vanilla-extract/css": "^1.15.
|
|
37
|
+
"@vanilla-extract/css": "^1.15.5",
|
|
38
38
|
"@vanilla-extract/recipes": "^0.5.1",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"iframe-resizer": "4.3.11",
|
|
41
41
|
"lodash": "^4.17.21",
|
|
42
42
|
"moment": "^2.30.1",
|
|
43
43
|
"react-date-picker": "^11.0.0",
|
|
44
|
-
"react-hook-form": "^7.
|
|
44
|
+
"react-hook-form": "^7.53.0",
|
|
45
45
|
"react-markdown": "^9.0.1",
|
|
46
46
|
"react-slick": "^0.30.2",
|
|
47
47
|
"react-use": "^17.5.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typed-css-modules": "^0.9.1",
|
|
50
50
|
"vite-plugin-svgr": "^4.2.0",
|
|
51
51
|
"zod": "^3.23.8",
|
|
52
|
-
"zustand": "^4.5.
|
|
52
|
+
"zustand": "^4.5.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@vanilla-extract/css-utils": "^0.1.3",
|
|
@@ -78,24 +78,24 @@
|
|
|
78
78
|
"@svgr/plugin-prettier": "^8.1.0",
|
|
79
79
|
"@svgr/plugin-svgo": "^8.1.0",
|
|
80
80
|
"@types/lodash": "^4.17.7",
|
|
81
|
-
"@types/node": "^20.
|
|
82
|
-
"@types/react": "^18.3.
|
|
81
|
+
"@types/node": "^20.16.5",
|
|
82
|
+
"@types/react": "^18.3.5",
|
|
83
83
|
"@types/react-datepicker": "^6.2.0",
|
|
84
84
|
"@types/react-dom": "^18.3.0",
|
|
85
85
|
"@types/react-slick": "^0.23.13",
|
|
86
86
|
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
|
87
87
|
"@typescript-eslint/parser": "^7.9.0",
|
|
88
|
-
"@vanilla-extract/css-utils": "^0.1.
|
|
89
|
-
"@vanilla-extract/recipes": "^0.5.
|
|
90
|
-
"@vanilla-extract/vite-plugin": "^4.0.
|
|
91
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
88
|
+
"@vanilla-extract/css-utils": "^0.1.4",
|
|
89
|
+
"@vanilla-extract/recipes": "^0.5.5",
|
|
90
|
+
"@vanilla-extract/vite-plugin": "^4.0.15",
|
|
91
|
+
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
92
92
|
"esbuild-vanilla-image-loader": "^0.1.3",
|
|
93
93
|
"eslint": "^8.57.0",
|
|
94
94
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
95
95
|
"eslint-plugin-react-refresh": "^0.4.7",
|
|
96
96
|
"eslint-plugin-storybook": "^0.8.0",
|
|
97
97
|
"glob": "^10.4.5",
|
|
98
|
-
"husky": "^9.
|
|
98
|
+
"husky": "^9.1.6",
|
|
99
99
|
"next": "^14.1.4",
|
|
100
100
|
"prettier": "3.2.5",
|
|
101
101
|
"react": "^18.3.1",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
"rollup-plugin-svg-import": "^3.0.0",
|
|
105
105
|
"rollup-plugin-svgo": "^2.0.0",
|
|
106
106
|
"storybook": "^8.2.9",
|
|
107
|
-
"typescript": "^5.
|
|
107
|
+
"typescript": "^5.6.2",
|
|
108
108
|
"typescript-plugin-css-modules": "^5.1.0",
|
|
109
|
-
"vite": "^5.
|
|
109
|
+
"vite": "^5.4.4",
|
|
110
110
|
"vite-plugin-dts": "^3.9.1",
|
|
111
111
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
112
112
|
"vite-plugin-setting-css-module": "^1.1.4",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormProps } from './FormProps';
|
|
2
|
-
|
|
3
|
-
export type BlendPurchaseInputs = {
|
|
4
|
-
property_Type: string;
|
|
5
|
-
Occupancy: string;
|
|
6
|
-
SalesPrice: string;
|
|
7
|
-
DownPayment: string;
|
|
8
|
-
CreditScore: string;
|
|
9
|
-
ZipCode: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const BlendPurchase: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
-
import { Button } from "../Button/Button.js";
|
|
5
|
-
import "../Button/Button.css.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-use";
|
|
8
|
-
import "../Input/Checkbox.js";
|
|
9
|
-
import "../Input/CurrencyInput.js";
|
|
10
|
-
import "../Input/Dropdown.js";
|
|
11
|
-
/* empty css */
|
|
12
|
-
/* empty css */
|
|
13
|
-
import { Input } from "../Input/Input.js";
|
|
14
|
-
import "../Input/Input.css.js";
|
|
15
|
-
import "../Input/InputAmount.js";
|
|
16
|
-
import { InputPhone } from "../Input/InputPhone.js";
|
|
17
|
-
import "../Input/InputTextArea.js";
|
|
18
|
-
import "../icons/ArrowIcon/ArrowIcon.css.js";
|
|
19
|
-
import SvgAxosX from "../icons/AxosX/index.js";
|
|
20
|
-
import SvgComponent from "../icons/AxosX/Blue.js";
|
|
21
|
-
import "../icons/CheckIcon/CheckIcon.css.js";
|
|
22
|
-
/* empty css */
|
|
23
|
-
/* empty css */
|
|
24
|
-
/* empty css */
|
|
25
|
-
/* empty css */
|
|
26
|
-
import { associatedEmail } from "../utils/EverestValidity.js";
|
|
27
|
-
import "../utils/allowedAxosDomains.js";
|
|
28
|
-
import { getVariant } from "../utils/getVariant.js";
|
|
29
|
-
import clsx from "clsx";
|
|
30
|
-
import { useForm, FormProvider } from "react-hook-form";
|
|
31
|
-
import * as z from "zod";
|
|
32
|
-
import { formContainer, iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions } from "./Forms.css.js";
|
|
33
|
-
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
34
|
-
const BlendPurchase = ({
|
|
35
|
-
icon = false,
|
|
36
|
-
children,
|
|
37
|
-
onSubmit = (values) => {
|
|
38
|
-
console.log(values);
|
|
39
|
-
},
|
|
40
|
-
disclosure,
|
|
41
|
-
variant: fullVariant = "primary",
|
|
42
|
-
headline,
|
|
43
|
-
description,
|
|
44
|
-
callToAction,
|
|
45
|
-
validateEmail,
|
|
46
|
-
id
|
|
47
|
-
}) => {
|
|
48
|
-
const schema = z.object({
|
|
49
|
-
property_Type: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
|
|
50
|
-
Occupancy: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Last Name is required." }),
|
|
51
|
-
SalesPrice: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
|
|
52
|
-
DownPayment: z.string().regex(/[\d-]{10}/).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
|
|
53
|
-
const removeDashes = val.replace(/-/gi, "");
|
|
54
|
-
if (removeDashes.length !== 10) {
|
|
55
|
-
ctx.addIssue({
|
|
56
|
-
code: z.ZodIssueCode.custom,
|
|
57
|
-
message: "Phone must have at least 10 and no more than 10 characters."
|
|
58
|
-
});
|
|
59
|
-
return z.NEVER;
|
|
60
|
-
}
|
|
61
|
-
return removeDashes;
|
|
62
|
-
}),
|
|
63
|
-
CreditScore: z.string(),
|
|
64
|
-
ZipCode: z.string()
|
|
65
|
-
});
|
|
66
|
-
const methods = useForm({
|
|
67
|
-
resolver: zodResolver(schema.merge(SalesforceSchema), {
|
|
68
|
-
async: true
|
|
69
|
-
}),
|
|
70
|
-
mode: "all",
|
|
71
|
-
defaultValues: {}
|
|
72
|
-
});
|
|
73
|
-
const {
|
|
74
|
-
handleSubmit,
|
|
75
|
-
register,
|
|
76
|
-
formState: { errors, isValid, isSubmitting }
|
|
77
|
-
} = methods;
|
|
78
|
-
const submitForm = async (data) => {
|
|
79
|
-
await onSubmit(data);
|
|
80
|
-
};
|
|
81
|
-
const variant = getVariant(fullVariant);
|
|
82
|
-
return /* @__PURE__ */ jsx(
|
|
83
|
-
"section",
|
|
84
|
-
{
|
|
85
|
-
id: `id_${id}`,
|
|
86
|
-
className: clsx(formContainer({ variant })),
|
|
87
|
-
children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
|
|
88
|
-
icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
|
|
89
|
-
/* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
|
|
90
|
-
/* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
|
|
91
|
-
description && /* @__PURE__ */ jsx(
|
|
92
|
-
"div",
|
|
93
|
-
{
|
|
94
|
-
className: clsx(
|
|
95
|
-
"text_center",
|
|
96
|
-
form,
|
|
97
|
-
descriptionField({ variant })
|
|
98
|
-
),
|
|
99
|
-
children: description
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
] }),
|
|
103
|
-
/* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
|
|
104
|
-
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
|
|
105
|
-
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
|
|
106
|
-
Input,
|
|
107
|
-
{
|
|
108
|
-
id: "property_Type",
|
|
109
|
-
...register("property_Type", { required: true }),
|
|
110
|
-
label: "Property Type",
|
|
111
|
-
sizes: "medium",
|
|
112
|
-
required: true,
|
|
113
|
-
error: !!errors.property_Type,
|
|
114
|
-
helperText: errors.property_Type?.message,
|
|
115
|
-
variant
|
|
116
|
-
}
|
|
117
|
-
) }),
|
|
118
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
119
|
-
Input,
|
|
120
|
-
{
|
|
121
|
-
id: "Occupancy",
|
|
122
|
-
...register("Occupancy", { required: true }),
|
|
123
|
-
label: "Property Usage",
|
|
124
|
-
sizes: "medium",
|
|
125
|
-
required: true,
|
|
126
|
-
error: !!errors.Occupancy,
|
|
127
|
-
helperText: errors.Occupancy?.message,
|
|
128
|
-
variant
|
|
129
|
-
}
|
|
130
|
-
) }),
|
|
131
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
132
|
-
Input,
|
|
133
|
-
{
|
|
134
|
-
id: "SalesPrice",
|
|
135
|
-
...register("SalesPrice", {
|
|
136
|
-
required: true,
|
|
137
|
-
validate: {
|
|
138
|
-
isValid: associatedEmail
|
|
139
|
-
}
|
|
140
|
-
}),
|
|
141
|
-
label: "Purchase Price",
|
|
142
|
-
sizes: "medium",
|
|
143
|
-
required: true,
|
|
144
|
-
error: !!errors.SalesPrice,
|
|
145
|
-
helperText: errors.SalesPrice?.message,
|
|
146
|
-
variant
|
|
147
|
-
}
|
|
148
|
-
) }),
|
|
149
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
150
|
-
InputPhone,
|
|
151
|
-
{
|
|
152
|
-
id: "DownPayment",
|
|
153
|
-
...register("DownPayment", {
|
|
154
|
-
required: true,
|
|
155
|
-
maxLength: 12
|
|
156
|
-
}),
|
|
157
|
-
label: "Down Payment",
|
|
158
|
-
sizes: "medium",
|
|
159
|
-
required: true,
|
|
160
|
-
error: !!errors.DownPayment,
|
|
161
|
-
helperText: errors.DownPayment?.message,
|
|
162
|
-
variant
|
|
163
|
-
}
|
|
164
|
-
) }),
|
|
165
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
166
|
-
InputPhone,
|
|
167
|
-
{
|
|
168
|
-
id: "CreditScore",
|
|
169
|
-
...register("CreditScore", {
|
|
170
|
-
required: true,
|
|
171
|
-
maxLength: 12
|
|
172
|
-
}),
|
|
173
|
-
label: "Credit Score",
|
|
174
|
-
sizes: "medium",
|
|
175
|
-
required: true,
|
|
176
|
-
error: !!errors.CreditScore,
|
|
177
|
-
helperText: errors.CreditScore?.message,
|
|
178
|
-
variant
|
|
179
|
-
}
|
|
180
|
-
) }),
|
|
181
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
182
|
-
InputPhone,
|
|
183
|
-
{
|
|
184
|
-
id: "ZipCode",
|
|
185
|
-
...register("ZipCode", { required: true, maxLength: 12 }),
|
|
186
|
-
label: "Zip Code",
|
|
187
|
-
sizes: "medium",
|
|
188
|
-
required: true,
|
|
189
|
-
error: !!errors.ZipCode,
|
|
190
|
-
helperText: errors.ZipCode?.message,
|
|
191
|
-
variant
|
|
192
|
-
}
|
|
193
|
-
) })
|
|
194
|
-
] }),
|
|
195
|
-
children,
|
|
196
|
-
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
197
|
-
/* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
|
|
198
|
-
Button,
|
|
199
|
-
{
|
|
200
|
-
color: getVariant(callToAction?.variant),
|
|
201
|
-
as: "button",
|
|
202
|
-
type: "submit",
|
|
203
|
-
disabled: !isValid || isSubmitting,
|
|
204
|
-
children: callToAction?.displayText
|
|
205
|
-
}
|
|
206
|
-
) })
|
|
207
|
-
] })
|
|
208
|
-
] }) })
|
|
209
|
-
},
|
|
210
|
-
id
|
|
211
|
-
);
|
|
212
|
-
};
|
|
213
|
-
export {
|
|
214
|
-
BlendPurchase
|
|
215
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FormProps } from './FormProps';
|
|
2
|
-
|
|
3
|
-
export type BlendPurchaseInputs = {
|
|
4
|
-
property_Type: string;
|
|
5
|
-
Occupancy: string;
|
|
6
|
-
SalesPrice: string;
|
|
7
|
-
DownPayment: string;
|
|
8
|
-
CreditScore: string;
|
|
9
|
-
ZipCode: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const BlendPurchase: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
4
|
-
import { Button } from "../Button/Button.js";
|
|
5
|
-
import "../Button/Button.css.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-use";
|
|
8
|
-
import "../Input/Checkbox.js";
|
|
9
|
-
import "../Input/CurrencyInput.js";
|
|
10
|
-
import "../Input/Dropdown.js";
|
|
11
|
-
/* empty css */
|
|
12
|
-
/* empty css */
|
|
13
|
-
import { Input } from "../Input/Input.js";
|
|
14
|
-
import "../Input/Input.css.js";
|
|
15
|
-
import "../Input/InputAmount.js";
|
|
16
|
-
import { InputPhone } from "../Input/InputPhone.js";
|
|
17
|
-
import "../Input/InputTextArea.js";
|
|
18
|
-
import "../icons/ArrowIcon/ArrowIcon.css.js";
|
|
19
|
-
import SvgAxosX from "../icons/AxosX/index.js";
|
|
20
|
-
import SvgComponent from "../icons/AxosX/Blue.js";
|
|
21
|
-
import "../icons/CheckIcon/CheckIcon.css.js";
|
|
22
|
-
/* empty css */
|
|
23
|
-
/* empty css */
|
|
24
|
-
/* empty css */
|
|
25
|
-
/* empty css */
|
|
26
|
-
import { associatedEmail } from "../utils/EverestValidity.js";
|
|
27
|
-
import "../utils/allowedAxosDomains.js";
|
|
28
|
-
import { getVariant } from "../utils/getVariant.js";
|
|
29
|
-
import clsx from "clsx";
|
|
30
|
-
import { useForm, FormProvider } from "react-hook-form";
|
|
31
|
-
import * as z from "zod";
|
|
32
|
-
import { formContainer, iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions } from "./Forms.css.js";
|
|
33
|
-
import { SalesforceSchema } from "./SalesforceFieldsForm.js";
|
|
34
|
-
const BlendPurchase = ({
|
|
35
|
-
icon = false,
|
|
36
|
-
children,
|
|
37
|
-
onSubmit = (values) => {
|
|
38
|
-
console.log(values);
|
|
39
|
-
},
|
|
40
|
-
disclosure,
|
|
41
|
-
variant: fullVariant = "primary",
|
|
42
|
-
headline,
|
|
43
|
-
description,
|
|
44
|
-
callToAction,
|
|
45
|
-
validateEmail,
|
|
46
|
-
id
|
|
47
|
-
}) => {
|
|
48
|
-
const schema = z.object({
|
|
49
|
-
property_Type: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
|
|
50
|
-
Occupancy: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Last Name is required." }),
|
|
51
|
-
SalesPrice: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
|
|
52
|
-
DownPayment: z.string().regex(/[\d-]{10}/).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
|
|
53
|
-
const removeDashes = val.replace(/-/gi, "");
|
|
54
|
-
if (removeDashes.length !== 10) {
|
|
55
|
-
ctx.addIssue({
|
|
56
|
-
code: z.ZodIssueCode.custom,
|
|
57
|
-
message: "Phone must have at least 10 and no more than 10 characters."
|
|
58
|
-
});
|
|
59
|
-
return z.NEVER;
|
|
60
|
-
}
|
|
61
|
-
return removeDashes;
|
|
62
|
-
}),
|
|
63
|
-
CreditScore: z.string(),
|
|
64
|
-
ZipCode: z.string()
|
|
65
|
-
});
|
|
66
|
-
const methods = useForm({
|
|
67
|
-
resolver: zodResolver(schema.merge(SalesforceSchema), {
|
|
68
|
-
async: true
|
|
69
|
-
}),
|
|
70
|
-
mode: "all",
|
|
71
|
-
defaultValues: {}
|
|
72
|
-
});
|
|
73
|
-
const {
|
|
74
|
-
handleSubmit,
|
|
75
|
-
register,
|
|
76
|
-
formState: { errors, isValid, isSubmitting }
|
|
77
|
-
} = methods;
|
|
78
|
-
const submitForm = async (data) => {
|
|
79
|
-
await onSubmit(data);
|
|
80
|
-
};
|
|
81
|
-
const variant = getVariant(fullVariant);
|
|
82
|
-
return /* @__PURE__ */ jsx(
|
|
83
|
-
"section",
|
|
84
|
-
{
|
|
85
|
-
id: `id_${id}`,
|
|
86
|
-
className: clsx(formContainer({ variant })),
|
|
87
|
-
children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
|
|
88
|
-
icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
|
|
89
|
-
/* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
|
|
90
|
-
/* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
|
|
91
|
-
description && /* @__PURE__ */ jsx(
|
|
92
|
-
"div",
|
|
93
|
-
{
|
|
94
|
-
className: clsx(
|
|
95
|
-
"text_center",
|
|
96
|
-
form,
|
|
97
|
-
descriptionField({ variant })
|
|
98
|
-
),
|
|
99
|
-
children: description
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
] }),
|
|
103
|
-
/* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
|
|
104
|
-
/* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
|
|
105
|
-
/* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
|
|
106
|
-
Input,
|
|
107
|
-
{
|
|
108
|
-
id: "property_Type",
|
|
109
|
-
...register("property_Type", { required: true }),
|
|
110
|
-
label: "Property Type",
|
|
111
|
-
sizes: "medium",
|
|
112
|
-
required: true,
|
|
113
|
-
error: !!errors.property_Type,
|
|
114
|
-
helperText: errors.property_Type?.message,
|
|
115
|
-
variant
|
|
116
|
-
}
|
|
117
|
-
) }),
|
|
118
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
119
|
-
Input,
|
|
120
|
-
{
|
|
121
|
-
id: "Occupancy",
|
|
122
|
-
...register("Occupancy", { required: true }),
|
|
123
|
-
label: "Property Usage",
|
|
124
|
-
sizes: "medium",
|
|
125
|
-
required: true,
|
|
126
|
-
error: !!errors.Occupancy,
|
|
127
|
-
helperText: errors.Occupancy?.message,
|
|
128
|
-
variant
|
|
129
|
-
}
|
|
130
|
-
) }),
|
|
131
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
132
|
-
Input,
|
|
133
|
-
{
|
|
134
|
-
id: "SalesPrice",
|
|
135
|
-
...register("SalesPrice", {
|
|
136
|
-
required: true,
|
|
137
|
-
validate: {
|
|
138
|
-
isValid: associatedEmail
|
|
139
|
-
}
|
|
140
|
-
}),
|
|
141
|
-
label: "Purchase Price",
|
|
142
|
-
sizes: "medium",
|
|
143
|
-
required: true,
|
|
144
|
-
error: !!errors.SalesPrice,
|
|
145
|
-
helperText: errors.SalesPrice?.message,
|
|
146
|
-
variant
|
|
147
|
-
}
|
|
148
|
-
) }),
|
|
149
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
150
|
-
InputPhone,
|
|
151
|
-
{
|
|
152
|
-
id: "DownPayment",
|
|
153
|
-
...register("DownPayment", {
|
|
154
|
-
required: true,
|
|
155
|
-
maxLength: 12
|
|
156
|
-
}),
|
|
157
|
-
label: "Down Payment",
|
|
158
|
-
sizes: "medium",
|
|
159
|
-
required: true,
|
|
160
|
-
error: !!errors.DownPayment,
|
|
161
|
-
helperText: errors.DownPayment?.message,
|
|
162
|
-
variant
|
|
163
|
-
}
|
|
164
|
-
) }),
|
|
165
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
166
|
-
InputPhone,
|
|
167
|
-
{
|
|
168
|
-
id: "CreditScore",
|
|
169
|
-
...register("CreditScore", {
|
|
170
|
-
required: true,
|
|
171
|
-
maxLength: 12
|
|
172
|
-
}),
|
|
173
|
-
label: "Credit Score",
|
|
174
|
-
sizes: "medium",
|
|
175
|
-
required: true,
|
|
176
|
-
error: !!errors.CreditScore,
|
|
177
|
-
helperText: errors.CreditScore?.message,
|
|
178
|
-
variant
|
|
179
|
-
}
|
|
180
|
-
) }),
|
|
181
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
182
|
-
InputPhone,
|
|
183
|
-
{
|
|
184
|
-
id: "ZipCode",
|
|
185
|
-
...register("ZipCode", { required: true, maxLength: 12 }),
|
|
186
|
-
label: "Zip Code",
|
|
187
|
-
sizes: "medium",
|
|
188
|
-
required: true,
|
|
189
|
-
error: !!errors.ZipCode,
|
|
190
|
-
helperText: errors.ZipCode?.message,
|
|
191
|
-
variant
|
|
192
|
-
}
|
|
193
|
-
) })
|
|
194
|
-
] }),
|
|
195
|
-
children,
|
|
196
|
-
/* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
|
|
197
|
-
/* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
|
|
198
|
-
Button,
|
|
199
|
-
{
|
|
200
|
-
color: getVariant(callToAction?.variant),
|
|
201
|
-
as: "button",
|
|
202
|
-
type: "submit",
|
|
203
|
-
disabled: !isValid || isSubmitting,
|
|
204
|
-
children: callToAction?.displayText
|
|
205
|
-
}
|
|
206
|
-
) })
|
|
207
|
-
] })
|
|
208
|
-
] }) })
|
|
209
|
-
},
|
|
210
|
-
id
|
|
211
|
-
);
|
|
212
|
-
};
|
|
213
|
-
export {
|
|
214
|
-
BlendPurchase
|
|
215
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const datePicker: string;
|