mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
e1e8410ba4
migrate pin page migrate copy tag migrate pin input migrate dropdown menus migrate radio buttons migrate switch migrate select migrate textarea migrate colour picker migrate select migrate context menu migrate viewparams remove chakra
25 lines
793 B
TypeScript
25 lines
793 B
TypeScript
import { PropsWithChildren } from 'react';
|
|
import { HexAlphaColorPicker, HexColorInput } from 'react-colorful';
|
|
import { Popover } from '@base-ui-components/react/popover';
|
|
|
|
import PopoverContents from '../../popover/Popover';
|
|
|
|
import style from './PopoverPicker.module.scss';
|
|
|
|
interface PopoverPickerProps {
|
|
color: string;
|
|
onChange: (color: string) => void;
|
|
}
|
|
|
|
export default function PopoverPicker({ color, onChange, children }: PropsWithChildren<PopoverPickerProps>) {
|
|
return (
|
|
<Popover.Root>
|
|
<Popover.Trigger>{children}</Popover.Trigger>
|
|
<PopoverContents>
|
|
<HexAlphaColorPicker color={color} onChange={onChange} />
|
|
<HexColorInput color={color} onChange={onChange} className={style.input} prefixed />
|
|
</PopoverContents>
|
|
</Popover.Root>
|
|
);
|
|
}
|