@joralvmel/cosmos-angular 0.0.0 → 0.2.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.
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CosmIcon, CosmIconSize } from '@joralvmel/cosmos-elements/icon';
|
|
2
|
+
import type { IconDefinition } from '@joralvmel/cosmos-icons';
|
|
3
|
+
import '@joralvmel/cosmos-elements/icon';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Angular proxy of `<cosm-icon>`.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <cosm-icon [icon]="house" size="md" [decorative]="false" label="Home" />
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmIconComponent {
|
|
13
|
+
readonly element: CosmIcon;
|
|
14
|
+
set icon(value: IconDefinition);
|
|
15
|
+
set size(value: CosmIconSize);
|
|
16
|
+
set stroke(value: string);
|
|
17
|
+
set fill(value: string);
|
|
18
|
+
set strokeWidth(value: number);
|
|
19
|
+
set label(value: string | undefined);
|
|
20
|
+
set decorative(value: boolean);
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CosmIconComponent, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CosmIconComponent, "cosm-icon", never, { "icon": { "alias": "icon"; "required": true; }; "size": { "alias": "size"; "required": false; }; "stroke": { "alias": "stroke"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; }; "label": { "alias": "label"; "required": false; }; "decorative": { "alias": "decorative"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
23
|
+
static ngAcceptInputType_decorative: unknown;
|
|
24
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, Input, inject, } from '@angular/core';
|
|
2
|
+
import '@joralvmel/cosmos-elements/icon';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Angular proxy of `<cosm-icon>`.
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <cosm-icon [icon]="house" size="md" [decorative]="false" label="Home" />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export class CosmIconComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.element = inject(ElementRef).nativeElement;
|
|
14
|
+
}
|
|
15
|
+
set icon(value) {
|
|
16
|
+
this.element.icon = value;
|
|
17
|
+
}
|
|
18
|
+
set size(value) {
|
|
19
|
+
this.element.size = value;
|
|
20
|
+
}
|
|
21
|
+
set stroke(value) {
|
|
22
|
+
this.element.stroke = value;
|
|
23
|
+
}
|
|
24
|
+
set fill(value) {
|
|
25
|
+
this.element.fill = value;
|
|
26
|
+
}
|
|
27
|
+
set strokeWidth(value) {
|
|
28
|
+
this.element.strokeWidth = value;
|
|
29
|
+
}
|
|
30
|
+
set label(value) {
|
|
31
|
+
this.element.label = value;
|
|
32
|
+
}
|
|
33
|
+
set decorative(value) {
|
|
34
|
+
this.element.decorative = value;
|
|
35
|
+
}
|
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.5", ngImport: i0, type: CosmIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
37
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "22.2.5", type: CosmIconComponent, isStandalone: true, selector: "cosm-icon", inputs: { icon: "icon", size: "size", stroke: "stroke", fill: "fill", strokeWidth: "strokeWidth", label: "label", decorative: ["decorative", "decorative", booleanAttribute] }, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.5", ngImport: i0, type: CosmIconComponent, decorators: [{
|
|
40
|
+
type: Component,
|
|
41
|
+
args: [{
|
|
42
|
+
selector: 'cosm-icon',
|
|
43
|
+
template: '<ng-content />',
|
|
44
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
45
|
+
}]
|
|
46
|
+
}], propDecorators: { icon: [{
|
|
47
|
+
type: Input,
|
|
48
|
+
args: [{ required: true }]
|
|
49
|
+
}], size: [{
|
|
50
|
+
type: Input
|
|
51
|
+
}], stroke: [{
|
|
52
|
+
type: Input
|
|
53
|
+
}], fill: [{
|
|
54
|
+
type: Input
|
|
55
|
+
}], strokeWidth: [{
|
|
56
|
+
type: Input
|
|
57
|
+
}], label: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], decorative: [{
|
|
60
|
+
type: Input,
|
|
61
|
+
args: [{ transform: booleanAttribute }]
|
|
62
|
+
}] } });
|
|
63
|
+
//# sourceMappingURL=icon.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.component.js","sourceRoot":"","sources":["../../src/components/icon.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AAGvB,OAAO,iCAAiC,CAAC;;AAEzC;;;;;;GAMG;AAMH,MAAM,OAAO,iBAAiB;IAL9B;QAMW,YAAO,GAAa,MAAM,CAAuB,UAAU,CAAC,CAAC,aAAa,CAAC;KA6BrF;IA3BC,IAA+B,IAAI,CAAC,KAAqB;QACvD,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,IAAI,CAAC,KAAmB;QACnC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,MAAM,CAAC,KAAa;QAC/B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,IAAa,IAAI,CAAC,KAAa;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAAa,WAAW,CAAC,KAAa;QACpC,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;IACnC,CAAC;IAED,IAAa,KAAK,CAAC,KAAyB;QAC1C,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,IAA4C,UAAU,CAAC,KAAc;QACnE,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,KAAK,CAAC;IAClC,CAAC;8GA7BU,iBAAiB;kGAAjB,iBAAiB,wMA2BR,gBAAgB,6BA9B1B,gBAAgB;;2FAGf,iBAAiB;kBAL7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,gBAAgB;oBAC1B,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;sBAIE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAIxB,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;;sBAIL,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { ButtonPressDetail, PressSource } from '@joralvmel/cosmos-core';
|
|
2
2
|
export { CosmButtonComponent } from './components/button.component.js';
|
|
3
|
+
export { CosmIconComponent } from './components/icon.component.js';
|
|
3
4
|
import { CosmButtonComponent } from './components/button.component.js';
|
|
5
|
+
import { CosmIconComponent } from './components/icon.component.js';
|
|
4
6
|
/** Every Cosmos Angular component, for `imports: [...COSMOS_COMPONENTS]`. */
|
|
5
|
-
export declare const COSMOS_COMPONENTS: readonly [typeof CosmButtonComponent];
|
|
7
|
+
export declare const COSMOS_COMPONENTS: readonly [typeof CosmButtonComponent, typeof CosmIconComponent];
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { CosmButtonComponent } from './components/button.component.js';
|
|
2
|
+
export { CosmIconComponent } from './components/icon.component.js';
|
|
2
3
|
import { CosmButtonComponent } from './components/button.component.js';
|
|
4
|
+
import { CosmIconComponent } from './components/icon.component.js';
|
|
3
5
|
/** Every Cosmos Angular component, for `imports: [...COSMOS_COMPONENTS]`. */
|
|
4
|
-
export const COSMOS_COMPONENTS = [CosmButtonComponent];
|
|
6
|
+
export const COSMOS_COMPONENTS = [CosmButtonComponent, CosmIconComponent];
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,CAAU,CAAC"}
|
package/llms.md
CHANGED
|
@@ -80,6 +80,36 @@ export class ExampleComponent {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
|
+
### `CosmIconComponent` (`<cosm-icon>`)
|
|
84
|
+
|
|
85
|
+
Renders a structured SVG icon. Decorative icons are hidden from assistive technology; informative icons require a text label.
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default | Description |
|
|
88
|
+
| --- | --- | --- | --- |
|
|
89
|
+
| `icon` | IconDefinition | Required | Structured icon definition, commonly imported from @joralvmel/cosmos-icons. |
|
|
90
|
+
| `size` | 'sm' \| 'md' \| 'lg' \| number | `md` | Semantic size (16, 20 or 24) or a positive finite number in pixels / native units. |
|
|
91
|
+
| `stroke` | string | `currentColor` | Stroke paint; currentColor inherits on web and resolves to the theme foreground on native. |
|
|
92
|
+
| `fill` | string | `none` | Root fill paint. Explicit node fills take precedence. |
|
|
93
|
+
| `strokeWidth` | number | `2` | Finite nonnegative stroke width in SVG viewBox units. |
|
|
94
|
+
| `label` | string | — | Accessible name required when decorative is false. |
|
|
95
|
+
| `decorative` | boolean | `true` | Hides the icon from assistive technology when true. |
|
|
96
|
+
|
|
97
|
+
Events: none.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { Component } from '@angular/core';
|
|
101
|
+
import { CosmIconComponent } from '@joralvmel/cosmos-angular';
|
|
102
|
+
import { house } from '@joralvmel/cosmos-icons/house';
|
|
103
|
+
|
|
104
|
+
@Component({
|
|
105
|
+
selector: 'app-example',
|
|
106
|
+
imports: [CosmIconComponent],
|
|
107
|
+
template: `<cosm-icon [icon]="house"></cosm-icon>`,
|
|
108
|
+
})
|
|
109
|
+
export class ExampleComponent {
|
|
110
|
+
readonly house = house;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
83
113
|
|
|
84
114
|
## Themes
|
|
85
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joralvmel/cosmos-angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Angular standalone components and forms integration for the Cosmos UI Web Components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@joralvmel/cosmos-core": "^0.
|
|
46
|
-
"@joralvmel/cosmos-elements": "^0.
|
|
45
|
+
"@joralvmel/cosmos-core": "^0.2.0",
|
|
46
|
+
"@joralvmel/cosmos-elements": "^0.2.0",
|
|
47
|
+
"@joralvmel/cosmos-icons": "^0.2.0",
|
|
47
48
|
"tslib": "^2.9.1"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|