@prosperitainova/dumbo-react-native
Version:
Dumbo for React Native Library
51 lines • 2.11 kB
TypeScript
import React from 'react';
import { GestureResponderEvent, PressableProps, StyleProp, ViewStyle } from 'react-native';
import { TooltipProps } from '../Tooltip';
export declare const checkboxRadioBaseStyle: {
paddingTop: number;
paddingBottom: number;
minWidth: number;
flexDirection: "row";
alignContent: "flex-start";
};
/** Props for Checkbox and Radio component */
export type CheckboxRadioProps = {
/** Text to render */
label: string;
/** ID of item (any identifier to identify the checkbox) */
id: string;
/** Indicate if checked */
checked: boolean;
/** Indicate if disabled */
disabled?: boolean;
/** Indicate if label should be hidden (label is used for accessibility even when hidden) */
hideLabel?: boolean;
/** onPress event returns the current value and ID of the item */
onPress: (value: boolean, id: string, event: GestureResponderEvent) => void;
/** onLongPress event returns the ID of the item (value is not changed) */
onLongPress?: (id: string, event: GestureResponderEvent) => void;
/** Text to use for checkbox (accessibility). Defaults to ENGLISH "Checkbox"/"Radio button" depending on use */
accessibleText?: string;
/** Tooltip props to show at the end of the text */
tooltipProps?: TooltipProps;
/** Style to set on the item */
style?: StyleProp<ViewStyle>;
/** Style to set on the checkbox wrapper */
wrapperStyle?: StyleProp<ViewStyle>;
/** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */
componentProps?: PressableProps;
};
/**
* Checkbox component for rendering a checkbox
*
* {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/Checkbox.tsx | Example code}
*/
export declare class Checkbox extends React.Component<CheckboxRadioProps> {
private get styles();
private get textStyle();
private get checkbox();
private onPress;
private onLongPress;
render(): React.ReactNode;
}
//# sourceMappingURL=index.d.ts.map