@triptease/tt-icon 1.1.14 → 1.1.16
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/dist/src/TtIcon.js +3 -7
- package/dist/src/TtIcon.js.map +1 -1
- package/package.json +2 -2
package/dist/src/TtIcon.js
CHANGED
|
@@ -5,12 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { html, LitElement, css } from 'lit';
|
|
8
|
-
import { property
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
9
|
import * as Icons from '@triptease/icons';
|
|
10
10
|
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
|
|
11
11
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
12
12
|
const iconRegistry = Icons;
|
|
13
|
-
|
|
13
|
+
export class TtIcon extends LitElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.size = 24;
|
|
@@ -38,7 +38,7 @@ let TtIcon = class TtIcon extends LitElement {
|
|
|
38
38
|
>${unsafeSVG(svg)}</span
|
|
39
39
|
>`;
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|
|
42
42
|
TtIcon.styles = css `
|
|
43
43
|
svg {
|
|
44
44
|
width: 100%;
|
|
@@ -58,8 +58,4 @@ __decorate([
|
|
|
58
58
|
__decorate([
|
|
59
59
|
property({ type: Number })
|
|
60
60
|
], TtIcon.prototype, "size", void 0);
|
|
61
|
-
TtIcon = __decorate([
|
|
62
|
-
customElement('tt-icon')
|
|
63
|
-
], TtIcon);
|
|
64
|
-
export { TtIcon };
|
|
65
61
|
//# sourceMappingURL=TtIcon.js.map
|
package/dist/src/TtIcon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtIcon.js","sourceRoot":"","sources":["../../src/TtIcon.ts"],"names":[],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B,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,QAAQ;SACxB,CAAC;SACC,SAAS,CAAC,GAAG,CAAC;MACjB,CAAC;IACL,CAAC;;AA9CM,aAAM,GAAG,GAAG,CAAA;;;;;;GAMlB,AANY,CAMX;AAGK;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACK;AAGzB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACM;AAG1B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACM;AAG1B;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACI","sourcesContent":["import { html, LitElement, css } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport * as Icons from '@triptease/icons';\nimport { unsafeSVG } from 'lit/directives/unsafe-svg.js';\nimport { styleMap } from 'lit/directives/style-map.js';\n\nconst iconRegistry = Icons as Record<string, string>;\n\nexport class TtIcon extends LitElement {\n static styles = css`\n svg {\n width: 100%;\n height: 100%;\n display: block;\n }\n `;\n\n @property({ type: String })\n public name: string | undefined;\n\n @property({ type: String })\n public label: string | undefined;\n\n @property({ type: String })\n public color: string | undefined;\n\n @property({ type: Number })\n public size: 16 | 24 | 32 = 24;\n\n render() {\n if (!this.name) {\n throw new Error('name attribute is required');\n }\n\n const svg = iconRegistry[this.name];\n\n if (!svg) {\n throw new Error(`Icon ${this.name} not found`);\n }\n\n const sizeInPx = `${this.size}px`;\n\n return html`<span\n role=${this.label ? 'img' : 'presentation'}\n aria-label=\"${this.label}\"\n style=${styleMap({\n color: this.color,\n width: sizeInPx,\n height: sizeInPx,\n display: 'inline-block',\n lineHeight: 0,\n verticalAlign: 'middle',\n })}\n >${unsafeSVG(svg)}</span\n >`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-icon': TtIcon;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent tt-icon following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "@triptease",
|
|
6
|
-
"version": "1.1.
|
|
6
|
+
"version": "1.1.16",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/src/index.js",
|
|
9
9
|
"module": "dist/src/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@triptease/icons": "1.3.
|
|
31
|
+
"@triptease/icons": "1.3.10",
|
|
32
32
|
"lit": "^3.1.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|