@axos-web-dev/shared-components 1.0.8 → 1.0.9-9.dev.1

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 (242) hide show
  1. package/dist/ATMLocator/ATMLocator.js +42 -32
  2. package/dist/Accordion/Accordion.css.d.ts +1 -1
  3. package/dist/Article/Article.css.d.ts +41 -41
  4. package/dist/Article/Article.js +3 -13
  5. package/dist/ArticlesSet/ArticlesSet.css.d.ts +16 -16
  6. package/dist/Auth/ErrorAlert.css.d.ts +4 -0
  7. package/dist/Auth/ErrorAlert.css.js +11 -0
  8. package/dist/Auth/ErrorAlert.d.ts +14 -0
  9. package/dist/Auth/ErrorAlert.js +184 -0
  10. package/dist/Auth/Logout.d.ts +3 -0
  11. package/dist/Auth/Logout.js +29 -0
  12. package/dist/Auth/SignIn.css.d.ts +6 -0
  13. package/dist/Auth/SignIn.css.js +18 -0
  14. package/dist/Auth/SignInPassword.d.ts +15 -0
  15. package/dist/Auth/SignInPassword.js +118 -0
  16. package/dist/Auth/index.d.ts +5 -0
  17. package/dist/Auth/index.js +20 -0
  18. package/dist/Button/Button.css.d.ts +31 -18
  19. package/dist/Button/Button.css.js +1 -1
  20. package/dist/Button/Button.js +14 -4
  21. package/dist/Calculators/AnnualFeeCalculator/AnnualFeeCalculator.css.d.ts +12 -12
  22. package/dist/Calculators/ApyCalculator/ApyCalculator.css.d.ts +14 -14
  23. package/dist/Calculators/ApyCalculator/index.js +20 -12
  24. package/dist/Calculators/AxosOneCalculator/BalanceAPYCalculator.css.d.ts +8 -8
  25. package/dist/Calculators/AxosOneCalculator/index.js +18 -10
  26. package/dist/Calculators/BalanceAPYCalculator/BalanceAPYCalculator.css.d.ts +22 -22
  27. package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.d.ts +101 -0
  28. package/dist/Calculators/BuyDownCalculator/BuyDownCalculator.css.js +56 -0
  29. package/dist/Calculators/BuyDownCalculator/index.d.ts +25 -0
  30. package/dist/Calculators/BuyDownCalculator/index.js +855 -0
  31. package/dist/Calculators/Calculator.js +29 -10
  32. package/dist/Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.d.ts +12 -12
  33. package/dist/Calculators/MonthlyPaymentLVFCalculator/MonthlyPaymentCalculator.css.d.ts +12 -12
  34. package/dist/Calculators/SummitApyCalculator/BalanceAPYCalculator.css.d.ts +8 -8
  35. package/dist/Calculators/calculator.css.d.ts +12 -12
  36. package/dist/Calculators/index.d.ts +1 -0
  37. package/dist/Calculators/index.js +2 -0
  38. package/dist/CallToActionBar/index.js +3 -1
  39. package/dist/Carousel/Carousel.css.d.ts +20 -20
  40. package/dist/Carousel/index.js +23 -13
  41. package/dist/Chevron/Chevron.css.d.ts +6 -6
  42. package/dist/Chevron/index.js +14 -4
  43. package/dist/Comparison/Comparison.css.d.ts +11 -10
  44. package/dist/Comparison/Comparison.css.js +3 -1
  45. package/dist/Comparison/Comparison.js +23 -13
  46. package/dist/Comparison/index.js +2 -1
  47. package/dist/ContentBanner/ContentBanner.css.d.ts +12 -12
  48. package/dist/ExecutiveBio/ExecutiveBio.css.d.ts +31 -31
  49. package/dist/ExecutiveBio/ExecutiveBio.js +16 -22
  50. package/dist/FaqAccordion/index.js +16 -6
  51. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +14 -4
  52. package/dist/Forms/ApplicationStart.js +21 -4
  53. package/dist/Forms/ApplyNow.js +14 -4
  54. package/dist/Forms/ClearingForm.js +19 -2
  55. package/dist/Forms/CommercialDeposits.js +19 -2
  56. package/dist/Forms/CommercialLending.js +20 -3
  57. package/dist/Forms/CommercialPremiumFinance.d.ts +10 -0
  58. package/dist/Forms/CommercialPremiumFinance.js +212 -0
  59. package/dist/Forms/ContactCompany.js +20 -3
  60. package/dist/Forms/ContactCompanyTitle.js +20 -3
  61. package/dist/Forms/ContactUs.d.ts +1 -1
  62. package/dist/Forms/ContactUs.js +107 -79
  63. package/dist/Forms/ContactUsAAS.js +20 -5
  64. package/dist/Forms/ContactUsBusiness.d.ts +2 -2
  65. package/dist/Forms/ContactUsBusiness.js +45 -19
  66. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +9 -0
  67. package/dist/Forms/ContactUsBusinessNameEmail.js +282 -0
  68. package/dist/Forms/ContactUsLVF.js +20 -3
  69. package/dist/Forms/ContactUsNMLSId.js +35 -9
  70. package/dist/Forms/CpraRequest.d.ts +1 -1
  71. package/dist/Forms/CpraRequest.js +75 -63
  72. package/dist/Forms/CraPublicFile.d.ts +5 -5
  73. package/dist/Forms/CraPublicFile.js +69 -45
  74. package/dist/Forms/DealerServices.js +20 -4
  75. package/dist/Forms/EmailOnly.js +45 -28
  76. package/dist/Forms/EmailUs.js +12 -2
  77. package/dist/Forms/FormEnums.d.ts +21 -0
  78. package/dist/Forms/FormEnums.js +308 -0
  79. package/dist/Forms/FormProps.d.ts +3 -0
  80. package/dist/Forms/Forms.css.d.ts +42 -42
  81. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
  82. package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
  83. package/dist/Forms/HoneyPot/index.d.ts +24 -0
  84. package/dist/Forms/HoneyPot/index.js +71 -0
  85. package/dist/Forms/MortgageRate/MortgageRateForm.js +17 -7
  86. package/dist/Forms/MortgageRate/MortgageRateWatch.js +16 -6
  87. package/dist/Forms/QuickPricer/QuickPricerForm.js +19 -20
  88. package/dist/Forms/ScheduleCall.js +20 -3
  89. package/dist/Forms/ScheduleCallPremier.js +20 -3
  90. package/dist/Forms/SuccesForm.js +31 -21
  91. package/dist/Forms/VendorQuestionnaire.js +12 -2
  92. package/dist/Forms/WcplSurvey.js +20 -3
  93. package/dist/Forms/index.d.ts +3 -0
  94. package/dist/Forms/index.js +8 -0
  95. package/dist/HelpArticle/HelpArticle.css.d.ts +4 -0
  96. package/dist/HelpArticle/HelpArticle.css.js +12 -0
  97. package/dist/HelpArticle/index.d.ts +1 -0
  98. package/dist/HelpArticle/index.js +7 -0
  99. package/dist/HeroBanner/HeroBanner.css.d.ts +19 -17
  100. package/dist/HeroBanner/HeroBanner.css.js +9 -5
  101. package/dist/HeroBanner/HeroBanner.d.ts +1 -1
  102. package/dist/HeroBanner/HeroBanner.interface.d.ts +3 -0
  103. package/dist/HeroBanner/HeroBanner.js +47 -1
  104. package/dist/HeroBanner/LargeBanner.css.d.ts +20 -20
  105. package/dist/HeroBanner/SelectionBanner.css.d.ts +8 -8
  106. package/dist/HeroBanner/index.js +3 -1
  107. package/dist/Hyperlink/index.js +17 -7
  108. package/dist/IconBillboard/IconBillboard.css.d.ts +26 -25
  109. package/dist/IconBillboard/IconBillboard.css.js +5 -3
  110. package/dist/IconBillboard/IconBillboard.d.ts +1 -2
  111. package/dist/IconBillboard/IconBillboard.interface.d.ts +1 -0
  112. package/dist/IconBillboard/IconBillboard.js +46 -80
  113. package/dist/IconBillboard/IconBillboardSet.js +1 -1
  114. package/dist/IconBillboard/index.js +3 -3
  115. package/dist/IconBillboard/sections/CallToActionSection.d.ts +12 -0
  116. package/dist/IconBillboard/sections/CallToActionSection.js +101 -0
  117. package/dist/IconBillboard/sections/HeaderSection.d.ts +11 -0
  118. package/dist/IconBillboard/sections/HeaderSection.js +23 -0
  119. package/dist/IconBillboard/sections/IconSection.d.ts +7 -0
  120. package/dist/IconBillboard/sections/IconSection.js +18 -0
  121. package/dist/IconBillboard/sections/ItemsSection.d.ts +11 -0
  122. package/dist/IconBillboard/sections/ItemsSection.js +11 -0
  123. package/dist/IconBillboard/sections/LayoutSection.d.ts +8 -0
  124. package/dist/IconBillboard/sections/LayoutSection.js +6 -0
  125. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.d.ts +9 -0
  126. package/dist/ImageBillboard/ExitIntentModal/ModalWrapper.js +85 -0
  127. package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.d.ts +5 -0
  128. package/dist/ImageBillboard/ExitIntentModal/useExitIntentModal.js +90 -0
  129. package/dist/ImageBillboard/ImageBillboard.css.d.ts +36 -20
  130. package/dist/ImageBillboard/ImageBillboard.css.js +50 -18
  131. package/dist/ImageBillboard/ImageBillboard.interface.d.ts +20 -2
  132. package/dist/ImageBillboard/ImageBillboardSet.d.ts +1 -1
  133. package/dist/ImageBillboard/ImageBillboardSet.js +104 -28
  134. package/dist/ImageBillboard/index.js +17 -1
  135. package/dist/ImageLink/ImageLink.d.ts +2 -2
  136. package/dist/ImageLink/ImageLink.js +17 -13
  137. package/dist/ImageLink/ImageLinkSet.js +20 -10
  138. package/dist/ImageLink/index.js +17 -7
  139. package/dist/Input/Checkbox.js +2 -1
  140. package/dist/Input/Input.css.d.ts +16 -16
  141. package/dist/Input/Input.js +4 -1
  142. package/dist/Input/PercentageInput.d.ts +3 -0
  143. package/dist/Input/PercentageInput.js +32 -0
  144. package/dist/Input/RadioButton.js +12 -3
  145. package/dist/Inputs/Input.css.d.ts +14 -14
  146. package/dist/Insight/Featured/CategorySelector.js +28 -20
  147. package/dist/Insight/Featured/Featured.js +75 -58
  148. package/dist/Insight/Featured/Header.js +22 -12
  149. package/dist/Interstitial/Interstitial-variants.css.d.ts +2 -2
  150. package/dist/LandingPageHeader/LandingPageHeader.css.d.ts +3 -3
  151. package/dist/Modal/Modal.js +15 -5
  152. package/dist/NavigationMenu/AxosALTS/NavData.js +14 -4
  153. package/dist/NavigationMenu/AxosALTS/index.js +14 -4
  154. package/dist/NavigationMenu/AxosAdvisor/SubNavBar.js +3 -10
  155. package/dist/NavigationMenu/AxosAdvisor/index.js +3 -11
  156. package/dist/NavigationMenu/AxosAdvisorServices/NavData.js +0 -5
  157. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.d.ts +2 -0
  158. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +345 -0
  159. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +53 -0
  160. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +272 -0
  161. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +664 -0
  162. package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -81
  163. package/dist/NavigationMenu/AxosBank/NavData.js +14 -4
  164. package/dist/NavigationMenu/AxosBank/SubNavBar.js +432 -108
  165. package/dist/NavigationMenu/AxosBank/index.d.ts +2 -1
  166. package/dist/NavigationMenu/AxosBank/index.js +104 -533
  167. package/dist/NavigationMenu/LaVictoire/NavData.js +14 -4
  168. package/dist/NavigationMenu/LaVictoire/index.js +40 -20
  169. package/dist/NavigationMenu/NavDataJson.d.ts +2 -0
  170. package/dist/NavigationMenu/NavDataJson.js +309 -0
  171. package/dist/NavigationMenu/Navbar.d.ts +5 -0
  172. package/dist/NavigationMenu/Navbar.js +195 -0
  173. package/dist/NavigationMenu/SignInNavButton.d.ts +1 -0
  174. package/dist/NavigationMenu/SignInNavButton.js +363 -0
  175. package/dist/PageNavItem/PageNavItem.css.d.ts +2 -2
  176. package/dist/SetContainer/SetContainer.css.d.ts +17 -18
  177. package/dist/SetContainer/SetContainer.css.js +2 -4
  178. package/dist/SetContainer/SetContainer.d.ts +2 -1
  179. package/dist/SetContainer/SetContainer.js +27 -13
  180. package/dist/SetContainer/index.js +1 -2
  181. package/dist/SocialMediaBar/iconsRepository.js +14 -4
  182. package/dist/StepItem/StepItem.css.d.ts +18 -18
  183. package/dist/StepItemSet/StepItemSet.css.d.ts +14 -14
  184. package/dist/StepItemSet/StepItemSet.js +2 -6
  185. package/dist/Tab/Tab.css.d.ts +12 -12
  186. package/dist/Table/Table.css.d.ts +25 -25
  187. package/dist/Table/Table.d.ts +3 -3
  188. package/dist/Topic/Topic.css.d.ts +4 -0
  189. package/dist/Topic/Topic.css.js +12 -0
  190. package/dist/Topic/Topic.d.ts +19 -0
  191. package/dist/Topic/Topic.js +24 -0
  192. package/dist/Topic/index.d.ts +2 -0
  193. package/dist/Topic/index.js +12 -0
  194. package/dist/VideoTile/VideoTile.interface.d.ts +4 -3
  195. package/dist/VideoTile/VideoTile.js +183 -28
  196. package/dist/VideoWrapper/index.js +15 -5
  197. package/dist/WalnutIframe/index.d.ts +6 -0
  198. package/dist/WalnutIframe/index.js +21 -0
  199. package/dist/WalnutIframe/wrapper.module.js +14 -0
  200. package/dist/assets/Auth/ErrorAlert.css +37 -0
  201. package/dist/assets/Auth/SignIn.css +86 -0
  202. package/dist/assets/Button/Button.css +31 -16
  203. package/dist/assets/Calculators/AxosOneCalculator/BalanceAPYCalculator.css +5 -0
  204. package/dist/assets/Calculators/BuyDownCalculator/BuyDownCalculator.css +197 -0
  205. package/dist/assets/Calculators/SummitApyCalculator/BalanceAPYCalculator.css +8 -0
  206. package/dist/assets/CallToActionBar/CallToActionBar.css +4 -0
  207. package/dist/assets/Comparison/Comparison.css +9 -2
  208. package/dist/assets/Forms/HoneyPot/HoneyPot.css +4 -0
  209. package/dist/assets/HelpArticle/HelpArticle.css +70 -0
  210. package/dist/assets/HeroBanner/HeroBanner.css +38 -26
  211. package/dist/assets/HeroBanner/LargeBanner.css +3 -0
  212. package/dist/assets/IconBillboard/IconBillboard.css +43 -36
  213. package/dist/assets/ImageBillboard/ImageBillboard.css +336 -36
  214. package/dist/assets/Insight/Insight.css +12 -0
  215. package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +191 -0
  216. package/dist/assets/NavigationMenu/AxosBank/NavBar.css +6 -0
  217. package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +473 -661
  218. package/dist/assets/SetContainer/SetContainer.css +44 -22
  219. package/dist/assets/Topic/Topic.css +54 -0
  220. package/dist/assets/WalnutIframe/wrapper.css.css +49 -0
  221. package/dist/assets/globals.css +13 -30
  222. package/dist/assets/utils/optimizeImage/optimizeImage.css.css +47 -0
  223. package/dist/icons/ArrowIcon/ArrowIcon.css.d.ts +3 -3
  224. package/dist/icons/CheckIcon/CheckIcon.css.d.ts +2 -2
  225. package/dist/icons/Logos/AXB.d.ts +8 -0
  226. package/dist/icons/Logos/AXB.js +74 -0
  227. package/dist/main.d.ts +5 -0
  228. package/dist/main.js +69 -8
  229. package/dist/themes/axos.css.d.ts +38 -38
  230. package/dist/utils/allowedAxosDomains.js +19 -3
  231. package/dist/utils/appendQueryParams.js +3 -6
  232. package/dist/utils/{lazyImage/lazyImage.d.ts → optimizeImage/OptimizeImage.d.ts} +3 -2
  233. package/dist/utils/optimizeImage/OptimizeImage.js +46 -0
  234. package/dist/utils/optimizeImage/index.d.ts +1 -0
  235. package/dist/utils/optimizeImage/index.js +4 -0
  236. package/dist/utils/optimizeImage/optimizeImage.module.js +14 -0
  237. package/package.json +11 -8
  238. package/dist/utils/lazyImage/imageObserver.d.ts +0 -9
  239. package/dist/utils/lazyImage/imageObserver.js +0 -29
  240. package/dist/utils/lazyImage/index.d.ts +0 -2
  241. package/dist/utils/lazyImage/index.js +0 -7
  242. package/dist/utils/lazyImage/lazyImage.js +0 -26
@@ -0,0 +1,212 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { zodResolver } from "@hookform/resolvers/zod";
4
+ import { Button } from "../Button/Button.js";
5
+ import "../Button/Button.css.js";
6
+ import "react";
7
+ import "react-use";
8
+ import "../icons/ArrowIcon/ArrowIcon.css.js";
9
+ import SvgAxosX from "../icons/AxosX/index.js";
10
+ import SvgComponent from "../icons/AxosX/Blue.js";
11
+ import "../icons/CheckIcon/CheckIcon.css.js";
12
+ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
13
+ /* empty css */
14
+ /* empty css */
15
+ /* empty css */
16
+ /* empty css */
17
+ import "../Input/Checkbox.js";
18
+ import "../Input/CurrencyInput.js";
19
+ import { Dropdown } from "../Input/Dropdown.js";
20
+ import "../Input/Dropdown.css.js";
21
+ import { Input } from "../Input/Input.js";
22
+ import "../Input/Input.css.js";
23
+ import "../Input/InputAmount.js";
24
+ import "../Input/InputPhone.js";
25
+ import "../Input/InputTextArea.js";
26
+ import "../Input/DownPaymentInput.js";
27
+ import "../Input/RadioButton.js";
28
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
29
+ import "../utils/allowedAxosDomains.js";
30
+ import { associatedEmail } from "../utils/EverestValidity.js";
31
+ import { getVariant } from "../utils/getVariant.js";
32
+ import clsx from "clsx";
33
+ import { useForm, FormProvider } from "react-hook-form";
34
+ import { z } from "zod";
35
+ import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
36
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
37
+ import { SalesforceSchema } from "./SalesforceFieldsForm.js";
38
+ const CommercialPremiumFinance = ({
39
+ icon = false,
40
+ children,
41
+ onSubmit = (values) => {
42
+ console.log(values);
43
+ },
44
+ disclosure,
45
+ variant: fullVariant = "primary",
46
+ headline,
47
+ callToAction,
48
+ validateEmail,
49
+ description,
50
+ id
51
+ }) => {
52
+ const schema = z.object({
53
+ first_name: z.string({
54
+ required_error: "First name is required",
55
+ invalid_type_error: "Invalid first name"
56
+ }).regex(/^[a-zA-Z]*(?:[a-zA-Z][a-zA-Z'-]*\s{0,1}){2,}$/g, {
57
+ message: "Invalid first name"
58
+ }).trim().min(1, { message: "First Name is required." }),
59
+ last_name: z.string({
60
+ required_error: "Last name is required",
61
+ invalid_type_error: "Invalid last name"
62
+ }).regex(/^[a-zA-Z]*(?:[a-zA-Z][a-zA-Z'-]*\s{0,1}){2,}$/g, {
63
+ message: "Invalid last name"
64
+ }).trim().min(1, { message: "Last Name is required." }),
65
+ email: z.string().email({ message: "Invalid email address" }).refine(async (val) => await validateEmail(val), {
66
+ message: "Invalid email address"
67
+ }),
68
+ Insurance_Company__c: z.string(),
69
+ Type_of_Policy__c: z.string()
70
+ });
71
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
72
+ if (!isValidHoneyPot(data)) {
73
+ ctx.addIssue({
74
+ code: z.ZodIssueCode.custom,
75
+ message: "fields are not valid."
76
+ });
77
+ }
78
+ });
79
+ const methods = useForm({
80
+ resolver: zodResolver(gen_schema, {
81
+ async: true
82
+ }),
83
+ mode: "onBlur",
84
+ defaultValues: {
85
+ email: ""
86
+ }
87
+ });
88
+ const {
89
+ handleSubmit,
90
+ register,
91
+ formState: { errors, isValid, isSubmitting }
92
+ } = methods;
93
+ const submitForm = async (data) => {
94
+ await onSubmit(data);
95
+ };
96
+ const variant = getVariant(fullVariant);
97
+ return /* @__PURE__ */ jsx("section", { id, className: clsx(formContainer({ variant })), children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
98
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
99
+ /* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
100
+ /* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
101
+ description && /* @__PURE__ */ jsx(
102
+ "div",
103
+ {
104
+ className: clsx(
105
+ "text_center",
106
+ form,
107
+ descriptionField({ variant })
108
+ ),
109
+ children: description
110
+ }
111
+ )
112
+ ] }),
113
+ /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
114
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
115
+ /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
116
+ Input,
117
+ {
118
+ id: "first_name",
119
+ ...register("first_name", { required: true }),
120
+ label: "First Name",
121
+ sizes: "medium",
122
+ required: true,
123
+ error: !!errors.first_name,
124
+ helperText: errors.first_name?.message,
125
+ variant
126
+ }
127
+ ) }),
128
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
129
+ Input,
130
+ {
131
+ id: "last_name",
132
+ ...register("last_name", { required: true }),
133
+ label: "Last Name",
134
+ sizes: "medium",
135
+ required: true,
136
+ error: !!errors.last_name,
137
+ helperText: errors.last_name?.message,
138
+ variant
139
+ }
140
+ ) }),
141
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
142
+ Input,
143
+ {
144
+ id: "email",
145
+ ...register("email", {
146
+ required: true,
147
+ validate: {
148
+ isValid: associatedEmail
149
+ }
150
+ }),
151
+ label: "Email",
152
+ sizes: "medium",
153
+ required: true,
154
+ error: !!errors.email,
155
+ helperText: errors.email?.message,
156
+ variant
157
+ }
158
+ ) }),
159
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
160
+ Input,
161
+ {
162
+ id: "Insurance_Company__c",
163
+ ...register("Insurance_Company__c", {}),
164
+ label: "Insurance Company",
165
+ sizes: "medium",
166
+ error: !!errors.Insurance_Company__c,
167
+ helperText: errors.Insurance_Company__c?.message,
168
+ variant
169
+ }
170
+ ) }),
171
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
172
+ Dropdown,
173
+ {
174
+ id: "Type_of_Policy__c",
175
+ ...register("Type_of_Policy__c", {}),
176
+ label: "Type of Policy",
177
+ sizes: "medium",
178
+ variant,
179
+ defaultValue: "",
180
+ children: [
181
+ /* @__PURE__ */ jsx("option", { value: "" }),
182
+ /* @__PURE__ */ jsx("option", { value: "Whole life", children: "Whole life" }),
183
+ /* @__PURE__ */ jsx("option", { value: "Index Universal Life", children: "Index Universal Life" })
184
+ ]
185
+ }
186
+ ) }),
187
+ /* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
188
+ ] }),
189
+ children,
190
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
191
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
192
+ LoadingIndicator,
193
+ {
194
+ style: { marginInline: "auto" },
195
+ variant
196
+ }
197
+ ) : /* @__PURE__ */ jsx(
198
+ Button,
199
+ {
200
+ color: getVariant(callToAction?.variant),
201
+ as: "button",
202
+ type: "submit",
203
+ disabled: !isValid || isSubmitting,
204
+ children: callToAction?.displayText
205
+ }
206
+ ) })
207
+ ] })
208
+ ] }) }) }, id);
209
+ };
210
+ export {
211
+ CommercialPremiumFinance
212
+ };
@@ -32,6 +32,7 @@ import clsx from "clsx";
32
32
  import { useForm, FormProvider } from "react-hook-form";
33
33
  import * as z from "zod";
34
34
  import { iconForm, headerContainer, headerForm, form, descriptionField, fullRowForm, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
35
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
35
36
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
36
37
  const ContactCompany = ({
37
38
  icon = false,
@@ -51,7 +52,7 @@ const ContactCompany = ({
51
52
  first_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
52
53
  last_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Last Name is required." }),
53
54
  email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
54
- phone: z.string().regex(/[\d-]{10}/).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
55
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, "Invalid phone number.").min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
55
56
  const removeDashes = val.replace(/-/gi, "");
56
57
  if (removeDashes.length !== 10) {
57
58
  ctx.addIssue({
@@ -60,12 +61,27 @@ const ContactCompany = ({
60
61
  });
61
62
  return z.NEVER;
62
63
  }
64
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
65
+ ctx.addIssue({
66
+ code: z.ZodIssueCode.custom,
67
+ message: "Invalid phone number."
68
+ });
69
+ return z.NEVER;
70
+ }
63
71
  return removeDashes;
64
72
  }),
65
73
  company: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Company is required." }).max(255, { message: "Company can have atmost 255 characters." })
66
74
  });
75
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
76
+ if (!isValidHoneyPot(data)) {
77
+ ctx.addIssue({
78
+ code: z.ZodIssueCode.custom,
79
+ message: "fields are not valid."
80
+ });
81
+ }
82
+ });
67
83
  const methods = useForm({
68
- resolver: zodResolver(schema.merge(SalesforceSchema), {
84
+ resolver: zodResolver(gen_schema, {
69
85
  async: true
70
86
  }),
71
87
  mode: "all",
@@ -174,7 +190,8 @@ const ContactCompany = ({
174
190
  helperText: errors.company?.message,
175
191
  variant
176
192
  }
177
- ) })
193
+ ) }),
194
+ /* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
178
195
  ] }),
179
196
  children,
180
197
  /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
@@ -32,6 +32,7 @@ import clsx from "clsx";
32
32
  import { useForm, FormProvider } from "react-hook-form";
33
33
  import * as z from "zod";
34
34
  import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
35
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
35
36
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
36
37
  const ContactCompanyTitle = ({
37
38
  icon = false,
@@ -51,7 +52,7 @@ const ContactCompanyTitle = ({
51
52
  first_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
52
53
  last_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Last Name is required." }),
53
54
  email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
54
- phone: z.string().regex(/[\d-]{10}/).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
55
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, "Invalid phone number.").min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
55
56
  const removeDashes = val.replace(/-/gi, "");
56
57
  if (removeDashes.length !== 10) {
57
58
  ctx.addIssue({
@@ -60,13 +61,28 @@ const ContactCompanyTitle = ({
60
61
  });
61
62
  return z.NEVER;
62
63
  }
64
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
65
+ ctx.addIssue({
66
+ code: z.ZodIssueCode.custom,
67
+ message: "Invalid phone number."
68
+ });
69
+ return z.NEVER;
70
+ }
63
71
  return removeDashes;
64
72
  }),
65
73
  company: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Company is required." }).max(255, { message: "Company can have at most 255 characters." }),
66
74
  title: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Title is required." }).max(128, { message: "Title can have at most 128 characters." })
67
75
  });
76
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
77
+ if (!isValidHoneyPot(data)) {
78
+ ctx.addIssue({
79
+ code: z.ZodIssueCode.custom,
80
+ message: "fields are not valid."
81
+ });
82
+ }
83
+ });
68
84
  const methods = useForm({
69
- resolver: zodResolver(schema.merge(SalesforceSchema), {
85
+ resolver: zodResolver(gen_schema, {
70
86
  async: true
71
87
  }),
72
88
  mode: "all",
@@ -189,7 +205,8 @@ const ContactCompanyTitle = ({
189
205
  helperText: errors.title?.message,
190
206
  variant
191
207
  }
192
- ) })
208
+ ) }),
209
+ /* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
193
210
  ] }),
194
211
  children,
195
212
  /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
@@ -6,4 +6,4 @@ export type Inputs = {
6
6
  email: string;
7
7
  phone: string;
8
8
  };
9
- export declare const ContactUs: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ContactUs: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
@@ -32,6 +32,7 @@ import clsx from "clsx";
32
32
  import { useForm, FormProvider } from "react-hook-form";
33
33
  import * as z from "zod";
34
34
  import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
35
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
35
36
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
36
37
  const ContactUs = ({
37
38
  icon = false,
@@ -45,13 +46,14 @@ const ContactUs = ({
45
46
  description,
46
47
  callToAction,
47
48
  validateEmail,
49
+ onValidate,
48
50
  id
49
51
  }) => {
50
52
  const schema = z.object({
51
53
  first_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "First Name is required." }),
52
54
  last_name: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g).trim().min(1, { message: "Last Name is required." }),
53
55
  email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
54
- phone: z.string().regex(/[\d-]{10}/).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
56
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, "Invalid phone number.").min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
55
57
  const removeDashes = val.replace(/-/gi, "");
56
58
  if (removeDashes.length !== 10) {
57
59
  ctx.addIssue({
@@ -60,11 +62,26 @@ const ContactUs = ({
60
62
  });
61
63
  return z.NEVER;
62
64
  }
65
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
66
+ ctx.addIssue({
67
+ code: z.ZodIssueCode.custom,
68
+ message: "Invalid phone number."
69
+ });
70
+ return z.NEVER;
71
+ }
63
72
  return removeDashes;
64
73
  })
65
74
  });
75
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
76
+ if (!isValidHoneyPot(data)) {
77
+ ctx.addIssue({
78
+ code: z.ZodIssueCode.custom,
79
+ message: "fields are not valid."
80
+ });
81
+ }
82
+ });
66
83
  const methods = useForm({
67
- resolver: zodResolver(schema.merge(SalesforceSchema), {
84
+ resolver: zodResolver(gen_schema, {
68
85
  async: true
69
86
  }),
70
87
  mode: "all",
@@ -75,7 +92,7 @@ const ContactUs = ({
75
92
  const {
76
93
  handleSubmit,
77
94
  register,
78
- formState: { errors, isValid, isSubmitting }
95
+ formState: { errors }
79
96
  } = methods;
80
97
  const submitForm = async (data) => {
81
98
  await onSubmit(data);
@@ -93,83 +110,94 @@ const ContactUs = ({
93
110
  }
94
111
  )
95
112
  ] }),
96
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
97
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
98
- /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
99
- Input,
100
- {
101
- id: "first_name",
102
- ...register("first_name", { required: true }),
103
- label: "First Name",
104
- sizes: "medium",
105
- placeholder: "First Name",
106
- required: true,
107
- error: !!errors.first_name,
108
- helperText: errors.first_name?.message,
109
- variant
110
- }
111
- ) }),
112
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
113
- Input,
114
- {
115
- id: "last_name",
116
- ...register("last_name", { required: true }),
117
- label: "Last Name",
118
- sizes: "medium",
119
- placeholder: "Last Name",
120
- required: true,
121
- error: !!errors.last_name,
122
- helperText: errors.last_name?.message,
123
- variant
124
- }
125
- ) }),
126
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
127
- Input,
128
- {
129
- id: "email",
130
- ...register("email", {
131
- required: true,
132
- validate: {
133
- isValid: associatedEmail
113
+ /* @__PURE__ */ jsxs(
114
+ "form",
115
+ {
116
+ className: form,
117
+ onSubmit: async (e) => {
118
+ onValidate && onValidate(e);
119
+ await handleSubmit(submitForm)(e);
120
+ e.preventDefault();
121
+ },
122
+ children: [
123
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
124
+ /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
125
+ Input,
126
+ {
127
+ id: "first_name",
128
+ ...register("first_name", { required: true }),
129
+ label: "First Name",
130
+ sizes: "medium",
131
+ placeholder: "First Name",
132
+ required: true,
133
+ error: !!errors.first_name,
134
+ helperText: errors.first_name?.message,
135
+ variant
134
136
  }
135
- }),
136
- label: "Email",
137
- sizes: "medium",
138
- placeholder: "Email",
139
- required: true,
140
- error: !!errors.email,
141
- helperText: errors.email?.message,
142
- variant
143
- }
144
- ) }),
145
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
146
- InputPhone,
147
- {
148
- id: "phone",
149
- ...register("phone", { required: true, maxLength: 12 }),
150
- label: "Phone",
151
- sizes: "medium",
152
- placeholder: "Phone",
153
- required: true,
154
- error: !!errors.phone,
155
- helperText: errors.phone?.message,
156
- variant
157
- }
158
- ) })
159
- ] }),
160
- children,
161
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
162
- /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
163
- Button,
164
- {
165
- color: getVariant(callToAction?.variant),
166
- as: "button",
167
- type: "submit",
168
- disabled: !isValid || isSubmitting,
169
- children: callToAction?.displayText
170
- }
171
- ) })
172
- ] })
137
+ ) }),
138
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
139
+ Input,
140
+ {
141
+ id: "last_name",
142
+ ...register("last_name", { required: true }),
143
+ label: "Last Name",
144
+ sizes: "medium",
145
+ placeholder: "Last Name",
146
+ required: true,
147
+ error: !!errors.last_name,
148
+ helperText: errors.last_name?.message,
149
+ variant
150
+ }
151
+ ) }),
152
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
153
+ Input,
154
+ {
155
+ id: "email",
156
+ ...register("email", {
157
+ required: true,
158
+ validate: {
159
+ isValid: associatedEmail
160
+ }
161
+ }),
162
+ label: "Email",
163
+ sizes: "medium",
164
+ placeholder: "Email",
165
+ required: true,
166
+ error: !!errors.email,
167
+ helperText: errors.email?.message,
168
+ variant
169
+ }
170
+ ) }),
171
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
172
+ InputPhone,
173
+ {
174
+ id: "phone",
175
+ ...register("phone", { required: true, maxLength: 12 }),
176
+ label: "Phone",
177
+ sizes: "medium",
178
+ placeholder: "Phone",
179
+ required: true,
180
+ error: !!errors.phone,
181
+ helperText: errors.phone?.message,
182
+ variant
183
+ }
184
+ ) }),
185
+ /* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
186
+ ] }),
187
+ children,
188
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
189
+ /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
190
+ Button,
191
+ {
192
+ color: getVariant(callToAction?.variant),
193
+ as: "button",
194
+ type: "submit",
195
+ children: callToAction?.displayText
196
+ }
197
+ ) })
198
+ ]
199
+ }
200
+ )
173
201
  ] }) }) }, id);
174
202
  };
175
203
  export {
@@ -33,6 +33,7 @@ import { useForm, FormProvider } from "react-hook-form";
33
33
  import { z } from "zod";
34
34
  import { Roles } from "./FormEnums.js";
35
35
  import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
36
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
36
37
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
37
38
  const ContactUsAAS = ({
38
39
  icon = false,
@@ -56,9 +57,7 @@ const ContactUsAAS = ({
56
57
  message: "Invalid last name"
57
58
  }).trim().min(1, { message: "Last Name is required." }),
58
59
  email: z.string({ message: "Email is required." }).email({ message: "Email is required." }).refine(async (val) => await validateEmail(val)),
59
- phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, {
60
- message: "Invalid phone number"
61
- }).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
60
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, "Invalid phone number.").min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
62
61
  const removeDashes = val.replace(/-/gi, "");
63
62
  if (removeDashes.length !== 10) {
64
63
  ctx.addIssue({
@@ -67,6 +66,13 @@ const ContactUsAAS = ({
67
66
  });
68
67
  return z.NEVER;
69
68
  }
69
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
70
+ ctx.addIssue({
71
+ code: z.ZodIssueCode.custom,
72
+ message: "Invalid phone number."
73
+ });
74
+ return z.NEVER;
75
+ }
70
76
  return removeDashes;
71
77
  }),
72
78
  company: z.string().regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
@@ -76,9 +82,17 @@ const ContactUsAAS = ({
76
82
  Role__c: z.string().min(1, { message: "Role is required." }).refine((val) => Roles.includes(val), "Role is required"),
77
83
  description: z.optional(z.string().trim().max(32e3))
78
84
  });
85
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
86
+ if (!isValidHoneyPot(data)) {
87
+ ctx.addIssue({
88
+ code: z.ZodIssueCode.custom,
89
+ message: "fields are not valid."
90
+ });
91
+ }
92
+ });
79
93
  const methods = useForm({
80
94
  resolver: zodResolver(
81
- schema.merge(SalesforceSchema),
95
+ gen_schema,
82
96
  {
83
97
  async: true
84
98
  },
@@ -247,7 +261,8 @@ const ContactUsAAS = ({
247
261
  variant,
248
262
  rows: 1
249
263
  }
250
- ) })
264
+ ) }),
265
+ /* @__PURE__ */ jsx(HoneyPot, { register, errors, variant })
251
266
  ] }),
252
267
  children,
253
268
  /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
@@ -3,9 +3,9 @@ import { FormProps } from './FormProps';
3
3
  export type ContactUsBusinessNmlsIdInputs = {
4
4
  first_name: string;
5
5
  last_name: string;
6
- Business_Name__c: string;
6
+ Company: string;
7
7
  email: string;
8
8
  phone: string;
9
- NMLS_ID__c: string;
9
+ Company_NMLS_ID__c: string;
10
10
  };
11
11
  export declare const ContactUsBusiness: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;