@sikka/hawa 0.6.5-next → 0.6.10-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
@@ -1749,7 +1749,7 @@ var Radio = function(_param) {
1749
1749
  return /* @__PURE__ */ import_react10.default.createElement("div", {
1750
1750
  className: "hawa-rounded hawa-border hawa-border-gray-200 "
1751
1751
  }, /* @__PURE__ */ import_react10.default.createElement("div", {
1752
- className: cn("radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all", props.direction === "rtl" ? "margin-left" : "margin-right"),
1752
+ className: cn("radio-item radio-item-bordered hawa-flex hawa-items-center hawa-transition-all", props.direction === "rtl" ? "margin-left right-19px" : "margin-right left-23px"),
1753
1753
  key: i + 1
1754
1754
  }, /* @__PURE__ */ import_react10.default.createElement("input", {
1755
1755
  disabled: opt.disabled,
@@ -1787,12 +1787,11 @@ var Radio = function(_param) {
1787
1787
  }, opt.sublabel))));
1788
1788
  }));
1789
1789
  default:
1790
- console.log("ds", parentDirection);
1791
1790
  return /* @__PURE__ */ import_react10.default.createElement("div", {
1792
1791
  className: cn(orientationStyle[orientation], "hawa-gap-2")
1793
1792
  }, props.options && props.options.map(function(opt, i) {
1794
1793
  return /* @__PURE__ */ import_react10.default.createElement("div", {
1795
- className: cn("radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all", props.direction === "rtl" ? "margin-left" : "margin-right"),
1794
+ className: cn("radio-item radio-item-default hawa-flex hawa-items-center hawa-transition-all", props.direction === "rtl" ? "margin-left right-3px" : "margin-right left-3px"),
1796
1795
  key: i + 1
1797
1796
  }, /* @__PURE__ */ import_react10.default.createElement("input", {
1798
1797
  disabled: opt.disabled,
@@ -1969,7 +1968,7 @@ var PopoverContent = React21.forwardRef(function(_param, ref) /* @__PURE__ */ {
1969
1968
  ref: ref,
1970
1969
  align: align,
1971
1970
  sideOffset: sideOffset,
1972
- className: cn("hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-p-4 hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2 dark:hawa-shadow-dark", className)
1971
+ className: cn("hawa-z-50 hawa-rounded hawa-border hawa-bg-popover hawa-p-4 hawa-text-popover-foreground hawa-shadow-md hawa-outline-none data-[state=open]:hawa-animate-in data-[state=closed]:hawa-animate-out data-[state=closed]:hawa-fade-out-0 data-[state=open]:hawa-fade-in-0 data-[state=closed]:hawa-zoom-out-95 data-[state=open]:hawa-zoom-in-95 data-[side=bottom]:hawa-slide-in-from-top-2 data-[side=left]:hawa-slide-in-from-right-2 data-[side=right]:hawa-slide-in-from-left-2 data-[side=top]:hawa-slide-in-from-bottom-2 dark:dark-shadow", className)
1973
1972
  }, props)));
1974
1973
  });
1975
1974
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
@@ -2338,6 +2337,8 @@ var PinInput = function(_param) {
2338
2337
  }
2339
2338
  };
2340
2339
  return /* @__PURE__ */ import_react15.default.createElement("div", {
2340
+ className: "hawa-flex hawa-flex-col hawa-gap-2"
2341
+ }, /* @__PURE__ */ import_react15.default.createElement("div", {
2341
2342
  className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
2342
2343
  dir: "ltr"
2343
2344
  }, pin.map(function(value, index) {
@@ -2359,7 +2360,9 @@ var PinInput = function(_param) {
2359
2360
  return e.target.select();
2360
2361
  }
2361
2362
  }, props));
2362
- }));
2363
+ })), props.helperText && /* @__PURE__ */ import_react15.default.createElement("p", {
2364
+ className: "hawa-mb-0 hawa-mt-0 hawa-text-xs hawa-text-red-600 dark:hawa-text-red-500"
2365
+ }, props.helperText));
2363
2366
  };
2364
2367
  // components/elements/FileDropzone.tsx
2365
2368
  var import_react16 = __toESM(require("react"));
@@ -4310,12 +4313,13 @@ var Menu = function(_param) {
4310
4313
  "innerProps",
4311
4314
  "innerRef"
4312
4315
  ]);
4316
+ var menuOpen = props.selectProps.menuIsOpen;
4313
4317
  return /* @__PURE__ */ import_react18.default.createElement("div", _object_spread({
4314
- className: "hawa-absolute hawa-z-10 hawa-mt-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-p-1.5",
4318
+ className: cn("hawa-absolute hawa-shadow-md dark:dark-shadow hawa-z-10 hawa-mt-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-p-1.5", menuOpen && "hawa-zoom-in-95 hawa-animate-in hawa-fade-in-0 "),
4315
4319
  ref: innerRef
4316
4320
  }, innerProps), children);
4317
4321
  };
4318
- var Option = function(_param) /* @__PURE__ */ {
4322
+ var Option = function(_param) {
4319
4323
  var cx = _param.cx, children = _param.children, getStyles = _param.getStyles, innerProps = _param.innerProps, innerRef = _param.innerRef, _param_size = _param.size, size = _param_size === void 0 ? "normal" : _param_size, props = _object_without_properties(_param, [
4320
4324
  "cx",
4321
4325
  "children",
@@ -4324,9 +4328,9 @@ var Option = function(_param) /* @__PURE__ */ {
4324
4328
  "innerRef",
4325
4329
  "size"
4326
4330
  ]);
4327
- return import_react18.default.createElement("div", _object_spread({
4331
+ return /* @__PURE__ */ import_react18.default.createElement("div", _object_spread({
4328
4332
  ref: innerRef,
4329
- className: "hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hover:hawa-bg-primary hover:hawa-text-primary-foreground"
4333
+ className: "hawa-flex hawa-cursor-pointer hawa-select-none hawa-flex-row hawa-items-center hawa-justify-between hawa-rounded-inner hawa-p-1 hawa-px-2 hover:hawa-bg-primary hawa-transition-all hover:hawa-text-primary-foreground "
4330
4334
  }, innerProps), children);
4331
4335
  };
4332
4336
  var Select = function(props) {
@@ -4352,6 +4356,15 @@ var Select = function(props) {
4352
4356
  }) : !props.isCreatable ? /* @__PURE__ */ import_react18.default.createElement(import_react_select.default, {
4353
4357
  noOptionsMessage: NoOption,
4354
4358
  classNames: {
4359
+ // menuList: (d) => {
4360
+ // console.log("d is ", d.selectProps.menuIsOpen);
4361
+ // return cn(
4362
+ // "hawa-absolute hawa-shadow-md dark:dark-shadow hawa-z-10 hawa-mt-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-start hawa-rounded hawa-border hawa-bg-background hawa-p-1.5",
4363
+ // d.selectProps.menuIsOpen
4364
+ // ? "hawa-zoom-in-95 hawa-animate-in hawa-fade-in-0 "
4365
+ // : "hawa-zoom-out-95 hawa-fade-out-0 hawa-animate-out"
4366
+ // );
4367
+ // },
4355
4368
  control: function() {
4356
4369
  return cn(" hawa-text-sm hawa-flex hawa-p-2 hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-text-gray-900 focus:hawa-border-blue-500 focus:hawa-ring-blue-500 dark:focus:hawa-ring-blue-500", props.controlClassNames);
4357
4370
  },
@@ -4382,6 +4395,7 @@ var Select = function(props) {
4382
4395
  isClearable: props.isClearable,
4383
4396
  isMulti: props.isMulti,
4384
4397
  isSearchable: props.isSearchable,
4398
+ placeholder: props.placeholder,
4385
4399
  autoFocus: true,
4386
4400
  onChange: function(newValue, action) {
4387
4401
  return(// props.onChange(newValue.label, action)
@@ -4424,9 +4438,8 @@ var Select = function(props) {
4424
4438
  isClearable: props.isClearable,
4425
4439
  isMulti: props.isMulti,
4426
4440
  isSearchable: props.isSearchable,
4427
- onCreateOption: function() {
4428
- return console.log("im changing");
4429
- },
4441
+ placeholder: props.placeholder,
4442
+ onCreateOption: props.handleCreateOption,
4430
4443
  onChange: function(newValue, action) {
4431
4444
  return props.onChange(newValue, action);
4432
4445
  },
@@ -4618,7 +4631,7 @@ var TableHead = React33.forwardRef(function(_param, ref) /* @__PURE__ */ {
4618
4631
  ]);
4619
4632
  return React33.createElement("th", _object_spread({
4620
4633
  ref: ref,
4621
- className: cn("hawa-bg-muted/60 dark:hawa-bg-muted/40 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x", "[&:not(:last-child)]:hawa-border-r", props.condensed ? "hawa-h-8" : "hawa-h-12", props.clickable ? "hawa-px-1" : "hawa-px-4", //First and last columns
4634
+ className: cn("hawa-bg-muted/60 dark:hawa-bg-muted/40 hawa-text-start hawa-align-middle hawa-font-medium hawa-text-muted-foreground [&:has([role=checkbox])]:hawa-pr-0 [&:not(:last-child)&:not(:first-child)]:hawa-border-x", props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r", props.condensed ? "hawa-h-8" : "hawa-h-12", props.clickable ? "hawa-px-1" : "hawa-px-4", //First and last columns
4622
4635
  props.clickable ? " [&:not(:last-child)&:not(:first-child)]:hawa-p-1" : "hawa-px-4", //Columns in between
4623
4636
  className)
4624
4637
  }, props));
@@ -4664,7 +4677,8 @@ var TableCell = React33.forwardRef(function(_param, ref) /* @__PURE__ */ {
4664
4677
  return React33.createElement("td", _object_spread({
4665
4678
  ref: ref,
4666
4679
  className: cn(// "border-x",
4667
- props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4", "hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ", "[&:not(:last-child)&:not(:first-child)]:hawa-border-x", "[&:not(:last-child)]:hawa-border-r", className)
4680
+ props.condensed ? "hawa-p-0 hawa-px-4" : "hawa-p-4", "hawa-align-middle [&:has([role=checkbox])]:hawa-pr-0 ", "[&:not(:last-child)&:not(:first-child)]:hawa-border-x", // "[&:not(:last-child)]:hawa-border-r",
4681
+ props.dir === "rtl" ? "[&:not(:last-child)]:hawa-border-l" : "[&:not(:last-child)]:hawa-border-r", className)
4668
4682
  }, props));
4669
4683
  });
4670
4684
  TableCell.displayName = "TableCell";
@@ -4876,6 +4890,7 @@ var SimpleTable = function(_param) {
4876
4890
  }, headerGroup.headers.map(function(header) {
4877
4891
  return /* @__PURE__ */ React35.createElement(TableHead, {
4878
4892
  condensed: props.condensed,
4893
+ dir: props.direction,
4879
4894
  key: header.id
4880
4895
  }, header.isPlaceholder ? null : (0, import_react_table2.flexRender)(header.column.columnDef.header, header.getContext()));
4881
4896
  }));
@@ -4885,6 +4900,7 @@ var SimpleTable = function(_param) {
4885
4900
  "data-state": row.getIsSelected() && "selected"
4886
4901
  }, row.getVisibleCells().map(function(cell) {
4887
4902
  return /* @__PURE__ */ React35.createElement(TableCell, {
4903
+ dir: props.direction,
4888
4904
  condensed: props.condensed,
4889
4905
  key: cell.id
4890
4906
  }, (0, import_react_table2.flexRender)(cell.column.columnDef.cell, cell.getContext()));
@@ -6212,6 +6228,7 @@ var AppLayout = function(_param) {
6212
6228
  },
6213
6229
  ref: ref
6214
6230
  }, /* @__PURE__ */ import_react31.default.createElement("div", {
6231
+ onClick: props.onLogoClick,
6215
6232
  dir: direction,
6216
6233
  className: "hawa-fixed hawa-z-50 hawa-mb-2 hawa-flex hawa-h-14 hawa-w-full hawa-flex-row hawa-items-center hawa-justify-center hawa-bg-primary-foreground hawa-transition-all",
6217
6234
  style: {
@@ -6322,10 +6339,10 @@ var import_zod = require("@hookform/resolvers/zod");
6322
6339
  var z = __toESM(require("zod"));
6323
6340
  var LoginForm = function(props) {
6324
6341
  var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6;
6325
- var formSchema2;
6342
+ var formSchema;
6326
6343
  if (props.loginType === "email") {
6327
6344
  var _props_texts7, _props_texts8, _props_texts9, _props_texts10, _props_texts11;
6328
- formSchema2 = z.object({
6345
+ formSchema = z.object({
6329
6346
  email: z.string({
6330
6347
  required_error: (_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.emailRequiredText
6331
6348
  }).nonempty({
@@ -6343,7 +6360,7 @@ var LoginForm = function(props) {
6343
6360
  });
6344
6361
  } else if (props.loginType === "username") {
6345
6362
  var _props_texts12, _props_texts13, _props_texts14;
6346
- formSchema2 = z.object({
6363
+ formSchema = z.object({
6347
6364
  username: z.string().min(2, {
6348
6365
  message: "Username must be at least 2 characters"
6349
6366
  }).nonempty({
@@ -6358,16 +6375,16 @@ var LoginForm = function(props) {
6358
6375
  })
6359
6376
  });
6360
6377
  } else if (props.loginType === "phone") {
6361
- formSchema2 = z.object({
6378
+ formSchema = z.object({
6362
6379
  phone: z.string().nonempty({
6363
6380
  message: "Phone number is required"
6364
6381
  })
6365
6382
  });
6366
6383
  } else {
6367
- formSchema2 = z.object({});
6384
+ formSchema = z.object({});
6368
6385
  }
6369
6386
  var _ref = (0, import_react_hook_form2.useForm)({
6370
- resolver: (0, import_zod.zodResolver)(formSchema2)
6387
+ resolver: (0, import_zod.zodResolver)(formSchema)
6371
6388
  }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
6372
6389
  return /* @__PURE__ */ import_react33.default.createElement("div", {
6373
6390
  className: "hawa-flex hawa-flex-col hawa-gap-4"
@@ -6383,7 +6400,6 @@ var LoginForm = function(props) {
6383
6400
  className: "hawa-flex hawa-flex-col hawa-gap-4",
6384
6401
  onSubmit: handleSubmit(function(e) {
6385
6402
  if (props.handleLogin) {
6386
- console.log("attempting to login");
6387
6403
  return props.handleLogin(e);
6388
6404
  } else {
6389
6405
  console.log("Form is submitted but handleLogin prop is missing");
@@ -6506,7 +6522,7 @@ var import_zod2 = require("@hookform/resolvers/zod");
6506
6522
  var z2 = __toESM(require("zod"));
6507
6523
  var RegisterForm = function(props) {
6508
6524
  var methods = (0, import_react_hook_form3.useForm)();
6509
- var _props_texts = props.texts, usernamePlaceholder = _props_texts.usernamePlaceholder, usernameRequired = _props_texts.usernameRequired, emailInvalidText = _props_texts.emailInvalidText, emailPlaceholder = _props_texts.emailPlaceholder, emailRequiredText = _props_texts.emailRequiredText, passwordPlaceholder = _props_texts.passwordPlaceholder, passwordRequiredText = _props_texts.passwordRequiredText, passwordTooShortText = _props_texts.passwordTooShortText, confirmPasswordRequired = _props_texts.confirmPasswordRequired, confirmPasswordPlaceholder = _props_texts.confirmPasswordPlaceholder, termsRequiredText = _props_texts.termsRequiredText, fullNameRequiredText = _props_texts.fullNameRequiredText;
6525
+ var _props_texts = props.texts, usernamePlaceholder = _props_texts.usernamePlaceholder, usernameRequired = _props_texts.usernameRequired, emailInvalidText = _props_texts.emailInvalidText, emailPlaceholder = _props_texts.emailPlaceholder, emailRequiredText = _props_texts.emailRequiredText, passwordPlaceholder = _props_texts.passwordPlaceholder, passwordRequiredText = _props_texts.passwordRequiredText, passwordTooShortText = _props_texts.passwordTooShortText, passwordsDontMatch = _props_texts.passwordsDontMatch, confirmPasswordRequired = _props_texts.confirmPasswordRequired, confirmPasswordPlaceholder = _props_texts.confirmPasswordPlaceholder, termsRequiredText = _props_texts.termsRequiredText, fullNameRequiredText = _props_texts.fullNameRequiredText;
6510
6526
  var fieldSchemas = {};
6511
6527
  props.registerFields.forEach(function(field) {
6512
6528
  switch(field){
@@ -6533,7 +6549,7 @@ var RegisterForm = function(props) {
6533
6549
  break;
6534
6550
  }
6535
6551
  });
6536
- var formSchema2 = z2.object(_object_spread_props(_object_spread({}, fieldSchemas), {
6552
+ var formSchema = z2.object(_object_spread_props(_object_spread({}, fieldSchemas), {
6537
6553
  password: z2.string({
6538
6554
  required_error: passwordRequiredText
6539
6555
  }).min(5, {
@@ -6563,13 +6579,13 @@ var RegisterForm = function(props) {
6563
6579
  })).refine(function(data) {
6564
6580
  return data.password === data.confirm_password;
6565
6581
  }, {
6566
- message: "Passwords don't match",
6582
+ message: passwordsDontMatch,
6567
6583
  path: [
6568
6584
  "confirm_password"
6569
6585
  ]
6570
6586
  });
6571
6587
  var _ref = (0, import_react_hook_form3.useForm)({
6572
- resolver: (0, import_zod2.zodResolver)(formSchema2)
6588
+ resolver: (0, import_zod2.zodResolver)(formSchema)
6573
6589
  }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
6574
6590
  return /* @__PURE__ */ import_react34.default.createElement("div", {
6575
6591
  className: "hawa-flex hawa-flex-col hawa-gap-4"
@@ -6582,7 +6598,13 @@ var RegisterForm = function(props) {
6582
6598
  text: props.errorText,
6583
6599
  severity: "error"
6584
6600
  }), /* @__PURE__ */ import_react34.default.createElement(import_react_hook_form3.FormProvider, _object_spread({}, methods), /* @__PURE__ */ import_react34.default.createElement("form", {
6585
- onSubmit: handleSubmit(props.handleRegister),
6601
+ onSubmit: handleSubmit(function(e) {
6602
+ if (props.handleRegister) {
6603
+ return props.handleRegister(e);
6604
+ } else {
6605
+ console.log("Form is submitted but handleRegister prop is missing");
6606
+ }
6607
+ }),
6586
6608
  className: "hawa-flex hawa-flex-col hawa-gap-4"
6587
6609
  }, /* @__PURE__ */ import_react34.default.createElement("div", {
6588
6610
  className: "hawa-flex hawa-flex-col hawa-gap-4"
@@ -6856,7 +6878,7 @@ var AppLanding = function(props) {
6856
6878
  }), (_props_texts_continueWithPhone = (_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.continueWithPhone) !== null && _props_texts_continueWithPhone !== void 0 ? _props_texts_continueWithPhone : "Continue With Phone"), !props.withoutSignUp && /* @__PURE__ */ import_react35.default.createElement("div", {
6857
6879
  className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300"
6858
6880
  }, (_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.newUserText, " ", /* @__PURE__ */ import_react35.default.createElement("span", {
6859
- onClick: props.handleRouteToSignUp,
6881
+ onClick: props.handleRouteToRegister,
6860
6882
  className: "clickable-link"
6861
6883
  }, (_props_texts8 = props.texts) === null || _props_texts8 === void 0 ? void 0 : _props_texts8.createAccount)))), /* @__PURE__ */ import_react35.default.createElement("div", {
6862
6884
  className: "hawa-mt-4 hawa-flex hawa-flex-row hawa-justify-between"
@@ -6954,7 +6976,7 @@ var import_react_hook_form4 = require("react-hook-form");
6954
6976
  var import_zod3 = require("@hookform/resolvers/zod");
6955
6977
  var z3 = __toESM(require("zod"));
6956
6978
  var NewPasswordForm = function(props) {
6957
- var formSchema2 = z3.object({
6979
+ var formSchema = z3.object({
6958
6980
  password: z3.string({
6959
6981
  required_error: props.texts.passwordRequiredText
6960
6982
  }).min(5, {
@@ -6980,7 +7002,7 @@ var NewPasswordForm = function(props) {
6980
7002
  ]
6981
7003
  });
6982
7004
  var _ref = (0, import_react_hook_form4.useForm)({
6983
- resolver: (0, import_zod3.zodResolver)(formSchema2)
7005
+ resolver: (0, import_zod3.zodResolver)(formSchema)
6984
7006
  }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
6985
7007
  var _ref1 = _sliced_to_array((0, import_react37.useState)(false), 2), matchError = _ref1[0], setMatchError = _ref1[1];
6986
7008
  return /* @__PURE__ */ import_react37.default.createElement(Card, {
@@ -6995,7 +7017,6 @@ var NewPasswordForm = function(props) {
6995
7017
  }, props.texts.passwordChanged)) : /* @__PURE__ */ import_react37.default.createElement("form", {
6996
7018
  onSubmit: handleSubmit(function(e) {
6997
7019
  if (props.handleNewPassword) {
6998
- console.log("attempting to login");
6999
7020
  return props.handleNewPassword(e);
7000
7021
  } else {
7001
7022
  console.log("Form is submitted but handleSubmission prop is missing");
@@ -7052,7 +7073,7 @@ var import_zod4 = require("@hookform/resolvers/zod");
7052
7073
  var z4 = __toESM(require("zod"));
7053
7074
  var ResetPasswordForm = function(props) {
7054
7075
  var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6;
7055
- var formSchema2 = z4.object({
7076
+ var formSchema = z4.object({
7056
7077
  email: z4.string({
7057
7078
  required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.emailRequiredText
7058
7079
  }).email({
@@ -7062,7 +7083,7 @@ var ResetPasswordForm = function(props) {
7062
7083
  })
7063
7084
  });
7064
7085
  var _ref = (0, import_react_hook_form5.useForm)({
7065
- resolver: (0, import_zod4.zodResolver)(formSchema2)
7086
+ resolver: (0, import_zod4.zodResolver)(formSchema)
7066
7087
  }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
7067
7088
  var _props_texts_dontHaveAccount, _props_texts_registerText;
7068
7089
  return /* @__PURE__ */ import_react38.default.createElement(Card, {
@@ -7070,7 +7091,6 @@ var ResetPasswordForm = function(props) {
7070
7091
  }, !props.sent ? /* @__PURE__ */ import_react38.default.createElement(import_react38.default.Fragment, null, !props.headless && /* @__PURE__ */ import_react38.default.createElement(CardHeader, null, /* @__PURE__ */ import_react38.default.createElement(CardTitle, null, "Reset Password"), /* @__PURE__ */ import_react38.default.createElement(CardDescription, null, "Enter your email to reset your account password")), /* @__PURE__ */ import_react38.default.createElement("form", {
7071
7092
  onSubmit: handleSubmit(function(e) {
7072
7093
  if (props.handleResetPassword) {
7073
- console.log("attempting to login");
7074
7094
  return props.handleResetPassword(e);
7075
7095
  } else {
7076
7096
  console.log("Form is submitted but handleResetPassword prop is missing");
@@ -7111,9 +7131,21 @@ var ResetPasswordForm = function(props) {
7111
7131
  };
7112
7132
  // components/blocks/auth/CodeConfirmation.tsx
7113
7133
  var import_react39 = __toESM(require("react"));
7134
+ var import_react_hook_form6 = require("react-hook-form");
7135
+ var import_zod5 = require("@hookform/resolvers/zod");
7136
+ var z5 = __toESM(require("zod"));
7114
7137
  var CodeConfirmation = function(props) {
7115
- var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5;
7116
- var _ref = _sliced_to_array((0, import_react39.useState)(null), 2), pins = _ref[0], setPins = _ref[1];
7138
+ var _props_texts, _props_texts1, _props_texts2, _props_texts3, _props_texts4, _props_texts5, _props_texts6, _props_texts7;
7139
+ var formSchema = z5.object({
7140
+ otp_code: z5.string({
7141
+ required_error: (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.codeRequiredText
7142
+ }).min(6, {
7143
+ message: (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.codeTooShort
7144
+ })
7145
+ });
7146
+ var _ref = (0, import_react_hook_form6.useForm)({
7147
+ resolver: (0, import_zod5.zodResolver)(formSchema)
7148
+ }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState, setValue = _ref.setValue;
7117
7149
  var _props_texts_checkYourPhone, _props_texts_weSentCode, _props_texts_didntGetCode, _props_texts_resendCode, _props_texts_cancel, _props_texts_confirm;
7118
7150
  return /* @__PURE__ */ import_react39.default.createElement(Card, null, /* @__PURE__ */ import_react39.default.createElement(CardContent, {
7119
7151
  headless: true
@@ -7125,30 +7157,40 @@ var CodeConfirmation = function(props) {
7125
7157
  className: "hawa-mb-4 dark:hawa-text-white"
7126
7158
  }, /* @__PURE__ */ import_react39.default.createElement("div", {
7127
7159
  className: "hawa-text-lg hawa-font-bold"
7128
- }, (_props_texts_checkYourPhone = (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.checkYourPhone) !== null && _props_texts_checkYourPhone !== void 0 ? _props_texts_checkYourPhone : "Please check your phone"), /* @__PURE__ */ import_react39.default.createElement("div", {
7160
+ }, (_props_texts_checkYourPhone = (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.checkYourPhone) !== null && _props_texts_checkYourPhone !== void 0 ? _props_texts_checkYourPhone : "Please check your phone"), /* @__PURE__ */ import_react39.default.createElement("div", {
7129
7161
  className: "hawa-text-muted-foreground"
7130
- }, /* @__PURE__ */ import_react39.default.createElement("span", null, (_props_texts_weSentCode = (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.weSentCode) !== null && _props_texts_weSentCode !== void 0 ? _props_texts_weSentCode : "We've sent a code to "), /* @__PURE__ */ import_react39.default.createElement("span", null, props.phoneNumber)), " "), /* @__PURE__ */ import_react39.default.createElement("form", {
7131
- onSubmit: function(e) {
7132
- e.preventDefault();
7133
- if (pins) {
7134
- props.submitConfirmation(pins);
7162
+ }, /* @__PURE__ */ import_react39.default.createElement("span", null, (_props_texts_weSentCode = (_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.weSentCode) !== null && _props_texts_weSentCode !== void 0 ? _props_texts_weSentCode : "We've sent a code to "), /* @__PURE__ */ import_react39.default.createElement("span", null, props.phoneNumber)), " "), /* @__PURE__ */ import_react39.default.createElement("form", {
7163
+ onSubmit: handleSubmit(function(e) {
7164
+ if (props.handleConfirm) {
7165
+ return props.handleConfirm(e);
7166
+ } else {
7167
+ console.log("Form is submitted but handleConfirm prop is missing");
7135
7168
  }
7136
- }
7137
- }, /* @__PURE__ */ import_react39.default.createElement(PinInput, {
7138
- width: "full",
7139
- digits: 6,
7140
- getPins: function(e) {
7141
- return setPins(e);
7169
+ })
7170
+ }, /* @__PURE__ */ import_react39.default.createElement(import_react_hook_form6.Controller, {
7171
+ control: control,
7172
+ name: "otp_code",
7173
+ render: function(param) {
7174
+ var field = param.field;
7175
+ var _formState_errors_otp_code;
7176
+ return /* @__PURE__ */ import_react39.default.createElement(PinInput, {
7177
+ width: "full",
7178
+ digits: 6,
7179
+ getPins: function(e) {
7180
+ return setValue("otp_code", e.join(""));
7181
+ },
7182
+ helperText: (_formState_errors_otp_code = formState.errors.otp_code) === null || _formState_errors_otp_code === void 0 ? void 0 : _formState_errors_otp_code.message
7183
+ });
7142
7184
  }
7143
7185
  }), /* @__PURE__ */ import_react39.default.createElement("div", {
7144
7186
  className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground"
7145
- }, /* @__PURE__ */ import_react39.default.createElement("span", null, (_props_texts_didntGetCode = (_props_texts2 = props.texts) === null || _props_texts2 === void 0 ? void 0 : _props_texts2.didntGetCode) !== null && _props_texts_didntGetCode !== void 0 ? _props_texts_didntGetCode : "Didn't get the code?"), " ", /* @__PURE__ */ import_react39.default.createElement("span", {
7187
+ }, /* @__PURE__ */ import_react39.default.createElement("span", null, (_props_texts_didntGetCode = (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.didntGetCode) !== null && _props_texts_didntGetCode !== void 0 ? _props_texts_didntGetCode : "Didn't get the code?"), " ", /* @__PURE__ */ import_react39.default.createElement("span", {
7146
7188
  className: "clickable-link"
7147
- }, (_props_texts_resendCode = (_props_texts3 = props.texts) === null || _props_texts3 === void 0 ? void 0 : _props_texts3.resendCode) !== null && _props_texts_resendCode !== void 0 ? _props_texts_resendCode : "Click to resend")), /* @__PURE__ */ import_react39.default.createElement("div", {
7189
+ }, (_props_texts_resendCode = (_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.resendCode) !== null && _props_texts_resendCode !== void 0 ? _props_texts_resendCode : "Click to resend")), /* @__PURE__ */ import_react39.default.createElement("div", {
7148
7190
  className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2"
7149
7191
  }, /* @__PURE__ */ import_react39.default.createElement(Button, {
7150
7192
  variant: "secondary"
7151
- }, (_props_texts_cancel = (_props_texts4 = props.texts) === null || _props_texts4 === void 0 ? void 0 : _props_texts4.cancel) !== null && _props_texts_cancel !== void 0 ? _props_texts_cancel : "Cancel"), /* @__PURE__ */ import_react39.default.createElement(Button, null, (_props_texts_confirm = (_props_texts5 = props.texts) === null || _props_texts5 === void 0 ? void 0 : _props_texts5.confirm) !== null && _props_texts_confirm !== void 0 ? _props_texts_confirm : "Confirm")))));
7193
+ }, (_props_texts_cancel = (_props_texts6 = props.texts) === null || _props_texts6 === void 0 ? void 0 : _props_texts6.cancel) !== null && _props_texts_cancel !== void 0 ? _props_texts_cancel : "Cancel"), /* @__PURE__ */ import_react39.default.createElement(Button, null, (_props_texts_confirm = (_props_texts7 = props.texts) === null || _props_texts7 === void 0 ? void 0 : _props_texts7.confirm) !== null && _props_texts_confirm !== void 0 ? _props_texts_confirm : "Confirm")))));
7152
7194
  };
7153
7195
  // components/blocks/feedback/UserReferralSource.tsx
7154
7196
  var import_react40 = __toESM(require("react"));
@@ -7545,28 +7587,38 @@ var VeryBadEmoji = function() {
7545
7587
  };
7546
7588
  // components/blocks/feedback/FeedbackForm.tsx
7547
7589
  var import_react43 = __toESM(require("react"));
7548
- var import_react_hook_form6 = require("react-hook-form");
7549
- var import_zod5 = require("@hookform/resolvers/zod");
7550
- var z5 = __toESM(require("zod"));
7551
- var formSchema = z5.object({
7552
- requestType: z5.string().nonempty({
7553
- message: "Request type is required."
7554
- }),
7555
- description: z5.string().min(10, {
7556
- message: "Description must be at least 10 characters."
7557
- })
7558
- });
7559
- var FeedbackForm = function(param) {
7560
- var onSubmit = param.onSubmit;
7561
- var _ref = (0, import_react_hook_form6.useForm)({
7562
- resolver: (0, import_zod5.zodResolver)(formSchema)
7590
+ var import_react_hook_form7 = require("react-hook-form");
7591
+ var import_zod6 = require("@hookform/resolvers/zod");
7592
+ var z6 = __toESM(require("zod"));
7593
+ var FeedbackForm = function(props) {
7594
+ var _props_texts, _props_texts1;
7595
+ var formSchema = z6.object({
7596
+ requestType: z6.string({
7597
+ required_error: props.texts.requestTypeRequired
7598
+ }).nonempty({
7599
+ message: props.texts.requestTypeRequired
7600
+ }),
7601
+ description: z6.string({
7602
+ required_error: props.texts.descriptionRequired
7603
+ }).min(10, {
7604
+ message: props.texts.descriptionTooShort
7605
+ })
7606
+ });
7607
+ var _ref = (0, import_react_hook_form7.useForm)({
7608
+ resolver: (0, import_zod6.zodResolver)(formSchema)
7563
7609
  }), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
7564
7610
  return /* @__PURE__ */ import_react43.default.createElement(Card, null, /* @__PURE__ */ import_react43.default.createElement(CardContent, {
7565
7611
  headless: true
7566
7612
  }, /* @__PURE__ */ import_react43.default.createElement("form", {
7567
- onSubmit: handleSubmit(onSubmit),
7613
+ onSubmit: handleSubmit(function(e) {
7614
+ if (props.onSubmit) {
7615
+ return props.onSubmit(e);
7616
+ } else {
7617
+ console.log("Form is submitted but onSubmit prop is missing");
7618
+ }
7619
+ }),
7568
7620
  className: "hawa-flex hawa-flex-col hawa-gap-4"
7569
- }, /* @__PURE__ */ import_react43.default.createElement(Label, null, "Request Type:"), /* @__PURE__ */ import_react43.default.createElement(import_react_hook_form6.Controller, {
7621
+ }, /* @__PURE__ */ import_react43.default.createElement(Label, null, (_props_texts = props.texts) === null || _props_texts === void 0 ? void 0 : _props_texts.requestType), /* @__PURE__ */ import_react43.default.createElement(import_react_hook_form7.Controller, {
7570
7622
  name: "requestType",
7571
7623
  control: control,
7572
7624
  render: function(param) {
@@ -7597,7 +7649,7 @@ var FeedbackForm = function(param) {
7597
7649
  helperText: formState.errors.requestType && ((_formState_errors_requestType = formState.errors.requestType) === null || _formState_errors_requestType === void 0 ? void 0 : _formState_errors_requestType.message)
7598
7650
  }));
7599
7651
  }
7600
- }), /* @__PURE__ */ import_react43.default.createElement(Label, null, "Description:"), /* @__PURE__ */ import_react43.default.createElement(import_react_hook_form6.Controller, {
7652
+ }), /* @__PURE__ */ import_react43.default.createElement(Label, null, props.texts.description), /* @__PURE__ */ import_react43.default.createElement(import_react_hook_form7.Controller, {
7601
7653
  name: "description",
7602
7654
  control: control,
7603
7655
  render: function(param) {
@@ -7609,7 +7661,7 @@ var FeedbackForm = function(param) {
7609
7661
  }
7610
7662
  }), /* @__PURE__ */ import_react43.default.createElement(Button, {
7611
7663
  type: "submit"
7612
- }, "Submit"))));
7664
+ }, (_props_texts1 = props.texts) === null || _props_texts1 === void 0 ? void 0 : _props_texts1.submit))));
7613
7665
  };
7614
7666
  // components/blocks/misc/LegalTexts.tsx
7615
7667
  var import_react44 = __toESM(require("react"));
@@ -7698,10 +7750,10 @@ var Testimonial = function(props) {
7698
7750
  };
7699
7751
  // components/blocks/misc/LeadGenerator.tsx
7700
7752
  var import_react47 = __toESM(require("react"));
7701
- var import_react_hook_form7 = require("react-hook-form");
7753
+ var import_react_hook_form8 = require("react-hook-form");
7702
7754
  var LeadGenerator = function(param) {
7703
7755
  var texts = param.texts, submitHandler = param.submitHandler;
7704
- var _ref = (0, import_react_hook_form7.useForm)(), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
7756
+ var _ref = (0, import_react_hook_form8.useForm)(), handleSubmit = _ref.handleSubmit, control = _ref.control, formState = _ref.formState;
7705
7757
  var onSubmit = function(data) {
7706
7758
  if (submitHandler) {
7707
7759
  submitHandler(data.email);
@@ -7713,7 +7765,7 @@ var LeadGenerator = function(param) {
7713
7765
  return /* @__PURE__ */ import_react47.default.createElement(Card, null, /* @__PURE__ */ import_react47.default.createElement(CardHeader, null, /* @__PURE__ */ import_react47.default.createElement(CardTitle, null, texts === null || texts === void 0 ? void 0 : texts.title), /* @__PURE__ */ import_react47.default.createElement(CardDescription, null, texts === null || texts === void 0 ? void 0 : texts.subtitle)), /* @__PURE__ */ import_react47.default.createElement(CardContent, null, /* @__PURE__ */ import_react47.default.createElement("form", {
7714
7766
  className: "hawa-flex hawa-flex-row hawa-gap-2",
7715
7767
  onSubmit: handleSubmit(onSubmit)
7716
- }, /* @__PURE__ */ import_react47.default.createElement(import_react_hook_form7.Controller, {
7768
+ }, /* @__PURE__ */ import_react47.default.createElement(import_react_hook_form8.Controller, {
7717
7769
  name: "email",
7718
7770
  control: control,
7719
7771
  rules: {