import "./comments_button.css"; import type * as React from "react"; import { Button as Base } from "@base-ui/react/button"; import { type StyleProps, type TriggerProps } from "./style_props"; export interface CommentsButtonProps extends StyleProps, TriggerProps { /** How many comments the thread holds. Render the button only where there ARE * some — see the note on zero below. */ count: number; /** What the thread is about — the record's name. It only reaches the accessible * label, which is where a screen-reader user needs it: "3 comments on Northwind * Packaging" is a destination, "3 comments" on the fortieth row is not. */ subject?: string; /** Open the discussion. A count the reader cannot act on states that a * conversation exists and leaves them to find it. */ onPress?: (event: React.MouseEvent) => void; /** `sm` (the register row's) or `md`. Matches `CopyButton`'s scale so the two * affordances a row carries sit at one size. */ size?: "sm" | "md"; /** Override the wording; otherwise the locale's. `withSubject` builds the whole * phrase from the counted noun and the subject, so an override changes the word * ORDER too, not just the words. */ labels?: { comments?: string; comment?: string; withSubject?: (counted: string, subject: string) => string; }; disabled?: boolean; testID?: string; ref?: React.Ref; render?: Base.Props["render"]; } /** * A row's DISCUSSION — the count, the bubble, and the way in. * * Reach for it wherever a record is listed and its thread would otherwise be * invisible until opened: a register row, a card, a compact header. It is the * peer of `CopyButton` — the other thing a dense row lets you press — and shares * its surface, its scale and its focus ring, so a row carrying both reads as one * grammar rather than two authors. * * **ONE control, not a number beside a button.** The count and the glyph are the * same target: the number IS what the reader aims at ("three comments" is the * thing they saw), and splitting them leaves half the affordance dead under the * pointer. It was briefly an `IconButton` with the count as loose text — which * gave the glyph a hover state and the number none. * * **Full ink.** Everything else on a register row is a value ABOUT the record; * this is people talking about it, and it is the one thing on the row that can be * UNREAD. Muted, it files itself with the phone number. * * **Render it only when `count > 0`.** A zero on every quiet row is a column of * noise that trains the eye to skip exactly where the signal will appear. The * component does not decide that for you — an empty-state row may legitimately * want a way to START a thread — but a register should not. */ export declare function CommentsButton(props: CommentsButtonProps): React.JSX.Element;