Skip to content

Commit

Permalink
feat(xo-core): update UiLink component
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierFL committed Feb 11, 2025
1 parent 82473fd commit 4377352
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions @xen-orchestra/web-core/lib/components/ui/link/UiLink.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<!-- v2 -->
<!-- v3 -->
<template>
<component :is="component" :class="classes" class="ui-link" v-bind="attributes">
<VtsIcon :icon accent="current" />
<slot />
<VtsIcon
v-if="attributes.target === '_blank'"
:icon="faArrowUpRightFromSquare"
accent="current"
class="external-icon"
/>
<VtsIcon v-if="attributes.target === '_blank'" :icon="faUpRightFromSquare" accent="current" class="external-icon" />
</component>
</template>

<script lang="ts" setup>
import VtsIcon from '@core/components/icon/VtsIcon.vue'
import { type LinkOptions, useLinkComponent } from '@core/composables/link-component.composable'
import type { IconDefinition } from '@fortawesome/fontawesome-common-types'
import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'
import { faUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'
import { computed } from 'vue'

const props = defineProps<
Expand All @@ -41,14 +36,14 @@ const classes = computed(() => [typoClasses[props.size], { disabled: isDisabled.
display: inline-flex;
align-items: center;
gap: 0.8rem;
color: var(--color-info-txt-base);
color: var(--color-brand-txt-base);

&:hover {
color: var(--color-info-txt-hover);
color: var(--color-brand-txt-hover);
}

&:active {
color: var(--color-info-txt-active);
color: var(--color-brand-txt-active);
}

&:focus-visible {
Expand All @@ -57,7 +52,7 @@ const classes = computed(() => [typoClasses[props.size], { disabled: isDisabled.
&::before {
content: '';
position: absolute;
inset: -0.6rem;
inset: -0.4rem;
border: 0.2rem solid var(--color-info-txt-base);
border-radius: 0.4rem;
}
Expand Down

0 comments on commit 4377352

Please sign in to comment.