File tree 5 files changed +209
-23
lines changed
5 files changed +209
-23
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,19 @@ import {
14
14
15
15
import PropTypes from 'prop-types'
16
16
import styled from '@emotion/styled'
17
+ import { css } from '@emotion/core'
17
18
import { createBase , blacklistOf } from '../utils'
18
19
20
+ const reset = css `
21
+ box-sizing : border-box;
22
+ min-width : 0 ;
23
+ margin : 0 ;
24
+ padding : 0 ;
25
+ border : 0 ;
26
+ `
27
+
28
+ const initialCSS = ( props ) => props . initialCSS
29
+
19
30
const styles = combineStyles (
20
31
box ,
21
32
boxStyle ,
@@ -34,8 +45,8 @@ const BoxBase = createBase('div', {
34
45
} )
35
46
36
47
const Box = styled ( BoxBase ) (
37
- { boxSizing : 'border-box' } ,
38
- ( props ) => props . initialCSS ,
48
+ reset ,
49
+ initialCSS ,
39
50
styles
40
51
)
41
52
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import { FlexBox } from '../flex-box'
5
5
const FlexList = ( props ) => (
6
6
< FlexBox
7
7
as = 'ul'
8
- m = { 0 }
9
- p = { 0 }
10
8
flexDirection = 'column'
11
9
initialCSS = { { listStyle : 'none' } }
12
10
{ ...props }
Original file line number Diff line number Diff line change @@ -3,25 +3,15 @@ import { FlexBox } from '../flex-box'
3
3
import { Box } from '../box'
4
4
5
5
const MediaObject = ( props ) => (
6
- < FlexBox
7
- alignItems = 'flex-start'
8
- { ...props }
9
- />
6
+ < FlexBox { ...props } />
10
7
)
11
8
12
9
const MediaObjectSide = ( props ) => (
13
- < Box
14
- flex = '0 0 auto'
15
- { ...props }
16
- />
10
+ < Box flex = '0 0 auto' { ...props } />
17
11
)
18
12
19
13
const MediaObjectContent = ( props ) => (
20
- < Box
21
- flex = '1 1 auto'
22
- minWidth = { 0 }
23
- { ...props }
24
- />
14
+ < Box flex = '1 1 auto' { ...props } />
25
15
)
26
16
27
17
Object . assign ( MediaObject , {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import isPropValid from '@emotion/is-prop-valid'
4
4
import { createBaseFactory } from 'react-styled-base'
5
5
6
6
export const createBase = createBaseFactory ( { filter : isPropValid } )
7
- export const blacklistOf = ( styles ) => Object . keys ( styles . propTypes || { } )
7
+ export const blacklistOf = ( styles ) => Object . keys ( Object ( styles . propTypes ) )
8
8
9
9
export const getDisplayName = ( comp , fallback = 'Component' ) =>
10
10
( isStr ( comp ) ? comp : ( comp . displayName || comp . name || fallback ) )
You can’t perform that action at this time.
0 commit comments