@touchcastllc/napster-companion-api-dev 2.0.0-alpha.5 → 2.0.0-alpha.7
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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-hide for the control bar: it fades out a few seconds after the pointer
|
|
3
|
+
* leaves and returns when the pointer comes back.
|
|
4
|
+
*
|
|
5
|
+
* Keyboard focus counts as presence too (CA-841, WCAG 2.1.1 / 2.4.7). The bar
|
|
6
|
+
* is only faded (opacity), not removed, so its buttons stay in the tab order;
|
|
7
|
+
* without this a keyboard user tabbed onto buttons they could not see, and
|
|
8
|
+
* nothing but a mouse movement ever brought the bar back.
|
|
9
|
+
*/
|
|
10
|
+
export interface ControlsAutoHide {
|
|
11
|
+
isVisible(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Start the countdown to hiding the bar. When the countdown ends the bar
|
|
14
|
+
* stays up if a control inside the widget still has focus; it is hidden
|
|
15
|
+
* later, after focus leaves.
|
|
16
|
+
*/
|
|
17
|
+
scheduleHide(): void;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
20
|
+
export interface ControlsAutoHideOptions {
|
|
21
|
+
/** Called whenever the bar becomes visible (`true`) or hidden (`false`). */
|
|
22
|
+
onChange: (visible: boolean) => void;
|
|
23
|
+
/** How long after the pointer or focus leaves before hiding. Default 5000. */
|
|
24
|
+
delayMs?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function createControlsAutoHide(root: HTMLElement, { onChange, delayMs }: ControlsAutoHideOptions): ControlsAutoHide;
|
|
@@ -11,3 +11,12 @@
|
|
|
11
11
|
* `:hover` or `:focus-visible`.
|
|
12
12
|
*/
|
|
13
13
|
export declare function createControlButton(extraClass?: string): HTMLButtonElement;
|
|
14
|
+
/**
|
|
15
|
+
* Puts a control's icon in its button, replacing whatever was there.
|
|
16
|
+
*
|
|
17
|
+
* The icon is decorative: the button's own `aria-label` is its name. Without
|
|
18
|
+
* `aria-hidden` assistive technology may announce the unlabelled graphic as
|
|
19
|
+
* well, and `focusable="false"` keeps legacy engines from adding the SVG to
|
|
20
|
+
* the tab order.
|
|
21
|
+
*/
|
|
22
|
+
export declare function setControlIcon(btn: HTMLElement, icon: SVGElement): void;
|