@epam/ai-dial-ui-kit 0.16.0-dev.55 → 0.16.0-dev.57

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