@epam/ai-dial-ui-kit 0.16.0-dev.55 → 0.16.0-dev.57

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.
Files changed (34) hide show
  1. package/README.md +2 -0
  2. package/dist/CHANGELOG.md +12 -0
  3. package/dist/{DateCellRenderer-D5FgkGHp.cjs → DateCellRenderer-CB2R7gM2.cjs} +28 -28
  4. package/dist/{MarkdownEditor-BtLY7OVq.cjs → MarkdownEditor-B-x8Ntfe.cjs} +1 -1
  5. package/dist/components/New/Dropdown/Dropdown.js +212 -203
  6. package/dist/components/New/Notification/Notification.js +51 -40
  7. package/dist/components/New/Notification/constants.js +26 -17
  8. package/dist/components/New/ToggleChip/ToggleChip.js +54 -0
  9. package/dist/components/New/ToggleChip/constants.js +11 -0
  10. package/dist/components/ProgressBar/ProgressBar.js +43 -38
  11. package/dist/components-manifest.json +144 -10
  12. package/dist/constants/public-class-names.js +2 -0
  13. package/dist/dial-ui-kit.cjs +3 -3
  14. package/dist/dial-ui-kit.js +375 -369
  15. package/dist/editors.cjs +1 -1
  16. package/dist/grid.cjs +1 -1
  17. package/dist/{icon-D93YIwGJ.cjs → icon-4D9xu6E_.cjs} +1 -1
  18. package/dist/index.css +1 -1
  19. package/dist/src/components/New/Dropdown/Dropdown.d.ts +53 -1
  20. package/dist/src/components/New/Notification/Notification.d.ts +21 -2
  21. package/dist/src/components/New/Notification/constants.d.ts +11 -0
  22. package/dist/src/components/New/ToggleChip/ToggleChip.d.ts +70 -0
  23. package/dist/src/components/New/ToggleChip/constants.d.ts +12 -0
  24. package/dist/src/components/ProgressBar/ProgressBar.d.ts +23 -3
  25. package/dist/src/constants/public-class-names.d.ts +2 -0
  26. package/dist/src/index.d.ts +5 -2
  27. package/dist/src/types/dropdown.d.ts +16 -0
  28. package/dist/src/types/notification.d.ts +11 -0
  29. package/dist/src/types/progress-bar.d.ts +13 -0
  30. package/dist/types/dropdown.js +5 -4
  31. package/dist/types/notification.js +3 -2
  32. package/dist/types/progress-bar.js +4 -0
  33. package/dist/utils/merge-classes.js +11 -8
  34. package/package.json +1 -1
@@ -0,0 +1,70 @@
1
+ import { ButtonHTMLAttributes, FC, ReactNode } from 'react';
2
+ type NativeToggleChipProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type' | 'onToggle' | 'aria-pressed'>;
3
+ export interface ToggleChipProps extends NativeToggleChipProps {
4
+ label: ReactNode;
5
+ icon?: ReactNode;
6
+ isSelected?: boolean;
7
+ onToggle?: (isSelected: boolean) => void;
8
+ }
9
+ /**
10
+ * A chip that switches one option on and off on its own, for a row of
11
+ * independent toggles — tools a model may call, filters that combine.
12
+ * aliases: ChipToggle|ToggleTag|PressableChip|SelectableChip|MultiSelectChip
13
+ * Design system 2.0
14
+ *
15
+ * Draws the `TagAppearance.Selectable` filter chip of the 2.0 design — no fill
16
+ * until it is on, one accent hover tint shared by both states, an accent-alpha
17
+ * fill and a semibold label once on — so a row of these sits beside a
18
+ * `FilterChips` row without a seam. Turning it on therefore widens it by the
19
+ * difference between the regular and semibold label; give it a width if that
20
+ * shift matters.
21
+ *
22
+ * Reach for it when each chip is its own yes/no. `FilterChips` picks one value
23
+ * out of several and `Tag` is a label that may be clicked or removed; neither
24
+ * keeps several independent states, and `Tag` renders a `<span>` with a string
25
+ * label. This is a native `<button aria-pressed>`: Enter and Space work, the
26
+ * state is announced as "pressed", and `disabled` takes it out of the tab order
27
+ * and greys it out.
28
+ *
29
+ * Keep one accessible name across both states — the state rides on
30
+ * `aria-pressed`, and a control that renames itself on click reads as a
31
+ * different control. Visible state text such as "ON" / "OFF" belongs inside
32
+ * `label`, wrapped in `aria-hidden` so it is not read on top of the pressed
33
+ * state. There is no remove control: a chip that toggles and also closes gives
34
+ * a screen reader two actions with no way to tell which one it landed on, so a
35
+ * removable value is a closable `Tag` instead.
36
+ *
37
+ * Group a row of these in a named `role="group"` so they are announced
38
+ * together. Labels are the caller's to translate — the component ships no
39
+ * English defaults.
40
+ *
41
+ * @example
42
+ * ```tsx
43
+ * <div role="group" aria-label={t('Tools')} className="flex flex-wrap gap-1">
44
+ * {tools.map((tool) => (
45
+ * <ToggleChip
46
+ * key={tool.id}
47
+ * icon={tool.icon}
48
+ * label={
49
+ * <>
50
+ * {tool.label}
51
+ * <span aria-hidden="true">: {tool.isOn ? t('ON') : t('OFF')}</span>
52
+ * </>
53
+ * }
54
+ * isSelected={tool.isOn}
55
+ * onToggle={(isOn) => setTool(tool.id, isOn)}
56
+ * />
57
+ * ))}
58
+ * </div>
59
+ * ```
60
+ *
61
+ * @param label - Content of the chip after the icon. Any node, so trailing state text can follow the name; it truncates on one line
62
+ * @param [icon] - Icon rendered before the label; hidden from assistive tech
63
+ * @param [isSelected=false] - Whether the chip is on; rendered as `aria-pressed`
64
+ * @param [onToggle] - Called with the next value when the chip is activated by click, Enter or Space
65
+ * @param [disabled=false] - Greys the chip out and stops it responding; it keeps showing its on/off state
66
+ * @param [onClick] - Native click handler, called before `onToggle`
67
+ * @param [className] - Additional classes on the button
68
+ */
69
+ export declare const ToggleChip: FC<ToggleChipProps>;
70
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type scale per state, as the selectable `Tag` draws it: the regular label
3
+ * steps up to semibold once the chip is on.
4
+ */
5
+ export declare const toggleChipLabelClassNames: Record<'default' | 'selected', string>;
6
+ /**
7
+ * Colours of a disabled chip. The `Tag` design defines no disabled state, so
8
+ * these follow the kit's other 2.0 controls — the disabled text colour, and on
9
+ * a chip that is on, the disabled fill `SegmentedControl` gives its selected
10
+ * segment — keeping the on/off state visible while the chip cannot respond.
11
+ */
12
+ export declare const toggleChipDisabledClassNames: Record<'default' | 'selected', string>;
@@ -1,19 +1,31 @@
1
1
  import { FC, HTMLAttributes, ReactNode } from 'react';
2
2
  import { LabelProps } from '../New/Label/Label';
3
+ import { ProgressBarRole } from '../../types/progress-bar';
3
4
  import { ElementSize } from '../../types/size';
4
- type NativeProgressBarProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
5
+ type NativeProgressBarProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role'>;
5
6
  export interface ProgressBarProps extends NativeProgressBarProps {
6
7
  value: number;
7
8
  max?: number;
8
9
  size?: ElementSize;
9
10
  labelProps?: LabelProps;
10
11
  valueLabel?: ReactNode;
12
+ role?: ProgressBarRole;
11
13
  }
12
14
  /**
13
- * A horizontal bar indicating progress toward a goal.
14
- * aliases: Progress|LoadingBar|Meter
15
+ * A horizontal bar indicating progress toward a goal, or a level within a range.
16
+ * aliases: Progress|LoadingBar|Meter|Gauge|CapacityMeter|UsageBar
15
17
  * Design system 2.0
16
18
  *
19
+ * `role` picks what the bar means. The default, `ProgressBarRole.Progressbar`,
20
+ * is a task on its way to done — an upload, an import. `ProgressBarRole.Meter`
21
+ * renders `role="meter"`: a level inside a known range that never completes —
22
+ * capacity used, a quota, a budget. Both carry `aria-valuemin`,
23
+ * `aria-valuemax`, `aria-valuenow` and, when given, `aria-valuetext`, and draw
24
+ * the same track and accent fill; the role changes only what a screen reader
25
+ * announces. The bar has no low / optimum / high colouring, so a meter that
26
+ * must change colour near its limit is restyled by the caller through
27
+ * `className`.
28
+ *
17
29
  * Names itself from `labelProps.label` through `aria-labelledby`; without one it
18
30
  * falls back to `aria-label`, and finally to `Progress` so the bar is never
19
31
  * anonymous. Prefer a real label — several bars all announcing "Progress" tell a
@@ -33,6 +45,13 @@ export interface ProgressBarProps extends NativeProgressBarProps {
33
45
  * <ProgressBar value={40} labelProps={{ label: 'Uploading' }} />
34
46
  * <ProgressBar value={3} max={10} aria-valuetext="3 of 10 files" />
35
47
  * <ProgressBar value={80} size={ElementSize.Small} />
48
+ * <ProgressBar
49
+ * role={ProgressBarRole.Meter}
50
+ * value={usedBytes}
51
+ * max={maxBytes}
52
+ * aria-label="Project capacity"
53
+ * aria-valuetext="42% used"
54
+ * />
36
55
  *
37
56
  * <ProgressBar
38
57
  * value={3.313182}
@@ -48,6 +67,7 @@ export interface ProgressBarProps extends NativeProgressBarProps {
48
67
  * @param [size=ElementSize.Standard] - Bar height: standard is 8px, small is 4px.
49
68
  * @param [labelProps] - Props of the {@link Label} rendered above the bar, which also names it.
50
69
  * @param [valueLabel] - Readout rendered at the end of the label row.
70
+ * @param [role=ProgressBarRole.Progressbar] - ARIA role of the bar: `progressbar` for a task's progress, `meter` for a level within a range. Without a label the bar is named `Progress` or `Meter` respectively.
51
71
  * @param [className] - Additional classes on the track element.
52
72
  */
53
73
  export declare const ProgressBar: FC<ProgressBarProps>;
@@ -222,6 +222,8 @@ export declare const DIAL_KIT_CLASS: {
222
222
  * already carries.
223
223
  */
224
224
  readonly toggleIconButton: "dial-kit-toggle-icon-button";
225
+ /** The `<button aria-pressed>` of a `ToggleChip`. */
226
+ readonly toggleChip: "dial-kit-toggle-chip";
225
227
  /** A `CloseButton`, additive to `dial-kit-base-icon-button`. */
226
228
  readonly closeButton: "dial-kit-close-button";
227
229
  /** An `InfoButton`, additive to `dial-kit-base-icon-button`. */
@@ -8,6 +8,7 @@ export { Spinner } from './components/Spinner/Spinner';
8
8
  export type { SpinnerProps } from './components/Spinner/Spinner';
9
9
  export { ProgressBar } from './components/ProgressBar/ProgressBar';
10
10
  export type { ProgressBarProps } from './components/ProgressBar/ProgressBar';
11
+ export { ProgressBarRole } from './types/progress-bar';
11
12
  export { DialNoDataContent } from './components/NoDataContent/NoDataContent';
12
13
  export type { DialNoDataContentProps } from './components/NoDataContent/NoDataContent';
13
14
  export { DialLabelledText } from './components/LabelledText/LabelledText';
@@ -42,7 +43,7 @@ export { ButtonVariant, ButtonAppearance } from './types/button';
42
43
  export { RadioGroupOrientation } from './types/radio-group';
43
44
  export { PopupSize } from './types/popup';
44
45
  export { ConfirmationPopupVariant } from './types/confirmation-popup';
45
- export { DropdownType, DropdownTrigger, DropdownItemType, } from './types/dropdown';
46
+ export { DropdownType, DropdownTrigger, DropdownItemType, DropdownOverlayRole, } from './types/dropdown';
46
47
  export { MenuItemMark } from './types/menu-item';
47
48
  export { ElementSize } from './types/size';
48
49
  export { ScreenResolution, TabOrientation, TabStatus, TabView, } from './types/tab';
@@ -75,7 +76,7 @@ export { SchemaRendererVariant, SchemaDisplayMode, SchemaOrientation, JsonSchema
75
76
  export type { JsonSchema, JsonSchemaDef, ValidationError, SchemaRendererTexts, } from './models/json-schema';
76
77
  export { SchemaRenderer } from './components/New/SchemaRenderer/SchemaRenderer';
77
78
  export type { SchemaRendererProps, SchemaRenderField, } from './components/New/SchemaRenderer/types';
78
- export { NotificationVariant, NotificationType } from './types/notification.ts';
79
+ export { NotificationVariant, NotificationType, NotificationSurface, } from './types/notification.ts';
79
80
  export { Notification } from './components/New/Notification/Notification';
80
81
  export { Highlight } from './components/New/Highlight/Highlight';
81
82
  export { CardShell } from './components/New/CardShell/CardShell';
@@ -165,6 +166,8 @@ export { CheckboxBox } from './components/New/Checkbox/CheckboxBox';
165
166
  export type { CheckboxBoxProps } from './components/New/Checkbox/CheckboxBox';
166
167
  export { ToggleIconButton } from './components/New/ToggleIconButton/ToggleIconButton';
167
168
  export type { ToggleIconButtonProps } from './components/New/ToggleIconButton/ToggleIconButton';
169
+ export { ToggleChip } from './components/New/ToggleChip/ToggleChip';
170
+ export type { ToggleChipProps } from './components/New/ToggleChip/ToggleChip';
168
171
  export { SegmentedControl } from './components/New/SegmentedControl/SegmentedControl';
169
172
  export type { SegmentedControlProps, SegmentedControlItem, } from './components/New/SegmentedControl/SegmentedControl';
170
173
  export { Tabs } from './components/New/Tabs/Tabs';
@@ -12,3 +12,19 @@ export declare enum DropdownItemType {
12
12
  Divider = "divider",
13
13
  PlainText = "plainText"
14
14
  }
15
+ /**
16
+ * Role of the 2.0 `Dropdown`'s floating overlay, and with it the
17
+ * `aria-haspopup` value its trigger announces.
18
+ */
19
+ export declare enum DropdownOverlayRole {
20
+ /** `role="menu"`, trigger `aria-haspopup="menu"`; options are arrow-key navigated. */
21
+ Menu = "menu",
22
+ /** `role="dialog"`, trigger `aria-haspopup="dialog"`; for a panel of free-form content. */
23
+ Dialog = "dialog",
24
+ /**
25
+ * No role on the overlay and no `aria-haspopup` on the trigger, which keeps
26
+ * `aria-expanded`/`aria-controls` as a disclosure; for an overlay whose
27
+ * content supplies its own semantics (a `region`, its own `dialog`).
28
+ */
29
+ None = "none"
30
+ }
@@ -10,3 +10,14 @@ export declare enum NotificationType {
10
10
  Toast = "toast",
11
11
  SectionMessage = "section-message"
12
12
  }
13
+ /**
14
+ * Which surface a `Notification` draws on.
15
+ *
16
+ * - `Variant` — the variant's own coloured surface (`bg-info`, `bg-warning` …).
17
+ * - `Neutral` — the neutral sunken layer (`bg-layer-sunken`) with primary text;
18
+ * the variant still picks the icon, the icon colour and the live-region role.
19
+ */
20
+ export declare enum NotificationSurface {
21
+ Variant = "variant",
22
+ Neutral = "neutral"
23
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The ARIA role a `ProgressBar` renders, which decides what its value means to
3
+ * a screen reader.
4
+ */
5
+ export declare enum ProgressBarRole {
6
+ /** `role="progressbar"`: how far a task has got toward completion — an upload, an import. */
7
+ Progressbar = "progressbar",
8
+ /**
9
+ * `role="meter"`: a scalar inside a known range that is not a task's
10
+ * progress — capacity used, a quota, a score. It never "completes".
11
+ */
12
+ Meter = "meter"
13
+ }
@@ -1,6 +1,7 @@
1
- var t = /* @__PURE__ */ ((e) => (e.Dropdown = "dropdown", e.Menu = "menu", e))(t || {}), n = /* @__PURE__ */ ((e) => (e.Click = "click", e.Hover = "hover", e.ContextMenu = "contextMenu", e))(n || {}), i = /* @__PURE__ */ ((e) => (e.Item = "item", e.Divider = "divider", e.PlainText = "plainText", e))(i || {});
1
+ var n = /* @__PURE__ */ ((e) => (e.Dropdown = "dropdown", e.Menu = "menu", e))(n || {}), t = /* @__PURE__ */ ((e) => (e.Click = "click", e.Hover = "hover", e.ContextMenu = "contextMenu", e))(t || {}), u = /* @__PURE__ */ ((e) => (e.Item = "item", e.Divider = "divider", e.PlainText = "plainText", e))(u || {}), i = /* @__PURE__ */ ((e) => (e.Menu = "menu", e.Dialog = "dialog", e.None = "none", e))(i || {});
2
2
  export {
3
- i as DropdownItemType,
4
- n as DropdownTrigger,
5
- t as DropdownType
3
+ u as DropdownItemType,
4
+ i as DropdownOverlayRole,
5
+ t as DropdownTrigger,
6
+ n as DropdownType
6
7
  };
@@ -1,5 +1,6 @@
1
- var r = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Error = "error", e.Loading = "loading", e.General = "general", e))(r || {}), s = /* @__PURE__ */ ((e) => (e.Toast = "toast", e.SectionMessage = "section-message", e))(s || {});
1
+ var e = /* @__PURE__ */ ((r) => (r.Info = "info", r.Success = "success", r.Warning = "warning", r.Error = "error", r.Loading = "loading", r.General = "general", r))(e || {}), s = /* @__PURE__ */ ((r) => (r.Toast = "toast", r.SectionMessage = "section-message", r))(s || {}), g = /* @__PURE__ */ ((r) => (r.Variant = "variant", r.Neutral = "neutral", r))(g || {});
2
2
  export {
3
+ g as NotificationSurface,
3
4
  s as NotificationType,
4
- r as NotificationVariant
5
+ e as NotificationVariant
5
6
  };
@@ -0,0 +1,4 @@
1
+ var e = /* @__PURE__ */ ((r) => (r.Progressbar = "progressbar", r.Meter = "meter", r))(e || {});
2
+ export {
3
+ e as ProgressBarRole
4
+ };
@@ -1,6 +1,6 @@
1
- import i from "classnames";
1
+ import a from "classnames";
2
2
  import { extendTailwindMerge as t } from "../node_modules/tailwind-merge/dist/bundle-mjs.js";
3
- const l = [
3
+ const e = [
4
4
  "display1",
5
5
  "display2",
6
6
  "display3",
@@ -22,23 +22,26 @@ const l = [
22
22
  "caption",
23
23
  "caption-lead-semi",
24
24
  "code",
25
+ "code-semi",
26
+ "tiny-code",
27
+ "tiny-code-semi",
25
28
  "italic",
26
29
  "small-italic",
27
30
  "tiny-italic",
28
31
  "caption-italic"
29
- ], e = t({
32
+ ], l = t({
30
33
  extend: {
31
34
  classGroups: {
32
35
  z: [{ z: ["popup", "floating", "interactive-tooltip", "tooltip"] }],
33
- "dial-typography": l.map(
34
- (a) => `dial-${a}-text`
36
+ "dial-typography": e.map(
37
+ (i) => `dial-${i}-text`
35
38
  )
36
39
  }
37
40
  }
38
41
  });
39
- function o(...a) {
40
- return e(i(a));
42
+ function p(...i) {
43
+ return l(a(i));
41
44
  }
42
45
  export {
43
- o as mergeClasses
46
+ p as mergeClasses
44
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.16.0-dev.55",
3
+ "version": "0.16.0-dev.57",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",