@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.
- package/README.md +2 -0
- package/dist/CHANGELOG.md +12 -0
- package/dist/{DateCellRenderer-D5FgkGHp.cjs → DateCellRenderer-CB2R7gM2.cjs} +28 -28
- package/dist/{MarkdownEditor-BtLY7OVq.cjs → MarkdownEditor-B-x8Ntfe.cjs} +1 -1
- package/dist/components/New/Dropdown/Dropdown.js +212 -203
- package/dist/components/New/Notification/Notification.js +51 -40
- package/dist/components/New/Notification/constants.js +26 -17
- package/dist/components/New/ToggleChip/ToggleChip.js +54 -0
- package/dist/components/New/ToggleChip/constants.js +11 -0
- package/dist/components/ProgressBar/ProgressBar.js +43 -38
- package/dist/components-manifest.json +144 -10
- package/dist/constants/public-class-names.js +2 -0
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/dial-ui-kit.js +375 -369
- package/dist/editors.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/{icon-D93YIwGJ.cjs → icon-4D9xu6E_.cjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +53 -1
- package/dist/src/components/New/Notification/Notification.d.ts +21 -2
- package/dist/src/components/New/Notification/constants.d.ts +11 -0
- package/dist/src/components/New/ToggleChip/ToggleChip.d.ts +70 -0
- package/dist/src/components/New/ToggleChip/constants.d.ts +12 -0
- package/dist/src/components/ProgressBar/ProgressBar.d.ts +23 -3
- package/dist/src/constants/public-class-names.d.ts +2 -0
- package/dist/src/index.d.ts +5 -2
- package/dist/src/types/dropdown.d.ts +16 -0
- package/dist/src/types/notification.d.ts +11 -0
- package/dist/src/types/progress-bar.d.ts +13 -0
- package/dist/types/dropdown.js +5 -4
- package/dist/types/notification.js +3 -2
- package/dist/types/progress-bar.js +4 -0
- package/dist/utils/merge-classes.js +11 -8
- 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-
|
|
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
|
|
2
|
-
import { useFloatingNodeId as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { InteractiveTooltip as
|
|
5
|
-
import { DIAL_KIT_CLASS as
|
|
6
|
-
import { DropdownTrigger as y, DropdownItemType as
|
|
7
|
-
import { MenuItemMark as
|
|
8
|
-
import { dropdownGap as
|
|
9
|
-
import { CloseButton as
|
|
10
|
-
import { MenuItem as
|
|
11
|
-
import { Search as
|
|
12
|
-
import { useThemeScope as
|
|
13
|
-
import { ElementSize as
|
|
14
|
-
import { mergeClasses as
|
|
15
|
-
import { DropdownSubMenuItem as
|
|
16
|
-
import { resolveItemMark as
|
|
17
|
-
import { highlightDropdownItems as
|
|
18
|
-
const
|
|
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
|
|
20
|
+
if (t === "End") return p - 1;
|
|
21
21
|
const u = t === "ArrowDown" ? 1 : -1;
|
|
22
|
-
return d === -1 ? u === 1 ? 0 :
|
|
23
|
-
},
|
|
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:
|
|
26
|
+
onItemClick: p,
|
|
27
27
|
menuHeader: u,
|
|
28
|
-
menuFooter:
|
|
29
|
-
renderOverlay:
|
|
30
|
-
trigger:
|
|
31
|
-
placement:
|
|
28
|
+
menuFooter: C,
|
|
29
|
+
renderOverlay: N,
|
|
30
|
+
trigger: f = [y.Click],
|
|
31
|
+
placement: B,
|
|
32
32
|
disabled: a = !1,
|
|
33
|
-
open:
|
|
34
|
-
defaultOpen:
|
|
35
|
-
onOpenChange:
|
|
36
|
-
closable:
|
|
37
|
-
onClose:
|
|
38
|
-
className:
|
|
39
|
-
overlayContentClassName:
|
|
40
|
-
separatorClassName:
|
|
41
|
-
listClassName:
|
|
42
|
-
listStyle:
|
|
43
|
-
outsidePressIgnoreRef:
|
|
44
|
-
outsideClosable:
|
|
45
|
-
allowedPlacements:
|
|
46
|
-
anchorToMouse:
|
|
47
|
-
matchReferenceWidth:
|
|
48
|
-
maxDropdownHeight:
|
|
49
|
-
initialFocus:
|
|
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:
|
|
52
|
-
onSearchChange:
|
|
53
|
-
searchPlaceholder:
|
|
54
|
-
searchClearLabel:
|
|
55
|
-
noResultsLabel:
|
|
56
|
-
filterItem:
|
|
57
|
-
maxVisibleItems:
|
|
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
|
|
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
|
-
|
|
65
|
+
L === void 0 && be(o), J?.(o);
|
|
62
66
|
},
|
|
63
|
-
[
|
|
64
|
-
), [
|
|
67
|
+
[L, J]
|
|
68
|
+
), [Fe, Re] = W(!0), r = h(
|
|
65
69
|
(o, e, s) => {
|
|
66
|
-
o ?
|
|
70
|
+
o ? Re(s !== "hover" && s !== "safe-polygon") : l && m && P(""), $ || Se(o), U?.(o);
|
|
67
71
|
},
|
|
68
|
-
[
|
|
69
|
-
),
|
|
70
|
-
nodeId:
|
|
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:
|
|
78
|
+
whileElementsMounted: Ze,
|
|
75
79
|
middleware: [
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
Ve({ mainAxis: D, crossAxis: 0 }),
|
|
81
|
+
Ae ? eo({
|
|
78
82
|
alignment: "start",
|
|
79
83
|
crossAxis: !0,
|
|
80
|
-
padding:
|
|
81
|
-
allowedPlacements:
|
|
82
|
-
}) :
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
padding:
|
|
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,
|
|
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
|
-
|
|
94
|
-
),
|
|
95
|
-
const
|
|
96
|
-
i.style.maxHeight = `${
|
|
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
|
-
}),
|
|
101
|
-
enabled:
|
|
102
|
-
}),
|
|
103
|
-
enabled:
|
|
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:
|
|
110
|
+
handleClose: io(),
|
|
107
111
|
delay: { open: 80, close: 80 }
|
|
108
|
-
}),
|
|
112
|
+
}), _e = lo(E, {
|
|
109
113
|
bubbles: !0,
|
|
110
114
|
referencePress: !1,
|
|
111
115
|
outsidePress: (o) => {
|
|
112
|
-
if (!
|
|
116
|
+
if (!ke) return !1;
|
|
113
117
|
const e = o.target;
|
|
114
|
-
return !(
|
|
118
|
+
return !(q?.current && e instanceof Node && q.current.contains(e));
|
|
115
119
|
}
|
|
116
|
-
}),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
),
|
|
144
|
+
), Ye = h(
|
|
138
145
|
(o) => {
|
|
139
|
-
!
|
|
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
|
-
[
|
|
145
|
-
),
|
|
151
|
+
[M, a, r, T, f]
|
|
152
|
+
), Be = h(
|
|
146
153
|
(o) => {
|
|
147
|
-
!
|
|
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
|
-
[
|
|
159
|
+
[M, a, T, c, f, r]
|
|
153
160
|
);
|
|
154
|
-
|
|
161
|
+
ge(() => {
|
|
155
162
|
a && c && r(!1);
|
|
156
163
|
}, [a, c, r]);
|
|
157
|
-
const
|
|
164
|
+
const Ke = h(
|
|
158
165
|
(o) => {
|
|
159
|
-
if (o.defaultPrevented || !
|
|
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
|
-
|
|
170
|
+
$o
|
|
164
171
|
)
|
|
165
|
-
).filter(
|
|
172
|
+
).filter(Ho);
|
|
166
173
|
if (e.length === 0) return;
|
|
167
174
|
o.preventDefault();
|
|
168
|
-
const s = o.currentTarget.ownerDocument.activeElement, i = e.findIndex((
|
|
169
|
-
e[
|
|
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
|
-
),
|
|
178
|
+
[re]
|
|
179
|
+
), le = h(
|
|
173
180
|
(o) => (e) => {
|
|
174
|
-
o.disabled || (o.onClick?.({ key: o.key, domEvent: e }),
|
|
181
|
+
o.disabled || (o.onClick?.({ key: o.key, domEvent: e }), p?.({ key: o.key, domEvent: e }), o.selectable || r(!1));
|
|
175
182
|
},
|
|
176
|
-
[
|
|
177
|
-
),
|
|
178
|
-
|
|
183
|
+
[p, r]
|
|
184
|
+
), b = he(() => !d || !l ? d : Lo(
|
|
185
|
+
_o(d, m, ee),
|
|
179
186
|
m
|
|
180
|
-
), [d, l, m,
|
|
181
|
-
if (
|
|
182
|
-
if (!
|
|
183
|
-
const o = l &&
|
|
184
|
-
return /* @__PURE__ */
|
|
185
|
-
u && /* @__PURE__ */ n(
|
|
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:
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
className: x(
|
|
197
|
+
Co,
|
|
198
|
+
Y.dropdownSearch
|
|
192
199
|
),
|
|
193
200
|
children: /* @__PURE__ */ n(
|
|
194
|
-
|
|
201
|
+
To,
|
|
195
202
|
{
|
|
196
203
|
value: m,
|
|
197
|
-
placeholder:
|
|
198
|
-
"aria-label":
|
|
199
|
-
clearLabel:
|
|
200
|
-
size:
|
|
201
|
-
onChange: (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__ */
|
|
213
|
+
/* @__PURE__ */ F(
|
|
207
214
|
"div",
|
|
208
215
|
{
|
|
209
216
|
role: "none",
|
|
210
|
-
className:
|
|
211
|
-
|
|
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 ||
|
|
216
|
-
|
|
217
|
-
|
|
222
|
+
(l || k != null) && "min-h-0 flex-1 overflow-auto",
|
|
223
|
+
j,
|
|
224
|
+
Y.dropdownList
|
|
218
225
|
),
|
|
219
|
-
style:
|
|
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 ?
|
|
229
|
-
children: o ?
|
|
235
|
+
className: o ? No : "sr-only",
|
|
236
|
+
children: o ? V : ""
|
|
230
237
|
}
|
|
231
238
|
),
|
|
232
|
-
|
|
233
|
-
if (e.type ===
|
|
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:
|
|
239
|
-
|
|
240
|
-
|
|
245
|
+
className: x(
|
|
246
|
+
ko,
|
|
247
|
+
z
|
|
241
248
|
)
|
|
242
249
|
},
|
|
243
250
|
e.key
|
|
244
251
|
);
|
|
245
|
-
if (e.type ===
|
|
252
|
+
if (e.type === we.PlainText)
|
|
246
253
|
return /* @__PURE__ */ n(
|
|
247
254
|
"div",
|
|
248
255
|
{
|
|
249
|
-
className:
|
|
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
|
-
|
|
266
|
+
Ro,
|
|
260
267
|
{
|
|
261
268
|
item: e,
|
|
262
269
|
onRootClose: () => r(!1)
|
|
263
270
|
},
|
|
264
271
|
e.key
|
|
265
272
|
);
|
|
266
|
-
const s =
|
|
267
|
-
|
|
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 ===
|
|
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:
|
|
288
|
+
onClick: le(e),
|
|
282
289
|
children: e.renderItem?.(e)
|
|
283
290
|
}
|
|
284
291
|
);
|
|
285
|
-
return /* @__PURE__ */ n(
|
|
286
|
-
|
|
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:
|
|
299
|
+
children: g
|
|
293
300
|
}
|
|
294
|
-
) :
|
|
301
|
+
) : g }, e.key);
|
|
295
302
|
})
|
|
296
303
|
]
|
|
297
304
|
}
|
|
298
305
|
),
|
|
299
|
-
|
|
306
|
+
C && /* @__PURE__ */ n(H, { children: typeof C == "function" ? C() : C })
|
|
300
307
|
] });
|
|
301
308
|
}, [
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
309
|
+
le,
|
|
310
|
+
b,
|
|
311
|
+
C,
|
|
305
312
|
u,
|
|
306
|
-
|
|
313
|
+
N,
|
|
307
314
|
r,
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
j,
|
|
316
|
+
z,
|
|
310
317
|
l,
|
|
311
318
|
m,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
]),
|
|
318
|
-
"aria-haspopup":
|
|
319
|
-
"aria-expanded":
|
|
320
|
-
"aria-controls":
|
|
321
|
-
...
|
|
322
|
-
} =
|
|
323
|
-
onContextMenu:
|
|
324
|
-
onMouseDown:
|
|
325
|
-
}),
|
|
326
|
-
"aria-haspopup":
|
|
327
|
-
"aria-expanded":
|
|
328
|
-
"aria-controls":
|
|
329
|
-
},
|
|
330
|
-
"aria-haspopup": t.props["aria-haspopup"] ??
|
|
331
|
-
"aria-expanded": t.props["aria-expanded"] ??
|
|
332
|
-
"aria-controls": t.props["aria-controls"] ??
|
|
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
|
|
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(
|
|
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
|
-
|
|
352
|
-
|
|
358
|
+
id: ue ? ie : void 0,
|
|
359
|
+
className: x(
|
|
360
|
+
Mo,
|
|
353
361
|
a && "!cursor-not-allowed opacity-75",
|
|
354
|
-
|
|
355
|
-
|
|
362
|
+
Ce,
|
|
363
|
+
Y.dropdown
|
|
356
364
|
),
|
|
357
|
-
...
|
|
358
|
-
...
|
|
359
|
-
children:
|
|
365
|
+
...fe ? void 0 : qe,
|
|
366
|
+
...ze,
|
|
367
|
+
children: Xe
|
|
360
368
|
}
|
|
361
369
|
),
|
|
362
|
-
c && /* @__PURE__ */ n(
|
|
363
|
-
|
|
370
|
+
c && /* @__PURE__ */ n(po, { children: /* @__PURE__ */ n(
|
|
371
|
+
mo,
|
|
364
372
|
{
|
|
365
|
-
context:
|
|
373
|
+
context: E,
|
|
366
374
|
modal: !1,
|
|
367
|
-
initialFocus:
|
|
368
|
-
returnFocus:
|
|
369
|
-
children: /* @__PURE__ */
|
|
375
|
+
initialFocus: G !== void 0 ? G : Fe ? 0 : -1,
|
|
376
|
+
returnFocus: De,
|
|
377
|
+
children: /* @__PURE__ */ F(
|
|
370
378
|
"div",
|
|
371
379
|
{
|
|
372
|
-
id:
|
|
380
|
+
id: oe,
|
|
373
381
|
ref: w.setFloating,
|
|
374
|
-
style:
|
|
375
|
-
className:
|
|
376
|
-
|
|
377
|
-
!
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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
|
-
...
|
|
390
|
+
...We({ onKeyDown: Ke }),
|
|
391
|
+
...Qe(),
|
|
383
392
|
children: [
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
398
|
+
xe?.(o), r(!1);
|
|
390
399
|
}
|
|
391
400
|
}
|
|
392
401
|
) }),
|
|
393
|
-
|
|
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
|
-
|
|
411
|
+
it as Dropdown
|
|
403
412
|
};
|