"""Stub file for reflex/components/radix/primitives/drawer.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `reflex/utils/pyi_generator.py`! # ------------------------------------------------------ from typing import Any, Literal, Optional, Sequence, overload from reflex.components.component import ComponentNamespace from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.event import EventType from reflex.style import Style from reflex.vars.base import Var class DrawerComponent(RadixPrimitiveComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerComponent": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... LiteralDirectionType = Literal["top", "bottom", "left", "right"] class DrawerRoot(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, default_open: Var[bool] | bool | None = None, open: Var[bool] | bool | None = None, modal: Var[bool] | bool | None = None, direction: Literal["bottom", "left", "right", "top"] | Var[Literal["bottom", "left", "right", "top"]] | None = None, dismissible: Var[bool] | bool | None = None, handle_only: Var[bool] | bool | None = None, snap_points: Sequence[float | str] | None = None, fade_from_index: Var[int] | int | None = None, scroll_lock_timeout: Var[int] | int | None = None, prevent_scroll_restoration: Var[bool] | bool | None = None, should_scale_background: Var[bool] | bool | None = None, close_threshold: Var[float] | float | None = None, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_animation_end: Optional[EventType[()] | EventType[bool]] = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_open_change: Optional[EventType[()] | EventType[bool]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerRoot": """Create the component. Args: *children: The children of the component. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state. open: Whether the drawer is open or not. on_open_change: Fires when the drawer is opened or closed. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"` on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer. handle_only: When `True`, dragging will only be possible by the handle. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms prevent_scroll_restoration: When `True`, it prevents scroll restoration. Defaults to `True`. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background. close_threshold: Number between 0 and 1 that determines when the drawer should be closed. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class DrawerTrigger(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerTrigger": """Create a new DrawerTrigger instance. Args: *children: The children of the element. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The properties of the element. Returns: The new DrawerTrigger instance. """ ... class DrawerPortal(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerPortal": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class DrawerContent(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_close_auto_focus: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_escape_key_down: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_interact_outside: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_open_auto_focus: Optional[EventType[()]] = None, on_pointer_down_outside: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerContent": """Create a Drawer Content. We wrap the Drawer content in an `rx.theme` to make radix themes definitions available to rendered div in the DOM. This is because Vaul Drawer injects the Drawer overlay content in a sibling div to the root div rendered by radix which contains styling definitions. Wrapping in `rx.theme` makes the styling available to the overlay. Args: *children: The list of children to use. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: Additional properties to apply to the drawer content. Returns: The drawer content. """ ... class DrawerOverlay(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerOverlay": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class DrawerClose(DrawerTrigger): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerClose": """Create a new DrawerTrigger instance. Args: *children: The children of the element. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The properties of the element. Returns: The new DrawerTrigger instance. """ ... class DrawerTitle(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerTitle": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class DrawerDescription(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerDescription": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class DrawerHandle(DrawerComponent): @overload @classmethod def create( # type: ignore cls, *children, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerHandle": """Create the component. Args: *children: The children of the component. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... class Drawer(ComponentNamespace): root = staticmethod(DrawerRoot.create) trigger = staticmethod(DrawerTrigger.create) portal = staticmethod(DrawerPortal.create) content = staticmethod(DrawerContent.create) overlay = staticmethod(DrawerOverlay.create) close = staticmethod(DrawerClose.create) title = staticmethod(DrawerTitle.create) description = staticmethod(DrawerDescription.create) handle = staticmethod(DrawerHandle.create) @staticmethod def __call__( *children, default_open: Var[bool] | bool | None = None, open: Var[bool] | bool | None = None, modal: Var[bool] | bool | None = None, direction: Literal["bottom", "left", "right", "top"] | Var[Literal["bottom", "left", "right", "top"]] | None = None, dismissible: Var[bool] | bool | None = None, handle_only: Var[bool] | bool | None = None, snap_points: Sequence[float | str] | None = None, fade_from_index: Var[int] | int | None = None, scroll_lock_timeout: Var[int] | int | None = None, prevent_scroll_restoration: Var[bool] | bool | None = None, should_scale_background: Var[bool] | bool | None = None, close_threshold: Var[float] | float | None = None, as_child: Var[bool] | bool | None = None, style: Style | None = None, key: Any | None = None, id: Any | None = None, class_name: Any | None = None, autofocus: bool | None = None, custom_attrs: dict[str, Var | Any] | None = None, on_animation_end: Optional[EventType[()] | EventType[bool]] = None, on_blur: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None, on_mouse_leave: Optional[EventType[()]] = None, on_mouse_move: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None, on_open_change: Optional[EventType[()] | EventType[bool]] = None, on_scroll: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None, **props, ) -> "DrawerRoot": """Create the component. Args: *children: The children of the component. default_open: The open state of the drawer when it is initially rendered. Use when you do not need to control its open state. open: Whether the drawer is open or not. on_open_change: Fires when the drawer is opened or closed. modal: When `False`, it allows interaction with elements outside of the drawer without closing it. Defaults to `True`. direction: Direction of the drawer. This adjusts the animations and the drag direction. Defaults to `"bottom"` on_animation_end: Gets triggered after the open or close animation ends, it receives an open argument with the open state of the drawer by the time the function was triggered. dismissible: When `False`, dragging, clicking outside, pressing esc, etc. will not close the drawer. Use this in combination with the open prop, otherwise you won't be able to open/close the drawer. handle_only: When `True`, dragging will only be possible by the handle. snap_points: Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account. fade_from_index: Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point. scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms prevent_scroll_restoration: When `True`, it prevents scroll restoration. Defaults to `True`. should_scale_background: Enable background scaling, it requires container element with `vaul-drawer-wrapper` attribute to scale its background. close_threshold: Number between 0 and 1 that determines when the drawer should be closed. as_child: Change the default rendered element for the one passed as a child. style: The style of the component. key: A unique key for the component. id: The id for the component. class_name: The class name for the component. autofocus: Whether the component should take the focus once the page is loaded custom_attrs: custom attribute **props: The props of the component. Returns: The component. """ ... drawer = Drawer()