diff --git a/package.json b/package.json index 8d6362924..8689013c4 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "lint": "npm-run-all --parallel lint:*", "test": "karma start --single-run", "bootstrap": "npm install && ./scripts/bootstrap.sh", - "build": "npm run build-styling && tsc -b packages/base packages/switch packages/ripple packages/button packages/fab", + "build": "npm run build-styling && tsc -b packages/base packages/switch packages/ripple packages/button packages/fab packages/icon", "build-styling": "./scripts/build-styling.sh", "update-gh-pages": "npm run bootstrap && ./scripts/publish-demos.sh" }, diff --git a/packages/icon/mwc-icon-css.js b/packages/icon/mwc-icon-css.js deleted file mode 100644 index 5eb04d650..000000000 --- a/packages/icon/mwc-icon-css.js +++ /dev/null @@ -1,19 +0,0 @@ -/** -@license -Copyright 2018 Google Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -import {html} from '@polymer/lit-element/lit-element.js'; - -export const style = html``; diff --git a/packages/icon/mwc-icon-host-css.js b/packages/icon/mwc-icon-host-css.js deleted file mode 100644 index 1af7b5638..000000000 --- a/packages/icon/mwc-icon-host-css.js +++ /dev/null @@ -1,20 +0,0 @@ -/** -@license -Copyright 2018 Google Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -import {html} from '@polymer/lit-element/lit-element.js'; - -export const style = html``; diff --git a/packages/icon/mwc-icon-font.js b/packages/icon/src/mwc-icon-font.ts similarity index 100% rename from packages/icon/mwc-icon-font.js rename to packages/icon/src/mwc-icon-font.ts diff --git a/packages/icon/mwc-icon-host.scss b/packages/icon/src/mwc-icon-host.scss similarity index 100% rename from packages/icon/mwc-icon-host.scss rename to packages/icon/src/mwc-icon-host.scss diff --git a/packages/icon/mwc-icon.scss b/packages/icon/src/mwc-icon.scss similarity index 100% rename from packages/icon/mwc-icon.scss rename to packages/icon/src/mwc-icon.scss diff --git a/packages/icon/mwc-icon.js b/packages/icon/src/mwc-icon.ts similarity index 75% rename from packages/icon/mwc-icon.js rename to packages/icon/src/mwc-icon.ts index 4bacd9f47..f8805afb5 100644 --- a/packages/icon/mwc-icon.js +++ b/packages/icon/src/mwc-icon.ts @@ -14,17 +14,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import {LitElement, html} from '@polymer/lit-element/lit-element.js'; -import {style} from './mwc-icon-host-css.js'; +import {LitElement, html, customElement} from '@polymer/lit-element/lit-element.js'; +import {style} from './mwc-icon-host-css'; import './mwc-icon-font.js'; +@customElement('mwc-icon' as any) export class Icon extends LitElement { + renderStyle() { return style; } + render() { return html`${this.renderStyle()}`; } + } -customElements.define('mwc-icon', Icon); +declare global { + interface HTMLElementTagNameMap { + 'mwc-icon': Icon; + } +} \ No newline at end of file diff --git a/packages/icon/tsconfig.json b/packages/icon/tsconfig.json new file mode 100644 index 000000000..3c8ee59d8 --- /dev/null +++ b/packages/icon/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "." + }, + "include": [ + "src/*.ts" + ] +} \ No newline at end of file