@sikka/hawa 0.46.0-next → 0.46.3-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 (84) hide show
  1. package/dist/blocks/auth/index.js +31 -13
  2. package/dist/blocks/auth/index.mjs +4 -4
  3. package/dist/blocks/feedback/index.js +6 -0
  4. package/dist/blocks/feedback/index.mjs +5 -5
  5. package/dist/blocks/index.js +31 -13
  6. package/dist/blocks/index.mjs +2 -2
  7. package/dist/blocks/misc/index.js +31 -13
  8. package/dist/blocks/misc/index.mjs +5 -5
  9. package/dist/blocks/pricing/index.js +6 -0
  10. package/dist/blocks/pricing/index.mjs +4 -4
  11. package/dist/{chunk-6LI35F6L.mjs → chunk-6UOJKVIA.mjs} +6 -0
  12. package/dist/{chunk-JKZQWCAQ.mjs → chunk-7L5VUKZ7.mjs} +27 -15
  13. package/dist/{chunk-D3B3MKLS.mjs → chunk-7O555VJR.mjs} +1 -1
  14. package/dist/{chunk-XC6FSDW7.mjs → chunk-CIMTNOLA.mjs} +1 -1
  15. package/dist/{chunk-FIUKVRL5.mjs → chunk-EHJXQQDP.mjs} +1 -1
  16. package/dist/{chunk-3B7UZCET.mjs → chunk-HJVL6X7I.mjs} +6 -0
  17. package/dist/{chunk-IEB2ANWU.mjs → chunk-QLUJEUIB.mjs} +33 -21
  18. package/dist/{chunk-YABFWOF3.mjs → chunk-R37QEYSB.mjs} +1 -1
  19. package/dist/{chunk-FUYMZP4J.mjs → chunk-U72MOMEK.mjs} +1 -1
  20. package/dist/{chunk-JDCQLGWW.mjs → chunk-YXUHXKKK.mjs} +1 -1
  21. package/dist/colorPicker/index.js +6 -0
  22. package/dist/colorPicker/index.js.map +1 -1
  23. package/dist/colorPicker/index.mjs +6 -0
  24. package/dist/colorPicker/index.mjs.map +1 -1
  25. package/dist/combobox/index.js +7 -0
  26. package/dist/combobox/index.js.map +1 -1
  27. package/dist/combobox/index.mjs +7 -0
  28. package/dist/combobox/index.mjs.map +1 -1
  29. package/dist/command/index.js +1 -0
  30. package/dist/command/index.js.map +1 -1
  31. package/dist/command/index.mjs +1 -0
  32. package/dist/command/index.mjs.map +1 -1
  33. package/dist/dataTable/index.js +31 -13
  34. package/dist/dataTable/index.js.map +1 -1
  35. package/dist/dataTable/index.mjs +32 -14
  36. package/dist/dataTable/index.mjs.map +1 -1
  37. package/dist/elements/index.d.mts +4 -3
  38. package/dist/elements/index.d.ts +4 -3
  39. package/dist/elements/index.js +32 -13
  40. package/dist/elements/index.mjs +4 -3
  41. package/dist/index.css +1 -1
  42. package/dist/index.d.mts +4 -3
  43. package/dist/index.d.ts +4 -3
  44. package/dist/index.js +32 -13
  45. package/dist/index.mjs +139 -120
  46. package/dist/input/index.d.mts +2 -2
  47. package/dist/input/index.d.ts +2 -2
  48. package/dist/input/index.js +31 -13
  49. package/dist/input/index.js.map +1 -1
  50. package/dist/input/index.mjs +32 -14
  51. package/dist/input/index.mjs.map +1 -1
  52. package/dist/layout/index.js +6 -0
  53. package/dist/layout/index.mjs +2 -2
  54. package/dist/passwordInput/index.js +31 -13
  55. package/dist/passwordInput/index.js.map +1 -1
  56. package/dist/passwordInput/index.mjs +42 -24
  57. package/dist/passwordInput/index.mjs.map +1 -1
  58. package/dist/phoneInput/index.js +6 -0
  59. package/dist/phoneInput/index.js.map +1 -1
  60. package/dist/phoneInput/index.mjs +6 -0
  61. package/dist/phoneInput/index.mjs.map +1 -1
  62. package/dist/select/index.js +6 -0
  63. package/dist/select/index.js.map +1 -1
  64. package/dist/select/index.mjs +6 -0
  65. package/dist/select/index.mjs.map +1 -1
  66. package/dist/simpleTable/index.js +6 -0
  67. package/dist/simpleTable/index.js.map +1 -1
  68. package/dist/simpleTable/index.mjs +6 -0
  69. package/dist/simpleTable/index.mjs.map +1 -1
  70. package/dist/skeleton/index.d.mts +2 -1
  71. package/dist/skeleton/index.d.ts +2 -1
  72. package/dist/skeleton/index.js +6 -0
  73. package/dist/skeleton/index.js.map +1 -1
  74. package/dist/skeleton/index.mjs +6 -0
  75. package/dist/skeleton/index.mjs.map +1 -1
  76. package/dist/stats/index.js +6 -0
  77. package/dist/stats/index.js.map +1 -1
  78. package/dist/stats/index.mjs +6 -0
  79. package/dist/stats/index.mjs.map +1 -1
  80. package/dist/textarea/index.js +6 -0
  81. package/dist/textarea/index.js.map +1 -1
  82. package/dist/textarea/index.mjs +6 -0
  83. package/dist/textarea/index.mjs.map +1 -1
  84. package/package.json +1 -1
@@ -1386,6 +1386,7 @@ function Skeleton({
1386
1386
  content,
1387
1387
  animation = "pulse",
1388
1388
  fade,
1389
+ as = "div",
1389
1390
  ...props
1390
1391
  }) {
1391
1392
  const animationStyles = {
@@ -1399,6 +1400,10 @@ function Skeleton({
1399
1400
  right: "hawa-mask-fade-right",
1400
1401
  left: "hawa-mask-fade-left "
1401
1402
  };
1403
+ const styledAs = {
1404
+ div: "",
1405
+ input: "!h-[38px] !w-full"
1406
+ };
1402
1407
  return /* @__PURE__ */ import_react7.default.createElement(
1403
1408
  "div",
1404
1409
  {
@@ -1406,6 +1411,7 @@ function Skeleton({
1406
1411
  animationStyles[animation],
1407
1412
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
1408
1413
  fade && fadeStyle[fade],
1414
+ styledAs[as],
1409
1415
  className
1410
1416
  ),
1411
1417
  ...props
@@ -1429,6 +1435,7 @@ var Input = (0, import_react8.forwardRef)(
1429
1435
  ...props
1430
1436
  }, ref) => {
1431
1437
  var _a;
1438
+ const [value, setValue] = (0, import_react8.useState)(props.value || "");
1432
1439
  let marginStyles = {
1433
1440
  none: "hawa-mb-0",
1434
1441
  normal: "hawa-mb-3",
@@ -1444,6 +1451,7 @@ var Input = (0, import_react8.forwardRef)(
1444
1451
  let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground";
1445
1452
  const handleChange = (e) => {
1446
1453
  let newValue = e.target.value;
1454
+ setValue(newValue);
1447
1455
  if (props.prefixText) {
1448
1456
  if (newValue.length < props.prefixText.length) {
1449
1457
  newValue = props.prefixText;
@@ -1455,10 +1463,27 @@ var Input = (0, import_react8.forwardRef)(
1455
1463
  }
1456
1464
  }
1457
1465
  if (props.onChange) {
1458
- const newEvent = { ...e, target: { ...e.target, value: newValue } };
1459
- props.onChange(newEvent);
1466
+ if (props.type === "number" && props.maxLength) {
1467
+ console.log("type is ", props.type);
1468
+ console.log("max length is ", props.maxLength);
1469
+ let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
1470
+ const newEvent = { ...e, target: { ...e.target, value: v } };
1471
+ setValue(v);
1472
+ props.onChange(newEvent);
1473
+ } else {
1474
+ console.log("NETIHERRRER");
1475
+ const newEvent = { ...e, target: { ...e.target, value: newValue } };
1476
+ setValue(newValue);
1477
+ props.onChange(newEvent);
1478
+ }
1460
1479
  }
1461
1480
  };
1481
+ const handleKeyDown = (e) => {
1482
+ if (props.type === "number" && ["e", "E", "+", "-", "."].includes(e.key)) {
1483
+ e.preventDefault();
1484
+ }
1485
+ props.onKeyDown && props.onKeyDown(e);
1486
+ };
1462
1487
  return /* @__PURE__ */ import_react8.default.createElement(
1463
1488
  "div",
1464
1489
  {
@@ -1471,16 +1496,7 @@ var Input = (0, import_react8.forwardRef)(
1471
1496
  )
1472
1497
  },
1473
1498
  props.label && /* @__PURE__ */ import_react8.default.createElement(Label, { ...labelProps }, props.label),
1474
- /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement(
1475
- "span",
1476
- {
1477
- className: cn(
1478
- "hawa-me-2 hawa-opacity-90",
1479
- !forceHideHelperText && "hawa-mb-2"
1480
- )
1481
- },
1482
- props.outsidePrefix
1483
- ), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(
1499
+ /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(
1484
1500
  Skeleton,
1485
1501
  {
1486
1502
  animation: "none",
@@ -1527,13 +1543,15 @@ var Input = (0, import_react8.forwardRef)(
1527
1543
  required: true,
1528
1544
  dir: props.dir,
1529
1545
  type: props.type,
1530
- value: props.value,
1546
+ value: props.value || value,
1531
1547
  onChange: handleChange,
1548
+ onKeyDown: handleKeyDown,
1532
1549
  autoComplete: props.autoComplete,
1533
1550
  defaultValue: props.defaultValue,
1534
1551
  placeholder,
1535
1552
  disabled: props.disabled || preview,
1536
1553
  style: { height: 40 },
1554
+ maxLength: props.maxLength,
1537
1555
  ...inputProps,
1538
1556
  className: cn(
1539
1557
  defaultInputStyle,
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "../../chunk-JKZQWCAQ.mjs";
4
+ } from "../../chunk-7L5VUKZ7.mjs";
5
5
  import {
6
6
  StopPropagationWrapper
7
7
  } from "../../chunk-47APBDKK.mjs";
8
8
  import {
9
9
  Select
10
- } from "../../chunk-D3B3MKLS.mjs";
10
+ } from "../../chunk-7O555VJR.mjs";
11
11
  import {
12
12
  EyeIcon,
13
13
  HiddenEyeIcon
14
- } from "../../chunk-JDCQLGWW.mjs";
14
+ } from "../../chunk-YXUHXKKK.mjs";
15
15
  import {
16
16
  Button,
17
17
  Card,
@@ -24,7 +24,7 @@ import {
24
24
  Label,
25
25
  Loading,
26
26
  cn
27
- } from "../../chunk-6LI35F6L.mjs";
27
+ } from "../../chunk-6UOJKVIA.mjs";
28
28
 
29
29
  // blocks/auth/AuthButtons.tsx
30
30
  import React2 from "react";
@@ -948,6 +948,7 @@ function Skeleton({
948
948
  content,
949
949
  animation = "pulse",
950
950
  fade,
951
+ as = "div",
951
952
  ...props
952
953
  }) {
953
954
  const animationStyles = {
@@ -961,6 +962,10 @@ function Skeleton({
961
962
  right: "hawa-mask-fade-right",
962
963
  left: "hawa-mask-fade-left "
963
964
  };
965
+ const styledAs = {
966
+ div: "",
967
+ input: "!h-[38px] !w-full"
968
+ };
964
969
  return /* @__PURE__ */ import_react5.default.createElement(
965
970
  "div",
966
971
  {
@@ -968,6 +973,7 @@ function Skeleton({
968
973
  animationStyles[animation],
969
974
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
970
975
  fade && fadeStyle[fade],
976
+ styledAs[as],
971
977
  className
972
978
  ),
973
979
  ...props
@@ -1,26 +1,26 @@
1
1
  "use client";
2
2
  import {
3
3
  Textarea
4
- } from "../../chunk-FIUKVRL5.mjs";
4
+ } from "../../chunk-EHJXQQDP.mjs";
5
5
  import {
6
6
  Select
7
- } from "../../chunk-D3B3MKLS.mjs";
7
+ } from "../../chunk-7O555VJR.mjs";
8
8
  import {
9
9
  Popover,
10
10
  Radio
11
- } from "../../chunk-YABFWOF3.mjs";
11
+ } from "../../chunk-R37QEYSB.mjs";
12
12
  import {
13
13
  BadEmoji,
14
14
  GoodEmoji,
15
15
  VeryBadEmoji,
16
16
  VeryGoodEmoji
17
- } from "../../chunk-JDCQLGWW.mjs";
17
+ } from "../../chunk-YXUHXKKK.mjs";
18
18
  import {
19
19
  Button,
20
20
  Card,
21
21
  CardContent,
22
22
  cn
23
- } from "../../chunk-6LI35F6L.mjs";
23
+ } from "../../chunk-6UOJKVIA.mjs";
24
24
 
25
25
  // blocks/feedback/UserReferralSource.tsx
26
26
  import React, { useRef, useState } from "react";
@@ -1407,6 +1407,7 @@ function Skeleton({
1407
1407
  content,
1408
1408
  animation = "pulse",
1409
1409
  fade,
1410
+ as = "div",
1410
1411
  ...props
1411
1412
  }) {
1412
1413
  const animationStyles = {
@@ -1420,6 +1421,10 @@ function Skeleton({
1420
1421
  right: "hawa-mask-fade-right",
1421
1422
  left: "hawa-mask-fade-left "
1422
1423
  };
1424
+ const styledAs = {
1425
+ div: "",
1426
+ input: "!h-[38px] !w-full"
1427
+ };
1423
1428
  return /* @__PURE__ */ import_react7.default.createElement(
1424
1429
  "div",
1425
1430
  {
@@ -1427,6 +1432,7 @@ function Skeleton({
1427
1432
  animationStyles[animation],
1428
1433
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
1429
1434
  fade && fadeStyle[fade],
1435
+ styledAs[as],
1430
1436
  className
1431
1437
  ),
1432
1438
  ...props
@@ -1450,6 +1456,7 @@ var Input = (0, import_react8.forwardRef)(
1450
1456
  ...props
1451
1457
  }, ref) => {
1452
1458
  var _a;
1459
+ const [value, setValue] = (0, import_react8.useState)(props.value || "");
1453
1460
  let marginStyles = {
1454
1461
  none: "hawa-mb-0",
1455
1462
  normal: "hawa-mb-3",
@@ -1465,6 +1472,7 @@ var Input = (0, import_react8.forwardRef)(
1465
1472
  let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground";
1466
1473
  const handleChange = (e) => {
1467
1474
  let newValue = e.target.value;
1475
+ setValue(newValue);
1468
1476
  if (props.prefixText) {
1469
1477
  if (newValue.length < props.prefixText.length) {
1470
1478
  newValue = props.prefixText;
@@ -1476,10 +1484,27 @@ var Input = (0, import_react8.forwardRef)(
1476
1484
  }
1477
1485
  }
1478
1486
  if (props.onChange) {
1479
- const newEvent = { ...e, target: { ...e.target, value: newValue } };
1480
- props.onChange(newEvent);
1487
+ if (props.type === "number" && props.maxLength) {
1488
+ console.log("type is ", props.type);
1489
+ console.log("max length is ", props.maxLength);
1490
+ let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
1491
+ const newEvent = { ...e, target: { ...e.target, value: v } };
1492
+ setValue(v);
1493
+ props.onChange(newEvent);
1494
+ } else {
1495
+ console.log("NETIHERRRER");
1496
+ const newEvent = { ...e, target: { ...e.target, value: newValue } };
1497
+ setValue(newValue);
1498
+ props.onChange(newEvent);
1499
+ }
1481
1500
  }
1482
1501
  };
1502
+ const handleKeyDown = (e) => {
1503
+ if (props.type === "number" && ["e", "E", "+", "-", "."].includes(e.key)) {
1504
+ e.preventDefault();
1505
+ }
1506
+ props.onKeyDown && props.onKeyDown(e);
1507
+ };
1483
1508
  return /* @__PURE__ */ import_react8.default.createElement(
1484
1509
  "div",
1485
1510
  {
@@ -1492,16 +1517,7 @@ var Input = (0, import_react8.forwardRef)(
1492
1517
  )
1493
1518
  },
1494
1519
  props.label && /* @__PURE__ */ import_react8.default.createElement(Label, { ...labelProps }, props.label),
1495
- /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement(
1496
- "span",
1497
- {
1498
- className: cn(
1499
- "hawa-me-2 hawa-opacity-90",
1500
- !forceHideHelperText && "hawa-mb-2"
1501
- )
1502
- },
1503
- props.outsidePrefix
1504
- ), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(
1520
+ /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react8.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react8.default.createElement(
1505
1521
  Skeleton,
1506
1522
  {
1507
1523
  animation: "none",
@@ -1548,13 +1564,15 @@ var Input = (0, import_react8.forwardRef)(
1548
1564
  required: true,
1549
1565
  dir: props.dir,
1550
1566
  type: props.type,
1551
- value: props.value,
1567
+ value: props.value || value,
1552
1568
  onChange: handleChange,
1569
+ onKeyDown: handleKeyDown,
1553
1570
  autoComplete: props.autoComplete,
1554
1571
  defaultValue: props.defaultValue,
1555
1572
  placeholder,
1556
1573
  disabled: props.disabled || preview,
1557
1574
  style: { height: 40 },
1575
+ maxLength: props.maxLength,
1558
1576
  ...inputProps,
1559
1577
  className: cn(
1560
1578
  defaultInputStyle,
@@ -17,7 +17,7 @@ import {
17
17
  TabsList,
18
18
  TabsTrigger,
19
19
  Textarea
20
- } from "../chunk-IEB2ANWU.mjs";
20
+ } from "../chunk-QLUJEUIB.mjs";
21
21
  import {
22
22
  getHotkeyHandler
23
23
  } from "../chunk-WL7C2A5D.mjs";
@@ -44,7 +44,7 @@ import {
44
44
  VeryBadEmoji,
45
45
  VeryGoodEmoji,
46
46
  cn
47
- } from "../chunk-3B7UZCET.mjs";
47
+ } from "../chunk-HJVL6X7I.mjs";
48
48
  import "../chunk-2LUXOXAL.mjs";
49
49
 
50
50
  // blocks/auth/AuthButtons.tsx
@@ -1195,6 +1195,7 @@ function Skeleton({
1195
1195
  content,
1196
1196
  animation = "pulse",
1197
1197
  fade,
1198
+ as = "div",
1198
1199
  ...props
1199
1200
  }) {
1200
1201
  const animationStyles = {
@@ -1208,6 +1209,10 @@ function Skeleton({
1208
1209
  right: "hawa-mask-fade-right",
1209
1210
  left: "hawa-mask-fade-left "
1210
1211
  };
1212
+ const styledAs = {
1213
+ div: "",
1214
+ input: "!h-[38px] !w-full"
1215
+ };
1211
1216
  return /* @__PURE__ */ import_react27.default.createElement(
1212
1217
  "div",
1213
1218
  {
@@ -1215,6 +1220,7 @@ function Skeleton({
1215
1220
  animationStyles[animation],
1216
1221
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
1217
1222
  fade && fadeStyle[fade],
1223
+ styledAs[as],
1218
1224
  className
1219
1225
  ),
1220
1226
  ...props
@@ -1238,6 +1244,7 @@ var Input = (0, import_react28.forwardRef)(
1238
1244
  ...props
1239
1245
  }, ref) => {
1240
1246
  var _a;
1247
+ const [value, setValue] = (0, import_react28.useState)(props.value || "");
1241
1248
  let marginStyles = {
1242
1249
  none: "hawa-mb-0",
1243
1250
  normal: "hawa-mb-3",
@@ -1253,6 +1260,7 @@ var Input = (0, import_react28.forwardRef)(
1253
1260
  let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground";
1254
1261
  const handleChange = (e) => {
1255
1262
  let newValue = e.target.value;
1263
+ setValue(newValue);
1256
1264
  if (props.prefixText) {
1257
1265
  if (newValue.length < props.prefixText.length) {
1258
1266
  newValue = props.prefixText;
@@ -1264,10 +1272,27 @@ var Input = (0, import_react28.forwardRef)(
1264
1272
  }
1265
1273
  }
1266
1274
  if (props.onChange) {
1267
- const newEvent = { ...e, target: { ...e.target, value: newValue } };
1268
- props.onChange(newEvent);
1275
+ if (props.type === "number" && props.maxLength) {
1276
+ console.log("type is ", props.type);
1277
+ console.log("max length is ", props.maxLength);
1278
+ let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
1279
+ const newEvent = { ...e, target: { ...e.target, value: v } };
1280
+ setValue(v);
1281
+ props.onChange(newEvent);
1282
+ } else {
1283
+ console.log("NETIHERRRER");
1284
+ const newEvent = { ...e, target: { ...e.target, value: newValue } };
1285
+ setValue(newValue);
1286
+ props.onChange(newEvent);
1287
+ }
1269
1288
  }
1270
1289
  };
1290
+ const handleKeyDown = (e) => {
1291
+ if (props.type === "number" && ["e", "E", "+", "-", "."].includes(e.key)) {
1292
+ e.preventDefault();
1293
+ }
1294
+ props.onKeyDown && props.onKeyDown(e);
1295
+ };
1271
1296
  return /* @__PURE__ */ import_react28.default.createElement(
1272
1297
  "div",
1273
1298
  {
@@ -1280,16 +1305,7 @@ var Input = (0, import_react28.forwardRef)(
1280
1305
  )
1281
1306
  },
1282
1307
  props.label && /* @__PURE__ */ import_react28.default.createElement(Label, { ...labelProps }, props.label),
1283
- /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react28.default.createElement(
1284
- "span",
1285
- {
1286
- className: cn(
1287
- "hawa-me-2 hawa-opacity-90",
1288
- !forceHideHelperText && "hawa-mb-2"
1289
- )
1290
- },
1291
- props.outsidePrefix
1292
- ), props.isLoading ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(
1308
+ /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ import_react28.default.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react28.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react28.default.createElement(
1293
1309
  Skeleton,
1294
1310
  {
1295
1311
  animation: "none",
@@ -1336,13 +1352,15 @@ var Input = (0, import_react28.forwardRef)(
1336
1352
  required: true,
1337
1353
  dir: props.dir,
1338
1354
  type: props.type,
1339
- value: props.value,
1355
+ value: props.value || value,
1340
1356
  onChange: handleChange,
1357
+ onKeyDown: handleKeyDown,
1341
1358
  autoComplete: props.autoComplete,
1342
1359
  defaultValue: props.defaultValue,
1343
1360
  placeholder,
1344
1361
  disabled: props.disabled || preview,
1345
1362
  style: { height: 40 },
1363
+ maxLength: props.maxLength,
1346
1364
  ...inputProps,
1347
1365
  className: cn(
1348
1366
  defaultInputStyle,
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  Input
4
- } from "../../chunk-JKZQWCAQ.mjs";
4
+ } from "../../chunk-7L5VUKZ7.mjs";
5
5
  import {
6
6
  Chip,
7
7
  ScrollArea
8
- } from "../../chunk-FUYMZP4J.mjs";
8
+ } from "../../chunk-U72MOMEK.mjs";
9
9
  import {
10
10
  Textarea
11
- } from "../../chunk-FIUKVRL5.mjs";
11
+ } from "../../chunk-EHJXQQDP.mjs";
12
12
  import {
13
13
  Select
14
- } from "../../chunk-D3B3MKLS.mjs";
14
+ } from "../../chunk-7O555VJR.mjs";
15
15
  import {
16
16
  Button,
17
17
  Card,
@@ -21,7 +21,7 @@ import {
21
21
  CardHeader,
22
22
  CardTitle,
23
23
  cn
24
- } from "../../chunk-6LI35F6L.mjs";
24
+ } from "../../chunk-6UOJKVIA.mjs";
25
25
 
26
26
  // blocks/misc/LegalTexts.tsx
27
27
  import React10 from "react";
@@ -622,6 +622,7 @@ function Skeleton({
622
622
  content,
623
623
  animation = "pulse",
624
624
  fade,
625
+ as = "div",
625
626
  ...props
626
627
  }) {
627
628
  const animationStyles = {
@@ -635,6 +636,10 @@ function Skeleton({
635
636
  right: "hawa-mask-fade-right",
636
637
  left: "hawa-mask-fade-left "
637
638
  };
639
+ const styledAs = {
640
+ div: "",
641
+ input: "!h-[38px] !w-full"
642
+ };
638
643
  return /* @__PURE__ */ import_react6.default.createElement(
639
644
  "div",
640
645
  {
@@ -642,6 +647,7 @@ function Skeleton({
642
647
  animationStyles[animation],
643
648
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
644
649
  fade && fadeStyle[fade],
650
+ styledAs[as],
645
651
  className
646
652
  ),
647
653
  ...props
@@ -2,22 +2,22 @@
2
2
  import {
3
3
  Chip,
4
4
  ScrollArea
5
- } from "../../chunk-FUYMZP4J.mjs";
5
+ } from "../../chunk-U72MOMEK.mjs";
6
6
  import "../../chunk-47APBDKK.mjs";
7
7
  import {
8
8
  Radio
9
- } from "../../chunk-YABFWOF3.mjs";
9
+ } from "../../chunk-R37QEYSB.mjs";
10
10
  import {
11
11
  CheckMark,
12
12
  UncheckMark
13
- } from "../../chunk-JDCQLGWW.mjs";
13
+ } from "../../chunk-YXUHXKKK.mjs";
14
14
  import {
15
15
  Button,
16
16
  Card,
17
17
  Skeleton,
18
18
  Tooltip,
19
19
  cn
20
- } from "../../chunk-6LI35F6L.mjs";
20
+ } from "../../chunk-6UOJKVIA.mjs";
21
21
 
22
22
  // blocks/pricing/PricingPlans.tsx
23
23
  import React8 from "react";
@@ -553,6 +553,7 @@ function Skeleton({
553
553
  content,
554
554
  animation = "pulse",
555
555
  fade,
556
+ as = "div",
556
557
  ...props
557
558
  }) {
558
559
  const animationStyles = {
@@ -566,6 +567,10 @@ function Skeleton({
566
567
  right: "hawa-mask-fade-right",
567
568
  left: "hawa-mask-fade-left "
568
569
  };
570
+ const styledAs = {
571
+ div: "",
572
+ input: "!h-[38px] !w-full"
573
+ };
569
574
  return /* @__PURE__ */ React7.createElement(
570
575
  "div",
571
576
  {
@@ -573,6 +578,7 @@ function Skeleton({
573
578
  animationStyles[animation],
574
579
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
575
580
  fade && fadeStyle[fade],
581
+ styledAs[as],
576
582
  className
577
583
  ),
578
584
  ...props
@@ -4,10 +4,10 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6LI35F6L.mjs";
7
+ } from "./chunk-6UOJKVIA.mjs";
8
8
 
9
9
  // elements/input/Input.tsx
10
- import React, { forwardRef } from "react";
10
+ import React, { forwardRef, useState } from "react";
11
11
  var Input = forwardRef(
12
12
  ({
13
13
  margin = "none",
@@ -22,6 +22,7 @@ var Input = forwardRef(
22
22
  ...props
23
23
  }, ref) => {
24
24
  var _a;
25
+ const [value, setValue] = useState(props.value || "");
25
26
  let marginStyles = {
26
27
  none: "hawa-mb-0",
27
28
  normal: "hawa-mb-3",
@@ -37,6 +38,7 @@ var Input = forwardRef(
37
38
  let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm placeholder:hawa-text-muted-foreground";
38
39
  const handleChange = (e) => {
39
40
  let newValue = e.target.value;
41
+ setValue(newValue);
40
42
  if (props.prefixText) {
41
43
  if (newValue.length < props.prefixText.length) {
42
44
  newValue = props.prefixText;
@@ -48,9 +50,26 @@ var Input = forwardRef(
48
50
  }
49
51
  }
50
52
  if (props.onChange) {
51
- const newEvent = { ...e, target: { ...e.target, value: newValue } };
52
- props.onChange(newEvent);
53
+ if (props.type === "number" && props.maxLength) {
54
+ console.log("type is ", props.type);
55
+ console.log("max length is ", props.maxLength);
56
+ let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
57
+ const newEvent = { ...e, target: { ...e.target, value: v } };
58
+ setValue(v);
59
+ props.onChange(newEvent);
60
+ } else {
61
+ console.log("NETIHERRRER");
62
+ const newEvent = { ...e, target: { ...e.target, value: newValue } };
63
+ setValue(newValue);
64
+ props.onChange(newEvent);
65
+ }
66
+ }
67
+ };
68
+ const handleKeyDown = (e) => {
69
+ if (props.type === "number" && ["e", "E", "+", "-", "."].includes(e.key)) {
70
+ e.preventDefault();
53
71
  }
72
+ props.onKeyDown && props.onKeyDown(e);
54
73
  };
55
74
  return /* @__PURE__ */ React.createElement(
56
75
  "div",
@@ -64,16 +83,7 @@ var Input = forwardRef(
64
83
  )
65
84
  },
66
85
  props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
67
- /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement(
68
- "span",
69
- {
70
- className: cn(
71
- "hawa-me-2 hawa-opacity-90",
72
- !forceHideHelperText && "hawa-mb-2"
73
- )
74
- },
75
- props.outsidePrefix
76
- ), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(
86
+ /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React.createElement(
77
87
  Skeleton,
78
88
  {
79
89
  animation: "none",
@@ -120,13 +130,15 @@ var Input = forwardRef(
120
130
  required: true,
121
131
  dir: props.dir,
122
132
  type: props.type,
123
- value: props.value,
133
+ value: props.value || value,
124
134
  onChange: handleChange,
135
+ onKeyDown: handleKeyDown,
125
136
  autoComplete: props.autoComplete,
126
137
  defaultValue: props.defaultValue,
127
138
  placeholder,
128
139
  disabled: props.disabled || preview,
129
140
  style: { height: 40 },
141
+ maxLength: props.maxLength,
130
142
  ...inputProps,
131
143
  className: cn(
132
144
  defaultInputStyle,
@@ -4,7 +4,7 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6LI35F6L.mjs";
7
+ } from "./chunk-6UOJKVIA.mjs";
8
8
 
9
9
  // elements/select/Select.tsx
10
10
  import React from "react";
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  cn
4
- } from "./chunk-3B7UZCET.mjs";
4
+ } from "./chunk-HJVL6X7I.mjs";
5
5
 
6
6
  // elements/sheet/Sheet.tsx
7
7
  import * as React from "react";
@@ -4,7 +4,7 @@ import {
4
4
  Label,
5
5
  Skeleton,
6
6
  cn
7
- } from "./chunk-6LI35F6L.mjs";
7
+ } from "./chunk-6UOJKVIA.mjs";
8
8
 
9
9
  // elements/textarea/Textarea.tsx
10
10
  import * as React from "react";