@epam/ai-dial-ui-kit 0.13.0-dev.59 → 0.13.0-dev.61

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 (27) hide show
  1. package/dist/CHANGELOG.md +6 -0
  2. package/dist/{JsonEditor-DPQ_6Rk7.cjs → JsonEditor-VxKP6FMq.cjs} +1 -1
  3. package/dist/{JsonEditor-CV2FUqAs.js → JsonEditor-oVyN8mBH.js} +1 -1
  4. package/dist/{MarkdownEditor-CfnRGBST.js → MarkdownEditor-DK6yZsKo.js} +15 -15
  5. package/dist/{MarkdownEditor-BEjYBI-4.cjs → MarkdownEditor-DX802wRs.cjs} +1 -1
  6. package/dist/{MarkdownEditor-DT_WX1cP.js → MarkdownEditor-Dff9kVc8.js} +1 -1
  7. package/dist/{MarkdownEditor-BpG28sAL.cjs → MarkdownEditor-GOvwGJ9y.cjs} +1 -1
  8. package/dist/components-manifest.json +83 -66
  9. package/dist/dial-ui-kit.cjs.js +1 -1
  10. package/dist/dial-ui-kit.es.js +126 -127
  11. package/dist/{index-qU5tP4t0.js → index-BU5Qz5JM.js} +6176 -6161
  12. package/dist/{index-EGRzQwVW.cjs → index-CTC4NNdx.cjs} +27 -27
  13. package/dist/index.css +2 -2
  14. package/dist/migration-guides/0.13.0/field-label-props-unification.md +94 -0
  15. package/dist/migration-guides/0.13.0/progress-bar-2-0-rewrite.md +103 -0
  16. package/dist/migration-guides/README.md +2 -0
  17. package/dist/src/components/New/Calendar/Calendar.d.ts +4 -2
  18. package/dist/src/components/New/FileDropzone/FileDropzone.d.ts +9 -0
  19. package/dist/src/components/New/MarkdownEditor/constants.d.ts +6 -1
  20. package/dist/src/components/New/Popup/Popup.d.ts +1 -1
  21. package/dist/src/components/New/Switch/Switch.d.ts +11 -5
  22. package/dist/src/components/Popup/Popup.d.ts +1 -1
  23. package/dist/src/components/ProgressBar/ProgressBar.d.ts +49 -11
  24. package/dist/src/index.d.ts +2 -2
  25. package/dist/src/models/dropdown.d.ts +27 -0
  26. package/dist/src/utils/sub-menu-floating.d.ts +8 -1
  27. package/package.json +1 -1
@@ -67,6 +67,6 @@ export interface PopupProps {
67
67
  * @param [hideClose=false] - Whether the close button is hidden in the header
68
68
  * @param [closeAriaLabel="Close dialog"] - Accessible name of the close button
69
69
  * @param [closeOnOutsideClick=true] - Whether the popup closes when clicking outside
70
- * @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile
70
+ * @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile. Redundant since the default focuses the dialog container, which never raises the keyboard; kept for compatibility
71
71
  */
72
72
  export declare const Popup: FC<PopupProps>;
@@ -1,7 +1,8 @@
1
- import { FC, InputHTMLAttributes, ReactNode } from 'react';
1
+ import { FC, InputHTMLAttributes } from 'react';
2
+ import { LabelProps } from '../Label/Label';
2
3
  type NativeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'onChange' | 'size'>;
3
4
  export interface SwitchProps extends NativeInputProps {
4
- label?: ReactNode;
5
+ labelProps?: LabelProps;
5
6
  isOn?: boolean;
6
7
  disabled?: boolean;
7
8
  onChange?: (value: boolean) => void;
@@ -16,17 +17,22 @@ export interface SwitchProps extends NativeInputProps {
16
17
  * ```tsx
17
18
  * <Switch
18
19
  * id="notifications"
19
- * label="Active"
20
+ * labelProps={{ label: 'Active' }}
20
21
  * isOn={isActive}
21
22
  * onChange={setIsActive}
22
23
  * />
23
24
  * ```
24
25
  *
25
- * @param [label] - Visible label rendered next to the control
26
+ * The track and the label text are two sibling `<label for>` elements rather
27
+ * than one wrapper, so the {@link Label} keeps its own `required` marker and
28
+ * `caption` info button — a button nested in a label forwards its clicks to the
29
+ * labelled control. Clicking either one still toggles the switch.
30
+ *
31
+ * @param [labelProps] - Props of the {@link Label} rendered next to the control
26
32
  * @param [isOn=false] - The current value of the switch
27
33
  * @param [disabled=false] - Whether the switch is disabled
28
34
  * @param [onChange] - Callback fired with the new value when toggled
29
- * @param [caption] - Caption text rendered below the label
35
+ * @param [caption] - Caption text rendered below the label, and described by the switch
30
36
  */
31
37
  export declare const Switch: FC<SwitchProps>;
32
38
  export {};
@@ -59,6 +59,6 @@ export interface DialPopupProps {
59
59
  * @param [size=PopupSize.Md] - Sets the max-width of the popup
60
60
  * @param [hideClose=false] Whether the close button is hidden in the header (default: false)
61
61
  * @param [closeOnOutsideClick=true] - Whether the popup closes when clicking outside (default: true)
62
- * @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile
62
+ * @param [preventKeyboardOnOpen=false] - When true, initial focus goes to a non-input guard to avoid opening the virtual keyboard on mobile. Redundant since the default focuses the dialog container, which never raises the keyboard; kept for compatibility
63
63
  */
64
64
  export declare const DialPopup: FC<DialPopupProps>;
@@ -1,16 +1,54 @@
1
- import { FC } from 'react';
2
- export declare enum DialProgressBarSize {
3
- Small = "sm",
4
- Medium = "md"
5
- }
6
- export interface DialProgressBarProps {
1
+ import { FC, HTMLAttributes, ReactNode } from 'react';
2
+ import { LabelProps } from '../New/Label/Label';
3
+ import { ElementSize } from '../../types/size';
4
+ type NativeProgressBarProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
5
+ export interface ProgressBarProps extends NativeProgressBarProps {
7
6
  value: number;
8
7
  max?: number;
9
- size?: DialProgressBarSize;
10
- className?: string;
11
- ariaLabel?: string;
8
+ size?: ElementSize;
9
+ labelProps?: LabelProps;
10
+ valueLabel?: ReactNode;
12
11
  }
13
12
  /**
14
- * Design system 1.0
13
+ * A horizontal bar indicating progress toward a goal.
14
+ * aliases: Progress|LoadingBar|Meter
15
+ * Design system 2.0
16
+ *
17
+ * Names itself from `labelProps.label` through `aria-labelledby`; without one it
18
+ * falls back to `aria-label`, and finally to `Progress` so the bar is never
19
+ * anonymous. Prefer a real label — several bars all announcing "Progress" tell a
20
+ * screen reader user nothing about which is which.
21
+ *
22
+ * Screen readers derive the announced percentage from the value and `max`. When
23
+ * the raw numbers are more useful than a percentage, pass `aria-valuetext`
24
+ * (e.g. `"3 of 10 files"`); it goes straight through to the element.
25
+ *
26
+ * `valueLabel` renders a readout at the end of the label row. Formatting stays
27
+ * with the caller — the bar has no way to know how many decimals or which unit
28
+ * a given quantity deserves. It does not name the bar, so pair it with a
29
+ * matching `aria-valuetext` to have the same reading announced.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * <ProgressBar value={40} labelProps={{ label: 'Uploading' }} />
34
+ * <ProgressBar value={3} max={10} aria-valuetext="3 of 10 files" />
35
+ * <ProgressBar value={80} size={ElementSize.Small} />
36
+ *
37
+ * <ProgressBar
38
+ * value={3.313182}
39
+ * max={500}
40
+ * labelProps={{ label: 'Cost per month', caption: 'Billed monthly' }}
41
+ * valueLabel="3.31 / 500"
42
+ * aria-valuetext="3.31 of 500"
43
+ * />
44
+ * ```
45
+ *
46
+ * @param value - Current progress. Clamped into `0…max`.
47
+ * @param [max=100] - Value that counts as complete.
48
+ * @param [size=ElementSize.Standard] - Bar height: standard is 8px, small is 4px.
49
+ * @param [labelProps] - Props of the {@link Label} rendered above the bar, which also names it.
50
+ * @param [valueLabel] - Readout rendered at the end of the label row.
51
+ * @param [className] - Additional classes on the track element.
15
52
  */
16
- export declare const DialProgressBar: FC<DialProgressBarProps>;
53
+ export declare const ProgressBar: FC<ProgressBarProps>;
54
+ export {};
@@ -21,8 +21,8 @@ export type { DialNotificationProps } from './components/Notification/Notificati
21
21
  export { DialLoader } from './components/Loader/Loader';
22
22
  export { Spinner } from './components/Spinner/Spinner';
23
23
  export type { SpinnerProps } from './components/Spinner/Spinner';
24
- export { DialProgressBar, DialProgressBarSize, } from './components/ProgressBar/ProgressBar';
25
- export type { DialProgressBarProps } from './components/ProgressBar/ProgressBar';
24
+ export { ProgressBar } from './components/ProgressBar/ProgressBar';
25
+ export type { ProgressBarProps } from './components/ProgressBar/ProgressBar';
26
26
  export { DialPagination } from './components/Pagination/Pagination';
27
27
  export type { DialPaginationProps } from './components/Pagination/Pagination';
28
28
  export { DialCheckbox } from './components/Checkbox/Checkbox';
@@ -1,5 +1,14 @@
1
1
  import { DropdownItemType } from '../types/dropdown';
2
2
  import { ReactNode, MouseEvent } from 'react';
3
+ export interface DropdownSubMenuHoverOptions {
4
+ /** Delay (ms) before the submenu opens/closes on hover. Defaults to `{ open: 80, close: 80 }`. */
5
+ delay?: number | {
6
+ open?: number;
7
+ close?: number;
8
+ };
9
+ /** Whether pointer movement (not just rest) can trigger the hover open. Defaults to `false`. */
10
+ move?: boolean;
11
+ }
3
12
  export interface DropdownItem {
4
13
  key: string;
5
14
  label?: ReactNode;
@@ -13,4 +22,22 @@ export interface DropdownItem {
13
22
  domEvent: MouseEvent;
14
23
  }) => void;
15
24
  children?: DropdownItem[];
25
+ /** Content rendered above the children list in this item's submenu panel. */
26
+ menuHeader?: ReactNode | (() => ReactNode);
27
+ /** Content rendered below the children list in this item's submenu panel. */
28
+ menuFooter?: ReactNode | (() => ReactNode);
29
+ /**
30
+ * Fully replaces the submenu panel content (children/menuHeader/menuFooter are ignored).
31
+ * Use this to show a custom popup — e.g. a preview or a picker — instead of a plain item list.
32
+ */
33
+ renderSubMenu?: () => ReactNode;
34
+ /**
35
+ * Replaces this item's icon + label content while keeping its button element, click
36
+ * handling, and (for a submenu trigger) the caret intact. Use this for lighter-weight
37
+ * customization — e.g. a badge or avatar next to the label — without giving up the
38
+ * default row/list wiring the way `renderSubMenu` does.
39
+ */
40
+ renderItem?: (item: DropdownItem) => ReactNode;
41
+ /** Overrides the default hover-open behavior of this item's submenu. */
42
+ subMenuHoverOptions?: DropdownSubMenuHoverOptions;
16
43
  }
@@ -1,9 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
+ export interface SubMenuHoverOptions {
3
+ delay?: number | {
4
+ open?: number;
5
+ close?: number;
6
+ };
7
+ move?: boolean;
8
+ }
2
9
  /**
3
10
  * Shared floating state for right-side submenus.
4
11
  * Handles open state, Floating UI positioning and hover/dismiss/role interactions.
5
12
  */
6
- export declare function useSubMenuFloating(gap: number, ariaRole?: 'menu' | 'listbox', disabled?: boolean): {
13
+ export declare function useSubMenuFloating(gap: number, ariaRole?: 'menu' | 'listbox', disabled?: boolean, hoverOptions?: SubMenuHoverOptions): {
7
14
  isOpen: boolean;
8
15
  refs: {
9
16
  reference: import('react').MutableRefObject<import('@floating-ui/react-dom').ReferenceType | null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-ui-kit",
3
- "version": "0.13.0-dev.59",
3
+ "version": "0.13.0-dev.61",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",