@axos-web-dev/shared-components 1.0.100-dev.56 → 1.0.100-dev.58
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/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +2 -0
- package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.js +7 -2
- package/dist/Calculators/AxosOneCalculator/index.js +70 -63
- package/dist/Table/Table.d.ts +1 -1
- package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +40 -2
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import '../../assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css';import '../../assets/Typography/Typography.css';import '../../assets/themes/victorie.css';import '../../assets/themes/ufb.css';import '../../assets/themes/premier.css';import '../../assets/themes/axos.css';/* empty css */
|
|
1
|
+
import '../../assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css';import '../../assets/Table/Table.css';import '../../assets/Typography/Typography.css';import '../../assets/themes/victorie.css';import '../../assets/themes/ufb.css';import '../../assets/themes/premier.css';import '../../assets/themes/axos.css';/* empty css */
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
|
+
/* empty css */
|
|
6
7
|
/* empty css */
|
|
7
8
|
import { createRuntimeFn } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
8
9
|
var ax1_container = "_11b2y8z0";
|
|
@@ -21,6 +22,8 @@ var ax1_calc_text = "_11b2y8zc";
|
|
|
21
22
|
var ax1_description_text = createRuntimeFn({ defaultClassName: "_11b2y8zd", variantClassNames: { variant: { primary: "_11b2y8ze", secondary: "_11b2y8zf", tertiary: "_11b2y8zg", quaternary: "_11b2y8zh" } }, defaultVariants: {}, compoundVariants: [] });
|
|
22
23
|
var ax1_calc_disclosure = createRuntimeFn({ defaultClassName: "_11b2y8zi", variantClassNames: { variant: { primary: "_11b2y8zj", secondary: "_11b2y8zk", tertiary: "_11b2y8zl", quaternary: "_11b2y8zm" } }, defaultVariants: {}, compoundVariants: [] });
|
|
23
24
|
var call_to_action_row = "_11b2y8zn";
|
|
25
|
+
var tieredRowAnimation = "_11b2y8zp";
|
|
26
|
+
var tieredRowAnimationDelayed = "_11b2y8zq";
|
|
24
27
|
export {
|
|
25
28
|
ax1_calc_disclosure,
|
|
26
29
|
ax1_calc_icon,
|
|
@@ -37,5 +40,7 @@ export {
|
|
|
37
40
|
ax1_input_label,
|
|
38
41
|
ax1_m_label,
|
|
39
42
|
ax1_table_container,
|
|
40
|
-
call_to_action_row
|
|
43
|
+
call_to_action_row,
|
|
44
|
+
tieredRowAnimation,
|
|
45
|
+
tieredRowAnimationDelayed
|
|
41
46
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Button } from "../../Button/Button.js";
|
|
4
4
|
import "../../Button/Button.css.js";
|
|
5
5
|
import { useState } from "react";
|
|
@@ -19,7 +19,7 @@ import { headerCell } from "../../Table/Table.css.js";
|
|
|
19
19
|
import "../../utils/allowedAxosDomains.js";
|
|
20
20
|
import { getVariant } from "../../utils/getVariant.js";
|
|
21
21
|
import clsx from "clsx";
|
|
22
|
-
import { ax1_calc_icon, ax1_header_container, ax1_header_calc, ax1_calc_text, ax1_description_text, ax1_calculator_wrapper, ax1_input_container, ax1_input_label, ax1_calculator_input, ax1_calculator_button, ax1_d_label, ax1_m_label, ax1_table_container, call_to_action_row, ax1_calc_disclosure, ax1_container } from "./BalanceAPYCalculator.css.js";
|
|
22
|
+
import { ax1_calc_icon, ax1_header_container, ax1_header_calc, ax1_calc_text, ax1_description_text, ax1_calculator_wrapper, ax1_input_container, ax1_input_label, ax1_calculator_input, ax1_calculator_button, ax1_d_label, ax1_m_label, tieredRowAnimation, tieredRowAnimationDelayed, ax1_table_container, call_to_action_row, ax1_calc_disclosure, ax1_container } from "./BalanceAPYCalculator.css.js";
|
|
23
23
|
const AxosOneCalculator = ({
|
|
24
24
|
headline,
|
|
25
25
|
bodyCopy,
|
|
@@ -31,24 +31,17 @@ const AxosOneCalculator = ({
|
|
|
31
31
|
}) => {
|
|
32
32
|
const calc_variant = getVariant(variant);
|
|
33
33
|
const AXOS_ONE_APY = +process.env.NEXT_PUBLIC_AXOS_ONE_APY;
|
|
34
|
+
const AXOS_ONE_APY_TIERED = +process.env.NEXT_PUBLIC_AXOS1_APY_TIER;
|
|
34
35
|
const startingBalance = Number.isFinite(Number(initialBalance)) && Number(initialBalance) >= 0 ? Number(initialBalance) : 1e4;
|
|
35
36
|
const [balance, setBalance] = useState(startingBalance);
|
|
36
|
-
const [
|
|
37
|
+
const [calculatedBalance, setCalculatedBalance] = useState(startingBalance);
|
|
38
|
+
const [axbAPY, setAxbAPY] = useState(AXOS_ONE_APY);
|
|
37
39
|
const [axbEarning, setAxbEarning] = useState(
|
|
38
40
|
AXOS_ONE_APY / 100 * startingBalance
|
|
39
41
|
);
|
|
40
|
-
const [
|
|
41
|
-
const [
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
const [bofaAPY, _setBofaAPY] = useState(0.01);
|
|
45
|
-
const [bofaEarning, setBofaEarning] = useState(
|
|
46
|
-
0.01 / 100 * startingBalance
|
|
47
|
-
);
|
|
48
|
-
const [fargoAPY, _setFargoAPY] = useState(0.05);
|
|
49
|
-
const [fargoEarning, setFargoEarning] = useState(
|
|
50
|
-
0.05 / 100 * startingBalance
|
|
51
|
-
);
|
|
42
|
+
const [tier1Earning, setTier1Earning] = useState(0);
|
|
43
|
+
const [tier2Earning, setTier2Earning] = useState(0);
|
|
44
|
+
const [showTieredRows, setShowTieredRows] = useState(false);
|
|
52
45
|
const removeNonNumeric = (value) => {
|
|
53
46
|
if (value === "") {
|
|
54
47
|
value = "0";
|
|
@@ -59,10 +52,27 @@ const AxosOneCalculator = ({
|
|
|
59
52
|
return newValue;
|
|
60
53
|
};
|
|
61
54
|
const calculateBalance = (amount) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
setCalculatedBalance(amount);
|
|
56
|
+
const TIER_THRESHOLD = 499999.99;
|
|
57
|
+
if (amount > TIER_THRESHOLD) {
|
|
58
|
+
const tier1Amount = TIER_THRESHOLD;
|
|
59
|
+
const tier2Amount = amount - TIER_THRESHOLD;
|
|
60
|
+
const tier1Earn = AXOS_ONE_APY / 100 * tier1Amount;
|
|
61
|
+
const tier2Earn = AXOS_ONE_APY_TIERED / 100 * tier2Amount;
|
|
62
|
+
setTier1Earning(tier1Earn);
|
|
63
|
+
setTier2Earning(tier2Earn);
|
|
64
|
+
const totalEarning = tier1Earn + tier2Earn;
|
|
65
|
+
setAxbEarning(totalEarning);
|
|
66
|
+
const effectiveAPY = totalEarning / amount * 100;
|
|
67
|
+
setAxbAPY(effectiveAPY);
|
|
68
|
+
setShowTieredRows(true);
|
|
69
|
+
} else {
|
|
70
|
+
setAxbEarning(AXOS_ONE_APY / 100 * amount);
|
|
71
|
+
setAxbAPY(AXOS_ONE_APY);
|
|
72
|
+
setTier1Earning(0);
|
|
73
|
+
setTier2Earning(0);
|
|
74
|
+
setShowTieredRows(false);
|
|
75
|
+
}
|
|
66
76
|
};
|
|
67
77
|
const onUpdateBalance = (e) => {
|
|
68
78
|
const text = e.target.value;
|
|
@@ -83,6 +93,12 @@ const AxosOneCalculator = ({
|
|
|
83
93
|
maximumFractionDigits: 2
|
|
84
94
|
});
|
|
85
95
|
};
|
|
96
|
+
const formatEarnings = (value) => {
|
|
97
|
+
return Math.round(value).toLocaleString(void 0, {
|
|
98
|
+
minimumFractionDigits: 0,
|
|
99
|
+
maximumFractionDigits: 0
|
|
100
|
+
});
|
|
101
|
+
};
|
|
86
102
|
return /* @__PURE__ */ jsx("section", { className: clsx(ax1_container), id: "axoapycalc", children: /* @__PURE__ */ jsxs("div", { className: clsx("containment"), children: [
|
|
87
103
|
icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", ax1_calc_icon), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
|
|
88
104
|
(headline || bodyCopy) && /* @__PURE__ */ jsxs("div", { className: `${ax1_header_container} text_center`, children: [
|
|
@@ -137,8 +153,8 @@ const AxosOneCalculator = ({
|
|
|
137
153
|
children: [
|
|
138
154
|
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
139
155
|
/* @__PURE__ */ jsxs(TableCell, { as: "th", variant: "primary", children: [
|
|
140
|
-
/* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "
|
|
141
|
-
/* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_m_label), children: "
|
|
156
|
+
/* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "Balance" }),
|
|
157
|
+
/* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_m_label), children: "Balance" })
|
|
142
158
|
] }),
|
|
143
159
|
/* @__PURE__ */ jsxs(TableCell, { as: "th", variant: "primary", children: [
|
|
144
160
|
/* @__PURE__ */ jsx("div", { className: clsx(headerCell, ax1_d_label), children: "Annual Percentage Yield*" }),
|
|
@@ -151,56 +167,47 @@ const AxosOneCalculator = ({
|
|
|
151
167
|
] }) }),
|
|
152
168
|
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
153
169
|
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
154
|
-
/* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
|
|
171
|
+
"$",
|
|
172
|
+
formatUSD(calculatedBalance)
|
|
173
|
+
] }) }),
|
|
155
174
|
/* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
|
|
156
175
|
axbAPY.toFixed(2),
|
|
157
176
|
"%"
|
|
158
177
|
] }) }),
|
|
159
178
|
/* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
|
|
160
179
|
"$",
|
|
161
|
-
|
|
180
|
+
formatEarnings(axbEarning)
|
|
162
181
|
] }) })
|
|
163
182
|
] }),
|
|
164
|
-
/* @__PURE__ */ jsxs(
|
|
165
|
-
/* @__PURE__ */ jsxs(
|
|
166
|
-
|
|
167
|
-
|
|
183
|
+
showTieredRows && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
184
|
+
/* @__PURE__ */ jsxs(TableRow, { className: clsx(tieredRowAnimation), children: [
|
|
185
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
186
|
+
"$",
|
|
187
|
+
formatUSD(499999.99)
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
190
|
+
AXOS_ONE_APY.toFixed(2),
|
|
191
|
+
"%"
|
|
192
|
+
] }),
|
|
193
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
194
|
+
"$",
|
|
195
|
+
formatEarnings(tier1Earning)
|
|
196
|
+
] })
|
|
168
197
|
] }),
|
|
169
|
-
/* @__PURE__ */ jsxs(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
] }),
|
|
183
|
-
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
184
|
-
bofaAPY.toFixed(2),
|
|
185
|
-
"%"
|
|
186
|
-
] }),
|
|
187
|
-
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
188
|
-
"$",
|
|
189
|
-
formatUSD(bofaEarning)
|
|
190
|
-
] })
|
|
191
|
-
] }),
|
|
192
|
-
/* @__PURE__ */ jsxs(TableRow, { children: [
|
|
193
|
-
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
194
|
-
"Chase",
|
|
195
|
-
/* @__PURE__ */ jsx("sup", { children: "4" })
|
|
196
|
-
] }),
|
|
197
|
-
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
198
|
-
chaseAPY.toFixed(2),
|
|
199
|
-
"%"
|
|
200
|
-
] }),
|
|
201
|
-
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
202
|
-
"$",
|
|
203
|
-
formatUSD(chaseEarning)
|
|
198
|
+
/* @__PURE__ */ jsxs(TableRow, { className: clsx(tieredRowAnimationDelayed), children: [
|
|
199
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
200
|
+
"$",
|
|
201
|
+
formatUSD(calculatedBalance - 499999.99)
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
204
|
+
AXOS_ONE_APY_TIERED.toFixed(2),
|
|
205
|
+
"%"
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
|
|
208
|
+
"$",
|
|
209
|
+
formatEarnings(tier2Earning)
|
|
210
|
+
] })
|
|
204
211
|
] })
|
|
205
212
|
] })
|
|
206
213
|
] })
|
|
@@ -221,7 +228,7 @@ const AxosOneCalculator = ({
|
|
|
221
228
|
id
|
|
222
229
|
)
|
|
223
230
|
) }),
|
|
224
|
-
disclosure && /* @__PURE__ */ jsx("div", { className: ax1_calc_disclosure({ variant: calc_variant }), children: disclosure })
|
|
231
|
+
showTieredRows && disclosure && /* @__PURE__ */ jsx("div", { className: ax1_calc_disclosure({ variant: calc_variant }), children: disclosure })
|
|
225
232
|
] }) });
|
|
226
233
|
};
|
|
227
234
|
export {
|
package/dist/Table/Table.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare const TableCell: ({ children, as, variant, highlighted, colSpan,
|
|
|
61
61
|
is?: string | undefined;
|
|
62
62
|
exportparts?: string | undefined;
|
|
63
63
|
part?: string | undefined;
|
|
64
|
-
popover?: "" | "auto" | "manual" | undefined;
|
|
64
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
65
65
|
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
66
66
|
popoverTarget?: string | undefined;
|
|
67
67
|
onToggle?: import('react').ToggleEventHandler<HTMLTableCellElement> | undefined;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
@keyframes _11b2y8zo {
|
|
2
|
+
0% {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
transform: translateY(-10px);
|
|
5
|
+
}
|
|
6
|
+
100% {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
transform: translateY(0);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
1
11
|
._11b2y8z0 {
|
|
2
12
|
position: relative;
|
|
3
13
|
}
|
|
@@ -8,11 +18,24 @@
|
|
|
8
18
|
background: #fff;
|
|
9
19
|
color: #1e3860;
|
|
10
20
|
}
|
|
21
|
+
._11b2y8z0 th {
|
|
22
|
+
background: #fff !important;
|
|
23
|
+
color: #1e3860;
|
|
24
|
+
}
|
|
25
|
+
._11b2y8z0 ._1nivbwet {
|
|
26
|
+
overflow-x: hidden;
|
|
27
|
+
}
|
|
28
|
+
._11b2y8z0 tbody tr:first-child td:first-child {
|
|
29
|
+
border-radius: 1rem 0 0 1rem !important;
|
|
30
|
+
}
|
|
31
|
+
._11b2y8z0 tbody tr:first-child td:last-child {
|
|
32
|
+
border-radius: 0 1rem 1rem 0 !important;
|
|
33
|
+
}
|
|
11
34
|
._11b2y8z0 ._1nivbwet ._1nivbwe12 tr:nth-child(even) td {
|
|
12
35
|
background: #fff;
|
|
13
36
|
}
|
|
14
37
|
._11b2y8z0 > .containment {
|
|
15
|
-
padding:
|
|
38
|
+
padding: 56px;
|
|
16
39
|
background: #def4ff;
|
|
17
40
|
border-radius: 1rem;
|
|
18
41
|
}
|
|
@@ -131,12 +154,18 @@
|
|
|
131
154
|
margin-top: 2rem;
|
|
132
155
|
gap: 3rem;
|
|
133
156
|
}
|
|
157
|
+
._11b2y8zp {
|
|
158
|
+
animation: _11b2y8zo 0.5s ease-out forwards;
|
|
159
|
+
}
|
|
160
|
+
._11b2y8zq {
|
|
161
|
+
animation: _11b2y8zo 0.5s ease-out 0.15s forwards;
|
|
162
|
+
opacity: 0;
|
|
163
|
+
}
|
|
134
164
|
@media screen and (max-width: 1023px) {
|
|
135
165
|
._11b2y8z0 > .containment {
|
|
136
166
|
max-width: 100%;
|
|
137
167
|
width: 100%;
|
|
138
168
|
border-radius: 0;
|
|
139
|
-
padding: 84px 28px 100px;
|
|
140
169
|
}
|
|
141
170
|
._11b2y8z1 {
|
|
142
171
|
padding: 32px 24px;
|
|
@@ -159,6 +188,15 @@
|
|
|
159
188
|
}
|
|
160
189
|
}
|
|
161
190
|
@media screen and (max-width: 768px) {
|
|
191
|
+
._11b2y8z0 ._1nivbwet {
|
|
192
|
+
margin-top: 0px !important;
|
|
193
|
+
}
|
|
194
|
+
._11b2y8z0 tbody tr:first-child td:first-child {
|
|
195
|
+
border-radius: 0px !important;
|
|
196
|
+
}
|
|
197
|
+
._11b2y8z0 tbody tr:first-child td:last-child {
|
|
198
|
+
border-radius: 0px !important;
|
|
199
|
+
}
|
|
162
200
|
._11b2y8z0 ._1nivbwet ._1nivbwe12 tr:nth-child(even) td {
|
|
163
201
|
background: var(--_1073cm88);
|
|
164
202
|
}
|
package/package.json
CHANGED