hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiBdcf123aBurak Boduroğlu2 months ago674 commits
| 1 | import { Popover as PopoverPrimitive } from "@kobalte/core/popover"; |
| 2 | import type { ComponentProps, ValidComponent } from "solid-js"; |
| 3 | import { splitProps } from "solid-js"; |
| 4 | import { cn } from "@/lib/cn"; |
| 5 | |
| 6 | export const Popover = PopoverPrimitive; |
| 7 | export const PopoverTrigger = PopoverPrimitive.Trigger; |
| 8 | export const PopoverAnchor = PopoverPrimitive.Anchor; |
| 9 | |
| 10 | export function PopoverContent<T extends ValidComponent = "div">( |
| 11 | props: ComponentProps<typeof PopoverPrimitive.Content<T>>, |
| 12 | ) { |
| 13 | const [local, rest] = splitProps(props as ComponentProps<typeof PopoverPrimitive.Content>, [ |
| 14 | "class", |
| 15 | ]); |
| 16 | return ( |
| 17 | <PopoverPrimitive.Portal> |
| 18 | <PopoverPrimitive.Content |
| 19 | class={cn( |
| 20 | "z-[70] w-72 rounded-md border border-border/80 bg-popover p-4 text-popover-foreground shadow-xl shadow-black/10 outline-hidden", |
| 21 | "origin-(--kb-popover-content-transform-origin) animate-in fade-in-0 zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", |
| 22 | local.class, |
| 23 | )} |
| 24 | {...rest} |
| 25 | /> |
| 26 | </PopoverPrimitive.Portal> |
| 27 | ); |
| 28 | } |