This commit is contained in:
Tom Gotsman 2024-10-30 17:34:29 +00:00
parent 418f4a7925
commit 5194cde3e4
11 changed files with 234 additions and 34 deletions

View File

@ -76,7 +76,6 @@ class DrawerRoot(DrawerComponent):
close_threshold: Var[float] close_threshold: Var[float]
class DrawerTrigger(DrawerComponent): class DrawerTrigger(DrawerComponent):
"""The button that opens the dialog.""" """The button that opens the dialog."""
@ -275,6 +274,7 @@ class DrawerDescription(DrawerComponent):
base_style.update(style) base_style.update(style)
return {"css": base_style} return {"css": base_style}
class DrawerHandle(DrawerComponent): class DrawerHandle(DrawerComponent):
"""A description for the drawer.""" """A description for the drawer."""
@ -282,6 +282,7 @@ class DrawerHandle(DrawerComponent):
alias = "Vaul" + tag alias = "Vaul" + tag
class Drawer(ComponentNamespace): class Drawer(ComponentNamespace):
"""A namespace for Drawer components.""" """A namespace for Drawer components."""

View File

@ -67,12 +67,8 @@ class DrawerRoot(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
default_open: Optional[Union[Var[bool], bool]] = None,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None,
close_threshold: Optional[Union[Var[float], float]] = None,
snap_points: Optional[List[Union[float, str]]] = None,
fade_from_index: Optional[Union[Var[int], int]] = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
modal: Optional[Union[Var[bool], bool]] = None, modal: Optional[Union[Var[bool], bool]] = None,
direction: Optional[ direction: Optional[
Union[ Union[
@ -80,7 +76,14 @@ class DrawerRoot(DrawerComponent):
Var[Literal["bottom", "left", "right", "top"]], Var[Literal["bottom", "left", "right", "top"]],
] ]
] = None, ] = None,
dismissible: Optional[Union[Var[bool], bool]] = None,
handle_only: Optional[Union[Var[bool], bool]] = None,
snap_points: Optional[List[Union[float, str]]] = None,
fade_from_index: Optional[Union[Var[int], int]] = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
preventScrollRestoration: Optional[Union[Var[bool], bool]] = None, preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None,
close_threshold: Optional[Union[Var[float], float]] = None,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
@ -88,6 +91,7 @@ class DrawerRoot(DrawerComponent):
class_name: Optional[Any] = None, class_name: Optional[Any] = None,
autofocus: Optional[bool] = None, autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_animation_end: Optional[EventType[bool]] = None,
on_blur: Optional[EventType[[]]] = None, on_blur: Optional[EventType[[]]] = None,
on_click: Optional[EventType[[]]] = None, on_click: Optional[EventType[[]]] = None,
on_context_menu: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None,
@ -110,15 +114,18 @@ class DrawerRoot(DrawerComponent):
Args: Args:
*children: The children of the component. *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. open: Whether the drawer is open or not.
should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data attribute to scale its background. modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
close_threshold: Number between 0 and 1 that determines when the drawer should be closed. direction: Direction of the drawer. This adjust the animations and the drag direction. Defaults to `"bottom"`
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. 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. 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 scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
direction: Direction of the drawer. Defaults to `"bottom"`
preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data 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. as_child: Change the default rendered element for the one passed as a child.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
@ -464,6 +471,54 @@ class DrawerDescription(DrawerComponent):
""" """
... ...
class DrawerHandle(DrawerComponent):
@overload
@classmethod
def create( # type: ignore
cls,
*children,
as_child: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = 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): class Drawer(ComponentNamespace):
root = staticmethod(DrawerRoot.create) root = staticmethod(DrawerRoot.create)
trigger = staticmethod(DrawerTrigger.create) trigger = staticmethod(DrawerTrigger.create)
@ -473,16 +528,13 @@ class Drawer(ComponentNamespace):
close = staticmethod(DrawerClose.create) close = staticmethod(DrawerClose.create)
title = staticmethod(DrawerTitle.create) title = staticmethod(DrawerTitle.create)
description = staticmethod(DrawerDescription.create) description = staticmethod(DrawerDescription.create)
handle = staticmethod(DrawerHandle.create)
@staticmethod @staticmethod
def __call__( def __call__(
*children, *children,
default_open: Optional[Union[Var[bool], bool]] = None,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None,
close_threshold: Optional[Union[Var[float], float]] = None,
snap_points: Optional[List[Union[float, str]]] = None,
fade_from_index: Optional[Union[Var[int], int]] = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
modal: Optional[Union[Var[bool], bool]] = None, modal: Optional[Union[Var[bool], bool]] = None,
direction: Optional[ direction: Optional[
Union[ Union[
@ -490,7 +542,14 @@ class Drawer(ComponentNamespace):
Var[Literal["bottom", "left", "right", "top"]], Var[Literal["bottom", "left", "right", "top"]],
] ]
] = None, ] = None,
dismissible: Optional[Union[Var[bool], bool]] = None,
handle_only: Optional[Union[Var[bool], bool]] = None,
snap_points: Optional[List[Union[float, str]]] = None,
fade_from_index: Optional[Union[Var[int], int]] = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None,
preventScrollRestoration: Optional[Union[Var[bool], bool]] = None, preventScrollRestoration: Optional[Union[Var[bool], bool]] = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None,
close_threshold: Optional[Union[Var[float], float]] = None,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
@ -498,6 +557,7 @@ class Drawer(ComponentNamespace):
class_name: Optional[Any] = None, class_name: Optional[Any] = None,
autofocus: Optional[bool] = None, autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
on_animation_end: Optional[EventType[bool]] = None,
on_blur: Optional[EventType[[]]] = None, on_blur: Optional[EventType[[]]] = None,
on_click: Optional[EventType[[]]] = None, on_click: Optional[EventType[[]]] = None,
on_context_menu: Optional[EventType[[]]] = None, on_context_menu: Optional[EventType[[]]] = None,
@ -520,15 +580,18 @@ class Drawer(ComponentNamespace):
Args: Args:
*children: The children of the component. *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. open: Whether the drawer is open or not.
should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data attribute to scale its background. modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
close_threshold: Number between 0 and 1 that determines when the drawer should be closed. direction: Direction of the drawer. This adjust the animations and the drag direction. Defaults to `"bottom"`
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. 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. 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 scroll_lock_timeout: Duration for which the drawer is not draggable after scrolling content inside of the drawer. Defaults to 500ms
modal: When `False`, it allows to interact with elements outside of the drawer without closing it. Defaults to `True`.
direction: Direction of the drawer. Defaults to `"bottom"`
preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`. preventScrollRestoration: When `True`, it prevents scroll restoration. Defaults to `True`.
should_scale_background: Enable background scaling, it requires an element with [vaul-drawer-wrapper] data 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. as_child: Change the default rendered element for the one passed as a child.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.

View File

@ -23,6 +23,7 @@ class AlertDialogRoot(RadixThemesComponent):
cls, cls,
*children, *children,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
default_open: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -55,6 +56,7 @@ class AlertDialogRoot(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
open: The controlled open state of the dialog. open: The controlled open state of the dialog.
default_open: The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.

View File

@ -27,6 +27,7 @@ LiteralStickyType = Literal[
"always", "always",
] ]
class ContextMenuRoot(RadixThemesComponent): class ContextMenuRoot(RadixThemesComponent):
"""Menu representing a set of actions, displayed at the origin of a pointer right-click or long-press.""" """Menu representing a set of actions, displayed at the origin of a pointer right-click or long-press."""

View File

@ -13,6 +13,13 @@ from reflex.vars.base import Var
from ..base import RadixThemesComponent from ..base import 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 ContextMenuRoot(RadixThemesComponent): class ContextMenuRoot(RadixThemesComponent):
@overload @overload
@classmethod @classmethod
@ -20,6 +27,7 @@ class ContextMenuRoot(RadixThemesComponent):
cls, cls,
*children, *children,
modal: Optional[Union[Var[bool], bool]] = None, modal: Optional[Union[Var[bool], bool]] = None,
dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -52,6 +60,7 @@ class ContextMenuRoot(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
modal: The modality of the context 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 context menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -195,8 +204,36 @@ class ContextMenuContent(RadixThemesComponent):
] ]
] = None, ] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None, high_contrast: Optional[Union[Var[bool], bool]] = None,
align_offset: Optional[Union[Var[int], int]] = 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[
Literal["bottom", "left", "right", "top"],
Var[Literal["bottom", "left", "right", "top"]],
]
] = None,
side_offset: Optional[Union[Var[Union[float, int]], float, int]] = None,
align: Optional[
Union[
Literal["center", "end", "start"],
Var[Literal["center", "end", "start"]],
]
] = None,
align_offset: Optional[Union[Var[Union[float, int]], float, int]] = None,
avoid_collisions: Optional[Union[Var[bool], bool]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None,
collision_padding: Optional[
Union[
Dict[str, Union[float, int]],
Var[Union[Dict[str, Union[float, int]], float, int]],
float,
int,
]
] = None,
sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None,
hide_when_detached: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -232,12 +269,21 @@ class ContextMenuContent(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
size: Button size "1" - "4" size: Dropdown Menu Content size "1" - "2"
variant: Variant of button: "solid" | "soft" | "outline" | "ghost" variant: Variant of Dropdown Menu Content: "solid" | "soft"
color_scheme: Override theme color for button color_scheme: Override theme color for Dropdown Menu Content
high_contrast: Whether to render the button with higher contrast color against background high_contrast: Renders the Dropdown Menu Content in higher contrast
align_offset: The vertical distance in pixels from the anchor. as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
avoid_collisions: When true, overrides the side and aligns preferences to prevent collisions with boundary edges. 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.
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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -257,6 +303,8 @@ class ContextMenuSub(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
open: Optional[Union[Var[bool], bool]] = None,
default_open: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -276,6 +324,7 @@ class ContextMenuSub(RadixThemesComponent):
on_mouse_out: Optional[EventType[[]]] = None, on_mouse_out: Optional[EventType[[]]] = None,
on_mouse_over: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None,
on_mouse_up: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None,
on_open_change: Optional[EventType[bool]] = None,
on_scroll: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None,
on_unmount: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None,
**props, **props,
@ -287,6 +336,8 @@ class ContextMenuSub(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -306,7 +357,9 @@ class ContextMenuSubTrigger(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None,
disabled: 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, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -337,7 +390,9 @@ class ContextMenuSubTrigger(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
disabled: Whether the trigger is disabled disabled: Whether the trigger is disabled
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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -357,7 +412,24 @@ class ContextMenuSubContent(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None,
loop: 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]], float, int]] = None,
align_offset: Optional[Union[Var[Union[float, int]], float, int]] = None,
avoid_collisions: Optional[Union[Var[bool], bool]] = None,
collision_padding: Optional[
Union[
Dict[str, Union[float, int]],
Var[Union[Dict[str, Union[float, int]], float, int]],
float,
int,
]
] = None,
sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None,
hide_when_detached: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -392,7 +464,15 @@ class ContextMenuSubContent(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
loop: When true, keyboard navigation will loop from last item to first, and vice versa. 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.
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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -475,6 +555,9 @@ class ContextMenuItem(RadixThemesComponent):
] ]
] = None, ] = None,
shortcut: Optional[Union[Var[str], str]] = 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, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -495,6 +578,7 @@ class ContextMenuItem(RadixThemesComponent):
on_mouse_over: Optional[EventType[[]]] = None, on_mouse_over: Optional[EventType[[]]] = None,
on_mouse_up: Optional[EventType[[]]] = None, on_mouse_up: Optional[EventType[[]]] = None,
on_scroll: Optional[EventType[[]]] = None, on_scroll: Optional[EventType[[]]] = None,
on_select: Optional[EventType[[]]] = None,
on_unmount: Optional[EventType[[]]] = None, on_unmount: Optional[EventType[[]]] = None,
**props, **props,
) -> "ContextMenuItem": ) -> "ContextMenuItem":
@ -507,6 +591,9 @@ class ContextMenuItem(RadixThemesComponent):
*children: Child components. *children: Child components.
color_scheme: Override theme color for button color_scheme: Override theme color for button
shortcut: Shortcut to render a menu item as a link 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. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.

View File

@ -21,6 +21,7 @@ class DialogRoot(RadixThemesComponent):
cls, cls,
*children, *children,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
default_open: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -53,6 +54,7 @@ class DialogRoot(RadixThemesComponent):
Args: Args:
*children: Child components. *children: Child components.
open: The controlled open state of the dialog. open: The controlled open state of the dialog.
default_open: The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -363,6 +365,7 @@ class Dialog(ComponentNamespace):
def __call__( def __call__(
*children, *children,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
default_open: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -395,6 +398,7 @@ class Dialog(ComponentNamespace):
Args: Args:
*children: Child components. *children: Child components.
open: The controlled open state of the dialog. open: The controlled open state of the dialog.
default_open: The open state of the dialog when it is initially rendered. Use when you do not need to control its open state.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.

View File

@ -224,7 +224,6 @@ class DropdownMenuContent(RadixThemesComponent):
int, int,
] ]
] = None, ] = None,
arrow_padding: Optional[Union[Var[Union[float, int]], float, int]] = None,
sticky: Optional[ sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]] Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None, ] = None,
@ -277,7 +276,6 @@ class DropdownMenuContent(RadixThemesComponent):
align_offset: An offset in pixels from the "start" or "end" alignment options. 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. 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. 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". 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. hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
style: The style of the component. style: The style of the component.
@ -410,7 +408,6 @@ class DropdownMenuSubContent(RadixThemesComponent):
int, int,
] ]
] = None, ] = None,
arrow_padding: Optional[Union[Var[Union[float, int]], float, int]] = None,
sticky: Optional[ sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]] Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None, ] = None,
@ -456,7 +453,6 @@ class DropdownMenuSubContent(RadixThemesComponent):
align_offset: An offset in pixels from the "start" or "end" alignment options. 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. 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. 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". 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. hide_when_detached: Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
style: The style of the component. style: The style of the component.

View File

@ -1,6 +1,6 @@
"""Interactive components provided by @radix-ui/themes.""" """Interactive components provided by @radix-ui/themes."""
from typing import Literal, Union, Dict from typing import Dict, Literal, Union
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.core.breakpoints import Responsive from reflex.components.core.breakpoints import Responsive
@ -60,7 +60,7 @@ class HoverCardContent(elements.Div, RadixThemesComponent):
# Whether or not the hover card should avoid collisions with its trigger. # Whether or not the hover card should avoid collisions with its trigger.
avoid_collisions: Var[bool] avoid_collisions: Var[bool]
# 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 }. # 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 }.
collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]] collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]]

View File

@ -137,7 +137,31 @@ class HoverCardContent(elements.Div, RadixThemesComponent):
Var[Literal["center", "end", "start"]], Var[Literal["center", "end", "start"]],
] ]
] = None, ] = None,
align_offset: Optional[Union[Var[int], int]] = None,
avoid_collisions: Optional[Union[Var[bool], bool]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None,
collision_padding: Optional[
Union[
Dict[str, Union[float, int]],
Var[Union[Dict[str, Union[float, int]], float, int]],
float,
int,
]
] = None,
sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None,
hide_when_detached: Optional[Union[Var[bool], bool]] = None,
size: Optional[
Union[
Breakpoints[str, Literal["1", "2", "3"]],
Literal["1", "2", "3"],
Var[
Union[
Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"]
]
],
]
] = None,
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
auto_capitalize: Optional[ auto_capitalize: Optional[
Union[Var[Union[bool, int, str]], bool, int, str] Union[Var[Union[bool, int, str]], bool, int, str]
@ -195,7 +219,12 @@ class HoverCardContent(elements.Div, RadixThemesComponent):
side: The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. side: The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
side_offset: The distance in pixels from the trigger. side_offset: The distance in pixels from the trigger.
align: The preferred alignment against the trigger. May change when collisions occur. align: The preferred alignment against the trigger. May change when collisions occur.
align_offset: An offset in pixels from the "start" or "end" alignment options.
avoid_collisions: Whether or not the hover card should avoid collisions with its trigger. avoid_collisions: Whether or not the hover card should avoid collisions with its trigger.
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 }.
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
hide_when_detached: Whether to hide the content when the trigger becomes fully occluded.
size: Hovercard size "1" - "3"
access_key: Provides a hint for generating a keyboard shortcut for the current element. access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable. content_editable: Indicates whether the element's content is editable.

View File

@ -1,6 +1,6 @@
"""Interactive components provided by @radix-ui/themes.""" """Interactive components provided by @radix-ui/themes."""
from typing import Dict, List, Literal, Union from typing import Dict, Literal, Union
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.core.breakpoints import Responsive from reflex.components.core.breakpoints import Responsive

View File

@ -22,6 +22,7 @@ class PopoverRoot(RadixThemesComponent):
*children, *children,
open: Optional[Union[Var[bool], bool]] = None, open: Optional[Union[Var[bool], bool]] = None,
modal: Optional[Union[Var[bool], bool]] = None, modal: Optional[Union[Var[bool], bool]] = None,
default_open: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
id: Optional[Any] = None, id: Optional[Any] = None,
@ -55,6 +56,7 @@ class PopoverRoot(RadixThemesComponent):
*children: Child components. *children: Child components.
open: The controlled open state of the popover. open: The controlled open state of the popover.
modal: The modality of the popover. When set to true, interaction with outside elements will be disabled and only popover content will be visible to screen readers. modal: The modality of the popover. When set to true, interaction with outside elements will be disabled and only popover content will be visible to screen readers.
default_open: The open state of the popover when it is initially rendered. Use when you do not need to control its open state.
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.
id: The id for the component. id: The id for the component.
@ -141,6 +143,18 @@ class PopoverContent(elements.Div, RadixThemesComponent):
] = None, ] = None,
align_offset: Optional[Union[Var[int], int]] = None, align_offset: Optional[Union[Var[int], int]] = None,
avoid_collisions: Optional[Union[Var[bool], bool]] = None, avoid_collisions: Optional[Union[Var[bool], bool]] = None,
collision_padding: Optional[
Union[
Dict[str, Union[float, int]],
Var[Union[Dict[str, Union[float, int]], float, int]],
float,
int,
]
] = None,
sticky: Optional[
Union[Literal["always", "partial"], Var[Literal["always", "partial"]]]
] = None,
hide_when_detached: Optional[Union[Var[bool], bool]] = None,
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
auto_capitalize: Optional[ auto_capitalize: Optional[
Union[Var[Union[bool, int, str]], bool, int, str] Union[Var[Union[bool, int, str]], bool, int, str]
@ -207,6 +221,9 @@ class PopoverContent(elements.Div, RadixThemesComponent):
align: The preferred alignment against the anchor. May change when collisions occur. align: The preferred alignment against the anchor. May change when collisions occur.
align_offset: The vertical distance in pixels from the anchor. align_offset: The vertical distance in pixels from the anchor.
avoid_collisions: When true, overrides the side andalign preferences to prevent collisions with boundary edges. avoid_collisions: When true, overrides the side andalign preferences to prevent collisions with boundary edges.
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.
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.
access_key: Provides a hint for generating a keyboard shortcut for the current element. access_key: Provides a hint for generating a keyboard shortcut for the current element.
auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user. auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
content_editable: Indicates whether the element's content is editable. content_editable: Indicates whether the element's content is editable.