@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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),s=require("../../../../../external/classnames/index.cjs.js"),_=require("react"),K=require("../../../../../external/react-animate-height/dist/esm/index.cjs.js"),A=require("../../base/icon/icon.cjs.js"),F=require("../../base/typography/text/text.cjs.js"),G=require("../../misc/print/print.cjs.js"),e=require("./collapse.module.scss.cjs.js"),H=require("../../../helpers/hooks/use-print.cjs.js"),J=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),v=require("../../layout/grid/row.cjs.js"),i=require("../../layout/grid/col.cjs.js"),N=x=>{const{getCurrentBreakpointProps:P}=J.useBreakpointProps(x.defaultServerBreakpoint),{getLabel:h}=Q.useLabels(),{id:r,children:w,className:k,openText:j=h("open"),closeText:g=h("close"),hideCollapseText:I=!1,title:c,titleRowProps:O,defaultOpen:$,open:d,onToggle:u,arrowType:n="default",size:o="default",underline:S=!0,toggleLabel:y,iconOnly:B=!1,...M}=P(x),p=`${r}__trigger`,f=`${r}__content`,R=`${r}__animate`,[b,T]=_.useState(()=>$),m=H.usePrint(),a=_.useMemo(()=>m||(d!==void 0?d:b),[m,d,b]),L=B===!0&&!c,D=s.default(e.default["tedi-collapse"],o==="small"&&e.default["tedi-collapse--small"],a&&e.default["tedi-collapse--is-open"],L&&e.default["tedi-collapse--icon-only"],e.default[`tedi-collapse--arrow-${n}`],k),q=()=>{const l=!a;T(l),u==null||u(l)},z=l=>{(l.key==="Enter"||l.key===" ")&&!l.repeat&&(l.preventDefault(),q())},E=y||(a?g:j),C=_.useMemo(()=>t.jsx("div",{id:f,role:"region","aria-labelledby":p,className:e.default["tedi-collapse__content"],children:w}),[w,f,p]);return t.jsxs("div",{"data-name":"collapse",...M,className:D,children:[t.jsx("button",{id:p,type:"button","data-name":"collapse-trigger",className:e.default["tedi-collapse__title"],"aria-label":E,"aria-expanded":a,"aria-controls":f,onKeyDown:z,onClick:q,children:t.jsxs(v.Row,{justifyContent:"between",alignItems:"center",wrap:"nowrap",...O,element:"span",children:[c&&t.jsx(i.Col,{"aria-hidden":"true",children:c}),t.jsx(i.Col,{width:"auto",children:t.jsxs(v.Row,{element:"span",alignItems:"center",gutter:0,wrap:"nowrap",children:[t.jsx(G.Print,{visibility:"hide",children:t.jsx(i.Col,{width:"auto",className:s.default({"visually-hidden":I}),children:t.jsx(F.Text,{element:"span",className:s.default(e.default["tedi-collapse__text"],{[e.default["tedi-collapse__text--underline"]]:S}),children:a?g:j})})}),t.jsx(i.Col,{width:"auto",children:t.jsx("div",{className:s.default(e.default["tedi-collapse__icon-wrapper"],e.default[`tedi-collapse__icon-wrapper--${n}`],o==="small"&&e.default["tedi-collapse__icon-wrapper--small"]),children:t.jsx(A.Icon,{className:s.default(e.default["tedi-collapse__icon"],e.default[`tedi-collapse__icon--${n}`],o==="small"&&e.default["tedi-collapse__icon--small"]),name:"expand_more",size:o==="small"||n==="secondary"?18:24})})})]})})]})}),m?C:t.jsx(K.default,{id:R,duration:300,height:a?"auto":0,"data-testid":"collapse-inner",children:C})]})};exports.Collapse=N;exports.default=N;
|
|
@@ -34,6 +34,12 @@ type CollapseBreakpointProps = {
|
|
|
34
34
|
*/
|
|
35
35
|
size?: 'default' | 'small';
|
|
36
36
|
underline?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Render collapse as icon-only toggle.
|
|
39
|
+
* Icon-only styles are applied ONLY when no title is provided.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
iconOnly?: boolean;
|
|
37
43
|
};
|
|
38
44
|
export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps> {
|
|
39
45
|
/**
|
|
@@ -65,6 +71,11 @@ export interface CollapseProps extends BreakpointSupport<CollapseBreakpointProps
|
|
|
65
71
|
* Defaults to the result of `getLabel('close')`.
|
|
66
72
|
*/
|
|
67
73
|
closeText?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Descriptive label for screen readers (e.g. "Toggle Products submenu")
|
|
76
|
+
* If provided, overrides the default open/close text for the accessible name.
|
|
77
|
+
*/
|
|
78
|
+
toggleLabel?: string;
|
|
68
79
|
}
|
|
69
80
|
export declare const Collapse: (props: CollapseProps) => JSX.Element;
|
|
70
81
|
export default Collapse;
|
|
@@ -1,97 +1,98 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import o from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Text as
|
|
7
|
-
import { Print as
|
|
3
|
+
import f from "react";
|
|
4
|
+
import A from "../../../../../external/react-animate-height/dist/esm/index.es.js";
|
|
5
|
+
import { Icon as H } from "../../base/icon/icon.es.js";
|
|
6
|
+
import { Text as q } from "../../base/typography/text/text.es.js";
|
|
7
|
+
import { Print as F } from "../../misc/print/print.es.js";
|
|
8
8
|
import e from "./collapse.module.scss.es.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { Row as
|
|
13
|
-
import { Col as
|
|
14
|
-
const
|
|
15
|
-
const { getCurrentBreakpointProps:
|
|
16
|
-
id:
|
|
17
|
-
children:
|
|
18
|
-
className:
|
|
19
|
-
openText:
|
|
20
|
-
closeText:
|
|
21
|
-
hideCollapseText:
|
|
22
|
-
title:
|
|
23
|
-
titleRowProps:
|
|
24
|
-
defaultOpen:
|
|
25
|
-
open:
|
|
26
|
-
onToggle:
|
|
27
|
-
arrowType:
|
|
28
|
-
size:
|
|
29
|
-
underline:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
import { usePrint as G } from "../../../helpers/hooks/use-print.es.js";
|
|
10
|
+
import { useBreakpointProps as J } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
11
|
+
import { useLabels as Q } from "../../../providers/label-provider/use-labels.es.js";
|
|
12
|
+
import { Row as k } from "../../layout/grid/row.es.js";
|
|
13
|
+
import { Col as s } from "../../layout/grid/col.es.js";
|
|
14
|
+
const se = (w) => {
|
|
15
|
+
const { getCurrentBreakpointProps: O } = J(w.defaultServerBreakpoint), { getLabel: y } = Q(), {
|
|
16
|
+
id: r,
|
|
17
|
+
children: g,
|
|
18
|
+
className: P,
|
|
19
|
+
openText: b = y("open"),
|
|
20
|
+
closeText: x = y("close"),
|
|
21
|
+
hideCollapseText: $ = !1,
|
|
22
|
+
title: c,
|
|
23
|
+
titleRowProps: B,
|
|
24
|
+
defaultOpen: S,
|
|
25
|
+
open: d,
|
|
26
|
+
onToggle: p,
|
|
27
|
+
arrowType: n = "default",
|
|
28
|
+
size: i = "default",
|
|
29
|
+
underline: T = !0,
|
|
30
|
+
toggleLabel: N,
|
|
31
|
+
iconOnly: j = !1,
|
|
32
|
+
...D
|
|
33
|
+
} = O(w), m = `${r}__trigger`, u = `${r}__content`, L = `${r}__animate`, [C, M] = f.useState(() => S), _ = G(), a = f.useMemo(
|
|
34
|
+
() => _ || (d !== void 0 ? d : C),
|
|
35
|
+
[_, d, C]
|
|
36
|
+
), R = j === !0 && !c, z = o(
|
|
35
37
|
e["tedi-collapse"],
|
|
36
|
-
|
|
38
|
+
i === "small" && e["tedi-collapse--small"],
|
|
37
39
|
a && e["tedi-collapse--is-open"],
|
|
38
|
-
|
|
39
|
-
e[`tedi-collapse--arrow-${
|
|
40
|
-
|
|
41
|
-
),
|
|
40
|
+
R && e["tedi-collapse--icon-only"],
|
|
41
|
+
e[`tedi-collapse--arrow-${n}`],
|
|
42
|
+
P
|
|
43
|
+
), v = () => {
|
|
42
44
|
const l = !a;
|
|
43
|
-
M(l),
|
|
44
|
-
},
|
|
45
|
-
(l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(),
|
|
46
|
-
}, N =
|
|
47
|
-
() => /* @__PURE__ */ t("div", { id:
|
|
48
|
-
[
|
|
45
|
+
M(l), p == null || p(l);
|
|
46
|
+
}, E = (l) => {
|
|
47
|
+
(l.key === "Enter" || l.key === " ") && !l.repeat && (l.preventDefault(), v());
|
|
48
|
+
}, K = N || (a ? x : b), I = f.useMemo(
|
|
49
|
+
() => /* @__PURE__ */ t("div", { id: u, role: "region", "aria-labelledby": m, className: e["tedi-collapse__content"], children: g }),
|
|
50
|
+
[g, u, m]
|
|
49
51
|
);
|
|
50
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ h("div", { "data-name": "collapse", ...D, className: z, children: [
|
|
51
53
|
/* @__PURE__ */ t(
|
|
52
54
|
"button",
|
|
53
55
|
{
|
|
54
|
-
id:
|
|
56
|
+
id: m,
|
|
55
57
|
type: "button",
|
|
56
58
|
"data-name": "collapse-trigger",
|
|
57
59
|
className: e["tedi-collapse__title"],
|
|
58
|
-
"aria-
|
|
60
|
+
"aria-label": K,
|
|
59
61
|
"aria-expanded": a,
|
|
60
|
-
"aria-controls":
|
|
61
|
-
onKeyDown:
|
|
62
|
-
onClick:
|
|
63
|
-
children: /* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
/* @__PURE__ */ t(
|
|
66
|
-
/* @__PURE__ */ t(
|
|
67
|
-
|
|
62
|
+
"aria-controls": u,
|
|
63
|
+
onKeyDown: E,
|
|
64
|
+
onClick: v,
|
|
65
|
+
children: /* @__PURE__ */ h(k, { justifyContent: "between", alignItems: "center", wrap: "nowrap", ...B, element: "span", children: [
|
|
66
|
+
c && /* @__PURE__ */ t(s, { "aria-hidden": "true", children: c }),
|
|
67
|
+
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ h(k, { element: "span", alignItems: "center", gutter: 0, wrap: "nowrap", children: [
|
|
68
|
+
/* @__PURE__ */ t(F, { visibility: "hide", children: /* @__PURE__ */ t(s, { width: "auto", className: o({ "visually-hidden": $ }), children: /* @__PURE__ */ t(
|
|
69
|
+
q,
|
|
68
70
|
{
|
|
69
71
|
element: "span",
|
|
70
72
|
className: o(e["tedi-collapse__text"], {
|
|
71
|
-
[e["tedi-collapse__text--underline"]]:
|
|
73
|
+
[e["tedi-collapse__text--underline"]]: T
|
|
72
74
|
}),
|
|
73
|
-
|
|
74
|
-
children: a ? P : $
|
|
75
|
+
children: a ? x : b
|
|
75
76
|
}
|
|
76
77
|
) }) }),
|
|
77
|
-
/* @__PURE__ */ t(
|
|
78
|
+
/* @__PURE__ */ t(s, { width: "auto", children: /* @__PURE__ */ t(
|
|
78
79
|
"div",
|
|
79
80
|
{
|
|
80
81
|
className: o(
|
|
81
82
|
e["tedi-collapse__icon-wrapper"],
|
|
82
|
-
e[`tedi-collapse__icon-wrapper--${
|
|
83
|
-
|
|
83
|
+
e[`tedi-collapse__icon-wrapper--${n}`],
|
|
84
|
+
i === "small" && e["tedi-collapse__icon-wrapper--small"]
|
|
84
85
|
),
|
|
85
86
|
children: /* @__PURE__ */ t(
|
|
86
|
-
|
|
87
|
+
H,
|
|
87
88
|
{
|
|
88
89
|
className: o(
|
|
89
90
|
e["tedi-collapse__icon"],
|
|
90
|
-
e[`tedi-collapse__icon--${
|
|
91
|
-
|
|
91
|
+
e[`tedi-collapse__icon--${n}`],
|
|
92
|
+
i === "small" && e["tedi-collapse__icon--small"]
|
|
92
93
|
),
|
|
93
94
|
name: "expand_more",
|
|
94
|
-
size:
|
|
95
|
+
size: i === "small" || n === "secondary" ? 18 : 24
|
|
95
96
|
}
|
|
96
97
|
)
|
|
97
98
|
}
|
|
@@ -100,10 +101,10 @@ const oe = (h) => {
|
|
|
100
101
|
] })
|
|
101
102
|
}
|
|
102
103
|
),
|
|
103
|
-
|
|
104
|
+
_ ? I : /* @__PURE__ */ t(A, { id: L, duration: 300, height: a ? "auto" : 0, "data-testid": "collapse-inner", children: I })
|
|
104
105
|
] });
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
se as Collapse,
|
|
109
|
+
se as default
|
|
109
110
|
};
|
|
@@ -32,5 +32,5 @@ export interface LabelProps extends BreakpointSupport<LabelBreakpointProps>, Lab
|
|
|
32
32
|
*/
|
|
33
33
|
tooltip?: string;
|
|
34
34
|
}
|
|
35
|
-
export declare const Label: import('react').ForwardRefExoticComponent<LabelProps & import('react').RefAttributes<
|
|
35
|
+
export declare const Label: import('react').ForwardRefExoticComponent<LabelProps & import('react').RefAttributes<HTMLLabelElement | HTMLSpanElement>>;
|
|
36
36
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),f=require("../../../../../external/classnames/index.cjs.js"),P=require("react"),W=require("../../../helpers/hooks/use-file-upload.cjs.js"),A=require("../../base/typography/text/text.cjs.js"),v=require("../../buttons/button/button.cjs.js"),E=require("../../buttons/closing-button/closing-button.cjs.js"),G=require("../form-label/form-label.cjs.js"),J=require("../../misc/separator/separator.cjs.js"),K=require("../../tags/tag/tag.cjs.js"),y=require("../feedback-text/feedback-text.cjs.js"),a=require("./file-upload.module.scss.cjs.js"),Q=require("../../../providers/label-provider/use-labels.cjs.js"),F=require("../../../helpers/hooks/use-breakpoint.cjs.js"),X=require("../../layout/grid/row.cjs.js"),q=require("../../layout/grid/col.cjs.js"),L=B=>{const{getLabel:d}=Q.useLabels(),{id:r,name:C,accept:g,multiple:_,onChange:m,className:N,defaultFiles:k,onDelete:T,hasClearButton:U=!0,files:u,readOnly:p,disabled:s=!1,maxSize:$,validateIndividually:w=!1,size:c="default",helper:i,...M}=B,{innerFiles:b,uploadErrorHelper:t,onFileChange:R,onFileRemove:S,handleClear:h,announcement:z}=W.useFileUpload({accept:g,maxSize:$,multiple:_,validateIndividually:w,defaultFiles:k,onChange:m,onDelete:T,files:u}),I=F.useBreakpoint(),V=f.default(a.default["tedi-file-upload"],{[a.default["tedi-file-upload--disabled"]]:s},N),x=i?(i==null?void 0:i.id)??`${r}-helper`:void 0,n=P.useMemo(()=>u&&m?u:b,[u,b,m]),O=(l,o)=>{const D=l.isValid===!1?`${l.name} (${d("file-upload.failed")})`:l.name;return e.jsx("li",{children:e.jsx(K.Tag,{color:l.isValid===!1?"danger":"primary",onClose:!l.isLoading&&!s&&!p?()=>S(l):void 0,isLoading:l.isLoading,"aria-label":D,children:l.name})},o)},j=()=>{if(n.length>1)return e.jsx("ul",{className:f.default(a.default["tedi-file-upload__items"],a.default["tedi-file-upload__truncate-list"]),children:n.map((l,o)=>O(l,o))});if(n.length===1){const l=n[0],o=l.isValid===!1?`${l.name} (${d("file-upload.failed")})`:l.name;return e.jsx(A.Text,{"aria-label":o,className:f.default(a.default["tedi-file-upload__items"],a.default["tedi-file-upload__truncate"]),children:l.name})}return null};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:a.default["tedi-file-upload__label-wrapper"],children:e.jsx(G.FormLabel,{id:r,...M,renderWithoutLabel:p,className:a.default["tedi-file-upload__label"],size:c})}),e.jsx("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:z}),p?j():e.jsx("div",{className:f.default(a.default["tedi-file-upload__container"],{[a.default["tedi-file-upload--disabled"]]:s,[a.default["tedi-file-upload--error"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="error",[a.default["tedi-file-upload--valid"]]:((t==null?void 0:t.type)||(i==null?void 0:i.type))==="valid"},{[a.default[`tedi-file-upload__container--${c}`]]:c}),children:e.jsx("div",{className:a.default["tedi-file-upload__content"],children:e.jsxs(X.Row,{children:[e.jsx(q.Col,{className:"display-flex",children:j()}),e.jsx(q.Col,{xs:12,md:"auto",children:e.jsxs("div",{className:V,children:[e.jsx("input",{id:r,type:"file",name:C,accept:g,onChange:R,multiple:_,disabled:s,"aria-invalid":!!t&&t.type==="error","aria-describedby":x}),U&&n.length>0&&!s&&e.jsxs(e.Fragment,{children:[F.isBreakpointBelow(I,"md")?e.jsx(v.Button,{visualType:"neutral",iconLeft:"close",disabled:s,onClick:h,className:a.default["tedi-file-upload__button"],children:d("clear")}):e.jsx(E.ClosingButton,{onClick:h,size:"medium",title:d("clear")}),e.jsx(J.Separator,{axis:"vertical",height:1.5,spacing:.5,color:"primary"})]}),e.jsx(v.Button,{visualType:"neutral",iconLeft:"file_upload",disabled:s,onClick:()=>{var l;return(l=document.getElementById(r))==null?void 0:l.click()},className:a.default["tedi-file-upload__button"],size:c,children:d("file-upload.add")})]})})]})})}),i?e.jsx(y.FeedbackText,{...i,id:x}):t?e.jsx(y.FeedbackText,{...t,id:x}):null]})};exports.FileUpload=L;exports.default=L;
|
|
@@ -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;
|