This repository was archived by the owner on Jan 14, 2025. It is now read-only.
File tree 7 files changed +70
-1
lines changed
7 files changed +70
-1
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,9 @@ short | Boolean | Enables short variant.
62
62
shortCollapsed | Boolean | Enables short collapsed variant.
63
63
prominent | Boolean | Enables prominent variant.
64
64
fixed | Boolean | Enables fixed variant.
65
+ dense | Boolean | Enables dense variant.
65
66
66
- > NOTE: As per design guidelines, prominent variant should not be used with short or short collapsed.
67
+ > NOTE: As per design guidelines, prominent and dense variants should not be used with short or short collapsed.
67
68
68
69
69
70
## Icons
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export default class TopAppBar extends React.Component {
47
47
const { classList} = this . state ;
48
48
const {
49
49
className,
50
+ dense,
50
51
fixed,
51
52
prominent,
52
53
short,
@@ -58,6 +59,7 @@ export default class TopAppBar extends React.Component {
58
59
'mdc-top-app-bar--short' : shortCollapsed || short ,
59
60
'mdc-top-app-bar--short-collapsed' : shortCollapsed ,
60
61
'mdc-top-app-bar--prominent' : prominent ,
62
+ 'mdc-top-app-bar--dense' : dense ,
61
63
} ) ;
62
64
}
63
65
@@ -222,6 +224,7 @@ export default class TopAppBar extends React.Component {
222
224
TopAppBar . propTypes = {
223
225
actionItems : PropTypes . arrayOf ( PropTypes . element ) ,
224
226
className : PropTypes . string ,
227
+ dense : PropTypes . bool ,
225
228
fixed : PropTypes . bool ,
226
229
navigationIcon : PropTypes . element ,
227
230
prominent : PropTypes . bool ,
@@ -236,6 +239,7 @@ TopAppBar.propTypes = {
236
239
TopAppBar . defaultProps = {
237
240
actionItems : null ,
238
241
className : '' ,
242
+ dense : false ,
239
243
fixed : false ,
240
244
navigationIcon : null ,
241
245
prominent : false ,
Original file line number Diff line number Diff line change 32
32
"top-app-bar/standard" : " 7a2dd6318d62ac2eabd66f1b28100db7c15840ccb753660065fa9524db6435d6" ,
33
33
"top-app-bar/standardNoActionItems" : " 6d361edb994cafcc6ac720336d12ee7d7114745993e16abd6e6b00f078424ff2" ,
34
34
"top-app-bar/standardWithNavigationIconElement" : " 95afd559c35dede805e4d4b51ad1fabd82b4117c358a8679e3166b88e059bf68" ,
35
+ "top-app-bar/dense" : " e8e288b997fa6cf112053e4ee62ed7c3d601c23a87eaece29348fc172dd5ebe4" ,
36
+ "top-app-bar/prominentDense" : " 280995e7c3df950c72ea39f1673e359c9032ebdfa3ab0309831591b9f79227d6" ,
35
37
"drawer/permanentBelowTopAppBar" : " 587ee2605c4b3e3f0408c6130b824b58587e05cedf9b964e14fc481b9de1e4c2" ,
36
38
"drawer/dismissibleBelowTopAppBar" : " a9bf24c0edd3dcc9167516ce3bdd146fd1a352c4f5b9ea76a1f9dad1ba61e0f8" ,
37
39
"drawer/permanent" : " 6355905c2241b5e6fdddc2e25119a1cc3b062577375a88b59e6750c4b76e4561" ,
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import TopAppBar from '../../../packages/top-app-bar' ;
3
+
4
+ import MaterialIcon from '../../../packages/material-icon' ;
5
+ import MainTopAppBarContent from './mainContent' ;
6
+
7
+ const TopAppBarDenseScreenshotTest = ( ) => {
8
+ return (
9
+ < div className = 'top-app-bar-container' >
10
+ < TopAppBar
11
+ dense
12
+ title = 'Miami, FL'
13
+ navigationIcon = { < MaterialIcon
14
+ icon = 'menu'
15
+ onClick = { ( ) => console . log ( 'dense click' ) }
16
+ /> }
17
+ actionItems = { [ < MaterialIcon key = 'item' icon = 'bookmark' /> ] }
18
+ />
19
+ < MainTopAppBarContent />
20
+ </ div >
21
+ ) ;
22
+ } ;
23
+
24
+ export default TopAppBarDenseScreenshotTest ;
Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+ import TopAppBar from '../../../packages/top-app-bar' ;
3
+
4
+ import MaterialIcon from '../../../packages/material-icon' ;
5
+ import MainTopAppBarContent from './mainContent' ;
6
+
7
+ const TopAppBarProminentDenseScreenshotTest = ( ) => {
8
+ return (
9
+ < div className = 'top-app-bar-container' >
10
+ < TopAppBar
11
+ prominent
12
+ dense
13
+ title = 'Miami, FL'
14
+ navigationIcon = { < MaterialIcon
15
+ icon = 'menu'
16
+ onClick = { ( ) => console . log ( 'prominent dense click' ) }
17
+ /> }
18
+ actionItems = { [ < MaterialIcon key = 'item' icon = 'bookmark' /> ] }
19
+ />
20
+ < MainTopAppBarContent />
21
+ </ div >
22
+ ) ;
23
+ } ;
24
+
25
+ export default TopAppBarProminentDenseScreenshotTest ;
Original file line number Diff line number Diff line change 1
1
export default [
2
2
'fixed' ,
3
+ 'dense' ,
3
4
'prominent' ,
5
+ 'prominentDense' ,
4
6
'short' ,
5
7
'shortCollapsed' ,
6
8
'standard' ,
Original file line number Diff line number Diff line change @@ -63,6 +63,17 @@ test('has correct fixed class', () => {
63
63
assert . isTrue ( wrapper . hasClass ( 'mdc-top-app-bar--fixed' ) ) ;
64
64
} ) ;
65
65
66
+ test ( 'has correct dense class' , ( ) => {
67
+ const wrapper = shallow ( < TopAppBar dense /> ) ;
68
+ assert . isTrue ( wrapper . hasClass ( 'mdc-top-app-bar--dense' ) ) ;
69
+ } ) ;
70
+
71
+ test ( 'has correct prominent dense class' , ( ) => {
72
+ const wrapper = shallow ( < TopAppBar prominent dense /> ) ;
73
+ assert . isTrue ( wrapper . hasClass ( 'mdc-top-app-bar--dense' ) ) ;
74
+ assert . isTrue ( wrapper . hasClass ( 'mdc-top-app-bar--prominent' ) ) ;
75
+ } ) ;
76
+
66
77
test ( 'navigationIcon is rendered with navigation icon class' , ( ) => {
67
78
const wrapper = mount (
68
79
< TopAppBar
You can’t perform that action at this time.
0 commit comments