Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyi_hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"reflex/components/radix/primitives/__init__.pyi": "01c388fe7a1f5426a16676404344edf6",
"reflex/components/radix/primitives/accordion.pyi": "19484eca0ad53f538f5db04c09921738",
"reflex/components/radix/primitives/base.pyi": "9ef34884fb6028dc017df5e2db639c81",
"reflex/components/radix/primitives/dialog.pyi": "1bc7533791b07928ad1ade5f616b81d4",
"reflex/components/radix/primitives/dialog.pyi": "9ee73362bb59619c482b6b0d07033f37",
"reflex/components/radix/primitives/drawer.pyi": "921e45dfaf5b9131ef27c561c3acca2e",
"reflex/components/radix/primitives/form.pyi": "78055e820703c98c3b838aa889566365",
"reflex/components/radix/primitives/progress.pyi": "c917952d57ddb3e138a40c4005120d5e",
Expand Down
15 changes: 13 additions & 2 deletions reflex/components/radix/primitives/dialog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Interactive components provided by @radix-ui/react-dialog."""

from typing import Any
from typing import Any, ClassVar

from reflex.components.component import ComponentNamespace
from reflex.components.el import elements
Expand Down Expand Up @@ -35,6 +35,11 @@ class DialogRoot(DialogElement):
# The modality of the dialog. When set to true, interaction with outside elements will be disabled and only dialog content will be visible to screen readers.
modal: Var[bool]

_valid_children: ClassVar[list[str]] = [
"DialogTrigger",
"DialogPortal",
]


class DialogPortal(DialogElement):
"""Portal component for Dialog."""
Expand All @@ -48,6 +53,8 @@ class DialogPortal(DialogElement):
# Specify a container element to portal the content into.
container: Var[Any]

_valid_parents: ClassVar[list[str]] = ["DialogRoot"]


class DialogOverlay(DialogElement):
"""A layer that covers the inert portion of the view when the dialog is open."""
Expand All @@ -61,6 +68,8 @@ class DialogOverlay(DialogElement):
# Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. It inherits from Dialog.Portal.
force_mount: Var[bool]

_valid_parents: ClassVar[list[str]] = ["DialogPortal"]


class DialogTrigger(DialogElement, RadixPrimitiveTriggerComponent):
"""Trigger an action or event, to open a Dialog modal."""
Expand All @@ -73,7 +82,7 @@ class DialogTrigger(DialogElement, RadixPrimitiveTriggerComponent):

_memoization_mode = MemoizationMode(recursive=False)

_valid_parents = ["DialogRoot"]
_valid_parents: ClassVar[list[str]] = ["DialogRoot"]


class DialogContent(elements.Div, DialogElement):
Expand Down Expand Up @@ -103,6 +112,8 @@ class DialogContent(elements.Div, DialogElement):
# Fired when the pointer interacts outside the dialog.
on_interact_outside: EventHandler[no_args_event_spec]

_valid_parents: ClassVar[list[str]] = ["DialogPortal"]


class DialogTitle(DialogElement):
"""Title component to display inside a Dialog modal."""
Expand Down
Loading