2023-02-27 06:18:16 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import OpenInNew from '@iconify-icons/mdi/open-in-new';
|
2023-02-28 23:42:00 +00:00
|
|
|
import type { IconifyIcon } from 'iconify-icon';
|
2023-02-27 06:18:16 +00:00
|
|
|
export let rel = 'noreferrer';
|
|
|
|
|
export let target = '_blank';
|
|
|
|
|
export let href: string;
|
|
|
|
|
export let ariaLabel: string;
|
|
|
|
|
export let showIcon: boolean = false;
|
2023-02-28 23:42:00 +00:00
|
|
|
export let icon: IconifyIcon = OpenInNew;
|
2023-02-27 06:18:16 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<span class:show-icon={showIcon}>
|
|
|
|
|
<a aria-label={`Open ${ariaLabel} externally`} title={`Open ${ariaLabel} externally`} {href} {rel} {target}>
|
|
|
|
|
<slot />
|
|
|
|
|
</a>
|
|
|
|
|
{#if showIcon}
|
2023-02-28 23:42:00 +00:00
|
|
|
<iconify-icon {icon} width="24" height="24" role="img" title={`Open ${ariaLabel} Externally`} />
|
2023-02-27 06:18:16 +00:00
|
|
|
{/if}
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<style lang="postcss">
|
|
|
|
|
.show-icon {
|
2023-02-28 23:42:00 +00:00
|
|
|
display: inline-flex;
|
2023-02-27 06:18:16 +00:00
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
color: var(--shellYellow);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|