@@ -2,7 +2,7 @@ import { clsx } from 'clsx';
22
33import { componentMarkers } from '../../utils/groupMarker' ;
44import { slotClasses } from '../../utils/slotClasses' ;
5- import type { InfoButtonSize , InfoButtonState } from './InfoButton.types' ;
5+ import type { InfoButtonState } from './InfoButton.types' ;
66
77import styles from './InfoButton.module.css' ;
88
@@ -15,15 +15,6 @@ type InfoButtonRootDataAttributes = {
1515 'data-size' ?: InfoButtonState [ 'size' ] ;
1616} ;
1717
18- /** Keyed off the button's own size, never off the surface's: a consumer may set the popover's
19- * size directly, and Griffel still resolves the typography from the button. */
20- const infoTypographyClass = ( size : InfoButtonSize ) : string => {
21- if ( size === 'large' ) {
22- return styles . infoLarge ;
23- }
24- return styles . infoSmallMedium ;
25- } ;
26-
2718/**
2819 * Applies the visual contract, returning new state. The headless hook already stamps data-open,
2920 * which is the whole open/selected channel; data-size is style-only.
@@ -40,6 +31,8 @@ export const useInfoButtonStyles = (state: InfoButtonState): InfoButtonState =>
4031 return {
4132 ...state ,
4233 root,
43- info : slotClasses ( state . info , styles . info , infoTypographyClass ( size ) ) ,
34+ /* Keyed off the button's own size, never off the surface's: a consumer may set the popover's
35+ * size directly, and Griffel still resolves the typography from the button. */
36+ info : slotClasses ( state . info , styles . info , size === 'large' ? styles . infoLarge : styles . infoSmallMedium ) ,
4437 } ;
4538} ;
0 commit comments