@tedi-design-system/react 14.4.0-rc.8 → 15.0.0-rc.1
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 +221 -223
- 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 -1
- 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/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/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
|
@@ -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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),r=require("../../../../../external/classnames/index.cjs.js"),y=require("react"),N=require("../../buttons/button/button.cjs.js"),j=require("../textfield/textfield.cjs.js"),t=require("./search.module.scss.cjs.js"),v=require("../../../providers/label-provider/use-labels.cjs.js"),u=y.forwardRef(({placeholder:c,isClearable:d=!0,searchIcon:n="search",onSearch:a,onChange:o,button:e,ariaLabel:f,...s},h)=>{const{getLabel:l}=v.useLabels(),m=q=>{q.key==="Enter"&&(a==null||a(s.value))},_=()=>{a==null||a(s.value)},x={...s,ref:h,inputClassName:r.default(t.default["tedi-search__input"],e&&t.default["tedi-search__input--has-button"]),placeholder:c,isClearable:d,onKeyDown:m,onChange:o,...e?{}:{icon:n}},b=c||l("search"),p=f??b;return i.jsxs("div",{className:r.default(t.default["tedi-search__wrapper"],s.className),role:"search","aria-label":p,children:[i.jsx(j.TextField,{...x}),e&&i.jsx(N.Button,{...e,onClick:_,className:r.default(t.default["tedi-search__button"],e.className),"aria-label":e.children?void 0:l("search"),children:e.children??l("search")})]})});u.displayName="Search";exports.Search=u;
|
|
@@ -15,5 +15,10 @@ export interface SearchProps extends Omit<TextFieldProps, 'isTextArea' | 'icon'
|
|
|
15
15
|
* Optional button properties.
|
|
16
16
|
*/
|
|
17
17
|
button?: Partial<ButtonProps>;
|
|
18
|
+
/**
|
|
19
|
+
* For accessibility: search field name (accessible name). Recommended to always set.
|
|
20
|
+
* E.g., "Search products" or "Search site".
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel?: string;
|
|
18
23
|
}
|
|
19
24
|
export declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<TextFieldForwardRef>>;
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { TextField as
|
|
1
|
+
import { jsxs as y, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import l from "../../../../../external/classnames/index.es.js";
|
|
3
|
+
import { forwardRef as v } from "react";
|
|
4
|
+
import { Button as w } from "../../buttons/button/button.es.js";
|
|
5
|
+
import { TextField as L } from "../textfield/textfield.es.js";
|
|
6
6
|
import r from "./search.module.scss.es.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { useLabels as k } from "../../../providers/label-provider/use-labels.es.js";
|
|
8
|
+
const C = v(
|
|
9
|
+
({ placeholder: t, isClearable: m = !0, searchIcon: o = "search", onSearch: s, onChange: d, button: e, ariaLabel: p, ...a }, n) => {
|
|
10
|
+
const { getLabel: i } = k(), f = (x) => {
|
|
11
|
+
x.key === "Enter" && (s == null || s(a.value));
|
|
12
|
+
}, h = () => {
|
|
13
|
+
s == null || s(a.value);
|
|
13
14
|
}, _ = {
|
|
14
|
-
...
|
|
15
|
-
ref:
|
|
16
|
-
inputClassName:
|
|
17
|
-
placeholder:
|
|
15
|
+
...a,
|
|
16
|
+
ref: n,
|
|
17
|
+
inputClassName: l(r["tedi-search__input"], e && r["tedi-search__input--has-button"]),
|
|
18
|
+
placeholder: t,
|
|
18
19
|
isClearable: m,
|
|
19
|
-
|
|
20
|
-
onChange:
|
|
21
|
-
...e ? {} : { icon:
|
|
22
|
-
};
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
e && /* @__PURE__ */
|
|
26
|
-
|
|
20
|
+
onKeyDown: f,
|
|
21
|
+
onChange: d,
|
|
22
|
+
...e ? {} : { icon: o }
|
|
23
|
+
}, u = t || i("search"), N = p ?? u;
|
|
24
|
+
return /* @__PURE__ */ y("div", { className: l(r["tedi-search__wrapper"], a.className), role: "search", "aria-label": N, children: [
|
|
25
|
+
/* @__PURE__ */ c(L, { ..._ }),
|
|
26
|
+
e && /* @__PURE__ */ c(
|
|
27
|
+
w,
|
|
27
28
|
{
|
|
28
29
|
...e,
|
|
29
|
-
onClick:
|
|
30
|
-
className:
|
|
31
|
-
|
|
30
|
+
onClick: h,
|
|
31
|
+
className: l(r["tedi-search__button"], e.className),
|
|
32
|
+
"aria-label": e.children ? void 0 : i("search"),
|
|
33
|
+
children: e.children ?? i("search")
|
|
32
34
|
}
|
|
33
35
|
)
|
|
34
36
|
] });
|
|
35
37
|
}
|
|
36
38
|
);
|
|
37
|
-
|
|
39
|
+
C.displayName = "Search";
|
|
38
40
|
export {
|
|
39
|
-
|
|
41
|
+
C as Search
|
|
40
42
|
};
|
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;
|