@fuse_ui/icon 0.0.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,7 @@
1
+ # icon
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test icon` to execute the unit tests.
@@ -0,0 +1,43 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, inject, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { DomSanitizer } from '@angular/platform-browser';
4
+ import { FuseIconRegistryService } from '@fuse_ui/core';
5
+
6
+ const SIZE_MAP = {
7
+ xs: 12,
8
+ sm: 16,
9
+ md: 20,
10
+ lg: 24,
11
+ xl: 32,
12
+ };
13
+ class FuseIconComponent {
14
+ /** Name of the icon registered in FuseIconRegistryService. Required. */
15
+ name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
16
+ /** Size variant, maps to pixel dimensions. */
17
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
18
+ /** CSS colour value applied to the icon stroke/fill. Defaults to currentColor. */
19
+ color = input('currentColor', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
20
+ sanitizer = inject(DomSanitizer);
21
+ registry = inject(FuseIconRegistryService);
22
+ safeSvg = signal('', ...(ngDevMode ? [{ debugName: "safeSvg" }] : /* istanbul ignore next */ []));
23
+ sizeMap = SIZE_MAP;
24
+ constructor() {
25
+ effect(() => {
26
+ const raw = this.registry.getIcon(this.name());
27
+ this.safeSvg.set(raw ? this.sanitizer.bypassSecurityTrustHtml(raw) : '');
28
+ });
29
+ }
30
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
31
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.6", type: FuseIconComponent, isStandalone: true, selector: "fuse-icon", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<span\n [innerHTML]=\"safeSvg()\"\n [style.display]=\"'inline-flex'\"\n [style.color]=\"color()\"\n [style.width.px]=\"sizeMap[size()]\"\n [style.height.px]=\"sizeMap[size()]\"\n aria-hidden=\"true\">\n</span>\n", styles: [":host{--fuse-icon-color: currentColor;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}:host span{display:inline-flex;align-items:center;justify-content:center}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: FuseIconComponent, decorators: [{
34
+ type: Component,
35
+ args: [{ selector: 'fuse-icon', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n [innerHTML]=\"safeSvg()\"\n [style.display]=\"'inline-flex'\"\n [style.color]=\"color()\"\n [style.width.px]=\"sizeMap[size()]\"\n [style.height.px]=\"sizeMap[size()]\"\n aria-hidden=\"true\">\n</span>\n", styles: [":host{--fuse-icon-color: currentColor;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;line-height:0}:host span{display:inline-flex;align-items:center;justify-content:center}\n"] }]
36
+ }], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }] } });
37
+
38
+ /**
39
+ * Generated bundle index. Do not edit.
40
+ */
41
+
42
+ export { FuseIconComponent };
43
+ //# sourceMappingURL=fuse_ui-icon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuse_ui-icon.mjs","sources":["../../../../packages/icon/src/lib/icon/fuse-icon.component.ts","../../../../packages/icon/src/lib/icon/fuse-icon.component.html","../../../../packages/icon/src/fuse_ui-icon.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { FuseIconRegistryService } from '@fuse_ui/core';\n\nconst SIZE_MAP: Record<string, number> = {\n xs: 12,\n sm: 16,\n md: 20,\n lg: 24,\n xl: 32,\n};\n\n@Component({\n selector: 'fuse-icon',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './fuse-icon.component.html',\n styleUrl: './fuse-icon.component.scss',\n})\nexport class FuseIconComponent {\n /** Name of the icon registered in FuseIconRegistryService. Required. */\n readonly name = input.required<string>();\n\n /** Size variant, maps to pixel dimensions. */\n readonly size = input<'xs' | 'sm' | 'md' | 'lg' | 'xl'>('md');\n\n /** CSS colour value applied to the icon stroke/fill. Defaults to currentColor. */\n readonly color = input('currentColor');\n\n private readonly sanitizer = inject(DomSanitizer);\n private readonly registry = inject(FuseIconRegistryService);\n\n protected readonly safeSvg = signal<SafeHtml>('');\n\n readonly sizeMap = SIZE_MAP;\n\n constructor() {\n effect(() => {\n const raw = this.registry.getIcon(this.name());\n this.safeSvg.set(raw ? this.sanitizer.bypassSecurityTrustHtml(raw) : '');\n });\n }\n}\n","<span\n [innerHTML]=\"safeSvg()\"\n [style.display]=\"'inline-flex'\"\n [style.color]=\"color()\"\n [style.width.px]=\"sizeMap[size()]\"\n [style.height.px]=\"sizeMap[size()]\"\n aria-hidden=\"true\">\n</span>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,QAAQ,GAA2B;AACvC,IAAA,EAAE,EAAE,EAAE;AACN,IAAA,EAAE,EAAE,EAAE;AACN,IA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,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2NAAA,EAAA,MAAA,EAAA,CAAA,6MAAA,CAAA,EAAA;;;AEvBjD;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@fuse_ui/icon",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "keywords": [
9
+ "fuse-ui",
10
+ "angular",
11
+ "ionic",
12
+ "ionic8",
13
+ "angular18",
14
+ "angular19",
15
+ "angular20",
16
+ "angular21",
17
+ "ui-components",
18
+ "design-system",
19
+ "css-variables",
20
+ "signals",
21
+ "standalone",
22
+ "multi-theme",
23
+ "dark-mode",
24
+ "fluid-typography",
25
+ "animated"
26
+ ],
27
+ "peerDependencies": {
28
+ "@angular/core": ">=18.0.0",
29
+ "@angular/common": ">=18.0.0",
30
+ "rxjs": ">=7.4.0",
31
+ "@angular/platform-browser": "21.1.1",
32
+ "@fuse_ui/core": "0.0.1"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "@ionic/angular": {
36
+ "optional": true
37
+ }
38
+ },
39
+ "sideEffects": [
40
+ "*.css",
41
+ "**/*.scss"
42
+ ],
43
+ "engines": {
44
+ "node": ">=20.0.0"
45
+ },
46
+ "module": "fesm2022/fuse_ui-icon.mjs",
47
+ "typings": "types/fuse_ui-icon.d.ts",
48
+ "exports": {
49
+ "./package.json": {
50
+ "default": "./package.json"
51
+ },
52
+ ".": {
53
+ "types": "./types/fuse_ui-icon.d.ts",
54
+ "default": "./fesm2022/fuse_ui-icon.mjs"
55
+ }
56
+ },
57
+ "type": "module",
58
+ "dependencies": {
59
+ "tslib": "^2.3.0"
60
+ }
61
+ }
@@ -0,0 +1,20 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { SafeHtml } from '@angular/platform-browser';
3
+
4
+ declare class FuseIconComponent {
5
+ /** Name of the icon registered in FuseIconRegistryService. Required. */
6
+ readonly name: _angular_core.InputSignal<string>;
7
+ /** Size variant, maps to pixel dimensions. */
8
+ readonly size: _angular_core.InputSignal<"xs" | "sm" | "md" | "lg" | "xl">;
9
+ /** CSS colour value applied to the icon stroke/fill. Defaults to currentColor. */
10
+ readonly color: _angular_core.InputSignal<string>;
11
+ private readonly sanitizer;
12
+ private readonly registry;
13
+ protected readonly safeSvg: _angular_core.WritableSignal<SafeHtml>;
14
+ readonly sizeMap: Record<string, number>;
15
+ constructor();
16
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<FuseIconComponent, never>;
17
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<FuseIconComponent, "fuse-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
18
+ }
19
+
20
+ export { FuseIconComponent };