Run ruff format

This commit is contained in:
Nikhil Rao 2024-06-13 09:38:28 -07:00
parent 24be948a1c
commit c2117a3e19

View File

@ -16,8 +16,7 @@ from ..base import (
RadixThemesComponent, RadixThemesComponent,
) )
LiteralFlexDirection = Literal["row", LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"]
"column", "row-reverse", "column-reverse"]
class RadioGroupRoot(RadixThemesComponent): class RadioGroupRoot(RadixThemesComponent):
@ -26,8 +25,7 @@ class RadioGroupRoot(RadixThemesComponent):
tag = "RadioGroup.Root" tag = "RadioGroup.Root"
# The size of the radio group: "1" | "2" | "3" # The size of the radio group: "1" | "2" | "3"
size: Var[Literal["1", "2", "3"]] = Var.create_safe( size: Var[Literal["1", "2", "3"]] = Var.create_safe("2", _var_is_string=True)
"2", _var_is_string=True)
# The variant of the radio group # The variant of the radio group
variant: Var[Literal["classic", "surface", "soft"]] = Var.create_safe( variant: Var[Literal["classic", "surface", "soft"]] = Var.create_safe(
@ -100,8 +98,7 @@ class HighLevelRadioGroup(RadixThemesComponent):
spacing: Var[LiteralSpacing] = Var.create_safe("2", _var_is_string=True) spacing: Var[LiteralSpacing] = Var.create_safe("2", _var_is_string=True)
# The size of the radio group. # The size of the radio group.
size: Var[Literal["1", "2", "3"]] = Var.create_safe( size: Var[Literal["1", "2", "3"]] = Var.create_safe("2", _var_is_string=True)
"2", _var_is_string=True)
# The variant of the radio group # The variant of the radio group
variant: Var[Literal["classic", "surface", "soft"]] = Var.create_safe( variant: Var[Literal["classic", "surface", "soft"]] = Var.create_safe(
@ -161,8 +158,7 @@ class HighLevelRadioGroup(RadixThemesComponent):
if isinstance(default_value, str) or ( if isinstance(default_value, str) or (
isinstance(default_value, Var) and default_value._var_type is str isinstance(default_value, Var) and default_value._var_type is str
): ):
default_value = Var.create( default_value = Var.create(default_value, _var_is_string=True) # type: ignore
default_value, _var_is_string=True) # type: ignore
else: else:
default_value = ( default_value = (
Var.create(default_value, _var_is_string=False) Var.create(default_value, _var_is_string=False)
@ -171,8 +167,7 @@ class HighLevelRadioGroup(RadixThemesComponent):
) )
def radio_group_item(value: str | Var) -> Component: def radio_group_item(value: str | Var) -> Component:
item_value = Var.create( item_value = Var.create(value, _var_is_string=False) # type: ignore
value, _var_is_string=False) # type: ignore
item_value = rx.cond( item_value = rx.cond(
item_value._type() == str, # type: ignore item_value._type() == str, # type: ignore
item_value, item_value,
@ -182,8 +177,8 @@ class HighLevelRadioGroup(RadixThemesComponent):
return Text.create( return Text.create(
Flex.create( Flex.create(
RadioGroupItem.create( RadioGroupItem.create(
value=item_value, disabled=props.get( value=item_value,
"disabled", Var.create(False)) disabled=props.get("disabled", Var.create(False)),
), ),
item_value, item_value,
spacing="2", spacing="2",