@@ -17,7 +17,9 @@ UnstyledButton(
1717 Icon( v-else-if ="icon" , :source ="loading ? 'placeholder' : icon" )
1818 span(
1919 v-if ="hasChildren" ,
20- :class ="removeUnderline ? styles.removeUnderline : ''" ,
20+ as ="span" ,
21+ :variant ="size === 'large' || hasPlainText ? 'bodyMd' : 'bodySm'" ,
22+ :fontWeight ="textFontWeight" ,
2123 :key ="disabled ? 'text-disabled' : 'text'"
2224 )
2325 slot
@@ -35,6 +37,7 @@ import { classNames, variationName } from '@/utilities/css';
3537import type { VueNode } from ' @/utilities/types' ;
3638import useI18n from ' @/use/useI18n' ;
3739import { useHasSlot } from ' @/use/useHasSlot' ;
40+ import { useBreakpoints } from ' @/use/useBreakpoints' ;
3841import type { ButtonProps } from ' ./types' ;
3942import { Spinner , Icon } from ' @/components' ;
4043import { UnstyledButton } from ' ../UnstyledButton' ;
@@ -56,6 +59,9 @@ const attrs = useAttrs();
5659const i18n = useI18n ();
5760const { hasSlot } = useHasSlot ();
5861
62+ const breakpoints = useBreakpoints ();
63+ const { mdUp } = breakpoints .value ;
64+
5965const props = withDefaults (defineProps <ButtonProps >(), {
6066 size: ' medium' ,
6167 textAlign: ' center' ,
@@ -76,7 +82,18 @@ const listeners = computed(() => {
7682
7783 return eventBindings ;
7884});
85+ const hasPlainText = computed (() => [' plain' , ' monochromePlain' ].includes (props .variant ));
86+ const textFontWeight = computed (() => {
87+ if (hasPlainText .value ) {
88+ return ' regular' ;
89+ }
7990
91+ if (props .variant === ' primary' ) {
92+ return mdUp ? ' medium' : ' semibold' ;
93+ }
94+
95+ return ' medium' ;
96+ });
8097const hasChildren = computed (() => hasSlot (slots .default ));
8198const isDisabled = computed (() => props .disabled || props .loading );
8299const className = computed (() => classNames (
0 commit comments