Fix wrong modal sizes (#2183)

This commit is contained in:
Alek Petuskey 2023-11-16 15:35:15 -08:00 committed by GitHub
parent 9480f76a27
commit e399b5a98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,15 @@
"""Modal components."""
from __future__ import annotations
from typing import Any, Optional, Union
from typing import Any, Literal, Optional, Union
from reflex.components.component import Component
from reflex.components.libs.chakra import ChakraComponent, LiteralAlertDialogSize
from reflex.components.libs.chakra import ChakraComponent
from reflex.components.media import Icon
from reflex.vars import Var
ModalSizes = Literal["xs", "sm", "md", "lg", "xl", "full"]
class Modal(ChakraComponent):
"""The wrapper that provides context for its children."""
@ -47,8 +49,8 @@ class Modal(ChakraComponent):
# If true, the modal will return focus to the element that triggered it when it closes.
return_focus_on_close: Var[bool]
# "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full"
size: Var[LiteralAlertDialogSize]
# "xs" | "sm" | "md" | "lg" | "xl" | "full"
size: Var[ModalSizes]
# A11y: If true, the siblings of the modal will have `aria-hidden` set to true so that screen readers can only see the modal. This is commonly known as making the other elements **inert**
use_inert: Var[bool]