import { useState } from "react"; import type { Meta } from "@storybook/react-vite"; import { ColorPicker } from "./ColorPicker"; import { Color, type BrandPalette, defaultNamedColor, RawColor } from "./config"; import { getColorValue } from "./util"; const meta = { title: "Components/Color/ColorPicker", component: ColorPicker, } satisfies Meta; export default meta; const samplePalette: BrandPalette = { primary: "#ffca0a", secondary: "#3b82f6", tertiary: "#ec4899", text: "#323232", }; const refColor: RawColor = { type: "raw", hex: "#ffca0a", }; const Playbook = () => { const [value, setValue] = useState(defaultNamedColor); return ( <> ); }; export { Playbook as ColorPicker }; export const WithInherit = () => { const [value, setValue] = useState(defaultNamedColor); return ( <> ); }; function Info({ color }: { color: Color | null }) { return (
{color && ( <>
type
{color.type}
{color.type === "raw" ? ( <>
hex
{color.hex}
) : color.type === "named" ? ( <>
name
{color.name}
variant
{color.variant}
) : null}
preview
)}
); }