|
@@ -10,7 +10,7 @@ import styled from 'styled-components';
|
|
|
import Icon from '../Icon';
|
|
|
import Spinner from '../Spinner';
|
|
|
|
|
|
-// iBasic, isPrimary, isPosition, isNegative - here for old compat, check, remove
|
|
|
+// isPrimary, isPosition, isNegative - here for old compat, check, remove
|
|
|
function Button ({ children, className = '', icon, isBasic, isBusy, isCircular, isDisabled, isFull, isIcon, isNegative, isPositive, isPrimary, label, onClick, onMouseEnter, onMouseLeave, tabIndex }: ButtonProps): React.ReactElement<ButtonProps> {
|
|
|
const _onClick = useCallback(
|
|
|
() => !(isBusy || isDisabled) && onClick && onClick(),
|
|
@@ -28,34 +28,26 @@ function Button ({ children, className = '', icon, isBasic, isBusy, isCircular,
|
|
|
<Icon icon={icon} />
|
|
|
{label}
|
|
|
{children}
|
|
|
- <div className='ui--Button-overlay'>
|
|
|
- <Spinner
|
|
|
- className='ui--Button-spinner'
|
|
|
- variant='cover'
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <Spinner
|
|
|
+ className='ui--Button-spinner'
|
|
|
+ variant='cover'
|
|
|
+ />
|
|
|
</button>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
export default React.memo(styled(Button)`
|
|
|
- background: #e9e8e7; // similar to rgba(0, 0, 0, 0.05);
|
|
|
+ background: transparent; // #e9e8e7; // similar to rgba(0, 0, 0, 0.05);
|
|
|
border: none;
|
|
|
color: #4e4e4e;
|
|
|
cursor: pointer;
|
|
|
// font-size: 0.92857142857rem; // 13/14px
|
|
|
- margin: 0 1px;
|
|
|
+ margin: 0;
|
|
|
position: relative;
|
|
|
text-align: center;
|
|
|
- // text-shadow: 0 0 2px #f5f4f3;
|
|
|
|
|
|
&:not(.hasLabel) {
|
|
|
- padding: 0.7em;
|
|
|
-
|
|
|
- > .ui--Icon {
|
|
|
- height: 1rem;
|
|
|
- width: 1rem;
|
|
|
- }
|
|
|
+ padding: 0.7em 0.4rem;
|
|
|
}
|
|
|
|
|
|
&:not(.isCircular) {
|
|
@@ -67,13 +59,17 @@ export default React.memo(styled(Button)`
|
|
|
}
|
|
|
|
|
|
&.hasLabel {
|
|
|
- padding: 0.7em 1.3em;
|
|
|
+ padding: 0.7rem 1.15rem 0.7rem ${1.15 - 0.425}rem;
|
|
|
|
|
|
- > .ui--Icon {
|
|
|
- margin-right: 0.75rem;
|
|
|
+ .ui--Icon {
|
|
|
+ margin-right: 0.425rem !important;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ &.isBasic {
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+
|
|
|
&.isCircular {
|
|
|
border-radius: 10rem;
|
|
|
}
|
|
@@ -111,6 +107,15 @@ export default React.memo(styled(Button)`
|
|
|
visibility: hidden;
|
|
|
}
|
|
|
|
|
|
+ .ui--Icon {
|
|
|
+ border-radius: 1rem;
|
|
|
+ box-sizing: content-box;
|
|
|
+ height: 1rem;
|
|
|
+ margin: -0.425rem 0;
|
|
|
+ padding: 0.425rem;
|
|
|
+ width: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
&.isBusy {
|
|
|
.ui--Button-spinner {
|
|
|
visibility: visible;
|
|
@@ -118,8 +123,6 @@ export default React.memo(styled(Button)`
|
|
|
}
|
|
|
|
|
|
&.isDisabled {
|
|
|
- .ui--Button-overlay {
|
|
|
- visibility: visible;
|
|
|
- }
|
|
|
+ color: #bcbbba;
|
|
|
}
|
|
|
`);
|