@axos-web-dev/shared-components 1.0.68 → 1.0.70

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.
@@ -0,0 +1,10 @@
1
+ import { FormProps } from './FormProps';
2
+
3
+ export type CommercialPremiumFinanceInputs = {
4
+ first_name: string;
5
+ last_name: string;
6
+ email: string;
7
+ Insurance_Company__c: string;
8
+ Type_of_Policy__c: string;
9
+ };
10
+ export declare const CommercialPremiumFinance: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, validateEmail, description, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,201 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { z } from "zod";
4
+ import { useForm, FormProvider } from "react-hook-form";
5
+ import { zodResolver } from "@hookform/resolvers/zod";
6
+ import "../utils/allowedAxosDomains.js";
7
+ import { associatedEmail } from "../utils/EverestValidity.js";
8
+ import { getVariant } from "../utils/getVariant.js";
9
+ import { formContainer, iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions } from "./Forms.css.js";
10
+ import clsx from "clsx";
11
+ import "../icons/ArrowIcon/ArrowIcon.css.js";
12
+ import SvgAxosX from "../icons/AxosX/index.js";
13
+ import SvgComponent from "../icons/AxosX/Blue.js";
14
+ import "../icons/CheckIcon/CheckIcon.css.js";
15
+ /* empty css */
16
+ /* empty css */
17
+ /* empty css */
18
+ /* empty css */
19
+ /* empty css */
20
+ import "../Input/Checkbox.js";
21
+ import "../Input/CurrencyInput.js";
22
+ import { Dropdown } from "../Input/Dropdown.js";
23
+ import "../Input/Dropdown.css.js";
24
+ import { Input } from "../Input/Input.js";
25
+ import "../Input/Input.css.js";
26
+ import "../Input/InputAmount.js";
27
+ import "../Input/InputPhone.js";
28
+ import "../Input/InputTextArea.js";
29
+ import "../Input/DownPaymentInput.js";
30
+ import "../Input/RadioButton.js";
31
+ import { LoadingIndicator } from "../LoadingIndicator/index.js";
32
+ import { Button } from "../Button/Button.js";
33
+ import "../Button/Button.css.js";
34
+ import "react";
35
+ import "react-use";
36
+ const CommercialPremiumFinance = ({
37
+ icon = false,
38
+ children,
39
+ onSubmit = (values) => {
40
+ console.log(values);
41
+ },
42
+ disclosure,
43
+ variant: fullVariant = "primary",
44
+ headline,
45
+ callToAction,
46
+ validateEmail,
47
+ description,
48
+ id
49
+ }) => {
50
+ const schema = z.object({
51
+ first_name: z.string({
52
+ required_error: "First name is required",
53
+ invalid_type_error: "Invalid first name"
54
+ }).regex(/^[a-zA-Z]*(?:[a-zA-Z][a-zA-Z'-]*\s{0,1}){2,}$/g, {
55
+ message: "Invalid first name"
56
+ }).trim().min(1, { message: "First Name is required." }),
57
+ last_name: z.string({
58
+ required_error: "Last name is required",
59
+ invalid_type_error: "Invalid last name"
60
+ }).regex(/^[a-zA-Z]*(?:[a-zA-Z][a-zA-Z'-]*\s{0,1}){2,}$/g, {
61
+ message: "Invalid last name"
62
+ }).trim().min(1, { message: "Last Name is required." }),
63
+ email: z.string().email({ message: "Invalid email address" }).refine(async (val) => await validateEmail(val), {
64
+ message: "Invalid email address"
65
+ }),
66
+ Insurance_Company__c: z.string(),
67
+ Type_of_Policy__c: z.string()
68
+ });
69
+ const methods = useForm({
70
+ resolver: zodResolver(schema, {
71
+ async: true
72
+ }),
73
+ mode: "onBlur",
74
+ defaultValues: {
75
+ email: ""
76
+ }
77
+ });
78
+ const {
79
+ handleSubmit,
80
+ register,
81
+ formState: { errors, isValid, isSubmitting }
82
+ } = methods;
83
+ const submitForm = async (data) => {
84
+ await onSubmit(data);
85
+ };
86
+ const variant = getVariant(fullVariant);
87
+ return /* @__PURE__ */ jsx("section", { id, className: clsx(formContainer({ variant })), children: /* @__PURE__ */ jsx("div", { className: clsx("containment"), children: /* @__PURE__ */ jsxs(FormProvider, { ...methods, children: [
88
+ icon && /* @__PURE__ */ jsx("div", { className: clsx("text_center", iconForm), children: ["primary", "secondary"].includes(variant) ? /* @__PURE__ */ jsx(SvgComponent, {}) : /* @__PURE__ */ jsx(SvgAxosX, {}) }),
89
+ /* @__PURE__ */ jsxs("div", { className: `${headerContainer} text_center`, children: [
90
+ /* @__PURE__ */ jsx("h2", { className: clsx("header_2", headerForm({ variant })), children: headline }),
91
+ description && /* @__PURE__ */ jsx(
92
+ "div",
93
+ {
94
+ className: clsx(
95
+ "text_center",
96
+ form,
97
+ descriptionField({ variant })
98
+ ),
99
+ children: description
100
+ }
101
+ )
102
+ ] }),
103
+ /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
104
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
105
+ /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
106
+ Input,
107
+ {
108
+ id: "first_name",
109
+ ...register("first_name", { required: true }),
110
+ label: "First Name",
111
+ sizes: "medium",
112
+ required: true,
113
+ error: !!errors.first_name,
114
+ helperText: errors.first_name?.message,
115
+ variant
116
+ }
117
+ ) }),
118
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
119
+ Input,
120
+ {
121
+ id: "last_name",
122
+ ...register("last_name", { required: true }),
123
+ label: "Last Name",
124
+ sizes: "medium",
125
+ required: true,
126
+ error: !!errors.last_name,
127
+ helperText: errors.last_name?.message,
128
+ variant
129
+ }
130
+ ) }),
131
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
132
+ Input,
133
+ {
134
+ id: "email",
135
+ ...register("email", {
136
+ required: true,
137
+ validate: {
138
+ isValid: associatedEmail
139
+ }
140
+ }),
141
+ label: "Email",
142
+ sizes: "medium",
143
+ required: true,
144
+ error: !!errors.email,
145
+ helperText: errors.email?.message,
146
+ variant
147
+ }
148
+ ) }),
149
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
150
+ Input,
151
+ {
152
+ id: "Insurance_Company__c",
153
+ ...register("Insurance_Company__c", {}),
154
+ label: "Insurance Company",
155
+ sizes: "medium",
156
+ error: !!errors.Insurance_Company__c,
157
+ helperText: errors.Insurance_Company__c?.message,
158
+ variant
159
+ }
160
+ ) }),
161
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
162
+ Dropdown,
163
+ {
164
+ id: "Type_of_Policy__c",
165
+ ...register("Type_of_Policy__c", {}),
166
+ label: "Type of Policy",
167
+ sizes: "medium",
168
+ variant,
169
+ defaultValue: "",
170
+ children: [
171
+ /* @__PURE__ */ jsx("option", { value: "" }),
172
+ /* @__PURE__ */ jsx("option", { value: "Whole life", children: "Whole life" }),
173
+ /* @__PURE__ */ jsx("option", { value: "Index Universal Life", children: "Index Universal Life" })
174
+ ]
175
+ }
176
+ ) })
177
+ ] }),
178
+ children,
179
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
180
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
181
+ LoadingIndicator,
182
+ {
183
+ style: { marginInline: "auto" },
184
+ variant
185
+ }
186
+ ) : /* @__PURE__ */ jsx(
187
+ Button,
188
+ {
189
+ color: getVariant(callToAction?.variant),
190
+ as: "button",
191
+ type: "submit",
192
+ disabled: !isValid || isSubmitting,
193
+ children: callToAction?.displayText
194
+ }
195
+ ) })
196
+ ] })
197
+ ] }) }) }, id);
198
+ };
199
+ export {
200
+ CommercialPremiumFinance
201
+ };
@@ -28,3 +28,4 @@ export * from './ScheduleCallPremier';
28
28
  export * from './SuccesForm';
29
29
  export * from './VendorQuestionnaire';
30
30
  export * from './WcplSurvey';
31
+ export * from './CommercialPremiumFinance';
@@ -34,12 +34,14 @@ import { ScheduleCallPremier } from "./ScheduleCallPremier.js";
34
34
  import { SuccesFormWrapper } from "./SuccesForm.js";
35
35
  import { VendorQuestionnaire } from "./VendorQuestionnaire.js";
36
36
  import { WCPLSurvey } from "./WcplSurvey.js";
37
+ import { CommercialPremiumFinance } from "./CommercialPremiumFinance.js";
37
38
  export {
38
39
  ApplicationStart,
39
40
  ApplyNow,
40
41
  ClearingForm,
41
42
  CommercialDeposits,
42
43
  CommercialLending,
44
+ CommercialPremiumFinance,
43
45
  ContactCompany,
44
46
  ContactCompanyTitle,
45
47
  ContactUs,
@@ -185,6 +185,7 @@ export declare const menuData: {
185
185
  "Small Balance Commercial Real Estate": string;
186
186
  "Leveraged Finance": string;
187
187
  "Marine Dealer Floorplan Finance": string;
188
+ "Premium Finance": string;
188
189
  };
189
190
  "Other Resources": {
190
191
  "Business Support": string;
@@ -497,7 +497,10 @@ const menuData = {
497
497
  "Leveraged Finance": findMoreAxosDomains(
498
498
  "{AXOSBANK}/commercial/lending/leveraged-finance"
499
499
  ),
500
- "Marine Dealer Floorplan Finance": "https://lavictoirefinance.com/dealers"
500
+ "Marine Dealer Floorplan Finance": "https://lavictoirefinance.com/dealers",
501
+ "Premium Finance": findMoreAxosDomains(
502
+ "{AXOSBANK}/commercial/lending/premium-finance"
503
+ )
501
504
  },
502
505
  "Other Resources": {
503
506
  "Business Support": findMoreAxosDomains("{AXOSBANK}/business/support"),
@@ -2899,6 +2899,15 @@ function SubNavBar() {
2899
2899
  href: `https://lavictoirefinance.com/dealers`,
2900
2900
  children: "Marine Dealer Floorplan Finance"
2901
2901
  }
2902
+ ) }),
2903
+ /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
2904
+ Link,
2905
+ {
2906
+ href: findMoreAxosDomains(
2907
+ "{AXOSBANK}/commercial/lending/premium-finance"
2908
+ ),
2909
+ children: "Premium Finance"
2910
+ }
2902
2911
  ) })
2903
2912
  ] })
2904
2913
  ] }),
package/dist/main.js CHANGED
@@ -87,6 +87,7 @@ import { ScheduleCallPremier } from "./Forms/ScheduleCallPremier.js";
87
87
  import { SuccesFormWrapper } from "./Forms/SuccesForm.js";
88
88
  import { VendorQuestionnaire } from "./Forms/VendorQuestionnaire.js";
89
89
  import { WCPLSurvey } from "./Forms/WcplSurvey.js";
90
+ import { CommercialPremiumFinance } from "./Forms/CommercialPremiumFinance.js";
90
91
  import { helpArticle_container, helpArticle_headline, helpArticle_p, insight_headline_2 } from "./HelpArticle/HelpArticle.css.js";
91
92
  import { HeroBanner } from "./HeroBanner/HeroBanner.js";
92
93
  import { headline_text, heroSupertag, hero_banner, hero_btns, hero_content, hero_embedded_image, hero_img, hero_text, hero_wrapper, img_contents, logout, reversed, reversed_lg_image } from "./HeroBanner/HeroBanner.css.js";
@@ -250,6 +251,7 @@ export {
250
251
  CollectInformationAlert,
251
252
  CommercialDeposits,
252
253
  CommercialLending,
254
+ CommercialPremiumFinance,
253
255
  ComparisonSet,
254
256
  ContactCompany,
255
257
  ContactCompanyTitle,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@axos-web-dev/shared-components",
3
3
  "description": "Axos shared components library for web.",
4
- "version": "1.0.68",
4
+ "version": "1.0.70",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",