@tedi-design-system/react 14.4.0-rc.9 → 15.0.0-rc.10
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 +219 -229
- package/index.css +1 -1
- package/package.json +3 -3
- package/src/community/components/accordion/accordion-item-header/accordion-item-header.cjs.js +1 -1
- package/src/community/components/accordion/accordion-item-header/accordion-item-header.es.js +2 -2
- package/src/community/components/button-content/button-content.cjs.js +1 -1
- package/src/community/components/button-content/button-content.d.ts +1 -1
- package/src/community/components/button-content/button-content.es.js +39 -33
- package/src/community/components/form/select/select.cjs.js +1 -1
- package/src/community/components/form/select/select.d.ts +1 -1
- package/src/community/components/form/select/select.es.js +33 -33
- package/src/community/components/form/text-editor/components/style-button.cjs.js +1 -1
- package/src/community/components/form/text-editor/components/style-button.es.js +2 -2
- package/src/community/components/form/toggle/toggle.cjs.js +1 -1
- package/src/community/components/form/toggle/toggle.es.js +4 -4
- package/src/community/components/layout/breadcrumbs/crumb/crumb.cjs.js +1 -1
- package/src/community/components/layout/breadcrumbs/crumb/crumb.es.js +9 -9
- package/src/community/components/layout/footer/footer.cjs.js +1 -1
- package/src/community/components/layout/footer/footer.d.ts +1 -1
- package/src/community/components/layout/footer/footer.es.js +23 -23
- package/src/community/components/layout/header/components/header-language/header-language.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-language/header-language.es.js +8 -8
- package/src/community/components/layout/header/components/header-modal/header-modal.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-modal/header-modal.es.js +6 -6
- package/src/community/components/layout/header/components/header-notification/header-notification.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-notification/header-notification.es.js +4 -4
- package/src/community/components/layout/header/components/header-role/header-role.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-role/header-role.es.js +20 -20
- package/src/community/components/layout/header/components/header-settings/header-settings.cjs.js +1 -1
- package/src/community/components/layout/header/components/header-settings/header-settings.es.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.d.ts +1 -1
- package/src/community/components/layout/sidenav/sidenav.es.js +39 -34
- package/src/community/components/placeholder/placeholder.cjs.js +1 -1
- package/src/community/components/placeholder/placeholder.d.ts +1 -1
- package/src/community/components/placeholder/placeholder.es.js +21 -20
- package/src/community/components/stepper/stepper-nav.cjs.js +1 -1
- package/src/community/components/stepper/stepper-nav.es.js +1 -1
- package/src/community/components/table/components/helpers.cjs.js +1 -1
- package/src/community/components/table/components/helpers.es.js +1 -1
- package/src/community/components/table/components/pagination/PaginationNextButton.cjs.js +1 -1
- package/src/community/components/table/components/pagination/PaginationNextButton.es.js +1 -1
- package/src/community/components/table/components/pagination/pagination.cjs.js +1 -1
- package/src/community/components/table/components/pagination/pagination.es.js +4 -4
- package/src/community/components/table/components/table-filter/components/table-date-filter.cjs.js +1 -1
- package/src/community/components/table/components/table-filter/components/table-date-filter.es.js +1 -1
- package/src/community/components/table/components/table-filter/components/table-select-filter.cjs.js +1 -1
- package/src/community/components/table/components/table-filter/components/table-select-filter.es.js +5 -5
- package/src/community/components/table-of-contents/table-of-contents-item.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents-item.es.js +18 -18
- package/src/community/components/table-of-contents/table-of-contents-items.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents-items.es.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents-modal.cjs.js +1 -1
- package/src/community/components/table-of-contents/table-of-contents-modal.es.js +13 -13
- package/src/community/components/toggle-open/toggle-open.d.ts +1 -1
- package/src/community/components/tooltip/tooltip-trigger.cjs.js +1 -1
- package/src/community/components/tooltip/tooltip-trigger.es.js +1 -1
- package/src/community/components/vertical-progress/vertical-progress-item.cjs.js +1 -1
- package/src/community/components/vertical-progress/vertical-progress-item.es.js +4 -4
- package/src/community/index.d.ts +0 -5
- package/src/tedi/components/base/icon/icon.d.ts +1 -1
- package/src/tedi/components/base/icon/icon.module.scss.cjs.js +1 -1
- package/src/tedi/components/base/icon/icon.module.scss.es.js +1 -0
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +11 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +68 -67
- package/src/tedi/components/content/label/label.d.ts +1 -1
- 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/radio/radio.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.es.js +42 -41
- package/src/tedi/components/form/textfield/textfield.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.module.scss.es.js +0 -1
- 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/misc/scroll-visibility/scroll-visibility.cjs.js +2 -1
- package/src/tedi/components/misc/scroll-visibility/scroll-visibility.es.js +44 -32
- 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/helpers/hooks/use-scroll.cjs.js +1 -1
- package/src/tedi/helpers/hooks/use-scroll.d.ts +3 -1
- package/src/tedi/helpers/hooks/use-scroll.es.js +19 -19
- package/src/tedi/providers/label-provider/labels-map.cjs.js +1 -1
- package/src/tedi/providers/label-provider/labels-map.d.ts +44 -0
- package/src/tedi/providers/label-provider/labels-map.es.js +37 -2
- package/src/community/components/collapse/collapse.cjs.js +0 -1
- package/src/community/components/collapse/collapse.d.ts +0 -56
- package/src/community/components/collapse/collapse.es.js +0 -67
- package/src/community/components/collapse/collapse.module.scss.cjs.js +0 -1
- package/src/community/components/collapse/collapse.module.scss.es.js +0 -12
- package/src/community/components/ellipsis/ellipsis.cjs.js +0 -1
- package/src/community/components/ellipsis/ellipsis.d.ts +0 -19
- package/src/community/components/ellipsis/ellipsis.es.js +0 -34
- package/src/community/components/ellipsis/ellipsis.module.scss.cjs.js +0 -1
- package/src/community/components/ellipsis/ellipsis.module.scss.es.js +0 -9
- package/src/community/components/icon/icon.cjs.js +0 -1
- package/src/community/components/icon/icon.d.ts +0 -49
- package/src/community/components/icon/icon.es.js +0 -47
- package/src/community/components/icon/icon.module.scss.cjs.js +0 -1
- package/src/community/components/icon/icon.module.scss.es.js +0 -9
- package/src/community/components/typography/heading/heading.cjs.js +0 -1
- package/src/community/components/typography/heading/heading.d.ts +0 -11
- package/src/community/components/typography/heading/heading.es.js +0 -10
- package/src/community/components/typography/text/text.cjs.js +0 -1
- package/src/community/components/typography/text/text.d.ts +0 -43
- package/src/community/components/typography/text/text.es.js +0 -26
- package/src/tedi/providers/storybook-provider/storybook-provider.d.ts +0 -10
|
@@ -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,2 @@
|
|
|
1
|
-
"use
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("react/jsx-runtime"),v=require("../../../../../external/classnames/index.cjs.js"),t=require("react"),V=require("../../../helpers/hooks/use-scroll.cjs.js"),b=require("./scroll-visibility.module.scss.cjs.js"),g=w=>{const{children:l,enabled:o=!0,className:H,visibility:n="hide",toggleVisibility:h=!1,scrollDistance:c=100,scrollDirection:u="down",scrollContainer:p,animationDirection:q="center"}=w,[d,D]=t.useState(!1),{scrollTop:i=0,scrollHeight:a=0,clientHeight:f=0}=V.useScroll(p)??{},[E,m]=t.useState(!1),S=t.useRef(0);t.useEffect(()=>{if(D(!0),!o)return;const e=u==="down"?i:a-f-i,s=n==="hide"?e>c:e<=c;m(s),S.current=e},[]),t.useEffect(()=>{if(!d||!o)return;const e=n==="show",s=u==="down"?i:a-f-i;let r;h&&s<S.current?r=e:s>c?r=!e:r=e,m(r),S.current=s},[d,o,n,h,c,i,u,a,f]);const y=v.default(b.default["tedi-scroll-visibility"],b.default[`tedi-scroll-visibility--${q}`],{[b.default["tedi-scroll-visibility--hidden"]]:d&&o&&E},H);return t.isValidElement(l)?t.cloneElement(l,{className:v.default(l.props.className,y)}):M.jsx("div",{className:y,children:l})};exports.ScrollVisibility=g;exports.default=g;
|
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as M } from "react/jsx-runtime";
|
|
3
|
+
import y from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { useState as S, useRef as V, useEffect as w, cloneElement as x, isValidElement as I } from "react";
|
|
5
|
+
import { useScroll as T } from "../../../helpers/hooks/use-scroll.es.js";
|
|
6
|
+
import f from "./scroll-visibility.module.scss.es.js";
|
|
7
|
+
const k = (H) => {
|
|
7
8
|
const {
|
|
8
|
-
children:
|
|
9
|
-
enabled:
|
|
10
|
-
className:
|
|
9
|
+
children: t,
|
|
10
|
+
enabled: l = !0,
|
|
11
|
+
className: v,
|
|
11
12
|
visibility: n = "hide",
|
|
12
|
-
toggleVisibility:
|
|
13
|
-
scrollDistance:
|
|
14
|
-
scrollDirection:
|
|
15
|
-
scrollContainer:
|
|
16
|
-
animationDirection:
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
toggleVisibility: h = !1,
|
|
14
|
+
scrollDistance: o = 100,
|
|
15
|
+
scrollDirection: c = "down",
|
|
16
|
+
scrollContainer: D,
|
|
17
|
+
animationDirection: N = "center"
|
|
18
|
+
} = H, [d, g] = S(!1), { scrollTop: s = 0, scrollHeight: a = 0, clientHeight: u = 0 } = T(D) ?? {}, [E, p] = S(!1), m = V(0);
|
|
19
|
+
w(() => {
|
|
20
|
+
if (g(!0), !l) return;
|
|
21
|
+
const e = c === "down" ? s : a - u - s, i = n === "hide" ? e > o : e <= o;
|
|
22
|
+
p(i), m.current = e;
|
|
23
|
+
}, []), w(() => {
|
|
24
|
+
if (!d || !l) return;
|
|
25
|
+
const e = n === "show", i = c === "down" ? s : a - u - s;
|
|
26
|
+
let r;
|
|
27
|
+
h && i < m.current ? r = e : i > o ? r = !e : r = e, p(r), m.current = i;
|
|
28
|
+
}, [
|
|
29
|
+
d,
|
|
30
|
+
l,
|
|
31
|
+
n,
|
|
32
|
+
h,
|
|
33
|
+
o,
|
|
34
|
+
s,
|
|
35
|
+
c,
|
|
36
|
+
a,
|
|
37
|
+
u
|
|
38
|
+
]);
|
|
39
|
+
const b = y(
|
|
40
|
+
f["tedi-scroll-visibility"],
|
|
41
|
+
f[`tedi-scroll-visibility--${N}`],
|
|
30
42
|
{
|
|
31
|
-
[
|
|
43
|
+
[f["tedi-scroll-visibility--hidden"]]: d && l && E
|
|
32
44
|
},
|
|
33
|
-
|
|
45
|
+
v
|
|
34
46
|
);
|
|
35
|
-
return
|
|
47
|
+
return I(t) ? x(t, { className: y(t.props.className, b) }) : /* @__PURE__ */ M("div", { className: b, children: t });
|
|
36
48
|
};
|
|
37
49
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
k as ScrollVisibility,
|
|
51
|
+
k as default
|
|
40
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),A=require("../../providers/label-provider/use-labels.cjs.js"),$=({accept:g,maxSize:r},o)=>{if(!g&&!r)return;const a=[g&&`${o("file-upload.accept")} ${g.replaceAll(",",", ")}`,r&&`${o("file-upload.max-size")} ${r}MB`].filter(Boolean).join(". ");return a.length?{text:a}:void 0},H=()=>`${Date.now()}-${Math.random().toString(36).slice(2)}`,I=g=>{const{getLabel:r}=A.useLabels(),{accept:o,maxSize:a,multiple:w=!1,validateIndividually:E=!1,defaultFiles:S=[],onChange:u,onDelete:f,files:x,announcementTimeout:T=5e3}=g,F=x!==void 0,[b,j]=m.useState(S),p=F?x:b,[L,h]=m.useState($({accept:o,maxSize:a},r)),[R,M]=m.useState(""),y=m.useRef(!0);m.useEffect(()=>()=>{y.current=!1},[]);const d=m.useRef(null),U=s=>{var n;if(!o)return!0;const l=o.split(",").map(e=>e.trim().toLowerCase()),t=s.name.includes(".")?`.${(n=s.name.split(".").pop())==null?void 0:n.toLowerCase()}`:"",i=s.type.toLowerCase();return l.includes(t)||l.includes(i)},V=s=>{const l=s.reduce((t,{type:i,file:n})=>(t[i].push(n.name),t),{extension:[],size:[]});return Object.entries(l).filter(([t,i])=>i.length).map(([t,i])=>{const n=i.map(e=>`'${e}'`).join(", ");return r(`file-upload.${t}-rejected`,n)}).join(". ")};return{innerFiles:p,uploadErrorHelper:L,onFileChange:s=>{if(s.target.files){const l=Array.from(s.target.files),t=[],i=l.map(e=>{const c=U(e),v=!a||e.size<=a*1024**2;c||t.push({type:"extension",file:e}),v||t.push({type:"size",file:e});const z=new File([e],e.name,{type:e.type,lastModified:e.lastModified});return Object.assign(z,{id:H(),isLoading:!1,isValid:c&&v})});let n=[];if(!w&&i.length>0)i[0].isValid&&(n=[i[0]]);else if(E)n=[...p,...i];else{const e=i.filter(c=>c.isValid);e.length>0&&(n=[...p,...e])}if(n.length>0&&(F||j(n),u==null||u(n),t.length===0)){const e=n.length-p.length,c=r("file-upload.success-added",e.toString())||`${e} file(s) added successfully`;y.current&&M(c)}if(t.length){const e=t.map(v=>v.file.name).join(", "),c=r("file-upload.failed-some",e)||`Upload failed for: ${e}`;y.current&&M(c),h({type:"error",text:V(t)})}else h($({accept:o,maxSize:a},r));setTimeout(()=>{y.current&&M("")},T),d.current&&(d.current.value="")}},onFileRemove:s=>{const l=p.filter(t=>t!==s);F||j(l),f==null||f(s),u==null||u(l),l.length===0&&h($({accept:o,maxSize:a},r)),d.current&&(d.current.value="")},handleClear:()=>{const s=[...p];return s.forEach(l=>f==null?void 0:f(l)),F||j([]),u==null||u([]),h($({accept:o,maxSize:a},r)),d.current&&(d.current.value=""),s},fileInputRef:d,announcement:R}};exports.useFileUpload=I;
|
|
@@ -19,6 +19,11 @@ export interface UseFileUploadProps {
|
|
|
19
19
|
onChange?: (files: FileUploadFile[]) => void;
|
|
20
20
|
onDelete?: (file: FileUploadFile) => void;
|
|
21
21
|
files?: FileUploadFile[];
|
|
22
|
+
/**
|
|
23
|
+
* How long (ms) the announcement message should be visible.
|
|
24
|
+
* @default 5000
|
|
25
|
+
*/
|
|
26
|
+
announcementTimeout?: number;
|
|
22
27
|
}
|
|
23
28
|
export declare const useFileUpload: (props: UseFileUploadProps) => {
|
|
24
29
|
innerFiles: FileUploadFile[];
|
|
@@ -27,4 +32,5 @@ export declare const useFileUpload: (props: UseFileUploadProps) => {
|
|
|
27
32
|
onFileRemove: (file: FileUploadFile) => void;
|
|
28
33
|
handleClear: () => FileUploadFile[];
|
|
29
34
|
fileInputRef: React.RefObject<HTMLInputElement>;
|
|
35
|
+
announcement: string;
|
|
30
36
|
};
|