@sikka/hawa 0.27.19-next → 0.27.21-next

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.
@@ -442,7 +442,7 @@ var RegisterForm = ({
442
442
  showNewsletterOption = false,
443
443
  ...props
444
444
  }) => {
445
- var _a, _b, _c, _d, _e, _f;
445
+ var _a, _b, _c, _d, _e, _f, _g, _h;
446
446
  const [passwordVisible, setPasswordVisible] = useState2(false);
447
447
  const thirdPartyAuthTexts = {
448
448
  continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
@@ -508,281 +508,290 @@ var RegisterForm = ({
508
508
  const { handleSubmit, control, formState } = useForm2({
509
509
  resolver: zodResolver2(formSchema)
510
510
  });
511
- return /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React3.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React3.createElement(CardContent, { headless: true }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
512
- Alert,
513
- {
514
- title: props.errorTitle,
515
- text: props.errorText,
516
- severity: "error"
517
- }
518
- ), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
519
- "form",
511
+ return /* @__PURE__ */ React3.createElement(
512
+ "div",
520
513
  {
521
- noValidate: true,
522
- onSubmit: handleSubmit((e) => {
523
- if (props.onRegister) {
524
- return props.onRegister(e);
525
- } else {
526
- console.log(
527
- "Form is submitted but onRegister prop is missing"
528
- );
529
- }
530
- }),
531
- className: "hawa-flex hawa-flex-col hawa-gap-4"
514
+ className: cn(
515
+ "hawa-flex hawa-flex-col hawa-gap-4",
516
+ (_g = props.classNames) == null ? void 0 : _g.root
517
+ )
532
518
  },
533
- /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
534
- if (fld === "fullname") {
535
- return /* @__PURE__ */ React3.createElement(
536
- Controller2,
537
- {
538
- key: i,
539
- control,
540
- name: "fullName",
541
- render: ({ field }) => {
542
- var _a2, _b2, _c2;
543
- return /* @__PURE__ */ React3.createElement(
544
- Input,
545
- {
546
- width: "full",
547
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
548
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
549
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
550
- ...field
551
- }
552
- );
553
- }
554
- }
555
- );
556
- }
557
- if (fld === "email") {
558
- return /* @__PURE__ */ React3.createElement(
559
- Controller2,
560
- {
561
- key: i,
562
- control,
563
- name: "email",
564
- render: ({ field }) => {
565
- var _a2, _b2, _c2;
566
- return /* @__PURE__ */ React3.createElement(
567
- Input,
568
- {
569
- dir: "ltr",
570
- inputProps: {
571
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
572
- },
573
- width: "full",
574
- autoComplete: "email",
575
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
576
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
577
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
578
- ...field
579
- }
580
- );
581
- }
582
- }
583
- );
584
- }
585
- if (fld === "username") {
586
- return /* @__PURE__ */ React3.createElement(
587
- Controller2,
588
- {
589
- key: i,
590
- control,
591
- name: "username",
592
- render: ({ field }) => {
593
- var _a2, _b2, _c2, _d2;
594
- return /* @__PURE__ */ React3.createElement(
595
- Input,
596
- {
597
- width: "full",
598
- autoComplete: "username",
599
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
600
- labelProps: {
601
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
602
- },
603
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
604
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
605
- ...field
606
- }
607
- );
608
- }
609
- }
610
- );
611
- }
612
- })),
613
- /* @__PURE__ */ React3.createElement(
614
- Controller2,
519
+ /* @__PURE__ */ React3.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ React3.createElement(CardContent, { headless: true }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
520
+ Alert,
615
521
  {
616
- control,
617
- name: "password",
618
- render: ({ field }) => {
619
- var _a2, _b2, _c2;
620
- return /* @__PURE__ */ React3.createElement(
621
- Input,
622
- {
623
- width: "full",
624
- type: passwordVisible ? "text" : "password",
625
- endIcon: /* @__PURE__ */ React3.createElement(
626
- "div",
627
- {
628
- className: "hawa-cursor-pointer",
629
- onClick: () => setPasswordVisible(!passwordVisible)
630
- },
631
- passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
632
- " "
633
- ),
634
- autoComplete: "new-password",
635
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
636
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
637
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
638
- ...field
639
- }
640
- );
641
- }
522
+ title: props.errorTitle,
523
+ text: props.errorText,
524
+ severity: "error"
642
525
  }
643
- ),
644
- /* @__PURE__ */ React3.createElement(
645
- Controller2,
526
+ ), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
527
+ "form",
646
528
  {
647
- control,
648
- name: "confirm_password",
649
- render: ({ field }) => {
650
- var _a2, _b2, _c2;
529
+ noValidate: true,
530
+ onSubmit: handleSubmit((e) => {
531
+ if (props.onRegister) {
532
+ return props.onRegister(e);
533
+ } else {
534
+ console.log(
535
+ "Form is submitted but onRegister prop is missing"
536
+ );
537
+ }
538
+ }),
539
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
540
+ },
541
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
542
+ if (fld === "fullname") {
651
543
  return /* @__PURE__ */ React3.createElement(
652
- Input,
544
+ Controller2,
653
545
  {
654
- width: "full",
655
- type: "password",
656
- autoComplete: "new-password",
657
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
658
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
659
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
660
- ...field
546
+ key: i,
547
+ control,
548
+ name: "fullName",
549
+ render: ({ field }) => {
550
+ var _a2, _b2, _c2;
551
+ return /* @__PURE__ */ React3.createElement(
552
+ Input,
553
+ {
554
+ width: "full",
555
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
556
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
557
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
558
+ ...field
559
+ }
560
+ );
561
+ }
661
562
  }
662
563
  );
663
564
  }
664
- }
665
- ),
666
- props.additionalInputs,
667
- props.showRefCode && /* @__PURE__ */ React3.createElement(
668
- Controller2,
669
- {
670
- control,
671
- name: "refCode",
672
- render: ({ field }) => {
673
- var _a2;
565
+ if (fld === "email") {
674
566
  return /* @__PURE__ */ React3.createElement(
675
- Input,
567
+ Controller2,
676
568
  {
677
- width: "full",
678
- label: texts == null ? void 0 : texts.refCode,
679
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
680
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
681
- ...field
569
+ key: i,
570
+ control,
571
+ name: "email",
572
+ render: ({ field }) => {
573
+ var _a2, _b2, _c2;
574
+ return /* @__PURE__ */ React3.createElement(
575
+ Input,
576
+ {
577
+ dir: "ltr",
578
+ inputProps: {
579
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
580
+ },
581
+ width: "full",
582
+ autoComplete: "email",
583
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
584
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
585
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
586
+ ...field
587
+ }
588
+ );
589
+ }
682
590
  }
683
591
  );
684
592
  }
685
- }
686
- ),
687
- props.showUserSource && /* @__PURE__ */ React3.createElement(
688
- Controller2,
689
- {
690
- control,
691
- name: "reference",
692
- render: ({ field }) => {
693
- var _a2, _b2;
593
+ if (fld === "username") {
694
594
  return /* @__PURE__ */ React3.createElement(
695
- Select,
595
+ Controller2,
696
596
  {
697
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
698
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
699
- isCreatable: false,
700
- isMulti: false,
701
- isSearchable: false,
702
- isClearable: false,
703
- options: props.userReferenceOptions,
704
- onChange: (e) => {
705
- field.onChange(e.value);
597
+ key: i,
598
+ control,
599
+ name: "username",
600
+ render: ({ field }) => {
601
+ var _a2, _b2, _c2, _d2;
602
+ return /* @__PURE__ */ React3.createElement(
603
+ Input,
604
+ {
605
+ width: "full",
606
+ autoComplete: "username",
607
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
608
+ labelProps: {
609
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
610
+ },
611
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
612
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
613
+ ...field
614
+ }
615
+ );
706
616
  }
707
617
  }
708
618
  );
709
619
  }
710
- }
711
- ),
712
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
713
- Controller2,
714
- {
715
- control,
716
- name: "terms_accepted",
717
- render: ({ field }) => {
718
- var _a2, _b2;
719
- return /* @__PURE__ */ React3.createElement(
620
+ })),
621
+ /* @__PURE__ */ React3.createElement(
622
+ Controller2,
623
+ {
624
+ control,
625
+ name: "password",
626
+ render: ({ field }) => {
627
+ var _a2, _b2, _c2;
628
+ return /* @__PURE__ */ React3.createElement(
629
+ Input,
630
+ {
631
+ width: "full",
632
+ type: passwordVisible ? "text" : "password",
633
+ endIcon: /* @__PURE__ */ React3.createElement(
634
+ "div",
635
+ {
636
+ className: "hawa-cursor-pointer",
637
+ onClick: () => setPasswordVisible(!passwordVisible)
638
+ },
639
+ passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
640
+ " "
641
+ ),
642
+ autoComplete: "new-password",
643
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
644
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
645
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
646
+ ...field
647
+ }
648
+ );
649
+ }
650
+ }
651
+ ),
652
+ /* @__PURE__ */ React3.createElement(
653
+ Controller2,
654
+ {
655
+ control,
656
+ name: "confirm_password",
657
+ render: ({ field }) => {
658
+ var _a2, _b2, _c2;
659
+ return /* @__PURE__ */ React3.createElement(
660
+ Input,
661
+ {
662
+ width: "full",
663
+ type: "password",
664
+ autoComplete: "new-password",
665
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
666
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
667
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
668
+ ...field
669
+ }
670
+ );
671
+ }
672
+ }
673
+ ),
674
+ props.additionalInputs,
675
+ props.showRefCode && /* @__PURE__ */ React3.createElement(
676
+ Controller2,
677
+ {
678
+ control,
679
+ name: "refCode",
680
+ render: ({ field }) => {
681
+ var _a2;
682
+ return /* @__PURE__ */ React3.createElement(
683
+ Input,
684
+ {
685
+ width: "full",
686
+ label: texts == null ? void 0 : texts.refCode,
687
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
688
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
689
+ ...field
690
+ }
691
+ );
692
+ }
693
+ }
694
+ ),
695
+ props.showUserSource && /* @__PURE__ */ React3.createElement(
696
+ Controller2,
697
+ {
698
+ control,
699
+ name: "reference",
700
+ render: ({ field }) => {
701
+ var _a2, _b2;
702
+ return /* @__PURE__ */ React3.createElement(
703
+ Select,
704
+ {
705
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
706
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
707
+ isCreatable: false,
708
+ isMulti: false,
709
+ isSearchable: false,
710
+ isClearable: false,
711
+ options: props.userReferenceOptions,
712
+ onChange: (e) => {
713
+ field.onChange(e.value);
714
+ }
715
+ }
716
+ );
717
+ }
718
+ }
719
+ ),
720
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
721
+ Controller2,
722
+ {
723
+ control,
724
+ name: "terms_accepted",
725
+ render: ({ field }) => {
726
+ var _a2, _b2;
727
+ return /* @__PURE__ */ React3.createElement(
728
+ Checkbox,
729
+ {
730
+ id: "terms_accepted",
731
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
732
+ onCheckedChange: (e) => field.onChange(e),
733
+ label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.iAcceptText) || "I accept the "), " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
734
+ "a",
735
+ {
736
+ onClick: props.onRouteToTOS,
737
+ className: "clickable-link"
738
+ },
739
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
740
+ )))
741
+ }
742
+ );
743
+ }
744
+ }
745
+ ), showNewsletterOption && /* @__PURE__ */ React3.createElement(
746
+ Controller2,
747
+ {
748
+ control,
749
+ name: "newsletter_accepted",
750
+ render: ({ field }) => /* @__PURE__ */ React3.createElement(
720
751
  Checkbox,
721
752
  {
722
- id: "terms_accepted",
723
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
724
- onCheckedChange: (e) => field.onChange(e),
725
- label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.iAcceptText) || "I accept the "), " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
726
- "a",
727
- {
728
- onClick: props.onRouteToTOS,
729
- className: "clickable-link"
730
- },
731
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
732
- )))
753
+ id: "newsletter_accepted",
754
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
755
+ onCheckedChange: field.onChange
733
756
  }
734
- );
757
+ )
735
758
  }
736
- }
737
- ), showNewsletterOption && /* @__PURE__ */ React3.createElement(
738
- Controller2,
759
+ )) : null,
760
+ /* @__PURE__ */ React3.createElement(
761
+ Button,
762
+ {
763
+ className: " hawa-w-full",
764
+ type: "submit",
765
+ isLoading: props.isLoading,
766
+ disabled: props.isLoading
767
+ },
768
+ (texts == null ? void 0 : texts.registerText) || "Register"
769
+ ),
770
+ props.additionalButtons
771
+ )), /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
772
+ CardFooter,
739
773
  {
740
- control,
741
- name: "newsletter_accepted",
742
- render: ({ field }) => /* @__PURE__ */ React3.createElement(
743
- Checkbox,
744
- {
745
- id: "newsletter_accepted",
746
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
747
- onCheckedChange: field.onChange
748
- }
774
+ className: cn(
775
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
749
776
  )
750
- }
751
- )) : null,
752
- /* @__PURE__ */ React3.createElement(
753
- Button,
754
- {
755
- className: " hawa-w-full",
756
- type: "submit",
757
- isLoading: props.isLoading,
758
- disabled: props.isLoading
759
777
  },
760
- (texts == null ? void 0 : texts.registerText) || "Register"
761
- ),
762
- props.additionalButtons
763
- )), /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
764
- CardFooter,
765
- {
766
- className: cn(
767
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
778
+ /* @__PURE__ */ React3.createElement(
779
+ AuthButtons,
780
+ {
781
+ texts: thirdPartyAuthTexts,
782
+ viaGoogle: props.viaGoogle,
783
+ viaGithub: props.viaGithub,
784
+ viaTwitter: props.viaTwitter,
785
+ isGoogleLoading: props.isGoogleLoading,
786
+ isGithubLoading: props.isGithubLoading,
787
+ isTwitterLoading: props.isTwitterLoading,
788
+ handleGoogle: props.onGoogleRegister,
789
+ handleGithub: props.onGithubRegister,
790
+ handleTwitter: props.onTwitterRegister
791
+ }
768
792
  )
769
- },
770
- /* @__PURE__ */ React3.createElement(
771
- AuthButtons,
772
- {
773
- texts: thirdPartyAuthTexts,
774
- viaGoogle: props.viaGoogle,
775
- viaGithub: props.viaGithub,
776
- viaTwitter: props.viaTwitter,
777
- isGoogleLoading: props.isGoogleLoading,
778
- isGithubLoading: props.isGithubLoading,
779
- isTwitterLoading: props.isTwitterLoading,
780
- handleGoogle: props.onGoogleRegister,
781
- handleGithub: props.onGithubRegister,
782
- handleTwitter: props.onTwitterRegister
783
- }
784
- )
785
- ) : null));
793
+ ) : null)
794
+ );
786
795
  };
787
796
 
788
797
  // blocks/auth/AppLanding.tsx
@@ -1738,7 +1747,7 @@ var ContactForm = ({
1738
1747
  size = "default",
1739
1748
  texts,
1740
1749
  formId,
1741
- formAutoComplete,
1750
+ formAutoComplete = "off",
1742
1751
  onSubmit,
1743
1752
  customFields
1744
1753
  }) => {
@@ -1765,9 +1774,11 @@ var ContactForm = ({
1765
1774
  )
1766
1775
  });
1767
1776
  const contactFormSchema = z8.object({
1768
- name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
1769
- email: z8.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }).default(""),
1770
- message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
1777
+ name: z8.string({ required_error: (texts == null ? void 0 : texts.name.required) || "Name is required" }).min(1, (texts == null ? void 0 : texts.name.required) || "Name is required").default(""),
1778
+ email: z8.string({ required_error: ((_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required) || "Email is required" }).min(1, { message: ((_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required) || "Email is required" }).email({ message: ((_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid) || "Invalid email" }).default(""),
1779
+ message: z8.string({
1780
+ required_error: (texts == null ? void 0 : texts.message.required) || "Message is required"
1781
+ }).min(10, (texts == null ? void 0 : texts.message.invalid) || "Message is too short").default("")
1771
1782
  });
1772
1783
  const customFieldsDefaultValues = customFields == null ? void 0 : customFields.reduce(
1773
1784
  (acc, curr) => {
@@ -1838,7 +1849,7 @@ var ContactForm = ({
1838
1849
  return /* @__PURE__ */ React20.createElement(
1839
1850
  Input,
1840
1851
  {
1841
- label: texts == null ? void 0 : texts.name.label,
1852
+ label: (texts == null ? void 0 : texts.name.label) || "Name",
1842
1853
  id: texts == null ? void 0 : texts.name.label,
1843
1854
  ...field,
1844
1855
  placeholder: texts == null ? void 0 : texts.name.placeholder,
@@ -1858,7 +1869,7 @@ var ContactForm = ({
1858
1869
  return /* @__PURE__ */ React20.createElement(
1859
1870
  Input,
1860
1871
  {
1861
- label: texts == null ? void 0 : texts.email.label,
1872
+ label: (texts == null ? void 0 : texts.email.label) || "Email",
1862
1873
  id: texts == null ? void 0 : texts.email.label,
1863
1874
  ...field,
1864
1875
  placeholder: texts == null ? void 0 : texts.email.placeholder,
@@ -1918,7 +1929,7 @@ var ContactForm = ({
1918
1929
  return /* @__PURE__ */ React20.createElement(
1919
1930
  Textarea,
1920
1931
  {
1921
- label: texts == null ? void 0 : texts.message.label,
1932
+ label: (texts == null ? void 0 : texts.message.label) || "Message",
1922
1933
  id: texts == null ? void 0 : texts.message.label,
1923
1934
  textareaProps: {
1924
1935
  placeholder: texts == null ? void 0 : texts.message.placeholder,
@@ -86,14 +86,14 @@ type ContactFormProps = {
86
86
  formId?: string;
87
87
  formAutoComplete?: "on" | "off";
88
88
  size?: "sm" | "default";
89
- onSubmit?: (e: ContactFormData) => void;
89
+ onSubmit: (e: ContactFormData) => void;
90
+ customFields?: CustomField[];
90
91
  texts?: {
91
92
  submit: string;
92
93
  name: TextInputType;
93
94
  email: TextInputType;
94
95
  message: TextInputType;
95
96
  };
96
- customFields?: CustomField[];
97
97
  };
98
98
  declare const ContactForm: React__default.FC<ContactFormProps>;
99
99
 
@@ -86,14 +86,14 @@ type ContactFormProps = {
86
86
  formId?: string;
87
87
  formAutoComplete?: "on" | "off";
88
88
  size?: "sm" | "default";
89
- onSubmit?: (e: ContactFormData) => void;
89
+ onSubmit: (e: ContactFormData) => void;
90
+ customFields?: CustomField[];
90
91
  texts?: {
91
92
  submit: string;
92
93
  name: TextInputType;
93
94
  email: TextInputType;
94
95
  message: TextInputType;
95
96
  };
96
- customFields?: CustomField[];
97
97
  };
98
98
  declare const ContactForm: React__default.FC<ContactFormProps>;
99
99