@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.js CHANGED
@@ -2294,7 +2294,7 @@ var Alert = ({
2294
2294
  oceanic: ""
2295
2295
  };
2296
2296
  let styleVariant = {
2297
- none: "hawa-text-gray-700 hawa-bg-gray-100 dark:hawa-bg-gray-900 ",
2297
+ none: "hawa-bg-background hawa-border",
2298
2298
  info: "hawa-text-info-foreground hawa-bg-info/90",
2299
2299
  warning: "hawa-text-warning-foreground hawa-bg-warning/90",
2300
2300
  error: "hawa-text-destructive-foreground hawa-bg-destructive/90",
@@ -9565,8 +9565,8 @@ var import_libphonenumber_js = require("libphonenumber-js");
9565
9565
  var z = __toESM(require("zod"));
9566
9566
  var LoginForm = ({
9567
9567
  loginType = "email",
9568
- texts,
9569
9568
  passwordLength = 8,
9569
+ texts,
9570
9570
  ...props
9571
9571
  }) => {
9572
9572
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
@@ -9797,70 +9797,80 @@ var LoginForm = ({
9797
9797
  break;
9798
9798
  }
9799
9799
  };
9800
- return /* @__PURE__ */ import_react47.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ import_react47.default.createElement(Card, { dir: props.direction }, /* @__PURE__ */ import_react47.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react47.default.createElement(
9801
- Alert,
9802
- {
9803
- direction: props.direction,
9804
- title: props.errorTitle,
9805
- text: props.errorText,
9806
- severity: "error"
9807
- }
9808
- ), /* @__PURE__ */ import_react47.default.createElement(
9809
- "form",
9800
+ return /* @__PURE__ */ import_react47.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ import_react47.default.createElement(
9801
+ Card,
9810
9802
  {
9811
- noValidate: true,
9812
- className: "hawa-flex hawa-flex-col hawa-gap-4",
9813
- onSubmit: handleSubmit((e) => {
9814
- if (props.onLogin) {
9815
- return props.onLogin(e);
9816
- } else {
9817
- console.log("Form is submitted but onLogin prop is missing");
9818
- }
9819
- })
9803
+ dir: props.direction,
9804
+ className: cn(
9805
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
9806
+ )
9820
9807
  },
9821
- renderFields(),
9822
- /* @__PURE__ */ import_react47.default.createElement(
9823
- Button,
9808
+ /* @__PURE__ */ import_react47.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react47.default.createElement(
9809
+ Alert,
9824
9810
  {
9825
- className: "hawa-mt-0 hawa-w-full",
9826
- type: "submit",
9827
- isLoading: props.isLoading,
9828
- disabled: props.isLoading
9811
+ direction: props.direction,
9812
+ title: props.errorTitle,
9813
+ text: props.errorText,
9814
+ severity: "error"
9815
+ }
9816
+ ), /* @__PURE__ */ import_react47.default.createElement(
9817
+ "form",
9818
+ {
9819
+ noValidate: true,
9820
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
9821
+ onSubmit: handleSubmit((e) => {
9822
+ if (props.onLogin) {
9823
+ return props.onLogin(e);
9824
+ } else {
9825
+ console.log("Form is submitted but onLogin prop is missing");
9826
+ }
9827
+ })
9829
9828
  },
9830
- (texts == null ? void 0 : texts.loginText) || "Login"
9831
- ),
9832
- props.additionalButtons,
9833
- props.allowRegister && /* @__PURE__ */ import_react47.default.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__ */ import_react47.default.createElement(
9834
- "span",
9829
+ renderFields(),
9830
+ /* @__PURE__ */ import_react47.default.createElement(
9831
+ Button,
9832
+ {
9833
+ className: "hawa-mt-0 hawa-w-full",
9834
+ type: "submit",
9835
+ isLoading: props.isLoading,
9836
+ disabled: props.isLoading
9837
+ },
9838
+ (texts == null ? void 0 : texts.loginText) || "Login"
9839
+ ),
9840
+ props.additionalButtons,
9841
+ props.allowRegister && /* @__PURE__ */ import_react47.default.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__ */ import_react47.default.createElement(
9842
+ "span",
9843
+ {
9844
+ onClick: props.onRouteToRegister,
9845
+ className: "clickable-link"
9846
+ },
9847
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
9848
+ ))
9849
+ )),
9850
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react47.default.createElement(
9851
+ CardFooter,
9835
9852
  {
9836
- onClick: props.onRouteToRegister,
9837
- className: "clickable-link"
9853
+ className: cn(
9854
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
9855
+ )
9838
9856
  },
9839
- (texts == null ? void 0 : texts.createAccount) || "Create Account"
9840
- ))
9841
- )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react47.default.createElement(
9842
- CardFooter,
9843
- {
9844
- className: cn(
9845
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
9857
+ /* @__PURE__ */ import_react47.default.createElement(
9858
+ AuthButtons,
9859
+ {
9860
+ texts: thirdPartyAuthTexts,
9861
+ viaGoogle: props.viaGoogle,
9862
+ viaGithub: props.viaGithub,
9863
+ viaTwitter: props.viaTwitter,
9864
+ isGoogleLoading: props.isGoogleLoading,
9865
+ isGithubLoading: props.isGithubLoading,
9866
+ isTwitterLoading: props.isTwitterLoading,
9867
+ handleGoogle: props.onGoogleLogin,
9868
+ handleGithub: props.onGithubLogin,
9869
+ handleTwitter: props.onTwitterLogin
9870
+ }
9846
9871
  )
9847
- },
9848
- /* @__PURE__ */ import_react47.default.createElement(
9849
- AuthButtons,
9850
- {
9851
- texts: thirdPartyAuthTexts,
9852
- viaGoogle: props.viaGoogle,
9853
- viaGithub: props.viaGithub,
9854
- viaTwitter: props.viaTwitter,
9855
- isGoogleLoading: props.isGoogleLoading,
9856
- isGithubLoading: props.isGithubLoading,
9857
- isTwitterLoading: props.isTwitterLoading,
9858
- handleGoogle: props.onGoogleLogin,
9859
- handleGithub: props.onGithubLogin,
9860
- handleTwitter: props.onTwitterLogin
9861
- }
9862
- )
9863
- ) : null));
9872
+ ) : null
9873
+ ));
9864
9874
  };
9865
9875
 
9866
9876
  // blocks/auth/RegisterForm.tsx
@@ -9949,292 +9959,303 @@ var RegisterForm = ({
9949
9959
  (_g = props.classNames) == null ? void 0 : _g.root
9950
9960
  )
9951
9961
  },
9952
- /* @__PURE__ */ import_react48.default.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ import_react48.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react48.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react48.default.createElement(
9953
- Alert,
9954
- {
9955
- direction: props.direction,
9956
- title: props.errorTitle,
9957
- text: props.errorText,
9958
- severity: "error",
9959
- onAlertClosed: () => {
9960
- if (props.onErrorDismissed) {
9961
- props.onErrorDismissed();
9962
- }
9963
- }
9964
- }
9965
- ), /* @__PURE__ */ import_react48.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react48.default.createElement(
9966
- "form",
9962
+ /* @__PURE__ */ import_react48.default.createElement(
9963
+ Card,
9967
9964
  {
9968
- noValidate: true,
9969
- onSubmit: handleSubmit((e) => {
9970
- if (props.onRegister) {
9971
- return props.onRegister(e);
9972
- } else {
9973
- console.log(
9974
- "Form is submitted but onRegister prop is missing"
9975
- );
9976
- }
9977
- }),
9978
- className: "hawa-flex hawa-flex-col hawa-gap-4"
9965
+ dir: props.direction,
9966
+ className: cn(
9967
+ (_h = props.classNames) == null ? void 0 : _h.card,
9968
+ props.cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
9969
+ )
9979
9970
  },
9980
- /* @__PURE__ */ import_react48.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
9981
- if (fld === "fullname") {
9982
- return /* @__PURE__ */ import_react48.default.createElement(
9983
- import_react_hook_form2.Controller,
9984
- {
9985
- key: i,
9986
- control,
9987
- name: "fullName",
9988
- render: ({ field }) => {
9989
- var _a2, _b2, _c2;
9990
- return /* @__PURE__ */ import_react48.default.createElement(
9991
- Input,
9992
- {
9993
- width: "full",
9994
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
9995
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
9996
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
9997
- ...field
9998
- }
9999
- );
10000
- }
10001
- }
10002
- );
10003
- }
10004
- if (fld === "email") {
10005
- return /* @__PURE__ */ import_react48.default.createElement(
10006
- import_react_hook_form2.Controller,
10007
- {
10008
- key: i,
10009
- control,
10010
- name: "email",
10011
- render: ({ field }) => {
10012
- var _a2, _b2, _c2;
10013
- return /* @__PURE__ */ import_react48.default.createElement(
10014
- Input,
10015
- {
10016
- dir: "ltr",
10017
- inputProps: {
10018
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
10019
- },
10020
- width: "full",
10021
- autoComplete: "email",
10022
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
10023
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
10024
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
10025
- ...field
10026
- }
10027
- );
10028
- }
10029
- }
10030
- );
10031
- }
10032
- if (fld === "username") {
10033
- return /* @__PURE__ */ import_react48.default.createElement(
10034
- import_react_hook_form2.Controller,
10035
- {
10036
- key: i,
10037
- control,
10038
- name: "username",
10039
- render: ({ field }) => {
10040
- var _a2, _b2, _c2, _d2;
10041
- return /* @__PURE__ */ import_react48.default.createElement(
10042
- Input,
10043
- {
10044
- width: "full",
10045
- autoComplete: "username",
10046
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
10047
- labelProps: {
10048
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
10049
- },
10050
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
10051
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
10052
- ...field
10053
- }
10054
- );
10055
- }
10056
- }
10057
- );
10058
- }
10059
- })),
10060
- /* @__PURE__ */ import_react48.default.createElement(
10061
- import_react_hook_form2.Controller,
9971
+ /* @__PURE__ */ import_react48.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react48.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react48.default.createElement(
9972
+ Alert,
10062
9973
  {
10063
- control,
10064
- name: "password",
10065
- render: ({ field }) => {
10066
- var _a2, _b2, _c2;
10067
- return /* @__PURE__ */ import_react48.default.createElement(
10068
- Input,
10069
- {
10070
- width: "full",
10071
- type: passwordVisible ? "text" : "password",
10072
- endIcon: /* @__PURE__ */ import_react48.default.createElement(
10073
- "div",
10074
- {
10075
- className: "hawa-cursor-pointer",
10076
- onClick: () => setPasswordVisible(!passwordVisible)
10077
- },
10078
- passwordVisible ? /* @__PURE__ */ import_react48.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react48.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
10079
- " "
10080
- ),
10081
- autoComplete: "new-password",
10082
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
10083
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
10084
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
10085
- ...field
10086
- }
10087
- );
9974
+ direction: props.direction,
9975
+ title: props.errorTitle,
9976
+ text: props.errorText,
9977
+ severity: "error",
9978
+ onAlertClosed: () => {
9979
+ if (props.onErrorDismissed) {
9980
+ props.onErrorDismissed();
9981
+ }
10088
9982
  }
10089
9983
  }
10090
- ),
10091
- /* @__PURE__ */ import_react48.default.createElement(
10092
- import_react_hook_form2.Controller,
9984
+ ), /* @__PURE__ */ import_react48.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react48.default.createElement(
9985
+ "form",
10093
9986
  {
10094
- control,
10095
- name: "confirm_password",
10096
- render: ({ field }) => {
10097
- var _a2, _b2, _c2;
9987
+ noValidate: true,
9988
+ onSubmit: handleSubmit((e) => {
9989
+ if (props.onRegister) {
9990
+ return props.onRegister(e);
9991
+ } else {
9992
+ console.log(
9993
+ "Form is submitted but onRegister prop is missing"
9994
+ );
9995
+ }
9996
+ }),
9997
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
9998
+ },
9999
+ /* @__PURE__ */ import_react48.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
10000
+ if (fld === "fullname") {
10098
10001
  return /* @__PURE__ */ import_react48.default.createElement(
10099
- Input,
10002
+ import_react_hook_form2.Controller,
10100
10003
  {
10101
- width: "full",
10102
- type: "password",
10103
- autoComplete: "new-password",
10104
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
10105
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
10106
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
10107
- ...field
10004
+ key: i,
10005
+ control,
10006
+ name: "fullName",
10007
+ render: ({ field }) => {
10008
+ var _a2, _b2, _c2;
10009
+ return /* @__PURE__ */ import_react48.default.createElement(
10010
+ Input,
10011
+ {
10012
+ width: "full",
10013
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
10014
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
10015
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
10016
+ ...field
10017
+ }
10018
+ );
10019
+ }
10108
10020
  }
10109
10021
  );
10110
10022
  }
10111
- }
10112
- ),
10113
- props.additionalInputs,
10114
- props.showRefCode && /* @__PURE__ */ import_react48.default.createElement(
10115
- import_react_hook_form2.Controller,
10116
- {
10117
- control,
10118
- name: "refCode",
10119
- render: ({ field }) => {
10120
- var _a2;
10023
+ if (fld === "email") {
10121
10024
  return /* @__PURE__ */ import_react48.default.createElement(
10122
- Input,
10025
+ import_react_hook_form2.Controller,
10123
10026
  {
10124
- width: "full",
10125
- label: texts == null ? void 0 : texts.refCode,
10126
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10127
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10128
- ...field
10027
+ key: i,
10028
+ control,
10029
+ name: "email",
10030
+ render: ({ field }) => {
10031
+ var _a2, _b2, _c2;
10032
+ return /* @__PURE__ */ import_react48.default.createElement(
10033
+ Input,
10034
+ {
10035
+ dir: "ltr",
10036
+ inputProps: {
10037
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
10038
+ },
10039
+ width: "full",
10040
+ autoComplete: "email",
10041
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
10042
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
10043
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
10044
+ ...field
10045
+ }
10046
+ );
10047
+ }
10129
10048
  }
10130
10049
  );
10131
10050
  }
10132
- }
10133
- ),
10134
- props.showUserSource && /* @__PURE__ */ import_react48.default.createElement(
10135
- import_react_hook_form2.Controller,
10136
- {
10137
- control,
10138
- name: "reference",
10139
- render: ({ field }) => {
10140
- var _a2, _b2;
10051
+ if (fld === "username") {
10141
10052
  return /* @__PURE__ */ import_react48.default.createElement(
10142
- Select,
10053
+ import_react_hook_form2.Controller,
10143
10054
  {
10144
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
10145
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
10146
- isCreatable: false,
10147
- isMulti: false,
10148
- isSearchable: false,
10149
- isClearable: false,
10150
- options: props.userReferenceOptions,
10151
- onChange: (e) => {
10152
- field.onChange(e.value);
10055
+ key: i,
10056
+ control,
10057
+ name: "username",
10058
+ render: ({ field }) => {
10059
+ var _a2, _b2, _c2, _d2;
10060
+ return /* @__PURE__ */ import_react48.default.createElement(
10061
+ Input,
10062
+ {
10063
+ width: "full",
10064
+ autoComplete: "username",
10065
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
10066
+ labelProps: {
10067
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
10068
+ },
10069
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
10070
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
10071
+ ...field
10072
+ }
10073
+ );
10153
10074
  }
10154
10075
  }
10155
10076
  );
10156
10077
  }
10157
- }
10158
- ),
10159
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react48.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react48.default.createElement(
10160
- import_react_hook_form2.Controller,
10161
- {
10162
- control,
10163
- name: "terms_accepted",
10164
- render: ({ field }) => {
10165
- var _a2, _b2;
10166
- return /* @__PURE__ */ import_react48.default.createElement(
10078
+ })),
10079
+ /* @__PURE__ */ import_react48.default.createElement(
10080
+ import_react_hook_form2.Controller,
10081
+ {
10082
+ control,
10083
+ name: "password",
10084
+ render: ({ field }) => {
10085
+ var _a2, _b2, _c2;
10086
+ return /* @__PURE__ */ import_react48.default.createElement(
10087
+ Input,
10088
+ {
10089
+ width: "full",
10090
+ type: passwordVisible ? "text" : "password",
10091
+ endIcon: /* @__PURE__ */ import_react48.default.createElement(
10092
+ "div",
10093
+ {
10094
+ className: "hawa-cursor-pointer",
10095
+ onClick: () => setPasswordVisible(!passwordVisible)
10096
+ },
10097
+ passwordVisible ? /* @__PURE__ */ import_react48.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react48.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
10098
+ " "
10099
+ ),
10100
+ autoComplete: "new-password",
10101
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
10102
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
10103
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
10104
+ ...field
10105
+ }
10106
+ );
10107
+ }
10108
+ }
10109
+ ),
10110
+ /* @__PURE__ */ import_react48.default.createElement(
10111
+ import_react_hook_form2.Controller,
10112
+ {
10113
+ control,
10114
+ name: "confirm_password",
10115
+ render: ({ field }) => {
10116
+ var _a2, _b2, _c2;
10117
+ return /* @__PURE__ */ import_react48.default.createElement(
10118
+ Input,
10119
+ {
10120
+ width: "full",
10121
+ type: "password",
10122
+ autoComplete: "new-password",
10123
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
10124
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
10125
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
10126
+ ...field
10127
+ }
10128
+ );
10129
+ }
10130
+ }
10131
+ ),
10132
+ props.additionalInputs,
10133
+ props.showRefCode && /* @__PURE__ */ import_react48.default.createElement(
10134
+ import_react_hook_form2.Controller,
10135
+ {
10136
+ control,
10137
+ name: "refCode",
10138
+ render: ({ field }) => {
10139
+ var _a2;
10140
+ return /* @__PURE__ */ import_react48.default.createElement(
10141
+ Input,
10142
+ {
10143
+ width: "full",
10144
+ label: texts == null ? void 0 : texts.refCode,
10145
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10146
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10147
+ ...field
10148
+ }
10149
+ );
10150
+ }
10151
+ }
10152
+ ),
10153
+ props.showUserSource && /* @__PURE__ */ import_react48.default.createElement(
10154
+ import_react_hook_form2.Controller,
10155
+ {
10156
+ control,
10157
+ name: "reference",
10158
+ render: ({ field }) => {
10159
+ var _a2, _b2;
10160
+ return /* @__PURE__ */ import_react48.default.createElement(
10161
+ Select,
10162
+ {
10163
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
10164
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
10165
+ isCreatable: false,
10166
+ isMulti: false,
10167
+ isSearchable: false,
10168
+ isClearable: false,
10169
+ options: props.userReferenceOptions,
10170
+ onChange: (e) => {
10171
+ field.onChange(e.value);
10172
+ }
10173
+ }
10174
+ );
10175
+ }
10176
+ }
10177
+ ),
10178
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react48.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react48.default.createElement(
10179
+ import_react_hook_form2.Controller,
10180
+ {
10181
+ control,
10182
+ name: "terms_accepted",
10183
+ render: ({ field }) => {
10184
+ var _a2, _b2;
10185
+ return /* @__PURE__ */ import_react48.default.createElement(
10186
+ Checkbox,
10187
+ {
10188
+ id: "terms_accepted",
10189
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10190
+ onCheckedChange: (e) => field.onChange(e),
10191
+ label: /* @__PURE__ */ import_react48.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_react48.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react48.default.createElement(
10192
+ "span",
10193
+ {
10194
+ onClick: (e) => {
10195
+ e.preventDefault();
10196
+ if (props.onRouteToTOS) {
10197
+ props.onRouteToTOS();
10198
+ }
10199
+ },
10200
+ className: "clickable-link"
10201
+ },
10202
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
10203
+ )))
10204
+ }
10205
+ );
10206
+ }
10207
+ }
10208
+ ), showNewsletterOption && /* @__PURE__ */ import_react48.default.createElement(
10209
+ import_react_hook_form2.Controller,
10210
+ {
10211
+ control,
10212
+ name: "newsletter_accepted",
10213
+ render: ({ field }) => /* @__PURE__ */ import_react48.default.createElement(
10167
10214
  Checkbox,
10168
10215
  {
10169
- id: "terms_accepted",
10170
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10171
- onCheckedChange: (e) => field.onChange(e),
10172
- label: /* @__PURE__ */ import_react48.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_react48.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react48.default.createElement(
10173
- "span",
10174
- {
10175
- onClick: (e) => {
10176
- e.preventDefault();
10177
- if (props.onRouteToTOS) {
10178
- props.onRouteToTOS();
10179
- }
10180
- },
10181
- className: "clickable-link"
10182
- },
10183
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
10184
- )))
10216
+ id: "newsletter_accepted",
10217
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
10218
+ onCheckedChange: field.onChange
10185
10219
  }
10186
- );
10220
+ )
10187
10221
  }
10188
- }
10189
- ), showNewsletterOption && /* @__PURE__ */ import_react48.default.createElement(
10190
- import_react_hook_form2.Controller,
10222
+ )) : null,
10223
+ /* @__PURE__ */ import_react48.default.createElement(
10224
+ Button,
10225
+ {
10226
+ className: " hawa-w-full",
10227
+ type: "submit",
10228
+ isLoading: props.isLoading,
10229
+ disabled: props.isLoading
10230
+ },
10231
+ (texts == null ? void 0 : texts.registerText) || "Register"
10232
+ ),
10233
+ props.additionalButtons
10234
+ )), /* @__PURE__ */ import_react48.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_react48.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react48.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))),
10235
+ props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react48.default.createElement(
10236
+ CardFooter,
10191
10237
  {
10192
- control,
10193
- name: "newsletter_accepted",
10194
- render: ({ field }) => /* @__PURE__ */ import_react48.default.createElement(
10195
- Checkbox,
10196
- {
10197
- id: "newsletter_accepted",
10198
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
10199
- onCheckedChange: field.onChange
10200
- }
10238
+ className: cn(
10239
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
10201
10240
  )
10202
- }
10203
- )) : null,
10204
- /* @__PURE__ */ import_react48.default.createElement(
10205
- Button,
10206
- {
10207
- className: " hawa-w-full",
10208
- type: "submit",
10209
- isLoading: props.isLoading,
10210
- disabled: props.isLoading
10211
10241
  },
10212
- (texts == null ? void 0 : texts.registerText) || "Register"
10213
- ),
10214
- props.additionalButtons
10215
- )), /* @__PURE__ */ import_react48.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_react48.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react48.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react48.default.createElement(
10216
- CardFooter,
10217
- {
10218
- className: cn(
10219
- props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
10242
+ /* @__PURE__ */ import_react48.default.createElement(
10243
+ AuthButtons,
10244
+ {
10245
+ texts: thirdPartyAuthTexts,
10246
+ viaGoogle: props.viaGoogle,
10247
+ viaGithub: props.viaGithub,
10248
+ viaTwitter: props.viaTwitter,
10249
+ isGoogleLoading: props.isGoogleLoading,
10250
+ isGithubLoading: props.isGithubLoading,
10251
+ isTwitterLoading: props.isTwitterLoading,
10252
+ handleGoogle: props.onGoogleRegister,
10253
+ handleGithub: props.onGithubRegister,
10254
+ handleTwitter: props.onTwitterRegister
10255
+ }
10220
10256
  )
10221
- },
10222
- /* @__PURE__ */ import_react48.default.createElement(
10223
- AuthButtons,
10224
- {
10225
- texts: thirdPartyAuthTexts,
10226
- viaGoogle: props.viaGoogle,
10227
- viaGithub: props.viaGithub,
10228
- viaTwitter: props.viaTwitter,
10229
- isGoogleLoading: props.isGoogleLoading,
10230
- isGithubLoading: props.isGithubLoading,
10231
- isTwitterLoading: props.isTwitterLoading,
10232
- handleGoogle: props.onGoogleRegister,
10233
- handleGithub: props.onGithubRegister,
10234
- handleTwitter: props.onTwitterRegister
10235
- }
10236
- )
10237
- ) : null)
10257
+ ) : null
10258
+ )
10238
10259
  );
10239
10260
  };
10240
10261