|
| 1 | +from dataclasses import dataclass, field |
| 2 | +from typing import Literal, Any |
| 3 | + |
| 4 | +from chartlets import Container |
| 5 | + |
| 6 | + |
| 7 | +@dataclass(frozen=True) |
| 8 | +class Dialog(Container): |
| 9 | + """A modal dialog that presents content and actions in a focused interface.""" |
| 10 | + |
| 11 | + open: bool = field(default=False) |
| 12 | + """Controls whether the dialog is open.""" |
| 13 | + |
| 14 | + title: str | None = None |
| 15 | + """The title of the dialog.""" |
| 16 | + |
| 17 | + titleProps: dict[str, Any] | None = None |
| 18 | + """Additional properties for the dialog title. Can include |
| 19 | + typography-related attributes. |
| 20 | + https://mui.com/material-ui/api/dialog-title/""" |
| 21 | + |
| 22 | + content: str | None = None |
| 23 | + """The content of the dialog.""" |
| 24 | + |
| 25 | + contentProps: dict[str, Any] | None = None |
| 26 | + """Additional properties for the dialog content. Can include |
| 27 | + typography-related attributes. |
| 28 | + https://mui.com/material-ui/api/dialog-content-text/""" |
| 29 | + |
| 30 | + disableEscapeKeyDown: bool | None = None |
| 31 | + """If true, pressing the Escape key does not close the dialog.""" |
| 32 | + |
| 33 | + fullScreen: bool | None = None |
| 34 | + """If true, the dialog will be displayed in full-screen mode.""" |
| 35 | + |
| 36 | + fullWidth: bool | None = None |
| 37 | + """If true, the dialog will take up the full width of the screen.""" |
| 38 | + |
| 39 | + maxWidth: Literal["xs", "sm", "md", "lg", "xl", False] | str | None = None |
| 40 | + """The maximum width of the dialog.""" |
| 41 | + |
| 42 | + scroll: Literal["body", "paper"] | None = None |
| 43 | + """Determines the scroll behavior of the dialog's content.""" |
| 44 | + |
| 45 | + ariaLabel: str | None = None |
| 46 | + """Defines a string value that labels the dialog for accessibility.""" |
| 47 | + |
| 48 | + ariaDescribedBy: str | None = None |
| 49 | + """Defines the ID of an element that describes the dialog for |
| 50 | + accessibility.""" |
0 commit comments