import { SHADOW_PROPS , SPACE_PROPS , TYPOGRAPHY_PROPS , OVERFLOW_PROPS } from '@twilio-paste/style-props' ; import { PseudoPropStyles } from './PseudoPropStyles' ; export const TEXT_PROPS_TO_BLOCK = [ ... SHADOW_PROPS , ... SPACE_PROPS , ... TYPOGRAPHY_PROPS , ... OVERFLOW_PROPS , ... Object . keys ( PseudoPropStyles ) , 'display' , 'verticalAlign' , 'className' , 'style' , ] ; type Props = { [ key ] : any ; } ; export const safelySpreadTextProps = ( props ) : Props => { return Object . keys ( props ) . reduce ( ( newProps , key ) : Props => { if ( ! TEXT_PROPS_TO_BLOCK . includes ( key ) ) { newProps [ key ] = props [ key ] ; } return newProps ; } , { } ) ; } ;