@axos-web-dev/shared-components 2.0.0-dev.enableCTA2 → 2.0.0-dev.insights.11

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 (90) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -1
  2. package/dist/Auth/ErrorAlert.js +1 -1
  3. package/dist/Button/Button.js +1 -1
  4. package/dist/Calculators/ApyCalculator/index.js +5 -78
  5. package/dist/Calculators/Calculator.js +1 -1
  6. package/dist/Calculators/MarginTradingCalculator/index.js +1 -1
  7. package/dist/Carousel/index.js +1 -1
  8. package/dist/Chatbot/Bubble.css.js +0 -1
  9. package/dist/Chatbot/ChatWindow.d.ts +0 -1
  10. package/dist/Chatbot/ChatWindow.js +10 -5
  11. package/dist/Chatbot/Chatbot.css.js +1 -0
  12. package/dist/Chatbot/Chatbot.js +42 -75
  13. package/dist/Chatbot/ChatbotMessage.d.ts +0 -1
  14. package/dist/Chatbot/ChatbotMessage.js +1 -2
  15. package/dist/Chatbot/store/messages.d.ts +1 -6
  16. package/dist/Chatbot/store/messages.js +3 -62
  17. package/dist/Chevron/index.js +1 -1
  18. package/dist/Comparison/Comparison.js +1 -1
  19. package/dist/ExecutiveBio/ExecutiveBio.js +1 -1
  20. package/dist/FaqAccordion/index.js +1 -1
  21. package/dist/FdicCallout/index.js +1 -1
  22. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -1
  23. package/dist/Forms/ApplyNow.js +1 -1
  24. package/dist/Forms/ContactUsBusiness.js +1 -1
  25. package/dist/Forms/ContactUsBusinessNameEmail.js +1 -1
  26. package/dist/Forms/ContactUsNMLSId.js +1 -1
  27. package/dist/Forms/CpraRequest.js +1 -1
  28. package/dist/Forms/CraPublicFile.js +1 -1
  29. package/dist/Forms/EmailOnly.js +2 -12
  30. package/dist/Forms/FormEnums.d.ts +0 -16
  31. package/dist/Forms/FormEnums.js +0 -27
  32. package/dist/Forms/MortgageRate/MortgageRateForm.js +9 -27
  33. package/dist/Forms/MortgageRate/MortgageRateQuoteFilters.js +11 -33
  34. package/dist/Forms/MortgageRate/MortgageRateWatch.d.ts +1 -1
  35. package/dist/Forms/MortgageRate/MortgageRateWatch.js +18 -91
  36. package/dist/Forms/MortgageWarehouseLending.js +1 -1
  37. package/dist/Forms/SuccesForm.js +1 -1
  38. package/dist/Forms/index.d.ts +0 -1
  39. package/dist/Forms/index.js +0 -2
  40. package/dist/Hyperlink/index.js +1 -1
  41. package/dist/ImageLink/ImageLink.js +1 -1
  42. package/dist/ImageLink/ImageLinkSet.js +1 -1
  43. package/dist/ImageLink/index.js +1 -1
  44. package/dist/ImageToast/index.js +1 -1
  45. package/dist/Input/DownPaymentInput.js +0 -1
  46. package/dist/Insight/Featured/CategorySelector.css.d.ts +5 -3
  47. package/dist/Insight/Featured/CategorySelector.css.js +12 -8
  48. package/dist/Insight/Featured/CategorySelector.d.ts +1 -0
  49. package/dist/Insight/Featured/CategorySelector.js +75 -35
  50. package/dist/Insight/Featured/Featured.css.d.ts +13 -4
  51. package/dist/Insight/Featured/Featured.css.js +37 -18
  52. package/dist/Insight/Featured/Featured.d.ts +1 -0
  53. package/dist/Insight/Featured/Featured.js +130 -94
  54. package/dist/Insight/Featured/Header.css.d.ts +1 -0
  55. package/dist/Insight/Featured/Header.css.js +9 -6
  56. package/dist/Insight/Featured/Header.js +11 -18
  57. package/dist/Insight/Featured/index.js +13 -4
  58. package/dist/Insight/index.js +13 -4
  59. package/dist/LandingPageHeader/WithLogin.js +1 -1
  60. package/dist/Modal/Modal.js +1 -1
  61. package/dist/NavigationMenu/AxosALTS/index.js +1 -1
  62. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +1 -1
  63. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -1
  64. package/dist/NavigationMenu/AxosBank/SubNavBar.js +2 -2
  65. package/dist/NavigationMenu/AxosBank/index.js +1 -1
  66. package/dist/NavigationMenu/LaVictoire/index.js +1 -1
  67. package/dist/NavigationMenu/NavItem/index.js +1 -1
  68. package/dist/NavigationMenu/ServerNavigation/DropwdownButton.js +1 -1
  69. package/dist/NavigationMenu/ServerNavigation/Menu.js +1 -1
  70. package/dist/NavigationMenu/ServerNavigation/MobileMenu/MobileMenu.js +14 -12
  71. package/dist/NavigationMenu/ServerNavigation/SubNavBar.js +1 -1
  72. package/dist/NavigationMenu/ServerNavigation/SubNavItem.js +1 -1
  73. package/dist/NavigationMenu/ServerNavigation/index.js +1 -1
  74. package/dist/SetContainer/SetContainer.js +1 -1
  75. package/dist/SocialMediaBar/iconsRepository.js +1 -1
  76. package/dist/VideoTile/VideoTile.js +1 -1
  77. package/dist/VideoWrapper/index.js +1 -1
  78. package/dist/assets/CallToActionBar/CallToActionBar.css +2 -1
  79. package/dist/assets/Forms/Forms.css +2 -1
  80. package/dist/assets/Input/Input.css +1 -0
  81. package/dist/assets/Insight/Featured/CategorySelector.css +60 -38
  82. package/dist/assets/Insight/Featured/Featured.css +126 -65
  83. package/dist/assets/Insight/Featured/Header.css +22 -13
  84. package/dist/assets/TextBlock/TextBlock.css +1 -0
  85. package/dist/icons/Clock/index.js +1 -0
  86. package/dist/main.js +12 -5
  87. package/dist/utils/allowedAxosDomains.js +3 -2
  88. package/package.json +4 -5
  89. package/dist/Forms/NonQMLoans.d.ts +0 -16
  90. package/dist/Forms/NonQMLoans.js +0 -471
@@ -82,10 +82,10 @@ import "../Auth/SignInPassword.js";
82
82
  /* empty css */
83
83
  import "../Carousel/index.js";
84
84
  /* empty css */
85
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
86
85
  /* empty css */
87
86
  import "../Chatbot/store/chat.js";
88
87
  import "../Chatbot/Chatbot.js";
88
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
89
89
  /* empty css */
90
90
  import "../Chatbot/store/messages.js";
91
91
  /* empty css */
@@ -82,10 +82,10 @@ import "../Auth/SignInPassword.js";
82
82
  /* empty css */
83
83
  import "../Carousel/index.js";
84
84
  /* empty css */
85
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
86
85
  /* empty css */
87
86
  import "../Chatbot/store/chat.js";
88
87
  import "../Chatbot/Chatbot.js";
88
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
89
89
  /* empty css */
90
90
  import "../Chatbot/store/messages.js";
91
91
  /* empty css */
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import css from "./FdicCallout.module.js";
3
3
  const FdicBanner = () => {
4
- return /* @__PURE__ */ jsx("div", { className: css.fdic_callout, children: /* @__PURE__ */ jsx("div", { className: css.inner_container, children: /* @__PURE__ */ jsx("div", { className: "flex middle", children: /* @__PURE__ */ jsxs(
4
+ return /* @__PURE__ */ jsx("div", { className: css.fdic_callout, "aria-label": "FDIC Notice banner", children: /* @__PURE__ */ jsx("div", { className: css.inner_container, children: /* @__PURE__ */ jsx("div", { className: "flex middle", children: /* @__PURE__ */ jsxs(
5
5
  "svg",
6
6
  {
7
7
  width: "430",
@@ -78,10 +78,10 @@ import "../../Auth/SignInPassword.js";
78
78
  /* empty css */
79
79
  import "../../Carousel/index.js";
80
80
  /* empty css */
81
- import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
82
81
  /* empty css */
83
82
  import "../../Chatbot/store/chat.js";
84
83
  import "../../Chatbot/Chatbot.js";
84
+ import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
85
85
  /* empty css */
86
86
  import "../../Chatbot/store/messages.js";
87
87
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -83,10 +83,10 @@ import "../Auth/SignInPassword.js";
83
83
  /* empty css */
84
84
  import "../Carousel/index.js";
85
85
  /* empty css */
86
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
86
  /* empty css */
88
87
  import "../Chatbot/store/chat.js";
89
88
  import "../Chatbot/Chatbot.js";
89
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
90
90
  /* empty css */
91
91
  import "../Chatbot/store/messages.js";
92
92
  /* empty css */
@@ -84,10 +84,10 @@ import "../Auth/SignInPassword.js";
84
84
  /* empty css */
85
85
  import "../Carousel/index.js";
86
86
  /* empty css */
87
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
88
87
  /* empty css */
89
88
  import "../Chatbot/store/chat.js";
90
89
  import "../Chatbot/Chatbot.js";
90
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
91
91
  /* empty css */
92
92
  import "../Chatbot/store/messages.js";
93
93
  /* empty css */
@@ -197,17 +197,7 @@ const EmailOnly = ({
197
197
  children: /* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
198
198
  icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
199
199
  /* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
200
- /* @__PURE__ */ jsx(
201
- "h2",
202
- {
203
- className: clsx(
204
- "header_2",
205
- headerForm({ variant }),
206
- email_only_h2
207
- ),
208
- children: headline
209
- }
210
- ),
200
+ /* @__PURE__ */ jsx("h2", { className: clsx(headerForm({ variant }), email_only_h2), children: headline }),
211
201
  description && /* @__PURE__ */ jsx(
212
202
  "div",
213
203
  {
@@ -11,22 +11,10 @@ export declare const Purposes: {
11
11
  value: string;
12
12
  text: string;
13
13
  }[];
14
- export declare const LoanPurposes: {
15
- value: string;
16
- text: string;
17
- }[];
18
- export declare const LoanTypeDetails: {
19
- value: string;
20
- text: string;
21
- }[];
22
14
  export declare const RepresentativesFico: {
23
15
  value: string;
24
16
  text: string;
25
17
  }[];
26
- export declare const CreditScore: {
27
- value: string;
28
- text: string;
29
- }[];
30
18
  export declare const DocType: {
31
19
  value: string;
32
20
  text: string;
@@ -63,10 +51,6 @@ export declare const PropertyType: {
63
51
  value: string;
64
52
  text: string;
65
53
  }[];
66
- export declare const PropertyIntendedUse: {
67
- value: string;
68
- text: string;
69
- }[];
70
54
  export declare const Occupancy: {
71
55
  value: string;
72
56
  text: string;
@@ -50,14 +50,6 @@ const Purposes = [
50
50
  { value: "RefiCashout", text: "Refi Cashout" },
51
51
  { value: "RefiRateTermLimitedCO", text: "Refi Rate-Term/Limited C.O." }
52
52
  ];
53
- const LoanPurposes = [
54
- { value: "Purchase", text: "Purchase" },
55
- { value: "Refinance", text: "Refinance" }
56
- ];
57
- const LoanTypeDetails = [
58
- { value: "DSCR", text: "DSCR" },
59
- { value: "Bank Statement Loan", text: "Bank Statement Loan" }
60
- ];
61
53
  const RepresentativesFico = [
62
54
  { value: "780", text: "780+" },
63
55
  { value: "760", text: "779 - 760" },
@@ -70,16 +62,6 @@ const RepresentativesFico = [
70
62
  { value: "620", text: "639 - 620" },
71
63
  { value: "600", text: "Below 620" }
72
64
  ];
73
- const CreditScore = [
74
- { value: "740+", text: "740+" },
75
- { value: "720", text: "739 - 720" },
76
- { value: "700", text: "719 - 700" },
77
- { value: "680", text: "699 - 680" },
78
- { value: "660", text: "679 - 660" },
79
- { value: "640", text: "659 - 640" },
80
- { value: "620", text: "639 - 620" },
81
- { value: "Below 620 ", text: "Below 620" }
82
- ];
83
65
  const DocType = [
84
66
  { value: "FullDoc", text: "Full Doc" },
85
67
  // { value: "AssetDepletion", text: "Asset Depletion" },
@@ -151,11 +133,6 @@ const PropertyType = [
151
133
  { value: "Coop", text: "Co-op" },
152
134
  { value: "Condotel", text: "Condotel" }
153
135
  ];
154
- const PropertyIntendedUse = [
155
- { value: "Primary Residence", text: "Primary Residence" },
156
- { value: "Second / Vacation Home", text: "Vacation Home" },
157
- { value: "Investment", text: "Investment" }
158
- ];
159
136
  const Occupancy = [
160
137
  { value: "PrimaryResidence", text: "Principal Residence" },
161
138
  { value: "SecondHome", text: "Second Home" },
@@ -479,23 +456,19 @@ export {
479
456
  BuydownRate,
480
457
  BuydownTerm,
481
458
  Citizenship,
482
- CreditScore,
483
459
  CurrentAssets,
484
460
  DocType,
485
461
  Fico,
486
462
  HousingEventHistory,
487
463
  HousingEventType,
488
464
  LeadType,
489
- LoanPurposes,
490
465
  LoanRates,
491
- LoanTypeDetails,
492
466
  MortgageLates12,
493
467
  MortgageLates24,
494
468
  NumberOfUnits,
495
469
  Occupancy,
496
470
  PrepaymentPenalty,
497
471
  Program,
498
- PropertyIntendedUse,
499
472
  PropertyType,
500
473
  PurposeOfLoan,
501
474
  Purposes,
@@ -22,7 +22,7 @@ import clsx from "clsx";
22
22
  import "../../Accordion/Accordion.js";
23
23
  import "../../Accordion/Accordion.css.js";
24
24
  import "../../AlertBanner/AlertBanner.css.js";
25
- import { useState, useRef, useEffect, useLayoutEffect } from "react";
25
+ import { useState, useEffect } from "react";
26
26
  import "../../Article/Article.css.js";
27
27
  import "../../ArticlesSet/ArticlesSet.css.js";
28
28
  import "../../Calculators/calculator.css.js";
@@ -84,10 +84,10 @@ import "../../Auth/SignInPassword.js";
84
84
  /* empty css */
85
85
  import "../../Carousel/index.js";
86
86
  /* empty css */
87
- import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
88
87
  /* empty css */
89
88
  import "../../Chatbot/store/chat.js";
90
89
  import "../../Chatbot/Chatbot.js";
90
+ import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
91
91
  /* empty css */
92
92
  import "../../Chatbot/store/messages.js";
93
93
  /* empty css */
@@ -138,7 +138,6 @@ import "../../StepItemSet/StepItemSet.css.js";
138
138
  /* empty css */
139
139
  /* empty css */
140
140
  import { honeyPotSchema, isValidHoneyPot } from "../HoneyPot/honeyPotValidation.js";
141
- const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
142
141
  const MortgageRate = ({
143
142
  icon = false,
144
143
  children,
@@ -164,8 +163,6 @@ const MortgageRate = ({
164
163
  const [_downPayment, setDownPayment] = useState(0);
165
164
  const [isTypingDownPayment, setIsTypingDownPayment] = useState(false);
166
165
  const [salesPriceVal, setSalesPriceVal] = useState(0);
167
- const containerRef = useRef(null);
168
- const restoreScrollOnNextRender = useRef(false);
169
166
  const cachedEmailValidator = useCachedEmailValidator(validateEmail);
170
167
  const schema = z.object({
171
168
  firstName: z.string({ message: "First Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
@@ -302,17 +299,6 @@ const MortgageRate = ({
302
299
  methods.setValue("downPayment", calculatedDownPayment);
303
300
  }
304
301
  }, [salesPrice, downPaymentPercentage]);
305
- useIsomorphicLayoutEffect(() => {
306
- if (!restoreScrollOnNextRender.current) return;
307
- restoreScrollOnNextRender.current = false;
308
- const anchorViewport = () => {
309
- const target = showingTables && containerRef.current?.nextElementSibling || containerRef.current;
310
- target?.scrollIntoView({ block: "start" });
311
- };
312
- anchorViewport();
313
- const raf = requestAnimationFrame(anchorViewport);
314
- return () => cancelAnimationFrame(raf);
315
- }, [hideModal, showingTables]);
316
302
  const submitForm = async (data) => {
317
303
  const processData = {
318
304
  ...data
@@ -321,7 +307,6 @@ const MortgageRate = ({
321
307
  if (setRateWatchSubmitted) {
322
308
  setRateWatchSubmitted(false);
323
309
  }
324
- restoreScrollOnNextRender.current = true;
325
310
  setHideModal(true);
326
311
  };
327
312
  const variant = getVariant(fullVariant);
@@ -385,7 +370,7 @@ const MortgageRate = ({
385
370
  }
386
371
  return value;
387
372
  };
388
- return /* @__PURE__ */ jsxs("div", { ref: containerRef, children: [
373
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
389
374
  hideModal && !showingTables && /* @__PURE__ */ jsx(
390
375
  "section",
391
376
  {
@@ -461,9 +446,9 @@ const MortgageRate = ({
461
446
  {
462
447
  className: form,
463
448
  onSubmit: async (e) => {
464
- e.preventDefault();
465
449
  onValidate && onValidate(e);
466
450
  await handleSubmit(submitForm)(e);
451
+ e.preventDefault();
467
452
  },
468
453
  children: [
469
454
  /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
@@ -813,15 +798,12 @@ const MortgageRate = ({
813
798
  {
814
799
  id,
815
800
  className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
816
- onClick: (e) => {
801
+ onClick: isValid ? handleSubmit(async (data) => {
802
+ await onSubmit(data);
803
+ toggleModal();
804
+ setHideModal(false);
805
+ }) : (e) => {
817
806
  e.preventDefault();
818
- if (!isValid) return;
819
- handleSubmit(async (data) => {
820
- await onSubmit(data);
821
- restoreScrollOnNextRender.current = true;
822
- toggleModal();
823
- setHideModal(false);
824
- })(e);
825
807
  },
826
808
  children: "Sign Up For Ratewatch"
827
809
  }
@@ -36,7 +36,7 @@ const MortgageRateFilters = ({
36
36
  loanPurpose: z.number({ message: "Loan Purpose is required." }),
37
37
  propertyType: z.number({ message: "Property Type is required." }).positive({ message: "Property Type is required." }),
38
38
  occupancy: z.number({ message: "Property Usage is required." }).positive({ message: "Property Usage is required." }),
39
- salesPrice: z.number({ message: "Purchase Price is required." }).optional().refine((val) => loanPurpose === 1 ? val != null : true, {
39
+ salesPrice: z.number({ message: "Purchase Price is required." }).refine((val) => loanPurpose === 1 ? val != null : true, {
40
40
  message: "Sales Price is required."
41
41
  }).refine(
42
42
  (val) => {
@@ -47,7 +47,7 @@ const MortgageRateFilters = ({
47
47
  },
48
48
  { message: "Value must be between $50,000 and $25,000,000." }
49
49
  ),
50
- downPayment: z.number({ message: "Down Payment is required." }).optional().refine((val) => loanPurpose === 1 ? val != null : true, {
50
+ downPayment: z.number({ message: "Down Payment is required." }).refine((val) => loanPurpose === 1 ? val != null : true, {
51
51
  message: "Down Payment is required."
52
52
  }).refine(
53
53
  (val) => {
@@ -61,8 +61,8 @@ const MortgageRateFilters = ({
61
61
  }
62
62
  ),
63
63
  creditScore: z.number({ message: "Credit Score is required." }).positive({ message: "Credit Score is required." }),
64
- zipCode: z.number({ message: "Zip Code is required." }).int({ message: "Zip Code must be a valid 5-digit zip code." }).gte(1e4, { message: "Zip Code must be a valid 5-digit zip code." }).lte(99999, { message: "Zip Code must be a valid 5-digit zip code." }),
65
- appraisedValue: z.number({ message: "Home Price is required." }).optional().refine(
64
+ zipCode: z.number({ message: "Zip Code is required." }),
65
+ appraisedValue: z.number({ message: "Home Price is required." }).refine(
66
66
  (val) => {
67
67
  if (loanPurpose === 2) {
68
68
  return val != null && val >= 5e4 && val <= 25e6;
@@ -71,7 +71,7 @@ const MortgageRateFilters = ({
71
71
  },
72
72
  { message: "Value must be between $50,000 and $25,000,000." }
73
73
  ),
74
- mortgageBalance: z.number({ message: "Mortgage Balance is required." }).optional().refine(
74
+ mortgageBalance: z.number({ message: "Mortgage Balance is required." }).refine(
75
75
  (val) => {
76
76
  if (loanPurpose === 2) {
77
77
  return val != null && val >= 5e4 && val <= 25e6;
@@ -80,7 +80,7 @@ const MortgageRateFilters = ({
80
80
  },
81
81
  { message: "Value must be between $50,000 and $25,000,000." }
82
82
  ),
83
- cashOut: z.number({ message: "Cash Out is required." }).optional().refine(
83
+ cashOut: z.number({ message: "Cash Out is required." }).refine(
84
84
  (val) => {
85
85
  if (loanPurpose === 2 && val == null) {
86
86
  return false;
@@ -92,19 +92,7 @@ const MortgageRateFilters = ({
92
92
  });
93
93
  const methods = useForm({
94
94
  resolver: zodResolver(schema),
95
- mode: "all",
96
- defaultValues: {
97
- loanPurpose: formData.loanPurpose,
98
- propertyType: formData.propertyType,
99
- occupancy: formData.occupancy,
100
- salesPrice: formData.salesPrice,
101
- downPayment: formData.downPayment,
102
- creditScore: formData.creditScore,
103
- zipCode: formData.zipCode,
104
- appraisedValue: formData.appraisedValue,
105
- mortgageBalance: formData.mortgageBalance,
106
- cashOut: formData.cashOut
107
- }
95
+ mode: "all"
108
96
  });
109
97
  const {
110
98
  handleSubmit,
@@ -114,10 +102,10 @@ const MortgageRateFilters = ({
114
102
  } = methods;
115
103
  const salesPrice = watch("salesPrice");
116
104
  useEffect(() => {
117
- setSalesPriceVal(salesPrice ?? 0);
105
+ setSalesPriceVal(salesPrice);
118
106
  });
119
107
  useEffect(() => {
120
- if (salesPrice != null && salesPrice > 0 && !isTypingDownPayment) {
108
+ if (salesPrice > 0 && !isTypingDownPayment) {
121
109
  const calculatedDownPayment = Math.round(
122
110
  salesPrice * downPaymentPercentage / 100
123
111
  );
@@ -127,16 +115,7 @@ const MortgageRateFilters = ({
127
115
  }, [salesPrice, downPaymentPercentage]);
128
116
  const submitForm = async (data) => {
129
117
  const processData = {
130
- loanPurpose: data.loanPurpose,
131
- propertyType: data.propertyType,
132
- occupancy: data.occupancy,
133
- creditScore: data.creditScore,
134
- zipCode: data.zipCode,
135
- salesPrice: data.salesPrice ?? 0,
136
- downPayment: data.downPayment ?? 0,
137
- appraisedValue: data.appraisedValue ?? 0,
138
- mortgageBalance: data.mortgageBalance ?? 0,
139
- cashOut: data.cashOut ?? 0
118
+ ...data
140
119
  };
141
120
  await onSubmit(processData);
142
121
  };
@@ -412,8 +391,7 @@ const MortgageRateFilters = ({
412
391
  inputMode: "numeric",
413
392
  ...register("zipCode", {
414
393
  required: true,
415
- pattern: /^\d{5}$/,
416
- setValueAs: (value) => Number(value)
394
+ pattern: /^\d{5}$/
417
395
  }),
418
396
  label: "Zip Code",
419
397
  sizes: "medium",
@@ -1,6 +1,6 @@
1
1
  export type RateWatchInputs = {
2
2
  updateType: string;
3
- updateCadence?: string;
3
+ updateCadence: string;
4
4
  loanTerms?: string;
5
5
  hasSmsConsent: boolean;
6
6
  tR1DesiredRate?: string;