File tree 9 files changed +23
-13
lines changed
9 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ const FlexGridItem = styled(FlexGridItemBase)(
79
79
80
80
FlexGrid . Item = FlexGridItem
81
81
FlexGrid . Item . displayName = 'FlexGrid.Item'
82
- FlexGrid . Item . propTypes = { ...getPropTypes ( flexGridItem ) , ...Box . propTypes }
83
- FlexGrid . Item . defaultProps = { flex : '0 1 auto' , minWidth : 0 }
82
+ FlexGrid . Item . propTypes = { ...getPropTypes ( flexGridItem ) , ...FlexGridItemBase . propTypes }
83
+ FlexGrid . Item . defaultProps = { ... FlexGridItemBase . defaultProps , flex : '0 1 auto' , minWidth : 0 }
84
84
85
85
export {
86
86
FlexGrid
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const Flex = styled(Box)(
25
25
26
26
Flex . displayName = 'Flex'
27
27
Flex . propTypes = { ...styles . propTypes , ...Box . propTypes }
28
- Flex . defaultProps = { display : 'flex' }
28
+ Flex . defaultProps = { ... Box . defaultProps , display : 'flex' }
29
29
30
30
export {
31
31
Flex
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ const Grid = styled(Box)(
34
34
35
35
Grid . displayName = 'Grid'
36
36
Grid . propTypes = { ...getPropTypes ( styles ) , ...Box . propTypes }
37
- Grid . defaultProps = { display : 'grid' }
37
+ Grid . defaultProps = { ... Box . defaultProps , display : 'grid' }
38
38
39
39
const BaseGridItem = base ( {
40
40
use : Box ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Image.propTypes = {
13
13
}
14
14
15
15
Image . defaultProps = {
16
+ ...Box . defaultProps ,
16
17
as : 'img' ,
17
18
display : 'block' ,
18
19
maxWidth : '100%' ,
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ const LayoutSide = styled(Box)()
12
12
13
13
LayoutSide . displayName = 'Layout.Side'
14
14
LayoutSide . propTypes = { ...Box . propTypes }
15
- LayoutSide . defaultProps = { flex : '0 0 auto' , minWidth : 0 }
15
+ LayoutSide . defaultProps = { ... Box . defaultProps , flex : '0 0 auto' , minWidth : 0 }
16
16
17
17
const LayoutContent = styled ( Box ) ( )
18
18
19
19
LayoutContent . displayName = 'Layout.Content'
20
20
LayoutContent . propTypes = { ...Box . propTypes }
21
- LayoutContent . defaultProps = { flex : '1 1 auto' , minWidth : 0 }
21
+ LayoutContent . defaultProps = { ... Box . defaultProps , flex : '1 1 auto' , minWidth : 0 }
22
22
23
23
Layout . Side = LayoutSide
24
24
Layout . Content = LayoutContent
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ const Link = styled(Text)(
8
8
9
9
Link . displayName = 'Link'
10
10
Link . propTypes = { ...Text . propTypes }
11
- Link . defaultProps = { as : 'a' }
11
+ Link . defaultProps = { ... Text . defaultProps , as : 'a' }
12
12
13
13
export {
14
14
Link
Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ const List = styled(BaseList)(
17
17
)
18
18
19
19
List . displayName = 'List'
20
- List . propTypes = { ...listStyle . propTypes , ...Box . propTypes }
21
- List . defaultProps = { listStyle : 'none' , as : 'ul' }
20
+ List . propTypes = { ...listStyle . propTypes , ...BaseList . propTypes }
21
+ List . defaultProps = { ... BaseList . defaultProps , listStyle : 'none' , as : 'ul' }
22
22
23
23
List . Item = styled ( Box ) (
24
24
listStyle
25
25
)
26
26
27
27
List . Item . displayName = 'List.Item'
28
28
List . Item . propTypes = { ...listStyle . propTypes , ...Box . propTypes }
29
- List . Item . defaultProps = { as : 'li' }
29
+ List . Item . defaultProps = { ... Box . defaultProps , as : 'li' }
30
30
31
31
export {
32
32
List
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Text.displayName = 'Text'
24
24
25
25
Text . propTypes = {
26
26
...getPropTypes ( styles ) ,
27
- ...Box . propTypes
27
+ ...BaseText . propTypes
28
28
}
29
29
30
30
export {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function base ({
22
22
const Base = React . forwardRef ( ( props , ref ) => {
23
23
const {
24
24
as : Element = defaultElement ,
25
- base : Comp = ( BaseComp || Element ) ,
25
+ base : Comp = Element ,
26
26
className,
27
27
...rest
28
28
} = props
@@ -48,10 +48,19 @@ export function base ({
48
48
} )
49
49
50
50
Base . displayName = name ? `Base(${ name } )` : 'Base'
51
+
51
52
Base . propTypes = {
52
53
className : PropTypes . string ,
53
54
as : PropTypes . elementType ,
54
- base : PropTypes . elementType
55
+ ...BaseComp !== undefined && {
56
+ base : PropTypes . elementType ,
57
+ ...BaseComp . propTypes
58
+ }
59
+ }
60
+
61
+ Base . defaultProps = {
62
+ as : defaultElement ,
63
+ base : BaseComp
55
64
}
56
65
57
66
return Base
You can’t perform that action at this time.
0 commit comments