@axos-web-dev/shared-components 1.0.77-patch.19 → 1.0.77-patch.21

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 (113) hide show
  1. package/dist/ATMLocator/ATMLocator.js +1 -0
  2. package/dist/Auth/ErrorAlert.js +1 -0
  3. package/dist/Avatar/Avatar.module.js +7 -7
  4. package/dist/Blockquote/Blockquote.module.js +3 -3
  5. package/dist/Button/Button.js +1 -0
  6. package/dist/Calculators/BuyDownCalculator/index.js +1 -1
  7. package/dist/Calculators/Calculator.js +1 -0
  8. package/dist/Carousel/index.js +1 -0
  9. package/dist/Chevron/index.js +1 -0
  10. package/dist/Comparison/Comparison.js +1 -0
  11. package/dist/ExecutiveBio/ExecutiveBio.js +1 -0
  12. package/dist/FaqAccordion/index.js +1 -0
  13. package/dist/FooterSiteMap/AxosBank/FooterSiteMap.js +1 -0
  14. package/dist/Forms/ApplicationStart.d.ts +1 -1
  15. package/dist/Forms/ApplicationStart.js +111 -89
  16. package/dist/Forms/ApplyNow.js +1 -0
  17. package/dist/Forms/ClearingForm.d.ts +1 -1
  18. package/dist/Forms/ClearingForm.js +184 -162
  19. package/dist/Forms/CommercialDeposits.d.ts +1 -1
  20. package/dist/Forms/CommercialDeposits.js +201 -179
  21. package/dist/Forms/CommercialLending.d.ts +1 -1
  22. package/dist/Forms/CommercialLending.js +278 -256
  23. package/dist/Forms/CommercialPremiumFinance.d.ts +1 -1
  24. package/dist/Forms/CommercialPremiumFinance.js +128 -106
  25. package/dist/Forms/ContactCompany.d.ts +1 -1
  26. package/dist/Forms/ContactCompany.js +113 -91
  27. package/dist/Forms/ContactCompanyTitle.d.ts +1 -1
  28. package/dist/Forms/ContactCompanyTitle.js +127 -105
  29. package/dist/Forms/ContactUs.d.ts +1 -1
  30. package/dist/Forms/ContactUs.js +99 -77
  31. package/dist/Forms/ContactUsAAS.d.ts +1 -1
  32. package/dist/Forms/ContactUsAAS.js +180 -158
  33. package/dist/Forms/ContactUsBusiness.d.ts +1 -1
  34. package/dist/Forms/ContactUsBusiness.js +134 -112
  35. package/dist/Forms/ContactUsBusinessNameEmail.d.ts +1 -1
  36. package/dist/Forms/ContactUsBusinessNameEmail.js +103 -81
  37. package/dist/Forms/ContactUsLVF.d.ts +1 -1
  38. package/dist/Forms/ContactUsLVF.js +118 -98
  39. package/dist/Forms/ContactUsNMLSId.d.ts +1 -1
  40. package/dist/Forms/ContactUsNMLSId.js +117 -95
  41. package/dist/Forms/CpraRequest.d.ts +1 -1
  42. package/dist/Forms/CpraRequest.js +641 -619
  43. package/dist/Forms/CraPublicFile.d.ts +1 -1
  44. package/dist/Forms/CraPublicFile.js +109 -87
  45. package/dist/Forms/DealerServices.d.ts +1 -1
  46. package/dist/Forms/DealerServices.js +225 -203
  47. package/dist/Forms/EmailOnly.d.ts +1 -1
  48. package/dist/Forms/EmailOnly.js +56 -36
  49. package/dist/Forms/EmailUs.d.ts +1 -1
  50. package/dist/Forms/EmailUs.js +75 -53
  51. package/dist/Forms/FormProps.d.ts +3 -0
  52. package/dist/Forms/HoneyPot/HoneyPot.css.d.ts +1 -0
  53. package/dist/Forms/HoneyPot/HoneyPot.css.js +5 -0
  54. package/dist/Forms/HoneyPot/index.d.ts +23 -0
  55. package/dist/Forms/HoneyPot/index.js +69 -0
  56. package/dist/Forms/MortgageRate/MortgageRateForm.d.ts +1 -1
  57. package/dist/Forms/MortgageRate/MortgageRateForm.js +367 -345
  58. package/dist/Forms/MortgageRate/MortgageRateWatch.js +1 -0
  59. package/dist/Forms/MortgageWarehouseLending.d.ts +1 -3
  60. package/dist/Forms/MortgageWarehouseLending.js +13 -3
  61. package/dist/Forms/QuickPricer/QuickPricerForm.d.ts +1 -1
  62. package/dist/Forms/QuickPricer/QuickPricerForm.js +624 -609
  63. package/dist/Forms/ScheduleCall.d.ts +1 -1
  64. package/dist/Forms/ScheduleCall.js +156 -134
  65. package/dist/Forms/ScheduleCallPremier.d.ts +1 -1
  66. package/dist/Forms/ScheduleCallPremier.js +178 -156
  67. package/dist/Forms/SuccesForm.js +1 -0
  68. package/dist/Forms/VendorQuestionnaire.d.ts +1 -1
  69. package/dist/Forms/VendorQuestionnaire.js +817 -795
  70. package/dist/Forms/WcplSurvey.d.ts +1 -1
  71. package/dist/Forms/WcplSurvey.js +112 -90
  72. package/dist/Forms/index.d.ts +1 -0
  73. package/dist/Forms/index.js +4 -0
  74. package/dist/Hyperlink/index.js +1 -0
  75. package/dist/ImageLink/ImageLink.js +1 -0
  76. package/dist/ImageLink/ImageLinkSet.js +1 -0
  77. package/dist/ImageLink/index.js +1 -0
  78. package/dist/Insight/Featured/CategorySelector.js +1 -0
  79. package/dist/Insight/Featured/Featured.js +1 -0
  80. package/dist/Insight/Featured/Header.js +1 -0
  81. package/dist/Modal/Modal.js +1 -0
  82. package/dist/NavigationMenu/AxosALTS/NavData.js +1 -0
  83. package/dist/NavigationMenu/AxosALTS/index.js +1 -0
  84. package/dist/NavigationMenu/AxosAdvisor/NavBar.module.js +52 -52
  85. package/dist/NavigationMenu/AxosAdvisorServices/NavBar.module.js +53 -53
  86. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileMenu.module.js +16 -16
  87. package/dist/NavigationMenu/AxosBank/MobileMenu/MobileNavData.js +1 -0
  88. package/dist/NavigationMenu/AxosBank/NavBar.module.js +39 -39
  89. package/dist/NavigationMenu/AxosBank/NavData.js +1 -0
  90. package/dist/NavigationMenu/AxosBank/SubNavBar.js +1 -0
  91. package/dist/NavigationMenu/AxosBank/index.js +1 -0
  92. package/dist/NavigationMenu/AxosClearing/NavBar.module.js +37 -37
  93. package/dist/NavigationMenu/AxosFiduciary/NavBar.module.js +41 -41
  94. package/dist/NavigationMenu/LaVictoire/NavData.js +1 -0
  95. package/dist/NavigationMenu/LaVictoire/index.js +1 -0
  96. package/dist/SetContainer/SetContainer.js +1 -0
  97. package/dist/SocialMediaBar/iconsRepository.js +1 -0
  98. package/dist/VideoTile/VideoTile.js +1 -0
  99. package/dist/VideoWrapper/index.js +1 -0
  100. package/dist/WalnutIframe/wrapper.module.js +3 -3
  101. package/dist/assets/Avatar/Avatar.css.css +59 -59
  102. package/dist/assets/Blockquote/Blockquote.css.css +68 -68
  103. package/dist/assets/Forms/HoneyPot/HoneyPot.css +8 -0
  104. package/dist/assets/NavigationMenu/AxosAdvisor/NavBar.css.css +597 -597
  105. package/dist/assets/NavigationMenu/AxosAdvisorServices/NavBar.css.css +618 -618
  106. package/dist/assets/NavigationMenu/AxosBank/MobileMenu/MobileMenu.css.css +191 -191
  107. package/dist/assets/NavigationMenu/AxosBank/NavBar.css.css +473 -473
  108. package/dist/assets/NavigationMenu/AxosClearing/NavBar.css.css +458 -458
  109. package/dist/assets/NavigationMenu/AxosFiduciary/NavBar.css.css +426 -426
  110. package/dist/assets/WalnutIframe/wrapper.css.css +48 -48
  111. package/dist/main.js +4 -0
  112. package/dist/utils/allowedAxosDomains.js +1 -0
  113. package/package.json +133 -133
@@ -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 DealerServices = ({
37
38
  icon = false,
@@ -45,6 +46,7 @@ const DealerServices = ({
45
46
  description,
46
47
  callToAction,
47
48
  validateEmail,
49
+ onValidate,
48
50
  id
49
51
  }) => {
50
52
  const schema = z.object({
@@ -81,8 +83,16 @@ const DealerServices = ({
81
83
  zip: z.string().trim().max(20).min(1, { message: "Zip code is required." }),
82
84
  description: z.string().trim().max(32e3)
83
85
  });
86
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
87
+ if (!isValidHoneyPot(data)) {
88
+ ctx.addIssue({
89
+ code: z.ZodIssueCode.custom,
90
+ message: "fields are not valid."
91
+ });
92
+ }
93
+ });
84
94
  const methods = useForm({
85
- resolver: zodResolver(schema.merge(SalesforceSchema), {
95
+ resolver: zodResolver(gen_schema, {
86
96
  async: true
87
97
  }),
88
98
  mode: "all",
@@ -118,209 +128,221 @@ const DealerServices = ({
118
128
  }
119
129
  )
120
130
  ] }),
121
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
122
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
123
- /* @__PURE__ */ jsx("div", { className: "", children: /* @__PURE__ */ jsx(
124
- Input,
125
- {
126
- id: "first_name",
127
- ...register("first_name", { required: true }),
128
- label: "First Name",
129
- sizes: "medium",
130
- placeholder: "First Name",
131
- required: true,
132
- error: !!errors.first_name,
133
- helperText: errors.first_name?.message,
134
- variant
135
- }
136
- ) }),
137
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
138
- Input,
139
- {
140
- id: "last_name",
141
- ...register("last_name", { required: true }),
142
- label: "Last Name",
143
- sizes: "medium",
144
- placeholder: "Last Name",
145
- required: true,
146
- error: !!errors.last_name,
147
- helperText: errors.last_name?.message,
148
- variant
149
- }
150
- ) }),
151
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
152
- Input,
153
- {
154
- id: "email",
155
- ...register("email", {
156
- required: true,
157
- validate: {
158
- isValid: async (val) => await associatedEmail(val) && await validateEmail(val)
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", { className: "", children: /* @__PURE__ */ jsx(
143
+ Input,
144
+ {
145
+ id: "first_name",
146
+ ...register("first_name", { required: true }),
147
+ label: "First Name",
148
+ sizes: "medium",
149
+ placeholder: "First Name",
150
+ required: true,
151
+ error: !!errors.first_name,
152
+ helperText: errors.first_name?.message,
153
+ variant
159
154
  }
160
- }),
161
- label: "Email",
162
- sizes: "medium",
163
- placeholder: "Email",
164
- required: true,
165
- error: !!errors.email,
166
- helperText: errors.email?.message,
167
- variant
168
- }
169
- ) }),
170
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
171
- InputPhone,
172
- {
173
- id: "phone",
174
- ...register("phone", { required: true, maxLength: 12 }),
175
- label: "Phone",
176
- sizes: "medium",
177
- placeholder: "Phone",
178
- required: true,
179
- error: !!errors.phone,
180
- helperText: errors.phone?.message,
181
- variant
182
- }
183
- ) }),
184
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
185
- Input,
186
- {
187
- id: "title",
188
- ...register("title", { required: true }),
189
- label: "Title",
190
- sizes: "medium",
191
- placeholder: "Title",
192
- required: true,
193
- error: !!errors.title,
194
- helperText: errors.title?.message,
195
- variant
196
- }
197
- ) }),
198
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
199
- Input,
200
- {
201
- id: "company",
202
- ...register("company", { required: true }),
203
- label: "Company Name",
204
- sizes: "medium",
205
- placeholder: "Company Name",
206
- required: true,
207
- error: !!errors.company,
208
- helperText: errors.company?.message,
209
- variant
210
- }
211
- ) }),
212
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
213
- Dropdown,
214
- {
215
- id: "Dealer_Type__c",
216
- ...register("Dealer_Type__c", {
217
- required: true,
218
- maxLength: 12
219
- }),
220
- label: "Franchise or Independent",
221
- sizes: "medium",
222
- required: true,
223
- error: !!errors.Dealer_Type__c,
224
- helperText: errors.Dealer_Type__c?.message,
225
- variant,
226
- defaultValue: "Franchise",
227
- children: [
228
- /* @__PURE__ */ jsx("option", { value: "Franchise", children: "Franchise" }),
229
- /* @__PURE__ */ jsx("option", { value: "Independent", children: "Independent" })
230
- ]
231
- }
232
- ) }),
233
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
234
- Dropdown,
235
- {
236
- id: "Lead_Source_Detail_SFDC2__c2",
237
- ...register("Lead_Source_Detail_SFDC2__c2", {
238
- required: true,
239
- maxLength: 12
240
- }),
241
- label: "Dealer Services or Collector Car Program",
242
- sizes: "medium",
243
- required: true,
244
- error: !!errors.Lead_Source_Detail_SFDC2__c2,
245
- helperText: errors.Lead_Source_Detail_SFDC2__c2?.message,
246
- variant,
247
- defaultValue: "Dealer Services",
248
- children: [
249
- /* @__PURE__ */ jsx("option", { value: "Dealer Services", children: "Dealer Services" }),
250
- /* @__PURE__ */ jsx("option", { value: "Collector Car Program", children: "Collector Car Program" })
251
- ]
252
- }
253
- ) }),
254
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
255
- Input,
256
- {
257
- id: "city",
258
- ...register("city", { required: true }),
259
- label: "City",
260
- sizes: "medium",
261
- placeholder: "City",
262
- required: true,
263
- error: !!errors.city,
264
- helperText: errors.city?.message,
265
- variant
266
- }
267
- ) }),
268
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
269
- Input,
270
- {
271
- id: "state",
272
- ...register("state", { required: true }),
273
- label: "State",
274
- sizes: "medium",
275
- placeholder: "State",
276
- required: true,
277
- error: !!errors.state,
278
- helperText: errors.state?.message,
279
- variant
280
- }
281
- ) }),
282
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
283
- Input,
284
- {
285
- id: "zip",
286
- ...register("zip", { required: true }),
287
- label: "Zip Code",
288
- sizes: "medium",
289
- placeholder: "Zip Code",
290
- required: true,
291
- error: !!errors.zip,
292
- helperText: errors.zip?.message,
293
- variant
294
- }
295
- ) }),
296
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
297
- InputTextArea,
298
- {
299
- id: "description",
300
- ...register("description"),
301
- label: "Additional Details",
302
- sizes: "medium",
303
- placeholder: "Additional Details",
304
- error: !!errors.description,
305
- helperText: errors.description?.message,
306
- variant,
307
- rows: 1
308
- }
309
- ) })
310
- ] }),
311
- children,
312
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
313
- /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
314
- Button,
315
- {
316
- color: getVariant(callToAction?.variant),
317
- as: "button",
318
- type: "submit",
319
- disabled: !isValid || isSubmitting,
320
- children: callToAction?.displayText
321
- }
322
- ) })
323
- ] })
155
+ ) }),
156
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
157
+ Input,
158
+ {
159
+ id: "last_name",
160
+ ...register("last_name", { required: true }),
161
+ label: "Last Name",
162
+ sizes: "medium",
163
+ placeholder: "Last Name",
164
+ required: true,
165
+ error: !!errors.last_name,
166
+ helperText: errors.last_name?.message,
167
+ variant
168
+ }
169
+ ) }),
170
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
171
+ Input,
172
+ {
173
+ id: "email",
174
+ ...register("email", {
175
+ required: true,
176
+ validate: {
177
+ isValid: async (val) => await associatedEmail(val) && await validateEmail(val)
178
+ }
179
+ }),
180
+ label: "Email",
181
+ sizes: "medium",
182
+ placeholder: "Email",
183
+ required: true,
184
+ error: !!errors.email,
185
+ helperText: errors.email?.message,
186
+ variant
187
+ }
188
+ ) }),
189
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
190
+ InputPhone,
191
+ {
192
+ id: "phone",
193
+ ...register("phone", { required: true, maxLength: 12 }),
194
+ label: "Phone",
195
+ sizes: "medium",
196
+ placeholder: "Phone",
197
+ required: true,
198
+ error: !!errors.phone,
199
+ helperText: errors.phone?.message,
200
+ variant
201
+ }
202
+ ) }),
203
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
204
+ Input,
205
+ {
206
+ id: "title",
207
+ ...register("title", { required: true }),
208
+ label: "Title",
209
+ sizes: "medium",
210
+ placeholder: "Title",
211
+ required: true,
212
+ error: !!errors.title,
213
+ helperText: errors.title?.message,
214
+ variant
215
+ }
216
+ ) }),
217
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
218
+ Input,
219
+ {
220
+ id: "company",
221
+ ...register("company", { required: true }),
222
+ label: "Company Name",
223
+ sizes: "medium",
224
+ placeholder: "Company Name",
225
+ required: true,
226
+ error: !!errors.company,
227
+ helperText: errors.company?.message,
228
+ variant
229
+ }
230
+ ) }),
231
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
232
+ Dropdown,
233
+ {
234
+ id: "Dealer_Type__c",
235
+ ...register("Dealer_Type__c", {
236
+ required: true,
237
+ maxLength: 12
238
+ }),
239
+ label: "Franchise or Independent",
240
+ sizes: "medium",
241
+ required: true,
242
+ error: !!errors.Dealer_Type__c,
243
+ helperText: errors.Dealer_Type__c?.message,
244
+ variant,
245
+ defaultValue: "Franchise",
246
+ children: [
247
+ /* @__PURE__ */ jsx("option", { value: "Franchise", children: "Franchise" }),
248
+ /* @__PURE__ */ jsx("option", { value: "Independent", children: "Independent" })
249
+ ]
250
+ }
251
+ ) }),
252
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
253
+ Dropdown,
254
+ {
255
+ id: "Lead_Source_Detail_SFDC2__c2",
256
+ ...register("Lead_Source_Detail_SFDC2__c2", {
257
+ required: true,
258
+ maxLength: 12
259
+ }),
260
+ label: "Dealer Services or Collector Car Program",
261
+ sizes: "medium",
262
+ required: true,
263
+ error: !!errors.Lead_Source_Detail_SFDC2__c2,
264
+ helperText: errors.Lead_Source_Detail_SFDC2__c2?.message,
265
+ variant,
266
+ defaultValue: "Dealer Services",
267
+ children: [
268
+ /* @__PURE__ */ jsx("option", { value: "Dealer Services", children: "Dealer Services" }),
269
+ /* @__PURE__ */ jsx("option", { value: "Collector Car Program", children: "Collector Car Program" })
270
+ ]
271
+ }
272
+ ) }),
273
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
274
+ Input,
275
+ {
276
+ id: "city",
277
+ ...register("city", { required: true }),
278
+ label: "City",
279
+ sizes: "medium",
280
+ placeholder: "City",
281
+ required: true,
282
+ error: !!errors.city,
283
+ helperText: errors.city?.message,
284
+ variant
285
+ }
286
+ ) }),
287
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
288
+ Input,
289
+ {
290
+ id: "state",
291
+ ...register("state", { required: true }),
292
+ label: "State",
293
+ sizes: "medium",
294
+ placeholder: "State",
295
+ required: true,
296
+ error: !!errors.state,
297
+ helperText: errors.state?.message,
298
+ variant
299
+ }
300
+ ) }),
301
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
302
+ Input,
303
+ {
304
+ id: "zip",
305
+ ...register("zip", { required: true }),
306
+ label: "Zip Code",
307
+ sizes: "medium",
308
+ placeholder: "Zip Code",
309
+ required: true,
310
+ error: !!errors.zip,
311
+ helperText: errors.zip?.message,
312
+ variant
313
+ }
314
+ ) }),
315
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
316
+ InputTextArea,
317
+ {
318
+ id: "description",
319
+ ...register("description"),
320
+ label: "Additional Details",
321
+ sizes: "medium",
322
+ placeholder: "Additional Details",
323
+ error: !!errors.description,
324
+ helperText: errors.description?.message,
325
+ variant,
326
+ rows: 1
327
+ }
328
+ ) }),
329
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
330
+ ] }),
331
+ children,
332
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
333
+ /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
334
+ Button,
335
+ {
336
+ color: getVariant(callToAction?.variant),
337
+ as: "button",
338
+ type: "submit",
339
+ disabled: !isValid || isSubmitting,
340
+ children: callToAction?.displayText
341
+ }
342
+ ) })
343
+ ]
344
+ }
345
+ )
324
346
  ] }) }) }, id);
325
347
  };
326
348
  export {
@@ -3,4 +3,4 @@ import { FormProps } from './FormProps';
3
3
  export type EmailOnlyInputs = {
4
4
  email: string;
5
5
  };
6
- export declare const EmailOnly: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const EmailOnly: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, description, callToAction, validateEmail, onValidate, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
@@ -47,6 +47,7 @@ import { useForm, FormProvider } from "react-hook-form";
47
47
  import { z } from "zod";
48
48
  import "../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
49
49
  import { iconForm, headerContainer, headerForm, form, descriptionField, formWrapper, disclosureForm, actions, formContainer } from "./Forms.css.js";
50
+ import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "./HoneyPot/index.js";
50
51
  import { SalesforceSchema } from "./SalesforceFieldsForm.js";
51
52
  /* empty css */
52
53
  /* empty css */
@@ -139,18 +140,23 @@ const EmailOnly = ({
139
140
  description,
140
141
  callToAction,
141
142
  validateEmail,
143
+ onValidate,
142
144
  id
143
145
  }) => {
144
146
  const schema = z.object({
145
147
  email: z.string().email({ message: "Email is required." }).refine(async (val) => await validateEmail(val))
146
148
  });
149
+ const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
150
+ if (!isValidHoneyPot(data)) {
151
+ ctx.addIssue({
152
+ code: z.ZodIssueCode.custom,
153
+ message: "fields are not valid."
154
+ });
155
+ }
156
+ });
147
157
  const methods = useForm({
148
158
  resolver: async (data, context, options) => {
149
- return zodResolver(schema.merge(SalesforceSchema))(
150
- data,
151
- context,
152
- options
153
- );
159
+ return zodResolver(gen_schema)(data, context, options);
154
160
  },
155
161
  mode: "all",
156
162
  defaultValues: {
@@ -183,38 +189,52 @@ const EmailOnly = ({
183
189
  }
184
190
  )
185
191
  ] }),
186
- /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
187
- /* @__PURE__ */ jsx("div", { className: clsx(formWrapper({ variant, formType })), children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
188
- Input,
189
- {
190
- id: "email",
191
- ...register("email", {
192
- required: true,
193
- validate: {
194
- isValid: associatedEmail
192
+ /* @__PURE__ */ jsxs(
193
+ "form",
194
+ {
195
+ className: form,
196
+ onSubmit: async (e) => {
197
+ onValidate && onValidate(e);
198
+ await handleSubmit(submitForm)(e);
199
+ e.preventDefault();
200
+ },
201
+ children: [
202
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant, formType })), children: [
203
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
204
+ Input,
205
+ {
206
+ id: "email",
207
+ ...register("email", {
208
+ required: true,
209
+ validate: {
210
+ isValid: associatedEmail
211
+ }
212
+ }),
213
+ sizes: "medium",
214
+ placeholder: "Enter Email",
215
+ required: true,
216
+ error: !!errors.email,
217
+ helperText: errors.email?.message,
218
+ variant
219
+ }
220
+ ) }),
221
+ /* @__PURE__ */ jsx(HoneyPot, { register, variant })
222
+ ] }),
223
+ children,
224
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
225
+ /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
226
+ Button,
227
+ {
228
+ color: getVariant(callToAction?.variant),
229
+ as: "button",
230
+ type: "submit",
231
+ disabled: !isValid || isSubmitting,
232
+ children: callToAction?.displayText
195
233
  }
196
- }),
197
- sizes: "medium",
198
- placeholder: "Enter Email",
199
- required: true,
200
- error: !!errors.email,
201
- helperText: errors.email?.message,
202
- variant
203
- }
204
- ) }) }),
205
- children,
206
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
207
- /* @__PURE__ */ jsx("div", { className: actions, children: /* @__PURE__ */ jsx(
208
- Button,
209
- {
210
- color: getVariant(callToAction?.variant),
211
- as: "button",
212
- type: "submit",
213
- disabled: !isValid || isSubmitting,
214
- children: callToAction?.displayText
215
- }
216
- ) })
217
- ] })
234
+ ) })
235
+ ]
236
+ }
237
+ )
218
238
  ] }) }) }, id);
219
239
  };
220
240
  export {
@@ -4,4 +4,4 @@ export type EmailUsInputs = {
4
4
  email: string;
5
5
  message: string;
6
6
  };
7
- export declare const EmailUs: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, validateEmail, description, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const EmailUs: ({ icon, children, onSubmit, disclosure, variant: fullVariant, headline, callToAction, validateEmail, onValidate, description, id, }: FormProps) => import("react/jsx-runtime").JSX.Element;