66import { calc } from '@vanilla-extract/css-utils' ;
77import { createGlobalThemeMapFn } from './css-helpers.js' ;
88import { typedObjectEntries , typedObjectFromEntries } from './utils.js' ;
9- import { propsVars , globalVars } from './vars.css.js' ;
9+ import { propsVars , baseVars , type Prefix } from './vars.css.js' ;
1010
1111export type ButtonVariant =
1212 | 'default'
@@ -18,21 +18,22 @@ export type ButtonVariant =
1818export type ButtonState = 'active' | 'disabled' | 'hover' | 'rest' ;
1919
2020const buttonStateVarsShape = {
21+ rest : { bgColor : '' , fgColor : '' , borderColor : '' } ,
22+ hover : { bgColor : '' , fgColor : '' , borderColor : '' } ,
2123 active : { bgColor : '' , fgColor : '' , borderColor : '' } ,
2224 disabled : { bgColor : '' , fgColor : '' , borderColor : '' } ,
23- hover : { bgColor : '' , fgColor : '' , borderColor : '' } ,
24- rest : { bgColor : '' , fgColor : '' , borderColor : '' } ,
2525} satisfies Record < ButtonState , { bgColor : '' ; fgColor : '' ; borderColor : '' } > ;
2626
27+ export const buttonVariantMapFnPrefix = 'button' satisfies Prefix ;
2728export const buttonVariantVars = createGlobalThemeContract (
2829 {
29- default : buttonStateVarsShape ,
30- danger : buttonStateVarsShape ,
3130 primary : buttonStateVarsShape ,
31+ default : buttonStateVarsShape ,
3232 invisible : buttonStateVarsShape ,
33+ danger : buttonStateVarsShape ,
3334 inactive : buttonStateVarsShape ,
3435 } satisfies Record < ButtonVariant , typeof buttonStateVarsShape > ,
35- createGlobalThemeMapFn ( 'button' ) ,
36+ createGlobalThemeMapFn ( buttonVariantMapFnPrefix ) ,
3637) ;
3738
3839export const buttonVariantClassNames = styleVariants (
@@ -76,8 +77,8 @@ export const buttonClassName = style([
7677 {
7778 cursor : 'pointer' ,
7879 userSelect : 'none' ,
79- borderRadius : globalVars . border . radius ,
80- borderWidth : globalVars . border . width ,
80+ borderRadius : baseVars . border . radius ,
81+ borderWidth : baseVars . border . width ,
8182 selectors : {
8283 '&[disabled]' : {
8384 pointerEvents : 'none' ,
0 commit comments