UNPKG

@bulmil/core

Version:

![bulmil](https://user-images.githubusercontent.com/2362138/65766959-c721a080-e16f-11e9-9fb9-45a5a2ad0391.jpg)

50 lines (45 loc) 5.52 kB
/*! * Bulmil - MIT License */ import { HTMLElement, h, proxyCustomElement } from '@stencil/core/internal/client'; const progressCss = ".progress:not(:last-child){margin-bottom:1.5rem}.progress{-moz-appearance:none;-webkit-appearance:none;border:none;border-radius:9999px;display:block;height:1rem;overflow:hidden;padding:0;width:100%}.progress::-webkit-progress-bar{background-color:#ededed}.progress::-webkit-progress-value{background-color:#4a4a4a}.progress::-moz-progress-bar{background-color:#4a4a4a}.progress::-ms-fill{background-color:#4a4a4a;border:none}.progress.is-white::-webkit-progress-value{background-color:white}.progress.is-white::-moz-progress-bar{background-color:white}.progress.is-white::-ms-fill{background-color:white}.progress.is-white:indeterminate{background-image:linear-gradient(to right, white 30%, #ededed 30%)}.progress.is-black::-webkit-progress-value{background-color:#0a0a0a}.progress.is-black::-moz-progress-bar{background-color:#0a0a0a}.progress.is-black::-ms-fill{background-color:#0a0a0a}.progress.is-black:indeterminate{background-image:linear-gradient(to right, #0a0a0a 30%, #ededed 30%)}.progress.is-light::-webkit-progress-value{background-color:whitesmoke}.progress.is-light::-moz-progress-bar{background-color:whitesmoke}.progress.is-light::-ms-fill{background-color:whitesmoke}.progress.is-light:indeterminate{background-image:linear-gradient(to right, whitesmoke 30%, #ededed 30%)}.progress.is-dark::-webkit-progress-value{background-color:#363636}.progress.is-dark::-moz-progress-bar{background-color:#363636}.progress.is-dark::-ms-fill{background-color:#363636}.progress.is-dark:indeterminate{background-image:linear-gradient(to right, #363636 30%, #ededed 30%)}.progress.is-primary::-webkit-progress-value{background-color:#5851ff}.progress.is-primary::-moz-progress-bar{background-color:#5851ff}.progress.is-primary::-ms-fill{background-color:#5851ff}.progress.is-primary:indeterminate{background-image:linear-gradient(to right, #5851ff 30%, #ededed 30%)}.progress.is-link::-webkit-progress-value{background-color:#5851ff}.progress.is-link::-moz-progress-bar{background-color:#5851ff}.progress.is-link::-ms-fill{background-color:#5851ff}.progress.is-link:indeterminate{background-image:linear-gradient(to right, #5851ff 30%, #ededed 30%)}.progress.is-info::-webkit-progress-value{background-color:#3e8ed0}.progress.is-info::-moz-progress-bar{background-color:#3e8ed0}.progress.is-info::-ms-fill{background-color:#3e8ed0}.progress.is-info:indeterminate{background-image:linear-gradient(to right, #3e8ed0 30%, #ededed 30%)}.progress.is-success::-webkit-progress-value{background-color:#48c78e}.progress.is-success::-moz-progress-bar{background-color:#48c78e}.progress.is-success::-ms-fill{background-color:#48c78e}.progress.is-success:indeterminate{background-image:linear-gradient(to right, #48c78e 30%, #ededed 30%)}.progress.is-warning::-webkit-progress-value{background-color:#ffe08a}.progress.is-warning::-moz-progress-bar{background-color:#ffe08a}.progress.is-warning::-ms-fill{background-color:#ffe08a}.progress.is-warning:indeterminate{background-image:linear-gradient(to right, #ffe08a 30%, #ededed 30%)}.progress.is-danger::-webkit-progress-value{background-color:#f14668}.progress.is-danger::-moz-progress-bar{background-color:#f14668}.progress.is-danger::-ms-fill{background-color:#f14668}.progress.is-danger:indeterminate{background-image:linear-gradient(to right, #f14668 30%, #ededed 30%)}.progress:indeterminate{-webkit-animation-duration:1.5s;animation-duration:1.5s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:moveIndeterminate;animation-name:moveIndeterminate;-webkit-animation-timing-function:linear;animation-timing-function:linear;background-color:#ededed;background-image:linear-gradient(to right, #4a4a4a 30%, #ededed 30%);background-position:top left;background-repeat:no-repeat;background-size:150% 150%}.progress:indeterminate::-webkit-progress-bar{background-color:transparent}.progress:indeterminate::-moz-progress-bar{background-color:transparent}.progress:indeterminate::-ms-fill{animation-name:none}.progress.is-small{height:0.75rem}.progress.is-medium{height:1.25rem}.progress.is-large{height:1.5rem}@-webkit-keyframes moveIndeterminate{from{background-position:200% 0}to{background-position:-200% 0}}@keyframes moveIndeterminate{from{background-position:200% 0}to{background-position:-200% 0}}"; let Progress = class extends HTMLElement { constructor() { super(); this.__registerHost(); /** * Maximum value */ this.max = 100; } render() { return (h("progress", { class: { progress: true, [this.color]: Boolean(this.color), [this.size]: Boolean(this.size), }, value: this.value, max: this.max }, typeof this.value === 'number' && `${this.value}%`)); } static get style() { return progressCss; } }; Progress = /*@__PURE__*/ proxyCustomElement(Progress, [0, "bm-progress", { "value": [2], "max": [2], "color": [1], "size": [1] }]); function defineCustomElement$1() { if (typeof customElements === "undefined") { return; } const components = ["bm-progress"]; components.forEach(tagName => { switch (tagName) { case "bm-progress": if (!customElements.get(tagName)) { customElements.define(tagName, Progress); } break; } }); } const BmProgress = Progress; const defineCustomElement = defineCustomElement$1; export { BmProgress, defineCustomElement };