diff --git a/integration/test_radix_themes.py b/integration/test_radix_themes.py deleted file mode 100644 index d4731d20e..000000000 --- a/integration/test_radix_themes.py +++ /dev/null @@ -1,185 +0,0 @@ -"""Integration test for @radix-ui/themes integration.""" - -from __future__ import annotations - -import time -from typing import Generator - -import pytest -from selenium.webdriver.common.by import By -from selenium.webdriver.common.keys import Keys - -from reflex.testing import DEFAULT_TIMEOUT, AppHarness, WebDriver - - -def RadixThemesApp(): - """App using radix-themes components.""" - import reflex as rx - import reflex.components.radix.themes as rdxt - - class State(rx.State): - v: str = "" - checked: bool = False - - def index() -> rx.Component: - return rdxt.box( - rdxt.text_field( - id="token", value=State.router.session.client_token, read_only=True - ), - rdxt.text_field(id="tf-bare", value=State.v, on_change=State.set_v), # type: ignore - rdxt.text_field_root( - rdxt.text_field_slot("🧸"), - rdxt.text_field(id="tf-slotted", value=State.v, on_change=State.set_v), # type: ignore - ), - rdxt.flex( - rdxt.switch( - id="switch1", - checked=State.checked, - on_checked_change=State.set_checked, # type: ignore - ), - rx.cond( - State.checked, - rdxt.text("💡", id="bulb"), - rdxt.text("🌙", id="moon"), - ), - direction="row", - gap="2", - ), - rdxt.button("This is a button", size="4", variant="solid", color="plum"), - rdxt.grid( - *[ - rdxt.box(rdxt.text(f"Cell {i}"), width="10vw", height="10vw") - for i in range(1, 10) - ], - columns="3", - ), - rdxt.container( - rdxt.section( - rdxt.heading("Section 1"), - rdxt.text( - "text one with ", - rdxt.kbd("K"), - rdxt.kbd("E"), - rdxt.kbd("Y"), - "s", - ), - ), - rdxt.section( - rdxt.heading("Section 2", size="2"), - rdxt.code("Inline code yo"), - ), - rdxt.section( - rdxt.heading("Section 3"), - rdxt.link("Link to google", href="https://google.com"), - rdxt.strong("Strong text"), - rdxt.em("Emphasized text"), - rdxt.blockquote("Blockquote text"), - rdxt.quote("Inline quote"), - ), - ), - p="5", - ) - - app = rx.App( - state=rx.State, - theme=rdxt.theme(rdxt.theme_panel(), accent_color="grass"), - ) - app.add_page(index) - app.compile() - - -@pytest.fixture(scope="session") -def radix_themes_app( - tmp_path_factory, -) -> Generator[AppHarness, None, None]: - """Start BackgroundTask app at tmp_path via AppHarness. - - Args: - tmp_path_factory: pytest tmp_path_factory fixture - - Yields: - running AppHarness instance - """ - with AppHarness.create( - root=tmp_path_factory.mktemp(f"radix_themes_app"), - app_source=RadixThemesApp, # type: ignore - ) as harness: - yield harness - - -@pytest.fixture -def driver(radix_themes_app: AppHarness) -> Generator[WebDriver, None, None]: - """Get an instance of the browser open to the radix_themes_app app. - - Args: - radix_themes_app: harness for BackgroundTask app - - Yields: - WebDriver instance. - """ - assert radix_themes_app.app_instance is not None, "app is not running" - driver = radix_themes_app.frontend() - try: - yield driver - finally: - driver.quit() - - -@pytest.fixture() -def token(radix_themes_app: AppHarness, driver: WebDriver) -> str: - """Get a function that returns the active token. - - Args: - radix_themes_app: harness for BackgroundTask app. - driver: WebDriver instance. - - Returns: - The token for the connected client - """ - assert radix_themes_app.app_instance is not None - token_input = driver.find_element(By.ID, "token") - assert token_input - - # wait for the backend connection to send the token - token = radix_themes_app.poll_for_value(token_input, timeout=DEFAULT_TIMEOUT * 2) - assert token is not None - - return token - - -def test_radix_themes_app( - radix_themes_app: AppHarness, - driver: WebDriver, - token: str, -): - """Test that background tasks work as expected. - - Args: - radix_themes_app: harness for BackgroundTask app. - driver: WebDriver instance. - token: The token for the connected client. - """ - assert radix_themes_app.app_instance is not None - - tf_bare = driver.find_element(By.ID, "tf-bare") - tf_slotted = driver.find_element(By.ID, "tf-slotted") - switch = driver.find_element(By.ID, "switch1") - - tf_bare.send_keys("hello") - assert radix_themes_app.poll_for_value(tf_slotted) == "hello" - tf_slotted.send_keys(Keys.ARROW_LEFT, Keys.ARROW_LEFT, Keys.ARROW_LEFT, "y je") - assert ( - radix_themes_app.poll_for_value(tf_bare, exp_not_equal="hello") == "hey jello" - ) - - driver.find_element(By.ID, "moon") - switch.click() - time.sleep(0.5) - driver.find_element(By.ID, "bulb") - with pytest.raises(Exception): - driver.find_element(By.ID, "moon") - switch.click() - time.sleep(0.5) - driver.find_element(By.ID, "moon") - with pytest.raises(Exception): - driver.find_element(By.ID, "bulb") diff --git a/reflex/components/radix/themes/__init__.py b/reflex/components/radix/themes/__init__.py index 39ee0b5f3..7ecdfb749 100644 --- a/reflex/components/radix/themes/__init__.py +++ b/reflex/components/radix/themes/__init__.py @@ -1,77 +1,8 @@ """Namespace for components provided by the @radix-ui/themes library.""" -from .base import LiteralAccentColor as LiteralAccentColor -from .base import LiteralAlign as LiteralAlign -from .base import LiteralAppearance as LiteralAppearance -from .base import LiteralGrayColor as LiteralGrayColor -from .base import LiteralJustify as LiteralJustify -from .base import LiteralPanelBackground as LiteralPanelBackground -from .base import LiteralRadius as LiteralRadius -from .base import LiteralScaling as LiteralScaling -from .base import LiteralSize as LiteralSize -from .base import LiteralVariant as LiteralVariant -from .base import ( - Theme, - ThemePanel, -) -from .components import ( - Button, - Switch, - TextField, - TextFieldRoot, - TextFieldSlot, -) -from .components import LiteralButtonSize as LiteralButtonSize -from .components import LiteralSwitchSize as LiteralSwitchSize -from .layout import ( - Box, - Container, - Flex, - Grid, - Section, -) -from .layout import LiteralBoolNumber as LiteralBoolNumber -from .layout import LiteralContainerSize as LiteralContainerSize -from .layout import LiteralFlexDirection as LiteralFlexDirection -from .layout import LiteralFlexDisplay as LiteralFlexDisplay -from .layout import LiteralFlexWrap as LiteralFlexWrap -from .layout import LiteralGridDisplay as LiteralGridDisplay -from .layout import LiteralGridFlow as LiteralGridFlow -from .layout import LiteralSectionSize as LiteralSectionSize -from .typography import ( - Blockquote, - Code, - Em, - Heading, - Kbd, - Link, - Quote, - Strong, - Text, -) -from .typography import LiteralLinkUnderline as LiteralLinkUnderline -from .typography import LiteralTextAlign as LiteralTextAlign -from .typography import LiteralTextSize as LiteralTextSize -from .typography import LiteralTextTrim as LiteralTextTrim -from .typography import LiteralTextWeight as LiteralTextWeight +from .base import Theme, ThemePanel +from .components import * +from .layout import * +from .typography import * -blockquote = Blockquote.create -box = Box.create -button = Button.create -code = Code.create -container = Container.create -em = Em.create -flex = Flex.create -grid = Grid.create -heading = Heading.create -kbd = Kbd.create -link = Link.create -quote = Quote.create -section = Section.create -strong = Strong.create -switch = Switch.create -text = Text.create -text_field = TextField.create -text_field_root = TextFieldRoot.create -text_field_slot = TextFieldSlot.create theme = Theme.create theme_panel = ThemePanel.create diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 46ef26214..0ed9f9c88 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -10,8 +10,13 @@ from reflex.vars import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] -LiteralSize = Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] -LiteralVariant = Literal["solid", "soft", "outline", "ghost"] +LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] +LiteralVariant = Literal["classic", "solid", "soft", "surface", "outline", "ghost"] +LiteralAppearance = Literal["inherit", "light", "dark"] +LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] +LiteralPanelBackground = Literal["solid", "transparent"] +LiteralRadius = Literal["none", "small", "medium", "large", "full"] +LiteralScaling = Literal["90%", "95%", "100%", "105%", "110%"] class CommonMarginProps(Component): @@ -101,11 +106,6 @@ LiteralAccentColor = Literal[ "bronze", "gray", ] -LiteralAppearance = Literal["inherit", "light", "dark"] -LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] -LiteralPanelBackground = Literal["solid", "transparent"] -LiteralRadius = Literal["none", "small", "medium", "large", "full"] -LiteralScaling = Literal["90%", "95%", "100%", "105%", "110%"] class Theme(RadixThemesComponent): diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index f22a09a27..deb800ca5 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -14,8 +14,13 @@ from reflex.vars import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] -LiteralSize = Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] -LiteralVariant = Literal["solid", "soft", "outline", "ghost"] +LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] +LiteralVariant = Literal["classic", "solid", "soft", "surface", "outline", "ghost"] +LiteralAppearance = Literal["inherit", "light", "dark"] +LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] +LiteralPanelBackground = Literal["solid", "transparent"] +LiteralRadius = Literal["none", "small", "medium", "large", "full"] +LiteralScaling = Literal["90%", "95%", "100%", "105%", "110%"] class CommonMarginProps(Component): @overload @@ -25,44 +30,44 @@ class CommonMarginProps(Component): *children, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -252,11 +257,6 @@ LiteralAccentColor = Literal[ "bronze", "gray", ] -LiteralAppearance = Literal["inherit", "light", "dark"] -LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] -LiteralPanelBackground = Literal["solid", "transparent"] -LiteralRadius = Literal["none", "small", "medium", "large", "full"] -LiteralScaling = Literal["90%", "95%", "100%", "105%", "110%"] class Theme(RadixThemesComponent): @overload diff --git a/reflex/components/radix/themes/components/__init__.py b/reflex/components/radix/themes/components/__init__.py new file mode 100644 index 000000000..ded7f5e57 --- /dev/null +++ b/reflex/components/radix/themes/components/__init__.py @@ -0,0 +1,189 @@ +"""Radix themes components.""" + +from .alertdialog import ( + AlertDialog, + AlertDialogContent, + AlertDialogDescription, + AlertDialogTitle, + AlertDialogTrigger, +) +from .aspectratio import AspectRatio +from .avatar import Avatar +from .badge import Badge +from .button import Button +from .callout import CalloutIcon, CalloutRoot, CalloutText +from .card import Card +from .checkbox import Checkbox +from .contextmenu import ( + ContextMenuContent, + ContextMenuItem, + ContextMenuRoot, + ContextMenuSeparator, + ContextMenuSub, + ContextMenuSubContent, + ContextMenuSubTrigger, + ContextMenuTrigger, +) +from .dialog import ( + DialogContent, + DialogDescription, + DialogRoot, + DialogTitle, + DialogTrigger, +) +from .dropdownmenu import ( + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuRoot, + DropdownMenuSeparator, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuTrigger, +) +from .hovercard import HoverCardContent, HoverCardRoot, HoverCardTrigger +from .iconbutton import IconButton +from .inset import Inset +from .popover import PopoverClose, PopoverContent, PopoverRoot, PopoverTrigger +from .radiogroup import RadioGroupItem, RadioGroupRoot +from .scrollarea import ScrollArea +from .select import ( + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectRoot, + SelectSeparator, + SelectTrigger, +) +from .separator import Separator +from .switch import Switch +from .table import ( + TableBody, + TableCell, + TableColumnHeaderCell, + TableHeader, + TableRoot, + TableRow, + TableRowHeaderCell, +) +from .tabs import TabsList, TabsRoot, TabsTrigger +from .textarea import TextArea +from .textfield import TextFieldInput, TextFieldRoot, TextFieldSlot + +# Alert Dialog +alertdialog = AlertDialog.create +alertdialog_trigger = AlertDialogTrigger.create +alertdialog_content = AlertDialogContent.create +alertdialog_title = AlertDialogTitle.create +alertdialog_description = AlertDialogDescription.create + +# Aspect Ratio +aspect_ratio = AspectRatio.create + +# Avatar +avatar = Avatar.create + +# Badge +badge = Badge.create + +# Button +button = Button.create + +# Callout +callout_root = CalloutRoot.create +callout_icon = CalloutIcon.create +callout_text = CalloutText.create + +# Card +card = Card.create + +# Checkbox +checkbox = Checkbox.create + +# Context Menu +contextmenu_root = ContextMenuRoot.create +contextmenu_sub = ContextMenuSub.create +contextmenu_trigger = ContextMenuTrigger.create +contextmenu_content = ContextMenuContent.create +contextmenu_sub_content = ContextMenuSubContent.create +contextmenu_sub_trigger = ContextMenuSubTrigger.create +contextmenu_item = ContextMenuItem.create +contextmenu_separator = ContextMenuSeparator.create + + +# Dialog +dialog_root = DialogRoot.create +dialog_trigger = DialogTrigger.create +dialog_content = DialogContent.create +dialog_title = DialogTitle.create +dialog_description = DialogDescription.create + +# Dropdown Menu +dropdownmenu_root = DropdownMenuRoot.create +dropdownmenu_trigger = DropdownMenuTrigger.create +dropdownmenu_content = DropdownMenuContent.create +dropdownmenu_sub_content = DropdownMenuSubContent.create +dropdownmenu_sub_trigger = DropdownMenuSubTrigger.create +dropdownmenu_item = DropdownMenuItem.create +dropdownmenu_separator = DropdownMenuSeparator.create + +# Hover Card +hovercard_root = HoverCardRoot.create +hovercard_trigger = HoverCardTrigger.create +hovercard_content = HoverCardContent.create + +# Icon Button +icon_button = IconButton.create + +# Inset +inset = Inset.create + +# Popover +popover_root = PopoverRoot.create +popover_trigger = PopoverTrigger.create +popover_content = PopoverContent.create +popover_close = PopoverClose.create + +# Radio Group +radio_group_root = RadioGroupRoot.create +radio_group_item = RadioGroupItem.create + +# Scroll Area +scroll_area = ScrollArea.create + +# Select +select_root = SelectRoot.create +select_trigger = SelectTrigger.create +select_content = SelectContent.create +select_item = SelectItem.create +select_separator = SelectSeparator.create +select_group = SelectGroup.create +select_label = SelectLabel.create + +# Separator +separator = Separator.create + +# Switch +switch = Switch.create + +# Table +table_root = TableRoot.create +table_header = TableHeader.create +table_body = TableBody.create +table_row = TableRow.create +table_cell = TableCell.create +table_column_header_cell = TableColumnHeaderCell.create +table_row_header_cell = TableRowHeaderCell.create + +# Tabs +tabs_root = TabsRoot.create +tabs_list = TabsList.create +tabs_trigger = TabsTrigger.create + +# Text Area +textarea = TextArea.create + +# Text Field +textfield_root = TextFieldRoot.create +textfield_input = TextFieldInput.create +textfield_slot = TextFieldSlot.create diff --git a/reflex/components/radix/themes/components/alertdialog.py b/reflex/components/radix/themes/components/alertdialog.py new file mode 100644 index 000000000..f4595cf53 --- /dev/null +++ b/reflex/components/radix/themes/components/alertdialog.py @@ -0,0 +1,72 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + + +class AlertDialog(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AlertDialog.Root" + + # The controlled open state of the dialog. + open: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class AlertDialogTrigger(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AlertDialog.Trigger" + + +class AlertDialogContent(el.Div, CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AlertDialog.Content" + + # Whether to force mount the content on open. + force_mount: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_auto_focus": lambda e0: [e0], + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + } + + +class AlertDialogTitle(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AlertDialog.Title" + + +class AlertDialogDescription(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AlertDialog.Description" diff --git a/reflex/components/radix/themes/components/alertdialog.pyi b/reflex/components/radix/themes/components/alertdialog.pyi new file mode 100644 index 000000000..7e36f5445 --- /dev/null +++ b/reflex/components/radix/themes/components/alertdialog.pyi @@ -0,0 +1,733 @@ +"""Stub file for reflex/components/radix/themes/components/alertdialog.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + +class AlertDialog(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + open: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AlertDialog": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + open: The controlled open state of the dialog. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class AlertDialogTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AlertDialogTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class AlertDialogContent(el.Div, CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + force_mount: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AlertDialogContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + force_mount: Whether to force mount the content on open. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class AlertDialogTitle(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AlertDialogTitle": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class AlertDialogDescription(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AlertDialogDescription": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/aspectratio.py b/reflex/components/radix/themes/components/aspectratio.py new file mode 100644 index 000000000..08bfc49f0 --- /dev/null +++ b/reflex/components/radix/themes/components/aspectratio.py @@ -0,0 +1,20 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal, Union + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + + +class AspectRatio(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "AspectRatio" + + # The ratio of the width to the height of the element + ration: Var[Union[float, int]] diff --git a/reflex/components/radix/themes/components/aspectratio.pyi b/reflex/components/radix/themes/components/aspectratio.pyi new file mode 100644 index 000000000..38bd9f9de --- /dev/null +++ b/reflex/components/radix/themes/components/aspectratio.pyi @@ -0,0 +1,144 @@ +"""Stub file for reflex/components/radix/themes/components/aspectratio.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal, Union +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + +class AspectRatio(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + ration: Optional[Union[Var[Union[float, int]], Union[float, int]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "AspectRatio": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + ration: The ratio of the width to the height of the element + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/avatar.py b/reflex/components/radix/themes/components/avatar.py new file mode 100644 index 000000000..8d0699c9f --- /dev/null +++ b/reflex/components/radix/themes/components/avatar.py @@ -0,0 +1,38 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralSize, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + + +class Avatar(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "Avatar" + + # The ratio of the width to the height of the element + ration: Var[float] + + # The variant of the avatar + variant: Var[Literal["solid", "soft"]] + + # The size of the avatar + size: Var[LiteralSize] + + # Color theme of the avatar + color: Var[LiteralAccentColor] + + # Whether to render the avatar with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi new file mode 100644 index 000000000..81cd470c0 --- /dev/null +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -0,0 +1,233 @@ +"""Stub file for reflex/components/radix/themes/components/avatar.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralSize, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + +class Avatar(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + ration: Optional[Union[Var[float], float]] = None, + variant: Optional[ + Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + ] = None, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Avatar": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + ration: The ratio of the width to the height of the element + variant: The variant of the avatar + size: The size of the avatar + color: Color theme of the avatar + high_contrast: Whether to render the avatar with higher contrast color against background + radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/badge.py b/reflex/components/radix/themes/components/badge.py new file mode 100644 index 000000000..babbbe825 --- /dev/null +++ b/reflex/components/radix/themes/components/badge.py @@ -0,0 +1,38 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + + +class Badge(el.Span, CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "Badge" + + # The ratio of the width to the height of the element + ration: Var[float] + + # The variant of the avatar + variant: Var[Literal["solid", "soft", "surface", "outline"]] + + # The size of the avatar + size: Var[Literal[1, 2]] + + # Color theme of the avatar + color: Var[LiteralAccentColor] + + # Whether to render the avatar with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi new file mode 100644 index 000000000..fc455e6d5 --- /dev/null +++ b/reflex/components/radix/themes/components/badge.pyi @@ -0,0 +1,291 @@ +"""Stub file for reflex/components/radix/themes/components/badge.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + +class Badge(el.Span, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + ration: Optional[Union[Var[float], float]] = None, + variant: Optional[ + Union[ + Var[Literal["solid", "soft", "surface", "outline"]], + Literal["solid", "soft", "surface", "outline"], + ] + ] = None, + size: Optional[Union[Var[Literal[1, 2]], Literal[1, 2]]] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Badge": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + ration: The ratio of the width to the height of the element + variant: The variant of the avatar + size: The size of the avatar + color: Color theme of the avatar + high_contrast: Whether to render the avatar with higher contrast color against background + radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/button.py b/reflex/components/radix/themes/components/button.py new file mode 100644 index 000000000..2be972a12 --- /dev/null +++ b/reflex/components/radix/themes/components/button.py @@ -0,0 +1,39 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralButtonSize = Literal[1, 2, 3, 4] + + +class Button(el.Button, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Button" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "4" + size: Var[LiteralButtonSize] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi new file mode 100644 index 000000000..9f4830eb8 --- /dev/null +++ b/reflex/components/radix/themes/components/button.pyi @@ -0,0 +1,330 @@ +"""Stub file for reflex/components/radix/themes/components/button.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralButtonSize = Literal[1, 2, 3, 4] + +class Button(el.Button, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[Union[Var[Literal[1, 2, 3, 4]], Literal[1, 2, 3, 4]]] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + auto_focus: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + disabled: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + form_action: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_enc_type: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_method: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_no_validate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_target: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + type: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + value: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Button": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "4" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + auto_focus: Automatically focuses the button when the page loads + disabled: Disables the button + form: Associates the button with a form (by id) + form_action: URL to send the form data to (for type="submit" buttons) + form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons) + form_method: HTTP method to use for sending form data (for type="submit" buttons) + form_no_validate: Bypasses form validation when submitting (for type="submit" buttons) + form_target: Specifies where to display the response after submitting the form (for type="submit" buttons) + name: Name of the button, used when sending form data + type: Type of the button (submit, reset, or button) + value: Value of the button, used when sending form data + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/callout.py b/reflex/components/radix/themes/components/callout.py new file mode 100644 index 000000000..cb0bae91d --- /dev/null +++ b/reflex/components/radix/themes/components/callout.py @@ -0,0 +1,49 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + + +class CalloutRoot(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Callout.Root" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "4" + size: Var[Literal["1", "2", "3"]] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] + + +class CalloutIcon(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Callout.Icon" + + +class CalloutText(el.P, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Callout.Text" diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi new file mode 100644 index 000000000..c69771d4a --- /dev/null +++ b/reflex/components/radix/themes/components/callout.pyi @@ -0,0 +1,668 @@ +"""Stub file for reflex/components/radix/themes/components/callout.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +class CalloutRoot(el.Div, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "CalloutRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "4" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class CalloutIcon(el.Div, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "CalloutIcon": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class CalloutText(el.P, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "CalloutText": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/card.py b/reflex/components/radix/themes/components/card.py new file mode 100644 index 000000000..746eb82f4 --- /dev/null +++ b/reflex/components/radix/themes/components/card.py @@ -0,0 +1,25 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class Card(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Card" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "5" + size: Var[Literal[1, 2, 3, 4, 5]] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[Literal["surface", "classic", "ghost"]] diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi new file mode 100644 index 000000000..437c5d24c --- /dev/null +++ b/reflex/components/radix/themes/components/card.pyi @@ -0,0 +1,214 @@ +"""Stub file for reflex/components/radix/themes/components/card.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class Card(el.Div, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[Var[Literal[1, 2, 3, 4, 5]], Literal[1, 2, 3, 4, 5]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["surface", "classic", "ghost"]], + Literal["surface", "classic", "ghost"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Card": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "5" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/checkbox.py b/reflex/components/radix/themes/components/checkbox.py new file mode 100644 index 000000000..19267bac1 --- /dev/null +++ b/reflex/components/radix/themes/components/checkbox.py @@ -0,0 +1,67 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralCheckboxSize = Literal["1", "2", "3"] + + +class Checkbox(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Checkbox" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "3" + size: Var[LiteralCheckboxSize] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] + + # Whether the checkbox is checked by default + default_checked: Var[bool] + + # Whether the checkbox is checked + checked: Var[bool] + + # Whether the checkbox is disabled + disabled: Var[bool] + + # Whether the checkbox is required + required: Var[bool] + + # The name of the checkbox control when submitting the form. + name: Var[str] + + # The value of the checkbox control when submitting the form. + value: Var[str] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_checked_change": lambda e0: [e0], + } diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi new file mode 100644 index 000000000..d74a5c3ce --- /dev/null +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -0,0 +1,249 @@ +"""Stub file for reflex/components/radix/themes/components/checkbox.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralCheckboxSize = Literal["1", "2", "3"] + +class Checkbox(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + default_checked: Optional[Union[Var[bool], bool]] = None, + checked: Optional[Union[Var[bool], bool]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], bool]] = None, + name: Optional[Union[Var[str], str]] = None, + value: Optional[Union[Var[str], str]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_checked_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Checkbox": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "3" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + default_checked: Whether the checkbox is checked by default + checked: Whether the checkbox is checked + disabled: Whether the checkbox is disabled + required: Whether the checkbox is required + name: The name of the checkbox control when submitting the form. + value: The value of the checkbox control when submitting the form. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/contextmenu.py b/reflex/components/radix/themes/components/contextmenu.py new file mode 100644 index 000000000..1d5b3a1f5 --- /dev/null +++ b/reflex/components/radix/themes/components/contextmenu.py @@ -0,0 +1,134 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) + + +class ContextMenuRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Root" + + # 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: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class ContextMenuTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Trigger" + + # Whether the trigger is disabled + disabled: Var[bool] + + +class ContextMenuContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Content" + + # Button size "1" - "4" + size: Var[Literal["1", "2"]] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[Literal["solid", "soft"]] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # The vertical distance in pixels from the anchor. + align_offset: Var[int] + + # When true, overrides the side andalign preferences to prevent collisions with boundary edges. + avoid_collisions: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + "on_focus_outside": lambda e0: [e0], + "on_interact_outside": lambda e0: [e0], + } + + +class ContextMenuSub(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Sub" + + +class ContextMenuSubTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.SubTrigger" + + # Whether the trigger is disabled + disabled: Var[bool] + + +class ContextMenuSubContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.SubContent" + + # When true, keyboard navigation will loop from last item to first, and vice versa. + loop: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + "on_focus_outside": lambda e0: [e0], + "on_interact_outside": lambda e0: [e0], + } + + +class ContextMenuItem(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Item" + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Shortcut to render a menu item as a link + shortcut: Var[str] + + +class ContextMenuSeparator(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ContextMenu.Separator" diff --git a/reflex/components/radix/themes/typography.pyi b/reflex/components/radix/themes/components/contextmenu.pyi similarity index 58% rename from reflex/components/radix/themes/typography.pyi rename to reflex/components/radix/themes/components/contextmenu.pyi index 121a256f8..89d4ba91b 100644 --- a/reflex/components/radix/themes/typography.pyi +++ b/reflex/components/radix/themes/components/contextmenu.pyi @@ -1,4 +1,4 @@ -"""Stub file for reflex/components/radix/themes/typography.py""" +"""Stub file for reflex/components/radix/themes/components/contextmenu.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `scripts/pyi_generator.py`! # ------------------------------------------------------ @@ -7,155 +7,191 @@ from typing import Any, Dict, Literal, Optional, Union, overload from reflex.vars import Var, BaseVar, ComputedVar from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style -from typing import Literal +from typing import Any, Dict, Literal from reflex.vars import Var -from .base import ( - CommonMarginProps, - LiteralAccentColor, - LiteralVariant, - RadixThemesComponent, -) +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent -LiteralTextWeight = Literal["light", "regular", "medium", "bold"] -LiteralTextAlign = Literal["left", "center", "right"] -LiteralTextSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] -LiteralTextTrim = Literal["normal", "start", "end", "both"] - -class Text(CommonMarginProps, RadixThemesComponent): +class ContextMenuRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore cls, *children, - as_child: Optional[Union[Var[bool], bool]] = None, - as_: Optional[Union[Var[str], str]] = None, - size: Optional[ + modal: Optional[Union[Var[bool], bool]] = None, + m: Optional[ Union[ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, - weight: Optional[ - Union[ - Var[Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], - ] - ] = None, - align: Optional[ - Union[ - Var[Literal["left", "center", "right"]], - Literal["left", "center", "right"], - ] - ] = None, - trim: Optional[ - Union[ - Var[Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], - ] - ] = None, - color: Optional[ - Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ], - ] - ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "ContextMenuRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *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. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class ContextMenuTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + disabled: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -210,7 +246,7 @@ class Text(CommonMarginProps, RadixThemesComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Text": + ) -> "ContextMenuTrigger": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -218,14 +254,7 @@ class Text(CommonMarginProps, RadixThemesComponent): Args: *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - as_: Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) - size: Text size: "1" - "9" - weight: Thickness of text: "light" | "regular" | "medium" | "bold" - align: Alignment of text in element: "left" | "center" | "right" - trim: Removes the leading trim space: "normal" | "start" | "end" | "both" - color: Overrides the accent color inherited from the Theme. - high_contrast: Whether to render the text with higher contrast color + disabled: Whether the trigger is disabled m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -246,461 +275,16 @@ class Text(CommonMarginProps, RadixThemesComponent): """ ... -class Heading(Text): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_child: Optional[Union[Var[bool], bool]] = None, - as_: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - weight: Optional[ - Union[ - Var[Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], - ] - ] = None, - align: Optional[ - Union[ - Var[Literal["left", "center", "right"]], - Literal["left", "center", "right"], - ] - ] = None, - trim: Optional[ - Union[ - Var[Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], - ] - ] = None, - color: Optional[ - Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ], - ] - ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Heading": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - as_: Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) - size: Text size: "1" - "9" - weight: Thickness of text: "light" | "regular" | "medium" | "bold" - align: Alignment of text in element: "left" | "center" | "right" - trim: Removes the leading trim space: "normal" | "start" | "end" | "both" - color: Overrides the accent color inherited from the Theme. - high_contrast: Whether to render the text with higher contrast color - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -class Blockquote(CommonMarginProps, RadixThemesComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - size: Optional[ - Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - weight: Optional[ - Union[ - Var[Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], - ] - ] = None, - color: Optional[ - Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ], - ] - ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Blockquote": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - size: Text size: "1" - "9" - weight: Thickness of text: "light" | "regular" | "medium" | "bold" - color: Overrides the accent color inherited from the Theme. - high_contrast: Whether to render the text with higher contrast color - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -class Code(Blockquote): +class ContextMenuContent(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore cls, *children, + size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None, variant: Optional[ - Union[ - Var[Literal["solid", "soft", "outline", "ghost"]], - Literal["solid", "soft", "outline", "ghost"], - ] - ] = None, - size: Optional[ - Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - weight: Optional[ - Union[ - Var[Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], - ] + Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] ] = None, color: Optional[ Union[ @@ -765,313 +349,197 @@ class Code(Blockquote): ] ] = None, high_contrast: Optional[Union[Var[bool], bool]] = None, + align_offset: Optional[Union[Var[int], int]] = None, + avoid_collisions: Optional[Union[Var[bool], bool]] = None, m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Code": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - variant: The visual variant to apply: "solid" | "soft" | "outline" | "ghost" - size: Text size: "1" - "9" - weight: Thickness of text: "light" | "regular" | "medium" | "bold" - color: Overrides the accent color inherited from the Theme. - high_contrast: Whether to render the text with higher contrast color - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -class Em(CommonMarginProps, RadixThemesComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Em": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -class Kbd(CommonMarginProps, RadixThemesComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - size: Optional[ Union[ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_interact_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "ContextMenuContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Button size "1" - "4" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + 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. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class ContextMenuSub(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -1126,7 +594,7 @@ class Kbd(CommonMarginProps, RadixThemesComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Kbd": + ) -> "ContextMenuSub": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -1134,7 +602,6 @@ class Kbd(CommonMarginProps, RadixThemesComponent): Args: *children: Child components. - size: Text size: "1" - "9" m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -1155,39 +622,285 @@ class Kbd(CommonMarginProps, RadixThemesComponent): """ ... -LiteralLinkUnderline = Literal["auto", "hover", "always"] - -class Link(CommonMarginProps, RadixThemesComponent): +class ContextMenuSubTrigger(CommonMarginProps, RadixThemesComponent): @overload @classmethod def create( # type: ignore cls, *children, - as_child: Optional[Union[Var[bool], bool]] = None, - size: Optional[ + disabled: Optional[Union[Var[bool], bool]] = None, + m: Optional[ Union[ Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, - weight: Optional[ + mx: Optional[ Union[ - Var[Literal["light", "regular", "medium", "bold"]], - Literal["light", "regular", "medium", "bold"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, - trim: Optional[ + my: Optional[ Union[ - Var[Literal["normal", "start", "end", "both"]], - Literal["normal", "start", "end", "both"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, - underline: Optional[ + mt: Optional[ Union[ - Var[Literal["auto", "hover", "always"]], - Literal["auto", "hover", "always"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "ContextMenuSubTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + disabled: Whether the trigger is disabled + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class ContextMenuSubContent(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + loop: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_interact_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "ContextMenuSubContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + loop: When true, keyboard navigation will loop from last item to first, and vice versa. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class ContextMenuItem(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, color: Optional[ Union[ Var[ @@ -1250,47 +963,47 @@ class Link(CommonMarginProps, RadixThemesComponent): ], ] ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, + shortcut: Optional[Union[Var[str], str]] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -1345,7 +1058,7 @@ class Link(CommonMarginProps, RadixThemesComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Link": + ) -> "ContextMenuItem": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -1353,13 +1066,8 @@ class Link(CommonMarginProps, RadixThemesComponent): Args: *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - size: Text size: "1" - "9" - weight: Thickness of text: "light" | "regular" | "medium" | "bold" - trim: Removes the leading trim space: "normal" | "start" | "end" | "both" - underline: Sets the visibility of the underline affordance: "auto" | "hover" | "always" - color: Overrides the accent color inherited from the Theme. - high_contrast: Whether to render the text with higher contrast color + color: Override theme color for button + shortcut: Shortcut to render a menu item as a link m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -1380,7 +1088,7 @@ class Link(CommonMarginProps, RadixThemesComponent): """ ... -class Quote(CommonMarginProps, RadixThemesComponent): +class ContextMenuSeparator(CommonMarginProps, RadixThemesComponent): @overload @classmethod def create( # type: ignore @@ -1388,44 +1096,44 @@ class Quote(CommonMarginProps, RadixThemesComponent): *children, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -1480,135 +1188,7 @@ class Quote(CommonMarginProps, RadixThemesComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Quote": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -class Strong(CommonMarginProps, RadixThemesComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Strong": + ) -> "ContextMenuSeparator": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with diff --git a/reflex/components/radix/themes/components/dialog.py b/reflex/components/radix/themes/components/dialog.py new file mode 100644 index 000000000..5a857b44f --- /dev/null +++ b/reflex/components/radix/themes/components/dialog.py @@ -0,0 +1,75 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class DialogRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Dialog.Root" + + # The controlled open state of the dialog. + open: Var[bool] + + # 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] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class DialogTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Dialog.Trigger" + + +class DialogTitle(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Dialog.Title" + + +class DialogContent(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Dialog.Content" + + # Button size "1" - "4" + size: Var[Literal[1, 2, 3, 4]] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_auto_focus": lambda e0: [e0], + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + "on_interact_outside": lambda e0: [e0], + } + + +class DialogDescription(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Dialog.Description" diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi new file mode 100644 index 000000000..762b0ef8f --- /dev/null +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -0,0 +1,739 @@ +"""Stub file for reflex/components/radix/themes/components/dialog.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class DialogRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + open: Optional[Union[Var[bool], bool]] = None, + modal: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DialogRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + open: The controlled open state of the dialog. + modal: 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. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DialogTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DialogTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DialogTitle(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DialogTitle": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DialogContent(el.Div, CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3, 4]], Literal[1, 2, 3, 4]]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_interact_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DialogContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Button size "1" - "4" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DialogDescription(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DialogDescription": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/dropdownmenu.py b/reflex/components/radix/themes/components/dropdownmenu.py new file mode 100644 index 000000000..7857516b8 --- /dev/null +++ b/reflex/components/radix/themes/components/dropdownmenu.py @@ -0,0 +1,101 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) + + +class DropdownMenuRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.Root" + + # The controlled open state of the dropdown menu. Must be used in conjunction with onOpenChange. + open: Var[bool] + + # The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers. + modal: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class DropdownMenuTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.Trigger" + + +class DropdownMenuContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.Content" + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + "on_interact_outside": lambda e0: [e0], + } + + +class DropdownMenuSubTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.SubTrigger" + + +class DropdownMenuSubContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.SubContent" + + # Button size "1" - "4" + size: Var[Literal["1", "2"]] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[Literal["solid", "soft"]] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + +class DropdownMenuItem(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.Item" + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Shortcut to render a menu item as a link + shortcut: Var[str] + + +class DropdownMenuSeparator(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "DropdownMenu.Separator" diff --git a/reflex/components/radix/themes/components/dropdownmenu.pyi b/reflex/components/radix/themes/components/dropdownmenu.pyi new file mode 100644 index 000000000..f5c9f80c7 --- /dev/null +++ b/reflex/components/radix/themes/components/dropdownmenu.pyi @@ -0,0 +1,1065 @@ +"""Stub file for reflex/components/radix/themes/components/dropdownmenu.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent + +class DropdownMenuRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + open: Optional[Union[Var[bool], bool]] = None, + modal: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + open: The controlled open state of the dropdown menu. Must be used in conjunction with onOpenChange. + modal: The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuContent(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_interact_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuSubTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuSubTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuSubContent(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None, + variant: Optional[ + Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuSubContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Button size "1" - "4" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuItem(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + shortcut: Optional[Union[Var[str], str]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuItem": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + color: Override theme color for button + shortcut: Shortcut to render a menu item as a link + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class DropdownMenuSeparator(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "DropdownMenuSeparator": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/hovercard.py b/reflex/components/radix/themes/components/hovercard.py new file mode 100644 index 000000000..e3af01bf4 --- /dev/null +++ b/reflex/components/radix/themes/components/hovercard.py @@ -0,0 +1,63 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class HoverCardRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "HoverCard.Root" + + # The open state of the hover card when it is initially rendered. Use when you do not need to control its open state. + default_open: Var[bool] + + # The controlled open state of the hover card. Must be used in conjunction with onOpenChange. + open: Var[bool] + + # The duration from when the mouse enters the trigger until the hover card opens. + open_delay: Var[int] + + # The duration from when the mouse leaves the trigger until the hover card closes. + close_delay: Var[int] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class HoverCardTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "HoverCard.Trigger" + + +class HoverCardContent(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "HoverCard.Content" + + # The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. + side: Var[Literal["top", "right", "bottom", "left"]] + + # The distance in pixels from the trigger. + side_offset: Var[int] + + # The preferred alignment against the trigger. May change when collisions occur. + align: Var[Literal["start", "center", "end"]] + + # Whether or not the hover card should avoid collisions with its trigger. + avoid_collisions: Var[bool] diff --git a/reflex/components/radix/themes/components/hovercard.pyi b/reflex/components/radix/themes/components/hovercard.pyi new file mode 100644 index 000000000..34a20a716 --- /dev/null +++ b/reflex/components/radix/themes/components/hovercard.pyi @@ -0,0 +1,487 @@ +"""Stub file for reflex/components/radix/themes/components/hovercard.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class HoverCardRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + default_open: Optional[Union[Var[bool], bool]] = None, + open: Optional[Union[Var[bool], bool]] = None, + open_delay: Optional[Union[Var[int], int]] = None, + close_delay: Optional[Union[Var[int], int]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "HoverCardRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + default_open: The open state of the hover card when it is initially rendered. Use when you do not need to control its open state. + open: The controlled open state of the hover card. Must be used in conjunction with onOpenChange. + open_delay: The duration from when the mouse enters the trigger until the hover card opens. + close_delay: The duration from when the mouse leaves the trigger until the hover card closes. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class HoverCardTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "HoverCardTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class HoverCardContent(el.Div, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + side: Optional[ + Union[ + Var[Literal["top", "right", "bottom", "left"]], + Literal["top", "right", "bottom", "left"], + ] + ] = None, + side_offset: Optional[Union[Var[int], int]] = None, + align: Optional[ + Union[ + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], + ] + ] = None, + avoid_collisions: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "HoverCardContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + align: The preferred alignment against the trigger. May change when collisions occur. + avoid_collisions: Whether or not the hover card should avoid collisions with its trigger. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/iconbutton.py b/reflex/components/radix/themes/components/iconbutton.py new file mode 100644 index 000000000..3a9e958f4 --- /dev/null +++ b/reflex/components/radix/themes/components/iconbutton.py @@ -0,0 +1,39 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralButtonSize = Literal["1", "2", "3", "4"] + + +class IconButton(el.Button, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Button" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "4" + size: Var[LiteralButtonSize] + + # Variant of button: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] diff --git a/reflex/components/radix/themes/components/iconbutton.pyi b/reflex/components/radix/themes/components/iconbutton.pyi new file mode 100644 index 000000000..6940cba7e --- /dev/null +++ b/reflex/components/radix/themes/components/iconbutton.pyi @@ -0,0 +1,332 @@ +"""Stub file for reflex/components/radix/themes/components/iconbutton.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralButtonSize = Literal["1", "2", "3", "4"] + +class IconButton(el.Button, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + auto_focus: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + disabled: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + form_action: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_enc_type: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_method: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_no_validate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_target: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + type: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + value: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "IconButton": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "4" + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + auto_focus: Automatically focuses the button when the page loads + disabled: Disables the button + form: Associates the button with a form (by id) + form_action: URL to send the form data to (for type="submit" buttons) + form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons) + form_method: HTTP method to use for sending form data (for type="submit" buttons) + form_no_validate: Bypasses form validation when submitting (for type="submit" buttons) + form_target: Specifies where to display the response after submitting the form (for type="submit" buttons) + name: Name of the button, used when sending form data + type: Type of the button (submit, reset, or button) + value: Value of the button, used when sending form data + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/inset.py b/reflex/components/radix/themes/components/inset.py new file mode 100644 index 000000000..65c244cdf --- /dev/null +++ b/reflex/components/radix/themes/components/inset.py @@ -0,0 +1,44 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal, Union + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + +LiteralButtonSize = Literal["1", "2", "3", "4"] + + +class Inset(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Inset" + + # The side + side: Var[Literal["x", "y", "top", "bottom", "right", "left"]] + + clip: Var[Literal["border-box", "padding-box"]] + + # Padding + p: Var[Union[int, str]] + + # Padding on the x axis + px: Var[Union[int, str]] + + # Padding on the y axis + py: Var[Union[int, str]] + + # Padding on the top + pt: Var[Union[int, str]] + + # Padding on the right + pr: Var[Union[int, str]] + + # Padding on the bottom + pb: Var[Union[int, str]] + + # Padding on the left + pl: Var[Union[int, str]] diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi new file mode 100644 index 000000000..b59724ff1 --- /dev/null +++ b/reflex/components/radix/themes/components/inset.pyi @@ -0,0 +1,230 @@ +"""Stub file for reflex/components/radix/themes/components/inset.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal, Union +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +LiteralButtonSize = Literal["1", "2", "3", "4"] + +class Inset(el.Div, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + side: Optional[ + Union[ + Var[Literal["x", "y", "top", "bottom", "right", "left"]], + Literal["x", "y", "top", "bottom", "right", "left"], + ] + ] = None, + clip: Optional[ + Union[ + Var[Literal["border-box", "padding-box"]], + Literal["border-box", "padding-box"], + ] + ] = None, + p: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + px: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + py: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + pt: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + pr: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + pb: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + pl: Optional[Union[Var[Union[int, str]], Union[int, str]]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Inset": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + side: The side + p: Padding + px: Padding on the x axis + py: Padding on the y axis + pt: Padding on the top + pr: Padding on the right + pb: Padding on the bottom + pl: Padding on the left + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/popover.py b/reflex/components/radix/themes/components/popover.py new file mode 100644 index 000000000..e22fb95b5 --- /dev/null +++ b/reflex/components/radix/themes/components/popover.py @@ -0,0 +1,85 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class PopoverRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Popover.Root" + + # The controlled open state of the popover. + open: Var[bool] + + # 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: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + } + + +class PopoverTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Popover.Trigger" + + +class PopoverContent(el.Div, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Popover.Content" + + # Size of the button: "1" | "2" | "3" | "4" + size: Var[Literal[1, 2, 3, 4]] + + # The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. + side: Var[Literal["top", "right", "bottom", "left"]] + + # The distance in pixels from the anchor. + side_offset: Var[int] + + # The preferred alignment against the anchor. May change when collisions occur. + align: Var[Literal["start", "center", "end"]] + + # The vertical distance in pixels from the anchor. + align_offset: Var[int] + + # When true, overrides the side andalign preferences to prevent collisions with boundary edges. + avoid_collisions: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_auto_focus": lambda e0: [e0], + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + "on_focus_outside": lambda e0: [e0], + "on_interact_outside": lambda e0: [e0], + } + + +class PopoverClose(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Popover.Close" diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi new file mode 100644 index 000000000..57dc1e492 --- /dev/null +++ b/reflex/components/radix/themes/components/popover.pyi @@ -0,0 +1,634 @@ +"""Stub file for reflex/components/radix/themes/components/popover.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class PopoverRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + open: Optional[Union[Var[bool], bool]] = None, + modal: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "PopoverRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class PopoverTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "PopoverTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class PopoverContent(el.Div, CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3, 4]], Literal[1, 2, 3, 4]]] = None, + side: Optional[ + Union[ + Var[Literal["top", "right", "bottom", "left"]], + Literal["top", "right", "bottom", "left"], + ] + ] = None, + side_offset: Optional[Union[Var[int], int]] = None, + align: Optional[ + Union[ + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], + ] + ] = None, + align_offset: Optional[Union[Var[int], int]] = None, + avoid_collisions: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_interact_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "PopoverContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Size of the button: "1" | "2" | "3" | "4" + side: The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. + side_offset: The distance in pixels from the anchor. + align: The preferred alignment against the anchor. May change when collisions occur. + 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. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class PopoverClose(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "PopoverClose": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/radiogroup.py b/reflex/components/radix/themes/components/radiogroup.py new file mode 100644 index 000000000..897a0c8d1 --- /dev/null +++ b/reflex/components/radix/themes/components/radiogroup.py @@ -0,0 +1,72 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) + + +class RadioGroupRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "RadioGroup.Root" + + # The size of the radio group: "1" | "2" | "3" + size: Var[Literal[1, 2, 3]] + + # The variant of the radio group + variant: Var[Literal["classic", "surface", "soft"]] + + # The color of the radio group + color: Var[LiteralAccentColor] + + # Whether to render the radio group with higher contrast color against background + high_contrast: Var[bool] + + # The controlled value of the radio item to check. Should be used in conjunction with onValueChange. + value: Var[str] + + # The initial value of checked radio item. Should be used in conjunction with onValueChange. + default_value: Var[str] + + # Whether the radio group is disabled + disabled: Var[bool] + + # Whether the radio group is required + required: Var[bool] + + # The orientation of the component. + orientation: Var[Literal["horizontal", "vertical"]] + + # When true, keyboard navigation will loop from last item to first, and vice versa. + loop: Var[bool] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_value_change": lambda e0: [e0], + } + + +class RadioGroupItem(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "RadioGroup.Item" + + # The value of the radio item to check. Should be used in conjunction with onCheckedChange. + value: Var[str] + + # When true, prevents the user from interacting with the radio item. + disabled: Var[bool] + + # When true, indicates that the user must check the radio item before the owning form can be submitted. + required: Var[bool] diff --git a/reflex/components/radix/themes/components/radiogroup.pyi b/reflex/components/radix/themes/components/radiogroup.pyi new file mode 100644 index 000000000..e0eda8357 --- /dev/null +++ b/reflex/components/radix/themes/components/radiogroup.pyi @@ -0,0 +1,369 @@ +"""Stub file for reflex/components/radix/themes/components/radiogroup.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent + +class RadioGroupRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "surface", "soft"]], + Literal["classic", "surface", "soft"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + value: Optional[Union[Var[str], str]] = None, + default_value: Optional[Union[Var[str], str]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], bool]] = None, + orientation: Optional[ + Union[ + Var[Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], + ] + ] = None, + loop: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_value_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "RadioGroupRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the radio group: "1" | "2" | "3" + variant: The variant of the radio group + color: The color of the radio group + high_contrast: Whether to render the radio group with higher contrast color against background + value: The controlled value of the radio item to check. Should be used in conjunction with onValueChange. + default_value: The initial value of checked radio item. Should be used in conjunction with onValueChange. + disabled: Whether the radio group is disabled + required: Whether the radio group is required + orientation: The orientation of the component. + loop: When true, keyboard navigation will loop from last item to first, and vice versa. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class RadioGroupItem(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + value: Optional[Union[Var[str], str]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "RadioGroupItem": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + value: The value of the radio item to check. Should be used in conjunction with onCheckedChange. + disabled: When true, prevents the user from interacting with the radio item. + required: When true, indicates that the user must check the radio item before the owning form can be submitted. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/scrollarea.py b/reflex/components/radix/themes/components/scrollarea.py new file mode 100644 index 000000000..ba3573e8c --- /dev/null +++ b/reflex/components/radix/themes/components/scrollarea.py @@ -0,0 +1,31 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralRadius, + RadixThemesComponent, +) + + +class ScrollArea(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "ScrollArea" + + # The size of the radio group: "1" | "2" | "3" + size: Var[Literal[1, 2, 3]] + + # The radius of the radio group + radius: Var[LiteralRadius] + + # The alignment of the scroll area + scrollbars: Var[Literal["vertical", "horizontal", "both"]] + + # Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars. "auto" | "always" | "scroll" | "hover" + type_: Var[Literal["auto", "always", "scroll", "hover"]] + + # If type is set to either "scroll" or "hover", this prop determines the length of time, in milliseconds, before the scrollbars are hidden after the user stops interacting with scrollbars. + scroll_hide_delay: Var[int] diff --git a/reflex/components/radix/themes/components/scrollarea.pyi b/reflex/components/radix/themes/components/scrollarea.pyi new file mode 100644 index 000000000..859f20fa8 --- /dev/null +++ b/reflex/components/radix/themes/components/scrollarea.pyi @@ -0,0 +1,165 @@ +"""Stub file for reflex/components/radix/themes/components/scrollarea.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralRadius, RadixThemesComponent + +class ScrollArea(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + scrollbars: Optional[ + Union[ + Var[Literal["vertical", "horizontal", "both"]], + Literal["vertical", "horizontal", "both"], + ] + ] = None, + type_: Optional[ + Union[ + Var[Literal["auto", "always", "scroll", "hover"]], + Literal["auto", "always", "scroll", "hover"], + ] + ] = None, + scroll_hide_delay: Optional[Union[Var[int], int]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "ScrollArea": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the radio group: "1" | "2" | "3" + radius: The radius of the radio group + scrollbars: The alignment of the scroll area + type_: Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars. "auto" | "always" | "scroll" | "hover" + scroll_hide_delay: If type is set to either "scroll" or "hover", this prop determines the length of time, in milliseconds, before the scrollbars are hidden after the user stops interacting with scrollbars. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py new file mode 100644 index 000000000..7a3fb3c8d --- /dev/null +++ b/reflex/components/radix/themes/components/select.py @@ -0,0 +1,137 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + RadixThemesComponent, +) + +LiteralButtonSize = Literal[1, 2, 3, 4] + + +class SelectRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Root" + + # The size of the select: "1" | "2" | "3" + size: Var[Literal[1, 2, 3]] + + # The value of the select when initially rendered. Use when you do not need to control the state of the select. + default_value: Var[str] + + # The controlled value of the select. Use when you need to control the state of the select. + value: Var[str] + + # The open state of the select when it is initially rendered. Use when you do not need to control its open state. + default_open: Var[bool] + + # The controlled open state of the select. Must be used in conjunction with onOpenChange. + open: Var[bool] + + # The name of the select control when submitting the form. + name: Var[str] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_open_change": lambda e0: [e0], + "on_value_change": lambda e0: [e0], + } + + +class SelectTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Trigger" + + # Variant of the select trigger + variant: Var[Literal["classic", "surface", "soft", "ghost"]] + + # The color of the select trigger + color: Var[LiteralAccentColor] + + # The radius of the select trigger + radius: Var[LiteralRadius] + + # The placeholder of the select trigger + placeholder: Var[str] + + +class SelectContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Content" + + # The variant of the select content + variant: Var[Literal["solid", "soft"]] + + # The color of the select content + color: Var[LiteralAccentColor] + + # Whether to render the select content with higher contrast color against background + high_contrast: Var[bool] + + # The positioning mode to use, item-aligned is the default and behaves similarly to a native MacOS menu by positioning content relative to the active item. popper positions content in the same way as our other primitives, for example Popover or DropdownMenu. + position: Var[Literal["item-aligned", "popper"]] + + # The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. Only available when position is set to popper. + side: Var[Literal["top", "right", "bottom", "left"]] + + # The distance in pixels from the anchor. Only available when position is set to popper. + side_offset: Var[int] + + # The preferred alignment against the anchor. May change when collisions occur. Only available when position is set to popper. + align: Var[Literal["start", "center", "end"]] + + # The vertical distance in pixels from the anchor. Only available when position is set to popper. + align_offset: Var[int] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_close_auto_focus": lambda e0: [e0], + "on_escape_key_down": lambda e0: [e0], + "on_pointer_down_outside": lambda e0: [e0], + } + + +class SelectGroup(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Group" + + +class SelectItem(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Item" + + # The value of the select item when submitting the form. + value: Var[str] + + +class SelectLabel(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Label" + + +class SelectSeparator(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Select.Separator" diff --git a/reflex/components/radix/themes/layout.pyi b/reflex/components/radix/themes/components/select.pyi similarity index 52% rename from reflex/components/radix/themes/layout.pyi rename to reflex/components/radix/themes/components/select.pyi index 5d085f26f..0a9d8b142 100644 --- a/reflex/components/radix/themes/layout.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -1,4 +1,4 @@ -"""Stub file for reflex/components/radix/themes/layout.py""" +"""Stub file for reflex/components/radix/themes/components/select.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `scripts/pyi_generator.py`! # ------------------------------------------------------ @@ -7,108 +7,285 @@ from typing import Any, Dict, Literal, Optional, Union, overload from reflex.vars import Var, BaseVar, ComputedVar from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style -from typing import Literal +from typing import Any, Dict, Literal from reflex.vars import Var -from .base import ( +from ..base import ( CommonMarginProps, - LiteralAlign, - LiteralJustify, - LiteralSize, + LiteralAccentColor, + LiteralRadius, RadixThemesComponent, ) -LiteralBoolNumber = Literal["0", "1"] +LiteralButtonSize = Literal[1, 2, 3, 4] -class LayoutComponent(CommonMarginProps, RadixThemesComponent): +class SelectRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore cls, *children, - p: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - px: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - py: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pl: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + default_value: Optional[Union[Var[str], str]] = None, + value: Optional[Union[Var[str], str]] = None, + default_open: Optional[Union[Var[bool], bool]] = None, + open: Optional[Union[Var[bool], bool]] = None, + name: Optional[Union[Var[str], str]] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_open_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_value_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "SelectRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the select: "1" | "2" | "3" + default_value: The value of the select when initially rendered. Use when you do not need to control the state of the select. + value: The controlled value of the select. Use when you need to control the state of the select. + default_open: The open state of the select when it is initially rendered. Use when you do not need to control its open state. + open: The controlled open state of the select. Must be used in conjunction with onOpenChange. + name: The name of the select control when submitting the form. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class SelectTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + variant: Optional[ + Union[ + Var[Literal["classic", "surface", "soft", "ghost"]], + Literal["classic", "surface", "soft", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + placeholder: Optional[Union[Var[str], str]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -163,7 +340,7 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "LayoutComponent": + ) -> "SelectTrigger": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -171,15 +348,10 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): Args: *children: Child components. - p: Padding: "0" - "9" - px: Padding horizontal: "0" - "9" - py: Padding vertical: "0" - "9" - pt: Padding top: "0" - "9" - pr: Padding right: "0" - "9" - pb: Padding bottom: "0" - "9" - pl: Padding left: "0" - "9" - shrink: Whether the element will take up the smallest possible space: "0" | "1" - grow: Whether the element will take up the largest possible space: "0" | "1" + variant: Variant of the select trigger + color: The color of the select trigger + radius: The radius of the select trigger + placeholder: The placeholder of the select trigger m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -200,318 +372,139 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): """ ... -class Box(LayoutComponent): +class SelectContent(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... @overload @classmethod def create( # type: ignore cls, *children, - p: Optional[ + variant: Optional[ + Union[Var[Literal["solid", "soft"]], Literal["solid", "soft"]] + ] = None, + color: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], ] ] = None, - px: Optional[ + high_contrast: Optional[Union[Var[bool], bool]] = None, + position: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["item-aligned", "popper"]], + Literal["item-aligned", "popper"], ] ] = None, - py: Optional[ + side: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pl: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Box": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - p: Padding: "0" - "9" - px: Padding horizontal: "0" - "9" - py: Padding vertical: "0" - "9" - pt: Padding top: "0" - "9" - pr: Padding right: "0" - "9" - pb: Padding bottom: "0" - "9" - pl: Padding left: "0" - "9" - shrink: Whether the element will take up the smallest possible space: "0" | "1" - grow: Whether the element will take up the largest possible space: "0" | "1" - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] -LiteralFlexDisplay = Literal["none", "inline-flex", "flex"] -LiteralFlexWrap = Literal["nowrap", "wrap", "wrap-reverse"] - -class Flex(LayoutComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_child: Optional[Union[Var[bool], bool]] = None, - display: Optional[ - Union[ - Var[Literal["none", "inline-flex", "flex"]], - Literal["none", "inline-flex", "flex"], - ] - ] = None, - direction: Optional[ - Union[ - Var[Literal["row", "column", "row-reverse", "column-reverse"]], - Literal["row", "column", "row-reverse", "column-reverse"], + Var[Literal["top", "right", "bottom", "left"]], + Literal["top", "right", "bottom", "left"], ] ] = None, + side_offset: Optional[Union[Var[int], int]] = None, align: Optional[ Union[ - Var[Literal["start", "center", "end", "baseline", "stretch"]], - Literal["start", "center", "end", "baseline", "stretch"], + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], ] ] = None, - justify: Optional[ - Union[ - Var[Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], - ] - ] = None, - wrap: Optional[ - Union[ - Var[Literal["nowrap", "wrap", "wrap-reverse"]], - Literal["nowrap", "wrap", "wrap-reverse"], - ] - ] = None, - gap: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - p: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - px: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - py: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pl: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + align_offset: Optional[Union[Var[int], int]] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -526,12 +519,18 @@ class Flex(LayoutComponent): on_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_close_auto_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_context_menu: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, on_double_click: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_escape_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_focus: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, @@ -559,6 +558,9 @@ class Flex(LayoutComponent): on_mouse_up: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, + on_pointer_down_outside: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, on_scroll: Optional[ Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, @@ -566,7 +568,7 @@ class Flex(LayoutComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Flex": + ) -> "SelectContent": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -574,22 +576,14 @@ class Flex(LayoutComponent): Args: *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - display: How to display the element: "none" | "inline-flex" | "flex" - direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" - align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" - justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" - wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" - gap: Gap between children: "0" - "9" - p: Padding: "0" - "9" - px: Padding horizontal: "0" - "9" - py: Padding vertical: "0" - "9" - pt: Padding top: "0" - "9" - pr: Padding right: "0" - "9" - pb: Padding bottom: "0" - "9" - pl: Padding left: "0" - "9" - shrink: Whether the element will take up the smallest possible space: "0" | "1" - grow: Whether the element will take up the largest possible space: "0" | "1" + variant: The variant of the select content + color: The color of the select content + high_contrast: Whether to render the select content with higher contrast color against background + position: The positioning mode to use, item-aligned is the default and behaves similarly to a native MacOS menu by positioning content relative to the active item. popper positions content in the same way as our other primitives, for example Popover or DropdownMenu. + side: The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. Only available when position is set to popper. + side_offset: The distance in pixels from the anchor. Only available when position is set to popper. + align: The preferred alignment against the anchor. May change when collisions occur. Only available when position is set to popper. + align_offset: The vertical distance in pixels from the anchor. Only available when position is set to popper. m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -610,231 +604,52 @@ class Flex(LayoutComponent): """ ... -LiteralGridDisplay = Literal["none", "inline-grid", "grid"] -LiteralGridFlow = Literal["row", "column", "dense", "row-dense", "column-dense"] - -class Grid(RadixThemesComponent): +class SelectGroup(CommonMarginProps, RadixThemesComponent): @overload @classmethod def create( # type: ignore cls, *children, - as_child: Optional[Union[Var[bool], bool]] = None, - display: Optional[ - Union[ - Var[Literal["none", "inline-grid", "grid"]], - Literal["none", "inline-grid", "grid"], - ] - ] = None, - columns: Optional[Union[Var[str], str]] = None, - rows: Optional[Union[Var[str], str]] = None, - flow: Optional[ - Union[ - Var[Literal["row", "column", "dense", "row-dense", "column-dense"]], - Literal["row", "column", "dense", "row-dense", "column-dense"], - ] - ] = None, - align: Optional[ - Union[ - Var[Literal["start", "center", "end", "baseline", "stretch"]], - Literal["start", "center", "end", "baseline", "stretch"], - ] - ] = None, - justify: Optional[ - Union[ - Var[Literal["start", "center", "end", "between"]], - Literal["start", "center", "end", "between"], - ] - ] = None, - gap: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - gap_x: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Grid": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - display: How to display the element: "none" | "inline-grid" | "grid" - columns: Number of columns - rows: Number of rows - flow: How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" - align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" - justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" - gap: Gap between children: "0" - "9" - gap_x: Gap between children vertical: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -LiteralContainerSize = Literal["1", "2", "3", "4"] - -class Container(LayoutComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - size: Optional[ - Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] - ] = None, - p: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - px: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - py: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pl: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -889,7 +704,7 @@ class Container(LayoutComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Container": + ) -> "SelectGroup": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -897,16 +712,6 @@ class Container(LayoutComponent): Args: *children: Child components. - size: The size of the container: "1" - "4" (default "4") - p: Padding: "0" - "9" - px: Padding horizontal: "0" - "9" - py: Padding vertical: "0" - "9" - pt: Padding top: "0" - "9" - pr: Padding right: "0" - "9" - pb: Padding bottom: "0" - "9" - pl: Padding left: "0" - "9" - shrink: Whether the element will take up the smallest possible space: "0" | "1" - grow: Whether the element will take up the largest possible space: "0" | "1" m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -927,101 +732,53 @@ class Container(LayoutComponent): """ ... -LiteralSectionSize = Literal["1", "2", "3"] - -class Section(LayoutComponent): +class SelectItem(CommonMarginProps, RadixThemesComponent): @overload @classmethod def create( # type: ignore cls, *children, - size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] - ] = None, - p: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - px: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - py: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - pl: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, - grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + value: Optional[Union[Var[str], str]] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -1076,7 +833,264 @@ class Section(LayoutComponent): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "Section": + ) -> "SelectItem": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + value: The value of the select item when submitting the form. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class SelectLabel(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "SelectLabel": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class SelectSeparator(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "SelectSeparator": """Create a new component instance. Will prepend "RadixThemes" to the component tag to avoid conflicts with @@ -1084,16 +1098,6 @@ class Section(LayoutComponent): Args: *children: Child components. - size: The size of the section: "1" - "3" (default "3") - p: Padding: "0" - "9" - px: Padding horizontal: "0" - "9" - py: Padding vertical: "0" - "9" - pt: Padding top: "0" - "9" - pr: Padding right: "0" - "9" - pb: Padding bottom: "0" - "9" - pl: Padding left: "0" - "9" - shrink: Whether the element will take up the smallest possible space: "0" | "1" - grow: Whether the element will take up the largest possible space: "0" | "1" m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" diff --git a/reflex/components/radix/themes/components/separator.py b/reflex/components/radix/themes/components/separator.py new file mode 100644 index 000000000..f3f1ef9ea --- /dev/null +++ b/reflex/components/radix/themes/components/separator.py @@ -0,0 +1,30 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) + +LiteralSeperatorSize = Literal["1", "2", "3", "4"] + + +class Separator(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Separator" + + # The size of the select: "1" | "2" | "3" + size: Var[LiteralSeperatorSize] + + # The color of the select + color: Var[LiteralAccentColor] + + # The orientation of the separator. + orientation: Var[Literal["horizontal", "vertical"]] + + # When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree. + decorative: Var[bool] diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi new file mode 100644 index 000000000..7c4e4eb1a --- /dev/null +++ b/reflex/components/radix/themes/components/separator.pyi @@ -0,0 +1,218 @@ +"""Stub file for reflex/components/radix/themes/components/separator.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent + +LiteralSeperatorSize = Literal["1", "2", "3", "4"] + +class Separator(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + orientation: Optional[ + Union[ + Var[Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], + ] + ] = None, + decorative: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Separator": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the select: "1" | "2" | "3" + color: The color of the select + orientation: The orientation of the separator. + decorative: When true, signifies that it is purely visual, carries no semantic meaning, and ensures it is not present in the accessibility tree. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py new file mode 100644 index 000000000..6642ad380 --- /dev/null +++ b/reflex/components/radix/themes/components/slider.py @@ -0,0 +1,68 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + RadixThemesComponent, +) + + +class Slider(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Slider" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Button size "1" - "4" + size: Var[Literal[1, 2, 3]] + + # Variant of button + variant: Var[Literal["classic", "surface", "soft"]] + + # Override theme color for button + color: Var[LiteralAccentColor] + + # Whether to render the button with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] + + # The value of the slider when initially rendered. Use when you do not need to control the state of the slider. + default_value: Var[float] + + # The controlled value of the slider. Must be used in conjunction with onValueChange. + value: Var[float] + + # The minimum value of the slider. + min: Var[float] + + # The maximum value of the slider. + max: Var[float] + + # The step value of the slider. + step: Var[float] + + # Whether the slider is disabled + disabled: Var[bool] + + # The orientation of the slider. + orientation: Var[Literal["horizontal", "vertical"]] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_value_change": lambda e0: [e0], + "on_value_commit": lambda e0: [e0], + } diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi new file mode 100644 index 000000000..53e149e7f --- /dev/null +++ b/reflex/components/radix/themes/components/slider.pyi @@ -0,0 +1,254 @@ +"""Stub file for reflex/components/radix/themes/components/slider.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + RadixThemesComponent, +) + +class Slider(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "surface", "soft"]], + Literal["classic", "surface", "soft"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + default_value: Optional[Union[Var[float], float]] = None, + value: Optional[Union[Var[float], float]] = None, + min: Optional[Union[Var[float], float]] = None, + max: Optional[Union[Var[float], float]] = None, + step: Optional[Union[Var[float], float]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + orientation: Optional[ + Union[ + Var[Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], + ] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_value_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_value_commit: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Slider": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Button size "1" - "4" + variant: Variant of button + color: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" + default_value: The value of the slider when initially rendered. Use when you do not need to control the state of the slider. + value: The controlled value of the slider. Must be used in conjunction with onValueChange. + min: The minimum value of the slider. + max: The maximum value of the slider. + step: The step value of the slider. + disabled: Whether the slider is disabled + orientation: The orientation of the slider. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/switch.py b/reflex/components/radix/themes/components/switch.py new file mode 100644 index 000000000..173954f8f --- /dev/null +++ b/reflex/components/radix/themes/components/switch.py @@ -0,0 +1,68 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.constants import EventTriggers +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + + +class Switch(CommonMarginProps, RadixThemesComponent): + """A toggle switch alternative to the checkbox.""" + + tag = "Switch" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Whether the switch is checked by default + default_checked: Var[bool] + + # Whether the switch is checked + checked: Var[bool] + + # If true, prevent the user from interacting with the switch + disabled: Var[bool] + + # If true, the user must interact with the switch to submit the form + required: Var[bool] + + # The name of the switch (when submitting a form) + name: Var[str] + + # The value associated with the "on" position + value: Var[str] + + # Switch size "1" - "4" + size: Var[LiteralSwitchSize] + + # Variant of switch: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Override theme color for switch + color: Var[LiteralAccentColor] + + # Whether to render the switch with higher contrast color against background + high_contrast: Var[bool] + + # Override theme radius for switch: "none" | "small" | "medium" | "large" | "full" + radius: Var[LiteralRadius] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the event triggers that pass the component's value to the handler. + + Returns: + A dict mapping the event trigger name to the argspec passed to the handler. + """ + return { + **super().get_event_triggers(), + EventTriggers.ON_CHECKED_CHANGE: lambda checked: [checked], + } diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi new file mode 100644 index 000000000..6006838c2 --- /dev/null +++ b/reflex/components/radix/themes/components/switch.pyi @@ -0,0 +1,250 @@ +"""Stub file for reflex/components/radix/themes/components/switch.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.constants import EventTriggers +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralRadius, + LiteralVariant, + RadixThemesComponent, +) + +LiteralSwitchSize = Literal["1", "2", "3", "4"] + +class Switch(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + default_checked: Optional[Union[Var[bool], bool]] = None, + checked: Optional[Union[Var[bool], bool]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], bool]] = None, + name: Optional[Union[Var[str], str]] = None, + value: Optional[Union[Var[str], str]] = None, + size: Optional[ + Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_checked_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Switch": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + default_checked: Whether the switch is checked by default + checked: Whether the switch is checked + disabled: If true, prevent the user from interacting with the switch + required: If true, the user must interact with the switch to submit the form + name: The name of the switch (when submitting a form) + value: The value associated with the "on" position + size: Switch size "1" - "4" + variant: Variant of switch: "solid" | "soft" | "outline" | "ghost" + color: Override theme color for switch + high_contrast: Whether to render the switch with higher contrast color against background + radius: Override theme radius for switch: "none" | "small" | "medium" | "large" | "full" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/table.py b/reflex/components/radix/themes/components/table.py new file mode 100644 index 000000000..a26b60a89 --- /dev/null +++ b/reflex/components/radix/themes/components/table.py @@ -0,0 +1,79 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Literal, Union + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class TableRoot(el.Table, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.Root" + + # The size of the table: "1" | "2" | "3" + size: Var[Literal[1, 2, 3]] + + # The variant of the table + variant: Var[Literal["surface", "ghost"]] + + +class TableHeader(el.Thead, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.Header" + + +class TableRow(el.Tr, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.Row" + + # The alignment of the row + align: Var[Literal["start", "center", "end", "baseline"]] + + +class TableColumnHeaderCell(el.Th, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.ColumnHeaderCell" + + # The justification of the column + justify: Var[Literal["start", "center", "end"]] + + # width of the column + width: Var[Union[str, int]] + + +class TableBody(el.Tbody, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.Body" + + +class TableCell(el.Td, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.Cell" + + # The justification of the column + justify: Var[Literal["start", "center", "end"]] + + # width of the column + width: Var[Union[str, int]] + + +class TableRowHeaderCell(el.Th, CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Table.RowHeaderCell" + + # The justification of the column + justify: Var[Literal["start", "center", "end"]] + + # width of the column + width: Var[Union[str, int]] diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi new file mode 100644 index 000000000..8bc7d2925 --- /dev/null +++ b/reflex/components/radix/themes/components/table.pyi @@ -0,0 +1,1485 @@ +"""Stub file for reflex/components/radix/themes/components/table.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal, Union +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class TableRoot(el.Table, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + variant: Optional[ + Union[Var[Literal["surface", "ghost"]], Literal["surface", "ghost"]] + ] = None, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + background: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + border: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + summary: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the table: "1" | "2" | "3" + variant: The variant of the table + align: Alignment of the table + background: Background image for the table + bgcolor: Background color of the table + border: Specifies the width of the border around the table + summary: Provides a summary of the table's purpose and structure + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableHeader(el.Thead, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableHeader": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + align: Alignment of the content within the table header + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableRow(el.Tr, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + align: Optional[ + Union[ + Var[Literal["start", "center", "end", "baseline"]], + Literal["start", "center", "end", "baseline"], + ] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableRow": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + align: Alignment of the content within the table row + bgcolor: Background color of the table row + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableColumnHeaderCell(el.Th, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + justify: Optional[ + Union[ + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], + ] + ] = None, + width: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + background: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + col_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + headers: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + row_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + scope: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableColumnHeaderCell": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + justify: The justification of the column + width: width of the column + align: Alignment of the content within the table header cell + background: Background image for the table header cell + bgcolor: Background color of the table header cell + col_span: Number of columns a header cell should span + headers: IDs of the headers associated with this header cell + row_span: Number of rows a header cell should span + scope: Scope of the header cell (row, col, rowgroup, colgroup) + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableBody(el.Tbody, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableBody": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + align: Alignment of the content within the table body + bgcolor: Background color of the table body + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableCell(el.Td, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + justify: Optional[ + Union[ + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], + ] + ] = None, + width: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + background: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + col_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + headers: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + row_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableCell": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + justify: The justification of the column + width: width of the column + align: Alignment of the content within the table cell + background: Background image for the table cell + bgcolor: Background color of the table cell + col_span: Number of columns a cell should span + headers: IDs of the headers associated with this cell + row_span: Number of rows a cell should span + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TableRowHeaderCell(el.Th, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + justify: Optional[ + Union[ + Var[Literal["start", "center", "end"]], + Literal["start", "center", "end"], + ] + ] = None, + width: Optional[Union[Var[Union[str, int]], Union[str, int]]] = None, + align: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + background: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + bgcolor: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + col_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + headers: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + row_span: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + scope: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TableRowHeaderCell": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + justify: The justification of the column + width: width of the column + align: Alignment of the content within the table header cell + background: Background image for the table header cell + bgcolor: Background color of the table header cell + col_span: Number of columns a header cell should span + headers: IDs of the headers associated with this header cell + row_span: Number of rows a header cell should span + scope: Scope of the header cell (row, col, rowgroup, colgroup) + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/tabs.py b/reflex/components/radix/themes/components/tabs.py new file mode 100644 index 000000000..c1b419222 --- /dev/null +++ b/reflex/components/radix/themes/components/tabs.py @@ -0,0 +1,65 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class TabsRoot(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Tabs.Root" + + # The size of the table: "1" | "2" | "3" + size: Var[Literal[1, 2, 3]] + + # The variant of the table + variant: Var[Literal["surface", "ghost"]] + + # The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs. + default_value: Var[str] + + # The controlled value of the tab that should be active. Use when you need to control the state of the tabs. + value: Var[str] + + # The orientation of the tabs. + orientation: Var[Literal["horizontal", "vertical"]] + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the events triggers signatures for the component. + + Returns: + The signatures of the event triggers. + """ + return { + **super().get_event_triggers(), + "on_value_change": lambda e0: [e0], + } + + +class TabsList(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Tabs.List" + + +class TabsTrigger(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Tabs.Trigger" + + # The value of the tab. Must be unique for each tab. + value: Var[str] + + # Whether the tab is disabled + disabled: Var[bool] + + +class TabsContent(CommonMarginProps, RadixThemesComponent): + """Trigger an action or event, such as submitting a form or displaying a dialog.""" + + tag = "Tabs.Content" diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi new file mode 100644 index 000000000..a0a23e7d2 --- /dev/null +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -0,0 +1,549 @@ +"""Stub file for reflex/components/radix/themes/components/tabs.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent + +class TabsRoot(CommonMarginProps, RadixThemesComponent): + def get_event_triggers(self) -> Dict[str, Any]: ... + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[Union[Var[Literal[1, 2, 3]], Literal[1, 2, 3]]] = None, + variant: Optional[ + Union[Var[Literal["surface", "ghost"]], Literal["surface", "ghost"]] + ] = None, + default_value: Optional[Union[Var[str], str]] = None, + value: Optional[Union[Var[str], str]] = None, + orientation: Optional[ + Union[ + Var[Literal["horizontal", "vertical"]], + Literal["horizontal", "vertical"], + ] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_value_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TabsRoot": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the table: "1" | "2" | "3" + variant: The variant of the table + default_value: The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs. + value: The controlled value of the tab that should be active. Use when you need to control the state of the tabs. + orientation: The orientation of the tabs. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TabsList(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TabsList": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TabsTrigger(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + value: Optional[Union[Var[str], str]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TabsTrigger": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + value: The value of the tab. Must be unique for each tab. + disabled: Whether the tab is disabled + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... + +class TabsContent(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TabsContent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/components/textarea.py b/reflex/components/radix/themes/components/textarea.py new file mode 100644 index 000000000..f28aed35b --- /dev/null +++ b/reflex/components/radix/themes/components/textarea.py @@ -0,0 +1,68 @@ +"""Interactive components provided by @radix-ui/themes.""" +from typing import Any, Dict, Literal + +from reflex import el +from reflex.components.component import Component +from reflex.components.forms.debounce import DebounceInput +from reflex.constants import EventTriggers +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) + +LiteralTextAreaSize = Literal["1", "2", "3"] + + +class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea): + """The input part of a TextArea, may be used by itself.""" + + tag = "TextArea" + + # The size of the text area: "1" | "2" | "3" + size: Var[LiteralTextAreaSize] + + # The variant of the text area + variant: Var[Literal["classic", "surface", "soft"]] + + # The color of the text area + color: Var[LiteralAccentColor] + + @classmethod + def create(cls, *children, **props) -> Component: + """Create an Input component. + + Args: + *children: The children of the component. + **props: The properties of the component. + + Returns: + The component. + """ + if ( + isinstance(props.get("value"), Var) and props.get("on_change") + ) or "debounce_timeout" in props: + # Currently default to 50ms, which appears to be a good balance + debounce_timeout = props.pop("debounce_timeout", 50) + # create a debounced input if the user requests full control to avoid typing jank + return DebounceInput.create( + super().create(*children, **props), debounce_timeout=debounce_timeout + ) + return super().create(*children, **props) + + def get_event_triggers(self) -> Dict[str, Any]: + """Get the event triggers that pass the component's value to the handler. + + Returns: + A dict mapping the event trigger to the var that is passed to the handler. + """ + return { + **super().get_event_triggers(), + EventTriggers.ON_CHANGE: lambda e0: [e0.target.value], + EventTriggers.ON_FOCUS: lambda e0: [e0.target.value], + EventTriggers.ON_BLUR: lambda e0: [e0.target.value], + EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key], + EventTriggers.ON_KEY_UP: lambda e0: [e0.key], + } diff --git a/reflex/components/radix/themes/components/textarea.pyi b/reflex/components/radix/themes/components/textarea.pyi new file mode 100644 index 000000000..5a0d8a04b --- /dev/null +++ b/reflex/components/radix/themes/components/textarea.pyi @@ -0,0 +1,333 @@ +"""Stub file for reflex/components/radix/themes/components/textarea.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Any, Dict, Literal +from reflex import el +from reflex.components.component import Component +from reflex.components.forms.debounce import DebounceInput +from reflex.constants import EventTriggers +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent + +LiteralTextAreaSize = Literal["1", "2", "3"] + +class TextArea(CommonMarginProps, RadixThemesComponent, el.Textarea): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + ] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "surface", "soft"]], + Literal["classic", "surface", "soft"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + auto_complete: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_focus: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + cols: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + dirname: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + disabled: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + max_length: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + min_length: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + placeholder: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + read_only: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + required: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_change: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_key_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_key_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "TextArea": + """Create an Input component. + + Args: + *children: The children of the component. + size: The size of the text area: "1" | "2" | "3" + variant: The variant of the text area + color: The color of the text area + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + auto_complete: Whether the form control should have autocomplete enabled + auto_focus: Automatically focuses the textarea when the page loads + cols: Visible width of the text control, in average character widths + dirname: Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted + disabled: Disables the textarea + form: Associates the textarea with a form (by id) + max_length: Maximum number of characters allowed in the textarea + min_length: Minimum number of characters required in the textarea + name: Name of the textarea, used when submitting the form + placeholder: Placeholder text in the textarea + read_only: Indicates whether the textarea is read-only + required: Indicates that the textarea is required + rows: Visible number of lines in the text control + wrap: How the text in the textarea is to be wrapped when submitting the form + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + 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 properties of the component. + + Returns: + The component. + """ + ... + def get_event_triggers(self) -> Dict[str, Any]: ... diff --git a/reflex/components/radix/themes/components.py b/reflex/components/radix/themes/components/textfield.py similarity index 52% rename from reflex/components/radix/themes/components.py rename to reflex/components/radix/themes/components/textfield.py index 5ee7c8a00..2f8cb1892 100644 --- a/reflex/components/radix/themes/components.py +++ b/reflex/components/radix/themes/components/textfield.py @@ -7,103 +7,19 @@ from reflex.components.forms.debounce import DebounceInput from reflex.constants import EventTriggers from reflex.vars import Var -from .base import ( +from ..base import ( CommonMarginProps, LiteralAccentColor, LiteralRadius, LiteralSize, - LiteralVariant, RadixThemesComponent, ) -LiteralButtonSize = Literal["1", "2", "3", "4"] - - -class Button(CommonMarginProps, RadixThemesComponent): - """Trigger an action or event, such as submitting a form or displaying a dialog.""" - - tag = "Button" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # Button size "1" - "4" - size: Var[LiteralButtonSize] - - # Variant of button: "solid" | "soft" | "outline" | "ghost" - variant: Var[LiteralVariant] - - # Override theme color for button - color: Var[LiteralAccentColor] - - # Whether to render the button with higher contrast color against background - high_contrast: Var[bool] - - # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" - radius: Var[LiteralRadius] - - -LiteralSwitchSize = Literal["1", "2", "3", "4"] - - -class Switch(CommonMarginProps, RadixThemesComponent): - """A toggle switch alternative to the checkbox.""" - - tag = "Switch" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # Whether the switch is checked by default - default_checked: Var[bool] - - # Whether the switch is checked - checked: Var[bool] - - # If true, prevent the user from interacting with the switch - disabled: Var[bool] - - # If true, the user must interact with the switch to submit the form - required: Var[bool] - - # The name of the switch (when submitting a form) - name: Var[str] - - # The value associated with the "on" position - value: Var[str] - - # Switch size "1" - "4" - size: Var[LiteralSwitchSize] - - # Variant of switch: "solid" | "soft" | "outline" | "ghost" - variant: Var[LiteralVariant] - - # Override theme color for switch - color: Var[LiteralAccentColor] - - # Whether to render the switch with higher contrast color against background - high_contrast: Var[bool] - - # Override theme radius for switch: "none" | "small" | "medium" | "large" | "full" - radius: Var[LiteralRadius] - - def get_event_triggers(self) -> Dict[str, Any]: - """Get the event triggers that pass the component's value to the handler. - - Returns: - A dict mapping the event trigger name to the argspec passed to the handler. - """ - return { - **super().get_event_triggers(), - EventTriggers.ON_CHECKED_CHANGE: lambda checked: [checked], - } - - LiteralTextFieldSize = Literal["1", "2", "3"] LiteralTextFieldVariant = Literal["classic", "surface", "soft"] -class TextFieldRoot(CommonMarginProps, RadixThemesComponent): +class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent): """Captures user input with an optional slot for buttons and icons.""" tag = "TextField.Root" @@ -121,7 +37,7 @@ class TextFieldRoot(CommonMarginProps, RadixThemesComponent): radius: Var[LiteralRadius] -class TextField(TextFieldRoot, el.Input): +class TextFieldInput(el.Input, TextFieldRoot): """The input part of a TextField, may be used by itself.""" tag = "TextField.Input" diff --git a/reflex/components/radix/themes/components.pyi b/reflex/components/radix/themes/components/textfield.pyi similarity index 59% rename from reflex/components/radix/themes/components.pyi rename to reflex/components/radix/themes/components/textfield.pyi index ad452bfc4..bda382e80 100644 --- a/reflex/components/radix/themes/components.pyi +++ b/reflex/components/radix/themes/components/textfield.pyi @@ -1,4 +1,4 @@ -"""Stub file for reflex/components/radix/themes/components.py""" +"""Stub file for reflex/components/radix/themes/components/textfield.py""" # ------------------- DO NOT EDIT ---------------------- # This file was generated by `scripts/pyi_generator.py`! # ------------------------------------------------------ @@ -13,465 +13,18 @@ from reflex.components.component import Component from reflex.components.forms.debounce import DebounceInput from reflex.constants import EventTriggers from reflex.vars import Var -from .base import ( +from ..base import ( CommonMarginProps, LiteralAccentColor, LiteralRadius, LiteralSize, - LiteralVariant, RadixThemesComponent, ) -LiteralButtonSize = Literal["1", "2", "3", "4"] - -class Button(CommonMarginProps, RadixThemesComponent): - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_child: Optional[Union[Var[bool], bool]] = None, - size: Optional[ - Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["solid", "soft", "outline", "ghost"]], - Literal["solid", "soft", "outline", "ghost"], - ] - ] = None, - color: Optional[ - Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ], - ] - ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, - radius: Optional[ - Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], - ] - ] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Button": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - size: Button size "1" - "4" - variant: Variant of button: "solid" | "soft" | "outline" | "ghost" - color: Override theme color for button - high_contrast: Whether to render the button with higher contrast color against background - radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full" - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - -LiteralSwitchSize = Literal["1", "2", "3", "4"] - -class Switch(CommonMarginProps, RadixThemesComponent): - def get_event_triggers(self) -> Dict[str, Any]: ... - @overload - @classmethod - def create( # type: ignore - cls, - *children, - as_child: Optional[Union[Var[bool], bool]] = None, - default_checked: Optional[Union[Var[bool], bool]] = None, - checked: Optional[Union[Var[bool], bool]] = None, - disabled: Optional[Union[Var[bool], bool]] = None, - required: Optional[Union[Var[bool], bool]] = None, - name: Optional[Union[Var[str], str]] = None, - value: Optional[Union[Var[str], str]] = None, - size: Optional[ - Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] - ] = None, - variant: Optional[ - Union[ - Var[Literal["solid", "soft", "outline", "ghost"]], - Literal["solid", "soft", "outline", "ghost"], - ] - ] = None, - color: Optional[ - Union[ - Var[ - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ] - ], - Literal[ - "tomato", - "red", - "ruby", - "crimson", - "pink", - "plum", - "purple", - "violet", - "iris", - "indigo", - "blue", - "cyan", - "teal", - "jade", - "green", - "grass", - "brown", - "orange", - "sky", - "mint", - "lime", - "yellow", - "amber", - "gold", - "bronze", - "gray", - ], - ] - ] = None, - high_contrast: Optional[Union[Var[bool], bool]] = None, - radius: Optional[ - Union[ - Var[Literal["none", "small", "medium", "large", "full"]], - Literal["none", "small", "medium", "large", "full"], - ] - ] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = 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[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_checked_change: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_context_menu: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_double_click: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_focus: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_down: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_enter: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_leave: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_move: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_out: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_over: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_mouse_up: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_scroll: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - on_unmount: Optional[ - Union[EventHandler, EventSpec, list, function, BaseVar] - ] = None, - **props - ) -> "Switch": - """Create a new component instance. - - Will prepend "RadixThemes" to the component tag to avoid conflicts with - other UI libraries for common names, like Text and Button. - - Args: - *children: Child components. - as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. - default_checked: Whether the switch is checked by default - checked: Whether the switch is checked - disabled: If true, prevent the user from interacting with the switch - required: If true, the user must interact with the switch to submit the form - name: The name of the switch (when submitting a form) - value: The value associated with the "on" position - size: Switch size "1" - "4" - variant: Variant of switch: "solid" | "soft" | "outline" | "ghost" - color: Override theme color for switch - high_contrast: Whether to render the switch with higher contrast color against background - radius: Override theme radius for switch: "none" | "small" | "medium" | "large" | "full" - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" - 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: Component properties. - - Returns: - A new component instance. - """ - ... - LiteralTextFieldSize = Literal["1", "2", "3"] LiteralTextFieldVariant = Literal["classic", "surface", "soft"] -class TextFieldRoot(CommonMarginProps, RadixThemesComponent): +class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent): @overload @classmethod def create( # type: ignore @@ -554,46 +107,89 @@ class TextFieldRoot(CommonMarginProps, RadixThemesComponent): Literal["none", "small", "medium", "large", "full"], ] ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, m: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -660,6 +256,23 @@ class TextFieldRoot(CommonMarginProps, RadixThemesComponent): variant: Variant of text field: "classic" | "surface" | "soft" color: Override theme color for text field radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. m: Margin: "0" - "9" mx: Margin horizontal: "0" - "9" my: Margin vertical: "0" - "9" @@ -680,14 +293,90 @@ class TextFieldRoot(CommonMarginProps, RadixThemesComponent): """ ... -class TextField(TextFieldRoot, el.Input): +class TextFieldInput(el.Input, TextFieldRoot): @overload @classmethod def create( # type: ignore cls, *children, - size: Optional[ - Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + accept: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + alt: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + auto_complete: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_focus: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + capture: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + checked: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dirname: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + disabled: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + form_action: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_enc_type: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_method: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_no_validate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + form_target: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + height: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + list: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + max: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + max_length: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + min_length: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + min: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + multiple: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + pattern: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + placeholder: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + read_only: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + required: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + size: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + src: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + step: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + type: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + use_map: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + value: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + width: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] ] = None, variant: Optional[ Union[ @@ -763,126 +452,6 @@ class TextField(TextFieldRoot, el.Input): Literal["none", "small", "medium", "large", "full"], ] ] = None, - m: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mx: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - my: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mt: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mr: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - mb: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - ml: Optional[ - Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], - ] - ] = None, - accept: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - alt: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - auto_complete: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - auto_focus: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - capture: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - checked: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - dirname: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - disabled: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - form_action: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - form_enc_type: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - form_method: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - form_no_validate: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - form_target: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - height: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - list: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - max: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - max_length: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - min_length: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - min: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - multiple: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - pattern: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - placeholder: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - read_only: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - required: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - src: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - step: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - type: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, - use_map: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - value: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, - width: Optional[ - Union[Var[Union[str, int, bool]], Union[str, int, bool]] - ] = None, access_key: Optional[ Union[Var[Union[str, int, bool]], Union[str, int, bool]] ] = None, @@ -926,6 +495,48 @@ class TextField(TextFieldRoot, el.Input): translate: Optional[ Union[Var[Union[str, int, bool]], Union[str, int, bool]] ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -987,22 +598,11 @@ class TextField(TextFieldRoot, el.Input): Union[EventHandler, EventSpec, list, function, BaseVar] ] = None, **props - ) -> "TextField": + ) -> "TextFieldInput": """Create an Input component. Args: *children: The children of the component. - size: Specifies the visible width of a text control - variant: Variant of text field: "classic" | "surface" | "soft" - color: Override theme color for text field - radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" - m: Margin: "0" - "9" - mx: Margin horizontal: "0" - "9" - my: Margin vertical: "0" - "9" - mt: Margin top: "0" - "9" - mr: Margin right: "0" - "9" - mb: Margin bottom: "0" - "9" - ml: Margin left: "0" - "9" accept: Accepted types of files when the input is file type alt: Alternate text for input type="image" auto_complete: Whether the input should have autocomplete enabled @@ -1029,12 +629,16 @@ class TextField(TextFieldRoot, el.Input): placeholder: Placeholder text in the input read_only: Indicates whether the input is read-only required: Indicates that the input is required + size: Text field size "1" - "3" src: URL for image inputs step: Specifies the legal number intervals for an input type: Specifies the type of input use_map: Name of the image map used with the input value: Value of the input width: The width of the input (only for type="image") + variant: Variant of text field: "classic" | "surface" | "soft" + color: Override theme color for text field + radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" 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. content_editable: Indicates whether the element's content is editable. @@ -1052,6 +656,13 @@ class TextField(TextFieldRoot, el.Input): tab_index: Defines the position of the current element in the tabbing order. title: Defines a tooltip for the element. translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -1136,8 +747,8 @@ class TextFieldSlot(RadixThemesComponent): ] = None, gap: Optional[ Union[ - Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, diff --git a/reflex/components/radix/themes/layout.py b/reflex/components/radix/themes/layout.py deleted file mode 100644 index be8c24320..000000000 --- a/reflex/components/radix/themes/layout.py +++ /dev/null @@ -1,155 +0,0 @@ -"""Declarative layout and common spacing props.""" -from __future__ import annotations - -from typing import Literal - -from reflex.vars import Var - -from .base import ( - CommonMarginProps, - LiteralAlign, - LiteralJustify, - LiteralSize, - RadixThemesComponent, -) - -LiteralBoolNumber = Literal["0", "1"] - - -class LayoutComponent(CommonMarginProps, RadixThemesComponent): - """Box, Flex and Grid are foundational elements you'll use to construct - layouts. Box provides block-level spacing and sizing, while Flex and Grid - let you create flexible columns, rows and grids. - """ - - # Padding: "0" - "9" - p: Var[LiteralSize] - - # Padding horizontal: "0" - "9" - px: Var[LiteralSize] - - # Padding vertical: "0" - "9" - py: Var[LiteralSize] - - # Padding top: "0" - "9" - pt: Var[LiteralSize] - - # Padding right: "0" - "9" - pr: Var[LiteralSize] - - # Padding bottom: "0" - "9" - pb: Var[LiteralSize] - - # Padding left: "0" - "9" - pl: Var[LiteralSize] - - # Whether the element will take up the smallest possible space: "0" | "1" - shrink: Var[LiteralBoolNumber] - - # Whether the element will take up the largest possible space: "0" | "1" - grow: Var[LiteralBoolNumber] - - -class Box(LayoutComponent): - """A fundamental layout building block, based on
.""" - - tag = "Box" - - -LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] -LiteralFlexDisplay = Literal["none", "inline-flex", "flex"] -LiteralFlexWrap = Literal["nowrap", "wrap", "wrap-reverse"] - - -class Flex(LayoutComponent): - """Component for creating flex layouts.""" - - tag = "Flex" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # How to display the element: "none" | "inline-flex" | "flex" - display: Var[LiteralFlexDisplay] - - # How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" - direction: Var[LiteralFlexDirection] - - # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" - align: Var[LiteralAlign] - - # Alignment of children along the cross axis: "start" | "center" | "end" | "between" - justify: Var[LiteralJustify] - - # Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" - wrap: Var[LiteralFlexWrap] - - # Gap between children: "0" - "9" - gap: Var[LiteralSize] - - -LiteralGridDisplay = Literal["none", "inline-grid", "grid"] -LiteralGridFlow = Literal["row", "column", "dense", "row-dense", "column-dense"] - - -class Grid(RadixThemesComponent): - """Component for creating grid layouts.""" - - tag = "Grid" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # How to display the element: "none" | "inline-grid" | "grid" - display: Var[LiteralGridDisplay] - - # Number of columns - columns: Var[str] - - # Number of rows - rows: Var[str] - - # How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" - flow: Var[LiteralGridFlow] - - # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" - align: Var[LiteralAlign] - - # Alignment of children along the cross axis: "start" | "center" | "end" | "between" - justify: Var[LiteralJustify] - - # Gap between children: "0" - "9" - gap: Var[LiteralSize] - - # Gap between children horizontal: "0" - "9" - gap_x: Var[LiteralSize] - - # Gap between children vertical: "0" - "9" - gap_x: Var[LiteralSize] - - -LiteralContainerSize = Literal["1", "2", "3", "4"] - - -class Container(LayoutComponent): - """Constrains the maximum width of page content. - - See https://www.radix-ui.com/themes/docs/components/container - """ - - tag = "Container" - - # The size of the container: "1" - "4" (default "4") - size: Var[LiteralContainerSize] - - -LiteralSectionSize = Literal["1", "2", "3"] - - -class Section(LayoutComponent): - """Denotes a section of page content.""" - - tag = "Section" - - # The size of the section: "1" - "3" (default "3") - size: Var[LiteralSectionSize] diff --git a/reflex/components/radix/themes/layout/__init__.py b/reflex/components/radix/themes/layout/__init__.py new file mode 100644 index 000000000..ac1f43feb --- /dev/null +++ b/reflex/components/radix/themes/layout/__init__.py @@ -0,0 +1,13 @@ +"""Layout components.""" + +from .box import Box +from .container import Container +from .flex import Flex +from .grid import Grid +from .section import Section + +box = Box.create +container = Container.create +flex = Flex.create +grid = Grid.create +section = Section.create diff --git a/reflex/components/radix/themes/layout/base.py b/reflex/components/radix/themes/layout/base.py new file mode 100644 index 000000000..cd02a5465 --- /dev/null +++ b/reflex/components/radix/themes/layout/base.py @@ -0,0 +1,48 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from typing import Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralSize, + RadixThemesComponent, +) + +LiteralBoolNumber = Literal["0", "1"] + + +class LayoutComponent(CommonMarginProps, RadixThemesComponent): + """Box, Flex and Grid are foundational elements you'll use to construct + layouts. Box provides block-level spacing and sizing, while Flex and Grid + let you create flexible columns, rows and grids. + """ + + # Padding: "0" - "9" + p: Var[LiteralSize] + + # Padding horizontal: "0" - "9" + px: Var[LiteralSize] + + # Padding vertical: "0" - "9" + py: Var[LiteralSize] + + # Padding top: "0" - "9" + pt: Var[LiteralSize] + + # Padding right: "0" - "9" + pr: Var[LiteralSize] + + # Padding bottom: "0" - "9" + pb: Var[LiteralSize] + + # Padding left: "0" - "9" + pl: Var[LiteralSize] + + # Whether the element will take up the smallest possible space: "0" | "1" + shrink: Var[LiteralBoolNumber] + + # Whether the element will take up the largest possible space: "0" | "1" + grow: Var[LiteralBoolNumber] diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi new file mode 100644 index 000000000..aa88429e2 --- /dev/null +++ b/reflex/components/radix/themes/layout/base.pyi @@ -0,0 +1,195 @@ +"""Stub file for reflex/components/radix/themes/layout/base.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralSize, RadixThemesComponent + +LiteralBoolNumber = Literal["0", "1"] + +class LayoutComponent(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + p: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + px: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + py: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pl: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "LayoutComponent": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + p: Padding: "0" - "9" + px: Padding horizontal: "0" - "9" + py: Padding vertical: "0" - "9" + pt: Padding top: "0" - "9" + pr: Padding right: "0" - "9" + pb: Padding bottom: "0" - "9" + pl: Padding left: "0" - "9" + shrink: Whether the element will take up the smallest possible space: "0" | "1" + grow: Whether the element will take up the largest possible space: "0" | "1" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/layout/box.py b/reflex/components/radix/themes/layout/box.py new file mode 100644 index 000000000..4cf55169d --- /dev/null +++ b/reflex/components/radix/themes/layout/box.py @@ -0,0 +1,12 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from reflex import el + +from .base import LayoutComponent + + +class Box(el.Div, LayoutComponent): + """A fundamental layout building block, based on
.""" + + tag = "Box" diff --git a/reflex/components/radix/themes/layout/box.pyi b/reflex/components/radix/themes/layout/box.pyi new file mode 100644 index 000000000..02d876c65 --- /dev/null +++ b/reflex/components/radix/themes/layout/box.pyi @@ -0,0 +1,252 @@ +"""Stub file for reflex/components/radix/themes/layout/box.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from .base import LayoutComponent + +class Box(el.Div, LayoutComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + p: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + px: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + py: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pl: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Box": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + p: Padding: "0" - "9" + px: Padding horizontal: "0" - "9" + py: Padding vertical: "0" - "9" + pt: Padding top: "0" - "9" + pr: Padding right: "0" - "9" + pb: Padding bottom: "0" - "9" + pl: Padding left: "0" - "9" + shrink: Whether the element will take up the smallest possible space: "0" | "1" + grow: Whether the element will take up the largest possible space: "0" | "1" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/layout/container.py b/reflex/components/radix/themes/layout/container.py new file mode 100644 index 000000000..21a020b1d --- /dev/null +++ b/reflex/components/radix/themes/layout/container.py @@ -0,0 +1,23 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from .base import LayoutComponent + +LiteralContainerSize = Literal["1", "2", "3", "4"] + + +class Container(el.Div, LayoutComponent): + """Constrains the maximum width of page content. + + See https://www.radix-ui.com/themes/docs/components/container + """ + + tag = "Container" + + # The size of the container: "1" - "4" (default "4") + size: Var[LiteralContainerSize] diff --git a/reflex/components/radix/themes/layout/container.pyi b/reflex/components/radix/themes/layout/container.pyi new file mode 100644 index 000000000..63df8f1c5 --- /dev/null +++ b/reflex/components/radix/themes/layout/container.pyi @@ -0,0 +1,260 @@ +"""Stub file for reflex/components/radix/themes/layout/container.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from .base import LayoutComponent + +LiteralContainerSize = Literal["1", "2", "3", "4"] + +class Container(el.Div, LayoutComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + p: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + px: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + py: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pl: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Container": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the container: "1" - "4" (default "4") + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + p: Padding: "0" - "9" + px: Padding horizontal: "0" - "9" + py: Padding vertical: "0" - "9" + pt: Padding top: "0" - "9" + pr: Padding right: "0" - "9" + pb: Padding bottom: "0" - "9" + pl: Padding left: "0" - "9" + shrink: Whether the element will take up the smallest possible space: "0" | "1" + grow: Whether the element will take up the largest possible space: "0" | "1" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/layout/flex.py b/reflex/components/radix/themes/layout/flex.py new file mode 100644 index 000000000..f6584e6e8 --- /dev/null +++ b/reflex/components/radix/themes/layout/flex.py @@ -0,0 +1,45 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + LiteralAlign, + LiteralJustify, + LiteralSize, +) +from .base import LayoutComponent + +LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] +LiteralFlexDisplay = Literal["none", "inline-flex", "flex"] +LiteralFlexWrap = Literal["nowrap", "wrap", "wrap-reverse"] + + +class Flex(el.Div, LayoutComponent): + """Component for creating flex layouts.""" + + tag = "Flex" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # How to display the element: "none" | "inline-flex" | "flex" + display: Var[LiteralFlexDisplay] + + # How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + direction: Var[LiteralFlexDirection] + + # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" + align: Var[LiteralAlign] + + # Alignment of children along the cross axis: "start" | "center" | "end" | "between" + justify: Var[LiteralJustify] + + # Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" + wrap: Var[LiteralFlexWrap] + + # Gap between children: "0" - "9" + gap: Var[LiteralSize] diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi new file mode 100644 index 000000000..5131b07b1 --- /dev/null +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -0,0 +1,303 @@ +"""Stub file for reflex/components/radix/themes/layout/flex.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import LiteralAlign, LiteralJustify, LiteralSize +from .base import LayoutComponent + +LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] +LiteralFlexDisplay = Literal["none", "inline-flex", "flex"] +LiteralFlexWrap = Literal["nowrap", "wrap", "wrap-reverse"] + +class Flex(el.Div, LayoutComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + display: Optional[ + Union[ + Var[Literal["none", "inline-flex", "flex"]], + Literal["none", "inline-flex", "flex"], + ] + ] = None, + direction: Optional[ + Union[ + Var[Literal["row", "column", "row-reverse", "column-reverse"]], + Literal["row", "column", "row-reverse", "column-reverse"], + ] + ] = None, + align: Optional[ + Union[ + Var[Literal["start", "center", "end", "baseline", "stretch"]], + Literal["start", "center", "end", "baseline", "stretch"], + ] + ] = None, + justify: Optional[ + Union[ + Var[Literal["start", "center", "end", "between"]], + Literal["start", "center", "end", "between"], + ] + ] = None, + wrap: Optional[ + Union[ + Var[Literal["nowrap", "wrap", "wrap-reverse"]], + Literal["nowrap", "wrap", "wrap-reverse"], + ] + ] = None, + gap: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + p: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + px: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + py: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pl: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Flex": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + display: How to display the element: "none" | "inline-flex" | "flex" + direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse" + align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" + justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" + wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse" + gap: Gap between children: "0" - "9" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + p: Padding: "0" - "9" + px: Padding horizontal: "0" - "9" + py: Padding vertical: "0" - "9" + pt: Padding top: "0" - "9" + pr: Padding right: "0" - "9" + pb: Padding bottom: "0" - "9" + pl: Padding left: "0" - "9" + shrink: Whether the element will take up the smallest possible space: "0" | "1" + grow: Whether the element will take up the largest possible space: "0" | "1" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/layout/grid.py b/reflex/components/radix/themes/layout/grid.py new file mode 100644 index 000000000..f9c9bd6c8 --- /dev/null +++ b/reflex/components/radix/themes/layout/grid.py @@ -0,0 +1,53 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from ..base import ( + LiteralAlign, + LiteralJustify, + LiteralSize, + RadixThemesComponent, +) + +LiteralGridDisplay = Literal["none", "inline-grid", "grid"] +LiteralGridFlow = Literal["row", "column", "dense", "row-dense", "column-dense"] + + +class Grid(el.Div, RadixThemesComponent): + """Component for creating grid layouts.""" + + tag = "Grid" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # How to display the element: "none" | "inline-grid" | "grid" + display: Var[LiteralGridDisplay] + + # Number of columns + columns: Var[str] + + # Number of rows + rows: Var[str] + + # How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" + flow: Var[LiteralGridFlow] + + # Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" + align: Var[LiteralAlign] + + # Alignment of children along the cross axis: "start" | "center" | "end" | "between" + justify: Var[LiteralJustify] + + # Gap between children: "0" - "9" + gap: Var[LiteralSize] + + # Gap between children horizontal: "0" - "9" + gap_x: Var[LiteralSize] + + # Gap between children vertical: "0" - "9" + gap_x: Var[LiteralSize] diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi new file mode 100644 index 000000000..592c1df55 --- /dev/null +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -0,0 +1,203 @@ +"""Stub file for reflex/components/radix/themes/layout/grid.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from ..base import LiteralAlign, LiteralJustify, LiteralSize, RadixThemesComponent + +LiteralGridDisplay = Literal["none", "inline-grid", "grid"] +LiteralGridFlow = Literal["row", "column", "dense", "row-dense", "column-dense"] + +class Grid(el.Div, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + display: Optional[ + Union[ + Var[Literal["none", "inline-grid", "grid"]], + Literal["none", "inline-grid", "grid"], + ] + ] = None, + columns: Optional[Union[Var[str], str]] = None, + rows: Optional[Union[Var[str], str]] = None, + flow: Optional[ + Union[ + Var[Literal["row", "column", "dense", "row-dense", "column-dense"]], + Literal["row", "column", "dense", "row-dense", "column-dense"], + ] + ] = None, + align: Optional[ + Union[ + Var[Literal["start", "center", "end", "baseline", "stretch"]], + Literal["start", "center", "end", "baseline", "stretch"], + ] + ] = None, + justify: Optional[ + Union[ + Var[Literal["start", "center", "end", "between"]], + Literal["start", "center", "end", "between"], + ] + ] = None, + gap: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + gap_x: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Grid": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + display: How to display the element: "none" | "inline-grid" | "grid" + columns: Number of columns + rows: Number of rows + flow: How the grid items are layed out: "row" | "column" | "dense" | "row-dense" | "column-dense" + align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch" + justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between" + gap: Gap between children: "0" - "9" + gap_x: Gap between children vertical: "0" - "9" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/layout/section.py b/reflex/components/radix/themes/layout/section.py new file mode 100644 index 000000000..a86a00325 --- /dev/null +++ b/reflex/components/radix/themes/layout/section.py @@ -0,0 +1,20 @@ +"""Declarative layout and common spacing props.""" +from __future__ import annotations + +from typing import Literal + +from reflex import el +from reflex.vars import Var + +from .base import LayoutComponent + +LiteralSectionSize = Literal["1", "2", "3"] + + +class Section(el.Section, LayoutComponent): + """Denotes a section of page content.""" + + tag = "Section" + + # The size of the section: "1" - "3" (default "3") + size: Var[LiteralSectionSize] diff --git a/reflex/components/radix/themes/layout/section.pyi b/reflex/components/radix/themes/layout/section.pyi new file mode 100644 index 000000000..cce751c1a --- /dev/null +++ b/reflex/components/radix/themes/layout/section.pyi @@ -0,0 +1,260 @@ +"""Stub file for reflex/components/radix/themes/layout/section.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex import el +from reflex.vars import Var +from .base import LayoutComponent + +LiteralSectionSize = Literal["1", "2", "3"] + +class Section(el.Section, LayoutComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + p: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + px: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + py: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + pl: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Section": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: The size of the section: "1" - "3" (default "3") + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + p: Padding: "0" - "9" + px: Padding horizontal: "0" - "9" + py: Padding vertical: "0" - "9" + pt: Padding top: "0" - "9" + pr: Padding right: "0" - "9" + pb: Padding bottom: "0" - "9" + pl: Padding left: "0" - "9" + shrink: Whether the element will take up the smallest possible space: "0" | "1" + grow: Whether the element will take up the largest possible space: "0" | "1" + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography.py b/reflex/components/radix/themes/typography.py deleted file mode 100644 index 1464e9938..000000000 --- a/reflex/components/radix/themes/typography.py +++ /dev/null @@ -1,141 +0,0 @@ -"""Components for rendering text. - -https://www.radix-ui.com/themes/docs/theme/typography -""" -from __future__ import annotations - -from typing import Literal - -from reflex.vars import Var - -from .base import ( - CommonMarginProps, - LiteralAccentColor, - LiteralVariant, - RadixThemesComponent, -) - -LiteralTextWeight = Literal["light", "regular", "medium", "bold"] -LiteralTextAlign = Literal["left", "center", "right"] -LiteralTextSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] -LiteralTextTrim = Literal["normal", "start", "end", "both"] - - -class Text(CommonMarginProps, RadixThemesComponent): - """A foundational text primitive based on the element.""" - - tag = "Text" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) - as_: Var[str] - - # Text size: "1" - "9" - size: Var[LiteralTextSize] - - # Thickness of text: "light" | "regular" | "medium" | "bold" - weight: Var[LiteralTextWeight] - - # Alignment of text in element: "left" | "center" | "right" - align: Var[LiteralTextAlign] - - # Removes the leading trim space: "normal" | "start" | "end" | "both" - trim: Var[LiteralTextTrim] - - # Overrides the accent color inherited from the Theme. - color: Var[LiteralAccentColor] - - # Whether to render the text with higher contrast color - high_contrast: Var[bool] - - -class Heading(Text): - """A semantic heading element.""" - - tag = "Heading" - - -class Blockquote(CommonMarginProps, RadixThemesComponent): - """A block level extended quotation.""" - - tag = "Blockquote" - - # Text size: "1" - "9" - size: Var[LiteralTextSize] - - # Thickness of text: "light" | "regular" | "medium" | "bold" - weight: Var[LiteralTextWeight] - - # Overrides the accent color inherited from the Theme. - color: Var[LiteralAccentColor] - - # Whether to render the text with higher contrast color - high_contrast: Var[bool] - - -class Code(Blockquote): - """Marks text to signify a short fragment of computer code.""" - - tag = "Code" - - # The visual variant to apply: "solid" | "soft" | "outline" | "ghost" - variant: Var[LiteralVariant] - - -class Em(CommonMarginProps, RadixThemesComponent): - """Marks text to stress emphasis.""" - - tag = "Em" - - -class Kbd(CommonMarginProps, RadixThemesComponent): - """Represents keyboard input or a hotkey.""" - - tag = "Kbd" - - # Text size: "1" - "9" - size: Var[LiteralTextSize] - - -LiteralLinkUnderline = Literal["auto", "hover", "always"] - - -class Link(CommonMarginProps, RadixThemesComponent): - """A semantic element for navigation between pages.""" - - tag = "Link" - - # Change the default rendered element for the one passed as a child, merging their props and behavior. - as_child: Var[bool] - - # Text size: "1" - "9" - size: Var[LiteralTextSize] - - # Thickness of text: "light" | "regular" | "medium" | "bold" - weight: Var[LiteralTextWeight] - - # Removes the leading trim space: "normal" | "start" | "end" | "both" - trim: Var[LiteralTextTrim] - - # Sets the visibility of the underline affordance: "auto" | "hover" | "always" - underline: Var[LiteralLinkUnderline] - - # Overrides the accent color inherited from the Theme. - color: Var[LiteralAccentColor] - - # Whether to render the text with higher contrast color - high_contrast: Var[bool] - - -class Quote(CommonMarginProps, RadixThemesComponent): - """A short inline quotation.""" - - tag = "Quote" - - -class Strong(CommonMarginProps, RadixThemesComponent): - """Marks text to signify strong importance.""" - - tag = "Strong" diff --git a/reflex/components/radix/themes/typography/__init__.py b/reflex/components/radix/themes/typography/__init__.py new file mode 100644 index 000000000..1d47a44fa --- /dev/null +++ b/reflex/components/radix/themes/typography/__init__.py @@ -0,0 +1,21 @@ +"""Typographic components.""" + +from .blockquote import Blockquote +from .code import Code +from .em import Em +from .heading import Heading +from .kbd import Kbd +from .link import Link +from .quote import Quote +from .strong import Strong +from .text import Text + +blockquote = Blockquote.create +code = Code.create +em = Em.create +heading = Heading.create +kbd = Kbd.create +link = Link.create +quote = Quote.create +strong = Strong.create +text = Text.create diff --git a/reflex/components/radix/themes/typography/base.py b/reflex/components/radix/themes/typography/base.py new file mode 100644 index 000000000..8742753b4 --- /dev/null +++ b/reflex/components/radix/themes/typography/base.py @@ -0,0 +1,12 @@ +"""Components for rendering text. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from typing import Literal + +LiteralTextWeight = Literal["light", "regular", "medium", "bold"] +LiteralTextAlign = Literal["left", "center", "right"] +LiteralTextSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] +LiteralTextTrim = Literal["normal", "start", "end", "both"] diff --git a/reflex/components/radix/themes/typography/blockquote.py b/reflex/components/radix/themes/typography/blockquote.py new file mode 100644 index 000000000..cb1fa05b7 --- /dev/null +++ b/reflex/components/radix/themes/typography/blockquote.py @@ -0,0 +1,36 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) +from .base import ( + LiteralTextSize, + LiteralTextWeight, +) + + +class Blockquote(el.Blockquote, CommonMarginProps, RadixThemesComponent): + """A block level extended quotation.""" + + tag = "Blockquote" + + # Text size: "1" - "9" + size: Var[LiteralTextSize] + + # Thickness of text: "light" | "regular" | "medium" | "bold" + weight: Var[LiteralTextWeight] + + # Overrides the accent color inherited from the Theme. + color: Var[LiteralAccentColor] + + # Whether to render the text with higher contrast color + high_contrast: Var[bool] diff --git a/reflex/components/radix/themes/typography/blockquote.pyi b/reflex/components/radix/themes/typography/blockquote.pyi new file mode 100644 index 000000000..cfc079088 --- /dev/null +++ b/reflex/components/radix/themes/typography/blockquote.pyi @@ -0,0 +1,282 @@ +"""Stub file for reflex/components/radix/themes/typography/blockquote.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent +from .base import LiteralTextSize, LiteralTextWeight + +class Blockquote(el.Blockquote, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + weight: Optional[ + Union[ + Var[Literal["light", "regular", "medium", "bold"]], + Literal["light", "regular", "medium", "bold"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + cite: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Blockquote": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Text size: "1" - "9" + weight: Thickness of text: "light" | "regular" | "medium" | "bold" + color: Overrides the accent color inherited from the Theme. + high_contrast: Whether to render the text with higher contrast color + cite: Define the title of a work. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/code.py b/reflex/components/radix/themes/typography/code.py new file mode 100644 index 000000000..a73c7ce70 --- /dev/null +++ b/reflex/components/radix/themes/typography/code.py @@ -0,0 +1,40 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralVariant, + RadixThemesComponent, +) +from .base import ( + LiteralTextSize, + LiteralTextWeight, +) + + +class Code(el.Code, CommonMarginProps, RadixThemesComponent): + """A block level extended quotation.""" + + tag = "Code" + + # The visual variant to apply: "solid" | "soft" | "outline" | "ghost" + variant: Var[LiteralVariant] + + # Text size: "1" - "9" + size: Var[LiteralTextSize] + + # Thickness of text: "light" | "regular" | "medium" | "bold" + weight: Var[LiteralTextWeight] + + # Overrides the accent color inherited from the Theme. + color: Var[LiteralAccentColor] + + # Whether to render the text with higher contrast color + high_contrast: Var[bool] diff --git a/reflex/components/radix/themes/typography/code.pyi b/reflex/components/radix/themes/typography/code.pyi new file mode 100644 index 000000000..6a780cf6d --- /dev/null +++ b/reflex/components/radix/themes/typography/code.pyi @@ -0,0 +1,292 @@ +"""Stub file for reflex/components/radix/themes/typography/code.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from reflex.vars import Var +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + LiteralVariant, + RadixThemesComponent, +) +from .base import LiteralTextSize, LiteralTextWeight + +class Code(el.Code, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + weight: Optional[ + Union[ + Var[Literal["light", "regular", "medium", "bold"]], + Literal["light", "regular", "medium", "bold"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Code": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + variant: The visual variant to apply: "solid" | "soft" | "outline" | "ghost" + size: Text size: "1" - "9" + weight: Thickness of text: "light" | "regular" | "medium" | "bold" + color: Overrides the accent color inherited from the Theme. + high_contrast: Whether to render the text with higher contrast color + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/em.py b/reflex/components/radix/themes/typography/em.py new file mode 100644 index 000000000..91b9d660c --- /dev/null +++ b/reflex/components/radix/themes/typography/em.py @@ -0,0 +1,18 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class Em(el.Em, CommonMarginProps, RadixThemesComponent): + """Marks text to stress emphasis.""" + + tag = "Em" diff --git a/reflex/components/radix/themes/typography/em.pyi b/reflex/components/radix/themes/typography/em.pyi new file mode 100644 index 000000000..2264c9f14 --- /dev/null +++ b/reflex/components/radix/themes/typography/em.pyi @@ -0,0 +1,199 @@ +"""Stub file for reflex/components/radix/themes/typography/em.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from ..base import CommonMarginProps, RadixThemesComponent + +class Em(el.Em, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Em": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/heading.py b/reflex/components/radix/themes/typography/heading.py new file mode 100644 index 000000000..cbdee555f --- /dev/null +++ b/reflex/components/radix/themes/typography/heading.py @@ -0,0 +1,50 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) +from .base import ( + LiteralTextAlign, + LiteralTextSize, + LiteralTextTrim, + LiteralTextWeight, +) + + +class Heading(el.H1, CommonMarginProps, RadixThemesComponent): + """A foundational text primitive based on the element.""" + + tag = "Heading" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) + as_: Var[str] + + # Text size: "1" - "9" + size: Var[LiteralTextSize] + + # Thickness of text: "light" | "regular" | "medium" | "bold" + weight: Var[LiteralTextWeight] + + # Alignment of text in element: "left" | "center" | "right" + align: Var[LiteralTextAlign] + + # Removes the leading trim space: "normal" | "start" | "end" | "both" + trim: Var[LiteralTextTrim] + + # Overrides the accent color inherited from the Theme. + color: Var[LiteralAccentColor] + + # Whether to render the text with higher contrast color + high_contrast: Var[bool] diff --git a/reflex/components/radix/themes/typography/heading.pyi b/reflex/components/radix/themes/typography/heading.pyi new file mode 100644 index 000000000..e8670dda1 --- /dev/null +++ b/reflex/components/radix/themes/typography/heading.pyi @@ -0,0 +1,298 @@ +"""Stub file for reflex/components/radix/themes/typography/heading.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent +from .base import LiteralTextAlign, LiteralTextSize, LiteralTextTrim, LiteralTextWeight + +class Heading(el.H1, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + as_: Optional[Union[Var[str], str]] = None, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + weight: Optional[ + Union[ + Var[Literal["light", "regular", "medium", "bold"]], + Literal["light", "regular", "medium", "bold"], + ] + ] = None, + align: Optional[ + Union[ + Var[Literal["left", "center", "right"]], + Literal["left", "center", "right"], + ] + ] = None, + trim: Optional[ + Union[ + Var[Literal["normal", "start", "end", "both"]], + Literal["normal", "start", "end", "both"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Heading": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + as_: Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) + size: Text size: "1" - "9" + weight: Thickness of text: "light" | "regular" | "medium" | "bold" + align: Alignment of text in element: "left" | "center" | "right" + trim: Removes the leading trim space: "normal" | "start" | "end" | "both" + color: Overrides the accent color inherited from the Theme. + high_contrast: Whether to render the text with higher contrast color + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/kbd.py b/reflex/components/radix/themes/typography/kbd.py new file mode 100644 index 000000000..a7d984a31 --- /dev/null +++ b/reflex/components/radix/themes/typography/kbd.py @@ -0,0 +1,25 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) +from .base import ( + LiteralTextSize, +) + + +class Kbd(el.Kbd, CommonMarginProps, RadixThemesComponent): + """Represents keyboard input or a hotkey.""" + + tag = "Kbd" + + # Text size: "1" - "9" + size: Var[LiteralTextSize] diff --git a/reflex/components/radix/themes/typography/kbd.pyi b/reflex/components/radix/themes/typography/kbd.pyi new file mode 100644 index 000000000..e4a65494f --- /dev/null +++ b/reflex/components/radix/themes/typography/kbd.pyi @@ -0,0 +1,208 @@ +"""Stub file for reflex/components/radix/themes/typography/kbd.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, RadixThemesComponent +from .base import LiteralTextSize + +class Kbd(el.Kbd, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Kbd": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + size: Text size: "1" - "9" + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/link.py b/reflex/components/radix/themes/typography/link.py new file mode 100644 index 000000000..d4880d7ca --- /dev/null +++ b/reflex/components/radix/themes/typography/link.py @@ -0,0 +1,49 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from typing import Literal + +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) +from .base import ( + LiteralTextSize, + LiteralTextTrim, + LiteralTextWeight, +) + +LiteralLinkUnderline = Literal["auto", "hover", "always"] + + +class Link(CommonMarginProps, RadixThemesComponent): + """A semantic element for navigation between pages.""" + + tag = "Link" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Text size: "1" - "9" + size: Var[LiteralTextSize] + + # Thickness of text: "light" | "regular" | "medium" | "bold" + weight: Var[LiteralTextWeight] + + # Removes the leading trim space: "normal" | "start" | "end" | "both" + trim: Var[LiteralTextTrim] + + # Sets the visibility of the underline affordance: "auto" | "hover" | "always" + underline: Var[LiteralLinkUnderline] + + # Overrides the accent color inherited from the Theme. + color: Var[LiteralAccentColor] + + # Whether to render the text with higher contrast color + high_contrast: Var[bool] diff --git a/reflex/components/radix/themes/typography/link.pyi b/reflex/components/radix/themes/typography/link.pyi new file mode 100644 index 000000000..741f813ca --- /dev/null +++ b/reflex/components/radix/themes/typography/link.pyi @@ -0,0 +1,238 @@ +"""Stub file for reflex/components/radix/themes/typography/link.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from typing import Literal +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent +from .base import LiteralTextSize, LiteralTextTrim, LiteralTextWeight + +LiteralLinkUnderline = Literal["auto", "hover", "always"] + +class Link(CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + weight: Optional[ + Union[ + Var[Literal["light", "regular", "medium", "bold"]], + Literal["light", "regular", "medium", "bold"], + ] + ] = None, + trim: Optional[ + Union[ + Var[Literal["normal", "start", "end", "both"]], + Literal["normal", "start", "end", "both"], + ] + ] = None, + underline: Optional[ + Union[ + Var[Literal["auto", "hover", "always"]], + Literal["auto", "hover", "always"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Link": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Text size: "1" - "9" + weight: Thickness of text: "light" | "regular" | "medium" | "bold" + trim: Removes the leading trim space: "normal" | "start" | "end" | "both" + underline: Sets the visibility of the underline affordance: "auto" | "hover" | "always" + color: Overrides the accent color inherited from the Theme. + high_contrast: Whether to render the text with higher contrast color + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/quote.py b/reflex/components/radix/themes/typography/quote.py new file mode 100644 index 000000000..ed58fa8e5 --- /dev/null +++ b/reflex/components/radix/themes/typography/quote.py @@ -0,0 +1,18 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class Quote(el.Q, CommonMarginProps, RadixThemesComponent): + """A short inline quotation.""" + + tag = "Quote" diff --git a/reflex/components/radix/themes/typography/quote.pyi b/reflex/components/radix/themes/typography/quote.pyi new file mode 100644 index 000000000..019d40e9e --- /dev/null +++ b/reflex/components/radix/themes/typography/quote.pyi @@ -0,0 +1,200 @@ +"""Stub file for reflex/components/radix/themes/typography/quote.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from ..base import CommonMarginProps, RadixThemesComponent + +class Quote(el.Q, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + cite: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Quote": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/strong.py b/reflex/components/radix/themes/typography/strong.py new file mode 100644 index 000000000..a130b65a3 --- /dev/null +++ b/reflex/components/radix/themes/typography/strong.py @@ -0,0 +1,18 @@ +"""Components for rendering heading. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el + +from ..base import ( + CommonMarginProps, + RadixThemesComponent, +) + + +class Strong(el.Strong, CommonMarginProps, RadixThemesComponent): + """Marks text to signify strong importance.""" + + tag = "Strong" diff --git a/reflex/components/radix/themes/typography/strong.pyi b/reflex/components/radix/themes/typography/strong.pyi new file mode 100644 index 000000000..882dc41d4 --- /dev/null +++ b/reflex/components/radix/themes/typography/strong.pyi @@ -0,0 +1,199 @@ +"""Stub file for reflex/components/radix/themes/typography/strong.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from ..base import CommonMarginProps, RadixThemesComponent + +class Strong(el.Strong, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Strong": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ... diff --git a/reflex/components/radix/themes/typography/text.py b/reflex/components/radix/themes/typography/text.py new file mode 100644 index 000000000..5b3b62979 --- /dev/null +++ b/reflex/components/radix/themes/typography/text.py @@ -0,0 +1,50 @@ +"""Components for rendering text. + +https://www.radix-ui.com/themes/docs/theme/typography +""" +from __future__ import annotations + +from reflex import el +from reflex.vars import Var + +from ..base import ( + CommonMarginProps, + LiteralAccentColor, + RadixThemesComponent, +) +from .base import ( + LiteralTextAlign, + LiteralTextSize, + LiteralTextTrim, + LiteralTextWeight, +) + + +class Text(el.Span, CommonMarginProps, RadixThemesComponent): + """A foundational text primitive based on the element.""" + + tag = "Text" + + # Change the default rendered element for the one passed as a child, merging their props and behavior. + as_child: Var[bool] + + # Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) + as_: Var[str] + + # Text size: "1" - "9" + size: Var[LiteralTextSize] + + # Thickness of text: "light" | "regular" | "medium" | "bold" + weight: Var[LiteralTextWeight] + + # Alignment of text in element: "left" | "center" | "right" + align: Var[LiteralTextAlign] + + # Removes the leading trim space: "normal" | "start" | "end" | "both" + trim: Var[LiteralTextTrim] + + # Overrides the accent color inherited from the Theme. + color: Var[LiteralAccentColor] + + # Whether to render the text with higher contrast color + high_contrast: Var[bool] diff --git a/reflex/components/radix/themes/typography/text.pyi b/reflex/components/radix/themes/typography/text.pyi new file mode 100644 index 000000000..be71f1861 --- /dev/null +++ b/reflex/components/radix/themes/typography/text.pyi @@ -0,0 +1,298 @@ +"""Stub file for reflex/components/radix/themes/typography/text.py""" +# ------------------- DO NOT EDIT ---------------------- +# This file was generated by `scripts/pyi_generator.py`! +# ------------------------------------------------------ + +from typing import Any, Dict, Literal, Optional, Union, overload +from reflex.vars import Var, BaseVar, ComputedVar +from reflex.event import EventChain, EventHandler, EventSpec +from reflex.style import Style +from reflex import el +from reflex.vars import Var +from ..base import CommonMarginProps, LiteralAccentColor, RadixThemesComponent +from .base import LiteralTextAlign, LiteralTextSize, LiteralTextTrim, LiteralTextWeight + +class Text(el.Span, CommonMarginProps, RadixThemesComponent): + @overload + @classmethod + def create( # type: ignore + cls, + *children, + as_child: Optional[Union[Var[bool], bool]] = None, + as_: Optional[Union[Var[str], str]] = None, + size: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + weight: Optional[ + Union[ + Var[Literal["light", "regular", "medium", "bold"]], + Literal["light", "regular", "medium", "bold"], + ] + ] = None, + align: Optional[ + Union[ + Var[Literal["left", "center", "right"]], + Literal["left", "center", "right"], + ] + ] = None, + trim: Optional[ + Union[ + Var[Literal["normal", "start", "end", "both"]], + Literal["normal", "start", "end", "both"], + ] + ] = None, + color: Optional[ + Union[ + Var[ + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ] + ], + Literal[ + "tomato", + "red", + "ruby", + "crimson", + "pink", + "plum", + "purple", + "violet", + "iris", + "indigo", + "blue", + "cyan", + "teal", + "jade", + "green", + "grass", + "brown", + "orange", + "sky", + "mint", + "lime", + "yellow", + "amber", + "gold", + "bronze", + "gray", + ], + ] + ] = None, + high_contrast: Optional[Union[Var[bool], bool]] = None, + access_key: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + auto_capitalize: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + content_editable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + context_menu: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + dir: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + draggable: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + enter_key_hint: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + hidden: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + input_mode: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + item_prop: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + lang: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + role: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + slot: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None, + spell_check: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + tab_index: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + title: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + translate: Optional[ + Union[Var[Union[str, int, bool]], Union[str, int, bool]] + ] = None, + m: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mx: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + my: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mt: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mr: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + mb: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = None, + ml: Optional[ + Union[ + Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + ] + ] = 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[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_context_menu: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_double_click: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_focus: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_down: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_enter: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_leave: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_move: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_out: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_over: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_mouse_up: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_scroll: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + on_unmount: Optional[ + Union[EventHandler, EventSpec, list, function, BaseVar] + ] = None, + **props + ) -> "Text": + """Create a new component instance. + + Will prepend "RadixThemes" to the component tag to avoid conflicts with + other UI libraries for common names, like Text and Button. + + Args: + *children: Child components. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + as_: Change the default rendered element into a semantically appropriate alternative (cannot be used with asChild) + size: Text size: "1" - "9" + weight: Thickness of text: "light" | "regular" | "medium" | "bold" + align: Alignment of text in element: "left" | "center" | "right" + trim: Removes the leading trim space: "normal" | "start" | "end" | "both" + color: Overrides the accent color inherited from the Theme. + high_contrast: Whether to render the text with higher contrast color + 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. + content_editable: Indicates whether the element's content is editable. + context_menu: Defines the ID of a element which will serve as the element's context menu. + dir: Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left) + draggable: Defines whether the element can be dragged. + enter_key_hint: Hints what media types the media element is able to play. + hidden: Defines whether the element is hidden. + input_mode: Defines the type of the element. + item_prop: Defines the name of the element for metadata purposes. + lang: Defines the language used in the element. + role: Defines the role of the element. + slot: Assigns a slot in a shadow DOM shadow tree to an element. + spell_check: Defines whether the element may be checked for spelling errors. + tab_index: Defines the position of the current element in the tabbing order. + title: Defines a tooltip for the element. + translate: Specifies whether the content of an element should be translated or not. + m: Margin: "0" - "9" + mx: Margin horizontal: "0" - "9" + my: Margin vertical: "0" - "9" + mt: Margin top: "0" - "9" + mr: Margin right: "0" - "9" + mb: Margin bottom: "0" - "9" + ml: Margin left: "0" - "9" + 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: Component properties. + + Returns: + A new component instance. + """ + ...