@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.
- package/dist/blocks/auth/index.js +31 -13
- package/dist/blocks/auth/index.mjs +4 -4
- package/dist/blocks/feedback/index.js +6 -0
- package/dist/blocks/feedback/index.mjs +5 -5
- package/dist/blocks/index.js +31 -13
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/misc/index.js +31 -13
- package/dist/blocks/misc/index.mjs +5 -5
- package/dist/blocks/pricing/index.js +6 -0
- package/dist/blocks/pricing/index.mjs +4 -4
- package/dist/{chunk-6LI35F6L.mjs → chunk-6UOJKVIA.mjs} +6 -0
- package/dist/{chunk-JKZQWCAQ.mjs → chunk-7L5VUKZ7.mjs} +27 -15
- package/dist/{chunk-D3B3MKLS.mjs → chunk-7O555VJR.mjs} +1 -1
- package/dist/{chunk-XC6FSDW7.mjs → chunk-CIMTNOLA.mjs} +1 -1
- package/dist/{chunk-FIUKVRL5.mjs → chunk-EHJXQQDP.mjs} +1 -1
- package/dist/{chunk-3B7UZCET.mjs → chunk-HJVL6X7I.mjs} +6 -0
- package/dist/{chunk-IEB2ANWU.mjs → chunk-QLUJEUIB.mjs} +33 -21
- package/dist/{chunk-YABFWOF3.mjs → chunk-R37QEYSB.mjs} +1 -1
- package/dist/{chunk-FUYMZP4J.mjs → chunk-U72MOMEK.mjs} +1 -1
- package/dist/{chunk-JDCQLGWW.mjs → chunk-YXUHXKKK.mjs} +1 -1
- package/dist/colorPicker/index.js +6 -0
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +6 -0
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/combobox/index.js +7 -0
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +7 -0
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/command/index.js +1 -0
- package/dist/command/index.js.map +1 -1
- package/dist/command/index.mjs +1 -0
- package/dist/command/index.mjs.map +1 -1
- package/dist/dataTable/index.js +31 -13
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +32 -14
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +4 -3
- package/dist/elements/index.d.ts +4 -3
- package/dist/elements/index.js +32 -13
- package/dist/elements/index.mjs +4 -3
- package/dist/index.css +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +32 -13
- package/dist/index.mjs +139 -120
- package/dist/input/index.d.mts +2 -2
- package/dist/input/index.d.ts +2 -2
- package/dist/input/index.js +31 -13
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +32 -14
- package/dist/input/index.mjs.map +1 -1
- package/dist/layout/index.js +6 -0
- package/dist/layout/index.mjs +2 -2
- package/dist/passwordInput/index.js +31 -13
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +42 -24
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +6 -0
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +6 -0
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/select/index.js +6 -0
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +6 -0
- package/dist/select/index.mjs.map +1 -1
- package/dist/simpleTable/index.js +6 -0
- package/dist/simpleTable/index.js.map +1 -1
- package/dist/simpleTable/index.mjs +6 -0
- package/dist/simpleTable/index.mjs.map +1 -1
- package/dist/skeleton/index.d.mts +2 -1
- package/dist/skeleton/index.d.ts +2 -1
- package/dist/skeleton/index.js +6 -0
- package/dist/skeleton/index.js.map +1 -1
- package/dist/skeleton/index.mjs +6 -0
- package/dist/skeleton/index.mjs.map +1 -1
- package/dist/stats/index.js +6 -0
- package/dist/stats/index.js.map +1 -1
- package/dist/stats/index.mjs +6 -0
- package/dist/stats/index.mjs.map +1 -1
- package/dist/textarea/index.js +6 -0
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +6 -0
- package/dist/textarea/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dataTable/index.mjs
CHANGED
@@ -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
|
-
|
1075
|
-
|
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,
|