@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.
- package/dist/blocks/auth/index.d.mts +2 -0
- package/dist/blocks/auth/index.d.ts +2 -0
- package/dist/blocks/auth/index.js +40 -16
- package/dist/blocks/auth/index.mjs +41 -17
- package/dist/blocks/index.d.mts +2 -0
- package/dist/blocks/index.d.ts +2 -0
- package/dist/blocks/index.js +40 -16
- package/dist/blocks/index.mjs +28 -4
- package/dist/blocks/misc/index.js +1 -1
- package/dist/blocks/misc/index.mjs +1 -1
- package/dist/{chunk-Z6S6PTPG.mjs → chunk-AQXHMINT.mjs} +1 -1
- package/dist/{chunk-2IGBXSJF.mjs → chunk-XWNN7K63.mjs} +14 -14
- package/dist/dataTable/index.js +1 -1
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +1 -1
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/elements/index.js +14 -14
- package/dist/elements/index.mjs +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -16
- package/dist/index.mjs +41 -17
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/input/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +1 -1
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +1 -1
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +13 -13
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +13 -13
- package/dist/pinInput/index.mjs.map +1 -1
- package/package.json +3 -3
@@ -298,6 +298,7 @@ type TConfirmation = {
|
|
298
298
|
showError?: any;
|
299
299
|
errorTitle?: any;
|
300
300
|
errorText?: any;
|
301
|
+
direction?: "ltr" | "rtl";
|
301
302
|
identifier?: string;
|
302
303
|
confirmLoading?: boolean;
|
303
304
|
onConfirm?: any;
|
@@ -305,6 +306,7 @@ type TConfirmation = {
|
|
305
306
|
onCancel?: any;
|
306
307
|
cardless?: boolean;
|
307
308
|
codeLength?: number;
|
309
|
+
autoSubmit?: boolean;
|
308
310
|
};
|
309
311
|
declare const CodeConfirmation: FC<TConfirmation>;
|
310
312
|
|
@@ -298,6 +298,7 @@ type TConfirmation = {
|
|
298
298
|
showError?: any;
|
299
299
|
errorTitle?: any;
|
300
300
|
errorText?: any;
|
301
|
+
direction?: "ltr" | "rtl";
|
301
302
|
identifier?: string;
|
302
303
|
confirmLoading?: boolean;
|
303
304
|
onConfirm?: any;
|
@@ -305,6 +306,7 @@ type TConfirmation = {
|
|
305
306
|
onCancel?: any;
|
306
307
|
cardless?: boolean;
|
307
308
|
codeLength?: number;
|
309
|
+
autoSubmit?: boolean;
|
308
310
|
};
|
309
311
|
declare const CodeConfirmation: FC<TConfirmation>;
|
310
312
|
|
@@ -1355,7 +1355,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1355
1355
|
className: cn(
|
1356
1356
|
defaultInputStyle,
|
1357
1357
|
"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",
|
1358
|
-
props.alwaysLTR ? {
|
1358
|
+
props.alwaysLTR && props.dir === "rtl" ? {
|
1359
1359
|
"hawa-ps-9": props.endIcon,
|
1360
1360
|
"hawa-pe-9": props.startIcon,
|
1361
1361
|
"hawa-ps-[60px]": countPosition === "center"
|
@@ -5049,19 +5049,19 @@ var z5 = __toESM(require("zod"));
|
|
5049
5049
|
var React36 = __toESM(require("react"));
|
5050
5050
|
var import_input_otp = require("input-otp");
|
5051
5051
|
|
5052
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5052
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
5053
5053
|
var import_react43 = require("react");
|
5054
5054
|
|
5055
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5055
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
5056
5056
|
var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
5057
5057
|
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
5058
5058
|
return Boolean(className) && array.indexOf(className) === index;
|
5059
5059
|
}).join(" ");
|
5060
5060
|
|
5061
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5061
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
5062
5062
|
var import_react42 = require("react");
|
5063
5063
|
|
5064
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5064
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
5065
5065
|
var defaultAttributes = {
|
5066
5066
|
xmlns: "http://www.w3.org/2000/svg",
|
5067
5067
|
width: 24,
|
@@ -5074,7 +5074,7 @@ var defaultAttributes = {
|
|
5074
5074
|
strokeLinejoin: "round"
|
5075
5075
|
};
|
5076
5076
|
|
5077
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5077
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
5078
5078
|
var Icon = (0, import_react42.forwardRef)(
|
5079
5079
|
({
|
5080
5080
|
color = "currentColor",
|
@@ -5106,7 +5106,7 @@ var Icon = (0, import_react42.forwardRef)(
|
|
5106
5106
|
}
|
5107
5107
|
);
|
5108
5108
|
|
5109
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5109
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
5110
5110
|
var createLucideIcon = (iconName, iconNode) => {
|
5111
5111
|
const Component = (0, import_react43.forwardRef)(
|
5112
5112
|
({ className, ...props }, ref) => (0, import_react43.createElement)(Icon, {
|
@@ -5120,7 +5120,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
5120
5120
|
return Component;
|
5121
5121
|
};
|
5122
5122
|
|
5123
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5123
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
5124
5124
|
var Dot = createLucideIcon("Dot", [
|
5125
5125
|
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
5126
5126
|
]);
|
@@ -5178,7 +5178,11 @@ var PinInput = ({ separatorPosition = 0, ...props }) => {
|
|
5178
5178
|
};
|
5179
5179
|
|
5180
5180
|
// blocks/auth/CodeConfirmation.tsx
|
5181
|
-
var CodeConfirmation = ({
|
5181
|
+
var CodeConfirmation = ({
|
5182
|
+
autoSubmit = false,
|
5183
|
+
codeLength = 6,
|
5184
|
+
...props
|
5185
|
+
}) => {
|
5182
5186
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
5183
5187
|
const formSchema = z5.object({
|
5184
5188
|
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 })
|
@@ -5217,6 +5221,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5217
5221
|
}
|
5218
5222
|
};
|
5219
5223
|
}, []);
|
5224
|
+
const otpCode = (0, import_react_hook_form5.useWatch)({ control, name: "otp_code" });
|
5225
|
+
(0, import_react44.useEffect)(() => {
|
5226
|
+
if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
|
5227
|
+
handleSubmit((e) => {
|
5228
|
+
if (props.onConfirm) {
|
5229
|
+
return props.onConfirm(e);
|
5230
|
+
} else {
|
5231
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
5232
|
+
}
|
5233
|
+
})();
|
5234
|
+
}
|
5235
|
+
}, [otpCode, autoSubmit, codeLength]);
|
5220
5236
|
return /* @__PURE__ */ import_react44.default.createElement(
|
5221
5237
|
Card,
|
5222
5238
|
{
|
@@ -5224,7 +5240,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5224
5240
|
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
5225
5241
|
)
|
5226
5242
|
},
|
5227
|
-
/* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react44.default.createElement(
|
5243
|
+
/* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react44.default.createElement(
|
5244
|
+
Alert,
|
5245
|
+
{
|
5246
|
+
direction: props.direction || "ltr",
|
5247
|
+
title: props.errorTitle,
|
5248
|
+
text: props.errorText,
|
5249
|
+
severity: "error"
|
5250
|
+
}
|
5251
|
+
), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react44.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react44.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react44.default.createElement(
|
5228
5252
|
"form",
|
5229
5253
|
{
|
5230
5254
|
noValidate: true,
|
@@ -5298,7 +5322,7 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5298
5322
|
|
5299
5323
|
lucide-react/dist/esm/shared/src/utils.js:
|
5300
5324
|
(**
|
5301
|
-
* @license lucide-react v0.
|
5325
|
+
* @license lucide-react v0.438.0 - ISC
|
5302
5326
|
*
|
5303
5327
|
* This source code is licensed under the ISC license.
|
5304
5328
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5306,7 +5330,7 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
5306
5330
|
|
5307
5331
|
lucide-react/dist/esm/defaultAttributes.js:
|
5308
5332
|
(**
|
5309
|
-
* @license lucide-react v0.
|
5333
|
+
* @license lucide-react v0.438.0 - ISC
|
5310
5334
|
*
|
5311
5335
|
* This source code is licensed under the ISC license.
|
5312
5336
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5314,7 +5338,7 @@ lucide-react/dist/esm/defaultAttributes.js:
|
|
5314
5338
|
|
5315
5339
|
lucide-react/dist/esm/Icon.js:
|
5316
5340
|
(**
|
5317
|
-
* @license lucide-react v0.
|
5341
|
+
* @license lucide-react v0.438.0 - ISC
|
5318
5342
|
*
|
5319
5343
|
* This source code is licensed under the ISC license.
|
5320
5344
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5322,7 +5346,7 @@ lucide-react/dist/esm/Icon.js:
|
|
5322
5346
|
|
5323
5347
|
lucide-react/dist/esm/createLucideIcon.js:
|
5324
5348
|
(**
|
5325
|
-
* @license lucide-react v0.
|
5349
|
+
* @license lucide-react v0.438.0 - ISC
|
5326
5350
|
*
|
5327
5351
|
* This source code is licensed under the ISC license.
|
5328
5352
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5330,7 +5354,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
5330
5354
|
|
5331
5355
|
lucide-react/dist/esm/icons/dot.js:
|
5332
5356
|
(**
|
5333
|
-
* @license lucide-react v0.
|
5357
|
+
* @license lucide-react v0.438.0 - ISC
|
5334
5358
|
*
|
5335
5359
|
* This source code is licensed under the ISC license.
|
5336
5360
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5338,7 +5362,7 @@ lucide-react/dist/esm/icons/dot.js:
|
|
5338
5362
|
|
5339
5363
|
lucide-react/dist/esm/lucide-react.js:
|
5340
5364
|
(**
|
5341
|
-
* @license lucide-react v0.
|
5365
|
+
* @license lucide-react v0.438.0 - ISC
|
5342
5366
|
*
|
5343
5367
|
* This source code is licensed under the ISC license.
|
5344
5368
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -5,7 +5,7 @@ import {
|
|
5
5
|
TabsContent,
|
6
6
|
TabsList,
|
7
7
|
TabsTrigger
|
8
|
-
} from "../../chunk-
|
8
|
+
} from "../../chunk-AQXHMINT.mjs";
|
9
9
|
import {
|
10
10
|
StopPropagationWrapper
|
11
11
|
} from "../../chunk-47APBDKK.mjs";
|
@@ -3663,7 +3663,7 @@ var ResetPasswordForm = ({
|
|
3663
3663
|
|
3664
3664
|
// blocks/auth/CodeConfirmation.tsx
|
3665
3665
|
import React13, { useEffect as useEffect3, useState as useState5 } from "react";
|
3666
|
-
import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
|
3666
|
+
import { Controller as Controller5, useForm as useForm5, useWatch } from "react-hook-form";
|
3667
3667
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
3668
3668
|
import * as z5 from "zod";
|
3669
3669
|
|
@@ -3671,19 +3671,19 @@ import * as z5 from "zod";
|
|
3671
3671
|
import * as React12 from "react";
|
3672
3672
|
import { OTPInput, OTPInputContext } from "input-otp";
|
3673
3673
|
|
3674
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3674
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
3675
3675
|
import { forwardRef as forwardRef3, createElement as createElement3 } from "react";
|
3676
3676
|
|
3677
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3677
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
3678
3678
|
var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
3679
3679
|
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
3680
3680
|
return Boolean(className) && array.indexOf(className) === index;
|
3681
3681
|
}).join(" ");
|
3682
3682
|
|
3683
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3683
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
3684
3684
|
import { forwardRef as forwardRef2, createElement as createElement2 } from "react";
|
3685
3685
|
|
3686
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3686
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
3687
3687
|
var defaultAttributes = {
|
3688
3688
|
xmlns: "http://www.w3.org/2000/svg",
|
3689
3689
|
width: 24,
|
@@ -3696,7 +3696,7 @@ var defaultAttributes = {
|
|
3696
3696
|
strokeLinejoin: "round"
|
3697
3697
|
};
|
3698
3698
|
|
3699
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3699
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
3700
3700
|
var Icon = forwardRef2(
|
3701
3701
|
({
|
3702
3702
|
color = "currentColor",
|
@@ -3728,7 +3728,7 @@ var Icon = forwardRef2(
|
|
3728
3728
|
}
|
3729
3729
|
);
|
3730
3730
|
|
3731
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3731
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
3732
3732
|
var createLucideIcon = (iconName, iconNode) => {
|
3733
3733
|
const Component = forwardRef3(
|
3734
3734
|
({ className, ...props }, ref) => createElement3(Icon, {
|
@@ -3742,7 +3742,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
3742
3742
|
return Component;
|
3743
3743
|
};
|
3744
3744
|
|
3745
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
3745
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
3746
3746
|
var Dot = createLucideIcon("Dot", [
|
3747
3747
|
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
3748
3748
|
]);
|
@@ -3800,7 +3800,11 @@ var PinInput = ({ separatorPosition = 0, ...props }) => {
|
|
3800
3800
|
};
|
3801
3801
|
|
3802
3802
|
// blocks/auth/CodeConfirmation.tsx
|
3803
|
-
var CodeConfirmation = ({
|
3803
|
+
var CodeConfirmation = ({
|
3804
|
+
autoSubmit = false,
|
3805
|
+
codeLength = 6,
|
3806
|
+
...props
|
3807
|
+
}) => {
|
3804
3808
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
3805
3809
|
const formSchema = z5.object({
|
3806
3810
|
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 })
|
@@ -3839,6 +3843,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
3839
3843
|
}
|
3840
3844
|
};
|
3841
3845
|
}, []);
|
3846
|
+
const otpCode = useWatch({ control, name: "otp_code" });
|
3847
|
+
useEffect3(() => {
|
3848
|
+
if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
|
3849
|
+
handleSubmit((e) => {
|
3850
|
+
if (props.onConfirm) {
|
3851
|
+
return props.onConfirm(e);
|
3852
|
+
} else {
|
3853
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
3854
|
+
}
|
3855
|
+
})();
|
3856
|
+
}
|
3857
|
+
}, [otpCode, autoSubmit, codeLength]);
|
3842
3858
|
return /* @__PURE__ */ React13.createElement(
|
3843
3859
|
Card,
|
3844
3860
|
{
|
@@ -3846,7 +3862,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
3846
3862
|
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
3847
3863
|
)
|
3848
3864
|
},
|
3849
|
-
/* @__PURE__ */ React13.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React13.createElement(
|
3865
|
+
/* @__PURE__ */ React13.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React13.createElement(
|
3866
|
+
Alert,
|
3867
|
+
{
|
3868
|
+
direction: props.direction || "ltr",
|
3869
|
+
title: props.errorTitle,
|
3870
|
+
text: props.errorText,
|
3871
|
+
severity: "error"
|
3872
|
+
}
|
3873
|
+
), /* @__PURE__ */ React13.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React13.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ React13.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ React13.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ React13.createElement(
|
3850
3874
|
"form",
|
3851
3875
|
{
|
3852
3876
|
noValidate: true,
|
@@ -3919,7 +3943,7 @@ export {
|
|
3919
3943
|
|
3920
3944
|
lucide-react/dist/esm/shared/src/utils.js:
|
3921
3945
|
(**
|
3922
|
-
* @license lucide-react v0.
|
3946
|
+
* @license lucide-react v0.438.0 - ISC
|
3923
3947
|
*
|
3924
3948
|
* This source code is licensed under the ISC license.
|
3925
3949
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -3927,7 +3951,7 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
3927
3951
|
|
3928
3952
|
lucide-react/dist/esm/defaultAttributes.js:
|
3929
3953
|
(**
|
3930
|
-
* @license lucide-react v0.
|
3954
|
+
* @license lucide-react v0.438.0 - ISC
|
3931
3955
|
*
|
3932
3956
|
* This source code is licensed under the ISC license.
|
3933
3957
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -3935,7 +3959,7 @@ lucide-react/dist/esm/defaultAttributes.js:
|
|
3935
3959
|
|
3936
3960
|
lucide-react/dist/esm/Icon.js:
|
3937
3961
|
(**
|
3938
|
-
* @license lucide-react v0.
|
3962
|
+
* @license lucide-react v0.438.0 - ISC
|
3939
3963
|
*
|
3940
3964
|
* This source code is licensed under the ISC license.
|
3941
3965
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -3943,7 +3967,7 @@ lucide-react/dist/esm/Icon.js:
|
|
3943
3967
|
|
3944
3968
|
lucide-react/dist/esm/createLucideIcon.js:
|
3945
3969
|
(**
|
3946
|
-
* @license lucide-react v0.
|
3970
|
+
* @license lucide-react v0.438.0 - ISC
|
3947
3971
|
*
|
3948
3972
|
* This source code is licensed under the ISC license.
|
3949
3973
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -3951,7 +3975,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
3951
3975
|
|
3952
3976
|
lucide-react/dist/esm/icons/dot.js:
|
3953
3977
|
(**
|
3954
|
-
* @license lucide-react v0.
|
3978
|
+
* @license lucide-react v0.438.0 - ISC
|
3955
3979
|
*
|
3956
3980
|
* This source code is licensed under the ISC license.
|
3957
3981
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -3959,7 +3983,7 @@ lucide-react/dist/esm/icons/dot.js:
|
|
3959
3983
|
|
3960
3984
|
lucide-react/dist/esm/lucide-react.js:
|
3961
3985
|
(**
|
3962
|
-
* @license lucide-react v0.
|
3986
|
+
* @license lucide-react v0.438.0 - ISC
|
3963
3987
|
*
|
3964
3988
|
* This source code is licensed under the ISC license.
|
3965
3989
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/blocks/index.d.mts
CHANGED
@@ -275,6 +275,7 @@ type TConfirmation = {
|
|
275
275
|
showError?: any;
|
276
276
|
errorTitle?: any;
|
277
277
|
errorText?: any;
|
278
|
+
direction?: "ltr" | "rtl";
|
278
279
|
identifier?: string;
|
279
280
|
confirmLoading?: boolean;
|
280
281
|
onConfirm?: any;
|
@@ -282,6 +283,7 @@ type TConfirmation = {
|
|
282
283
|
onCancel?: any;
|
283
284
|
cardless?: boolean;
|
284
285
|
codeLength?: number;
|
286
|
+
autoSubmit?: boolean;
|
285
287
|
};
|
286
288
|
declare const CodeConfirmation: FC<TConfirmation>;
|
287
289
|
|
package/dist/blocks/index.d.ts
CHANGED
@@ -275,6 +275,7 @@ type TConfirmation = {
|
|
275
275
|
showError?: any;
|
276
276
|
errorTitle?: any;
|
277
277
|
errorText?: any;
|
278
|
+
direction?: "ltr" | "rtl";
|
278
279
|
identifier?: string;
|
279
280
|
confirmLoading?: boolean;
|
280
281
|
onConfirm?: any;
|
@@ -282,6 +283,7 @@ type TConfirmation = {
|
|
282
283
|
onCancel?: any;
|
283
284
|
cardless?: boolean;
|
284
285
|
codeLength?: number;
|
286
|
+
autoSubmit?: boolean;
|
285
287
|
};
|
286
288
|
declare const CodeConfirmation: FC<TConfirmation>;
|
287
289
|
|
package/dist/blocks/index.js
CHANGED
@@ -1376,7 +1376,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1376
1376
|
className: cn(
|
1377
1377
|
defaultInputStyle,
|
1378
1378
|
"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",
|
1379
|
-
props.alwaysLTR ? {
|
1379
|
+
props.alwaysLTR && props.dir === "rtl" ? {
|
1380
1380
|
"hawa-ps-9": props.endIcon,
|
1381
1381
|
"hawa-pe-9": props.startIcon,
|
1382
1382
|
"hawa-ps-[60px]": countPosition === "center"
|
@@ -5224,19 +5224,19 @@ var z5 = __toESM(require("zod"));
|
|
5224
5224
|
var React36 = __toESM(require("react"));
|
5225
5225
|
var import_input_otp = require("input-otp");
|
5226
5226
|
|
5227
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5227
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
5228
5228
|
var import_react43 = require("react");
|
5229
5229
|
|
5230
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5230
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
5231
5231
|
var toKebabCase = (string9) => string9.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
5232
5232
|
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
5233
5233
|
return Boolean(className) && array.indexOf(className) === index;
|
5234
5234
|
}).join(" ");
|
5235
5235
|
|
5236
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5236
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
5237
5237
|
var import_react42 = require("react");
|
5238
5238
|
|
5239
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5239
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
5240
5240
|
var defaultAttributes = {
|
5241
5241
|
xmlns: "http://www.w3.org/2000/svg",
|
5242
5242
|
width: 24,
|
@@ -5249,7 +5249,7 @@ var defaultAttributes = {
|
|
5249
5249
|
strokeLinejoin: "round"
|
5250
5250
|
};
|
5251
5251
|
|
5252
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5252
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
5253
5253
|
var Icon = (0, import_react42.forwardRef)(
|
5254
5254
|
({
|
5255
5255
|
color = "currentColor",
|
@@ -5281,7 +5281,7 @@ var Icon = (0, import_react42.forwardRef)(
|
|
5281
5281
|
}
|
5282
5282
|
);
|
5283
5283
|
|
5284
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5284
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
5285
5285
|
var createLucideIcon = (iconName, iconNode) => {
|
5286
5286
|
const Component = (0, import_react43.forwardRef)(
|
5287
5287
|
({ className, ...props }, ref) => (0, import_react43.createElement)(Icon, {
|
@@ -5295,7 +5295,7 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
5295
5295
|
return Component;
|
5296
5296
|
};
|
5297
5297
|
|
5298
|
-
// ../../node_modules/.pnpm/lucide-react@0.
|
5298
|
+
// ../../node_modules/.pnpm/lucide-react@0.438.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
5299
5299
|
var Dot = createLucideIcon("Dot", [
|
5300
5300
|
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
5301
5301
|
]);
|
@@ -5353,7 +5353,11 @@ var PinInput = ({ separatorPosition = 0, ...props }) => {
|
|
5353
5353
|
};
|
5354
5354
|
|
5355
5355
|
// blocks/auth/CodeConfirmation.tsx
|
5356
|
-
var CodeConfirmation = ({
|
5356
|
+
var CodeConfirmation = ({
|
5357
|
+
autoSubmit = false,
|
5358
|
+
codeLength = 6,
|
5359
|
+
...props
|
5360
|
+
}) => {
|
5357
5361
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
5358
5362
|
const formSchema = z5.object({
|
5359
5363
|
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 })
|
@@ -5392,6 +5396,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5392
5396
|
}
|
5393
5397
|
};
|
5394
5398
|
}, []);
|
5399
|
+
const otpCode = (0, import_react_hook_form5.useWatch)({ control, name: "otp_code" });
|
5400
|
+
(0, import_react44.useEffect)(() => {
|
5401
|
+
if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
|
5402
|
+
handleSubmit((e) => {
|
5403
|
+
if (props.onConfirm) {
|
5404
|
+
return props.onConfirm(e);
|
5405
|
+
} else {
|
5406
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
5407
|
+
}
|
5408
|
+
})();
|
5409
|
+
}
|
5410
|
+
}, [otpCode, autoSubmit, codeLength]);
|
5395
5411
|
return /* @__PURE__ */ import_react44.default.createElement(
|
5396
5412
|
Card,
|
5397
5413
|
{
|
@@ -5399,7 +5415,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
5399
5415
|
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
5400
5416
|
)
|
5401
5417
|
},
|
5402
|
-
/* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react44.default.createElement(
|
5418
|
+
/* @__PURE__ */ import_react44.default.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ import_react44.default.createElement(
|
5419
|
+
Alert,
|
5420
|
+
{
|
5421
|
+
direction: props.direction || "ltr",
|
5422
|
+
title: props.errorTitle,
|
5423
|
+
text: props.errorText,
|
5424
|
+
severity: "error"
|
5425
|
+
}
|
5426
|
+
), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ import_react44.default.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ import_react44.default.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ import_react44.default.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ import_react44.default.createElement(
|
5403
5427
|
"form",
|
5404
5428
|
{
|
5405
5429
|
noValidate: true,
|
@@ -7687,7 +7711,7 @@ var Usage = (props) => {
|
|
7687
7711
|
|
7688
7712
|
lucide-react/dist/esm/shared/src/utils.js:
|
7689
7713
|
(**
|
7690
|
-
* @license lucide-react v0.
|
7714
|
+
* @license lucide-react v0.438.0 - ISC
|
7691
7715
|
*
|
7692
7716
|
* This source code is licensed under the ISC license.
|
7693
7717
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7695,7 +7719,7 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
7695
7719
|
|
7696
7720
|
lucide-react/dist/esm/defaultAttributes.js:
|
7697
7721
|
(**
|
7698
|
-
* @license lucide-react v0.
|
7722
|
+
* @license lucide-react v0.438.0 - ISC
|
7699
7723
|
*
|
7700
7724
|
* This source code is licensed under the ISC license.
|
7701
7725
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7703,7 +7727,7 @@ lucide-react/dist/esm/defaultAttributes.js:
|
|
7703
7727
|
|
7704
7728
|
lucide-react/dist/esm/Icon.js:
|
7705
7729
|
(**
|
7706
|
-
* @license lucide-react v0.
|
7730
|
+
* @license lucide-react v0.438.0 - ISC
|
7707
7731
|
*
|
7708
7732
|
* This source code is licensed under the ISC license.
|
7709
7733
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7711,7 +7735,7 @@ lucide-react/dist/esm/Icon.js:
|
|
7711
7735
|
|
7712
7736
|
lucide-react/dist/esm/createLucideIcon.js:
|
7713
7737
|
(**
|
7714
|
-
* @license lucide-react v0.
|
7738
|
+
* @license lucide-react v0.438.0 - ISC
|
7715
7739
|
*
|
7716
7740
|
* This source code is licensed under the ISC license.
|
7717
7741
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7719,7 +7743,7 @@ lucide-react/dist/esm/createLucideIcon.js:
|
|
7719
7743
|
|
7720
7744
|
lucide-react/dist/esm/icons/dot.js:
|
7721
7745
|
(**
|
7722
|
-
* @license lucide-react v0.
|
7746
|
+
* @license lucide-react v0.438.0 - ISC
|
7723
7747
|
*
|
7724
7748
|
* This source code is licensed under the ISC license.
|
7725
7749
|
* See the LICENSE file in the root directory of this source tree.
|
@@ -7727,7 +7751,7 @@ lucide-react/dist/esm/icons/dot.js:
|
|
7727
7751
|
|
7728
7752
|
lucide-react/dist/esm/lucide-react.js:
|
7729
7753
|
(**
|
7730
|
-
* @license lucide-react v0.
|
7754
|
+
* @license lucide-react v0.438.0 - ISC
|
7731
7755
|
*
|
7732
7756
|
* This source code is licensed under the ISC license.
|
7733
7757
|
* See the LICENSE file in the root directory of this source tree.
|
package/dist/blocks/index.mjs
CHANGED
@@ -17,7 +17,7 @@ import {
|
|
17
17
|
TabsList,
|
18
18
|
TabsTrigger,
|
19
19
|
Textarea
|
20
|
-
} from "../chunk-
|
20
|
+
} from "../chunk-XWNN7K63.mjs";
|
21
21
|
import {
|
22
22
|
getHotkeyHandler
|
23
23
|
} from "../chunk-WQR4XZGL.mjs";
|
@@ -1253,10 +1253,14 @@ var ResetPasswordForm = ({
|
|
1253
1253
|
|
1254
1254
|
// blocks/auth/CodeConfirmation.tsx
|
1255
1255
|
import React8, { useEffect, useState as useState3 } from "react";
|
1256
|
-
import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
|
1256
|
+
import { Controller as Controller5, useForm as useForm5, useWatch } from "react-hook-form";
|
1257
1257
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
1258
1258
|
import * as z5 from "zod";
|
1259
|
-
var CodeConfirmation = ({
|
1259
|
+
var CodeConfirmation = ({
|
1260
|
+
autoSubmit = false,
|
1261
|
+
codeLength = 6,
|
1262
|
+
...props
|
1263
|
+
}) => {
|
1260
1264
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
1261
1265
|
const formSchema = z5.object({
|
1262
1266
|
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 })
|
@@ -1295,6 +1299,18 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
1295
1299
|
}
|
1296
1300
|
};
|
1297
1301
|
}, []);
|
1302
|
+
const otpCode = useWatch({ control, name: "otp_code" });
|
1303
|
+
useEffect(() => {
|
1304
|
+
if (autoSubmit && (otpCode == null ? void 0 : otpCode.length) === codeLength) {
|
1305
|
+
handleSubmit((e) => {
|
1306
|
+
if (props.onConfirm) {
|
1307
|
+
return props.onConfirm(e);
|
1308
|
+
} else {
|
1309
|
+
console.log("Form is submitted but onConfirm prop is missing");
|
1310
|
+
}
|
1311
|
+
})();
|
1312
|
+
}
|
1313
|
+
}, [otpCode, autoSubmit, codeLength]);
|
1298
1314
|
return /* @__PURE__ */ React8.createElement(
|
1299
1315
|
Card,
|
1300
1316
|
{
|
@@ -1302,7 +1318,15 @@ var CodeConfirmation = ({ codeLength = 6, ...props }) => {
|
|
1302
1318
|
props.cardless && "hawa-border-none hawa-bg-transparent !hawa-shadow-none !hawa-drop-shadow-none"
|
1303
1319
|
)
|
1304
1320
|
},
|
1305
|
-
/* @__PURE__ */ React8.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React8.createElement(
|
1321
|
+
/* @__PURE__ */ React8.createElement(CardContent, { headless: true, noPadding: props.cardless }, props.showError && /* @__PURE__ */ React8.createElement(
|
1322
|
+
Alert,
|
1323
|
+
{
|
1324
|
+
direction: props.direction || "ltr",
|
1325
|
+
title: props.errorTitle,
|
1326
|
+
text: props.errorText,
|
1327
|
+
severity: "error"
|
1328
|
+
}
|
1329
|
+
), /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourIdentifier) || "Please check your phone"), /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-muted-foreground hawa-flex hawa-flex-row" }, /* @__PURE__ */ React8.createElement("span", null, `${(_d = props.texts) == null ? void 0 : _d.weSentCode} ` || `We've sent a code to `, /* @__PURE__ */ React8.createElement("span", { dir: "ltr" }, props.identifier)))), /* @__PURE__ */ React8.createElement(
|
1306
1330
|
"form",
|
1307
1331
|
{
|
1308
1332
|
noValidate: true,
|
@@ -1280,7 +1280,7 @@ var Input = (0, import_react28.forwardRef)(
|
|
1280
1280
|
className: cn(
|
1281
1281
|
defaultInputStyle,
|
1282
1282
|
"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",
|
1283
|
-
props.alwaysLTR ? {
|
1283
|
+
props.alwaysLTR && props.dir === "rtl" ? {
|
1284
1284
|
"hawa-ps-9": props.endIcon,
|
1285
1285
|
"hawa-pe-9": props.startIcon,
|
1286
1286
|
"hawa-ps-[60px]": countPosition === "center"
|
@@ -455,7 +455,7 @@ var Input = forwardRef2(
|
|
455
455
|
className: cn(
|
456
456
|
defaultInputStyle,
|
457
457
|
"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",
|
458
|
-
props.alwaysLTR ? {
|
458
|
+
props.alwaysLTR && props.dir === "rtl" ? {
|
459
459
|
"hawa-ps-9": props.endIcon,
|
460
460
|
"hawa-pe-9": props.startIcon,
|
461
461
|
"hawa-ps-[60px]": countPosition === "center"
|