@krosoft/react 0.0.181 → 0.0.182
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/{ConfirmationDialog-9CKgZoNY.js → ConfirmationDialog-BPXA2g3g.js} +34 -34
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/tailwind/index.d.ts +10 -10
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +7 -3
- package/package.json +1 -1
|
@@ -12,30 +12,30 @@ import "tailwind-merge";
|
|
|
12
12
|
import "./select-BpjFWqAY.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
|
-
import { useState as
|
|
15
|
+
import { useState as y, useEffect as ee } from "react";
|
|
16
16
|
import { useTranslation as O } from "react-i18next";
|
|
17
17
|
import { G as le } from "./GenericForm-B39toMkE.js";
|
|
18
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
|
-
const { t: i } = O(), { title: b, description:
|
|
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: [
|
|
20
|
+
const { t: i } = O(), { title: b, description: d, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
21
|
+
return /* @__PURE__ */ e(q, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(B, { className: `${g} max-h-[100dvh] sm: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-surface shrink-0", children: [
|
|
24
|
-
/* @__PURE__ */ r(X, { className: "text-2xl font-bold flex items-center gap-2 text-white", children: [
|
|
23
|
+
/* @__PURE__ */ r(W, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-4 sm:p-6 sm:rounded-t-surface shrink-0", children: [
|
|
24
|
+
/* @__PURE__ */ r(X, { className: "text-xl sm:text-2xl font-bold flex items-center gap-2 text-white", children: [
|
|
25
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
|
+
d !== void 0 && d !== "" ? /* @__PURE__ */ e($, { className: "text-indigo-100 text-base", children: i(d) }) : null
|
|
29
29
|
] }),
|
|
30
30
|
s != null ? /* @__PURE__ */ e("div", { className: "px-6 ", children: /* @__PURE__ */ r(Z, { variant: "destructive", className: "max-w-full", children: [
|
|
31
31
|
/* @__PURE__ */ e(L, { className: "size-4" }),
|
|
32
32
|
/* @__PURE__ */ e(_, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
|
|
33
33
|
] }) }) : null,
|
|
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-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,
|
|
34
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 sm:px-6 py-4", children: p }),
|
|
35
|
+
n !== void 0 && n.length > 0 ? /* @__PURE__ */ e("div", { className: "sm:rounded-b-surface border-t border-gray-200 dark:border-gray-700 shrink-0 p-4 sm: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, k) => /* @__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
|
+
] }, k)) }) }) : null
|
|
39
39
|
] }) });
|
|
40
40
|
}
|
|
41
41
|
function De({
|
|
@@ -47,29 +47,29 @@ function De({
|
|
|
47
47
|
schema: p,
|
|
48
48
|
onSave: i,
|
|
49
49
|
customFooter: b,
|
|
50
|
-
defaultEditing:
|
|
50
|
+
defaultEditing: d = !1,
|
|
51
51
|
footerActions: f = !0,
|
|
52
52
|
saveLabel: g = "Sauvegarder",
|
|
53
53
|
cancelLabel: n = "Annuler",
|
|
54
54
|
hideSaveIcon: a = !1,
|
|
55
|
-
maxWidth:
|
|
55
|
+
maxWidth: k = "sm:max-w-4xl",
|
|
56
56
|
isLoading: h = !1
|
|
57
57
|
}) {
|
|
58
|
-
const [
|
|
58
|
+
const [x, N] = y(d), [o, A] = y(!1), [C, P] = y(null);
|
|
59
59
|
if (ee(() => {
|
|
60
|
-
t &&
|
|
61
|
-
}, [t,
|
|
60
|
+
t && N(d);
|
|
61
|
+
}, [t, d]), l == null) return null;
|
|
62
62
|
const z = () => {
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
63
|
+
x ? i !== void 0 && C && C() : N(!0);
|
|
64
|
+
}, w = () => {
|
|
65
|
+
N(!1);
|
|
66
66
|
}, E = () => {
|
|
67
67
|
i !== void 0 && C && C();
|
|
68
|
-
}, G = async (
|
|
68
|
+
}, G = async (m) => {
|
|
69
69
|
if (i) {
|
|
70
70
|
A(!0);
|
|
71
71
|
try {
|
|
72
|
-
await i(
|
|
72
|
+
await i(m), N(!1);
|
|
73
73
|
} catch (K) {
|
|
74
74
|
console.error(K);
|
|
75
75
|
} finally {
|
|
@@ -77,9 +77,9 @@ function De({
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}, D = [];
|
|
80
|
-
i !== void 0 && (
|
|
80
|
+
i !== void 0 && (x ? (n !== "" && D.push({
|
|
81
81
|
label: n,
|
|
82
|
-
onClick:
|
|
82
|
+
onClick: w,
|
|
83
83
|
variant: "outline",
|
|
84
84
|
disabled: o || h,
|
|
85
85
|
icon: S
|
|
@@ -97,39 +97,39 @@ function De({
|
|
|
97
97
|
}));
|
|
98
98
|
const H = {
|
|
99
99
|
title: u(l),
|
|
100
|
-
maxWidth:
|
|
100
|
+
maxWidth: k,
|
|
101
101
|
actions: f ? D : []
|
|
102
102
|
};
|
|
103
103
|
return /* @__PURE__ */ e(
|
|
104
104
|
re,
|
|
105
105
|
{
|
|
106
106
|
open: t,
|
|
107
|
-
onOpenChange: (
|
|
108
|
-
c(
|
|
107
|
+
onOpenChange: (m) => {
|
|
108
|
+
c(m), m || w();
|
|
109
109
|
},
|
|
110
110
|
config: H,
|
|
111
111
|
isLoading: o || h,
|
|
112
|
-
children: /* @__PURE__ */ r("div", {
|
|
112
|
+
children: /* @__PURE__ */ r("div", { children: [
|
|
113
113
|
s !== void 0 ? /* @__PURE__ */ e("div", { className: "mb-4", children: s(l) }) : null,
|
|
114
114
|
/* @__PURE__ */ e(
|
|
115
115
|
le,
|
|
116
116
|
{
|
|
117
117
|
schema: p,
|
|
118
118
|
initialData: l,
|
|
119
|
-
disabled: !
|
|
120
|
-
onSubmit: (
|
|
121
|
-
G(
|
|
119
|
+
disabled: !x,
|
|
120
|
+
onSubmit: (m) => {
|
|
121
|
+
G(m);
|
|
122
122
|
},
|
|
123
123
|
renderActions: !1,
|
|
124
|
-
onRegisterSubmit: (
|
|
125
|
-
P(() =>
|
|
124
|
+
onRegisterSubmit: (m) => {
|
|
125
|
+
P(() => m);
|
|
126
126
|
},
|
|
127
127
|
isLoading: o || h
|
|
128
128
|
}
|
|
129
129
|
),
|
|
130
130
|
b !== void 0 ? b(l) : null,
|
|
131
|
-
i !== void 0 && !f ? /* @__PURE__ */ e("div", { className: "flex justify-end gap-2 border-t pt-4 mt-6", children:
|
|
132
|
-
n !== "" ? /* @__PURE__ */ r(v, { onClick:
|
|
131
|
+
i !== void 0 && !f ? /* @__PURE__ */ e("div", { className: "flex justify-end gap-2 border-t pt-4 mt-6", children: x ? /* @__PURE__ */ r(M, { children: [
|
|
132
|
+
n !== "" ? /* @__PURE__ */ r(v, { onClick: w, variant: "outline", size: "sm", disabled: o || h, children: [
|
|
133
133
|
/* @__PURE__ */ e(S, { className: "size-4 mr-2" }),
|
|
134
134
|
n
|
|
135
135
|
] }) : null,
|
|
@@ -145,7 +145,7 @@ function De({
|
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ke({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
|
|
149
149
|
const { t: s } = O();
|
|
150
150
|
if (!l) return null;
|
|
151
151
|
const p = (i) => {
|
|
@@ -180,6 +180,6 @@ function ye({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
|
|
|
180
180
|
}
|
|
181
181
|
export {
|
|
182
182
|
re as A,
|
|
183
|
-
|
|
183
|
+
ke as C,
|
|
184
184
|
De as F
|
|
185
185
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-
|
|
1
|
+
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-BPXA2g3g.js";
|
|
2
2
|
import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-D6c-gM1D.js";
|
|
3
3
|
export {
|
|
4
4
|
i as AppDialog,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as r, M as o } from "../../MetricCard-CvQFjIOb.js";
|
|
2
2
|
import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-BvJYF_LK.js";
|
|
3
|
-
import { A as m, C as d, F as g } from "../../ConfirmationDialog-
|
|
3
|
+
import { A as m, C as d, F as g } from "../../ConfirmationDialog-BPXA2g3g.js";
|
|
4
4
|
import { D as A, a as D, b as T, c as n, d as c, e as x, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-D6c-gM1D.js";
|
|
5
5
|
import { A as k, a as H, F as I, S as K, T as v } from "../../TableFilter-CWDy_RHA.js";
|
|
6
6
|
import { G as M } from "../../GenericForm-B39toMkE.js";
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as o, M as r } from "../MetricCard-CvQFjIOb.js";
|
|
2
2
|
import { K as t, a as n, S as i, b as l } from "../SkeletonCards-BvJYF_LK.js";
|
|
3
|
-
import { A as p, C as u, F as g } from "../ConfirmationDialog-
|
|
3
|
+
import { A as p, C as u, F as g } from "../ConfirmationDialog-BPXA2g3g.js";
|
|
4
4
|
import { A as C, j as m, k as T, l as S, m as c, n as D, o as M, p as x, q as A, r as I, s as P, t as h, u as f, v as w, w as v, x as F, B as L, y as B, z as G, C as H, E as R, F as k, G as N, H as y, I as E, J as O, K as V, L as K, M as z, N as U, O as j, Q as q, R as J, S as Q, T as W, U as X, V as Y, W as Z, X as _, Y as $, Z as aa, _ as ea, $ as oa, a0 as ra, a1 as sa, a2 as ta, a3 as na, a4 as ia, a5 as la, a6 as ba, a7 as pa, a8 as ua, a9 as ga, aa as da, ab as Ca, ac as ma, ad as Ta, ae as Sa, af as ca, ag as Da, ah as Ma, ai as xa, aj as Aa, ak as Ia, al as Pa, am as ha, an as fa, D as wa, a as va, b as Fa, c as La, d as Ba, e as Ga, f as Ha, g as Ra, h as ka, i as Na, ao as ya, ap as Ea, aq as Oa, ar as Va, as as Ka, at as za, au as Ua, av as ja, aw as qa, ax as Ja, ay as Qa, az as Wa, aA as Xa, aB as Ya, aC as Za, aD as _a, aE as $a, aF as ae, aG as ee, aH as oe, aI as re, aJ as se, aK as te, aL as ne, aM as ie, aN as le, aO as be, aP as pe, aQ as ue, aR as ge, aS as de, aT as Ce, aU as me, aV as Te, aW as Se, aX as ce, aY as De, aZ as Me, a_ as xe, a$ as Ae, b0 as Ie, b1 as Pe, b2 as he, b3 as fe, b4 as we, b5 as ve, b6 as Fe, b7 as Le, b8 as Be, b9 as Ge, ba as He, bb as Re, bc as ke, bd as Ne, be as ye, bf as Ee, bg as Oe, bh as Ve, bi as Ke, bj as ze, bk as Ue, bl as je, bm as qe, bn as Je, bo as Qe, bp as We, bq as Xe, br as Ye, bs as Ze, bt as _e, bu as $e, bv as ao, bw as eo, bx as oo, P as ro, by as so, bz as to, bA as no, bB as io, bC as lo, bD as bo, bE as po, bF as uo, bG as go, bH as Co, bI as mo, bJ as To, bK as So, bL as co, bM as Do, bN as Mo, bO as xo, bP as Ao, bQ as Io, bR as Po, bS as ho, bT as fo, bU as wo, bV as vo, bW as Fo, bX as Lo, bY as Bo, bZ as Go, b_ as Ho, b$ as Ro, c0 as ko, c1 as No, c2 as yo, c3 as Eo } from "../toggle-group-D6c-gM1D.js";
|
|
5
5
|
import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-CWDy_RHA.js";
|
|
6
6
|
import { G as Jo } from "../GenericForm-B39toMkE.js";
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const krosoftContent: string[];
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Preset Tailwind CSS partagé par les projets @krosoft/react.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* -
|
|
22
|
-
* - tailwindcss-animate
|
|
16
|
+
* Regroupe les tokens de design shadcn/ui communs à tous les projets :
|
|
17
|
+
* - configuration du mode sombre ;
|
|
18
|
+
* - réglages du conteneur ;
|
|
19
|
+
* - mapping des couleurs de base (border, input, ring, background, foreground, primary…) ;
|
|
20
|
+
* - tokens de rayon de bordure ;
|
|
21
|
+
* - keyframes & animations de l'accordéon ;
|
|
22
|
+
* - plugin tailwindcss-animate.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* Utilisation dans le tailwind.config.ts d'un projet consommateur :
|
|
25
25
|
*
|
|
26
26
|
* ```ts
|
|
27
27
|
* import krosoftPreset, { krosoftContent } from "@krosoft/react/tailwind";
|
|
@@ -31,7 +31,7 @@ export declare const krosoftContent: string[];
|
|
|
31
31
|
* content: [...krosoftContent, "./src/**\/*.{ts,tsx}"],
|
|
32
32
|
* theme: {
|
|
33
33
|
* extend: {
|
|
34
|
-
* //
|
|
34
|
+
* // surcharges spécifiques au projet
|
|
35
35
|
* },
|
|
36
36
|
* },
|
|
37
37
|
* } satisfies Config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tailwind/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,UAAiD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tailwind/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,UAAiD,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+IQ,CAAC;AAE5B,eAAe,aAAa,CAAC"}
|
package/dist/tailwind/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import r from "tailwindcss-animate";
|
|
2
2
|
const a = ["./node_modules/@krosoft/react/dist/**/*.js"], e = {
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
|
|
3
|
+
// Les thèmes sombres sont des classes posées sur <html> ("dark", "dark-temporal", "dark-forest"…)
|
|
4
|
+
// et CSS n'a pas de syntaxe .dark*. [class*='dark'] la simulait, mais la sous-chaîne matche aussi
|
|
5
|
+
// le préfixe des utilitaires eux-mêmes (class="dark:bg-gray-900") : n'importe quel ancêtre portant
|
|
6
|
+
// une classe dark:* activait donc le mode sombre sur tout son sous-arbre, même en thème clair.
|
|
7
|
+
// Matcher "dark" comme classe entière, plus tout ce qui contient "dark-", couvre la famille .dark*
|
|
8
|
+
// sans ce faux positif.
|
|
9
|
+
darkMode: ["class", ':is([class~="dark"],[class*="dark-"])'],
|
|
6
10
|
theme: {
|
|
7
11
|
container: {
|
|
8
12
|
center: !0,
|