From 41b6efd23d3b58db3ff0eb44459594e136480690 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 7 Nov 2024 15:31:17 +0000 Subject: [PATCH] add more props --- reflex/components/radix/themes/base.py | 2 +- .../components/radix/themes/components/table.py | 14 +++++++++++++- .../components/radix/themes/components/table.pyi | 16 ++++++++++++++++ reflex/components/radix/themes/layout/base.py | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index 2e5cf1822..7a0fc809f 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -5,11 +5,11 @@ from __future__ import annotations 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 d130e161a..a16002f58 100644 --- a/reflex/components/radix/themes/components/table.py +++ b/reflex/components/radix/themes/components/table.py @@ -7,7 +7,7 @@ from reflex.components.core.breakpoints import Responsive 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 ca9827a70..42f5e074a 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 17eaf4af3..f31f6a72c 100644 --- a/reflex/components/radix/themes/layout/base.py +++ b/reflex/components/radix/themes/layout/base.py @@ -7,7 +7,7 @@ from typing import Literal 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"]