import React from 'react'; import type { ModalProps, PressableProps, StyleProp, ViewStyle } from 'react-native'; import type { PinningDirection } from '@coinbase/cds-common/types/BoxBaseProps'; import type { SharedAccessibilityProps } from '@coinbase/cds-common/types/SharedAccessibilityProps'; import type { SharedProps } from '@coinbase/cds-common/types/SharedProps'; import { type HandleBarProps } from '../handlebar/HandleBar'; export type DrawerRenderChildren = (args: { handleClose: () => void }) => React.ReactNode; export type DrawerRefBaseProps = { /** ref callback that animates out the drawer */ handleClose: () => void; }; export type DrawerBaseProps = SharedProps & Pick & Omit & { /** Component to render as the Modal content */ children?: DrawerRenderChildren | React.ReactNode; /** * Pin the modal to one side of the screen * @default bottom * */ pin?: PinningDirection; /** * Prevents a user from dismissing the drawer by pressing the overlay or swiping */ preventDismissGestures?: boolean; /** * Prevents a user from dismissing the drawer by pressing hardware back button on Android */ preventHardwareBackBehaviorAndroid?: boolean; /** * The HandleBar can be rendered inside or outside the drawer, when pinned to bottom. * @default 'outside' * @note The 'outside' variant is deprecated. Use 'inside' for new implementations. */ handleBarVariant?: HandleBarProps['variant']; /** * The HandleBar by default only is used for a bottom pinned drawer. This removes it. * */ hideHandleBar?: boolean; /** Action that will happen when drawer is dismissed */ onCloseComplete: () => void; /** * Prevents the Drawer from capturing pan gestures on children. Set to true when using a ScrollView as a child * @default false */ disableCapturePanGestureToDismiss?: boolean; /** Callback fired when the overlay is pressed, or swipe to close */ onBlur?: () => void; /** * Allow user of component to define maximum percentage of screen that can be taken up by the Drawer * @example if you want a Drawer to take up 50% of the screen, you would pass a value of `0.5` */ verticalDrawerPercentageOfView?: number; /** * Accessibility label for handlebar * @example This is a handlebar, double tap to dismiss the tray. */ handleBarAccessibilityLabel?: string; /** * StickyFooter to be rendered at bottom of Drawer * @deprecated Use TrayStickyFooter as a Tray child instead. This will be removed in a future major release. * @deprecationExpectedRemoval v9 */ stickyFooter?: DrawerRenderChildren | React.ReactNode; /** * When true, the drawer opens and closes with an opacity fade instead of * a slide animation. Swipe-to-dismiss gestures remain enabled and use * the slide transform so the drawer follows the user's finger naturally. */ reduceMotion?: boolean; /** Callback fired when the open animation completes. */ onOpenComplete?: () => void; /** * disable safe area padding for bottom of drawer when true */ disableSafeAreaPaddingBottom?: boolean; }; export type DrawerProps = DrawerBaseProps & { styles?: { /** Root container element */ root?: StyleProp; /** Overlay backdrop element */ overlay?: StyleProp; /** Animated sliding container element */ container?: StyleProp; /** Handle bar container element */ handleBar?: PressableProps['style']; /** Handle bar indicator element */ handleBarHandle?: StyleProp; /** Drawer content wrapper element */ drawer?: StyleProp; }; }; export declare const Drawer: React.MemoExoticComponent< ({ ref, ..._props }: DrawerProps & { ref?: React.Ref; }) => import('react/jsx-runtime').JSX.Element >; //# sourceMappingURL=Drawer.d.ts.map