@epam/ai-dial-ui-kit 0.15.0-dev.1 → 0.15.0-dev.11
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 +147 -0
- package/dist/CHANGELOG.md +17 -0
- package/dist/DateCellRenderer-Ba9tlNbk.cjs +1 -0
- package/dist/{DateCellRenderer-BVM-Q8yx.cjs → DateCellRenderer-S5QJV-Wp.cjs} +26 -26
- package/dist/components/Dropdown/Dropdown.js +70 -65
- package/dist/components/Dropdown/DropdownSubMenuItem.js +63 -55
- package/dist/components/Dropdown/constants.js +15 -13
- package/dist/components/DropdownIcon/DropdownIcon.js +43 -32
- package/dist/components/New/Accordion/Accordion.js +40 -38
- package/dist/components/New/Breadcrumbs/Breadcrumbs.js +159 -0
- package/dist/components/New/Breadcrumbs/constants.js +41 -0
- package/dist/components/New/ButtonDropdown/ButtonDropdown.js +7 -6
- package/dist/components/New/Calendar/Calendar.js +337 -289
- 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 +101 -95
- package/dist/components/New/EllipsisTooltip/EllipsisTooltip.js +20 -18
- package/dist/components/New/FileDropzone/FileDropzone.js +27 -25
- package/dist/components/New/FilterChips/FilterChips.js +43 -0
- package/dist/components/New/FilterChips/constants.js +5 -0
- package/dist/components/New/FolderPath/FolderPath.js +29 -28
- package/dist/components/New/Highlight/Highlight.js +23 -30
- package/dist/components/New/InfoButton/InfoButton.js +13 -11
- package/dist/components/New/InlineSelect/InlineSelect.js +43 -41
- package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +41 -39
- 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 +29 -27
- package/dist/components/New/NumberInput/NumberInput.js +42 -33
- package/dist/components/New/PasswordInput/PasswordInput.js +41 -34
- package/dist/components/New/Popup/Popup.js +46 -44
- 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/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 +45 -43
- package/dist/components/New/ToggleIconButton/ToggleIconButton.js +26 -24
- package/dist/components/New/Tooltip/TooltipContent.js +11 -9
- package/dist/components/ProgressBar/ProgressBar.js +45 -33
- package/dist/components/SchemaRenderer/components/SchemaAdditionalPropertiesEditor.js +46 -31
- package/dist/components/SchemaRenderer/components/SchemaKeyValueEditor.js +223 -135
- package/dist/components/SchemaRenderer/types.js +19 -8
- package/dist/components/SchemaRenderer/utils.js +121 -96
- package/dist/components/Skeleton/Skeleton.js +25 -19
- package/dist/components/Spinner/Spinner.js +7 -5
- package/dist/components-manifest.json +248 -6
- package/dist/constants/public-class-names.js +182 -0
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +227 -217
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +1 -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/Calendar/Calendar.d.ts +14 -1
- 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/PasswordInput/PasswordInput.d.ts +4 -1
- package/dist/src/components/New/Tabs/Tabs.d.ts +54 -6
- package/dist/src/components/SchemaRenderer/types.d.ts +11 -0
- package/dist/src/components/SchemaRenderer/utils.d.ts +5 -1
- package/dist/src/constants/public-class-names.d.ts +173 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/types/breadcrumbs.d.ts +9 -0
- package/dist/src/utils/__tests__/timezone.spec.d.ts +1 -0
- package/dist/src/utils/timezone.d.ts +24 -0
- package/dist/types/breadcrumbs.js +4 -0
- package/dist/use-file-manager-tabs-Ff6KIQOF.cjs +3 -0
- package/dist/utils/timezone.js +19 -0
- package/package.json +2 -2
- package/dist/DateCellRenderer-ssp7eaZY.cjs +0 -1
- package/dist/use-file-manager-tabs-DjdR_mYM.cjs +0 -3
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as N, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { useFloating as ce, autoUpdate as de, offset as fe, autoPlacement as ue, flip as pe, shift as me, size as he, useClick as ye, useHover as xe, useDismiss as ge, useRole as we, useInteractions as
|
|
2
|
+
import { useFloating as ce, autoUpdate as de, offset as fe, autoPlacement as ue, flip as pe, shift as me, size as he, useClick as ye, useHover as xe, useDismiss as ge, useRole as we, useInteractions as Ce, FloatingPortal as be, FloatingFocusManager as ve } from "@floating-ui/react";
|
|
3
3
|
import m from "classnames";
|
|
4
4
|
import { useState as Ne, useRef as Pe, useCallback as h, useId as ke, useEffect as U, useMemo as De } from "react";
|
|
5
|
-
import { DialIcon as
|
|
5
|
+
import { DialIcon as Ie } from "../Icon/Icon.js";
|
|
6
|
+
import { DIAL_KIT_CLASS as Me } from "../../constants/public-class-names.js";
|
|
6
7
|
import { DropdownTrigger as y, DropdownItemType as X } from "../../types/dropdown.js";
|
|
7
|
-
import { dropdownGap as x, dropdownDividerClassName as
|
|
8
|
-
import { DialCloseButton as
|
|
9
|
-
import { mergeClasses as
|
|
10
|
-
import { DropdownSubMenuItem as
|
|
11
|
-
const
|
|
8
|
+
import { dropdownGap as x, dropdownDividerClassName as Ee, dropdownItemBaseClassName as Fe, dropdownItemDisabledClassName as Re, dropdownItemDangerClassName as Ae, dropdownBaseClassName as Be, dropdownListBaseClassName as Le } from "./constants.js";
|
|
9
|
+
import { DialCloseButton as Se } from "../CloseButton/CloseButton.js";
|
|
10
|
+
import { mergeClasses as I } from "../../utils/merge-classes.js";
|
|
11
|
+
import { DropdownSubMenuItem as $e } from "./DropdownSubMenuItem.js";
|
|
12
|
+
const We = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.()?.width ?? 0, Je = ({
|
|
12
13
|
children: c,
|
|
13
14
|
items: g,
|
|
14
|
-
onItemClick:
|
|
15
|
+
onItemClick: M,
|
|
15
16
|
menuHeader: d,
|
|
16
17
|
menuFooter: f,
|
|
17
18
|
renderOverlay: P,
|
|
@@ -21,51 +22,51 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
21
22
|
open: F,
|
|
22
23
|
defaultOpen: Y = !1,
|
|
23
24
|
onOpenChange: R,
|
|
24
|
-
closable:
|
|
25
|
-
onClose:
|
|
26
|
-
className:
|
|
27
|
-
overlayContentClassName:
|
|
28
|
-
separatorClassName:
|
|
29
|
-
listClassName:
|
|
30
|
-
outsidePressIgnoreRef:
|
|
31
|
-
outsideClosable:
|
|
32
|
-
allowedPlacements:
|
|
25
|
+
closable: _ = !1,
|
|
26
|
+
onClose: z,
|
|
27
|
+
className: G,
|
|
28
|
+
overlayContentClassName: A,
|
|
29
|
+
separatorClassName: B,
|
|
30
|
+
listClassName: K,
|
|
31
|
+
outsidePressIgnoreRef: L,
|
|
32
|
+
outsideClosable: T = !0,
|
|
33
|
+
allowedPlacements: q,
|
|
33
34
|
anchorToMouse: w = !1,
|
|
34
35
|
matchReferenceWidth: k = !0,
|
|
35
|
-
maxDropdownHeight:
|
|
36
|
+
maxDropdownHeight: S
|
|
36
37
|
}) => {
|
|
37
|
-
const [
|
|
38
|
+
const [J, Q] = Ne(Y), D = F !== void 0, s = D ? !!F : J, C = Pe(null), n = h(
|
|
38
39
|
(e) => {
|
|
39
|
-
D ||
|
|
40
|
+
D || Q(e), R?.(e);
|
|
40
41
|
},
|
|
41
42
|
[D, R]
|
|
42
|
-
),
|
|
43
|
+
), $ = ke(), V = E === void 0, { refs: a, floatingStyles: Z, context: u } = ce({
|
|
43
44
|
placement: E,
|
|
44
45
|
open: s,
|
|
45
46
|
onOpenChange: n,
|
|
46
47
|
whileElementsMounted: de,
|
|
47
48
|
middleware: [
|
|
48
49
|
fe({ mainAxis: x, crossAxis: 0 }),
|
|
49
|
-
|
|
50
|
+
V ? ue({
|
|
50
51
|
alignment: "start",
|
|
51
52
|
crossAxis: !0,
|
|
52
53
|
padding: x,
|
|
53
|
-
allowedPlacements:
|
|
54
|
+
allowedPlacements: q
|
|
54
55
|
}) : pe({ padding: x }),
|
|
55
56
|
me({ padding: x }),
|
|
56
57
|
he({
|
|
57
58
|
padding: x,
|
|
58
59
|
apply({ availableWidth: e, availableHeight: t, elements: p }) {
|
|
59
|
-
const l = p.floating,
|
|
60
|
+
const l = p.floating, j = We(p.reference);
|
|
60
61
|
l.style.setProperty(
|
|
61
62
|
"--fui-available-height",
|
|
62
63
|
`${Math.floor(t)}px`
|
|
63
64
|
), l.style.setProperty(
|
|
64
65
|
"--reference-width",
|
|
65
|
-
k ? `${Math.round(
|
|
66
|
-
), k ? l.style.minWidth = `${Math.round(
|
|
67
|
-
const
|
|
68
|
-
l.style.maxHeight = `${
|
|
66
|
+
k ? `${Math.round(j)}px` : "0px"
|
|
67
|
+
), k ? l.style.minWidth = `${Math.round(j)}px` : l.style.removeProperty("min-width"), l.style.maxWidth = `${Math.floor(e)}px`;
|
|
68
|
+
const O = Math.floor(t);
|
|
69
|
+
l.style.maxHeight = `${S ? Math.min(O, S) : O}px`;
|
|
69
70
|
}
|
|
70
71
|
})
|
|
71
72
|
]
|
|
@@ -80,16 +81,16 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
80
81
|
bubbles: !0,
|
|
81
82
|
referencePress: !1,
|
|
82
83
|
outsidePress: (e) => {
|
|
83
|
-
if (!
|
|
84
|
+
if (!T) return !1;
|
|
84
85
|
const t = e.target;
|
|
85
|
-
return !(
|
|
86
|
+
return !(L?.current && t instanceof Node && L.current.contains(t));
|
|
86
87
|
}
|
|
87
|
-
}), ne = we(u, { role: "menu" }), { getReferenceProps: oe, getFloatingProps: re } =
|
|
88
|
+
}), ne = we(u, { role: "menu" }), { getReferenceProps: oe, getFloatingProps: re } = Ce([
|
|
88
89
|
H,
|
|
89
90
|
ee,
|
|
90
91
|
te,
|
|
91
92
|
ne
|
|
92
|
-
]),
|
|
93
|
+
]), b = h(
|
|
93
94
|
(e, t) => {
|
|
94
95
|
a.setPositionReference({
|
|
95
96
|
getBoundingClientRect: () => ({
|
|
@@ -107,51 +108,55 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
107
108
|
[a]
|
|
108
109
|
), se = h(
|
|
109
110
|
(e) => {
|
|
110
|
-
!i.includes(y.ContextMenu) || r || (e.preventDefault(), w && (
|
|
111
|
+
!i.includes(y.ContextMenu) || r || (e.preventDefault(), w && (b(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
111
112
|
e.clientX,
|
|
112
113
|
e.clientY
|
|
113
114
|
)), n(!0));
|
|
114
115
|
},
|
|
115
|
-
[w, r, n,
|
|
116
|
+
[w, r, n, b, i]
|
|
116
117
|
), le = h(
|
|
117
118
|
(e) => {
|
|
118
|
-
!w || r || (i.includes(y.ContextMenu) && s && n(!1),
|
|
119
|
+
!w || r || (i.includes(y.ContextMenu) && s && n(!1), b(e.clientX, e.clientY), C.current = document.elementFromPoint(
|
|
119
120
|
e.clientX,
|
|
120
121
|
e.clientY
|
|
121
122
|
));
|
|
122
123
|
},
|
|
123
|
-
[w, r,
|
|
124
|
+
[w, r, b, s, i, n]
|
|
124
125
|
);
|
|
125
126
|
U(() => {
|
|
126
127
|
r && s && n(!1);
|
|
127
128
|
}, [r, s, n]);
|
|
128
|
-
const
|
|
129
|
+
const W = h(
|
|
129
130
|
(e) => (t) => {
|
|
130
|
-
e.disabled || (e.onClick?.({ key: e.key, domEvent: t }),
|
|
131
|
+
e.disabled || (e.onClick?.({ key: e.key, domEvent: t }), M?.({ key: e.key, domEvent: t }), n(!1));
|
|
131
132
|
},
|
|
132
|
-
[
|
|
133
|
+
[M, n]
|
|
133
134
|
), ie = De(() => P ? P() : g ? /* @__PURE__ */ v(N, { children: [
|
|
134
135
|
d && /* @__PURE__ */ o(N, { children: typeof d == "function" ? d() : d }),
|
|
135
136
|
/* @__PURE__ */ o(
|
|
136
137
|
"div",
|
|
137
138
|
{
|
|
138
139
|
role: "none",
|
|
139
|
-
className:
|
|
140
|
+
className: I(
|
|
141
|
+
"py-1",
|
|
142
|
+
A,
|
|
143
|
+
Me.dropdownList
|
|
144
|
+
),
|
|
140
145
|
"aria-label": "dropdown",
|
|
141
146
|
children: g.map((e) => e.type === X.Divider ? /* @__PURE__ */ o(
|
|
142
147
|
"div",
|
|
143
148
|
{
|
|
144
149
|
role: "separator",
|
|
145
|
-
className:
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
className: I(
|
|
151
|
+
Ee,
|
|
152
|
+
B
|
|
148
153
|
)
|
|
149
154
|
},
|
|
150
155
|
e.key
|
|
151
156
|
) : e.type === X.PlainText ? /* @__PURE__ */ o(
|
|
152
157
|
"div",
|
|
153
158
|
{
|
|
154
|
-
className:
|
|
159
|
+
className: I(
|
|
155
160
|
"px-3 py-2 text-secondary dial-caption-text",
|
|
156
161
|
e.className
|
|
157
162
|
),
|
|
@@ -159,7 +164,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
159
164
|
},
|
|
160
165
|
e.key
|
|
161
166
|
) : e.children?.length ? /* @__PURE__ */ o(
|
|
162
|
-
|
|
167
|
+
$e,
|
|
163
168
|
{
|
|
164
169
|
item: e,
|
|
165
170
|
onRootClose: () => n(!1)
|
|
@@ -172,13 +177,13 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
172
177
|
type: "button",
|
|
173
178
|
"aria-disabled": !!e.disabled,
|
|
174
179
|
className: m(
|
|
175
|
-
|
|
176
|
-
e.disabled &&
|
|
177
|
-
e.danger &&
|
|
180
|
+
Fe,
|
|
181
|
+
e.disabled && Re,
|
|
182
|
+
e.danger && Ae,
|
|
178
183
|
e.className
|
|
179
184
|
),
|
|
180
185
|
disabled: e.disabled,
|
|
181
|
-
onClick:
|
|
186
|
+
onClick: W(e),
|
|
182
187
|
children: [
|
|
183
188
|
e.icon && /* @__PURE__ */ o(
|
|
184
189
|
"span",
|
|
@@ -187,7 +192,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
187
192
|
e.danger && "text-error",
|
|
188
193
|
e.disabled && "text-secondary"
|
|
189
194
|
),
|
|
190
|
-
children: /* @__PURE__ */ o(
|
|
195
|
+
children: /* @__PURE__ */ o(Ie, { icon: e.icon })
|
|
191
196
|
}
|
|
192
197
|
),
|
|
193
198
|
/* @__PURE__ */ o(
|
|
@@ -210,14 +215,14 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
210
215
|
),
|
|
211
216
|
f && /* @__PURE__ */ o(N, { children: typeof f == "function" ? f() : f })
|
|
212
217
|
] }) : null, [
|
|
213
|
-
|
|
218
|
+
W,
|
|
214
219
|
g,
|
|
215
220
|
f,
|
|
216
221
|
d,
|
|
217
222
|
P,
|
|
218
223
|
n,
|
|
219
|
-
|
|
220
|
-
|
|
224
|
+
A,
|
|
225
|
+
B
|
|
221
226
|
]), ae = oe({
|
|
222
227
|
onContextMenu: se,
|
|
223
228
|
onMouseDown: le
|
|
@@ -226,7 +231,7 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
226
231
|
if (!s) return;
|
|
227
232
|
const e = a.reference.current;
|
|
228
233
|
let t = null;
|
|
229
|
-
if (e instanceof Element ? t = e :
|
|
234
|
+
if (e instanceof Element ? t = e : C.current instanceof Element && (t = C.current), !t) return;
|
|
230
235
|
const p = new IntersectionObserver(
|
|
231
236
|
([l]) => {
|
|
232
237
|
l.isIntersecting || n(!1);
|
|
@@ -242,16 +247,16 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
242
247
|
className: m(
|
|
243
248
|
Be,
|
|
244
249
|
r && "!cursor-not-allowed opacity-75",
|
|
245
|
-
|
|
250
|
+
G
|
|
246
251
|
),
|
|
247
252
|
"aria-haspopup": "menu",
|
|
248
253
|
"aria-expanded": s,
|
|
249
|
-
"aria-controls":
|
|
254
|
+
"aria-controls": $,
|
|
250
255
|
...ae,
|
|
251
256
|
children: c
|
|
252
257
|
}
|
|
253
258
|
),
|
|
254
|
-
s && /* @__PURE__ */ o(
|
|
259
|
+
s && /* @__PURE__ */ o(be, { children: /* @__PURE__ */ o(
|
|
255
260
|
ve,
|
|
256
261
|
{
|
|
257
262
|
context: u,
|
|
@@ -261,22 +266,22 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
261
266
|
children: /* @__PURE__ */ v(
|
|
262
267
|
"div",
|
|
263
268
|
{
|
|
264
|
-
id:
|
|
269
|
+
id: $,
|
|
265
270
|
ref: a.setFloating,
|
|
266
|
-
style:
|
|
271
|
+
style: Z,
|
|
267
272
|
className: m(
|
|
268
|
-
|
|
273
|
+
Le,
|
|
269
274
|
!k && "w-max",
|
|
270
|
-
|
|
275
|
+
K
|
|
271
276
|
),
|
|
272
277
|
...re(),
|
|
273
278
|
children: [
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
_ && /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-2 pt-2", children: /* @__PURE__ */ o(
|
|
280
|
+
Se,
|
|
276
281
|
{
|
|
277
282
|
ariaLabel: "Close dropdown",
|
|
278
283
|
onClose: (e) => {
|
|
279
|
-
|
|
284
|
+
z?.(e), n(!1);
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
287
|
) }),
|
|
@@ -289,5 +294,5 @@ const je = (c) => "clientWidth" in c ? c.clientWidth : c.getBoundingClientRect?.
|
|
|
289
294
|
] });
|
|
290
295
|
};
|
|
291
296
|
export {
|
|
292
|
-
|
|
297
|
+
Je as DialDropdown
|
|
293
298
|
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
1
|
+
import { jsxs as r, Fragment as N, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import n from "classnames";
|
|
3
3
|
import { useCallback as y } from "react";
|
|
4
4
|
import { DialIcon as l } from "../Icon/Icon.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { DIAL_KIT_CLASS as g } from "../../constants/public-class-names.js";
|
|
6
|
+
import { useSubMenuFloating as C, SubMenuPanel as k } from "../../utils/sub-menu-floating.js";
|
|
7
|
+
import { dropdownGap as I, submenuCaretIcon as w, dropdownItemBaseClassName as i, dropdownItemDisabledClassName as m, dropdownItemDangerClassName as S } from "./constants.js";
|
|
8
|
+
const A = ({
|
|
8
9
|
item: a,
|
|
9
10
|
onRootClose: o
|
|
10
11
|
}) => {
|
|
11
12
|
const {
|
|
12
13
|
isOpen: t,
|
|
13
14
|
refs: d,
|
|
14
|
-
floatingStyles:
|
|
15
|
-
context:
|
|
16
|
-
getReferenceProps:
|
|
15
|
+
floatingStyles: c,
|
|
16
|
+
context: p,
|
|
17
|
+
getReferenceProps: b,
|
|
17
18
|
getFloatingProps: u
|
|
18
|
-
} =
|
|
19
|
-
(e) => (
|
|
20
|
-
e.disabled || (e.onClick?.({ key: e.key, domEvent:
|
|
19
|
+
} = C(I, "menu", !!a.disabled), x = y(
|
|
20
|
+
(e) => (f) => {
|
|
21
|
+
e.disabled || (e.onClick?.({ key: e.key, domEvent: f }), o());
|
|
21
22
|
},
|
|
22
23
|
[o]
|
|
23
24
|
);
|
|
24
|
-
return /* @__PURE__ */ r(
|
|
25
|
+
return /* @__PURE__ */ r(N, { children: [
|
|
25
26
|
/* @__PURE__ */ r(
|
|
26
27
|
"button",
|
|
27
28
|
{
|
|
@@ -33,11 +34,11 @@ const v = ({
|
|
|
33
34
|
"aria-disabled": !!a.disabled,
|
|
34
35
|
disabled: a.disabled,
|
|
35
36
|
className: n(
|
|
36
|
-
|
|
37
|
-
a.disabled &&
|
|
37
|
+
i,
|
|
38
|
+
a.disabled && m,
|
|
38
39
|
a.className
|
|
39
40
|
),
|
|
40
|
-
...
|
|
41
|
+
...b(),
|
|
41
42
|
children: [
|
|
42
43
|
a.icon && /* @__PURE__ */ s("span", { className: n(a.disabled && "text-secondary"), children: /* @__PURE__ */ s(l, { icon: a.icon }) }),
|
|
43
44
|
/* @__PURE__ */ s(
|
|
@@ -67,55 +68,62 @@ const v = ({
|
|
|
67
68
|
k,
|
|
68
69
|
{
|
|
69
70
|
refs: d,
|
|
70
|
-
floatingStyles:
|
|
71
|
-
context:
|
|
71
|
+
floatingStyles: c,
|
|
72
|
+
context: p,
|
|
72
73
|
getFloatingProps: u,
|
|
73
74
|
role: "menu",
|
|
74
75
|
className: "w-max",
|
|
75
|
-
children: /* @__PURE__ */ s(
|
|
76
|
-
"
|
|
76
|
+
children: /* @__PURE__ */ s(
|
|
77
|
+
"div",
|
|
77
78
|
{
|
|
78
|
-
role: "
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
role: "none",
|
|
80
|
+
className: n("py-1", g.dropdownList),
|
|
81
|
+
children: a.children.map((e) => /* @__PURE__ */ r(
|
|
82
|
+
"button",
|
|
83
|
+
{
|
|
84
|
+
role: "menuitem",
|
|
85
|
+
type: "button",
|
|
86
|
+
"aria-disabled": !!e.disabled,
|
|
87
|
+
disabled: e.disabled,
|
|
88
|
+
className: n(
|
|
89
|
+
i,
|
|
90
|
+
e.disabled && m,
|
|
91
|
+
e.danger && S,
|
|
92
|
+
e.className
|
|
93
|
+
),
|
|
94
|
+
onClick: x(e),
|
|
95
|
+
children: [
|
|
96
|
+
e.icon && /* @__PURE__ */ s(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: n(
|
|
100
|
+
e.danger && "text-error",
|
|
101
|
+
e.disabled && "text-secondary"
|
|
102
|
+
),
|
|
103
|
+
children: /* @__PURE__ */ s(l, { icon: e.icon })
|
|
104
|
+
}
|
|
96
105
|
),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
)) })
|
|
106
|
+
/* @__PURE__ */ s(
|
|
107
|
+
"span",
|
|
108
|
+
{
|
|
109
|
+
className: n(
|
|
110
|
+
"flex-1 truncate text-start",
|
|
111
|
+
e.danger && "text-error",
|
|
112
|
+
e.disabled && "text-secondary"
|
|
113
|
+
),
|
|
114
|
+
children: e.label
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
e.key
|
|
120
|
+
))
|
|
121
|
+
}
|
|
122
|
+
)
|
|
115
123
|
}
|
|
116
124
|
)
|
|
117
125
|
] });
|
|
118
126
|
};
|
|
119
127
|
export {
|
|
120
|
-
|
|
128
|
+
A as DropdownSubMenuItem
|
|
121
129
|
};
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import o from "classnames";
|
|
3
3
|
import { IconChevronRight as r } from "@tabler/icons-react";
|
|
4
|
-
|
|
4
|
+
import { DIAL_KIT_CLASS as s } from "../../constants/public-class-names.js";
|
|
5
|
+
const m = o(
|
|
5
6
|
"flex items-center gap-2 align-middle",
|
|
6
7
|
"h-auto px-0 bg-transparent border-0"
|
|
7
|
-
), d = o(
|
|
8
|
-
"z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"
|
|
9
8
|
), i = o(
|
|
9
|
+
"z-[53] overflow-auto rounded bg-layer-0 text-primary shadow focus-visible:outline-none"
|
|
10
|
+
), l = o(
|
|
10
11
|
"flex w-full cursor-pointer items-center gap-3",
|
|
11
12
|
"focus-visible:border-none focus-visible:outline-none",
|
|
12
13
|
"hover:bg-accent-primary-alpha px-3",
|
|
13
|
-
"dial-small-text h-[34px] rounded text-primary"
|
|
14
|
-
|
|
14
|
+
"dial-small-text h-[34px] rounded text-primary",
|
|
15
|
+
s.menuItem
|
|
16
|
+
), p = "opacity-75 !cursor-not-allowed", c = "text-error", u = "my-1 border-t border-hover border-secondary", b = 4, f = /* @__PURE__ */ e(r, { size: 14 });
|
|
15
17
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
m as dropdownBaseClassName,
|
|
19
|
+
u as dropdownDividerClassName,
|
|
20
|
+
b as dropdownGap,
|
|
21
|
+
l as dropdownItemBaseClassName,
|
|
22
|
+
c as dropdownItemDangerClassName,
|
|
23
|
+
p as dropdownItemDisabledClassName,
|
|
24
|
+
i as dropdownListBaseClassName,
|
|
25
|
+
f as submenuCaretIcon
|
|
24
26
|
};
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { IconChevronDown as O } from "@tabler/icons-react";
|
|
3
3
|
import { useState as j } from "react";
|
|
4
|
-
import { DialDropdown as
|
|
4
|
+
import { DialDropdown as L } from "../Dropdown/Dropdown.js";
|
|
5
5
|
import { DialIcon as m } from "../Icon/Icon.js";
|
|
6
|
-
import { DIAL_ICON_SIZE as
|
|
6
|
+
import { DIAL_ICON_SIZE as _ } from "../../constants/icon.js";
|
|
7
|
+
import { DIAL_KIT_CLASS as p } from "../../constants/public-class-names.js";
|
|
7
8
|
import { ElementSize as r } from "../../types/size.js";
|
|
8
9
|
import { mergeClasses as o } from "../../utils/merge-classes.js";
|
|
9
10
|
const F = ({
|
|
10
|
-
icon:
|
|
11
|
+
icon: f,
|
|
11
12
|
ariaLabel: b,
|
|
12
13
|
size: n = r.Standard,
|
|
13
14
|
disabled: a = !1,
|
|
14
|
-
className:
|
|
15
|
-
buttonClassName:
|
|
16
|
-
iconClassName:
|
|
17
|
-
caretIcon:
|
|
15
|
+
className: u,
|
|
16
|
+
buttonClassName: x,
|
|
17
|
+
iconClassName: h,
|
|
18
|
+
caretIcon: y = /* @__PURE__ */ e(O, { size: _.SM }),
|
|
18
19
|
showCaret: t = !0,
|
|
19
|
-
placement:
|
|
20
|
-
matchReferenceWidth:
|
|
20
|
+
placement: g = "bottom-start",
|
|
21
|
+
matchReferenceWidth: S = !1,
|
|
21
22
|
open: v,
|
|
22
|
-
onOpenChange:
|
|
23
|
+
onOpenChange: I,
|
|
23
24
|
defaultOpen: s = !1,
|
|
24
25
|
...z
|
|
25
26
|
}) => {
|
|
26
|
-
const i = n === r.Small, [
|
|
27
|
+
const i = n === r.Small, [C, D] = j(s), l = v ?? C, w = i ? "w-8 px-0" : "w-10 px-0", N = {
|
|
27
28
|
[r.Small]: "size-5",
|
|
28
29
|
[r.Standard]: "size-6",
|
|
29
30
|
[r.Large]: "size-7"
|
|
30
31
|
};
|
|
31
32
|
return /* @__PURE__ */ e(
|
|
32
|
-
|
|
33
|
+
L,
|
|
33
34
|
{
|
|
34
35
|
...z,
|
|
35
36
|
disabled: a,
|
|
36
|
-
placement:
|
|
37
|
-
matchReferenceWidth:
|
|
38
|
-
className:
|
|
37
|
+
placement: g,
|
|
38
|
+
matchReferenceWidth: S,
|
|
39
|
+
className: u,
|
|
39
40
|
open: l,
|
|
40
41
|
onOpenChange: (c) => {
|
|
41
|
-
|
|
42
|
+
D(c), I?.(c);
|
|
42
43
|
},
|
|
43
44
|
defaultOpen: s,
|
|
44
45
|
children: /* @__PURE__ */ d(
|
|
@@ -52,35 +53,45 @@ const F = ({
|
|
|
52
53
|
"enabled:hover:bg-accent-primary-alpha enabled:active:bg-controls-accent-primary-alpha-active",
|
|
53
54
|
"focus-visible:border-focus focus-visible:outline-none disabled:cursor-not-allowed disabled:text-controls-secondary-disable disabled:opacity-75",
|
|
54
55
|
i ? "h-8 px-2" : "h-10 px-2",
|
|
55
|
-
t ? void 0 :
|
|
56
|
-
|
|
56
|
+
t ? void 0 : w,
|
|
57
|
+
x
|
|
57
58
|
),
|
|
58
59
|
children: [
|
|
59
60
|
/* @__PURE__ */ e(
|
|
60
61
|
m,
|
|
61
62
|
{
|
|
62
|
-
icon:
|
|
63
|
+
icon: f,
|
|
63
64
|
className: o(
|
|
64
65
|
"flex items-center justify-center text-inherit",
|
|
65
66
|
N[n],
|
|
66
67
|
t && "-mr-2",
|
|
67
|
-
|
|
68
|
+
h,
|
|
69
|
+
p.dropdownIcon
|
|
68
70
|
)
|
|
69
71
|
}
|
|
70
72
|
),
|
|
71
|
-
t && /* @__PURE__ */ d(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
t && /* @__PURE__ */ d(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: o(
|
|
77
|
+
"relative z-10 inline-grid size-5 shrink-0 place-items-center",
|
|
78
|
+
p.dropdownIconCaret
|
|
79
|
+
),
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0 rounded-full bg-layer-2" }),
|
|
82
|
+
/* @__PURE__ */ e(
|
|
83
|
+
m,
|
|
84
|
+
{
|
|
85
|
+
icon: y,
|
|
86
|
+
className: o(
|
|
87
|
+
"relative flex items-center justify-center text-secondary transition-transform group-hover:text-primary group-disabled:text-controls-secondary-disable",
|
|
88
|
+
l && "rotate-180"
|
|
89
|
+
)
|
|
90
|
+
}
|
|
80
91
|
)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
)
|
|
84
95
|
]
|
|
85
96
|
}
|
|
86
97
|
)
|