@krosoft/react 0.0.77 → 0.0.79
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/{LoadingState-CqRLmkxn.js → LoadingState-DQjGcT2l.js} +5 -5
- package/dist/MetricCard-4VI9Ki0g.js +83 -0
- package/dist/SearchInput-Cf5NHhnz.js +698 -0
- package/dist/TableFilter-DgChe4aX.js +406 -0
- package/dist/TableSettings-4YLJSh4G.js +2064 -0
- package/dist/{ThemeSelector-sTd9T2OD.js → ThemeSelector-MqD5QvHl.js} +8 -8
- package/dist/{Topbar-BqC05zWP.js → Topbar-DifQ00kV.js} +26 -27
- package/dist/{badge-kADcbb2Y.js → badge-Bw-aBz_H.js} +1 -1
- package/dist/components/core/cards/KpiCard.d.ts +1 -1
- package/dist/components/core/cards/KpiCard.d.ts.map +1 -1
- package/dist/components/core/cards/MetricCard.d.ts +20 -8
- package/dist/components/core/cards/MetricCard.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/filters/ActiveFilters.d.ts +10 -0
- package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -0
- package/dist/components/core/filters/AdvancedFilters.d.ts +11 -0
- package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -0
- package/dist/components/core/filters/FilterField.d.ts +11 -0
- package/dist/components/core/filters/FilterField.d.ts.map +1 -0
- package/dist/components/core/filters/SearchableFilterPill.d.ts +15 -0
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -0
- package/dist/components/core/filters/TableFilter.d.ts +17 -0
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -0
- package/dist/components/core/filters/index.d.ts +5 -0
- package/dist/components/core/filters/index.d.ts.map +1 -0
- package/dist/components/core/filters/index.js +7 -0
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +34 -26
- package/dist/components/core/inputs/DatePicker.d.ts +9 -0
- package/dist/components/core/inputs/DatePicker.d.ts.map +1 -0
- package/dist/components/core/inputs/MultiSelect.d.ts +17 -0
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -0
- package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts +14 -0
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -0
- package/dist/components/core/inputs/index.d.ts +3 -1
- package/dist/components/core/inputs/index.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +6 -3
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +1 -1
- package/dist/components/core/table/DataTable.d.ts +17 -2
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +2 -2
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TableHeader.d.ts +1 -1
- package/dist/components/core/table/TableHeader.d.ts.map +1 -1
- package/dist/components/core/table/index.d.ts +1 -3
- package/dist/components/core/table/index.d.ts.map +1 -1
- package/dist/components/core/table/index.js +9 -9
- package/dist/components/core/theme/ThemeSelector.d.ts +2 -1
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +86 -63
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +4 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +50 -35
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.d.ts.map +1 -1
- package/dist/{floating-ui.react-dom-BPCyLQfI.js → floating-ui.react-dom-BIcsGc3t.js} +553 -526
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/ui/useDataTable.d.ts +1 -1
- package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
- package/dist/hooks/ui/useToast.d.ts +5 -13
- package/dist/hooks/ui/useToast.d.ts.map +1 -1
- package/dist/popover-UjRQmYGN.js +5889 -0
- package/dist/select-CtU681LB.js +2070 -0
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tooltip-DzQngJZK.js +828 -0
- package/dist/types/FilterFieldConfig.d.ts +16 -0
- package/dist/types/FilterFieldConfig.d.ts.map +1 -0
- package/dist/types/FilterSection.d.ts +6 -0
- package/dist/types/FilterSection.d.ts.map +1 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/{useTheme-D__o7mLN.js → useTheme-DsHPKCDp.js} +24 -18
- package/package.json +5 -3
- package/dist/Combination-CzdDhqdB.js +0 -564
- package/dist/DataTable-CjFA9p4V.js +0 -2216
- package/dist/DateRangePicker-rrXXEYz8.js +0 -1240
- package/dist/MetricCard-88djqC4o.js +0 -66
- package/dist/calendar-BMReToKR.js +0 -3911
- package/dist/checkbox-BI6Lm_p-.js +0 -358
- package/dist/chevron-down-ki5-dwtL.js +0 -11
- package/dist/select-B-hcmC3K.js +0 -1468
- package/dist/tooltip-gI1Mp9DG.js +0 -779
- package/dist/types/DataTableProps.d.ts +0 -19
- package/dist/types/DataTableProps.d.ts.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface FilterFieldConfig {
|
|
2
|
+
key: string;
|
|
3
|
+
label: string;
|
|
4
|
+
type: "text" | "select" | "date" | "date-range" | "number" | "multi-select";
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
options?: {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
isQuickFilter?: boolean;
|
|
13
|
+
searchable?: boolean;
|
|
14
|
+
searchPlaceholder?: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=FilterFieldConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterFieldConfig.d.ts","sourceRoot":"","sources":["../../src/types/FilterFieldConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,cAAc,CAAC;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;KAAE,EAAE,CAAC;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSection.d.ts","sourceRoot":"","sources":["../../src/types/FilterSection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -2,20 +2,20 @@ import { useTheme as _ } from "next-themes";
|
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
const I = 1, O = 1e6;
|
|
4
4
|
let i = 0;
|
|
5
|
-
function
|
|
5
|
+
function v() {
|
|
6
6
|
return i = (i + 1) % Number.MAX_SAFE_INTEGER, i.toString();
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
8
|
+
const d = /* @__PURE__ */ new Map(), h = (s) => {
|
|
9
|
+
if (d.has(s))
|
|
10
10
|
return;
|
|
11
11
|
const e = setTimeout(() => {
|
|
12
|
-
|
|
12
|
+
d.delete(s), c({
|
|
13
13
|
type: "REMOVE_TOAST",
|
|
14
14
|
toastId: s
|
|
15
15
|
});
|
|
16
16
|
}, O);
|
|
17
|
-
|
|
18
|
-
},
|
|
17
|
+
d.set(s, e);
|
|
18
|
+
}, D = (s, e) => {
|
|
19
19
|
switch (e.type) {
|
|
20
20
|
case "ADD_TOAST":
|
|
21
21
|
return {
|
|
@@ -29,7 +29,7 @@ const S = /* @__PURE__ */ new Map(), h = (s) => {
|
|
|
29
29
|
};
|
|
30
30
|
case "DISMISS_TOAST": {
|
|
31
31
|
const { toastId: t } = e;
|
|
32
|
-
return t ? h(t) : s.toasts.forEach((o) => {
|
|
32
|
+
return t !== void 0 ? h(t) : s.toasts.forEach((o) => {
|
|
33
33
|
h(o.id);
|
|
34
34
|
}), {
|
|
35
35
|
...s,
|
|
@@ -53,15 +53,19 @@ const S = /* @__PURE__ */ new Map(), h = (s) => {
|
|
|
53
53
|
}, a = [];
|
|
54
54
|
let u = { toasts: [] };
|
|
55
55
|
function c(s) {
|
|
56
|
-
u =
|
|
56
|
+
u = D(u, s), a.forEach((e) => {
|
|
57
57
|
e(u);
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
const e =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
function S({ ...s }) {
|
|
61
|
+
const e = v(), t = (n) => {
|
|
62
|
+
c({
|
|
63
|
+
type: "UPDATE_TOAST",
|
|
64
|
+
toast: { ...n, id: e }
|
|
65
|
+
});
|
|
66
|
+
}, o = () => {
|
|
67
|
+
c({ type: "DISMISS_TOAST", toastId: e });
|
|
68
|
+
};
|
|
65
69
|
return c({
|
|
66
70
|
type: "ADD_TOAST",
|
|
67
71
|
toast: {
|
|
@@ -85,16 +89,18 @@ function x() {
|
|
|
85
89
|
t > -1 && a.splice(t, 1);
|
|
86
90
|
}), [s]), {
|
|
87
91
|
...s,
|
|
88
|
-
toast:
|
|
89
|
-
dismiss: (t) =>
|
|
92
|
+
toast: S,
|
|
93
|
+
dismiss: (t) => {
|
|
94
|
+
c({ type: "DISMISS_TOAST", toastId: t });
|
|
95
|
+
}
|
|
90
96
|
};
|
|
91
97
|
}
|
|
92
98
|
const y = () => ({
|
|
93
99
|
showSuccess: (t, o, n) => {
|
|
94
|
-
|
|
100
|
+
S({ title: t, description: o, action: n });
|
|
95
101
|
},
|
|
96
102
|
showError: (t, o, n) => {
|
|
97
|
-
console.error(o, n),
|
|
103
|
+
console.error(o, n), S({ title: t, description: o, variant: "destructive" });
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
function R(s) {
|
|
@@ -117,6 +123,6 @@ function R(s) {
|
|
|
117
123
|
export {
|
|
118
124
|
y as a,
|
|
119
125
|
x as b,
|
|
120
|
-
|
|
126
|
+
S as t,
|
|
121
127
|
R as u
|
|
122
128
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krosoft/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.79",
|
|
4
4
|
"description": "Krosoft shared React package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -43,9 +43,11 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
45
45
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
46
|
-
"@radix-ui/react-
|
|
46
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
47
47
|
"@radix-ui/react-popover": "^1.1.15",
|
|
48
48
|
"@radix-ui/react-select": "^2.2.6",
|
|
49
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
50
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
49
51
|
"@radix-ui/react-separator": "^1.1.8",
|
|
50
52
|
"@radix-ui/react-toast": "^1.2.15",
|
|
51
53
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
@@ -58,7 +60,7 @@
|
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@krosoft/core": "^0.0.37",
|
|
61
|
-
"@krosoft/tooling-eslint-react": "^0.0.
|
|
63
|
+
"@krosoft/tooling-eslint-react": "^0.0.20",
|
|
62
64
|
"@krosoft/tooling-prettier": "^0.0.14",
|
|
63
65
|
"@krosoft/tooling-tsconfig-react": "^0.0.10",
|
|
64
66
|
"@storybook/addon-essentials": "^8.6.18",
|