@bulmil/core
Version:

49 lines (44 loc) • 2.13 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { proxyCustomElement, HTMLElement, h } 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}";
const BmIconStyle0 = iconCss;
const Icon = /*@__PURE__*/ proxyCustomElement(class Icon extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.color = undefined;
this.size = undefined;
this.withText = false;
}
render() {
return (h("span", { key: 'a9c8d4a50fdbf71014bacfaebc2a42c28a1d9b07', class: {
icon: !this.withText,
[this.color]: Boolean(this.color),
[this.size]: Boolean(this.size),
'icon-text': this.withText,
} }, h("slot", { key: 'ac7b8b500e7aa05651ff322cbedd636c06f1b9f2' })));
}
static get style() { return BmIconStyle0; }
}, [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 };