@vialiq/web-components 0.0.1 → 0.0.2
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/base/vi-element.d.ts +9 -0
- package/base/vi-element.d.ts.map +1 -0
- package/button/vi-button.js +10 -9
- package/icons/vi-icon.js +44 -294
- package/index.js +1 -1
- package/package.json +4 -4
- package/vi-element-hVRGgsNW.js +6 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Shared base class for Vi web components.
|
|
4
|
+
* Keep this thin and framework-agnostic.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ViElement extends LitElement {
|
|
7
|
+
}
|
|
8
|
+
export type ViVariant = 'primary' | 'secondary' | 'danger';
|
|
9
|
+
//# sourceMappingURL=vi-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi-element.d.ts","sourceRoot":"","sources":["../../../../../../../libs/web-components/src/base/vi-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,UAAU;CAAG;AAE5C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC"}
|
package/button/vi-button.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { html as H, unsafeCSS as J, css as K } from "lit";
|
|
2
|
+
import { customElement as L, property as B } from "lit/decorators.js";
|
|
3
|
+
import { V as Q } from "../vi-element-hVRGgsNW.js";
|
|
3
4
|
const R = '@charset "UTF-8";@layer reset,components,utilities;:host{display:inline-block;--vi-button-surface-primary-background-color: var(--vi-color-primary, #0066cc);--vi-button-surface-primary-text-color: var(--vi-color-grey-100, #f3f4f6);--vi-button-surface-secondary-background-color: var(--vi-color-secondary, #f0f4f8);--vi-button-surface-secondary-text-color: var(--vi-color-foreground, #111827);--vi-button-surface-danger-background-color: var(--vi-color-error, #ef4444);--vi-button-surface-danger-text-color: var(--vi-color-grey-100, #f3f4f6);--vi-button-shape-border-radius: var(--vi-border-radius-md, 4px);--vi-button-spacing-padding-inline: var(--vi-spacing-md, 24px);--vi-button-spacing-padding-block: var(--vi-spacing-sm, 16px);--vi-button-typography-font-size: var(--vi-font-size-base, 16px);--vi-button-typography-font-weight: var(--vi-font-weight-semibold, 600);--vi-button-effect-transition-duration: .16s}:host([variant=primary]) .button{background-color:var(--vi-button-surface-primary-background-color, var(--vi-color-primary, #0066cc));color:var(--vi-button-surface-primary-text-color, var(--vi-color-grey-100, #f3f4f6))}:host([variant=secondary]) .button{background-color:var(--vi-button-surface-secondary-background-color, var(--vi-color-secondary, #f0f4f8));color:var(--vi-button-surface-secondary-text-color, var(--vi-color-foreground, #111827));border-color:var(--vi-color-border, #e5e7eb)}:host([variant=danger]) .button{background-color:var(--vi-button-surface-danger-background-color, var(--vi-color-error, #ef4444));color:var(--vi-button-surface-danger-text-color, var(--vi-color-grey-100, #f3f4f6))}:host([disabled]) .button,.button:disabled{opacity:.6;cursor:not-allowed}.button:hover:not(:disabled){opacity:.92}';
|
|
4
5
|
var X = Object.create, x = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, $ = (r, t) => (t = Symbol[r]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + r), f = (r) => {
|
|
5
6
|
throw TypeError(r);
|
|
@@ -7,18 +8,18 @@ var X = Object.create, x = Object.defineProperty, Y = Object.getOwnPropertyDescr
|
|
|
7
8
|
for (var a = 0, i = r[t >> 1], u = i && i.length; a < u; a++) t & 1 ? i[a].call(o) : s = i[a].call(o, s);
|
|
8
9
|
return s;
|
|
9
10
|
}, C = (r, t, o, s, a, i) => {
|
|
10
|
-
var u, c,
|
|
11
|
+
var u, c, E, b, y, e = t & 7, g = !!(t & 8), l = !!(t & 16), m = e > 3 ? r.length + 1 : e ? g ? 1 : 2 : 0, I = T[e + 5], V = e > 3 && (r[m - 1] = []), q = r[m] || (r[m] = []), v = e && (!l && !g && (a = a.prototype), e < 5 && (e > 3 || !l) && Y(e < 4 ? a : { get [o]() {
|
|
11
12
|
return M(this, i);
|
|
12
13
|
}, set [o](n) {
|
|
13
14
|
return W(this, i, n);
|
|
14
15
|
} }, o));
|
|
15
16
|
e ? l && e < 4 && F(i, (e > 2 ? "set " : e > 1 ? "get " : "") + o) : F(a, o);
|
|
16
|
-
for (var
|
|
17
|
-
b = j(e, o,
|
|
17
|
+
for (var k = s.length - 1; k >= 0; k--)
|
|
18
|
+
b = j(e, o, E = {}, r[3], q), e && (b.static = g, b.private = l, y = b.access = { has: l ? (n) => or(a, n) : (n) => o in n }, e ^ 3 && (y.get = l ? (n) => (e ^ 1 ? M : er)(n, a, e ^ 4 ? i : v.get) : (n) => n[o]), e > 2 && (y.set = l ? (n, S) => W(n, a, S, e ^ 4 ? i : v.set) : (n, S) => n[o] = S)), c = (0, s[k])(e ? e < 4 ? l ? i : v[I] : e > 4 ? void 0 : { get: v.get, set: v.set } : a, b), E._ = 1, e ^ 4 || c === void 0 ? _(c) && (e > 4 ? V.unshift(c) : e ? l ? i = c : v[I] = c : a = c) : typeof c != "object" || c === null ? f("Object expected") : (_(u = c.get) && (v.get = u), _(u = c.set) && (v.set = u), _(u = c.init) && V.unshift(u));
|
|
18
19
|
return e || rr(r, a), v && x(a, o, v), l ? e ^ 4 ? i : v : a;
|
|
19
20
|
}, tr = (r, t, o) => A(r, t + "", o), z = (r, t, o) => t.has(r) || f("Cannot " + o), or = (r, t) => Object(t) !== t ? f('Cannot use the "in" operator on this value') : r.has(t), M = (r, t, o) => (z(r, t, "read from private field"), o ? o.call(r) : t.get(r)), D = (r, t, o) => t.has(r) ? f("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, o), W = (r, t, o, s) => (z(r, t, "write to private field"), s ? s.call(r, o) : t.set(r, o), o), er = (r, t, o) => (z(r, t, "access private method"), o), G, N, w, U, d, O, P;
|
|
20
|
-
U = [
|
|
21
|
-
class p extends (w =
|
|
21
|
+
U = [L("vi-button")];
|
|
22
|
+
class p extends (w = Q, N = [B({ type: String, reflect: !0 })], G = [B({ type: Boolean, reflect: !0 })], w) {
|
|
22
23
|
constructor() {
|
|
23
24
|
super(...arguments), D(this, O, h(d, 8, this, "primary")), h(d, 11, this), D(this, P, h(d, 12, this, !1)), h(d, 15, this);
|
|
24
25
|
}
|
|
@@ -26,7 +27,7 @@ class p extends (w = L, N = [E({ type: String, reflect: !0 })], G = [E({ type: B
|
|
|
26
27
|
this.disabled && (t.preventDefault(), t.stopImmediatePropagation());
|
|
27
28
|
}
|
|
28
29
|
render() {
|
|
29
|
-
return
|
|
30
|
+
return H`
|
|
30
31
|
<button class="button" type="button" ?disabled=${this.disabled} @click=${this.onClick}>
|
|
31
32
|
<slot></slot>
|
|
32
33
|
</button>
|
|
@@ -39,7 +40,7 @@ P = /* @__PURE__ */ new WeakMap();
|
|
|
39
40
|
C(d, 4, "variant", N, p, O);
|
|
40
41
|
C(d, 4, "disabled", G, p, P);
|
|
41
42
|
p = C(d, 0, "ViButton", U, p);
|
|
42
|
-
tr(p, "styles",
|
|
43
|
+
tr(p, "styles", K`${J(R)}`);
|
|
43
44
|
h(d, 1, p);
|
|
44
45
|
export {
|
|
45
46
|
p as ViButton
|
package/icons/vi-icon.js
CHANGED
|
@@ -1,308 +1,58 @@
|
|
|
1
|
-
import { nothing as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return [At(i, r + (i[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), n];
|
|
25
|
-
};
|
|
26
|
-
class I {
|
|
27
|
-
constructor({ strings: t, _$litType$: e }, n) {
|
|
28
|
-
let s;
|
|
29
|
-
this.parts = [];
|
|
30
|
-
let r = 0, h = 0;
|
|
31
|
-
const l = t.length - 1, a = this.parts, [c, _] = Et(t, e);
|
|
32
|
-
if (this.el = I.createElement(c, n), H.currentNode = this.el.content, e === 2 || e === 3) {
|
|
33
|
-
const o = this.el.content.firstChild;
|
|
34
|
-
o.replaceWith(...o.childNodes);
|
|
35
|
-
}
|
|
36
|
-
for (; (s = H.nextNode()) !== null && a.length < l; ) {
|
|
37
|
-
if (s.nodeType === 1) {
|
|
38
|
-
if (s.hasAttributes()) for (const o of s.getAttributeNames()) if (o.endsWith(pt)) {
|
|
39
|
-
const u = _[h++], p = s.getAttribute(o).split(m), g = /([.?@])?(.*)/.exec(u);
|
|
40
|
-
a.push({ type: 1, index: r, name: g[2], strings: p, ctor: g[1] === "." ? Ot : g[1] === "?" ? Ut : g[1] === "@" ? Pt : W }), s.removeAttribute(o);
|
|
41
|
-
} else o.startsWith(m) && (a.push({ type: 6, index: r }), s.removeAttribute(o));
|
|
42
|
-
if (ut.test(s.tagName)) {
|
|
43
|
-
const o = s.textContent.split(m), u = o.length - 1;
|
|
44
|
-
if (u > 0) {
|
|
45
|
-
s.textContent = O ? O.emptyScript : "";
|
|
46
|
-
for (let p = 0; p < u; p++) s.append(o[p], U()), H.nextNode(), a.push({ type: 2, index: ++r });
|
|
47
|
-
s.append(o[u], U());
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} else if (s.nodeType === 8) if (s.data === $t) a.push({ type: 2, index: r });
|
|
51
|
-
else {
|
|
52
|
-
let o = -1;
|
|
53
|
-
for (; (o = s.data.indexOf(m, o + 1)) !== -1; ) a.push({ type: 7, index: r }), o += m.length - 1;
|
|
54
|
-
}
|
|
55
|
-
r++;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
static createElement(t, e) {
|
|
59
|
-
const n = N.createElement("template");
|
|
60
|
-
return n.innerHTML = t, n;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function w(i, t, e = i, n) {
|
|
64
|
-
if (t === b) return t;
|
|
65
|
-
let s = n !== void 0 ? e._$Co?.[n] : e._$Cl;
|
|
66
|
-
const r = S(t) ? void 0 : t._$litDirective$;
|
|
67
|
-
return s?.constructor !== r && (s?._$AO?.(!1), r === void 0 ? s = void 0 : (s = new r(i), s._$AT(i, e, n)), n !== void 0 ? (e._$Co ??= [])[n] = s : e._$Cl = s), s !== void 0 && (t = w(i, s._$AS(i, t.values), s, n)), t;
|
|
68
|
-
}
|
|
69
|
-
class kt {
|
|
70
|
-
constructor(t, e) {
|
|
71
|
-
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
72
|
-
}
|
|
73
|
-
get parentNode() {
|
|
74
|
-
return this._$AM.parentNode;
|
|
75
|
-
}
|
|
76
|
-
get _$AU() {
|
|
77
|
-
return this._$AM._$AU;
|
|
78
|
-
}
|
|
79
|
-
u(t) {
|
|
80
|
-
const { el: { content: e }, parts: n } = this._$AD, s = (t?.creationScope ?? N).importNode(e, !0);
|
|
81
|
-
H.currentNode = s;
|
|
82
|
-
let r = H.nextNode(), h = 0, l = 0, a = n[0];
|
|
83
|
-
for (; a !== void 0; ) {
|
|
84
|
-
if (h === a.index) {
|
|
85
|
-
let c;
|
|
86
|
-
a.type === 2 ? c = new P(r, r.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(r, a.name, a.strings, this, t) : a.type === 6 && (c = new Wt(r, this, t)), this._$AV.push(c), a = n[++l];
|
|
87
|
-
}
|
|
88
|
-
h !== a?.index && (r = H.nextNode(), h++);
|
|
89
|
-
}
|
|
90
|
-
return H.currentNode = N, s;
|
|
91
|
-
}
|
|
92
|
-
p(t) {
|
|
93
|
-
let e = 0;
|
|
94
|
-
for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(t, n, e), e += n.strings.length - 2) : n._$AI(t[e])), e++;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
class P {
|
|
98
|
-
get _$AU() {
|
|
99
|
-
return this._$AM?._$AU ?? this._$Cv;
|
|
100
|
-
}
|
|
101
|
-
constructor(t, e, n, s) {
|
|
102
|
-
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = n, this.options = s, this._$Cv = s?.isConnected ?? !0;
|
|
103
|
-
}
|
|
104
|
-
get parentNode() {
|
|
105
|
-
let t = this._$AA.parentNode;
|
|
106
|
-
const e = this._$AM;
|
|
107
|
-
return e !== void 0 && t?.nodeType === 11 && (t = e.parentNode), t;
|
|
108
|
-
}
|
|
109
|
-
get startNode() {
|
|
110
|
-
return this._$AA;
|
|
111
|
-
}
|
|
112
|
-
get endNode() {
|
|
113
|
-
return this._$AB;
|
|
114
|
-
}
|
|
115
|
-
_$AI(t, e = this) {
|
|
116
|
-
t = w(this, t, e), S(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== b && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : zt(t) ? this.k(t) : this._(t);
|
|
117
|
-
}
|
|
118
|
-
O(t) {
|
|
119
|
-
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
120
|
-
}
|
|
121
|
-
T(t) {
|
|
122
|
-
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
123
|
-
}
|
|
124
|
-
_(t) {
|
|
125
|
-
this._$AH !== d && S(this._$AH) ? this._$AA.nextSibling.data = t : this.T(N.createTextNode(t)), this._$AH = t;
|
|
126
|
-
}
|
|
127
|
-
$(t) {
|
|
128
|
-
const { values: e, _$litType$: n } = t, s = typeof n == "number" ? this._$AC(t) : (n.el === void 0 && (n.el = I.createElement(At(n.h, n.h[0]), this.options)), n);
|
|
129
|
-
if (this._$AH?._$AD === s) this._$AH.p(e);
|
|
130
|
-
else {
|
|
131
|
-
const r = new kt(s, this), h = r.u(this.options);
|
|
132
|
-
r.p(e), this.T(h), this._$AH = r;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
_$AC(t) {
|
|
136
|
-
let e = at.get(t.strings);
|
|
137
|
-
return e === void 0 && at.set(t.strings, e = new I(t)), e;
|
|
138
|
-
}
|
|
139
|
-
k(t) {
|
|
140
|
-
Z(this._$AH) || (this._$AH = [], this._$AR());
|
|
141
|
-
const e = this._$AH;
|
|
142
|
-
let n, s = 0;
|
|
143
|
-
for (const r of t) s === e.length ? e.push(n = new P(this.O(U()), this.O(U()), this, this.options)) : n = e[s], n._$AI(r), s++;
|
|
144
|
-
s < e.length && (this._$AR(n && n._$AB.nextSibling, s), e.length = s);
|
|
145
|
-
}
|
|
146
|
-
_$AR(t = this._$AA.nextSibling, e) {
|
|
147
|
-
for (this._$AP?.(!1, !0, e); t !== this._$AB; ) {
|
|
148
|
-
const n = it(t).nextSibling;
|
|
149
|
-
it(t).remove(), t = n;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
setConnected(t) {
|
|
153
|
-
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
class W {
|
|
157
|
-
get tagName() {
|
|
158
|
-
return this.element.tagName;
|
|
159
|
-
}
|
|
160
|
-
get _$AU() {
|
|
161
|
-
return this._$AM._$AU;
|
|
162
|
-
}
|
|
163
|
-
constructor(t, e, n, s, r) {
|
|
164
|
-
this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = s, this.options = r, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String()), this.strings = n) : this._$AH = d;
|
|
165
|
-
}
|
|
166
|
-
_$AI(t, e = this, n, s) {
|
|
167
|
-
const r = this.strings;
|
|
168
|
-
let h = !1;
|
|
169
|
-
if (r === void 0) t = w(this, t, e, 0), h = !S(t) || t !== this._$AH && t !== b, h && (this._$AH = t);
|
|
170
|
-
else {
|
|
171
|
-
const l = t;
|
|
172
|
-
let a, c;
|
|
173
|
-
for (t = r[0], a = 0; a < r.length - 1; a++) c = w(this, l[n + a], e, a), c === b && (c = this._$AH[a]), h ||= !S(c) || c !== this._$AH[a], c === d ? t = d : t !== d && (t += (c ?? "") + r[a + 1]), this._$AH[a] = c;
|
|
174
|
-
}
|
|
175
|
-
h && !s && this.j(t);
|
|
176
|
-
}
|
|
177
|
-
j(t) {
|
|
178
|
-
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
class Ot extends W {
|
|
182
|
-
constructor() {
|
|
183
|
-
super(...arguments), this.type = 3;
|
|
184
|
-
}
|
|
185
|
-
j(t) {
|
|
186
|
-
this.element[this.name] = t === d ? void 0 : t;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
class Ut extends W {
|
|
190
|
-
constructor() {
|
|
191
|
-
super(...arguments), this.type = 4;
|
|
192
|
-
}
|
|
193
|
-
j(t) {
|
|
194
|
-
this.element.toggleAttribute(this.name, !!t && t !== d);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
class Pt extends W {
|
|
198
|
-
constructor(t, e, n, s, r) {
|
|
199
|
-
super(t, e, n, s, r), this.type = 5;
|
|
200
|
-
}
|
|
201
|
-
_$AI(t, e = this) {
|
|
202
|
-
if ((t = w(this, t, e, 0) ?? d) === b) return;
|
|
203
|
-
const n = this._$AH, s = t === d && n !== d || t.capture !== n.capture || t.once !== n.once || t.passive !== n.passive, r = t !== d && (n === d || s);
|
|
204
|
-
s && this.element.removeEventListener(this.name, this, n), r && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
205
|
-
}
|
|
206
|
-
handleEvent(t) {
|
|
207
|
-
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
class Wt {
|
|
211
|
-
constructor(t, e, n) {
|
|
212
|
-
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = n;
|
|
213
|
-
}
|
|
214
|
-
get _$AU() {
|
|
215
|
-
return this._$AM._$AU;
|
|
216
|
-
}
|
|
217
|
-
_$AI(t) {
|
|
218
|
-
w(this, t);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
const Vt = F.litHtmlPolyfillSupport;
|
|
222
|
-
Vt?.(I, P), (F.litHtmlVersions ??= []).push("3.3.2");
|
|
223
|
-
const Dt = { CHILD: 2 }, Lt = (i) => (...t) => ({ _$litDirective$: i, values: t });
|
|
224
|
-
class Rt {
|
|
225
|
-
constructor(t) {
|
|
226
|
-
}
|
|
227
|
-
get _$AU() {
|
|
228
|
-
return this._$AM._$AU;
|
|
229
|
-
}
|
|
230
|
-
_$AT(t, e, n) {
|
|
231
|
-
this._$Ct = t, this._$AM = e, this._$Ci = n;
|
|
232
|
-
}
|
|
233
|
-
_$AS(t, e) {
|
|
234
|
-
return this.update(t, e);
|
|
235
|
-
}
|
|
236
|
-
update(t, e) {
|
|
237
|
-
return this.render(...e);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
class B extends Rt {
|
|
241
|
-
constructor(t) {
|
|
242
|
-
if (super(t), this.it = d, t.type !== Dt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
|
|
243
|
-
}
|
|
244
|
-
render(t) {
|
|
245
|
-
if (t === d || t == null) return this._t = void 0, this.it = t;
|
|
246
|
-
if (t === b) return t;
|
|
247
|
-
if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
|
|
248
|
-
if (t === this.it) return this._t;
|
|
249
|
-
this.it = t;
|
|
250
|
-
const e = [t];
|
|
251
|
-
return e.raw = e, this._t = { _$litType$: this.constructor.resultType, strings: e, values: [] };
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
B.directiveName = "unsafeHTML", B.resultType = 1;
|
|
255
|
-
const lt = Lt(B);
|
|
256
|
-
var Bt = Object.create, G = Object.defineProperty, jt = Object.getOwnPropertyDescriptor, vt = (i, t) => (t = Symbol[i]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + i), C = (i) => {
|
|
257
|
-
throw TypeError(i);
|
|
258
|
-
}, ft = (i, t, e) => t in i ? G(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, ct = (i, t) => G(i, "name", { value: t, configurable: !0 }), Ft = (i) => [, , , Bt(i?.[vt("metadata")] ?? null)], gt = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], T = (i) => i !== void 0 && typeof i != "function" ? C("Function expected") : i, Zt = (i, t, e, n, s) => ({ kind: gt[i], name: t, metadata: n, addInitializer: (r) => e._ ? C("Already initialized") : s.push(T(r || null)) }), Gt = (i, t) => ft(t, vt("metadata"), i[3]), f = (i, t, e, n) => {
|
|
259
|
-
for (var s = 0, r = i[t >> 1], h = r && r.length; s < h; s++) t & 1 ? r[s].call(e) : n = r[s].call(e, n);
|
|
260
|
-
return n;
|
|
261
|
-
}, z = (i, t, e, n, s, r) => {
|
|
262
|
-
var h, l, a, c, _, o = t & 7, u = !!(t & 8), p = !!(t & 16), g = o > 3 ? i.length + 1 : o ? u ? 1 : 2 : 0, Y = gt[o + 5], tt = o > 3 && (i[g - 1] = []), bt = i[g] || (i[g] = []), v = o && (!p && !u && (s = s.prototype), o < 5 && (o > 3 || !p) && jt(o < 4 ? s : { get [e]() {
|
|
263
|
-
return _t(this, r);
|
|
264
|
-
}, set [e](A) {
|
|
265
|
-
return dt(this, r, A);
|
|
266
|
-
} }, e));
|
|
267
|
-
o ? p && o < 4 && ct(r, (o > 2 ? "set " : o > 1 ? "get " : "") + e) : ct(s, e);
|
|
268
|
-
for (var V = n.length - 1; V >= 0; V--)
|
|
269
|
-
c = Zt(o, e, a = {}, i[3], bt), o && (c.static = u, c.private = p, _ = c.access = { has: p ? (A) => Jt(s, A) : (A) => e in A }, o ^ 3 && (_.get = p ? (A) => (o ^ 1 ? _t : Kt)(A, s, o ^ 4 ? r : v.get) : (A) => A[e]), o > 2 && (_.set = p ? (A, D) => dt(A, s, D, o ^ 4 ? r : v.set) : (A, D) => A[e] = D)), l = (0, n[V])(o ? o < 4 ? p ? r : v[Y] : o > 4 ? void 0 : { get: v.get, set: v.set } : s, c), a._ = 1, o ^ 4 || l === void 0 ? T(l) && (o > 4 ? tt.unshift(l) : o ? p ? r = l : v[Y] = l : s = l) : typeof l != "object" || l === null ? C("Object expected") : (T(h = l.get) && (v.get = h), T(h = l.set) && (v.set = h), T(h = l.init) && tt.unshift(h));
|
|
270
|
-
return o || Gt(i, s), v && G(s, e, v), p ? o ^ 4 ? r : v : s;
|
|
271
|
-
}, qt = (i, t, e) => ft(i, t + "", e), q = (i, t, e) => t.has(i) || C("Cannot " + e), Jt = (i, t) => Object(t) !== t ? C('Cannot use the "in" operator on this value') : i.has(t), _t = (i, t, e) => (q(i, t, "read from private field"), e ? e.call(i) : t.get(i)), E = (i, t, e) => t.has(i) ? C("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), dt = (i, t, e, n) => (q(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), Kt = (i, t, e) => (q(i, t, "access private method"), e), mt, yt, xt, Ht, j, Nt, $, J, K, Q, X;
|
|
272
|
-
Nt = [Tt("vi-icon")];
|
|
273
|
-
class y extends (j = Mt, Ht = [k({ type: String, reflect: !0 })], xt = [k({ type: Number })], yt = [k({ type: String })], mt = [St()], j) {
|
|
1
|
+
import { nothing as Y, html as b, css as Z } from "lit";
|
|
2
|
+
import { customElement as j, property as M, state as ee } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as D } from "lit/directives/unsafe-html.js";
|
|
4
|
+
import { V as te } from "../vi-element-hVRGgsNW.js";
|
|
5
|
+
import { getIcon as N } from "./registry.js";
|
|
6
|
+
var ie = Object.create, x = Object.defineProperty, re = Object.getOwnPropertyDescriptor, H = (e, t) => (t = Symbol[e]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + e), u = (e) => {
|
|
7
|
+
throw TypeError(e);
|
|
8
|
+
}, L = (e, t, i) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i, T = (e, t) => x(e, "name", { value: t, configurable: !0 }), se = (e) => [, , , ie(e?.[H("metadata")] ?? null)], q = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], m = (e) => e !== void 0 && typeof e != "function" ? u("Function expected") : e, ne = (e, t, i, _, s) => ({ kind: q[e], name: t, metadata: _, addInitializer: (n) => i._ ? u("Already initialized") : s.push(m(n || null)) }), ae = (e, t) => L(t, H("metadata"), e[3]), d = (e, t, i, _) => {
|
|
9
|
+
for (var s = 0, n = e[t >> 1], h = n && n.length; s < h; s++) t & 1 ? n[s].call(i) : _ = n[s].call(i, _);
|
|
10
|
+
return _;
|
|
11
|
+
}, y = (e, t, i, _, s, n) => {
|
|
12
|
+
var h, c, W, f, w, r = t & 7, g = !!(t & 8), p = !!(t & 16), k = r > 3 ? e.length + 1 : r ? g ? 1 : 2 : 0, F = q[r + 5], A = r > 3 && (e[k - 1] = []), X = e[k] || (e[k] = []), l = r && (!p && !g && (s = s.prototype), r < 5 && (r > 3 || !p) && re(r < 4 ? s : { get [i]() {
|
|
13
|
+
return U(this, n);
|
|
14
|
+
}, set [i](o) {
|
|
15
|
+
return G(this, n, o);
|
|
16
|
+
} }, i));
|
|
17
|
+
r ? p && r < 4 && T(n, (r > 2 ? "set " : r > 1 ? "get " : "") + i) : T(s, i);
|
|
18
|
+
for (var S = _.length - 1; S >= 0; S--)
|
|
19
|
+
f = ne(r, i, W = {}, e[3], X), r && (f.static = g, f.private = p, w = f.access = { has: p ? (o) => ce(s, o) : (o) => i in o }, r ^ 3 && (w.get = p ? (o) => (r ^ 1 ? U : _e)(o, s, r ^ 4 ? n : l.get) : (o) => o[i]), r > 2 && (w.set = p ? (o, I) => G(o, s, I, r ^ 4 ? n : l.set) : (o, I) => o[i] = I)), c = (0, _[S])(r ? r < 4 ? p ? n : l[F] : r > 4 ? void 0 : { get: l.get, set: l.set } : s, f), W._ = 1, r ^ 4 || c === void 0 ? m(c) && (r > 4 ? A.unshift(c) : r ? p ? n = c : l[F] = c : s = c) : typeof c != "object" || c === null ? u("Object expected") : (m(h = c.get) && (l.get = h), m(h = c.set) && (l.set = h), m(h = c.init) && A.unshift(h));
|
|
20
|
+
return r || ae(e, s), l && x(s, i, l), p ? r ^ 4 ? n : l : s;
|
|
21
|
+
}, oe = (e, t, i) => L(e, t + "", i), C = (e, t, i) => t.has(e) || u("Cannot " + i), ce = (e, t) => Object(t) !== t ? u('Cannot use the "in" operator on this value') : e.has(t), U = (e, t, i) => (C(e, t, "read from private field"), i ? i.call(e) : t.get(e)), z = (e, t, i) => t.has(e) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), G = (e, t, i, _) => (C(e, t, "write to private field"), _ ? _.call(e, i) : t.set(e, i), i), _e = (e, t, i) => (C(e, t, "access private method"), i), B, J, K, Q, O, R, a, $, E, P, V;
|
|
22
|
+
R = [j("vi-icon")];
|
|
23
|
+
class v extends (O = te, Q = [M({ type: String, reflect: !0 })], K = [M({ type: Number })], J = [M({ type: String })], B = [ee()], O) {
|
|
274
24
|
constructor() {
|
|
275
|
-
super(...arguments),
|
|
25
|
+
super(...arguments), z(this, $, d(a, 8, this, "")), d(a, 11, this), z(this, E, d(a, 12, this, 24)), d(a, 15, this), z(this, P, d(a, 16, this, "")), d(a, 19, this), z(this, V, d(a, 20, this)), d(a, 23, this);
|
|
276
26
|
}
|
|
277
27
|
updated(t) {
|
|
278
|
-
super.updated(t), t.has("name") && (this._icon =
|
|
28
|
+
super.updated(t), t.has("name") && (this._icon = N(this.name)), t.has("size") && this.style.setProperty("--vi-icon-size", `${this.size}px`);
|
|
279
29
|
}
|
|
280
30
|
firstUpdated(t) {
|
|
281
|
-
super.firstUpdated(t), this._icon =
|
|
31
|
+
super.firstUpdated(t), this._icon = N(this.name), this.style.setProperty("--vi-icon-size", `${this.size}px`);
|
|
282
32
|
}
|
|
283
33
|
render() {
|
|
284
|
-
return this._icon ? this.label ?
|
|
34
|
+
return this._icon ? this.label ? b`
|
|
285
35
|
<span role="img" aria-label=${this.label}>
|
|
286
|
-
${
|
|
36
|
+
${D(this._icon.data)}
|
|
287
37
|
</span>
|
|
288
|
-
` :
|
|
38
|
+
` : b`
|
|
289
39
|
<span aria-hidden="true">
|
|
290
|
-
${
|
|
40
|
+
${D(this._icon.data)}
|
|
291
41
|
</span>
|
|
292
|
-
` :
|
|
42
|
+
` : b`${Y}`;
|
|
293
43
|
}
|
|
294
44
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
45
|
+
a = se(O);
|
|
46
|
+
$ = /* @__PURE__ */ new WeakMap();
|
|
47
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
48
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
49
|
+
V = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
y(a, 4, "name", Q, v, $);
|
|
51
|
+
y(a, 4, "size", K, v, E);
|
|
52
|
+
y(a, 4, "label", J, v, P);
|
|
53
|
+
y(a, 4, "_icon", B, v, V);
|
|
54
|
+
v = y(a, 0, "ViIcon", R, v);
|
|
55
|
+
oe(v, "styles", Z`
|
|
306
56
|
:host {
|
|
307
57
|
display: inline-flex;
|
|
308
58
|
align-items: center;
|
|
@@ -321,7 +71,7 @@ qt(y, "styles", Ct`
|
|
|
321
71
|
stroke-linejoin: round;
|
|
322
72
|
}
|
|
323
73
|
`);
|
|
324
|
-
|
|
74
|
+
d(a, 1, v);
|
|
325
75
|
export {
|
|
326
|
-
|
|
76
|
+
v as ViIcon
|
|
327
77
|
};
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as e } from "./
|
|
1
|
+
import { V as e } from "./vi-element-hVRGgsNW.js";
|
|
2
2
|
import { ViButton as m } from "./button/vi-button.js";
|
|
3
3
|
import { ViIcon as f } from "./icons/vi-icon.js";
|
|
4
4
|
import { getIcon as p, registerIcons as x } from "./icons/registry.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vialiq/web-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"description": "Lit web component library built on @vi/flux-ui design tokens",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"flux-ui"
|
|
39
39
|
],
|
|
40
40
|
"files": [
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
41
|
+
"*.js",
|
|
42
|
+
"*.d.ts",
|
|
43
|
+
"base/",
|
|
44
44
|
"button/",
|
|
45
45
|
"icons/",
|
|
46
46
|
"README.md"
|