@krosoft/react 0.0.21 → 0.0.22

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.
Files changed (33) hide show
  1. package/dist/KpiCards-DhstZUeY.js +336 -0
  2. package/dist/{LoadingState-C91zWRVu.js → LoadingState-Br3lWjL2.js} +4 -5
  3. package/dist/badge-CS99D5mG.js +26 -0
  4. package/dist/components/core/cards/KpiCard.d.ts +13 -0
  5. package/dist/components/core/cards/KpiCard.d.ts.map +1 -0
  6. package/dist/components/core/cards/KpiCards.d.ts +7 -0
  7. package/dist/components/core/cards/KpiCards.d.ts.map +1 -0
  8. package/dist/components/core/cards/index.d.ts +4 -0
  9. package/dist/components/core/cards/index.d.ts.map +1 -0
  10. package/dist/components/core/cards/index.js +5 -0
  11. package/dist/components/core/index.d.ts +1 -0
  12. package/dist/components/core/index.d.ts.map +1 -1
  13. package/dist/components/core/index.js +6 -3
  14. package/dist/components/core/states/index.js +1 -1
  15. package/dist/components/index.js +27 -15
  16. package/dist/components/ui/badge.d.ts +1 -1
  17. package/dist/components/ui/button.d.ts +12 -0
  18. package/dist/components/ui/button.d.ts.map +1 -0
  19. package/dist/components/ui/card.d.ts +9 -0
  20. package/dist/components/ui/card.d.ts.map +1 -0
  21. package/dist/components/ui/index.d.ts +3 -0
  22. package/dist/components/ui/index.d.ts.map +1 -1
  23. package/dist/components/ui/index.js +20 -11
  24. package/dist/helpers/index.js +1 -1
  25. package/dist/hooks/index.d.ts +1 -0
  26. package/dist/hooks/index.d.ts.map +1 -1
  27. package/dist/hooks/index.js +28 -38
  28. package/dist/hooks/ui/useMobile.d.ts.map +1 -1
  29. package/dist/hooks/ui/useNotifications.d.ts +5 -4
  30. package/dist/hooks/ui/useNotifications.d.ts.map +1 -1
  31. package/dist/{index-DxGGCUCL.js → index-gWiv5-6R.js} +2 -2
  32. package/dist/{toast-DZWzsFB2.js → toast-CUZ-UU-l.js} +412 -384
  33. package/package.json +6 -2
@@ -1,21 +1,21 @@
1
- import * as d from "react";
1
+ import * as S from "react";
2
2
  import { useState as E, useEffect as m } from "react";
3
- const a = 768;
4
- function M() {
3
+ const u = 768;
4
+ function _() {
5
5
  const [t, s] = E(!1);
6
6
  return m(() => {
7
- const e = window.matchMedia(`(max-width: ${a - 1}px)`), o = () => {
8
- s(window.innerWidth < a);
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 < a), () => e.removeEventListener("change", o);
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 u = 0;
14
+ let a = 0;
15
15
  function h() {
16
- return u = (u + 1) % Number.MAX_SAFE_INTEGER, u.toString();
16
+ return a = (a + 1) % Number.MAX_SAFE_INTEGER, a.toString();
17
17
  }
18
- const T = /* @__PURE__ */ new Map(), S = (t) => {
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 ? S(e) : t.toasts.forEach((o) => {
43
- S(o.id);
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 l({ ...t }) {
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] = d.useState(c);
93
- return d.useEffect(() => (i.push(s), () => {
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: l,
98
+ toast: d,
99
99
  dismiss: (e) => r({ type: "DISMISS_TOAST", toastId: e })
100
100
  };
101
101
  }
102
- const w = () => {
103
- const { toast: t } = _();
104
- return {
105
- showSuccess: (o, n) => {
106
- t({
107
- title: o,
108
- description: n
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
- l as toast,
122
- M as useMobile,
123
- w as useNotifications,
124
- _ as useToast
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,YAcxB"}
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 declare const useNotifications: () => {
2
- showSuccess: (title: string, description?: string | undefined) => void;
3
- showError: (title: string, description?: string | undefined, error?: Error | null) => void;
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,eAAO,MAAM,gBAAgB;yBAGC,MAAM,gBAAgB,MAAM,GAAG,SAAS;uBAQ3D,MAAM,gBACC,MAAM,GAAG,SAAS,UACxB,KAAK,GAAG,IAAI;CAcvB,CAAC"}
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"}
@@ -2273,6 +2273,6 @@ function We(...e) {
2273
2273
  return Le(ne(e));
2274
2274
  }
2275
2275
  export {
2276
- We as a,
2277
- ne as c
2276
+ ne as a,
2277
+ We as c
2278
2278
  };