zuii 1.4.13 → 1.4.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.
- package/dist/components/Color/react/index.js +9 -8
- package/dist/components/Dashboard/react/index.d.ts +1 -0
- package/dist/components/Dashboard/react/index.js +16 -15
- package/dist/components/Dashboard/style/index.css +1 -1
- package/dist/components/Errorpage/react/index.js +4 -3
- package/dist/components/Group/style/index.css +1 -1
- package/dist/components/Lang-selector/js/language-selector.d.ts +3 -1
- package/dist/components/Lang-selector/js/language-selector.js +15 -13
- package/dist/components/Lang-selector/react/index.d.ts +14 -1
- package/dist/components/Lang-selector/react/index.js +29 -20
- package/dist/components/Loader/js/loader.d.ts +24 -0
- package/dist/components/Loader/js/loader.js +8 -0
- package/dist/components/Loader/react/index.d.ts +27 -0
- package/dist/components/Loader/react/index.js +38 -0
- package/dist/components/Loader/style/index.css +1 -0
- package/dist/components/Nav/react/index.js +24 -23
- package/dist/components/Table/js/table.d.ts +1 -1
- package/dist/components/Table/style/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -8
- package/dist/templates/Lang-selector/LangSelectors.tsx +29 -1
- package/dist/templates/Loaders/Loaders.d.ts +6 -0
- package/dist/templates/Loaders/Loaders.tsx +78 -0
- package/dist/templates/Tables/tables.data.d.ts +1 -1
- package/dist/templates/Tables/tables.data.tsx +6 -6
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { tokens as
|
|
3
|
-
import '../../Errorpage/style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Icon/style/index.css';import '../../Button/style/index.css';import '../style/index.css';import '../../../core/styles/main.css';/* empty css */
|
|
2
|
+
import { tokens as l } from "../../../core/styles/tokens.js";
|
|
3
|
+
import '../../Loader/style/index.css';import '../../Errorpage/style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Icon/style/index.css';import '../../Button/style/index.css';import '../style/index.css';import '../../../core/styles/main.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
import "react-bootstrap";
|
|
6
6
|
/* empty css */
|
|
@@ -31,29 +31,30 @@ import "choices.js";
|
|
|
31
31
|
import "../../Auth/react/index.js";
|
|
32
32
|
import "react-router-dom";
|
|
33
33
|
/* empty css */
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/* empty css */
|
|
35
|
+
const L = ({ name: r }) => {
|
|
36
|
+
const p = l.brands[r];
|
|
36
37
|
return /* @__PURE__ */ i(t, { children: [
|
|
37
38
|
/* @__PURE__ */ o("div", { className: `color bg-${r} p-4`, children: /* @__PURE__ */ i(t, { vertical: !0, center: !0, children: [
|
|
38
39
|
/* @__PURE__ */ o("span", { className: "color__name", children: r }),
|
|
39
|
-
/* @__PURE__ */ o("span", { className: "color__value", children:
|
|
40
|
+
/* @__PURE__ */ o("span", { className: "color__value", children: p.value })
|
|
40
41
|
] }) }),
|
|
41
42
|
/* @__PURE__ */ o("div", { className: `color bg-${r}-light p-4`, children: /* @__PURE__ */ i(t, { vertical: !0, center: !0, children: [
|
|
42
43
|
/* @__PURE__ */ i("span", { className: "color__name", children: [
|
|
43
44
|
r,
|
|
44
45
|
"-light"
|
|
45
46
|
] }),
|
|
46
|
-
/* @__PURE__ */ o("span", { className: "color__value", children:
|
|
47
|
+
/* @__PURE__ */ o("span", { className: "color__value", children: p.value })
|
|
47
48
|
] }) }),
|
|
48
49
|
/* @__PURE__ */ o("div", { className: `color bg-${r}-dark p-4`, children: /* @__PURE__ */ i(t, { vertical: !0, center: !0, children: [
|
|
49
50
|
/* @__PURE__ */ i("span", { className: "color__name", children: [
|
|
50
51
|
r,
|
|
51
52
|
"-dark"
|
|
52
53
|
] }),
|
|
53
|
-
/* @__PURE__ */ o("span", { className: "color__value", children:
|
|
54
|
+
/* @__PURE__ */ o("span", { className: "color__value", children: p.value })
|
|
54
55
|
] }) })
|
|
55
56
|
] });
|
|
56
57
|
};
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
+
L as Color
|
|
59
60
|
};
|
|
@@ -25,5 +25,6 @@ export declare const Dashboard: {
|
|
|
25
25
|
Header: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
SubNavigation: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
Wrapper: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Card: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
28
29
|
};
|
|
29
30
|
export {};
|
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import e from "react";
|
|
3
3
|
import '../style/index.css';/* empty css */
|
|
4
4
|
const c = ({ children: a, className: s = "" }) => {
|
|
5
|
-
const n =
|
|
6
|
-
if (
|
|
7
|
-
const i =
|
|
5
|
+
const n = e.Children.map(a, (o, d) => {
|
|
6
|
+
if (e.isValidElement(o)) {
|
|
7
|
+
const i = o, m = [
|
|
8
8
|
`nav-${d + 1}`
|
|
9
9
|
].filter(Boolean).join(" ");
|
|
10
|
-
return
|
|
10
|
+
return e.cloneElement(i, {
|
|
11
11
|
className: `${i.props.className || ""} ${m}`.trim()
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
return
|
|
14
|
+
return o;
|
|
15
15
|
});
|
|
16
16
|
return /* @__PURE__ */ r("div", { className: `dashboard__navigation ${s}`.trim(), children: n });
|
|
17
|
-
}, l = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__content ${s}`.trim(), children: a }), b = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__header ${s}`.trim(), children: a }),
|
|
17
|
+
}, l = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__content ${s}`.trim(), children: a }), b = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__header ${s}`.trim(), children: a }), h = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__sub-navigation ${s}`.trim(), children: a }), p = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__wrapper ${s}`.trim(), children: a }), _ = ({ children: a, className: s = "" }) => /* @__PURE__ */ r("div", { className: `dashboard__card ${s}`.trim(), children: a }), t = ({
|
|
18
18
|
children: a,
|
|
19
19
|
className: s = ""
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */ r("main", { className:
|
|
21
|
+
const o = `dashboard ${s}`.trim();
|
|
22
|
+
return /* @__PURE__ */ r("main", { className: o, children: a });
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
t.Navigation = c;
|
|
25
|
+
t.Content = l;
|
|
26
|
+
t.Header = b;
|
|
27
|
+
t.SubNavigation = h;
|
|
28
|
+
t.Wrapper = p;
|
|
29
|
+
t.Card = _;
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
t as Dashboard
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer layout{.dashboard{--dashboard-nav-width: 90px;--dashboard-padding: var(--spacing-md);display:flex;height:100vh;overflow:hidden}.dashboard__navigation{display:flex;flex-direction:column;background:var(--primary);color:var(--white);padding:var(--dashboard-padding) 0;width:var(--dashboard-nav-width);gap:var(--spacing-lg)}.dashboard__navigation>:first-child{flex:1;overflow-y:auto}.dashboard__content{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;width:100%}.dashboard__header{grid-column:span 2;background:var(--accent)}.dashboard__sub-navigation{grid-row:2;background:var(--light);width:0px;background:var(--primary-dark);color:var(--white);transition:all .3s ease-in-out}.dashboard__sub-navigation.open{width:
|
|
1
|
+
@layer layout{.dashboard{--dashboard-nav-width: 90px;--dashboard-padding: var(--spacing-md);display:flex;height:100vh;overflow:hidden}.dashboard__navigation{display:flex;flex-direction:column;background:var(--primary);color:var(--white);padding:var(--dashboard-padding) 0;width:var(--dashboard-nav-width);gap:var(--spacing-lg)}.dashboard__navigation>:first-child{flex:1;overflow-y:auto}.dashboard__content{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;width:100%}.dashboard__header{grid-column:span 2;background:var(--accent)}.dashboard__sub-navigation{grid-row:2;background:var(--light);width:0px;background:var(--primary-dark);color:var(--white);transition:all .3s ease-in-out}.dashboard__sub-navigation.open{width:160px}.dashboard__wrapper{padding:var(--dashboard-padding);display:flex;flex-direction:column;gap:var(--spacing-md);overflow:auto}.dashboard__card{background:var(--white);border-radius:var(--radius-base);box-shadow:var(--box-shadow-md);height:fit-content;overflow:hidden}.dashboard__card-header{background:var(--gray-200);padding:0 var(--spacing-md)}.dashboard__card-content{padding:var(--spacing-md)}.dashboard__card-title{font-size:1.25rem;margin:0}}@layer components{.dashboard__card-header .btn{--btn-font-size: .8rem;padding:var(--spacing-xs)}.dashboard__card-header .btn .icon{font-size:.8rem}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { useNavigate as e } from "react-router-dom";
|
|
3
|
-
import '../style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Color/style/index.css';import '../../../core/styles/main.css';/* empty css */
|
|
3
|
+
import '../../Loader/style/index.css';import '../style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Color/style/index.css';import '../../../core/styles/main.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { Button as p } from "../../Button/react/index.js";
|
|
6
6
|
import { Icon as a } from "../../Icon/react/index.js";
|
|
@@ -30,7 +30,8 @@ import "choices.js";
|
|
|
30
30
|
/* empty css */
|
|
31
31
|
import "../../Auth/react/index.js";
|
|
32
32
|
/* empty css */
|
|
33
|
-
|
|
33
|
+
/* empty css */
|
|
34
|
+
const J = ({ code: t = 404 }) => {
|
|
34
35
|
const m = e();
|
|
35
36
|
return /* @__PURE__ */ r("main", { className: "error-page", children: /* @__PURE__ */ r("div", { className: "error-page__container ", children: /* @__PURE__ */ i("div", { className: "container", children: [
|
|
36
37
|
/* @__PURE__ */ i(o, { className: "text-secondary mb-4", children: [
|
|
@@ -46,5 +47,5 @@ const H = ({ code: t = 404 }) => {
|
|
|
46
47
|
] }) }) });
|
|
47
48
|
};
|
|
48
49
|
export {
|
|
49
|
-
|
|
50
|
+
J as Errorpage
|
|
50
51
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.group{display:flex;flex-wrap:wrap;gap:.5rem}.group--vertical{flex-direction:column;align-items:flex-start}.group--horizontal{flex-direction:row;align-items:center}.group--no-wrap{flex-wrap:nowrap}.group--gap-none{gap:0}.group--center{align-items:center;justify-content:center}.group--start{justify-content:flex-start}.group--end{justify-content:flex-end}.group--between{justify-content:space-between}}
|
|
1
|
+
@layer components{.group{display:flex;flex-wrap:wrap;gap:.5rem}.group>*:has(.form__input){flex:1}.group--vertical{flex-direction:column;align-items:flex-start}.group--horizontal{flex-direction:row;align-items:center}.group--no-wrap{flex-wrap:nowrap}.group--gap-none{gap:0}.group--center{align-items:center;justify-content:center}.group--start{justify-content:flex-start}.group--end{justify-content:flex-end}.group--between{justify-content:space-between}}
|
|
@@ -14,6 +14,8 @@ export interface LanguageOption {
|
|
|
14
14
|
* @param {HTMLSelectElement} element - L'élément select à transformer.
|
|
15
15
|
* @param {LanguageOption[]} options - Liste des langues disponibles.
|
|
16
16
|
* @param {(value: string) => void} onChange - Callback appelé lors du changement de langue.
|
|
17
|
+
* @param {boolean} searchEnabled - Active la recherche.
|
|
18
|
+
* @param {string} placeholder - Texte affiché quand aucune option n'est sélectionnée.
|
|
17
19
|
* @returns {Choices} L'instance de Choices.js.
|
|
18
20
|
*/
|
|
19
|
-
export declare const initLanguageSelector: (element: HTMLSelectElement, options: LanguageOption[], onChange?: (value: string) => void) => Choices;
|
|
21
|
+
export declare const initLanguageSelector: (element: HTMLSelectElement, options: LanguageOption[], onChange?: (value: string) => void, searchEnabled?: boolean, placeholder?: string) => Choices;
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import g from "choices.js";
|
|
2
2
|
import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';/* empty css */
|
|
3
|
-
const
|
|
3
|
+
const S = (s, p, m, v = !1, $ = "") => {
|
|
4
4
|
s.innerHTML = "";
|
|
5
|
-
const
|
|
6
|
-
choices:
|
|
5
|
+
const b = new g(s, {
|
|
6
|
+
choices: p.map((t) => ({
|
|
7
7
|
value: t.value,
|
|
8
8
|
label: t.label || "",
|
|
9
9
|
selected: t.selected,
|
|
10
10
|
customProperties: { flag: t.flag, label: t.label }
|
|
11
11
|
})),
|
|
12
|
-
searchEnabled:
|
|
12
|
+
searchEnabled: v,
|
|
13
13
|
itemSelectText: "",
|
|
14
14
|
shouldSort: !1,
|
|
15
|
+
placeholder: !!$,
|
|
16
|
+
placeholderValue: $,
|
|
15
17
|
callbackOnCreateTemplates: (t) => {
|
|
16
|
-
const a = (l) => `<span class="fi fi-${l.customProperties.flag} lang-selector__flag"></span>${l.customProperties.label ? ` ${l.label}` : ""}`;
|
|
18
|
+
const a = (l) => l.placeholder ? `<span>${l.label}</span>` : `<span class="fi fi-${l.customProperties.flag} lang-selector__flag"></span>${l.customProperties.label ? ` ${l.label}` : ""}`;
|
|
17
19
|
return {
|
|
18
20
|
item: (l, e) => {
|
|
19
|
-
const { item:
|
|
21
|
+
const { item: c, highlightedState: i, itemSelectable: r, placeholder: o } = l.classNames, d = e.highlighted ? i : r, n = e.active ? 'aria-selected="true"' : "", h = e.disabled ? 'aria-disabled="true"' : "", u = e.placeholder ? o : "";
|
|
20
22
|
return t(`
|
|
21
|
-
<div class="${
|
|
23
|
+
<div class="${c} ${d} ${u}" data-item data-id="${e.id}" data-value="${e.value}" ${n} ${h}>
|
|
22
24
|
${a(e)}
|
|
23
25
|
</div>`.trim());
|
|
24
26
|
},
|
|
25
27
|
choice: (l, e) => {
|
|
26
|
-
const { item:
|
|
28
|
+
const { item: c, itemChoice: i, itemDisabled: r, itemSelectable: o, placeholder: d } = l.classNames, n = e.disabled ? r : o, h = e.disabled ? 'data-choice-disabled aria-disabled="true"' : "data-choice-selectable", u = e.placeholder ? d : "";
|
|
27
29
|
return t(`
|
|
28
|
-
<div class="${
|
|
30
|
+
<div class="${c} ${i} ${n} ${u}" data-select-text="${l.itemSelectText}" data-choice ${h} data-id="${e.id}" data-value="${e.value}" role="option">
|
|
29
31
|
${a(e)}
|
|
30
32
|
</div>`.trim());
|
|
31
33
|
}
|
|
@@ -37,10 +39,10 @@ const g = (s, h, m) => {
|
|
|
37
39
|
const l = a.detail.value;
|
|
38
40
|
document.documentElement.lang = l, m(l);
|
|
39
41
|
};
|
|
40
|
-
s.addEventListener("change", t),
|
|
42
|
+
s.addEventListener("change", t), b._handleChange = t;
|
|
41
43
|
}
|
|
42
|
-
return
|
|
44
|
+
return b;
|
|
43
45
|
};
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
S as initLanguageSelector
|
|
46
48
|
};
|
|
@@ -16,6 +16,19 @@ interface Props {
|
|
|
16
16
|
* Classe CSS additionnelle.
|
|
17
17
|
*/
|
|
18
18
|
className?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Active la recherche dans le sélecteur.
|
|
21
|
+
*/
|
|
22
|
+
search?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Texte affiché si aucune langue n'est sélectionnée.
|
|
25
|
+
*/
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Si vrai, une valeur par défaut est sélectionnée.
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
hasDefault?: boolean;
|
|
19
32
|
}
|
|
20
33
|
/**
|
|
21
34
|
* Composant sélecteur de langue utilisant Choices.js.
|
|
@@ -23,5 +36,5 @@ interface Props {
|
|
|
23
36
|
* @param {Props} props - Les propriétés du composant.
|
|
24
37
|
* @returns {JSX.Element} Le composant rendu.
|
|
25
38
|
*/
|
|
26
|
-
export declare const LangSelector: ({ options, defaultValue, onChange, className }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare const LangSelector: ({ options, defaultValue, onChange, className, search, placeholder, hasDefault }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
40
|
export {};
|
|
@@ -1,30 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { initLanguageSelector as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as g } from "react";
|
|
3
|
+
import { initLanguageSelector as d } from "../js/language-selector.js";
|
|
4
4
|
import '../style/index.css';/* empty css */
|
|
5
|
-
const
|
|
6
|
-
options:
|
|
7
|
-
defaultValue:
|
|
8
|
-
onChange:
|
|
9
|
-
className:
|
|
5
|
+
const R = ({
|
|
6
|
+
options: r,
|
|
7
|
+
defaultValue: t,
|
|
8
|
+
onChange: l,
|
|
9
|
+
className: f = "",
|
|
10
|
+
search: o = !1,
|
|
11
|
+
placeholder: a = "",
|
|
12
|
+
hasDefault: u = !0
|
|
10
13
|
}) => {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
if (!(!
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
...
|
|
18
|
-
selected:
|
|
14
|
+
const c = m(null), n = m(null);
|
|
15
|
+
return g(() => {
|
|
16
|
+
if (!(!r || r.length === 0)) {
|
|
17
|
+
if (c.current) {
|
|
18
|
+
c.current.innerHTML = "";
|
|
19
|
+
const s = r.map((e) => ({
|
|
20
|
+
...e,
|
|
21
|
+
selected: u ? t ? e.value === t : !1 : e.value === t
|
|
19
22
|
}));
|
|
20
|
-
|
|
23
|
+
u && !s.some((e) => e.selected) && s.length > 0 && (s[0].selected = !0), n.current = d(
|
|
24
|
+
c.current,
|
|
25
|
+
s,
|
|
26
|
+
l,
|
|
27
|
+
o,
|
|
28
|
+
a
|
|
29
|
+
);
|
|
21
30
|
}
|
|
22
31
|
return () => {
|
|
23
|
-
|
|
32
|
+
n.current && (n.current.destroy(), n.current = null);
|
|
24
33
|
};
|
|
25
34
|
}
|
|
26
|
-
}, [
|
|
35
|
+
}, [r, t, l]), /* @__PURE__ */ i("div", { className: `form__input lang-selector ${f}`.trim(), children: /* @__PURE__ */ i("select", { ref: c, className: "lang-selector__select" }) });
|
|
27
36
|
};
|
|
28
37
|
export {
|
|
29
|
-
|
|
38
|
+
R as LangSelector
|
|
30
39
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options pour le composant Loader.
|
|
3
|
+
*/
|
|
4
|
+
export interface LoaderOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Message à afficher sous le loader.
|
|
7
|
+
*/
|
|
8
|
+
message?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Taille du loader.
|
|
11
|
+
*/
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
/**
|
|
14
|
+
* Variante de style du loader.
|
|
15
|
+
*/
|
|
16
|
+
variant?: 'dots' | 'spinner' | 'pulse' | 'quad';
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Logique JavaScript pour le composant Loader.
|
|
20
|
+
*
|
|
21
|
+
* @param {HTMLElement} element - L'élément DOM du loader.
|
|
22
|
+
* @param {LoaderOptions} options - Les options de configuration.
|
|
23
|
+
*/
|
|
24
|
+
export declare const initLoader: (element: HTMLElement, options?: LoaderOptions) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LoaderOptions } from '../js/loader';
|
|
3
|
+
/**
|
|
4
|
+
* Propriétés du composant Loader.
|
|
5
|
+
*/
|
|
6
|
+
interface Props extends LoaderOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Classe CSS additionnelle.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Contenu optionnel (ex: texte sous le spinner).
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Couleur du loader.
|
|
17
|
+
*/
|
|
18
|
+
color?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Composant Loader.
|
|
22
|
+
*
|
|
23
|
+
* @param {Props} props - Les propriétés du composant.
|
|
24
|
+
* @returns {JSX.Element} Le rendu du composant.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Loader: ({ className, size, variant, message, children, color, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as m, useEffect as p } from "react";
|
|
3
|
+
import '../style/index.css';/* empty css */
|
|
4
|
+
import { initLoader as _ } from "../js/loader.js";
|
|
5
|
+
const x = ({
|
|
6
|
+
className: l = "",
|
|
7
|
+
size: a = "md",
|
|
8
|
+
variant: s = "dots",
|
|
9
|
+
message: t,
|
|
10
|
+
children: c,
|
|
11
|
+
color: d = "primary"
|
|
12
|
+
}) => {
|
|
13
|
+
const n = m(null), e = "loader", o = a ? `${e}--${a}` : "", $ = s ? `${e}--${s}` : "", u = `${e} ${o} ${$} ${d ? `loader--${d}` : ""} ${l}`.trim();
|
|
14
|
+
return p(() => {
|
|
15
|
+
n.current && _(n.current, { size: a, variant: s, message: t });
|
|
16
|
+
}, [a, s, t]), /* @__PURE__ */ i("div", { ref: n, className: u, "aria-live": "polite", "aria-busy": "true", children: [
|
|
17
|
+
(() => {
|
|
18
|
+
switch (s) {
|
|
19
|
+
case "quad":
|
|
20
|
+
return /* @__PURE__ */ r("div", { className: `${e}__quad` });
|
|
21
|
+
case "spinner":
|
|
22
|
+
return /* @__PURE__ */ r("div", { className: `${e}__spinner-circle` });
|
|
23
|
+
case "pulse":
|
|
24
|
+
return /* @__PURE__ */ r("div", { className: `${e}__pulse` });
|
|
25
|
+
default:
|
|
26
|
+
return /* @__PURE__ */ i("div", { className: `${e}__spinner`, children: [
|
|
27
|
+
/* @__PURE__ */ r("div", { className: `${e}__dot` }),
|
|
28
|
+
/* @__PURE__ */ r("div", { className: `${e}__dot` }),
|
|
29
|
+
/* @__PURE__ */ r("div", { className: `${e}__dot` })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
})(),
|
|
33
|
+
(t || c) && /* @__PURE__ */ r("div", { className: `${e}__content`, children: t || c })
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
x as Loader
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.page-loader{position:fixed;top:0;left:0;width:100vw;height:100vh;background-color:color-mix(in srgb,var(--primary),var(--dark) 80%);display:flex;align-items:center;justify-content:center;z-index:9999;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.loader,.loader.loader--primary{--loader-color: var(--primary)}.loader.loader--secondary{--loader-color: var(--secondary)}.loader.loader--accent{--loader-color: var(--accent)}.loader.loader--tertiary{--loader-color: var(--tertiary)}.loader.loader--success{--loader-color: var(--success)}.loader.loader--danger{--loader-color: var(--danger)}.loader.loader--warning{--loader-color: var(--warning)}.loader.loader--info{--loader-color: var(--info)}.loader.loader--light{--loader-color: var(--light)}.loader.loader--dark{--loader-color: var(--dark)}.loader{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;vertical-align:middle}.loader__spinner,.loader__spinner-circle,.loader__pulse{flex-shrink:0}.loader--sm .loader__spinner,.loader--sm .loader__spinner-circle,.loader--sm .loader__pulse{width:20px;height:20px}.loader--sm .loader__dot{width:6px;height:6px}.loader--md .loader__spinner,.loader--md .loader__spinner-circle,.loader--md .loader__pulse{width:36px;height:36px}.loader--md .loader__dot{width:10px;height:10px}.loader--lg .loader__spinner,.loader--lg .loader__spinner-circle,.loader--lg .loader__pulse{width:56px;height:56px}.loader--lg .loader__dot{width:16px;height:16px}.loader--dots .loader__spinner{width:auto;height:auto;display:flex;flex-wrap:nowrap;gap:4px}.loader--dots .loader__dot{width:8px;height:8px;margin:0;background-color:var(--loader-color);border-radius:50%;animation:loader-dots-wave 1.2s infinite ease-in-out}.loader--dots .loader__dot:nth-child(2){animation-delay:.2s}.loader--dots .loader__dot:nth-child(3){animation-delay:.4s}.loader--dots .loader__dot:nth-child(4){animation-delay:.6s}.loader--dots.loader--sm .loader__dot{width:4px;height:4px;gap:2px}.loader--dots.loader--lg .loader__dot{width:12px;height:12px;gap:6px}.loader__spinner{position:relative;display:flex;align-items:center;justify-content:center}.loader--spinner .loader__spinner-circle{border:3px solid rgba(var(--primary-rgb, 0, 123, 255),.1);border-radius:50%;border-top-color:var(--loader-color);animation:loader-rotate .8s infinite linear}.loader--spinner.loader--sm .loader__spinner-circle{border-width:2px}.loader--spinner.loader--lg .loader__spinner-circle{border-width:4px}.loader--pulse .loader__pulse{background-color:var(--loader-color);border-radius:50%;animation:loader-pulse 1.2s infinite ease-in-out}.loader--quad .loader__quad{width:36px;aspect-ratio:1;--_c: no-repeat radial-gradient(farthest-side, var(--loader-color) 92%, #0000);background:var(--_c) top,var(--_c) left,var(--_c) right,var(--_c) bottom;background-size:12px 12px;animation:loader-quad-rotate 1s infinite}.loader__content{font-family:var(--font-family-base, sans-serif);font-size:.875rem;color:var(--text-muted, #6c757d);font-weight:500;text-align:center;line-height:1.4}@keyframes loader-rotate{to{transform:rotate(360deg)}}@keyframes loader-dot-bounce{0%,to{transform:scale(.5)}50%{transform:scale(1)}}@keyframes loader-pulse{0%,to{transform:scale(0);opacity:1}50%{transform:scale(1);opacity:.5}}@keyframes loader-dots-wave{0%,60%,to{transform:translateY(0);opacity:.6}35%{transform:translateY(-8px);opacity:1}}@keyframes loader-quad-rotate{to{transform:rotate(.5turn)}}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as _, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as u } from "react";
|
|
3
|
-
import '../../Errorpage/style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Group/style/index.css';import '../../Color/style/index.css';import '../../../core/styles/main.css';import '../style/index.css';/* empty css */
|
|
3
|
+
import '../../Loader/style/index.css';import '../../Errorpage/style/index.css';import '../../Lang-selector/style/index.css';import '../../../node_modules/.pnpm/flag-icons@7.5.0/node_modules/flag-icons/css/flag-icons.min.css';import '../../Placeholder/style/index.css';import '../../Logo/style/index.css';import '../../Radius/style/index.css';import '../../Shadow/style/index.css';import '../../Context-menu/style/index.css';import '../../Divider/style/index.css';import '../../Badge/style/index.css';import '../../Avatar/style/index.css';import '../../Group/style/index.css';import '../../Color/style/index.css';import '../../../core/styles/main.css';import '../style/index.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { Button as $ } from "../../Button/react/index.js";
|
|
@@ -28,49 +28,50 @@ import "choices.js";
|
|
|
28
28
|
/* empty css */
|
|
29
29
|
/* empty css */
|
|
30
30
|
import "../../Auth/react/index.js";
|
|
31
|
-
import "react-router-dom";
|
|
31
|
+
import { Link as N } from "react-router-dom";
|
|
32
32
|
/* empty css */
|
|
33
|
-
|
|
33
|
+
/* empty css */
|
|
34
|
+
import { initNav as g } from "../js/nav.js";
|
|
34
35
|
const h = ({
|
|
35
36
|
children: s,
|
|
36
|
-
component:
|
|
37
|
+
component: o,
|
|
37
38
|
label: r,
|
|
38
|
-
icon:
|
|
39
|
+
icon: i,
|
|
39
40
|
href: p,
|
|
40
41
|
onClick: a,
|
|
41
42
|
tooltip: m = !1,
|
|
42
|
-
className:
|
|
43
|
-
vertical:
|
|
43
|
+
className: n = "",
|
|
44
|
+
vertical: e = !1,
|
|
44
45
|
...c
|
|
45
46
|
}) => {
|
|
46
47
|
const l = s || /* @__PURE__ */ _(v, { children: [
|
|
47
|
-
|
|
48
|
+
o || i && /* @__PURE__ */ t(C, { name: i }),
|
|
48
49
|
r && /* @__PURE__ */ t("span", { children: r })
|
|
49
|
-
] }), f = a ? /* @__PURE__ */ _($, { icon:
|
|
50
|
-
|
|
51
|
-
!
|
|
52
|
-
] }) : p ? /* @__PURE__ */ t(
|
|
53
|
-
return /* @__PURE__ */ t("li", { className: `nav__item ${
|
|
54
|
-
},
|
|
50
|
+
] }), f = a ? /* @__PURE__ */ _($, { icon: o ? void 0 : i, btnIcon: !0, onClick: a, ...c, children: [
|
|
51
|
+
o,
|
|
52
|
+
!o && !i && r
|
|
53
|
+
] }) : p ? /* @__PURE__ */ t(N, { to: p, ...c, children: l }) : l, d = typeof m == "string" ? m : m === !0 ? r : void 0;
|
|
54
|
+
return /* @__PURE__ */ t("li", { className: `nav__item ${e ? "nav__item--col" : ""} ${n} `.trim(), children: d ? /* @__PURE__ */ t(I, { content: d, placement: e ? "right" : "bottom", children: /* @__PURE__ */ t("span", { children: f }) }) : f });
|
|
55
|
+
}, x = ({
|
|
55
56
|
children: s,
|
|
56
|
-
items:
|
|
57
|
+
items: o,
|
|
57
58
|
className: r = "",
|
|
58
|
-
vertical:
|
|
59
|
+
vertical: i = !1,
|
|
59
60
|
tooltip: p = !1
|
|
60
61
|
}) => {
|
|
61
62
|
const m = `nav ${r}`.trim();
|
|
62
63
|
return u(() => {
|
|
63
|
-
|
|
64
|
-
}, []), /* @__PURE__ */ t("nav", { className: m, children: /* @__PURE__ */ t("ul", { className: `nav__items ${
|
|
64
|
+
g();
|
|
65
|
+
}, []), /* @__PURE__ */ t("nav", { className: m, children: /* @__PURE__ */ t("ul", { className: `nav__items ${i ? "nav__items--col" : ""} ${r ? `${r}__items` : ""}`.trim(), children: o ? o.map((n, e) => /* @__PURE__ */ t(
|
|
65
66
|
h,
|
|
66
67
|
{
|
|
67
|
-
...
|
|
68
|
-
tooltip: p ?
|
|
68
|
+
...n,
|
|
69
|
+
tooltip: p ? n.tooltip ?? !0 : !1
|
|
69
70
|
},
|
|
70
|
-
|
|
71
|
+
e
|
|
71
72
|
)) : s }) });
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
+
x.Item = h;
|
|
74
75
|
export {
|
|
75
|
-
|
|
76
|
+
x as Nav
|
|
76
77
|
};
|