/** * @license * Copyright 2026 Aglyn LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type ChipProps } from '@mui/material'; import { type Theme } from '@mui/material/styles'; /** * A picture across the top of an {@link OptionCard} (AGL-3898): a real * example of the choice, at a fixed size so the grid does not shift while it * loads, and loaded lazily, since a grid of them is mostly below the fold. */ export interface OptionCardImage { src: string; /** What the picture shows, for a reader who cannot see it. */ alt: string; width: number; height: number; } /** * A short fact about a choice, drawn as a small chip under its line: a price, * who made it, how many pages it has. Theme colors only; the label is read * with the card's name, so a chip is never the only place a fact is said. */ export interface OptionCardChip { label: string; /** A theme palette color; `default` when absent. */ color?: ChipProps['color']; /** `outlined` when absent. */ variant?: 'filled' | 'outlined'; } /** One choice in an {@link OptionCardGrid}. */ export interface OptionCard { id: T; title: string; description?: string; /** An SVG path, such as an MDI icon's. */ icon?: string; /** A picture of the choice, drawn above its title. */ image?: OptionCardImage; /** Facts drawn as chips under its line, in this order. */ chips?: readonly OptionCardChip[]; } /** * What a card is called for assistive technology: its title, its line after a * colon, and its chips in parentheses — every word the card shows, since the * card is one control and its name is all a screen reader says of it. */ export declare function optionCardLabel(option: Pick): string; export interface OptionCardGridProps { /** What the group is, for assistive technology. */ label: string; options: readonly OptionCard[]; /** The selected option, or `null` for none. */ value: T | null; onChange: (value: T) => void; /** Columns at each breakpoint. */ columns?: { xs?: number; sm?: number; md?: number; }; /** `data-*` attributes for the grid's root, such as a page's own marker for where clicks land. */ [data: `data-${string}`]: string | undefined; } /** * How an option card sits on the page around it (AGL-3985). A grid of them is * often drawn on a dialog's gray, where a transparent card with a divider * outline melted into the page, so each card is: * * - a surface of its own, `background.paper`; * - outlined as strongly as an outlined field (the text color at 23%, the * border MUI's OutlinedInput draws), the text color on hover; * - once picked, outlined 2px in the primary color, from a 1px ring laid * outside its 1px border so the grid never shifts, with a check in a disc * at its top corner ({@link OptionCardCheck}); * - ringed in the primary color while it has the keyboard's focus. * * Theme values only, so it reads the same in light and dark mode. */ export declare function optionCardSx(selected: boolean): (theme: Theme) => { position: "relative"; borderRadius: number; bgcolor: string; borderColor: string; boxShadow: string; transition: string; '&:hover': { borderColor: string; }; '&:has(.Mui-focusVisible)': { outline: string; outlineOffset: string; }; }; /** The check a picked card carries in its top corner: over its picture, or beside its words. */ export declare function OptionCardCheck(): import("react").JSX.Element; /** * A grid of cards to pick one from (AGL-3660): a radio group drawn as cards, * each with an icon or a picture (AGL-3898), a title, a line under it and any * facts as chips under that (AGL-4049), which its accessible name reads too. Each * card is a surface with an outline that reads on a gray page, its title in * the text color and its line in the secondary text color, both at AA on the * card (AGL-3985). The picked card is outlined 2px in the primary color and * carries a check; the arrow keys move between cards and pick, as a radio * group's do, only the picked card is in the tab order, and the focused card * is ringed. */ export declare function OptionCardGrid({ label, options, value, onChange, columns, ...rest }: OptionCardGridProps): import("react").JSX.Element; export default OptionCardGrid;