UNPKG

@nopwdio/ui

Version:
62 lines (60 loc) 2.01 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { css, html, LitElement } from "lit"; import { customElement, property } from "lit/decorators.js"; import "./ui-color.js"; let UiColors = class UiColors extends LitElement { constructor() { super(...arguments); this.prefix = ""; this.suffix = ""; } render() { return html ` <span class="prefix">${this.prefix}</span> <span class="colors"> ${this.suffix.split(",").map((s) => { return html `<ui-color color="${this.prefix}${s}">${s.length ? s : "default"}</ui-color>`; })} </span> `; } }; UiColors.styles = [ css ` :host { display: flex; flex-direction: column; justify-content: space-between; gap: var(--np-gap); } .prefix { font-size: var(--np-text-size-muted); font-weight: var(--np-text-weight-emphasis); padding: var(--np-padding) 0; border-bottom: 1px solid var(--np-border-color-muted); } .colors { display: flex; flex: 1; font-size: var(--np-text-size-muted); overflow-x: scroll; gap: var(--np-gap); } `, ]; __decorate([ property() ], UiColors.prototype, "prefix", void 0); __decorate([ property() ], UiColors.prototype, "suffix", void 0); UiColors = __decorate([ customElement("ui-colors") ], UiColors); export { UiColors }; //# sourceMappingURL=ui-colors.js.map