@bulmil/core
Version:

50 lines (45 loc) • 1.85 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client';
const iconCss = ".icon{-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;height:1.5rem;width:1.5rem}.icon.is-small{height:1rem;width:1rem}.icon.is-medium{height:2rem;width:2rem}.icon.is-large{height:3rem;width:3rem}.icon-text{-ms-flex-align:start;align-items:flex-start;color:inherit;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:1.5rem;vertical-align:top}.icon-text .icon{-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0}.icon-text .icon:not(:last-child){margin-right:0.25em}.icon-text .icon:not(:first-child){margin-left:0.25em}div.icon-text{display:-ms-flexbox;display:flex}";
let Icon = class extends HTMLElement {
constructor() {
super();
this.__registerHost();
/**
* Icon text
*/
this.withText = false;
}
render() {
return (h("span", { class: {
icon: !this.withText,
[this.color]: Boolean(this.color),
[this.size]: Boolean(this.size),
'icon-text': this.withText,
} }, h("slot", null)));
}
static get style() { return iconCss; }
};
Icon = /*@__PURE__*/ proxyCustomElement(Icon, [4, "bm-icon", {
"color": [1],
"size": [1],
"withText": [4, "with-text"]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["bm-icon"];
components.forEach(tagName => { switch (tagName) {
case "bm-icon":
if (!customElements.get(tagName)) {
customElements.define(tagName, Icon);
}
break;
} });
}
const BmIcon = Icon;
const defineCustomElement = defineCustomElement$1;
export { BmIcon, defineCustomElement };