@cbpds/web-components
Version:
Web components for the CBP Design System.
92 lines (91 loc) • 3.41 kB
JavaScript
/*!
* CPB Design System web components - built with Stencil
*/
import { Host, h } from "@stencil/core";
import { setCSSProps } from "../../utils/utils";
export class CbpNotice {
constructor() {
this.color = 'info';
this.sx = {};
this.context = undefined;
}
componentWillLoad() {
if (typeof this.sx == 'string') {
this.sx = JSON.parse(this.sx) || {};
}
setCSSProps(this.host, Object.assign({}, this.sx));
}
render() {
return (h(Host, { key: 'b2d47a7b429108b7aa28902b8812c1b51f06a4a8' }, h("slot", { key: '94924dd1802f2fb723436387cd14bfbc3e559009', name: "cbp-notice-title" }), h("div", { key: 'dde61cf3903deba1b4a27d2bf92fa68073be9029' }, h("slot", { key: 'c535a5224c239584b517ecfb5e0b2dbc3873cd05' }))));
}
static get is() { return "cbp-notice"; }
static get originalStyleUrls() {
return {
"$": ["cbp-notice.scss"]
};
}
static get styleUrls() {
return {
"$": ["cbp-notice.css"]
};
}
static get properties() {
return {
"color": {
"type": "string",
"mutable": false,
"complexType": {
"original": "'info' | 'success' | 'warning' | 'danger'",
"resolved": "\"danger\" | \"info\" | \"success\" | \"warning\"",
"references": {}
},
"required": false,
"optional": false,
"docs": {
"tags": [],
"text": "Optionally specifies a notice color based on predefined design token values. Defaults to \"info\"."
},
"attribute": "color",
"reflect": true,
"defaultValue": "'info'"
},
"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": "{}"
},
"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
}
};
}
static get elementRef() { return "host"; }
}
//# sourceMappingURL=cbp-notice.js.map