@sikka/hawa 0.10.25-next → 0.10.27-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/README.md +17 -2
- package/dist/index.d.mts +22 -18
- package/dist/index.d.ts +22 -18
- package/dist/index.js +39 -33
- package/dist/index.mjs +22 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
|
|
53
53
|
## Install
|
|
54
54
|
|
|
55
|
-
**Note:** Current npm tags 👇
|
|
55
|
+
**Note:** Current npm tags 👇
|
|
56
56
|
|
|
57
|
-
`@beta` is archived.
|
|
57
|
+
`@beta` is archived.
|
|
58
58
|
|
|
59
59
|
`@next` only points to pre-releases.
|
|
60
60
|
|
|
@@ -70,6 +70,21 @@ npm install @sikka/hawa
|
|
|
70
70
|
|
|
71
71
|
To contribute, clone this github repository and run the development server
|
|
72
72
|
|
|
73
|
+
```js
|
|
74
|
+
// To preview the components
|
|
75
|
+
npm run storybook
|
|
76
|
+
// To run the landing pages
|
|
77
|
+
npm run dev
|
|
78
|
+
```
|
|
79
|
+
To build the library to /dist
|
|
80
|
+
```
|
|
81
|
+
npm run build-lib
|
|
82
|
+
```
|
|
83
|
+
To generate /dist/index.css
|
|
84
|
+
```
|
|
85
|
+
npm run build-css
|
|
86
|
+
```
|
|
87
|
+
|
|
73
88
|
</br>
|
|
74
89
|
|
|
75
90
|

|
package/dist/index.d.mts
CHANGED
|
@@ -1058,32 +1058,24 @@ type RegisterFormTypes = {
|
|
|
1058
1058
|
texts: {
|
|
1059
1059
|
fullNameLabel: string;
|
|
1060
1060
|
fullNamePlaceholder: string;
|
|
1061
|
-
fullNameRequiredText: string;
|
|
1062
1061
|
emailLabel: string;
|
|
1063
1062
|
emailPlaceholder: string;
|
|
1064
|
-
|
|
1065
|
-
|
|
1063
|
+
emailRequired: string;
|
|
1064
|
+
emailInvalid: string;
|
|
1066
1065
|
usernameLabel: string;
|
|
1067
1066
|
usernamePlaceholder: string;
|
|
1068
1067
|
usernameInvalid: string;
|
|
1069
1068
|
usernameRequired: string;
|
|
1070
1069
|
passwordLabel: string;
|
|
1071
1070
|
passwordPlaceholder: string;
|
|
1072
|
-
|
|
1073
|
-
|
|
1071
|
+
passwordRequired: string;
|
|
1072
|
+
passwordTooShort: string;
|
|
1074
1073
|
passwordsDontMatch: string;
|
|
1075
1074
|
confirmPasswordLabel: string;
|
|
1076
1075
|
confirmPasswordPlaceholder: string;
|
|
1077
1076
|
confirmPasswordRequired: string;
|
|
1078
1077
|
subscribeToNewsletter: string;
|
|
1079
|
-
|
|
1080
|
-
termsText: string;
|
|
1081
|
-
iAcceptText: string;
|
|
1082
|
-
termsRequiredText: string;
|
|
1083
|
-
newUserText: string;
|
|
1084
|
-
registerText: string;
|
|
1085
|
-
loginText: string;
|
|
1086
|
-
existingUserText: string;
|
|
1078
|
+
termsRequired: string;
|
|
1087
1079
|
registerViaGoogleLabel: string;
|
|
1088
1080
|
registerViaGithubLabel: string;
|
|
1089
1081
|
registerViaTwitterLabel: string;
|
|
@@ -1091,6 +1083,11 @@ type RegisterFormTypes = {
|
|
|
1091
1083
|
refCodePlaceholder: string;
|
|
1092
1084
|
userReferenceLabel: string;
|
|
1093
1085
|
userReferencePlaceholder: string;
|
|
1086
|
+
existingUserText: string;
|
|
1087
|
+
termsText: string;
|
|
1088
|
+
iAcceptText: string;
|
|
1089
|
+
registerText: string;
|
|
1090
|
+
loginText: string;
|
|
1094
1091
|
};
|
|
1095
1092
|
};
|
|
1096
1093
|
declare const RegisterForm: FC<RegisterFormTypes>;
|
|
@@ -1142,8 +1139,10 @@ declare const CheckEmail: FC<CheckEmailBlocks>;
|
|
|
1142
1139
|
|
|
1143
1140
|
type NewPasswordTypes = {
|
|
1144
1141
|
handleNewPassword: (e: any) => void;
|
|
1142
|
+
handleRouteToRegister: () => void;
|
|
1145
1143
|
direction?: "rtl" | "ltr";
|
|
1146
1144
|
headless?: boolean;
|
|
1145
|
+
allowRegister?: boolean;
|
|
1147
1146
|
passwordChanged: any;
|
|
1148
1147
|
texts: {
|
|
1149
1148
|
updatePassword: string;
|
|
@@ -1156,6 +1155,8 @@ type NewPasswordTypes = {
|
|
|
1156
1155
|
confirmPasswordPlaceholder: string;
|
|
1157
1156
|
confirmPasswordLabel: string;
|
|
1158
1157
|
confirmPasswordRequired: string;
|
|
1158
|
+
dontHaveAccount?: string;
|
|
1159
|
+
registerText?: string;
|
|
1159
1160
|
};
|
|
1160
1161
|
};
|
|
1161
1162
|
declare const NewPasswordForm: FC<NewPasswordTypes>;
|
|
@@ -1164,18 +1165,21 @@ type ResetPasswordType = {
|
|
|
1164
1165
|
handleResetPassword: (e: any) => void;
|
|
1165
1166
|
handleRouteToRegister: () => void;
|
|
1166
1167
|
sent: any;
|
|
1168
|
+
headless?: boolean;
|
|
1169
|
+
allowRegister?: boolean;
|
|
1170
|
+
direction?: "rtl" | "ltr";
|
|
1167
1171
|
texts?: {
|
|
1168
1172
|
emailLabel: string;
|
|
1169
1173
|
emailPlaceholder: string;
|
|
1170
|
-
|
|
1171
|
-
|
|
1174
|
+
emailRequired: string;
|
|
1175
|
+
emailInvalid: string;
|
|
1172
1176
|
emailSentText: string;
|
|
1173
|
-
resetPassword: string;
|
|
1174
1177
|
registerText: string;
|
|
1178
|
+
resetPassword: string;
|
|
1175
1179
|
dontHaveAccount: string;
|
|
1180
|
+
headTitle?: string;
|
|
1181
|
+
headDescription?: string;
|
|
1176
1182
|
};
|
|
1177
|
-
headless?: boolean;
|
|
1178
|
-
direction?: "rtl" | "ltr";
|
|
1179
1183
|
};
|
|
1180
1184
|
declare const ResetPasswordForm: FC<ResetPasswordType>;
|
|
1181
1185
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1058,32 +1058,24 @@ type RegisterFormTypes = {
|
|
|
1058
1058
|
texts: {
|
|
1059
1059
|
fullNameLabel: string;
|
|
1060
1060
|
fullNamePlaceholder: string;
|
|
1061
|
-
fullNameRequiredText: string;
|
|
1062
1061
|
emailLabel: string;
|
|
1063
1062
|
emailPlaceholder: string;
|
|
1064
|
-
|
|
1065
|
-
|
|
1063
|
+
emailRequired: string;
|
|
1064
|
+
emailInvalid: string;
|
|
1066
1065
|
usernameLabel: string;
|
|
1067
1066
|
usernamePlaceholder: string;
|
|
1068
1067
|
usernameInvalid: string;
|
|
1069
1068
|
usernameRequired: string;
|
|
1070
1069
|
passwordLabel: string;
|
|
1071
1070
|
passwordPlaceholder: string;
|
|
1072
|
-
|
|
1073
|
-
|
|
1071
|
+
passwordRequired: string;
|
|
1072
|
+
passwordTooShort: string;
|
|
1074
1073
|
passwordsDontMatch: string;
|
|
1075
1074
|
confirmPasswordLabel: string;
|
|
1076
1075
|
confirmPasswordPlaceholder: string;
|
|
1077
1076
|
confirmPasswordRequired: string;
|
|
1078
1077
|
subscribeToNewsletter: string;
|
|
1079
|
-
|
|
1080
|
-
termsText: string;
|
|
1081
|
-
iAcceptText: string;
|
|
1082
|
-
termsRequiredText: string;
|
|
1083
|
-
newUserText: string;
|
|
1084
|
-
registerText: string;
|
|
1085
|
-
loginText: string;
|
|
1086
|
-
existingUserText: string;
|
|
1078
|
+
termsRequired: string;
|
|
1087
1079
|
registerViaGoogleLabel: string;
|
|
1088
1080
|
registerViaGithubLabel: string;
|
|
1089
1081
|
registerViaTwitterLabel: string;
|
|
@@ -1091,6 +1083,11 @@ type RegisterFormTypes = {
|
|
|
1091
1083
|
refCodePlaceholder: string;
|
|
1092
1084
|
userReferenceLabel: string;
|
|
1093
1085
|
userReferencePlaceholder: string;
|
|
1086
|
+
existingUserText: string;
|
|
1087
|
+
termsText: string;
|
|
1088
|
+
iAcceptText: string;
|
|
1089
|
+
registerText: string;
|
|
1090
|
+
loginText: string;
|
|
1094
1091
|
};
|
|
1095
1092
|
};
|
|
1096
1093
|
declare const RegisterForm: FC<RegisterFormTypes>;
|
|
@@ -1142,8 +1139,10 @@ declare const CheckEmail: FC<CheckEmailBlocks>;
|
|
|
1142
1139
|
|
|
1143
1140
|
type NewPasswordTypes = {
|
|
1144
1141
|
handleNewPassword: (e: any) => void;
|
|
1142
|
+
handleRouteToRegister: () => void;
|
|
1145
1143
|
direction?: "rtl" | "ltr";
|
|
1146
1144
|
headless?: boolean;
|
|
1145
|
+
allowRegister?: boolean;
|
|
1147
1146
|
passwordChanged: any;
|
|
1148
1147
|
texts: {
|
|
1149
1148
|
updatePassword: string;
|
|
@@ -1156,6 +1155,8 @@ type NewPasswordTypes = {
|
|
|
1156
1155
|
confirmPasswordPlaceholder: string;
|
|
1157
1156
|
confirmPasswordLabel: string;
|
|
1158
1157
|
confirmPasswordRequired: string;
|
|
1158
|
+
dontHaveAccount?: string;
|
|
1159
|
+
registerText?: string;
|
|
1159
1160
|
};
|
|
1160
1161
|
};
|
|
1161
1162
|
declare const NewPasswordForm: FC<NewPasswordTypes>;
|
|
@@ -1164,18 +1165,21 @@ type ResetPasswordType = {
|
|
|
1164
1165
|
handleResetPassword: (e: any) => void;
|
|
1165
1166
|
handleRouteToRegister: () => void;
|
|
1166
1167
|
sent: any;
|
|
1168
|
+
headless?: boolean;
|
|
1169
|
+
allowRegister?: boolean;
|
|
1170
|
+
direction?: "rtl" | "ltr";
|
|
1167
1171
|
texts?: {
|
|
1168
1172
|
emailLabel: string;
|
|
1169
1173
|
emailPlaceholder: string;
|
|
1170
|
-
|
|
1171
|
-
|
|
1174
|
+
emailRequired: string;
|
|
1175
|
+
emailInvalid: string;
|
|
1172
1176
|
emailSentText: string;
|
|
1173
|
-
resetPassword: string;
|
|
1174
1177
|
registerText: string;
|
|
1178
|
+
resetPassword: string;
|
|
1175
1179
|
dontHaveAccount: string;
|
|
1180
|
+
headTitle?: string;
|
|
1181
|
+
headDescription?: string;
|
|
1176
1182
|
};
|
|
1177
|
-
headless?: boolean;
|
|
1178
|
-
direction?: "rtl" | "ltr";
|
|
1179
1183
|
};
|
|
1180
1184
|
declare const ResetPasswordForm: FC<ResetPasswordType>;
|
|
1181
1185
|
|
package/dist/index.js
CHANGED
|
@@ -7171,11 +7171,11 @@ var RegisterForm = function(_param) {
|
|
|
7171
7171
|
break;
|
|
7172
7172
|
case "email":
|
|
7173
7173
|
fieldSchemas["email"] = z2.string({
|
|
7174
|
-
required_error: texts === null || texts === void 0 ? void 0 : texts.
|
|
7174
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
7175
7175
|
}).email({
|
|
7176
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7176
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailInvalid
|
|
7177
7177
|
}).min(1, {
|
|
7178
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7178
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
7179
7179
|
});
|
|
7180
7180
|
break;
|
|
7181
7181
|
case "username":
|
|
@@ -7194,29 +7194,29 @@ var RegisterForm = function(_param) {
|
|
|
7194
7194
|
});
|
|
7195
7195
|
var formSchema = z2.object(_object_spread_props(_object_spread({}, fieldSchemas), {
|
|
7196
7196
|
password: z2.string({
|
|
7197
|
-
required_error: texts === null || texts === void 0 ? void 0 : texts.
|
|
7197
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7198
7198
|
}).min(5, {
|
|
7199
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7199
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
7200
7200
|
}).refine(function(value) {
|
|
7201
7201
|
return value !== "";
|
|
7202
7202
|
}, {
|
|
7203
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7203
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7204
7204
|
}),
|
|
7205
7205
|
confirm_password: z2.string({
|
|
7206
7206
|
required_error: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordRequired
|
|
7207
7207
|
}).refine(function(value) {
|
|
7208
7208
|
return value !== "";
|
|
7209
7209
|
}, {
|
|
7210
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7210
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7211
7211
|
}),
|
|
7212
7212
|
refCode: z2.string().optional(),
|
|
7213
7213
|
reference: z2.string().optional(),
|
|
7214
7214
|
terms_accepted: z2.boolean({
|
|
7215
|
-
required_error: texts === null || texts === void 0 ? void 0 : texts.
|
|
7215
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.termsRequired
|
|
7216
7216
|
}).refine(function(value) {
|
|
7217
7217
|
return value;
|
|
7218
7218
|
}, {
|
|
7219
|
-
message: texts === null || texts === void 0 ? void 0 : texts.
|
|
7219
|
+
message: texts === null || texts === void 0 ? void 0 : texts.termsRequired
|
|
7220
7220
|
}),
|
|
7221
7221
|
newsletter_accepted: z2.boolean().optional()
|
|
7222
7222
|
})).refine(function(data) {
|
|
@@ -7623,6 +7623,7 @@ var NewPasswordForm = function(_param) {
|
|
|
7623
7623
|
resolver: (0, import_zod3.zodResolver)(formSchema)
|
|
7624
7624
|
}), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
|
|
7625
7625
|
var _ref1 = _sliced_to_array((0, import_react42.useState)(false), 2), matchError = _ref1[0], setMatchError = _ref1[1];
|
|
7626
|
+
var _texts_dontHaveAccount, _texts_registerText;
|
|
7626
7627
|
return /* @__PURE__ */ import_react42.default.createElement(Card, {
|
|
7627
7628
|
dir: props.direction
|
|
7628
7629
|
}, matchError && /* @__PURE__ */ import_react42.default.createElement(Alert, {
|
|
@@ -7673,10 +7674,17 @@ var NewPasswordForm = function(_param) {
|
|
|
7673
7674
|
helperText: (_formState_errors_confirm_password = formState.errors.confirm_password) === null || _formState_errors_confirm_password === void 0 ? void 0 : _formState_errors_confirm_password.message
|
|
7674
7675
|
}, field));
|
|
7675
7676
|
}
|
|
7676
|
-
})), /* @__PURE__ */ import_react42.default.createElement(CardFooter,
|
|
7677
|
+
})), /* @__PURE__ */ import_react42.default.createElement(CardFooter, {
|
|
7678
|
+
className: "hawa-flex hawa-flex-col"
|
|
7679
|
+
}, /* @__PURE__ */ import_react42.default.createElement(Button, {
|
|
7677
7680
|
className: "hawa-w-full",
|
|
7678
7681
|
type: "submit"
|
|
7679
|
-
}, texts === null || texts === void 0 ? void 0 : texts.updatePassword)
|
|
7682
|
+
}, texts === null || texts === void 0 ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ import_react42.default.createElement("div", {
|
|
7683
|
+
className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300"
|
|
7684
|
+
}, (_texts_dontHaveAccount = texts === null || texts === void 0 ? void 0 : texts.dontHaveAccount) !== null && _texts_dontHaveAccount !== void 0 ? _texts_dontHaveAccount : "Don't have an account? ", /* @__PURE__ */ import_react42.default.createElement("span", {
|
|
7685
|
+
className: "clickable-link",
|
|
7686
|
+
onClick: props.handleRouteToRegister
|
|
7687
|
+
}, (_texts_registerText = texts === null || texts === void 0 ? void 0 : texts.registerText) !== null && _texts_registerText !== void 0 ? _texts_registerText : "Register")))));
|
|
7680
7688
|
};
|
|
7681
7689
|
// components/blocks/auth/ResetPassword.tsx
|
|
7682
7690
|
var import_react43 = __toESM(require("react"));
|
|
@@ -7684,14 +7692,14 @@ var import_react_hook_form5 = require("react-hook-form");
|
|
|
7684
7692
|
var import_zod4 = require("@hookform/resolvers/zod");
|
|
7685
7693
|
var z4 = __toESM(require("zod"));
|
|
7686
7694
|
var ResetPasswordForm = function(props) {
|
|
7687
|
-
var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6;
|
|
7695
|
+
var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7, _props_texts8;
|
|
7688
7696
|
var formSchema = z4.object({
|
|
7689
7697
|
email: z4.string({
|
|
7690
|
-
required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.
|
|
7698
|
+
required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.emailRequired
|
|
7691
7699
|
}).email({
|
|
7692
|
-
message: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.
|
|
7693
|
-
}).
|
|
7694
|
-
message: (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.
|
|
7700
|
+
message: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.emailInvalid
|
|
7701
|
+
}).min(1, {
|
|
7702
|
+
message: (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.emailRequired
|
|
7695
7703
|
})
|
|
7696
7704
|
});
|
|
7697
7705
|
var _ref = (0, import_react_hook_form5.useForm)({
|
|
@@ -7700,12 +7708,12 @@ var ResetPasswordForm = function(props) {
|
|
|
7700
7708
|
var _props_texts_dontHaveAccount, _props_texts_registerText;
|
|
7701
7709
|
return /* @__PURE__ */ import_react43.default.createElement(Card, {
|
|
7702
7710
|
dir: props.direction
|
|
7703
|
-
}, !props.sent ? /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react43.default.createElement(CardHeader, null, /* @__PURE__ */ import_react43.default.createElement(CardTitle, null, "Reset Password"), /* @__PURE__ */ import_react43.default.createElement(CardDescription, null, "Enter your email to reset your account password")), /* @__PURE__ */ import_react43.default.createElement("form", {
|
|
7711
|
+
}, !props.sent ? /* @__PURE__ */ import_react43.default.createElement(import_react43.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react43.default.createElement(CardHeader, null, /* @__PURE__ */ import_react43.default.createElement(CardTitle, null, " ", ((_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.headTitle) || "Reset Password"), /* @__PURE__ */ import_react43.default.createElement(CardDescription, null, ((_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ import_react43.default.createElement("form", {
|
|
7704
7712
|
onSubmit: handleSubmit(function(e) {
|
|
7705
7713
|
if (props.handleResetPassword) {
|
|
7706
7714
|
return props.handleResetPassword(e);
|
|
7707
7715
|
} else {
|
|
7708
|
-
console.log("
|
|
7716
|
+
console.log("handleResetPassword prop is missing");
|
|
7709
7717
|
}
|
|
7710
7718
|
})
|
|
7711
7719
|
}, /* @__PURE__ */ import_react43.default.createElement(CardContent, {
|
|
@@ -7713,33 +7721,31 @@ var ResetPasswordForm = function(props) {
|
|
|
7713
7721
|
}, /* @__PURE__ */ import_react43.default.createElement(import_react_hook_form5.Controller, {
|
|
7714
7722
|
control: control,
|
|
7715
7723
|
name: "email",
|
|
7716
|
-
render: function(param)
|
|
7724
|
+
render: function(param) {
|
|
7717
7725
|
var field = param.field;
|
|
7718
7726
|
var _props_texts, _formState_errors_email, _props_texts1;
|
|
7719
|
-
|
|
7720
|
-
return import_react43.default.createElement(Input, _object_spread_props(_object_spread({
|
|
7727
|
+
return /* @__PURE__ */ import_react43.default.createElement(Input, _object_spread({
|
|
7721
7728
|
width: "full",
|
|
7722
|
-
type: "text",
|
|
7723
7729
|
label: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.emailLabel,
|
|
7724
7730
|
helperText: (_formState_errors_email = formState.errors.email) === null || _formState_errors_email === void 0 ? void 0 : _formState_errors_email.message,
|
|
7725
7731
|
placeholder: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.emailPlaceholder
|
|
7726
|
-
}, field)
|
|
7727
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7728
|
-
}));
|
|
7732
|
+
}, field));
|
|
7729
7733
|
}
|
|
7730
|
-
}), /* @__PURE__ */ import_react43.default.createElement(
|
|
7731
|
-
className: "hawa-
|
|
7732
|
-
},
|
|
7733
|
-
onClick: props.handleRouteToRegister,
|
|
7734
|
-
className: "clickable-link"
|
|
7735
|
-
}, (_props_texts_registerText = (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.registerText) !== null && _props_texts_registerText !== void 0 ? _props_texts_registerText : "Register"))), /* @__PURE__ */ import_react43.default.createElement(CardFooter, null, /* @__PURE__ */ import_react43.default.createElement(Button, {
|
|
7734
|
+
})), /* @__PURE__ */ import_react43.default.createElement(CardFooter, {
|
|
7735
|
+
className: "hawa-flex hawa-flex-col"
|
|
7736
|
+
}, /* @__PURE__ */ import_react43.default.createElement(Button, {
|
|
7736
7737
|
type: "submit",
|
|
7737
7738
|
className: "hawa-w-full"
|
|
7738
|
-
}, (_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.resetPassword)
|
|
7739
|
+
}, (_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.resetPassword), props.allowRegister && /* @__PURE__ */ import_react43.default.createElement("div", {
|
|
7740
|
+
className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300"
|
|
7741
|
+
}, (_props_texts_dontHaveAccount = (_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.dontHaveAccount) !== null && _props_texts_dontHaveAccount !== void 0 ? _props_texts_dontHaveAccount : "Don't have an account? ", /* @__PURE__ */ import_react43.default.createElement("span", {
|
|
7742
|
+
className: "clickable-link",
|
|
7743
|
+
onClick: props.handleRouteToRegister
|
|
7744
|
+
}, (_props_texts_registerText = (_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.registerText) !== null && _props_texts_registerText !== void 0 ? _props_texts_registerText : "Register"))))) : /* @__PURE__ */ import_react43.default.createElement(CardContent, {
|
|
7739
7745
|
headless: true
|
|
7740
7746
|
}, /* @__PURE__ */ import_react43.default.createElement("div", {
|
|
7741
7747
|
className: "hawa-text-center"
|
|
7742
|
-
}, (
|
|
7748
|
+
}, (_props_texts8 = props.texts) === null || _props_texts8 === void 0 ? void 0 : _props_texts8.emailSentText)));
|
|
7743
7749
|
};
|
|
7744
7750
|
// components/blocks/auth/CodeConfirmation.tsx
|
|
7745
7751
|
var import_react44 = __toESM(require("react"));
|
package/dist/index.mjs
CHANGED
|
@@ -7052,7 +7052,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
7052
7052
|
fieldSchemas["fullName"] = z2.string().optional();
|
|
7053
7053
|
break;
|
|
7054
7054
|
case "email":
|
|
7055
|
-
fieldSchemas["email"] = z2.string({ required_error: texts?.
|
|
7055
|
+
fieldSchemas["email"] = z2.string({ required_error: texts?.emailRequired }).email({ message: texts?.emailInvalid }).min(1, { message: texts?.emailRequired });
|
|
7056
7056
|
break;
|
|
7057
7057
|
case "username":
|
|
7058
7058
|
fieldSchemas["username"] = z2.string({ required_error: texts?.usernameRequired }).min(1, { message: texts?.usernameRequired }).refine(
|
|
@@ -7067,15 +7067,15 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
7067
7067
|
});
|
|
7068
7068
|
const formSchema = z2.object({
|
|
7069
7069
|
...fieldSchemas,
|
|
7070
|
-
password: z2.string({ required_error: texts?.
|
|
7071
|
-
message: texts?.
|
|
7070
|
+
password: z2.string({ required_error: texts?.passwordRequired }).min(5, { message: texts?.passwordTooShort }).refine((value) => value !== "", {
|
|
7071
|
+
message: texts?.passwordRequired
|
|
7072
7072
|
}),
|
|
7073
7073
|
confirm_password: z2.string({ required_error: texts?.confirmPasswordRequired }).refine((value) => value !== "", {
|
|
7074
|
-
message: texts?.
|
|
7074
|
+
message: texts?.passwordRequired
|
|
7075
7075
|
}),
|
|
7076
7076
|
refCode: z2.string().optional(),
|
|
7077
7077
|
reference: z2.string().optional(),
|
|
7078
|
-
terms_accepted: z2.boolean({ required_error: texts?.
|
|
7078
|
+
terms_accepted: z2.boolean({ required_error: texts?.termsRequired }).refine((value) => value, { message: texts?.termsRequired }),
|
|
7079
7079
|
newsletter_accepted: z2.boolean().optional()
|
|
7080
7080
|
}).refine((data) => data.password === data.confirm_password, {
|
|
7081
7081
|
message: texts?.passwordsDontMatch,
|
|
@@ -7579,7 +7579,14 @@ var NewPasswordForm = ({ texts, ...props }) => {
|
|
|
7579
7579
|
}
|
|
7580
7580
|
)
|
|
7581
7581
|
),
|
|
7582
|
-
/* @__PURE__ */ React62.createElement(CardFooter,
|
|
7582
|
+
/* @__PURE__ */ React62.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React62.createElement(Button, { className: "hawa-w-full", type: "submit" }, texts?.updatePassword), props.allowRegister && /* @__PURE__ */ React62.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, texts?.dontHaveAccount ?? "Don't have an account? ", /* @__PURE__ */ React62.createElement(
|
|
7583
|
+
"span",
|
|
7584
|
+
{
|
|
7585
|
+
className: "clickable-link",
|
|
7586
|
+
onClick: props.handleRouteToRegister
|
|
7587
|
+
},
|
|
7588
|
+
texts?.registerText ?? "Register"
|
|
7589
|
+
)))
|
|
7583
7590
|
));
|
|
7584
7591
|
};
|
|
7585
7592
|
|
|
@@ -7590,21 +7597,19 @@ import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
|
7590
7597
|
import * as z4 from "zod";
|
|
7591
7598
|
var ResetPasswordForm = (props) => {
|
|
7592
7599
|
const formSchema = z4.object({
|
|
7593
|
-
email: z4.string({ required_error: props.texts?.
|
|
7600
|
+
email: z4.string({ required_error: props.texts?.emailRequired }).email({ message: props.texts?.emailInvalid }).min(1, { message: props.texts?.emailRequired })
|
|
7594
7601
|
});
|
|
7595
7602
|
const { handleSubmit, control, formState } = useForm4({
|
|
7596
7603
|
resolver: zodResolver4(formSchema)
|
|
7597
7604
|
});
|
|
7598
|
-
return /* @__PURE__ */ React63.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ React63.createElement(React63.Fragment, null, !props.headless && /* @__PURE__ */ React63.createElement(CardHeader, null, /* @__PURE__ */ React63.createElement(CardTitle, null, "Reset Password"), /* @__PURE__ */ React63.createElement(CardDescription, null, "Enter your email to reset your account password")), /* @__PURE__ */ React63.createElement(
|
|
7605
|
+
return /* @__PURE__ */ React63.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ React63.createElement(React63.Fragment, null, !props.headless && /* @__PURE__ */ React63.createElement(CardHeader, null, /* @__PURE__ */ React63.createElement(CardTitle, null, " ", props.texts?.headTitle || "Reset Password"), /* @__PURE__ */ React63.createElement(CardDescription, null, props.texts?.headDescription || "Enter your email to reset your account password")), /* @__PURE__ */ React63.createElement(
|
|
7599
7606
|
"form",
|
|
7600
7607
|
{
|
|
7601
7608
|
onSubmit: handleSubmit((e) => {
|
|
7602
7609
|
if (props.handleResetPassword) {
|
|
7603
7610
|
return props.handleResetPassword(e);
|
|
7604
7611
|
} else {
|
|
7605
|
-
console.log(
|
|
7606
|
-
"Form is submitted but handleResetPassword prop is missing"
|
|
7607
|
-
);
|
|
7612
|
+
console.log("handleResetPassword prop is missing");
|
|
7608
7613
|
}
|
|
7609
7614
|
})
|
|
7610
7615
|
},
|
|
@@ -7617,24 +7622,22 @@ var ResetPasswordForm = (props) => {
|
|
|
7617
7622
|
Input,
|
|
7618
7623
|
{
|
|
7619
7624
|
width: "full",
|
|
7620
|
-
type: "text",
|
|
7621
7625
|
label: props.texts?.emailLabel,
|
|
7622
7626
|
helperText: formState.errors.email?.message,
|
|
7623
7627
|
placeholder: props.texts?.emailPlaceholder,
|
|
7624
|
-
...field
|
|
7625
|
-
value: field.value ?? ""
|
|
7628
|
+
...field
|
|
7626
7629
|
}
|
|
7627
7630
|
)
|
|
7628
7631
|
}
|
|
7629
|
-
),
|
|
7632
|
+
)),
|
|
7633
|
+
/* @__PURE__ */ React63.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React63.createElement(Button, { type: "submit", className: "hawa-w-full" }, props.texts?.resetPassword), props.allowRegister && /* @__PURE__ */ React63.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, props.texts?.dontHaveAccount ?? "Don't have an account? ", /* @__PURE__ */ React63.createElement(
|
|
7630
7634
|
"span",
|
|
7631
7635
|
{
|
|
7632
|
-
|
|
7633
|
-
|
|
7636
|
+
className: "clickable-link",
|
|
7637
|
+
onClick: props.handleRouteToRegister
|
|
7634
7638
|
},
|
|
7635
7639
|
props.texts?.registerText ?? "Register"
|
|
7636
|
-
)))
|
|
7637
|
-
/* @__PURE__ */ React63.createElement(CardFooter, null, /* @__PURE__ */ React63.createElement(Button, { type: "submit", className: "hawa-w-full" }, props.texts?.resetPassword))
|
|
7640
|
+
)))
|
|
7638
7641
|
)) : /* @__PURE__ */ React63.createElement(CardContent, { headless: true }, /* @__PURE__ */ React63.createElement("div", { className: "hawa-text-center" }, props.texts?.emailSentText)));
|
|
7639
7642
|
};
|
|
7640
7643
|
|