UNPKG

@cbpds/web-components

Version:
36 lines (30 loc) 2.09 kB
/*! * CPB Design System web components - built with Stencil */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const index = require('./index-cd71cbd5.js'); const utils = require('./utils-99c9e716.js'); const cbpBadgeCss = ":root{--cbp-badge-color:var(--cbp-color-text-lightest);--cbp-badge-color-dark:var(--cbp-color-info-darker);--cbp-badge-color-background:var(--cbp-color-info-base);--cbp-badge-color-background-dark:var( --cbp-color-interactive-secondary-lighter)}[data-cbp-theme=light] cbp-badge[context*=dark]:not([context=light-always]),[data-cbp-theme=dark] cbp-badge:not([context=dark-inverts]):not([context=light-always]){--cbp-badge-color:var(--cbp-badge-color-dark);--cbp-badge-color-background:var(--cbp-badge-color-background-dark)}cbp-badge{display:inline-block;width:var(--cbp-space-6x);height:var(--cbp-space-6x);color:var(--cbp-badge-color);background-color:var(--cbp-badge-color-background);border-radius:var(--cbp-border-radius-pill);cursor:default;font-size:0.625rem;font-weight:var(--cbp-font-weight-black);text-align:center;line-height:var(--cbp-space-6x)}cbp-badge[color=danger]{--cbp-badge-color-dark:var(--cbp-color-danger-darker);--cbp-badge-color-background:var(--cbp-color-danger-dark);--cbp-badge-color-background-dark:var(--cbp-color-danger-light)}"; const CbpBadgeStyle0 = cbpBadgeCss; const CbpBadge = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.color = undefined; this.context = undefined; this.sx = {}; } componentWillLoad() { if (typeof this.sx == 'string') { this.sx = JSON.parse(this.sx) || {}; } utils.setCSSProps(this.host, Object.assign({}, this.sx)); } render() { return (index.h(index.Host, { key: '82bdb09f322ef6d4fedb7cc1bff6a854ffe7af67' }, index.h("slot", { key: '37de2b5506ac3812a8fe85f908cd67d3b41f5d9f' }))); } get host() { return index.getElement(this); } }; CbpBadge.style = CbpBadgeStyle0; exports.cbp_badge = CbpBadge; //# sourceMappingURL=cbp-badge.cjs.entry.js.map