File tree Expand file tree Collapse file tree 6 files changed +9
-8
lines changed
Expand file tree Collapse file tree 6 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { withGlobalProps } from '../../provider';
44import { classNames } from '../../utils/classNames' ;
55import { transferProps } from '../../utils/transferProps' ;
66import { getRootColorClassName } from '../_helpers/getRootColorClassName' ;
7+ import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName' ;
78import styles from './Badge.module.scss' ;
89
910export const Badge = ( {
@@ -16,7 +17,7 @@ export const Badge = ({
1617 { ...transferProps ( restProps ) }
1718 className = { classNames (
1819 styles . root ,
19- priority === 'outline' && styles . isRootPriorityOutline ,
20+ getRootPriorityClassName ( priority , styles ) ,
2021 getRootColorClassName ( color , styles ) ,
2122 ) }
2223 >
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ $_badge-size: 1.25rem;
2020 vertical-align : baseline ;
2121 color : var (--rui-local-color );
2222 border-radius : math .div ($_badge-size , 2 );
23+ }
24+
25+ .isRootPriorityFilled {
2326 background-color : var (--rui-local-background-color );
2427 box-shadow : var (--rui-local-box-shadow , #{0 0 0 2px rgb (255 255 255 / 80% )} );
2528 }
@@ -67,9 +70,6 @@ $_badge-size: 1.25rem;
6770 }
6871
6972 .isRootPriorityOutline {
70- --rui-local-background-color : transparent ;
71- --rui-local-box-shadow : none ;
72-
7373 padding-top : 0.1875rem ;
7474 padding-bottom : 0.1875rem ;
7575 border : borders .$width solid currentcolor ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ describe('rendering', () => {
1919 ] ,
2020 [
2121 { priority : 'filled' } ,
22- ( rootElement ) => expect ( rootElement ) . not . toHaveClass ( 'isRootPriorityOutline ' ) ,
22+ ( rootElement ) => expect ( rootElement ) . toHaveClass ( 'isRootPriorityFilled ' ) ,
2323 ] ,
2424 [
2525 { priority : 'outline' } ,
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ import { withGlobalProps } from '../../provider';
44import { classNames } from '../../utils/classNames' ;
55import { transferProps } from '../../utils/transferProps' ;
66import { getRootColorClassName } from '../_helpers/getRootColorClassName' ;
7+ import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName' ;
78import { getRootSizeClassName } from '../_helpers/getRootSizeClassName' ;
89import { resolveContextOrProp } from '../_helpers/resolveContextOrProp' ;
910import { ButtonGroupContext } from '../ButtonGroup' ;
1011import { InputGroupContext } from '../InputGroup/InputGroupContext' ;
11- import getRootPriorityClassName from '../_helpers/getRootPriorityClassName' ;
1212import getRootLabelVisibilityClassName from './helpers/getRootLabelVisibilityClassName' ;
1313import styles from './Button.module.scss' ;
1414
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import React, {
55import { withGlobalProps } from '../../provider' ;
66import { classNames } from '../../utils/classNames' ;
77import { transferProps } from '../../utils/transferProps' ;
8- import getRootPriorityClassName from '../_helpers/getRootPriorityClassName' ;
8+ import { getRootPriorityClassName } from '../_helpers/getRootPriorityClassName' ;
99import { isChildrenEmpty } from '../_helpers/isChildrenEmpty' ;
1010import styles from './ButtonGroup.module.scss' ;
1111import { ButtonGroupContext } from './ButtonGroupContext' ;
Original file line number Diff line number Diff line change 1- export default ( priority , styles ) => {
1+ export const getRootPriorityClassName = ( priority , styles ) => {
22 if ( priority === 'filled' ) {
33 return styles . isRootPriorityFilled ;
44 }
You can’t perform that action at this time.
0 commit comments