@@ -13,16 +13,16 @@ import './react-jsx'
13
13
14
14
export * from './types'
15
15
16
- const getCSS = props => {
16
+ const getCSS = ( props ) => {
17
17
if ( ! props . sx && ! props . css ) return undefined
18
- return theme => {
18
+ return ( theme ) => {
19
19
const styles = css ( props . sx ) ( theme )
20
20
const raw = typeof props . css === 'function' ? props . css ( theme ) : props . css
21
21
return [ styles , raw ]
22
22
}
23
23
}
24
24
25
- const parseProps = props => {
25
+ const parseProps = ( props ) => {
26
26
if ( ! props ) return null
27
27
const next : typeof props & { css ?: InterpolationWithTheme < any > } = { }
28
28
for ( let key in props ) {
@@ -55,7 +55,7 @@ const canUseSymbol = typeof Symbol === 'function' && Symbol.for
55
55
const REACT_ELEMENT = canUseSymbol ? Symbol . for ( 'react.element' ) : 0xeac7
56
56
const FORWARD_REF = canUseSymbol ? Symbol . for ( 'react.forward_ref' ) : 0xeac7
57
57
58
- const isMergeableObject = n => {
58
+ const isMergeableObject = ( n ) => {
59
59
return (
60
60
! ! n &&
61
61
typeof n === 'object' &&
@@ -66,10 +66,13 @@ const isMergeableObject = n => {
66
66
67
67
const arrayMerge = ( destinationArray , sourceArray , options ) => sourceArray
68
68
69
- export const merge = < T > ( a : Partial < T > , b : Partial < T > ) : T =>
69
+ /**
70
+ * Deeply merge themes
71
+ */
72
+ export const merge = ( a : Theme , b : Theme ) : Theme =>
70
73
deepmerge ( a , b , { isMergeableObject, arrayMerge } )
71
74
72
- merge . all = < T > ( ...args : Partial < T > [ ] ) =>
75
+ merge . all = < T = Theme > ( ...args : Partial < T > [ ] ) =>
73
76
deepmerge . all < T > ( args , { isMergeableObject, arrayMerge } )
74
77
75
78
interface BaseProviderProps {
0 commit comments