@@ -55,6 +55,8 @@ const isLink = computed(() => props.variant === 'link')
5555const isButton = computed (() => ! isLink .value )
5656const isButtonSmall = computed (() => props .size === ' small' && ! isLink .value )
5757const isButtonMedium = computed (() => props .size === ' medium' && ! isLink .value )
58+ const slots = useSlots ()
59+ const iconOnly = computed (() => !! props .classicon && ! slots .default )
5860 </script >
5961
6062<template >
@@ -65,12 +67,14 @@ const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
6567 'inline-flex': !block,
6668 'opacity-50 gap-x-1 items-center justify-center font-mono border border-transparent rounded-md':
6769 isButton,
68- 'text-sm py-2': isButtonMedium,
69- 'px-4': isButtonMedium && !classicon,
70- 'ps-3 pe-4': isButtonMedium && !!classicon,
71- 'text-xs py-0.5': isButtonSmall,
72- 'px-2': isButtonSmall && !classicon,
73- 'ps-1.5 pe-2': isButtonSmall && !!classicon,
70+ 'text-sm py-2': isButtonMedium && !iconOnly,
71+ 'text-sm p-2': isButtonMedium && !!iconOnly,
72+ 'px-4': isButtonMedium && !classicon && !iconOnly,
73+ 'ps-3 pe-4': isButtonMedium && !!classicon && !iconOnly,
74+ 'text-xs py-0.5': isButtonSmall && !iconOnly,
75+ 'text-xs p-0.5': isButtonSmall && !!iconOnly,
76+ 'px-2': isButtonSmall && !classicon && !iconOnly,
77+ 'ps-1.5 pe-2': isButtonSmall && !!classicon && !iconOnly,
7478 'text-bg bg-fg': variant === 'button-primary',
7579 'bg-transparent text-fg': variant === 'button-secondary',
7680 }"
@@ -89,12 +93,14 @@ const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
8993 isLink,
9094 'justify-center font-mono border border-border rounded-md transition-all duration-200':
9195 isButton,
92- 'text-sm py-2': isButtonMedium,
93- 'px-4': isButtonMedium && !classicon,
94- 'ps-3 pe-4': isButtonMedium && !!classicon,
95- 'text-xs py-0.5': isButtonSmall,
96- 'px-2': isButtonSmall && !classicon,
97- 'ps-1.5 pe-2': isButtonSmall && !!classicon,
96+ 'text-sm py-2': isButtonMedium && !iconOnly,
97+ 'text-sm p-2': isButtonMedium && iconOnly,
98+ 'px-4': isButtonMedium && !classicon && !iconOnly,
99+ 'ps-3 pe-4': isButtonMedium && !!classicon && !iconOnly,
100+ 'text-xs py-0.5': isButtonSmall && !iconOnly,
101+ 'text-xs p-0.5': isButtonSmall && iconOnly,
102+ 'px-2': isButtonSmall && !classicon && !iconOnly,
103+ 'ps-1.5 pe-2': isButtonSmall && !!classicon && !iconOnly,
98104 'bg-transparent text-fg hover:(bg-fg/10 text-accent) focus-visible:(bg-fg/10 text-accent) aria-[current=true]:(bg-fg/10 text-accent border-fg/20 hover:enabled:(bg-fg/20 text-fg/50))':
99105 variant === 'button-secondary',
100106 'text-bg bg-fg hover:(bg-fg/50 text-accent) focus-visible:(bg-fg/50) aria-current:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':
0 commit comments