import React from 'react' import { Tooltip } from '../shared/Tooltip' import { fs } from '../shared/DialogShell' /** * A fact on a stop's second line: what it is in the quiet ink (an icon or a word), then * the figure. The day plan's white pill, the one its transports wear for their times, so * a stop and the ride beside it carry their facts the same way. * * One component because the shell had been typed out six times, the stay, the walk, the * fill-up, the two findings and the limits button each carrying their own copy, and the * copies had started to drift. */ const TONES = { neutral: { lead: 'text-content-faint', value: 'text-content-secondary' }, warning: { lead: 'text-warning', value: 'text-warning' }, /** A confirmed booking: the word in the success colour, the figure plain. */ success: { lead: 'text-success', value: 'text-content-secondary' }, /** A booking still pending: the word in the warning colour, the figure plain. */ pending: { lead: 'text-warning', value: 'text-content-secondary' }, } as const // White with a light shadow and a hairline, so it still stands off the white card it sits on. const PILL = 'inline-flex h-[20px] flex-none items-center gap-1 self-start whitespace-nowrap rounded-full bg-surface-card px-2 font-geist font-normal leading-none tabular-nums shadow-sm ring-1 ring-inset ring-edge-faint' interface FigureBadgeProps { /** An icon, or a word (`caption`). */ lead: React.ReactNode /** The figure. Absent draws the lead alone, a badge that is only a sign. */ value?: React.ReactNode tone?: 'neutral' | 'warning' | 'success' | 'pending' tooltip?: string /** The lead is a word rather than an icon, set in capitals like the day plan's phase pills. */ caption?: boolean /** The figure in the quiet ink: an invitation, or a value inherited rather than set. */ faint?: boolean valueSize?: 'label' | 'micro' /** May give up width to the pills beside it, its words cut short rather than wrapping the row. */ shrink?: boolean dir?: 'ltr' /** * Makes the badge the control that changes its figure. A span with the button role, not * a