@epam/ai-dial-ui-kit 0.15.0-dev.51 → 0.15.0-dev.53
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 +8 -0
- package/dist/{DateCellRenderer-CmgeZvYm.cjs → DateCellRenderer-BdUMSg-E.cjs} +1 -1
- package/dist/JsonEditor-eAV7SaKu.cjs +1 -0
- package/dist/{MarkdownEditor-BKtFs714.cjs → MarkdownEditor-Cp-KX6-T.cjs} +1 -1
- package/dist/{MarkdownEditor-Bapd1ycU.cjs → MarkdownEditor-Dav_pp0T.cjs} +1 -1
- package/dist/MarkdownEditorContainer-96cKYmYd.cjs +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
- package/dist/components/New/AutocompleteTagInput/AutocompleteTagInput.js +144 -137
- package/dist/components/New/Grid/constants.js +14 -5
- package/dist/components/New/Slider/Slider.js +115 -86
- package/dist/components/New/Slider/utils.js +14 -6
- package/dist/components-manifest.json +26 -6
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/editor-BH6_A1k2.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/index.css +2 -2
- package/dist/lazy-DMVYJhUR.cjs +1 -0
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +11 -0
- package/dist/src/components/New/Grid/constants.d.ts +6 -4
- package/dist/src/components/New/Slider/Slider.d.ts +9 -0
- package/dist/src/components/New/Slider/utils.d.ts +11 -3
- package/package.json +1 -1
- package/dist/JsonEditor-Bxui5wJH.cjs +0 -1
- package/dist/MarkdownEditorContainer-B5aHwoYF.cjs +0 -1
- package/dist/lazy-_W6FYhKg.cjs +0 -1
|
@@ -1,159 +1,166 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useFloating as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { Input as
|
|
5
|
-
import { MenuItem as
|
|
6
|
-
import { selectTagClassName as
|
|
7
|
-
import { Tag as
|
|
8
|
-
import { useThemeScope as
|
|
9
|
-
import { overlayGap as
|
|
10
|
-
import { DIAL_KIT_CLASS as
|
|
11
|
-
import { MenuItemMark as
|
|
12
|
-
import { ElementSize as
|
|
13
|
-
import { mergeClasses as
|
|
14
|
-
import { filterAutocompleteSuggestions as
|
|
15
|
-
const
|
|
16
|
-
id:
|
|
17
|
-
value:
|
|
18
|
-
defaultValue:
|
|
19
|
-
suggestions:
|
|
20
|
-
maxSuggestions:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { jsxs as ce, Fragment as me, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useFloating as pe, autoUpdate as fe, offset as de, flip as ue, size as he, FloatingPortal as ge } from "@floating-ui/react";
|
|
3
|
+
import { useId as we, useState as h, useMemo as ve, useCallback as xe } from "react";
|
|
4
|
+
import { Input as Ie } from "../Input/Input.js";
|
|
5
|
+
import { MenuItem as Te } from "../MenuItem/MenuItem.js";
|
|
6
|
+
import { selectTagClassName as Se } from "../Select/MultiSelectTags.js";
|
|
7
|
+
import { Tag as be } from "../Tag/Tag.js";
|
|
8
|
+
import { useThemeScope as ye } from "../ThemeScope/ThemeScope.js";
|
|
9
|
+
import { overlayGap as y, overlayListClassName as Ce, overlaySurfaceClassName as De } from "../constants/overlay.js";
|
|
10
|
+
import { DIAL_KIT_CLASS as Me } from "../../../constants/public-class-names.js";
|
|
11
|
+
import { MenuItemMark as Ae } from "../../../types/menu-item.js";
|
|
12
|
+
import { ElementSize as F } from "../../../types/size.js";
|
|
13
|
+
import { mergeClasses as f } from "../../../utils/merge-classes.js";
|
|
14
|
+
import { filterAutocompleteSuggestions as Ne } from "./utils.js";
|
|
15
|
+
const ke = 5, Pe = ({
|
|
16
|
+
id: G,
|
|
17
|
+
value: C,
|
|
18
|
+
defaultValue: K,
|
|
19
|
+
suggestions: g,
|
|
20
|
+
maxSuggestions: D = ke,
|
|
21
|
+
openOnFocus: m = !1,
|
|
22
|
+
size: M = F.Standard,
|
|
23
|
+
labelProps: R,
|
|
24
|
+
placeholder: j,
|
|
25
|
+
caption: H,
|
|
26
|
+
error: V,
|
|
27
|
+
invalid: A = !1,
|
|
28
|
+
disabled: w = !1,
|
|
29
|
+
readOnly: v = !1,
|
|
30
|
+
ariaLabel: P,
|
|
31
|
+
tagListLabel: N = "Tags",
|
|
32
|
+
getRemoveTagLabel: X,
|
|
33
|
+
className: q,
|
|
34
|
+
fieldClassName: J,
|
|
35
|
+
tagClassName: Q,
|
|
36
|
+
listClassName: W,
|
|
37
|
+
onChange: k
|
|
37
38
|
}) => {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
), a =
|
|
41
|
-
() =>
|
|
42
|
-
|
|
39
|
+
const Y = we(), E = G || Y, x = `${E}-listbox`, Z = ye(), O = M === F.Small, I = C !== void 0, [ee, te] = h(
|
|
40
|
+
K ?? []
|
|
41
|
+
), a = I ? C : ee, d = a.length > 0, p = !v && !w, [s, L] = h(""), [oe, u] = h(!1), [ae, l] = h(0), T = !s.trim(), n = ve(
|
|
42
|
+
() => Ne(
|
|
43
|
+
g,
|
|
43
44
|
s,
|
|
44
45
|
a,
|
|
45
|
-
|
|
46
|
+
// The list opened on focus is meant to show every choice.
|
|
47
|
+
m && T ? g.length : D
|
|
46
48
|
),
|
|
47
|
-
[s,
|
|
48
|
-
),
|
|
49
|
-
open:
|
|
49
|
+
[s, T, D, m, g, a]
|
|
50
|
+
), r = oe && p && n.length > 0, i = Math.min(ae, n.length - 1), U = r && i >= 0, z = (e) => `${x}-option-${e}`, { refs: B, floatingStyles: re } = pe({
|
|
51
|
+
open: r,
|
|
50
52
|
placement: "bottom-start",
|
|
51
|
-
whileElementsMounted:
|
|
53
|
+
whileElementsMounted: fe,
|
|
52
54
|
middleware: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
padding:
|
|
57
|
-
apply({ rects: e, availableHeight: t, elements:
|
|
58
|
-
|
|
55
|
+
de(y),
|
|
56
|
+
ue({ padding: y }),
|
|
57
|
+
he({
|
|
58
|
+
padding: y,
|
|
59
|
+
apply({ rects: e, availableHeight: t, elements: o }) {
|
|
60
|
+
o.floating.style.width = `${Math.round(e.reference.width)}px`, o.floating.style.maxHeight = `${Math.floor(t)}px`;
|
|
59
61
|
}
|
|
60
62
|
})
|
|
61
63
|
]
|
|
62
|
-
}),
|
|
64
|
+
}), S = xe(
|
|
63
65
|
(e) => {
|
|
64
|
-
|
|
66
|
+
I || te(e), k?.(e);
|
|
65
67
|
},
|
|
66
|
-
[
|
|
67
|
-
),
|
|
68
|
-
|
|
69
|
-
},
|
|
68
|
+
[I, k]
|
|
69
|
+
), b = () => {
|
|
70
|
+
u(!1), l(0);
|
|
71
|
+
}, _ = () => {
|
|
72
|
+
!m || !p || (u(!0), l(T ? -1 : 0));
|
|
73
|
+
}, $ = (e) => {
|
|
70
74
|
const t = e.trim();
|
|
71
|
-
t && !a.includes(t) &&
|
|
72
|
-
},
|
|
73
|
-
const t = e ?? "";
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
if (
|
|
75
|
+
t && !a.includes(t) && S([...a, t]), L(""), m ? l(-1) : b();
|
|
76
|
+
}, le = (e) => S(a.filter((t) => t !== e)), se = (e) => {
|
|
77
|
+
const t = e ?? "", o = !!t.trim();
|
|
78
|
+
L(t), u(o || m), l(o ? 0 : -1);
|
|
79
|
+
}, ne = (e) => {
|
|
80
|
+
if (p)
|
|
77
81
|
switch (e.key) {
|
|
78
82
|
case "ArrowDown":
|
|
79
83
|
case "ArrowUp": {
|
|
80
|
-
if (e.preventDefault(),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
);
|
|
84
|
+
if (e.preventDefault(), !r) {
|
|
85
|
+
u(!0), l(0);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const t = e.key === "ArrowDown" ? 1 : -1, o = i < 0 ? Math.min(-t, 0) : i;
|
|
89
|
+
l((o + t + n.length) % n.length);
|
|
85
90
|
return;
|
|
86
91
|
}
|
|
87
92
|
case "Enter":
|
|
88
93
|
case ",":
|
|
89
|
-
e.preventDefault(),
|
|
94
|
+
e.preventDefault(), $(U ? n[i].value : s);
|
|
90
95
|
return;
|
|
91
96
|
case "Escape":
|
|
92
|
-
|
|
97
|
+
r && e.preventDefault(), b();
|
|
93
98
|
return;
|
|
94
99
|
case "Backspace":
|
|
95
|
-
!s &&
|
|
100
|
+
!s && d && (e.preventDefault(), S(a.slice(0, -1)));
|
|
96
101
|
return;
|
|
97
102
|
}
|
|
98
|
-
},
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
103
|
+
}, ie = (e) => e.preventDefault();
|
|
104
|
+
return /* @__PURE__ */ ce(me, { children: [
|
|
105
|
+
/* @__PURE__ */ c(
|
|
106
|
+
Ie,
|
|
102
107
|
{
|
|
103
|
-
id:
|
|
108
|
+
id: E,
|
|
104
109
|
role: "combobox",
|
|
105
110
|
"aria-autocomplete": "list",
|
|
106
|
-
"aria-expanded":
|
|
107
|
-
"aria-controls":
|
|
108
|
-
"aria-activedescendant":
|
|
109
|
-
"aria-invalid":
|
|
110
|
-
"aria-label":
|
|
111
|
-
size:
|
|
112
|
-
labelProps:
|
|
113
|
-
caption:
|
|
114
|
-
error:
|
|
115
|
-
invalid:
|
|
116
|
-
disabled:
|
|
117
|
-
readOnly:
|
|
111
|
+
"aria-expanded": r,
|
|
112
|
+
"aria-controls": x,
|
|
113
|
+
"aria-activedescendant": U ? z(i) : void 0,
|
|
114
|
+
"aria-invalid": A || void 0,
|
|
115
|
+
"aria-label": P,
|
|
116
|
+
size: M,
|
|
117
|
+
labelProps: R,
|
|
118
|
+
caption: H,
|
|
119
|
+
error: V,
|
|
120
|
+
invalid: A,
|
|
121
|
+
disabled: w,
|
|
122
|
+
readOnly: v,
|
|
118
123
|
value: s,
|
|
119
|
-
placeholder:
|
|
120
|
-
wrapperRef:
|
|
121
|
-
onChange:
|
|
122
|
-
onKeyDown:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
placeholder: d ? void 0 : j,
|
|
125
|
+
wrapperRef: B.setReference,
|
|
126
|
+
onChange: se,
|
|
127
|
+
onKeyDown: ne,
|
|
128
|
+
onFocus: _,
|
|
129
|
+
onClick: _,
|
|
130
|
+
onBlur: b,
|
|
131
|
+
containerClassName: f("w-full", q),
|
|
132
|
+
wrapperClassName: f(
|
|
133
|
+
d && [
|
|
127
134
|
"!h-auto flex-wrap gap-1 py-2",
|
|
128
|
-
|
|
135
|
+
O ? "min-h-[24px]" : "min-h-[40px]"
|
|
129
136
|
],
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
J,
|
|
138
|
+
Me.autocompleteTagInput
|
|
132
139
|
),
|
|
133
|
-
className:
|
|
140
|
+
className: f(
|
|
134
141
|
"w-auto min-w-[100px] flex-1",
|
|
135
|
-
|
|
142
|
+
v && "cursor-default"
|
|
136
143
|
),
|
|
137
|
-
children:
|
|
144
|
+
children: d && /* @__PURE__ */ c(
|
|
138
145
|
"span",
|
|
139
146
|
{
|
|
140
147
|
role: "list",
|
|
141
|
-
"aria-label":
|
|
148
|
+
"aria-label": N,
|
|
142
149
|
className: "flex min-w-0 flex-wrap items-center gap-1",
|
|
143
|
-
children: a.map((e) => /* @__PURE__ */
|
|
144
|
-
|
|
150
|
+
children: a.map((e) => /* @__PURE__ */ c(
|
|
151
|
+
be,
|
|
145
152
|
{
|
|
146
153
|
role: "listitem",
|
|
147
154
|
label: e,
|
|
148
|
-
className:
|
|
149
|
-
|
|
155
|
+
className: f(
|
|
156
|
+
Se,
|
|
150
157
|
"min-w-0",
|
|
151
|
-
|
|
158
|
+
Q
|
|
152
159
|
),
|
|
153
|
-
disabled:
|
|
154
|
-
closable:
|
|
155
|
-
removeLabel:
|
|
156
|
-
onRemove:
|
|
160
|
+
disabled: w,
|
|
161
|
+
closable: p,
|
|
162
|
+
removeLabel: X?.(e),
|
|
163
|
+
onRemove: p ? () => le(e) : void 0
|
|
157
164
|
},
|
|
158
165
|
e
|
|
159
166
|
))
|
|
@@ -161,39 +168,39 @@ const Ce = 5, Re = ({
|
|
|
161
168
|
)
|
|
162
169
|
}
|
|
163
170
|
),
|
|
164
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ c(ge, { children: /* @__PURE__ */ c(
|
|
165
172
|
"div",
|
|
166
173
|
{
|
|
167
|
-
ref:
|
|
168
|
-
id:
|
|
174
|
+
ref: B.setFloating,
|
|
175
|
+
id: x,
|
|
169
176
|
role: "listbox",
|
|
170
|
-
"aria-label":
|
|
171
|
-
hidden: !
|
|
172
|
-
style:
|
|
173
|
-
className:
|
|
177
|
+
"aria-label": N,
|
|
178
|
+
hidden: !r,
|
|
179
|
+
style: re,
|
|
180
|
+
className: f(
|
|
174
181
|
"z-floating overflow-y-auto",
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
!
|
|
178
|
-
|
|
179
|
-
|
|
182
|
+
De,
|
|
183
|
+
Ce,
|
|
184
|
+
!r && "hidden",
|
|
185
|
+
Z,
|
|
186
|
+
W
|
|
180
187
|
),
|
|
181
|
-
children:
|
|
182
|
-
const
|
|
183
|
-
return /* @__PURE__ */
|
|
184
|
-
|
|
188
|
+
children: r && n.map((e, t) => {
|
|
189
|
+
const o = t === i;
|
|
190
|
+
return /* @__PURE__ */ c(
|
|
191
|
+
Te,
|
|
185
192
|
{
|
|
186
|
-
id:
|
|
193
|
+
id: z(t),
|
|
187
194
|
role: "option",
|
|
188
|
-
"aria-selected":
|
|
195
|
+
"aria-selected": o,
|
|
189
196
|
tabIndex: -1,
|
|
190
197
|
label: e.label,
|
|
191
198
|
description: e.description,
|
|
192
|
-
mark:
|
|
193
|
-
selected:
|
|
194
|
-
onMouseDown:
|
|
195
|
-
onMouseEnter: () =>
|
|
196
|
-
onClick: () =>
|
|
199
|
+
mark: Ae.Tint,
|
|
200
|
+
selected: o,
|
|
201
|
+
onMouseDown: ie,
|
|
202
|
+
onMouseEnter: () => l(t),
|
|
203
|
+
onClick: () => $(e.value)
|
|
197
204
|
},
|
|
198
205
|
e.value
|
|
199
206
|
);
|
|
@@ -203,5 +210,5 @@ const Ce = 5, Re = ({
|
|
|
203
210
|
] });
|
|
204
211
|
};
|
|
205
212
|
export {
|
|
206
|
-
|
|
213
|
+
Pe as AutocompleteTagInput
|
|
207
214
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const a = "dial-kit-grid", t = "dial-kit-grid-with-selection", d = "dial-kit-grid-without-header-borders", i = "dial-kit-grid-row-select", l = "dial-kit-grid-header-select", n = "dial-kit-grid-selection-visible", c = "dial-kit-grid-align-right", C = 40, o = "0.5px solid var(--stroke-tertiary, #E0E6F0)",
|
|
1
|
+
const a = "dial-kit-grid", t = "dial-kit-grid-with-selection", d = "dial-kit-grid-without-header-borders", i = "dial-kit-grid-row-select", l = "dial-kit-grid-header-select", n = "dial-kit-grid-selection-visible", c = "dial-kit-grid-align-right", C = 40, o = "0.5px solid var(--stroke-tertiary, #E0E6F0)", s = {
|
|
2
2
|
accentColor: "var(--bg-control-accent, #1D4ED8)",
|
|
3
3
|
backgroundColor: "var(--bg-layer-raised, #FCFCFC)",
|
|
4
4
|
oddRowBackgroundColor: "var(--bg-layer-sunken, #EEF1F7)",
|
|
5
|
-
selectedRowBackgroundColor: "var(--bg-control-accent-alpha, #
|
|
6
|
-
rowHoverColor: "var(--bg-control-accent-alpha-hover, #
|
|
5
|
+
selectedRowBackgroundColor: "var(--bg-control-accent-alpha-active-subtle, #2764D914)",
|
|
6
|
+
rowHoverColor: "var(--bg-control-accent-alpha-hover-subtle, #2764D90A)",
|
|
7
7
|
borderColor: "var(--stroke-tertiary, #E0E6F0)",
|
|
8
8
|
// Dividers inside the table sit on the thin stroke (0.5px) rather than the
|
|
9
9
|
// 1px main stroke that controls and standalone dividers use, so a dense grid
|
|
@@ -13,9 +13,16 @@ const a = "dial-kit-grid", t = "dial-kit-grid-with-selection", d = "dial-kit-gri
|
|
|
13
13
|
// by the theme: those frame the table and separate its regions rather than
|
|
14
14
|
// dividing rows and columns.
|
|
15
15
|
rowBorder: o,
|
|
16
|
-
|
|
16
|
+
// Off: ag-Grid draws this one both under the header and between the title
|
|
17
|
+
// row and the filter row, and the design has no line between those two. The
|
|
18
|
+
// line under the header is drawn at 1px in `styles/grid.scss`.
|
|
19
|
+
headerRowBorder: !1,
|
|
17
20
|
headerColumnBorder: o,
|
|
21
|
+
// The design's header divider is a short 12px mark centred in the cell, not
|
|
22
|
+
// the 20px (half the row) ag-Grid draws by default.
|
|
23
|
+
headerColumnBorderHeight: 12,
|
|
18
24
|
chromeBackgroundColor: "var(--bg-layer-base, #F5F7FA)",
|
|
25
|
+
headerBackgroundColor: "var(--bg-layer-raised, #FCFCFC)",
|
|
19
26
|
foregroundColor: "var(--text-primary, #161B2D)",
|
|
20
27
|
headerTextColor: "var(--text-secondary, #57647A)",
|
|
21
28
|
// 1.0 asked the browser for dark native widgets while painting a light
|
|
@@ -27,6 +34,8 @@ const a = "dial-kit-grid", t = "dial-kit-grid-with-selection", d = "dial-kit-gri
|
|
|
27
34
|
fontFamily: "var(--theme-font, var(--font-inter))",
|
|
28
35
|
spacing: 4,
|
|
29
36
|
borderRadius: 4,
|
|
37
|
+
// Search fields in the header and filter popups: `rounded-lg`.
|
|
38
|
+
inputBorderRadius: 8,
|
|
30
39
|
wrapperBorderRadius: 8
|
|
31
40
|
};
|
|
32
41
|
var e = /* @__PURE__ */ ((r) => (r.API = "api", r.ROW_DATA_CHANGED = "rowDataChanged", r.CHECKBOX_SELECTED = "checkboxSelected", r))(e || {});
|
|
@@ -36,7 +45,7 @@ export {
|
|
|
36
45
|
a as GRID_ROOT_CLASS,
|
|
37
46
|
i as GRID_ROW_SELECT_CLASS,
|
|
38
47
|
n as GRID_SELECTION_VISIBLE_CLASS,
|
|
39
|
-
|
|
48
|
+
s as GRID_THEME_PARAMS,
|
|
40
49
|
d as GRID_WITHOUT_HEADER_BORDERS_CLASS,
|
|
41
50
|
t as GRID_WITH_SELECTION_CLASS,
|
|
42
51
|
C as ROW_HEIGHT,
|