@krosoft/react 0.0.14 → 0.0.15
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/LoadingState-DC6s7pmB.js +132 -0
- package/dist/components/core/index.js +3 -2
- package/dist/components/core/states/LoadingState.d.ts +6 -0
- package/dist/components/core/states/LoadingState.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 +3 -2
- package/dist/components/index.js +9 -8
- package/package.json +2 -1
- package/dist/ErrorState-CghWXpM0.js +0 -8
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as N, createContext as y, forwardRef as h, createElement as l } from "react";
|
|
3
|
+
const P = ({ message: e }) => /* @__PURE__ */ p("div", { className: "p-6 border border-destructive bg-destructive/10 text-destructive rounded-md animate-fade-in", children: [
|
|
4
|
+
/* @__PURE__ */ a("p", { className: "font-semibold mb-2", children: "Une erreur est survenue." }),
|
|
5
|
+
e ? /* @__PURE__ */ a("p", { className: "text-sm opacity-80", children: e }) : null
|
|
6
|
+
] });
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide-react v1.7.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
const x = (...e) => e.filter((t, r, o) => !!t && t.trim() !== "" && o.indexOf(t) === r).join(" ").trim();
|
|
14
|
+
/**
|
|
15
|
+
* @license lucide-react v1.7.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/
|
|
20
|
+
const A = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
21
|
+
/**
|
|
22
|
+
* @license lucide-react v1.7.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/
|
|
27
|
+
const S = (e) => e.replace(
|
|
28
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
29
|
+
(t, r, o) => o ? o.toUpperCase() : r.toLowerCase()
|
|
30
|
+
);
|
|
31
|
+
/**
|
|
32
|
+
* @license lucide-react v1.7.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const m = (e) => {
|
|
38
|
+
const t = S(e);
|
|
39
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @license lucide-react v1.7.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
var i = {
|
|
48
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
49
|
+
width: 24,
|
|
50
|
+
height: 24,
|
|
51
|
+
viewBox: "0 0 24 24",
|
|
52
|
+
fill: "none",
|
|
53
|
+
stroke: "currentColor",
|
|
54
|
+
strokeWidth: 2,
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round"
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* @license lucide-react v1.7.0 - ISC
|
|
60
|
+
*
|
|
61
|
+
* This source code is licensed under the ISC license.
|
|
62
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
63
|
+
*/
|
|
64
|
+
const W = (e) => {
|
|
65
|
+
for (const t in e)
|
|
66
|
+
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
67
|
+
return !0;
|
|
68
|
+
return !1;
|
|
69
|
+
}, j = y({}), $ = () => N(j), E = h(
|
|
70
|
+
({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: o, className: n = "", children: s, iconNode: f, ...d }, C) => {
|
|
71
|
+
const {
|
|
72
|
+
size: c = 24,
|
|
73
|
+
strokeWidth: u = 2,
|
|
74
|
+
absoluteStrokeWidth: w = !1,
|
|
75
|
+
color: b = "currentColor",
|
|
76
|
+
className: k = ""
|
|
77
|
+
} = $() ?? {}, g = o ?? w ? Number(r ?? u) * 24 / Number(t ?? c) : r ?? u;
|
|
78
|
+
return l(
|
|
79
|
+
"svg",
|
|
80
|
+
{
|
|
81
|
+
ref: C,
|
|
82
|
+
...i,
|
|
83
|
+
width: t ?? c ?? i.width,
|
|
84
|
+
height: t ?? c ?? i.height,
|
|
85
|
+
stroke: e ?? b,
|
|
86
|
+
strokeWidth: g,
|
|
87
|
+
className: x("lucide", k, n),
|
|
88
|
+
...!s && !W(d) && { "aria-hidden": "true" },
|
|
89
|
+
...d
|
|
90
|
+
},
|
|
91
|
+
[
|
|
92
|
+
...f.map(([v, L]) => l(v, L)),
|
|
93
|
+
...Array.isArray(s) ? s : [s]
|
|
94
|
+
]
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
/**
|
|
99
|
+
* @license lucide-react v1.7.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/
|
|
104
|
+
const U = (e, t) => {
|
|
105
|
+
const r = h(
|
|
106
|
+
({ className: o, ...n }, s) => l(E, {
|
|
107
|
+
ref: s,
|
|
108
|
+
iconNode: t,
|
|
109
|
+
className: x(
|
|
110
|
+
`lucide-${A(m(e))}`,
|
|
111
|
+
`lucide-${e}`,
|
|
112
|
+
o
|
|
113
|
+
),
|
|
114
|
+
...n
|
|
115
|
+
})
|
|
116
|
+
);
|
|
117
|
+
return r.displayName = m(e), r;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* @license lucide-react v1.7.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/
|
|
125
|
+
const _ = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], z = U("loader-circle", _), Z = ({ message: e }) => /* @__PURE__ */ p("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
|
|
126
|
+
/* @__PURE__ */ a(z, { className: "w-8 h-8 animate-spin mb-4 text-primary" }),
|
|
127
|
+
e ? /* @__PURE__ */ a("p", { className: "font-mono uppercase tracking-widest text-xs", children: e }) : null
|
|
128
|
+
] });
|
|
129
|
+
export {
|
|
130
|
+
P as E,
|
|
131
|
+
Z as L
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadingState.d.ts","sourceRoot":"","sources":["../../../../src/components/core/states/LoadingState.tsx"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,GAAI,aAAa,iBAAiB,KAAG,KAAK,CAAC,GAAG,CAAC,OAOvE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/states/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/states/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { E as e } from "../
|
|
2
|
-
import { A as
|
|
1
|
+
import { E as t, L as e } from "../LoadingState-DC6s7pmB.js";
|
|
2
|
+
import { A as o, a as i, b as l, B as A, c as d } from "../badge-DUEyCWfa.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
o as Alert,
|
|
5
|
+
i as AlertDescription,
|
|
6
|
+
l as AlertTitle,
|
|
7
|
+
A as Badge,
|
|
8
|
+
t as ErrorState,
|
|
9
|
+
e as LoadingState,
|
|
10
|
+
d as badgeVariants
|
|
10
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krosoft/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Krosoft shared React package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"class-variance-authority": "^0.7.1",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
|
+
"lucide-react": "^1.7.0",
|
|
37
38
|
"tailwind-merge": "^2.6.1"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
};
|