From 37eeea11002945dc5f54d4a42c441375d1280497 Mon Sep 17 00:00:00 2001 From: Martin Xu <15661672+martinxu9@users.noreply.github.com> Date: Thu, 15 Feb 2024 11:54:38 -0800 Subject: [PATCH] Spacing literal should include "0" (#2622) * spacing literal should include "0" * rename to LiteralSpacing * pyi --- reflex/components/radix/themes/base.py | 16 +- reflex/components/radix/themes/base.pyi | 30 +-- .../radix/themes/components/avatar.py | 4 +- .../radix/themes/components/avatar.pyi | 4 +- .../radix/themes/components/checkbox.py | 5 +- .../radix/themes/components/checkbox.pyi | 10 +- .../radix/themes/components/radio_group.py | 5 +- .../radix/themes/components/radio_group.pyi | 10 +- .../radix/themes/components/radiogroup.pyi | 3 +- reflex/components/radix/themes/layout/base.py | 17 +- .../components/radix/themes/layout/base.pyi | 58 +++--- .../components/radix/themes/layout/center.py | 1 + .../components/radix/themes/layout/center.pyi | 4 +- reflex/components/radix/themes/layout/flex.py | 5 +- .../components/radix/themes/layout/flex.pyi | 6 +- reflex/components/radix/themes/layout/grid.py | 9 +- .../components/radix/themes/layout/grid.pyi | 14 +- reflex/components/radix/themes/layout/list.py | 4 - .../components/radix/themes/layout/list.pyi | 180 +++++++++--------- .../components/radix/themes/layout/spacer.py | 1 + .../components/radix/themes/layout/spacer.pyi | 4 +- .../components/radix/themes/layout/stack.py | 5 +- .../components/radix/themes/layout/stack.pyi | 8 +- 23 files changed, 206 insertions(+), 197 deletions(-) diff --git a/reflex/components/radix/themes/base.py b/reflex/components/radix/themes/base.py index a923e499c..be7657ad4 100644 --- a/reflex/components/radix/themes/base.py +++ b/reflex/components/radix/themes/base.py @@ -11,7 +11,7 @@ from reflex.vars import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] -LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] +LiteralSpacing = Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] LiteralVariant = Literal["classic", "solid", "soft", "surface", "outline", "ghost"] LiteralAppearance = Literal["inherit", "light", "dark"] LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] @@ -52,25 +52,25 @@ class CommonMarginProps(Component): """Many radix-themes elements accept shorthand margin props.""" # Margin: "0" - "9" - m: Var[LiteralSize] + m: Var[LiteralSpacing] # Margin horizontal: "0" - "9" - mx: Var[LiteralSize] + mx: Var[LiteralSpacing] # Margin vertical: "0" - "9" - my: Var[LiteralSize] + my: Var[LiteralSpacing] # Margin top: "0" - "9" - mt: Var[LiteralSize] + mt: Var[LiteralSpacing] # Margin right: "0" - "9" - mr: Var[LiteralSize] + mr: Var[LiteralSpacing] # Margin bottom: "0" - "9" - mb: Var[LiteralSize] + mb: Var[LiteralSpacing] # Margin left: "0" - "9" - ml: Var[LiteralSize] + ml: Var[LiteralSpacing] class RadixThemesComponent(Component): diff --git a/reflex/components/radix/themes/base.pyi b/reflex/components/radix/themes/base.pyi index c24fbd39e..0ae5812e5 100644 --- a/reflex/components/radix/themes/base.pyi +++ b/reflex/components/radix/themes/base.pyi @@ -15,7 +15,7 @@ from reflex.vars import Var LiteralAlign = Literal["start", "center", "end", "baseline", "stretch"] LiteralJustify = Literal["start", "center", "end", "between"] -LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] +LiteralSpacing = Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] LiteralVariant = Literal["classic", "solid", "soft", "surface", "outline", "ghost"] LiteralAppearance = Literal["inherit", "light", "dark"] LiteralGrayColor = Literal["gray", "mauve", "slate", "sage", "olive", "sand", "auto"] @@ -59,44 +59,44 @@ class CommonMarginProps(Component): *children, m: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, diff --git a/reflex/components/radix/themes/components/avatar.py b/reflex/components/radix/themes/components/avatar.py index 2029c7ef1..0b64831c3 100644 --- a/reflex/components/radix/themes/components/avatar.py +++ b/reflex/components/radix/themes/components/avatar.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" + from typing import Literal from reflex.vars import Var @@ -6,10 +7,11 @@ from reflex.vars import Var from ..base import ( LiteralAccentColor, LiteralRadius, - LiteralSize, RadixThemesComponent, ) +LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] + class Avatar(RadixThemesComponent): """An image element with a fallback for representing the user.""" diff --git a/reflex/components/radix/themes/components/avatar.pyi b/reflex/components/radix/themes/components/avatar.pyi index 508d5b3ff..8a61a64a2 100644 --- a/reflex/components/radix/themes/components/avatar.pyi +++ b/reflex/components/radix/themes/components/avatar.pyi @@ -9,7 +9,9 @@ from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style from typing import Literal from reflex.vars import Var -from ..base import LiteralAccentColor, LiteralRadius, LiteralSize, RadixThemesComponent +from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent + +LiteralSize = Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] class Avatar(RadixThemesComponent): @overload diff --git a/reflex/components/radix/themes/components/checkbox.py b/reflex/components/radix/themes/components/checkbox.py index 9d1682f68..2303b8667 100644 --- a/reflex/components/radix/themes/components/checkbox.py +++ b/reflex/components/radix/themes/components/checkbox.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" + from types import SimpleNamespace from typing import Any, Dict, Literal @@ -10,7 +11,7 @@ from reflex.vars import Var from ..base import ( LiteralAccentColor, - LiteralSize, + LiteralSpacing, RadixThemesComponent, ) @@ -80,7 +81,7 @@ class HighLevelCheckbox(RadixThemesComponent): text: Var[str] # The gap between the checkbox and the label. - spacing: Var[LiteralSize] + spacing: Var[LiteralSpacing] # The size of the checkbox "1" - "3". size: Var[LiteralCheckboxSize] diff --git a/reflex/components/radix/themes/components/checkbox.pyi b/reflex/components/radix/themes/components/checkbox.pyi index 4ac7e070e..2cce04e90 100644 --- a/reflex/components/radix/themes/components/checkbox.pyi +++ b/reflex/components/radix/themes/components/checkbox.pyi @@ -14,7 +14,7 @@ from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text from reflex.constants import EventTriggers from reflex.vars import Var -from ..base import LiteralAccentColor, LiteralSize, RadixThemesComponent +from ..base import LiteralAccentColor, LiteralSpacing, RadixThemesComponent LiteralCheckboxSize = Literal["1", "2", "3"] LiteralCheckboxVariant = Literal["classic", "surface", "soft"] @@ -202,8 +202,8 @@ class HighLevelCheckbox(RadixThemesComponent): text: Optional[Union[Var[str], str]] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, size: Optional[ @@ -378,8 +378,8 @@ class CheckboxNamespace(SimpleNamespace): text: Optional[Union[Var[str], str]] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, size: Optional[ diff --git a/reflex/components/radix/themes/components/radio_group.py b/reflex/components/radix/themes/components/radio_group.py index 986d7271f..61d700ec9 100644 --- a/reflex/components/radix/themes/components/radio_group.py +++ b/reflex/components/radix/themes/components/radio_group.py @@ -1,4 +1,5 @@ """Interactive components provided by @radix-ui/themes.""" + from types import SimpleNamespace from typing import Any, Dict, List, Literal, Optional, Union @@ -11,7 +12,7 @@ from reflex.vars import Var from ..base import ( LiteralAccentColor, - LiteralSize, + LiteralSpacing, RadixThemesComponent, ) @@ -90,7 +91,7 @@ class HighLevelRadioGroup(RadixThemesComponent): direction: Var[LiteralFlexDirection] = Var.create_safe("column") # The gap between the items of the radio group. - spacing: Var[LiteralSize] = Var.create_safe("2") + spacing: Var[LiteralSpacing] = Var.create_safe("2") # The size of the radio group. size: Var[Literal["1", "2", "3"]] = Var.create_safe("2") diff --git a/reflex/components/radix/themes/components/radio_group.pyi b/reflex/components/radix/themes/components/radio_group.pyi index aff3fe9ed..782c8ca8c 100644 --- a/reflex/components/radix/themes/components/radio_group.pyi +++ b/reflex/components/radix/themes/components/radio_group.pyi @@ -15,7 +15,7 @@ from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text from reflex.constants import EventTriggers from reflex.vars import Var -from ..base import LiteralAccentColor, LiteralSize, RadixThemesComponent +from ..base import LiteralAccentColor, LiteralSpacing, RadixThemesComponent LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] @@ -288,8 +288,8 @@ class HighLevelRadioGroup(RadixThemesComponent): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, size: Optional[ @@ -467,8 +467,8 @@ class RadioGroup(SimpleNamespace): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, size: Optional[ diff --git a/reflex/components/radix/themes/components/radiogroup.pyi b/reflex/components/radix/themes/components/radiogroup.pyi index 1ea3e3bfa..6540428fc 100644 --- a/reflex/components/radix/themes/components/radiogroup.pyi +++ b/reflex/components/radix/themes/components/radiogroup.pyi @@ -1,4 +1,5 @@ """Stub file for reflex/components/radix/themes/components/radiogroup.py""" + # ------------------- DO NOT EDIT ---------------------- # This file was generated by `scripts/pyi_generator.py`! # ------------------------------------------------------ @@ -15,7 +16,7 @@ from reflex.components.radix.themes.layout.flex import Flex from reflex.components.radix.themes.typography.text import Text from reflex.constants import EventTriggers from reflex.vars import Var -from ..base import LiteralAccentColor, LiteralSize, RadixThemesComponent +from ..base import LiteralAccentColor, LiteralSpacing, RadixThemesComponent LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] diff --git a/reflex/components/radix/themes/layout/base.py b/reflex/components/radix/themes/layout/base.py index cd02a5465..f18ed34a8 100644 --- a/reflex/components/radix/themes/layout/base.py +++ b/reflex/components/radix/themes/layout/base.py @@ -1,4 +1,5 @@ """Declarative layout and common spacing props.""" + from __future__ import annotations from typing import Literal @@ -7,7 +8,7 @@ from reflex.vars import Var from ..base import ( CommonMarginProps, - LiteralSize, + LiteralSpacing, RadixThemesComponent, ) @@ -21,25 +22,25 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): """ # Padding: "0" - "9" - p: Var[LiteralSize] + p: Var[LiteralSpacing] # Padding horizontal: "0" - "9" - px: Var[LiteralSize] + px: Var[LiteralSpacing] # Padding vertical: "0" - "9" - py: Var[LiteralSize] + py: Var[LiteralSpacing] # Padding top: "0" - "9" - pt: Var[LiteralSize] + pt: Var[LiteralSpacing] # Padding right: "0" - "9" - pr: Var[LiteralSize] + pr: Var[LiteralSpacing] # Padding bottom: "0" - "9" - pb: Var[LiteralSize] + pb: Var[LiteralSpacing] # Padding left: "0" - "9" - pl: Var[LiteralSize] + pl: Var[LiteralSpacing] # Whether the element will take up the smallest possible space: "0" | "1" shrink: Var[LiteralBoolNumber] diff --git a/reflex/components/radix/themes/layout/base.pyi b/reflex/components/radix/themes/layout/base.pyi index aa88429e2..11f1d1412 100644 --- a/reflex/components/radix/themes/layout/base.pyi +++ b/reflex/components/radix/themes/layout/base.pyi @@ -9,7 +9,7 @@ from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style from typing import Literal from reflex.vars import Var -from ..base import CommonMarginProps, LiteralSize, RadixThemesComponent +from ..base import CommonMarginProps, LiteralSpacing, RadixThemesComponent LiteralBoolNumber = Literal["0", "1"] @@ -21,88 +21,88 @@ class LayoutComponent(CommonMarginProps, RadixThemesComponent): *children, p: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, px: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, py: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pl: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, m: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, diff --git a/reflex/components/radix/themes/layout/center.py b/reflex/components/radix/themes/layout/center.py index 1d3502980..b6a8faa8e 100644 --- a/reflex/components/radix/themes/layout/center.py +++ b/reflex/components/radix/themes/layout/center.py @@ -1,4 +1,5 @@ """A center component.""" + from __future__ import annotations from reflex.components.component import Component diff --git a/reflex/components/radix/themes/layout/center.pyi b/reflex/components/radix/themes/layout/center.pyi index 402e4c08f..726a66f0a 100644 --- a/reflex/components/radix/themes/layout/center.pyi +++ b/reflex/components/radix/themes/layout/center.pyi @@ -43,8 +43,8 @@ class Center(Flex): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ diff --git a/reflex/components/radix/themes/layout/flex.py b/reflex/components/radix/themes/layout/flex.py index 295df7832..ef7aed16c 100644 --- a/reflex/components/radix/themes/layout/flex.py +++ b/reflex/components/radix/themes/layout/flex.py @@ -1,4 +1,5 @@ """Declarative layout and common spacing props.""" + from __future__ import annotations from typing import Dict, Literal @@ -9,7 +10,7 @@ from reflex.vars import Var from ..base import ( LiteralAlign, LiteralJustify, - LiteralSize, + LiteralSpacing, RadixThemesComponent, ) @@ -38,7 +39,7 @@ class Flex(el.Div, RadixThemesComponent): wrap: Var[LiteralFlexWrap] # Gap between children: "0" - "9" - spacing: Var[LiteralSize] + spacing: Var[LiteralSpacing] # Reflex maps the "spacing" prop to "gap" prop. _rename_props: Dict[str, str] = {"spacing": "gap"} diff --git a/reflex/components/radix/themes/layout/flex.pyi b/reflex/components/radix/themes/layout/flex.pyi index e50fabae6..fe8c6d6b2 100644 --- a/reflex/components/radix/themes/layout/flex.pyi +++ b/reflex/components/radix/themes/layout/flex.pyi @@ -10,7 +10,7 @@ from reflex.style import Style from typing import Dict, Literal from reflex import el from reflex.vars import Var -from ..base import LiteralAlign, LiteralJustify, LiteralSize, RadixThemesComponent +from ..base import LiteralAlign, LiteralJustify, LiteralSpacing, RadixThemesComponent LiteralFlexDirection = Literal["row", "column", "row-reverse", "column-reverse"] LiteralFlexWrap = Literal["nowrap", "wrap", "wrap-reverse"] @@ -48,8 +48,8 @@ class Flex(el.Div, RadixThemesComponent): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ diff --git a/reflex/components/radix/themes/layout/grid.py b/reflex/components/radix/themes/layout/grid.py index 90665b911..565703643 100644 --- a/reflex/components/radix/themes/layout/grid.py +++ b/reflex/components/radix/themes/layout/grid.py @@ -1,4 +1,5 @@ """Declarative layout and common spacing props.""" + from __future__ import annotations from typing import Dict, Literal @@ -9,7 +10,7 @@ from reflex.vars import Var from ..base import ( LiteralAlign, LiteralJustify, - LiteralSize, + LiteralSpacing, RadixThemesComponent, ) @@ -40,13 +41,13 @@ class Grid(el.Div, RadixThemesComponent): justify: Var[LiteralJustify] # Gap between children: "0" - "9" - spacing: Var[LiteralSize] + spacing: Var[LiteralSpacing] # Gap between children horizontal: "0" - "9" - spacing_x: Var[LiteralSize] + spacing_x: Var[LiteralSpacing] # Gap between children vertical: "0" - "9" - spacing_y: Var[LiteralSize] + spacing_y: Var[LiteralSpacing] # Reflex maps the "spacing" prop to "gap" prop. _rename_props: Dict[str, str] = { diff --git a/reflex/components/radix/themes/layout/grid.pyi b/reflex/components/radix/themes/layout/grid.pyi index 3171bcbe4..e6107f7de 100644 --- a/reflex/components/radix/themes/layout/grid.pyi +++ b/reflex/components/radix/themes/layout/grid.pyi @@ -10,7 +10,7 @@ from reflex.style import Style from typing import Dict, Literal from reflex import el from reflex.vars import Var -from ..base import LiteralAlign, LiteralJustify, LiteralSize, RadixThemesComponent +from ..base import LiteralAlign, LiteralJustify, LiteralSpacing, RadixThemesComponent LiteralGridFlow = Literal["row", "column", "dense", "row-dense", "column-dense"] @@ -43,20 +43,20 @@ class Grid(el.Div, RadixThemesComponent): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, spacing_x: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, spacing_y: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ diff --git a/reflex/components/radix/themes/layout/list.py b/reflex/components/radix/themes/layout/list.py index 69c95acbe..0de3b7dcc 100644 --- a/reflex/components/radix/themes/layout/list.py +++ b/reflex/components/radix/themes/layout/list.py @@ -12,10 +12,6 @@ from reflex.vars import Var from .base import LayoutComponent from .flex import Flex -# from reflex.vars import Var - -# from reflex.components.radix.themes.layout import LayoutComponent - LiteralListStyleTypeUnordered = Literal[ "none", "disc", diff --git a/reflex/components/radix/themes/layout/list.pyi b/reflex/components/radix/themes/layout/list.pyi index 878cdc9ea..f28c6223b 100644 --- a/reflex/components/radix/themes/layout/list.pyi +++ b/reflex/components/radix/themes/layout/list.pyi @@ -70,8 +70,8 @@ class BaseList(Flex, LayoutComponent): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ @@ -116,88 +116,88 @@ class BaseList(Flex, LayoutComponent): ] = None, p: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, px: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, py: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pl: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, m: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -345,8 +345,8 @@ class UnorderedList(BaseList): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ @@ -391,88 +391,88 @@ class UnorderedList(BaseList): ] = None, p: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, px: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, py: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pl: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, m: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, @@ -637,8 +637,8 @@ class OrderedList(BaseList): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ @@ -683,88 +683,88 @@ class OrderedList(BaseList): ] = None, p: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, px: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, py: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, pl: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, shrink: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, grow: Optional[Union[Var[Literal["0", "1"]], Literal["0", "1"]]] = None, m: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mx: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, my: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mt: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mr: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, mb: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, ml: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, style: Optional[Style] = None, diff --git a/reflex/components/radix/themes/layout/spacer.py b/reflex/components/radix/themes/layout/spacer.py index ea7a7307d..33a790216 100644 --- a/reflex/components/radix/themes/layout/spacer.py +++ b/reflex/components/radix/themes/layout/spacer.py @@ -1,4 +1,5 @@ """A spacer component.""" + from __future__ import annotations from reflex.components.component import Component diff --git a/reflex/components/radix/themes/layout/spacer.pyi b/reflex/components/radix/themes/layout/spacer.pyi index df662edae..7d0a49d61 100644 --- a/reflex/components/radix/themes/layout/spacer.pyi +++ b/reflex/components/radix/themes/layout/spacer.pyi @@ -43,8 +43,8 @@ class Spacer(Flex): ] = None, spacing: Optional[ Union[ - Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], - Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], + Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], + Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ] ] = None, access_key: Optional[ diff --git a/reflex/components/radix/themes/layout/stack.py b/reflex/components/radix/themes/layout/stack.py index 2718f038b..d9bbb4f45 100644 --- a/reflex/components/radix/themes/layout/stack.py +++ b/reflex/components/radix/themes/layout/stack.py @@ -1,11 +1,12 @@ """Stack components.""" + from __future__ import annotations from typing import Literal from reflex.components.component import Component -from ..base import LiteralSize +from ..base import LiteralSpacing from .flex import Flex LiteralJustify = Literal["start", "center", "end"] @@ -19,7 +20,7 @@ class Stack(Flex): def create( cls, *children, - spacing: LiteralSize = "2", + spacing: LiteralSpacing = "2", **props, ) -> Component: """Create a new instance of the component. diff --git a/reflex/components/radix/themes/layout/stack.pyi b/reflex/components/radix/themes/layout/stack.pyi index eb4523ad8..5873f24f5 100644 --- a/reflex/components/radix/themes/layout/stack.pyi +++ b/reflex/components/radix/themes/layout/stack.pyi @@ -9,7 +9,7 @@ from reflex.event import EventChain, EventHandler, EventSpec from reflex.style import Style from typing import Literal from reflex.components.component import Component -from ..base import LiteralSize +from ..base import LiteralSpacing from .flex import Flex LiteralJustify = Literal["start", "center", "end"] @@ -21,7 +21,7 @@ class Stack(Flex): def create( # type: ignore cls, *children, - spacing: Optional[LiteralSize] = "2", + spacing: Optional[LiteralSpacing] = "2", as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ @@ -185,7 +185,7 @@ class VStack(Stack): def create( # type: ignore cls, *children, - spacing: Optional[LiteralSize] = "2", + spacing: Optional[LiteralSpacing] = "2", as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[ @@ -349,7 +349,7 @@ class HStack(Stack): def create( # type: ignore cls, *children, - spacing: Optional[LiteralSize] = "2", + spacing: Optional[LiteralSpacing] = "2", as_child: Optional[Union[Var[bool], bool]] = None, direction: Optional[ Union[