UNPKG

2.01 kBSource Map (JSON)View Raw
1{"version":3,"file":"OpenedSurfaceBorder.js","sources":["../src/components/DataView/OpenedSurfaceBorder.js"],"sourcesContent":["import React from 'react'\nimport PropTypes from 'prop-types'\nimport { Spring, animated } from 'react-spring'\nimport { springs } from '../../style'\nimport { useTheme } from '../../theme'\n\nfunction OpenedSurfaceBorder({ opened, ...props }) {\n const theme = useTheme()\n return (\n <Spring\n native\n from={{ width: 0 }}\n to={{ width: Number(opened) }}\n config={{ ...springs.smooth }}\n >\n {({ width }) => (\n <animated.div\n css={`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 3px;\n background: ${theme.surfaceOpened};\n transform-origin: 0 0;\n `}\n style={{\n transform: width.interpolate(v => `scale3d(${v}, 1, 1)`),\n }}\n {...props}\n />\n )}\n </Spring>\n )\n}\n\nOpenedSurfaceBorder.propTypes = {\n opened: PropTypes.bool,\n}\n\nexport { OpenedSurfaceBorder }\n"],"names":["OpenedSurfaceBorder","opened","props","theme","useTheme","React","Spring","width","Number","springs","smooth","transform","interpolate","v","surfaceOpened","propTypes","PropTypes","bool"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,SAASA,mBAAT,OAAmD;AAAA,MAApBC,MAAoB,QAApBA,MAAoB;AAAA,MAATC,KAAS;;AACjD,MAAMC,KAAK,GAAGC,cAAQ,EAAtB;AACA,sBACEC,6BAACC,UAAD;AACE,IAAA,MAAM,MADR;AAEE,IAAA,IAAI,EAAE;AAAEC,MAAAA,KAAK,EAAE;AAAT,KAFR;AAGE,IAAA,EAAE,EAAE;AAAEA,MAAAA,KAAK,EAAEC,MAAM,CAACP,MAAD;AAAf,KAHN;AAIE,IAAA,MAAM,oBAAOQ,eAAO,CAACC,MAAf;AAJR,KAMG;AAAA,QAAGH,KAAH,SAAGA,KAAH;AAAA,wBACCF;AAUE,MAAA,KAAK,EAAE;AACLM,QAAAA,SAAS,EAAEJ,KAAK,CAACK,WAAN,CAAkB,UAAAC,CAAC;AAAA,mCAAeA,CAAf;AAAA,SAAnB;AADN;AAVT,OAaMX,KAbN;AAAA,YAOkBC,KAAK,CAACW;AAPxB,OADD;AAAA,GANH,CADF;AA0BD;;AAEDd,mBAAmB,CAACe,SAApB,GAAgC;AAC9Bd,EAAAA,MAAM,EAAEe,eAAS,CAACC;AADY,CAAhC;;;;"}
\No newline at end of file