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

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.
@@ -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';
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.60",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A modern UI kit for building AI DIAL interfaces with React",