Deutsche Oberfläche, Hell und Dunkel über next-themes, Navigation mit Rollenfilter und die shadcn-Primitiven, die M1 braucht. Der Farbschema-Knopf kommt ohne Effekt und ohne Zustand aus: welches Symbol gilt, entscheidet die dark-Klasse und damit CSS. next-themes setzt sie schon vor der Hydratation, deshalb blitzt nichts auf — und die React-Compiler-Regel gegen setState im Effekt bleibt eingehalten. Farben als OKLCH, damit Hell und Dunkel dieselbe wahrgenommene Helligkeit halten. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
27 lines
566 B
TypeScript
27 lines
566 B
TypeScript
'use client'
|
|
|
|
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
function Separator({
|
|
className,
|
|
orientation = 'horizontal',
|
|
decorative = true,
|
|
...rest
|
|
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
return (
|
|
<SeparatorPrimitive.Root
|
|
decorative={decorative}
|
|
orientation={orientation}
|
|
className={cn(
|
|
'bg-rand shrink-0',
|
|
orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',
|
|
className,
|
|
)}
|
|
{...rest}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export { Separator }
|