reflex 0.6.8a1__py3-none-any.whl → 0.7.0__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 (248) hide show
  1. reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +1 -1
  2. reflex/.templates/jinja/web/pages/_app.js.jinja2 +7 -7
  3. reflex/.templates/jinja/web/pages/utils.js.jinja2 +3 -3
  4. reflex/.templates/web/components/reflex/radix_themes_color_mode_provider.js +1 -4
  5. reflex/.templates/web/utils/state.js +65 -36
  6. reflex/__init__.py +4 -17
  7. reflex/__init__.pyi +1 -2
  8. reflex/app.py +286 -135
  9. reflex/app_mixins/lifespan.py +9 -9
  10. reflex/app_mixins/middleware.py +6 -6
  11. reflex/app_module_for_backend.py +3 -7
  12. reflex/base.py +7 -7
  13. reflex/compiler/compiler.py +8 -0
  14. reflex/compiler/utils.py +57 -18
  15. reflex/components/base/app_wrap.pyi +16 -16
  16. reflex/components/base/bare.py +1 -1
  17. reflex/components/base/body.pyi +16 -16
  18. reflex/components/base/document.pyi +76 -76
  19. reflex/components/base/error_boundary.py +2 -1
  20. reflex/components/base/error_boundary.pyi +19 -22
  21. reflex/components/base/fragment.pyi +16 -16
  22. reflex/components/base/head.pyi +31 -31
  23. reflex/components/base/link.pyi +31 -31
  24. reflex/components/base/meta.py +2 -2
  25. reflex/components/base/meta.pyi +61 -61
  26. reflex/components/base/script.pyi +19 -19
  27. reflex/components/base/strict_mode.py +10 -0
  28. reflex/components/base/strict_mode.pyi +57 -0
  29. reflex/components/component.py +38 -77
  30. reflex/components/core/banner.py +159 -4
  31. reflex/components/core/banner.pyi +162 -76
  32. reflex/components/core/breakpoints.py +3 -1
  33. reflex/components/core/client_side_routing.py +1 -1
  34. reflex/components/core/client_side_routing.pyi +32 -32
  35. reflex/components/core/clipboard.pyi +17 -20
  36. reflex/components/core/cond.py +9 -10
  37. reflex/components/core/debounce.py +1 -1
  38. reflex/components/core/debounce.pyi +17 -17
  39. reflex/components/core/foreach.py +28 -3
  40. reflex/components/core/html.py +1 -1
  41. reflex/components/core/html.pyi +16 -16
  42. reflex/components/core/match.py +5 -5
  43. reflex/components/core/sticky.py +134 -0
  44. reflex/components/core/sticky.pyi +449 -0
  45. reflex/components/core/upload.py +2 -2
  46. reflex/components/core/upload.pyi +80 -88
  47. reflex/components/datadisplay/code.py +5 -14
  48. reflex/components/datadisplay/code.pyi +31 -31
  49. reflex/components/datadisplay/dataeditor.py +7 -4
  50. reflex/components/datadisplay/dataeditor.pyi +40 -54
  51. reflex/components/datadisplay/logo.py +13 -8
  52. reflex/components/datadisplay/shiki_code_block.py +14 -9
  53. reflex/components/datadisplay/shiki_code_block.pyi +46 -46
  54. reflex/components/dynamic.py +22 -3
  55. reflex/components/el/constants/reflex.py +1 -1
  56. reflex/components/el/element.py +1 -1
  57. reflex/components/el/element.pyi +16 -16
  58. reflex/components/el/elements/base.pyi +16 -16
  59. reflex/components/el/elements/forms.py +4 -4
  60. reflex/components/el/elements/forms.pyi +224 -258
  61. reflex/components/el/elements/inline.pyi +421 -421
  62. reflex/components/el/elements/media.pyi +376 -376
  63. reflex/components/el/elements/metadata.pyi +91 -91
  64. reflex/components/el/elements/other.pyi +106 -106
  65. reflex/components/el/elements/scripts.pyi +46 -46
  66. reflex/components/el/elements/sectioning.pyi +226 -226
  67. reflex/components/el/elements/tables.pyi +151 -151
  68. reflex/components/el/elements/typography.pyi +226 -226
  69. reflex/components/gridjs/datatable.pyi +31 -31
  70. reflex/components/lucide/icon.py +46 -8
  71. reflex/components/lucide/icon.pyi +85 -31
  72. reflex/components/markdown/markdown.py +10 -8
  73. reflex/components/markdown/markdown.pyi +16 -16
  74. reflex/components/moment/moment.py +2 -2
  75. reflex/components/moment/moment.pyi +17 -19
  76. reflex/components/next/base.pyi +16 -16
  77. reflex/components/next/image.py +16 -4
  78. reflex/components/next/image.pyi +22 -20
  79. reflex/components/next/link.py +1 -1
  80. reflex/components/next/link.pyi +16 -16
  81. reflex/components/next/video.pyi +16 -16
  82. reflex/components/plotly/__init__.py +29 -2
  83. reflex/components/plotly/plotly.py +240 -5
  84. reflex/components/plotly/plotly.pyi +799 -44
  85. reflex/components/props.py +3 -3
  86. reflex/components/radix/__init__.pyi +1 -1
  87. reflex/components/radix/primitives/accordion.py +9 -5
  88. reflex/components/radix/primitives/accordion.pyi +110 -108
  89. reflex/components/radix/primitives/base.pyi +31 -31
  90. reflex/components/radix/primitives/drawer.py +5 -2
  91. reflex/components/radix/primitives/drawer.pyi +179 -187
  92. reflex/components/radix/primitives/form.pyi +160 -172
  93. reflex/components/radix/primitives/progress.py +1 -1
  94. reflex/components/radix/primitives/progress.pyi +76 -76
  95. reflex/components/radix/primitives/slider.py +1 -1
  96. reflex/components/radix/primitives/slider.pyi +78 -82
  97. reflex/components/radix/themes/base.pyi +121 -121
  98. reflex/components/radix/themes/color_mode.py +11 -9
  99. reflex/components/radix/themes/color_mode.pyi +47 -49
  100. reflex/components/radix/themes/components/alert_dialog.py +3 -0
  101. reflex/components/radix/themes/components/alert_dialog.pyi +110 -112
  102. reflex/components/radix/themes/components/aspect_ratio.pyi +16 -16
  103. reflex/components/radix/themes/components/avatar.pyi +16 -16
  104. reflex/components/radix/themes/components/badge.pyi +16 -16
  105. reflex/components/radix/themes/components/button.pyi +16 -16
  106. reflex/components/radix/themes/components/callout.pyi +76 -76
  107. reflex/components/radix/themes/components/card.py +1 -1
  108. reflex/components/radix/themes/components/card.pyi +17 -17
  109. reflex/components/radix/themes/components/checkbox.pyi +49 -55
  110. reflex/components/radix/themes/components/checkbox_cards.pyi +31 -31
  111. reflex/components/radix/themes/components/checkbox_group.pyi +31 -31
  112. reflex/components/radix/themes/components/context_menu.py +5 -0
  113. reflex/components/radix/themes/components/context_menu.pyi +149 -155
  114. reflex/components/radix/themes/components/data_list.pyi +61 -61
  115. reflex/components/radix/themes/components/dialog.py +3 -0
  116. reflex/components/radix/themes/components/dialog.pyi +113 -117
  117. reflex/components/radix/themes/components/dropdown_menu.py +5 -0
  118. reflex/components/radix/themes/components/dropdown_menu.pyi +133 -137
  119. reflex/components/radix/themes/components/hover_card.py +3 -0
  120. reflex/components/radix/themes/components/hover_card.pyi +63 -67
  121. reflex/components/radix/themes/components/icon_button.py +2 -2
  122. reflex/components/radix/themes/components/icon_button.pyi +17 -16
  123. reflex/components/radix/themes/components/inset.pyi +16 -16
  124. reflex/components/radix/themes/components/popover.py +3 -0
  125. reflex/components/radix/themes/components/popover.pyi +68 -70
  126. reflex/components/radix/themes/components/progress.pyi +16 -16
  127. reflex/components/radix/themes/components/radio.pyi +16 -16
  128. reflex/components/radix/themes/components/radio_cards.py +2 -0
  129. reflex/components/radix/themes/components/radio_cards.pyi +32 -34
  130. reflex/components/radix/themes/components/radio_group.py +1 -1
  131. reflex/components/radix/themes/components/radio_group.pyi +62 -64
  132. reflex/components/radix/themes/components/scroll_area.pyi +16 -16
  133. reflex/components/radix/themes/components/segmented_control.pyi +32 -35
  134. reflex/components/radix/themes/components/select.py +4 -0
  135. reflex/components/radix/themes/components/select.pyi +145 -157
  136. reflex/components/radix/themes/components/separator.pyi +16 -16
  137. reflex/components/radix/themes/components/skeleton.py +3 -0
  138. reflex/components/radix/themes/components/skeleton.pyi +16 -16
  139. reflex/components/radix/themes/components/slider.pyi +22 -28
  140. reflex/components/radix/themes/components/spinner.pyi +16 -16
  141. reflex/components/radix/themes/components/switch.pyi +17 -19
  142. reflex/components/radix/themes/components/table.pyi +106 -106
  143. reflex/components/radix/themes/components/tabs.py +3 -0
  144. reflex/components/radix/themes/components/tabs.pyi +78 -82
  145. reflex/components/radix/themes/components/text_area.py +12 -0
  146. reflex/components/radix/themes/components/text_area.pyi +21 -33
  147. reflex/components/radix/themes/components/text_field.py +1 -1
  148. reflex/components/radix/themes/components/text_field.pyi +52 -80
  149. reflex/components/radix/themes/components/tooltip.py +6 -1
  150. reflex/components/radix/themes/components/tooltip.pyi +20 -21
  151. reflex/components/radix/themes/layout/__init__.pyi +1 -1
  152. reflex/components/radix/themes/layout/base.pyi +16 -16
  153. reflex/components/radix/themes/layout/box.pyi +16 -16
  154. reflex/components/radix/themes/layout/center.pyi +16 -16
  155. reflex/components/radix/themes/layout/container.pyi +16 -16
  156. reflex/components/radix/themes/layout/flex.pyi +16 -16
  157. reflex/components/radix/themes/layout/grid.pyi +16 -16
  158. reflex/components/radix/themes/layout/list.py +2 -2
  159. reflex/components/radix/themes/layout/list.pyi +76 -76
  160. reflex/components/radix/themes/layout/section.pyi +16 -16
  161. reflex/components/radix/themes/layout/spacer.pyi +16 -16
  162. reflex/components/radix/themes/layout/stack.py +2 -2
  163. reflex/components/radix/themes/layout/stack.pyi +46 -46
  164. reflex/components/radix/themes/typography/blockquote.pyi +16 -16
  165. reflex/components/radix/themes/typography/code.pyi +16 -16
  166. reflex/components/radix/themes/typography/heading.pyi +16 -16
  167. reflex/components/radix/themes/typography/link.py +1 -1
  168. reflex/components/radix/themes/typography/link.pyi +16 -16
  169. reflex/components/radix/themes/typography/text.py +2 -2
  170. reflex/components/radix/themes/typography/text.pyi +106 -106
  171. reflex/components/react_player/audio.pyi +33 -39
  172. reflex/components/react_player/react_player.py +1 -1
  173. reflex/components/react_player/react_player.pyi +32 -38
  174. reflex/components/react_player/video.pyi +33 -39
  175. reflex/components/recharts/__init__.py +2 -0
  176. reflex/components/recharts/__init__.pyi +2 -0
  177. reflex/components/recharts/cartesian.pyi +282 -282
  178. reflex/components/recharts/charts.py +15 -15
  179. reflex/components/recharts/charts.pyi +164 -164
  180. reflex/components/recharts/general.py +19 -4
  181. reflex/components/recharts/general.pyi +132 -81
  182. reflex/components/recharts/polar.py +2 -2
  183. reflex/components/recharts/polar.pyi +55 -55
  184. reflex/components/recharts/recharts.py +4 -4
  185. reflex/components/recharts/recharts.pyi +31 -31
  186. reflex/components/sonner/toast.py +15 -13
  187. reflex/components/sonner/toast.pyi +22 -22
  188. reflex/components/suneditor/editor.py +6 -4
  189. reflex/components/suneditor/editor.pyi +26 -40
  190. reflex/components/tags/iter_tag.py +3 -3
  191. reflex/components/tags/tag.py +25 -3
  192. reflex/config.py +48 -20
  193. reflex/constants/__init__.py +1 -0
  194. reflex/constants/base.py +4 -1
  195. reflex/constants/compiler.py +5 -2
  196. reflex/constants/config.py +8 -1
  197. reflex/constants/installer.py +9 -9
  198. reflex/constants/style.py +1 -1
  199. reflex/custom_components/custom_components.py +18 -10
  200. reflex/event.py +228 -233
  201. reflex/experimental/__init__.py +19 -11
  202. reflex/experimental/client_state.py +53 -28
  203. reflex/experimental/hooks.py +5 -5
  204. reflex/experimental/layout.py +8 -5
  205. reflex/experimental/layout.pyi +79 -83
  206. reflex/experimental/misc.py +3 -3
  207. reflex/istate/wrappers.py +1 -1
  208. reflex/middleware/hydrate_middleware.py +2 -2
  209. reflex/model.py +11 -6
  210. reflex/page.py +5 -5
  211. reflex/reflex.py +104 -26
  212. reflex/route.py +1 -1
  213. reflex/state.py +358 -401
  214. reflex/style.py +27 -3
  215. reflex/testing.py +34 -39
  216. reflex/utils/build.py +6 -2
  217. reflex/utils/codespaces.py +1 -4
  218. reflex/utils/compat.py +6 -5
  219. reflex/utils/console.py +71 -21
  220. reflex/utils/exceptions.py +89 -26
  221. reflex/utils/exec.py +69 -74
  222. reflex/utils/export.py +6 -1
  223. reflex/utils/format.py +8 -40
  224. reflex/utils/imports.py +5 -2
  225. reflex/utils/lazy_loader.py +7 -1
  226. reflex/utils/path_ops.py +74 -14
  227. reflex/utils/prerequisites.py +345 -68
  228. reflex/utils/processes.py +45 -32
  229. reflex/utils/pyi_generator.py +39 -33
  230. reflex/utils/registry.py +4 -4
  231. reflex/utils/serializers.py +1 -1
  232. reflex/utils/telemetry.py +5 -4
  233. reflex/utils/types.py +42 -18
  234. reflex/vars/base.py +695 -330
  235. reflex/vars/datetime.py +6 -7
  236. reflex/vars/dep_tracking.py +344 -0
  237. reflex/vars/function.py +11 -5
  238. reflex/vars/number.py +31 -43
  239. reflex/vars/object.py +74 -64
  240. reflex/vars/sequence.py +79 -67
  241. {reflex-0.6.8a1.dist-info → reflex-0.7.0.dist-info}/METADATA +7 -10
  242. reflex-0.7.0.dist-info/RECORD +401 -0
  243. {reflex-0.6.8a1.dist-info → reflex-0.7.0.dist-info}/WHEEL +1 -1
  244. reflex/experimental/assets.py +0 -37
  245. reflex/proxy.py +0 -119
  246. reflex-0.6.8a1.dist-info/RECORD +0 -398
  247. {reflex-0.6.8a1.dist-info → reflex-0.7.0.dist-info}/LICENSE +0 -0
  248. {reflex-0.6.8a1.dist-info → reflex-0.7.0.dist-info}/entry_points.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from typing import Any, Dict, List, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import Component
9
- from reflex.event import BASE_STATE, EventType
9
+ from reflex.event import EventType
10
10
  from reflex.style import Style
11
11
  from reflex.utils.imports import ImportDict
12
12
  from reflex.vars.base import Var
@@ -23,21 +23,21 @@ class Gridjs(Component):
23
23
  class_name: Optional[Any] = None,
24
24
  autofocus: Optional[bool] = None,
25
25
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
26
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
27
- on_click: Optional[EventType[[], BASE_STATE]] = None,
28
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
29
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
30
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
31
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
32
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
33
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
34
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
35
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
36
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
37
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
38
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
39
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
40
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
26
+ on_blur: Optional[EventType[()]] = None,
27
+ on_click: Optional[EventType[()]] = None,
28
+ on_context_menu: Optional[EventType[()]] = None,
29
+ on_double_click: Optional[EventType[()]] = None,
30
+ on_focus: Optional[EventType[()]] = None,
31
+ on_mount: Optional[EventType[()]] = None,
32
+ on_mouse_down: Optional[EventType[()]] = None,
33
+ on_mouse_enter: Optional[EventType[()]] = None,
34
+ on_mouse_leave: Optional[EventType[()]] = None,
35
+ on_mouse_move: Optional[EventType[()]] = None,
36
+ on_mouse_out: Optional[EventType[()]] = None,
37
+ on_mouse_over: Optional[EventType[()]] = None,
38
+ on_mouse_up: Optional[EventType[()]] = None,
39
+ on_scroll: Optional[EventType[()]] = None,
40
+ on_unmount: Optional[EventType[()]] = None,
41
41
  **props,
42
42
  ) -> "Gridjs":
43
43
  """Create the component.
@@ -75,21 +75,21 @@ class DataTable(Gridjs):
75
75
  class_name: Optional[Any] = None,
76
76
  autofocus: Optional[bool] = None,
77
77
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
78
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
79
- on_click: Optional[EventType[[], BASE_STATE]] = None,
80
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
81
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
82
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
83
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
84
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
85
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
86
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
87
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
88
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
89
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
90
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
91
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
92
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
78
+ on_blur: Optional[EventType[()]] = None,
79
+ on_click: Optional[EventType[()]] = None,
80
+ on_context_menu: Optional[EventType[()]] = None,
81
+ on_double_click: Optional[EventType[()]] = None,
82
+ on_focus: Optional[EventType[()]] = None,
83
+ on_mount: Optional[EventType[()]] = None,
84
+ on_mouse_down: Optional[EventType[()]] = None,
85
+ on_mouse_enter: Optional[EventType[()]] = None,
86
+ on_mouse_leave: Optional[EventType[()]] = None,
87
+ on_mouse_move: Optional[EventType[()]] = None,
88
+ on_mouse_out: Optional[EventType[()]] = None,
89
+ on_mouse_over: Optional[EventType[()]] = None,
90
+ on_mouse_up: Optional[EventType[()]] = None,
91
+ on_scroll: Optional[EventType[()]] = None,
92
+ on_unmount: Optional[EventType[()]] = None,
93
93
  **props,
94
94
  ) -> "DataTable":
95
95
  """Create a datatable component.
@@ -2,13 +2,15 @@
2
2
 
3
3
  from reflex.components.component import Component
4
4
  from reflex.utils import format
5
- from reflex.vars.base import Var
5
+ from reflex.utils.imports import ImportVar
6
+ from reflex.vars.base import LiteralVar, Var
7
+ from reflex.vars.sequence import LiteralStringVar
6
8
 
7
9
 
8
10
  class LucideIconComponent(Component):
9
11
  """Lucide Icon Component."""
10
12
 
11
- library = "lucide-react@0.469.0"
13
+ library = "lucide-react@0.471.1"
12
14
 
13
15
 
14
16
  class Icon(LucideIconComponent):
@@ -32,6 +34,7 @@ class Icon(LucideIconComponent):
32
34
  Raises:
33
35
  AttributeError: The errors tied to bad usage of the Icon component.
34
36
  ValueError: If the icon tag is invalid.
37
+ TypeError: If the icon name is not a string.
35
38
 
36
39
  Returns:
37
40
  The created component.
@@ -39,7 +42,6 @@ class Icon(LucideIconComponent):
39
42
  if children:
40
43
  if len(children) == 1 and isinstance(children[0], str):
41
44
  props["tag"] = children[0]
42
- children = []
43
45
  else:
44
46
  raise AttributeError(
45
47
  f"Passing multiple children to Icon component is not allowed: remove positional arguments {children[1:]} to fix"
@@ -47,19 +49,46 @@ class Icon(LucideIconComponent):
47
49
  if "tag" not in props:
48
50
  raise AttributeError("Missing 'tag' keyword-argument for Icon")
49
51
 
52
+ tag: str | Var | LiteralVar = props.pop("tag")
53
+ if isinstance(tag, LiteralVar):
54
+ if isinstance(tag, LiteralStringVar):
55
+ tag = tag._var_value
56
+ else:
57
+ raise TypeError(f"Icon name must be a string, got {type(tag)}")
58
+ elif isinstance(tag, Var):
59
+ return DynamicIcon.create(name=tag, **props)
60
+
50
61
  if (
51
- not isinstance(props["tag"], str)
52
- or format.to_snake_case(props["tag"]) not in LUCIDE_ICON_LIST
62
+ not isinstance(tag, str)
63
+ or format.to_snake_case(tag) not in LUCIDE_ICON_LIST
53
64
  ):
54
65
  raise ValueError(
55
- f"Invalid icon tag: {props['tag']}. Please use one of the following: {', '.join(LUCIDE_ICON_LIST[0:25])}, ..."
66
+ f"Invalid icon tag: {tag}. Please use one of the following: {', '.join(LUCIDE_ICON_LIST[0:25])}, ..."
56
67
  "\nSee full list at https://lucide.dev/icons."
57
68
  )
58
69
 
59
- props["tag"] = format.to_title_case(format.to_snake_case(props["tag"])) + "Icon"
70
+ if tag in LUCIDE_ICON_MAPPING_OVERRIDE:
71
+ props["tag"] = LUCIDE_ICON_MAPPING_OVERRIDE[tag]
72
+ else:
73
+ props["tag"] = format.to_title_case(format.to_snake_case(tag)) + "Icon"
60
74
  props["alias"] = f"Lucide{props['tag']}"
61
75
  props.setdefault("color", "var(--current-color)")
62
- return super().create(*children, **props)
76
+ return super().create(**props)
77
+
78
+
79
+ class DynamicIcon(LucideIconComponent):
80
+ """A DynamicIcon component."""
81
+
82
+ tag = "DynamicIcon"
83
+
84
+ name: Var[str]
85
+
86
+ def _get_imports(self):
87
+ _imports = super()._get_imports()
88
+ if self.library:
89
+ _imports.pop(self.library)
90
+ _imports["lucide-react/dynamic"] = [ImportVar("DynamicIcon", install=False)]
91
+ return _imports
63
92
 
64
93
 
65
94
  LUCIDE_ICON_LIST = [
@@ -841,6 +870,7 @@ LUCIDE_ICON_LIST = [
841
870
  "house",
842
871
  "house_plug",
843
872
  "house_plus",
873
+ "house_wifi",
844
874
  "ice_cream_bowl",
845
875
  "ice_cream_cone",
846
876
  "id_card",
@@ -1529,6 +1559,7 @@ LUCIDE_ICON_LIST = [
1529
1559
  "trending_up_down",
1530
1560
  "triangle",
1531
1561
  "triangle_alert",
1562
+ "triangle_dashed",
1532
1563
  "triangle_right",
1533
1564
  "trophy",
1534
1565
  "truck",
@@ -1634,3 +1665,10 @@ LUCIDE_ICON_LIST = [
1634
1665
  "zoom_in",
1635
1666
  "zoom_out",
1636
1667
  ]
1668
+
1669
+ # The default transformation of some icon names doesn't match how the
1670
+ # icons are exported from Lucide. Manual overrides can go here.
1671
+ LUCIDE_ICON_MAPPING_OVERRIDE = {
1672
+ "grid_2x_2_check": "Grid2x2Check",
1673
+ "grid_2x_2_x": "Grid2x2X",
1674
+ }
@@ -6,7 +6,7 @@
6
6
  from typing import Any, Dict, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import Component
9
- from reflex.event import BASE_STATE, EventType
9
+ from reflex.event import EventType
10
10
  from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
@@ -22,21 +22,21 @@ class LucideIconComponent(Component):
22
22
  class_name: Optional[Any] = None,
23
23
  autofocus: Optional[bool] = None,
24
24
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
25
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
26
- on_click: Optional[EventType[[], BASE_STATE]] = None,
27
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
28
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
29
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
30
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
31
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
32
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
33
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
34
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
35
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
36
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
37
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
38
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
39
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
25
+ on_blur: Optional[EventType[()]] = None,
26
+ on_click: Optional[EventType[()]] = None,
27
+ on_context_menu: Optional[EventType[()]] = None,
28
+ on_double_click: Optional[EventType[()]] = None,
29
+ on_focus: Optional[EventType[()]] = None,
30
+ on_mount: Optional[EventType[()]] = None,
31
+ on_mouse_down: Optional[EventType[()]] = None,
32
+ on_mouse_enter: Optional[EventType[()]] = None,
33
+ on_mouse_leave: Optional[EventType[()]] = None,
34
+ on_mouse_move: Optional[EventType[()]] = None,
35
+ on_mouse_out: Optional[EventType[()]] = None,
36
+ on_mouse_over: Optional[EventType[()]] = None,
37
+ on_mouse_up: Optional[EventType[()]] = None,
38
+ on_scroll: Optional[EventType[()]] = None,
39
+ on_unmount: Optional[EventType[()]] = None,
40
40
  **props,
41
41
  ) -> "LucideIconComponent":
42
42
  """Create the component.
@@ -69,21 +69,21 @@ class Icon(LucideIconComponent):
69
69
  class_name: Optional[Any] = None,
70
70
  autofocus: Optional[bool] = None,
71
71
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
72
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
73
- on_click: Optional[EventType[[], BASE_STATE]] = None,
74
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
75
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
76
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
77
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
78
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
79
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
80
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
81
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
82
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
83
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
84
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
85
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
86
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
72
+ on_blur: Optional[EventType[()]] = None,
73
+ on_click: Optional[EventType[()]] = None,
74
+ on_context_menu: Optional[EventType[()]] = None,
75
+ on_double_click: Optional[EventType[()]] = None,
76
+ on_focus: Optional[EventType[()]] = None,
77
+ on_mount: Optional[EventType[()]] = None,
78
+ on_mouse_down: Optional[EventType[()]] = None,
79
+ on_mouse_enter: Optional[EventType[()]] = None,
80
+ on_mouse_leave: Optional[EventType[()]] = None,
81
+ on_mouse_move: Optional[EventType[()]] = None,
82
+ on_mouse_out: Optional[EventType[()]] = None,
83
+ on_mouse_over: Optional[EventType[()]] = None,
84
+ on_mouse_up: Optional[EventType[()]] = None,
85
+ on_scroll: Optional[EventType[()]] = None,
86
+ on_unmount: Optional[EventType[()]] = None,
87
87
  **props,
88
88
  ) -> "Icon":
89
89
  """Initialize the Icon component.
@@ -104,12 +104,60 @@ class Icon(LucideIconComponent):
104
104
  Raises:
105
105
  AttributeError: The errors tied to bad usage of the Icon component.
106
106
  ValueError: If the icon tag is invalid.
107
+ TypeError: If the icon name is not a string.
107
108
 
108
109
  Returns:
109
110
  The created component.
110
111
  """
111
112
  ...
112
113
 
114
+ class DynamicIcon(LucideIconComponent):
115
+ @overload
116
+ @classmethod
117
+ def create( # type: ignore
118
+ cls,
119
+ *children,
120
+ name: Optional[Union[Var[str], str]] = None,
121
+ style: Optional[Style] = None,
122
+ key: Optional[Any] = None,
123
+ id: Optional[Any] = None,
124
+ class_name: Optional[Any] = None,
125
+ autofocus: Optional[bool] = None,
126
+ custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
127
+ on_blur: Optional[EventType[()]] = None,
128
+ on_click: Optional[EventType[()]] = None,
129
+ on_context_menu: Optional[EventType[()]] = None,
130
+ on_double_click: Optional[EventType[()]] = None,
131
+ on_focus: Optional[EventType[()]] = None,
132
+ on_mount: Optional[EventType[()]] = None,
133
+ on_mouse_down: Optional[EventType[()]] = None,
134
+ on_mouse_enter: Optional[EventType[()]] = None,
135
+ on_mouse_leave: Optional[EventType[()]] = None,
136
+ on_mouse_move: Optional[EventType[()]] = None,
137
+ on_mouse_out: Optional[EventType[()]] = None,
138
+ on_mouse_over: Optional[EventType[()]] = None,
139
+ on_mouse_up: Optional[EventType[()]] = None,
140
+ on_scroll: Optional[EventType[()]] = None,
141
+ on_unmount: Optional[EventType[()]] = None,
142
+ **props,
143
+ ) -> "DynamicIcon":
144
+ """Create the component.
145
+
146
+ Args:
147
+ *children: The children of the component.
148
+ style: The style of the component.
149
+ key: A unique key for the component.
150
+ id: The id for the component.
151
+ class_name: The class name for the component.
152
+ autofocus: Whether the component should take the focus once the page is loaded
153
+ custom_attrs: custom attribute
154
+ **props: The props of the component.
155
+
156
+ Returns:
157
+ The component.
158
+ """
159
+ ...
160
+
113
161
  LUCIDE_ICON_LIST = [
114
162
  "a_arrow_down",
115
163
  "a_arrow_up",
@@ -889,6 +937,7 @@ LUCIDE_ICON_LIST = [
889
937
  "house",
890
938
  "house_plug",
891
939
  "house_plus",
940
+ "house_wifi",
892
941
  "ice_cream_bowl",
893
942
  "ice_cream_cone",
894
943
  "id_card",
@@ -1577,6 +1626,7 @@ LUCIDE_ICON_LIST = [
1577
1626
  "trending_up_down",
1578
1627
  "triangle",
1579
1628
  "triangle_alert",
1629
+ "triangle_dashed",
1580
1630
  "triangle_right",
1581
1631
  "trophy",
1582
1632
  "truck",
@@ -1682,3 +1732,7 @@ LUCIDE_ICON_LIST = [
1682
1732
  "zoom_in",
1683
1733
  "zoom_out",
1684
1734
  ]
1735
+ LUCIDE_ICON_MAPPING_OVERRIDE = {
1736
+ "grid_2x_2_check": "Grid2x2Check",
1737
+ "grid_2x_2_x": "Grid2x2X",
1738
+ }
@@ -8,7 +8,7 @@ from functools import lru_cache
8
8
  from hashlib import md5
9
9
  from typing import Any, Callable, Dict, Sequence, Union
10
10
 
11
- from reflex.components.component import Component, CustomComponent
11
+ from reflex.components.component import BaseComponent, Component, CustomComponent
12
12
  from reflex.components.tags.tag import Tag
13
13
  from reflex.utils import types
14
14
  from reflex.utils.imports import ImportDict, ImportVar
@@ -65,8 +65,8 @@ def get_base_component_map() -> dict[str, Callable]:
65
65
  "h5": lambda value: Heading.create(value, as_="h5", size="2", margin_y="0.5em"),
66
66
  "h6": lambda value: Heading.create(value, as_="h6", size="1", margin_y="0.5em"),
67
67
  "p": lambda value: Text.create(value, margin_y="1em"),
68
- "ul": lambda value: UnorderedList.create(value, margin_y="1em"), # type: ignore
69
- "ol": lambda value: OrderedList.create(value, margin_y="1em"), # type: ignore
68
+ "ul": lambda value: UnorderedList.create(value, margin_y="1em"),
69
+ "ol": lambda value: OrderedList.create(value, margin_y="1em"),
70
70
  "li": lambda value: ListItem.create(value, margin_y="0.5em"),
71
71
  "a": lambda value: Link.create(value),
72
72
  "code": lambda value: Code.create(value),
@@ -236,7 +236,7 @@ class Markdown(Component):
236
236
  ),
237
237
  },
238
238
  *[
239
- component(_MOCK_ARG)._get_all_imports() # type: ignore
239
+ component(_MOCK_ARG)._get_all_imports()
240
240
  for component in self.component_map.values()
241
241
  ],
242
242
  ]
@@ -327,7 +327,7 @@ const {_LANGUAGE!s} = match ? match[1] : '';
327
327
  if tag != "codeblock"
328
328
  # For codeblock, the mapping for some cases returns an array of elements. Let's join them into a string.
329
329
  else ternary_operation(
330
- ARRAY_ISARRAY.call(_CHILDREN), # type: ignore
330
+ ARRAY_ISARRAY.call(_CHILDREN), # pyright: ignore [reportArgumentType]
331
331
  _CHILDREN.to(list).join("\n"),
332
332
  _CHILDREN,
333
333
  ).to(str)
@@ -379,7 +379,9 @@ const {_LANGUAGE!s} = match ? match[1] : '';
379
379
  # fallback to the default fn Var creation if the component is not a MarkdownComponentMap.
380
380
  return MarkdownComponentMap.create_map_fn_var(fn_body=formatted_component)
381
381
 
382
- def _get_map_fn_custom_code_from_children(self, component) -> list[str]:
382
+ def _get_map_fn_custom_code_from_children(
383
+ self, component: BaseComponent
384
+ ) -> list[str]:
383
385
  """Recursively get markdown custom code from children components.
384
386
 
385
387
  Args:
@@ -409,7 +411,7 @@ const {_LANGUAGE!s} = match ? match[1] : '';
409
411
  return custom_code_list
410
412
 
411
413
  @staticmethod
412
- def _component_map_hash(component_map) -> str:
414
+ def _component_map_hash(component_map: dict) -> str:
413
415
  inp = str(
414
416
  {tag: component(_MOCK_ARG) for tag, component in component_map.items()}
415
417
  ).encode()
@@ -425,7 +427,7 @@ const {_LANGUAGE!s} = match ? match[1] : '';
425
427
  for _component in self.component_map.values():
426
428
  comp = _component(_MOCK_ARG)
427
429
  hooks.update(comp._get_all_hooks())
428
- formatted_hooks = MACROS.module.renderHooks(hooks) # type: ignore
430
+ formatted_hooks = MACROS.module.renderHooks(hooks) # pyright: ignore [reportAttributeAccessIssue]
429
431
  return f"""
430
432
  function {self._get_component_map_name()} () {{
431
433
  {formatted_hooks}
@@ -8,7 +8,7 @@ from functools import lru_cache
8
8
  from typing import Any, Callable, Dict, Optional, Sequence, Union, overload
9
9
 
10
10
  from reflex.components.component import Component
11
- from reflex.event import BASE_STATE, EventType
11
+ from reflex.event import EventType
12
12
  from reflex.style import Style
13
13
  from reflex.utils.imports import ImportDict
14
14
  from reflex.vars.base import LiteralVar, Var
@@ -59,21 +59,21 @@ class Markdown(Component):
59
59
  class_name: Optional[Any] = None,
60
60
  autofocus: Optional[bool] = None,
61
61
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
62
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
63
- on_click: Optional[EventType[[], BASE_STATE]] = None,
64
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
65
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
66
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
67
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
68
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
69
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
70
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
71
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
72
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
73
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
74
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
75
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
76
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
62
+ on_blur: Optional[EventType[()]] = None,
63
+ on_click: Optional[EventType[()]] = None,
64
+ on_context_menu: Optional[EventType[()]] = None,
65
+ on_double_click: Optional[EventType[()]] = None,
66
+ on_focus: Optional[EventType[()]] = None,
67
+ on_mount: Optional[EventType[()]] = None,
68
+ on_mouse_down: Optional[EventType[()]] = None,
69
+ on_mouse_enter: Optional[EventType[()]] = None,
70
+ on_mouse_leave: Optional[EventType[()]] = None,
71
+ on_mouse_move: Optional[EventType[()]] = None,
72
+ on_mouse_out: Optional[EventType[()]] = None,
73
+ on_mouse_over: Optional[EventType[()]] = None,
74
+ on_mouse_up: Optional[EventType[()]] = None,
75
+ on_scroll: Optional[EventType[()]] = None,
76
+ on_unmount: Optional[EventType[()]] = None,
77
77
  **props,
78
78
  ) -> "Markdown":
79
79
  """Create a markdown component.
@@ -28,9 +28,9 @@ class MomentDelta:
28
28
  class Moment(NoSSRComponent):
29
29
  """The Moment component."""
30
30
 
31
- tag: str = "Moment"
31
+ tag: str | None = "Moment"
32
32
  is_default = True
33
- library: str = "react-moment"
33
+ library: str | None = "react-moment"
34
34
  lib_dependencies: List[str] = ["moment"]
35
35
 
36
36
  # How often the date update (how often time update / 0 to disable).
@@ -8,7 +8,7 @@ from datetime import date, datetime, time, timedelta
8
8
  from typing import Any, Dict, Optional, Union, overload
9
9
 
10
10
  from reflex.components.component import NoSSRComponent
11
- from reflex.event import BASE_STATE, EventType
11
+ from reflex.event import EventType
12
12
  from reflex.style import Style
13
13
  from reflex.utils.imports import ImportDict
14
14
  from reflex.vars.base import Var
@@ -68,24 +68,22 @@ class Moment(NoSSRComponent):
68
68
  class_name: Optional[Any] = None,
69
69
  autofocus: Optional[bool] = None,
70
70
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
71
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
72
- on_change: Optional[
73
- Union[EventType[[], BASE_STATE], EventType[[str], BASE_STATE]]
74
- ] = None,
75
- on_click: Optional[EventType[[], BASE_STATE]] = None,
76
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
77
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
78
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
79
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
80
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
81
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
82
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
83
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
84
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
85
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
86
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
87
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
88
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
71
+ on_blur: Optional[EventType[()]] = None,
72
+ on_change: Optional[Union[EventType[()], EventType[str]]] = None,
73
+ on_click: Optional[EventType[()]] = None,
74
+ on_context_menu: Optional[EventType[()]] = None,
75
+ on_double_click: Optional[EventType[()]] = None,
76
+ on_focus: Optional[EventType[()]] = None,
77
+ on_mount: Optional[EventType[()]] = None,
78
+ on_mouse_down: Optional[EventType[()]] = None,
79
+ on_mouse_enter: Optional[EventType[()]] = None,
80
+ on_mouse_leave: Optional[EventType[()]] = None,
81
+ on_mouse_move: Optional[EventType[()]] = None,
82
+ on_mouse_out: Optional[EventType[()]] = None,
83
+ on_mouse_over: Optional[EventType[()]] = None,
84
+ on_mouse_up: Optional[EventType[()]] = None,
85
+ on_scroll: Optional[EventType[()]] = None,
86
+ on_unmount: Optional[EventType[()]] = None,
89
87
  **props,
90
88
  ) -> "Moment":
91
89
  """Create the component.
@@ -6,7 +6,7 @@
6
6
  from typing import Any, Dict, Optional, Union, overload
7
7
 
8
8
  from reflex.components.component import Component
9
- from reflex.event import BASE_STATE, EventType
9
+ from reflex.event import EventType
10
10
  from reflex.style import Style
11
11
  from reflex.vars.base import Var
12
12
 
@@ -24,21 +24,21 @@ class NextComponent(Component):
24
24
  class_name: Optional[Any] = None,
25
25
  autofocus: Optional[bool] = None,
26
26
  custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
27
- on_blur: Optional[EventType[[], BASE_STATE]] = None,
28
- on_click: Optional[EventType[[], BASE_STATE]] = None,
29
- on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
30
- on_double_click: Optional[EventType[[], BASE_STATE]] = None,
31
- on_focus: Optional[EventType[[], BASE_STATE]] = None,
32
- on_mount: Optional[EventType[[], BASE_STATE]] = None,
33
- on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
34
- on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
35
- on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
36
- on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
37
- on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
38
- on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
39
- on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
40
- on_scroll: Optional[EventType[[], BASE_STATE]] = None,
41
- on_unmount: Optional[EventType[[], BASE_STATE]] = None,
27
+ on_blur: Optional[EventType[()]] = None,
28
+ on_click: Optional[EventType[()]] = None,
29
+ on_context_menu: Optional[EventType[()]] = None,
30
+ on_double_click: Optional[EventType[()]] = None,
31
+ on_focus: Optional[EventType[()]] = None,
32
+ on_mount: Optional[EventType[()]] = None,
33
+ on_mouse_down: Optional[EventType[()]] = None,
34
+ on_mouse_enter: Optional[EventType[()]] = None,
35
+ on_mouse_leave: Optional[EventType[()]] = None,
36
+ on_mouse_move: Optional[EventType[()]] = None,
37
+ on_mouse_out: Optional[EventType[()]] = None,
38
+ on_mouse_over: Optional[EventType[()]] = None,
39
+ on_mouse_up: Optional[EventType[()]] = None,
40
+ on_scroll: Optional[EventType[()]] = None,
41
+ on_unmount: Optional[EventType[()]] = None,
42
42
  **props,
43
43
  ) -> "NextComponent":
44
44
  """Create the component.
@@ -1,13 +1,17 @@
1
1
  """Image component from next/image."""
2
2
 
3
+ from __future__ import annotations
4
+
3
5
  from typing import Any, Literal, Optional, Union
4
6
 
5
7
  from reflex.event import EventHandler, no_args_event_spec
6
- from reflex.utils import types
8
+ from reflex.utils import console, types
7
9
  from reflex.vars.base import Var
8
10
 
9
11
  from .base import NextComponent
10
12
 
13
+ DEFAULT_W_H = "100%"
14
+
11
15
 
12
16
  class Image(NextComponent):
13
17
  """Display an image."""
@@ -53,7 +57,7 @@ class Image(NextComponent):
53
57
  loading: Var[Literal["lazy", "eager"]]
54
58
 
55
59
  # A Data URL to be used as a placeholder image before the src image successfully loads. Only takes effect when combined with placeholder="blur".
56
- blurDataURL: Var[str]
60
+ blur_data_url: Var[str]
57
61
 
58
62
  # Fires when the image has loaded.
59
63
  on_load: EventHandler[no_args_event_spec]
@@ -80,10 +84,18 @@ class Image(NextComponent):
80
84
  Returns:
81
85
  _type_: _description_
82
86
  """
87
+ if "blurDataURL" in props:
88
+ console.deprecate(
89
+ feature_name="blurDataURL",
90
+ reason="Use blur_data_url instead",
91
+ deprecation_version="0.7.0",
92
+ removal_version="0.8.0",
93
+ )
94
+ props["blur_data_url"] = props.pop("blurDataURL")
95
+
83
96
  style = props.get("style", {})
84
- DEFAULT_W_H = "100%"
85
97
 
86
- def check_prop_type(prop_name, prop_value):
98
+ def check_prop_type(prop_name: str, prop_value: int | str | None):
87
99
  if types.check_prop_in_allowed_types(prop_value, allowed_types=[int]):
88
100
  props[prop_name] = prop_value
89
101