@epam/ai-dial-ui-kit 0.14.0-dev.4 → 0.14.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.
Files changed (34) hide show
  1. package/README.md +1 -0
  2. package/dist/CHANGELOG.md +10 -0
  3. package/dist/{JsonEditor-CFkmn69x.js → JsonEditor-CQmVvyc3.js} +1 -1
  4. package/dist/{JsonEditor-CPk58Te4.cjs → JsonEditor-DpV8EJsP.cjs} +1 -1
  5. package/dist/{MarkdownEditor-ALJ17x82.js → MarkdownEditor-ByqdCRg9.js} +1 -1
  6. package/dist/{MarkdownEditor-CqMQgd-3.js → MarkdownEditor-CCsi7d4R.js} +1 -1
  7. package/dist/{MarkdownEditor-DgPlyntV.cjs → MarkdownEditor-CIH1ew3u.cjs} +1 -1
  8. package/dist/{MarkdownEditor-Cz2HKRcy.cjs → MarkdownEditor-Dk2ErWQK.cjs} +1 -1
  9. package/dist/components-manifest.json +155 -16
  10. package/dist/dial-ui-kit.cjs.js +1 -1
  11. package/dist/dial-ui-kit.es.js +198 -196
  12. package/dist/{index-BnqboA_3.js → index-CdkIstBB.js} +7811 -7742
  13. package/dist/{index-CBaBO6e_.cjs → index-DQfKTiXa.cjs} +30 -30
  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/0.14.0/tag-single-size.md +121 -0
  18. package/dist/migration-guides/README.md +3 -0
  19. package/dist/src/components/New/Button/Button.d.ts +4 -3
  20. package/dist/src/components/New/Checkbox/Checkbox.d.ts +4 -0
  21. package/dist/src/components/New/Checkbox/CheckboxBox.d.ts +30 -0
  22. package/dist/src/components/New/Dropdown/constants.d.ts +2 -0
  23. package/dist/src/components/New/IconButton/IconButton.d.ts +4 -4
  24. package/dist/src/components/New/Popup/Popup.d.ts +48 -9
  25. package/dist/src/components/New/Popup/constants.d.ts +7 -0
  26. package/dist/src/components/New/Select/constants.d.ts +2 -2
  27. package/dist/src/components/New/Tag/Tag.d.ts +26 -4
  28. package/dist/src/components/New/Tag/constants.d.ts +23 -0
  29. package/dist/src/components/New/Tooltip/constants.d.ts +6 -1
  30. package/dist/src/components/New/constants/overlay.d.ts +12 -3
  31. package/dist/src/index.d.ts +3 -0
  32. package/dist/src/models/dropdown.d.ts +10 -0
  33. package/dist/src/types/tag.d.ts +4 -0
  34. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { FC, MouseEvent, ReactNode } from 'react';
2
+ import { ButtonProps } from '../Button/Button';
2
3
  import { PopupSize } from '../../../types/popup';
3
4
  export interface PopupProps {
4
5
  open?: boolean;
@@ -13,7 +14,16 @@ export interface PopupProps {
13
14
  bodyClassName?: string;
14
15
  children?: ReactNode;
15
16
  footer?: ReactNode;
17
+ footerClassName?: string;
16
18
  onClose?: (e?: MouseEvent<HTMLButtonElement> | null) => void;
19
+ onBack?: (e: MouseEvent<HTMLButtonElement>) => void;
20
+ backAriaLabel?: string;
21
+ headerActions?: ReactNode;
22
+ headerDivider?: boolean;
23
+ mainButtons?: ButtonProps[];
24
+ additionalButtons?: ButtonProps[];
25
+ additionalButtonsOnLeft?: boolean;
26
+ footerDivider?: boolean;
17
27
  size?: PopupSize;
18
28
  hideClose?: boolean;
19
29
  closeAriaLabel?: string;
@@ -27,8 +37,18 @@ export interface PopupProps {
27
37
  *
28
38
  * Renders in a portal with a scrim overlay, focus management, a header with the
29
39
  * title and close control, a scrollable body and an optional footer. Sections
30
- * are separated by spacing rather than rules; add your own through
31
- * `headerClassName` or the footer node if a surface needs them.
40
+ * are separated by spacing rather than rules; opt into a rule with
41
+ * `headerDivider` / `footerDivider`.
42
+ *
43
+ * The header grows from the title alone: `onBack` prepends a back control,
44
+ * `headerActions` sits between the title and the close button.
45
+ *
46
+ * The footer is declared as data, not markup: `mainButtons` and
47
+ * `additionalButtons` take {@link ButtonProps} and the popup renders the
48
+ * {@link Button}s itself, so spacing, order and the neutral default are the
49
+ * same on every dialog. `additionalButtonsOnLeft` moves the secondary group to
50
+ * the opposite edge. A `footer` node still wins over both, for the rare surface
51
+ * that needs something other than a row of buttons.
32
52
  *
33
53
  * A string `header` names the dialog automatically. A `header` node cannot —
34
54
  * pass `ariaLabel` in that case, or the dialog opens unnamed.
@@ -39,12 +59,22 @@ export interface PopupProps {
39
59
  * open
40
60
  * header="Title"
41
61
  * size={PopupSize.Md}
42
- * footer={
43
- * <div className="flex justify-end gap-2 px-6 py-4">
44
- * <NeutralButton label="Cancel" />
45
- * <PrimaryButton label="Confirm" />
46
- * </div>
47
- * }
62
+ * onBack={() => setStep(step - 1)}
63
+ * headerActions={<InfoButton caption="What is this?" />}
64
+ * additionalButtonsOnLeft
65
+ * additionalButtons={[
66
+ * {
67
+ * label: 'Back',
68
+ * variant: ButtonVariant.Primary,
69
+ * appearance: ButtonAppearance.Link,
70
+ * iconBefore: <IconArrowLeft />,
71
+ * onClick: goBack,
72
+ * },
73
+ * ]}
74
+ * mainButtons={[
75
+ * { label: 'Cancel', onClick: () => setOpen(false) },
76
+ * { label: 'Confirm', variant: ButtonVariant.Primary, onClick: submit },
77
+ * ]}
48
78
  * onClose={() => setOpen(false)}
49
79
  * >
50
80
  * <div className="px-6 py-4">Dialog content goes here…</div>
@@ -61,7 +91,16 @@ export interface PopupProps {
61
91
  * @param [headerClassName] - Additional CSS classes applied to the popup header container
62
92
  * @param [bodyClassName] - Additional CSS classes applied to the scrollable body wrapper around `children`
63
93
  * @param [children] - Body content
64
- * @param [footer] - Footer area for actions
94
+ * @param [footer] - Custom footer node; overrides `mainButtons` and `additionalButtons`
95
+ * @param [footerClassName] - Additional CSS classes applied to the built-in footer container
96
+ * @param [onBack] - Callback for the header back button; the button renders only when set
97
+ * @param [backAriaLabel="Back"] - Accessible name of the back button
98
+ * @param [headerActions] - Controls rendered between the title and the close button
99
+ * @param [headerDivider=false] - Whether a rule is drawn under the header
100
+ * @param [mainButtons] - Primary footer buttons, aligned to the trailing edge; each defaults to `ButtonVariant.Neutral`
101
+ * @param [additionalButtons] - Secondary footer buttons, next to `mainButtons` unless moved left
102
+ * @param [additionalButtonsOnLeft=false] - Whether `additionalButtons` sit on the leading edge
103
+ * @param [footerDivider=false] - Whether a rule is drawn above the footer
65
104
  * @param [onClose] - Callback fired when the popup requests to close
66
105
  * @param [size=PopupSize.Md] - Sets the max-width of the popup
67
106
  * @param [hideClose=false] - Whether the close button is hidden in the header
@@ -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.
@@ -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,10 @@
1
1
  import { FC, HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
- import { ElementSize } from '../../../types/size';
2
+ import { TagAppearance } from '../../../types/tag';
3
3
  type NativeTagProps = Omit<HTMLAttributes<HTMLSpanElement>, 'children'>;
4
4
  export interface TagProps extends NativeTagProps {
5
5
  label: string;
6
6
  icon?: ReactNode;
7
- size?: ElementSize;
7
+ appearance?: TagAppearance;
8
8
  selected?: boolean;
9
9
  disabled?: boolean;
10
10
  closable?: boolean;
@@ -16,6 +16,10 @@ export interface TagProps extends NativeTagProps {
16
16
  * aliases: Chip|Pill
17
17
  * Design system 2.0
18
18
  *
19
+ * The tag has one height — the 32px pill of the 2.0 design. There is no `size`
20
+ * prop: a tag sizes itself, and a caller that needs a different height is
21
+ * usually reaching for a button.
22
+ *
19
23
  * The label truncates rather than wrapping, and carries a native `title` so the
20
24
  * full text stays reachable when it does.
21
25
  *
@@ -24,18 +28,36 @@ export interface TagProps extends NativeTagProps {
24
28
  * the caller: a clickable tag that is also closable gives a screen reader two
25
29
  * actions with no way to tell which one it landed on.
26
30
  *
31
+ * No tag draws a rim; the two appearances are told apart by their fill.
32
+ * `TagAppearance.Selectable` is the filter chip of the 2.0 design: no fill
33
+ * at all until it is selected, one hover tint shared by both states, a semibold
34
+ * label once selected, and the state carried on `aria-pressed` rather than by
35
+ * the tint alone. Give it an `onClick` — a selectable tag that cannot be
36
+ * activated is a colour and nothing else.
37
+ *
38
+ * Selecting one therefore changes its width by the difference between the
39
+ * regular and semibold label. In a wrapping filter row that is what the design
40
+ * asks for; if a fixed width matters, give the chip one.
41
+ *
27
42
  * @example
28
43
  * ```tsx
29
44
  * <Tag label="TypeScript" />
30
45
  * <Tag label="TypeScript" closable onRemove={() => remove('TypeScript')} />
31
46
  * <Tag label="Drafts" selected onClick={() => toggle('Drafts')} />
47
+ * <Tag
48
+ * label="Drafts"
49
+ * appearance={TagAppearance.Selectable}
50
+ * selected={isSelected}
51
+ * onClick={() => toggle('Drafts')}
52
+ * />
32
53
  * ```
33
54
  *
34
55
  * @param label - Text content displayed inside the tag.
35
56
  * @param [icon] - Icon rendered before the label.
36
- * @param [size=ElementSize.Standard] - Tag height: standard is 24px, small is 20px.
57
+ * @param [appearance=TagAppearance.Outlined] - `outlined` is the filled chip on the raised
58
+ * layer; `selectable` is the unfilled filter chip that tints and turns semibold when selected.
37
59
  * @param [selected=false] - Applies the accent-tinted selected styling.
38
- * @param [disabled=false] - Dims the tag and suppresses the remove control and click handling.
60
+ * @param [disabled=false] - Stops the tag responding: no click handling, no remove control. The design defines no disabled tag, so the colours stay put.
39
61
  * @param [closable=false] - Renders the remove button. Needs `onRemove` to appear.
40
62
  * @param [removeLabel] - Accessible name of the remove button; defaults to `Remove <label>`.
41
63
  * @param [onRemove] - Called when the remove button is clicked. The click does not bubble to `onClick`.
@@ -0,0 +1,23 @@
1
+ import { TagAppearance } from '../../../types/tag';
2
+ /**
3
+ * Geometry and layout shared by every tag. No transition: the design animates
4
+ * the hover and selected steps instantly (0ms), so the fill switches on the
5
+ * same frame as the pointer.
6
+ */
7
+ export declare const tagBaseClassName = "inline-flex h-[32px] max-w-full items-center gap-1 rounded-full px-3";
8
+ /**
9
+ * Fill and text colour per appearance and selection. No tag draws a rim: the
10
+ * two appearances are told apart by their fill — `outlined` sits on the raised
11
+ * layer, `selectable` on nothing until it is selected, where it also steps its
12
+ * label up from secondary to primary.
13
+ */
14
+ export declare const tagStateClassNames: Record<TagAppearance, Record<'default' | 'selected', string>>;
15
+ /** Cursor and focus ring of a tag that can be activated. */
16
+ export declare const tagInteractiveClassName = "cursor-pointer outline-offset-0 focus-visible:outline focus-visible:outline-focus";
17
+ /**
18
+ * Hover and active step of a clickable tag — one accent tint for every
19
+ * appearance and both selections, as the 2.0 overlay rows do. A selected tag
20
+ * must not read as hovered at rest, and the label is left alone, so an
21
+ * unselected one never darkens into looking selected.
22
+ */
23
+ export declare const tagHoverClassName = "hover:bg-control-accent-alpha-hover active:bg-control-accent-alpha-active";
@@ -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;
@@ -208,6 +208,8 @@ export { RadioGroupPopupField } from './components/New/RadioGroupPopupField/Radi
208
208
  export type { RadioGroupPopupFieldProps } from './components/New/RadioGroupPopupField/RadioGroupPopupField';
209
209
  export { Checkbox } from './components/New/Checkbox/Checkbox';
210
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';
211
213
  export { ToggleIconButton } from './components/New/ToggleIconButton/ToggleIconButton';
212
214
  export type { ToggleIconButtonProps } from './components/New/ToggleIconButton/ToggleIconButton';
213
215
  export { SegmentedControl } from './components/New/SegmentedControl/SegmentedControl';
@@ -218,6 +220,7 @@ export { FileDropzone } from './components/New/FileDropzone/FileDropzone';
218
220
  export type { FileDropzoneProps } from './components/New/FileDropzone/FileDropzone';
219
221
  export { Tag } from './components/New/Tag/Tag';
220
222
  export type { TagProps } from './components/New/Tag/Tag';
223
+ export { TagAppearance } from './types/tag';
221
224
  export { TagInput } from './components/New/TagInput/TagInput';
222
225
  export type { TagInputProps } from './components/New/TagInput/TagInput';
223
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.4",
3
+ "version": "0.14.0-dev.6",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",