@sikka/hawa 0.10.14-next → 0.10.16-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/index.d.mts +55 -48
- package/dist/index.d.ts +55 -48
- package/dist/index.js +170 -211
- package/dist/index.mjs +117 -134
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -4734,8 +4734,8 @@ var PhoneInput = function(props) {
|
|
|
4734
4734
|
value: phoneNumber,
|
|
4735
4735
|
type: "tel",
|
|
4736
4736
|
placeholder: "531045453"
|
|
4737
|
-
}))),
|
|
4738
|
-
className: "hawa-my-0 hawa-text-xs hawa-text-helper-color"
|
|
4737
|
+
}))), /* @__PURE__ */ import_react21.default.createElement("p", {
|
|
4738
|
+
className: cn("hawa-my-0 hawa-text-xs hawa-text-helper-color hawa-transition-all", props.helperText ? "hawa-opacity-100 hawa-h-4" : "hawa-opacity-0 hawa-h-0")
|
|
4739
4739
|
}, props.helperText));
|
|
4740
4740
|
};
|
|
4741
4741
|
{}// components/elements/AppStores.tsx
|
|
@@ -4961,7 +4961,7 @@ var Input = function(_param) {
|
|
|
4961
4961
|
auto: ""
|
|
4962
4962
|
};
|
|
4963
4963
|
var defaultStyle = "hawa-flex hawa-max-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
|
4964
|
-
var defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-
|
|
4964
|
+
var defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
|
4965
4965
|
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
4966
4966
|
className: cn(defaultStyle, marginStyles[margin], widthStyles[width], props.containerClassName, "hawa-w-full hawa-gap-2")
|
|
4967
4967
|
}, props.label && /* @__PURE__ */ import_react24.default.createElement(Label2, {
|
|
@@ -6046,7 +6046,7 @@ var Combobox = function(_param) {
|
|
|
6046
6046
|
}), /* @__PURE__ */ React47.createElement("button", {
|
|
6047
6047
|
role: "combobox",
|
|
6048
6048
|
"aria-expanded": open,
|
|
6049
|
-
className: cn("hawa-text-primary hawa-border hawa-h-10 hawa-py-2 hawa-justify-between hawa-w-full hawa-font-normal hawa-inline-flex hawa-items-center hawa-transition-all hawa-select-none hawa-rounded-md hawa-text-sm hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50", props.preview ? "hawa-px-0 hawa-rounded-none hawa-border-transparent hawa-cursor-default" : "hawa-px-
|
|
6049
|
+
className: cn("hawa-text-primary hawa-border hawa-h-10 hawa-py-2 hawa-justify-between hawa-w-full hawa-font-normal hawa-inline-flex hawa-items-center hawa-transition-all hawa-select-none hawa-rounded-md hawa-text-sm hawa-ring-offset-background focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-2 disabled:hawa-pointer-events-none disabled:hawa-opacity-50", props.preview ? "hawa-px-0 hawa-rounded-none hawa-border-transparent hawa-cursor-default" : "hawa-px-3 hawa-bg-background ")
|
|
6050
6050
|
}, value ? getProperty(data.find(function(item) {
|
|
6051
6051
|
return item[valueKey] === value;
|
|
6052
6052
|
}) || {}, labelKey) : props.placeholder || "...", !props.preview && /* @__PURE__ */ React47.createElement("svg", {
|
|
@@ -6849,67 +6849,70 @@ var Copyrights = function(props) {
|
|
|
6849
6849
|
var import_react37 = __toESM(require("react"));
|
|
6850
6850
|
var import_react_hook_form2 = require("react-hook-form");
|
|
6851
6851
|
var import_zod = require("@hookform/resolvers/zod");
|
|
6852
|
+
var import_libphonenumber_js = require("libphonenumber-js");
|
|
6852
6853
|
var z = __toESM(require("zod"));
|
|
6853
6854
|
var LoginForm = function(_param) {
|
|
6854
|
-
var loginType = _param.loginType, props = _object_without_properties(_param, [
|
|
6855
|
-
"loginType"
|
|
6855
|
+
var loginType = _param.loginType, texts = _param.texts, props = _object_without_properties(_param, [
|
|
6856
|
+
"loginType",
|
|
6857
|
+
"texts"
|
|
6856
6858
|
]);
|
|
6857
|
-
var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5;
|
|
6858
6859
|
var formSchema;
|
|
6859
6860
|
if (loginType === "email") {
|
|
6860
|
-
var _props_texts6, _props_texts7, _props_texts8, _props_texts9, _props_texts10;
|
|
6861
6861
|
formSchema = z.object({
|
|
6862
6862
|
email: z.string({
|
|
6863
|
-
required_error:
|
|
6864
|
-
}).
|
|
6865
|
-
message:
|
|
6863
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
6864
|
+
}).min(1, {
|
|
6865
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
6866
6866
|
}).email({
|
|
6867
|
-
message:
|
|
6867
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailInvalid
|
|
6868
6868
|
}),
|
|
6869
6869
|
password: z.string({
|
|
6870
|
-
required_error:
|
|
6871
|
-
}).min(
|
|
6872
|
-
message:
|
|
6873
|
-
}).
|
|
6874
|
-
message:
|
|
6870
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6871
|
+
}).min(1, {
|
|
6872
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6873
|
+
}).min(8, {
|
|
6874
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
6875
6875
|
})
|
|
6876
6876
|
});
|
|
6877
6877
|
} else if (loginType === "username") {
|
|
6878
|
-
var _props_texts11, _props_texts12, _props_texts13;
|
|
6879
6878
|
formSchema = z.object({
|
|
6880
|
-
username: z.string(
|
|
6879
|
+
username: z.string({
|
|
6880
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
|
|
6881
|
+
}).min(2, {
|
|
6881
6882
|
message: "Username must be at least 2 characters"
|
|
6882
|
-
}).
|
|
6883
|
-
|
|
6883
|
+
}).refine(function(value) {
|
|
6884
|
+
var isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
|
|
6885
|
+
return isValid;
|
|
6886
|
+
}, {
|
|
6887
|
+
message: texts === null || texts === void 0 ? void 0 : texts.usernameInvalid
|
|
6884
6888
|
}),
|
|
6885
6889
|
password: z.string({
|
|
6886
|
-
required_error:
|
|
6887
|
-
}).min(
|
|
6888
|
-
message:
|
|
6889
|
-
}).
|
|
6890
|
-
message:
|
|
6890
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6891
|
+
}).min(1, {
|
|
6892
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6893
|
+
}).min(8, {
|
|
6894
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
6891
6895
|
})
|
|
6892
6896
|
});
|
|
6893
6897
|
} else if (loginType === "phone") {
|
|
6894
|
-
var _props_texts14, _props_texts15;
|
|
6895
6898
|
formSchema = z.object({
|
|
6896
6899
|
phone: z.string({
|
|
6897
|
-
required_error:
|
|
6900
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.phoneRequired
|
|
6898
6901
|
}).refine(function(value) {
|
|
6899
|
-
|
|
6902
|
+
var phoneNumber = (0, import_libphonenumber_js.parsePhoneNumber)(value);
|
|
6903
|
+
return phoneNumber.isValid();
|
|
6900
6904
|
}, {
|
|
6901
|
-
message:
|
|
6905
|
+
message: texts === null || texts === void 0 ? void 0 : texts.phoneInvalid
|
|
6902
6906
|
})
|
|
6903
6907
|
});
|
|
6904
6908
|
} else if (loginType === "link") {
|
|
6905
|
-
var _props_texts16, _props_texts17, _props_texts18;
|
|
6906
6909
|
formSchema = z.object({
|
|
6907
6910
|
email: z.string({
|
|
6908
|
-
required_error:
|
|
6909
|
-
}).
|
|
6910
|
-
message:
|
|
6911
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
6912
|
+
}).min(1, {
|
|
6913
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailRequired
|
|
6911
6914
|
}).email({
|
|
6912
|
-
message:
|
|
6915
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailInvalid
|
|
6913
6916
|
})
|
|
6914
6917
|
});
|
|
6915
6918
|
} else {
|
|
@@ -6921,89 +6924,73 @@ var LoginForm = function(_param) {
|
|
|
6921
6924
|
var renderFields = function() {
|
|
6922
6925
|
switch(loginType){
|
|
6923
6926
|
case "email":
|
|
6924
|
-
var _props_texts;
|
|
6925
6927
|
return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
6926
6928
|
control: control,
|
|
6927
6929
|
name: "email",
|
|
6928
|
-
render: function(param)
|
|
6930
|
+
render: function(param) {
|
|
6929
6931
|
var field = param.field;
|
|
6930
|
-
var
|
|
6931
|
-
|
|
6932
|
-
return import_react37.default.createElement(Input, {
|
|
6932
|
+
var _formState_errors_email;
|
|
6933
|
+
return /* @__PURE__ */ import_react37.default.createElement(Input, _object_spread({
|
|
6933
6934
|
width: "full",
|
|
6934
|
-
type: "text",
|
|
6935
6935
|
autoComplete: "email",
|
|
6936
|
-
label: (
|
|
6936
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.emailLabel) || "Email",
|
|
6937
6937
|
helperText: (_formState_errors_email = formState.errors.email) === null || _formState_errors_email === void 0 ? void 0 : _formState_errors_email.message,
|
|
6938
|
-
placeholder: (
|
|
6939
|
-
|
|
6940
|
-
onChange: field.onChange
|
|
6941
|
-
});
|
|
6938
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.emailPlaceholder) || "contact@sikka.io"
|
|
6939
|
+
}, field));
|
|
6942
6940
|
}
|
|
6943
6941
|
}), /* @__PURE__ */ import_react37.default.createElement("div", null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
6944
6942
|
control: control,
|
|
6945
6943
|
name: "password",
|
|
6946
|
-
render: function(param)
|
|
6944
|
+
render: function(param) {
|
|
6947
6945
|
var field = param.field;
|
|
6948
|
-
var
|
|
6949
|
-
|
|
6950
|
-
return import_react37.default.createElement(Input, {
|
|
6946
|
+
var _formState_errors_password;
|
|
6947
|
+
return /* @__PURE__ */ import_react37.default.createElement(Input, _object_spread({
|
|
6951
6948
|
width: "full",
|
|
6952
6949
|
autoComplete: "current-password",
|
|
6953
6950
|
type: "password",
|
|
6954
|
-
label: (
|
|
6955
|
-
placeholder: (
|
|
6956
|
-
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
6957
|
-
|
|
6958
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
6959
|
-
});
|
|
6951
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.passwordLabel) || "Password",
|
|
6952
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.passwordPlaceholder) || "Enter your password",
|
|
6953
|
+
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
6954
|
+
}, field));
|
|
6960
6955
|
}
|
|
6961
6956
|
}), !props.withoutResetPassword && /* @__PURE__ */ import_react37.default.createElement("div", {
|
|
6962
6957
|
onClick: props.onForgotPassword,
|
|
6963
6958
|
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-text-xs dark:hawa-text-gray-300"
|
|
6964
|
-
}, (
|
|
6959
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.forgotPassword) || "Forgot Password?")));
|
|
6965
6960
|
case "username":
|
|
6966
|
-
var _props_texts1;
|
|
6967
6961
|
return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
6968
6962
|
control: control,
|
|
6969
6963
|
name: "username",
|
|
6970
6964
|
render: function(param) {
|
|
6971
6965
|
var field = param.field;
|
|
6972
|
-
var
|
|
6973
|
-
|
|
6974
|
-
return /* @__PURE__ */ import_react37.default.createElement(Input, {
|
|
6966
|
+
var _formState_errors_username;
|
|
6967
|
+
return /* @__PURE__ */ import_react37.default.createElement(Input, _object_spread({
|
|
6975
6968
|
width: "full",
|
|
6976
|
-
type: "text",
|
|
6977
6969
|
autoComplete: "username",
|
|
6978
|
-
label: (
|
|
6970
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.usernameLabel) || "Username",
|
|
6979
6971
|
helperText: (_formState_errors_username = formState.errors.username) === null || _formState_errors_username === void 0 ? void 0 : _formState_errors_username.message,
|
|
6980
|
-
placeholder: (
|
|
6981
|
-
|
|
6982
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
6983
|
-
});
|
|
6972
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.usernamePlaceholder) || "sikka_sa"
|
|
6973
|
+
}, field));
|
|
6984
6974
|
}
|
|
6985
6975
|
}), /* @__PURE__ */ import_react37.default.createElement("div", null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
6986
6976
|
control: control,
|
|
6987
6977
|
name: "password",
|
|
6988
|
-
render: function(param)
|
|
6978
|
+
render: function(param) {
|
|
6989
6979
|
var field = param.field;
|
|
6990
|
-
var
|
|
6991
|
-
|
|
6992
|
-
return import_react37.default.createElement(Input, {
|
|
6980
|
+
var _formState_errors_password;
|
|
6981
|
+
return /* @__PURE__ */ import_react37.default.createElement(Input, _object_spread({
|
|
6993
6982
|
width: "full",
|
|
6994
6983
|
autoComplete: "current-password",
|
|
6995
6984
|
type: "password",
|
|
6996
|
-
label: (
|
|
6997
|
-
placeholder: (
|
|
6998
|
-
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
6999
|
-
|
|
7000
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7001
|
-
});
|
|
6985
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.passwordLabel) || "Password",
|
|
6986
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.passwordPlaceholder) || "Enter your password",
|
|
6987
|
+
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
6988
|
+
}, field));
|
|
7002
6989
|
}
|
|
7003
6990
|
}), !props.withoutResetPassword && /* @__PURE__ */ import_react37.default.createElement("div", {
|
|
7004
6991
|
onClick: props.onForgotPassword,
|
|
7005
6992
|
className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-text-xs dark:hawa-text-gray-300"
|
|
7006
|
-
}, (
|
|
6993
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.forgotPassword) || "Forgot Password?")));
|
|
7007
6994
|
case "phone":
|
|
7008
6995
|
return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
7009
6996
|
control: control,
|
|
@@ -7012,12 +6999,14 @@ var LoginForm = function(_param) {
|
|
|
7012
6999
|
var field = param.field;
|
|
7013
7000
|
var _formState_errors_phone;
|
|
7014
7001
|
return /* @__PURE__ */ import_react37.default.createElement(PhoneInput, {
|
|
7015
|
-
label:
|
|
7002
|
+
label: texts === null || texts === void 0 ? void 0 : texts.phoneLabel,
|
|
7016
7003
|
helperText: (_formState_errors_phone = formState.errors.phone) === null || _formState_errors_phone === void 0 ? void 0 : _formState_errors_phone.message,
|
|
7017
7004
|
preferredCountry: {
|
|
7018
7005
|
label: "+966"
|
|
7019
7006
|
},
|
|
7020
|
-
handleChange:
|
|
7007
|
+
handleChange: function(e) {
|
|
7008
|
+
return field.onChange((0, import_libphonenumber_js.parsePhoneNumber)(e).number);
|
|
7009
|
+
}
|
|
7021
7010
|
});
|
|
7022
7011
|
}
|
|
7023
7012
|
}));
|
|
@@ -7025,20 +7014,16 @@ var LoginForm = function(_param) {
|
|
|
7025
7014
|
return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.Controller, {
|
|
7026
7015
|
control: control,
|
|
7027
7016
|
name: "email",
|
|
7028
|
-
render: function(param)
|
|
7017
|
+
render: function(param) {
|
|
7029
7018
|
var field = param.field;
|
|
7030
|
-
var
|
|
7031
|
-
|
|
7032
|
-
return import_react37.default.createElement(Input, {
|
|
7019
|
+
var _formState_errors_email;
|
|
7020
|
+
return /* @__PURE__ */ import_react37.default.createElement(Input, _object_spread({
|
|
7033
7021
|
width: "full",
|
|
7034
|
-
type: "text",
|
|
7035
7022
|
autoComplete: "email",
|
|
7036
|
-
label: (
|
|
7023
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.emailLabel) || "Email",
|
|
7037
7024
|
helperText: (_formState_errors_email = formState.errors.email) === null || _formState_errors_email === void 0 ? void 0 : _formState_errors_email.message,
|
|
7038
|
-
placeholder: (
|
|
7039
|
-
|
|
7040
|
-
onChange: field.onChange
|
|
7041
|
-
});
|
|
7025
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.emailPlaceholder) || "contact@sikka.io"
|
|
7026
|
+
}, field));
|
|
7042
7027
|
}
|
|
7043
7028
|
}));
|
|
7044
7029
|
default:
|
|
@@ -7068,12 +7053,12 @@ var LoginForm = function(_param) {
|
|
|
7068
7053
|
className: "hawa-mt-0 hawa-w-full",
|
|
7069
7054
|
type: "submit",
|
|
7070
7055
|
isLoading: props.isLoading
|
|
7071
|
-
}, (
|
|
7056
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.loginText) || "Login"), props.additionalButtons, !props.withoutRegister && /* @__PURE__ */ import_react37.default.createElement("div", {
|
|
7072
7057
|
className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal hawa-select-none dark:hawa-text-gray-300"
|
|
7073
|
-
}, (
|
|
7058
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react37.default.createElement("span", {
|
|
7074
7059
|
onClick: props.onRouteToRegister,
|
|
7075
7060
|
className: "clickable-link"
|
|
7076
|
-
}, (
|
|
7061
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.createAccount) || "Create Account")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(CardFooter, {
|
|
7077
7062
|
className: cn(props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2")
|
|
7078
7063
|
}, props.viaGoogle && /* @__PURE__ */ import_react37.default.createElement(Button, {
|
|
7079
7064
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
@@ -7083,7 +7068,7 @@ var LoginForm = function(_param) {
|
|
|
7083
7068
|
size: "button"
|
|
7084
7069
|
}) : /* @__PURE__ */ import_react37.default.createElement(Logos.google, {
|
|
7085
7070
|
className: "hawa-h-4 hawa-w-4"
|
|
7086
|
-
}), !props.logosOnly && (
|
|
7071
|
+
}), !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.loginViaGoogleLabel)), props.viaGithub && /* @__PURE__ */ import_react37.default.createElement(Button, {
|
|
7087
7072
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
7088
7073
|
variant: "outline",
|
|
7089
7074
|
onClick: props.onGithubLogin
|
|
@@ -7091,7 +7076,7 @@ var LoginForm = function(_param) {
|
|
|
7091
7076
|
size: "button"
|
|
7092
7077
|
}) : /* @__PURE__ */ import_react37.default.createElement(Logos.github, {
|
|
7093
7078
|
className: "hawa-h-4 hawa-w-4"
|
|
7094
|
-
}), !props.logosOnly && (
|
|
7079
|
+
}), !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.loginViaGithubLabel)), props.viaTwitter && /* @__PURE__ */ import_react37.default.createElement(Button, {
|
|
7095
7080
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
7096
7081
|
variant: "outline",
|
|
7097
7082
|
onClick: props.onTwitterLogin
|
|
@@ -7099,7 +7084,7 @@ var LoginForm = function(_param) {
|
|
|
7099
7084
|
size: "button"
|
|
7100
7085
|
}) : /* @__PURE__ */ import_react37.default.createElement(Logos.twitter, {
|
|
7101
7086
|
className: "hawa-h-4 hawa-w-4"
|
|
7102
|
-
}), " ", !props.logosOnly && (
|
|
7087
|
+
}), " ", !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.loginViaTwitterLabel))) : null), props.handleColorMode && props.handleLanguage && /* @__PURE__ */ import_react37.default.createElement(InterfaceSettings, {
|
|
7103
7088
|
currentColorMode: props.currentColorMode,
|
|
7104
7089
|
currentLanguage: props.currentLanguage,
|
|
7105
7090
|
handleColorMode: props.handleColorMode,
|
|
@@ -7111,9 +7096,11 @@ var import_react38 = __toESM(require("react"));
|
|
|
7111
7096
|
var import_react_hook_form3 = require("react-hook-form");
|
|
7112
7097
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
7113
7098
|
var z2 = __toESM(require("zod"));
|
|
7114
|
-
var RegisterForm = function(
|
|
7099
|
+
var RegisterForm = function(_param) {
|
|
7100
|
+
var texts = _param.texts, props = _object_without_properties(_param, [
|
|
7101
|
+
"texts"
|
|
7102
|
+
]);
|
|
7115
7103
|
var methods = (0, import_react_hook_form3.useForm)();
|
|
7116
|
-
var _props_texts = props.texts, usernamePlaceholder = _props_texts.usernamePlaceholder, usernameRequired = _props_texts.usernameRequired, emailInvalidText = _props_texts.emailInvalidText, emailPlaceholder = _props_texts.emailPlaceholder, emailRequiredText = _props_texts.emailRequiredText, passwordPlaceholder = _props_texts.passwordPlaceholder, passwordRequiredText = _props_texts.passwordRequiredText, passwordTooShortText = _props_texts.passwordTooShortText, passwordsDontMatch = _props_texts.passwordsDontMatch, confirmPasswordRequired = _props_texts.confirmPasswordRequired, confirmPasswordPlaceholder = _props_texts.confirmPasswordPlaceholder, termsRequiredText = _props_texts.termsRequiredText, fullNameRequiredText = _props_texts.fullNameRequiredText;
|
|
7117
7104
|
var fieldSchemas = {};
|
|
7118
7105
|
props.registerFields.forEach(function(field) {
|
|
7119
7106
|
switch(field){
|
|
@@ -7122,55 +7109,55 @@ var RegisterForm = function(props) {
|
|
|
7122
7109
|
break;
|
|
7123
7110
|
case "email":
|
|
7124
7111
|
fieldSchemas["email"] = z2.string({
|
|
7125
|
-
required_error: emailRequiredText
|
|
7112
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.emailRequiredText
|
|
7126
7113
|
}).email({
|
|
7127
|
-
message: emailInvalidText
|
|
7128
|
-
}).
|
|
7129
|
-
message:
|
|
7114
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailInvalidText
|
|
7115
|
+
}).min(1, {
|
|
7116
|
+
message: texts === null || texts === void 0 ? void 0 : texts.emailRequiredText
|
|
7130
7117
|
});
|
|
7131
7118
|
break;
|
|
7132
7119
|
case "username":
|
|
7133
7120
|
fieldSchemas["username"] = z2.string({
|
|
7134
|
-
required_error: usernameRequired
|
|
7121
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
|
|
7135
7122
|
}).refine(function(value) {
|
|
7136
7123
|
return value !== "";
|
|
7137
7124
|
}, {
|
|
7138
|
-
message: usernameRequired
|
|
7125
|
+
message: texts === null || texts === void 0 ? void 0 : texts.usernameRequired
|
|
7139
7126
|
});
|
|
7140
7127
|
break;
|
|
7141
7128
|
}
|
|
7142
7129
|
});
|
|
7143
7130
|
var formSchema = z2.object(_object_spread_props(_object_spread({}, fieldSchemas), {
|
|
7144
7131
|
password: z2.string({
|
|
7145
|
-
required_error: passwordRequiredText
|
|
7132
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequiredText
|
|
7146
7133
|
}).min(5, {
|
|
7147
|
-
message: passwordTooShortText
|
|
7134
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShortText
|
|
7148
7135
|
}).refine(function(value) {
|
|
7149
7136
|
return value !== "";
|
|
7150
7137
|
}, {
|
|
7151
|
-
message: passwordRequiredText
|
|
7138
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequiredText
|
|
7152
7139
|
}),
|
|
7153
7140
|
confirm_password: z2.string({
|
|
7154
|
-
required_error: confirmPasswordRequired
|
|
7141
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordRequired
|
|
7155
7142
|
}).refine(function(value) {
|
|
7156
7143
|
return value !== "";
|
|
7157
7144
|
}, {
|
|
7158
|
-
message: passwordRequiredText
|
|
7145
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequiredText
|
|
7159
7146
|
}),
|
|
7160
7147
|
refCode: z2.string().optional(),
|
|
7161
7148
|
reference: z2.string().optional(),
|
|
7162
7149
|
terms_accepted: z2.boolean({
|
|
7163
|
-
required_error: termsRequiredText
|
|
7150
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.termsRequiredText
|
|
7164
7151
|
}).refine(function(value) {
|
|
7165
7152
|
return value;
|
|
7166
7153
|
}, {
|
|
7167
|
-
message: termsRequiredText
|
|
7154
|
+
message: texts === null || texts === void 0 ? void 0 : texts.termsRequiredText
|
|
7168
7155
|
}),
|
|
7169
7156
|
newsletter_accepted: z2.boolean().optional()
|
|
7170
7157
|
})).refine(function(data) {
|
|
7171
7158
|
return data.password === data.confirm_password;
|
|
7172
7159
|
}, {
|
|
7173
|
-
message: passwordsDontMatch,
|
|
7160
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordsDontMatch,
|
|
7174
7161
|
path: [
|
|
7175
7162
|
"confirm_password"
|
|
7176
7163
|
]
|
|
@@ -7205,19 +7192,15 @@ var RegisterForm = function(props) {
|
|
|
7205
7192
|
key: i,
|
|
7206
7193
|
control: control,
|
|
7207
7194
|
name: "fullName",
|
|
7208
|
-
render: function(param)
|
|
7195
|
+
render: function(param) {
|
|
7209
7196
|
var field = param.field;
|
|
7210
7197
|
var _formState_errors_fullName;
|
|
7211
|
-
|
|
7212
|
-
return import_react38.default.createElement(Input, {
|
|
7198
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7213
7199
|
width: "full",
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
onChange: field.onChange,
|
|
7219
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7220
|
-
});
|
|
7200
|
+
label: texts === null || texts === void 0 ? void 0 : texts.fullNameLabel,
|
|
7201
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.fullNamePlaceholder,
|
|
7202
|
+
helperText: (_formState_errors_fullName = formState.errors.fullName) === null || _formState_errors_fullName === void 0 ? void 0 : _formState_errors_fullName.message
|
|
7203
|
+
}, field));
|
|
7221
7204
|
}
|
|
7222
7205
|
});
|
|
7223
7206
|
}
|
|
@@ -7226,20 +7209,16 @@ var RegisterForm = function(props) {
|
|
|
7226
7209
|
key: i,
|
|
7227
7210
|
control: control,
|
|
7228
7211
|
name: "email",
|
|
7229
|
-
render: function(param)
|
|
7212
|
+
render: function(param) {
|
|
7230
7213
|
var field = param.field;
|
|
7231
7214
|
var _formState_errors_email;
|
|
7232
|
-
|
|
7233
|
-
return import_react38.default.createElement(Input, {
|
|
7215
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7234
7216
|
width: "full",
|
|
7235
|
-
type: "text",
|
|
7236
7217
|
autoComplete: "email",
|
|
7237
|
-
label:
|
|
7218
|
+
label: texts === null || texts === void 0 ? void 0 : texts.emailLabel,
|
|
7238
7219
|
helperText: (_formState_errors_email = formState.errors.email) === null || _formState_errors_email === void 0 ? void 0 : _formState_errors_email.message,
|
|
7239
|
-
placeholder:
|
|
7240
|
-
|
|
7241
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7242
|
-
});
|
|
7220
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.emailPlaceholder) || "Enter your email"
|
|
7221
|
+
}, field));
|
|
7243
7222
|
}
|
|
7244
7223
|
});
|
|
7245
7224
|
}
|
|
@@ -7248,85 +7227,70 @@ var RegisterForm = function(props) {
|
|
|
7248
7227
|
key: i,
|
|
7249
7228
|
control: control,
|
|
7250
7229
|
name: "username",
|
|
7251
|
-
render: function(param)
|
|
7230
|
+
render: function(param) {
|
|
7252
7231
|
var field = param.field;
|
|
7253
7232
|
var _formState_errors_username;
|
|
7254
|
-
|
|
7255
|
-
return import_react38.default.createElement(Input, {
|
|
7233
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7256
7234
|
width: "full",
|
|
7257
|
-
type: "text",
|
|
7258
7235
|
autoComplete: "username",
|
|
7259
|
-
label:
|
|
7236
|
+
label: texts === null || texts === void 0 ? void 0 : texts.usernameLabel,
|
|
7260
7237
|
helperText: (_formState_errors_username = formState.errors.username) === null || _formState_errors_username === void 0 ? void 0 : _formState_errors_username.message,
|
|
7261
|
-
placeholder:
|
|
7262
|
-
|
|
7263
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7264
|
-
});
|
|
7238
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.usernamePlaceholder
|
|
7239
|
+
}, field));
|
|
7265
7240
|
}
|
|
7266
7241
|
});
|
|
7267
7242
|
}
|
|
7268
7243
|
})), /* @__PURE__ */ import_react38.default.createElement(import_react_hook_form3.Controller, {
|
|
7269
7244
|
control: control,
|
|
7270
7245
|
name: "password",
|
|
7271
|
-
render: function(param)
|
|
7246
|
+
render: function(param) {
|
|
7272
7247
|
var field = param.field;
|
|
7273
7248
|
var _formState_errors_password;
|
|
7274
|
-
|
|
7275
|
-
return import_react38.default.createElement(Input, {
|
|
7249
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7276
7250
|
width: "full",
|
|
7277
7251
|
type: "password",
|
|
7278
7252
|
autoComplete: "new-password",
|
|
7279
|
-
label:
|
|
7280
|
-
placeholder:
|
|
7281
|
-
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
7282
|
-
|
|
7283
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7284
|
-
});
|
|
7253
|
+
label: texts === null || texts === void 0 ? void 0 : texts.passwordLabel,
|
|
7254
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.passwordPlaceholder,
|
|
7255
|
+
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
7256
|
+
}, field));
|
|
7285
7257
|
}
|
|
7286
7258
|
}), /* @__PURE__ */ import_react38.default.createElement(import_react_hook_form3.Controller, {
|
|
7287
7259
|
control: control,
|
|
7288
7260
|
name: "confirm_password",
|
|
7289
|
-
render: function(param)
|
|
7261
|
+
render: function(param) {
|
|
7290
7262
|
var field = param.field;
|
|
7291
7263
|
var _formState_errors_confirm_password;
|
|
7292
|
-
|
|
7293
|
-
return import_react38.default.createElement(Input, {
|
|
7264
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7294
7265
|
width: "full",
|
|
7295
7266
|
type: "password",
|
|
7296
7267
|
autoComplete: "new-password",
|
|
7297
|
-
label:
|
|
7298
|
-
placeholder:
|
|
7299
|
-
helperText: (_formState_errors_confirm_password = formState.errors.confirm_password) === null || _formState_errors_confirm_password === void 0 ? void 0 : _formState_errors_confirm_password.message
|
|
7300
|
-
|
|
7301
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7302
|
-
});
|
|
7268
|
+
label: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordLabel,
|
|
7269
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordPlaceholder,
|
|
7270
|
+
helperText: (_formState_errors_confirm_password = formState.errors.confirm_password) === null || _formState_errors_confirm_password === void 0 ? void 0 : _formState_errors_confirm_password.message
|
|
7271
|
+
}, field));
|
|
7303
7272
|
}
|
|
7304
7273
|
}), props.additionalInputs, props.showRefCode && /* @__PURE__ */ import_react38.default.createElement(import_react_hook_form3.Controller, {
|
|
7305
7274
|
control: control,
|
|
7306
7275
|
name: "refCode",
|
|
7307
|
-
render: function(param)
|
|
7276
|
+
render: function(param) {
|
|
7308
7277
|
var field = param.field;
|
|
7309
7278
|
var _formState_errors_refCode;
|
|
7310
|
-
|
|
7311
|
-
return import_react38.default.createElement(Input, {
|
|
7279
|
+
return /* @__PURE__ */ import_react38.default.createElement(Input, _object_spread({
|
|
7312
7280
|
width: "full",
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : "",
|
|
7318
|
-
onChange: field.onChange
|
|
7319
|
-
});
|
|
7281
|
+
label: texts === null || texts === void 0 ? void 0 : texts.refCode,
|
|
7282
|
+
placeholder: (texts === null || texts === void 0 ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
|
7283
|
+
helperText: (_formState_errors_refCode = formState.errors.refCode) === null || _formState_errors_refCode === void 0 ? void 0 : _formState_errors_refCode.message
|
|
7284
|
+
}, field));
|
|
7320
7285
|
}
|
|
7321
7286
|
}), props.showUserSource && /* @__PURE__ */ import_react38.default.createElement(import_react_hook_form3.Controller, {
|
|
7322
7287
|
control: control,
|
|
7323
7288
|
name: "reference",
|
|
7324
7289
|
render: function(param) {
|
|
7325
7290
|
var field = param.field;
|
|
7326
|
-
var _props_texts, _props_texts1;
|
|
7327
7291
|
return /* @__PURE__ */ import_react38.default.createElement(Select, {
|
|
7328
|
-
label: (
|
|
7329
|
-
placeholder:
|
|
7292
|
+
label: (texts === null || texts === void 0 ? void 0 : texts.userReferenceLabel) || "How did you learn about us?",
|
|
7293
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.userReferencePlaceholder,
|
|
7330
7294
|
isCreatable: false,
|
|
7331
7295
|
isMulti: false,
|
|
7332
7296
|
isSearchable: false,
|
|
@@ -7353,10 +7317,10 @@ var RegisterForm = function(props) {
|
|
|
7353
7317
|
},
|
|
7354
7318
|
label: /* @__PURE__ */ import_react38.default.createElement("div", {
|
|
7355
7319
|
className: "hawa-flex hawa-flex-row hawa-gap-0.5"
|
|
7356
|
-
}, /* @__PURE__ */ import_react38.default.createElement("span", null,
|
|
7320
|
+
}, /* @__PURE__ */ import_react38.default.createElement("span", null, texts === null || texts === void 0 ? void 0 : texts.iAcceptText), " ", /* @__PURE__ */ import_react38.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react38.default.createElement("a", {
|
|
7357
7321
|
onClick: props.onRouteToTOS,
|
|
7358
7322
|
className: "clickable-link"
|
|
7359
|
-
},
|
|
7323
|
+
}, texts === null || texts === void 0 ? void 0 : texts.termsText)))
|
|
7360
7324
|
});
|
|
7361
7325
|
}
|
|
7362
7326
|
}), props.showNewsletterOption && /* @__PURE__ */ import_react38.default.createElement(import_react_hook_form3.Controller, {
|
|
@@ -7366,19 +7330,19 @@ var RegisterForm = function(props) {
|
|
|
7366
7330
|
var field = param.field;
|
|
7367
7331
|
return /* @__PURE__ */ import_react38.default.createElement(Checkbox, {
|
|
7368
7332
|
id: "newsletter_accepted",
|
|
7369
|
-
label:
|
|
7333
|
+
label: texts === null || texts === void 0 ? void 0 : texts.subscribeToNewsletter,
|
|
7370
7334
|
onCheckedChange: field.onChange
|
|
7371
7335
|
});
|
|
7372
7336
|
}
|
|
7373
7337
|
})), /* @__PURE__ */ import_react38.default.createElement(Button, {
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
},
|
|
7338
|
+
isLoading: props.isLoading,
|
|
7339
|
+
className: "hawa-w-full hawa-mt-4"
|
|
7340
|
+
}, texts === null || texts === void 0 ? void 0 : texts.registerText), props.additionalButtons)), /* @__PURE__ */ import_react38.default.createElement("div", {
|
|
7377
7341
|
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"
|
|
7378
|
-
}, /* @__PURE__ */ import_react38.default.createElement("span", null,
|
|
7342
|
+
}, /* @__PURE__ */ import_react38.default.createElement("span", null, texts === null || texts === void 0 ? void 0 : texts.existingUserText), /* @__PURE__ */ import_react38.default.createElement("span", {
|
|
7379
7343
|
onClick: props.onRouteToLogin,
|
|
7380
7344
|
className: "clickable-link"
|
|
7381
|
-
},
|
|
7345
|
+
}, (texts === null || texts === void 0 ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react38.default.createElement(CardFooter, {
|
|
7382
7346
|
className: cn(props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2")
|
|
7383
7347
|
}, props.viaGoogle && /* @__PURE__ */ import_react38.default.createElement(Button, {
|
|
7384
7348
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
@@ -7388,7 +7352,7 @@ var RegisterForm = function(props) {
|
|
|
7388
7352
|
size: "button"
|
|
7389
7353
|
}) : /* @__PURE__ */ import_react38.default.createElement(Logos.google, {
|
|
7390
7354
|
className: "hawa-h-4 hawa-w-4"
|
|
7391
|
-
}), " ", !props.logosOnly &&
|
|
7355
|
+
}), " ", !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.registerViaGoogleLabel)), props.viaGithub && /* @__PURE__ */ import_react38.default.createElement(Button, {
|
|
7392
7356
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
7393
7357
|
variant: "outline",
|
|
7394
7358
|
onClick: props.onGithubRegister
|
|
@@ -7396,7 +7360,7 @@ var RegisterForm = function(props) {
|
|
|
7396
7360
|
size: "button"
|
|
7397
7361
|
}) : /* @__PURE__ */ import_react38.default.createElement(Logos.github, {
|
|
7398
7362
|
className: "hawa-h-4 hawa-w-4"
|
|
7399
|
-
}), " ", !props.logosOnly &&
|
|
7363
|
+
}), " ", !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.registerViaGithubLabel)), props.viaTwitter && /* @__PURE__ */ import_react38.default.createElement(Button, {
|
|
7400
7364
|
className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
|
|
7401
7365
|
variant: "outline",
|
|
7402
7366
|
onClick: props.onTwitterRegister
|
|
@@ -7404,7 +7368,7 @@ var RegisterForm = function(props) {
|
|
|
7404
7368
|
size: "button"
|
|
7405
7369
|
}) : /* @__PURE__ */ import_react38.default.createElement(Logos.twitter, {
|
|
7406
7370
|
className: "hawa-h-4 hawa-w-4"
|
|
7407
|
-
}), " ", !props.logosOnly &&
|
|
7371
|
+
}), " ", !props.logosOnly && (texts === null || texts === void 0 ? void 0 : texts.registerViaTwitterLabel))) : null), props.handleColorMode && props.handleLanguage && /* @__PURE__ */ import_react38.default.createElement(InterfaceSettings, {
|
|
7408
7372
|
currentColorMode: props.currentColorMode,
|
|
7409
7373
|
currentLanguage: props.currentLanguage,
|
|
7410
7374
|
handleColorMode: props.handleColorMode,
|
|
@@ -7563,23 +7527,24 @@ var import_react41 = __toESM(require("react"));
|
|
|
7563
7527
|
var import_react_hook_form4 = require("react-hook-form");
|
|
7564
7528
|
var import_zod3 = require("@hookform/resolvers/zod");
|
|
7565
7529
|
var z3 = __toESM(require("zod"));
|
|
7566
|
-
var NewPasswordForm = function(
|
|
7530
|
+
var NewPasswordForm = function(_param) {
|
|
7531
|
+
var texts = _param.texts, props = _object_without_properties(_param, [
|
|
7532
|
+
"texts"
|
|
7533
|
+
]);
|
|
7567
7534
|
var formSchema = z3.object({
|
|
7568
7535
|
password: z3.string({
|
|
7569
|
-
required_error:
|
|
7570
|
-
}).min(
|
|
7571
|
-
message:
|
|
7572
|
-
}).
|
|
7573
|
-
|
|
7574
|
-
}, {
|
|
7575
|
-
message: props.texts.passwordRequiredText
|
|
7536
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7537
|
+
}).min(1, {
|
|
7538
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7539
|
+
}).min(8, {
|
|
7540
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
7576
7541
|
}),
|
|
7577
7542
|
confirm_password: z3.string({
|
|
7578
|
-
required_error:
|
|
7543
|
+
required_error: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordRequired
|
|
7579
7544
|
}).refine(function(value) {
|
|
7580
7545
|
return value !== "";
|
|
7581
7546
|
}, {
|
|
7582
|
-
message:
|
|
7547
|
+
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
7583
7548
|
})
|
|
7584
7549
|
}).refine(function(data) {
|
|
7585
7550
|
return data.password === data.confirm_password;
|
|
@@ -7596,13 +7561,13 @@ var NewPasswordForm = function(props) {
|
|
|
7596
7561
|
return /* @__PURE__ */ import_react41.default.createElement(Card, {
|
|
7597
7562
|
dir: props.direction
|
|
7598
7563
|
}, matchError && /* @__PURE__ */ import_react41.default.createElement(Alert, {
|
|
7599
|
-
text:
|
|
7564
|
+
text: texts === null || texts === void 0 ? void 0 : texts.passwordMatchError,
|
|
7600
7565
|
severity: "error"
|
|
7601
7566
|
}), props.passwordChanged ? /* @__PURE__ */ import_react41.default.createElement(CardContent, {
|
|
7602
7567
|
headless: true
|
|
7603
7568
|
}, /* @__PURE__ */ import_react41.default.createElement("div", {
|
|
7604
7569
|
className: "hawa-text-center"
|
|
7605
|
-
},
|
|
7570
|
+
}, texts === null || texts === void 0 ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ import_react41.default.createElement("form", {
|
|
7606
7571
|
onSubmit: handleSubmit(function(e) {
|
|
7607
7572
|
if (props.handleNewPassword) {
|
|
7608
7573
|
return props.handleNewPassword(e);
|
|
@@ -7616,43 +7581,37 @@ var NewPasswordForm = function(props) {
|
|
|
7616
7581
|
}, /* @__PURE__ */ import_react41.default.createElement(import_react_hook_form4.Controller, {
|
|
7617
7582
|
control: control,
|
|
7618
7583
|
name: "password",
|
|
7619
|
-
render: function(param)
|
|
7584
|
+
render: function(param) {
|
|
7620
7585
|
var field = param.field;
|
|
7621
7586
|
var _formState_errors_password;
|
|
7622
|
-
|
|
7623
|
-
return import_react41.default.createElement(Input, _object_spread_props(_object_spread({
|
|
7587
|
+
return /* @__PURE__ */ import_react41.default.createElement(Input, _object_spread({
|
|
7624
7588
|
width: "full",
|
|
7625
7589
|
type: "password",
|
|
7626
7590
|
autoComplete: "new-password",
|
|
7627
|
-
label:
|
|
7628
|
-
placeholder:
|
|
7591
|
+
label: texts === null || texts === void 0 ? void 0 : texts.passwordLabel,
|
|
7592
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.passwordPlaceholder,
|
|
7629
7593
|
helperText: (_formState_errors_password = formState.errors.password) === null || _formState_errors_password === void 0 ? void 0 : _formState_errors_password.message
|
|
7630
|
-
}, field)
|
|
7631
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7632
|
-
}));
|
|
7594
|
+
}, field));
|
|
7633
7595
|
}
|
|
7634
7596
|
}), /* @__PURE__ */ import_react41.default.createElement(import_react_hook_form4.Controller, {
|
|
7635
7597
|
control: control,
|
|
7636
7598
|
name: "confirm_password",
|
|
7637
|
-
render: function(param)
|
|
7599
|
+
render: function(param) {
|
|
7638
7600
|
var field = param.field;
|
|
7639
7601
|
var _formState_errors_confirm_password;
|
|
7640
|
-
|
|
7641
|
-
return import_react41.default.createElement(Input, _object_spread_props(_object_spread({
|
|
7602
|
+
return /* @__PURE__ */ import_react41.default.createElement(Input, _object_spread({
|
|
7642
7603
|
width: "full",
|
|
7643
7604
|
type: "password",
|
|
7644
7605
|
autoComplete: "new-password",
|
|
7645
|
-
label:
|
|
7646
|
-
placeholder:
|
|
7606
|
+
label: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordLabel,
|
|
7607
|
+
placeholder: texts === null || texts === void 0 ? void 0 : texts.confirmPasswordPlaceholder,
|
|
7647
7608
|
helperText: (_formState_errors_confirm_password = formState.errors.confirm_password) === null || _formState_errors_confirm_password === void 0 ? void 0 : _formState_errors_confirm_password.message
|
|
7648
|
-
}, field)
|
|
7649
|
-
value: (_field_value = field.value) !== null && _field_value !== void 0 ? _field_value : ""
|
|
7650
|
-
}));
|
|
7609
|
+
}, field));
|
|
7651
7610
|
}
|
|
7652
7611
|
})), /* @__PURE__ */ import_react41.default.createElement(CardFooter, null, /* @__PURE__ */ import_react41.default.createElement(Button, {
|
|
7653
7612
|
className: "hawa-w-full",
|
|
7654
7613
|
type: "submit"
|
|
7655
|
-
},
|
|
7614
|
+
}, texts === null || texts === void 0 ? void 0 : texts.updatePassword))));
|
|
7656
7615
|
};
|
|
7657
7616
|
// components/blocks/auth/ResetPassword.tsx
|
|
7658
7617
|
var import_react42 = __toESM(require("react"));
|