From 06f6b251d643266b9e5fd675b1ec1dec90159ce9 Mon Sep 17 00:00:00 2001 From: Mika Nevalainen Date: Thu, 19 Jan 2023 12:47:42 +0200 Subject: [PATCH] Add IconAngleUp component --- .../web-components/src/icons/IconAngleUp.svg | 9 ---- .../web-components/src/icons/IconAngleUp.ts | 45 +++++++++++++++++++ packages/web-components/src/icons/icon.scss | 4 ++ packages/web-components/src/icons/icons.css | 25 ----------- packages/web-components/src/icons/index.ts | 3 +- 5 files changed, 50 insertions(+), 36 deletions(-) delete mode 100644 packages/web-components/src/icons/IconAngleUp.svg create mode 100644 packages/web-components/src/icons/IconAngleUp.ts create mode 100644 packages/web-components/src/icons/icon.scss delete mode 100644 packages/web-components/src/icons/icons.css diff --git a/packages/web-components/src/icons/IconAngleUp.svg b/packages/web-components/src/icons/IconAngleUp.svg deleted file mode 100644 index b286372a0a..0000000000 --- a/packages/web-components/src/icons/IconAngleUp.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/packages/web-components/src/icons/IconAngleUp.ts b/packages/web-components/src/icons/IconAngleUp.ts new file mode 100644 index 0000000000..aa4d6e6cc7 --- /dev/null +++ b/packages/web-components/src/icons/IconAngleUp.ts @@ -0,0 +1,45 @@ +import { LitElement, css, html, PropertyValueMap, CSSResultGroup } from 'lit'; +// eslint-disable-next-line import/extensions +import { customElement } from 'lit/decorators.js'; + +import classNames from '../utils/className'; +import iconStyles from './icon.scss'; + +@customElement('hds-icon-angle-up') +export class IconAngleUp extends LitElement { + size: string; // SizeType = 'm'; + + static readonly styles = [ + css` + ${iconStyles as unknown as CSSResultGroup} + `, + ]; + + static get properties() { + return { + size: { type: String }, + }; + } + + render() { + return html` + + + + + + + `; + } +} + +declare global { + interface HTMLElementTagNameMap { + 'hds-icon-angle-up': IconAngleUp; + } +} diff --git a/packages/web-components/src/icons/icon.scss b/packages/web-components/src/icons/icon.scss new file mode 100644 index 0000000000..d4098aa654 --- /dev/null +++ b/packages/web-components/src/icons/icon.scss @@ -0,0 +1,4 @@ +.icon { + composes: hds-icon from 'hds-core/lib/icons/icon.css'; + background-color: transparent !important; +} diff --git a/packages/web-components/src/icons/icons.css b/packages/web-components/src/icons/icons.css deleted file mode 100644 index 2a874bc2d0..0000000000 --- a/packages/web-components/src/icons/icons.css +++ /dev/null @@ -1,25 +0,0 @@ - -.icon { - composes: hds-icon from 'hds-core/lib/icons/icon.css'; - background-color: transparent; -} - -.xs { - composes: hds-icon--size-xs from 'hds-core/lib/icons/icon.css'; -} - -.s { - composes: hds-icon--size-s from 'hds-core/lib/icons/icon.css'; -} - -.m { - composes: hds-icon--size-m from 'hds-core/lib/icons/icon.css'; -} - -.l { - composes: hds-icon--size-l from 'hds-core/lib/icons/icon.css'; -} - -.xl { - composes: hds-icon--size-xl from 'hds-core/lib/icons/icon.css'; -} diff --git a/packages/web-components/src/icons/index.ts b/packages/web-components/src/icons/index.ts index 7776ea735d..8129622fc4 100644 --- a/packages/web-components/src/icons/index.ts +++ b/packages/web-components/src/icons/index.ts @@ -1,3 +1,2 @@ -import * as x from './icons.css' +export { IconAngleUp } from './IconAngleUp' -export default x