@tociva/tailng-icons 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # @tociva/tailng-icons
2
+
3
+ Angular icon components and utilities for Tailng.
4
+
5
+ This package provides a lightweight, tree-shakable icon system built for
6
+ modern Angular applications. Icons are rendered using SVG and styled via
7
+ `currentColor`, making them fully compatible with Tailwind CSS.
8
+
9
+ ## Features
10
+ - Standalone Angular icon component
11
+ - Signal-based API
12
+ - Tree-shakable icon definitions
13
+ - `currentColor`-based SVG icons
14
+ - No CSS or styling opinions
15
+
16
+ ## Installation
17
+ ```bash
18
+ npm install @tociva/tailng-icons
@@ -0,0 +1,51 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, computed, Component } from '@angular/core';
3
+ import { NgIconComponent } from '@ng-icons/core';
4
+
5
+ class TailngIconComponent {
6
+ /** Icon name from @ng-icons registry */
7
+ name = input.required(...(ngDevMode ? [{ debugName: "name" }] : []));
8
+ /**
9
+ * Size:
10
+ * - number => px
11
+ * - string => passed as-is (e.g. '1em', '20px', '1.25rem')
12
+ */
13
+ size = input('1em', ...(ngDevMode ? [{ debugName: "size" }] : []));
14
+ /** Additional classes for host element */
15
+ klass = input('', ...(ngDevMode ? [{ debugName: "klass" }] : []));
16
+ /**
17
+ * Accessibility:
18
+ * - decorative=true => aria-hidden (default)
19
+ * - decorative=false => aria-label is recommended
20
+ */
21
+ decorative = input(true, { ...(ngDevMode ? { debugName: "decorative" } : {}), transform: booleanAttribute });
22
+ ariaLabel = input('', ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
23
+ normalizedSize = computed(() => {
24
+ const s = this.size();
25
+ return typeof s === 'number' ? `${s}px` : s;
26
+ }, ...(ngDevMode ? [{ debugName: "normalizedSize" }] : []));
27
+ classes = computed(() => {
28
+ const extra = this.klass().trim();
29
+ return ['inline-flex', 'align-middle', extra].filter(Boolean).join(' ');
30
+ }, ...(ngDevMode ? [{ debugName: "classes" }] : []));
31
+ ariaHidden = computed(() => (this.decorative() ? 'true' : null), ...(ngDevMode ? [{ debugName: "ariaHidden" }] : []));
32
+ computedAriaLabel = computed(() => {
33
+ if (this.decorative())
34
+ return null;
35
+ const label = this.ariaLabel().trim();
36
+ return label || null;
37
+ }, ...(ngDevMode ? [{ debugName: "computedAriaLabel" }] : []));
38
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TailngIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
39
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: TailngIconComponent, isStandalone: true, selector: "tng-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, klass: { classPropertyName: "klass", publicName: "klass", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-icon\n [name]=\"name()\"\n [size]=\"normalizedSize()\"\n [class]=\"classes()\"\n [attr.aria-hidden]=\"ariaHidden()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n></ng-icon>\n", dependencies: [{ kind: "component", type: NgIconComponent, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }] });
40
+ }
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: TailngIconComponent, decorators: [{
42
+ type: Component,
43
+ args: [{ selector: 'tng-icon', standalone: true, imports: [NgIconComponent], template: "<ng-icon\n [name]=\"name()\"\n [size]=\"normalizedSize()\"\n [class]=\"classes()\"\n [attr.aria-hidden]=\"ariaHidden()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n></ng-icon>\n" }]
44
+ }], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], klass: [{ type: i0.Input, args: [{ isSignal: true, alias: "klass", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }] } });
45
+
46
+ /**
47
+ * Generated bundle index. Do not edit.
48
+ */
49
+
50
+ export { TailngIconComponent };
51
+ //# sourceMappingURL=tociva-tailng-icons.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tociva-tailng-icons.mjs","sources":["../../../../libs/icons/src/icon/icon.component.ts","../../../../libs/icons/src/icon/icon.component.html","../../../../libs/icons/src/tociva-tailng-icons.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { NgIconComponent } from '@ng-icons/core';\nimport { booleanAttribute } from '@angular/core';\n\ntype TailngIconSize = number | string;\n\n@Component({\n selector: 'tng-icon',\n standalone: true,\n imports: [NgIconComponent],\n templateUrl: './icon.component.html',\n})\nexport class TailngIconComponent {\n /** Icon name from @ng-icons registry */\n name = input.required<string>();\n\n /**\n * Size:\n * - number => px\n * - string => passed as-is (e.g. '1em', '20px', '1.25rem')\n */\n size = input<TailngIconSize>('1em');\n\n /** Additional classes for host element */\n klass = input<string>('');\n\n /**\n * Accessibility:\n * - decorative=true => aria-hidden (default)\n * - decorative=false => aria-label is recommended\n */\n decorative = input(true, { transform: booleanAttribute });\n ariaLabel = input<string>('');\n\n readonly normalizedSize = computed(() => {\n const s = this.size();\n return typeof s === 'number' ? `${s}px` : s;\n });\n\n readonly classes = computed(() => {\n const extra = this.klass().trim();\n return ['inline-flex', 'align-middle', extra].filter(Boolean).join(' ');\n });\n\n readonly ariaHidden = computed(() => (this.decorative() ? 'true' : null));\n\n readonly computedAriaLabel = computed(() => {\n if (this.decorative()) return null;\n const label = this.ariaLabel().trim();\n return label || null;\n });\n}\n","<ng-icon\n [name]=\"name()\"\n [size]=\"normalizedSize()\"\n [class]=\"classes()\"\n [attr.aria-hidden]=\"ariaHidden()\"\n [attr.aria-label]=\"computedAriaLabel()\"\n></ng-icon>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAYa,mBAAmB,CAAA;;AAE9B,IAAA,IAAI,GAAG,KAAK,CAAC,QAAQ,+CAAU;AAE/B;;;;AAIG;AACH,IAAA,IAAI,GAAG,KAAK,CAAiB,KAAK,gDAAC;;AAGnC,IAAA,KAAK,GAAG,KAAK,CAAS,EAAE,iDAAC;AAEzB;;;;AAIG;IACH,UAAU,GAAG,KAAK,CAAC,IAAI,uDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AACzD,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,qDAAC;AAEpB,IAAA,cAAc,GAAG,QAAQ,CAAC,MAAK;AACtC,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE;AACrB,QAAA,OAAO,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAA,EAAG,CAAC,CAAA,EAAA,CAAI,GAAG,CAAC;AAC7C,IAAA,CAAC,0DAAC;AAEO,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE;AACjC,QAAA,OAAO,CAAC,aAAa,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzE,IAAA,CAAC,mDAAC;IAEO,UAAU,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,UAAU,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,YAAA,EAAA,CAAA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A,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDEY,eAAe,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,KAAA,EAAA,MAAA,EAAA,aAAA,EAAA,OAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAGd,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,UAAU,EAAA,UAAA,EACR,IAAI,EAAA,OAAA,EACP,CAAC,eAAe,CAAC,EAAA,QAAA,EAAA,0LAAA,EAAA;;;AET5B;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@tociva/tailng-icons",
3
+ "version": "0.1.0",
4
+ "description": "Angular icon components for Tailng",
5
+ "license": "MIT",
6
+ "sideEffects": false,
7
+ "peerDependencies": {
8
+ "@angular/core": "^21.0.0",
9
+ "@angular/common": "^21.0.0",
10
+ "@ng-icons/core": "^30.0.0"
11
+ },
12
+ "dependencies": {
13
+ "tslib": "^2.6.0"
14
+ },
15
+ "module": "fesm2022/tociva-tailng-icons.mjs",
16
+ "typings": "types/tociva-tailng-icons.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./types/tociva-tailng-icons.d.ts",
23
+ "default": "./fesm2022/tociva-tailng-icons.mjs"
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,30 @@
1
+ import * as _angular_core from '@angular/core';
2
+
3
+ type TailngIconSize = number | string;
4
+ declare class TailngIconComponent {
5
+ /** Icon name from @ng-icons registry */
6
+ name: _angular_core.InputSignal<string>;
7
+ /**
8
+ * Size:
9
+ * - number => px
10
+ * - string => passed as-is (e.g. '1em', '20px', '1.25rem')
11
+ */
12
+ size: _angular_core.InputSignal<TailngIconSize>;
13
+ /** Additional classes for host element */
14
+ klass: _angular_core.InputSignal<string>;
15
+ /**
16
+ * Accessibility:
17
+ * - decorative=true => aria-hidden (default)
18
+ * - decorative=false => aria-label is recommended
19
+ */
20
+ decorative: _angular_core.InputSignalWithTransform<boolean, unknown>;
21
+ ariaLabel: _angular_core.InputSignal<string>;
22
+ readonly normalizedSize: _angular_core.Signal<string>;
23
+ readonly classes: _angular_core.Signal<string>;
24
+ readonly ariaHidden: _angular_core.Signal<string>;
25
+ readonly computedAriaLabel: _angular_core.Signal<string>;
26
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<TailngIconComponent, never>;
27
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TailngIconComponent, "tng-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "klass": { "alias": "klass"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
28
+ }
29
+
30
+ export { TailngIconComponent };