@@ -20,44 +20,47 @@ const ButtonComponent = ({ className, size, ...props }) => (
2020)
2121
2222const Button = styled ( handleRef ( ButtonComponent ) ) `
23- &.sui-button {
24- display: inline-block;
25- padding: ${ props => props . theme . textControlPadding . sm } ;
26- z-index: ${ props => props . theme . zIndexes . control } ;
27- border-radius: ${ props => props . theme . borderRadius . md } ;
28- font-size: 1rem;
29- line-height: 1.5;
30- background-color: ${ props => props . theme . colors . primary } ;
31- color: ${ props => props . theme . colors . white } ;
32- border: 0;
33- cursor: pointer;
34- transition: background-color 300ms;
23+ display: inline-block;
24+ padding: ${ props => props . theme . textControlPadding . sm } ;
25+ z-index: ${ props => props . theme . zIndexes . control } ;
26+ border-radius: ${ props => props . theme . borderRadius . md } ;
27+ font-size: 1rem;
28+ line-height: 1.5;
29+ background-color: ${ props => props . theme . colors . primary } ;
30+ color: ${ props => props . theme . colors . white } ;
31+ border: 0;
32+ cursor: pointer;
33+ transition: background-color 300ms;
3534
36- &:focus {
37- ${ props => props . theme . mixins . controlFocus } ;
38- }
35+ &:focus {
36+ ${ props => props . theme . mixins . controlFocus } ;
37+ }
3938
40- & :hover,
41- & :active {
42- background-color: ${ props => darken ( 0.05 , props . theme . colors . primary ) } ;
43- }
39+ &:not(:disabled) :hover,
40+ &:not(:disabled) :active {
41+ background-color: ${ props => darken ( 0.05 , props . theme . colors . primary ) } ;
42+ }
4443
45- &.sui-button-lg {
46- padding: ${ props => props . theme . textControlPadding . lg } ;
47- font-size: ${ props => props . theme . controlFontSize . lg } ;
48- border-radius: ${ props => props . theme . borderRadius . lg } ;
49- }
44+ &.sui-button-lg {
45+ padding: ${ props => props . theme . textControlPadding . lg } ;
46+ font-size: ${ props => props . theme . controlFontSize . lg } ;
47+ border-radius: ${ props => props . theme . borderRadius . lg } ;
48+ }
49+
50+ &.sui-button-sm {
51+ padding: ${ props => props . theme . textControlPadding . sm } ;
52+ font-size: ${ props => props . theme . controlFontSize . sm } ;
53+ border-radius: ${ props => props . theme . borderRadius . sm } ;
54+ }
5055
51- &.sui-button-sm {
52- padding: ${ props => props . theme . textControlPadding . sm } ;
53- font-size: ${ props => props . theme . controlFontSize . sm } ;
54- border-radius: ${ props => props . theme . borderRadius . sm } ;
55- }
56+ &:disabled {
57+ opacity: 0.8;
5658 }
5759`
5860
5961Button . propTypes = {
6062 size : PropTypes . oneOf ( [ 'sm' , 'lg' ] ) ,
63+ disabled : PropTypes . bool ,
6164 theme : PropTypes . object ,
6265}
6366
0 commit comments