diff --git a/packages/components/link/src/link.ts b/packages/components/link/src/link.ts index 0d0d916f..b4d95ef8 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 54ee2b33..f7019f34 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 }} +