@trenoxxious/n-components 1.0.2 → 1.0.3
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/n-components.js +660 -0
- package/package.json +6 -4
- package/index.html +0 -77
- package/src/assets/lit.svg +0 -1
- package/src/components/n-button.ts +0 -140
- package/src/index.css +0 -188
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -27
- /package/{public → dist}/vite.svg +0 -0
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
var t$2 = globalThis, e$1 = t$2.ShadowRoot && (t$2.ShadyCSS === void 0 || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$3 = /* @__PURE__ */ new WeakMap(), n$1 = class {
|
|
7
|
+
constructor(x, j, U) {
|
|
8
|
+
if (this._$cssResult$ = !0, U !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
9
|
+
this.cssText = x, this.t = j;
|
|
10
|
+
}
|
|
11
|
+
get styleSheet() {
|
|
12
|
+
let x = this.o, F = this.t;
|
|
13
|
+
if (e$1 && x === void 0) {
|
|
14
|
+
let j = F !== void 0 && F.length === 1;
|
|
15
|
+
j && (x = o$3.get(F)), x === void 0 && ((this.o = x = new CSSStyleSheet()).replaceSync(this.cssText), j && o$3.set(F, x));
|
|
16
|
+
}
|
|
17
|
+
return x;
|
|
18
|
+
}
|
|
19
|
+
toString() {
|
|
20
|
+
return this.cssText;
|
|
21
|
+
}
|
|
22
|
+
}, r$1 = (x) => new n$1(typeof x == "string" ? x : x + "", void 0, s$2), i$1 = (x, ...j) => new n$1(x.length === 1 ? x[0] : j.reduce((j, F, U) => j + ((x) => {
|
|
23
|
+
if (!0 === x._$cssResult$) return x.cssText;
|
|
24
|
+
if (typeof x == "number") return x;
|
|
25
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + x + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
26
|
+
})(F) + x[U + 1], x[0]), x, s$2), S$1 = (F, U) => {
|
|
27
|
+
if (e$1) F.adoptedStyleSheets = U.map((x) => x instanceof CSSStyleSheet ? x : x.styleSheet);
|
|
28
|
+
else for (let j of U) {
|
|
29
|
+
let U = document.createElement("style"), W = t$2.litNonce;
|
|
30
|
+
W !== void 0 && U.setAttribute("nonce", W), U.textContent = j.cssText, F.appendChild(U);
|
|
31
|
+
}
|
|
32
|
+
}, c$1 = e$1 ? (x) => x : (x) => x instanceof CSSStyleSheet ? ((x) => {
|
|
33
|
+
let j = "";
|
|
34
|
+
for (let F of x.cssRules) j += F.cssText;
|
|
35
|
+
return r$1(j);
|
|
36
|
+
})(x) : x, { is: i$3, defineProperty: e$2, getOwnPropertyDescriptor: h$1, getOwnPropertyNames: r$2, getOwnPropertySymbols: o$2, getPrototypeOf: n$2 } = Object, a$1 = globalThis, c$2 = a$1.trustedTypes, l$1 = c$2 ? c$2.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (x, j) => x, u$1 = {
|
|
37
|
+
toAttribute(x, j) {
|
|
38
|
+
switch (j) {
|
|
39
|
+
case Boolean:
|
|
40
|
+
x = x ? l$1 : null;
|
|
41
|
+
break;
|
|
42
|
+
case Object:
|
|
43
|
+
case Array: x = x == null ? x : JSON.stringify(x);
|
|
44
|
+
}
|
|
45
|
+
return x;
|
|
46
|
+
},
|
|
47
|
+
fromAttribute(x, j) {
|
|
48
|
+
let F = x;
|
|
49
|
+
switch (j) {
|
|
50
|
+
case Boolean:
|
|
51
|
+
F = x !== null;
|
|
52
|
+
break;
|
|
53
|
+
case Number:
|
|
54
|
+
F = x === null ? null : Number(x);
|
|
55
|
+
break;
|
|
56
|
+
case Object:
|
|
57
|
+
case Array: try {
|
|
58
|
+
F = JSON.parse(x);
|
|
59
|
+
} catch {
|
|
60
|
+
F = null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return F;
|
|
64
|
+
}
|
|
65
|
+
}, f$1 = (x, j) => !i$3(x, j), b$1 = {
|
|
66
|
+
attribute: !0,
|
|
67
|
+
type: String,
|
|
68
|
+
converter: u$1,
|
|
69
|
+
reflect: !1,
|
|
70
|
+
useDefault: !1,
|
|
71
|
+
hasChanged: f$1
|
|
72
|
+
};
|
|
73
|
+
Symbol.metadata ??= Symbol("metadata"), a$1.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
74
|
+
var y = class extends HTMLElement {
|
|
75
|
+
static addInitializer(x) {
|
|
76
|
+
this._$Ei(), (this.l ??= []).push(x);
|
|
77
|
+
}
|
|
78
|
+
static get observedAttributes() {
|
|
79
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
80
|
+
}
|
|
81
|
+
static createProperty(x, j = b$1) {
|
|
82
|
+
if (j.state && (j.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(x) && ((j = Object.create(j)).wrapped = !0), this.elementProperties.set(x, j), !j.noAccessor) {
|
|
83
|
+
let F = Symbol(), U = this.getPropertyDescriptor(x, F, j);
|
|
84
|
+
U !== void 0 && e$2(this.prototype, x, U);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static getPropertyDescriptor(x, j, F) {
|
|
88
|
+
let { get: U, set: W } = h$1(this.prototype, x) ?? {
|
|
89
|
+
get() {
|
|
90
|
+
return this[j];
|
|
91
|
+
},
|
|
92
|
+
set(x) {
|
|
93
|
+
this[j] = x;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return {
|
|
97
|
+
get: U,
|
|
98
|
+
set(j) {
|
|
99
|
+
let G = U?.call(this);
|
|
100
|
+
W?.call(this, j), this.requestUpdate(x, G, F);
|
|
101
|
+
},
|
|
102
|
+
configurable: !0,
|
|
103
|
+
enumerable: !0
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
static getPropertyOptions(x) {
|
|
107
|
+
return this.elementProperties.get(x) ?? b$1;
|
|
108
|
+
}
|
|
109
|
+
static _$Ei() {
|
|
110
|
+
if (this.hasOwnProperty(d$1("elementProperties"))) return;
|
|
111
|
+
let x = n$2(this);
|
|
112
|
+
x.finalize(), x.l !== void 0 && (this.l = [...x.l]), this.elementProperties = new Map(x.elementProperties);
|
|
113
|
+
}
|
|
114
|
+
static finalize() {
|
|
115
|
+
if (this.hasOwnProperty(d$1("finalized"))) return;
|
|
116
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
|
|
117
|
+
let x = this.properties, j = [...r$2(x), ...o$2(x)];
|
|
118
|
+
for (let F of j) this.createProperty(F, x[F]);
|
|
119
|
+
}
|
|
120
|
+
let x = this[Symbol.metadata];
|
|
121
|
+
if (x !== null) {
|
|
122
|
+
let j = litPropertyMetadata.get(x);
|
|
123
|
+
if (j !== void 0) for (let [x, F] of j) this.elementProperties.set(x, F);
|
|
124
|
+
}
|
|
125
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
126
|
+
for (let [x, j] of this.elementProperties) {
|
|
127
|
+
let F = this._$Eu(x, j);
|
|
128
|
+
F !== void 0 && this._$Eh.set(F, x);
|
|
129
|
+
}
|
|
130
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
131
|
+
}
|
|
132
|
+
static finalizeStyles(x) {
|
|
133
|
+
let j = [];
|
|
134
|
+
if (Array.isArray(x)) {
|
|
135
|
+
let F = new Set(x.flat(Infinity).reverse());
|
|
136
|
+
for (let x of F) j.unshift(c$1(x));
|
|
137
|
+
} else x !== void 0 && j.push(c$1(x));
|
|
138
|
+
return j;
|
|
139
|
+
}
|
|
140
|
+
static _$Eu(x, j) {
|
|
141
|
+
let F = j.attribute;
|
|
142
|
+
return !1 === F ? void 0 : typeof F == "string" ? F : typeof x == "string" ? x.toLowerCase() : void 0;
|
|
143
|
+
}
|
|
144
|
+
constructor() {
|
|
145
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
146
|
+
}
|
|
147
|
+
_$Ev() {
|
|
148
|
+
this._$ES = new Promise((x) => this.enableUpdating = x), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((x) => x(this));
|
|
149
|
+
}
|
|
150
|
+
addController(x) {
|
|
151
|
+
(this._$EO ??= /* @__PURE__ */ new Set()).add(x), this.renderRoot !== void 0 && this.isConnected && x.hostConnected?.();
|
|
152
|
+
}
|
|
153
|
+
removeController(x) {
|
|
154
|
+
this._$EO?.delete(x);
|
|
155
|
+
}
|
|
156
|
+
_$E_() {
|
|
157
|
+
let x = /* @__PURE__ */ new Map(), j = this.constructor.elementProperties;
|
|
158
|
+
for (let F of j.keys()) this.hasOwnProperty(F) && (x.set(F, this[F]), delete this[F]);
|
|
159
|
+
x.size > 0 && (this._$Ep = x);
|
|
160
|
+
}
|
|
161
|
+
createRenderRoot() {
|
|
162
|
+
let x = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
163
|
+
return S$1(x, this.constructor.elementStyles), x;
|
|
164
|
+
}
|
|
165
|
+
connectedCallback() {
|
|
166
|
+
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach((x) => x.hostConnected?.());
|
|
167
|
+
}
|
|
168
|
+
enableUpdating(x) {}
|
|
169
|
+
disconnectedCallback() {
|
|
170
|
+
this._$EO?.forEach((x) => x.hostDisconnected?.());
|
|
171
|
+
}
|
|
172
|
+
attributeChangedCallback(x, j, F) {
|
|
173
|
+
this._$AK(x, F);
|
|
174
|
+
}
|
|
175
|
+
_$ET(x, j) {
|
|
176
|
+
let F = this.constructor.elementProperties.get(x), U = this.constructor._$Eu(x, F);
|
|
177
|
+
if (U !== void 0 && !0 === F.reflect) {
|
|
178
|
+
let W = (F.converter?.toAttribute === void 0 ? u$1 : F.converter).toAttribute(j, F.type);
|
|
179
|
+
this._$Em = x, W == null ? this.removeAttribute(U) : this.setAttribute(U, W), this._$Em = null;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
_$AK(x, j) {
|
|
183
|
+
let F = this.constructor, U = F._$Eh.get(x);
|
|
184
|
+
if (U !== void 0 && this._$Em !== U) {
|
|
185
|
+
let x = F.getPropertyOptions(U), W = typeof x.converter == "function" ? { fromAttribute: x.converter } : x.converter?.fromAttribute === void 0 ? u$1 : x.converter;
|
|
186
|
+
this._$Em = U;
|
|
187
|
+
let G = W.fromAttribute(j, x.type);
|
|
188
|
+
this[U] = G ?? this._$Ej?.get(U) ?? G, this._$Em = null;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
requestUpdate(x, j, F, U = !1, W) {
|
|
192
|
+
if (x !== void 0) {
|
|
193
|
+
let G = this.constructor;
|
|
194
|
+
if (!1 === U && (W = this[x]), F ??= G.getPropertyOptions(x), !((F.hasChanged ?? f$1)(W, j) || F.useDefault && F.reflect && W === this._$Ej?.get(x) && !this.hasAttribute(G._$Eu(x, F)))) return;
|
|
195
|
+
this.C(x, j, F);
|
|
196
|
+
}
|
|
197
|
+
!1 === this.isUpdatePending && (this._$ES = this._$EP());
|
|
198
|
+
}
|
|
199
|
+
C(x, j, { useDefault: F, reflect: U, wrapped: W }, G) {
|
|
200
|
+
F && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(x) && (this._$Ej.set(x, G ?? j ?? this[x]), !0 !== W || G !== void 0) || (this._$AL.has(x) || (this.hasUpdated || F || (j = void 0), this._$AL.set(x, j)), !0 === U && this._$Em !== x && (this._$Eq ??= /* @__PURE__ */ new Set()).add(x));
|
|
201
|
+
}
|
|
202
|
+
async _$EP() {
|
|
203
|
+
this.isUpdatePending = !0;
|
|
204
|
+
try {
|
|
205
|
+
await this._$ES;
|
|
206
|
+
} catch (x) {
|
|
207
|
+
Promise.reject(x);
|
|
208
|
+
}
|
|
209
|
+
let x = this.scheduleUpdate();
|
|
210
|
+
return x != null && await x, !this.isUpdatePending;
|
|
211
|
+
}
|
|
212
|
+
scheduleUpdate() {
|
|
213
|
+
return this.performUpdate();
|
|
214
|
+
}
|
|
215
|
+
performUpdate() {
|
|
216
|
+
if (!this.isUpdatePending) return;
|
|
217
|
+
if (!this.hasUpdated) {
|
|
218
|
+
if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
|
|
219
|
+
for (let [x, j] of this._$Ep) this[x] = j;
|
|
220
|
+
this._$Ep = void 0;
|
|
221
|
+
}
|
|
222
|
+
let x = this.constructor.elementProperties;
|
|
223
|
+
if (x.size > 0) for (let [j, F] of x) {
|
|
224
|
+
let { wrapped: x } = F, U = this[j];
|
|
225
|
+
!0 !== x || this._$AL.has(j) || U === void 0 || this.C(j, void 0, F, U);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
let x = !1, j = this._$AL;
|
|
229
|
+
try {
|
|
230
|
+
x = this.shouldUpdate(j), x ? (this.willUpdate(j), this._$EO?.forEach((x) => x.hostUpdate?.()), this.update(j)) : this._$EM();
|
|
231
|
+
} catch (j) {
|
|
232
|
+
throw x = !1, this._$EM(), j;
|
|
233
|
+
}
|
|
234
|
+
x && this._$AE(j);
|
|
235
|
+
}
|
|
236
|
+
willUpdate(x) {}
|
|
237
|
+
_$AE(x) {
|
|
238
|
+
this._$EO?.forEach((x) => x.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(x)), this.updated(x);
|
|
239
|
+
}
|
|
240
|
+
_$EM() {
|
|
241
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
242
|
+
}
|
|
243
|
+
get updateComplete() {
|
|
244
|
+
return this.getUpdateComplete();
|
|
245
|
+
}
|
|
246
|
+
getUpdateComplete() {
|
|
247
|
+
return this._$ES;
|
|
248
|
+
}
|
|
249
|
+
shouldUpdate(x) {
|
|
250
|
+
return !0;
|
|
251
|
+
}
|
|
252
|
+
update(x) {
|
|
253
|
+
this._$Eq &&= this._$Eq.forEach((x) => this._$ET(x, this[x])), this._$EM();
|
|
254
|
+
}
|
|
255
|
+
updated(x) {}
|
|
256
|
+
firstUpdated(x) {}
|
|
257
|
+
};
|
|
258
|
+
y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y }), (a$1.reactiveElementVersions ??= []).push("2.1.2");
|
|
259
|
+
/**
|
|
260
|
+
* @license
|
|
261
|
+
* Copyright 2017 Google LLC
|
|
262
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
263
|
+
*/
|
|
264
|
+
var t$1 = globalThis, i$2 = (x) => x, s$1 = t$1.trustedTypes, e = s$1 ? s$1.createPolicy("lit-html", { createHTML: (x) => x }) : void 0, h = "$lit$", o$1 = `lit$${Math.random().toFixed(9).slice(2)}$`, n = "?" + o$1, r = `<${n}>`, l = document, c = () => l.createComment(""), a = (x) => x === null || typeof x != "object" && typeof x != "function", u = Array.isArray, d = (x) => u(x) || typeof x?.[Symbol.iterator] == "function", f = "[ \n\f\r]", v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m = />/g, p = RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y$1 = /^(?:script|style|textarea|title)$/i, b = ((x) => (j, ...F) => ({
|
|
265
|
+
_$litType$: x,
|
|
266
|
+
strings: j,
|
|
267
|
+
values: F
|
|
268
|
+
}))(1), E = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), C = /* @__PURE__ */ new WeakMap(), P = l.createTreeWalker(l, 129);
|
|
269
|
+
function V(x, j) {
|
|
270
|
+
if (!u(x) || !x.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
271
|
+
return e === void 0 ? j : e.createHTML(j);
|
|
272
|
+
}
|
|
273
|
+
var N = (x, j) => {
|
|
274
|
+
let F = x.length - 1, U = [], W, G = j === 2 ? "<svg>" : j === 3 ? "<math>" : "", K = v;
|
|
275
|
+
for (let j = 0; j < F; j++) {
|
|
276
|
+
let F = x[j], q, J, Y = -1, X = 0;
|
|
277
|
+
for (; X < F.length && (K.lastIndex = X, J = K.exec(F), J !== null);) X = K.lastIndex, K === v ? J[1] === "!--" ? K = _ : J[1] === void 0 ? J[2] === void 0 ? J[3] !== void 0 && (K = p) : (y$1.test(J[2]) && (W = RegExp("</" + J[2], "g")), K = p) : K = m : K === p ? J[0] === ">" ? (K = W ?? v, Y = -1) : J[1] === void 0 ? Y = -2 : (Y = K.lastIndex - J[2].length, q = J[1], K = J[3] === void 0 ? p : J[3] === "\"" ? $ : g) : K === $ || K === g ? K = p : K === _ || K === m ? K = v : (K = p, W = void 0);
|
|
278
|
+
let Q = K === p && x[j + 1].startsWith("/>") ? " " : "";
|
|
279
|
+
G += K === v ? F + r : Y >= 0 ? (U.push(q), F.slice(0, Y) + h + F.slice(Y) + o$1 + Q) : F + o$1 + (Y === -2 ? j : Q);
|
|
280
|
+
}
|
|
281
|
+
return [V(x, G + (x[F] || "<?>") + (j === 2 ? "</svg>" : j === 3 ? "</math>" : "")), U];
|
|
282
|
+
}, S = class x {
|
|
283
|
+
constructor({ strings: j, _$litType$: F }, U) {
|
|
284
|
+
let W;
|
|
285
|
+
this.parts = [];
|
|
286
|
+
let G = 0, K = 0, q = j.length - 1, J = this.parts, [Y, X] = N(j, F);
|
|
287
|
+
if (this.el = x.createElement(Y, U), P.currentNode = this.el.content, F === 2 || F === 3) {
|
|
288
|
+
let x = this.el.content.firstChild;
|
|
289
|
+
x.replaceWith(...x.childNodes);
|
|
290
|
+
}
|
|
291
|
+
for (; (W = P.nextNode()) !== null && J.length < q;) {
|
|
292
|
+
if (W.nodeType === 1) {
|
|
293
|
+
if (W.hasAttributes()) for (let x of W.getAttributeNames()) if (x.endsWith(h)) {
|
|
294
|
+
let j = X[K++], F = W.getAttribute(x).split(o$1), U = /([.?@])?(.*)/.exec(j);
|
|
295
|
+
J.push({
|
|
296
|
+
type: 1,
|
|
297
|
+
index: G,
|
|
298
|
+
name: U[2],
|
|
299
|
+
strings: F,
|
|
300
|
+
ctor: U[1] === "." ? I : U[1] === "?" ? L : U[1] === "@" ? z : H
|
|
301
|
+
}), W.removeAttribute(x);
|
|
302
|
+
} else x.startsWith(o$1) && (J.push({
|
|
303
|
+
type: 6,
|
|
304
|
+
index: G
|
|
305
|
+
}), W.removeAttribute(x));
|
|
306
|
+
if (y$1.test(W.tagName)) {
|
|
307
|
+
let x = W.textContent.split(o$1), j = x.length - 1;
|
|
308
|
+
if (j > 0) {
|
|
309
|
+
W.textContent = s$1 ? s$1.emptyScript : "";
|
|
310
|
+
for (let F = 0; F < j; F++) W.append(x[F], c()), P.nextNode(), J.push({
|
|
311
|
+
type: 2,
|
|
312
|
+
index: ++G
|
|
313
|
+
});
|
|
314
|
+
W.append(x[j], c());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
} else if (W.nodeType === 8) if (W.data === n) J.push({
|
|
318
|
+
type: 2,
|
|
319
|
+
index: G
|
|
320
|
+
});
|
|
321
|
+
else {
|
|
322
|
+
let x = -1;
|
|
323
|
+
for (; (x = W.data.indexOf(o$1, x + 1)) !== -1;) J.push({
|
|
324
|
+
type: 7,
|
|
325
|
+
index: G
|
|
326
|
+
}), x += o$1.length - 1;
|
|
327
|
+
}
|
|
328
|
+
G++;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
static createElement(x, j) {
|
|
332
|
+
let F = l.createElement("template");
|
|
333
|
+
return F.innerHTML = x, F;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
function M(x, j, F = x, U) {
|
|
337
|
+
if (j === E) return j;
|
|
338
|
+
let W = U === void 0 ? F._$Cl : F._$Co?.[U], G = a(j) ? void 0 : j._$litDirective$;
|
|
339
|
+
return W?.constructor !== G && (W?._$AO?.(!1), G === void 0 ? W = void 0 : (W = new G(x), W._$AT(x, F, U)), U === void 0 ? F._$Cl = W : (F._$Co ??= [])[U] = W), W !== void 0 && (j = M(x, W._$AS(x, j.values), W, U)), j;
|
|
340
|
+
}
|
|
341
|
+
var R = class {
|
|
342
|
+
constructor(x, j) {
|
|
343
|
+
this._$AV = [], this._$AN = void 0, this._$AD = x, this._$AM = j;
|
|
344
|
+
}
|
|
345
|
+
get parentNode() {
|
|
346
|
+
return this._$AM.parentNode;
|
|
347
|
+
}
|
|
348
|
+
get _$AU() {
|
|
349
|
+
return this._$AM._$AU;
|
|
350
|
+
}
|
|
351
|
+
u(x) {
|
|
352
|
+
let { el: { content: j }, parts: F } = this._$AD, U = (x?.creationScope ?? l).importNode(j, !0);
|
|
353
|
+
P.currentNode = U;
|
|
354
|
+
let W = P.nextNode(), G = 0, K = 0, q = F[0];
|
|
355
|
+
for (; q !== void 0;) {
|
|
356
|
+
if (G === q.index) {
|
|
357
|
+
let j;
|
|
358
|
+
q.type === 2 ? j = new k(W, W.nextSibling, this, x) : q.type === 1 ? j = new q.ctor(W, q.name, q.strings, this, x) : q.type === 6 && (j = new Z(W, this, x)), this._$AV.push(j), q = F[++K];
|
|
359
|
+
}
|
|
360
|
+
G !== q?.index && (W = P.nextNode(), G++);
|
|
361
|
+
}
|
|
362
|
+
return P.currentNode = l, U;
|
|
363
|
+
}
|
|
364
|
+
p(x) {
|
|
365
|
+
let j = 0;
|
|
366
|
+
for (let F of this._$AV) F !== void 0 && (F.strings === void 0 ? F._$AI(x[j]) : (F._$AI(x, F, j), j += F.strings.length - 2)), j++;
|
|
367
|
+
}
|
|
368
|
+
}, k = class x {
|
|
369
|
+
get _$AU() {
|
|
370
|
+
return this._$AM?._$AU ?? this._$Cv;
|
|
371
|
+
}
|
|
372
|
+
constructor(x, j, F, U) {
|
|
373
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = x, this._$AB = j, this._$AM = F, this.options = U, this._$Cv = U?.isConnected ?? !0;
|
|
374
|
+
}
|
|
375
|
+
get parentNode() {
|
|
376
|
+
let x = this._$AA.parentNode, j = this._$AM;
|
|
377
|
+
return j !== void 0 && x?.nodeType === 11 && (x = j.parentNode), x;
|
|
378
|
+
}
|
|
379
|
+
get startNode() {
|
|
380
|
+
return this._$AA;
|
|
381
|
+
}
|
|
382
|
+
get endNode() {
|
|
383
|
+
return this._$AB;
|
|
384
|
+
}
|
|
385
|
+
_$AI(x, j = this) {
|
|
386
|
+
x = M(this, x, j), a(x) ? x === A || x == null || x === "" ? (this._$AH !== A && this._$AR(), this._$AH = A) : x !== this._$AH && x !== E && this._(x) : x._$litType$ === void 0 ? x.nodeType === void 0 ? d(x) ? this.k(x) : this._(x) : this.T(x) : this.$(x);
|
|
387
|
+
}
|
|
388
|
+
O(x) {
|
|
389
|
+
return this._$AA.parentNode.insertBefore(x, this._$AB);
|
|
390
|
+
}
|
|
391
|
+
T(x) {
|
|
392
|
+
this._$AH !== x && (this._$AR(), this._$AH = this.O(x));
|
|
393
|
+
}
|
|
394
|
+
_(x) {
|
|
395
|
+
this._$AH !== A && a(this._$AH) ? this._$AA.nextSibling.data = x : this.T(l.createTextNode(x)), this._$AH = x;
|
|
396
|
+
}
|
|
397
|
+
$(x) {
|
|
398
|
+
let { values: j, _$litType$: F } = x, U = typeof F == "number" ? this._$AC(x) : (F.el === void 0 && (F.el = S.createElement(V(F.h, F.h[0]), this.options)), F);
|
|
399
|
+
if (this._$AH?._$AD === U) this._$AH.p(j);
|
|
400
|
+
else {
|
|
401
|
+
let x = new R(U, this), F = x.u(this.options);
|
|
402
|
+
x.p(j), this.T(F), this._$AH = x;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
_$AC(x) {
|
|
406
|
+
let j = C.get(x.strings);
|
|
407
|
+
return j === void 0 && C.set(x.strings, j = new S(x)), j;
|
|
408
|
+
}
|
|
409
|
+
k(j) {
|
|
410
|
+
u(this._$AH) || (this._$AH = [], this._$AR());
|
|
411
|
+
let F = this._$AH, U, W = 0;
|
|
412
|
+
for (let G of j) W === F.length ? F.push(U = new x(this.O(c()), this.O(c()), this, this.options)) : U = F[W], U._$AI(G), W++;
|
|
413
|
+
W < F.length && (this._$AR(U && U._$AB.nextSibling, W), F.length = W);
|
|
414
|
+
}
|
|
415
|
+
_$AR(x = this._$AA.nextSibling, j) {
|
|
416
|
+
for (this._$AP?.(!1, !0, j); x !== this._$AB;) {
|
|
417
|
+
let j = i$2(x).nextSibling;
|
|
418
|
+
i$2(x).remove(), x = j;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
setConnected(x) {
|
|
422
|
+
this._$AM === void 0 && (this._$Cv = x, this._$AP?.(x));
|
|
423
|
+
}
|
|
424
|
+
}, H = class {
|
|
425
|
+
get tagName() {
|
|
426
|
+
return this.element.tagName;
|
|
427
|
+
}
|
|
428
|
+
get _$AU() {
|
|
429
|
+
return this._$AM._$AU;
|
|
430
|
+
}
|
|
431
|
+
constructor(x, j, F, U, W) {
|
|
432
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = x, this.name = j, this._$AM = U, this.options = W, F.length > 2 || F[0] !== "" || F[1] !== "" ? (this._$AH = Array(F.length - 1).fill(/* @__PURE__ */ new String()), this.strings = F) : this._$AH = A;
|
|
433
|
+
}
|
|
434
|
+
_$AI(x, j = this, F, U) {
|
|
435
|
+
let W = this.strings, G = !1;
|
|
436
|
+
if (W === void 0) x = M(this, x, j, 0), G = !a(x) || x !== this._$AH && x !== E, G && (this._$AH = x);
|
|
437
|
+
else {
|
|
438
|
+
let U = x, K, q;
|
|
439
|
+
for (x = W[0], K = 0; K < W.length - 1; K++) q = M(this, U[F + K], j, K), q === E && (q = this._$AH[K]), G ||= !a(q) || q !== this._$AH[K], q === A ? x = A : x !== A && (x += (q ?? "") + W[K + 1]), this._$AH[K] = q;
|
|
440
|
+
}
|
|
441
|
+
G && !U && this.j(x);
|
|
442
|
+
}
|
|
443
|
+
j(x) {
|
|
444
|
+
x === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, x ?? "");
|
|
445
|
+
}
|
|
446
|
+
}, I = class extends H {
|
|
447
|
+
constructor() {
|
|
448
|
+
super(...arguments), this.type = 3;
|
|
449
|
+
}
|
|
450
|
+
j(x) {
|
|
451
|
+
this.element[this.name] = x === A ? void 0 : x;
|
|
452
|
+
}
|
|
453
|
+
}, L = class extends H {
|
|
454
|
+
constructor() {
|
|
455
|
+
super(...arguments), this.type = 4;
|
|
456
|
+
}
|
|
457
|
+
j(x) {
|
|
458
|
+
this.element.toggleAttribute(this.name, !!x && x !== A);
|
|
459
|
+
}
|
|
460
|
+
}, z = class extends H {
|
|
461
|
+
constructor(x, j, F, U, W) {
|
|
462
|
+
super(x, j, F, U, W), this.type = 5;
|
|
463
|
+
}
|
|
464
|
+
_$AI(x, j = this) {
|
|
465
|
+
if ((x = M(this, x, j, 0) ?? A) === E) return;
|
|
466
|
+
let F = this._$AH, U = x === A && F !== A || x.capture !== F.capture || x.once !== F.once || x.passive !== F.passive, W = x !== A && (F === A || U);
|
|
467
|
+
U && this.element.removeEventListener(this.name, this, F), W && this.element.addEventListener(this.name, this, x), this._$AH = x;
|
|
468
|
+
}
|
|
469
|
+
handleEvent(x) {
|
|
470
|
+
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, x) : this._$AH.handleEvent(x);
|
|
471
|
+
}
|
|
472
|
+
}, Z = class {
|
|
473
|
+
constructor(x, j, F) {
|
|
474
|
+
this.element = x, this.type = 6, this._$AN = void 0, this._$AM = j, this.options = F;
|
|
475
|
+
}
|
|
476
|
+
get _$AU() {
|
|
477
|
+
return this._$AM._$AU;
|
|
478
|
+
}
|
|
479
|
+
_$AI(x) {
|
|
480
|
+
M(this, x);
|
|
481
|
+
}
|
|
482
|
+
}, B = t$1.litHtmlPolyfillSupport;
|
|
483
|
+
B?.(S, k), (t$1.litHtmlVersions ??= []).push("3.3.2");
|
|
484
|
+
var D = (x, j, F) => {
|
|
485
|
+
let U = F?.renderBefore ?? j, W = U._$litPart$;
|
|
486
|
+
if (W === void 0) {
|
|
487
|
+
let x = F?.renderBefore ?? null;
|
|
488
|
+
U._$litPart$ = W = new k(j.insertBefore(c(), x), x, void 0, F ?? {});
|
|
489
|
+
}
|
|
490
|
+
return W._$AI(x), W;
|
|
491
|
+
}, s = globalThis, i = class extends y {
|
|
492
|
+
constructor() {
|
|
493
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
494
|
+
}
|
|
495
|
+
createRenderRoot() {
|
|
496
|
+
let x = super.createRenderRoot();
|
|
497
|
+
return this.renderOptions.renderBefore ??= x.firstChild, x;
|
|
498
|
+
}
|
|
499
|
+
update(x) {
|
|
500
|
+
let j = this.render();
|
|
501
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(x), this._$Do = D(j, this.renderRoot, this.renderOptions);
|
|
502
|
+
}
|
|
503
|
+
connectedCallback() {
|
|
504
|
+
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
505
|
+
}
|
|
506
|
+
disconnectedCallback() {
|
|
507
|
+
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
508
|
+
}
|
|
509
|
+
render() {
|
|
510
|
+
return E;
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
i._$litElement$ = !0, i.finalized = !0, s.litElementHydrateSupport?.({ LitElement: i });
|
|
514
|
+
var o = s.litElementPolyfillSupport;
|
|
515
|
+
o?.({ LitElement: i }), (s.litElementVersions ??= []).push("4.2.2");
|
|
516
|
+
/**
|
|
517
|
+
* @license
|
|
518
|
+
* Copyright 2017 Google LLC
|
|
519
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
520
|
+
*/
|
|
521
|
+
var t = (x) => (j, F) => {
|
|
522
|
+
F === void 0 ? customElements.define(x, j) : F.addInitializer(() => {
|
|
523
|
+
customElements.define(x, j);
|
|
524
|
+
});
|
|
525
|
+
};
|
|
526
|
+
function __decorate(x, j, F, U) {
|
|
527
|
+
var W = arguments.length, G = W < 3 ? j : U === null ? U = Object.getOwnPropertyDescriptor(j, F) : U, K;
|
|
528
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") G = Reflect.decorate(x, j, F, U);
|
|
529
|
+
else for (var q = x.length - 1; q >= 0; q--) (K = x[q]) && (G = (W < 3 ? K(G) : W > 3 ? K(j, F, G) : K(j, F)) || G);
|
|
530
|
+
return W > 3 && G && Object.defineProperty(j, F, G), G;
|
|
531
|
+
}
|
|
532
|
+
var NButton = class extends i {
|
|
533
|
+
constructor(...x) {
|
|
534
|
+
super(...x), this.variant = "normal", this.thin = !1, this.thick = !1, this.outlineOnly = !1, this.scaleHover = !1, this.rounded = !1, this.sharp = !1, this.dark = !1, this.animation = "normal";
|
|
535
|
+
}
|
|
536
|
+
static #e = this.properties = {
|
|
537
|
+
variant: { type: String },
|
|
538
|
+
animation: { type: String },
|
|
539
|
+
thin: { type: Boolean },
|
|
540
|
+
thick: { type: Boolean },
|
|
541
|
+
outlineOnly: { type: Boolean },
|
|
542
|
+
rounded: { type: Boolean },
|
|
543
|
+
sharp: { type: Boolean },
|
|
544
|
+
scaleHover: { type: Boolean },
|
|
545
|
+
dark: { type: Boolean }
|
|
546
|
+
};
|
|
547
|
+
static #t = this.styles = i$1`
|
|
548
|
+
button {
|
|
549
|
+
padding: 8px 16px;
|
|
550
|
+
border: none;
|
|
551
|
+
cursor: pointer;
|
|
552
|
+
font-size: 14px;
|
|
553
|
+
font-weight: 400;
|
|
554
|
+
border-radius: 2px;
|
|
555
|
+
transition: all;
|
|
556
|
+
animation-duration: 0.3s;
|
|
557
|
+
min-width: 100px;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
button.info {
|
|
561
|
+
background-color: #007bff;
|
|
562
|
+
color: white;
|
|
563
|
+
border: 1px solid #2c92ffff;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
button.info:hover {
|
|
567
|
+
background-color: #268fffff;
|
|
568
|
+
border: 1px solid #4da3ffff;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
button.normal {
|
|
572
|
+
background-color: #e0e0e0;
|
|
573
|
+
color: #242424ff;
|
|
574
|
+
border: 1px solid #ddd;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
button.normal:hover {
|
|
578
|
+
background-color: #f5f5f5ff;
|
|
579
|
+
border: 1px solid #ffffffff;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
button.warning {
|
|
583
|
+
background-color: rgba(241, 132, 7, 1);
|
|
584
|
+
color: white;
|
|
585
|
+
border: 1px solid rgba(248, 142, 42, 1);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
button.warning:hover {
|
|
589
|
+
background-color: rgba(240, 162, 16, 1);
|
|
590
|
+
border: 1px solid rgba(255, 184, 53, 1);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
button.alert {
|
|
594
|
+
background-color: rgba(233, 30, 23, 1);
|
|
595
|
+
color: white;
|
|
596
|
+
border: 1px solid rgba(248, 49, 42, 1);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
button.alert:hover {
|
|
600
|
+
background-color: rgba(248, 44, 44, 1);
|
|
601
|
+
border: 1px solid rgba(255, 76, 76, 1);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
button.thin {
|
|
605
|
+
padding: 4px 8px;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
button.thick {
|
|
609
|
+
padding: 12px 24px;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
button.outline-only {
|
|
613
|
+
background-color: transparent !important;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
button.scale-hover:hover {
|
|
617
|
+
transform: scale(1.05);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.animation-fast {
|
|
621
|
+
transition: all 0.10s;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.animation-normal {
|
|
625
|
+
transition: all 0.25s;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.animation-slow {
|
|
629
|
+
transition: all 0.45s;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
.animation-extra-slow {
|
|
633
|
+
transition: all 1s;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.rounded {
|
|
637
|
+
border-radius: 4px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.sharp {
|
|
641
|
+
border-radius: 0;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
@media screen and (width <= 1024px) {
|
|
645
|
+
button {
|
|
646
|
+
font-size: 12px;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
`;
|
|
650
|
+
render() {
|
|
651
|
+
let x = this.variant === "normal" && this.dark ? "white" : "";
|
|
652
|
+
return b`<button
|
|
653
|
+
class="${this.variant}${this.thin && !this.thick ? " thin" : this.thick ? " thick" : ""}${this.outlineOnly ? " outline-only" : ""}${this.scaleHover ? " scale-hover" : ""}${this.rounded && !this.sharp ? " rounded" : this.sharp ? " sharp" : ""} animation-${this.animation}"
|
|
654
|
+
style="${x ? `color: ${x}` : ""}">
|
|
655
|
+
<slot></slot>
|
|
656
|
+
</button>`;
|
|
657
|
+
}
|
|
658
|
+
};
|
|
659
|
+
NButton = __decorate([t("n-button")], NButton);
|
|
660
|
+
export { NButton };
|
package/package.json
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
"name": "@trenoxxious/n-components",
|
|
3
3
|
"description": "Customizable components for use with vanilla HTML, Javascript and CSS.",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.3",
|
|
6
6
|
"repository": "github:Trenoxxious/n-components",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"web-components",
|
|
9
9
|
"lit-element"
|
|
10
10
|
],
|
|
11
11
|
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
12
15
|
"exports": {
|
|
13
|
-
".": "./dist/
|
|
14
|
-
"./n-button": "./dist/components/n-button.js"
|
|
16
|
+
".": "./dist/n-components.js"
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
17
19
|
"dev": "vite",
|
|
@@ -28,4 +30,4 @@
|
|
|
28
30
|
"overrides": {
|
|
29
31
|
"vite": "npm:rolldown-vite@7.2.5"
|
|
30
32
|
}
|
|
31
|
-
}
|
|
33
|
+
}
|
package/index.html
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8" />
|
|
6
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<title>n-components</title>
|
|
9
|
-
<link rel="stylesheet" href="./src/index.css" />
|
|
10
|
-
<script type="module" src="/src/index.ts"></script>
|
|
11
|
-
</head>
|
|
12
|
-
|
|
13
|
-
<body>
|
|
14
|
-
<header>
|
|
15
|
-
<h1>
|
|
16
|
-
n-components
|
|
17
|
-
</h1>
|
|
18
|
-
<p>Light-weight web components for use with vanilla HTML, JS and CSS.</p>
|
|
19
|
-
</header>
|
|
20
|
-
<p class="sec">You want some buttons? We have some cool, customizable buttons.</p>
|
|
21
|
-
<div class="components-grid">
|
|
22
|
-
<div class="component-card">
|
|
23
|
-
<div class="component-header">
|
|
24
|
-
<h3>Base Buttons</h3>
|
|
25
|
-
<div class="code w-full"><<span class="html-red">n-button</span> <span class="html-orange">variant=</span><span class="html-green">"info"</span>><pre>More Info</pre></<span class="html-red">n-button</span>></div>
|
|
26
|
-
<n-button variant="info">More Info</n-button>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="button-grid">
|
|
29
|
-
<n-button variant="normal">Normal</n-button>
|
|
30
|
-
<n-button variant="info">Info</n-button>
|
|
31
|
-
<n-button variant="warning">Warning</n-button>
|
|
32
|
-
<n-button variant="alert">Alert</n-button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="component-card">
|
|
36
|
-
<div class="component-header">
|
|
37
|
-
<h3>Thin Buttons</h3>
|
|
38
|
-
<div class="code w-full"><<span class="html-red">n-button</span> <span class="html-orange">variant=</span><span class="html-green">"warning"</span> <span class="html-orange">thin</span>><pre>A warning!</pre></<span class="html-red">n-button</span>></div>
|
|
39
|
-
<n-button variant="warning" thin>A warning!</n-button>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="button-grid">
|
|
42
|
-
<n-button variant="normal" thin>Thin</n-button>
|
|
43
|
-
<n-button variant="info" thin>Thin</n-button>
|
|
44
|
-
<n-button variant="warning" thin>Thin</n-button>
|
|
45
|
-
<n-button variant="alert" thin>Thin</n-button>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
<div class="component-card">
|
|
49
|
-
<div class="component-header">
|
|
50
|
-
<h3>Thick Buttons</h3>
|
|
51
|
-
<div class="code w-full"><<span class="html-red">n-button</span> <span class="html-orange">thick</span>><pre>Play</pre></<span class="html-red">n-button</span>></div>
|
|
52
|
-
<n-button thick>Play</n-button>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="button-grid">
|
|
55
|
-
<n-button variant="normal" thick>Thick</n-button>
|
|
56
|
-
<n-button variant="info" thick>Thick</n-button>
|
|
57
|
-
<n-button variant="warning" thick>Thick</n-button>
|
|
58
|
-
<n-button variant="alert" thick>Thick</n-button>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
<div class="component-card">
|
|
62
|
-
<div class="component-header">
|
|
63
|
-
<h3>Outlined Buttons, w/ Dark Mode</h3>
|
|
64
|
-
<div class="code w-full"><<span class="html-red">n-button</span> <span class="html-orange">outlineOnly dark thin</span>><pre>Go!</pre></<span class="html-red">n-button</span>></div>
|
|
65
|
-
<n-button outlineOnly dark thin>Go!</n-button>
|
|
66
|
-
</div>
|
|
67
|
-
<div class="button-grid">
|
|
68
|
-
<n-button variant="normal" outlineOnly dark>Outlined</n-button>
|
|
69
|
-
<n-button variant="info" outlineOnly dark>Outlined</n-button>
|
|
70
|
-
<n-button variant="warning" outlineOnly dark>Outlined</n-button>
|
|
71
|
-
<n-button variant="alert" outlineOnly dark>Outlined</n-button>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
</body>
|
|
76
|
-
|
|
77
|
-
</html>
|
package/src/assets/lit.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="25.6" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 320"><path fill="#00E8FF" d="m64 192l25.926-44.727l38.233-19.114l63.974 63.974l10.833 61.754L192 320l-64-64l-38.074-25.615z"></path><path fill="#283198" d="M128 256V128l64-64v128l-64 64ZM0 256l64 64l9.202-60.602L64 192l-37.542 23.71L0 256Z"></path><path fill="#324FFF" d="M64 192V64l64-64v128l-64 64Zm128 128V192l64-64v128l-64 64ZM0 256V128l64 64l-64 64Z"></path><path fill="#0FF" d="M64 320V192l64 64z"></path></svg>
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from 'lit';
|
|
2
|
-
import { customElement } from 'lit/decorators.js';
|
|
3
|
-
|
|
4
|
-
@customElement('n-button')
|
|
5
|
-
export class NButton extends LitElement {
|
|
6
|
-
static properties = {
|
|
7
|
-
variant: { type: String },
|
|
8
|
-
animation: { type: String },
|
|
9
|
-
thin: { type: Boolean },
|
|
10
|
-
thick: { type: Boolean },
|
|
11
|
-
outlineOnly: { type: Boolean },
|
|
12
|
-
rounded: { type: Boolean },
|
|
13
|
-
sharp: { type: Boolean },
|
|
14
|
-
scaleHover: { type: Boolean },
|
|
15
|
-
dark: { type: Boolean },
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
variant: 'normal' | 'info' | 'warning' | 'alert' = 'normal';
|
|
19
|
-
thin = false;
|
|
20
|
-
thick = false;
|
|
21
|
-
outlineOnly = false;
|
|
22
|
-
scaleHover = false;
|
|
23
|
-
rounded = false;
|
|
24
|
-
sharp = false;
|
|
25
|
-
dark = false;
|
|
26
|
-
animation: 'fast' | 'normal' | 'slow' | 'extra-slow' = 'normal';
|
|
27
|
-
|
|
28
|
-
static styles = css`
|
|
29
|
-
button {
|
|
30
|
-
padding: 8px 16px;
|
|
31
|
-
border: none;
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
font-weight: 400;
|
|
35
|
-
border-radius: 2px;
|
|
36
|
-
transition: all;
|
|
37
|
-
animation-duration: 0.3s;
|
|
38
|
-
min-width: 100px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
button.info {
|
|
42
|
-
background-color: #007bff;
|
|
43
|
-
color: white;
|
|
44
|
-
border: 1px solid #2c92ffff;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
button.info:hover {
|
|
48
|
-
background-color: #268fffff;
|
|
49
|
-
border: 1px solid #4da3ffff;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
button.normal {
|
|
53
|
-
background-color: #e0e0e0;
|
|
54
|
-
color: #242424ff;
|
|
55
|
-
border: 1px solid #ddd;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
button.normal:hover {
|
|
59
|
-
background-color: #f5f5f5ff;
|
|
60
|
-
border: 1px solid #ffffffff;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
button.warning {
|
|
64
|
-
background-color: rgba(241, 132, 7, 1);
|
|
65
|
-
color: white;
|
|
66
|
-
border: 1px solid rgba(248, 142, 42, 1);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
button.warning:hover {
|
|
70
|
-
background-color: rgba(240, 162, 16, 1);
|
|
71
|
-
border: 1px solid rgba(255, 184, 53, 1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
button.alert {
|
|
75
|
-
background-color: rgba(233, 30, 23, 1);
|
|
76
|
-
color: white;
|
|
77
|
-
border: 1px solid rgba(248, 49, 42, 1);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
button.alert:hover {
|
|
81
|
-
background-color: rgba(248, 44, 44, 1);
|
|
82
|
-
border: 1px solid rgba(255, 76, 76, 1);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
button.thin {
|
|
86
|
-
padding: 4px 8px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
button.thick {
|
|
90
|
-
padding: 12px 24px;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
button.outline-only {
|
|
94
|
-
background-color: transparent !important;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
button.scale-hover:hover {
|
|
98
|
-
transform: scale(1.05);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.animation-fast {
|
|
102
|
-
transition: all 0.10s;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.animation-normal {
|
|
106
|
-
transition: all 0.25s;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.animation-slow {
|
|
110
|
-
transition: all 0.45s;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.animation-extra-slow {
|
|
114
|
-
transition: all 1s;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.rounded {
|
|
118
|
-
border-radius: 4px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.sharp {
|
|
122
|
-
border-radius: 0;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
@media screen and (width <= 1024px) {
|
|
126
|
-
button {
|
|
127
|
-
font-size: 12px;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
`;
|
|
131
|
-
|
|
132
|
-
render() {
|
|
133
|
-
const color = this.variant === 'normal' && this.dark ? 'white' : '';
|
|
134
|
-
return html`<button
|
|
135
|
-
class="${this.variant}${this.thin && !this.thick ? ' thin' : this.thick ? ' thick' : ''}${this.outlineOnly ? ' outline-only' : ''}${this.scaleHover ? ' scale-hover' : ''}${this.rounded && !this.sharp ? ' rounded' : this.sharp ? ' sharp' : ''} animation-${this.animation}"
|
|
136
|
-
style="${color ? `color: ${color}` : ''}">
|
|
137
|
-
<slot></slot>
|
|
138
|
-
</button>`;
|
|
139
|
-
}
|
|
140
|
-
}
|
package/src/index.css
DELETED
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
@import url('https://fonts.googleapis.com/css2?family=Cal+Sans&display=swap');
|
|
2
|
-
@import url('https://fonts.googleapis.com/css2?family=Manjari:wght@100;400;700&display=swap');
|
|
3
|
-
|
|
4
|
-
:root {
|
|
5
|
-
font-family: "Cal Sans", system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
6
|
-
line-height: 1.5;
|
|
7
|
-
font-weight: 300;
|
|
8
|
-
font-size: 16px;
|
|
9
|
-
color-scheme: light dark;
|
|
10
|
-
color: rgba(255, 255, 255, 0.87);
|
|
11
|
-
background: linear-gradient(to top, #182633, #242424);
|
|
12
|
-
font-synthesis: none;
|
|
13
|
-
text-rendering: optimizeLegibility;
|
|
14
|
-
-webkit-font-smoothing: antialiased;
|
|
15
|
-
-moz-osx-font-smoothing: grayscale;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
* {
|
|
19
|
-
margin: 0;
|
|
20
|
-
padding: 0;
|
|
21
|
-
text-align: center;
|
|
22
|
-
text-wrap: pretty;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
body {
|
|
26
|
-
margin: 0;
|
|
27
|
-
min-width: 320px;
|
|
28
|
-
min-height: 100vh;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
header {
|
|
32
|
-
position: relative;
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
background-clip: text;
|
|
38
|
-
margin-left: 5%;
|
|
39
|
-
margin-right: 5%;
|
|
40
|
-
margin-bottom: 50px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
header h1 {
|
|
44
|
-
position: relative;
|
|
45
|
-
background-clip: text;
|
|
46
|
-
background-image: linear-gradient(2deg, rgb(255, 255, 255) 40%, transparent 40.5%);
|
|
47
|
-
-webkit-background-clip: text;
|
|
48
|
-
color: transparent;
|
|
49
|
-
font-size: 9rem;
|
|
50
|
-
-webkit-text-stroke-color: rgb(255, 255, 255);
|
|
51
|
-
-webkit-text-stroke-width: 2px;
|
|
52
|
-
overflow: hidden;
|
|
53
|
-
text-wrap: nowrap;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
header p {
|
|
57
|
-
text-align: center;
|
|
58
|
-
text-wrap: pretty;
|
|
59
|
-
font-size: 1.8rem;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.sec {
|
|
63
|
-
margin-top: 15px;
|
|
64
|
-
margin-bottom: 15px;
|
|
65
|
-
font-size: 1.5rem;
|
|
66
|
-
font-family: "Manjari", sans-serif, system-ui;
|
|
67
|
-
font-weight: 400;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.components-grid {
|
|
71
|
-
font-family: "Manjari", sans-serif, system-ui;
|
|
72
|
-
display: grid;
|
|
73
|
-
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
|
74
|
-
gap: 24px;
|
|
75
|
-
max-width: 1200px;
|
|
76
|
-
margin: 0 auto;
|
|
77
|
-
padding: 0 20px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.component-card {
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 16px;
|
|
84
|
-
padding: 24px;
|
|
85
|
-
background: rgba(36, 36, 36, 0.6);
|
|
86
|
-
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
87
|
-
border-radius: 4px;
|
|
88
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
89
|
-
transition: border-color 0.2s ease;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
.component-header {
|
|
93
|
-
display: flex;
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
gap: 12px;
|
|
96
|
-
align-items: flex-start;
|
|
97
|
-
padding-bottom: 12px;
|
|
98
|
-
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.component-header h3 {
|
|
102
|
-
margin: 0;
|
|
103
|
-
font-size: 1.25rem;
|
|
104
|
-
font-weight: 500;
|
|
105
|
-
color: rgba(255, 255, 255, 0.95);
|
|
106
|
-
font-family: "Manjari", sans-serif, system-ui;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.button-grid {
|
|
110
|
-
display: grid;
|
|
111
|
-
grid-template-columns: repeat(2, 1fr);
|
|
112
|
-
gap: 12px;
|
|
113
|
-
padding: 16px;
|
|
114
|
-
background: rgba(24, 38, 51, 0.4);
|
|
115
|
-
border: 1px dashed rgba(255, 255, 255, 0.1);
|
|
116
|
-
border-radius: 4px;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.button-grid n-button {
|
|
120
|
-
padding: 8px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.code {
|
|
124
|
-
text-wrap: nowrap;
|
|
125
|
-
text-align: left;
|
|
126
|
-
overflow-x: auto;
|
|
127
|
-
display: inline;
|
|
128
|
-
justify-content: flex-start;
|
|
129
|
-
align-items: center;
|
|
130
|
-
padding: 5px 5px 0 5px;
|
|
131
|
-
background: rgba(255, 255, 255, 0.05);
|
|
132
|
-
border-radius: 4px;
|
|
133
|
-
font-size: 1rem;
|
|
134
|
-
height: 100px;
|
|
135
|
-
color: rgba(194, 194, 194, 1);
|
|
136
|
-
font-weight: 500;
|
|
137
|
-
border: 1px dotted rgba(255, 255, 255, 0.25);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
pre {
|
|
141
|
-
text-align: left;
|
|
142
|
-
margin-left: 25px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.code span {
|
|
146
|
-
text-wrap: nowrap;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.html-red {
|
|
150
|
-
color: rgba(255, 84, 84, 1);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.html-orange {
|
|
154
|
-
color: rgba(255, 158, 79, 1);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.html-green {
|
|
158
|
-
color: rgba(101, 255, 121, 1);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.w-full {
|
|
162
|
-
width: -webkit-fill-available;
|
|
163
|
-
width: -moz-available;
|
|
164
|
-
width: stretch;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
@media (prefers-color-scheme: light) {
|
|
168
|
-
:root {
|
|
169
|
-
color: #213547;
|
|
170
|
-
background-color: #ffffff;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
@media screen and (width < 1050px) {
|
|
175
|
-
header h1 {
|
|
176
|
-
font-size: 3rem;
|
|
177
|
-
-webkit-text-stroke-width: 1px;
|
|
178
|
-
background-image: linear-gradient(2deg, rgb(255, 255, 255) 39%, transparent 39.5%);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
header p {
|
|
182
|
-
font-size: 1rem;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.sec {
|
|
186
|
-
font-size: 1.25rem;
|
|
187
|
-
}
|
|
188
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { NButton } from './components/n-button.js';
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"experimentalDecorators": true,
|
|
5
|
-
"useDefineForClassFields": false,
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
|
-
"types": ["vite/client"],
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
|
|
11
|
-
/* Bundler mode */
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"moduleDetection": "force",
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"erasableSyntaxOnly": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"noUncheckedSideEffectImports": true
|
|
25
|
-
},
|
|
26
|
-
"include": ["src"]
|
|
27
|
-
}
|
|
File without changes
|