reflex 0.5.9a1__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 (169) hide show
  1. reflex/__init__.py +21 -2
  2. reflex/__init__.pyi +0 -1
  3. reflex/app.py +1 -1
  4. reflex/components/__init__.py +0 -1
  5. reflex/components/__init__.pyi +0 -1
  6. reflex/components/markdown/markdown.py +1 -1
  7. reflex/components/recharts/cartesian.py +3 -0
  8. reflex/components/recharts/cartesian.pyi +2 -0
  9. reflex/components/sonner/toast.py +27 -1
  10. reflex/components/sonner/toast.pyi +5 -0
  11. reflex/constants/base.py +2 -0
  12. reflex/constants/installer.py +2 -0
  13. reflex/experimental/hooks.py +1 -1
  14. reflex/reflex.py +0 -15
  15. reflex/state.py +22 -22
  16. reflex/testing.py +8 -3
  17. reflex/utils/net.py +43 -0
  18. reflex/utils/prerequisites.py +27 -126
  19. reflex/utils/registry.py +48 -0
  20. reflex/utils/types.py +1 -1
  21. reflex/vars.py +4 -2
  22. {reflex-0.5.9a1.dist-info → reflex-0.5.10.dist-info}/METADATA +2 -1
  23. {reflex-0.5.9a1.dist-info → reflex-0.5.10.dist-info}/RECORD +26 -167
  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.9a1.dist-info → reflex-0.5.10.dist-info}/LICENSE +0 -0
  168. {reflex-0.5.9a1.dist-info → reflex-0.5.10.dist-info}/WHEEL +0 -0
  169. {reflex-0.5.9a1.dist-info → reflex-0.5.10.dist-info}/entry_points.txt +0 -0
@@ -1,58 +0,0 @@
1
- """Avatar components."""
2
-
3
- from __future__ import annotations
4
-
5
- from reflex.components.chakra import ChakraComponent, LiteralAvatarSize
6
- from reflex.event import EventHandler
7
- from reflex.vars import Var
8
-
9
-
10
- class Avatar(ChakraComponent):
11
- """The image that represents the user."""
12
-
13
- tag = "Avatar"
14
-
15
- # The default avatar used as fallback when name, and src is not specified.
16
- icon: Var[str]
17
-
18
- # The label of the icon.
19
- icon_label: Var[str]
20
-
21
- # If true, opt out of the avatar's fallback logic and renders the img at all times.
22
- ignore_fallback: Var[bool]
23
-
24
- # The name of the person in the avatar.
25
- name: Var[str]
26
-
27
- # If true, the Avatar will show a border around it. Best for a group of avatars.
28
- show_border: Var[bool]
29
-
30
- # The image url of the Avatar.
31
- src: Var[str]
32
-
33
- # List of sources to use for different screen resolutions.
34
- src_set: Var[str]
35
-
36
- # "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
37
- size: Var[LiteralAvatarSize]
38
-
39
- # Fired when the image fails to load.
40
- on_error: EventHandler[lambda: []]
41
-
42
-
43
- class AvatarBadge(ChakraComponent):
44
- """A wrapper that displays its content on the right corner of the avatar."""
45
-
46
- tag = "AvatarBadge"
47
-
48
-
49
- class AvatarGroup(ChakraComponent):
50
- """A wrapper to stack multiple Avatars together."""
51
-
52
- tag = "AvatarGroup"
53
-
54
- # The maximum number of visible avatars.
55
- max_: Var[int]
56
-
57
- # The space between the avatars in the group.
58
- spacing: Var[int]
@@ -1,267 +0,0 @@
1
- """Stub file for reflex/components/chakra/media/avatar.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 Avatar(ChakraComponent):
14
- @overload
15
- @classmethod
16
- def create( # type: ignore
17
- cls,
18
- *children,
19
- icon: Optional[Union[Var[str], str]] = None,
20
- icon_label: Optional[Union[Var[str], str]] = None,
21
- ignore_fallback: Optional[Union[Var[bool], bool]] = None,
22
- name: Optional[Union[Var[str], str]] = None,
23
- show_border: Optional[Union[Var[bool], bool]] = None,
24
- src: Optional[Union[Var[str], str]] = None,
25
- src_set: Optional[Union[Var[str], str]] = None,
26
- size: Optional[
27
- Union[
28
- Var[Literal["sm", "md", "lg", "xl", "xs", "2xl", "full", "2xs"]],
29
- Literal["sm", "md", "lg", "xl", "xs", "2xl", "full", "2xs"],
30
- ]
31
- ] = None,
32
- style: Optional[Style] = None,
33
- key: Optional[Any] = None,
34
- id: Optional[Any] = None,
35
- class_name: Optional[Any] = None,
36
- autofocus: Optional[bool] = None,
37
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
38
- on_blur: Optional[
39
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
40
- ] = None,
41
- on_click: Optional[
42
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
43
- ] = None,
44
- on_context_menu: Optional[
45
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
46
- ] = None,
47
- on_double_click: Optional[
48
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
49
- ] = None,
50
- on_error: Optional[
51
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
52
- ] = None,
53
- on_focus: Optional[
54
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
55
- ] = None,
56
- on_mount: Optional[
57
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
58
- ] = None,
59
- on_mouse_down: Optional[
60
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
61
- ] = None,
62
- on_mouse_enter: Optional[
63
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
64
- ] = None,
65
- on_mouse_leave: Optional[
66
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
67
- ] = None,
68
- on_mouse_move: Optional[
69
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
70
- ] = None,
71
- on_mouse_out: Optional[
72
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
73
- ] = None,
74
- on_mouse_over: Optional[
75
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
76
- ] = None,
77
- on_mouse_up: Optional[
78
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
79
- ] = None,
80
- on_scroll: Optional[
81
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
82
- ] = None,
83
- on_unmount: Optional[
84
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
85
- ] = None,
86
- **props,
87
- ) -> "Avatar":
88
- """Create the component.
89
-
90
- Args:
91
- *children: The children of the component.
92
- icon: The default avatar used as fallback when name, and src is not specified.
93
- icon_label: The label of the icon.
94
- ignore_fallback: If true, opt out of the avatar's fallback logic and renders the img at all times.
95
- name: The name of the person in the avatar.
96
- show_border: If true, the Avatar will show a border around it. Best for a group of avatars.
97
- src: The image url of the Avatar.
98
- src_set: List of sources to use for different screen resolutions.
99
- size: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
100
- style: The style of the component.
101
- key: A unique key for the component.
102
- id: The id for the component.
103
- class_name: The class name for the component.
104
- autofocus: Whether the component should take the focus once the page is loaded
105
- custom_attrs: custom attribute
106
- **props: The props of the component.
107
-
108
- Returns:
109
- The component.
110
- """
111
- ...
112
-
113
- class AvatarBadge(ChakraComponent):
114
- @overload
115
- @classmethod
116
- def create( # type: ignore
117
- cls,
118
- *children,
119
- style: Optional[Style] = None,
120
- key: Optional[Any] = None,
121
- id: Optional[Any] = None,
122
- class_name: Optional[Any] = None,
123
- autofocus: Optional[bool] = None,
124
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
125
- on_blur: Optional[
126
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
127
- ] = None,
128
- on_click: Optional[
129
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
130
- ] = None,
131
- on_context_menu: Optional[
132
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
133
- ] = None,
134
- on_double_click: Optional[
135
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
136
- ] = None,
137
- on_focus: Optional[
138
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
139
- ] = None,
140
- on_mount: Optional[
141
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
142
- ] = None,
143
- on_mouse_down: Optional[
144
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
145
- ] = None,
146
- on_mouse_enter: Optional[
147
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
148
- ] = None,
149
- on_mouse_leave: Optional[
150
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
151
- ] = None,
152
- on_mouse_move: Optional[
153
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
154
- ] = None,
155
- on_mouse_out: Optional[
156
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
157
- ] = None,
158
- on_mouse_over: Optional[
159
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
160
- ] = None,
161
- on_mouse_up: Optional[
162
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
163
- ] = None,
164
- on_scroll: Optional[
165
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
166
- ] = None,
167
- on_unmount: Optional[
168
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
169
- ] = None,
170
- **props,
171
- ) -> "AvatarBadge":
172
- """Create the component.
173
-
174
- Args:
175
- *children: The children of the component.
176
- style: The style of the component.
177
- key: A unique key for the component.
178
- id: The id for the component.
179
- class_name: The class name for the component.
180
- autofocus: Whether the component should take the focus once the page is loaded
181
- custom_attrs: custom attribute
182
- **props: The props of the component.
183
-
184
- Returns:
185
- The component.
186
- """
187
- ...
188
-
189
- class AvatarGroup(ChakraComponent):
190
- @overload
191
- @classmethod
192
- def create( # type: ignore
193
- cls,
194
- *children,
195
- max_: Optional[Union[Var[int], int]] = None,
196
- spacing: Optional[Union[Var[int], int]] = None,
197
- style: Optional[Style] = None,
198
- key: Optional[Any] = None,
199
- id: Optional[Any] = None,
200
- class_name: Optional[Any] = None,
201
- autofocus: Optional[bool] = None,
202
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
203
- on_blur: Optional[
204
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
205
- ] = None,
206
- on_click: Optional[
207
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
208
- ] = None,
209
- on_context_menu: Optional[
210
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
211
- ] = None,
212
- on_double_click: Optional[
213
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
214
- ] = None,
215
- on_focus: Optional[
216
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
217
- ] = None,
218
- on_mount: Optional[
219
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
220
- ] = None,
221
- on_mouse_down: Optional[
222
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
223
- ] = None,
224
- on_mouse_enter: Optional[
225
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
226
- ] = None,
227
- on_mouse_leave: Optional[
228
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
229
- ] = None,
230
- on_mouse_move: Optional[
231
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
232
- ] = None,
233
- on_mouse_out: Optional[
234
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
235
- ] = None,
236
- on_mouse_over: Optional[
237
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
238
- ] = None,
239
- on_mouse_up: Optional[
240
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
241
- ] = None,
242
- on_scroll: Optional[
243
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
244
- ] = None,
245
- on_unmount: Optional[
246
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
247
- ] = None,
248
- **props,
249
- ) -> "AvatarGroup":
250
- """Create the component.
251
-
252
- Args:
253
- *children: The children of the component.
254
- max_: The maximum number of visible avatars.
255
- spacing: The space between the avatars in the group.
256
- style: The style of the component.
257
- key: A unique key for the component.
258
- id: The id for the component.
259
- class_name: The class name for the component.
260
- autofocus: Whether the component should take the focus once the page is loaded
261
- custom_attrs: custom attribute
262
- **props: The props of the component.
263
-
264
- Returns:
265
- The component.
266
- """
267
- ...
@@ -1,111 +0,0 @@
1
- """An icon component."""
2
-
3
- from typing import List
4
-
5
- from reflex.components.chakra import ChakraComponent
6
- from reflex.utils import format
7
-
8
-
9
- class ChakraIconComponent(ChakraComponent):
10
- """A component that wraps a Chakra icon component."""
11
-
12
- library = "@chakra-ui/icons@2.0.19"
13
-
14
-
15
- class Icon(ChakraIconComponent):
16
- """An image icon."""
17
-
18
- tag = "None"
19
-
20
- @classmethod
21
- def create(cls, *children, **props):
22
- """Initialize the Icon component.
23
-
24
- Run some additional checks on Icon component.
25
-
26
- Args:
27
- *children: The positional arguments
28
- **props: The keyword arguments
29
-
30
- Raises:
31
- AttributeError: The errors tied to bad usage of the Icon component.
32
- ValueError: If the icon tag is invalid.
33
-
34
- Returns:
35
- The created component.
36
- """
37
- if children:
38
- raise AttributeError(
39
- f"Passing children to Icon component is not allowed: remove positional arguments {children} to fix"
40
- )
41
- if "tag" not in props:
42
- raise AttributeError("Missing 'tag' keyword-argument for Icon")
43
- if not isinstance(props["tag"], str) or props["tag"].lower() not in ICON_LIST:
44
- raise ValueError(
45
- f"Invalid icon tag: {props['tag']}. Please use one of the following: {sorted(ICON_LIST)}"
46
- )
47
- props["tag"] = format.to_title_case(props["tag"]) + "Icon"
48
- return super().create(*children, **props)
49
-
50
-
51
- # List of all icons.
52
- ICON_LIST: List[str] = [
53
- "add",
54
- "arrow_back",
55
- "arrow_down",
56
- "arrow_forward",
57
- "arrow_left",
58
- "arrow_right",
59
- "arrow_up",
60
- "arrow_up_down",
61
- "at_sign",
62
- "attachment",
63
- "bell",
64
- "calendar",
65
- "chat",
66
- "check_circle",
67
- "check",
68
- "chevron_down",
69
- "chevron_left",
70
- "chevron_right",
71
- "chevron_up",
72
- "close",
73
- "copy",
74
- "delete",
75
- "download",
76
- "drag_handle",
77
- "edit",
78
- "email",
79
- "external_link",
80
- "hamburger",
81
- "info",
82
- "info_outline",
83
- "link",
84
- "lock",
85
- "minus",
86
- "moon",
87
- "not_allowed",
88
- "phone",
89
- "plus_square",
90
- "question",
91
- "question_outline",
92
- "repeat",
93
- "repeat_clock",
94
- "search",
95
- "search2",
96
- "settings",
97
- "small_add",
98
- "small_close",
99
- "spinner",
100
- "star",
101
- "sun",
102
- "time",
103
- "triangle_down",
104
- "triangle_up",
105
- "unlock",
106
- "up_down",
107
- "view",
108
- "view_off",
109
- "warning",
110
- "warning_two",
111
- ]
@@ -1,171 +0,0 @@
1
- """Stub file for reflex/components/chakra/media/icon.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, List, 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 ChakraIconComponent(ChakraComponent):
14
- @overload
15
- @classmethod
16
- def create( # type: ignore
17
- cls,
18
- *children,
19
- style: Optional[Style] = None,
20
- key: Optional[Any] = None,
21
- id: Optional[Any] = None,
22
- class_name: Optional[Any] = None,
23
- autofocus: Optional[bool] = None,
24
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
25
- on_blur: Optional[
26
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
27
- ] = None,
28
- on_click: Optional[
29
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
30
- ] = None,
31
- on_context_menu: Optional[
32
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
33
- ] = None,
34
- on_double_click: Optional[
35
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
36
- ] = None,
37
- on_focus: Optional[
38
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
39
- ] = None,
40
- on_mount: Optional[
41
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
42
- ] = None,
43
- on_mouse_down: Optional[
44
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
45
- ] = None,
46
- on_mouse_enter: Optional[
47
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
48
- ] = None,
49
- on_mouse_leave: Optional[
50
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
51
- ] = None,
52
- on_mouse_move: Optional[
53
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
54
- ] = None,
55
- on_mouse_out: Optional[
56
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
57
- ] = None,
58
- on_mouse_over: Optional[
59
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
60
- ] = None,
61
- on_mouse_up: Optional[
62
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
63
- ] = None,
64
- on_scroll: Optional[
65
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
66
- ] = None,
67
- on_unmount: Optional[
68
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
69
- ] = None,
70
- **props,
71
- ) -> "ChakraIconComponent":
72
- """Create the component.
73
-
74
- Args:
75
- *children: The children of the component.
76
- style: The style of the component.
77
- key: A unique key for the component.
78
- id: The id for the component.
79
- class_name: The class name for the component.
80
- autofocus: Whether the component should take the focus once the page is loaded
81
- custom_attrs: custom attribute
82
- **props: The props of the component.
83
-
84
- Returns:
85
- The component.
86
- """
87
- ...
88
-
89
- class Icon(ChakraIconComponent):
90
- @overload
91
- @classmethod
92
- def create( # type: ignore
93
- cls,
94
- *children,
95
- style: Optional[Style] = None,
96
- key: Optional[Any] = None,
97
- id: Optional[Any] = None,
98
- class_name: Optional[Any] = None,
99
- autofocus: Optional[bool] = None,
100
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
101
- on_blur: Optional[
102
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
103
- ] = None,
104
- on_click: Optional[
105
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
106
- ] = None,
107
- on_context_menu: Optional[
108
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
109
- ] = None,
110
- on_double_click: Optional[
111
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
112
- ] = None,
113
- on_focus: Optional[
114
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
115
- ] = None,
116
- on_mount: Optional[
117
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
118
- ] = None,
119
- on_mouse_down: Optional[
120
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
121
- ] = None,
122
- on_mouse_enter: Optional[
123
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
124
- ] = None,
125
- on_mouse_leave: Optional[
126
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
127
- ] = None,
128
- on_mouse_move: Optional[
129
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
130
- ] = None,
131
- on_mouse_out: Optional[
132
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
133
- ] = None,
134
- on_mouse_over: Optional[
135
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
136
- ] = None,
137
- on_mouse_up: Optional[
138
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
139
- ] = None,
140
- on_scroll: Optional[
141
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
142
- ] = None,
143
- on_unmount: Optional[
144
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
145
- ] = None,
146
- **props,
147
- ) -> "Icon":
148
- """Initialize the Icon component.
149
-
150
- Run some additional checks on Icon component.
151
-
152
- Args:
153
- *children: The positional arguments
154
- style: The style of the component.
155
- key: A unique key for the component.
156
- id: The id for the component.
157
- class_name: The class name for the component.
158
- autofocus: Whether the component should take the focus once the page is loaded
159
- custom_attrs: custom attribute
160
- **props: The keyword arguments
161
-
162
- Raises:
163
- AttributeError: The errors tied to bad usage of the Icon component.
164
- ValueError: If the icon tag is invalid.
165
-
166
- Returns:
167
- The created component.
168
- """
169
- ...
170
-
171
- ICON_LIST: List[str]
@@ -1,74 +0,0 @@
1
- """An image component."""
2
-
3
- from __future__ import annotations
4
-
5
- from typing import Any, Optional
6
-
7
- from reflex.components.chakra import ChakraComponent, LiteralImageLoading
8
- from reflex.components.component import Component
9
- from reflex.event import EventHandler
10
- from reflex.vars import Var
11
-
12
-
13
- class Image(ChakraComponent):
14
- """Display an image."""
15
-
16
- tag = "Image"
17
- alias = "ChakraImage"
18
- # How to align the image within its bounds. It maps to css `object-position` property.
19
- align: Var[str]
20
-
21
- # Fallback Reflex component to show if image is loading or image fails.
22
- fallback: Optional[Component] = None
23
-
24
- # Fallback image src to show if image is loading or image fails.
25
- fallback_src: Var[str]
26
-
27
- # How the image to fit within its bounds. It maps to css `object-fit` property.
28
- fit: Var[str]
29
-
30
- # The native HTML height attribute to the passed to the img.
31
- html_height: Var[str]
32
-
33
- # The native HTML width attribute to the passed to the img.
34
- html_width: Var[str]
35
-
36
- # If true, opt out of the fallbackSrc logic and use as img.
37
- ignore_fallback: Var[bool]
38
-
39
- # "eager" | "lazy"
40
- loading: Var[LiteralImageLoading]
41
-
42
- # The path/url to the image or PIL image object.
43
- src: Var[Any]
44
-
45
- # The alt text of the image.
46
- alt: Var[str]
47
-
48
- # Provide multiple sources for an image, allowing the browser
49
- # to select the most appropriate source based on factors like
50
- # screen resolution and device capabilities.
51
- # Learn more _[here](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images)_
52
- src_set: Var[str]
53
-
54
- # Fired when the image fails to load.
55
- on_error: EventHandler[lambda: []]
56
-
57
- # Fired when the image is loaded.
58
- on_load: EventHandler[lambda: []]
59
-
60
- @classmethod
61
- def create(cls, *children, **props) -> Component:
62
- """Create an Image component.
63
-
64
- Args:
65
- *children: The children of the image.
66
- **props: The props of the image.
67
-
68
- Returns:
69
- The Image component.
70
- """
71
- src = props.get("src", None)
72
- if src is not None and not isinstance(src, (Var)):
73
- props["src"] = Var.create(value=src, _var_is_string=True)
74
- return super().create(*children, **props)