@krosoft/react 0.0.12 → 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,2 @@
1
+ export * from "./states";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { E as t } from "../../ErrorState-CghWXpM0.js";
2
+ export {
3
+ t as ErrorState
4
+ };
@@ -0,0 +1,6 @@
1
+ interface ErrorStateProps {
2
+ message?: string;
3
+ }
4
+ export declare const ErrorState: ({ message }: ErrorStateProps) => React.JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=ErrorState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorState.d.ts","sourceRoot":"","sources":["../../../../src/components/core/states/ErrorState.tsx"],"names":[],"mappings":"AAAA,UAAU,eAAe;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,GAAI,aAAa,eAAe,KAAG,KAAK,CAAC,GAAG,CAAC,OAOnE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ErrorState } from "./ErrorState";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ import { E as t } from "../../../ErrorState-CghWXpM0.js";
2
+ export {
3
+ t as ErrorState
4
+ };
@@ -1,2 +1,3 @@
1
+ export * from "./core";
1
2
  export * from "./ui";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC"}
@@ -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
+ };
@@ -0,0 +1,10 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "secondary" | "outline" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
10
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,aAAa;;8EAelB,CAAC;AAEF,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAE/G,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAE1D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -1,2 +1,4 @@
1
1
  export { Alert, AlertTitle, AlertDescription } from "./alert";
2
+ export { Badge, badgeVariants } from "./badge";
3
+ export type { BadgeProps } from "./badge";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,58 +1,8 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import * as v from "react";
3
- import { c as k, a as c } from "../../index-DxGGCUCL.js";
4
- const y = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, N = k, C = (e, a) => (t) => {
5
- var s;
6
- if ((a == null ? void 0 : a.variants) == null) return N(e, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
7
- const { variants: m, defaultVariants: i } = a, x = Object.keys(m).map((r) => {
8
- const l = t == null ? void 0 : t[r], d = i == null ? void 0 : i[r];
9
- if (l === null) return null;
10
- const n = y(l) || y(d);
11
- return m[r][n];
12
- }), f = t && Object.entries(t).reduce((r, l) => {
13
- let [d, n] = l;
14
- return n === void 0 || (r[d] = n), r;
15
- }, {}), b = a == null || (s = a.compoundVariants) === null || s === void 0 ? void 0 : s.reduce((r, l) => {
16
- let { class: d, className: n, ...V } = l;
17
- return Object.entries(V).every((A) => {
18
- let [g, o] = A;
19
- return Array.isArray(o) ? o.includes({
20
- ...i,
21
- ...f
22
- }[g]) : {
23
- ...i,
24
- ...f
25
- }[g] === o;
26
- }) ? [
27
- ...r,
28
- d,
29
- n
30
- ] : r;
31
- }, []);
32
- return N(e, x, b, t == null ? void 0 : t.class, t == null ? void 0 : t.className);
33
- }, j = C(
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
- ), w = v.forwardRef(
47
- ({ className: e, variant: a, ...t }, s) => /* @__PURE__ */ u("div", { ref: s, role: "alert", className: c(j({ variant: a }), e), ...t })
48
- );
49
- w.displayName = "Alert";
50
- const O = v.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ u("h5", { ref: t, className: c("mb-1 font-medium leading-none tracking-tight", e), ...a }));
51
- O.displayName = "AlertTitle";
52
- const R = v.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ u("div", { ref: t, className: c("text-sm [&_p]:leading-relaxed", e), ...a }));
53
- R.displayName = "AlertDescription";
1
+ import { A as r, a as s, b as t, B as i, c as l } from "../../badge-DUEyCWfa.js";
54
2
  export {
55
- w as Alert,
56
- R as AlertDescription,
57
- O as AlertTitle
3
+ r as Alert,
4
+ s as AlertDescription,
5
+ t as AlertTitle,
6
+ i as Badge,
7
+ l as badgeVariants
58
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -23,17 +23,9 @@
23
23
  "dist"
24
24
  ],
25
25
  "exports": {
26
- "./helpers": {
27
- "import": "./dist/helpers/index.js",
28
- "types": "./dist/helpers/index.d.ts"
29
- },
30
- "./hooks": {
31
- "import": "./dist/hooks/index.js",
32
- "types": "./dist/hooks/index.d.ts"
33
- },
34
- "./components/ui": {
35
- "import": "./dist/components/ui/index.js",
36
- "types": "./dist/components/ui/index.d.ts"
26
+ "./*": {
27
+ "import": "./dist/*/index.js",
28
+ "types": "./dist/*/index.d.ts"
37
29
  }
38
30
  },
39
31
  "peerDependencies": {
@@ -45,11 +37,10 @@
45
37
  "tailwind-merge": "^2.6.1"
46
38
  },
47
39
  "devDependencies": {
48
- "@krosoft/tooling-eslint-react": ">=0.0.2",
49
- "@krosoft/tooling-prettier": ">=0.0.6",
50
- "@krosoft/tooling-tsconfig-react": ">=0.0.5",
51
- "@storybook/addon-essentials": "^8.6.14",
52
- "@storybook/addon-themes": "^8.6.18",
40
+ "@krosoft/tooling-eslint-react": "^0.0.2",
41
+ "@krosoft/tooling-prettier": "^0.0.6",
42
+ "@krosoft/tooling-tsconfig-react": "^0.0.5",
43
+ "@storybook/addon-essentials": "^8.6.18",
53
44
  "@storybook/react": "^8.6.18",
54
45
  "@storybook/react-vite": "^8.6.18",
55
46
  "@tailwindcss/vite": "^4.2.2",