reflex 0.6.4a3__py3-none-any.whl → 0.6.5__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 (228) hide show
  1. reflex/.templates/jinja/web/pages/custom_component.js.jinja2 +0 -14
  2. reflex/.templates/jinja/web/pages/utils.js.jinja2 +4 -8
  3. reflex/.templates/web/components/shiki/code.js +16 -11
  4. reflex/.templates/web/utils/state.js +29 -21
  5. reflex/__init__.py +4 -0
  6. reflex/__init__.pyi +4 -0
  7. reflex/app.py +148 -154
  8. reflex/app_mixins/lifespan.py +5 -1
  9. reflex/app_mixins/middleware.py +3 -1
  10. reflex/app_mixins/mixin.py +3 -2
  11. reflex/base.py +2 -4
  12. reflex/compiler/compiler.py +111 -37
  13. reflex/components/base/app_wrap.pyi +17 -17
  14. reflex/components/base/bare.py +72 -3
  15. reflex/components/base/body.pyi +17 -17
  16. reflex/components/base/document.pyi +81 -81
  17. reflex/components/base/error_boundary.pyi +25 -18
  18. reflex/components/base/fragment.pyi +17 -17
  19. reflex/components/base/head.pyi +33 -33
  20. reflex/components/base/link.pyi +33 -33
  21. reflex/components/base/meta.pyi +65 -65
  22. reflex/components/base/script.py +4 -4
  23. reflex/components/base/script.pyi +23 -20
  24. reflex/components/component.py +250 -31
  25. reflex/components/core/banner.py +1 -1
  26. reflex/components/core/banner.pyi +81 -81
  27. reflex/components/core/client_side_routing.pyi +33 -33
  28. reflex/components/core/clipboard.py +2 -2
  29. reflex/components/core/clipboard.pyi +24 -18
  30. reflex/components/core/debounce.py +2 -2
  31. reflex/components/core/debounce.pyi +18 -18
  32. reflex/components/core/html.pyi +17 -17
  33. reflex/components/core/upload.py +90 -28
  34. reflex/components/core/upload.pyi +128 -72
  35. reflex/components/datadisplay/code.py +55 -40
  36. reflex/components/datadisplay/code.pyi +46 -44
  37. reflex/components/datadisplay/dataeditor.py +21 -20
  38. reflex/components/datadisplay/dataeditor.pyi +103 -35
  39. reflex/components/datadisplay/shiki_code_block.py +60 -27
  40. reflex/components/datadisplay/shiki_code_block.pyi +86 -65
  41. reflex/components/dynamic.py +9 -5
  42. reflex/components/el/element.pyi +17 -17
  43. reflex/components/el/elements/base.pyi +17 -17
  44. reflex/components/el/elements/forms.py +12 -3
  45. reflex/components/el/elements/forms.pyi +293 -233
  46. reflex/components/el/elements/inline.pyi +449 -449
  47. reflex/components/el/elements/media.pyi +401 -401
  48. reflex/components/el/elements/metadata.pyi +97 -97
  49. reflex/components/el/elements/other.pyi +113 -113
  50. reflex/components/el/elements/scripts.pyi +49 -49
  51. reflex/components/el/elements/sectioning.pyi +241 -241
  52. reflex/components/el/elements/tables.pyi +161 -161
  53. reflex/components/el/elements/typography.pyi +241 -241
  54. reflex/components/gridjs/datatable.pyi +33 -33
  55. reflex/components/lucide/icon.py +1 -1
  56. reflex/components/lucide/icon.pyi +33 -33
  57. reflex/components/markdown/markdown.py +180 -49
  58. reflex/components/markdown/markdown.pyi +36 -19
  59. reflex/components/moment/moment.py +17 -21
  60. reflex/components/moment/moment.pyi +26 -21
  61. reflex/components/next/base.pyi +17 -17
  62. reflex/components/next/image.py +3 -3
  63. reflex/components/next/image.pyi +21 -19
  64. reflex/components/next/link.pyi +17 -17
  65. reflex/components/next/video.pyi +17 -17
  66. reflex/components/plotly/plotly.py +79 -78
  67. reflex/components/plotly/plotly.pyi +91 -41
  68. reflex/components/props.py +34 -0
  69. reflex/components/radix/primitives/accordion.py +15 -8
  70. reflex/components/radix/primitives/accordion.pyi +121 -118
  71. reflex/components/radix/primitives/base.pyi +33 -33
  72. reflex/components/radix/primitives/drawer.py +41 -20
  73. reflex/components/radix/primitives/drawer.pyi +279 -190
  74. reflex/components/radix/primitives/form.py +2 -2
  75. reflex/components/radix/primitives/form.pyi +200 -167
  76. reflex/components/radix/primitives/progress.pyi +81 -81
  77. reflex/components/radix/primitives/slider.pyi +89 -83
  78. reflex/components/radix/themes/base.py +30 -1
  79. reflex/components/radix/themes/base.pyi +286 -113
  80. reflex/components/radix/themes/color_mode.py +17 -9
  81. reflex/components/radix/themes/color_mode.pyi +68 -56
  82. reflex/components/radix/themes/components/alert_dialog.py +8 -5
  83. reflex/components/radix/themes/components/alert_dialog.pyi +125 -117
  84. reflex/components/radix/themes/components/aspect_ratio.pyi +17 -17
  85. reflex/components/radix/themes/components/avatar.py +1 -5
  86. reflex/components/radix/themes/components/avatar.pyi +17 -17
  87. reflex/components/radix/themes/components/badge.py +1 -5
  88. reflex/components/radix/themes/components/badge.pyi +17 -17
  89. reflex/components/radix/themes/components/button.pyi +18 -21
  90. reflex/components/radix/themes/components/callout.py +1 -4
  91. reflex/components/radix/themes/components/callout.pyi +81 -81
  92. reflex/components/radix/themes/components/card.py +1 -3
  93. reflex/components/radix/themes/components/card.pyi +17 -17
  94. reflex/components/radix/themes/components/checkbox.py +4 -8
  95. reflex/components/radix/themes/components/checkbox.pyi +61 -52
  96. reflex/components/radix/themes/components/checkbox_cards.pyi +33 -33
  97. reflex/components/radix/themes/components/checkbox_group.pyi +33 -33
  98. reflex/components/radix/themes/components/context_menu.py +121 -28
  99. reflex/components/radix/themes/components/context_menu.pyi +250 -147
  100. reflex/components/radix/themes/components/data_list.pyi +65 -65
  101. reflex/components/radix/themes/components/dialog.py +11 -11
  102. reflex/components/radix/themes/components/dialog.pyi +135 -120
  103. reflex/components/radix/themes/components/dropdown_menu.py +14 -25
  104. reflex/components/radix/themes/components/dropdown_menu.pyi +157 -145
  105. reflex/components/radix/themes/components/hover_card.py +19 -7
  106. reflex/components/radix/themes/components/hover_card.pyi +102 -67
  107. reflex/components/radix/themes/components/icon_button.pyi +18 -21
  108. reflex/components/radix/themes/components/inset.py +1 -3
  109. reflex/components/radix/themes/components/inset.pyi +17 -17
  110. reflex/components/radix/themes/components/popover.py +22 -13
  111. reflex/components/radix/themes/components/popover.pyi +98 -72
  112. reflex/components/radix/themes/components/progress.pyi +17 -17
  113. reflex/components/radix/themes/components/radio.pyi +17 -17
  114. reflex/components/radix/themes/components/radio_cards.py +2 -2
  115. reflex/components/radix/themes/components/radio_cards.pyi +37 -34
  116. reflex/components/radix/themes/components/radio_group.py +3 -7
  117. reflex/components/radix/themes/components/radio_group.pyi +69 -66
  118. reflex/components/radix/themes/components/scroll_area.py +1 -3
  119. reflex/components/radix/themes/components/scroll_area.pyi +17 -17
  120. reflex/components/radix/themes/components/segmented_control.pyi +37 -34
  121. reflex/components/radix/themes/components/select.py +7 -11
  122. reflex/components/radix/themes/components/select.pyi +175 -154
  123. reflex/components/radix/themes/components/separator.py +1 -4
  124. reflex/components/radix/themes/components/separator.pyi +17 -17
  125. reflex/components/radix/themes/components/skeleton.pyi +17 -17
  126. reflex/components/radix/themes/components/slider.py +12 -21
  127. reflex/components/radix/themes/components/slider.pyi +47 -25
  128. reflex/components/radix/themes/components/spinner.py +1 -4
  129. reflex/components/radix/themes/components/spinner.pyi +17 -17
  130. reflex/components/radix/themes/components/switch.py +3 -6
  131. reflex/components/radix/themes/components/switch.pyi +21 -18
  132. reflex/components/radix/themes/components/table.py +21 -5
  133. reflex/components/radix/themes/components/table.pyi +392 -116
  134. reflex/components/radix/themes/components/tabs.py +3 -6
  135. reflex/components/radix/themes/components/tabs.pyi +89 -83
  136. reflex/components/radix/themes/components/text_area.py +1 -5
  137. reflex/components/radix/themes/components/text_area.pyi +43 -20
  138. reflex/components/radix/themes/components/text_field.py +1 -5
  139. reflex/components/radix/themes/components/text_field.pyi +101 -55
  140. reflex/components/radix/themes/components/tooltip.py +5 -7
  141. reflex/components/radix/themes/components/tooltip.pyi +25 -22
  142. reflex/components/radix/themes/layout/base.py +2 -27
  143. reflex/components/radix/themes/layout/base.pyi +82 -82
  144. reflex/components/radix/themes/layout/box.pyi +17 -17
  145. reflex/components/radix/themes/layout/center.pyi +17 -17
  146. reflex/components/radix/themes/layout/container.pyi +17 -17
  147. reflex/components/radix/themes/layout/flex.py +1 -6
  148. reflex/components/radix/themes/layout/flex.pyi +17 -17
  149. reflex/components/radix/themes/layout/grid.py +1 -6
  150. reflex/components/radix/themes/layout/grid.pyi +17 -17
  151. reflex/components/radix/themes/layout/list.py +20 -15
  152. reflex/components/radix/themes/layout/list.pyi +175 -92
  153. reflex/components/radix/themes/layout/section.pyi +17 -17
  154. reflex/components/radix/themes/layout/spacer.pyi +17 -17
  155. reflex/components/radix/themes/layout/stack.py +6 -6
  156. reflex/components/radix/themes/layout/stack.pyi +91 -62
  157. reflex/components/radix/themes/typography/blockquote.py +2 -8
  158. reflex/components/radix/themes/typography/blockquote.pyi +17 -17
  159. reflex/components/radix/themes/typography/code.py +4 -10
  160. reflex/components/radix/themes/typography/code.pyi +19 -18
  161. reflex/components/radix/themes/typography/heading.py +4 -11
  162. reflex/components/radix/themes/typography/heading.pyi +19 -18
  163. reflex/components/radix/themes/typography/link.py +4 -10
  164. reflex/components/radix/themes/typography/link.pyi +19 -18
  165. reflex/components/radix/themes/typography/text.py +4 -11
  166. reflex/components/radix/themes/typography/text.pyi +115 -114
  167. reflex/components/react_player/audio.pyi +58 -33
  168. reflex/components/react_player/react_player.py +17 -17
  169. reflex/components/react_player/react_player.pyi +55 -33
  170. reflex/components/react_player/video.pyi +58 -33
  171. reflex/components/recharts/cartesian.py +45 -45
  172. reflex/components/recharts/cartesian.pyi +389 -304
  173. reflex/components/recharts/charts.py +22 -22
  174. reflex/components/recharts/charts.pyi +226 -179
  175. reflex/components/recharts/general.py +26 -27
  176. reflex/components/recharts/general.pyi +106 -99
  177. reflex/components/recharts/polar.py +33 -33
  178. reflex/components/recharts/polar.pyi +70 -64
  179. reflex/components/recharts/recharts.pyi +33 -33
  180. reflex/components/sonner/toast.py +9 -36
  181. reflex/components/sonner/toast.pyi +20 -24
  182. reflex/components/suneditor/editor.py +8 -8
  183. reflex/components/suneditor/editor.pyi +50 -25
  184. reflex/components/tags/iter_tag.py +1 -10
  185. reflex/components/tags/tag.py +1 -4
  186. reflex/config.py +198 -35
  187. reflex/constants/__init__.py +4 -16
  188. reflex/constants/base.py +7 -14
  189. reflex/constants/colors.py +0 -1
  190. reflex/constants/installer.py +12 -7
  191. reflex/constants/state.py +4 -0
  192. reflex/custom_components/custom_components.py +6 -6
  193. reflex/event.py +486 -241
  194. reflex/experimental/client_state.py +9 -9
  195. reflex/experimental/layout.py +2 -2
  196. reflex/experimental/layout.pyi +95 -87
  197. reflex/experimental/misc.py +1 -1
  198. reflex/istate/__init__.py +1 -0
  199. reflex/istate/proxy.py +33 -0
  200. reflex/istate/wrappers.py +27 -0
  201. reflex/model.py +7 -7
  202. reflex/page.py +2 -1
  203. reflex/reflex.py +142 -8
  204. reflex/state.py +133 -46
  205. reflex/testing.py +9 -7
  206. reflex/utils/console.py +0 -1
  207. reflex/utils/exceptions.py +31 -3
  208. reflex/utils/exec.py +33 -14
  209. reflex/utils/format.py +15 -12
  210. reflex/utils/net.py +1 -1
  211. reflex/utils/path_ops.py +2 -2
  212. reflex/utils/prerequisites.py +82 -46
  213. reflex/utils/pyi_generator.py +63 -20
  214. reflex/utils/registry.py +1 -1
  215. reflex/utils/serializers.py +75 -36
  216. reflex/utils/telemetry.py +3 -2
  217. reflex/utils/types.py +125 -10
  218. reflex/vars/base.py +131 -119
  219. reflex/vars/function.py +59 -12
  220. reflex/vars/number.py +3 -1
  221. reflex/vars/object.py +30 -24
  222. reflex/vars/sequence.py +7 -7
  223. {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/METADATA +3 -3
  224. reflex-0.6.5.dist-info/RECORD +394 -0
  225. reflex-0.6.4a3.dist-info/RECORD +0 -391
  226. {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/LICENSE +0 -0
  227. {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/WHEEL +0 -0
  228. {reflex-0.6.4a3.dist-info → reflex-0.6.5.dist-info}/entry_points.txt +0 -0
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union
6
6
 
7
7
  from reflex.components.component import MemoizationLeaf
8
8
  from reflex.constants.colors import Color
9
- from reflex.event import EventHandler, empty_event
9
+ from reflex.event import EventHandler, no_args_event_spec
10
10
  from reflex.vars.base import LiteralVar, Var
11
11
 
12
12
  from .recharts import (
@@ -46,7 +46,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
46
46
  debounce: Var[int]
47
47
 
48
48
  # If specified provides a callback providing the updated chart width and height values.
49
- on_resize: EventHandler[empty_event]
49
+ on_resize: EventHandler[no_args_event_spec]
50
50
 
51
51
  # Valid children components
52
52
  _valid_children: List[str] = [
@@ -104,28 +104,28 @@ class Legend(Recharts):
104
104
  margin: Var[Dict[str, Any]]
105
105
 
106
106
  # The customized event handler of click on the items in this group
107
- on_click: EventHandler[empty_event]
107
+ on_click: EventHandler[no_args_event_spec]
108
108
 
109
109
  # The customized event handler of mousedown on the items in this group
110
- on_mouse_down: EventHandler[empty_event]
110
+ on_mouse_down: EventHandler[no_args_event_spec]
111
111
 
112
112
  # The customized event handler of mouseup on the items in this group
113
- on_mouse_up: EventHandler[empty_event]
113
+ on_mouse_up: EventHandler[no_args_event_spec]
114
114
 
115
115
  # The customized event handler of mousemove on the items in this group
116
- on_mouse_move: EventHandler[empty_event]
116
+ on_mouse_move: EventHandler[no_args_event_spec]
117
117
 
118
118
  # The customized event handler of mouseover on the items in this group
119
- on_mouse_over: EventHandler[empty_event]
119
+ on_mouse_over: EventHandler[no_args_event_spec]
120
120
 
121
121
  # The customized event handler of mouseout on the items in this group
122
- on_mouse_out: EventHandler[empty_event]
122
+ on_mouse_out: EventHandler[no_args_event_spec]
123
123
 
124
124
  # The customized event handler of mouseenter on the items in this group
125
- on_mouse_enter: EventHandler[empty_event]
125
+ on_mouse_enter: EventHandler[no_args_event_spec]
126
126
 
127
127
  # The customized event handler of mouseleave on the items in this group
128
- on_mouse_leave: EventHandler[empty_event]
128
+ on_mouse_leave: EventHandler[no_args_event_spec]
129
129
 
130
130
 
131
131
  class GraphingTooltip(Recharts):
@@ -135,16 +135,16 @@ class GraphingTooltip(Recharts):
135
135
 
136
136
  alias = "RechartsTooltip"
137
137
 
138
- # The separator between name and value.
138
+ # The separator between name and value. Default: ":"
139
139
  separator: Var[str]
140
140
 
141
- # The offset size of tooltip. Number
141
+ # The offset size of tooltip. Number. Default: 10
142
142
  offset: Var[int]
143
143
 
144
- # When an item of the payload has value null or undefined, this item won't be displayed.
144
+ # When an item of the payload has value null or undefined, this item won't be displayed. Default: True
145
145
  filter_null: Var[bool]
146
146
 
147
- # If set false, no cursor will be drawn when tooltip is active.
147
+ # If set false, no cursor will be drawn when tooltip is active. Default: {"strokeWidth": 1, "fill": rx.color("gray", 3)}
148
148
  cursor: Var[Union[Dict[str, Any], bool]] = LiteralVar.create(
149
149
  {
150
150
  "strokeWidth": 1,
@@ -155,16 +155,17 @@ class GraphingTooltip(Recharts):
155
155
  # The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
156
156
  view_box: Var[Dict[str, Any]]
157
157
 
158
- # The style of default tooltip content item which is a li element. DEFAULT: {}
158
+ # The style of default tooltip content item which is a li element. Default: {"color": rx.color("gray", 12)}
159
159
  item_style: Var[Dict[str, Any]] = LiteralVar.create(
160
160
  {
161
161
  "color": Color("gray", 12),
162
162
  }
163
163
  )
164
164
 
165
- # The style of tooltip wrapper which is a dom element. DEFAULT: {}
165
+ # The style of tooltip wrapper which is a dom element. Default: {}
166
166
  wrapper_style: Var[Dict[str, Any]]
167
- # The style of tooltip content which is a dom element. DEFAULT: {}
167
+
168
+ # The style of tooltip content which is a dom element. Default: {"background": rx.color("gray", 1), "borderColor": rx.color("gray", 4), "borderRadius": "8px"}
168
169
  content_style: Var[Dict[str, Any]] = LiteralVar.create(
169
170
  {
170
171
  "background": Color("gray", 1),
@@ -173,30 +174,28 @@ class GraphingTooltip(Recharts):
173
174
  }
174
175
  )
175
176
 
176
- # The style of default tooltip label which is a p element. DEFAULT: {}
177
+ # The style of default tooltip label which is a p element. Default: {"color": rx.color("gray", 11)}
177
178
  label_style: Var[Dict[str, Any]] = LiteralVar.create({"color": Color("gray", 11)})
178
179
 
179
- # This option allows the tooltip to extend beyond the viewBox of the chart itself. DEFAULT: { x: false, y: false }
180
- allow_escape_view_box: Var[Dict[str, bool]] = LiteralVar.create(
181
- {"x": False, "y": False}
182
- )
180
+ # This option allows the tooltip to extend beyond the viewBox of the chart itself. Default: {"x": False, "y": False}
181
+ allow_escape_view_box: Var[Dict[str, bool]]
183
182
 
184
- # If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally.
183
+ # If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally. Default: False
185
184
  active: Var[bool]
186
185
 
187
186
  # If this field is set, the tooltip position will be fixed and will not move anymore.
188
187
  position: Var[Dict[str, Any]]
189
188
 
190
- # The coordinate of tooltip which is usually calculated internally.
189
+ # The coordinate of tooltip which is usually calculated internally. Default: {"x": 0, "y": 0}
191
190
  coordinate: Var[Dict[str, Any]]
192
191
 
193
- # If set false, animation of tooltip will be disabled. DEFAULT: true in CSR, and false in SSR
192
+ # If set false, animation of tooltip will be disabled. Default: True
194
193
  is_animation_active: Var[bool]
195
194
 
196
- # Specifies the duration of animation, the unit of this option is ms. DEFAULT: 1500
195
+ # Specifies the duration of animation, the unit of this option is ms. Default: 1500
197
196
  animation_duration: Var[int]
198
197
 
199
- # The type of easing function. DEFAULT: 'ease'
198
+ # The type of easing function. Default: "ease"
200
199
  animation_easing: Var[LiteralAnimationEasing]
201
200
 
202
201
 
@@ -7,13 +7,11 @@ from typing import Any, Dict, List, Literal, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import MemoizationLeaf
9
9
  from reflex.constants.colors import Color
10
- from reflex.event import EventType
10
+ from reflex.event import BASE_STATE, EventType
11
11
  from reflex.style import Style
12
12
  from reflex.vars.base import Var
13
13
 
14
- from .recharts import (
15
- Recharts,
16
- )
14
+ from .recharts import Recharts
17
15
 
18
16
  class ResponsiveContainer(Recharts, MemoizationLeaf):
19
17
  @overload
@@ -32,23 +30,23 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
32
30
  id: Optional[Any] = None,
33
31
  class_name: Optional[Any] = None,
34
32
  autofocus: Optional[bool] = None,
35
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
36
- on_blur: Optional[EventType[[]]] = None,
37
- on_click: Optional[EventType[[]]] = None,
38
- on_context_menu: Optional[EventType[[]]] = None,
39
- on_double_click: Optional[EventType[[]]] = None,
40
- on_focus: Optional[EventType[[]]] = None,
41
- on_mount: Optional[EventType[[]]] = None,
42
- on_mouse_down: Optional[EventType[[]]] = None,
43
- on_mouse_enter: Optional[EventType[[]]] = None,
44
- on_mouse_leave: Optional[EventType[[]]] = None,
45
- on_mouse_move: Optional[EventType[[]]] = None,
46
- on_mouse_out: Optional[EventType[[]]] = None,
47
- on_mouse_over: Optional[EventType[[]]] = None,
48
- on_mouse_up: Optional[EventType[[]]] = None,
49
- on_resize: Optional[EventType[[]]] = None,
50
- on_scroll: Optional[EventType[[]]] = None,
51
- on_unmount: Optional[EventType[[]]] = None,
33
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
34
+ on_blur: Optional[EventType[[], BASE_STATE]] = None,
35
+ on_click: Optional[EventType[[], BASE_STATE]] = None,
36
+ on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
37
+ on_double_click: Optional[EventType[[], BASE_STATE]] = None,
38
+ on_focus: Optional[EventType[[], BASE_STATE]] = None,
39
+ on_mount: Optional[EventType[[], BASE_STATE]] = None,
40
+ on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
41
+ on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
42
+ on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
43
+ on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
44
+ on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
45
+ on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
46
+ on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
47
+ on_resize: Optional[EventType[[], BASE_STATE]] = None,
48
+ on_scroll: Optional[EventType[[], BASE_STATE]] = None,
49
+ on_unmount: Optional[EventType[[], BASE_STATE]] = None,
52
50
  **props,
53
51
  ) -> "ResponsiveContainer":
54
52
  """Create a new memoization leaf component.
@@ -61,6 +59,7 @@ class ResponsiveContainer(Recharts, MemoizationLeaf):
61
59
  min_width: The minimum width of chart container. Number
62
60
  min_height: The minimum height of chart container. Number
63
61
  debounce: If specified a positive number, debounced function will be used to handle the resize event. Default: 0
62
+ on_resize: If specified provides a callback providing the updated chart width and height values.
64
63
  style: The style of the component.
65
64
  key: A unique key for the component.
66
65
  id: The id for the component.
@@ -142,22 +141,22 @@ class Legend(Recharts):
142
141
  id: Optional[Any] = None,
143
142
  class_name: Optional[Any] = None,
144
143
  autofocus: Optional[bool] = None,
145
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
146
- on_blur: Optional[EventType[[]]] = None,
147
- on_click: Optional[EventType[[]]] = None,
148
- on_context_menu: Optional[EventType[[]]] = None,
149
- on_double_click: Optional[EventType[[]]] = None,
150
- on_focus: Optional[EventType[[]]] = None,
151
- on_mount: Optional[EventType[[]]] = None,
152
- on_mouse_down: Optional[EventType[[]]] = None,
153
- on_mouse_enter: Optional[EventType[[]]] = None,
154
- on_mouse_leave: Optional[EventType[[]]] = None,
155
- on_mouse_move: Optional[EventType[[]]] = None,
156
- on_mouse_out: Optional[EventType[[]]] = None,
157
- on_mouse_over: Optional[EventType[[]]] = None,
158
- on_mouse_up: Optional[EventType[[]]] = None,
159
- on_scroll: Optional[EventType[[]]] = None,
160
- on_unmount: Optional[EventType[[]]] = None,
144
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
145
+ on_blur: Optional[EventType[[], BASE_STATE]] = None,
146
+ on_click: Optional[EventType[[], BASE_STATE]] = None,
147
+ on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
148
+ on_double_click: Optional[EventType[[], BASE_STATE]] = None,
149
+ on_focus: Optional[EventType[[], BASE_STATE]] = None,
150
+ on_mount: Optional[EventType[[], BASE_STATE]] = None,
151
+ on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
152
+ on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
153
+ on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
154
+ on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
155
+ on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
156
+ on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
157
+ on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
158
+ on_scroll: Optional[EventType[[], BASE_STATE]] = None,
159
+ on_unmount: Optional[EventType[[], BASE_STATE]] = None,
161
160
  **props,
162
161
  ) -> "Legend":
163
162
  """Create the component.
@@ -175,6 +174,14 @@ class Legend(Recharts):
175
174
  chart_width: The width of chart container, usually calculated internally.
176
175
  chart_height: The height of chart container, usually calculated internally.
177
176
  margin: The margin of chart container, usually calculated internally.
177
+ on_click: The customized event handler of click on the items in this group
178
+ on_mouse_down: The customized event handler of mousedown on the items in this group
179
+ on_mouse_up: The customized event handler of mouseup on the items in this group
180
+ on_mouse_move: The customized event handler of mousemove on the items in this group
181
+ on_mouse_over: The customized event handler of mouseover on the items in this group
182
+ on_mouse_out: The customized event handler of mouseout on the items in this group
183
+ on_mouse_enter: The customized event handler of mouseenter on the items in this group
184
+ on_mouse_leave: The customized event handler of mouseleave on the items in this group
178
185
  style: The style of the component.
179
186
  key: A unique key for the component.
180
187
  id: The id for the component.
@@ -224,44 +231,44 @@ class GraphingTooltip(Recharts):
224
231
  id: Optional[Any] = None,
225
232
  class_name: Optional[Any] = None,
226
233
  autofocus: Optional[bool] = None,
227
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
228
- on_blur: Optional[EventType[[]]] = None,
229
- on_click: Optional[EventType[[]]] = None,
230
- on_context_menu: Optional[EventType[[]]] = None,
231
- on_double_click: Optional[EventType[[]]] = None,
232
- on_focus: Optional[EventType[[]]] = None,
233
- on_mount: Optional[EventType[[]]] = None,
234
- on_mouse_down: Optional[EventType[[]]] = None,
235
- on_mouse_enter: Optional[EventType[[]]] = None,
236
- on_mouse_leave: Optional[EventType[[]]] = None,
237
- on_mouse_move: Optional[EventType[[]]] = None,
238
- on_mouse_out: Optional[EventType[[]]] = None,
239
- on_mouse_over: Optional[EventType[[]]] = None,
240
- on_mouse_up: Optional[EventType[[]]] = None,
241
- on_scroll: Optional[EventType[[]]] = None,
242
- on_unmount: Optional[EventType[[]]] = None,
234
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
235
+ on_blur: Optional[EventType[[], BASE_STATE]] = None,
236
+ on_click: Optional[EventType[[], BASE_STATE]] = None,
237
+ on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
238
+ on_double_click: Optional[EventType[[], BASE_STATE]] = None,
239
+ on_focus: Optional[EventType[[], BASE_STATE]] = None,
240
+ on_mount: Optional[EventType[[], BASE_STATE]] = None,
241
+ on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
242
+ on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
243
+ on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
244
+ on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
245
+ on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
246
+ on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
247
+ on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
248
+ on_scroll: Optional[EventType[[], BASE_STATE]] = None,
249
+ on_unmount: Optional[EventType[[], BASE_STATE]] = None,
243
250
  **props,
244
251
  ) -> "GraphingTooltip":
245
252
  """Create the component.
246
253
 
247
254
  Args:
248
255
  *children: The children of the component.
249
- separator: The separator between name and value.
250
- offset: The offset size of tooltip. Number
251
- filter_null: When an item of the payload has value null or undefined, this item won't be displayed.
252
- cursor: If set false, no cursor will be drawn when tooltip is active.
256
+ separator: The separator between name and value. Default: ":"
257
+ offset: The offset size of tooltip. Number. Default: 10
258
+ filter_null: When an item of the payload has value null or undefined, this item won't be displayed. Default: True
259
+ cursor: If set false, no cursor will be drawn when tooltip is active. Default: {"strokeWidth": 1, "fill": rx.color("gray", 3)}
253
260
  view_box: The box of viewing area, which has the shape of {x: someVal, y: someVal, width: someVal, height: someVal}, usually calculated internally.
254
- item_style: The style of default tooltip content item which is a li element. DEFAULT: {}
255
- wrapper_style: The style of tooltip wrapper which is a dom element. DEFAULT: {}
256
- content_style: The style of tooltip content which is a dom element. DEFAULT: {}
257
- label_style: The style of default tooltip label which is a p element. DEFAULT: {}
258
- allow_escape_view_box: This option allows the tooltip to extend beyond the viewBox of the chart itself. DEFAULT: { x: false, y: false }
259
- active: If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally.
261
+ item_style: The style of default tooltip content item which is a li element. Default: {"color": rx.color("gray", 12)}
262
+ wrapper_style: The style of tooltip wrapper which is a dom element. Default: {}
263
+ content_style: The style of tooltip content which is a dom element. Default: {"background": rx.color("gray", 1), "borderColor": rx.color("gray", 4), "borderRadius": "8px"}
264
+ label_style: The style of default tooltip label which is a p element. Default: {"color": rx.color("gray", 11)}
265
+ allow_escape_view_box: This option allows the tooltip to extend beyond the viewBox of the chart itself. Default: {"x": False, "y": False}
266
+ active: If set true, the tooltip is displayed. If set false, the tooltip is hidden, usually calculated internally. Default: False
260
267
  position: If this field is set, the tooltip position will be fixed and will not move anymore.
261
- coordinate: The coordinate of tooltip which is usually calculated internally.
262
- is_animation_active: If set false, animation of tooltip will be disabled. DEFAULT: true in CSR, and false in SSR
263
- animation_duration: Specifies the duration of animation, the unit of this option is ms. DEFAULT: 1500
264
- animation_easing: The type of easing function. DEFAULT: 'ease'
268
+ coordinate: The coordinate of tooltip which is usually calculated internally. Default: {"x": 0, "y": 0}
269
+ is_animation_active: If set false, animation of tooltip will be disabled. Default: True
270
+ animation_duration: Specifies the duration of animation, the unit of this option is ms. Default: 1500
271
+ animation_easing: The type of easing function. Default: "ease"
265
272
  style: The style of the component.
266
273
  key: A unique key for the component.
267
274
  id: The id for the component.
@@ -335,22 +342,22 @@ class Label(Recharts):
335
342
  id: Optional[Any] = None,
336
343
  class_name: Optional[Any] = None,
337
344
  autofocus: Optional[bool] = None,
338
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
339
- on_blur: Optional[EventType[[]]] = None,
340
- on_click: Optional[EventType[[]]] = None,
341
- on_context_menu: Optional[EventType[[]]] = None,
342
- on_double_click: Optional[EventType[[]]] = None,
343
- on_focus: Optional[EventType[[]]] = None,
344
- on_mount: Optional[EventType[[]]] = None,
345
- on_mouse_down: Optional[EventType[[]]] = None,
346
- on_mouse_enter: Optional[EventType[[]]] = None,
347
- on_mouse_leave: Optional[EventType[[]]] = None,
348
- on_mouse_move: Optional[EventType[[]]] = None,
349
- on_mouse_out: Optional[EventType[[]]] = None,
350
- on_mouse_over: Optional[EventType[[]]] = None,
351
- on_mouse_up: Optional[EventType[[]]] = None,
352
- on_scroll: Optional[EventType[[]]] = None,
353
- on_unmount: Optional[EventType[[]]] = None,
345
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
346
+ on_blur: Optional[EventType[[], BASE_STATE]] = None,
347
+ on_click: Optional[EventType[[], BASE_STATE]] = None,
348
+ on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
349
+ on_double_click: Optional[EventType[[], BASE_STATE]] = None,
350
+ on_focus: Optional[EventType[[], BASE_STATE]] = None,
351
+ on_mount: Optional[EventType[[], BASE_STATE]] = None,
352
+ on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
353
+ on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
354
+ on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
355
+ on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
356
+ on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
357
+ on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
358
+ on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
359
+ on_scroll: Optional[EventType[[], BASE_STATE]] = None,
360
+ on_unmount: Optional[EventType[[], BASE_STATE]] = None,
354
361
  **props,
355
362
  ) -> "Label":
356
363
  """Create the component.
@@ -435,22 +442,22 @@ class LabelList(Recharts):
435
442
  id: Optional[Any] = None,
436
443
  class_name: Optional[Any] = None,
437
444
  autofocus: Optional[bool] = None,
438
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
439
- on_blur: Optional[EventType[[]]] = None,
440
- on_click: Optional[EventType[[]]] = None,
441
- on_context_menu: Optional[EventType[[]]] = None,
442
- on_double_click: Optional[EventType[[]]] = None,
443
- on_focus: Optional[EventType[[]]] = None,
444
- on_mount: Optional[EventType[[]]] = None,
445
- on_mouse_down: Optional[EventType[[]]] = None,
446
- on_mouse_enter: Optional[EventType[[]]] = None,
447
- on_mouse_leave: Optional[EventType[[]]] = None,
448
- on_mouse_move: Optional[EventType[[]]] = None,
449
- on_mouse_out: Optional[EventType[[]]] = None,
450
- on_mouse_over: Optional[EventType[[]]] = None,
451
- on_mouse_up: Optional[EventType[[]]] = None,
452
- on_scroll: Optional[EventType[[]]] = None,
453
- on_unmount: Optional[EventType[[]]] = None,
445
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
446
+ on_blur: Optional[EventType[[], BASE_STATE]] = None,
447
+ on_click: Optional[EventType[[], BASE_STATE]] = None,
448
+ on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
449
+ on_double_click: Optional[EventType[[], BASE_STATE]] = None,
450
+ on_focus: Optional[EventType[[], BASE_STATE]] = None,
451
+ on_mount: Optional[EventType[[], BASE_STATE]] = None,
452
+ on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
453
+ on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
454
+ on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
455
+ on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
456
+ on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
457
+ on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
458
+ on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
459
+ on_scroll: Optional[EventType[[], BASE_STATE]] = None,
460
+ on_unmount: Optional[EventType[[], BASE_STATE]] = None,
454
461
  **props,
455
462
  ) -> "LabelList":
456
463
  """Create the component.
@@ -6,7 +6,7 @@ from typing import Any, Dict, List, Union
6
6
 
7
7
  from reflex.constants import EventTriggers
8
8
  from reflex.constants.colors import Color
9
- from reflex.event import EventHandler, empty_event
9
+ from reflex.event import EventHandler, no_args_event_spec
10
10
  from reflex.vars.base import LiteralVar, Var
11
11
 
12
12
  from .recharts import (
@@ -103,14 +103,14 @@ class Pie(Recharts):
103
103
  A dict mapping the event trigger to the var that is passed to the handler.
104
104
  """
105
105
  return {
106
- EventTriggers.ON_ANIMATION_START: empty_event,
107
- EventTriggers.ON_ANIMATION_END: empty_event,
108
- EventTriggers.ON_CLICK: empty_event,
109
- EventTriggers.ON_MOUSE_MOVE: empty_event,
110
- EventTriggers.ON_MOUSE_OVER: empty_event,
111
- EventTriggers.ON_MOUSE_OUT: empty_event,
112
- EventTriggers.ON_MOUSE_ENTER: empty_event,
113
- EventTriggers.ON_MOUSE_LEAVE: empty_event,
106
+ EventTriggers.ON_ANIMATION_START: no_args_event_spec,
107
+ EventTriggers.ON_ANIMATION_END: no_args_event_spec,
108
+ EventTriggers.ON_CLICK: no_args_event_spec,
109
+ EventTriggers.ON_MOUSE_MOVE: no_args_event_spec,
110
+ EventTriggers.ON_MOUSE_OVER: no_args_event_spec,
111
+ EventTriggers.ON_MOUSE_OUT: no_args_event_spec,
112
+ EventTriggers.ON_MOUSE_ENTER: no_args_event_spec,
113
+ EventTriggers.ON_MOUSE_LEAVE: no_args_event_spec,
114
114
  }
115
115
 
116
116
 
@@ -167,8 +167,8 @@ class Radar(Recharts):
167
167
  A dict mapping the event trigger to the var that is passed to the handler.
168
168
  """
169
169
  return {
170
- EventTriggers.ON_ANIMATION_START: empty_event,
171
- EventTriggers.ON_ANIMATION_END: empty_event,
170
+ EventTriggers.ON_ANIMATION_START: no_args_event_spec,
171
+ EventTriggers.ON_ANIMATION_END: no_args_event_spec,
172
172
  }
173
173
 
174
174
 
@@ -219,14 +219,14 @@ class RadialBar(Recharts):
219
219
  A dict mapping the event trigger to the var that is passed to the handler.
220
220
  """
221
221
  return {
222
- EventTriggers.ON_CLICK: empty_event,
223
- EventTriggers.ON_MOUSE_MOVE: empty_event,
224
- EventTriggers.ON_MOUSE_OVER: empty_event,
225
- EventTriggers.ON_MOUSE_OUT: empty_event,
226
- EventTriggers.ON_MOUSE_ENTER: empty_event,
227
- EventTriggers.ON_MOUSE_LEAVE: empty_event,
228
- EventTriggers.ON_ANIMATION_START: empty_event,
229
- EventTriggers.ON_ANIMATION_END: empty_event,
222
+ EventTriggers.ON_CLICK: no_args_event_spec,
223
+ EventTriggers.ON_MOUSE_MOVE: no_args_event_spec,
224
+ EventTriggers.ON_MOUSE_OVER: no_args_event_spec,
225
+ EventTriggers.ON_MOUSE_OUT: no_args_event_spec,
226
+ EventTriggers.ON_MOUSE_ENTER: no_args_event_spec,
227
+ EventTriggers.ON_MOUSE_LEAVE: no_args_event_spec,
228
+ EventTriggers.ON_ANIMATION_START: no_args_event_spec,
229
+ EventTriggers.ON_ANIMATION_END: no_args_event_spec,
230
230
  }
231
231
 
232
232
 
@@ -277,28 +277,28 @@ class PolarAngleAxis(Recharts):
277
277
  _valid_children: List[str] = ["Label"]
278
278
 
279
279
  # The customized event handler of click on the ticks of this axis.
280
- on_click: EventHandler[empty_event]
280
+ on_click: EventHandler[no_args_event_spec]
281
281
 
282
282
  # The customized event handler of mousedown on the the ticks of this axis.
283
- on_mouse_down: EventHandler[empty_event]
283
+ on_mouse_down: EventHandler[no_args_event_spec]
284
284
 
285
285
  # The customized event handler of mouseup on the ticks of this axis.
286
- on_mouse_up: EventHandler[empty_event]
286
+ on_mouse_up: EventHandler[no_args_event_spec]
287
287
 
288
288
  # The customized event handler of mousemove on the ticks of this axis.
289
- on_mouse_move: EventHandler[empty_event]
289
+ on_mouse_move: EventHandler[no_args_event_spec]
290
290
 
291
291
  # The customized event handler of mouseover on the ticks of this axis.
292
- on_mouse_over: EventHandler[empty_event]
292
+ on_mouse_over: EventHandler[no_args_event_spec]
293
293
 
294
294
  # The customized event handler of mouseout on the ticks of this axis.
295
- on_mouse_out: EventHandler[empty_event]
295
+ on_mouse_out: EventHandler[no_args_event_spec]
296
296
 
297
297
  # The customized event handler of moustenter on the ticks of this axis.
298
- on_mouse_enter: EventHandler[empty_event]
298
+ on_mouse_enter: EventHandler[no_args_event_spec]
299
299
 
300
300
  # The customized event handler of mouseleave on the ticks of this axis.
301
- on_mouse_leave: EventHandler[empty_event]
301
+ on_mouse_leave: EventHandler[no_args_event_spec]
302
302
 
303
303
 
304
304
  class PolarGrid(Recharts):
@@ -392,12 +392,12 @@ class PolarRadiusAxis(Recharts):
392
392
  A dict mapping the event trigger to the var that is passed to the handler.
393
393
  """
394
394
  return {
395
- EventTriggers.ON_CLICK: empty_event,
396
- EventTriggers.ON_MOUSE_MOVE: empty_event,
397
- EventTriggers.ON_MOUSE_OVER: empty_event,
398
- EventTriggers.ON_MOUSE_OUT: empty_event,
399
- EventTriggers.ON_MOUSE_ENTER: empty_event,
400
- EventTriggers.ON_MOUSE_LEAVE: empty_event,
395
+ EventTriggers.ON_CLICK: no_args_event_spec,
396
+ EventTriggers.ON_MOUSE_MOVE: no_args_event_spec,
397
+ EventTriggers.ON_MOUSE_OVER: no_args_event_spec,
398
+ EventTriggers.ON_MOUSE_OUT: no_args_event_spec,
399
+ EventTriggers.ON_MOUSE_ENTER: no_args_event_spec,
400
+ EventTriggers.ON_MOUSE_LEAVE: no_args_event_spec,
401
401
  }
402
402
 
403
403