-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui-library): removed icon-link (#997)
* fix(ui-libary): removed icon-link * fix(ui-library): removed icon-link from documentation --------- Co-authored-by: Christian Hoffmann <112889877+ChristianHoffmannS2@users.noreply.github.com>
- Loading branch information
1 parent
12893f9
commit c3ab5f0
Showing
10 changed files
with
1 addition
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
packages/ui-library/src/components/icon-link/index.stories.ts
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
packages/ui-library/src/components/icon-link/index.test.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +0,0 @@ | ||
import { LitElement, html, nothing } from 'lit'; | ||
import { classMap } from 'lit/directives/class-map.js'; | ||
import { property } from 'lit/decorators.js'; | ||
import { SizelessIconType } from '@boiler/icons'; | ||
import { styleCustom as iconLinkStyleCustom } from './index.css'; | ||
import { styleCustom as iconButtonStyleCustom } from '../icon-button/index.css'; | ||
import { ThemeType } from '../../foundation/_tokens-generated/index.themes'; | ||
import { actionLight, actionDark } from '../../foundation/semantic-tokens/action.css'; | ||
import { ActionVariantType, ActionSizesType, FormSizesType, SizesType } from '../../globals/types'; | ||
import { calculateIconName } from '../../utils/calculate-icon-name'; | ||
import { determineLoaderVariant } from '../../utils/determine-loader-variant'; | ||
import { getComponentConfigToken } from '../../utils/get-component-config-token'; | ||
import { BlrIconRenderFunction } from '../icon/renderFunction'; | ||
import { BlrLoaderRenderFunction } from '../loader/renderFunction'; | ||
import { TAG_NAME } from './renderFunction'; | ||
|
||
// | ||
export class BlrIconLink extends LitElement { | ||
static styles = [iconLinkStyleCustom, iconButtonStyleCustom]; | ||
|
||
@property() arialabel?: string; | ||
@property() icon?: SizelessIconType; | ||
@property() href?: string; | ||
@property() target?: string; | ||
@property() onClick?: HTMLLinkElement['onclick']; | ||
@property() onBlur?: HTMLLinkElement['onblur']; | ||
@property() linkId?: string; | ||
@property() variant: ActionVariantType = 'primary'; | ||
@property() size?: ActionSizesType = 'md'; | ||
@property() loading!: boolean; | ||
@property() theme: ThemeType = 'Light'; | ||
|
||
protected render() { | ||
if (this.size) { | ||
const classes = classMap({ | ||
[`${this.variant}`]: this.variant, | ||
[`${this.size}`]: this.size, | ||
}); | ||
|
||
const dynamicStyles = this.theme === 'Light' ? [actionLight] : [actionDark]; | ||
const loaderVariant = determineLoaderVariant(this.variant); | ||
|
||
const loaderSize = getComponentConfigToken([ | ||
'sem', | ||
'buttons', | ||
'loader', | ||
'sizevariant', | ||
this.size, | ||
]).toLowerCase() as FormSizesType; | ||
|
||
const iconSizeVariant = getComponentConfigToken([ | ||
'cmp', | ||
'IconButton', | ||
'Icon', | ||
'SizeVariant', | ||
this.size.toUpperCase(), | ||
]).toLowerCase() as SizesType; | ||
|
||
return html`<style> | ||
${dynamicStyles.map((style) => style)} | ||
</style> | ||
<a | ||
aria-label=${this.arialabel} | ||
class="blr-semantic-action blr-icon-link blr-icon-button ${classes}" | ||
href=${this.href} | ||
loading=${this.loading} | ||
target=${this.target} | ||
@click=${this.onClick} | ||
@blur=${this.onBlur} | ||
id=${this.linkId || nothing} | ||
> | ||
${this.loading | ||
? BlrLoaderRenderFunction({ | ||
sizeVariant: loaderSize, | ||
variant: loaderVariant, | ||
theme: this.theme, | ||
}) | ||
: BlrIconRenderFunction( | ||
{ | ||
icon: calculateIconName(this.icon, iconSizeVariant), | ||
sizeVariant: iconSizeVariant, | ||
}, | ||
{ | ||
'aria-hidden': true, | ||
} | ||
)} | ||
</a>`; | ||
} | ||
} | ||
} | ||
|
||
if (!customElements.get(TAG_NAME)) { | ||
customElements.define(TAG_NAME, BlrIconLink); | ||
} | ||
|
||
export type BlrIconLinkType = Omit<BlrIconLink, keyof LitElement>; | ||
13 changes: 0 additions & 13 deletions
13
packages/ui-library/src/components/icon-link/indexReact.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/ui-library/src/components/icon-link/renderFunction.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters