@tedi-design-system/react 14.4.0-rc.9 → 15.0.0-rc.2
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/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/community.cjs.js +1 -1
- package/community.es.js +219 -223
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.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/community/components/layout/footer/footer.cjs.js +1 -1
- package/src/community/components/layout/footer/footer.es.js +9 -9
- 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 +1 -1
- package/src/community/components/layout/sidenav/sidenav.cjs.js +1 -1
- package/src/community/components/layout/sidenav/sidenav.es.js +6 -6
- package/src/community/index.d.ts +0 -2
- package/src/tedi/components/buttons/collapse/collapse.cjs.js +1 -1
- package/src/tedi/components/buttons/collapse/collapse.d.ts +5 -0
- package/src/tedi/components/buttons/collapse/collapse.es.js +60 -60
- 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/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/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 +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
|
@@ -1,134 +1,153 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useFileUpload as
|
|
5
|
-
import { Text as
|
|
1
|
+
import { jsxs as u, Fragment as N, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import q from "react";
|
|
4
|
+
import { useFileUpload as A } from "../../../helpers/hooks/use-file-upload.es.js";
|
|
5
|
+
import { Text as E } from "../../base/typography/text/text.es.js";
|
|
6
6
|
import { Button as C } from "../../buttons/button/button.es.js";
|
|
7
|
-
import { ClosingButton as
|
|
8
|
-
import { FormLabel as
|
|
9
|
-
import { Separator as
|
|
10
|
-
import { Tag as
|
|
11
|
-
import { FeedbackText as
|
|
12
|
-
import
|
|
13
|
-
import { useLabels as
|
|
14
|
-
import { useBreakpoint as
|
|
15
|
-
import { Row as
|
|
16
|
-
import { Col as
|
|
17
|
-
const
|
|
18
|
-
const { getLabel:
|
|
19
|
-
id:
|
|
7
|
+
import { ClosingButton as G } from "../../buttons/closing-button/closing-button.es.js";
|
|
8
|
+
import { FormLabel as J } from "../form-label/form-label.es.js";
|
|
9
|
+
import { Separator as K } from "../../misc/separator/separator.es.js";
|
|
10
|
+
import { Tag as P } from "../../tags/tag/tag.es.js";
|
|
11
|
+
import { FeedbackText as L } from "../feedback-text/feedback-text.es.js";
|
|
12
|
+
import l from "./file-upload.module.scss.es.js";
|
|
13
|
+
import { useLabels as Q } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
import { useBreakpoint as X, isBreakpointBelow as Y } from "../../../helpers/hooks/use-breakpoint.es.js";
|
|
15
|
+
import { Row as Z } from "../../layout/grid/row.es.js";
|
|
16
|
+
import { Col as x } from "../../layout/grid/col.es.js";
|
|
17
|
+
const he = (B) => {
|
|
18
|
+
const { getLabel: n } = Q(), {
|
|
19
|
+
id: s,
|
|
20
20
|
name: k,
|
|
21
|
-
accept:
|
|
22
|
-
multiple:
|
|
23
|
-
onChange:
|
|
24
|
-
className:
|
|
25
|
-
defaultFiles:
|
|
26
|
-
onDelete:
|
|
27
|
-
hasClearButton:
|
|
28
|
-
files:
|
|
29
|
-
readOnly:
|
|
21
|
+
accept: g,
|
|
22
|
+
multiple: b,
|
|
23
|
+
onChange: f,
|
|
24
|
+
className: $,
|
|
25
|
+
defaultFiles: T,
|
|
26
|
+
onDelete: w,
|
|
27
|
+
hasClearButton: z = !0,
|
|
28
|
+
files: m,
|
|
29
|
+
readOnly: h,
|
|
30
30
|
disabled: o = !1,
|
|
31
|
-
maxSize:
|
|
32
|
-
validateIndividually:
|
|
33
|
-
size:
|
|
34
|
-
helper:
|
|
35
|
-
...
|
|
36
|
-
} =
|
|
37
|
-
accept:
|
|
38
|
-
maxSize:
|
|
39
|
-
multiple:
|
|
40
|
-
validateIndividually:
|
|
41
|
-
defaultFiles:
|
|
42
|
-
onChange:
|
|
43
|
-
onDelete:
|
|
44
|
-
files:
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
31
|
+
maxSize: I,
|
|
32
|
+
validateIndividually: R = !1,
|
|
33
|
+
size: c = "default",
|
|
34
|
+
helper: a,
|
|
35
|
+
...U
|
|
36
|
+
} = B, { innerFiles: v, uploadErrorHelper: t, onFileChange: V, onFileRemove: j, handleClear: y, announcement: M } = A({
|
|
37
|
+
accept: g,
|
|
38
|
+
maxSize: I,
|
|
39
|
+
multiple: b,
|
|
40
|
+
validateIndividually: R,
|
|
41
|
+
defaultFiles: T,
|
|
42
|
+
onChange: f,
|
|
43
|
+
onDelete: w,
|
|
44
|
+
files: m
|
|
45
|
+
}), S = X(), D = p(l["tedi-file-upload"], { [l["tedi-file-upload--disabled"]]: o }, $), _ = a ? (a == null ? void 0 : a.id) ?? `${s}-helper` : void 0, d = q.useMemo(() => m && f ? m : v, [m, v, f]), O = (e, r) => {
|
|
46
|
+
const W = e.isValid === !1 ? `${e.name} (${n("file-upload.failed")})` : e.name;
|
|
47
|
+
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
48
|
+
P,
|
|
49
|
+
{
|
|
50
|
+
color: e.isValid === !1 ? "danger" : "primary",
|
|
51
|
+
onClose: !e.isLoading && !o && !h ? () => j(e) : void 0,
|
|
52
|
+
isLoading: e.isLoading,
|
|
53
|
+
"aria-label": W,
|
|
54
|
+
children: e.name
|
|
55
|
+
}
|
|
56
|
+
) }, r);
|
|
57
|
+
}, F = () => {
|
|
58
|
+
if (d.length > 1)
|
|
59
|
+
return /* @__PURE__ */ i("ul", { className: p(l["tedi-file-upload__items"], l["tedi-file-upload__truncate-list"]), children: d.map((e, r) => O(e, r)) });
|
|
60
|
+
if (d.length === 1) {
|
|
61
|
+
const e = d[0], r = e.isValid === !1 ? `${e.name} (${n("file-upload.failed")})` : e.name;
|
|
62
|
+
return /* @__PURE__ */ i(
|
|
63
|
+
E,
|
|
64
|
+
{
|
|
65
|
+
"aria-label": r,
|
|
66
|
+
className: p(l["tedi-file-upload__items"], l["tedi-file-upload__truncate"]),
|
|
67
|
+
children: e.name
|
|
68
|
+
}
|
|
69
|
+
);
|
|
52
70
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ u(N, { children: [
|
|
74
|
+
/* @__PURE__ */ i("div", { className: l["tedi-file-upload__label-wrapper"], children: /* @__PURE__ */ i(
|
|
75
|
+
J,
|
|
57
76
|
{
|
|
58
|
-
id:
|
|
59
|
-
...
|
|
60
|
-
renderWithoutLabel:
|
|
61
|
-
className:
|
|
62
|
-
size:
|
|
77
|
+
id: s,
|
|
78
|
+
...U,
|
|
79
|
+
renderWithoutLabel: h,
|
|
80
|
+
className: l["tedi-file-upload__label"],
|
|
81
|
+
size: c
|
|
63
82
|
}
|
|
64
83
|
) }),
|
|
65
|
-
|
|
84
|
+
/* @__PURE__ */ i("div", { "aria-live": "polite", "aria-atomic": "true", className: "sr-only", children: M }),
|
|
85
|
+
h ? F() : /* @__PURE__ */ i(
|
|
66
86
|
"div",
|
|
67
87
|
{
|
|
68
|
-
className:
|
|
69
|
-
|
|
88
|
+
className: p(
|
|
89
|
+
l["tedi-file-upload__container"],
|
|
70
90
|
{
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
91
|
+
[l["tedi-file-upload--disabled"]]: o,
|
|
92
|
+
[l["tedi-file-upload--error"]]: ((t == null ? void 0 : t.type) || (a == null ? void 0 : a.type)) === "error",
|
|
93
|
+
[l["tedi-file-upload--valid"]]: ((t == null ? void 0 : t.type) || (a == null ? void 0 : a.type)) === "valid"
|
|
74
94
|
},
|
|
75
|
-
{ [
|
|
95
|
+
{ [l[`tedi-file-upload__container--${c}`]]: c }
|
|
76
96
|
),
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ i("div", { className: l["tedi-file-upload__content"], children: /* @__PURE__ */ u(Z, { children: [
|
|
98
|
+
/* @__PURE__ */ i(x, { className: "display-flex", children: F() }),
|
|
99
|
+
/* @__PURE__ */ i(x, { xs: 12, md: "auto", children: /* @__PURE__ */ u("div", { className: D, children: [
|
|
100
|
+
/* @__PURE__ */ i(
|
|
81
101
|
"input",
|
|
82
102
|
{
|
|
83
|
-
id:
|
|
103
|
+
id: s,
|
|
84
104
|
type: "file",
|
|
85
105
|
name: k,
|
|
86
|
-
accept:
|
|
87
|
-
onChange:
|
|
88
|
-
multiple:
|
|
106
|
+
accept: g,
|
|
107
|
+
onChange: V,
|
|
108
|
+
multiple: b,
|
|
89
109
|
disabled: o,
|
|
90
|
-
"aria-invalid": !!t
|
|
110
|
+
"aria-invalid": !!t && t.type === "error",
|
|
111
|
+
"aria-describedby": _
|
|
91
112
|
}
|
|
92
113
|
),
|
|
93
|
-
|
|
94
|
-
|
|
114
|
+
z && d.length > 0 && !o && /* @__PURE__ */ u(N, { children: [
|
|
115
|
+
Y(S, "md") ? /* @__PURE__ */ i(
|
|
95
116
|
C,
|
|
96
117
|
{
|
|
97
118
|
visualType: "neutral",
|
|
98
119
|
iconLeft: "close",
|
|
99
|
-
"aria-describedby": m,
|
|
100
120
|
disabled: o,
|
|
101
121
|
onClick: y,
|
|
102
|
-
className:
|
|
103
|
-
children:
|
|
122
|
+
className: l["tedi-file-upload__button"],
|
|
123
|
+
children: n("clear")
|
|
104
124
|
}
|
|
105
|
-
) : /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
125
|
+
) : /* @__PURE__ */ i(G, { onClick: y, size: "medium", title: n("clear") }),
|
|
126
|
+
/* @__PURE__ */ i(K, { axis: "vertical", height: 1.5, spacing: 0.5, color: "primary" })
|
|
107
127
|
] }),
|
|
108
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ i(
|
|
109
129
|
C,
|
|
110
130
|
{
|
|
111
131
|
visualType: "neutral",
|
|
112
132
|
iconLeft: "file_upload",
|
|
113
|
-
"aria-describedby": m,
|
|
114
133
|
disabled: o,
|
|
115
134
|
onClick: () => {
|
|
116
|
-
var
|
|
117
|
-
return (
|
|
135
|
+
var e;
|
|
136
|
+
return (e = document.getElementById(s)) == null ? void 0 : e.click();
|
|
118
137
|
},
|
|
119
|
-
className:
|
|
120
|
-
size:
|
|
121
|
-
children:
|
|
138
|
+
className: l["tedi-file-upload__button"],
|
|
139
|
+
size: c,
|
|
140
|
+
children: n("file-upload.add")
|
|
122
141
|
}
|
|
123
142
|
)
|
|
124
143
|
] }) })
|
|
125
144
|
] }) })
|
|
126
145
|
}
|
|
127
146
|
),
|
|
128
|
-
|
|
147
|
+
a ? /* @__PURE__ */ i(L, { ...a, id: _ }) : t ? /* @__PURE__ */ i(L, { ...t, id: _ }) : null
|
|
129
148
|
] });
|
|
130
149
|
};
|
|
131
150
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
151
|
+
he as FileUpload,
|
|
152
|
+
he as default
|
|
134
153
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-file-upload":"tedi-file-upload-115f37c2","tedi-file-upload__items":"tedi-file-upload__items-c73c19e5","tedi-file-upload__container":"tedi-file-upload__container-6b0f28a8","tedi-file-upload__container--default":"tedi-file-upload__container--default-56af0d96","tedi-file-upload__button":"tedi-file-upload__button-f37449e6","tedi-file-upload__container--small":"tedi-file-upload__container--small-4d5cd36e","tedi-file-upload--disabled":"tedi-file-upload--disabled-88f4fdcd","tedi-file-upload--error":"tedi-file-upload--error-388cda6f","tedi-file-upload--valid":"tedi-file-upload--valid-28d5eb71","tedi-file-upload__content":"tedi-file-upload__content-8b6bf324"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-file-upload":"tedi-file-upload-115f37c2","tedi-file-upload__items":"tedi-file-upload__items-c73c19e5","tedi-file-upload__container":"tedi-file-upload__container-6b0f28a8","tedi-file-upload__container--default":"tedi-file-upload__container--default-56af0d96","tedi-file-upload__button":"tedi-file-upload__button-f37449e6","tedi-file-upload__container--small":"tedi-file-upload__container--small-4d5cd36e","tedi-file-upload--disabled":"tedi-file-upload--disabled-88f4fdcd","tedi-file-upload--error":"tedi-file-upload--error-388cda6f","tedi-file-upload--valid":"tedi-file-upload--valid-28d5eb71","tedi-file-upload__content":"tedi-file-upload__content-8b6bf324","tedi-file-upload__items--truncate":"tedi-file-upload__items--truncate-5c249a01","tedi-file-upload__tag--truncate":"tedi-file-upload__tag--truncate-4c99cb2b"};exports.default=e;
|
|
@@ -8,7 +8,9 @@ const e = {
|
|
|
8
8
|
"tedi-file-upload--disabled": "tedi-file-upload--disabled-88f4fdcd",
|
|
9
9
|
"tedi-file-upload--error": "tedi-file-upload--error-388cda6f",
|
|
10
10
|
"tedi-file-upload--valid": "tedi-file-upload--valid-28d5eb71",
|
|
11
|
-
"tedi-file-upload__content": "tedi-file-upload__content-8b6bf324"
|
|
11
|
+
"tedi-file-upload__content": "tedi-file-upload__content-8b6bf324",
|
|
12
|
+
"tedi-file-upload__items--truncate": "tedi-file-upload__items--truncate-5c249a01",
|
|
13
|
+
"tedi-file-upload__tag--truncate": "tedi-file-upload__tag--truncate-4c99cb2b"
|
|
12
14
|
};
|
|
13
15
|
export {
|
|
14
16
|
e as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),c=require("../../../../../external/classnames/index.cjs.js"),n=require("react"),I=require("../feedback-text/feedback-text.cjs.js"),S=require("../form-label/form-label.cjs.js"),a=require("./radio.module.scss.cjs.js"),T=require("../../layout/grid/row.cjs.js"),x=require("../../layout/grid/col.cjs.js"),j=k=>{const{id:i,label:o,value:u,className:g,disabled:f,onChange:t,hideLabel:q,helper:r,checked:l,defaultChecked:C,hover:N,name:R,tooltip:h,size:b="default",invalid:y,...w}=k,[m,L]=n.useState(C||!1),s=n.useRef(null),M=n.useMemo(()=>t&&typeof l<"u"?l:m,[t,m,l]),v=d=>{typeof l>"u"&&L(d==null?void 0:d.target.checked),t==null||t(u,d==null?void 0:d.target.checked)},_=r?r.id??`${i}-helper`:void 0,F=h?`${i}-tooltip`:void 0,p=c.default(a.default["tedi-radio"],{[a.default["tedi-radio--disabled"]]:f});return e.jsxs("div",{"data-name":"radio",...w,children:[e.jsxs(T.Row,{gutter:0,children:[e.jsx(x.Col,{width:"auto",children:e.jsxs("div",{className:a.default["tedi-radio__outer-indicator-wrapper"],children:[e.jsx("input",{id:i,value:u,name:R,type:"radio",disabled:f,checked:M,onChange:v,className:a.default["tedi-radio__input"],"aria-describedby":[_,F].filter(Boolean).join(" ")}),e.jsx("div",{"aria-hidden":"true",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},className:c.default(a.default["tedi-radio__indicator"],{[a.default["tedi-radio__indicator--hover"]]:N},{[a.default[`tedi-radio__indicator--size-${b}`]]:b},{[a.default["tedi-radio__indicator--invalid"]]:y},g),"data-testid":"radio-indicator"})]})}),e.jsx(x.Col,{children:o&&typeof o=="string"?e.jsx(S.FormLabel,{ref:s,className:p,id:i,"data-testid":"radio-label",hideLabel:q,label:o,tooltip:h}):e.jsx("label",{ref:s,htmlFor:i,className:p,"data-testid":"radio-label",children:o})})]}),r&&e.jsx(I.FeedbackText,{id:_,...r,className:c.default(a.default["tedi-radio__helper"],r.className)})]})};exports.Radio=j;exports.default=j;
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { jsxs as s, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import n from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import m from "react";
|
|
4
|
-
import { FeedbackText as
|
|
5
|
-
import { FormLabel as
|
|
4
|
+
import { FeedbackText as B } from "../feedback-text/feedback-text.es.js";
|
|
5
|
+
import { FormLabel as M } from "../form-label/form-label.es.js";
|
|
6
6
|
import i from "./radio.module.scss.es.js";
|
|
7
|
-
import { Row as
|
|
8
|
-
import { Col as
|
|
9
|
-
const
|
|
7
|
+
import { Row as v } from "../../layout/grid/row.es.js";
|
|
8
|
+
import { Col as N } from "../../layout/grid/col.es.js";
|
|
9
|
+
const J = (C) => {
|
|
10
10
|
const {
|
|
11
|
-
id:
|
|
11
|
+
id: a,
|
|
12
12
|
label: o,
|
|
13
|
-
value:
|
|
14
|
-
className:
|
|
15
|
-
disabled:
|
|
13
|
+
value: h,
|
|
14
|
+
className: g,
|
|
15
|
+
disabled: f,
|
|
16
16
|
onChange: r,
|
|
17
|
-
hideLabel:
|
|
18
|
-
helper:
|
|
17
|
+
hideLabel: y,
|
|
18
|
+
helper: t,
|
|
19
19
|
checked: l,
|
|
20
|
-
defaultChecked:
|
|
21
|
-
hover:
|
|
22
|
-
name:
|
|
23
|
-
tooltip:
|
|
24
|
-
size:
|
|
20
|
+
defaultChecked: R,
|
|
21
|
+
hover: x,
|
|
22
|
+
name: j,
|
|
23
|
+
tooltip: p,
|
|
24
|
+
size: u = "default",
|
|
25
25
|
invalid: w,
|
|
26
26
|
...F
|
|
27
|
-
} =
|
|
28
|
-
typeof l > "u" &&
|
|
29
|
-
},
|
|
27
|
+
} = C, [_, I] = m.useState(R || !1), c = m.useRef(null), L = m.useMemo(() => r && typeof l < "u" ? l : _, [r, _, l]), $ = (e) => {
|
|
28
|
+
typeof l > "u" && I(e == null ? void 0 : e.target.checked), r == null || r(h, e == null ? void 0 : e.target.checked);
|
|
29
|
+
}, b = t ? t.id ?? `${a}-helper` : void 0, z = p ? `${a}-tooltip` : void 0, k = n(i["tedi-radio"], { [i["tedi-radio--disabled"]]: f });
|
|
30
30
|
return /* @__PURE__ */ s("div", { "data-name": "radio", ...F, children: [
|
|
31
|
-
/* @__PURE__ */ s(
|
|
32
|
-
/* @__PURE__ */ d(
|
|
31
|
+
/* @__PURE__ */ s(v, { gutter: 0, children: [
|
|
32
|
+
/* @__PURE__ */ d(N, { width: "auto", children: /* @__PURE__ */ s("div", { className: i["tedi-radio__outer-indicator-wrapper"], children: [
|
|
33
33
|
/* @__PURE__ */ d(
|
|
34
34
|
"input",
|
|
35
35
|
{
|
|
36
|
-
id:
|
|
37
|
-
value:
|
|
38
|
-
name:
|
|
36
|
+
id: a,
|
|
37
|
+
value: h,
|
|
38
|
+
name: j,
|
|
39
39
|
type: "radio",
|
|
40
|
-
disabled:
|
|
41
|
-
checked:
|
|
42
|
-
onChange:
|
|
43
|
-
className: i["tedi-radio__input"]
|
|
40
|
+
disabled: f,
|
|
41
|
+
checked: L,
|
|
42
|
+
onChange: $,
|
|
43
|
+
className: i["tedi-radio__input"],
|
|
44
|
+
"aria-describedby": [b, z].filter(Boolean).join(" ")
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
47
|
/* @__PURE__ */ d(
|
|
@@ -53,32 +54,32 @@ const G = (k) => {
|
|
|
53
54
|
},
|
|
54
55
|
className: n(
|
|
55
56
|
i["tedi-radio__indicator"],
|
|
56
|
-
{ [i["tedi-radio__indicator--hover"]]:
|
|
57
|
-
{ [i[`tedi-radio__indicator--size-${
|
|
57
|
+
{ [i["tedi-radio__indicator--hover"]]: x },
|
|
58
|
+
{ [i[`tedi-radio__indicator--size-${u}`]]: u },
|
|
58
59
|
{ [i["tedi-radio__indicator--invalid"]]: w },
|
|
59
|
-
|
|
60
|
+
g
|
|
60
61
|
),
|
|
61
62
|
"data-testid": "radio-indicator"
|
|
62
63
|
}
|
|
63
64
|
)
|
|
64
65
|
] }) }),
|
|
65
|
-
/* @__PURE__ */ d(
|
|
66
|
-
|
|
66
|
+
/* @__PURE__ */ d(N, { children: o && typeof o == "string" ? /* @__PURE__ */ d(
|
|
67
|
+
M,
|
|
67
68
|
{
|
|
68
69
|
ref: c,
|
|
69
|
-
className:
|
|
70
|
-
id:
|
|
70
|
+
className: k,
|
|
71
|
+
id: a,
|
|
71
72
|
"data-testid": "radio-label",
|
|
72
|
-
hideLabel:
|
|
73
|
+
hideLabel: y,
|
|
73
74
|
label: o,
|
|
74
|
-
tooltip:
|
|
75
|
+
tooltip: p
|
|
75
76
|
}
|
|
76
|
-
) : /* @__PURE__ */ d("label", { ref: c, htmlFor:
|
|
77
|
+
) : /* @__PURE__ */ d("label", { ref: c, htmlFor: a, className: k, "data-testid": "radio-label", children: o }) })
|
|
77
78
|
] }),
|
|
78
|
-
|
|
79
|
+
t && /* @__PURE__ */ d(B, { id: b, ...t, className: n(i["tedi-radio__helper"], t.className) })
|
|
79
80
|
] });
|
|
80
81
|
};
|
|
81
82
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
J as Radio,
|
|
84
|
+
J as default
|
|
84
85
|
};
|
package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("../../../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),d=require("../../../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),N=require("../../../../../../../external/classnames/index.cjs.js"),v=require("react"),k=require("../../../../navigation/link/link.cjs.js"),a=require("./sidenav-dropdown.module.scss.cjs.js"),D=require("../../../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),h=require("../../../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),q=require("../../../../../providers/label-provider/use-labels.cjs.js"),F=({trigger:b,groups:g,onOpenChange:o})=>{const{getLabel:x}=q.useLabels(),[u,r]=v.useState(!1),{refs:c,floatingStyles:_,context:f}=d.useFloating({open:u,middleware:[h.offset({mainAxis:8}),h.flip()],whileElementsMounted:D.autoUpdate,placement:"right-start",onOpenChange:e=>{r(e),o==null||o(e)},strategy:"fixed"}),{getReferenceProps:j,getFloatingProps:w}=d.useInteractions([d.useClick(f),d.useDismiss(f)]),p=e=>{var m;const n=e.subItemGroups||e.subItems,t=e.key||e.href||((m=e.children)==null?void 0:m.toString());return s.jsxs("li",{role:"none",className:N.default(a.default["tedi-sidenav-dropdown__item"],n&&a.default["tedi-sidenav-dropdown__item--has-children"]),children:[s.jsxs(k.Link,{...e,role:"menuitem","aria-haspopup":n?"true":void 0,"aria-expanded":n?!1:void 0,"aria-controls":n?`${t}-submenu`:void 0,className:a.default["tedi-sidenav-dropdown__link"],"data-active":e.isActive,"aria-current":e.isActive?"page":void 0,noStyle:!0,onClick:i=>{var l;(l=e.onClick)==null||l.call(e,i),r(!1)},children:[e.children,n&&s.jsx("span",{className:a.default["tedi-sidenav__bullet"]})]}),n&&s.jsx("ul",{id:`${t}-submenu`,className:a.default["tedi-sidenav-dropdown__list"],role:"menu","aria-label":x("sidenav.submenu"),children:(e.subItemGroups??(e.subItems?[{subItems:e.subItems}]:[])).map((i,l)=>s.jsxs(v.Fragment,{children:[i.subHeading&&s.jsx("div",{className:a.default["tedi-sidenav-dropdown__heading"],role:"presentation",children:i.subHeading}),i.subItems.map(I=>p(I))]},l))})]},t)},y=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),r(n=>!n)),e.key==="Escape"&&(e.preventDefault(),r(!1),c.setReference(null))};return s.jsxs(s.Fragment,{children:[s.jsx("div",{ref:c.setReference,...j(),role:"button",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":u,onKeyDown:y,children:b}),u&&s.jsx(d.FloatingOverlay,{children:s.jsx(d.FloatingPortal,{children:s.jsx(d.FloatingFocusManager,{context:f,modal:!1,children:s.jsx("div",{ref:c.setFloating,style:_,className:a.default["tedi-sidenav-dropdown"],role:"menu",...w(),children:g.map((e,n)=>s.jsxs("div",{className:a.default["tedi-sidenav-dropdown__group"],children:[e.subHeading&&s.jsx("div",{className:a.default["tedi-sidenav-dropdown__heading"],role:"presentation",children:e.subHeading}),s.jsx("ul",{className:a.default["tedi-sidenav-dropdown__list"],role:"menu",children:e.subItems.map(t=>p(t))})]},n))})})})})]})};exports.SideNavDropdown=F;
|
package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.es.js
CHANGED
|
@@ -1,97 +1,110 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Link as
|
|
1
|
+
import { jsxs as d, Fragment as N, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as k, useInteractions as F, useClick as x, useDismiss as D, FloatingOverlay as S, FloatingPortal as H, FloatingFocusManager as R } from "../../../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import A from "../../../../../../../external/classnames/index.es.js";
|
|
4
|
+
import E, { useState as L } from "react";
|
|
5
|
+
import { Link as P } from "../../../../navigation/link/link.es.js";
|
|
6
6
|
import n from "./sidenav-dropdown.module.scss.es.js";
|
|
7
7
|
import { autoUpdate as j } from "../../../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
8
|
-
import { offset as
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { offset as G, flip as K } from "../../../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
9
|
+
import { useLabels as M } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
10
|
+
const V = ({
|
|
11
|
+
trigger: v,
|
|
11
12
|
groups: h,
|
|
12
|
-
onOpenChange:
|
|
13
|
+
onOpenChange: l
|
|
13
14
|
}) => {
|
|
14
|
-
const [
|
|
15
|
-
open:
|
|
16
|
-
middleware: [
|
|
15
|
+
const { getLabel: b } = M(), [c, o] = L(!1), { refs: u, floatingStyles: _, context: m } = k({
|
|
16
|
+
open: c,
|
|
17
|
+
middleware: [G({ mainAxis: 8 }), K()],
|
|
17
18
|
whileElementsMounted: j,
|
|
18
19
|
placement: "right-start",
|
|
19
20
|
onOpenChange: (e) => {
|
|
20
|
-
|
|
21
|
+
o(e), l == null || l(e);
|
|
21
22
|
},
|
|
22
23
|
strategy: "fixed"
|
|
23
|
-
}), { getReferenceProps:
|
|
24
|
-
var
|
|
25
|
-
const
|
|
24
|
+
}), { getReferenceProps: g, getFloatingProps: w } = F([x(m), D(m)]), p = (e) => {
|
|
25
|
+
var f;
|
|
26
|
+
const s = e.subItemGroups || e.subItems, r = e.key || e.href || ((f = e.children) == null ? void 0 : f.toString());
|
|
26
27
|
return /* @__PURE__ */ d(
|
|
27
28
|
"li",
|
|
28
29
|
{
|
|
29
30
|
role: "none",
|
|
30
|
-
className:
|
|
31
|
+
className: A(
|
|
31
32
|
n["tedi-sidenav-dropdown__item"],
|
|
32
|
-
|
|
33
|
+
s && n["tedi-sidenav-dropdown__item--has-children"]
|
|
33
34
|
),
|
|
34
35
|
children: [
|
|
35
36
|
/* @__PURE__ */ d(
|
|
36
|
-
|
|
37
|
+
P,
|
|
37
38
|
{
|
|
38
39
|
...e,
|
|
39
40
|
role: "menuitem",
|
|
41
|
+
"aria-haspopup": s ? "true" : void 0,
|
|
42
|
+
"aria-expanded": s ? !1 : void 0,
|
|
43
|
+
"aria-controls": s ? `${r}-submenu` : void 0,
|
|
40
44
|
className: n["tedi-sidenav-dropdown__link"],
|
|
41
45
|
"data-active": e.isActive,
|
|
42
46
|
"aria-current": e.isActive ? "page" : void 0,
|
|
43
47
|
noStyle: !0,
|
|
44
|
-
onClick: (
|
|
48
|
+
onClick: (i) => {
|
|
45
49
|
var t;
|
|
46
|
-
(t = e.onClick) == null || t.call(e,
|
|
50
|
+
(t = e.onClick) == null || t.call(e, i), o(!1);
|
|
47
51
|
},
|
|
48
52
|
children: [
|
|
49
53
|
e.children,
|
|
50
|
-
|
|
54
|
+
s && /* @__PURE__ */ a("span", { className: n["tedi-sidenav__bullet"] })
|
|
51
55
|
]
|
|
52
56
|
}
|
|
53
57
|
),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
s && /* @__PURE__ */ a(
|
|
59
|
+
"ul",
|
|
60
|
+
{
|
|
61
|
+
id: `${r}-submenu`,
|
|
62
|
+
className: n["tedi-sidenav-dropdown__list"],
|
|
63
|
+
role: "menu",
|
|
64
|
+
"aria-label": b("sidenav.submenu"),
|
|
65
|
+
children: (e.subItemGroups ?? (e.subItems ? [{ subItems: e.subItems }] : [])).map((i, t) => /* @__PURE__ */ d(E.Fragment, { children: [
|
|
66
|
+
i.subHeading && /* @__PURE__ */ a("div", { className: n["tedi-sidenav-dropdown__heading"], role: "presentation", children: i.subHeading }),
|
|
67
|
+
i.subItems.map((I) => p(I))
|
|
68
|
+
] }, t))
|
|
69
|
+
}
|
|
70
|
+
)
|
|
58
71
|
]
|
|
59
72
|
},
|
|
60
|
-
|
|
73
|
+
r
|
|
61
74
|
);
|
|
62
|
-
},
|
|
63
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
75
|
+
}, y = (e) => {
|
|
76
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), o((s) => !s)), e.key === "Escape" && (e.preventDefault(), o(!1), u.setReference(null));
|
|
64
77
|
};
|
|
65
|
-
return /* @__PURE__ */ d(
|
|
66
|
-
/* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ d(N, { children: [
|
|
79
|
+
/* @__PURE__ */ a(
|
|
67
80
|
"div",
|
|
68
81
|
{
|
|
69
|
-
ref:
|
|
70
|
-
...
|
|
82
|
+
ref: u.setReference,
|
|
83
|
+
...g(),
|
|
71
84
|
role: "button",
|
|
72
85
|
tabIndex: -1,
|
|
73
86
|
"aria-haspopup": "menu",
|
|
74
|
-
"aria-expanded":
|
|
75
|
-
onKeyDown:
|
|
76
|
-
children:
|
|
87
|
+
"aria-expanded": c,
|
|
88
|
+
onKeyDown: y,
|
|
89
|
+
children: v
|
|
77
90
|
}
|
|
78
91
|
),
|
|
79
|
-
|
|
92
|
+
c && /* @__PURE__ */ a(S, { children: /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(R, { context: m, modal: !1, children: /* @__PURE__ */ a(
|
|
80
93
|
"div",
|
|
81
94
|
{
|
|
82
|
-
ref:
|
|
83
|
-
style:
|
|
95
|
+
ref: u.setFloating,
|
|
96
|
+
style: _,
|
|
84
97
|
className: n["tedi-sidenav-dropdown"],
|
|
85
98
|
role: "menu",
|
|
86
|
-
...
|
|
87
|
-
children: h.map((e,
|
|
88
|
-
e.subHeading && /* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
] },
|
|
99
|
+
...w(),
|
|
100
|
+
children: h.map((e, s) => /* @__PURE__ */ d("div", { className: n["tedi-sidenav-dropdown__group"], children: [
|
|
101
|
+
e.subHeading && /* @__PURE__ */ a("div", { className: n["tedi-sidenav-dropdown__heading"], role: "presentation", children: e.subHeading }),
|
|
102
|
+
/* @__PURE__ */ a("ul", { className: n["tedi-sidenav-dropdown__list"], role: "menu", children: e.subItems.map((r) => p(r)) })
|
|
103
|
+
] }, s))
|
|
91
104
|
}
|
|
92
105
|
) }) }) })
|
|
93
106
|
] });
|
|
94
107
|
};
|
|
95
108
|
export {
|
|
96
|
-
|
|
109
|
+
V as SideNavDropdown
|
|
97
110
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),o=require("../../../../../../../external/classnames/index.cjs.js"),D=require("../../../../base/icon/icon.cjs.js"),E=require("../../../../buttons/collapse/collapse.cjs.js"),C=require("../../../../navigation/link/link.cjs.js"),s=require("../../sidenav.module.scss.cjs.js"),W=require("../sidenav-dropdown/sidenav-dropdown.cjs.js"),g=require("../../../../overlays/tooltip/tooltip.cjs.js"),J=require("../../../../../providers/label-provider/use-labels.cjs.js"),M=O=>{const{icon:t,children:l,isActive:j,onClick:N,subItems:S,subItemGroups:P,as:T,onItemClick:p,className:B,level:r=1,isCollapsed:c=!1,isDefaultOpen:$=!1,sideNavItemSize:z="default",...u}=O,{getLabel:q}=J.useLabels(),[n,w]=x.useState($??!1),[y,F]=x.useState(!1),v=x.useId(),m=P??(S?[{subItems:S}]:null),d=!!m,H=o.default(s.default["tedi-sidenav__item"],s.default[`tedi-sidenav__item--${z}`],{[s.default[`tedi-sidenav__item--level-${r}`]]:r>1,[s.default["tedi-sidenav__item--current"]]:j,[s.default["tedi-sidenav__item--has-children"]]:d},B),_=a=>{const i={color:"white",className:o.default(s.default["tedi-sidenav__icon"])},h=typeof a=="string"?{...i,name:a}:{...i,...a,className:o.default(i.className,a==null?void 0:a.className)};return e.jsx(D.Icon,{...h})},K=a=>{N==null||N(a),d||p==null||p()},b=a=>{w(a)},A=a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),w(f=>{const i=!f;return b(i),i}))},G=d&&(u.href||u.to),k={...u,as:T,onClick:K,className:o.default(s.default["tedi-sidenav__link"],G&&s.default["tedi-sidenav__link--has-children-link"]),noStyle:!0,role:"menuitem","aria-current":j?"page":void 0,"aria-label":c&&typeof l=="string"?l:void 0,...d?{"aria-haspopup":"true","aria-expanded":n,"aria-controls":v}:{}},I=()=>!c&&(m==null?void 0:m.map((a,f)=>{var i;return e.jsxs("div",{children:[(a==null?void 0:a.subHeading)&&e.jsx("div",{className:s.default["tedi-sidenav__subheading"],children:a.subHeading}),e.jsx("ul",{className:s.default["tedi-sidenav__list"],role:"menu",children:(i=a.subItems)==null?void 0:i.map((h,R)=>x.createElement(M,{as:T,...h,key:R,level:r+1,onItemClick:p,isCollapsed:c,className:o.default(s.default["tedi-sidenav__sub-item"],h.className)}))})]},f)})),L=e.jsx("li",{"data-name":"sidenav-item",className:H,children:d&&c?e.jsx(W.SideNavDropdown,{trigger:e.jsx(g.Tooltip.Trigger,{children:e.jsxs("span",{className:o.default(s.default["tedi-sidenav__link"],y&&s.default["tedi-sidenav__link--active"]),children:[t&&_(t),e.jsx(D.Icon,{name:y?"chevron_right":"expand_more",color:"white",className:s.default["tedi-sidenav__toggle-icon"],size:18}),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:l})]})}),groups:m,onOpenChange:F}):d&&r===1?u.href||u.to?e.jsxs(e.Fragment,{children:[e.jsxs(C.Link,{...k,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:l})]}),e.jsx("div",{className:s.default["tedi-sidenav__link-collapse-wrapper"],children:e.jsx(E.Collapse,{id:v,hideCollapseText:!0,open:n,onToggle:b,toggleLabel:q("sidenav.toggleSubmenuChildren",{isCollapsedInternal:n,children:l}),className:s.default["tedi-sidenav__collapse"],children:I()})})]}):e.jsx(E.Collapse,{id:v,hideCollapseText:!0,open:n,onToggle:b,className:s.default["tedi-sidenav__collapse"],toggleLabel:q("sidenav.toggleSubmenuChildren",{isCollapsedInternal:n,children:l}),title:e.jsxs("span",{className:o.default(s.default["tedi-sidenav__link"],n&&s.default["tedi-sidenav__link--active"]),role:"button","aria-expanded":n,"aria-controls":v,"aria-current":j?"page":void 0,onKeyDown:A,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:l})]}),children:I()}):d?e.jsxs(e.Fragment,{children:[e.jsxs(C.Link,{...k,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:l}),e.jsx("i",{className:s.default["tedi-sidenav__bullet"]})]}),I()]}):e.jsx(g.Tooltip.Trigger,{children:e.jsxs(C.Link,{...k,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:l})]})})});return r===1&&c?e.jsxs(g.Tooltip,{placement:"right",focusManager:{order:["content"]},children:[e.jsx(g.Tooltip.Content,{maxWidth:"medium",children:l}),L]}):L};exports.SideNavItem=M;
|