@trimble-oss/moduswebcomponents
Version:
Modus Web Components is a modern, accessible UI library built with Stencil JS that provides reusable web components following Trimble's Modus design system. This updated version focuses on improved flexibility, enhanced theming options, comprehensive cust
32 lines (31 loc) • 1.48 kB
TypeScript
/**
* Checks if the app is in light mode by checking the html element's data-theme attribute.
* @returns { boolean } - Whether the app is in light mode or not.
*/
export declare const isLightMode: () => boolean;
export declare function generateRandomId(length?: number): string;
export type Attributes = {
[key: string]: string;
};
/**
* Elements inside of web components sometimes need to inherit global attributes
* set on the host. For example, the inner input in `ion-input` should inherit
* the `title` attribute that developers set directly on `ion-input`. This
* helper function should be called in componentWillLoad and assigned to a variable
* that is later used in the render function.
*
* This does not need to be reactive as changing attributes on the host element
* does not trigger a re-render.
*/
export declare const inheritAttributes: (el: HTMLElement, attributes?: string[]) => Attributes;
/**
* Returns an array of aria attributes that should be copied from
* the shadow host element to a target within the light DOM.
* @param el The element that the attributes should be copied from.
* @param ignoreList The list of aria-attributes to ignore reflecting and removing from the host.
* Use this in instances where we manually specify aria attributes on the `<Host>` element.
*/
export declare const inheritAriaAttributes: (el: HTMLElement, ignoreList?: string[]) => Attributes;
export declare const KEY: {
[key: string]: string;
};