@sikka/hawa 0.30.6-next → 0.30.8-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.
@@ -150,8 +150,8 @@ import { parsePhoneNumber } from "libphonenumber-js";
150
150
  import * as z from "zod";
151
151
  var LoginForm = ({
152
152
  loginType = "email",
153
- texts,
154
153
  passwordLength = 8,
154
+ texts,
155
155
  ...props
156
156
  }) => {
157
157
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
@@ -382,70 +382,80 @@ var LoginForm = ({
382
382
  break;
383
383
  }
384
384
  };
385
- return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React2.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React2.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React2.createElement(
386
- Alert,
387
- {
388
- direction: props.direction,
389
- title: props.errorTitle,
390
- text: props.errorText,
391
- severity: "error"
392
- }
393
- ), /* @__PURE__ */ React2.createElement(
394
- "form",
385
+ return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React2.createElement(
386
+ Card,
395
387
  {
396
- noValidate: true,
397
- className: "hawa-flex hawa-flex-col hawa-gap-4",
398
- onSubmit: handleSubmit((e) => {
399
- if (props.onLogin) {
400
- return props.onLogin(e);
401
- } else {
402
- console.log("Form is submitted but onLogin prop is missing");
403
- }
404
- })
388
+ dir: props.direction,
389
+ className: cn(
390
+ props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
391
+ )
405
392
  },
406
- renderFields(),
407
- /* @__PURE__ */ React2.createElement(
408
- Button,
393
+ /* @__PURE__ */ React2.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React2.createElement(
394
+ Alert,
409
395
  {
410
- className: "hawa-mt-0 hawa-w-full",
411
- type: "submit",
412
- isLoading: props.isLoading,
413
- disabled: props.isLoading
396
+ direction: props.direction,
397
+ title: props.errorTitle,
398
+ text: props.errorText,
399
+ severity: "error"
400
+ }
401
+ ), /* @__PURE__ */ React2.createElement(
402
+ "form",
403
+ {
404
+ noValidate: true,
405
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
406
+ onSubmit: handleSubmit((e) => {
407
+ if (props.onLogin) {
408
+ return props.onLogin(e);
409
+ } else {
410
+ console.log("Form is submitted but onLogin prop is missing");
411
+ }
412
+ })
414
413
  },
415
- (texts == null ? void 0 : texts.loginText) || "Login"
416
- ),
417
- props.additionalButtons,
418
- props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement(
419
- "span",
414
+ renderFields(),
415
+ /* @__PURE__ */ React2.createElement(
416
+ Button,
417
+ {
418
+ className: "hawa-mt-0 hawa-w-full",
419
+ type: "submit",
420
+ isLoading: props.isLoading,
421
+ disabled: props.isLoading
422
+ },
423
+ (texts == null ? void 0 : texts.loginText) || "Login"
424
+ ),
425
+ props.additionalButtons,
426
+ props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement(
427
+ "span",
428
+ {
429
+ onClick: props.onRouteToRegister,
430
+ className: "clickable-link"
431
+ },
432
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
433
+ ))
434
+ )),
435
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React2.createElement(
436
+ CardFooter,
420
437
  {
421
- onClick: props.onRouteToRegister,
422
- className: "clickable-link"
438
+ className: cn(
439
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
440
+ )
423
441
  },
424
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
425
- ))
426
- )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React2.createElement(
427
- CardFooter,
428
- {
429
- className: cn(
430
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
442
+ /* @__PURE__ */ React2.createElement(
443
+ AuthButtons,
444
+ {
445
+ texts: thirdPartyAuthTexts,
446
+ viaGoogle: props.viaGoogle,
447
+ viaGithub: props.viaGithub,
448
+ viaTwitter: props.viaTwitter,
449
+ isGoogleLoading: props.isGoogleLoading,
450
+ isGithubLoading: props.isGithubLoading,
451
+ isTwitterLoading: props.isTwitterLoading,
452
+ handleGoogle: props.onGoogleLogin,
453
+ handleGithub: props.onGithubLogin,
454
+ handleTwitter: props.onTwitterLogin
455
+ }
431
456
  )
432
- },
433
- /* @__PURE__ */ React2.createElement(
434
- AuthButtons,
435
- {
436
- texts: thirdPartyAuthTexts,
437
- viaGoogle: props.viaGoogle,
438
- viaGithub: props.viaGithub,
439
- viaTwitter: props.viaTwitter,
440
- isGoogleLoading: props.isGoogleLoading,
441
- isGithubLoading: props.isGithubLoading,
442
- isTwitterLoading: props.isTwitterLoading,
443
- handleGoogle: props.onGoogleLogin,
444
- handleGithub: props.onGithubLogin,
445
- handleTwitter: props.onTwitterLogin
446
- }
447
- )
448
- ) : null));
457
+ ) : null
458
+ ));
449
459
  };
450
460
 
451
461
  // blocks/auth/RegisterForm.tsx
@@ -534,292 +544,303 @@ var RegisterForm = ({
534
544
  (_g = props.classNames) == null ? void 0 : _g.root
535
545
  )
536
546
  },
537
- /* @__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(
538
- Alert,
539
- {
540
- direction: props.direction,
541
- title: props.errorTitle,
542
- text: props.errorText,
543
- severity: "error",
544
- onAlertClosed: () => {
545
- if (props.onErrorDismissed) {
546
- props.onErrorDismissed();
547
- }
548
- }
549
- }
550
- ), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
551
- "form",
547
+ /* @__PURE__ */ React3.createElement(
548
+ Card,
552
549
  {
553
- noValidate: true,
554
- onSubmit: handleSubmit((e) => {
555
- if (props.onRegister) {
556
- return props.onRegister(e);
557
- } else {
558
- console.log(
559
- "Form is submitted but onRegister prop is missing"
560
- );
561
- }
562
- }),
563
- className: "hawa-flex hawa-flex-col hawa-gap-4"
550
+ dir: props.direction,
551
+ className: cn(
552
+ (_h = props.classNames) == null ? void 0 : _h.card,
553
+ props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none hawa-drop-shadow-none"
554
+ )
564
555
  },
565
- /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
566
- if (fld === "fullname") {
567
- return /* @__PURE__ */ React3.createElement(
568
- Controller2,
569
- {
570
- key: i,
571
- control,
572
- name: "fullName",
573
- render: ({ field }) => {
574
- var _a2, _b2, _c2;
575
- return /* @__PURE__ */ React3.createElement(
576
- Input,
577
- {
578
- width: "full",
579
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
580
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
581
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
582
- ...field
583
- }
584
- );
585
- }
586
- }
587
- );
588
- }
589
- if (fld === "email") {
590
- return /* @__PURE__ */ React3.createElement(
591
- Controller2,
592
- {
593
- key: i,
594
- control,
595
- name: "email",
596
- render: ({ field }) => {
597
- var _a2, _b2, _c2;
598
- return /* @__PURE__ */ React3.createElement(
599
- Input,
600
- {
601
- dir: "ltr",
602
- inputProps: {
603
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
604
- },
605
- width: "full",
606
- autoComplete: "email",
607
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
608
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
609
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
610
- ...field
611
- }
612
- );
613
- }
614
- }
615
- );
616
- }
617
- if (fld === "username") {
618
- return /* @__PURE__ */ React3.createElement(
619
- Controller2,
620
- {
621
- key: i,
622
- control,
623
- name: "username",
624
- render: ({ field }) => {
625
- var _a2, _b2, _c2, _d2;
626
- return /* @__PURE__ */ React3.createElement(
627
- Input,
628
- {
629
- width: "full",
630
- autoComplete: "username",
631
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
632
- labelProps: {
633
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
634
- },
635
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
636
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
637
- ...field
638
- }
639
- );
640
- }
641
- }
642
- );
643
- }
644
- })),
645
- /* @__PURE__ */ React3.createElement(
646
- Controller2,
556
+ /* @__PURE__ */ React3.createElement(CardContent, { headless: true, noPadding: props.cardless }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
557
+ Alert,
647
558
  {
648
- control,
649
- name: "password",
650
- render: ({ field }) => {
651
- var _a2, _b2, _c2;
652
- return /* @__PURE__ */ React3.createElement(
653
- Input,
654
- {
655
- width: "full",
656
- type: passwordVisible ? "text" : "password",
657
- endIcon: /* @__PURE__ */ React3.createElement(
658
- "div",
659
- {
660
- className: "hawa-cursor-pointer",
661
- onClick: () => setPasswordVisible(!passwordVisible)
662
- },
663
- passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
664
- " "
665
- ),
666
- autoComplete: "new-password",
667
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
668
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
669
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
670
- ...field
671
- }
672
- );
559
+ direction: props.direction,
560
+ title: props.errorTitle,
561
+ text: props.errorText,
562
+ severity: "error",
563
+ onAlertClosed: () => {
564
+ if (props.onErrorDismissed) {
565
+ props.onErrorDismissed();
566
+ }
673
567
  }
674
568
  }
675
- ),
676
- /* @__PURE__ */ React3.createElement(
677
- Controller2,
569
+ ), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
570
+ "form",
678
571
  {
679
- control,
680
- name: "confirm_password",
681
- render: ({ field }) => {
682
- var _a2, _b2, _c2;
572
+ noValidate: true,
573
+ onSubmit: handleSubmit((e) => {
574
+ if (props.onRegister) {
575
+ return props.onRegister(e);
576
+ } else {
577
+ console.log(
578
+ "Form is submitted but onRegister prop is missing"
579
+ );
580
+ }
581
+ }),
582
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
583
+ },
584
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
585
+ if (fld === "fullname") {
683
586
  return /* @__PURE__ */ React3.createElement(
684
- Input,
587
+ Controller2,
685
588
  {
686
- width: "full",
687
- type: "password",
688
- autoComplete: "new-password",
689
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
690
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
691
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
692
- ...field
589
+ key: i,
590
+ control,
591
+ name: "fullName",
592
+ render: ({ field }) => {
593
+ var _a2, _b2, _c2;
594
+ return /* @__PURE__ */ React3.createElement(
595
+ Input,
596
+ {
597
+ width: "full",
598
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
599
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
600
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
601
+ ...field
602
+ }
603
+ );
604
+ }
693
605
  }
694
606
  );
695
607
  }
696
- }
697
- ),
698
- props.additionalInputs,
699
- props.showRefCode && /* @__PURE__ */ React3.createElement(
700
- Controller2,
701
- {
702
- control,
703
- name: "refCode",
704
- render: ({ field }) => {
705
- var _a2;
608
+ if (fld === "email") {
706
609
  return /* @__PURE__ */ React3.createElement(
707
- Input,
610
+ Controller2,
708
611
  {
709
- width: "full",
710
- label: texts == null ? void 0 : texts.refCode,
711
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
712
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
713
- ...field
612
+ key: i,
613
+ control,
614
+ name: "email",
615
+ render: ({ field }) => {
616
+ var _a2, _b2, _c2;
617
+ return /* @__PURE__ */ React3.createElement(
618
+ Input,
619
+ {
620
+ dir: "ltr",
621
+ inputProps: {
622
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
623
+ },
624
+ width: "full",
625
+ autoComplete: "email",
626
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
627
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
628
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
629
+ ...field
630
+ }
631
+ );
632
+ }
714
633
  }
715
634
  );
716
635
  }
717
- }
718
- ),
719
- props.showUserSource && /* @__PURE__ */ React3.createElement(
720
- Controller2,
721
- {
722
- control,
723
- name: "reference",
724
- render: ({ field }) => {
725
- var _a2, _b2;
636
+ if (fld === "username") {
726
637
  return /* @__PURE__ */ React3.createElement(
727
- Select,
638
+ Controller2,
728
639
  {
729
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
730
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
731
- isCreatable: false,
732
- isMulti: false,
733
- isSearchable: false,
734
- isClearable: false,
735
- options: props.userReferenceOptions,
736
- onChange: (e) => {
737
- field.onChange(e.value);
640
+ key: i,
641
+ control,
642
+ name: "username",
643
+ render: ({ field }) => {
644
+ var _a2, _b2, _c2, _d2;
645
+ return /* @__PURE__ */ React3.createElement(
646
+ Input,
647
+ {
648
+ width: "full",
649
+ autoComplete: "username",
650
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
651
+ labelProps: {
652
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
653
+ },
654
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
655
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
656
+ ...field
657
+ }
658
+ );
738
659
  }
739
660
  }
740
661
  );
741
662
  }
742
- }
743
- ),
744
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
745
- Controller2,
746
- {
747
- control,
748
- name: "terms_accepted",
749
- render: ({ field }) => {
750
- var _a2, _b2;
751
- return /* @__PURE__ */ React3.createElement(
663
+ })),
664
+ /* @__PURE__ */ React3.createElement(
665
+ Controller2,
666
+ {
667
+ control,
668
+ name: "password",
669
+ render: ({ field }) => {
670
+ var _a2, _b2, _c2;
671
+ return /* @__PURE__ */ React3.createElement(
672
+ Input,
673
+ {
674
+ width: "full",
675
+ type: passwordVisible ? "text" : "password",
676
+ endIcon: /* @__PURE__ */ React3.createElement(
677
+ "div",
678
+ {
679
+ className: "hawa-cursor-pointer",
680
+ onClick: () => setPasswordVisible(!passwordVisible)
681
+ },
682
+ passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
683
+ " "
684
+ ),
685
+ autoComplete: "new-password",
686
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
687
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
688
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
689
+ ...field
690
+ }
691
+ );
692
+ }
693
+ }
694
+ ),
695
+ /* @__PURE__ */ React3.createElement(
696
+ Controller2,
697
+ {
698
+ control,
699
+ name: "confirm_password",
700
+ render: ({ field }) => {
701
+ var _a2, _b2, _c2;
702
+ return /* @__PURE__ */ React3.createElement(
703
+ Input,
704
+ {
705
+ width: "full",
706
+ type: "password",
707
+ autoComplete: "new-password",
708
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
709
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
710
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
711
+ ...field
712
+ }
713
+ );
714
+ }
715
+ }
716
+ ),
717
+ props.additionalInputs,
718
+ props.showRefCode && /* @__PURE__ */ React3.createElement(
719
+ Controller2,
720
+ {
721
+ control,
722
+ name: "refCode",
723
+ render: ({ field }) => {
724
+ var _a2;
725
+ return /* @__PURE__ */ React3.createElement(
726
+ Input,
727
+ {
728
+ width: "full",
729
+ label: texts == null ? void 0 : texts.refCode,
730
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
731
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
732
+ ...field
733
+ }
734
+ );
735
+ }
736
+ }
737
+ ),
738
+ props.showUserSource && /* @__PURE__ */ React3.createElement(
739
+ Controller2,
740
+ {
741
+ control,
742
+ name: "reference",
743
+ render: ({ field }) => {
744
+ var _a2, _b2;
745
+ return /* @__PURE__ */ React3.createElement(
746
+ Select,
747
+ {
748
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
749
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
750
+ isCreatable: false,
751
+ isMulti: false,
752
+ isSearchable: false,
753
+ isClearable: false,
754
+ options: props.userReferenceOptions,
755
+ onChange: (e) => {
756
+ field.onChange(e.value);
757
+ }
758
+ }
759
+ );
760
+ }
761
+ }
762
+ ),
763
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React3.createElement(
764
+ Controller2,
765
+ {
766
+ control,
767
+ name: "terms_accepted",
768
+ render: ({ field }) => {
769
+ var _a2, _b2;
770
+ return /* @__PURE__ */ React3.createElement(
771
+ Checkbox,
772
+ {
773
+ id: "terms_accepted",
774
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
775
+ onCheckedChange: (e) => field.onChange(e),
776
+ label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
777
+ "span",
778
+ {
779
+ onClick: (e) => {
780
+ e.preventDefault();
781
+ if (props.onRouteToTOS) {
782
+ props.onRouteToTOS();
783
+ }
784
+ },
785
+ className: "clickable-link"
786
+ },
787
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
788
+ )))
789
+ }
790
+ );
791
+ }
792
+ }
793
+ ), showNewsletterOption && /* @__PURE__ */ React3.createElement(
794
+ Controller2,
795
+ {
796
+ control,
797
+ name: "newsletter_accepted",
798
+ render: ({ field }) => /* @__PURE__ */ React3.createElement(
752
799
  Checkbox,
753
800
  {
754
- id: "terms_accepted",
755
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
756
- onCheckedChange: (e) => field.onChange(e),
757
- label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
758
- "span",
759
- {
760
- onClick: (e) => {
761
- e.preventDefault();
762
- if (props.onRouteToTOS) {
763
- props.onRouteToTOS();
764
- }
765
- },
766
- className: "clickable-link"
767
- },
768
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
769
- )))
801
+ id: "newsletter_accepted",
802
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
803
+ onCheckedChange: field.onChange
770
804
  }
771
- );
805
+ )
772
806
  }
773
- }
774
- ), showNewsletterOption && /* @__PURE__ */ React3.createElement(
775
- Controller2,
807
+ )) : null,
808
+ /* @__PURE__ */ React3.createElement(
809
+ Button,
810
+ {
811
+ className: " hawa-w-full",
812
+ type: "submit",
813
+ isLoading: props.isLoading,
814
+ disabled: props.isLoading
815
+ },
816
+ (texts == null ? void 0 : texts.registerText) || "Register"
817
+ ),
818
+ props.additionalButtons
819
+ )), /* @__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")))),
820
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
821
+ CardFooter,
776
822
  {
777
- control,
778
- name: "newsletter_accepted",
779
- render: ({ field }) => /* @__PURE__ */ React3.createElement(
780
- Checkbox,
781
- {
782
- id: "newsletter_accepted",
783
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
784
- onCheckedChange: field.onChange
785
- }
823
+ className: cn(
824
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
786
825
  )
787
- }
788
- )) : null,
789
- /* @__PURE__ */ React3.createElement(
790
- Button,
791
- {
792
- className: " hawa-w-full",
793
- type: "submit",
794
- isLoading: props.isLoading,
795
- disabled: props.isLoading
796
826
  },
797
- (texts == null ? void 0 : texts.registerText) || "Register"
798
- ),
799
- props.additionalButtons
800
- )), /* @__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(
801
- CardFooter,
802
- {
803
- className: cn(
804
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
827
+ /* @__PURE__ */ React3.createElement(
828
+ AuthButtons,
829
+ {
830
+ texts: thirdPartyAuthTexts,
831
+ viaGoogle: props.viaGoogle,
832
+ viaGithub: props.viaGithub,
833
+ viaTwitter: props.viaTwitter,
834
+ isGoogleLoading: props.isGoogleLoading,
835
+ isGithubLoading: props.isGithubLoading,
836
+ isTwitterLoading: props.isTwitterLoading,
837
+ handleGoogle: props.onGoogleRegister,
838
+ handleGithub: props.onGithubRegister,
839
+ handleTwitter: props.onTwitterRegister
840
+ }
805
841
  )
806
- },
807
- /* @__PURE__ */ React3.createElement(
808
- AuthButtons,
809
- {
810
- texts: thirdPartyAuthTexts,
811
- viaGoogle: props.viaGoogle,
812
- viaGithub: props.viaGithub,
813
- viaTwitter: props.viaTwitter,
814
- isGoogleLoading: props.isGoogleLoading,
815
- isGithubLoading: props.isGithubLoading,
816
- isTwitterLoading: props.isTwitterLoading,
817
- handleGoogle: props.onGoogleRegister,
818
- handleGithub: props.onGithubRegister,
819
- handleTwitter: props.onTwitterRegister
820
- }
821
- )
822
- ) : null)
842
+ ) : null
843
+ )
823
844
  );
824
845
  };
825
846