@axos-web-dev/shared-components 0.0.136 → 0.0.138

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 (50) hide show
  1. package/dist/ATMLocator/ATMLocator.js +3 -2
  2. package/dist/Button/Button.js +1 -0
  3. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +45 -0
  4. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +37 -0
  5. package/dist/Calculators/AxosOneCalculator/index.d.ts +10 -0
  6. package/dist/Calculators/AxosOneCalculator/index.js +183 -0
  7. package/dist/Calculators/Calculator.js +12 -0
  8. package/dist/Calculators/index.d.ts +1 -0
  9. package/dist/Calculators/index.js +2 -0
  10. package/dist/Carousel/index.js +1 -0
  11. package/dist/Chevron/index.js +1 -0
  12. package/dist/Comparison/Comparison.js +1 -0
  13. package/dist/FaqAccordion/index.js +1 -0
  14. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
  15. package/dist/Forms/BlendPurchase.d.ts +11 -0
  16. package/dist/Forms/BlendPurchase.js +215 -0
  17. package/dist/Forms/BlendRefinance.d.ts +11 -0
  18. package/dist/Forms/BlendRefinance.js +215 -0
  19. package/dist/Forms/ContactUsBusiness.js +1 -0
  20. package/dist/Forms/ContactUsNMLSId.js +1 -0
  21. package/dist/Forms/EmailOnly.js +1 -0
  22. package/dist/Forms/SuccesForm.js +1 -0
  23. package/dist/Hyperlink/index.js +1 -0
  24. package/dist/ImageLink/ImageLink.js +1 -0
  25. package/dist/ImageLink/ImageLinkSet.js +1 -0
  26. package/dist/ImageLink/index.js +1 -0
  27. package/dist/Input/DatePicker.css.d.ts +1 -0
  28. package/dist/Input/DatePicker.css.js +6 -0
  29. package/dist/Input/Datepicker.d.ts +3 -0
  30. package/dist/Input/Datepicker.js +47 -0
  31. package/dist/Input/InputDate.css.d.ts +6 -0
  32. package/dist/Input/InputDate.css.js +15 -0
  33. package/dist/Input/InputDate.d.ts +3 -0
  34. package/dist/Input/InputDate.js +47 -0
  35. package/dist/Input/InputProps.d.ts +6 -0
  36. package/dist/Insight/Featured/CategorySelector.js +1 -0
  37. package/dist/Insight/Featured/Featured.js +1 -0
  38. package/dist/Modal/Modal.js +1 -0
  39. package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
  40. package/dist/NavigationMenu/AxosBank/SubNavBar.js +5 -2
  41. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  42. package/dist/SetContainer/SetContainer.js +1 -0
  43. package/dist/Table/Table.d.ts +1 -2
  44. package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +210 -0
  45. package/dist/assets/Input/DatePicker.css +95 -0
  46. package/dist/assets/Input/InputDate.css +39 -0
  47. package/dist/main.d.ts +2 -0
  48. package/dist/main.js +2 -0
  49. package/dist/utils/allowedAxosDomains.js +2 -1
  50. package/package.json +1 -1
@@ -24,9 +24,11 @@ import "../ArticlesSet/ArticlesSet.css.js";
24
24
  /* empty css */
25
25
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
26
26
  import clsx from "clsx";
27
+ import "../Table/Table.css.js";
28
+ import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
29
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
27
30
  import { calculator_headline, calculator_description } from "../Calculators/calculator.css.js";
28
31
  /* empty css */
29
- import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
30
32
  import "../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
31
33
  /* empty css */
32
34
  import "../Carousel/index.js";
@@ -88,7 +90,6 @@ import "react-slick";
88
90
  /* empty css */
89
91
  import "../StepItem/StepItem.css.js";
90
92
  import "../StepItemSet/StepItemSet.css.js";
91
- import "../Table/Table.css.js";
92
93
  /* empty css */
93
94
  /* empty css */
94
95
  /* empty css */
@@ -25,6 +25,7 @@ import "../Calculators/calculator.css.js";
25
25
  import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
26
26
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
27
27
  import "../Table/Table.css.js";
28
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
28
29
  import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
29
30
  import "@hookform/resolvers/zod";
30
31
  import "../Input/Checkbox.js";
@@ -0,0 +1,45 @@
1
+ export declare const ax1_container: string;
2
+ export declare const ax1_table_container: string;
3
+ export declare const ax1_calculator_wrapper: string;
4
+ export declare const ax1_input_container: string;
5
+ export declare const ax1_input_label: string;
6
+ export declare const ax1_calculator_input: string;
7
+ export declare const ax1_d_label: string;
8
+ export declare const ax1_m_label: string;
9
+ export declare const ax1_calculator_button: string;
10
+ export declare const ax1_calc_icon: string;
11
+ export declare const ax1_header_container: string;
12
+ export declare const ax1_header_calc: string;
13
+ export declare const ax1_calc_text: string;
14
+ export declare const ax1_description_text: import('@vanilla-extract/recipes').RuntimeFn<{
15
+ variant: {
16
+ primary: {
17
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
18
+ };
19
+ secondary: {
20
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
21
+ };
22
+ tertiary: {
23
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
24
+ };
25
+ quaternary: {
26
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
27
+ };
28
+ };
29
+ }>;
30
+ export declare const ax1_calc_disclosure: import('@vanilla-extract/recipes').RuntimeFn<{
31
+ variant: {
32
+ primary: {
33
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
34
+ };
35
+ secondary: {
36
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
37
+ };
38
+ tertiary: {
39
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
40
+ };
41
+ quaternary: {
42
+ color: `var(--${string})` | `var(--${string}, ${string})` | `var(--${string}, ${number})`;
43
+ };
44
+ };
45
+ }>;
@@ -0,0 +1,37 @@
1
+ /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
6
+ var ax1_container = "_11b2y8z0";
7
+ var ax1_table_container = "_11b2y8z1";
8
+ var ax1_calculator_wrapper = "_11b2y8z2";
9
+ var ax1_input_container = "_11b2y8z3";
10
+ var ax1_input_label = "_11b2y8z4";
11
+ var ax1_calculator_input = "_11b2y8z5";
12
+ var ax1_d_label = "_11b2y8z6";
13
+ var ax1_m_label = "_11b2y8z7";
14
+ var ax1_calculator_button = "_11b2y8z8";
15
+ var ax1_calc_icon = "_11b2y8z9";
16
+ var ax1_header_container = "_11b2y8za";
17
+ var ax1_header_calc = "_11b2y8zb";
18
+ var ax1_calc_text = "_11b2y8zc";
19
+ var ax1_description_text = createRuntimeFn({ defaultClassName: "_11b2y8zd", variantClassNames: { variant: { primary: "_11b2y8ze", secondary: "_11b2y8zf", tertiary: "_11b2y8zg", quaternary: "_11b2y8zh" } }, defaultVariants: {}, compoundVariants: [] });
20
+ var ax1_calc_disclosure = createRuntimeFn({ defaultClassName: "_11b2y8zi", variantClassNames: { variant: { primary: "_11b2y8zj", secondary: "_11b2y8zk", tertiary: "_11b2y8zl", quaternary: "_11b2y8zm" } }, defaultVariants: {}, compoundVariants: [] });
21
+ export {
22
+ ax1_calc_disclosure,
23
+ ax1_calc_icon,
24
+ ax1_calc_text,
25
+ ax1_calculator_button,
26
+ ax1_calculator_input,
27
+ ax1_calculator_wrapper,
28
+ ax1_container,
29
+ ax1_d_label,
30
+ ax1_description_text,
31
+ ax1_header_calc,
32
+ ax1_header_container,
33
+ ax1_input_container,
34
+ ax1_input_label,
35
+ ax1_m_label,
36
+ ax1_table_container
37
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React, FC } from 'react';
2
+
3
+ export interface AxosOneCalculatorProps {
4
+ headline?: React.ReactNode | string;
5
+ icon?: boolean;
6
+ bodyCopy?: React.ReactNode | string;
7
+ disclosure: React.ReactNode | string;
8
+ variant: string;
9
+ }
10
+ export declare const AxosOneCalculator: FC<AxosOneCalculatorProps>;
@@ -0,0 +1,183 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Button } from "../../Button/Button.js";
4
+ import "../../Button/Button.css.js";
5
+ import { useState } from "react";
6
+ import "react-use";
7
+ import "../../icons/ArrowIcon/ArrowIcon.css.js";
8
+ import SvgAxosX from "../../icons/AxosX/index.js";
9
+ import SvgComponent from "../../icons/AxosX/Blue.js";
10
+ import "../../icons/CheckIcon/CheckIcon.css.js";
11
+ /* empty css */
12
+ /* empty css */
13
+ /* empty css */
14
+ /* empty css */
15
+ import { Table, TableHead, TableRow, TableCell, TableBody } from "../../Table/Table.js";
16
+ import { headerCell } from "../../Table/Table.css.js";
17
+ import "../../utils/allowedAxosDomains.js";
18
+ import { getVariant } from "../../utils/getVariant.js";
19
+ import clsx from "clsx";
20
+ import { ax1_container, ax1_calc_icon, ax1_header_container, ax1_header_calc, ax1_calc_text, ax1_description_text, ax1_table_container, ax1_calculator_wrapper, ax1_input_container, ax1_input_label, ax1_calculator_input, ax1_calculator_button, ax1_d_label, ax1_m_label, ax1_calc_disclosure } from "./BalanceAPYCalculator.css.js";
21
+ const AxosOneCalculator = ({
22
+ headline,
23
+ bodyCopy,
24
+ disclosure,
25
+ icon,
26
+ variant
27
+ }) => {
28
+ const calc_variant = getVariant(variant);
29
+ const [balance, setBalance] = useState(1e4);
30
+ const [axbAPY, _setAxbAPY] = useState(4.53);
31
+ const [axbEarning, setAxbEarning] = useState(453);
32
+ const [chaseAPY, _setChaseAPY] = useState(0.01);
33
+ const [chaseEarning, setChaseEarning] = useState(1);
34
+ const [bofaAPY, _setBofaAPY] = useState(0.01);
35
+ const [bofaEarning, setBofaEarning] = useState(1);
36
+ const [fargoAPY, _setFargoAPY] = useState(0.05);
37
+ const [fargoEarning, setFargoEarning] = useState(5);
38
+ const removeNonNumeric = (value) => {
39
+ if (value === "") {
40
+ value = "0";
41
+ }
42
+ const removeNonNumericChars = value.replace(/\D/g, "");
43
+ const newValue = parseInt(removeNonNumericChars, 10);
44
+ setBalance(newValue);
45
+ return newValue;
46
+ };
47
+ const calculateBlance = (amount) => {
48
+ setAxbEarning(axbAPY / 100 * amount);
49
+ setChaseEarning(chaseAPY / 100 * amount);
50
+ setBofaEarning(bofaAPY / 100 * amount);
51
+ setFargoEarning(fargoAPY / 100 * amount);
52
+ };
53
+ const onUpdateBalance = (e) => {
54
+ const text = e.target.value;
55
+ const amount = removeNonNumeric(text);
56
+ if (amount === 0) {
57
+ setBalance(0);
58
+ }
59
+ };
60
+ return /* @__PURE__ */ jsx("section", { className: clsx(ax1_container), children: /* @__PURE__ */ jsxs("div", { className: clsx("containment"), children: [
61
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", ax1_calc_icon), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
62
+ (headline || bodyCopy) && /* @__PURE__ */ jsxs("div", { className: `${ax1_header_container} text_center`, children: [
63
+ headline && /* @__PURE__ */ jsx("h2", { className: clsx("header_2", ax1_header_calc), children: headline }),
64
+ bodyCopy && /* @__PURE__ */ jsx(
65
+ "div",
66
+ {
67
+ className: `${ax1_calc_text} ${ax1_description_text({ variant: calc_variant })} text_center`,
68
+ children: bodyCopy
69
+ }
70
+ )
71
+ ] }),
72
+ /* @__PURE__ */ jsxs("div", { className: clsx(ax1_table_container, "rounded"), children: [
73
+ /* @__PURE__ */ jsxs("div", { className: ax1_calculator_wrapper, children: [
74
+ /* @__PURE__ */ jsxs("div", { className: ax1_input_container, children: [
75
+ /* @__PURE__ */ jsx("label", { htmlFor: "amount", className: ax1_input_label, children: /* @__PURE__ */ jsx("span", { children: "Balance: $" }) }),
76
+ /* @__PURE__ */ jsx(
77
+ "input",
78
+ {
79
+ className: ax1_calculator_input,
80
+ id: "amount",
81
+ step: 100,
82
+ name: "amount",
83
+ value: balance,
84
+ onChange: onUpdateBalance
85
+ }
86
+ )
87
+ ] }),
88
+ /* @__PURE__ */ jsx(
89
+ Button,
90
+ {
91
+ className: ax1_calculator_button,
92
+ size: "large",
93
+ action: () => calculateBlance(balance),
94
+ children: "Calculate"
95
+ }
96
+ )
97
+ ] }),
98
+ /* @__PURE__ */ jsxs(
99
+ Table,
100
+ {
101
+ style: { width: "100%", marginTop: "32px" },
102
+ variant: "primary",
103
+ tableType: "Rate",
104
+ children: [
105
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
106
+ /* @__PURE__ */ jsxs(TableCell, { as: "th", variant: "primary", children: [
107
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "Bank" }),
108
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_m_label), children: "Bank" })
109
+ ] }),
110
+ /* @__PURE__ */ jsxs(TableCell, { as: "th", variant: "primary", children: [
111
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "Annual Percentage Yield*" }),
112
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_m_label), children: "APY*" })
113
+ ] }),
114
+ /* @__PURE__ */ jsxs(TableCell, { as: "th", variant: "primary", children: [
115
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "Annual Earnings" }),
116
+ /* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_m_label), children: "Earnings" })
117
+ ] })
118
+ ] }) }),
119
+ /* @__PURE__ */ jsxs(TableBody, { children: [
120
+ /* @__PURE__ */ jsxs(TableRow, { children: [
121
+ /* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsx("b", { children: "Axos Bank" }) }),
122
+ /* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
123
+ axbAPY.toFixed(2),
124
+ "%"
125
+ ] }) }),
126
+ /* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
127
+ "$",
128
+ axbEarning.toFixed(2)
129
+ ] }) })
130
+ ] }),
131
+ /* @__PURE__ */ jsxs(TableRow, { children: [
132
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
133
+ "Chase",
134
+ /* @__PURE__ */ jsx("sup", { children: "2" })
135
+ ] }),
136
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
137
+ chaseAPY.toFixed(2),
138
+ "%"
139
+ ] }),
140
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
141
+ "$",
142
+ chaseEarning.toFixed(2)
143
+ ] })
144
+ ] }),
145
+ /* @__PURE__ */ jsxs(TableRow, { children: [
146
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
147
+ "Bank of America",
148
+ /* @__PURE__ */ jsx("sup", { children: "3" })
149
+ ] }),
150
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
151
+ bofaAPY.toFixed(2),
152
+ "%"
153
+ ] }),
154
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
155
+ "$",
156
+ bofaEarning.toFixed(2)
157
+ ] })
158
+ ] }),
159
+ /* @__PURE__ */ jsxs(TableRow, { children: [
160
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
161
+ "Wells Fargo",
162
+ /* @__PURE__ */ jsx("sup", { children: "4" })
163
+ ] }),
164
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
165
+ fargoAPY.toFixed(2),
166
+ "%"
167
+ ] }),
168
+ /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
169
+ "$",
170
+ fargoEarning.toFixed(2)
171
+ ] })
172
+ ] })
173
+ ] })
174
+ ]
175
+ }
176
+ )
177
+ ] }),
178
+ disclosure && /* @__PURE__ */ jsx("div", { className: ax1_calc_disclosure({ variant: calc_variant }), children: disclosure })
179
+ ] }) });
180
+ };
181
+ export {
182
+ AxosOneCalculator
183
+ };
@@ -24,6 +24,7 @@ import "../ArticlesSet/ArticlesSet.css.js";
24
24
  /* empty css */
25
25
  import { AnnualFeeCalculator } from "./AnnualFeeCalculator/index.js";
26
26
  import { ApyCalculator } from "./ApyCalculator/index.js";
27
+ import { AxosOneCalculator } from "./AxosOneCalculator/index.js";
27
28
  import { BalanceAPYCalculator } from "./BalanceAPYCalculator/index.js";
28
29
  import { calculator_headline, calculator_description } from "./calculator.css.js";
29
30
  import { MarginTradingCalculator } from "./MarginTradingCalculator/index.js";
@@ -183,6 +184,17 @@ const Calculator = (props) => {
183
184
  icon
184
185
  }
185
186
  );
187
+ } else if (name === "APY Balance AxosOne") {
188
+ return /* @__PURE__ */ jsx(
189
+ AxosOneCalculator,
190
+ {
191
+ headline,
192
+ bodyCopy,
193
+ variant,
194
+ disclosure,
195
+ icon
196
+ }
197
+ );
186
198
  } else
187
199
  return /* @__PURE__ */ jsx("section", { id, children: /* @__PURE__ */ jsxs("div", { className: clsx("containment"), children: [
188
200
  /* @__PURE__ */ jsxs("div", { children: [
@@ -1,5 +1,6 @@
1
1
  export * from './AnnualFeeCalculator';
2
2
  export * from './ApyCalculator';
3
+ export * from './AxosOneCalculator';
3
4
  export * from './BalanceAPYCalculator';
4
5
  export * from './Calculator';
5
6
  export * from './calculator.css';
@@ -1,5 +1,6 @@
1
1
  import { AnnualFeeCalculator } from "./AnnualFeeCalculator/index.js";
2
2
  import { ApyCalculator } from "./ApyCalculator/index.js";
3
+ import { AxosOneCalculator } from "./AxosOneCalculator/index.js";
3
4
  import { BalanceAPYCalculator } from "./BalanceAPYCalculator/index.js";
4
5
  import { Calculator } from "./Calculator.js";
5
6
  import { calculator, calculator_description, calculator_headline } from "./calculator.css.js";
@@ -9,6 +10,7 @@ import { MonthlyPaymentCalculator } from "./MonthlyPaymentCalculator/index.js";
9
10
  export {
10
11
  AnnualFeeCalculator,
11
12
  ApyCalculator,
13
+ AxosOneCalculator,
12
14
  BalanceAPYCalculator,
13
15
  Calculator,
14
16
  MarginTradingCalculator,
@@ -31,6 +31,7 @@ import "../Calculators/calculator.css.js";
31
31
  import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
32
32
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
33
33
  import "../Table/Table.css.js";
34
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
34
35
  import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
35
36
  import "@hookform/resolvers/zod";
36
37
  import "../Input/Checkbox.js";
@@ -27,6 +27,7 @@ import "../Calculators/calculator.css.js";
27
27
  import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
28
28
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
29
29
  import "../Table/Table.css.js";
30
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
30
31
  import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
31
32
  import "@hookform/resolvers/zod";
32
33
  import "../Input/Checkbox.js";
@@ -25,6 +25,7 @@ import "../Calculators/calculator.css.js";
25
25
  import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
26
26
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
27
27
  import "../Table/Table.css.js";
28
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
28
29
  import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
29
30
  import "@hookform/resolvers/zod";
30
31
  import "../Input/Checkbox.js";
@@ -25,6 +25,7 @@ import "../Calculators/calculator.css.js";
25
25
  import "../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
26
26
  import "../Calculators/ApyCalculator/ApyCalculator.css.js";
27
27
  import "../Table/Table.css.js";
28
+ import "../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
28
29
  import "../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
29
30
  import "@hookform/resolvers/zod";
30
31
  import "../Input/Checkbox.js";
@@ -26,6 +26,7 @@ import "../../Calculators/calculator.css.js";
26
26
  import "../../Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js";
27
27
  import "../../Calculators/ApyCalculator/ApyCalculator.css.js";
28
28
  import "../../Table/Table.css.js";
29
+ import "../../Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js";
29
30
  import "../../Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.js";
30
31
  import "@hookform/resolvers/zod";
31
32
  import "../../Input/Checkbox.js";
@@ -0,0 +1,11 @@
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;
@@ -0,0 +1,215 @@
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
+ };
@@ -0,0 +1,11 @@
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;