@sikka/hawa 0.30.6-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.
- package/dist/blocks/auth/index.d.mts +4 -0
- package/dist/blocks/auth/index.d.ts +4 -0
- package/dist/blocks/auth/index.js +335 -314
- package/dist/blocks/auth/index.mjs +335 -314
- package/dist/blocks/index.d.mts +4 -0
- package/dist/blocks/index.d.ts +4 -0
- package/dist/blocks/index.js +335 -314
- package/dist/blocks/index.mjs +335 -314
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +335 -314
- package/dist/index.mjs +335 -314
- package/package.json +1 -1
package/dist/blocks/index.js
CHANGED
@@ -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(
|
3677
|
-
|
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
|
-
|
3688
|
-
className:
|
3689
|
-
|
3690
|
-
|
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
|
-
|
3698
|
-
|
3699
|
-
Button,
|
3684
|
+
/* @__PURE__ */ import_react13.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react13.default.createElement(
|
3685
|
+
Alert,
|
3700
3686
|
{
|
3701
|
-
|
3702
|
-
|
3703
|
-
|
3704
|
-
|
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
|
-
(
|
3707
|
-
|
3708
|
-
|
3709
|
-
|
3710
|
-
|
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
|
-
|
3713
|
-
|
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
|
-
|
3716
|
-
|
3717
|
-
|
3718
|
-
|
3719
|
-
|
3720
|
-
|
3721
|
-
|
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
|
-
|
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(
|
3976
|
-
|
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
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
|
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(
|
4004
|
-
|
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 }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
|
3995
|
+
Alert,
|
4085
3996
|
{
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
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
|
-
|
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
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
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
|
-
|
4025
|
+
import_react_hook_form2.Controller,
|
4123
4026
|
{
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4127
|
-
|
4128
|
-
|
4129
|
-
|
4130
|
-
|
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
|
-
|
4048
|
+
import_react_hook_form2.Controller,
|
4146
4049
|
{
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4150
|
-
|
4151
|
-
|
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
|
-
|
4076
|
+
import_react_hook_form2.Controller,
|
4166
4077
|
{
|
4167
|
-
|
4168
|
-
|
4169
|
-
|
4170
|
-
|
4171
|
-
|
4172
|
-
|
4173
|
-
|
4174
|
-
|
4175
|
-
|
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
|
-
|
4183
|
-
|
4184
|
-
|
4185
|
-
|
4186
|
-
|
4187
|
-
|
4188
|
-
|
4189
|
-
|
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: "
|
4193
|
-
|
4194
|
-
onCheckedChange:
|
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
|
-
|
4213
|
-
|
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
|
-
|
4216
|
-
|
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
|
-
|
4236
|
-
|
4237
|
-
|
4238
|
-
|
4239
|
-
|
4240
|
-
|
4241
|
-
|
4242
|
-
|
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
|
-
|
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
|
|