@cbpds/web-components
Version:
Web components for the CBP Design System.
73 lines (72 loc) • 2.75 kB
JavaScript
/*!
* CPB Design System web components - built with Stencil
*/
import { Host, h } from "@stencil/core";
import { setCSSProps } from "../../utils/utils";
export class CbpPanel {
constructor() {
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: '1cf8c7e297830b932895a8db51d4b06aef80043e' }, h("div", { key: '02007beb1311ea1ca044f479c9aec6fd18f16b2b', class: "cbp-panel__header" }, h("slot", { key: '35bf5c9c3b4ab3f5742e91fd0dacd9170532b0e5', name: "cbp-panel-header" })), h("div", { key: '6ccf324d230b4b1efad39e9ad03a7550391ed3b8', class: "cbp-panel__content" }, h("slot", { key: '3635f7746f6261255b4e7158cba0089ddf910f26' }))));
}
static get is() { return "cbp-panel"; }
static get originalStyleUrls() {
return {
"$": ["cbp-panel.scss"]
};
}
static get styleUrls() {
return {
"$": ["cbp-panel.css"]
};
}
static get properties() {
return {
"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-panel.js.map