@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
52 lines (51 loc) • 1.71 kB
TypeScript
import * as React from 'react';
import { ReactNode, SyntheticEvent } from 'react';
import { BoxProps } from '../Flex';
type Variant = 'default' | 'text-only';
type TypeProps = {
checked?: boolean;
as?: any;
name?: string;
value?: any;
onChange?: (checked: boolean, event?: SyntheticEvent | any) => void;
children?: ReactNode | React.JSX.Element;
gapDistance?: number;
childrenPosition?: 'start' | 'end';
variant?: Variant;
};
export interface RadioProps extends TypeProps, Omit<BoxProps, keyof TypeProps> {
tabIndex?: number;
id?: string;
disabled?: boolean;
className?: string;
style?: React.CSSProperties;
onClick?: React.MouseEventHandler<HTMLDivElement>;
onFocus?: React.FocusEventHandler<HTMLDivElement>;
}
export declare const useRadioContext: <T extends unknown>() => {
value: T;
onChange: (value: T) => void;
name: string;
variant: Variant;
};
declare const Radio: ({ children, checked, onChange, value, name, gapDistance, childrenPosition, as, id, tabIndex, disabled, ...props }: RadioProps) => React.JSX.Element;
export declare const RadioGroup: <T extends unknown>(props: {
orientation: "horizontal" | "vertical";
value?: T;
name?: string;
defaultValue?: T;
onRadioChange?: (value: T) => void;
className?: string;
children: React.ReactNode;
/**
* The variant of the radio group.
* @default 'default' - will show the radio button and the text
*
* 'text-only' - will show the text only and hide the radio button
*/
variant?: Variant;
}) => React.JSX.Element;
export declare const radioGroupStyling: {
horizontalTextOnly: string;
};
export default Radio;