@lumx/core 4.19.1-alpha.4 → 4.19.1-alpha.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.
- package/js/components/AlertDialog/index.d.ts +2 -2
- package/js/components/Button/IconButtonStories.d.ts +1 -1
- package/js/components/Button/Stories.d.ts +1 -1
- package/js/components/Combobox/constants.d.ts +1 -0
- package/js/components/Dialog/DialogContent.d.ts +61 -0
- package/js/components/Dialog/DialogHeadingStories.d.ts +32 -0
- package/js/components/Dialog/DialogHeadingTests.d.ts +18 -0
- package/js/components/Dialog/DialogShell.d.ts +42 -0
- package/js/components/Dialog/Stories.d.ts +1 -1
- package/js/components/Dialog/constants.d.ts +24 -0
- package/js/components/Dialog/index.d.ts +4 -99
- package/js/components/Dialog/labelRegistryTests.d.ts +19 -0
- package/js/components/Dialog/types.d.ts +17 -0
- package/js/components/Heading/index.d.ts +1 -0
- package/js/components/Lightbox/index.d.ts +6 -0
- package/js/components/Menu/constants.d.ts +1 -0
- package/js/components/PopoverDialog/index.d.ts +6 -3
- package/js/components/Tabs/Tab.d.ts +0 -2
- package/js/components/Tabs/constants.d.ts +1 -0
- package/js/components/Text/index.d.ts +4 -0
- package/js/components/Toolbar/index.d.ts +2 -2
- package/js/utils/InfiniteScroll/index.d.ts +6 -2
- package/js/utils/aria/resolveAccessibleNameProps.d.ts +8 -0
- package/js/utils/idsRegistry/constants.d.ts +4 -0
- package/js/utils/idsRegistry/createIdsRegistry.d.ts +25 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Kind } from '../../constants';
|
|
2
2
|
import type { LumxClassName, JSXElement, HasClassName, CommonRef } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { DialogShellProps } from '../Dialog';
|
|
4
4
|
export interface BaseAlertDialogProps {
|
|
5
5
|
/** Message variant. */
|
|
6
6
|
kind?: Kind;
|
|
@@ -11,7 +11,7 @@ export interface BaseAlertDialogProps {
|
|
|
11
11
|
*/
|
|
12
12
|
children?: JSXElement;
|
|
13
13
|
}
|
|
14
|
-
export interface AlertDialogProps extends HasClassName, BaseAlertDialogProps, Pick<
|
|
14
|
+
export interface AlertDialogProps extends HasClassName, BaseAlertDialogProps, Pick<DialogShellProps, 'size'> {
|
|
15
15
|
/** Props forwarded to the confirm button */
|
|
16
16
|
confirmProps: any;
|
|
17
17
|
/**
|
|
@@ -169,10 +169,10 @@ export declare function setup({ component: IconButton, decorators: { withCombina
|
|
|
169
169
|
isActive?: boolean | undefined;
|
|
170
170
|
isFocused?: boolean | undefined;
|
|
171
171
|
isHovered?: boolean | undefined;
|
|
172
|
+
'aria-label'?: string | undefined;
|
|
172
173
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
|
173
174
|
'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
174
175
|
'aria-pressed'?: boolean | "false" | "mixed" | "true" | undefined;
|
|
175
|
-
'aria-label'?: string | undefined;
|
|
176
176
|
className?: string | undefined;
|
|
177
177
|
theme?: import("@lumx/core/js/constants").Theme | undefined;
|
|
178
178
|
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
@@ -243,10 +243,10 @@ export declare function setup({ component: Button, decorators: { withCombination
|
|
|
243
243
|
isActive?: boolean | undefined;
|
|
244
244
|
isFocused?: boolean | undefined;
|
|
245
245
|
isHovered?: boolean | undefined;
|
|
246
|
+
'aria-label'?: string | undefined;
|
|
246
247
|
'aria-expanded'?: boolean | "true" | "false" | undefined;
|
|
247
248
|
'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
248
249
|
'aria-pressed'?: boolean | "false" | "mixed" | "true" | undefined;
|
|
249
|
-
'aria-label'?: string | undefined;
|
|
250
250
|
className?: string | undefined;
|
|
251
251
|
theme?: Theme | undefined;
|
|
252
252
|
'aria-disabled'?: import("../../types/Booleanish").Booleanish | undefined;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { CommonRef, GenericProps, JSXElement } from '../../types';
|
|
2
|
+
import type { BaseDialogProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Component display name.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMPONENT_NAME = "DialogContent";
|
|
7
|
+
/**
|
|
8
|
+
* Props of the dialog content: the `role="dialog"` element (which carries `aria-labelledby`) and
|
|
9
|
+
* everything inside it (header, body, footer). It is meant to be rendered by a framework component
|
|
10
|
+
* that has resolved `labelId` from the ids registry.
|
|
11
|
+
*/
|
|
12
|
+
export interface DialogContentProps extends BaseDialogProps {
|
|
13
|
+
/**
|
|
14
|
+
* Id of the heading naming this dialog (read from the ids registry by the framework), applied as
|
|
15
|
+
* `aria-labelledby`. Overridden by an explicit `aria-label`/`aria-labelledby` set via `dialogProps`.
|
|
16
|
+
*/
|
|
17
|
+
labelId?: string;
|
|
18
|
+
/** Additional props for the dialog container element. */
|
|
19
|
+
dialogProps?: GenericProps;
|
|
20
|
+
/** On close callback. */
|
|
21
|
+
handleClose?(): void;
|
|
22
|
+
/** Whether to prevent closing on click away. */
|
|
23
|
+
shouldPreventCloseOnClickAway?: boolean;
|
|
24
|
+
/** Refs used for click-away detection. */
|
|
25
|
+
clickAwayRefs?: any;
|
|
26
|
+
/** Ref for the root wrapper element. */
|
|
27
|
+
rootRef?: CommonRef;
|
|
28
|
+
/** Ref for the inner section element. */
|
|
29
|
+
wrapperRef?: CommonRef;
|
|
30
|
+
/** Reference to the dialog content element. */
|
|
31
|
+
contentRef?: CommonRef;
|
|
32
|
+
/** Props forwarded from a child <header> element. */
|
|
33
|
+
headerChildProps?: GenericProps;
|
|
34
|
+
/** Content extracted from a child <header> element. */
|
|
35
|
+
headerChildContent?: JSXElement;
|
|
36
|
+
/** Whether the header sentinel is out of view (controls header divider). */
|
|
37
|
+
hasTopIntersection: boolean | null;
|
|
38
|
+
/** Dialog body content. */
|
|
39
|
+
content?: JSXElement;
|
|
40
|
+
/** Ref setter for the top scroll sentinel element. */
|
|
41
|
+
setSentinelTop?: any;
|
|
42
|
+
/** Ref setter for the bottom scroll sentinel element. */
|
|
43
|
+
setSentinelBottom?: any;
|
|
44
|
+
/** Props forwarded from a child <footer> element. */
|
|
45
|
+
footerChildProps?: GenericProps;
|
|
46
|
+
/** Content extracted from a child <footer> element. */
|
|
47
|
+
footerChildContent?: JSXElement;
|
|
48
|
+
/** Whether the footer sentinel is out of view (controls footer divider). */
|
|
49
|
+
hasBottomIntersection: boolean | null;
|
|
50
|
+
/** ProgressCircular component. */
|
|
51
|
+
ProgressCircular: any;
|
|
52
|
+
/** ClickAwayProvider component. */
|
|
53
|
+
ClickAwayProvider: any;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Dialog content: the `role="dialog"` element + header/body/footer.
|
|
57
|
+
*
|
|
58
|
+
* @param props Component props.
|
|
59
|
+
* @return React element.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DialogContent: (props: DialogContentProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Core stories for DialogHeading, shared by React and Vue.
|
|
4
|
+
*
|
|
5
|
+
* Framework-agnostic on purpose: it defines no JSX `render` and no `play`, relying on Storybook's
|
|
6
|
+
* default rendering of the injected `component` from `args`. Each framework only injects its own
|
|
7
|
+
* `DialogHeading` component.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setup({ component: DialogHeading }: SetupStoriesOptions): {
|
|
10
|
+
meta: {
|
|
11
|
+
component: any;
|
|
12
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
13
|
+
args: {
|
|
14
|
+
children: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* `DialogHeading` renders a `Heading` defaulting to the `title` typography.
|
|
19
|
+
*
|
|
20
|
+
* Rendered inside a `Dialog`, `Lightbox` or `PopoverDialog` it also names the container via
|
|
21
|
+
* `aria-labelledby` — see those components' stories for the integration.
|
|
22
|
+
*/
|
|
23
|
+
Default: {
|
|
24
|
+
args: {};
|
|
25
|
+
};
|
|
26
|
+
/** The default `title` typography can be overridden with the `typography` prop. */
|
|
27
|
+
CustomTypography: {
|
|
28
|
+
args: {
|
|
29
|
+
typography: "headline";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts a standalone DialogHeading and returns the rendered heading element.
|
|
4
|
+
*
|
|
5
|
+
* The framework-specific `render` adapter receives `{ children, ...props }` and is responsible for
|
|
6
|
+
* mounting `<DialogHeading {...props}>{children}</DialogHeading>` in its own idiom.
|
|
7
|
+
*/
|
|
8
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
9
|
+
props: any;
|
|
10
|
+
dialogHeading: HTMLElement;
|
|
11
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Shared assertions for the standalone rendering of `DialogHeading` (no enclosing container).
|
|
15
|
+
* Registry wiring lives in `labelRegistryTests`; framework-specific prop/ref forwarding stays in the
|
|
16
|
+
* per-package `commonTestsSuite`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DialogHeadingTests: (renderOptions: SetupOptions<any>) => void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CommonRef, HasClassName } from '../../types';
|
|
2
|
+
import type { DialogSizes } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Props of the outer shell: the overlay + the context providers (theme, heading level, and the
|
|
5
|
+
* internal ids registry). It renders `children` - typically a framework component that reads the
|
|
6
|
+
* registered label id and renders a `DialogContent`.
|
|
7
|
+
*/
|
|
8
|
+
export interface DialogShellProps extends HasClassName {
|
|
9
|
+
/** Reference to the root element. */
|
|
10
|
+
ref?: CommonRef;
|
|
11
|
+
/** Whether the component is open or not. */
|
|
12
|
+
isOpen?: boolean;
|
|
13
|
+
/** Whether the indefinite progress indicator is displayed (drives the loading class). */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
/** Whether the component is still visible (e.g. during close animation). */
|
|
16
|
+
isVisible?: boolean;
|
|
17
|
+
/** Size variant. */
|
|
18
|
+
size?: DialogSizes;
|
|
19
|
+
/** Z-axis position. */
|
|
20
|
+
zIndex?: number;
|
|
21
|
+
/** Content rendered inside the overlay + providers (typically a framework `DialogContent` reader). */
|
|
22
|
+
children?: any;
|
|
23
|
+
/** Portal component for rendering outside the DOM hierarchy. */
|
|
24
|
+
Portal: any;
|
|
25
|
+
/** HeadingLevelProvider component. */
|
|
26
|
+
HeadingLevelProvider: any;
|
|
27
|
+
/** ThemeProvider component. */
|
|
28
|
+
ThemeProvider: any;
|
|
29
|
+
/** Provides the ids registry so a `DialogHeading` in the subtree can be linked via `aria-labelledby`. */
|
|
30
|
+
IdsRegistryProvider: any;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Component default props.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DEFAULT_PROPS: Partial<Pick<DialogShellProps, 'size'>>;
|
|
36
|
+
/**
|
|
37
|
+
* Dialog shell: overlay + context providers (theme, heading level, ids registry).
|
|
38
|
+
*
|
|
39
|
+
* @param props Component props.
|
|
40
|
+
* @return React element.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DialogShell: (props: DialogShellProps) => import("react").JSX.Element;
|
|
@@ -19,7 +19,7 @@ export declare function setup({ component: Dialog, render, decorators: { withChr
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
decorators: ((story: any, context: any) => any)[];
|
|
22
|
-
args: Partial<import("
|
|
22
|
+
args: Partial<Pick<import("./DialogShell").DialogShellProps, "size">>;
|
|
23
23
|
argTypes: {
|
|
24
24
|
size: {
|
|
25
25
|
control: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LumxClassName } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Dialog label id key in IdsRegistry
|
|
4
|
+
*/
|
|
5
|
+
export declare const DIALOG_LABEL_KEY = "dialog-label";
|
|
6
|
+
/**
|
|
7
|
+
* Component display name.
|
|
8
|
+
*/
|
|
9
|
+
export declare const COMPONENT_NAME = "Dialog";
|
|
10
|
+
/**
|
|
11
|
+
* `DialogHeading` component display name.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DIALOG_HEADING_COMPONENT_NAME = "DialogHeading";
|
|
14
|
+
/**
|
|
15
|
+
* Component default class name and class prefix. Shared by the shell and the container modules.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
18
|
+
export declare const block: {
|
|
19
|
+
(additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
20
|
+
(modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
21
|
+
}, element: {
|
|
22
|
+
(elem: string, additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
23
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
24
|
+
};
|
|
@@ -1,99 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
footer?: JSXElement;
|
|
6
|
-
/** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
|
|
7
|
-
forceFooterDivider?: boolean;
|
|
8
|
-
/** Header content. */
|
|
9
|
-
header?: JSXElement;
|
|
10
|
-
/** Whether the divider between the dialog content and the header is always displayed (instead of showing it on scroll). */
|
|
11
|
-
forceHeaderDivider?: boolean;
|
|
12
|
-
/** Whether the indefinite progress indicator over the dialog content is displayed or not. */
|
|
13
|
-
isLoading?: boolean;
|
|
14
|
-
/** Whether the component is open or not. */
|
|
15
|
-
isOpen?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Defines the props of the component.
|
|
19
|
-
*/
|
|
20
|
-
export interface DialogProps extends HasClassName, BaseDialogProps {
|
|
21
|
-
/** Reference to the root element. */
|
|
22
|
-
ref?: CommonRef;
|
|
23
|
-
/** Whether the component is still visible (e.g. during close animation). */
|
|
24
|
-
isVisible?: boolean;
|
|
25
|
-
/** Reference to the dialog content element. */
|
|
26
|
-
contentRef?: CommonRef;
|
|
27
|
-
/** Size variant. */
|
|
28
|
-
size?: DialogSizes;
|
|
29
|
-
/** Z-axis position. */
|
|
30
|
-
zIndex?: number;
|
|
31
|
-
/** Additional props for the dialog container element. */
|
|
32
|
-
dialogProps?: GenericProps;
|
|
33
|
-
/** On close callback. */
|
|
34
|
-
handleClose?(): void;
|
|
35
|
-
/** Whether to prevent closing on click away. */
|
|
36
|
-
shouldPreventCloseOnClickAway?: boolean;
|
|
37
|
-
/** Refs used for click-away detection. */
|
|
38
|
-
clickAwayRefs?: any;
|
|
39
|
-
/** Ref for the root wrapper element. */
|
|
40
|
-
rootRef?: CommonRef;
|
|
41
|
-
/** Ref for the inner section element. */
|
|
42
|
-
wrapperRef?: CommonRef;
|
|
43
|
-
/** Whether the header sentinel is out of view (controls header divider). */
|
|
44
|
-
hasTopIntersection: boolean | null;
|
|
45
|
-
/** Whether the footer sentinel is out of view (controls footer divider). */
|
|
46
|
-
hasBottomIntersection: boolean | null;
|
|
47
|
-
/** Props forwarded from a child <header> element. */
|
|
48
|
-
headerChildProps?: GenericProps;
|
|
49
|
-
/** Content extracted from a child <header> element. */
|
|
50
|
-
headerChildContent?: JSXElement;
|
|
51
|
-
/** Props forwarded from a child <footer> element. */
|
|
52
|
-
footerChildProps?: GenericProps;
|
|
53
|
-
/** Content extracted from a child <footer> element. */
|
|
54
|
-
footerChildContent?: JSXElement;
|
|
55
|
-
/** Dialog body content. */
|
|
56
|
-
content?: JSXElement;
|
|
57
|
-
/** Ref setter for the top scroll sentinel element. */
|
|
58
|
-
setSentinelTop?: any;
|
|
59
|
-
/** Ref setter for the bottom scroll sentinel element. */
|
|
60
|
-
setSentinelBottom?: any;
|
|
61
|
-
/** Portal component for rendering outside the DOM hierarchy. */
|
|
62
|
-
Portal: any;
|
|
63
|
-
/** HeadingLevelProvider component. */
|
|
64
|
-
HeadingLevelProvider: any;
|
|
65
|
-
/** ThemeProvider component. */
|
|
66
|
-
ThemeProvider: any;
|
|
67
|
-
/** ClickAwayProvider component. */
|
|
68
|
-
ClickAwayProvider: any;
|
|
69
|
-
/** ProgressCircular component */
|
|
70
|
-
ProgressCircular: any;
|
|
71
|
-
}
|
|
72
|
-
export type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
73
|
-
/**
|
|
74
|
-
* Component display name.
|
|
75
|
-
*/
|
|
76
|
-
export declare const COMPONENT_NAME = "Dialog";
|
|
77
|
-
/**
|
|
78
|
-
* Component default class name and class prefix.
|
|
79
|
-
*/
|
|
80
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
81
|
-
export declare const block: {
|
|
82
|
-
(additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
83
|
-
(modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
84
|
-
}, element: {
|
|
85
|
-
(elem: string, additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
86
|
-
(elem: string, modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Component default props.
|
|
90
|
-
*/
|
|
91
|
-
export declare const DEFAULT_PROPS: Partial<DialogProps>;
|
|
92
|
-
/**
|
|
93
|
-
* Dialog component.
|
|
94
|
-
*
|
|
95
|
-
* @param props Component props.
|
|
96
|
-
* @param ref Component ref.
|
|
97
|
-
* @return React element.
|
|
98
|
-
*/
|
|
99
|
-
export declare const Dialog: (props: DialogProps) => import("react").JSX.Element;
|
|
1
|
+
export { COMPONENT_NAME, CLASSNAME, block, element, DIALOG_LABEL_KEY } from './constants';
|
|
2
|
+
export { type BaseDialogProps, type DialogSizes } from './types';
|
|
3
|
+
export { DialogShell, DEFAULT_PROPS, type DialogShellProps } from './DialogShell';
|
|
4
|
+
export { DialogContent, type DialogContentProps } from './DialogContent';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
export interface LabelRegistrySetupOptions extends SetupOptions<any> {
|
|
3
|
+
/** Framework factory producing a DialogHeading child carrying the given accessible name. */
|
|
4
|
+
makeDialogHeading: (name: string) => any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Shared assertions proving a dialog-like container (`Dialog`, `Lightbox`, `PopoverDialog`) wires the
|
|
8
|
+
* ids registry: it links itself to a rendered `DialogHeading` via `aria-labelledby`, and stays
|
|
9
|
+
* unlabelled when none is present.
|
|
10
|
+
*
|
|
11
|
+
* The container's own precedence rules (explicit `aria-label`/`aria-labelledby`/`label` props), the
|
|
12
|
+
* unmount behaviour, and any framework-specific concerns (e.g. Vue stray-attribute leaks) stay in the
|
|
13
|
+
* per-package test files. Registry mechanics (last-wins, fallback) are covered by the IdsRegistry
|
|
14
|
+
* tests.
|
|
15
|
+
*
|
|
16
|
+
* `aria-label` is forced to `undefined` because some containers default it, which would otherwise win
|
|
17
|
+
* over the registry-provided `aria-labelledby`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DialogLabelRegistryTests: (renderOptions: LabelRegistrySetupOptions) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { JSXElement } from '../../types';
|
|
2
|
+
import type { Size } from '../../constants';
|
|
3
|
+
export interface BaseDialogProps {
|
|
4
|
+
/** Footer content. */
|
|
5
|
+
footer?: JSXElement;
|
|
6
|
+
/** Whether the divider between the dialog content and the footer is always displayed (instead of showing it on scroll). */
|
|
7
|
+
forceFooterDivider?: boolean;
|
|
8
|
+
/** Header content. */
|
|
9
|
+
header?: JSXElement;
|
|
10
|
+
/** Whether the divider between the dialog content and the header is always displayed (instead of showing it on scroll). */
|
|
11
|
+
forceHeaderDivider?: boolean;
|
|
12
|
+
/** Whether the indefinite progress indicator over the dialog content is displayed or not. */
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
/** Whether the component is open or not. */
|
|
15
|
+
isOpen?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type DialogSizes = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
|
|
@@ -32,6 +32,7 @@ export declare const getHeadingProps: (props: HeadingProps, contextHeadingElemen
|
|
|
32
32
|
as: HeadingElement;
|
|
33
33
|
className: string;
|
|
34
34
|
typography: import("../../constants").Typography;
|
|
35
|
+
id?: string | undefined;
|
|
35
36
|
color?: import("../../constants").ColorWithVariants | undefined;
|
|
36
37
|
colorVariant?: import("../../constants").ColorVariant | undefined;
|
|
37
38
|
truncate?: boolean | {
|
|
@@ -27,6 +27,12 @@ export interface LightboxProps extends BaseLightboxProps {
|
|
|
27
27
|
parentElement?: CommonRef;
|
|
28
28
|
/** Reference to the element that should get the focus when the lightbox opens. By default, the close button or the lightbox itself will take focus. */
|
|
29
29
|
focusElement?: CommonRef;
|
|
30
|
+
/**
|
|
31
|
+
* Id of the heading naming this lightbox (via the internal ids registry), applied as
|
|
32
|
+
* `aria-labelledby` on the lightbox container. Overridden by an explicit `aria-label`/
|
|
33
|
+
* `aria-labelledby`.
|
|
34
|
+
*/
|
|
35
|
+
labelId?: string;
|
|
30
36
|
/** On close callback. */
|
|
31
37
|
handleClose?(): void;
|
|
32
38
|
/** Children */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MENU_PROVIDER_COMPONENT_NAME = "MenuProvider";
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AriaAttributes, LumxClassName } from '../../types';
|
|
2
2
|
import type { PopoverProps } from '../Popover';
|
|
3
3
|
/**
|
|
4
4
|
* PopoverDialog props.
|
|
5
|
-
* The PopoverDialog has the same props as the Popover
|
|
5
|
+
* The PopoverDialog has the same props as the Popover, plus optional accessible-name props.
|
|
6
|
+
* An accessible name can be provided via `label`, `aria-label`, `aria-labelledby`, or by
|
|
7
|
+
* rendering a `DialogHeading` inside the dialog (which names it via the internal label
|
|
8
|
+
* registry) - at least one of these should be used.
|
|
6
9
|
*/
|
|
7
|
-
export type PopoverDialogProps = PopoverProps &
|
|
10
|
+
export type PopoverDialogProps = PopoverProps & Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'> & {
|
|
8
11
|
/** Accessible label for the dialog (alternative to aria-label prop). */
|
|
9
12
|
label?: string;
|
|
10
13
|
};
|
|
@@ -19,8 +19,6 @@ export interface CommonTabProps extends HasClassName {
|
|
|
19
19
|
id?: string;
|
|
20
20
|
/** Whether the tab is active or not. */
|
|
21
21
|
isActive?: boolean;
|
|
22
|
-
/** Synonym for `isActive` — `'page'` marks the tab as active (WAI-ARIA nav-link convention). */
|
|
23
|
-
'aria-current'?: 'page' | boolean;
|
|
24
22
|
/**
|
|
25
23
|
* WAI-ARIA `tab` role, resolved by the framework wrapper from `TabProvider` presence:
|
|
26
24
|
* `'tab'` inside a provider (classic tab mode), `undefined` outside (nav-link mode).
|
|
@@ -15,11 +15,11 @@ export interface ToolbarProps extends HasClassName {
|
|
|
15
15
|
/**
|
|
16
16
|
* Component display name.
|
|
17
17
|
*/
|
|
18
|
-
export declare const
|
|
18
|
+
export declare const COMPONENT_NAME = "Toolbar";
|
|
19
19
|
/**
|
|
20
20
|
* Component default class name and class prefix.
|
|
21
21
|
*/
|
|
22
|
-
export declare const CLASSNAME: LumxClassName<typeof
|
|
22
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
23
23
|
/**
|
|
24
24
|
* Component default props.
|
|
25
25
|
*/
|
|
@@ -2,8 +2,12 @@ import type { CommonRef } from '../../types';
|
|
|
2
2
|
export { setupInfiniteScrollObserver } from './setupInfiniteScrollObserver';
|
|
3
3
|
export declare const INFINITE_SCROLL_CLASSNAME = "lumx-infinite-scroll-anchor";
|
|
4
4
|
export interface InfiniteScrollProps {
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Callback when infinite scroll component is in view.
|
|
7
|
+
* Omit (e.g. while loading) to temporarily disable without changing the callback's
|
|
8
|
+
* identity when re-enabled — keeps the underlying observer stable.
|
|
9
|
+
*/
|
|
10
|
+
callback?(evt?: Event): void;
|
|
7
11
|
/** Customize intersection observer option */
|
|
8
12
|
options?: IntersectionObserverInit;
|
|
9
13
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picks the accessible-name prop (`aria-label` or `aria-labelledby`).
|
|
3
|
+
*/
|
|
4
|
+
export declare function resolveAccessibleNameProps(ariaLabel: string | undefined, ariaLabelledBy: string | undefined): {
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
} | {
|
|
7
|
+
'aria-labelledby': string;
|
|
8
|
+
} | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal "ids registry" contract shared between framework wrappers (`@lumx/react`, `@lumx/vue`).
|
|
3
|
+
*/
|
|
4
|
+
export interface IdsRegistry {
|
|
5
|
+
/** Get the id currently registered under `key` (the most recently registered one still holding it), if any. */
|
|
6
|
+
getId(key: string): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Register (or clear, when `id` is `undefined`) the id held by `token` under `key`. `token` identifies the
|
|
9
|
+
* registrant (e.g. one per component instance) so that clearing/overwriting only ever affects its own
|
|
10
|
+
* registration: if it wasn't the most recent registrant, clearing it falls back to whichever other
|
|
11
|
+
* registrant is still holding the key. Notifies its listeners when the id returned by `getId` changes.
|
|
12
|
+
*/
|
|
13
|
+
setId(key: string, token: unknown, id: string | undefined): void;
|
|
14
|
+
/** Subscribe to changes of the id registered under `key`. Returns an unsubscribe function. */
|
|
15
|
+
subscribe(key: string, listener: (key: string) => void): () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Create a standalone ids registry.
|
|
19
|
+
*
|
|
20
|
+
* Can be used to store ids for 'aria-labelledby' or 'aria-describedby'. Registrations under the same key are
|
|
21
|
+
* kept as a stack (most recently registered wins); a registrant clearing itself only affects the top of the
|
|
22
|
+
* stack if it put itself there, so an older still-registered registrant is restored instead of the key going
|
|
23
|
+
* empty.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createIdsRegistry(): IdsRegistry;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.19.1-alpha.
|
|
10
|
+
"@lumx/icons": "^4.19.1-alpha.6",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.19.1-alpha.
|
|
69
|
+
"version": "4.19.1-alpha.6",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|