@axos-web-dev/shared-components 0.0.81 → 0.0.83
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/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.js +35 -0
- package/dist/{AnnualFeeCalculator → Calculators/AnnualFeeCalculator}/index.d.ts +1 -1
- package/dist/{AnnualFeeCalculator → Calculators/AnnualFeeCalculator}/index.js +4 -4
- package/dist/Calculators/ApyCalculator/ApyCalculator.css.js +50 -0
- package/dist/{ApyCalculator → Calculators/ApyCalculator}/index.d.ts +2 -2
- package/dist/{ApyCalculator → Calculators/ApyCalculator}/index.js +5 -5
- package/dist/Calculators/Calculator.d.ts +1 -1
- package/dist/Calculators/Calculator.js +53 -39
- package/dist/Calculators/MarginTradingCalculator/MarginTradingCalculator.css.d.ts +26 -0
- package/dist/Calculators/MarginTradingCalculator/MarginTradingCalculator.css.js +55 -0
- package/dist/Calculators/MarginTradingCalculator/index.d.ts +9 -0
- package/dist/Calculators/MarginTradingCalculator/index.js +409 -0
- package/dist/Calculators/MaxLoanCalculator/index.d.ts +8 -0
- package/dist/Calculators/MaxLoanCalculator/index.js +216 -0
- package/dist/{MonthlyPaymentCalculator → Calculators/MonthlyPaymentCalculator}/MonthlyPaymentCalculator.css.d.ts +1 -0
- package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +24 -0
- package/dist/{MonthlyPaymentCalculator → Calculators/MonthlyPaymentCalculator}/index.js +5 -5
- package/dist/Carousel/index.js +9 -8
- package/dist/Chevron/index.js +12 -11
- package/dist/Comparison/Comparison.js +4 -3
- package/dist/Comparison/ComparisonSet.js +8 -7
- package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +11 -10
- package/dist/Forms/ContactUsAAS.js +9 -8
- package/dist/Forms/ContactUsBusiness.js +9 -8
- package/dist/Forms/ContactUsNMLSId.js +9 -8
- package/dist/Forms/EmailOnly.js +9 -8
- package/dist/Forms/SuccesForm.js +5 -4
- package/dist/Hyperlink/index.js +12 -11
- package/dist/ImageLink/ImageLink.js +5 -4
- package/dist/ImageLink/ImageLinkSet.js +4 -3
- package/dist/ImageLink/index.js +10 -9
- package/dist/Modal/Modal.js +9 -8
- package/dist/NavigationMenu/AxosAdvisorServices/index.js +0 -9
- package/dist/NavigationMenu/AxosBank/SubNavBar.js +11 -10
- package/dist/SetContainer/SetContainer.js +5 -4
- package/dist/assets/{AnnualFeeCalculator → Calculators/AnnualFeeCalculator}/AnnualFeeCalculator.css +25 -25
- package/dist/assets/{ApyCalculator → Calculators/ApyCalculator}/ApyCalculator.css +37 -36
- package/dist/assets/Calculators/MarginTradingCalculator/MarginTradingCalculator.css +107 -0
- package/dist/assets/{MonthlyPaymentCalculator → Calculators/MonthlyPaymentCalculator}/MonthlyPaymentCalculator.css +18 -14
- package/dist/main.d.ts +4 -1
- package/dist/main.js +7 -1
- package/package.json +111 -111
- package/dist/AnnualFeeCalculator/AnnualFeeCalculator.css.js +0 -35
- package/dist/ApyCalculator/ApyCalculator.css.js +0 -50
- package/dist/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js +0 -22
- /package/dist/{AnnualFeeCalculator → Calculators/AnnualFeeCalculator}/AnnualFeeCalculator.css.d.ts +0 -0
- /package/dist/{ApyCalculator → Calculators/ApyCalculator}/ApyCalculator.css.d.ts +0 -0
- /package/dist/{MonthlyPaymentCalculator → Calculators/MonthlyPaymentCalculator}/index.d.ts +0 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { container, field_row, marketingTile, bodyContent, header_theme } from "../ApyCalculator/ApyCalculator.css.js";
|
|
4
|
+
import { Button } from "../../Button/Button.js";
|
|
5
|
+
import { button } from "../../Button/Button.css.js";
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import "react-use";
|
|
8
|
+
import { Chevron } from "../../Chevron/index.js";
|
|
9
|
+
import { content, headerIconBillboard, buttons } from "../../IconBillboard/IconBillboard.css.js";
|
|
10
|
+
import { getVariant } from "../../utils/getVariant.js";
|
|
11
|
+
import { px40, fc1023, w100, bb_gray, fb50, r400_fs, fs36, green, h50, r603_fs24, mx1, table, r502_fs12, tc, bb0, btl, w25, btml, btr, bbl, bbml, bbr, savingsSummary, w50, g24, mtc } from "./MarginTradingCalculator.css.js";
|
|
12
|
+
const MarginTradingCalculator = ({
|
|
13
|
+
marketingTiles,
|
|
14
|
+
variant
|
|
15
|
+
}) => {
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const cashVal = document.querySelector("#accCashVal");
|
|
18
|
+
const secVal = document.querySelector("#accSecVal");
|
|
19
|
+
const borrowedAmt = document.querySelector("#borrowedAmt");
|
|
20
|
+
const purchasedAmt = document.querySelector("#purchasedAmt");
|
|
21
|
+
const duration = document.querySelector("#duration");
|
|
22
|
+
const calculateBtn = document.querySelector("#calculateBtn");
|
|
23
|
+
const axsCell = document.querySelector("#axStd");
|
|
24
|
+
const axeCell = document.querySelector("#axElt");
|
|
25
|
+
const tdCell = document.querySelector("#TDA");
|
|
26
|
+
const etCell = document.querySelector("#eTrd");
|
|
27
|
+
const errorMsg = document.querySelector("#errMsg");
|
|
28
|
+
const eliteSavings = document.querySelector("#eliteSavings");
|
|
29
|
+
const upTo = document.querySelector(".upto");
|
|
30
|
+
const over500 = document.querySelector(".over500");
|
|
31
|
+
const savingsSummary2 = document.querySelector(".savingsSummary");
|
|
32
|
+
if (calculateBtn) {
|
|
33
|
+
calculateBtn.addEventListener("click", () => {
|
|
34
|
+
calculateBuy();
|
|
35
|
+
calculateBorrow();
|
|
36
|
+
borrowedAmtChecker();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const usd = new Intl.NumberFormat("en-US", {
|
|
40
|
+
style: "currency",
|
|
41
|
+
currency: "USD"
|
|
42
|
+
});
|
|
43
|
+
const calculateBuy = () => {
|
|
44
|
+
if (cashVal && secVal && purchasedAmt && duration) {
|
|
45
|
+
if (Number(cashVal.value) > 0 || Number(secVal.value) > 0) {
|
|
46
|
+
purchasedAmt.innerHTML = usd.format(
|
|
47
|
+
Number(cashVal.value) * 2 + Number(secVal.value)
|
|
48
|
+
);
|
|
49
|
+
if (!duration.value)
|
|
50
|
+
duration.value = "30";
|
|
51
|
+
populateTable();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const calculateBorrow = () => {
|
|
56
|
+
if (cashVal && secVal && borrowedAmt && duration) {
|
|
57
|
+
if (Number(cashVal.value) > 0 || Number(secVal.value) > 0) {
|
|
58
|
+
borrowedAmt.innerHTML = usd.format(
|
|
59
|
+
Number(cashVal.value) + Number(secVal.value)
|
|
60
|
+
);
|
|
61
|
+
if (!duration.value)
|
|
62
|
+
duration.value = "30";
|
|
63
|
+
populateTable();
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
let savings;
|
|
68
|
+
const populateTable = () => {
|
|
69
|
+
const rateTiers = {
|
|
70
|
+
1: { axs: 13, axe: 12.5, td: 13.575, et: 14.2 },
|
|
71
|
+
2: { axs: 13, axe: 12.5, td: 13.575, et: 13.95 },
|
|
72
|
+
3: { axs: 12.5, axe: 12, td: 13.075, et: 13.7 },
|
|
73
|
+
4: { axs: 12.5, axe: 12, td: 12.125, et: 13.2 },
|
|
74
|
+
5: { axs: 12, axe: 11.5, td: 12.075, et: 12.7 },
|
|
75
|
+
6: { axs: 12, axe: 11.5, td: 12.75, et: 12.2 },
|
|
76
|
+
7: { axs: 11.5, axe: 11, td: "N/A", et: "N/A" },
|
|
77
|
+
8: { axs: 11, axe: 10.75, td: "N/A", et: "N/A" }
|
|
78
|
+
};
|
|
79
|
+
if (cashVal && secVal && axsCell && axeCell && tdCell && etCell && duration) {
|
|
80
|
+
const totalValue = Number(cashVal.value) + Number(secVal.value);
|
|
81
|
+
if (totalValue > 1999 && totalValue < 1e4) {
|
|
82
|
+
axsCell.innerHTML = (totalValue * rateTiers[1].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
83
|
+
axeCell.innerHTML = (totalValue * rateTiers[1].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
84
|
+
tdCell.innerHTML = (totalValue * rateTiers[1].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
85
|
+
etCell.innerHTML = (totalValue * rateTiers[1].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
86
|
+
savings = (rateTiers[1].td - rateTiers[1].axe) / ((rateTiers[1].td + rateTiers[1].axe) / 2) * 100;
|
|
87
|
+
} else if (totalValue > 9999 && totalValue < 25e3) {
|
|
88
|
+
axsCell.innerHTML = (totalValue * rateTiers[2].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
89
|
+
axeCell.innerHTML = (totalValue * rateTiers[2].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
90
|
+
tdCell.innerHTML = (totalValue * rateTiers[2].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
91
|
+
etCell.innerHTML = (totalValue * rateTiers[2].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
92
|
+
savings = (rateTiers[2].td - rateTiers[2].axe) / ((rateTiers[2].td + rateTiers[2].axe) / 2) * 100;
|
|
93
|
+
} else if (totalValue > 24999 && totalValue < 5e4) {
|
|
94
|
+
axsCell.innerHTML = (totalValue * rateTiers[3].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
95
|
+
axeCell.innerHTML = (totalValue * rateTiers[3].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
96
|
+
tdCell.innerHTML = (totalValue * rateTiers[3].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
97
|
+
etCell.innerHTML = (totalValue * rateTiers[3].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
98
|
+
savings = (rateTiers[3].td - rateTiers[3].axe) / ((rateTiers[3].td + rateTiers[3].axe) / 2) * 100;
|
|
99
|
+
} else if (totalValue > 49999 && totalValue < 1e5) {
|
|
100
|
+
axsCell.innerHTML = (totalValue * rateTiers[4].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
101
|
+
axeCell.innerHTML = (totalValue * rateTiers[4].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
102
|
+
tdCell.innerHTML = (totalValue * rateTiers[4].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
103
|
+
etCell.innerHTML = (totalValue * rateTiers[4].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
104
|
+
savings = (rateTiers[4].td - rateTiers[4].axe) / ((rateTiers[4].td + rateTiers[4].axe) / 2) * 100;
|
|
105
|
+
} else if (totalValue > 99999 && totalValue < 25e4) {
|
|
106
|
+
axsCell.innerHTML = (totalValue * rateTiers[5].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
107
|
+
axeCell.innerHTML = (totalValue * rateTiers[5].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
108
|
+
tdCell.innerHTML = (totalValue * rateTiers[5].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
109
|
+
etCell.innerHTML = (totalValue * rateTiers[5].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
110
|
+
savings = (rateTiers[5].td - rateTiers[5].axe) / ((rateTiers[5].td + rateTiers[5].axe) / 2) * 100;
|
|
111
|
+
} else if (totalValue > 249999 && totalValue < 5e5) {
|
|
112
|
+
axsCell.innerHTML = (totalValue * rateTiers[6].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
113
|
+
axeCell.innerHTML = (totalValue * rateTiers[6].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
114
|
+
tdCell.innerHTML = (totalValue * rateTiers[6].td / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
115
|
+
etCell.innerHTML = (totalValue * rateTiers[6].et / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
116
|
+
savings = (rateTiers[6].td - rateTiers[6].axe) / ((rateTiers[6].td + rateTiers[6].axe) / 2) * 100;
|
|
117
|
+
} else if (totalValue > 499999 && totalValue < 1e6) {
|
|
118
|
+
axsCell.innerHTML = (totalValue * rateTiers[7].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
119
|
+
axeCell.innerHTML = (totalValue * rateTiers[7].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
120
|
+
tdCell.innerHTML = "N/A";
|
|
121
|
+
etCell.innerHTML = "N/A";
|
|
122
|
+
} else if (totalValue > 999999) {
|
|
123
|
+
axsCell.innerHTML = (totalValue * rateTiers[8].axs / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
124
|
+
axeCell.innerHTML = (totalValue * rateTiers[8].axe / 100 / 360 * Number(duration.value)).toFixed(2);
|
|
125
|
+
tdCell.innerHTML = "N/A";
|
|
126
|
+
etCell.innerHTML = "N/A";
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
calculateEliteSavings();
|
|
130
|
+
};
|
|
131
|
+
duration?.addEventListener("input", () => {
|
|
132
|
+
if (duration && Number(duration.value) < 1) {
|
|
133
|
+
duration.value = "";
|
|
134
|
+
clearTbl();
|
|
135
|
+
} else {
|
|
136
|
+
if (calculateBtn)
|
|
137
|
+
calculateBtn.click();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const borrowedAmtChecker = () => {
|
|
141
|
+
if (borrowedAmt && cashVal && secVal) {
|
|
142
|
+
if (errorMsg && Number(cashVal.value) + Number(secVal.value) / 2 < 2e3) {
|
|
143
|
+
errorMsg.innerHTML = "* Borrowed amount must be at least $2000";
|
|
144
|
+
clearTbl();
|
|
145
|
+
} else if (errorMsg) {
|
|
146
|
+
errorMsg.innerHTML = "";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
const clearTbl = () => {
|
|
151
|
+
if (axsCell && axeCell && tdCell && etCell && upTo && savingsSummary2 && over500) {
|
|
152
|
+
axsCell.innerHTML = "";
|
|
153
|
+
axeCell.innerHTML = "";
|
|
154
|
+
tdCell.innerHTML = "";
|
|
155
|
+
etCell.innerHTML = "";
|
|
156
|
+
upTo.classList.add("hide");
|
|
157
|
+
savingsSummary2.classList.add("gradient_text", "green");
|
|
158
|
+
over500.classList.add("hide");
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const calculateEliteSavings = () => {
|
|
162
|
+
if (etCell && eliteSavings && axsCell && axeCell && tdCell && etCell && duration) {
|
|
163
|
+
eliteSavings.innerHTML = `${Number(savings).toFixed(2)}%`;
|
|
164
|
+
if (etCell.innerHTML !== "N/A") {
|
|
165
|
+
upTo?.classList.remove("hide");
|
|
166
|
+
savingsSummary2?.classList.remove("gradient_text", "green");
|
|
167
|
+
over500?.classList.add("hide");
|
|
168
|
+
} else {
|
|
169
|
+
upTo?.classList.add("hide");
|
|
170
|
+
savingsSummary2?.classList.add("gradient_text", "green");
|
|
171
|
+
over500?.classList.remove("hide");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (cashVal && secVal && Number(cashVal.value) + Number(secVal.value) / 2 < 2e3)
|
|
175
|
+
clearTbl();
|
|
176
|
+
};
|
|
177
|
+
if (cashVal) {
|
|
178
|
+
cashVal.addEventListener("input", () => {
|
|
179
|
+
const inputElement = cashVal;
|
|
180
|
+
const max = parseInt(inputElement.max || "0");
|
|
181
|
+
if (parseInt(inputElement.value) > max) {
|
|
182
|
+
inputElement.value = max.toString();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
if (secVal) {
|
|
187
|
+
secVal.addEventListener("input", () => {
|
|
188
|
+
const inputElement = secVal;
|
|
189
|
+
const max = parseInt(inputElement.max || "0");
|
|
190
|
+
if (parseInt(inputElement.value) > max) {
|
|
191
|
+
inputElement.value = max.toString();
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (duration) {
|
|
196
|
+
duration.addEventListener("input", () => {
|
|
197
|
+
const inputElement = duration;
|
|
198
|
+
const max = parseInt(inputElement.max || "0");
|
|
199
|
+
if (parseInt(inputElement.value) > max) {
|
|
200
|
+
inputElement.value = max.toString();
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}, []);
|
|
205
|
+
const calculator_variant = getVariant(variant);
|
|
206
|
+
console.log("marketingtiles: ", marketingTiles);
|
|
207
|
+
return /* @__PURE__ */ jsx(
|
|
208
|
+
"section",
|
|
209
|
+
{
|
|
210
|
+
className: `section_spacer ${px40} ${container({ variant: getVariant(variant) })}`,
|
|
211
|
+
children: /* @__PURE__ */ jsx("div", { className: `containment`, children: /* @__PURE__ */ jsxs("div", { className: `flex ${fc1023}`, children: [
|
|
212
|
+
/* @__PURE__ */ jsxs("div", { className: w100, children: [
|
|
213
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
214
|
+
/* @__PURE__ */ jsx("h2", { className: "header_2 gradient_text", children: "How much can I buy or borrow using margin?" }),
|
|
215
|
+
/* @__PURE__ */ jsxs("div", { className: `${field_row} flex_col`, children: [
|
|
216
|
+
/* @__PURE__ */ jsx("label", { className: "input_label", htmlFor: "accCashVal", children: "Account Cash Value" }),
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
"input",
|
|
219
|
+
{
|
|
220
|
+
className: "bordered",
|
|
221
|
+
type: "number",
|
|
222
|
+
id: "accCashVal",
|
|
223
|
+
max: 999999999e-2
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ jsxs("div", { className: `${field_row} flex_col`, children: [
|
|
228
|
+
/* @__PURE__ */ jsxs("label", { className: "input_label", htmlFor: "accSecVal", children: [
|
|
229
|
+
"Account Securities Value",
|
|
230
|
+
/* @__PURE__ */ jsx("sup", { children: "2" })
|
|
231
|
+
] }),
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
"input",
|
|
234
|
+
{
|
|
235
|
+
className: "bordered",
|
|
236
|
+
type: "number",
|
|
237
|
+
id: "accSecVal",
|
|
238
|
+
max: 999999999e-2
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ jsx("div", { className: `center middle push_up_32`, children: /* @__PURE__ */ jsx(
|
|
243
|
+
"input",
|
|
244
|
+
{
|
|
245
|
+
className: `${button({ color: "primary", size: "medium", rounded: "medium" })} center`,
|
|
246
|
+
type: "button",
|
|
247
|
+
value: "Calculate",
|
|
248
|
+
id: "calculateBtn"
|
|
249
|
+
}
|
|
250
|
+
) }),
|
|
251
|
+
/* @__PURE__ */ jsxs("div", { className: `flex push_up_32 ${bb_gray}`, children: [
|
|
252
|
+
/* @__PURE__ */ jsxs("h3", { className: `flex_col ${fb50} ${r400_fs}`, children: [
|
|
253
|
+
"Purchased Amount:",
|
|
254
|
+
" ",
|
|
255
|
+
/* @__PURE__ */ jsx(
|
|
256
|
+
"span",
|
|
257
|
+
{
|
|
258
|
+
id: "purchasedAmt",
|
|
259
|
+
className: `gradient_text ${fs36} ${green} ${h50} ${r603_fs24}`
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
] }),
|
|
263
|
+
/* @__PURE__ */ jsxs("h3", { className: `flex_col ${fb50} ${r400_fs}`, children: [
|
|
264
|
+
"Borrowed Amount:",
|
|
265
|
+
" ",
|
|
266
|
+
/* @__PURE__ */ jsx(
|
|
267
|
+
"span",
|
|
268
|
+
{
|
|
269
|
+
id: "borrowedAmt",
|
|
270
|
+
className: `gradient_text ${fs36} ${green} ${h50} ${r603_fs24}`
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] })
|
|
274
|
+
] }),
|
|
275
|
+
/* @__PURE__ */ jsx("h2", { className: "header_2 push_up_32 gradient_text", children: "How much will it cost me?" }),
|
|
276
|
+
/* @__PURE__ */ jsxs("div", { className: `${field_row} flex_col`, children: [
|
|
277
|
+
/* @__PURE__ */ jsx("label", { className: "input_label", htmlFor: "duration", children: "Duration (days)" }),
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
"input",
|
|
280
|
+
{
|
|
281
|
+
className: "bordered",
|
|
282
|
+
type: "number",
|
|
283
|
+
id: "duration",
|
|
284
|
+
min: 0,
|
|
285
|
+
max: 9999
|
|
286
|
+
}
|
|
287
|
+
)
|
|
288
|
+
] })
|
|
289
|
+
] }),
|
|
290
|
+
/* @__PURE__ */ jsxs("p", { className: mx1, children: [
|
|
291
|
+
"See how Axos Invest rates compare to a few of our competitors.",
|
|
292
|
+
/* @__PURE__ */ jsx("sup", { children: "3" })
|
|
293
|
+
] }),
|
|
294
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
295
|
+
/* @__PURE__ */ jsx("div", { id: "errMsg" }),
|
|
296
|
+
/* @__PURE__ */ jsxs("table", { className: `${table} ${r502_fs12}`, children: [
|
|
297
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
298
|
+
/* @__PURE__ */ jsx("th", { className: `ax-th ${tc} ${bb0} ${btl} ${w25}`, children: "Axos Standard" }),
|
|
299
|
+
/* @__PURE__ */ jsx("th", { className: `ax-th ${tc} ${bb0} ${btml} ${w25}`, children: "Axos Elite" }),
|
|
300
|
+
/* @__PURE__ */ jsx("th", { className: `${tc} ${bb0} ${w25}`, children: "TD Ameritrade" }),
|
|
301
|
+
/* @__PURE__ */ jsx("th", { className: `${tc} ${bb0} ${btr} ${w25}`, children: "E*TRADE" })
|
|
302
|
+
] }) }),
|
|
303
|
+
/* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
304
|
+
/* @__PURE__ */ jsx("td", { className: `${tc} ${bbl}`, "data-label": "Axos Standard", children: /* @__PURE__ */ jsx("span", { id: "axStd" }) }),
|
|
305
|
+
/* @__PURE__ */ jsx(
|
|
306
|
+
"td",
|
|
307
|
+
{
|
|
308
|
+
className: `gradient_text ${tc} ${bbml}`,
|
|
309
|
+
id: "eltTd",
|
|
310
|
+
"data-label": "Axos Elite",
|
|
311
|
+
children: /* @__PURE__ */ jsx("span", { className: "ax-td", id: "axElt" })
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
/* @__PURE__ */ jsx("td", { className: `${tc}`, "data-label": "TD Ameritrade", children: /* @__PURE__ */ jsx("span", { id: "TDA" }) }),
|
|
315
|
+
/* @__PURE__ */ jsx("td", { className: `${tc} ${bbr}`, "data-label": "E*TRADE", children: /* @__PURE__ */ jsx("span", { id: "eTrd" }) })
|
|
316
|
+
] }) })
|
|
317
|
+
] }),
|
|
318
|
+
/* @__PURE__ */ jsxs("div", { className: "text_center push_up_32", children: [
|
|
319
|
+
/* @__PURE__ */ jsxs(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: `savingsSummary gradient_text ${savingsSummary}`,
|
|
323
|
+
children: [
|
|
324
|
+
"Save",
|
|
325
|
+
" ",
|
|
326
|
+
/* @__PURE__ */ jsxs("span", { className: "upto hide", children: [
|
|
327
|
+
"up to",
|
|
328
|
+
" ",
|
|
329
|
+
/* @__PURE__ */ jsx(
|
|
330
|
+
"span",
|
|
331
|
+
{
|
|
332
|
+
id: "eliteSavings",
|
|
333
|
+
className: `gradient_text ${green} ${fs36}`
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
] }),
|
|
337
|
+
" ",
|
|
338
|
+
"by using",
|
|
339
|
+
" ",
|
|
340
|
+
/* @__PURE__ */ jsx("span", { className: "savingsSummaryElite", children: "Axos Elite" }),
|
|
341
|
+
"!"
|
|
342
|
+
]
|
|
343
|
+
}
|
|
344
|
+
),
|
|
345
|
+
/* @__PURE__ */ jsxs("div", { className: "over500 hide push_up", children: [
|
|
346
|
+
"Balance over $500k? Talk to us about our tiered rates and how we compare. ",
|
|
347
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
348
|
+
/* @__PURE__ */ jsx("a", { href: "tel:1-888-585-4965", className: "supNum", children: "1-888-585-4965" }),
|
|
349
|
+
" ",
|
|
350
|
+
/* @__PURE__ */ jsx("a", { href: "mailto:support@axosinvest.com", children: "support@axosinvest.com" })
|
|
351
|
+
] })
|
|
352
|
+
] })
|
|
353
|
+
] })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ jsx("div", { className: `flex_col ml_24 ${w50} ${g24} ${mtc}`, children: marketingTiles && marketingTiles?.map(
|
|
356
|
+
({ id, headline, bodyCopy, callToActionRow }) => /* @__PURE__ */ jsxs(
|
|
357
|
+
"div",
|
|
358
|
+
{
|
|
359
|
+
className: `${container({ variant: getVariant(variant) })} ${marketingTile} rounded bordered flex_col`,
|
|
360
|
+
children: [
|
|
361
|
+
/* @__PURE__ */ jsx("div", { className: `${content} ${bodyContent}`, children: /* @__PURE__ */ jsxs("div", { className: headerIconBillboard, children: [
|
|
362
|
+
/* @__PURE__ */ jsx(
|
|
363
|
+
"div",
|
|
364
|
+
{
|
|
365
|
+
className: `header_3 ${header_theme({ variant: calculator_variant })}`,
|
|
366
|
+
children: headline
|
|
367
|
+
}
|
|
368
|
+
),
|
|
369
|
+
/* @__PURE__ */ jsx("div", { children: bodyCopy })
|
|
370
|
+
] }) }),
|
|
371
|
+
callToActionRow && /* @__PURE__ */ jsx("div", { className: `${buttons} middle`, children: callToActionRow.map(
|
|
372
|
+
({
|
|
373
|
+
id: id2,
|
|
374
|
+
variant: variant2,
|
|
375
|
+
displayText,
|
|
376
|
+
targetUrl,
|
|
377
|
+
type
|
|
378
|
+
}) => type === "Button" ? /* @__PURE__ */ jsx(
|
|
379
|
+
Button,
|
|
380
|
+
{
|
|
381
|
+
targetUrl,
|
|
382
|
+
color: getVariant(variant2),
|
|
383
|
+
size: "medium",
|
|
384
|
+
rounded: "medium",
|
|
385
|
+
children: displayText
|
|
386
|
+
},
|
|
387
|
+
id2
|
|
388
|
+
) : /* @__PURE__ */ jsx(
|
|
389
|
+
Chevron,
|
|
390
|
+
{
|
|
391
|
+
targetUrl,
|
|
392
|
+
variant: getVariant(variant2),
|
|
393
|
+
children: displayText
|
|
394
|
+
},
|
|
395
|
+
id2
|
|
396
|
+
)
|
|
397
|
+
) })
|
|
398
|
+
]
|
|
399
|
+
},
|
|
400
|
+
id
|
|
401
|
+
)
|
|
402
|
+
) })
|
|
403
|
+
] }) })
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
};
|
|
407
|
+
export {
|
|
408
|
+
MarginTradingCalculator
|
|
409
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface MonthlyPaymentCalculatorProps {
|
|
4
|
+
header?: React.ReactNode | string;
|
|
5
|
+
body?: React.ReactNode | string;
|
|
6
|
+
variant?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MaxLoanCalculator: FC<MonthlyPaymentCalculatorProps>;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { button } from "../../Button/Button.css.js";
|
|
5
|
+
import { getVariant } from "../../utils/getVariant.js";
|
|
6
|
+
import { title } from "../../IconBillboard/IconBillboard.css.js";
|
|
7
|
+
import { calc_container, container, h2i, inputs_container, input_container, input_box, error_message, calculation_header, payment_results } from "../MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
|
|
8
|
+
const MaxLoanCalculator = ({
|
|
9
|
+
variant,
|
|
10
|
+
header
|
|
11
|
+
}) => {
|
|
12
|
+
const [monthlyPaymentDisplay, setMonthlyPaymentDisplay] = useState("");
|
|
13
|
+
const [monthlyPayment, setMonthlyPayment] = useState(
|
|
14
|
+
void 0
|
|
15
|
+
);
|
|
16
|
+
const [loanDuration, setLoanDuration] = useState(60);
|
|
17
|
+
const [interestRateDisplay, setInterestRateDisplay] = useState("");
|
|
18
|
+
const [interestRate, setInterestRate] = useState("");
|
|
19
|
+
const [loanAmount, setLoanAmount] = useState(0);
|
|
20
|
+
const [monthlyPaymentError, setMonthlyPaymentError] = useState(
|
|
21
|
+
null
|
|
22
|
+
);
|
|
23
|
+
const [interestRateError, setInterestRateError] = useState(
|
|
24
|
+
null
|
|
25
|
+
);
|
|
26
|
+
const formatToCurrency = (value) => {
|
|
27
|
+
const numericValue = parseFloat(value.replace(/[^0-9.]/g, ""));
|
|
28
|
+
if (isNaN(numericValue)) {
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
return numericValue.toLocaleString("en-US", {
|
|
32
|
+
style: "currency",
|
|
33
|
+
currency: "USD",
|
|
34
|
+
minimumFractionDigits: 0,
|
|
35
|
+
maximumFractionDigits: 0
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
const validateInputs = () => {
|
|
39
|
+
let isValid = true;
|
|
40
|
+
if (!monthlyPayment || isNaN(monthlyPayment) || monthlyPayment <= 0) {
|
|
41
|
+
setMonthlyPaymentError("Please enter a valid Monthly Payment amount.");
|
|
42
|
+
isValid = false;
|
|
43
|
+
} else {
|
|
44
|
+
setMonthlyPaymentError(null);
|
|
45
|
+
}
|
|
46
|
+
if (!interestRate || isNaN(parseFloat(interestRate))) {
|
|
47
|
+
setInterestRateError("Please enter an Interest Rate.");
|
|
48
|
+
isValid = false;
|
|
49
|
+
} else {
|
|
50
|
+
setInterestRateError(null);
|
|
51
|
+
}
|
|
52
|
+
return isValid;
|
|
53
|
+
};
|
|
54
|
+
const handleMonthlyPaymentChange = (event) => {
|
|
55
|
+
const value = event.target.value;
|
|
56
|
+
const formattedValue = formatToCurrency(value);
|
|
57
|
+
setMonthlyPaymentDisplay(formattedValue);
|
|
58
|
+
const numericValue = parseFloat(value.replace(/[^0-9.]/g, ""));
|
|
59
|
+
setMonthlyPayment(isNaN(numericValue) ? void 0 : numericValue);
|
|
60
|
+
};
|
|
61
|
+
const handleLoanDurationChange = (event) => {
|
|
62
|
+
setLoanDuration(Number(event.target.value));
|
|
63
|
+
};
|
|
64
|
+
const formatToPercentage = (value) => {
|
|
65
|
+
const numericValue = value.replace(/[^0-9.]/g, "");
|
|
66
|
+
if (numericValue === "") {
|
|
67
|
+
return "";
|
|
68
|
+
} else if (numericValue.endsWith("%")) {
|
|
69
|
+
return numericValue;
|
|
70
|
+
} else {
|
|
71
|
+
return numericValue.substring(0, numericValue.length - 2) + numericValue.substring(numericValue.length - 2) + "%";
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const handleInterestRateChange = (event) => {
|
|
75
|
+
let value = event.target.value;
|
|
76
|
+
if (value.length < interestRateDisplay.length) {
|
|
77
|
+
if (interestRateDisplay.length > 1 && interestRateDisplay.endsWith("%")) {
|
|
78
|
+
value = interestRateDisplay.substring(0, interestRateDisplay.length - 2) + "%";
|
|
79
|
+
} else if (interestRateDisplay.length === 1) {
|
|
80
|
+
value = "";
|
|
81
|
+
} else {
|
|
82
|
+
value = interestRateDisplay.substring(
|
|
83
|
+
0,
|
|
84
|
+
interestRateDisplay.length - 1
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
value = formatToPercentage(value);
|
|
89
|
+
}
|
|
90
|
+
setInterestRateDisplay(value);
|
|
91
|
+
setInterestRate(value.replace(/[^0-9.]/g, ""));
|
|
92
|
+
};
|
|
93
|
+
const calculateLoanAmount = () => {
|
|
94
|
+
const numericInterestRate = parseFloat(interestRate);
|
|
95
|
+
const monthlyInterestRate = numericInterestRate / 100 / 12;
|
|
96
|
+
const months = loanDuration;
|
|
97
|
+
if (!isNaN(monthlyPayment || 0) && !isNaN(numericInterestRate) && months > 0) {
|
|
98
|
+
const loanAmount2 = (monthlyPayment || 0) * ((1 - Math.pow(1 + monthlyInterestRate, -months)) / monthlyInterestRate);
|
|
99
|
+
setLoanAmount(loanAmount2);
|
|
100
|
+
} else {
|
|
101
|
+
setLoanAmount(0);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleCalculate = () => {
|
|
105
|
+
if (validateInputs()) {
|
|
106
|
+
calculateLoanAmount();
|
|
107
|
+
} else {
|
|
108
|
+
setLoanAmount(0);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsx("section", { className: `section_spacer`, children: /* @__PURE__ */ jsx("div", { className: "containment", children: /* @__PURE__ */ jsxs(
|
|
112
|
+
"div",
|
|
113
|
+
{
|
|
114
|
+
className: `rounded ${calc_container} ${container({ variant: getVariant(variant) })}`,
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
117
|
+
"h2",
|
|
118
|
+
{
|
|
119
|
+
className: `text_center ${title({ variant: getVariant(variant) })} ${h2i}`,
|
|
120
|
+
children: header
|
|
121
|
+
}
|
|
122
|
+
) }),
|
|
123
|
+
/* @__PURE__ */ jsxs(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: `flex center text_center push_up_32 bottom ${inputs_container}`,
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsxs("div", { className: `flex flex_col ${input_container}`, children: [
|
|
129
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "monthlyPayment", id: "amount1", children: "Monthly Payment" }),
|
|
130
|
+
/* @__PURE__ */ jsx(
|
|
131
|
+
"input",
|
|
132
|
+
{
|
|
133
|
+
className: `text_center bordered ${input_box}`,
|
|
134
|
+
id: "monthlyPayment",
|
|
135
|
+
maxLength: 10,
|
|
136
|
+
name: "monthlyPayment",
|
|
137
|
+
type: "text",
|
|
138
|
+
placeholder: "$0",
|
|
139
|
+
value: monthlyPaymentDisplay,
|
|
140
|
+
onChange: handleMonthlyPaymentChange
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
monthlyPaymentError && /* @__PURE__ */ jsx("span", { className: error_message, children: monthlyPaymentError })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsxs("div", { className: `flex flex_col ${input_container}`, children: [
|
|
146
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "loanDuration", children: "Loan Duration (Months)" }),
|
|
147
|
+
/* @__PURE__ */ jsxs(
|
|
148
|
+
"select",
|
|
149
|
+
{
|
|
150
|
+
className: `text_center bordered ${input_box}`,
|
|
151
|
+
id: "loanDuration",
|
|
152
|
+
name: "loanDuration",
|
|
153
|
+
value: loanDuration,
|
|
154
|
+
onChange: handleLoanDurationChange,
|
|
155
|
+
children: [
|
|
156
|
+
/* @__PURE__ */ jsx("option", { value: "12", children: "12" }),
|
|
157
|
+
/* @__PURE__ */ jsx("option", { value: "24", children: "24" }),
|
|
158
|
+
/* @__PURE__ */ jsx("option", { value: "36", children: "36" }),
|
|
159
|
+
/* @__PURE__ */ jsx("option", { value: "48", children: "48" }),
|
|
160
|
+
/* @__PURE__ */ jsx("option", { value: "60", children: "60" }),
|
|
161
|
+
/* @__PURE__ */ jsx("option", { value: "72", children: "72" }),
|
|
162
|
+
/* @__PURE__ */ jsx("option", { value: "84", children: "84" }),
|
|
163
|
+
/* @__PURE__ */ jsx("option", { value: "96", children: "96" })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ jsxs("div", { className: `flex flex_col ${input_container}`, children: [
|
|
169
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "interestRate", children: "Interest Rate" }),
|
|
170
|
+
/* @__PURE__ */ jsx(
|
|
171
|
+
"input",
|
|
172
|
+
{
|
|
173
|
+
className: `text_center bordered ${input_box}`,
|
|
174
|
+
id: "interestRate",
|
|
175
|
+
maxLength: 6,
|
|
176
|
+
name: "interestRate",
|
|
177
|
+
type: "text",
|
|
178
|
+
placeholder: "0.00%",
|
|
179
|
+
value: interestRateDisplay,
|
|
180
|
+
onChange: handleInterestRateChange
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
interestRateError && /* @__PURE__ */ jsx("span", { className: error_message, children: interestRateError })
|
|
184
|
+
] })
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
189
|
+
/* @__PURE__ */ jsx("div", { className: `flex center middle push_up_32`, children: /* @__PURE__ */ jsx(
|
|
190
|
+
"input",
|
|
191
|
+
{
|
|
192
|
+
className: `${button({
|
|
193
|
+
color: "primary",
|
|
194
|
+
size: "medium",
|
|
195
|
+
rounded: "medium"
|
|
196
|
+
})} center`,
|
|
197
|
+
type: "button",
|
|
198
|
+
value: "Calculate",
|
|
199
|
+
onClick: handleCalculate
|
|
200
|
+
}
|
|
201
|
+
) }),
|
|
202
|
+
/* @__PURE__ */ jsxs("div", { className: "text_center flex flex_col center middle push_up_32", children: [
|
|
203
|
+
/* @__PURE__ */ jsx("span", { className: calculation_header, children: "Maximum Loan Amount You Can Borrow:" }),
|
|
204
|
+
/* @__PURE__ */ jsxs("span", { id: "estimatedLoanAmount", className: payment_results, children: [
|
|
205
|
+
"$",
|
|
206
|
+
loanAmount.toFixed(2)
|
|
207
|
+
] })
|
|
208
|
+
] })
|
|
209
|
+
] })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
) }) });
|
|
213
|
+
};
|
|
214
|
+
export {
|
|
215
|
+
MaxLoanCalculator
|
|
216
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
/* empty css */
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
5
|
+
var container = createRuntimeFn({ defaultClassName: "_10pitvc0", variantClassNames: { variant: { primary: "_10pitvc1", secondary: "_10pitvc2", tertiary: "_10pitvc3", quaternary: "_10pitvc4" } }, defaultVariants: {}, compoundVariants: [] });
|
|
6
|
+
var input_container = "_10pitvc5";
|
|
7
|
+
var input_box = "_10pitvc6";
|
|
8
|
+
var payment_results = "_10pitvc7";
|
|
9
|
+
var calc_container = "_10pitvc8";
|
|
10
|
+
var inputs_container = "_10pitvc9";
|
|
11
|
+
var calculation_header = "_10pitvca";
|
|
12
|
+
var error_message = "_10pitvcb";
|
|
13
|
+
var h2i = "_10pitvcc";
|
|
14
|
+
export {
|
|
15
|
+
calc_container,
|
|
16
|
+
calculation_header,
|
|
17
|
+
container,
|
|
18
|
+
error_message,
|
|
19
|
+
h2i,
|
|
20
|
+
input_box,
|
|
21
|
+
input_container,
|
|
22
|
+
inputs_container,
|
|
23
|
+
payment_results
|
|
24
|
+
};
|