@epam/ai-dial-ui-kit 0.16.0-dev.25 → 0.16.0-dev.32

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