@axos-web-dev/shared-components 2.2.27 → 2.2.29

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 (59) 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 +76 -4
  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/Chatbot.css.js +1 -0
  10. package/dist/Chevron/index.js +1 -1
  11. package/dist/Comparison/Comparison.js +1 -1
  12. package/dist/ExecutiveBio/ExecutiveBio.js +1 -1
  13. package/dist/FaqAccordion/index.js +1 -1
  14. package/dist/FdicCallout/index.js +1 -1
  15. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +10 -1
  16. package/dist/Forms/ApplyNow.js +1 -1
  17. package/dist/Forms/CommercialTrustAndEstate.d.ts +15 -0
  18. package/dist/Forms/CommercialTrustAndEstate.js +237 -0
  19. package/dist/Forms/ContactUsBusiness.js +1 -1
  20. package/dist/Forms/ContactUsBusinessNameEmail.js +1 -1
  21. package/dist/Forms/ContactUsNMLSId.js +1 -1
  22. package/dist/Forms/ContactUsSchwabAAS.js +43 -26
  23. package/dist/Forms/CpraRequest.js +1 -1
  24. package/dist/Forms/CraPublicFile.js +1 -1
  25. package/dist/Forms/EmailOnly.js +1 -1
  26. package/dist/Forms/Forms.css.d.ts +1 -0
  27. package/dist/Forms/Forms.css.js +3 -1
  28. package/dist/Forms/MortgageRate/MortgageRateForm.js +1 -1
  29. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -1
  30. package/dist/Forms/MortgageWarehouseLending.js +1 -1
  31. package/dist/Forms/SuccesForm.js +1 -1
  32. package/dist/Forms/index.d.ts +1 -0
  33. package/dist/Forms/index.js +4 -1
  34. package/dist/Hyperlink/index.js +1 -1
  35. package/dist/ImageLink/ImageLink.js +1 -1
  36. package/dist/ImageLink/ImageLinkSet.js +1 -1
  37. package/dist/ImageLink/index.js +1 -1
  38. package/dist/ImageToast/index.js +1 -1
  39. package/dist/Insight/Featured/CategorySelector.js +1 -1
  40. package/dist/Insight/Featured/Featured.js +1 -1
  41. package/dist/Insight/Featured/Header.js +1 -1
  42. package/dist/LandingPageHeader/WithLogin.js +1 -1
  43. package/dist/Modal/Modal.js +1 -1
  44. package/dist/NavigationMenu/AxosALTS/index.js +1 -1
  45. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.js +1 -1
  46. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.d.ts +1 -0
  47. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +3 -0
  48. package/dist/NavigationMenu/AxosBank/SubNavBar.js +10 -1
  49. package/dist/NavigationMenu/AxosBank/index.js +1 -1
  50. package/dist/NavigationMenu/LaVictoire/index.js +1 -1
  51. package/dist/NavigationMenu/Navbar.js +1 -1
  52. package/dist/NavigationMenu/SignInNavButton.js +1 -1
  53. package/dist/SetContainer/SetContainer.js +1 -1
  54. package/dist/SocialMediaBar/iconsRepository.js +1 -1
  55. package/dist/VideoTile/VideoTile.js +1 -1
  56. package/dist/VideoWrapper/index.js +1 -1
  57. package/dist/assets/Forms/Forms.css +6 -1
  58. package/dist/main.js +4 -1
  59. package/package.json +1 -1
@@ -74,10 +74,10 @@ import "../Calculators/MonthlyPaymentCalculator/MonthlyPaymentCalculator.css.js"
74
74
  /* empty css */
75
75
  import "../Carousel/index.js";
76
76
  /* empty css */
77
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
78
77
  /* empty css */
79
78
  import "../Chatbot/store/chat.js";
80
79
  import "../Chatbot/Chatbot.js";
80
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
81
81
  /* empty css */
82
82
  import "../Chatbot/store/messages.js";
83
83
  /* empty css */
@@ -70,10 +70,10 @@ import "./SignInPassword.js";
70
70
  /* empty css */
71
71
  import "../Carousel/index.js";
72
72
  /* empty css */
73
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
74
73
  /* empty css */
75
74
  import "../Chatbot/store/chat.js";
76
75
  import "../Chatbot/Chatbot.js";
76
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
77
77
  import "../LoadingIndicator/LoadingIndicator.css.js";
78
78
  /* empty css */
79
79
  import "../Chatbot/store/messages.js";
@@ -79,10 +79,10 @@ import "../Auth/SignInPassword.js";
79
79
  /* empty css */
80
80
  import "../Carousel/index.js";
81
81
  /* empty css */
82
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
83
82
  /* empty css */
84
83
  import "../Chatbot/store/chat.js";
85
84
  import "../Chatbot/Chatbot.js";
85
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
86
86
  /* empty css */
87
87
  import "../Chatbot/store/messages.js";
88
88
  /* empty css */
@@ -24,6 +24,10 @@ const CALCULATOR_DEFINITIONS = [
24
24
  term: "APY (Annual Percentage Yield)",
25
25
  description: "The rate your money earns in a year, with compounding included."
26
26
  },
27
+ {
28
+ term: "APR (Annual Percentage Rate)",
29
+ description: "The rate your money earns in a year, without compounding."
30
+ },
27
31
  {
28
32
  term: "Months",
29
33
  description: "How long you plan to keep your money in the account."
@@ -143,6 +147,14 @@ const ApyCalculator = ({
143
147
  },
144
148
  [compounding]
145
149
  );
150
+ const getAPY = useCallback(
151
+ (apr) => {
152
+ return Number.parseFloat(
153
+ (((1 + apr / 100 / compounding) ** compounding - 1) * 100).toFixed(2)
154
+ );
155
+ },
156
+ [compounding]
157
+ );
146
158
  const AXOS_ONE_APY = Number(domains.AXOS_ONE_APY) || 4.21;
147
159
  const [initialDeposit, setInitialDeposit] = useState(1e4);
148
160
  const [initialDepositDisplay, setInitialDepositDisplay] = useState(
@@ -150,6 +162,8 @@ const ApyCalculator = ({
150
162
  );
151
163
  const [APY, setAPY] = useState(AXOS_ONE_APY);
152
164
  const [APYDisplay, setAPYDisplay] = useState(APY.toString());
165
+ const [APR, setAPR] = useState(() => getAPR(AXOS_ONE_APY));
166
+ const [APRDisplay, setAPRDisplay] = useState(APR.toString());
153
167
  const [months, setMonths] = useState(12);
154
168
  const [monthsDisplay, setMonthsDisplay] = useState(months.toString());
155
169
  const [monthlyDeposits, setMonthlyDeposits] = useState(100);
@@ -182,10 +196,29 @@ const ApyCalculator = ({
182
196
  };
183
197
  const handleAPYChange = (e) => {
184
198
  const raw = e.target.value;
185
- const num = parseFloat(raw.replace(/[^0-9.]/g, ""));
199
+ const cleaned = raw.replace(/[^0-9.]/g, "");
200
+ const num = parseFloat(cleaned);
186
201
  setAPY(num);
187
- setAPYDisplay(raw.replace(/[^0-9.]/g, ""));
202
+ setAPYDisplay(cleaned);
203
+ const newAPR = Number.isNaN(num) ? NaN : getAPR(num);
204
+ setAPR(newAPR);
205
+ setAPRDisplay(Number.isNaN(newAPR) ? "" : newAPR.toString());
188
206
  };
207
+ const handleAPRChange = (e) => {
208
+ const raw = e.target.value;
209
+ const cleaned = raw.replace(/[^0-9.]/g, "");
210
+ const num = parseFloat(cleaned);
211
+ setAPR(num);
212
+ setAPRDisplay(cleaned);
213
+ const newAPY = Number.isNaN(num) ? NaN : getAPY(num);
214
+ setAPY(newAPY);
215
+ setAPYDisplay(Number.isNaN(newAPY) ? "" : newAPY.toString());
216
+ };
217
+ useEffect(() => {
218
+ const newAPR = Number.isNaN(APY) ? NaN : getAPR(APY);
219
+ setAPR(newAPR);
220
+ setAPRDisplay(Number.isNaN(newAPR) ? "" : newAPR.toString());
221
+ }, [compounding]);
189
222
  const [endingBalanceRaw, setEndingBalanceRaw] = useState(0);
190
223
  const [totalDepositsRaw, setTotalDepositsRaw] = useState(0);
191
224
  const [interestEarnedRaw, setInterestEarnedRaw] = useState(0);
@@ -215,9 +248,11 @@ const ApyCalculator = ({
215
248
  if (!APY || APY <= 0 || Number.isNaN(APY)) {
216
249
  newErrors.APY = "Please enter a valid APY greater than 0.";
217
250
  }
251
+ if (!APR || APR <= 0 || Number.isNaN(APR)) {
252
+ newErrors.APR = "Please enter a valid APR greater than 0.";
253
+ }
218
254
  setFieldErrors(newErrors);
219
255
  if (Object.keys(newErrors).length > 0) return false;
220
- const APR = getAPR(APY);
221
256
  const interestRate = 0.01 * APR;
222
257
  let total;
223
258
  if (compounding === 360) {
@@ -243,7 +278,7 @@ const ApyCalculator = ({
243
278
  setTotalDepositsRaw(deposits);
244
279
  setInterestEarnedRaw(interest > 0 ? interest : 0);
245
280
  return true;
246
- }, [initialDeposit, APY, months, monthlyDeposits, compounding, getAPR]);
281
+ }, [initialDeposit, APY, APR, months, monthlyDeposits, compounding]);
247
282
  const handleCalculateClick = useCallback(() => {
248
283
  const didCalculate = calculate();
249
284
  if (!didCalculate || !isStackedLayout) return;
@@ -347,6 +382,43 @@ const ApyCalculator = ({
347
382
  }
348
383
  )
349
384
  ] }),
385
+ /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
386
+ /* @__PURE__ */ jsx(Label, { className: field_label, children: "APR (Annual Percentage Rate)" }),
387
+ /* @__PURE__ */ jsx(
388
+ "span",
389
+ {
390
+ className: `${label_symbol} ${percent}`,
391
+ "aria-hidden": "true",
392
+ children: "%"
393
+ }
394
+ ),
395
+ /* @__PURE__ */ jsx(
396
+ Input,
397
+ {
398
+ className: `${field_row_input} ${fieldErrors.APR ? ` ${field_row_input_error}` : ""}`,
399
+ id: "apr",
400
+ type: "text",
401
+ inputMode: "decimal",
402
+ pattern: "[0-9.]*",
403
+ name: "apr",
404
+ value: APRDisplay,
405
+ onChange: handleAPRChange,
406
+ onWheel: (e) => e.currentTarget.blur(),
407
+ "aria-invalid": !!fieldErrors.APR,
408
+ "aria-describedby": fieldErrors.APR ? "apr-error" : void 0
409
+ }
410
+ ),
411
+ fieldErrors.APR && /* @__PURE__ */ jsx(
412
+ Description,
413
+ {
414
+ as: "span",
415
+ id: "apr-error",
416
+ className: field_error,
417
+ role: "alert",
418
+ children: fieldErrors.APR
419
+ }
420
+ )
421
+ ] }),
350
422
  /* @__PURE__ */ jsxs(Field, { className: `${field_row} ${relative} flex flex_col`, children: [
351
423
  /* @__PURE__ */ jsx(Label, { className: field_label, children: "Months" }),
352
424
  /* @__PURE__ */ jsx(
@@ -51,10 +51,10 @@ import { SummitApyCalculator } from "./SummitApyCalculator/index.js";
51
51
  /* empty css */
52
52
  import "../Carousel/index.js";
53
53
  /* empty css */
54
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
55
54
  /* empty css */
56
55
  import "../Chatbot/store/chat.js";
57
56
  import "../Chatbot/Chatbot.js";
57
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
58
58
  import "../LoadingIndicator/LoadingIndicator.css.js";
59
59
  import "react-use";
60
60
  /* empty css */
@@ -79,10 +79,10 @@ import "../../Auth/SignInPassword.js";
79
79
  /* empty css */
80
80
  import "../../Carousel/index.js";
81
81
  /* empty css */
82
- import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
83
82
  /* empty css */
84
83
  import "../../Chatbot/store/chat.js";
85
84
  import "../../Chatbot/Chatbot.js";
85
+ import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
86
86
  /* empty css */
87
87
  import "../../Chatbot/store/messages.js";
88
88
  /* empty css */
@@ -80,10 +80,10 @@ import "../Auth/SignInPassword.js";
80
80
  /* empty css */
81
81
  /* empty css */
82
82
  /* empty css */
83
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
84
83
  /* empty css */
85
84
  import "../Chatbot/store/chat.js";
86
85
  import "../Chatbot/Chatbot.js";
86
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
87
  /* empty css */
88
88
  import "../Chatbot/store/messages.js";
89
89
  /* empty css */
@@ -2,7 +2,6 @@ import '../assets/Chatbot/Bubble.css';import '../assets/themes/victorie.css';imp
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
- import "./Chatbot.css.ts.vanilla.css.js";
6
5
  /* empty css */
7
6
  var borderHoverGradient = "_7u9pv31";
8
7
  var bubbleWrapper = "_7u9pv32";
@@ -1,3 +1,4 @@
1
+ import "./Chatbot.css.ts.vanilla.css.js";
1
2
  var chatbotAXB = "_1hpv6vm0";
2
3
  var chatbotUFB = "_1hpv6vm1";
3
4
  export {
@@ -80,10 +80,10 @@ import "../Auth/SignInPassword.js";
80
80
  /* empty css */
81
81
  import "../Carousel/index.js";
82
82
  /* empty css */
83
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
84
83
  /* empty css */
85
84
  import "../Chatbot/store/chat.js";
86
85
  import "../Chatbot/Chatbot.js";
86
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
87
  /* empty css */
88
88
  import "../Chatbot/store/messages.js";
89
89
  /* empty css */
@@ -80,10 +80,10 @@ import "../Auth/SignInPassword.js";
80
80
  /* empty css */
81
81
  import "../Carousel/index.js";
82
82
  /* empty css */
83
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
84
83
  /* empty css */
85
84
  import "../Chatbot/store/chat.js";
86
85
  import "../Chatbot/Chatbot.js";
86
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
87
87
  /* empty css */
88
88
  import "../Chatbot/store/messages.js";
89
89
  /* empty css */
@@ -81,10 +81,10 @@ import "../Auth/SignInPassword.js";
81
81
  /* empty css */
82
82
  import "../Carousel/index.js";
83
83
  /* empty css */
84
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
85
84
  /* empty css */
86
85
  import "../Chatbot/store/chat.js";
87
86
  import "../Chatbot/Chatbot.js";
87
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
88
88
  /* empty css */
89
89
  import "../Chatbot/store/messages.js";
90
90
  /* empty css */
@@ -81,10 +81,10 @@ import "../Auth/SignInPassword.js";
81
81
  /* empty css */
82
82
  import "../Carousel/index.js";
83
83
  /* empty css */
84
- import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
85
84
  /* empty css */
86
85
  import "../Chatbot/store/chat.js";
87
86
  import "../Chatbot/Chatbot.js";
87
+ import "../Chatbot/Chatbot.css.ts.vanilla.css.js";
88
88
  /* empty css */
89
89
  import "../Chatbot/store/messages.js";
90
90
  /* 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, "aria-label": "FDIC Notice banner", 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, 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",
@@ -77,10 +77,10 @@ import "../../Auth/SignInPassword.js";
77
77
  /* empty css */
78
78
  import "../../Carousel/index.js";
79
79
  /* empty css */
80
- import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
81
80
  /* empty css */
82
81
  import "../../Chatbot/store/chat.js";
83
82
  import "../../Chatbot/Chatbot.js";
83
+ import "../../Chatbot/Chatbot.css.ts.vanilla.css.js";
84
84
  /* empty css */
85
85
  import "../../Chatbot/store/messages.js";
86
86
  /* empty css */
@@ -388,6 +388,15 @@ const AxosFooterSiteMap = ({
388
388
  ),
389
389
  children: "Technology and Life Sciences Banking"
390
390
  }
391
+ ) }),
392
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
393
+ "a",
394
+ {
395
+ href: resolveUrl(
396
+ "{AXOSBANK}/commercial/banking/trust-and-estate"
397
+ ),
398
+ children: "Trust & Estate"
399
+ }
391
400
  ) })
392
401
  ] })
393
402
  ] })
@@ -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 */
@@ -0,0 +1,15 @@
1
+ import { FormProps } from './FormProps';
2
+
3
+ export type CommercialTrustAndEstateInputs = {
4
+ first_name: string;
5
+ last_name: string;
6
+ title: string;
7
+ email: string;
8
+ phone: string;
9
+ };
10
+ export interface CommercialTrustAndEstateProps extends Omit<FormProps, "onSubmit"> {
11
+ onSubmit?: (values: {
12
+ [index: string]: string | boolean | number | Date | any;
13
+ }) => Promise<boolean | void> | boolean | void;
14
+ }
15
+ export declare const CommercialTrustAndEstate: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: CommercialTrustAndEstateProps) => import("react").JSX.Element;
@@ -0,0 +1,237 @@
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 { useState } from "react";
7
+ import "react-use";
8
+ import "../Input/Checkbox.js";
9
+ import "../Input/CurrencyInput.js";
10
+ import "../Input/Dropdown.js";
11
+ import "../Input/Dropdown.css.js";
12
+ import { Input } from "../Input/Input.js";
13
+ import "../Input/Input.css.js";
14
+ import "../Input/InputAmount.js";
15
+ import { InputPhone } from "../Input/InputPhone.js";
16
+ import "../Input/InputTextArea.js";
17
+ import "../Input/DownPaymentInput.js";
18
+ import "../Input/RadioButton.js";
19
+ import "../icons/ArrowIcon/ArrowIcon.css.js";
20
+ import SvgAxosX from "../icons/AxosX/index.js";
21
+ import SvgComponent from "../icons/AxosX/Blue.js";
22
+ import "../icons/CheckIcon/CheckIcon.css.js";
23
+ import '../assets/icons/FollowIcon/FollowIcon.css';import '../assets/icons/DownloadIcon/DownloadIcon.css';import '../assets/themes/victorie.css';import '../assets/themes/ufb.css';import '../assets/themes/premier.css';import '../assets/themes/axos.css';/* empty css */
24
+ /* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
+ import * as z from "zod";
30
+ import { associatedEmail } from "../utils/EverestValidity.js";
31
+ import { getVariant } from "../utils/getVariant.js";
32
+ import { useCachedEmailValidator } from "../utils/useCachedValidators.js";
33
+ import clsx from "clsx";
34
+ import { useForm, FormProvider } from "react-hook-form";
35
+ import { iconForm, headerForm, form, descriptionField, headerContainer, formWrapper, disclosureForm, submitErrorText, actions, formContainer } from "./Forms.css.js";
36
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
37
+ import { SalesforceSchema } from "./SalesforceFieldsForm.js";
38
+ const CommercialTrustAndEstate = ({
39
+ icon = false,
40
+ children,
41
+ onSubmit = (values) => {
42
+ console.log(values);
43
+ },
44
+ disclosure,
45
+ variant: fullVariant = "primary",
46
+ headline,
47
+ description,
48
+ callToAction,
49
+ validateEmail,
50
+ onValidate,
51
+ id
52
+ }) => {
53
+ const cachedEmailValidator = useCachedEmailValidator(validateEmail);
54
+ const [submitError, setSubmitError] = useState(false);
55
+ const schema = z.object({
56
+ first_name: z.string({ message: "First Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
57
+ message: "First Name is required."
58
+ }).trim().min(1, { message: "First Name is required." }),
59
+ last_name: z.string({ message: "Last Name is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
60
+ message: "Last Name is required."
61
+ }).trim().min(1, { message: "Last Name is required." }),
62
+ title: z.string({ message: "Title is required." }).regex(/^[A-Za-z][^0-9_!¡?÷?¿/\\+=@#$%ˆ&*,.^(){}|~<>;:[\]]{1,}$/g, {
63
+ message: "Invalid title."
64
+ }).trim().min(1, { message: "Title is required." }).max(128, { message: "Title can have at most 128 characters." }),
65
+ email: z.string().email({ message: "Email is required." }).refine(cachedEmailValidator, { message: "Invalid email address." }),
66
+ phone: z.string({ message: "Phone is required." }).regex(/[\d-]{10}/, { message: "Phone is required." }).min(10, { message: "Phone is required." }).max(12, { message: "Phone is required." }).transform((val, ctx) => {
67
+ const removeDashes = val.replace(/-/gi, "");
68
+ if (removeDashes.length !== 10) {
69
+ ctx.addIssue({
70
+ code: z.ZodIssueCode.custom,
71
+ message: "Phone must have at least 10 and no more than 10 characters."
72
+ });
73
+ return z.NEVER;
74
+ }
75
+ if (removeDashes.endsWith("00000") || removeDashes.startsWith("999") || removeDashes.length === 10 && /^[01]/.test(removeDashes)) {
76
+ ctx.addIssue({
77
+ code: z.ZodIssueCode.custom,
78
+ message: "Invalid phone number."
79
+ });
80
+ return z.NEVER;
81
+ }
82
+ return removeDashes;
83
+ })
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
+ });
93
+ const methods = useForm({
94
+ resolver: zodResolver(gen_schema),
95
+ mode: "all"
96
+ });
97
+ const {
98
+ handleSubmit,
99
+ register,
100
+ formState: { errors, isValid, isSubmitting }
101
+ } = methods;
102
+ const submitForm = async (data) => {
103
+ setSubmitError(false);
104
+ const result = await onSubmit(data);
105
+ if (result === false) {
106
+ setSubmitError(true);
107
+ }
108
+ };
109
+ const variant = getVariant(fullVariant);
110
+ return /* @__PURE__ */ jsx(
111
+ "section",
112
+ {
113
+ id: `id_${id}`,
114
+ className: clsx(formContainer({ variant })),
115
+ children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
116
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
117
+ /* @__PURE__ */ jsxs("div", { className: clsx(headerContainer, "text_center"), children: [
118
+ /* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
119
+ description && /* @__PURE__ */ jsx(
120
+ "div",
121
+ {
122
+ className: clsx(
123
+ form,
124
+ descriptionField({ variant }),
125
+ "text_center"
126
+ ),
127
+ children: description
128
+ }
129
+ )
130
+ ] }),
131
+ /* @__PURE__ */ jsxs(
132
+ "form",
133
+ {
134
+ className: form,
135
+ onSubmit: async (e) => {
136
+ onValidate && onValidate(e);
137
+ await handleSubmit(submitForm)(e);
138
+ e.preventDefault();
139
+ },
140
+ children: [
141
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
142
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
143
+ Input,
144
+ {
145
+ id: "first_name",
146
+ ...register("first_name", { required: true }),
147
+ label: "First Name",
148
+ sizes: "medium",
149
+ required: true,
150
+ error: !!errors.first_name,
151
+ helperText: errors.first_name?.message,
152
+ variant
153
+ }
154
+ ) }),
155
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
156
+ Input,
157
+ {
158
+ id: "last_name",
159
+ ...register("last_name", { required: true }),
160
+ label: "Last Name",
161
+ sizes: "medium",
162
+ required: true,
163
+ error: !!errors.last_name,
164
+ helperText: errors.last_name?.message,
165
+ variant
166
+ }
167
+ ) }),
168
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
169
+ Input,
170
+ {
171
+ id: "title",
172
+ ...register("title", { required: true }),
173
+ label: "Title",
174
+ sizes: "medium",
175
+ required: true,
176
+ error: !!errors.title,
177
+ helperText: errors.title?.message,
178
+ variant
179
+ }
180
+ ) }),
181
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
182
+ Input,
183
+ {
184
+ id: "email",
185
+ ...register("email", {
186
+ required: true,
187
+ validate: {
188
+ isValid: associatedEmail
189
+ }
190
+ }),
191
+ label: "Email",
192
+ sizes: "medium",
193
+ required: true,
194
+ error: !!errors.email,
195
+ helperText: errors.email?.message,
196
+ variant
197
+ }
198
+ ) }),
199
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
200
+ InputPhone,
201
+ {
202
+ id: "phone",
203
+ ...register("phone", { required: true, maxLength: 12 }),
204
+ label: "Phone",
205
+ sizes: "medium",
206
+ required: true,
207
+ error: !!errors.phone,
208
+ helperText: errors.phone?.message,
209
+ variant
210
+ }
211
+ ) }),
212
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
213
+ ] }),
214
+ children,
215
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
216
+ submitError && /* @__PURE__ */ jsx("div", { className: submitErrorText, role: "alert", children: "Something went wrong submitting your request. Please try again." }),
217
+ /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
218
+ Button,
219
+ {
220
+ color: getVariant(callToAction?.variant),
221
+ as: "button",
222
+ type: "submit",
223
+ disabled: !isValid || isSubmitting,
224
+ children: callToAction?.displayText
225
+ }
226
+ ) })
227
+ ]
228
+ }
229
+ )
230
+ ] }) })
231
+ },
232
+ id
233
+ );
234
+ };
235
+ export {
236
+ CommercialTrustAndEstate
237
+ };
@@ -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 */