@@ -12,7 +12,6 @@ const props = withDefaults(
1212 ' type' ?: never
1313 ' variant' ?: ' button-primary' | ' button-secondary' | ' link'
1414 ' size' ?: ' small' | ' medium'
15- ' iconSize' ?: ' sm' | ' md' | ' lg'
1615
1716 ' keyshortcut' ?: string
1817
@@ -52,21 +51,11 @@ const isLinkAnchor = computed(
5251 () => !! props .to && typeof props .to === ' string' && props .to .startsWith (' #' ),
5352)
5453
55- const ICON_SIZE_MAP = {
56- sm: ' size-3 min-w-3' ,
57- md: ' size-4 min-w-4' ,
58- lg: ' size-5 min-w-5' ,
59- }
60-
6154/** size is only applicable for button like links */
6255const isLink = computed (() => props .variant === ' link' )
6356const isButton = computed (() => props .variant !== ' link' )
6457const isButtonSmall = computed (() => props .size === ' small' && props .variant !== ' link' )
6558const isButtonMedium = computed (() => props .size === ' medium' && props .variant !== ' link' )
66-
67- const iconSizeClass = computed (
68- () => ICON_SIZE_MAP [props .iconSize || (isButtonSmall .value && ' sm' ) || ' md' ],
69- )
7059 </script >
7160
7261<template >
@@ -100,22 +89,22 @@ const iconSizeClass = computed(
10089 :aria-keyshortcuts =" keyshortcut"
10190 :target =" isLinkExternal ? '_blank' : undefined"
10291 >
103- <span v-if =" classicon" class =" me-1" :class =" [iconSizeClass, classicon] " aria-hidden =" true" />
92+ <span v-if =" classicon" class =" me-1 size-[1em] " :class =" classicon" aria-hidden =" true" />
10493 <slot />
10594 <!-- automatically show icon indicating external link -->
10695 <span
10796 v-if =" isLinkExternal && !classicon"
108- class =" i-carbon:launch rtl-flip w-3 h-3 opacity-50"
97+ class =" i-carbon:launch rtl-flip size-[1em] opacity-50"
10998 aria-hidden =" true"
11099 />
111100 <span
112101 v-else-if =" isLinkAnchor && isLink"
113- class =" i-carbon:link w-3 h-3 opacity-0 group-hover/link:opacity-100 transition-opacity duration-200"
102+ class =" i-carbon:link size-[1em] opacity-0 group-hover/link:opacity-100 transition-opacity duration-200"
114103 aria-hidden =" true"
115104 />
116105 <kbd
117106 v-if =" keyshortcut"
118- class =" ms-2 inline-flex items-center justify-center w-4 h -4 text-xs text-fg bg-bg-muted border border-border rounded no-underline"
107+ class =" ms-2 inline-flex items-center justify-center size -4 text-xs text-fg bg-bg-muted border border-border rounded no-underline"
119108 aria-hidden =" true"
120109 >
121110 {{ keyshortcut }}
0 commit comments