many small changes from going over all props (#2532)
This commit is contained in:
parent
450aa909ca
commit
cb66933921
@ -17,7 +17,7 @@ class Button(BaseHTML):
|
|||||||
auto_focus: Var[Union[str, int, bool]]
|
auto_focus: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
# Disables the button
|
# Disables the button
|
||||||
disabled: Var[Union[str, int, bool]]
|
disabled: Var[bool]
|
||||||
|
|
||||||
# Associates the button with a form (by id)
|
# Associates the button with a form (by id)
|
||||||
form: Var[Union[str, int, bool]]
|
form: Var[Union[str, int, bool]]
|
||||||
|
@ -22,9 +22,7 @@ class Button(BaseHTML):
|
|||||||
auto_focus: Optional[
|
auto_focus: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
] = None,
|
] = None,
|
||||||
disabled: Optional[
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
||||||
form_action: Optional[
|
form_action: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
|
@ -5,9 +5,9 @@ from reflex import el
|
|||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
|
|
||||||
from ..base import LiteralSize, RadixThemesComponent
|
from ..base import RadixThemesComponent
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
LiteralContentSize = Literal["1", "2", "3", "4"]
|
||||||
|
|
||||||
|
|
||||||
class AlertDialogRoot(RadixThemesComponent):
|
class AlertDialogRoot(RadixThemesComponent):
|
||||||
@ -42,7 +42,7 @@ class AlertDialogContent(el.Div, RadixThemesComponent):
|
|||||||
tag = "AlertDialog.Content"
|
tag = "AlertDialog.Content"
|
||||||
|
|
||||||
# The size of the content.
|
# The size of the content.
|
||||||
size: Var[LiteralSize]
|
size: Var[LiteralContentSize]
|
||||||
|
|
||||||
# Whether to force mount the content on open.
|
# Whether to force mount the content on open.
|
||||||
force_mount: Var[bool]
|
force_mount: Var[bool]
|
||||||
|
@ -11,9 +11,9 @@ from typing import Any, Dict, Literal
|
|||||||
from reflex import el
|
from reflex import el
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
from ..base import LiteralSize, RadixThemesComponent
|
from ..base import RadixThemesComponent
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
LiteralContentSize = Literal["1", "2", "3", "4"]
|
||||||
|
|
||||||
class AlertDialogRoot(RadixThemesComponent):
|
class AlertDialogRoot(RadixThemesComponent):
|
||||||
def get_event_triggers(self) -> Dict[str, Any]: ...
|
def get_event_triggers(self) -> Dict[str, Any]: ...
|
||||||
@ -384,10 +384,7 @@ class AlertDialogContent(el.Div, RadixThemesComponent):
|
|||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
size: Optional[
|
size: Optional[
|
||||||
Union[
|
Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
|
||||||
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
||||||
]
|
|
||||||
] = None,
|
] = None,
|
||||||
force_mount: Optional[Union[Var[bool], bool]] = None,
|
force_mount: Optional[Union[Var[bool], bool]] = None,
|
||||||
access_key: Optional[
|
access_key: Optional[
|
||||||
|
@ -108,9 +108,7 @@ class Button(el.Button, RadixThemesComponent):
|
|||||||
auto_focus: Optional[
|
auto_focus: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
] = None,
|
] = None,
|
||||||
disabled: Optional[
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
||||||
form_action: Optional[
|
form_action: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
|
@ -48,7 +48,7 @@ class DialogContent(el.Div, RadixThemesComponent):
|
|||||||
tag = "Dialog.Content"
|
tag = "Dialog.Content"
|
||||||
|
|
||||||
# DialogContent size "1" - "4"
|
# DialogContent size "1" - "4"
|
||||||
size: Var[Literal[1, 2, 3, 4]]
|
size: Var[Literal["1", "2", "3", "4"]]
|
||||||
|
|
||||||
def get_event_triggers(self) -> Dict[str, Any]:
|
def get_event_triggers(self) -> Dict[str, Any]:
|
||||||
"""Get the events triggers signatures for the component.
|
"""Get the events triggers signatures for the component.
|
||||||
|
@ -527,7 +527,9 @@ class DialogContent(el.Div, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
size: Optional[Union[Var[Literal[1, 2, 3, 4]], Literal[1, 2, 3, 4]]] = None,
|
size: Optional[
|
||||||
|
Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
|
||||||
|
] = None,
|
||||||
access_key: Optional[
|
access_key: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
] = None,
|
] = None,
|
||||||
|
@ -111,9 +111,7 @@ class IconButton(el.Button, RadixThemesComponent):
|
|||||||
auto_focus: Optional[
|
auto_focus: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
] = None,
|
] = None,
|
||||||
disabled: Optional[
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
||||||
form_action: Optional[
|
form_action: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
|
@ -45,7 +45,7 @@ class PopoverContent(el.Div, RadixThemesComponent):
|
|||||||
tag = "Popover.Content"
|
tag = "Popover.Content"
|
||||||
|
|
||||||
# Size of the button: "1" | "2" | "3" | "4"
|
# Size of the button: "1" | "2" | "3" | "4"
|
||||||
size: Var[Literal[1, 2, 3, 4]]
|
size: Var[Literal["1", "2", "3", "4"]]
|
||||||
|
|
||||||
# The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
|
# The preferred side of the anchor to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
|
||||||
side: Var[Literal["top", "right", "bottom", "left"]]
|
side: Var[Literal["top", "right", "bottom", "left"]]
|
||||||
|
@ -383,7 +383,9 @@ class PopoverContent(el.Div, RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
size: Optional[Union[Var[Literal[1, 2, 3, 4]], Literal[1, 2, 3, 4]]] = None,
|
size: Optional[
|
||||||
|
Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
|
||||||
|
] = None,
|
||||||
side: Optional[
|
side: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["top", "right", "bottom", "left"]],
|
Var[Literal["top", "right", "bottom", "left"]],
|
||||||
|
@ -49,12 +49,6 @@ class RadioGroupRoot(RadixThemesComponent):
|
|||||||
# Whether the radio group is required
|
# Whether the radio group is required
|
||||||
required: Var[bool]
|
required: Var[bool]
|
||||||
|
|
||||||
# The orientation of the component.
|
|
||||||
orientation: Var[Literal["horizontal", "vertical"]]
|
|
||||||
|
|
||||||
# When true, keyboard navigation will loop from last item to first, and vice versa.
|
|
||||||
loop: Var[bool]
|
|
||||||
|
|
||||||
# Props to rename
|
# Props to rename
|
||||||
_rename_props = {"onChange": "onValueChange"}
|
_rename_props = {"onChange": "onValueChange"}
|
||||||
|
|
||||||
@ -85,7 +79,7 @@ class RadioGroupItem(RadixThemesComponent):
|
|||||||
required: Var[bool]
|
required: Var[bool]
|
||||||
|
|
||||||
|
|
||||||
class HighLevelRadioGroup(RadioGroupRoot):
|
class HighLevelRadioGroup(RadixThemesComponent):
|
||||||
"""High level wrapper for the RadioGroup component."""
|
"""High level wrapper for the RadioGroup component."""
|
||||||
|
|
||||||
# The items of the radio group.
|
# The items of the radio group.
|
||||||
@ -100,6 +94,33 @@ class HighLevelRadioGroup(RadioGroupRoot):
|
|||||||
# The size of the radio group.
|
# The size of the radio group.
|
||||||
size: Var[Literal["1", "2", "3"]] = Var.create_safe("2")
|
size: Var[Literal["1", "2", "3"]] = Var.create_safe("2")
|
||||||
|
|
||||||
|
# The variant of the radio group
|
||||||
|
variant: Var[Literal["classic", "surface", "soft"]]
|
||||||
|
|
||||||
|
# The color of the radio group
|
||||||
|
color_scheme: Var[LiteralAccentColor]
|
||||||
|
|
||||||
|
# Whether to render the radio group with higher contrast color against background
|
||||||
|
high_contrast: Var[bool]
|
||||||
|
|
||||||
|
# The controlled value of the radio item to check. Should be used in conjunction with on_change.
|
||||||
|
value: Var[str]
|
||||||
|
|
||||||
|
# The initial value of checked radio item. Should be used in conjunction with on_change.
|
||||||
|
default_value: Var[str]
|
||||||
|
|
||||||
|
# Whether the radio group is disabled
|
||||||
|
disabled: Var[bool]
|
||||||
|
|
||||||
|
# The name of the group. Submitted with its owning form as part of a name/value pair.
|
||||||
|
name: Var[str]
|
||||||
|
|
||||||
|
# Whether the radio group is required
|
||||||
|
required: Var[bool]
|
||||||
|
|
||||||
|
# Props to rename
|
||||||
|
_rename_props = {"onChange": "onValueChange"}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(
|
def create(
|
||||||
cls,
|
cls,
|
||||||
|
@ -103,13 +103,6 @@ class RadioGroupRoot(RadixThemesComponent):
|
|||||||
disabled: Optional[Union[Var[bool], bool]] = None,
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
name: Optional[Union[Var[str], str]] = None,
|
name: Optional[Union[Var[str], str]] = None,
|
||||||
required: Optional[Union[Var[bool], bool]] = None,
|
required: Optional[Union[Var[bool], bool]] = None,
|
||||||
orientation: Optional[
|
|
||||||
Union[
|
|
||||||
Var[Literal["horizontal", "vertical"]],
|
|
||||||
Literal["horizontal", "vertical"],
|
|
||||||
]
|
|
||||||
] = None,
|
|
||||||
loop: Optional[Union[Var[bool], bool]] = None,
|
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
@ -184,8 +177,6 @@ class RadioGroupRoot(RadixThemesComponent):
|
|||||||
disabled: Whether the radio group is disabled
|
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.
|
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
|
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: Props to rename The style of the component.
|
style: Props to rename The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
@ -352,7 +343,7 @@ class RadioGroupItem(RadixThemesComponent):
|
|||||||
"""
|
"""
|
||||||
...
|
...
|
||||||
|
|
||||||
class HighLevelRadioGroup(RadioGroupRoot):
|
class HighLevelRadioGroup(RadixThemesComponent):
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
def create( # type: ignore
|
def create( # type: ignore
|
||||||
@ -448,13 +439,6 @@ class HighLevelRadioGroup(RadioGroupRoot):
|
|||||||
disabled: Optional[Union[Var[bool], bool]] = None,
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
name: Optional[Union[Var[str], str]] = None,
|
name: Optional[Union[Var[str], str]] = None,
|
||||||
required: Optional[Union[Var[bool], bool]] = None,
|
required: Optional[Union[Var[bool], bool]] = None,
|
||||||
orientation: Optional[
|
|
||||||
Union[
|
|
||||||
Var[Literal["horizontal", "vertical"]],
|
|
||||||
Literal["horizontal", "vertical"],
|
|
||||||
]
|
|
||||||
] = None,
|
|
||||||
loop: Optional[Union[Var[bool], bool]] = None,
|
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
@ -465,9 +449,6 @@ class HighLevelRadioGroup(RadioGroupRoot):
|
|||||||
on_blur: Optional[
|
on_blur: Optional[
|
||||||
Union[EventHandler, EventSpec, list, function, BaseVar]
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
] = None,
|
] = None,
|
||||||
on_change: Optional[
|
|
||||||
Union[EventHandler, EventSpec, list, function, BaseVar]
|
|
||||||
] = None,
|
|
||||||
on_click: Optional[
|
on_click: Optional[
|
||||||
Union[EventHandler, EventSpec, list, function, BaseVar]
|
Union[EventHandler, EventSpec, list, function, BaseVar]
|
||||||
] = None,
|
] = None,
|
||||||
@ -519,7 +500,7 @@ class HighLevelRadioGroup(RadioGroupRoot):
|
|||||||
items: The items of the radio group.
|
items: The items of the radio group.
|
||||||
direction: The direction of the radio group.
|
direction: The direction of the radio group.
|
||||||
gap: The gap between the items of the radio group.
|
gap: The gap between the items of the radio group.
|
||||||
size: The size of the radio group: "1" | "2" | "3"
|
size: The size of the radio group.
|
||||||
variant: The variant of the radio group
|
variant: The variant of the radio group
|
||||||
color_scheme: The color 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
|
high_contrast: Whether to render the radio group with higher contrast color against background
|
||||||
@ -528,8 +509,6 @@ class HighLevelRadioGroup(RadioGroupRoot):
|
|||||||
disabled: Whether the radio group is disabled
|
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.
|
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
|
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: Props to rename The style of the component.
|
style: Props to rename The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -7,7 +7,6 @@ from reflex.vars import Var
|
|||||||
|
|
||||||
from ..base import (
|
from ..base import (
|
||||||
LiteralAccentColor,
|
LiteralAccentColor,
|
||||||
LiteralRadius,
|
|
||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,8 +31,8 @@ class Slider(RadixThemesComponent):
|
|||||||
# Whether to render the button with higher contrast color against background
|
# Whether to render the button with higher contrast color against background
|
||||||
high_contrast: Var[bool]
|
high_contrast: Var[bool]
|
||||||
|
|
||||||
# Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
|
# Override theme radius for button: "none" | "small" | "full"
|
||||||
radius: Var[LiteralRadius]
|
radius: Var[Literal["none", "small", "full"]]
|
||||||
|
|
||||||
# The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
# The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
||||||
default_value: Var[Union[List[Union[float, int]], float, int]]
|
default_value: Var[Union[List[Union[float, int]], float, int]]
|
||||||
|
@ -11,7 +11,7 @@ from typing import Any, Dict, List, Literal, Optional, Union
|
|||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent
|
from ..base import LiteralAccentColor, RadixThemesComponent
|
||||||
|
|
||||||
class Slider(RadixThemesComponent):
|
class Slider(RadixThemesComponent):
|
||||||
def get_event_triggers(self) -> Dict[str, Any]: ...
|
def get_event_triggers(self) -> Dict[str, Any]: ...
|
||||||
@ -96,8 +96,7 @@ class Slider(RadixThemesComponent):
|
|||||||
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
||||||
radius: Optional[
|
radius: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["none", "small", "medium", "large", "full"]],
|
Var[Literal["none", "small", "full"]], Literal["none", "small", "full"]
|
||||||
Literal["none", "small", "medium", "large", "full"],
|
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
default_value: Optional[
|
default_value: Optional[
|
||||||
@ -190,7 +189,7 @@ class Slider(RadixThemesComponent):
|
|||||||
variant: Variant of button
|
variant: Variant of button
|
||||||
color_scheme: Override theme color for button
|
color_scheme: Override theme color for button
|
||||||
high_contrast: Whether to render the button with higher contrast color against background
|
high_contrast: Whether to render the button with higher contrast color against background
|
||||||
radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
|
radius: Override theme radius for button: "none" | "small" | "full"
|
||||||
default_value: The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
default_value: The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
||||||
value: The controlled value of the slider. Must be used in conjunction with onValueChange.
|
value: The controlled value of the slider. Must be used in conjunction with onValueChange.
|
||||||
name: The name of the slider. Submitted with its owning form as part of a name/value pair.
|
name: The name of the slider. Submitted with its owning form as part of a name/value pair.
|
||||||
|
@ -6,12 +6,10 @@ from reflex.vars import Var
|
|||||||
|
|
||||||
from ..base import (
|
from ..base import (
|
||||||
LiteralAccentColor,
|
LiteralAccentColor,
|
||||||
LiteralRadius,
|
|
||||||
LiteralVariant,
|
|
||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
LiteralSwitchSize = Literal["1", "2", "3"]
|
||||||
|
|
||||||
|
|
||||||
class Switch(RadixThemesComponent):
|
class Switch(RadixThemesComponent):
|
||||||
@ -43,8 +41,8 @@ class Switch(RadixThemesComponent):
|
|||||||
# Switch size "1" - "4"
|
# Switch size "1" - "4"
|
||||||
size: Var[LiteralSwitchSize]
|
size: Var[LiteralSwitchSize]
|
||||||
|
|
||||||
# Variant of switch: "solid" | "soft" | "outline" | "ghost"
|
# Variant of switch: "classic" | "surface" | "soft"
|
||||||
variant: Var[LiteralVariant]
|
variant: Var[Literal["classic", "surface", "soft"]]
|
||||||
|
|
||||||
# Override theme color for switch
|
# Override theme color for switch
|
||||||
color_scheme: Var[LiteralAccentColor]
|
color_scheme: Var[LiteralAccentColor]
|
||||||
@ -52,8 +50,8 @@ class Switch(RadixThemesComponent):
|
|||||||
# Whether to render the switch with higher contrast color against background
|
# Whether to render the switch with higher contrast color against background
|
||||||
high_contrast: Var[bool]
|
high_contrast: Var[bool]
|
||||||
|
|
||||||
# Override theme radius for switch: "none" | "small" | "medium" | "large" | "full"
|
# Override theme radius for switch: "none" | "small" | "full"
|
||||||
radius: Var[LiteralRadius]
|
radius: Var[Literal["none", "small", "full"]]
|
||||||
|
|
||||||
# Props to rename
|
# Props to rename
|
||||||
_rename_props = {"onChange": "onCheckedChange"}
|
_rename_props = {"onChange": "onCheckedChange"}
|
||||||
|
@ -10,14 +10,9 @@ from reflex.style import Style
|
|||||||
from typing import Any, Dict, Literal
|
from typing import Any, Dict, Literal
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
from ..base import (
|
from ..base import LiteralAccentColor, RadixThemesComponent
|
||||||
LiteralAccentColor,
|
|
||||||
LiteralRadius,
|
|
||||||
LiteralVariant,
|
|
||||||
RadixThemesComponent,
|
|
||||||
)
|
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
LiteralSwitchSize = Literal["1", "2", "3"]
|
||||||
|
|
||||||
class Switch(RadixThemesComponent):
|
class Switch(RadixThemesComponent):
|
||||||
def get_event_triggers(self) -> Dict[str, Any]: ...
|
def get_event_triggers(self) -> Dict[str, Any]: ...
|
||||||
@ -97,19 +92,18 @@ class Switch(RadixThemesComponent):
|
|||||||
name: Optional[Union[Var[str], str]] = None,
|
name: Optional[Union[Var[str], str]] = None,
|
||||||
value: Optional[Union[Var[str], str]] = None,
|
value: Optional[Union[Var[str], str]] = None,
|
||||||
size: Optional[
|
size: Optional[
|
||||||
Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
|
Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
|
||||||
] = None,
|
] = None,
|
||||||
variant: Optional[
|
variant: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["classic", "solid", "soft", "surface", "outline", "ghost"]],
|
Var[Literal["classic", "surface", "soft"]],
|
||||||
Literal["classic", "solid", "soft", "surface", "outline", "ghost"],
|
Literal["classic", "surface", "soft"],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
high_contrast: Optional[Union[Var[bool], bool]] = None,
|
||||||
radius: Optional[
|
radius: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["none", "small", "medium", "large", "full"]],
|
Var[Literal["none", "small", "full"]], Literal["none", "small", "full"]
|
||||||
Literal["none", "small", "medium", "large", "full"],
|
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
@ -186,9 +180,9 @@ class Switch(RadixThemesComponent):
|
|||||||
name: The name of the switch (when submitting a form)
|
name: The name of the switch (when submitting a form)
|
||||||
value: The value associated with the "on" position
|
value: The value associated with the "on" position
|
||||||
size: Switch size "1" - "4"
|
size: Switch size "1" - "4"
|
||||||
variant: Variant of switch: "solid" | "soft" | "outline" | "ghost"
|
variant: Variant of switch: "classic" | "surface" | "soft"
|
||||||
high_contrast: Whether to render the switch with higher contrast color against background
|
high_contrast: Whether to render the switch with higher contrast color against background
|
||||||
radius: Override theme radius for switch: "none" | "small" | "medium" | "large" | "full"
|
radius: Override theme radius for switch: "none" | "small" | "full"
|
||||||
style: Props to rename The style of the component.
|
style: Props to rename The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -14,9 +14,6 @@ class TabsRoot(RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "Tabs.Root"
|
tag = "Tabs.Root"
|
||||||
|
|
||||||
# The variant of the tab
|
|
||||||
variant: Var[Literal["surface", "ghost"]]
|
|
||||||
|
|
||||||
# The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs.
|
# The value of the tab that should be active when initially rendered. Use when you do not need to control the state of the tabs.
|
||||||
default_value: Var[str]
|
default_value: Var[str]
|
||||||
|
|
||||||
@ -46,6 +43,9 @@ class TabsList(RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "Tabs.List"
|
tag = "Tabs.List"
|
||||||
|
|
||||||
|
# Tabs size "1" - "2"
|
||||||
|
size: Var[Literal["1", "2"]]
|
||||||
|
|
||||||
|
|
||||||
class TabsTrigger(RadixThemesComponent):
|
class TabsTrigger(RadixThemesComponent):
|
||||||
"""Trigger an action or event, such as submitting a form or displaying a dialog."""
|
"""Trigger an action or event, such as submitting a form or displaying a dialog."""
|
||||||
|
@ -82,9 +82,6 @@ class TabsRoot(RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
variant: Optional[
|
|
||||||
Union[Var[Literal["surface", "ghost"]], Literal["surface", "ghost"]]
|
|
||||||
] = None,
|
|
||||||
default_value: Optional[Union[Var[str], str]] = None,
|
default_value: Optional[Union[Var[str], str]] = None,
|
||||||
value: Optional[Union[Var[str], str]] = None,
|
value: Optional[Union[Var[str], str]] = None,
|
||||||
orientation: Optional[
|
orientation: Optional[
|
||||||
@ -159,7 +156,6 @@ class TabsRoot(RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix 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.
|
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.
|
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.
|
orientation: The orientation of the tabs.
|
||||||
@ -246,6 +242,7 @@ class TabsList(RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None,
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
@ -309,6 +306,7 @@ class TabsList(RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
|
size: Tabs size "1" - "2"
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
"""Interactive components provided by @radix-ui/themes."""
|
"""Interactive components provided by @radix-ui/themes."""
|
||||||
from typing import Any, Dict, Literal
|
from typing import Any, Dict, Literal, Union
|
||||||
|
|
||||||
from reflex import el
|
from reflex import el
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
@ -29,6 +29,48 @@ class TextArea(RadixThemesComponent, el.Textarea):
|
|||||||
# The color of the text area
|
# The color of the text area
|
||||||
color_scheme: Var[LiteralAccentColor]
|
color_scheme: Var[LiteralAccentColor]
|
||||||
|
|
||||||
|
# Whether the form control should have autocomplete enabled
|
||||||
|
auto_complete: Var[bool]
|
||||||
|
|
||||||
|
# Automatically focuses the textarea when the page loads
|
||||||
|
auto_focus: Var[bool]
|
||||||
|
|
||||||
|
# Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
|
||||||
|
dirname: Var[str]
|
||||||
|
|
||||||
|
# Disables the textarea
|
||||||
|
disabled: Var[bool]
|
||||||
|
|
||||||
|
# Associates the textarea with a form (by id)
|
||||||
|
form: Var[Union[str, int, bool]]
|
||||||
|
|
||||||
|
# Maximum number of characters allowed in the textarea
|
||||||
|
max_length: Var[int]
|
||||||
|
|
||||||
|
# Minimum number of characters required in the textarea
|
||||||
|
min_length: Var[int]
|
||||||
|
|
||||||
|
# Name of the textarea, used when submitting the form
|
||||||
|
name: Var[str]
|
||||||
|
|
||||||
|
# Placeholder text in the textarea
|
||||||
|
placeholder: Var[str]
|
||||||
|
|
||||||
|
# Indicates whether the textarea is read-only
|
||||||
|
read_only: Var[bool]
|
||||||
|
|
||||||
|
# Indicates that the textarea is required
|
||||||
|
required: Var[bool]
|
||||||
|
|
||||||
|
# Visible number of lines in the text control
|
||||||
|
rows: Var[str]
|
||||||
|
|
||||||
|
# The controlled value of the textarea, read only unless used with on_change
|
||||||
|
value: Var[str]
|
||||||
|
|
||||||
|
# How the text in the textarea is to be wrapped when submitting the form
|
||||||
|
wrap: Var[str]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create(cls, *children, **props) -> Component:
|
def create(cls, *children, **props) -> Component:
|
||||||
"""Create an Input component.
|
"""Create an Input component.
|
||||||
|
@ -7,7 +7,7 @@ from typing import Any, Dict, Literal, Optional, Union, overload
|
|||||||
from reflex.vars import Var, BaseVar, ComputedVar
|
from reflex.vars import Var, BaseVar, ComputedVar
|
||||||
from reflex.event import EventChain, EventHandler, EventSpec
|
from reflex.event import EventChain, EventHandler, EventSpec
|
||||||
from reflex.style import Style
|
from reflex.style import Style
|
||||||
from typing import Any, Dict, Literal
|
from typing import Any, Dict, Literal, Union
|
||||||
from reflex import el
|
from reflex import el
|
||||||
from reflex.components.component import Component
|
from reflex.components.component import Component
|
||||||
from reflex.components.core.debounce import DebounceInput
|
from reflex.components.core.debounce import DebounceInput
|
||||||
@ -94,41 +94,21 @@ class TextArea(RadixThemesComponent, el.Textarea):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
auto_complete: Optional[
|
auto_complete: Optional[Union[Var[bool], bool]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
auto_focus: Optional[Union[Var[bool], bool]] = None,
|
||||||
] = None,
|
dirname: Optional[Union[Var[str], str]] = None,
|
||||||
auto_focus: Optional[
|
disabled: Optional[Union[Var[bool], bool]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
cols: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
||||||
dirname: Optional[
|
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
disabled: Optional[
|
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
||||||
max_length: Optional[
|
max_length: Optional[Union[Var[int], int]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
min_length: Optional[Union[Var[int], int]] = None,
|
||||||
] = None,
|
name: Optional[Union[Var[str], str]] = None,
|
||||||
min_length: Optional[
|
placeholder: Optional[Union[Var[str], str]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
read_only: Optional[Union[Var[bool], bool]] = None,
|
||||||
] = None,
|
required: Optional[Union[Var[bool], bool]] = None,
|
||||||
name: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
rows: Optional[Union[Var[str], str]] = None,
|
||||||
placeholder: Optional[
|
value: Optional[Union[Var[str], str]] = None,
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
wrap: Optional[Union[Var[str], str]] = None,
|
||||||
] = None,
|
cols: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
||||||
read_only: Optional[
|
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
required: Optional[
|
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
rows: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
||||||
value: Optional[
|
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
|
||||||
] = None,
|
|
||||||
wrap: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
|
|
||||||
access_key: Optional[
|
access_key: Optional[
|
||||||
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
Union[Var[Union[str, int, bool]], Union[str, int, bool]]
|
||||||
] = None,
|
] = None,
|
||||||
@ -244,7 +224,6 @@ class TextArea(RadixThemesComponent, el.Textarea):
|
|||||||
color_scheme: The color of the text area
|
color_scheme: The color of the text area
|
||||||
auto_complete: Whether the form control should have autocomplete enabled
|
auto_complete: Whether the form control should have autocomplete enabled
|
||||||
auto_focus: Automatically focuses the textarea when the page loads
|
auto_focus: Automatically focuses the textarea when the page loads
|
||||||
cols: Visible width of the text control, in average character widths
|
|
||||||
dirname: Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
|
dirname: Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
|
||||||
disabled: Disables the textarea
|
disabled: Disables the textarea
|
||||||
form: Associates the textarea with a form (by id)
|
form: Associates the textarea with a form (by id)
|
||||||
@ -257,6 +236,7 @@ class TextArea(RadixThemesComponent, el.Textarea):
|
|||||||
rows: Visible number of lines in the text control
|
rows: Visible number of lines in the text control
|
||||||
value: The controlled value of the textarea, read only unless used with on_change
|
value: The controlled value of the textarea, read only unless used with on_change
|
||||||
wrap: How the text in the textarea is to be wrapped when submitting the form
|
wrap: How the text in the textarea is to be wrapped when submitting the form
|
||||||
|
cols: Visible width of the text control, in average character widths
|
||||||
access_key: Provides a hint for generating a keyboard shortcut for the current element.
|
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.
|
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.
|
content_editable: Indicates whether the element's content is editable.
|
||||||
|
@ -12,7 +12,6 @@ from reflex.vars import Var
|
|||||||
from ..base import (
|
from ..base import (
|
||||||
LiteralAccentColor,
|
LiteralAccentColor,
|
||||||
LiteralRadius,
|
LiteralRadius,
|
||||||
LiteralSize,
|
|
||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -83,9 +82,6 @@ class TextFieldSlot(RadixThemesComponent):
|
|||||||
# Override theme color for text field slot
|
# Override theme color for text field slot
|
||||||
color_scheme: Var[LiteralAccentColor]
|
color_scheme: Var[LiteralAccentColor]
|
||||||
|
|
||||||
# Override the gap spacing between slot and input: "1" - "9"
|
|
||||||
gap: Var[LiteralSize]
|
|
||||||
|
|
||||||
|
|
||||||
class Input(RadixThemesComponent):
|
class Input(RadixThemesComponent):
|
||||||
"""High level wrapper for the Input component."""
|
"""High level wrapper for the Input component."""
|
||||||
|
@ -15,7 +15,7 @@ from reflex.components.core.debounce import DebounceInput
|
|||||||
from reflex.components.radix.themes.components.icons import Icon
|
from reflex.components.radix.themes.components.icons import Icon
|
||||||
from reflex.constants import EventTriggers
|
from reflex.constants import EventTriggers
|
||||||
from reflex.vars import Var
|
from reflex.vars import Var
|
||||||
from ..base import LiteralAccentColor, LiteralRadius, LiteralSize, RadixThemesComponent
|
from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent
|
||||||
|
|
||||||
LiteralTextFieldSize = Literal["1", "2", "3"]
|
LiteralTextFieldSize = Literal["1", "2", "3"]
|
||||||
LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
|
LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
|
||||||
@ -650,12 +650,6 @@ class TextFieldSlot(RadixThemesComponent):
|
|||||||
],
|
],
|
||||||
]
|
]
|
||||||
] = None,
|
] = 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,
|
|
||||||
style: Optional[Style] = None,
|
style: Optional[Style] = None,
|
||||||
key: Optional[Any] = None,
|
key: Optional[Any] = None,
|
||||||
id: Optional[Any] = None,
|
id: Optional[Any] = None,
|
||||||
@ -719,7 +713,6 @@ class TextFieldSlot(RadixThemesComponent):
|
|||||||
*children: Child components.
|
*children: Child components.
|
||||||
color: map to CSS default color property.
|
color: map to CSS default color property.
|
||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
gap: Override the gap spacing between slot and input: "1" - "9"
|
|
||||||
style: The style of the component.
|
style: The style of the component.
|
||||||
key: A unique key for the component.
|
key: A unique key for the component.
|
||||||
id: The id for the component.
|
id: The id for the component.
|
||||||
|
Loading…
Reference in New Issue
Block a user