UNPKG

@cbpds/web-components

Version:
91 lines (90 loc) 3.18 kB
/*! * CPB Design System web components - built with Stencil */ import { Host, h } from "@stencil/core"; import { setCSSProps } from "../../utils/utils"; export class CbpTag { constructor() { this.color = undefined; this.context = undefined; this.sx = {}; } componentWillLoad() { if (typeof this.sx == 'string') { this.sx = JSON.parse(this.sx) || {}; } setCSSProps(this.host, Object.assign({}, this.sx)); } render() { return (h(Host, { key: '73d18f7e15d79546bf0e71de86b10451d9be4a98' }, h("slot", { key: 'a6408cfd1fc0fb72b45c31f8bdc4babc2850e5f8' }))); } static get is() { return "cbp-tag"; } static get originalStyleUrls() { return { "$": ["cbp-tag.scss"] }; } static get styleUrls() { return { "$": ["cbp-tag.css"] }; } static get properties() { return { "color": { "type": "string", "mutable": false, "complexType": { "original": "'default' | 'danger' | 'success' | 'warning'", "resolved": "\"danger\" | \"default\" | \"success\" | \"warning\"", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Specifies a tag color variant. Default does not need to be specified." }, "attribute": "color", "reflect": true }, "context": { "type": "string", "mutable": false, "complexType": { "original": "\"light-inverts\" | \"light-always\" | \"dark-inverts\" | \"dark-always\"", "resolved": "\"dark-always\" | \"dark-inverts\" | \"light-always\" | \"light-inverts\"", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Specifies the context of the component as it applies to the visual design and whether it inverts when light/dark mode is toggled. Default behavior is \"light-inverts\" and does not have to be specified." }, "attribute": "context", "reflect": true }, "sx": { "type": "any", "mutable": false, "complexType": { "original": "any", "resolved": "any", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Supports adding inline styles as an object" }, "attribute": "sx", "reflect": false, "defaultValue": "{}" } }; } static get elementRef() { return "host"; } } //# sourceMappingURL=cbp-tag.js.map