import React from 'react'; import type { PositionMountNode } from '@instructure/ui-position'; import type { TextDirectionContextConsumerProps } from '@instructure/ui-i18n'; import type { ComponentStyle, WithStyleProps } from '@instructure/emotion'; import type { DrawerLayoutTrayTheme, LiveRegion, OtherHTMLAttributes, UIElement } from '@instructure/shared-types'; import type { BaseTransitionStatesType, TransitionType } from '@instructure/ui-motion'; type DrawerTrayPlacement = 'start' | 'end'; type DrawerLayoutTrayOwnProps = { label: string; children?: React.ReactNode | (() => React.ReactNode); render?: () => React.ReactNode; /** * Placement of the `` */ placement?: DrawerTrayPlacement; /** * If the tray is open or closed. */ open?: boolean; /** * Called when the `` is opened */ onOpen?: (transitionType?: TransitionType) => void; /** * Called when the `` is closed */ onClose?: (transitionType?: TransitionType) => void; /** * Should the `` have a border */ border?: boolean; /** * Should the `` have a shadow */ shadow?: boolean; /** * Ref function for the `` content */ contentRef?: (element: HTMLDivElement | null) => void; /** * An element or a function returning an element to use as the mount node * for the `` when tray is overlaying content */ mountNode?: PositionMountNode; } & PropsPassedToDialog & PropsPassedToTransition & TextDirectionContextConsumerProps; type PropsPassedToDialog = { /** * An element or a function returning an element to focus by default */ defaultFocusElement?: UIElement; /** * An element, function returning an element, or array of elements that will not be hidden from * the screen reader when the `` is open */ liveRegion?: LiveRegion; /** * Event fired when the underlying FocusRegion is dismissed in overlay mode. * This can happen if: * - `shouldCloseOnDocumentClick` is `true` and the user * clicks outside the `` * - If `shouldCloseOnEscape` is `true` and the user presses the ESC key. * * This should be used to close the `` in these cases */ onDismiss?: (event: React.UIEvent | React.FocusEvent, documentClick?: boolean) => void; shouldContainFocus?: boolean; shouldReturnFocus?: boolean; shouldCloseOnDocumentClick?: boolean; /** * Should the `` close when ESC is pressed. * Note that it will only close if it's in the overlay mode (if there is * less space for the content than `DrawerLayout.props.minWidth`) */ shouldCloseOnEscape?: boolean; }; type PropsPassedToTransition = { /** * Callback fired when the `` transitions in/out */ onTransition?: (toState: BaseTransitionStatesType, fromState: BaseTransitionStatesType) => void; /** * Callback fired before the `` transitions in */ onEnter?: () => void; /** * Callback fired as the `` begins to transition in */ onEntering?: () => void; /** * Callback fired after the `` finishes transitioning in */ onEntered?: (type?: TransitionType) => void; /** * Callback fired right before the `` transitions out */ onExit?: () => void; /** * Callback fired as the `` begins to transition out */ onExiting?: () => void; /** * Callback fired after the `` finishes transitioning out */ onExited?: (type?: TransitionType) => void; }; type DrawerLayoutTrayState = { transitioning: boolean; portalOpen: boolean; }; type DrawerLayoutTrayStyleProps = { placement: DrawerTrayPlacement; }; type PropKeys = keyof DrawerLayoutTrayOwnProps; type AllowedPropKeys = Readonly>; type DrawerLayoutTrayProps = DrawerLayoutTrayOwnProps & WithStyleProps & OtherHTMLAttributes; type DrawerLayoutTrayStyle = ComponentStyle<'drawerTray' | 'drawerTrayWithShadow' | 'drawerTrayContent'>; declare const allowedProps: AllowedPropKeys; export type { DrawerLayoutTrayProps, DrawerLayoutTrayState, DrawerLayoutTrayStyle, DrawerLayoutTrayStyleProps, DrawerTrayPlacement }; export { allowedProps }; //# sourceMappingURL=props.d.ts.map