@tedi-design-system/react 14.4.0-rc.1 → 14.4.0-rc.11
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/README.md +30 -14
- package/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +4 -2
- package/_virtual/index.es5.js +2 -4
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +18 -8
- package/src/tedi/components/buttons/collapse/collapse.es.js +91 -67
- package/src/tedi/components/buttons/collapse/collapse.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.module.scss.es.js +9 -2
- package/src/tedi/components/buttons/info-button/info-button.cjs.js +1 -1
- package/src/tedi/components/buttons/info-button/info-button.d.ts +5 -1
- package/src/tedi/components/buttons/info-button/info-button.es.js +14 -14
- package/src/tedi/components/content/label/label.cjs.js +1 -1
- package/src/tedi/components/content/label/label.es.js +24 -23
- package/src/tedi/components/form/checkbox/checkbox.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.es.js +40 -40
- package/src/tedi/components/form/file-dropzone/file-dropzone.cjs.js +1 -1
- package/src/tedi/components/form/file-dropzone/file-dropzone.es.js +69 -59
- package/src/tedi/components/form/file-dropzone/file-dropzone.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/file-dropzone/file-dropzone.module.scss.es.js +1 -0
- package/src/tedi/components/form/file-upload/file-upload.cjs.js +1 -1
- package/src/tedi/components/form/file-upload/file-upload.es.js +109 -90
- package/src/tedi/components/form/file-upload/file-upload.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/file-upload/file-upload.module.scss.es.js +3 -1
- package/src/tedi/components/form/search/search.cjs.js +1 -1
- package/src/tedi/components/form/search/search.d.ts +5 -0
- package/src/tedi/components/form/search/search.es.js +30 -28
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.es.js +134 -131
- package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.es.js +58 -45
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-item/sidenav-item.es.js +126 -104
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.cjs.js +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.d.ts +1 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-toggle/sidenav-toggle.es.js +20 -17
- package/src/tedi/components/layout/sidenav/sidenav.d.ts +1 -9
- package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-content.d.ts +27 -2
- package/src/tedi/components/overlays/overlay/overlay-content.es.js +37 -34
- package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay.es.js +72 -71
- package/src/tedi/components/overlays/popover/popover-content.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover-content.es.js +31 -29
- package/src/tedi/components/overlays/popover/popover.cjs.js +1 -1
- package/src/tedi/components/overlays/popover/popover.es.js +1 -0
- package/src/tedi/helpers/hooks/use-file-upload.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-file-upload.d.ts +6 -0
- package/src/tedi/helpers/hooks/use-file-upload.es.js +67 -50
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +72 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +70 -4
- package/src/tedi/providers/theme-provider/theme-provider.cjs.js +1 -1
- package/src/tedi/providers/theme-provider/theme-provider.d.ts +1 -2
- package/src/tedi/providers/theme-provider/theme-provider.es.js +26 -17
|
@@ -1,159 +1,181 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { Icon as
|
|
5
|
-
import { Collapse as
|
|
6
|
-
import { Link as
|
|
1
|
+
import { jsx as s, jsxs as l, Fragment as M } from "react/jsx-runtime";
|
|
2
|
+
import Q, { useState as O, createElement as R } from "react";
|
|
3
|
+
import o from "../../../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { Icon as P } from "../../../../base/icon/icon.es.js";
|
|
5
|
+
import { Collapse as B } from "../../../../buttons/collapse/collapse.es.js";
|
|
6
|
+
import { Link as w } from "../../../../navigation/link/link.es.js";
|
|
7
7
|
import e from "../../sidenav.module.scss.es.js";
|
|
8
|
-
import { SideNavDropdown as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
|
|
8
|
+
import { SideNavDropdown as U } from "../sidenav-dropdown/sidenav-dropdown.es.js";
|
|
9
|
+
import { Tooltip as f } from "../../../../overlays/tooltip/tooltip.es.js";
|
|
10
|
+
import { useLabels as V } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
11
|
+
const X = (j) => {
|
|
11
12
|
const {
|
|
12
|
-
icon:
|
|
13
|
-
children:
|
|
14
|
-
isActive:
|
|
15
|
-
onClick:
|
|
16
|
-
subItems:
|
|
17
|
-
subItemGroups:
|
|
18
|
-
as:
|
|
19
|
-
onItemClick:
|
|
20
|
-
className:
|
|
21
|
-
level:
|
|
22
|
-
isCollapsed:
|
|
23
|
-
isDefaultOpen:
|
|
24
|
-
sideNavItemSize:
|
|
25
|
-
...
|
|
26
|
-
} =
|
|
13
|
+
icon: i,
|
|
14
|
+
children: n,
|
|
15
|
+
isActive: b,
|
|
16
|
+
onClick: I,
|
|
17
|
+
subItems: y,
|
|
18
|
+
subItemGroups: z,
|
|
19
|
+
as: S,
|
|
20
|
+
onItemClick: h,
|
|
21
|
+
className: H,
|
|
22
|
+
level: c = 1,
|
|
23
|
+
isCollapsed: m = !1,
|
|
24
|
+
isDefaultOpen: K = !1,
|
|
25
|
+
sideNavItemSize: $ = "default",
|
|
26
|
+
..._
|
|
27
|
+
} = j, { getLabel: T } = V(), [d, D] = O(K ?? !1), [L, A] = O(!1), u = Q.useId(), p = z ?? (y ? [{ subItems: y }] : null), r = !!p, F = o(
|
|
27
28
|
e["tedi-sidenav__item"],
|
|
28
|
-
e[`tedi-sidenav__item--${
|
|
29
|
+
e[`tedi-sidenav__item--${$}`],
|
|
29
30
|
{
|
|
30
|
-
[e[`tedi-sidenav__item--level-${
|
|
31
|
-
[e["tedi-sidenav__item--current"]]:
|
|
32
|
-
[e["tedi-sidenav__item--has-children"]]:
|
|
31
|
+
[e[`tedi-sidenav__item--level-${c}`]]: c > 1,
|
|
32
|
+
[e["tedi-sidenav__item--current"]]: b,
|
|
33
|
+
[e["tedi-sidenav__item--has-children"]]: r
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
-
),
|
|
36
|
-
const
|
|
35
|
+
H
|
|
36
|
+
), v = (a) => {
|
|
37
|
+
const t = {
|
|
37
38
|
color: "white",
|
|
38
|
-
className:
|
|
39
|
-
},
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
className:
|
|
39
|
+
className: o(e["tedi-sidenav__icon"])
|
|
40
|
+
}, N = typeof a == "string" ? { ...t, name: a } : {
|
|
41
|
+
...t,
|
|
42
|
+
...a,
|
|
43
|
+
className: o(t.className, a == null ? void 0 : a.className)
|
|
43
44
|
};
|
|
44
|
-
return /* @__PURE__ */ s(
|
|
45
|
-
}, G = (
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
}, W =
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
return /* @__PURE__ */ s(P, { ...N });
|
|
46
|
+
}, G = (a) => {
|
|
47
|
+
I == null || I(a), r || h == null || h();
|
|
48
|
+
}, k = (a) => {
|
|
49
|
+
D(a);
|
|
50
|
+
}, W = (a) => {
|
|
51
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), D((g) => {
|
|
52
|
+
const t = !g;
|
|
53
|
+
return k(t), t;
|
|
54
|
+
}));
|
|
55
|
+
}, q = r && (_.href || _.to), C = {
|
|
56
|
+
..._,
|
|
57
|
+
as: S,
|
|
52
58
|
onClick: G,
|
|
53
|
-
className:
|
|
59
|
+
className: o(e["tedi-sidenav__link"], q && e["tedi-sidenav__link--has-children-link"]),
|
|
54
60
|
noStyle: !0,
|
|
55
61
|
role: "menuitem",
|
|
56
|
-
"aria-current":
|
|
57
|
-
"aria-label":
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
"aria-current": b ? "page" : void 0,
|
|
63
|
+
"aria-label": m && typeof n == "string" ? n : void 0,
|
|
64
|
+
...r ? {
|
|
65
|
+
"aria-haspopup": "true",
|
|
66
|
+
"aria-expanded": d,
|
|
67
|
+
"aria-controls": u
|
|
68
|
+
} : {}
|
|
69
|
+
}, x = () => !m && (p == null ? void 0 : p.map((a, g) => {
|
|
70
|
+
var t;
|
|
71
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
72
|
+
(a == null ? void 0 : a.subHeading) && /* @__PURE__ */ s("div", { className: e["tedi-sidenav__subheading"], children: a.subHeading }),
|
|
73
|
+
/* @__PURE__ */ s("ul", { className: e["tedi-sidenav__list"], role: "menu", children: (t = a.subItems) == null ? void 0 : t.map((N, J) => /* @__PURE__ */ R(
|
|
74
|
+
X,
|
|
64
75
|
{
|
|
65
|
-
as:
|
|
66
|
-
...
|
|
67
|
-
key:
|
|
68
|
-
level:
|
|
69
|
-
onItemClick:
|
|
70
|
-
isCollapsed:
|
|
71
|
-
className:
|
|
76
|
+
as: S,
|
|
77
|
+
...N,
|
|
78
|
+
key: J,
|
|
79
|
+
level: c + 1,
|
|
80
|
+
onItemClick: h,
|
|
81
|
+
isCollapsed: m,
|
|
82
|
+
className: o(e["tedi-sidenav__sub-item"], N.className)
|
|
72
83
|
}
|
|
73
84
|
)) })
|
|
74
|
-
] },
|
|
75
|
-
})),
|
|
76
|
-
|
|
85
|
+
] }, g);
|
|
86
|
+
})), E = /* @__PURE__ */ s("li", { "data-name": "sidenav-item", className: F, children: r && m ? /* @__PURE__ */ s(
|
|
87
|
+
U,
|
|
77
88
|
{
|
|
78
|
-
trigger: /* @__PURE__ */ s(
|
|
89
|
+
trigger: /* @__PURE__ */ s(f.Trigger, { children: /* @__PURE__ */ l(
|
|
79
90
|
"span",
|
|
80
91
|
{
|
|
81
|
-
className:
|
|
92
|
+
className: o(e["tedi-sidenav__link"], L && e["tedi-sidenav__link--active"]),
|
|
82
93
|
children: [
|
|
83
|
-
|
|
94
|
+
i && v(i),
|
|
84
95
|
/* @__PURE__ */ s(
|
|
85
|
-
|
|
96
|
+
P,
|
|
86
97
|
{
|
|
87
|
-
name:
|
|
98
|
+
name: L ? "chevron_right" : "expand_more",
|
|
88
99
|
color: "white",
|
|
89
100
|
className: e["tedi-sidenav__toggle-icon"],
|
|
90
101
|
size: 18
|
|
91
102
|
}
|
|
92
103
|
),
|
|
93
|
-
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children:
|
|
104
|
+
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
94
105
|
]
|
|
95
106
|
}
|
|
96
107
|
) }),
|
|
97
|
-
groups:
|
|
108
|
+
groups: p,
|
|
98
109
|
onOpenChange: A
|
|
99
110
|
}
|
|
100
|
-
) :
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children:
|
|
111
|
+
) : r && c === 1 ? _.href || _.to ? /* @__PURE__ */ l(M, { children: [
|
|
112
|
+
/* @__PURE__ */ l(w, { ...C, children: [
|
|
113
|
+
i && v(i),
|
|
114
|
+
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
104
115
|
] }),
|
|
105
116
|
/* @__PURE__ */ s("div", { className: e["tedi-sidenav__link-collapse-wrapper"], children: /* @__PURE__ */ s(
|
|
106
|
-
|
|
117
|
+
B,
|
|
107
118
|
{
|
|
108
|
-
id:
|
|
119
|
+
id: u,
|
|
109
120
|
hideCollapseText: !0,
|
|
110
|
-
open:
|
|
111
|
-
onToggle:
|
|
121
|
+
open: d,
|
|
122
|
+
onToggle: k,
|
|
123
|
+
toggleLabel: T("sidenav.toggleSubmenuChildren", {
|
|
124
|
+
isCollapsedInternal: d,
|
|
125
|
+
children: n
|
|
126
|
+
}),
|
|
112
127
|
className: e["tedi-sidenav__collapse"],
|
|
113
|
-
children:
|
|
128
|
+
children: x()
|
|
114
129
|
}
|
|
115
130
|
) })
|
|
116
131
|
] }) : /* @__PURE__ */ s(
|
|
117
|
-
|
|
132
|
+
B,
|
|
118
133
|
{
|
|
119
|
-
id:
|
|
134
|
+
id: u,
|
|
120
135
|
hideCollapseText: !0,
|
|
121
|
-
open:
|
|
122
|
-
onToggle:
|
|
136
|
+
open: d,
|
|
137
|
+
onToggle: k,
|
|
123
138
|
className: e["tedi-sidenav__collapse"],
|
|
124
|
-
|
|
139
|
+
toggleLabel: T("sidenav.toggleSubmenuChildren", {
|
|
140
|
+
isCollapsedInternal: d,
|
|
141
|
+
children: n
|
|
142
|
+
}),
|
|
143
|
+
title: /* @__PURE__ */ l(
|
|
125
144
|
"span",
|
|
126
145
|
{
|
|
127
|
-
className:
|
|
146
|
+
className: o(
|
|
128
147
|
e["tedi-sidenav__link"],
|
|
129
|
-
|
|
148
|
+
d && e["tedi-sidenav__link--active"]
|
|
130
149
|
),
|
|
131
|
-
role: "
|
|
132
|
-
"aria-
|
|
150
|
+
role: "button",
|
|
151
|
+
"aria-expanded": d,
|
|
152
|
+
"aria-controls": u,
|
|
153
|
+
"aria-current": b ? "page" : void 0,
|
|
154
|
+
onKeyDown: W,
|
|
133
155
|
children: [
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children:
|
|
156
|
+
i && v(i),
|
|
157
|
+
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
136
158
|
]
|
|
137
159
|
}
|
|
138
160
|
),
|
|
139
|
-
children:
|
|
161
|
+
children: x()
|
|
140
162
|
}
|
|
141
|
-
) :
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children:
|
|
163
|
+
) : r ? /* @__PURE__ */ l(M, { children: [
|
|
164
|
+
/* @__PURE__ */ l(w, { ...C, children: [
|
|
165
|
+
i && v(i),
|
|
166
|
+
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n }),
|
|
145
167
|
/* @__PURE__ */ s("i", { className: e["tedi-sidenav__bullet"] })
|
|
146
168
|
] }),
|
|
147
|
-
|
|
148
|
-
] }) : /* @__PURE__ */ s(
|
|
149
|
-
|
|
150
|
-
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children:
|
|
169
|
+
x()
|
|
170
|
+
] }) : /* @__PURE__ */ s(f.Trigger, { children: /* @__PURE__ */ l(w, { ...C, children: [
|
|
171
|
+
i && v(i),
|
|
172
|
+
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
151
173
|
] }) }) });
|
|
152
|
-
return
|
|
153
|
-
/* @__PURE__ */ s(
|
|
154
|
-
|
|
155
|
-
] }) :
|
|
174
|
+
return c === 1 && m ? /* @__PURE__ */ l(f, { placement: "right", focusManager: { order: ["content"] }, children: [
|
|
175
|
+
/* @__PURE__ */ s(f.Content, { maxWidth: "medium", children: n }),
|
|
176
|
+
E
|
|
177
|
+
] }) : E;
|
|
156
178
|
};
|
|
157
179
|
export {
|
|
158
|
-
|
|
180
|
+
X as SideNavItem
|
|
159
181
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("react/jsx-runtime"),p=require("../../../../../../../external/classnames/index.cjs.js"),b=require("../../../../buttons/button/button.cjs.js"),_=require("../../../../buttons/floating-button/floating-button.cjs.js"),o=require("./sidenav-toggle.module.scss.cjs.js"),y=require("../../../../../providers/label-provider/use-labels.cjs.js"),i=({menuOpen:l,toggleMenu:s,referenceRef:n,getReferenceProps:a=()=>({}),variant:e="mobile"})=>{const{getLabel:c}=y.useLabels(),d=c("header.toggle",l),u=p.default(o.default["tedi-sidenav-toggle"],{[o.default["tedi-sidenav-toggle--open"]]:l,[o.default[`tedi-sidenav-toggle--${e}`]]:!0}),r=e==="collapse"?_.FloatingButton:b.Button,g=t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),s(!l))};return f.jsx(r,{...a(),ref:n,icon:{name:e==="collapse"?l?"right_panel_open":"left_panel_open":l?"close":"menu",className:o.default["tedi-sidenav-toggle__icon"],size:e==="collapse"?18:24},visualType:e==="collapse"?"secondary":"primary",className:u,onClick:()=>s(!l),onKeyDown:g,position:e==="collapse"?"absolute":"static",size:e==="collapse"?"small":"",children:d})};exports.SidenavToggle=i;exports.default=i;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { UnknownType } from '
|
|
2
|
+
import { UnknownType } from '../../../../../types/commonTypes';
|
|
3
3
|
export type SidenavToggleVariant = 'mobile' | 'collapse';
|
|
4
4
|
export type SidenavToggleProps = {
|
|
5
5
|
/**
|
|
@@ -1,36 +1,39 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { FloatingButton as
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import d from "../../../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { Button as f } from "../../../../buttons/button/button.es.js";
|
|
4
|
+
import { FloatingButton as y } from "../../../../buttons/floating-button/floating-button.es.js";
|
|
5
5
|
import l from "./sidenav-toggle.module.scss.es.js";
|
|
6
|
-
import { useLabels as
|
|
6
|
+
import { useLabels as _ } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
7
7
|
const E = ({
|
|
8
8
|
menuOpen: o,
|
|
9
|
-
toggleMenu:
|
|
10
|
-
referenceRef:
|
|
11
|
-
getReferenceProps:
|
|
9
|
+
toggleMenu: t,
|
|
10
|
+
referenceRef: i,
|
|
11
|
+
getReferenceProps: a = () => ({}),
|
|
12
12
|
variant: e = "mobile"
|
|
13
13
|
}) => {
|
|
14
|
-
const { getLabel:
|
|
14
|
+
const { getLabel: c } = _(), r = c("header.toggle", o), n = d(l["tedi-sidenav-toggle"], {
|
|
15
15
|
[l["tedi-sidenav-toggle--open"]]: o,
|
|
16
16
|
[l[`tedi-sidenav-toggle--${e}`]]: !0
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
}), p = e === "collapse" ? y : f, m = (s) => {
|
|
18
|
+
(s.key === "Enter" || s.key === " ") && (s.preventDefault(), t(!o));
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ g(
|
|
21
|
+
p,
|
|
20
22
|
{
|
|
21
|
-
...
|
|
22
|
-
ref:
|
|
23
|
+
...a(),
|
|
24
|
+
ref: i,
|
|
23
25
|
icon: {
|
|
24
26
|
name: e === "collapse" ? o ? "right_panel_open" : "left_panel_open" : o ? "close" : "menu",
|
|
25
27
|
className: l["tedi-sidenav-toggle__icon"],
|
|
26
28
|
size: e === "collapse" ? 18 : 24
|
|
27
29
|
},
|
|
28
30
|
visualType: e === "collapse" ? "secondary" : "primary",
|
|
29
|
-
className:
|
|
30
|
-
onClick:
|
|
31
|
+
className: n,
|
|
32
|
+
onClick: () => t(!o),
|
|
33
|
+
onKeyDown: m,
|
|
31
34
|
position: e === "collapse" ? "absolute" : "static",
|
|
32
35
|
size: e === "collapse" ? "small" : "",
|
|
33
|
-
children:
|
|
36
|
+
children: r
|
|
34
37
|
}
|
|
35
38
|
);
|
|
36
39
|
};
|
|
@@ -84,15 +84,7 @@ export declare const SideNav: (<C extends React.ElementType = "a">(props: SideNa
|
|
|
84
84
|
Item: <C extends React.ElementType = "a">(props: SideNavItemProps<C> & {
|
|
85
85
|
onItemClick?: () => void;
|
|
86
86
|
level?: number;
|
|
87
|
-
isCollapsed
|
|
88
|
-
/**
|
|
89
|
-
* Show dividers between navigation items
|
|
90
|
-
* @default true
|
|
91
|
-
*/
|
|
92
|
-
? /**
|
|
93
|
-
* Show dividers between navigation items
|
|
94
|
-
* @default true
|
|
95
|
-
*/: boolean;
|
|
87
|
+
isCollapsed?: boolean;
|
|
96
88
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
97
89
|
Dropdown: <C extends React.ElementType = "a">({ trigger, groups, onOpenChange, }: {
|
|
98
90
|
trigger: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),r=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),d=require("react"),p=require("./overlay.cjs.js"),j=s=>{const{children:u,classNames:e,labelledBy:y,describedBy:f}=s,{open:n,x:m,y:h,strategy:g,focusManager:o,floating:b,arrowRef:v,getFloatingProps:x,placement:w,context:i,arrow:t,scrollLock:a}=d.useContext(p.OverlayContext);return d.useEffect(()=>{a&&(n?(document.documentElement.style.overflow="hidden",document.documentElement.scrollHeight>window.innerHeight&&(document.body.style.overflow="scroll")):(document.documentElement.style.overflow="",document.body.style.overflow=""))},[n,a]),n?l.jsx(r.FloatingPortal,{children:l.jsx(r.FloatingFocusManager,{modal:(o==null?void 0:o.modal)||!1,...o,context:i,children:l.jsxs("div",{...x({ref:b,tabIndex:-1,"aria-labelledby":y,"aria-describedby":f,style:{position:g,left:m,top:h},className:e==null?void 0:e.content}),"data-placement":w,"data-testid":"overlay-content",children:[l.jsx(r.FloatingArrow,{ref:c=>v.current=c,context:i,className:e==null?void 0:e.arrow,height:t==null?void 0:t.height,width:t==null?void 0:t.width,"data-testid":"overlay-arrow"}),u]})})}):null};exports.OverlayContent=j;
|
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface OverlayContentProps {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Overlay content.
|
|
5
|
+
* Can contain any valid React nodes (text, elements, components).
|
|
5
6
|
*/
|
|
6
7
|
children: ReactNode | ReactNode[];
|
|
7
8
|
/**
|
|
8
|
-
* Additional class names.
|
|
9
|
+
* Additional class names for styling overlay elements.
|
|
9
10
|
*/
|
|
10
11
|
classNames?: {
|
|
12
|
+
/**
|
|
13
|
+
* Class name applied to the floating content container.
|
|
14
|
+
*/
|
|
11
15
|
content: string;
|
|
16
|
+
/**
|
|
17
|
+
* Class name applied to the overlay arrow element.
|
|
18
|
+
*/
|
|
12
19
|
arrow: string;
|
|
13
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* ID of the element that labels the overlay content.
|
|
23
|
+
*
|
|
24
|
+
* This is used to set the `aria-labelledby` attribute on the overlay container,
|
|
25
|
+
* providing an accessible name for screen readers.
|
|
26
|
+
*
|
|
27
|
+
* Typically points to a heading element inside the overlay (e.g. a title).
|
|
28
|
+
*/
|
|
29
|
+
labelledBy?: string;
|
|
30
|
+
/**
|
|
31
|
+
* ID of the element that describes the overlay content.
|
|
32
|
+
*
|
|
33
|
+
* This is used to set the `aria-describedby` attribute on the overlay container,
|
|
34
|
+
* allowing screen readers to announce additional descriptive text.
|
|
35
|
+
*
|
|
36
|
+
* Useful for longer explanations or supporting content that complements the title.
|
|
37
|
+
*/
|
|
38
|
+
describedBy?: string;
|
|
14
39
|
}
|
|
15
40
|
export declare const OverlayContent: (props: OverlayContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { FloatingPortal as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { OverlayContext as
|
|
5
|
-
const
|
|
6
|
-
const { children:
|
|
7
|
-
open:
|
|
8
|
-
x:
|
|
9
|
-
y
|
|
10
|
-
strategy:
|
|
1
|
+
import { jsx as n, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { FloatingPortal as w, FloatingFocusManager as x, FloatingArrow as F } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import { useContext as E, useEffect as C } from "react";
|
|
4
|
+
import { OverlayContext as j } from "./overlay.es.js";
|
|
5
|
+
const S = (a) => {
|
|
6
|
+
const { children: c, classNames: e, labelledBy: s, describedBy: m } = a, {
|
|
7
|
+
open: l,
|
|
8
|
+
x: f,
|
|
9
|
+
y,
|
|
10
|
+
strategy: h,
|
|
11
11
|
focusManager: o,
|
|
12
|
-
floating:
|
|
13
|
-
arrowRef:
|
|
14
|
-
getFloatingProps:
|
|
15
|
-
placement:
|
|
12
|
+
floating: u,
|
|
13
|
+
arrowRef: b,
|
|
14
|
+
getFloatingProps: g,
|
|
15
|
+
placement: p,
|
|
16
16
|
context: r,
|
|
17
|
-
arrow:
|
|
17
|
+
arrow: t,
|
|
18
18
|
scrollLock: i
|
|
19
|
-
} =
|
|
20
|
-
return
|
|
21
|
-
i && (
|
|
22
|
-
}, [
|
|
19
|
+
} = E(j);
|
|
20
|
+
return C(() => {
|
|
21
|
+
i && (l ? (document.documentElement.style.overflow = "hidden", document.documentElement.scrollHeight > window.innerHeight && (document.body.style.overflow = "scroll")) : (document.documentElement.style.overflow = "", document.body.style.overflow = ""));
|
|
22
|
+
}, [l, i]), l ? /* @__PURE__ */ n(w, { children: /* @__PURE__ */ n(x, { modal: (o == null ? void 0 : o.modal) || !1, ...o, context: r, children: /* @__PURE__ */ v(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
-
...
|
|
26
|
-
ref:
|
|
25
|
+
...g({
|
|
26
|
+
ref: u,
|
|
27
|
+
tabIndex: -1,
|
|
28
|
+
"aria-labelledby": s,
|
|
29
|
+
"aria-describedby": m,
|
|
27
30
|
style: {
|
|
28
|
-
position:
|
|
29
|
-
left:
|
|
30
|
-
top:
|
|
31
|
+
position: h,
|
|
32
|
+
left: f,
|
|
33
|
+
top: y
|
|
31
34
|
},
|
|
32
|
-
className:
|
|
35
|
+
className: e == null ? void 0 : e.content
|
|
33
36
|
}),
|
|
34
|
-
"data-placement":
|
|
37
|
+
"data-placement": p,
|
|
35
38
|
"data-testid": "overlay-content",
|
|
36
39
|
children: [
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
40
|
+
/* @__PURE__ */ n(
|
|
41
|
+
F,
|
|
39
42
|
{
|
|
40
|
-
ref: (
|
|
43
|
+
ref: (d) => b.current = d,
|
|
41
44
|
context: r,
|
|
42
|
-
className:
|
|
43
|
-
height:
|
|
44
|
-
width:
|
|
45
|
+
className: e == null ? void 0 : e.arrow,
|
|
46
|
+
height: t == null ? void 0 : t.height,
|
|
47
|
+
width: t == null ? void 0 : t.width,
|
|
45
48
|
"data-testid": "overlay-arrow"
|
|
46
49
|
}
|
|
47
50
|
),
|
|
48
|
-
|
|
51
|
+
c
|
|
49
52
|
]
|
|
50
53
|
}
|
|
51
54
|
) }) }) : null;
|
|
52
55
|
};
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
S as OverlayContent
|
|
55
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("react/jsx-runtime"),t=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),s=require("react"),G=require("./overlay-content.cjs.js"),H=require("./overlay-trigger.cjs.js"),z=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),a=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),B=require("../../../helpers/hooks/use-is-touch-device.cjs.js"),J=require("../../../helpers/hooks/use-is-mounted.cjs.js"),K=3,M=s.createContext({open:!1,onOpenChange:()=>{},isMounted:!1,openWith:"hover",reference:()=>{},floating:()=>{},focusManager:{},arrowRef:{current:null},x:0,y:0,strategy:"absolute",getReferenceProps:()=>({}),getFloatingProps:()=>({}),arrow:{width:0,height:0,x:0,y:0,centerOffset:0},placement:"top",context:{},scrollLock:void 0}),c=x=>{const C=B.useIsTouchDevice(),{children:q,placement:w="top",openWith:i=C?"click":"hover",defaultOpen:F=!1,open:r,onToggle:o,role:P="tooltip",arrowDimensions:e,offset:R=K+((e==null?void 0:e.height)??0),focusManager:l,dismissible:u,scrollLock:b}=x,{order:k=["reference","content"],initialFocus:d,modal:f,...I}=l??{},T=d!==void 0?d:f?0:void 0,[g,p]=s.useState(F),h=s.useRef(null),_=J.useIsMounted(),v=s.useMemo(()=>o&&typeof r<"u"?r:g,[o,r,g]),y=s.useCallback(m=>{typeof r>"u"&&p(m),o==null||o(m)},[r,p,o]),{x:U,y:j,refs:O,strategy:S,context:n,middlewareData:D,placement:E}=t.useFloating({placement:w,open:v,onOpenChange:y,middleware:[a.offset(R),a.flip(),a.shift({padding:8}),a.arrow({element:h,padding:4})],whileElementsMounted:z.autoUpdate}),{getReferenceProps:L,getFloatingProps:W}=t.useInteractions([t.useHover(n,{enabled:i==="hover",handleClose:t.safePolygon()}),t.useClick(n,{toggle:u}),t.useFocus(n,{enabled:i==="hover"}),t.useRole(n,{role:P}),t.useDismiss(n,{enabled:u,outsidePressEvent:i==="click"?"mousedown":"pointerdown"})]);return A.jsx(M.Provider,{value:{open:v,onOpenChange:y,isMounted:_,openWith:i,reference:O.setReference,floating:O.setFloating,arrowRef:h,focusManager:l?{order:k,modal:f,initialFocus:T,...I}:void 0,x:U,y:j,strategy:S,getReferenceProps:L,getFloatingProps:W,arrow:{width:e==null?void 0:e.width,height:e==null?void 0:e.height,...D.arrow},context:n,placement:E,scrollLock:b},children:q})};c.Trigger=H.OverlayTrigger;c.Content=G.OverlayContent;exports.Overlay=c;exports.OverlayContext=M;exports.default=c;
|