@axos-web-dev/shared-components 1.0.99-dev.19 → 1.0.99-dev.20

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.
@@ -43,3 +43,4 @@ export declare const ax1_calc_disclosure: import('@vanilla-extract/recipes').Run
43
43
  };
44
44
  };
45
45
  }>;
46
+ export declare const call_to_action_row: string;
@@ -19,6 +19,7 @@ var ax1_header_calc = "_11b2y8zb";
19
19
  var ax1_calc_text = "_11b2y8zc";
20
20
  var ax1_description_text = createRuntimeFn({ defaultClassName: "_11b2y8zd", variantClassNames: { variant: { primary: "_11b2y8ze", secondary: "_11b2y8zf", tertiary: "_11b2y8zg", quaternary: "_11b2y8zh" } }, defaultVariants: {}, compoundVariants: [] });
21
21
  var ax1_calc_disclosure = createRuntimeFn({ defaultClassName: "_11b2y8zi", variantClassNames: { variant: { primary: "_11b2y8zj", secondary: "_11b2y8zk", tertiary: "_11b2y8zl", quaternary: "_11b2y8zm" } }, defaultVariants: {}, compoundVariants: [] });
22
+ var call_to_action_row = "_11b2y8zn";
22
23
  export {
23
24
  ax1_calc_disclosure,
24
25
  ax1_calc_icon,
@@ -34,5 +35,6 @@ export {
34
35
  ax1_input_container,
35
36
  ax1_input_label,
36
37
  ax1_m_label,
37
- ax1_table_container
38
+ ax1_table_container,
39
+ call_to_action_row
38
40
  };
@@ -1,4 +1,5 @@
1
1
  import { default as React, FC } from 'react';
2
+ import { ChevronProps } from '../../Chevron/Chevron.interface';
2
3
 
3
4
  export interface AxosOneCalculatorProps {
4
5
  headline?: React.ReactNode | string;
@@ -6,5 +7,7 @@ export interface AxosOneCalculatorProps {
6
7
  bodyCopy?: React.ReactNode | string;
7
8
  disclosure: React.ReactNode | string;
8
9
  variant: string;
10
+ initialBalance?: number;
11
+ callToActionRow?: ChevronProps[];
9
12
  }
10
13
  export declare const AxosOneCalculator: FC<AxosOneCalculatorProps>;
@@ -18,25 +18,36 @@ import { headerCell } from "../../Table/Table.css.js";
18
18
  import "../../utils/allowedAxosDomains.js";
19
19
  import { getVariant } from "../../utils/getVariant.js";
20
20
  import clsx from "clsx";
21
- 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, ax1_calc_disclosure, ax1_container } from "./BalanceAPYCalculator.css.js";
21
+ 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
22
  const AxosOneCalculator = ({
23
23
  headline,
24
24
  bodyCopy,
25
25
  disclosure,
26
26
  icon,
27
- variant
27
+ variant,
28
+ initialBalance,
29
+ callToActionRow
28
30
  }) => {
29
31
  const calc_variant = getVariant(variant);
30
32
  const AXOS_ONE_APY = +process.env.NEXT_PUBLIC_AXOS_ONE_APY;
31
- const [balance, setBalance] = useState(1e4);
33
+ const startingBalance = Number.isFinite(Number(initialBalance)) && Number(initialBalance) >= 0 ? Number(initialBalance) : 1e4;
34
+ const [balance, setBalance] = useState(startingBalance);
32
35
  const [axbAPY, _setAxbAPY] = useState(AXOS_ONE_APY);
33
- const [axbEarning, setAxbEarning] = useState(AXOS_ONE_APY * 100);
36
+ const [axbEarning, setAxbEarning] = useState(
37
+ AXOS_ONE_APY / 100 * startingBalance
38
+ );
34
39
  const [chaseAPY, _setChaseAPY] = useState(0.01);
35
- const [chaseEarning, setChaseEarning] = useState(1);
40
+ const [chaseEarning, setChaseEarning] = useState(
41
+ 0.01 / 100 * startingBalance
42
+ );
36
43
  const [bofaAPY, _setBofaAPY] = useState(0.01);
37
- const [bofaEarning, setBofaEarning] = useState(1);
44
+ const [bofaEarning, setBofaEarning] = useState(
45
+ 0.01 / 100 * startingBalance
46
+ );
38
47
  const [fargoAPY, _setFargoAPY] = useState(0.05);
39
- const [fargoEarning, setFargoEarning] = useState(5);
48
+ const [fargoEarning, setFargoEarning] = useState(
49
+ 0.05 / 100 * startingBalance
50
+ );
40
51
  const removeNonNumeric = (value) => {
41
52
  if (value === "") {
42
53
  value = "0";
@@ -59,7 +70,19 @@ const AxosOneCalculator = ({
59
70
  setBalance(0);
60
71
  }
61
72
  };
62
- return /* @__PURE__ */ jsx("section", { className: clsx(ax1_container), children: /* @__PURE__ */ jsxs("div", { className: clsx("containment"), children: [
73
+ const formatUSD = (value) => {
74
+ if (Number.isInteger(value)) {
75
+ return value.toLocaleString(void 0, {
76
+ minimumFractionDigits: 0,
77
+ maximumFractionDigits: 0
78
+ });
79
+ }
80
+ return value.toLocaleString(void 0, {
81
+ minimumFractionDigits: 2,
82
+ maximumFractionDigits: 2
83
+ });
84
+ };
85
+ return /* @__PURE__ */ jsx("section", { className: clsx(ax1_container), id: "axoapycalc", children: /* @__PURE__ */ jsxs("div", { className: clsx("containment"), children: [
63
86
  icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", ax1_calc_icon), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
64
87
  (headline || bodyCopy) && /* @__PURE__ */ jsxs("div", { className: `${ax1_header_container} text_center`, children: [
65
88
  headline && /* @__PURE__ */ jsx("h2", { className: clsx("header_2", ax1_header_calc), children: headline }),
@@ -134,9 +157,7 @@ const AxosOneCalculator = ({
134
157
  ] }) }),
135
158
  /* @__PURE__ */ jsx(TableCell, { variant: "primary", children: /* @__PURE__ */ jsxs("b", { children: [
136
159
  "$",
137
- axbEarning.toLocaleString(void 0, {
138
- maximumFractionDigits: 2
139
- })
160
+ formatUSD(axbEarning)
140
161
  ] }) })
141
162
  ] }),
142
163
  /* @__PURE__ */ jsxs(TableRow, { children: [
@@ -150,9 +171,7 @@ const AxosOneCalculator = ({
150
171
  ] }),
151
172
  /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
152
173
  "$",
153
- fargoEarning.toLocaleString(void 0, {
154
- maximumFractionDigits: 2
155
- })
174
+ formatUSD(fargoEarning)
156
175
  ] })
157
176
  ] }),
158
177
  /* @__PURE__ */ jsxs(TableRow, { children: [
@@ -166,9 +185,7 @@ const AxosOneCalculator = ({
166
185
  ] }),
167
186
  /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
168
187
  "$",
169
- bofaEarning.toLocaleString(void 0, {
170
- maximumFractionDigits: 2
171
- })
188
+ formatUSD(bofaEarning)
172
189
  ] })
173
190
  ] }),
174
191
  /* @__PURE__ */ jsxs(TableRow, { children: [
@@ -182,9 +199,7 @@ const AxosOneCalculator = ({
182
199
  ] }),
183
200
  /* @__PURE__ */ jsxs(TableCell, { variant: "primary", children: [
184
201
  "$",
185
- chaseEarning.toLocaleString(void 0, {
186
- maximumFractionDigits: 2
187
- })
202
+ formatUSD(chaseEarning)
188
203
  ] })
189
204
  ] })
190
205
  ] })
@@ -192,6 +207,19 @@ const AxosOneCalculator = ({
192
207
  }
193
208
  )
194
209
  ] }),
210
+ Array.isArray(callToActionRow) && callToActionRow.length > 0 && /* @__PURE__ */ jsx("div", { className: `${call_to_action_row}`, children: callToActionRow?.map(
211
+ ({ id, variant: variant2, displayText, targetUrl }) => /* @__PURE__ */ jsx(
212
+ Button,
213
+ {
214
+ targetUrl,
215
+ color: getVariant(variant2),
216
+ size: "medium",
217
+ rounded: "medium",
218
+ children: displayText
219
+ },
220
+ id
221
+ )
222
+ ) }),
195
223
  disclosure && /* @__PURE__ */ jsx("div", { className: ax1_calc_disclosure({ variant: calc_variant }), children: disclosure })
196
224
  ] }) });
197
225
  };
@@ -1,5 +1,6 @@
1
1
  import { IconBillboardProps } from '../IconBillboard/IconBillboard.interface';
2
2
  import { default as React } from 'react';
3
+ import { ChevronProps } from '../Chevron/Chevron.interface';
3
4
 
4
5
  export interface CalculatorProps {
5
6
  id?: string;
@@ -11,5 +12,6 @@ export interface CalculatorProps {
11
12
  bodyCopy?: React.ReactNode;
12
13
  disclosure?: React.ReactNode;
13
14
  marketingTiles?: IconBillboardProps[];
15
+ callToActionRow?: ChevronProps[];
14
16
  }
15
17
  export declare const Calculator: (props: CalculatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -136,7 +136,8 @@ const Calculator = (props) => {
136
136
  disclosure,
137
137
  headline,
138
138
  name,
139
- marketingTiles
139
+ marketingTiles,
140
+ callToActionRow
140
141
  } = props;
141
142
  const ref = useRef(null);
142
143
  const iframe = calculators.get(name || "");
@@ -227,7 +228,8 @@ const Calculator = (props) => {
227
228
  bodyCopy,
228
229
  variant,
229
230
  disclosure,
230
- icon
231
+ icon,
232
+ callToActionRow
231
233
  }
232
234
  );
233
235
  } else if (name === "APY Balance Summit Savings") {
@@ -335,7 +335,11 @@ const HeroBanner = ({
335
335
  ) : /* @__PURE__ */ jsx(
336
336
  "ul",
337
337
  {
338
- className: clsx(hero_sub_bullets, "mb_0", "push_up"),
338
+ className: clsx(
339
+ hero_sub_bullets,
340
+ "mb_0",
341
+ "push_up"
342
+ ),
339
343
  children: /* @__PURE__ */ jsxs("li", { className: "list_item flex", children: [
340
344
  /* @__PURE__ */ jsx("div", { className: "img_item", children: /* @__PURE__ */ jsx(
341
345
  "img",
@@ -119,6 +119,13 @@
119
119
  ._11b2y8zm {
120
120
  color: var(--_1073cm8n);
121
121
  }
122
+ ._11b2y8zn {
123
+ align-items: center;
124
+ display: flex;
125
+ justify-content: center;
126
+ margin-top: 2rem;
127
+ gap: 3rem;
128
+ }
122
129
  @media screen and (max-width: 1023px) {
123
130
  ._11b2y8z0 > .containment {
124
131
  max-width: 100%;
@@ -134,6 +141,11 @@
134
141
  ._11b2y8z3 {
135
142
  font-size: 23px;
136
143
  }
144
+ ._11b2y8zn {
145
+ flex-direction: column;
146
+ gap: 1rem;
147
+ padding-bottom: 2rem;
148
+ }
137
149
  }
138
150
  @media screen and (max-width: 900px) {
139
151
  ._11b2y8z8 {
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": "1.0.99-dev.19",
4
+ "version": "1.0.99-dev.20",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",