260703_01_FST: First Commit
This commit is contained in:
32
.tooling/components/ui/popover.tsx
Normal file
32
.tooling/components/ui/popover.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { HTMLAttributes, ReactNode } from "react";
|
||||
import { renderAsChild } from "@/lib/as-child";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export interface PopoverProps {
|
||||
open?: boolean;
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
modal?: boolean;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function Popover({ children }: PopoverProps) {
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
export function PopoverTrigger({
|
||||
asChild,
|
||||
children,
|
||||
...props
|
||||
}: HTMLAttributes<HTMLElement> & { asChild?: boolean }) {
|
||||
return renderAsChild(asChild, children, props);
|
||||
}
|
||||
|
||||
export interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {
|
||||
align?: "start" | "center" | "end";
|
||||
side?: "top" | "right" | "bottom" | "left";
|
||||
sideOffset?: number;
|
||||
}
|
||||
|
||||
export function PopoverContent({ className, align, side, sideOffset, ...props }: PopoverContentProps) {
|
||||
return <div data-align={align} data-side={side} className={cn(className)} {...props} />;
|
||||
}
|
||||
Reference in New Issue
Block a user