@tedi-design-system/react 19.1.2-rc.2 → 19.1.2-rc.4
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/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/content/table-card/table-card.cjs.js +1 -1
- package/src/tedi/components/content/table-card/table-card.d.ts +8 -0
- package/src/tedi/components/content/table-card/table-card.es.js +151 -146
- package/src/tedi/components/content/table-card/table-card.module.scss.cjs.js +1 -1
- package/src/tedi/components/content/table-card/table-card.module.scss.es.js +1 -3
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.cjs.js +1 -1
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.es.js +19 -10
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.module.scss.cjs.js +1 -1
- package/src/tedi/components/navigation/breadcrumbs/breadcrumbs.module.scss.es.js +2 -1
- package/src/tedi/components/overlays/dropdown/dropdown-context.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown-item/dropdown-item.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown-item/dropdown-item.es.js +46 -46
- package/src/tedi/components/overlays/dropdown/dropdown-trigger/dropdown-trigger.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown-trigger/dropdown-trigger.es.js +7 -6
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +95 -87
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMergeRefs as
|
|
1
|
+
import { jsx as z } from "react/jsx-runtime";
|
|
2
|
+
import { useMergeRefs as A } from "../../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
3
|
import D from "../../../../../../external/classnames/index.es.js";
|
|
4
|
-
import { isValidElement as I, cloneElement as
|
|
5
|
-
import { useDropdownContext as
|
|
4
|
+
import { isValidElement as I, cloneElement as B } from "react";
|
|
5
|
+
import { useDropdownContext as F } from "../dropdown-context.es.js";
|
|
6
6
|
import p from "./dropdown-item.module.scss.es.js";
|
|
7
|
-
const
|
|
8
|
-
n == null || n(
|
|
9
|
-
},
|
|
7
|
+
const g = (n, o) => (e) => {
|
|
8
|
+
n == null || n(e), e.defaultPrevented || o == null || o(e);
|
|
9
|
+
}, X = ({
|
|
10
10
|
children: n,
|
|
11
|
-
onClick:
|
|
12
|
-
disabled:
|
|
13
|
-
active:
|
|
11
|
+
onClick: o,
|
|
12
|
+
disabled: e,
|
|
13
|
+
active: x,
|
|
14
14
|
index: m,
|
|
15
15
|
indent: u,
|
|
16
16
|
asChild: s = !1,
|
|
17
17
|
closeOnSelect: i = !0,
|
|
18
|
-
isParent:
|
|
19
|
-
className:
|
|
20
|
-
role:
|
|
18
|
+
isParent: b = !1,
|
|
19
|
+
className: K,
|
|
20
|
+
role: a,
|
|
21
21
|
...k
|
|
22
22
|
}) => {
|
|
23
|
-
const { getItemProps:
|
|
23
|
+
const { getItemProps: l, listItemsRef: N, setOpen: c, activeIndex: P, divided: R, variant: w, navigation: E } = F(), T = s ? "div" : "button", d = s && i !== !1 && I(n), v = (t) => {
|
|
24
24
|
typeof m == "number" && (N.current[m] = t);
|
|
25
|
-
},
|
|
25
|
+
}, q = I(n) ? n.ref : void 0, V = A([v, q]), j = (t) => typeof t != "number" || t <= 0 ? {} : {
|
|
26
26
|
"--dropdown-indent-level": t,
|
|
27
27
|
"--dropdown-indent": `${t}rem`
|
|
28
|
-
},
|
|
29
|
-
if (
|
|
28
|
+
}, M = (t) => {
|
|
29
|
+
if (e) {
|
|
30
30
|
t.preventDefault();
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
@@ -37,9 +37,9 @@ const b = (n, e) => (o) => {
|
|
|
37
37
|
r.click();
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
40
|
+
o == null || o(t), (!s || d) && i && c(!1);
|
|
41
|
+
}, $ = (t) => {
|
|
42
|
+
if (e) {
|
|
43
43
|
(t.key === "Enter" || t.key === " ") && t.preventDefault();
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
@@ -48,54 +48,54 @@ const b = (n, e) => (o) => {
|
|
|
48
48
|
'input[type="checkbox"], input[type="radio"]'
|
|
49
49
|
);
|
|
50
50
|
if (r) {
|
|
51
|
-
t.preventDefault(), r.click(), !s && i &&
|
|
51
|
+
t.preventDefault(), r.click(), !s && i && c(!1);
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
if (
|
|
54
|
+
if (d) {
|
|
55
55
|
t.preventDefault(), t.currentTarget.click();
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
t.preventDefault(),
|
|
58
|
+
t.preventDefault(), o == null || o(t), !s && i && c(!1);
|
|
59
59
|
}
|
|
60
|
-
},
|
|
61
|
-
ref:
|
|
60
|
+
}, y = {
|
|
61
|
+
ref: v,
|
|
62
62
|
tabIndex: P === m ? 0 : -1,
|
|
63
63
|
className: D(
|
|
64
64
|
p["tedi-dropdown__item"],
|
|
65
65
|
{
|
|
66
|
-
[p["tedi-dropdown__item--active"]]:
|
|
67
|
-
[p["tedi-dropdown__item--disabled"]]:
|
|
66
|
+
[p["tedi-dropdown__item--active"]]: x,
|
|
67
|
+
[p["tedi-dropdown__item--disabled"]]: e,
|
|
68
68
|
[p["tedi-dropdown__item--divided"]]: R,
|
|
69
69
|
[p["tedi-dropdown__item--indent"]]: u,
|
|
70
|
-
[p["tedi-dropdown__item--tree-item"]]:
|
|
71
|
-
[p["tedi-dropdown__item--tree-parent"]]:
|
|
70
|
+
[p["tedi-dropdown__item--tree-item"]]: w === "tree" && u,
|
|
71
|
+
[p["tedi-dropdown__item--tree-parent"]]: w === "tree" && b
|
|
72
72
|
},
|
|
73
|
-
|
|
73
|
+
K
|
|
74
74
|
),
|
|
75
|
-
style:
|
|
76
|
-
onClick:
|
|
77
|
-
onKeyDown:
|
|
75
|
+
style: j(u),
|
|
76
|
+
onClick: M,
|
|
77
|
+
onKeyDown: $,
|
|
78
78
|
...k
|
|
79
|
-
}, _ = s && i === !1 ? { ...
|
|
80
|
-
role:
|
|
81
|
-
disabled: s ? void 0 :
|
|
82
|
-
...
|
|
79
|
+
}, _ = E ? { ...y, onKeyDown: void 0, tabIndex: e ? -1 : 0, role: a } : s && i === !1 ? { ...y, role: a } : l({
|
|
80
|
+
role: a ?? "menuitem",
|
|
81
|
+
disabled: s ? void 0 : e,
|
|
82
|
+
...y
|
|
83
83
|
});
|
|
84
|
-
if (
|
|
84
|
+
if (d) {
|
|
85
85
|
const t = n, r = t.props, f = _;
|
|
86
|
-
return
|
|
86
|
+
return B(t, {
|
|
87
87
|
...f,
|
|
88
|
-
ref:
|
|
88
|
+
ref: V,
|
|
89
89
|
className: D(f.className, r.className),
|
|
90
90
|
style: { ...f.style, ...r.style },
|
|
91
|
-
"aria-disabled":
|
|
92
|
-
tabIndex:
|
|
93
|
-
onClick:
|
|
94
|
-
onKeyDown:
|
|
91
|
+
"aria-disabled": e || void 0,
|
|
92
|
+
tabIndex: e ? -1 : f.tabIndex,
|
|
93
|
+
onClick: g(f.onClick, r.onClick),
|
|
94
|
+
onKeyDown: g(f.onKeyDown, r.onKeyDown)
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ z(T, { ..._, children: n });
|
|
98
98
|
};
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
X as DropdownItem
|
|
101
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),d=require("react"),f=require("../../../../helpers/get-element-ref.cjs.js"),p=require("../dropdown-context.cjs.js"),u=({children:e})=>{const{refs:t,getReferenceProps:r,navigation:n,open:o,contentId:s}=p.useDropdownContext(),i=f.getElementRef(e),c=g.useMergeRefs([t.setReference,i]),a=n?{"aria-expanded":o,"aria-controls":o?s:void 0}:void 0;return d.cloneElement(e,r({...e.props,...a,ref:c}))};exports.DropdownTrigger=u;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useMergeRefs as m } from "../../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
2
|
-
import { cloneElement as
|
|
3
|
-
import { getElementRef as
|
|
4
|
-
import { useDropdownContext as
|
|
2
|
+
import { cloneElement as a } from "react";
|
|
3
|
+
import { getElementRef as c } from "../../../../helpers/get-element-ref.es.js";
|
|
4
|
+
import { useDropdownContext as g } from "../dropdown-context.es.js";
|
|
5
5
|
const u = ({ children: e }) => {
|
|
6
|
-
const { refs:
|
|
7
|
-
return
|
|
6
|
+
const { refs: r, getReferenceProps: t, navigation: n, open: o, contentId: s } = g(), p = c(e), f = m([r.setReference, p]), i = n ? { "aria-expanded": o, "aria-controls": o ? s : void 0 } : void 0;
|
|
7
|
+
return a(
|
|
8
8
|
e,
|
|
9
|
-
|
|
9
|
+
t({
|
|
10
10
|
...e.props,
|
|
11
|
+
...i,
|
|
11
12
|
ref: f
|
|
12
13
|
})
|
|
13
14
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),e=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),e=require("../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),G=require("../../../../../external/classnames/index.cjs.js"),t=require("react"),x=require("./dropdown.module.scss.cjs.js"),J=require("./dropdown-content/dropdown-content.cjs.js"),K=require("./dropdown-context.cjs.js"),Q=require("./dropdown-helpers.cjs.js"),V=require("./dropdown-item/dropdown-item.cjs.js"),X=require("./dropdown-separator/dropdown-separator.cjs.js"),Y=require("./dropdown-trigger/dropdown-trigger.cjs.js"),Z=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),ee=require("../../../providers/label-provider/use-labels.cjs.js"),te=require("../../../../../external/@floating-ui/dom/dist/floating-ui.dom.cjs.js"),h=require("../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs.js"),ne=4,a=q=>{var S;const{getCurrentBreakpointProps:P}=Z.useBreakpointProps(q.defaultServerBreakpoint),{children:R,modal:I=!1,divided:y=!1,width:j="auto",variant:f="default",open:g,defaultOpen:N=!1,onOpenChange:l,defaultActiveIndex:o,placement:m="bottom-start",maxHeight:c,navigation:u=!1,className:_}=P(q),{getLabel:k}=ee.useLabels(),B=e.useFloatingNodeId(),D=t.useId(),b=t.useRef([]),[p,w]=t.useState(o??null),[v,T]=t.useState(null),[U,H]=t.useState(N),n=g??U;t.useEffect(()=>{n||w(o??null)},[n,o]);const C=t.useCallback(i=>{g===void 0&&H(i),l==null||l(i)},[g,l]),L=e.useFloating({nodeId:B,open:n,placement:m,onOpenChange:C,middleware:[h.offset(ne),h.flip(),h.shift()],whileElementsMounted:te.autoUpdate}),{context:r,refs:s,x:M,y:W,strategy:E}=L,O=e.useInteractions([e.useClick(r),e.useRole(r,{role:"menu",enabled:!u}),e.useDismiss(r),e.useListNavigation(r,{listRef:b,activeIndex:p,onNavigate:w,loop:!0,selectedIndex:o??null,focusItemOnOpen:o!==null?!0:"auto",enabled:!u})]),$={open:n,setOpen:C,refs:s,listItemsRef:b,activeIndex:p,setActiveIndex:w,placement:m,content:v,setContent:T,divided:y,variant:f,navigation:u,contentId:D,...O},A=(S=s.reference.current)==null?void 0:S.getBoundingClientRect().width,z=t.useMemo(()=>{const i=s.reference.current;if(!i)return;const F=i.offsetParent;if(F)return F.getBoundingClientRect().width},[s.reference.current]);return d.jsxs(K.DropdownContext.Provider,{value:$,children:[R,d.jsx(e.FloatingPortal,{children:n&&d.jsx(e.FloatingFocusManager,{context:r,modal:I,visuallyHiddenDismiss:I?k("close"):!1,children:d.jsx("div",{...O.getFloatingProps({ref:s.setFloating,className:G.default(x.default["tedi-dropdown"],{[x.default[`tedi-dropdown--${f}`]]:f==="tree"},_),style:{position:E,left:M??0,top:W??0,width:Q.resolveDropdownWidth(j,A,z)},...u?{id:D}:{role:"menu","aria-orientation":"vertical","aria-activedescendant":p!==null?`dropdown-item-${p}`:void 0}}),"data-placement":m,"data-state":n?"open":"closed",children:c!==void 0?d.jsx("div",{className:x.default["tedi-dropdown__scroll"],role:"group",tabIndex:0,style:{maxHeight:typeof c=="number"?`${c}px`:c},children:v}):v})})})]})};a.Trigger=Y.DropdownTrigger;a.Content=J.DropdownContent;a.Item=V.DropdownItem;a.Separator=X.DropdownSeparator;exports.Dropdown=a;
|
|
@@ -78,6 +78,14 @@ export interface DropdownProps extends BreakpointSupport<DropdownBreakpointProps
|
|
|
78
78
|
* the user has to press an arrow key to start navigating.
|
|
79
79
|
*/
|
|
80
80
|
defaultActiveIndex?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Navigation mode — use when the dropdown lists **links** (e.g. collapsed breadcrumbs) rather than
|
|
83
|
+
* menu commands. Drops the `menu` / `menuitem` roles, `aria-haspopup="menu"` and roving tabindex, so
|
|
84
|
+
* screen readers announce the items as links and each is a normal Tab stop. Keep it `false` (default)
|
|
85
|
+
* for action menus.
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
navigation?: boolean;
|
|
81
89
|
className?: string;
|
|
82
90
|
}
|
|
83
91
|
export declare const Dropdown: {
|
|
@@ -1,131 +1,139 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloatingNodeId as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as q, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingNodeId as z, useFloating as G, useInteractions as J, useClick as K, useRole as Q, useDismiss as V, useListNavigation as X, FloatingPortal as Y, FloatingFocusManager as Z } from "../../../../../external/@floating-ui/react/dist/floating-ui.react.es.js";
|
|
3
|
+
import ee from "../../../../../external/classnames/index.es.js";
|
|
4
4
|
import e from "react";
|
|
5
|
-
import
|
|
6
|
-
import { DropdownContent as
|
|
7
|
-
import { DropdownContext as
|
|
8
|
-
import { resolveDropdownWidth as
|
|
9
|
-
import { DropdownItem as
|
|
10
|
-
import { DropdownSeparator as
|
|
11
|
-
import { DropdownTrigger as
|
|
12
|
-
import { useBreakpointProps as
|
|
13
|
-
import { useLabels as
|
|
14
|
-
import { autoUpdate as
|
|
15
|
-
import { offset as
|
|
16
|
-
const
|
|
17
|
-
var
|
|
18
|
-
const { getCurrentBreakpointProps:
|
|
19
|
-
children:
|
|
20
|
-
modal:
|
|
21
|
-
divided:
|
|
22
|
-
width:
|
|
23
|
-
variant:
|
|
5
|
+
import h from "./dropdown.module.scss.es.js";
|
|
6
|
+
import { DropdownContent as te } from "./dropdown-content/dropdown-content.es.js";
|
|
7
|
+
import { DropdownContext as oe } from "./dropdown-context.es.js";
|
|
8
|
+
import { resolveDropdownWidth as ne } from "./dropdown-helpers.es.js";
|
|
9
|
+
import { DropdownItem as re } from "./dropdown-item/dropdown-item.es.js";
|
|
10
|
+
import { DropdownSeparator as ie } from "./dropdown-separator/dropdown-separator.es.js";
|
|
11
|
+
import { DropdownTrigger as se } from "./dropdown-trigger/dropdown-trigger.es.js";
|
|
12
|
+
import { useBreakpointProps as ae } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
+
import { useLabels as le } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
import { autoUpdate as de } from "../../../../../external/@floating-ui/dom/dist/floating-ui.dom.es.js";
|
|
15
|
+
import { offset as ce, flip as me, shift as ue } from "../../../../../external/@floating-ui/react-dom/dist/floating-ui.react-dom.es.js";
|
|
16
|
+
const pe = 4, m = (w) => {
|
|
17
|
+
var F;
|
|
18
|
+
const { getCurrentBreakpointProps: N } = ae(w.defaultServerBreakpoint), {
|
|
19
|
+
children: R,
|
|
20
|
+
modal: I = !1,
|
|
21
|
+
divided: y = !1,
|
|
22
|
+
width: P = "auto",
|
|
23
|
+
variant: u = "default",
|
|
24
24
|
open: p,
|
|
25
|
-
defaultOpen:
|
|
25
|
+
defaultOpen: S = !1,
|
|
26
26
|
onOpenChange: s,
|
|
27
27
|
defaultActiveIndex: o,
|
|
28
|
-
placement:
|
|
28
|
+
placement: f = "bottom-start",
|
|
29
29
|
maxHeight: a,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
navigation: l = !1,
|
|
31
|
+
className: k
|
|
32
|
+
} = N(w), { getLabel: B } = le(), _ = z(), x = e.useId(), D = e.useRef([]), [d, g] = e.useState(o ?? null), [v, W] = e.useState(null), [E, H] = e.useState(S), t = p ?? E;
|
|
32
33
|
e.useEffect(() => {
|
|
33
|
-
t ||
|
|
34
|
+
t || g(o ?? null);
|
|
34
35
|
}, [t, o]);
|
|
35
|
-
const
|
|
36
|
+
const O = e.useCallback(
|
|
36
37
|
(i) => {
|
|
37
|
-
p === void 0 &&
|
|
38
|
+
p === void 0 && H(i), s == null || s(i);
|
|
38
39
|
},
|
|
39
40
|
[p, s]
|
|
40
|
-
),
|
|
41
|
-
nodeId:
|
|
41
|
+
), L = G({
|
|
42
|
+
nodeId: _,
|
|
42
43
|
open: t,
|
|
43
|
-
placement:
|
|
44
|
-
onOpenChange:
|
|
45
|
-
middleware: [
|
|
46
|
-
whileElementsMounted:
|
|
47
|
-
}), { context: n, refs: r, x:
|
|
48
|
-
G(n),
|
|
49
|
-
J(n, { role: "menu" }),
|
|
44
|
+
placement: f,
|
|
45
|
+
onOpenChange: O,
|
|
46
|
+
middleware: [ce(pe), me(), ue()],
|
|
47
|
+
whileElementsMounted: de
|
|
48
|
+
}), { context: n, refs: r, x: M, y: T, strategy: $ } = L, C = J([
|
|
50
49
|
K(n),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
// In navigation mode the popup is a list of links, not a menu — disable the menu role and the
|
|
51
|
+
// roving-tabindex list navigation so items stay plain, tabbable links.
|
|
52
|
+
Q(n, { role: "menu", enabled: !l }),
|
|
53
|
+
V(n),
|
|
54
|
+
X(n, {
|
|
55
|
+
listRef: D,
|
|
56
|
+
activeIndex: d,
|
|
57
|
+
onNavigate: g,
|
|
55
58
|
loop: !0,
|
|
56
59
|
selectedIndex: o ?? null,
|
|
57
|
-
focusItemOnOpen: o !== null ? !0 : "auto"
|
|
60
|
+
focusItemOnOpen: o !== null ? !0 : "auto",
|
|
61
|
+
enabled: !l
|
|
58
62
|
})
|
|
59
|
-
]),
|
|
63
|
+
]), j = {
|
|
60
64
|
open: t,
|
|
61
|
-
setOpen:
|
|
65
|
+
setOpen: O,
|
|
62
66
|
refs: r,
|
|
63
|
-
listItemsRef:
|
|
64
|
-
activeIndex:
|
|
65
|
-
setActiveIndex:
|
|
66
|
-
placement:
|
|
67
|
-
content:
|
|
68
|
-
setContent:
|
|
69
|
-
divided:
|
|
70
|
-
variant:
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
listItemsRef: D,
|
|
68
|
+
activeIndex: d,
|
|
69
|
+
setActiveIndex: g,
|
|
70
|
+
placement: f,
|
|
71
|
+
content: v,
|
|
72
|
+
setContent: W,
|
|
73
|
+
divided: y,
|
|
74
|
+
variant: u,
|
|
75
|
+
navigation: l,
|
|
76
|
+
contentId: x,
|
|
77
|
+
...C
|
|
78
|
+
}, A = (F = r.reference.current) == null ? void 0 : F.getBoundingClientRect().width, U = e.useMemo(() => {
|
|
73
79
|
const i = r.reference.current;
|
|
74
80
|
if (!i) return;
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
81
|
+
const b = i.offsetParent;
|
|
82
|
+
if (b)
|
|
83
|
+
return b.getBoundingClientRect().width;
|
|
78
84
|
}, [r.reference.current]);
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
85
|
+
return /* @__PURE__ */ q(oe.Provider, { value: j, children: [
|
|
86
|
+
R,
|
|
87
|
+
/* @__PURE__ */ c(Y, { children: t && /* @__PURE__ */ c(
|
|
88
|
+
Z,
|
|
83
89
|
{
|
|
84
90
|
context: n,
|
|
85
|
-
modal:
|
|
86
|
-
visuallyHiddenDismiss:
|
|
87
|
-
children: /* @__PURE__ */
|
|
91
|
+
modal: I,
|
|
92
|
+
visuallyHiddenDismiss: I ? B("close") : !1,
|
|
93
|
+
children: /* @__PURE__ */ c(
|
|
88
94
|
"div",
|
|
89
95
|
{
|
|
90
|
-
...
|
|
96
|
+
...C.getFloatingProps({
|
|
91
97
|
ref: r.setFloating,
|
|
92
|
-
className:
|
|
93
|
-
|
|
94
|
-
{ [
|
|
95
|
-
|
|
98
|
+
className: ee(
|
|
99
|
+
h["tedi-dropdown"],
|
|
100
|
+
{ [h[`tedi-dropdown--${u}`]]: u === "tree" },
|
|
101
|
+
k
|
|
96
102
|
),
|
|
97
103
|
style: {
|
|
98
|
-
position:
|
|
99
|
-
left:
|
|
100
|
-
top:
|
|
101
|
-
width:
|
|
104
|
+
position: $,
|
|
105
|
+
left: M ?? 0,
|
|
106
|
+
top: T ?? 0,
|
|
107
|
+
width: ne(P, A, U)
|
|
102
108
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
...l ? { id: x } : {
|
|
110
|
+
role: "menu",
|
|
111
|
+
"aria-orientation": "vertical",
|
|
112
|
+
"aria-activedescendant": d !== null ? `dropdown-item-${d}` : void 0
|
|
113
|
+
}
|
|
106
114
|
}),
|
|
107
|
-
"data-placement":
|
|
115
|
+
"data-placement": f,
|
|
108
116
|
"data-state": t ? "open" : "closed",
|
|
109
|
-
children: a !== void 0 ? /* @__PURE__ */
|
|
117
|
+
children: a !== void 0 ? /* @__PURE__ */ c(
|
|
110
118
|
"div",
|
|
111
119
|
{
|
|
112
|
-
className:
|
|
120
|
+
className: h["tedi-dropdown__scroll"],
|
|
113
121
|
role: "group",
|
|
114
122
|
tabIndex: 0,
|
|
115
123
|
style: { maxHeight: typeof a == "number" ? `${a}px` : a },
|
|
116
|
-
children:
|
|
124
|
+
children: v
|
|
117
125
|
}
|
|
118
|
-
) :
|
|
126
|
+
) : v
|
|
119
127
|
}
|
|
120
128
|
)
|
|
121
129
|
}
|
|
122
130
|
) })
|
|
123
131
|
] });
|
|
124
132
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
133
|
+
m.Trigger = se;
|
|
134
|
+
m.Content = te;
|
|
135
|
+
m.Item = re;
|
|
136
|
+
m.Separator = ie;
|
|
129
137
|
export {
|
|
130
|
-
|
|
138
|
+
m as Dropdown
|
|
131
139
|
};
|