This repository was archived by the owner on Jan 14, 2025. It is now read-only.
File tree 5 files changed +15
-1
lines changed
5 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ className | String | Classes to be applied to the root element.
46
46
raised | Boolean | Enables raised variant.
47
47
unelevated | Boolean | Enables unelevated variant.
48
48
outlined | Boolean | Enables outlined variant.
49
+ dense | Boolean | Enables dense variant.
49
50
icon | Element | Icon to render within root element.
50
51
children | String | Text to be displayed within root element.
51
52
disabled | Boolean | Disables button if true.
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ export class Button extends Component {
32
32
raised,
33
33
unelevated,
34
34
outlined,
35
+ dense,
35
36
icon,
36
37
children,
37
38
initRipple,
@@ -43,6 +44,7 @@ export class Button extends Component {
43
44
'mdc-button--raised' : raised ,
44
45
'mdc-button--unelevated' : unelevated ,
45
46
'mdc-button--outlined' : outlined ,
47
+ 'mdc-button--dense' : dense ,
46
48
} ) ;
47
49
48
50
const SemanticButton = this . props . href ? 'a' : 'button' ;
@@ -76,6 +78,7 @@ Button.propTypes = {
76
78
raised : PropTypes . bool ,
77
79
unelevated : PropTypes . bool ,
78
80
outlined : PropTypes . bool ,
81
+ dense : PropTypes . bool ,
79
82
disabled : PropTypes . bool ,
80
83
unbounded : PropTypes . bool ,
81
84
initRipple : PropTypes . func ,
@@ -89,6 +92,7 @@ Button.defaultProps = {
89
92
raised : false ,
90
93
unelevated : false ,
91
94
outlined : false ,
95
+ dense : false ,
92
96
disabled : false ,
93
97
unbounded : false ,
94
98
initRipple : ( ) => { } ,
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ const ButtonScreenshotTest = () => {
39
39
< Button disabled raised > Disabled Raised</ Button >
40
40
</ div >
41
41
42
+ < div className = 'button-container' >
43
+ < Button dense > Dense</ Button >
44
+ </ div >
45
+
42
46
< div className = 'button-container' >
43
47
< Button href = 'https://google.com' raised > Anchor Tag</ Button >
44
48
</ div >
Original file line number Diff line number Diff line change 1
1
{
2
- "button" : " b01eeaad126491150baf47a736f5d5fbcfc284e62a47d91e9e50dcf1163925c1 " ,
2
+ "button" : " a0cf6b2a5d09400657303bb2a7b220dbe33642a8f44fd7571cdfcf5517fb3586 " ,
3
3
"card" : " b2fd82763c383be438ff6578083bf9009711c7470333d07eb916ab690fc42d31" ,
4
4
"line-ripple" : " 56b136db2dc7e09260849447e6bde9b55a837af332a05d9f52506ab1c95e2e57" ,
5
5
"fab" : " db36f52195c420062d91dd5ebe5432ad87247b3c1146fd547b0a195079bbce2f" ,
Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ test('renders an outlined button', () => {
38
38
assert . isTrue ( wrapper . hasClass ( 'mdc-button--outlined' ) ) ;
39
39
} ) ;
40
40
41
+ test ( 'renders a dense button' , ( ) => {
42
+ const wrapper = shallow ( < Button dense /> ) ;
43
+ assert . isTrue ( wrapper . hasClass ( 'mdc-button--dense' ) ) ;
44
+ } ) ;
45
+
41
46
test ( 'renders a button tag' , ( ) => {
42
47
const wrapper = shallow ( < Button /> ) ;
43
48
assert . equal ( wrapper . type ( ) , 'button' ) ;
You can’t perform that action at this time.
0 commit comments