@epam/ai-dial-ui-kit 0.16.0-dev.54 → 0.16.0-dev.56
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.
- package/README.md +3 -0
- package/dist/CHANGELOG.md +14 -0
- package/dist/{DateCellRenderer-CPl27YD9.cjs → DateCellRenderer-weXr7pb2.cjs} +28 -28
- package/dist/{MarkdownEditor-BtLY7OVq.cjs → MarkdownEditor-B-x8Ntfe.cjs} +1 -1
- package/dist/components/New/CaptionText/CaptionText.js +31 -25
- package/dist/components/New/Dropdown/Dropdown.js +204 -195
- package/dist/components/New/LiveRegion/LiveRegion.js +33 -0
- package/dist/components/New/Notification/Notification.js +51 -40
- package/dist/components/New/Notification/constants.js +26 -17
- package/dist/components/New/ToggleChip/ToggleChip.js +54 -0
- package/dist/components/New/ToggleChip/constants.js +11 -0
- package/dist/components/ProgressBar/ProgressBar.js +43 -38
- package/dist/components-manifest.json +230 -13
- package/dist/constants/public-class-names.js +7 -0
- package/dist/dial-ui-kit.cjs +3 -3
- package/dist/dial-ui-kit.js +378 -367
- package/dist/editors.cjs +1 -1
- package/dist/grid.cjs +1 -1
- package/dist/{icon-D93YIwGJ.cjs → icon-4D9xu6E_.cjs} +1 -1
- package/dist/index.css +1 -1
- package/dist/src/components/New/CaptionText/CaptionText.d.ts +21 -6
- package/dist/src/components/New/Dropdown/Dropdown.d.ts +53 -1
- package/dist/src/components/New/LiveRegion/LiveRegion.d.ts +58 -0
- package/dist/src/components/New/Notification/Notification.d.ts +21 -2
- package/dist/src/components/New/Notification/constants.d.ts +11 -0
- package/dist/src/components/New/ToggleChip/ToggleChip.d.ts +70 -0
- package/dist/src/components/New/ToggleChip/constants.d.ts +12 -0
- package/dist/src/components/ProgressBar/ProgressBar.d.ts +23 -3
- package/dist/src/constants/public-class-names.d.ts +7 -0
- package/dist/src/index.d.ts +8 -2
- package/dist/src/types/dropdown.d.ts +16 -0
- package/dist/src/types/live-region.d.ts +17 -0
- package/dist/src/types/notification.d.ts +11 -0
- package/dist/src/types/progress-bar.d.ts +13 -0
- package/dist/types/dropdown.js +5 -4
- package/dist/types/live-region.js +5 -0
- package/dist/types/notification.js +3 -2
- package/dist/types/progress-bar.js +4 -0
- package/dist/utils/merge-classes.js +11 -8
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { LiveRegionElement, LiveRegionPoliteness } from '../../../types/live-region';
|
|
3
|
+
export interface LiveRegionProps extends Omit<HTMLAttributes<HTMLElement>, 'role' | 'aria-live' | 'aria-atomic'> {
|
|
4
|
+
/**
|
|
5
|
+
* How urgently the change is read. `Polite` (default) renders
|
|
6
|
+
* `role="status"` + `aria-live="polite"`; `Assertive` renders
|
|
7
|
+
* `role="alert"` + `aria-live="assertive"`.
|
|
8
|
+
*/
|
|
9
|
+
politeness?: LiveRegionPoliteness;
|
|
10
|
+
/** Hide the region visually while keeping it readable by assistive tech (`sr-only`). */
|
|
11
|
+
visuallyHidden?: boolean;
|
|
12
|
+
/** Sets `aria-atomic`: read the whole region, not only the changed node, on each change. */
|
|
13
|
+
atomic?: boolean;
|
|
14
|
+
/** The wrapper element. Default `LiveRegionElement.Div`; use `Span` inside inline content. */
|
|
15
|
+
as?: LiveRegionElement;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A live region that is always in the DOM, so a screen reader announces the
|
|
19
|
+
* message put into it.
|
|
20
|
+
* aliases: AriaLive|Announcer|StatusMessage|ScreenReaderAnnouncement|SrOnlyStatus
|
|
21
|
+
* Design system 2.0
|
|
22
|
+
*
|
|
23
|
+
* Screen readers announce a live region reliably only when the region already
|
|
24
|
+
* exists before its content changes; a region mounted together with its text is
|
|
25
|
+
* often read late or not at all. `LiveRegion` always renders its wrapper, even
|
|
26
|
+
* when `children` is empty, `null` or `false` — only the content changes.
|
|
27
|
+
*
|
|
28
|
+
* Use it for a message that is not attached to one control and must be heard:
|
|
29
|
+
* a failed submit, an async status ("Saved", "3 results"), an empty search.
|
|
30
|
+
* Use something else when:
|
|
31
|
+
* - the message belongs to a form field — render `ErrorText` / `CaptionText`
|
|
32
|
+
* with an `id` and point the control's `aria-describedby` at it (or pass
|
|
33
|
+
* `announce` to them when the error must also be announced);
|
|
34
|
+
* - the message is a toast or a section message — `Notification` and its
|
|
35
|
+
* wrappers are already live regions.
|
|
36
|
+
*
|
|
37
|
+
* An empty, visible region takes no layout space: while it has no child nodes
|
|
38
|
+
* it gets `sr-only` (through `empty:sr-only`) rather than `display: none`,
|
|
39
|
+
* because some screen readers drop a `display: none` node from the
|
|
40
|
+
* accessibility tree and would then miss the first message put into it.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <LiveRegion politeness={LiveRegionPoliteness.Assertive}>
|
|
45
|
+
* {submitError && <ErrorText text={submitError} />}
|
|
46
|
+
* </LiveRegion>
|
|
47
|
+
*
|
|
48
|
+
* <LiveRegion visuallyHidden>{isEmpty ? 'No results' : ''}</LiveRegion>
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @param [politeness] - `LiveRegionPoliteness.Polite` (default) or `Assertive`.
|
|
52
|
+
* @param [visuallyHidden] - Hide the region visually (`sr-only`); it is still announced.
|
|
53
|
+
* @param [atomic] - Sets `aria-atomic`.
|
|
54
|
+
* @param [as] - The wrapper element, `LiveRegionElement.Div` by default.
|
|
55
|
+
* @param [className] - Additional CSS classes for the wrapper.
|
|
56
|
+
* @param [children] - The message. May be empty; the wrapper is rendered anyway.
|
|
57
|
+
*/
|
|
58
|
+
export declare const LiveRegion: FC<LiveRegionProps>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { FC, HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { NotificationType, NotificationVariant } from '../../../types/notification';
|
|
2
|
+
import { NotificationSurface, NotificationType, NotificationVariant } from '../../../types/notification';
|
|
3
3
|
export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
4
|
variant?: NotificationVariant;
|
|
5
5
|
type?: NotificationType;
|
|
6
|
+
/**
|
|
7
|
+
* Surface the notification draws on. `NotificationSurface.Neutral` keeps the
|
|
8
|
+
* variant's icon, icon colour and live-region role but draws the neutral
|
|
9
|
+
* sunken layer (`bg-layer-sunken`) with primary text instead of the
|
|
10
|
+
* variant's coloured surface.
|
|
11
|
+
* @default NotificationSurface.Variant
|
|
12
|
+
*/
|
|
13
|
+
surface?: NotificationSurface;
|
|
6
14
|
title?: ReactNode;
|
|
7
15
|
message: ReactNode;
|
|
8
16
|
action?: ReactNode;
|
|
@@ -18,7 +26,9 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
18
26
|
* Design system 2.0
|
|
19
27
|
*
|
|
20
28
|
* Renders a colored container with an icon, message text, and an optional
|
|
21
|
-
* close button.
|
|
29
|
+
* close button. `surface={NotificationSurface.Neutral}` swaps the coloured
|
|
30
|
+
* container for the neutral sunken layer and keeps the variant's icon, icon
|
|
31
|
+
* colour and role.
|
|
22
32
|
*
|
|
23
33
|
* The container is a live region whose politeness follows the variant: `error`
|
|
24
34
|
* and `warning` use `role="alert"` (assertive, interrupts the screen reader),
|
|
@@ -60,6 +70,14 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
60
70
|
* />
|
|
61
71
|
*
|
|
62
72
|
* <Notification
|
|
73
|
+
* variant={NotificationVariant.Warning}
|
|
74
|
+
* type={NotificationType.SectionMessage}
|
|
75
|
+
* surface={NotificationSurface.Neutral}
|
|
76
|
+
* title="Log in required"
|
|
77
|
+
* message="Scheduled tasks run while you are offline."
|
|
78
|
+
* />
|
|
79
|
+
*
|
|
80
|
+
* <Notification
|
|
63
81
|
* variant={NotificationVariant.Error}
|
|
64
82
|
* type={NotificationType.SectionMessage}
|
|
65
83
|
* title="Couldn't finish this response"
|
|
@@ -78,6 +96,7 @@ export interface NotificationProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
78
96
|
*
|
|
79
97
|
* @param [variant=NotificationVariant.Info] - Defines the visual style and icon of the alert
|
|
80
98
|
* @param [type=NotificationType.Toast] - Defines the type of notification, either a toast or a section message
|
|
99
|
+
* @param [surface=NotificationSurface.Variant] - `Neutral` draws the neutral sunken surface while keeping the variant's icon, icon colour and role
|
|
81
100
|
* @param [title] - Optional heading displayed above the message in semibold
|
|
82
101
|
* @param message - Message text to display inside the alert
|
|
83
102
|
* @param [action] - Optional control (typically a small `Button`) rendered at the inline end, after the text and before the close button; the caller supplies its accessible name
|
|
@@ -5,6 +5,17 @@ export declare const variantIcons: (props: {
|
|
|
5
5
|
stroke: number;
|
|
6
6
|
}) => Record<NotificationVariant, ReactNode>;
|
|
7
7
|
export declare const notificationVariantClassNameMap: Record<NotificationVariant, string>;
|
|
8
|
+
/** Surface classes for `NotificationSurface.Neutral`, whatever the variant. */
|
|
9
|
+
export declare const notificationNeutralSurfaceClassName = "bg-layer-sunken text-primary";
|
|
10
|
+
/**
|
|
11
|
+
* Icon colour per variant on `NotificationSurface.Neutral`.
|
|
12
|
+
*
|
|
13
|
+
* On the variant surface the icon inherits the container's text colour. The
|
|
14
|
+
* neutral surface sets primary text, so the icon names its status colour
|
|
15
|
+
* itself; `warning` uses the dedicated `text-warning-icon` token, as the design
|
|
16
|
+
* does for a warning triangle outside a warning surface.
|
|
17
|
+
*/
|
|
18
|
+
export declare const notificationNeutralSurfaceIconClassNameMap: Record<NotificationVariant, string>;
|
|
8
19
|
/**
|
|
9
20
|
* Live-region role per variant.
|
|
10
21
|
*
|
|
@@ -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>;
|
|
@@ -19,6 +19,11 @@ export declare const DIAL_KIT_CLASS: {
|
|
|
19
19
|
readonly noDataContent: "dial-kit-no-data-content";
|
|
20
20
|
/** The `section` root of a `StateScreen`. */
|
|
21
21
|
readonly stateScreen: "dial-kit-state-screen";
|
|
22
|
+
/**
|
|
23
|
+
* The always-mounted wrapper of a `LiveRegion` — also the wrapper `CaptionText`
|
|
24
|
+
* and `ErrorText` render when given `announce`.
|
|
25
|
+
*/
|
|
26
|
+
readonly liveRegion: "dial-kit-live-region";
|
|
22
27
|
/** The `role="status"` panel of a `TransferQueue`: header, rows and aggregate bar. */
|
|
23
28
|
readonly transferQueue: "dial-kit-transfer-queue";
|
|
24
29
|
/** The text element of a `Highlight`, which renders the matched query. */
|
|
@@ -217,6 +222,8 @@ export declare const DIAL_KIT_CLASS: {
|
|
|
217
222
|
* already carries.
|
|
218
223
|
*/
|
|
219
224
|
readonly toggleIconButton: "dial-kit-toggle-icon-button";
|
|
225
|
+
/** The `<button aria-pressed>` of a `ToggleChip`. */
|
|
226
|
+
readonly toggleChip: "dial-kit-toggle-chip";
|
|
220
227
|
/** A `CloseButton`, additive to `dial-kit-base-icon-button`. */
|
|
221
228
|
readonly closeButton: "dial-kit-close-button";
|
|
222
229
|
/** An `InfoButton`, additive to `dial-kit-base-icon-button`. */
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -234,6 +237,9 @@ export { NoDataContent } from './components/New/NoDataContent/NoDataContent';
|
|
|
234
237
|
export type { NoDataContentProps } from './components/New/NoDataContent/NoDataContent';
|
|
235
238
|
export { StateScreen } from './components/New/StateScreen/StateScreen';
|
|
236
239
|
export type { StateScreenProps } from './components/New/StateScreen/StateScreen';
|
|
240
|
+
export { LiveRegion } from './components/New/LiveRegion/LiveRegion';
|
|
241
|
+
export type { LiveRegionProps } from './components/New/LiveRegion/LiveRegion';
|
|
242
|
+
export { LiveRegionElement, LiveRegionPoliteness } from './types/live-region';
|
|
237
243
|
export { FormSection } from './components/New/FormSection/FormSection';
|
|
238
244
|
export type { FormSectionProps, FormSectionHeadingLevel, } from './components/New/FormSection/FormSection';
|
|
239
245
|
export { FormSectionVariant } from './types/form-section';
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How urgently a `LiveRegion` asks a screen reader to read a change.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum LiveRegionPoliteness {
|
|
5
|
+
/** `role="status"` + `aria-live="polite"`: read once the user is idle, queued behind other speech. */
|
|
6
|
+
Polite = "polite",
|
|
7
|
+
/** `role="alert"` + `aria-live="assertive"`: interrupts current speech. Reserve for failures the user must act on. */
|
|
8
|
+
Assertive = "assertive"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The element a `LiveRegion` renders as its always-mounted wrapper.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum LiveRegionElement {
|
|
14
|
+
Div = "div",
|
|
15
|
+
Span = "span",
|
|
16
|
+
P = "p"
|
|
17
|
+
}
|
|
@@ -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
|
+
}
|
package/dist/types/dropdown.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
var
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
t as
|
|
3
|
+
u as DropdownItemType,
|
|
4
|
+
i as DropdownOverlayRole,
|
|
5
|
+
t as DropdownTrigger,
|
|
6
|
+
n as DropdownType
|
|
6
7
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
var
|
|
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
|
-
|
|
5
|
+
e as NotificationVariant
|
|
5
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "classnames";
|
|
2
2
|
import { extendTailwindMerge as t } from "../node_modules/tailwind-merge/dist/bundle-mjs.js";
|
|
3
|
-
const
|
|
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
|
-
],
|
|
32
|
+
], l = t({
|
|
30
33
|
extend: {
|
|
31
34
|
classGroups: {
|
|
32
35
|
z: [{ z: ["popup", "floating", "interactive-tooltip", "tooltip"] }],
|
|
33
|
-
"dial-typography":
|
|
34
|
-
(
|
|
36
|
+
"dial-typography": e.map(
|
|
37
|
+
(i) => `dial-${i}-text`
|
|
35
38
|
)
|
|
36
39
|
}
|
|
37
40
|
}
|
|
38
41
|
});
|
|
39
|
-
function
|
|
40
|
-
return
|
|
42
|
+
function p(...i) {
|
|
43
|
+
return l(a(i));
|
|
41
44
|
}
|
|
42
45
|
export {
|
|
43
|
-
|
|
46
|
+
p as mergeClasses
|
|
44
47
|
};
|