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.
| The site is built from its shared components: one Button with its variants and sizes, one Badge, Card for every panel, Alert for notices, Kbd for keys, Table for the security tables, and Avatar, Command, Progress, ScrollArea, ToggleGroup, Collapsible and Accordion in the kit; raw buttons, hand-drawn cards and pills and per-file button class lists are gone, outline buttons stand the same height as filled ones, and the phone's Ask g1t loses its tile. Every page was compared pixel by pixel before and after. | 1 | import { Collapsible as Primitive } from "radix-ui"; |
| 2 | import type { ComponentProps } from "react"; | |
| 3 | ||
| 4 | import { cn } from "../../lib/cn"; | |
| 5 | ||
| 6 | // shadcn/ui's collapsible, styled with g1t's tokens: a region that opens | |
| 7 | // and closes under a trigger, for a panel whose state a page controls | |
| 8 | // (`open`/`onOpenChange`). A disclosure that should work before the page | |
| 9 | // hydrates, such as a section of a long form, stays a native <details>. | |
| 10 | ||
| 11 | export const Collapsible = Primitive.Root; | |
| 12 | ||
| 13 | export function CollapsibleTrigger({ className, ...props }: ComponentProps<typeof Primitive.Trigger>) { | |
| 14 | return ( | |
| 15 | <Primitive.Trigger | |
| 16 | data-slot="collapsible-trigger" | |
| 17 | className={cn("group/collapsible inline-flex items-center gap-1.5 text-sm text-muted outline-none hover:text-fg focus-visible:ring-2 focus-visible:ring-accent [&_svg]:transition-transform data-[state=open]:[&_svg]:rotate-90", className)} | |
| 18 | {...props} | |
| 19 | /> | |
| 20 | ); | |
| 21 | } | |
| 22 | ||
| 23 | export function CollapsibleContent({ className, ...props }: ComponentProps<typeof Primitive.Content>) { | |
| 24 | return <Primitive.Content data-slot="collapsible-content" className={cn("outline-none", className)} {...props} />; | |
| 25 | } |