@instructure/ui-a11y-utils 8.12.0 → 8.12.1-snapshot.15
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/LICENSE.md +27 -0
- package/es/FocusRegion.js +15 -8
- package/es/FocusRegionManager.js +8 -4
- package/es/FocusRegionOptions.js +1 -0
- package/es/KeyboardFocusRegion.js +28 -35
- package/es/ScreenReaderFocusRegion.js +10 -6
- package/lib/FocusRegion.js +10 -7
- package/lib/FocusRegionManager.js +5 -2
- package/lib/FocusRegionOptions.js +1 -0
- package/lib/KeyboardFocusRegion.js +26 -34
- package/lib/ScreenReaderFocusRegion.js +7 -4
- package/package.json +12 -11
- package/src/FocusRegion.ts +42 -65
- package/src/FocusRegionManager.ts +35 -35
- package/src/FocusRegionOptions.ts +80 -0
- package/src/KeyboardFocusRegion.ts +58 -108
- package/src/ScreenReaderFocusRegion.ts +36 -78
- package/src/hasVisibleChildren.ts +2 -5
- package/src/index.ts +1 -0
- package/src/scopeTab.ts +7 -4
- package/types/FocusRegion.d.ts +22 -15
- package/types/FocusRegion.d.ts.map +1 -1
- package/types/FocusRegionManager.d.ts +23 -14
- package/types/FocusRegionManager.d.ts.map +1 -1
- package/types/FocusRegionOptions.d.ts +56 -0
- package/types/FocusRegionOptions.d.ts.map +1 -0
- package/types/KeyboardFocusRegion.d.ts +24 -22
- package/types/KeyboardFocusRegion.d.ts.map +1 -1
- package/types/ScreenReaderFocusRegion.d.ts +19 -17
- package/types/ScreenReaderFocusRegion.d.ts.map +1 -1
- package/types/hasVisibleChildren.d.ts +2 -1
- package/types/hasVisibleChildren.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/scopeTab.d.ts +2 -1
- package/types/scopeTab.d.ts.map +1 -1
package/types/FocusRegion.d.ts
CHANGED
|
@@ -1,21 +1,26 @@
|
|
|
1
|
+
import { FocusRegionOptions } from './FocusRegionOptions';
|
|
1
2
|
declare class FocusRegion {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
private _contextElement;
|
|
4
|
+
private _preventCloseOnDocumentClick;
|
|
5
|
+
private _options;
|
|
6
|
+
private readonly _screenReaderFocusRegion;
|
|
7
|
+
private readonly _keyboardFocusRegion;
|
|
8
|
+
private readonly _id;
|
|
9
|
+
private _listeners;
|
|
10
|
+
private _active;
|
|
11
|
+
constructor(element: Element | Node, options: FocusRegionOptions);
|
|
12
|
+
updateElement(element: Element | Node): void;
|
|
13
|
+
handleDismiss: (event: Event, documentClick?: boolean | undefined) => void;
|
|
14
|
+
captureDocumentClick: (event: MouseEvent) => void;
|
|
15
|
+
handleDocumentClick: (event: MouseEvent) => void;
|
|
16
|
+
handleFrameClick: (event: MouseEvent, frame: HTMLIFrameElement) => void;
|
|
17
|
+
handleKeyUp: (event: KeyboardEvent) => void;
|
|
18
|
+
get id(): string;
|
|
14
19
|
get focused(): boolean;
|
|
15
20
|
get keyboardFocusable(): boolean;
|
|
16
21
|
activate(): void;
|
|
17
22
|
deactivate({ keyboard }?: {
|
|
18
|
-
keyboard?: boolean
|
|
23
|
+
keyboard?: boolean;
|
|
19
24
|
}): void;
|
|
20
25
|
focus(): void;
|
|
21
26
|
blur(): void;
|
|
@@ -26,11 +31,13 @@ export {
|
|
|
26
31
|
* ---
|
|
27
32
|
* category: utilities/a11y
|
|
28
33
|
* ---
|
|
29
|
-
*
|
|
30
|
-
* Class for focus operations
|
|
34
|
+
*
|
|
35
|
+
* Class for focus operations, manages [ScreenReaderFocusRegion](#ScreenReaderFocusRegion)
|
|
36
|
+
* and [KeyboardFocusRegion](#KeyboardFocusRegion) for the given DOM element.
|
|
31
37
|
* - Scoping focus within a given context (DOM node),
|
|
32
38
|
* - Mark active element for focus later
|
|
33
39
|
* - Return focus to the marked element
|
|
40
|
+
* @module FocusRegion
|
|
34
41
|
*/
|
|
35
42
|
FocusRegion };
|
|
36
43
|
//# sourceMappingURL=FocusRegion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusRegion.d.ts","sourceRoot":"","sources":["../src/FocusRegion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FocusRegion.d.ts","sourceRoot":"","sources":["../src/FocusRegion.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,cAAM,WAAW;IACf,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,4BAA4B,CAAQ;IAC5C,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAyB;IAClE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,OAAO,CAAQ;gBAEX,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,EAAE,kBAAkB;IAchE,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAUrC,aAAa,UAAW,KAAK,+CAE5B;IAED,oBAAoB,UAAW,UAAU,UAIxC;IAED,mBAAmB,UAAW,UAAU,UAOvC;IAED,gBAAgB,UAAW,UAAU,SAAS,iBAAiB,UAK9D;IAED,WAAW,UAAW,aAAa,UAQlC;IAED,IAAI,EAAE,WAEL;IAID,IAAI,OAAO,YAEV;IAED,IAAI,iBAAiB,YAEpB;IAED,QAAQ;IA+CR,UAAU,CAAC,EAAE,QAAe,EAAE,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO;IAc3D,KAAK;IAQL,IAAI;CAOL;AAED,eAAe,WAAW,CAAA;AAC1B,OAAO;AACL;;;;;;;;;;;GAWG;AACH,WAAW,EACZ,CAAA"}
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { FocusRegion } from './FocusRegion';
|
|
2
|
+
import { FocusRegionOptions } from './FocusRegionOptions';
|
|
3
|
+
declare type Entry = {
|
|
4
|
+
id: string;
|
|
5
|
+
element: Element | Node;
|
|
6
|
+
region: FocusRegion;
|
|
7
|
+
children: Entry[];
|
|
8
|
+
parent?: Entry;
|
|
9
|
+
};
|
|
2
10
|
declare class FocusRegionManager {
|
|
3
|
-
static focusRegion: (element:
|
|
4
|
-
static activateRegion: (element:
|
|
5
|
-
static getActiveEntry: () =>
|
|
6
|
-
static findEntry: (element:
|
|
7
|
-
static getEntry: (element:
|
|
8
|
-
static addEntry: (element:
|
|
9
|
-
id:
|
|
10
|
-
element:
|
|
11
|
+
static focusRegion: (element: Element | Node, idOrOptions?: string | FocusRegionOptions) => FocusRegion | undefined;
|
|
12
|
+
static activateRegion: (element: Element | Node, options: FocusRegionOptions) => FocusRegion;
|
|
13
|
+
static getActiveEntry: () => Entry | undefined;
|
|
14
|
+
static findEntry: (element: Element | Node, id?: string | undefined) => number;
|
|
15
|
+
static getEntry: (element: Element | Node, id?: string | undefined) => Entry;
|
|
16
|
+
static addEntry: (element: Element | Node, options?: FocusRegionOptions) => {
|
|
17
|
+
id: string;
|
|
18
|
+
element: Node | Element;
|
|
11
19
|
region: FocusRegion;
|
|
12
20
|
children: never[];
|
|
13
|
-
parent:
|
|
21
|
+
parent: Entry | undefined;
|
|
14
22
|
};
|
|
15
|
-
static removeEntry: (element:
|
|
16
|
-
static isFocused: (element:
|
|
23
|
+
static removeEntry: (element: Element | Node, id?: string | undefined) => Entry;
|
|
24
|
+
static isFocused: (element: Element | Node, id?: string | undefined) => boolean | undefined;
|
|
17
25
|
static clearEntries: () => void;
|
|
18
|
-
static blurRegion: (element:
|
|
26
|
+
static blurRegion: (element: Element | Node, id?: string | undefined) => void;
|
|
19
27
|
}
|
|
20
28
|
export default FocusRegionManager;
|
|
21
29
|
export {
|
|
@@ -23,11 +31,12 @@ export {
|
|
|
23
31
|
* ---
|
|
24
32
|
* category: utilities/a11y
|
|
25
33
|
* ---
|
|
26
|
-
*
|
|
27
|
-
* Class for focus operations.
|
|
34
|
+
*
|
|
35
|
+
* Class for focus operations, manages multiple [FocusRegion](#FocusRegion)s.
|
|
28
36
|
* - Scoping focus within a given context,
|
|
29
37
|
* - Mark active element for focus later
|
|
30
38
|
* - Return focus to the marked element
|
|
39
|
+
* @module FocusManager
|
|
31
40
|
*/
|
|
32
41
|
FocusRegionManager };
|
|
33
42
|
//# sourceMappingURL=FocusRegionManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusRegionManager.d.ts","sourceRoot":"","sources":["../src/FocusRegionManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FocusRegionManager.d.ts","sourceRoot":"","sources":["../src/FocusRegionManager.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,aAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,MAAM,EAAE,WAAW,CAAA;IACnB,QAAQ,EAAE,KAAK,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,KAAK,CAAA;CACf,CAAA;AAGD,cAAM,kBAAkB;IACtB,MAAM,CAAC,WAAW,YACP,OAAO,GAAG,IAAI,gBACV,MAAM,GAAG,kBAAkB,6BAkBzC;IAED,MAAM,CAAC,cAAc,YACV,OAAO,GAAG,IAAI,WACd,kBAAkB,iBAI5B;IAED,MAAM,CAAC,cAAc,0BAEpB;IAED,MAAM,CAAC,SAAS,YAAa,OAAO,GAAG,IAAI,qCAQ1C;IAED,MAAM,CAAC,QAAQ,YAAa,OAAO,GAAG,IAAI,oCAEzC;IAED,MAAM,CAAC,QAAQ,YACJ,OAAO,GAAG,IAAI,YACd,kBAAkB;;;;;;MAoC5B;IAED,MAAM,CAAC,WAAW,YAAa,OAAO,GAAG,IAAI,oCAO5C;IAED,MAAM,CAAC,SAAS,YAAa,OAAO,GAAG,IAAI,kDAO1C;IAED,MAAM,CAAC,YAAY,aAElB;IAED,MAAM,CAAC,UAAU,YAAa,OAAO,GAAG,IAAI,mCAsB3C;CACF;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO;AACL;;;;;;;;;;GAUG;AACH,kBAAkB,EACnB,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { LiveRegion, UIElement } from '@instructure/shared-types';
|
|
2
|
+
export declare type FocusRegionOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Function called when tab focus leaves the focusable content. This only
|
|
5
|
+
* occurs when `shouldContainFocus` is set to false.
|
|
6
|
+
*/
|
|
7
|
+
onBlur?: (event: Event) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Function called when a focus region is dismissed. This can happen when
|
|
10
|
+
* the user presses the escape key and `shouldCloseOnEscape` is true or
|
|
11
|
+
* when an IFrame is clicked or when anything outside the focus region
|
|
12
|
+
* is clicked if `shouldCloseOnDocumentClick` is true.
|
|
13
|
+
* @param event The event triggered the dismissal
|
|
14
|
+
* @param documentClick Whether the dismissal was triggered by a mouse click.
|
|
15
|
+
*/
|
|
16
|
+
onDismiss?: (event: Event, documentClick?: boolean) => void;
|
|
17
|
+
/**
|
|
18
|
+
* An element or a function returning an element to focus by default
|
|
19
|
+
*/
|
|
20
|
+
defaultFocusElement?: UIElement;
|
|
21
|
+
/**
|
|
22
|
+
* An element, function returning an element, or array of elements that will not be hidden from
|
|
23
|
+
* the screen reader when the focus region is active
|
|
24
|
+
*/
|
|
25
|
+
liveRegion?: LiveRegion;
|
|
26
|
+
/**
|
|
27
|
+
* When set to true or its an array that includes the 'keyboard' string,
|
|
28
|
+
* the keyboard and screenreader focus is trapped; when set to 'screenreader'
|
|
29
|
+
* only the screenreader focus is trapped.
|
|
30
|
+
*/
|
|
31
|
+
shouldContainFocus?: boolean | ('keyboard' | 'screenreader')[];
|
|
32
|
+
/**
|
|
33
|
+
* When set to true the keyboard focus is returned to the active element
|
|
34
|
+
* before the focus region was activated.
|
|
35
|
+
*/
|
|
36
|
+
shouldReturnFocus?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* When set to true the `onDismiss` function is called on a click outside
|
|
39
|
+
* the focus region.
|
|
40
|
+
*/
|
|
41
|
+
shouldCloseOnDocumentClick?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* When set to true the `onDismiss` function is called on the `Escape`
|
|
44
|
+
* keypress
|
|
45
|
+
*/
|
|
46
|
+
shouldCloseOnEscape?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* When set to true, the `defaultFocusElement` is focused on initialization.
|
|
49
|
+
*/
|
|
50
|
+
shouldFocusOnOpen?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* provides a reference to the underlying html root element
|
|
53
|
+
*/
|
|
54
|
+
elementRef?: (element: Element | null) => void;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=FocusRegionOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FocusRegionOptions.d.ts","sourceRoot":"","sources":["../src/FocusRegionOptions.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAEtE,oBAAY,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IAC/B;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3D;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAA;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,CAAC,UAAU,GAAG,cAAc,CAAC,EAAE,CAAA;IAC9D;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;CAC/C,CAAA"}
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UIElement } from '@instructure/shared-types';
|
|
2
|
+
import { FocusRegionOptions } from './FocusRegionOptions';
|
|
2
3
|
declare class KeyboardFocusRegion {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
private readonly _options;
|
|
5
|
+
private _focusLaterElement;
|
|
6
|
+
private _needToFocus;
|
|
7
|
+
private _listeners;
|
|
8
|
+
private _raf;
|
|
9
|
+
private _active;
|
|
10
|
+
private _wasDocumentClick?;
|
|
11
|
+
_contextElement?: Node;
|
|
12
|
+
constructor(element: UIElement, options: FocusRegionOptions);
|
|
10
13
|
get focused(): boolean;
|
|
11
|
-
get shouldContainFocus():
|
|
14
|
+
get shouldContainFocus(): boolean;
|
|
12
15
|
get focusable(): Element[];
|
|
13
16
|
get tabbable(): Element[];
|
|
14
|
-
get firstTabbable(): Element;
|
|
17
|
+
get firstTabbable(): Element | undefined;
|
|
15
18
|
get lastTabbable(): Element | undefined;
|
|
16
|
-
get firstFocusable(): Element;
|
|
19
|
+
get firstFocusable(): Element | undefined;
|
|
17
20
|
get lastFocusable(): Element | undefined;
|
|
18
21
|
get doc(): Document;
|
|
19
22
|
get win(): (Window & typeof globalThis) | null;
|
|
20
|
-
get
|
|
21
|
-
|
|
22
|
-
updateElement(element: any): void;
|
|
23
|
+
get defaultFocusElement(): Node | null;
|
|
24
|
+
updateElement(element: UIElement): void;
|
|
23
25
|
focusDefaultElement(): void;
|
|
24
26
|
focus(): void;
|
|
25
27
|
blur(): void;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
handleLastTabbableKeyDown: (event: any) => void;
|
|
28
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
29
|
+
handleClick: () => void;
|
|
30
|
+
handleWindowBlur: () => void;
|
|
31
|
+
handleFocus: () => void;
|
|
32
|
+
handleFirstTabbableKeyDown: (event: KeyboardEvent) => void;
|
|
33
|
+
handleLastTabbableKeyDown: (event: KeyboardEvent) => void;
|
|
33
34
|
activate(): void;
|
|
34
35
|
deactivate(): void;
|
|
35
36
|
}
|
|
@@ -39,11 +40,12 @@ export {
|
|
|
39
40
|
* ---
|
|
40
41
|
* category: utilities/a11y
|
|
41
42
|
* ---
|
|
42
|
-
*
|
|
43
|
+
*
|
|
43
44
|
* Class for focus operations.
|
|
44
45
|
* - Scoping focus within a given context (DOM node),
|
|
45
46
|
* - Mark active element for focus later
|
|
46
47
|
* - Return focus to the marked element
|
|
48
|
+
* @module KeyboardFocusRegion
|
|
47
49
|
*/
|
|
48
50
|
KeyboardFocusRegion };
|
|
49
51
|
//# sourceMappingURL=KeyboardFocusRegion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyboardFocusRegion.d.ts","sourceRoot":"","sources":["../src/KeyboardFocusRegion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyboardFocusRegion.d.ts","sourceRoot":"","sources":["../src/KeyboardFocusRegion.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,cAAM,mBAAmB;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAoB;IAC7C,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,IAAI,CAAkC;IAC9C,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,iBAAiB,CAAC,CAAS;IAC5B,eAAe,CAAC,EAAE,IAAI,CAAA;gBAEjB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB;IAY3D,IAAI,OAAO,YAEV;IAED,IAAI,kBAAkB,YAOrB;IAED,IAAI,SAAS,IAAI,OAAO,EAAE,CAEzB;IAED,IAAI,QAAQ,IAAI,OAAO,EAAE,CAExB;IAED,IAAI,aAAa,IAAI,OAAO,GAAG,SAAS,CAEvC;IAED,IAAI,YAAY,IAAI,OAAO,GAAG,SAAS,CAEtC;IAED,IAAI,cAAc,IAAI,OAAO,GAAG,SAAS,CAExC;IAED,IAAI,aAAa,IAAI,OAAO,GAAG,SAAS,CAEvC;IAED,IAAI,GAAG,aAEN;IAED,IAAI,GAAG,wCAEN;IAED,IAAI,mBAAmB,gBAwBtB;IAED,aAAa,CAAC,OAAO,EAAE,SAAS;IAIhC,mBAAmB;IAmBnB,KAAK;IAYL,IAAI;IAiBJ,aAAa,UAAW,aAAa,UAIpC;IAED,WAAW,aAEV;IAED,gBAAgB,aAMf;IAED,WAAW,aAqBV;IAED,0BAA0B,UAAW,aAAa,UAIjD;IAED,yBAAyB,UAAW,aAAa,UAIhD;IAED,QAAQ;IA6CR,UAAU;CAWX;AAED,eAAe,mBAAmB,CAAA;AAClC,OAAO;AACL;;;;;;;;;;GAUG;AACH,mBAAmB,EACpB,CAAA"}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { FocusRegionOptions } from './FocusRegionOptions';
|
|
1
2
|
declare class ScreenReaderFocusRegion {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
updateElement(element:
|
|
11
|
-
muteNode(node:
|
|
12
|
-
hideNodes(nodes:
|
|
13
|
-
hideNode(node:
|
|
14
|
-
handleDOMMutation: (records:
|
|
15
|
-
restoreNode(removedNode:
|
|
16
|
-
parseIframeBodies(node:
|
|
3
|
+
private _parents;
|
|
4
|
+
private _nodes;
|
|
5
|
+
private _liveRegion;
|
|
6
|
+
private _contextElement?;
|
|
7
|
+
private _options;
|
|
8
|
+
private _observer;
|
|
9
|
+
private _attributes;
|
|
10
|
+
constructor(element: Element | Node, options?: FocusRegionOptions);
|
|
11
|
+
updateElement(element: Element | Node): void;
|
|
12
|
+
muteNode(node: Element): void;
|
|
13
|
+
hideNodes(nodes: Element[]): void;
|
|
14
|
+
hideNode(node: Element): void;
|
|
15
|
+
handleDOMMutation: (records: MutationRecord[]) => void;
|
|
16
|
+
restoreNode(removedNode: Element): void;
|
|
17
|
+
parseIframeBodies(node: Element): HTMLElement[];
|
|
17
18
|
activate(): void;
|
|
18
19
|
deactivate(): void;
|
|
19
20
|
}
|
|
@@ -23,10 +24,11 @@ export {
|
|
|
23
24
|
* ---
|
|
24
25
|
* category: utilities/a11y
|
|
25
26
|
* ---
|
|
26
|
-
*
|
|
27
|
+
*
|
|
27
28
|
* Utility that hides all DOM elements outside of a specified node. Used,
|
|
28
29
|
* for example, in overlay components where we want to restrict the screen
|
|
29
|
-
* readers to the overlay content
|
|
30
|
+
* readers to the overlay content.
|
|
31
|
+
* @module ScreenReaderFocusRegion
|
|
30
32
|
*/
|
|
31
33
|
ScreenReaderFocusRegion };
|
|
32
34
|
//# sourceMappingURL=ScreenReaderFocusRegion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenReaderFocusRegion.d.ts","sourceRoot":"","sources":["../src/ScreenReaderFocusRegion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScreenReaderFocusRegion.d.ts","sourceRoot":"","sources":["../src/ScreenReaderFocusRegion.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,cAAM,uBAAuB;IAC3B,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,WAAW,CAAyB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAoB;IACpC,OAAO,CAAC,SAAS,CAAgC;IACjD,OAAO,CAAC,WAAW,CAAkC;gBAGnD,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,OAAO,GAAE,kBAGR;IAWH,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIrC,QAAQ,CAAC,IAAI,EAAE,OAAO;IAwBtB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE;IA4B1B,QAAQ,CAAC,IAAI,EAAE,OAAO;IAOtB,iBAAiB,YAAa,cAAc,EAAE,UAmB7C;IAED,WAAW,CAAC,WAAW,EAAE,OAAO;IAShC,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,EAAE;IA0B/C,QAAQ;IAqBR,UAAU;CAeX;AAED,eAAe,uBAAuB,CAAA;AACtC,OAAO;AACL;;;;;;;;;GASG;AACH,uBAAuB,EACxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasVisibleChildren.d.ts","sourceRoot":"","sources":["../src/hasVisibleChildren.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hasVisibleChildren.d.ts","sourceRoot":"","sources":["../src/hasVisibleChildren.ts"],"names":[],"mappings":"AAwBA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKxC,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,SAAS,WAQ9C;AAED,eAAe,kBAAkB,CAAA;AACjC,OAAO;AACL;;;;;;;;GAQG;AACH,kBAAkB,EACnB,CAAA"}
|
package/types/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { hasVisibleChildren } from './hasVisibleChildren';
|
|
|
4
4
|
export { KeyboardFocusRegion } from './KeyboardFocusRegion';
|
|
5
5
|
export { scopeTab } from './scopeTab';
|
|
6
6
|
export { ScreenReaderFocusRegion } from './ScreenReaderFocusRegion';
|
|
7
|
+
export type { FocusRegionOptions } from './FocusRegionOptions';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA"}
|
package/types/scopeTab.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { UIElement } from '@instructure/shared-types';
|
|
2
|
+
declare function scopeTab(element: UIElement | undefined, event: KeyboardEvent, onLeavingFinalTabbable?: () => void): void;
|
|
2
3
|
export default scopeTab;
|
|
3
4
|
export {
|
|
4
5
|
/**
|
package/types/scopeTab.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scopeTab.d.ts","sourceRoot":"","sources":["../src/scopeTab.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scopeTab.d.ts","sourceRoot":"","sources":["../src/scopeTab.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAE1D,iBAAS,QAAQ,CACf,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,KAAK,EAAE,aAAa,EACpB,sBAAsB,CAAC,EAAE,MAAM,IAAI,QAqCpC;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO;AACL;;;;;;;;;;;GAWG;AACH,QAAQ,EACT,CAAA"}
|