@sikka/hawa 0.49.7-next → 0.49.8-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
@@ -10539,8 +10539,15 @@ var RegisterForm = ({
10539
10539
  continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
10540
10540
  continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
10541
10541
  };
10542
- const methods = (0, import_react_hook_form2.useForm)();
10543
10542
  let fieldSchemas = {};
10543
+ let remainingFieldsSchema = z2.object({
10544
+ refCode: z2.string().optional(),
10545
+ reference: z2.string().optional(),
10546
+ terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10547
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10548
+ }) : z2.boolean().optional(),
10549
+ newsletter_accepted: z2.boolean().optional()
10550
+ });
10544
10551
  const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
10545
10552
  if (hasPhoneType && selectedRegisterType.value === "phone") {
10546
10553
  registerFields = ["phone"];
@@ -10595,13 +10602,7 @@ var RegisterForm = ({
10595
10602
  return isPhoneValid;
10596
10603
  },
10597
10604
  { message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
10598
- ),
10599
- refCode: z2.string().optional(),
10600
- reference: z2.string().optional(),
10601
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10602
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10603
- }),
10604
- newsletter_accepted: z2.boolean().optional()
10605
+ )
10605
10606
  });
10606
10607
  } else {
10607
10608
  formSchema = z2.object({
@@ -10619,21 +10620,24 @@ var RegisterForm = ({
10619
10620
  message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
10620
10621
  }).refine((value) => value !== "", {
10621
10622
  message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
10622
- }),
10623
- refCode: z2.string().optional(),
10624
- reference: z2.string().optional(),
10625
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10626
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10627
- }),
10628
- newsletter_accepted: z2.boolean().optional()
10623
+ })
10629
10624
  }).refine((data) => data.password === data.confirm_password, {
10630
10625
  message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
10631
10626
  path: ["confirm_password"]
10632
10627
  });
10633
10628
  }
10634
- const { handleSubmit, control, formState } = (0, import_react_hook_form2.useForm)({
10635
- resolver: (0, import_zod2.zodResolver)(formSchema)
10629
+ let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
10630
+ const methods = (0, import_react_hook_form2.useForm)({
10631
+ resolver: (0, import_zod2.zodResolver)(finalSchema)
10636
10632
  });
10633
+ const onSubmit = (data) => {
10634
+ console.log("Form submitted with data:", data);
10635
+ if (props.onRegister) {
10636
+ props.onRegister(data);
10637
+ } else {
10638
+ console.log("onRegister prop is missing");
10639
+ }
10640
+ };
10637
10641
  return /* @__PURE__ */ import_react69.default.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ import_react69.default.createElement(
10638
10642
  Card,
10639
10643
  {
@@ -10673,13 +10677,7 @@ var RegisterForm = ({
10673
10677
  {
10674
10678
  id: "register_form",
10675
10679
  noValidate: true,
10676
- onSubmit: handleSubmit((e) => {
10677
- if (props.onRegister) {
10678
- return props.onRegister(e);
10679
- } else {
10680
- console.log("Form is submitted but onRegister prop is missing");
10681
- }
10682
- }),
10680
+ onSubmit: methods.handleSubmit(onSubmit),
10683
10681
  className: "hawa-flex hawa-flex-col hawa-gap-4"
10684
10682
  },
10685
10683
  /* @__PURE__ */ import_react69.default.createElement(
@@ -10716,7 +10714,7 @@ var RegisterForm = ({
10716
10714
  import_react_hook_form2.Controller,
10717
10715
  {
10718
10716
  key: i,
10719
- control,
10717
+ control: methods.control,
10720
10718
  name: "fullName",
10721
10719
  render: ({ field }) => {
10722
10720
  var _a2, _b2, _c2;
@@ -10726,7 +10724,7 @@ var RegisterForm = ({
10726
10724
  width: "full",
10727
10725
  label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
10728
10726
  placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
10729
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
10727
+ helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
10730
10728
  ...field
10731
10729
  }
10732
10730
  );
@@ -10739,7 +10737,7 @@ var RegisterForm = ({
10739
10737
  import_react_hook_form2.Controller,
10740
10738
  {
10741
10739
  key: i,
10742
- control,
10740
+ control: methods.control,
10743
10741
  name: "email",
10744
10742
  render: ({ field }) => {
10745
10743
  var _a2, _b2, _c2;
@@ -10753,7 +10751,7 @@ var RegisterForm = ({
10753
10751
  width: "full",
10754
10752
  autoComplete: "email",
10755
10753
  label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
10756
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
10754
+ helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
10757
10755
  placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
10758
10756
  ...field,
10759
10757
  onChange: (e) => {
@@ -10770,7 +10768,7 @@ var RegisterForm = ({
10770
10768
  import_react_hook_form2.Controller,
10771
10769
  {
10772
10770
  key: i,
10773
- control,
10771
+ control: methods.control,
10774
10772
  name: "username",
10775
10773
  render: ({ field }) => {
10776
10774
  var _a2, _b2, _c2, _d2, _e2;
@@ -10783,7 +10781,7 @@ var RegisterForm = ({
10783
10781
  labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
10784
10782
  ...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
10785
10783
  } : void 0,
10786
- helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
10784
+ helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
10787
10785
  placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
10788
10786
  ...field
10789
10787
  }
@@ -10796,7 +10794,7 @@ var RegisterForm = ({
10796
10794
  /* @__PURE__ */ import_react69.default.createElement(
10797
10795
  import_react_hook_form2.Controller,
10798
10796
  {
10799
- control,
10797
+ control: methods.control,
10800
10798
  name: "password",
10801
10799
  render: ({ field }) => {
10802
10800
  var _a2, _b2, _c2;
@@ -10808,7 +10806,7 @@ var RegisterForm = ({
10808
10806
  autoComplete: "new-password",
10809
10807
  label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
10810
10808
  placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
10811
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
10809
+ helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
10812
10810
  endIcon: /* @__PURE__ */ import_react69.default.createElement(
10813
10811
  "div",
10814
10812
  {
@@ -10827,7 +10825,7 @@ var RegisterForm = ({
10827
10825
  /* @__PURE__ */ import_react69.default.createElement(
10828
10826
  import_react_hook_form2.Controller,
10829
10827
  {
10830
- control,
10828
+ control: methods.control,
10831
10829
  name: "confirm_password",
10832
10830
  render: ({ field }) => {
10833
10831
  var _a2, _b2, _c2;
@@ -10839,7 +10837,7 @@ var RegisterForm = ({
10839
10837
  autoComplete: "new-password",
10840
10838
  label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
10841
10839
  placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
10842
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
10840
+ helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
10843
10841
  endIcon: /* @__PURE__ */ import_react69.default.createElement(
10844
10842
  "div",
10845
10843
  {
@@ -10859,7 +10857,7 @@ var RegisterForm = ({
10859
10857
  props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
10860
10858
  import_react_hook_form2.Controller,
10861
10859
  {
10862
- control,
10860
+ control: methods.control,
10863
10861
  name: "refCode",
10864
10862
  render: ({ field }) => {
10865
10863
  var _a2;
@@ -10869,7 +10867,7 @@ var RegisterForm = ({
10869
10867
  width: "full",
10870
10868
  label: texts == null ? void 0 : texts.refCode,
10871
10869
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10872
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10870
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
10873
10871
  ...field
10874
10872
  }
10875
10873
  );
@@ -10879,7 +10877,7 @@ var RegisterForm = ({
10879
10877
  props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
10880
10878
  import_react_hook_form2.Controller,
10881
10879
  {
10882
- control,
10880
+ control: methods.control,
10883
10881
  name: "reference",
10884
10882
  render: ({ field }) => {
10885
10883
  var _a2, _b2;
@@ -10913,7 +10911,7 @@ var RegisterForm = ({
10913
10911
  /* @__PURE__ */ import_react69.default.createElement(
10914
10912
  import_react_hook_form2.Controller,
10915
10913
  {
10916
- control,
10914
+ control: methods.control,
10917
10915
  name: "phone",
10918
10916
  render: ({ field }) => {
10919
10917
  var _a2, _b2;
@@ -10921,7 +10919,7 @@ var RegisterForm = ({
10921
10919
  PhoneInput,
10922
10920
  {
10923
10921
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
10924
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
10922
+ helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
10925
10923
  preferredCountry: { label: "+966" },
10926
10924
  ...props.phoneInputProps,
10927
10925
  handleChange: (e) => {
@@ -10941,7 +10939,7 @@ var RegisterForm = ({
10941
10939
  props.showRefCode && /* @__PURE__ */ import_react69.default.createElement(
10942
10940
  import_react_hook_form2.Controller,
10943
10941
  {
10944
- control,
10942
+ control: methods.control,
10945
10943
  name: "refCode",
10946
10944
  render: ({ field }) => {
10947
10945
  var _a2;
@@ -10951,7 +10949,7 @@ var RegisterForm = ({
10951
10949
  width: "full",
10952
10950
  label: texts == null ? void 0 : texts.refCode,
10953
10951
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10954
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10952
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
10955
10953
  ...field
10956
10954
  }
10957
10955
  );
@@ -10961,7 +10959,7 @@ var RegisterForm = ({
10961
10959
  props.showUserSource && /* @__PURE__ */ import_react69.default.createElement(
10962
10960
  import_react_hook_form2.Controller,
10963
10961
  {
10964
- control,
10962
+ control: methods.control,
10965
10963
  name: "reference",
10966
10964
  render: ({ field }) => {
10967
10965
  var _a2, _b2;
@@ -10985,7 +10983,7 @@ var RegisterForm = ({
10985
10983
  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(
10986
10984
  import_react_hook_form2.Controller,
10987
10985
  {
10988
- control,
10986
+ control: methods.control,
10989
10987
  name: "terms_accepted",
10990
10988
  render: ({ field }) => {
10991
10989
  var _a2, _b2;
@@ -10993,7 +10991,7 @@ var RegisterForm = ({
10993
10991
  Checkbox,
10994
10992
  {
10995
10993
  id: "terms_accepted",
10996
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10994
+ helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10997
10995
  onCheckedChange: (e) => field.onChange(e),
10998
10996
  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(
10999
10997
  "span",
@@ -11015,7 +11013,7 @@ var RegisterForm = ({
11015
11013
  ), showNewsletterOption && /* @__PURE__ */ import_react69.default.createElement(
11016
11014
  import_react_hook_form2.Controller,
11017
11015
  {
11018
- control,
11016
+ control: methods.control,
11019
11017
  name: "newsletter_accepted",
11020
11018
  render: ({ field }) => /* @__PURE__ */ import_react69.default.createElement(
11021
11019
  Checkbox,
package/dist/index.mjs CHANGED
@@ -10309,8 +10309,15 @@ var RegisterForm = ({
10309
10309
  continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
10310
10310
  continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
10311
10311
  };
10312
- const methods = useForm2();
10313
10312
  let fieldSchemas = {};
10313
+ let remainingFieldsSchema = z2.object({
10314
+ refCode: z2.string().optional(),
10315
+ reference: z2.string().optional(),
10316
+ terms_accepted: showTermsOption ? z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10317
+ message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10318
+ }) : z2.boolean().optional(),
10319
+ newsletter_accepted: z2.boolean().optional()
10320
+ });
10314
10321
  const hasPhoneType = registerTypes == null ? void 0 : registerTypes.some((type) => type.value === "phone");
10315
10322
  if (hasPhoneType && selectedRegisterType.value === "phone") {
10316
10323
  registerFields = ["phone"];
@@ -10365,13 +10372,7 @@ var RegisterForm = ({
10365
10372
  return isPhoneValid;
10366
10373
  },
10367
10374
  { message: ((_d = texts == null ? void 0 : texts.phone) == null ? void 0 : _d.invalid) || "Phone Number Invalid" }
10368
- ),
10369
- refCode: z2.string().optional(),
10370
- reference: z2.string().optional(),
10371
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10372
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10373
- }),
10374
- newsletter_accepted: z2.boolean().optional()
10375
+ )
10375
10376
  });
10376
10377
  } else {
10377
10378
  formSchema = z2.object({
@@ -10389,21 +10390,24 @@ var RegisterForm = ({
10389
10390
  message: ((_i = texts == null ? void 0 : texts.password) == null ? void 0 : _i.tooShort) || "Password is too short"
10390
10391
  }).refine((value) => value !== "", {
10391
10392
  message: ((_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required) || "Confirm password is required"
10392
- }),
10393
- refCode: z2.string().optional(),
10394
- reference: z2.string().optional(),
10395
- terms_accepted: z2.boolean({ required_error: (texts == null ? void 0 : texts.termsRequired) || "Terms required" }).refine((value) => value, {
10396
- message: (texts == null ? void 0 : texts.termsRequired) || "Terms required"
10397
- }),
10398
- newsletter_accepted: z2.boolean().optional()
10393
+ })
10399
10394
  }).refine((data) => data.password === data.confirm_password, {
10400
10395
  message: ((_k = texts == null ? void 0 : texts.confirm) == null ? void 0 : _k.dontMatch) || "Passwords don't match",
10401
10396
  path: ["confirm_password"]
10402
10397
  });
10403
10398
  }
10404
- const { handleSubmit, control, formState } = useForm2({
10405
- resolver: zodResolver2(formSchema)
10399
+ let finalSchema = z2.intersection(formSchema, remainingFieldsSchema);
10400
+ const methods = useForm2({
10401
+ resolver: zodResolver2(finalSchema)
10406
10402
  });
10403
+ const onSubmit = (data) => {
10404
+ console.log("Form submitted with data:", data);
10405
+ if (props.onRegister) {
10406
+ props.onRegister(data);
10407
+ } else {
10408
+ console.log("onRegister prop is missing");
10409
+ }
10410
+ };
10407
10411
  return /* @__PURE__ */ React83.createElement("div", { className: cn("hawa-flex hawa-flex-col", (_l = props.classNames) == null ? void 0 : _l.root) }, /* @__PURE__ */ React83.createElement(
10408
10412
  Card,
10409
10413
  {
@@ -10443,13 +10447,7 @@ var RegisterForm = ({
10443
10447
  {
10444
10448
  id: "register_form",
10445
10449
  noValidate: true,
10446
- onSubmit: handleSubmit((e) => {
10447
- if (props.onRegister) {
10448
- return props.onRegister(e);
10449
- } else {
10450
- console.log("Form is submitted but onRegister prop is missing");
10451
- }
10452
- }),
10450
+ onSubmit: methods.handleSubmit(onSubmit),
10453
10451
  className: "hawa-flex hawa-flex-col hawa-gap-4"
10454
10452
  },
10455
10453
  /* @__PURE__ */ React83.createElement(
@@ -10486,7 +10484,7 @@ var RegisterForm = ({
10486
10484
  Controller2,
10487
10485
  {
10488
10486
  key: i,
10489
- control,
10487
+ control: methods.control,
10490
10488
  name: "fullName",
10491
10489
  render: ({ field }) => {
10492
10490
  var _a2, _b2, _c2;
@@ -10496,7 +10494,7 @@ var RegisterForm = ({
10496
10494
  width: "full",
10497
10495
  label: ((_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label) || "Full Name",
10498
10496
  placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
10499
- helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
10497
+ helperText: (_c2 = methods.formState.errors.fullName) == null ? void 0 : _c2.message,
10500
10498
  ...field
10501
10499
  }
10502
10500
  );
@@ -10509,7 +10507,7 @@ var RegisterForm = ({
10509
10507
  Controller2,
10510
10508
  {
10511
10509
  key: i,
10512
- control,
10510
+ control: methods.control,
10513
10511
  name: "email",
10514
10512
  render: ({ field }) => {
10515
10513
  var _a2, _b2, _c2;
@@ -10523,7 +10521,7 @@ var RegisterForm = ({
10523
10521
  width: "full",
10524
10522
  autoComplete: "email",
10525
10523
  label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
10526
- helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
10524
+ helperText: (_b2 = methods.formState.errors.email) == null ? void 0 : _b2.message,
10527
10525
  placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
10528
10526
  ...field,
10529
10527
  onChange: (e) => {
@@ -10540,7 +10538,7 @@ var RegisterForm = ({
10540
10538
  Controller2,
10541
10539
  {
10542
10540
  key: i,
10543
- control,
10541
+ control: methods.control,
10544
10542
  name: "username",
10545
10543
  render: ({ field }) => {
10546
10544
  var _a2, _b2, _c2, _d2, _e2;
@@ -10553,7 +10551,7 @@ var RegisterForm = ({
10553
10551
  labelProps: ((_b2 = props.usernameOptions) == null ? void 0 : _b2.label) ? {
10554
10552
  ...(_c2 = props.usernameOptions) == null ? void 0 : _c2.label
10555
10553
  } : void 0,
10556
- helperText: (_d2 = formState.errors.username) == null ? void 0 : _d2.message,
10554
+ helperText: (_d2 = methods.formState.errors.username) == null ? void 0 : _d2.message,
10557
10555
  placeholder: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.placeholder,
10558
10556
  ...field
10559
10557
  }
@@ -10566,7 +10564,7 @@ var RegisterForm = ({
10566
10564
  /* @__PURE__ */ React83.createElement(
10567
10565
  Controller2,
10568
10566
  {
10569
- control,
10567
+ control: methods.control,
10570
10568
  name: "password",
10571
10569
  render: ({ field }) => {
10572
10570
  var _a2, _b2, _c2;
@@ -10578,7 +10576,7 @@ var RegisterForm = ({
10578
10576
  autoComplete: "new-password",
10579
10577
  label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
10580
10578
  placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
10581
- helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
10579
+ helperText: (_c2 = methods.formState.errors.password) == null ? void 0 : _c2.message,
10582
10580
  endIcon: /* @__PURE__ */ React83.createElement(
10583
10581
  "div",
10584
10582
  {
@@ -10597,7 +10595,7 @@ var RegisterForm = ({
10597
10595
  /* @__PURE__ */ React83.createElement(
10598
10596
  Controller2,
10599
10597
  {
10600
- control,
10598
+ control: methods.control,
10601
10599
  name: "confirm_password",
10602
10600
  render: ({ field }) => {
10603
10601
  var _a2, _b2, _c2;
@@ -10609,7 +10607,7 @@ var RegisterForm = ({
10609
10607
  autoComplete: "new-password",
10610
10608
  label: ((_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label) || "Confirm Password",
10611
10609
  placeholder: ((_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder) || "Confirm your Password",
10612
- helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
10610
+ helperText: (_c2 = methods.formState.errors.confirm_password) == null ? void 0 : _c2.message,
10613
10611
  endIcon: /* @__PURE__ */ React83.createElement(
10614
10612
  "div",
10615
10613
  {
@@ -10629,7 +10627,7 @@ var RegisterForm = ({
10629
10627
  props.showRefCode && /* @__PURE__ */ React83.createElement(
10630
10628
  Controller2,
10631
10629
  {
10632
- control,
10630
+ control: methods.control,
10633
10631
  name: "refCode",
10634
10632
  render: ({ field }) => {
10635
10633
  var _a2;
@@ -10639,7 +10637,7 @@ var RegisterForm = ({
10639
10637
  width: "full",
10640
10638
  label: texts == null ? void 0 : texts.refCode,
10641
10639
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10642
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10640
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
10643
10641
  ...field
10644
10642
  }
10645
10643
  );
@@ -10649,7 +10647,7 @@ var RegisterForm = ({
10649
10647
  props.showUserSource && /* @__PURE__ */ React83.createElement(
10650
10648
  Controller2,
10651
10649
  {
10652
- control,
10650
+ control: methods.control,
10653
10651
  name: "reference",
10654
10652
  render: ({ field }) => {
10655
10653
  var _a2, _b2;
@@ -10683,7 +10681,7 @@ var RegisterForm = ({
10683
10681
  /* @__PURE__ */ React83.createElement(
10684
10682
  Controller2,
10685
10683
  {
10686
- control,
10684
+ control: methods.control,
10687
10685
  name: "phone",
10688
10686
  render: ({ field }) => {
10689
10687
  var _a2, _b2;
@@ -10691,7 +10689,7 @@ var RegisterForm = ({
10691
10689
  PhoneInput,
10692
10690
  {
10693
10691
  label: ((_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label) || "Phone Number",
10694
- helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
10692
+ helperText: (_b2 = methods.formState.errors.phone) == null ? void 0 : _b2.message,
10695
10693
  preferredCountry: { label: "+966" },
10696
10694
  ...props.phoneInputProps,
10697
10695
  handleChange: (e) => {
@@ -10711,7 +10709,7 @@ var RegisterForm = ({
10711
10709
  props.showRefCode && /* @__PURE__ */ React83.createElement(
10712
10710
  Controller2,
10713
10711
  {
10714
- control,
10712
+ control: methods.control,
10715
10713
  name: "refCode",
10716
10714
  render: ({ field }) => {
10717
10715
  var _a2;
@@ -10721,7 +10719,7 @@ var RegisterForm = ({
10721
10719
  width: "full",
10722
10720
  label: texts == null ? void 0 : texts.refCode,
10723
10721
  placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
10724
- helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
10722
+ helperText: (_a2 = methods.formState.errors.refCode) == null ? void 0 : _a2.message,
10725
10723
  ...field
10726
10724
  }
10727
10725
  );
@@ -10731,7 +10729,7 @@ var RegisterForm = ({
10731
10729
  props.showUserSource && /* @__PURE__ */ React83.createElement(
10732
10730
  Controller2,
10733
10731
  {
10734
- control,
10732
+ control: methods.control,
10735
10733
  name: "reference",
10736
10734
  render: ({ field }) => {
10737
10735
  var _a2, _b2;
@@ -10755,7 +10753,7 @@ var RegisterForm = ({
10755
10753
  showTermsOption || showNewsletterOption ? /* @__PURE__ */ React83.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3 hawa-mb-2" }, showTermsOption && /* @__PURE__ */ React83.createElement(
10756
10754
  Controller2,
10757
10755
  {
10758
- control,
10756
+ control: methods.control,
10759
10757
  name: "terms_accepted",
10760
10758
  render: ({ field }) => {
10761
10759
  var _a2, _b2;
@@ -10763,7 +10761,7 @@ var RegisterForm = ({
10763
10761
  Checkbox,
10764
10762
  {
10765
10763
  id: "terms_accepted",
10766
- helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10764
+ helperText: (_b2 = (_a2 = methods.formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
10767
10765
  onCheckedChange: (e) => field.onChange(e),
10768
10766
  label: /* @__PURE__ */ React83.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__ */ React83.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React83.createElement(
10769
10767
  "span",
@@ -10785,7 +10783,7 @@ var RegisterForm = ({
10785
10783
  ), showNewsletterOption && /* @__PURE__ */ React83.createElement(
10786
10784
  Controller2,
10787
10785
  {
10788
- control,
10786
+ control: methods.control,
10789
10787
  name: "newsletter_accepted",
10790
10788
  render: ({ field }) => /* @__PURE__ */ React83.createElement(
10791
10789
  Checkbox,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sikka/hawa",
3
- "version": "0.49.7-next",
3
+ "version": "0.49.8-next",
4
4
  "description": "Modern UI Kit made with Tailwind",
5
5
  "author": {
6
6
  "name": "Sikka Software",