From 9c086163dfec19c1f4c86c7a80e2cbd7b79f5f78 Mon Sep 17 00:00:00 2001 From: Masen Furer Date: Wed, 31 Jan 2024 15:32:17 -0800 Subject: [PATCH] [REF-1631] Clean up the rx.radix namespace (#2501) --- reflex/components/radix/__init__.py | 3 +- reflex/components/radix/themes/__init__.py | 6 +- reflex/components/radix/themes/base.py | 4 + reflex/components/radix/themes/base.pyi | 3 + .../radix/themes/components/__init__.py | 269 ++++-------------- .../radix/themes/components/alertdialog.py | 16 ++ .../radix/themes/components/alertdialog.pyi | 158 ++++++++++ .../radix/themes/components/aspectratio.py | 3 + .../radix/themes/components/aspectratio.pyi | 2 + .../radix/themes/components/avatar.py | 3 + .../radix/themes/components/avatar.pyi | 2 + .../radix/themes/components/badge.py | 3 + .../radix/themes/components/badge.pyi | 2 + .../radix/themes/components/button.py | 3 + .../radix/themes/components/button.pyi | 2 + .../radix/themes/components/callout.py | 13 + .../radix/themes/components/callout.pyi | 223 +++++++++++++++ .../radix/themes/components/card.py | 3 + .../radix/themes/components/card.pyi | 2 + .../radix/themes/components/checkbox.py | 11 + .../radix/themes/components/checkbox.pyi | 181 ++++++++++++ .../radix/themes/components/contextmenu.py | 17 ++ .../radix/themes/components/contextmenu.pyi | 159 +++++++++++ .../radix/themes/components/dialog.py | 15 + .../radix/themes/components/dialog.pyi | 157 ++++++++++ .../radix/themes/components/dropdownmenu.py | 17 ++ .../radix/themes/components/dropdownmenu.pyi | 161 +++++++++++ .../radix/themes/components/hovercard.py | 12 + .../radix/themes/components/hovercard.pyi | 160 +++++++++++ .../radix/themes/components/iconbutton.py | 3 + .../radix/themes/components/iconbutton.pyi | 2 + .../radix/themes/components/icons.py | 3 + .../radix/themes/components/icons.pyi | 1 + .../radix/themes/components/inset.py | 3 + .../radix/themes/components/inset.pyi | 2 + .../radix/themes/components/popover.py | 13 + .../radix/themes/components/popover.pyi | 157 ++++++++++ .../radix/themes/components/radiogroup.py | 12 + .../radix/themes/components/radiogroup.pyi | 194 +++++++++++++ .../radix/themes/components/scrollarea.py | 3 + .../radix/themes/components/scrollarea.pyi | 2 + .../radix/themes/components/select.py | 17 ++ .../radix/themes/components/select.pyi | 196 +++++++++++++ .../radix/themes/components/separator.py | 3 + .../radix/themes/components/separator.pyi | 2 + .../radix/themes/components/slider.py | 3 + .../radix/themes/components/slider.pyi | 2 + .../radix/themes/components/switch.py | 3 + .../radix/themes/components/switch.pyi | 2 + .../radix/themes/components/table.py | 16 ++ .../radix/themes/components/table.pyi | 241 ++++++++++++++++ .../radix/themes/components/tabs.py | 13 + .../radix/themes/components/tabs.pyi | 168 +++++++++++ .../radix/themes/components/textarea.py | 3 + .../radix/themes/components/textarea.pyi | 2 + .../radix/themes/components/textfield.py | 13 + .../radix/themes/components/textfield.pyi | 190 +++++++++++++ .../radix/themes/components/tooltip.py | 3 + .../radix/themes/components/tooltip.pyi | 2 + .../radix/themes/layout/__init__.py | 12 + .../radix/themes/typography/__init__.py | 12 + 61 files changed, 2690 insertions(+), 218 deletions(-) diff --git a/reflex/components/radix/__init__.py b/reflex/components/radix/__init__.py index ee7c2ec7a..08d1dcfef 100644 --- a/reflex/components/radix/__init__.py +++ b/reflex/components/radix/__init__.py @@ -1,3 +1,4 @@ """Namespace for components provided by @radix-ui packages.""" -from . import primitives, themes +from .primitives import * +from .themes import * diff --git a/reflex/components/radix/themes/__init__.py b/reflex/components/radix/themes/__init__.py index 7ecdfb749..ec02436b1 100644 --- a/reflex/components/radix/themes/__init__.py +++ b/reflex/components/radix/themes/__init__.py @@ -1,8 +1,6 @@ """Namespace for components provided by the @radix-ui/themes library.""" -from .base import Theme, ThemePanel +from .base import theme as theme +from .base import theme_panel as theme_panel from .components import * from .layout import * from .typography import * - -theme = Theme.create -theme_panel = ThemePanel.create diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index cc572d662..d7bed2d41 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -210,3 +210,7 @@ class RadixThemesColorModeProvider(Component): library = "/components/reflex/radix_themes_color_mode_provider.js" tag = "RadixThemesColorModeProvider" is_default = True + + +theme = Theme.create +theme_panel = ThemePanel.create diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index fcfb4732a..5e3725e9c 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -789,3 +789,6 @@ class RadixThemesColorModeProvider(Component): TypeError: If an invalid child is passed. """ ... + +theme = Theme.create +theme_panel = ThemePanel.create diff --git a/reflex/components/radix/themes/components/__init__.py b/reflex/components/radix/themes/components/__init__.py index 12b1105eb..c4beba8f1 100644 --- a/reflex/components/radix/themes/components/__init__.py +++ b/reflex/components/radix/themes/components/__init__.py @@ -1,216 +1,59 @@ """Radix themes components.""" -from .alertdialog import ( - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogRoot, - AlertDialogTitle, - AlertDialogTrigger, -) -from .aspectratio import AspectRatio -from .avatar import Avatar -from .badge import Badge -from .button import Button -from .callout import Callout, CalloutIcon, CalloutRoot, CalloutText -from .card import Card -from .checkbox import Checkbox, HighLevelCheckbox -from .contextmenu import ( - ContextMenuContent, - ContextMenuItem, - ContextMenuRoot, - ContextMenuSeparator, - ContextMenuSub, - ContextMenuSubContent, - ContextMenuSubTrigger, - ContextMenuTrigger, -) -from .dialog import ( - DialogClose, - DialogContent, - DialogDescription, - DialogRoot, - DialogTitle, - DialogTrigger, -) -from .dropdownmenu import ( - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuRoot, - DropdownMenuSeparator, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, -) -from .hovercard import HoverCardContent, HoverCardRoot, HoverCardTrigger -from .iconbutton import IconButton -from .icons import Icon -from .inset import Inset -from .popover import PopoverClose, PopoverContent, PopoverRoot, PopoverTrigger -from .radiogroup import HighLevelRadioGroup, RadioGroupItem, RadioGroupRoot -from .scrollarea import ScrollArea -from .select import ( - HighLevelSelect, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectRoot, - SelectSeparator, - SelectTrigger, -) -from .separator import Separator -from .slider import Slider -from .switch import Switch -from .table import ( - TableBody, - TableCell, - TableColumnHeaderCell, - TableHeader, - TableRoot, - TableRow, - TableRowHeaderCell, -) -from .tabs import TabsContent, TabsList, TabsRoot, TabsTrigger -from .textarea import TextArea -from .textfield import Input, TextFieldInput, TextFieldRoot, TextFieldSlot -from .tooltip import Tooltip +from .alertdialog import alert_dialog as alert_dialog +from .aspectratio import aspect_ratio as aspect_ratio +from .avatar import avatar as avatar +from .badge import badge as badge +from .button import button as button +from .callout import callout as callout +from .card import card as card +from .checkbox import checkbox as checkbox +from .contextmenu import context_menu as context_menu +from .dialog import dialog as dialog +from .dropdownmenu import dropdown_menu as dropdown_menu +from .hovercard import hover_card as hover_card +from .iconbutton import icon_button as icon_button +from .icons import icon as icon +from .inset import inset as inset +from .popover import popover as popover +from .radiogroup import radio_group as radio_group +from .scrollarea import scroll_area as scroll_area +from .select import select as select +from .separator import separator as separator +from .slider import slider as slider +from .switch import switch as switch +from .table import table as table +from .tabs import tabs as tabs +from .textarea import text_area as text_area +from .textfield import text_field as text_field +from .tooltip import tooltip as tooltip -# Alert Dialog -alertdialog_root = AlertDialogRoot.create -alertdialog_trigger = AlertDialogTrigger.create -alertdialog_content = AlertDialogContent.create -alertdialog_title = AlertDialogTitle.create -alertdialog_description = AlertDialogDescription.create -alertdialog_action = AlertDialogAction.create -alertdialog_cancel = AlertDialogCancel.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 -callout = Callout.create - -# Card -card = Card.create - -# Checkbox -checkbox = Checkbox.create -checkbox_hl = HighLevelCheckbox.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 -dialog_close = DialogClose.create - -# Dropdown Menu -dropdownmenu_root = DropdownMenuRoot.create -dropdownmenu_trigger = DropdownMenuTrigger.create -dropdownmenu_content = DropdownMenuContent.create -dropdownmenu_sub = DropdownMenuSub.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 -icon = Icon.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 -radio_group = HighLevelRadioGroup.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 -select = HighLevelSelect.create - -# Separator -separator = Separator.create - -# Slider -slider = Slider.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 -tabs_content = TabsContent.create - -# Text Area -textarea = TextArea.create - -# Text Field -textfield_root = TextFieldRoot.create -textfield_input = TextFieldInput.create -textfield_slot = TextFieldSlot.create -input = Input.create - -# Tooltip -tooltip = Tooltip.create +__all__ = [ + "alert_dialog", + "aspect_ratio", + "avatar", + "badge", + "button", + "callout", + "card", + "checkbox", + "context_menu", + "dialog", + "dropdown_menu", + "hover_card", + "icon_button", + "icon", + "inset", + "popover", + "radio_group", + "scroll_area", + "select", + "separator", + "slider", + "switch", + "table", + "tabs", + "text_area", + "text_field", + "tooltip", +] diff --git a/reflex/components/radix/themes/components/alertdialog.py b/reflex/components/radix/themes/components/alertdialog.py index 7a9edc8c6..221ab92e5 100644 --- a/reflex/components/radix/themes/components/alertdialog.py +++ b/reflex/components/radix/themes/components/alertdialog.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el @@ -91,3 +92,18 @@ class AlertDialogCancel(RadixThemesComponent): """ tag = "AlertDialog.Cancel" + + +class AlertDialog(SimpleNamespace): + """AlertDialog components namespace.""" + + root = __call__ = staticmethod(AlertDialogRoot.create) + trigger = staticmethod(AlertDialogTrigger.create) + content = staticmethod(AlertDialogContent.create) + title = staticmethod(AlertDialogTitle.create) + description = staticmethod(AlertDialogDescription.create) + action = staticmethod(AlertDialogAction.create) + cancel = staticmethod(AlertDialogCancel.create) + + +alert_dialog = AlertDialog() diff --git a/reflex/components/radix/themes/components/alertdialog.pyi b/reflex/components/radix/themes/components/alertdialog.pyi index c6c634a07..630fa894a 100644 --- a/reflex/components/radix/themes/components/alertdialog.pyi +++ b/reflex/components/radix/themes/components/alertdialog.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el from reflex.vars import Var @@ -1106,3 +1107,160 @@ class AlertDialogCancel(RadixThemesComponent): A new component instance. """ ... + +class AlertDialog(SimpleNamespace): + root = staticmethod(AlertDialogRoot.create) + trigger = staticmethod(AlertDialogTrigger.create) + content = staticmethod(AlertDialogContent.create) + title = staticmethod(AlertDialogTitle.create) + description = staticmethod(AlertDialogDescription.create) + action = staticmethod(AlertDialogAction.create) + cancel = staticmethod(AlertDialogCancel.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + open: Optional[Union[Var[bool], 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_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 + ) -> "AlertDialogRoot": + """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: map to CSS default color property. + color_scheme: map to radix color property. + open: The controlled open state of the dialog. + 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. + """ + ... + +alert_dialog = AlertDialog() diff --git a/reflex/components/radix/themes/components/aspectratio.py b/reflex/components/radix/themes/components/aspectratio.py index 556666605..1b6847a18 100644 --- a/reflex/components/radix/themes/components/aspectratio.py +++ b/reflex/components/radix/themes/components/aspectratio.py @@ -13,3 +13,6 @@ class AspectRatio(RadixThemesComponent): # The ratio of the width to the height of the element ratio: Var[Union[float, int]] + + +aspect_ratio = AspectRatio.create diff --git a/reflex/components/radix/themes/components/aspectratio.pyi b/reflex/components/radix/themes/components/aspectratio.pyi index b67bb9d09..4e73d8674 100644 --- a/reflex/components/radix/themes/components/aspectratio.pyi +++ b/reflex/components/radix/themes/components/aspectratio.pyi @@ -156,3 +156,5 @@ class AspectRatio(RadixThemesComponent): A new component instance. """ ... + +aspect_ratio = AspectRatio.create diff --git a/reflex/components/radix/themes/components/avatar.py b/reflex/components/radix/themes/components/avatar.py index 35664f4c6..2029c7ef1 100644 --- a/reflex/components/radix/themes/components/avatar.py +++ b/reflex/components/radix/themes/components/avatar.py @@ -36,3 +36,6 @@ class Avatar(RadixThemesComponent): # The rendered fallback text fallback: Var[str] + + +avatar = Avatar.create diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index 635cea11e..5b8722d74 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -178,3 +178,5 @@ class Avatar(RadixThemesComponent): A new component instance. """ ... + +avatar = Avatar.create diff --git a/reflex/components/radix/themes/components/badge.py b/reflex/components/radix/themes/components/badge.py index 98145c3d0..f279ee0cf 100644 --- a/reflex/components/radix/themes/components/badge.py +++ b/reflex/components/radix/themes/components/badge.py @@ -30,3 +30,6 @@ class Badge(el.Span, RadixThemesComponent): # Override theme radius for badge: "none" | "small" | "medium" | "large" | "full" radius: Var[LiteralRadius] + + +badge = Badge.create diff --git a/reflex/components/radix/themes/components/badge.pyi b/reflex/components/radix/themes/components/badge.pyi index 07b75e5a3..a60d397d2 100644 --- a/reflex/components/radix/themes/components/badge.pyi +++ b/reflex/components/radix/themes/components/badge.pyi @@ -233,3 +233,5 @@ class Badge(el.Span, RadixThemesComponent): A new component instance. """ ... + +badge = Badge.create diff --git a/reflex/components/radix/themes/components/button.py b/reflex/components/radix/themes/components/button.py index 4e17ee2d7..a9d681f8e 100644 --- a/reflex/components/radix/themes/components/button.py +++ b/reflex/components/radix/themes/components/button.py @@ -36,3 +36,6 @@ class Button(el.Button, RadixThemesComponent): # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" radius: Var[LiteralRadius] + + +button = Button.create diff --git a/reflex/components/radix/themes/components/button.pyi b/reflex/components/radix/themes/components/button.pyi index b72a0acfc..c1ece4f15 100644 --- a/reflex/components/radix/themes/components/button.pyi +++ b/reflex/components/radix/themes/components/button.pyi @@ -282,3 +282,5 @@ class Button(el.Button, RadixThemesComponent): A new component instance. """ ... + +button = Button.create diff --git a/reflex/components/radix/themes/components/callout.py b/reflex/components/radix/themes/components/callout.py index 884f55905..a388f423e 100644 --- a/reflex/components/radix/themes/components/callout.py +++ b/reflex/components/radix/themes/components/callout.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Literal, Union import reflex as rx @@ -75,3 +76,15 @@ class Callout(CalloutRoot): CalloutText.create(text), **props, ) + + +class CalloutNamespace(SimpleNamespace): + """Callout components namespace.""" + + root = staticmethod(CalloutRoot.create) + icon = staticmethod(CalloutIcon.create) + text = staticmethod(CalloutText.create) + __call__ = staticmethod(Callout.create) + + +callout = CalloutNamespace() diff --git a/reflex/components/radix/themes/components/callout.pyi b/reflex/components/radix/themes/components/callout.pyi index 262816d37..c60377016 100644 --- a/reflex/components/radix/themes/components/callout.pyi +++ b/reflex/components/radix/themes/components/callout.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Literal, Union import reflex as rx from reflex import el @@ -861,3 +862,225 @@ class Callout(CalloutRoot): The callout component. """ ... + +class CalloutNamespace(SimpleNamespace): + root = staticmethod(CalloutRoot.create) + icon = staticmethod(CalloutIcon.create) + text = staticmethod(CalloutText.create) + + @staticmethod + def __call__( + *children, + text: Optional[Union[Var[str], str]] = None, + icon: Optional[Union[Var[str], str]] = None, + 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["soft", "surface", "outline"]], + Literal["soft", "surface", "outline"], + ] + ] = None, + color_scheme: 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, + 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 + ) -> "Callout": + """Create a callout component. + + Args: + text: The text of the callout. + text: The text of the callout. + icon: The icon of the callout. + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + size: Size "1" - "3" + variant: Variant of button: "soft" | "surface" | "outline" + color_scheme: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + 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 callout component. + """ + ... + +callout = CalloutNamespace() diff --git a/reflex/components/radix/themes/components/card.py b/reflex/components/radix/themes/components/card.py index 068004b3a..ab4cf2b88 100644 --- a/reflex/components/radix/themes/components/card.py +++ b/reflex/components/radix/themes/components/card.py @@ -22,3 +22,6 @@ class Card(el.Div, RadixThemesComponent): # Variant of Card: "solid" | "soft" | "outline" | "ghost" variant: Var[Literal["surface", "classic", "ghost"]] + + +card = Card.create diff --git a/reflex/components/radix/themes/components/card.pyi b/reflex/components/radix/themes/components/card.pyi index 0c6457ff8..cf6f669a3 100644 --- a/reflex/components/radix/themes/components/card.pyi +++ b/reflex/components/radix/themes/components/card.pyi @@ -230,3 +230,5 @@ class Card(el.Div, RadixThemesComponent): A new component instance. """ ... + +card = Card.create diff --git a/reflex/components/radix/themes/components/checkbox.py b/reflex/components/radix/themes/components/checkbox.py index 97a69be00..aefa80458 100644 --- a/reflex/components/radix/themes/components/checkbox.py +++ b/reflex/components/radix/themes/components/checkbox.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex.components.component import Component @@ -101,3 +102,13 @@ class HighLevelCheckbox(Checkbox): as_="label", size=size, ) + + +class CheckboxNamespace(SimpleNamespace): + """Checkbox components namespace.""" + + root = staticmethod(Checkbox.create) + __call__ = staticmethod(HighLevelCheckbox.create) + + +checkbox = CheckboxNamespace() diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index c6d17a650..815366c06 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex.components.component import Component from reflex.components.radix.themes.layout.flex import Flex @@ -368,3 +369,183 @@ class HighLevelCheckbox(Checkbox): The checkbox component with a label. """ ... + +class CheckboxNamespace(SimpleNamespace): + root = staticmethod(Checkbox.create) + + @staticmethod + def __call__( + *children, + text: Optional[Union[Var[str], str]] = 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, + size: Optional[ + Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]] + ] = None, + as_child: Optional[Union[Var[bool], bool]] = None, + variant: Optional[ + Union[ + Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]], + Literal["classic", "solid", "soft", "surface", "outline", "ghost"], + ] + ] = None, + color_scheme: 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, + 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, + 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 + ) -> "HighLevelCheckbox": + """Create a checkbox with a label. + + Args: + text: The text of the label. + text: The text label for the checkbox. + gap: The gap between the checkbox and the label. + size: Button size "1" - "3" + as_child: Change the default rendered element for the one passed as a child, merging their props and behavior. + variant: Variant of button: "solid" | "soft" | "outline" | "ghost" + color_scheme: Override theme color for button + high_contrast: Whether to render the button with higher contrast color against background + 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. + 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: Additional properties to apply to the checkbox item. + + Returns: + The checkbox component with a label. + """ + ... + +checkbox = CheckboxNamespace() diff --git a/reflex/components/radix/themes/components/contextmenu.py b/reflex/components/radix/themes/components/contextmenu.py index 0eb67a72d..a8a0b0f2c 100644 --- a/reflex/components/radix/themes/components/contextmenu.py +++ b/reflex/components/radix/themes/components/contextmenu.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var @@ -131,3 +132,19 @@ class ContextMenuSeparator(RadixThemesComponent): """Trigger an action or event, such as submitting a form or displaying a dialog.""" tag = "ContextMenu.Separator" + + +class ContextMenu(SimpleNamespace): + """ContextMenu components namespace.""" + + root = __call__ = staticmethod(ContextMenuRoot.create) + trigger = staticmethod(ContextMenuTrigger.create) + content = staticmethod(ContextMenuContent.create) + sub = staticmethod(ContextMenuSub.create) + sub_trigger = staticmethod(ContextMenuSubTrigger.create) + sub_content = staticmethod(ContextMenuSubContent.create) + item = staticmethod(ContextMenuItem.create) + separator = staticmethod(ContextMenuSeparator.create) + + +context_menu = ContextMenu() diff --git a/reflex/components/radix/themes/components/contextmenu.pyi b/reflex/components/radix/themes/components/contextmenu.pyi index 3b346da51..25d9d5967 100644 --- a/reflex/components/radix/themes/components/contextmenu.pyi +++ b/reflex/components/radix/themes/components/contextmenu.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var from ..base import LiteralAccentColor, RadixThemesComponent @@ -1217,3 +1218,161 @@ class ContextMenuSeparator(RadixThemesComponent): A new component instance. """ ... + +class ContextMenu(SimpleNamespace): + root = staticmethod(ContextMenuRoot.create) + trigger = staticmethod(ContextMenuTrigger.create) + content = staticmethod(ContextMenuContent.create) + sub = staticmethod(ContextMenuSub.create) + sub_trigger = staticmethod(ContextMenuSubTrigger.create) + sub_content = staticmethod(ContextMenuSubContent.create) + item = staticmethod(ContextMenuItem.create) + separator = staticmethod(ContextMenuSeparator.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + modal: Optional[Union[Var[bool], 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_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. + color: map to CSS default color property. + color_scheme: map to radix color property. + 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. + 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. + """ + ... + +context_menu = ContextMenu() diff --git a/reflex/components/radix/themes/components/dialog.py b/reflex/components/radix/themes/components/dialog.py index 8cb3ef4ec..9d7042abc 100644 --- a/reflex/components/radix/themes/components/dialog.py +++ b/reflex/components/radix/themes/components/dialog.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el @@ -75,3 +76,17 @@ class DialogClose(RadixThemesComponent): """Trigger an action or event, such as submitting a form or displaying a dialog.""" tag = "Dialog.Close" + + +class Dialog(SimpleNamespace): + """Dialog components namespace.""" + + root = __call__ = staticmethod(DialogRoot.create) + trigger = staticmethod(DialogTrigger.create) + title = staticmethod(DialogTitle.create) + content = staticmethod(DialogContent.create) + description = staticmethod(DialogDescription.create) + close = staticmethod(DialogClose.create) + + +dialog = Dialog() diff --git a/reflex/components/radix/themes/components/dialog.pyi b/reflex/components/radix/themes/components/dialog.pyi index c0b7d38ed..aa039234a 100644 --- a/reflex/components/radix/themes/components/dialog.pyi +++ b/reflex/components/radix/themes/components/dialog.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el from reflex.vars import Var @@ -959,3 +960,159 @@ class DialogClose(RadixThemesComponent): A new component instance. """ ... + +class Dialog(SimpleNamespace): + root = staticmethod(DialogRoot.create) + trigger = staticmethod(DialogTrigger.create) + title = staticmethod(DialogTitle.create) + content = staticmethod(DialogContent.create) + description = staticmethod(DialogDescription.create) + close = staticmethod(DialogClose.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + open: Optional[Union[Var[bool], 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_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. + color: map to CSS default color property. + color_scheme: map to radix color property. + open: The controlled open state of the dialog. + 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. + """ + ... + +dialog = Dialog() diff --git a/reflex/components/radix/themes/components/dropdownmenu.py b/reflex/components/radix/themes/components/dropdownmenu.py index 92fa410f3..f5dd6c7ef 100644 --- a/reflex/components/radix/themes/components/dropdownmenu.py +++ b/reflex/components/radix/themes/components/dropdownmenu.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var @@ -104,3 +105,19 @@ class DropdownMenuSeparator(RadixThemesComponent): """Trigger an action or event, such as submitting a form or displaying a dialog.""" tag = "DropdownMenu.Separator" + + +class DropdownMenu(SimpleNamespace): + """DropdownMenu components namespace.""" + + root = __call__ = staticmethod(DropdownMenuRoot.create) + trigger = staticmethod(DropdownMenuTrigger.create) + content = staticmethod(DropdownMenuContent.create) + sub_trigger = staticmethod(DropdownMenuSubTrigger.create) + sub = staticmethod(DropdownMenuSub.create) + sub_content = staticmethod(DropdownMenuSubContent.create) + item = staticmethod(DropdownMenuItem.create) + separator = staticmethod(DropdownMenuSeparator.create) + + +dropdown_menu = DropdownMenu() diff --git a/reflex/components/radix/themes/components/dropdownmenu.pyi b/reflex/components/radix/themes/components/dropdownmenu.pyi index d97301515..95c72ff22 100644 --- a/reflex/components/radix/themes/components/dropdownmenu.pyi +++ b/reflex/components/radix/themes/components/dropdownmenu.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var from ..base import LiteralAccentColor, RadixThemesComponent @@ -1193,3 +1194,163 @@ class DropdownMenuSeparator(RadixThemesComponent): A new component instance. """ ... + +class DropdownMenu(SimpleNamespace): + root = staticmethod(DropdownMenuRoot.create) + trigger = staticmethod(DropdownMenuTrigger.create) + content = staticmethod(DropdownMenuContent.create) + sub_trigger = staticmethod(DropdownMenuSubTrigger.create) + sub = staticmethod(DropdownMenuSub.create) + sub_content = staticmethod(DropdownMenuSubContent.create) + item = staticmethod(DropdownMenuItem.create) + separator = staticmethod(DropdownMenuSeparator.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + open: Optional[Union[Var[bool], bool]] = None, + modal: Optional[Union[Var[bool], 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_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. + color: map to CSS default color property. + color_scheme: map to radix color property. + 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. + 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. + """ + ... + +dropdown_menu = DropdownMenu() diff --git a/reflex/components/radix/themes/components/hovercard.py b/reflex/components/radix/themes/components/hovercard.py index c16c03024..faf0afa3f 100644 --- a/reflex/components/radix/themes/components/hovercard.py +++ b/reflex/components/radix/themes/components/hovercard.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el @@ -60,3 +61,14 @@ class HoverCardContent(el.Div, RadixThemesComponent): # Whether or not the hover card should avoid collisions with its trigger. avoid_collisions: Var[bool] + + +class HoverCard(SimpleNamespace): + """HoverCard components namespace.""" + + root = __call__ = staticmethod(HoverCardRoot.create) + trigger = staticmethod(HoverCardTrigger.create) + content = staticmethod(HoverCardContent.create) + + +hover_card = HoverCard() diff --git a/reflex/components/radix/themes/components/hovercard.pyi b/reflex/components/radix/themes/components/hovercard.pyi index 962118ac5..f78f82ec2 100644 --- a/reflex/components/radix/themes/components/hovercard.pyi +++ b/reflex/components/radix/themes/components/hovercard.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el from reflex.vars import Var @@ -533,3 +534,162 @@ class HoverCardContent(el.Div, RadixThemesComponent): A new component instance. """ ... + +class HoverCard(SimpleNamespace): + root = staticmethod(HoverCardRoot.create) + trigger = staticmethod(HoverCardTrigger.create) + content = staticmethod(HoverCardContent.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + 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, + 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. + color: map to CSS default color property. + color_scheme: map to radix color property. + 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. + 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. + """ + ... + +hover_card = HoverCard() diff --git a/reflex/components/radix/themes/components/iconbutton.py b/reflex/components/radix/themes/components/iconbutton.py index 43b990167..eec3e21ab 100644 --- a/reflex/components/radix/themes/components/iconbutton.py +++ b/reflex/components/radix/themes/components/iconbutton.py @@ -36,3 +36,6 @@ class IconButton(el.Button, RadixThemesComponent): # Override theme radius for button: "none" | "small" | "medium" | "large" | "full" radius: Var[LiteralRadius] + + +icon_button = IconButton.create diff --git a/reflex/components/radix/themes/components/iconbutton.pyi b/reflex/components/radix/themes/components/iconbutton.pyi index 1f512ca17..5f058d099 100644 --- a/reflex/components/radix/themes/components/iconbutton.pyi +++ b/reflex/components/radix/themes/components/iconbutton.pyi @@ -282,3 +282,5 @@ class IconButton(el.Button, RadixThemesComponent): A new component instance. """ ... + +icon_button = IconButton.create diff --git a/reflex/components/radix/themes/components/icons.py b/reflex/components/radix/themes/components/icons.py index b2e5dee97..05f7cf5ca 100644 --- a/reflex/components/radix/themes/components/icons.py +++ b/reflex/components/radix/themes/components/icons.py @@ -50,6 +50,9 @@ class Icon(RadixIconComponent): return super().create(*children, **props) +icon = Icon.create + + ICON_ABSTRACT: List[str] = [ "hamburger_menu", "cross_1", diff --git a/reflex/components/radix/themes/components/icons.pyi b/reflex/components/radix/themes/components/icons.pyi index 2002f9b0f..52d355401 100644 --- a/reflex/components/radix/themes/components/icons.pyi +++ b/reflex/components/radix/themes/components/icons.pyi @@ -172,6 +172,7 @@ class Icon(RadixIconComponent): """ ... +icon = Icon.create ICON_ABSTRACT: List[str] ICON_ALIGNS: List[str] ICON_ARROWS: List[str] diff --git a/reflex/components/radix/themes/components/inset.py b/reflex/components/radix/themes/components/inset.py index 572609bd1..8c0fd1e5c 100644 --- a/reflex/components/radix/themes/components/inset.py +++ b/reflex/components/radix/themes/components/inset.py @@ -42,3 +42,6 @@ class Inset(el.Div, RadixThemesComponent): # Padding on the left pl: Var[Union[int, str]] + + +inset = Inset.create diff --git a/reflex/components/radix/themes/components/inset.pyi b/reflex/components/radix/themes/components/inset.pyi index 9c6ae4a36..54ddfd696 100644 --- a/reflex/components/radix/themes/components/inset.pyi +++ b/reflex/components/radix/themes/components/inset.pyi @@ -245,3 +245,5 @@ class Inset(el.Div, RadixThemesComponent): A new component instance. """ ... + +inset = Inset.create diff --git a/reflex/components/radix/themes/components/popover.py b/reflex/components/radix/themes/components/popover.py index fa8ce6b59..6bb015920 100644 --- a/reflex/components/radix/themes/components/popover.py +++ b/reflex/components/radix/themes/components/popover.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el @@ -82,3 +83,15 @@ class PopoverClose(RadixThemesComponent): """Trigger an action or event, such as submitting a form or displaying a dialog.""" tag = "Popover.Close" + + +class Popover(SimpleNamespace): + """Popover components namespace.""" + + root = __call__ = staticmethod(PopoverRoot.create) + trigger = staticmethod(PopoverTrigger.create) + content = staticmethod(PopoverContent.create) + close = staticmethod(PopoverClose.create) + + +popover = Popover() diff --git a/reflex/components/radix/themes/components/popover.pyi b/reflex/components/radix/themes/components/popover.pyi index d90f3f046..25e4c2926 100644 --- a/reflex/components/radix/themes/components/popover.pyi +++ b/reflex/components/radix/themes/components/popover.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex import el from reflex.vars import Var @@ -696,3 +697,159 @@ class PopoverClose(RadixThemesComponent): A new component instance. """ ... + +class Popover(SimpleNamespace): + root = staticmethod(PopoverRoot.create) + trigger = staticmethod(PopoverTrigger.create) + content = staticmethod(PopoverContent.create) + close = staticmethod(PopoverClose.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + open: Optional[Union[Var[bool], bool]] = None, + modal: Optional[Union[Var[bool], 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_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. + color: map to CSS default color property. + color_scheme: map to radix color property. + 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. + 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. + """ + ... + +popover = Popover() diff --git a/reflex/components/radix/themes/components/radiogroup.py b/reflex/components/radix/themes/components/radiogroup.py index 099a7c287..9e31dfffc 100644 --- a/reflex/components/radix/themes/components/radiogroup.py +++ b/reflex/components/radix/themes/components/radiogroup.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, List, Literal, Optional, Union import reflex as rx @@ -160,3 +161,14 @@ class HighLevelRadioGroup(RadioGroupRoot): default_value=default_value, **props, ) + + +class RadioGroup(SimpleNamespace): + """RadioGroup components namespace.""" + + root = staticmethod(RadioGroupRoot.create) + item = staticmethod(RadioGroupItem.create) + __call__ = staticmethod(HighLevelRadioGroup.create) + + +radio_group = RadioGroup() diff --git a/reflex/components/radix/themes/components/radiogroup.pyi b/reflex/components/radix/themes/components/radiogroup.pyi index 8f4b0a15c..e2a2135a9 100644 --- a/reflex/components/radix/themes/components/radiogroup.pyi +++ b/reflex/components/radix/themes/components/radiogroup.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, List, Literal, Optional, Union import reflex as rx from reflex.components.component import Component @@ -536,3 +537,196 @@ class HighLevelRadioGroup(RadioGroupRoot): The created radio group component. """ ... + +class RadioGroup(SimpleNamespace): + root = staticmethod(RadioGroupRoot.create) + item = staticmethod(RadioGroupItem.create) + + @staticmethod + def __call__( + *children, + items: Optional[Union[Var[List[str]], List[str]]] = None, + direction: Optional[ + Union[ + Var[Literal["row", "column", "row-reverse", "column-reverse"]], + Literal["row", "column", "row-reverse", "column-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, + 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_scheme: 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, + name: Optional[Union[Var[str], str]] = 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, + 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 + ) -> "HighLevelRadioGroup": + """Create a radio group component. + + Args: + items: The items of the radio group. + items: The items of the radio group. + direction: The direction of the radio group. + gap: The gap between the items of the radio group. + size: The size of the radio group: "1" | "2" | "3" + variant: The variant of the radio group + color_scheme: 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 on_value_change. + default_value: The initial value of checked radio item. Should be used in conjunction with onValueChange. + disabled: Whether the radio group is disabled + name: The name of the group. Submitted with its owning form as part of a name/value pair. + 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. + 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: Additional properties to apply to the accordion item. + + Returns: + The created radio group component. + """ + ... + +radio_group = RadioGroup() diff --git a/reflex/components/radix/themes/components/scrollarea.py b/reflex/components/radix/themes/components/scrollarea.py index 77fa190ee..911cda1a8 100644 --- a/reflex/components/radix/themes/components/scrollarea.py +++ b/reflex/components/radix/themes/components/scrollarea.py @@ -28,3 +28,6 @@ class ScrollArea(RadixThemesComponent): # 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] + + +scroll_area = ScrollArea.create diff --git a/reflex/components/radix/themes/components/scrollarea.pyi b/reflex/components/radix/themes/components/scrollarea.pyi index b51b35ca9..3744965d1 100644 --- a/reflex/components/radix/themes/components/scrollarea.pyi +++ b/reflex/components/radix/themes/components/scrollarea.pyi @@ -179,3 +179,5 @@ class ScrollArea(RadixThemesComponent): A new component instance. """ ... + +scroll_area = ScrollArea.create diff --git a/reflex/components/radix/themes/components/select.py b/reflex/components/radix/themes/components/select.py index 57388e625..a053a59fd 100644 --- a/reflex/components/radix/themes/components/select.py +++ b/reflex/components/radix/themes/components/select.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, List, Literal, Union import reflex as rx @@ -223,3 +224,19 @@ class HighLevelSelect(SelectRoot): ), **props, ) + + +class Select(SimpleNamespace): + """Select components namespace.""" + + root = staticmethod(SelectRoot.create) + trigger = staticmethod(SelectTrigger.create) + content = staticmethod(SelectContent.create) + group = staticmethod(SelectGroup.create) + item = staticmethod(SelectItem.create) + separator = staticmethod(SelectSeparator.create) + label = staticmethod(SelectLabel.create) + __call__ = staticmethod(HighLevelSelect.create) + + +select = Select() diff --git a/reflex/components/radix/themes/components/select.pyi b/reflex/components/radix/themes/components/select.pyi index d13d675d2..1db16617f 100644 --- a/reflex/components/radix/themes/components/select.pyi +++ b/reflex/components/radix/themes/components/select.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, List, Literal, Union import reflex as rx from reflex.components.component import Component @@ -1295,3 +1296,198 @@ class HighLevelSelect(SelectRoot): The select component. """ ... + +class Select(SimpleNamespace): + root = staticmethod(SelectRoot.create) + trigger = staticmethod(SelectTrigger.create) + content = staticmethod(SelectContent.create) + group = staticmethod(SelectGroup.create) + item = staticmethod(SelectItem.create) + separator = staticmethod(SelectSeparator.create) + label = staticmethod(SelectLabel.create) + + @staticmethod + def __call__( + *children, + items: Optional[Union[Var[List[str]], List[str]]] = None, + placeholder: Optional[Union[Var[str], str]] = None, + label: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + variant: Optional[ + Union[ + Var[Literal["classic", "surface", "soft", "ghost"]], + Literal["classic", "surface", "soft", "ghost"], + ] + ] = None, + radius: Optional[ + Union[ + Var[Literal["none", "small", "medium", "large", "full"]], + Literal["none", "small", "medium", "large", "full"], + ] + ] = None, + width: Optional[Union[Var[str], str]] = 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, + disabled: Optional[Union[Var[bool], bool]] = None, + required: Optional[Union[Var[bool], 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_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 + ) -> "HighLevelSelect": + """Create a select component. + + Args: + items: The items of the select. + items: The items of the select. + placeholder: The placeholder of the select. + label: The label of the select. + color_scheme: The color of the select. + high_contrast: Whether to render the select with higher contrast color against background. + variant: The variant of the select. + radius: The radius of the select. + width: The width of the select. + 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. Should be used in conjunction with on_value_change. + 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 on_open_change. + name: The name of the select control when submitting the form. + disabled: When True, prevents the user from interacting with select. + required: When True, indicates that the user must select a value before the owning form can be submitted. + 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: Additional properties to apply to the select component. + + Returns: + The select component. + """ + ... + +select = Select() diff --git a/reflex/components/radix/themes/components/separator.py b/reflex/components/radix/themes/components/separator.py index 80d369f04..08a147ca1 100644 --- a/reflex/components/radix/themes/components/separator.py +++ b/reflex/components/radix/themes/components/separator.py @@ -27,3 +27,6 @@ class Separator(RadixThemesComponent): # 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] + + +separator = Separator.create diff --git a/reflex/components/radix/themes/components/separator.pyi b/reflex/components/radix/themes/components/separator.pyi index 680cc13cf..01dadf3e2 100644 --- a/reflex/components/radix/themes/components/separator.pyi +++ b/reflex/components/radix/themes/components/separator.pyi @@ -169,3 +169,5 @@ class Separator(RadixThemesComponent): A new component instance. """ ... + +separator = Separator.create diff --git a/reflex/components/radix/themes/components/slider.py b/reflex/components/radix/themes/components/slider.py index e8cda4b6d..611883ecd 100644 --- a/reflex/components/radix/themes/components/slider.py +++ b/reflex/components/radix/themes/components/slider.py @@ -68,3 +68,6 @@ class Slider(RadixThemesComponent): "on_value_change": lambda e0: [e0], "on_value_commit": lambda e0: [e0], } + + +slider = Slider.create diff --git a/reflex/components/radix/themes/components/slider.pyi b/reflex/components/radix/themes/components/slider.pyi index 6564834a4..a847b1c45 100644 --- a/reflex/components/radix/themes/components/slider.pyi +++ b/reflex/components/radix/themes/components/slider.pyi @@ -208,3 +208,5 @@ class Slider(RadixThemesComponent): A new component instance. """ ... + +slider = Slider.create diff --git a/reflex/components/radix/themes/components/switch.py b/reflex/components/radix/themes/components/switch.py index dc5132ce1..8e5de69e9 100644 --- a/reflex/components/radix/themes/components/switch.py +++ b/reflex/components/radix/themes/components/switch.py @@ -65,3 +65,6 @@ class Switch(RadixThemesComponent): **super().get_event_triggers(), EventTriggers.ON_CHECKED_CHANGE: lambda checked: [checked], } + + +switch = Switch.create diff --git a/reflex/components/radix/themes/components/switch.pyi b/reflex/components/radix/themes/components/switch.pyi index 3414c5078..08fce2e3a 100644 --- a/reflex/components/radix/themes/components/switch.pyi +++ b/reflex/components/radix/themes/components/switch.pyi @@ -200,3 +200,5 @@ class Switch(RadixThemesComponent): A new component instance. """ ... + +switch = Switch.create diff --git a/reflex/components/radix/themes/components/table.py b/reflex/components/radix/themes/components/table.py index 4f67a2a2c..042318f03 100644 --- a/reflex/components/radix/themes/components/table.py +++ b/reflex/components/radix/themes/components/table.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Literal, Union from reflex import el @@ -76,3 +77,18 @@ class TableRowHeaderCell(el.Th, RadixThemesComponent): # width of the column width: Var[Union[str, int]] + + +class Table(SimpleNamespace): + """Table components namespace.""" + + root = __call__ = staticmethod(TableRoot.create) + header = staticmethod(TableHeader.create) + body = staticmethod(TableBody.create) + row = staticmethod(TableRow.create) + cell = staticmethod(TableCell.create) + column_header_cell = staticmethod(TableColumnHeaderCell.create) + row_header_cell = staticmethod(TableRowHeaderCell.create) + + +table = Table() diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index 4e348c9af..126ba7e5c 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Literal, Union from reflex import el from reflex.vars import Var @@ -1597,3 +1598,243 @@ class TableRowHeaderCell(el.Th, RadixThemesComponent): A new component instance. """ ... + +class Table(SimpleNamespace): + root = staticmethod(TableRoot.create) + header = staticmethod(TableHeader.create) + body = staticmethod(TableBody.create) + row = staticmethod(TableRow.create) + cell = staticmethod(TableCell.create) + column_header_cell = staticmethod(TableColumnHeaderCell.create) + row_header_cell = staticmethod(TableRowHeaderCell.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + 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, + 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. + color: map to CSS default color property. + color_scheme: map to radix color property. + 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. + 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. + """ + ... + +table = Table() diff --git a/reflex/components/radix/themes/components/tabs.py b/reflex/components/radix/themes/components/tabs.py index c371edf20..d709c50ab 100644 --- a/reflex/components/radix/themes/components/tabs.py +++ b/reflex/components/radix/themes/components/tabs.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var @@ -62,3 +63,15 @@ class TabsContent(RadixThemesComponent): # The value of the tab. Must be unique for each tab. value: Var[str] + + +class Tabs(SimpleNamespace): + """Tabs components namespace.""" + + root = __call__ = staticmethod(TabsRoot.create) + list = staticmethod(TabsList.create) + trigger = staticmethod(TabsTrigger.create) + content = staticmethod(TabsContent.create) + + +tabs = Tabs() diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index ba33bed05..f394a0e25 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal from reflex.vars import Var from ..base import RadixThemesComponent @@ -611,3 +612,170 @@ class TabsContent(RadixThemesComponent): A new component instance. """ ... + +class Tabs(SimpleNamespace): + root = staticmethod(TabsRoot.create) + list = staticmethod(TabsList.create) + trigger = staticmethod(TabsTrigger.create) + content = staticmethod(TabsContent.create) + + @staticmethod + def __call__( + *children, + color: Optional[Union[Var[str], str]] = None, + color_scheme: 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, + 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, + 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. + color: map to CSS default color property. + color_scheme: map to radix color property. + variant: The variant of the tab + 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. + 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. + """ + ... + +tabs = Tabs() diff --git a/reflex/components/radix/themes/components/textarea.py b/reflex/components/radix/themes/components/textarea.py index 0fe0ca575..13b5ee308 100644 --- a/reflex/components/radix/themes/components/textarea.py +++ b/reflex/components/radix/themes/components/textarea.py @@ -65,3 +65,6 @@ class TextArea(RadixThemesComponent, el.Textarea): EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key], EventTriggers.ON_KEY_UP: lambda e0: [e0.key], } + + +text_area = TextArea.create diff --git a/reflex/components/radix/themes/components/textarea.pyi b/reflex/components/radix/themes/components/textarea.pyi index 02badfd6e..7c35ad5f1 100644 --- a/reflex/components/radix/themes/components/textarea.pyi +++ b/reflex/components/radix/themes/components/textarea.pyi @@ -286,3 +286,5 @@ class TextArea(RadixThemesComponent, el.Textarea): """ ... def get_event_triggers(self) -> Dict[str, Any]: ... + +text_area = TextArea.create diff --git a/reflex/components/radix/themes/components/textfield.py b/reflex/components/radix/themes/components/textfield.py index 1b840cd74..63d0bdfed 100644 --- a/reflex/components/radix/themes/components/textfield.py +++ b/reflex/components/radix/themes/components/textfield.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" +from types import SimpleNamespace from typing import Any, Dict, Literal import reflex as rx @@ -191,3 +192,15 @@ class Input(RadixThemesComponent): EventTriggers.ON_KEY_DOWN: lambda e0: [e0.key], EventTriggers.ON_KEY_UP: lambda e0: [e0.key], } + + +class TextField(SimpleNamespace): + """TextField components namespace.""" + + root = staticmethod(TextFieldRoot.create) + input = staticmethod(TextFieldInput.create) + slot = staticmethod(TextFieldSlot.create) + __call__ = staticmethod(Input.create) + + +text_field = TextField() diff --git a/reflex/components/radix/themes/components/textfield.pyi b/reflex/components/radix/themes/components/textfield.pyi index 8b81af8ec..c9123cbd0 100644 --- a/reflex/components/radix/themes/components/textfield.pyi +++ b/reflex/components/radix/themes/components/textfield.pyi @@ -7,6 +7,7 @@ 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 types import SimpleNamespace from typing import Any, Dict, Literal import reflex as rx from reflex.components import el @@ -913,3 +914,192 @@ class Input(RadixThemesComponent): """ ... def get_event_triggers(self) -> Dict[str, Any]: ... + +class TextField(SimpleNamespace): + root = staticmethod(TextFieldRoot.create) + input = staticmethod(TextFieldInput.create) + slot = staticmethod(TextFieldSlot.create) + + @staticmethod + def __call__( + *children, + icon: Optional[Union[Var[str], str]] = 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_scheme: 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, + auto_complete: Optional[Union[Var[bool], bool]] = None, + default_value: Optional[Union[Var[str], str]] = None, + disabled: Optional[Union[Var[bool], bool]] = None, + max_length: Optional[Union[Var[str], str]] = None, + min_length: Optional[Union[Var[str], str]] = None, + name: Optional[Union[Var[str], str]] = None, + placeholder: Optional[Union[Var[str], str]] = None, + required: Optional[Union[Var[bool], bool]] = None, + value: Optional[Union[Var[str], str]] = 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 + ) -> "Input": + """Create an Input component. + + Args: + icon: The icon to render before the input. + size: Text field size "1" - "3" + variant: Variant of text field: "classic" | "surface" | "soft" + color_scheme: Override theme color for text field + radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full" + auto_complete: Whether the input should have autocomplete enabled + default_value: The value of the input when initially rendered. + disabled: Disables the input + max_length: Specifies the maximum number of characters allowed in the input + min_length: Specifies the minimum number of characters required in the input + name: Name of the input, used when sending form data + placeholder: Placeholder text in the input + required: Indicates that the input is required + value: Value of the input + 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. + """ + ... + +text_field = TextField() diff --git a/reflex/components/radix/themes/components/tooltip.py b/reflex/components/radix/themes/components/tooltip.py index 3cf60df56..e9ea61e92 100644 --- a/reflex/components/radix/themes/components/tooltip.py +++ b/reflex/components/radix/themes/components/tooltip.py @@ -13,3 +13,6 @@ class Tooltip(RadixThemesComponent): # The content of the tooltip. content: Var[str] + + +tooltip = Tooltip.create diff --git a/reflex/components/radix/themes/components/tooltip.pyi b/reflex/components/radix/themes/components/tooltip.pyi index f609b1605..f123ee6fa 100644 --- a/reflex/components/radix/themes/components/tooltip.pyi +++ b/reflex/components/radix/themes/components/tooltip.pyi @@ -155,3 +155,5 @@ class Tooltip(RadixThemesComponent): A new component instance. """ ... + +tooltip = Tooltip.create diff --git a/reflex/components/radix/themes/layout/__init__.py b/reflex/components/radix/themes/layout/__init__.py index 78e7a828f..ae8688460 100644 --- a/reflex/components/radix/themes/layout/__init__.py +++ b/reflex/components/radix/themes/layout/__init__.py @@ -18,3 +18,15 @@ section = Section.create spacer = Spacer.create hstack = HStack.create vstack = VStack.create + +__all__ = [ + "box", + "center", + "container", + "flex", + "grid", + "section", + "spacer", + "hstack", + "vstack", +] diff --git a/reflex/components/radix/themes/typography/__init__.py b/reflex/components/radix/themes/typography/__init__.py index 1d47a44fa..bcd41399c 100644 --- a/reflex/components/radix/themes/typography/__init__.py +++ b/reflex/components/radix/themes/typography/__init__.py @@ -19,3 +19,15 @@ link = Link.create quote = Quote.create strong = Strong.create text = Text.create + +__all__ = [ + "blockquote", + "code", + "em", + "heading", + "kbd", + "link", + "quote", + "strong", + "text", +]