@sikka/hawa 0.30.6-next → 0.30.7-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/auth/index.d.mts +4 -0
- package/dist/blocks/auth/index.d.ts +4 -0
- package/dist/blocks/auth/index.js +335 -314
- package/dist/blocks/auth/index.mjs +335 -314
- package/dist/blocks/index.d.mts +4 -0
- package/dist/blocks/index.d.ts +4 -0
- package/dist/blocks/index.js +335 -314
- package/dist/blocks/index.mjs +335 -314
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +335 -314
- package/dist/index.mjs +335 -314
- package/package.json +1 -1
@@ -2391,8 +2391,8 @@ var PhoneInput = ({ labelProps, ...props }) => {
|
|
2391
2391
|
// blocks/auth/LoginForm.tsx
|
2392
2392
|
var LoginForm = ({
|
2393
2393
|
loginType = "email",
|
2394
|
-
texts,
|
2395
2394
|
passwordLength = 8,
|
2395
|
+
texts,
|
2396
2396
|
...props
|
2397
2397
|
}) => {
|
2398
2398
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
@@ -2623,70 +2623,80 @@ var LoginForm = ({
|
|
2623
2623
|
break;
|
2624
2624
|
}
|
2625
2625
|
};
|
2626
|
-
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React5.createElement(
|
2627
|
-
|
2628
|
-
{
|
2629
|
-
direction: props.direction,
|
2630
|
-
title: props.errorTitle,
|
2631
|
-
text: props.errorText,
|
2632
|
-
severity: "error"
|
2633
|
-
}
|
2634
|
-
), /* @__PURE__ */ React5.createElement(
|
2635
|
-
"form",
|
2626
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React5.createElement(
|
2627
|
+
Card,
|
2636
2628
|
{
|
2637
|
-
|
2638
|
-
className:
|
2639
|
-
|
2640
|
-
|
2641
|
-
return props.onLogin(e);
|
2642
|
-
} else {
|
2643
|
-
console.log("Form is submitted but onLogin prop is missing");
|
2644
|
-
}
|
2645
|
-
})
|
2629
|
+
dir: props.direction,
|
2630
|
+
className: cn(
|
2631
|
+
props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
|
2632
|
+
)
|
2646
2633
|
},
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2634
|
+
/* @__PURE__ */ React5.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React5.createElement(
|
2635
|
+
Alert,
|
2636
|
+
{
|
2637
|
+
direction: props.direction,
|
2638
|
+
title: props.errorTitle,
|
2639
|
+
text: props.errorText,
|
2640
|
+
severity: "error"
|
2641
|
+
}
|
2642
|
+
), /* @__PURE__ */ React5.createElement(
|
2643
|
+
"form",
|
2650
2644
|
{
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2645
|
+
noValidate: true,
|
2646
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4",
|
2647
|
+
onSubmit: handleSubmit((e) => {
|
2648
|
+
if (props.onLogin) {
|
2649
|
+
return props.onLogin(e);
|
2650
|
+
} else {
|
2651
|
+
console.log("Form is submitted but onLogin prop is missing");
|
2652
|
+
}
|
2653
|
+
})
|
2655
2654
|
},
|
2656
|
-
(
|
2657
|
-
|
2658
|
-
|
2659
|
-
|
2660
|
-
|
2655
|
+
renderFields(),
|
2656
|
+
/* @__PURE__ */ React5.createElement(
|
2657
|
+
Button,
|
2658
|
+
{
|
2659
|
+
className: "hawa-mt-0 hawa-w-full",
|
2660
|
+
type: "submit",
|
2661
|
+
isLoading: props.isLoading,
|
2662
|
+
disabled: props.isLoading
|
2663
|
+
},
|
2664
|
+
(texts == null ? void 0 : texts.loginText) || "Login"
|
2665
|
+
),
|
2666
|
+
props.additionalButtons,
|
2667
|
+
props.allowRegister && /* @__PURE__ */ React5.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React5.createElement(
|
2668
|
+
"span",
|
2669
|
+
{
|
2670
|
+
onClick: props.onRouteToRegister,
|
2671
|
+
className: "clickable-link"
|
2672
|
+
},
|
2673
|
+
(texts == null ? void 0 : texts.createAccount) || "Create Account"
|
2674
|
+
))
|
2675
|
+
)),
|
2676
|
+
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React5.createElement(
|
2677
|
+
CardFooter,
|
2661
2678
|
{
|
2662
|
-
|
2663
|
-
|
2679
|
+
className: cn(
|
2680
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
2681
|
+
)
|
2664
2682
|
},
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2683
|
+
/* @__PURE__ */ React5.createElement(
|
2684
|
+
AuthButtons,
|
2685
|
+
{
|
2686
|
+
texts: thirdPartyAuthTexts,
|
2687
|
+
viaGoogle: props.viaGoogle,
|
2688
|
+
viaGithub: props.viaGithub,
|
2689
|
+
viaTwitter: props.viaTwitter,
|
2690
|
+
isGoogleLoading: props.isGoogleLoading,
|
2691
|
+
isGithubLoading: props.isGithubLoading,
|
2692
|
+
isTwitterLoading: props.isTwitterLoading,
|
2693
|
+
handleGoogle: props.onGoogleLogin,
|
2694
|
+
handleGithub: props.onGithubLogin,
|
2695
|
+
handleTwitter: props.onTwitterLogin
|
2696
|
+
}
|
2672
2697
|
)
|
2673
|
-
|
2674
|
-
|
2675
|
-
AuthButtons,
|
2676
|
-
{
|
2677
|
-
texts: thirdPartyAuthTexts,
|
2678
|
-
viaGoogle: props.viaGoogle,
|
2679
|
-
viaGithub: props.viaGithub,
|
2680
|
-
viaTwitter: props.viaTwitter,
|
2681
|
-
isGoogleLoading: props.isGoogleLoading,
|
2682
|
-
isGithubLoading: props.isGithubLoading,
|
2683
|
-
isTwitterLoading: props.isTwitterLoading,
|
2684
|
-
handleGoogle: props.onGoogleLogin,
|
2685
|
-
handleGithub: props.onGithubLogin,
|
2686
|
-
handleTwitter: props.onTwitterLogin
|
2687
|
-
}
|
2688
|
-
)
|
2689
|
-
) : null));
|
2698
|
+
) : null
|
2699
|
+
));
|
2690
2700
|
};
|
2691
2701
|
|
2692
2702
|
// blocks/auth/RegisterForm.tsx
|
@@ -2913,292 +2923,303 @@ var RegisterForm = ({
|
|
2913
2923
|
(_g = props.classNames) == null ? void 0 : _g.root
|
2914
2924
|
)
|
2915
2925
|
},
|
2916
|
-
/* @__PURE__ */ React7.createElement(
|
2917
|
-
|
2918
|
-
{
|
2919
|
-
direction: props.direction,
|
2920
|
-
title: props.errorTitle,
|
2921
|
-
text: props.errorText,
|
2922
|
-
severity: "error",
|
2923
|
-
onAlertClosed: () => {
|
2924
|
-
if (props.onErrorDismissed) {
|
2925
|
-
props.onErrorDismissed();
|
2926
|
-
}
|
2927
|
-
}
|
2928
|
-
}
|
2929
|
-
), /* @__PURE__ */ React7.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React7.createElement(
|
2930
|
-
"form",
|
2926
|
+
/* @__PURE__ */ React7.createElement(
|
2927
|
+
Card,
|
2931
2928
|
{
|
2932
|
-
|
2933
|
-
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
console.log(
|
2938
|
-
"Form is submitted but onRegister prop is missing"
|
2939
|
-
);
|
2940
|
-
}
|
2941
|
-
}),
|
2942
|
-
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
2929
|
+
dir: props.direction,
|
2930
|
+
className: cn(
|
2931
|
+
(_h = props.classNames) == null ? void 0 : _h.card,
|
2932
|
+
props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
|
2933
|
+
)
|
2943
2934
|
},
|
2944
|
-
/* @__PURE__ */ React7.createElement(
|
2945
|
-
|
2946
|
-
return /* @__PURE__ */ React7.createElement(
|
2947
|
-
Controller2,
|
2948
|
-
{
|
2949
|
-
key: i,
|
2950
|
-
control,
|
2951
|
-
name: "fullName",
|
2952
|
-
render: ({ field }) => {
|
2953
|
-
var _a2, _b2, _c2;
|
2954
|
-
return /* @__PURE__ */ React7.createElement(
|
2955
|
-
Input,
|
2956
|
-
{
|
2957
|
-
width: "full",
|
2958
|
-
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
2959
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
2960
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
2961
|
-
...field
|
2962
|
-
}
|
2963
|
-
);
|
2964
|
-
}
|
2965
|
-
}
|
2966
|
-
);
|
2967
|
-
}
|
2968
|
-
if (fld === "email") {
|
2969
|
-
return /* @__PURE__ */ React7.createElement(
|
2970
|
-
Controller2,
|
2971
|
-
{
|
2972
|
-
key: i,
|
2973
|
-
control,
|
2974
|
-
name: "email",
|
2975
|
-
render: ({ field }) => {
|
2976
|
-
var _a2, _b2, _c2;
|
2977
|
-
return /* @__PURE__ */ React7.createElement(
|
2978
|
-
Input,
|
2979
|
-
{
|
2980
|
-
dir: "ltr",
|
2981
|
-
inputProps: {
|
2982
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
2983
|
-
},
|
2984
|
-
width: "full",
|
2985
|
-
autoComplete: "email",
|
2986
|
-
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
2987
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
2988
|
-
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
2989
|
-
...field
|
2990
|
-
}
|
2991
|
-
);
|
2992
|
-
}
|
2993
|
-
}
|
2994
|
-
);
|
2995
|
-
}
|
2996
|
-
if (fld === "username") {
|
2997
|
-
return /* @__PURE__ */ React7.createElement(
|
2998
|
-
Controller2,
|
2999
|
-
{
|
3000
|
-
key: i,
|
3001
|
-
control,
|
3002
|
-
name: "username",
|
3003
|
-
render: ({ field }) => {
|
3004
|
-
var _a2, _b2, _c2, _d2;
|
3005
|
-
return /* @__PURE__ */ React7.createElement(
|
3006
|
-
Input,
|
3007
|
-
{
|
3008
|
-
width: "full",
|
3009
|
-
autoComplete: "username",
|
3010
|
-
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
3011
|
-
labelProps: {
|
3012
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
3013
|
-
},
|
3014
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
3015
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
3016
|
-
...field
|
3017
|
-
}
|
3018
|
-
);
|
3019
|
-
}
|
3020
|
-
}
|
3021
|
-
);
|
3022
|
-
}
|
3023
|
-
})),
|
3024
|
-
/* @__PURE__ */ React7.createElement(
|
3025
|
-
Controller2,
|
2935
|
+
/* @__PURE__ */ React7.createElement(CardContent, { headless: true }, /* @__PURE__ */ React7.createElement("div", null, props.showError && /* @__PURE__ */ React7.createElement(
|
2936
|
+
Alert,
|
3026
2937
|
{
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
type: passwordVisible ? "text" : "password",
|
3036
|
-
endIcon: /* @__PURE__ */ React7.createElement(
|
3037
|
-
"div",
|
3038
|
-
{
|
3039
|
-
className: "hawa-cursor-pointer",
|
3040
|
-
onClick: () => setPasswordVisible(!passwordVisible)
|
3041
|
-
},
|
3042
|
-
passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
3043
|
-
" "
|
3044
|
-
),
|
3045
|
-
autoComplete: "new-password",
|
3046
|
-
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
3047
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
3048
|
-
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
3049
|
-
...field
|
3050
|
-
}
|
3051
|
-
);
|
2938
|
+
direction: props.direction,
|
2939
|
+
title: props.errorTitle,
|
2940
|
+
text: props.errorText,
|
2941
|
+
severity: "error",
|
2942
|
+
onAlertClosed: () => {
|
2943
|
+
if (props.onErrorDismissed) {
|
2944
|
+
props.onErrorDismissed();
|
2945
|
+
}
|
3052
2946
|
}
|
3053
2947
|
}
|
3054
|
-
),
|
3055
|
-
|
3056
|
-
Controller2,
|
2948
|
+
), /* @__PURE__ */ React7.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React7.createElement(
|
2949
|
+
"form",
|
3057
2950
|
{
|
3058
|
-
|
3059
|
-
|
3060
|
-
|
3061
|
-
|
2951
|
+
noValidate: true,
|
2952
|
+
onSubmit: handleSubmit((e) => {
|
2953
|
+
if (props.onRegister) {
|
2954
|
+
return props.onRegister(e);
|
2955
|
+
} else {
|
2956
|
+
console.log(
|
2957
|
+
"Form is submitted but onRegister prop is missing"
|
2958
|
+
);
|
2959
|
+
}
|
2960
|
+
}),
|
2961
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
2962
|
+
},
|
2963
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
2964
|
+
if (fld === "fullname") {
|
3062
2965
|
return /* @__PURE__ */ React7.createElement(
|
3063
|
-
|
2966
|
+
Controller2,
|
3064
2967
|
{
|
3065
|
-
|
3066
|
-
|
3067
|
-
|
3068
|
-
|
3069
|
-
|
3070
|
-
|
3071
|
-
|
2968
|
+
key: i,
|
2969
|
+
control,
|
2970
|
+
name: "fullName",
|
2971
|
+
render: ({ field }) => {
|
2972
|
+
var _a2, _b2, _c2;
|
2973
|
+
return /* @__PURE__ */ React7.createElement(
|
2974
|
+
Input,
|
2975
|
+
{
|
2976
|
+
width: "full",
|
2977
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
2978
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
2979
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
2980
|
+
...field
|
2981
|
+
}
|
2982
|
+
);
|
2983
|
+
}
|
3072
2984
|
}
|
3073
2985
|
);
|
3074
2986
|
}
|
3075
|
-
|
3076
|
-
),
|
3077
|
-
props.additionalInputs,
|
3078
|
-
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3079
|
-
Controller2,
|
3080
|
-
{
|
3081
|
-
control,
|
3082
|
-
name: "refCode",
|
3083
|
-
render: ({ field }) => {
|
3084
|
-
var _a2;
|
2987
|
+
if (fld === "email") {
|
3085
2988
|
return /* @__PURE__ */ React7.createElement(
|
3086
|
-
|
2989
|
+
Controller2,
|
3087
2990
|
{
|
3088
|
-
|
3089
|
-
|
3090
|
-
|
3091
|
-
|
3092
|
-
|
2991
|
+
key: i,
|
2992
|
+
control,
|
2993
|
+
name: "email",
|
2994
|
+
render: ({ field }) => {
|
2995
|
+
var _a2, _b2, _c2;
|
2996
|
+
return /* @__PURE__ */ React7.createElement(
|
2997
|
+
Input,
|
2998
|
+
{
|
2999
|
+
dir: "ltr",
|
3000
|
+
inputProps: {
|
3001
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
3002
|
+
},
|
3003
|
+
width: "full",
|
3004
|
+
autoComplete: "email",
|
3005
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
3006
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
3007
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
3008
|
+
...field
|
3009
|
+
}
|
3010
|
+
);
|
3011
|
+
}
|
3093
3012
|
}
|
3094
3013
|
);
|
3095
3014
|
}
|
3096
|
-
|
3097
|
-
),
|
3098
|
-
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3099
|
-
Controller2,
|
3100
|
-
{
|
3101
|
-
control,
|
3102
|
-
name: "reference",
|
3103
|
-
render: ({ field }) => {
|
3104
|
-
var _a2, _b2;
|
3015
|
+
if (fld === "username") {
|
3105
3016
|
return /* @__PURE__ */ React7.createElement(
|
3106
|
-
|
3017
|
+
Controller2,
|
3107
3018
|
{
|
3108
|
-
|
3109
|
-
|
3110
|
-
|
3111
|
-
|
3112
|
-
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3019
|
+
key: i,
|
3020
|
+
control,
|
3021
|
+
name: "username",
|
3022
|
+
render: ({ field }) => {
|
3023
|
+
var _a2, _b2, _c2, _d2;
|
3024
|
+
return /* @__PURE__ */ React7.createElement(
|
3025
|
+
Input,
|
3026
|
+
{
|
3027
|
+
width: "full",
|
3028
|
+
autoComplete: "username",
|
3029
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
3030
|
+
labelProps: {
|
3031
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
3032
|
+
},
|
3033
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
3034
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
3035
|
+
...field
|
3036
|
+
}
|
3037
|
+
);
|
3117
3038
|
}
|
3118
3039
|
}
|
3119
3040
|
);
|
3120
3041
|
}
|
3121
|
-
}
|
3122
|
-
|
3123
|
-
|
3124
|
-
|
3125
|
-
|
3126
|
-
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3042
|
+
})),
|
3043
|
+
/* @__PURE__ */ React7.createElement(
|
3044
|
+
Controller2,
|
3045
|
+
{
|
3046
|
+
control,
|
3047
|
+
name: "password",
|
3048
|
+
render: ({ field }) => {
|
3049
|
+
var _a2, _b2, _c2;
|
3050
|
+
return /* @__PURE__ */ React7.createElement(
|
3051
|
+
Input,
|
3052
|
+
{
|
3053
|
+
width: "full",
|
3054
|
+
type: passwordVisible ? "text" : "password",
|
3055
|
+
endIcon: /* @__PURE__ */ React7.createElement(
|
3056
|
+
"div",
|
3057
|
+
{
|
3058
|
+
className: "hawa-cursor-pointer",
|
3059
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
3060
|
+
},
|
3061
|
+
passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
3062
|
+
" "
|
3063
|
+
),
|
3064
|
+
autoComplete: "new-password",
|
3065
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
3066
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
3067
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
3068
|
+
...field
|
3069
|
+
}
|
3070
|
+
);
|
3071
|
+
}
|
3072
|
+
}
|
3073
|
+
),
|
3074
|
+
/* @__PURE__ */ React7.createElement(
|
3075
|
+
Controller2,
|
3076
|
+
{
|
3077
|
+
control,
|
3078
|
+
name: "confirm_password",
|
3079
|
+
render: ({ field }) => {
|
3080
|
+
var _a2, _b2, _c2;
|
3081
|
+
return /* @__PURE__ */ React7.createElement(
|
3082
|
+
Input,
|
3083
|
+
{
|
3084
|
+
width: "full",
|
3085
|
+
type: "password",
|
3086
|
+
autoComplete: "new-password",
|
3087
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
3088
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
3089
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
3090
|
+
...field
|
3091
|
+
}
|
3092
|
+
);
|
3093
|
+
}
|
3094
|
+
}
|
3095
|
+
),
|
3096
|
+
props.additionalInputs,
|
3097
|
+
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3098
|
+
Controller2,
|
3099
|
+
{
|
3100
|
+
control,
|
3101
|
+
name: "refCode",
|
3102
|
+
render: ({ field }) => {
|
3103
|
+
var _a2;
|
3104
|
+
return /* @__PURE__ */ React7.createElement(
|
3105
|
+
Input,
|
3106
|
+
{
|
3107
|
+
width: "full",
|
3108
|
+
label: texts == null ? void 0 : texts.refCode,
|
3109
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
3110
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
3111
|
+
...field
|
3112
|
+
}
|
3113
|
+
);
|
3114
|
+
}
|
3115
|
+
}
|
3116
|
+
),
|
3117
|
+
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3118
|
+
Controller2,
|
3119
|
+
{
|
3120
|
+
control,
|
3121
|
+
name: "reference",
|
3122
|
+
render: ({ field }) => {
|
3123
|
+
var _a2, _b2;
|
3124
|
+
return /* @__PURE__ */ React7.createElement(
|
3125
|
+
Select,
|
3126
|
+
{
|
3127
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
3128
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
3129
|
+
isCreatable: false,
|
3130
|
+
isMulti: false,
|
3131
|
+
isSearchable: false,
|
3132
|
+
isClearable: false,
|
3133
|
+
options: props.userReferenceOptions,
|
3134
|
+
onChange: (e) => {
|
3135
|
+
field.onChange(e.value);
|
3136
|
+
}
|
3137
|
+
}
|
3138
|
+
);
|
3139
|
+
}
|
3140
|
+
}
|
3141
|
+
),
|
3142
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React7.createElement(
|
3143
|
+
Controller2,
|
3144
|
+
{
|
3145
|
+
control,
|
3146
|
+
name: "terms_accepted",
|
3147
|
+
render: ({ field }) => {
|
3148
|
+
var _a2, _b2;
|
3149
|
+
return /* @__PURE__ */ React7.createElement(
|
3150
|
+
Checkbox,
|
3151
|
+
{
|
3152
|
+
id: "terms_accepted",
|
3153
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
3154
|
+
onCheckedChange: (e) => field.onChange(e),
|
3155
|
+
label: /* @__PURE__ */ React7.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__ */ React7.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React7.createElement(
|
3156
|
+
"span",
|
3157
|
+
{
|
3158
|
+
onClick: (e) => {
|
3159
|
+
e.preventDefault();
|
3160
|
+
if (props.onRouteToTOS) {
|
3161
|
+
props.onRouteToTOS();
|
3162
|
+
}
|
3163
|
+
},
|
3164
|
+
className: "clickable-link"
|
3165
|
+
},
|
3166
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
3167
|
+
)))
|
3168
|
+
}
|
3169
|
+
);
|
3170
|
+
}
|
3171
|
+
}
|
3172
|
+
), showNewsletterOption && /* @__PURE__ */ React7.createElement(
|
3173
|
+
Controller2,
|
3174
|
+
{
|
3175
|
+
control,
|
3176
|
+
name: "newsletter_accepted",
|
3177
|
+
render: ({ field }) => /* @__PURE__ */ React7.createElement(
|
3131
3178
|
Checkbox,
|
3132
3179
|
{
|
3133
|
-
id: "
|
3134
|
-
|
3135
|
-
onCheckedChange:
|
3136
|
-
label: /* @__PURE__ */ React7.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__ */ React7.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React7.createElement(
|
3137
|
-
"span",
|
3138
|
-
{
|
3139
|
-
onClick: (e) => {
|
3140
|
-
e.preventDefault();
|
3141
|
-
if (props.onRouteToTOS) {
|
3142
|
-
props.onRouteToTOS();
|
3143
|
-
}
|
3144
|
-
},
|
3145
|
-
className: "clickable-link"
|
3146
|
-
},
|
3147
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
3148
|
-
)))
|
3180
|
+
id: "newsletter_accepted",
|
3181
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
3182
|
+
onCheckedChange: field.onChange
|
3149
3183
|
}
|
3150
|
-
)
|
3184
|
+
)
|
3151
3185
|
}
|
3152
|
-
|
3153
|
-
|
3154
|
-
|
3186
|
+
)) : null,
|
3187
|
+
/* @__PURE__ */ React7.createElement(
|
3188
|
+
Button,
|
3189
|
+
{
|
3190
|
+
className: " hawa-w-full",
|
3191
|
+
type: "submit",
|
3192
|
+
isLoading: props.isLoading,
|
3193
|
+
disabled: props.isLoading
|
3194
|
+
},
|
3195
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
3196
|
+
),
|
3197
|
+
props.additionalButtons
|
3198
|
+
)), /* @__PURE__ */ React7.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__ */ React7.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React7.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
|
3199
|
+
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React7.createElement(
|
3200
|
+
CardFooter,
|
3155
3201
|
{
|
3156
|
-
|
3157
|
-
|
3158
|
-
render: ({ field }) => /* @__PURE__ */ React7.createElement(
|
3159
|
-
Checkbox,
|
3160
|
-
{
|
3161
|
-
id: "newsletter_accepted",
|
3162
|
-
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
3163
|
-
onCheckedChange: field.onChange
|
3164
|
-
}
|
3202
|
+
className: cn(
|
3203
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
3165
3204
|
)
|
3166
|
-
}
|
3167
|
-
)) : null,
|
3168
|
-
/* @__PURE__ */ React7.createElement(
|
3169
|
-
Button,
|
3170
|
-
{
|
3171
|
-
className: " hawa-w-full",
|
3172
|
-
type: "submit",
|
3173
|
-
isLoading: props.isLoading,
|
3174
|
-
disabled: props.isLoading
|
3175
3205
|
},
|
3176
|
-
|
3177
|
-
|
3178
|
-
|
3179
|
-
|
3180
|
-
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3206
|
+
/* @__PURE__ */ React7.createElement(
|
3207
|
+
AuthButtons,
|
3208
|
+
{
|
3209
|
+
texts: thirdPartyAuthTexts,
|
3210
|
+
viaGoogle: props.viaGoogle,
|
3211
|
+
viaGithub: props.viaGithub,
|
3212
|
+
viaTwitter: props.viaTwitter,
|
3213
|
+
isGoogleLoading: props.isGoogleLoading,
|
3214
|
+
isGithubLoading: props.isGithubLoading,
|
3215
|
+
isTwitterLoading: props.isTwitterLoading,
|
3216
|
+
handleGoogle: props.onGoogleRegister,
|
3217
|
+
handleGithub: props.onGithubRegister,
|
3218
|
+
handleTwitter: props.onTwitterRegister
|
3219
|
+
}
|
3184
3220
|
)
|
3185
|
-
|
3186
|
-
|
3187
|
-
AuthButtons,
|
3188
|
-
{
|
3189
|
-
texts: thirdPartyAuthTexts,
|
3190
|
-
viaGoogle: props.viaGoogle,
|
3191
|
-
viaGithub: props.viaGithub,
|
3192
|
-
viaTwitter: props.viaTwitter,
|
3193
|
-
isGoogleLoading: props.isGoogleLoading,
|
3194
|
-
isGithubLoading: props.isGithubLoading,
|
3195
|
-
isTwitterLoading: props.isTwitterLoading,
|
3196
|
-
handleGoogle: props.onGoogleRegister,
|
3197
|
-
handleGithub: props.onGithubRegister,
|
3198
|
-
handleTwitter: props.onTwitterRegister
|
3199
|
-
}
|
3200
|
-
)
|
3201
|
-
) : null)
|
3221
|
+
) : null
|
3222
|
+
)
|
3202
3223
|
);
|
3203
3224
|
};
|
3204
3225
|
|