UNPKG

@stories-js/core

Version:

Stories web components to build stories

74 lines 2.28 kB
/*! * (C) StoriesJS https://storiesjs.org - GPL-2.0 License */ // eslint-disable-next-line @typescript-eslint/no-unused-vars import { Component, Host, h, Element, Prop } from '@stencil/core'; import { createColorClasses } from '../../utils'; export class Label { constructor() { /** * The position determines where and how the label behaves inside an item. */ this.position = 'fixed'; } render() { const position = this.position; return (h(Host, { class: createColorClasses(this.color, { [`label-${position}`]: position !== undefined, 'label-rtl': document.dir === 'rtl' }) }, h("slot", null))); } static get is() { return "stories-label"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["label.scss"] }; } static get styleUrls() { return { "$": ["label.css"] }; } static get properties() { return { "color": { "type": "string", "mutable": false, "complexType": { "original": "Color", "resolved": "string", "references": { "Color": { "location": "import", "path": "../../types" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "The color to use from your application's color palette.\nDefault options are: `\"primary\"`, `\"secondary\"`, `\"tertiary\"`, `\"success\"`, `\"warning\"`, `\"danger\"`, `\"light\"`, `\"medium\"`, and `\"dark\"`.\nFor more information on colors, see [theming](/docs/theming/basics)." }, "attribute": "color", "reflect": true }, "position": { "type": "string", "mutable": false, "complexType": { "original": "'fixed' | 'stacked' | 'floating'", "resolved": "\"fixed\" | \"floating\" | \"stacked\"", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "The position determines where and how the label behaves inside an item." }, "attribute": "position", "reflect": false, "defaultValue": "'fixed'" } }; } static get elementRef() { return "el"; } } //# sourceMappingURL=label.js.map