@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
@@ -993,7 +993,7 @@ var DropdownMenu = ({
993
993
  };
994
994
 
995
995
  // elements/input/Input.tsx
996
- import React9, { forwardRef as forwardRef5 } from "react";
996
+ import React9, { forwardRef as forwardRef5, useState as useState2 } from "react";
997
997
 
998
998
  // elements/skeleton/Skeleton.tsx
999
999
  import React8 from "react";
@@ -1002,6 +1002,7 @@ function Skeleton({
1002
1002
  content,
1003
1003
  animation = "pulse",
1004
1004
  fade,
1005
+ as = "div",
1005
1006
  ...props
1006
1007
  }) {
1007
1008
  const animationStyles = {
@@ -1015,6 +1016,10 @@ function Skeleton({
1015
1016
  right: "hawa-mask-fade-right",
1016
1017
  left: "hawa-mask-fade-left "
1017
1018
  };
1019
+ const styledAs = {
1020
+ div: "",
1021
+ input: "!h-[38px] !w-full"
1022
+ };
1018
1023
  return /* @__PURE__ */ React8.createElement(
1019
1024
  "div",
1020
1025
  {
@@ -1022,6 +1027,7 @@ function Skeleton({
1022
1027
  animationStyles[animation],
1023
1028
  content && "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center",
1024
1029
  fade && fadeStyle[fade],
1030
+ styledAs[as],
1025
1031
  className
1026
1032
  ),
1027
1033
  ...props
@@ -1045,6 +1051,7 @@ var Input = forwardRef5(
1045
1051
  ...props
1046
1052
  }, ref) => {
1047
1053
  var _a;
1054
+ const [value, setValue] = useState2(props.value || "");
1048
1055
  let marginStyles = {
1049
1056
  none: "hawa-mb-0",
1050
1057
  normal: "hawa-mb-3",
@@ -1060,6 +1067,7 @@ var Input = forwardRef5(
1060
1067
  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";
1061
1068
  const handleChange = (e) => {
1062
1069
  let newValue = e.target.value;
1070
+ setValue(newValue);
1063
1071
  if (props.prefixText) {
1064
1072
  if (newValue.length < props.prefixText.length) {
1065
1073
  newValue = props.prefixText;
@@ -1071,9 +1079,26 @@ var Input = forwardRef5(
1071
1079
  }
1072
1080
  }
1073
1081
  if (props.onChange) {
1074
- const newEvent = { ...e, target: { ...e.target, value: newValue } };
1075
- props.onChange(newEvent);
1082
+ if (props.type === "number" && props.maxLength) {
1083
+ console.log("type is ", props.type);
1084
+ console.log("max length is ", props.maxLength);
1085
+ let v = newValue.replace(/[^0-9]/g, "").slice(0, props.maxLength);
1086
+ const newEvent = { ...e, target: { ...e.target, value: v } };
1087
+ setValue(v);
1088
+ props.onChange(newEvent);
1089
+ } else {
1090
+ console.log("NETIHERRRER");
1091
+ const newEvent = { ...e, target: { ...e.target, value: newValue } };
1092
+ setValue(newValue);
1093
+ props.onChange(newEvent);
1094
+ }
1095
+ }
1096
+ };
1097
+ const handleKeyDown = (e) => {
1098
+ if (props.type === "number" && ["e", "E", "+", "-", "."].includes(e.key)) {
1099
+ e.preventDefault();
1076
1100
  }
1101
+ props.onKeyDown && props.onKeyDown(e);
1077
1102
  };
1078
1103
  return /* @__PURE__ */ React9.createElement(
1079
1104
  "div",
@@ -1087,16 +1112,7 @@ var Input = forwardRef5(
1087
1112
  )
1088
1113
  },
1089
1114
  props.label && /* @__PURE__ */ React9.createElement(Label, { ...labelProps }, props.label),
1090
- /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React9.createElement(
1091
- "span",
1092
- {
1093
- className: cn(
1094
- "hawa-me-2 hawa-opacity-90",
1095
- !forceHideHelperText && "hawa-mb-2"
1096
- )
1097
- },
1098
- props.outsidePrefix
1099
- ), props.isLoading ? /* @__PURE__ */ React9.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React9.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React9.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React9.createElement(
1115
+ /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center" }, props.outsidePrefix && /* @__PURE__ */ React9.createElement("span", { className: cn("hawa-me-2 hawa-opacity-90", !forceHideHelperText && "hawa-mb-2") }, props.outsidePrefix), props.isLoading ? /* @__PURE__ */ React9.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React9.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ React9.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ React9.createElement(
1100
1116
  Skeleton,
1101
1117
  {
1102
1118
  animation: "none",
@@ -1143,13 +1159,15 @@ var Input = forwardRef5(
1143
1159
  required: true,
1144
1160
  dir: props.dir,
1145
1161
  type: props.type,
1146
- value: props.value,
1162
+ value: props.value || value,
1147
1163
  onChange: handleChange,
1164
+ onKeyDown: handleKeyDown,
1148
1165
  autoComplete: props.autoComplete,
1149
1166
  defaultValue: props.defaultValue,
1150
1167
  placeholder,
1151
1168
  disabled: props.disabled || preview,
1152
1169
  style: { height: 40 },
1170
+ maxLength: props.maxLength,
1153
1171
  ...inputProps,
1154
1172
  className: cn(
1155
1173
  defaultInputStyle,