@cal.macconnachie/web-components 0.0.12 → 0.0.13
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.
- package/dist/components/theme-toggle.js +149 -118
- package/dist/index.js +138 -107
- package/dist/stylesheets/main.css +1 -1
- package/package.json +1 -1
|
@@ -17,12 +17,12 @@ let st = class {
|
|
|
17
17
|
return this.cssText;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const
|
|
21
|
-
const e = r.length === 1 ? r[0] : t.reduce(((s, i,
|
|
22
|
-
if (
|
|
23
|
-
if (typeof
|
|
24
|
-
throw Error("Value passed to 'css' function must be a 'css' function result: " +
|
|
25
|
-
})(i) + r[
|
|
20
|
+
const at = (r) => new st(typeof r == "string" ? r : r + "", void 0, I), ht = (r, ...t) => {
|
|
21
|
+
const e = r.length === 1 ? r[0] : t.reduce(((s, i, o) => s + ((n) => {
|
|
22
|
+
if (n._$cssResult$ === !0) return n.cssText;
|
|
23
|
+
if (typeof n == "number") return n;
|
|
24
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
25
|
+
})(i) + r[o + 1]), r[0]);
|
|
26
26
|
return new st(e, r, I);
|
|
27
27
|
}, lt = (r, t) => {
|
|
28
28
|
if (L) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
@@ -33,7 +33,7 @@ const ht = (r) => new st(typeof r == "string" ? r : r + "", void 0, I), at = (r,
|
|
|
33
33
|
}, J = L ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
|
|
34
34
|
let e = "";
|
|
35
35
|
for (const s of t.cssRules) e += s.cssText;
|
|
36
|
-
return
|
|
36
|
+
return at(e);
|
|
37
37
|
})(r) : r;
|
|
38
38
|
const { is: ct, defineProperty: dt, getOwnPropertyDescriptor: pt, getOwnPropertyNames: ut, getOwnPropertySymbols: $t, getPrototypeOf: mt } = Object, N = globalThis, Z = N.trustedTypes, gt = Z ? Z.emptyScript : "", ft = N.reactiveElementPolyfillSupport, w = (r, t) => r, H = { toAttribute(r, t) {
|
|
39
39
|
switch (t) {
|
|
@@ -65,7 +65,7 @@ const { is: ct, defineProperty: dt, getOwnPropertyDescriptor: pt, getOwnProperty
|
|
|
65
65
|
return e;
|
|
66
66
|
} }, B = (r, t) => !ct(r, t), F = { attribute: !0, type: String, converter: H, reflect: !1, useDefault: !1, hasChanged: B };
|
|
67
67
|
Symbol.metadata ??= Symbol("metadata"), N.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
68
|
-
let
|
|
68
|
+
let b = class extends HTMLElement {
|
|
69
69
|
static addInitializer(t) {
|
|
70
70
|
this._$Ei(), (this.l ??= []).push(t);
|
|
71
71
|
}
|
|
@@ -79,14 +79,14 @@ let A = class extends HTMLElement {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static getPropertyDescriptor(t, e, s) {
|
|
82
|
-
const { get: i, set:
|
|
82
|
+
const { get: i, set: o } = pt(this.prototype, t) ?? { get() {
|
|
83
83
|
return this[e];
|
|
84
|
-
}, set(
|
|
85
|
-
this[e] =
|
|
84
|
+
}, set(n) {
|
|
85
|
+
this[e] = n;
|
|
86
86
|
} };
|
|
87
|
-
return { get: i, set(
|
|
88
|
-
const
|
|
89
|
-
|
|
87
|
+
return { get: i, set(n) {
|
|
88
|
+
const h = i?.call(this);
|
|
89
|
+
o?.call(this, n), this.requestUpdate(t, h, s);
|
|
90
90
|
}, configurable: !0, enumerable: !0 };
|
|
91
91
|
}
|
|
92
92
|
static getPropertyOptions(t) {
|
|
@@ -162,29 +162,29 @@ let A = class extends HTMLElement {
|
|
|
162
162
|
_$ET(t, e) {
|
|
163
163
|
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
|
|
164
164
|
if (i !== void 0 && s.reflect === !0) {
|
|
165
|
-
const
|
|
166
|
-
this._$Em = t,
|
|
165
|
+
const o = (s.converter?.toAttribute !== void 0 ? s.converter : H).toAttribute(e, s.type);
|
|
166
|
+
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
_$AK(t, e) {
|
|
170
170
|
const s = this.constructor, i = s._$Eh.get(t);
|
|
171
171
|
if (i !== void 0 && this._$Em !== i) {
|
|
172
|
-
const
|
|
172
|
+
const o = s.getPropertyOptions(i), n = typeof o.converter == "function" ? { fromAttribute: o.converter } : o.converter?.fromAttribute !== void 0 ? o.converter : H;
|
|
173
173
|
this._$Em = i;
|
|
174
|
-
const
|
|
175
|
-
this[i] =
|
|
174
|
+
const h = n.fromAttribute(e, o.type);
|
|
175
|
+
this[i] = h ?? this._$Ej?.get(i) ?? h, this._$Em = null;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
requestUpdate(t, e, s) {
|
|
179
179
|
if (t !== void 0) {
|
|
180
|
-
const i = this.constructor,
|
|
181
|
-
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? B)(
|
|
180
|
+
const i = this.constructor, o = this[t];
|
|
181
|
+
if (s ??= i.getPropertyOptions(t), !((s.hasChanged ?? B)(o, e) || s.useDefault && s.reflect && o === this._$Ej?.get(t) && !this.hasAttribute(i._$Eu(t, s)))) return;
|
|
182
182
|
this.C(t, e, s);
|
|
183
183
|
}
|
|
184
184
|
this.isUpdatePending === !1 && (this._$ES = this._$EP());
|
|
185
185
|
}
|
|
186
|
-
C(t, e, { useDefault: s, reflect: i, wrapped:
|
|
187
|
-
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t,
|
|
186
|
+
C(t, e, { useDefault: s, reflect: i, wrapped: o }, n) {
|
|
187
|
+
s && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t));
|
|
188
188
|
}
|
|
189
189
|
async _$EP() {
|
|
190
190
|
this.isUpdatePending = !0;
|
|
@@ -203,13 +203,13 @@ let A = class extends HTMLElement {
|
|
|
203
203
|
if (!this.isUpdatePending) return;
|
|
204
204
|
if (!this.hasUpdated) {
|
|
205
205
|
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
206
|
-
for (const [i,
|
|
206
|
+
for (const [i, o] of this._$Ep) this[i] = o;
|
|
207
207
|
this._$Ep = void 0;
|
|
208
208
|
}
|
|
209
209
|
const s = this.constructor.elementProperties;
|
|
210
|
-
if (s.size > 0) for (const [i,
|
|
211
|
-
const { wrapped:
|
|
212
|
-
|
|
210
|
+
if (s.size > 0) for (const [i, o] of s) {
|
|
211
|
+
const { wrapped: n } = o, h = this[i];
|
|
212
|
+
n !== !0 || this._$AL.has(i) || h === void 0 || this.C(i, void 0, o, h);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
let t = !1;
|
|
@@ -246,56 +246,56 @@ let A = class extends HTMLElement {
|
|
|
246
246
|
firstUpdated(t) {
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
|
|
249
|
+
b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[w("elementProperties")] = /* @__PURE__ */ new Map(), b[w("finalized")] = /* @__PURE__ */ new Map(), ft?.({ ReactiveElement: b }), (N.reactiveElementVersions ??= []).push("2.1.1");
|
|
250
250
|
const V = globalThis, z = V.trustedTypes, G = z ? z.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, it = "$lit$", m = `lit$${Math.random().toFixed(9).slice(2)}$`, rt = "?" + m, _t = `<${rt}>`, y = document, P = () => y.createComment(""), x = (r) => r === null || typeof r != "object" && typeof r != "function", q = Array.isArray, yt = (r) => q(r) || typeof r?.[Symbol.iterator] == "function", D = `[
|
|
251
251
|
\f\r]`, S = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, Q = /-->/g, X = />/g, f = RegExp(`>|${D}(?:([^\\s"'>=/]+)(${D}*=${D}*(?:[^
|
|
252
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"), Y = /'/g, tt = /"/g,
|
|
253
|
-
function
|
|
252
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), Y = /'/g, tt = /"/g, ot = /^(?:script|style|textarea|title)$/i, bt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), j = bt(1), v = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), et = /* @__PURE__ */ new WeakMap(), _ = y.createTreeWalker(y, 129);
|
|
253
|
+
function nt(r, t) {
|
|
254
254
|
if (!q(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
255
255
|
return G !== void 0 ? G.createHTML(t) : t;
|
|
256
256
|
}
|
|
257
257
|
const vt = (r, t) => {
|
|
258
258
|
const e = r.length - 1, s = [];
|
|
259
|
-
let i,
|
|
260
|
-
for (let
|
|
261
|
-
const
|
|
259
|
+
let i, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = S;
|
|
260
|
+
for (let h = 0; h < e; h++) {
|
|
261
|
+
const a = r[h];
|
|
262
262
|
let c, p, l = -1, u = 0;
|
|
263
|
-
for (; u <
|
|
264
|
-
const $ =
|
|
265
|
-
|
|
263
|
+
for (; u < a.length && (n.lastIndex = u, p = n.exec(a), p !== null); ) u = n.lastIndex, n === S ? p[1] === "!--" ? n = Q : p[1] !== void 0 ? n = X : p[2] !== void 0 ? (ot.test(p[2]) && (i = RegExp("</" + p[2], "g")), n = f) : p[3] !== void 0 && (n = f) : n === f ? p[0] === ">" ? (n = i ?? S, l = -1) : p[1] === void 0 ? l = -2 : (l = n.lastIndex - p[2].length, c = p[1], n = p[3] === void 0 ? f : p[3] === '"' ? tt : Y) : n === tt || n === Y ? n = f : n === Q || n === X ? n = S : (n = f, i = void 0);
|
|
264
|
+
const $ = n === f && r[h + 1].startsWith("/>") ? " " : "";
|
|
265
|
+
o += n === S ? a + _t : l >= 0 ? (s.push(c), a.slice(0, l) + it + a.slice(l) + m + $) : a + m + (l === -2 ? h : $);
|
|
266
266
|
}
|
|
267
|
-
return [
|
|
267
|
+
return [nt(r, o + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
|
|
268
268
|
};
|
|
269
|
-
class
|
|
269
|
+
class k {
|
|
270
270
|
constructor({ strings: t, _$litType$: e }, s) {
|
|
271
271
|
let i;
|
|
272
272
|
this.parts = [];
|
|
273
|
-
let
|
|
274
|
-
const
|
|
275
|
-
if (this.el =
|
|
273
|
+
let o = 0, n = 0;
|
|
274
|
+
const h = t.length - 1, a = this.parts, [c, p] = vt(t, e);
|
|
275
|
+
if (this.el = k.createElement(c, s), _.currentNode = this.el.content, e === 2 || e === 3) {
|
|
276
276
|
const l = this.el.content.firstChild;
|
|
277
277
|
l.replaceWith(...l.childNodes);
|
|
278
278
|
}
|
|
279
|
-
for (; (i = _.nextNode()) !== null &&
|
|
279
|
+
for (; (i = _.nextNode()) !== null && a.length < h; ) {
|
|
280
280
|
if (i.nodeType === 1) {
|
|
281
281
|
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(it)) {
|
|
282
|
-
const u = p[
|
|
283
|
-
|
|
284
|
-
} else l.startsWith(m) && (
|
|
285
|
-
if (
|
|
282
|
+
const u = p[n++], $ = i.getAttribute(l).split(m), T = /([.?@])?(.*)/.exec(u);
|
|
283
|
+
a.push({ type: 1, index: o, name: T[2], strings: $, ctor: T[1] === "." ? Et : T[1] === "?" ? St : T[1] === "@" ? wt : R }), i.removeAttribute(l);
|
|
284
|
+
} else l.startsWith(m) && (a.push({ type: 6, index: o }), i.removeAttribute(l));
|
|
285
|
+
if (ot.test(i.tagName)) {
|
|
286
286
|
const l = i.textContent.split(m), u = l.length - 1;
|
|
287
287
|
if (u > 0) {
|
|
288
288
|
i.textContent = z ? z.emptyScript : "";
|
|
289
|
-
for (let $ = 0; $ < u; $++) i.append(l[$], P()), _.nextNode(),
|
|
289
|
+
for (let $ = 0; $ < u; $++) i.append(l[$], P()), _.nextNode(), a.push({ type: 2, index: ++o });
|
|
290
290
|
i.append(l[u], P());
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
|
-
} else if (i.nodeType === 8) if (i.data === rt)
|
|
293
|
+
} else if (i.nodeType === 8) if (i.data === rt) a.push({ type: 2, index: o });
|
|
294
294
|
else {
|
|
295
295
|
let l = -1;
|
|
296
|
-
for (; (l = i.data.indexOf(m, l + 1)) !== -1; )
|
|
296
|
+
for (; (l = i.data.indexOf(m, l + 1)) !== -1; ) a.push({ type: 7, index: o }), l += m.length - 1;
|
|
297
297
|
}
|
|
298
|
-
|
|
298
|
+
o++;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
static createElement(t, e) {
|
|
@@ -303,13 +303,13 @@ class O {
|
|
|
303
303
|
return s.innerHTML = t, s;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function A(r, t, e = r, s) {
|
|
307
307
|
if (t === v) return t;
|
|
308
308
|
let i = s !== void 0 ? e._$Co?.[s] : e._$Cl;
|
|
309
|
-
const
|
|
310
|
-
return i?.constructor !==
|
|
309
|
+
const o = x(t) ? void 0 : t._$litDirective$;
|
|
310
|
+
return i?.constructor !== o && (i?._$AO?.(!1), o === void 0 ? i = void 0 : (i = new o(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ??= [])[s] = i : e._$Cl = i), i !== void 0 && (t = A(r, i._$AS(r, t.values), i, s)), t;
|
|
311
311
|
}
|
|
312
|
-
class
|
|
312
|
+
class At {
|
|
313
313
|
constructor(t, e) {
|
|
314
314
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
315
315
|
}
|
|
@@ -322,13 +322,13 @@ class bt {
|
|
|
322
322
|
u(t) {
|
|
323
323
|
const { el: { content: e }, parts: s } = this._$AD, i = (t?.creationScope ?? y).importNode(e, !0);
|
|
324
324
|
_.currentNode = i;
|
|
325
|
-
let
|
|
326
|
-
for (;
|
|
327
|
-
if (
|
|
325
|
+
let o = _.nextNode(), n = 0, h = 0, a = s[0];
|
|
326
|
+
for (; a !== void 0; ) {
|
|
327
|
+
if (n === a.index) {
|
|
328
328
|
let c;
|
|
329
|
-
|
|
329
|
+
a.type === 2 ? c = new O(o, o.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (c = new Ct(o, this, t)), this._$AV.push(c), a = s[++h];
|
|
330
330
|
}
|
|
331
|
-
|
|
331
|
+
n !== a?.index && (o = _.nextNode(), n++);
|
|
332
332
|
}
|
|
333
333
|
return _.currentNode = y, i;
|
|
334
334
|
}
|
|
@@ -337,7 +337,7 @@ class bt {
|
|
|
337
337
|
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
class
|
|
340
|
+
class O {
|
|
341
341
|
get _$AU() {
|
|
342
342
|
return this._$AM?._$AU ?? this._$Cv;
|
|
343
343
|
}
|
|
@@ -356,7 +356,7 @@ class U {
|
|
|
356
356
|
return this._$AB;
|
|
357
357
|
}
|
|
358
358
|
_$AI(t, e = this) {
|
|
359
|
-
t =
|
|
359
|
+
t = A(this, t, e), x(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== v && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : yt(t) ? this.k(t) : this._(t);
|
|
360
360
|
}
|
|
361
361
|
O(t) {
|
|
362
362
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -368,22 +368,22 @@ class U {
|
|
|
368
368
|
this._$AH !== d && x(this._$AH) ? this._$AA.nextSibling.data = t : this.T(y.createTextNode(t)), this._$AH = t;
|
|
369
369
|
}
|
|
370
370
|
$(t) {
|
|
371
|
-
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el =
|
|
371
|
+
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = k.createElement(nt(s.h, s.h[0]), this.options)), s);
|
|
372
372
|
if (this._$AH?._$AD === i) this._$AH.p(e);
|
|
373
373
|
else {
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const o = new At(i, this), n = o.u(this.options);
|
|
375
|
+
o.p(e), this.T(n), this._$AH = o;
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
_$AC(t) {
|
|
379
379
|
let e = et.get(t.strings);
|
|
380
|
-
return e === void 0 && et.set(t.strings, e = new
|
|
380
|
+
return e === void 0 && et.set(t.strings, e = new k(t)), e;
|
|
381
381
|
}
|
|
382
382
|
k(t) {
|
|
383
383
|
q(this._$AH) || (this._$AH = [], this._$AR());
|
|
384
384
|
const e = this._$AH;
|
|
385
385
|
let s, i = 0;
|
|
386
|
-
for (const
|
|
386
|
+
for (const o of t) i === e.length ? e.push(s = new O(this.O(P()), this.O(P()), this, this.options)) : s = e[i], s._$AI(o), i++;
|
|
387
387
|
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
|
|
388
388
|
}
|
|
389
389
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -403,19 +403,19 @@ class R {
|
|
|
403
403
|
get _$AU() {
|
|
404
404
|
return this._$AM._$AU;
|
|
405
405
|
}
|
|
406
|
-
constructor(t, e, s, i,
|
|
407
|
-
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options =
|
|
406
|
+
constructor(t, e, s, i, o) {
|
|
407
|
+
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = o, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
|
|
408
408
|
}
|
|
409
409
|
_$AI(t, e = this, s, i) {
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
if (
|
|
410
|
+
const o = this.strings;
|
|
411
|
+
let n = !1;
|
|
412
|
+
if (o === void 0) t = A(this, t, e, 0), n = !x(t) || t !== this._$AH && t !== v, n && (this._$AH = t);
|
|
413
413
|
else {
|
|
414
|
-
const
|
|
415
|
-
let
|
|
416
|
-
for (t =
|
|
414
|
+
const h = t;
|
|
415
|
+
let a, c;
|
|
416
|
+
for (t = o[0], a = 0; a < o.length - 1; a++) c = A(this, h[s + a], e, a), c === v && (c = this._$AH[a]), n ||= !x(c) || c !== this._$AH[a], c === d ? t = d : t !== d && (t += (c ?? "") + o[a + 1]), this._$AH[a] = c;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
n && !i && this.j(t);
|
|
419
419
|
}
|
|
420
420
|
j(t) {
|
|
421
421
|
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
@@ -438,13 +438,13 @@ class St extends R {
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
class wt extends R {
|
|
441
|
-
constructor(t, e, s, i,
|
|
442
|
-
super(t, e, s, i,
|
|
441
|
+
constructor(t, e, s, i, o) {
|
|
442
|
+
super(t, e, s, i, o), this.type = 5;
|
|
443
443
|
}
|
|
444
444
|
_$AI(t, e = this) {
|
|
445
|
-
if ((t =
|
|
446
|
-
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive,
|
|
447
|
-
i && this.element.removeEventListener(this.name, this, s),
|
|
445
|
+
if ((t = A(this, t, e, 0) ?? d) === v) return;
|
|
446
|
+
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, o = t !== d && (s === d || i);
|
|
447
|
+
i && this.element.removeEventListener(this.name, this, s), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
448
448
|
}
|
|
449
449
|
handleEvent(t) {
|
|
450
450
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
@@ -458,22 +458,22 @@ class Ct {
|
|
|
458
458
|
return this._$AM._$AU;
|
|
459
459
|
}
|
|
460
460
|
_$AI(t) {
|
|
461
|
-
|
|
461
|
+
A(this, t);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
const Pt = V.litHtmlPolyfillSupport;
|
|
465
|
-
Pt?.(
|
|
465
|
+
Pt?.(k, O), (V.litHtmlVersions ??= []).push("3.3.1");
|
|
466
466
|
const xt = (r, t, e) => {
|
|
467
467
|
const s = e?.renderBefore ?? t;
|
|
468
468
|
let i = s._$litPart$;
|
|
469
469
|
if (i === void 0) {
|
|
470
|
-
const
|
|
471
|
-
s._$litPart$ = i = new
|
|
470
|
+
const o = e?.renderBefore ?? null;
|
|
471
|
+
s._$litPart$ = i = new O(t.insertBefore(P(), o), o, void 0, e ?? {});
|
|
472
472
|
}
|
|
473
473
|
return i._$AI(r), i;
|
|
474
474
|
};
|
|
475
475
|
const W = globalThis;
|
|
476
|
-
class C extends
|
|
476
|
+
class C extends b {
|
|
477
477
|
constructor() {
|
|
478
478
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
479
479
|
}
|
|
@@ -496,47 +496,47 @@ class C extends A {
|
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
C._$litElement$ = !0, C.finalized = !0, W.litElementHydrateSupport?.({ LitElement: C });
|
|
499
|
-
const
|
|
500
|
-
|
|
499
|
+
const kt = W.litElementPolyfillSupport;
|
|
500
|
+
kt?.({ LitElement: C });
|
|
501
501
|
(W.litElementVersions ??= []).push("4.2.1");
|
|
502
|
-
const
|
|
502
|
+
const Ot = (r) => (t, e) => {
|
|
503
503
|
e !== void 0 ? e.addInitializer((() => {
|
|
504
504
|
customElements.define(r, t);
|
|
505
505
|
})) : customElements.define(r, t);
|
|
506
506
|
};
|
|
507
|
-
const
|
|
507
|
+
const Ut = { attribute: !0, type: String, converter: H, reflect: !1, hasChanged: B }, Tt = (r = Ut, t, e) => {
|
|
508
508
|
const { kind: s, metadata: i } = e;
|
|
509
|
-
let
|
|
510
|
-
if (
|
|
511
|
-
const { name:
|
|
512
|
-
return { set(
|
|
513
|
-
const
|
|
514
|
-
t.set.call(this,
|
|
515
|
-
}, init(
|
|
516
|
-
return
|
|
509
|
+
let o = globalThis.litPropertyMetadata.get(i);
|
|
510
|
+
if (o === void 0 && globalThis.litPropertyMetadata.set(i, o = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), o.set(e.name, r), s === "accessor") {
|
|
511
|
+
const { name: n } = e;
|
|
512
|
+
return { set(h) {
|
|
513
|
+
const a = t.get.call(this);
|
|
514
|
+
t.set.call(this, h), this.requestUpdate(n, a, r);
|
|
515
|
+
}, init(h) {
|
|
516
|
+
return h !== void 0 && this.C(n, void 0, r, h), h;
|
|
517
517
|
} };
|
|
518
518
|
}
|
|
519
519
|
if (s === "setter") {
|
|
520
|
-
const { name:
|
|
521
|
-
return function(
|
|
522
|
-
const
|
|
523
|
-
t.call(this,
|
|
520
|
+
const { name: n } = e;
|
|
521
|
+
return function(h) {
|
|
522
|
+
const a = this[n];
|
|
523
|
+
t.call(this, h), this.requestUpdate(n, a, r);
|
|
524
524
|
};
|
|
525
525
|
}
|
|
526
526
|
throw Error("Unsupported decorator location: " + s);
|
|
527
527
|
};
|
|
528
|
-
function
|
|
529
|
-
return (t, e) => typeof e == "object" ?
|
|
530
|
-
const
|
|
531
|
-
return i.constructor.createProperty(
|
|
528
|
+
function U(r) {
|
|
529
|
+
return (t, e) => typeof e == "object" ? Tt(r, t, e) : ((s, i, o) => {
|
|
530
|
+
const n = i.hasOwnProperty(o);
|
|
531
|
+
return i.constructor.createProperty(o, s), n ? Object.getOwnPropertyDescriptor(i, o) : void 0;
|
|
532
532
|
})(r, t, e);
|
|
533
533
|
}
|
|
534
534
|
function Mt(r) {
|
|
535
|
-
return
|
|
535
|
+
return U({ ...r, state: !0, attribute: !1 });
|
|
536
536
|
}
|
|
537
537
|
var Ht = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, E = (r, t, e, s) => {
|
|
538
|
-
for (var i = s > 1 ? void 0 : s ? zt(t, e) : t,
|
|
539
|
-
(
|
|
538
|
+
for (var i = s > 1 ? void 0 : s ? zt(t, e) : t, o = r.length - 1, n; o >= 0; o--)
|
|
539
|
+
(n = r[o]) && (i = (s ? n(t, e, i) : n(i)) || i);
|
|
540
540
|
return s && i && Ht(t, e, i), i;
|
|
541
541
|
};
|
|
542
542
|
let g = class extends C {
|
|
@@ -614,7 +614,7 @@ let g = class extends C {
|
|
|
614
614
|
`;
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
|
-
g.styles =
|
|
617
|
+
g.styles = ht`
|
|
618
618
|
:host {
|
|
619
619
|
display: inline-block;
|
|
620
620
|
}
|
|
@@ -632,11 +632,16 @@ g.styles = at`
|
|
|
632
632
|
font-weight: 500;
|
|
633
633
|
position: relative;
|
|
634
634
|
overflow: hidden;
|
|
635
|
+
color: inherit;
|
|
635
636
|
}
|
|
636
637
|
|
|
637
638
|
.theme-toggle:focus {
|
|
638
639
|
outline: none;
|
|
639
|
-
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
.theme-toggle:focus-visible {
|
|
643
|
+
outline: 2px solid transparent;
|
|
644
|
+
outline-offset: 2px;
|
|
640
645
|
}
|
|
641
646
|
|
|
642
647
|
.theme-toggle:hover {
|
|
@@ -660,22 +665,25 @@ g.styles = at`
|
|
|
660
665
|
padding: 1rem;
|
|
661
666
|
}
|
|
662
667
|
|
|
663
|
-
/* Variant styles */
|
|
668
|
+
/* Variant styles - Light mode */
|
|
664
669
|
.btn--ghost {
|
|
665
670
|
background: transparent;
|
|
671
|
+
border: none;
|
|
666
672
|
}
|
|
667
673
|
|
|
668
674
|
.btn--ghost:hover {
|
|
669
|
-
background:
|
|
675
|
+
background: transparent;
|
|
676
|
+
opacity: 0.7;
|
|
670
677
|
}
|
|
671
678
|
|
|
672
679
|
.btn--outline {
|
|
673
|
-
border: 1px solid
|
|
680
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
674
681
|
background: transparent;
|
|
675
682
|
}
|
|
676
683
|
|
|
677
684
|
.btn--outline:hover {
|
|
678
685
|
background: rgba(0, 0, 0, 0.05);
|
|
686
|
+
border-color: rgba(0, 0, 0, 0.3);
|
|
679
687
|
}
|
|
680
688
|
|
|
681
689
|
.btn--solid {
|
|
@@ -686,6 +694,29 @@ g.styles = at`
|
|
|
686
694
|
background: rgba(0, 0, 0, 0.15);
|
|
687
695
|
}
|
|
688
696
|
|
|
697
|
+
/* Dark mode adaptations */
|
|
698
|
+
:host([theme="dark"]) .btn--ghost:hover {
|
|
699
|
+
background: transparent;
|
|
700
|
+
opacity: 0.7;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
:host([theme="dark"]) .btn--outline {
|
|
704
|
+
border-color: rgba(255, 255, 255, 0.2);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
:host([theme="dark"]) .btn--outline:hover {
|
|
708
|
+
background: rgba(255, 255, 255, 0.1);
|
|
709
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
:host([theme="dark"]) .btn--solid {
|
|
713
|
+
background: rgba(255, 255, 255, 0.1);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
:host([theme="dark"]) .btn--solid:hover {
|
|
717
|
+
background: rgba(255, 255, 255, 0.15);
|
|
718
|
+
}
|
|
719
|
+
|
|
689
720
|
.theme-icon {
|
|
690
721
|
width: 1.25rem;
|
|
691
722
|
height: 1.25rem;
|
|
@@ -734,22 +765,22 @@ g.styles = at`
|
|
|
734
765
|
}
|
|
735
766
|
`;
|
|
736
767
|
E([
|
|
737
|
-
|
|
768
|
+
U({ type: String, reflect: !0 })
|
|
738
769
|
], g.prototype, "theme", 2);
|
|
739
770
|
E([
|
|
740
|
-
|
|
771
|
+
U({ type: String, attribute: "storage-key" })
|
|
741
772
|
], g.prototype, "storageKey", 2);
|
|
742
773
|
E([
|
|
743
|
-
|
|
774
|
+
U({ type: String, attribute: "size" })
|
|
744
775
|
], g.prototype, "size", 2);
|
|
745
776
|
E([
|
|
746
|
-
|
|
777
|
+
U({ type: String, attribute: "variant" })
|
|
747
778
|
], g.prototype, "variant", 2);
|
|
748
779
|
E([
|
|
749
780
|
Mt()
|
|
750
781
|
], g.prototype, "isDark", 2);
|
|
751
782
|
g = E([
|
|
752
|
-
|
|
783
|
+
Ot("theme-toggle")
|
|
753
784
|
], g);
|
|
754
785
|
export {
|
|
755
786
|
g as ThemeToggle
|