UNPKG

@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

75 lines (69 loc) 2.57 kB
import { p as proxyCustomElement, H, h, c as Host } from './p-BMvVSi6Y.js'; import { i as inheritAriaAttributes } from './p-COxr4v9W.js'; const convertPropsToClasses = ({ shape, }) => { let classes = ''; if (shape === 'circle') { classes = `${classes} modus-wc-rounded-full`; } return classes.trim(); }; const modusWcSkeletonCss = ""; const ModusWcSkeleton$1 = /*@__PURE__*/ proxyCustomElement(class ModusWcSkeleton extends H { constructor() { super(); this.__registerHost(); this.inheritedAttributes = {}; /** Custom CSS class to apply to the inner div. */ this.customClass = ''; /** The height of the skeleton. */ this.height = 'var(--modus-wc-line-height-md)'; /** The shape of the skeleton. */ this.shape = 'rectangle'; /** The width of the skeleton. */ this.width = '100%'; } componentWillLoad() { this.inheritedAttributes = inheritAriaAttributes(this.el); } getClasses() { const classList = ['modus-wc-skeleton']; const propClasses = convertPropsToClasses({ shape: this.shape, }); // The order CSS classes are added matters to CSS specificity if (propClasses) classList.push(propClasses); if (this.customClass) classList.push(this.customClass); return classList.join(' '); } getStyles() { return { height: this.height, width: this.width }; } render() { return (h(Host, { key: '2f441234fae48276eb37aa7a16e5e86734878e68' }, h("div", Object.assign({ key: '29d121ddd6bf46e0e4200998c723c234c08ded10', "aria-hidden": "true", class: this.getClasses(), style: this.getStyles(), tabindex: -1 }, this.inheritedAttributes)))); } get el() { return this; } static get style() { return modusWcSkeletonCss; } }, [0, "modus-wc-skeleton", { "customClass": [1, "custom-class"], "height": [1], "shape": [1], "width": [1] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["modus-wc-skeleton"]; components.forEach(tagName => { switch (tagName) { case "modus-wc-skeleton": if (!customElements.get(tagName)) { customElements.define(tagName, ModusWcSkeleton$1); } break; } }); } const ModusWcSkeleton = ModusWcSkeleton$1; const defineCustomElement = defineCustomElement$1; export { ModusWcSkeleton, defineCustomElement };