|
@@ -8,11 +8,18 @@ from reflex.vars import Var, BaseVar, ComputedVar
|
|
|
from reflex.event import EventChain, EventHandler, EventSpec
|
|
|
from reflex.style import Style
|
|
|
from types import SimpleNamespace
|
|
|
-from typing import Any, Dict, Literal
|
|
|
+from typing import Any, Dict, Literal, Union
|
|
|
from reflex.constants import EventTriggers
|
|
|
from reflex.vars import Var
|
|
|
from ..base import LiteralAccentColor, RadixThemesComponent
|
|
|
|
|
|
+LiteralDirType = Literal["ltr", "rtl"]
|
|
|
+LiteralSizeType = Literal["1", "2"]
|
|
|
+LiteralVariantType = Literal["solid", "soft"]
|
|
|
+LiteralSideType = Literal["top", "right", "bottom", "left"]
|
|
|
+LiteralAlignType = Literal["start", "center", "end"]
|
|
|
+LiteralStickyType = Literal["partial", "always"]
|
|
|
+
|
|
|
class DropdownMenuRoot(RadixThemesComponent):
|
|
|
def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
|
@overload
|
|
@@ -83,8 +90,10 @@ class DropdownMenuRoot(RadixThemesComponent):
|
|
|
],
|
|
|
]
|
|
|
] = None,
|
|
|
+ default_open: Optional[Union[Var[bool], bool]] = None,
|
|
|
open: Optional[Union[Var[bool], bool]] = None,
|
|
|
modal: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -151,8 +160,10 @@ class DropdownMenuRoot(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
+ default_open: The open state of the dropdown menu when it is initially rendered. Use when you do not need to control its open state.
|
|
|
open: The controlled open state of the dropdown menu. Must be used in conjunction with onOpenChange.
|
|
|
- modal: The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
|
|
|
+ modal: The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers. Defaults to True.
|
|
|
+ dir: The reading direction of submenus when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -236,6 +247,7 @@ class DropdownMenuTrigger(RadixThemesComponent):
|
|
|
],
|
|
|
]
|
|
|
] = None,
|
|
|
+ as_child: Optional[Union[Var[bool], bool]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -299,6 +311,7 @@ class DropdownMenuTrigger(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -383,6 +396,42 @@ class DropdownMenuContent(RadixThemesComponent):
|
|
|
],
|
|
|
]
|
|
|
] = None,
|
|
|
+ size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None,
|
|
|
+ variant: Optional[
|
|
|
+ Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]]
|
|
|
+ ] = None,
|
|
|
+ high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ as_child: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ loop: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ force_mount: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ side: Optional[
|
|
|
+ Union[
|
|
|
+ Var[Literal["top", "right", "bottom", "left"]],
|
|
|
+ Literal["top", "right", "bottom", "left"],
|
|
|
+ ]
|
|
|
+ ] = None,
|
|
|
+ side_offset: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None,
|
|
|
+ align: Optional[
|
|
|
+ Union[
|
|
|
+ Var[Literal["start", "center", "end"]],
|
|
|
+ Literal["start", "center", "end"],
|
|
|
+ ]
|
|
|
+ ] = None,
|
|
|
+ align_offset: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None,
|
|
|
+ avoid_collisions: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ collision_padding: Optional[
|
|
|
+ Union[
|
|
|
+ Var[Union[float, int, Dict[str, Union[float, int]]]],
|
|
|
+ Union[float, int, Dict[str, Union[float, int]]],
|
|
|
+ ]
|
|
|
+ ] = None,
|
|
|
+ arrow_padding: Optional[
|
|
|
+ Union[Var[Union[float, int]], Union[float, int]]
|
|
|
+ ] = None,
|
|
|
+ sticky: Optional[
|
|
|
+ Union[Var[Literal["partial", "always"]], Literal["partial", "always"]]
|
|
|
+ ] = None,
|
|
|
+ hide_when_detached: Optional[Union[Var[bool], bool]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -411,6 +460,9 @@ class DropdownMenuContent(RadixThemesComponent):
|
|
|
on_focus: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_focus_outside: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_interact_outside: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
@@ -458,6 +510,21 @@ class DropdownMenuContent(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
+ size: Dropdown Menu Content size "1" - "2"
|
|
|
+ variant: Variant of Dropdown Menu Content: "solid" | "soft"
|
|
|
+ high_contrast: Renders the Dropdown Menu Content in higher contrast
|
|
|
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
|
|
|
+ loop: When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
|
|
|
+ force_mount: Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
|
|
|
+ side: The preferred side of the trigger to render against when open. Will be reversed when collisions occur and `avoid_collisions` is enabled.The position of the tooltip. Defaults to "top".
|
|
|
+ side_offset: The distance in pixels from the trigger. Defaults to 0.
|
|
|
+ align: The preferred alignment against the trigger. May change when collisions occur. Defaults to "center".
|
|
|
+ align_offset: An offset in pixels from the "start" or "end" alignment options.
|
|
|
+ avoid_collisions: When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
|
|
|
+ collision_padding: The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { "top": 20, "left": 20 }. Defaults to 0.
|
|
|
+ arrow_padding: The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. Defaults to 0.
|
|
|
+ sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. Defaults to "partial".
|
|
|
+ hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -541,6 +608,9 @@ class DropdownMenuSubTrigger(RadixThemesComponent):
|
|
|
],
|
|
|
]
|
|
|
] = None,
|
|
|
+ as_child: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ disabled: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ text_value: Optional[Union[Var[str], str]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -604,6 +674,9 @@ class DropdownMenuSubTrigger(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
|
|
|
+ disabled: When true, prevents the user from interacting with the item.
|
|
|
+ text_value: Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -619,6 +692,7 @@ class DropdownMenuSubTrigger(RadixThemesComponent):
|
|
|
...
|
|
|
|
|
|
class DropdownMenuSub(RadixThemesComponent):
|
|
|
+ def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
|
@overload
|
|
|
@classmethod
|
|
|
def create( # type: ignore
|
|
@@ -687,6 +761,8 @@ class DropdownMenuSub(RadixThemesComponent):
|
|
|
],
|
|
|
]
|
|
|
] = None,
|
|
|
+ open: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ default_open: Optional[Union[Var[bool], bool]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -733,6 +809,9 @@ class DropdownMenuSub(RadixThemesComponent):
|
|
|
on_mouse_up: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_open_change: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_scroll: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
@@ -750,6 +829,8 @@ class DropdownMenuSub(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
+ open: The controlled open state of the submenu. Must be used in conjunction with `on_open_change`.
|
|
|
+ default_open: The open state of the submenu when it is initially rendered. Use when you do not need to control its open state.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -765,6 +846,7 @@ class DropdownMenuSub(RadixThemesComponent):
|
|
|
...
|
|
|
|
|
|
class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
+ def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
|
@overload
|
|
|
@classmethod
|
|
|
def create( # type: ignore
|
|
@@ -838,6 +920,25 @@ class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]]
|
|
|
] = None,
|
|
|
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ as_child: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ loop: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ force_mount: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ side_offset: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None,
|
|
|
+ align_offset: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None,
|
|
|
+ avoid_collisions: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ collision_padding: Optional[
|
|
|
+ Union[
|
|
|
+ Var[Union[float, int, Dict[str, Union[float, int]]]],
|
|
|
+ Union[float, int, Dict[str, Union[float, int]]],
|
|
|
+ ]
|
|
|
+ ] = None,
|
|
|
+ arrow_padding: Optional[
|
|
|
+ Union[Var[Union[float, int]], Union[float, int]]
|
|
|
+ ] = None,
|
|
|
+ sticky: Optional[
|
|
|
+ Union[Var[Literal["partial", "always"]], Literal["partial", "always"]]
|
|
|
+ ] = None,
|
|
|
+ hide_when_detached: Optional[Union[Var[bool], bool]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -857,9 +958,18 @@ class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
on_double_click: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_escape_key_down: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_focus: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_focus_outside: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
+ on_interact_outside: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_mount: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
@@ -884,6 +994,9 @@ class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
on_mouse_up: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_pointer_down_outside: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_scroll: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
@@ -901,9 +1014,19 @@ class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
*children: Child components.
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
- size: Button size "1" - "4"
|
|
|
- variant: Variant of button: "solid" | "soft" | "outline" | "ghost"
|
|
|
- high_contrast: Whether to render the button with higher contrast color against background
|
|
|
+ size: Dropdown Menu Sub Content size "1" - "2"
|
|
|
+ variant: Variant of Dropdown Menu Sub Content: "solid" | "soft"
|
|
|
+ high_contrast: Whether to render the component with higher contrast color against background
|
|
|
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
|
|
|
+ loop: When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
|
|
|
+ force_mount: Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
|
|
|
+ side_offset: The distance in pixels from the trigger. Defaults to 0.
|
|
|
+ align_offset: An offset in pixels from the "start" or "end" alignment options.
|
|
|
+ avoid_collisions: When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
|
|
|
+ collision_padding: The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { "top": 20, "left": 20 }. Defaults to 0.
|
|
|
+ arrow_padding: The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. Defaults to 0.
|
|
|
+ sticky: The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. Defaults to "partial".
|
|
|
+ hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|
|
@@ -919,6 +1042,7 @@ class DropdownMenuSubContent(RadixThemesComponent):
|
|
|
...
|
|
|
|
|
|
class DropdownMenuItem(RadixThemesComponent):
|
|
|
+ def get_event_triggers(self) -> Dict[str, Any]: ...
|
|
|
@overload
|
|
|
@classmethod
|
|
|
def create( # type: ignore
|
|
@@ -988,6 +1112,9 @@ class DropdownMenuItem(RadixThemesComponent):
|
|
|
]
|
|
|
] = None,
|
|
|
shortcut: Optional[Union[Var[str], str]] = None,
|
|
|
+ as_child: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ disabled: Optional[Union[Var[bool], bool]] = None,
|
|
|
+ text_value: Optional[Union[Var[str], str]] = None,
|
|
|
style: Optional[Style] = None,
|
|
|
key: Optional[Any] = None,
|
|
|
id: Optional[Any] = None,
|
|
@@ -1037,6 +1164,9 @@ class DropdownMenuItem(RadixThemesComponent):
|
|
|
on_scroll: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
|
+ on_select: Optional[
|
|
|
+ Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
+ ] = None,
|
|
|
on_unmount: Optional[
|
|
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
|
] = None,
|
|
@@ -1052,6 +1182,9 @@ class DropdownMenuItem(RadixThemesComponent):
|
|
|
color: map to CSS default color property.
|
|
|
color_scheme: map to radix color property.
|
|
|
shortcut: Shortcut to render a menu item as a link
|
|
|
+ as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
|
|
|
+ disabled: When true, prevents the user from interacting with the item.
|
|
|
+ text_value: Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
|
|
|
style: The style of the component.
|
|
|
key: A unique key for the component.
|
|
|
id: The id for the component.
|