File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 11import type { ComponentPropsWithoutRef } from 'react'
22import { forwardRef , useId , useState } from 'react'
3- import { HexColorPicker } from 'react-colorful'
3+ import { HexColorPicker , HexColorInput } from 'react-colorful'
44import { cx } from 'class-variance-authority'
55import ClickAwayListener from 'react-click-away-listener'
66import {
@@ -96,13 +96,23 @@ export const ColorPicker = forwardRef<HTMLDivElement, ColorPickerProps>(
9696 < div
9797 className = { cx (
9898 'absolute border border-gray-400 p-1 -mt-8 ml-8 bg-gray-200 rounded-lg z-10' ,
99- displayColorpicker ? 'flex' : 'hidden'
99+ displayColorpicker ? 'flex flex-col ' : 'hidden'
100100 ) }
101101 >
102+ < style > { `.react-colorful__last-control { border-radius: 0; }` } </ style >
102103 < HexColorPicker
103104 color = { String ( value ) }
104105 onChange = { ( color ) => updateColor ( color ) }
105106 />
107+ < div className = "flex items-center justify-center p-2 bg-white border-t border-gray-300" >
108+ < span className = "text-gray-600 mr-2" > #</ span >
109+ < HexColorInput
110+ color = { String ( value ) }
111+ onChange = { ( color ) => updateColor ( color ) }
112+ className = "w-24 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:border-blue-500"
113+ placeholder = "000000"
114+ />
115+ </ div >
106116 </ div >
107117 </ ClickAwayListener >
108118 </ div >
You can’t perform that action at this time.
0 commit comments