export const getDiffRect = ( node , parentNode ) => { const nodeRect = node . getBoundingClientRect ( ) ; const parentNodeRect = parentNode . getBoundingClientRect ( ) ; return { left : nodeRect . left - parentNodeRect . left , top : nodeRect . top - parentNodeRect . top , right : nodeRect . right - parentNodeRect . right , bottom : nodeRect . bottom - parentNodeRect . bottom } ; } ; export const getTabListStyle = ( { direction , type , offset , } ) => { if ( direction === 'vertical' ) { return { transform : `translateY(${ - offset }px)` } ; } if ( type === 'capsule' ) { return { transform : `translateX(${ offset }px)` } ; } return { transform : `translateX(${ - offset }px)` } ; } ;