@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.
@@ -3183,385 +3183,398 @@ var RegisterForm = ({
3183
3183
  headless: registerTypes ? registerTypes.length <= 1 : true,
3184
3184
  noPadding: props.cardless
3185
3185
  },
3186
- /* @__PURE__ */ React7.createElement("div", null, props.showError && /* @__PURE__ */ React7.createElement(
3187
- Alert,
3186
+ /* @__PURE__ */ React7.createElement(
3187
+ "div",
3188
3188
  {
3189
- direction: props.direction,
3190
- title: props.errorTitle,
3191
- text: props.errorText,
3192
- severity: "error",
3193
- onAlertClosed: () => {
3194
- if (props.onErrorDismissed) {
3195
- props.onErrorDismissed();
3189
+ className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
3190
+ },
3191
+ props.showError && /* @__PURE__ */ React7.createElement(
3192
+ Alert,
3193
+ {
3194
+ direction: props.direction,
3195
+ title: props.errorTitle,
3196
+ text: props.errorText,
3197
+ severity: "error",
3198
+ onAlertClosed: () => {
3199
+ if (props.onErrorDismissed) {
3200
+ props.onErrorDismissed();
3201
+ }
3196
3202
  }
3197
3203
  }
3198
- }
3199
- ), /* @__PURE__ */ React7.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React7.createElement(
3200
- "form",
3201
- {
3202
- noValidate: true,
3203
- onSubmit: handleSubmit((e) => {
3204
- if (props.onRegister) {
3205
- return props.onRegister(e);
3206
- } else {
3207
- console.log("Form is submitted but onRegister prop is missing");
3208
- }
3209
- }),
3210
- className: "hawa-flex hawa-flex-col hawa-gap-4"
3211
- },
3212
- /* @__PURE__ */ React7.createElement(
3213
- Tabs,
3204
+ ),
3205
+ /* @__PURE__ */ React7.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React7.createElement(
3206
+ "form",
3214
3207
  {
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"
3208
+ noValidate: true,
3209
+ onSubmit: handleSubmit((e) => {
3210
+ if (props.onRegister) {
3211
+ return props.onRegister(e);
3212
+ } else {
3213
+ console.log("Form is submitted but onRegister prop is missing");
3221
3214
  }
3222
- )
3215
+ }),
3216
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
3223
3217
  },
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
3218
  /* @__PURE__ */ React7.createElement(
3226
- TabsContent,
3219
+ Tabs,
3227
3220
  {
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
- }
3221
+ dir: props.direction,
3222
+ value: selectedRegisterType.value,
3223
+ onValueChange: (e) => {
3224
+ if (props.onRegisterTypeChange) {
3225
+ props.onRegisterTypeChange(e);
3226
+ }
3227
+ setSelectedRegisterType(
3228
+ (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
3229
+ label: "Password",
3230
+ value: "password"
3314
3231
  }
3315
3232
  );
3316
3233
  }
3317
- })),
3234
+ },
3235
+ registerTypes && registerTypes.length > 1 && /* @__PURE__ */ React7.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ React7.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ React7.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
3318
3236
  /* @__PURE__ */ React7.createElement(
3319
- Controller2,
3237
+ TabsContent,
3320
3238
  {
3321
- control,
3322
- name: "password",
3323
- render: ({ field }) => {
3324
- var _a2, _b2, _c2;
3239
+ value: "password",
3240
+ className: cn(
3241
+ "hawa-flex hawa-flex-col hawa-gap-4",
3242
+ selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
3243
+ ),
3244
+ dir: props.direction
3245
+ },
3246
+ /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
3247
+ if (fld === "fullname") {
3325
3248
  return /* @__PURE__ */ React7.createElement(
3326
- Input,
3249
+ Controller2,
3327
3250
  {
3328
- width: "full",
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
- ),
3343
- ...field
3251
+ key: i,
3252
+ control,
3253
+ name: "fullName",
3254
+ render: ({ field }) => {
3255
+ var _a2, _b2, _c2;
3256
+ return /* @__PURE__ */ React7.createElement(
3257
+ Input,
3258
+ {
3259
+ width: "full",
3260
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
3261
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
3262
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
3263
+ ...field
3264
+ }
3265
+ );
3266
+ }
3344
3267
  }
3345
3268
  );
3346
3269
  }
3347
- }
3348
- ),
3349
- /* @__PURE__ */ React7.createElement(
3350
- Controller2,
3351
- {
3352
- control,
3353
- name: "confirm_password",
3354
- render: ({ field }) => {
3355
- var _a2, _b2, _c2;
3270
+ if (fld === "email") {
3356
3271
  return /* @__PURE__ */ React7.createElement(
3357
- Input,
3272
+ Controller2,
3358
3273
  {
3359
- width: "full",
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
3274
+ key: i,
3275
+ control,
3276
+ name: "email",
3277
+ render: ({ field }) => {
3278
+ var _a2, _b2, _c2;
3279
+ return /* @__PURE__ */ React7.createElement(
3280
+ Input,
3281
+ {
3282
+ dir: "ltr",
3283
+ inputProps: {
3284
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
3285
+ },
3286
+ width: "full",
3287
+ autoComplete: "email",
3288
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
3289
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
3290
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
3291
+ ...field,
3292
+ onChange: (e) => {
3293
+ field.onChange(e.target.value.toLowerCase().trim());
3294
+ }
3295
+ }
3296
+ );
3297
+ }
3375
3298
  }
3376
3299
  );
3377
3300
  }
3378
- }
3379
- ),
3380
- props.additionalInputs,
3381
- props.showRefCode && /* @__PURE__ */ React7.createElement(
3382
- Controller2,
3383
- {
3384
- control,
3385
- name: "refCode",
3386
- render: ({ field }) => {
3387
- var _a2;
3301
+ if (fld === "username") {
3388
3302
  return /* @__PURE__ */ React7.createElement(
3389
- Input,
3303
+ Controller2,
3390
3304
  {
3391
- width: "full",
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,
3395
- ...field
3305
+ key: i,
3306
+ control,
3307
+ name: "username",
3308
+ render: ({ field }) => {
3309
+ var _a2, _b2, _c2, _d2;
3310
+ return /* @__PURE__ */ React7.createElement(
3311
+ Input,
3312
+ {
3313
+ width: "full",
3314
+ autoComplete: "username",
3315
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
3316
+ labelProps: {
3317
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
3318
+ },
3319
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
3320
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
3321
+ ...field
3322
+ }
3323
+ );
3324
+ }
3396
3325
  }
3397
3326
  );
3398
3327
  }
3399
- }
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,
3410
- {
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
- );
3328
+ })),
3329
+ /* @__PURE__ */ React7.createElement(
3330
+ Controller2,
3331
+ {
3332
+ control,
3333
+ name: "password",
3334
+ render: ({ field }) => {
3335
+ var _a2, _b2, _c2;
3336
+ return /* @__PURE__ */ React7.createElement(
3337
+ Input,
3338
+ {
3339
+ width: "full",
3340
+ type: passwordVisible ? "text" : "password",
3341
+ autoComplete: "new-password",
3342
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
3343
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
3344
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
3345
+ endIcon: /* @__PURE__ */ React7.createElement(
3346
+ "div",
3347
+ {
3348
+ className: "hawa-cursor-pointer",
3349
+ onClick: () => setPasswordVisible(!passwordVisible)
3350
+ },
3351
+ passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
3352
+ " "
3353
+ ),
3354
+ ...field
3355
+ }
3356
+ );
3357
+ }
3421
3358
  }
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
3359
  ),
3433
- dir: props.direction
3434
- },
3360
+ /* @__PURE__ */ React7.createElement(
3361
+ Controller2,
3362
+ {
3363
+ control,
3364
+ name: "confirm_password",
3365
+ render: ({ field }) => {
3366
+ var _a2, _b2, _c2;
3367
+ return /* @__PURE__ */ React7.createElement(
3368
+ Input,
3369
+ {
3370
+ width: "full",
3371
+ type: passwordVisible ? "text" : "password",
3372
+ autoComplete: "new-password",
3373
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
3374
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
3375
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
3376
+ endIcon: /* @__PURE__ */ React7.createElement(
3377
+ "div",
3378
+ {
3379
+ className: "hawa-cursor-pointer",
3380
+ onClick: () => setPasswordVisible(!passwordVisible)
3381
+ },
3382
+ passwordVisible ? /* @__PURE__ */ React7.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React7.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
3383
+ " "
3384
+ ),
3385
+ ...field
3386
+ }
3387
+ );
3388
+ }
3389
+ }
3390
+ ),
3391
+ props.additionalInputs,
3392
+ props.showRefCode && /* @__PURE__ */ React7.createElement(
3393
+ Controller2,
3394
+ {
3395
+ control,
3396
+ name: "refCode",
3397
+ render: ({ field }) => {
3398
+ var _a2;
3399
+ return /* @__PURE__ */ React7.createElement(
3400
+ Input,
3401
+ {
3402
+ width: "full",
3403
+ label: texts == null ? void 0 : texts.refCode,
3404
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
3405
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
3406
+ ...field
3407
+ }
3408
+ );
3409
+ }
3410
+ }
3411
+ ),
3412
+ props.showUserSource && /* @__PURE__ */ React7.createElement(
3413
+ Controller2,
3414
+ {
3415
+ control,
3416
+ name: "reference",
3417
+ render: ({ field }) => {
3418
+ var _a2, _b2;
3419
+ return /* @__PURE__ */ React7.createElement(
3420
+ Select,
3421
+ {
3422
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
3423
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
3424
+ isCreatable: false,
3425
+ isMulti: false,
3426
+ isSearchable: false,
3427
+ isClearable: false,
3428
+ options: props.userReferenceOptions || [],
3429
+ onChange: (e) => field.onChange(e)
3430
+ }
3431
+ );
3432
+ }
3433
+ }
3434
+ )
3435
+ ),
3435
3436
  /* @__PURE__ */ React7.createElement(
3436
- Controller2,
3437
+ TabsContent,
3437
3438
  {
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);
3439
+ value: "phone",
3440
+ className: cn(
3441
+ "hawa-flex hawa-flex-col hawa-gap-4",
3442
+ selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
3443
+ ),
3444
+ dir: props.direction
3445
+ },
3446
+ /* @__PURE__ */ React7.createElement(
3447
+ Controller2,
3448
+ {
3449
+ control,
3450
+ name: "phone",
3451
+ render: ({ field }) => {
3452
+ var _a2, _b2;
3453
+ return /* @__PURE__ */ React7.createElement(
3454
+ PhoneInput,
3455
+ {
3456
+ label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
3457
+ helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
3458
+ preferredCountry: { label: "+966" },
3459
+ ...props.phoneInputProps,
3460
+ handleChange: (e) => {
3461
+ if (isValidPhoneNumber2(e) && isPossiblePhoneNumber2(e) && validatePhoneNumberLength2(e) === void 0) {
3462
+ let parsed = parsePhoneNumber2(e);
3463
+ field.onChange(parsed.number);
3464
+ } else {
3465
+ field.onChange(e);
3466
+ }
3455
3467
  }
3456
3468
  }
3457
- }
3458
- );
3469
+ );
3470
+ }
3459
3471
  }
3460
- }
3472
+ ),
3473
+ props.additionalInputs,
3474
+ props.showRefCode && /* @__PURE__ */ React7.createElement(
3475
+ Controller2,
3476
+ {
3477
+ control,
3478
+ name: "refCode",
3479
+ render: ({ field }) => {
3480
+ var _a2;
3481
+ return /* @__PURE__ */ React7.createElement(
3482
+ Input,
3483
+ {
3484
+ width: "full",
3485
+ label: texts == null ? void 0 : texts.refCode,
3486
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
3487
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
3488
+ ...field
3489
+ }
3490
+ );
3491
+ }
3492
+ }
3493
+ ),
3494
+ props.showUserSource && /* @__PURE__ */ React7.createElement(
3495
+ Controller2,
3496
+ {
3497
+ control,
3498
+ name: "reference",
3499
+ render: ({ field }) => {
3500
+ var _a2, _b2;
3501
+ return /* @__PURE__ */ React7.createElement(
3502
+ Select,
3503
+ {
3504
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
3505
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
3506
+ isCreatable: false,
3507
+ isMulti: false,
3508
+ isSearchable: false,
3509
+ isClearable: false,
3510
+ options: props.userReferenceOptions || [],
3511
+ onChange: (e) => field.onChange(e)
3512
+ }
3513
+ );
3514
+ }
3515
+ }
3516
+ )
3461
3517
  ),
3462
- props.additionalInputs,
3463
- props.showRefCode && /* @__PURE__ */ React7.createElement(
3518
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ React7.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React7.createElement(
3464
3519
  Controller2,
3465
3520
  {
3466
3521
  control,
3467
- name: "refCode",
3522
+ name: "terms_accepted",
3468
3523
  render: ({ field }) => {
3469
- var _a2;
3524
+ var _a2, _b2;
3470
3525
  return /* @__PURE__ */ React7.createElement(
3471
- Input,
3526
+ Checkbox,
3472
3527
  {
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
3528
+ id: "terms_accepted",
3529
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
3530
+ onCheckedChange: (e) => field.onChange(e),
3531
+ 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(
3532
+ "span",
3533
+ {
3534
+ onClick: (e) => {
3535
+ e.preventDefault();
3536
+ if (props.onRouteToTOS) {
3537
+ props.onRouteToTOS();
3538
+ }
3539
+ },
3540
+ className: "clickable-link"
3541
+ },
3542
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
3543
+ )))
3478
3544
  }
3479
3545
  );
3480
3546
  }
3481
3547
  }
3482
- ),
3483
- props.showUserSource && /* @__PURE__ */ React7.createElement(
3548
+ ), showNewsletterOption && /* @__PURE__ */ React7.createElement(
3484
3549
  Controller2,
3485
3550
  {
3486
3551
  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
- );
3503
- }
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(
3552
+ name: "newsletter_accepted",
3553
+ render: ({ field }) => /* @__PURE__ */ React7.createElement(
3515
3554
  Checkbox,
3516
3555
  {
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
- )))
3556
+ id: "newsletter_accepted",
3557
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
3558
+ onCheckedChange: field.onChange
3533
3559
  }
3534
- );
3560
+ )
3535
3561
  }
3536
- }
3537
- ), showNewsletterOption && /* @__PURE__ */ React7.createElement(
3538
- Controller2,
3562
+ )) : null
3563
+ ),
3564
+ /* @__PURE__ */ React7.createElement(
3565
+ Button,
3539
3566
  {
3540
- control,
3541
- name: "newsletter_accepted",
3542
- render: ({ field }) => /* @__PURE__ */ React7.createElement(
3543
- Checkbox,
3544
- {
3545
- id: "newsletter_accepted",
3546
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
3547
- onCheckedChange: field.onChange
3548
- }
3549
- )
3550
- }
3551
- )) : null
3552
- ),
3553
- /* @__PURE__ */ React7.createElement(
3554
- Button,
3555
- {
3556
- className: "hawa-w-full",
3557
- type: "submit",
3558
- isLoading: props.isLoading,
3559
- disabled: props.isLoading
3560
- },
3561
- (texts == null ? void 0 : texts.registerText) || "Register"
3562
- ),
3563
- props.additionalButtons
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")))
3567
+ className: "hawa-w-full",
3568
+ type: "submit",
3569
+ isLoading: props.isLoading,
3570
+ disabled: props.isLoading
3571
+ },
3572
+ (texts == null ? void 0 : texts.registerText) || "Register"
3573
+ ),
3574
+ props.additionalButtons
3575
+ )),
3576
+ 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"))
3577
+ )
3565
3578
  ),
3566
3579
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React7.createElement(
3567
3580
  CardFooter,