Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dom/__tests__/node-belongs.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { nodeBelongs } from '../node-belongs';
import nodeBelongs from '../node-belongs';

describe('nodeBelongs', () => {
let div: HTMLDivElement;
Expand Down
1 change: 1 addition & 0 deletions src/dom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

export { default as findUpUntil } from './find-up-until';
export { default as nodeContains } from './node-contains';
export { default as nodeBelongs } from './node-belongs';
2 changes: 1 addition & 1 deletion src/dom/node-belongs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { isHTMLElement, isNode } from './element-types';
* @param container Container node
* @param target Node that is checked to be a descendant of the container
*/
export function nodeBelongs(container: Node | null, target: Node | EventTarget | null): boolean {
export default function nodeBelongs(container: Node | null, target: Node | EventTarget | null): boolean {
if (!isNode(target)) {
return false;
}
Expand Down
8 changes: 8 additions & 0 deletions src/internal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ export {
export { useFocusVisible } from './focus-visible';
export { KeyCode, isModifierKey } from './keycode';
export { getGlobalFlag } from './global-flags';
export {
SingleTabStopNavigationAPI,
SingleTabStopNavigationProvider,
useSingleTabStopNavigation,
} from './single-tab-stop';
export { isFocusable, getAllFocusables, getFirstFocusable, getLastFocusable } from './focus-lock-utils/utils';
export { default as handleKey } from './utils/handle-key';
export { default as circleIndex } from './utils/circle-index';
2 changes: 1 addition & 1 deletion src/internal/single-tab-stop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React, {
useState,
} from 'react';

import { nodeBelongs } from '../../dom/node-belongs';
import nodeBelongs from '../../dom/node-belongs';

export type FocusableChangeHandler = (isFocusable: boolean) => void;

Expand Down
2 changes: 1 addition & 1 deletion src/internal/utils/circle-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

// Returns given index if it is in range or the opposite range boundary otherwise.
export function circleIndex(index: number, [from, to]: [number, number]): number {
export default function circleIndex(index: number, [from, to]: [number, number]): number {
if (index < from) {
return to;
}
Expand Down
Loading