1 | import * as React from 'react';
|
2 | import { ViewStyle, StyleProp, TextStyle, GestureResponderEvent } from 'react-native';
|
3 | declare type Props = {
|
4 | /**
|
5 | * Title text for the list accordion.
|
6 | */
|
7 | title: React.ReactNode;
|
8 | /**
|
9 | * Description text for the list accordion.
|
10 | */
|
11 | description?: React.ReactNode;
|
12 | /**
|
13 | * Callback which returns a React element to display on the left side.
|
14 | */
|
15 | left?: (props: {
|
16 | color: string;
|
17 | }) => React.ReactNode;
|
18 | /**
|
19 | * Callback which returns a React element to display on the right side.
|
20 | */
|
21 | right?: (props: {
|
22 | isExpanded: boolean;
|
23 | }) => React.ReactNode;
|
24 | /**
|
25 | * Whether the accordion is expanded
|
26 | * If this prop is provided, the accordion will behave as a "controlled component".
|
27 | * You'll need to update this prop when you want to toggle the component or on `onPress`.
|
28 | */
|
29 | expanded?: boolean;
|
30 | /**
|
31 | * Function to execute on press.
|
32 | */
|
33 | onPress?: () => void;
|
34 | /**
|
35 | * Function to execute on long press.
|
36 | */
|
37 | onLongPress?: (e: GestureResponderEvent) => void;
|
38 | /**
|
39 | * Content of the section.
|
40 | */
|
41 | children: React.ReactNode;
|
42 | /**
|
43 | * @optional
|
44 | */
|
45 | theme: ReactNativePaper.Theme;
|
46 | /**
|
47 | * Style that is passed to the wrapping TouchableRipple element.
|
48 | */
|
49 | style?: StyleProp<ViewStyle>;
|
50 | /**
|
51 | * Style that is passed to Title element.
|
52 | */
|
53 | titleStyle?: StyleProp<TextStyle>;
|
54 | /**
|
55 | * Style that is passed to Description element.
|
56 | */
|
57 | descriptionStyle?: StyleProp<TextStyle>;
|
58 | /**
|
59 | * Truncate Title text such that the total number of lines does not
|
60 | * exceed this number.
|
61 | */
|
62 | titleNumberOfLines?: number;
|
63 | /**
|
64 | * Truncate Description text such that the total number of lines does not
|
65 | * exceed this number.
|
66 | */
|
67 | descriptionNumberOfLines?: number;
|
68 | /**
|
69 | * Id is used for distinguishing specific accordion when using List.AccordionGroup. Property is required when using List.AccordionGroup and has no impact on behavior when using standalone List.Accordion.
|
70 | */
|
71 | id?: string | number;
|
72 | /**
|
73 | * TestID used for testing purposes
|
74 | */
|
75 | testID?: string;
|
76 | /**
|
77 | * Accessibility label for the TouchableRipple. This is read by the screen reader when the user taps the touchable.
|
78 | */
|
79 | accessibilityLabel?: string;
|
80 | };
|
81 | declare const _default: React.ComponentType<Pick<Props, "style" | "title" | "children" | "onPress" | "onLongPress" | "testID" | "accessibilityLabel" | "left" | "right" | "description" | "titleStyle" | "descriptionStyle" | "titleNumberOfLines" | "descriptionNumberOfLines" | "id" | "expanded"> & {
|
82 | theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
|
83 | }> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<Props> & {
|
84 | ({ left, right, title, description, children, theme, titleStyle, descriptionStyle, titleNumberOfLines, descriptionNumberOfLines, style, id, testID, onPress, onLongPress, expanded: expandedProp, accessibilityLabel, }: Props): JSX.Element;
|
85 | displayName: string;
|
86 | }, {}>;
|
87 | export default _default;
|