@sikka/hawa 0.37.1-next → 0.38.0-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.
Files changed (147) hide show
  1. package/dist/{Radio-y9uhxitu.d.ts → Radio-lgoClQrv.d.ts} +2 -2
  2. package/dist/{Radio-BCD7k628.d.mts → Radio-uQ7DtzcI.d.mts} +2 -2
  3. package/dist/alert/index.js.map +1 -1
  4. package/dist/alert/index.mjs.map +1 -1
  5. package/dist/appLayout/index.js.map +1 -1
  6. package/dist/appLayout/index.mjs.map +1 -1
  7. package/dist/backToTop/index.js.map +1 -1
  8. package/dist/backToTop/index.mjs.map +1 -1
  9. package/dist/blocks/auth/index.d.mts +1 -0
  10. package/dist/blocks/auth/index.d.ts +1 -0
  11. package/dist/blocks/auth/index.js +207 -123
  12. package/dist/blocks/auth/index.mjs +204 -101
  13. package/dist/blocks/feedback/index.js +4 -40
  14. package/dist/blocks/feedback/index.mjs +5 -5
  15. package/dist/blocks/index.d.mts +2 -1
  16. package/dist/blocks/index.d.ts +2 -1
  17. package/dist/blocks/index.js +457 -400
  18. package/dist/blocks/index.mjs +10 -8
  19. package/dist/blocks/misc/index.js +5 -32
  20. package/dist/blocks/misc/index.mjs +5 -5
  21. package/dist/blocks/pricing/index.js +4 -22
  22. package/dist/blocks/pricing/index.mjs +4 -4
  23. package/dist/button/index.js.map +1 -1
  24. package/dist/button/index.mjs.map +1 -1
  25. package/dist/calendar/index.js.map +1 -1
  26. package/dist/calendar/index.mjs.map +1 -1
  27. package/dist/checkbox/index.d.mts +1 -1
  28. package/dist/checkbox/index.d.ts +1 -1
  29. package/dist/checkbox/index.js.map +1 -1
  30. package/dist/checkbox/index.mjs.map +1 -1
  31. package/dist/{chunk-BPHQFAWM.mjs → chunk-4EZL2A64.mjs} +3 -11
  32. package/dist/{chunk-DS3AACQJ.mjs → chunk-E6C3LDHD.mjs} +1 -1
  33. package/dist/{chunk-ODOCZAWC.mjs → chunk-E77TUADR.mjs} +1 -1
  34. package/dist/{chunk-QXH7ZDMN.mjs → chunk-IA5FLRFL.mjs} +3 -11
  35. package/dist/{chunk-ZTUWU652.mjs → chunk-JJMRBD3S.mjs} +3 -3
  36. package/dist/{chunk-RNFJAEEU.mjs → chunk-LDJD5ITW.mjs} +1 -0
  37. package/dist/{chunk-QYWOI3DO.mjs → chunk-MHSSZ6XE.mjs} +204 -144
  38. package/dist/{chunk-BTDR3VAG.mjs → chunk-Q3HJI7ZE.mjs} +4 -21
  39. package/dist/{chunk-MDHDHEPZ.mjs → chunk-TMUQCNLO.mjs} +3 -11
  40. package/dist/{chunk-PXGL7ZXQ.mjs → chunk-V4SUYEVH.mjs} +1 -0
  41. package/dist/codeBlock/index.js.map +1 -1
  42. package/dist/codeBlock/index.mjs.map +1 -1
  43. package/dist/colorPicker/index.d.mts +1 -1
  44. package/dist/colorPicker/index.d.ts +1 -1
  45. package/dist/colorPicker/index.js +35 -31
  46. package/dist/colorPicker/index.js.map +1 -1
  47. package/dist/colorPicker/index.mjs +33 -29
  48. package/dist/colorPicker/index.mjs.map +1 -1
  49. package/dist/combobox/index.d.mts +2 -2
  50. package/dist/combobox/index.d.ts +2 -2
  51. package/dist/combobox/index.js +52 -48
  52. package/dist/combobox/index.js.map +1 -1
  53. package/dist/combobox/index.mjs +52 -48
  54. package/dist/combobox/index.mjs.map +1 -1
  55. package/dist/command/index.d.mts +1 -1
  56. package/dist/command/index.d.ts +1 -1
  57. package/dist/command/index.js +26 -4
  58. package/dist/command/index.js.map +1 -1
  59. package/dist/command/index.mjs +26 -4
  60. package/dist/command/index.mjs.map +1 -1
  61. package/dist/dataTable/index.js +1 -10
  62. package/dist/dataTable/index.js.map +1 -1
  63. package/dist/dataTable/index.mjs +1 -10
  64. package/dist/dataTable/index.mjs.map +1 -1
  65. package/dist/datePicker/index.js.map +1 -1
  66. package/dist/datePicker/index.mjs.map +1 -1
  67. package/dist/docsLayout/index.js.map +1 -1
  68. package/dist/docsLayout/index.mjs.map +1 -1
  69. package/dist/elements/index.d.mts +48 -25
  70. package/dist/elements/index.d.ts +48 -25
  71. package/dist/elements/index.js +361 -294
  72. package/dist/elements/index.mjs +40 -27
  73. package/dist/fileDropzone/index.js.map +1 -1
  74. package/dist/fileDropzone/index.mjs.map +1 -1
  75. package/dist/{index-e_Ob_SnB.d.ts → index-B0aJcA6d.d.mts} +6 -4
  76. package/dist/{index-e_Ob_SnB.d.mts → index-B0aJcA6d.d.ts} +6 -4
  77. package/dist/index.css +29 -3
  78. package/dist/index.d.mts +50 -26
  79. package/dist/index.d.ts +50 -26
  80. package/dist/index.js +790 -721
  81. package/dist/index.mjs +313 -248
  82. package/dist/input/index.d.mts +1 -1
  83. package/dist/input/index.d.ts +1 -1
  84. package/dist/input/index.js +46 -42
  85. package/dist/input/index.js.map +1 -1
  86. package/dist/input/index.mjs +45 -41
  87. package/dist/input/index.mjs.map +1 -1
  88. package/dist/interfaceSettings/index.js +64 -69
  89. package/dist/interfaceSettings/index.js.map +1 -1
  90. package/dist/interfaceSettings/index.mjs +57 -62
  91. package/dist/interfaceSettings/index.mjs.map +1 -1
  92. package/dist/layout/index.d.mts +1 -1
  93. package/dist/layout/index.d.ts +1 -1
  94. package/dist/layout/index.mjs +2 -2
  95. package/dist/passwordInput/index.js +70 -66
  96. package/dist/passwordInput/index.js.map +1 -1
  97. package/dist/passwordInput/index.mjs +59 -55
  98. package/dist/passwordInput/index.mjs.map +1 -1
  99. package/dist/phoneInput/index.js +50 -55
  100. package/dist/phoneInput/index.js.map +1 -1
  101. package/dist/phoneInput/index.mjs +47 -52
  102. package/dist/phoneInput/index.mjs.map +1 -1
  103. package/dist/pinInput/index.d.mts +37 -16
  104. package/dist/pinInput/index.d.ts +37 -16
  105. package/dist/pinInput/index.js +208 -78
  106. package/dist/pinInput/index.js.map +1 -1
  107. package/dist/pinInput/index.mjs +203 -77
  108. package/dist/pinInput/index.mjs.map +1 -1
  109. package/dist/radio/index.d.mts +1 -1
  110. package/dist/radio/index.d.ts +1 -1
  111. package/dist/radio/index.js +55 -60
  112. package/dist/radio/index.js.map +1 -1
  113. package/dist/radio/index.mjs +50 -55
  114. package/dist/radio/index.mjs.map +1 -1
  115. package/dist/scrollArea/index.js +2 -2
  116. package/dist/scrollArea/index.js.map +1 -1
  117. package/dist/scrollArea/index.mjs +2 -2
  118. package/dist/scrollArea/index.mjs.map +1 -1
  119. package/dist/select/index.d.mts +1 -1
  120. package/dist/select/index.d.ts +1 -1
  121. package/dist/select/index.js +43 -39
  122. package/dist/select/index.js.map +1 -1
  123. package/dist/select/index.mjs +43 -39
  124. package/dist/select/index.mjs.map +1 -1
  125. package/dist/signature/index.d.mts +1 -1
  126. package/dist/signature/index.d.ts +1 -1
  127. package/dist/signature/index.js.map +1 -1
  128. package/dist/signature/index.mjs.map +1 -1
  129. package/dist/sortButton/index.js.map +1 -1
  130. package/dist/sortButton/index.mjs.map +1 -1
  131. package/dist/splitButton/index.js.map +1 -1
  132. package/dist/splitButton/index.mjs.map +1 -1
  133. package/dist/stats/index.d.mts +1 -1
  134. package/dist/stats/index.d.ts +1 -1
  135. package/dist/stats/index.js.map +1 -1
  136. package/dist/stats/index.mjs.map +1 -1
  137. package/dist/tabs/index.js +2 -2
  138. package/dist/tabs/index.js.map +1 -1
  139. package/dist/tabs/index.mjs +2 -2
  140. package/dist/tabs/index.mjs.map +1 -1
  141. package/dist/textarea/index.d.mts +1 -1
  142. package/dist/textarea/index.d.ts +1 -1
  143. package/dist/textarea/index.js +34 -30
  144. package/dist/textarea/index.js.map +1 -1
  145. package/dist/textarea/index.mjs +34 -30
  146. package/dist/textarea/index.mjs.map +1 -1
  147. package/package.json +3 -2
@@ -1341,16 +1341,7 @@ var Input = (0, import_react8.forwardRef)(
1341
1341
  inputProps == null ? void 0 : inputProps.className
1342
1342
  )
1343
1343
  }
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(
1344
+ )), !forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(HelperText, { helperText: props.helperText }), !props.disabled && forceHideHelperText && /* @__PURE__ */ import_react8.default.createElement(
1354
1345
  "div",
1355
1346
  {
1356
1347
  className: cn(
@@ -3246,16 +3237,7 @@ var Select = ({
3246
3237
  onInputChange: (newValue, action) => props.onInputChange(newValue, action)
3247
3238
  }
3248
3239
  ),
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
- )
3240
+ !props.hideHelperText && /* @__PURE__ */ import_react9.default.createElement(HelperText, { helperText: props.helperText })
3259
3241
  );
3260
3242
  };
3261
3243
 
@@ -3312,16 +3294,7 @@ var PhoneInput = ({
3312
3294
  ),
3313
3295
  ...inputProps
3314
3296
  }
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
- ));
3297
+ ))), /* @__PURE__ */ import_react10.default.createElement(HelperText, { helperText: props.helperText }));
3325
3298
  };
3326
3299
 
3327
3300
  // icons/Emojis.tsx
@@ -4470,106 +4443,168 @@ var ResetPasswordForm = ({
4470
4443
  };
4471
4444
 
4472
4445
  // blocks/auth/CodeConfirmation.tsx
4473
- var import_react23 = __toESM(require("react"));
4446
+ var import_react24 = __toESM(require("react"));
4474
4447
  var import_react_hook_form5 = require("react-hook-form");
4475
4448
  var import_zod5 = require("@hookform/resolvers/zod");
4476
4449
  var z5 = __toESM(require("zod"));
4477
4450
 
4478
4451
  // elements/pinInput/PinInput.tsx
4479
- var import_react22 = __toESM(require("react"));
4480
- var PinInput = ({
4481
- label,
4482
- icon,
4483
- digits,
4484
- width = "normal",
4485
- getPins,
4486
- inputProps,
4487
- ...props
4488
- }) => {
4489
- const [pin, setPin] = (0, import_react22.useState)(Array.from(Array(digits)));
4490
- const handleKeyDown = (e, index) => {
4491
- let backTo = 0;
4492
- if (e.key === "Backspace") {
4493
- e.target.value.length === 0 ? backTo = index - 1 : backTo = index;
4494
- const previousInput = document.getElementById(`input-${backTo}`);
4495
- previousInput == null ? void 0 : previousInput.focus();
4496
- }
4497
- };
4498
- (0, import_react22.useEffect)(() => {
4499
- let unfilled = pin.includes(void 0);
4500
- if (!unfilled && getPins) {
4501
- getPins(pin);
4502
- }
4503
- });
4504
- const handleChange = (e, index) => {
4505
- if (!/^\d*$/.test(e.target.value)) {
4506
- const newPin = [...pin];
4507
- newPin[index] = "";
4508
- setPin(newPin);
4509
- return;
4510
- } else {
4511
- const newPin = [...pin];
4512
- newPin[index] = e.target.value;
4513
- setPin(newPin);
4514
- if (e.target.value.length === 1) {
4515
- const nextInput = document.getElementById(`input-${index + 1}`);
4516
- nextInput == null ? void 0 : nextInput.focus();
4517
- } else if (e.target.value.length === 0) {
4518
- const previousInput = document.getElementById(`input-${index - 1}`);
4519
- previousInput == null ? void 0 : previousInput.focus();
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",
4452
+ var React25 = __toESM(require("react"));
4453
+ var import_input_otp = require("input-otp");
4454
+
4455
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4456
+ var import_react23 = require("react");
4457
+
4458
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js
4459
+ var toKebabCase = (string6) => string6.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
4460
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
4461
+ return Boolean(className) && array.indexOf(className) === index;
4462
+ }).join(" ");
4463
+
4464
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4465
+ var import_react22 = require("react");
4466
+
4467
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js
4468
+ var defaultAttributes = {
4469
+ xmlns: "http://www.w3.org/2000/svg",
4470
+ width: 24,
4471
+ height: 24,
4472
+ viewBox: "0 0 24 24",
4473
+ fill: "none",
4474
+ stroke: "currentColor",
4475
+ strokeWidth: 2,
4476
+ strokeLinecap: "round",
4477
+ strokeLinejoin: "round"
4478
+ };
4479
+
4480
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js
4481
+ var Icon = (0, import_react22.forwardRef)(
4482
+ ({
4483
+ color = "currentColor",
4484
+ size = 24,
4485
+ strokeWidth = 2,
4486
+ absoluteStrokeWidth,
4487
+ className = "",
4488
+ children,
4489
+ iconNode,
4490
+ ...rest
4491
+ }, ref) => {
4492
+ return (0, import_react22.createElement)(
4493
+ "svg",
4531
4494
  {
4532
- key: index,
4533
- type: "text",
4534
- maxLength: 1,
4535
- value,
4536
- inputMode: "numeric",
4537
- id: `input-${index}`,
4538
- pattern: "[0-9]*",
4539
- className: cn(
4540
- "hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground",
4541
- width === "full" ? "hawa-w-full" : "hawa-w-10"
4542
- ),
4543
- onChange: (e) => handleChange(e, index),
4544
- onKeyDown: (e) => handleKeyDown(e, index),
4545
- onFocus: (e) => e.target.select(),
4546
- ...inputProps
4547
- }
4548
- ))
4549
- ), /* @__PURE__ */ import_react22.default.createElement(
4550
- "p",
4495
+ ref,
4496
+ ...defaultAttributes,
4497
+ width: size,
4498
+ height: size,
4499
+ stroke: color,
4500
+ strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
4501
+ className: mergeClasses("lucide", className),
4502
+ ...rest
4503
+ },
4504
+ [
4505
+ ...iconNode.map(([tag, attrs]) => (0, import_react22.createElement)(tag, attrs)),
4506
+ ...Array.isArray(children) ? children : [children]
4507
+ ]
4508
+ );
4509
+ }
4510
+ );
4511
+
4512
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js
4513
+ var createLucideIcon = (iconName, iconNode) => {
4514
+ const Component = (0, import_react23.forwardRef)(
4515
+ ({ className, ...props }, ref) => (0, import_react23.createElement)(Icon, {
4516
+ ref,
4517
+ iconNode,
4518
+ className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
4519
+ ...props
4520
+ })
4521
+ );
4522
+ Component.displayName = `${iconName}`;
4523
+ return Component;
4524
+ };
4525
+
4526
+ // ../../node_modules/.pnpm/lucide-react@0.379.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/dot.js
4527
+ var Dot = createLucideIcon("Dot", [
4528
+ ["circle", { cx: "12.1", cy: "12.1", r: "1", key: "18d7e5" }]
4529
+ ]);
4530
+
4531
+ // elements/pinInput/PinInput.tsx
4532
+ var PinInputRoot = React25.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ React25.createElement(
4533
+ import_input_otp.OTPInput,
4534
+ {
4535
+ ref,
4536
+ containerClassName: cn(
4537
+ "hawa-flex hawa-items-center hawa-gap-2 has-[:disabled]:hawa-opacity-50",
4538
+ containerClassName
4539
+ ),
4540
+ className: cn("disabled:hawa-cursor-not-allowed", className),
4541
+ ...props
4542
+ }
4543
+ ));
4544
+ PinInputRoot.displayName = "PinInputRoot";
4545
+ var PinInputGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React25.createElement(
4546
+ "div",
4547
+ {
4548
+ ref,
4549
+ className: cn("hawa-flex hawa-items-center", className),
4550
+ ...props
4551
+ }
4552
+ ));
4553
+ PinInputGroup.displayName = "PinInputGroup";
4554
+ var PinInputSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4555
+ const pinInputContext = React25.useContext(import_input_otp.OTPInputContext);
4556
+ const { char, hasFakeCaret, isActive } = pinInputContext.slots[index];
4557
+ return /* @__PURE__ */ React25.createElement(
4558
+ "div",
4551
4559
  {
4560
+ ref,
4552
4561
  className: cn(
4553
- "hawa-my-0 hawa-text-start hawa-text-xs hawa-text-helper-color hawa-transition-all",
4554
- props.helperText ? "hawa-h-4 hawa-opacity-100" : "hawa-h-0 hawa-opacity-0"
4555
- )
4562
+ "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",
4563
+ isActive && "hawa-ring-ring hawa-ring-offset-background hawa-z-10 hawa-ring-2",
4564
+ className
4565
+ ),
4566
+ ...props
4556
4567
  },
4557
- props.helperText
4558
- ));
4568
+ char,
4569
+ 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" }))
4570
+ );
4571
+ });
4572
+ PinInputSlot.displayName = "PinInputSlot";
4573
+ var PinInputSeperator = React25.forwardRef(({ ...props }, ref) => /* @__PURE__ */ React25.createElement("div", { ref, role: "separator", ...props }, /* @__PURE__ */ React25.createElement(Dot, null)));
4574
+ PinInputSeperator.displayName = "PinInputSeperator";
4575
+ var PinInput = ({
4576
+ separatorPosition = 0,
4577
+ ...props
4578
+ }) => {
4579
+ const maxLength = props.maxLength || 6;
4580
+ const clampedSeparatorPosition = Math.min(separatorPosition, maxLength);
4581
+ const firstGroupLength = clampedSeparatorPosition > 0 ? clampedSeparatorPosition : 0;
4582
+ const secondGroupLength = maxLength - firstGroupLength;
4583
+ 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(
4584
+ PinInputSlot,
4585
+ {
4586
+ key: index + firstGroupLength,
4587
+ index: index + firstGroupLength,
4588
+ className: "hawa-w-full"
4589
+ }
4590
+ )))), /* @__PURE__ */ React25.createElement(HelperText, { helperText: props.helperText }));
4559
4591
  };
4560
4592
 
4561
4593
  // blocks/auth/CodeConfirmation.tsx
4562
- var CodeConfirmation = (props) => {
4594
+ var CodeConfirmation = ({
4595
+ codeLength = 6,
4596
+ ...props
4597
+ }) => {
4563
4598
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
4564
4599
  const formSchema = z5.object({
4565
- otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(6, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
4600
+ 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
4601
  });
4567
4602
  const { handleSubmit, control, formState, setValue } = (0, import_react_hook_form5.useForm)({
4568
4603
  resolver: (0, import_zod5.zodResolver)(formSchema)
4569
4604
  });
4570
- const [resendTimer, setResendTimer] = (0, import_react23.useState)(null);
4571
- const [remainingTime, setRemainingTime] = (0, import_react23.useState)(0);
4572
- const [showResendTimer, setShowResendTimer] = (0, import_react23.useState)(false);
4605
+ const [resendTimer, setResendTimer] = (0, import_react24.useState)(null);
4606
+ const [remainingTime, setRemainingTime] = (0, import_react24.useState)(0);
4607
+ const [showResendTimer, setShowResendTimer] = (0, import_react24.useState)(false);
4573
4608
  const startResendTimer = () => {
4574
4609
  if (resendTimer !== null) {
4575
4610
  clearInterval(resendTimer);
@@ -4591,21 +4626,21 @@ var CodeConfirmation = (props) => {
4591
4626
  }, 1e3);
4592
4627
  setResendTimer(newTimer);
4593
4628
  };
4594
- (0, import_react23.useEffect)(() => {
4629
+ (0, import_react24.useEffect)(() => {
4595
4630
  return () => {
4596
4631
  if (resendTimer !== null) {
4597
4632
  clearInterval(resendTimer);
4598
4633
  }
4599
4634
  };
4600
4635
  }, []);
4601
- return /* @__PURE__ */ import_react23.default.createElement(Card, null, /* @__PURE__ */ import_react23.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react23.default.createElement(
4636
+ return /* @__PURE__ */ import_react24.default.createElement(Card, null, /* @__PURE__ */ import_react24.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react24.default.createElement(
4602
4637
  Alert,
4603
4638
  {
4604
4639
  title: props.errorTitle,
4605
4640
  text: props.errorText,
4606
4641
  severity: "error"
4607
4642
  }
4608
- ), /* @__PURE__ */ import_react23.default.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ import_react23.default.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ import_react23.default.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ import_react23.default.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ import_react23.default.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ import_react23.default.createElement(
4643
+ ), /* @__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
4644
  "form",
4610
4645
  {
4611
4646
  noValidate: true,
@@ -4619,26 +4654,25 @@ var CodeConfirmation = (props) => {
4619
4654
  }
4620
4655
  })
4621
4656
  },
4622
- /* @__PURE__ */ import_react23.default.createElement(
4657
+ /* @__PURE__ */ import_react24.default.createElement(
4623
4658
  import_react_hook_form5.Controller,
4624
4659
  {
4625
4660
  control,
4626
4661
  name: "otp_code",
4627
4662
  render: ({ field }) => {
4628
4663
  var _a2;
4629
- return /* @__PURE__ */ import_react23.default.createElement(
4664
+ return /* @__PURE__ */ import_react24.default.createElement(
4630
4665
  PinInput,
4631
4666
  {
4632
- width: "full",
4633
- digits: 6,
4634
- getPins: (e) => setValue("otp_code", e.join("")),
4635
- helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message
4667
+ maxLength: codeLength,
4668
+ helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message,
4669
+ ...field
4636
4670
  }
4637
4671
  );
4638
4672
  }
4639
4673
  }
4640
4674
  ),
4641
- showResendTimer ? /* @__PURE__ */ import_react23.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_react23.default.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ import_react23.default.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ import_react23.default.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ import_react23.default.createElement(
4675
+ 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
4676
  "span",
4643
4677
  {
4644
4678
  className: "clickable-link",
@@ -4649,7 +4683,7 @@ var CodeConfirmation = (props) => {
4649
4683
  },
4650
4684
  ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
4651
4685
  )),
4652
- /* @__PURE__ */ import_react23.default.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ import_react23.default.createElement(Button, { variant: "outline" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ import_react23.default.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
4686
+ /* @__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
4687
  )));
4654
4688
  };
4655
4689
  // Annotate the CommonJS export names for ESM import in node:
@@ -4663,3 +4697,53 @@ var CodeConfirmation = (props) => {
4663
4697
  RegisterForm,
4664
4698
  ResetPasswordForm
4665
4699
  });
4700
+ /*! Bundled license information:
4701
+
4702
+ lucide-react/dist/esm/shared/src/utils.js:
4703
+ (**
4704
+ * @license lucide-react v0.379.0 - ISC
4705
+ *
4706
+ * This source code is licensed under the ISC license.
4707
+ * See the LICENSE file in the root directory of this source tree.
4708
+ *)
4709
+
4710
+ lucide-react/dist/esm/defaultAttributes.js:
4711
+ (**
4712
+ * @license lucide-react v0.379.0 - ISC
4713
+ *
4714
+ * This source code is licensed under the ISC license.
4715
+ * See the LICENSE file in the root directory of this source tree.
4716
+ *)
4717
+
4718
+ lucide-react/dist/esm/Icon.js:
4719
+ (**
4720
+ * @license lucide-react v0.379.0 - ISC
4721
+ *
4722
+ * This source code is licensed under the ISC license.
4723
+ * See the LICENSE file in the root directory of this source tree.
4724
+ *)
4725
+
4726
+ lucide-react/dist/esm/createLucideIcon.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/icons/dot.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/lucide-react.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
+ */