mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 20:11:08 +00:00
* docs: design terminal host management * feat: add work-surface host editor state * feat: add work-surface host editor layer * feat: add host creation and edit menu actions * feat: expose host management from terminal tree * feat: edit hosts without leaving terminal * fix: keep host editor subpanels interactive * fix: keep terminal host toolbar unchanged * chore: exclude internal design notes from PR * fix: preserve terminal host editor state * fix: harden terminal host editor interactions * fix: fully hide inactive host editor --------- Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
36 lines
1.3 KiB
TypeScript
36 lines
1.3 KiB
TypeScript
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
import * as React from "react"
|
|
|
|
import { cn } from "../../lib/utils"
|
|
import { usePortalContainer } from "./portal-container"
|
|
|
|
const TooltipProvider = TooltipPrimitive.Provider
|
|
|
|
const Tooltip = TooltipPrimitive.Root
|
|
|
|
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
|
|
const TooltipContent = React.forwardRef<
|
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
>(({ className, sideOffset = 4, ...props }, ref) => {
|
|
const portalContainer = usePortalContainer()
|
|
|
|
return (
|
|
<TooltipPrimitive.Portal container={portalContainer ?? undefined}>
|
|
<TooltipPrimitive.Content
|
|
ref={ref}
|
|
sideOffset={sideOffset}
|
|
className={cn(
|
|
"z-[999999] overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
</TooltipPrimitive.Portal>
|
|
)
|
|
})
|
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
|
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }
|