diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 2e5cf1822e..7a0fc809f2 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -5,11 +5,11 @@ from typing import Any, Dict, Literal from reflex.components import Component +from reflex.components.core.breakpoints import Responsive from reflex.components.tags import Tag from reflex.config import get_config from reflex.utils.imports import ImportDict, ImportVar from reflex.vars.base import Var -from reflex.components.core.breakpoints import Responsive LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] diff --git a/reflex/components/radix/themes/components/table.py b/reflex/components/radix/themes/components/table.py index d130e161ab..a16002f588 100644 --- a/reflex/components/radix/themes/components/table.py +++ b/reflex/components/radix/themes/components/table.py @@ -7,7 +7,7 @@ from reflex.components.el import elements from reflex.vars.base import Var -from ..base import RadixThemesComponent, CommonPaddingProps +from ..base import CommonPaddingProps, RadixThemesComponent class TableRoot(elements.Table, RadixThemesComponent): @@ -51,6 +51,12 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): # The justification of the column justify: Var[Literal["start", "center", "end"]] + # The minimum width of the cell + min_width: Var[Responsive[str]] + + # The maximum width of the cell + max_width: Var[Responsive[str]] + _invalid_children: List[str] = [ "TableBody", "TableHeader", @@ -107,6 +113,12 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent): # The justification of the column justify: Var[Literal["start", "center", "end"]] + # The minimum width of the cell + min_width: Var[Responsive[str]] + + # The maximum width of the cell + max_width: Var[Responsive[str]] + _invalid_children: List[str] = [ "TableBody", "TableHeader", diff --git a/reflex/components/radix/themes/components/table.pyi b/reflex/components/radix/themes/components/table.pyi index ca9827a709..42f5e074a6 100644 --- a/reflex/components/radix/themes/components/table.pyi +++ b/reflex/components/radix/themes/components/table.pyi @@ -322,6 +322,12 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): Var[Literal["center", "end", "start"]], ] ] = None, + min_width: Optional[ + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] + ] = None, + max_width: Optional[ + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] + ] = None, align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, @@ -382,6 +388,8 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent): Args: *children: Child components. justify: The justification of the column + min_width: The minimum width of the cell + max_width: The maximum width of the cell align: Alignment of the content within the table header cell col_span: Number of columns a header cell should span headers: IDs of the headers associated with this header cell @@ -757,6 +765,12 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent): Var[Literal["center", "end", "start"]], ] ] = None, + min_width: Optional[ + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] + ] = None, + max_width: Optional[ + Union[Breakpoints[str, str], Var[Union[Breakpoints[str, str], str]], str] + ] = None, align: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, col_span: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, headers: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None, @@ -936,6 +950,8 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent): Args: *children: Child components. justify: The justification of the column + min_width: The minimum width of the cell + max_width: The maximum width of the cell align: Alignment of the content within the table header cell col_span: Number of columns a header cell should span headers: IDs of the headers associated with this header cell diff --git a/reflex/components/radix/themes/layout/base.py b/reflex/components/radix/themes/layout/base.py index 17eaf4af32..f31f6a72c8 100644 --- a/reflex/components/radix/themes/layout/base.py +++ b/reflex/components/radix/themes/layout/base.py @@ -7,7 +7,7 @@ from reflex.components.core.breakpoints import Responsive from reflex.vars.base import Var -from ..base import CommonMarginProps, LiteralSpacing, RadixThemesComponent, CommonPaddingProps +from ..base import CommonMarginProps, CommonPaddingProps, RadixThemesComponent LiteralBoolNumber = Literal["0", "1"]