Clean up Radix Avatar components props (#2375)
* clean up some props for some radix components * pyi
This commit is contained in:
parent
c81fa261b2
commit
a53af00480
@ -11,8 +11,6 @@ from ..base import (
|
|||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
||||||
|
|
||||||
|
|
||||||
class Avatar(CommonMarginProps, RadixThemesComponent):
|
class Avatar(CommonMarginProps, RadixThemesComponent):
|
||||||
"""A toggle switch alternative to the checkbox."""
|
"""A toggle switch alternative to the checkbox."""
|
||||||
@ -22,7 +20,7 @@ class Avatar(CommonMarginProps, RadixThemesComponent):
|
|||||||
# The variant of the avatar
|
# The variant of the avatar
|
||||||
variant: Var[Literal["solid", "soft"]]
|
variant: Var[Literal["solid", "soft"]]
|
||||||
|
|
||||||
# The size of the avatar
|
# The size of the avatar: "1" - "9"
|
||||||
size: Var[LiteralSize]
|
size: Var[LiteralSize]
|
||||||
|
|
||||||
# Color theme of the avatar
|
# Color theme of the avatar
|
||||||
@ -33,3 +31,9 @@ class Avatar(CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
# Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
# Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
||||||
radius: Var[LiteralRadius]
|
radius: Var[LiteralRadius]
|
||||||
|
|
||||||
|
# The src of the avatar image
|
||||||
|
src: Var[str]
|
||||||
|
|
||||||
|
# The rendered fallback text
|
||||||
|
fallback: Var[str]
|
||||||
|
@ -17,8 +17,6 @@ from ..base import (
|
|||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
||||||
|
|
||||||
class Avatar(CommonMarginProps, RadixThemesComponent):
|
class Avatar(CommonMarginProps, RadixThemesComponent):
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -104,6 +102,8 @@ class Avatar(CommonMarginProps, RadixThemesComponent):
|
|||||||
Literal["none", "small", "medium", "large", "full"],
|
Literal["none", "small", "medium", "large", "full"],
|
||||||
]
|
]
|
||||||
] = None,
|
] = None,
|
||||||
|
src: Optional[Union[Var[str], str]] = None,
|
||||||
|
fallback: Optional[Union[Var[str], str]] = None,
|
||||||
m: Optional[
|
m: Optional[
|
||||||
Union[
|
Union[
|
||||||
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
|
||||||
@ -209,9 +209,11 @@ class Avatar(CommonMarginProps, RadixThemesComponent):
|
|||||||
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 avatar
|
variant: The variant of the avatar
|
||||||
size: The size of the avatar
|
size: The size of the avatar: "1" - "9"
|
||||||
high_contrast: Whether to render the avatar with higher contrast color against background
|
high_contrast: Whether to render the avatar with higher contrast color against background
|
||||||
radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
||||||
|
src: The src of the avatar image
|
||||||
|
fallback: The rendered fallback text
|
||||||
m: Margin: "0" - "9"
|
m: Margin: "0" - "9"
|
||||||
mx: Margin horizontal: "0" - "9"
|
mx: Margin horizontal: "0" - "9"
|
||||||
my: Margin vertical: "0" - "9"
|
my: Margin vertical: "0" - "9"
|
||||||
|
@ -11,25 +11,23 @@ from ..base import (
|
|||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
||||||
|
|
||||||
|
|
||||||
class Badge(el.Span, CommonMarginProps, RadixThemesComponent):
|
class Badge(el.Span, CommonMarginProps, RadixThemesComponent):
|
||||||
"""A toggle switch alternative to the checkbox."""
|
"""A toggle switch alternative to the checkbox."""
|
||||||
|
|
||||||
tag = "Badge"
|
tag = "Badge"
|
||||||
|
|
||||||
# The variant of the avatar
|
# The variant of the badge
|
||||||
variant: Var[Literal["solid", "soft", "surface", "outline"]]
|
variant: Var[Literal["solid", "soft", "surface", "outline"]]
|
||||||
|
|
||||||
# The size of the avatar
|
# The size of the badge
|
||||||
size: Var[Literal["1", "2"]]
|
size: Var[Literal["1", "2"]]
|
||||||
|
|
||||||
# Color theme of the avatar
|
# Color theme of the badge
|
||||||
color: Var[LiteralAccentColor]
|
color: Var[LiteralAccentColor]
|
||||||
|
|
||||||
# Whether to render the avatar with higher contrast color against background
|
# Whether to render the badge with higher contrast color against background
|
||||||
high_contrast: Var[bool]
|
high_contrast: Var[bool]
|
||||||
|
|
||||||
# Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
# Override theme radius for badge: "none" | "small" | "medium" | "large" | "full"
|
||||||
radius: Var[LiteralRadius]
|
radius: Var[LiteralRadius]
|
||||||
|
@ -17,8 +17,6 @@ from ..base import (
|
|||||||
RadixThemesComponent,
|
RadixThemesComponent,
|
||||||
)
|
)
|
||||||
|
|
||||||
LiteralSwitchSize = Literal["1", "2", "3", "4"]
|
|
||||||
|
|
||||||
class Badge(el.Span, CommonMarginProps, RadixThemesComponent):
|
class Badge(el.Span, CommonMarginProps, RadixThemesComponent):
|
||||||
@overload
|
@overload
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -249,10 +247,10 @@ class Badge(el.Span, CommonMarginProps, 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 avatar
|
variant: The variant of the badge
|
||||||
size: The size of the avatar
|
size: The size of the badge
|
||||||
high_contrast: Whether to render the avatar with higher contrast color against background
|
high_contrast: Whether to render the badge with higher contrast color against background
|
||||||
radius: Override theme radius for avatar: "none" | "small" | "medium" | "large" | "full"
|
radius: Override theme radius for badge: "none" | "small" | "medium" | "large" | "full"
|
||||||
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.
|
||||||
|
@ -50,7 +50,7 @@ class DialogContent(el.Div, CommonMarginProps, RadixThemesComponent):
|
|||||||
|
|
||||||
tag = "Dialog.Content"
|
tag = "Dialog.Content"
|
||||||
|
|
||||||
# Button 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]:
|
||||||
|
@ -832,7 +832,7 @@ class DialogContent(el.Div, CommonMarginProps, 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: Button size "1" - "4"
|
size: DialogContent size "1" - "4"
|
||||||
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.
|
||||||
|
@ -26,7 +26,7 @@ class IconButton(el.Button, CommonMarginProps, RadixThemesComponent):
|
|||||||
# Button size "1" - "4"
|
# Button size "1" - "4"
|
||||||
size: Var[LiteralButtonSize]
|
size: Var[LiteralButtonSize]
|
||||||
|
|
||||||
# Variant of button: "solid" | "soft" | "outline" | "ghost"
|
# Variant of button: "classic" | "solid" | "soft" | "surface" | "outline" | "ghost"
|
||||||
variant: Var[LiteralVariant]
|
variant: Var[LiteralVariant]
|
||||||
|
|
||||||
# Override theme color for button
|
# Override theme color for button
|
||||||
|
@ -282,7 +282,7 @@ class IconButton(el.Button, CommonMarginProps, RadixThemesComponent):
|
|||||||
color_scheme: map to radix color property.
|
color_scheme: map to radix color property.
|
||||||
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
|
||||||
size: Button size "1" - "4"
|
size: Button size "1" - "4"
|
||||||
variant: Variant of button: "solid" | "soft" | "outline" | "ghost"
|
variant: Variant of button: "classic" | "solid" | "soft" | "surface" | "outline" | "ghost"
|
||||||
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" | "medium" | "large" | "full"
|
||||||
auto_focus: Automatically focuses the button when the page loads
|
auto_focus: Automatically focuses the button when the page loads
|
||||||
|
Loading…
Reference in New Issue
Block a user