import "./choice_strip.css"; import type * as React from "react"; import { type RadioGroupProps } from "@base-ui/react/radio-group"; import { type IconName } from "./icon"; import type { ColorName } from "./color_tokens"; import { type StyleProps } from "./style_props"; import { type InkColor } from "./text_ink"; export interface ChoiceStripOption { label: string; value: T; /** * For a set differing in kind (payment methods, channels), where the glyph is read faster than * words. Decoration on a set whose labels already differ plainly. Never icon-only: the label * stays readable aloud. */ icon?: IconName; /** * Defaults to the label's colour; give a role when the icon carries a meaning the label does not. */ iconColor?: InkColor; /** * A prop, never formatted into `label`, where it goes stale and cannot be styled apart. An option * stating a count should filter to those rows. */ count?: number; /** * The same vocabulary as `Status variant="dot"`, so a filter and its rows agree on a state's * colour. Status only; exclusive with `icon`. Never on `segmented`, which is a choice: a dot there * reads as the value's badge. */ status?: ColorName; /** Printed only: which strip a digit answers belongs to the surface that owns the keyboard. */ shortcut?: string; testID?: string; } /** A segmented cell is words (or a glyph) alone: the chosen cell is the choice, so no dot previews a badge. */ export type ChoiceStripSegment = Omit, "status"> & { status?: never; }; interface ChoiceStripBase extends StyleProps { /** It renders no visible label. */ accessibilityLabel: string; /** The view shown; a filter models "All" as an option. */ value: T; onValueChange: (value: T) => void; disabled?: boolean; /** Drawn dim, holding their width, so moving keys never resize cells under the reader's hand. */ shortcutsIdle?: boolean; testID?: string; ref?: React.Ref; render?: RadioGroupProps["render"]; } /** 2–4 cells in one recessed track — a parameter of the view. Where its box cannot seat every cell, it folds * into a select showing the chosen one: it never runs past its box. */ interface ChoiceStripSegmentedProps extends ChoiceStripBase { variant?: "segmented"; /** Above ~4, cells stop fitting. */ options: ChoiceStripSegment[]; overflow?: never; } /** * Big one-tap cells in a grid for an answer given once, where the press is the whole act. Labels * wrap rather than clip. */ interface ChoiceStripTilesProps extends ChoiceStripBase { variant: "tiles"; options: ChoiceStripOption[]; overflow?: never; } /** Pills, so the set may be longer and labels may carry counts. */ interface ChoiceStripChipsProps extends ChoiceStripBase { variant: "chips"; options: ChoiceStripOption[]; /** * `"wrap"` (default) keeps every option on screen, the reason to pick chips over a `Select`. * `"scroll"` suits a hot filter above a register: six statuses wrap to three rows (136px) at * 390px, one row costs 40. Chosen by the job, not the width. */ overflow?: "wrap" | "scroll"; } export type ChoiceStripProps = ChoiceStripSegmentedProps | ChoiceStripChipsProps | ChoiceStripTilesProps; /** * ONE of N, every option on screen: a Base UI Radio Group, so roving tabindex, `aria-checked` and * the WAI-ARIA radio keys are its. `segmented` (default) is a few-way mode switch, folding into a * select where its box cannot seat its cells; `chips` a hot filter or short form select that may carry * counts, dots or glyphs; `tiles` an answer the press gives. Independent booleans are `ToggleStrip`; * swapping the view is `Tabs`; past a phone row, `Select`. */ export declare function ChoiceStrip(props: ChoiceStripProps): React.JSX.Element; export {};