@epam/ai-dial-ui-kit 0.15.0-dev.24 → 0.15.0-dev.27
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/dist/CHANGELOG.md +6 -0
- package/dist/DateCellRenderer-BZ8vGglE.cjs +1 -0
- 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/Button/Button.js +32 -32
- package/dist/components/New/Button/utils.js +18 -8
- package/dist/components/New/IconButton/IconButton.js +30 -28
- package/dist/components/New/InlineSelect/InlineSelect.js +78 -66
- package/dist/components-manifest.json +29 -3
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/file-manager.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- 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/Button/Button.d.ts +4 -1
- package/dist/src/components/New/Button/utils.d.ts +15 -0
- package/dist/src/components/New/InlineSelect/InlineSelect.d.ts +8 -0
- package/dist/{use-file-manager-tabs-4s-dbnmu.cjs → use-file-manager-tabs-LWyTVrbO.cjs} +2 -2
- package/package.json +1 -1
- package/dist/DateCellRenderer-CkFOYZGc.cjs +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as F } from "react";
|
|
3
|
-
import { DialFileNodeType as
|
|
3
|
+
import { DialFileNodeType as i, DialFilePermission as X } from "../../../models/file.js";
|
|
4
4
|
import { DialFileManagerActions as e } from "../../../types/file-manager.js";
|
|
5
|
-
import { IconExternalLink as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
5
|
+
import { IconExternalLink as O, IconCopy as _, IconDownload as j, IconEye as W, IconTrashX as $, IconPencilMinus as q, IconInfoCircle as B, IconUserX as H } from "@tabler/icons-react";
|
|
6
|
+
import J from "../../../assets/icons/copy-to.svg.js";
|
|
7
|
+
import K from "../../../assets/icons/move-to.svg.js";
|
|
8
|
+
import Q from "../../../assets/icons/unshare.svg.js";
|
|
9
|
+
import V from "../../../assets/icons/add-child.svg.js";
|
|
10
|
+
import Y from "../../../assets/icons/add-sibling.svg.js";
|
|
11
11
|
import { BASE_ICON_PROPS as n } from "../../../constants/icon.js";
|
|
12
|
-
import { DropdownItemType as
|
|
13
|
-
import { cleanForbiddenSymbolsRegExp as
|
|
14
|
-
const
|
|
12
|
+
import { DropdownItemType as Z } from "../../../types/dropdown.js";
|
|
13
|
+
import { cleanForbiddenSymbolsRegExp as G } from "../utils.js";
|
|
14
|
+
const ye = ({
|
|
15
15
|
actionLabels: s,
|
|
16
16
|
onDuplicate: u,
|
|
17
17
|
onCopy: a,
|
|
18
18
|
onMove: k,
|
|
19
19
|
onDownload: l,
|
|
20
|
-
onRename:
|
|
21
|
-
onDelete:
|
|
20
|
+
onRename: T,
|
|
21
|
+
onDelete: C,
|
|
22
22
|
onInfo: I,
|
|
23
23
|
onUnshare: x,
|
|
24
24
|
onRemoveAccess: c,
|
|
@@ -31,62 +31,61 @@ const de = ({
|
|
|
31
31
|
isRenameFileAvailable: v = !0,
|
|
32
32
|
isDuplicateFolderAvailable: E = !0,
|
|
33
33
|
forbiddenSymbolsRegExp: z,
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
skipForbiddenSymbolsCheckForActions: w,
|
|
35
|
+
onGridCreateSiblingFolder: M,
|
|
36
|
+
onGridCreateChildFolder: R
|
|
36
37
|
}) => F(() => (o) => {
|
|
37
38
|
const t = [];
|
|
38
39
|
if (!s)
|
|
39
40
|
return t;
|
|
40
|
-
const p =
|
|
41
|
-
|
|
42
|
-
)?.test(o.name);
|
|
43
|
-
s[e.AddSibling] && o.nodeType === r.FOLDER && t.push({
|
|
41
|
+
const p = !w && G(z)?.test(o.name);
|
|
42
|
+
s[e.AddSibling] && o.nodeType === i.FOLDER && t.push({
|
|
44
43
|
key: "addSibling",
|
|
45
44
|
label: s[e.AddSibling],
|
|
46
|
-
icon: /* @__PURE__ */
|
|
47
|
-
|
|
45
|
+
icon: /* @__PURE__ */ r(
|
|
46
|
+
Y,
|
|
48
47
|
{
|
|
49
48
|
width: n.size,
|
|
50
49
|
height: n.size,
|
|
51
50
|
className: "text-secondary"
|
|
52
51
|
}
|
|
53
52
|
),
|
|
54
|
-
onClick: () =>
|
|
55
|
-
}), s[e.AddChild] && o.nodeType ===
|
|
53
|
+
onClick: () => M([o])
|
|
54
|
+
}), s[e.AddChild] && o.nodeType === i.FOLDER && !p && t.push(
|
|
56
55
|
{
|
|
57
56
|
key: "addChild",
|
|
58
57
|
label: s[e.AddChild],
|
|
59
|
-
icon: /* @__PURE__ */
|
|
60
|
-
|
|
58
|
+
icon: /* @__PURE__ */ r(
|
|
59
|
+
V,
|
|
61
60
|
{
|
|
62
61
|
width: n.size,
|
|
63
62
|
height: n.size,
|
|
64
63
|
className: "text-secondary"
|
|
65
64
|
}
|
|
66
65
|
),
|
|
67
|
-
onClick: () =>
|
|
66
|
+
onClick: () => R([o])
|
|
68
67
|
},
|
|
69
68
|
{
|
|
70
69
|
key: "divider",
|
|
71
|
-
type:
|
|
70
|
+
type: Z.Divider
|
|
72
71
|
}
|
|
73
|
-
), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType ===
|
|
72
|
+
), s[e.OpenInNewTab] && typeof y == "function" && o.nodeType === i.ITEM && !p && t.push({
|
|
74
73
|
key: e.OpenInNewTab,
|
|
75
74
|
label: s[e.OpenInNewTab],
|
|
76
|
-
icon: /* @__PURE__ */
|
|
75
|
+
icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
|
|
77
76
|
onClick: () => y?.(o)
|
|
78
77
|
});
|
|
79
|
-
const
|
|
80
|
-
s[e.Duplicate] &&
|
|
78
|
+
const P = o.nodeType === i.ITEM || o.nodeType === i.FOLDER && E;
|
|
79
|
+
s[e.Duplicate] && P && !p && t.push({
|
|
81
80
|
key: e.Duplicate,
|
|
82
81
|
label: s[e.Duplicate],
|
|
83
|
-
icon: /* @__PURE__ */
|
|
82
|
+
icon: /* @__PURE__ */ r(_, { ...n, className: "text-secondary" }),
|
|
84
83
|
onClick: () => u(o)
|
|
85
84
|
}), s[e.Copy] && !p && t.push({
|
|
86
85
|
key: e.Copy,
|
|
87
86
|
label: s[e.Copy],
|
|
88
|
-
icon: /* @__PURE__ */
|
|
89
|
-
|
|
87
|
+
icon: /* @__PURE__ */ r(
|
|
88
|
+
J,
|
|
90
89
|
{
|
|
91
90
|
width: n.size,
|
|
92
91
|
height: n.size,
|
|
@@ -97,8 +96,8 @@ const de = ({
|
|
|
97
96
|
}), s[e.Move] && !p && t.push({
|
|
98
97
|
key: e.Move,
|
|
99
98
|
label: s[e.Move],
|
|
100
|
-
icon: /* @__PURE__ */
|
|
101
|
-
|
|
99
|
+
icon: /* @__PURE__ */ r(
|
|
100
|
+
K,
|
|
102
101
|
{
|
|
103
102
|
width: n.size,
|
|
104
103
|
height: n.size,
|
|
@@ -109,44 +108,44 @@ const de = ({
|
|
|
109
108
|
}), s[e.Download] && !p && t.push({
|
|
110
109
|
key: e.Download,
|
|
111
110
|
label: s[e.Download],
|
|
112
|
-
icon: /* @__PURE__ */
|
|
111
|
+
icon: /* @__PURE__ */ r(j, { ...n, className: "text-secondary" }),
|
|
113
112
|
onClick: () => l(o)
|
|
114
|
-
}), s[e.ManagePermissions] && typeof m == "function" && o.nodeType ===
|
|
113
|
+
}), s[e.ManagePermissions] && typeof m == "function" && o.nodeType === i.FOLDER && !p && t.push({
|
|
115
114
|
key: e.ManagePermissions,
|
|
116
115
|
label: s[e.ManagePermissions],
|
|
117
|
-
icon: /* @__PURE__ */
|
|
116
|
+
icon: /* @__PURE__ */ r(O, { ...n, className: "text-secondary" }),
|
|
118
117
|
onClick: () => m?.(o.path)
|
|
119
118
|
});
|
|
120
|
-
const h = o.name.split("."),
|
|
121
|
-
s[e.Preview] && typeof d == "function" && o.nodeType ===
|
|
119
|
+
const h = o.name.split("."), S = h.length > 1 ? h[h.length - 1] : "", f = S && D?.includes(`.${S}`);
|
|
120
|
+
s[e.Preview] && typeof d == "function" && o.nodeType === i.ITEM && f && !p && t.push({
|
|
122
121
|
key: e.Preview,
|
|
123
122
|
label: s[e.Preview],
|
|
124
|
-
icon: /* @__PURE__ */
|
|
123
|
+
icon: /* @__PURE__ */ r(W, { ...n, className: "text-secondary" }),
|
|
125
124
|
onClick: () => d?.(o.path)
|
|
126
125
|
});
|
|
127
|
-
const
|
|
128
|
-
s[e.Delete] &&
|
|
126
|
+
const A = !o.permissions || o.permissions.includes(X.WRITE);
|
|
127
|
+
s[e.Delete] && A && t.push({
|
|
129
128
|
key: e.Delete,
|
|
130
129
|
label: s[e.Delete],
|
|
131
|
-
icon: /* @__PURE__ */
|
|
132
|
-
onClick: () =>
|
|
130
|
+
icon: /* @__PURE__ */ r($, { ...n, className: "text-secondary" }),
|
|
131
|
+
onClick: () => C(o, o.parentPath ?? "")
|
|
133
132
|
});
|
|
134
|
-
const
|
|
135
|
-
return s[e.Rename] &&
|
|
133
|
+
const U = o.nodeType === i.FOLDER || o.nodeType === i.ITEM && v;
|
|
134
|
+
return s[e.Rename] && U && A && t.push({
|
|
136
135
|
key: e.Rename,
|
|
137
136
|
label: s[e.Rename],
|
|
138
|
-
icon: /* @__PURE__ */
|
|
139
|
-
onClick: () =>
|
|
140
|
-
}), s[e.Info] && o.nodeType ===
|
|
137
|
+
icon: /* @__PURE__ */ r(q, { ...n, className: "text-secondary" }),
|
|
138
|
+
onClick: () => T(o.path)
|
|
139
|
+
}), s[e.Info] && o.nodeType === i.ITEM && !p && t.push({
|
|
141
140
|
key: e.Info,
|
|
142
141
|
label: s[e.Info],
|
|
143
|
-
icon: /* @__PURE__ */
|
|
142
|
+
icon: /* @__PURE__ */ r(B, { ...n, className: "text-secondary" }),
|
|
144
143
|
onClick: () => I(o)
|
|
145
144
|
}), s[e.Unshare] && N?.includes(o.path) && t.push({
|
|
146
145
|
key: e.Unshare,
|
|
147
146
|
label: s[e.Unshare],
|
|
148
|
-
icon: /* @__PURE__ */
|
|
149
|
-
|
|
147
|
+
icon: /* @__PURE__ */ r(
|
|
148
|
+
Q,
|
|
150
149
|
{
|
|
151
150
|
width: n.size,
|
|
152
151
|
height: n.size,
|
|
@@ -157,7 +156,7 @@ const de = ({
|
|
|
157
156
|
}), s[e.RemoveAccess] && g?.has(o.path) && c && t.push({
|
|
158
157
|
key: e.RemoveAccess,
|
|
159
158
|
label: s[e.RemoveAccess],
|
|
160
|
-
icon: /* @__PURE__ */
|
|
159
|
+
icon: /* @__PURE__ */ r(H, { size: n.size, className: "text-secondary" }),
|
|
161
160
|
onClick: () => c(o)
|
|
162
161
|
}), t;
|
|
163
162
|
}, [
|
|
@@ -166,8 +165,8 @@ const de = ({
|
|
|
166
165
|
a,
|
|
167
166
|
k,
|
|
168
167
|
l,
|
|
169
|
-
T,
|
|
170
168
|
C,
|
|
169
|
+
T,
|
|
171
170
|
I,
|
|
172
171
|
x,
|
|
173
172
|
c,
|
|
@@ -180,9 +179,10 @@ const de = ({
|
|
|
180
179
|
v,
|
|
181
180
|
E,
|
|
182
181
|
z,
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
w,
|
|
183
|
+
R,
|
|
184
|
+
M
|
|
185
185
|
]);
|
|
186
186
|
export {
|
|
187
|
-
|
|
187
|
+
ye as useGridContextMenu
|
|
188
188
|
};
|
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
import { jsx as t, jsxs as I, Fragment as j } from "react/jsx-runtime";
|
|
2
|
-
import { DialIcon as
|
|
3
|
-
import { ButtonAppearance as
|
|
2
|
+
import { DialIcon as f } from "../../Icon/Icon.js";
|
|
3
|
+
import { ButtonAppearance as c } from "../../../types/button.js";
|
|
4
4
|
import { ElementSize as o } from "../../../types/size.js";
|
|
5
5
|
import { mergeClasses as y } from "../../../utils/merge-classes.js";
|
|
6
6
|
import { resolveAccessibleName as A } from "../../../utils/accessible-name.js";
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import { getButtonClassNames as L } from "./utils.js";
|
|
9
|
-
const
|
|
7
|
+
import { Tooltip as D } from "../Tooltip/Tooltip.js";
|
|
8
|
+
import { getButtonClassNames as F, getDisabledButtonProps as L } from "./utils.js";
|
|
9
|
+
const K = ({
|
|
10
10
|
label: a,
|
|
11
|
-
variant:
|
|
12
|
-
appearance:
|
|
11
|
+
variant: s,
|
|
12
|
+
appearance: r = c.Solid,
|
|
13
13
|
size: n = o.Standard,
|
|
14
14
|
className: k,
|
|
15
|
-
textClassName:
|
|
16
|
-
iconAfter:
|
|
15
|
+
textClassName: g,
|
|
16
|
+
iconAfter: S,
|
|
17
17
|
iconBefore: v,
|
|
18
|
-
type:
|
|
19
|
-
tooltipProps:
|
|
18
|
+
type: C = "button",
|
|
19
|
+
tooltipProps: l,
|
|
20
20
|
href: d,
|
|
21
|
-
target:
|
|
22
|
-
rel:
|
|
21
|
+
target: b,
|
|
22
|
+
rel: N,
|
|
23
23
|
disabled: i,
|
|
24
24
|
...e
|
|
25
25
|
}) => {
|
|
26
26
|
const h = y(
|
|
27
27
|
"dial-kit-base-button",
|
|
28
|
-
|
|
28
|
+
s && F(s, r),
|
|
29
29
|
n === o.Small ? "dial-tiny-semi-text" : "dial-small-paragraph-semi-text",
|
|
30
30
|
n === o.Small ? "h-[24px] gap-1" : "h-[40px] gap-2",
|
|
31
31
|
// Corner radius is themable per size — see the radius tokens in
|
|
32
32
|
// `buttons.scss`; the standard radius comes from `dial-kit-base-button`.
|
|
33
33
|
n === o.Small && "dial-kit-base-button-small",
|
|
34
|
-
|
|
34
|
+
r !== c.Link && (n === o.Small ? "px-2" : "px-4"),
|
|
35
35
|
// A link-appearance button sits inline in text, where WCAG 2.5.5 exempts
|
|
36
36
|
// it and an expanded target would overlap the surrounding copy.
|
|
37
|
-
n !== o.Small &&
|
|
37
|
+
n !== o.Small && r !== c.Link && "dial-kit-enhanced-target",
|
|
38
38
|
k
|
|
39
|
-
), B = a ? void 0 :
|
|
39
|
+
), B = a ? void 0 : l?.tooltip, p = A(
|
|
40
40
|
typeof a == "string" ? a : void 0,
|
|
41
41
|
e["aria-label"],
|
|
42
42
|
B
|
|
43
|
-
),
|
|
44
|
-
/* @__PURE__ */ t(
|
|
45
|
-
a && /* @__PURE__ */ t("span", { className:
|
|
46
|
-
/* @__PURE__ */ t(
|
|
47
|
-
] }), m = e,
|
|
43
|
+
), u = /* @__PURE__ */ I(j, { children: [
|
|
44
|
+
/* @__PURE__ */ t(f, { icon: v }),
|
|
45
|
+
a && /* @__PURE__ */ t("span", { className: g, children: a }),
|
|
46
|
+
/* @__PURE__ */ t(f, { icon: S })
|
|
47
|
+
] }), m = e, x = d !== void 0 ? /* @__PURE__ */ t(
|
|
48
48
|
"a",
|
|
49
49
|
{
|
|
50
50
|
...m,
|
|
51
51
|
href: i ? void 0 : d,
|
|
52
|
-
target:
|
|
53
|
-
rel:
|
|
52
|
+
target: b,
|
|
53
|
+
rel: N ?? (b === "_blank" ? "noopener noreferrer" : void 0),
|
|
54
54
|
"aria-disabled": i || void 0,
|
|
55
55
|
tabIndex: i ? -1 : m.tabIndex,
|
|
56
56
|
onClick: i ? void 0 : m.onClick,
|
|
57
57
|
className: h,
|
|
58
|
-
"aria-label":
|
|
59
|
-
children:
|
|
58
|
+
"aria-label": p,
|
|
59
|
+
children: u
|
|
60
60
|
}
|
|
61
61
|
) : /* @__PURE__ */ t(
|
|
62
62
|
"button",
|
|
63
63
|
{
|
|
64
64
|
...e,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
...L(i, l, e.onClick),
|
|
66
|
+
type: C,
|
|
67
67
|
className: h,
|
|
68
|
-
"aria-label":
|
|
69
|
-
children:
|
|
68
|
+
"aria-label": p,
|
|
69
|
+
children: u
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
|
-
return
|
|
72
|
+
return l ? /* @__PURE__ */ t(D, { asChild: !0, ...l, children: x }) : x;
|
|
73
73
|
};
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
K as Button
|
|
76
76
|
};
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { ButtonVariant as o, ButtonAppearance as
|
|
2
|
-
import { variantClassMap as
|
|
3
|
-
const l = (t
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ButtonVariant as o, ButtonAppearance as r } from "../../../types/button.js";
|
|
2
|
+
import { variantClassMap as a } from "./constants.js";
|
|
3
|
+
const l = (t) => {
|
|
4
|
+
t.preventDefault();
|
|
5
|
+
}, d = (t, n, i) => {
|
|
6
|
+
const e = n != null && !n.hideTooltip && n.tooltip != null && n.tooltip !== "";
|
|
7
|
+
return t && e ? {
|
|
8
|
+
disabled: void 0,
|
|
9
|
+
"aria-disabled": !0,
|
|
10
|
+
onClick: l
|
|
11
|
+
} : { disabled: t, onClick: i };
|
|
12
|
+
}, c = (t = o.Primary, n = r.Solid) => {
|
|
13
|
+
const i = a[t]?.[n];
|
|
14
|
+
return i || (console.warn(
|
|
15
|
+
`Could not find Button styles for variant: ${t} and appearance: ${n}. Using default primary solid button styles.`
|
|
16
|
+
), a[o.Primary][r.Solid]);
|
|
8
17
|
};
|
|
9
18
|
export {
|
|
10
|
-
|
|
19
|
+
c as getButtonClassNames,
|
|
20
|
+
d as getDisabledButtonProps
|
|
11
21
|
};
|
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ButtonAppearance as
|
|
3
|
-
import { mergeClasses as
|
|
4
|
-
import { resolveAccessibleName as
|
|
5
|
-
import { ElementSize as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { getButtonClassNames as
|
|
8
|
-
const
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
},
|
|
13
|
-
variant:
|
|
14
|
-
appearance:
|
|
15
|
-
size: l =
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ButtonAppearance as u } from "../../../types/button.js";
|
|
3
|
+
import { mergeClasses as S } from "../../../utils/merge-classes.js";
|
|
4
|
+
import { resolveAccessibleName as f } from "../../../utils/accessible-name.js";
|
|
5
|
+
import { ElementSize as e } from "../../../types/size.js";
|
|
6
|
+
import { Tooltip as g } from "../Tooltip/Tooltip.js";
|
|
7
|
+
import { getButtonClassNames as p, getDisabledButtonProps as C } from "../Button/utils.js";
|
|
8
|
+
const h = {
|
|
9
|
+
[e.Small]: "size-[24px]",
|
|
10
|
+
[e.Standard]: "size-[40px] dial-kit-enhanced-target",
|
|
11
|
+
[e.Large]: "size-[48px] dial-kit-enhanced-target"
|
|
12
|
+
}, I = ({
|
|
13
|
+
variant: i,
|
|
14
|
+
appearance: r = u.Solid,
|
|
15
|
+
size: l = e.Standard,
|
|
16
16
|
className: m,
|
|
17
17
|
icon: s,
|
|
18
|
-
tooltipProps:
|
|
18
|
+
tooltipProps: t,
|
|
19
19
|
type: c = "button",
|
|
20
|
-
|
|
20
|
+
disabled: d,
|
|
21
|
+
...a
|
|
21
22
|
}) => {
|
|
22
|
-
const
|
|
23
|
+
const b = S(
|
|
23
24
|
"dial-kit-base-icon-button dial-kit-base-button",
|
|
24
|
-
|
|
25
|
+
i && p(i, r),
|
|
25
26
|
// 24px is below the AAA target size, so only the larger tiers get the
|
|
26
27
|
// enhanced pointer target — see the accessibility rules in AGENTS.md.
|
|
27
|
-
|
|
28
|
+
h[l],
|
|
28
29
|
m
|
|
29
|
-
),
|
|
30
|
+
), n = /* @__PURE__ */ o(
|
|
30
31
|
"button",
|
|
31
32
|
{
|
|
32
|
-
...
|
|
33
|
+
...a,
|
|
34
|
+
...C(d, t, a.onClick),
|
|
33
35
|
type: c,
|
|
34
|
-
className:
|
|
35
|
-
"aria-label":
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
className: b,
|
|
37
|
+
"aria-label": f(
|
|
38
|
+
a["aria-label"],
|
|
39
|
+
t?.tooltip
|
|
38
40
|
),
|
|
39
41
|
children: s
|
|
40
42
|
}
|
|
41
43
|
);
|
|
42
|
-
return
|
|
44
|
+
return t ? /* @__PURE__ */ o(g, { asChild: !0, ...t, children: n }) : n;
|
|
43
45
|
};
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
I as IconButton
|
|
46
48
|
};
|
|
@@ -1,98 +1,110 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconChevronDown as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Dropdown as
|
|
5
|
-
import { DIAL_KIT_ICON_STROKE as
|
|
6
|
-
import { DIAL_ICON_SIZE as
|
|
7
|
-
import { mergeClasses as
|
|
8
|
-
import { ElementSize as
|
|
9
|
-
import { DIAL_KIT_CLASS as
|
|
10
|
-
const
|
|
1
|
+
import { jsx as i, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { IconChevronDown as A } from "@tabler/icons-react";
|
|
3
|
+
import { useState as u, useCallback as h, useMemo as L } from "react";
|
|
4
|
+
import { Dropdown as T } from "../Dropdown/Dropdown.js";
|
|
5
|
+
import { DIAL_KIT_ICON_STROKE as E } from "../constants/icon.js";
|
|
6
|
+
import { DIAL_ICON_SIZE as j } from "../../../constants/icon.js";
|
|
7
|
+
import { mergeClasses as b } from "../../../utils/merge-classes.js";
|
|
8
|
+
import { ElementSize as w } from "../../../types/size.js";
|
|
9
|
+
import { DIAL_KIT_CLASS as z } from "../../../constants/public-class-names.js";
|
|
10
|
+
const M = ({
|
|
11
11
|
label: e,
|
|
12
|
-
size:
|
|
13
|
-
isOpen:
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
size: o,
|
|
13
|
+
isOpen: l = !1,
|
|
14
|
+
labelClassName: n,
|
|
15
|
+
className: s,
|
|
16
|
+
"aria-label": a,
|
|
17
|
+
...c
|
|
16
18
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
const m = o === w.Small ? "h-[32px]" : "h-[40px] dial-kit-enhanced-target";
|
|
20
|
+
return /* @__PURE__ */ O(
|
|
19
21
|
"button",
|
|
20
22
|
{
|
|
21
23
|
type: "button",
|
|
24
|
+
...c,
|
|
22
25
|
"aria-haspopup": "menu",
|
|
23
|
-
"aria-expanded":
|
|
24
|
-
"aria-label":
|
|
25
|
-
className:
|
|
26
|
+
"aria-expanded": l,
|
|
27
|
+
"aria-label": a ? `${a} ${e}` : void 0,
|
|
28
|
+
className: b(
|
|
26
29
|
"dial-small-paragraph-text px-3 focus-visible:outline focus-visible:outline-focus",
|
|
27
30
|
"flex items-center gap-1 rounded-full text-primary disabled:text-control-disable-primary",
|
|
28
31
|
"hover:bg-control-accent-alpha-hover focus-visible:outline-offset-2 active:bg-control-accent-alpha-active",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
m,
|
|
33
|
+
s,
|
|
34
|
+
z.inlineSelect
|
|
32
35
|
),
|
|
33
|
-
...a,
|
|
34
36
|
children: [
|
|
35
|
-
e,
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
37
|
+
/* @__PURE__ */ i("span", { className: n, children: e }),
|
|
38
|
+
/* @__PURE__ */ i(
|
|
39
|
+
A,
|
|
38
40
|
{
|
|
39
|
-
size:
|
|
40
|
-
stroke:
|
|
41
|
+
size: j.MD,
|
|
42
|
+
stroke: E,
|
|
41
43
|
"aria-hidden": !0,
|
|
42
|
-
className:
|
|
44
|
+
className: b("transition-transform", l && "rotate-180")
|
|
43
45
|
}
|
|
44
46
|
)
|
|
45
47
|
]
|
|
46
48
|
}
|
|
47
49
|
);
|
|
48
|
-
},
|
|
50
|
+
}, J = ({
|
|
49
51
|
items: e,
|
|
50
|
-
selectedKey:
|
|
51
|
-
defaultSelectedKey:
|
|
52
|
-
onSelect:
|
|
53
|
-
size:
|
|
54
|
-
disabled:
|
|
55
|
-
placement:
|
|
56
|
-
matchReferenceWidth:
|
|
57
|
-
listClassName:
|
|
58
|
-
ariaLabel:
|
|
52
|
+
selectedKey: o,
|
|
53
|
+
defaultSelectedKey: l,
|
|
54
|
+
onSelect: n,
|
|
55
|
+
size: s,
|
|
56
|
+
disabled: a,
|
|
57
|
+
placement: c = "bottom-end",
|
|
58
|
+
matchReferenceWidth: m = !1,
|
|
59
|
+
listClassName: I,
|
|
60
|
+
ariaLabel: v,
|
|
61
|
+
triggerClassName: S,
|
|
62
|
+
triggerLabelClassName: x,
|
|
63
|
+
onOpenChange: d
|
|
59
64
|
}) => {
|
|
60
|
-
const [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const o = e.find((i) => i.key === m);
|
|
64
|
-
return o?.label ? String(o.label) : "";
|
|
65
|
-
}, [e, m]), C = N(
|
|
66
|
-
({ key: o }) => {
|
|
67
|
-
const i = e.find((k) => k.key === o);
|
|
68
|
-
i && (c || x(o), t?.(i));
|
|
65
|
+
const [C, g] = u(!1), N = h(
|
|
66
|
+
(t) => {
|
|
67
|
+
g(t), d?.(t);
|
|
69
68
|
},
|
|
70
|
-
[
|
|
69
|
+
[d]
|
|
70
|
+
), [k, y] = u(
|
|
71
|
+
l ?? e[0]?.key
|
|
72
|
+
), p = o !== void 0, f = p ? o : k, _ = L(() => {
|
|
73
|
+
const t = e.find((r) => r.key === f);
|
|
74
|
+
return t?.label ? String(t.label) : "";
|
|
75
|
+
}, [e, f]), D = h(
|
|
76
|
+
({ key: t }) => {
|
|
77
|
+
const r = e.find((K) => K.key === t);
|
|
78
|
+
r && (p || y(t), n?.(r));
|
|
79
|
+
},
|
|
80
|
+
[e, p, n]
|
|
71
81
|
);
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
82
|
+
return /* @__PURE__ */ i(
|
|
83
|
+
T,
|
|
74
84
|
{
|
|
75
85
|
items: e,
|
|
76
|
-
placement:
|
|
77
|
-
matchReferenceWidth:
|
|
78
|
-
listClassName:
|
|
79
|
-
disabled:
|
|
80
|
-
onOpenChange:
|
|
81
|
-
onItemClick:
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
|
|
86
|
+
placement: c,
|
|
87
|
+
matchReferenceWidth: m,
|
|
88
|
+
listClassName: I,
|
|
89
|
+
disabled: a,
|
|
90
|
+
onOpenChange: N,
|
|
91
|
+
onItemClick: D,
|
|
92
|
+
children: /* @__PURE__ */ i(
|
|
93
|
+
M,
|
|
84
94
|
{
|
|
85
|
-
label:
|
|
86
|
-
size:
|
|
87
|
-
isOpen:
|
|
88
|
-
disabled:
|
|
89
|
-
"aria-label":
|
|
95
|
+
label: _,
|
|
96
|
+
size: s,
|
|
97
|
+
isOpen: C,
|
|
98
|
+
disabled: a,
|
|
99
|
+
"aria-label": v,
|
|
100
|
+
className: S,
|
|
101
|
+
labelClassName: x
|
|
90
102
|
}
|
|
91
103
|
)
|
|
92
104
|
}
|
|
93
105
|
);
|
|
94
106
|
};
|
|
95
107
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
J as InlineSelect,
|
|
109
|
+
M as InlineSelectTrigger
|
|
98
110
|
};
|