@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: 'bed4ca0d673a711be080c4e79ee9317d8a3ca0e7' }, h("div", { key: 'ae9bb127e958c0be40dbc583a82f1519910909c4', class: "cbp-panel__header" }, h("slot", { key: 'a06e80c97ef64391b4a22c366d55ba32ecadb26f', name: "cbp-panel-header" })), h("div", { key: '226da30207c60d9aca45cc681e2b3ac8b91a9848', class: "cbp-panel__content" }, h("slot", { key: '1f3864352c5a3dda5fc7f6b2c25fab72045bfa07' }))));
}
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