@sikka/hawa 0.49.11-next → 0.49.13-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.
@@ -2764,7 +2764,7 @@ var Input = (0, import_react11.forwardRef)(
2764
2764
  className: cn(
2765
2765
  defaultInputStyle,
2766
2766
  "focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
2767
- props.alwaysLTR ? {
2767
+ props.alwaysLTR && props.dir === "rtl" ? {
2768
2768
  "hawa-ps-9": props.endIcon,
2769
2769
  "hawa-pe-9": props.startIcon,
2770
2770
  "hawa-ps-[60px]": countPosition === "center"
@@ -6861,19 +6861,19 @@ var PhoneInput = ({
6861
6861
  var React50 = __toESM(require("react"));
6862
6862
  var import_input_otp = require("input-otp");
6863
6863
 
6864
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
6864
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
6865
6865
  var import_react41 = require("react");
6866
6866
 
6867
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
6867
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
6868
6868
  var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
6869
6869
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
6870
6870
  return Boolean(className) && array.indexOf(className) === index;
6871
6871
  }).join(" ");
6872
6872
 
6873
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
6873
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
6874
6874
  var import_react40 = require("react");
6875
6875
 
6876
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
6876
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
6877
6877
  var defaultAttributes = {
6878
6878
  xmlns: "http://www.w3.org/2000/svg",
6879
6879
  width: 24,
@@ -6886,7 +6886,7 @@ var defaultAttributes = {
6886
6886
  strokeLinejoin: "round"
6887
6887
  };
6888
6888
 
6889
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
6889
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
6890
6890
  var Icon = (0, import_react40.forwardRef)(
6891
6891
  ({
6892
6892
  color = "currentColor",
@@ -6918,7 +6918,7 @@ var Icon = (0, import_react40.forwardRef)(
6918
6918
  }
6919
6919
  );
6920
6920
 
6921
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
6921
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
6922
6922
  var createLucideIcon = (iconName, iconNode) => {
6923
6923
  const Component = (0, import_react41.forwardRef)(
6924
6924
  ({ className, ...props }, ref) => (0, import_react41.createElement)(Icon, {
@@ -6932,7 +6932,7 @@ var createLucideIcon = (iconName, iconNode) => {
6932
6932
  return Component;
6933
6933
  };
6934
6934
 
6935
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
6935
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
6936
6936
  var Dot = createLucideIcon("Dot", [
6937
6937
  ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
6938
6938
  ]);
@@ -8387,7 +8387,7 @@ var PhoneMockup = ({
8387
8387
 
8388
8388
  lucide-react/dist/esm/shared/src/utils.js:
8389
8389
  (**
8390
- * @license lucide-react v0.436.0 - ISC
8390
+ * @license lucide-react v0.438.0 - ISC
8391
8391
  *
8392
8392
  * This source code is licensed under the ISC license.
8393
8393
  * See the LICENSE file in the root directory of this source tree.
@@ -8395,7 +8395,7 @@ lucide-react/dist/esm/shared/src/utils.js:
8395
8395
 
8396
8396
  lucide-react/dist/esm/defaultAttributes.js:
8397
8397
  (**
8398
- * @license lucide-react v0.436.0 - ISC
8398
+ * @license lucide-react v0.438.0 - ISC
8399
8399
  *
8400
8400
  * This source code is licensed under the ISC license.
8401
8401
  * See the LICENSE file in the root directory of this source tree.
@@ -8403,7 +8403,7 @@ lucide-react/dist/esm/defaultAttributes.js:
8403
8403
 
8404
8404
  lucide-react/dist/esm/Icon.js:
8405
8405
  (**
8406
- * @license lucide-react v0.436.0 - ISC
8406
+ * @license lucide-react v0.438.0 - ISC
8407
8407
  *
8408
8408
  * This source code is licensed under the ISC license.
8409
8409
  * See the LICENSE file in the root directory of this source tree.
@@ -8411,7 +8411,7 @@ lucide-react/dist/esm/Icon.js:
8411
8411
 
8412
8412
  lucide-react/dist/esm/createLucideIcon.js:
8413
8413
  (**
8414
- * @license lucide-react v0.436.0 - ISC
8414
+ * @license lucide-react v0.438.0 - ISC
8415
8415
  *
8416
8416
  * This source code is licensed under the ISC license.
8417
8417
  * See the LICENSE file in the root directory of this source tree.
@@ -8419,7 +8419,7 @@ lucide-react/dist/esm/createLucideIcon.js:
8419
8419
 
8420
8420
  lucide-react/dist/esm/icons/dot.js:
8421
8421
  (**
8422
- * @license lucide-react v0.436.0 - ISC
8422
+ * @license lucide-react v0.438.0 - ISC
8423
8423
  *
8424
8424
  * This source code is licensed under the ISC license.
8425
8425
  * See the LICENSE file in the root directory of this source tree.
@@ -8427,7 +8427,7 @@ lucide-react/dist/esm/icons/dot.js:
8427
8427
 
8428
8428
  lucide-react/dist/esm/lucide-react.js:
8429
8429
  (**
8430
- * @license lucide-react v0.436.0 - ISC
8430
+ * @license lucide-react v0.438.0 - ISC
8431
8431
  *
8432
8432
  * This source code is licensed under the ISC license.
8433
8433
  * See the LICENSE file in the root directory of this source tree.
@@ -26,7 +26,7 @@ import {
26
26
  TabsList,
27
27
  TabsTrigger,
28
28
  Textarea
29
- } from "../chunk-2IGBXSJF.mjs";
29
+ } from "../chunk-XWNN7K63.mjs";
30
30
  import {
31
31
  useClipboard
32
32
  } from "../chunk-WQR4XZGL.mjs";
package/dist/index.d.mts CHANGED
@@ -1900,6 +1900,7 @@ type TConfirmation = {
1900
1900
  showError?: any;
1901
1901
  errorTitle?: any;
1902
1902
  errorText?: any;
1903
+ direction?: "ltr" | "rtl";
1903
1904
  identifier?: string;
1904
1905
  confirmLoading?: boolean;
1905
1906
  onConfirm?: any;
@@ -1907,6 +1908,7 @@ type TConfirmation = {
1907
1908
  onCancel?: any;
1908
1909
  cardless?: boolean;
1909
1910
  codeLength?: number;
1911
+ autoSubmit?: boolean;
1910
1912
  };
1911
1913
  declare const CodeConfirmation: FC<TConfirmation>;
1912
1914
 
package/dist/index.d.ts CHANGED
@@ -1900,6 +1900,7 @@ type TConfirmation = {
1900
1900
  showError?: any;
1901
1901
  errorTitle?: any;
1902
1902
  errorText?: any;
1903
+ direction?: "ltr" | "rtl";
1903
1904
  identifier?: string;
1904
1905
  confirmLoading?: boolean;
1905
1906
  onConfirm?: any;
@@ -1907,6 +1908,7 @@ type TConfirmation = {
1907
1908
  onCancel?: any;
1908
1909
  cardless?: boolean;
1909
1910
  codeLength?: number;
1911
+ autoSubmit?: boolean;
1910
1912
  };
1911
1913
  declare const CodeConfirmation: FC<TConfirmation>;
1912
1914
 
package/dist/index.js CHANGED
@@ -2839,7 +2839,7 @@ var Input = (0, import_react11.forwardRef)(
2839
2839
  className: cn(
2840
2840
  defaultInputStyle,
2841
2841
  "focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
2842
- props.alwaysLTR ? {
2842
+ props.alwaysLTR && props.dir === "rtl" ? {
2843
2843
  "hawa-ps-9": props.endIcon,
2844
2844
  "hawa-pe-9": props.startIcon,
2845
2845
  "hawa-ps-[60px]": countPosition === "center"
@@ -7375,19 +7375,19 @@ var PhoneInput = ({
7375
7375
  var React50 = __toESM(require("react"));
7376
7376
  var import_input_otp = require("input-otp");
7377
7377
 
7378
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7378
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7379
7379
  var import_react41 = require("react");
7380
7380
 
7381
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7381
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7382
7382
  var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
7383
7383
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
7384
7384
  return Boolean(className) && array.indexOf(className) === index;
7385
7385
  }).join(" ");
7386
7386
 
7387
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7387
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7388
7388
  var import_react40 = require("react");
7389
7389
 
7390
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7390
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7391
7391
  var defaultAttributes = {
7392
7392
  xmlns: "http://www.w3.org/2000/svg",
7393
7393
  width: 24,
@@ -7400,7 +7400,7 @@ var defaultAttributes = {
7400
7400
  strokeLinejoin: "round"
7401
7401
  };
7402
7402
 
7403
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7403
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7404
7404
  var Icon = (0, import_react40.forwardRef)(
7405
7405
  ({
7406
7406
  color = "currentColor",
@@ -7432,7 +7432,7 @@ var Icon = (0, import_react40.forwardRef)(
7432
7432
  }
7433
7433
  );
7434
7434
 
7435
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7435
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7436
7436
  var createLucideIcon = (iconName, iconNode) => {
7437
7437
  const Component = (0, import_react41.forwardRef)(
7438
7438
  ({ className, ...props }, ref) => (0, import_react41.createElement)(Icon, {
@@ -7446,7 +7446,7 @@ var createLucideIcon = (iconName, iconNode) => {
7446
7446
  return Component;
7447
7447
  };
7448
7448
 
7449
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
7449
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
7450
7450
  var Dot = createLucideIcon("Dot", [
7451
7451
  ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
7452
7452
  ]);
@@ -11285,7 +11285,11 @@ var import_react74 = __toESM(require("react"));
11285
11285
  var import_react_hook_form5 = require("react-hook-form");
11286
11286
  var import_zod5 = require("@hookform/resolvers/zod");
11287
11287
  var z5 = __toESM(require("zod"));
11288
- var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11288
+ var CodeConfirmation = ({
11289
+ autoSubmit = false,
11290
+ codeLength = 6,
11291
+ ...props
11292
+ }) => {
11289
11293
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
11290
11294
  const formSchema = z5.object({
11291
11295
  otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
@@ -11324,6 +11328,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11324
11328
  }
11325
11329
  };
11326
11330
  }, []);
11331
+ const otpCode = (0, import_react_hook_form5.useWatch)({ control, name: "otp_code" });
11332
+ (0, import_react74.useEffect)(() => {
11333
+ if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
11334
+ handleSubmit((e) => {
11335
+ if (props.onConfirm) {
11336
+ return props.onConfirm(e);
11337
+ } else {
11338
+ console.log("Form is submitted but onConfirm prop is missing");
11339
+ }
11340
+ })();
11341
+ }
11342
+ }, [otpCode, autoSubmit, codeLength]);
11327
11343
  return /* @__PURE__ */ import_react74.default.createElement(
11328
11344
  Card,
11329
11345
  {
@@ -11331,7 +11347,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11331
11347
  props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
11332
11348
  )
11333
11349
  },
11334
- /* @__PURE__ */ import_react74.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react74.default.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react74.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react74.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react74.default.createElement(
11350
+ /* @__PURE__ */ import_react74.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react74.default.createElement(
11351
+ Alert,
11352
+ {
11353
+ direction: props.direction || "ltr",
11354
+ title: props.errorTitle,
11355
+ text: props.errorText,
11356
+ severity: "error"
11357
+ }
11358
+ ), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react74.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react74.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react74.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react74.default.createElement(
11335
11359
  "form",
11336
11360
  {
11337
11361
  noValidate: true,
@@ -13071,7 +13095,7 @@ var Usage = (props) => {
13071
13095
 
13072
13096
  lucide-react/dist/esm/shared/src/utils.js:
13073
13097
  (**
13074
- * @license lucide-react v0.436.0 - ISC
13098
+ * @license lucide-react v0.438.0 - ISC
13075
13099
  *
13076
13100
  * This source code is licensed under the ISC license.
13077
13101
  * See the LICENSE file in the root directory of this source tree.
@@ -13079,7 +13103,7 @@ lucide-react/dist/esm/shared/src/utils.js:
13079
13103
 
13080
13104
  lucide-react/dist/esm/defaultAttributes.js:
13081
13105
  (**
13082
- * @license lucide-react v0.436.0 - ISC
13106
+ * @license lucide-react v0.438.0 - ISC
13083
13107
  *
13084
13108
  * This source code is licensed under the ISC license.
13085
13109
  * See the LICENSE file in the root directory of this source tree.
@@ -13087,7 +13111,7 @@ lucide-react/dist/esm/defaultAttributes.js:
13087
13111
 
13088
13112
  lucide-react/dist/esm/Icon.js:
13089
13113
  (**
13090
- * @license lucide-react v0.436.0 - ISC
13114
+ * @license lucide-react v0.438.0 - ISC
13091
13115
  *
13092
13116
  * This source code is licensed under the ISC license.
13093
13117
  * See the LICENSE file in the root directory of this source tree.
@@ -13095,7 +13119,7 @@ lucide-react/dist/esm/Icon.js:
13095
13119
 
13096
13120
  lucide-react/dist/esm/createLucideIcon.js:
13097
13121
  (**
13098
- * @license lucide-react v0.436.0 - ISC
13122
+ * @license lucide-react v0.438.0 - ISC
13099
13123
  *
13100
13124
  * This source code is licensed under the ISC license.
13101
13125
  * See the LICENSE file in the root directory of this source tree.
@@ -13103,7 +13127,7 @@ lucide-react/dist/esm/createLucideIcon.js:
13103
13127
 
13104
13128
  lucide-react/dist/esm/icons/dot.js:
13105
13129
  (**
13106
- * @license lucide-react v0.436.0 - ISC
13130
+ * @license lucide-react v0.438.0 - ISC
13107
13131
  *
13108
13132
  * This source code is licensed under the ISC license.
13109
13133
  * See the LICENSE file in the root directory of this source tree.
@@ -13111,7 +13135,7 @@ lucide-react/dist/esm/icons/dot.js:
13111
13135
 
13112
13136
  lucide-react/dist/esm/lucide-react.js:
13113
13137
  (**
13114
- * @license lucide-react v0.436.0 - ISC
13138
+ * @license lucide-react v0.438.0 - ISC
13115
13139
  *
13116
13140
  * This source code is licensed under the ISC license.
13117
13141
  * See the LICENSE file in the root directory of this source tree.
package/dist/index.mjs CHANGED
@@ -2595,7 +2595,7 @@ var Input = forwardRef13(
2595
2595
  className: cn(
2596
2596
  defaultInputStyle,
2597
2597
  "focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
2598
- props.alwaysLTR ? {
2598
+ props.alwaysLTR && props.dir === "rtl" ? {
2599
2599
  "hawa-ps-9": props.endIcon,
2600
2600
  "hawa-pe-9": props.startIcon,
2601
2601
  "hawa-ps-[60px]": countPosition === "center"
@@ -7131,19 +7131,19 @@ var PhoneInput = ({
7131
7131
  import * as React50 from "react";
7132
7132
  import { OTPInput, OTPInputContext } from "input-otp";
7133
7133
 
7134
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7134
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7135
7135
  import { forwardRef as forwardRef25, createElement as createElement24 } from "react";
7136
7136
 
7137
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7137
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
7138
7138
  var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
7139
7139
  var mergeClasses = (...classes) => classes.filter((className, index, array) => {
7140
7140
  return Boolean(className) && array.indexOf(className) === index;
7141
7141
  }).join(" ");
7142
7142
 
7143
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7143
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7144
7144
  import { forwardRef as forwardRef24, createElement as createElement23 } from "react";
7145
7145
 
7146
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7146
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
7147
7147
  var defaultAttributes = {
7148
7148
  xmlns: "http://www.w3.org/2000/svg",
7149
7149
  width: 24,
@@ -7156,7 +7156,7 @@ var defaultAttributes = {
7156
7156
  strokeLinejoin: "round"
7157
7157
  };
7158
7158
 
7159
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7159
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
7160
7160
  var Icon = forwardRef24(
7161
7161
  ({
7162
7162
  color = "currentColor",
@@ -7188,7 +7188,7 @@ var Icon = forwardRef24(
7188
7188
  }
7189
7189
  );
7190
7190
 
7191
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7191
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
7192
7192
  var createLucideIcon = (iconName, iconNode) => {
7193
7193
  const Component = forwardRef25(
7194
7194
  ({ className, ...props }, ref) => createElement24(Icon, {
@@ -7202,7 +7202,7 @@ var createLucideIcon = (iconName, iconNode) => {
7202
7202
  return Component;
7203
7203
  };
7204
7204
 
7205
- // ../../node_modules/.pnpm/lucide-react@0.436.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
7205
+ // ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
7206
7206
  var Dot = createLucideIcon("Dot", [
7207
7207
  ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
7208
7208
  ]);
@@ -11052,10 +11052,14 @@ var ResetPasswordForm = ({
11052
11052
 
11053
11053
  // blocks/auth/CodeConfirmation.tsx
11054
11054
  import React88, { useEffect as useEffect34, useState as useState43 } from "react";
11055
- import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
11055
+ import { Controller as Controller5, useForm as useForm5, useWatch } from "react-hook-form";
11056
11056
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
11057
11057
  import * as z5 from "zod";
11058
- var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11058
+ var CodeConfirmation = ({
11059
+ autoSubmit = false,
11060
+ codeLength = 6,
11061
+ ...props
11062
+ }) => {
11059
11063
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
11060
11064
  const formSchema = z5.object({
11061
11065
  otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(codeLength, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
@@ -11094,6 +11098,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11094
11098
  }
11095
11099
  };
11096
11100
  }, []);
11101
+ const otpCode = useWatch({ control, name: "otp_code" });
11102
+ useEffect34(() => {
11103
+ if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
11104
+ handleSubmit((e) => {
11105
+ if (props.onConfirm) {
11106
+ return props.onConfirm(e);
11107
+ } else {
11108
+ console.log("Form is submitted but onConfirm prop is missing");
11109
+ }
11110
+ })();
11111
+ }
11112
+ }, [otpCode, autoSubmit, codeLength]);
11097
11113
  return /* @__PURE__ */ React88.createElement(
11098
11114
  Card,
11099
11115
  {
@@ -11101,7 +11117,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
11101
11117
  props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
11102
11118
  )
11103
11119
  },
11104
- /* @__PURE__ */ React88.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React88.createElement(Alert, { title: props.errorTitle, text: props.errorText, severity: "error" }), /* @__PURE__ */ React88.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React88.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React88.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ React88.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ React88.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ React88.createElement(
11120
+ /* @__PURE__ */ React88.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React88.createElement(
11121
+ Alert,
11122
+ {
11123
+ direction: props.direction || "ltr",
11124
+ title: props.errorTitle,
11125
+ text: props.errorText,
11126
+ severity: "error"
11127
+ }
11128
+ ), /* @__PURE__ */ React88.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React88.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React88.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ React88.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ React88.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ React88.createElement(
11105
11129
  "form",
11106
11130
  {
11107
11131
  noValidate: true,
@@ -12840,7 +12864,7 @@ export {
12840
12864
 
12841
12865
  lucide-react/dist/esm/shared/src/utils.js:
12842
12866
  (**
12843
- * @license lucide-react v0.436.0 - ISC
12867
+ * @license lucide-react v0.438.0 - ISC
12844
12868
  *
12845
12869
  * This source code is licensed under the ISC license.
12846
12870
  * See the LICENSE file in the root directory of this source tree.
@@ -12848,7 +12872,7 @@ lucide-react/dist/esm/shared/src/utils.js:
12848
12872
 
12849
12873
  lucide-react/dist/esm/defaultAttributes.js:
12850
12874
  (**
12851
- * @license lucide-react v0.436.0 - ISC
12875
+ * @license lucide-react v0.438.0 - ISC
12852
12876
  *
12853
12877
  * This source code is licensed under the ISC license.
12854
12878
  * See the LICENSE file in the root directory of this source tree.
@@ -12856,7 +12880,7 @@ lucide-react/dist/esm/defaultAttributes.js:
12856
12880
 
12857
12881
  lucide-react/dist/esm/Icon.js:
12858
12882
  (**
12859
- * @license lucide-react v0.436.0 - ISC
12883
+ * @license lucide-react v0.438.0 - ISC
12860
12884
  *
12861
12885
  * This source code is licensed under the ISC license.
12862
12886
  * See the LICENSE file in the root directory of this source tree.
@@ -12864,7 +12888,7 @@ lucide-react/dist/esm/Icon.js:
12864
12888
 
12865
12889
  lucide-react/dist/esm/createLucideIcon.js:
12866
12890
  (**
12867
- * @license lucide-react v0.436.0 - ISC
12891
+ * @license lucide-react v0.438.0 - ISC
12868
12892
  *
12869
12893
  * This source code is licensed under the ISC license.
12870
12894
  * See the LICENSE file in the root directory of this source tree.
@@ -12872,7 +12896,7 @@ lucide-react/dist/esm/createLucideIcon.js:
12872
12896
 
12873
12897
  lucide-react/dist/esm/icons/dot.js:
12874
12898
  (**
12875
- * @license lucide-react v0.436.0 - ISC
12899
+ * @license lucide-react v0.438.0 - ISC
12876
12900
  *
12877
12901
  * This source code is licensed under the ISC license.
12878
12902
  * See the LICENSE file in the root directory of this source tree.
@@ -12880,7 +12904,7 @@ lucide-react/dist/esm/icons/dot.js:
12880
12904
 
12881
12905
  lucide-react/dist/esm/lucide-react.js:
12882
12906
  (**
12883
- * @license lucide-react v0.436.0 - ISC
12907
+ * @license lucide-react v0.438.0 - ISC
12884
12908
  *
12885
12909
  * This source code is licensed under the ISC license.
12886
12910
  * See the LICENSE file in the root directory of this source tree.
@@ -341,7 +341,7 @@ var Input = (0, import_react4.forwardRef)(
341
341
  className: cn(
342
342
  defaultInputStyle,
343
343
  "focus-visible:hawa-outline-none focus-visible:hawa-ring-2 focus-visible:hawa-ring-ring focus-visible:hawa-ring-offset-0 dark:hawa-text-white",
344
- props.alwaysLTR ? {
344
+ props.alwaysLTR && props.dir === "rtl" ? {
345
345
  "hawa-ps-9": props.endIcon,
346
346
  "hawa-pe-9": props.startIcon,
347
347
  "hawa-ps-[60px]": countPosition === "center"