@epam/ai-dial-ui-kit 0.16.0-dev.5 → 0.16.0-dev.6
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 +2 -2
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/components/New/Avatar/Avatar.js +18 -17
- package/dist/components-manifest.json +65 -3
- package/dist/dial-ui-kit.cjs +2 -2
- package/dist/dial-ui-kit.js +96 -94
- package/dist/node_modules/mime-types/index.js +1 -1
- package/dist/node_modules/react-dnd/dist/hooks/useCollector.js +1 -1
- package/dist/src/components/New/Avatar/Avatar.d.ts +9 -3
- package/dist/src/index.d.ts +3 -2
- package/dist/src/types/avatar.d.ts +9 -0
- package/dist/src/utils/avatar.d.ts +2 -1
- package/dist/types/avatar.js +3 -2
- package/dist/utils/avatar.js +41 -18
- package/package.json +1 -1
package/dist/CHANGELOG.md
CHANGED
|
@@ -13,12 +13,12 @@ Versions match the git tags on the `development` branch.
|
|
|
13
13
|
|
|
14
14
|
- **`Popup` (2.0) — footer buttons split the row evenly on mobile** — below the `mobile` breakpoint (768px), where the popup fills the screen, the trailing `mainButtons` group now spans the footer and each of its buttons takes an equal share, so a Cancel/Confirm pair renders 50/50 and a single button fills the row. `additionalButtons` in the trailing group stretch with it; with `additionalButtonsOnLeft` they keep their natural width. Desktop is unchanged, a caller's `className` on a button still merges on top, and a custom `footer` node is not touched. The props are unchanged. Reported on the mobile dialogs in ai-dial-chat.
|
|
15
15
|
|
|
16
|
+
- **`Avatar` (2.0) — `color`, with `AVATAR_PALETTE`, `AvatarColor` and `AvatarColorClasses` exported** — the colour pair was derived from `name` alone, so a host that needed every avatar of one kind to share a colour — every row of one entity type in its brand pairing — could only fight the component: a root `className` could at best force the background with `!important` arbitrary values, and the initials' foreground sits on an inner element no root class reaches, where the only prop landing there (`textClassName`) ties with the kit's own class at equal specificity and the winner is decided by stylesheet order. `color` takes an `AvatarColorClasses` pair and replaces both halves of the name-derived pick, background and initials foreground, applied with the component's own class cascade. `AVATAR_PALETTE` is exported as a record keyed by the new `AvatarColor` enum (one key per entry, named after its background token), so a host pins a colour directly — `color={AVATAR_PALETTE[AvatarColor.Violet1]}` — with no `.find` on class-name substrings and no new colour vocabulary; the `AvatarColorClasses` pair type is exported with it. A name that is a locale string no longer reshuffles the colour per translation. Without `color` the deterministic pick is unchanged, and a missing or broken image still falls back to the initials — on the overridden pair. Additive. Requested in [#928](https://github.com/epam/ai-dial-ui-kit/issues/928).
|
|
17
|
+
|
|
16
18
|
### Fixed
|
|
17
19
|
|
|
18
20
|
- **`MarkdownEditor` (2.0) — toolbar no longer overflows on narrow cards** — on a phone-width card the formatting group did not wrap, so its last buttons ran past the card edge and the edit/preview/fullscreen group dropped onto a second line at the start. The formatting group now wraps inside the card and the mode group stays at the inline end. Wide toolbars are unchanged ([ai-dial-chat#9389](https://github.com/epam/ai-dial-chat/issues/9389)).
|
|
19
21
|
|
|
20
|
-
---
|
|
21
|
-
|
|
22
22
|
## [0.15.0]
|
|
23
23
|
|
|
24
24
|
### Breaking Changes
|
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { DIAL_KIT_CLASS as
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
import { DIAL_KIT_CLASS as w } from "../../../constants/public-class-names.js";
|
|
4
4
|
import { AvatarShape as d } from "../../../types/avatar.js";
|
|
5
|
-
import { pickAvatarColor as
|
|
5
|
+
import { pickAvatarColor as I, extractInitials as N } from "../../../utils/avatar.js";
|
|
6
6
|
import { mergeClasses as e } from "../../../utils/merge-classes.js";
|
|
7
|
-
const
|
|
7
|
+
const j = {
|
|
8
8
|
[d.Circle]: "rounded-full",
|
|
9
9
|
[d.Square]: "rounded-md"
|
|
10
|
-
},
|
|
10
|
+
}, q = ({
|
|
11
11
|
name: s,
|
|
12
12
|
initials: c,
|
|
13
13
|
src: r,
|
|
14
14
|
alt: t = "",
|
|
15
15
|
size: o = 32,
|
|
16
16
|
shape: f = d.Circle,
|
|
17
|
-
|
|
17
|
+
color: h,
|
|
18
|
+
className: u,
|
|
18
19
|
textClassName: l,
|
|
19
|
-
onImageError:
|
|
20
|
+
onImageError: S
|
|
20
21
|
}) => {
|
|
21
|
-
const [
|
|
22
|
+
const [p, v] = b(), g = !!r && p !== r, i = t !== "", m = (n) => e(
|
|
22
23
|
"inline-flex shrink-0 select-none items-center justify-center overflow-hidden",
|
|
23
|
-
|
|
24
|
+
j[f],
|
|
24
25
|
n,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
u,
|
|
27
|
+
w.avatar
|
|
27
28
|
);
|
|
28
|
-
if (
|
|
29
|
+
if (g)
|
|
29
30
|
return /* @__PURE__ */ a(
|
|
30
31
|
"img",
|
|
31
32
|
{
|
|
@@ -35,18 +36,18 @@ const N = {
|
|
|
35
36
|
height: o,
|
|
36
37
|
className: e(m(), "object-cover"),
|
|
37
38
|
onError: (n) => {
|
|
38
|
-
|
|
39
|
+
v(r), S?.(n);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
|
-
const { background:
|
|
43
|
+
const { background: A, foreground: C } = h ?? I(s);
|
|
43
44
|
return /* @__PURE__ */ a(
|
|
44
45
|
"span",
|
|
45
46
|
{
|
|
46
47
|
role: i ? "img" : void 0,
|
|
47
48
|
"aria-label": i ? t : void 0,
|
|
48
49
|
"aria-hidden": i ? void 0 : !0,
|
|
49
|
-
className: m(e(
|
|
50
|
+
className: m(e(A, C)),
|
|
50
51
|
style: {
|
|
51
52
|
width: o,
|
|
52
53
|
height: o,
|
|
@@ -59,12 +60,12 @@ const N = {
|
|
|
59
60
|
"leading-none",
|
|
60
61
|
l ?? "font-semibold"
|
|
61
62
|
),
|
|
62
|
-
children: c ??
|
|
63
|
+
children: c ?? N(s)
|
|
63
64
|
}
|
|
64
65
|
)
|
|
65
66
|
}
|
|
66
67
|
);
|
|
67
68
|
};
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
q as Avatar
|
|
70
71
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.16.0-dev.
|
|
3
|
-
"generatedAt": "2026-10-
|
|
2
|
+
"version": "0.16.0-dev.6",
|
|
3
|
+
"generatedAt": "2026-10-13T09:45:10.487Z",
|
|
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",
|
|
@@ -3660,7 +3660,7 @@
|
|
|
3660
3660
|
"name": "Avatar",
|
|
3661
3661
|
"category": "Components_2_0",
|
|
3662
3662
|
"generation": "2.0",
|
|
3663
|
-
"description": "A person's or an entity's picture, or its initials on a colour picked from\nits name.\naliases: UserAvatar|InitialsAvatar|ProfilePicture\nDesign system 2.0\n\nThe same name always gets the same colour, drawn from the theme's visual\ntokens, so a list of avatars stays stable between renders and sessions. An
|
|
3663
|
+
"description": "A person's or an entity's picture, or its initials on a colour picked from\nits name.\naliases: UserAvatar|InitialsAvatar|ProfilePicture\nDesign system 2.0\n\nThe same name always gets the same colour, drawn from the theme's visual\ntokens, so a list of avatars stays stable between renders and sessions; pass\n`color` to pin one entry of `AVATAR_PALETTE` instead, so every avatar of a\nkind shares one colour regardless of name or locale. An image that is\nmissing or fails to load falls back to the initials; a new `src` tries the\nimage again.\n\nAn avatar with an `alt` is a `role=\"img\"` named by it, whether it shows the\nimage or the initials. Without one it is decorative and hidden from\nassistive technology, which is right when a visible name sits beside it.",
|
|
3664
3664
|
"props": [
|
|
3665
3665
|
{
|
|
3666
3666
|
"name": "name",
|
|
@@ -3701,6 +3701,12 @@
|
|
|
3701
3701
|
"defaultValue": "AvatarShape.Circle",
|
|
3702
3702
|
"description": "Outline of the avatar"
|
|
3703
3703
|
},
|
|
3704
|
+
{
|
|
3705
|
+
"name": "color",
|
|
3706
|
+
"type": "AvatarColorClasses",
|
|
3707
|
+
"required": false,
|
|
3708
|
+
"description": "Explicit colour pair overriding the deterministic pick from `name`"
|
|
3709
|
+
},
|
|
3704
3710
|
{
|
|
3705
3711
|
"name": "className",
|
|
3706
3712
|
"type": "string",
|
|
@@ -12018,6 +12024,41 @@
|
|
|
12018
12024
|
"sourceFile": "types/badge.ts",
|
|
12019
12025
|
"description": "How a `Badge` is drawn."
|
|
12020
12026
|
},
|
|
12027
|
+
{
|
|
12028
|
+
"name": "AvatarColor",
|
|
12029
|
+
"kind": "enum",
|
|
12030
|
+
"members": [
|
|
12031
|
+
{
|
|
12032
|
+
"name": "Green1",
|
|
12033
|
+
"value": "'green-1'"
|
|
12034
|
+
},
|
|
12035
|
+
{
|
|
12036
|
+
"name": "Violet2",
|
|
12037
|
+
"value": "'violet-2'"
|
|
12038
|
+
},
|
|
12039
|
+
{
|
|
12040
|
+
"name": "Brown",
|
|
12041
|
+
"value": "'brown'"
|
|
12042
|
+
},
|
|
12043
|
+
{
|
|
12044
|
+
"name": "Red",
|
|
12045
|
+
"value": "'red'"
|
|
12046
|
+
},
|
|
12047
|
+
{
|
|
12048
|
+
"name": "Green2",
|
|
12049
|
+
"value": "'green-2'"
|
|
12050
|
+
},
|
|
12051
|
+
{
|
|
12052
|
+
"name": "Blue",
|
|
12053
|
+
"value": "'blue'"
|
|
12054
|
+
},
|
|
12055
|
+
{
|
|
12056
|
+
"name": "Violet1",
|
|
12057
|
+
"value": "'violet-1'"
|
|
12058
|
+
}
|
|
12059
|
+
],
|
|
12060
|
+
"sourceFile": "types/avatar.ts"
|
|
12061
|
+
},
|
|
12021
12062
|
{
|
|
12022
12063
|
"name": "AvatarShape",
|
|
12023
12064
|
"kind": "enum",
|
|
@@ -12036,6 +12077,22 @@
|
|
|
12036
12077
|
"sourceFile": "types/avatar.ts",
|
|
12037
12078
|
"description": "The outline an `Avatar` is clipped to."
|
|
12038
12079
|
},
|
|
12080
|
+
{
|
|
12081
|
+
"name": "AvatarColorClasses",
|
|
12082
|
+
"kind": "interface",
|
|
12083
|
+
"members": [
|
|
12084
|
+
{
|
|
12085
|
+
"name": "background",
|
|
12086
|
+
"value": "string"
|
|
12087
|
+
},
|
|
12088
|
+
{
|
|
12089
|
+
"name": "foreground",
|
|
12090
|
+
"value": "string"
|
|
12091
|
+
}
|
|
12092
|
+
],
|
|
12093
|
+
"sourceFile": "utils/avatar.ts",
|
|
12094
|
+
"description": "A background and text colour pair for an initials avatar, as Tailwind classes."
|
|
12095
|
+
},
|
|
12039
12096
|
{
|
|
12040
12097
|
"name": "EntityIdentityItem",
|
|
12041
12098
|
"kind": "interface",
|
|
@@ -12421,6 +12478,11 @@
|
|
|
12421
12478
|
"description": "Class names of the enclosing `ThemeScope`s, outermost first, or `''` when the\ncaller sits outside any scope. Components rendering into a `FloatingPortal`\nmerge this onto their floating root so the tokens follow them out of the\nsubtree.",
|
|
12422
12479
|
"signature": "() => string"
|
|
12423
12480
|
},
|
|
12481
|
+
{
|
|
12482
|
+
"name": "AVATAR_PALETTE",
|
|
12483
|
+
"sourceFile": "utils/avatar.ts",
|
|
12484
|
+
"signature": "AVATAR_PALETTE: Record<AvatarColor, AvatarColorClasses>"
|
|
12485
|
+
},
|
|
12424
12486
|
{
|
|
12425
12487
|
"name": "extractInitials",
|
|
12426
12488
|
"sourceFile": "utils/avatar.ts",
|