From cca037421bf880a0b2cbe479004fe130a9f088e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Brand=C3=A9ho?= Date: Wed, 26 Jun 2024 22:24:47 +0200 Subject: [PATCH] add props for tabs (#3560) --- .../components/radix/themes/components/tabs.py | 12 ++++++++++++ .../components/radix/themes/components/tabs.pyi | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/reflex/components/radix/themes/components/tabs.py b/reflex/components/radix/themes/components/tabs.py index b306f25c5..551b37095 100644 --- a/reflex/components/radix/themes/components/tabs.py +++ b/reflex/components/radix/themes/components/tabs.py @@ -31,6 +31,12 @@ class TabsRoot(RadixThemesComponent): # The orientation of the tabs. orientation: Var[Literal["horizontal", "vertical"]] + # Reading direction of the tabs. + dir: Var[Literal["ltr", "rtl"]] + + # The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked. + activation_mode: Var[Literal["automatic", "manual"]] + # Props to rename _rename_props = {"onChange": "onValueChange"} @@ -58,6 +64,9 @@ class TabsList(RadixThemesComponent): # Tabs size "1" - "2" size: Var[Literal["1", "2"]] + # When true, the tabs will loop when reaching the end. + loop: Var[bool] + def add_style(self): """Add style for the component. @@ -124,6 +133,9 @@ class TabsContent(RadixThemesComponent): # The value of the tab. Must be unique for each tab. value: Var[str] + # Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. + force_mount: Var[bool] + def add_style(self) -> dict[str, Any] | None: """Add style for the component. diff --git a/reflex/components/radix/themes/components/tabs.pyi b/reflex/components/radix/themes/components/tabs.pyi index 422ca8b66..c8ee749bb 100644 --- a/reflex/components/radix/themes/components/tabs.pyi +++ b/reflex/components/radix/themes/components/tabs.pyi @@ -31,6 +31,10 @@ class TabsRoot(RadixThemesComponent): Literal["horizontal", "vertical"], ] ] = None, + dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + activation_mode: Optional[ + Union[Var[Literal["automatic", "manual"]], Literal["automatic", "manual"]] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -97,6 +101,8 @@ class TabsRoot(RadixThemesComponent): 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. orientation: The orientation of the tabs. + dir: Reading direction of the tabs. + activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -118,6 +124,7 @@ class TabsList(RadixThemesComponent): cls, *children, size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None, + loop: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -179,6 +186,7 @@ class TabsList(RadixThemesComponent): Args: *children: Child components. size: Tabs size "1" - "2" + loop: When true, the tabs will loop when reaching the end. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -345,6 +353,7 @@ class TabsContent(RadixThemesComponent): cls, *children, value: Optional[Union[Var[str], str]] = None, + force_mount: Optional[Union[Var[bool], bool]] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -406,6 +415,7 @@ class TabsContent(RadixThemesComponent): Args: *children: Child components. value: The value of the tab. Must be unique for each tab. + force_mount: Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. style: The style of the component. key: A unique key for the component. id: The id for the component. @@ -436,6 +446,10 @@ class Tabs(ComponentNamespace): Literal["horizontal", "vertical"], ] ] = None, + dir: Optional[Union[Var[Literal["ltr", "rtl"]], Literal["ltr", "rtl"]]] = None, + activation_mode: Optional[ + Union[Var[Literal["automatic", "manual"]], Literal["automatic", "manual"]] + ] = None, style: Optional[Style] = None, key: Optional[Any] = None, id: Optional[Any] = None, @@ -502,6 +516,8 @@ class Tabs(ComponentNamespace): 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. orientation: The orientation of the tabs. + dir: Reading direction of the tabs. + activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked. style: The style of the component. key: A unique key for the component. id: The id for the component.