@tedi-design-system/react 16.0.0-rc.1 → 16.0.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_virtual/index.cjs10.js +1 -1
- package/_virtual/index.cjs11.js +1 -1
- package/_virtual/index.cjs12.js +1 -1
- package/_virtual/index.cjs13.js +1 -1
- package/_virtual/index.cjs5.js +1 -1
- package/_virtual/index.cjs6.js +1 -1
- package/_virtual/index.cjs7.js +1 -1
- package/_virtual/index.cjs8.js +1 -1
- package/_virtual/index.cjs9.js +1 -1
- package/_virtual/index.es10.js +1 -1
- package/_virtual/index.es11.js +1 -1
- package/_virtual/index.es12.js +1 -1
- package/_virtual/index.es13.js +2 -4
- package/_virtual/index.es5.js +4 -2
- package/_virtual/index.es6.js +1 -1
- package/_virtual/index.es7.js +1 -1
- package/_virtual/index.es8.js +1 -1
- package/_virtual/index.es9.js +1 -1
- package/bundle-stats.html +1 -1
- package/external/@mui/system/colorManipulator.cjs.js +1 -1
- package/external/@mui/system/colorManipulator.es.js +2 -2
- package/external/@mui/system/createStyled.cjs.js +1 -1
- package/external/@mui/system/createStyled.es.js +6 -6
- package/external/@mui/system/useThemeWithoutDefault.cjs.js +1 -1
- package/external/@mui/system/useThemeWithoutDefault.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +2 -2
- package/src/tedi/components/buttons/button-content/button-content.cjs.js +1 -1
- package/src/tedi/components/buttons/button-content/button-content.es.js +54 -54
- package/src/tedi/components/buttons/button-content/button-content.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/button-content/button-content.module.scss.es.js +2 -1
- package/src/tedi/components/buttons/button-group/button-group.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.d.ts +4 -0
- package/src/tedi/components/buttons/button-group/button-group.es.js +31 -22
- package/src/tedi/components/buttons/button-group/button-group.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/button-group/button-group.module.scss.es.js +2 -0
- package/src/tedi/components/buttons/floating-button/floating-button.module.scss.cjs.js +1 -1
- package/src/tedi/components/buttons/floating-button/floating-button.module.scss.es.js +2 -1
- package/src/tedi/components/buttons/info-button/info-button.cjs.js +1 -1
- package/src/tedi/components/buttons/info-button/info-button.d.ts +4 -3
- package/src/tedi/components/buttons/info-button/info-button.es.js +17 -16
- package/src/tedi/components/form/checkbox/checkbox.cjs.js +1 -1
- package/src/tedi/components/form/checkbox/checkbox.es.js +61 -59
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.cjs.js +1 -1
- package/src/tedi/components/form/choice-group/components/choice-group-item/choice-group-item.es.js +61 -58
- package/src/tedi/components/form/choice-input.types.d.ts +5 -1
- package/src/tedi/components/form/form-label/form-label.d.ts +1 -1
- package/src/tedi/components/form/radio/radio.cjs.js +1 -1
- package/src/tedi/components/form/radio/radio.es.js +55 -53
- 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.d.ts +2 -1
- package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.es.js +37 -35
- 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 +20 -19
- package/src/tedi/components/layout/sidenav/sidenav.d.ts +2 -1
- package/src/tedi/components/notifications/alert/alert.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.d.ts +8 -1
- package/src/tedi/components/notifications/alert/alert.es.js +17 -15
- package/src/tedi/components/notifications/alert/alert.module.scss.cjs.js +1 -1
- package/src/tedi/components/notifications/alert/alert.module.scss.es.js +2 -0
- package/src/tedi/components/overlays/overlay/overlay-content.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-content.es.js +13 -11
- package/src/tedi/components/overlays/overlay/overlay-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay-trigger.es.js +21 -17
- package/src/tedi/components/overlays/overlay/overlay.cjs.js +1 -1
- package/src/tedi/components/overlays/overlay/overlay.d.ts +2 -0
- package/src/tedi/components/overlays/overlay/overlay.es.js +114 -88
- package/src/tedi/components/overlays/tooltip/tooltip.cjs.js +1 -1
- package/src/tedi/components/overlays/tooltip/tooltip.es.js +21 -14
package/src/tedi/components/layout/sidenav/components/sidenav-dropdown/sidenav-dropdown.es.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import { jsxs as d, Fragment as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Link as
|
|
1
|
+
import { jsxs as d, Fragment as k, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as F, useInteractions as x, useClick as D, useDismiss as S, FloatingOverlay as H, FloatingPortal as R, FloatingFocusManager as A } from "../../../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import E from "../../../../../../../external/classnames/index.es.js";
|
|
4
|
+
import L, { useState as P } from "react";
|
|
5
|
+
import { Link as j } from "../../../../navigation/link/link.es.js";
|
|
6
6
|
import n from "./sidenav-dropdown.module.scss.es.js";
|
|
7
|
-
import { autoUpdate as
|
|
8
|
-
import { offset as
|
|
9
|
-
import { useLabels as
|
|
10
|
-
const
|
|
7
|
+
import { autoUpdate as G } from "../../../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
8
|
+
import { offset as K, flip as M } from "../../../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
9
|
+
import { useLabels as $ } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
10
|
+
const W = ({
|
|
11
11
|
trigger: v,
|
|
12
12
|
groups: h,
|
|
13
|
-
onOpenChange:
|
|
13
|
+
onOpenChange: c,
|
|
14
|
+
as: b
|
|
14
15
|
}) => {
|
|
15
|
-
const { getLabel:
|
|
16
|
-
open:
|
|
17
|
-
middleware: [
|
|
18
|
-
whileElementsMounted:
|
|
16
|
+
const { getLabel: _ } = $(), [o, t] = P(!1), { refs: u, floatingStyles: g, context: m } = F({
|
|
17
|
+
open: o,
|
|
18
|
+
middleware: [K({ mainAxis: 8 }), M()],
|
|
19
|
+
whileElementsMounted: G,
|
|
19
20
|
placement: "right-start",
|
|
20
21
|
onOpenChange: (e) => {
|
|
21
|
-
|
|
22
|
+
t(e), c == null || c(e);
|
|
22
23
|
},
|
|
23
24
|
strategy: "fixed"
|
|
24
|
-
}), { getReferenceProps:
|
|
25
|
+
}), { getReferenceProps: w, getFloatingProps: y } = x([D(m), S(m)]), p = (e) => {
|
|
25
26
|
var f;
|
|
26
27
|
const s = e.subItemGroups || e.subItems, r = e.key || e.href || ((f = e.children) == null ? void 0 : f.toString());
|
|
27
28
|
return /* @__PURE__ */ d(
|
|
28
29
|
"li",
|
|
29
30
|
{
|
|
30
31
|
role: "none",
|
|
31
|
-
className:
|
|
32
|
+
className: E(
|
|
32
33
|
n["tedi-sidenav-dropdown__item"],
|
|
33
34
|
s && n["tedi-sidenav-dropdown__item--has-children"]
|
|
34
35
|
),
|
|
35
36
|
children: [
|
|
36
37
|
/* @__PURE__ */ d(
|
|
37
|
-
|
|
38
|
+
j,
|
|
38
39
|
{
|
|
39
40
|
...e,
|
|
40
41
|
role: "menuitem",
|
|
41
42
|
"aria-haspopup": s ? "true" : void 0,
|
|
42
|
-
"aria-expanded": s ?
|
|
43
|
+
"aria-expanded": s ? o : void 0,
|
|
43
44
|
"aria-controls": s ? `${r}-submenu` : void 0,
|
|
44
45
|
className: n["tedi-sidenav-dropdown__link"],
|
|
45
46
|
"data-active": e.isActive,
|
|
46
47
|
"aria-current": e.isActive ? "page" : void 0,
|
|
47
48
|
noStyle: !0,
|
|
48
49
|
onClick: (i) => {
|
|
49
|
-
var
|
|
50
|
-
(
|
|
50
|
+
var l;
|
|
51
|
+
(l = e.onClick) == null || l.call(e, i), t(!1);
|
|
51
52
|
},
|
|
53
|
+
as: e.as ?? b,
|
|
52
54
|
children: [
|
|
53
55
|
e.children,
|
|
54
56
|
s && /* @__PURE__ */ a("span", { className: n["tedi-sidenav__bullet"] })
|
|
@@ -61,42 +63,42 @@ const V = ({
|
|
|
61
63
|
id: `${r}-submenu`,
|
|
62
64
|
className: n["tedi-sidenav-dropdown__list"],
|
|
63
65
|
role: "menu",
|
|
64
|
-
"aria-label":
|
|
65
|
-
children: (e.subItemGroups ?? (e.subItems ? [{ subItems: e.subItems }] : [])).map((i,
|
|
66
|
+
"aria-label": _("sidenav.submenu"),
|
|
67
|
+
children: (e.subItemGroups ?? (e.subItems ? [{ subItems: e.subItems }] : [])).map((i, l) => /* @__PURE__ */ d(L.Fragment, { children: [
|
|
66
68
|
i.subHeading && /* @__PURE__ */ a("div", { className: n["tedi-sidenav-dropdown__heading"], role: "presentation", children: i.subHeading }),
|
|
67
|
-
i.subItems.map((
|
|
68
|
-
] },
|
|
69
|
+
i.subItems.map((N) => p(N))
|
|
70
|
+
] }, l))
|
|
69
71
|
}
|
|
70
72
|
)
|
|
71
73
|
]
|
|
72
74
|
},
|
|
73
75
|
r
|
|
74
76
|
);
|
|
75
|
-
},
|
|
76
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
77
|
+
}, I = (e) => {
|
|
78
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t((s) => !s)), e.key === "Escape" && (e.preventDefault(), t(!1), u.setReference(null));
|
|
77
79
|
};
|
|
78
|
-
return /* @__PURE__ */ d(
|
|
80
|
+
return /* @__PURE__ */ d(k, { children: [
|
|
79
81
|
/* @__PURE__ */ a(
|
|
80
82
|
"div",
|
|
81
83
|
{
|
|
82
84
|
ref: u.setReference,
|
|
83
|
-
...
|
|
85
|
+
...w(),
|
|
84
86
|
role: "button",
|
|
85
87
|
tabIndex: -1,
|
|
86
88
|
"aria-haspopup": "menu",
|
|
87
|
-
"aria-expanded":
|
|
88
|
-
onKeyDown:
|
|
89
|
+
"aria-expanded": o,
|
|
90
|
+
onKeyDown: I,
|
|
89
91
|
children: v
|
|
90
92
|
}
|
|
91
93
|
),
|
|
92
|
-
|
|
94
|
+
o && /* @__PURE__ */ a(H, { children: /* @__PURE__ */ a(R, { children: /* @__PURE__ */ a(A, { context: m, modal: !1, children: /* @__PURE__ */ a(
|
|
93
95
|
"div",
|
|
94
96
|
{
|
|
95
97
|
ref: u.setFloating,
|
|
96
|
-
style:
|
|
98
|
+
style: g,
|
|
97
99
|
className: n["tedi-sidenav-dropdown"],
|
|
98
100
|
role: "menu",
|
|
99
|
-
...
|
|
101
|
+
...y(),
|
|
100
102
|
children: h.map((e, s) => /* @__PURE__ */ d("div", { className: n["tedi-sidenav-dropdown__group"], children: [
|
|
101
103
|
e.subHeading && /* @__PURE__ */ a("div", { className: n["tedi-sidenav-dropdown__heading"], role: "presentation", children: e.subHeading }),
|
|
102
104
|
/* @__PURE__ */ a("ul", { className: n["tedi-sidenav-dropdown__list"], role: "menu", children: e.subItems.map((r) => p(r)) })
|
|
@@ -106,5 +108,5 @@ const V = ({
|
|
|
106
108
|
] });
|
|
107
109
|
};
|
|
108
110
|
export {
|
|
109
|
-
|
|
111
|
+
W as SideNavDropdown
|
|
110
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),o=require("../../../../../../../external/classnames/index.cjs.js"),D=require("../../../../base/icon/icon.cjs.js"),E=require("../../../../buttons/collapse/collapse.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),o=require("../../../../../../../external/classnames/index.cjs.js"),D=require("../../../../base/icon/icon.cjs.js"),E=require("../../../../buttons/collapse/collapse.cjs.js"),S=require("../../../../navigation/link/link.cjs.js"),s=require("../../sidenav.module.scss.cjs.js"),W=require("../sidenav-dropdown/sidenav-dropdown.cjs.js"),J=require("../../../../../providers/label-provider/use-labels.cjs.js"),g=require("../../../../overlays/tooltip/tooltip.cjs.js"),M=O=>{const{icon:t,children:i,isActive:j,onClick:N,subItems:T,subItemGroups:P,as:b,onItemClick:v,className:B,level:r=1,isCollapsed:c=!1,isDefaultOpen:$=!1,sideNavItemSize:z="default",...u}=O,{getLabel:q}=J.useLabels(),[n,w]=x.useState($??!1),[y,F]=x.useState(!1),p=x.useId(),m=P??(T?[{subItems:T}]:null),d=!!m,H=o.default(s.default["tedi-sidenav__item"],s.default[`tedi-sidenav__item--${z}`],{[s.default[`tedi-sidenav__item--level-${r}`]]:r>1,[s.default["tedi-sidenav__item--current"]]:j,[s.default["tedi-sidenav__item--has-children"]]:d},B),_=a=>{const l={color:"white",className:o.default(s.default["tedi-sidenav__icon"])},h=typeof a=="string"?{...l,name:a}:{...l,...a,className:o.default(l.className,a==null?void 0:a.className)};return e.jsx(D.Icon,{...h})},K=a=>{N==null||N(a),d||v==null||v()},k=a=>{w(a)},A=a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),w(f=>{const l=!f;return k(l),l}))},G=d&&(u.href||u.to),I={...u,as:b,onClick:K,className:o.default(s.default["tedi-sidenav__link"],G&&s.default["tedi-sidenav__link--has-children-link"]),noStyle:!0,role:"menuitem","aria-current":j?"page":void 0,"aria-label":c&&typeof i=="string"?i:void 0,...d?{"aria-haspopup":"true","aria-expanded":n,"aria-controls":p}:{}},C=()=>!c&&(m==null?void 0:m.map((a,f)=>{var l;return e.jsxs("div",{children:[(a==null?void 0:a.subHeading)&&e.jsx("div",{className:s.default["tedi-sidenav__subheading"],children:a.subHeading}),e.jsx("ul",{className:s.default["tedi-sidenav__list"],role:"menu",children:(l=a.subItems)==null?void 0:l.map((h,R)=>x.createElement(M,{as:b,...h,key:R,level:r+1,onItemClick:v,isCollapsed:c,className:o.default(s.default["tedi-sidenav__sub-item"],h.className)}))})]},f)})),L=e.jsx("li",{"data-name":"sidenav-item",className:H,children:d&&c?e.jsx(W.SideNavDropdown,{trigger:e.jsx(g.Tooltip.Trigger,{children:e.jsxs("span",{className:o.default(s.default["tedi-sidenav__link"],y&&s.default["tedi-sidenav__link--active"]),children:[t&&_(t),e.jsx(D.Icon,{name:y?"chevron_right":"expand_more",color:"white",className:s.default["tedi-sidenav__toggle-icon"],size:18}),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})}),as:b,groups:m,onOpenChange:F}):d&&r===1?u.href||u.to?e.jsxs(e.Fragment,{children:[e.jsxs(S.Link,{...I,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),e.jsx("div",{className:s.default["tedi-sidenav__link-collapse-wrapper"],children:e.jsx(E.Collapse,{id:p,hideCollapseText:!0,open:n,onToggle:k,toggleLabel:q("sidenav.toggleSubmenuChildren",{isCollapsedInternal:n,children:i}),className:s.default["tedi-sidenav__collapse"],children:C()})})]}):e.jsx(E.Collapse,{id:p,hideCollapseText:!0,open:n,onToggle:k,className:s.default["tedi-sidenav__collapse"],toggleLabel:q("sidenav.toggleSubmenuChildren",{isCollapsedInternal:n,children:i}),title:e.jsxs("span",{className:o.default(s.default["tedi-sidenav__link"],n&&s.default["tedi-sidenav__link--active"]),role:"button","aria-expanded":n,"aria-controls":p,"aria-current":j?"page":void 0,onKeyDown:A,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]}),children:C()}):d?e.jsxs(e.Fragment,{children:[e.jsxs(S.Link,{...I,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i}),e.jsx("i",{className:s.default["tedi-sidenav__bullet"]})]}),C()]}):e.jsx(g.Tooltip.Trigger,{children:e.jsxs(S.Link,{...I,children:[t&&_(t),e.jsx("span",{className:s.default["tedi-sidenav__title"],children:i})]})})});return r===1&&c?e.jsxs(g.Tooltip,{placement:"right",focusManager:void 0,children:[e.jsx(g.Tooltip.Content,{maxWidth:"medium",children:i}),L]}):L};exports.SideNavItem=M;
|
|
@@ -3,7 +3,7 @@ import Q, { useState as O, createElement as R } from "react";
|
|
|
3
3
|
import o from "../../../../../../../external/classnames/index.es.js";
|
|
4
4
|
import { Icon as P } from "../../../../base/icon/icon.es.js";
|
|
5
5
|
import { Collapse as B } from "../../../../buttons/collapse/collapse.es.js";
|
|
6
|
-
import { Link as
|
|
6
|
+
import { Link as y } from "../../../../navigation/link/link.es.js";
|
|
7
7
|
import e from "../../sidenav.module.scss.es.js";
|
|
8
8
|
import { SideNavDropdown as U } from "../sidenav-dropdown/sidenav-dropdown.es.js";
|
|
9
9
|
import { useLabels as V } from "../../../../../providers/label-provider/use-labels.es.js";
|
|
@@ -14,9 +14,9 @@ const X = (j) => {
|
|
|
14
14
|
children: n,
|
|
15
15
|
isActive: b,
|
|
16
16
|
onClick: I,
|
|
17
|
-
subItems:
|
|
17
|
+
subItems: S,
|
|
18
18
|
subItemGroups: z,
|
|
19
|
-
as:
|
|
19
|
+
as: k,
|
|
20
20
|
onItemClick: h,
|
|
21
21
|
className: H,
|
|
22
22
|
level: c = 1,
|
|
@@ -24,7 +24,7 @@ const X = (j) => {
|
|
|
24
24
|
isDefaultOpen: K = !1,
|
|
25
25
|
sideNavItemSize: $ = "default",
|
|
26
26
|
..._
|
|
27
|
-
} = j, { getLabel: T } = V(), [d, D] = O(K ?? !1), [L, A] = O(!1), u = Q.useId(), p = z ?? (
|
|
27
|
+
} = j, { getLabel: T } = V(), [d, D] = O(K ?? !1), [L, A] = O(!1), u = Q.useId(), p = z ?? (S ? [{ subItems: S }] : null), r = !!p, F = o(
|
|
28
28
|
e["tedi-sidenav__item"],
|
|
29
29
|
e[`tedi-sidenav__item--${$}`],
|
|
30
30
|
{
|
|
@@ -45,16 +45,16 @@ const X = (j) => {
|
|
|
45
45
|
return /* @__PURE__ */ s(P, { ...N });
|
|
46
46
|
}, G = (a) => {
|
|
47
47
|
I == null || I(a), r || h == null || h();
|
|
48
|
-
},
|
|
48
|
+
}, C = (a) => {
|
|
49
49
|
D(a);
|
|
50
50
|
}, W = (a) => {
|
|
51
51
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), D((g) => {
|
|
52
52
|
const t = !g;
|
|
53
|
-
return
|
|
53
|
+
return C(t), t;
|
|
54
54
|
}));
|
|
55
|
-
}, q = r && (_.href || _.to),
|
|
55
|
+
}, q = r && (_.href || _.to), x = {
|
|
56
56
|
..._,
|
|
57
|
-
as:
|
|
57
|
+
as: k,
|
|
58
58
|
onClick: G,
|
|
59
59
|
className: o(e["tedi-sidenav__link"], q && e["tedi-sidenav__link--has-children-link"]),
|
|
60
60
|
noStyle: !0,
|
|
@@ -66,14 +66,14 @@ const X = (j) => {
|
|
|
66
66
|
"aria-expanded": d,
|
|
67
67
|
"aria-controls": u
|
|
68
68
|
} : {}
|
|
69
|
-
},
|
|
69
|
+
}, w = () => !m && (p == null ? void 0 : p.map((a, g) => {
|
|
70
70
|
var t;
|
|
71
71
|
return /* @__PURE__ */ l("div", { children: [
|
|
72
72
|
(a == null ? void 0 : a.subHeading) && /* @__PURE__ */ s("div", { className: e["tedi-sidenav__subheading"], children: a.subHeading }),
|
|
73
73
|
/* @__PURE__ */ s("ul", { className: e["tedi-sidenav__list"], role: "menu", children: (t = a.subItems) == null ? void 0 : t.map((N, J) => /* @__PURE__ */ R(
|
|
74
74
|
X,
|
|
75
75
|
{
|
|
76
|
-
as:
|
|
76
|
+
as: k,
|
|
77
77
|
...N,
|
|
78
78
|
key: J,
|
|
79
79
|
level: c + 1,
|
|
@@ -105,11 +105,12 @@ const X = (j) => {
|
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
) }),
|
|
108
|
+
as: k,
|
|
108
109
|
groups: p,
|
|
109
110
|
onOpenChange: A
|
|
110
111
|
}
|
|
111
112
|
) : r && c === 1 ? _.href || _.to ? /* @__PURE__ */ l(M, { children: [
|
|
112
|
-
/* @__PURE__ */ l(
|
|
113
|
+
/* @__PURE__ */ l(y, { ...x, children: [
|
|
113
114
|
i && v(i),
|
|
114
115
|
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
115
116
|
] }),
|
|
@@ -119,13 +120,13 @@ const X = (j) => {
|
|
|
119
120
|
id: u,
|
|
120
121
|
hideCollapseText: !0,
|
|
121
122
|
open: d,
|
|
122
|
-
onToggle:
|
|
123
|
+
onToggle: C,
|
|
123
124
|
toggleLabel: T("sidenav.toggleSubmenuChildren", {
|
|
124
125
|
isCollapsedInternal: d,
|
|
125
126
|
children: n
|
|
126
127
|
}),
|
|
127
128
|
className: e["tedi-sidenav__collapse"],
|
|
128
|
-
children:
|
|
129
|
+
children: w()
|
|
129
130
|
}
|
|
130
131
|
) })
|
|
131
132
|
] }) : /* @__PURE__ */ s(
|
|
@@ -134,7 +135,7 @@ const X = (j) => {
|
|
|
134
135
|
id: u,
|
|
135
136
|
hideCollapseText: !0,
|
|
136
137
|
open: d,
|
|
137
|
-
onToggle:
|
|
138
|
+
onToggle: C,
|
|
138
139
|
className: e["tedi-sidenav__collapse"],
|
|
139
140
|
toggleLabel: T("sidenav.toggleSubmenuChildren", {
|
|
140
141
|
isCollapsedInternal: d,
|
|
@@ -158,20 +159,20 @@ const X = (j) => {
|
|
|
158
159
|
]
|
|
159
160
|
}
|
|
160
161
|
),
|
|
161
|
-
children:
|
|
162
|
+
children: w()
|
|
162
163
|
}
|
|
163
164
|
) : r ? /* @__PURE__ */ l(M, { children: [
|
|
164
|
-
/* @__PURE__ */ l(
|
|
165
|
+
/* @__PURE__ */ l(y, { ...x, children: [
|
|
165
166
|
i && v(i),
|
|
166
167
|
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n }),
|
|
167
168
|
/* @__PURE__ */ s("i", { className: e["tedi-sidenav__bullet"] })
|
|
168
169
|
] }),
|
|
169
|
-
|
|
170
|
-
] }) : /* @__PURE__ */ s(f.Trigger, { children: /* @__PURE__ */ l(
|
|
170
|
+
w()
|
|
171
|
+
] }) : /* @__PURE__ */ s(f.Trigger, { children: /* @__PURE__ */ l(y, { ...x, children: [
|
|
171
172
|
i && v(i),
|
|
172
173
|
/* @__PURE__ */ s("span", { className: e["tedi-sidenav__title"], children: n })
|
|
173
174
|
] }) }) });
|
|
174
|
-
return c === 1 && m ? /* @__PURE__ */ l(f, { placement: "right", focusManager:
|
|
175
|
+
return c === 1 && m ? /* @__PURE__ */ l(f, { placement: "right", focusManager: void 0, children: [
|
|
175
176
|
/* @__PURE__ */ s(f.Content, { maxWidth: "medium", children: n }),
|
|
176
177
|
E
|
|
177
178
|
] }) : E;
|
|
@@ -86,13 +86,14 @@ export declare const SideNav: (<C extends React.ElementType = "a">(props: SideNa
|
|
|
86
86
|
level?: number;
|
|
87
87
|
isCollapsed?: boolean;
|
|
88
88
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
-
Dropdown: <C extends React.ElementType = "a">({ trigger, groups, onOpenChange, }: {
|
|
89
|
+
Dropdown: <C extends React.ElementType = "a">({ trigger, groups, onOpenChange, as, }: {
|
|
90
90
|
trigger: React.ReactNode;
|
|
91
91
|
groups: {
|
|
92
92
|
subHeading?: string;
|
|
93
93
|
subItems: SideNavItemProps<C>[];
|
|
94
94
|
}[];
|
|
95
95
|
onOpenChange?: (isOpen: boolean) => void;
|
|
96
|
+
as?: C | undefined;
|
|
96
97
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
97
98
|
Mobile: <C extends React.ElementType = "a">({ navItems, ariaLabel, linkAs, isOpen, onClose, showOverlay, id, className, }: {
|
|
98
99
|
navItems: SideNavItemProps<C>[];
|
|
@@ -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"),w=require("../../../../../external/classnames/index.cjs.js"),C=require("react"),M=require("../../base/icon/icon.cjs.js"),N=require("../../base/typography/heading/heading.cjs.js"),P=require("../../buttons/closing-button/closing-button.cjs.js"),t=require("./alert.module.scss.cjs.js"),k=require("../../../helpers/hooks/use-is-mounted.cjs.js"),z=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),y=require("../../layout/vertical-spacing/vertical-spacing.cjs.js"),$=require("../../layout/grid/row.cjs.js"),f=require("../../layout/grid/col.cjs.js"),p=l=>{const{getCurrentBreakpointProps:g}=z.useBreakpointProps(l.defaultServerBreakpoint),{children:s,role:i="alert",title:r,className:m,type:n="info",icon:o,onClose:c,isGlobal:h=!1,noSideBorders:j=!1,titleElement:q="h3",size:x="default",...v}=g(l),_=w.default(t.default["tedi-alert"],t.default[`tedi-alert--${n}`],t.default[`tedi-alert--size-${x}`],{[t.default["tedi-alert--global"]]:h,[t.default["tedi-alert--no-side-borders"]]:j},m),b=k.useIsMounted(),B=a=>{const u={size:18},S=typeof a=="string"?{...u,name:a}:{...u,...a};return e.jsx(M.Icon,{...S,className:t.default["tedi-alert__icon"]})},I=i==="alert"?"assertive":i==="status"?"polite":"off",d=C.useId();return b?e.jsx("div",{role:i,"data-name":"alert","aria-label":`${n} alert`,"aria-live":I,"aria-labelledby":r?d:void 0,...v,className:_,children:e.jsxs(y.VerticalSpacing,{size:.25,children:[e.jsxs($.Row,{gutterX:2,alignItems:r?"center":"start",children:[e.jsxs(f.Col,{grow:1,className:t.default["tedi-alert__content"],children:[o&&B(o),e.jsx("div",{className:"tedi-alert__content-wrapper",children:r?e.jsx(N.Heading,{element:q,id:d,modifiers:["h5"],children:r}):s})]}),c&&e.jsx(f.Col,{width:"auto",children:e.jsx(P.ClosingButton,{onClick:c,iconSize:18})})]}),r&&s&&e.jsx("div",{className:"tedi-alert__content-wrapper",children:s})]})}):null};exports.Alert=p;exports.default=p;
|
|
@@ -20,6 +20,13 @@ type AlertBreakpointProps = {
|
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
|
22
22
|
noSideBorders?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Alert size variant.
|
|
25
|
+
* - 'default': Standard alert size with padding and border radius.
|
|
26
|
+
* - 'small': More compact alert size with reduced padding.
|
|
27
|
+
* @default default
|
|
28
|
+
*/
|
|
29
|
+
size?: 'default' | 'small';
|
|
23
30
|
};
|
|
24
31
|
export interface AlertProps extends BreakpointSupport<AlertBreakpointProps> {
|
|
25
32
|
/**
|
|
@@ -69,7 +76,7 @@ export interface AlertProps extends BreakpointSupport<AlertBreakpointProps> {
|
|
|
69
76
|
* // For secondary notifications
|
|
70
77
|
* titleElement="h4"
|
|
71
78
|
*
|
|
72
|
-
* @default
|
|
79
|
+
* @default h3
|
|
73
80
|
*/
|
|
74
81
|
titleElement?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
75
82
|
}
|
|
@@ -5,13 +5,13 @@ import { Icon as P } from "../../base/icon/icon.es.js";
|
|
|
5
5
|
import { Heading as S } from "../../base/typography/heading/heading.es.js";
|
|
6
6
|
import { ClosingButton as x } from "../../buttons/closing-button/closing-button.es.js";
|
|
7
7
|
import t from "./alert.module.scss.es.js";
|
|
8
|
-
import { useIsMounted as
|
|
9
|
-
import { useBreakpointProps as
|
|
8
|
+
import { useIsMounted as M } from "../../../helpers/hooks/use-is-mounted.es.js";
|
|
9
|
+
import { useBreakpointProps as $ } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
10
10
|
import { VerticalSpacing as j } from "../../layout/vertical-spacing/vertical-spacing.es.js";
|
|
11
11
|
import { Row as E } from "../../layout/grid/row.es.js";
|
|
12
12
|
import { Col as f } from "../../layout/grid/col.es.js";
|
|
13
|
-
const
|
|
14
|
-
const { getCurrentBreakpointProps: u } =
|
|
13
|
+
const O = (s) => {
|
|
14
|
+
const { getCurrentBreakpointProps: u } = $(s.defaultServerBreakpoint), {
|
|
15
15
|
children: o,
|
|
16
16
|
role: i = "alert",
|
|
17
17
|
title: r,
|
|
@@ -22,33 +22,35 @@ const K = (s) => {
|
|
|
22
22
|
isGlobal: g = !1,
|
|
23
23
|
noSideBorders: _ = !1,
|
|
24
24
|
titleElement: v = "h3",
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
size: I = "default",
|
|
26
|
+
...N
|
|
27
|
+
} = u(s), b = k(
|
|
27
28
|
t["tedi-alert"],
|
|
28
29
|
t[`tedi-alert--${n}`],
|
|
30
|
+
t[`tedi-alert--size-${I}`],
|
|
29
31
|
{
|
|
30
32
|
[t["tedi-alert--global"]]: g,
|
|
31
33
|
[t["tedi-alert--no-side-borders"]]: _
|
|
32
34
|
},
|
|
33
35
|
h
|
|
34
|
-
),
|
|
36
|
+
), B = M(), w = (a) => {
|
|
35
37
|
const p = { size: 18 }, C = typeof a == "string" ? { ...p, name: a } : { ...p, ...a };
|
|
36
38
|
return /* @__PURE__ */ e(P, { ...C, className: t["tedi-alert__icon"] });
|
|
37
|
-
},
|
|
38
|
-
return
|
|
39
|
+
}, z = i === "alert" ? "assertive" : i === "status" ? "polite" : "off", m = y.useId();
|
|
40
|
+
return B ? /* @__PURE__ */ e(
|
|
39
41
|
"div",
|
|
40
42
|
{
|
|
41
43
|
role: i,
|
|
42
44
|
"data-name": "alert",
|
|
43
45
|
"aria-label": `${n} alert`,
|
|
44
|
-
"aria-live":
|
|
46
|
+
"aria-live": z,
|
|
45
47
|
"aria-labelledby": r ? m : void 0,
|
|
46
|
-
...
|
|
47
|
-
className:
|
|
48
|
+
...N,
|
|
49
|
+
className: b,
|
|
48
50
|
children: /* @__PURE__ */ l(j, { size: 0.25, children: [
|
|
49
51
|
/* @__PURE__ */ l(E, { gutterX: 2, alignItems: r ? "center" : "start", children: [
|
|
50
52
|
/* @__PURE__ */ l(f, { grow: 1, className: t["tedi-alert__content"], children: [
|
|
51
|
-
d &&
|
|
53
|
+
d && w(d),
|
|
52
54
|
/* @__PURE__ */ e("div", { className: "tedi-alert__content-wrapper", children: r ? /* @__PURE__ */ e(S, { element: v, id: m, modifiers: ["h5"], children: r }) : o })
|
|
53
55
|
] }),
|
|
54
56
|
c && /* @__PURE__ */ e(f, { width: "auto", children: /* @__PURE__ */ e(x, { onClick: c, iconSize: 18 }) })
|
|
@@ -59,6 +61,6 @@ const K = (s) => {
|
|
|
59
61
|
) : null;
|
|
60
62
|
};
|
|
61
63
|
export {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
O as Alert,
|
|
65
|
+
O as default
|
|
64
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-alert":"tedi-alert-8ca3e7b9","tedi-alert__content":"tedi-alert__content-d480ed20","tedi-alert__icon":"tedi-alert__icon-f9ab1feb","tedi-alert--info":"tedi-alert--info-bcd40044","tedi-alert--success":"tedi-alert--success-e6d21f49","tedi-alert--warning":"tedi-alert--warning-88456526","tedi-alert--danger":"tedi-alert--danger-b9a2aa60","tedi-alert--global":"tedi-alert--global-14ff86d0","tedi-alert--no-side-borders":"tedi-alert--no-side-borders-a15a1df0"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-alert":"tedi-alert-8ca3e7b9","tedi-alert__content":"tedi-alert__content-d480ed20","tedi-alert__icon":"tedi-alert__icon-f9ab1feb","tedi-alert--size-default":"tedi-alert--size-default-6a9ebe2c","tedi-alert--size-small":"tedi-alert--size-small-4c763cad","tedi-alert--info":"tedi-alert--info-bcd40044","tedi-alert--success":"tedi-alert--success-e6d21f49","tedi-alert--warning":"tedi-alert--warning-88456526","tedi-alert--danger":"tedi-alert--danger-b9a2aa60","tedi-alert--global":"tedi-alert--global-14ff86d0","tedi-alert--no-side-borders":"tedi-alert--no-side-borders-a15a1df0"};exports.default=e;
|
|
@@ -2,6 +2,8 @@ const e = {
|
|
|
2
2
|
"tedi-alert": "tedi-alert-8ca3e7b9",
|
|
3
3
|
"tedi-alert__content": "tedi-alert__content-d480ed20",
|
|
4
4
|
"tedi-alert__icon": "tedi-alert__icon-f9ab1feb",
|
|
5
|
+
"tedi-alert--size-default": "tedi-alert--size-default-6a9ebe2c",
|
|
6
|
+
"tedi-alert--size-small": "tedi-alert--size-small-4c763cad",
|
|
5
7
|
"tedi-alert--info": "tedi-alert--info-bcd40044",
|
|
6
8
|
"tedi-alert--success": "tedi-alert--success-e6d21f49",
|
|
7
9
|
"tedi-alert--warning": "tedi-alert--warning-88456526",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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"),d=require("react"),j=require("./overlay.cjs.js"),F=s=>{const{children:u,classNames:e,labelledBy:y,describedBy:f}=s,{open:l,x:m,y:h,strategy:g,focusManager:o,floating:b,arrowRef:v,getFloatingProps:x,placement:w,context:i,arrow:t,scrollLock:c,contentId:p}=d.useContext(j.OverlayContext);return d.useEffect(()=>{c&&(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,c]),l?n.jsx(r.FloatingPortal,{children:n.jsx(r.FloatingFocusManager,{modal:(o==null?void 0:o.modal)||!1,...o,context:i,children:n.jsxs("div",{...x({ref:b,tabIndex:-1,id:p,"aria-labelledby":y,"aria-describedby":f,style:{position:g,left:m,top:h},className:e==null?void 0:e.content}),"data-placement":w,"data-testid":"overlay-content",children:[n.jsx(r.FloatingArrow,{ref:a=>v.current=a,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"}),u]})})}):null};exports.OverlayContent=F;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { FloatingPortal as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { OverlayContext as
|
|
1
|
+
import { jsx as n, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { FloatingPortal as x, FloatingFocusManager as F, FloatingArrow as E } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import { useContext as C, useEffect as j } from "react";
|
|
4
|
+
import { OverlayContext as B } from "./overlay.es.js";
|
|
5
5
|
const S = (a) => {
|
|
6
6
|
const { children: c, classNames: e, labelledBy: s, describedBy: m } = a, {
|
|
7
7
|
open: l,
|
|
@@ -15,16 +15,18 @@ const S = (a) => {
|
|
|
15
15
|
placement: p,
|
|
16
16
|
context: r,
|
|
17
17
|
arrow: t,
|
|
18
|
-
scrollLock:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
scrollLock: d,
|
|
19
|
+
contentId: v
|
|
20
|
+
} = C(B);
|
|
21
|
+
return j(() => {
|
|
22
|
+
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 = ""));
|
|
23
|
+
}, [l, d]), l ? /* @__PURE__ */ n(x, { children: /* @__PURE__ */ n(F, { modal: (o == null ? void 0 : o.modal) || !1, ...o, context: r, children: /* @__PURE__ */ w(
|
|
23
24
|
"div",
|
|
24
25
|
{
|
|
25
26
|
...g({
|
|
26
27
|
ref: u,
|
|
27
28
|
tabIndex: -1,
|
|
29
|
+
id: v,
|
|
28
30
|
"aria-labelledby": s,
|
|
29
31
|
"aria-describedby": m,
|
|
30
32
|
style: {
|
|
@@ -38,9 +40,9 @@ const S = (a) => {
|
|
|
38
40
|
"data-testid": "overlay-content",
|
|
39
41
|
children: [
|
|
40
42
|
/* @__PURE__ */ n(
|
|
41
|
-
|
|
43
|
+
E,
|
|
42
44
|
{
|
|
43
|
-
ref: (
|
|
45
|
+
ref: (i) => b.current = i,
|
|
44
46
|
context: r,
|
|
45
47
|
className: e == null ? void 0 : e.arrow,
|
|
46
48
|
height: t == null ? void 0 : t.height,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),y=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),b=require("../../../../../external/classnames/index.cjs.js"),r=require("react"),p=require("../../base/icon/icon.cjs.js"),x=require("./overlay.cjs.js"),t=require("./overlay.module.scss.cjs.js"),q=require("../../../providers/label-provider/use-labels.cjs.js"),_=s=>{const{children:e,className:l}=s,{getLabel:c}=q.useLabels(),{getReferenceProps:o,reference:a,openWith:u,open:d,role:g,contentId:f}=r.useContext(x.OverlayContext),i=y.useMergeRefs([a,e.ref]),n=g==="tooltip"?{"aria-describedby":d?f:void 0}:{};return r.isValidElement(e)?r.cloneElement(e,o({ref:i,tabIndex:0,...n,label:e.type===p.Icon?c("tooltip.icon-trigger"):void 0,...e.props})):v.jsx("div",{...o({ref:i,tabIndex:0,className:b.default(t.default["tedi-overlay__trigger"],t.default["tedi-overlay__trigger--text"],{[t.default["tedi-overlay__trigger--click"]]:u==="click"},l),...n}),children:e})};exports.OverlayTrigger=_;
|
|
@@ -1,40 +1,44 @@
|
|
|
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 d } from "react/jsx-runtime";
|
|
2
|
+
import { useMergeRefs as g } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import v from "../../../../../external/classnames/index.es.js";
|
|
4
|
+
import { useContext as x, isValidElement as y, cloneElement as b } from "react";
|
|
5
|
+
import { Icon as _ } from "../../base/icon/icon.es.js";
|
|
6
|
+
import { OverlayContext as u } 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:
|
|
11
|
-
|
|
8
|
+
import { useLabels as I } from "../../../providers/label-provider/use-labels.es.js";
|
|
9
|
+
const R = (s) => {
|
|
10
|
+
const { children: e, className: n } = s, { getLabel: l } = I(), { getReferenceProps: t, reference: c, openWith: m, open: a, role: p, contentId: f } = x(u), o = g([c, e.ref]), i = p === "tooltip" ? {
|
|
11
|
+
"aria-describedby": a ? f : void 0
|
|
12
|
+
} : {};
|
|
13
|
+
return y(e) ? b(
|
|
12
14
|
e,
|
|
13
15
|
t({
|
|
14
16
|
ref: o,
|
|
15
17
|
tabIndex: 0,
|
|
16
|
-
|
|
18
|
+
...i,
|
|
19
|
+
label: e.type === _ ? l("tooltip.icon-trigger") : void 0,
|
|
17
20
|
...e.props
|
|
18
21
|
})
|
|
19
|
-
) : /* @__PURE__ */
|
|
22
|
+
) : /* @__PURE__ */ d(
|
|
20
23
|
"div",
|
|
21
24
|
{
|
|
22
25
|
...t({
|
|
23
26
|
ref: o,
|
|
24
27
|
tabIndex: 0,
|
|
25
|
-
className:
|
|
28
|
+
className: v(
|
|
26
29
|
r["tedi-overlay__trigger"],
|
|
27
30
|
r["tedi-overlay__trigger--text"],
|
|
28
31
|
{
|
|
29
|
-
[r["tedi-overlay__trigger--click"]]:
|
|
32
|
+
[r["tedi-overlay__trigger--click"]]: m === "click"
|
|
30
33
|
},
|
|
31
|
-
|
|
32
|
-
)
|
|
34
|
+
n
|
|
35
|
+
),
|
|
36
|
+
...i
|
|
33
37
|
}),
|
|
34
38
|
children: e
|
|
35
39
|
}
|
|
36
40
|
);
|
|
37
41
|
};
|
|
38
42
|
export {
|
|
39
|
-
|
|
43
|
+
R as OverlayTrigger
|
|
40
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 V=require("react/jsx-runtime"),t=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),n=require("react"),z=require("./overlay-content.cjs.js"),B=require("./overlay-trigger.cjs.js"),J=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),a=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),K=require("../../../helpers/hooks/use-is-touch-device.cjs.js"),N=require("../../../helpers/hooks/use-is-mounted.cjs.js"),Q=3,j=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:""}),i=S=>{const E=K.useIsTouchDevice(),{children:L,placement:W="top",openWith:s=E?"click":"hover",defaultOpen:A=!1,open:c,onToggle:r,role:u="tooltip",arrowDimensions:e,offset:G=Q+((e==null?void 0:e.height)??0),focusManager:d,dismissible:v,scrollLock:y}=S,{order:O=["reference","content"],initialFocus:M,modal:f,...x}=d??{},C=M!==void 0?M:f?0:void 0,[m,F]=n.useState(A),g=n.useRef(null),R=N.useIsMounted(),p=n.useMemo(()=>r&&typeof c<"u"?c:m,[r,c,m]),h=n.useCallback(U=>{typeof c>"u"&&F(U),r==null||r(U)},[c,F,r]),{x:q,y:I,refs:l,strategy:P,context:o,middlewareData:b,placement:w}=t.useFloating({placement:W,open:p,onOpenChange:h,middleware:[a.offset(G),a.flip(),a.shift({padding:8}),a.arrow({element:g,padding:4})],whileElementsMounted:J.autoUpdate}),{getReferenceProps:k,getFloatingProps:T}=t.useInteractions([t.useHover(o,{enabled:s==="hover",handleClose:t.safePolygon()}),t.useClick(o,{toggle:v}),t.useFocus(o,{enabled:s==="hover"}),t.useRole(o,{role:u}),t.useDismiss(o,{enabled:v,outsidePressEvent:s==="click"?"mousedown":"pointerdown"})]),_=n.useId(),H=n.useMemo(()=>({open:p,onOpenChange:h,isMounted:R,openWith:s,focusManager:d?{order:O,modal:f,initialFocus:C,...x}:void 0,reference:l.setReference,floating:l.setFloating,arrowRef:g,x:q,y:I,strategy:P,getReferenceProps:k,getFloatingProps:T,arrow:{width:e==null?void 0:e.width,height:e==null?void 0:e.height,...b.arrow},context:o,placement:w,scrollLock:y,role:u,contentId:_}),[p,h,R,s,d,l.setReference,l.setFloating,g,q,I,P,k,T,e==null?void 0:e.width,e==null?void 0:e.height,b.arrow,o,w,y,u,_,f,O,C,x]);return V.jsx(j.Provider,{value:H,children:L})};i.Trigger=B.OverlayTrigger;i.Content=z.OverlayContent;exports.Overlay=i;exports.OverlayContext=j;exports.default=i;
|
|
@@ -88,6 +88,8 @@ export interface OverlayContextType {
|
|
|
88
88
|
placement: Placement;
|
|
89
89
|
context: FloatingContext<ReferenceType>;
|
|
90
90
|
scrollLock?: boolean;
|
|
91
|
+
role?: UseRoleProps['role'];
|
|
92
|
+
contentId: string;
|
|
91
93
|
}
|
|
92
94
|
export declare const OverlayContext: import('react').Context<OverlayContextType>;
|
|
93
95
|
export declare const Overlay: {
|