fix buttons
This commit is contained in:
parent
fbb29c87b2
commit
f281e123f8
1 changed files with 25 additions and 0 deletions
|
@ -10,6 +10,7 @@ export interface ToolButtonProps {
|
|||
onDoubleClick?: () => void
|
||||
disabled?: boolean
|
||||
isActive?: boolean
|
||||
isSponsor?: boolean
|
||||
isToolLocked?: boolean
|
||||
variant?: 'icon' | 'text' | 'circle' | 'primary'
|
||||
children: React.ReactNode
|
||||
|
@ -28,6 +29,7 @@ export const ToolButton = React.forwardRef<HTMLButtonElement, ToolButtonProps>(
|
|||
isToolLocked = false,
|
||||
disabled = false,
|
||||
isActive = false,
|
||||
isSponsor = false,
|
||||
onKeyDown,
|
||||
id,
|
||||
...rest
|
||||
|
@ -38,6 +40,7 @@ export const ToolButton = React.forwardRef<HTMLButtonElement, ToolButtonProps>(
|
|||
<StyledToolButton
|
||||
ref={ref}
|
||||
isActive={isActive}
|
||||
isSponsor={isSponsor}
|
||||
variant={variant}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
|
@ -208,6 +211,28 @@ export const StyledToolButton = styled('button', {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
isActive: true,
|
||||
css: {
|
||||
[`${StyledToolButtonInner}`]: {
|
||||
backgroundColor: '$selected',
|
||||
color: '$selectedContrast',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
isActive: false,
|
||||
bp: 'small',
|
||||
css: {
|
||||
[`&:hover:not(:disabled) ${StyledToolButtonInner}`]: {
|
||||
backgroundColor: '$hover',
|
||||
border: '1px solid $panel',
|
||||
},
|
||||
[`&:focus:not(:disabled) ${StyledToolButtonInner}`]: {
|
||||
backgroundColor: '$hover',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue