1 | import { type HTMLInputProps } from "../../common/props";
|
2 | import { type CardProps } from "../card/card";
|
3 | import type { CheckedControlProps, ControlProps } from "../forms/controlProps";
|
4 | export type ControlKind = "switch" | "checkbox" | "radio";
|
5 | /**
|
6 | * Subset of {@link CardProps} which can be used to adjust its behavior.
|
7 | */
|
8 | type SupportedCardProps = Omit<CardProps, "interactive" | "onChange">;
|
9 | /**
|
10 | * Subset of {@link ControlProps} which can be used to adjust its behavior.
|
11 | */
|
12 | type SupportedControlProps = Pick<ControlProps, keyof CheckedControlProps | "alignIndicator" | "disabled" | "inputRef" | "label" | "value">;
|
13 | /**
|
14 | * Shared props interface for all control card components, including `CheckboxCard`, `RadioCard`, and `SwitchCard`.
|
15 | * The label content may be specified as either `label` or `children`, but not both.
|
16 | */
|
17 | export interface ControlCardProps extends SupportedCardProps, SupportedControlProps {
|
18 | /**
|
19 | * Which kind of form control to render inside the card.
|
20 | */
|
21 | controlKind: ControlKind;
|
22 | /**
|
23 | * HTML input attributes to forward to the control `<input>` element.
|
24 | */
|
25 | inputProps?: HTMLInputProps;
|
26 | /**
|
27 | * Whether the component should use "selected" Card styling when checked.
|
28 | *
|
29 | * @default true
|
30 | */
|
31 | showAsSelectedWhenChecked?: boolean;
|
32 | }
|
33 | export {};
|