mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
## Problem Our `<Button>` component breaks the default `button` contract by redefining the `type` prop to set its variant (`primary`, `default`, etc) instead of the button type (`submit`, `button`, etc). This is confusing and forces to write more code when using it with shadcn components that expect/inject the standard button props. ## Solution - rename the `type` prop to `variant` - rename the `htmlType` prop to `type` - propagate the changes where necessary - format code ## How to test As this is just prop renaming, if it builds it's ok --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { CalendarDays } from 'lucide-react'
|
||
import {
|
||
Avatar,
|
||
AvatarFallback,
|
||
AvatarImage,
|
||
Button,
|
||
HoverCard,
|
||
HoverCardContent,
|
||
HoverCardTrigger,
|
||
} from 'ui'
|
||
|
||
export default function HoverCardDemo() {
|
||
return (
|
||
<HoverCard>
|
||
<HoverCardTrigger asChild>
|
||
<Button variant="link">@nextjs</Button>
|
||
</HoverCardTrigger>
|
||
<HoverCardContent className="w-80">
|
||
<div className="flex justify-between space-x-4">
|
||
<Avatar>
|
||
<AvatarImage src="https://github.com/vercel.png" />
|
||
<AvatarFallback>VC</AvatarFallback>
|
||
</Avatar>
|
||
<div className="space-y-1">
|
||
<h4 className="text-sm font-semibold">@nextjs</h4>
|
||
<p className="text-sm">The React Framework – created and maintained by @vercel.</p>
|
||
<div className="flex items-center pt-2">
|
||
<CalendarDays className="mr-2 h-4 w-4 opacity-70" />{' '}
|
||
<span className="text-xs text-muted-foreground">Joined December 2021</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</HoverCardContent>
|
||
</HoverCard>
|
||
)
|
||
}
|