@blaze/atoms
Version:
Open Source UI Toolkit - Atoms
121 lines (120 loc) • 2.72 kB
JavaScript
import { h, Component, Prop } from '@stencil/core';
export class Avatar {
constructor() {
this.size = '';
}
render() {
if (!this.src && !this.text)
return;
const sizeClass = this.size.length > 0 ? `u-${this.size}` : '';
return (h("div", { class: `c-avatar ${sizeClass}`, "data-text": this.text },
this.src && h("img", { class: "c-avatar__img", alt: this.alt, src: this.src }),
this.src2 && h("img", { class: "c-avatar__img", alt: this.alt2, src: this.src2 })));
}
static get is() { return "blaze-avatar"; }
static get properties() { return {
"size": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "size",
"reflect": false,
"defaultValue": "''"
},
"src": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "src",
"reflect": false
},
"src2": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "src-2",
"reflect": false
},
"alt": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "alt",
"reflect": false
},
"alt2": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "alt-2",
"reflect": false
},
"text": {
"type": "string",
"mutable": false,
"complexType": {
"original": "string",
"resolved": "string",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": ""
},
"attribute": "text",
"reflect": false
}
}; }
}