Files
url_tracker_tool/node_modules/@chakra-ui/utils/dist/cjs/tabbable.cjs
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

45 lines
1.5 KiB
JavaScript

'use strict';
var isElement = require('./is-element.cjs');
const hasDisplayNone = (element) => window.getComputedStyle(element).display === "none";
const hasTabIndex = (element) => element.hasAttribute("tabindex");
const hasNegativeTabIndex = (element) => hasTabIndex(element) && element.tabIndex === -1;
function hasFocusWithin(element) {
if (!document.activeElement)
return false;
return element.contains(document.activeElement);
}
function isFocusable(element) {
if (!isElement.isHTMLElement(element) || isElement.isHiddenElement(element) || isElement.isDisabledElement(element)) {
return false;
}
const { localName } = element;
const focusableTags = ["input", "select", "textarea", "button"];
if (focusableTags.indexOf(localName) >= 0)
return true;
const others = {
a: () => element.hasAttribute("href"),
audio: () => element.hasAttribute("controls"),
video: () => element.hasAttribute("controls")
};
if (localName in others) {
return others[localName]();
}
if (isElement.isContentEditableElement(element))
return true;
return hasTabIndex(element);
}
function isTabbable(element) {
if (!element)
return false;
return isElement.isHTMLElement(element) && isFocusable(element) && !hasNegativeTabIndex(element);
}
exports.hasDisplayNone = hasDisplayNone;
exports.hasFocusWithin = hasFocusWithin;
exports.hasNegativeTabIndex = hasNegativeTabIndex;
exports.hasTabIndex = hasTabIndex;
exports.isFocusable = isFocusable;
exports.isTabbable = isTabbable;