@krosoft/react 0.0.21 → 0.0.23
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/KpiCards-CZBzcNpV.js +336 -0
- package/dist/{LoadingState-C91zWRVu.js → LoadingState-Br3lWjL2.js} +4 -5
- package/dist/SearchInput-CVB8yapU.js +45 -0
- package/dist/badge-GmlbyLzK.js +26 -0
- package/dist/components/core/cards/KpiCard.d.ts +13 -0
- package/dist/components/core/cards/KpiCard.d.ts.map +1 -0
- package/dist/components/core/cards/KpiCards.d.ts +7 -0
- package/dist/components/core/cards/KpiCards.d.ts.map +1 -0
- package/dist/components/core/cards/index.d.ts +4 -0
- package/dist/components/core/cards/index.d.ts.map +1 -0
- package/dist/components/core/cards/index.js +5 -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 +8 -3
- package/dist/components/core/inputs/SearchInput.d.ts +12 -0
- package/dist/components/core/inputs/SearchInput.d.ts.map +1 -0
- package/dist/components/core/inputs/index.d.ts +2 -0
- package/dist/components/core/inputs/index.d.ts.map +1 -0
- package/dist/components/core/inputs/index.js +4 -0
- package/dist/components/core/states/index.js +1 -1
- package/dist/components/index.js +31 -16
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +4 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +21 -11
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/helpers/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +28 -38
- package/dist/hooks/ui/useMobile.d.ts.map +1 -1
- package/dist/hooks/ui/useNotifications.d.ts +5 -4
- package/dist/hooks/ui/useNotifications.d.ts.map +1 -1
- package/dist/{index-DxGGCUCL.js → index-gWiv5-6R.js} +2 -2
- package/dist/toast-CysfMIUk.js +1107 -0
- package/package.json +6 -2
- package/dist/toast-DZWzsFB2.js +0 -1064
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import { A as t, a as o, b as
|
|
1
|
+
import { A as t, a as o, b as r, B as e, C as i, c as n, d, e as T, f as C, g as l, I as p, T as c, h as A, i as b, j as B, k as f, l as g, m, n as u } from "../../toast-CysfMIUk.js";
|
|
2
|
+
import { B as V, b as x } from "../../badge-GmlbyLzK.js";
|
|
2
3
|
export {
|
|
3
4
|
t as Alert,
|
|
4
5
|
o as AlertDescription,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
p as
|
|
6
|
+
r as AlertTitle,
|
|
7
|
+
V as Badge,
|
|
8
|
+
e as Button,
|
|
9
|
+
i as Card,
|
|
10
|
+
n as CardContent,
|
|
11
|
+
d as CardDescription,
|
|
12
|
+
T as CardFooter,
|
|
13
|
+
C as CardHeader,
|
|
14
|
+
l as CardTitle,
|
|
15
|
+
p as Input,
|
|
16
|
+
c as Toast,
|
|
17
|
+
A as ToastAction,
|
|
18
|
+
b as ToastClose,
|
|
19
|
+
B as ToastDescription,
|
|
20
|
+
f as ToastProvider,
|
|
21
|
+
g as ToastTitle,
|
|
22
|
+
m as ToastViewport,
|
|
23
|
+
x as badgeVariants,
|
|
24
|
+
u as buttonVariants
|
|
15
25
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
3
|
+
export { Input };
|
|
4
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/components/ui/input.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,KAAK,8KAYT,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/helpers/index.js
CHANGED
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as S from "react";
|
|
2
2
|
import { useState as E, useEffect as m } from "react";
|
|
3
|
-
const
|
|
4
|
-
function
|
|
3
|
+
const u = 768;
|
|
4
|
+
function _() {
|
|
5
5
|
const [t, s] = E(!1);
|
|
6
6
|
return m(() => {
|
|
7
|
-
const e = window.matchMedia(`(max-width: ${
|
|
8
|
-
s(window.innerWidth <
|
|
7
|
+
const e = window.matchMedia(`(max-width: ${String(u - 1)}px)`), o = () => {
|
|
8
|
+
s(window.innerWidth < u);
|
|
9
9
|
};
|
|
10
|
-
return e.addEventListener("change", o), s(window.innerWidth <
|
|
10
|
+
return e.addEventListener("change", o), s(window.innerWidth < u), () => e.removeEventListener("change", o);
|
|
11
11
|
}, []), t;
|
|
12
12
|
}
|
|
13
13
|
const p = 1, A = 1e6;
|
|
14
|
-
let
|
|
14
|
+
let a = 0;
|
|
15
15
|
function h() {
|
|
16
|
-
return
|
|
16
|
+
return a = (a + 1) % Number.MAX_SAFE_INTEGER, a.toString();
|
|
17
17
|
}
|
|
18
|
-
const T = /* @__PURE__ */ new Map(),
|
|
18
|
+
const T = /* @__PURE__ */ new Map(), f = (t) => {
|
|
19
19
|
if (T.has(t))
|
|
20
20
|
return;
|
|
21
21
|
const s = setTimeout(() => {
|
|
@@ -39,8 +39,8 @@ const T = /* @__PURE__ */ new Map(), S = (t) => {
|
|
|
39
39
|
};
|
|
40
40
|
case "DISMISS_TOAST": {
|
|
41
41
|
const { toastId: e } = s;
|
|
42
|
-
return e ?
|
|
43
|
-
|
|
42
|
+
return e ? f(e) : t.toasts.forEach((o) => {
|
|
43
|
+
f(o.id);
|
|
44
44
|
}), {
|
|
45
45
|
...t,
|
|
46
46
|
toasts: t.toasts.map(
|
|
@@ -67,7 +67,7 @@ function r(t) {
|
|
|
67
67
|
s(c);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function d({ ...t }) {
|
|
71
71
|
const s = h(), e = (n) => r({
|
|
72
72
|
type: "UPDATE_TOAST",
|
|
73
73
|
toast: { ...n, id: s }
|
|
@@ -88,38 +88,28 @@ function l({ ...t }) {
|
|
|
88
88
|
update: e
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const [t, s] =
|
|
93
|
-
return
|
|
91
|
+
function I() {
|
|
92
|
+
const [t, s] = S.useState(c);
|
|
93
|
+
return S.useEffect(() => (i.push(s), () => {
|
|
94
94
|
const e = i.indexOf(s);
|
|
95
95
|
e > -1 && i.splice(e, 1);
|
|
96
96
|
}), [t]), {
|
|
97
97
|
...t,
|
|
98
|
-
toast:
|
|
98
|
+
toast: d,
|
|
99
99
|
dismiss: (e) => r({ type: "DISMISS_TOAST", toastId: e })
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
},
|
|
111
|
-
showError: (o, n, f) => {
|
|
112
|
-
console.error(n, f), t({
|
|
113
|
-
title: o,
|
|
114
|
-
description: n,
|
|
115
|
-
variant: "destructive"
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
};
|
|
102
|
+
const M = () => ({
|
|
103
|
+
showSuccess: (e, o) => {
|
|
104
|
+
d({ title: e, description: o });
|
|
105
|
+
},
|
|
106
|
+
showError: (e, o, n) => {
|
|
107
|
+
console.error(o, n), d({ title: e, description: o, variant: "destructive" });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
120
110
|
export {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
111
|
+
d as toast,
|
|
112
|
+
_ as useMobile,
|
|
113
|
+
M as useNotifications,
|
|
114
|
+
I as useToast
|
|
125
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useMobile.tsx"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,
|
|
1
|
+
{"version":3,"file":"useMobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useMobile.tsx"],"names":[],"mappings":"AAIA,wBAAgB,SAAS,IAAI,OAAO,CAcnC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
showSuccess: (title: string, description?: string
|
|
3
|
-
showError: (title: string, description?: string
|
|
4
|
-
}
|
|
1
|
+
export interface UseNotificationsResult {
|
|
2
|
+
showSuccess: (title: string, description?: string) => void;
|
|
3
|
+
showError: (title: string, description?: string, error?: Error | null) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useNotifications: () => UseNotificationsResult;
|
|
5
6
|
//# sourceMappingURL=useNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useNotifications.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useNotifications.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CAChF;AAED,eAAO,MAAM,gBAAgB,QAAO,sBAcnC,CAAC"}
|