rollpkg-example-package
Version:
Example package for Rollpkg
46 lines (38 loc) • 1.37 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () {
return e[k];
}
});
}
});
}
n['default'] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
const randomNumber0to255 = () => Math.floor(256 * Math.random());
const randomRGBColorGenerator = () => {
const red = randomNumber0to255();
const green = randomNumber0to255();
const blue = randomNumber0to255();
return [red, green, blue];
};
const ColorBlock = ({ width, height, rgbColor, }) => React__namespace.createElement("div", { style: { width, height, backgroundColor: `rgb(${rgbColor})` } });
// only add displayName in development to help with debugging
if (process.env.NODE_ENV !== 'production') {
ColorBlock.displayName = 'ColorBlock';
}
exports.ColorBlock = ColorBlock;
exports.randomRGBColorGenerator = randomRGBColorGenerator;
//# sourceMappingURL=rollpkg-example-package.cjs.development.js.map
;