@triptease/tt-icon 1.2.4 → 1.3.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/dist/cjs/package.json +3 -0
- package/dist/cjs/src/TtIcon.js +98 -0
- package/dist/cjs/src/TtIcon.js.map +1 -0
- package/dist/cjs/src/index.js +21 -0
- package/dist/cjs/src/index.js.map +1 -0
- package/dist/cjs/src/tt-icon.js +11 -0
- package/dist/cjs/src/tt-icon.js.map +1 -0
- package/dist/cjs/src/types.js +3 -0
- package/dist/cjs/src/types.js.map +1 -0
- package/dist/esm/src/TtIcon.js.map +1 -0
- package/dist/esm/src/index.js.map +1 -0
- package/dist/esm/src/tt-icon.js.map +1 -0
- package/dist/esm/src/types.js.map +1 -0
- package/dist/esm/test/tt-icon.test.d.ts +1 -0
- package/dist/esm/test/tt-icon.test.js +73 -0
- package/dist/esm/test/tt-icon.test.js.map +1 -0
- package/package.json +13 -9
- package/dist/src/TtIcon.js.map +0 -1
- package/dist/src/index.js.map +0 -1
- package/dist/src/tt-icon.js.map +0 -1
- package/dist/src/types.js.map +0 -1
- /package/dist/{src → esm/src}/TtIcon.d.ts +0 -0
- /package/dist/{src → esm/src}/TtIcon.js +0 -0
- /package/dist/{src → esm/src}/index.d.ts +0 -0
- /package/dist/{src → esm/src}/index.js +0 -0
- /package/dist/{src → esm/src}/tt-icon.d.ts +0 -0
- /package/dist/{src → esm/src}/tt-icon.js +0 -0
- /package/dist/{src → esm/src}/types.d.ts +0 -0
- /package/dist/{src → esm/src}/types.js +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.TtIcon = void 0;
|
|
43
|
+
const lit_1 = require("lit");
|
|
44
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
45
|
+
const Icons = __importStar(require("@triptease/icons"));
|
|
46
|
+
const unsafe_svg_js_1 = require("lit/directives/unsafe-svg.js");
|
|
47
|
+
const style_map_js_1 = require("lit/directives/style-map.js");
|
|
48
|
+
const iconRegistry = Icons;
|
|
49
|
+
class TtIcon extends lit_1.LitElement {
|
|
50
|
+
constructor() {
|
|
51
|
+
super(...arguments);
|
|
52
|
+
this.size = 24;
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
if (!this.name) {
|
|
56
|
+
throw new Error('name attribute is required');
|
|
57
|
+
}
|
|
58
|
+
const svg = iconRegistry[this.name];
|
|
59
|
+
if (!svg) {
|
|
60
|
+
throw new Error(`Icon ${this.name} not found`);
|
|
61
|
+
}
|
|
62
|
+
const sizeInPx = `${this.size}px`;
|
|
63
|
+
return (0, lit_1.html) `<span
|
|
64
|
+
role=${this.label ? 'img' : 'presentation'}
|
|
65
|
+
aria-label="${this.label}"
|
|
66
|
+
style=${(0, style_map_js_1.styleMap)({
|
|
67
|
+
color: this.color,
|
|
68
|
+
width: sizeInPx,
|
|
69
|
+
height: sizeInPx,
|
|
70
|
+
display: 'inline-block',
|
|
71
|
+
lineHeight: 0,
|
|
72
|
+
verticalAlign: 'middle',
|
|
73
|
+
})}
|
|
74
|
+
>${(0, unsafe_svg_js_1.unsafeSVG)(svg)}</span
|
|
75
|
+
>`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.TtIcon = TtIcon;
|
|
79
|
+
TtIcon.styles = (0, lit_1.css) `
|
|
80
|
+
svg {
|
|
81
|
+
width: 100%;
|
|
82
|
+
height: 100%;
|
|
83
|
+
display: block;
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
__decorate([
|
|
87
|
+
(0, decorators_js_1.property)({ type: String })
|
|
88
|
+
], TtIcon.prototype, "name", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, decorators_js_1.property)({ type: String })
|
|
91
|
+
], TtIcon.prototype, "label", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, decorators_js_1.property)({ type: String })
|
|
94
|
+
], TtIcon.prototype, "color", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, decorators_js_1.property)({ type: Number })
|
|
97
|
+
], TtIcon.prototype, "size", void 0);
|
|
98
|
+
//# sourceMappingURL=TtIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtIcon.js","sourceRoot":"","sources":["../../../src/TtIcon.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA4C;AAC5C,qDAA6C;AAC7C,wDAA0C;AAC1C,gEAAyD;AACzD,8DAAuD;AAEvD,MAAM,YAAY,GAAG,KAA+B,CAAC;AAErD,MAAa,MAAO,SAAQ,gBAAU;IAAtC;;QAmBS,SAAI,GAAW,EAAE,CAAC;IA6B3B,CAAC;IA3BC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC;QAElC,OAAO,IAAA,UAAI,EAAA;aACF,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc;oBAC5B,IAAI,CAAC,KAAK;cAChB,IAAA,uBAAQ,EAAC;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,cAAc;YACvB,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,QAAQ;SACxB,CAAC;SACC,IAAA,yBAAS,EAAC,GAAG,CAAC;MACjB,CAAC;IACL,CAAC;;AA/CH,wBAgDC;AA/CQ,aAAM,GAAG,IAAA,SAAG,EAAA;;;;;;GAMlB,AANY,CAMX;AAGK;IADN,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACK;AAGzB;IADN,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACM;AAG1B;IADN,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACM;AAG1B;IADN,IAAA,wBAAQ,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCACF","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: number = 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"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TtIcon = void 0;
|
|
18
|
+
var tt_icon_js_1 = require("./tt-icon.js");
|
|
19
|
+
Object.defineProperty(exports, "TtIcon", { enumerable: true, get: function () { return tt_icon_js_1.TtIcon; } });
|
|
20
|
+
__exportStar(require("./types.js"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,6CAA2B","sourcesContent":["export { TtIcon } from './tt-icon.js';\nexport * from './types.js';\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TtIcon = void 0;
|
|
4
|
+
const TtIcon_js_1 = require("./TtIcon.js");
|
|
5
|
+
Object.defineProperty(exports, "TtIcon", { enumerable: true, get: function () { return TtIcon_js_1.TtIcon; } });
|
|
6
|
+
if (typeof window !== 'undefined') {
|
|
7
|
+
if (!window.customElements.get('tt-icon')) {
|
|
8
|
+
window.customElements.define('tt-icon', TtIcon_js_1.TtIcon);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=tt-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-icon.js","sourceRoot":"","sources":["../../../src/tt-icon.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAQ5B,uFARA,kBAAM,OAQA;AANf,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,kBAAM,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { TtIcon } from './TtIcon.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-icon')) {\n window.customElements.define('tt-icon', TtIcon);\n }\n}\n\nexport { TtIcon };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import IconManifest from '@triptease/icons/manifest.json' with { type: 'json' };\nimport { TtIcon } from './TtIcon.js';\n\ntype IconName = keyof typeof IconManifest;\n\ninterface TtIconExternalAttributes {\n id?: string;\n name: IconName;\n label?: string;\n color?: string;\n size?: number;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-icon': TtIcon;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & { style?: string };\n }\n }\n\n namespace React {\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & {\n ref?: React.Ref<unknown>;\n style?: React.CSSProperties;\n };\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TtIcon.js","sourceRoot":"","sources":["../../../src/TtIcon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,MAAM,YAAY,GAAG,KAA+B,CAAC;AAErD,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QAmBS,SAAI,GAAW,EAAE,CAAC;IA6B3B,CAAC;IA3BC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC;QAElC,OAAO,IAAI,CAAA;aACF,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc;oBAC5B,IAAI,CAAC,KAAK;cAChB,QAAQ,CAAC;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,cAAc;YACvB,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;oCACF","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: number = 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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,cAAc,YAAY,CAAC","sourcesContent":["export { TtIcon } from './tt-icon.js';\nexport * from './types.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tt-icon.js","sourceRoot":"","sources":["../../../src/tt-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import { TtIcon } from './TtIcon.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-icon')) {\n window.customElements.define('tt-icon', TtIcon);\n }\n}\n\nexport { TtIcon };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import IconManifest from '@triptease/icons/manifest.json' with { type: 'json' };\nimport { TtIcon } from './TtIcon.js';\n\ntype IconName = keyof typeof IconManifest;\n\ninterface TtIconExternalAttributes {\n id?: string;\n name: IconName;\n label?: string;\n color?: string;\n size?: number;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-icon': TtIcon;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & { style?: string };\n }\n }\n\n namespace React {\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & {\n ref?: React.Ref<unknown>;\n style?: React.CSSProperties;\n };\n }\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../src/tt-icon.js';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import '../src/tt-icon.js';
|
|
3
|
+
describe('TtIcon', () => {
|
|
4
|
+
it('should render with required properties', async () => {
|
|
5
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert icon"></tt-icon> `);
|
|
6
|
+
expect(element).to.exist;
|
|
7
|
+
expect(element.name).to.equal('alert');
|
|
8
|
+
expect(element.label).to.equal('Alert icon');
|
|
9
|
+
});
|
|
10
|
+
it('should render SVG content', async () => {
|
|
11
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert icon"></tt-icon> `);
|
|
12
|
+
const span = element.shadowRoot.querySelector('span[role="img"]');
|
|
13
|
+
const svg = span.querySelector('svg');
|
|
14
|
+
expect(span).to.exist;
|
|
15
|
+
expect(svg).to.exist;
|
|
16
|
+
});
|
|
17
|
+
it('should throw error when name is missing', async () => {
|
|
18
|
+
try {
|
|
19
|
+
await fixture(html ` <tt-icon label="Alert icon"></tt-icon> `);
|
|
20
|
+
expect.fail('Should have thrown an error');
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
expect(error.message).to.include('name attribute is required');
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
it('should default to presentation role', async () => {
|
|
27
|
+
const element = await fixture(html ` <tt-icon name="alert"></tt-icon> `);
|
|
28
|
+
const span = element.shadowRoot.querySelector('span[role="presentation"]');
|
|
29
|
+
expect(span).to.exist;
|
|
30
|
+
});
|
|
31
|
+
it('should have role img when label is provided', async () => {
|
|
32
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert"></tt-icon> `);
|
|
33
|
+
const span = element.shadowRoot.querySelector('span[role="img"]');
|
|
34
|
+
expect(span).to.exist;
|
|
35
|
+
});
|
|
36
|
+
it('should throw error for invalid icon name', async () => {
|
|
37
|
+
try {
|
|
38
|
+
await fixture(html ` <tt-icon name="nonexistent" label="Test"></tt-icon> `);
|
|
39
|
+
expect.fail('Should have thrown an error');
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
expect(error.message).to.include('Icon nonexistent not found');
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
it('should default to size 24', async () => {
|
|
46
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert icon"></tt-icon> `);
|
|
47
|
+
expect(element.size).to.equal(24);
|
|
48
|
+
const span = element.shadowRoot.querySelector('span[role="img"]');
|
|
49
|
+
expect(span.style.width).to.equal('24px');
|
|
50
|
+
expect(span.style.height).to.equal('24px');
|
|
51
|
+
});
|
|
52
|
+
it('should override hardcoded SVG dimensions with custom size', async () => {
|
|
53
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert icon" size="16"></tt-icon> `);
|
|
54
|
+
const svg = element.shadowRoot.querySelector('svg');
|
|
55
|
+
const computedStyle = window.getComputedStyle(svg);
|
|
56
|
+
// The SVG should be scaled to 16px despite having width="20" in markup
|
|
57
|
+
expect(computedStyle.width).to.equal('16px');
|
|
58
|
+
expect(computedStyle.height).to.equal('16px');
|
|
59
|
+
});
|
|
60
|
+
it('should apply color when provided', async () => {
|
|
61
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Alert icon" color="red"></tt-icon> `);
|
|
62
|
+
expect(element.color).to.equal('red');
|
|
63
|
+
const span = element.shadowRoot.querySelector('span[role="img"]');
|
|
64
|
+
expect(span.style.color).to.equal('red');
|
|
65
|
+
});
|
|
66
|
+
it('should have role="img" and aria-label', async () => {
|
|
67
|
+
const element = await fixture(html ` <tt-icon name="alert" label="Warning message"></tt-icon> `);
|
|
68
|
+
const span = element.shadowRoot.querySelector('span');
|
|
69
|
+
expect(span.getAttribute('role')).to.equal('img');
|
|
70
|
+
expect(span.getAttribute('aria-label')).to.equal('Warning message');
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73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CAAC;QAClF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAS,IAAI,CAAA,4DAA4D,CAAC,CAAC;QAExG,MAAM,IAAI,GAAG,OAAO,CAAC,UAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,CAAC,IAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,CAAC,IAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { expect, fixture, html } from '@open-wc/testing';\nimport { TtIcon } from '../src/TtIcon.js';\nimport '../src/tt-icon.js';\n\ndescribe('TtIcon', () => {\n it('should render with required properties', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert icon\"></tt-icon> `);\n\n expect(element).to.exist;\n expect(element.name).to.equal('alert');\n expect(element.label).to.equal('Alert icon');\n });\n\n it('should render SVG content', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert icon\"></tt-icon> `);\n\n const span = element.shadowRoot!.querySelector('span[role=\"img\"]');\n const svg = span!.querySelector('svg');\n\n expect(span).to.exist;\n expect(svg).to.exist;\n });\n\n it('should throw error when name is missing', async () => {\n try {\n await fixture<TtIcon>(html` <tt-icon label=\"Alert icon\"></tt-icon> `);\n expect.fail('Should have thrown an error');\n } catch (error) {\n expect((error as Error).message).to.include('name attribute is required');\n }\n });\n\n it('should default to presentation role', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\"></tt-icon> `);\n\n const span = element.shadowRoot!.querySelector('span[role=\"presentation\"]') as HTMLElement;\n\n expect(span).to.exist;\n });\n\n it('should have role img when label is provided', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert\"></tt-icon> `);\n\n const span = element.shadowRoot!.querySelector('span[role=\"img\"]') as HTMLElement;\n\n expect(span).to.exist;\n });\n\n it('should throw error for invalid icon name', async () => {\n try {\n await fixture<TtIcon>(html` <tt-icon name=\"nonexistent\" label=\"Test\"></tt-icon> `);\n expect.fail('Should have thrown an error');\n } catch (error) {\n expect((error as Error).message).to.include('Icon nonexistent not found');\n }\n });\n\n it('should default to size 24', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert icon\"></tt-icon> `);\n\n expect(element.size).to.equal(24);\n const span = element.shadowRoot!.querySelector('span[role=\"img\"]') as HTMLElement;\n expect(span.style.width).to.equal('24px');\n expect(span.style.height).to.equal('24px');\n });\n\n it('should override hardcoded SVG dimensions with custom size', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert icon\" size=\"16\"></tt-icon> `);\n\n const svg = element.shadowRoot!.querySelector('svg') as SVGElement;\n const computedStyle = window.getComputedStyle(svg);\n\n // The SVG should be scaled to 16px despite having width=\"20\" in markup\n expect(computedStyle.width).to.equal('16px');\n expect(computedStyle.height).to.equal('16px');\n });\n\n it('should apply color when provided', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Alert icon\" color=\"red\"></tt-icon> `);\n\n expect(element.color).to.equal('red');\n const span = element.shadowRoot!.querySelector('span[role=\"img\"]') as HTMLElement;\n expect(span.style.color).to.equal('red');\n });\n\n it('should have role=\"img\" and aria-label', async () => {\n const element = await fixture<TtIcon>(html` <tt-icon name=\"alert\" label=\"Warning message\"></tt-icon> `);\n\n const span = element.shadowRoot!.querySelector('span');\n expect(span!.getAttribute('role')).to.equal('img');\n expect(span!.getAttribute('aria-label')).to.equal('Warning message');\n });\n});\n"]}
|
package/package.json
CHANGED
|
@@ -3,32 +3,36 @@
|
|
|
3
3
|
"description": "Webcomponent tt-icon following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "@triptease",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.3.1",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "dist/src/index.js",
|
|
9
|
-
"module": "dist/src/index.js",
|
|
8
|
+
"main": "dist/esm/src/index.js",
|
|
9
|
+
"module": "dist/esm/src/index.js",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
12
|
+
"types": "./dist/esm/src/index.d.ts",
|
|
13
|
+
"import": "./dist/esm/src/index.js",
|
|
14
|
+
"require": "./dist/cjs/src/index.js"
|
|
14
15
|
}
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
|
-
"dist/
|
|
18
|
+
"dist/esm",
|
|
19
|
+
"dist/cjs"
|
|
18
20
|
],
|
|
19
21
|
"scripts": {
|
|
20
22
|
"analyze": "cem analyze --litelement",
|
|
21
23
|
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"web-dev-server\"",
|
|
22
24
|
"build": "yarn build:node && yarn build:web",
|
|
23
25
|
"build:web": "node ../../scripts/esbuild.mjs",
|
|
24
|
-
"build:
|
|
26
|
+
"build:esm": "tsc && npm run analyze -- --exclude dist",
|
|
27
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && node ../../scripts/create-cjs-package.mjs",
|
|
28
|
+
"build:node": "yarn build:esm && yarn build:cjs",
|
|
25
29
|
"build:node:watch": "tsc --watch",
|
|
26
|
-
"prepublish": "
|
|
30
|
+
"prepublish": "yarn build:node && npm run analyze -- --exclude dist",
|
|
27
31
|
"test": "tsc && wtr",
|
|
28
32
|
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
|
-
"@triptease/icons": "1.
|
|
35
|
+
"@triptease/icons": "1.4.0",
|
|
32
36
|
"lit": "^3.1.4"
|
|
33
37
|
},
|
|
34
38
|
"devDependencies": {
|
package/dist/src/TtIcon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TtIcon.js","sourceRoot":"","sources":["../../src/TtIcon.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,MAAM,YAAY,GAAG,KAA+B,CAAC;AAErD,MAAM,OAAO,MAAO,SAAQ,UAAU;IAAtC;;QAmBS,SAAI,GAAW,EAAE,CAAC;IA6B3B,CAAC;IA3BC,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAChD,CAAC;QAED,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,CAAC,IAAI,YAAY,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC;QAElC,OAAO,IAAI,CAAA;aACF,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc;oBAC5B,IAAI,CAAC,KAAK;cAChB,QAAQ,CAAC;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,cAAc;YACvB,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;oCACF","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: number = 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/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,cAAc,YAAY,CAAC","sourcesContent":["export { TtIcon } from './tt-icon.js';\nexport * from './types.js';\n"]}
|
package/dist/src/tt-icon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tt-icon.js","sourceRoot":"","sources":["../../src/tt-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import { TtIcon } from './TtIcon.js';\n\nif (typeof window !== 'undefined') {\n if (!window.customElements.get('tt-icon')) {\n window.customElements.define('tt-icon', TtIcon);\n }\n}\n\nexport { TtIcon };\n"]}
|
package/dist/src/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import IconManifest from '@triptease/icons/manifest.json' with { type: 'json' };\nimport { TtIcon } from './TtIcon.js';\n\ntype IconName = keyof typeof IconManifest;\n\ninterface TtIconExternalAttributes {\n id?: string;\n name: IconName;\n label?: string;\n color?: string;\n size?: number;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tt-icon': TtIcon;\n }\n\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & { style?: string };\n }\n }\n\n namespace React {\n namespace JSX {\n interface IntrinsicElements {\n 'tt-icon': TtIconExternalAttributes & {\n ref?: React.Ref<unknown>;\n style?: React.CSSProperties;\n };\n }\n }\n }\n}\n"]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|