UNPKG

@claromentis/design-system

Version:

Claromentis Design System Component Library

65 lines (64 loc) 1.48 kB
import { h } from '@stencil/core'; /** * @slot - Content of the banner */ export class Banner { constructor() { this.position = 'bottom'; } /** * Get the map of CSS classes for the banner. * * @return CssClassMap */ getClassMap() { const position = this.position; return { 'banner-outer': true, [`banner-top`]: position === 'top', [`banner-bottom`]: position === 'bottom', }; } render() { return (h("div", { class: this.getClassMap() }, h("div", { class: "banner" }, h("slot", null)))); } static get is() { return "cla-banner"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["cla-banner.scss"] }; } static get styleUrls() { return { "$": ["cla-banner.css"] }; } static get properties() { return { "position": { "type": "string", "mutable": false, "complexType": { "original": "Position", "resolved": "\"bottom\" | \"top\"", "references": { "Position": { "location": "import", "path": "../../interfaces" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "The banner position i.e top or bottom" }, "attribute": "position", "reflect": false, "defaultValue": "'bottom'" } }; } }