@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/index.mjs
CHANGED
@@ -11238,385 +11238,398 @@ var RegisterForm = ({
|
|
11238
11238
|
headless: registerTypes ? registerTypes.length <= 1 : true,
|
11239
11239
|
noPadding: props.cardless
|
11240
11240
|
},
|
11241
|
-
/* @__PURE__ */ React83.createElement(
|
11242
|
-
|
11241
|
+
/* @__PURE__ */ React83.createElement(
|
11242
|
+
"div",
|
11243
11243
|
{
|
11244
|
-
|
11245
|
-
|
11246
|
-
|
11247
|
-
|
11248
|
-
|
11249
|
-
|
11250
|
-
|
11244
|
+
className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
|
11245
|
+
},
|
11246
|
+
props.showError && /* @__PURE__ */ React83.createElement(
|
11247
|
+
Alert,
|
11248
|
+
{
|
11249
|
+
direction: props.direction,
|
11250
|
+
title: props.errorTitle,
|
11251
|
+
text: props.errorText,
|
11252
|
+
severity: "error",
|
11253
|
+
onAlertClosed: () => {
|
11254
|
+
if (props.onErrorDismissed) {
|
11255
|
+
props.onErrorDismissed();
|
11256
|
+
}
|
11251
11257
|
}
|
11252
11258
|
}
|
11253
|
-
|
11254
|
-
|
11255
|
-
|
11256
|
-
{
|
11257
|
-
noValidate: true,
|
11258
|
-
onSubmit: handleSubmit((e) => {
|
11259
|
-
if (props.onRegister) {
|
11260
|
-
return props.onRegister(e);
|
11261
|
-
} else {
|
11262
|
-
console.log("Form is submitted but onRegister prop is missing");
|
11263
|
-
}
|
11264
|
-
}),
|
11265
|
-
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
11266
|
-
},
|
11267
|
-
/* @__PURE__ */ React83.createElement(
|
11268
|
-
Tabs2,
|
11259
|
+
),
|
11260
|
+
/* @__PURE__ */ React83.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React83.createElement(
|
11261
|
+
"form",
|
11269
11262
|
{
|
11270
|
-
|
11271
|
-
|
11272
|
-
|
11273
|
-
|
11274
|
-
|
11275
|
-
|
11263
|
+
noValidate: true,
|
11264
|
+
onSubmit: handleSubmit((e) => {
|
11265
|
+
if (props.onRegister) {
|
11266
|
+
return props.onRegister(e);
|
11267
|
+
} else {
|
11268
|
+
console.log("Form is submitted but onRegister prop is missing");
|
11276
11269
|
}
|
11277
|
-
)
|
11270
|
+
}),
|
11271
|
+
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
11278
11272
|
},
|
11279
|
-
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React83.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ React83.createElement(TabsList2, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React83.createElement(TabsTrigger2, { value: registerType.value }, registerType.label)))),
|
11280
11273
|
/* @__PURE__ */ React83.createElement(
|
11281
|
-
|
11274
|
+
Tabs2,
|
11282
11275
|
{
|
11283
|
-
|
11284
|
-
|
11285
|
-
|
11286
|
-
|
11287
|
-
|
11288
|
-
|
11289
|
-
|
11290
|
-
|
11291
|
-
|
11292
|
-
|
11293
|
-
Controller2,
|
11294
|
-
{
|
11295
|
-
key: i,
|
11296
|
-
control,
|
11297
|
-
name: "fullName",
|
11298
|
-
render: ({ field }) => {
|
11299
|
-
var _a2, _b2, _c2;
|
11300
|
-
return /* @__PURE__ */ React83.createElement(
|
11301
|
-
Input,
|
11302
|
-
{
|
11303
|
-
width: "full",
|
11304
|
-
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
11305
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
11306
|
-
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
11307
|
-
...field
|
11308
|
-
}
|
11309
|
-
);
|
11310
|
-
}
|
11311
|
-
}
|
11312
|
-
);
|
11313
|
-
}
|
11314
|
-
if (fld === "email") {
|
11315
|
-
return /* @__PURE__ */ React83.createElement(
|
11316
|
-
Controller2,
|
11317
|
-
{
|
11318
|
-
key: i,
|
11319
|
-
control,
|
11320
|
-
name: "email",
|
11321
|
-
render: ({ field }) => {
|
11322
|
-
var _a2, _b2, _c2;
|
11323
|
-
return /* @__PURE__ */ React83.createElement(
|
11324
|
-
Input,
|
11325
|
-
{
|
11326
|
-
dir: "ltr",
|
11327
|
-
inputProps: {
|
11328
|
-
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
11329
|
-
},
|
11330
|
-
width: "full",
|
11331
|
-
autoComplete: "email",
|
11332
|
-
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
11333
|
-
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
11334
|
-
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
11335
|
-
...field,
|
11336
|
-
onChange: (e) => {
|
11337
|
-
field.onChange(e.target.value.toLowerCase().trim());
|
11338
|
-
}
|
11339
|
-
}
|
11340
|
-
);
|
11341
|
-
}
|
11342
|
-
}
|
11343
|
-
);
|
11344
|
-
}
|
11345
|
-
if (fld === "username") {
|
11346
|
-
return /* @__PURE__ */ React83.createElement(
|
11347
|
-
Controller2,
|
11348
|
-
{
|
11349
|
-
key: i,
|
11350
|
-
control,
|
11351
|
-
name: "username",
|
11352
|
-
render: ({ field }) => {
|
11353
|
-
var _a2, _b2, _c2, _d2;
|
11354
|
-
return /* @__PURE__ */ React83.createElement(
|
11355
|
-
Input,
|
11356
|
-
{
|
11357
|
-
width: "full",
|
11358
|
-
autoComplete: "username",
|
11359
|
-
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
11360
|
-
labelProps: {
|
11361
|
-
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
11362
|
-
},
|
11363
|
-
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
11364
|
-
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
11365
|
-
...field
|
11366
|
-
}
|
11367
|
-
);
|
11368
|
-
}
|
11276
|
+
dir: props.direction,
|
11277
|
+
value: selectedRegisterType.value,
|
11278
|
+
onValueChange: (e) => {
|
11279
|
+
if (props.onRegisterTypeChange) {
|
11280
|
+
props.onRegisterTypeChange(e);
|
11281
|
+
}
|
11282
|
+
setSelectedRegisterType(
|
11283
|
+
(registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
|
11284
|
+
label: "Password",
|
11285
|
+
value: "password"
|
11369
11286
|
}
|
11370
11287
|
);
|
11371
11288
|
}
|
11372
|
-
}
|
11289
|
+
},
|
11290
|
+
registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React83.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ React83.createElement(TabsList2, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React83.createElement(TabsTrigger2, { value: registerType.value }, registerType.label)))),
|
11373
11291
|
/* @__PURE__ */ React83.createElement(
|
11374
|
-
|
11292
|
+
TabsContent,
|
11375
11293
|
{
|
11376
|
-
|
11377
|
-
|
11378
|
-
|
11379
|
-
|
11294
|
+
value: "password",
|
11295
|
+
className: cn(
|
11296
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
11297
|
+
selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
|
11298
|
+
),
|
11299
|
+
dir: props.direction
|
11300
|
+
},
|
11301
|
+
/* @__PURE__ */ React83.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
11302
|
+
if (fld === "fullname") {
|
11380
11303
|
return /* @__PURE__ */ React83.createElement(
|
11381
|
-
|
11304
|
+
Controller2,
|
11382
11305
|
{
|
11383
|
-
|
11384
|
-
|
11385
|
-
|
11386
|
-
|
11387
|
-
|
11388
|
-
|
11389
|
-
|
11390
|
-
|
11391
|
-
|
11392
|
-
|
11393
|
-
|
11394
|
-
|
11395
|
-
|
11396
|
-
|
11397
|
-
|
11398
|
-
|
11306
|
+
key: i,
|
11307
|
+
control,
|
11308
|
+
name: "fullName",
|
11309
|
+
render: ({ field }) => {
|
11310
|
+
var _a2, _b2, _c2;
|
11311
|
+
return /* @__PURE__ */ React83.createElement(
|
11312
|
+
Input,
|
11313
|
+
{
|
11314
|
+
width: "full",
|
11315
|
+
label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
|
11316
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
|
11317
|
+
helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
|
11318
|
+
...field
|
11319
|
+
}
|
11320
|
+
);
|
11321
|
+
}
|
11399
11322
|
}
|
11400
11323
|
);
|
11401
11324
|
}
|
11402
|
-
|
11403
|
-
),
|
11404
|
-
/* @__PURE__ */ React83.createElement(
|
11405
|
-
Controller2,
|
11406
|
-
{
|
11407
|
-
control,
|
11408
|
-
name: "confirm_password",
|
11409
|
-
render: ({ field }) => {
|
11410
|
-
var _a2, _b2, _c2;
|
11325
|
+
if (fld === "email") {
|
11411
11326
|
return /* @__PURE__ */ React83.createElement(
|
11412
|
-
|
11327
|
+
Controller2,
|
11413
11328
|
{
|
11414
|
-
|
11415
|
-
|
11416
|
-
|
11417
|
-
|
11418
|
-
|
11419
|
-
|
11420
|
-
|
11421
|
-
|
11422
|
-
|
11423
|
-
|
11424
|
-
|
11425
|
-
|
11426
|
-
|
11427
|
-
|
11428
|
-
|
11429
|
-
|
11329
|
+
key: i,
|
11330
|
+
control,
|
11331
|
+
name: "email",
|
11332
|
+
render: ({ field }) => {
|
11333
|
+
var _a2, _b2, _c2;
|
11334
|
+
return /* @__PURE__ */ React83.createElement(
|
11335
|
+
Input,
|
11336
|
+
{
|
11337
|
+
dir: "ltr",
|
11338
|
+
inputProps: {
|
11339
|
+
className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
|
11340
|
+
},
|
11341
|
+
width: "full",
|
11342
|
+
autoComplete: "email",
|
11343
|
+
label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
|
11344
|
+
helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
|
11345
|
+
placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
|
11346
|
+
...field,
|
11347
|
+
onChange: (e) => {
|
11348
|
+
field.onChange(e.target.value.toLowerCase().trim());
|
11349
|
+
}
|
11350
|
+
}
|
11351
|
+
);
|
11352
|
+
}
|
11430
11353
|
}
|
11431
11354
|
);
|
11432
11355
|
}
|
11433
|
-
|
11434
|
-
),
|
11435
|
-
props.additionalInputs,
|
11436
|
-
props.showRefCode && /* @__PURE__ */ React83.createElement(
|
11437
|
-
Controller2,
|
11438
|
-
{
|
11439
|
-
control,
|
11440
|
-
name: "refCode",
|
11441
|
-
render: ({ field }) => {
|
11442
|
-
var _a2;
|
11356
|
+
if (fld === "username") {
|
11443
11357
|
return /* @__PURE__ */ React83.createElement(
|
11444
|
-
|
11358
|
+
Controller2,
|
11445
11359
|
{
|
11446
|
-
|
11447
|
-
|
11448
|
-
|
11449
|
-
|
11450
|
-
|
11360
|
+
key: i,
|
11361
|
+
control,
|
11362
|
+
name: "username",
|
11363
|
+
render: ({ field }) => {
|
11364
|
+
var _a2, _b2, _c2, _d2;
|
11365
|
+
return /* @__PURE__ */ React83.createElement(
|
11366
|
+
Input,
|
11367
|
+
{
|
11368
|
+
width: "full",
|
11369
|
+
autoComplete: "username",
|
11370
|
+
label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
|
11371
|
+
labelProps: {
|
11372
|
+
...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
|
11373
|
+
},
|
11374
|
+
helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
|
11375
|
+
placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
|
11376
|
+
...field
|
11377
|
+
}
|
11378
|
+
);
|
11379
|
+
}
|
11451
11380
|
}
|
11452
11381
|
);
|
11453
11382
|
}
|
11454
|
-
}
|
11455
|
-
|
11456
|
-
|
11457
|
-
|
11458
|
-
|
11459
|
-
|
11460
|
-
|
11461
|
-
|
11462
|
-
|
11463
|
-
|
11464
|
-
|
11465
|
-
|
11466
|
-
|
11467
|
-
|
11468
|
-
|
11469
|
-
|
11470
|
-
|
11471
|
-
|
11472
|
-
|
11473
|
-
|
11474
|
-
|
11475
|
-
|
11383
|
+
})),
|
11384
|
+
/* @__PURE__ */ React83.createElement(
|
11385
|
+
Controller2,
|
11386
|
+
{
|
11387
|
+
control,
|
11388
|
+
name: "password",
|
11389
|
+
render: ({ field }) => {
|
11390
|
+
var _a2, _b2, _c2;
|
11391
|
+
return /* @__PURE__ */ React83.createElement(
|
11392
|
+
Input,
|
11393
|
+
{
|
11394
|
+
width: "full",
|
11395
|
+
type: passwordVisible ? "text" : "password",
|
11396
|
+
autoComplete: "new-password",
|
11397
|
+
label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
|
11398
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
|
11399
|
+
helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
|
11400
|
+
endIcon: /* @__PURE__ */ React83.createElement(
|
11401
|
+
"div",
|
11402
|
+
{
|
11403
|
+
className: "hawa-cursor-pointer",
|
11404
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
11405
|
+
},
|
11406
|
+
passwordVisible ? /* @__PURE__ */ React83.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React83.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
11407
|
+
" "
|
11408
|
+
),
|
11409
|
+
...field
|
11410
|
+
}
|
11411
|
+
);
|
11412
|
+
}
|
11476
11413
|
}
|
11477
|
-
}
|
11478
|
-
)
|
11479
|
-
),
|
11480
|
-
/* @__PURE__ */ React83.createElement(
|
11481
|
-
TabsContent,
|
11482
|
-
{
|
11483
|
-
value: "phone",
|
11484
|
-
className: cn(
|
11485
|
-
"hawa-flex hawa-flex-col hawa-gap-4",
|
11486
|
-
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
11487
11414
|
),
|
11488
|
-
|
11489
|
-
|
11415
|
+
/* @__PURE__ */ React83.createElement(
|
11416
|
+
Controller2,
|
11417
|
+
{
|
11418
|
+
control,
|
11419
|
+
name: "confirm_password",
|
11420
|
+
render: ({ field }) => {
|
11421
|
+
var _a2, _b2, _c2;
|
11422
|
+
return /* @__PURE__ */ React83.createElement(
|
11423
|
+
Input,
|
11424
|
+
{
|
11425
|
+
width: "full",
|
11426
|
+
type: passwordVisible ? "text" : "password",
|
11427
|
+
autoComplete: "new-password",
|
11428
|
+
label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
|
11429
|
+
placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
|
11430
|
+
helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
|
11431
|
+
endIcon: /* @__PURE__ */ React83.createElement(
|
11432
|
+
"div",
|
11433
|
+
{
|
11434
|
+
className: "hawa-cursor-pointer",
|
11435
|
+
onClick: () => setPasswordVisible(!passwordVisible)
|
11436
|
+
},
|
11437
|
+
passwordVisible ? /* @__PURE__ */ React83.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React83.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
|
11438
|
+
" "
|
11439
|
+
),
|
11440
|
+
...field
|
11441
|
+
}
|
11442
|
+
);
|
11443
|
+
}
|
11444
|
+
}
|
11445
|
+
),
|
11446
|
+
props.additionalInputs,
|
11447
|
+
props.showRefCode && /* @__PURE__ */ React83.createElement(
|
11448
|
+
Controller2,
|
11449
|
+
{
|
11450
|
+
control,
|
11451
|
+
name: "refCode",
|
11452
|
+
render: ({ field }) => {
|
11453
|
+
var _a2;
|
11454
|
+
return /* @__PURE__ */ React83.createElement(
|
11455
|
+
Input,
|
11456
|
+
{
|
11457
|
+
width: "full",
|
11458
|
+
label: texts == null ? void 0 : texts.refCode,
|
11459
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
11460
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
11461
|
+
...field
|
11462
|
+
}
|
11463
|
+
);
|
11464
|
+
}
|
11465
|
+
}
|
11466
|
+
),
|
11467
|
+
props.showUserSource && /* @__PURE__ */ React83.createElement(
|
11468
|
+
Controller2,
|
11469
|
+
{
|
11470
|
+
control,
|
11471
|
+
name: "reference",
|
11472
|
+
render: ({ field }) => {
|
11473
|
+
var _a2, _b2;
|
11474
|
+
return /* @__PURE__ */ React83.createElement(
|
11475
|
+
Select,
|
11476
|
+
{
|
11477
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
11478
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
11479
|
+
isCreatable: false,
|
11480
|
+
isMulti: false,
|
11481
|
+
isSearchable: false,
|
11482
|
+
isClearable: false,
|
11483
|
+
options: props.userReferenceOptions || [],
|
11484
|
+
onChange: (e) => field.onChange(e)
|
11485
|
+
}
|
11486
|
+
);
|
11487
|
+
}
|
11488
|
+
}
|
11489
|
+
)
|
11490
|
+
),
|
11490
11491
|
/* @__PURE__ */ React83.createElement(
|
11491
|
-
|
11492
|
+
TabsContent,
|
11492
11493
|
{
|
11493
|
-
|
11494
|
-
|
11495
|
-
|
11496
|
-
|
11497
|
-
|
11498
|
-
|
11499
|
-
|
11500
|
-
|
11501
|
-
|
11502
|
-
|
11503
|
-
|
11504
|
-
|
11505
|
-
|
11506
|
-
|
11507
|
-
|
11508
|
-
|
11509
|
-
|
11494
|
+
value: "phone",
|
11495
|
+
className: cn(
|
11496
|
+
"hawa-flex hawa-flex-col hawa-gap-4",
|
11497
|
+
selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
|
11498
|
+
),
|
11499
|
+
dir: props.direction
|
11500
|
+
},
|
11501
|
+
/* @__PURE__ */ React83.createElement(
|
11502
|
+
Controller2,
|
11503
|
+
{
|
11504
|
+
control,
|
11505
|
+
name: "phone",
|
11506
|
+
render: ({ field }) => {
|
11507
|
+
var _a2, _b2;
|
11508
|
+
return /* @__PURE__ */ React83.createElement(
|
11509
|
+
PhoneInput,
|
11510
|
+
{
|
11511
|
+
label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
|
11512
|
+
helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
|
11513
|
+
preferredCountry: { label: "+966" },
|
11514
|
+
...props.phoneInputProps,
|
11515
|
+
handleChange: (e) => {
|
11516
|
+
if (isValidPhoneNumber2(e) && isPossiblePhoneNumber2(e) && validatePhoneNumberLength2(e) === void 0) {
|
11517
|
+
let parsed = parsePhoneNumber2(e);
|
11518
|
+
field.onChange(parsed.number);
|
11519
|
+
} else {
|
11520
|
+
field.onChange(e);
|
11521
|
+
}
|
11510
11522
|
}
|
11511
11523
|
}
|
11512
|
-
|
11513
|
-
|
11524
|
+
);
|
11525
|
+
}
|
11514
11526
|
}
|
11515
|
-
|
11527
|
+
),
|
11528
|
+
props.additionalInputs,
|
11529
|
+
props.showRefCode && /* @__PURE__ */ React83.createElement(
|
11530
|
+
Controller2,
|
11531
|
+
{
|
11532
|
+
control,
|
11533
|
+
name: "refCode",
|
11534
|
+
render: ({ field }) => {
|
11535
|
+
var _a2;
|
11536
|
+
return /* @__PURE__ */ React83.createElement(
|
11537
|
+
Input,
|
11538
|
+
{
|
11539
|
+
width: "full",
|
11540
|
+
label: texts == null ? void 0 : texts.refCode,
|
11541
|
+
placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
|
11542
|
+
helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
|
11543
|
+
...field
|
11544
|
+
}
|
11545
|
+
);
|
11546
|
+
}
|
11547
|
+
}
|
11548
|
+
),
|
11549
|
+
props.showUserSource && /* @__PURE__ */ React83.createElement(
|
11550
|
+
Controller2,
|
11551
|
+
{
|
11552
|
+
control,
|
11553
|
+
name: "reference",
|
11554
|
+
render: ({ field }) => {
|
11555
|
+
var _a2, _b2;
|
11556
|
+
return /* @__PURE__ */ React83.createElement(
|
11557
|
+
Select,
|
11558
|
+
{
|
11559
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
11560
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
11561
|
+
isCreatable: false,
|
11562
|
+
isMulti: false,
|
11563
|
+
isSearchable: false,
|
11564
|
+
isClearable: false,
|
11565
|
+
options: props.userReferenceOptions || [],
|
11566
|
+
onChange: (e) => field.onChange(e)
|
11567
|
+
}
|
11568
|
+
);
|
11569
|
+
}
|
11570
|
+
}
|
11571
|
+
)
|
11516
11572
|
),
|
11517
|
-
|
11518
|
-
props.showRefCode && /* @__PURE__ */ React83.createElement(
|
11573
|
+
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React83.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React83.createElement(
|
11519
11574
|
Controller2,
|
11520
11575
|
{
|
11521
11576
|
control,
|
11522
|
-
name: "
|
11577
|
+
name: "terms_accepted",
|
11523
11578
|
render: ({ field }) => {
|
11524
|
-
var _a2;
|
11579
|
+
var _a2, _b2;
|
11525
11580
|
return /* @__PURE__ */ React83.createElement(
|
11526
|
-
|
11581
|
+
Checkbox,
|
11527
11582
|
{
|
11528
|
-
|
11529
|
-
|
11530
|
-
|
11531
|
-
|
11532
|
-
|
11583
|
+
id: "terms_accepted",
|
11584
|
+
helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
|
11585
|
+
onCheckedChange: (e) => field.onChange(e),
|
11586
|
+
label: /* @__PURE__ */ React83.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__ */ React83.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React83.createElement(
|
11587
|
+
"span",
|
11588
|
+
{
|
11589
|
+
onClick: (e) => {
|
11590
|
+
e.preventDefault();
|
11591
|
+
if (props.onRouteToTOS) {
|
11592
|
+
props.onRouteToTOS();
|
11593
|
+
}
|
11594
|
+
},
|
11595
|
+
className: "clickable-link"
|
11596
|
+
},
|
11597
|
+
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
11598
|
+
)))
|
11533
11599
|
}
|
11534
11600
|
);
|
11535
11601
|
}
|
11536
11602
|
}
|
11537
|
-
),
|
11538
|
-
props.showUserSource && /* @__PURE__ */ React83.createElement(
|
11603
|
+
), showNewsletterOption && /* @__PURE__ */ React83.createElement(
|
11539
11604
|
Controller2,
|
11540
11605
|
{
|
11541
11606
|
control,
|
11542
|
-
name: "
|
11543
|
-
render: ({ field }) =>
|
11544
|
-
var _a2, _b2;
|
11545
|
-
return /* @__PURE__ */ React83.createElement(
|
11546
|
-
Select,
|
11547
|
-
{
|
11548
|
-
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
11549
|
-
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
11550
|
-
isCreatable: false,
|
11551
|
-
isMulti: false,
|
11552
|
-
isSearchable: false,
|
11553
|
-
isClearable: false,
|
11554
|
-
options: props.userReferenceOptions || [],
|
11555
|
-
onChange: (e) => field.onChange(e)
|
11556
|
-
}
|
11557
|
-
);
|
11558
|
-
}
|
11559
|
-
}
|
11560
|
-
)
|
11561
|
-
),
|
11562
|
-
showTermsOption || showNewsletterOption ? /* @__PURE__ */ React83.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React83.createElement(
|
11563
|
-
Controller2,
|
11564
|
-
{
|
11565
|
-
control,
|
11566
|
-
name: "terms_accepted",
|
11567
|
-
render: ({ field }) => {
|
11568
|
-
var _a2, _b2;
|
11569
|
-
return /* @__PURE__ */ React83.createElement(
|
11607
|
+
name: "newsletter_accepted",
|
11608
|
+
render: ({ field }) => /* @__PURE__ */ React83.createElement(
|
11570
11609
|
Checkbox,
|
11571
11610
|
{
|
11572
|
-
id: "
|
11573
|
-
|
11574
|
-
onCheckedChange:
|
11575
|
-
label: /* @__PURE__ */ React83.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__ */ React83.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React83.createElement(
|
11576
|
-
"span",
|
11577
|
-
{
|
11578
|
-
onClick: (e) => {
|
11579
|
-
e.preventDefault();
|
11580
|
-
if (props.onRouteToTOS) {
|
11581
|
-
props.onRouteToTOS();
|
11582
|
-
}
|
11583
|
-
},
|
11584
|
-
className: "clickable-link"
|
11585
|
-
},
|
11586
|
-
(texts == null ? void 0 : texts.termsText) || "Terms of Service"
|
11587
|
-
)))
|
11611
|
+
id: "newsletter_accepted",
|
11612
|
+
label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
|
11613
|
+
onCheckedChange: field.onChange
|
11588
11614
|
}
|
11589
|
-
)
|
11615
|
+
)
|
11590
11616
|
}
|
11591
|
-
|
11592
|
-
),
|
11593
|
-
|
11617
|
+
)) : null
|
11618
|
+
),
|
11619
|
+
/* @__PURE__ */ React83.createElement(
|
11620
|
+
Button,
|
11594
11621
|
{
|
11595
|
-
|
11596
|
-
|
11597
|
-
|
11598
|
-
|
11599
|
-
|
11600
|
-
|
11601
|
-
|
11602
|
-
|
11603
|
-
|
11604
|
-
|
11605
|
-
|
11606
|
-
)) : null
|
11607
|
-
),
|
11608
|
-
/* @__PURE__ */ React83.createElement(
|
11609
|
-
Button,
|
11610
|
-
{
|
11611
|
-
className: "hawa-w-full",
|
11612
|
-
type: "submit",
|
11613
|
-
isLoading: props.isLoading,
|
11614
|
-
disabled: props.isLoading
|
11615
|
-
},
|
11616
|
-
(texts == null ? void 0 : texts.registerText) || "Register"
|
11617
|
-
),
|
11618
|
-
props.additionalButtons
|
11619
|
-
)), props.onRouteToLogin && /* @__PURE__ */ React83.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__ */ React83.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React83.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
|
11622
|
+
className: "hawa-w-full",
|
11623
|
+
type: "submit",
|
11624
|
+
isLoading: props.isLoading,
|
11625
|
+
disabled: props.isLoading
|
11626
|
+
},
|
11627
|
+
(texts == null ? void 0 : texts.registerText) || "Register"
|
11628
|
+
),
|
11629
|
+
props.additionalButtons
|
11630
|
+
)),
|
11631
|
+
props.onRouteToLogin && /* @__PURE__ */ React83.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__ */ React83.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React83.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login"))
|
11632
|
+
)
|
11620
11633
|
),
|
11621
11634
|
props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React83.createElement(
|
11622
11635
|
CardFooter,
|