Skip to content

Commit 6264510

Browse files
Initial commit
Co-authored-by: Darren Rooney <darren@edgeworkscreative.com>
0 parents  commit 6264510

29 files changed

Lines changed: 553 additions & 0 deletions

‎.gitignore‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
dist/
2+
www/
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.lock
8+
*.tmp
9+
*.tmp.*
10+
log.txt
11+
*.sublime-project
12+
*.sublime-workspace
13+
14+
.stencil/
15+
.idea/
16+
.vscode/
17+
.sass-cache/
18+
.versions/
19+
node_modules/
20+
$RECYCLE.BIN/
21+
22+
.DS_Store
23+
Thumbs.db
24+
UserInterfaceState.xcuserstate
25+
.env

‎.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Interactive.Training
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# it-icon

‎package.json‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "@interactivetraining/icons",
3+
"version": "0.0.1",
4+
"description": "IT icon components ",
5+
"main": "dist/index.js",
6+
"types": "dist/types/components.d.ts",
7+
"collection": "dist/collection/collection-manifest.json",
8+
"module": "dist/index.mjs",
9+
"files": [
10+
"dist/"
11+
],
12+
"scripts": {
13+
"build": "stencil build --docs && npm run copy",
14+
"npmjs.publish": "npm publish --@interactivetraining:registry=https://registry.npmjs.org/ --access public",
15+
"start": "stencil build --dev --watch --serve",
16+
"copy": "ts-node -P ./scripts.tsconfig.json ./scripts/copy.ts"
17+
},
18+
"dependencies": {},
19+
"devDependencies": {
20+
"@stencil/core": "^1.3.2",
21+
"@stencil/sass": "^1.0.1",
22+
"@types/fs-extra": "^8.0.0",
23+
"@types/jest": "^24.0.18",
24+
"@types/puppeteer": "^1.19.1",
25+
"fs-extra": "^8.1.0",
26+
"ts-node": "^8.3.0",
27+
"workbox-build": "4.3.1"
28+
},
29+
"author": "Interactive Training (http://interactive.training)",
30+
"license": "MIT",
31+
"homepage": "https://github.com/InteractiveTraining/it-icon",
32+
"maintainers": [
33+
"Adam LaCombe (https://github.com/adamlacombe)",
34+
"Darren Rooney (https://github.com/ddevereauxx)"
35+
],
36+
"bugs": {
37+
"url": "https://github.com/InteractiveTraining/it-icon/issues"
38+
},
39+
"repository": {
40+
"type": "git",
41+
"url": "git://github.com/InteractiveTraining/it-icon.git"
42+
}
43+
}

‎scripts.tsconfig.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es6",
5+
"noImplicitAny": false,
6+
"sourceMap": true,
7+
"emitDecoratorMetadata": true,
8+
"experimentalDecorators": true
9+
},
10+
"include": [
11+
"scripts"
12+
],
13+
"exclude": [
14+
"**/node_modules/*"
15+
]
16+
}

‎scripts/copy.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// https://github.com/ionic-team/ionicons/blob/master/scripts/copy-tasks.js
2+
import * as fs from 'fs-extra';
3+
import * as path from 'path';
4+
5+
let optimizedSvgsDir = path.join(__dirname, '..', 'src', 'svg');
6+
let componentSvgsDir = path.join(__dirname, '..', 'dist', 'it-icon', 'svg');
7+
let collectionSvgsDir = path.join(__dirname, '..', 'dist', 'collection', 'icon', 'svg');
8+
9+
fs.emptyDirSync(componentSvgsDir);
10+
fs.emptyDirSync(collectionSvgsDir);
11+
12+
fs.copySync(optimizedSvgsDir, collectionSvgsDir);
13+
fs.copySync(optimizedSvgsDir, componentSvgsDir, {overwrite: true});

‎src/components/components.d.ts‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* tslint:disable */
2+
/**
3+
* This is an autogenerated file created by the Stencil compiler.
4+
* It contains typing information for all components that exist in this project.
5+
*/
6+
7+
8+
import { HTMLStencilElement, JSXBase } from '@stencil/core/internal';
9+
10+
11+
export namespace Components {
12+
interface ItIcon {
13+
'name'?: string;
14+
'size'?: 'small' | 'medium' | 'large';
15+
'src'?: string;
16+
}
17+
}
18+
19+
declare global {
20+
21+
22+
interface HTMLItIconElement extends Components.ItIcon, HTMLStencilElement {}
23+
var HTMLItIconElement: {
24+
prototype: HTMLItIconElement;
25+
new (): HTMLItIconElement;
26+
};
27+
interface HTMLElementTagNameMap {
28+
'it-icon': HTMLItIconElement;
29+
}
30+
}
31+
32+
declare namespace LocalJSX {
33+
interface ItIcon extends JSXBase.HTMLAttributes<HTMLItIconElement> {
34+
'name'?: string;
35+
'size'?: 'small' | 'medium' | 'large';
36+
'src'?: string;
37+
}
38+
39+
interface IntrinsicElements {
40+
'it-icon': ItIcon;
41+
}
42+
}
43+
44+
export { LocalJSX as JSX };
45+
46+
47+
declare module "@stencil/core" {
48+
export namespace JSX {
49+
interface IntrinsicElements extends LocalJSX.IntrinsicElements {}
50+
}
51+
}
52+
53+

‎src/components/global.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default () => {
2+
window.itIconRequests = new Map<string, Promise<string>>();
3+
};

‎src/components/icon/icon.scss‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:host {
2+
display: inline-block;
3+
width: 1em;
4+
height: 1em;
5+
contain: strict;
6+
fill: currentColor;
7+
box-sizing: content-box !important;
8+
}
9+
10+
.icon-inner, svg {
11+
display: block;
12+
height: 100%;
13+
width: 100%;
14+
}
15+
16+
:host(.icon-small) {
17+
font-size: 0.7em !important;
18+
}
19+
20+
:host(.icon-medium) {
21+
font-size: 1.2em !important;
22+
}
23+
24+
25+
:host(.icon-large) {
26+
font-size: 1.8em !important;
27+
}

0 commit comments

Comments
 (0)