@epam/ai-dial-ui-kit 0.14.0-dev.3 → 0.14.0-dev.5

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 (38) hide show
  1. package/README.md +2 -1
  2. package/dist/CHANGELOG.md +14 -0
  3. package/dist/{JsonEditor-0ZT9yNXj.js → JsonEditor-DrC6i27F.js} +1 -1
  4. package/dist/{JsonEditor-EOISr6OE.cjs → JsonEditor-dP4yDdgN.cjs} +1 -1
  5. package/dist/{MarkdownEditor-Csbic0gz.js → MarkdownEditor-BeNDQecT.js} +1 -1
  6. package/dist/{MarkdownEditor-D8p7zjZ1.js → MarkdownEditor-CO-k9xZo.js} +1 -1
  7. package/dist/{MarkdownEditor-vV5rCB3Y.cjs → MarkdownEditor-CSgVi6EZ.cjs} +1 -1
  8. package/dist/{MarkdownEditor-BfeV6-XV.cjs → MarkdownEditor-fskBDR5e.cjs} +1 -1
  9. package/dist/components-manifest.json +461 -13
  10. package/dist/dial-ui-kit.cjs.js +1 -1
  11. package/dist/dial-ui-kit.es.js +199 -195
  12. package/dist/{index-Ho1ZjGNx.cjs → index-DmEajFx0.cjs} +31 -31
  13. package/dist/{index-BVZGIW7V.js → index-jMP1W9V6.js} +10410 -10118
  14. package/dist/index.css +1 -1
  15. package/dist/migration-guides/0.14.0/button-tooltip-2-0.md +111 -0
  16. package/dist/migration-guides/0.14.0/select-multiselect-option-row.md +99 -0
  17. package/dist/migration-guides/README.md +2 -0
  18. package/dist/src/components/New/Button/Button.d.ts +4 -3
  19. package/dist/src/components/New/Checkbox/Checkbox.d.ts +4 -0
  20. package/dist/src/components/New/Checkbox/CheckboxBox.d.ts +30 -0
  21. package/dist/src/components/New/Dropdown/constants.d.ts +2 -0
  22. package/dist/src/components/New/Highlight/Highlight.d.ts +1 -1
  23. package/dist/src/components/New/IconButton/IconButton.d.ts +4 -4
  24. package/dist/src/components/New/Label/Label.d.ts +5 -0
  25. package/dist/src/components/New/Popup/Popup.d.ts +48 -9
  26. package/dist/src/components/New/Popup/constants.d.ts +7 -0
  27. package/dist/src/components/New/RadioGroup/RadioGroup.d.ts +78 -0
  28. package/dist/src/components/New/RadioGroup/constants.d.ts +11 -0
  29. package/dist/src/components/New/RadioGroupPopupField/RadioGroupPopupField.d.ts +93 -0
  30. package/dist/src/components/New/RadioGroupPopupField/constants.d.ts +22 -0
  31. package/dist/src/components/New/Select/constants.d.ts +2 -2
  32. package/dist/src/components/New/Tag/Tag.d.ts +15 -0
  33. package/dist/src/components/New/Tooltip/constants.d.ts +6 -1
  34. package/dist/src/components/New/constants/overlay.d.ts +12 -3
  35. package/dist/src/index.d.ts +7 -0
  36. package/dist/src/models/dropdown.d.ts +10 -0
  37. package/dist/src/types/tag.d.ts +4 -0
  38. package/package.json +1 -1
@@ -3,6 +3,13 @@ export declare const popupOverlayBaseClassName = "z-[52] flex items-center justi
3
3
  export declare const popupBaseClassName = "relative flex w-full max-h-full flex-col rounded-xl bg-layer-raised md:h-auto";
4
4
  export declare const popupHeaderClassName = "flex flex-row items-center justify-between px-6 py-4";
5
5
  export declare const popupTitleClassName = "flex-1 min-w-0 mr-3 truncate dial-h1-text text-primary";
6
+ /** Rule under the header. Opt-in: by default sections are separated by spacing. */
7
+ export declare const popupHeaderDividerClassName = "border-b border-tertiary";
8
+ export declare const popupFooterClassName = "flex flex-row items-center gap-2 px-6 py-4";
9
+ /** Rule above the footer, mirroring the header. */
10
+ export declare const popupFooterDividerClassName = "border-t border-tertiary";
11
+ /** Groups the controls sitting on one side of the header or footer. */
12
+ export declare const popupActionsGroupClassName = "flex shrink-0 flex-row items-center gap-2";
6
13
  /**
7
14
  * Max widths per size. Full width below the `md` breakpoint, where the popup
8
15
  * fills the screen.
@@ -0,0 +1,78 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ import { RadioGroupOrientation } from '../../../types/radio-group';
4
+ export interface RadioGroupItem {
5
+ value: string;
6
+ label?: ReactNode;
7
+ /** Explanatory text rendered under the option's label. */
8
+ caption?: string;
9
+ /** Content revealed under the option while it is the selected one. */
10
+ content?: ReactNode;
11
+ disabled?: boolean;
12
+ /** Names the option when its `label` is not a string (or absent). */
13
+ 'aria-label'?: string;
14
+ }
15
+ export interface RadioGroupProps {
16
+ items: RadioGroupItem[];
17
+ value?: string;
18
+ onChange: (value: string) => void;
19
+ name?: string;
20
+ id?: string;
21
+ orientation?: RadioGroupOrientation;
22
+ labelProps?: LabelProps;
23
+ disabled?: boolean;
24
+ error?: string;
25
+ caption?: string;
26
+ ariaLabel?: string;
27
+ className?: string;
28
+ optionsClassName?: string;
29
+ radioClassName?: string;
30
+ contentClassName?: string;
31
+ }
32
+ /**
33
+ * A set of mutually exclusive {@link Radio} options with one group label.
34
+ * aliases: SelectionGroup|OptionGroup|RadioList
35
+ * Design system 2.0
36
+ *
37
+ * @example
38
+ * ```tsx
39
+ * <RadioGroup
40
+ * labelProps={{ label: 'Delivery' }}
41
+ * value={delivery}
42
+ * onChange={setDelivery}
43
+ * items={[
44
+ * { value: 'pickup', label: 'Pickup', caption: 'Free, ready today' },
45
+ * { value: 'courier', label: 'Courier', content: <AddressForm /> },
46
+ * ]}
47
+ * />
48
+ * ```
49
+ *
50
+ * The options are native radios sharing one `name`, so the browser gives the
51
+ * group a single tab stop and moves the selection with the arrow keys — no
52
+ * roving `tabindex` is needed. The wrapper still takes `role="radiogroup"` so
53
+ * the group's own name is announced before the options.
54
+ *
55
+ * An option's `content` is mounted only while that option is selected, so a
56
+ * form or an input inside it never holds focus for an option the user has moved
57
+ * away from.
58
+ *
59
+ * The group is named by `labelProps.label` when that is a string, and by
60
+ * `ariaLabel` otherwise — a group whose label is a node has no other name.
61
+ *
62
+ * @param items - Options to render; each needs a unique `value` and may carry a `label`, `caption`, `content` and `disabled` flag
63
+ * @param [value] - The `value` of the selected option
64
+ * @param onChange - Callback fired with the newly selected `value`
65
+ * @param [name] - The `name` shared by the underlying radios; defaults to the group id
66
+ * @param [id] - Base id for the group; option ids are derived from it
67
+ * @param [orientation=RadioGroupOrientation.Column] - Whether the options stack or sit in a row
68
+ * @param [labelProps] - Props of the {@link Label} rendered above the options
69
+ * @param [disabled] - Disables every option
70
+ * @param [error] - Error message rendered below the options
71
+ * @param [caption] - Helper text rendered below the options when there is no `error`
72
+ * @param [ariaLabel] - Names the group when there is no string `labelProps.label`
73
+ * @param [className] - Additional classes for the outer container
74
+ * @param [optionsClassName] - Additional classes for the options wrapper
75
+ * @param [radioClassName] - Additional classes for every option's control row
76
+ * @param [contentClassName] - Additional classes for the selected option's content
77
+ */
78
+ export declare const RadioGroup: FC<RadioGroupProps>;
@@ -0,0 +1,11 @@
1
+ import { RadioGroupOrientation } from '../../../types/radio-group';
2
+ /** Label, options and caption/error stack, matching the 2.0 field rhythm. */
3
+ export declare const groupBaseClassName = "flex flex-col gap-2";
4
+ export declare const optionsWrapperBaseClassName = "flex";
5
+ /**
6
+ * Content revealed under the selected option. The inline offset is the one
7
+ * `Radio` gives its own caption, so the content lines up with the option's
8
+ * label text rather than with its circle.
9
+ */
10
+ export declare const selectedContentClassName = "mt-2 ml-[26px]";
11
+ export declare const orientationClassMap: Record<RadioGroupOrientation, string>;
@@ -0,0 +1,93 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { LabelProps } from '../Label/Label';
3
+ import { RadioGroupItem } from '../RadioGroup/RadioGroup';
4
+ import { PopupSize } from '../../../types/popup';
5
+ export interface RadioGroupPopupFieldProps {
6
+ items: RadioGroupItem[];
7
+ value?: string;
8
+ customValue?: string;
9
+ header: ReactNode;
10
+ onApply: (value?: string) => void;
11
+ id?: string;
12
+ labelProps?: LabelProps;
13
+ placeholder?: string;
14
+ selectedValue?: string;
15
+ onSelectionChange?: (value: string) => void;
16
+ onCancel?: () => void;
17
+ onClose?: () => void;
18
+ isValid?: boolean;
19
+ applyButtonLabel?: string;
20
+ cancelButtonLabel?: string;
21
+ size?: PopupSize;
22
+ portalId?: string;
23
+ disabled?: boolean;
24
+ invalid?: boolean;
25
+ error?: string;
26
+ caption?: string;
27
+ ariaLabel?: string;
28
+ className?: string;
29
+ fieldClassName?: string;
30
+ }
31
+ /**
32
+ * A field whose value is picked from a {@link RadioGroup} inside a {@link Popup}.
33
+ * aliases: PopupRadio|ChoicePopup|RadioPopupField
34
+ * Design system 2.0
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <RadioGroupPopupField
39
+ * labelProps={{ label: 'Status' }}
40
+ * header="Select status"
41
+ * placeholder="None"
42
+ * items={[
43
+ * { value: 'draft', label: 'Draft' },
44
+ * { value: 'published', label: 'Published' },
45
+ * ]}
46
+ * value={status}
47
+ * onApply={(next) => setStatus(next)}
48
+ * />
49
+ * ```
50
+ *
51
+ * The collapsed field is a `<button>` rather than a read-only `<input>`: it
52
+ * opens a dialog and holds no text of its own, so the button role and its
53
+ * `Enter` / `Space` activation come from the element itself instead of being
54
+ * re-implemented on an input that would also invite typing.
55
+ *
56
+ * The selection inside the popup is a draft. Uncontrolled, it is seeded from
57
+ * `value` each time the popup opens, so an edit the user cancelled never leaks
58
+ * into the next one, and `onApply` is the only callback reporting a committed
59
+ * value. Pass `selectedValue` with `onSelectionChange` to drive the draft
60
+ * yourself — needed when `isValid` depends on what is currently selected.
61
+ *
62
+ * The field's accessible name is its label followed by the current value, so it
63
+ * announces like a collapsed picker ("Status, Draft"). With no `labelProps`,
64
+ * pass `ariaLabel`: it is exposed through a visually hidden element rather than
65
+ * as `aria-label`, which would replace the value in the name instead of
66
+ * preceding it.
67
+ *
68
+ * @param items - Options offered inside the popup
69
+ * @param [value] - The committed value, shown in the collapsed field
70
+ * @param [customValue] - Text shown in the field in place of the selected option's label
71
+ * @param header - Title of the popup
72
+ * @param onApply - Callback fired with the selected value when Apply is clicked
73
+ * @param [id] - Base id for the field; the label and the options derive theirs from it
74
+ * @param [labelProps] - Props of the {@link Label} rendered above the field
75
+ * @param [placeholder] - Text shown in the field while no value is selected
76
+ * @param [selectedValue] - Controlled draft selection inside the popup
77
+ * @param [onSelectionChange] - Callback fired when the draft selection changes
78
+ * @param [onCancel] - Callback fired when Cancel is clicked, before the popup closes
79
+ * @param [onClose] - Callback fired whenever the popup closes
80
+ * @param [isValid=true] - Whether Apply is enabled
81
+ * @param [applyButtonLabel="Apply"] - Label of the Apply button
82
+ * @param [cancelButtonLabel="Cancel"] - Label of the Cancel button
83
+ * @param [size=PopupSize.Md] - Size of the popup
84
+ * @param [portalId] - Portal container id for the popup
85
+ * @param [disabled] - Disables the field, so the popup cannot be opened
86
+ * @param [invalid] - Paints the field with the error border
87
+ * @param [error] - Error message rendered below the field
88
+ * @param [caption] - Helper text rendered below the field when there is no `error`
89
+ * @param [ariaLabel] - Names the field when there is no string `labelProps.label`
90
+ * @param [className] - Additional classes for the outer container
91
+ * @param [fieldClassName] - Additional classes for the collapsed field
92
+ */
93
+ export declare const RadioGroupPopupField: FC<RadioGroupPopupFieldProps>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The collapsed field. `dial-kit-input` gives it the 2.0 field box — 40px tall,
3
+ * raised surface, accent border on hover, accent outline on focus, and the
4
+ * sunken disabled treatment through its own `:disabled` rule, which a `<button>`
5
+ * matches. The utilities after it only lay the row out; the SCSS class is
6
+ * unlayered, so anything it already sets (`truncate`, `w-full`, the height)
7
+ * cannot be overridden from here.
8
+ *
9
+ * No `dial-kit-enhanced-target`: `truncate` puts `overflow: hidden` on the
10
+ * field, which would clip the 44px pseudo-element back to the field's own 40px,
11
+ * and being unlayered it cannot be undone with a utility. The field takes the
12
+ * same documented 2.5.5 exception as `Input` and `Select` — full-width target,
13
+ * 4px short of 44 vertically.
14
+ */
15
+ export declare const fieldBaseClassName = "dial-kit-input flex flex-row items-center justify-between gap-x-2 px-3 text-left";
16
+ export declare const fieldValueClassName = "min-w-0 flex-1 truncate text-primary";
17
+ export declare const fieldPlaceholderClassName = "min-w-0 flex-1 truncate text-secondary";
18
+ export declare const fieldIconClassName = "shrink-0 text-secondary";
19
+ export declare const popupBodyClassName = "px-6 pb-4";
20
+ export declare const popupFooterClassName = "flex justify-end gap-2 px-6 py-4 border-t border-tertiary";
21
+ export declare const defaultCancelLabel = "Cancel";
22
+ export declare const defaultApplyLabel = "Apply";
@@ -1,6 +1,6 @@
1
1
  export declare const selectOverlayBaseClassName: string;
2
2
  export declare const selectOptionBaseClassName: string;
3
- export declare const selectOptionSelectedClassName = "bg-control-accent-alpha-hover";
3
+ export declare const selectOptionSelectedClassName = "bg-control-accent-alpha";
4
4
  /**
5
5
  * Holds the option list to the width of the field.
6
6
  *
@@ -12,7 +12,7 @@ export declare const selectOptionSelectedClassName = "bg-control-accent-alpha-ho
12
12
  * default this component relies on).
13
13
  */
14
14
  export declare const selectListWidthClassName = "!max-w-[var(--reference-width)]";
15
- export declare const selectOptionDisabledClassName = "text-secondary";
15
+ export declare const selectOptionDisabledClassName: string;
16
16
  export declare const dropdownMenuMaxHeight = 352;
17
17
  export declare const selectSubMenuGap = 4;
18
18
  export declare const selectSubMenuClassName: string;
@@ -1,10 +1,12 @@
1
1
  import { FC, HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
2
  import { ElementSize } from '../../../types/size';
3
+ import { TagAppearance } from '../../../types/tag';
3
4
  type NativeTagProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
4
5
  export interface TagProps extends NativeTagProps {
5
6
  label: string;
6
7
  icon?: ReactNode;
7
8
  size?: ElementSize;
9
+ appearance?: TagAppearance;
8
10
  selected?: boolean;
9
11
  disabled?: boolean;
10
12
  closable?: boolean;
@@ -24,16 +26,29 @@ export interface TagProps extends NativeTagProps {
24
26
  * the caller: a clickable tag that is also closable gives a screen reader two
25
27
  * actions with no way to tell which one it landed on.
26
28
  *
29
+ * `TagAppearance.Selectable` is the filter chip of the 2.0 design: no rim and no
30
+ * fill until it is selected, one hover tint shared by both states, and the state
31
+ * carried on `aria-pressed` rather than by the tint alone. Give it an `onClick` —
32
+ * a selectable tag that cannot be activated is a colour and nothing else.
33
+ *
27
34
  * @example
28
35
  * ```tsx
29
36
  * <Tag label="TypeScript" />
30
37
  * <Tag label="TypeScript" closable onRemove={() => remove('TypeScript')} />
31
38
  * <Tag label="Drafts" selected onClick={() => toggle('Drafts')} />
39
+ * <Tag
40
+ * label="Drafts"
41
+ * appearance={TagAppearance.Selectable}
42
+ * selected={isSelected}
43
+ * onClick={() => toggle('Drafts')}
44
+ * />
32
45
  * ```
33
46
  *
34
47
  * @param label - Text content displayed inside the tag.
35
48
  * @param [icon] - Icon rendered before the label.
36
49
  * @param [size=ElementSize.Standard] - Tag height: standard is 24px, small is 20px.
50
+ * @param [appearance=TagAppearance.Outlined] - `outlined` is the bordered chip; `selectable`
51
+ * is the borderless filter chip that tints when selected.
37
52
  * @param [selected=false] - Applies the accent-tinted selected styling.
38
53
  * @param [disabled=false] - Dims the tag and suppresses the remove control and click handling.
39
54
  * @param [closable=false] - Renders the remove button. Needs `onRemove` to appear.
@@ -21,5 +21,10 @@ export declare const arrowClassName = "fill-control-inverted";
21
21
  /**
22
22
  * Tooltips sit above popups, dropdowns and the calendar (all `z-[53]`), since
23
23
  * they can be triggered by a control inside one of them.
24
+ *
25
+ * `max-w-[376px]` is the cap the design puts on a tooltip: at `dial-small-text`
26
+ * that is around 60 characters a line, past which a line stops being
27
+ * comfortable to read. Longer text wraps instead of widening the bubble. The
28
+ * width stays a literal because Tailwind only sees static class strings.
24
29
  */
25
- export declare const tooltipClassName = "z-[55] max-w-[300px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted";
30
+ export declare const tooltipClassName = "z-[55] max-w-[376px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted";
@@ -17,8 +17,17 @@ export declare const overlaySubMenuClassName: string;
17
17
  * reached by keyboard, and the 1.0 versions suppressed the ring outright.
18
18
  */
19
19
  export declare const overlayItemClassName: string;
20
- /** Tint marking the row that is currently selected. */
21
- export declare const overlayItemSelectedClassName = "bg-control-accent-alpha-hover";
22
- export declare const overlayItemDisabledClassName = "text-secondary";
20
+ /**
21
+ * Tint marking the row that is currently selected, at rest: the faint step of
22
+ * the accent-alpha ramp, so hovering a selected row still has somewhere to go.
23
+ */
24
+ export declare const overlayItemSelectedClassName = "bg-control-accent-alpha";
25
+ /**
26
+ * A row that cannot be chosen. `overlayItemClassName` tints every row on hover
27
+ * and a selected row carries a tint at rest, so both have to be turned off
28
+ * again here — `mergeClasses` is tailwind-merge, so these later declarations
29
+ * win as long as the disabled classes are merged after the selected ones.
30
+ */
31
+ export declare const overlayItemDisabledClassName: string;
23
32
  /** Distance between the trigger and its panel, and between nested panels. */
24
33
  export declare const overlayGap = 4;
@@ -202,8 +202,14 @@ export { Switch } from './components/New/Switch/Switch';
202
202
  export type { SwitchProps } from './components/New/Switch/Switch';
203
203
  export { Radio } from './components/New/Radio/Radio';
204
204
  export type { RadioProps } from './components/New/Radio/Radio';
205
+ export { RadioGroup } from './components/New/RadioGroup/RadioGroup';
206
+ export type { RadioGroupProps, RadioGroupItem, } from './components/New/RadioGroup/RadioGroup';
207
+ export { RadioGroupPopupField } from './components/New/RadioGroupPopupField/RadioGroupPopupField';
208
+ export type { RadioGroupPopupFieldProps } from './components/New/RadioGroupPopupField/RadioGroupPopupField';
205
209
  export { Checkbox } from './components/New/Checkbox/Checkbox';
206
210
  export type { CheckboxProps } from './components/New/Checkbox/Checkbox';
211
+ export { CheckboxBox } from './components/New/Checkbox/CheckboxBox';
212
+ export type { CheckboxBoxProps } from './components/New/Checkbox/CheckboxBox';
207
213
  export { ToggleIconButton } from './components/New/ToggleIconButton/ToggleIconButton';
208
214
  export type { ToggleIconButtonProps } from './components/New/ToggleIconButton/ToggleIconButton';
209
215
  export { SegmentedControl } from './components/New/SegmentedControl/SegmentedControl';
@@ -214,6 +220,7 @@ export { FileDropzone } from './components/New/FileDropzone/FileDropzone';
214
220
  export type { FileDropzoneProps } from './components/New/FileDropzone/FileDropzone';
215
221
  export { Tag } from './components/New/Tag/Tag';
216
222
  export type { TagProps } from './components/New/Tag/Tag';
223
+ export { TagAppearance } from './types/tag';
217
224
  export { TagInput } from './components/New/TagInput/TagInput';
218
225
  export type { TagInputProps } from './components/New/TagInput/TagInput';
219
226
  export { Search } from './components/New/Search/Search';
@@ -15,6 +15,16 @@ export interface DropdownItem {
15
15
  icon?: ReactNode;
16
16
  disabled?: boolean;
17
17
  danger?: boolean;
18
+ /**
19
+ * Renders the item as a multiselect row: a checkbox box before the label, the
20
+ * accent tint while checked, and a click that leaves the menu open. The row is
21
+ * a `menuitemcheckbox` whose state lives on `aria-checked`; the box itself is
22
+ * decorative. Keep `checked` in your own state and update it from the item's
23
+ * `onClick` (or the dropdown's `onItemClick`).
24
+ */
25
+ selectable?: boolean;
26
+ /** Whether a `selectable` item is currently checked. */
27
+ checked?: boolean;
18
28
  type?: DropdownItemType;
19
29
  className?: string;
20
30
  onClick?: (info: {
@@ -0,0 +1,4 @@
1
+ export declare enum TagAppearance {
2
+ Outlined = "outlined",
3
+ Selectable = "selectable"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.14.0-dev.3",
3
+ "version": "0.14.0-dev.5",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",