@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.
- package/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +215 -230
- package/external/@mui/x-date-pickers/DatePicker/shared.es.js +1 -1
- package/external/@mui/x-date-pickers/DateTimePicker/shared.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/community/components/accordion/accordion.cjs.js +1 -1
- package/src/community/components/accordion/accordion.es.js +14 -9
- package/src/community/components/card/card-notification/card-notification.cjs.js +1 -1
- package/src/community/components/card/card-notification/card-notification.es.js +10 -8
- package/src/community/components/dropdown/dropdown.cjs.js +1 -1
- package/src/community/components/dropdown/dropdown.es.js +34 -32
- package/src/community/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/community/components/form/file-upload/file-upload.es.js +43 -41
- package/src/community/components/form/pickers/calendar/calendar.cjs.js +1 -1
- package/src/community/components/form/pickers/calendar/calendar.es.js +41 -39
- package/src/community/components/form/pickers/timepicker/timepicker.cjs.js +1 -1
- package/src/community/components/form/pickers/timepicker/timepicker.es.js +33 -31
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +30 -28
- package/src/community/components/map-components/carousel/carousel.cjs.js +1 -1
- package/src/community/components/map-components/carousel/carousel.es.js +19 -17
- package/src/community/components/status/status.cjs.js +1 -1
- package/src/community/components/status/status.es.js +14 -12
- package/src/community/components/stepper/stepper.cjs.js +1 -1
- package/src/community/components/stepper/stepper.es.js +33 -31
- package/src/community/components/table/table.cjs.js +1 -1
- package/src/community/components/table/table.es.js +9 -9
- package/src/community/components/table-of-contents/table-of-contents.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents.es.js +21 -19
- package/src/community/components/tabs/tabs/tabs.cjs.js +1 -1
- package/src/community/components/tabs/tabs/tabs.es.js +29 -27
- package/src/community/components/vertical-stepper/vertical-stepper.cjs.js +1 -1
- package/src/community/components/vertical-stepper/vertical-stepper.es.js +8 -6
- package/src/community/deprecated-exports.cjs.js +1 -0
- package/src/community/deprecated-exports.d.ts +19 -0
- package/src/community/deprecated-exports.es.js +112 -0
- package/src/community/index.d.ts +1 -0
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/components/mobile-nav-toggle/mobile-nav-toggle.es.js +28 -27
- package/src/tedi/components/layout/mobile-nav/mobile-nav.cjs.js +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.d.ts +1 -1
- package/src/tedi/components/layout/mobile-nav/mobile-nav.es.js +64 -63
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.cjs.js +1 -0
- package/src/tedi/helpers/warn-deprecated/warn-deprecated.d.ts +12 -0
- 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
|
|
3
|
-
import
|
|
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 {
|
|
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
|
|
10
|
-
const
|
|
11
|
-
let u = (
|
|
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
|
|
14
|
-
if (
|
|
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
|
-
},
|
|
20
|
-
navItems:
|
|
20
|
+
}, ee = ({
|
|
21
|
+
navItems: r,
|
|
21
22
|
ariaLabel: u,
|
|
22
|
-
linkAs:
|
|
23
|
+
linkAs: o,
|
|
23
24
|
isOpen: h,
|
|
24
25
|
onClose: v,
|
|
25
|
-
showOverlay:
|
|
26
|
+
showOverlay: f = !0,
|
|
26
27
|
id: P,
|
|
27
28
|
className: F
|
|
28
29
|
}) => {
|
|
29
|
-
var
|
|
30
|
-
const { getLabel: N } =
|
|
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
|
-
|
|
33
|
-
}, [
|
|
34
|
-
if (!h || !
|
|
35
|
-
const e =
|
|
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
|
-
|
|
38
|
+
w("var(--layout-header-height)");
|
|
38
39
|
return;
|
|
39
40
|
}
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const l = () => {
|
|
42
|
+
const _ = e ? e.getBoundingClientRect().top : 0;
|
|
43
|
+
w(`${Math.max(0, Math.round(i.getBoundingClientRect().bottom - _))}px`);
|
|
43
44
|
};
|
|
44
|
-
|
|
45
|
+
l(), window.addEventListener("resize", l);
|
|
45
46
|
let a;
|
|
46
|
-
return typeof ResizeObserver < "u" && (a = new ResizeObserver(
|
|
47
|
-
window.removeEventListener("resize",
|
|
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,
|
|
50
|
-
if (!h || !
|
|
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
|
|
57
|
-
var
|
|
58
|
-
const i = !!(e.subItems || e.subItemGroups),
|
|
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 = ((
|
|
64
|
-
|
|
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:
|
|
70
|
+
renderParentLink: l
|
|
70
71
|
}
|
|
71
72
|
]);
|
|
72
73
|
}, D = () => {
|
|
73
|
-
|
|
74
|
+
b(s.slice(0, -1));
|
|
74
75
|
}, H = () => {
|
|
75
|
-
|
|
76
|
-
},
|
|
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:
|
|
81
|
+
as: o,
|
|
81
82
|
level: i,
|
|
82
83
|
onItemClick: v,
|
|
83
|
-
className:
|
|
84
|
+
className: c(n["tedi-sidenav__item--mobile"], e.className)
|
|
84
85
|
}
|
|
85
|
-
) : /* @__PURE__ */ t("li", { className:
|
|
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
|
-
|
|
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(
|
|
96
|
-
] }) }) :
|
|
97
|
-
const
|
|
98
|
-
return
|
|
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:
|
|
103
|
+
as: o,
|
|
103
104
|
level: i,
|
|
104
105
|
icon: void 0,
|
|
105
106
|
onItemClick: v,
|
|
106
|
-
className:
|
|
107
|
+
className: c(n["tedi-sidenav__sub-item"], e.className)
|
|
107
108
|
}
|
|
108
|
-
) : /* @__PURE__ */ t("li", { className:
|
|
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 ?
|
|
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(
|
|
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:
|
|
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:
|
|
135
|
+
className: c(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
|
|
135
136
|
children: [
|
|
136
|
-
/* @__PURE__ */ t(
|
|
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:
|
|
147
|
+
className: c(n["tedi-sidenav__link"], n["tedi-sidenav__back-button"]),
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */ t(
|
|
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
|
-
|
|
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
|
-
|
|
157
|
-
!
|
|
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 ?
|
|
163
|
-
|
|
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
|
-
},
|
|
175
|
+
}, ue = (r) => (Y("SideNavMobile", "Use `MobileNav` (same component, vendor-neutral name)."), /* @__PURE__ */ t(ee, { ...r }));
|
|
175
176
|
export {
|
|
176
|
-
|
|
177
|
-
|
|
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
|
+
};
|