reflex 0.5.10a3__py3-none-any.whl → 0.6.0a1__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 (237) hide show
  1. reflex/.templates/jinja/web/pages/utils.js.jinja2 +4 -4
  2. reflex/.templates/jinja/web/utils/context.js.jinja2 +1 -1
  3. reflex/.templates/jinja/web/utils/theme.js.jinja2 +1 -1
  4. reflex/__init__.py +3 -2
  5. reflex/__init__.pyi +2 -2
  6. reflex/app.py +43 -9
  7. reflex/base.py +3 -2
  8. reflex/compiler/compiler.py +6 -6
  9. reflex/compiler/utils.py +5 -3
  10. reflex/components/base/app_wrap.py +2 -4
  11. reflex/components/base/app_wrap.pyi +17 -17
  12. reflex/components/base/bare.py +7 -4
  13. reflex/components/base/body.pyi +17 -17
  14. reflex/components/base/document.pyi +81 -81
  15. reflex/components/base/error_boundary.py +10 -8
  16. reflex/components/base/error_boundary.pyi +20 -19
  17. reflex/components/base/fragment.pyi +17 -17
  18. reflex/components/base/head.pyi +33 -33
  19. reflex/components/base/link.pyi +34 -33
  20. reflex/components/base/meta.pyi +65 -65
  21. reflex/components/base/script.py +2 -1
  22. reflex/components/base/script.pyi +21 -20
  23. reflex/components/component.py +116 -145
  24. reflex/components/core/banner.py +59 -60
  25. reflex/components/core/banner.pyi +86 -150
  26. reflex/components/core/client_side_routing.py +2 -1
  27. reflex/components/core/client_side_routing.pyi +34 -33
  28. reflex/components/core/clipboard.py +2 -2
  29. reflex/components/core/clipboard.pyi +19 -18
  30. reflex/components/core/cond.py +21 -44
  31. reflex/components/core/debounce.py +6 -8
  32. reflex/components/core/debounce.pyi +19 -18
  33. reflex/components/core/foreach.py +5 -14
  34. reflex/components/core/html.pyi +18 -17
  35. reflex/components/core/match.py +36 -43
  36. reflex/components/core/upload.py +32 -25
  37. reflex/components/core/upload.pyi +84 -73
  38. reflex/components/datadisplay/code.py +55 -28
  39. reflex/components/datadisplay/code.pyi +20 -17
  40. reflex/components/datadisplay/dataeditor.py +17 -11
  41. reflex/components/datadisplay/dataeditor.pyi +34 -33
  42. reflex/components/el/__init__.py +0 -1
  43. reflex/components/el/__init__.pyi +0 -11
  44. reflex/components/el/element.pyi +17 -17
  45. reflex/components/el/elements/__init__.py +1 -7
  46. reflex/components/el/elements/__init__.pyi +1 -15
  47. reflex/components/el/elements/base.pyi +18 -17
  48. reflex/components/el/elements/forms.py +24 -31
  49. reflex/components/el/elements/forms.pyi +237 -236
  50. reflex/components/el/elements/inline.pyi +450 -449
  51. reflex/components/el/elements/media.py +0 -21
  52. reflex/components/el/elements/media.pyi +338 -337
  53. reflex/components/el/elements/metadata.py +3 -2
  54. reflex/components/el/elements/metadata.pyi +98 -97
  55. reflex/components/el/elements/other.pyi +114 -113
  56. reflex/components/el/elements/scripts.pyi +50 -49
  57. reflex/components/el/elements/sectioning.pyi +242 -241
  58. reflex/components/el/elements/tables.pyi +162 -161
  59. reflex/components/el/elements/typography.pyi +242 -241
  60. reflex/components/gridjs/datatable.py +13 -14
  61. reflex/components/gridjs/datatable.pyi +34 -33
  62. reflex/components/lucide/icon.py +2 -126
  63. reflex/components/lucide/icon.pyi +34 -142
  64. reflex/components/markdown/markdown.py +30 -35
  65. reflex/components/markdown/markdown.pyi +29 -32
  66. reflex/components/moment/moment.pyi +19 -18
  67. reflex/components/next/base.pyi +17 -17
  68. reflex/components/next/image.py +0 -4
  69. reflex/components/next/image.pyi +20 -19
  70. reflex/components/next/link.pyi +18 -17
  71. reflex/components/next/video.pyi +18 -17
  72. reflex/components/plotly/plotly.py +16 -28
  73. reflex/components/plotly/plotly.pyi +36 -35
  74. reflex/components/props.py +21 -10
  75. reflex/components/radix/__init__.pyi +1 -1
  76. reflex/components/radix/primitives/__init__.pyi +0 -1
  77. reflex/components/radix/primitives/accordion.py +7 -8
  78. reflex/components/radix/primitives/accordion.pyi +117 -116
  79. reflex/components/radix/primitives/base.pyi +34 -33
  80. reflex/components/radix/primitives/drawer.pyi +169 -168
  81. reflex/components/radix/primitives/form.pyi +168 -167
  82. reflex/components/radix/primitives/progress.pyi +82 -81
  83. reflex/components/radix/primitives/slider.pyi +84 -83
  84. reflex/components/radix/themes/base.py +8 -4
  85. reflex/components/radix/themes/base.pyi +114 -113
  86. reflex/components/radix/themes/color_mode.py +12 -21
  87. reflex/components/radix/themes/color_mode.pyi +67 -67
  88. reflex/components/radix/themes/components/__init__.pyi +1 -0
  89. reflex/components/radix/themes/components/alert_dialog.pyi +118 -117
  90. reflex/components/radix/themes/components/aspect_ratio.pyi +18 -17
  91. reflex/components/radix/themes/components/avatar.pyi +18 -17
  92. reflex/components/radix/themes/components/badge.pyi +18 -17
  93. reflex/components/radix/themes/components/button.pyi +18 -17
  94. reflex/components/radix/themes/components/callout.pyi +82 -81
  95. reflex/components/radix/themes/components/card.pyi +18 -17
  96. reflex/components/radix/themes/components/checkbox.py +2 -3
  97. reflex/components/radix/themes/components/checkbox.pyi +53 -52
  98. reflex/components/radix/themes/components/checkbox_cards.pyi +34 -33
  99. reflex/components/radix/themes/components/checkbox_group.pyi +34 -33
  100. reflex/components/radix/themes/components/context_menu.pyi +140 -139
  101. reflex/components/radix/themes/components/data_list.py +5 -0
  102. reflex/components/radix/themes/components/data_list.pyi +71 -65
  103. reflex/components/radix/themes/components/dialog.pyi +121 -120
  104. reflex/components/radix/themes/components/dropdown_menu.pyi +142 -141
  105. reflex/components/radix/themes/components/hover_card.pyi +68 -67
  106. reflex/components/radix/themes/components/icon_button.py +2 -1
  107. reflex/components/radix/themes/components/icon_button.pyi +18 -17
  108. reflex/components/radix/themes/components/inset.pyi +18 -17
  109. reflex/components/radix/themes/components/popover.pyi +73 -72
  110. reflex/components/radix/themes/components/progress.pyi +18 -17
  111. reflex/components/radix/themes/components/radio.pyi +18 -17
  112. reflex/components/radix/themes/components/radio_cards.pyi +35 -34
  113. reflex/components/radix/themes/components/radio_group.py +35 -31
  114. reflex/components/radix/themes/components/radio_group.pyi +73 -66
  115. reflex/components/radix/themes/components/scroll_area.pyi +18 -17
  116. reflex/components/radix/themes/components/segmented_control.pyi +35 -34
  117. reflex/components/radix/themes/components/select.py +2 -1
  118. reflex/components/radix/themes/components/select.pyi +155 -154
  119. reflex/components/radix/themes/components/separator.py +2 -3
  120. reflex/components/radix/themes/components/separator.pyi +18 -17
  121. reflex/components/radix/themes/components/skeleton.pyi +18 -17
  122. reflex/components/radix/themes/components/slider.py +2 -1
  123. reflex/components/radix/themes/components/slider.pyi +20 -19
  124. reflex/components/radix/themes/components/spinner.pyi +18 -17
  125. reflex/components/radix/themes/components/switch.pyi +19 -18
  126. reflex/components/radix/themes/components/table.pyi +114 -113
  127. reflex/components/radix/themes/components/tabs.pyi +84 -83
  128. reflex/components/radix/themes/components/text_area.pyi +21 -20
  129. reflex/components/radix/themes/components/text_field.py +0 -79
  130. reflex/components/radix/themes/components/text_field.pyi +57 -63
  131. reflex/components/radix/themes/components/tooltip.pyi +21 -20
  132. reflex/components/radix/themes/layout/base.pyi +18 -17
  133. reflex/components/radix/themes/layout/box.pyi +18 -17
  134. reflex/components/radix/themes/layout/center.pyi +18 -17
  135. reflex/components/radix/themes/layout/container.py +2 -3
  136. reflex/components/radix/themes/layout/container.pyi +18 -17
  137. reflex/components/radix/themes/layout/flex.pyi +18 -17
  138. reflex/components/radix/themes/layout/grid.pyi +18 -17
  139. reflex/components/radix/themes/layout/list.py +5 -4
  140. reflex/components/radix/themes/layout/list.pyi +86 -85
  141. reflex/components/radix/themes/layout/section.py +2 -3
  142. reflex/components/radix/themes/layout/section.pyi +18 -17
  143. reflex/components/radix/themes/layout/spacer.pyi +18 -17
  144. reflex/components/radix/themes/layout/stack.pyi +50 -49
  145. reflex/components/radix/themes/typography/blockquote.pyi +18 -17
  146. reflex/components/radix/themes/typography/code.pyi +18 -17
  147. reflex/components/radix/themes/typography/heading.pyi +18 -17
  148. reflex/components/radix/themes/typography/link.pyi +18 -17
  149. reflex/components/radix/themes/typography/text.pyi +114 -113
  150. reflex/components/react_player/audio.pyi +34 -33
  151. reflex/components/react_player/react_player.pyi +34 -33
  152. reflex/components/react_player/video.pyi +34 -33
  153. reflex/components/recharts/cartesian.py +23 -19
  154. reflex/components/recharts/cartesian.pyi +297 -296
  155. reflex/components/recharts/charts.py +6 -5
  156. reflex/components/recharts/charts.pyi +179 -178
  157. reflex/components/recharts/general.py +8 -7
  158. reflex/components/recharts/general.pyi +82 -81
  159. reflex/components/recharts/polar.py +14 -13
  160. reflex/components/recharts/polar.pyi +76 -75
  161. reflex/components/recharts/recharts.pyi +33 -33
  162. reflex/components/sonner/toast.py +30 -33
  163. reflex/components/sonner/toast.pyi +27 -25
  164. reflex/components/suneditor/editor.py +2 -1
  165. reflex/components/suneditor/editor.pyi +27 -26
  166. reflex/components/tags/iter_tag.py +16 -16
  167. reflex/components/tags/tag.py +8 -10
  168. reflex/constants/base.py +3 -1
  169. reflex/constants/event.py +1 -0
  170. reflex/event.py +89 -79
  171. reflex/experimental/__init__.py +25 -6
  172. reflex/experimental/client_state.py +34 -58
  173. reflex/experimental/hooks.py +13 -18
  174. reflex/experimental/layout.py +5 -5
  175. reflex/experimental/layout.pyi +84 -83
  176. reflex/{experimental/vars → ivars}/__init__.py +0 -1
  177. reflex/ivars/base.py +2180 -0
  178. reflex/ivars/function.py +200 -0
  179. reflex/ivars/number.py +1137 -0
  180. reflex/ivars/object.py +564 -0
  181. reflex/ivars/sequence.py +1601 -0
  182. reflex/model.py +22 -0
  183. reflex/reflex.py +4 -0
  184. reflex/state.py +388 -73
  185. reflex/style.py +52 -34
  186. reflex/testing.py +8 -3
  187. reflex/utils/exceptions.py +12 -0
  188. reflex/utils/exec.py +0 -14
  189. reflex/utils/format.py +74 -223
  190. reflex/utils/net.py +43 -0
  191. reflex/utils/path_ops.py +13 -1
  192. reflex/utils/prerequisites.py +46 -26
  193. reflex/utils/pyi_generator.py +5 -4
  194. reflex/utils/serializers.py +13 -31
  195. reflex/utils/types.py +44 -9
  196. reflex/vars.py +127 -2230
  197. {reflex-0.5.10a3.dist-info → reflex-0.6.0a1.dist-info}/METADATA +4 -6
  198. reflex-0.6.0a1.dist-info/RECORD +384 -0
  199. reflex/.templates/apps/demo/.gitignore +0 -4
  200. reflex/.templates/apps/demo/assets/favicon.ico +0 -0
  201. reflex/.templates/apps/demo/assets/github.svg +0 -10
  202. reflex/.templates/apps/demo/assets/icon.svg +0 -37
  203. reflex/.templates/apps/demo/assets/logo.svg +0 -68
  204. reflex/.templates/apps/demo/assets/paneleft.svg +0 -13
  205. reflex/.templates/apps/demo/code/__init__.py +0 -1
  206. reflex/.templates/apps/demo/code/demo.py +0 -127
  207. reflex/.templates/apps/demo/code/pages/__init__.py +0 -7
  208. reflex/.templates/apps/demo/code/pages/chatapp.py +0 -31
  209. reflex/.templates/apps/demo/code/pages/datatable.py +0 -360
  210. reflex/.templates/apps/demo/code/pages/forms.py +0 -257
  211. reflex/.templates/apps/demo/code/pages/graphing.py +0 -253
  212. reflex/.templates/apps/demo/code/pages/home.py +0 -56
  213. reflex/.templates/apps/demo/code/sidebar.py +0 -178
  214. reflex/.templates/apps/demo/code/state.py +0 -22
  215. reflex/.templates/apps/demo/code/states/form_state.py +0 -40
  216. reflex/.templates/apps/demo/code/states/pie_state.py +0 -47
  217. reflex/.templates/apps/demo/code/styles.py +0 -68
  218. reflex/.templates/apps/demo/code/webui/__init__.py +0 -0
  219. reflex/.templates/apps/demo/code/webui/components/__init__.py +0 -4
  220. reflex/.templates/apps/demo/code/webui/components/chat.py +0 -118
  221. reflex/.templates/apps/demo/code/webui/components/loading_icon.py +0 -19
  222. reflex/.templates/apps/demo/code/webui/components/modal.py +0 -56
  223. reflex/.templates/apps/demo/code/webui/components/navbar.py +0 -70
  224. reflex/.templates/apps/demo/code/webui/components/sidebar.py +0 -66
  225. reflex/.templates/apps/demo/code/webui/state.py +0 -146
  226. reflex/.templates/apps/demo/code/webui/styles.py +0 -88
  227. reflex/experimental/vars/base.py +0 -583
  228. reflex/experimental/vars/function.py +0 -290
  229. reflex/experimental/vars/number.py +0 -1458
  230. reflex/experimental/vars/object.py +0 -804
  231. reflex/experimental/vars/sequence.py +0 -1764
  232. reflex/utils/watch.py +0 -96
  233. reflex/vars.pyi +0 -218
  234. reflex-0.5.10a3.dist-info/RECORD +0 -413
  235. {reflex-0.5.10a3.dist-info → reflex-0.6.0a1.dist-info}/LICENSE +0 -0
  236. {reflex-0.5.10a3.dist-info → reflex-0.6.0a1.dist-info}/WHEEL +0 -0
  237. {reflex-0.5.10a3.dist-info → reflex-0.6.0a1.dist-info}/entry_points.txt +0 -0
@@ -6,10 +6,11 @@ from typing import Any, Dict, List, Union
6
6
 
7
7
  from reflex.components.component import Component
8
8
  from reflex.components.tags import Tag
9
+ from reflex.ivars.base import ImmutableVar, LiteralVar, is_computed_var
9
10
  from reflex.utils import types
10
11
  from reflex.utils.imports import ImportDict
11
12
  from reflex.utils.serializers import serialize
12
- from reflex.vars import BaseVar, ComputedVar, Var
13
+ from reflex.vars import Var
13
14
 
14
15
 
15
16
  class Gridjs(Component):
@@ -65,14 +66,14 @@ class DataTable(Gridjs):
65
66
 
66
67
  # The annotation should be provided if data is a computed var. We need this to know how to
67
68
  # render pandas dataframes.
68
- if isinstance(data, ComputedVar) and data._var_type == Any:
69
+ if is_computed_var(data) and data._var_type == Any:
69
70
  raise ValueError(
70
71
  "Annotation of the computed var assigned to the data field should be provided."
71
72
  )
72
73
 
73
74
  if (
74
75
  columns is not None
75
- and isinstance(columns, ComputedVar)
76
+ and is_computed_var(columns)
76
77
  and columns._var_type == Any
77
78
  ):
78
79
  raise ValueError(
@@ -82,7 +83,7 @@ class DataTable(Gridjs):
82
83
  # If data is a pandas dataframe and columns are provided throw an error.
83
84
  if (
84
85
  types.is_dataframe(type(data))
85
- or (isinstance(data, Var) and types.is_dataframe(data._var_type))
86
+ or (isinstance(data, ImmutableVar) and types.is_dataframe(data._var_type))
86
87
  ) and columns is not None:
87
88
  raise ValueError(
88
89
  "Cannot pass in both a pandas dataframe and columns to the data_table component."
@@ -90,7 +91,7 @@ class DataTable(Gridjs):
90
91
 
91
92
  # If data is a list and columns are not provided, throw an error
92
93
  if (
93
- (isinstance(data, Var) and types._issubclass(data._var_type, List))
94
+ (isinstance(data, ImmutableVar) and types._issubclass(data._var_type, List))
94
95
  or issubclass(type(data), List)
95
96
  ) and columns is None:
96
97
  raise ValueError(
@@ -112,25 +113,23 @@ class DataTable(Gridjs):
112
113
  return {"": "gridjs/dist/theme/mermaid.css"}
113
114
 
114
115
  def _render(self) -> Tag:
115
- if isinstance(self.data, Var) and types.is_dataframe(self.data._var_type):
116
- self.columns = BaseVar(
116
+ if isinstance(self.data, ImmutableVar) and types.is_dataframe(
117
+ self.data._var_type
118
+ ):
119
+ self.columns = self.data._replace(
117
120
  _var_name=f"{self.data._var_name}.columns",
118
121
  _var_type=List[Any],
119
- _var_full_name_needs_state_prefix=True,
120
- _var_data=self.data._var_data,
121
122
  )
122
- self.data = BaseVar(
123
+ self.data = self.data._replace(
123
124
  _var_name=f"{self.data._var_name}.data",
124
125
  _var_type=List[List[Any]],
125
- _var_full_name_needs_state_prefix=True,
126
- _var_data=self.data._var_data,
127
126
  )
128
127
  if types.is_dataframe(type(self.data)):
129
128
  # If given a pandas df break up the data and columns
130
129
  data = serialize(self.data)
131
130
  assert isinstance(data, dict), "Serialized dataframe should be a dict."
132
- self.columns = Var.create_safe(data["columns"])
133
- self.data = Var.create_safe(data["data"])
131
+ self.columns = LiteralVar.create(data["columns"])
132
+ self.data = LiteralVar.create(data["data"])
134
133
 
135
134
  # Render the table.
136
135
  return super()._render()
@@ -7,9 +7,10 @@ from typing import Any, Callable, Dict, List, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import Component
9
9
  from reflex.event import EventHandler, EventSpec
10
+ from reflex.ivars.base import ImmutableVar
10
11
  from reflex.style import Style
11
12
  from reflex.utils.imports import ImportDict
12
- from reflex.vars import BaseVar, Var
13
+ from reflex.vars import Var
13
14
 
14
15
  class Gridjs(Component):
15
16
  @overload
@@ -22,51 +23,51 @@ class Gridjs(Component):
22
23
  id: Optional[Any] = None,
23
24
  class_name: Optional[Any] = None,
24
25
  autofocus: Optional[bool] = None,
25
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
26
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
26
27
  on_blur: Optional[
27
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
28
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
28
29
  ] = None,
29
30
  on_click: Optional[
30
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
31
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
31
32
  ] = None,
32
33
  on_context_menu: Optional[
33
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
34
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
34
35
  ] = None,
35
36
  on_double_click: Optional[
36
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
37
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
37
38
  ] = None,
38
39
  on_focus: Optional[
39
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
40
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
40
41
  ] = None,
41
42
  on_mount: Optional[
42
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
43
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
43
44
  ] = None,
44
45
  on_mouse_down: Optional[
45
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
46
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
46
47
  ] = None,
47
48
  on_mouse_enter: Optional[
48
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
49
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
49
50
  ] = None,
50
51
  on_mouse_leave: Optional[
51
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
52
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
52
53
  ] = None,
53
54
  on_mouse_move: Optional[
54
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
55
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
55
56
  ] = None,
56
57
  on_mouse_out: Optional[
57
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
58
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
58
59
  ] = None,
59
60
  on_mouse_over: Optional[
60
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
61
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
61
62
  ] = None,
62
63
  on_mouse_up: Optional[
63
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
64
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
64
65
  ] = None,
65
66
  on_scroll: Optional[
66
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
67
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
67
68
  ] = None,
68
69
  on_unmount: Optional[
69
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
70
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
70
71
  ] = None,
71
72
  **props,
72
73
  ) -> "Gridjs":
@@ -104,51 +105,51 @@ class DataTable(Gridjs):
104
105
  id: Optional[Any] = None,
105
106
  class_name: Optional[Any] = None,
106
107
  autofocus: Optional[bool] = None,
107
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
108
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
108
109
  on_blur: Optional[
109
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
110
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
110
111
  ] = None,
111
112
  on_click: Optional[
112
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
113
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
113
114
  ] = None,
114
115
  on_context_menu: Optional[
115
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
116
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
116
117
  ] = None,
117
118
  on_double_click: Optional[
118
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
119
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
119
120
  ] = None,
120
121
  on_focus: Optional[
121
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
122
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
122
123
  ] = None,
123
124
  on_mount: Optional[
124
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
125
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
125
126
  ] = None,
126
127
  on_mouse_down: Optional[
127
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
128
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
128
129
  ] = None,
129
130
  on_mouse_enter: Optional[
130
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
131
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
131
132
  ] = None,
132
133
  on_mouse_leave: Optional[
133
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
134
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
134
135
  ] = None,
135
136
  on_mouse_move: Optional[
136
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
137
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
137
138
  ] = None,
138
139
  on_mouse_out: Optional[
139
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
140
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
140
141
  ] = None,
141
142
  on_mouse_over: Optional[
142
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
143
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
143
144
  ] = None,
144
145
  on_mouse_up: Optional[
145
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
146
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
146
147
  ] = None,
147
148
  on_scroll: Optional[
148
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
149
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
149
150
  ] = None,
150
151
  on_unmount: Optional[
151
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
152
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
152
153
  ] = None,
153
154
  **props,
154
155
  ) -> "DataTable":
@@ -1,7 +1,7 @@
1
1
  """Lucide Icon component."""
2
2
 
3
3
  from reflex.components.component import Component
4
- from reflex.utils import console, format
4
+ from reflex.utils import format
5
5
  from reflex.vars import Var
6
6
 
7
7
 
@@ -36,19 +36,6 @@ class Icon(LucideIconComponent):
36
36
  Returns:
37
37
  The created component.
38
38
  """
39
-
40
- def map_deprecated_icon_names_05(tag: str) -> str:
41
- new_tag = RENAMED_ICONS_05.get(tag)
42
- if new_tag is not None:
43
- console.deprecate(
44
- feature_name=f"icon {tag}",
45
- reason=f"it was renamed upstream. Use {new_tag} instead.",
46
- deprecation_version="0.4.6",
47
- removal_version="0.6.0",
48
- )
49
- return new_tag
50
- return tag
51
-
52
39
  if children:
53
40
  if len(children) == 1 and isinstance(children[0], str):
54
41
  props["tag"] = children[0]
@@ -62,8 +49,7 @@ class Icon(LucideIconComponent):
62
49
 
63
50
  if (
64
51
  not isinstance(props["tag"], str)
65
- or map_deprecated_icon_names_05(format.to_snake_case(props["tag"]))
66
- not in LUCIDE_ICON_LIST
52
+ or format.to_snake_case(props["tag"]) not in LUCIDE_ICON_LIST
67
53
  ):
68
54
  raise ValueError(
69
55
  f"Invalid icon tag: {props['tag']}. Please use one of the following: {', '.join(LUCIDE_ICON_LIST[0:25])}, ..."
@@ -76,116 +62,6 @@ class Icon(LucideIconComponent):
76
62
  return super().create(*children, **props)
77
63
 
78
64
 
79
- RENAMED_ICONS_05 = {
80
- "activity_square": "square_activity",
81
- "alert_circle": "circle_alert",
82
- "alert_octagon": "octagon_alert",
83
- "alert_triangle": "triangle_alert",
84
- "arrow_down_circle": "circle_arrow_down",
85
- "arrow_down_left_from_circle": "circle_arrow_out_down_left",
86
- "arrow_down_left_from_square": "square_arrow_out_down_left",
87
- "arrow_down_left_square": "square_arrow_down_left",
88
- "arrow_down_right_from_circle": "circle_arrow_out_down_right",
89
- "arrow_down_right_from_square": "square_arrow_out_down_right",
90
- "arrow_down_right_square": "square_arrow_down_right",
91
- "arrow_down_square": "square_arrow_down",
92
- "arrow_left_circle": "circle_arrow_left",
93
- "arrow_left_square": "square_arrow_left",
94
- "arrow_right_circle": "circle_arrow_right",
95
- "arrow_right_square": "square_arrow_right",
96
- "arrow_up_circle": "circle_arrow_up",
97
- "arrow_up_left_from_circle": "circle_arrow_out_up_left",
98
- "arrow_up_left_from_square": "square_arrow_out_up_left",
99
- "arrow_up_left_square": "square_arrow_up_left",
100
- "arrow_up_right_from_circle": "circle_arrow_out_up_right",
101
- "arrow_up_right_from_square": "square_arrow_out_up_right",
102
- "arrow_up_right_square": "square_arrow_up_right",
103
- "arrow_up_square": "square_arrow_up",
104
- "asterisk_square": "square_asterisk",
105
- "check_circle": "circle_check_big",
106
- "check_circle_2": "circle_check",
107
- "check_square": "square_check_big",
108
- "check_square_2": "square_check",
109
- "chevron_down_circle": "circle_chevron_down",
110
- "chevron_down_square": "square_chevron_down",
111
- "chevron_left_circle": "circle_chevron_left",
112
- "chevron_left_square": "square_chevron_left",
113
- "chevron_right_circle": "circle_chevron_right",
114
- "chevron_right_square": "square_chevron_right",
115
- "chevron_up_circle": "circle_chevron_up",
116
- "chevron_up_square": "square_chevron_up",
117
- "code_2": "code_xml",
118
- "code_square": "square_code",
119
- "contact_2": "contact_round",
120
- "divide_circle": "circle_divide",
121
- "divide_square": "square_divide",
122
- "dot_square": "square_dot",
123
- "download_cloud": "cloud_download",
124
- "equal_square": "square_equal",
125
- "form_input": "rectangle_ellipsis",
126
- "function_square": "square_function",
127
- "gantt_chart_square": "square_gantt_chart",
128
- "gauge_circle": "circle_gauge",
129
- "globe_2": "earth",
130
- "help_circle": "circle_help",
131
- "helping_hand": "hand_helping",
132
- "ice_cream": "ice_cream_cone",
133
- "ice_cream_2": "ice_cream_bowl",
134
- "indent": "indent_increase",
135
- "kanban_square": "square_kanban",
136
- "kanban_square_dashed": "square_dashed_kanban",
137
- "laptop_2": "laptop_minimal",
138
- "library_square": "square_library",
139
- "loader_2": "loader_circle",
140
- "m_square": "square_m",
141
- "menu_square": "square_menu",
142
- "mic_2": "mic_vocal",
143
- "minus_circle": "circle_minus",
144
- "minus_square": "square_minus",
145
- "more_horizontal": "ellipsis",
146
- "more_vertical": "ellipsis_vertical",
147
- "mouse_pointer_square": "square_mouse_pointer",
148
- "mouse_pointer_square_dashed": "square_dashed_mouse_pointer",
149
- "outdent": "indent_decrease",
150
- "palm_tree": "tree_palm",
151
- "parking_circle": "circle_parking",
152
- "parking_circle_off": "circle_parking_off",
153
- "parking_square": "square_parking",
154
- "parking_square_off": "square_parking_off",
155
- "pause_circle": "circle_pause",
156
- "pause_octagon": "octagon_pause",
157
- "percent_circle": "circle_percent",
158
- "percent_diamond": "diamond_percent",
159
- "percent_square": "square_percent",
160
- "pi_square": "square_pi",
161
- "pilcrow_square": "square_pilcrow",
162
- "play_circle": "circle_play",
163
- "play_square": "square_play",
164
- "plus_circle": "circle_plus",
165
- "plus_square": "square_plus",
166
- "power_circle": "circle_power",
167
- "power_square": "square_power",
168
- "school_2": "university",
169
- "scissors_square": "square_scissors",
170
- "scissors_square_dashed_bottom": "square_bottom_dashed_scissors",
171
- "sigma_square": "square_sigma",
172
- "slash_circle": "circle_slash",
173
- "sliders": "sliders_vertical",
174
- "split_square_horizontal": "square_split_horizontal",
175
- "split_square_vertical": "square_split_vertical",
176
- "stop_circle": "circle_stop",
177
- "subtitles": "captions",
178
- "test_tube_2": "test_tube_diagonal",
179
- "unlock": "lock_open",
180
- "unlock_keyhole": "lock_keyhole_open",
181
- "upload_cloud": "cloud_upload",
182
- "wallet_2": "wallet_minimal",
183
- "wand_2": "wand_sparkles",
184
- "x_circle": "circle_x",
185
- "x_octagon": "octagon_x",
186
- "x_square": "square_x",
187
- }
188
-
189
65
  LUCIDE_ICON_LIST = [
190
66
  "a_arrow_down",
191
67
  "a_arrow_up",
@@ -7,8 +7,9 @@ from typing import Any, Callable, Dict, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import Component
9
9
  from reflex.event import EventHandler, EventSpec
10
+ from reflex.ivars.base import ImmutableVar
10
11
  from reflex.style import Style
11
- from reflex.vars import BaseVar, Var
12
+ from reflex.vars import Var
12
13
 
13
14
  class LucideIconComponent(Component):
14
15
  @overload
@@ -21,51 +22,51 @@ class LucideIconComponent(Component):
21
22
  id: Optional[Any] = None,
22
23
  class_name: Optional[Any] = None,
23
24
  autofocus: Optional[bool] = None,
24
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
25
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
25
26
  on_blur: Optional[
26
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
27
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
27
28
  ] = None,
28
29
  on_click: Optional[
29
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
30
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
30
31
  ] = None,
31
32
  on_context_menu: Optional[
32
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
33
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
33
34
  ] = None,
34
35
  on_double_click: Optional[
35
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
36
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
36
37
  ] = None,
37
38
  on_focus: Optional[
38
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
39
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
39
40
  ] = None,
40
41
  on_mount: Optional[
41
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
42
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
42
43
  ] = None,
43
44
  on_mouse_down: Optional[
44
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
45
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
45
46
  ] = None,
46
47
  on_mouse_enter: Optional[
47
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
48
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
48
49
  ] = None,
49
50
  on_mouse_leave: Optional[
50
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
51
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
51
52
  ] = None,
52
53
  on_mouse_move: Optional[
53
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
54
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
54
55
  ] = None,
55
56
  on_mouse_out: Optional[
56
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
57
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
57
58
  ] = None,
58
59
  on_mouse_over: Optional[
59
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
60
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
60
61
  ] = None,
61
62
  on_mouse_up: Optional[
62
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
63
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
63
64
  ] = None,
64
65
  on_scroll: Optional[
65
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
66
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
66
67
  ] = None,
67
68
  on_unmount: Optional[
68
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
69
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
69
70
  ] = None,
70
71
  **props,
71
72
  ) -> "LucideIconComponent":
@@ -98,51 +99,51 @@ class Icon(LucideIconComponent):
98
99
  id: Optional[Any] = None,
99
100
  class_name: Optional[Any] = None,
100
101
  autofocus: Optional[bool] = None,
101
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
102
+ custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
102
103
  on_blur: Optional[
103
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
104
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
104
105
  ] = None,
105
106
  on_click: Optional[
106
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
107
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
107
108
  ] = None,
108
109
  on_context_menu: Optional[
109
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
110
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
110
111
  ] = None,
111
112
  on_double_click: Optional[
112
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
113
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
113
114
  ] = None,
114
115
  on_focus: Optional[
115
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
116
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
116
117
  ] = None,
117
118
  on_mount: Optional[
118
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
119
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
119
120
  ] = None,
120
121
  on_mouse_down: Optional[
121
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
122
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
122
123
  ] = None,
123
124
  on_mouse_enter: Optional[
124
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
125
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
125
126
  ] = None,
126
127
  on_mouse_leave: Optional[
127
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
128
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
128
129
  ] = None,
129
130
  on_mouse_move: Optional[
130
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
131
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
131
132
  ] = None,
132
133
  on_mouse_out: Optional[
133
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
134
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
134
135
  ] = None,
135
136
  on_mouse_over: Optional[
136
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
137
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
137
138
  ] = None,
138
139
  on_mouse_up: Optional[
139
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
140
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
140
141
  ] = None,
141
142
  on_scroll: Optional[
142
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
143
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
143
144
  ] = None,
144
145
  on_unmount: Optional[
145
- Union[EventHandler, EventSpec, list, Callable, BaseVar]
146
+ Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
146
147
  ] = None,
147
148
  **props,
148
149
  ) -> "Icon":
@@ -170,115 +171,6 @@ class Icon(LucideIconComponent):
170
171
  """
171
172
  ...
172
173
 
173
- RENAMED_ICONS_05 = {
174
- "activity_square": "square_activity",
175
- "alert_circle": "circle_alert",
176
- "alert_octagon": "octagon_alert",
177
- "alert_triangle": "triangle_alert",
178
- "arrow_down_circle": "circle_arrow_down",
179
- "arrow_down_left_from_circle": "circle_arrow_out_down_left",
180
- "arrow_down_left_from_square": "square_arrow_out_down_left",
181
- "arrow_down_left_square": "square_arrow_down_left",
182
- "arrow_down_right_from_circle": "circle_arrow_out_down_right",
183
- "arrow_down_right_from_square": "square_arrow_out_down_right",
184
- "arrow_down_right_square": "square_arrow_down_right",
185
- "arrow_down_square": "square_arrow_down",
186
- "arrow_left_circle": "circle_arrow_left",
187
- "arrow_left_square": "square_arrow_left",
188
- "arrow_right_circle": "circle_arrow_right",
189
- "arrow_right_square": "square_arrow_right",
190
- "arrow_up_circle": "circle_arrow_up",
191
- "arrow_up_left_from_circle": "circle_arrow_out_up_left",
192
- "arrow_up_left_from_square": "square_arrow_out_up_left",
193
- "arrow_up_left_square": "square_arrow_up_left",
194
- "arrow_up_right_from_circle": "circle_arrow_out_up_right",
195
- "arrow_up_right_from_square": "square_arrow_out_up_right",
196
- "arrow_up_right_square": "square_arrow_up_right",
197
- "arrow_up_square": "square_arrow_up",
198
- "asterisk_square": "square_asterisk",
199
- "check_circle": "circle_check_big",
200
- "check_circle_2": "circle_check",
201
- "check_square": "square_check_big",
202
- "check_square_2": "square_check",
203
- "chevron_down_circle": "circle_chevron_down",
204
- "chevron_down_square": "square_chevron_down",
205
- "chevron_left_circle": "circle_chevron_left",
206
- "chevron_left_square": "square_chevron_left",
207
- "chevron_right_circle": "circle_chevron_right",
208
- "chevron_right_square": "square_chevron_right",
209
- "chevron_up_circle": "circle_chevron_up",
210
- "chevron_up_square": "square_chevron_up",
211
- "code_2": "code_xml",
212
- "code_square": "square_code",
213
- "contact_2": "contact_round",
214
- "divide_circle": "circle_divide",
215
- "divide_square": "square_divide",
216
- "dot_square": "square_dot",
217
- "download_cloud": "cloud_download",
218
- "equal_square": "square_equal",
219
- "form_input": "rectangle_ellipsis",
220
- "function_square": "square_function",
221
- "gantt_chart_square": "square_gantt_chart",
222
- "gauge_circle": "circle_gauge",
223
- "globe_2": "earth",
224
- "help_circle": "circle_help",
225
- "helping_hand": "hand_helping",
226
- "ice_cream": "ice_cream_cone",
227
- "ice_cream_2": "ice_cream_bowl",
228
- "indent": "indent_increase",
229
- "kanban_square": "square_kanban",
230
- "kanban_square_dashed": "square_dashed_kanban",
231
- "laptop_2": "laptop_minimal",
232
- "library_square": "square_library",
233
- "loader_2": "loader_circle",
234
- "m_square": "square_m",
235
- "menu_square": "square_menu",
236
- "mic_2": "mic_vocal",
237
- "minus_circle": "circle_minus",
238
- "minus_square": "square_minus",
239
- "more_horizontal": "ellipsis",
240
- "more_vertical": "ellipsis_vertical",
241
- "mouse_pointer_square": "square_mouse_pointer",
242
- "mouse_pointer_square_dashed": "square_dashed_mouse_pointer",
243
- "outdent": "indent_decrease",
244
- "palm_tree": "tree_palm",
245
- "parking_circle": "circle_parking",
246
- "parking_circle_off": "circle_parking_off",
247
- "parking_square": "square_parking",
248
- "parking_square_off": "square_parking_off",
249
- "pause_circle": "circle_pause",
250
- "pause_octagon": "octagon_pause",
251
- "percent_circle": "circle_percent",
252
- "percent_diamond": "diamond_percent",
253
- "percent_square": "square_percent",
254
- "pi_square": "square_pi",
255
- "pilcrow_square": "square_pilcrow",
256
- "play_circle": "circle_play",
257
- "play_square": "square_play",
258
- "plus_circle": "circle_plus",
259
- "plus_square": "square_plus",
260
- "power_circle": "circle_power",
261
- "power_square": "square_power",
262
- "school_2": "university",
263
- "scissors_square": "square_scissors",
264
- "scissors_square_dashed_bottom": "square_bottom_dashed_scissors",
265
- "sigma_square": "square_sigma",
266
- "slash_circle": "circle_slash",
267
- "sliders": "sliders_vertical",
268
- "split_square_horizontal": "square_split_horizontal",
269
- "split_square_vertical": "square_split_vertical",
270
- "stop_circle": "circle_stop",
271
- "subtitles": "captions",
272
- "test_tube_2": "test_tube_diagonal",
273
- "unlock": "lock_open",
274
- "unlock_keyhole": "lock_keyhole_open",
275
- "upload_cloud": "cloud_upload",
276
- "wallet_2": "wallet_minimal",
277
- "wand_2": "wand_sparkles",
278
- "x_circle": "circle_x",
279
- "x_octagon": "octagon_x",
280
- "x_square": "square_x",
281
- }
282
174
  LUCIDE_ICON_LIST = [
283
175
  "a_arrow_down",
284
176
  "a_arrow_up",