|
|
@ -3,6 +3,7 @@ import colornames from 'colornames'
|
|
|
|
|
|
|
|
|
|
|
|
import ImagePicker from './ImagePicker'
|
|
|
|
import ImagePicker from './ImagePicker'
|
|
|
|
import ColorPicker from './ColorPicker'
|
|
|
|
import ColorPicker from './ColorPicker'
|
|
|
|
|
|
|
|
import Button from './Button'
|
|
|
|
import Popout, { managePopout } from './Popout'
|
|
|
|
import Popout, { managePopout } from './Popout'
|
|
|
|
import { COLORS, DEFAULT_BG_COLOR } from '../lib/constants'
|
|
|
|
import { COLORS, DEFAULT_BG_COLOR } from '../lib/constants'
|
|
|
|
import { capitalize, stringifyRGBA } from '../lib/util'
|
|
|
|
import { capitalize, stringifyRGBA } from '../lib/util'
|
|
|
@ -31,12 +32,17 @@ class BackgroundSelect extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="bg-select-container">
|
|
|
|
<div className="bg-select-container">
|
|
|
|
<div className={`bg-select-display ${isVisible ? 'is-visible' : ''}`}>
|
|
|
|
<Button
|
|
|
|
<div role="button" tabIndex={0} className="bg-color-container" onClick={toggleVisibility}>
|
|
|
|
border
|
|
|
|
<div className="bg-color-alpha" />
|
|
|
|
center
|
|
|
|
<div className="bg-color" />
|
|
|
|
selected={isVisible}
|
|
|
|
</div>
|
|
|
|
className={`bg-select-display ${isVisible ? 'is-visible' : ''}`}
|
|
|
|
</div>
|
|
|
|
onClick={toggleVisibility}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div className="bg-color-alpha" />
|
|
|
|
|
|
|
|
<div className="bg-color" />
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
|
|
|
|
<Popout
|
|
|
|
<Popout
|
|
|
|
id="bg-select-pickers"
|
|
|
|
id="bg-select-pickers"
|
|
|
|
pointerLeft="15px"
|
|
|
|
pointerLeft="15px"
|
|
|
@ -71,26 +77,19 @@ class BackgroundSelect extends React.PureComponent {
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-select-display {
|
|
|
|
.bg-select-container :global(.bg-select-display) {
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
width: 40px;
|
|
|
|
width: 40px;
|
|
|
|
border: 1px solid ${COLORS.SECONDARY};
|
|
|
|
border: 1px solid ${COLORS.SECONDARY};
|
|
|
|
border-radius: 3px;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-select-display.is-visible {
|
|
|
|
.bg-select-container :global(.bg-select-display.is-visible),
|
|
|
|
|
|
|
|
.bg-select-container :global(.bg-select-display:focus) {
|
|
|
|
border-width: 2px;
|
|
|
|
border-width: 2px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.bg-color-container {
|
|
|
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
background: #fff;
|
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.bg-color {
|
|
|
|
.bg-color {
|
|
|
|
position: absolute;
|
|
|
|
position: absolute;
|
|
|
|
top: 0px;
|
|
|
|
top: 0px;
|
|
|
|