UNPKG

@attio/react-native-bottom-sheet-toolbox

Version:
74 lines 2.91 kB
import * as React from "react"; import { type SharedValue } from "react-native-reanimated"; import type { SheetPosition } from "./utils"; import { type BottomSheetToolboxSheetProps } from "./components"; import { type BottomSheetToolboxActions } from "./hooks"; export interface BottomSheetToolboxComposerProps { /** * The contents of the bottom-sheet. */ children: React.ReactNode; /** * The positions we want the bottom sheet to snap to. */ snapPoints: readonly SheetPosition[]; /** * By default, the snapPoints you provide will be offset by the height of the * keyboard. This prop allows you to disable that behavior. */ disableSnapPointKeyboardAdjust?: boolean; /** * Where should the bottom-sheet initially snap to once it is ready? */ initialSnapPointIndex: number; /** * The top inset to apply to the wrapper of our bottom-sheet. * This can be used to keep a portion of the backdrop always visible. */ insetTop?: number; /** * A component that lives alongside and behind the wrapper (and sheet). */ backdropComponent?: React.ReactNode; /** * A component that lives within the bottom-sheet wrapper, but outside and above the sheet itself. */ overlayComponent?: React.ReactNode; /** * Called when the sheet's current position changes snap-point. */ onSnapChange?: (currentSnapIndex: number, lastSnapIndex: number | null) => void; /** * Called when the sheet is closed. */ onClose?: () => void; /** * The style of the bottom-sheet. */ sheetStyle?: BottomSheetToolboxSheetProps["style"]; /** * Should the entire sheet be draggable? */ disableSheetDrag?: boolean; /** * Internally, the bottom sheet is considered ready once the snap-points * are all not null and children/wrapper layout measurements have occurred. * However, sometimes the consumer may want to extend this to include * additional checks. This prop allows you to do that. */ additionalIsReady?: SharedValue<boolean> | boolean; /** * Called when the ready state changes. */ onReadyChange?: (ready: boolean) => void; /** * Ref object for the component. */ ref?: React.ForwardedRef<BottomSheetToolboxComposerRef> | undefined; } export type BottomSheetToolboxComposerRef = BottomSheetToolboxActions; /** * A general-purpose composer of all our bottom sheet utilities. */ export declare function BottomSheetToolboxComposer({ children, snapPoints, initialSnapPointIndex, insetTop: outerInsetTop, backdropComponent, overlayComponent, onSnapChange, onClose, sheetStyle, disableSheetDrag, disableSnapPointKeyboardAdjust, additionalIsReady, onReadyChange, ref, }: BottomSheetToolboxComposerProps): React.JSX.Element; //# sourceMappingURL=bottom-sheet-toolbox-composer.d.ts.map