@muraldevkit/ui-toolkit 4.65.0 → 4.65.1
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/dist/components/modal/MrlModalContent/MrlModalContent.d.ts +2 -2
- package/dist/components/modal/demo/ModalWithTriggerDemo.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useHasFocusableDescendant/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/dist/utils/trapFocus/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface MrlModalContentProps {
|
|
3
3
|
/**
|
|
4
4
|
* Children to be rendered within the component.
|
|
5
5
|
*/
|
|
@@ -15,5 +15,5 @@ interface MrlModalHeaderProps {
|
|
|
15
15
|
* @param {React.ReactElement} props.children - The children to be rendered within the component
|
|
16
16
|
* @returns {React.ReactElement}} The rendered MrlModalContent component
|
|
17
17
|
*/
|
|
18
|
-
export declare const MrlModalContent: ({ children, className, ...rest }:
|
|
18
|
+
export declare const MrlModalContent: ({ children, className, ...rest }: MrlModalContentProps) => JSX.Element;
|
|
19
19
|
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks whether the subtree of the given ref contains at least one element
|
|
4
|
+
* that participates in sequential focus navigation.
|
|
5
|
+
*
|
|
6
|
+
* Used by scrollable wrapper components (`MrlPanel`, `MrlModalContent`) to
|
|
7
|
+
* decide whether the wrapper itself needs `tabindex="0"`. Per ACT rule
|
|
8
|
+
* 0ssw9k (https://www.w3.org/WAI/standards-guidelines/act/rules/0ssw9k/) a
|
|
9
|
+
* scrollable region passes WCAG 2.1.1 Keyboard either by being focusable
|
|
10
|
+
* itself or by having a focusable descendant. When focusable descendants
|
|
11
|
+
* already exist, adding `tabindex="0"` to the wrapper produces a
|
|
12
|
+
* "meaningless tab stop" finding from manual auditors.
|
|
13
|
+
*
|
|
14
|
+
* The default return value is `true` so that, on the very first render
|
|
15
|
+
* (before the layout effect has measured the DOM), components err on the
|
|
16
|
+
* side of NOT adding a tab stop. The MutationObserver flips it to `false`
|
|
17
|
+
* synchronously inside the layout effect if the wrapper is genuinely
|
|
18
|
+
* empty of focusable descendants.
|
|
19
|
+
*
|
|
20
|
+
* @param {React.RefObject<HTMLElement | null>} ref - Ref pointing at the container whose subtree should be observed.
|
|
21
|
+
* @returns {boolean} `true` while the subtree contains at least one focusable element, `false` otherwise.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useHasFocusableDescendant(ref: React.RefObject<HTMLElement | null>): boolean;
|