@sikka/hawa 0.46.4-next → 0.48.0-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/{Radio-Dyvlywnk.d.mts → Radio-BPHTeDMz.d.mts} +8 -7
- package/dist/{Radio-DlPwVCG4.d.ts → Radio-cRcIH8_L.d.ts} +8 -7
- package/dist/blocks/auth/index.d.mts +34 -17
- package/dist/blocks/auth/index.d.ts +34 -17
- package/dist/blocks/auth/index.js +1008 -430
- package/dist/blocks/auth/index.mjs +427 -297
- package/dist/blocks/feedback/index.d.mts +1 -1
- package/dist/blocks/feedback/index.d.ts +1 -1
- package/dist/blocks/feedback/index.js +68 -79
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.d.mts +28 -11
- package/dist/blocks/index.d.ts +28 -11
- package/dist/blocks/index.js +2340 -2233
- package/dist/blocks/index.mjs +407 -269
- package/dist/blocks/misc/index.d.mts +1 -1
- package/dist/blocks/misc/index.d.ts +1 -1
- package/dist/blocks/misc/index.js +68 -79
- package/dist/blocks/misc/index.mjs +50 -367
- package/dist/blocks/pricing/index.d.mts +1 -1
- package/dist/blocks/pricing/index.d.ts +1 -1
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/{chunk-6TG2PHZK.mjs → chunk-AWJSHOYU.mjs} +68 -79
- package/dist/{chunk-5CTMGPEF.mjs → chunk-GBLWUEYN.mjs} +650 -674
- package/dist/chunk-JFWD2ICY.mjs +511 -0
- package/dist/elements/index.d.mts +2 -2
- package/dist/elements/index.d.ts +2 -2
- package/dist/elements/index.js +81 -105
- package/dist/elements/index.mjs +1 -1
- package/dist/index.css +7 -0
- package/dist/index.d.mts +36 -17
- package/dist/index.d.ts +36 -17
- package/dist/index.js +482 -373
- package/dist/index.mjs +487 -373
- package/dist/phoneInput/index.d.mts +7 -7
- package/dist/phoneInput/index.d.ts +7 -7
- package/dist/phoneInput/index.js +78 -85
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +78 -85
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +3 -20
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +3 -20
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -0
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +68 -79
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +68 -79
- package/dist/select/index.mjs.map +1 -1
- package/dist/{textTypes-DXLtO2fL.d.mts → textTypes-CYQYIsFt.d.mts} +1 -0
- package/dist/{textTypes-DXLtO2fL.d.ts → textTypes-CYQYIsFt.d.ts} +1 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunk-EOH6A3GR.mjs +0 -183
@@ -1,13 +1,18 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
|
-
Input
|
4
|
-
|
3
|
+
Input,
|
4
|
+
Tabs,
|
5
|
+
TabsContent,
|
6
|
+
TabsList,
|
7
|
+
TabsTrigger
|
8
|
+
} from "../../chunk-JFWD2ICY.mjs";
|
5
9
|
import {
|
6
10
|
StopPropagationWrapper
|
7
11
|
} from "../../chunk-47APBDKK.mjs";
|
12
|
+
import "../../chunk-C2UOOH4X.mjs";
|
8
13
|
import {
|
9
14
|
Select
|
10
|
-
} from "../../chunk-
|
15
|
+
} from "../../chunk-AWJSHOYU.mjs";
|
11
16
|
import {
|
12
17
|
EyeIcon,
|
13
18
|
HiddenEyeIcon
|
@@ -2518,11 +2523,13 @@ var PhoneInput = ({
|
|
2518
2523
|
countryCodes,
|
2519
2524
|
...props
|
2520
2525
|
}) => {
|
2526
|
+
var _a;
|
2521
2527
|
const [phoneNumber, setPhoneNumber] = useState2("");
|
2522
|
-
const [countryCode, setCountryCode] = useState2(
|
2528
|
+
const [countryCode, setCountryCode] = useState2(
|
2529
|
+
props.preferredCountry || { label: "+966" }
|
2530
|
+
);
|
2523
2531
|
const inputRef = useRef2(null);
|
2524
2532
|
const handleInputChange = (e) => {
|
2525
|
-
console.log("test e ", e.target.value);
|
2526
2533
|
const validChars = /^[0-9-()]+$/;
|
2527
2534
|
const input = e.target.value;
|
2528
2535
|
if (input === "" || validChars.test(input)) {
|
@@ -2544,11 +2551,13 @@ var PhoneInput = ({
|
|
2544
2551
|
isMulti: false,
|
2545
2552
|
isSearchable: true,
|
2546
2553
|
isClearable: false,
|
2547
|
-
placeholder:
|
2554
|
+
placeholder: (_a = props.preferredCountry) == null ? void 0 : _a.label,
|
2548
2555
|
options: countryCodes || countries_default,
|
2549
|
-
onChange: setCountryCode,
|
2550
|
-
|
2551
|
-
|
2556
|
+
onChange: (e) => setCountryCode({ label: e.label, value: e.label }),
|
2557
|
+
valueKey: "label",
|
2558
|
+
labelKey: "label",
|
2559
|
+
value: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label },
|
2560
|
+
defaultValue: { label: countryCode == null ? void 0 : countryCode.label, value: countryCode == null ? void 0 : countryCode.label }
|
2552
2561
|
}
|
2553
2562
|
), /* @__PURE__ */ React4.createElement("div", { className: "hawa-relative hawa-flex hawa-h-fit hawa-w-full hawa-flex-col hawa-justify-center hawa-gap-0" }, /* @__PURE__ */ React4.createElement(
|
2554
2563
|
"input",
|
@@ -2862,14 +2871,7 @@ var LoginForm = ({
|
|
2862
2871
|
(texts == null ? void 0 : texts.loginText) || "Login"
|
2863
2872
|
),
|
2864
2873
|
props.additionalButtons && props.additionalButtons,
|
2865
|
-
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(
|
2866
|
-
"span",
|
2867
|
-
{
|
2868
|
-
onClick: props.onRouteToRegister,
|
2869
|
-
className: "clickable-link"
|
2870
|
-
},
|
2871
|
-
(texts == null ? void 0 : texts.createAccount) || "Create Account"
|
2872
|
-
))
|
2874
|
+
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("span", { onClick: props.onRouteToRegister, className: "clickable-link" }, (texts == null ? void 0 : texts.createAccount) || "Create Account"))
|
2873
2875
|
)),
|
2874
2876
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React5.createElement(
|
2875
2877
|
CardFooter,
|
@@ -2902,6 +2904,12 @@ var LoginForm = ({
|
|
2902
2904
|
import React7, { useState as useState4 } from "react";
|
2903
2905
|
import { Controller as Controller2, FormProvider, useForm as useForm2 } from "react-hook-form";
|
2904
2906
|
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
2907
|
+
import {
|
2908
|
+
isPossiblePhoneNumber as isPossiblePhoneNumber2,
|
2909
|
+
isValidPhoneNumber as isValidPhoneNumber2,
|
2910
|
+
parsePhoneNumber as parsePhoneNumber2,
|
2911
|
+
validatePhoneNumberLength as validatePhoneNumberLength2
|
2912
|
+
} from "libphonenumber-js";
|
2905
2913
|
import * as z2 from "zod";
|
2906
2914
|
|
2907
2915
|
// elements/checkbox/Checkbox.tsx
|
@@ -3047,10 +3055,15 @@ var RegisterForm = ({
|
|
3047
3055
|
minPasswordLength = 8,
|
3048
3056
|
showTermsOption = false,
|
3049
3057
|
showNewsletterOption = false,
|
3058
|
+
registerTypes,
|
3050
3059
|
...props
|
3051
3060
|
}) => {
|
3052
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
3061
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
3053
3062
|
const [passwordVisible, setPasswordVisible] = useState4(false);
|
3063
|
+
const [selectedRegisterType, setSelectedRegisterType] = useState4({
|
3064
|
+
value: ((_a = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _a.value) || "password",
|
3065
|
+
label: ((_b = registerTypes == null ? void 0 : registerTypes[0]) == null ? void 0 : _b.label) || "Password"
|
3066
|
+
});
|
3054
3067
|
const thirdPartyAuthTexts = {
|
3055
3068
|
continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
|
3056
3069
|
continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
|
@@ -3062,8 +3075,12 @@ var RegisterForm = ({
|
|
3062
3075
|
};
|
3063
3076
|
const methods = useForm2();
|
3064
3077
|
let fieldSchemas = {};
|
3078
|
+
const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
|
3079
|
+
if (hasPhoneType && selectedRegisterType.value === "phone") {
|
3080
|
+
registerFields = ["phone"];
|
3081
|
+
}
|
3065
3082
|
registerFields.forEach((field) => {
|
3066
|
-
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
3083
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2;
|
3067
3084
|
switch (field) {
|
3068
3085
|
case "fullname":
|
3069
3086
|
fieldSchemas["fullName"] = z2.string().optional();
|
@@ -3088,55 +3105,85 @@ var RegisterForm = ({
|
|
3088
3105
|
{ message: ((_g2 = texts == null ? void 0 : texts.username) == null ? void 0 : _g2.invalid) || "Invalid username" }
|
3089
3106
|
);
|
3090
3107
|
break;
|
3108
|
+
case "phone":
|
3109
|
+
fieldSchemas["phone"] = z2.string({
|
3110
|
+
required_error: ((_h2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _h2.required) || "Phone Number Required"
|
3111
|
+
}).refine(
|
3112
|
+
(value) => {
|
3113
|
+
let isPhoneValid = isPossiblePhoneNumber2(value) && isValidPhoneNumber2(value) && validatePhoneNumberLength2(value) === void 0;
|
3114
|
+
return isPhoneValid;
|
3115
|
+
},
|
3116
|
+
{ message: ((_i2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _i2.invalid) || "Phone Number Invalid" }
|
3117
|
+
);
|
3118
|
+
break;
|
3091
3119
|
}
|
3092
3120
|
});
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
3096
|
-
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
|
3102
|
-
|
3103
|
-
|
3104
|
-
|
3105
|
-
|
3106
|
-
|
3107
|
-
|
3108
|
-
|
3109
|
-
|
3110
|
-
|
3111
|
-
|
3112
|
-
|
3113
|
-
|
3114
|
-
|
3115
|
-
|
3116
|
-
|
3117
|
-
|
3118
|
-
|
3121
|
+
let formSchema;
|
3122
|
+
if (selectedRegisterType.value === "phone") {
|
3123
|
+
formSchema = z2.object({
|
3124
|
+
phone: z2.string({
|
3125
|
+
required_error: ((_c = texts == null ? void 0 : texts.phone) == null ? void 0 : _c.required) || "Phone Number Required"
|
3126
|
+
}).refine(
|
3127
|
+
(value) => {
|
3128
|
+
let isPhoneValid = isPossiblePhoneNumber2(value) && isValidPhoneNumber2(value) && validatePhoneNumberLength2(value) === void 0;
|
3129
|
+
return isPhoneValid;
|
3130
|
+
},
|
3131
|
+
{ message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
|
3132
|
+
),
|
3133
|
+
refCode: z2.string().optional(),
|
3134
|
+
reference: z2.string().optional(),
|
3135
|
+
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
3136
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
3137
|
+
}),
|
3138
|
+
newsletter_accepted: z2.boolean().optional()
|
3139
|
+
});
|
3140
|
+
} else {
|
3141
|
+
formSchema = z2.object({
|
3142
|
+
...fieldSchemas,
|
3143
|
+
password: z2.string({
|
3144
|
+
required_error: ((_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required) || "Password is required"
|
3145
|
+
}).min(minPasswordLength, {
|
3146
|
+
message: ((_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.tooShort) || "Password is too short"
|
3147
|
+
}).refine((value) => value !== "", {
|
3148
|
+
message: ((_g = texts == null ? void 0 : texts.password) == null ? void 0 : _g.required) || "Password is required"
|
3149
|
+
}),
|
3150
|
+
confirm_password: z2.string({
|
3151
|
+
required_error: ((_h = texts == null ? void 0 : texts.confirm) == null ? void 0 : _h.required) || "Confirm password required"
|
3152
|
+
}).min(minPasswordLength, {
|
3153
|
+
message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
|
3154
|
+
}).refine((value) => value !== "", {
|
3155
|
+
message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
|
3156
|
+
}),
|
3157
|
+
refCode: z2.string().optional(),
|
3158
|
+
reference: z2.string().optional(),
|
3159
|
+
terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
|
3160
|
+
message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
|
3161
|
+
}),
|
3162
|
+
newsletter_accepted: z2.boolean().optional()
|
3163
|
+
}).refine((data) => data.password === data.confirm_password, {
|
3164
|
+
message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
|
3165
|
+
path: ["confirm_password"]
|
3166
|
+
});
|
3167
|
+
}
|
3119
3168
|
const { handleSubmit, control, formState } = useForm2({
|
3120
3169
|
resolver: zodResolver2(formSchema)
|
3121
3170
|
});
|
3122
|
-
return /* @__PURE__ */ React7.createElement(
|
3123
|
-
|
3171
|
+
return /* @__PURE__ */ React7.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ React7.createElement(
|
3172
|
+
Card,
|
3124
3173
|
{
|
3174
|
+
dir: props.direction,
|
3125
3175
|
className: cn(
|
3126
|
-
|
3127
|
-
|
3176
|
+
(_m = props.classNames) == null ? void 0 : _m.card,
|
3177
|
+
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
3128
3178
|
)
|
3129
3179
|
},
|
3130
3180
|
/* @__PURE__ */ React7.createElement(
|
3131
|
-
|
3181
|
+
CardContent,
|
3132
3182
|
{
|
3133
|
-
|
3134
|
-
|
3135
|
-
(_i = props.classNames) == null ? void 0 : _i.card,
|
3136
|
-
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
3137
|
-
)
|
3183
|
+
headless: registerTypes ? registerTypes.length <= 1 : true,
|
3184
|
+
noPadding: props.cardless
|
3138
3185
|
},
|
3139
|
-
/* @__PURE__ */ React7.createElement(
|
3186
|
+
/* @__PURE__ */ React7.createElement("div", null, props.showError && /* @__PURE__ */ React7.createElement(
|
3140
3187
|
Alert,
|
3141
3188
|
{
|
3142
3189
|
direction: props.direction,
|
@@ -3157,240 +3204,352 @@ var RegisterForm = ({
|
|
3157
3204
|
if (props.onRegister) {
|
3158
3205
|
return props.onRegister(e);
|
3159
3206
|
} else {
|
3160
|
-
console.log(
|
3161
|
-
"Form is submitted but onRegister prop is missing"
|
3162
|
-
);
|
3207
|
+
console.log("Form is submitted but onRegister prop is missing");
|
3163
3208
|
}
|
3164
3209
|
}),
|
3165
3210
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
3166
3211
|
},
|
3167
|
-
/* @__PURE__ */ React7.createElement(
|
3168
|
-
|
3169
|
-
|
3212
|
+
/* @__PURE__ */ React7.createElement(
|
3213
|
+
Tabs,
|
3214
|
+
{
|
3215
|
+
dir: props.direction,
|
3216
|
+
value: selectedRegisterType.value,
|
3217
|
+
onValueChange: (e) => setSelectedRegisterType(
|
3218
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
3219
|
+
label: "Password",
|
3220
|
+
value: "password"
|
3221
|
+
}
|
3222
|
+
)
|
3223
|
+
},
|
3224
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React7.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ React7.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React7.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
|
3225
|
+
/* @__PURE__ */ React7.createElement(
|
3226
|
+
TabsContent,
|
3227
|
+
{
|
3228
|
+
value: "password",
|
3229
|
+
className: cn(
|
3230
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
3231
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
3232
|
+
),
|
3233
|
+
dir: props.direction
|
3234
|
+
},
|
3235
|
+
/* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
3236
|
+
if (fld === "fullname") {
|
3237
|
+
return /* @__PURE__ */ React7.createElement(
|
3238
|
+
Controller2,
|
3239
|
+
{
|
3240
|
+
key: i,
|
3241
|
+
control,
|
3242
|
+
name: "fullName",
|
3243
|
+
render: ({ field }) => {
|
3244
|
+
var _a2, _b2, _c2;
|
3245
|
+
return /* @__PURE__ */ React7.createElement(
|
3246
|
+
Input,
|
3247
|
+
{
|
3248
|
+
width: "full",
|
3249
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
3250
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
3251
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
3252
|
+
...field
|
3253
|
+
}
|
3254
|
+
);
|
3255
|
+
}
|
3256
|
+
}
|
3257
|
+
);
|
3258
|
+
}
|
3259
|
+
if (fld === "email") {
|
3260
|
+
return /* @__PURE__ */ React7.createElement(
|
3261
|
+
Controller2,
|
3262
|
+
{
|
3263
|
+
key: i,
|
3264
|
+
control,
|
3265
|
+
name: "email",
|
3266
|
+
render: ({ field }) => {
|
3267
|
+
var _a2, _b2, _c2;
|
3268
|
+
return /* @__PURE__ */ React7.createElement(
|
3269
|
+
Input,
|
3270
|
+
{
|
3271
|
+
dir: "ltr",
|
3272
|
+
inputProps: {
|
3273
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
3274
|
+
},
|
3275
|
+
width: "full",
|
3276
|
+
autoComplete: "email",
|
3277
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
3278
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
3279
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
3280
|
+
...field,
|
3281
|
+
onChange: (e) => {
|
3282
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
3283
|
+
}
|
3284
|
+
}
|
3285
|
+
);
|
3286
|
+
}
|
3287
|
+
}
|
3288
|
+
);
|
3289
|
+
}
|
3290
|
+
if (fld === "username") {
|
3291
|
+
return /* @__PURE__ */ React7.createElement(
|
3292
|
+
Controller2,
|
3293
|
+
{
|
3294
|
+
key: i,
|
3295
|
+
control,
|
3296
|
+
name: "username",
|
3297
|
+
render: ({ field }) => {
|
3298
|
+
var _a2, _b2, _c2, _d2;
|
3299
|
+
return /* @__PURE__ */ React7.createElement(
|
3300
|
+
Input,
|
3301
|
+
{
|
3302
|
+
width: "full",
|
3303
|
+
autoComplete: "username",
|
3304
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
3305
|
+
labelProps: {
|
3306
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
3307
|
+
},
|
3308
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
3309
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
3310
|
+
...field
|
3311
|
+
}
|
3312
|
+
);
|
3313
|
+
}
|
3314
|
+
}
|
3315
|
+
);
|
3316
|
+
}
|
3317
|
+
})),
|
3318
|
+
/* @__PURE__ */ React7.createElement(
|
3170
3319
|
Controller2,
|
3171
3320
|
{
|
3172
|
-
key: i,
|
3173
3321
|
control,
|
3174
|
-
name: "
|
3322
|
+
name: "password",
|
3175
3323
|
render: ({ field }) => {
|
3176
3324
|
var _a2, _b2, _c2;
|
3177
3325
|
return /* @__PURE__ */ React7.createElement(
|
3178
3326
|
Input,
|
3179
3327
|
{
|
3180
3328
|
width: "full",
|
3181
|
-
|
3182
|
-
|
3183
|
-
|
3329
|
+
type: passwordVisible ? "text" : "password",
|
3330
|
+
autoComplete: "new-password",
|
3331
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
3332
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
3333
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
3334
|
+
endIcon: /* @__PURE__ */ React7.createElement(
|
3335
|
+
"div",
|
3336
|
+
{
|
3337
|
+
className: "hawa-cursor-pointer",
|
3338
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
3339
|
+
},
|
3340
|
+
passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
3341
|
+
" "
|
3342
|
+
),
|
3184
3343
|
...field
|
3185
3344
|
}
|
3186
3345
|
);
|
3187
3346
|
}
|
3188
3347
|
}
|
3189
|
-
)
|
3190
|
-
|
3191
|
-
if (fld === "email") {
|
3192
|
-
return /* @__PURE__ */ React7.createElement(
|
3348
|
+
),
|
3349
|
+
/* @__PURE__ */ React7.createElement(
|
3193
3350
|
Controller2,
|
3194
3351
|
{
|
3195
|
-
key: i,
|
3196
3352
|
control,
|
3197
|
-
name: "
|
3353
|
+
name: "confirm_password",
|
3198
3354
|
render: ({ field }) => {
|
3199
3355
|
var _a2, _b2, _c2;
|
3200
3356
|
return /* @__PURE__ */ React7.createElement(
|
3201
3357
|
Input,
|
3202
3358
|
{
|
3203
|
-
dir: "ltr",
|
3204
|
-
inputProps: {
|
3205
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
3206
|
-
},
|
3207
3359
|
width: "full",
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
placeholder: ((
|
3212
|
-
|
3213
|
-
|
3214
|
-
|
3215
|
-
|
3216
|
-
|
3217
|
-
|
3360
|
+
type: passwordVisible ? "text" : "password",
|
3361
|
+
autoComplete: "new-password",
|
3362
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
3363
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
3364
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
3365
|
+
endIcon: /* @__PURE__ */ React7.createElement(
|
3366
|
+
"div",
|
3367
|
+
{
|
3368
|
+
className: "hawa-cursor-pointer",
|
3369
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
3370
|
+
},
|
3371
|
+
passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
3372
|
+
" "
|
3373
|
+
),
|
3374
|
+
...field
|
3218
3375
|
}
|
3219
3376
|
);
|
3220
3377
|
}
|
3221
3378
|
}
|
3222
|
-
)
|
3223
|
-
|
3224
|
-
|
3225
|
-
return /* @__PURE__ */ React7.createElement(
|
3379
|
+
),
|
3380
|
+
props.additionalInputs,
|
3381
|
+
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3226
3382
|
Controller2,
|
3227
3383
|
{
|
3228
|
-
key: i,
|
3229
3384
|
control,
|
3230
|
-
name: "
|
3385
|
+
name: "refCode",
|
3231
3386
|
render: ({ field }) => {
|
3232
|
-
var _a2
|
3387
|
+
var _a2;
|
3233
3388
|
return /* @__PURE__ */ React7.createElement(
|
3234
3389
|
Input,
|
3235
3390
|
{
|
3236
3391
|
width: "full",
|
3237
|
-
|
3238
|
-
|
3239
|
-
|
3240
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
3241
|
-
},
|
3242
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
3243
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
3392
|
+
label: texts == null ? void 0 : texts.refCode,
|
3393
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
3394
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
3244
3395
|
...field
|
3245
3396
|
}
|
3246
3397
|
);
|
3247
3398
|
}
|
3248
3399
|
}
|
3249
|
-
)
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3254
|
-
|
3255
|
-
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
return /* @__PURE__ */ React7.createElement(
|
3260
|
-
Input,
|
3261
|
-
{
|
3262
|
-
width: "full",
|
3263
|
-
type: passwordVisible ? "text" : "password",
|
3264
|
-
endIcon: /* @__PURE__ */ React7.createElement(
|
3265
|
-
"div",
|
3400
|
+
),
|
3401
|
+
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3402
|
+
Controller2,
|
3403
|
+
{
|
3404
|
+
control,
|
3405
|
+
name: "reference",
|
3406
|
+
render: ({ field }) => {
|
3407
|
+
var _a2, _b2;
|
3408
|
+
return /* @__PURE__ */ React7.createElement(
|
3409
|
+
Select,
|
3266
3410
|
{
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3277
|
-
...field
|
3411
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
3412
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
3413
|
+
isCreatable: false,
|
3414
|
+
isMulti: false,
|
3415
|
+
isSearchable: false,
|
3416
|
+
isClearable: false,
|
3417
|
+
options: props.userReferenceOptions || [],
|
3418
|
+
onChange: (e) => field.onChange(e)
|
3419
|
+
}
|
3420
|
+
);
|
3278
3421
|
}
|
3279
|
-
|
3280
|
-
|
3281
|
-
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3292
|
-
|
3293
|
-
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
|
3298
|
-
|
3299
|
-
|
3422
|
+
}
|
3423
|
+
)
|
3424
|
+
),
|
3425
|
+
/* @__PURE__ */ React7.createElement(
|
3426
|
+
TabsContent,
|
3427
|
+
{
|
3428
|
+
value: "phone",
|
3429
|
+
className: cn(
|
3430
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
3431
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
3432
|
+
),
|
3433
|
+
dir: props.direction
|
3434
|
+
},
|
3435
|
+
/* @__PURE__ */ React7.createElement(
|
3436
|
+
Controller2,
|
3437
|
+
{
|
3438
|
+
control,
|
3439
|
+
name: "phone",
|
3440
|
+
render: ({ field }) => {
|
3441
|
+
var _a2, _b2;
|
3442
|
+
return /* @__PURE__ */ React7.createElement(
|
3443
|
+
PhoneInput,
|
3444
|
+
{
|
3445
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
3446
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
3447
|
+
preferredCountry: { label: "+966" },
|
3448
|
+
...props.phoneInputProps,
|
3449
|
+
handleChange: (e) => {
|
3450
|
+
if (isValidPhoneNumber2(e) && isPossiblePhoneNumber2(e) && validatePhoneNumberLength2(e) === void 0) {
|
3451
|
+
let parsed = parsePhoneNumber2(e);
|
3452
|
+
field.onChange(parsed.number);
|
3453
|
+
} else {
|
3454
|
+
field.onChange(e);
|
3455
|
+
}
|
3456
|
+
}
|
3457
|
+
}
|
3458
|
+
);
|
3300
3459
|
}
|
3301
|
-
|
3302
|
-
|
3303
|
-
|
3304
|
-
|
3305
|
-
|
3306
|
-
|
3307
|
-
|
3308
|
-
|
3309
|
-
|
3310
|
-
|
3311
|
-
|
3312
|
-
|
3313
|
-
|
3314
|
-
|
3315
|
-
|
3316
|
-
|
3317
|
-
|
3318
|
-
|
3319
|
-
|
3320
|
-
|
3460
|
+
}
|
3461
|
+
),
|
3462
|
+
props.additionalInputs,
|
3463
|
+
props.showRefCode && /* @__PURE__ */ React7.createElement(
|
3464
|
+
Controller2,
|
3465
|
+
{
|
3466
|
+
control,
|
3467
|
+
name: "refCode",
|
3468
|
+
render: ({ field }) => {
|
3469
|
+
var _a2;
|
3470
|
+
return /* @__PURE__ */ React7.createElement(
|
3471
|
+
Input,
|
3472
|
+
{
|
3473
|
+
width: "full",
|
3474
|
+
label: texts == null ? void 0 : texts.refCode,
|
3475
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
3476
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
3477
|
+
...field
|
3478
|
+
}
|
3479
|
+
);
|
3321
3480
|
}
|
3322
|
-
|
3323
|
-
|
3324
|
-
|
3325
|
-
|
3326
|
-
|
3327
|
-
|
3328
|
-
|
3329
|
-
|
3330
|
-
|
3331
|
-
|
3332
|
-
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
|
3338
|
-
|
3339
|
-
|
3340
|
-
|
3341
|
-
|
3342
|
-
|
3343
|
-
|
3481
|
+
}
|
3482
|
+
),
|
3483
|
+
props.showUserSource && /* @__PURE__ */ React7.createElement(
|
3484
|
+
Controller2,
|
3485
|
+
{
|
3486
|
+
control,
|
3487
|
+
name: "reference",
|
3488
|
+
render: ({ field }) => {
|
3489
|
+
var _a2, _b2;
|
3490
|
+
return /* @__PURE__ */ React7.createElement(
|
3491
|
+
Select,
|
3492
|
+
{
|
3493
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
3494
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
3495
|
+
isCreatable: false,
|
3496
|
+
isMulti: false,
|
3497
|
+
isSearchable: false,
|
3498
|
+
isClearable: false,
|
3499
|
+
options: props.userReferenceOptions || [],
|
3500
|
+
onChange: (e) => field.onChange(e)
|
3501
|
+
}
|
3502
|
+
);
|
3344
3503
|
}
|
3345
|
-
|
3504
|
+
}
|
3505
|
+
)
|
3506
|
+
),
|
3507
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React7.createElement(
|
3508
|
+
Controller2,
|
3509
|
+
{
|
3510
|
+
control,
|
3511
|
+
name: "terms_accepted",
|
3512
|
+
render: ({ field }) => {
|
3513
|
+
var _a2, _b2;
|
3514
|
+
return /* @__PURE__ */ React7.createElement(
|
3515
|
+
Checkbox,
|
3516
|
+
{
|
3517
|
+
id: "terms_accepted",
|
3518
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
3519
|
+
onCheckedChange: (e) => field.onChange(e),
|
3520
|
+
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(
|
3521
|
+
"span",
|
3522
|
+
{
|
3523
|
+
onClick: (e) => {
|
3524
|
+
e.preventDefault();
|
3525
|
+
if (props.onRouteToTOS) {
|
3526
|
+
props.onRouteToTOS();
|
3527
|
+
}
|
3528
|
+
},
|
3529
|
+
className: "clickable-link"
|
3530
|
+
},
|
3531
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
3532
|
+
)))
|
3533
|
+
}
|
3534
|
+
);
|
3535
|
+
}
|
3346
3536
|
}
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3353
|
-
name: "terms_accepted",
|
3354
|
-
render: ({ field }) => {
|
3355
|
-
var _a2, _b2;
|
3356
|
-
return /* @__PURE__ */ React7.createElement(
|
3537
|
+
), showNewsletterOption && /* @__PURE__ */ React7.createElement(
|
3538
|
+
Controller2,
|
3539
|
+
{
|
3540
|
+
control,
|
3541
|
+
name: "newsletter_accepted",
|
3542
|
+
render: ({ field }) => /* @__PURE__ */ React7.createElement(
|
3357
3543
|
Checkbox,
|
3358
3544
|
{
|
3359
|
-
id: "
|
3360
|
-
|
3361
|
-
onCheckedChange:
|
3362
|
-
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(
|
3363
|
-
"span",
|
3364
|
-
{
|
3365
|
-
onClick: (e) => {
|
3366
|
-
e.preventDefault();
|
3367
|
-
if (props.onRouteToTOS) {
|
3368
|
-
props.onRouteToTOS();
|
3369
|
-
}
|
3370
|
-
},
|
3371
|
-
className: "clickable-link"
|
3372
|
-
},
|
3373
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
3374
|
-
)))
|
3545
|
+
id: "newsletter_accepted",
|
3546
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
3547
|
+
onCheckedChange: field.onChange
|
3375
3548
|
}
|
3376
|
-
)
|
3549
|
+
)
|
3377
3550
|
}
|
3378
|
-
|
3379
|
-
),
|
3380
|
-
Controller2,
|
3381
|
-
{
|
3382
|
-
control,
|
3383
|
-
name: "newsletter_accepted",
|
3384
|
-
render: ({ field }) => /* @__PURE__ */ React7.createElement(
|
3385
|
-
Checkbox,
|
3386
|
-
{
|
3387
|
-
id: "newsletter_accepted",
|
3388
|
-
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
3389
|
-
onCheckedChange: field.onChange
|
3390
|
-
}
|
3391
|
-
)
|
3392
|
-
}
|
3393
|
-
)) : null,
|
3551
|
+
)) : null
|
3552
|
+
),
|
3394
3553
|
/* @__PURE__ */ React7.createElement(
|
3395
3554
|
Button,
|
3396
3555
|
{
|
@@ -3402,33 +3561,33 @@ var RegisterForm = ({
|
|
3402
3561
|
(texts == null ? void 0 : texts.registerText) || "Register"
|
3403
3562
|
),
|
3404
3563
|
props.additionalButtons
|
3405
|
-
)), props.onRouteToLogin && /* @__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")))
|
3406
|
-
|
3407
|
-
|
3408
|
-
|
3409
|
-
|
3410
|
-
|
3411
|
-
|
3412
|
-
|
3413
|
-
},
|
3414
|
-
/* @__PURE__ */ React7.createElement(
|
3415
|
-
AuthButtons,
|
3416
|
-
{
|
3417
|
-
texts: thirdPartyAuthTexts,
|
3418
|
-
viaGoogle: props.viaGoogle,
|
3419
|
-
viaGithub: props.viaGithub,
|
3420
|
-
viaTwitter: props.viaTwitter,
|
3421
|
-
isGoogleLoading: props.isGoogleLoading,
|
3422
|
-
isGithubLoading: props.isGithubLoading,
|
3423
|
-
isTwitterLoading: props.isTwitterLoading,
|
3424
|
-
handleGoogle: props.onGoogleRegister,
|
3425
|
-
handleGithub: props.onGithubRegister,
|
3426
|
-
handleTwitter: props.onTwitterRegister
|
3427
|
-
}
|
3564
|
+
)), props.onRouteToLogin && /* @__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")))
|
3565
|
+
),
|
3566
|
+
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React7.createElement(
|
3567
|
+
CardFooter,
|
3568
|
+
{
|
3569
|
+
noPadding: props.cardless,
|
3570
|
+
className: cn(
|
3571
|
+
props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
|
3428
3572
|
)
|
3429
|
-
|
3430
|
-
|
3431
|
-
|
3573
|
+
},
|
3574
|
+
/* @__PURE__ */ React7.createElement(
|
3575
|
+
AuthButtons,
|
3576
|
+
{
|
3577
|
+
texts: thirdPartyAuthTexts,
|
3578
|
+
viaGoogle: props.viaGoogle,
|
3579
|
+
viaGithub: props.viaGithub,
|
3580
|
+
viaTwitter: props.viaTwitter,
|
3581
|
+
isGoogleLoading: props.isGoogleLoading,
|
3582
|
+
isGithubLoading: props.isGithubLoading,
|
3583
|
+
isTwitterLoading: props.isTwitterLoading,
|
3584
|
+
handleGoogle: props.onGoogleRegister,
|
3585
|
+
handleGithub: props.onGithubRegister,
|
3586
|
+
handleTwitter: props.onTwitterRegister
|
3587
|
+
}
|
3588
|
+
)
|
3589
|
+
) : null
|
3590
|
+
));
|
3432
3591
|
};
|
3433
3592
|
|
3434
3593
|
// blocks/auth/AppLanding.tsx
|
@@ -3772,14 +3931,7 @@ var PinInputRoot = React12.forwardRef(({ className, containerClassName, ...props
|
|
3772
3931
|
}
|
3773
3932
|
));
|
3774
3933
|
PinInputRoot.displayName = "PinInputRoot";
|
3775
|
-
var PinInputGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement(
|
3776
|
-
"div",
|
3777
|
-
{
|
3778
|
-
ref,
|
3779
|
-
className: cn("hawa-flex hawa-items-center", className),
|
3780
|
-
...props
|
3781
|
-
}
|
3782
|
-
));
|
3934
|
+
var PinInputGroup = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React12.createElement("div", { ref, className: cn("hawa-flex hawa-items-center", className), ...props }));
|
3783
3935
|
PinInputGroup.displayName = "PinInputGroup";
|
3784
3936
|
var PinInputSlot = React12.forwardRef(({ index, className, ...props }, ref) => {
|
3785
3937
|
const pinInputContext = React12.useContext(OTPInputContext);
|
@@ -3802,22 +3954,12 @@ var PinInputSlot = React12.forwardRef(({ index, className, ...props }, ref) => {
|
|
3802
3954
|
PinInputSlot.displayName = "PinInputSlot";
|
3803
3955
|
var PinInputSeperator = React12.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React12.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React12.createElement(Dot, null)));
|
3804
3956
|
PinInputSeperator.displayName = "PinInputSeperator";
|
3805
|
-
var PinInput = ({
|
3806
|
-
separatorPosition = 0,
|
3807
|
-
...props
|
3808
|
-
}) => {
|
3957
|
+
var PinInput = ({ separatorPosition = 0, ...props }) => {
|
3809
3958
|
const maxLength = props.maxLength || 6;
|
3810
3959
|
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
3811
3960
|
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
3812
3961
|
const secondGroupLength = maxLength - firstGroupLength;
|
3813
|
-
return /* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React12.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
|
3814
|
-
PinInputSlot,
|
3815
|
-
{
|
3816
|
-
key: index,
|
3817
|
-
index,
|
3818
|
-
className: "hawa-w-full hawa-border"
|
3819
|
-
}
|
3820
|
-
))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React12.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
|
3962
|
+
return /* @__PURE__ */ React12.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2", dir: "ltr" }, /* @__PURE__ */ React12.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full hawa-border" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React12.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React12.createElement(PinInputGroup, { className: "hawa-w-full hawa-gap-2" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React12.createElement(
|
3821
3963
|
PinInputSlot,
|
3822
3964
|
{
|
3823
3965
|
key: index + firstGroupLength,
|
@@ -3828,10 +3970,7 @@ var PinInput = ({
|
|
3828
3970
|
};
|
3829
3971
|
|
3830
3972
|
// blocks/auth/CodeConfirmation.tsx
|
3831
|
-
var CodeConfirmation = ({
|
3832
|
-
codeLength = 6,
|
3833
|
-
...props
|
3834
|
-
}) => {
|
3973
|
+
var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
3835
3974
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
3836
3975
|
const formSchema = z5.object({
|
3837
3976
|
otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
|
@@ -3870,14 +4009,7 @@ var CodeConfirmation = ({
|
|
3870
4009
|
}
|
3871
4010
|
};
|
3872
4011
|
}, []);
|
3873
|
-
return /* @__PURE__ */ React13.createElement(Card, null, /* @__PURE__ */ React13.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React13.createElement(
|
3874
|
-
Alert,
|
3875
|
-
{
|
3876
|
-
title: props.errorTitle,
|
3877
|
-
text: props.errorText,
|
3878
|
-
severity: "error"
|
3879
|
-
}
|
3880
|
-
), /* @__PURE__ */ React13.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React13.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React13.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ React13.createElement(
|
4012
|
+
return /* @__PURE__ */ React13.createElement(Card, null, /* @__PURE__ */ React13.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React13.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ React13.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React13.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React13.createElement("span", null, props.identifier))), /* @__PURE__ */ React13.createElement(
|
3881
4013
|
"form",
|
3882
4014
|
{
|
3883
4015
|
noValidate: true,
|
@@ -3926,9 +4058,7 @@ var CodeConfirmation = ({
|
|
3926
4058
|
if (props.onCancel) {
|
3927
4059
|
return props.onCancel();
|
3928
4060
|
} else {
|
3929
|
-
console.log(
|
3930
|
-
"Cancel button clicked but onCancel prop is missing"
|
3931
|
-
);
|
4061
|
+
console.log("Cancel button clicked but onCancel prop is missing");
|
3932
4062
|
}
|
3933
4063
|
},
|
3934
4064
|
variant: "outline"
|