@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.
@@ -4853,385 +4853,398 @@ var RegisterForm = ({
4853
4853
  headless: registerTypes ? registerTypes.length <= 1 : true,
4854
4854
  noPadding: props.cardless
4855
4855
  },
4856
- /* @__PURE__ */ import_react37.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react37.default.createElement(
4857
- Alert,
4856
+ /* @__PURE__ */ import_react37.default.createElement(
4857
+ "div",
4858
4858
  {
4859
- direction: props.direction,
4860
- title: props.errorTitle,
4861
- text: props.errorText,
4862
- severity: "error",
4863
- onAlertClosed: () => {
4864
- if (props.onErrorDismissed) {
4865
- props.onErrorDismissed();
4859
+ className: cn(registerTypes && registerTypes.length > 1 ? "hawa-mt-6 hawa-mb-0" : "")
4860
+ },
4861
+ props.showError && /* @__PURE__ */ import_react37.default.createElement(
4862
+ Alert,
4863
+ {
4864
+ direction: props.direction,
4865
+ title: props.errorTitle,
4866
+ text: props.errorText,
4867
+ severity: "error",
4868
+ onAlertClosed: () => {
4869
+ if (props.onErrorDismissed) {
4870
+ props.onErrorDismissed();
4871
+ }
4866
4872
  }
4867
4873
  }
4868
- }
4869
- ), /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
4870
- "form",
4871
- {
4872
- noValidate: true,
4873
- onSubmit: handleSubmit((e) => {
4874
- if (props.onRegister) {
4875
- return props.onRegister(e);
4876
- } else {
4877
- console.log("Form is submitted but onRegister prop is missing");
4878
- }
4879
- }),
4880
- className: "hawa-flex hawa-flex-col hawa-gap-4"
4881
- },
4882
- /* @__PURE__ */ import_react37.default.createElement(
4883
- Tabs,
4874
+ ),
4875
+ /* @__PURE__ */ import_react37.default.createElement(import_react_hook_form2.FormProvider, { ...methods }, /* @__PURE__ */ import_react37.default.createElement(
4876
+ "form",
4884
4877
  {
4885
- dir: props.direction,
4886
- value: selectedRegisterType.value,
4887
- onValueChange: (e) => setSelectedRegisterType(
4888
- (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
4889
- label: "Password",
4890
- value: "password"
4878
+ noValidate: true,
4879
+ onSubmit: handleSubmit((e) => {
4880
+ if (props.onRegister) {
4881
+ return props.onRegister(e);
4882
+ } else {
4883
+ console.log("Form is submitted but onRegister prop is missing");
4891
4884
  }
4892
- )
4885
+ }),
4886
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
4893
4887
  },
4894
- registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-my-4 hawa-mt-6" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
4895
4888
  /* @__PURE__ */ import_react37.default.createElement(
4896
- TabsContent,
4889
+ Tabs,
4897
4890
  {
4898
- value: "password",
4899
- className: cn(
4900
- "hawa-flex hawa-flex-col hawa-gap-4",
4901
- selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
4902
- ),
4903
- dir: props.direction
4904
- },
4905
- /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4906
- if (fld === "fullname") {
4907
- return /* @__PURE__ */ import_react37.default.createElement(
4908
- import_react_hook_form2.Controller,
4909
- {
4910
- key: i,
4911
- control,
4912
- name: "fullName",
4913
- render: ({ field }) => {
4914
- var _a2, _b2, _c2;
4915
- return /* @__PURE__ */ import_react37.default.createElement(
4916
- Input,
4917
- {
4918
- width: "full",
4919
- label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4920
- placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4921
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4922
- ...field
4923
- }
4924
- );
4925
- }
4926
- }
4927
- );
4928
- }
4929
- if (fld === "email") {
4930
- return /* @__PURE__ */ import_react37.default.createElement(
4931
- import_react_hook_form2.Controller,
4932
- {
4933
- key: i,
4934
- control,
4935
- name: "email",
4936
- render: ({ field }) => {
4937
- var _a2, _b2, _c2;
4938
- return /* @__PURE__ */ import_react37.default.createElement(
4939
- Input,
4940
- {
4941
- dir: "ltr",
4942
- inputProps: {
4943
- className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4944
- },
4945
- width: "full",
4946
- autoComplete: "email",
4947
- label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4948
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4949
- placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4950
- ...field,
4951
- onChange: (e) => {
4952
- field.onChange(e.target.value.toLowerCase().trim());
4953
- }
4954
- }
4955
- );
4956
- }
4957
- }
4958
- );
4959
- }
4960
- if (fld === "username") {
4961
- return /* @__PURE__ */ import_react37.default.createElement(
4962
- import_react_hook_form2.Controller,
4963
- {
4964
- key: i,
4965
- control,
4966
- name: "username",
4967
- render: ({ field }) => {
4968
- var _a2, _b2, _c2, _d2;
4969
- return /* @__PURE__ */ import_react37.default.createElement(
4970
- Input,
4971
- {
4972
- width: "full",
4973
- autoComplete: "username",
4974
- label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4975
- labelProps: {
4976
- ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4977
- },
4978
- helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4979
- placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4980
- ...field
4981
- }
4982
- );
4983
- }
4891
+ dir: props.direction,
4892
+ value: selectedRegisterType.value,
4893
+ onValueChange: (e) => {
4894
+ if (props.onRegisterTypeChange) {
4895
+ props.onRegisterTypeChange(e);
4896
+ }
4897
+ setSelectedRegisterType(
4898
+ (registerTypes == null ? void 0 : registerTypes.find((r) => r.value === e)) || registerTypes && registerTypes[0] || {
4899
+ label: "Password",
4900
+ value: "password"
4984
4901
  }
4985
4902
  );
4986
4903
  }
4987
- })),
4904
+ },
4905
+ registerTypes && registerTypes.length > 1 && /* @__PURE__ */ import_react37.default.createElement(CardHeader, { className: "hawa-w-full hawa-px-0 hawa-py-0 hawa-mb-4" }, /* @__PURE__ */ import_react37.default.createElement(TabsList, { className: "hawa-w-full" }, registerTypes.map((registerType) => /* @__PURE__ */ import_react37.default.createElement(TabsTrigger, { value: registerType.value }, registerType.label)))),
4988
4906
  /* @__PURE__ */ import_react37.default.createElement(
4989
- import_react_hook_form2.Controller,
4907
+ TabsContent,
4990
4908
  {
4991
- control,
4992
- name: "password",
4993
- render: ({ field }) => {
4994
- var _a2, _b2, _c2;
4909
+ value: "password",
4910
+ className: cn(
4911
+ "hawa-flex hawa-flex-col hawa-gap-4",
4912
+ selectedRegisterType.value === "password" ? "hawa-block" : "hawa-hidden"
4913
+ ),
4914
+ dir: props.direction
4915
+ },
4916
+ /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
4917
+ if (fld === "fullname") {
4995
4918
  return /* @__PURE__ */ import_react37.default.createElement(
4996
- Input,
4919
+ import_react_hook_form2.Controller,
4997
4920
  {
4998
- width: "full",
4999
- type: passwordVisible ? "text" : "password",
5000
- autoComplete: "new-password",
5001
- label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
5002
- placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
5003
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
5004
- endIcon: /* @__PURE__ */ import_react37.default.createElement(
5005
- "div",
5006
- {
5007
- className: "hawa-cursor-pointer",
5008
- onClick: () => setPasswordVisible(!passwordVisible)
5009
- },
5010
- passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
5011
- " "
5012
- ),
5013
- ...field
4921
+ key: i,
4922
+ control,
4923
+ name: "fullName",
4924
+ render: ({ field }) => {
4925
+ var _a2, _b2, _c2;
4926
+ return /* @__PURE__ */ import_react37.default.createElement(
4927
+ Input,
4928
+ {
4929
+ width: "full",
4930
+ label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
4931
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
4932
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
4933
+ ...field
4934
+ }
4935
+ );
4936
+ }
5014
4937
  }
5015
4938
  );
5016
4939
  }
5017
- }
5018
- ),
5019
- /* @__PURE__ */ import_react37.default.createElement(
5020
- import_react_hook_form2.Controller,
5021
- {
5022
- control,
5023
- name: "confirm_password",
5024
- render: ({ field }) => {
5025
- var _a2, _b2, _c2;
4940
+ if (fld === "email") {
5026
4941
  return /* @__PURE__ */ import_react37.default.createElement(
5027
- Input,
4942
+ import_react_hook_form2.Controller,
5028
4943
  {
5029
- width: "full",
5030
- type: passwordVisible ? "text" : "password",
5031
- autoComplete: "new-password",
5032
- label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
5033
- placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
5034
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
5035
- endIcon: /* @__PURE__ */ import_react37.default.createElement(
5036
- "div",
5037
- {
5038
- className: "hawa-cursor-pointer",
5039
- onClick: () => setPasswordVisible(!passwordVisible)
5040
- },
5041
- passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
5042
- " "
5043
- ),
5044
- ...field
4944
+ key: i,
4945
+ control,
4946
+ name: "email",
4947
+ render: ({ field }) => {
4948
+ var _a2, _b2, _c2;
4949
+ return /* @__PURE__ */ import_react37.default.createElement(
4950
+ Input,
4951
+ {
4952
+ dir: "ltr",
4953
+ inputProps: {
4954
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
4955
+ },
4956
+ width: "full",
4957
+ autoComplete: "email",
4958
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
4959
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
4960
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
4961
+ ...field,
4962
+ onChange: (e) => {
4963
+ field.onChange(e.target.value.toLowerCase().trim());
4964
+ }
4965
+ }
4966
+ );
4967
+ }
5045
4968
  }
5046
4969
  );
5047
4970
  }
5048
- }
5049
- ),
5050
- props.additionalInputs,
5051
- props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
5052
- import_react_hook_form2.Controller,
5053
- {
5054
- control,
5055
- name: "refCode",
5056
- render: ({ field }) => {
5057
- var _a2;
4971
+ if (fld === "username") {
5058
4972
  return /* @__PURE__ */ import_react37.default.createElement(
5059
- Input,
4973
+ import_react_hook_form2.Controller,
5060
4974
  {
5061
- width: "full",
5062
- label: texts == null ? void 0 : texts.refCode,
5063
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
5064
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
5065
- ...field
4975
+ key: i,
4976
+ control,
4977
+ name: "username",
4978
+ render: ({ field }) => {
4979
+ var _a2, _b2, _c2, _d2;
4980
+ return /* @__PURE__ */ import_react37.default.createElement(
4981
+ Input,
4982
+ {
4983
+ width: "full",
4984
+ autoComplete: "username",
4985
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
4986
+ labelProps: {
4987
+ ...(_b2 = props.usernameOptions) == null ? void 0 : _b2.label
4988
+ },
4989
+ helperText: (_c2 = formState.errors.username) == null ? void 0 : _c2.message,
4990
+ placeholder: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.placeholder,
4991
+ ...field
4992
+ }
4993
+ );
4994
+ }
5066
4995
  }
5067
4996
  );
5068
4997
  }
5069
- }
5070
- ),
5071
- props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
5072
- import_react_hook_form2.Controller,
5073
- {
5074
- control,
5075
- name: "reference",
5076
- render: ({ field }) => {
5077
- var _a2, _b2;
5078
- return /* @__PURE__ */ import_react37.default.createElement(
5079
- Select,
5080
- {
5081
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
5082
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
5083
- isCreatable: false,
5084
- isMulti: false,
5085
- isSearchable: false,
5086
- isClearable: false,
5087
- options: props.userReferenceOptions || [],
5088
- onChange: (e) => field.onChange(e)
5089
- }
5090
- );
4998
+ })),
4999
+ /* @__PURE__ */ import_react37.default.createElement(
5000
+ import_react_hook_form2.Controller,
5001
+ {
5002
+ control,
5003
+ name: "password",
5004
+ render: ({ field }) => {
5005
+ var _a2, _b2, _c2;
5006
+ return /* @__PURE__ */ import_react37.default.createElement(
5007
+ Input,
5008
+ {
5009
+ width: "full",
5010
+ type: passwordVisible ? "text" : "password",
5011
+ autoComplete: "new-password",
5012
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
5013
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
5014
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
5015
+ endIcon: /* @__PURE__ */ import_react37.default.createElement(
5016
+ "div",
5017
+ {
5018
+ className: "hawa-cursor-pointer",
5019
+ onClick: () => setPasswordVisible(!passwordVisible)
5020
+ },
5021
+ passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
5022
+ " "
5023
+ ),
5024
+ ...field
5025
+ }
5026
+ );
5027
+ }
5091
5028
  }
5092
- }
5093
- )
5094
- ),
5095
- /* @__PURE__ */ import_react37.default.createElement(
5096
- TabsContent,
5097
- {
5098
- value: "phone",
5099
- className: cn(
5100
- "hawa-flex hawa-flex-col hawa-gap-4",
5101
- selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
5102
5029
  ),
5103
- dir: props.direction
5104
- },
5030
+ /* @__PURE__ */ import_react37.default.createElement(
5031
+ import_react_hook_form2.Controller,
5032
+ {
5033
+ control,
5034
+ name: "confirm_password",
5035
+ render: ({ field }) => {
5036
+ var _a2, _b2, _c2;
5037
+ return /* @__PURE__ */ import_react37.default.createElement(
5038
+ Input,
5039
+ {
5040
+ width: "full",
5041
+ type: passwordVisible ? "text" : "password",
5042
+ autoComplete: "new-password",
5043
+ label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
5044
+ placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
5045
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
5046
+ endIcon: /* @__PURE__ */ import_react37.default.createElement(
5047
+ "div",
5048
+ {
5049
+ className: "hawa-cursor-pointer",
5050
+ onClick: () => setPasswordVisible(!passwordVisible)
5051
+ },
5052
+ passwordVisible ? /* @__PURE__ */ import_react37.default.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ import_react37.default.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
5053
+ " "
5054
+ ),
5055
+ ...field
5056
+ }
5057
+ );
5058
+ }
5059
+ }
5060
+ ),
5061
+ props.additionalInputs,
5062
+ props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
5063
+ import_react_hook_form2.Controller,
5064
+ {
5065
+ control,
5066
+ name: "refCode",
5067
+ render: ({ field }) => {
5068
+ var _a2;
5069
+ return /* @__PURE__ */ import_react37.default.createElement(
5070
+ Input,
5071
+ {
5072
+ width: "full",
5073
+ label: texts == null ? void 0 : texts.refCode,
5074
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
5075
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
5076
+ ...field
5077
+ }
5078
+ );
5079
+ }
5080
+ }
5081
+ ),
5082
+ props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
5083
+ import_react_hook_form2.Controller,
5084
+ {
5085
+ control,
5086
+ name: "reference",
5087
+ render: ({ field }) => {
5088
+ var _a2, _b2;
5089
+ return /* @__PURE__ */ import_react37.default.createElement(
5090
+ Select,
5091
+ {
5092
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
5093
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
5094
+ isCreatable: false,
5095
+ isMulti: false,
5096
+ isSearchable: false,
5097
+ isClearable: false,
5098
+ options: props.userReferenceOptions || [],
5099
+ onChange: (e) => field.onChange(e)
5100
+ }
5101
+ );
5102
+ }
5103
+ }
5104
+ )
5105
+ ),
5105
5106
  /* @__PURE__ */ import_react37.default.createElement(
5106
- import_react_hook_form2.Controller,
5107
+ TabsContent,
5107
5108
  {
5108
- control,
5109
- name: "phone",
5110
- render: ({ field }) => {
5111
- var _a2, _b2;
5112
- return /* @__PURE__ */ import_react37.default.createElement(
5113
- PhoneInput,
5114
- {
5115
- label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
5116
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
5117
- preferredCountry: { label: "+966" },
5118
- ...props.phoneInputProps,
5119
- handleChange: (e) => {
5120
- if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
5121
- let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
5122
- field.onChange(parsed.number);
5123
- } else {
5124
- field.onChange(e);
5109
+ value: "phone",
5110
+ className: cn(
5111
+ "hawa-flex hawa-flex-col hawa-gap-4",
5112
+ selectedRegisterType.value === "phone" ? "hawa-block" : "hawa-hidden"
5113
+ ),
5114
+ dir: props.direction
5115
+ },
5116
+ /* @__PURE__ */ import_react37.default.createElement(
5117
+ import_react_hook_form2.Controller,
5118
+ {
5119
+ control,
5120
+ name: "phone",
5121
+ render: ({ field }) => {
5122
+ var _a2, _b2;
5123
+ return /* @__PURE__ */ import_react37.default.createElement(
5124
+ PhoneInput,
5125
+ {
5126
+ label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
5127
+ helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
5128
+ preferredCountry: { label: "+966" },
5129
+ ...props.phoneInputProps,
5130
+ handleChange: (e) => {
5131
+ if ((0, import_libphonenumber_js2.isValidPhoneNumber)(e) && (0, import_libphonenumber_js2.isPossiblePhoneNumber)(e) && (0, import_libphonenumber_js2.validatePhoneNumberLength)(e) === void 0) {
5132
+ let parsed = (0, import_libphonenumber_js2.parsePhoneNumber)(e);
5133
+ field.onChange(parsed.number);
5134
+ } else {
5135
+ field.onChange(e);
5136
+ }
5125
5137
  }
5126
5138
  }
5127
- }
5128
- );
5139
+ );
5140
+ }
5129
5141
  }
5130
- }
5142
+ ),
5143
+ props.additionalInputs,
5144
+ props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
5145
+ import_react_hook_form2.Controller,
5146
+ {
5147
+ control,
5148
+ name: "refCode",
5149
+ render: ({ field }) => {
5150
+ var _a2;
5151
+ return /* @__PURE__ */ import_react37.default.createElement(
5152
+ Input,
5153
+ {
5154
+ width: "full",
5155
+ label: texts == null ? void 0 : texts.refCode,
5156
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
5157
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
5158
+ ...field
5159
+ }
5160
+ );
5161
+ }
5162
+ }
5163
+ ),
5164
+ props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
5165
+ import_react_hook_form2.Controller,
5166
+ {
5167
+ control,
5168
+ name: "reference",
5169
+ render: ({ field }) => {
5170
+ var _a2, _b2;
5171
+ return /* @__PURE__ */ import_react37.default.createElement(
5172
+ Select,
5173
+ {
5174
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
5175
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
5176
+ isCreatable: false,
5177
+ isMulti: false,
5178
+ isSearchable: false,
5179
+ isClearable: false,
5180
+ options: props.userReferenceOptions || [],
5181
+ onChange: (e) => field.onChange(e)
5182
+ }
5183
+ );
5184
+ }
5185
+ }
5186
+ )
5131
5187
  ),
5132
- props.additionalInputs,
5133
- props.showRefCode && /* @__PURE__ */ import_react37.default.createElement(
5188
+ showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
5134
5189
  import_react_hook_form2.Controller,
5135
5190
  {
5136
5191
  control,
5137
- name: "refCode",
5192
+ name: "terms_accepted",
5138
5193
  render: ({ field }) => {
5139
- var _a2;
5194
+ var _a2, _b2;
5140
5195
  return /* @__PURE__ */ import_react37.default.createElement(
5141
- Input,
5196
+ Checkbox,
5142
5197
  {
5143
- width: "full",
5144
- label: texts == null ? void 0 : texts.refCode,
5145
- placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
5146
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
5147
- ...field
5198
+ id: "terms_accepted",
5199
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
5200
+ onCheckedChange: (e) => field.onChange(e),
5201
+ label: /* @__PURE__ */ import_react37.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_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
5202
+ "span",
5203
+ {
5204
+ onClick: (e) => {
5205
+ e.preventDefault();
5206
+ if (props.onRouteToTOS) {
5207
+ props.onRouteToTOS();
5208
+ }
5209
+ },
5210
+ className: "clickable-link"
5211
+ },
5212
+ (texts == null ? void 0 : texts.termsText) || "Terms of Service"
5213
+ )))
5148
5214
  }
5149
5215
  );
5150
5216
  }
5151
5217
  }
5152
- ),
5153
- props.showUserSource && /* @__PURE__ */ import_react37.default.createElement(
5218
+ ), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
5154
5219
  import_react_hook_form2.Controller,
5155
5220
  {
5156
5221
  control,
5157
- name: "reference",
5158
- render: ({ field }) => {
5159
- var _a2, _b2;
5160
- return /* @__PURE__ */ import_react37.default.createElement(
5161
- Select,
5162
- {
5163
- label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
5164
- placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
5165
- isCreatable: false,
5166
- isMulti: false,
5167
- isSearchable: false,
5168
- isClearable: false,
5169
- options: props.userReferenceOptions || [],
5170
- onChange: (e) => field.onChange(e)
5171
- }
5172
- );
5173
- }
5174
- }
5175
- )
5176
- ),
5177
- showTermsOption || showNewsletterOption ? /* @__PURE__ */ import_react37.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ import_react37.default.createElement(
5178
- import_react_hook_form2.Controller,
5179
- {
5180
- control,
5181
- name: "terms_accepted",
5182
- render: ({ field }) => {
5183
- var _a2, _b2;
5184
- return /* @__PURE__ */ import_react37.default.createElement(
5222
+ name: "newsletter_accepted",
5223
+ render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
5185
5224
  Checkbox,
5186
5225
  {
5187
- id: "terms_accepted",
5188
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
5189
- onCheckedChange: (e) => field.onChange(e),
5190
- label: /* @__PURE__ */ import_react37.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_react37.default.createElement(StopPropagationWrapper, null, /* @__PURE__ */ import_react37.default.createElement(
5191
- "span",
5192
- {
5193
- onClick: (e) => {
5194
- e.preventDefault();
5195
- if (props.onRouteToTOS) {
5196
- props.onRouteToTOS();
5197
- }
5198
- },
5199
- className: "clickable-link"
5200
- },
5201
- (texts == null ? void 0 : texts.termsText) || "Terms of Service"
5202
- )))
5226
+ id: "newsletter_accepted",
5227
+ label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
5228
+ onCheckedChange: field.onChange
5203
5229
  }
5204
- );
5230
+ )
5205
5231
  }
5206
- }
5207
- ), showNewsletterOption && /* @__PURE__ */ import_react37.default.createElement(
5208
- import_react_hook_form2.Controller,
5232
+ )) : null
5233
+ ),
5234
+ /* @__PURE__ */ import_react37.default.createElement(
5235
+ Button,
5209
5236
  {
5210
- control,
5211
- name: "newsletter_accepted",
5212
- render: ({ field }) => /* @__PURE__ */ import_react37.default.createElement(
5213
- Checkbox,
5214
- {
5215
- id: "newsletter_accepted",
5216
- label: (texts == null ? void 0 : texts.subscribeToNewsletter) || "Subscribe to our newsletter",
5217
- onCheckedChange: field.onChange
5218
- }
5219
- )
5220
- }
5221
- )) : null
5222
- ),
5223
- /* @__PURE__ */ import_react37.default.createElement(
5224
- Button,
5225
- {
5226
- className: "hawa-w-full",
5227
- type: "submit",
5228
- isLoading: props.isLoading,
5229
- disabled: props.isLoading
5230
- },
5231
- (texts == null ? void 0 : texts.registerText) || "Register"
5232
- ),
5233
- props.additionalButtons
5234
- )), props.onRouteToLogin && /* @__PURE__ */ import_react37.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_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))
5237
+ className: "hawa-w-full",
5238
+ type: "submit",
5239
+ isLoading: props.isLoading,
5240
+ disabled: props.isLoading
5241
+ },
5242
+ (texts == null ? void 0 : texts.registerText) || "Register"
5243
+ ),
5244
+ props.additionalButtons
5245
+ )),
5246
+ props.onRouteToLogin && /* @__PURE__ */ import_react37.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_react37.default.createElement("span", null, (texts == null ? void 0 : texts.existingUserText) || "Already have an account?"), /* @__PURE__ */ import_react37.default.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login"))
5247
+ )
5235
5248
  ),
5236
5249
  props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ import_react37.default.createElement(
5237
5250
  CardFooter,