1 | import * as React from 'react';
|
2 | import { Animated, GestureResponderEvent, StyleProp, View, ViewStyle } from 'react-native';
|
3 | import CardActions from './CardActions';
|
4 | import CardContent from './CardContent';
|
5 | import CardCover from './CardCover';
|
6 | import CardTitle from './CardTitle';
|
7 | import type { $Omit, ThemeProp } from '../../types';
|
8 | import Surface from '../Surface';
|
9 | type OutlinedCardProps = {
|
10 | mode: 'outlined';
|
11 | elevation?: never;
|
12 | };
|
13 | type ElevatedCardProps = {
|
14 | mode?: 'elevated';
|
15 | elevation?: number;
|
16 | };
|
17 | type ContainedCardProps = {
|
18 | mode?: 'contained';
|
19 | elevation?: never;
|
20 | };
|
21 | type Mode = 'elevated' | 'outlined' | 'contained';
|
22 | export type Props = $Omit<React.ComponentProps<typeof Surface>, 'mode'> & {
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | mode?: Mode;
|
30 | |
31 |
|
32 |
|
33 | children: React.ReactNode;
|
34 | |
35 |
|
36 |
|
37 | onLongPress?: () => void;
|
38 | |
39 |
|
40 |
|
41 | onPress?: (e: GestureResponderEvent) => void;
|
42 | |
43 |
|
44 |
|
45 | onPressIn?: (e: GestureResponderEvent) => void;
|
46 | |
47 |
|
48 |
|
49 | onPressOut?: (e: GestureResponderEvent) => void;
|
50 | |
51 |
|
52 |
|
53 | delayLongPress?: number;
|
54 | |
55 |
|
56 |
|
57 | disabled?: boolean;
|
58 | |
59 |
|
60 |
|
61 | elevation?: 0 | 1 | 2 | 3 | 4 | 5 | Animated.Value;
|
62 | |
63 |
|
64 |
|
65 | contentStyle?: StyleProp<ViewStyle>;
|
66 | style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
67 | |
68 |
|
69 |
|
70 | theme?: ThemeProp;
|
71 | |
72 |
|
73 |
|
74 | testID?: string;
|
75 | |
76 |
|
77 |
|
78 | accessible?: boolean;
|
79 | };
|
80 | declare const Card: import("../../utils/forwardRef").ForwardRefComponent<View, (OutlinedCardProps | ElevatedCardProps | ContainedCardProps) & $Omit<Omit<import("../Surface").Props, "ref"> & React.RefAttributes<View>, "mode"> & {
|
81 | |
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | mode?: Mode | undefined;
|
88 | |
89 |
|
90 |
|
91 | children: React.ReactNode;
|
92 | |
93 |
|
94 |
|
95 | onLongPress?: (() => void) | undefined;
|
96 | /**
|
97 | * Function to execute on press.
|
98 | */
|
99 | onPress?: ((e: GestureResponderEvent) => void) | undefined;
|
100 | /**
|
101 | * Function to execute as soon as the touchable element is pressed and invoked even before onPress.
|
102 | */
|
103 | onPressIn?: ((e: GestureResponderEvent) => void) | undefined;
|
104 | /**
|
105 | * Function to execute as soon as the touch is released even before onPress.
|
106 | */
|
107 | onPressOut?: ((e: GestureResponderEvent) => void) | undefined;
|
108 | /**
|
109 | * The number of milliseconds a user must touch the element before executing `onLongPress`.
|
110 | */
|
111 | delayLongPress?: number | undefined;
|
112 | /**
|
113 | * If true, disable all interactions for this component.
|
114 | */
|
115 | disabled?: boolean | undefined;
|
116 | /**
|
117 | * Changes Card shadow and background on iOS and Android.
|
118 | */
|
119 | elevation?: 0 | 3 | 2 | 1 | 4 | 5 | Animated.Value | undefined;
|
120 | /**
|
121 | * Style of card's inner content.
|
122 | */
|
123 | contentStyle?: StyleProp<ViewStyle>;
|
124 | style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
|
125 | /**
|
126 | * @optional
|
127 | */
|
128 | theme?: ThemeProp | undefined;
|
129 | /**
|
130 | * Pass down testID from card props to touchable
|
131 | */
|
132 | testID?: string | undefined;
|
133 | /**
|
134 | * Pass down accessible from card props to touchable
|
135 | */
|
136 | accessible?: boolean | undefined;
|
137 | }> & {
|
138 | Content: typeof CardContent;
|
139 | Actions: typeof CardActions;
|
140 | Cover: typeof CardCover;
|
141 | Title: typeof CardTitle;
|
142 | };
|
143 | export default Card;
|
144 | //# sourceMappingURL=Card.d.ts.map |
\ | No newline at end of file |