flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/apps/web/app/components/ui/popover.tsx

33 lines1,045 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Workspace names and icons, and a component kit for every control1import { Popover as Primitive } from "radix-ui";
2import type { ComponentProps } from "react";
3
4import { cn } from "../../lib/cn";
5
6// shadcn/ui's popover, styled with g1t's tokens.
7
8export const Popover = Primitive.Root;
9export const PopoverTrigger = Primitive.Trigger;
10export const PopoverAnchor = Primitive.Anchor;
11export const PopoverClose = Primitive.Close;
12
13export function PopoverContent({
14 className,
15 align = "center",
16 sideOffset = 6,
17 ...props
18}: ComponentProps<typeof Primitive.Content>) {
19 return (
20 <Primitive.Portal>
21 <Primitive.Content
22 align={align}
23 sideOffset={sideOffset}
24 className={cn(
25 "z-50 w-72 max-w-[calc(100vw-2rem)] rounded-lg border border-line-strong bg-raised p-4 text-sm text-fg shadow-xl shadow-black/40 outline-none",
26 "origin-(--radix-popover-content-transform-origin) data-[state=open]:animate-pop-in data-[state=closed]:animate-pop-out motion-reduce:animate-none",
27 className,
28 )}
29 {...props}
30 />
31 </Primitive.Portal>
32 );
33}