From c59ea2360373459a7d1a5121c412e94fe38d01be Mon Sep 17 00:00:00 2001 From: Tom Gotsman Date: Tue, 29 Oct 2024 18:06:06 +0000 Subject: [PATCH] add popover props --- .../components/radix/themes/components/popover.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/reflex/components/radix/themes/components/popover.py b/reflex/components/radix/themes/components/popover.py index 2535a8a22..fc2e524ea 100644 --- a/reflex/components/radix/themes/components/popover.py +++ b/reflex/components/radix/themes/components/popover.py @@ -1,6 +1,6 @@ """Interactive components provided by @radix-ui/themes.""" -from typing import Literal +from typing import Dict, List, Literal, Union from reflex.components.component import ComponentNamespace from reflex.components.core.breakpoints import Responsive @@ -28,6 +28,9 @@ class PopoverRoot(RadixThemesComponent): # Fired when the open state changes. on_open_change: EventHandler[identity_event(bool)] + # The open state of the popover when it is initially rendered. Use when you do not need to control its open state. + default_open: Var[bool] + class PopoverTrigger(RadixThemesTriggerComponent): """Wraps the control that will open the popover.""" @@ -58,6 +61,15 @@ class PopoverContent(elements.Div, RadixThemesComponent): # When true, overrides the side andalign preferences to prevent collisions with boundary edges. 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 }. Defaults to 0. + collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]] + + # 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: Var[Literal["partial", "always"]] + + # Whether to hide the content when the trigger becomes fully occluded. Defaults to False. + hide_when_detached: Var[bool] + # Fired when the dialog is opened. on_open_auto_focus: EventHandler[empty_event]