From e28b4bd2ae50b06f9ce27276157b2475847a0e6e Mon Sep 17 00:00:00 2001 From: Mike Lebeau Date: Thu, 26 Oct 2023 22:32:56 +0200 Subject: [PATCH] fix: use text decoration underline --- packages/components/link/src/link.ts | 32 ++++++++++++++++++++++----- packages/components/link/src/link.vue | 11 ++++++++- packages/theme/src/link.scss | 30 ++++++++++++++++++++----- 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/packages/components/link/src/link.ts b/packages/components/link/src/link.ts index 0d0d916fc..b4d95ef83 100644 --- a/packages/components/link/src/link.ts +++ b/packages/components/link/src/link.ts @@ -3,16 +3,33 @@ import type { RouteLocationRaw } from 'vue-router' import type { ExtractPropTypes, PropType } from 'vue' import type Link from './link.vue' +export enum PuikLinkTarget { + BLANK = '_blank', + SELF = '_self', + PARENT = '_parent', + TOP = '_top', +} + export const targetVariants = ['_blank', '_self', '_parent', '_top'] as const -export type PuikTargetVariant = (typeof targetVariants)[number] +export type PuikTargetString = (typeof targetVariants)[number] + +export enum PuikLinkSize { + SMALL = 'sm', + MEDIUM = 'md', + LARGE = 'lg', +} + export const linkSizes = ['sm', 'md', 'lg'] as const -export type PuikLinkSize = (typeof linkSizes)[number] +export type PuikLinkSizeString = (typeof linkSizes)[number] export const linkProps = buildProps({ size: { - type: String as PropType, + type: [ + String as PropType, + String as PropType, + ], required: false, - default: 'md', + default: PuikLinkSize.MEDIUM, }, href: { type: String, @@ -25,9 +42,12 @@ export const linkProps = buildProps({ default: undefined, }, target: { - type: String as PropType, + type: [ + String as PropType, + String as PropType, + ], required: false, - default: '_self', + default: PuikLinkTarget.SELF, }, title: { type: String, diff --git a/packages/components/link/src/link.vue b/packages/components/link/src/link.vue index 54ee2b339..f7019f346 100644 --- a/packages/components/link/src/link.vue +++ b/packages/components/link/src/link.vue @@ -7,17 +7,26 @@ :class="['puik-link', `puik-link--${size}`]" > + + + {{ TARGET_BLANK_ICON }} +