@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
20 lines (19 loc) • 1.2 kB
TypeScript
export declare const TEXT_TAG: readonly ["address", "blockquote", "cite", "div", "dd", "dfn", "dt", "figcaption", "legend", "li", "p", "span", "time"];
export type TextTag = (typeof TEXT_TAG)[number];
export declare const TEXT_SIZE: readonly ["large", "medium", "small", "x-small", "xx-small"];
export type TextSize = (typeof TEXT_SIZE)[number];
export declare const TEXT_WEIGHT: readonly ["bold", "normal"];
export type TextWeight = (typeof TEXT_WEIGHT)[number];
/**
* Determines whether the specified HTMLElement is within one or more elements
* matching the provided CSS selector(s).
*
* This function checks if the given HTMLElement (`host`) is a descendant of
* any of the specified selectors in the DOM tree. It utilizes the
* `getClosestHTMLElement` utility to traverse the DOM hierarchy.
*
* @param {HTMLElement} host - The HTMLElement to check for being within a matching element.
* @param {string | string[]} selector - A CSS selector or an array of selectors to match against.
* @returns {boolean} `true` if the `host` element is within any matching element; otherwise, `false`.
*/
export declare const isWithinElement: (host: HTMLElement, selector: string | string[]) => boolean;