@tedi-design-system/react 19.1.0-rc.19 → 19.1.0-rc.20

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 (48) hide show
  1. package/bundle-stats.html +1 -1
  2. package/community.cjs.js +1 -1
  3. package/community.es.js +215 -230
  4. package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
  5. package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
  6. package/index.css +1 -1
  7. package/package.json +1 -1
  8. package/src/community/components/accordion/accordion.cjs.js +1 -1
  9. package/src/community/components/accordion/accordion.es.js +14 -9
  10. package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
  11. package/src/community/components/card/card-notification/card-notification.es.js +10 -8
  12. package/src/community/components/dropdown/dropdown.cjs.js +1 -1
  13. package/src/community/components/dropdown/dropdown.es.js +34 -32
  14. package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
  15. package/src/community/components/form/file-upload/file-upload.es.js +43 -41
  16. package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
  17. package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
  18. package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
  19. package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
  20. package/src/community/components/form/toggle/toggle.cjs.js +1 -1
  21. package/src/community/components/form/toggle/toggle.es.js +30 -28
  22. package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
  23. package/src/community/components/map-components/carousel/carousel.es.js +19 -17
  24. package/src/community/components/status/status.cjs.js +1 -1
  25. package/src/community/components/status/status.es.js +14 -12
  26. package/src/community/components/stepper/stepper.cjs.js +1 -1
  27. package/src/community/components/stepper/stepper.es.js +33 -31
  28. package/src/community/components/table/table.cjs.js +1 -1
  29. package/src/community/components/table/table.es.js +9 -9
  30. package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
  31. package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
  32. package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
  33. package/src/community/components/tabs/tabs/tabs.es.js +29 -27
  34. package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
  35. package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
  36. package/src/community/deprecated-exports.cjs.js +1 -0
  37. package/src/community/deprecated-exports.d.ts +19 -0
  38. package/src/community/deprecated-exports.es.js +112 -0
  39. package/src/community/index.d.ts +1 -0
  40. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
  41. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
  42. package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
  43. package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
  44. package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
  45. package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +64 -63
  46. package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
  47. package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
  48. package/src/tedi/helpers/warn-deprecated/warn-deprecated.es.js +11 -0
@@ -1,90 +1,91 @@
1
1
  import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
- import { FloatingOverlay as U } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
- import l from "../../../../../external/classnames/index.es.js";
2
+ import { FloatingOverlay as Q } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
3
+ import c from "../../../../../external/classnames/index.es.js";
4
4
  import V, { useState as T, useRef as W, useEffect as k, useLayoutEffect as X } from "react";
5
- import { Icon as b } from "../../base/icon/icon.es.js";
5
+ import { warnDeprecated as Y } from "../../../helpers/warn-deprecated/warn-deprecated.es.js";
6
+ import { Icon as p } from "../../base/icon/icon.es.js";
6
7
  import { Button as g } from "../../buttons/button/button.es.js";
7
8
  import { SideNavItem as G } from "../sidenav/components/sidenav-item/sidenav-item.es.js";
8
9
  import n from "../sidenav/sidenav.module.scss.es.js";
9
- import { useLabels as Y } from "../../../providers/label-provider/use-labels.es.js";
10
- const Z = typeof window < "u" ? X : k, A = (c) => {
11
- let u = (c == null ? void 0 : c.parentElement) ?? null;
10
+ import { useLabels as Z } from "../../../providers/label-provider/use-labels.es.js";
11
+ const A = typeof window < "u" ? X : k, O = (r) => {
12
+ let u = (r == null ? void 0 : r.parentElement) ?? null;
12
13
  for (; u; ) {
13
- const r = getComputedStyle(u);
14
- if (r.transform !== "none" || r.perspective !== "none" || r.filter !== "" && r.filter !== "none" || /\b(transform|perspective|filter)\b/.test(r.willChange) || /\b(layout|paint|strict|content)\b/.test(r.contain))
14
+ const o = getComputedStyle(u);
15
+ if (o.transform !== "none" || o.perspective !== "none" || o.filter !== "" && o.filter !== "none" || /\b(transform|perspective|filter)\b/.test(o.willChange) || /\b(layout|paint|strict|content)\b/.test(o.contain))
15
16
  return u;
16
17
  u = u.parentElement;
17
18
  }
18
19
  return null;
19
- }, O = ({
20
- navItems: c,
20
+ }, ee = ({
21
+ navItems: r,
21
22
  ariaLabel: u,
22
- linkAs: r,
23
+ linkAs: o,
23
24
  isOpen: h,
24
25
  onClose: v,
25
- showOverlay: _ = !0,
26
+ showOverlay: f = !0,
26
27
  id: P,
27
28
  className: F
28
29
  }) => {
29
- var S, M, R, x, E, z, B;
30
- const { getLabel: N } = Y(), [s, p] = T([{ items: c }]), y = W(null), [j, I] = T("var(--layout-header-height)");
30
+ var M, S, R, x, E, z, B;
31
+ const { getLabel: N } = Z(), [s, b] = T([{ items: r }]), y = W(null), [j, w] = T("var(--layout-header-height)");
31
32
  k(() => {
32
- p([{ items: c }]);
33
- }, [c]), Z(() => {
34
- if (!h || !_ || typeof document > "u") return;
35
- const e = A(y.current), i = (e ?? document).querySelector("header") ?? document.querySelector("header");
33
+ b([{ items: r }]);
34
+ }, [r]), A(() => {
35
+ if (!h || !f || typeof document > "u") return;
36
+ const e = O(y.current), i = (e ?? document).querySelector("header") ?? document.querySelector("header");
36
37
  if (!i) {
37
- I("var(--layout-header-height)");
38
+ w("var(--layout-header-height)");
38
39
  return;
39
40
  }
40
- const d = () => {
41
- const f = e ? e.getBoundingClientRect().top : 0;
42
- I(`${Math.max(0, Math.round(i.getBoundingClientRect().bottom - f))}px`);
41
+ const l = () => {
42
+ const _ = e ? e.getBoundingClientRect().top : 0;
43
+ w(`${Math.max(0, Math.round(i.getBoundingClientRect().bottom - _))}px`);
43
44
  };
44
- d(), window.addEventListener("resize", d);
45
+ l(), window.addEventListener("resize", l);
45
46
  let a;
46
- return typeof ResizeObserver < "u" && (a = new ResizeObserver(d), a.observe(i), e && a.observe(e)), () => {
47
- window.removeEventListener("resize", d), a == null || a.disconnect();
47
+ return typeof ResizeObserver < "u" && (a = new ResizeObserver(l), a.observe(i), e && a.observe(e)), () => {
48
+ window.removeEventListener("resize", l), a == null || a.disconnect();
48
49
  };
49
- }, [h, _]), k(() => {
50
- if (!h || !_ || typeof document > "u") return;
50
+ }, [h, f]), k(() => {
51
+ if (!h || !f || typeof document > "u") return;
51
52
  const { body: e } = document, i = e.style.overflow;
52
53
  return e.style.overflow = "hidden", () => {
53
54
  e.style.overflow = i;
54
55
  };
55
- }, [h, _]);
56
- const o = s[s.length - 1], q = s.length === 1, w = (e) => {
57
- var f;
58
- const i = !!(e.subItems || e.subItemGroups), d = !!(e.href || e.to);
56
+ }, [h, f]);
57
+ const d = s[s.length - 1], q = s.length === 1, I = (e) => {
58
+ var _;
59
+ const i = !!(e.subItems || e.subItemGroups), l = !!(e.href || e.to);
59
60
  if (!i) {
60
61
  v();
61
62
  return;
62
63
  }
63
- const a = ((f = e.subItemGroups) == null ? void 0 : f.flatMap((Q) => Q.subItems)) || e.subItems || [];
64
- p([
64
+ const a = ((_ = e.subItemGroups) == null ? void 0 : _.flatMap((K) => K.subItems)) || e.subItems || [];
65
+ b([
65
66
  ...s,
66
67
  {
67
68
  items: a,
68
69
  parent: e,
69
- renderParentLink: d
70
+ renderParentLink: l
70
71
  }
71
72
  ]);
72
73
  }, D = () => {
73
- p(s.slice(0, -1));
74
+ b(s.slice(0, -1));
74
75
  }, H = () => {
75
- p([s[0]]);
76
- }, $ = ((M = (S = o.parent) == null ? void 0 : S.subItems) == null ? void 0 : M.length) ?? ((x = (R = o.parent) == null ? void 0 : R.subItemGroups) == null ? void 0 : x.length), J = s.length > 1 && !(o.renderParentLink && $), C = (e, i) => i === 1 ? !(e.subItems || e.subItemGroups) ? /* @__PURE__ */ t(
76
+ b([s[0]]);
77
+ }, U = ((S = (M = d.parent) == null ? void 0 : M.subItems) == null ? void 0 : S.length) ?? ((x = (R = d.parent) == null ? void 0 : R.subItemGroups) == null ? void 0 : x.length), $ = s.length > 1 && !(d.renderParentLink && U), C = (e, i) => i === 1 ? !(e.subItems || e.subItemGroups) ? /* @__PURE__ */ t(
77
78
  G,
78
79
  {
79
80
  ...e,
80
- as: r,
81
+ as: o,
81
82
  level: i,
82
83
  onItemClick: v,
83
- className: l(n["tedi-sidenav__item--mobile"], e.className)
84
+ className: c(n["tedi-sidenav__item--mobile"], e.className)
84
85
  }
85
- ) : /* @__PURE__ */ t("li", { className: l(n["tedi-sidenav__item"], n["tedi-sidenav__item--mobile"]), children: /* @__PURE__ */ m("button", { onClick: () => w(e), className: n["tedi-sidenav__link"], children: [
86
+ ) : /* @__PURE__ */ t("li", { className: c(n["tedi-sidenav__item"], n["tedi-sidenav__item--mobile"]), children: /* @__PURE__ */ m("button", { onClick: () => I(e), className: n["tedi-sidenav__link"], children: [
86
87
  e.icon && /* @__PURE__ */ t(
87
- b,
88
+ p,
88
89
  {
89
90
  name: typeof e.icon == "string" ? e.icon : e.icon.name,
90
91
  color: "white",
@@ -92,28 +93,28 @@ const Z = typeof window < "u" ? X : k, A = (c) => {
92
93
  }
93
94
  ),
94
95
  /* @__PURE__ */ t("span", { className: n["tedi-sidenav__title"], children: e.children }),
95
- /* @__PURE__ */ t(b, { name: "expand_more", color: "white", className: n["tedi-sidenav__toggle-icon"] })
96
- ] }) }) : K(e, i), K = (e, i) => {
97
- const d = !!(e.href || e.to), a = !!(e.subItems || e.subItemGroups);
98
- return d ? /* @__PURE__ */ t(
96
+ /* @__PURE__ */ t(p, { name: "expand_more", color: "white", className: n["tedi-sidenav__toggle-icon"] })
97
+ ] }) }) : J(e, i), J = (e, i) => {
98
+ const l = !!(e.href || e.to), a = !!(e.subItems || e.subItemGroups);
99
+ return l ? /* @__PURE__ */ t(
99
100
  G,
100
101
  {
101
102
  ...e,
102
- as: r,
103
+ as: o,
103
104
  level: i,
104
105
  icon: void 0,
105
106
  onItemClick: v,
106
- className: l(n["tedi-sidenav__sub-item"], e.className)
107
+ className: c(n["tedi-sidenav__sub-item"], e.className)
107
108
  }
108
- ) : /* @__PURE__ */ t("li", { className: l(n["tedi-sidenav__item"]), children: /* @__PURE__ */ m(
109
+ ) : /* @__PURE__ */ t("li", { className: c(n["tedi-sidenav__item"]), children: /* @__PURE__ */ m(
109
110
  g,
110
111
  {
111
112
  noStyle: !0,
112
- onClick: () => a ? w(e) : v(),
113
+ onClick: () => a ? I(e) : v(),
113
114
  className: n["tedi-sidenav__link"],
114
115
  children: [
115
116
  /* @__PURE__ */ t("span", { className: n["tedi-sidenav__title"], children: e.children }),
116
- a ? /* @__PURE__ */ t(b, { name: "expand_more", color: "white", className: n["tedi-sidenav__toggle-icon"] }) : null
117
+ a ? /* @__PURE__ */ t(p, { name: "expand_more", color: "white", className: n["tedi-sidenav__toggle-icon"] }) : null
117
118
  ]
118
119
  }
119
120
  ) });
@@ -121,7 +122,7 @@ const Z = typeof window < "u" ? X : k, A = (c) => {
121
122
  "nav",
122
123
  {
123
124
  "data-name": "mobile-sidenav",
124
- className: l(n["tedi-sidenav"], n["tedi-sidenav--mobile"], F),
125
+ className: c(n["tedi-sidenav"], n["tedi-sidenav--mobile"], F),
125
126
  "aria-label": u,
126
127
  id: P,
127
128
  children: [
@@ -131,9 +132,9 @@ const Z = typeof window < "u" ? X : k, A = (c) => {
131
132
  {
132
133
  noStyle: !0,
133
134
  onClick: H,
134
- className: l(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
135
+ className: c(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
135
136
  children: [
136
- /* @__PURE__ */ t(b, { name: "arrow_back", size: 16, color: "white" }),
137
+ /* @__PURE__ */ t(p, { name: "arrow_back", size: 16, color: "white" }),
137
138
  /* @__PURE__ */ t("span", { children: N("sidenav.backToMainMenu") })
138
139
  ]
139
140
  }
@@ -143,24 +144,24 @@ const Z = typeof window < "u" ? X : k, A = (c) => {
143
144
  {
144
145
  noStyle: !0,
145
146
  onClick: D,
146
- className: l(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
147
+ className: c(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
147
148
  children: [
148
- /* @__PURE__ */ t(b, { name: "arrow_back", size: 16, color: "white" }),
149
+ /* @__PURE__ */ t(p, { name: "arrow_back", size: 16, color: "white" }),
149
150
  /* @__PURE__ */ t("span", { children: ((z = (E = s[s.length - 1]) == null ? void 0 : E.parent) == null ? void 0 : z.children) + " " + N("sidenav.backtoMenu") })
150
151
  ]
151
152
  }
152
153
  )
153
154
  ] }) }),
154
- J && /* @__PURE__ */ t("div", { className: l(n["tedi-sidenav__subheading"], n["tedi-sidenav__subheading--mobile"]), children: (B = o.parent) == null ? void 0 : B.children }),
155
+ $ && /* @__PURE__ */ t("div", { className: c(n["tedi-sidenav__subheading"], n["tedi-sidenav__subheading--mobile"]), children: (B = d.parent) == null ? void 0 : B.children }),
155
156
  /* @__PURE__ */ m("ul", { className: n["tedi-sidenav__list"], children: [
156
- o.renderParentLink && o.parent && /* @__PURE__ */ t("li", { className: n["tedi-sidenav__list-item"], children: /* @__PURE__ */ t("div", { className: l(n["tedi-sidenav__collapse"]), children: C(o.parent, s.length) }) }),
157
- !o.renderParentLink && o.items.map((e, i) => /* @__PURE__ */ t(V.Fragment, { children: C(e, s.length) }, e.id || i))
157
+ d.renderParentLink && d.parent && /* @__PURE__ */ t("li", { className: n["tedi-sidenav__list-item"], children: /* @__PURE__ */ t("div", { className: c(n["tedi-sidenav__collapse"]), children: C(d.parent, s.length) }) }),
158
+ !d.renderParentLink && d.items.map((e, i) => /* @__PURE__ */ t(V.Fragment, { children: C(e, s.length) }, e.id || i))
158
159
  ] })
159
160
  ]
160
161
  }
161
162
  );
162
- return h ? _ ? /* @__PURE__ */ t(
163
- U,
163
+ return h ? f ? /* @__PURE__ */ t(
164
+ Q,
164
165
  {
165
166
  ref: y,
166
167
  style: { top: j },
@@ -171,8 +172,8 @@ const Z = typeof window < "u" ? X : k, A = (c) => {
171
172
  children: L
172
173
  }
173
174
  ) : L : null;
174
- }, le = O;
175
+ }, ue = (r) => (Y("SideNavMobile", "Use `MobileNav` (same component, vendor-neutral name)."), /* @__PURE__ */ t(ee, { ...r }));
175
176
  export {
176
- O as MobileNav,
177
- le as SideNavMobile
177
+ ee as MobileNav,
178
+ ue as SideNavMobile
178
179
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),i=new Set,o=(e,r)=>{process.env.NODE_ENV==="production"||i.has(e)||(i.add(e),console.warn(`[TEDI] ${e} is deprecated. ${r}`))},u=(e,r,d)=>{const t=c.forwardRef((n,a)=>(o(r,d),c.createElement(e,a?{...n,ref:a}:n))),{displayName:s,name:p}=e;return t.displayName=s??p,t};exports.warnDeprecated=o;exports.withDeprecationWarning=u;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * Logs a deprecation warning once per component, outside production builds only.
4
+ * @internal
5
+ */
6
+ export declare const warnDeprecated: (name: string, message: string) => void;
7
+ /**
8
+ * Wraps a deprecated component so only the public export warns. Library code that renders the
9
+ * component imports the unwrapped one, so consumers are not warned about components they never used.
10
+ * @internal
11
+ */
12
+ export declare const withDeprecationWarning: <T extends React.ElementType>(Component: T, name: string, message: string) => T;
@@ -0,0 +1,11 @@
1
+ import c from "react";
2
+ const d = /* @__PURE__ */ new Set(), p = (e, r) => {
3
+ process.env.NODE_ENV === "production" || d.has(e) || (d.add(e), console.warn(`[TEDI] ${e} is deprecated. ${r}`));
4
+ }, f = (e, r, o) => {
5
+ const t = c.forwardRef((a, n) => (p(r, o), c.createElement(e, n ? { ...a, ref: n } : a))), { displayName: s, name: i } = e;
6
+ return t.displayName = s ?? i, t;
7
+ };
8
+ export {
9
+ p as warnDeprecated,
10
+ f as withDeprecationWarning
11
+ };