Files
simple-react-app-kit/packages/appearance/docs/sandboxes/theme-toggle/AccentPicker.tsx
T

31 lines
692 B
TypeScript
Raw Normal View History

2026-09-21 17:09:54 +08:00
import {
ThemeColorPicker,
accentColorSwatches,
2026-09-29 21:29:49 +08:00
type ThemeColorPickerVariant,
2026-09-21 17:09:54 +08:00
} from "@workspace/appearance/components/theme-color-picker"
import type { ThemeColorConfig } from "@workspace/appearance/theme"
export function AccentPicker({
config,
onConfigChange,
title,
2026-09-29 21:29:49 +08:00
variant,
2026-09-21 17:09:54 +08:00
}: {
config: ThemeColorConfig
onConfigChange: (config: ThemeColorConfig) => void
title: string
2026-09-29 21:29:49 +08:00
variant?: ThemeColorPickerVariant
2026-09-21 17:09:54 +08:00
}) {
return (
<ThemeColorPicker
title={title}
2026-09-21 17:09:54 +08:00
swatches={accentColorSwatches}
value={config.accentColor}
2026-09-29 21:29:49 +08:00
variant={variant}
2026-09-21 17:09:54 +08:00
onValueChange={(accentColor) =>
onConfigChange({ ...config, accentColor })
}
/>
)
}