diff --git a/.babelrc.js b/.babelrc.js index 9870ed13..84bcb43e 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -42,6 +42,9 @@ module.exports = { return { visitor: { + ExportAllDeclaration(path, state) { + rewriteRelativeImports(path.node); + }, ExportNamedDeclaration(path, state) { rewriteRelativeImports(path.node); }, diff --git a/.changeset/curly-ghosts-sing.md b/.changeset/curly-ghosts-sing.md new file mode 100644 index 00000000..d56d8e28 --- /dev/null +++ b/.changeset/curly-ghosts-sing.md @@ -0,0 +1,8 @@ +--- +"dom-accessibility-api": patch +--- + +Add `isInaccessible` and `isSubtreeInaccessible`. + +`isInaccessible` implements https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion. +`isSubtreeInaccessible` can be used to inject a memoized version of that function into `isInaccessible`. diff --git a/sources/__tests__/is-inaccessible.js b/sources/__tests__/is-inaccessible.js new file mode 100644 index 00000000..66f7aebf --- /dev/null +++ b/sources/__tests__/is-inaccessible.js @@ -0,0 +1,133 @@ +import { isInaccessible, isSubtreeInaccessible } from "../is-inaccessible"; +import { cleanup, renderIntoDocument } from "./helpers/test-utils"; + +afterEach(() => { + jest.restoreAllMocks(); +}); + +describe("isInaccessible", () => { + test.each([ + ["
", false], + ['
', false], + ['
', false], + [ + '
', + false, + ], + ["