@dile/ui 2.22.1 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,2 @@
1
- export { DileSpinner } from './src/DileSpinner.js';
1
+ export { DileSpinner } from './src/DileSpinner.js';
2
+ export { DileSpinnerBar } from './src/DileSpinnerBar.js';
@@ -0,0 +1,3 @@
1
+ import { DileSpinnerBar } from "./src/DileSpinnerBar.js";
2
+
3
+ window.customElements.define("dile-spinner-bar", DileSpinnerBar);
@@ -0,0 +1,39 @@
1
+ import { LitElement, html, css } from 'lit';
2
+ import { DileSpinnerMixin } from './DileSpinnerMixin.js';
3
+
4
+ export class DileSpinnerBar extends DileSpinnerMixin(LitElement) {
5
+ static styles = [
6
+ css`
7
+ :host {
8
+ display: block;
9
+ }
10
+ .bar {
11
+ width: 100%;
12
+ height: var(--dile-spinner-bar-height, 4px);
13
+ border-radius: var(--dile-spinner-bar-border-radius, 0);
14
+ background: linear-gradient(
15
+ 90deg,
16
+ var(--dile-spinner-bar-color-1, #1e3c72) 0%,
17
+ var(--dile-spinner-bar-color-2, #00d4ff) 50%,
18
+ var(--dile-spinner-bar-color-1, #1e3c72) 100%
19
+ );
20
+ background-size: 200% 100%;
21
+ animation: dile-bar-shimmer var(--dile-spinner-bar-animation-time, 1.8s) ease-in-out infinite;
22
+ }
23
+ @keyframes dile-bar-shimmer {
24
+ 0% { background-position: 0% 50%; }
25
+ 50% { background-position: 100% 50%; }
26
+ 100% { background-position: 0% 50%; }
27
+ }
28
+ `
29
+ ];
30
+
31
+ render() {
32
+ return html`
33
+ ${this.active
34
+ ? html`<div class="bar"></div>`
35
+ : ''
36
+ }
37
+ `;
38
+ }
39
+ }
@@ -24,6 +24,10 @@ export class DileToastPersistent extends DileOverlay(LitElement) {
24
24
  right: 0px;
25
25
  left: auto;
26
26
  }
27
+ :host([center]:not([right])) span {
28
+ left: 50%;
29
+ right: auto;
30
+ }
27
31
  #overlay {
28
32
  box-sizing: border-box;
29
33
  color: var(--dile-toast-persistent-color, #fff);
@@ -53,7 +57,11 @@ export class DileToastPersistent extends DileOverlay(LitElement) {
53
57
 
54
58
  static get properties() {
55
59
  return {
56
- right: {
60
+ right: {
61
+ type: Boolean,
62
+ reflect: true
63
+ },
64
+ center: {
57
65
  type: Boolean,
58
66
  reflect: true
59
67
  },
@@ -79,8 +87,17 @@ export class DileToastPersistent extends DileOverlay(LitElement) {
79
87
  }
80
88
 
81
89
  updated(changedProperties) {
82
- if(changedProperties.has('right') && this.right !== undefined) {
83
- this.horizontalAlign = this.right ? 'left' : 'right';
90
+ if(changedProperties.has('right') || changedProperties.has('center')) {
91
+ if (this.right) {
92
+ this.horizontalAlign = 'left';
93
+ this.moveLeft = -10;
94
+ } else if (this.center) {
95
+ this.horizontalAlign = 'center';
96
+ this.moveLeft = 0;
97
+ } else {
98
+ this.horizontalAlign = 'right';
99
+ this.moveLeft = -10;
100
+ }
84
101
  }
85
102
  }
86
103
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dile/ui",
3
- "version": "2.22.1",
3
+ "version": "2.23.0",
4
4
  "description": "UI Core components from dile-components.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "publishConfig": {
27
27
  "access": "public"
28
28
  },
29
- "gitHead": "20de388e2c9140eb18f37c5f4102efc1da4b955a"
29
+ "gitHead": "47e4ddf20a4d15b4fb71f13724872ffdc06cfb0c"
30
30
  }