@axos-web-dev/shared-components 1.0.77-patch.22 → 1.0.77-patch.24

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.
@@ -46,7 +46,7 @@ import { useForm, FormProvider } from "react-hook-form";
46
46
  import * as z from "zod";
47
47
  import "../../Calculators/BuyDownCalculator/BuyDownCalculator.css.js";
48
48
  import { iconForm, headerForm, form, descriptionField, headerContainer, fullRowSelect, formWrapper, centerSelect, mt2rem, fullRowForm, disclosureForm, actions, formBtns, na_cursor, formContainer } from "../Forms.css.js";
49
- import { honeyPotSchema, isValidHoneyPot, HoneyPot } from "../HoneyPot/index.js";
49
+ import "../HoneyPot/index.js";
50
50
  import { SalesforceSchema } from "../SalesforceFieldsForm.js";
51
51
  import "../../Input/RadioButton.css.js";
52
52
  import "../../Input/Checkbox.css.js";
@@ -141,8 +141,7 @@ const MortgageRate = ({
141
141
  rateWatchOnSubmit,
142
142
  setRateWatchSubmitted,
143
143
  hideModalValue,
144
- showingTables,
145
- onValidate
144
+ showingTables
146
145
  }) => {
147
146
  const [loanPurpose, setLoanPurpose] = useState(1);
148
147
  const [rateType, setRateType] = useState("Purchase");
@@ -221,16 +220,8 @@ const MortgageRate = ({
221
220
  cashOut: z.number({ message: "Cash Out is required." }).optional(),
222
221
  loanPurpose: z.number({ message: "Loan Purpose is required." })
223
222
  });
224
- const gen_schema = schema.merge(SalesforceSchema).merge(honeyPotSchema).superRefine((data, ctx) => {
225
- if (!isValidHoneyPot(data)) {
226
- ctx.addIssue({
227
- code: z.ZodIssueCode.custom,
228
- message: "fields are not valid."
229
- });
230
- }
231
- });
232
223
  const methods = useForm({
233
- resolver: zodResolver(gen_schema, {
224
+ resolver: zodResolver(schema.merge(SalesforceSchema), {
234
225
  async: true
235
226
  }),
236
227
  mode: "all",
@@ -420,373 +411,361 @@ const MortgageRate = ({
420
411
  children: "Tell us about your property and loan to personalize your rate."
421
412
  }
422
413
  ) }),
423
- /* @__PURE__ */ jsxs(
424
- "form",
425
- {
426
- className: form,
427
- onSubmit: async (e) => {
428
- onValidate && onValidate(e);
429
- await handleSubmit(submitForm)(e);
430
- e.preventDefault();
431
- },
432
- children: [
433
- /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
434
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
435
- Dropdown,
436
- {
437
- id: "propertyType",
438
- ...register("propertyType", {
439
- required: true,
440
- setValueAs: (value) => Number(value)
441
- }),
442
- label: "Property Type",
443
- sizes: "medium",
444
- required: true,
445
- error: !!errors.propertyType,
446
- helperText: errors.propertyType?.message,
447
- variant,
448
- defaultValue: "Select option",
449
- children: [
450
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
451
- /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
452
- /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
453
- /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
454
- /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
455
- /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
456
- /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
457
- ]
458
- }
459
- ) }),
460
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
461
- Dropdown,
462
- {
463
- id: "occupancy",
464
- ...register("occupancy", {
465
- required: true,
466
- setValueAs: (value) => Number(value)
467
- }),
468
- label: "Property Usage",
469
- sizes: "medium",
470
- required: true,
471
- error: !!errors.occupancy,
472
- helperText: errors.occupancy?.message,
473
- variant,
474
- defaultValue: "Select option",
475
- children: [
476
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
477
- /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
478
- /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
479
- /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
480
- ]
481
- }
482
- ) }),
483
- loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
484
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
485
- Input,
486
- {
487
- id: "salesPrice",
488
- type: "text",
489
- ...register("salesPrice", {
490
- required: true,
491
- setValueAs: (value) => parseCurrency(value)
492
- }),
493
- label: "Purchase Price",
494
- sizes: "medium",
495
- required: true,
496
- error: !!errors.salesPrice,
497
- helperText: errors.salesPrice?.message,
498
- variant,
499
- onBlur: (e) => {
500
- setIsTypingDownPayment(false);
501
- const rawValue = e.target.value;
502
- const parsedValue = parseCurrency(rawValue);
503
- if (parsedValue === 0) {
504
- methods.setError("salesPrice", {
505
- type: "manual",
506
- message: "Purchase Price is required."
507
- });
508
- } else {
509
- methods.setValue("salesPrice", parsedValue);
510
- e.target.value = formatCurrency(parsedValue);
511
- }
512
- methods.trigger("downPayment");
513
- },
514
- onFocus: (e) => {
515
- const currentValue = e.target.value;
516
- e.target.value = currentValue.replace(/[$,]/g, "");
517
- }
518
- }
519
- ) }),
520
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
521
- DownPaymentInput,
522
- {
523
- id: "downPayment",
524
- type: "text",
525
- ...register("downPayment", {
526
- required: true,
527
- setValueAs: (value) => parseCurrency(value)
528
- }),
529
- salesPrice: watch("salesPrice"),
530
- downPaymentPercentage,
531
- setDownPaymentPercentage,
532
- label: "Down Payment",
533
- sizes: "medium",
534
- error: !!errors.downPayment,
535
- helperText: errors.downPayment?.message,
536
- onChange: (e) => {
537
- const value = parseCurrency(e.target.value);
538
- methods.setValue("downPayment", value);
539
- },
540
- variant,
541
- isTypingDownPayment,
542
- setIsTypingDownPayment,
543
- methods
544
- }
545
- ) })
546
- ] }),
547
- loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
548
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
549
- Input,
550
- {
551
- id: "appraisedValue",
552
- type: "text",
553
- ...register("appraisedValue", {
554
- required: true,
555
- setValueAs: (value) => parseCurrency(value)
556
- }),
557
- label: "Home Value",
558
- sizes: "medium",
559
- required: true,
560
- error: !!errors.appraisedValue,
561
- helperText: errors.appraisedValue?.message,
562
- variant,
563
- onBlur: (e) => {
564
- const rawValue = e.target.value;
565
- const parsedValue = parseCurrency(rawValue);
566
- methods.setValue("appraisedValue", parsedValue);
567
- e.target.value = formatCurrency(parsedValue);
568
- },
569
- onFocus: (e) => {
570
- const currentValue = e.target.value;
571
- e.target.value = currentValue.replace(/[$,]/g, "");
572
- }
573
- }
574
- ) }),
575
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
576
- Input,
577
- {
578
- id: "mortgageBalance",
579
- type: "text",
580
- ...register("mortgageBalance", {
581
- required: true,
582
- setValueAs: (value) => parseCurrency(value)
583
- }),
584
- label: "Mortgage Balance",
585
- sizes: "medium",
586
- required: true,
587
- error: !!errors.mortgageBalance,
588
- helperText: errors.mortgageBalance?.message,
589
- variant,
590
- onBlur: (e) => {
591
- const rawValue = e.target.value;
592
- const parsedValue = parseCurrency(rawValue);
593
- methods.setValue("mortgageBalance", parsedValue);
594
- e.target.value = formatCurrency(parsedValue);
595
- },
596
- onFocus: (e) => {
597
- const currentValue = e.target.value;
598
- e.target.value = currentValue.replace(/[$,]/g, "");
599
- }
600
- }
601
- ) })
602
- ] }),
603
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
604
- Dropdown,
605
- {
606
- id: "creditScore",
607
- ...register("creditScore", {
608
- required: true,
609
- setValueAs: (value) => value === "" ? void 0 : Number(value)
610
- }),
611
- label: "Credit Score",
612
- sizes: "medium",
613
- required: true,
614
- error: !!errors.creditScore,
615
- helperText: errors.creditScore?.message,
616
- variant,
617
- defaultValue: "Select option",
618
- children: [
619
- /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
620
- /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
621
- /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
622
- /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
623
- /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
624
- /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
625
- /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
626
- /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
627
- /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
628
- ]
629
- }
630
- ) }),
631
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
632
- Input,
633
- {
634
- id: "zipCode",
635
- type: "number",
636
- ...register("zipCode", {
637
- required: true,
638
- setValueAs: (value) => Number(value)
639
- }),
640
- label: "Zip Code",
641
- sizes: "medium",
414
+ /* @__PURE__ */ jsxs("form", { className: form, onSubmit: handleSubmit(submitForm), children: [
415
+ /* @__PURE__ */ jsxs("div", { className: clsx(formWrapper({ variant })), children: [
416
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
417
+ Dropdown,
418
+ {
419
+ id: "propertyType",
420
+ ...register("propertyType", {
421
+ required: true,
422
+ setValueAs: (value) => Number(value)
423
+ }),
424
+ label: "Property Type",
425
+ sizes: "medium",
426
+ required: true,
427
+ error: !!errors.propertyType,
428
+ helperText: errors.propertyType?.message,
429
+ variant,
430
+ defaultValue: "Select option",
431
+ children: [
432
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
433
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Single Family Home" }),
434
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Condo" }),
435
+ /* @__PURE__ */ jsx("option", { value: "5", children: "Hi-Rise Condo" }),
436
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Co-op" }),
437
+ /* @__PURE__ */ jsx("option", { value: "4", children: "2-4 Unit" }),
438
+ /* @__PURE__ */ jsx("option", { value: "6", children: "Manufactured" })
439
+ ]
440
+ }
441
+ ) }),
442
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
443
+ Dropdown,
444
+ {
445
+ id: "occupancy",
446
+ ...register("occupancy", {
447
+ required: true,
448
+ setValueAs: (value) => Number(value)
449
+ }),
450
+ label: "Property Usage",
451
+ sizes: "medium",
452
+ required: true,
453
+ error: !!errors.occupancy,
454
+ helperText: errors.occupancy?.message,
455
+ variant,
456
+ defaultValue: "Select option",
457
+ children: [
458
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
459
+ /* @__PURE__ */ jsx("option", { value: "1", children: "Primary Residence" }),
460
+ /* @__PURE__ */ jsx("option", { value: "2", children: "Vacation Home" }),
461
+ /* @__PURE__ */ jsx("option", { value: "3", children: "Investment" })
462
+ ]
463
+ }
464
+ ) }),
465
+ loanPurpose === 1 && /* @__PURE__ */ jsxs(Fragment, { children: [
466
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
467
+ Input,
468
+ {
469
+ id: "salesPrice",
470
+ type: "text",
471
+ ...register("salesPrice", {
642
472
  required: true,
643
- error: !!errors.zipCode,
644
- helperText: errors.zipCode?.message,
645
- variant
646
- }
647
- ) }),
648
- loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
649
- Input,
650
- {
651
- id: "cashOut",
652
- type: "text",
653
- ...register("cashOut", {
654
- required: true,
655
- setValueAs: (value) => parseCurrency(value)
656
- }),
657
- label: "Cash Out (Optional)",
658
- sizes: "medium",
659
- error: !!errors.cashOut,
660
- helperText: errors.cashOut?.message,
661
- variant,
662
- onBlur: (e) => {
663
- const rawValue = e.target.value;
664
- const parsedValue = parseCurrency(rawValue);
665
- methods.setValue("cashOut", parsedValue);
473
+ setValueAs: (value) => parseCurrency(value)
474
+ }),
475
+ label: "Purchase Price",
476
+ sizes: "medium",
477
+ required: true,
478
+ error: !!errors.salesPrice,
479
+ helperText: errors.salesPrice?.message,
480
+ variant,
481
+ onBlur: (e) => {
482
+ setIsTypingDownPayment(false);
483
+ const rawValue = e.target.value;
484
+ const parsedValue = parseCurrency(rawValue);
485
+ if (parsedValue === 0) {
486
+ methods.setError("salesPrice", {
487
+ type: "manual",
488
+ message: "Purchase Price is required."
489
+ });
490
+ } else {
491
+ methods.setValue("salesPrice", parsedValue);
666
492
  e.target.value = formatCurrency(parsedValue);
667
- },
668
- onFocus: (e) => {
669
- const currentValue = e.target.value;
670
- e.target.value = currentValue.replace(/[$,]/g, "");
671
493
  }
494
+ methods.trigger("downPayment");
495
+ },
496
+ onFocus: (e) => {
497
+ const currentValue = e.target.value;
498
+ e.target.value = currentValue.replace(/[$,]/g, "");
672
499
  }
673
- ) }) }) : null,
674
- /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
675
- "div",
676
- {
677
- className: clsx(
678
- descriptionField({ variant }),
679
- "text_center"
680
- ),
681
- children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
682
- }
683
- ) }),
684
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
685
- Input,
686
- {
687
- id: "firstName",
688
- ...register("firstName", {
689
- required: "First Name is required"
690
- }),
691
- label: "First Name",
692
- sizes: "medium",
500
+ }
501
+ ) }),
502
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
503
+ DownPaymentInput,
504
+ {
505
+ id: "downPayment",
506
+ type: "text",
507
+ ...register("downPayment", {
693
508
  required: true,
694
- error: !!errors.firstName,
695
- helperText: errors.firstName?.message,
696
- variant
697
- }
698
- ) }),
699
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
700
- Input,
701
- {
702
- id: "lastName",
703
- ...register("lastName", { required: true }),
704
- label: "Last Name",
705
- sizes: "medium",
509
+ setValueAs: (value) => parseCurrency(value)
510
+ }),
511
+ salesPrice: watch("salesPrice"),
512
+ downPaymentPercentage,
513
+ setDownPaymentPercentage,
514
+ label: "Down Payment",
515
+ sizes: "medium",
516
+ error: !!errors.downPayment,
517
+ helperText: errors.downPayment?.message,
518
+ onChange: (e) => {
519
+ const value = parseCurrency(e.target.value);
520
+ methods.setValue("downPayment", value);
521
+ },
522
+ variant,
523
+ isTypingDownPayment,
524
+ setIsTypingDownPayment,
525
+ methods
526
+ }
527
+ ) })
528
+ ] }),
529
+ loanPurpose === 2 && /* @__PURE__ */ jsxs(Fragment, { children: [
530
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
531
+ Input,
532
+ {
533
+ id: "appraisedValue",
534
+ type: "text",
535
+ ...register("appraisedValue", {
706
536
  required: true,
707
- error: !!errors.lastName,
708
- helperText: errors.lastName?.message,
709
- variant
537
+ setValueAs: (value) => parseCurrency(value)
538
+ }),
539
+ label: "Home Value",
540
+ sizes: "medium",
541
+ required: true,
542
+ error: !!errors.appraisedValue,
543
+ helperText: errors.appraisedValue?.message,
544
+ variant,
545
+ onBlur: (e) => {
546
+ const rawValue = e.target.value;
547
+ const parsedValue = parseCurrency(rawValue);
548
+ methods.setValue("appraisedValue", parsedValue);
549
+ e.target.value = formatCurrency(parsedValue);
550
+ },
551
+ onFocus: (e) => {
552
+ const currentValue = e.target.value;
553
+ e.target.value = currentValue.replace(/[$,]/g, "");
710
554
  }
711
- ) }),
712
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
713
- Input,
714
- {
715
- id: "email",
716
- ...register("email", {
717
- required: true,
718
- validate: {
719
- isValid: associatedEmail
720
- }
721
- }),
722
- label: "Email",
723
- sizes: "medium",
555
+ }
556
+ ) }),
557
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
558
+ Input,
559
+ {
560
+ id: "mortgageBalance",
561
+ type: "text",
562
+ ...register("mortgageBalance", {
724
563
  required: true,
725
- error: !!errors.email,
726
- helperText: errors.email?.message,
727
- variant
564
+ setValueAs: (value) => parseCurrency(value)
565
+ }),
566
+ label: "Mortgage Balance",
567
+ sizes: "medium",
568
+ required: true,
569
+ error: !!errors.mortgageBalance,
570
+ helperText: errors.mortgageBalance?.message,
571
+ variant,
572
+ onBlur: (e) => {
573
+ const rawValue = e.target.value;
574
+ const parsedValue = parseCurrency(rawValue);
575
+ methods.setValue("mortgageBalance", parsedValue);
576
+ e.target.value = formatCurrency(parsedValue);
577
+ },
578
+ onFocus: (e) => {
579
+ const currentValue = e.target.value;
580
+ e.target.value = currentValue.replace(/[$,]/g, "");
728
581
  }
729
- ) }),
730
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
731
- InputPhone,
732
- {
733
- id: "phone",
734
- ...register("phone", { required: true, maxLength: 12 }),
735
- label: "Phone Number",
736
- sizes: "medium",
737
- required: true,
738
- error: !!errors.phone,
739
- helperText: errors.phone?.message,
740
- variant
582
+ }
583
+ ) })
584
+ ] }),
585
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(
586
+ Dropdown,
587
+ {
588
+ id: "creditScore",
589
+ ...register("creditScore", {
590
+ required: true,
591
+ setValueAs: (value) => value === "" ? void 0 : Number(value)
592
+ }),
593
+ label: "Credit Score",
594
+ sizes: "medium",
595
+ required: true,
596
+ error: !!errors.creditScore,
597
+ helperText: errors.creditScore?.message,
598
+ variant,
599
+ defaultValue: "Select option",
600
+ children: [
601
+ /* @__PURE__ */ jsx("option", { disabled: true, value: "Select option", children: "Select Option" }),
602
+ /* @__PURE__ */ jsx("option", { value: "740", children: "740+" }),
603
+ /* @__PURE__ */ jsx("option", { value: "720", children: "739-720" }),
604
+ /* @__PURE__ */ jsx("option", { value: "700", children: "719-700" }),
605
+ /* @__PURE__ */ jsx("option", { value: "680", children: "699-680" }),
606
+ /* @__PURE__ */ jsx("option", { value: "660", children: "679-660" }),
607
+ /* @__PURE__ */ jsx("option", { value: "640", children: "659-640" }),
608
+ /* @__PURE__ */ jsx("option", { value: "620", children: "639-620" }),
609
+ /* @__PURE__ */ jsx("option", { value: "600", children: "Below 620" })
610
+ ]
611
+ }
612
+ ) }),
613
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
614
+ Input,
615
+ {
616
+ id: "zipCode",
617
+ type: "number",
618
+ ...register("zipCode", {
619
+ required: true,
620
+ setValueAs: (value) => Number(value)
621
+ }),
622
+ label: "Zip Code",
623
+ sizes: "medium",
624
+ required: true,
625
+ error: !!errors.zipCode,
626
+ helperText: errors.zipCode?.message,
627
+ variant
628
+ }
629
+ ) }),
630
+ loanPurpose === 2 ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: fullRowForm, children: /* @__PURE__ */ jsx(
631
+ Input,
632
+ {
633
+ id: "cashOut",
634
+ type: "text",
635
+ ...register("cashOut", {
636
+ required: true,
637
+ setValueAs: (value) => parseCurrency(value)
638
+ }),
639
+ label: "Cash Out (Optional)",
640
+ sizes: "medium",
641
+ error: !!errors.cashOut,
642
+ helperText: errors.cashOut?.message,
643
+ variant,
644
+ onBlur: (e) => {
645
+ const rawValue = e.target.value;
646
+ const parsedValue = parseCurrency(rawValue);
647
+ methods.setValue("cashOut", parsedValue);
648
+ e.target.value = formatCurrency(parsedValue);
649
+ },
650
+ onFocus: (e) => {
651
+ const currentValue = e.target.value;
652
+ e.target.value = currentValue.replace(/[$,]/g, "");
653
+ }
654
+ }
655
+ ) }) }) : null,
656
+ /* @__PURE__ */ jsx("div", { className: clsx(fullRowForm, "text_center"), children: /* @__PURE__ */ jsx(
657
+ "div",
658
+ {
659
+ className: clsx(
660
+ descriptionField({ variant }),
661
+ "text_center"
662
+ ),
663
+ children: "Almost there! Please provide your contact information to view rates and sign up for Rate Watch."
664
+ }
665
+ ) }),
666
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
667
+ Input,
668
+ {
669
+ id: "firstName",
670
+ ...register("firstName", {
671
+ required: "First Name is required"
672
+ }),
673
+ label: "First Name",
674
+ sizes: "medium",
675
+ required: true,
676
+ error: !!errors.firstName,
677
+ helperText: errors.firstName?.message,
678
+ variant
679
+ }
680
+ ) }),
681
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
682
+ Input,
683
+ {
684
+ id: "lastName",
685
+ ...register("lastName", { required: true }),
686
+ label: "Last Name",
687
+ sizes: "medium",
688
+ required: true,
689
+ error: !!errors.lastName,
690
+ helperText: errors.lastName?.message,
691
+ variant
692
+ }
693
+ ) }),
694
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
695
+ Input,
696
+ {
697
+ id: "email",
698
+ ...register("email", {
699
+ required: true,
700
+ validate: {
701
+ isValid: associatedEmail
741
702
  }
742
- ) })
743
- ] }),
744
- children,
745
- /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
746
- /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
747
- LoadingIndicator,
703
+ }),
704
+ label: "Email",
705
+ sizes: "medium",
706
+ required: true,
707
+ error: !!errors.email,
708
+ helperText: errors.email?.message,
709
+ variant
710
+ }
711
+ ) }),
712
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
713
+ InputPhone,
714
+ {
715
+ id: "phone",
716
+ ...register("phone", { required: true, maxLength: 12 }),
717
+ label: "Phone Number",
718
+ sizes: "medium",
719
+ required: true,
720
+ error: !!errors.phone,
721
+ helperText: errors.phone?.message,
722
+ variant
723
+ }
724
+ ) })
725
+ ] }),
726
+ children,
727
+ /* @__PURE__ */ jsx("div", { className: disclosureForm({ variant }), children: disclosure }),
728
+ /* @__PURE__ */ jsx("div", { className: actions, children: isSubmitting ? /* @__PURE__ */ jsx(
729
+ LoadingIndicator,
730
+ {
731
+ style: { marginInline: "auto" },
732
+ variant
733
+ }
734
+ ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
735
+ /* @__PURE__ */ jsx(
736
+ "button",
737
+ {
738
+ type: "submit",
739
+ disabled: !isValid,
740
+ className: button({
741
+ color: "secondary",
742
+ size: "large",
743
+ rounded: "medium",
744
+ disabled: !isValid
745
+ }),
746
+ children: "Get My Rate"
747
+ }
748
+ ),
749
+ /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
750
+ /* @__PURE__ */ jsx(
751
+ "a",
748
752
  {
749
- style: { marginInline: "auto" },
750
- variant
753
+ id,
754
+ className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
755
+ onClick: isValid ? handleSubmit(async (data) => {
756
+ await onSubmit(data);
757
+ toggleModal();
758
+ setHideModal(false);
759
+ }) : (e) => {
760
+ e.preventDefault();
761
+ },
762
+ children: "Sign Up For Ratewatch"
751
763
  }
752
- ) : /* @__PURE__ */ jsxs("div", { className: formBtns, children: [
753
- /* @__PURE__ */ jsx(
754
- "button",
755
- {
756
- type: "submit",
757
- disabled: !isValid,
758
- className: button({
759
- color: "secondary",
760
- size: "large",
761
- rounded: "medium",
762
- disabled: !isValid
763
- }),
764
- children: "Get My Rate"
765
- }
766
- ),
767
- /* @__PURE__ */ jsxs("span", { className: `sc__btn ${chevron_wrapper}`, children: [
768
- /* @__PURE__ */ jsx(
769
- "a",
770
- {
771
- id,
772
- className: `${chevron({ variant })} ${!isValid ? na_cursor : ""}`,
773
- onClick: isValid ? handleSubmit(async (data) => {
774
- await onSubmit(data);
775
- toggleModal();
776
- setHideModal(false);
777
- }) : (e) => {
778
- e.preventDefault();
779
- },
780
- children: "Sign Up For Ratewatch"
781
- }
782
- ),
783
- /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
784
- ] })
785
- ] }) }),
786
- /* @__PURE__ */ jsx(HoneyPot, { register, variant })
787
- ]
788
- }
789
- )
764
+ ),
765
+ /* @__PURE__ */ jsx(SvgArrowIcon, { className: "arrow", variant: "tertiary" })
766
+ ] })
767
+ ] }) })
768
+ ] })
790
769
  ] }) })
791
770
  },
792
771
  id