nve-designsystem 0.3.2 → 0.3.4

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.
Files changed (53) hide show
  1. package/chunks/{chunk.7OLWOZOB.js → chunk.2NJFRWZV.js} +1 -1
  2. package/chunks/{chunk.KWPBDQ6I.js → chunk.2RCF7SLU.js} +1 -1
  3. package/chunks/{chunk.LHI6QEL2.js → chunk.3EPZX5HE.js} +1 -1
  4. package/chunks/{chunk.JA7IPEW3.js → chunk.4K24TN3D.js} +4 -4
  5. package/chunks/{chunk.L4XM7VSU.js → chunk.6HLGYC3C.js} +4 -4
  6. package/chunks/{chunk.C2BA3SSZ.js → chunk.7DDYEY2M.js} +1 -1
  7. package/chunks/{chunk.XGGOIW4X.js → chunk.7EHPR4EM.js} +1 -1
  8. package/chunks/{chunk.XJILXOW4.js → chunk.AYP3HPB7.js} +2 -2
  9. package/chunks/{chunk.2FB5TK5H.js → chunk.CCJUT23E.js} +1 -1
  10. package/chunks/{chunk.EIGIU6GJ.js → chunk.CKUHGEST.js} +2 -2
  11. package/chunks/{chunk.N6VGRU7O.js → chunk.DQ4DJ4AJ.js} +5 -5
  12. package/chunks/{chunk.MVKF2MV6.js → chunk.DZGTLMEZ.js} +3 -3
  13. package/chunks/{chunk.62L7S2LE.js → chunk.H24ENZMO.js} +2 -2
  14. package/chunks/{chunk.4V3LPB2X.js → chunk.IHZEMJ7S.js} +3 -3
  15. package/chunks/{chunk.6OYGZP33.js → chunk.ITPUUJXW.js} +3 -3
  16. package/chunks/{chunk.VVYY25KM.js → chunk.IZD4DHXL.js} +4 -4
  17. package/chunks/{chunk.FZZ6EDTG.js → chunk.KSOMZJI5.js} +1 -1
  18. package/chunks/chunk.NLWS5DN7.js +118 -0
  19. package/chunks/{chunk.4SGTRSOV.js → chunk.NZL6FC7F.js} +138 -47
  20. package/chunks/{chunk.ALSPWWWG.js → chunk.O7VCMB7W.js} +40 -39
  21. package/chunks/{chunk.KKYBVPZ5.js → chunk.OJYFHDX5.js} +4 -4
  22. package/chunks/{chunk.2IGSSN44.js → chunk.PIGCKFMH.js} +2 -2
  23. package/chunks/{chunk.3MBST6KA.js → chunk.QPGW3IHR.js} +4 -4
  24. package/chunks/{chunk.7HOIOSC7.js → chunk.R2T2D3TO.js} +1 -1
  25. package/chunks/{chunk.FWDECKQY.js → chunk.RW5OZQWQ.js} +24 -15
  26. package/chunks/{chunk.PY3UYT6X.js → chunk.VP77VWVR.js} +6 -6
  27. package/chunks/{chunk.FBL77HIN.js → chunk.X66VV6J2.js} +6 -5
  28. package/components/nve-accordion/nve-accordion.component.d.ts +12 -2
  29. package/components/nve-accordion/nve-accordion.component.js +34 -22
  30. package/components/nve-accordion/nve-accordion.styles.js +113 -3
  31. package/components/nve-alert/nve-alert.component.js +4 -4
  32. package/components/nve-button/nve-button.component.js +5 -5
  33. package/components/nve-checkbox/nve-checkbox.component.js +4 -4
  34. package/components/nve-dialog/nve-dialog.component.js +4 -4
  35. package/components/nve-divider/nve-divider.component.js +2 -2
  36. package/components/nve-dropdown/nve-dropdown.component.js +3 -3
  37. package/components/nve-input/nve-input.component.js +4 -4
  38. package/components/nve-menu/nve-menu.component.js +2 -2
  39. package/components/nve-menu-item/nve-menu-item.component.js +5 -5
  40. package/components/nve-option/nve-option.component.js +3 -3
  41. package/components/nve-popup/nve-popup.component.js +3 -3
  42. package/components/nve-radio/nve-radio.component.js +3 -3
  43. package/components/nve-radio-button/nve-radio-button.component.js +2 -2
  44. package/components/nve-radio-group/nve-radio-group.component.js +3 -3
  45. package/components/nve-radio-group/nve-radio-group.styles.js +1 -1
  46. package/components/nve-relative-time/nve-relative-time.component.js +1566 -1484
  47. package/components/nve-select/nve-select.component.js +6 -6
  48. package/components/nve-skeleton/nve-skeleton.component.js +2 -2
  49. package/components/nve-spinner/nve-spinner.component.js +3 -3
  50. package/components/nve-tooltip/nve-tooltip.component.js +3 -3
  51. package/custom-elements.json +152 -73
  52. package/package.json +2 -2
  53. package/chunks/chunk.5THGRZAA.js +0 -98
@@ -1,4 +1,4 @@
1
- import { S as e } from "./chunk.7HOIOSC7.js";
1
+ import { S as e } from "./chunk.R2T2D3TO.js";
2
2
  var r = e;
3
3
  e.define("sl-spinner");
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { _ as c, a as m } from "./chunk.5THGRZAA.js";
1
+ import { _ as c, a as m } from "./chunk.NLWS5DN7.js";
2
2
  var a = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakSet(), l = /* @__PURE__ */ new WeakMap(), y = class {
3
3
  constructor(e, i) {
4
4
  this.handleFormData = (t) => {
@@ -1,4 +1,4 @@
1
- import { _ as s, a } from "./chunk.5THGRZAA.js";
1
+ import { _ as s, a } from "./chunk.NLWS5DN7.js";
2
2
  var u = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new WeakMap();
3
3
  function c(t) {
4
4
  return t ?? { keyframes: [], options: { duration: 0 } };
@@ -1,12 +1,12 @@
1
1
  import { a as b } from "./chunk.LXDTFLWU.js";
2
- import { d as F, c as A, b as a, S as E } from "./chunk.5THGRZAA.js";
2
+ import { d as F, c as A, b as a, S as E } from "./chunk.NLWS5DN7.js";
3
3
  import { l as _, u as w } from "./chunk.RWUUFNUL.js";
4
4
  import { i as D, k as x } from "./lit-element.js";
5
- import { S } from "./chunk.XJILXOW4.js";
6
- import { s as h, g as n, b as d, a as p, w as k } from "./chunk.LHI6QEL2.js";
5
+ import { S } from "./chunk.AYP3HPB7.js";
6
+ import { s as h, g as n, b as d, a as p, w as k } from "./chunk.3EPZX5HE.js";
7
7
  import { H as L } from "./chunk.NYIIDP5N.js";
8
8
  import { L as z } from "./chunk.WLV3FVBR.js";
9
- import { w as T } from "./chunk.2FB5TK5H.js";
9
+ import { w as T } from "./chunk.CCJUT23E.js";
10
10
  import { R as H } from "./class-map.js";
11
11
  import { t as C } from "./if-defined.js";
12
12
  import { n as m } from "./property.js";
@@ -1,11 +1,11 @@
1
1
  import { i as n, k as l } from "./lit-element.js";
2
2
  import { d as h } from "./chunk.GI7VDIWX.js";
3
3
  import { f as d } from "./chunk.SI4ACBFK.js";
4
- import { F as u } from "./chunk.KWPBDQ6I.js";
4
+ import { F as u } from "./chunk.2RCF7SLU.js";
5
5
  import { H as p } from "./chunk.NYIIDP5N.js";
6
- import { S as m } from "./chunk.ALSPWWWG.js";
7
- import { w as a } from "./chunk.2FB5TK5H.js";
8
- import { c as b, b as t, S as k } from "./chunk.5THGRZAA.js";
6
+ import { S as m } from "./chunk.O7VCMB7W.js";
7
+ import { w as a } from "./chunk.CCJUT23E.js";
8
+ import { c as b, b as t, S as k } from "./chunk.NLWS5DN7.js";
9
9
  import { R as s } from "./class-map.js";
10
10
  import { t as f } from "./if-defined.js";
11
11
  import { F as c } from "./live.js";
@@ -1,4 +1,4 @@
1
- import { S as p } from "./chunk.62L7S2LE.js";
1
+ import { S as p } from "./chunk.H24ENZMO.js";
2
2
  var a = p;
3
3
  p.define("sl-popup");
4
4
  export {
@@ -1,5 +1,5 @@
1
1
  import { i as a, k as u } from "./lit-element.js";
2
- import { c, b as d, S as m } from "./chunk.5THGRZAA.js";
2
+ import { c, b as d, S as m } from "./chunk.NLWS5DN7.js";
3
3
  import { e as h } from "./query.js";
4
4
  var f = a`
5
5
  :host {
@@ -1,6 +1,6 @@
1
1
  import { i as a } from "./lit-element.js";
2
- import { S as l } from "./chunk.ALSPWWWG.js";
3
- import { c, b as i, S as u } from "./chunk.5THGRZAA.js";
2
+ import { S as l } from "./chunk.O7VCMB7W.js";
3
+ import { c, b as i, S as u } from "./chunk.NLWS5DN7.js";
4
4
  import { R as d } from "./class-map.js";
5
5
  import { e as n, k as b } from "./static.js";
6
6
  import { t as e } from "./if-defined.js";
@@ -1,4 +1,4 @@
1
- import { a as u } from "./chunk.5THGRZAA.js";
1
+ import { a as u } from "./chunk.NLWS5DN7.js";
2
2
  function w(t, c) {
3
3
  const l = u({
4
4
  waitUntilFirstUpdate: !1
@@ -1,8 +1,8 @@
1
1
  import { b as l } from "./chunk.MAQXLKQ7.js";
2
2
  import { i as a } from "./lit-element.js";
3
3
  import { H as r } from "./chunk.NYIIDP5N.js";
4
- import { w as u } from "./chunk.2FB5TK5H.js";
5
- import { c as n, b as e, S as h } from "./chunk.5THGRZAA.js";
4
+ import { w as u } from "./chunk.CCJUT23E.js";
5
+ import { c as n, b as e, S as h } from "./chunk.NLWS5DN7.js";
6
6
  import { R as d } from "./class-map.js";
7
7
  import { k as p } from "./static.js";
8
8
  import { t as b } from "./if-defined.js";
@@ -1,12 +1,12 @@
1
1
  import { i as S, D as g, k as c } from "./lit-element.js";
2
2
  import { r as k } from "./directive-helpers.js";
3
3
  import { i as _, t as C, e as w, R as $ } from "./class-map.js";
4
- import { S as A } from "./chunk.62L7S2LE.js";
5
- import { S as L } from "./chunk.7HOIOSC7.js";
4
+ import { S as A } from "./chunk.H24ENZMO.js";
5
+ import { S as L } from "./chunk.R2T2D3TO.js";
6
6
  import { H as E, g as M } from "./chunk.NYIIDP5N.js";
7
- import { S as R } from "./chunk.ALSPWWWG.js";
8
- import { w as b } from "./chunk.2FB5TK5H.js";
9
- import { c as T, b as l, S as P } from "./chunk.5THGRZAA.js";
7
+ import { S as R } from "./chunk.O7VCMB7W.js";
8
+ import { w as b } from "./chunk.CCJUT23E.js";
9
+ import { c as T, b as l, S as P } from "./chunk.NLWS5DN7.js";
10
10
  import { n as d } from "./property.js";
11
11
  import { e as y } from "./query.js";
12
12
  var D = S`
@@ -1,8 +1,8 @@
1
1
  import { i as r, k as c } from "./lit-element.js";
2
2
  import { L as p } from "./chunk.WLV3FVBR.js";
3
- import { S as d } from "./chunk.ALSPWWWG.js";
4
- import { w as a } from "./chunk.2FB5TK5H.js";
5
- import { c as h, b as t, S as u } from "./chunk.5THGRZAA.js";
3
+ import { S as d } from "./chunk.O7VCMB7W.js";
4
+ import { w as a } from "./chunk.CCJUT23E.js";
5
+ import { c as h, b as t, S as u } from "./chunk.NLWS5DN7.js";
6
6
  import { R as f } from "./class-map.js";
7
7
  import { n } from "./property.js";
8
8
  import { r as i } from "./state.js";
@@ -1,5 +1,5 @@
1
1
  import { i as $t, k as yt } from "./lit-element.js";
2
- import { c as Dt, b as x, S as Nt, _ as Mt, a as _t } from "./chunk.5THGRZAA.js";
2
+ import { c as Dt, b as x, S as Nt, _ as Mt, a as _t } from "./chunk.NLWS5DN7.js";
3
3
  import { R as bt } from "./class-map.js";
4
4
  import { n as E } from "./property.js";
5
5
  import { e as At } from "./query.js";
@@ -1033,7 +1033,7 @@ var v = class extends Nt {
1033
1033
  const t = this.getRootNode();
1034
1034
  this.anchorEl = t.getElementById(this.anchor);
1035
1035
  } else this.anchor instanceof Element || ve(this.anchor) ? this.anchorEl = this.anchor : this.anchorEl = this.querySelector('[slot="anchor"]');
1036
- this.anchorEl instanceof HTMLSlotElement && (this.anchorEl = this.anchorEl.assignedElements({ flatten: !0 })[0]), this.anchorEl && this.start();
1036
+ this.anchorEl instanceof HTMLSlotElement && (this.anchorEl = this.anchorEl.assignedElements({ flatten: !0 })[0]), this.anchorEl && this.active && this.start();
1037
1037
  }
1038
1038
  start() {
1039
1039
  this.anchorEl && (this.cleanup = me(this.anchorEl, this.popup, () => {
@@ -1,7 +1,7 @@
1
1
  import { i as a, k as t } from "./lit-element.js";
2
- import { S as l } from "./chunk.ALSPWWWG.js";
3
- import { w as r } from "./chunk.2FB5TK5H.js";
4
- import { c as d, b as i, S as n } from "./chunk.5THGRZAA.js";
2
+ import { S as l } from "./chunk.O7VCMB7W.js";
3
+ import { w as r } from "./chunk.CCJUT23E.js";
4
+ import { c as d, b as i, S as n } from "./chunk.NLWS5DN7.js";
5
5
  import { R as c } from "./class-map.js";
6
6
  import { n as o } from "./property.js";
7
7
  import { r as s } from "./state.js";
@@ -1,12 +1,12 @@
1
1
  import { i as f, k as c } from "./lit-element.js";
2
2
  import { f as _ } from "./chunk.SI4ACBFK.js";
3
- import { F as C, c as R, a as x, v as V } from "./chunk.KWPBDQ6I.js";
4
- import { c as g, b as l, S as b } from "./chunk.5THGRZAA.js";
3
+ import { c as g, b as l, S as b } from "./chunk.NLWS5DN7.js";
5
4
  import { n as r } from "./property.js";
6
5
  import { r as p } from "./state.js";
7
6
  import { e as m } from "./query.js";
7
+ import { F as C, c as R, a as x, v as V } from "./chunk.2RCF7SLU.js";
8
8
  import { H as k } from "./chunk.NYIIDP5N.js";
9
- import { w as v } from "./chunk.2FB5TK5H.js";
9
+ import { w as v } from "./chunk.CCJUT23E.js";
10
10
  import { R as w } from "./class-map.js";
11
11
  var A = f`
12
12
  :host {
@@ -1,9 +1,9 @@
1
1
  import { i as y, k as f } from "./lit-element.js";
2
- import { S as g } from "./chunk.62L7S2LE.js";
3
- import { s as m, p as l, a as h, g as d, b as c, w as u } from "./chunk.LHI6QEL2.js";
2
+ import { S as g } from "./chunk.H24ENZMO.js";
3
+ import { s as m, p as l, a as h, g as d, b as c, w as u } from "./chunk.3EPZX5HE.js";
4
4
  import { L as v } from "./chunk.WLV3FVBR.js";
5
- import { w as p } from "./chunk.2FB5TK5H.js";
6
- import { c as w, b as o, S as b } from "./chunk.5THGRZAA.js";
5
+ import { w as p } from "./chunk.CCJUT23E.js";
6
+ import { c as w, b as o, S as b } from "./chunk.NLWS5DN7.js";
7
7
  import { R as k } from "./class-map.js";
8
8
  import { n as i } from "./property.js";
9
9
  import { e as n } from "./query.js";
@@ -1,5 +1,5 @@
1
1
  import { i as o, k as s } from "./lit-element.js";
2
- import { c as r, b as t, S as a } from "./chunk.5THGRZAA.js";
2
+ import { c as r, b as t, S as a } from "./chunk.NLWS5DN7.js";
3
3
  import { R as n } from "./class-map.js";
4
4
  import { n as i } from "./property.js";
5
5
  var l = o`
@@ -0,0 +1,118 @@
1
+ import { i as y, h as b } from "./lit-element.js";
2
+ import { n as d } from "./property.js";
3
+ var v = Object.defineProperty, P = Object.defineProperties, O = Object.getOwnPropertyDescriptor, g = Object.getOwnPropertyDescriptors, h = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, E = Object.prototype.propertyIsEnumerable, c = (r, e) => (e = Symbol[r]) ? e : Symbol.for("Symbol." + r), p = (r, e, t) => e in r ? v(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, S = (r, e) => {
4
+ for (var t in e || (e = {}))
5
+ m.call(e, t) && p(r, t, e[t]);
6
+ if (h)
7
+ for (var t of h(e))
8
+ E.call(e, t) && p(r, t, e[t]);
9
+ return r;
10
+ }, $ = (r, e) => P(r, g(e)), u = (r, e, t, s) => {
11
+ for (var i = s > 1 ? void 0 : s ? O(e, t) : e, a = r.length - 1, n; a >= 0; a--)
12
+ (n = r[a]) && (i = (s ? n(e, t, i) : n(i)) || i);
13
+ return s && i && v(e, t, i), i;
14
+ }, _ = (r, e, t) => {
15
+ if (!e.has(r))
16
+ throw TypeError("Cannot " + t);
17
+ }, x = (r, e, t) => (_(r, e, "read from private field"), e.get(r)), C = (r, e, t) => {
18
+ if (e.has(r))
19
+ throw TypeError("Cannot add the same private member more than once");
20
+ e instanceof WeakSet ? e.add(r) : e.set(r, t);
21
+ }, j = (r, e, t, s) => (_(r, e, "write to private field"), e.set(r, t), t), R = function(r, e) {
22
+ this[0] = r, this[1] = e;
23
+ }, A = (r) => {
24
+ var e = r[c("asyncIterator")], t = !1, s, i = {};
25
+ return e == null ? (e = r[c("iterator")](), s = (a) => i[a] = (n) => e[a](n)) : (e = e.call(r), s = (a) => i[a] = (n) => {
26
+ if (t) {
27
+ if (t = !1, a === "throw")
28
+ throw n;
29
+ return n;
30
+ }
31
+ return t = !0, {
32
+ done: !1,
33
+ value: new R(new Promise((w) => {
34
+ var f = e[a](n);
35
+ if (!(f instanceof Object))
36
+ throw TypeError("Object expected");
37
+ w(f);
38
+ }), 1)
39
+ };
40
+ }), i[c("iterator")] = () => i, s("next"), "throw" in e ? s("throw") : i.throw = (a) => {
41
+ throw a;
42
+ }, "return" in e && s("return"), i;
43
+ }, T = y`
44
+ :host {
45
+ box-sizing: border-box;
46
+ }
47
+
48
+ :host *,
49
+ :host *::before,
50
+ :host *::after {
51
+ box-sizing: inherit;
52
+ }
53
+
54
+ [hidden] {
55
+ display: none !important;
56
+ }
57
+ `, o, l = class extends b {
58
+ constructor() {
59
+ super(), C(this, o, !1), this.initialReflectedProperties = /* @__PURE__ */ new Map(), Object.entries(this.constructor.dependencies).forEach(([r, e]) => {
60
+ this.constructor.define(r, e);
61
+ });
62
+ }
63
+ emit(r, e) {
64
+ const t = new CustomEvent(r, S({
65
+ bubbles: !0,
66
+ cancelable: !1,
67
+ composed: !0,
68
+ detail: {}
69
+ }, e));
70
+ return this.dispatchEvent(t), t;
71
+ }
72
+ /* eslint-enable */
73
+ static define(r, e = this, t = {}) {
74
+ const s = customElements.get(r);
75
+ if (!s) {
76
+ try {
77
+ customElements.define(r, e, t);
78
+ } catch {
79
+ customElements.define(r, class extends e {
80
+ }, t);
81
+ }
82
+ return;
83
+ }
84
+ let i = " (unknown version)", a = i;
85
+ "version" in e && e.version && (i = " v" + e.version), "version" in s && s.version && (a = " v" + s.version), !(i && a && i === a) && console.warn(
86
+ `Attempted to register <${r}>${i}, but <${r}>${a} has already been registered.`
87
+ );
88
+ }
89
+ attributeChangedCallback(r, e, t) {
90
+ x(this, o) || (this.constructor.elementProperties.forEach(
91
+ (s, i) => {
92
+ s.reflect && this[i] != null && this.initialReflectedProperties.set(i, this[i]);
93
+ }
94
+ ), j(this, o, !0)), super.attributeChangedCallback(r, e, t);
95
+ }
96
+ willUpdate(r) {
97
+ super.willUpdate(r), this.initialReflectedProperties.forEach((e, t) => {
98
+ r.has(t) && this[t] == null && (this[t] = e);
99
+ });
100
+ }
101
+ };
102
+ o = /* @__PURE__ */ new WeakMap();
103
+ l.version = "2.17.1";
104
+ l.dependencies = {};
105
+ u([
106
+ d()
107
+ ], l.prototype, "dir", 2);
108
+ u([
109
+ d()
110
+ ], l.prototype, "lang", 2);
111
+ export {
112
+ l as S,
113
+ $ as _,
114
+ S as a,
115
+ u as b,
116
+ T as c,
117
+ A as d
118
+ };
@@ -1,14 +1,15 @@
1
- import { S as u } from "./chunk.XJILXOW4.js";
2
- import { s as h, a as i, g as l, b as n, w as c } from "./chunk.LHI6QEL2.js";
3
- import { H as m } from "./chunk.NYIIDP5N.js";
1
+ import { S as w } from "./chunk.AYP3HPB7.js";
2
+ import { s as u, a as s, g as l, b as d, w as c } from "./chunk.3EPZX5HE.js";
3
+ import { H as g } from "./chunk.NYIIDP5N.js";
4
4
  import { L as f } from "./chunk.WLV3FVBR.js";
5
- import { i as v, k as d } from "./lit-element.js";
6
- import { w as p } from "./chunk.2FB5TK5H.js";
7
- import { c as b, b as t, S as g } from "./chunk.5THGRZAA.js";
8
- import { R as y } from "./class-map.js";
9
- import { n as s } from "./property.js";
10
- import { e as _ } from "./query.js";
11
- var w = v`
5
+ import { i as _, k as n } from "./lit-element.js";
6
+ import { w as p } from "./chunk.CCJUT23E.js";
7
+ import { c as b, b as a, S as y } from "./chunk.NLWS5DN7.js";
8
+ import { R as h } from "./class-map.js";
9
+ import { n as i } from "./property.js";
10
+ import { r as T } from "./state.js";
11
+ import { e as m } from "./query.js";
12
+ var C = _`
12
13
  :host {
13
14
  display: contents;
14
15
 
@@ -30,6 +31,7 @@ var w = v`
30
31
  line-height: 1.6;
31
32
  color: var(--sl-color-neutral-700);
32
33
  margin: inherit;
34
+ overflow: hidden;
33
35
  }
34
36
 
35
37
  .alert:not(.alert--has-icon) .alert__icon,
@@ -45,6 +47,10 @@ var w = v`
45
47
  padding-inline-start: var(--sl-spacing-large);
46
48
  }
47
49
 
50
+ .alert--has-countdown {
51
+ border-bottom: none;
52
+ }
53
+
48
54
  .alert--primary {
49
55
  border-top-color: var(--sl-color-primary-600);
50
56
  }
@@ -99,31 +105,92 @@ var w = v`
99
105
  font-size: var(--sl-font-size-medium);
100
106
  padding-inline-end: var(--sl-spacing-medium);
101
107
  }
102
- `, a = Object.assign(document.createElement("div"), { className: "sl-toast-stack" }), e = class extends g {
108
+
109
+ .alert__countdown {
110
+ position: absolute;
111
+ bottom: 0;
112
+ left: 0;
113
+ width: 100%;
114
+ height: calc(var(--sl-panel-border-width) * 3);
115
+ background-color: var(--sl-panel-border-color);
116
+ display: flex;
117
+ }
118
+
119
+ .alert__countdown--ltr {
120
+ justify-content: flex-end;
121
+ }
122
+
123
+ .alert__countdown .alert__countdown-elapsed {
124
+ height: 100%;
125
+ width: 0;
126
+ }
127
+
128
+ .alert--primary .alert__countdown-elapsed {
129
+ background-color: var(--sl-color-primary-600);
130
+ }
131
+
132
+ .alert--success .alert__countdown-elapsed {
133
+ background-color: var(--sl-color-success-600);
134
+ }
135
+
136
+ .alert--neutral .alert__countdown-elapsed {
137
+ background-color: var(--sl-color-neutral-600);
138
+ }
139
+
140
+ .alert--warning .alert__countdown-elapsed {
141
+ background-color: var(--sl-color-warning-600);
142
+ }
143
+
144
+ .alert--danger .alert__countdown-elapsed {
145
+ background-color: var(--sl-color-danger-600);
146
+ }
147
+
148
+ .alert__timer {
149
+ display: none;
150
+ }
151
+ `, r = Object.assign(document.createElement("div"), { className: "sl-toast-stack" }), e = class extends y {
103
152
  constructor() {
104
- super(...arguments), this.hasSlotController = new m(this, "icon", "suffix"), this.localize = new f(this), this.open = !1, this.closable = !1, this.variant = "primary", this.duration = 1 / 0;
153
+ super(...arguments), this.hasSlotController = new g(this, "icon", "suffix"), this.localize = new f(this), this.open = !1, this.closable = !1, this.variant = "primary", this.duration = 1 / 0, this.remainingTime = this.duration;
105
154
  }
106
155
  firstUpdated() {
107
156
  this.base.hidden = !this.open;
108
157
  }
109
158
  restartAutoHide() {
110
- clearTimeout(this.autoHideTimeout), this.open && this.duration < 1 / 0 && (this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration));
159
+ this.handleCountdownChange(), clearTimeout(this.autoHideTimeout), clearInterval(this.remainingTimeInterval), this.open && this.duration < 1 / 0 && (this.autoHideTimeout = window.setTimeout(() => this.hide(), this.duration), this.remainingTime = this.duration, this.remainingTimeInterval = window.setInterval(() => {
160
+ this.remainingTime -= 100;
161
+ }, 100));
162
+ }
163
+ pauseAutoHide() {
164
+ var t;
165
+ (t = this.countdownAnimation) == null || t.pause(), clearTimeout(this.autoHideTimeout), clearInterval(this.remainingTimeInterval);
166
+ }
167
+ resumeAutoHide() {
168
+ var t;
169
+ this.duration < 1 / 0 && (this.autoHideTimeout = window.setTimeout(() => this.hide(), this.remainingTime), this.remainingTimeInterval = window.setInterval(() => {
170
+ this.remainingTime -= 100;
171
+ }, 100), (t = this.countdownAnimation) == null || t.play());
172
+ }
173
+ handleCountdownChange() {
174
+ if (this.open && this.duration < 1 / 0 && this.countdown) {
175
+ const { countdownElement: t } = this, o = "100%", v = "0";
176
+ this.countdownAnimation = t.animate([{ width: o }, { width: v }], {
177
+ duration: this.duration,
178
+ easing: "linear"
179
+ });
180
+ }
111
181
  }
112
182
  handleCloseClick() {
113
183
  this.hide();
114
184
  }
115
- handleMouseMove() {
116
- this.restartAutoHide();
117
- }
118
185
  async handleOpenChange() {
119
186
  if (this.open) {
120
- this.emit("sl-show"), this.duration < 1 / 0 && this.restartAutoHide(), await i(this.base), this.base.hidden = !1;
121
- const { keyframes: r, options: o } = l(this, "alert.show", { dir: this.localize.dir() });
122
- await n(this.base, r, o), this.emit("sl-after-show");
187
+ this.emit("sl-show"), this.duration < 1 / 0 && this.restartAutoHide(), await s(this.base), this.base.hidden = !1;
188
+ const { keyframes: t, options: o } = l(this, "alert.show", { dir: this.localize.dir() });
189
+ await d(this.base, t, o), this.emit("sl-after-show");
123
190
  } else {
124
- this.emit("sl-hide"), clearTimeout(this.autoHideTimeout), await i(this.base);
125
- const { keyframes: r, options: o } = l(this, "alert.hide", { dir: this.localize.dir() });
126
- await n(this.base, r, o), this.base.hidden = !0, this.emit("sl-after-hide");
191
+ this.emit("sl-hide"), clearTimeout(this.autoHideTimeout), clearInterval(this.remainingTimeInterval), await s(this.base);
192
+ const { keyframes: t, options: o } = l(this, "alert.hide", { dir: this.localize.dir() });
193
+ await d(this.base, t, o), this.base.hidden = !0, this.emit("sl-after-hide");
127
194
  }
128
195
  }
129
196
  handleDurationChange() {
@@ -145,26 +212,27 @@ var w = v`
145
212
  * calling this method again. The returned promise will resolve after the alert is hidden.
146
213
  */
147
214
  async toast() {
148
- return new Promise((r) => {
149
- a.parentElement === null && document.body.append(a), a.appendChild(this), requestAnimationFrame(() => {
215
+ return new Promise((t) => {
216
+ this.handleCountdownChange(), r.parentElement === null && document.body.append(r), r.appendChild(this), requestAnimationFrame(() => {
150
217
  this.clientWidth, this.show();
151
218
  }), this.addEventListener(
152
219
  "sl-after-hide",
153
220
  () => {
154
- a.removeChild(this), r(), a.querySelector("sl-alert") === null && a.remove();
221
+ r.removeChild(this), t(), r.querySelector("sl-alert") === null && r.remove();
155
222
  },
156
223
  { once: !0 }
157
224
  );
158
225
  });
159
226
  }
160
227
  render() {
161
- return d`
228
+ return n`
162
229
  <div
163
230
  part="base"
164
- class=${y({
231
+ class=${h({
165
232
  alert: !0,
166
233
  "alert--open": this.open,
167
234
  "alert--closable": this.closable,
235
+ "alert--has-countdown": !!this.countdown,
168
236
  "alert--has-icon": this.hasSlotController.test("icon"),
169
237
  "alert--primary": this.variant === "primary",
170
238
  "alert--success": this.variant === "success",
@@ -174,7 +242,8 @@ var w = v`
174
242
  })}
175
243
  role="alert"
176
244
  aria-hidden=${this.open ? "false" : "true"}
177
- @mousemove=${this.handleMouseMove}
245
+ @mouseenter=${this.pauseAutoHide}
246
+ @mouseleave=${this.resumeAutoHide}
178
247
  >
179
248
  <div part="icon" class="alert__icon">
180
249
  <slot name="icon"></slot>
@@ -184,7 +253,7 @@ var w = v`
184
253
  <slot></slot>
185
254
  </div>
186
255
 
187
- ${this.closable ? d`
256
+ ${this.closable ? n`
188
257
  <sl-icon-button
189
258
  part="close-button"
190
259
  exportparts="base:close-button__base"
@@ -195,49 +264,71 @@ var w = v`
195
264
  @click=${this.handleCloseClick}
196
265
  ></sl-icon-button>
197
266
  ` : ""}
267
+
268
+ <div role="timer" class="alert__timer">${this.remainingTime}</div>
269
+
270
+ ${this.countdown ? n`
271
+ <div
272
+ class=${h({
273
+ alert__countdown: !0,
274
+ "alert__countdown--ltr": this.countdown === "ltr"
275
+ })}
276
+ >
277
+ <div class="alert__countdown-elapsed"></div>
278
+ </div>
279
+ ` : ""}
198
280
  </div>
199
281
  `;
200
282
  }
201
283
  };
202
- e.styles = [b, w];
203
- e.dependencies = { "sl-icon-button": u };
204
- t([
205
- _('[part~="base"]')
284
+ e.styles = [b, C];
285
+ e.dependencies = { "sl-icon-button": w };
286
+ a([
287
+ m('[part~="base"]')
206
288
  ], e.prototype, "base", 2);
207
- t([
208
- s({ type: Boolean, reflect: !0 })
289
+ a([
290
+ m(".alert__countdown-elapsed")
291
+ ], e.prototype, "countdownElement", 2);
292
+ a([
293
+ i({ type: Boolean, reflect: !0 })
209
294
  ], e.prototype, "open", 2);
210
- t([
211
- s({ type: Boolean, reflect: !0 })
295
+ a([
296
+ i({ type: Boolean, reflect: !0 })
212
297
  ], e.prototype, "closable", 2);
213
- t([
214
- s({ reflect: !0 })
298
+ a([
299
+ i({ reflect: !0 })
215
300
  ], e.prototype, "variant", 2);
216
- t([
217
- s({ type: Number })
301
+ a([
302
+ i({ type: Number })
218
303
  ], e.prototype, "duration", 2);
219
- t([
304
+ a([
305
+ i({ type: String, reflect: !0 })
306
+ ], e.prototype, "countdown", 2);
307
+ a([
308
+ T()
309
+ ], e.prototype, "remainingTime", 2);
310
+ a([
220
311
  p("open", { waitUntilFirstUpdate: !0 })
221
312
  ], e.prototype, "handleOpenChange", 1);
222
- t([
313
+ a([
223
314
  p("duration")
224
315
  ], e.prototype, "handleDurationChange", 1);
225
- h("alert.show", {
316
+ u("alert.show", {
226
317
  keyframes: [
227
318
  { opacity: 0, scale: 0.8 },
228
319
  { opacity: 1, scale: 1 }
229
320
  ],
230
321
  options: { duration: 250, easing: "ease" }
231
322
  });
232
- h("alert.hide", {
323
+ u("alert.hide", {
233
324
  keyframes: [
234
325
  { opacity: 1, scale: 1 },
235
326
  { opacity: 0, scale: 0.8 }
236
327
  ],
237
328
  options: { duration: 250, easing: "ease" }
238
329
  });
239
- var D = e;
330
+ var B = e;
240
331
  e.define("sl-alert");
241
332
  export {
242
- D as a
333
+ B as a
243
334
  };