UNPKG

@enact/sandstone

Version:

Large-screen/TV support library for Enact, containing a variety of UI components.

60 lines (51 loc) 1.81 kB
// Type definitions for sandstone/RadioItem import { ToggleableProps as ui_Toggleable_ToggleableProps } from "@enact/ui/Toggleable"; import { ItemProps as sandstone_Item_ItemProps } from "@enact/sandstone/Item"; import * as React from "react"; type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N; export interface RadioItemBaseProps extends sandstone_Item_ItemProps {} /** * An item component with a radio toggle icon. * * This component is most often not used directly but may be composed within another component as it is within . */ export class RadioItemBase extends React.Component< Merge<React.HTMLProps<HTMLElement>, RadioItemBaseProps> > {} export interface RadioItemProps extends Merge<RadioItemBaseProps, RadioItemDecoratorProps> { /** * Customizes the component by mapping the supplied collection of CSS class names to the corresponding internal elements and states of this component. * * The following classes are supported: * * `radioItem` - The root class name */ css?: object; /** * The icon to display when selected. */ icon?: string; /** * If true it will be selected. */ selected?: boolean; /** * Nodes to be inserted after the radio button and before `children` . */ slotBefore?: React.ReactNode; } /** * Renders an `Item` with a radio-dot component. Useful to show a selected state on an Item. */ export class RadioItem extends React.Component< Merge<React.HTMLProps<HTMLElement>, RadioItemProps> > {} export interface RadioItemDecoratorProps extends ui_Toggleable_ToggleableProps {} export function RadioItemDecorator<P>( Component: React.ComponentType<P> | string, ): React.ComponentType<P & RadioItemDecoratorProps>; export default RadioItem;