Skip to content

Commit

Permalink
Accept suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo committed Oct 25, 2024
1 parent db143cf commit 7ab15e2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 23 deletions.
6 changes: 3 additions & 3 deletions reflex/components/radix/primitives/accordion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, List, Literal, Optional, Tuple, Union
from typing import Any, List, Literal, Tuple, Union

from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.colors import color
Expand Down Expand Up @@ -194,9 +194,9 @@ class AccordionItem(AccordionComponent):
disabled: Var[bool]

# The header of the accordion item.
header: Optional[Union[Component, str, Var[Union[Component, str]]]] = None
header: Var[Union[Component, str]] = Var.create(None)
# The content of the accordion item.
content: Optional[Union[Component, str, Var[Union[Component, str]]]] = None
content: Var[Union[Component, str]] = Var.create(None)

_valid_children: List[str] = [
"AccordionHeader",
Expand Down
8 changes: 2 additions & 6 deletions reflex/components/radix/primitives/accordion.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,8 @@ class AccordionItem(AccordionComponent):
*children,
value: Optional[Union[Var[str], str]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
header: Optional[
Union[Component, Union[Component, Var[Union[Component, str]], str], str]
] = None,
content: Optional[
Union[Component, Union[Component, Var[Union[Component, str]], str], str]
] = None,
header: Optional[Union[Component, Var[Union[Component, str]], str]] = None,
content: Optional[Union[Component, Var[Union[Component, str]], str]] = None,
color_scheme: Optional[
Union[
Literal[
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/radix/themes/color_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def create(
The button component.
"""
position = props.pop("position", None)
allow_system = props.pop("allow_system", None)
allow_system = props.pop("allow_system", False)

# position is used to set nice defaults for positioning the icon button
if isinstance(position, Var):
Expand Down
8 changes: 1 addition & 7 deletions reflex/components/radix/themes/layout/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BaseList(Component):
] = "none"

# A list of items to add to the list.
items: Optional[Union[Iterable, Var[Iterable]]] = None
items: Var[Iterable] = Var.create([])

@classmethod
def create(
Expand Down Expand Up @@ -99,9 +99,6 @@ class UnorderedList(BaseList, Ul):

tag = "ul"

# The style of the list.
list_style_type: LiteralListStyleTypeUnordered = "disc"

@classmethod
def create(
cls,
Expand Down Expand Up @@ -132,9 +129,6 @@ class OrderedList(BaseList, Ol):

tag = "ol"

# The style of the list.
list_style_type: LiteralListStyleTypeOrdered = "decimal"

@classmethod
def create(
cls,
Expand Down
52 changes: 46 additions & 6 deletions reflex/components/radix/themes/layout/list.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class BaseList(Component):
Literal["circle", "disc", "none", "square"],
]
] = None,
items: Optional[Union[Iterable, Union[Iterable, Var[Iterable]]]] = None,
items: Optional[Union[Iterable, Var[Iterable]]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
Expand Down Expand Up @@ -108,8 +108,28 @@ class UnorderedList(BaseList, Ul):
def create( # type: ignore
cls,
*children,
list_style_type: Optional[LiteralListStyleTypeUnordered] = None,
items: Optional[Union[Iterable, Union[Iterable, Var[Iterable]]]] = None,
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",
],
Literal["circle", "disc", "none", "square"],
]
] = None,
items: 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]
Expand Down Expand Up @@ -199,8 +219,28 @@ class OrderedList(BaseList, Ol):
def create( # type: ignore
cls,
*children,
list_style_type: Optional[LiteralListStyleTypeOrdered] = None,
items: Optional[Union[Iterable, Union[Iterable, Var[Iterable]]]] = None,
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",
],
Literal["circle", "disc", "none", "square"],
]
] = None,
items: Optional[Union[Iterable, Var[Iterable]]] = None,
reversed: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
start: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
type: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
Expand Down Expand Up @@ -406,7 +446,7 @@ class List(ComponentNamespace):
Literal["circle", "disc", "none", "square"],
]
] = None,
items: Optional[Union[Iterable, Union[Iterable, Var[Iterable]]]] = None,
items: Optional[Union[Iterable, Var[Iterable]]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
Expand Down

0 comments on commit 7ab15e2

Please sign in to comment.