@epam/ai-dial-ui-kit 0.15.0-dev.3 → 0.15.0-dev.31
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 +185 -0
- package/dist/CHANGELOG.md +48 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-BFEh4rXZ.cjs} +26 -26
- package/dist/DateCellRenderer-J1V3xwF7.cjs +1 -0
- package/dist/IconButton-DHOFapLo.cjs +1 -0
- package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
- package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
- package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
- package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-GvlxX6kx.cjs} +1 -1
- package/dist/{Switch-CUKClcEz.cjs → Switch-DE6MrcqJ.cjs} +1 -1
- package/dist/components/Button/constants.js +9 -8
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +16 -14
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/FileManager/FileManager.js +373 -372
- package/dist/components/FileManager/FileManagerProvider.js +266 -264
- package/dist/components/FileManager/hooks/use-grid-context-menu.js +59 -59
- package/dist/components/New/Accordion/Accordion.js +87 -71
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/Button/Button.js +32 -32
- package/dist/components/New/Button/ButtonWrappers.js +93 -37
- package/dist/components/New/Button/constants.js +3 -0
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +26 -16
- package/dist/components/New/Calendar/Calendar.js +337 -289
- package/dist/components/New/Calendar/constants.js +5 -5
- package/dist/components/New/CaptionText/CaptionText.js +18 -15
- package/dist/components/New/CardShell/CardShell.js +5 -3
- package/dist/components/New/Checkbox/Checkbox.js +67 -56
- package/dist/components/New/Checkbox/CheckboxBox.js +5 -3
- package/dist/components/New/CloseButton/CloseButton.js +18 -16
- package/dist/components/New/CollapsibleSidebar/CollapsibleSidebar.js +39 -34
- package/dist/components/New/ConfirmationPopup/ConfirmationPopup.js +44 -39
- package/dist/components/New/Dropdown/Dropdown.js +112 -105
- package/dist/components/New/Dropdown/DropdownSubMenuItem.js +17 -17
- package/dist/components/New/Dropdown/constants.js +22 -17
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FileIcon/FileIcon.js +55 -0
- package/dist/components/New/FileIcon/constants.js +134 -0
- package/dist/components/New/FileIcon/icons/FileGlyph.js +150 -0
- package/dist/components/New/FileIcon/icons/FolderGlyph.js +50 -0
- package/dist/components/New/FileName/FileName.js +78 -0
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderName/FolderName.js +16 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +74 -56
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- package/dist/components/New/InteractiveTooltip/constants.js +2 -2
- package/dist/components/New/Label/Label.js +13 -8
- package/dist/components/New/MenuItem/MenuItem.js +29 -27
- package/dist/components/New/MenuItem/constants.js +9 -8
- package/dist/components/New/NoDataContent/NoDataContent.js +21 -19
- package/dist/components/New/Notification/Notification.js +33 -29
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -35
- package/dist/components/New/Popup/Popup.js +46 -44
- package/dist/components/New/Popup/constants.js +3 -3
- package/dist/components/New/Radio/Radio.js +75 -64
- package/dist/components/New/RadioGroup/RadioGroup.js +76 -65
- package/dist/components/New/RadioGroupPopupField/RadioGroupPopupField.js +117 -106
- package/dist/components/New/ResizableContainer/ResizableContainer.js +42 -40
- package/dist/components/New/Search/Search.js +29 -27
- package/dist/components/New/SegmentedControl/SegmentedControl.js +29 -23
- package/dist/components/New/Select/Select.js +120 -109
- package/dist/components/New/Select/constants.js +23 -20
- package/dist/components/New/SharedEntityIndicator/SharedEntityIndicator.js +34 -0
- package/dist/components/New/Switch/Switch.js +69 -58
- package/dist/components/New/Tabs/Tabs.js +125 -61
- package/dist/components/New/Tag/Tag.js +42 -40
- package/dist/components/New/TagInput/TagInput.js +48 -44
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- package/dist/components/New/Tooltip/constants.js +1 -1
- package/dist/components/New/TransferQueue/TransferQueue.js +124 -0
- package/dist/components/New/TransferQueue/TransferQueueHeader.js +71 -0
- package/dist/components/New/TransferQueue/TransferQueueRow.js +119 -0
- package/dist/components/New/TransferQueue/constants.js +24 -0
- package/dist/components/New/constants/overlay.js +15 -9
- package/dist/components/Popup/constants.js +8 -8
- package/dist/components/ProgressBar/ProgressBar.js +45 -33
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaField.js +19 -19
- package/dist/components/SchemaRenderer/components/SchemaFieldContent.js +18 -18
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/types.js +19 -8
- package/dist/components/SchemaRenderer/utils.js +122 -95
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components/Tooltip/TooltipContent.js +11 -11
- package/dist/components-manifest.json +830 -31
- package/dist/constants/public-class-names.js +198 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +330 -302
- package/dist/editors.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-BEsZqouS.cjs +1 -0
- package/dist/merge-classes-BEJXjzkx.cjs +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
- package/dist/src/components/FileManager/FileManager.d.ts +2 -0
- package/dist/src/components/FileManager/FileManagerContext.d.ts +1 -0
- package/dist/src/components/FileManager/hooks/use-grid-context-menu.d.ts +2 -1
- package/dist/src/components/New/Accordion/Accordion.d.ts +6 -1
- package/dist/src/components/New/Breadcrumbs/Breadcrumbs.d.ts +94 -0
- package/dist/src/components/New/Breadcrumbs/constants.d.ts +60 -0
- package/dist/src/components/New/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/ButtonWrappers.d.ts +20 -0
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/ButtonDropdown/ButtonDropdown.d.ts +4 -0
- package/dist/src/components/New/Calendar/Calendar.d.ts +14 -1
- package/dist/src/components/New/Calendar/constants.d.ts +1 -1
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
- package/dist/src/components/New/Dropdown/constants.d.ts +3 -0
- package/dist/src/components/New/FileIcon/FileIcon.d.ts +61 -0
- package/dist/src/components/New/FileIcon/constants.d.ts +16 -0
- package/dist/src/components/New/FileIcon/icons/FileGlyph.d.ts +18 -0
- package/dist/src/components/New/FileIcon/icons/FolderGlyph.d.ts +17 -0
- package/dist/src/components/New/FileName/FileName.d.ts +79 -0
- package/dist/src/components/New/FilterChips/FilterChips.d.ts +69 -0
- package/dist/src/components/New/FilterChips/constants.d.ts +13 -0
- package/dist/src/components/New/FolderName/FolderName.d.ts +37 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +16 -1
- package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
- package/dist/src/components/New/Notification/Notification.d.ts +18 -0
- package/dist/src/components/New/Popup/constants.d.ts +1 -1
- package/dist/src/components/New/Select/constants.d.ts +3 -2
- package/dist/src/components/New/SharedEntityIndicator/SharedEntityIndicator.d.ts +35 -0
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
- package/dist/src/components/New/TransferQueue/TransferQueue.d.ts +139 -0
- package/dist/src/components/New/TransferQueue/TransferQueueHeader.d.ts +16 -0
- package/dist/src/components/New/TransferQueue/TransferQueueRow.d.ts +10 -0
- package/dist/src/components/New/TransferQueue/constants.d.ts +6 -0
- package/dist/src/components/New/constants/overlay.d.ts +13 -0
- package/dist/src/components/Popup/constants.d.ts +1 -1
- package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +10 -1
- package/dist/src/constants/public-class-names.d.ts +189 -0
- package/dist/src/index.d.ts +22 -1
- package/dist/src/types/accordion.d.ts +7 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/types/button.d.ts +1 -0
- package/dist/src/types/transfer-queue.d.ts +10 -0
- package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
- package/dist/src/utils/sub-menu-floating.d.ts +7 -4
- package/dist/src/utils/timezone.d.ts +24 -0
- package/dist/types/accordion.js +4 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/types/button.js +3 -3
- package/dist/types/transfer-queue.js +4 -0
- package/dist/use-file-manager-tabs-C0h1Sq5T.cjs +3 -0
- package/dist/utils/merge-classes.js +12 -5
- package/dist/utils/sub-menu-floating.js +98 -54
- package/dist/utils/timezone.js +19 -0
- package/package.json +3 -3
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/IconButton-DWqoaBWf.cjs +0 -1
- package/dist/lazy-tfN4sKhq.cjs +0 -1
- package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
import { jsxs as N, Fragment as
|
|
2
|
-
import { useFloatingNodeId as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { InteractiveTooltip as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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";
|
|
11
12
|
import { mergeClasses as v } from "../../../utils/merge-classes.js";
|
|
12
|
-
import { DropdownSubMenuItem as
|
|
13
|
-
import { resolveItemMark as
|
|
14
|
-
const
|
|
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) => {
|
|
15
16
|
if (l === "Home") return 0;
|
|
16
17
|
if (l === "End") return u - 1;
|
|
17
18
|
const a = l === "ArrowDown" ? 1 : -1;
|
|
18
19
|
return d === -1 ? a === 1 ? 0 : u - 1 : (d + a + u) % u;
|
|
19
|
-
},
|
|
20
|
+
}, tt = (l) => "clientWidth" in l ? l.clientWidth : l.getBoundingClientRect?.()?.width ?? 0, gt = ({
|
|
20
21
|
children: l,
|
|
21
22
|
items: d,
|
|
22
23
|
onItemClick: u,
|
|
23
24
|
menuHeader: a,
|
|
24
25
|
menuFooter: h,
|
|
25
|
-
renderOverlay:
|
|
26
|
+
renderOverlay: I,
|
|
26
27
|
trigger: f = [y.Click],
|
|
27
28
|
placement: D,
|
|
28
29
|
disabled: i = !1,
|
|
29
|
-
open:
|
|
30
|
-
defaultOpen:
|
|
31
|
-
onOpenChange:
|
|
32
|
-
closable:
|
|
33
|
-
onClose:
|
|
34
|
-
className:
|
|
35
|
-
overlayContentClassName:
|
|
36
|
-
separatorClassName:
|
|
37
|
-
listClassName:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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,
|
|
41
43
|
anchorToMouse: x = !1,
|
|
42
|
-
matchReferenceWidth:
|
|
44
|
+
matchReferenceWidth: P = !0,
|
|
43
45
|
maxDropdownHeight: S,
|
|
44
|
-
initialFocus:
|
|
46
|
+
initialFocus: _
|
|
45
47
|
}) => {
|
|
46
|
-
const
|
|
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(
|
|
47
49
|
(e, t, r) => {
|
|
48
|
-
e &&
|
|
50
|
+
e && re(r !== "hover" && r !== "safe-polygon"), E || ne(e), F?.(e);
|
|
49
51
|
},
|
|
50
|
-
[
|
|
51
|
-
), $ =
|
|
52
|
+
[E, F]
|
|
53
|
+
), $ = Se(), se = D === void 0, B = ye(), { refs: p, floatingStyles: Y, context: g } = we({
|
|
52
54
|
nodeId: B,
|
|
53
55
|
placement: D,
|
|
54
56
|
open: c,
|
|
55
57
|
onOpenChange: o,
|
|
56
|
-
whileElementsMounted:
|
|
58
|
+
whileElementsMounted: ve,
|
|
57
59
|
middleware: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
xe({ mainAxis: w, crossAxis: 0 }),
|
|
61
|
+
se ? Ce({
|
|
60
62
|
alignment: "start",
|
|
61
63
|
crossAxis: !0,
|
|
62
64
|
padding: w,
|
|
63
|
-
allowedPlacements:
|
|
64
|
-
}) :
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
allowedPlacements: Z
|
|
66
|
+
}) : ke({ padding: w }),
|
|
67
|
+
be({ padding: w }),
|
|
68
|
+
Ie({
|
|
67
69
|
padding: w,
|
|
68
70
|
apply({ availableWidth: e, availableHeight: t, elements: r }) {
|
|
69
|
-
const s = r.floating, b =
|
|
71
|
+
const s = r.floating, b = tt(r.reference);
|
|
70
72
|
s.style.setProperty(
|
|
71
73
|
"--fui-available-height",
|
|
72
74
|
`${Math.floor(t)}px`
|
|
73
75
|
), s.style.setProperty(
|
|
74
76
|
"--reference-width",
|
|
75
|
-
|
|
76
|
-
),
|
|
77
|
-
const
|
|
78
|
-
s.style.maxHeight = `${S ? Math.min(
|
|
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`;
|
|
79
81
|
}
|
|
80
82
|
})
|
|
81
83
|
]
|
|
82
|
-
}),
|
|
84
|
+
}), le = Pe(g, {
|
|
83
85
|
enabled: f.includes(y.Click) && !i
|
|
84
|
-
}),
|
|
86
|
+
}), ie = Ee(g, {
|
|
85
87
|
enabled: f.includes(y.Hover) && !i,
|
|
86
88
|
move: !1,
|
|
87
89
|
restMs: 40,
|
|
88
|
-
handleClose:
|
|
90
|
+
handleClose: Ne(),
|
|
89
91
|
delay: { open: 80, close: 80 }
|
|
90
|
-
}),
|
|
92
|
+
}), ce = Ae(g, {
|
|
91
93
|
bubbles: !0,
|
|
92
94
|
referencePress: !1,
|
|
93
95
|
outsidePress: (e) => {
|
|
94
|
-
if (!
|
|
96
|
+
if (!Q) return !1;
|
|
95
97
|
const t = e.target;
|
|
96
|
-
return !(
|
|
98
|
+
return !(L?.current && t instanceof Node && L.current.contains(t));
|
|
97
99
|
}
|
|
98
|
-
}),
|
|
99
|
-
re,
|
|
100
|
-
se,
|
|
100
|
+
}), ae = De(g, { role: "menu" }), { getReferenceProps: de, getFloatingProps: ue } = Me([
|
|
101
101
|
le,
|
|
102
|
-
ie
|
|
102
|
+
ie,
|
|
103
|
+
ce,
|
|
104
|
+
ae
|
|
103
105
|
]), k = m(
|
|
104
106
|
(e, t) => {
|
|
105
107
|
p.setPositionReference({
|
|
@@ -116,7 +118,7 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
116
118
|
});
|
|
117
119
|
},
|
|
118
120
|
[p]
|
|
119
|
-
),
|
|
121
|
+
), fe = m(
|
|
120
122
|
(e) => {
|
|
121
123
|
!f.includes(y.ContextMenu) || i || (e.preventDefault(), x && (k(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
122
124
|
e.clientX,
|
|
@@ -124,7 +126,7 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
124
126
|
)), o(!0));
|
|
125
127
|
},
|
|
126
128
|
[x, i, o, k, f]
|
|
127
|
-
),
|
|
129
|
+
), pe = m(
|
|
128
130
|
(e) => {
|
|
129
131
|
!x || i || (f.includes(y.ContextMenu) && c && o(!1), k(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
130
132
|
e.clientX,
|
|
@@ -133,50 +135,54 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
133
135
|
},
|
|
134
136
|
[x, i, k, c, f, o]
|
|
135
137
|
);
|
|
136
|
-
|
|
138
|
+
U(() => {
|
|
137
139
|
i && c && o(!1);
|
|
138
140
|
}, [i, c, o]);
|
|
139
|
-
const
|
|
141
|
+
const me = m(
|
|
140
142
|
(e) => {
|
|
141
|
-
if (e.defaultPrevented || !
|
|
143
|
+
if (e.defaultPrevented || !Ze.includes(e.key) || !e.currentTarget.contains(e.target)) return;
|
|
142
144
|
const t = Array.from(
|
|
143
145
|
e.currentTarget.querySelectorAll(
|
|
144
|
-
|
|
146
|
+
Je
|
|
145
147
|
)
|
|
146
|
-
).filter(
|
|
148
|
+
).filter(Qe);
|
|
147
149
|
if (t.length === 0) return;
|
|
148
150
|
e.preventDefault();
|
|
149
151
|
const r = e.currentTarget.ownerDocument.activeElement, s = t.findIndex((b) => b === r);
|
|
150
|
-
t[
|
|
152
|
+
t[et(e.key, s, t.length)]?.focus();
|
|
151
153
|
},
|
|
152
154
|
[]
|
|
153
|
-
),
|
|
155
|
+
), K = m(
|
|
154
156
|
(e) => (t) => {
|
|
155
157
|
e.disabled || (e.onClick?.({ key: e.key, domEvent: t }), u?.({ key: e.key, domEvent: t }), e.selectable || o(!1));
|
|
156
158
|
},
|
|
157
159
|
[u, o]
|
|
158
|
-
),
|
|
159
|
-
a && /* @__PURE__ */ n(
|
|
160
|
+
), he = _e(() => I ? I() : d ? /* @__PURE__ */ N(A, { children: [
|
|
161
|
+
a && /* @__PURE__ */ n(A, { children: typeof a == "function" ? a() : a }),
|
|
160
162
|
/* @__PURE__ */ n(
|
|
161
163
|
"div",
|
|
162
164
|
{
|
|
163
165
|
role: "none",
|
|
164
|
-
className: v(
|
|
166
|
+
className: v(
|
|
167
|
+
We,
|
|
168
|
+
T,
|
|
169
|
+
V.dropdownList
|
|
170
|
+
),
|
|
165
171
|
"aria-label": "dropdown",
|
|
166
172
|
children: d.map((e) => {
|
|
167
|
-
if (e.type ===
|
|
173
|
+
if (e.type === X.Divider)
|
|
168
174
|
return /* @__PURE__ */ n(
|
|
169
175
|
"div",
|
|
170
176
|
{
|
|
171
177
|
role: "separator",
|
|
172
178
|
className: v(
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
Ke,
|
|
180
|
+
O
|
|
175
181
|
)
|
|
176
182
|
},
|
|
177
183
|
e.key
|
|
178
184
|
);
|
|
179
|
-
if (e.type ===
|
|
185
|
+
if (e.type === X.PlainText)
|
|
180
186
|
return /* @__PURE__ */ n(
|
|
181
187
|
"div",
|
|
182
188
|
{
|
|
@@ -190,19 +196,19 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
190
196
|
);
|
|
191
197
|
if (e.children?.length)
|
|
192
198
|
return /* @__PURE__ */ n(
|
|
193
|
-
|
|
199
|
+
ze,
|
|
194
200
|
{
|
|
195
201
|
item: e,
|
|
196
202
|
onRootClose: () => o(!1)
|
|
197
203
|
},
|
|
198
204
|
e.key
|
|
199
205
|
);
|
|
200
|
-
const t =
|
|
201
|
-
|
|
206
|
+
const t = Ge(e), r = He(e), s = /* @__PURE__ */ n(
|
|
207
|
+
Xe,
|
|
202
208
|
{
|
|
203
209
|
role: r,
|
|
204
210
|
"aria-checked": r === "menuitem" ? void 0 : !!e.checked,
|
|
205
|
-
"aria-current": t ===
|
|
211
|
+
"aria-current": t === Ye.Highlight && e.checked ? !0 : void 0,
|
|
206
212
|
"aria-disabled": !!e.disabled,
|
|
207
213
|
disabled: e.disabled,
|
|
208
214
|
mark: t,
|
|
@@ -212,12 +218,12 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
212
218
|
label: e.label,
|
|
213
219
|
className: e.className,
|
|
214
220
|
rightControl: e.rightControl,
|
|
215
|
-
onClick:
|
|
221
|
+
onClick: K(e),
|
|
216
222
|
children: e.renderItem?.(e)
|
|
217
223
|
}
|
|
218
224
|
);
|
|
219
|
-
return /* @__PURE__ */ n(
|
|
220
|
-
|
|
225
|
+
return /* @__PURE__ */ n($e, { children: e.interactiveTooltip ? /* @__PURE__ */ n(
|
|
226
|
+
Be,
|
|
221
227
|
{
|
|
222
228
|
asChild: !0,
|
|
223
229
|
placement: e.interactiveTooltip.placement,
|
|
@@ -229,21 +235,21 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
229
235
|
})
|
|
230
236
|
}
|
|
231
237
|
),
|
|
232
|
-
h && /* @__PURE__ */ n(
|
|
238
|
+
h && /* @__PURE__ */ n(A, { children: typeof h == "function" ? h() : h })
|
|
233
239
|
] }) : null, [
|
|
234
|
-
|
|
240
|
+
K,
|
|
235
241
|
d,
|
|
236
242
|
h,
|
|
237
243
|
a,
|
|
238
|
-
|
|
244
|
+
I,
|
|
239
245
|
o,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
]),
|
|
243
|
-
onContextMenu:
|
|
244
|
-
onMouseDown:
|
|
246
|
+
T,
|
|
247
|
+
O
|
|
248
|
+
]), ge = de({
|
|
249
|
+
onContextMenu: fe,
|
|
250
|
+
onMouseDown: pe
|
|
245
251
|
});
|
|
246
|
-
return
|
|
252
|
+
return U(() => {
|
|
247
253
|
if (!c) return;
|
|
248
254
|
const e = p.reference.current;
|
|
249
255
|
let t = null;
|
|
@@ -255,55 +261,56 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
255
261
|
{ root: null, threshold: 0 }
|
|
256
262
|
);
|
|
257
263
|
return r.observe(t), () => r.disconnect();
|
|
258
|
-
}, [c, p.reference, o]), /* @__PURE__ */ n(
|
|
264
|
+
}, [c, p.reference, o]), /* @__PURE__ */ n(Fe, { children: /* @__PURE__ */ N(Te, { id: B, children: [
|
|
259
265
|
/* @__PURE__ */ n(
|
|
260
266
|
"span",
|
|
261
267
|
{
|
|
262
268
|
ref: p.setReference,
|
|
263
269
|
className: v(
|
|
264
|
-
|
|
270
|
+
je,
|
|
265
271
|
i && "!cursor-not-allowed opacity-75",
|
|
266
|
-
|
|
272
|
+
H,
|
|
273
|
+
V.dropdown
|
|
267
274
|
),
|
|
268
275
|
"aria-haspopup": "menu",
|
|
269
276
|
"aria-expanded": c,
|
|
270
277
|
"aria-controls": $,
|
|
271
|
-
...
|
|
278
|
+
...ge,
|
|
272
279
|
children: l
|
|
273
280
|
}
|
|
274
281
|
),
|
|
275
|
-
c && /* @__PURE__ */ n(
|
|
276
|
-
|
|
282
|
+
c && /* @__PURE__ */ n(Oe, { children: /* @__PURE__ */ n(
|
|
283
|
+
Re,
|
|
277
284
|
{
|
|
278
285
|
context: g,
|
|
279
286
|
modal: !1,
|
|
280
|
-
initialFocus:
|
|
287
|
+
initialFocus: _ !== void 0 ? _ : oe ? 0 : -1,
|
|
281
288
|
returnFocus: !0,
|
|
282
289
|
children: /* @__PURE__ */ N(
|
|
283
290
|
"div",
|
|
284
291
|
{
|
|
285
292
|
id: $,
|
|
286
293
|
ref: p.setFloating,
|
|
287
|
-
style:
|
|
294
|
+
style: R ? { ...R, ...Y } : Y,
|
|
288
295
|
className: v(
|
|
289
|
-
|
|
290
|
-
!
|
|
296
|
+
Ue,
|
|
297
|
+
!P && "w-max",
|
|
291
298
|
"overflow-auto",
|
|
292
|
-
|
|
293
|
-
|
|
299
|
+
ee,
|
|
300
|
+
J
|
|
294
301
|
),
|
|
295
|
-
...
|
|
302
|
+
...ue({ onKeyDown: me }),
|
|
296
303
|
children: [
|
|
297
|
-
|
|
298
|
-
|
|
304
|
+
z && /* @__PURE__ */ n("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ n(
|
|
305
|
+
Ve,
|
|
299
306
|
{
|
|
300
307
|
ariaLabel: "Close dropdown",
|
|
301
308
|
onClose: (e) => {
|
|
302
|
-
|
|
309
|
+
G?.(e), o(!1);
|
|
303
310
|
}
|
|
304
311
|
}
|
|
305
312
|
) }),
|
|
306
|
-
|
|
313
|
+
he
|
|
307
314
|
]
|
|
308
315
|
}
|
|
309
316
|
)
|
|
@@ -312,5 +319,5 @@ const ze = '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]
|
|
|
312
319
|
] }) });
|
|
313
320
|
};
|
|
314
321
|
export {
|
|
315
|
-
|
|
322
|
+
gt as Dropdown
|
|
316
323
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { FloatingNode as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { InteractiveTooltip as
|
|
1
|
+
import { jsx as r, jsxs as u, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { FloatingNode as M } from "@floating-ui/react";
|
|
3
|
+
import { useCallback as N, Fragment as F } from "react";
|
|
4
|
+
import { InteractiveTooltip as c } from "../InteractiveTooltip/InteractiveTooltip.js";
|
|
5
5
|
import { MenuItem as d } from "../MenuItem/MenuItem.js";
|
|
6
|
-
import { MenuItemMark as
|
|
7
|
-
import { useSubMenuFloating as
|
|
6
|
+
import { MenuItemMark as I } from "../../../types/menu-item.js";
|
|
7
|
+
import { useSubMenuFloating as S, SubMenuPanel as T } from "../../../utils/sub-menu-floating.js";
|
|
8
8
|
import { getItemRole as y, resolveItemMark as m } from "./item-mark.js";
|
|
9
|
-
import { dropdownGap as
|
|
9
|
+
import { dropdownGap as w, submenuCaretIcon as x, dropdownSubMenuClassName as H, dropdownSubMenuListClassName as P } from "./constants.js";
|
|
10
10
|
const q = ({
|
|
11
11
|
item: n,
|
|
12
12
|
onRootClose: a
|
|
@@ -19,7 +19,7 @@ const q = ({
|
|
|
19
19
|
context: f,
|
|
20
20
|
getReferenceProps: g,
|
|
21
21
|
getFloatingProps: C
|
|
22
|
-
} =
|
|
22
|
+
} = S(w, "menu", !!n.disabled), k = N(
|
|
23
23
|
(e) => (o) => {
|
|
24
24
|
e.disabled || (e.onClick?.({ key: e.key, domEvent: o }), e.selectable || a());
|
|
25
25
|
},
|
|
@@ -35,15 +35,15 @@ const q = ({
|
|
|
35
35
|
disabled: n.disabled,
|
|
36
36
|
icon: n.icon,
|
|
37
37
|
label: n.label,
|
|
38
|
-
trailing:
|
|
38
|
+
trailing: x,
|
|
39
39
|
className: n.className,
|
|
40
40
|
...g(),
|
|
41
41
|
children: n.renderItem?.(n)
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ u(M, { id: p, children: [
|
|
45
45
|
n.interactiveTooltip ? /* @__PURE__ */ r(
|
|
46
|
-
|
|
46
|
+
c,
|
|
47
47
|
{
|
|
48
48
|
asChild: !0,
|
|
49
49
|
placement: n.interactiveTooltip.placement,
|
|
@@ -53,15 +53,15 @@ const q = ({
|
|
|
53
53
|
}
|
|
54
54
|
) : l,
|
|
55
55
|
t && /* @__PURE__ */ r(
|
|
56
|
-
|
|
56
|
+
T,
|
|
57
57
|
{
|
|
58
58
|
refs: s,
|
|
59
59
|
floatingStyles: b,
|
|
60
60
|
context: f,
|
|
61
61
|
getFloatingProps: C,
|
|
62
62
|
role: "menu",
|
|
63
|
-
surfaceClassName:
|
|
64
|
-
children: n.renderSubMenu ? n.renderSubMenu() : /* @__PURE__ */
|
|
63
|
+
surfaceClassName: n.renderSubMenu ? H : P,
|
|
64
|
+
children: n.renderSubMenu ? n.renderSubMenu() : /* @__PURE__ */ u(v, { children: [
|
|
65
65
|
n.menuHeader && (typeof n.menuHeader == "function" ? n.menuHeader() : n.menuHeader),
|
|
66
66
|
n.children.map((e) => {
|
|
67
67
|
const o = y(e), i = /* @__PURE__ */ r(
|
|
@@ -69,7 +69,7 @@ const q = ({
|
|
|
69
69
|
{
|
|
70
70
|
role: o,
|
|
71
71
|
"aria-checked": o === "menuitem" ? void 0 : !!e.checked,
|
|
72
|
-
"aria-current": m(e) ===
|
|
72
|
+
"aria-current": m(e) === I.Highlight && e.checked ? !0 : void 0,
|
|
73
73
|
"aria-disabled": !!e.disabled,
|
|
74
74
|
disabled: e.disabled,
|
|
75
75
|
mark: m(e),
|
|
@@ -83,8 +83,8 @@ const q = ({
|
|
|
83
83
|
children: e.renderItem?.(e)
|
|
84
84
|
}
|
|
85
85
|
);
|
|
86
|
-
return /* @__PURE__ */ r(
|
|
87
|
-
|
|
86
|
+
return /* @__PURE__ */ r(F, { children: e.interactiveTooltip ? /* @__PURE__ */ r(
|
|
87
|
+
c,
|
|
88
88
|
{
|
|
89
89
|
asChild: !0,
|
|
90
90
|
placement: e.interactiveTooltip.placement,
|
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconChevronRight as
|
|
3
|
-
import { overlayGap as
|
|
4
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
5
|
-
import { DIAL_ICON_SIZE as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { IconChevronRight as s } from "@tabler/icons-react";
|
|
3
|
+
import { overlayGap as r, overlaySubMenuClassName as a, overlaySubMenuListClassName as t, overlayListClassName as n, overlaySurfaceClassName as m } from "../constants/overlay.js";
|
|
4
|
+
import { DIAL_KIT_ICON_STROKE as i } from "../constants/icon.js";
|
|
5
|
+
import { DIAL_ICON_SIZE as d } from "../../../constants/icon.js";
|
|
6
6
|
import { mergeClasses as o } from "../../../utils/merge-classes.js";
|
|
7
|
-
const
|
|
7
|
+
const b = o(
|
|
8
8
|
"flex items-center gap-2 align-middle",
|
|
9
9
|
"h-auto px-0 bg-transparent border-0"
|
|
10
10
|
), f = o(
|
|
11
|
-
"z-
|
|
12
|
-
|
|
13
|
-
),
|
|
14
|
-
|
|
11
|
+
"z-floating focus-visible:outline-none",
|
|
12
|
+
m
|
|
13
|
+
), I = a, v = t, y = o(
|
|
14
|
+
n,
|
|
15
|
+
"py-1"
|
|
16
|
+
), S = "my-1 border-t border-tertiary", w = r, L = /* @__PURE__ */ e(
|
|
17
|
+
s,
|
|
15
18
|
{
|
|
16
|
-
size:
|
|
17
|
-
stroke:
|
|
19
|
+
size: d.SM,
|
|
20
|
+
stroke: i,
|
|
18
21
|
"aria-hidden": "true"
|
|
19
22
|
}
|
|
20
23
|
);
|
|
21
24
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
b as dropdownBaseClassName,
|
|
26
|
+
S as dropdownDividerClassName,
|
|
27
|
+
w as dropdownGap,
|
|
28
|
+
y as dropdownItemListClassName,
|
|
25
29
|
f as dropdownListBaseClassName,
|
|
26
|
-
|
|
27
|
-
v as
|
|
30
|
+
I as dropdownSubMenuClassName,
|
|
31
|
+
v as dropdownSubMenuListClassName,
|
|
32
|
+
L as submenuCaretIcon
|
|
28
33
|
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as T, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as C } from "react";
|
|
3
|
-
import { mergeClasses as
|
|
3
|
+
import { mergeClasses as d } from "../../../utils/merge-classes.js";
|
|
4
4
|
import { TooltipContainer as x } from "../Tooltip/TooltipContainer.js";
|
|
5
5
|
import { TooltipContent as g } from "../Tooltip/TooltipContent.js";
|
|
6
6
|
import { TooltipTrigger as h } from "../Tooltip/TooltipTrigger.js";
|
|
7
7
|
import { useTruncation as b } from "./use-truncation.js";
|
|
8
|
-
|
|
8
|
+
import { DIAL_KIT_CLASS as j } from "../../../constants/public-class-names.js";
|
|
9
|
+
const _ = ({
|
|
9
10
|
text: r,
|
|
10
11
|
className: m,
|
|
11
12
|
contentClassName: a,
|
|
12
|
-
hideTooltip:
|
|
13
|
+
hideTooltip: i = !1,
|
|
13
14
|
id: p,
|
|
14
|
-
customTooltipContent:
|
|
15
|
-
...
|
|
15
|
+
customTooltipContent: n,
|
|
16
|
+
...f
|
|
16
17
|
}) => {
|
|
17
|
-
const { ref:
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
18
|
+
const { ref: u, isTruncated: t, textContent: c, remeasure: s } = b(r), o = typeof r == "string" ? r : c, l = C(() => i || !t ? null : n ?? o, [n, o, i, t]);
|
|
19
|
+
return /* @__PURE__ */ T(x, { ...f, children: [
|
|
20
|
+
/* @__PURE__ */ e(
|
|
20
21
|
h,
|
|
21
22
|
{
|
|
22
23
|
asChild: !0,
|
|
23
|
-
onMouseEnter:
|
|
24
|
-
onFocusCapture:
|
|
25
|
-
children: /* @__PURE__ */
|
|
24
|
+
onMouseEnter: s,
|
|
25
|
+
onFocusCapture: s,
|
|
26
|
+
children: /* @__PURE__ */ e(
|
|
26
27
|
"span",
|
|
27
28
|
{
|
|
28
29
|
id: p,
|
|
29
|
-
ref:
|
|
30
|
-
"aria-label":
|
|
31
|
-
className:
|
|
30
|
+
ref: u,
|
|
31
|
+
"aria-label": t && o ? o : void 0,
|
|
32
|
+
className: d(
|
|
32
33
|
"block min-w-0 max-w-full flex-1 truncate text-start",
|
|
33
|
-
m
|
|
34
|
+
m,
|
|
35
|
+
j.ellipsisTooltip
|
|
34
36
|
),
|
|
35
37
|
children: r
|
|
36
38
|
}
|
|
37
39
|
)
|
|
38
40
|
}
|
|
39
41
|
),
|
|
40
|
-
!!l && /* @__PURE__ */
|
|
42
|
+
!!l && /* @__PURE__ */ e(g, { className: a, children: l })
|
|
41
43
|
] });
|
|
42
44
|
};
|
|
43
45
|
export {
|
|
44
|
-
|
|
46
|
+
_ as EllipsisTooltip
|
|
45
47
|
};
|