@epam/ai-dial-ui-kit 0.15.0-dev.51 → 0.15.0-dev.52
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/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/Slider/Slider.js +115 -86
- package/dist/components/New/Slider/utils.js +14 -6
- package/dist/components-manifest.json +23 -3
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/editor-BH6_A1k2.cjs +1 -0
- package/dist/editors.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/lazy-DMVYJhUR.cjs +1 -0
- package/dist/src/components/New/AutocompleteTagInput/AutocompleteTagInput.d.ts +11 -0
- 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,54 +1,66 @@
|
|
|
1
|
-
import { jsxs as n, jsx as e, Fragment as
|
|
2
|
-
import { useId as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as j } from "react/jsx-runtime";
|
|
2
|
+
import { useId as Y, useState as P, useCallback as b } from "react";
|
|
3
|
+
import { ElementSize as ee } from "../../../types/size.js";
|
|
4
|
+
import { mergeClasses as s } from "../../../utils/merge-classes.js";
|
|
4
5
|
import { resolveAccessibleName as D } from "../../../utils/accessible-name.js";
|
|
5
|
-
import { ErrorText as
|
|
6
|
-
import { Label as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
import { ErrorText as te, CaptionText as ne } from "../CaptionText/CaptionText.js";
|
|
7
|
+
import { Label as re } from "../Label/Label.js";
|
|
8
|
+
import { NumberInput as le } from "../NumberInput/NumberInput.js";
|
|
9
|
+
import { getTickPercents as ae, getStepPrecision as ie, snapToStep as se } from "./utils.js";
|
|
10
|
+
const oe = 12, L = (r) => `calc(${r}% + ${(0.5 - r / 100) * oe}px)`, ce = (r, t) => r && t ? "grid-cols-[auto_minmax(0,1fr)_auto]" : r ? "grid-cols-[auto_minmax(0,1fr)]" : t ? "grid-cols-[minmax(0,1fr)_auto]" : "grid-cols-[minmax(0,1fr)]", Ne = ({
|
|
11
|
+
id: r,
|
|
12
|
+
value: t,
|
|
13
|
+
min: o = 0,
|
|
14
|
+
max: m = 1,
|
|
15
|
+
step: c = 0.1,
|
|
16
|
+
disabled: l,
|
|
17
|
+
labelProps: d,
|
|
18
|
+
labels: a,
|
|
19
|
+
formatValue: p,
|
|
20
|
+
showValue: y = !1,
|
|
21
|
+
showTooltip: A = !1,
|
|
22
|
+
showTicks: G = !1,
|
|
23
|
+
leftContent: I,
|
|
24
|
+
rightContent: S,
|
|
25
|
+
showValueInput: w = !1,
|
|
26
|
+
valueInputAriaLabel: H,
|
|
27
|
+
caption: C,
|
|
28
|
+
error: u,
|
|
29
|
+
onChange: f,
|
|
30
|
+
containerClassName: U,
|
|
31
|
+
trackClassName: V,
|
|
32
|
+
fillClassName: Z,
|
|
33
|
+
className: q,
|
|
34
|
+
...T
|
|
31
35
|
}) => {
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
|
|
36
|
+
const J = Y(), h = r ?? J, F = C && !u ? `${h}-caption` : void 0, _ = u ? `${h}-error` : void 0, x = m - o, K = x > 0 ? Math.min(100, Math.max(0, (t - o) / x * 100)) : 0, z = L(K), O = G && !l ? ae(x, c) : [], B = A && !l, g = I != null, M = w || S != null, $ = ie(c), [Q, k] = P(null), v = p ? p(t) : t.toFixed($), R = b(
|
|
37
|
+
(i) => {
|
|
38
|
+
f?.(Number(i.target.value));
|
|
35
39
|
},
|
|
36
|
-
[
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
[f]
|
|
41
|
+
), W = b(
|
|
42
|
+
(i) => {
|
|
43
|
+
const N = i == null ? "" : String(i);
|
|
44
|
+
k(N);
|
|
45
|
+
const E = Number(N);
|
|
46
|
+
N !== "" && Number.isFinite(E) && f?.(se(E, o, m, c));
|
|
47
|
+
},
|
|
48
|
+
[m, o, f, c]
|
|
49
|
+
), X = b(() => k(null), []);
|
|
50
|
+
return /* @__PURE__ */ n("div", { className: s("flex flex-col gap-2", U), children: [
|
|
51
|
+
(d || y) && /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
52
|
+
d && /* @__PURE__ */ e(re, { ...d, htmlFor: h }),
|
|
53
|
+
y && // The input already reports its value to assistive tech, so this is
|
|
42
54
|
// a visual echo rather than a second announcement.
|
|
43
55
|
/* @__PURE__ */ e(
|
|
44
56
|
"span",
|
|
45
57
|
{
|
|
46
58
|
"aria-hidden": "true",
|
|
47
|
-
className:
|
|
59
|
+
className: s(
|
|
48
60
|
"dial-small-text ml-auto",
|
|
49
|
-
|
|
61
|
+
l ? "text-control-disable-primary" : "text-primary"
|
|
50
62
|
),
|
|
51
|
-
children:
|
|
63
|
+
children: v
|
|
52
64
|
}
|
|
53
65
|
)
|
|
54
66
|
] }),
|
|
@@ -56,55 +68,55 @@ const R = 12, W = (t) => (t.toString().split(".")[1] ?? "").length, F = (t) => `
|
|
|
56
68
|
/* @__PURE__ */ n(
|
|
57
69
|
"div",
|
|
58
70
|
{
|
|
59
|
-
className:
|
|
71
|
+
className: s(
|
|
60
72
|
"grid items-center gap-x-3 gap-y-1",
|
|
61
|
-
|
|
73
|
+
ce(g, M),
|
|
62
74
|
// Room for the value bubble, which hangs above the track row.
|
|
63
|
-
|
|
75
|
+
B && "mt-7"
|
|
64
76
|
),
|
|
65
77
|
children: [
|
|
66
|
-
|
|
78
|
+
g && /* @__PURE__ */ e("div", { className: "flex items-center", children: I }),
|
|
67
79
|
/* @__PURE__ */ n("div", { className: "relative flex h-6 items-center", children: [
|
|
68
80
|
/* @__PURE__ */ e(
|
|
69
81
|
"div",
|
|
70
82
|
{
|
|
71
|
-
className:
|
|
83
|
+
className: s(
|
|
72
84
|
"pointer-events-none absolute inset-x-0 h-1 rounded-full",
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
l ? "bg-control-disable-primary" : "bg-control-accent-muted",
|
|
86
|
+
V
|
|
75
87
|
)
|
|
76
88
|
}
|
|
77
89
|
),
|
|
78
|
-
|
|
90
|
+
O.map((i) => /* @__PURE__ */ e(
|
|
79
91
|
"span",
|
|
80
92
|
{
|
|
81
93
|
"aria-hidden": "true",
|
|
82
|
-
className: "pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full
|
|
83
|
-
style: { left:
|
|
94
|
+
className: "pointer-events-none absolute size-0.5 -translate-x-1/2 rounded-full border border-accent-focus",
|
|
95
|
+
style: { left: L(i) }
|
|
84
96
|
},
|
|
85
|
-
|
|
97
|
+
i
|
|
86
98
|
)),
|
|
87
99
|
/* @__PURE__ */ e(
|
|
88
100
|
"div",
|
|
89
101
|
{
|
|
90
|
-
className:
|
|
102
|
+
className: s(
|
|
91
103
|
"pointer-events-none absolute left-0 h-1 rounded-full",
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
l ? "bg-control-disable-secondary" : "bg-control-accent",
|
|
105
|
+
Z
|
|
94
106
|
),
|
|
95
|
-
style: { width:
|
|
107
|
+
style: { width: z }
|
|
96
108
|
}
|
|
97
109
|
),
|
|
98
|
-
|
|
110
|
+
B && // A visual echo like `showValue`: the input already announces
|
|
99
111
|
// its value, so the bubble stays out of the accessibility tree.
|
|
100
112
|
/* @__PURE__ */ n(
|
|
101
113
|
"span",
|
|
102
114
|
{
|
|
103
115
|
"aria-hidden": "true",
|
|
104
116
|
className: "pointer-events-none absolute bottom-full mb-0.5 flex -translate-x-1/2 flex-col items-center",
|
|
105
|
-
style: { left:
|
|
117
|
+
style: { left: z },
|
|
106
118
|
children: [
|
|
107
|
-
/* @__PURE__ */ e("span", { className: "whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs", children:
|
|
119
|
+
/* @__PURE__ */ e("span", { className: "whitespace-nowrap rounded-md bg-control-inverted px-2 py-0.5 dial-small-text text-control-inverted shadow-xs", children: v }),
|
|
108
120
|
/* @__PURE__ */ e(
|
|
109
121
|
"svg",
|
|
110
122
|
{
|
|
@@ -121,53 +133,70 @@ const R = 12, W = (t) => (t.toString().split(".")[1] ?? "").length, F = (t) => `
|
|
|
121
133
|
/* @__PURE__ */ e(
|
|
122
134
|
"input",
|
|
123
135
|
{
|
|
124
|
-
...
|
|
136
|
+
...T,
|
|
125
137
|
type: "range",
|
|
126
|
-
id:
|
|
127
|
-
value:
|
|
128
|
-
min:
|
|
129
|
-
max:
|
|
130
|
-
step:
|
|
131
|
-
disabled:
|
|
132
|
-
onChange:
|
|
138
|
+
id: h,
|
|
139
|
+
value: t,
|
|
140
|
+
min: o,
|
|
141
|
+
max: m,
|
|
142
|
+
step: c,
|
|
143
|
+
disabled: l,
|
|
144
|
+
onChange: R,
|
|
133
145
|
"aria-label": D(
|
|
134
|
-
typeof
|
|
146
|
+
typeof d?.label != "string" ? T["aria-label"] : void 0
|
|
135
147
|
),
|
|
136
|
-
"aria-valuetext":
|
|
137
|
-
"aria-describedby":
|
|
138
|
-
className:
|
|
148
|
+
"aria-valuetext": p ? v : void 0,
|
|
149
|
+
"aria-describedby": _ ?? F,
|
|
150
|
+
className: s(
|
|
139
151
|
"dial-kit-slider absolute inset-0 h-full w-full",
|
|
140
|
-
|
|
152
|
+
q
|
|
141
153
|
)
|
|
142
154
|
}
|
|
143
155
|
)
|
|
144
156
|
] }),
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
M && /* @__PURE__ */ e("div", { className: "flex items-center", children: w ? /* @__PURE__ */ e(
|
|
158
|
+
le,
|
|
159
|
+
{
|
|
160
|
+
"aria-label": D(
|
|
161
|
+
H ?? (typeof d?.label == "string" ? d.label : void 0)
|
|
162
|
+
),
|
|
163
|
+
value: Q ?? t.toFixed($),
|
|
164
|
+
min: o,
|
|
165
|
+
max: m,
|
|
166
|
+
step: c,
|
|
167
|
+
disabled: l,
|
|
168
|
+
size: ee.Small,
|
|
169
|
+
containerClassName: "w-12",
|
|
170
|
+
className: "text-center",
|
|
171
|
+
onChange: W,
|
|
172
|
+
onBlur: X
|
|
173
|
+
}
|
|
174
|
+
) : S }),
|
|
175
|
+
a && /* @__PURE__ */ e(
|
|
147
176
|
"div",
|
|
148
177
|
{
|
|
149
|
-
className:
|
|
178
|
+
className: s(
|
|
150
179
|
"dial-tiny-text flex text-secondary",
|
|
151
|
-
|
|
180
|
+
g && "col-start-2"
|
|
152
181
|
),
|
|
153
|
-
children:
|
|
154
|
-
/* @__PURE__ */ e("span", { children:
|
|
155
|
-
/* @__PURE__ */ e("span", { className: "flex-1 text-center", children:
|
|
156
|
-
/* @__PURE__ */ e("span", { children:
|
|
157
|
-
] }) : /* @__PURE__ */ n(
|
|
158
|
-
/* @__PURE__ */ e("span", { children:
|
|
159
|
-
/* @__PURE__ */ e("span", { className: "ml-auto", children:
|
|
182
|
+
children: a.length === 3 ? /* @__PURE__ */ n(j, { children: [
|
|
183
|
+
/* @__PURE__ */ e("span", { children: a[0] }),
|
|
184
|
+
/* @__PURE__ */ e("span", { className: "flex-1 text-center", children: a[1] }),
|
|
185
|
+
/* @__PURE__ */ e("span", { children: a[2] })
|
|
186
|
+
] }) : /* @__PURE__ */ n(j, { children: [
|
|
187
|
+
/* @__PURE__ */ e("span", { children: a[0] }),
|
|
188
|
+
/* @__PURE__ */ e("span", { className: "ml-auto", children: a[1] })
|
|
160
189
|
] })
|
|
161
190
|
}
|
|
162
191
|
)
|
|
163
192
|
]
|
|
164
193
|
}
|
|
165
194
|
),
|
|
166
|
-
/* @__PURE__ */ e(
|
|
167
|
-
!
|
|
195
|
+
/* @__PURE__ */ e(te, { id: _, text: u }),
|
|
196
|
+
!u && /* @__PURE__ */ e(ne, { id: F, text: C })
|
|
168
197
|
] })
|
|
169
198
|
] });
|
|
170
199
|
};
|
|
171
200
|
export {
|
|
172
|
-
|
|
201
|
+
Ne as Slider
|
|
173
202
|
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (
|
|
1
|
+
const u = (t, n) => {
|
|
2
|
+
if (t <= 0 || n <= 0)
|
|
3
3
|
return [];
|
|
4
|
-
const
|
|
4
|
+
const r = Math.floor(t / n + 1e-9);
|
|
5
5
|
return Array.from(
|
|
6
|
-
{ length:
|
|
7
|
-
(
|
|
6
|
+
{ length: r },
|
|
7
|
+
(o, e) => (e + 1) * n / t * 100
|
|
8
8
|
);
|
|
9
|
+
}, s = (t) => (t.toString().split(".")[1] ?? "").length, a = (t, n, r, o) => {
|
|
10
|
+
const e = Math.min(r, Math.max(n, t));
|
|
11
|
+
if (o <= 0)
|
|
12
|
+
return e;
|
|
13
|
+
const c = Math.round(Number(((e - n) / o).toFixed(9))), i = n + c * o;
|
|
14
|
+
return Number(Math.min(r, i).toFixed(s(o)));
|
|
9
15
|
};
|
|
10
16
|
export {
|
|
11
|
-
|
|
17
|
+
s as getStepPrecision,
|
|
18
|
+
u as getTickPercents,
|
|
19
|
+
a as snapToStep
|
|
12
20
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.15.0-dev.
|
|
3
|
-
"generatedAt": "2026-10-08T09:
|
|
2
|
+
"version": "0.15.0-dev.52",
|
|
3
|
+
"generatedAt": "2026-10-08T09:40:33.410Z",
|
|
4
4
|
"kit": {
|
|
5
5
|
"name": "@epam/ai-dial-ui-kit",
|
|
6
6
|
"description": "A modern UI kit for building AI DIAL interfaces with React",
|
|
@@ -4159,7 +4159,7 @@
|
|
|
4159
4159
|
"name": "AutocompleteTagInput",
|
|
4160
4160
|
"category": "Components_2_0",
|
|
4161
4161
|
"generation": "2.0",
|
|
4162
|
-
"description": "A tag input that suggests values while typing and also accepts its own.\naliases: Autocomplete|Combobox|TagAutocomplete|ChipAutocomplete|MultiValueAutocomplete\nDesign system 2.0\n\nTyping opens a list of the `suggestions` that match the text (by label, value\nor description) and are not already tags, capped at `maxSuggestions`, with the\nfirst one highlighted. Enter or comma adds the highlighted suggestion, or the\ntyped text when nothing matches; clicking a suggestion adds it too. The arrow\nkeys move the highlight and wrap at the ends; Escape and leaving the field\nclose the list without adding what was typed. Backspace on an empty input\nremoves the last tag, and duplicate tags are ignored. Entered text is not\nvalidated — say what format is expected through `caption`.\n\nReach for when there is nothing to suggest, and for a\nmultiple `Select` when only listed values are allowed.\n\nThe input follows the ARIA combobox pattern: it keeps focus while the list is\nopen, and the highlighted suggestion is announced through\n`aria-activedescendant`. The tags are a list named by `tagListLabel`, and each\nremove button is named after its tag.\n\nWorks controlled (`value` + `onChange`) or uncontrolled (`defaultValue`).",
|
|
4162
|
+
"description": "A tag input that suggests values while typing and also accepts its own.\naliases: Autocomplete|Combobox|TagAutocomplete|ChipAutocomplete|MultiValueAutocomplete\nDesign system 2.0\n\nTyping opens a list of the `suggestions` that match the text (by label, value\nor description) and are not already tags, capped at `maxSuggestions`, with the\nfirst one highlighted. Enter or comma adds the highlighted suggestion, or the\ntyped text when nothing matches; clicking a suggestion adds it too. The arrow\nkeys move the highlight and wrap at the ends; Escape and leaving the field\nclose the list without adding what was typed. Backspace on an empty input\nremoves the last tag, and duplicate tags are ignored. Entered text is not\nvalidated — say what format is expected through `caption`.\n\nWith `openOnFocus`, focusing or clicking the input opens the list of every\nsuggestion that is not yet a tag, uncapped by `maxSuggestions`, with nothing\nhighlighted, so Enter adds nothing the user did not choose. Picking one keeps\nthe list open for the next pick; typing filters it as usual.\n\nReach for when there is nothing to suggest, and for a\nmultiple `Select` when only listed values are allowed.\n\nThe input follows the ARIA combobox pattern: it keeps focus while the list is\nopen, and the highlighted suggestion is announced through\n`aria-activedescendant`. The tags are a list named by `tagListLabel`, and each\nremove button is named after its tag.\n\nWorks controlled (`value` + `onChange`) or uncontrolled (`defaultValue`).",
|
|
4163
4163
|
"props": [
|
|
4164
4164
|
{
|
|
4165
4165
|
"name": "id",
|
|
@@ -4192,6 +4192,13 @@
|
|
|
4192
4192
|
"defaultValue": "DEFAULT_MAX_SUGGESTIONS",
|
|
4193
4193
|
"description": "How many matching suggestions the list shows at most."
|
|
4194
4194
|
},
|
|
4195
|
+
{
|
|
4196
|
+
"name": "openOnFocus",
|
|
4197
|
+
"type": "boolean",
|
|
4198
|
+
"required": false,
|
|
4199
|
+
"defaultValue": "false",
|
|
4200
|
+
"description": "Opens the full list of suggestions that are not yet tags on focus or click, and keeps it open after a pick."
|
|
4201
|
+
},
|
|
4195
4202
|
{
|
|
4196
4203
|
"name": "size",
|
|
4197
4204
|
"type": "ElementSize",
|
|
@@ -4415,6 +4422,19 @@
|
|
|
4415
4422
|
"required": false,
|
|
4416
4423
|
"description": "Content after the track, vertically centred on it"
|
|
4417
4424
|
},
|
|
4425
|
+
{
|
|
4426
|
+
"name": "showValueInput",
|
|
4427
|
+
"type": "boolean",
|
|
4428
|
+
"required": false,
|
|
4429
|
+
"defaultValue": "false",
|
|
4430
|
+
"description": "Renders a compact (24px), synced `NumberInput` after the track (clamped to `min`/`max`, snapped to `step`); replaces `rightContent`"
|
|
4431
|
+
},
|
|
4432
|
+
{
|
|
4433
|
+
"name": "valueInputAriaLabel",
|
|
4434
|
+
"type": "string",
|
|
4435
|
+
"required": false,
|
|
4436
|
+
"description": "Accessible name of the value input; defaults to a string `labelProps.label`"
|
|
4437
|
+
},
|
|
4418
4438
|
{
|
|
4419
4439
|
"name": "caption",
|
|
4420
4440
|
"type": "string",
|