mirror of
https://github.com/MeshEnvy/mesh-forge.git
synced 2026-06-15 11:24:47 +02:00
32 lines
966 B
TypeScript
32 lines
966 B
TypeScript
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
|
import * as React from 'react'
|
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
const Popover = PopoverPrimitive.Root
|
|
|
|
const PopoverTrigger = PopoverPrimitive.Trigger
|
|
|
|
const PopoverAnchor = PopoverPrimitive.Anchor
|
|
|
|
const PopoverContent = React.forwardRef<
|
|
React.ComponentRef<typeof PopoverPrimitive.Content>,
|
|
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
|
>(({ className, align = 'start', sideOffset = 4, ...props }, ref) => (
|
|
<PopoverPrimitive.Portal>
|
|
<PopoverPrimitive.Content
|
|
ref={ref}
|
|
align={align}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
'z-50 w-72 rounded-md border border-slate-700 bg-slate-900 p-0 text-slate-200 shadow-lg outline-none',
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
</PopoverPrimitive.Portal>
|
|
))
|
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
|
|
|
export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger }
|