@sikka/hawa 0.48.0-next → 0.48.1-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 +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +338 -325
- package/dist/blocks/auth/index.mjs +338 -325
- package/dist/blocks/index.d.mts +1 -0
- package/dist/blocks/index.d.ts +1 -0
- package/dist/blocks/index.js +338 -325
- package/dist/blocks/index.mjs +338 -325
- package/dist/index.css +0 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +338 -325
- package/dist/index.mjs +338 -325
- package/package.json +1 -1
package/dist/blocks/index.js
CHANGED
@@ -4853,385 +4853,398 @@ var RegisterForm = ({
|
|
4853
4853
|
headless: registerTypes ? registerTypes.length <= 1 : true,
|
4854
4854
|
noPadding: props.cardless
|
4855
4855
|
},
|
4856
|
-
/* @__PURE__ */ import_react37.default.createElement(
|
4857
|
-
|
4856
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
4857
|
+
"div",
|
4858
4858
|
{
|
4859
|
-
|
4860
|
-
|
4861
|
-
|
4862
|
-
|
4863
|
-
|
4864
|
-
|
4865
|
-
|
4859
|
+
className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
|
4860
|
+
},
|
4861
|
+
props.showError && /* @__PURE__ */ import_react37.default.createElement(
|
4862
|
+
Alert,
|
4863
|
+
{
|
4864
|
+
direction: props.direction,
|
4865
|
+
title: props.errorTitle,
|
4866
|
+
text: props.errorText,
|
4867
|
+
severity: "error",
|
4868
|
+
onAlertClosed: () => {
|
4869
|
+
if (props.onErrorDismissed) {
|
4870
|
+
props.onErrorDismissed();
|
4871
|
+
}
|
4866
4872
|
}
|
4867
4873
|
}
|
4868
|
-
|
4869
|
-
|
4870
|
-
|
4871
|
-
{
|
4872
|
-
noValidate: true,
|
4873
|
-
onSubmit: handleSubmit((e) => {
|
4874
|
-
if (props.onRegister) {
|
4875
|
-
return props.onRegister(e);
|
4876
|
-
} else {
|
4877
|
-
console.log("Form is submitted but onRegister prop is missing");
|
4878
|
-
}
|
4879
|
-
}),
|
4880
|
-
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4881
|
-
},
|
4882
|
-
/* @__PURE__ */ import_react37.default.createElement(
|
4883
|
-
Tabs,
|
4874
|
+
),
|
4875
|
+
/* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
|
4876
|
+
"form",
|
4884
4877
|
{
|
4885
|
-
|
4886
|
-
|
4887
|
-
|
4888
|
-
|
4889
|
-
|
4890
|
-
|
4878
|
+
noValidate: true,
|
4879
|
+
onSubmit: handleSubmit((e) => {
|
4880
|
+
if (props.onRegister) {
|
4881
|
+
return props.onRegister(e);
|
4882
|
+
} else {
|
4883
|
+
console.log("Form is submitted but onRegister prop is missing");
|
4891
4884
|
}
|
4892
|
-
)
|
4885
|
+
}),
|
4886
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
4893
4887
|
},
|
4894
|
-
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
4895
4888
|
/* @__PURE__ */ import_react37.default.createElement(
|
4896
|
-
|
4889
|
+
Tabs,
|
4897
4890
|
{
|
4898
|
-
|
4899
|
-
|
4900
|
-
|
4901
|
-
|
4902
|
-
|
4903
|
-
|
4904
|
-
|
4905
|
-
|
4906
|
-
|
4907
|
-
|
4908
|
-
import_react_hook_form2.Controller,
|
4909
|
-
{
|
4910
|
-
key: i,
|
4911
|
-
control,
|
4912
|
-
name: "fullName",
|
4913
|
-
render: ({ field }) => {
|
4914
|
-
var _a2, _b2, _c2;
|
4915
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
4916
|
-
Input,
|
4917
|
-
{
|
4918
|
-
width: "full",
|
4919
|
-
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4920
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4921
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4922
|
-
...field
|
4923
|
-
}
|
4924
|
-
);
|
4925
|
-
}
|
4926
|
-
}
|
4927
|
-
);
|
4928
|
-
}
|
4929
|
-
if (fld === "email") {
|
4930
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
4931
|
-
import_react_hook_form2.Controller,
|
4932
|
-
{
|
4933
|
-
key: i,
|
4934
|
-
control,
|
4935
|
-
name: "email",
|
4936
|
-
render: ({ field }) => {
|
4937
|
-
var _a2, _b2, _c2;
|
4938
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
4939
|
-
Input,
|
4940
|
-
{
|
4941
|
-
dir: "ltr",
|
4942
|
-
inputProps: {
|
4943
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
4944
|
-
},
|
4945
|
-
width: "full",
|
4946
|
-
autoComplete: "email",
|
4947
|
-
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4948
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4949
|
-
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4950
|
-
...field,
|
4951
|
-
onChange: (e) => {
|
4952
|
-
field.onChange(e.target.value.toLowerCase().trim());
|
4953
|
-
}
|
4954
|
-
}
|
4955
|
-
);
|
4956
|
-
}
|
4957
|
-
}
|
4958
|
-
);
|
4959
|
-
}
|
4960
|
-
if (fld === "username") {
|
4961
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
4962
|
-
import_react_hook_form2.Controller,
|
4963
|
-
{
|
4964
|
-
key: i,
|
4965
|
-
control,
|
4966
|
-
name: "username",
|
4967
|
-
render: ({ field }) => {
|
4968
|
-
var _a2, _b2, _c2, _d2;
|
4969
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
4970
|
-
Input,
|
4971
|
-
{
|
4972
|
-
width: "full",
|
4973
|
-
autoComplete: "username",
|
4974
|
-
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
4975
|
-
labelProps: {
|
4976
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
4977
|
-
},
|
4978
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
4979
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
4980
|
-
...field
|
4981
|
-
}
|
4982
|
-
);
|
4983
|
-
}
|
4891
|
+
dir: props.direction,
|
4892
|
+
value: selectedRegisterType.value,
|
4893
|
+
onValueChange: (e) => {
|
4894
|
+
if (props.onRegisterTypeChange) {
|
4895
|
+
props.onRegisterTypeChange(e);
|
4896
|
+
}
|
4897
|
+
setSelectedRegisterType(
|
4898
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
4899
|
+
label: "Password",
|
4900
|
+
value: "password"
|
4984
4901
|
}
|
4985
4902
|
);
|
4986
4903
|
}
|
4987
|
-
}
|
4904
|
+
},
|
4905
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
4988
4906
|
/* @__PURE__ */ import_react37.default.createElement(
|
4989
|
-
|
4907
|
+
TabsContent,
|
4990
4908
|
{
|
4991
|
-
|
4992
|
-
|
4993
|
-
|
4994
|
-
|
4909
|
+
value: "password",
|
4910
|
+
className: cn(
|
4911
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
4912
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
4913
|
+
),
|
4914
|
+
dir: props.direction
|
4915
|
+
},
|
4916
|
+
/* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
4917
|
+
if (fld === "fullname") {
|
4995
4918
|
return /* @__PURE__ */ import_react37.default.createElement(
|
4996
|
-
|
4919
|
+
import_react_hook_form2.Controller,
|
4997
4920
|
{
|
4998
|
-
|
4999
|
-
|
5000
|
-
|
5001
|
-
|
5002
|
-
|
5003
|
-
|
5004
|
-
|
5005
|
-
|
5006
|
-
|
5007
|
-
|
5008
|
-
|
5009
|
-
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
4921
|
+
key: i,
|
4922
|
+
control,
|
4923
|
+
name: "fullName",
|
4924
|
+
render: ({ field }) => {
|
4925
|
+
var _a2, _b2, _c2;
|
4926
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4927
|
+
Input,
|
4928
|
+
{
|
4929
|
+
width: "full",
|
4930
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
4931
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
4932
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
4933
|
+
...field
|
4934
|
+
}
|
4935
|
+
);
|
4936
|
+
}
|
5014
4937
|
}
|
5015
4938
|
);
|
5016
4939
|
}
|
5017
|
-
|
5018
|
-
),
|
5019
|
-
/* @__PURE__ */ import_react37.default.createElement(
|
5020
|
-
import_react_hook_form2.Controller,
|
5021
|
-
{
|
5022
|
-
control,
|
5023
|
-
name: "confirm_password",
|
5024
|
-
render: ({ field }) => {
|
5025
|
-
var _a2, _b2, _c2;
|
4940
|
+
if (fld === "email") {
|
5026
4941
|
return /* @__PURE__ */ import_react37.default.createElement(
|
5027
|
-
|
4942
|
+
import_react_hook_form2.Controller,
|
5028
4943
|
{
|
5029
|
-
|
5030
|
-
|
5031
|
-
|
5032
|
-
|
5033
|
-
|
5034
|
-
|
5035
|
-
|
5036
|
-
|
5037
|
-
|
5038
|
-
|
5039
|
-
|
5040
|
-
|
5041
|
-
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
4944
|
+
key: i,
|
4945
|
+
control,
|
4946
|
+
name: "email",
|
4947
|
+
render: ({ field }) => {
|
4948
|
+
var _a2, _b2, _c2;
|
4949
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4950
|
+
Input,
|
4951
|
+
{
|
4952
|
+
dir: "ltr",
|
4953
|
+
inputProps: {
|
4954
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
4955
|
+
},
|
4956
|
+
width: "full",
|
4957
|
+
autoComplete: "email",
|
4958
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
4959
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
4960
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
4961
|
+
...field,
|
4962
|
+
onChange: (e) => {
|
4963
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
4964
|
+
}
|
4965
|
+
}
|
4966
|
+
);
|
4967
|
+
}
|
5045
4968
|
}
|
5046
4969
|
);
|
5047
4970
|
}
|
5048
|
-
|
5049
|
-
),
|
5050
|
-
props.additionalInputs,
|
5051
|
-
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
5052
|
-
import_react_hook_form2.Controller,
|
5053
|
-
{
|
5054
|
-
control,
|
5055
|
-
name: "refCode",
|
5056
|
-
render: ({ field }) => {
|
5057
|
-
var _a2;
|
4971
|
+
if (fld === "username") {
|
5058
4972
|
return /* @__PURE__ */ import_react37.default.createElement(
|
5059
|
-
|
4973
|
+
import_react_hook_form2.Controller,
|
5060
4974
|
{
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
4975
|
+
key: i,
|
4976
|
+
control,
|
4977
|
+
name: "username",
|
4978
|
+
render: ({ field }) => {
|
4979
|
+
var _a2, _b2, _c2, _d2;
|
4980
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
4981
|
+
Input,
|
4982
|
+
{
|
4983
|
+
width: "full",
|
4984
|
+
autoComplete: "username",
|
4985
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
4986
|
+
labelProps: {
|
4987
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
4988
|
+
},
|
4989
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
4990
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
4991
|
+
...field
|
4992
|
+
}
|
4993
|
+
);
|
4994
|
+
}
|
5066
4995
|
}
|
5067
4996
|
);
|
5068
4997
|
}
|
5069
|
-
}
|
5070
|
-
|
5071
|
-
|
5072
|
-
|
5073
|
-
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5077
|
-
|
5078
|
-
|
5079
|
-
|
5080
|
-
|
5081
|
-
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5086
|
-
|
5087
|
-
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
4998
|
+
})),
|
4999
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5000
|
+
import_react_hook_form2.Controller,
|
5001
|
+
{
|
5002
|
+
control,
|
5003
|
+
name: "password",
|
5004
|
+
render: ({ field }) => {
|
5005
|
+
var _a2, _b2, _c2;
|
5006
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5007
|
+
Input,
|
5008
|
+
{
|
5009
|
+
width: "full",
|
5010
|
+
type: passwordVisible ? "text" : "password",
|
5011
|
+
autoComplete: "new-password",
|
5012
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
5013
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
5014
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
5015
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
5016
|
+
"div",
|
5017
|
+
{
|
5018
|
+
className: "hawa-cursor-pointer",
|
5019
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
5020
|
+
},
|
5021
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
5022
|
+
" "
|
5023
|
+
),
|
5024
|
+
...field
|
5025
|
+
}
|
5026
|
+
);
|
5027
|
+
}
|
5091
5028
|
}
|
5092
|
-
}
|
5093
|
-
)
|
5094
|
-
),
|
5095
|
-
/* @__PURE__ */ import_react37.default.createElement(
|
5096
|
-
TabsContent,
|
5097
|
-
{
|
5098
|
-
value: "phone",
|
5099
|
-
className: cn(
|
5100
|
-
"hawa-flex hawa-flex-col hawa-gap-4",
|
5101
|
-
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
5102
5029
|
),
|
5103
|
-
|
5104
|
-
|
5030
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5031
|
+
import_react_hook_form2.Controller,
|
5032
|
+
{
|
5033
|
+
control,
|
5034
|
+
name: "confirm_password",
|
5035
|
+
render: ({ field }) => {
|
5036
|
+
var _a2, _b2, _c2;
|
5037
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5038
|
+
Input,
|
5039
|
+
{
|
5040
|
+
width: "full",
|
5041
|
+
type: passwordVisible ? "text" : "password",
|
5042
|
+
autoComplete: "new-password",
|
5043
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
5044
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
5045
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
5046
|
+
endIcon: /* @__PURE__ */ import_react37.default.createElement(
|
5047
|
+
"div",
|
5048
|
+
{
|
5049
|
+
className: "hawa-cursor-pointer",
|
5050
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
5051
|
+
},
|
5052
|
+
passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
5053
|
+
" "
|
5054
|
+
),
|
5055
|
+
...field
|
5056
|
+
}
|
5057
|
+
);
|
5058
|
+
}
|
5059
|
+
}
|
5060
|
+
),
|
5061
|
+
props.additionalInputs,
|
5062
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
5063
|
+
import_react_hook_form2.Controller,
|
5064
|
+
{
|
5065
|
+
control,
|
5066
|
+
name: "refCode",
|
5067
|
+
render: ({ field }) => {
|
5068
|
+
var _a2;
|
5069
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5070
|
+
Input,
|
5071
|
+
{
|
5072
|
+
width: "full",
|
5073
|
+
label: texts == null ? void 0 : texts.refCode,
|
5074
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
5075
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
5076
|
+
...field
|
5077
|
+
}
|
5078
|
+
);
|
5079
|
+
}
|
5080
|
+
}
|
5081
|
+
),
|
5082
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
5083
|
+
import_react_hook_form2.Controller,
|
5084
|
+
{
|
5085
|
+
control,
|
5086
|
+
name: "reference",
|
5087
|
+
render: ({ field }) => {
|
5088
|
+
var _a2, _b2;
|
5089
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5090
|
+
Select,
|
5091
|
+
{
|
5092
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
5093
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
5094
|
+
isCreatable: false,
|
5095
|
+
isMulti: false,
|
5096
|
+
isSearchable: false,
|
5097
|
+
isClearable: false,
|
5098
|
+
options: props.userReferenceOptions || [],
|
5099
|
+
onChange: (e) => field.onChange(e)
|
5100
|
+
}
|
5101
|
+
);
|
5102
|
+
}
|
5103
|
+
}
|
5104
|
+
)
|
5105
|
+
),
|
5105
5106
|
/* @__PURE__ */ import_react37.default.createElement(
|
5106
|
-
|
5107
|
+
TabsContent,
|
5107
5108
|
{
|
5108
|
-
|
5109
|
-
|
5110
|
-
|
5111
|
-
|
5112
|
-
|
5113
|
-
|
5114
|
-
|
5115
|
-
|
5116
|
-
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5109
|
+
value: "phone",
|
5110
|
+
className: cn(
|
5111
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
5112
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
5113
|
+
),
|
5114
|
+
dir: props.direction
|
5115
|
+
},
|
5116
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5117
|
+
import_react_hook_form2.Controller,
|
5118
|
+
{
|
5119
|
+
control,
|
5120
|
+
name: "phone",
|
5121
|
+
render: ({ field }) => {
|
5122
|
+
var _a2, _b2;
|
5123
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5124
|
+
PhoneInput,
|
5125
|
+
{
|
5126
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
5127
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
5128
|
+
preferredCountry: { label: "+966" },
|
5129
|
+
...props.phoneInputProps,
|
5130
|
+
handleChange: (e) => {
|
5131
|
+
if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
|
5132
|
+
let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
|
5133
|
+
field.onChange(parsed.number);
|
5134
|
+
} else {
|
5135
|
+
field.onChange(e);
|
5136
|
+
}
|
5125
5137
|
}
|
5126
5138
|
}
|
5127
|
-
|
5128
|
-
|
5139
|
+
);
|
5140
|
+
}
|
5129
5141
|
}
|
5130
|
-
|
5142
|
+
),
|
5143
|
+
props.additionalInputs,
|
5144
|
+
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
5145
|
+
import_react_hook_form2.Controller,
|
5146
|
+
{
|
5147
|
+
control,
|
5148
|
+
name: "refCode",
|
5149
|
+
render: ({ field }) => {
|
5150
|
+
var _a2;
|
5151
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5152
|
+
Input,
|
5153
|
+
{
|
5154
|
+
width: "full",
|
5155
|
+
label: texts == null ? void 0 : texts.refCode,
|
5156
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
5157
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
5158
|
+
...field
|
5159
|
+
}
|
5160
|
+
);
|
5161
|
+
}
|
5162
|
+
}
|
5163
|
+
),
|
5164
|
+
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
5165
|
+
import_react_hook_form2.Controller,
|
5166
|
+
{
|
5167
|
+
control,
|
5168
|
+
name: "reference",
|
5169
|
+
render: ({ field }) => {
|
5170
|
+
var _a2, _b2;
|
5171
|
+
return /* @__PURE__ */ import_react37.default.createElement(
|
5172
|
+
Select,
|
5173
|
+
{
|
5174
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
5175
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
5176
|
+
isCreatable: false,
|
5177
|
+
isMulti: false,
|
5178
|
+
isSearchable: false,
|
5179
|
+
isClearable: false,
|
5180
|
+
options: props.userReferenceOptions || [],
|
5181
|
+
onChange: (e) => field.onChange(e)
|
5182
|
+
}
|
5183
|
+
);
|
5184
|
+
}
|
5185
|
+
}
|
5186
|
+
)
|
5131
5187
|
),
|
5132
|
-
|
5133
|
-
props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
|
5188
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
|
5134
5189
|
import_react_hook_form2.Controller,
|
5135
5190
|
{
|
5136
5191
|
control,
|
5137
|
-
name: "
|
5192
|
+
name: "terms_accepted",
|
5138
5193
|
render: ({ field }) => {
|
5139
|
-
var _a2;
|
5194
|
+
var _a2, _b2;
|
5140
5195
|
return /* @__PURE__ */ import_react37.default.createElement(
|
5141
|
-
|
5196
|
+
Checkbox,
|
5142
5197
|
{
|
5143
|
-
|
5144
|
-
|
5145
|
-
|
5146
|
-
|
5147
|
-
|
5198
|
+
id: "terms_accepted",
|
5199
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
5200
|
+
onCheckedChange: (e) => field.onChange(e),
|
5201
|
+
label: /* @__PURE__ */ import_react37.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_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
|
5202
|
+
"span",
|
5203
|
+
{
|
5204
|
+
onClick: (e) => {
|
5205
|
+
e.preventDefault();
|
5206
|
+
if (props.onRouteToTOS) {
|
5207
|
+
props.onRouteToTOS();
|
5208
|
+
}
|
5209
|
+
},
|
5210
|
+
className: "clickable-link"
|
5211
|
+
},
|
5212
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
5213
|
+
)))
|
5148
5214
|
}
|
5149
5215
|
);
|
5150
5216
|
}
|
5151
5217
|
}
|
5152
|
-
),
|
5153
|
-
props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
|
5218
|
+
), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
|
5154
5219
|
import_react_hook_form2.Controller,
|
5155
5220
|
{
|
5156
5221
|
control,
|
5157
|
-
name: "
|
5158
|
-
render: ({ field }) =>
|
5159
|
-
var _a2, _b2;
|
5160
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
5161
|
-
Select,
|
5162
|
-
{
|
5163
|
-
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
5164
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
5165
|
-
isCreatable: false,
|
5166
|
-
isMulti: false,
|
5167
|
-
isSearchable: false,
|
5168
|
-
isClearable: false,
|
5169
|
-
options: props.userReferenceOptions || [],
|
5170
|
-
onChange: (e) => field.onChange(e)
|
5171
|
-
}
|
5172
|
-
);
|
5173
|
-
}
|
5174
|
-
}
|
5175
|
-
)
|
5176
|
-
),
|
5177
|
-
showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
|
5178
|
-
import_react_hook_form2.Controller,
|
5179
|
-
{
|
5180
|
-
control,
|
5181
|
-
name: "terms_accepted",
|
5182
|
-
render: ({ field }) => {
|
5183
|
-
var _a2, _b2;
|
5184
|
-
return /* @__PURE__ */ import_react37.default.createElement(
|
5222
|
+
name: "newsletter_accepted",
|
5223
|
+
render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
|
5185
5224
|
Checkbox,
|
5186
5225
|
{
|
5187
|
-
id: "
|
5188
|
-
|
5189
|
-
onCheckedChange:
|
5190
|
-
label: /* @__PURE__ */ import_react37.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_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
|
5191
|
-
"span",
|
5192
|
-
{
|
5193
|
-
onClick: (e) => {
|
5194
|
-
e.preventDefault();
|
5195
|
-
if (props.onRouteToTOS) {
|
5196
|
-
props.onRouteToTOS();
|
5197
|
-
}
|
5198
|
-
},
|
5199
|
-
className: "clickable-link"
|
5200
|
-
},
|
5201
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
5202
|
-
)))
|
5226
|
+
id: "newsletter_accepted",
|
5227
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
5228
|
+
onCheckedChange: field.onChange
|
5203
5229
|
}
|
5204
|
-
)
|
5230
|
+
)
|
5205
5231
|
}
|
5206
|
-
|
5207
|
-
),
|
5208
|
-
|
5232
|
+
)) : null
|
5233
|
+
),
|
5234
|
+
/* @__PURE__ */ import_react37.default.createElement(
|
5235
|
+
Button,
|
5209
5236
|
{
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5221
|
-
)) : null
|
5222
|
-
),
|
5223
|
-
/* @__PURE__ */ import_react37.default.createElement(
|
5224
|
-
Button,
|
5225
|
-
{
|
5226
|
-
className: "hawa-w-full",
|
5227
|
-
type: "submit",
|
5228
|
-
isLoading: props.isLoading,
|
5229
|
-
disabled: props.isLoading
|
5230
|
-
},
|
5231
|
-
(texts == null ? void 0 : texts.registerText) || "Register"
|
5232
|
-
),
|
5233
|
-
props.additionalButtons
|
5234
|
-
)), props.onRouteToLogin && /* @__PURE__ */ import_react37.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_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
|
5237
|
+
className: "hawa-w-full",
|
5238
|
+
type: "submit",
|
5239
|
+
isLoading: props.isLoading,
|
5240
|
+
disabled: props.isLoading
|
5241
|
+
},
|
5242
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
5243
|
+
),
|
5244
|
+
props.additionalButtons
|
5245
|
+
)),
|
5246
|
+
props.onRouteToLogin && /* @__PURE__ */ import_react37.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_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login"))
|
5247
|
+
)
|
5235
5248
|
),
|
5236
5249
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(
|
5237
5250
|
CardFooter,
|