mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-14 11:53:49 +00:00
1849b4d39f
* chore: migrate eslint to oxlint * chore: migrate prettier to oxfmt * chore: migrate typescript * chore: toThrow should have a expected value * chore: cast test value as Day * chore: small title fix * chore: mocks should be hoisted * chore: incorrect async useage * chore: test should be inside description * chore: test sohuld include an expeced * chore: oxfmt --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
25 lines
782 B
TypeScript
25 lines
782 B
TypeScript
import { Popover } from '@base-ui/react/popover';
|
|
import { PropsWithChildren } from 'react';
|
|
import { HexAlphaColorPicker, HexColorInput } from 'react-colorful';
|
|
|
|
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>
|
|
);
|
|
}
|