1 | import * as React from 'react';
|
2 | import { ColorValue, GestureResponderEvent, PressableAndroidRippleConfig, StyleProp, TextStyle, ViewStyle } from 'react-native';
|
3 | import type { ThemeProp, MD3TypescaleKey } from '../../types';
|
4 | export type Props = {
|
5 | /**
|
6 | * Status of checkbox.
|
7 | */
|
8 | status: 'checked' | 'unchecked' | 'indeterminate';
|
9 | /**
|
10 | * Whether checkbox is disabled.
|
11 | */
|
12 | disabled?: boolean;
|
13 | /**
|
14 | * Label to be displayed on the item.
|
15 | */
|
16 | label: string;
|
17 | /**
|
18 | * Function to execute on press.
|
19 | */
|
20 | onPress?: (e: GestureResponderEvent) => void;
|
21 | /**
|
22 | * Function to execute on long press.
|
23 | */
|
24 | onLongPress?: (e: GestureResponderEvent) => void;
|
25 | /**
|
26 | * Type of background drawabale to display the feedback (Android).
|
27 | * https://reactnative.dev/docs/pressable#rippleconfig
|
28 | */
|
29 | background?: PressableAndroidRippleConfig;
|
30 | /**
|
31 | * Accessibility label for the touchable. This is read by the screen reader when the user taps the touchable.
|
32 | */
|
33 | accessibilityLabel?: string;
|
34 | /**
|
35 | * Custom color for unchecked checkbox.
|
36 | */
|
37 | uncheckedColor?: string;
|
38 | /**
|
39 | * Custom color for checkbox.
|
40 | */
|
41 | color?: string;
|
42 | /**
|
43 | * Color of the ripple effect.
|
44 | */
|
45 | rippleColor?: ColorValue;
|
46 | /**
|
47 | * Additional styles for container View.
|
48 | */
|
49 | style?: StyleProp<ViewStyle>;
|
50 | /**
|
51 | * Specifies the largest possible scale a label font can reach.
|
52 | */
|
53 | labelMaxFontSizeMultiplier?: number;
|
54 | /**
|
55 | * Style that is passed to Label element.
|
56 | */
|
57 | labelStyle?: StyleProp<TextStyle>;
|
58 | /**
|
59 | * @supported Available in v5.x with theme version 3
|
60 | *
|
61 | * Label text variant defines appropriate text styles for type role and its size.
|
62 | * Available variants:
|
63 | *
|
64 | * Display: `displayLarge`, `displayMedium`, `displaySmall`
|
65 | *
|
66 | * Headline: `headlineLarge`, `headlineMedium`, `headlineSmall`
|
67 | *
|
68 | * Title: `titleLarge`, `titleMedium`, `titleSmall`
|
69 | *
|
70 | * Label: `labelLarge`, `labelMedium`, `labelSmall`
|
71 | *
|
72 | * Body: `bodyLarge`, `bodyMedium`, `bodySmall`
|
73 | */
|
74 | labelVariant?: keyof typeof MD3TypescaleKey;
|
75 | /**
|
76 | * @optional
|
77 | */
|
78 | theme?: ThemeProp;
|
79 | /**
|
80 | * testID to be used on tests.
|
81 | */
|
82 | testID?: string;
|
83 | /**
|
84 | * Checkbox control position.
|
85 | */
|
86 | position?: 'leading' | 'trailing';
|
87 | /**
|
88 | * Whether `<Checkbox.Android />` or `<Checkbox.IOS />` should be used.
|
89 | * Left undefined `<Checkbox />` will be used.
|
90 | */
|
91 | mode?: 'android' | 'ios';
|
92 | };
|
93 | /**
|
94 | * Checkbox.Item allows you to press the whole row (item) instead of only the Checkbox.
|
95 | *
|
96 | * ## Usage
|
97 | * ```js
|
98 | * import * as React from 'react';
|
99 | * import { View } from 'react-native';
|
100 | * import { Checkbox } from 'react-native-paper';
|
101 | *
|
102 | * const MyComponent = () => (
|
103 | * <View>
|
104 | * <Checkbox.Item label="Item" status="checked" />
|
105 | * </View>
|
106 | * );
|
107 | *
|
108 | * export default MyComponent;
|
109 | *```
|
110 | */
|
111 | declare const CheckboxItem: {
|
112 | ({ style, status, label, onPress, onLongPress, labelStyle, theme: themeOverrides, testID, mode, position, accessibilityLabel, disabled, labelVariant, labelMaxFontSizeMultiplier, rippleColor, background, ...props }: Props): React.JSX.Element;
|
113 | displayName: string;
|
114 | };
|
115 | export default CheckboxItem;
|
116 | export { CheckboxItem };
|
117 | //# sourceMappingURL=CheckboxItem.d.ts.map |
\ | No newline at end of file |