@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.
Files changed (168) 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 +43 -19
  4. package/dist/alert/index.js.map +1 -1
  5. package/dist/alert/index.mjs +43 -19
  6. package/dist/alert/index.mjs.map +1 -1
  7. package/dist/appLayout/index.js +43 -19
  8. package/dist/appLayout/index.js.map +1 -1
  9. package/dist/appLayout/index.mjs +43 -19
  10. package/dist/appLayout/index.mjs.map +1 -1
  11. package/dist/backToTop/index.js +43 -19
  12. package/dist/backToTop/index.js.map +1 -1
  13. package/dist/backToTop/index.mjs +43 -19
  14. package/dist/backToTop/index.mjs.map +1 -1
  15. package/dist/blocks/auth/index.d.mts +1 -0
  16. package/dist/blocks/auth/index.d.ts +1 -0
  17. package/dist/blocks/auth/index.js +251 -143
  18. package/dist/blocks/auth/index.mjs +205 -102
  19. package/dist/blocks/feedback/index.js +47 -59
  20. package/dist/blocks/feedback/index.mjs +5 -5
  21. package/dist/blocks/index.d.mts +2 -1
  22. package/dist/blocks/index.d.ts +2 -1
  23. package/dist/blocks/index.js +501 -420
  24. package/dist/blocks/index.mjs +11 -9
  25. package/dist/blocks/misc/index.js +48 -51
  26. package/dist/blocks/misc/index.mjs +5 -5
  27. package/dist/blocks/pricing/index.js +47 -41
  28. package/dist/blocks/pricing/index.mjs +4 -4
  29. package/dist/button/index.d.mts +4 -0
  30. package/dist/button/index.d.ts +4 -0
  31. package/dist/button/index.js +43 -19
  32. package/dist/button/index.js.map +1 -1
  33. package/dist/button/index.mjs +43 -19
  34. package/dist/button/index.mjs.map +1 -1
  35. package/dist/calendar/index.js +43 -19
  36. package/dist/calendar/index.js.map +1 -1
  37. package/dist/calendar/index.mjs +43 -19
  38. package/dist/calendar/index.mjs.map +1 -1
  39. package/dist/checkbox/index.d.mts +1 -1
  40. package/dist/checkbox/index.d.ts +1 -1
  41. package/dist/checkbox/index.js.map +1 -1
  42. package/dist/checkbox/index.mjs.map +1 -1
  43. package/dist/{chunk-ZTUWU652.mjs → chunk-EZBHA2IL.mjs} +3 -3
  44. package/dist/{chunk-ODOCZAWC.mjs → chunk-F23GAE2P.mjs} +1 -1
  45. package/dist/{chunk-DS3AACQJ.mjs → chunk-IC5WYNKN.mjs} +1 -1
  46. package/dist/{chunk-QXH7ZDMN.mjs → chunk-RTK6REIK.mjs} +3 -11
  47. package/dist/{chunk-QYWOI3DO.mjs → chunk-UDJFVH2I.mjs} +204 -144
  48. package/dist/{chunk-BPHQFAWM.mjs → chunk-UJ5SXC3M.mjs} +3 -11
  49. package/dist/{chunk-PXGL7ZXQ.mjs → chunk-UMOBOCED.mjs} +44 -19
  50. package/dist/{chunk-RNFJAEEU.mjs → chunk-V7O5MQZQ.mjs} +44 -19
  51. package/dist/{chunk-BTDR3VAG.mjs → chunk-WDCKXU54.mjs} +4 -21
  52. package/dist/{chunk-MDHDHEPZ.mjs → chunk-XFSBC5VI.mjs} +3 -11
  53. package/dist/codeBlock/index.js +43 -19
  54. package/dist/codeBlock/index.js.map +1 -1
  55. package/dist/codeBlock/index.mjs +43 -19
  56. package/dist/codeBlock/index.mjs.map +1 -1
  57. package/dist/colorPicker/index.d.mts +1 -1
  58. package/dist/colorPicker/index.d.ts +1 -1
  59. package/dist/colorPicker/index.js +35 -31
  60. package/dist/colorPicker/index.js.map +1 -1
  61. package/dist/colorPicker/index.mjs +33 -29
  62. package/dist/colorPicker/index.mjs.map +1 -1
  63. package/dist/combobox/index.d.mts +1 -1
  64. package/dist/combobox/index.d.ts +1 -1
  65. package/dist/combobox/index.js +52 -48
  66. package/dist/combobox/index.js.map +1 -1
  67. package/dist/combobox/index.mjs +52 -48
  68. package/dist/combobox/index.mjs.map +1 -1
  69. package/dist/dataTable/index.js +44 -29
  70. package/dist/dataTable/index.js.map +1 -1
  71. package/dist/dataTable/index.mjs +44 -29
  72. package/dist/dataTable/index.mjs.map +1 -1
  73. package/dist/datePicker/index.d.mts +4 -0
  74. package/dist/datePicker/index.d.ts +4 -0
  75. package/dist/datePicker/index.js +44 -19
  76. package/dist/datePicker/index.js.map +1 -1
  77. package/dist/datePicker/index.mjs +44 -19
  78. package/dist/datePicker/index.mjs.map +1 -1
  79. package/dist/docsLayout/index.js +43 -19
  80. package/dist/docsLayout/index.js.map +1 -1
  81. package/dist/docsLayout/index.mjs +43 -19
  82. package/dist/docsLayout/index.mjs.map +1 -1
  83. package/dist/elements/index.d.mts +46 -21
  84. package/dist/elements/index.d.ts +46 -21
  85. package/dist/elements/index.js +378 -309
  86. package/dist/elements/index.mjs +14 -23
  87. package/dist/fileDropzone/index.js +43 -19
  88. package/dist/fileDropzone/index.js.map +1 -1
  89. package/dist/fileDropzone/index.mjs +43 -19
  90. package/dist/fileDropzone/index.mjs.map +1 -1
  91. package/dist/index.css +29 -3
  92. package/dist/index.d.mts +48 -22
  93. package/dist/index.d.ts +48 -22
  94. package/dist/index.js +808 -737
  95. package/dist/index.mjs +331 -264
  96. package/dist/input/index.d.mts +1 -1
  97. package/dist/input/index.d.ts +1 -1
  98. package/dist/input/index.js +46 -42
  99. package/dist/input/index.js.map +1 -1
  100. package/dist/input/index.mjs +45 -41
  101. package/dist/input/index.mjs.map +1 -1
  102. package/dist/interfaceSettings/index.js +64 -69
  103. package/dist/interfaceSettings/index.js.map +1 -1
  104. package/dist/interfaceSettings/index.mjs +57 -62
  105. package/dist/interfaceSettings/index.mjs.map +1 -1
  106. package/dist/layout/index.d.mts +1 -1
  107. package/dist/layout/index.d.ts +1 -1
  108. package/dist/layout/index.js +43 -19
  109. package/dist/layout/index.mjs +2 -2
  110. package/dist/passwordInput/index.js +70 -66
  111. package/dist/passwordInput/index.js.map +1 -1
  112. package/dist/passwordInput/index.mjs +59 -55
  113. package/dist/passwordInput/index.mjs.map +1 -1
  114. package/dist/phoneInput/index.js +50 -55
  115. package/dist/phoneInput/index.js.map +1 -1
  116. package/dist/phoneInput/index.mjs +47 -52
  117. package/dist/phoneInput/index.mjs.map +1 -1
  118. package/dist/pinInput/index.d.mts +37 -16
  119. package/dist/pinInput/index.d.ts +37 -16
  120. package/dist/pinInput/index.js +208 -78
  121. package/dist/pinInput/index.js.map +1 -1
  122. package/dist/pinInput/index.mjs +203 -77
  123. package/dist/pinInput/index.mjs.map +1 -1
  124. package/dist/radio/index.d.mts +1 -1
  125. package/dist/radio/index.d.ts +1 -1
  126. package/dist/radio/index.js +55 -60
  127. package/dist/radio/index.js.map +1 -1
  128. package/dist/radio/index.mjs +50 -55
  129. package/dist/radio/index.mjs.map +1 -1
  130. package/dist/scrollArea/index.js +2 -2
  131. package/dist/scrollArea/index.js.map +1 -1
  132. package/dist/scrollArea/index.mjs +2 -2
  133. package/dist/scrollArea/index.mjs.map +1 -1
  134. package/dist/select/index.d.mts +1 -1
  135. package/dist/select/index.d.ts +1 -1
  136. package/dist/select/index.js +43 -39
  137. package/dist/select/index.js.map +1 -1
  138. package/dist/select/index.mjs +43 -39
  139. package/dist/select/index.mjs.map +1 -1
  140. package/dist/signature/index.d.mts +1 -1
  141. package/dist/signature/index.d.ts +1 -1
  142. package/dist/signature/index.js.map +1 -1
  143. package/dist/signature/index.mjs.map +1 -1
  144. package/dist/sortButton/index.js +43 -19
  145. package/dist/sortButton/index.js.map +1 -1
  146. package/dist/sortButton/index.mjs +43 -19
  147. package/dist/sortButton/index.mjs.map +1 -1
  148. package/dist/splitButton/index.d.mts +4 -0
  149. package/dist/splitButton/index.d.ts +4 -0
  150. package/dist/splitButton/index.js +43 -19
  151. package/dist/splitButton/index.js.map +1 -1
  152. package/dist/splitButton/index.mjs +43 -19
  153. package/dist/splitButton/index.mjs.map +1 -1
  154. package/dist/stats/index.d.mts +1 -1
  155. package/dist/stats/index.d.ts +1 -1
  156. package/dist/stats/index.js.map +1 -1
  157. package/dist/stats/index.mjs.map +1 -1
  158. package/dist/tabs/index.js +2 -2
  159. package/dist/tabs/index.js.map +1 -1
  160. package/dist/tabs/index.mjs +2 -2
  161. package/dist/tabs/index.mjs.map +1 -1
  162. package/dist/textarea/index.d.mts +1 -1
  163. package/dist/textarea/index.d.ts +1 -1
  164. package/dist/textarea/index.js +34 -30
  165. package/dist/textarea/index.js.map +1 -1
  166. package/dist/textarea/index.mjs +34 -30
  167. package/dist/textarea/index.mjs.map +1 -1
  168. 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
- return /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, label && /* @__PURE__ */ React5.createElement(Label, { ...labelProps }, label), /* @__PURE__ */ React5.createElement(
456
- Comp,
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
- design: size === "icon" || size === "smallIcon" ? "spinner" : "dots-pulse",
469
- themeMode: variant === "outline" ? "light" : "dark",
470
- color: loadingColor,
471
- size: size === "sm" || size === "xs" ? "xs" : "button"
472
- }
473
- ) : children
474
- ), showHelperText && /* @__PURE__ */ React5.createElement(HelperText, { helperText: props.helperText }));
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 import_react23 = __toESM(require("react"));
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 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",
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
- 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",
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-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
- )
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
- props.helperText
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 = (props) => {
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(6, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
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, import_react23.useState)(null);
4571
- const [remainingTime, setRemainingTime] = (0, import_react23.useState)(0);
4572
- const [showResendTimer, setShowResendTimer] = (0, import_react23.useState)(false);
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, import_react23.useEffect)(() => {
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__ */ import_react23.default.createElement(Card, null, /* @__PURE__ */ import_react23.default.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ import_react23.default.createElement(
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__ */ 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(
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__ */ import_react23.default.createElement(
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__ */ import_react23.default.createElement(
4688
+ return /* @__PURE__ */ import_react24.default.createElement(
4630
4689
  PinInput,
4631
4690
  {
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
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__ */ 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(
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__ */ 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"))
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
+ */