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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -0
  2. package/dist/Auth/ErrorAlert.js +1 -0
  3. package/dist/Button/Button.js +1 -0
  4. package/dist/Calculators/Calculator.js +1 -0
  5. package/dist/Carousel/index.js +1 -0
  6. package/dist/Chevron/index.js +1 -0
  7. package/dist/Comparison/Comparison.js +1 -0
  8. package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
  9. package/dist/FaqAccordion/index.js +1 -0
  10. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
  11. package/dist/Forms/ApplicationStart.d.ts +1 -1
  12. package/dist/Forms/ApplicationStart.js +111 -89
  13. package/dist/Forms/ApplyNow.js +1 -0
  14. package/dist/Forms/ClearingForm.d.ts +1 -1
  15. package/dist/Forms/ClearingForm.js +184 -162
  16. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  17. package/dist/Forms/CommercialDeposits.js +201 -179
  18. package/dist/Forms/CommercialLending.d.ts +1 -1
  19. package/dist/Forms/CommercialLending.js +278 -256
  20. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  21. package/dist/Forms/CommercialPremiumFinance.js +128 -106
  22. package/dist/Forms/ContactCompany.d.ts +1 -1
  23. package/dist/Forms/ContactCompany.js +113 -91
  24. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  25. package/dist/Forms/ContactCompanyTitle.js +127 -105
  26. package/dist/Forms/ContactUs.d.ts +1 -1
  27. package/dist/Forms/ContactUs.js +99 -77
  28. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  29. package/dist/Forms/ContactUsAAS.js +180 -158
  30. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  31. package/dist/Forms/ContactUsBusiness.js +134 -112
  32. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  33. package/dist/Forms/ContactUsBusinessNameEmail.js +103 -81
  34. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  35. package/dist/Forms/ContactUsLVF.js +118 -98
  36. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  37. package/dist/Forms/ContactUsNMLSId.js +117 -95
  38. package/dist/Forms/CpraRequest.d.ts +1 -1
  39. package/dist/Forms/CpraRequest.js +641 -619
  40. package/dist/Forms/CraPublicFile.d.ts +1 -1
  41. package/dist/Forms/CraPublicFile.js +109 -87
  42. package/dist/Forms/DealerServices.d.ts +1 -1
  43. package/dist/Forms/DealerServices.js +225 -203
  44. package/dist/Forms/EmailOnly.d.ts +1 -1
  45. package/dist/Forms/EmailOnly.js +56 -36
  46. package/dist/Forms/EmailUs.d.ts +1 -1
  47. package/dist/Forms/EmailUs.js +75 -53
  48. package/dist/Forms/FormProps.d.ts +3 -0
  49. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
  50. package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
  51. package/dist/Forms/HoneyPot/index.d.ts +23 -0
  52. package/dist/Forms/HoneyPot/index.js +69 -0
  53. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  54. package/dist/Forms/MortgageRate/MortgageRateForm.js +367 -345
  55. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  56. package/dist/Forms/MortgageWarehouseLending.d.ts +1 -3
  57. package/dist/Forms/MortgageWarehouseLending.js +13 -3
  58. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  59. package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
  60. package/dist/Forms/ScheduleCall.d.ts +1 -1
  61. package/dist/Forms/ScheduleCall.js +156 -134
  62. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  63. package/dist/Forms/ScheduleCallPremier.js +178 -156
  64. package/dist/Forms/SuccesForm.js +1 -0
  65. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  66. package/dist/Forms/VendorQuestionnaire.js +817 -795
  67. package/dist/Forms/WcplSurvey.d.ts +1 -1
  68. package/dist/Forms/WcplSurvey.js +112 -90
  69. package/dist/Forms/index.d.ts +1 -0
  70. package/dist/Forms/index.js +4 -0
  71. package/dist/Hyperlink/index.js +1 -0
  72. package/dist/ImageLink/ImageLink.js +1 -0
  73. package/dist/ImageLink/ImageLinkSet.js +1 -0
  74. package/dist/ImageLink/index.js +1 -0
  75. package/dist/Insight/Featured/CategorySelector.js +1 -0
  76. package/dist/Insight/Featured/Featured.js +1 -0
  77. package/dist/Insight/Featured/Header.js +1 -0
  78. package/dist/Modal/Modal.js +1 -0
  79. package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
  80. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  81. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
  82. package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
  83. package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
  84. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  85. package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
  86. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  87. package/dist/SetContainer/SetContainer.js +1 -0
  88. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  89. package/dist/VideoTile/VideoTile.js +1 -0
  90. package/dist/VideoWrapper/index.js +1 -0
  91. package/dist/assets/Forms/HoneyPot/HoneyPot.css +8 -0
  92. package/dist/main.js +4 -0
  93. package/package.json +1 -1
@@ -24,6 +24,7 @@ import clsx from "clsx";
24
24
  import { useForm, FormProvider } from "react-hook-form";
25
25
  import * as z from "zod";
26
26
  import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
27
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
27
28
  const EmailUs = ({
28
29
  icon = false,
29
30
  children,
@@ -35,6 +36,7 @@ const EmailUs = ({
35
36
  headline,
36
37
  callToAction,
37
38
  validateEmail,
39
+ onValidate,
38
40
  description,
39
41
  id
40
42
  }) => {
@@ -42,8 +44,16 @@ const EmailUs = ({
42
44
  email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
43
45
  message: z.string().min(2, "Message is required")
44
46
  });
47
+ const gen_schema = schema.merge(honeyPotSchema).superRefine((data, ctx) => {
48
+ if (!isValidHoneyPot(data)) {
49
+ ctx.addIssue({
50
+ code: z.ZodIssueCode.custom,
51
+ message: "fields are not valid."
52
+ });
53
+ }
54
+ });
45
55
  const methods = useForm({
46
- resolver: zodResolver(schema, {
56
+ resolver: zodResolver(gen_schema, {
47
57
  async: true
48
58
  }),
49
59
  mode: "all",
@@ -77,59 +87,71 @@ const EmailUs = ({
77
87
  }
78
88
  )
79
89
  ] }),
80
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
81
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant, formType: "email" })), children: [
82
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
83
- Input,
84
- {
85
- id: "email",
86
- ...register("email", {
87
- required: true,
88
- validate: {
89
- isValid: associatedEmail
90
+ /* @__PURE__ */ jsxs(
91
+ "form",
92
+ {
93
+ className: form,
94
+ onSubmit: async (e) => {
95
+ onValidate && onValidate(e);
96
+ await handleSubmit(submitForm)(e);
97
+ e.preventDefault();
98
+ },
99
+ children: [
100
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant, formType: "email" })), children: [
101
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
102
+ Input,
103
+ {
104
+ id: "email",
105
+ ...register("email", {
106
+ required: true,
107
+ validate: {
108
+ isValid: associatedEmail
109
+ }
110
+ }),
111
+ label: "Email",
112
+ sizes: "medium",
113
+ required: true,
114
+ error: !!errors.email,
115
+ helperText: errors.email?.message,
116
+ variant
90
117
  }
91
- }),
92
- label: "Email",
93
- sizes: "medium",
94
- required: true,
95
- error: !!errors.email,
96
- helperText: errors.email?.message,
97
- variant
98
- }
99
- ) }),
100
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
101
- InputTextArea,
102
- {
103
- id: "message",
104
- ...register("message", { required: true }),
105
- label: "Write Your Message",
106
- sizes: "medium",
107
- required: true,
108
- error: !!errors.message,
109
- helperText: errors.message?.message,
110
- variant
111
- }
112
- ) })
113
- ] }),
114
- children,
115
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
116
- /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
117
- LoadingIndicator,
118
- {
119
- style: { marginInline: "auto" },
120
- variant
121
- }
122
- ) : /* @__PURE__ */ jsx(
123
- Button,
124
- {
125
- color: getVariant(callToAction?.variant),
126
- as: "button",
127
- type: "submit",
128
- disabled: !isValid || isSubmitting,
129
- children: callToAction?.displayText
130
- }
131
- ) })
132
- ] })
118
+ ) }),
119
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
120
+ InputTextArea,
121
+ {
122
+ id: "message",
123
+ ...register("message", { required: true }),
124
+ label: "Write Your Message",
125
+ sizes: "medium",
126
+ required: true,
127
+ error: !!errors.message,
128
+ helperText: errors.message?.message,
129
+ variant
130
+ }
131
+ ) }),
132
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
133
+ ] }),
134
+ children,
135
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
136
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
137
+ LoadingIndicator,
138
+ {
139
+ style: { marginInline: "auto" },
140
+ variant
141
+ }
142
+ ) : /* @__PURE__ */ jsx(
143
+ Button,
144
+ {
145
+ color: getVariant(callToAction?.variant),
146
+ as: "button",
147
+ type: "submit",
148
+ disabled: !isValid || isSubmitting,
149
+ children: callToAction?.displayText
150
+ }
151
+ ) })
152
+ ]
153
+ }
154
+ )
133
155
  ] }) }) }, id);
134
156
  };
135
157
  export {
@@ -7,6 +7,9 @@ export interface FormProps extends PropsWithChildren {
7
7
  onSubmit?: (values: {
8
8
  [index: string]: string | boolean | number | Date | any;
9
9
  }) => void;
10
+ onValidate?: (values: {
11
+ [index: string]: string | boolean | number | Date | any;
12
+ }) => void;
10
13
  icon?: boolean;
11
14
  headline?: ReactNode | string;
12
15
  description?: ReactNode | string;
@@ -0,0 +1 @@
1
+ export declare const form_field_container: string;
@@ -0,0 +1,5 @@
1
+ import '../../assets/Forms/HoneyPot/HoneyPot.css';/* empty css */
2
+ var form_field_container = "_1f7d89m0";
3
+ export {
4
+ form_field_container
5
+ };
@@ -0,0 +1,23 @@
1
+ import { UseFormRegister } from 'react-hook-form';
2
+ import { z } from 'zod';
3
+ import { FormProps } from '../FormProps';
4
+
5
+ export type HoneyPotInterface = {
6
+ AlternativePhone?: string;
7
+ AlternativeEmail?: string;
8
+ };
9
+ export declare const honeyPotSchema: z.ZodObject<{
10
+ AlternativeEmail: z.ZodEffects<z.ZodString, "bestbank@axos.com", string>;
11
+ AlternativePhone: z.ZodEffects<z.ZodString, string, string>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ AlternativeEmail: "bestbank@axos.com";
14
+ AlternativePhone: string;
15
+ }, {
16
+ AlternativeEmail: string;
17
+ AlternativePhone: string;
18
+ }>;
19
+ export declare const isValidHoneyPot: (data: HoneyPotInterface) => boolean;
20
+ export declare const HoneyPot: ({ variant: fullVariant, register, }: {
21
+ variant?: FormProps["variant"];
22
+ register: UseFormRegister<any>;
23
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import "../../Input/Checkbox.js";
3
+ import "../../Input/CurrencyInput.js";
4
+ import "../../Input/Dropdown.js";
5
+ import "../../Input/Dropdown.css.js";
6
+ import { Input } from "../../Input/Input.js";
7
+ import "../../Input/Input.css.js";
8
+ import "../../Input/InputAmount.js";
9
+ import { InputPhone } from "../../Input/InputPhone.js";
10
+ import "../../Input/InputTextArea.js";
11
+ import "../../Input/DownPaymentInput.js";
12
+ import "../../Input/RadioButton.js";
13
+ import "../../utils/allowedAxosDomains.js";
14
+ import { getVariant } from "../../utils/getVariant.js";
15
+ import { z } from "zod";
16
+ import { form_field_container } from "./HoneyPot.css.js";
17
+ const honeyPotSchema = z.object({
18
+ AlternativeEmail: z.string().refine((val) => val === "bestbank@axos.com"),
19
+ AlternativePhone: z.string().refine((val) => !val || val.trim() === "")
20
+ });
21
+ const isValidHoneyPot = (data) => {
22
+ return data.AlternativeEmail === "bestbank@axos.com" && (!data.AlternativePhone || data.AlternativePhone.trim() === "");
23
+ };
24
+ const HoneyPot = ({
25
+ variant: fullVariant = "primary",
26
+ register
27
+ }) => {
28
+ const variant = getVariant(fullVariant);
29
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
30
+ /* @__PURE__ */ jsx("div", { className: form_field_container, children: /* @__PURE__ */ jsx(
31
+ Input,
32
+ {
33
+ id: "AlternativeEmail",
34
+ ...register("AlternativeEmail"),
35
+ label: "Alternative Email",
36
+ sizes: "medium",
37
+ variant,
38
+ tabIndex: -1,
39
+ defaultValue: "bestbank@axos.com",
40
+ autoComplete: "off",
41
+ "aria-autocomplete": "none",
42
+ name: "AlternativeEmail",
43
+ "aria-label": "Alternative Email",
44
+ type: "text"
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ jsx("div", { className: form_field_container, children: /* @__PURE__ */ jsx(
48
+ InputPhone,
49
+ {
50
+ id: "AlternativePhone",
51
+ ...register("AlternativePhone"),
52
+ label: "Alternative Phone",
53
+ sizes: "medium",
54
+ variant,
55
+ tabIndex: -1,
56
+ defaultValue: "",
57
+ autoComplete: "off",
58
+ "aria-autocomplete": "none",
59
+ name: "AlternativePhone",
60
+ "aria-label": "Alternative Phone"
61
+ }
62
+ ) })
63
+ ] });
64
+ };
65
+ export {
66
+ HoneyPot,
67
+ honeyPotSchema,
68
+ isValidHoneyPot
69
+ };
@@ -19,7 +19,7 @@ export type MortgageRateInputs = {
19
19
  loanPurpose: number;
20
20
  [key: string]: string | number;
21
21
  };
22
- export declare const MortgageRate: ({ icon, children, onSubmit, disclosure, variant: fullVariant, validateEmail, id, rateWatchOnSubmit, setRateWatchSubmitted, hideModalValue, showingTables, }: FormProps & {
22
+ export declare const MortgageRate: ({ icon, children, onSubmit, disclosure, variant: fullVariant, validateEmail, id, rateWatchOnSubmit, setRateWatchSubmitted, hideModalValue, showingTables, onValidate, }: FormProps & {
23
23
  rateWatchOnSubmit: (values: RateWatchInputs & {
24
24
  email: string;
25
25
  }) => Promise<void>;