UNPKG

@kelvininc/ui-components

Version:
79 lines (78 loc) 2.73 kB
import { Host, h } from "@stencil/core"; import { EBadgeType } from "./badge.types"; /** * @part badge - The badge. */ export class KvBadge { constructor() { /** (optional) Defines the badge type.*/ this.type = EBadgeType.Primary; /** (optional) If `true` the badge is in disabled state. */ this.disabled = false; } render() { return (h(Host, { key: '328a5d250cedc4b7e3203350524c619178929f73' }, h("span", { key: 'b8bebd22e6e57faf92db60bba1af4a0e20f4fe9d', class: { badge: true, [`badge--type-${this.type}`]: true, disabled: this.disabled }, part: "badge" }, h("slot", { key: 'b294395e58d978304c6a6964589fceccdd9bfa39' })))); } static get is() { return "kv-badge"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["badge.scss"] }; } static get styleUrls() { return { "$": ["badge.css"] }; } static get properties() { return { "type": { "type": "string", "attribute": "type", "mutable": false, "complexType": { "original": "EBadgeType", "resolved": "EBadgeType.Primary | EBadgeType.Secondary", "references": { "EBadgeType": { "location": "import", "path": "./badge.types", "id": "src/components/badge/badge.types.ts::EBadgeType" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "(optional) Defines the badge type." }, "getter": false, "setter": false, "reflect": true, "defaultValue": "EBadgeType.Primary" }, "disabled": { "type": "boolean", "attribute": "disabled", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "(optional) If `true` the badge is in disabled state." }, "getter": false, "setter": false, "reflect": true, "defaultValue": "false" } }; } }