add keyframe popover

add shadcn ui stuff
This commit is contained in:
2023-05-31 16:59:43 +02:00
parent e3098c4400
commit ebb2408a68
13 changed files with 671 additions and 1815 deletions

View File

@@ -0,0 +1,31 @@
import { PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
import { Popover } from "components/Popover";
import { Keyframe } from "primitives/Keyframe";
import { FC } from "react";
import { z } from "zod";
const KeyframePopover: FC<{
open: boolean;
keyframe: z.input<typeof Keyframe>;
onUpdate: (k: z.input<typeof Keyframe>) => void;
}> = ({ open, keyframe, onUpdate }) => {
return (
<div>
<Popover open={open}>
<PopoverContent>
<label>
<span className="label">Value</span>
<input
onChange={(e) =>
onUpdate({ ...keyframe, value: Number(e.target.value) })
}
value={keyframe.value}
/>
</label>
</PopoverContent>
</Popover>
</div>
);
};
export default KeyframePopover;