reflex 0.5.9.dev1__py3-none-any.whl → 0.5.10a1__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 (169) 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/prerequisites.py +16 -115
  19. reflex/utils/registry.py +48 -0
  20. reflex/utils/types.py +1 -1
  21. reflex/vars.py +4 -2
  22. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10a1.dist-info}/METADATA +2 -1
  23. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10a1.dist-info}/RECORD +26 -168
  24. reflex/components/chakra/__init__.py +0 -204
  25. reflex/components/chakra/base.py +0 -210
  26. reflex/components/chakra/base.pyi +0 -319
  27. reflex/components/chakra/datadisplay/__init__.py +0 -10
  28. reflex/components/chakra/datadisplay/badge.py +0 -16
  29. reflex/components/chakra/datadisplay/badge.pyi +0 -96
  30. reflex/components/chakra/datadisplay/code.py +0 -11
  31. reflex/components/chakra/datadisplay/code.pyi +0 -87
  32. reflex/components/chakra/datadisplay/divider.py +0 -20
  33. reflex/components/chakra/datadisplay/divider.pyi +0 -100
  34. reflex/components/chakra/datadisplay/keyboard_key.py +0 -9
  35. reflex/components/chakra/datadisplay/keyboard_key.pyi +0 -87
  36. reflex/components/chakra/datadisplay/list.py +0 -60
  37. reflex/components/chakra/datadisplay/list.pyi +0 -339
  38. reflex/components/chakra/datadisplay/stat.py +0 -80
  39. reflex/components/chakra/datadisplay/stat.pyi +0 -477
  40. reflex/components/chakra/datadisplay/table.py +0 -305
  41. reflex/components/chakra/datadisplay/table.pyi +0 -737
  42. reflex/components/chakra/datadisplay/tag.py +0 -85
  43. reflex/components/chakra/datadisplay/tag.pyi +0 -433
  44. reflex/components/chakra/disclosure/__init__.py +0 -14
  45. reflex/components/chakra/disclosure/accordion.py +0 -110
  46. reflex/components/chakra/disclosure/accordion.pyi +0 -411
  47. reflex/components/chakra/disclosure/tabs.py +0 -117
  48. reflex/components/chakra/disclosure/tabs.pyi +0 -496
  49. reflex/components/chakra/disclosure/transition.py +0 -73
  50. reflex/components/chakra/disclosure/transition.pyi +0 -509
  51. reflex/components/chakra/disclosure/visuallyhidden.py +0 -9
  52. reflex/components/chakra/disclosure/visuallyhidden.pyi +0 -87
  53. reflex/components/chakra/feedback/__init__.py +0 -7
  54. reflex/components/chakra/feedback/alert.py +0 -68
  55. reflex/components/chakra/feedback/alert.pyi +0 -335
  56. reflex/components/chakra/feedback/circularprogress.py +0 -68
  57. reflex/components/chakra/feedback/circularprogress.pyi +0 -185
  58. reflex/components/chakra/feedback/progress.py +0 -33
  59. reflex/components/chakra/feedback/progress.pyi +0 -101
  60. reflex/components/chakra/feedback/skeleton.py +0 -70
  61. reflex/components/chakra/feedback/skeleton.pyi +0 -271
  62. reflex/components/chakra/feedback/spinner.py +0 -25
  63. reflex/components/chakra/feedback/spinner.pyi +0 -102
  64. reflex/components/chakra/forms/__init__.py +0 -49
  65. reflex/components/chakra/forms/button.py +0 -83
  66. reflex/components/chakra/forms/button.pyi +0 -262
  67. reflex/components/chakra/forms/checkbox.py +0 -77
  68. reflex/components/chakra/forms/checkbox.pyi +0 -247
  69. reflex/components/chakra/forms/colormodeswitch.py +0 -104
  70. reflex/components/chakra/forms/colormodeswitch.pyi +0 -473
  71. reflex/components/chakra/forms/date_picker.py +0 -11
  72. reflex/components/chakra/forms/date_picker.pyi +0 -129
  73. reflex/components/chakra/forms/date_time_picker.py +0 -11
  74. reflex/components/chakra/forms/date_time_picker.pyi +0 -129
  75. reflex/components/chakra/forms/editable.py +0 -67
  76. reflex/components/chakra/forms/editable.pyi +0 -343
  77. reflex/components/chakra/forms/email.py +0 -11
  78. reflex/components/chakra/forms/email.pyi +0 -129
  79. reflex/components/chakra/forms/form.py +0 -103
  80. reflex/components/chakra/forms/form.pyi +0 -484
  81. reflex/components/chakra/forms/iconbutton.py +0 -38
  82. reflex/components/chakra/forms/iconbutton.pyi +0 -108
  83. reflex/components/chakra/forms/input.py +0 -130
  84. reflex/components/chakra/forms/input.pyi +0 -566
  85. reflex/components/chakra/forms/multiselect.py +0 -355
  86. reflex/components/chakra/forms/numberinput.py +0 -128
  87. reflex/components/chakra/forms/numberinput.pyi +0 -442
  88. reflex/components/chakra/forms/password.py +0 -11
  89. reflex/components/chakra/forms/password.pyi +0 -129
  90. reflex/components/chakra/forms/pininput.py +0 -201
  91. reflex/components/chakra/forms/pininput.pyi +0 -215
  92. reflex/components/chakra/forms/radio.py +0 -101
  93. reflex/components/chakra/forms/radio.pyi +0 -197
  94. reflex/components/chakra/forms/rangeslider.py +0 -149
  95. reflex/components/chakra/forms/rangeslider.pyi +0 -354
  96. reflex/components/chakra/forms/select.py +0 -103
  97. reflex/components/chakra/forms/select.pyi +0 -204
  98. reflex/components/chakra/forms/slider.py +0 -130
  99. reflex/components/chakra/forms/slider.pyi +0 -449
  100. reflex/components/chakra/forms/switch.py +0 -49
  101. reflex/components/chakra/forms/switch.pyi +0 -159
  102. reflex/components/chakra/forms/textarea.py +0 -79
  103. reflex/components/chakra/forms/textarea.pyi +0 -123
  104. reflex/components/chakra/forms/time_picker.py +0 -11
  105. reflex/components/chakra/forms/time_picker.pyi +0 -129
  106. reflex/components/chakra/layout/__init__.py +0 -14
  107. reflex/components/chakra/layout/aspect_ratio.py +0 -13
  108. reflex/components/chakra/layout/aspect_ratio.pyi +0 -89
  109. reflex/components/chakra/layout/box.py +0 -31
  110. reflex/components/chakra/layout/box.pyi +0 -93
  111. reflex/components/chakra/layout/card.py +0 -100
  112. reflex/components/chakra/layout/card.pyi +0 -379
  113. reflex/components/chakra/layout/center.py +0 -21
  114. reflex/components/chakra/layout/center.pyi +0 -239
  115. reflex/components/chakra/layout/container.py +0 -13
  116. reflex/components/chakra/layout/container.pyi +0 -89
  117. reflex/components/chakra/layout/flex.py +0 -33
  118. reflex/components/chakra/layout/flex.pyi +0 -101
  119. reflex/components/chakra/layout/grid.py +0 -125
  120. reflex/components/chakra/layout/grid.pyi +0 -293
  121. reflex/components/chakra/layout/spacer.py +0 -9
  122. reflex/components/chakra/layout/spacer.pyi +0 -87
  123. reflex/components/chakra/layout/stack.py +0 -48
  124. reflex/components/chakra/layout/stack.pyi +0 -305
  125. reflex/components/chakra/layout/wrap.py +0 -57
  126. reflex/components/chakra/layout/wrap.pyi +0 -179
  127. reflex/components/chakra/media/__init__.py +0 -7
  128. reflex/components/chakra/media/avatar.py +0 -58
  129. reflex/components/chakra/media/avatar.pyi +0 -267
  130. reflex/components/chakra/media/icon.py +0 -111
  131. reflex/components/chakra/media/icon.pyi +0 -171
  132. reflex/components/chakra/media/image.py +0 -74
  133. reflex/components/chakra/media/image.pyi +0 -118
  134. reflex/components/chakra/navigation/__init__.py +0 -18
  135. reflex/components/chakra/navigation/breadcrumb.py +0 -98
  136. reflex/components/chakra/navigation/breadcrumb.pyi +0 -351
  137. reflex/components/chakra/navigation/link.py +0 -62
  138. reflex/components/chakra/navigation/link.pyi +0 -105
  139. reflex/components/chakra/navigation/linkoverlay.py +0 -22
  140. reflex/components/chakra/navigation/linkoverlay.pyi +0 -167
  141. reflex/components/chakra/navigation/stepper.py +0 -113
  142. reflex/components/chakra/navigation/stepper.pyi +0 -762
  143. reflex/components/chakra/overlay/__init__.py +0 -50
  144. reflex/components/chakra/overlay/alertdialog.py +0 -153
  145. reflex/components/chakra/overlay/alertdialog.pyi +0 -612
  146. reflex/components/chakra/overlay/drawer.py +0 -168
  147. reflex/components/chakra/overlay/drawer.pyi +0 -652
  148. reflex/components/chakra/overlay/menu.py +0 -225
  149. reflex/components/chakra/overlay/menu.pyi +0 -708
  150. reflex/components/chakra/overlay/modal.py +0 -166
  151. reflex/components/chakra/overlay/modal.pyi +0 -600
  152. reflex/components/chakra/overlay/popover.py +0 -183
  153. reflex/components/chakra/overlay/popover.pyi +0 -757
  154. reflex/components/chakra/overlay/tooltip.py +0 -70
  155. reflex/components/chakra/overlay/tooltip.pyi +0 -129
  156. reflex/components/chakra/typography/__init__.py +0 -10
  157. reflex/components/chakra/typography/heading.py +0 -16
  158. reflex/components/chakra/typography/heading.pyi +0 -96
  159. reflex/components/chakra/typography/highlight.py +0 -23
  160. reflex/components/chakra/typography/highlight.pyi +0 -91
  161. reflex/components/chakra/typography/span.py +0 -15
  162. reflex/components/chakra/typography/span.pyi +0 -89
  163. reflex/components/chakra/typography/text.py +0 -18
  164. reflex/components/chakra/typography/text.pyi +0 -91
  165. reflex/components/media/__init__.py +0 -1
  166. reflex/components/media/icon.py +0 -3
  167. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10a1.dist-info}/LICENSE +0 -0
  168. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10a1.dist-info}/WHEEL +0 -0
  169. {reflex-0.5.9.dev1.dist-info → reflex-0.5.10a1.dist-info}/entry_points.txt +0 -0
@@ -1,85 +0,0 @@
1
- """Chakra Tag Component."""
2
-
3
- from typing import Optional
4
-
5
- from reflex.components.chakra import (
6
- ChakraComponent,
7
- LiteralTagColorScheme,
8
- LiteralTagSize,
9
- LiteralVariant,
10
- )
11
- from reflex.components.component import Component
12
- from reflex.vars import Var
13
-
14
-
15
- class TagLabel(ChakraComponent):
16
- """The label of the tag."""
17
-
18
- tag = "TagLabel"
19
-
20
-
21
- class TagLeftIcon(ChakraComponent):
22
- """The left icon of the tag."""
23
-
24
- tag = "TagLeftIcon"
25
-
26
-
27
- class TagRightIcon(ChakraComponent):
28
- """The right icon of the tag."""
29
-
30
- tag = "TagRightIcon"
31
-
32
-
33
- class TagCloseButton(ChakraComponent):
34
- """The close button of the tag."""
35
-
36
- tag = "TagCloseButton"
37
-
38
-
39
- class Tag(ChakraComponent):
40
- """The parent wrapper that provides context for its children."""
41
-
42
- tag = "Tag"
43
-
44
- # The visual color appearance of the tag.
45
- # options: "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" |
46
- # "cyan" | "purple" | "pink"
47
- # default: "gray"
48
- color_scheme: Var[LiteralTagColorScheme]
49
-
50
- # The size of the tag
51
- # options: "sm" | "md" | "lg"
52
- # default: "md"
53
- size: Var[LiteralTagSize]
54
-
55
- # The variant of the tag
56
- # options: "solid" | "subtle" | "outline"
57
- # default: "solid"
58
- variant: Var[LiteralVariant]
59
-
60
- @classmethod
61
- def create(
62
- cls,
63
- label: Component,
64
- *,
65
- left_icon: Optional[Component] = None,
66
- right_icon: Optional[Component] = None,
67
- close_button: Optional[Component] = None,
68
- **props,
69
- ) -> Component:
70
- """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it.
71
-
72
- Args:
73
- label (Component): The label of the Tag that will be created.
74
- left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance.
75
- right_icon (Optional[Component]): Should be a rx.TagRightIcon instance.
76
- close_button (Optional[Component]): Should be a rx.TagCloseButton instance.
77
- props: The properties to be passed to the component.
78
-
79
- Returns:
80
- The `create()` method returns a Tag object.
81
- """
82
- children = [
83
- x for x in (left_icon, label, right_icon, close_button) if x is not None
84
- ]
85
- return super().create(*children, **props)
@@ -1,433 +0,0 @@
1
- """Stub file for reflex/components/chakra/datadisplay/tag.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 (
9
- ChakraComponent,
10
- )
11
- from reflex.components.component import Component
12
- from reflex.event import EventHandler, EventSpec
13
- from reflex.style import Style
14
- from reflex.vars import BaseVar, Var
15
-
16
- class TagLabel(ChakraComponent):
17
- @overload
18
- @classmethod
19
- def create( # type: ignore
20
- cls,
21
- *children,
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
- ) -> "TagLabel":
75
- """Create the component.
76
-
77
- Args:
78
- *children: The children of the component.
79
- style: The style of the component.
80
- key: A unique key for the component.
81
- id: The id for the component.
82
- class_name: The class name for the component.
83
- autofocus: Whether the component should take the focus once the page is loaded
84
- custom_attrs: custom attribute
85
- **props: The props of the component.
86
-
87
- Returns:
88
- The component.
89
- """
90
- ...
91
-
92
- class TagLeftIcon(ChakraComponent):
93
- @overload
94
- @classmethod
95
- def create( # type: ignore
96
- cls,
97
- *children,
98
- style: Optional[Style] = None,
99
- key: Optional[Any] = None,
100
- id: Optional[Any] = None,
101
- class_name: Optional[Any] = None,
102
- autofocus: Optional[bool] = None,
103
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
104
- on_blur: Optional[
105
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
106
- ] = None,
107
- on_click: Optional[
108
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
109
- ] = None,
110
- on_context_menu: Optional[
111
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
112
- ] = None,
113
- on_double_click: Optional[
114
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
115
- ] = None,
116
- on_focus: Optional[
117
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
118
- ] = None,
119
- on_mount: Optional[
120
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
121
- ] = None,
122
- on_mouse_down: Optional[
123
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
124
- ] = None,
125
- on_mouse_enter: Optional[
126
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
127
- ] = None,
128
- on_mouse_leave: Optional[
129
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
130
- ] = None,
131
- on_mouse_move: Optional[
132
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
133
- ] = None,
134
- on_mouse_out: Optional[
135
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
136
- ] = None,
137
- on_mouse_over: Optional[
138
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
139
- ] = None,
140
- on_mouse_up: Optional[
141
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
142
- ] = None,
143
- on_scroll: Optional[
144
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
145
- ] = None,
146
- on_unmount: Optional[
147
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
148
- ] = None,
149
- **props,
150
- ) -> "TagLeftIcon":
151
- """Create the component.
152
-
153
- Args:
154
- *children: The children of the component.
155
- style: The style of the component.
156
- key: A unique key for the component.
157
- id: The id for the component.
158
- class_name: The class name for the component.
159
- autofocus: Whether the component should take the focus once the page is loaded
160
- custom_attrs: custom attribute
161
- **props: The props of the component.
162
-
163
- Returns:
164
- The component.
165
- """
166
- ...
167
-
168
- class TagRightIcon(ChakraComponent):
169
- @overload
170
- @classmethod
171
- def create( # type: ignore
172
- cls,
173
- *children,
174
- style: Optional[Style] = None,
175
- key: Optional[Any] = None,
176
- id: Optional[Any] = None,
177
- class_name: Optional[Any] = None,
178
- autofocus: Optional[bool] = None,
179
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
180
- on_blur: Optional[
181
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
182
- ] = None,
183
- on_click: Optional[
184
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
185
- ] = None,
186
- on_context_menu: Optional[
187
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
188
- ] = None,
189
- on_double_click: Optional[
190
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
191
- ] = None,
192
- on_focus: Optional[
193
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
194
- ] = None,
195
- on_mount: Optional[
196
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
197
- ] = None,
198
- on_mouse_down: Optional[
199
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
200
- ] = None,
201
- on_mouse_enter: Optional[
202
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
203
- ] = None,
204
- on_mouse_leave: Optional[
205
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
206
- ] = None,
207
- on_mouse_move: Optional[
208
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
209
- ] = None,
210
- on_mouse_out: Optional[
211
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
212
- ] = None,
213
- on_mouse_over: Optional[
214
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
215
- ] = None,
216
- on_mouse_up: Optional[
217
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
218
- ] = None,
219
- on_scroll: Optional[
220
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
221
- ] = None,
222
- on_unmount: Optional[
223
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
224
- ] = None,
225
- **props,
226
- ) -> "TagRightIcon":
227
- """Create the component.
228
-
229
- Args:
230
- *children: The children of the component.
231
- style: The style of the component.
232
- key: A unique key for the component.
233
- id: The id for the component.
234
- class_name: The class name for the component.
235
- autofocus: Whether the component should take the focus once the page is loaded
236
- custom_attrs: custom attribute
237
- **props: The props of the component.
238
-
239
- Returns:
240
- The component.
241
- """
242
- ...
243
-
244
- class TagCloseButton(ChakraComponent):
245
- @overload
246
- @classmethod
247
- def create( # type: ignore
248
- cls,
249
- *children,
250
- style: Optional[Style] = None,
251
- key: Optional[Any] = None,
252
- id: Optional[Any] = None,
253
- class_name: Optional[Any] = None,
254
- autofocus: Optional[bool] = None,
255
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
256
- on_blur: Optional[
257
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
258
- ] = None,
259
- on_click: Optional[
260
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
261
- ] = None,
262
- on_context_menu: Optional[
263
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
264
- ] = None,
265
- on_double_click: Optional[
266
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
267
- ] = None,
268
- on_focus: Optional[
269
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
270
- ] = None,
271
- on_mount: Optional[
272
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
273
- ] = None,
274
- on_mouse_down: Optional[
275
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
276
- ] = None,
277
- on_mouse_enter: Optional[
278
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
279
- ] = None,
280
- on_mouse_leave: Optional[
281
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
282
- ] = None,
283
- on_mouse_move: Optional[
284
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
285
- ] = None,
286
- on_mouse_out: Optional[
287
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
288
- ] = None,
289
- on_mouse_over: Optional[
290
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
291
- ] = None,
292
- on_mouse_up: Optional[
293
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
294
- ] = None,
295
- on_scroll: Optional[
296
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
297
- ] = None,
298
- on_unmount: Optional[
299
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
300
- ] = None,
301
- **props,
302
- ) -> "TagCloseButton":
303
- """Create the component.
304
-
305
- Args:
306
- *children: The children of the component.
307
- style: The style of the component.
308
- key: A unique key for the component.
309
- id: The id for the component.
310
- class_name: The class name for the component.
311
- autofocus: Whether the component should take the focus once the page is loaded
312
- custom_attrs: custom attribute
313
- **props: The props of the component.
314
-
315
- Returns:
316
- The component.
317
- """
318
- ...
319
-
320
- class Tag(ChakraComponent):
321
- @overload
322
- @classmethod
323
- def create( # type: ignore
324
- cls,
325
- *children,
326
- left_icon: Optional[Component] = None,
327
- right_icon: Optional[Component] = None,
328
- close_button: Optional[Component] = None,
329
- color_scheme: Optional[
330
- Union[
331
- Var[
332
- Literal[
333
- "gray",
334
- "red",
335
- "orange",
336
- "yellow",
337
- "green",
338
- "teal",
339
- "blue",
340
- "cyan",
341
- "purple",
342
- "pink",
343
- ]
344
- ],
345
- Literal[
346
- "gray",
347
- "red",
348
- "orange",
349
- "yellow",
350
- "green",
351
- "teal",
352
- "blue",
353
- "cyan",
354
- "purple",
355
- "pink",
356
- ],
357
- ]
358
- ] = None,
359
- size: Optional[
360
- Union[Var[Literal["sm", "md", "lg"]], Literal["sm", "md", "lg"]]
361
- ] = None,
362
- variant: Optional[
363
- Union[
364
- Var[Literal["solid", "subtle", "outline"]],
365
- Literal["solid", "subtle", "outline"],
366
- ]
367
- ] = None,
368
- style: Optional[Style] = None,
369
- key: Optional[Any] = None,
370
- id: Optional[Any] = None,
371
- class_name: Optional[Any] = None,
372
- autofocus: Optional[bool] = None,
373
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
374
- on_blur: Optional[
375
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
376
- ] = None,
377
- on_click: Optional[
378
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
379
- ] = None,
380
- on_context_menu: Optional[
381
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
382
- ] = None,
383
- on_double_click: Optional[
384
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
385
- ] = None,
386
- on_focus: Optional[
387
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
388
- ] = None,
389
- on_mount: Optional[
390
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
391
- ] = None,
392
- on_mouse_down: Optional[
393
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
394
- ] = None,
395
- on_mouse_enter: Optional[
396
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
397
- ] = None,
398
- on_mouse_leave: Optional[
399
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
400
- ] = None,
401
- on_mouse_move: Optional[
402
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
403
- ] = None,
404
- on_mouse_out: Optional[
405
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
406
- ] = None,
407
- on_mouse_over: Optional[
408
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
409
- ] = None,
410
- on_mouse_up: Optional[
411
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
412
- ] = None,
413
- on_scroll: Optional[
414
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
415
- ] = None,
416
- on_unmount: Optional[
417
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
418
- ] = None,
419
- **props,
420
- ) -> "Tag":
421
- """Creates a Chakra Tag with a label and optionally left_icon, right_icon, and close_button, and returns it.
422
-
423
- Args:
424
- label (Component): The label of the Tag that will be created.
425
- left_icon (Optional[Component]): Should be a rx.TagLeftIcon instance.
426
- right_icon (Optional[Component]): Should be a rx.TagRightIcon instance.
427
- close_button (Optional[Component]): Should be a rx.TagCloseButton instance.
428
- props: The properties to be passed to the component.
429
-
430
- Returns:
431
- The `create()` method returns a Tag object.
432
- """
433
- ...
@@ -1,14 +0,0 @@
1
- """Disclosure components."""
2
-
3
- from .accordion import (
4
- Accordion,
5
- AccordionButton,
6
- AccordionIcon,
7
- AccordionItem,
8
- AccordionPanel,
9
- )
10
- from .tabs import Tab, TabList, TabPanel, TabPanels, Tabs
11
- from .transition import Collapse, Fade, ScaleFade, Slide, SlideFade
12
- from .visuallyhidden import VisuallyHidden
13
-
14
- __all__ = [f for f in dir() if f[0].isupper()] # type: ignore
@@ -1,110 +0,0 @@
1
- """Container to stack elements with spacing."""
2
-
3
- from typing import List, Optional, Union
4
-
5
- from reflex.components.chakra import ChakraComponent
6
- from reflex.components.component import Component
7
- from reflex.vars import Var
8
-
9
-
10
- class Accordion(ChakraComponent):
11
- """The wrapper that uses cloneElement to pass props to AccordionItem children."""
12
-
13
- tag = "Accordion"
14
-
15
- # If true, multiple accordion items can be expanded at once.
16
- allow_multiple: Var[bool]
17
-
18
- # If true, any expanded accordion item can be collapsed again.
19
- allow_toggle: Var[bool]
20
-
21
- # The initial index(es) of the expanded accordion item(s).
22
- default_index: Var[Optional[List[int]]]
23
-
24
- # The index(es) of the expanded accordion item
25
- index: Var[Union[int, List[int]]]
26
-
27
- # If true, height animation and transitions will be disabled.
28
- reduce_motion: Var[bool]
29
-
30
- @classmethod
31
- def create(
32
- cls,
33
- *children,
34
- items=None,
35
- icon_pos="right",
36
- allow_multiple: Optional[Var[bool]] = None,
37
- allow_toggle: Optional[Var[bool]] = None,
38
- **props,
39
- ) -> Component:
40
- """Create an accordion component.
41
-
42
- Args:
43
- *children: The children of the component.
44
- items: The items of the accordion component: list of tuples (label,panel)
45
- icon_pos: The position of the arrow icon of the accordion. "right", "left" or None
46
- allow_multiple: The allow_multiple property of the accordion. (True or False)
47
- allow_toggle: The allow_toggle property of the accordion. (True or False)
48
- **props: The properties of the component.
49
-
50
- Returns:
51
- The accordion component
52
- """
53
- if len(children) == 0:
54
- children = []
55
- if not items:
56
- items = []
57
- for label, panel in items:
58
- if icon_pos == "right":
59
- button = AccordionButton.create(label, AccordionIcon.create())
60
- elif icon_pos == "left":
61
- button = AccordionButton.create(AccordionIcon.create(), label)
62
- else:
63
- button = AccordionButton.create(label)
64
-
65
- children.append(
66
- AccordionItem.create(
67
- button,
68
- AccordionPanel.create(panel),
69
- )
70
- )
71
-
72
- # if allow_multiple is True, allow_toggle is implicitely used and does not need to be defined
73
- if allow_multiple:
74
- props.update({"allow_multiple": allow_multiple})
75
- elif allow_toggle:
76
- props.update({"allow_toggle": allow_toggle})
77
- return super().create(*children, **props)
78
-
79
-
80
- class AccordionItem(ChakraComponent):
81
- """A single accordion item."""
82
-
83
- tag = "AccordionItem"
84
-
85
- # A unique id for the accordion item.
86
- id_: Var[str]
87
-
88
- # If true, the accordion item will be disabled.
89
- is_disabled: Var[bool]
90
-
91
- # If true, the accordion item will be focusable.
92
- is_focusable: Var[bool]
93
-
94
-
95
- class AccordionButton(ChakraComponent):
96
- """The button that toggles the expand/collapse state of the accordion item. This button must be wrapped in an element with role heading."""
97
-
98
- tag = "AccordionButton"
99
-
100
-
101
- class AccordionPanel(ChakraComponent):
102
- """The container for the details to be revealed."""
103
-
104
- tag = "AccordionPanel"
105
-
106
-
107
- class AccordionIcon(ChakraComponent):
108
- """A chevron-down icon that rotates based on the expanded/collapsed state."""
109
-
110
- tag = "AccordionIcon"