@sikka/hawa 0.35.6-next → 0.36.0-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/{Chip-BtgTAs8x.d.mts → Chip-CGl24Kd9.d.mts} +2 -2
- package/dist/{Chip-DQsP5hFS.d.ts → Chip-Cato49ar.d.ts} +2 -2
- package/dist/accordion/index.d.mts +1 -1
- package/dist/accordion/index.d.ts +1 -1
- package/dist/accordion/index.js +6 -4
- package/dist/accordion/index.js.map +1 -1
- package/dist/accordion/index.mjs +6 -4
- package/dist/accordion/index.mjs.map +1 -1
- package/dist/appLayout/index.js +7 -6
- package/dist/appLayout/index.js.map +1 -1
- package/dist/appLayout/index.mjs +7 -6
- package/dist/appLayout/index.mjs.map +1 -1
- package/dist/blocks/auth/index.js +28 -5
- package/dist/blocks/auth/index.mjs +4 -4
- package/dist/blocks/feedback/index.js +0 -1
- package/dist/blocks/feedback/index.mjs +1 -1
- package/dist/blocks/index.js +34 -9
- package/dist/blocks/index.mjs +2 -2
- package/dist/blocks/misc/index.js +32 -7
- package/dist/blocks/misc/index.mjs +3 -3
- package/dist/blocks/pricing/index.js +6 -4
- package/dist/blocks/pricing/index.mjs +1 -1
- package/dist/chip/index.d.mts +2 -2
- package/dist/chip/index.d.ts +2 -2
- package/dist/chip/index.js +6 -4
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +6 -4
- package/dist/chip/index.mjs.map +1 -1
- package/dist/{chunk-MZRUEJED.mjs → chunk-6QIOEUE2.mjs} +1 -1
- package/dist/{chunk-JEZLVXSU.mjs → chunk-BXBSZD5X.mjs} +26 -2
- package/dist/{chunk-LVXG3SMD.mjs → chunk-CJ57JBYA.mjs} +6 -4
- package/dist/{chunk-CD6AQVU3.mjs → chunk-HLYAX77R.mjs} +0 -1
- package/dist/{chunk-ANXGMZXS.mjs → chunk-NNPNQK6F.mjs} +6 -4
- package/dist/{chunk-57EAKTAP.mjs → chunk-T33FXOHA.mjs} +29 -6
- package/dist/colorPicker/index.js +1 -1
- package/dist/colorPicker/index.js.map +1 -1
- package/dist/colorPicker/index.mjs +1 -1
- package/dist/colorPicker/index.mjs.map +1 -1
- package/dist/dataTable/index.js +41 -5
- package/dist/dataTable/index.js.map +1 -1
- package/dist/dataTable/index.mjs +41 -5
- package/dist/dataTable/index.mjs.map +1 -1
- package/dist/datePicker/index.d.mts +1 -0
- package/dist/datePicker/index.d.ts +1 -0
- package/dist/datePicker/index.js +3 -2
- package/dist/datePicker/index.js.map +1 -1
- package/dist/datePicker/index.mjs +3 -2
- package/dist/datePicker/index.mjs.map +1 -1
- package/dist/elements/index.d.mts +8 -4
- package/dist/elements/index.d.ts +8 -4
- package/dist/elements/index.js +50 -13
- package/dist/elements/index.mjs +19 -7
- package/dist/index.css +10 -0
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +51 -15
- package/dist/index.mjs +51 -15
- package/dist/input/index.d.mts +6 -2
- package/dist/input/index.d.ts +6 -2
- package/dist/input/index.js +26 -2
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +26 -2
- package/dist/input/index.mjs.map +1 -1
- package/dist/layout/index.d.mts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +7 -6
- package/dist/layout/index.mjs +3 -4
- package/dist/passwordInput/index.js +26 -2
- package/dist/passwordInput/index.js.map +1 -1
- package/dist/passwordInput/index.mjs +26 -2
- package/dist/passwordInput/index.mjs.map +1 -1
- package/dist/phoneInput/index.js +1 -2
- package/dist/phoneInput/index.js.map +1 -1
- package/dist/phoneInput/index.mjs +1 -2
- package/dist/phoneInput/index.mjs.map +1 -1
- package/dist/pinInput/index.js +1 -1
- package/dist/pinInput/index.js.map +1 -1
- package/dist/pinInput/index.mjs +1 -1
- package/dist/pinInput/index.mjs.map +1 -1
- package/dist/select/index.js +0 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +0 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/sidebar/index.js +6 -4
- package/dist/sidebar/index.js.map +1 -1
- package/dist/sidebar/index.mjs +6 -4
- package/dist/sidebar/index.mjs.map +1 -1
- package/dist/tabs/index.d.mts +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/index.js +6 -4
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +6 -4
- package/dist/tabs/index.mjs.map +1 -1
- package/package.json +7 -8
package/dist/elements/index.js
CHANGED
@@ -1023,7 +1023,8 @@ var Chip = import_react5.default.forwardRef(
|
|
1023
1023
|
icon,
|
1024
1024
|
color,
|
1025
1025
|
radius = "inherit",
|
1026
|
-
|
1026
|
+
dot,
|
1027
|
+
dotStatus = "none",
|
1027
1028
|
...rest
|
1028
1029
|
}, ref) => {
|
1029
1030
|
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
@@ -1042,7 +1043,8 @@ var Chip = import_react5.default.forwardRef(
|
|
1042
1043
|
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
1043
1044
|
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
1044
1045
|
};
|
1045
|
-
let
|
1046
|
+
let dotStatusStyles = {
|
1047
|
+
none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
|
1046
1048
|
available: "hawa-bg-green-500",
|
1047
1049
|
unavailable: "hawa-bg-red-500"
|
1048
1050
|
};
|
@@ -1070,10 +1072,10 @@ var Chip = import_react5.default.forwardRef(
|
|
1070
1072
|
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
1071
1073
|
)
|
1072
1074
|
},
|
1073
|
-
|
1075
|
+
dot && /* @__PURE__ */ import_react5.default.createElement(
|
1074
1076
|
"span",
|
1075
1077
|
{
|
1076
|
-
className: cn(dotStyles[size],
|
1078
|
+
className: cn(dotStyles[size], dotStatusStyles[dotStatus])
|
1077
1079
|
}
|
1078
1080
|
),
|
1079
1081
|
icon && icon,
|
@@ -2590,7 +2592,7 @@ var Input = (0, import_react11.forwardRef)(
|
|
2590
2592
|
auto: ""
|
2591
2593
|
};
|
2592
2594
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
2593
|
-
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
2595
|
+
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";
|
2594
2596
|
const handleChange = (e) => {
|
2595
2597
|
let newValue = e.target.value;
|
2596
2598
|
if (props.prefixText) {
|
@@ -2629,7 +2631,31 @@ var Input = (0, import_react11.forwardRef)(
|
|
2629
2631
|
)
|
2630
2632
|
},
|
2631
2633
|
props.outsidePrefix
|
2632
|
-
), props.isLoading ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react11.default.createElement(
|
2634
|
+
), props.isLoading ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(
|
2635
|
+
Skeleton,
|
2636
|
+
{
|
2637
|
+
animation: "none",
|
2638
|
+
className: "hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]",
|
2639
|
+
content: /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ import_react11.default.createElement(
|
2640
|
+
"svg",
|
2641
|
+
{
|
2642
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2643
|
+
width: "20",
|
2644
|
+
height: "20",
|
2645
|
+
viewBox: "0 0 24 24",
|
2646
|
+
fill: "none",
|
2647
|
+
stroke: "currentColor",
|
2648
|
+
strokeWidth: "2",
|
2649
|
+
strokeLinecap: "round",
|
2650
|
+
strokeLinejoin: "round",
|
2651
|
+
className: "hawa-text-destructive"
|
2652
|
+
},
|
2653
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
2654
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M12 9v4" }),
|
2655
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M12 17h.01" })
|
2656
|
+
), /* @__PURE__ */ import_react11.default.createElement("span", null, /* @__PURE__ */ import_react11.default.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
|
2657
|
+
}
|
2658
|
+
)) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react11.default.createElement(
|
2633
2659
|
"div",
|
2634
2660
|
{
|
2635
2661
|
className: cn(
|
@@ -2821,6 +2847,7 @@ TableHeader.displayName = "TableHeader";
|
|
2821
2847
|
TableCaption.displayName = "TableCaption";
|
2822
2848
|
|
2823
2849
|
// elements/dataTable/DataTable.tsx
|
2850
|
+
var LOCAL_STORAGE_KEY = "datatable-column-visibility";
|
2824
2851
|
var DataTable = ({
|
2825
2852
|
columns,
|
2826
2853
|
data,
|
@@ -2840,7 +2867,10 @@ var DataTable = ({
|
|
2840
2867
|
);
|
2841
2868
|
const [globalFilter, setGlobalFilter] = React23.useState("");
|
2842
2869
|
const [expanded, setExpanded] = React23.useState({});
|
2843
|
-
const [columnVisibility, setColumnVisibility] = React23.useState({
|
2870
|
+
const [columnVisibility, setColumnVisibility] = React23.useState(() => {
|
2871
|
+
const savedVisibility = localStorage.getItem(LOCAL_STORAGE_KEY);
|
2872
|
+
return savedVisibility ? JSON.parse(savedVisibility) : {};
|
2873
|
+
});
|
2844
2874
|
const [rowSelection, setRowSelection] = React23.useState({});
|
2845
2875
|
const table = (0, import_react_table.useReactTable)({
|
2846
2876
|
data,
|
@@ -2870,12 +2900,20 @@ var DataTable = ({
|
|
2870
2900
|
label: `${item} / ${pageText}`,
|
2871
2901
|
value: item
|
2872
2902
|
}));
|
2903
|
+
React23.useEffect(() => {
|
2904
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(columnVisibility));
|
2905
|
+
}, [columnVisibility]);
|
2873
2906
|
React23.useEffect(() => {
|
2874
2907
|
setColumnVisibility((prev) => {
|
2875
2908
|
let newColumnVisibility = {};
|
2876
2909
|
columns.forEach((column) => {
|
2877
2910
|
var _a2;
|
2878
|
-
|
2911
|
+
const savedVisibility = prev[column.accessorKey];
|
2912
|
+
if (savedVisibility !== void 0) {
|
2913
|
+
newColumnVisibility[column.accessorKey] = savedVisibility;
|
2914
|
+
} else {
|
2915
|
+
newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
|
2916
|
+
}
|
2879
2917
|
});
|
2880
2918
|
return newColumnVisibility;
|
2881
2919
|
});
|
@@ -3044,7 +3082,7 @@ var DataTable = ({
|
|
3044
3082
|
}
|
3045
3083
|
table.setPageIndex(page);
|
3046
3084
|
},
|
3047
|
-
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm"
|
3085
|
+
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
|
3048
3086
|
}
|
3049
3087
|
)), /* @__PURE__ */ React23.createElement(
|
3050
3088
|
DropdownMenu,
|
@@ -4610,7 +4648,6 @@ var Select = ({
|
|
4610
4648
|
)
|
4611
4649
|
},
|
4612
4650
|
unstyled: true,
|
4613
|
-
autoFocus: true,
|
4614
4651
|
components: props.hideIndicator ? {
|
4615
4652
|
Option,
|
4616
4653
|
Menu,
|
@@ -6832,7 +6869,7 @@ var PhoneInput = ({
|
|
6832
6869
|
onChange: handleInputChange,
|
6833
6870
|
placeholder: props.placeholder,
|
6834
6871
|
className: cn(
|
6835
|
-
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
6872
|
+
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
6836
6873
|
),
|
6837
6874
|
...inputProps
|
6838
6875
|
}
|
@@ -6910,7 +6947,7 @@ var PinInput = ({
|
|
6910
6947
|
id: `input-${index}`,
|
6911
6948
|
pattern: "[0-9]*",
|
6912
6949
|
className: cn(
|
6913
|
-
"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center",
|
6950
|
+
"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground",
|
6914
6951
|
width === "full" ? "hawa-w-full" : "hawa-w-10"
|
6915
6952
|
),
|
6916
6953
|
onChange: (e) => handleChange(e, index),
|
@@ -7045,7 +7082,7 @@ var ColorPicker = ({
|
|
7045
7082
|
value: selectedColor,
|
7046
7083
|
className: cn(
|
7047
7084
|
"hawa-block hawa-h-[40px] hawa-w-24 hawa-rounded hawa-rounded-l-none hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all",
|
7048
|
-
"hawa-border hawa-border-l-0 hawa-border-l-transparent"
|
7085
|
+
"hawa-border hawa-border-l-0 hawa-border-l-transparent placeholder:hawa-text-muted-foreground"
|
7049
7086
|
// "hawa-border hawa-border-x-0 hawa-border-x-transparent hawa-border-b-0 hawa-rounded-tr-none"
|
7050
7087
|
),
|
7051
7088
|
style: {
|
package/dist/elements/index.mjs
CHANGED
@@ -22,7 +22,7 @@ import {
|
|
22
22
|
TabsList,
|
23
23
|
TabsTrigger,
|
24
24
|
Textarea
|
25
|
-
} from "../chunk-
|
25
|
+
} from "../chunk-T33FXOHA.mjs";
|
26
26
|
import {
|
27
27
|
useClipboard
|
28
28
|
} from "../chunk-OPYDG34F.mjs";
|
@@ -37,7 +37,7 @@ import {
|
|
37
37
|
SheetPortal,
|
38
38
|
SheetTitle,
|
39
39
|
SheetTrigger
|
40
|
-
} from "../chunk-
|
40
|
+
} from "../chunk-6QIOEUE2.mjs";
|
41
41
|
import {
|
42
42
|
Button,
|
43
43
|
Card,
|
@@ -76,7 +76,7 @@ import {
|
|
76
76
|
buttonVariants,
|
77
77
|
calculateLuminance,
|
78
78
|
cn
|
79
|
-
} from "../chunk-
|
79
|
+
} from "../chunk-NNPNQK6F.mjs";
|
80
80
|
import {
|
81
81
|
__require
|
82
82
|
} from "../chunk-SYGWSBJL.mjs";
|
@@ -906,6 +906,7 @@ TableHeader.displayName = "TableHeader";
|
|
906
906
|
TableCaption.displayName = "TableCaption";
|
907
907
|
|
908
908
|
// elements/dataTable/DataTable.tsx
|
909
|
+
var LOCAL_STORAGE_KEY = "datatable-column-visibility";
|
909
910
|
var DataTable = ({
|
910
911
|
columns,
|
911
912
|
data,
|
@@ -925,7 +926,10 @@ var DataTable = ({
|
|
925
926
|
);
|
926
927
|
const [globalFilter, setGlobalFilter] = React10.useState("");
|
927
928
|
const [expanded, setExpanded] = React10.useState({});
|
928
|
-
const [columnVisibility, setColumnVisibility] = React10.useState({
|
929
|
+
const [columnVisibility, setColumnVisibility] = React10.useState(() => {
|
930
|
+
const savedVisibility = localStorage.getItem(LOCAL_STORAGE_KEY);
|
931
|
+
return savedVisibility ? JSON.parse(savedVisibility) : {};
|
932
|
+
});
|
929
933
|
const [rowSelection, setRowSelection] = React10.useState({});
|
930
934
|
const table = useReactTable({
|
931
935
|
data,
|
@@ -955,12 +959,20 @@ var DataTable = ({
|
|
955
959
|
label: `${item} / ${pageText}`,
|
956
960
|
value: item
|
957
961
|
}));
|
962
|
+
React10.useEffect(() => {
|
963
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(columnVisibility));
|
964
|
+
}, [columnVisibility]);
|
958
965
|
React10.useEffect(() => {
|
959
966
|
setColumnVisibility((prev) => {
|
960
967
|
let newColumnVisibility = {};
|
961
968
|
columns.forEach((column) => {
|
962
969
|
var _a2;
|
963
|
-
|
970
|
+
const savedVisibility = prev[column.accessorKey];
|
971
|
+
if (savedVisibility !== void 0) {
|
972
|
+
newColumnVisibility[column.accessorKey] = savedVisibility;
|
973
|
+
} else {
|
974
|
+
newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
|
975
|
+
}
|
964
976
|
});
|
965
977
|
return newColumnVisibility;
|
966
978
|
});
|
@@ -1129,7 +1141,7 @@ var DataTable = ({
|
|
1129
1141
|
}
|
1130
1142
|
table.setPageIndex(page);
|
1131
1143
|
},
|
1132
|
-
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm"
|
1144
|
+
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
|
1133
1145
|
}
|
1134
1146
|
)), /* @__PURE__ */ React10.createElement(
|
1135
1147
|
DropdownMenu,
|
@@ -2219,7 +2231,7 @@ var ColorPicker = ({
|
|
2219
2231
|
value: selectedColor,
|
2220
2232
|
className: cn(
|
2221
2233
|
"hawa-block hawa-h-[40px] hawa-w-24 hawa-rounded hawa-rounded-l-none hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all",
|
2222
|
-
"hawa-border hawa-border-l-0 hawa-border-l-transparent"
|
2234
|
+
"hawa-border hawa-border-l-0 hawa-border-l-transparent placeholder:hawa-text-muted-foreground"
|
2223
2235
|
// "hawa-border hawa-border-x-0 hawa-border-x-transparent hawa-border-b-0 hawa-rounded-tr-none"
|
2224
2236
|
),
|
2225
2237
|
style: {
|
package/dist/index.css
CHANGED
@@ -1296,6 +1296,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
1296
1296
|
.hawa-ms-2 {
|
1297
1297
|
margin-inline-start: 0.5rem;
|
1298
1298
|
}
|
1299
|
+
.hawa-ms-auto {
|
1300
|
+
margin-inline-start: auto;
|
1301
|
+
}
|
1299
1302
|
.hawa-mt-0 {
|
1300
1303
|
margin-top: 0px;
|
1301
1304
|
}
|
@@ -2275,6 +2278,9 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
2275
2278
|
.hawa-border-t-transparent {
|
2276
2279
|
border-top-color: transparent;
|
2277
2280
|
}
|
2281
|
+
.\!hawa-bg-destructive\/\[0\.3\] {
|
2282
|
+
background-color: hsl(var(--destructive) / 0.3) !important;
|
2283
|
+
}
|
2278
2284
|
.\!hawa-bg-transparent {
|
2279
2285
|
background-color: transparent !important;
|
2280
2286
|
}
|
@@ -2896,6 +2902,10 @@ input[type="number"]::-webkit-inner-spin-button,
|
|
2896
2902
|
--tw-text-opacity: 1;
|
2897
2903
|
color: rgb(14 116 144 / var(--tw-text-opacity));
|
2898
2904
|
}
|
2905
|
+
.hawa-text-destructive {
|
2906
|
+
--tw-text-opacity: 1;
|
2907
|
+
color: hsl(var(--destructive) / var(--tw-text-opacity));
|
2908
|
+
}
|
2899
2909
|
.hawa-text-destructive-foreground {
|
2900
2910
|
--tw-text-opacity: 1;
|
2901
2911
|
color: hsl(var(--destructive-foreground) / var(--tw-text-opacity));
|
package/dist/index.d.mts
CHANGED
@@ -206,7 +206,7 @@ type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
|
|
206
206
|
/** Enable/Disable the dot before the label of the chip */
|
207
207
|
dot?: boolean;
|
208
208
|
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
209
|
-
|
209
|
+
dotStatus?: "available" | "unavailable" | "none";
|
210
210
|
radius?: RadiusType;
|
211
211
|
};
|
212
212
|
declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
|
@@ -221,7 +221,7 @@ declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTML
|
|
221
221
|
/** Enable/Disable the dot before the label of the chip */
|
222
222
|
dot?: boolean | undefined;
|
223
223
|
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
224
|
-
|
224
|
+
dotStatus?: "none" | "available" | "unavailable" | undefined;
|
225
225
|
radius?: RadiusType | undefined;
|
226
226
|
} & React__default.RefAttributes<HTMLSpanElement>>;
|
227
227
|
|
@@ -683,6 +683,7 @@ declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.
|
|
683
683
|
|
684
684
|
type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
685
685
|
isLoading?: boolean;
|
686
|
+
isLoadingError?: boolean;
|
686
687
|
containerClassName?: string;
|
687
688
|
margin?: "none" | "normal" | "large";
|
688
689
|
width?: "small" | "normal" | "full" | "auto";
|
@@ -692,6 +693,7 @@ type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
692
693
|
hideSeparator?: boolean;
|
693
694
|
/** The small red text under the input field to show validation. */
|
694
695
|
helperText?: any;
|
696
|
+
prefixText?: any;
|
695
697
|
forceHideHelperText?: boolean;
|
696
698
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
697
699
|
/** The icon inside the input field */
|
@@ -711,10 +713,11 @@ type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
711
713
|
popup?: boolean;
|
712
714
|
popupContent?: React__default.ReactNode;
|
713
715
|
outsidePrefix?: any;
|
714
|
-
|
716
|
+
loadingErrorMesssage?: string;
|
715
717
|
};
|
716
718
|
declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
|
717
719
|
isLoading?: boolean | undefined;
|
720
|
+
isLoadingError?: boolean | undefined;
|
718
721
|
containerClassName?: string | undefined;
|
719
722
|
margin?: "none" | "normal" | "large" | undefined;
|
720
723
|
width?: "small" | "normal" | "full" | "auto" | undefined;
|
@@ -724,6 +727,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
724
727
|
hideSeparator?: boolean | undefined;
|
725
728
|
/** The small red text under the input field to show validation. */
|
726
729
|
helperText?: any;
|
730
|
+
prefixText?: any;
|
727
731
|
forceHideHelperText?: boolean | undefined;
|
728
732
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
729
733
|
/** The icon inside the input field */
|
@@ -743,7 +747,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
743
747
|
popup?: boolean | undefined;
|
744
748
|
popupContent?: React__default.ReactNode;
|
745
749
|
outsidePrefix?: any;
|
746
|
-
|
750
|
+
loadingErrorMesssage?: string | undefined;
|
747
751
|
} & React__default.RefAttributes<HTMLInputElement>>;
|
748
752
|
|
749
753
|
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
package/dist/index.d.ts
CHANGED
@@ -206,7 +206,7 @@ type ChipTypes = React__default.HTMLAttributes<HTMLSpanElement> & {
|
|
206
206
|
/** Enable/Disable the dot before the label of the chip */
|
207
207
|
dot?: boolean;
|
208
208
|
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
209
|
-
|
209
|
+
dotStatus?: "available" | "unavailable" | "none";
|
210
210
|
radius?: RadiusType;
|
211
211
|
};
|
212
212
|
declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTMLAttributes<HTMLSpanElement> & {
|
@@ -221,7 +221,7 @@ declare const Chip: React__default.ForwardRefExoticComponent<React__default.HTML
|
|
221
221
|
/** Enable/Disable the dot before the label of the chip */
|
222
222
|
dot?: boolean | undefined;
|
223
223
|
/** Red/Green dot next to the label of the chip indicating online/offline or available/unavailable */
|
224
|
-
|
224
|
+
dotStatus?: "none" | "available" | "unavailable" | undefined;
|
225
225
|
radius?: RadiusType | undefined;
|
226
226
|
} & React__default.RefAttributes<HTMLSpanElement>>;
|
227
227
|
|
@@ -683,6 +683,7 @@ declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.
|
|
683
683
|
|
684
684
|
type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
685
685
|
isLoading?: boolean;
|
686
|
+
isLoadingError?: boolean;
|
686
687
|
containerClassName?: string;
|
687
688
|
margin?: "none" | "normal" | "large";
|
688
689
|
width?: "small" | "normal" | "full" | "auto";
|
@@ -692,6 +693,7 @@ type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
692
693
|
hideSeparator?: boolean;
|
693
694
|
/** The small red text under the input field to show validation. */
|
694
695
|
helperText?: any;
|
696
|
+
prefixText?: any;
|
695
697
|
forceHideHelperText?: boolean;
|
696
698
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement>;
|
697
699
|
/** The icon inside the input field */
|
@@ -711,10 +713,11 @@ type TextFieldTypes = React__default.InputHTMLAttributes<HTMLInputElement> & {
|
|
711
713
|
popup?: boolean;
|
712
714
|
popupContent?: React__default.ReactNode;
|
713
715
|
outsidePrefix?: any;
|
714
|
-
|
716
|
+
loadingErrorMesssage?: string;
|
715
717
|
};
|
716
718
|
declare const Input: React__default.ForwardRefExoticComponent<React__default.InputHTMLAttributes<HTMLInputElement> & {
|
717
719
|
isLoading?: boolean | undefined;
|
720
|
+
isLoadingError?: boolean | undefined;
|
718
721
|
containerClassName?: string | undefined;
|
719
722
|
margin?: "none" | "normal" | "large" | undefined;
|
720
723
|
width?: "small" | "normal" | "full" | "auto" | undefined;
|
@@ -724,6 +727,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
724
727
|
hideSeparator?: boolean | undefined;
|
725
728
|
/** The small red text under the input field to show validation. */
|
726
729
|
helperText?: any;
|
730
|
+
prefixText?: any;
|
727
731
|
forceHideHelperText?: boolean | undefined;
|
728
732
|
inputProps?: React__default.InputHTMLAttributes<HTMLInputElement> | undefined;
|
729
733
|
/** The icon inside the input field */
|
@@ -743,7 +747,7 @@ declare const Input: React__default.ForwardRefExoticComponent<React__default.Inp
|
|
743
747
|
popup?: boolean | undefined;
|
744
748
|
popupContent?: React__default.ReactNode;
|
745
749
|
outsidePrefix?: any;
|
746
|
-
|
750
|
+
loadingErrorMesssage?: string | undefined;
|
747
751
|
} & React__default.RefAttributes<HTMLInputElement>>;
|
748
752
|
|
749
753
|
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
package/dist/index.js
CHANGED
@@ -1092,7 +1092,8 @@ var Chip = import_react5.default.forwardRef(
|
|
1092
1092
|
icon,
|
1093
1093
|
color,
|
1094
1094
|
radius = "inherit",
|
1095
|
-
|
1095
|
+
dot,
|
1096
|
+
dotStatus = "none",
|
1096
1097
|
...rest
|
1097
1098
|
}, ref) => {
|
1098
1099
|
let defaultStyles = "hawa-flex hawa-flex-row hawa-w-fit hawa-gap-1 hawa-items-center hawa-px-2.5 hawa-py-1 hawa-font-bold ";
|
@@ -1111,7 +1112,8 @@ var Chip = import_react5.default.forwardRef(
|
|
1111
1112
|
normal: "hawa-flex hawa-h-2 hawa-w-2 hawa-rounded-full",
|
1112
1113
|
large: "hawa-flex hawa-h-3 hawa-w-3 hawa-rounded-full"
|
1113
1114
|
};
|
1114
|
-
let
|
1115
|
+
let dotStatusStyles = {
|
1116
|
+
none: "hawa-bg-gray-500 dark:hawa-bg-gray-800",
|
1115
1117
|
available: "hawa-bg-green-500",
|
1116
1118
|
unavailable: "hawa-bg-red-500"
|
1117
1119
|
};
|
@@ -1139,10 +1141,10 @@ var Chip = import_react5.default.forwardRef(
|
|
1139
1141
|
color ? colorStyles[color] : "hawa-border hawa-bg-none"
|
1140
1142
|
)
|
1141
1143
|
},
|
1142
|
-
|
1144
|
+
dot && /* @__PURE__ */ import_react5.default.createElement(
|
1143
1145
|
"span",
|
1144
1146
|
{
|
1145
|
-
className: cn(dotStyles[size],
|
1147
|
+
className: cn(dotStyles[size], dotStatusStyles[dotStatus])
|
1146
1148
|
}
|
1147
1149
|
),
|
1148
1150
|
icon && icon,
|
@@ -2659,7 +2661,7 @@ var Input = (0, import_react11.forwardRef)(
|
|
2659
2661
|
auto: ""
|
2660
2662
|
};
|
2661
2663
|
let defaultStyle = "hawa-flex hawa-max-h-fit hawa-h-fit hawa-relative hawa-flex-col hawa-justify-center hawa-gap-0";
|
2662
|
-
let defaultInputStyle = "hawa-block hawa-w-full hawa-rounded hawa-border hawa-transition-all hawa-bg-background hawa-p-3 hawa-text-sm ";
|
2664
|
+
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";
|
2663
2665
|
const handleChange = (e) => {
|
2664
2666
|
let newValue = e.target.value;
|
2665
2667
|
if (props.prefixText) {
|
@@ -2698,7 +2700,31 @@ var Input = (0, import_react11.forwardRef)(
|
|
2698
2700
|
)
|
2699
2701
|
},
|
2700
2702
|
props.outsidePrefix
|
2701
|
-
), props.isLoading ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : /* @__PURE__ */ import_react11.default.createElement(
|
2703
|
+
), props.isLoading ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(Skeleton, { className: "hawa-h-[40px] hawa-w-full" })) : props.isLoadingError ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-pb-2 hawa-w-full" }, /* @__PURE__ */ import_react11.default.createElement(
|
2704
|
+
Skeleton,
|
2705
|
+
{
|
2706
|
+
animation: "none",
|
2707
|
+
className: "hawa-h-[40px] hawa-w-full !hawa-bg-destructive/[0.3]",
|
2708
|
+
content: /* @__PURE__ */ import_react11.default.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ import_react11.default.createElement(
|
2709
|
+
"svg",
|
2710
|
+
{
|
2711
|
+
xmlns: "http://www.w3.org/2000/svg",
|
2712
|
+
width: "20",
|
2713
|
+
height: "20",
|
2714
|
+
viewBox: "0 0 24 24",
|
2715
|
+
fill: "none",
|
2716
|
+
stroke: "currentColor",
|
2717
|
+
strokeWidth: "2",
|
2718
|
+
strokeLinecap: "round",
|
2719
|
+
strokeLinejoin: "round",
|
2720
|
+
className: "hawa-text-destructive"
|
2721
|
+
},
|
2722
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
|
2723
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M12 9v4" }),
|
2724
|
+
/* @__PURE__ */ import_react11.default.createElement("path", { d: "M12 17h.01" })
|
2725
|
+
), /* @__PURE__ */ import_react11.default.createElement("span", null, /* @__PURE__ */ import_react11.default.createElement("span", { className: "hawa-text-destructive" }, props.loadingErrorMesssage || "Error loading data")))
|
2726
|
+
}
|
2727
|
+
)) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, !props.hideSeparator && /* @__PURE__ */ import_react11.default.createElement(
|
2702
2728
|
"div",
|
2703
2729
|
{
|
2704
2730
|
className: cn(
|
@@ -2890,6 +2916,7 @@ TableHeader.displayName = "TableHeader";
|
|
2890
2916
|
TableCaption.displayName = "TableCaption";
|
2891
2917
|
|
2892
2918
|
// elements/dataTable/DataTable.tsx
|
2919
|
+
var LOCAL_STORAGE_KEY = "datatable-column-visibility";
|
2893
2920
|
var DataTable = ({
|
2894
2921
|
columns,
|
2895
2922
|
data,
|
@@ -2909,7 +2936,10 @@ var DataTable = ({
|
|
2909
2936
|
);
|
2910
2937
|
const [globalFilter, setGlobalFilter] = React23.useState("");
|
2911
2938
|
const [expanded, setExpanded] = React23.useState({});
|
2912
|
-
const [columnVisibility, setColumnVisibility] = React23.useState({
|
2939
|
+
const [columnVisibility, setColumnVisibility] = React23.useState(() => {
|
2940
|
+
const savedVisibility = localStorage.getItem(LOCAL_STORAGE_KEY);
|
2941
|
+
return savedVisibility ? JSON.parse(savedVisibility) : {};
|
2942
|
+
});
|
2913
2943
|
const [rowSelection, setRowSelection] = React23.useState({});
|
2914
2944
|
const table = (0, import_react_table.useReactTable)({
|
2915
2945
|
data,
|
@@ -2939,12 +2969,20 @@ var DataTable = ({
|
|
2939
2969
|
label: `${item} / ${pageText}`,
|
2940
2970
|
value: item
|
2941
2971
|
}));
|
2972
|
+
React23.useEffect(() => {
|
2973
|
+
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(columnVisibility));
|
2974
|
+
}, [columnVisibility]);
|
2942
2975
|
React23.useEffect(() => {
|
2943
2976
|
setColumnVisibility((prev) => {
|
2944
2977
|
let newColumnVisibility = {};
|
2945
2978
|
columns.forEach((column) => {
|
2946
2979
|
var _a2;
|
2947
|
-
|
2980
|
+
const savedVisibility = prev[column.accessorKey];
|
2981
|
+
if (savedVisibility !== void 0) {
|
2982
|
+
newColumnVisibility[column.accessorKey] = savedVisibility;
|
2983
|
+
} else {
|
2984
|
+
newColumnVisibility[column.accessorKey] = !((_a2 = column.meta) == null ? void 0 : _a2.hidden);
|
2985
|
+
}
|
2948
2986
|
});
|
2949
2987
|
return newColumnVisibility;
|
2950
2988
|
});
|
@@ -3113,7 +3151,7 @@ var DataTable = ({
|
|
3113
3151
|
}
|
3114
3152
|
table.setPageIndex(page);
|
3115
3153
|
},
|
3116
|
-
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm"
|
3154
|
+
className: "hawa-w-16 hawa-rounded hawa-border hawa-p-1 hawa-px-2 hawa-text-sm placeholder:hawa-text-muted-foreground"
|
3117
3155
|
}
|
3118
3156
|
)), /* @__PURE__ */ React23.createElement(
|
3119
3157
|
DropdownMenu,
|
@@ -5016,7 +5054,6 @@ var Select = ({
|
|
5016
5054
|
)
|
5017
5055
|
},
|
5018
5056
|
unstyled: true,
|
5019
|
-
autoFocus: true,
|
5020
5057
|
components: props.hideIndicator ? {
|
5021
5058
|
Option,
|
5022
5059
|
Menu: Menu2,
|
@@ -7238,7 +7275,7 @@ var PhoneInput = ({
|
|
7238
7275
|
onChange: handleInputChange,
|
7239
7276
|
placeholder: props.placeholder,
|
7240
7277
|
className: cn(
|
7241
|
-
"hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
7278
|
+
"placeholder:hawa-text-muted-foreground hawa-block hawa-h-[40px] hawa-w-full hawa-rounded hawa-rounded-l-none hawa-border hawa-border-l-0 hawa-border-l-transparent hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all"
|
7242
7279
|
),
|
7243
7280
|
...inputProps
|
7244
7281
|
}
|
@@ -7316,7 +7353,7 @@ var PinInput = ({
|
|
7316
7353
|
id: `input-${index}`,
|
7317
7354
|
pattern: "[0-9]*",
|
7318
7355
|
className: cn(
|
7319
|
-
"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center",
|
7356
|
+
"hawa-h-10 hawa-rounded hawa-border hawa-bg-background hawa-text-center placeholder:hawa-text-muted-foreground",
|
7320
7357
|
width === "full" ? "hawa-w-full" : "hawa-w-10"
|
7321
7358
|
),
|
7322
7359
|
onChange: (e) => handleChange(e, index),
|
@@ -7451,7 +7488,7 @@ var ColorPicker = ({
|
|
7451
7488
|
value: selectedColor,
|
7452
7489
|
className: cn(
|
7453
7490
|
"hawa-block hawa-h-[40px] hawa-w-24 hawa-rounded hawa-rounded-l-none hawa-bg-background hawa-p-2 hawa-text-sm hawa-transition-all",
|
7454
|
-
"hawa-border hawa-border-l-0 hawa-border-l-transparent"
|
7491
|
+
"hawa-border hawa-border-l-0 hawa-border-l-transparent placeholder:hawa-text-muted-foreground"
|
7455
7492
|
// "hawa-border hawa-border-x-0 hawa-border-x-transparent hawa-border-b-0 hawa-rounded-tr-none"
|
7456
7493
|
),
|
7457
7494
|
style: {
|
@@ -9353,8 +9390,7 @@ var AppLayout = ({
|
|
9353
9390
|
"div",
|
9354
9391
|
{
|
9355
9392
|
className: cn(
|
9356
|
-
"hawa-fixed hawa-z-0 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all hawa-top-0 hawa-h-[calc(100dvh)] hawa-bg-
|
9357
|
-
// 'hawa-bg-primary-foreground',
|
9393
|
+
"hawa-fixed hawa-z-0 hawa-flex hawa-flex-col hawa-justify-between hawa-overflow-x-clip hawa-transition-all hawa-top-0 hawa-h-[calc(100dvh)] hawa-bg-primary-foreground",
|
9358
9394
|
isRTL ? "hawa-right-0" : "hawa-left-0",
|
9359
9395
|
bordered ? direction === "rtl" ? "hawa-border-s-[1px]" : "hawa-border-e-[1px]" : ""
|
9360
9396
|
),
|