@@ -10,11 +10,11 @@ import React, { forwardRef } from 'react'
1010import {
1111 css ,
1212 get ,
13- ThemeUICSSObject ,
1413 ThemeUICSSProperties ,
1514 ThemeUIStyleObject ,
1615} from '@theme-ui/css'
1716import type { Assign } from './types'
17+ import type { __ThemeUIComponentsInternalProps } from './util'
1818
1919const boxSystemProps = [
2020 // space scale props (inherited from @styled-system/space)
@@ -77,7 +77,10 @@ export const __isBoxStyledSystemProp = (prop: string) =>
7777
7878const pickSystemProps = ( props : BoxOwnProps ) => {
7979 const res : Partial < Pick < BoxOwnProps , typeof boxSystemProps [ number ] > > = { }
80- for ( const key of boxSystemProps ) res [ key ] = props [ key ]
80+ for ( const key of boxSystemProps ) {
81+ // ts2590: union is too large
82+ ; ( res as any ) [ key ] = props [ key ]
83+ }
8184
8285 return res
8386}
@@ -86,14 +89,9 @@ const pickSystemProps = (props: BoxOwnProps) => {
8689 * Use the Box component as a layout primitive to add margin, padding, and colors to content.
8790 * @see https://theme-ui.com/components/box
8891 */
89- export const Box = forwardRef < HTMLElement , BoxProps > ( function Box ( props , ref ) {
92+ export const Box = forwardRef < any , BoxProps > ( function Box ( props , ref ) {
9093 const theme = useTheme ( )
9194
92- interface __BoxInternalProps {
93- __css : ThemeUICSSObject
94- __themeKey ?: string
95- }
96-
9795 const {
9896 __themeKey = 'variants' ,
9997 __css,
@@ -102,7 +100,7 @@ export const Box = forwardRef<HTMLElement, BoxProps>(function Box(props, ref) {
102100 sx,
103101 as : Component = 'div' ,
104102 ...rest
105- } = props as BoxProps & __BoxInternalProps
103+ } = props as BoxProps & __ThemeUIComponentsInternalProps
106104
107105 const baseStyles : CSSObject = {
108106 boxSizing : 'border-box' ,
0 commit comments