zuii 1.4.33 → 1.5.0

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.
@@ -1,4 +1,4 @@
1
- import { tokens } from '../../../core/styles/tokens';
1
+ import { tokens } from '../../../../packages/core/src/styles/tokens';
2
2
  interface Props {
3
3
  /**
4
4
  * Le nom de la couleur à afficher (ex: 'primary', 'success').
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
- import { tokens as m } from "../../../core/styles/tokens.js";
3
- import '../../Slider/style/index.css';import '../../Grid/style/index.css';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 '../../Button/style/index.css';import '../style/index.css';import '../../../core/styles/main.css';/* empty css */
2
+ import { tokens as m } from "../../../packages/core/src/styles/tokens.js";
3
+ import '../../../packages/cookie-consent/src/style/index.css';import '../../Slider/style/index.css';import '../../Grid/style/index.css';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 '../../Button/style/index.css';import '../style/index.css';import '../../../packages/core/src/styles/main.css';/* empty css */
4
4
  /* empty css */
5
5
  import "react-bootstrap";
6
6
  /* empty css */
@@ -37,7 +37,8 @@ import "../../Menu/react/index.js";
37
37
  import "@splidejs/react-splide";
38
38
  /* empty css */
39
39
  import "../../Card/react/index.js";
40
- const R = ({ name: r }) => {
40
+ /* empty css */
41
+ const S = ({ name: r }) => {
41
42
  const p = m.brands[r];
42
43
  return /* @__PURE__ */ i(t, { children: [
43
44
  /* @__PURE__ */ o("div", { className: `color bg-${r} p-4`, children: /* @__PURE__ */ i(t, { vertical: !0, center: !0, children: [
@@ -61,5 +62,5 @@ const R = ({ name: r }) => {
61
62
  ] });
62
63
  };
63
64
  export {
64
- R as Color
65
+ S as Color
65
66
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
2
  import { useNavigate as p } from "react-router-dom";
3
- import '../../Slider/style/index.css';import '../../Grid/style/index.css';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 */
3
+ import '../../../packages/cookie-consent/src/style/index.css';import '../../Slider/style/index.css';import '../../Grid/style/index.css';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 '../../../packages/core/src/styles/main.css';/* empty css */
4
4
  /* empty css */
5
5
  import { Button as e } from "../../Button/react/index.js";
6
6
  import { Icon as a } from "../../Icon/react/index.js";
@@ -36,7 +36,8 @@ import "../../Menu/react/index.js";
36
36
  import "@splidejs/react-splide";
37
37
  /* empty css */
38
38
  import "../../Card/react/index.js";
39
- const T = ({ code: t = 404 }) => {
39
+ /* empty css */
40
+ const U = ({ code: t = 404 }) => {
40
41
  const m = p();
41
42
  return /* @__PURE__ */ r("main", { className: "error-page", children: /* @__PURE__ */ r("div", { className: "error-page__container ", children: /* @__PURE__ */ i("div", { className: "container", children: [
42
43
  /* @__PURE__ */ i(o, { className: "text-secondary mb-4", children: [
@@ -52,5 +53,5 @@ const T = ({ code: t = 404 }) => {
52
53
  ] }) }) });
53
54
  };
54
55
  export {
55
- T as Errorpage
56
+ U as Errorpage
56
57
  };
@@ -1,7 +1,7 @@
1
- import { jsxs as R, jsx as S } from "react/jsx-runtime";
2
- import { useRef as i, useEffect as l } from "react";
3
- import { initSelect as E } from "../js/select.js";
4
- import { Icon as b } from "../../Icon/react/index.js";
1
+ import { jsxs as g, jsx as S } from "react/jsx-runtime";
2
+ import { useRef as l, useEffect as u } from "react";
3
+ import { initSelect as R } from "../js/select.js";
4
+ import { Icon as E } from "../../Icon/react/index.js";
5
5
  const V = {
6
6
  fr: {
7
7
  placeholder: "Sélectionnez une option",
@@ -9,8 +9,8 @@ const V = {
9
9
  noChoicesText: "Aucun choix disponible",
10
10
  uniqueItemText: "Seules les valeurs uniques peuvent être ajoutées",
11
11
  customAddItemText: "Seules les valeurs correspondant à un critère spécifique peuvent être ajoutées",
12
- addItemText: (e) => `Appuyez sur Entrée pour ajouter **${e}**`,
13
- maxItemText: (e) => `Seulement ${e} options peuvent être sélectionnées`
12
+ addItemText: (t) => `Appuyez sur Entrée pour ajouter **${t}**`,
13
+ maxItemText: (t) => `Seulement ${t} options peuvent être sélectionnées`
14
14
  },
15
15
  en: {
16
16
  placeholder: "Select an option",
@@ -18,73 +18,81 @@ const V = {
18
18
  noChoicesText: "No choices to choose from",
19
19
  uniqueItemText: "Only unique values can be added",
20
20
  customAddItemText: "Only values matching specific conditions can be added",
21
- addItemText: (e) => `Press Enter to add **${e}**`,
22
- maxItemText: (e) => `Only ${e} options can be selected`
21
+ addItemText: (t) => `Press Enter to add **${t}**`,
22
+ maxItemText: (t) => `Only ${t} options can be selected`
23
23
  }
24
24
  }, L = ({
25
- options: e,
26
- value: t,
25
+ options: t,
26
+ value: r,
27
27
  onChange: a,
28
- multiple: c = !1,
28
+ multiple: i = !1,
29
29
  placeholder: x = "Sélectionnez une option",
30
30
  disabled: A = !1,
31
31
  searchable: y = !0,
32
- className: I = "",
32
+ className: b = "",
33
33
  name: v,
34
34
  variant: h = "default",
35
35
  icon: T,
36
- lang: N
36
+ lang: I
37
37
  }) => {
38
- const o = i(null), s = i(null), d = i(a), f = i(t), g = N || (typeof document < "u" ? document.documentElement.lang : "fr") || "fr", m = V[g.startsWith("en") ? "en" : "fr"], p = x === "Sélectionnez une option" ? m.placeholder : x;
39
- l(() => {
38
+ const o = l(null), n = l(null), d = l(a), f = l(r), N = I || (typeof document < "u" ? document.documentElement.lang : "fr") || "fr", m = V[N.startsWith("en") ? "en" : "fr"], p = x === "Sélectionnez une option" ? m.placeholder : x;
39
+ u(() => {
40
40
  d.current = a;
41
- }, [a]), l(() => {
42
- f.current = t;
43
- }, [t]);
44
- const O = JSON.stringify(e);
45
- return l(() => {
41
+ }, [a]), u(() => {
42
+ f.current = r;
43
+ }, [r]);
44
+ const O = JSON.stringify(t);
45
+ return u(() => {
46
46
  if (o.current) {
47
47
  o.current.innerHTML = "";
48
- const r = t ?? f.current, u = e.map((n) => ({
49
- value: n.value,
50
- label: n.text,
51
- selected: Array.isArray(r) ? r.includes(n.value) : r === n.value,
48
+ const e = r ?? f.current, c = t.map((s) => ({
49
+ value: s.value,
50
+ label: s.text,
51
+ selected: Array.isArray(e) ? e.includes(s.value) : e === s.value,
52
52
  customProperties: {
53
- flag: n.flag
53
+ flag: s.flag
54
54
  }
55
55
  }));
56
- c || u.unshift({
56
+ i || c.unshift({
57
57
  value: "",
58
58
  label: p,
59
- selected: r === void 0 || r === "",
59
+ selected: e === void 0 || e === "",
60
60
  placeholder: !0
61
- }), s.current = E(o.current, {
62
- choices: u,
63
- removeItemButton: c,
61
+ }), n.current = R(o.current, {
62
+ choices: c,
63
+ removeItemButton: i,
64
64
  placeholderValue: p,
65
65
  searchEnabled: y,
66
66
  silent: !0,
67
67
  variant: h,
68
68
  ...m
69
- }, (n) => {
70
- f.current = n, d.current && d.current(n);
69
+ }, (s) => {
70
+ f.current = s, d.current && d.current(s);
71
71
  });
72
72
  }
73
73
  return () => {
74
- s.current && (s.current.destroy(), s.current = null);
74
+ n.current && (n.current.destroy(), n.current = null);
75
75
  };
76
- }, [O, c, p, h, y, m]), l(() => {
77
- if (s.current && t !== void 0) {
78
- const r = s.current.getValue(!0), u = Array.isArray(t) ? t : [t], n = Array.isArray(r) ? r : [r];
79
- JSON.stringify(u.sort()) !== JSON.stringify(n.sort()) && s.current.setChoiceByValue(t);
76
+ }, [O, i, p, h, y, m]), u(() => {
77
+ if (n.current && r !== void 0) {
78
+ const e = n.current.getValue(!0), c = Array.isArray(r) ? r : [r], s = Array.isArray(e) ? e : [e];
79
+ JSON.stringify(c.sort()) !== JSON.stringify(s.sort()) && n.current.setChoiceByValue(r);
80
80
  }
81
- }, [t]), /* @__PURE__ */ R("div", { className: `form__input ${I}`.trim(), children: [
82
- T && /* @__PURE__ */ S(b, { name: T, size: "sm" }),
81
+ }, [r]), u(() => {
82
+ const e = o.current?.closest("fieldset");
83
+ if (e) {
84
+ const c = new MutationObserver(() => {
85
+ n && (e.disabled ? n.current.disable() : n.current.enable());
86
+ });
87
+ return c.observe(e, { attributes: !0 }), () => c.disconnect();
88
+ }
89
+ }, []), /* @__PURE__ */ g("div", { className: `form__input ${b}`.trim(), children: [
90
+ T && /* @__PURE__ */ S(E, { name: T, size: "sm" }),
83
91
  /* @__PURE__ */ S(
84
92
  "select",
85
93
  {
86
94
  ref: o,
87
- multiple: c,
95
+ multiple: i,
88
96
  disabled: A,
89
97
  className: "select",
90
98
  name: v