@axos-web-dev/shared-components 0.0.110 → 0.0.111

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.
@@ -141,7 +141,8 @@ const Button = ({
141
141
  href: findMoreAxosDomains(targetUrl),
142
142
  id,
143
143
  target: newTab ? "_blank" : "_self",
144
- onClick: marketingIntersitial ? openMarketingInterstitial : action ?? onClick
144
+ onClick: marketingIntersitial ? openMarketingInterstitial : action ?? onClick,
145
+ disabled: disabled ?? false
145
146
  },
146
147
  children
147
148
  ),
@@ -29,7 +29,7 @@ import { getVariant } from "../utils/getVariant.js";
29
29
  import clsx from "clsx";
30
30
  import { useForm, FormProvider } from "react-hook-form";
31
31
  import * as z from "zod";
32
- import { formContainer, iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, fullRowForm, disclosureForm, actions } from "./Forms.css.js";
32
+ import { formContainer, iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, fullRowForm, ro_input, disclosureForm, actions } from "./Forms.css.js";
33
33
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
34
34
  import CheckboxGroup from "../Input/CheckboxGroup.js";
35
35
  const options = [
@@ -96,12 +96,13 @@ const ClearingForm = ({
96
96
  const handleShowBusinessType = () => {
97
97
  setShowBusinessTypes(true);
98
98
  };
99
- let formattedValues = "";
100
99
  const handleBusinessTypeChange = (updatedValues) => {
101
- setSelectedValues(updatedValues);
102
- formattedValues = updatedValues.join(";");
103
- setValue("Business_Type__c", formattedValues);
104
- handleTOBerrors();
100
+ if (updatedValues) {
101
+ setSelectedValues(updatedValues);
102
+ setValue("Business_Type__c", updatedValues.join(";"));
103
+ clearErrors("Business_Type__c");
104
+ setRequiredTOB(true);
105
+ }
105
106
  };
106
107
  const methods = useForm({
107
108
  resolver: zodResolver(schema.merge(SalesforceSchema), {
@@ -110,8 +111,7 @@ const ClearingForm = ({
110
111
  mode: "all",
111
112
  defaultValues: {
112
113
  email: "",
113
- Business_Type__c: "FinTech"
114
- // Set default value as empty array
114
+ Business_Type__c: ""
115
115
  }
116
116
  });
117
117
  const {
@@ -126,7 +126,7 @@ const ClearingForm = ({
126
126
  await onSubmit(data);
127
127
  };
128
128
  const handleTOBerrors = () => {
129
- if (!formattedValues.length) {
129
+ if (!selectedValues.length) {
130
130
  setError("Business_Type__c", {
131
131
  type: "manual",
132
132
  message: "Type of Business is required."
@@ -142,6 +142,16 @@ const ClearingForm = ({
142
142
  setValue("Current_Assets_Under_Management__c", value);
143
143
  if (value) setRequiredAUM(true);
144
144
  };
145
+ const handleAUMerror = () => {
146
+ if (!requiredAUM) {
147
+ setError("Current_Assets_Under_Management__c", {
148
+ type: "manual",
149
+ message: "Assets Under Management is required"
150
+ });
151
+ } else {
152
+ clearErrors("Current_Assets_Under_Management__c");
153
+ }
154
+ };
145
155
  const variant = getVariant(fullVariant);
146
156
  return /* @__PURE__ */ jsx(
147
157
  "section",
@@ -253,8 +263,10 @@ const ClearingForm = ({
253
263
  variant,
254
264
  defaultValue: "Select option",
255
265
  onChange: handleDropdownChange,
266
+ onClick: handleAUMerror,
267
+ onBlur: handleAUMerror,
256
268
  children: [
257
- /* @__PURE__ */ jsx("option", { value: "Select option", disabled: true, children: "Select Option" }),
269
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
258
270
  /* @__PURE__ */ jsx("option", { value: "$0 - $100MM", children: "$0 - $100MM" }),
259
271
  /* @__PURE__ */ jsx("option", { value: "$101MM - $200MM", children: "$101MM - $200MM" }),
260
272
  /* @__PURE__ */ jsx("option", { value: "$201MM - $500MM", children: "$201MM - $500MM" }),
@@ -276,7 +288,8 @@ const ClearingForm = ({
276
288
  sizes: "medium",
277
289
  placeholder: "Select All That Apply",
278
290
  error: !!errors.Business_Type__c,
279
- disabled: true
291
+ readOnly: true,
292
+ className: ro_input
280
293
  }
281
294
  ),
282
295
  showBusinessTypes && /* @__PURE__ */ jsx(
@@ -284,7 +297,8 @@ const ClearingForm = ({
284
297
  {
285
298
  options,
286
299
  selectedValues,
287
- onChange: handleBusinessTypeChange
300
+ onChange: handleBusinessTypeChange,
301
+ error: !!errors.Business_Type__c
288
302
  }
289
303
  )
290
304
  ] }),
@@ -0,0 +1,27 @@
1
+ import { FormProps } from './FormProps';
2
+
3
+ export type CpraInputs = {
4
+ California_Resident: "Yes" | "No";
5
+ Categories_of_personal_info: "Yes" | "No";
6
+ Pieces_of_personal_information: "Yes" | "No";
7
+ Request_Correction_of_Information: "Yes" | "No";
8
+ Corrected_Information: string;
9
+ Delete_personal_info: "Yes" | "No";
10
+ Opt_out_of_sale_of_info: "Yes" | "No";
11
+ Current_client: "Yes" | "No";
12
+ Currently_Employed_by_Axos_Financial: "Yes" | "No";
13
+ Previously_Employed_by_Axos_Financial: "Yes" | "No";
14
+ Ever_Applied_for_Employment_with_Axos_Financial: "Yes" | "No";
15
+ Axos_Financial_interaction_outlet: string;
16
+ First_Name: string;
17
+ Last_Name: string;
18
+ DOB: string;
19
+ email: string;
20
+ Telephone: string;
21
+ "Street Address": string;
22
+ City: string;
23
+ State: string;
24
+ "Zip Code": string;
25
+ Contact_Method: "Email" | "Postal Mail";
26
+ };
27
+ export declare const CpraRequest: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;