@axos-web-dev/shared-components 0.0.119 → 0.0.121

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 (70) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -0
  2. package/dist/Article/Article.js +8 -4
  3. package/dist/Button/Button.js +3 -2
  4. package/dist/Calculators/Calculator.js +1 -0
  5. package/dist/Carousel/index.js +5 -4
  6. package/dist/Chevron/index.js +3 -2
  7. package/dist/Comparison/Comparison.css.js +2 -2
  8. package/dist/Comparison/Comparison.js +1 -0
  9. package/dist/FaqAccordion/index.js +1 -0
  10. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +4 -3
  11. package/dist/Forms/ClearingForm.js +2 -2
  12. package/dist/Forms/CommercialDeposits.d.ts +18 -0
  13. package/dist/Forms/CommercialDeposits.js +326 -0
  14. package/dist/Forms/ContactUsBusiness.js +4 -3
  15. package/dist/Forms/ContactUsNMLSId.js +4 -3
  16. package/dist/Forms/CpraRequest.d.ts +3 -3
  17. package/dist/Forms/CpraRequest.js +9 -9
  18. package/dist/Forms/DealerServices.d.ts +1 -1
  19. package/dist/Forms/DealerServices.js +12 -8
  20. package/dist/Forms/EmailOnly.js +4 -3
  21. package/dist/Forms/Forms.css.d.ts +3 -0
  22. package/dist/Forms/Forms.css.js +9 -3
  23. package/dist/Forms/ScheduleCall.js +1 -0
  24. package/dist/Forms/ScheduleCallPremier.js +1 -0
  25. package/dist/Forms/SuccesForm.js +1 -0
  26. package/dist/Forms/index.d.ts +2 -0
  27. package/dist/Forms/index.js +7 -2
  28. package/dist/HeroBanner/HeroBanner.css.js +1 -1
  29. package/dist/Hyperlink/index.js +4 -3
  30. package/dist/ImageBillboard/ImageBillboard.css.js +1 -1
  31. package/dist/ImageLink/ImageLink.js +1 -0
  32. package/dist/ImageLink/ImageLinkSet.d.ts +1 -0
  33. package/dist/ImageLink/ImageLinkSet.js +3 -1
  34. package/dist/ImageLink/index.js +4 -3
  35. package/dist/Input/Input.css.js +1 -1
  36. package/dist/Input/InputProps.d.ts +0 -6
  37. package/dist/Insight/Featured/CategorySelector.css.js +1 -1
  38. package/dist/Insight/Featured/CategorySelector.js +1 -0
  39. package/dist/Insight/Featured/Featured.js +5 -4
  40. package/dist/Modal/Modal.js +4 -3
  41. package/dist/NavigationMenu/AxosBank/NavData.js +4 -3
  42. package/dist/NavigationMenu/AxosBank/SubNavBar.js +4 -3
  43. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  44. package/dist/SetContainer/SetContainer.js +1 -0
  45. package/dist/VideoTile/VideoInit.js +2 -1
  46. package/dist/VideoWrapper/index.js +1 -0
  47. package/dist/assets/Forms/Forms.css +22 -0
  48. package/dist/assets/PageNavItem/PageNavItem.css +1 -0
  49. package/dist/assets/PageNavSet/PageNavigationSet.css +1 -1
  50. package/dist/assets/SetContainer/SetContainer.css +0 -1
  51. package/dist/assets/Table/Table.css +8 -4
  52. package/dist/assets/VideoTile/VideoTile.css +5 -0
  53. package/dist/index.css.js +1 -1
  54. package/dist/main.js +7 -2
  55. package/dist/utils/allowedAxosDomains.js +2 -1
  56. package/package.json +17 -17
  57. package/dist/Forms/BlendPurchase.d.ts +0 -11
  58. package/dist/Forms/BlendPurchase.js +0 -215
  59. package/dist/Forms/BlendRefinance.d.ts +0 -11
  60. package/dist/Forms/BlendRefinance.js +0 -215
  61. package/dist/Input/DatePicker.css.d.ts +0 -1
  62. package/dist/Input/DatePicker.css.js +0 -6
  63. package/dist/Input/Datepicker.d.ts +0 -3
  64. package/dist/Input/Datepicker.js +0 -47
  65. package/dist/Input/InputDate.css.d.ts +0 -6
  66. package/dist/Input/InputDate.css.js +0 -15
  67. package/dist/Input/InputDate.d.ts +0 -3
  68. package/dist/Input/InputDate.js +0 -47
  69. package/dist/assets/Input/DatePicker.css +0 -95
  70. 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
- tr:has(> :last-child:nth-child(-n + 3)) td {
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;
package/dist/index.css.js CHANGED
@@ -1,3 +1,3 @@
1
- /* empty css */
2
1
  /* empty css */
2
+ /* empty css */
3
3
  /* empty css */
package/dist/main.js CHANGED
@@ -53,13 +53,14 @@ import { CpraRequest } from "./Forms/CpraRequest.js";
53
53
  import { DealerServices } from "./Forms/DealerServices.js";
54
54
  import { EmailOnly } from "./Forms/EmailOnly.js";
55
55
  import { EmailUs } from "./Forms/EmailUs.js";
56
- import { actions, checkbox_group, descriptionField, disclosureForm, form, formContainer, formWrapper, fullRowForm, headerContainer, headerForm, iconForm, one_row, ro_input, section_title, succes_check_mark, success_circle, success_icon, success_wrap } from "./Forms/Forms.css.js";
56
+ import { actions, checkbox_group, descriptionField, disclosureForm, form, formContainer, formWrapper, fullRowForm, headerContainer, headerForm, iconForm, one_row, pl_label, ro_input, section_title, succes_check_mark, success_circle, success_icon, success_wrap, x_input, xc_input } from "./Forms/Forms.css.js";
57
57
  import { QuickPricer } from "./Forms/QuickPricer.js";
58
58
  import { SalesforceFieldsForm, SalesforceSchema } from "./Forms/SalesforceFieldsForm.js";
59
59
  import { ScheduleCall } from "./Forms/ScheduleCall.js";
60
60
  import { ScheduleCallPremier } from "./Forms/ScheduleCallPremier.js";
61
61
  import { SuccesFormWrapper } from "./Forms/SuccesForm.js";
62
62
  import { WCPLSurvey } from "./Forms/WcplSurvey.js";
63
+ import { CommercialDeposits } from "./Forms/CommercialDeposits.js";
63
64
  import { HeroBanner } from "./HeroBanner/HeroBanner.js";
64
65
  import { headline_text, heroSupertag, hero_banner, hero_btns, hero_content, hero_embedded_image, hero_img, hero_text, hero_wrapper, logout, reversed, reversed_lg_image } from "./HeroBanner/HeroBanner.css.js";
65
66
  import { selection_headline_text, selection_section, selection_section_bg, selection_section_content, selection_section_icon, selection_section_icon_img } from "./HeroBanner/SelectionBanner.css.js";
@@ -203,6 +204,7 @@ export {
203
204
  default19 as ClockIcon,
204
205
  default10 as CloseIcon,
205
206
  CollectInformationAlert,
207
+ CommercialDeposits,
206
208
  CommercialLending,
207
209
  ComparisonSet,
208
210
  ContactCompany,
@@ -479,6 +481,7 @@ export {
479
481
  picker_navItem,
480
482
  picker_orient,
481
483
  picker_section,
484
+ pl_label,
482
485
  pn_btn,
483
486
  pn_link,
484
487
  point,
@@ -554,5 +557,7 @@ export {
554
557
  video_title,
555
558
  vidyard_height,
556
559
  w_100,
557
- wrapper
560
+ wrapper,
561
+ x_input,
562
+ xc_input
558
563
  };
@@ -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.119",
4
+ "version": "0.0.121",
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.5",
33
- "@react-input/number-format": "^1.0.27",
34
- "@storybook/icons": "^1.2.9",
35
- "@storybook/preview-api": "^8.2.9",
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.3",
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.52.1",
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.4"
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.14.11",
82
- "@types/react": "^18.3.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.3",
89
- "@vanilla-extract/recipes": "^0.5.2",
90
- "@vanilla-extract/vite-plugin": "^4.0.9",
91
- "@vitejs/plugin-react-swc": "^3.6.0",
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.0.11",
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.4.5",
107
+ "typescript": "^5.6.2",
108
108
  "typescript-plugin-css-modules": "^5.1.0",
109
- "vite": "^5.3.4",
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;
@@ -1,6 +0,0 @@
1
- /* empty css */
2
- /* empty css */
3
- var datePicker = "_1oit9ls0";
4
- export {
5
- datePicker
6
- };
@@ -1,3 +0,0 @@
1
- import { DatepickerInputProps } from './InputProps';
2
-
3
- export declare const DatePickerInput: (props: DatepickerInputProps) => import("react/jsx-runtime").JSX.Element;