Skip to content

Commit 43a0867

Browse files
authored
add time_picker component (#2343)
1 parent 87844c3 commit 43a0867

File tree

6 files changed

+145
-0
lines changed

6 files changed

+145
-0
lines changed

reflex/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
"Tfoot",
217217
"Th",
218218
"Thead",
219+
"TimePicker",
219220
"Tooltip",
220221
"Tr",
221222
"UnorderedList",

reflex/__init__.pyi

+2
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ from reflex.components import TextArea as TextArea
209209
from reflex.components import Tfoot as Tfoot
210210
from reflex.components import Th as Th
211211
from reflex.components import Thead as Thead
212+
from reflex.components import TimePicker as TimePicker
212213
from reflex.components import Tooltip as Tooltip
213214
from reflex.components import Tr as Tr
214215
from reflex.components import UnorderedList as UnorderedList
@@ -420,6 +421,7 @@ from reflex.components import text_area as text_area
420421
from reflex.components import tfoot as tfoot
421422
from reflex.components import th as th
422423
from reflex.components import thead as thead
424+
from reflex.components import time_picker as time_picker
423425
from reflex.components import tooltip as tooltip
424426
from reflex.components import tr as tr
425427
from reflex.components import unordered_list as unordered_list

reflex/components/chakra/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
tfoot = Tfoot.create
197197
th = Th.create
198198
thead = Thead.create
199+
time_picker = TimePicker.create
199200
tooltip = Tooltip.create
200201
tr = Tr.create
201202
unordered_list = UnorderedList.create

reflex/components/chakra/forms/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from .slider import Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack
4646
from .switch import Switch
4747
from .textarea import TextArea
48+
from .time_picker import TimePicker
4849

4950
helpers = [
5051
"color_mode_cond",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"""A time input component."""
2+
3+
from reflex.components.chakra.forms.input import Input
4+
from reflex.vars import Var
5+
6+
7+
class TimePicker(Input):
8+
"""A time input component."""
9+
10+
# The type of input.
11+
type_: Var[str] = "time" # type: ignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
"""Stub file for reflex/components/chakra/forms/time_picker.py"""
2+
# ------------------- DO NOT EDIT ----------------------
3+
# This file was generated by `scripts/pyi_generator.py`!
4+
# ------------------------------------------------------
5+
6+
from typing import Any, Dict, Literal, Optional, Union, overload
7+
from reflex.vars import Var, BaseVar, ComputedVar
8+
from reflex.event import EventChain, EventHandler, EventSpec
9+
from reflex.style import Style
10+
from reflex.components.chakra.forms.input import Input
11+
from reflex.vars import Var
12+
13+
class TimePicker(Input):
14+
@overload
15+
@classmethod
16+
def create( # type: ignore
17+
cls,
18+
*children,
19+
type_: Optional[Union[Var[str], str]] = None,
20+
value: Optional[Union[Var[str], str]] = None,
21+
default_value: Optional[Union[Var[str], str]] = None,
22+
placeholder: Optional[Union[Var[str], str]] = None,
23+
error_border_color: Optional[Union[Var[str], str]] = None,
24+
focus_border_color: Optional[Union[Var[str], str]] = None,
25+
is_disabled: Optional[Union[Var[bool], bool]] = None,
26+
is_invalid: Optional[Union[Var[bool], bool]] = None,
27+
is_read_only: Optional[Union[Var[bool], bool]] = None,
28+
is_required: Optional[Union[Var[bool], bool]] = None,
29+
variant: Optional[
30+
Union[
31+
Var[Literal["outline", "filled", "flushed", "unstyled"]],
32+
Literal["outline", "filled", "flushed", "unstyled"],
33+
]
34+
] = None,
35+
size: Optional[
36+
Union[Var[Literal["sm", "md", "lg", "xs"]], Literal["sm", "md", "lg", "xs"]]
37+
] = None,
38+
name: Optional[Union[Var[str], str]] = None,
39+
style: Optional[Style] = None,
40+
key: Optional[Any] = None,
41+
id: Optional[Any] = None,
42+
class_name: Optional[Any] = None,
43+
autofocus: Optional[bool] = None,
44+
custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
45+
on_blur: Optional[
46+
Union[EventHandler, EventSpec, list, function, BaseVar]
47+
] = None,
48+
on_change: Optional[
49+
Union[EventHandler, EventSpec, list, function, BaseVar]
50+
] = None,
51+
on_click: Optional[
52+
Union[EventHandler, EventSpec, list, function, BaseVar]
53+
] = None,
54+
on_context_menu: Optional[
55+
Union[EventHandler, EventSpec, list, function, BaseVar]
56+
] = None,
57+
on_double_click: Optional[
58+
Union[EventHandler, EventSpec, list, function, BaseVar]
59+
] = None,
60+
on_focus: Optional[
61+
Union[EventHandler, EventSpec, list, function, BaseVar]
62+
] = None,
63+
on_key_down: Optional[
64+
Union[EventHandler, EventSpec, list, function, BaseVar]
65+
] = None,
66+
on_key_up: Optional[
67+
Union[EventHandler, EventSpec, list, function, BaseVar]
68+
] = None,
69+
on_mount: Optional[
70+
Union[EventHandler, EventSpec, list, function, BaseVar]
71+
] = None,
72+
on_mouse_down: Optional[
73+
Union[EventHandler, EventSpec, list, function, BaseVar]
74+
] = None,
75+
on_mouse_enter: Optional[
76+
Union[EventHandler, EventSpec, list, function, BaseVar]
77+
] = None,
78+
on_mouse_leave: Optional[
79+
Union[EventHandler, EventSpec, list, function, BaseVar]
80+
] = None,
81+
on_mouse_move: Optional[
82+
Union[EventHandler, EventSpec, list, function, BaseVar]
83+
] = None,
84+
on_mouse_out: Optional[
85+
Union[EventHandler, EventSpec, list, function, BaseVar]
86+
] = None,
87+
on_mouse_over: Optional[
88+
Union[EventHandler, EventSpec, list, function, BaseVar]
89+
] = None,
90+
on_mouse_up: Optional[
91+
Union[EventHandler, EventSpec, list, function, BaseVar]
92+
] = None,
93+
on_scroll: Optional[
94+
Union[EventHandler, EventSpec, list, function, BaseVar]
95+
] = None,
96+
on_unmount: Optional[
97+
Union[EventHandler, EventSpec, list, function, BaseVar]
98+
] = None,
99+
**props
100+
) -> "TimePicker":
101+
"""Create an Input component.
102+
103+
Args:
104+
*children: The children of the component.
105+
type_: The type of input.
106+
value: State var to bind the input.
107+
default_value: The default value of the input.
108+
placeholder: The placeholder text.
109+
error_border_color: The border color when the input is invalid.
110+
focus_border_color: The border color when the input is focused.
111+
is_disabled: If true, the form control will be disabled. This has 2 side effects - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
112+
is_invalid: If true, the form control will be invalid. This has 2 side effects - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
113+
is_read_only: If true, the form control will be readonly.
114+
is_required: If true, the form control will be required. This has 2 side effects - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
115+
variant: "outline" | "filled" | "flushed" | "unstyled"
116+
size: "lg" | "md" | "sm" | "xs"
117+
name: The name of the form field
118+
style: The style of the component.
119+
key: A unique key for the component.
120+
id: The id for the component.
121+
class_name: The class name for the component.
122+
autofocus: Whether the component should take the focus once the page is loaded
123+
custom_attrs: custom attribute
124+
**props: The properties of the component.
125+
126+
Returns:
127+
The component.
128+
"""
129+
...

0 commit comments

Comments
 (0)