@sikka/hawa 0.30.5-next → 0.30.7-next

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2059,7 +2059,7 @@ var Alert = ({
2059
2059
  oceanic: ""
2060
2060
  };
2061
2061
  let styleVariant = {
2062
- none: "hawa-text-gray-700 hawa-bg-gray-100 dark:hawa-bg-gray-900 ",
2062
+ none: "hawa-bg-background hawa-border",
2063
2063
  info: "hawa-text-info-foreground hawa-bg-info/90",
2064
2064
  warning: "hawa-text-warning-foreground hawa-bg-warning/90",
2065
2065
  error: "hawa-text-destructive-foreground hawa-bg-destructive/90",
@@ -9345,8 +9345,8 @@ import { parsePhoneNumber } from "libphonenumber-js";
9345
9345
  import * as z from "zod";
9346
9346
  var LoginForm = ({
9347
9347
  loginType = "email",
9348
- texts,
9349
9348
  passwordLength = 8,
9349
+ texts,
9350
9350
  ...props
9351
9351
  }) => {
9352
9352
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
@@ -9577,70 +9577,80 @@ var LoginForm = ({
9577
9577
  break;
9578
9578
  }
9579
9579
  };
9580
- return /* @__PURE__ */ React74.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React74.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React74.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React74.createElement(
9581
- Alert,
9582
- {
9583
- direction: props.direction,
9584
- title: props.errorTitle,
9585
- text: props.errorText,
9586
- severity: "error"
9587
- }
9588
- ), /* @__PURE__ */ React74.createElement(
9589
- "form",
9580
+ return /* @__PURE__ */ React74.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React74.createElement(
9581
+ Card,
9590
9582
  {
9591
- noValidate: true,
9592
- className: "hawa-flex hawa-flex-col hawa-gap-4",
9593
- onSubmit: handleSubmit((e) => {
9594
- if (props.onLogin) {
9595
- return props.onLogin(e);
9596
- } else {
9597
- console.log("Form is submitted but onLogin prop is missing");
9598
- }
9599
- })
9583
+ dir: props.direction,
9584
+ className: cn(
9585
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
9586
+ )
9600
9587
  },
9601
- renderFields(),
9602
- /* @__PURE__ */ React74.createElement(
9603
- Button,
9588
+ /* @__PURE__ */ React74.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React74.createElement(
9589
+ Alert,
9604
9590
  {
9605
- className: "hawa-mt-0 hawa-w-full",
9606
- type: "submit",
9607
- isLoading: props.isLoading,
9608
- disabled: props.isLoading
9591
+ direction: props.direction,
9592
+ title: props.errorTitle,
9593
+ text: props.errorText,
9594
+ severity: "error"
9595
+ }
9596
+ ), /* @__PURE__ */ React74.createElement(
9597
+ "form",
9598
+ {
9599
+ noValidate: true,
9600
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
9601
+ onSubmit: handleSubmit((e) => {
9602
+ if (props.onLogin) {
9603
+ return props.onLogin(e);
9604
+ } else {
9605
+ console.log("Form is submitted but onLogin prop is missing");
9606
+ }
9607
+ })
9609
9608
  },
9610
- (texts == null ? void 0 : texts.loginText) || "Login"
9611
- ),
9612
- props.additionalButtons,
9613
- props.allowRegister && /* @__PURE__ */ React74.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__ */ React74.createElement(
9614
- "span",
9609
+ renderFields(),
9610
+ /* @__PURE__ */ React74.createElement(
9611
+ Button,
9612
+ {
9613
+ className: "hawa-mt-0 hawa-w-full",
9614
+ type: "submit",
9615
+ isLoading: props.isLoading,
9616
+ disabled: props.isLoading
9617
+ },
9618
+ (texts == null ? void 0 : texts.loginText) || "Login"
9619
+ ),
9620
+ props.additionalButtons,
9621
+ props.allowRegister && /* @__PURE__ */ React74.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__ */ React74.createElement(
9622
+ "span",
9623
+ {
9624
+ onClick: props.onRouteToRegister,
9625
+ className: "clickable-link"
9626
+ },
9627
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
9628
+ ))
9629
+ )),
9630
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React74.createElement(
9631
+ CardFooter,
9615
9632
  {
9616
- onClick: props.onRouteToRegister,
9617
- className: "clickable-link"
9633
+ className: cn(
9634
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
9635
+ )
9618
9636
  },
9619
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
9620
- ))
9621
- )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React74.createElement(
9622
- CardFooter,
9623
- {
9624
- className: cn(
9625
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
9637
+ /* @__PURE__ */ React74.createElement(
9638
+ AuthButtons,
9639
+ {
9640
+ texts: thirdPartyAuthTexts,
9641
+ viaGoogle: props.viaGoogle,
9642
+ viaGithub: props.viaGithub,
9643
+ viaTwitter: props.viaTwitter,
9644
+ isGoogleLoading: props.isGoogleLoading,
9645
+ isGithubLoading: props.isGithubLoading,
9646
+ isTwitterLoading: props.isTwitterLoading,
9647
+ handleGoogle: props.onGoogleLogin,
9648
+ handleGithub: props.onGithubLogin,
9649
+ handleTwitter: props.onTwitterLogin
9650
+ }
9626
9651
  )
9627
- },
9628
- /* @__PURE__ */ React74.createElement(
9629
- AuthButtons,
9630
- {
9631
- texts: thirdPartyAuthTexts,
9632
- viaGoogle: props.viaGoogle,
9633
- viaGithub: props.viaGithub,
9634
- viaTwitter: props.viaTwitter,
9635
- isGoogleLoading: props.isGoogleLoading,
9636
- isGithubLoading: props.isGithubLoading,
9637
- isTwitterLoading: props.isTwitterLoading,
9638
- handleGoogle: props.onGoogleLogin,
9639
- handleGithub: props.onGithubLogin,
9640
- handleTwitter: props.onTwitterLogin
9641
- }
9642
- )
9643
- ) : null));
9652
+ ) : null
9653
+ ));
9644
9654
  };
9645
9655
 
9646
9656
  // blocks/auth/RegisterForm.tsx
@@ -9729,292 +9739,303 @@ var RegisterForm = ({
9729
9739
  (_g = props.classNames) == null ? void 0 : _g.root
9730
9740
  )
9731
9741
  },
9732
- /* @__PURE__ */ React75.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ React75.createElement(CardContent, { headless: true }, /* @__PURE__ */ React75.createElement("div", null, props.showError && /* @__PURE__ */ React75.createElement(
9733
- Alert,
9734
- {
9735
- direction: props.direction,
9736
- title: props.errorTitle,
9737
- text: props.errorText,
9738
- severity: "error",
9739
- onAlertClosed: () => {
9740
- if (props.onErrorDismissed) {
9741
- props.onErrorDismissed();
9742
- }
9743
- }
9744
- }
9745
- ), /* @__PURE__ */ React75.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React75.createElement(
9746
- "form",
9742
+ /* @__PURE__ */ React75.createElement(
9743
+ Card,
9747
9744
  {
9748
- noValidate: true,
9749
- onSubmit: handleSubmit((e) => {
9750
- if (props.onRegister) {
9751
- return props.onRegister(e);
9752
- } else {
9753
- console.log(
9754
- "Form is submitted but onRegister prop is missing"
9755
- );
9756
- }
9757
- }),
9758
- className: "hawa-flex hawa-flex-col hawa-gap-4"
9745
+ dir: props.direction,
9746
+ className: cn(
9747
+ (_h = props.classNames) == null ? void 0 : _h.card,
9748
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
9749
+ )
9759
9750
  },
9760
- /* @__PURE__ */ React75.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
9761
- if (fld === "fullname") {
9762
- return /* @__PURE__ */ React75.createElement(
9763
- Controller2,
9764
- {
9765
- key: i,
9766
- control,
9767
- name: "fullName",
9768
- render: ({ field }) => {
9769
- var _a2, _b2, _c2;
9770
- return /* @__PURE__ */ React75.createElement(
9771
- Input,
9772
- {
9773
- width: "full",
9774
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
9775
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
9776
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
9777
- ...field
9778
- }
9779
- );
9780
- }
9781
- }
9782
- );
9783
- }
9784
- if (fld === "email") {
9785
- return /* @__PURE__ */ React75.createElement(
9786
- Controller2,
9787
- {
9788
- key: i,
9789
- control,
9790
- name: "email",
9791
- render: ({ field }) => {
9792
- var _a2, _b2, _c2;
9793
- return /* @__PURE__ */ React75.createElement(
9794
- Input,
9795
- {
9796
- dir: "ltr",
9797
- inputProps: {
9798
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
9799
- },
9800
- width: "full",
9801
- autoComplete: "email",
9802
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
9803
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
9804
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
9805
- ...field
9806
- }
9807
- );
9808
- }
9809
- }
9810
- );
9811
- }
9812
- if (fld === "username") {
9813
- return /* @__PURE__ */ React75.createElement(
9814
- Controller2,
9815
- {
9816
- key: i,
9817
- control,
9818
- name: "username",
9819
- render: ({ field }) => {
9820
- var _a2, _b2, _c2, _d2;
9821
- return /* @__PURE__ */ React75.createElement(
9822
- Input,
9823
- {
9824
- width: "full",
9825
- autoComplete: "username",
9826
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
9827
- labelProps: {
9828
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
9829
- },
9830
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
9831
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
9832
- ...field
9833
- }
9834
- );
9835
- }
9836
- }
9837
- );
9838
- }
9839
- })),
9840
- /* @__PURE__ */ React75.createElement(
9841
- Controller2,
9751
+ /* @__PURE__ */ React75.createElement(CardContent, { headless: true }, /* @__PURE__ */ React75.createElement("div", null, props.showError && /* @__PURE__ */ React75.createElement(
9752
+ Alert,
9842
9753
  {
9843
- control,
9844
- name: "password",
9845
- render: ({ field }) => {
9846
- var _a2, _b2, _c2;
9847
- return /* @__PURE__ */ React75.createElement(
9848
- Input,
9849
- {
9850
- width: "full",
9851
- type: passwordVisible ? "text" : "password",
9852
- endIcon: /* @__PURE__ */ React75.createElement(
9853
- "div",
9854
- {
9855
- className: "hawa-cursor-pointer",
9856
- onClick: () => setPasswordVisible(!passwordVisible)
9857
- },
9858
- passwordVisible ? /* @__PURE__ */ React75.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React75.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
9859
- " "
9860
- ),
9861
- autoComplete: "new-password",
9862
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
9863
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
9864
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
9865
- ...field
9866
- }
9867
- );
9754
+ direction: props.direction,
9755
+ title: props.errorTitle,
9756
+ text: props.errorText,
9757
+ severity: "error",
9758
+ onAlertClosed: () => {
9759
+ if (props.onErrorDismissed) {
9760
+ props.onErrorDismissed();
9761
+ }
9868
9762
  }
9869
9763
  }
9870
- ),
9871
- /* @__PURE__ */ React75.createElement(
9872
- Controller2,
9764
+ ), /* @__PURE__ */ React75.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React75.createElement(
9765
+ "form",
9873
9766
  {
9874
- control,
9875
- name: "confirm_password",
9876
- render: ({ field }) => {
9877
- var _a2, _b2, _c2;
9767
+ noValidate: true,
9768
+ onSubmit: handleSubmit((e) => {
9769
+ if (props.onRegister) {
9770
+ return props.onRegister(e);
9771
+ } else {
9772
+ console.log(
9773
+ "Form is submitted but onRegister prop is missing"
9774
+ );
9775
+ }
9776
+ }),
9777
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
9778
+ },
9779
+ /* @__PURE__ */ React75.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
9780
+ if (fld === "fullname") {
9878
9781
  return /* @__PURE__ */ React75.createElement(
9879
- Input,
9782
+ Controller2,
9880
9783
  {
9881
- width: "full",
9882
- type: "password",
9883
- autoComplete: "new-password",
9884
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
9885
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
9886
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
9887
- ...field
9784
+ key: i,
9785
+ control,
9786
+ name: "fullName",
9787
+ render: ({ field }) => {
9788
+ var _a2, _b2, _c2;
9789
+ return /* @__PURE__ */ React75.createElement(
9790
+ Input,
9791
+ {
9792
+ width: "full",
9793
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
9794
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
9795
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
9796
+ ...field
9797
+ }
9798
+ );
9799
+ }
9888
9800
  }
9889
9801
  );
9890
9802
  }
9891
- }
9892
- ),
9893
- props.additionalInputs,
9894
- props.showRefCode && /* @__PURE__ */ React75.createElement(
9895
- Controller2,
9896
- {
9897
- control,
9898
- name: "refCode",
9899
- render: ({ field }) => {
9900
- var _a2;
9803
+ if (fld === "email") {
9901
9804
  return /* @__PURE__ */ React75.createElement(
9902
- Input,
9805
+ Controller2,
9903
9806
  {
9904
- width: "full",
9905
- label: texts == null ? void 0 : texts.refCode,
9906
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
9907
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
9908
- ...field
9807
+ key: i,
9808
+ control,
9809
+ name: "email",
9810
+ render: ({ field }) => {
9811
+ var _a2, _b2, _c2;
9812
+ return /* @__PURE__ */ React75.createElement(
9813
+ Input,
9814
+ {
9815
+ dir: "ltr",
9816
+ inputProps: {
9817
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
9818
+ },
9819
+ width: "full",
9820
+ autoComplete: "email",
9821
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
9822
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
9823
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
9824
+ ...field
9825
+ }
9826
+ );
9827
+ }
9909
9828
  }
9910
9829
  );
9911
9830
  }
9912
- }
9913
- ),
9914
- props.showUserSource && /* @__PURE__ */ React75.createElement(
9915
- Controller2,
9916
- {
9917
- control,
9918
- name: "reference",
9919
- render: ({ field }) => {
9920
- var _a2, _b2;
9831
+ if (fld === "username") {
9921
9832
  return /* @__PURE__ */ React75.createElement(
9922
- Select,
9833
+ Controller2,
9923
9834
  {
9924
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
9925
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
9926
- isCreatable: false,
9927
- isMulti: false,
9928
- isSearchable: false,
9929
- isClearable: false,
9930
- options: props.userReferenceOptions,
9931
- onChange: (e) => {
9932
- field.onChange(e.value);
9835
+ key: i,
9836
+ control,
9837
+ name: "username",
9838
+ render: ({ field }) => {
9839
+ var _a2, _b2, _c2, _d2;
9840
+ return /* @__PURE__ */ React75.createElement(
9841
+ Input,
9842
+ {
9843
+ width: "full",
9844
+ autoComplete: "username",
9845
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
9846
+ labelProps: {
9847
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
9848
+ },
9849
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
9850
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
9851
+ ...field
9852
+ }
9853
+ );
9933
9854
  }
9934
9855
  }
9935
9856
  );
9936
9857
  }
9937
- }
9938
- ),
9939
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ React75.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React75.createElement(
9940
- Controller2,
9941
- {
9942
- control,
9943
- name: "terms_accepted",
9944
- render: ({ field }) => {
9945
- var _a2, _b2;
9946
- return /* @__PURE__ */ React75.createElement(
9858
+ })),
9859
+ /* @__PURE__ */ React75.createElement(
9860
+ Controller2,
9861
+ {
9862
+ control,
9863
+ name: "password",
9864
+ render: ({ field }) => {
9865
+ var _a2, _b2, _c2;
9866
+ return /* @__PURE__ */ React75.createElement(
9867
+ Input,
9868
+ {
9869
+ width: "full",
9870
+ type: passwordVisible ? "text" : "password",
9871
+ endIcon: /* @__PURE__ */ React75.createElement(
9872
+ "div",
9873
+ {
9874
+ className: "hawa-cursor-pointer",
9875
+ onClick: () => setPasswordVisible(!passwordVisible)
9876
+ },
9877
+ passwordVisible ? /* @__PURE__ */ React75.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React75.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
9878
+ " "
9879
+ ),
9880
+ autoComplete: "new-password",
9881
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
9882
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
9883
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
9884
+ ...field
9885
+ }
9886
+ );
9887
+ }
9888
+ }
9889
+ ),
9890
+ /* @__PURE__ */ React75.createElement(
9891
+ Controller2,
9892
+ {
9893
+ control,
9894
+ name: "confirm_password",
9895
+ render: ({ field }) => {
9896
+ var _a2, _b2, _c2;
9897
+ return /* @__PURE__ */ React75.createElement(
9898
+ Input,
9899
+ {
9900
+ width: "full",
9901
+ type: "password",
9902
+ autoComplete: "new-password",
9903
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
9904
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
9905
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
9906
+ ...field
9907
+ }
9908
+ );
9909
+ }
9910
+ }
9911
+ ),
9912
+ props.additionalInputs,
9913
+ props.showRefCode && /* @__PURE__ */ React75.createElement(
9914
+ Controller2,
9915
+ {
9916
+ control,
9917
+ name: "refCode",
9918
+ render: ({ field }) => {
9919
+ var _a2;
9920
+ return /* @__PURE__ */ React75.createElement(
9921
+ Input,
9922
+ {
9923
+ width: "full",
9924
+ label: texts == null ? void 0 : texts.refCode,
9925
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
9926
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
9927
+ ...field
9928
+ }
9929
+ );
9930
+ }
9931
+ }
9932
+ ),
9933
+ props.showUserSource && /* @__PURE__ */ React75.createElement(
9934
+ Controller2,
9935
+ {
9936
+ control,
9937
+ name: "reference",
9938
+ render: ({ field }) => {
9939
+ var _a2, _b2;
9940
+ return /* @__PURE__ */ React75.createElement(
9941
+ Select,
9942
+ {
9943
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
9944
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
9945
+ isCreatable: false,
9946
+ isMulti: false,
9947
+ isSearchable: false,
9948
+ isClearable: false,
9949
+ options: props.userReferenceOptions,
9950
+ onChange: (e) => {
9951
+ field.onChange(e.value);
9952
+ }
9953
+ }
9954
+ );
9955
+ }
9956
+ }
9957
+ ),
9958
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ React75.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React75.createElement(
9959
+ Controller2,
9960
+ {
9961
+ control,
9962
+ name: "terms_accepted",
9963
+ render: ({ field }) => {
9964
+ var _a2, _b2;
9965
+ return /* @__PURE__ */ React75.createElement(
9966
+ Checkbox,
9967
+ {
9968
+ id: "terms_accepted",
9969
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
9970
+ onCheckedChange: (e) => field.onChange(e),
9971
+ label: /* @__PURE__ */ React75.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__ */ React75.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React75.createElement(
9972
+ "span",
9973
+ {
9974
+ onClick: (e) => {
9975
+ e.preventDefault();
9976
+ if (props.onRouteToTOS) {
9977
+ props.onRouteToTOS();
9978
+ }
9979
+ },
9980
+ className: "clickable-link"
9981
+ },
9982
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
9983
+ )))
9984
+ }
9985
+ );
9986
+ }
9987
+ }
9988
+ ), showNewsletterOption && /* @__PURE__ */ React75.createElement(
9989
+ Controller2,
9990
+ {
9991
+ control,
9992
+ name: "newsletter_accepted",
9993
+ render: ({ field }) => /* @__PURE__ */ React75.createElement(
9947
9994
  Checkbox,
9948
9995
  {
9949
- id: "terms_accepted",
9950
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
9951
- onCheckedChange: (e) => field.onChange(e),
9952
- label: /* @__PURE__ */ React75.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__ */ React75.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React75.createElement(
9953
- "span",
9954
- {
9955
- onClick: (e) => {
9956
- e.preventDefault();
9957
- if (props.onRouteToTOS) {
9958
- props.onRouteToTOS();
9959
- }
9960
- },
9961
- className: "clickable-link"
9962
- },
9963
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
9964
- )))
9996
+ id: "newsletter_accepted",
9997
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
9998
+ onCheckedChange: field.onChange
9965
9999
  }
9966
- );
10000
+ )
9967
10001
  }
9968
- }
9969
- ), showNewsletterOption && /* @__PURE__ */ React75.createElement(
9970
- Controller2,
10002
+ )) : null,
10003
+ /* @__PURE__ */ React75.createElement(
10004
+ Button,
10005
+ {
10006
+ className: " hawa-w-full",
10007
+ type: "submit",
10008
+ isLoading: props.isLoading,
10009
+ disabled: props.isLoading
10010
+ },
10011
+ (texts == null ? void 0 : texts.registerText) || "Register"
10012
+ ),
10013
+ props.additionalButtons
10014
+ )), /* @__PURE__ */ React75.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__ */ React75.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React75.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
10015
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React75.createElement(
10016
+ CardFooter,
9971
10017
  {
9972
- control,
9973
- name: "newsletter_accepted",
9974
- render: ({ field }) => /* @__PURE__ */ React75.createElement(
9975
- Checkbox,
9976
- {
9977
- id: "newsletter_accepted",
9978
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
9979
- onCheckedChange: field.onChange
9980
- }
10018
+ className: cn(
10019
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
9981
10020
  )
9982
- }
9983
- )) : null,
9984
- /* @__PURE__ */ React75.createElement(
9985
- Button,
9986
- {
9987
- className: " hawa-w-full",
9988
- type: "submit",
9989
- isLoading: props.isLoading,
9990
- disabled: props.isLoading
9991
10021
  },
9992
- (texts == null ? void 0 : texts.registerText) || "Register"
9993
- ),
9994
- props.additionalButtons
9995
- )), /* @__PURE__ */ React75.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__ */ React75.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ React75.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React75.createElement(
9996
- CardFooter,
9997
- {
9998
- className: cn(
9999
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
10022
+ /* @__PURE__ */ React75.createElement(
10023
+ AuthButtons,
10024
+ {
10025
+ texts: thirdPartyAuthTexts,
10026
+ viaGoogle: props.viaGoogle,
10027
+ viaGithub: props.viaGithub,
10028
+ viaTwitter: props.viaTwitter,
10029
+ isGoogleLoading: props.isGoogleLoading,
10030
+ isGithubLoading: props.isGithubLoading,
10031
+ isTwitterLoading: props.isTwitterLoading,
10032
+ handleGoogle: props.onGoogleRegister,
10033
+ handleGithub: props.onGithubRegister,
10034
+ handleTwitter: props.onTwitterRegister
10035
+ }
10000
10036
  )
10001
- },
10002
- /* @__PURE__ */ React75.createElement(
10003
- AuthButtons,
10004
- {
10005
- texts: thirdPartyAuthTexts,
10006
- viaGoogle: props.viaGoogle,
10007
- viaGithub: props.viaGithub,
10008
- viaTwitter: props.viaTwitter,
10009
- isGoogleLoading: props.isGoogleLoading,
10010
- isGithubLoading: props.isGithubLoading,
10011
- isTwitterLoading: props.isTwitterLoading,
10012
- handleGoogle: props.onGoogleRegister,
10013
- handleGithub: props.onGithubRegister,
10014
- handleTwitter: props.onTwitterRegister
10015
- }
10016
- )
10017
- ) : null)
10037
+ ) : null
10038
+ )
10018
10039
  );
10019
10040
  };
10020
10041