@krosoft/react 0.0.170 → 0.0.171
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/README.md +27 -1
- package/dist/{AppActions-DCYt9I0e.js → AppActions-CwPaiNx1.js} +5 -5
- package/dist/{AppSubTitle-DhioA5bv.js → AppSubTitle-6JLlE8Vf.js} +1 -1
- package/dist/{AppVerticalTabs-DujFNh9f.js → AppVerticalTabs-BkZkxL_K.js} +4 -4
- package/dist/{ConfirmationDialog-CCZPbD4x.js → ConfirmationDialog-t5QtNOQO.js} +10 -10
- package/dist/{DataTable-28eGRJvy.js → DataTable-C1l3CLr1.js} +92 -86
- package/dist/{ErrorAlert-DH1onuyt.js → ErrorAlert-SrIcU1mM.js} +1 -1
- package/dist/{ErrorState-vU8d4CwD.js → ErrorState-CmaxuJyW.js} +2 -2
- package/dist/{GenericForm-EohJXOt8.js → GenericForm-DXclmweK.js} +8 -8
- package/dist/{ImageInput-Bbxr8vpu.js → ImageInput-BqoCekqh.js} +18 -18
- package/dist/KpiCardsLayout-BhEoJhJ9.js +49 -0
- package/dist/{MetricCard-rL1mIA58.js → MetricCard-C7kgpgRl.js} +8 -8
- package/dist/{MultiSelect-B72dsN-1.js → MultiSelect-BFdaRnIO.js} +8 -8
- package/dist/{SearchInput-rRYNQ8fq.js → SearchInput-Dg5Aw2lv.js} +29 -29
- package/dist/{SkeletonCards-BgsWWMun.js → SkeletonCards-DemfjUfD.js} +6 -6
- package/dist/{TableFilter-BfWYeTv_.js → TableFilter-WWNz4Nua.js} +9 -9
- package/dist/{ThemeSelector-CQ3fSDJ2.js → ThemeSelector-BwrbKW-4.js} +2 -2
- package/dist/{Topbar-DMyjbOTI.js → Topbar-D55ou5Uk.js} +7 -7
- package/dist/{alert-B78CiTYe.js → alert-B9F1N9Qk.js} +6 -6
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +18 -18
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- 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 +24 -24
- package/dist/components/ui/index.js +7 -7
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/{select-MWzbMBAS.js → select-BwcXfUqZ.js} +2 -2
- package/dist/{sheet-Gop1cIaU.js → sheet-DOncI9p6.js} +5 -5
- package/dist/skeleton-BX4RcsiK.js +8 -0
- package/dist/tailwind/index.d.ts +2 -0
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +10 -2
- package/dist/{toaster-DTcdwmkK.js → toaster-S0xacBVZ.js} +1 -1
- package/dist/{toggle-group-DY9wl0HW.js → toggle-group-DC5hqQ4H.js} +33 -33
- package/dist/{tooltip-BWyFpIxo.js → tooltip-OY3E8Lo0.js} +14 -14
- package/dist/{usePage-CWu-cjzK.js → usePage-u2gRhvQ0.js} +1 -1
- package/package.json +1 -1
- package/dist/KpiCardsLayout-DBqGhp0I.js +0 -49
- package/dist/skeleton-8o8eJd3P.js +0 -8
package/README.md
CHANGED
|
@@ -4,4 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
Krosoft shared React package.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Radius des composants
|
|
8
|
+
|
|
9
|
+
La forme des composants est pilotée par des variables CSS, pas par des classes `rounded-*` codées en dur : un input, un bouton et une pastille de filtre posés côte à côte ont toujours la même forme.
|
|
10
|
+
|
|
11
|
+
Choisir un preset sur `<html>` :
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<html lang="fr" data-radius="round"></html>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Preset | Contrôles<br><small>boutons, inputs, selects, pastilles, badges</small> | Conteneurs<br><small>cards, dialogs, popovers, menus</small> |
|
|
18
|
+
| ----------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
19
|
+
| `square` | `0` | `0` |
|
|
20
|
+
| `soft` _(défaut)_ | `0.5rem` | `0.75rem` |
|
|
21
|
+
| `round` | capsule | `1.25rem` |
|
|
22
|
+
|
|
23
|
+
Pour des valeurs sur mesure, aucun preset n'est nécessaire — il suffit de redéfinir les variables :
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
:root {
|
|
27
|
+
--radius-control: 4px; /* contrôles */
|
|
28
|
+
--radius-surface: 16px; /* conteneurs */
|
|
29
|
+
--radius: 4px; /* éléments imbriqués : items de menu, checkbox */
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Story `Démos/Radius` pour comparer les presets, sélecteur **Radius** dans la barre d'outils Storybook pour les appliquer à n'importe quelle story.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-
|
|
3
|
-
import "./alert-
|
|
2
|
+
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-DC5hqQ4H.js";
|
|
3
|
+
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as p } from "./tooltip-
|
|
5
|
+
import { B as p } from "./tooltip-OY3E8Lo0.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-DOncI9p6.js";
|
|
8
8
|
import { MoreVerticalIcon as C } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
11
|
-
import "./select-
|
|
11
|
+
import "./select-BwcXfUqZ.js";
|
|
12
12
|
import "next-themes";
|
|
13
13
|
import "sonner";
|
|
14
14
|
import "react";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
|
-
import { A as m } from "./AppActions-
|
|
3
|
+
import { A as m } from "./AppActions-CwPaiNx1.js";
|
|
4
4
|
function f({ titleKey: s, actions: t, className: o }) {
|
|
5
5
|
const { t: r } = l();
|
|
6
6
|
return /* @__PURE__ */ i("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { J as N, N as g, K as v, bN as y, bP as T, bQ as b, bO as w, bA as S } from "./toggle-group-
|
|
3
|
-
import { A as C } from "./AppActions-
|
|
2
|
+
import { J as N, N as g, K as v, bN as y, bP as T, bQ as b, bO as w, bA as S } from "./toggle-group-DC5hqQ4H.js";
|
|
3
|
+
import { A as C } from "./AppActions-CwPaiNx1.js";
|
|
4
4
|
import { A } from "./AppTitle-uboDuil4.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import { useSearchParams as f } from "react-router-dom";
|
|
7
7
|
import { c as P } from "./tailwind.helper-B6yFEsav.js";
|
|
8
|
-
import { S as k, h as j, i as z, a as K, c as V } from "./select-
|
|
8
|
+
import { S as k, h as j, i as z, a as K, c as V } from "./select-BwcXfUqZ.js";
|
|
9
9
|
import { ConstructionIcon as p } from "lucide-react";
|
|
10
10
|
function L({ titleKey: s, descriptionKey: l, actions: c = [], className: t }) {
|
|
11
11
|
return /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
@@ -55,7 +55,7 @@ const E = ({ tabs: s, item: l }) => {
|
|
|
55
55
|
/* @__PURE__ */ a("div", { className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4", children: /* @__PURE__ */ a(S, { className: "h-full", children: /* @__PURE__ */ a("div", { className: "space-y-1", children: s.map((e, r) => /* @__PURE__ */ n(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
|
-
className: `px-2 py-2 rounded-
|
|
58
|
+
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : i === e.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
59
59
|
onClick: () => !e.disabled && d(e.value),
|
|
60
60
|
children: [
|
|
61
61
|
e.icon && /* @__PURE__ */ a(e.icon, { className: "size-4" }),
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-
|
|
3
|
-
import { A as Z, a as _ } from "./alert-
|
|
2
|
+
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-DC5hqQ4H.js";
|
|
3
|
+
import { A as Z, a as _ } from "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as v } from "./tooltip-
|
|
5
|
+
import { B as v } from "./tooltip-OY3E8Lo0.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-DOncI9p6.js";
|
|
8
8
|
import { AlertCircleIcon as L, X as S, Save as T, Pen as I } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import "clsx";
|
|
11
11
|
import "tailwind-merge";
|
|
12
|
-
import "./select-
|
|
12
|
+
import "./select-BwcXfUqZ.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
15
|
import { useState as w, useEffect as ee } from "react";
|
|
16
16
|
import { useTranslation as O } from "react-i18next";
|
|
17
|
-
import { G as le } from "./GenericForm-
|
|
18
|
-
import { E as ie } from "./ErrorAlert-
|
|
17
|
+
import { G as le } from "./GenericForm-DXclmweK.js";
|
|
18
|
+
import { E as ie } from "./ErrorAlert-SrIcU1mM.js";
|
|
19
19
|
function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, children: p }) {
|
|
20
20
|
const { t: i } = O(), { title: b, description: m, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
21
21
|
return /* @__PURE__ */ e(q, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(B, { className: `${g} max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
|
|
22
22
|
u === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(R, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
|
|
23
|
-
/* @__PURE__ */ r(W, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-6 rounded-t-
|
|
23
|
+
/* @__PURE__ */ r(W, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-6 rounded-t-surface shrink-0", children: [
|
|
24
24
|
/* @__PURE__ */ r(X, { className: "text-2xl font-bold flex items-center gap-2 text-white", children: [
|
|
25
|
-
f !== void 0 ? /* @__PURE__ */ e("div", { className: "p-2 bg-white/20 rounded-
|
|
25
|
+
f !== void 0 ? /* @__PURE__ */ e("div", { className: "p-2 bg-white/20 rounded-control", children: /* @__PURE__ */ e(f, { className: "size-4 text-white" }) }) : null,
|
|
26
26
|
i(b)
|
|
27
27
|
] }),
|
|
28
28
|
m !== void 0 && m !== "" ? /* @__PURE__ */ e($, { className: "text-indigo-100 text-base", children: i(m) }) : null
|
|
@@ -32,7 +32,7 @@ function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, child
|
|
|
32
32
|
/* @__PURE__ */ e(_, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
|
|
33
33
|
] }) }) : null,
|
|
34
34
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: p }),
|
|
35
|
-
n !== void 0 && n.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-b-
|
|
35
|
+
n !== void 0 && n.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-b-surface border-t border-gray-200 dark:border-gray-700 shrink-0 p-6 light:bg-gradient-to-r light:from-gray-50 light:to-gray-100 dark:bg-gray-950", children: /* @__PURE__ */ e("div", { className: "flex justify-end gap-3", children: n.map((a, y) => /* @__PURE__ */ r(v, { variant: a.variant ?? "default", onClick: a.onClick, disabled: a.disabled === !0 || u === !0, children: [
|
|
36
36
|
a.icon !== void 0 ? /* @__PURE__ */ e(a.icon, { className: "size-4" }) : null,
|
|
37
37
|
i(a.label)
|
|
38
38
|
] }, y)) }) }) : null
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import { u as le } from "./useDataTable-CxcA5S-s.js";
|
|
3
|
-
import { ay as B, aM as L, aA as V, aC as de, $ as O, az as ce } from "./toggle-group-
|
|
4
|
-
import "./alert-
|
|
3
|
+
import { ay as B, aM as L, aA as V, aC as de, $ as O, az as ce } from "./toggle-group-DC5hqQ4H.js";
|
|
4
|
+
import "./alert-B9F1N9Qk.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
|
-
import { B as
|
|
6
|
+
import { B as y } from "./tooltip-OY3E8Lo0.js";
|
|
7
7
|
import "@radix-ui/react-collapsible";
|
|
8
|
-
import "./sheet-
|
|
9
|
-
import { MoreVerticalIcon as oe, Loader2Icon as he, AlertTriangleIcon as me, GripVerticalIcon as ge, ArrowUpIcon as ue, ArrowDownIcon as fe, ArrowUpDownIcon as pe, ChevronLeftIcon as xe, ChevronRightIcon as
|
|
8
|
+
import "./sheet-DOncI9p6.js";
|
|
9
|
+
import { MoreVerticalIcon as oe, Loader2Icon as he, AlertTriangleIcon as me, GripVerticalIcon as ge, ArrowUpIcon as ue, ArrowDownIcon as fe, ArrowUpDownIcon as pe, ChevronLeftIcon as xe, ChevronRightIcon as ve, SettingsIcon as ye } from "lucide-react";
|
|
10
10
|
import "react-resizable-panels";
|
|
11
11
|
import "clsx";
|
|
12
12
|
import "tailwind-merge";
|
|
13
|
-
import { S as be, h as Ne, i as ke, a as Se, c as we } from "./select-
|
|
13
|
+
import { S as be, h as Ne, i as ke, a as Se, c as we } from "./select-BwcXfUqZ.js";
|
|
14
14
|
import "next-themes";
|
|
15
15
|
import "sonner";
|
|
16
16
|
import "react";
|
|
@@ -25,7 +25,7 @@ function ze({ actions: n, row: t }) {
|
|
|
25
25
|
var o;
|
|
26
26
|
const m = r.icon;
|
|
27
27
|
return /* @__PURE__ */ i(
|
|
28
|
-
|
|
28
|
+
y,
|
|
29
29
|
{
|
|
30
30
|
variant: r.variant ?? "ghost",
|
|
31
31
|
size: "sm",
|
|
@@ -43,7 +43,7 @@ function ze({ actions: n, row: t }) {
|
|
|
43
43
|
);
|
|
44
44
|
}),
|
|
45
45
|
g.length > 0 && /* @__PURE__ */ i(B, { children: [
|
|
46
|
-
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
|
|
46
|
+
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { variant: "ghost", size: "icon", className: "h-7 w-7 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(oe, { className: "size-3.5" }) }) }),
|
|
47
47
|
/* @__PURE__ */ e(
|
|
48
48
|
V,
|
|
49
49
|
{
|
|
@@ -87,7 +87,7 @@ function De({
|
|
|
87
87
|
selectedRows: o,
|
|
88
88
|
toggleRowSelection: x,
|
|
89
89
|
visibleColumnsArray: l,
|
|
90
|
-
columnWidths:
|
|
90
|
+
columnWidths: v,
|
|
91
91
|
hasActions: C,
|
|
92
92
|
actions: b,
|
|
93
93
|
columns: z,
|
|
@@ -140,7 +140,7 @@ function De({
|
|
|
140
140
|
"td",
|
|
141
141
|
{
|
|
142
142
|
className: `px-2 py-2 relative ${k && !N ? "border-r border-gray-100 dark:border-gray-800" : ""} ${h.className ?? ""}`,
|
|
143
|
-
style: S ? { width:
|
|
143
|
+
style: S ? { width: v[h.key] } : { minWidth: v[h.key] },
|
|
144
144
|
children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: D(u, h.key) })
|
|
145
145
|
},
|
|
146
146
|
h.key
|
|
@@ -164,7 +164,7 @@ function De({
|
|
|
164
164
|
}) });
|
|
165
165
|
}
|
|
166
166
|
function Ie({ selectedRows: n, setSelectedRows: t, bulkActions: a }) {
|
|
167
|
-
return /* @__PURE__ */ i("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-
|
|
167
|
+
return /* @__PURE__ */ i("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-surface", children: [
|
|
168
168
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
169
169
|
/* @__PURE__ */ i("span", { className: "text-sm font-medium text-primary ml-1", children: [
|
|
170
170
|
n.length,
|
|
@@ -173,7 +173,7 @@ function Ie({ selectedRows: n, setSelectedRows: t, bulkActions: a }) {
|
|
|
173
173
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: a.map((d, g) => {
|
|
174
174
|
const r = d.icon;
|
|
175
175
|
return /* @__PURE__ */ i(
|
|
176
|
-
|
|
176
|
+
y,
|
|
177
177
|
{
|
|
178
178
|
variant: "outline",
|
|
179
179
|
size: "sm",
|
|
@@ -193,7 +193,7 @@ function Ie({ selectedRows: n, setSelectedRows: t, bulkActions: a }) {
|
|
|
193
193
|
}) })
|
|
194
194
|
] }),
|
|
195
195
|
/* @__PURE__ */ e(
|
|
196
|
-
|
|
196
|
+
y,
|
|
197
197
|
{
|
|
198
198
|
variant: "ghost",
|
|
199
199
|
size: "sm",
|
|
@@ -218,7 +218,7 @@ function je({
|
|
|
218
218
|
sortColumn: o,
|
|
219
219
|
sortDirection: x,
|
|
220
220
|
handleSort: l,
|
|
221
|
-
handleDragStart:
|
|
221
|
+
handleDragStart: v,
|
|
222
222
|
handleDragOver: C,
|
|
223
223
|
handleDrop: b,
|
|
224
224
|
handleMouseDown: z,
|
|
@@ -245,7 +245,7 @@ function je({
|
|
|
245
245
|
l(s.key);
|
|
246
246
|
},
|
|
247
247
|
onDragStart: (f) => {
|
|
248
|
-
I ?
|
|
248
|
+
I ? v(f, s.key) : f.preventDefault();
|
|
249
249
|
},
|
|
250
250
|
onDragOver: (f) => {
|
|
251
251
|
C(f, s.key);
|
|
@@ -317,11 +317,11 @@ function Me({
|
|
|
317
317
|
] }),
|
|
318
318
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-center gap-1", children: o > 1 && /* @__PURE__ */ i(ne, { children: [
|
|
319
319
|
/* @__PURE__ */ e(
|
|
320
|
-
|
|
320
|
+
y,
|
|
321
321
|
{
|
|
322
322
|
variant: "ghost",
|
|
323
323
|
size: "icon",
|
|
324
|
-
className: "h-8 w-8 rounded-
|
|
324
|
+
className: "h-8 w-8 rounded-control",
|
|
325
325
|
onClick: () => {
|
|
326
326
|
c((l) => Math.max(1, l - 1));
|
|
327
327
|
},
|
|
@@ -331,12 +331,12 @@ function Me({
|
|
|
331
331
|
}
|
|
332
332
|
),
|
|
333
333
|
x.map(
|
|
334
|
-
(l,
|
|
335
|
-
|
|
334
|
+
(l, v) => l === w ? /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center text-sm text-muted-foreground", children: w }, `dots-${String(v)}`) : /* @__PURE__ */ e(
|
|
335
|
+
y,
|
|
336
336
|
{
|
|
337
337
|
variant: l === r ? "default" : "ghost",
|
|
338
338
|
size: "icon",
|
|
339
|
-
className: "h-8 w-8 rounded-
|
|
339
|
+
className: "h-8 w-8 rounded-control text-sm",
|
|
340
340
|
onClick: () => {
|
|
341
341
|
c(l);
|
|
342
342
|
},
|
|
@@ -347,17 +347,17 @@ function Me({
|
|
|
347
347
|
)
|
|
348
348
|
),
|
|
349
349
|
/* @__PURE__ */ e(
|
|
350
|
-
|
|
350
|
+
y,
|
|
351
351
|
{
|
|
352
352
|
variant: "ghost",
|
|
353
353
|
size: "icon",
|
|
354
|
-
className: "h-8 w-8 rounded-
|
|
354
|
+
className: "h-8 w-8 rounded-control",
|
|
355
355
|
onClick: () => {
|
|
356
356
|
c((l) => Math.min(o, l + 1));
|
|
357
357
|
},
|
|
358
358
|
disabled: r === o,
|
|
359
359
|
"aria-label": "Page suivante",
|
|
360
|
-
children: /* @__PURE__ */ e(
|
|
360
|
+
children: /* @__PURE__ */ e(ve, { className: "size-4" })
|
|
361
361
|
}
|
|
362
362
|
)
|
|
363
363
|
] }) }),
|
|
@@ -381,7 +381,7 @@ function Me({
|
|
|
381
381
|
}
|
|
382
382
|
function Te({ columns: n, visibleColumns: t, toggleColumnVisibility: a }) {
|
|
383
383
|
return /* @__PURE__ */ i(B, { children: [
|
|
384
|
-
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(
|
|
384
|
+
/* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { variant: "outline", size: "sm", className: "size-7 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e(ye, { className: "size-3.5 text-gray-600 dark:text-gray-300" }) }) }),
|
|
385
385
|
/* @__PURE__ */ e(V, { align: "end", className: "w-56", children: n.map((d) => /* @__PURE__ */ e(
|
|
386
386
|
ce,
|
|
387
387
|
{
|
|
@@ -407,7 +407,7 @@ function Qe({
|
|
|
407
407
|
columnVisibility: o = !1,
|
|
408
408
|
isLoading: x = !1,
|
|
409
409
|
error: l = null,
|
|
410
|
-
bordered:
|
|
410
|
+
bordered: v = !1,
|
|
411
411
|
noDataMessage: C = "Aucun résultat",
|
|
412
412
|
defaultPageSize: b = Ce,
|
|
413
413
|
pageSizeOptions: z = H,
|
|
@@ -465,72 +465,78 @@ function Qe({
|
|
|
465
465
|
sortDirection: s,
|
|
466
466
|
onSortChange: N
|
|
467
467
|
});
|
|
468
|
-
return
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
468
|
+
return (
|
|
469
|
+
// Le tableau suit le preset de l'application — square reste square — mais
|
|
470
|
+
// bascule sur les valeurs plafonnées : ni ses contrôles ni son cadre ne
|
|
471
|
+
// prennent la forme capsule. Le scope couvre le cadre, les actions
|
|
472
|
+
// groupées et la pagination. Les fallbacks correspondent au preset "soft".
|
|
473
|
+
/* @__PURE__ */ i("div", { className: "space-y-4 [--radius-control:var(--radius-control-dense,0.5rem)] [--radius-surface:var(--radius-surface-dense,0.75rem)]", children: [
|
|
474
|
+
f.length > 0 && r !== void 0 && r.length > 0 && /* @__PURE__ */ e(Ie, { selectedRows: f, setSelectedRows: U, bulkActions: r }),
|
|
475
|
+
/* @__PURE__ */ i("div", { className: "w-full bg-card dark:bg-gray-950 rounded-surface border border-gray-200 dark:border-gray-800 overflow-hidden", children: [
|
|
476
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ i("table", { ref: E, className: "w-full", children: [
|
|
477
|
+
/* @__PURE__ */ e(
|
|
478
|
+
je,
|
|
479
|
+
{
|
|
480
|
+
hasBulkActions: $,
|
|
481
|
+
selectedRows: f,
|
|
482
|
+
totalItems: n.length,
|
|
483
|
+
toggleSelectAll: te,
|
|
484
|
+
visibleColumnsArray: W,
|
|
485
|
+
draggableColumns: c,
|
|
486
|
+
resizableColumns: m,
|
|
487
|
+
columnWidths: M,
|
|
488
|
+
sortColumn: I,
|
|
489
|
+
sortDirection: A,
|
|
490
|
+
handleSort: Q,
|
|
491
|
+
handleDragStart: Y,
|
|
492
|
+
handleDragOver: Z,
|
|
493
|
+
handleDrop: K,
|
|
494
|
+
handleMouseDown: X,
|
|
495
|
+
hasActions: T,
|
|
496
|
+
bordered: v,
|
|
497
|
+
settingsNode: o ? /* @__PURE__ */ e(Te, { columns: t, visibleColumns: F, toggleColumnVisibility: ee }) : void 0
|
|
498
|
+
}
|
|
499
|
+
),
|
|
500
|
+
/* @__PURE__ */ e(
|
|
501
|
+
De,
|
|
502
|
+
{
|
|
503
|
+
bordered: v,
|
|
504
|
+
isLoading: x,
|
|
505
|
+
error: l,
|
|
506
|
+
colSpanCount: J,
|
|
507
|
+
noDataMessage: C,
|
|
508
|
+
paginatedData: P,
|
|
509
|
+
getRowId: a,
|
|
510
|
+
onRowClick: d,
|
|
511
|
+
hasBulkActions: $,
|
|
512
|
+
selectedRows: f,
|
|
513
|
+
toggleRowSelection: re,
|
|
514
|
+
visibleColumnsArray: W,
|
|
515
|
+
columnWidths: M,
|
|
516
|
+
hasActions: T || o,
|
|
517
|
+
actions: g,
|
|
518
|
+
columns: t,
|
|
519
|
+
resizableColumns: m
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
] }) }),
|
|
495
523
|
/* @__PURE__ */ e(
|
|
496
|
-
|
|
524
|
+
Me,
|
|
497
525
|
{
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
selectedRows: f,
|
|
508
|
-
toggleRowSelection: re,
|
|
509
|
-
visibleColumnsArray: W,
|
|
510
|
-
columnWidths: M,
|
|
511
|
-
hasActions: T || o,
|
|
512
|
-
actions: g,
|
|
513
|
-
columns: t,
|
|
514
|
-
resizableColumns: m
|
|
526
|
+
totalItems: k ?? n.length,
|
|
527
|
+
startIndex: _,
|
|
528
|
+
endIndex: q,
|
|
529
|
+
pageSize: ae,
|
|
530
|
+
setPageSize: se,
|
|
531
|
+
currentPage: G,
|
|
532
|
+
setCurrentPage: ie,
|
|
533
|
+
pageSizeOptions: z,
|
|
534
|
+
totalPages: R
|
|
515
535
|
}
|
|
516
536
|
)
|
|
517
|
-
] })
|
|
518
|
-
/* @__PURE__ */ e(
|
|
519
|
-
Me,
|
|
520
|
-
{
|
|
521
|
-
totalItems: k ?? n.length,
|
|
522
|
-
startIndex: _,
|
|
523
|
-
endIndex: q,
|
|
524
|
-
pageSize: ae,
|
|
525
|
-
setPageSize: se,
|
|
526
|
-
currentPage: G,
|
|
527
|
-
setCurrentPage: ie,
|
|
528
|
-
pageSizeOptions: z,
|
|
529
|
-
totalPages: R
|
|
530
|
-
}
|
|
531
|
-
)
|
|
537
|
+
] })
|
|
532
538
|
] })
|
|
533
|
-
|
|
539
|
+
);
|
|
534
540
|
}
|
|
535
541
|
export {
|
|
536
542
|
Qe as D,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { A as n, a as t } from "./alert-
|
|
2
|
+
import { A as n, a as t } from "./alert-B9F1N9Qk.js";
|
|
3
3
|
import { AlertTriangle as a } from "lucide-react";
|
|
4
4
|
const o = ({ error: e }) => e ? /* @__PURE__ */ r(n, { variant: "destructive", children: [
|
|
5
5
|
/* @__PURE__ */ s(a, { className: "size-4" }),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
2
|
+
const d = ({ message: e }) => /* @__PURE__ */ t("div", { className: "p-6 border border-destructive bg-destructive/10 text-destructive rounded-surface animate-fade-in", children: [
|
|
3
3
|
/* @__PURE__ */ r("p", { className: "font-semibold mb-2", children: "Une erreur est survenue." }),
|
|
4
4
|
e !== void 0 && e !== "" ? /* @__PURE__ */ r("p", { className: "text-sm opacity-80", children: e }) : null
|
|
5
5
|
] });
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
d as E
|
|
8
8
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { I as J } from "./ImageInput-
|
|
3
|
-
import { A as V } from "./AppSubTitle-
|
|
4
|
-
import { M as Q } from "./MultiSelect-
|
|
5
|
-
import { aN as W, aQ as $, aR as q, aS as D, aO as A, aT as L, J as X, N as Y, K as F, bR as ee, $ as te } from "./toggle-group-
|
|
6
|
-
import "./alert-
|
|
2
|
+
import { I as J } from "./ImageInput-BqoCekqh.js";
|
|
3
|
+
import { A as V } from "./AppSubTitle-6JLlE8Vf.js";
|
|
4
|
+
import { M as Q } from "./MultiSelect-BFdaRnIO.js";
|
|
5
|
+
import { aN as W, aQ as $, aR as q, aS as D, aO as A, aT as L, J as X, N as Y, K as F, bR as ee, $ as te } from "./toggle-group-DC5hqQ4H.js";
|
|
6
|
+
import "./alert-B9F1N9Qk.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
|
-
import { B as M } from "./tooltip-
|
|
8
|
+
import { B as M } from "./tooltip-OY3E8Lo0.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
-
import { I as k } from "./sheet-
|
|
10
|
+
import { I as k } from "./sheet-DOncI9p6.js";
|
|
11
11
|
import "lucide-react";
|
|
12
12
|
import "react-resizable-panels";
|
|
13
13
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
14
|
-
import { S as ae, h as re, i as se, a as ne, c as le } from "./select-
|
|
14
|
+
import { S as ae, h as re, i as se, a as ne, c as le } from "./select-BwcXfUqZ.js";
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|
|
17
17
|
import { u as ce } from "./useToast-BFTk4lWz.js";
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
3
|
-
import "./alert-
|
|
2
|
+
import "./toggle-group-DC5hqQ4H.js";
|
|
3
|
+
import "./alert-B9F1N9Qk.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
|
-
import { B as x } from "./tooltip-
|
|
5
|
+
import { B as x } from "./tooltip-OY3E8Lo0.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
-
import "./sheet-
|
|
7
|
+
import "./sheet-DOncI9p6.js";
|
|
8
8
|
import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
|
|
9
9
|
import "react-resizable-panels";
|
|
10
10
|
import { c as u } from "./tailwind.helper-B6yFEsav.js";
|
|
11
|
-
import "./select-
|
|
11
|
+
import "./select-BwcXfUqZ.js";
|
|
12
12
|
import "next-themes";
|
|
13
13
|
import "sonner";
|
|
14
14
|
import { forwardRef as I, useRef as y } from "react";
|
|
15
15
|
import { u as j } from "./useNotifications-zbUhCvF_.js";
|
|
16
16
|
const R = I(
|
|
17
|
-
({ value: i, onChange:
|
|
18
|
-
const { showError: m } = j(), r = y(null), h = (
|
|
17
|
+
({ value: i, onChange: n, accept: a = "image/jpeg,image/png,image/webp", maxSizeMB: s = 2, disabled: c = !1, className: p = "", hint: l = "JPG, PNG, WEBP" }, f) => {
|
|
18
|
+
const { showError: m } = j(), r = y(null), h = (b) => {
|
|
19
19
|
var d;
|
|
20
|
-
const t = (d =
|
|
20
|
+
const t = (d = b.target.files) == null ? void 0 : d[0];
|
|
21
21
|
if (!t) return;
|
|
22
|
-
if (!
|
|
23
|
-
m("Erreur", `Seuls les fichiers ${
|
|
22
|
+
if (!a.split(",").map((g) => g.trim()).includes(t.type)) {
|
|
23
|
+
m("Erreur", `Seuls les fichiers ${l} sont acceptés`), r.current && (r.current.value = "");
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
if (t.size > s * 1024 * 1024) {
|
|
27
27
|
m("Erreur", `Le fichier ne doit pas dépasser ${s}MB`), r.current && (r.current.value = "");
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
n(t), r.current && (r.current.value = "");
|
|
31
31
|
};
|
|
32
|
-
return /* @__PURE__ */ e("div", { ref: f, className: p, children: i ? /* @__PURE__ */ o("div", { className: "relative w-32 h-32 rounded-
|
|
32
|
+
return /* @__PURE__ */ e("div", { ref: f, className: p, children: i ? /* @__PURE__ */ o("div", { className: "relative w-32 h-32 rounded-surface overflow-hidden border-2 border-border", children: [
|
|
33
33
|
/* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-full object-cover" }),
|
|
34
|
-
!
|
|
35
|
-
|
|
34
|
+
!c && /* @__PURE__ */ e(x, { type: "button", variant: "destructive", size: "sm", className: "absolute top-1 right-1 h-6 w-6 p-0", onClick: () => {
|
|
35
|
+
n(null);
|
|
36
36
|
}, children: /* @__PURE__ */ e(N, { className: "h-4 w-4" }) })
|
|
37
|
-
] }) :
|
|
37
|
+
] }) : c ? /* @__PURE__ */ o("div", { className: u("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed border-border rounded-surface", "bg-muted/30"), children: [
|
|
38
38
|
/* @__PURE__ */ e(v, { className: "h-8 w-8 text-muted-foreground/50 mb-2" }),
|
|
39
39
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground/50", children: "Aucune image" })
|
|
40
40
|
] }) : /* @__PURE__ */ o(
|
|
@@ -42,19 +42,19 @@ const R = I(
|
|
|
42
42
|
{
|
|
43
43
|
className: u(
|
|
44
44
|
"flex flex-col items-center justify-center w-full h-32",
|
|
45
|
-
"border-2 border-dashed border-border rounded-
|
|
45
|
+
"border-2 border-dashed border-border rounded-surface",
|
|
46
46
|
"cursor-pointer hover:bg-muted/50 transition-colors"
|
|
47
47
|
),
|
|
48
48
|
children: [
|
|
49
49
|
/* @__PURE__ */ e(w, { className: "h-8 w-8 text-muted-foreground mb-2" }),
|
|
50
50
|
/* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Cliquer pour uploader" }),
|
|
51
51
|
/* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
52
|
-
|
|
52
|
+
l,
|
|
53
53
|
" (max ",
|
|
54
54
|
s,
|
|
55
55
|
"MB)"
|
|
56
56
|
] }),
|
|
57
|
-
/* @__PURE__ */ e("input", { ref: r, type: "file", className: "hidden", accept:
|
|
57
|
+
/* @__PURE__ */ e("input", { ref: r, type: "file", className: "hidden", accept: a, onChange: h })
|
|
58
58
|
]
|
|
59
59
|
}
|
|
60
60
|
) });
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import "./toggle-group-DC5hqQ4H.js";
|
|
3
|
+
import "./alert-B9F1N9Qk.js";
|
|
4
|
+
import "@radix-ui/react-aspect-ratio";
|
|
5
|
+
import { B as c } from "./tooltip-OY3E8Lo0.js";
|
|
6
|
+
import "@radix-ui/react-collapsible";
|
|
7
|
+
import "./sheet-DOncI9p6.js";
|
|
8
|
+
import { ArrowLeftIcon as l } from "lucide-react";
|
|
9
|
+
import "react-resizable-panels";
|
|
10
|
+
import "clsx";
|
|
11
|
+
import "tailwind-merge";
|
|
12
|
+
import "./select-BwcXfUqZ.js";
|
|
13
|
+
import "next-themes";
|
|
14
|
+
import "sonner";
|
|
15
|
+
import "react";
|
|
16
|
+
import { A as f } from "./AppActions-CwPaiNx1.js";
|
|
17
|
+
import { A as u } from "./AppTitle-uboDuil4.js";
|
|
18
|
+
import { u as d } from "./useDocumentTitle-WNwdPz-I.js";
|
|
19
|
+
import { useTranslation as x } from "react-i18next";
|
|
20
|
+
import "@krosoft/core/helpers";
|
|
21
|
+
import { b as g, a as h } from "./SkeletonCards-DemfjUfD.js";
|
|
22
|
+
import { E as A } from "./ErrorState-CmaxuJyW.js";
|
|
23
|
+
function M({
|
|
24
|
+
icon: t,
|
|
25
|
+
titleKey: e,
|
|
26
|
+
descriptionKey: i,
|
|
27
|
+
actions: a,
|
|
28
|
+
onBack: s,
|
|
29
|
+
renderPreActions: m,
|
|
30
|
+
className: p
|
|
31
|
+
}) {
|
|
32
|
+
const { t: n } = x();
|
|
33
|
+
return d(n(e)), /* @__PURE__ */ o("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
|
|
34
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4", children: [
|
|
35
|
+
s && /* @__PURE__ */ r(c, { variant: "ghost", size: "icon", onClick: s, children: /* @__PURE__ */ r(l, { className: "h-4 w-4" }) }),
|
|
36
|
+
t && /* @__PURE__ */ r("div", { className: "size-12 bg-blue-100 rounded-control flex items-center justify-center", children: /* @__PURE__ */ r(t, { className: "h-6 w-6 text-blue-600" }) }),
|
|
37
|
+
/* @__PURE__ */ r(u, { titleKey: e, descriptionKey: i })
|
|
38
|
+
] }),
|
|
39
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-4", children: [
|
|
40
|
+
m && m(),
|
|
41
|
+
/* @__PURE__ */ r(f, { actions: a, className: p })
|
|
42
|
+
] })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
const O = ({ stats: t, isLoading: e, error: i }) => e ? /* @__PURE__ */ r(g, { count: 4 }) : i ? /* @__PURE__ */ r(A, { message: i.message }) : /* @__PURE__ */ r(h, { stats: t });
|
|
46
|
+
export {
|
|
47
|
+
M as A,
|
|
48
|
+
O as K
|
|
49
|
+
};
|