@tedi-design-system/react 18.1.0-rc.21 → 18.1.0-rc.22
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/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.cjs.js +1 -1
- package/external/hoist-non-react-statics/external/react-is/index.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.development.es.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.cjs.js +1 -1
- package/external/prop-types/external/react-is/cjs/react-is.production.min.es.js +1 -1
- package/external/prop-types/external/react-is/index.cjs.js +1 -1
- package/external/prop-types/external/react-is/index.es.js +1 -1
- package/package.json +1 -1
- package/src/tedi/components/buttons/button-content/button-content.cjs.js +1 -1
- package/src/tedi/components/buttons/button-content/button-content.es.js +31 -30
- package/src/tedi/components/loaders/spinner/spinner.cjs.js +1 -1
- package/src/tedi/components/loaders/spinner/spinner.d.ts +7 -0
- package/src/tedi/components/loaders/spinner/spinner.es.js +29 -18
- package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-content.es.js +14 -12
- package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +16 -16
- package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay.d.ts +10 -0
- package/src/tedi/components/overlays/overlay/overlay.es.js +74 -71
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/external/hoist-non-react-statics/external/react-is/cjs/react-is.production.min.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs2.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs4.js"),r=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");process.env.NODE_ENV==="production"?e.__module.exports=r.__require():e.__module.exports=o.__require();var t=e.__module.exports;exports.reactIsExports=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as r } from "../../../../_virtual/index.es4.js";
|
|
2
2
|
import { __require as e } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as o } from "./cjs/react-is.development.es.js";
|
|
4
4
|
process.env.NODE_ENV === "production" ? r.exports = e() : r.exports = o();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.development.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../../_virtual/react-is.production.min.cjs.js");/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../_virtual/index.cjs3.js"),t=require("./cjs/react-is.production.min.cjs.js"),o=require("./cjs/react-is.development.cjs.js");var r;function u(){return r||(r=1,process.env.NODE_ENV==="production"?e.__module.exports=t.__require():e.__module.exports=o.__require()),e.__module.exports}exports.__require=u;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/index.
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index.es3.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.es.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.es.js";
|
|
4
4
|
var r;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),l=require("../../../../../external/classnames/index.cjs.js"),D=require("react"),F=require("../../base/icon/icon.cjs.js"),q=require("../../loaders/spinner/spinner.cjs.js"),G=require("../../misc/print/print.cjs.js"),t=require("./button-content.module.scss.cjs.js"),b=require("../../overlays/tooltip/tooltip.cjs.js"),T=D.forwardRef(({children:d,as:g,_text:J,className:p,visualType:h="primary",color:E="default",size:o,icon:r,iconLeft:u,iconRight:i,underline:M=!1,isHovered:P,isActive:w,isLoading:s=!1,noStyle:m,_renderWrapperElement:K,fullWidth:_,onClick:x,showTooltip:S=!1,...j},A)=>{const y=g||"button",v=r||u||i,H=m?l.default(t.default["tedi-btn--no-style"],{[t.default["tedi-btn--full-width"]]:_},p):l.default(t.default["tedi-btn"],t.default[`tedi-btn--${h}`],t.default[`tedi-btn--${E}`],{[t.default[`tedi-btn--${o}`]]:o},{[t.default["tedi-btn--underline"]]:M},{[t.default["tedi-btn--is-hovered"]]:P},{[t.default["tedi-btn--is-active"]]:w},{[t.default["tedi-btn--is-loading"]]:s},{[t.default["tedi-btn--icon-only"]]:r},{[t.default["tedi-btn--icon"]]:v},{[t.default["tedi-btn--full-width"]]:_},p),f=(e,a)=>{const z=l.default(t.default["tedi-btn__icon"],t.default[`tedi-btn__icon--${e}`],{[t.default["tedi-btn__spinner"]]:s,[t.default["tedi-btn__icon-responsive"]]:y==="a"&&o==="small"}),c={size:o==="large"?24:18,className:z},B=typeof a=="string"?{...c,name:a}:{...c,...a,className:l.default(c.className,a==null?void 0:a.className)};return s?n.jsx(q.Spinner,{className:B.className,size:18,decorative:!0}):n.jsx(F.Icon,{...B})},O=()=>{const e=s?n.jsx(q.Spinner,{position:v?void 0:"absolute",className:l.default(t.default["tedi-btn__spinner"],t.default["tedi-btn__spinner--left"]),size:18,decorative:!0}):u?f("left",u):r?f("center",r):null;return n.jsxs("span",{className:t.default["tedi-btn__inner"],children:[e,n.jsx("span",{className:t.default["tedi-btn__text"],children:d}),!s&&i&&f("right",i)]})},k=e=>{x&&!s&&x(e)},R=!!r,C=(e=>{if(typeof e=="string")return e;if(Array.isArray(e))return e.map(a=>typeof a=="string"?a:"").join("").trim()})(d),N=n.jsx(y,{"data-name":"button-content",...j,"aria-disabled":s||j["aria-disabled"],"aria-busy":s||void 0,onClick:k,ref:A,className:H,children:m?d:O()});return n.jsx(G.Print,{visibility:"hide",children:S&&R&&C?n.jsxs(b.Tooltip,{ariaHidden:!0,children:[n.jsx(b.Tooltip.Trigger,{children:N}),n.jsx(b.Tooltip.Content,{children:C})]}):N})});T.displayName="ButtonContent";const I=T;exports.ButtonContent=I;exports.default=I;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as o, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import a from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import { forwardRef as F } from "react";
|
|
4
4
|
import { Icon as G } from "../../base/icon/icon.es.js";
|
|
5
5
|
import { Spinner as h } from "../../loaders/spinner/spinner.es.js";
|
|
6
6
|
import { Print as J } from "../../misc/print/print.es.js";
|
|
7
7
|
import t from "./button-content.module.scss.es.js";
|
|
8
|
-
import { Tooltip as
|
|
8
|
+
import { Tooltip as p } from "../../overlays/tooltip/tooltip.es.js";
|
|
9
9
|
const E = F(
|
|
10
10
|
({
|
|
11
11
|
children: l,
|
|
12
12
|
as: $,
|
|
13
13
|
_text: K,
|
|
14
|
-
className:
|
|
14
|
+
className: u,
|
|
15
15
|
visualType: j = "primary",
|
|
16
16
|
color: w = "default",
|
|
17
17
|
size: i,
|
|
18
|
-
icon:
|
|
18
|
+
icon: s,
|
|
19
19
|
iconLeft: d,
|
|
20
20
|
iconRight: m,
|
|
21
21
|
underline: P = !1,
|
|
22
22
|
isHovered: g,
|
|
23
23
|
isActive: A,
|
|
24
24
|
isLoading: r = !1,
|
|
25
|
-
noStyle:
|
|
25
|
+
noStyle: f,
|
|
26
26
|
_renderWrapperElement: Q,
|
|
27
27
|
fullWidth: _,
|
|
28
28
|
onClick: y,
|
|
29
|
-
showTooltip:
|
|
29
|
+
showTooltip: H = !1,
|
|
30
30
|
...N
|
|
31
|
-
},
|
|
32
|
-
const
|
|
31
|
+
}, M) => {
|
|
32
|
+
const v = $ || "button", x = s || d || m, k = f ? a(t["tedi-btn--no-style"], { [t["tedi-btn--full-width"]]: _ }, u) : a(
|
|
33
33
|
t["tedi-btn"],
|
|
34
34
|
t[`tedi-btn--${j}`],
|
|
35
35
|
t[`tedi-btn--${w}`],
|
|
@@ -38,56 +38,57 @@ const E = F(
|
|
|
38
38
|
{ [t["tedi-btn--is-hovered"]]: g },
|
|
39
39
|
{ [t["tedi-btn--is-active"]]: A },
|
|
40
40
|
{ [t["tedi-btn--is-loading"]]: r },
|
|
41
|
-
{ [t["tedi-btn--icon-only"]]:
|
|
42
|
-
{ [t["tedi-btn--icon"]]:
|
|
41
|
+
{ [t["tedi-btn--icon-only"]]: s },
|
|
42
|
+
{ [t["tedi-btn--icon"]]: x },
|
|
43
43
|
{ [t["tedi-btn--full-width"]]: _ },
|
|
44
|
-
|
|
44
|
+
u
|
|
45
45
|
), b = (e, n) => {
|
|
46
46
|
const D = a(t["tedi-btn__icon"], t[`tedi-btn__icon--${e}`], {
|
|
47
47
|
[t["tedi-btn__spinner"]]: r,
|
|
48
|
-
[t["tedi-btn__icon-responsive"]]:
|
|
49
|
-
}),
|
|
48
|
+
[t["tedi-btn__icon-responsive"]]: v === "a" && i === "small"
|
|
49
|
+
}), c = {
|
|
50
50
|
size: i === "large" ? 24 : 18,
|
|
51
51
|
className: D
|
|
52
|
-
}, I = typeof n == "string" ? { ...
|
|
53
|
-
return r ? /* @__PURE__ */
|
|
52
|
+
}, I = typeof n == "string" ? { ...c, name: n } : { ...c, ...n, className: a(c.className, n == null ? void 0 : n.className) };
|
|
53
|
+
return r ? /* @__PURE__ */ o(h, { className: I.className, size: 18, decorative: !0 }) : /* @__PURE__ */ o(G, { ...I });
|
|
54
54
|
}, O = () => {
|
|
55
|
-
const e = r ? /* @__PURE__ */
|
|
55
|
+
const e = r ? /* @__PURE__ */ o(
|
|
56
56
|
h,
|
|
57
57
|
{
|
|
58
|
-
position:
|
|
58
|
+
position: x ? void 0 : "absolute",
|
|
59
59
|
className: a(t["tedi-btn__spinner"], t["tedi-btn__spinner--left"]),
|
|
60
|
-
size: 18
|
|
60
|
+
size: 18,
|
|
61
|
+
decorative: !0
|
|
61
62
|
}
|
|
62
|
-
) : d ? b("left", d) :
|
|
63
|
+
) : d ? b("left", d) : s ? b("center", s) : null;
|
|
63
64
|
return /* @__PURE__ */ T("span", { className: t["tedi-btn__inner"], children: [
|
|
64
65
|
e,
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
+
/* @__PURE__ */ o("span", { className: t["tedi-btn__text"], children: l }),
|
|
66
67
|
!r && m && b("right", m)
|
|
67
68
|
] });
|
|
68
69
|
}, q = (e) => {
|
|
69
70
|
y && !r && y(e);
|
|
70
|
-
}, z = !!
|
|
71
|
+
}, z = !!s, B = ((e) => {
|
|
71
72
|
if (typeof e == "string") return e;
|
|
72
73
|
if (Array.isArray(e))
|
|
73
74
|
return e.map((n) => typeof n == "string" ? n : "").join("").trim();
|
|
74
|
-
})(l),
|
|
75
|
-
|
|
75
|
+
})(l), C = /* @__PURE__ */ o(
|
|
76
|
+
v,
|
|
76
77
|
{
|
|
77
78
|
"data-name": "button-content",
|
|
78
79
|
...N,
|
|
79
80
|
"aria-disabled": r || N["aria-disabled"],
|
|
80
81
|
"aria-busy": r || void 0,
|
|
81
82
|
onClick: q,
|
|
82
|
-
ref:
|
|
83
|
-
className:
|
|
84
|
-
children:
|
|
83
|
+
ref: M,
|
|
84
|
+
className: k,
|
|
85
|
+
children: f ? l : O()
|
|
85
86
|
}
|
|
86
87
|
);
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
] }) :
|
|
88
|
+
return /* @__PURE__ */ o(J, { visibility: "hide", children: H && z && B ? /* @__PURE__ */ T(p, { ariaHidden: !0, children: [
|
|
89
|
+
/* @__PURE__ */ o(p.Trigger, { children: C }),
|
|
90
|
+
/* @__PURE__ */ o(p.Content, { children: B })
|
|
91
|
+
] }) : C });
|
|
91
92
|
}
|
|
92
93
|
);
|
|
93
94
|
E.displayName = "ButtonContent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),p=require("../../../../../external/classnames/index.cjs.js"),e=require("./spinner.module.scss.cjs.js"),f=require("../../../providers/label-provider/use-labels.cjs.js"),v=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),m=r=>{const{getLabel:o}=f.useLabels(),{getCurrentBreakpointProps:l}=v.useBreakpointProps(r.defaultServerBreakpoint),{className:d,size:s=16,color:t="primary",label:c=o("spinner.loading"),position:a,decorative:i=!1}=l(r),u=p.default(e.default["tedi-spinner"],d,a&&e.default[`tedi-spinner--${a}`],s&&e.default[`tedi-spinner--size-${s}`],t&&e.default[`tedi-spinner--color-${t}`]);return n.jsxs("span",{className:u,role:i?void 0:"status","aria-live":i?void 0:"polite","aria-hidden":i||void 0,"data-testid":"tedi-spinner",children:[n.jsx("svg",{viewBox:"22 22 44 44","aria-hidden":"true",children:n.jsx("circle",{className:e.default["tedi-spinner__inner"],cx:"44",cy:"44",r:"20",fill:"none"})}),!i&&n.jsx("span",{className:"sr-only",children:c})]})};exports.Spinner=m;
|
|
@@ -33,6 +33,13 @@ export interface SpinnerProps extends BreakpointSupport<SpinnerBreakpointProps>
|
|
|
33
33
|
* Provides a text label for screen readers to announce the spinner's purpose or status.
|
|
34
34
|
*/
|
|
35
35
|
label?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Renders the spinner as purely decorative — no `role="status"` live region and
|
|
38
|
+
* no screen-reader label. Use when the loading state is already announced by an
|
|
39
|
+
* ancestor (e.g. a button's `aria-busy`), so it isn't announced twice.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
decorative?: boolean;
|
|
36
43
|
}
|
|
37
44
|
export declare const Spinner: (props: SpinnerProps) => JSX.Element;
|
|
38
45
|
export {};
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import f from "../../../../../external/classnames/index.es.js";
|
|
3
3
|
import e from "./spinner.module.scss.es.js";
|
|
4
|
-
import { useLabels as
|
|
4
|
+
import { useLabels as v } from "../../../providers/label-provider/use-labels.es.js";
|
|
5
5
|
import { useBreakpointProps as u } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
6
|
-
const
|
|
7
|
-
const { getLabel:
|
|
8
|
-
className:
|
|
9
|
-
size:
|
|
10
|
-
color:
|
|
11
|
-
label:
|
|
12
|
-
position: t
|
|
13
|
-
|
|
6
|
+
const y = (s) => {
|
|
7
|
+
const { getLabel: a } = v(), { getCurrentBreakpointProps: l } = u(s.defaultServerBreakpoint), {
|
|
8
|
+
className: p,
|
|
9
|
+
size: n = 16,
|
|
10
|
+
color: o = "primary",
|
|
11
|
+
label: d = a("spinner.loading"),
|
|
12
|
+
position: t,
|
|
13
|
+
decorative: i = !1
|
|
14
|
+
} = l(s), c = f(
|
|
14
15
|
e["tedi-spinner"],
|
|
15
|
-
|
|
16
|
+
p,
|
|
16
17
|
t && e[`tedi-spinner--${t}`],
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
n && e[`tedi-spinner--size-${n}`],
|
|
19
|
+
o && e[`tedi-spinner--color-${o}`]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ m(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
className: c,
|
|
25
|
+
role: i ? void 0 : "status",
|
|
26
|
+
"aria-live": i ? void 0 : "polite",
|
|
27
|
+
"aria-hidden": i || void 0,
|
|
28
|
+
"data-testid": "tedi-spinner",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ r("svg", { viewBox: "22 22 44 44", "aria-hidden": "true", children: /* @__PURE__ */ r("circle", { className: e["tedi-spinner__inner"], cx: "44", cy: "44", r: "20", fill: "none" }) }),
|
|
31
|
+
!i && /* @__PURE__ */ r("span", { className: "sr-only", children: d })
|
|
32
|
+
]
|
|
33
|
+
}
|
|
19
34
|
);
|
|
20
|
-
return /* @__PURE__ */ m("span", { className: c, role: "status", "aria-live": "polite", "data-testid": "tedi-spinner", children: [
|
|
21
|
-
/* @__PURE__ */ r("svg", { viewBox: "22 22 44 44", "aria-hidden": "true", children: /* @__PURE__ */ r("circle", { className: e["tedi-spinner__inner"], cx: "44", cy: "44", r: "20", fill: "none" }) }),
|
|
22
|
-
/* @__PURE__ */ r("span", { className: "sr-only", children: p })
|
|
23
|
-
] });
|
|
24
35
|
};
|
|
25
36
|
export {
|
|
26
|
-
|
|
37
|
+
y as Spinner
|
|
27
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),s=require("react"),C=require("./overlay.cjs.js"),E=u=>{const{children:y,classNames:e,labelledBy:f,describedBy:h}=u,{open:l,x:m,y:g,strategy:b,focusManager:o,floating:v,arrowRef:x,getFloatingProps:w,placement:p,context:i,arrow:t,scrollLock:d,contentId:j,role:F,ariaHidden:q}=s.useContext(C.OverlayContext);if(s.useEffect(()=>{d&&(l?(document.documentElement.style.overflow="hidden",document.documentElement.scrollHeight>window.innerHeight&&(document.body.style.overflow="scroll")):(document.documentElement.style.overflow="",document.body.style.overflow=""))},[l,d]),!l)return null;const a=n.jsxs("div",{...w({ref:v,tabIndex:-1,id:j,"aria-hidden":q||void 0,"aria-labelledby":f,"aria-describedby":h,style:{position:b,left:m,top:g},className:e==null?void 0:e.content}),"data-placement":p,"data-testid":"overlay-content",children:[n.jsx(r.FloatingArrow,{ref:c=>x.current=c,context:i,className:e==null?void 0:e.arrow,height:t==null?void 0:t.height,width:t==null?void 0:t.width,"data-testid":"overlay-arrow"}),y]});return n.jsx(r.FloatingPortal,{children:F==="tooltip"?a:n.jsx(r.FloatingFocusManager,{modal:(o==null?void 0:o.modal)||!1,...o,context:i,children:a})})};exports.OverlayContent=E;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { FloatingArrow as
|
|
3
|
-
import { useContext as B, useEffect as
|
|
4
|
-
import { OverlayContext as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as E, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { FloatingArrow as C, FloatingPortal as H, FloatingFocusManager as j } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import { useContext as B, useEffect as I } from "react";
|
|
4
|
+
import { OverlayContext as O } from "./overlay.es.js";
|
|
5
|
+
const L = (c) => {
|
|
6
6
|
const { children: s, classNames: e, labelledBy: m, describedBy: f } = c, {
|
|
7
7
|
open: l,
|
|
8
8
|
x: y,
|
|
@@ -17,18 +17,20 @@ const A = (c) => {
|
|
|
17
17
|
arrow: t,
|
|
18
18
|
scrollLock: i,
|
|
19
19
|
contentId: w,
|
|
20
|
-
role: x
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
role: x,
|
|
21
|
+
ariaHidden: F
|
|
22
|
+
} = B(O);
|
|
23
|
+
if (I(() => {
|
|
23
24
|
i && (l ? (document.documentElement.style.overflow = "hidden", document.documentElement.scrollHeight > window.innerHeight && (document.body.style.overflow = "scroll")) : (document.documentElement.style.overflow = "", document.body.style.overflow = ""));
|
|
24
25
|
}, [l, i]), !l) return null;
|
|
25
|
-
const d = /* @__PURE__ */
|
|
26
|
+
const d = /* @__PURE__ */ E(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
28
29
|
...b({
|
|
29
30
|
ref: g,
|
|
30
31
|
tabIndex: -1,
|
|
31
32
|
id: w,
|
|
33
|
+
"aria-hidden": F || void 0,
|
|
32
34
|
"aria-labelledby": m,
|
|
33
35
|
"aria-describedby": f,
|
|
34
36
|
style: {
|
|
@@ -42,7 +44,7 @@ const A = (c) => {
|
|
|
42
44
|
"data-testid": "overlay-content",
|
|
43
45
|
children: [
|
|
44
46
|
/* @__PURE__ */ n(
|
|
45
|
-
|
|
47
|
+
C,
|
|
46
48
|
{
|
|
47
49
|
ref: (a) => p.current = a,
|
|
48
50
|
context: r,
|
|
@@ -56,8 +58,8 @@ const A = (c) => {
|
|
|
56
58
|
]
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
|
-
return /* @__PURE__ */ n(
|
|
61
|
+
return /* @__PURE__ */ n(H, { children: x === "tooltip" ? d : /* @__PURE__ */ n(j, { modal: (o == null ? void 0 : o.modal) || !1, ...o, context: r, children: d }) });
|
|
60
62
|
};
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
L as OverlayContent
|
|
63
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),b=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),p=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),x=require("../../base/icon/icon.cjs.js"),q=require("./overlay.cjs.js"),t=require("./overlay.module.scss.cjs.js"),_=require("../../../providers/label-provider/use-labels.cjs.js"),m=s=>{const{children:e,className:l}=s,{getLabel:a}=_.useLabels(),{getReferenceProps:o,reference:c,openWith:d,open:u,role:g,ariaHidden:f,contentId:v}=r.useContext(q.OverlayContext),i=b.useMergeRefs([c,e.ref]),n=g==="tooltip"&&!f?{"aria-describedby":u?v:void 0}:{};return r.isValidElement(e)?r.cloneElement(e,o({ref:i,tabIndex:0,...n,label:e.type===x.Icon?a("tooltip.icon-trigger"):void 0,...e.props})):y.jsx("div",{...o({ref:i,tabIndex:0,className:p.default(t.default["tedi-overlay__trigger"],t.default["tedi-overlay__trigger--text"],{[t.default["tedi-overlay__trigger--click"]]:d==="click"},l),...n}),children:e})};exports.OverlayTrigger=m;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMergeRefs as
|
|
3
|
-
import
|
|
4
|
-
import { useContext as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { OverlayContext as
|
|
1
|
+
import { jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useMergeRefs as v } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import x from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { useContext as y, isValidElement as b, cloneElement as _ } from "react";
|
|
5
|
+
import { Icon as u } from "../../base/icon/icon.es.js";
|
|
6
|
+
import { OverlayContext as I } from "./overlay.es.js";
|
|
7
7
|
import r from "./overlay.module.scss.es.js";
|
|
8
|
-
import { useLabels as
|
|
9
|
-
const
|
|
10
|
-
const { children: e, className: n } = s, { getLabel: l } =
|
|
11
|
-
"aria-describedby":
|
|
8
|
+
import { useLabels as N } from "../../../providers/label-provider/use-labels.es.js";
|
|
9
|
+
const j = (s) => {
|
|
10
|
+
const { children: e, className: n } = s, { getLabel: l } = N(), { getReferenceProps: t, reference: a, openWith: c, open: m, role: p, ariaHidden: f, contentId: d } = y(I), o = v([a, e.ref]), i = p === "tooltip" && !f ? {
|
|
11
|
+
"aria-describedby": m ? d : void 0
|
|
12
12
|
} : {};
|
|
13
|
-
return
|
|
13
|
+
return b(e) ? _(
|
|
14
14
|
e,
|
|
15
15
|
t({
|
|
16
16
|
ref: o,
|
|
17
17
|
tabIndex: 0,
|
|
18
18
|
...i,
|
|
19
|
-
label: e.type ===
|
|
19
|
+
label: e.type === u ? l("tooltip.icon-trigger") : void 0,
|
|
20
20
|
...e.props
|
|
21
21
|
})
|
|
22
|
-
) : /* @__PURE__ */
|
|
22
|
+
) : /* @__PURE__ */ g(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
25
|
...t({
|
|
26
26
|
ref: o,
|
|
27
27
|
tabIndex: 0,
|
|
28
|
-
className:
|
|
28
|
+
className: x(
|
|
29
29
|
r["tedi-overlay__trigger"],
|
|
30
30
|
r["tedi-overlay__trigger--text"],
|
|
31
31
|
{
|
|
32
|
-
[r["tedi-overlay__trigger--click"]]:
|
|
32
|
+
[r["tedi-overlay__trigger--click"]]: c === "click"
|
|
33
33
|
},
|
|
34
34
|
n
|
|
35
35
|
),
|
|
@@ -40,5 +40,5 @@ const R = (s) => {
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
j as OverlayTrigger
|
|
44
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Q=require("react/jsx-runtime"),t=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),n=require("react"),X=require("./overlay-content.cjs.js"),Y=require("./overlay-trigger.cjs.js"),Z=require("../../../helpers/hooks/use-is-touch-device.cjs.js"),$=require("../../../helpers/hooks/use-is-mounted.cjs.js"),S=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),i=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),D=3,E=n.createContext({open:!1,onOpenChange:()=>{},isMounted:!1,openWith:"hover",reference:()=>{},floating:()=>{},focusManager:{},arrowRef:{current:null},x:0,y:0,strategy:"absolute",getReferenceProps:()=>({}),getFloatingProps:()=>({}),arrow:{width:0,height:0,x:0,y:0,centerOffset:0},placement:"top",context:{},scrollLock:void 0,contentId:""}),u=H=>{const L=Z.useIsTouchDevice(),{children:W,placement:A="top",openWith:s=L?"click":"hover",defaultOpen:G=!1,open:a,onToggle:r,role:d="tooltip",ariaHidden:f=!1,arrowDimensions:e,offset:V=D+((e==null?void 0:e.height)??0),arrowPadding:z=4,focusManager:g,dismissible:O,scrollLock:M,trackReferencePosition:B=!1}=H,{order:m=["reference","content"],initialFocus:x,modal:p,...C}=g??{},F=x!==void 0?x:p?0:void 0,[P,R]=n.useState(G),h=n.useRef(null),b=$.useIsMounted(),v=n.useMemo(()=>r&&typeof a<"u"?a:P,[r,a,P]),y=n.useCallback(l=>{typeof a>"u"&&R(l),r==null||r(l)},[a,R,r]),{x:q,y:I,refs:c,strategy:w,context:o,middlewareData:k,placement:T}=t.useFloating({placement:A,open:v,onOpenChange:y,middleware:[i.offset(V),i.flip(),i.shift({padding:8}),i.arrow({element:h,padding:z})],whileElementsMounted:B?(l,K,N)=>S.autoUpdate(l,K,N,{animationFrame:!0}):S.autoUpdate}),{getReferenceProps:U,getFloatingProps:_}=t.useInteractions([t.useHover(o,{enabled:s==="hover",handleClose:t.safePolygon()}),t.useClick(o,{toggle:O}),t.useFocus(o,{enabled:s==="hover"}),t.useRole(o,{role:d,enabled:!f}),t.useDismiss(o,{enabled:O,outsidePressEvent:s==="click"?"mousedown":"pointerdown"})]),j=n.useId(),J=n.useMemo(()=>({open:v,onOpenChange:y,isMounted:b,openWith:s,focusManager:g?{order:m,modal:p,initialFocus:F,...C}:void 0,reference:c.setReference,floating:c.setFloating,arrowRef:h,x:q,y:I,strategy:w,getReferenceProps:U,getFloatingProps:_,arrow:{width:e==null?void 0:e.width,height:e==null?void 0:e.height,...k.arrow},context:o,placement:T,scrollLock:M,role:d,ariaHidden:f,contentId:j}),[v,y,b,s,g,c.setReference,c.setFloating,h,q,I,w,U,_,e==null?void 0:e.width,e==null?void 0:e.height,k.arrow,o,T,M,d,f,j,p,m,F,C]);return Q.jsx(E.Provider,{value:J,children:W})};u.Trigger=Y.OverlayTrigger;u.Content=X.OverlayContent;exports.Overlay=u;exports.OverlayContext=E;exports.default=u;
|
|
@@ -46,6 +46,15 @@ export interface OverlayProps {
|
|
|
46
46
|
* @default tooltip
|
|
47
47
|
*/
|
|
48
48
|
role?: UseRoleProps['role'];
|
|
49
|
+
/**
|
|
50
|
+
* Renders the overlay purely visually: no `useRole` aria wiring on the trigger
|
|
51
|
+
* (so no `aria-describedby`) and the content is `aria-hidden`. Use when the
|
|
52
|
+
* trigger already conveys the same text through its accessible name — e.g. an
|
|
53
|
+
* icon-only button whose visible tooltip merely mirrors its label — so screen
|
|
54
|
+
* readers don't announce it twice.
|
|
55
|
+
* @default false
|
|
56
|
+
*/
|
|
57
|
+
ariaHidden?: boolean;
|
|
49
58
|
/**
|
|
50
59
|
* Content overlay arrow dimensions.
|
|
51
60
|
*/
|
|
@@ -108,6 +117,7 @@ export interface OverlayContextType {
|
|
|
108
117
|
context: FloatingContext<ReferenceType>;
|
|
109
118
|
scrollLock?: boolean;
|
|
110
119
|
role?: UseRoleProps['role'];
|
|
120
|
+
ariaHidden?: boolean;
|
|
111
121
|
contentId: string;
|
|
112
122
|
}
|
|
113
123
|
export declare const OverlayContext: import('react').Context<OverlayContextType>;
|