From 97f528e7b560c86c31dd23427d1f857d68041614 Mon Sep 17 00:00:00 2001 From: dodeca-6-tope <21145501+dodeca-6-tope@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:54:20 +0200 Subject: [PATCH] add size prop to the number input (#2311) --- reflex/components/forms/numberinput.py | 4 ++++ reflex/components/forms/numberinput.pyi | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/reflex/components/forms/numberinput.py b/reflex/components/forms/numberinput.py index 2fe90ad96..1dd58d192 100644 --- a/reflex/components/forms/numberinput.py +++ b/reflex/components/forms/numberinput.py @@ -6,6 +6,7 @@ from typing import Any, Dict from reflex.components.component import Component from reflex.components.libs.chakra import ( ChakraComponent, + LiteralButtonSize, LiteralInputVariant, ) from reflex.constants import EventTriggers @@ -68,6 +69,9 @@ class NumberInput(ChakraComponent): # "outline" | "filled" | "flushed" | "unstyled" variant: Var[LiteralInputVariant] + # "lg" | "md" | "sm" | "xs" + size: Var[LiteralButtonSize] + # The name of the form field name: Var[str] diff --git a/reflex/components/forms/numberinput.pyi b/reflex/components/forms/numberinput.pyi index 4f099992b..1fe3eb8af 100644 --- a/reflex/components/forms/numberinput.pyi +++ b/reflex/components/forms/numberinput.pyi @@ -10,7 +10,11 @@ from reflex.style import Style from numbers import Number from typing import Any, Dict 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.vars import Var @@ -42,6 +46,9 @@ class NumberInput(ChakraComponent): Literal["outline", "filled", "flushed", "unstyled"], ] ] = None, + size: Optional[ + Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]] + ] = None, name: Optional[Union[Var[str], str]] = None, style: Optional[Style] = None, key: Optional[Any] = None, @@ -121,6 +128,7 @@ class NumberInput(ChakraComponent): max_: The maximum value of the counter min_: The minimum value of the counter variant: "outline" | "filled" | "flushed" | "unstyled" + size: "lg" | "md" | "sm" | "xs" name: The name of the form field style: The style of the component. key: A unique key for the component.