@sikka/hawa 0.30.5-next → 0.30.7-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.
@@ -841,7 +841,7 @@ var Alert = ({
841
841
  oceanic: ""
842
842
  };
843
843
  let styleVariant = {
844
- none: "hawa-text-gray-700 hawa-bg-gray-100 dark:hawa-bg-gray-900 ",
844
+ none: "hawa-bg-background hawa-border",
845
845
  info: "hawa-text-info-foreground hawa-bg-info/90",
846
846
  warning: "hawa-text-warning-foreground hawa-bg-warning/90",
847
847
  error: "hawa-text-destructive-foreground hawa-bg-destructive/90",
@@ -3284,8 +3284,8 @@ var import_react12 = __toESM(require("react"));
3284
3284
  // blocks/auth/LoginForm.tsx
3285
3285
  var LoginForm = ({
3286
3286
  loginType = "email",
3287
- texts,
3288
3287
  passwordLength = 8,
3288
+ texts,
3289
3289
  ...props
3290
3290
  }) => {
3291
3291
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
@@ -3516,70 +3516,80 @@ var LoginForm = ({
3516
3516
  break;
3517
3517
  }
3518
3518
  };
3519
- return /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ import_react13.default.createElement(Card, { dir: props.direction }, /* @__PURE__ */ import_react13.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react13.default.createElement(
3520
- Alert,
3521
- {
3522
- direction: props.direction,
3523
- title: props.errorTitle,
3524
- text: props.errorText,
3525
- severity: "error"
3526
- }
3527
- ), /* @__PURE__ */ import_react13.default.createElement(
3528
- "form",
3519
+ return /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ import_react13.default.createElement(
3520
+ Card,
3529
3521
  {
3530
- noValidate: true,
3531
- className: "hawa-flex hawa-flex-col hawa-gap-4",
3532
- onSubmit: handleSubmit((e) => {
3533
- if (props.onLogin) {
3534
- return props.onLogin(e);
3535
- } else {
3536
- console.log("Form is submitted but onLogin prop is missing");
3537
- }
3538
- })
3522
+ dir: props.direction,
3523
+ className: cn(
3524
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
3525
+ )
3539
3526
  },
3540
- renderFields(),
3541
- /* @__PURE__ */ import_react13.default.createElement(
3542
- Button,
3527
+ /* @__PURE__ */ import_react13.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react13.default.createElement(
3528
+ Alert,
3543
3529
  {
3544
- className: "hawa-mt-0 hawa-w-full",
3545
- type: "submit",
3546
- isLoading: props.isLoading,
3547
- disabled: props.isLoading
3530
+ direction: props.direction,
3531
+ title: props.errorTitle,
3532
+ text: props.errorText,
3533
+ severity: "error"
3534
+ }
3535
+ ), /* @__PURE__ */ import_react13.default.createElement(
3536
+ "form",
3537
+ {
3538
+ noValidate: true,
3539
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
3540
+ onSubmit: handleSubmit((e) => {
3541
+ if (props.onLogin) {
3542
+ return props.onLogin(e);
3543
+ } else {
3544
+ console.log("Form is submitted but onLogin prop is missing");
3545
+ }
3546
+ })
3548
3547
  },
3549
- (texts == null ? void 0 : texts.loginText) || "Login"
3550
- ),
3551
- props.additionalButtons,
3552
- props.allowRegister && /* @__PURE__ */ import_react13.default.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__ */ import_react13.default.createElement(
3553
- "span",
3548
+ renderFields(),
3549
+ /* @__PURE__ */ import_react13.default.createElement(
3550
+ Button,
3551
+ {
3552
+ className: "hawa-mt-0 hawa-w-full",
3553
+ type: "submit",
3554
+ isLoading: props.isLoading,
3555
+ disabled: props.isLoading
3556
+ },
3557
+ (texts == null ? void 0 : texts.loginText) || "Login"
3558
+ ),
3559
+ props.additionalButtons,
3560
+ props.allowRegister && /* @__PURE__ */ import_react13.default.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__ */ import_react13.default.createElement(
3561
+ "span",
3562
+ {
3563
+ onClick: props.onRouteToRegister,
3564
+ className: "clickable-link"
3565
+ },
3566
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
3567
+ ))
3568
+ )),
3569
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react13.default.createElement(
3570
+ CardFooter,
3554
3571
  {
3555
- onClick: props.onRouteToRegister,
3556
- className: "clickable-link"
3572
+ className: cn(
3573
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
3574
+ )
3557
3575
  },
3558
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
3559
- ))
3560
- )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react13.default.createElement(
3561
- CardFooter,
3562
- {
3563
- className: cn(
3564
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
3576
+ /* @__PURE__ */ import_react13.default.createElement(
3577
+ AuthButtons,
3578
+ {
3579
+ texts: thirdPartyAuthTexts,
3580
+ viaGoogle: props.viaGoogle,
3581
+ viaGithub: props.viaGithub,
3582
+ viaTwitter: props.viaTwitter,
3583
+ isGoogleLoading: props.isGoogleLoading,
3584
+ isGithubLoading: props.isGithubLoading,
3585
+ isTwitterLoading: props.isTwitterLoading,
3586
+ handleGoogle: props.onGoogleLogin,
3587
+ handleGithub: props.onGithubLogin,
3588
+ handleTwitter: props.onTwitterLogin
3589
+ }
3565
3590
  )
3566
- },
3567
- /* @__PURE__ */ import_react13.default.createElement(
3568
- AuthButtons,
3569
- {
3570
- texts: thirdPartyAuthTexts,
3571
- viaGoogle: props.viaGoogle,
3572
- viaGithub: props.viaGithub,
3573
- viaTwitter: props.viaTwitter,
3574
- isGoogleLoading: props.isGoogleLoading,
3575
- isGithubLoading: props.isGithubLoading,
3576
- isTwitterLoading: props.isTwitterLoading,
3577
- handleGoogle: props.onGoogleLogin,
3578
- handleGithub: props.onGithubLogin,
3579
- handleTwitter: props.onTwitterLogin
3580
- }
3581
- )
3582
- ) : null));
3591
+ ) : null
3592
+ ));
3583
3593
  };
3584
3594
 
3585
3595
  // blocks/auth/RegisterForm.tsx
@@ -3815,292 +3825,303 @@ var RegisterForm = ({
3815
3825
  (_g = props.classNames) == null ? void 0 : _g.root
3816
3826
  )
3817
3827
  },
3818
- /* @__PURE__ */ import_react15.default.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ import_react15.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
3819
- Alert,
3820
- {
3821
- direction: props.direction,
3822
- title: props.errorTitle,
3823
- text: props.errorText,
3824
- severity: "error",
3825
- onAlertClosed: () => {
3826
- if (props.onErrorDismissed) {
3827
- props.onErrorDismissed();
3828
- }
3829
- }
3830
- }
3831
- ), /* @__PURE__ */ import_react15.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react15.default.createElement(
3832
- "form",
3828
+ /* @__PURE__ */ import_react15.default.createElement(
3829
+ Card,
3833
3830
  {
3834
- noValidate: true,
3835
- onSubmit: handleSubmit((e) => {
3836
- if (props.onRegister) {
3837
- return props.onRegister(e);
3838
- } else {
3839
- console.log(
3840
- "Form is submitted but onRegister prop is missing"
3841
- );
3842
- }
3843
- }),
3844
- className: "hawa-flex hawa-flex-col hawa-gap-4"
3831
+ dir: props.direction,
3832
+ className: cn(
3833
+ (_h = props.classNames) == null ? void 0 : _h.card,
3834
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
3835
+ )
3845
3836
  },
3846
- /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
3847
- if (fld === "fullname") {
3848
- return /* @__PURE__ */ import_react15.default.createElement(
3849
- import_react_hook_form2.Controller,
3850
- {
3851
- key: i,
3852
- control,
3853
- name: "fullName",
3854
- render: ({ field }) => {
3855
- var _a2, _b2, _c2;
3856
- return /* @__PURE__ */ import_react15.default.createElement(
3857
- Input,
3858
- {
3859
- width: "full",
3860
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
3861
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
3862
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
3863
- ...field
3864
- }
3865
- );
3866
- }
3867
- }
3868
- );
3869
- }
3870
- if (fld === "email") {
3871
- return /* @__PURE__ */ import_react15.default.createElement(
3872
- import_react_hook_form2.Controller,
3873
- {
3874
- key: i,
3875
- control,
3876
- name: "email",
3877
- render: ({ field }) => {
3878
- var _a2, _b2, _c2;
3879
- return /* @__PURE__ */ import_react15.default.createElement(
3880
- Input,
3881
- {
3882
- dir: "ltr",
3883
- inputProps: {
3884
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
3885
- },
3886
- width: "full",
3887
- autoComplete: "email",
3888
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
3889
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
3890
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
3891
- ...field
3892
- }
3893
- );
3894
- }
3895
- }
3896
- );
3897
- }
3898
- if (fld === "username") {
3899
- return /* @__PURE__ */ import_react15.default.createElement(
3900
- import_react_hook_form2.Controller,
3901
- {
3902
- key: i,
3903
- control,
3904
- name: "username",
3905
- render: ({ field }) => {
3906
- var _a2, _b2, _c2, _d2;
3907
- return /* @__PURE__ */ import_react15.default.createElement(
3908
- Input,
3909
- {
3910
- width: "full",
3911
- autoComplete: "username",
3912
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
3913
- labelProps: {
3914
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
3915
- },
3916
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
3917
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
3918
- ...field
3919
- }
3920
- );
3921
- }
3922
- }
3923
- );
3924
- }
3925
- })),
3926
- /* @__PURE__ */ import_react15.default.createElement(
3927
- import_react_hook_form2.Controller,
3837
+ /* @__PURE__ */ import_react15.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
3838
+ Alert,
3928
3839
  {
3929
- control,
3930
- name: "password",
3931
- render: ({ field }) => {
3932
- var _a2, _b2, _c2;
3933
- return /* @__PURE__ */ import_react15.default.createElement(
3934
- Input,
3935
- {
3936
- width: "full",
3937
- type: passwordVisible ? "text" : "password",
3938
- endIcon: /* @__PURE__ */ import_react15.default.createElement(
3939
- "div",
3940
- {
3941
- className: "hawa-cursor-pointer",
3942
- onClick: () => setPasswordVisible(!passwordVisible)
3943
- },
3944
- passwordVisible ? /* @__PURE__ */ import_react15.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react15.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
3945
- " "
3946
- ),
3947
- autoComplete: "new-password",
3948
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
3949
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
3950
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
3951
- ...field
3952
- }
3953
- );
3840
+ direction: props.direction,
3841
+ title: props.errorTitle,
3842
+ text: props.errorText,
3843
+ severity: "error",
3844
+ onAlertClosed: () => {
3845
+ if (props.onErrorDismissed) {
3846
+ props.onErrorDismissed();
3847
+ }
3954
3848
  }
3955
3849
  }
3956
- ),
3957
- /* @__PURE__ */ import_react15.default.createElement(
3958
- import_react_hook_form2.Controller,
3850
+ ), /* @__PURE__ */ import_react15.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react15.default.createElement(
3851
+ "form",
3959
3852
  {
3960
- control,
3961
- name: "confirm_password",
3962
- render: ({ field }) => {
3963
- var _a2, _b2, _c2;
3853
+ noValidate: true,
3854
+ onSubmit: handleSubmit((e) => {
3855
+ if (props.onRegister) {
3856
+ return props.onRegister(e);
3857
+ } else {
3858
+ console.log(
3859
+ "Form is submitted but onRegister prop is missing"
3860
+ );
3861
+ }
3862
+ }),
3863
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
3864
+ },
3865
+ /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
3866
+ if (fld === "fullname") {
3964
3867
  return /* @__PURE__ */ import_react15.default.createElement(
3965
- Input,
3868
+ import_react_hook_form2.Controller,
3966
3869
  {
3967
- width: "full",
3968
- type: "password",
3969
- autoComplete: "new-password",
3970
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
3971
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
3972
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
3973
- ...field
3870
+ key: i,
3871
+ control,
3872
+ name: "fullName",
3873
+ render: ({ field }) => {
3874
+ var _a2, _b2, _c2;
3875
+ return /* @__PURE__ */ import_react15.default.createElement(
3876
+ Input,
3877
+ {
3878
+ width: "full",
3879
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
3880
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
3881
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
3882
+ ...field
3883
+ }
3884
+ );
3885
+ }
3974
3886
  }
3975
3887
  );
3976
3888
  }
3977
- }
3978
- ),
3979
- props.additionalInputs,
3980
- props.showRefCode && /* @__PURE__ */ import_react15.default.createElement(
3981
- import_react_hook_form2.Controller,
3982
- {
3983
- control,
3984
- name: "refCode",
3985
- render: ({ field }) => {
3986
- var _a2;
3889
+ if (fld === "email") {
3987
3890
  return /* @__PURE__ */ import_react15.default.createElement(
3988
- Input,
3891
+ import_react_hook_form2.Controller,
3989
3892
  {
3990
- width: "full",
3991
- label: texts == null ? void 0 : texts.refCode,
3992
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
3993
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
3994
- ...field
3893
+ key: i,
3894
+ control,
3895
+ name: "email",
3896
+ render: ({ field }) => {
3897
+ var _a2, _b2, _c2;
3898
+ return /* @__PURE__ */ import_react15.default.createElement(
3899
+ Input,
3900
+ {
3901
+ dir: "ltr",
3902
+ inputProps: {
3903
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
3904
+ },
3905
+ width: "full",
3906
+ autoComplete: "email",
3907
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
3908
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
3909
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
3910
+ ...field
3911
+ }
3912
+ );
3913
+ }
3995
3914
  }
3996
3915
  );
3997
3916
  }
3998
- }
3999
- ),
4000
- props.showUserSource && /* @__PURE__ */ import_react15.default.createElement(
4001
- import_react_hook_form2.Controller,
4002
- {
4003
- control,
4004
- name: "reference",
4005
- render: ({ field }) => {
4006
- var _a2, _b2;
3917
+ if (fld === "username") {
4007
3918
  return /* @__PURE__ */ import_react15.default.createElement(
4008
- Select,
3919
+ import_react_hook_form2.Controller,
4009
3920
  {
4010
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4011
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4012
- isCreatable: false,
4013
- isMulti: false,
4014
- isSearchable: false,
4015
- isClearable: false,
4016
- options: props.userReferenceOptions,
4017
- onChange: (e) => {
4018
- field.onChange(e.value);
3921
+ key: i,
3922
+ control,
3923
+ name: "username",
3924
+ render: ({ field }) => {
3925
+ var _a2, _b2, _c2, _d2;
3926
+ return /* @__PURE__ */ import_react15.default.createElement(
3927
+ Input,
3928
+ {
3929
+ width: "full",
3930
+ autoComplete: "username",
3931
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
3932
+ labelProps: {
3933
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
3934
+ },
3935
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
3936
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
3937
+ ...field
3938
+ }
3939
+ );
4019
3940
  }
4020
3941
  }
4021
3942
  );
4022
3943
  }
4023
- }
4024
- ),
4025
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react15.default.createElement(
4026
- import_react_hook_form2.Controller,
4027
- {
4028
- control,
4029
- name: "terms_accepted",
4030
- render: ({ field }) => {
4031
- var _a2, _b2;
4032
- return /* @__PURE__ */ import_react15.default.createElement(
3944
+ })),
3945
+ /* @__PURE__ */ import_react15.default.createElement(
3946
+ import_react_hook_form2.Controller,
3947
+ {
3948
+ control,
3949
+ name: "password",
3950
+ render: ({ field }) => {
3951
+ var _a2, _b2, _c2;
3952
+ return /* @__PURE__ */ import_react15.default.createElement(
3953
+ Input,
3954
+ {
3955
+ width: "full",
3956
+ type: passwordVisible ? "text" : "password",
3957
+ endIcon: /* @__PURE__ */ import_react15.default.createElement(
3958
+ "div",
3959
+ {
3960
+ className: "hawa-cursor-pointer",
3961
+ onClick: () => setPasswordVisible(!passwordVisible)
3962
+ },
3963
+ passwordVisible ? /* @__PURE__ */ import_react15.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react15.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
3964
+ " "
3965
+ ),
3966
+ autoComplete: "new-password",
3967
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
3968
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
3969
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
3970
+ ...field
3971
+ }
3972
+ );
3973
+ }
3974
+ }
3975
+ ),
3976
+ /* @__PURE__ */ import_react15.default.createElement(
3977
+ import_react_hook_form2.Controller,
3978
+ {
3979
+ control,
3980
+ name: "confirm_password",
3981
+ render: ({ field }) => {
3982
+ var _a2, _b2, _c2;
3983
+ return /* @__PURE__ */ import_react15.default.createElement(
3984
+ Input,
3985
+ {
3986
+ width: "full",
3987
+ type: "password",
3988
+ autoComplete: "new-password",
3989
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
3990
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
3991
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
3992
+ ...field
3993
+ }
3994
+ );
3995
+ }
3996
+ }
3997
+ ),
3998
+ props.additionalInputs,
3999
+ props.showRefCode && /* @__PURE__ */ import_react15.default.createElement(
4000
+ import_react_hook_form2.Controller,
4001
+ {
4002
+ control,
4003
+ name: "refCode",
4004
+ render: ({ field }) => {
4005
+ var _a2;
4006
+ return /* @__PURE__ */ import_react15.default.createElement(
4007
+ Input,
4008
+ {
4009
+ width: "full",
4010
+ label: texts == null ? void 0 : texts.refCode,
4011
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4012
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4013
+ ...field
4014
+ }
4015
+ );
4016
+ }
4017
+ }
4018
+ ),
4019
+ props.showUserSource && /* @__PURE__ */ import_react15.default.createElement(
4020
+ import_react_hook_form2.Controller,
4021
+ {
4022
+ control,
4023
+ name: "reference",
4024
+ render: ({ field }) => {
4025
+ var _a2, _b2;
4026
+ return /* @__PURE__ */ import_react15.default.createElement(
4027
+ Select,
4028
+ {
4029
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4030
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4031
+ isCreatable: false,
4032
+ isMulti: false,
4033
+ isSearchable: false,
4034
+ isClearable: false,
4035
+ options: props.userReferenceOptions,
4036
+ onChange: (e) => {
4037
+ field.onChange(e.value);
4038
+ }
4039
+ }
4040
+ );
4041
+ }
4042
+ }
4043
+ ),
4044
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react15.default.createElement(
4045
+ import_react_hook_form2.Controller,
4046
+ {
4047
+ control,
4048
+ name: "terms_accepted",
4049
+ render: ({ field }) => {
4050
+ var _a2, _b2;
4051
+ return /* @__PURE__ */ import_react15.default.createElement(
4052
+ Checkbox,
4053
+ {
4054
+ id: "terms_accepted",
4055
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4056
+ onCheckedChange: (e) => field.onChange(e),
4057
+ label: /* @__PURE__ */ import_react15.default.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__ */ import_react15.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react15.default.createElement(
4058
+ "span",
4059
+ {
4060
+ onClick: (e) => {
4061
+ e.preventDefault();
4062
+ if (props.onRouteToTOS) {
4063
+ props.onRouteToTOS();
4064
+ }
4065
+ },
4066
+ className: "clickable-link"
4067
+ },
4068
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4069
+ )))
4070
+ }
4071
+ );
4072
+ }
4073
+ }
4074
+ ), showNewsletterOption && /* @__PURE__ */ import_react15.default.createElement(
4075
+ import_react_hook_form2.Controller,
4076
+ {
4077
+ control,
4078
+ name: "newsletter_accepted",
4079
+ render: ({ field }) => /* @__PURE__ */ import_react15.default.createElement(
4033
4080
  Checkbox,
4034
4081
  {
4035
- id: "terms_accepted",
4036
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4037
- onCheckedChange: (e) => field.onChange(e),
4038
- label: /* @__PURE__ */ import_react15.default.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__ */ import_react15.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react15.default.createElement(
4039
- "span",
4040
- {
4041
- onClick: (e) => {
4042
- e.preventDefault();
4043
- if (props.onRouteToTOS) {
4044
- props.onRouteToTOS();
4045
- }
4046
- },
4047
- className: "clickable-link"
4048
- },
4049
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4050
- )))
4082
+ id: "newsletter_accepted",
4083
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
4084
+ onCheckedChange: field.onChange
4051
4085
  }
4052
- );
4086
+ )
4053
4087
  }
4054
- }
4055
- ), showNewsletterOption && /* @__PURE__ */ import_react15.default.createElement(
4056
- import_react_hook_form2.Controller,
4088
+ )) : null,
4089
+ /* @__PURE__ */ import_react15.default.createElement(
4090
+ Button,
4091
+ {
4092
+ className: " hawa-w-full",
4093
+ type: "submit",
4094
+ isLoading: props.isLoading,
4095
+ disabled: props.isLoading
4096
+ },
4097
+ (texts == null ? void 0 : texts.registerText) || "Register"
4098
+ ),
4099
+ props.additionalButtons
4100
+ )), /* @__PURE__ */ import_react15.default.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__ */ import_react15.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react15.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
4101
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react15.default.createElement(
4102
+ CardFooter,
4057
4103
  {
4058
- control,
4059
- name: "newsletter_accepted",
4060
- render: ({ field }) => /* @__PURE__ */ import_react15.default.createElement(
4061
- Checkbox,
4062
- {
4063
- id: "newsletter_accepted",
4064
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
4065
- onCheckedChange: field.onChange
4066
- }
4104
+ className: cn(
4105
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4067
4106
  )
4068
- }
4069
- )) : null,
4070
- /* @__PURE__ */ import_react15.default.createElement(
4071
- Button,
4072
- {
4073
- className: " hawa-w-full",
4074
- type: "submit",
4075
- isLoading: props.isLoading,
4076
- disabled: props.isLoading
4077
4107
  },
4078
- (texts == null ? void 0 : texts.registerText) || "Register"
4079
- ),
4080
- props.additionalButtons
4081
- )), /* @__PURE__ */ import_react15.default.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__ */ import_react15.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react15.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react15.default.createElement(
4082
- CardFooter,
4083
- {
4084
- className: cn(
4085
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4108
+ /* @__PURE__ */ import_react15.default.createElement(
4109
+ AuthButtons,
4110
+ {
4111
+ texts: thirdPartyAuthTexts,
4112
+ viaGoogle: props.viaGoogle,
4113
+ viaGithub: props.viaGithub,
4114
+ viaTwitter: props.viaTwitter,
4115
+ isGoogleLoading: props.isGoogleLoading,
4116
+ isGithubLoading: props.isGithubLoading,
4117
+ isTwitterLoading: props.isTwitterLoading,
4118
+ handleGoogle: props.onGoogleRegister,
4119
+ handleGithub: props.onGithubRegister,
4120
+ handleTwitter: props.onTwitterRegister
4121
+ }
4086
4122
  )
4087
- },
4088
- /* @__PURE__ */ import_react15.default.createElement(
4089
- AuthButtons,
4090
- {
4091
- texts: thirdPartyAuthTexts,
4092
- viaGoogle: props.viaGoogle,
4093
- viaGithub: props.viaGithub,
4094
- viaTwitter: props.viaTwitter,
4095
- isGoogleLoading: props.isGoogleLoading,
4096
- isGithubLoading: props.isGithubLoading,
4097
- isTwitterLoading: props.isTwitterLoading,
4098
- handleGoogle: props.onGoogleRegister,
4099
- handleGithub: props.onGithubRegister,
4100
- handleTwitter: props.onTwitterRegister
4101
- }
4102
- )
4103
- ) : null)
4123
+ ) : null
4124
+ )
4104
4125
  );
4105
4126
  };
4106
4127