|
|
@ -2,6 +2,7 @@ import React from 'react'
|
|
|
|
import SketchPicker from 'react-color/lib/Sketch'
|
|
|
|
import SketchPicker from 'react-color/lib/Sketch'
|
|
|
|
|
|
|
|
|
|
|
|
import { COLORS } from '../lib/constants'
|
|
|
|
import { COLORS } from '../lib/constants'
|
|
|
|
|
|
|
|
import { stringifyColor } from '../lib/util'
|
|
|
|
|
|
|
|
|
|
|
|
const pickerStyle = {
|
|
|
|
const pickerStyle = {
|
|
|
|
backgroundColor: COLORS.BLACK,
|
|
|
|
backgroundColor: COLORS.BLACK,
|
|
|
@ -18,31 +19,34 @@ export default function ColorPicker(props) {
|
|
|
|
<SketchPicker
|
|
|
|
<SketchPicker
|
|
|
|
styles={{ picker: style || pickerStyle }}
|
|
|
|
styles={{ picker: style || pickerStyle }}
|
|
|
|
onChange={setColor}
|
|
|
|
onChange={setColor}
|
|
|
|
color={color}
|
|
|
|
color={typeof color === 'string' ? color : stringifyColor(color)}
|
|
|
|
onChangeComplete={onChange}
|
|
|
|
onChangeComplete={onChange}
|
|
|
|
presetColors={presets}
|
|
|
|
presetColors={presets}
|
|
|
|
disableAlpha={disableAlpha}
|
|
|
|
disableAlpha={disableAlpha}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<style jsx>
|
|
|
|
<style jsx>
|
|
|
|
{`
|
|
|
|
{`
|
|
|
|
/* react-color overrides */
|
|
|
|
/* react-color overrides */
|
|
|
|
:global(.sketch-picker > div:nth-child(3) > div > div > span) {
|
|
|
|
:global(.sketch-picker > div:nth-child(3) > div > div > input) {
|
|
|
|
color: ${COLORS.SECONDARY} !important
|
|
|
|
width: 100% !important;
|
|
|
|
}
|
|
|
|
box-shadow: none;
|
|
|
|
|
|
|
|
outline: none;
|
|
|
|
|
|
|
|
border-radius: 2px;
|
|
|
|
|
|
|
|
background: ${COLORS.DARK_GRAY};
|
|
|
|
|
|
|
|
color: #fff !important;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
:global(.sketch-picker > div:nth-child(3) > div > div > input) {
|
|
|
|
:global(.sketch-picker
|
|
|
|
width: 100% !important
|
|
|
|
> div:nth-child(2)
|
|
|
|
box-shadow: none
|
|
|
|
> div:nth-child(1)
|
|
|
|
outline: none
|
|
|
|
> div:nth-child(2), .sketch-picker > div:nth-child(2) > div:nth-child(2)) {
|
|
|
|
border-radius: 2px
|
|
|
|
background: #fff;
|
|
|
|
background: ${COLORS.DARK_GRAY}
|
|
|
|
}
|
|
|
|
color: #fff !important
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
:global(.sketch-picker > div:nth-child(2) > div:nth-child(1) > div:nth-child(2), .sketch-picker > div:nth-child(2) > div:nth-child(2)) {
|
|
|
|
:global(.sketch-picker label) {
|
|
|
|
background: #fff
|
|
|
|
color: ${COLORS.SECONDARY} !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
`}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
|
)
|
|
|
|
)
|
|
|
|