feat: update schema, add ProjectCard, readme

This commit is contained in:
enscribe 2024-09-13 15:18:47 -07:00
parent fbeab5a744
commit b93eddea6b
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
24 changed files with 373 additions and 72 deletions

View file

@ -25,12 +25,14 @@ const badgeVariants = cva(
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}
VariantProps<typeof badgeVariants> {
showHash?: boolean
}
function Badge({ className, variant, ...props }: BadgeProps) {
function Badge({ className, variant, showHash = true, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props}>
<Hash className="size-3 -translate-x-0.5" />
{showHash && <Hash className="size-3 -translate-x-0.5" />}
{props.children}
</div>
)

View file

@ -7,7 +7,7 @@ const Card = React.forwardRef<
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn('bg-card text-card-foreground rounded-xl border', className)}
className={cn('bg-background rounded-xl border', className)}
{...props}
/>
))

View file

@ -23,7 +23,16 @@ export function ModeToggle() {
theme === 'dark' ||
(theme === 'system' &&
window.matchMedia('(prefers-color-scheme: dark)').matches)
document.documentElement.classList.add('disable-transitions')
document.documentElement.classList[isDark ? 'add' : 'remove']('dark')
window.getComputedStyle(document.documentElement).getPropertyValue('opacity')
requestAnimationFrame(() => {
document.documentElement.classList.remove('disable-transitions')
})
}, [theme])
return (
@ -56,4 +65,4 @@ export function ModeToggle() {
</DropdownMenuContent>
</DropdownMenu>
)
}
}