UNPKG

12.4 kBTypeScriptView Raw
1import * as React from 'react';
2import { Animated, View, ViewStyle, StyleProp } from 'react-native';
3import Surface from '../../Surface';
4import type { $RemoveChildren } from '../../../types';
5import type { IconSource } from '../../Icon';
6import type { AccessibilityState } from 'react-native';
7export declare type AnimatedFABIconMode = 'static' | 'dynamic';
8export declare type AnimatedFABAnimateFrom = 'left' | 'right';
9declare type Props = $RemoveChildren<typeof Surface> & {
10 /**
11 * Icon to display for the `FAB`.
12 */
13 icon: IconSource;
14 /**
15 * Label for extended `FAB`.
16 */
17 label: string;
18 /**
19 * Make the label text uppercased.
20 */
21 uppercase?: boolean;
22 /**
23 * Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB.
24 * Uses `label` by default if specified.
25 */
26 accessibilityLabel?: string;
27 /**
28 * Accessibility state for the FAB. This is read by the screen reader when the user taps the FAB.
29 */
30 accessibilityState?: AccessibilityState;
31 /**
32 * Custom color for the icon and label of the `FAB`.
33 */
34 color?: string;
35 /**
36 * Whether `FAB` is disabled. A disabled button is greyed out and `onPress` is not called on touch.
37 */
38 disabled?: boolean;
39 /**
40 * Whether `FAB` is currently visible.
41 */
42 visible?: boolean;
43 /**
44 * Function to execute on press.
45 */
46 onPress?: () => void;
47 /**
48 * Function to execute on long press.
49 */
50 onLongPress?: () => void;
51 /**
52 * Whether icon should be translated to the end of extended `FAB` or be static and stay in the same place. The default value is `dynamic`.
53 */
54 iconMode?: AnimatedFABIconMode;
55 /**
56 * Indicates from which direction animation should be performed. The default value is `right`.
57 */
58 animateFrom?: AnimatedFABAnimateFrom;
59 /**
60 * Whether `FAB` should start animation to extend.
61 */
62 extended: boolean;
63 style?: StyleProp<ViewStyle>;
64 /**
65 * @optional
66 */
67 theme: ReactNativePaper.Theme;
68 testID?: string;
69};
70declare const _default: React.ComponentType<Pick<$RemoveChildren<React.ComponentType<Pick<import("react-native").ViewProps & React.RefAttributes<View> & {
71 children: React.ReactNode;
72 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
73 theme: ReactNativePaper.Theme;
74}, keyof import("react-native").ViewProps | keyof React.RefAttributes<View>> & {
75 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
76}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<import("react-native").ViewProps & React.RefAttributes<View> & {
77 children: React.ReactNode;
78 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
79 theme: ReactNativePaper.Theme;
80}> & (({ style, theme, ...rest }: import("react-native").ViewProps & React.RefAttributes<View> & {
81 children: React.ReactNode;
82 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
83 theme: ReactNativePaper.Theme;
84}) => JSX.Element), {}>> & {
85 /**
86 * Icon to display for the `FAB`.
87 */
88 icon: IconSource;
89 /**
90 * Label for extended `FAB`.
91 */
92 label: string;
93 /**
94 * Make the label text uppercased.
95 */
96 uppercase?: boolean | undefined;
97 /**
98 * Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB.
99 * Uses `label` by default if specified.
100 */
101 accessibilityLabel?: string | undefined;
102 /**
103 * Accessibility state for the FAB. This is read by the screen reader when the user taps the FAB.
104 */
105 accessibilityState?: AccessibilityState | undefined;
106 /**
107 * Custom color for the icon and label of the `FAB`.
108 */
109 color?: string | undefined;
110 /**
111 * Whether `FAB` is disabled. A disabled button is greyed out and `onPress` is not called on touch.
112 */
113 disabled?: boolean | undefined;
114 /**
115 * Whether `FAB` is currently visible.
116 */
117 visible?: boolean | undefined;
118 /**
119 * Function to execute on press.
120 */
121 onPress?: (() => void) | undefined;
122 /**
123 * Function to execute on long press.
124 */
125 onLongPress?: (() => void) | undefined;
126 /**
127 * Whether icon should be translated to the end of extended `FAB` or be static and stay in the same place. The default value is `dynamic`.
128 */
129 iconMode?: AnimatedFABIconMode | undefined;
130 /**
131 * Indicates from which direction animation should be performed. The default value is `right`.
132 */
133 animateFrom?: AnimatedFABAnimateFrom | undefined;
134 /**
135 * Whether `FAB` should start animation to extend.
136 */
137 extended: boolean;
138 style?: StyleProp<ViewStyle>;
139 /**
140 * @optional
141 */
142 theme: ReactNativePaper.Theme;
143 testID?: string | undefined;
144}, "label" | "style" | "pointerEvents" | "color" | "onLayout" | "onPress" | "onLongPress" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "icon" | "visible" | "key" | "hitSlop" | "removeClippedSubviews" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "uppercase" | "disabled" | "animateFrom" | "extended" | "iconMode"> & {
145 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
146}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<$RemoveChildren<React.ComponentType<Pick<import("react-native").ViewProps & React.RefAttributes<View> & {
147 children: React.ReactNode;
148 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
149 theme: ReactNativePaper.Theme;
150}, keyof import("react-native").ViewProps | keyof React.RefAttributes<View>> & {
151 theme?: import("@callstack/react-theme-provider").$DeepPartial<ReactNativePaper.Theme> | undefined;
152}> & import("@callstack/react-theme-provider/typings/hoist-non-react-statics").NonReactStatics<React.ComponentType<import("react-native").ViewProps & React.RefAttributes<View> & {
153 children: React.ReactNode;
154 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
155 theme: ReactNativePaper.Theme;
156}> & (({ style, theme, ...rest }: import("react-native").ViewProps & React.RefAttributes<View> & {
157 children: React.ReactNode;
158 style?: false | import("react-native").RegisteredStyle<ViewStyle> | Animated.Value | Animated.AnimatedInterpolation | Animated.WithAnimatedObject<ViewStyle> | Animated.WithAnimatedArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle> | import("react-native").RecursiveArray<ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>> | readonly (ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<ViewStyle>)[]> | null | undefined;
159 theme: ReactNativePaper.Theme;
160}) => JSX.Element), {}>> & {
161 /**
162 * Icon to display for the `FAB`.
163 */
164 icon: IconSource;
165 /**
166 * Label for extended `FAB`.
167 */
168 label: string;
169 /**
170 * Make the label text uppercased.
171 */
172 uppercase?: boolean | undefined;
173 /**
174 * Accessibility label for the FAB. This is read by the screen reader when the user taps the FAB.
175 * Uses `label` by default if specified.
176 */
177 accessibilityLabel?: string | undefined;
178 /**
179 * Accessibility state for the FAB. This is read by the screen reader when the user taps the FAB.
180 */
181 accessibilityState?: AccessibilityState | undefined;
182 /**
183 * Custom color for the icon and label of the `FAB`.
184 */
185 color?: string | undefined;
186 /**
187 * Whether `FAB` is disabled. A disabled button is greyed out and `onPress` is not called on touch.
188 */
189 disabled?: boolean | undefined;
190 /**
191 * Whether `FAB` is currently visible.
192 */
193 visible?: boolean | undefined;
194 /**
195 * Function to execute on press.
196 */
197 onPress?: (() => void) | undefined;
198 /**
199 * Function to execute on long press.
200 */
201 onLongPress?: (() => void) | undefined;
202 /**
203 * Whether icon should be translated to the end of extended `FAB` or be static and stay in the same place. The default value is `dynamic`.
204 */
205 iconMode?: AnimatedFABIconMode | undefined;
206 /**
207 * Indicates from which direction animation should be performed. The default value is `right`.
208 */
209 animateFrom?: AnimatedFABAnimateFrom | undefined;
210 /**
211 * Whether `FAB` should start animation to extend.
212 */
213 extended: boolean;
214 style?: StyleProp<ViewStyle>;
215 /**
216 * @optional
217 */
218 theme: ReactNativePaper.Theme;
219 testID?: string | undefined;
220}> & (({ icon, label, accessibilityLabel, accessibilityState, color: customColor, disabled, onPress, onLongPress, theme, style, visible, uppercase, testID, animateFrom, extended, iconMode, ...rest }: Props) => JSX.Element), {}>;
221export default _default;
222
\No newline at end of file