rollpkg-example-package
Version:
Example package for Rollpkg
1 lines • 1.31 kB
Source Map (JSON)
{"version":3,"file":"rollpkg-example-package.cjs.production.js","sources":["../src/randomRGBColorGenerator.ts","../src/ColorBlock.tsx"],"sourcesContent":["const randomNumber0to255 = () => Math.floor(256 * Math.random());\n\ninterface RandomRGBColorGenerator {\n (): [number, number, number];\n}\n\nexport const randomRGBColorGenerator: RandomRGBColorGenerator = () => {\n const red = randomNumber0to255();\n const green = randomNumber0to255();\n const blue = randomNumber0to255();\n\n return [red, green, blue];\n};\n","import * as React from 'react';\n\ninterface ColorBlockProps {\n width: string;\n height: string;\n rgbColor: [number, number, number];\n}\n\nexport const ColorBlock: React.VFC<ColorBlockProps> = ({\n width,\n height,\n rgbColor,\n}) => <div style={{ width, height, backgroundColor: `rgb(${rgbColor})` }} />;\n\n// only add displayName in development to help with debugging\nif (process.env.NODE_ENV !== 'production') {\n ColorBlock.displayName = 'ColorBlock';\n}\n"],"names":["randomNumber0to255","Math","floor","random","width","height","rgbColor","React","style","backgroundColor"],"mappings":"6XAAA,MAAMA,EAAqB,IAAMC,KAAKC,MAAM,IAAMD,KAAKE,6BCQD,EACpDC,MAAAA,EACAC,OAAAA,EACAC,SAAAA,KACIC,uBAAKC,MAAO,CAAEJ,MAAAA,EAAOC,OAAAA,EAAQI,gBAAiB,OAAOH,wCDNK,IAKvD,CAJKN,IACEA,IACDA"}