@epam/ai-dial-ui-kit 0.16.0-dev.12 → 0.16.0-dev.13

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.
@@ -1,316 +1,385 @@
1
- import { jsxs as N, Fragment as A, jsx as n } from "react/jsx-runtime";
2
- import { useFloatingNodeId as ye, useFloating as we, autoUpdate as ve, offset as xe, autoPlacement as Ce, flip as ke, shift as be, size as Ie, useClick as Pe, useHover as Ee, safePolygon as Ne, useDismiss as Ae, useRole as De, useInteractions as Me, FloatingTree as Fe, FloatingNode as Te, FloatingPortal as Oe, FloatingFocusManager as Re } from "@floating-ui/react";
3
- import { useState as j, useRef as Le, useCallback as m, useId as Se, useEffect as U, useMemo as _e, Fragment as $e } from "react";
4
- import { InteractiveTooltip as Be } from "../InteractiveTooltip/InteractiveTooltip.js";
5
- import { DIAL_KIT_CLASS as V } from "../../../constants/public-class-names.js";
6
- import { DropdownTrigger as y, DropdownItemType as X } from "../../../types/dropdown.js";
7
- import { MenuItemMark as Ye } from "../../../types/menu-item.js";
8
- import { dropdownGap as w, dropdownDividerClassName as Ke, dropdownItemListClassName as We, dropdownBaseClassName as je, dropdownListBaseClassName as Ue } from "./constants.js";
9
- import { CloseButton as Ve } from "../CloseButton/CloseButton.js";
10
- import { MenuItem as Xe } from "../MenuItem/MenuItem.js";
11
- import { useThemeScope as qe } from "../ThemeScope/ThemeScope.js";
12
- import { mergeClasses as v } from "../../../utils/merge-classes.js";
13
- import { DropdownSubMenuItem as ze } from "./DropdownSubMenuItem.js";
14
- import { resolveItemMark as Ge, getItemRole as He } from "./item-mark.js";
15
- const Je = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]', Qe = (l) => !l.hasAttribute("disabled") && l.getAttribute("aria-disabled") !== "true", Ze = ["ArrowDown", "ArrowUp", "Home", "End"], et = (l, d, u) => {
1
+ import { jsxs as S, Fragment as R, jsx as o } from "react/jsx-runtime";
2
+ import { useFloatingNodeId as Te, useFloating as Le, autoUpdate as Oe, offset as Re, autoPlacement as be, flip as _e, shift as $e, size as Be, useClick as Ye, useHover as He, safePolygon as Ke, useDismiss as Ue, useRole as We, useInteractions as je, FloatingTree as ze, FloatingNode as Qe, FloatingPortal as qe, FloatingFocusManager as Xe } from "@floating-ui/react";
3
+ import { useState as b, useRef as Ge, useCallback as h, useId as Je, useEffect as oe, useMemo as ne, Fragment as Ze } from "react";
4
+ import { InteractiveTooltip as Ve } from "../InteractiveTooltip/InteractiveTooltip.js";
5
+ import { DIAL_KIT_CLASS as _ } from "../../../constants/public-class-names.js";
6
+ import { DropdownTrigger as k, DropdownItemType as re } from "../../../types/dropdown.js";
7
+ import { MenuItemMark as et } from "../../../types/menu-item.js";
8
+ import { dropdownGap as N, dropdownSearchClassName as tt, dropdownNoResultsClassName as ot, dropdownDividerClassName as nt, getDropdownListHeight as rt, dropdownItemListClassName as st, dropdownBaseClassName as lt, dropdownListBaseClassName as it } from "./constants.js";
9
+ import { CloseButton as ct } from "../CloseButton/CloseButton.js";
10
+ import { MenuItem as at } from "../MenuItem/MenuItem.js";
11
+ import { Search as dt } from "../Search/Search.js";
12
+ import { useThemeScope as ut } from "../ThemeScope/ThemeScope.js";
13
+ import { ElementSize as ft } from "../../../types/size.js";
14
+ import { mergeClasses as y } from "../../../utils/merge-classes.js";
15
+ import { DropdownSubMenuItem as pt } from "./DropdownSubMenuItem.js";
16
+ import { resolveItemMark as mt, getItemRole as ht } from "./item-mark.js";
17
+ import { highlightDropdownItems as gt, filterDropdownItems as wt } from "./search.js";
18
+ const yt = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]', vt = (l) => !l.hasAttribute("disabled") && l.getAttribute("aria-disabled") !== "true", Ct = ["ArrowDown", "ArrowUp", "Home", "End"], xt = (l, d, f) => {
16
19
  if (l === "Home") return 0;
17
- if (l === "End") return u - 1;
18
- const a = l === "ArrowDown" ? 1 : -1;
19
- return d === -1 ? a === 1 ? 0 : u - 1 : (d + a + u) % u;
20
- }, tt = (l) => "clientWidth" in l ? l.clientWidth : l.getBoundingClientRect?.()?.width ?? 0, gt = ({
20
+ if (l === "End") return f - 1;
21
+ const u = l === "ArrowDown" ? 1 : -1;
22
+ return d === -1 ? u === 1 ? 0 : f - 1 : (d + u + f) % f;
23
+ }, kt = (l) => "clientWidth" in l ? l.clientWidth : l.getBoundingClientRect?.()?.width ?? 0, Yt = ({
21
24
  children: l,
22
25
  items: d,
23
- onItemClick: u,
24
- menuHeader: a,
25
- menuFooter: h,
26
- renderOverlay: I,
27
- trigger: f = [y.Click],
28
- placement: D,
29
- disabled: i = !1,
30
- open: M,
31
- defaultOpen: q = !1,
32
- onOpenChange: F,
33
- closable: z = !1,
34
- onClose: G,
35
- className: H,
36
- overlayContentClassName: T,
37
- separatorClassName: O,
38
- listClassName: J,
39
- listStyle: R,
40
- outsidePressIgnoreRef: L,
41
- outsideClosable: Q = !0,
42
- allowedPlacements: Z,
43
- anchorToMouse: x = !1,
44
- matchReferenceWidth: P = !0,
45
- maxDropdownHeight: S,
46
- initialFocus: _
26
+ onItemClick: f,
27
+ menuHeader: u,
28
+ menuFooter: v,
29
+ renderOverlay: E,
30
+ trigger: g = [k.Click],
31
+ placement: $,
32
+ disabled: c = !1,
33
+ open: B,
34
+ defaultOpen: se = !1,
35
+ onOpenChange: Y,
36
+ closable: le = !1,
37
+ onClose: ie,
38
+ className: ce,
39
+ overlayContentClassName: H,
40
+ separatorClassName: K,
41
+ listClassName: ae,
42
+ listStyle: U,
43
+ outsidePressIgnoreRef: W,
44
+ outsideClosable: de = !0,
45
+ allowedPlacements: ue,
46
+ anchorToMouse: D = !1,
47
+ matchReferenceWidth: F = !0,
48
+ maxDropdownHeight: j,
49
+ initialFocus: z,
50
+ searchable: i = !1,
51
+ searchValue: T,
52
+ onSearchChange: Q,
53
+ searchPlaceholder: L = "Search",
54
+ searchClearLabel: q = "Clear search",
55
+ noResultsLabel: X = "No results found",
56
+ filterItem: G,
57
+ maxVisibleItems: C
47
58
  }) => {
48
- const ee = qe(), [te, ne] = j(q), E = M !== void 0, c = E ? !!M : te, C = Le(null), [oe, re] = j(!0), o = m(
49
- (e, t, r) => {
50
- e && re(r !== "hover" && r !== "safe-polygon"), E || ne(e), F?.(e);
59
+ const fe = ut(), [pe, me] = b(se), O = B !== void 0, a = O ? !!B : pe, I = Ge(null), [he, ge] = b(""), p = T ?? he, M = h(
60
+ (t) => {
61
+ T === void 0 && ge(t), Q?.(t);
51
62
  },
52
- [E, F]
53
- ), $ = Se(), se = D === void 0, B = ye(), { refs: p, floatingStyles: Y, context: g } = we({
54
- nodeId: B,
55
- placement: D,
56
- open: c,
57
- onOpenChange: o,
58
- whileElementsMounted: ve,
63
+ [T, Q]
64
+ ), [we, ye] = b(!0), n = h(
65
+ (t, e, r) => {
66
+ t ? ye(r !== "hover" && r !== "safe-polygon") : i && p && M(""), O || me(t), Y?.(t);
67
+ },
68
+ [O, Y, i, p, M]
69
+ ), J = Je(), ve = $ === void 0, Z = Te(), { refs: w, floatingStyles: V, context: x } = Le({
70
+ nodeId: Z,
71
+ placement: $,
72
+ open: a,
73
+ onOpenChange: n,
74
+ whileElementsMounted: Oe,
59
75
  middleware: [
60
- xe({ mainAxis: w, crossAxis: 0 }),
61
- se ? Ce({
76
+ Re({ mainAxis: N, crossAxis: 0 }),
77
+ ve ? be({
62
78
  alignment: "start",
63
79
  crossAxis: !0,
64
- padding: w,
65
- allowedPlacements: Z
66
- }) : ke({ padding: w }),
67
- be({ padding: w }),
68
- Ie({
69
- padding: w,
70
- apply({ availableWidth: e, availableHeight: t, elements: r }) {
71
- const s = r.floating, b = tt(r.reference);
80
+ padding: N,
81
+ allowedPlacements: ue
82
+ }) : _e({ padding: N }),
83
+ $e({ padding: N }),
84
+ Be({
85
+ padding: N,
86
+ apply({ availableWidth: t, availableHeight: e, elements: r }) {
87
+ const s = r.floating, m = kt(r.reference);
72
88
  s.style.setProperty(
73
89
  "--fui-available-height",
74
- `${Math.floor(t)}px`
90
+ `${Math.floor(e)}px`
75
91
  ), s.style.setProperty(
76
92
  "--reference-width",
77
- P ? `${Math.round(b)}px` : "0px"
78
- ), P ? s.style.minWidth = `${Math.round(b)}px` : s.style.removeProperty("min-width"), s.style.maxWidth = `${Math.floor(e)}px`;
79
- const W = Math.floor(t);
80
- s.style.maxHeight = `${S ? Math.min(W, S) : W}px`;
93
+ F ? `${Math.round(m)}px` : "0px"
94
+ ), F ? s.style.minWidth = `${Math.round(m)}px` : s.style.removeProperty("min-width"), s.style.maxWidth = `${Math.floor(t)}px`;
95
+ const te = Math.floor(e);
96
+ s.style.maxHeight = `${j ? Math.min(te, j) : te}px`;
81
97
  }
82
98
  })
83
99
  ]
84
- }), le = Pe(g, {
85
- enabled: f.includes(y.Click) && !i
86
- }), ie = Ee(g, {
87
- enabled: f.includes(y.Hover) && !i,
100
+ }), Ce = Ye(x, {
101
+ enabled: g.includes(k.Click) && !c
102
+ }), xe = He(x, {
103
+ enabled: g.includes(k.Hover) && !c,
88
104
  move: !1,
89
105
  restMs: 40,
90
- handleClose: Ne(),
106
+ handleClose: Ke(),
91
107
  delay: { open: 80, close: 80 }
92
- }), ce = Ae(g, {
108
+ }), ke = Ue(x, {
93
109
  bubbles: !0,
94
110
  referencePress: !1,
95
- outsidePress: (e) => {
96
- if (!Q) return !1;
97
- const t = e.target;
98
- return !(L?.current && t instanceof Node && L.current.contains(t));
111
+ outsidePress: (t) => {
112
+ if (!de) return !1;
113
+ const e = t.target;
114
+ return !(W?.current && e instanceof Node && W.current.contains(e));
99
115
  }
100
- }), ae = De(g, { role: "menu" }), { getReferenceProps: de, getFloatingProps: ue } = Me([
101
- le,
102
- ie,
103
- ce,
104
- ae
105
- ]), k = m(
106
- (e, t) => {
107
- p.setPositionReference({
116
+ }), Ne = We(x, { role: "menu" }), { getReferenceProps: Ee, getFloatingProps: De } = je([
117
+ Ce,
118
+ xe,
119
+ ke,
120
+ Ne
121
+ ]), P = h(
122
+ (t, e) => {
123
+ w.setPositionReference({
108
124
  getBoundingClientRect: () => ({
109
125
  width: 0,
110
126
  height: 0,
111
- x: e,
112
- y: t,
113
- top: t,
114
- left: e,
115
- right: e,
116
- bottom: t
127
+ x: t,
128
+ y: e,
129
+ top: e,
130
+ left: t,
131
+ right: t,
132
+ bottom: e
117
133
  })
118
134
  });
119
135
  },
120
- [p]
121
- ), fe = m(
122
- (e) => {
123
- !f.includes(y.ContextMenu) || i || (e.preventDefault(), x && (k(e.clientX, e.clientY), C.current = document.elementFromPoint(
124
- e.clientX,
125
- e.clientY
126
- )), o(!0));
136
+ [w]
137
+ ), Ie = h(
138
+ (t) => {
139
+ !g.includes(k.ContextMenu) || c || (t.preventDefault(), D && (P(t.clientX, t.clientY), I.current = document.elementFromPoint(
140
+ t.clientX,
141
+ t.clientY
142
+ )), n(!0));
127
143
  },
128
- [x, i, o, k, f]
129
- ), pe = m(
130
- (e) => {
131
- !x || i || (f.includes(y.ContextMenu) && c && o(!1), k(e.clientX, e.clientY), C.current = document.elementFromPoint(
132
- e.clientX,
133
- e.clientY
144
+ [D, c, n, P, g]
145
+ ), Me = h(
146
+ (t) => {
147
+ !D || c || (g.includes(k.ContextMenu) && a && n(!1), P(t.clientX, t.clientY), I.current = document.elementFromPoint(
148
+ t.clientX,
149
+ t.clientY
134
150
  ));
135
151
  },
136
- [x, i, k, c, f, o]
152
+ [D, c, P, a, g, n]
137
153
  );
138
- U(() => {
139
- i && c && o(!1);
140
- }, [i, c, o]);
141
- const me = m(
142
- (e) => {
143
- if (e.defaultPrevented || !Ze.includes(e.key) || !e.currentTarget.contains(e.target)) return;
144
- const t = Array.from(
145
- e.currentTarget.querySelectorAll(
146
- Je
154
+ oe(() => {
155
+ c && a && n(!1);
156
+ }, [c, a, n]);
157
+ const Pe = h(
158
+ (t) => {
159
+ if (t.defaultPrevented || !Ct.includes(t.key) || !t.currentTarget.contains(t.target) || t.target instanceof HTMLInputElement && (t.key === "Home" || t.key === "End"))
160
+ return;
161
+ const e = Array.from(
162
+ t.currentTarget.querySelectorAll(
163
+ yt
147
164
  )
148
- ).filter(Qe);
149
- if (t.length === 0) return;
150
- e.preventDefault();
151
- const r = e.currentTarget.ownerDocument.activeElement, s = t.findIndex((b) => b === r);
152
- t[et(e.key, s, t.length)]?.focus();
165
+ ).filter(vt);
166
+ if (e.length === 0) return;
167
+ t.preventDefault();
168
+ const r = t.currentTarget.ownerDocument.activeElement, s = e.findIndex((m) => m === r);
169
+ e[xt(t.key, s, e.length)]?.focus();
153
170
  },
154
171
  []
155
- ), K = m(
156
- (e) => (t) => {
157
- e.disabled || (e.onClick?.({ key: e.key, domEvent: t }), u?.({ key: e.key, domEvent: t }), e.selectable || o(!1));
172
+ ), ee = h(
173
+ (t) => (e) => {
174
+ t.disabled || (t.onClick?.({ key: t.key, domEvent: e }), f?.({ key: t.key, domEvent: e }), t.selectable || n(!1));
158
175
  },
159
- [u, o]
160
- ), he = _e(() => I ? I() : d ? /* @__PURE__ */ N(A, { children: [
161
- a && /* @__PURE__ */ n(A, { children: typeof a == "function" ? a() : a }),
162
- /* @__PURE__ */ n(
163
- "div",
164
- {
165
- role: "none",
166
- className: v(
167
- We,
168
- T,
169
- V.dropdownList
170
- ),
171
- "aria-label": "dropdown",
172
- children: d.map((e) => {
173
- if (e.type === X.Divider)
174
- return /* @__PURE__ */ n(
175
- "div",
176
- {
177
- role: "separator",
178
- className: v(
179
- Ke,
180
- O
181
- )
182
- },
183
- e.key
184
- );
185
- if (e.type === X.PlainText)
186
- return /* @__PURE__ */ n(
187
- "div",
188
- {
189
- className: v(
190
- "px-3 py-2 text-secondary dial-caption-text",
191
- e.className
192
- ),
193
- children: e.label
194
- },
195
- e.key
196
- );
197
- if (e.children?.length)
198
- return /* @__PURE__ */ n(
199
- ze,
200
- {
201
- item: e,
202
- onRootClose: () => o(!1)
203
- },
204
- e.key
205
- );
206
- const t = Ge(e), r = He(e), s = /* @__PURE__ */ n(
207
- Xe,
208
- {
209
- role: r,
210
- "aria-checked": r === "menuitem" ? void 0 : !!e.checked,
211
- "aria-current": t === Ye.Highlight && e.checked ? !0 : void 0,
212
- "aria-disabled": !!e.disabled,
213
- disabled: e.disabled,
214
- mark: t,
215
- selected: !!e.checked,
216
- danger: e.danger,
217
- icon: e.icon,
218
- label: e.label,
219
- className: e.className,
220
- rightControl: e.rightControl,
221
- onClick: K(e),
222
- children: e.renderItem?.(e)
223
- }
224
- );
225
- return /* @__PURE__ */ n($e, { children: e.interactiveTooltip ? /* @__PURE__ */ n(
226
- Be,
176
+ [f, n]
177
+ ), A = ne(() => !d || !i ? d : gt(
178
+ wt(d, p, G),
179
+ p
180
+ ), [d, i, p, G]), Ae = ne(() => {
181
+ if (E) return E();
182
+ if (!A) return null;
183
+ const t = i && A.length === 0;
184
+ return /* @__PURE__ */ S(R, { children: [
185
+ u && /* @__PURE__ */ o(R, { children: typeof u == "function" ? u() : u }),
186
+ i && /* @__PURE__ */ o(
187
+ "div",
188
+ {
189
+ className: y(
190
+ tt,
191
+ _.dropdownSearch
192
+ ),
193
+ children: /* @__PURE__ */ o(
194
+ dt,
227
195
  {
228
- asChild: !0,
229
- placement: e.interactiveTooltip.placement,
230
- content: e.interactiveTooltip.content,
231
- contentClassName: e.interactiveTooltip.contentClassName,
232
- children: s
196
+ value: p,
197
+ placeholder: L,
198
+ "aria-label": L,
199
+ clearLabel: q,
200
+ size: ft.Small,
201
+ onChange: (e) => M(e ?? "")
233
202
  }
234
- ) : s }, e.key);
235
- })
236
- }
237
- ),
238
- h && /* @__PURE__ */ n(A, { children: typeof h == "function" ? h() : h })
239
- ] }) : null, [
203
+ )
204
+ }
205
+ ),
206
+ /* @__PURE__ */ S(
207
+ "div",
208
+ {
209
+ role: "none",
210
+ className: y(
211
+ st,
212
+ /* Under a search field or a row cap the list scrolls by itself,
213
+ so the field stays in view; the panel's own height cap still
214
+ shrinks it through `min-h-0`. */
215
+ (i || C != null) && "min-h-0 flex-1 overflow-auto",
216
+ H,
217
+ _.dropdownList
218
+ ),
219
+ style: C != null ? { maxHeight: rt(C) } : void 0,
220
+ "aria-label": "dropdown",
221
+ children: [
222
+ i && /* Always mounted, so a screen reader announces the text when a
223
+ query empties the list rather than missing a fresh region. */
224
+ /* @__PURE__ */ o(
225
+ "div",
226
+ {
227
+ role: "status",
228
+ className: t ? ot : "sr-only",
229
+ children: t ? X : ""
230
+ }
231
+ ),
232
+ A.map((e) => {
233
+ if (e.type === re.Divider)
234
+ return /* @__PURE__ */ o(
235
+ "div",
236
+ {
237
+ role: "separator",
238
+ className: y(
239
+ nt,
240
+ K
241
+ )
242
+ },
243
+ e.key
244
+ );
245
+ if (e.type === re.PlainText)
246
+ return /* @__PURE__ */ o(
247
+ "div",
248
+ {
249
+ className: y(
250
+ "px-3 py-2 text-secondary dial-caption-text",
251
+ e.className
252
+ ),
253
+ children: e.label
254
+ },
255
+ e.key
256
+ );
257
+ if (e.children?.length)
258
+ return /* @__PURE__ */ o(
259
+ pt,
260
+ {
261
+ item: e,
262
+ onRootClose: () => n(!1)
263
+ },
264
+ e.key
265
+ );
266
+ const r = mt(e), s = ht(e), m = /* @__PURE__ */ o(
267
+ at,
268
+ {
269
+ role: s,
270
+ "aria-checked": s === "menuitem" ? void 0 : !!e.checked,
271
+ "aria-current": r === et.Highlight && e.checked ? !0 : void 0,
272
+ "aria-disabled": !!e.disabled,
273
+ disabled: e.disabled,
274
+ mark: r,
275
+ selected: !!e.checked,
276
+ danger: e.danger,
277
+ icon: e.icon,
278
+ label: e.label,
279
+ className: e.className,
280
+ rightControl: e.rightControl,
281
+ onClick: ee(e),
282
+ children: e.renderItem?.(e)
283
+ }
284
+ );
285
+ return /* @__PURE__ */ o(Ze, { children: e.interactiveTooltip ? /* @__PURE__ */ o(
286
+ Ve,
287
+ {
288
+ asChild: !0,
289
+ placement: e.interactiveTooltip.placement,
290
+ content: e.interactiveTooltip.content,
291
+ contentClassName: e.interactiveTooltip.contentClassName,
292
+ children: m
293
+ }
294
+ ) : m }, e.key);
295
+ })
296
+ ]
297
+ }
298
+ ),
299
+ v && /* @__PURE__ */ o(R, { children: typeof v == "function" ? v() : v })
300
+ ] });
301
+ }, [
302
+ ee,
303
+ A,
304
+ v,
305
+ u,
306
+ E,
307
+ n,
308
+ H,
240
309
  K,
241
- d,
242
- h,
243
- a,
244
- I,
245
- o,
246
- T,
247
- O
248
- ]), ge = de({
249
- onContextMenu: fe,
250
- onMouseDown: pe
310
+ i,
311
+ p,
312
+ M,
313
+ L,
314
+ q,
315
+ X,
316
+ C
317
+ ]), Se = !E && (i || C != null), Fe = Ee({
318
+ onContextMenu: Ie,
319
+ onMouseDown: Me
251
320
  });
252
- return U(() => {
253
- if (!c) return;
254
- const e = p.reference.current;
255
- let t = null;
256
- if (e instanceof Element ? t = e : C.current instanceof Element && (t = C.current), !t) return;
321
+ return oe(() => {
322
+ if (!a) return;
323
+ const t = w.reference.current;
324
+ let e = null;
325
+ if (t instanceof Element ? e = t : I.current instanceof Element && (e = I.current), !e) return;
257
326
  const r = new IntersectionObserver(
258
327
  ([s]) => {
259
- s.isIntersecting || o(!1);
328
+ s.isIntersecting || n(!1);
260
329
  },
261
330
  { root: null, threshold: 0 }
262
331
  );
263
- return r.observe(t), () => r.disconnect();
264
- }, [c, p.reference, o]), /* @__PURE__ */ n(Fe, { children: /* @__PURE__ */ N(Te, { id: B, children: [
265
- /* @__PURE__ */ n(
332
+ return r.observe(e), () => r.disconnect();
333
+ }, [a, w.reference, n]), /* @__PURE__ */ o(ze, { children: /* @__PURE__ */ S(Qe, { id: Z, children: [
334
+ /* @__PURE__ */ o(
266
335
  "span",
267
336
  {
268
- ref: p.setReference,
269
- className: v(
270
- je,
271
- i && "!cursor-not-allowed opacity-75",
272
- H,
273
- V.dropdown
337
+ ref: w.setReference,
338
+ className: y(
339
+ lt,
340
+ c && "!cursor-not-allowed opacity-75",
341
+ ce,
342
+ _.dropdown
274
343
  ),
275
344
  "aria-haspopup": "menu",
276
- "aria-expanded": c,
277
- "aria-controls": $,
278
- ...ge,
345
+ "aria-expanded": a,
346
+ "aria-controls": J,
347
+ ...Fe,
279
348
  children: l
280
349
  }
281
350
  ),
282
- c && /* @__PURE__ */ n(Oe, { children: /* @__PURE__ */ n(
283
- Re,
351
+ a && /* @__PURE__ */ o(qe, { children: /* @__PURE__ */ o(
352
+ Xe,
284
353
  {
285
- context: g,
354
+ context: x,
286
355
  modal: !1,
287
- initialFocus: _ !== void 0 ? _ : oe ? 0 : -1,
356
+ initialFocus: z !== void 0 ? z : we ? 0 : -1,
288
357
  returnFocus: !0,
289
- children: /* @__PURE__ */ N(
358
+ children: /* @__PURE__ */ S(
290
359
  "div",
291
360
  {
292
- id: $,
293
- ref: p.setFloating,
294
- style: R ? { ...R, ...Y } : Y,
295
- className: v(
296
- Ue,
297
- !P && "w-max",
298
- "overflow-auto",
299
- ee,
300
- J
361
+ id: J,
362
+ ref: w.setFloating,
363
+ style: U ? { ...U, ...V } : V,
364
+ className: y(
365
+ it,
366
+ !F && "w-max",
367
+ Se ? "flex flex-col overflow-hidden" : "overflow-auto",
368
+ fe,
369
+ ae
301
370
  ),
302
- ...ue({ onKeyDown: me }),
371
+ ...De({ onKeyDown: Pe }),
303
372
  children: [
304
- z && /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ n(
305
- Ve,
373
+ le && /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ o(
374
+ ct,
306
375
  {
307
376
  ariaLabel: "Close dropdown",
308
- onClose: (e) => {
309
- G?.(e), o(!1);
377
+ onClose: (t) => {
378
+ ie?.(t), n(!1);
310
379
  }
311
380
  }
312
381
  ) }),
313
- he
382
+ Ae
314
383
  ]
315
384
  }
316
385
  )
@@ -319,5 +388,5 @@ const Je = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
319
388
  ] }) });
320
389
  };
321
390
  export {
322
- gt as Dropdown
391
+ Yt as Dropdown
323
392
  };