@epam/ai-dial-ui-kit 0.15.0-dev.39 → 0.15.0-dev.41

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.
@@ -0,0 +1,85 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { EntityType } from '../../../types/entity-type';
3
+ /** Identity fields of the entity rendered by `EntityIdentity`. */
4
+ export interface EntityIdentityItem {
5
+ /** Entity category; picks the colour of the type label and the featured chip. */
6
+ type: EntityType;
7
+ /** Display name. */
8
+ name: string;
9
+ /** Version shown next to the name. */
10
+ version?: string;
11
+ /** Icon URL. The initials of `name` show while it is missing or fails to load. */
12
+ iconUrl?: string;
13
+ /** Whether the entity is marked as featured. */
14
+ isFeatured?: boolean;
15
+ }
16
+ /** User-visible strings of `EntityIdentity`. */
17
+ export interface EntityIdentityLabels {
18
+ /** Type label text, rendered uppercase. Defaults to the English name of `item.type`. */
19
+ type?: string;
20
+ /** Featured chip text. Defaults to `'Featured'`. */
21
+ featured?: string;
22
+ }
23
+ /** Props for `EntityIdentity`. */
24
+ export interface EntityIdentityProps {
25
+ /** The entity to display. */
26
+ item: EntityIdentityItem;
27
+ /** User-visible strings; pass translated ones in a localised app. */
28
+ labels?: EntityIdentityLabels;
29
+ /** Whether to show `item.version` next to the name. */
30
+ showVersion?: boolean;
31
+ /** Whether to show the featured chip when `item.isFeatured` is true. */
32
+ hasFeaturedTag?: boolean;
33
+ /** Width and height of the icon in px. */
34
+ iconSize?: number;
35
+ /** Heading level of the name, 1–6. */
36
+ headingLevel?: number;
37
+ /** Search query; the matching part of the name is highlighted. */
38
+ query?: string;
39
+ /** Content pinned to the bottom of the text column, aligned with the bottom of the icon. */
40
+ footer?: ReactNode;
41
+ /** Badge rendered before the featured chip, in the top-end corner. */
42
+ statusBadge?: ReactNode;
43
+ /** Additional CSS classes for the root. */
44
+ className?: string;
45
+ /** Type-scale class for the name. Defaults to `'dial-h3-text'`. */
46
+ nameClassName?: string;
47
+ /** Type-scale class for the type label. Defaults to `'dial-caption-lead-semi-text'`. */
48
+ typeClassName?: string;
49
+ /** Type-scale class for the version. Defaults to `'dial-tiny-text'`. */
50
+ versionClassName?: string;
51
+ /** Additional CSS classes for the icon, e.g. to change its corner radius. */
52
+ iconClassName?: string;
53
+ /** Additional CSS classes for the featured chip. */
54
+ featuredChipClassName?: string;
55
+ }
56
+ /**
57
+ * The identity block of a DIAL entity: its icon, a coloured type label, the
58
+ * name and the version, with an optional featured chip.
59
+ * aliases: EntityHeader|ModelHeader|AppIdentity
60
+ * Design system 2.0
61
+ *
62
+ * The type label is plain uppercase text coloured by `item.type`. The icon is
63
+ * a square `Avatar`, so a missing or broken image falls back to the initials of
64
+ * the name. The icon is decorative: the name next to it already names the
65
+ * entity.
66
+ *
67
+ * @example
68
+ * ```tsx
69
+ * <EntityIdentity
70
+ * item={{ type: EntityType.Model, name: 'GPT-4o', version: '2024-11-20' }}
71
+ * labels={{ type: t('Model') }}
72
+ * />
73
+ * ```
74
+ *
75
+ * @param item - The entity to display
76
+ * @param [labels] - User-visible strings
77
+ * @param [showVersion=true] - Whether to show the version
78
+ * @param [hasFeaturedTag=true] - Whether to show the featured chip for a featured entity
79
+ * @param [iconSize=48] - Icon size in px
80
+ * @param [headingLevel=3] - Heading level of the name
81
+ * @param [query] - Search query highlighted in the name
82
+ * @param [footer] - Content pinned to the bottom of the text column
83
+ * @param [statusBadge] - Badge in the top-end corner
84
+ */
85
+ export declare const EntityIdentity: FC<EntityIdentityProps>;
@@ -129,6 +129,8 @@ export declare const DIAL_KIT_CLASS: {
129
129
  readonly badge: "dial-kit-badge";
130
130
  /** The root of an `Avatar`: the image, or the initials box that replaces it. */
131
131
  readonly avatar: "dial-kit-avatar";
132
+ /** The root row of an `EntityIdentity`: its icon, type label, name and version. */
133
+ readonly entityIdentity: "dial-kit-entity-identity";
132
134
  /** The row of a `Switch`: the control and its label. */
133
135
  readonly switch: "dial-kit-switch";
134
136
  /** The row of a `Checkbox`: the box and its label. */
@@ -249,6 +249,9 @@ export { Avatar } from './components/New/Avatar/Avatar';
249
249
  export type { AvatarProps } from './components/New/Avatar/Avatar';
250
250
  export { AvatarShape } from './types/avatar';
251
251
  export { extractInitials } from './utils/avatar';
252
+ export { EntityIdentity } from './components/New/EntityIdentity/EntityIdentity';
253
+ export type { EntityIdentityProps, EntityIdentityItem, EntityIdentityLabels, } from './components/New/EntityIdentity/EntityIdentity';
254
+ export { EntityType } from './types/entity-type';
252
255
  export { SideDrawer } from './components/New/SideDrawer/SideDrawer';
253
256
  export type { SideDrawerProps } from './components/New/SideDrawer/SideDrawer';
254
257
  export { Tag } from './components/New/Tag/Tag';
@@ -0,0 +1,9 @@
1
+ /** The category of a DIAL catalog entity. It picks the colour of the type label and the featured chip. */
2
+ export declare enum EntityType {
3
+ Model = "model",
4
+ Agent = "agent",
5
+ Toolset = "toolset",
6
+ Skill = "skill",
7
+ /** Reusable text prompt. Carries a body instead of a runtime. */
8
+ Prompt = "prompt"
9
+ }
@@ -0,0 +1,4 @@
1
+ var l = /* @__PURE__ */ ((o) => (o.Model = "model", o.Agent = "agent", o.Toolset = "toolset", o.Skill = "skill", o.Prompt = "prompt", o))(l || {});
2
+ export {
3
+ l as EntityType
4
+ };