@@ -29,6 +29,19 @@ const confirmDialogStyles = readFileSync(
2929 `${ process . cwd ( ) } /src/components/ui/confirm-dialog/index.module.css` ,
3030 "utf8"
3131) ;
32+ const buttonStyles = readFileSync (
33+ `${ process . cwd ( ) } /src/components/ui/button/index.module.css` ,
34+ "utf8"
35+ ) ;
36+ const inputStyles = readFileSync (
37+ `${ process . cwd ( ) } /src/components/ui/input/index.module.css` ,
38+ "utf8"
39+ ) ;
40+ const textareaStyles = readFileSync (
41+ `${ process . cwd ( ) } /src/components/ui/textarea/index.module.css` ,
42+ "utf8"
43+ ) ;
44+ const tabsStyles = readFileSync ( `${ process . cwd ( ) } /src/components/ui/tabs/index.module.css` , "utf8" ) ;
3245
3346function getLastGroupedRuleBlockFrom ( source : string , pattern : RegExp ) {
3447 const matches = Array . from ( source . matchAll ( pattern ) ) ;
@@ -205,6 +218,40 @@ describe("components.css theme-sensitive surfaces", () => {
205218 ) ;
206219 } ) ;
207220
221+ it ( "maps text-entry and navigation primitives onto semantic typography tokens" , ( ) => {
222+ expect ( getLastRuleBlockFrom ( buttonStyles , ".btn" ) ) . toContain (
223+ "font-size: var(--type-body-strong-size)"
224+ ) ;
225+ expect ( getLastRuleBlockFrom ( buttonStyles , ".btn" ) ) . toContain (
226+ "line-height: var(--type-body-strong-line-height)"
227+ ) ;
228+ expect ( getLastRuleBlockFrom ( buttonStyles , ".sm" ) ) . toContain (
229+ "font-size: var(--type-label-size)"
230+ ) ;
231+ expect ( getLastRuleBlockFrom ( buttonStyles , ".lg" ) ) . not . toContain ( "font-size:" ) ;
232+
233+ expect ( getLastRuleBlockFrom ( inputStyles , ".input" ) ) . toContain (
234+ "font-size: var(--type-body-strong-size)"
235+ ) ;
236+ expect ( getLastRuleBlockFrom ( inputStyles , ".sm" ) ) . toContain ( "font-size: var(--type-label-size)" ) ;
237+ expect ( getLastRuleBlockFrom ( inputStyles , ".lg" ) ) . not . toContain ( "font-size:" ) ;
238+
239+ expect ( getLastRuleBlockFrom ( textareaStyles , ".input" ) ) . toContain (
240+ "font-size: var(--type-body-strong-size)"
241+ ) ;
242+ expect ( getLastRuleBlockFrom ( textareaStyles , ".lg" ) ) . not . toContain ( "font-size:" ) ;
243+
244+ expect ( getLastRuleBlockFrom ( tabsStyles , ":global(.panel-tab)" ) ) . toContain (
245+ "font-size: var(--type-label-size)"
246+ ) ;
247+ expect ( getLastRuleBlockFrom ( tabsStyles , ":global(.panel-tab)" ) ) . toContain (
248+ "line-height: var(--type-label-line-height)"
249+ ) ;
250+ expect ( getLastRuleBlockFrom ( tabsStyles , ":global(.worktree-tab)" ) ) . toContain (
251+ "font-size: var(--type-label-size)"
252+ ) ;
253+ } ) ;
254+
208255 it ( "keeps config status colors on icon tokens" , ( ) => {
209256 expect ( getLastRuleBlock ( ".config-status--success" ) ) . toContain ( "var(--icon-success)" ) ;
210257 expect ( getLastRuleBlock ( ".config-status--warning" ) ) . toContain ( "var(--icon-warning)" ) ;
0 commit comments