reflex 0.5.9.dev1__py3-none-any.whl → 0.5.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

Files changed (170) hide show
  1. reflex/.templates/web/utils/client_side_routing.js +6 -1
  2. reflex/__init__.py +21 -2
  3. reflex/__init__.pyi +0 -1
  4. reflex/app.py +1 -1
  5. reflex/components/__init__.py +0 -1
  6. reflex/components/__init__.pyi +0 -1
  7. reflex/components/markdown/markdown.py +1 -1
  8. reflex/components/recharts/cartesian.py +3 -0
  9. reflex/components/recharts/cartesian.pyi +2 -0
  10. reflex/components/sonner/toast.py +27 -1
  11. reflex/components/sonner/toast.pyi +5 -0
  12. reflex/constants/base.py +2 -0
  13. reflex/constants/installer.py +2 -0
  14. reflex/experimental/hooks.py +1 -1
  15. reflex/reflex.py +0 -15
  16. reflex/state.py +22 -22
  17. reflex/testing.py +8 -3
  18. reflex/utils/net.py +43 -0
  19. reflex/utils/prerequisites.py +27 -126
  20. reflex/utils/registry.py +48 -0
  21. reflex/utils/types.py +1 -1
  22. reflex/vars.py +4 -2
  23. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/METADATA +2 -1
  24. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/RECORD +27 -168
  25. reflex/components/chakra/__init__.py +0 -204
  26. reflex/components/chakra/base.py +0 -210
  27. reflex/components/chakra/base.pyi +0 -319
  28. reflex/components/chakra/datadisplay/__init__.py +0 -10
  29. reflex/components/chakra/datadisplay/badge.py +0 -16
  30. reflex/components/chakra/datadisplay/badge.pyi +0 -96
  31. reflex/components/chakra/datadisplay/code.py +0 -11
  32. reflex/components/chakra/datadisplay/code.pyi +0 -87
  33. reflex/components/chakra/datadisplay/divider.py +0 -20
  34. reflex/components/chakra/datadisplay/divider.pyi +0 -100
  35. reflex/components/chakra/datadisplay/keyboard_key.py +0 -9
  36. reflex/components/chakra/datadisplay/keyboard_key.pyi +0 -87
  37. reflex/components/chakra/datadisplay/list.py +0 -60
  38. reflex/components/chakra/datadisplay/list.pyi +0 -339
  39. reflex/components/chakra/datadisplay/stat.py +0 -80
  40. reflex/components/chakra/datadisplay/stat.pyi +0 -477
  41. reflex/components/chakra/datadisplay/table.py +0 -305
  42. reflex/components/chakra/datadisplay/table.pyi +0 -737
  43. reflex/components/chakra/datadisplay/tag.py +0 -85
  44. reflex/components/chakra/datadisplay/tag.pyi +0 -433
  45. reflex/components/chakra/disclosure/__init__.py +0 -14
  46. reflex/components/chakra/disclosure/accordion.py +0 -110
  47. reflex/components/chakra/disclosure/accordion.pyi +0 -411
  48. reflex/components/chakra/disclosure/tabs.py +0 -117
  49. reflex/components/chakra/disclosure/tabs.pyi +0 -496
  50. reflex/components/chakra/disclosure/transition.py +0 -73
  51. reflex/components/chakra/disclosure/transition.pyi +0 -509
  52. reflex/components/chakra/disclosure/visuallyhidden.py +0 -9
  53. reflex/components/chakra/disclosure/visuallyhidden.pyi +0 -87
  54. reflex/components/chakra/feedback/__init__.py +0 -7
  55. reflex/components/chakra/feedback/alert.py +0 -68
  56. reflex/components/chakra/feedback/alert.pyi +0 -335
  57. reflex/components/chakra/feedback/circularprogress.py +0 -68
  58. reflex/components/chakra/feedback/circularprogress.pyi +0 -185
  59. reflex/components/chakra/feedback/progress.py +0 -33
  60. reflex/components/chakra/feedback/progress.pyi +0 -101
  61. reflex/components/chakra/feedback/skeleton.py +0 -70
  62. reflex/components/chakra/feedback/skeleton.pyi +0 -271
  63. reflex/components/chakra/feedback/spinner.py +0 -25
  64. reflex/components/chakra/feedback/spinner.pyi +0 -102
  65. reflex/components/chakra/forms/__init__.py +0 -49
  66. reflex/components/chakra/forms/button.py +0 -83
  67. reflex/components/chakra/forms/button.pyi +0 -262
  68. reflex/components/chakra/forms/checkbox.py +0 -77
  69. reflex/components/chakra/forms/checkbox.pyi +0 -247
  70. reflex/components/chakra/forms/colormodeswitch.py +0 -104
  71. reflex/components/chakra/forms/colormodeswitch.pyi +0 -473
  72. reflex/components/chakra/forms/date_picker.py +0 -11
  73. reflex/components/chakra/forms/date_picker.pyi +0 -129
  74. reflex/components/chakra/forms/date_time_picker.py +0 -11
  75. reflex/components/chakra/forms/date_time_picker.pyi +0 -129
  76. reflex/components/chakra/forms/editable.py +0 -67
  77. reflex/components/chakra/forms/editable.pyi +0 -343
  78. reflex/components/chakra/forms/email.py +0 -11
  79. reflex/components/chakra/forms/email.pyi +0 -129
  80. reflex/components/chakra/forms/form.py +0 -103
  81. reflex/components/chakra/forms/form.pyi +0 -484
  82. reflex/components/chakra/forms/iconbutton.py +0 -38
  83. reflex/components/chakra/forms/iconbutton.pyi +0 -108
  84. reflex/components/chakra/forms/input.py +0 -130
  85. reflex/components/chakra/forms/input.pyi +0 -566
  86. reflex/components/chakra/forms/multiselect.py +0 -355
  87. reflex/components/chakra/forms/numberinput.py +0 -128
  88. reflex/components/chakra/forms/numberinput.pyi +0 -442
  89. reflex/components/chakra/forms/password.py +0 -11
  90. reflex/components/chakra/forms/password.pyi +0 -129
  91. reflex/components/chakra/forms/pininput.py +0 -201
  92. reflex/components/chakra/forms/pininput.pyi +0 -215
  93. reflex/components/chakra/forms/radio.py +0 -101
  94. reflex/components/chakra/forms/radio.pyi +0 -197
  95. reflex/components/chakra/forms/rangeslider.py +0 -149
  96. reflex/components/chakra/forms/rangeslider.pyi +0 -354
  97. reflex/components/chakra/forms/select.py +0 -103
  98. reflex/components/chakra/forms/select.pyi +0 -204
  99. reflex/components/chakra/forms/slider.py +0 -130
  100. reflex/components/chakra/forms/slider.pyi +0 -449
  101. reflex/components/chakra/forms/switch.py +0 -49
  102. reflex/components/chakra/forms/switch.pyi +0 -159
  103. reflex/components/chakra/forms/textarea.py +0 -79
  104. reflex/components/chakra/forms/textarea.pyi +0 -123
  105. reflex/components/chakra/forms/time_picker.py +0 -11
  106. reflex/components/chakra/forms/time_picker.pyi +0 -129
  107. reflex/components/chakra/layout/__init__.py +0 -14
  108. reflex/components/chakra/layout/aspect_ratio.py +0 -13
  109. reflex/components/chakra/layout/aspect_ratio.pyi +0 -89
  110. reflex/components/chakra/layout/box.py +0 -31
  111. reflex/components/chakra/layout/box.pyi +0 -93
  112. reflex/components/chakra/layout/card.py +0 -100
  113. reflex/components/chakra/layout/card.pyi +0 -379
  114. reflex/components/chakra/layout/center.py +0 -21
  115. reflex/components/chakra/layout/center.pyi +0 -239
  116. reflex/components/chakra/layout/container.py +0 -13
  117. reflex/components/chakra/layout/container.pyi +0 -89
  118. reflex/components/chakra/layout/flex.py +0 -33
  119. reflex/components/chakra/layout/flex.pyi +0 -101
  120. reflex/components/chakra/layout/grid.py +0 -125
  121. reflex/components/chakra/layout/grid.pyi +0 -293
  122. reflex/components/chakra/layout/spacer.py +0 -9
  123. reflex/components/chakra/layout/spacer.pyi +0 -87
  124. reflex/components/chakra/layout/stack.py +0 -48
  125. reflex/components/chakra/layout/stack.pyi +0 -305
  126. reflex/components/chakra/layout/wrap.py +0 -57
  127. reflex/components/chakra/layout/wrap.pyi +0 -179
  128. reflex/components/chakra/media/__init__.py +0 -7
  129. reflex/components/chakra/media/avatar.py +0 -58
  130. reflex/components/chakra/media/avatar.pyi +0 -267
  131. reflex/components/chakra/media/icon.py +0 -111
  132. reflex/components/chakra/media/icon.pyi +0 -171
  133. reflex/components/chakra/media/image.py +0 -74
  134. reflex/components/chakra/media/image.pyi +0 -118
  135. reflex/components/chakra/navigation/__init__.py +0 -18
  136. reflex/components/chakra/navigation/breadcrumb.py +0 -98
  137. reflex/components/chakra/navigation/breadcrumb.pyi +0 -351
  138. reflex/components/chakra/navigation/link.py +0 -62
  139. reflex/components/chakra/navigation/link.pyi +0 -105
  140. reflex/components/chakra/navigation/linkoverlay.py +0 -22
  141. reflex/components/chakra/navigation/linkoverlay.pyi +0 -167
  142. reflex/components/chakra/navigation/stepper.py +0 -113
  143. reflex/components/chakra/navigation/stepper.pyi +0 -762
  144. reflex/components/chakra/overlay/__init__.py +0 -50
  145. reflex/components/chakra/overlay/alertdialog.py +0 -153
  146. reflex/components/chakra/overlay/alertdialog.pyi +0 -612
  147. reflex/components/chakra/overlay/drawer.py +0 -168
  148. reflex/components/chakra/overlay/drawer.pyi +0 -652
  149. reflex/components/chakra/overlay/menu.py +0 -225
  150. reflex/components/chakra/overlay/menu.pyi +0 -708
  151. reflex/components/chakra/overlay/modal.py +0 -166
  152. reflex/components/chakra/overlay/modal.pyi +0 -600
  153. reflex/components/chakra/overlay/popover.py +0 -183
  154. reflex/components/chakra/overlay/popover.pyi +0 -757
  155. reflex/components/chakra/overlay/tooltip.py +0 -70
  156. reflex/components/chakra/overlay/tooltip.pyi +0 -129
  157. reflex/components/chakra/typography/__init__.py +0 -10
  158. reflex/components/chakra/typography/heading.py +0 -16
  159. reflex/components/chakra/typography/heading.pyi +0 -96
  160. reflex/components/chakra/typography/highlight.py +0 -23
  161. reflex/components/chakra/typography/highlight.pyi +0 -91
  162. reflex/components/chakra/typography/span.py +0 -15
  163. reflex/components/chakra/typography/span.pyi +0 -89
  164. reflex/components/chakra/typography/text.py +0 -18
  165. reflex/components/chakra/typography/text.pyi +0 -91
  166. reflex/components/media/__init__.py +0 -1
  167. reflex/components/media/icon.py +0 -3
  168. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/LICENSE +0 -0
  169. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/WHEEL +0 -0
  170. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10.dist-info}/entry_points.txt +0 -0
@@ -1,79 +0,0 @@
1
- """A textarea component."""
2
-
3
- from __future__ import annotations
4
-
5
- from reflex.components.chakra import ChakraComponent, LiteralInputVariant
6
- from reflex.components.component import Component
7
- from reflex.components.core.debounce import DebounceInput
8
- from reflex.event import EventHandler
9
- from reflex.vars import Var
10
-
11
-
12
- class TextArea(ChakraComponent):
13
- """A text area component."""
14
-
15
- tag = "Textarea"
16
-
17
- # State var to bind the input.
18
- value: Var[str]
19
-
20
- # The default value of the textarea.
21
- default_value: Var[str]
22
-
23
- # The placeholder text.
24
- placeholder: Var[str]
25
-
26
- # The border color when the input is invalid.
27
- error_border_color: Var[str]
28
-
29
- # The border color when the input is focused.
30
- focus_border_color: Var[str]
31
-
32
- # If true, the form control will be disabled.
33
- is_disabled: Var[bool]
34
-
35
- # If true, the form control will be invalid.
36
- is_invalid: Var[bool]
37
-
38
- # If true, the form control will be read-only.
39
- is_read_only: Var[bool]
40
-
41
- # If true, the form control will be required.
42
- is_required: Var[bool]
43
-
44
- # "outline" | "filled" | "flushed" | "unstyled"
45
- variant: Var[LiteralInputVariant]
46
-
47
- # The name of the form field
48
- name: Var[str]
49
-
50
- # Fired when the value changes.
51
- on_change: EventHandler[lambda e0: [e0.target.value]]
52
-
53
- # Fired when the textarea gets focus.
54
- on_focus: EventHandler[lambda e0: [e0.target.value]]
55
-
56
- # Fired when the textarea loses focus.
57
- on_blur: EventHandler[lambda e0: [e0.target.value]]
58
-
59
- # Fired when a key is pressed down.
60
- on_key_down: EventHandler[lambda e0: [e0.key]]
61
-
62
- # Fired when a key is released.
63
- on_key_up: EventHandler[lambda e0: [e0.key]]
64
-
65
- @classmethod
66
- def create(cls, *children, **props) -> Component:
67
- """Create an Input component.
68
-
69
- Args:
70
- *children: The children of the component.
71
- **props: The properties of the component.
72
-
73
- Returns:
74
- The component.
75
- """
76
- if props.get("value") is not None and props.get("on_change") is not None:
77
- # create a debounced input if the user requests full control to avoid typing jank
78
- return DebounceInput.create(super().create(*children, **props))
79
- return super().create(*children, **props)
@@ -1,123 +0,0 @@
1
- """Stub file for reflex/components/chakra/forms/textarea.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- from typing import Any, Callable, Dict, Literal, Optional, Union, overload
7
-
8
- from reflex.components.chakra import ChakraComponent
9
- from reflex.event import EventHandler, EventSpec
10
- from reflex.style import Style
11
- from reflex.vars import BaseVar, Var
12
-
13
- class TextArea(ChakraComponent):
14
- @overload
15
- @classmethod
16
- def create( # type: ignore
17
- cls,
18
- *children,
19
- value: Optional[Union[Var[str], str]] = None,
20
- default_value: Optional[Union[Var[str], str]] = None,
21
- placeholder: Optional[Union[Var[str], str]] = None,
22
- error_border_color: Optional[Union[Var[str], str]] = None,
23
- focus_border_color: Optional[Union[Var[str], str]] = None,
24
- is_disabled: Optional[Union[Var[bool], bool]] = None,
25
- is_invalid: Optional[Union[Var[bool], bool]] = None,
26
- is_read_only: Optional[Union[Var[bool], bool]] = None,
27
- is_required: Optional[Union[Var[bool], bool]] = None,
28
- variant: Optional[
29
- Union[
30
- Var[Literal["outline", "filled", "flushed", "unstyled"]],
31
- Literal["outline", "filled", "flushed", "unstyled"],
32
- ]
33
- ] = None,
34
- name: Optional[Union[Var[str], str]] = None,
35
- style: Optional[Style] = None,
36
- key: Optional[Any] = None,
37
- id: Optional[Any] = None,
38
- class_name: Optional[Any] = None,
39
- autofocus: Optional[bool] = None,
40
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
41
- on_blur: Optional[
42
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
43
- ] = None,
44
- on_change: Optional[
45
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
46
- ] = None,
47
- on_click: Optional[
48
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
49
- ] = None,
50
- on_context_menu: Optional[
51
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
52
- ] = None,
53
- on_double_click: Optional[
54
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
55
- ] = None,
56
- on_focus: Optional[
57
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
58
- ] = None,
59
- on_key_down: Optional[
60
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
61
- ] = None,
62
- on_key_up: Optional[
63
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
64
- ] = None,
65
- on_mount: Optional[
66
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
67
- ] = None,
68
- on_mouse_down: Optional[
69
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
70
- ] = None,
71
- on_mouse_enter: Optional[
72
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
73
- ] = None,
74
- on_mouse_leave: Optional[
75
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
76
- ] = None,
77
- on_mouse_move: Optional[
78
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
79
- ] = None,
80
- on_mouse_out: Optional[
81
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
82
- ] = None,
83
- on_mouse_over: Optional[
84
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
85
- ] = None,
86
- on_mouse_up: Optional[
87
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
88
- ] = None,
89
- on_scroll: Optional[
90
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
91
- ] = None,
92
- on_unmount: Optional[
93
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
94
- ] = None,
95
- **props,
96
- ) -> "TextArea":
97
- """Create an Input component.
98
-
99
- Args:
100
- *children: The children of the component.
101
- value: State var to bind the input.
102
- default_value: The default value of the textarea.
103
- placeholder: The placeholder text.
104
- error_border_color: The border color when the input is invalid.
105
- focus_border_color: The border color when the input is focused.
106
- is_disabled: If true, the form control will be disabled.
107
- is_invalid: If true, the form control will be invalid.
108
- is_read_only: If true, the form control will be read-only.
109
- is_required: If true, the form control will be required.
110
- variant: "outline" | "filled" | "flushed" | "unstyled"
111
- name: The name of the form field
112
- style: The style of the component.
113
- key: A unique key for the component.
114
- id: The id for the component.
115
- class_name: The class name for the component.
116
- autofocus: Whether the component should take the focus once the page is loaded
117
- custom_attrs: custom attribute
118
- **props: The properties of the component.
119
-
120
- Returns:
121
- The component.
122
- """
123
- ...
@@ -1,11 +0,0 @@
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
@@ -1,129 +0,0 @@
1
- """Stub file for reflex/components/chakra/forms/time_picker.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- from typing import Any, Callable, Dict, Literal, Optional, Union, overload
7
-
8
- from reflex.components.chakra.forms.input import Input
9
- from reflex.event import EventHandler, EventSpec
10
- from reflex.style import Style
11
- from reflex.vars import BaseVar, 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, Callable, BaseVar]
47
- ] = None,
48
- on_change: Optional[
49
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
50
- ] = None,
51
- on_click: Optional[
52
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
53
- ] = None,
54
- on_context_menu: Optional[
55
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
56
- ] = None,
57
- on_double_click: Optional[
58
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
59
- ] = None,
60
- on_focus: Optional[
61
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
62
- ] = None,
63
- on_key_down: Optional[
64
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
65
- ] = None,
66
- on_key_up: Optional[
67
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
68
- ] = None,
69
- on_mount: Optional[
70
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
71
- ] = None,
72
- on_mouse_down: Optional[
73
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
74
- ] = None,
75
- on_mouse_enter: Optional[
76
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
77
- ] = None,
78
- on_mouse_leave: Optional[
79
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
80
- ] = None,
81
- on_mouse_move: Optional[
82
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
83
- ] = None,
84
- on_mouse_out: Optional[
85
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
86
- ] = None,
87
- on_mouse_over: Optional[
88
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
89
- ] = None,
90
- on_mouse_up: Optional[
91
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
92
- ] = None,
93
- on_scroll: Optional[
94
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
95
- ] = None,
96
- on_unmount: Optional[
97
- Union[EventHandler, EventSpec, list, Callable, 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
- ...
@@ -1,14 +0,0 @@
1
- """Convenience functions to define layout components."""
2
-
3
- from .aspect_ratio import AspectRatio
4
- from .box import Box
5
- from .card import Card, CardBody, CardFooter, CardHeader
6
- from .center import Center, Circle, Square
7
- from .container import Container
8
- from .flex import Flex
9
- from .grid import Grid, GridItem, ResponsiveGrid
10
- from .spacer import Spacer
11
- from .stack import Hstack, Stack, Vstack
12
- from .wrap import Wrap, WrapItem
13
-
14
- __all__ = [f for f in dir() if f[0].isupper()] # type: ignore
@@ -1,13 +0,0 @@
1
- """A AspectRatio component."""
2
-
3
- from reflex.components.chakra import ChakraComponent
4
- from reflex.vars import Var
5
-
6
-
7
- class AspectRatio(ChakraComponent):
8
- """AspectRatio component is used to embed responsive videos and maps, etc."""
9
-
10
- tag = "AspectRatio"
11
-
12
- # The aspect ratio of the Box
13
- ratio: Var[float]
@@ -1,89 +0,0 @@
1
- """Stub file for reflex/components/chakra/layout/aspect_ratio.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- from typing import Any, Callable, Dict, Optional, Union, overload
7
-
8
- from reflex.components.chakra import ChakraComponent
9
- from reflex.event import EventHandler, EventSpec
10
- from reflex.style import Style
11
- from reflex.vars import BaseVar, Var
12
-
13
- class AspectRatio(ChakraComponent):
14
- @overload
15
- @classmethod
16
- def create( # type: ignore
17
- cls,
18
- *children,
19
- ratio: Optional[Union[Var[float], float]] = None,
20
- style: Optional[Style] = None,
21
- key: Optional[Any] = None,
22
- id: Optional[Any] = None,
23
- class_name: Optional[Any] = None,
24
- autofocus: Optional[bool] = None,
25
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
26
- on_blur: Optional[
27
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
28
- ] = None,
29
- on_click: Optional[
30
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
31
- ] = None,
32
- on_context_menu: Optional[
33
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
34
- ] = None,
35
- on_double_click: Optional[
36
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
37
- ] = None,
38
- on_focus: Optional[
39
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
40
- ] = None,
41
- on_mount: Optional[
42
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
43
- ] = None,
44
- on_mouse_down: Optional[
45
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
46
- ] = None,
47
- on_mouse_enter: Optional[
48
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
49
- ] = None,
50
- on_mouse_leave: Optional[
51
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
52
- ] = None,
53
- on_mouse_move: Optional[
54
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
55
- ] = None,
56
- on_mouse_out: Optional[
57
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
58
- ] = None,
59
- on_mouse_over: Optional[
60
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
61
- ] = None,
62
- on_mouse_up: Optional[
63
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
64
- ] = None,
65
- on_scroll: Optional[
66
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
67
- ] = None,
68
- on_unmount: Optional[
69
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
70
- ] = None,
71
- **props,
72
- ) -> "AspectRatio":
73
- """Create the component.
74
-
75
- Args:
76
- *children: The children of the component.
77
- ratio: The aspect ratio of the Box
78
- style: The style of the component.
79
- key: A unique key for the component.
80
- id: The id for the component.
81
- class_name: The class name for the component.
82
- autofocus: Whether the component should take the focus once the page is loaded
83
- custom_attrs: custom attribute
84
- **props: The props of the component.
85
-
86
- Returns:
87
- The component.
88
- """
89
- ...
@@ -1,31 +0,0 @@
1
- """A box component that can contain other components."""
2
-
3
- from reflex.components.chakra import ChakraComponent
4
- from reflex.components.tags import Tag
5
- from reflex.vars import Var
6
-
7
-
8
- class Box(ChakraComponent):
9
- """A generic container component that can contain other components."""
10
-
11
- tag = "Box"
12
-
13
- # The type element to render. You can specify an image, video, or any other HTML element such as iframe.
14
- element: Var[str]
15
-
16
- # The source of the content.
17
- src: Var[str]
18
-
19
- # The alt text of the content.
20
- alt: Var[str]
21
-
22
- def _render(self) -> Tag:
23
- return (
24
- super()
25
- ._render()
26
- .add_props(
27
- **{
28
- "as": self.element,
29
- }
30
- )
31
- )
@@ -1,93 +0,0 @@
1
- """Stub file for reflex/components/chakra/layout/box.py"""
2
-
3
- # ------------------- DO NOT EDIT ----------------------
4
- # This file was generated by `reflex/utils/pyi_generator.py`!
5
- # ------------------------------------------------------
6
- from typing import Any, Callable, Dict, Optional, Union, overload
7
-
8
- from reflex.components.chakra import ChakraComponent
9
- from reflex.event import EventHandler, EventSpec
10
- from reflex.style import Style
11
- from reflex.vars import BaseVar, Var
12
-
13
- class Box(ChakraComponent):
14
- @overload
15
- @classmethod
16
- def create( # type: ignore
17
- cls,
18
- *children,
19
- element: Optional[Union[Var[str], str]] = None,
20
- src: Optional[Union[Var[str], str]] = None,
21
- alt: Optional[Union[Var[str], str]] = None,
22
- style: Optional[Style] = None,
23
- key: Optional[Any] = None,
24
- id: Optional[Any] = None,
25
- class_name: Optional[Any] = None,
26
- autofocus: Optional[bool] = None,
27
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
28
- on_blur: Optional[
29
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
30
- ] = None,
31
- on_click: Optional[
32
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
33
- ] = None,
34
- on_context_menu: Optional[
35
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
36
- ] = None,
37
- on_double_click: Optional[
38
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
39
- ] = None,
40
- on_focus: Optional[
41
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
42
- ] = None,
43
- on_mount: Optional[
44
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
45
- ] = None,
46
- on_mouse_down: Optional[
47
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
48
- ] = None,
49
- on_mouse_enter: Optional[
50
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
51
- ] = None,
52
- on_mouse_leave: Optional[
53
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
54
- ] = None,
55
- on_mouse_move: Optional[
56
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
57
- ] = None,
58
- on_mouse_out: Optional[
59
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
60
- ] = None,
61
- on_mouse_over: Optional[
62
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
63
- ] = None,
64
- on_mouse_up: Optional[
65
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
66
- ] = None,
67
- on_scroll: Optional[
68
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
69
- ] = None,
70
- on_unmount: Optional[
71
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
72
- ] = None,
73
- **props,
74
- ) -> "Box":
75
- """Create the component.
76
-
77
- Args:
78
- *children: The children of the component.
79
- element: The type element to render. You can specify an image, video, or any other HTML element such as iframe.
80
- src: The source of the content.
81
- alt: The alt text of the content.
82
- style: The style of the component.
83
- key: A unique key for the component.
84
- id: The id for the component.
85
- class_name: The class name for the component.
86
- autofocus: Whether the component should take the focus once the page is loaded
87
- custom_attrs: custom attribute
88
- **props: The props of the component.
89
-
90
- Returns:
91
- The component.
92
- """
93
- ...
@@ -1,100 +0,0 @@
1
- """Chakra Card component."""
2
-
3
- from typing import Optional
4
-
5
- from reflex.components.chakra import (
6
- ChakraComponent,
7
- LiteralCardVariant,
8
- LiteralColorScheme,
9
- LiteralTagSize,
10
- )
11
- from reflex.components.component import Component
12
- from reflex.vars import Var
13
-
14
-
15
- class CardHeader(ChakraComponent):
16
- """The wrapper that contains a card's header."""
17
-
18
- tag = "CardHeader"
19
-
20
-
21
- class CardBody(ChakraComponent):
22
- """The wrapper that houses the card's main content."""
23
-
24
- tag = "CardBody"
25
-
26
-
27
- class CardFooter(ChakraComponent):
28
- """The footer that houses the card actions."""
29
-
30
- tag = "CardFooter"
31
-
32
-
33
- class Card(ChakraComponent):
34
- """The parent wrapper that provides context for its children."""
35
-
36
- tag = "Card"
37
-
38
- # [required] The flex alignment of the card
39
- align: Var[str]
40
-
41
- # [required] The flex direction of the card
42
- direction: Var[str]
43
-
44
- # [required] The flex distribution of the card
45
- justify: Var[str]
46
-
47
- # The visual color appearance of the component.
48
- # options: "whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" |
49
- # "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" |
50
- # "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"
51
- # default: "gray"
52
- color_scheme: Var[LiteralColorScheme]
53
-
54
- # The size of the Card
55
- # options: "sm" | "md" | "lg"
56
- # default: "md"
57
- size: Var[LiteralTagSize]
58
-
59
- # The variant of the Card
60
- # options: "elevated" | "outline" | "filled" | "unstyled"
61
- # default: "elevated"
62
- variant: Var[LiteralCardVariant]
63
-
64
- @classmethod
65
- def create(
66
- cls,
67
- body: Component,
68
- *,
69
- header: Optional[Component] = None,
70
- footer: Optional[Component] = None,
71
- **props,
72
- ) -> Component:
73
- """Creates a Chakra Card with a body and optionally header and/or footer, and returns it.
74
- If header, body or footer are not already instances of Chead, Cbody or Cfoot respectively,
75
- they will be wrapped as such for layout purposes. If you want to modify their props,
76
- e.g. padding_left, you should wrap them yourself.
77
-
78
- Args:
79
- body (Component): The main content of the Card that will be created.
80
- header (Optional[Component]): The header of the Card.
81
- footer (Optional[Component]): The footer of the Card.
82
- props: The properties to be passed to the component.
83
-
84
- Returns:
85
- The `create()` method returns a Card object.
86
- """
87
- children = []
88
- param_to_component_class = (
89
- (header, CardHeader),
90
- (body, CardBody),
91
- (footer, CardFooter),
92
- )
93
-
94
- for param, component_class in param_to_component_class:
95
- if isinstance(param, component_class):
96
- children.append(param)
97
- elif param is not None:
98
- children.append(component_class.create(param))
99
-
100
- return super().create(*children, **props)