mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
- Updated lib/colors.ts to match shadcn v4 (added var field, fixed oklch wrapping) - Updated color.tsx with lastCopied state and improved UX - Updated color-palette.tsx (removed Suspense, updated styling) - Updated color-format-selector.tsx from shadcn v4 - Updated colors-nav.tsx from shadcn v4 - Updated use-colors hook with lastCopied state management - Updated lib/themes.ts to use explicit color scheme list (8 themes) All color palettes should now display correctly on /colors page
25 lines
841 B
TypeScript
25 lines
841 B
TypeScript
import { type ColorPalette } from "@/lib/colors"
|
|
import { Color } from "@/components/color"
|
|
import { ColorFormatSelector } from "@/components/color-format-selector"
|
|
|
|
export function ColorPalette({ colorPalette }: { colorPalette: ColorPalette }) {
|
|
return (
|
|
<div id={colorPalette.name} className="scroll-mt-20 rounded-lg">
|
|
<div className="flex items-center px-4">
|
|
<div className="flex-1 pl-1 text-sm font-medium">
|
|
<h2 className="capitalize">{colorPalette.name}</h2>
|
|
</div>
|
|
<ColorFormatSelector
|
|
color={colorPalette.colors[0]}
|
|
className="ml-auto"
|
|
/>
|
|
</div>
|
|
<div className="flex flex-col gap-4 py-4 sm:flex-row sm:gap-2">
|
|
{colorPalette.colors.map((color) => (
|
|
<Color key={color.hex} color={color} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|