@sikka/hawa 0.37.2-next → 0.38.1-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Radio-y9uhxitu.d.ts → Radio-lgoClQrv.d.ts} +2 -2
- package/dist/{Radio-BCD7k628.d.mts → Radio-uQ7DtzcI.d.mts} +2 -2
- package/dist/alert/index.js +43 -19
- package/dist/alert/index.js.map +1 -1
- package/dist/alert/index.mjs +43 -19
- package/dist/alert/index.mjs.map +1 -1
- package/dist/appLayout/index.js +43 -19
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +43 -19
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/backToTop/index.js +43 -19
- package/dist/backToTop/index.js.map +1 -1
- package/dist/backToTop/index.mjs +43 -19
- package/dist/backToTop/index.mjs.map +1 -1
- package/dist/blocks/auth/index.d.mts +1 -0
- package/dist/blocks/auth/index.d.ts +1 -0
- package/dist/blocks/auth/index.js +251 -143
- package/dist/blocks/auth/index.mjs +205 -102
- package/dist/blocks/feedback/index.js +47 -59
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.d.mts +2 -1
- package/dist/blocks/index.d.ts +2 -1
- package/dist/blocks/index.js +501 -420
- package/dist/blocks/index.mjs +11 -9
- package/dist/blocks/misc/index.js +48 -51
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +47 -41
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/button/index.d.mts +4 -0
- package/dist/button/index.d.ts +4 -0
- package/dist/button/index.js +43 -19
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +43 -19
- package/dist/button/index.mjs.map +1 -1
- package/dist/calendar/index.js +43 -19
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/index.mjs +43 -19
- package/dist/calendar/index.mjs.map +1 -1
- package/dist/checkbox/index.d.mts +1 -1
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.js.map +1 -1
- package/dist/checkbox/index.mjs.map +1 -1
- package/dist/{chunk-ZTUWU652.mjs → chunk-EZBHA2IL.mjs} +3 -3
- package/dist/{chunk-ODOCZAWC.mjs → chunk-F23GAE2P.mjs} +1 -1
- package/dist/{chunk-DS3AACQJ.mjs → chunk-IC5WYNKN.mjs} +1 -1
- package/dist/{chunk-QXH7ZDMN.mjs → chunk-RTK6REIK.mjs} +3 -11
- package/dist/{chunk-QYWOI3DO.mjs → chunk-UDJFVH2I.mjs} +204 -144
- package/dist/{chunk-BPHQFAWM.mjs → chunk-UJ5SXC3M.mjs} +3 -11
- package/dist/{chunk-PXGL7ZXQ.mjs → chunk-UMOBOCED.mjs} +44 -19
- package/dist/{chunk-RNFJAEEU.mjs → chunk-V7O5MQZQ.mjs} +44 -19
- package/dist/{chunk-BTDR3VAG.mjs → chunk-WDCKXU54.mjs} +4 -21
- package/dist/{chunk-MDHDHEPZ.mjs → chunk-XFSBC5VI.mjs} +3 -11
- package/dist/codeBlock/index.js +43 -19
- package/dist/codeBlock/index.js.map +1 -1
- package/dist/codeBlock/index.mjs +43 -19
- package/dist/codeBlock/index.mjs.map +1 -1
- package/dist/colorPicker/index.d.mts +1 -1
- package/dist/colorPicker/index.d.ts +1 -1
- package/dist/colorPicker/index.js +35 -31
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +33 -29
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.d.mts +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +52 -48
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +52 -48
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dataTable/index.js +44 -29
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +44 -29
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +4 -0
- package/dist/datePicker/index.d.ts +4 -0
- package/dist/datePicker/index.js +44 -19
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +44 -19
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/docsLayout/index.js +43 -19
- package/dist/docsLayout/index.js.map +1 -1
- package/dist/docsLayout/index.mjs +43 -19
- package/dist/docsLayout/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +46 -21
- package/dist/elements/index.d.ts +46 -21
- package/dist/elements/index.js +378 -309
- package/dist/elements/index.mjs +14 -23
- package/dist/fileDropzone/index.js +43 -19
- package/dist/fileDropzone/index.js.map +1 -1
- package/dist/fileDropzone/index.mjs +43 -19
- package/dist/fileDropzone/index.mjs.map +1 -1
- package/dist/index.css +29 -3
- package/dist/index.d.mts +48 -22
- package/dist/index.d.ts +48 -22
- package/dist/index.js +808 -737
- package/dist/index.mjs +331 -264
- package/dist/input/index.d.mts +1 -1
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +46 -42
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +45 -41
- package/dist/input/index.mjs.map +1 -1
- package/dist/interfaceSettings/index.js +64 -69
- package/dist/interfaceSettings/index.js.map +1 -1
- package/dist/interfaceSettings/index.mjs +57 -62
- package/dist/interfaceSettings/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +43 -19
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +70 -66
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +59 -55
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +50 -55
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +47 -52
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.d.mts +37 -16
- package/dist/pinInput/index.d.ts +37 -16
- package/dist/pinInput/index.js +208 -78
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +203 -77
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/radio/index.d.mts +1 -1
- package/dist/radio/index.d.ts +1 -1
- package/dist/radio/index.js +55 -60
- package/dist/radio/index.js.map +1 -1
- package/dist/radio/index.mjs +50 -55
- package/dist/radio/index.mjs.map +1 -1
- package/dist/scrollArea/index.js +2 -2
- package/dist/scrollArea/index.js.map +1 -1
- package/dist/scrollArea/index.mjs +2 -2
- package/dist/scrollArea/index.mjs.map +1 -1
- package/dist/select/index.d.mts +1 -1
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.js +43 -39
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +43 -39
- package/dist/select/index.mjs.map +1 -1
- package/dist/signature/index.d.mts +1 -1
- package/dist/signature/index.d.ts +1 -1
- package/dist/signature/index.js.map +1 -1
- package/dist/signature/index.mjs.map +1 -1
- package/dist/sortButton/index.js +43 -19
- package/dist/sortButton/index.js.map +1 -1
- package/dist/sortButton/index.mjs +43 -19
- package/dist/sortButton/index.mjs.map +1 -1
- package/dist/splitButton/index.d.mts +4 -0
- package/dist/splitButton/index.d.ts +4 -0
- package/dist/splitButton/index.js +43 -19
- package/dist/splitButton/index.js.map +1 -1
- package/dist/splitButton/index.mjs +43 -19
- package/dist/splitButton/index.mjs.map +1 -1
- package/dist/stats/index.d.mts +1 -1
- package/dist/stats/index.d.ts +1 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs.map +1 -1
- package/dist/tabs/index.js +2 -2
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +2 -2
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/textarea/index.d.mts +1 -1
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/index.js +34 -30
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +34 -30
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +2 -1
@@ -448,30 +448,54 @@ var Button = React5.forwardRef(
|
|
448
448
|
children,
|
449
449
|
labelProps,
|
450
450
|
showHelperText = false,
|
451
|
+
inForm = false,
|
451
452
|
...props
|
452
453
|
}, ref) => {
|
453
454
|
const Comp = "button";
|
454
455
|
const loadingColor = variant === "outline" || variant === "ghost" || variant === "neoBrutalism" ? "hawa-bg-primary" : "hawa-bg-primary-foreground";
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
className: cn(
|
459
|
-
buttonVariants({ variant, size, className }),
|
460
|
-
centered && "hawa-justify-center"
|
461
|
-
),
|
462
|
-
ref,
|
463
|
-
...props
|
464
|
-
},
|
465
|
-
isLoading ? /* @__PURE__ */ React5.createElement(
|
466
|
-
Loading,
|
456
|
+
if (inForm) {
|
457
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
|
458
|
+
Comp,
|
467
459
|
{
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
460
|
+
className: cn(
|
461
|
+
buttonVariants({ variant, size, className }),
|
462
|
+
centered && "hawa-justify-center"
|
463
|
+
),
|
464
|
+
ref,
|
465
|
+
...props
|
466
|
+
},
|
467
|
+
isLoading ? /* @__PURE__ */ React5.createElement(
|
468
|
+
Loading,
|
469
|
+
{
|
470
|
+
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
471
|
+
themeMode: variant === "outline" ? "light" : "dark",
|
472
|
+
color: loadingColor,
|
473
|
+
size: size === "sm" || size === "xs" ? "xs" : "button"
|
474
|
+
}
|
475
|
+
) : children
|
476
|
+
), showHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
|
477
|
+
} else {
|
478
|
+
return /* @__PURE__ */ React5.createElement(
|
479
|
+
Comp,
|
480
|
+
{
|
481
|
+
className: cn(
|
482
|
+
buttonVariants({ variant, size, className }),
|
483
|
+
centered && "hawa-justify-center"
|
484
|
+
),
|
485
|
+
ref,
|
486
|
+
...props
|
487
|
+
},
|
488
|
+
isLoading ? /* @__PURE__ */ React5.createElement(
|
489
|
+
Loading,
|
490
|
+
{
|
491
|
+
design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
|
492
|
+
themeMode: variant === "outline" ? "light" : "dark",
|
493
|
+
color: loadingColor,
|
494
|
+
size: size === "sm" || size === "xs" ? "xs" : "button"
|
495
|
+
}
|
496
|
+
) : children
|
497
|
+
);
|
498
|
+
}
|
475
499
|
}
|
476
500
|
);
|
477
501
|
Button.displayName = "Button";
|
@@ -1341,16 +1365,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
1341
1365
|
inputProps == null ? void 0 : inputProps.className
|
1342
1366
|
)
|
1343
1367
|
}
|
1344
|
-
)), !forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(
|
1345
|
-
"p",
|
1346
|
-
{
|
1347
|
-
className: cn(
|
1348
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
1349
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
1350
|
-
)
|
1351
|
-
},
|
1352
|
-
props.helperText
|
1353
|
-
), !props.disabled && forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(
|
1368
|
+
)), !forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(HelperText, { helperText: props.helperText }), !props.disabled && forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(
|
1354
1369
|
"div",
|
1355
1370
|
{
|
1356
1371
|
className: cn(
|
@@ -3246,16 +3261,7 @@ var Select = ({
|
|
3246
3261
|
onInputChange: (newValue, action) => props.onInputChange(newValue, action)
|
3247
3262
|
}
|
3248
3263
|
),
|
3249
|
-
!props.hideHelperText && /* @__PURE__ */ import_react9.default.createElement(
|
3250
|
-
"p",
|
3251
|
-
{
|
3252
|
-
className: cn(
|
3253
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
3254
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
3255
|
-
)
|
3256
|
-
},
|
3257
|
-
props.helperText
|
3258
|
-
)
|
3264
|
+
!props.hideHelperText && /* @__PURE__ */ import_react9.default.createElement(HelperText, { helperText: props.helperText })
|
3259
3265
|
);
|
3260
3266
|
};
|
3261
3267
|
|
@@ -3312,16 +3318,7 @@ var PhoneInput = ({
|
|
3312
3318
|
),
|
3313
3319
|
...inputProps
|
3314
3320
|
}
|
3315
|
-
))), /* @__PURE__ */ import_react10.default.createElement(
|
3316
|
-
"p",
|
3317
|
-
{
|
3318
|
-
className: cn(
|
3319
|
-
"hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
|
3320
|
-
props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
|
3321
|
-
)
|
3322
|
-
},
|
3323
|
-
props.helperText
|
3324
|
-
));
|
3321
|
+
))), /* @__PURE__ */ import_react10.default.createElement(HelperText, { helperText: props.helperText }));
|
3325
3322
|
};
|
3326
3323
|
|
3327
3324
|
// icons/Emojis.tsx
|
@@ -3652,7 +3649,7 @@ var LoginForm = ({
|
|
3652
3649
|
},
|
3653
3650
|
(texts == null ? void 0 : texts.loginText) || "Login"
|
3654
3651
|
),
|
3655
|
-
props.additionalButtons,
|
3652
|
+
props.additionalButtons && props.additionalButtons,
|
3656
3653
|
props.allowRegister && /* @__PURE__ */ import_react14.default.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ import_react14.default.createElement(
|
3657
3654
|
"span",
|
3658
3655
|
{
|
@@ -4470,106 +4467,168 @@ var ResetPasswordForm = ({
|
|
4470
4467
|
};
|
4471
4468
|
|
4472
4469
|
// blocks/auth/CodeConfirmation.tsx
|
4473
|
-
var
|
4470
|
+
var import_react24 = __toESM(require("react"));
|
4474
4471
|
var import_react_hook_form5 = require("react-hook-form");
|
4475
4472
|
var import_zod5 = require("@hookform/resolvers/zod");
|
4476
4473
|
var z5 = __toESM(require("zod"));
|
4477
4474
|
|
4478
4475
|
// elements/pinInput/PinInput.tsx
|
4479
|
-
var
|
4480
|
-
var
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
4484
|
-
|
4485
|
-
|
4486
|
-
|
4487
|
-
|
4488
|
-
|
4489
|
-
|
4490
|
-
|
4491
|
-
|
4492
|
-
|
4493
|
-
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4497
|
-
|
4498
|
-
|
4499
|
-
|
4500
|
-
|
4501
|
-
|
4502
|
-
|
4503
|
-
|
4504
|
-
|
4505
|
-
|
4506
|
-
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
4515
|
-
|
4516
|
-
|
4517
|
-
|
4518
|
-
|
4519
|
-
|
4520
|
-
|
4521
|
-
}
|
4522
|
-
};
|
4523
|
-
return /* @__PURE__ */ import_react22.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ import_react22.default.createElement(
|
4524
|
-
"div",
|
4525
|
-
{
|
4526
|
-
className: "hawa-flex hawa-w-full hawa-flex-row hawa-justify-center hawa-gap-2",
|
4527
|
-
dir: "ltr"
|
4528
|
-
},
|
4529
|
-
pin.map((value, index) => /* @__PURE__ */ import_react22.default.createElement(
|
4530
|
-
"input",
|
4476
|
+
var React25 = __toESM(require("react"));
|
4477
|
+
var import_input_otp = require("input-otp");
|
4478
|
+
|
4479
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4480
|
+
var import_react23 = require("react");
|
4481
|
+
|
4482
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
4483
|
+
var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
4484
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
4485
|
+
return Boolean(className) && array.indexOf(className) === index;
|
4486
|
+
}).join(" ");
|
4487
|
+
|
4488
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4489
|
+
var import_react22 = require("react");
|
4490
|
+
|
4491
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
4492
|
+
var defaultAttributes = {
|
4493
|
+
xmlns: "http://www.w3.org/2000/svg",
|
4494
|
+
width: 24,
|
4495
|
+
height: 24,
|
4496
|
+
viewBox: "0 0 24 24",
|
4497
|
+
fill: "none",
|
4498
|
+
stroke: "currentColor",
|
4499
|
+
strokeWidth: 2,
|
4500
|
+
strokeLinecap: "round",
|
4501
|
+
strokeLinejoin: "round"
|
4502
|
+
};
|
4503
|
+
|
4504
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
|
4505
|
+
var Icon = (0, import_react22.forwardRef)(
|
4506
|
+
({
|
4507
|
+
color = "currentColor",
|
4508
|
+
size = 24,
|
4509
|
+
strokeWidth = 2,
|
4510
|
+
absoluteStrokeWidth,
|
4511
|
+
className = "",
|
4512
|
+
children,
|
4513
|
+
iconNode,
|
4514
|
+
...rest
|
4515
|
+
}, ref) => {
|
4516
|
+
return (0, import_react22.createElement)(
|
4517
|
+
"svg",
|
4531
4518
|
{
|
4532
|
-
|
4533
|
-
|
4534
|
-
|
4535
|
-
|
4536
|
-
|
4537
|
-
|
4538
|
-
|
4539
|
-
|
4540
|
-
|
4541
|
-
|
4542
|
-
),
|
4543
|
-
|
4544
|
-
|
4545
|
-
|
4546
|
-
|
4547
|
-
|
4548
|
-
|
4549
|
-
|
4550
|
-
|
4519
|
+
ref,
|
4520
|
+
...defaultAttributes,
|
4521
|
+
width: size,
|
4522
|
+
height: size,
|
4523
|
+
stroke: color,
|
4524
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
4525
|
+
className: mergeClasses("lucide", className),
|
4526
|
+
...rest
|
4527
|
+
},
|
4528
|
+
[
|
4529
|
+
...iconNode.map(([tag, attrs]) => (0, import_react22.createElement)(tag, attrs)),
|
4530
|
+
...Array.isArray(children) ? children : [children]
|
4531
|
+
]
|
4532
|
+
);
|
4533
|
+
}
|
4534
|
+
);
|
4535
|
+
|
4536
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
4537
|
+
var createLucideIcon = (iconName, iconNode) => {
|
4538
|
+
const Component = (0, import_react23.forwardRef)(
|
4539
|
+
({ className, ...props }, ref) => (0, import_react23.createElement)(Icon, {
|
4540
|
+
ref,
|
4541
|
+
iconNode,
|
4542
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
4543
|
+
...props
|
4544
|
+
})
|
4545
|
+
);
|
4546
|
+
Component.displayName = `${iconName}`;
|
4547
|
+
return Component;
|
4548
|
+
};
|
4549
|
+
|
4550
|
+
// ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
|
4551
|
+
var Dot = createLucideIcon("Dot", [
|
4552
|
+
["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
|
4553
|
+
]);
|
4554
|
+
|
4555
|
+
// elements/pinInput/PinInput.tsx
|
4556
|
+
var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
4557
|
+
import_input_otp.OTPInput,
|
4558
|
+
{
|
4559
|
+
ref,
|
4560
|
+
containerClassName: cn(
|
4561
|
+
"hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50",
|
4562
|
+
containerClassName
|
4563
|
+
),
|
4564
|
+
className: cn("disabled:hawa-cursor-not-allowed", className),
|
4565
|
+
...props
|
4566
|
+
}
|
4567
|
+
));
|
4568
|
+
PinInputRoot.displayName = "PinInputRoot";
|
4569
|
+
var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
|
4570
|
+
"div",
|
4571
|
+
{
|
4572
|
+
ref,
|
4573
|
+
className: cn("hawa-flex hawa-items-center", className),
|
4574
|
+
...props
|
4575
|
+
}
|
4576
|
+
));
|
4577
|
+
PinInputGroup.displayName = "PinInputGroup";
|
4578
|
+
var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
|
4579
|
+
const pinInputContext = React25.useContext(import_input_otp.OTPInputContext);
|
4580
|
+
const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
|
4581
|
+
return /* @__PURE__ */ React25.createElement(
|
4582
|
+
"div",
|
4551
4583
|
{
|
4584
|
+
ref,
|
4552
4585
|
className: cn(
|
4553
|
-
"hawa-
|
4554
|
-
|
4555
|
-
|
4586
|
+
"hawa-border-input hawa-relative hawa-flex hawa-h-10 hawa-w-10 hawa-items-center hawa-justify-center hawa-border-y hawa-border-r hawa-text-sm hawa-transition-all first:hawa-rounded-l-md first:hawa-border-l last:hawa-rounded-r-md",
|
4587
|
+
isActive && "hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2",
|
4588
|
+
className
|
4589
|
+
),
|
4590
|
+
...props
|
4556
4591
|
},
|
4557
|
-
|
4558
|
-
|
4592
|
+
char,
|
4593
|
+
hasFakeCaret && /* @__PURE__ */ React25.createElement("div", { className: "hawa-pointer-events-none hawa-absolute hawa-inset-0 hawa-flex hawa-items-center hawa-justify-center" }, /* @__PURE__ */ React25.createElement("div", { className: "hawa-animate-caret-blink hawa-bg-foreground hawa-h-4 hawa-w-px hawa-duration-1000" }))
|
4594
|
+
);
|
4595
|
+
});
|
4596
|
+
PinInputSlot.displayName = "PinInputSlot";
|
4597
|
+
var PinInputSeperator = React25.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React25.createElement(Dot, null)));
|
4598
|
+
PinInputSeperator.displayName = "PinInputSeperator";
|
4599
|
+
var PinInput = ({
|
4600
|
+
separatorPosition = 0,
|
4601
|
+
...props
|
4602
|
+
}) => {
|
4603
|
+
const maxLength = props.maxLength || 6;
|
4604
|
+
const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
|
4605
|
+
const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
|
4606
|
+
const secondGroupLength = maxLength - firstGroupLength;
|
4607
|
+
return /* @__PURE__ */ React25.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React25.createElement(PinInputRoot, { ...props }, firstGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(firstGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(PinInputSlot, { key: index, index, className: "hawa-w-full" }))), separatorPosition > 0 && separatorPosition < props.maxLength && /* @__PURE__ */ React25.createElement(PinInputSeperator, null), secondGroupLength > 0 && /* @__PURE__ */ React25.createElement(PinInputGroup, { className: "hawa-w-full" }, [...Array(secondGroupLength)].map((_, index) => /* @__PURE__ */ React25.createElement(
|
4608
|
+
PinInputSlot,
|
4609
|
+
{
|
4610
|
+
key: index + firstGroupLength,
|
4611
|
+
index: index + firstGroupLength,
|
4612
|
+
className: "hawa-w-full"
|
4613
|
+
}
|
4614
|
+
)))), /* @__PURE__ */ React25.createElement(HelperText, { helperText: props.helperText }));
|
4559
4615
|
};
|
4560
4616
|
|
4561
4617
|
// blocks/auth/CodeConfirmation.tsx
|
4562
|
-
var CodeConfirmation = (
|
4618
|
+
var CodeConfirmation = ({
|
4619
|
+
codeLength = 6,
|
4620
|
+
...props
|
4621
|
+
}) => {
|
4563
4622
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
4564
4623
|
const formSchema = z5.object({
|
4565
|
-
otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(
|
4624
|
+
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 })
|
4566
4625
|
});
|
4567
4626
|
const { handleSubmit, control, formState, setValue } = (0, import_react_hook_form5.useForm)({
|
4568
4627
|
resolver: (0, import_zod5.zodResolver)(formSchema)
|
4569
4628
|
});
|
4570
|
-
const [resendTimer, setResendTimer] = (0,
|
4571
|
-
const [remainingTime, setRemainingTime] = (0,
|
4572
|
-
const [showResendTimer, setShowResendTimer] = (0,
|
4629
|
+
const [resendTimer, setResendTimer] = (0, import_react24.useState)(null);
|
4630
|
+
const [remainingTime, setRemainingTime] = (0, import_react24.useState)(0);
|
4631
|
+
const [showResendTimer, setShowResendTimer] = (0, import_react24.useState)(false);
|
4573
4632
|
const startResendTimer = () => {
|
4574
4633
|
if (resendTimer !== null) {
|
4575
4634
|
clearInterval(resendTimer);
|
@@ -4591,21 +4650,21 @@ var CodeConfirmation = (props) => {
|
|
4591
4650
|
}, 1e3);
|
4592
4651
|
setResendTimer(newTimer);
|
4593
4652
|
};
|
4594
|
-
(0,
|
4653
|
+
(0, import_react24.useEffect)(() => {
|
4595
4654
|
return () => {
|
4596
4655
|
if (resendTimer !== null) {
|
4597
4656
|
clearInterval(resendTimer);
|
4598
4657
|
}
|
4599
4658
|
};
|
4600
4659
|
}, []);
|
4601
|
-
return /* @__PURE__ */
|
4660
|
+
return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(
|
4602
4661
|
Alert,
|
4603
4662
|
{
|
4604
4663
|
title: props.errorTitle,
|
4605
4664
|
text: props.errorText,
|
4606
4665
|
severity: "error"
|
4607
4666
|
}
|
4608
|
-
), /* @__PURE__ */
|
4667
|
+
), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react24.default.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ import_react24.default.createElement(
|
4609
4668
|
"form",
|
4610
4669
|
{
|
4611
4670
|
noValidate: true,
|
@@ -4619,26 +4678,25 @@ var CodeConfirmation = (props) => {
|
|
4619
4678
|
}
|
4620
4679
|
})
|
4621
4680
|
},
|
4622
|
-
/* @__PURE__ */
|
4681
|
+
/* @__PURE__ */ import_react24.default.createElement(
|
4623
4682
|
import_react_hook_form5.Controller,
|
4624
4683
|
{
|
4625
4684
|
control,
|
4626
4685
|
name: "otp_code",
|
4627
4686
|
render: ({ field }) => {
|
4628
4687
|
var _a2;
|
4629
|
-
return /* @__PURE__ */
|
4688
|
+
return /* @__PURE__ */ import_react24.default.createElement(
|
4630
4689
|
PinInput,
|
4631
4690
|
{
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4635
|
-
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message
|
4691
|
+
maxLength: codeLength,
|
4692
|
+
helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
|
4693
|
+
...field
|
4636
4694
|
}
|
4637
4695
|
);
|
4638
4696
|
}
|
4639
4697
|
}
|
4640
4698
|
),
|
4641
|
-
showResendTimer ? /* @__PURE__ */
|
4699
|
+
showResendTimer ? /* @__PURE__ */ import_react24.default.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ import_react24.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react24.default.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react24.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react24.default.createElement(
|
4642
4700
|
"span",
|
4643
4701
|
{
|
4644
4702
|
className: "clickable-link",
|
@@ -4649,7 +4707,7 @@ var CodeConfirmation = (props) => {
|
|
4649
4707
|
},
|
4650
4708
|
((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
|
4651
4709
|
)),
|
4652
|
-
/* @__PURE__ */
|
4710
|
+
/* @__PURE__ */ import_react24.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react24.default.createElement(Button, { variant: "outline" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ import_react24.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
|
4653
4711
|
)));
|
4654
4712
|
};
|
4655
4713
|
// Annotate the CommonJS export names for ESM import in node:
|
@@ -4663,3 +4721,53 @@ var CodeConfirmation = (props) => {
|
|
4663
4721
|
RegisterForm,
|
4664
4722
|
ResetPasswordForm
|
4665
4723
|
});
|
4724
|
+
/*! Bundled license information:
|
4725
|
+
|
4726
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
4727
|
+
(**
|
4728
|
+
* @license lucide-react v0.379.0 - ISC
|
4729
|
+
*
|
4730
|
+
* This source code is licensed under the ISC license.
|
4731
|
+
* See the LICENSE file in the root directory of this source tree.
|
4732
|
+
*)
|
4733
|
+
|
4734
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
4735
|
+
(**
|
4736
|
+
* @license lucide-react v0.379.0 - ISC
|
4737
|
+
*
|
4738
|
+
* This source code is licensed under the ISC license.
|
4739
|
+
* See the LICENSE file in the root directory of this source tree.
|
4740
|
+
*)
|
4741
|
+
|
4742
|
+
lucide-react/dist/esm/Icon.js:
|
4743
|
+
(**
|
4744
|
+
* @license lucide-react v0.379.0 - ISC
|
4745
|
+
*
|
4746
|
+
* This source code is licensed under the ISC license.
|
4747
|
+
* See the LICENSE file in the root directory of this source tree.
|
4748
|
+
*)
|
4749
|
+
|
4750
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
4751
|
+
(**
|
4752
|
+
* @license lucide-react v0.379.0 - ISC
|
4753
|
+
*
|
4754
|
+
* This source code is licensed under the ISC license.
|
4755
|
+
* See the LICENSE file in the root directory of this source tree.
|
4756
|
+
*)
|
4757
|
+
|
4758
|
+
lucide-react/dist/esm/icons/dot.js:
|
4759
|
+
(**
|
4760
|
+
* @license lucide-react v0.379.0 - ISC
|
4761
|
+
*
|
4762
|
+
* This source code is licensed under the ISC license.
|
4763
|
+
* See the LICENSE file in the root directory of this source tree.
|
4764
|
+
*)
|
4765
|
+
|
4766
|
+
lucide-react/dist/esm/lucide-react.js:
|
4767
|
+
(**
|
4768
|
+
* @license lucide-react v0.379.0 - ISC
|
4769
|
+
*
|
4770
|
+
* This source code is licensed under the ISC license.
|
4771
|
+
* See the LICENSE file in the root directory of this source tree.
|
4772
|
+
*)
|
4773
|
+
*/
|