@axos-web-dev/shared-components 1.0.99-dev.1 → 1.0.99-dev.3

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 (95) 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 -78
  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 +120 -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 -204
  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 +24 -0
  52. package/dist/Forms/HoneyPot/index.js +71 -0
  53. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  54. package/dist/Forms/MortgageRate/MortgageRateForm.js +363 -342
  55. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  56. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  57. package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
  58. package/dist/Forms/ScheduleCall.d.ts +1 -1
  59. package/dist/Forms/ScheduleCall.js +156 -134
  60. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  61. package/dist/Forms/ScheduleCallPremier.js +178 -156
  62. package/dist/Forms/SuccesForm.js +1 -0
  63. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  64. package/dist/Forms/VendorQuestionnaire.js +817 -795
  65. package/dist/Forms/WcplSurvey.d.ts +1 -1
  66. package/dist/Forms/WcplSurvey.js +112 -90
  67. package/dist/Forms/index.d.ts +1 -0
  68. package/dist/Forms/index.js +4 -0
  69. package/dist/Hyperlink/index.js +1 -0
  70. package/dist/ImageLink/ImageLink.js +1 -0
  71. package/dist/ImageLink/ImageLinkSet.js +1 -0
  72. package/dist/ImageLink/index.js +1 -0
  73. package/dist/Input/Input.js +3 -1
  74. package/dist/Insight/Featured/CategorySelector.js +1 -0
  75. package/dist/Insight/Featured/Featured.js +1 -0
  76. package/dist/Insight/Featured/Header.js +1 -0
  77. package/dist/Modal/Modal.js +1 -0
  78. package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
  79. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  80. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
  81. package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
  82. package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
  83. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  84. package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
  85. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  86. package/dist/NavigationMenu/NavDataJson.js +1 -0
  87. package/dist/NavigationMenu/Navbar.js +1 -0
  88. package/dist/NavigationMenu/SignInNavButton.js +1 -0
  89. package/dist/SetContainer/SetContainer.js +1 -0
  90. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  91. package/dist/VideoTile/VideoTile.js +1 -0
  92. package/dist/VideoWrapper/index.js +1 -0
  93. package/dist/assets/Forms/HoneyPot/HoneyPot.css +4 -0
  94. package/dist/main.js +4 -0
  95. 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, errors, 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 h_container_position: string;
@@ -0,0 +1,5 @@
1
+ import '../../assets/Forms/HoneyPot/HoneyPot.css';/* empty css */
2
+ var h_container_position = "_1f7d89m0";
3
+ export {
4
+ h_container_position
5
+ };
@@ -0,0 +1,24 @@
1
+ import { FieldErrors, UseFormRegister } from 'react-hook-form';
2
+ import { z } from 'zod';
3
+ import { FormProps } from '../FormProps';
4
+
5
+ export type HoneyPotInterface = {
6
+ Alternative_Phone?: string;
7
+ Alternative_Email?: string;
8
+ };
9
+ export declare const honeyPotSchema: z.ZodObject<{
10
+ Alternative_Email: z.ZodOptional<z.ZodString>;
11
+ Alternative_Phone: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ Alternative_Email?: string | undefined;
14
+ Alternative_Phone?: string | undefined;
15
+ }, {
16
+ Alternative_Email?: string | undefined;
17
+ Alternative_Phone?: string | undefined;
18
+ }>;
19
+ export declare const isValidHoneyPot: (data: HoneyPotInterface) => boolean;
20
+ export declare const HoneyPot: ({ variant: fullVariant, register, errors, }: {
21
+ variant?: FormProps["variant"];
22
+ register: UseFormRegister<any>;
23
+ errors: FieldErrors<HoneyPotInterface>;
24
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,71 @@
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 { h_container_position } from "./HoneyPot.css.js";
17
+ const honeyPotSchema = z.object({
18
+ Alternative_Email: z.string().optional(),
19
+ Alternative_Phone: z.string().optional()
20
+ });
21
+ const isValidHoneyPot = (data) => {
22
+ if (data.Alternative_Email !== "bestbank@axos.com" || data.Alternative_Phone !== "") {
23
+ return false;
24
+ }
25
+ return true;
26
+ };
27
+ const HoneyPot = ({
28
+ variant: fullVariant = "primary",
29
+ register,
30
+ errors
31
+ }) => {
32
+ const variant = getVariant(fullVariant);
33
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
34
+ /* @__PURE__ */ jsx("div", { className: h_container_position, children: /* @__PURE__ */ jsx(
35
+ Input,
36
+ {
37
+ id: "Alternative_Email",
38
+ ...register("Alternative_Email"),
39
+ label: "Alternative Email",
40
+ sizes: "medium",
41
+ error: !!errors.Alternative_Email,
42
+ helperText: errors.Alternative_Email?.message,
43
+ variant,
44
+ tabIndex: -1,
45
+ defaultValue: "bestbank@axos.com",
46
+ autoComplete: "false"
47
+ }
48
+ ) }),
49
+ /* @__PURE__ */ jsx("div", { className: h_container_position, children: /* @__PURE__ */ jsx(
50
+ InputPhone,
51
+ {
52
+ id: "Alternative_Phone",
53
+ ...register("Alternative_Phone", {
54
+ maxLength: 12
55
+ }),
56
+ label: "Alternative Phone",
57
+ sizes: "medium",
58
+ error: !!errors.Alternative_Phone,
59
+ helperText: errors.Alternative_Phone?.message,
60
+ variant,
61
+ tabIndex: -1,
62
+ autoComplete: "autocomplete_off_randString"
63
+ }
64
+ ) })
65
+ ] });
66
+ };
67
+ export {
68
+ HoneyPot,
69
+ honeyPotSchema,
70
+ isValidHoneyPot
71
+ };
@@ -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>;