@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.
@@ -3441,8 +3441,8 @@ var UncheckMark = ({ size = "default", className }) => {
3441
3441
  // blocks/auth/LoginForm.tsx
3442
3442
  var LoginForm = ({
3443
3443
  loginType = "email",
3444
- texts,
3445
3444
  passwordLength = 8,
3445
+ texts,
3446
3446
  ...props
3447
3447
  }) => {
3448
3448
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
@@ -3673,70 +3673,80 @@ var LoginForm = ({
3673
3673
  break;
3674
3674
  }
3675
3675
  };
3676
- 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(
3677
- Alert,
3678
- {
3679
- direction: props.direction,
3680
- title: props.errorTitle,
3681
- text: props.errorText,
3682
- severity: "error"
3683
- }
3684
- ), /* @__PURE__ */ import_react13.default.createElement(
3685
- "form",
3676
+ return /* @__PURE__ */ import_react13.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ import_react13.default.createElement(
3677
+ Card,
3686
3678
  {
3687
- noValidate: true,
3688
- className: "hawa-flex hawa-flex-col hawa-gap-4",
3689
- onSubmit: handleSubmit((e) => {
3690
- if (props.onLogin) {
3691
- return props.onLogin(e);
3692
- } else {
3693
- console.log("Form is submitted but onLogin prop is missing");
3694
- }
3695
- })
3679
+ dir: props.direction,
3680
+ className: cn(
3681
+ props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
3682
+ )
3696
3683
  },
3697
- renderFields(),
3698
- /* @__PURE__ */ import_react13.default.createElement(
3699
- Button,
3684
+ /* @__PURE__ */ import_react13.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react13.default.createElement(
3685
+ Alert,
3700
3686
  {
3701
- className: "hawa-mt-0 hawa-w-full",
3702
- type: "submit",
3703
- isLoading: props.isLoading,
3704
- disabled: props.isLoading
3687
+ direction: props.direction,
3688
+ title: props.errorTitle,
3689
+ text: props.errorText,
3690
+ severity: "error"
3691
+ }
3692
+ ), /* @__PURE__ */ import_react13.default.createElement(
3693
+ "form",
3694
+ {
3695
+ noValidate: true,
3696
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
3697
+ onSubmit: handleSubmit((e) => {
3698
+ if (props.onLogin) {
3699
+ return props.onLogin(e);
3700
+ } else {
3701
+ console.log("Form is submitted but onLogin prop is missing");
3702
+ }
3703
+ })
3705
3704
  },
3706
- (texts == null ? void 0 : texts.loginText) || "Login"
3707
- ),
3708
- props.additionalButtons,
3709
- 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(
3710
- "span",
3705
+ renderFields(),
3706
+ /* @__PURE__ */ import_react13.default.createElement(
3707
+ Button,
3708
+ {
3709
+ className: "hawa-mt-0 hawa-w-full",
3710
+ type: "submit",
3711
+ isLoading: props.isLoading,
3712
+ disabled: props.isLoading
3713
+ },
3714
+ (texts == null ? void 0 : texts.loginText) || "Login"
3715
+ ),
3716
+ props.additionalButtons,
3717
+ 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(
3718
+ "span",
3719
+ {
3720
+ onClick: props.onRouteToRegister,
3721
+ className: "clickable-link"
3722
+ },
3723
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
3724
+ ))
3725
+ )),
3726
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react13.default.createElement(
3727
+ CardFooter,
3711
3728
  {
3712
- onClick: props.onRouteToRegister,
3713
- className: "clickable-link"
3729
+ className: cn(
3730
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
3731
+ )
3714
3732
  },
3715
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
3716
- ))
3717
- )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react13.default.createElement(
3718
- CardFooter,
3719
- {
3720
- className: cn(
3721
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
3733
+ /* @__PURE__ */ import_react13.default.createElement(
3734
+ AuthButtons,
3735
+ {
3736
+ texts: thirdPartyAuthTexts,
3737
+ viaGoogle: props.viaGoogle,
3738
+ viaGithub: props.viaGithub,
3739
+ viaTwitter: props.viaTwitter,
3740
+ isGoogleLoading: props.isGoogleLoading,
3741
+ isGithubLoading: props.isGithubLoading,
3742
+ isTwitterLoading: props.isTwitterLoading,
3743
+ handleGoogle: props.onGoogleLogin,
3744
+ handleGithub: props.onGithubLogin,
3745
+ handleTwitter: props.onTwitterLogin
3746
+ }
3722
3747
  )
3723
- },
3724
- /* @__PURE__ */ import_react13.default.createElement(
3725
- AuthButtons,
3726
- {
3727
- texts: thirdPartyAuthTexts,
3728
- viaGoogle: props.viaGoogle,
3729
- viaGithub: props.viaGithub,
3730
- viaTwitter: props.viaTwitter,
3731
- isGoogleLoading: props.isGoogleLoading,
3732
- isGithubLoading: props.isGithubLoading,
3733
- isTwitterLoading: props.isTwitterLoading,
3734
- handleGoogle: props.onGoogleLogin,
3735
- handleGithub: props.onGithubLogin,
3736
- handleTwitter: props.onTwitterLogin
3737
- }
3738
- )
3739
- ) : null));
3748
+ ) : null
3749
+ ));
3740
3750
  };
3741
3751
 
3742
3752
  // blocks/auth/RegisterForm.tsx
@@ -3972,292 +3982,303 @@ var RegisterForm = ({
3972
3982
  (_g = props.classNames) == null ? void 0 : _g.root
3973
3983
  )
3974
3984
  },
3975
- /* @__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(
3976
- Alert,
3977
- {
3978
- direction: props.direction,
3979
- title: props.errorTitle,
3980
- text: props.errorText,
3981
- severity: "error",
3982
- onAlertClosed: () => {
3983
- if (props.onErrorDismissed) {
3984
- props.onErrorDismissed();
3985
- }
3986
- }
3987
- }
3988
- ), /* @__PURE__ */ import_react15.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react15.default.createElement(
3989
- "form",
3985
+ /* @__PURE__ */ import_react15.default.createElement(
3986
+ Card,
3990
3987
  {
3991
- noValidate: true,
3992
- onSubmit: handleSubmit((e) => {
3993
- if (props.onRegister) {
3994
- return props.onRegister(e);
3995
- } else {
3996
- console.log(
3997
- "Form is submitted but onRegister prop is missing"
3998
- );
3999
- }
4000
- }),
4001
- className: "hawa-flex hawa-flex-col hawa-gap-4"
3988
+ dir: props.direction,
3989
+ className: cn(
3990
+ (_h = props.classNames) == null ? void 0 : _h.card,
3991
+ props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none hawa-drop-shadow-none"
3992
+ )
4002
3993
  },
4003
- /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4004
- if (fld === "fullname") {
4005
- return /* @__PURE__ */ import_react15.default.createElement(
4006
- import_react_hook_form2.Controller,
4007
- {
4008
- key: i,
4009
- control,
4010
- name: "fullName",
4011
- render: ({ field }) => {
4012
- var _a2, _b2, _c2;
4013
- return /* @__PURE__ */ import_react15.default.createElement(
4014
- Input,
4015
- {
4016
- width: "full",
4017
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4018
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4019
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4020
- ...field
4021
- }
4022
- );
4023
- }
4024
- }
4025
- );
4026
- }
4027
- if (fld === "email") {
4028
- return /* @__PURE__ */ import_react15.default.createElement(
4029
- import_react_hook_form2.Controller,
4030
- {
4031
- key: i,
4032
- control,
4033
- name: "email",
4034
- render: ({ field }) => {
4035
- var _a2, _b2, _c2;
4036
- return /* @__PURE__ */ import_react15.default.createElement(
4037
- Input,
4038
- {
4039
- dir: "ltr",
4040
- inputProps: {
4041
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4042
- },
4043
- width: "full",
4044
- autoComplete: "email",
4045
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4046
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4047
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4048
- ...field
4049
- }
4050
- );
4051
- }
4052
- }
4053
- );
4054
- }
4055
- if (fld === "username") {
4056
- return /* @__PURE__ */ import_react15.default.createElement(
4057
- import_react_hook_form2.Controller,
4058
- {
4059
- key: i,
4060
- control,
4061
- name: "username",
4062
- render: ({ field }) => {
4063
- var _a2, _b2, _c2, _d2;
4064
- return /* @__PURE__ */ import_react15.default.createElement(
4065
- Input,
4066
- {
4067
- width: "full",
4068
- autoComplete: "username",
4069
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4070
- labelProps: {
4071
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4072
- },
4073
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4074
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4075
- ...field
4076
- }
4077
- );
4078
- }
4079
- }
4080
- );
4081
- }
4082
- })),
4083
- /* @__PURE__ */ import_react15.default.createElement(
4084
- import_react_hook_form2.Controller,
3994
+ /* @__PURE__ */ import_react15.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
3995
+ Alert,
4085
3996
  {
4086
- control,
4087
- name: "password",
4088
- render: ({ field }) => {
4089
- var _a2, _b2, _c2;
4090
- return /* @__PURE__ */ import_react15.default.createElement(
4091
- Input,
4092
- {
4093
- width: "full",
4094
- type: passwordVisible ? "text" : "password",
4095
- endIcon: /* @__PURE__ */ import_react15.default.createElement(
4096
- "div",
4097
- {
4098
- className: "hawa-cursor-pointer",
4099
- onClick: () => setPasswordVisible(!passwordVisible)
4100
- },
4101
- passwordVisible ? /* @__PURE__ */ import_react15.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react15.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
4102
- " "
4103
- ),
4104
- autoComplete: "new-password",
4105
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
4106
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
4107
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
4108
- ...field
4109
- }
4110
- );
3997
+ direction: props.direction,
3998
+ title: props.errorTitle,
3999
+ text: props.errorText,
4000
+ severity: "error",
4001
+ onAlertClosed: () => {
4002
+ if (props.onErrorDismissed) {
4003
+ props.onErrorDismissed();
4004
+ }
4111
4005
  }
4112
4006
  }
4113
- ),
4114
- /* @__PURE__ */ import_react15.default.createElement(
4115
- import_react_hook_form2.Controller,
4007
+ ), /* @__PURE__ */ import_react15.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react15.default.createElement(
4008
+ "form",
4116
4009
  {
4117
- control,
4118
- name: "confirm_password",
4119
- render: ({ field }) => {
4120
- var _a2, _b2, _c2;
4010
+ noValidate: true,
4011
+ onSubmit: handleSubmit((e) => {
4012
+ if (props.onRegister) {
4013
+ return props.onRegister(e);
4014
+ } else {
4015
+ console.log(
4016
+ "Form is submitted but onRegister prop is missing"
4017
+ );
4018
+ }
4019
+ }),
4020
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
4021
+ },
4022
+ /* @__PURE__ */ import_react15.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4023
+ if (fld === "fullname") {
4121
4024
  return /* @__PURE__ */ import_react15.default.createElement(
4122
- Input,
4025
+ import_react_hook_form2.Controller,
4123
4026
  {
4124
- width: "full",
4125
- type: "password",
4126
- autoComplete: "new-password",
4127
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
4128
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
4129
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
4130
- ...field
4027
+ key: i,
4028
+ control,
4029
+ name: "fullName",
4030
+ render: ({ field }) => {
4031
+ var _a2, _b2, _c2;
4032
+ return /* @__PURE__ */ import_react15.default.createElement(
4033
+ Input,
4034
+ {
4035
+ width: "full",
4036
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4037
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4038
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4039
+ ...field
4040
+ }
4041
+ );
4042
+ }
4131
4043
  }
4132
4044
  );
4133
4045
  }
4134
- }
4135
- ),
4136
- props.additionalInputs,
4137
- props.showRefCode && /* @__PURE__ */ import_react15.default.createElement(
4138
- import_react_hook_form2.Controller,
4139
- {
4140
- control,
4141
- name: "refCode",
4142
- render: ({ field }) => {
4143
- var _a2;
4046
+ if (fld === "email") {
4144
4047
  return /* @__PURE__ */ import_react15.default.createElement(
4145
- Input,
4048
+ import_react_hook_form2.Controller,
4146
4049
  {
4147
- width: "full",
4148
- label: texts == null ? void 0 : texts.refCode,
4149
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4150
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4151
- ...field
4050
+ key: i,
4051
+ control,
4052
+ name: "email",
4053
+ render: ({ field }) => {
4054
+ var _a2, _b2, _c2;
4055
+ return /* @__PURE__ */ import_react15.default.createElement(
4056
+ Input,
4057
+ {
4058
+ dir: "ltr",
4059
+ inputProps: {
4060
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4061
+ },
4062
+ width: "full",
4063
+ autoComplete: "email",
4064
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4065
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4066
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4067
+ ...field
4068
+ }
4069
+ );
4070
+ }
4152
4071
  }
4153
4072
  );
4154
4073
  }
4155
- }
4156
- ),
4157
- props.showUserSource && /* @__PURE__ */ import_react15.default.createElement(
4158
- import_react_hook_form2.Controller,
4159
- {
4160
- control,
4161
- name: "reference",
4162
- render: ({ field }) => {
4163
- var _a2, _b2;
4074
+ if (fld === "username") {
4164
4075
  return /* @__PURE__ */ import_react15.default.createElement(
4165
- Select,
4076
+ import_react_hook_form2.Controller,
4166
4077
  {
4167
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4168
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4169
- isCreatable: false,
4170
- isMulti: false,
4171
- isSearchable: false,
4172
- isClearable: false,
4173
- options: props.userReferenceOptions,
4174
- onChange: (e) => {
4175
- field.onChange(e.value);
4078
+ key: i,
4079
+ control,
4080
+ name: "username",
4081
+ render: ({ field }) => {
4082
+ var _a2, _b2, _c2, _d2;
4083
+ return /* @__PURE__ */ import_react15.default.createElement(
4084
+ Input,
4085
+ {
4086
+ width: "full",
4087
+ autoComplete: "username",
4088
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4089
+ labelProps: {
4090
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4091
+ },
4092
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4093
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4094
+ ...field
4095
+ }
4096
+ );
4176
4097
  }
4177
4098
  }
4178
4099
  );
4179
4100
  }
4180
- }
4181
- ),
4182
- 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(
4183
- import_react_hook_form2.Controller,
4184
- {
4185
- control,
4186
- name: "terms_accepted",
4187
- render: ({ field }) => {
4188
- var _a2, _b2;
4189
- return /* @__PURE__ */ import_react15.default.createElement(
4101
+ })),
4102
+ /* @__PURE__ */ import_react15.default.createElement(
4103
+ import_react_hook_form2.Controller,
4104
+ {
4105
+ control,
4106
+ name: "password",
4107
+ render: ({ field }) => {
4108
+ var _a2, _b2, _c2;
4109
+ return /* @__PURE__ */ import_react15.default.createElement(
4110
+ Input,
4111
+ {
4112
+ width: "full",
4113
+ type: passwordVisible ? "text" : "password",
4114
+ endIcon: /* @__PURE__ */ import_react15.default.createElement(
4115
+ "div",
4116
+ {
4117
+ className: "hawa-cursor-pointer",
4118
+ onClick: () => setPasswordVisible(!passwordVisible)
4119
+ },
4120
+ passwordVisible ? /* @__PURE__ */ import_react15.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react15.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
4121
+ " "
4122
+ ),
4123
+ autoComplete: "new-password",
4124
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
4125
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
4126
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
4127
+ ...field
4128
+ }
4129
+ );
4130
+ }
4131
+ }
4132
+ ),
4133
+ /* @__PURE__ */ import_react15.default.createElement(
4134
+ import_react_hook_form2.Controller,
4135
+ {
4136
+ control,
4137
+ name: "confirm_password",
4138
+ render: ({ field }) => {
4139
+ var _a2, _b2, _c2;
4140
+ return /* @__PURE__ */ import_react15.default.createElement(
4141
+ Input,
4142
+ {
4143
+ width: "full",
4144
+ type: "password",
4145
+ autoComplete: "new-password",
4146
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
4147
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
4148
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
4149
+ ...field
4150
+ }
4151
+ );
4152
+ }
4153
+ }
4154
+ ),
4155
+ props.additionalInputs,
4156
+ props.showRefCode && /* @__PURE__ */ import_react15.default.createElement(
4157
+ import_react_hook_form2.Controller,
4158
+ {
4159
+ control,
4160
+ name: "refCode",
4161
+ render: ({ field }) => {
4162
+ var _a2;
4163
+ return /* @__PURE__ */ import_react15.default.createElement(
4164
+ Input,
4165
+ {
4166
+ width: "full",
4167
+ label: texts == null ? void 0 : texts.refCode,
4168
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
4169
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
4170
+ ...field
4171
+ }
4172
+ );
4173
+ }
4174
+ }
4175
+ ),
4176
+ props.showUserSource && /* @__PURE__ */ import_react15.default.createElement(
4177
+ import_react_hook_form2.Controller,
4178
+ {
4179
+ control,
4180
+ name: "reference",
4181
+ render: ({ field }) => {
4182
+ var _a2, _b2;
4183
+ return /* @__PURE__ */ import_react15.default.createElement(
4184
+ Select,
4185
+ {
4186
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
4187
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
4188
+ isCreatable: false,
4189
+ isMulti: false,
4190
+ isSearchable: false,
4191
+ isClearable: false,
4192
+ options: props.userReferenceOptions,
4193
+ onChange: (e) => {
4194
+ field.onChange(e.value);
4195
+ }
4196
+ }
4197
+ );
4198
+ }
4199
+ }
4200
+ ),
4201
+ 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(
4202
+ import_react_hook_form2.Controller,
4203
+ {
4204
+ control,
4205
+ name: "terms_accepted",
4206
+ render: ({ field }) => {
4207
+ var _a2, _b2;
4208
+ return /* @__PURE__ */ import_react15.default.createElement(
4209
+ Checkbox,
4210
+ {
4211
+ id: "terms_accepted",
4212
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4213
+ onCheckedChange: (e) => field.onChange(e),
4214
+ 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(
4215
+ "span",
4216
+ {
4217
+ onClick: (e) => {
4218
+ e.preventDefault();
4219
+ if (props.onRouteToTOS) {
4220
+ props.onRouteToTOS();
4221
+ }
4222
+ },
4223
+ className: "clickable-link"
4224
+ },
4225
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4226
+ )))
4227
+ }
4228
+ );
4229
+ }
4230
+ }
4231
+ ), showNewsletterOption && /* @__PURE__ */ import_react15.default.createElement(
4232
+ import_react_hook_form2.Controller,
4233
+ {
4234
+ control,
4235
+ name: "newsletter_accepted",
4236
+ render: ({ field }) => /* @__PURE__ */ import_react15.default.createElement(
4190
4237
  Checkbox,
4191
4238
  {
4192
- id: "terms_accepted",
4193
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
4194
- onCheckedChange: (e) => field.onChange(e),
4195
- 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(
4196
- "span",
4197
- {
4198
- onClick: (e) => {
4199
- e.preventDefault();
4200
- if (props.onRouteToTOS) {
4201
- props.onRouteToTOS();
4202
- }
4203
- },
4204
- className: "clickable-link"
4205
- },
4206
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
4207
- )))
4239
+ id: "newsletter_accepted",
4240
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
4241
+ onCheckedChange: field.onChange
4208
4242
  }
4209
- );
4243
+ )
4210
4244
  }
4211
- }
4212
- ), showNewsletterOption && /* @__PURE__ */ import_react15.default.createElement(
4213
- import_react_hook_form2.Controller,
4245
+ )) : null,
4246
+ /* @__PURE__ */ import_react15.default.createElement(
4247
+ Button,
4248
+ {
4249
+ className: " hawa-w-full",
4250
+ type: "submit",
4251
+ isLoading: props.isLoading,
4252
+ disabled: props.isLoading
4253
+ },
4254
+ (texts == null ? void 0 : texts.registerText) || "Register"
4255
+ ),
4256
+ props.additionalButtons
4257
+ )), /* @__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")))),
4258
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react15.default.createElement(
4259
+ CardFooter,
4214
4260
  {
4215
- control,
4216
- name: "newsletter_accepted",
4217
- render: ({ field }) => /* @__PURE__ */ import_react15.default.createElement(
4218
- Checkbox,
4219
- {
4220
- id: "newsletter_accepted",
4221
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
4222
- onCheckedChange: field.onChange
4223
- }
4261
+ className: cn(
4262
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4224
4263
  )
4225
- }
4226
- )) : null,
4227
- /* @__PURE__ */ import_react15.default.createElement(
4228
- Button,
4229
- {
4230
- className: " hawa-w-full",
4231
- type: "submit",
4232
- isLoading: props.isLoading,
4233
- disabled: props.isLoading
4234
4264
  },
4235
- (texts == null ? void 0 : texts.registerText) || "Register"
4236
- ),
4237
- props.additionalButtons
4238
- )), /* @__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(
4239
- CardFooter,
4240
- {
4241
- className: cn(
4242
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
4265
+ /* @__PURE__ */ import_react15.default.createElement(
4266
+ AuthButtons,
4267
+ {
4268
+ texts: thirdPartyAuthTexts,
4269
+ viaGoogle: props.viaGoogle,
4270
+ viaGithub: props.viaGithub,
4271
+ viaTwitter: props.viaTwitter,
4272
+ isGoogleLoading: props.isGoogleLoading,
4273
+ isGithubLoading: props.isGithubLoading,
4274
+ isTwitterLoading: props.isTwitterLoading,
4275
+ handleGoogle: props.onGoogleRegister,
4276
+ handleGithub: props.onGithubRegister,
4277
+ handleTwitter: props.onTwitterRegister
4278
+ }
4243
4279
  )
4244
- },
4245
- /* @__PURE__ */ import_react15.default.createElement(
4246
- AuthButtons,
4247
- {
4248
- texts: thirdPartyAuthTexts,
4249
- viaGoogle: props.viaGoogle,
4250
- viaGithub: props.viaGithub,
4251
- viaTwitter: props.viaTwitter,
4252
- isGoogleLoading: props.isGoogleLoading,
4253
- isGithubLoading: props.isGithubLoading,
4254
- isTwitterLoading: props.isTwitterLoading,
4255
- handleGoogle: props.onGoogleRegister,
4256
- handleGithub: props.onGithubRegister,
4257
- handleTwitter: props.onTwitterRegister
4258
- }
4259
- )
4260
- ) : null)
4280
+ ) : null
4281
+ )
4261
4282
  );
4262
4283
  };
4263
4284