@vialiq/web-components 0.0.3 → 0.1.1

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/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # @vialiq/web-components
2
+
3
+ Buildable and publishable Lit web component library for the Vi design system.
4
+
5
+ ## Goals
6
+
7
+ - ESM-only output
8
+ - Per-component subpath exports (no forced all-in import)
9
+ - Self-styled components with CSS embedded in JS
10
+ - Themeable via Flux UI token fallbacks
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install @vialiq/web-components lit
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import '@vialiq/web-components/button';
22
+ ```
23
+
24
+ ```html
25
+ <vi-button variant="primary">Save</vi-button>
26
+ ```
27
+
28
+ ## Token strategy
29
+
30
+ Component styles use BEM + state CSS variable naming and Flux UI fallbacks.
31
+
32
+ Example:
33
+
34
+ ```css
35
+ background-color: var(--vi-button-surface-primary-background-color, var(--vi-color-primary, #0066cc));
36
+ ```
37
+
38
+ ## Development
39
+
40
+ ```bash
41
+ npx nx build web-components
42
+ npx nx run web-components:postbuild-publish
43
+ npx nx run web-components:storybook
44
+ npx nx run web-components:test-wdio
45
+ ```
46
+
47
+ ## Storybook
48
+
49
+ The project uses **Storybook 10** with the `@storybook/web-components-vite` framework.
50
+
51
+ - `esbuild` is replaced by `unplugin-swc` in `viteFinal` so TC39 standard decorators
52
+ (required by Lit v3) work inside Storybook. See `.storybook/main.ts`.
53
+ - **`autodocs`** in Storybook 10 is tag-driven, not configured globally. Add
54
+ `tags: ['autodocs']` to the `meta` export inside each story file to enable the
55
+ auto-generated docs page for that component:
56
+
57
+ ```ts
58
+ const meta: Meta = {
59
+ title: 'Components/Button',
60
+ tags: ['autodocs'],
61
+ // ...
62
+ };
63
+ ```
64
+
65
+ - The `docs: { autodocs: ... }` key was removed from `StorybookConfig` in Storybook 10.
66
+ Do **not** add it back to `.storybook/main.ts`.
package/package.json CHANGED
@@ -1,34 +1,42 @@
1
1
  {
2
2
  "name": "@vialiq/web-components",
3
- "version": "0.0.3",
3
+ "version": "0.1.1",
4
+ "private": false,
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/prasworld/Vialiq.git"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
4
12
  "type": "module",
5
13
  "sideEffects": true,
6
- "description": "Lit web component library built on @vi/flux-ui design tokens",
14
+ "description": "Lit web component library built on @vialiq/flux-ui design tokens",
7
15
  "license": "MIT",
8
16
  "module": "./index.js",
9
17
  "types": "./index.d.ts",
10
18
  "exports": {
11
19
  ".": {
12
- "import": "./index.js",
20
+ "default": "./index.js",
13
21
  "types": "./index.d.ts"
14
22
  },
15
23
  "./button": {
16
- "import": "./button/vi-button.js",
24
+ "default": "./button/vi-button.js",
17
25
  "types": "./button/vi-button.d.ts"
18
26
  },
19
27
  "./icons/vi-icon": {
20
- "import": "./icons/vi-icon.js",
28
+ "default": "./icons/vi-icon.js",
21
29
  "types": "./icons/vi-icon.d.ts"
22
30
  },
23
31
  "./icons/registry": {
24
- "import": "./icons/registry.js",
32
+ "default": "./icons/registry.js",
25
33
  "types": "./icons/registry.d.ts"
26
34
  }
27
35
  },
28
36
  "peerDependencies": {
29
37
  "lit": "^3.0.0",
30
- "@vialiq/flux-ui": "^0.0.1",
31
- "@vialiq/icons": "^0.0.1"
38
+ "@vialiq/flux-ui": "^0.0.4",
39
+ "@vialiq/icons": "^0.0.3"
32
40
  },
33
41
  "keywords": [
34
42
  "web-components",
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { ViButton } from './vi-button.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../libs/web-components/src/button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,33 +0,0 @@
1
- import { type TemplateResult } from 'lit';
2
- import { ViElement, type ViVariant } from '../base/vi-element.js';
3
- /**
4
- * vi-button
5
- * Self-styled button component using Flux UI token fallbacks.
6
- *
7
- * @element vi-button
8
- * @attr variant - Button variant: primary, secondary, danger
9
- * @attr disabled - Disabled state: prevents click events
10
- */
11
- export declare class ViButton extends ViElement {
12
- static styles: import("lit").CSSResult;
13
- /**
14
- * Button variant: primary, secondary, danger.
15
- * PUBLIC — users set this as <vi-button variant="primary">
16
- * @attr
17
- */
18
- accessor variant: ViVariant;
19
- /**
20
- * Disabled state: prevents click events/opacity.
21
- * PUBLIC — users set this as <vi-button disabled>
22
- * @attr
23
- */
24
- accessor disabled: boolean;
25
- private onClick;
26
- render(): TemplateResult;
27
- }
28
- declare global {
29
- interface HTMLElementTagNameMap {
30
- 'vi-button': ViButton;
31
- }
32
- }
33
- //# sourceMappingURL=vi-button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vi-button.d.ts","sourceRoot":"","sources":["../../../../../../../libs/web-components/src/button/vi-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlE;;;;;;;GAOG;AACH,qBACa,QAAS,SAAQ,SAAS;IACrC,OAAgB,MAAM,0BAAmC;IAEzD;;;;OAIG;IACwC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAa;IAEnF;;;;OAIG;IACyC,QAAQ,CAAC,QAAQ,UAAS;IAEtE,OAAO,CAAC,OAAO;IAON,MAAM,IAAI,cAAc;CAOlC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -1,47 +0,0 @@
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";
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}';
5
- var X = Object.create, x = Object.defineProperty, Y = Object.getOwnPropertyDescriptor, $ = (r, t) => (t = Symbol[r]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + r), f = (r) => {
6
- throw TypeError(r);
7
- }, A = (r, t, o) => t in r ? x(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o, F = (r, t) => x(r, "name", { value: t, configurable: !0 }), Z = (r) => [, , , X(r?.[$("metadata")] ?? null)], T = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], _ = (r) => r !== void 0 && typeof r != "function" ? f("Function expected") : r, j = (r, t, o, s, a) => ({ kind: T[r], name: t, metadata: s, addInitializer: (i) => o._ ? f("Already initialized") : a.push(_(i || null)) }), rr = (r, t) => A(t, $("metadata"), r[3]), h = (r, t, o, s) => {
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);
9
- return s;
10
- }, C = (r, t, o, s, a, i) => {
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]() {
12
- return M(this, i);
13
- }, set [o](n) {
14
- return W(this, i, n);
15
- } }, o));
16
- e ? l && e < 4 && F(i, (e > 2 ? "set " : e > 1 ? "get " : "") + o) : F(a, 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));
19
- return e || rr(r, a), v && x(a, o, v), l ? e ^ 4 ? i : v : a;
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;
21
- U = [L("vi-button")];
22
- class p extends (w = Q, N = [B({ type: String, reflect: !0 })], G = [B({ type: Boolean, reflect: !0 })], w) {
23
- constructor() {
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);
25
- }
26
- onClick(t) {
27
- this.disabled && (t.preventDefault(), t.stopImmediatePropagation());
28
- }
29
- render() {
30
- return H`
31
- <button class="button" type="button" ?disabled=${this.disabled} @click=${this.onClick}>
32
- <slot></slot>
33
- </button>
34
- `;
35
- }
36
- }
37
- d = Z(w);
38
- O = /* @__PURE__ */ new WeakMap();
39
- P = /* @__PURE__ */ new WeakMap();
40
- C(d, 4, "variant", N, p, O);
41
- C(d, 4, "disabled", G, p, P);
42
- p = C(d, 0, "ViButton", U, p);
43
- tr(p, "styles", K`${J(R)}`);
44
- h(d, 1, p);
45
- export {
46
- p as ViButton
47
- };
@@ -1,25 +0,0 @@
1
- /**
2
- * Icon Registry
3
- *
4
- * A Map-based store for SvgIconDef objects sourced from @vi/icons.
5
- * Icons must be explicitly registered before <vi-icon> can render them.
6
- * Only the icons you register end up in your bundle — full tree-shaking.
7
- *
8
- * Usage:
9
- * import { registerIcons } from '@vi/web-components';
10
- * import { checkIcon } from '@vi/icons/check';
11
- *
12
- * registerIcons([checkIcon]);
13
- * // <vi-icon name="check"></vi-icon>
14
- */
15
- import type { SvgIconDef } from '@vi/icons';
16
- export type { SvgIconDef };
17
- /**
18
- * Register one or more icons. Call this before using <vi-icon>.
19
- */
20
- export declare function registerIcons(icons: SvgIconDef | SvgIconDef[]): void;
21
- /**
22
- * Look up a registered icon by name.
23
- */
24
- export declare function getIcon(name: string): SvgIconDef | undefined;
25
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../../../libs/web-components/src/icons/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,YAAY,EAAE,UAAU,EAAE,CAAC;AAI3B;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,GAAG,IAAI,CAKpE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE5D"}
package/icons/registry.js DELETED
@@ -1,13 +0,0 @@
1
- const n = /* @__PURE__ */ new Map();
2
- function o(t) {
3
- const e = Array.isArray(t) ? t : [t];
4
- for (const r of e)
5
- n.set(r.name, r);
6
- }
7
- function s(t) {
8
- return n.get(t);
9
- }
10
- export {
11
- s as getIcon,
12
- o as registerIcons
13
- };
@@ -1,43 +0,0 @@
1
- import { type PropertyValues, type TemplateResult } from 'lit';
2
- import { ViElement } from '../base/vi-element.js';
3
- /**
4
- * vi-icon
5
- *
6
- * Renders a named SVG icon from the registry. Icons must be registered first
7
- * by importing their individual modules e.g.:
8
- * import '@vi/web-components/icons/check';
9
- *
10
- * @element vi-icon
11
- * @attr name - The icon name to render (must be registered)
12
- * @attr size - Width/height in px (default: 24)
13
- * @attr label - Accessible label; omit for decorative icons
14
- */
15
- export declare class ViIcon extends ViElement {
16
- static styles: import("lit").CSSResult;
17
- /**
18
- * The registered icon name to render.
19
- * @attr
20
- */
21
- accessor name: string;
22
- /**
23
- * Size in pixels applied as a CSS custom property.
24
- * @attr
25
- */
26
- accessor size: number;
27
- /**
28
- * Accessible label. When set the SVG gets role="img" + aria-label.
29
- * When omitted the icon is treated as decorative (aria-hidden).
30
- * @attr
31
- */
32
- accessor label: string;
33
- private accessor _icon;
34
- updated(changedProperties: PropertyValues): void;
35
- firstUpdated(changedProperties: PropertyValues): void;
36
- render(): TemplateResult;
37
- }
38
- declare global {
39
- interface HTMLElementTagNameMap {
40
- 'vi-icon': ViIcon;
41
- }
42
- }
43
- //# sourceMappingURL=vi-icon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vi-icon.d.ts","sourceRoot":"","sources":["../../../../../../../libs/web-components/src/icons/vi-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGnF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD;;;;;;;;;;;GAWG;AACH,qBACa,MAAO,SAAQ,SAAS;IACnC,OAAgB,MAAM,0BAkBpB;IAEF;;;OAGG;IACwC,QAAQ,CAAC,IAAI,SAAM;IAE9D;;;OAGG;IACyB,QAAQ,CAAC,IAAI,SAAM;IAE/C;;;;OAIG;IACyB,QAAQ,CAAC,KAAK,SAAM;IAEvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqC;IAE3D,OAAO,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAUhD,YAAY,CAAC,iBAAiB,EAAE,cAAc,GAAG,IAAI;IAMrD,MAAM,IAAI,cAAc;CAoBlC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
package/icons/vi-icon.js DELETED
@@ -1,77 +0,0 @@
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) {
24
- constructor() {
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);
26
- }
27
- updated(t) {
28
- super.updated(t), t.has("name") && (this._icon = N(this.name)), t.has("size") && this.style.setProperty("--vi-icon-size", `${this.size}px`);
29
- }
30
- firstUpdated(t) {
31
- super.firstUpdated(t), this._icon = N(this.name), this.style.setProperty("--vi-icon-size", `${this.size}px`);
32
- }
33
- render() {
34
- return this._icon ? this.label ? b`
35
- <span role="img" aria-label=${this.label}>
36
- ${D(this._icon.data)}
37
- </span>
38
- ` : b`
39
- <span aria-hidden="true">
40
- ${D(this._icon.data)}
41
- </span>
42
- ` : b`${Y}`;
43
- }
44
- }
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`
56
- :host {
57
- display: inline-flex;
58
- align-items: center;
59
- justify-content: center;
60
- width: var(--vi-icon-size, 24px);
61
- height: var(--vi-icon-size, 24px);
62
- }
63
-
64
- svg {
65
- width: 100%;
66
- height: 100%;
67
- fill: none;
68
- stroke: currentColor;
69
- stroke-width: 2;
70
- stroke-linecap: round;
71
- stroke-linejoin: round;
72
- }
73
- `);
74
- d(a, 1, v);
75
- export {
76
- v as ViIcon
77
- };
package/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- export { ViElement } from './base/vi-element.js';
2
- export type { ViVariant } from './base/vi-element.js';
3
- export { ViButton } from './button/vi-button.js';
4
- export { ViIcon } from './icons/vi-icon.js';
5
- export { registerIcons, getIcon } from './icons/registry.js';
6
- export type { SvgIconDef } from './icons/registry.js';
7
- //# sourceMappingURL=index.d.ts.map
package/index.js DELETED
@@ -1,11 +0,0 @@
1
- import { V as e } from "./vi-element-hVRGgsNW.js";
2
- import { ViButton as m } from "./button/vi-button.js";
3
- import { ViIcon as f } from "./icons/vi-icon.js";
4
- import { getIcon as p, registerIcons as x } from "./icons/registry.js";
5
- export {
6
- m as ViButton,
7
- e as ViElement,
8
- f as ViIcon,
9
- p as getIcon,
10
- x as registerIcons
11
- };
@@ -1,6 +0,0 @@
1
- import { LitElement as e } from "lit";
2
- class s extends e {
3
- }
4
- export {
5
- s as V
6
- };