diff --git a/src/components/chrome/Chrome.js b/src/components/chrome/Chrome.js index 8f2e651b..f67708aa 100644 --- a/src/components/chrome/Chrome.js +++ b/src/components/chrome/Chrome.js @@ -1,164 +1,161 @@ -import React from 'react' -import PropTypes from 'prop-types' -import reactCSS from 'reactcss' -import merge from 'lodash/merge' +import React from "react"; +import PropTypes from "prop-types"; +import reactCSS from "reactcss"; +import merge from "lodash/merge"; +import { ColorWrap, Saturation, Hue, Alpha, Checkboard } from "../common"; +import ChromeFields from "./ChromeFields"; +import ChromePointer from "./ChromePointer"; +import ChromePointerCircle from "./ChromePointerCircle"; -import { ColorWrap, Saturation, Hue, Alpha, Checkboard } from '../common' -import ChromeFields from './ChromeFields' -import ChromePointer from './ChromePointer' -import ChromePointerCircle from './ChromePointerCircle' - -export const Chrome = ({ width, onChange, disableAlpha, rgb, hsl, hsv, hex, renderers, - styles: passedStyles = {}, className = '', defaultView }) => { - const styles = reactCSS(merge({ - 'default': { - picker: { - width, - background: '#fff', - borderRadius: '2px', - boxShadow: '0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)', - boxSizing: 'initial', - fontFamily: 'Menlo', - }, - saturation: { - width: '100%', - paddingBottom: '55%', - position: 'relative', - borderRadius: '2px 2px 0 0', - overflow: 'hidden', - }, - Saturation: { - radius: '2px 2px 0 0', - }, - body: { - padding: '16px 16px 12px', - }, - controls: { - display: 'flex', - }, - color: { - width: '32px', - }, - swatch: { - marginTop: '6px', - width: '16px', - height: '16px', - borderRadius: '8px', - position: 'relative', - overflow: 'hidden', - }, - active: { - absolute: '0px 0px 0px 0px', - borderRadius: '8px', - boxShadow: 'inset 0 0 0 1px rgba(0,0,0,.1)', - background: `rgba(${ rgb.r }, ${ rgb.g }, ${ rgb.b }, ${ rgb.a })`, - zIndex: '2', - }, - toggles: { - flex: '1', - }, - hue: { - height: '10px', - position: 'relative', - marginBottom: '8px', - }, - Hue: { - radius: '2px', - }, - alpha: { - height: '10px', - position: 'relative', - }, - Alpha: { - radius: '2px', - }, - }, - 'disableAlpha': { - color: { - width: '22px', - }, - alpha: { - display: 'none', - }, - hue: { - marginBottom: '0px', - }, - swatch: { - width: '10px', - height: '10px', - marginTop: '0px', - }, - }, - }, passedStyles), { disableAlpha }) +export const Chrome = ({ + width, + onChange, + disableAlpha, + rgb, + hsl, + hsv, + hex, + renderers, + styles: passedStyles = {}, + className = "", + defaultView, +}) => { + const styles = reactCSS( + merge( + { + default: { + picker: { + width, + }, + saturation: { + width: "100%", + paddingBottom: "55%", + position: "relative", + overflow: "hidden", + }, + Saturation: {}, + body: { + padding: "16px 16px 12px", + }, + controls: { + display: "flex", + }, + color: { + width: "32px", + }, + swatch: { + marginTop: "6px", + width: "16px", + height: "16px", + position: "relative", + overflow: "hidden", + }, + active: { + absolute: "0px 0px 0px 0px", + background: `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${rgb.a})`, + zIndex: "2", + }, + toggles: { + flex: "1", + }, + hue: { + height: "10px", + position: "relative", + marginBottom: "8px", + }, + Hue: {}, + alpha: { + height: "10px", + position: "relative", + }, + Alpha: {}, + }, + disableAlpha: { + color: { + width: "22px", + }, + alpha: { + display: "none", + }, + hue: { + marginBottom: "0px", + }, + swatch: { + width: "10px", + height: "10px", + marginTop: "0px", + }, + }, + }, + passedStyles + ), + { disableAlpha } + ); return ( -