"use client";
import * as React from "react";
import * as DialogP from "@radix-ui/react-dialog";
import * as PopoverP from "@radix-ui/react-popover";
import * as TooltipP from "@radix-ui/react-tooltip";
import * as DropdownP from "@radix-ui/react-dropdown-menu";
import * as SwitchP from "@radix-ui/react-switch";
import * as TabsP from "@radix-ui/react-tabs";
import { X } from "lucide-react";
import { cn } from "@/lib/utils";
export const Dialog = DialogP.Root; export const DialogTrigger = DialogP.Trigger; export const DialogClose = DialogP.Close;
export function DialogContent({ className, children, title, description, wide, ...p }: DialogP.DialogContentProps & { title?: React.ReactNode; description?: React.ReactNode; wide?: boolean }) {
return (
{title && {title}}
{description ? {description} : Dialog}
{children}
);
}
export const Popover = PopoverP.Root; export const PopoverTrigger = PopoverP.Trigger; export const PopoverAnchor = PopoverP.Anchor;
export function PopoverContent({ className, align = "start", sideOffset = 6, ...p }: PopoverP.PopoverContentProps) {
return ;
}
export function Tip({ children, label, side = "bottom" }: { children: React.ReactNode; label: React.ReactNode; side?: "top" | "bottom" | "left" | "right" }) {
return (
{children}
{label}
);
}
export const Menu = DropdownP.Root; export const MenuTrigger = DropdownP.Trigger; export const MenuSeparator = (p: any) => ;
export function MenuContent({ className, align = "end", ...p }: DropdownP.DropdownMenuContentProps) {
return ;
}
export function MenuItem({ className, danger, ...p }: DropdownP.DropdownMenuItemProps & { danger?: boolean }) {
return ;
}
export function Switch(p: SwitchP.SwitchProps) {
return ;
}
export const Tabs = TabsP.Root; export const TabsContent = TabsP.Content;
export function TabsList({ className, ...p }: TabsP.TabsListProps) { return ; }
export function TabsTrigger({ className, ...p }: TabsP.TabsTriggerProps) { return ; }
export function Badge({ className, tone = "neutral", children }: { className?: string; tone?: "neutral" | "accent" | "ai" | "success" | "warning" | "danger"; children: React.ReactNode }) {
const tones = { neutral: "bg-bg-sunk text-fg-muted border-line", accent: "bg-accent-soft text-accent border-accent/20", ai: "bg-ai-soft text-ai border-ai/20", success: "bg-success/10 text-success border-success/20", warning: "bg-warning/15 text-warning border-warning/30", danger: "bg-danger/10 text-danger border-danger/20" };
return {children};
}
export function Kbd({ children }: { children: React.ReactNode }) { return {children}; }
export function Spinner({ className }: { className?: string }) { return ; }
export function Empty({ icon, title, hint, action }: { icon?: React.ReactNode; title: string; hint?: string; action?: React.ReactNode }) {
return
{icon}
{title}
{hint &&
{hint}
}{action &&
{action}
}
;
}