@axos-web-dev/shared-components 2.2.11 → 2.2.12

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 (189) hide show
  1. package/dist/ATMLocator/ATMLocator.d.ts +1 -1
  2. package/dist/ATMLocator/ATMLocator.js +1 -0
  3. package/dist/Accordion/Accordion.d.ts +3 -3
  4. package/dist/Article/Article.d.ts +1 -1
  5. package/dist/Auth/ErrorAlert.d.ts +1 -1
  6. package/dist/Auth/ErrorAlert.js +3 -2
  7. package/dist/Auth/Logout.d.ts +1 -1
  8. package/dist/Auth/SignInPassword.d.ts +1 -1
  9. package/dist/BulletItem/BulletItem.d.ts +1 -1
  10. package/dist/Button/Button.d.ts +1 -1
  11. package/dist/Button/Button.js +3 -2
  12. package/dist/Button/GoBackButton.d.ts +1 -1
  13. package/dist/Calculators/AnnualFeeCalculator/index.js +1 -1
  14. package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.d.ts +95 -0
  15. package/dist/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css.js +101 -0
  16. package/dist/Calculators/ApyCalculatorUserTest/index.d.ts +12 -0
  17. package/dist/Calculators/ApyCalculatorUserTest/index.js +618 -0
  18. package/dist/Calculators/Calculator.d.ts +1 -1
  19. package/dist/Calculators/Calculator.js +11 -0
  20. package/dist/Calculators/MarginTradingCalculator/index.js +3 -2
  21. package/dist/Calculators/index.d.ts +1 -0
  22. package/dist/Calculators/index.js +2 -0
  23. package/dist/Carousel/index.d.ts +3 -3
  24. package/dist/Carousel/index.js +3 -2
  25. package/dist/Chatbot/Bubble.d.ts +1 -1
  26. package/dist/Chatbot/Chatbot.d.ts +1 -1
  27. package/dist/Chatbot/EllipsisAnimation.d.ts +1 -1
  28. package/dist/Chatbot/EllipsisIcon.d.ts +1 -1
  29. package/dist/Chevron/index.js +2 -1
  30. package/dist/Comparison/Comparison.d.ts +1 -1
  31. package/dist/Comparison/Comparison.js +3 -2
  32. package/dist/Comparison/ComparisonSet.d.ts +1 -1
  33. package/dist/ExecutiveBio/ExecutiveBio.d.ts +1 -1
  34. package/dist/ExecutiveBio/ExecutiveBio.js +2 -1
  35. package/dist/ExecutiveBio/ExecutiveBioSet.d.ts +1 -1
  36. package/dist/ExecutiveBio/Overlay.d.ts +1 -1
  37. package/dist/FaqAccordion/index.d.ts +5 -5
  38. package/dist/FaqAccordion/index.js +3 -2
  39. package/dist/FdicCallout/index.d.ts +1 -1
  40. package/dist/FooterDisclosure/FooterDisclosure.d.ts +4 -4
  41. package/dist/FooterDisclosure/LVF/LaVictorieFooter.d.ts +1 -1
  42. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.d.ts +1 -1
  43. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -1
  44. package/dist/Forms/ApplicationStart.d.ts +1 -1
  45. package/dist/Forms/ApplyNow.d.ts +1 -1
  46. package/dist/Forms/ApplyNow.js +3 -2
  47. package/dist/Forms/BoatMooringLocation.d.ts +1 -1
  48. package/dist/Forms/ClearingForm.d.ts +1 -1
  49. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  50. package/dist/Forms/CommercialDepositsNoLendingOption.d.ts +1 -1
  51. package/dist/Forms/CommercialLending.d.ts +1 -1
  52. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  53. package/dist/Forms/ConstructionLendingDynamic.d.ts +1 -1
  54. package/dist/Forms/ContactCompany.d.ts +1 -1
  55. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  56. package/dist/Forms/ContactUs.d.ts +1 -1
  57. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  58. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  59. package/dist/Forms/ContactUsBusiness.js +3 -2
  60. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  61. package/dist/Forms/ContactUsBusinessNameEmail.js +3 -2
  62. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  63. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  64. package/dist/Forms/ContactUsNMLSId.js +3 -2
  65. package/dist/Forms/ContactUsSchwabAAS.d.ts +1 -1
  66. package/dist/Forms/CpraRequest.d.ts +1 -1
  67. package/dist/Forms/CpraRequest.js +3 -2
  68. package/dist/Forms/CraPublicFile.d.ts +1 -1
  69. package/dist/Forms/CraPublicFile.js +3 -2
  70. package/dist/Forms/DealerServices.d.ts +1 -1
  71. package/dist/Forms/EmailOnly.d.ts +1 -1
  72. package/dist/Forms/EmailOnly.js +3 -2
  73. package/dist/Forms/EmailUs.d.ts +1 -1
  74. package/dist/Forms/HoneyPot/index.d.ts +1 -1
  75. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  76. package/dist/Forms/MortgageRate/MortgageRateForm.js +3 -2
  77. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.d.ts +1 -1
  78. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  79. package/dist/Forms/MortgageRate/MortgageRateWatch.js +3 -2
  80. package/dist/Forms/MortgageWarehouseLending.d.ts +1 -1
  81. package/dist/Forms/MortgageWarehouseLending.js +3 -2
  82. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  83. package/dist/Forms/QuickPricer/UserInformation.d.ts +1 -1
  84. package/dist/Forms/ScheduleCall.d.ts +1 -1
  85. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  86. package/dist/Forms/SuccesForm.d.ts +1 -1
  87. package/dist/Forms/SuccesForm.js +3 -2
  88. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  89. package/dist/Forms/WcplSurvey.d.ts +1 -1
  90. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  91. package/dist/HeroBanner/HeroVideoPoster.d.ts +1 -1
  92. package/dist/HeroBanner/LargeHeroBanner.d.ts +1 -1
  93. package/dist/Hyperlink/index.js +3 -2
  94. package/dist/IconBillboard/IconBillboard.d.ts +1 -1
  95. package/dist/IconBillboard/IconBillboardSet.d.ts +1 -1
  96. package/dist/IconBillboard/sections/CallToActionSection.d.ts +1 -1
  97. package/dist/IconBillboard/sections/HeaderSection.d.ts +2 -2
  98. package/dist/IconBillboard/sections/IconSection.d.ts +1 -1
  99. package/dist/IconBillboard/sections/ItemsSection.d.ts +1 -1
  100. package/dist/IconBillboard/sections/LayoutSection.d.ts +1 -1
  101. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +1 -1
  102. package/dist/ImageBillboard/ImageBillboard.d.ts +1 -1
  103. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  104. package/dist/ImageLink/ImageLink.d.ts +1 -1
  105. package/dist/ImageLink/ImageLink.js +3 -2
  106. package/dist/ImageLink/ImageLinkSet.d.ts +1 -1
  107. package/dist/ImageLink/ImageLinkSet.js +3 -2
  108. package/dist/ImageLink/index.js +3 -2
  109. package/dist/ImageWrapper/ImageWrapper.d.ts +1 -1
  110. package/dist/Insight/Featured/CategorySelector.d.ts +2 -2
  111. package/dist/Insight/Featured/CategorySelector.js +3 -2
  112. package/dist/Insight/Featured/Featured.d.ts +2 -2
  113. package/dist/Insight/Featured/Featured.js +3 -2
  114. package/dist/Insight/Featured/Header.d.ts +1 -1
  115. package/dist/Insight/Featured/Header.js +3 -2
  116. package/dist/LandingPageHeader/LandingPageHeader.d.ts +1 -1
  117. package/dist/LoadingIndicator/index.d.ts +1 -1
  118. package/dist/MainHTML/index.d.ts +1 -1
  119. package/dist/Modal/Modal.js +3 -2
  120. package/dist/Modal/contextApi/store.d.ts +1 -1
  121. package/dist/NavigationMenu/AxosALTS/index.d.ts +1 -1
  122. package/dist/NavigationMenu/AxosALTS/index.js +2 -1
  123. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.d.ts +1 -1
  124. package/dist/NavigationMenu/AxosAdvisor/index.d.ts +1 -1
  125. package/dist/NavigationMenu/AxosAdvisorServices/SubNavBar.d.ts +1 -1
  126. package/dist/NavigationMenu/AxosAdvisorServices/index.d.ts +1 -1
  127. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +1 -1
  128. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +3 -2
  129. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -0
  130. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +4 -1
  131. package/dist/NavigationMenu/AxosBank/SubNavBar.d.ts +1 -1
  132. package/dist/NavigationMenu/AxosBank/SubNavBar.js +11 -1
  133. package/dist/NavigationMenu/AxosBank/index.d.ts +1 -1
  134. package/dist/NavigationMenu/AxosBank/index.js +4 -3
  135. package/dist/NavigationMenu/AxosClearing/SubNavBar.d.ts +1 -1
  136. package/dist/NavigationMenu/AxosClearing/index.d.ts +1 -1
  137. package/dist/NavigationMenu/AxosFiduciary/index.d.ts +1 -1
  138. package/dist/NavigationMenu/LaVictoire/SubNavBar.d.ts +1 -1
  139. package/dist/NavigationMenu/LaVictoire/index.d.ts +1 -1
  140. package/dist/NavigationMenu/LaVictoire/index.js +3 -2
  141. package/dist/NavigationMenu/NavItem/index.d.ts +1 -1
  142. package/dist/NavigationMenu/Navbar.d.ts +1 -1
  143. package/dist/NavigationMenu/Navbar.js +2 -1
  144. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -3
  145. package/dist/NavigationMenu/SignInNavButton.js +3 -2
  146. package/dist/Pagination/Pagination.d.ts +1 -1
  147. package/dist/SecondaryFooter/index.d.ts +1 -1
  148. package/dist/SetContainer/SetContainer.d.ts +1 -1
  149. package/dist/SetContainer/SetContainer.js +3 -2
  150. package/dist/SocialMediaBar/iconsRepository.d.ts +14 -14
  151. package/dist/SocialMediaBar/iconsRepository.js +2 -1
  152. package/dist/SocialMediaBar/index.d.ts +1 -1
  153. package/dist/Tab/Tab.d.ts +1 -1
  154. package/dist/Tab/TabContainer.d.ts +1 -1
  155. package/dist/Table/Table.d.ts +5 -5
  156. package/dist/TextBlock/TextBlock.d.ts +1 -1
  157. package/dist/Topic/Topic.d.ts +4 -4
  158. package/dist/VideoTile/VideoInit.d.ts +1 -1
  159. package/dist/VideoTile/VideoTile.js +2 -1
  160. package/dist/VideoWrapper/index.js +2 -1
  161. package/dist/WalnutIframe/index.d.ts +1 -1
  162. package/dist/assets/Calculators/ApyCalculatorUserTest/ApyCalculatorUserTest.css +424 -0
  163. package/dist/icons/AxosX/Blue.d.ts +1 -1
  164. package/dist/icons/AxosX/index.d.ts +1 -1
  165. package/dist/icons/CheckCircle.d.ts +1 -1
  166. package/dist/icons/CheckCircleLight.d.ts +1 -1
  167. package/dist/icons/CheckIcon/index.d.ts +1 -1
  168. package/dist/icons/ChevronDown.d.ts +1 -1
  169. package/dist/icons/ChevronUp.d.ts +1 -1
  170. package/dist/icons/Clock/index.d.ts +1 -1
  171. package/dist/icons/EqualHousingLender.d.ts +1 -1
  172. package/dist/icons/Logos/AAS.d.ts +1 -1
  173. package/dist/icons/Logos/AFS.d.ts +1 -1
  174. package/dist/icons/Logos/AXA.d.ts +1 -1
  175. package/dist/icons/Logos/AXB.d.ts +1 -1
  176. package/dist/icons/Logos/AXC.d.ts +1 -1
  177. package/dist/icons/Logos/AXI.d.ts +1 -1
  178. package/dist/icons/Logos/AXOS.d.ts +1 -1
  179. package/dist/icons/Logos/GBLVF.d.ts +1 -1
  180. package/dist/icons/Logos/LVF.d.ts +1 -1
  181. package/dist/icons/Logos/LVFText.d.ts +1 -1
  182. package/dist/icons/Logos/SPB.d.ts +1 -1
  183. package/dist/icons/MemberFdicLogo.d.ts +1 -1
  184. package/dist/icons/QuoteIconGrey.d.ts +1 -1
  185. package/dist/icons/QuoteIconWhite.d.ts +1 -1
  186. package/dist/icons/QuoteIconYellow.d.ts +1 -1
  187. package/dist/main.js +2 -0
  188. package/dist/utils/allowedAxosDomains.js +2 -1
  189. package/package.json +1 -1
@@ -0,0 +1,618 @@
1
+ "use client";
2
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
+ import { useGlobalContext } from "../../Modal/contextApi/store.js";
4
+ import { getVariant } from "../../utils/getVariant.js";
5
+ import Image from "next/image.js";
6
+ import { button } from "../../Button/Button.css.js";
7
+ import { Field, Label, Input, Description, Listbox, ListboxButton, ListboxOptions, ListboxOption, Button, Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/react";
8
+ import { AnimatePresence, motion } from "framer-motion";
9
+ import { useState, useCallback, useEffect, useRef } from "react";
10
+ import { apy_calculator, section_header, header_theme, mt_8, calculator_section, apy_calculator_form, fieldset, field_row, relative, field_label, field_row_input, field_row_input_error, field_error, label_symbol, percent, listbox_button, chevron_icon, listbox_options, listbox_option, optional_badge, form_disclosure, calc_btn, results_wrapper, result_card, result_section, result_image, result_value, scrambling, result_value_label, result_item, result_item_label, result_item_value, definitions_accordion, definitions_button, definitions_h2, definitions_columns, definitions_panel, definitions_column, definitions_item, definitions_term, definitions_text, container } from "./ApyCalculatorUserTest.css.js";
11
+ const COMPOUNDING_OPTIONS = [
12
+ { value: 360, label: "Daily" },
13
+ { value: 12, label: "Monthly" },
14
+ { value: 4, label: "Quarterly" },
15
+ { value: 2, label: "Semi-Annual" },
16
+ { value: 1, label: "Yearly" }
17
+ ];
18
+ const CALCULATOR_DEFINITIONS = [
19
+ {
20
+ term: "Initial deposit",
21
+ description: "The amount of money you're starting with."
22
+ },
23
+ {
24
+ term: "APY (Annual Percentage Yield)",
25
+ description: "The rate your money earns in a year, with compounding included."
26
+ },
27
+ {
28
+ term: "Months",
29
+ description: "How long you plan to keep your money in the account."
30
+ },
31
+ {
32
+ term: "Compounding",
33
+ description: "How often interest is calculated and added to your balance. APY on bank accounts usually compounds monthly."
34
+ },
35
+ {
36
+ term: "Monthly deposits",
37
+ description: "Any additional amount you plan to contribute each month."
38
+ },
39
+ {
40
+ term: "Interest earned",
41
+ description: "The amount gained from interest over the selected time period."
42
+ },
43
+ {
44
+ term: "Ending balance",
45
+ description: "Your projected balance at the end of the selected time period, based on the inputs above."
46
+ },
47
+ {
48
+ term: "Total deposits",
49
+ description: "The total money you contribute, including your initial and monthly deposits."
50
+ }
51
+ ];
52
+ const SCRAMBLE_CHARS = "0123456789";
53
+ const STACKED_LAYOUT_MEDIA = "(max-width: 930px)";
54
+ const INTEREST_EARNED_ID = "interestEarned";
55
+ function useStackedLayout() {
56
+ const [isStacked, setIsStacked] = useState(false);
57
+ useEffect(() => {
58
+ const media = window.matchMedia(STACKED_LAYOUT_MEDIA);
59
+ const onChange = () => setIsStacked(media.matches);
60
+ onChange();
61
+ media.addEventListener("change", onChange);
62
+ return () => media.removeEventListener("change", onChange);
63
+ }, []);
64
+ return isStacked;
65
+ }
66
+ function scrambleCurrency(target, progress) {
67
+ const formatted = target.toLocaleString("en-US", {
68
+ style: "currency",
69
+ currency: "USD"
70
+ });
71
+ return formatted.split("").map((char) => {
72
+ if (char === "$" || char === "," || char === "." || char === "-") {
73
+ return char;
74
+ }
75
+ if (/\d/.test(char)) {
76
+ return Math.random() > progress ? SCRAMBLE_CHARS[Math.floor(Math.random() * SCRAMBLE_CHARS.length)] : char;
77
+ }
78
+ return char;
79
+ }).join("");
80
+ }
81
+ function useScramble(targetValue, duration = 700) {
82
+ const [display, setDisplay] = useState(
83
+ () => targetValue.toLocaleString("en-US", { style: "currency", currency: "USD" })
84
+ );
85
+ const [isScrambling, setIsScrambling] = useState(false);
86
+ const rafRef = useRef(null);
87
+ const startRef = useRef(0);
88
+ const prevTarget = useRef(targetValue);
89
+ useEffect(() => {
90
+ if (prevTarget.current === targetValue) return;
91
+ prevTarget.current = targetValue;
92
+ setIsScrambling(true);
93
+ startRef.current = Date.now();
94
+ const tick = () => {
95
+ const elapsed = Date.now() - startRef.current;
96
+ const progress = Math.min(elapsed / duration, 1);
97
+ if (progress < 1) {
98
+ setDisplay(scrambleCurrency(targetValue, progress));
99
+ rafRef.current = setTimeout(tick, 40);
100
+ } else {
101
+ setDisplay(
102
+ targetValue.toLocaleString("en-US", {
103
+ style: "currency",
104
+ currency: "USD"
105
+ })
106
+ );
107
+ setIsScrambling(false);
108
+ }
109
+ };
110
+ if (rafRef.current) clearTimeout(rafRef.current);
111
+ rafRef.current = setTimeout(tick, 40);
112
+ return () => {
113
+ if (rafRef.current) clearTimeout(rafRef.current);
114
+ };
115
+ }, [targetValue, duration]);
116
+ return { display, isScrambling };
117
+ }
118
+ function formatWithCommas(value) {
119
+ return value.toLocaleString("en-US");
120
+ }
121
+ function parseCurrencyInput(raw) {
122
+ const digits = raw.replace(/[^0-9]/g, "");
123
+ return digits === "" ? 0 : parseInt(digits, 10);
124
+ }
125
+ const ApyCalculatorUserTesting = ({
126
+ header,
127
+ body,
128
+ disclosure,
129
+ variant
130
+ }) => {
131
+ const { domains } = useGlobalContext();
132
+ const isStackedLayout = useStackedLayout();
133
+ const calculator_variant = getVariant(variant);
134
+ const [compoundingOption, setCompoundingOption] = useState(
135
+ COMPOUNDING_OPTIONS[1]
136
+ );
137
+ const compounding = compoundingOption.value;
138
+ const getAPR = useCallback(
139
+ (apy) => {
140
+ return Number.parseFloat(
141
+ (((1 + apy / 100) ** (1 / compounding) - 1) * compounding * 100).toFixed(2)
142
+ );
143
+ },
144
+ [compounding]
145
+ );
146
+ const AXOS_ONE_APY = Number(domains.AXOS_ONE_APY) || 4.21;
147
+ const [initialDeposit, setInitialDeposit] = useState(1e4);
148
+ const [initialDepositDisplay, setInitialDepositDisplay] = useState(
149
+ formatWithCommas(1e4)
150
+ );
151
+ const [APY, setAPY] = useState(AXOS_ONE_APY);
152
+ const [APYDisplay, setAPYDisplay] = useState(APY.toString());
153
+ const [months, setMonths] = useState(12);
154
+ const [monthsDisplay, setMonthsDisplay] = useState(months.toString());
155
+ const [monthlyDeposits, setMonthlyDeposits] = useState(100);
156
+ const [monthlyDepositsDisplay, setMonthlyDepositsDisplay] = useState(
157
+ formatWithCommas(100)
158
+ );
159
+ const [fieldErrors, setFieldErrors] = useState({});
160
+ const handleInitialDepositChange = (e) => {
161
+ const raw = e.target.value;
162
+ const num = parseCurrencyInput(raw);
163
+ setInitialDeposit(num);
164
+ setInitialDepositDisplay(num > 0 ? formatWithCommas(num) : "");
165
+ };
166
+ const handleMonthlyDepositsChange = (e) => {
167
+ const raw = e.target.value;
168
+ if (raw === "") {
169
+ setMonthlyDeposits(0);
170
+ setMonthlyDepositsDisplay("");
171
+ return;
172
+ }
173
+ const num = parseCurrencyInput(raw);
174
+ setMonthlyDeposits(num);
175
+ setMonthlyDepositsDisplay(formatWithCommas(num));
176
+ };
177
+ const handleMonthsChange = (e) => {
178
+ const raw = e.target.value;
179
+ const num = parseInt(raw.replace(/[^0-9]/g, ""), 10);
180
+ setMonths(num);
181
+ setMonthsDisplay(num > 0 ? num.toString() : "");
182
+ };
183
+ const handleAPYChange = (e) => {
184
+ const raw = e.target.value;
185
+ const num = parseFloat(raw.replace(/[^0-9.]/g, ""));
186
+ setAPY(num);
187
+ setAPYDisplay(raw.replace(/[^0-9.]/g, ""));
188
+ };
189
+ const [endingBalanceRaw, setEndingBalanceRaw] = useState(0);
190
+ const [totalDepositsRaw, setTotalDepositsRaw] = useState(0);
191
+ const [interestEarnedRaw, setInterestEarnedRaw] = useState(0);
192
+ const { display: endingBalanceDisplay, isScrambling: balanceScrambling } = useScramble(endingBalanceRaw);
193
+ const { display: totalDepositsDisplay, isScrambling: depositsScrambling } = useScramble(totalDepositsRaw);
194
+ const { display: interestEarnedDisplay, isScrambling: interestScrambling } = useScramble(interestEarnedRaw);
195
+ const midPoint = Math.ceil(CALCULATOR_DEFINITIONS.length / 2);
196
+ const leftDefinitions = CALCULATOR_DEFINITIONS.slice(0, midPoint);
197
+ const rightDefinitions = CALCULATOR_DEFINITIONS.slice(midPoint);
198
+ const scrollToInterestEarned = useCallback(() => {
199
+ document.getElementById(INTEREST_EARNED_ID)?.scrollIntoView({
200
+ behavior: "smooth",
201
+ block: "start"
202
+ });
203
+ }, []);
204
+ const calculate = useCallback(() => {
205
+ const newErrors = {};
206
+ if (!initialDeposit || initialDeposit <= 0 || Number.isNaN(initialDeposit)) {
207
+ newErrors.initialDeposit = "Please enter an amount greater than 0.";
208
+ }
209
+ if (!months || months < 1 || Number.isNaN(months)) {
210
+ newErrors.months = "Please enter a term of at least 1 month.";
211
+ }
212
+ if (monthlyDeposits < 0 || Number.isNaN(monthlyDeposits)) {
213
+ newErrors.monthlyDeposits = "Monthly deposit amount cannot be negative.";
214
+ }
215
+ if (!APY || APY <= 0 || Number.isNaN(APY)) {
216
+ newErrors.APY = "Please enter a valid APY greater than 0.";
217
+ }
218
+ setFieldErrors(newErrors);
219
+ if (Object.keys(newErrors).length > 0) return false;
220
+ const APR = getAPR(APY);
221
+ const interestRate = 0.01 * APR;
222
+ let total;
223
+ if (compounding === 360) {
224
+ total = initialDeposit * Math.pow(1 + interestRate / compounding, 30 * months) + (monthlyDeposits > 0 ? monthlyDeposits / (interestRate / 12) * (Math.pow(1 + interestRate / compounding, 30 * months) - 1) : 0);
225
+ } else if (compounding === 12) {
226
+ total = initialDeposit * Math.pow(1 + interestRate / compounding, months) + (monthlyDeposits > 0 ? monthlyDeposits / (interestRate / 12) * (Math.pow(1 + interestRate / compounding, months) - 1) : 0);
227
+ } else if (compounding === 4) {
228
+ total = initialDeposit * Math.pow(1 + interestRate / compounding, months / 3) + (monthlyDeposits > 0 ? monthlyDeposits / (interestRate / 12) * (Math.pow(1 + interestRate / compounding, months / 3) - 1) : 0);
229
+ } else if (compounding === 2) {
230
+ total = initialDeposit * Math.pow(1 + interestRate / compounding, months / 6) + (monthlyDeposits > 0 ? monthlyDeposits / (interestRate / 12) * (Math.pow(1 + interestRate / compounding, months / 6) - 1) : 0);
231
+ } else if (compounding === 1) {
232
+ total = initialDeposit * Math.pow(1 + interestRate, months / 12) + (monthlyDeposits > 0 ? monthlyDeposits / (interestRate / 12) * (Math.pow(1 + interestRate / compounding, months / 12) - 1) : 0);
233
+ } else {
234
+ total = initialDeposit;
235
+ for (let i = 0; i < months; i++) {
236
+ total += monthlyDeposits;
237
+ total *= Math.pow(1 + interestRate / compounding, compounding / 12);
238
+ }
239
+ }
240
+ const deposits = initialDeposit + monthlyDeposits * months;
241
+ const interest = total - deposits;
242
+ setEndingBalanceRaw(total);
243
+ setTotalDepositsRaw(deposits);
244
+ setInterestEarnedRaw(interest > 0 ? interest : 0);
245
+ return true;
246
+ }, [initialDeposit, APY, months, monthlyDeposits, compounding, getAPR]);
247
+ const handleCalculateClick = useCallback(() => {
248
+ const didCalculate = calculate();
249
+ if (!didCalculate || !isStackedLayout) return;
250
+ requestAnimationFrame(() => {
251
+ scrollToInterestEarned();
252
+ });
253
+ }, [calculate, isStackedLayout, scrollToInterestEarned]);
254
+ useEffect(() => {
255
+ calculate();
256
+ }, []);
257
+ return /* @__PURE__ */ jsxs(
258
+ "section",
259
+ {
260
+ className: `${container({ variant: getVariant(variant) })} ${apy_calculator}`,
261
+ children: [
262
+ (header || body) && /* @__PURE__ */ jsxs("div", { className: `${section_header} containment`, children: [
263
+ header && /* @__PURE__ */ jsx(
264
+ "h1",
265
+ {
266
+ className: `header_1 ${header_theme({ variant: calculator_variant })}`,
267
+ children: header
268
+ }
269
+ ),
270
+ body && /* @__PURE__ */ jsx("div", { className: mt_8, children: body })
271
+ ] }),
272
+ /* @__PURE__ */ jsxs(
273
+ "div",
274
+ {
275
+ className: `${apy_calculator} flex between`,
276
+ style: { paddingBlock: "0px" },
277
+ children: [
278
+ /* @__PURE__ */ jsx("div", { className: calculator_section, children: /* @__PURE__ */ jsx("form", { id: "calculator_form", className: apy_calculator_form, children: /* @__PURE__ */ jsxs("div", { className: fieldset, children: [
279
+ /* @__PURE__ */ jsxs(
280
+ Field,
281
+ {
282
+ className: `${field_row} ${relative} flex flex_col`,
283
+ style: { marginTop: 0 },
284
+ children: [
285
+ /* @__PURE__ */ jsx(Label, { className: field_label, children: "Initial Deposit" }),
286
+ /* @__PURE__ */ jsx(
287
+ Input,
288
+ {
289
+ className: `${field_row_input} ${fieldErrors.initialDeposit ? ` ${field_row_input_error}` : ""}`,
290
+ id: "initDeposit",
291
+ type: "text",
292
+ inputMode: "numeric",
293
+ name: "initDeposit",
294
+ value: initialDepositDisplay ? `$${initialDepositDisplay}` : "",
295
+ onChange: handleInitialDepositChange,
296
+ "aria-invalid": !!fieldErrors.initialDeposit,
297
+ "aria-describedby": fieldErrors.initialDeposit ? "initDeposit-error" : void 0
298
+ }
299
+ ),
300
+ fieldErrors.initialDeposit && /* @__PURE__ */ jsx(
301
+ Description,
302
+ {
303
+ as: "span",
304
+ id: "initDeposit-error",
305
+ className: field_error,
306
+ role: "alert",
307
+ children: fieldErrors.initialDeposit
308
+ }
309
+ )
310
+ ]
311
+ }
312
+ ),
313
+ /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
314
+ /* @__PURE__ */ jsx(Label, { className: field_label, children: "APY (Annual Percentage Yield)" }),
315
+ /* @__PURE__ */ jsx(
316
+ "span",
317
+ {
318
+ className: `${label_symbol} ${percent}`,
319
+ "aria-hidden": "true",
320
+ children: "%"
321
+ }
322
+ ),
323
+ /* @__PURE__ */ jsx(
324
+ Input,
325
+ {
326
+ className: `${field_row_input} ${fieldErrors.APY ? ` ${field_row_input_error}` : ""}`,
327
+ id: "apy",
328
+ type: "text",
329
+ inputMode: "numeric",
330
+ name: "apy",
331
+ value: APYDisplay,
332
+ onChange: handleAPYChange,
333
+ onWheel: (e) => e.currentTarget.blur(),
334
+ "aria-invalid": !!fieldErrors.APY,
335
+ "aria-describedby": fieldErrors.APY ? "apy-error" : void 0
336
+ }
337
+ ),
338
+ fieldErrors.APY && /* @__PURE__ */ jsx(
339
+ Description,
340
+ {
341
+ as: "span",
342
+ id: "apy-error",
343
+ className: field_error,
344
+ role: "alert",
345
+ children: fieldErrors.APY
346
+ }
347
+ )
348
+ ] }),
349
+ /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
350
+ /* @__PURE__ */ jsx(Label, { className: field_label, children: "Months" }),
351
+ /* @__PURE__ */ jsx(
352
+ Input,
353
+ {
354
+ className: `${field_row_input}${fieldErrors.months ? ` ${field_row_input_error}` : ""}`,
355
+ id: "months",
356
+ min: 1,
357
+ type: "text",
358
+ inputMode: "numeric",
359
+ name: "months",
360
+ value: monthsDisplay,
361
+ onChange: handleMonthsChange,
362
+ "aria-invalid": !!fieldErrors.months,
363
+ "aria-describedby": fieldErrors.months ? "months-error" : void 0
364
+ }
365
+ ),
366
+ fieldErrors.months && /* @__PURE__ */ jsx(
367
+ Description,
368
+ {
369
+ as: "span",
370
+ id: "months-error",
371
+ className: field_error,
372
+ role: "alert",
373
+ children: fieldErrors.months
374
+ }
375
+ )
376
+ ] }),
377
+ /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
378
+ /* @__PURE__ */ jsx(Label, { className: field_label, htmlFor: "compounding", children: "Compounding" }),
379
+ /* @__PURE__ */ jsxs(
380
+ Listbox,
381
+ {
382
+ value: compoundingOption,
383
+ onChange: setCompoundingOption,
384
+ children: [
385
+ /* @__PURE__ */ jsxs(
386
+ ListboxButton,
387
+ {
388
+ id: "compounding",
389
+ className: `${listbox_button} ${field_row_input}`,
390
+ children: [
391
+ /* @__PURE__ */ jsx("span", { children: compoundingOption.label }),
392
+ /* @__PURE__ */ jsx(
393
+ "svg",
394
+ {
395
+ className: chevron_icon,
396
+ xmlns: "http://www.w3.org/2000/svg",
397
+ viewBox: "0 0 20 20",
398
+ fill: "currentColor",
399
+ "aria-hidden": "true",
400
+ children: /* @__PURE__ */ jsx(
401
+ "path",
402
+ {
403
+ fillRule: "evenodd",
404
+ d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
405
+ clipRule: "evenodd"
406
+ }
407
+ )
408
+ }
409
+ )
410
+ ]
411
+ }
412
+ ),
413
+ /* @__PURE__ */ jsx(
414
+ ListboxOptions,
415
+ {
416
+ anchor: "bottom start",
417
+ className: listbox_options,
418
+ children: COMPOUNDING_OPTIONS.map((opt) => /* @__PURE__ */ jsx(
419
+ ListboxOption,
420
+ {
421
+ value: opt,
422
+ className: listbox_option,
423
+ children: opt.label
424
+ },
425
+ opt.value
426
+ ))
427
+ }
428
+ )
429
+ ]
430
+ }
431
+ )
432
+ ] }),
433
+ /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
434
+ /* @__PURE__ */ jsxs(Label, { className: field_label, children: [
435
+ "Monthly Deposits",
436
+ " ",
437
+ /* @__PURE__ */ jsx("span", { className: optional_badge, children: "(optional)" })
438
+ ] }),
439
+ /* @__PURE__ */ jsx(
440
+ Input,
441
+ {
442
+ className: `${field_row_input} ${fieldErrors.monthlyDeposits ? ` ${field_row_input_error}` : ""}`,
443
+ id: "monthlyDeposits",
444
+ type: "text",
445
+ inputMode: "numeric",
446
+ name: "monthlyDeposits",
447
+ value: monthlyDepositsDisplay ? `$${monthlyDepositsDisplay}` : "",
448
+ placeholder: "0",
449
+ onChange: handleMonthlyDepositsChange,
450
+ "aria-invalid": !!fieldErrors.monthlyDeposits,
451
+ "aria-describedby": fieldErrors.monthlyDeposits ? "monthlyDeposits-error" : void 0
452
+ }
453
+ ),
454
+ fieldErrors.monthlyDeposits && /* @__PURE__ */ jsx(
455
+ Description,
456
+ {
457
+ as: "span",
458
+ id: "monthlyDeposits-error",
459
+ className: field_error,
460
+ role: "alert",
461
+ children: fieldErrors.monthlyDeposits
462
+ }
463
+ )
464
+ ] }),
465
+ disclosure && /* @__PURE__ */ jsx("div", { className: `${form_disclosure} push_up_24`, children: disclosure }),
466
+ /* @__PURE__ */ jsx("div", { className: "flex center push_up", children: /* @__PURE__ */ jsx(
467
+ Button,
468
+ {
469
+ type: "button",
470
+ onClick: handleCalculateClick,
471
+ className: `${button({ color: "primary", size: "large", rounded: "medium" })} ${calc_btn}`,
472
+ children: "Calculate"
473
+ }
474
+ ) })
475
+ ] }) }) }),
476
+ /* @__PURE__ */ jsx("div", { className: results_wrapper, children: /* @__PURE__ */ jsxs("div", { className: result_card, children: [
477
+ /* @__PURE__ */ jsxs(
478
+ "div",
479
+ {
480
+ id: INTEREST_EARNED_ID,
481
+ className: result_section,
482
+ "aria-live": "polite",
483
+ "aria-atomic": "true",
484
+ "aria-label": `Interest earned: ${interestEarnedDisplay}`,
485
+ children: [
486
+ /* @__PURE__ */ jsx(
487
+ Image,
488
+ {
489
+ src: "https://www.axos.com/images/5IyqVlv7El9K7hAX0vIGWG/axb-25th-growth-lg.png",
490
+ alt: "",
491
+ height: 173,
492
+ width: 202,
493
+ className: `img_fluid ${result_image}`,
494
+ priority: true
495
+ }
496
+ ),
497
+ /* @__PURE__ */ jsx(
498
+ "div",
499
+ {
500
+ className: `${result_value} ${interestScrambling ? scrambling : ""}`,
501
+ children: interestEarnedDisplay
502
+ }
503
+ ),
504
+ /* @__PURE__ */ jsx("div", { className: result_value_label, children: "Interest Earned" })
505
+ ]
506
+ }
507
+ ),
508
+ /* @__PURE__ */ jsxs("div", { "aria-live": "polite", "aria-atomic": "true", children: [
509
+ /* @__PURE__ */ jsxs("div", { className: result_item, children: [
510
+ /* @__PURE__ */ jsx("span", { className: result_item_label, children: "Ending Balance:" }),
511
+ /* @__PURE__ */ jsx(
512
+ "span",
513
+ {
514
+ className: `${result_item_value} ${balanceScrambling ? scrambling : ""}`,
515
+ children: endingBalanceDisplay
516
+ }
517
+ )
518
+ ] }),
519
+ /* @__PURE__ */ jsxs("div", { className: result_item, children: [
520
+ /* @__PURE__ */ jsx("span", { className: result_item_label, children: "Total Deposits:" }),
521
+ /* @__PURE__ */ jsx(
522
+ "span",
523
+ {
524
+ className: `${result_item_value} ${depositsScrambling ? scrambling : ""}`,
525
+ children: totalDepositsDisplay
526
+ }
527
+ )
528
+ ] })
529
+ ] })
530
+ ] }) })
531
+ ]
532
+ }
533
+ ),
534
+ /* @__PURE__ */ jsx("div", { id: "definitions", className: "push_up_24", children: /* @__PURE__ */ jsx(
535
+ "div",
536
+ {
537
+ className: `${definitions_accordion} ${apy_calculator}`,
538
+ "aria-label": "Calculator definitions",
539
+ style: { paddingBlock: "0px" },
540
+ children: /* @__PURE__ */ jsx(Disclosure, { children: ({ open }) => /* @__PURE__ */ jsxs(Fragment, { children: [
541
+ /* @__PURE__ */ jsxs(DisclosureButton, { className: definitions_button, children: [
542
+ /* @__PURE__ */ jsx(
543
+ "h2",
544
+ {
545
+ className: definitions_h2({ variant: getVariant(variant) }),
546
+ children: "Calculator definitions"
547
+ }
548
+ ),
549
+ /* @__PURE__ */ jsx(
550
+ "svg",
551
+ {
552
+ xmlns: "http://www.w3.org/2000/svg",
553
+ width: "20",
554
+ height: "20",
555
+ viewBox: "0 0 20 20",
556
+ fill: "none",
557
+ "aria-hidden": "true",
558
+ children: /* @__PURE__ */ jsx(
559
+ "path",
560
+ {
561
+ d: "M10 1.25C14.8325 1.25 18.75 5.16751 18.75 10C18.75 14.8325 14.8325 18.75 10 18.75C5.16751 18.75 1.25 14.8325 1.25 10C1.25 5.16751 5.16751 1.25 10 1.25ZM10 2.5C5.85786 2.5 2.5 5.85786 2.5 10C2.5 14.1421 5.85786 17.5 10 17.5C14.1421 17.5 17.5 14.1421 17.5 10C17.5 5.85786 14.1421 2.5 10 2.5ZM10.625 8.75V14.375H9.375V8.75H10.625ZM10 5.625C10.5178 5.625 10.9375 6.04473 10.9375 6.5625C10.9375 7.08027 10.5178 7.5 10 7.5C9.48223 7.5 9.0625 7.08027 9.0625 6.5625C9.0625 6.04473 9.48223 5.625 10 5.625Z",
562
+ fill: "#435164"
563
+ }
564
+ )
565
+ }
566
+ )
567
+ ] }),
568
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: open && /* @__PURE__ */ jsx(
569
+ DisclosurePanel,
570
+ {
571
+ static: true,
572
+ as: motion.div,
573
+ initial: { opacity: 0, height: 0, y: -6 },
574
+ animate: { opacity: 1, height: "auto", y: 0 },
575
+ exit: { opacity: 0, height: 0, y: -4 },
576
+ style: { overflow: "hidden" },
577
+ children: /* @__PURE__ */ jsxs(
578
+ "div",
579
+ {
580
+ className: `${definitions_columns} ${definitions_panel}`,
581
+ children: [
582
+ /* @__PURE__ */ jsx("div", { className: definitions_column, children: leftDefinitions.map((definition) => /* @__PURE__ */ jsxs(
583
+ "div",
584
+ {
585
+ className: definitions_item,
586
+ children: [
587
+ /* @__PURE__ */ jsx("h3", { className: definitions_term, children: definition.term }),
588
+ /* @__PURE__ */ jsx("p", { className: definitions_text, children: definition.description })
589
+ ]
590
+ },
591
+ definition.term
592
+ )) }),
593
+ /* @__PURE__ */ jsx("div", { className: definitions_column, children: rightDefinitions.map((definition) => /* @__PURE__ */ jsxs(
594
+ "div",
595
+ {
596
+ className: definitions_item,
597
+ children: [
598
+ /* @__PURE__ */ jsx("h3", { className: definitions_term, children: definition.term }),
599
+ /* @__PURE__ */ jsx("p", { className: definitions_text, children: definition.description })
600
+ ]
601
+ },
602
+ definition.term
603
+ )) })
604
+ ]
605
+ }
606
+ )
607
+ }
608
+ ) })
609
+ ] }) })
610
+ }
611
+ ) })
612
+ ]
613
+ }
614
+ );
615
+ };
616
+ export {
617
+ ApyCalculatorUserTesting
618
+ };
@@ -16,4 +16,4 @@ export interface CalculatorProps {
16
16
  initialBalance?: number;
17
17
  callToActionRow?: ChevronProps[];
18
18
  }
19
- export declare const Calculator: (props: CalculatorProps) => React.JSX.Element;
19
+ export declare const Calculator: (props: CalculatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -36,6 +36,7 @@ import "../Auth/SignInPassword.js";
36
36
  /* empty css */
37
37
  import { AnnualFeeCalculator } from "./AnnualFeeCalculator/index.js";
38
38
  import { ApyCalculator } from "./ApyCalculator/index.js";
39
+ import { ApyCalculatorUserTesting } from "./ApyCalculatorUserTest/index.js";
39
40
  import { AxosOneCalculator } from "./AxosOneCalculator/index.js";
40
41
  import { BalanceAPYCalculator } from "./BalanceAPYCalculator/index.js";
41
42
  import { BuyDownCalculator } from "./BuyDownCalculator/index.js";
@@ -175,6 +176,16 @@ const Calculator = (props) => {
175
176
  disclosure
176
177
  }
177
178
  );
179
+ } else if (resolvedName === "APY User Testing") {
180
+ return /* @__PURE__ */ jsx(
181
+ ApyCalculatorUserTesting,
182
+ {
183
+ header: headline,
184
+ body: bodyCopy,
185
+ variant,
186
+ disclosure
187
+ }
188
+ );
178
189
  } else if (resolvedName === "Monthly Payment") {
179
190
  return /* @__PURE__ */ jsx(
180
191
  MonthlyPaymentCalculator,
@@ -26,6 +26,9 @@ import "../../AlertBanner/AlertBanner.css.js";
26
26
  import "../../Article/Article.css.js";
27
27
  import "../../ArticlesSet/ArticlesSet.css.js";
28
28
  import "../AnnualFeeCalculator/AnnualFeeCalculator.css.js";
29
+ import { useGlobalContext } from "../../Modal/contextApi/store.js";
30
+ import "next/image.js";
31
+ import "../ApyCalculatorUserTest/ApyCalculatorUserTest.css.js";
29
32
  import "../../Table/Table.css.js";
30
33
  import "../AxosOneCalculator/BalanceAPYCalculator.css.js";
31
34
  import "../BalanceAPYCalculator/BalanceAPYCalculator.css.js";
@@ -60,7 +63,6 @@ import "../../Hyperlink/Hyperlink.css.js";
60
63
  import "iframe-resizer";
61
64
  import "../MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js";
62
65
  import "../MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.js";
63
- import { useGlobalContext } from "../../Modal/contextApi/store.js";
64
66
  import "../SummitApyCalculator/BalanceAPYCalculator.css.js";
65
67
  /* empty css */
66
68
  import "react-dom";
@@ -80,7 +82,6 @@ import "../../Chatbot/Chatbot.js";
80
82
  import "../../Chatbot/store/messages.js";
81
83
  /* empty css */
82
84
  import "../../Comparison/Comparison.css.js";
83
- import "next/image.js";
84
85
  import "../../HeroBanner/LargeBanner.css.js";
85
86
  import "../../HeroBanner/HeroBanner.css.js";
86
87
  import "../../HeroBanner/SelectionBanner.css.js";