import "./toggle_strip.css"; import type * as React from "react"; import { CheckboxGroup } from "@base-ui/react/checkbox-group"; import { type StyleProps } from "./style_props"; /** Two characters at `xs` with air, which is what a weekday initial, an hour * band or a channel letter needs when the cell prints one. */ export declare const TOGGLE_STRIP_CELL_WIDTH = 30; /** The MARK variant's cell: the register band. A column of these IS a register's * cell, and a register cell's whole box is the press target — at 30 × 28 it was * under the floor in both directions. */ export declare const TOGGLE_STRIP_MARK_CELL_WIDTH = 40; export interface ToggleStripOption { value: T; /** What the cell SHOWS — one or two characters ("T2", "CN", "08"). */ label: string; /** What a screen reader says instead. Required, because a two-letter cell * announces as nonsense: seven "T2" switches in a table are told apart only * by voice, and the label is not a name. */ name: string; } export interface ToggleStripProps extends StyleProps { /** Names the SET — "Ngày chạy của nốt 05:30". Every cell's own name is * prefixed with it, so a register of these strips is navigable by voice. */ accessibilityLabel: string; /** The fixed positions, in reading order. They do not move with the data — * the whole point is that position N means the same thing on every row. */ options: ToggleStripOption[]; /** The values that are ON. */ value: T[]; onValueChange: (next: T[]) => void; /** * Refuse to turn the LAST cell off. * * For a set where empty is not a neutral state but a DIFFERENT reading — a * schedule with no day is not a schedule, and where the empty set already * means "every day" the two readings would silently swap. The held cell wears * the disabled treatment so the floor is visible rather than a press that * does nothing. */ minOne?: boolean; disabled?: boolean; /** * `label` (default) prints each option's one or two letters in a chip — the * strip stands alone, in a field or a lone row, and names its own positions. * `mark` draws a bare square instead, for a COLUMN of strips whose positions * a header names once (`Timetable`): the same seven letters on every row were * twenty-eight labels for four facts. */ variant?: "label" | "mark"; /** The position the reader is standing in — today's weekday. Its cell is * tinted so a column of strips shows the day as a band. */ current?: T; /** Cell width. Raise it for three-character labels; the strip's own width is * {@link toggleStripWidth}, which a table column budgets against. Defaults to * {@link TOGGLE_STRIP_CELL_WIDTH}, or the register band on `variant="mark"`. */ cellWidth?: number; testID?: string; ref?: React.Ref; render?: CheckboxGroup.Props["render"]; } /** * A COMPACT MULTI-TOGGLE — N fixed cells, each independently on or off, sized * to sit inside a register row rather than on a control band. * * The subject is a PATTERN across fixed positions: which days a departure runs, * which hours a gate is open, which channels a notice goes out on. What makes it * its own component rather than a `ChoiceStrip` is that the positions are fixed and * the reading is VERTICAL — a column of these strips has to let the eye run down * position 3 and see the shape of the week. Chips wrap and re-flow, which is * right for a filter band and destroys exactly that. * * It is also not `ChoiceStrip`: that is one choice among peers (a * radiogroup); this is N independent booleans, so it is a Base UI * `CheckboxGroup` and each cell announces `role="checkbox"` with its own * `aria-checked`. * * **The selected treatment is the chip's**, not a ground of its own. A filled * brand ground was the obvious answer and is the wrong one twice over: a ground * is the ROW's language and these are controls, so the two altitudes end up * saying the same thing in the same paint; and it spends the brand on a * selection, which then has to be walked back everywhere at once. Seven ON cells * per row also made the primary button on the same screen the twenty-third copy * of its own ground. The doubled `--primary` edge is the kit's one answer to * "which one is on", and it survives the hover wash instead of being replaced * by it. * * Height is the control CONTENT rung, not the control height: this rides inside * a row or a field, where 40 is the box and 28 is what the box may seat. */ export declare function ToggleStrip(props: ToggleStripProps): React.JSX.Element; /** The width the strip occupies, so a table column can be budgeted for it * EXACTLY. A column guessed at is a column the fit sheds for the wrong reason. */ export declare function toggleStripWidth(count: number, cellWidth?: number): number;