This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.react-calendar { | |
.rounded-corners(); | |
width: 350px; | |
max-width: 100%; | |
background: white; | |
font: inherit; | |
line-height: 1.125em; | |
border: 0; | |
overflow: hidden; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pnp.* | |
.yarn/* | |
!.yarn/patches | |
!.yarn/plugins | |
!.yarn/releases | |
!.yarn/sdks | |
!.yarn/versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!('open' in document.createElement('details'))) { | |
const DETAILS = 'details'; | |
const SUMMARY = 'summary'; | |
function injectStyle(style) { | |
const styleElement = document.createElement('style'); | |
styleElement.innerHTML = style; | |
document.getElementsByTagName('head')[0].appendChild(styleElement); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function round(value, decimals) { | |
return Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`); | |
} | |
function roundPath(path, decimals = 3) { | |
function roundPathPoint(pathPoint) { | |
function roundPathPointElement(pathPointElement) { | |
if (pathPointElement.match(/^[A-Za-z]/)) { | |
return `${pathPointElement[0]}${pathPointElement.slice(1) && round(pathPointElement.slice(1), decimals)}`; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toPx(val) { | |
return typeof val === 'number' ? `${val}px` : val; | |
} | |
/** | |
* Creates a background with a single line, e.g. for simulating underline. | |
* | |
* Sample usage in styled-components: | |
* ${props => lineBackground('to bottom', '2px', props.color)} | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toPx(val) { | |
return typeof val === 'number' ? `${val}px` : val; | |
} | |
/** | |
* Creates a text outline of a given width and color. | |
* | |
* Sample usage in styled-components: | |
* ${props => textOutline('2px', props.color)} | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transforms HTML table into JSON data. | |
* | |
* Sample input: | |
* | |
* <table> | |
* <thead> | |
* <tr> | |
* <th>Heading 1</th> | |
* <th>Heading 2</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Allows to use multiple refs on a single React element. | |
* Supports both functions and ref objects created using createRef() and useRef(). | |
* | |
* Usage: | |
* ```jsx | |
* <div ref={mergeRefs(ref1, ref2, ref3)} /> | |
* ``` | |
* | |
* @param {...Array<Function|Object>} inputRefs Array of refs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const findScrollContainer = (element) => { | |
if (!element) { | |
return undefined; | |
} | |
let parent = element.parentElement; | |
while (parent) { | |
const { overflow } = window.getComputedStyle(parent); | |
if (overflow.split(' ').every(o => o === 'auto' || o === 'scroll')) { | |
return parent; |