zuii 1.4.13 → 1.4.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.
Files changed (45) hide show
  1. package/dist/components/Button/react/index.js +20 -20
  2. package/dist/components/Color/react/index.js +10 -9
  3. package/dist/components/Dashboard/react/index.d.ts +1 -0
  4. package/dist/components/Dashboard/react/index.js +16 -15
  5. package/dist/components/Dashboard/style/index.css +1 -1
  6. package/dist/components/Errorpage/react/index.js +4 -3
  7. package/dist/components/Form/js/select.d.ts +1 -1
  8. package/dist/components/Form/js/select.js +33 -12
  9. package/dist/components/Form/react/Select.d.ts +10 -1
  10. package/dist/components/Form/react/Select.js +58 -40
  11. package/dist/components/Form/react/index.d.ts +1 -1
  12. package/dist/components/Form/style/index.css +1 -1
  13. package/dist/components/Group/style/index.css +1 -1
  14. package/dist/components/Icon/react/index.d.ts +17 -1
  15. package/dist/components/Icon/react/index.js +10 -7
  16. package/dist/components/Icon/style/index.css +1 -1
  17. package/dist/components/Lang-selector/js/language-selector.d.ts +3 -1
  18. package/dist/components/Lang-selector/js/language-selector.js +15 -13
  19. package/dist/components/Lang-selector/react/index.d.ts +14 -1
  20. package/dist/components/Lang-selector/react/index.js +29 -20
  21. package/dist/components/Loader/js/loader.d.ts +24 -0
  22. package/dist/components/Loader/js/loader.js +8 -0
  23. package/dist/components/Loader/react/index.d.ts +27 -0
  24. package/dist/components/Loader/react/index.js +38 -0
  25. package/dist/components/Loader/style/index.css +1 -0
  26. package/dist/components/Modal/style/index.css +1 -1
  27. package/dist/components/Nav/react/index.js +24 -23
  28. package/dist/components/Placeholder/react/index.d.ts +3 -1
  29. package/dist/components/Placeholder/react/index.js +11 -10
  30. package/dist/components/Placeholder/style/index.css +1 -1
  31. package/dist/components/Table/js/table.d.ts +1 -1
  32. package/dist/components/Table/style/index.css +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +44 -40
  35. package/dist/templates/Forms/Forms-elements.tsx +18 -3
  36. package/dist/templates/Forms/Forms.tsx +1 -1
  37. package/dist/templates/Lang-selector/LangSelectors.tsx +29 -1
  38. package/dist/templates/Loaders/Loaders.d.ts +6 -0
  39. package/dist/templates/Loaders/Loaders.tsx +78 -0
  40. package/dist/templates/Placeholders/Placeholders.tsx +5 -0
  41. package/dist/templates/Tables/tables.data.d.ts +1 -1
  42. package/dist/templates/Tables/tables.data.tsx +6 -6
  43. package/dist/templates/index.d.ts +1 -0
  44. package/dist/templates/index.ts +1 -0
  45. package/package.json +1 -1
@@ -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 b from "choices.js";
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 g = (s, h, m) => {
3
+ const S = (s, p, m, v = !1, $ = "") => {
4
4
  s.innerHTML = "";
5
- const u = new b(s, {
6
- choices: h.map((t) => ({
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: !1,
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: i, highlightedState: c, itemSelectable: r } = l.classNames, d = e.highlighted ? c : r, n = e.active ? 'aria-selected="true"' : "", o = e.disabled ? 'aria-disabled="true"' : "";
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="${i} ${d}" data-item data-id="${e.id}" data-value="${e.value}" ${n} ${o}>
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: i, itemChoice: c, itemDisabled: r, itemSelectable: d } = l.classNames, n = e.disabled ? r : d, o = e.disabled ? 'data-choice-disabled aria-disabled="true"' : "data-choice-selectable";
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="${i} ${c} ${n}" data-select-text="${l.itemSelectText}" data-choice ${o} data-id="${e.id}" data-value="${e.value}" role="option">
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), u._handleChange = t;
42
+ s.addEventListener("change", t), b._handleChange = t;
41
43
  }
42
- return u;
44
+ return b;
43
45
  };
44
46
  export {
45
- g as initLanguageSelector
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 s } from "react/jsx-runtime";
2
- import { useRef as u, useEffect as m } from "react";
3
- import { initLanguageSelector as o } from "../js/language-selector.js";
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: e,
7
- defaultValue: c,
8
- onChange: n,
9
- className: i = ""
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 r = u(null), t = u(null);
12
- return m(() => {
13
- if (!(!e || e.length === 0)) {
14
- if (r.current) {
15
- r.current.innerHTML = "";
16
- const f = e.map((l) => ({
17
- ...l,
18
- selected: l.value === c
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
- t.current = o(r.current, f, n);
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
- t.current && (t.current.destroy(), t.current = null);
32
+ n.current && (n.current.destroy(), n.current = null);
24
33
  };
25
34
  }
26
- }, [e, c, n]), /* @__PURE__ */ s("div", { className: `form__input lang-selector ${i}`.trim(), children: /* @__PURE__ */ s("select", { ref: r, className: "lang-selector__select" }) });
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
- _ as LangSelector
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,8 @@
1
+ const s = (t, i = {}) => {
2
+ if (!t) return;
3
+ const { size: r = "md" } = i;
4
+ t.setAttribute("data-size", r);
5
+ };
6
+ export {
7
+ s as initLoader
8
+ };
@@ -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 s } from "react/jsx-runtime";
2
+ import { useRef as u, 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: r = "md",
8
+ variant: a = "dots",
9
+ message: t,
10
+ children: c,
11
+ color: d = "primary"
12
+ }) => {
13
+ const n = u(null), e = "loader", o = r ? `${e}--${r}` : "", $ = a ? `${e}--${a}` : "", m = `${e} ${o} ${$} ${d ? `loader--${d}` : ""} ${l}`.trim();
14
+ return p(() => {
15
+ n.current && _(n.current, { size: r });
16
+ }, [r, a, t]), /* @__PURE__ */ i("div", { ref: n, className: m, "aria-live": "polite", "aria-busy": "true", children: [
17
+ (() => {
18
+ switch (a) {
19
+ case "quad":
20
+ return /* @__PURE__ */ s("div", { className: `${e}__quad` });
21
+ case "spinner":
22
+ return /* @__PURE__ */ s("div", { className: `${e}__spinner-circle` });
23
+ case "pulse":
24
+ return /* @__PURE__ */ s("div", { className: `${e}__pulse` });
25
+ default:
26
+ return /* @__PURE__ */ i("div", { className: `${e}__spinner`, children: [
27
+ /* @__PURE__ */ s("div", { className: `${e}__dot` }),
28
+ /* @__PURE__ */ s("div", { className: `${e}__dot` }),
29
+ /* @__PURE__ */ s("div", { className: `${e}__dot` })
30
+ ] });
31
+ }
32
+ })(),
33
+ (t || c) && /* @__PURE__ */ s("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 +1 @@
1
- @layer components{@keyframes menu-fade-in{0%{opacity:0}to{opacity:1}}.backdrop{--backdrop-opacity: .7;--backdrop-bg: color-mix(in srgb, var(--primary-dark), var(--dark) 80%)}.modal-content{--modal-border-radius: var(--radius-sm);--modal-border-width: 0;--modal-border-color: var(--border-color);overflow:hidden}.modal-header{--modal-header-padding: var(--spacing-md) var(--spacing-lg);--modal-header-border-width: var(--border-none);--modal-header-border-color: var(--border-color)}.modal-header .btn-close{padding:.5rem;margin:-.5rem -.5rem -.5rem auto}.modal-body{padding:var(--spacing-md) var(--spacing-lg)}.modal-footer{padding:var(--spacing-md) var(--spacing-lg);border-top:1px solid var(--gray-100);border-bottom-right-radius:0;border-bottom-left-radius:0}.modal-backdrop{--backdrop-opacity: .7;--backdrop-bg: color-mix(in srgb, var(--primary-dark), var(--dark) 80%)}}
1
+ @layer components{@keyframes menu-fade-in{0%{opacity:0}to{opacity:1}}.backdrop{--backdrop-opacity: .7;--backdrop-bg: color-mix(in srgb, var(--primary-dark), var(--dark) 80%)}.modal-content{--modal-border-radius: var(--radius-sm);--modal-border-width: 0;--modal-border-color: var(--border-color)}.modal-header{--modal-header-padding: var(--spacing-md) var(--spacing-lg);--modal-header-border-width: var(--border-none);--modal-header-border-color: var(--border-color)}.modal-header .btn-close{padding:.5rem;margin:-.5rem -.5rem -.5rem auto}.modal-body{padding:var(--spacing-md) var(--spacing-lg)}.modal-footer{padding:var(--spacing-md) var(--spacing-lg);border-top:1px solid var(--gray-100);border-bottom-right-radius:0;border-bottom-left-radius:0}.modal-backdrop{--backdrop-opacity: .7;--backdrop-bg: color-mix(in srgb, var(--primary-dark), var(--dark) 80%)}}
@@ -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
- import { initNav as N } from "../js/nav.js";
33
+ /* empty css */
34
+ import { initNav as g } from "../js/nav.js";
34
35
  const h = ({
35
36
  children: s,
36
- component: i,
37
+ component: o,
37
38
  label: r,
38
- icon: o,
39
+ icon: i,
39
40
  href: p,
40
41
  onClick: a,
41
42
  tooltip: m = !1,
42
- className: e = "",
43
- vertical: n = !1,
43
+ className: n = "",
44
+ vertical: e = !1,
44
45
  ...c
45
46
  }) => {
46
47
  const l = s || /* @__PURE__ */ _(v, { children: [
47
- i || o && /* @__PURE__ */ t(C, { name: o }),
48
+ o || i && /* @__PURE__ */ t(C, { name: i }),
48
49
  r && /* @__PURE__ */ t("span", { children: r })
49
- ] }), f = a ? /* @__PURE__ */ _($, { icon: i ? void 0 : o, btnIcon: !0, onClick: a, ...c, children: [
50
- i,
51
- !i && !o && r
52
- ] }) : p ? /* @__PURE__ */ t("a", { href: p, ...c, children: l }) : l, d = typeof m == "string" ? m : m === !0 ? r : void 0;
53
- return /* @__PURE__ */ t("li", { className: `nav__item ${n ? "nav__item--col" : ""} ${e} `.trim(), children: d ? /* @__PURE__ */ t(I, { content: d, placement: n ? "right" : "bottom", children: /* @__PURE__ */ t("span", { children: f }) }) : f });
54
- }, g = ({
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: i,
57
+ items: o,
57
58
  className: r = "",
58
- vertical: o = !1,
59
+ vertical: i = !1,
59
60
  tooltip: p = !1
60
61
  }) => {
61
62
  const m = `nav ${r}`.trim();
62
63
  return u(() => {
63
- N();
64
- }, []), /* @__PURE__ */ t("nav", { className: m, children: /* @__PURE__ */ t("ul", { className: `nav__items ${o ? "nav__items--col" : ""} ${r ? `${r}__items` : ""}`.trim(), children: i ? i.map((e, n) => /* @__PURE__ */ t(
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
- ...e,
68
- tooltip: p ? e.tooltip ?? !0 : !1
68
+ ...n,
69
+ tooltip: p ? n.tooltip ?? !0 : !1
69
70
  },
70
- n
71
+ e
71
72
  )) : s }) });
72
73
  };
73
- g.Item = h;
74
+ x.Item = h;
74
75
  export {
75
- g as Nav
76
+ x as Nav
76
77
  };
@@ -15,6 +15,8 @@ interface Props extends BSTPlaceholderProps {
15
15
  button?: boolean;
16
16
  /** Si le placeholder est une image */
17
17
  image?: boolean;
18
+ /** Si le placeholder est un input */
19
+ input?: boolean;
18
20
  }
19
21
  /**
20
22
  * Composant Placeholder.
@@ -22,5 +24,5 @@ interface Props extends BSTPlaceholderProps {
22
24
  * @param {Props} props - Les propriétés du composant.
23
25
  * @returns {JSX.Element} Le rendu du composant.
24
26
  */
25
- export declare const Placeholder: ({ animation, size, variant, width, button, image, children, className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const Placeholder: ({ animation, size, variant, width, button, image, input, children, className, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
26
28
  export {};
@@ -1,6 +1,6 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import s from "react";
3
- import { Placeholder as $ } from "react-bootstrap";
1
+ import { jsx as $ } from "react/jsx-runtime";
2
+ import h from "react";
3
+ import { Placeholder as s } from "react-bootstrap";
4
4
  import '../style/index.css';/* empty css */
5
5
  const x = ({
6
6
  animation: r = void 0,
@@ -9,21 +9,22 @@ const x = ({
9
9
  width: c,
10
10
  button: l,
11
11
  image: t,
12
+ input: a,
12
13
  children: o,
13
- className: a = "",
14
- ...m
14
+ className: p = "",
15
+ ...i
15
16
  }) => {
16
- const i = s.Children.count(o) > 0;
17
- return /* @__PURE__ */ p(
18
- $,
17
+ const m = h.Children.count(o) > 0;
18
+ return /* @__PURE__ */ $(
19
+ s,
19
20
  {
20
21
  size: d,
21
22
  variant: e,
22
23
  xs: c,
23
24
  "aria-hidden": "true",
24
- className: `placeholder__item ${r ? `placeholder-${r}` : ""} ${l ? "btn" : ""} ${t ? "placeholder--image" : ""} ${i ? "placeholder--filled" : ""} ${e && l ? `btn-${e}` : ""} ${a}`.trim(),
25
+ className: `placeholder__item ${r ? `placeholder-${r}` : ""} ${l ? "btn" : ""} ${t ? "placeholder--image" : ""} ${a ? "placeholder--input" : ""} ${m ? "placeholder--filled" : ""} ${e && l ? `btn-${e}` : ""} ${p}`.trim(),
25
26
  ...l ? { as: "button" } : {},
26
- ...m,
27
+ ...i,
27
28
  children: o
28
29
  }
29
30
  );
@@ -1 +1 @@
1
- @layer layout{.placeholder,.placeholder__item{width:100%}.placeholder--filled{width:auto}.placeholder--image{width:100px;height:100px;display:flex;align-items:center;justify-content:center;background-color:var(--primary, #f1f5f9);border:var(--border-width, 1px) solid var(--border-color, #94a3b8);position:relative;overflow:hidden}.placeholder--image:after{content:"";width:40%;height:40%;background-color:var(--gray-200, #94a3b8);-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>');mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>');-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}.placeholder-glow.placeholder,.placeholder-glow.placeholder__item,.placeholder-glow .placeholder,.placeholder-glow .placeholder__item{animation:placeholder-glow 2s ease-in-out infinite}.placeholder-wave.placeholder,.placeholder-wave.placeholder__item,.placeholder-wave .placeholder,.placeholder-wave .placeholder__item{-webkit-mask-image:linear-gradient(130deg,#000 40%,#00000080,#000 60%);mask-image:linear-gradient(130deg,#000 40%,#00000080,#000 60%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-glow{0%,to{opacity:.6}50%{opacity:.3}}@keyframes placeholder-wave{to{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}.placeholder-xs{min-height:.6em}.placeholder-sm{min-height:.8em}.placeholder-lg{min-height:1.25em}[variant=primary]{background-color:var(--primary, #296782)!important;opacity:.5}[variant=secondary]{background-color:var(--secondary, #49B4E8)!important;opacity:.5}[variant=accent]{background-color:var(--accent, #49B4E8)!important;opacity:.5}[variant=tertiary]{background-color:var(--tertiary, #f5524d)!important;opacity:.5}[variant=success]{background-color:var(--success, #73D3B6)!important;opacity:.5}[variant=danger]{background-color:var(--danger, #EA5F5F)!important;opacity:.5}[variant=warning]{background-color:var(--warning, #F5D762)!important;opacity:.5}[variant=info]{background-color:var(--info, #73B6D3)!important;opacity:.5}[variant=light]{background-color:var(--light, #FFFFFF)!important;opacity:.5}[variant=dark]{background-color:var(--dark, #000000)!important;opacity:.5}}
1
+ @layer layout{.form__input,.placeholder--input{--form-placeholder-color: color-mix(in srgb, var(--body-color), transparent 70%)}.form__input:not(:has(.choices)),.placeholder--input:not(:has(.choices)){padding:var(--spacing-xs) var(--spacing-sm)}.choices__inner{padding:var(--spacing-xs) var(--spacing-sm)}.form__input,.placeholder--input{background-color:var(--white);border-radius:var(--radius-base);border:var(--border-width) solid var(--border-color);margin:var(--spacing-sm) 0;display:flex;gap:var(--spacing-xs);transition:all .2s cubic-bezier(.455,.03,.515,.955);flex:1}.form__input[type=checkbox],[type=checkbox].placeholder--input,.form__input[type=radio],[type=radio].placeholder--input{appearance:none;width:1.25rem;height:1.25rem;background-color:var(--white);border:2px solid var(--color-gray-300);border-radius:var(--radius-sm);cursor:pointer;position:relative;transition:all .2s cubic-bezier(.4,0,.2,1);vertical-align:middle;margin-top:-2px}.form__input[type=checkbox]:after,[type=checkbox].placeholder--input:after,.form__input[type=radio]:after,[type=radio].placeholder--input:after{content:"";position:absolute;top:50%;left:50%;width:.75rem;height:.75rem;background-color:var(--white);-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;transform:translate(-50%,-50%) scale(0);transition:transform .2s cubic-bezier(.4,0,.2,1)}.form__input[type=checkbox]:checked,[type=checkbox].placeholder--input:checked,.form__input[type=radio]:checked,[type=radio].placeholder--input:checked{background-color:var(--primary);border-color:var(--primary)}.form__input[type=checkbox]:checked:after,[type=checkbox].placeholder--input:checked:after,.form__input[type=radio]:checked:after,[type=radio].placeholder--input:checked:after{transform:translate(-50%,-50%) scale(1)}.form__input[type=checkbox]:focus,[type=checkbox].placeholder--input:focus,.form__input[type=radio]:focus,[type=radio].placeholder--input:focus{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,var(--primary),transparent 80%);border-color:var(--primary)}.form__input[type=checkbox]:hover:not(:checked):not(:disabled),[type=checkbox].placeholder--input:hover:not(:checked):not(:disabled),.form__input[type=radio]:hover:not(:checked):not(:disabled),[type=radio].placeholder--input:hover:not(:checked):not(:disabled){border-color:var(--primary);background-color:color-mix(in srgb,var(--primary),transparent 95%)}.form__input[type=checkbox]:disabled,[type=checkbox].placeholder--input:disabled,.form__input[type=radio]:disabled,[type=radio].placeholder--input:disabled{background-color:var(--color-gray-100);border-color:var(--color-gray-200);cursor:not-allowed;opacity:.7}.form__input[type=radio],[type=radio].placeholder--input{border-radius:var(--radius-pill)}.form__input[type=radio]:after,[type=radio].placeholder--input:after{-webkit-mask-image:none;mask-image:none;border-radius:var(--radius-pill);width:.5rem;height:.5rem}.form__input .form-control:not([type=checkbox]):not([type=radio]),.placeholder--input .form-control:not([type=checkbox]):not([type=radio]){padding:0;background-color:transparent;border-radius:var(--radius-none);border:none;line-height:1.3}.form__input .form-control:not([type=checkbox]):not([type=radio]):focus,.placeholder--input .form-control:not([type=checkbox]):not([type=radio]):focus{border:none;box-shadow:none}.form__input:has(.form-control:focus),.placeholder--input:has(.form-control:focus){border-color:var(--accent)}.group--vertical .form__input,.group--vertical .placeholder--input{width:100%}input[type=checkbox],input[type=radio]{--border-color: var(--primary)}.form__input:has(.form-control:disabled),.placeholder--input:has(.form-control:disabled){border-color:var(--gray-200);background-color:var(--gray-100)}.form__input:has(.form-control:disabled) .form-control,.placeholder--input:has(.form-control:disabled) .form-control,.form__input:has(.form-control:disabled) .form-control::placeholder,.placeholder--input:has(.form-control:disabled) .form-control::placeholder,.form__input:has(.form-control:disabled) .icon,.placeholder--input:has(.form-control:disabled) .icon{color:var(--form-placeholder-color)}input::placeholder{color:var(--form-placeholder-color)}.placeholder,.placeholder__item{width:100%}.placeholder--filled{width:auto}.placeholder--image{width:100px;height:100px;display:flex;align-items:center;justify-content:center;background-color:var(--primary, #f1f5f9);border:var(--border-width, 1px) solid var(--border-color, #94a3b8);position:relative;overflow:hidden}.placeholder--image:after{content:"";width:40%;height:40%;background-color:var(--gray-200, #94a3b8);-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>');mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>');-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center}.placeholder--input{height:1.93rem;background:color-mix(in srgb,currentcolor,transparent 70%)}.placeholder-glow.placeholder,.placeholder-glow.placeholder__item,.placeholder-glow .placeholder,.placeholder-glow .placeholder__item{animation:placeholder-glow 2s ease-in-out infinite}.placeholder-wave.placeholder,.placeholder-wave.placeholder__item,.placeholder-wave .placeholder,.placeholder-wave .placeholder__item{-webkit-mask-image:linear-gradient(130deg,#000 40%,#00000080,#000 60%);mask-image:linear-gradient(130deg,#000 40%,#00000080,#000 60%);-webkit-mask-size:200% 100%;mask-size:200% 100%;animation:placeholder-wave 2s linear infinite}@keyframes placeholder-glow{0%,to{opacity:.6}50%{opacity:.3}}@keyframes placeholder-wave{to{-webkit-mask-position:-200% 0%;mask-position:-200% 0%}}.placeholder-xs{min-height:.6em}.placeholder-sm{min-height:.8em}.placeholder-lg{min-height:1.25em}[variant=primary]{background-color:var(--primary, #296782)!important;opacity:.5}[variant=secondary]{background-color:var(--secondary, #49B4E8)!important;opacity:.5}[variant=accent]{background-color:var(--accent, #49B4E8)!important;opacity:.5}[variant=tertiary]{background-color:var(--tertiary, #f5524d)!important;opacity:.5}[variant=success]{background-color:var(--success, #73D3B6)!important;opacity:.5}[variant=danger]{background-color:var(--danger, #EA5F5F)!important;opacity:.5}[variant=warning]{background-color:var(--warning, #F5D762)!important;opacity:.5}[variant=info]{background-color:var(--info, #73B6D3)!important;opacity:.5}[variant=light]{background-color:var(--light, #FFFFFF)!important;opacity:.5}[variant=dark]{background-color:var(--dark, #000000)!important;opacity:.5}}
@@ -60,7 +60,7 @@ export interface TableOptions {
60
60
  /**
61
61
  * Langue du tableau (par défaut: 'fr').
62
62
  */
63
- locale?: 'fr' | 'en';
63
+ locale?: string;
64
64
  /**
65
65
  * Options personnalisées pour la colonne de sélection (checkbox).
66
66
  */