@lukso/web-components 1.0.6 → 1.2.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/assets/fonts/index.umd.cjs +1 -0
  3. package/dist/assets/images/index.ts +1 -0
  4. package/dist/assets/index.js +4 -0
  5. package/dist/assets/index.ts +1 -0
  6. package/dist/assets/index.umd.cjs +1 -0
  7. package/dist/components/index.d.ts +6 -0
  8. package/dist/components/index.js +2115 -0
  9. package/dist/components/index.umd.cjs +167 -0
  10. package/dist/components/lukso-button/index.d.ts +22 -0
  11. package/dist/components/lukso-button/index.js +1184 -0
  12. package/dist/components/lukso-button/index.umd.cjs +77 -0
  13. package/dist/components/lukso-navbar/index.d.ts +17 -0
  14. package/dist/components/lukso-navbar/index.js +1181 -0
  15. package/dist/components/lukso-navbar/index.umd.cjs +71 -0
  16. package/dist/components/lukso-test/index.d.ts +18 -0
  17. package/dist/components/lukso-test/index.js +1820 -0
  18. package/dist/components/lukso-test/index.umd.cjs +95 -0
  19. package/dist/components/lukso-wizard/index.d.ts +18 -0
  20. package/dist/components/lukso-wizard/index.js +1297 -0
  21. package/dist/components/lukso-wizard/index.umd.cjs +89 -0
  22. package/dist/index.d.ts +2 -0
  23. package/dist/index.js +2113 -4
  24. package/dist/index.umd.cjs +167 -0
  25. package/dist/sass/color-palette.ts +7 -0
  26. package/dist/sass/index.js +2 -2
  27. package/dist/sass/index.umd.cjs +1 -0
  28. package/dist/sass/typography.scss +1 -1
  29. package/dist/shared/assets/fonts/index.d.ts +2 -0
  30. package/dist/shared/assets/index.d.ts +2 -0
  31. package/dist/shared/directives/custom-class-map/index.d.ts +26 -0
  32. package/dist/shared/directives/index.d.ts +2 -0
  33. package/dist/shared/globals.d.ts +5 -0
  34. package/dist/shared/styles/index.d.ts +2 -0
  35. package/dist/shared/tailwind-element/index.d.ts +6 -0
  36. package/dist/shared/tailwind-element/index.js +1064 -0
  37. package/dist/shared/tailwind-element/index.umd.cjs +39 -0
  38. package/dist/shared/tailwind-element.js +1064 -0
  39. package/dist/shared/tailwind-element.umd.cjs +39 -0
  40. package/dist/styles/index.umd.cjs +1 -0
  41. package/dist/styles/main.css +1 -1
  42. package/package.json +55 -34
  43. package/src/components/index.ts +6 -0
  44. package/src/components/lukso-button/index.ts +74 -1
  45. package/src/components/lukso-button/lukso-button.stories.ts +29 -21
  46. package/src/components/lukso-navbar/index.ts +61 -0
  47. package/src/components/lukso-navbar/lukso-navbar.stories.ts +44 -0
  48. package/src/components/lukso-test/index.ts +1 -1
  49. package/src/components/lukso-test/test.stories.ts +1 -1
  50. package/src/components/lukso-wizard/index.ts +74 -0
  51. package/src/components/lukso-wizard/lukso-wizard.stories.ts +45 -0
  52. package/src/index.ts +1 -3
  53. package/src/shared/assets/images/index.ts +1 -0
  54. package/src/shared/assets/index.ts +1 -0
  55. package/src/shared/directives/{custom-class-map.ts → custom-class-map/index.ts} +1 -3
  56. package/src/shared/directives/index.ts +1 -0
  57. package/src/shared/styles/color-palette.ts +7 -0
  58. package/src/shared/styles/typography.scss +1 -1
  59. package/src/shared/{tailwind.element.ts → tailwind-element/index.ts} +1 -1
  60. package/tailwind.config.cjs +57 -1
  61. package/tools/color-palette.cjs +7 -1
  62. package/tools/color-palette.d.ts +5 -0
  63. package/tools/color-palette.d.ts.map +1 -1
  64. package/dist/assets/fonts/index.cjs +0 -1
  65. package/dist/directive-619b88dd.cjs +0 -55
  66. package/dist/directive-76d5504a.js +0 -1128
  67. package/dist/index.cjs +0 -1
  68. package/dist/lukso-button-4b795065.js +0 -57
  69. package/dist/lukso-button-ab7e2769.cjs +0 -17
  70. package/dist/lukso-button.cjs +0 -1
  71. package/dist/lukso-button.js +0 -2
  72. package/dist/lukso-test.cjs +0 -41
  73. package/dist/lukso-test.js +0 -710
  74. package/dist/sass/index.cjs +0 -1
  75. package/dist/styles/index.cjs +0 -1
  76. package/dist/styles/main.css.map +0 -1
  77. package/src/components/lukso-button/lukso-button.ts +0 -55
  78. package/src/docs/buttons.stories.mdx +0 -35
  79. package/src/docs/colors.stories.mdx +0 -72
  80. package/src/docs/typography.stories.mdx +0 -360
  81. package/src/globals.d.ts +0 -1
  82. package/src/tailwind.config.ts +0 -60
@@ -1,710 +0,0 @@
1
- import { e as nt, i as ot, t as rt, x as lt, c as ht, y as at, a as D, b as dt } from "./directive-76d5504a.js";
2
- /**
3
- * @license
4
- * Copyright 2017 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- var I;
8
- const T = window, f = T.trustedTypes, L = f ? f.createPolicy("lit-html", { createHTML: (o) => o }) : void 0, $ = `lit$${(Math.random() + "").slice(9)}$`, G = "?" + $, ct = `<${G}>`, g = document, E = (o = "") => g.createComment(o), w = (o) => o === null || typeof o != "object" && typeof o != "function", J = Array.isArray, ut = (o) => J(o) || typeof (o == null ? void 0 : o[Symbol.iterator]) == "function", y = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, j = /-->/g, B = />/g, m = RegExp(`>|[
9
- \f\r](?:([^\\s"'>=/]+)([
10
- \f\r]*=[
11
- \f\r]*(?:[^
12
- \f\r"'\`<>=]|("|')|))|$)`, "g"), F = /'/g, z = /"/g, tt = /^(?:script|style|textarea|title)$/i, C = Symbol.for("lit-noChange"), u = Symbol.for("lit-nothing"), W = /* @__PURE__ */ new WeakMap(), A = g.createTreeWalker(g, 129, null, !1), pt = (o, t) => {
13
- const i = o.length - 1, e = [];
14
- let s, n = t === 2 ? "<svg>" : "", r = y;
15
- for (let l = 0; l < i; l++) {
16
- const h = o[l];
17
- let p, a, c = -1, v = 0;
18
- for (; v < h.length && (r.lastIndex = v, a = r.exec(h), a !== null); )
19
- v = r.lastIndex, r === y ? a[1] === "!--" ? r = j : a[1] !== void 0 ? r = B : a[2] !== void 0 ? (tt.test(a[2]) && (s = RegExp("</" + a[2], "g")), r = m) : a[3] !== void 0 && (r = m) : r === m ? a[0] === ">" ? (r = s ?? y, c = -1) : a[1] === void 0 ? c = -2 : (c = r.lastIndex - a[2].length, p = a[1], r = a[3] === void 0 ? m : a[3] === '"' ? z : F) : r === z || r === F ? r = m : r === j || r === B ? r = y : (r = m, s = void 0);
20
- const N = r === m && o[l + 1].startsWith("/>") ? " " : "";
21
- n += r === y ? h + ct : c >= 0 ? (e.push(p), h.slice(0, c) + "$lit$" + h.slice(c) + $ + N) : h + $ + (c === -2 ? (e.push(void 0), l) : N);
22
- }
23
- const d = n + (o[i] || "<?>") + (t === 2 ? "</svg>" : "");
24
- if (!Array.isArray(o) || !o.hasOwnProperty("raw"))
25
- throw Error("invalid template strings array");
26
- return [L !== void 0 ? L.createHTML(d) : d, e];
27
- };
28
- class x {
29
- constructor({ strings: t, _$litType$: i }, e) {
30
- let s;
31
- this.parts = [];
32
- let n = 0, r = 0;
33
- const d = t.length - 1, l = this.parts, [h, p] = pt(t, i);
34
- if (this.el = x.createElement(h, e), A.currentNode = this.el.content, i === 2) {
35
- const a = this.el.content, c = a.firstChild;
36
- c.remove(), a.append(...c.childNodes);
37
- }
38
- for (; (s = A.nextNode()) !== null && l.length < d; ) {
39
- if (s.nodeType === 1) {
40
- if (s.hasAttributes()) {
41
- const a = [];
42
- for (const c of s.getAttributeNames())
43
- if (c.endsWith("$lit$") || c.startsWith($)) {
44
- const v = p[r++];
45
- if (a.push(c), v !== void 0) {
46
- const N = s.getAttribute(v.toLowerCase() + "$lit$").split($), O = /([.?@])?(.*)/.exec(v);
47
- l.push({ type: 1, index: n, name: O[2], strings: N, ctor: O[1] === "." ? $t : O[1] === "?" ? At : O[1] === "@" ? ft : P });
48
- } else
49
- l.push({ type: 6, index: n });
50
- }
51
- for (const c of a)
52
- s.removeAttribute(c);
53
- }
54
- if (tt.test(s.tagName)) {
55
- const a = s.textContent.split($), c = a.length - 1;
56
- if (c > 0) {
57
- s.textContent = f ? f.emptyScript : "";
58
- for (let v = 0; v < c; v++)
59
- s.append(a[v], E()), A.nextNode(), l.push({ type: 2, index: ++n });
60
- s.append(a[c], E());
61
- }
62
- }
63
- } else if (s.nodeType === 8)
64
- if (s.data === G)
65
- l.push({ type: 2, index: n });
66
- else {
67
- let a = -1;
68
- for (; (a = s.data.indexOf($, a + 1)) !== -1; )
69
- l.push({ type: 7, index: n }), a += $.length - 1;
70
- }
71
- n++;
72
- }
73
- }
74
- static createElement(t, i) {
75
- const e = g.createElement("template");
76
- return e.innerHTML = t, e;
77
- }
78
- }
79
- function _(o, t, i = o, e) {
80
- var s, n, r, d;
81
- if (t === C)
82
- return t;
83
- let l = e !== void 0 ? (s = i._$Co) === null || s === void 0 ? void 0 : s[e] : i._$Cl;
84
- const h = w(t) ? void 0 : t._$litDirective$;
85
- return (l == null ? void 0 : l.constructor) !== h && ((n = l == null ? void 0 : l._$AO) === null || n === void 0 || n.call(l, !1), h === void 0 ? l = void 0 : (l = new h(o), l._$AT(o, i, e)), e !== void 0 ? ((r = (d = i)._$Co) !== null && r !== void 0 ? r : d._$Co = [])[e] = l : i._$Cl = l), l !== void 0 && (t = _(o, l._$AS(o, t.values), l, e)), t;
86
- }
87
- class vt {
88
- constructor(t, i) {
89
- this.u = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
90
- }
91
- get parentNode() {
92
- return this._$AM.parentNode;
93
- }
94
- get _$AU() {
95
- return this._$AM._$AU;
96
- }
97
- v(t) {
98
- var i;
99
- const { el: { content: e }, parts: s } = this._$AD, n = ((i = t == null ? void 0 : t.creationScope) !== null && i !== void 0 ? i : g).importNode(e, !0);
100
- A.currentNode = n;
101
- let r = A.nextNode(), d = 0, l = 0, h = s[0];
102
- for (; h !== void 0; ) {
103
- if (d === h.index) {
104
- let p;
105
- h.type === 2 ? p = new k(r, r.nextSibling, this, t) : h.type === 1 ? p = new h.ctor(r, h.name, h.strings, this, t) : h.type === 6 && (p = new gt(r, this, t)), this.u.push(p), h = s[++l];
106
- }
107
- d !== (h == null ? void 0 : h.index) && (r = A.nextNode(), d++);
108
- }
109
- return n;
110
- }
111
- p(t) {
112
- let i = 0;
113
- for (const e of this.u)
114
- e !== void 0 && (e.strings !== void 0 ? (e._$AI(t, e, i), i += e.strings.length - 2) : e._$AI(t[i])), i++;
115
- }
116
- }
117
- class k {
118
- constructor(t, i, e, s) {
119
- var n;
120
- this.type = 2, this._$AH = u, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = e, this.options = s, this._$Cm = (n = s == null ? void 0 : s.isConnected) === null || n === void 0 || n;
121
- }
122
- get _$AU() {
123
- var t, i;
124
- return (i = (t = this._$AM) === null || t === void 0 ? void 0 : t._$AU) !== null && i !== void 0 ? i : this._$Cm;
125
- }
126
- get parentNode() {
127
- let t = this._$AA.parentNode;
128
- const i = this._$AM;
129
- return i !== void 0 && t.nodeType === 11 && (t = i.parentNode), t;
130
- }
131
- get startNode() {
132
- return this._$AA;
133
- }
134
- get endNode() {
135
- return this._$AB;
136
- }
137
- _$AI(t, i = this) {
138
- t = _(this, t, i), w(t) ? t === u || t == null || t === "" ? (this._$AH !== u && this._$AR(), this._$AH = u) : t !== this._$AH && t !== C && this.g(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : ut(t) ? this.k(t) : this.g(t);
139
- }
140
- O(t, i = this._$AB) {
141
- return this._$AA.parentNode.insertBefore(t, i);
142
- }
143
- T(t) {
144
- this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
145
- }
146
- g(t) {
147
- this._$AH !== u && w(this._$AH) ? this._$AA.nextSibling.data = t : this.T(g.createTextNode(t)), this._$AH = t;
148
- }
149
- $(t) {
150
- var i;
151
- const { values: e, _$litType$: s } = t, n = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = x.createElement(s.h, this.options)), s);
152
- if (((i = this._$AH) === null || i === void 0 ? void 0 : i._$AD) === n)
153
- this._$AH.p(e);
154
- else {
155
- const r = new vt(n, this), d = r.v(this.options);
156
- r.p(e), this.T(d), this._$AH = r;
157
- }
158
- }
159
- _$AC(t) {
160
- let i = W.get(t.strings);
161
- return i === void 0 && W.set(t.strings, i = new x(t)), i;
162
- }
163
- k(t) {
164
- J(this._$AH) || (this._$AH = [], this._$AR());
165
- const i = this._$AH;
166
- let e, s = 0;
167
- for (const n of t)
168
- s === i.length ? i.push(e = new k(this.O(E()), this.O(E()), this, this.options)) : e = i[s], e._$AI(n), s++;
169
- s < i.length && (this._$AR(e && e._$AB.nextSibling, s), i.length = s);
170
- }
171
- _$AR(t = this._$AA.nextSibling, i) {
172
- var e;
173
- for ((e = this._$AP) === null || e === void 0 || e.call(this, !1, !0, i); t && t !== this._$AB; ) {
174
- const s = t.nextSibling;
175
- t.remove(), t = s;
176
- }
177
- }
178
- setConnected(t) {
179
- var i;
180
- this._$AM === void 0 && (this._$Cm = t, (i = this._$AP) === null || i === void 0 || i.call(this, t));
181
- }
182
- }
183
- let P = class {
184
- constructor(t, i, e, s, n) {
185
- this.type = 1, this._$AH = u, this._$AN = void 0, this.element = t, this.name = i, this._$AM = s, this.options = n, e.length > 2 || e[0] !== "" || e[1] !== "" ? (this._$AH = Array(e.length - 1).fill(new String()), this.strings = e) : this._$AH = u;
186
- }
187
- get tagName() {
188
- return this.element.tagName;
189
- }
190
- get _$AU() {
191
- return this._$AM._$AU;
192
- }
193
- _$AI(t, i = this, e, s) {
194
- const n = this.strings;
195
- let r = !1;
196
- if (n === void 0)
197
- t = _(this, t, i, 0), r = !w(t) || t !== this._$AH && t !== C, r && (this._$AH = t);
198
- else {
199
- const d = t;
200
- let l, h;
201
- for (t = n[0], l = 0; l < n.length - 1; l++)
202
- h = _(this, d[e + l], i, l), h === C && (h = this._$AH[l]), r || (r = !w(h) || h !== this._$AH[l]), h === u ? t = u : t !== u && (t += (h ?? "") + n[l + 1]), this._$AH[l] = h;
203
- }
204
- r && !s && this.j(t);
205
- }
206
- j(t) {
207
- t === u ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
208
- }
209
- };
210
- class $t extends P {
211
- constructor() {
212
- super(...arguments), this.type = 3;
213
- }
214
- j(t) {
215
- this.element[this.name] = t === u ? void 0 : t;
216
- }
217
- }
218
- const mt = f ? f.emptyScript : "";
219
- class At extends P {
220
- constructor() {
221
- super(...arguments), this.type = 4;
222
- }
223
- j(t) {
224
- t && t !== u ? this.element.setAttribute(this.name, mt) : this.element.removeAttribute(this.name);
225
- }
226
- }
227
- class ft extends P {
228
- constructor(t, i, e, s, n) {
229
- super(t, i, e, s, n), this.type = 5;
230
- }
231
- _$AI(t, i = this) {
232
- var e;
233
- if ((t = (e = _(this, t, i, 0)) !== null && e !== void 0 ? e : u) === C)
234
- return;
235
- const s = this._$AH, n = t === u && s !== u || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, r = t !== u && (s === u || n);
236
- n && this.element.removeEventListener(this.name, this, s), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
237
- }
238
- handleEvent(t) {
239
- var i, e;
240
- typeof this._$AH == "function" ? this._$AH.call((e = (i = this.options) === null || i === void 0 ? void 0 : i.host) !== null && e !== void 0 ? e : this.element, t) : this._$AH.handleEvent(t);
241
- }
242
- }
243
- class gt {
244
- constructor(t, i, e) {
245
- this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = e;
246
- }
247
- get _$AU() {
248
- return this._$AM._$AU;
249
- }
250
- _$AI(t) {
251
- _(this, t);
252
- }
253
- }
254
- const V = T.litHtmlPolyfillSupport;
255
- V == null || V(x, k), ((I = T.litHtmlVersions) !== null && I !== void 0 ? I : T.litHtmlVersions = []).push("2.5.0");
256
- /**
257
- * @license
258
- * Copyright 2017 Google LLC
259
- * SPDX-License-Identifier: BSD-3-Clause
260
- */
261
- const it = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, _t = (o) => (...t) => ({ _$litDirective$: o, values: t });
262
- let yt = class {
263
- constructor(t) {
264
- }
265
- get _$AU() {
266
- return this._$AM._$AU;
267
- }
268
- _$AT(t, i, e) {
269
- this._$Ct = t, this._$AM = i, this._$Ci = e;
270
- }
271
- _$AS(t, i) {
272
- return this.update(t, i);
273
- }
274
- update(t, i) {
275
- return this.render(...i);
276
- }
277
- };
278
- /**
279
- * @license
280
- * Copyright 2020 Google LLC
281
- * SPDX-License-Identifier: BSD-3-Clause
282
- */
283
- const bt = (o) => o.strings === void 0;
284
- /**
285
- * @license
286
- * Copyright 2017 Google LLC
287
- * SPDX-License-Identifier: BSD-3-Clause
288
- */
289
- const b = (o, t) => {
290
- var i, e;
291
- const s = o._$AN;
292
- if (s === void 0)
293
- return !1;
294
- for (const n of s)
295
- (e = (i = n)._$AO) === null || e === void 0 || e.call(i, t, !1), b(n, t);
296
- return !0;
297
- }, S = (o) => {
298
- let t, i;
299
- do {
300
- if ((t = o._$AM) === void 0)
301
- break;
302
- i = t._$AN, i.delete(o), o = t;
303
- } while ((i == null ? void 0 : i.size) === 0);
304
- }, et = (o) => {
305
- for (let t; t = o._$AM; o = t) {
306
- let i = t._$AN;
307
- if (i === void 0)
308
- t._$AN = i = /* @__PURE__ */ new Set();
309
- else if (i.has(o))
310
- break;
311
- i.add(o), xt(t);
312
- }
313
- };
314
- function wt(o) {
315
- this._$AN !== void 0 ? (S(this), this._$AM = o, et(this)) : this._$AM = o;
316
- }
317
- function Ct(o, t = !1, i = 0) {
318
- const e = this._$AH, s = this._$AN;
319
- if (s !== void 0 && s.size !== 0)
320
- if (t)
321
- if (Array.isArray(e))
322
- for (let n = i; n < e.length; n++)
323
- b(e[n], !1), S(e[n]);
324
- else
325
- e != null && (b(e, !1), S(e));
326
- else
327
- b(this, o);
328
- }
329
- const xt = (o) => {
330
- var t, i, e, s;
331
- o.type == it.CHILD && ((t = (e = o)._$AP) !== null && t !== void 0 || (e._$AP = Ct), (i = (s = o)._$AQ) !== null && i !== void 0 || (s._$AQ = wt));
332
- };
333
- class Ht extends yt {
334
- constructor() {
335
- super(...arguments), this._$AN = void 0;
336
- }
337
- _$AT(t, i, e) {
338
- super._$AT(t, i, e), et(this), this.isConnected = t._$AU;
339
- }
340
- _$AO(t, i = !0) {
341
- var e, s;
342
- t !== this.isConnected && (this.isConnected = t, t ? (e = this.reconnected) === null || e === void 0 || e.call(this) : (s = this.disconnected) === null || s === void 0 || s.call(this)), i && (b(this, t), S(this));
343
- }
344
- setValue(t) {
345
- if (bt(this._$Ct))
346
- this._$Ct._$AI(t, this);
347
- else {
348
- const i = [...this._$Ct._$AH];
349
- i[this._$Ci] = t, this._$Ct._$AI(i, this, 0);
350
- }
351
- }
352
- disconnected() {
353
- }
354
- reconnected() {
355
- }
356
- }
357
- const st = /* @__PURE__ */ new WeakMap();
358
- class Nt {
359
- constructor(t, i) {
360
- this.startPaused = !1, this.disabled = !1, this.clients = /* @__PURE__ */ new Set(), this.pendingComplete = !1, this.host = t, this.defaultOptions = i.defaultOptions || {}, this.startPaused = !!i.startPaused, this.disabled = !!i.disabled, this.onComplete = i.onComplete, st.set(this.host, this);
361
- }
362
- async add(t) {
363
- var i, e;
364
- this.clients.add(t), this.startPaused && ((i = t.webAnimation) === null || i === void 0 || i.pause()), this.pendingComplete = !0, await t.finished, this.pendingComplete && !this.isAnimating && (this.pendingComplete = !1, (e = this.onComplete) === null || e === void 0 || e.call(this));
365
- }
366
- remove(t) {
367
- this.clients.delete(t);
368
- }
369
- pause() {
370
- this.clients.forEach((t) => {
371
- var i;
372
- return (i = t.webAnimation) === null || i === void 0 ? void 0 : i.pause();
373
- });
374
- }
375
- play() {
376
- this.clients.forEach((t) => {
377
- var i;
378
- return (i = t.webAnimation) === null || i === void 0 ? void 0 : i.play();
379
- });
380
- }
381
- cancel() {
382
- this.clients.forEach((t) => {
383
- var i;
384
- return (i = t.webAnimation) === null || i === void 0 ? void 0 : i.cancel();
385
- }), this.clients.clear();
386
- }
387
- finish() {
388
- this.clients.forEach((t) => {
389
- var i;
390
- return (i = t.webAnimation) === null || i === void 0 ? void 0 : i.finish();
391
- }), this.clients.clear();
392
- }
393
- togglePlay() {
394
- this.isPlaying ? this.pause() : this.play();
395
- }
396
- get isAnimating() {
397
- return this.clients.size > 0;
398
- }
399
- get isPlaying() {
400
- return Array.from(this.clients).some((t) => {
401
- var i;
402
- return ((i = t.webAnimation) === null || i === void 0 ? void 0 : i.playState) === "running";
403
- });
404
- }
405
- async finished() {
406
- await Promise.all(Array.from(this.clients).map((t) => t.finished));
407
- }
408
- }
409
- let K = 0;
410
- const U = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new WeakSet(), Q = () => new Promise((o) => requestAnimationFrame(o)), X = (o, t) => {
411
- const i = o - t;
412
- return i === 0 ? void 0 : i;
413
- }, Z = (o, t) => {
414
- const i = o / t;
415
- return i === 1 ? void 0 : i;
416
- }, R = { left: (o, t) => {
417
- const i = X(o, t);
418
- return { value: i, transform: i && `translateX(${i}px)` };
419
- }, top: (o, t) => {
420
- const i = X(o, t);
421
- return { value: i, transform: i && `translateY(${i}px)` };
422
- }, width: (o, t) => {
423
- const i = Z(o, t);
424
- return { value: i, transform: i && `scaleX(${i})` };
425
- }, height: (o, t) => {
426
- const i = Z(o, t);
427
- return { value: i, transform: i && `scaleY(${i})` };
428
- } }, Ot = { duration: 333, easing: "ease-in-out" }, Tt = ["left", "top", "width", "height", "opacity", "color", "background"], q = /* @__PURE__ */ new WeakMap();
429
- class Et extends Ht {
430
- constructor(t) {
431
- if (super(t), this.t = null, this.i = null, this.o = !0, this.shouldLog = !1, t.type === it.CHILD)
432
- throw Error("The `animate` directive must be used in attribute position.");
433
- this.createFinished();
434
- }
435
- createFinished() {
436
- var t;
437
- (t = this.resolveFinished) === null || t === void 0 || t.call(this), this.finished = new Promise((i) => {
438
- this.h = i;
439
- });
440
- }
441
- async resolveFinished() {
442
- var t;
443
- (t = this.h) === null || t === void 0 || t.call(this), this.h = void 0;
444
- }
445
- render(t) {
446
- return u;
447
- }
448
- getController() {
449
- return st.get(this.l);
450
- }
451
- isDisabled() {
452
- var t;
453
- return this.options.disabled || ((t = this.getController()) === null || t === void 0 ? void 0 : t.disabled);
454
- }
455
- update(t, [i]) {
456
- var e;
457
- const s = this.l === void 0;
458
- return s && (this.l = (e = t.options) === null || e === void 0 ? void 0 : e.host, this.l.addController(this), this.element = t.element, q.set(this.element, this)), this.optionsOrCallback = i, (s || typeof i != "function") && this.u(i), this.render(i);
459
- }
460
- u(t) {
461
- var i, e;
462
- t = t ?? {};
463
- const s = this.getController();
464
- s !== void 0 && ((t = { ...s.defaultOptions, ...t }).keyframeOptions = { ...s.defaultOptions.keyframeOptions, ...t.keyframeOptions }), (i = (e = t).properties) !== null && i !== void 0 || (e.properties = Tt), this.options = t;
465
- }
466
- v() {
467
- const t = {}, i = this.element.getBoundingClientRect(), e = getComputedStyle(this.element);
468
- return this.options.properties.forEach((s) => {
469
- var n;
470
- const r = (n = i[s]) !== null && n !== void 0 ? n : R[s] ? void 0 : e[s], d = Number(r);
471
- t[s] = isNaN(d) ? r + "" : d;
472
- }), t;
473
- }
474
- p() {
475
- let t, i = !0;
476
- return this.options.guard && (t = this.options.guard(), i = ((e, s) => {
477
- if (Array.isArray(e)) {
478
- if (Array.isArray(s) && s.length === e.length && e.every((n, r) => n === s[r]))
479
- return !1;
480
- } else if (s === e)
481
- return !1;
482
- return !0;
483
- })(t, this.m)), this.o = this.l.hasUpdated && !this.isDisabled() && !this.isAnimating() && i && this.element.isConnected, this.o && (this.m = Array.isArray(t) ? Array.from(t) : t), this.o;
484
- }
485
- hostUpdate() {
486
- var t;
487
- typeof this.optionsOrCallback == "function" && this.u(this.optionsOrCallback()), this.p() && (this.g = this.v(), this.t = (t = this.t) !== null && t !== void 0 ? t : this.element.parentNode, this.i = this.element.nextSibling);
488
- }
489
- async hostUpdated() {
490
- if (!this.o || !this.element.isConnected || this.options.skipInitial && !this.isHostRendered)
491
- return;
492
- let t;
493
- this.prepare(), await Q;
494
- const i = this._(), e = this.A(this.options.keyframeOptions, i), s = this.v();
495
- if (this.g !== void 0) {
496
- const { from: n, to: r } = this.O(this.g, s, i);
497
- this.log("measured", [this.g, s, n, r]), t = this.calculateKeyframes(n, r);
498
- } else {
499
- const n = U.get(this.options.inId);
500
- if (n) {
501
- U.delete(this.options.inId);
502
- const { from: r, to: d } = this.O(n, s, i);
503
- t = this.calculateKeyframes(r, d), t = this.options.in ? [{ ...this.options.in[0], ...t[0] }, ...this.options.in.slice(1), t[1]] : t, K++, t.forEach((l) => l.zIndex = K);
504
- } else
505
- this.options.in && (t = [...this.options.in, {}]);
506
- }
507
- this.animate(t, e);
508
- }
509
- resetStyles() {
510
- var t;
511
- this.P !== void 0 && (this.element.setAttribute("style", (t = this.P) !== null && t !== void 0 ? t : ""), this.P = void 0);
512
- }
513
- commitStyles() {
514
- var t, i;
515
- this.P = this.element.getAttribute("style"), (t = this.webAnimation) === null || t === void 0 || t.commitStyles(), (i = this.webAnimation) === null || i === void 0 || i.cancel();
516
- }
517
- reconnected() {
518
- }
519
- async disconnected() {
520
- var t;
521
- if (!this.o || (this.options.id !== void 0 && U.set(this.options.id, this.g), this.options.out === void 0))
522
- return;
523
- if (this.prepare(), await Q(), (t = this.t) === null || t === void 0 ? void 0 : t.isConnected) {
524
- const e = this.i && this.i.parentNode === this.t ? this.i : null;
525
- if (this.t.insertBefore(this.element, e), this.options.stabilizeOut) {
526
- const s = this.v();
527
- this.log("stabilizing out");
528
- const n = this.g.left - s.left, r = this.g.top - s.top;
529
- getComputedStyle(this.element).position !== "static" || n === 0 && r === 0 || (this.element.style.position = "relative"), n !== 0 && (this.element.style.left = n + "px"), r !== 0 && (this.element.style.top = r + "px");
530
- }
531
- }
532
- const i = this.A(this.options.keyframeOptions);
533
- await this.animate(this.options.out, i), this.element.remove();
534
- }
535
- prepare() {
536
- this.createFinished();
537
- }
538
- start() {
539
- var t, i;
540
- (i = (t = this.options).onStart) === null || i === void 0 || i.call(t, this);
541
- }
542
- didFinish(t) {
543
- var i, e;
544
- t && ((e = (i = this.options).onComplete) === null || e === void 0 || e.call(i, this)), this.g = void 0, this.animatingProperties = void 0, this.frames = void 0, this.resolveFinished();
545
- }
546
- _() {
547
- const t = [];
548
- for (let i = this.element.parentNode; i; i = i == null ? void 0 : i.parentNode) {
549
- const e = q.get(i);
550
- e && !e.isDisabled() && e && t.push(e);
551
- }
552
- return t;
553
- }
554
- get isHostRendered() {
555
- const t = Y.has(this.l);
556
- return t || this.l.updateComplete.then(() => {
557
- Y.add(this.l);
558
- }), t;
559
- }
560
- A(t, i = this._()) {
561
- const e = { ...Ot };
562
- return i.forEach((s) => Object.assign(e, s.options.keyframeOptions)), Object.assign(e, t), e;
563
- }
564
- O(t, i, e) {
565
- t = { ...t }, i = { ...i };
566
- const s = e.map((d) => d.animatingProperties).filter((d) => d !== void 0);
567
- let n = 1, r = 1;
568
- return s !== void 0 && (s.forEach((d) => {
569
- d.width && (n /= d.width), d.height && (r /= d.height);
570
- }), t.left !== void 0 && i.left !== void 0 && (t.left = n * t.left, i.left = n * i.left), t.top !== void 0 && i.top !== void 0 && (t.top = r * t.top, i.top = r * i.top)), { from: t, to: i };
571
- }
572
- calculateKeyframes(t, i, e = !1) {
573
- var s;
574
- const n = {}, r = {};
575
- let d = !1;
576
- const l = {};
577
- for (const h in i) {
578
- const p = t[h], a = i[h];
579
- if (h in R) {
580
- const c = R[h];
581
- if (p === void 0 || a === void 0)
582
- continue;
583
- const v = c(p, a);
584
- v.transform !== void 0 && (l[h] = v.value, d = !0, n.transform = `${(s = n.transform) !== null && s !== void 0 ? s : ""} ${v.transform}`);
585
- } else
586
- p !== a && p !== void 0 && a !== void 0 && (d = !0, n[h] = p, r[h] = a);
587
- }
588
- return n.transformOrigin = r.transformOrigin = e ? "center center" : "top left", this.animatingProperties = l, d ? [n, r] : void 0;
589
- }
590
- async animate(t, i = this.options.keyframeOptions) {
591
- this.start(), this.frames = t;
592
- let e = !1;
593
- if (!this.isAnimating() && !this.isDisabled() && (this.options.onFrames && (this.frames = t = this.options.onFrames(this), this.log("modified frames", t)), t !== void 0)) {
594
- this.log("animate", [t, i]), e = !0, this.webAnimation = this.element.animate(t, i);
595
- const s = this.getController();
596
- s == null || s.add(this);
597
- try {
598
- await this.webAnimation.finished;
599
- } catch {
600
- }
601
- s == null || s.remove(this);
602
- }
603
- return this.didFinish(e), e;
604
- }
605
- isAnimating() {
606
- var t, i;
607
- return ((t = this.webAnimation) === null || t === void 0 ? void 0 : t.playState) === "running" || ((i = this.webAnimation) === null || i === void 0 ? void 0 : i.pending);
608
- }
609
- log(t, i) {
610
- this.shouldLog && !this.isDisabled() && console.log(t, this.options.id, i);
611
- }
612
- }
613
- const St = _t(Et);
614
- /**
615
- * @license
616
- * Copyright 2018 Google LLC
617
- * SPDX-License-Identifier: BSD-3-Clause
618
- */
619
- const kt = nt(class extends ot {
620
- constructor(o) {
621
- var t;
622
- if (super(o), o.type !== rt.ATTRIBUTE || o.name !== "class" || ((t = o.strings) === null || t === void 0 ? void 0 : t.length) > 2)
623
- throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
624
- }
625
- render(o) {
626
- return " " + Object.keys(o).filter((t) => o[t]).join(" ") + " ";
627
- }
628
- update(o, [t]) {
629
- var i, e;
630
- if (this.nt === void 0) {
631
- this.nt = /* @__PURE__ */ new Set(), o.strings !== void 0 && (this.st = new Set(o.strings.join(" ").split(/\s/).filter((n) => n !== "")));
632
- for (const n in t)
633
- t[n] && !(!((i = this.st) === null || i === void 0) && i.has(n)) && this.nt.add(n);
634
- return this.render(t);
635
- }
636
- const s = o.element.classList;
637
- this.nt.forEach((n) => {
638
- n in t || (s.remove(n), this.nt.delete(n));
639
- });
640
- for (const n in t) {
641
- const r = !!t[n];
642
- r === this.nt.has(n) || !((e = this.st) === null || e === void 0) && e.has(n) || (r ? (s.add(n), this.nt.add(n)) : (s.remove(n), this.nt.delete(n)));
643
- }
644
- return lt;
645
- }
646
- }), Pt = `p{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}p b{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}
647
- `;
648
- var Mt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, M = (o, t, i, e) => {
649
- for (var s = e > 1 ? void 0 : e ? It(t, i) : t, n = o.length - 1, r; n >= 0; n--)
650
- (r = o[n]) && (s = (e ? r(t, i, s) : r(s)) || s);
651
- return e && s && Mt(t, i, s), s;
652
- };
653
- let H = class extends ht(Pt) {
654
- constructor() {
655
- super(...arguments), this.name = "World", this.clicked = !1, this.disabled = !1, this.duration = 1e3, this.controller = new Nt(this, {
656
- defaultOptions: {
657
- keyframeOptions: {
658
- duration: this.duration,
659
- fill: "backwards"
660
- }
661
- }
662
- });
663
- }
664
- _onClick() {
665
- this.disabled || (this.clicked = !0, setTimeout(() => {
666
- this.clicked = !1;
667
- }, 2e3));
668
- }
669
- render() {
670
- const o = {
671
- "text-yellow-200": !this.disabled,
672
- "p-2": !0,
673
- "rounded-full": !0,
674
- "text-24": !0,
675
- "bg-blue-800": this.clicked && !this.disabled,
676
- "bg-blue-200": !this.clicked && !this.disabled
677
- };
678
- return at`
679
- <p class="heading-1">
680
- Hello,
681
- <b class="heading-4">${this.name}</b>
682
- !
683
- </p>
684
- <button
685
- ?disabled=${this.disabled}
686
- data-testid="button"
687
- @click=${this._onClick}
688
- class="hover:text-yellow-700 ${kt(o)}"
689
- ${St()}
690
- >
691
- Hello world! 2
692
- </button>
693
- `;
694
- }
695
- };
696
- M([
697
- D()
698
- ], H.prototype, "name", 2);
699
- M([
700
- D()
701
- ], H.prototype, "clicked", 2);
702
- M([
703
- D({ type: Boolean })
704
- ], H.prototype, "disabled", 2);
705
- H = M([
706
- dt("lukso-test")
707
- ], H);
708
- export {
709
- H as LuksoTest
710
- };