@krosoft/react 0.0.13 → 0.0.14
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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
const d = ({ message: e }) => /* @__PURE__ */ t("div", { className: "p-6 border border-destructive bg-destructive/10 text-destructive rounded-md animate-fade-in", children: [
|
|
3
|
+
/* @__PURE__ */ r("p", { className: "font-semibold mb-2", children: "Une erreur est survenue." }),
|
|
4
|
+
e ? /* @__PURE__ */ r("p", { className: "text-sm opacity-80", children: e }) : null
|
|
5
|
+
] });
|
|
6
|
+
export {
|
|
7
|
+
d as E
|
|
8
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { c as k, a as u } from "./index-DxGGCUCL.js";
|
|
4
|
+
const b = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, y = k, x = (t, r) => (e) => {
|
|
5
|
+
var i;
|
|
6
|
+
if ((r == null ? void 0 : r.variants) == null) return y(t, e == null ? void 0 : e.class, e == null ? void 0 : e.className);
|
|
7
|
+
const { variants: f, defaultVariants: o } = r, N = Object.keys(f).map((a) => {
|
|
8
|
+
const n = e == null ? void 0 : e[a], d = o == null ? void 0 : o[a];
|
|
9
|
+
if (n === null) return null;
|
|
10
|
+
const s = b(n) || b(d);
|
|
11
|
+
return f[a][s];
|
|
12
|
+
}), m = e && Object.entries(e).reduce((a, n) => {
|
|
13
|
+
let [d, s] = n;
|
|
14
|
+
return s === void 0 || (a[d] = s), a;
|
|
15
|
+
}, {}), V = r == null || (i = r.compoundVariants) === null || i === void 0 ? void 0 : i.reduce((a, n) => {
|
|
16
|
+
let { class: d, className: s, ...A } = n;
|
|
17
|
+
return Object.entries(A).every((h) => {
|
|
18
|
+
let [g, c] = h;
|
|
19
|
+
return Array.isArray(c) ? c.includes({
|
|
20
|
+
...o,
|
|
21
|
+
...m
|
|
22
|
+
}[g]) : {
|
|
23
|
+
...o,
|
|
24
|
+
...m
|
|
25
|
+
}[g] === c;
|
|
26
|
+
}) ? [
|
|
27
|
+
...a,
|
|
28
|
+
d,
|
|
29
|
+
s
|
|
30
|
+
] : a;
|
|
31
|
+
}, []);
|
|
32
|
+
return y(t, N, V, e == null ? void 0 : e.class, e == null ? void 0 : e.className);
|
|
33
|
+
}, C = x(
|
|
34
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
35
|
+
{
|
|
36
|
+
variants: {
|
|
37
|
+
variant: {
|
|
38
|
+
default: "bg-background text-foreground",
|
|
39
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
variant: "default"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
), j = v.forwardRef(
|
|
47
|
+
({ className: t, variant: r, ...e }, i) => /* @__PURE__ */ l("div", { ref: i, role: "alert", className: u(C({ variant: r }), t), ...e })
|
|
48
|
+
);
|
|
49
|
+
j.displayName = "Alert";
|
|
50
|
+
const w = v.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ l("h5", { ref: e, className: u("mb-1 font-medium leading-none tracking-tight", t), ...r }));
|
|
51
|
+
w.displayName = "AlertTitle";
|
|
52
|
+
const O = v.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ l("div", { ref: e, className: u("text-sm [&_p]:leading-relaxed", t), ...r }));
|
|
53
|
+
O.displayName = "AlertDescription";
|
|
54
|
+
const R = x(
|
|
55
|
+
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
56
|
+
{
|
|
57
|
+
variants: {
|
|
58
|
+
variant: {
|
|
59
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
60
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
61
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
62
|
+
outline: "text-foreground"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
variant: "default"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
function B({ className: t, variant: r, ...e }) {
|
|
71
|
+
return /* @__PURE__ */ l("div", { className: u(R({ variant: r }), t), ...e });
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
j as A,
|
|
75
|
+
B,
|
|
76
|
+
O as a,
|
|
77
|
+
w as b,
|
|
78
|
+
R as c
|
|
79
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { E as e } from "../ErrorState-CghWXpM0.js";
|
|
2
|
+
import { A as s, a as o, b as i, B as l, c as A } from "../badge-DUEyCWfa.js";
|
|
3
|
+
export {
|
|
4
|
+
s as Alert,
|
|
5
|
+
o as AlertDescription,
|
|
6
|
+
i as AlertTitle,
|
|
7
|
+
l as Badge,
|
|
8
|
+
e as ErrorState,
|
|
9
|
+
A as badgeVariants
|
|
10
|
+
};
|
|
@@ -1,79 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as v from "react";
|
|
3
|
-
import { c as k, a as u } from "../../index-DxGGCUCL.js";
|
|
4
|
-
const b = (t) => typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, y = k, x = (t, r) => (e) => {
|
|
5
|
-
var i;
|
|
6
|
-
if ((r == null ? void 0 : r.variants) == null) return y(t, e == null ? void 0 : e.class, e == null ? void 0 : e.className);
|
|
7
|
-
const { variants: f, defaultVariants: o } = r, N = Object.keys(f).map((a) => {
|
|
8
|
-
const n = e == null ? void 0 : e[a], d = o == null ? void 0 : o[a];
|
|
9
|
-
if (n === null) return null;
|
|
10
|
-
const s = b(n) || b(d);
|
|
11
|
-
return f[a][s];
|
|
12
|
-
}), m = e && Object.entries(e).reduce((a, n) => {
|
|
13
|
-
let [d, s] = n;
|
|
14
|
-
return s === void 0 || (a[d] = s), a;
|
|
15
|
-
}, {}), V = r == null || (i = r.compoundVariants) === null || i === void 0 ? void 0 : i.reduce((a, n) => {
|
|
16
|
-
let { class: d, className: s, ...A } = n;
|
|
17
|
-
return Object.entries(A).every((h) => {
|
|
18
|
-
let [g, c] = h;
|
|
19
|
-
return Array.isArray(c) ? c.includes({
|
|
20
|
-
...o,
|
|
21
|
-
...m
|
|
22
|
-
}[g]) : {
|
|
23
|
-
...o,
|
|
24
|
-
...m
|
|
25
|
-
}[g] === c;
|
|
26
|
-
}) ? [
|
|
27
|
-
...a,
|
|
28
|
-
d,
|
|
29
|
-
s
|
|
30
|
-
] : a;
|
|
31
|
-
}, []);
|
|
32
|
-
return y(t, N, V, e == null ? void 0 : e.class, e == null ? void 0 : e.className);
|
|
33
|
-
}, C = x(
|
|
34
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
35
|
-
{
|
|
36
|
-
variants: {
|
|
37
|
-
variant: {
|
|
38
|
-
default: "bg-background text-foreground",
|
|
39
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
variant: "default"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
), j = v.forwardRef(
|
|
47
|
-
({ className: t, variant: r, ...e }, i) => /* @__PURE__ */ l("div", { ref: i, role: "alert", className: u(C({ variant: r }), t), ...e })
|
|
48
|
-
);
|
|
49
|
-
j.displayName = "Alert";
|
|
50
|
-
const w = v.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ l("h5", { ref: e, className: u("mb-1 font-medium leading-none tracking-tight", t), ...r }));
|
|
51
|
-
w.displayName = "AlertTitle";
|
|
52
|
-
const O = v.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ l("div", { ref: e, className: u("text-sm [&_p]:leading-relaxed", t), ...r }));
|
|
53
|
-
O.displayName = "AlertDescription";
|
|
54
|
-
const R = x(
|
|
55
|
-
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
56
|
-
{
|
|
57
|
-
variants: {
|
|
58
|
-
variant: {
|
|
59
|
-
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
60
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
61
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
62
|
-
outline: "text-foreground"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
defaultVariants: {
|
|
66
|
-
variant: "default"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
function D({ className: t, variant: r, ...e }) {
|
|
71
|
-
return /* @__PURE__ */ l("div", { className: u(R({ variant: r }), t), ...e });
|
|
72
|
-
}
|
|
1
|
+
import { A as r, a as s, b as t, B as i, c as l } from "../../badge-DUEyCWfa.js";
|
|
73
2
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
3
|
+
r as Alert,
|
|
4
|
+
s as AlertDescription,
|
|
5
|
+
t as AlertTitle,
|
|
6
|
+
i as Badge,
|
|
7
|
+
l as badgeVariants
|
|
79
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krosoft/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Krosoft shared React package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -23,29 +23,9 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"exports": {
|
|
26
|
-
"
|
|
27
|
-
"import": "./dist
|
|
28
|
-
"types": "./dist
|
|
29
|
-
},
|
|
30
|
-
"./hooks": {
|
|
31
|
-
"import": "./dist/hooks/index.js",
|
|
32
|
-
"types": "./dist/hooks/index.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./components": {
|
|
35
|
-
"import": "./dist/components/index.js",
|
|
36
|
-
"types": "./dist/components/index.d.ts"
|
|
37
|
-
},
|
|
38
|
-
"./components/core": {
|
|
39
|
-
"import": "./dist/components/core/index.js",
|
|
40
|
-
"types": "./dist/components/core/index.d.ts"
|
|
41
|
-
},
|
|
42
|
-
"./components/core/states": {
|
|
43
|
-
"import": "./dist/components/core/states/index.js",
|
|
44
|
-
"types": "./dist/components/core/states/index.d.ts"
|
|
45
|
-
},
|
|
46
|
-
"./components/ui": {
|
|
47
|
-
"import": "./dist/components/ui/index.js",
|
|
48
|
-
"types": "./dist/components/ui/index.d.ts"
|
|
26
|
+
"./*": {
|
|
27
|
+
"import": "./dist/*/index.js",
|
|
28
|
+
"types": "./dist/*/index.d.ts"
|
|
49
29
|
}
|
|
50
30
|
},
|
|
51
31
|
"peerDependencies": {
|