@carbon/react
Version:
React components for the Carbon Design System
28 lines (27 loc) • 1.52 kB
TypeScript
/**
* Copyright IBM Corp. 2016, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { KeyboardEvent } from 'react';
/**
* A "ring buffer" function that takes an array and, depending on an ArrowRight
* or ArrowLeft key input, loops from last index to first or first index to last.
*
* @param key - the left or right arrow key (KeyboardEvent, number, or string)
* @param index - the current index in the array
* @param arrayLength - the total length of the array
*
* @example
* getNextIndex(keyCodes.RIGHT, 0, 4)
*/
export declare const getNextIndex: (key: KeyboardEvent | number | string, index: number, arrayLength: number) => number | undefined;
/**
* CSS selector that selects major nodes that are sequentially focusable.
*/
export declare const selectorTabbable = "\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\n textarea:not([disabled]):not([tabindex='-1']),\n iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true]\n";
/**
* CSS selector that selects major nodes that are click focusable.
*/
export declare const selectorFocusable = "\n a[href], area[href], input:not([disabled]),\n button:not([disabled]),select:not([disabled]),\n textarea:not([disabled]),\n iframe, object, embed, *[tabindex]:not([disabled]), *[contenteditable=true]\n";