@sikka/hawa 0.30.1-next → 0.30.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/Label-9FHRF7Ex.d.mts +14 -0
- package/dist/Label-9FHRF7Ex.d.ts +14 -0
- package/dist/blocks/auth/index.js +29 -3
- package/dist/blocks/auth/index.mjs +2 -2
- package/dist/blocks/index.js +31 -5
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/misc/index.js +28 -2
- package/dist/blocks/misc/index.mjs +1 -1
- package/dist/{chunk-KZCOE6V3.mjs → chunk-E6VRANQ3.mjs} +28 -2
- package/dist/{chunk-Q754X27Z.mjs → chunk-N4O2A727.mjs} +30 -4
- package/dist/dataTable/index.js +28 -2
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +28 -2
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +7 -2
- package/dist/elements/index.d.ts +7 -2
- package/dist/elements/index.js +35 -24
- package/dist/elements/index.mjs +6 -21
- package/dist/index.css +0 -10
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +36 -25
- package/dist/index.mjs +36 -25
- package/dist/input/index.d.mts +2 -0
- package/dist/input/index.d.ts +2 -0
- package/dist/input/index.js +28 -2
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +28 -2
- package/dist/input/index.mjs.map +1 -1
- package/dist/passwordInput/index.js +28 -2
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +28 -2
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/progress/index.d.mts +5 -1
- package/dist/progress/index.d.ts +5 -1
- package/dist/progress/index.js +120 -4
- package/dist/progress/index.js.map +1 -1
- package/dist/progress/index.mjs +120 -4
- package/dist/progress/index.mjs.map +1 -1
- package/dist/progressCircle/index.d.mts +1 -1
- package/dist/progressCircle/index.d.ts +1 -1
- package/dist/progressCircle/index.js +5 -20
- package/dist/progressCircle/index.js.map +1 -1
- package/dist/progressCircle/index.mjs +5 -20
- package/dist/progressCircle/index.mjs.map +1 -1
- package/dist/radio/index.d.mts +1 -12
- package/dist/radio/index.d.ts +1 -12
- package/package.json +1 -1
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
type DirectionType = "rtl" | "ltr";
|
4
|
+
type PositionType = "top" | "bottom" | "right" | "left";
|
5
|
+
type OrientationType = "vertical" | "horizontal";
|
6
|
+
|
7
|
+
type LabelProps = {
|
8
|
+
hint?: React.ReactNode;
|
9
|
+
hintSide?: PositionType;
|
10
|
+
htmlFor?: string;
|
11
|
+
required?: boolean;
|
12
|
+
};
|
13
|
+
|
14
|
+
export type { DirectionType as D, LabelProps as L, OrientationType as O };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
type DirectionType = "rtl" | "ltr";
|
4
|
+
type PositionType = "top" | "bottom" | "right" | "left";
|
5
|
+
type OrientationType = "vertical" | "horizontal";
|
6
|
+
|
7
|
+
type LabelProps = {
|
8
|
+
hint?: React.ReactNode;
|
9
|
+
hintSide?: PositionType;
|
10
|
+
htmlFor?: string;
|
11
|
+
required?: boolean;
|
12
|
+
};
|
13
|
+
|
14
|
+
export type { DirectionType as D, LabelProps as L, OrientationType as O };
|
@@ -1209,6 +1209,23 @@ var Input = (0, import_react7.forwardRef)(
|
|
1209
1209
|
};
|
1210
1210
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
1211
1211
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
1212
|
+
const handleChange = (e) => {
|
1213
|
+
let newValue = e.target.value;
|
1214
|
+
if (props.prefixText) {
|
1215
|
+
if (newValue.length < props.prefixText.length) {
|
1216
|
+
newValue = props.prefixText;
|
1217
|
+
} else {
|
1218
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
1219
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
1220
|
+
newValue = `${props.prefixText}${newValue}`;
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
}
|
1224
|
+
if (props.onChange) {
|
1225
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
1226
|
+
props.onChange(newEvent);
|
1227
|
+
}
|
1228
|
+
};
|
1212
1229
|
return /* @__PURE__ */ import_react7.default.createElement(
|
1213
1230
|
"div",
|
1214
1231
|
{
|
@@ -1221,7 +1238,16 @@ var Input = (0, import_react7.forwardRef)(
|
|
1221
1238
|
)
|
1222
1239
|
},
|
1223
1240
|
props.label && /* @__PURE__ */ import_react7.default.createElement(Label, { ...labelProps }, props.label),
|
1224
|
-
/* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
1241
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ import_react7.default.createElement(
|
1242
|
+
"span",
|
1243
|
+
{
|
1244
|
+
className: cn(
|
1245
|
+
"hawa-me-2 hawa-opacity-90",
|
1246
|
+
!forceHideHelperText && "hawa-mb-2"
|
1247
|
+
)
|
1248
|
+
},
|
1249
|
+
props.outsidePrefix
|
1250
|
+
), props.isLoading ? /* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ import_react7.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react7.default.createElement(
|
1225
1251
|
"div",
|
1226
1252
|
{
|
1227
1253
|
className: cn(
|
@@ -1245,7 +1271,7 @@ var Input = (0, import_react7.forwardRef)(
|
|
1245
1271
|
dir: props.dir,
|
1246
1272
|
type: props.type,
|
1247
1273
|
value: props.value,
|
1248
|
-
onChange:
|
1274
|
+
onChange: handleChange,
|
1249
1275
|
autoComplete: props.autoComplete,
|
1250
1276
|
defaultValue: props.defaultValue,
|
1251
1277
|
placeholder,
|
@@ -3792,10 +3818,10 @@ var RegisterForm = ({
|
|
3792
3818
|
/* @__PURE__ */ import_react15.default.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ import_react15.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
|
3793
3819
|
Alert,
|
3794
3820
|
{
|
3821
|
+
direction: props.direction,
|
3795
3822
|
title: props.errorTitle,
|
3796
3823
|
text: props.errorText,
|
3797
3824
|
severity: "error",
|
3798
|
-
noDestroy: true,
|
3799
3825
|
onAlertClosed: () => {
|
3800
3826
|
if (props.onErrorDismissed) {
|
3801
3827
|
props.onErrorDismissed();
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client";
|
2
2
|
import {
|
3
3
|
Input
|
4
|
-
} from "../../chunk-
|
4
|
+
} from "../../chunk-E6VRANQ3.mjs";
|
5
5
|
import {
|
6
6
|
StopPropagationWrapper
|
7
7
|
} from "../../chunk-47APBDKK.mjs";
|
@@ -2916,10 +2916,10 @@ var RegisterForm = ({
|
|
2916
2916
|
/* @__PURE__ */ React7.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ React7.createElement(CardContent, { headless: true }, /* @__PURE__ */ React7.createElement("div", null, props.showError && /* @__PURE__ */ React7.createElement(
|
2917
2917
|
Alert,
|
2918
2918
|
{
|
2919
|
+
direction: props.direction,
|
2919
2920
|
title: props.errorTitle,
|
2920
2921
|
text: props.errorText,
|
2921
2922
|
severity: "error",
|
2922
|
-
noDestroy: true,
|
2923
2923
|
onAlertClosed: () => {
|
2924
2924
|
if (props.onErrorDismissed) {
|
2925
2925
|
props.onErrorDismissed();
|
package/dist/blocks/index.js
CHANGED
@@ -1230,6 +1230,23 @@ var Input = (0, import_react7.forwardRef)(
|
|
1230
1230
|
};
|
1231
1231
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
1232
1232
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
1233
|
+
const handleChange = (e) => {
|
1234
|
+
let newValue = e.target.value;
|
1235
|
+
if (props.prefixText) {
|
1236
|
+
if (newValue.length < props.prefixText.length) {
|
1237
|
+
newValue = props.prefixText;
|
1238
|
+
} else {
|
1239
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
1240
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
1241
|
+
newValue = `${props.prefixText}${newValue}`;
|
1242
|
+
}
|
1243
|
+
}
|
1244
|
+
}
|
1245
|
+
if (props.onChange) {
|
1246
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
1247
|
+
props.onChange(newEvent);
|
1248
|
+
}
|
1249
|
+
};
|
1233
1250
|
return /* @__PURE__ */ import_react7.default.createElement(
|
1234
1251
|
"div",
|
1235
1252
|
{
|
@@ -1242,7 +1259,16 @@ var Input = (0, import_react7.forwardRef)(
|
|
1242
1259
|
)
|
1243
1260
|
},
|
1244
1261
|
props.label && /* @__PURE__ */ import_react7.default.createElement(Label, { ...labelProps }, props.label),
|
1245
|
-
/* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
1262
|
+
/* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ import_react7.default.createElement(
|
1263
|
+
"span",
|
1264
|
+
{
|
1265
|
+
className: cn(
|
1266
|
+
"hawa-me-2 hawa-opacity-90",
|
1267
|
+
!forceHideHelperText && "hawa-mb-2"
|
1268
|
+
)
|
1269
|
+
},
|
1270
|
+
props.outsidePrefix
|
1271
|
+
), props.isLoading ? /* @__PURE__ */ import_react7.default.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ import_react7.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react7.default.createElement(
|
1246
1272
|
"div",
|
1247
1273
|
{
|
1248
1274
|
className: cn(
|
@@ -1266,7 +1292,7 @@ var Input = (0, import_react7.forwardRef)(
|
|
1266
1292
|
dir: props.dir,
|
1267
1293
|
type: props.type,
|
1268
1294
|
value: props.value,
|
1269
|
-
onChange:
|
1295
|
+
onChange: handleChange,
|
1270
1296
|
autoComplete: props.autoComplete,
|
1271
1297
|
defaultValue: props.defaultValue,
|
1272
1298
|
placeholder,
|
@@ -3949,10 +3975,10 @@ var RegisterForm = ({
|
|
3949
3975
|
/* @__PURE__ */ import_react15.default.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ import_react15.default.createElement(CardContent, { headless: true }, /* @__PURE__ */ import_react15.default.createElement("div", null, props.showError && /* @__PURE__ */ import_react15.default.createElement(
|
3950
3976
|
Alert,
|
3951
3977
|
{
|
3978
|
+
direction: props.direction,
|
3952
3979
|
title: props.errorTitle,
|
3953
3980
|
text: props.errorText,
|
3954
3981
|
severity: "error",
|
3955
|
-
noDestroy: true,
|
3956
3982
|
onAlertClosed: () => {
|
3957
3983
|
if (props.onErrorDismissed) {
|
3958
3984
|
props.onErrorDismissed();
|
@@ -7124,7 +7150,7 @@ var import_react44 = __toESM(require("react"));
|
|
7124
7150
|
// elements/progress/Progress.tsx
|
7125
7151
|
var React54 = __toESM(require("react"));
|
7126
7152
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"));
|
7127
|
-
var Progress = React54.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React54.createElement(
|
7153
|
+
var Progress = React54.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React54.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React54.createElement(Label, { ...props.labelProps }, props.label), /* @__PURE__ */ React54.createElement(
|
7128
7154
|
ProgressPrimitive.Root,
|
7129
7155
|
{
|
7130
7156
|
ref,
|
@@ -7141,7 +7167,7 @@ var Progress = React54.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
7141
7167
|
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
7142
7168
|
}
|
7143
7169
|
)
|
7144
|
-
));
|
7170
|
+
)));
|
7145
7171
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
7146
7172
|
|
7147
7173
|
// blocks/Usage.tsx
|
package/dist/blocks/index.mjs
CHANGED
@@ -26,7 +26,7 @@ import {
|
|
26
26
|
UncheckMark,
|
27
27
|
VeryBadEmoji,
|
28
28
|
VeryGoodEmoji
|
29
|
-
} from "../chunk-
|
29
|
+
} from "../chunk-N4O2A727.mjs";
|
30
30
|
import {
|
31
31
|
Button,
|
32
32
|
Card,
|
@@ -537,10 +537,10 @@ var RegisterForm = ({
|
|
537
537
|
/* @__PURE__ */ React3.createElement(Card, { dir: props.direction, className: cn((_h = props.classNames) == null ? void 0 : _h.card) }, /* @__PURE__ */ React3.createElement(CardContent, { headless: true }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
|
538
538
|
Alert,
|
539
539
|
{
|
540
|
+
direction: props.direction,
|
540
541
|
title: props.errorTitle,
|
541
542
|
text: props.errorText,
|
542
543
|
severity: "error",
|
543
|
-
noDestroy: true,
|
544
544
|
onAlertClosed: () => {
|
545
545
|
if (props.onErrorDismissed) {
|
546
546
|
props.onErrorDismissed();
|
@@ -931,6 +931,23 @@ var Input = (0, import_react8.forwardRef)(
|
|
931
931
|
};
|
932
932
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
933
933
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
934
|
+
const handleChange = (e) => {
|
935
|
+
let newValue = e.target.value;
|
936
|
+
if (props.prefixText) {
|
937
|
+
if (newValue.length < props.prefixText.length) {
|
938
|
+
newValue = props.prefixText;
|
939
|
+
} else {
|
940
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
941
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
942
|
+
newValue = `${props.prefixText}${newValue}`;
|
943
|
+
}
|
944
|
+
}
|
945
|
+
}
|
946
|
+
if (props.onChange) {
|
947
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
948
|
+
props.onChange(newEvent);
|
949
|
+
}
|
950
|
+
};
|
934
951
|
return /* @__PURE__ */ import_react8.default.createElement(
|
935
952
|
"div",
|
936
953
|
{
|
@@ -943,7 +960,16 @@ var Input = (0, import_react8.forwardRef)(
|
|
943
960
|
)
|
944
961
|
},
|
945
962
|
props.label && /* @__PURE__ */ import_react8.default.createElement(Label, { ...labelProps }, props.label),
|
946
|
-
/* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
963
|
+
/* @__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(
|
964
|
+
"span",
|
965
|
+
{
|
966
|
+
className: cn(
|
967
|
+
"hawa-me-2 hawa-opacity-90",
|
968
|
+
!forceHideHelperText && "hawa-mb-2"
|
969
|
+
)
|
970
|
+
},
|
971
|
+
props.outsidePrefix
|
972
|
+
), props.isLoading ? /* @__PURE__ */ import_react8.default.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ import_react8.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react8.default.createElement(
|
947
973
|
"div",
|
948
974
|
{
|
949
975
|
className: cn(
|
@@ -967,7 +993,7 @@ var Input = (0, import_react8.forwardRef)(
|
|
967
993
|
dir: props.dir,
|
968
994
|
type: props.type,
|
969
995
|
value: props.value,
|
970
|
-
onChange:
|
996
|
+
onChange: handleChange,
|
971
997
|
autoComplete: props.autoComplete,
|
972
998
|
defaultValue: props.defaultValue,
|
973
999
|
placeholder,
|
@@ -34,6 +34,23 @@ var Input = forwardRef(
|
|
34
34
|
};
|
35
35
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
36
36
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
37
|
+
const handleChange = (e) => {
|
38
|
+
let newValue = e.target.value;
|
39
|
+
if (props.prefixText) {
|
40
|
+
if (newValue.length < props.prefixText.length) {
|
41
|
+
newValue = props.prefixText;
|
42
|
+
} else {
|
43
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
44
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
45
|
+
newValue = `${props.prefixText}${newValue}`;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
if (props.onChange) {
|
50
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
51
|
+
props.onChange(newEvent);
|
52
|
+
}
|
53
|
+
};
|
37
54
|
return /* @__PURE__ */ React.createElement(
|
38
55
|
"div",
|
39
56
|
{
|
@@ -46,7 +63,16 @@ var Input = forwardRef(
|
|
46
63
|
)
|
47
64
|
},
|
48
65
|
props.label && /* @__PURE__ */ React.createElement(Label, { ...labelProps }, props.label),
|
49
|
-
/* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
66
|
+
/* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ React.createElement(
|
67
|
+
"span",
|
68
|
+
{
|
69
|
+
className: cn(
|
70
|
+
"hawa-me-2 hawa-opacity-90",
|
71
|
+
!forceHideHelperText && "hawa-mb-2"
|
72
|
+
)
|
73
|
+
},
|
74
|
+
props.outsidePrefix
|
75
|
+
), props.isLoading ? /* @__PURE__ */ React.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React.createElement(React.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React.createElement(
|
50
76
|
"div",
|
51
77
|
{
|
52
78
|
className: cn(
|
@@ -70,7 +96,7 @@ var Input = forwardRef(
|
|
70
96
|
dir: props.dir,
|
71
97
|
type: props.type,
|
72
98
|
value: props.value,
|
73
|
-
onChange:
|
99
|
+
onChange: handleChange,
|
74
100
|
autoComplete: props.autoComplete,
|
75
101
|
defaultValue: props.defaultValue,
|
76
102
|
placeholder,
|
@@ -223,6 +223,23 @@ var Input = forwardRef2(
|
|
223
223
|
};
|
224
224
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
225
225
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
226
|
+
const handleChange = (e) => {
|
227
|
+
let newValue = e.target.value;
|
228
|
+
if (props.prefixText) {
|
229
|
+
if (newValue.length < props.prefixText.length) {
|
230
|
+
newValue = props.prefixText;
|
231
|
+
} else {
|
232
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
233
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
234
|
+
newValue = `${props.prefixText}${newValue}`;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
if (props.onChange) {
|
239
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
240
|
+
props.onChange(newEvent);
|
241
|
+
}
|
242
|
+
};
|
226
243
|
return /* @__PURE__ */ React3.createElement(
|
227
244
|
"div",
|
228
245
|
{
|
@@ -235,7 +252,16 @@ var Input = forwardRef2(
|
|
235
252
|
)
|
236
253
|
},
|
237
254
|
props.label && /* @__PURE__ */ React3.createElement(Label, { ...labelProps }, props.label),
|
238
|
-
/* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
255
|
+
/* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ React3.createElement(
|
256
|
+
"span",
|
257
|
+
{
|
258
|
+
className: cn(
|
259
|
+
"hawa-me-2 hawa-opacity-90",
|
260
|
+
!forceHideHelperText && "hawa-mb-2"
|
261
|
+
)
|
262
|
+
},
|
263
|
+
props.outsidePrefix
|
264
|
+
), props.isLoading ? /* @__PURE__ */ React3.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ React3.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ React3.createElement(React3.Fragment, null, !props.hideSeparator && /* @__PURE__ */ React3.createElement(
|
239
265
|
"div",
|
240
266
|
{
|
241
267
|
className: cn(
|
@@ -259,7 +285,7 @@ var Input = forwardRef2(
|
|
259
285
|
dir: props.dir,
|
260
286
|
type: props.type,
|
261
287
|
value: props.value,
|
262
|
-
onChange:
|
288
|
+
onChange: handleChange,
|
263
289
|
autoComplete: props.autoComplete,
|
264
290
|
defaultValue: props.defaultValue,
|
265
291
|
placeholder,
|
@@ -2977,7 +3003,7 @@ var Separator = ({
|
|
2977
3003
|
// elements/progress/Progress.tsx
|
2978
3004
|
import * as React15 from "react";
|
2979
3005
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
2980
|
-
var Progress = React15.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React15.createElement(
|
3006
|
+
var Progress = React15.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ React15.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, props.label && /* @__PURE__ */ React15.createElement(Label, { ...props.labelProps }, props.label), /* @__PURE__ */ React15.createElement(
|
2981
3007
|
ProgressPrimitive.Root,
|
2982
3008
|
{
|
2983
3009
|
ref,
|
@@ -2994,7 +3020,7 @@ var Progress = React15.forwardRef(({ className, value, ...props }, ref) => /* @_
|
|
2994
3020
|
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
2995
3021
|
}
|
2996
3022
|
)
|
2997
|
-
));
|
3023
|
+
)));
|
2998
3024
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
2999
3025
|
|
3000
3026
|
// icons/Emojis.tsx
|
package/dist/dataTable/index.js
CHANGED
@@ -860,6 +860,23 @@ var Input = (0, import_react4.forwardRef)(
|
|
860
860
|
};
|
861
861
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
862
862
|
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
863
|
+
const handleChange = (e) => {
|
864
|
+
let newValue = e.target.value;
|
865
|
+
if (props.prefixText) {
|
866
|
+
if (newValue.length < props.prefixText.length) {
|
867
|
+
newValue = props.prefixText;
|
868
|
+
} else {
|
869
|
+
const isSubstring = props.prefixText.startsWith(newValue);
|
870
|
+
if (!isSubstring && !newValue.startsWith(props.prefixText)) {
|
871
|
+
newValue = `${props.prefixText}${newValue}`;
|
872
|
+
}
|
873
|
+
}
|
874
|
+
}
|
875
|
+
if (props.onChange) {
|
876
|
+
const newEvent = { ...e, target: { ...e.target, value: newValue } };
|
877
|
+
props.onChange(newEvent);
|
878
|
+
}
|
879
|
+
};
|
863
880
|
return /* @__PURE__ */ import_react4.default.createElement(
|
864
881
|
"div",
|
865
882
|
{
|
@@ -872,7 +889,16 @@ var Input = (0, import_react4.forwardRef)(
|
|
872
889
|
)
|
873
890
|
},
|
874
891
|
props.label && /* @__PURE__ */ import_react4.default.createElement(Label2, { ...labelProps }, props.label),
|
875
|
-
/* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.
|
892
|
+
/* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-w-full hawa-items-center " }, props.outsidePrefix && /* @__PURE__ */ import_react4.default.createElement(
|
893
|
+
"span",
|
894
|
+
{
|
895
|
+
className: cn(
|
896
|
+
"hawa-me-2 hawa-opacity-90",
|
897
|
+
!forceHideHelperText && "hawa-mb-2"
|
898
|
+
)
|
899
|
+
},
|
900
|
+
props.outsidePrefix
|
901
|
+
), props.isLoading ? /* @__PURE__ */ import_react4.default.createElement("div", { className: "hawa-pb-2" }, /* @__PURE__ */ import_react4.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react4.default.createElement(
|
876
902
|
"div",
|
877
903
|
{
|
878
904
|
className: cn(
|
@@ -896,7 +922,7 @@ var Input = (0, import_react4.forwardRef)(
|
|
896
922
|
dir: props.dir,
|
897
923
|
type: props.type,
|
898
924
|
value: props.value,
|
899
|
-
onChange:
|
925
|
+
onChange: handleChange,
|
900
926
|
autoComplete: props.autoComplete,
|
901
927
|
defaultValue: props.defaultValue,
|
902
928
|
placeholder,
|