chunk.HEWURXB4.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. i
  3. } from "./chunk.DA3UDEH5.js";
  4. import {
  5. e as e2
  6. } from "./chunk.YXKHB4AC.js";
  7. import {
  8. T,
  9. e,
  10. h,
  11. n,
  12. r
  13. } from "./chunk.5PIDMFOE.js";
  14. import {
  15. __decorateClass
  16. } from "./chunk.IHGPZX35.js";
  17. // _uyihdawu1:/Users/claviska/Projects/shoelace/src/components/progress-bar/progress-bar.scss
  18. var progress_bar_default = ":host {\n position: relative;\n box-sizing: border-box;\n}\n:host *, :host *:before, :host *:after {\n box-sizing: inherit;\n}\n\n[hidden] {\n display: none !important;\n}\n\n:host {\n --height: 16px;\n --track-color: var(--sl-color-gray-200);\n --indicator-color: var(--sl-color-primary-500);\n --label-color: var(--sl-color-white);\n display: block;\n}\n\n.progress-bar {\n position: relative;\n background-color: var(--track-color);\n height: var(--height);\n border-radius: var(--sl-border-radius-pill);\n overflow: hidden;\n}\n\n.progress-bar__indicator {\n height: 100%;\n font-family: var(--sl-font-sans);\n font-size: 12px;\n font-weight: var(--sl-font-weight-normal);\n background-color: var(--indicator-color);\n color: var(--label-color);\n text-align: center;\n line-height: var(--height);\n white-space: nowrap;\n overflow: hidden;\n transition: 400ms width, 400ms background-color;\n user-select: none;\n}\n\n.progress-bar--indeterminate .progress-bar__indicator {\n position: absolute;\n animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);\n}\n\n@keyframes indeterminate {\n 0% {\n left: -50%;\n width: 50%;\n }\n 75%, 100% {\n left: 100%;\n width: 50%;\n }\n}";
  19. // src/components/progress-bar/progress-bar.ts
  20. var SlProgressBar = class extends h {
  21. constructor() {
  22. super(...arguments);
  23. this.percentage = 0;
  24. this.indeterminate = false;
  25. }
  26. render() {
  27. return T`
  28. <div
  29. part="base"
  30. class=${e2({
  31. "progress-bar": true,
  32. "progress-bar--indeterminate": this.indeterminate
  33. })}
  34. role="progressbar"
  35. aria-valuemin="0"
  36. aria-valuemax="100"
  37. aria-valuenow="${this.indeterminate ? "" : this.percentage}"
  38. >
  39. <div part="indicator" class="progress-bar__indicator" style=${i({ width: this.percentage + "%" })}>
  40. ${!this.indeterminate ? T`
  41. <span part="label" class="progress-bar__label">
  42. <slot></slot>
  43. </span>
  44. ` : ""}
  45. </div>
  46. </div>
  47. `;
  48. }
  49. };
  50. SlProgressBar.styles = r(progress_bar_default);
  51. __decorateClass([
  52. e({ type: Number, reflect: true })
  53. ], SlProgressBar.prototype, "percentage", 2);
  54. __decorateClass([
  55. e({ type: Boolean, reflect: true })
  56. ], SlProgressBar.prototype, "indeterminate", 2);
  57. SlProgressBar = __decorateClass([
  58. n("sl-progress-bar")
  59. ], SlProgressBar);
  60. var progress_bar_default2 = SlProgressBar;
  61. export {
  62. progress_bar_default2 as progress_bar_default
  63. };