@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/index.js CHANGED
@@ -11465,385 +11465,398 @@ var RegisterForm = ({
11465
11465
  headless: registerTypes ? registerTypes.length <= 1 : true,
11466
11466
  noPadding: props.cardless
11467
11467
  },
11468
- /* @__PURE__ */ import_react69.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react69.default.createElement(
11469
- Alert,
11468
+ /* @__PURE__ */ import_react69.default.createElement(
11469
+ "div",
11470
11470
  {
11471
- direction: props.direction,
11472
- title: props.errorTitle,
11473
- text: props.errorText,
11474
- severity: "error",
11475
- onAlertClosed: () => {
11476
- if (props.onErrorDismissed) {
11477
- props.onErrorDismissed();
11471
+ className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
11472
+ },
11473
+ props.showError && /* @__PURE__ */ import_react69.default.createElement(
11474
+ Alert,
11475
+ {
11476
+ direction: props.direction,
11477
+ title: props.errorTitle,
11478
+ text: props.errorText,
11479
+ severity: "error",
11480
+ onAlertClosed: () => {
11481
+ if (props.onErrorDismissed) {
11482
+ props.onErrorDismissed();
11483
+ }
11478
11484
  }
11479
11485
  }
11480
- }
11481
- ), /* @__PURE__ */ import_react69.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react69.default.createElement(
11482
- "form",
11483
- {
11484
- noValidate: true,
11485
- onSubmit: handleSubmit((e) => {
11486
- if (props.onRegister) {
11487
- return props.onRegister(e);
11488
- } else {
11489
- console.log("Form is submitted but onRegister prop is missing");
11490
- }
11491
- }),
11492
- className: "hawa-flex hawa-flex-col hawa-gap-4"
11493
- },
11494
- /* @__PURE__ */ import_react69.default.createElement(
11495
- Tabs2,
11486
+ ),
11487
+ /* @__PURE__ */ import_react69.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react69.default.createElement(
11488
+ "form",
11496
11489
  {
11497
- dir: props.direction,
11498
- value: selectedRegisterType.value,
11499
- onValueChange: (e) => setSelectedRegisterType(
11500
- (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
11501
- label: "Password",
11502
- value: "password"
11490
+ noValidate: true,
11491
+ onSubmit: handleSubmit((e) => {
11492
+ if (props.onRegister) {
11493
+ return props.onRegister(e);
11494
+ } else {
11495
+ console.log("Form is submitted but onRegister prop is missing");
11503
11496
  }
11504
- )
11497
+ }),
11498
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
11505
11499
  },
11506
- registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react69.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ import_react69.default.createElement(TabsList2, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react69.default.createElement(TabsTrigger2, { value: registerType.value }, registerType.label)))),
11507
11500
  /* @__PURE__ */ import_react69.default.createElement(
11508
- TabsContent,
11501
+ Tabs2,
11509
11502
  {
11510
- value: "password",
11511
- className: cn(
11512
- "hawa-flex hawa-flex-col hawa-gap-4",
11513
- selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
11514
- ),
11515
- dir: props.direction
11516
- },
11517
- /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
11518
- if (fld === "fullname") {
11519
- return /* @__PURE__ */ import_react69.default.createElement(
11520
- import_react_hook_form2.Controller,
11521
- {
11522
- key: i,
11523
- control,
11524
- name: "fullName",
11525
- render: ({ field }) => {
11526
- var _a2, _b2, _c2;
11527
- return /* @__PURE__ */ import_react69.default.createElement(
11528
- Input,
11529
- {
11530
- width: "full",
11531
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
11532
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
11533
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
11534
- ...field
11535
- }
11536
- );
11537
- }
11538
- }
11539
- );
11540
- }
11541
- if (fld === "email") {
11542
- return /* @__PURE__ */ import_react69.default.createElement(
11543
- import_react_hook_form2.Controller,
11544
- {
11545
- key: i,
11546
- control,
11547
- name: "email",
11548
- render: ({ field }) => {
11549
- var _a2, _b2, _c2;
11550
- return /* @__PURE__ */ import_react69.default.createElement(
11551
- Input,
11552
- {
11553
- dir: "ltr",
11554
- inputProps: {
11555
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
11556
- },
11557
- width: "full",
11558
- autoComplete: "email",
11559
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
11560
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
11561
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
11562
- ...field,
11563
- onChange: (e) => {
11564
- field.onChange(e.target.value.toLowerCase().trim());
11565
- }
11566
- }
11567
- );
11568
- }
11569
- }
11570
- );
11571
- }
11572
- if (fld === "username") {
11573
- return /* @__PURE__ */ import_react69.default.createElement(
11574
- import_react_hook_form2.Controller,
11575
- {
11576
- key: i,
11577
- control,
11578
- name: "username",
11579
- render: ({ field }) => {
11580
- var _a2, _b2, _c2, _d2;
11581
- return /* @__PURE__ */ import_react69.default.createElement(
11582
- Input,
11583
- {
11584
- width: "full",
11585
- autoComplete: "username",
11586
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
11587
- labelProps: {
11588
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
11589
- },
11590
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
11591
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
11592
- ...field
11593
- }
11594
- );
11595
- }
11503
+ dir: props.direction,
11504
+ value: selectedRegisterType.value,
11505
+ onValueChange: (e) => {
11506
+ if (props.onRegisterTypeChange) {
11507
+ props.onRegisterTypeChange(e);
11508
+ }
11509
+ setSelectedRegisterType(
11510
+ (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
11511
+ label: "Password",
11512
+ value: "password"
11596
11513
  }
11597
11514
  );
11598
11515
  }
11599
- })),
11516
+ },
11517
+ registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react69.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ import_react69.default.createElement(TabsList2, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react69.default.createElement(TabsTrigger2, { value: registerType.value }, registerType.label)))),
11600
11518
  /* @__PURE__ */ import_react69.default.createElement(
11601
- import_react_hook_form2.Controller,
11519
+ TabsContent,
11602
11520
  {
11603
- control,
11604
- name: "password",
11605
- render: ({ field }) => {
11606
- var _a2, _b2, _c2;
11521
+ value: "password",
11522
+ className: cn(
11523
+ "hawa-flex hawa-flex-col hawa-gap-4",
11524
+ selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
11525
+ ),
11526
+ dir: props.direction
11527
+ },
11528
+ /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
11529
+ if (fld === "fullname") {
11607
11530
  return /* @__PURE__ */ import_react69.default.createElement(
11608
- Input,
11531
+ import_react_hook_form2.Controller,
11609
11532
  {
11610
- width: "full",
11611
- type: passwordVisible ? "text" : "password",
11612
- autoComplete: "new-password",
11613
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
11614
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
11615
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
11616
- endIcon: /* @__PURE__ */ import_react69.default.createElement(
11617
- "div",
11618
- {
11619
- className: "hawa-cursor-pointer",
11620
- onClick: () => setPasswordVisible(!passwordVisible)
11621
- },
11622
- passwordVisible ? /* @__PURE__ */ import_react69.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react69.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
11623
- " "
11624
- ),
11625
- ...field
11533
+ key: i,
11534
+ control,
11535
+ name: "fullName",
11536
+ render: ({ field }) => {
11537
+ var _a2, _b2, _c2;
11538
+ return /* @__PURE__ */ import_react69.default.createElement(
11539
+ Input,
11540
+ {
11541
+ width: "full",
11542
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
11543
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
11544
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
11545
+ ...field
11546
+ }
11547
+ );
11548
+ }
11626
11549
  }
11627
11550
  );
11628
11551
  }
11629
- }
11630
- ),
11631
- /* @__PURE__ */ import_react69.default.createElement(
11632
- import_react_hook_form2.Controller,
11633
- {
11634
- control,
11635
- name: "confirm_password",
11636
- render: ({ field }) => {
11637
- var _a2, _b2, _c2;
11552
+ if (fld === "email") {
11638
11553
  return /* @__PURE__ */ import_react69.default.createElement(
11639
- Input,
11554
+ import_react_hook_form2.Controller,
11640
11555
  {
11641
- width: "full",
11642
- type: passwordVisible ? "text" : "password",
11643
- autoComplete: "new-password",
11644
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
11645
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
11646
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
11647
- endIcon: /* @__PURE__ */ import_react69.default.createElement(
11648
- "div",
11649
- {
11650
- className: "hawa-cursor-pointer",
11651
- onClick: () => setPasswordVisible(!passwordVisible)
11652
- },
11653
- passwordVisible ? /* @__PURE__ */ import_react69.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react69.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
11654
- " "
11655
- ),
11656
- ...field
11556
+ key: i,
11557
+ control,
11558
+ name: "email",
11559
+ render: ({ field }) => {
11560
+ var _a2, _b2, _c2;
11561
+ return /* @__PURE__ */ import_react69.default.createElement(
11562
+ Input,
11563
+ {
11564
+ dir: "ltr",
11565
+ inputProps: {
11566
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
11567
+ },
11568
+ width: "full",
11569
+ autoComplete: "email",
11570
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
11571
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
11572
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
11573
+ ...field,
11574
+ onChange: (e) => {
11575
+ field.onChange(e.target.value.toLowerCase().trim());
11576
+ }
11577
+ }
11578
+ );
11579
+ }
11657
11580
  }
11658
11581
  );
11659
11582
  }
11660
- }
11661
- ),
11662
- props.additionalInputs,
11663
- props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
11664
- import_react_hook_form2.Controller,
11665
- {
11666
- control,
11667
- name: "refCode",
11668
- render: ({ field }) => {
11669
- var _a2;
11583
+ if (fld === "username") {
11670
11584
  return /* @__PURE__ */ import_react69.default.createElement(
11671
- Input,
11585
+ import_react_hook_form2.Controller,
11672
11586
  {
11673
- width: "full",
11674
- label: texts == null ? void 0 : texts.refCode,
11675
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
11676
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
11677
- ...field
11587
+ key: i,
11588
+ control,
11589
+ name: "username",
11590
+ render: ({ field }) => {
11591
+ var _a2, _b2, _c2, _d2;
11592
+ return /* @__PURE__ */ import_react69.default.createElement(
11593
+ Input,
11594
+ {
11595
+ width: "full",
11596
+ autoComplete: "username",
11597
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
11598
+ labelProps: {
11599
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
11600
+ },
11601
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
11602
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
11603
+ ...field
11604
+ }
11605
+ );
11606
+ }
11678
11607
  }
11679
11608
  );
11680
11609
  }
11681
- }
11682
- ),
11683
- props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
11684
- import_react_hook_form2.Controller,
11685
- {
11686
- control,
11687
- name: "reference",
11688
- render: ({ field }) => {
11689
- var _a2, _b2;
11690
- return /* @__PURE__ */ import_react69.default.createElement(
11691
- Select,
11692
- {
11693
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
11694
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
11695
- isCreatable: false,
11696
- isMulti: false,
11697
- isSearchable: false,
11698
- isClearable: false,
11699
- options: props.userReferenceOptions || [],
11700
- onChange: (e) => field.onChange(e)
11701
- }
11702
- );
11610
+ })),
11611
+ /* @__PURE__ */ import_react69.default.createElement(
11612
+ import_react_hook_form2.Controller,
11613
+ {
11614
+ control,
11615
+ name: "password",
11616
+ render: ({ field }) => {
11617
+ var _a2, _b2, _c2;
11618
+ return /* @__PURE__ */ import_react69.default.createElement(
11619
+ Input,
11620
+ {
11621
+ width: "full",
11622
+ type: passwordVisible ? "text" : "password",
11623
+ autoComplete: "new-password",
11624
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
11625
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
11626
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
11627
+ endIcon: /* @__PURE__ */ import_react69.default.createElement(
11628
+ "div",
11629
+ {
11630
+ className: "hawa-cursor-pointer",
11631
+ onClick: () => setPasswordVisible(!passwordVisible)
11632
+ },
11633
+ passwordVisible ? /* @__PURE__ */ import_react69.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react69.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
11634
+ " "
11635
+ ),
11636
+ ...field
11637
+ }
11638
+ );
11639
+ }
11703
11640
  }
11704
- }
11705
- )
11706
- ),
11707
- /* @__PURE__ */ import_react69.default.createElement(
11708
- TabsContent,
11709
- {
11710
- value: "phone",
11711
- className: cn(
11712
- "hawa-flex hawa-flex-col hawa-gap-4",
11713
- selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
11714
11641
  ),
11715
- dir: props.direction
11716
- },
11642
+ /* @__PURE__ */ import_react69.default.createElement(
11643
+ import_react_hook_form2.Controller,
11644
+ {
11645
+ control,
11646
+ name: "confirm_password",
11647
+ render: ({ field }) => {
11648
+ var _a2, _b2, _c2;
11649
+ return /* @__PURE__ */ import_react69.default.createElement(
11650
+ Input,
11651
+ {
11652
+ width: "full",
11653
+ type: passwordVisible ? "text" : "password",
11654
+ autoComplete: "new-password",
11655
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
11656
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
11657
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
11658
+ endIcon: /* @__PURE__ */ import_react69.default.createElement(
11659
+ "div",
11660
+ {
11661
+ className: "hawa-cursor-pointer",
11662
+ onClick: () => setPasswordVisible(!passwordVisible)
11663
+ },
11664
+ passwordVisible ? /* @__PURE__ */ import_react69.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react69.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
11665
+ " "
11666
+ ),
11667
+ ...field
11668
+ }
11669
+ );
11670
+ }
11671
+ }
11672
+ ),
11673
+ props.additionalInputs,
11674
+ props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
11675
+ import_react_hook_form2.Controller,
11676
+ {
11677
+ control,
11678
+ name: "refCode",
11679
+ render: ({ field }) => {
11680
+ var _a2;
11681
+ return /* @__PURE__ */ import_react69.default.createElement(
11682
+ Input,
11683
+ {
11684
+ width: "full",
11685
+ label: texts == null ? void 0 : texts.refCode,
11686
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
11687
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
11688
+ ...field
11689
+ }
11690
+ );
11691
+ }
11692
+ }
11693
+ ),
11694
+ props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
11695
+ import_react_hook_form2.Controller,
11696
+ {
11697
+ control,
11698
+ name: "reference",
11699
+ render: ({ field }) => {
11700
+ var _a2, _b2;
11701
+ return /* @__PURE__ */ import_react69.default.createElement(
11702
+ Select,
11703
+ {
11704
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
11705
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
11706
+ isCreatable: false,
11707
+ isMulti: false,
11708
+ isSearchable: false,
11709
+ isClearable: false,
11710
+ options: props.userReferenceOptions || [],
11711
+ onChange: (e) => field.onChange(e)
11712
+ }
11713
+ );
11714
+ }
11715
+ }
11716
+ )
11717
+ ),
11717
11718
  /* @__PURE__ */ import_react69.default.createElement(
11718
- import_react_hook_form2.Controller,
11719
+ TabsContent,
11719
11720
  {
11720
- control,
11721
- name: "phone",
11722
- render: ({ field }) => {
11723
- var _a2, _b2;
11724
- return /* @__PURE__ */ import_react69.default.createElement(
11725
- PhoneInput,
11726
- {
11727
- label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
11728
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
11729
- preferredCountry: { label: "+966" },
11730
- ...props.phoneInputProps,
11731
- handleChange: (e) => {
11732
- if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
11733
- let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
11734
- field.onChange(parsed.number);
11735
- } else {
11736
- field.onChange(e);
11721
+ value: "phone",
11722
+ className: cn(
11723
+ "hawa-flex hawa-flex-col hawa-gap-4",
11724
+ selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
11725
+ ),
11726
+ dir: props.direction
11727
+ },
11728
+ /* @__PURE__ */ import_react69.default.createElement(
11729
+ import_react_hook_form2.Controller,
11730
+ {
11731
+ control,
11732
+ name: "phone",
11733
+ render: ({ field }) => {
11734
+ var _a2, _b2;
11735
+ return /* @__PURE__ */ import_react69.default.createElement(
11736
+ PhoneInput,
11737
+ {
11738
+ label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
11739
+ helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
11740
+ preferredCountry: { label: "+966" },
11741
+ ...props.phoneInputProps,
11742
+ handleChange: (e) => {
11743
+ if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
11744
+ let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
11745
+ field.onChange(parsed.number);
11746
+ } else {
11747
+ field.onChange(e);
11748
+ }
11737
11749
  }
11738
11750
  }
11739
- }
11740
- );
11751
+ );
11752
+ }
11741
11753
  }
11742
- }
11754
+ ),
11755
+ props.additionalInputs,
11756
+ props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
11757
+ import_react_hook_form2.Controller,
11758
+ {
11759
+ control,
11760
+ name: "refCode",
11761
+ render: ({ field }) => {
11762
+ var _a2;
11763
+ return /* @__PURE__ */ import_react69.default.createElement(
11764
+ Input,
11765
+ {
11766
+ width: "full",
11767
+ label: texts == null ? void 0 : texts.refCode,
11768
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
11769
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
11770
+ ...field
11771
+ }
11772
+ );
11773
+ }
11774
+ }
11775
+ ),
11776
+ props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
11777
+ import_react_hook_form2.Controller,
11778
+ {
11779
+ control,
11780
+ name: "reference",
11781
+ render: ({ field }) => {
11782
+ var _a2, _b2;
11783
+ return /* @__PURE__ */ import_react69.default.createElement(
11784
+ Select,
11785
+ {
11786
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
11787
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
11788
+ isCreatable: false,
11789
+ isMulti: false,
11790
+ isSearchable: false,
11791
+ isClearable: false,
11792
+ options: props.userReferenceOptions || [],
11793
+ onChange: (e) => field.onChange(e)
11794
+ }
11795
+ );
11796
+ }
11797
+ }
11798
+ )
11743
11799
  ),
11744
- props.additionalInputs,
11745
- props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
11800
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react69.default.createElement(
11746
11801
  import_react_hook_form2.Controller,
11747
11802
  {
11748
11803
  control,
11749
- name: "refCode",
11804
+ name: "terms_accepted",
11750
11805
  render: ({ field }) => {
11751
- var _a2;
11806
+ var _a2, _b2;
11752
11807
  return /* @__PURE__ */ import_react69.default.createElement(
11753
- Input,
11808
+ Checkbox,
11754
11809
  {
11755
- width: "full",
11756
- label: texts == null ? void 0 : texts.refCode,
11757
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
11758
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
11759
- ...field
11810
+ id: "terms_accepted",
11811
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
11812
+ onCheckedChange: (e) => field.onChange(e),
11813
+ label: /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react69.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react69.default.createElement(
11814
+ "span",
11815
+ {
11816
+ onClick: (e) => {
11817
+ e.preventDefault();
11818
+ if (props.onRouteToTOS) {
11819
+ props.onRouteToTOS();
11820
+ }
11821
+ },
11822
+ className: "clickable-link"
11823
+ },
11824
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
11825
+ )))
11760
11826
  }
11761
11827
  );
11762
11828
  }
11763
11829
  }
11764
- ),
11765
- props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
11830
+ ), showNewsletterOption && /* @__PURE__ */ import_react69.default.createElement(
11766
11831
  import_react_hook_form2.Controller,
11767
11832
  {
11768
11833
  control,
11769
- name: "reference",
11770
- render: ({ field }) => {
11771
- var _a2, _b2;
11772
- return /* @__PURE__ */ import_react69.default.createElement(
11773
- Select,
11774
- {
11775
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
11776
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
11777
- isCreatable: false,
11778
- isMulti: false,
11779
- isSearchable: false,
11780
- isClearable: false,
11781
- options: props.userReferenceOptions || [],
11782
- onChange: (e) => field.onChange(e)
11783
- }
11784
- );
11785
- }
11786
- }
11787
- )
11788
- ),
11789
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react69.default.createElement(
11790
- import_react_hook_form2.Controller,
11791
- {
11792
- control,
11793
- name: "terms_accepted",
11794
- render: ({ field }) => {
11795
- var _a2, _b2;
11796
- return /* @__PURE__ */ import_react69.default.createElement(
11834
+ name: "newsletter_accepted",
11835
+ render: ({ field }) => /* @__PURE__ */ import_react69.default.createElement(
11797
11836
  Checkbox,
11798
11837
  {
11799
- id: "terms_accepted",
11800
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
11801
- onCheckedChange: (e) => field.onChange(e),
11802
- label: /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5 hawa-whitespace-nowrap hawa-flex-wrap" }, (texts == null ? void 0 : texts.iAcceptText) || "I accept the", " ", /* @__PURE__ */ import_react69.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react69.default.createElement(
11803
- "span",
11804
- {
11805
- onClick: (e) => {
11806
- e.preventDefault();
11807
- if (props.onRouteToTOS) {
11808
- props.onRouteToTOS();
11809
- }
11810
- },
11811
- className: "clickable-link"
11812
- },
11813
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
11814
- )))
11838
+ id: "newsletter_accepted",
11839
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
11840
+ onCheckedChange: field.onChange
11815
11841
  }
11816
- );
11842
+ )
11817
11843
  }
11818
- }
11819
- ), showNewsletterOption && /* @__PURE__ */ import_react69.default.createElement(
11820
- import_react_hook_form2.Controller,
11844
+ )) : null
11845
+ ),
11846
+ /* @__PURE__ */ import_react69.default.createElement(
11847
+ Button,
11821
11848
  {
11822
- control,
11823
- name: "newsletter_accepted",
11824
- render: ({ field }) => /* @__PURE__ */ import_react69.default.createElement(
11825
- Checkbox,
11826
- {
11827
- id: "newsletter_accepted",
11828
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
11829
- onCheckedChange: field.onChange
11830
- }
11831
- )
11832
- }
11833
- )) : null
11834
- ),
11835
- /* @__PURE__ */ import_react69.default.createElement(
11836
- Button,
11837
- {
11838
- className: "hawa-w-full",
11839
- type: "submit",
11840
- isLoading: props.isLoading,
11841
- disabled: props.isLoading
11842
- },
11843
- (texts == null ? void 0 : texts.registerText) || "Register"
11844
- ),
11845
- props.additionalButtons
11846
- )), props.onRouteToLogin && /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react69.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react69.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
11849
+ className: "hawa-w-full",
11850
+ type: "submit",
11851
+ isLoading: props.isLoading,
11852
+ disabled: props.isLoading
11853
+ },
11854
+ (texts == null ? void 0 : texts.registerText) || "Register"
11855
+ ),
11856
+ props.additionalButtons
11857
+ )),
11858
+ props.onRouteToLogin && /* @__PURE__ */ import_react69.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ import_react69.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react69.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login"))
11859
+ )
11847
11860
  ),
11848
11861
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react69.default.createElement(
11849
11862
  CardFooter,