add size prop to the number input (#2311)

This commit is contained in:
dodeca-6-tope 2023-12-20 23:54:20 +02:00 committed by GitHub
parent 5c5d17df59
commit 97f528e7b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -6,6 +6,7 @@ from typing import Any, Dict
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.libs.chakra import ( from reflex.components.libs.chakra import (
ChakraComponent, ChakraComponent,
LiteralButtonSize,
LiteralInputVariant, LiteralInputVariant,
) )
from reflex.constants import EventTriggers from reflex.constants import EventTriggers
@ -68,6 +69,9 @@ class NumberInput(ChakraComponent):
# "outline" | "filled" | "flushed" | "unstyled" # "outline" | "filled" | "flushed" | "unstyled"
variant: Var[LiteralInputVariant] variant: Var[LiteralInputVariant]
# "lg" | "md" | "sm" | "xs"
size: Var[LiteralButtonSize]
# The name of the form field # The name of the form field
name: Var[str] name: Var[str]

View File

@ -10,7 +10,11 @@ from reflex.style import Style
from numbers import Number from numbers import Number
from typing import Any, Dict from typing import Any, Dict
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.libs.chakra import ChakraComponent, LiteralInputVariant from reflex.components.libs.chakra import (
ChakraComponent,
LiteralButtonSize,
LiteralInputVariant,
)
from reflex.constants import EventTriggers from reflex.constants import EventTriggers
from reflex.vars import Var from reflex.vars import Var
@ -42,6 +46,9 @@ class NumberInput(ChakraComponent):
Literal["outline", "filled", "flushed", "unstyled"], Literal["outline", "filled", "flushed", "unstyled"],
] ]
] = None, ] = None,
size: Optional[
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
] = None,
name: Optional[Union[Var[str], str]] = None, name: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None, style: Optional[Style] = None,
key: Optional[Any] = None, key: Optional[Any] = None,
@ -121,6 +128,7 @@ class NumberInput(ChakraComponent):
max_: The maximum value of the counter max_: The maximum value of the counter
min_: The minimum value of the counter min_: The minimum value of the counter
variant: "outline" | "filled" | "flushed" | "unstyled" variant: "outline" | "filled" | "flushed" | "unstyled"
size: "lg" | "md" | "sm" | "xs"
name: The name of the form field name: The name of the form field
style: The style of the component. style: The style of the component.
key: A unique key for the component. key: A unique key for the component.