File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,41 @@ const CardCheckbox = ({
3232 className = { cx ( 'sg-card-radio' , className ) }
3333 style = { { ...style , ...cssVariables } }
3434 >
35- < Checkbox />
35+ < CardCheckboxIndicator />
3636 { children }
3737 </ label >
3838 ) ;
3939} ;
4040
41+ export interface CardCheckboxIndicatorPropsType {
42+ slot ?:
43+ | 'top-left'
44+ | 'center-left'
45+ | 'bottom-left'
46+ | 'top-right'
47+ | 'center-right'
48+ | 'bottom-right' ;
49+ style ?: React . CSSProperties ;
50+ className ?: string ;
51+ }
52+
53+ const CardCheckboxIndicator = ( {
54+ slot = 'top-left' ,
55+ style,
56+ className,
57+ } : CardCheckboxIndicatorPropsType ) => {
58+ return (
59+ < div
60+ className = { cx (
61+ 'sg-card-checkbox__indicator' ,
62+ `sg-card-checkbox__indicator--${ slot } ` ,
63+ className
64+ ) }
65+ style = { style }
66+ >
67+ < Checkbox />
68+ </ div >
69+ ) ;
70+ } ;
71+
4172export default CardCheckbox ;
Original file line number Diff line number Diff line change 22.sg-card-radio ,
33.sg-card-checkbox {
44 display : block ;
5+ position : relative ;
56 width : var (--card-width , auto );
67 height : var (--card-height , auto );
78 border-radius : 8px ;
1718 border-color : #46535f ;
1819 }
1920}
21+
22+ .sg-card-checkbox__indicator {
23+ position : absolute ;
24+ top : 0 ;
25+ left : 0 ;
26+ }
You can’t perform that action at this time.
0 commit comments