@axos-web-dev/shared-components 2.0.0-dev.13-stepForm.4 → 2.0.0-dev.14-modal-iFrame

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 (107) hide show
  1. package/dist/ATMLocator/ATMLocator.js +2 -4
  2. package/dist/Accordion/Accordion.js +1 -2
  3. package/dist/AlertBanner/index.js +1 -2
  4. package/dist/Auth/ErrorAlert.js +1 -3
  5. package/dist/BulletItem/BulletItem.js +1 -2
  6. package/dist/Button/Button.js +2 -4
  7. package/dist/Calculators/AxosOneCalculator/index.js +1 -2
  8. package/dist/Calculators/BalanceAPYCalculator/index.js +1 -2
  9. package/dist/Calculators/Calculator.js +1 -3
  10. package/dist/Calculators/MarginTradingCalculator/index.js +2 -4
  11. package/dist/Calculators/SummitApyCalculator/index.js +1 -2
  12. package/dist/Carousel/index.js +2 -4
  13. package/dist/Chevron/index.js +2 -4
  14. package/dist/CollectInformationAlert/index.js +1 -2
  15. package/dist/Comparison/Comparison.css.js +1 -2
  16. package/dist/Comparison/Comparison.js +3 -5
  17. package/dist/DownloadTile/index.js +0 -1
  18. package/dist/ExecutiveBio/ExecutiveBio.js +1 -3
  19. package/dist/FaqAccordion/index.js +2 -4
  20. package/dist/FooterDisclosure/LVF/LaVictorieFooter.js +1 -2
  21. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +2 -4
  22. package/dist/Forms/ApplicationStart.js +1 -2
  23. package/dist/Forms/ApplyNow.js +2 -4
  24. package/dist/Forms/BoatMooringLocation.js +1 -2
  25. package/dist/Forms/ClearingForm.js +1 -2
  26. package/dist/Forms/CommercialDeposits.js +1 -2
  27. package/dist/Forms/CommercialDepositsNoLendingOption.js +1 -2
  28. package/dist/Forms/CommercialLending.js +1 -2
  29. package/dist/Forms/CommercialPremiumFinance.js +1 -2
  30. package/dist/Forms/ConstructionLendingDynamic.js +1 -2
  31. package/dist/Forms/ContactCompany.js +1 -2
  32. package/dist/Forms/ContactCompanyTitle.js +1 -2
  33. package/dist/Forms/ContactUs.js +1 -2
  34. package/dist/Forms/ContactUsAAS.js +1 -2
  35. package/dist/Forms/ContactUsBusiness.js +2 -4
  36. package/dist/Forms/ContactUsBusinessNameEmail.js +2 -4
  37. package/dist/Forms/ContactUsLVF.js +1 -2
  38. package/dist/Forms/ContactUsNMLSId.js +2 -4
  39. package/dist/Forms/CpraRequest.js +2 -4
  40. package/dist/Forms/CraPublicFile.js +2 -4
  41. package/dist/Forms/DealerServices.js +1 -2
  42. package/dist/Forms/EmailOnly.js +2 -4
  43. package/dist/Forms/EmailUs.js +1 -2
  44. package/dist/Forms/MortgageRate/MortgageRateForm.js +2 -4
  45. package/dist/Forms/MortgageRate/MortgageRateWatch.js +2 -4
  46. package/dist/Forms/MortgageWarehouseLending.js +2 -4
  47. package/dist/Forms/QuickPricer/QuickPricerForm.js +1 -2
  48. package/dist/Forms/ScheduleCall.js +1 -2
  49. package/dist/Forms/ScheduleCallPremier.js +1 -2
  50. package/dist/Forms/SuccesForm.js +1 -3
  51. package/dist/Forms/WcplSurvey.js +1 -2
  52. package/dist/Forms/index.d.ts +0 -1
  53. package/dist/Forms/index.js +0 -2
  54. package/dist/HeroBanner/HeroBanner.js +1 -2
  55. package/dist/HeroBanner/LargeHeroBanner.js +1 -2
  56. package/dist/Hyperlink/index.js +2 -4
  57. package/dist/ImageBillboard/ImageBillboard.js +1 -2
  58. package/dist/ImageBillboard/ImageBillboardSet.js +1 -2
  59. package/dist/ImageLink/ImageLink.js +2 -4
  60. package/dist/ImageLink/ImageLinkSet.js +2 -4
  61. package/dist/ImageLink/index.js +2 -4
  62. package/dist/Insight/Featured/CategorySelector.js +2 -4
  63. package/dist/Insight/Featured/Featured.js +2 -4
  64. package/dist/Insight/Featured/Header.js +2 -4
  65. package/dist/Interstitial/Interstitial.d.ts +3 -0
  66. package/dist/Interstitial/Interstitial.js +37 -1
  67. package/dist/Interstitial/Interstitial.module.js +16 -10
  68. package/dist/LandingPageHeader/LandingPageHeader.js +1 -2
  69. package/dist/Modal/Modal.js +2 -4
  70. package/dist/NavigationMenu/AxosALTS/index.js +2 -4
  71. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +2 -4
  72. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +27 -27
  73. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +4 -2
  74. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +6 -4
  75. package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -4
  76. package/dist/NavigationMenu/AxosBank/index.js +29 -21
  77. package/dist/NavigationMenu/LaVictoire/index.js +2 -4
  78. package/dist/NavigationMenu/Navbar.js +2 -4
  79. package/dist/NavigationMenu/SignInNavButton.js +2 -4
  80. package/dist/Pagination/Pagination.js +1 -2
  81. package/dist/SetContainer/SetContainer.js +2 -4
  82. package/dist/SocialMediaBar/iconsRepository.js +2 -4
  83. package/dist/Table/Table.js +1 -2
  84. package/dist/VideoTile/VideoTile.js +2 -4
  85. package/dist/VideoWrapper/index.js +2 -4
  86. package/dist/assets/Interstitial/Interstitial.css +43 -23
  87. package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css +49 -49
  88. package/dist/icons/index.d.ts +0 -1
  89. package/dist/icons/index.js +0 -2
  90. package/dist/main.js +0 -4
  91. package/package.json +1 -1
  92. package/dist/Forms/MortgageRate/MortgageRateStep.css.d.ts +0 -48
  93. package/dist/Forms/MortgageRate/MortgageRateStep.css.js +0 -100
  94. package/dist/Forms/MortgageRate/MortgageRateStep.d.ts +0 -1
  95. package/dist/Forms/MortgageRate/MortgageRateStep.js +0 -911
  96. package/dist/Forms/MortgageRate/mortgageLeadForm.config.d.ts +0 -101
  97. package/dist/Forms/MortgageRate/mortgageLeadForm.config.js +0 -57
  98. package/dist/Forms/MortgageRate/mortgageLeadForm.types.d.ts +0 -29
  99. package/dist/Forms/MortgageRate/mortgageLeadForm.types.js +0 -1
  100. package/dist/Forms/MortgageRate/mortgageLeadForm.utils.d.ts +0 -11
  101. package/dist/Forms/MortgageRate/mortgageLeadForm.utils.js +0 -74
  102. package/dist/assets/Forms/MortgageRate/MortgageRateStep.css +0 -364
  103. package/dist/assets/icons/AlertBell/AlertBellIcon.css +0 -6
  104. package/dist/icons/AlertBell/AlertBellIcon.css.d.ts +0 -1
  105. package/dist/icons/AlertBell/AlertBellIcon.css.js +0 -5
  106. package/dist/icons/AlertBell/index.d.ts +0 -1
  107. package/dist/icons/AlertBell/index.js +0 -57
@@ -1,911 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useState, useRef, useMemo, useEffect } from "react";
4
- import { AnimatePresence, motion } from "framer-motion";
5
- import { Button, Field, Label, Input, RadioGroup, Radio } from "@headlessui/react";
6
- import { section, formShell, successWrap, successTitle, successText, disclosure, disclosureTitle, disclosureText, mainTitle, mainDescription, progressWrap, progressRow, progressLabel, progressTrack, progressFill, stepPanel, title, description, actions, secondaryButton, primaryButton, disclosureTextSm, overlayOpacity, inputGrid, inputRowTwo, fieldBlock, fieldLabel, input, errorText, optionalText, radioOption, radioOptionChecked, radioText, autoAdvanceHint, sliderWrap, sliderHeader, sliderValue, slider, helperText, amountPreview, amountPreviewLabel, amountPreviewValue, radioGrid, autoAdvanceStatus, autoAdvanceText, autoAdvanceTrack, autoAdvanceBar } from "./MortgageRateStep.css.js";
7
- import { fixedLoanTermOptions, armLoanTermOptions, fixedLoanTypeOptions, amortizationTypeOptions, creditScoreOptions, propertyUseOptions, propertyTypeOptions, mortgageTypeOptions } from "./mortgageLeadForm.config.js";
8
- import { parseCurrencyInput, formatCurrency, formatPhoneInput, formatPercentInput, formatCurrencyInput, calculatePercentAmount, validateZipCode, validateEmail, validatePhone } from "./mortgageLeadForm.utils.js";
9
- import "../../icons/ArrowIcon/ArrowIcon.css.js";
10
- import "../../icons/CheckIcon/CheckIcon.css.js";
11
- import '../../assets/icons/FollowIcon/FollowIcon.css';import '../../assets/icons/DownloadIcon/DownloadIcon.css';import '../../assets/themes/victorie.css';import '../../assets/themes/ufb.css';import '../../assets/themes/premier.css';import '../../assets/themes/axos.css';/* empty css */
12
- /* empty css */
13
- /* empty css */
14
- /* empty css */
15
- /* empty css */
16
- /* empty css */
17
- import { AlertBellIcon } from "../../icons/AlertBell/index.js";
18
- import { Overlay } from "../../ExecutiveBio/Overlay.js";
19
- import { overlay } from "../../ExecutiveBio/ExecutiveBio.css.js";
20
- const AUTO_ADVANCE_DELAY = 1e3;
21
- const initialValues = {
22
- mortgageType: "",
23
- propertyType: "",
24
- propertyUse: "",
25
- creditScore: "",
26
- purchasePrice: "",
27
- downPaymentPercent: 10,
28
- downPaymentAmount: "",
29
- estimatedHomeValue: "",
30
- currentLoanBalance: "",
31
- cashOutAmount: "",
32
- zipCode: "",
33
- amortizationType: "",
34
- fixedLoanType: "",
35
- loanTerm: "",
36
- desiredRate: "",
37
- discountPoints: "",
38
- firstName: "",
39
- lastName: "",
40
- email: "",
41
- phoneNumber: ""
42
- };
43
- function MortgageRateStep() {
44
- const [currentStepIndex, setCurrentStepIndex] = useState(0);
45
- const [values, setValues] = useState(initialValues);
46
- const [errors, setErrors] = useState({});
47
- const [submitted, setSubmitted] = useState(false);
48
- const [isAutoAdvancing, setIsAutoAdvancing] = useState(false);
49
- const [lastInteractedRadioStep, setLastInteractedRadioStep] = useState(null);
50
- const [radioSelectionVersion, setRadioSelectionVersion] = useState(0);
51
- const autoAdvanceTimeout = useRef(null);
52
- const isPurchase = values.mortgageType === "purchase-rates";
53
- const isRefinance = values.mortgageType === "refinance-rates";
54
- const showFixedLoanTypeStep = values.amortizationType === "fixed";
55
- const steps = useMemo(() => {
56
- const base = [
57
- "mortgageType",
58
- "propertyType",
59
- "propertyUse",
60
- "creditScore",
61
- "propertyDetails",
62
- "amortizationType"
63
- ];
64
- if (showFixedLoanTypeStep) {
65
- base.push("fixedLoanType");
66
- }
67
- base.push("loanTerm", "finalDetails", "contact");
68
- return base;
69
- }, [showFixedLoanTypeStep]);
70
- const totalSteps = steps.length;
71
- const stepKey = steps[currentStepIndex];
72
- const progress = (currentStepIndex + 1) / totalSteps * 100;
73
- const purchaseDownPaymentPreview = useMemo(() => {
74
- const raw = parseCurrencyInput(values.downPaymentAmount);
75
- return formatCurrency(raw);
76
- }, [values.downPaymentAmount]);
77
- const clearAutoAdvance = () => {
78
- if (autoAdvanceTimeout.current) {
79
- clearTimeout(autoAdvanceTimeout.current);
80
- autoAdvanceTimeout.current = null;
81
- }
82
- setIsAutoAdvancing(false);
83
- };
84
- useEffect(() => {
85
- return () => clearAutoAdvance();
86
- }, []);
87
- const updateValue = (key, value) => {
88
- setValues((prev) => {
89
- const next = { ...prev, [key]: value };
90
- if (key === "purchasePrice") {
91
- next.downPaymentAmount = calculatePercentAmount(
92
- String(value),
93
- next.downPaymentPercent
94
- );
95
- }
96
- if (key === "downPaymentPercent") {
97
- next.downPaymentAmount = calculatePercentAmount(
98
- next.purchasePrice,
99
- Number(value)
100
- );
101
- }
102
- if (key === "amortizationType") {
103
- next.fixedLoanType = "";
104
- next.loanTerm = "";
105
- }
106
- return next;
107
- });
108
- setErrors((prev) => {
109
- const next = { ...prev };
110
- delete next[String(key)];
111
- return next;
112
- });
113
- };
114
- const validateStep = (step) => {
115
- const nextErrors = {};
116
- if (step === "mortgageType" && !values.mortgageType) {
117
- nextErrors.mortgageType = "Please select a mortgage type.";
118
- }
119
- if (step === "propertyType" && !values.propertyType) {
120
- nextErrors.propertyType = "Please select a property type.";
121
- }
122
- if (step === "propertyUse" && !values.propertyUse) {
123
- nextErrors.propertyUse = "Please select how the property will be used.";
124
- }
125
- if (step === "creditScore" && !values.creditScore) {
126
- nextErrors.creditScore = "Please select your estimated credit score.";
127
- }
128
- if (step === "propertyDetails") {
129
- if (isPurchase) {
130
- if (!values.purchasePrice.trim()) {
131
- nextErrors.purchasePrice = "Please enter a purchase price.";
132
- }
133
- if (!values.zipCode.trim()) {
134
- nextErrors.zipCode = "Please enter a ZIP Code.";
135
- } else if (!validateZipCode(values.zipCode)) {
136
- nextErrors.zipCode = "Please enter a valid 5-digit ZIP Code.";
137
- }
138
- }
139
- if (isRefinance) {
140
- if (!values.estimatedHomeValue.trim()) {
141
- nextErrors.estimatedHomeValue = "Please enter an estimated home value.";
142
- }
143
- if (!values.currentLoanBalance.trim()) {
144
- nextErrors.currentLoanBalance = "Please enter your current loan balance.";
145
- }
146
- if (!values.zipCode.trim()) {
147
- nextErrors.zipCode = "Please enter a ZIP Code.";
148
- } else if (!validateZipCode(values.zipCode)) {
149
- nextErrors.zipCode = "Please enter a valid 5-digit ZIP Code.";
150
- }
151
- }
152
- }
153
- if (step === "amortizationType" && !values.amortizationType) {
154
- nextErrors.amortizationType = "Please select an amortization type.";
155
- }
156
- if (step === "fixedLoanType" && !values.fixedLoanType) {
157
- nextErrors.fixedLoanType = "Please select a loan type.";
158
- }
159
- if (step === "loanTerm" && !values.loanTerm) {
160
- nextErrors.loanTerm = "Please select a desired loan term.";
161
- }
162
- if (step === "finalDetails") {
163
- if (!values.desiredRate.trim()) {
164
- nextErrors.desiredRate = "Please enter your desired rate.";
165
- }
166
- }
167
- if (step === "contact") {
168
- if (!values.firstName.trim()) {
169
- nextErrors.firstName = "Please enter your first name.";
170
- }
171
- if (!values.lastName.trim()) {
172
- nextErrors.lastName = "Please enter your last name.";
173
- }
174
- if (!values.email.trim()) {
175
- nextErrors.email = "Please enter your email address.";
176
- } else if (!validateEmail(values.email)) {
177
- nextErrors.email = "Please enter a valid email address.";
178
- }
179
- if (!values.phoneNumber.trim()) {
180
- nextErrors.phoneNumber = "Please enter your phone number.";
181
- } else if (!validatePhone(values.phoneNumber)) {
182
- nextErrors.phoneNumber = "Please enter a valid 10-digit phone number.";
183
- }
184
- }
185
- setErrors(nextErrors);
186
- return Object.keys(nextErrors).length === 0;
187
- };
188
- const goNext = () => {
189
- clearAutoAdvance();
190
- if (!validateStep(stepKey)) return;
191
- if (currentStepIndex === totalSteps - 1) {
192
- console.log("Mortgage lead form submitted:", values);
193
- setSubmitted(true);
194
- return;
195
- }
196
- setLastInteractedRadioStep(null);
197
- setCurrentStepIndex((prev) => prev + 1);
198
- };
199
- const goBack = () => {
200
- clearAutoAdvance();
201
- setErrors({});
202
- setIsAutoAdvancing(false);
203
- setLastInteractedRadioStep(null);
204
- setCurrentStepIndex((prev) => Math.max(0, prev - 1));
205
- };
206
- const getAutoAdvanceValue = () => {
207
- switch (stepKey) {
208
- case "mortgageType":
209
- return values.mortgageType;
210
- case "propertyType":
211
- return values.propertyType;
212
- case "propertyUse":
213
- return values.propertyUse;
214
- case "creditScore":
215
- return values.creditScore;
216
- case "amortizationType":
217
- return values.amortizationType;
218
- case "fixedLoanType":
219
- return values.fixedLoanType;
220
- case "loanTerm":
221
- return values.loanTerm;
222
- default:
223
- return "";
224
- }
225
- };
226
- const isAutoAdvanceStep = (key) => {
227
- return [
228
- "mortgageType",
229
- "propertyType",
230
- "propertyUse",
231
- "creditScore",
232
- "amortizationType",
233
- "fixedLoanType",
234
- "loanTerm"
235
- ].includes(key);
236
- };
237
- const registerRadioInteraction = (step) => {
238
- setLastInteractedRadioStep(step);
239
- setRadioSelectionVersion((prev) => prev + 1);
240
- };
241
- useEffect(() => {
242
- clearAutoAdvance();
243
- if (!isAutoAdvanceStep(stepKey)) return;
244
- const selectedValue = getAutoAdvanceValue();
245
- if (!selectedValue) return;
246
- if (lastInteractedRadioStep !== stepKey) return;
247
- setIsAutoAdvancing(true);
248
- autoAdvanceTimeout.current = setTimeout(() => {
249
- if (currentStepIndex === totalSteps - 1) return;
250
- setCurrentStepIndex((prev) => prev + 1);
251
- setIsAutoAdvancing(false);
252
- }, AUTO_ADVANCE_DELAY);
253
- return () => clearAutoAdvance();
254
- }, [
255
- currentStepIndex,
256
- totalSteps,
257
- stepKey,
258
- lastInteractedRadioStep,
259
- radioSelectionVersion,
260
- values.mortgageType,
261
- values.propertyType,
262
- values.propertyUse,
263
- values.creditScore,
264
- values.amortizationType,
265
- values.fixedLoanType,
266
- values.loanTerm
267
- ]);
268
- const getStepTitle = () => {
269
- switch (stepKey) {
270
- case "mortgageType":
271
- return "What type of mortgage are you interested in?";
272
- case "propertyType":
273
- return "What type of property are you interested in financing?";
274
- case "propertyUse":
275
- return "How do you plan to utilize this property?";
276
- case "creditScore":
277
- return "What is your estimated credit score?";
278
- case "propertyDetails":
279
- return "Please share more details about the property.";
280
- case "amortizationType":
281
- return "What type of amortization do you prefer for the loan?";
282
- case "fixedLoanType":
283
- return "Which type of loan are you interested in?";
284
- case "loanTerm":
285
- return "What is your desired loan term?";
286
- case "finalDetails":
287
- return "Some final details...";
288
- case "contact":
289
- return "Tell us how we can get in touch with you.";
290
- default:
291
- return "";
292
- }
293
- };
294
- const getStepDescription = () => {
295
- switch (stepKey) {
296
- case "mortgageType":
297
- return "Select the option that best matches your needs.";
298
- case "propertyUse":
299
- return "Select how you intend to utilize the property so we can assist you in discovering the most suitable mortgage options available for you.";
300
- case "propertyDetails":
301
- return "Kindly share these extra details so we can better grasp your mortgage requirements.";
302
- case "amortizationType":
303
- return "Choosing an amortization type allows us to customize loan options that align with your financial objectives.";
304
- case "fixedLoanType":
305
- return "Select the loan type that most accurately reflects the mortgage you are looking for.";
306
- case "loanTerm":
307
- return "Choose the duration for your loan term.";
308
- case "finalDetails":
309
- return "You're almost done! Just share these last details so we can help you discover the best rates available.";
310
- default:
311
- return "";
312
- }
313
- };
314
- const renderAutoAdvanceStatus = () => {
315
- if (!isAutoAdvancing || !isAutoAdvanceStep(stepKey)) return null;
316
- return /* @__PURE__ */ jsxs("div", { className: autoAdvanceStatus, "aria-live": "polite", children: [
317
- /* @__PURE__ */ jsx("span", { className: autoAdvanceText, children: "Continuing…" }),
318
- /* @__PURE__ */ jsx("div", { className: autoAdvanceTrack, children: /* @__PURE__ */ jsx("div", { className: autoAdvanceBar }) })
319
- ] });
320
- };
321
- const renderStep = () => {
322
- switch (stepKey) {
323
- case "mortgageType":
324
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
325
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
326
- /* @__PURE__ */ jsx(
327
- RadioGroup,
328
- {
329
- value: values.mortgageType,
330
- onChange: (value) => {
331
- updateValue("mortgageType", value);
332
- registerRadioInteraction("mortgageType");
333
- },
334
- className: radioGrid,
335
- children: mortgageTypeOptions.map((option) => {
336
- const checked = values.mortgageType === option.value;
337
- return /* @__PURE__ */ jsx(
338
- Radio,
339
- {
340
- value: option.value,
341
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
342
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
343
- },
344
- option.value
345
- );
346
- })
347
- }
348
- ),
349
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
350
- renderAutoAdvanceStatus(),
351
- errors.mortgageType ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.mortgageType }) : null
352
- ] });
353
- case "propertyType":
354
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, style: { marginTop: "24px" }, children: [
355
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
356
- /* @__PURE__ */ jsx(
357
- RadioGroup,
358
- {
359
- value: values.propertyType,
360
- onChange: (value) => {
361
- updateValue("propertyType", value);
362
- registerRadioInteraction("propertyType");
363
- },
364
- className: radioGrid,
365
- style: {
366
- gridTemplateColumns: "repeat(auto-fit,minmax(258px,1fr))"
367
- },
368
- children: propertyTypeOptions.map((option) => {
369
- const checked = values.propertyType === option.value;
370
- return /* @__PURE__ */ jsx(
371
- Radio,
372
- {
373
- value: option.value,
374
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
375
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
376
- },
377
- option.value
378
- );
379
- })
380
- }
381
- ),
382
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
383
- renderAutoAdvanceStatus(),
384
- errors.propertyType ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.propertyType }) : null
385
- ] });
386
- case "propertyUse":
387
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
388
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
389
- /* @__PURE__ */ jsx(
390
- RadioGroup,
391
- {
392
- value: values.propertyUse,
393
- onChange: (value) => {
394
- updateValue("propertyUse", value);
395
- registerRadioInteraction("propertyUse");
396
- },
397
- className: radioGrid,
398
- style: {
399
- gridTemplateColumns: "repeat(auto-fit,minmax(258px,1fr))"
400
- },
401
- children: propertyUseOptions.map((option) => {
402
- const checked = values.propertyUse === option.value;
403
- return /* @__PURE__ */ jsx(
404
- Radio,
405
- {
406
- value: option.value,
407
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
408
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
409
- },
410
- option.value
411
- );
412
- })
413
- }
414
- ),
415
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
416
- renderAutoAdvanceStatus(),
417
- errors.propertyUse ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.propertyUse }) : null
418
- ] });
419
- case "creditScore":
420
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, style: { marginTop: "24px" }, children: [
421
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
422
- /* @__PURE__ */ jsx(
423
- RadioGroup,
424
- {
425
- value: values.creditScore,
426
- onChange: (value) => {
427
- updateValue("creditScore", value);
428
- registerRadioInteraction("creditScore");
429
- },
430
- className: radioGrid,
431
- children: creditScoreOptions.map((option) => {
432
- const checked = values.creditScore === option.value;
433
- return /* @__PURE__ */ jsx(
434
- Radio,
435
- {
436
- value: option.value,
437
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
438
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
439
- },
440
- option.value
441
- );
442
- })
443
- }
444
- ),
445
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
446
- renderAutoAdvanceStatus(),
447
- errors.creditScore ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.creditScore }) : null
448
- ] });
449
- case "propertyDetails":
450
- if (isPurchase) {
451
- return /* @__PURE__ */ jsxs("div", { className: inputGrid, children: [
452
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
453
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Purchase Price" }),
454
- /* @__PURE__ */ jsx(
455
- Input,
456
- {
457
- className: input,
458
- inputMode: "numeric",
459
- placeholder: "Enter your purchase price",
460
- value: values.purchasePrice ? `$${values.purchasePrice}` : "",
461
- onChange: (e) => updateValue(
462
- "purchasePrice",
463
- formatCurrencyInput(e.target.value)
464
- )
465
- }
466
- ),
467
- errors.purchasePrice ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.purchasePrice }) : null
468
- ] }),
469
- /* @__PURE__ */ jsxs(Field, { className: sliderWrap, children: [
470
- /* @__PURE__ */ jsxs("div", { className: sliderHeader, children: [
471
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Down Payment" }),
472
- /* @__PURE__ */ jsxs("span", { className: sliderValue, children: [
473
- values.downPaymentPercent,
474
- "%"
475
- ] })
476
- ] }),
477
- /* @__PURE__ */ jsx(
478
- "input",
479
- {
480
- className: slider,
481
- type: "range",
482
- min: 0,
483
- max: 100,
484
- step: 1,
485
- value: values.downPaymentPercent,
486
- onChange: (e) => updateValue("downPaymentPercent", Number(e.target.value)),
487
- "aria-label": "Down payment percentage"
488
- }
489
- ),
490
- /* @__PURE__ */ jsx("p", { className: helperText, children: "Move the slider to estimate your down payment amount instantly." }),
491
- /* @__PURE__ */ jsxs("div", { className: amountPreview, children: [
492
- /* @__PURE__ */ jsx("span", { className: amountPreviewLabel, children: "Estimated down payment amount" }),
493
- /* @__PURE__ */ jsx("div", { className: amountPreviewValue, children: purchaseDownPaymentPreview })
494
- ] })
495
- ] }),
496
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
497
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "ZIP Code" }),
498
- /* @__PURE__ */ jsx(
499
- Input,
500
- {
501
- className: input,
502
- inputMode: "numeric",
503
- placeholder: "Enter ZIP Code",
504
- value: values.zipCode,
505
- onChange: (e) => updateValue(
506
- "zipCode",
507
- e.target.value.replace(/[^\d]/g, "").slice(0, 5)
508
- )
509
- }
510
- ),
511
- errors.zipCode ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.zipCode }) : null
512
- ] })
513
- ] });
514
- }
515
- return /* @__PURE__ */ jsxs(
516
- "div",
517
- {
518
- className: inputGrid,
519
- style: {
520
- gridTemplateColumns: "repeat(auto-fit,minmax(258px,1fr))"
521
- },
522
- children: [
523
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
524
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Estimated Home Value" }),
525
- /* @__PURE__ */ jsx(
526
- Input,
527
- {
528
- className: input,
529
- inputMode: "numeric",
530
- placeholder: "Enter your home value",
531
- value: values.estimatedHomeValue ? `$${values.estimatedHomeValue}` : "",
532
- onChange: (e) => updateValue(
533
- "estimatedHomeValue",
534
- formatCurrencyInput(e.target.value)
535
- )
536
- }
537
- ),
538
- errors.estimatedHomeValue ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.estimatedHomeValue }) : null
539
- ] }),
540
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
541
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Current Loan Balance" }),
542
- /* @__PURE__ */ jsx(
543
- Input,
544
- {
545
- className: input,
546
- inputMode: "numeric",
547
- placeholder: "Enter your loan balance",
548
- value: values.currentLoanBalance ? `$${values.currentLoanBalance}` : "",
549
- onChange: (e) => updateValue(
550
- "currentLoanBalance",
551
- formatCurrencyInput(e.target.value)
552
- )
553
- }
554
- ),
555
- errors.currentLoanBalance ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.currentLoanBalance }) : null
556
- ] }),
557
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
558
- /* @__PURE__ */ jsxs(Label, { className: fieldLabel, children: [
559
- "Cash Out Amount",
560
- " ",
561
- /* @__PURE__ */ jsx("span", { className: optionalText, children: "(Optional)" })
562
- ] }),
563
- /* @__PURE__ */ jsx(
564
- Input,
565
- {
566
- className: input,
567
- inputMode: "numeric",
568
- placeholder: "Enter cash out amount",
569
- value: values.cashOutAmount ? `$${values.cashOutAmount}` : "",
570
- onChange: (e) => updateValue(
571
- "cashOutAmount",
572
- formatCurrencyInput(e.target.value)
573
- )
574
- }
575
- )
576
- ] }),
577
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
578
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "ZIP Code" }),
579
- /* @__PURE__ */ jsx(
580
- Input,
581
- {
582
- className: input,
583
- inputMode: "numeric",
584
- placeholder: "Enter ZIP Code",
585
- value: values.zipCode,
586
- onChange: (e) => updateValue(
587
- "zipCode",
588
- e.target.value.replace(/[^\d]/g, "").slice(0, 5)
589
- )
590
- }
591
- ),
592
- errors.zipCode ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.zipCode }) : null
593
- ] })
594
- ]
595
- }
596
- );
597
- case "amortizationType":
598
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
599
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
600
- /* @__PURE__ */ jsx(
601
- RadioGroup,
602
- {
603
- value: values.amortizationType,
604
- onChange: (value) => {
605
- updateValue("amortizationType", value);
606
- registerRadioInteraction("amortizationType");
607
- },
608
- className: inputRowTwo,
609
- children: amortizationTypeOptions.map((option) => {
610
- const checked = values.amortizationType === option.value;
611
- return /* @__PURE__ */ jsx(
612
- Radio,
613
- {
614
- value: option.value,
615
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
616
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
617
- },
618
- option.value
619
- );
620
- })
621
- }
622
- ),
623
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
624
- renderAutoAdvanceStatus(),
625
- errors.amortizationType ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.amortizationType }) : null
626
- ] });
627
- case "fixedLoanType":
628
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
629
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
630
- /* @__PURE__ */ jsx(
631
- RadioGroup,
632
- {
633
- value: values.fixedLoanType,
634
- onChange: (value) => {
635
- updateValue("fixedLoanType", value);
636
- registerRadioInteraction("fixedLoanType");
637
- },
638
- className: inputRowTwo,
639
- children: fixedLoanTypeOptions.map((option) => {
640
- const checked = values.fixedLoanType === option.value;
641
- return /* @__PURE__ */ jsx(
642
- Radio,
643
- {
644
- value: option.value,
645
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
646
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
647
- },
648
- option.value
649
- );
650
- })
651
- }
652
- ),
653
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
654
- renderAutoAdvanceStatus(),
655
- errors.fixedLoanType ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.fixedLoanType }) : null
656
- ] });
657
- case "loanTerm":
658
- const loanTermOptions = values.amortizationType === "fixed" ? fixedLoanTermOptions : armLoanTermOptions;
659
- return /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
660
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Choose one" }),
661
- /* @__PURE__ */ jsx(
662
- RadioGroup,
663
- {
664
- value: values.loanTerm,
665
- onChange: (value) => {
666
- updateValue("loanTerm", value);
667
- registerRadioInteraction("loanTerm");
668
- },
669
- className: inputRowTwo,
670
- children: loanTermOptions.map((option) => {
671
- const checked = values.loanTerm === option.value;
672
- return /* @__PURE__ */ jsx(
673
- Radio,
674
- {
675
- value: option.value,
676
- className: `${radioOption} ${checked ? radioOptionChecked : ""}`,
677
- children: /* @__PURE__ */ jsx("span", { className: radioText, children: option.label })
678
- },
679
- option.value
680
- );
681
- })
682
- }
683
- ),
684
- /* @__PURE__ */ jsx("p", { className: autoAdvanceHint, children: "Your selection will continue automatically." }),
685
- renderAutoAdvanceStatus(),
686
- errors.loanTerm ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.loanTerm }) : null
687
- ] });
688
- case "finalDetails":
689
- return /* @__PURE__ */ jsxs("div", { className: inputGrid, children: [
690
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
691
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Desired Rate" }),
692
- /* @__PURE__ */ jsx(
693
- Input,
694
- {
695
- className: input,
696
- type: "text",
697
- inputMode: "decimal",
698
- placeholder: "6.25%",
699
- value: values.desiredRate ? `${values.desiredRate}%` : "",
700
- onChange: (e) => updateValue("desiredRate", formatPercentInput(e.target.value))
701
- }
702
- ),
703
- errors.desiredRate ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.desiredRate }) : null
704
- ] }),
705
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
706
- /* @__PURE__ */ jsxs(Label, { className: fieldLabel, children: [
707
- "Discount Points",
708
- " ",
709
- /* @__PURE__ */ jsx("span", { className: optionalText, children: "(Optional)" })
710
- ] }),
711
- /* @__PURE__ */ jsx(
712
- Input,
713
- {
714
- className: input,
715
- type: "text",
716
- inputMode: "decimal",
717
- placeholder: "1.0",
718
- value: values.discountPoints,
719
- onChange: (e) => updateValue("discountPoints", e.target.value)
720
- }
721
- )
722
- ] })
723
- ] });
724
- case "contact":
725
- return /* @__PURE__ */ jsxs("div", { className: inputGrid, style: { marginTop: "24px" }, children: [
726
- /* @__PURE__ */ jsxs("div", { className: inputRowTwo, children: [
727
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
728
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "First Name" }),
729
- /* @__PURE__ */ jsx(
730
- Input,
731
- {
732
- className: input,
733
- type: "text",
734
- placeholder: "Enter your first name",
735
- value: values.firstName,
736
- onChange: (e) => updateValue("firstName", e.target.value)
737
- }
738
- ),
739
- errors.firstName ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.firstName }) : null
740
- ] }),
741
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
742
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Last Name" }),
743
- /* @__PURE__ */ jsx(
744
- Input,
745
- {
746
- className: input,
747
- type: "text",
748
- placeholder: "Enter your last name",
749
- value: values.lastName,
750
- onChange: (e) => updateValue("lastName", e.target.value)
751
- }
752
- ),
753
- errors.lastName ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.lastName }) : null
754
- ] })
755
- ] }),
756
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
757
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Email" }),
758
- /* @__PURE__ */ jsx(
759
- Input,
760
- {
761
- className: input,
762
- type: "email",
763
- placeholder: "Enter your email",
764
- value: values.email,
765
- onChange: (e) => updateValue("email", e.target.value)
766
- }
767
- ),
768
- errors.email ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.email }) : null
769
- ] }),
770
- /* @__PURE__ */ jsxs(Field, { className: fieldBlock, children: [
771
- /* @__PURE__ */ jsx(Label, { className: fieldLabel, children: "Phone Number" }),
772
- /* @__PURE__ */ jsx(
773
- Input,
774
- {
775
- className: input,
776
- type: "tel",
777
- inputMode: "tel",
778
- placeholder: "(XXX) XXX-XXXX",
779
- value: values.phoneNumber,
780
- onChange: (e) => updateValue("phoneNumber", formatPhoneInput(e.target.value))
781
- }
782
- ),
783
- errors.phoneNumber ? /* @__PURE__ */ jsx("p", { className: errorText, children: errors.phoneNumber }) : null
784
- ] })
785
- ] });
786
- default:
787
- return null;
788
- }
789
- };
790
- if (submitted) {
791
- return /* @__PURE__ */ jsx("section", { className: section, children: /* @__PURE__ */ jsxs("div", { className: formShell, children: [
792
- /* @__PURE__ */ jsxs("div", { className: successWrap, children: [
793
- /* @__PURE__ */ jsx("h2", { className: successTitle, children: "Thanks for your submission" }),
794
- /* @__PURE__ */ jsx("p", { className: successText, children: "Your information has been received. An Axos team member may follow up with next steps based on your inquiry." })
795
- ] }),
796
- /* @__PURE__ */ jsxs("div", { className: disclosure, children: [
797
- /* @__PURE__ */ jsx("p", { className: disclosureTitle, children: "Important information" }),
798
- /* @__PURE__ */ jsx("p", { className: disclosureText, children: "Mortgage products are offered by Axos Bank. All loan applications are subject to credit and property approval. Terms, conditions, and program availability are subject to change without notice. This is not a commitment to lend. Additional disclosures may apply. NMLS #524995." })
799
- ] })
800
- ] }) });
801
- }
802
- const isCurrentStepAutoAdvanceStep = isAutoAdvanceStep(stepKey);
803
- const continueButtonLabel = isCurrentStepAutoAdvanceStep && isAutoAdvancing ? "Continuing…" : currentStepIndex === totalSteps - 1 ? "Start Watching Rates" : "Continue";
804
- const continueButtonDisabled = isCurrentStepAutoAdvanceStep && isAutoAdvancing;
805
- return /* @__PURE__ */ jsxs("section", { className: section, children: [
806
- stepKey === "mortgageType" && /* @__PURE__ */ jsxs("div", { className: "text_center", children: [
807
- /* @__PURE__ */ jsxs("div", { className: "flex middle center", style: { gap: "16px" }, children: [
808
- /* @__PURE__ */ jsx("h1", { className: mainTitle, children: "Rate Watch" }),
809
- /* @__PURE__ */ jsx(AlertBellIcon, {})
810
- ] }),
811
- /* @__PURE__ */ jsx("p", { className: mainDescription, children: "Receive alerts for a customized rate tailored to your requirements. It only takes a couple of minutes." })
812
- ] }),
813
- /* @__PURE__ */ jsxs("div", { className: formShell, children: [
814
- /* @__PURE__ */ jsxs("div", { className: progressWrap, children: [
815
- /* @__PURE__ */ jsxs("div", { className: progressRow, children: [
816
- /* @__PURE__ */ jsxs("span", { className: progressLabel, children: [
817
- "Step ",
818
- currentStepIndex + 1,
819
- " of ",
820
- totalSteps
821
- ] }),
822
- /* @__PURE__ */ jsxs("span", { className: progressLabel, children: [
823
- Math.round(progress),
824
- "%"
825
- ] })
826
- ] }),
827
- /* @__PURE__ */ jsx("div", { className: progressTrack, children: /* @__PURE__ */ jsx(
828
- "div",
829
- {
830
- className: progressFill,
831
- style: { width: `${progress}%` }
832
- }
833
- ) })
834
- ] }),
835
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxs(
836
- motion.div,
837
- {
838
- className: stepPanel,
839
- initial: { opacity: 0, x: 15 },
840
- animate: { opacity: 1, x: 0 },
841
- exit: { opacity: 0, x: -15 },
842
- transition: { duration: 0.24, ease: "easeOut" },
843
- children: [
844
- /* @__PURE__ */ jsx("h2", { className: title, children: getStepTitle() }),
845
- getStepDescription() ? /* @__PURE__ */ jsx("p", { className: description, children: getStepDescription() }) : null,
846
- renderStep(),
847
- /* @__PURE__ */ jsxs("div", { className: actions, children: [
848
- /* @__PURE__ */ jsx(
849
- Button,
850
- {
851
- type: "button",
852
- className: secondaryButton,
853
- onClick: goBack,
854
- disabled: currentStepIndex === 0,
855
- children: "Back"
856
- }
857
- ),
858
- /* @__PURE__ */ jsx(
859
- Button,
860
- {
861
- type: "button",
862
- className: primaryButton,
863
- onClick: goNext,
864
- disabled: continueButtonDisabled,
865
- children: continueButtonLabel
866
- }
867
- )
868
- ] }),
869
- stepKey === "mortgageType" && /* @__PURE__ */ jsxs("div", { className: disclosure, children: [
870
- /* @__PURE__ */ jsx("p", { className: disclosureTitle, children: "Important information" }),
871
- /* @__PURE__ */ jsx("p", { className: disclosureText, children: "By continuing, you agree to provide information so Axos can better understand your mortgage needs. Mortgage products are subject to underwriting and approval. Rates, terms, and product availability may vary based on credit profile, property type, occupancy, loan amount, and other factors. This form is for informational purposes only and is not a commitment to lend. NMLS #524995." })
872
- ] }),
873
- stepKey === "contact" && /* @__PURE__ */ jsxs("div", { className: disclosure, children: [
874
- /* @__PURE__ */ jsxs(
875
- "p",
876
- {
877
- className: `${disclosureText} ${disclosureTextSm}`,
878
- children: [
879
- 'By clicking "Start Watching Rates", you have agreed to these',
880
- " ",
881
- /* @__PURE__ */ jsx("a", { href: "https://assets.axos.com/o9ov1v03uwqk/6gQNHxCzLuaoCeivQk84N4/14ae33b36f550b3c776d2840be513fb9/SMS-and-MMS-Disclosure-Axos-Bank.pdf", children: "Terms and Conditions" }),
882
- ", and you have agreed to receive automated SMS text messages, calls, and emails for any purpose including but not limited to marketing of products and services by Axos Bank. You understand and agree that such messages may be sent via Automatic Telephone Dialing System and/or artificial or pre-recorded voice, and that such consent is not a condition of receipt of any good or service. Mobile carrier messages and data rates may apply. You may opt out at any time."
883
- ]
884
- }
885
- ),
886
- /* @__PURE__ */ jsx(
887
- "p",
888
- {
889
- className: `${disclosureText} ${disclosureTextSm}`,
890
- style: { marginTop: "8px" },
891
- children: "If you do not wish to receive your rate quote by email or SMS text, please call 888-546-2364 to speak with a mortgage expert to receive a rate quote."
892
- }
893
- )
894
- ] })
895
- ]
896
- },
897
- stepKey
898
- ) })
899
- ] }),
900
- /* @__PURE__ */ jsx(
901
- Overlay,
902
- {
903
- className: `${overlay} ${overlayOpacity}`,
904
- variant: "secondary"
905
- }
906
- )
907
- ] });
908
- }
909
- export {
910
- MortgageRateStep
911
- };