@krosoft/react 0.0.89 → 0.0.91
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/{AppSubTitle-RKbtrPJr.js → AppSubTitle-CvJlatS9.js} +1 -1
- package/dist/{AppTitle-DCQpP2qE.js → AppTitle-LIQCjpo5.js} +26 -25
- package/dist/{AppVerticalTabs-pK3i9ZTD.js → AppVerticalTabs-BHrad7wu.js} +23 -23
- package/dist/ConfirmationDialog-BlRXnFH5.js +321 -0
- package/dist/ErrorAlert-BITMD2I5.js +33 -0
- package/dist/{LoadingState-DQjGcT2l.js → LoadingState-COf3KhOP.js} +6 -6
- package/dist/{MetricCard-DB1ME6tD.js → MetricCard-BGT2QRn0.js} +14 -13
- package/dist/{SearchInput-D_SLIZ2y.js → SearchInput-DpOuKSIf.js} +115 -126
- package/dist/{TableFilter-DXTOY-oa.js → TableFilter-DFtN_-Bg.js} +51 -51
- package/dist/{TableSettings-CBtuAPgM.js → TableSettings-m2q3s0wU.js} +68 -80
- package/dist/{ThemeSelector-CU8JmN2b.js → ThemeSelector-D9KTJAWz.js} +3 -3
- package/dist/{Topbar-BzZxu1Zi.js → Topbar-QKCJiWdO.js} +2 -2
- package/dist/{badge-DyRSpnOb.js → badge-C09fRxvd.js} +1 -1
- package/dist/card-Bn3Y7DHQ.js +48 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts +10 -0
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts.map +1 -0
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts +13 -0
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts.map +1 -0
- package/dist/components/core/dialogs/index.d.ts +3 -0
- package/dist/components/core/dialogs/index.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +15 -13
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +60 -56
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/ErrorAlert.d.ts +7 -0
- package/dist/components/core/states/ErrorAlert.d.ts.map +1 -0
- package/dist/components/core/states/index.d.ts +1 -0
- package/dist/components/core/states/index.d.ts.map +1 -1
- package/dist/components/core/states/index.js +6 -4
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +280 -136
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +21 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +4 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/carousel.d.ts +19 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +50 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/form.d.ts +24 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/index.d.ts +42 -16
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +231 -91
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/menubar.d.ts +34 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/pagination.d.ts +33 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +67 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/simple-table.d.ts +11 -0
- package/dist/components/ui/simple-table.d.ts.map +1 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +5 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +6 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/toaster.d.ts +2 -0
- package/dist/components/ui/toaster.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/{ellipsis-vertical-CqrunffH.js → ellipsis-vertical-BVxSFNOa.js} +1 -1
- package/dist/grip-vertical-CJ07_87Y.js +18 -0
- package/dist/hooks/index.js +6 -5
- package/dist/index-DSyPHOLE.js +147 -0
- package/dist/{loader-circle-BhJXKs31.js → loader-circle-GAYBtm3z.js} +1 -1
- package/dist/{select-B5wF6jxC.js → select-D6_XPD6x.js} +309 -308
- package/dist/toaster-D6ND7OTk.js +113 -0
- package/dist/toggle-group-VJoGbVQm.js +19987 -0
- package/dist/{tooltip-BzTGwm2E.js → tooltip-CAu4DEhc.js} +767 -796
- package/dist/types/ConfirmDialogConfig.d.ts +11 -0
- package/dist/types/ConfirmDialogConfig.d.ts.map +1 -0
- package/dist/useTheme-Bn8z_uxy.js +31 -0
- package/dist/useToast-BFTk4lWz.js +100 -0
- package/package.json +29 -7
- package/dist/FormDialog-CXLQG83d.js +0 -250
- package/dist/card-7XPLAra3.js +0 -23
- package/dist/createLucideIcon-CRdjzt2A.js +0 -116
- package/dist/skeleton-CJ1F2tD3.js +0 -8
- package/dist/tabs-BYqvMsA6.js +0 -6628
- package/dist/useTheme-CvNYmhjo.js +0 -128
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { useTheme as _ } from "next-themes";
|
|
2
|
-
import * as l from "react";
|
|
3
|
-
const I = 1, O = 1e6;
|
|
4
|
-
let i = 0;
|
|
5
|
-
function v() {
|
|
6
|
-
return i = (i + 1) % Number.MAX_SAFE_INTEGER, i.toString();
|
|
7
|
-
}
|
|
8
|
-
const d = /* @__PURE__ */ new Map(), h = (s) => {
|
|
9
|
-
if (d.has(s))
|
|
10
|
-
return;
|
|
11
|
-
const e = setTimeout(() => {
|
|
12
|
-
d.delete(s), c({
|
|
13
|
-
type: "REMOVE_TOAST",
|
|
14
|
-
toastId: s
|
|
15
|
-
});
|
|
16
|
-
}, O);
|
|
17
|
-
d.set(s, e);
|
|
18
|
-
}, D = (s, e) => {
|
|
19
|
-
switch (e.type) {
|
|
20
|
-
case "ADD_TOAST":
|
|
21
|
-
return {
|
|
22
|
-
...s,
|
|
23
|
-
toasts: [e.toast, ...s.toasts].slice(0, I)
|
|
24
|
-
};
|
|
25
|
-
case "UPDATE_TOAST":
|
|
26
|
-
return {
|
|
27
|
-
...s,
|
|
28
|
-
toasts: s.toasts.map((t) => t.id === e.toast.id ? { ...t, ...e.toast } : t)
|
|
29
|
-
};
|
|
30
|
-
case "DISMISS_TOAST": {
|
|
31
|
-
const { toastId: t } = e;
|
|
32
|
-
return t !== void 0 ? h(t) : s.toasts.forEach((o) => {
|
|
33
|
-
h(o.id);
|
|
34
|
-
}), {
|
|
35
|
-
...s,
|
|
36
|
-
toasts: s.toasts.map(
|
|
37
|
-
(o) => o.id === t || t === void 0 ? {
|
|
38
|
-
...o,
|
|
39
|
-
open: !1
|
|
40
|
-
} : o
|
|
41
|
-
)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
case "REMOVE_TOAST":
|
|
45
|
-
return e.toastId === void 0 ? {
|
|
46
|
-
...s,
|
|
47
|
-
toasts: []
|
|
48
|
-
} : {
|
|
49
|
-
...s,
|
|
50
|
-
toasts: s.toasts.filter((t) => t.id !== e.toastId)
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}, a = [];
|
|
54
|
-
let u = { toasts: [] };
|
|
55
|
-
function c(s) {
|
|
56
|
-
u = D(u, s), a.forEach((e) => {
|
|
57
|
-
e(u);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
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
|
-
};
|
|
69
|
-
return c({
|
|
70
|
-
type: "ADD_TOAST",
|
|
71
|
-
toast: {
|
|
72
|
-
...s,
|
|
73
|
-
id: e,
|
|
74
|
-
open: !0,
|
|
75
|
-
onOpenChange: (n) => {
|
|
76
|
-
n || o();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}), {
|
|
80
|
-
id: e,
|
|
81
|
-
dismiss: o,
|
|
82
|
-
update: t
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function x() {
|
|
86
|
-
const [s, e] = l.useState(u);
|
|
87
|
-
return l.useEffect(() => (a.push(e), () => {
|
|
88
|
-
const t = a.indexOf(e);
|
|
89
|
-
t > -1 && a.splice(t, 1);
|
|
90
|
-
}), [s]), {
|
|
91
|
-
...s,
|
|
92
|
-
toast: S,
|
|
93
|
-
dismiss: (t) => {
|
|
94
|
-
c({ type: "DISMISS_TOAST", toastId: t });
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
const y = () => ({
|
|
99
|
-
showSuccess: (t, o, n) => {
|
|
100
|
-
S({ title: t, description: o, action: n });
|
|
101
|
-
},
|
|
102
|
-
showError: (t, o, n) => {
|
|
103
|
-
console.error(o, n), S({ title: t, description: o, variant: "destructive" });
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
function R(s) {
|
|
107
|
-
const { showSuccess: e } = y(), { theme: t, setTheme: o } = _(), n = (r) => {
|
|
108
|
-
o(r);
|
|
109
|
-
const T = s.find((p) => p.value === r);
|
|
110
|
-
e("Thème mis à jour", `Le thème a été changé vers ${(T == null ? void 0 : T.label) ?? r}.`);
|
|
111
|
-
}, m = s.find((r) => r.value === t), A = s.findIndex((r) => r.value === t), f = s[(A + 1) % s.length], E = (t == null ? void 0 : t.startsWith("dark")) ?? !1;
|
|
112
|
-
return {
|
|
113
|
-
theme: t,
|
|
114
|
-
setTheme: o,
|
|
115
|
-
handleThemeChange: n,
|
|
116
|
-
themeOptions: s,
|
|
117
|
-
currentThemeOption: m,
|
|
118
|
-
nextThemeOption: f,
|
|
119
|
-
isDark: E,
|
|
120
|
-
cycleTheme: () => n(f.value)
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
export {
|
|
124
|
-
R as a,
|
|
125
|
-
x as b,
|
|
126
|
-
S as t,
|
|
127
|
-
y as u
|
|
128
|
-
};
|