···55 export const buttonGroup = tv({
66 base: "inline-flex items-center",
77 variants: {
88- // joined groups are the segmented control from Figma, built the way the appview's
99- // .btn-group is: the group alone draws the outer border and the recessed surface,
1010- // its segments drop their own top/bottom border entirely (border-y-0) and stretch
1111- // to fill the inner box. that matters because a segment's y-border is the same
1212- // token as the group's, so keeping both stacks two 1px lines into one 2px-looking
1313- // edge above and below the selected segment. horizontally the segments keep their
1414- // border and it's pulled onto the neighbour's (-ml-px) so each seam collapses to a
1515- // single divider, and the outer ones onto the group's own edge.
1616- //
1717- // the recessed surface has to stay darker than the selected segment's
1818- // bg-background-default, and no single token does that in both modes — subtle is
1919- // below default in light (#f9fafb vs #fff) but above it in dark (#374151 vs
2020- // #1f2937) — so dark falls back to canvas (#111827), i.e. the appview's gray-900.
218 spaced: {
229 true: "gap-2",
2310 false: [
2424- "items-stretch gap-0 rounded-sm border border-border-default bg-background-subtle dark:bg-background-canvas",
1111+ "items-stretch gap-0 rounded-sm overflow-hidden border border-border-default bg-background-subtle dark:bg-background-canvas",
2512 "*:relative *:border-y-0",
2613 "[&>*:first-child]:-ml-px [&>*:last-child]:-mr-px",
2714 "[&>*:not(:first-child)]:-ml-px [&>*:not(:first-child)]:[--btn-radius-l:0px]",
···37243825 export type ButtonGroupVariants = VariantProps<typeof buttonGroup>;
39264040- /**
4141- * Recipe for using ButtonGroup as a tab/segment switcher (e.g. Open/Closed issue filters,
4242- * Write/Preview editor tabs). Per Figma, the selected segment reads as a raised, lighter
4343- * surface (`default` + its inset shadow) while unselected segments are flat `ghost`
4444- * buttons — never the plain `default` variant, which reads as the *hovered* state of an
4545- * unselected segment. Figma also gives an unselected segment the same foreground as a
4646- * selected one, where `ghost` on its own is muted, so the recipe overrides the colour
4747- * here rather than changing `ghost` everywhere it's used.
4848- */
4927 export function segmentProps(selected: boolean): {
5028 variant: ButtonVariants["variant"];
5129 insetShadow: boolean;