@@ -13,16 +13,16 @@ import './react-jsx'
1313
1414export * from './types'
1515
16- const getCSS = props => {
16+ const getCSS = ( props ) => {
1717 if ( ! props . sx && ! props . css ) return undefined
18- return theme => {
18+ return ( theme ) => {
1919 const styles = css ( props . sx ) ( theme )
2020 const raw = typeof props . css === 'function' ? props . css ( theme ) : props . css
2121 return [ styles , raw ]
2222 }
2323}
2424
25- const parseProps = props => {
25+ const parseProps = ( props ) => {
2626 if ( ! props ) return null
2727 const next : typeof props & { css ?: InterpolationWithTheme < any > } = { }
2828 for ( let key in props ) {
@@ -55,7 +55,7 @@ const canUseSymbol = typeof Symbol === 'function' && Symbol.for
5555const REACT_ELEMENT = canUseSymbol ? Symbol . for ( 'react.element' ) : 0xeac7
5656const FORWARD_REF = canUseSymbol ? Symbol . for ( 'react.forward_ref' ) : 0xeac7
5757
58- const isMergeableObject = n => {
58+ const isMergeableObject = ( n ) => {
5959 return (
6060 ! ! n &&
6161 typeof n === 'object' &&
@@ -66,10 +66,13 @@ const isMergeableObject = n => {
6666
6767const arrayMerge = ( destinationArray , sourceArray , options ) => sourceArray
6868
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 =>
7073 deepmerge ( a , b , { isMergeableObject, arrayMerge } )
7174
72- merge . all = < T > ( ...args : Partial < T > [ ] ) =>
75+ merge . all = < T = Theme > ( ...args : Partial < T > [ ] ) =>
7376 deepmerge . all < T > ( args , { isMergeableObject, arrayMerge } )
7477
7578interface BaseProviderProps {
0 commit comments