mirror of
https://github.com/hanzoai/shadcn.git
synced 2026-11-03 03:18:52 +00:00
Upstream sync from shadcn-ui/ui (1686 commits since last merge base). Key changes: - packages/shadcn upgraded to 4.1.0 (CLI font transformers, scaffold from github, chart colors) - apps/v4 replaces apps/www as the primary docs/registry app - Font system: 25+ heading font registries, font markers utility, @supports override - Chart improvements: recharts v3 compat, radial chart fixes - templates/ updated with monorepo variants (astro, vite, react-router, start) - skills/shadcn AI skill definitions added - deprecated/ removed (auth, auth-firebase, cli, www) Preserved Hanzo-only paths: app/, pkg/, demo/, docs/, template/next/
90 lines
2.0 KiB
TypeScript
90 lines
2.0 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { Popover as PopoverPrimitive } from "radix-ui"
|
|
|
|
import { cn } from "@/registry/bases/radix/lib/utils"
|
|
|
|
function Popover({
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
|
|
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
}
|
|
|
|
function PopoverTrigger({
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
|
|
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
}
|
|
|
|
function PopoverContent({
|
|
className,
|
|
align = "center",
|
|
sideOffset = 4,
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
|
|
return (
|
|
<PopoverPrimitive.Portal>
|
|
<PopoverPrimitive.Content
|
|
data-slot="popover-content"
|
|
align={align}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
"cn-popover-content z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
</PopoverPrimitive.Portal>
|
|
)
|
|
}
|
|
|
|
function PopoverAnchor({
|
|
...props
|
|
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
|
|
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
|
|
}
|
|
|
|
function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
return (
|
|
<div
|
|
data-slot="popover-header"
|
|
className={cn("cn-popover-header", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
|
|
return (
|
|
<div
|
|
data-slot="popover-title"
|
|
className={cn("cn-popover-title cn-font-heading", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function PopoverDescription({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<"p">) {
|
|
return (
|
|
<p
|
|
data-slot="popover-description"
|
|
className={cn("cn-popover-description", className)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export {
|
|
Popover,
|
|
PopoverAnchor,
|
|
PopoverContent,
|
|
PopoverDescription,
|
|
PopoverHeader,
|
|
PopoverTitle,
|
|
PopoverTrigger,
|
|
}
|