@@ -11,7 +11,9 @@ import { cssClass } from '../utils/css-class'
1111import themeGet from '../utils/theme-get'
1212import { ColorProps } from '../utils/color-props'
1313
14- const labelVariants = variant < any , VariantType > ( {
14+ export type LabelVariantType = VariantType | 'light'
15+
16+ const labelVariants = variant < any , LabelVariantType > ( {
1517 variants : {
1618 primary : {
1719 color : 'primary100' ,
@@ -43,6 +45,14 @@ const labelVariants = variant<any, VariantType>({
4345 fill : 'accent' ,
4446 } ,
4547 } ,
48+ light : {
49+ color : 'grey60' ,
50+ mb : 'sm' ,
51+ fontWeight : 'light' ,
52+ [ `& .${ cssClass ( 'Icon' ) } svg` ] : {
53+ fill : 'grey60' ,
54+ } ,
55+ } ,
4656 default : { } ,
4757 } ,
4858} )
@@ -69,7 +79,7 @@ export type LabelProps = ColorProps & SpaceProps & TypographyProps & {
6979 /** If label represents disabled field (dimmed version) */
7080 disabled ?: boolean ;
7181 /** Color variant */
72- variant ?: VariantType ;
82+ variant ?: LabelVariantType ;
7383
7484 /** Label size */
7585 size ?: 'default' | 'lg'
@@ -119,15 +129,15 @@ const setDisabled = ({ disabled, theme }): ReturnType<ThemedCssFunction<DefaultT
119129 */
120130const Label = styled . label < LabelProps > `
121131 display: ${ ( { inline } ) : string => ( inline ? 'inline-block' : 'block' ) } ;
122- font-family: ${ ( { theme } ) : string => theme . font } ;
132+ font-family: ${ themeGet ( ' font' ) } ;
123133 font-size: ${ ( props ) : string => themeGet ( 'fontSizes' , props . size === 'lg' ? 'md' : 'sm' ) ( props ) } ;
124- line-height: ${ ( { theme } ) : string => theme . lineHeights . default } ;
134+ line-height: ${ themeGet ( ' lineHeights' , ' default' ) } ;
125135 margin-bottom: ${ ( { theme, inline } ) : string => ( inline ? '0' : theme . space . default ) } ;
126136
127137 &:before {
128138 content: "${ ( { required } ) : string => ( required ? '*' : '' ) } ";
129- color: ${ ( { theme } ) : string => theme . colors . primary100 } ;
130- margin-right: ${ ( { theme } ) : string => theme . space . sm } ;
139+ color: ${ themeGet ( ' colors' , ' primary100' ) } ;
140+ margin-right: ${ themeGet ( ' space' , 'sm' ) } ;
131141 display: ${ ( { required } ) : string => ( required ? 'block-inline' : 'none' ) } ;
132142 }
133143
0 commit comments