@tedi-design-system/react 19.1.2-rc.3 → 19.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.html +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.d.ts +6 -0
- package/src/tedi/components/form/multi-value-field/multi-value-field.es.js +126 -117
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/multi-value-field/multi-value-field.module.scss.es.js +2 -0
- package/src/tedi/components/form/select/components/select-clear-indicator.cjs.js +1 -1
- package/src/tedi/components/form/select/components/select-clear-indicator.es.js +21 -10
- package/src/tedi/components/form/select/select.cjs.js +1 -1
- package/src/tedi/components/form/select/select.d.ts +6 -0
- package/src/tedi/components/form/select/select.es.js +173 -171
- package/src/tedi/components/form/select/select.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/select/select.module.scss.es.js +2 -1
- package/src/tedi/components/form/textarea/textarea.d.ts +1 -1
- package/src/tedi/components/form/textfield/textfield.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.d.ts +6 -0
- package/src/tedi/components/form/textfield/textfield.es.js +86 -84
- package/src/tedi/components/form/textfield/textfield.module.scss.cjs.js +1 -1
- package/src/tedi/components/form/textfield/textfield.module.scss.es.js +2 -0
- 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,162 +1,164 @@
|
|
|
1
1
|
import { jsx as n, jsxs as S } from "react/jsx-runtime";
|
|
2
2
|
import _ from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import y, { forwardRef as
|
|
3
|
+
import y, { forwardRef as be, useMemo as b, useCallback as w } from "react";
|
|
4
4
|
import { Icon as D } from "../../base/icon/icon.es.js";
|
|
5
|
-
import { ClosingButton as
|
|
6
|
-
import { Separator as
|
|
5
|
+
import { ClosingButton as Ie } from "../../buttons/closing-button/closing-button.es.js";
|
|
6
|
+
import { Separator as ge } from "../../misc/separator/separator.es.js";
|
|
7
7
|
import { FeedbackText as U } from "../feedback-text/feedback-text.es.js";
|
|
8
|
-
import { Field as
|
|
9
|
-
import { FormLabel as
|
|
10
|
-
import { useOptionalInputGroup as
|
|
11
|
-
import
|
|
8
|
+
import { Field as Ne } from "../field/field.es.js";
|
|
9
|
+
import { FormLabel as Ae } from "../form-label/form-label.es.js";
|
|
10
|
+
import { useOptionalInputGroup as Ce } from "../input-group/input-group.es.js";
|
|
11
|
+
import r from "./textfield.module.scss.es.js";
|
|
12
12
|
import { useBreakpointProps as ke } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
13
|
-
import { useLabels as
|
|
14
|
-
const
|
|
13
|
+
import { useLabels as Se } from "../../../providers/label-provider/use-labels.es.js";
|
|
14
|
+
const we = {
|
|
15
15
|
large: 24,
|
|
16
16
|
default: 18
|
|
17
|
-
}, Be =
|
|
17
|
+
}, Be = be((I, J) => {
|
|
18
18
|
var M;
|
|
19
19
|
const { getCurrentBreakpointProps: Q } = ke(I.defaultServerBreakpoint), {
|
|
20
|
-
id:
|
|
20
|
+
id: ze,
|
|
21
21
|
label: g,
|
|
22
22
|
className: W,
|
|
23
23
|
inputClassName: X,
|
|
24
24
|
disabled: d,
|
|
25
|
-
required:
|
|
25
|
+
required: B,
|
|
26
26
|
hideLabel: z,
|
|
27
|
-
invalid:
|
|
27
|
+
invalid: f,
|
|
28
28
|
readOnly: F,
|
|
29
29
|
icon: i,
|
|
30
|
-
onIconClick:
|
|
30
|
+
onIconClick: x,
|
|
31
31
|
iconButtonProps: p,
|
|
32
32
|
size: s = "default",
|
|
33
33
|
placeholder: Y,
|
|
34
34
|
isArrowsHidden: Z = !0,
|
|
35
35
|
isClearable: R,
|
|
36
|
-
|
|
36
|
+
showClearOnInteraction: G,
|
|
37
|
+
onClear: v,
|
|
37
38
|
onChange: o,
|
|
38
|
-
onChangeEvent:
|
|
39
|
-
onKeyUp:
|
|
40
|
-
onKeyDown:
|
|
41
|
-
onKeyPress:
|
|
39
|
+
onChangeEvent: ee,
|
|
40
|
+
onKeyUp: re,
|
|
41
|
+
onKeyDown: te,
|
|
42
|
+
onKeyPress: ae,
|
|
42
43
|
defaultValue: $,
|
|
43
44
|
value: N,
|
|
44
45
|
onFocus: A,
|
|
45
|
-
onBlur:
|
|
46
|
-
onClick:
|
|
46
|
+
onBlur: C,
|
|
47
|
+
onClick: ie,
|
|
47
48
|
helper: e,
|
|
48
49
|
input: a,
|
|
49
|
-
name:
|
|
50
|
-
isTextArea:
|
|
51
|
-
startSlot:
|
|
52
|
-
endSlot:
|
|
53
|
-
...
|
|
54
|
-
} = Q(I) || {}, { getLabel: L } =
|
|
50
|
+
name: le,
|
|
51
|
+
isTextArea: ne,
|
|
52
|
+
startSlot: se,
|
|
53
|
+
endSlot: oe,
|
|
54
|
+
...de
|
|
55
|
+
} = Q(I) || {}, { getLabel: L } = Se(), O = y.useRef(null), T = y.useRef(null), [ce, E] = y.useState(N ?? $ ?? ""), P = N ?? ce, c = !!(R && P && !F), m = (M = Ce) == null ? void 0 : M(), fe = y.useId(), me = m == null ? void 0 : m.hasExternalLabel, u = I.id ?? (m == null ? void 0 : m.inputId) ?? fe;
|
|
55
56
|
y.useImperativeHandle(J, () => ({
|
|
56
57
|
get input() {
|
|
57
|
-
return
|
|
58
|
+
return T.current;
|
|
58
59
|
},
|
|
59
60
|
get inner() {
|
|
60
|
-
return
|
|
61
|
+
return O.current;
|
|
61
62
|
}
|
|
62
63
|
}));
|
|
63
|
-
const V = b(() => Array.isArray(e) ?
|
|
64
|
-
(
|
|
65
|
-
h ||
|
|
64
|
+
const V = b(() => Array.isArray(e) ? f || e.some((t) => t.type === "error") : f || (e == null ? void 0 : e.type) === "error", [f, e]), ue = b(() => !e || Array.isArray(e) && e.length === 0 ? !1 : Array.isArray(e) ? !f && e.every((t) => t.type === "valid") : !f && e.type === "valid", [f, e]), pe = s === "large" ? "default" : s, h = N !== void 0, ye = w(
|
|
65
|
+
(t) => {
|
|
66
|
+
h || E(t), o == null || o(t);
|
|
66
67
|
},
|
|
67
68
|
[h, o]
|
|
68
|
-
), j =
|
|
69
|
-
h ||
|
|
70
|
-
}, [h, o,
|
|
69
|
+
), j = w(() => {
|
|
70
|
+
h || E(""), o == null || o(""), v == null || v();
|
|
71
|
+
}, [h, o, v]), H = w(() => {
|
|
71
72
|
if (!i) return null;
|
|
72
|
-
const
|
|
73
|
-
size: s === "large" ? 24 : s === "small" ? !!
|
|
74
|
-
className:
|
|
75
|
-
}, q = typeof i == "string" ? { ...
|
|
76
|
-
return
|
|
73
|
+
const k = {
|
|
74
|
+
size: s === "large" ? 24 : s === "small" ? !!x ? 18 : 16 : 18,
|
|
75
|
+
className: r["tedi-textfield__icon"]
|
|
76
|
+
}, q = typeof i == "string" ? { ...k, name: i } : { ...k, ...i, className: _(k.className, i.className) };
|
|
77
|
+
return x ? /* @__PURE__ */ n(
|
|
77
78
|
"button",
|
|
78
79
|
{
|
|
79
80
|
type: "button",
|
|
80
81
|
...p,
|
|
81
|
-
className: _(
|
|
82
|
-
onClick: d ? void 0 :
|
|
82
|
+
className: _(r["tedi-textfield__icon-wrapper"], p == null ? void 0 : p.className),
|
|
83
|
+
onClick: d ? void 0 : x,
|
|
83
84
|
disabled: d,
|
|
84
85
|
children: /* @__PURE__ */ n(D, { ...q })
|
|
85
86
|
}
|
|
86
|
-
) : /* @__PURE__ */ n("div", { className:
|
|
87
|
-
}, [i, s,
|
|
88
|
-
|
|
87
|
+
) : /* @__PURE__ */ n("div", { className: r["tedi-textfield__icon-wrapper"], "aria-hidden": "true", children: /* @__PURE__ */ n(D, { ...q }) });
|
|
88
|
+
}, [i, s, x, p, d]), K = b(() => c ? /* @__PURE__ */ n(
|
|
89
|
+
Ie,
|
|
89
90
|
{
|
|
90
|
-
iconSize:
|
|
91
|
+
iconSize: we[s === "large" ? "large" : "default"],
|
|
91
92
|
onClick: d ? void 0 : j,
|
|
92
93
|
disabled: d,
|
|
93
94
|
title: L("clear"),
|
|
94
|
-
className:
|
|
95
|
+
className: r["tedi-textfield__clear-button"]
|
|
95
96
|
}
|
|
96
|
-
) : null, [
|
|
97
|
+
) : null, [c, s, d, j, L]), xe = b(() => !c && !i ? null : /* @__PURE__ */ S("div", { className: r["tedi-textfield__right-area"], children: [
|
|
97
98
|
K,
|
|
98
|
-
|
|
99
|
+
c && i && /* @__PURE__ */ n(ge, { color: "primary", axis: "vertical", className: r["tedi-textfield__separator"] }),
|
|
99
100
|
i && H()
|
|
100
|
-
] }), [
|
|
101
|
-
|
|
101
|
+
] }), [c, i, K, H]), ve = /* @__PURE__ */ n(
|
|
102
|
+
Ne,
|
|
102
103
|
{
|
|
103
104
|
...a,
|
|
104
105
|
id: u,
|
|
105
|
-
name:
|
|
106
|
+
name: le,
|
|
106
107
|
value: P,
|
|
107
108
|
defaultValue: $,
|
|
108
|
-
onChange:
|
|
109
|
-
onChangeEvent:
|
|
109
|
+
onChange: ye,
|
|
110
|
+
onChangeEvent: ee,
|
|
110
111
|
disabled: d,
|
|
111
112
|
readOnly: F || (a == null ? void 0 : a.readOnly),
|
|
112
|
-
required:
|
|
113
|
+
required: B,
|
|
113
114
|
invalid: V,
|
|
114
115
|
placeholder: Y,
|
|
115
|
-
className: _(
|
|
116
|
-
[
|
|
116
|
+
className: _(r["tedi-textfield__input"], X, {
|
|
117
|
+
[r["tedi-textfield__input--hidden-arrows"]]: Z
|
|
117
118
|
}),
|
|
118
|
-
onFocus: (
|
|
119
|
+
onFocus: (t) => {
|
|
119
120
|
var l;
|
|
120
|
-
(l = a == null ? void 0 : a.onFocus) == null || l.call(a,
|
|
121
|
+
(l = a == null ? void 0 : a.onFocus) == null || l.call(a, t), A == null || A(t);
|
|
121
122
|
},
|
|
122
|
-
onBlur: (
|
|
123
|
+
onBlur: (t) => {
|
|
123
124
|
var l;
|
|
124
|
-
(l = a == null ? void 0 : a.onBlur) == null || l.call(a,
|
|
125
|
+
(l = a == null ? void 0 : a.onBlur) == null || l.call(a, t), C == null || C(t);
|
|
125
126
|
},
|
|
126
|
-
isTextArea:
|
|
127
|
-
"aria-describedby": !e || Array.isArray(e) && e.length === 0 ? void 0 : Array.isArray(e) ? e.map((
|
|
127
|
+
isTextArea: ne,
|
|
128
|
+
"aria-describedby": !e || Array.isArray(e) && e.length === 0 ? void 0 : Array.isArray(e) ? e.map((t, l) => `${u}-helper-${l}`).join(" ") : `${u}-helper`,
|
|
128
129
|
"aria-label": z && typeof g == "string" ? g : void 0,
|
|
129
|
-
ref:
|
|
130
|
+
ref: T
|
|
130
131
|
}
|
|
131
|
-
),
|
|
132
|
-
|
|
133
|
-
{ [
|
|
134
|
-
{ [
|
|
135
|
-
{ [
|
|
136
|
-
{ [
|
|
137
|
-
{ [
|
|
132
|
+
), he = _(
|
|
133
|
+
r["tedi-textfield"],
|
|
134
|
+
{ [r[`tedi-textfield--${s}`]]: s },
|
|
135
|
+
{ [r["tedi-textfield--with-icon"]]: i },
|
|
136
|
+
{ [r["tedi-textfield--invalid"]]: V },
|
|
137
|
+
{ [r["tedi-textfield--valid"]]: ue },
|
|
138
|
+
{ [r["tedi-textfield--clearable"]]: c },
|
|
139
|
+
{ [r["tedi-textfield--clear-on-interaction"]]: c && G },
|
|
138
140
|
W
|
|
139
|
-
),
|
|
140
|
-
return /* @__PURE__ */ S("div", { "data-name": "textfield", ...
|
|
141
|
-
!
|
|
141
|
+
), _e = () => !e || Array.isArray(e) && e.length === 0 ? null : /* @__PURE__ */ n("div", { className: r["tedi-textfield__feedback-wrapper"], children: Array.isArray(e) ? e.map((t, l) => /* @__PURE__ */ n(U, { ...t, id: `${u}-helper-${l}` }, l)) : /* @__PURE__ */ n(U, { ...e, id: `${u}-helper` }) });
|
|
142
|
+
return /* @__PURE__ */ S("div", { "data-name": "textfield", ...de, className: he, children: [
|
|
143
|
+
!me && /* @__PURE__ */ n(Ae, { id: u, label: g, required: B, hideLabel: z, size: pe }),
|
|
142
144
|
/* @__PURE__ */ S(
|
|
143
145
|
"div",
|
|
144
146
|
{
|
|
145
|
-
className:
|
|
146
|
-
onKeyDown:
|
|
147
|
-
onKeyUp:
|
|
148
|
-
onKeyPress:
|
|
149
|
-
onClick:
|
|
150
|
-
ref:
|
|
147
|
+
className: r["tedi-textfield__inner"],
|
|
148
|
+
onKeyDown: te,
|
|
149
|
+
onKeyUp: re,
|
|
150
|
+
onKeyPress: ae,
|
|
151
|
+
onClick: ie,
|
|
152
|
+
ref: O,
|
|
151
153
|
children: [
|
|
152
|
-
ne,
|
|
153
|
-
ve,
|
|
154
154
|
se,
|
|
155
|
-
|
|
155
|
+
ve,
|
|
156
|
+
oe,
|
|
157
|
+
(R || i) && xe
|
|
156
158
|
]
|
|
157
159
|
}
|
|
158
160
|
),
|
|
159
|
-
|
|
161
|
+
_e()
|
|
160
162
|
] });
|
|
161
163
|
});
|
|
162
164
|
Be.displayName = "TextField";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-textfield":"tedi-textfield-376bbeed","tedi-textfield__inner":"tedi-textfield__inner-98791cdd","tedi-textfield__input":"tedi-textfield__input-ade0f9a6","tedi-textfield--invalid":"tedi-textfield--invalid-290ce18d","tedi-textfield--valid":"tedi-textfield--valid-273af8c0","tedi-textfield--clearable":"tedi-textfield--clearable-f47f0508","tedi-textfield--with-icon":"tedi-textfield--with-icon-db2c6f01","tedi-textfield--small":"tedi-textfield--small-4ffcc517","tedi-textfield--large":"tedi-textfield--large-0e4d788c","tedi-textfield__right-area":"tedi-textfield__right-area-6ac81c6b","tedi-textfield__icon-wrapper":"tedi-textfield__icon-wrapper-4935814e","tedi-textfield--inline":"tedi-textfield--inline-7ed55c4e","tedi-textfield__icon":"tedi-textfield__icon-05d4adc8","tedi-textfield__feedback-wrapper":"tedi-textfield__feedback-wrapper-9d47f9c6","tedi-textfield__separator":"tedi-textfield__separator-63d1ba14"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-textfield":"tedi-textfield-376bbeed","tedi-textfield__inner":"tedi-textfield__inner-98791cdd","tedi-textfield__input":"tedi-textfield__input-ade0f9a6","tedi-textfield--invalid":"tedi-textfield--invalid-290ce18d","tedi-textfield--valid":"tedi-textfield--valid-273af8c0","tedi-textfield--clearable":"tedi-textfield--clearable-f47f0508","tedi-textfield--with-icon":"tedi-textfield--with-icon-db2c6f01","tedi-textfield--small":"tedi-textfield--small-4ffcc517","tedi-textfield--large":"tedi-textfield--large-0e4d788c","tedi-textfield__right-area":"tedi-textfield__right-area-6ac81c6b","tedi-textfield--clear-on-interaction":"tedi-textfield--clear-on-interaction-155ed896","tedi-textfield__clear-button":"tedi-textfield__clear-button-edbbffef","tedi-textfield__icon-wrapper":"tedi-textfield__icon-wrapper-4935814e","tedi-textfield--inline":"tedi-textfield--inline-7ed55c4e","tedi-textfield__icon":"tedi-textfield__icon-05d4adc8","tedi-textfield__feedback-wrapper":"tedi-textfield__feedback-wrapper-9d47f9c6","tedi-textfield__separator":"tedi-textfield__separator-63d1ba14"};exports.default=e;
|
|
@@ -9,6 +9,8 @@ const e = {
|
|
|
9
9
|
"tedi-textfield--small": "tedi-textfield--small-4ffcc517",
|
|
10
10
|
"tedi-textfield--large": "tedi-textfield--large-0e4d788c",
|
|
11
11
|
"tedi-textfield__right-area": "tedi-textfield__right-area-6ac81c6b",
|
|
12
|
+
"tedi-textfield--clear-on-interaction": "tedi-textfield--clear-on-interaction-155ed896",
|
|
13
|
+
"tedi-textfield__clear-button": "tedi-textfield__clear-button-edbbffef",
|
|
12
14
|
"tedi-textfield__icon-wrapper": "tedi-textfield__icon-wrapper-4935814e",
|
|
13
15
|
"tedi-textfield--inline": "tedi-textfield--inline-7ed55c4e",
|
|
14
16
|
"tedi-textfield__icon": "tedi-textfield__icon-05d4adc8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),S=require("../../base/icon/icon.cjs.js"),M=require("../../buttons/button/button.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("../../../../../external/classnames/index.cjs.js"),l=require("react"),S=require("../../base/icon/icon.cjs.js"),M=require("../../buttons/button/button.cjs.js"),s=require("./breadcrumbs.module.scss.cjs.js"),P=require("../../../helpers/hooks/use-breakpoint-props.cjs.js"),D=require("../../../providers/label-provider/use-labels.cjs.js"),d=require("../../overlays/dropdown/dropdown.cjs.js"),N=i=>{const o=[];return l.Children.forEach(i,a=>{if(l.isValidElement(a)){if(a.type===l.Fragment){o.push(...N(a.props.children));return}o.push(a)}}),o},E=e.jsx(S.Icon,{name:"chevron_right",size:16,color:"brand"}),y=i=>{const{children:o,ariaLabel:a,showMoreLabel:k,separator:w=E,className:p}=i,{getCurrentBreakpointProps:v}=P.useBreakpointProps(i.defaultServerBreakpoint),{variant:B="long",maxItems:h,itemsBeforeCollapse:q=1,itemsAfterCollapse:C=1}=v(i),{getLabel:f}=D.useLabels(),x=a??f("breadcrumbs"),L=k??f("breadcrumbs.show-more"),t=N(o);if(t.length===0)return null;if(B==="short"){if(t.length<2)return null;const r=t[t.length-2],c=r.props,n=typeof r.type!="string"&&c.iconLeft===void 0?l.cloneElement(r,{iconLeft:"arrow_back"}):r;return e.jsx("nav",{"aria-label":x,className:b.default(s.default["tedi-breadcrumbs"],p),children:e.jsx("ol",{className:s.default["tedi-breadcrumbs__list"],children:e.jsx("li",{className:s.default["tedi-breadcrumbs__item"],children:n})})})}const u=Math.max(0,q),m=Math.max(1,C),g=h!==void 0&&t.length>h&&t.length>u+m?[...t.slice(0,u).map(r=>({kind:"item",element:r})),{kind:"ellipsis",hidden:t.slice(u,t.length-m)},...t.slice(t.length-m).map(r=>({kind:"item",element:r}))]:t.map(r=>({kind:"item",element:r})),_=g.length-1;return e.jsx("nav",{"aria-label":x,className:b.default(s.default["tedi-breadcrumbs"],p),children:e.jsx("ol",{className:s.default["tedi-breadcrumbs__list"],children:g.map((r,c)=>e.jsxs(l.Fragment,{children:[r.kind==="item"?e.jsx("li",{className:b.default(s.default["tedi-breadcrumbs__item"],{[s.default["tedi-breadcrumbs__current"]]:c===_}),children:r.element}):e.jsx("li",{className:s.default["tedi-breadcrumbs__item"],children:e.jsxs(d.Dropdown,{navigation:!0,children:[e.jsx(d.Dropdown.Trigger,{children:e.jsxs(M.Button,{noStyle:!0,className:s.default["tedi-breadcrumbs__ellipsis"],children:[e.jsx("span",{"aria-hidden":"true",children:"…"}),e.jsx("span",{className:"sr-only",children:L})]})}),e.jsx(d.Dropdown.Content,{children:r.hidden.map((n,j)=>{const I=typeof n.type!="string"?l.cloneElement(n,{noStyle:!0}):n;return e.jsx(d.Dropdown.Item,{index:j,asChild:!0,className:s.default["tedi-breadcrumbs__dropdown-link"],children:I},n.key??j)})})]})}),c<_&&e.jsx("li",{className:s.default["tedi-breadcrumbs__separator"],"aria-hidden":"true",children:w})]},c))})})};y.displayName="Breadcrumbs";exports.Breadcrumbs=y;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import u from "../../../../../external/classnames/index.es.js";
|
|
3
|
-
import { cloneElement as k, Fragment as
|
|
3
|
+
import { cloneElement as k, Fragment as v, Children as P, isValidElement as j } from "react";
|
|
4
4
|
import { Icon as A } from "../../base/icon/icon.es.js";
|
|
5
5
|
import { Button as T } from "../../buttons/button/button.es.js";
|
|
6
6
|
import s from "./breadcrumbs.module.scss.es.js";
|
|
7
7
|
import { useBreakpointProps as z } from "../../../helpers/hooks/use-breakpoint-props.es.js";
|
|
8
8
|
import { useLabels as D } from "../../../providers/label-provider/use-labels.es.js";
|
|
9
9
|
import { Dropdown as c } from "../../overlays/dropdown/dropdown.es.js";
|
|
10
|
-
const
|
|
10
|
+
const C = (l) => {
|
|
11
11
|
const i = [];
|
|
12
12
|
return P.forEach(l, (a) => {
|
|
13
13
|
if (j(a)) {
|
|
14
|
-
if (a.type ===
|
|
15
|
-
i.push(...
|
|
14
|
+
if (a.type === v) {
|
|
15
|
+
i.push(...C(a.props.children));
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
18
|
i.push(a);
|
|
19
19
|
}
|
|
20
20
|
}), i;
|
|
21
21
|
}, F = /* @__PURE__ */ r(A, { name: "chevron_right", size: 16, color: "brand" }), V = (l) => {
|
|
22
|
-
const { children: i, ariaLabel: a, showMoreLabel: B, separator:
|
|
22
|
+
const { children: i, ariaLabel: a, showMoreLabel: B, separator: w = F, className: h } = l, { getCurrentBreakpointProps: L } = z(l.defaultServerBreakpoint), {
|
|
23
23
|
variant: x = "long",
|
|
24
24
|
maxItems: b,
|
|
25
25
|
itemsBeforeCollapse: I = 1,
|
|
26
26
|
itemsAfterCollapse: M = 1
|
|
27
|
-
} =
|
|
27
|
+
} = L(l), { getLabel: f } = D(), _ = a ?? f("breadcrumbs"), S = B ?? f("breadcrumbs.show-more"), t = C(i);
|
|
28
28
|
if (t.length === 0) return null;
|
|
29
29
|
if (x === "short") {
|
|
30
30
|
if (t.length < 2) return null;
|
|
@@ -39,7 +39,7 @@ const v = (l) => {
|
|
|
39
39
|
},
|
|
40
40
|
...t.slice(t.length - d).map((e) => ({ kind: "item", element: e }))
|
|
41
41
|
] : t.map((e) => ({ kind: "item", element: e })), N = g.length - 1;
|
|
42
|
-
return /* @__PURE__ */ r("nav", { "aria-label": _, className: u(s["tedi-breadcrumbs"], h), children: /* @__PURE__ */ r("ol", { className: s["tedi-breadcrumbs__list"], children: g.map((e, o) => /* @__PURE__ */ p(
|
|
42
|
+
return /* @__PURE__ */ r("nav", { "aria-label": _, className: u(s["tedi-breadcrumbs"], h), children: /* @__PURE__ */ r("ol", { className: s["tedi-breadcrumbs__list"], children: g.map((e, o) => /* @__PURE__ */ p(v, { children: [
|
|
43
43
|
e.kind === "item" ? /* @__PURE__ */ r(
|
|
44
44
|
"li",
|
|
45
45
|
{
|
|
@@ -48,17 +48,26 @@ const v = (l) => {
|
|
|
48
48
|
}),
|
|
49
49
|
children: e.element
|
|
50
50
|
}
|
|
51
|
-
) : /* @__PURE__ */ r("li", { className: s["tedi-breadcrumbs__item"], children: /* @__PURE__ */ p(c, { children: [
|
|
51
|
+
) : /* @__PURE__ */ r("li", { className: s["tedi-breadcrumbs__item"], children: /* @__PURE__ */ p(c, { navigation: !0, children: [
|
|
52
52
|
/* @__PURE__ */ r(c.Trigger, { children: /* @__PURE__ */ p(T, { noStyle: !0, className: s["tedi-breadcrumbs__ellipsis"], children: [
|
|
53
53
|
/* @__PURE__ */ r("span", { "aria-hidden": "true", children: "…" }),
|
|
54
54
|
/* @__PURE__ */ r("span", { className: "sr-only", children: S })
|
|
55
55
|
] }) }),
|
|
56
56
|
/* @__PURE__ */ r(c.Content, { children: e.hidden.map((n, y) => {
|
|
57
57
|
const E = typeof n.type != "string" ? k(n, { noStyle: !0 }) : n;
|
|
58
|
-
return /* @__PURE__ */ r(
|
|
58
|
+
return /* @__PURE__ */ r(
|
|
59
|
+
c.Item,
|
|
60
|
+
{
|
|
61
|
+
index: y,
|
|
62
|
+
asChild: !0,
|
|
63
|
+
className: s["tedi-breadcrumbs__dropdown-link"],
|
|
64
|
+
children: E
|
|
65
|
+
},
|
|
66
|
+
n.key ?? y
|
|
67
|
+
);
|
|
59
68
|
}) })
|
|
60
69
|
] }) }),
|
|
61
|
-
o < N && /* @__PURE__ */ r("li", { className: s["tedi-breadcrumbs__separator"], "aria-hidden": "true", children:
|
|
70
|
+
o < N && /* @__PURE__ */ r("li", { className: s["tedi-breadcrumbs__separator"], "aria-hidden": "true", children: w })
|
|
62
71
|
] }, o)) }) });
|
|
63
72
|
};
|
|
64
73
|
V.displayName = "Breadcrumbs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-breadcrumbs":"tedi-breadcrumbs-0247287c","tedi-breadcrumbs__list":"tedi-breadcrumbs__list-10d5a5f4","tedi-breadcrumbs__item":"tedi-breadcrumbs__item-d8534029","tedi-breadcrumbs__separator":"tedi-breadcrumbs__separator-7f7b6f95","tedi-breadcrumbs__current":"tedi-breadcrumbs__current-db9fd67c","tedi-breadcrumbs__ellipsis":"tedi-breadcrumbs__ellipsis-0b4cdcac"};exports.default=e;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-breadcrumbs":"tedi-breadcrumbs-0247287c","tedi-breadcrumbs__list":"tedi-breadcrumbs__list-10d5a5f4","tedi-breadcrumbs__item":"tedi-breadcrumbs__item-d8534029","tedi-breadcrumbs__separator":"tedi-breadcrumbs__separator-7f7b6f95","tedi-breadcrumbs__current":"tedi-breadcrumbs__current-db9fd67c","tedi-breadcrumbs__ellipsis":"tedi-breadcrumbs__ellipsis-0b4cdcac","tedi-breadcrumbs__dropdown-link":"tedi-breadcrumbs__dropdown-link-a476c274"};exports.default=e;
|
|
@@ -4,7 +4,8 @@ const e = {
|
|
|
4
4
|
"tedi-breadcrumbs__item": "tedi-breadcrumbs__item-d8534029",
|
|
5
5
|
"tedi-breadcrumbs__separator": "tedi-breadcrumbs__separator-7f7b6f95",
|
|
6
6
|
"tedi-breadcrumbs__current": "tedi-breadcrumbs__current-db9fd67c",
|
|
7
|
-
"tedi-breadcrumbs__ellipsis": "tedi-breadcrumbs__ellipsis-0b4cdcac"
|
|
7
|
+
"tedi-breadcrumbs__ellipsis": "tedi-breadcrumbs__ellipsis-0b4cdcac",
|
|
8
|
+
"tedi-breadcrumbs__dropdown-link": "tedi-breadcrumbs__dropdown-link-a476c274"
|
|
8
9
|
};
|
|
9
10
|
export {
|
|
10
11
|
e as default
|
|
@@ -15,6 +15,14 @@ export type DropdownContextValue = {
|
|
|
15
15
|
setContent: (content: React.ReactNode) => void;
|
|
16
16
|
divided?: boolean;
|
|
17
17
|
variant?: 'default' | 'tree';
|
|
18
|
+
/**
|
|
19
|
+
* Navigation mode: the dropdown holds links rather than menu commands. Disables the
|
|
20
|
+
* `menu`/`menuitem` roles and roving tabindex so items are announced as links and are
|
|
21
|
+
* natural Tab stops.
|
|
22
|
+
*/
|
|
23
|
+
navigation?: boolean;
|
|
24
|
+
/** Id applied to the floating content; referenced by the trigger's `aria-controls` in navigation mode. */
|
|
25
|
+
contentId?: string;
|
|
18
26
|
};
|
|
19
27
|
export declare const DropdownContext: React.Context<DropdownContextValue | null>;
|
|
20
28
|
export declare const useDropdownContext: () => DropdownContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react/jsx-runtime"),z=require("../../../../../../external/@floating-ui/react/dist/floating-ui.react.cjs.js"),D=require("../../../../../../external/classnames/index.cjs.js"),w=require("react"),A=require("../dropdown-context.cjs.js"),u=require("./dropdown-item.module.scss.cjs.js"),g=(n,o)=>t=>{n==null||n(t),t.defaultPrevented||o==null||o(t)},B=({children:n,onClick:o,disabled:t,active:x,index:a,indent:d,asChild:s=!1,closeOnSelect:f=!0,isParent:I=!1,className:b,role:p,...q})=>{const{getItemProps:R,listItemsRef:K,setOpen:c,activeIndex:P,divided:k,variant:l,navigation:E}=A.useDropdownContext(),N=s?"div":"button",m=s&&f!==!1&&w.isValidElement(n),v=e=>{typeof a=="number"&&(K.current[a]=e)},T=w.isValidElement(n)?n.ref:void 0,j=z.useMergeRefs([v,T]),V=e=>typeof e!="number"||e<=0?{}:{"--dropdown-indent-level":e,"--dropdown-indent":`${e}rem`},M=e=>{if(t){e.preventDefault();return}const r=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');if(r){r.click();return}o==null||o(e),(!s||m)&&f&&c(!1)},S=e=>{if(t){(e.key==="Enter"||e.key===" ")&&e.preventDefault();return}if(e.key==="Enter"||e.key===" "){const r=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');if(r){e.preventDefault(),r.click(),!s&&f&&c(!1);return}if(m){e.preventDefault(),e.currentTarget.click();return}e.preventDefault(),o==null||o(e),!s&&f&&c(!1)}},y={ref:v,tabIndex:P===a?0:-1,className:D.default(u.default["tedi-dropdown__item"],{[u.default["tedi-dropdown__item--active"]]:x,[u.default["tedi-dropdown__item--disabled"]]:t,[u.default["tedi-dropdown__item--divided"]]:k,[u.default["tedi-dropdown__item--indent"]]:d,[u.default["tedi-dropdown__item--tree-item"]]:l==="tree"&&d,[u.default["tedi-dropdown__item--tree-parent"]]:l==="tree"&&I},b),style:V(d),onClick:M,onKeyDown:S,...q},_=E?{...y,onKeyDown:void 0,tabIndex:t?-1:0,role:p}:s&&f===!1?{...y,role:p}:R({role:p??"menuitem",disabled:s?void 0:t,...y});if(m){const e=n,r=e.props,i=_;return w.cloneElement(e,{...i,ref:j,className:D.default(i.className,r.className),style:{...i.style,...r.style},"aria-disabled":t||void 0,tabIndex:t?-1:i.tabIndex,onClick:g(i.onClick,r.onClick),onKeyDown:g(i.onKeyDown,r.onKeyDown)})}return U.jsx(N,{..._,children:n})};exports.DropdownItem=B;
|
|
@@ -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;
|