This commit is contained in:
Elijah 2024-10-18 13:10:19 +00:00
parent c8ea434cc1
commit 81da27c777
7 changed files with 122 additions and 36 deletions

View File

@ -143,6 +143,7 @@ class ConnectionBanner(Component):
def create( # type: ignore
cls,
*children,
comp: Optional[Union[Component, Var[Optional[Component]]]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
@ -168,9 +169,6 @@ class ConnectionBanner(Component):
) -> "ConnectionBanner":
"""Create a connection banner component.
Args:
comp: The component to render when there's a server connection error.
Returns:
The connection banner component.
"""
@ -182,6 +180,7 @@ class ConnectionModal(Component):
def create( # type: ignore
cls,
*children,
comp: Optional[Union[Component, Var[Optional[Component]]]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
@ -207,9 +206,6 @@ class ConnectionModal(Component):
) -> "ConnectionModal":
"""Create a connection banner component.
Args:
comp: The component to render when there's a server connection error.
Returns:
The connection banner component.
"""

View File

@ -356,8 +356,6 @@ class CodeBlock(Component):
def create( # type: ignore
cls,
*children,
can_copy: Optional[bool] = False,
copy_button: Optional[Union[Component, bool]] = None,
theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
language: Optional[
Union[
@ -933,6 +931,10 @@ class CodeBlock(Component):
wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
can_copy: Optional[Union[Var[Optional[bool]], bool]] = None,
copy_button: Optional[
Union[Component, Var[Optional[Union[Component, bool]]], bool]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
@ -960,8 +962,6 @@ class CodeBlock(Component):
Args:
*children: The children of the component.
can_copy: Whether a copy button should appears.
copy_button: A custom copy button to override the default one.
theme: The theme to use ("light" or "dark").
language: The language to use.
code: The code to display.
@ -970,6 +970,8 @@ class CodeBlock(Component):
wrap_long_lines: Whether to wrap long lines.
custom_style: A custom style for the code block.
code_tag_props: Props passed down to the code tag.
can_copy: Whether a copy button should appear.
copy_button: A custom copy button to override the default one.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.
@ -991,8 +993,6 @@ class CodeblockNamespace(ComponentNamespace):
@staticmethod
def __call__(
*children,
can_copy: Optional[bool] = False,
copy_button: Optional[Union[Component, bool]] = None,
theme: Optional[Union[Theme, Var[Union[Theme, str]], str]] = None,
language: Optional[
Union[
@ -1568,6 +1568,10 @@ class CodeblockNamespace(ComponentNamespace):
wrap_long_lines: Optional[Union[Var[bool], bool]] = None,
custom_style: Optional[Dict[str, Union[str, Var, Color]]] = None,
code_tag_props: Optional[Union[Dict[str, str], Var[Dict[str, str]]]] = None,
can_copy: Optional[Union[Var[Optional[bool]], bool]] = None,
copy_button: Optional[
Union[Component, Var[Optional[Union[Component, bool]]], bool]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
@ -1595,8 +1599,6 @@ class CodeblockNamespace(ComponentNamespace):
Args:
*children: The children of the component.
can_copy: Whether a copy button should appears.
copy_button: A custom copy button to override the default one.
theme: The theme to use ("light" or "dark").
language: The language to use.
code: The code to display.
@ -1605,6 +1607,8 @@ class CodeblockNamespace(ComponentNamespace):
wrap_long_lines: Whether to wrap long lines.
custom_style: A custom style for the code block.
code_tag_props: Props passed down to the code tag.
can_copy: Whether a copy button should appear.
copy_button: A custom copy button to override the default one.
style: The style of the component.
key: A unique key for the component.
id: The id for the component.

View File

@ -302,10 +302,14 @@ class AccordionItem(AccordionComponent):
def create( # type: ignore
cls,
*children,
header: Optional[Union[Component, Var]] = None,
content: Optional[Union[Component, Var]] = None,
value: Optional[Union[Var[str], str]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
header: Optional[
Union[Component, Var[Optional[Union[Component, str]]], str]
] = None,
content: Optional[
Union[Component, Var[Optional[Union[Component, str]]], str]
] = None,
color_scheme: Optional[
Union[
Literal[
@ -402,10 +406,10 @@ class AccordionItem(AccordionComponent):
Args:
*children: The list of children to use if header and content are not provided.
header: The header of the accordion item.
content: The content of the accordion item.
value: A unique identifier for the item.
disabled: When true, prevents the user from interacting with the item.
header: The header of the accordion item.
content: The content of the accordion item.
color_scheme: The color scheme of the component.
variant: The variant of the component.
as_child: Change the default rendered element for the one passed as a child.

View File

@ -75,6 +75,17 @@ class ColorModeIconButton(IconButton):
def create( # type: ignore
cls,
*children,
position: Optional[
Union[
Literal["bottom-left", "bottom-right", "top-left", "top-right"],
Var[
Optional[
Literal["bottom-left", "bottom-right", "top-left", "top-right"]
]
],
]
] = None,
allow_system: Optional[Union[Var[bool], bool]] = None,
as_child: Optional[Union[Var[bool], bool]] = None,
size: Optional[
Union[

View File

@ -22,7 +22,6 @@ class Slider(RadixThemesComponent):
def create( # type: ignore
cls,
*children,
width: Optional[str] = "100%",
as_child: Optional[Union[Var[bool], bool]] = None,
size: Optional[
Union[
@ -121,6 +120,7 @@ class Slider(RadixThemesComponent):
Union[List[Union[float, int]], Var[List[Union[float, int]]]]
] = None,
name: Optional[Union[Var[str], str]] = None,
width: Optional[Union[Var[Optional[str]], str]] = None,
min: Optional[Union[Var[Union[float, int]], float, int]] = None,
max: Optional[Union[Var[Union[float, int]], float, int]] = None,
step: Optional[Union[Var[Union[float, int]], float, int]] = None,
@ -160,7 +160,6 @@ class Slider(RadixThemesComponent):
Args:
*children: The children of the component.
width: The width of the slider.
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
size: Button size "1" - "3"
variant: Variant of button
@ -170,6 +169,7 @@ class Slider(RadixThemesComponent):
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.
name: The name of the slider. Submitted with its owning form as part of a name/value pair.
width: The width of the slider.
min: The minimum value of the slider.
max: The maximum value of the slider.
step: The step value of the slider.

View File

@ -134,8 +134,50 @@ class UnorderedList(BaseList, Ul):
def create( # type: ignore
cls,
*children,
items: Optional[Union[Iterable, Var[Iterable]]] = None,
list_style_type: Optional[LiteralListStyleTypeUnordered] = "disc",
list_style_type: Optional[
Union[
Literal[
"armenian",
"decimal",
"decimal-leading-zero",
"georgian",
"hiragana",
"katakana",
"lower-alpha",
"lower-greek",
"lower-latin",
"lower-roman",
"none",
"upper-alpha",
"upper-latin",
"upper-roman",
],
Var[
Literal[
"armenian",
"decimal",
"decimal-leading-zero",
"georgian",
"hiragana",
"katakana",
"lower-alpha",
"lower-greek",
"lower-latin",
"lower-roman",
"none",
"upper-alpha",
"upper-latin",
"upper-roman",
]
],
]
] = None,
items: Optional[
Union[
Union[Iterable, Var[Iterable]],
Var[Optional[Union[Iterable, Var[Iterable]]]],
]
] = None,
access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
auto_capitalize: Optional[
Union[Var[Union[bool, int, str]], bool, int, str]
@ -187,8 +229,8 @@ class UnorderedList(BaseList, Ul):
Args:
*children: The children of the component.
list_style_type: The style of the list. Default to "none".
items: A list of items to add to the list.
list_style_type: The style of the list.
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.

View File

@ -10,7 +10,6 @@ from reflex.event import EventType
from reflex.style import Style
from reflex.vars.base import Var
from ..base import LiteralAlign, LiteralSpacing
from .flex import Flex
class Stack(Flex):
@ -19,8 +18,18 @@ class Stack(Flex):
def create( # type: ignore
cls,
*children,
spacing: Optional[LiteralSpacing] = "3",
align: Optional[LiteralAlign] = "start",
spacing: Optional[
Union[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
align: Optional[
Union[
Literal["baseline", "center", "end", "start", "stretch"],
Var[Literal["baseline", "center", "end", "start", "stretch"]],
]
] = None,
as_child: Optional[Union[Var[bool], bool]] = None,
direction: Optional[
Union[
@ -114,8 +123,8 @@ class Stack(Flex):
Args:
*children: The children of the stack.
spacing: The spacing between each stack item.
align: The alignment of the stack items.
spacing: Gap between children: "0" - "9"
align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch"
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
@ -155,14 +164,24 @@ class VStack(Stack):
def create( # type: ignore
cls,
*children,
spacing: Optional[LiteralSpacing] = "3",
align: Optional[LiteralAlign] = "start",
direction: Optional[
Union[
Literal["column", "column-reverse", "row", "row-reverse"],
Var[Literal["column", "column-reverse", "row", "row-reverse"]],
]
] = None,
spacing: Optional[
Union[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
align: Optional[
Union[
Literal["baseline", "center", "end", "start", "stretch"],
Var[Literal["baseline", "center", "end", "start", "stretch"]],
]
] = None,
as_child: Optional[Union[Var[bool], bool]] = None,
justify: Optional[
Union[
@ -239,9 +258,9 @@ class VStack(Stack):
Args:
*children: The children of the stack.
spacing: The spacing between each stack item.
align: The alignment of the stack items.
direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
spacing: Gap between children: "0" - "9"
align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch"
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
@ -280,14 +299,24 @@ class HStack(Stack):
def create( # type: ignore
cls,
*children,
spacing: Optional[LiteralSpacing] = "3",
align: Optional[LiteralAlign] = "start",
direction: Optional[
Union[
Literal["column", "column-reverse", "row", "row-reverse"],
Var[Literal["column", "column-reverse", "row", "row-reverse"]],
]
] = None,
spacing: Optional[
Union[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
align: Optional[
Union[
Literal["baseline", "center", "end", "start", "stretch"],
Var[Literal["baseline", "center", "end", "start", "stretch"]],
]
] = None,
as_child: Optional[Union[Var[bool], bool]] = None,
justify: Optional[
Union[
@ -364,9 +393,9 @@ class HStack(Stack):
Args:
*children: The children of the stack.
spacing: The spacing between each stack item.
align: The alignment of the stack items.
direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
spacing: Gap between children: "0" - "9"
align: Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch"
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"