@@ -2,7 +2,6 @@ import React, { useCallback, useState, SyntheticEvent, useRef, useEffect, useMem
2
2
import styled from "@emotion/styled" ;
3
3
import { css } from "emotion" ;
4
4
import { usePageElements } from "@webiny/app-page-builder-elements/hooks/usePageElements" ;
5
- import classnames from "classnames" ;
6
5
import { ChromePicker , ColorState , RGBColor } from "react-color" ;
7
6
import { OnChangeHandler } from "react-color/lib/components/common/ColorWrap" ;
8
7
import { Tooltip } from "@webiny/ui/Tooltip" ;
@@ -34,7 +33,7 @@ const Color = styled("button")({
34
33
cursor : "pointer" ,
35
34
width : 40 ,
36
35
height : 40 ,
37
- transition : "transform 0.2s, scale 0.2s" ,
36
+ transition : "transform 0.1s, border 0.2s" ,
38
37
borderColor : "transparent" ,
39
38
display : "flex" ,
40
39
alignItems : "center" ,
@@ -85,7 +84,10 @@ const COLORS = {
85
84
86
85
const styles = {
87
86
selectedColor : css ( {
88
- boxShadow : "0px 0px 0px 2px var(--mdc-theme-secondary)"
87
+ boxShadow : "inset 0px 0px 0px 10px var(--mdc-theme-secondary)" ,
88
+ button : {
89
+ border : "5px solid var(--mdc-theme-surface)"
90
+ }
89
91
} ) ,
90
92
button : css ( {
91
93
cursor : "pointer" ,
@@ -192,10 +194,9 @@ export const LexicalColorPicker = ({
192
194
themeColor . current = true ;
193
195
}
194
196
return (
195
- < ColorBox key = { index } >
197
+ < ColorBox key = { index } className = { color === value ? styles . selectedColor : "" } >
196
198
< Tooltip content = { < span > { color } </ span > } placement = "bottom" >
197
199
< Color
198
- className = { key === value ? styles . selectedColor : "" }
199
200
style = { { backgroundColor : color } }
200
201
onClick = { ( ) => {
201
202
// With page elements implementation, we want to store the color key and
@@ -209,23 +210,20 @@ export const LexicalColorPicker = ({
209
210
) ;
210
211
} ) }
211
212
212
- < ColorBox >
213
+ < ColorBox className = { value === "transparent" ? styles . selectedColor : "" } >
213
214
< Tooltip content = { < span > Transparent</ span > } placement = "bottom" >
214
215
< Color
215
- className = { classnames ( transparent , {
216
- [ styles . selectedColor ] : value === "transparent"
217
- } ) }
216
+ className = { transparent }
218
217
onClick = { ( ) => {
219
218
onChangeComplete ( "transparent" ) ;
220
219
} }
221
220
/>
222
221
</ Tooltip >
223
222
</ ColorBox >
224
223
225
- < ColorBox >
224
+ < ColorBox className = { value && ! themeColor . current ? styles . selectedColor : "" } >
226
225
< Tooltip content = { < span > Color picker</ span > } placement = "bottom" >
227
226
< Color
228
- className = { value && ! themeColor . current ? styles . selectedColor : "" }
229
227
style = { { backgroundColor : themeColor . current ? "#fff" : value } }
230
228
onClick = { togglePicker }
231
229
>
0 commit comments