Skip to content

Commit

Permalink
add more props
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo committed Nov 7, 2024
1 parent 6fc625c commit 41b6efd
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion reflex/components/radix/themes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
14 changes: 13 additions & 1 deletion reflex/components/radix/themes/components/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions reflex/components/radix/themes/components/table.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion reflex/components/radix/themes/layout/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit 41b6efd

Please sign in to comment.