@krosoft/react 0.0.234 → 0.0.235
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/LanguageSelector-C7E51rCQ.js +47 -0
- package/dist/{ThemeSelector-DKhn02V2.js → ThemeSelector-CLi4_epH.js} +20 -19
- package/dist/components/core/index.js +2 -2
- package/dist/components/core/language/LanguageSelector.d.ts +3 -1
- package/dist/components/core/language/LanguageSelector.d.ts.map +1 -1
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts +3 -1
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +2 -2
- package/package.json +1 -1
- package/dist/LanguageSelector-D5Ly1SFC.js +0 -46
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import "date-fns/locale";
|
|
3
|
+
import "react-i18next";
|
|
4
|
+
import { u as h } from "./useKrosoftTranslation-BTp46G94.js";
|
|
5
|
+
import { b as g, T as f, c as v, B as p, a as b } from "./tooltip-DVeqVwqV.js";
|
|
6
|
+
import { S as T, h as N, i as x, a as S, c as C } from "./select-BpjFWqAY.js";
|
|
7
|
+
import { u as I } from "./useLanguage-C9jI2nwn.js";
|
|
8
|
+
import { LanguagesIcon as i } from "lucide-react";
|
|
9
|
+
function P({ languageOptions: o, variant: n = "select", id: t }) {
|
|
10
|
+
const { t: r } = h(), { currentLanguageOption: a, nextLanguageOption: c, changeLanguage: m, cycleLanguage: d } = I(o);
|
|
11
|
+
if (n === "mini") {
|
|
12
|
+
const l = (a == null ? void 0 : a.icon) ?? i;
|
|
13
|
+
return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ s(f, { children: [
|
|
14
|
+
/* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ s(
|
|
15
|
+
p,
|
|
16
|
+
{
|
|
17
|
+
id: t,
|
|
18
|
+
variant: "ghost",
|
|
19
|
+
size: "icon",
|
|
20
|
+
onClick: d,
|
|
21
|
+
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ e(l, { className: "size-4" }),
|
|
24
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: r("language.current", { language: (a == null ? void 0 : a.label) ?? "" }) })
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
) }),
|
|
28
|
+
/* @__PURE__ */ e(b, { side: "bottom", align: "center", children: r("language.switchTo", { language: (c == null ? void 0 : c.label) ?? "" }) })
|
|
29
|
+
] }) });
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
32
|
+
/* @__PURE__ */ s(T, { value: a == null ? void 0 : a.value, onValueChange: m, children: [
|
|
33
|
+
/* @__PURE__ */ e(N, { id: t, className: "w-full", children: /* @__PURE__ */ e(x, { placeholder: r("select.language") }) }),
|
|
34
|
+
/* @__PURE__ */ e(S, { children: o.map((l) => {
|
|
35
|
+
const u = l.icon ?? i;
|
|
36
|
+
return /* @__PURE__ */ e(C, { value: l.value, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
37
|
+
/* @__PURE__ */ e(u, { className: "size-4" }),
|
|
38
|
+
l.label
|
|
39
|
+
] }) }, l.value);
|
|
40
|
+
}) })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: r("language.description") })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
P as L
|
|
47
|
+
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import "date-fns/locale";
|
|
3
3
|
import "react-i18next";
|
|
4
|
-
import { u
|
|
5
|
-
import { b as
|
|
6
|
-
import { S as
|
|
7
|
-
import { u as
|
|
8
|
-
function
|
|
9
|
-
const { t:
|
|
10
|
-
if (
|
|
4
|
+
import { u } from "./useKrosoftTranslation-BTp46G94.js";
|
|
5
|
+
import { b as g, T as f, c as v, B as b, a as p } from "./tooltip-DVeqVwqV.js";
|
|
6
|
+
import { S as N, h as T, i as x, a as C, c as S } from "./select-BpjFWqAY.js";
|
|
7
|
+
import { u as y } from "./useTheme-DS6ZjdzM.js";
|
|
8
|
+
function w({ themeOptions: c, variant: o = "select", id: t }) {
|
|
9
|
+
const { t: i } = u(), { theme: n, handleThemeChange: m, currentThemeOption: e, nextThemeOption: r, cycleTheme: d } = y(c);
|
|
10
|
+
if (o === "mini") {
|
|
11
11
|
const s = e == null ? void 0 : e.icon;
|
|
12
|
-
return /* @__PURE__ */ a(
|
|
13
|
-
/* @__PURE__ */ a(
|
|
14
|
-
|
|
12
|
+
return /* @__PURE__ */ a(g, { children: /* @__PURE__ */ l(f, { children: [
|
|
13
|
+
/* @__PURE__ */ a(v, { asChild: !0, children: /* @__PURE__ */ l(
|
|
14
|
+
b,
|
|
15
15
|
{
|
|
16
|
+
id: t,
|
|
16
17
|
variant: "ghost",
|
|
17
18
|
size: "icon",
|
|
18
|
-
onClick:
|
|
19
|
+
onClick: d,
|
|
19
20
|
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
20
21
|
children: [
|
|
21
22
|
s && /* @__PURE__ */ a(s, { className: "size-4" }),
|
|
@@ -26,19 +27,19 @@ function k({ themeOptions: c, variant: t = "select" }) {
|
|
|
26
27
|
]
|
|
27
28
|
}
|
|
28
29
|
) }),
|
|
29
|
-
/* @__PURE__ */ l(
|
|
30
|
+
/* @__PURE__ */ l(p, { side: "bottom", align: "center", children: [
|
|
30
31
|
"Passer en ",
|
|
31
32
|
r == null ? void 0 : r.label
|
|
32
33
|
] })
|
|
33
34
|
] }) });
|
|
34
35
|
}
|
|
35
36
|
return /* @__PURE__ */ l("div", { className: "space-y-2", children: [
|
|
36
|
-
/* @__PURE__ */ l(
|
|
37
|
-
/* @__PURE__ */ a(
|
|
38
|
-
/* @__PURE__ */ a(
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ a(
|
|
41
|
-
/* @__PURE__ */ a(
|
|
37
|
+
/* @__PURE__ */ l(N, { value: n, onValueChange: m, children: [
|
|
38
|
+
/* @__PURE__ */ a(T, { id: t, className: "w-full", children: /* @__PURE__ */ a(x, { placeholder: i("select.theme") }) }),
|
|
39
|
+
/* @__PURE__ */ a(C, { children: c.map((s) => {
|
|
40
|
+
const h = s.icon;
|
|
41
|
+
return /* @__PURE__ */ a(S, { value: s.value, children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
42
|
+
/* @__PURE__ */ a(h, { className: "size-4" }),
|
|
42
43
|
s.label
|
|
43
44
|
] }) }, s.value);
|
|
44
45
|
}) })
|
|
@@ -47,5 +48,5 @@ function k({ themeOptions: c, variant: t = "select" }) {
|
|
|
47
48
|
] });
|
|
48
49
|
}
|
|
49
50
|
export {
|
|
50
|
-
|
|
51
|
+
w as T
|
|
51
52
|
};
|
|
@@ -9,7 +9,7 @@ import { G as V } from "../../GenericForm-CydibLHU.js";
|
|
|
9
9
|
import { I as z } from "../../ImageInput-DoOOvvth.js";
|
|
10
10
|
import { D as q, a as w, S as J, b as Q } from "../../SearchInput-DIZ5Yt6L.js";
|
|
11
11
|
import { M as X } from "../../MultiSelect-DbH7LrsD.js";
|
|
12
|
-
import { L as $ } from "../../LanguageSelector-
|
|
12
|
+
import { L as $ } from "../../LanguageSelector-C7E51rCQ.js";
|
|
13
13
|
import { A as ea } from "../../AppActions-BFwztl-1.js";
|
|
14
14
|
import { A as oa, K as sa } from "../../KpiCardsLayout-Ca6otKVw.js";
|
|
15
15
|
import { A as ia } from "../../AppSubTitle-BTN0YAc7.js";
|
|
@@ -20,7 +20,7 @@ import { E as Ta } from "../../ErrorState-CkeS_IBT.js";
|
|
|
20
20
|
import { L as Da } from "../../LoadingState-BN0YaPSs.js";
|
|
21
21
|
import { A as Fa, D as La, S as Pa, T as ua, a as Ea, b as Ha, c as Ia, d as Ka, e as Na, g as Oa, f as Ba, h as Ma } from "../../DataTable-CjrR27Di.js";
|
|
22
22
|
import { A as Ga, a as _a, b as va, c as ya } from "../../AppVerticalTabs-B7XXtAVj.js";
|
|
23
|
-
import { T as Ua } from "../../ThemeSelector-
|
|
23
|
+
import { T as Ua } from "../../ThemeSelector-CLi4_epH.js";
|
|
24
24
|
export {
|
|
25
25
|
Fa as ACTIONS_COLUMN_KEY,
|
|
26
26
|
G as ActiveFilters,
|
|
@@ -3,7 +3,9 @@ import { type LanguageOption } from "../../../hooks/ui/useLanguage";
|
|
|
3
3
|
interface LanguageSelectorProps {
|
|
4
4
|
languageOptions: readonly LanguageOption[];
|
|
5
5
|
variant?: "select" | "mini";
|
|
6
|
+
/** Posé sur le déclencheur, pour qu'un `<Label htmlFor>` de l'application puisse s'y associer. */
|
|
7
|
+
id?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare function LanguageSelector({ languageOptions, variant }: LanguageSelectorProps): React.JSX.Element;
|
|
9
|
+
export declare function LanguageSelector({ languageOptions, variant, id }: LanguageSelectorProps): React.JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=LanguageSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/core/language/LanguageSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG1E,UAAU,qBAAqB;IAC7B,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"LanguageSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/core/language/LanguageSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG1E,UAAU,qBAAqB;IAC7B,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,kGAAkG;IAClG,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,gBAAgB,CAAC,EAAE,eAAe,EAAE,OAAkB,EAAE,EAAE,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsDtH"}
|
|
@@ -3,7 +3,9 @@ import { type ThemeOption } from "../../../hooks/ui/useTheme";
|
|
|
3
3
|
interface ThemeSelectorProps {
|
|
4
4
|
themeOptions: readonly ThemeOption[];
|
|
5
5
|
variant?: "select" | "mini";
|
|
6
|
+
/** Posé sur le déclencheur, pour qu'un `<Label htmlFor>` de l'application puisse s'y associer. */
|
|
7
|
+
id?: string;
|
|
6
8
|
}
|
|
7
|
-
export declare function ThemeSelector({ themeOptions, variant }: ThemeSelectorProps): React.JSX.Element;
|
|
9
|
+
export declare function ThemeSelector({ themeOptions, variant, id }: ThemeSelectorProps): React.JSX.Element;
|
|
8
10
|
export {};
|
|
9
11
|
//# sourceMappingURL=ThemeSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/core/theme/ThemeSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE,UAAU,kBAAkB;IAC1B,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/core/theme/ThemeSelector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE,UAAU,kBAAkB;IAC1B,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,kGAAkG;IAClG,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,wBAAgB,aAAa,CAAC,EAAE,YAAY,EAAE,OAAkB,EAAE,EAAE,EAAE,EAAE,kBAAkB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqD7G"}
|
package/dist/components/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { G as as } from "../GenericForm-CydibLHU.js";
|
|
|
9
9
|
import { I as rs } from "../ImageInput-DoOOvvth.js";
|
|
10
10
|
import { D as os, a as ts, S as ns, b as is } from "../SearchInput-DIZ5Yt6L.js";
|
|
11
11
|
import { M as ps } from "../MultiSelect-DbH7LrsD.js";
|
|
12
|
-
import { L as us } from "../LanguageSelector-
|
|
12
|
+
import { L as us } from "../LanguageSelector-C7E51rCQ.js";
|
|
13
13
|
import { A as gs } from "../AppActions-BFwztl-1.js";
|
|
14
14
|
import { A as ds, K as Ss } from "../KpiCardsLayout-Ca6otKVw.js";
|
|
15
15
|
import { A as cs } from "../AppSubTitle-BTN0YAc7.js";
|
|
@@ -20,7 +20,7 @@ import { E as Bs } from "../ErrorState-CkeS_IBT.js";
|
|
|
20
20
|
import { L as ks } from "../LoadingState-BN0YaPSs.js";
|
|
21
21
|
import { A as Ns, D as Rs, S as Os, T as Es, a as ys, b as Vs, c as Ks, d as zs, e as _s, g as js, f as Us, h as qs } from "../DataTable-CjrR27Di.js";
|
|
22
22
|
import { A as Js, a as Qs, b as Ws, c as Xs } from "../AppVerticalTabs-B7XXtAVj.js";
|
|
23
|
-
import { T as $s } from "../ThemeSelector-
|
|
23
|
+
import { T as $s } from "../ThemeSelector-CLi4_epH.js";
|
|
24
24
|
import { A as eo, a as ro, b as so } from "../alert-B9F1N9Qk.js";
|
|
25
25
|
import { A as to, C as no, a as io, b as lo, R as po, c as bo, d as uo, T as Co, e as go } from "../toaster-CyzB1m5z.js";
|
|
26
26
|
import { B as So, T as To, a as co, b as Do, c as Mo, d as xo, e as Ao, f as ho } from "../tooltip-DVeqVwqV.js";
|
package/package.json
CHANGED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import "date-fns/locale";
|
|
3
|
-
import "react-i18next";
|
|
4
|
-
import { u } from "./useKrosoftTranslation-BTp46G94.js";
|
|
5
|
-
import { b as h, T as g, c as f, B as v, a as p } from "./tooltip-DVeqVwqV.js";
|
|
6
|
-
import { S as b, h as T, i as N, a as x, c as S } from "./select-BpjFWqAY.js";
|
|
7
|
-
import { u as C } from "./useLanguage-C9jI2nwn.js";
|
|
8
|
-
import { LanguagesIcon as t } from "lucide-react";
|
|
9
|
-
function K({ languageOptions: o, variant: i = "select" }) {
|
|
10
|
-
const { t: r } = u(), { currentLanguageOption: a, nextLanguageOption: c, changeLanguage: n, cycleLanguage: m } = C(o);
|
|
11
|
-
if (i === "mini") {
|
|
12
|
-
const l = (a == null ? void 0 : a.icon) ?? t;
|
|
13
|
-
return /* @__PURE__ */ e(h, { children: /* @__PURE__ */ s(g, { children: [
|
|
14
|
-
/* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ s(
|
|
15
|
-
v,
|
|
16
|
-
{
|
|
17
|
-
variant: "ghost",
|
|
18
|
-
size: "icon",
|
|
19
|
-
onClick: m,
|
|
20
|
-
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ e(l, { className: "size-4" }),
|
|
23
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: r("language.current", { language: (a == null ? void 0 : a.label) ?? "" }) })
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
) }),
|
|
27
|
-
/* @__PURE__ */ e(p, { side: "bottom", align: "center", children: r("language.switchTo", { language: (c == null ? void 0 : c.label) ?? "" }) })
|
|
28
|
-
] }) });
|
|
29
|
-
}
|
|
30
|
-
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
31
|
-
/* @__PURE__ */ s(b, { value: a == null ? void 0 : a.value, onValueChange: n, children: [
|
|
32
|
-
/* @__PURE__ */ e(T, { className: "w-full", children: /* @__PURE__ */ e(N, { placeholder: r("select.language") }) }),
|
|
33
|
-
/* @__PURE__ */ e(x, { children: o.map((l) => {
|
|
34
|
-
const d = l.icon ?? t;
|
|
35
|
-
return /* @__PURE__ */ e(S, { value: l.value, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
36
|
-
/* @__PURE__ */ e(d, { className: "size-4" }),
|
|
37
|
-
l.label
|
|
38
|
-
] }) }, l.value);
|
|
39
|
-
}) })
|
|
40
|
-
] }),
|
|
41
|
-
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: r("language.description") })
|
|
42
|
-
] });
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
K as L
|
|
46
|
-
};
|