reflex 0.3.9a3__py3-none-any.whl → 0.3.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

Files changed (247) hide show
  1. reflex/__init__.py +3 -1
  2. reflex/__init__.pyi +3 -1
  3. reflex/app.py +116 -86
  4. reflex/compiler/compiler.py +110 -0
  5. reflex/compiler/utils.py +13 -12
  6. reflex/components/base/app_wrap.pyi +1 -0
  7. reflex/components/base/body.pyi +2 -0
  8. reflex/components/base/document.pyi +10 -0
  9. reflex/components/base/fragment.pyi +2 -0
  10. reflex/components/base/head.pyi +4 -0
  11. reflex/components/base/link.pyi +4 -0
  12. reflex/components/base/meta.pyi +8 -0
  13. reflex/components/base/script.pyi +2 -0
  14. reflex/components/chakra/base.pyi +7 -0
  15. reflex/components/chakra/datadisplay/badge.pyi +2 -0
  16. reflex/components/chakra/datadisplay/code.pyi +4 -0
  17. reflex/components/chakra/datadisplay/divider.pyi +2 -0
  18. reflex/components/chakra/datadisplay/keyboard_key.pyi +2 -0
  19. reflex/components/chakra/datadisplay/list.pyi +8 -0
  20. reflex/components/chakra/datadisplay/stat.pyi +12 -0
  21. reflex/components/chakra/datadisplay/table.pyi +18 -0
  22. reflex/components/chakra/datadisplay/tag.pyi +9 -0
  23. reflex/components/chakra/disclosure/accordion.pyi +10 -0
  24. reflex/components/chakra/disclosure/tabs.py +8 -0
  25. reflex/components/chakra/disclosure/tabs.pyi +10 -0
  26. reflex/components/chakra/disclosure/transition.pyi +12 -0
  27. reflex/components/chakra/disclosure/visuallyhidden.pyi +2 -0
  28. reflex/components/chakra/feedback/alert.pyi +8 -0
  29. reflex/components/chakra/feedback/circularprogress.pyi +4 -0
  30. reflex/components/chakra/feedback/progress.pyi +2 -0
  31. reflex/components/chakra/feedback/skeleton.pyi +6 -0
  32. reflex/components/chakra/feedback/spinner.pyi +2 -0
  33. reflex/components/chakra/forms/button.pyi +4 -0
  34. reflex/components/chakra/forms/checkbox.pyi +4 -0
  35. reflex/components/chakra/forms/colormodeswitch.pyi +7 -0
  36. reflex/components/chakra/forms/date_picker.pyi +2 -0
  37. reflex/components/chakra/forms/date_time_picker.pyi +2 -0
  38. reflex/components/chakra/forms/editable.pyi +8 -0
  39. reflex/components/chakra/forms/email.pyi +2 -0
  40. reflex/components/chakra/forms/form.pyi +10 -0
  41. reflex/components/chakra/forms/iconbutton.py +1 -0
  42. reflex/components/chakra/forms/iconbutton.pyi +2 -0
  43. reflex/components/chakra/forms/input.pyi +12 -0
  44. reflex/components/chakra/forms/numberinput.pyi +10 -0
  45. reflex/components/chakra/forms/password.pyi +2 -0
  46. reflex/components/chakra/forms/pininput.pyi +4 -0
  47. reflex/components/chakra/forms/radio.pyi +4 -0
  48. reflex/components/chakra/forms/rangeslider.pyi +8 -0
  49. reflex/components/chakra/forms/select.pyi +4 -0
  50. reflex/components/chakra/forms/slider.pyi +10 -0
  51. reflex/components/chakra/forms/switch.pyi +2 -0
  52. reflex/components/chakra/forms/textarea.pyi +2 -0
  53. reflex/components/chakra/forms/time_picker.pyi +2 -0
  54. reflex/components/chakra/layout/aspect_ratio.pyi +2 -0
  55. reflex/components/chakra/layout/box.pyi +2 -0
  56. reflex/components/chakra/layout/card.pyi +7 -0
  57. reflex/components/chakra/layout/center.pyi +6 -0
  58. reflex/components/chakra/layout/container.pyi +2 -0
  59. reflex/components/chakra/layout/flex.pyi +2 -0
  60. reflex/components/chakra/layout/grid.pyi +6 -0
  61. reflex/components/chakra/layout/html.pyi +2 -0
  62. reflex/components/chakra/layout/spacer.pyi +2 -0
  63. reflex/components/chakra/layout/stack.pyi +6 -0
  64. reflex/components/chakra/layout/wrap.pyi +4 -0
  65. reflex/components/chakra/media/avatar.pyi +6 -0
  66. reflex/components/chakra/media/icon.pyi +4 -0
  67. reflex/components/chakra/media/image.pyi +2 -0
  68. reflex/components/chakra/navigation/breadcrumb.pyi +8 -0
  69. reflex/components/chakra/navigation/link.pyi +2 -0
  70. reflex/components/chakra/navigation/linkoverlay.pyi +4 -0
  71. reflex/components/chakra/navigation/stepper.pyi +18 -0
  72. reflex/components/chakra/overlay/alertdialog.pyi +14 -0
  73. reflex/components/chakra/overlay/drawer.pyi +14 -0
  74. reflex/components/chakra/overlay/menu.pyi +16 -0
  75. reflex/components/chakra/overlay/modal.pyi +14 -0
  76. reflex/components/chakra/overlay/popover.pyi +18 -0
  77. reflex/components/chakra/overlay/tooltip.pyi +2 -0
  78. reflex/components/chakra/typography/heading.pyi +2 -0
  79. reflex/components/chakra/typography/highlight.pyi +2 -0
  80. reflex/components/chakra/typography/span.pyi +2 -0
  81. reflex/components/chakra/typography/text.pyi +2 -0
  82. reflex/components/component.py +41 -3
  83. reflex/components/core/__init__.py +2 -0
  84. reflex/components/core/banner.pyi +3 -0
  85. reflex/components/core/client_side_routing.pyi +4 -0
  86. reflex/components/core/colors.py +21 -0
  87. reflex/components/core/cond.py +11 -2
  88. reflex/components/core/debounce.pyi +1 -0
  89. reflex/components/core/layout/__init__.py +1 -0
  90. reflex/components/core/match.py +44 -18
  91. reflex/components/core/upload.py +8 -2
  92. reflex/components/core/upload.pyi +7 -1
  93. reflex/components/datadisplay/dataeditor.pyi +2 -0
  94. reflex/components/el/element.pyi +2 -0
  95. reflex/components/el/elements/base.pyi +2 -0
  96. reflex/components/el/elements/forms.py +3 -0
  97. reflex/components/el/elements/forms.pyi +32 -0
  98. reflex/components/el/elements/inline.pyi +56 -0
  99. reflex/components/el/elements/media.pyi +28 -0
  100. reflex/components/el/elements/metadata.pyi +10 -0
  101. reflex/components/el/elements/other.pyi +14 -0
  102. reflex/components/el/elements/scripts.pyi +6 -0
  103. reflex/components/el/elements/sectioning.pyi +30 -0
  104. reflex/components/el/elements/tables.pyi +20 -0
  105. reflex/components/el/elements/typography.pyi +30 -0
  106. reflex/components/gridjs/datatable.pyi +4 -0
  107. reflex/components/lucide/__init__.py +5 -0
  108. reflex/components/lucide/icon.py +1484 -0
  109. reflex/components/lucide/icon.pyi +1594 -0
  110. reflex/components/markdown/markdown.pyi +2 -0
  111. reflex/components/moment/moment.pyi +2 -0
  112. reflex/components/next/base.pyi +2 -0
  113. reflex/components/next/image.pyi +2 -0
  114. reflex/components/next/link.pyi +2 -0
  115. reflex/components/next/video.pyi +2 -0
  116. reflex/components/plotly/plotly.pyi +4 -0
  117. reflex/components/radix/primitives/__init__.py +10 -0
  118. reflex/components/radix/primitives/accordion.py +51 -32
  119. reflex/components/radix/primitives/accordion.pyi +16 -3
  120. reflex/components/radix/primitives/base.pyi +4 -0
  121. reflex/components/radix/primitives/drawer.py +240 -0
  122. reflex/components/radix/primitives/drawer.pyi +814 -0
  123. reflex/components/radix/primitives/form.py +40 -7
  124. reflex/components/radix/primitives/form.pyi +32 -10
  125. reflex/components/radix/primitives/progress.py +2 -2
  126. reflex/components/radix/primitives/progress.pyi +6 -0
  127. reflex/components/radix/primitives/slider.pyi +10 -0
  128. reflex/components/radix/themes/base.py +46 -12
  129. reflex/components/radix/themes/base.pyi +23 -9
  130. reflex/components/radix/themes/components/__init__.py +4 -2
  131. reflex/components/radix/themes/components/alertdialog.py +13 -12
  132. reflex/components/radix/themes/components/alertdialog.pyi +23 -351
  133. reflex/components/radix/themes/components/aspectratio.py +2 -5
  134. reflex/components/radix/themes/components/aspectratio.pyi +4 -51
  135. reflex/components/radix/themes/components/avatar.py +3 -4
  136. reflex/components/radix/themes/components/avatar.pyi +4 -57
  137. reflex/components/radix/themes/components/badge.py +3 -4
  138. reflex/components/radix/themes/components/badge.pyi +4 -56
  139. reflex/components/radix/themes/components/button.py +2 -3
  140. reflex/components/radix/themes/components/button.pyi +3 -51
  141. reflex/components/radix/themes/components/callout.py +9 -12
  142. reflex/components/radix/themes/components/callout.pyi +24 -217
  143. reflex/components/radix/themes/components/card.py +1 -2
  144. reflex/components/radix/themes/components/card.pyi +4 -51
  145. reflex/components/radix/themes/components/checkbox.py +11 -5
  146. reflex/components/radix/themes/components/checkbox.pyi +13 -112
  147. reflex/components/radix/themes/components/contextmenu.py +21 -21
  148. reflex/components/radix/themes/components/contextmenu.pyi +26 -401
  149. reflex/components/radix/themes/components/dialog.py +13 -16
  150. reflex/components/radix/themes/components/dialog.pyi +20 -303
  151. reflex/components/radix/themes/components/dropdownmenu.py +196 -32
  152. reflex/components/radix/themes/components/dropdownmenu.pyi +147 -389
  153. reflex/components/radix/themes/components/hovercard.py +5 -5
  154. reflex/components/radix/themes/components/hovercard.pyi +11 -151
  155. reflex/components/radix/themes/components/iconbutton.py +56 -4
  156. reflex/components/radix/themes/components/iconbutton.pyi +25 -71
  157. reflex/components/radix/themes/components/icons.pyi +4 -0
  158. reflex/components/radix/themes/components/inset.py +1 -2
  159. reflex/components/radix/themes/components/inset.pyi +4 -51
  160. reflex/components/radix/themes/components/popover.py +12 -12
  161. reflex/components/radix/themes/components/popover.pyi +14 -201
  162. reflex/components/radix/themes/components/radiogroup.py +47 -20
  163. reflex/components/radix/themes/components/radiogroup.pyi +26 -171
  164. reflex/components/radix/themes/components/scrollarea.py +2 -3
  165. reflex/components/radix/themes/components/scrollarea.pyi +4 -51
  166. reflex/components/radix/themes/components/select.py +28 -25
  167. reflex/components/radix/themes/components/select.pyi +43 -419
  168. reflex/components/radix/themes/components/separator.py +4 -5
  169. reflex/components/radix/themes/components/separator.pyi +5 -52
  170. reflex/components/radix/themes/components/slider.py +8 -5
  171. reflex/components/radix/themes/components/slider.pyi +9 -60
  172. reflex/components/radix/themes/components/switch.py +6 -4
  173. reflex/components/radix/themes/components/switch.pyi +5 -53
  174. reflex/components/radix/themes/components/table.py +14 -15
  175. reflex/components/radix/themes/components/table.pyi +22 -351
  176. reflex/components/radix/themes/components/tabs.py +9 -6
  177. reflex/components/radix/themes/components/tabs.pyi +18 -205
  178. reflex/components/radix/themes/components/textarea.py +2 -3
  179. reflex/components/radix/themes/components/textarea.pyi +10 -53
  180. reflex/components/radix/themes/components/textfield.py +105 -4
  181. reflex/components/radix/themes/components/textfield.pyi +200 -108
  182. reflex/components/radix/themes/components/tooltip.py +102 -2
  183. reflex/components/radix/themes/components/tooltip.pyi +66 -110
  184. reflex/components/radix/themes/layout/__init__.py +7 -0
  185. reflex/components/radix/themes/layout/base.pyi +2 -0
  186. reflex/components/radix/themes/layout/box.py +2 -2
  187. reflex/components/radix/themes/layout/box.pyi +4 -104
  188. reflex/components/radix/themes/layout/center.py +19 -0
  189. reflex/components/radix/themes/layout/center.pyi +261 -0
  190. reflex/components/radix/themes/layout/container.py +2 -2
  191. reflex/components/radix/themes/layout/container.pyi +4 -104
  192. reflex/components/radix/themes/layout/flex.py +2 -2
  193. reflex/components/radix/themes/layout/flex.pyi +4 -105
  194. reflex/components/radix/themes/layout/grid.pyi +2 -0
  195. reflex/components/radix/themes/layout/section.py +2 -2
  196. reflex/components/radix/themes/layout/section.pyi +4 -104
  197. reflex/components/radix/themes/layout/spacer.py +19 -0
  198. reflex/components/radix/themes/layout/spacer.pyi +261 -0
  199. reflex/components/radix/themes/layout/stack.py +60 -0
  200. reflex/components/radix/themes/layout/stack.pyi +537 -0
  201. reflex/components/radix/themes/typography/blockquote.py +2 -3
  202. reflex/components/radix/themes/typography/blockquote.pyi +4 -51
  203. reflex/components/radix/themes/typography/code.py +2 -3
  204. reflex/components/radix/themes/typography/code.pyi +4 -56
  205. reflex/components/radix/themes/typography/em.py +1 -2
  206. reflex/components/radix/themes/typography/em.pyi +4 -51
  207. reflex/components/radix/themes/typography/heading.py +2 -3
  208. reflex/components/radix/themes/typography/heading.pyi +4 -51
  209. reflex/components/radix/themes/typography/kbd.py +1 -2
  210. reflex/components/radix/themes/typography/kbd.pyi +4 -51
  211. reflex/components/radix/themes/typography/link.py +34 -3
  212. reflex/components/radix/themes/typography/link.pyi +41 -86
  213. reflex/components/radix/themes/typography/quote.py +1 -2
  214. reflex/components/radix/themes/typography/quote.pyi +4 -51
  215. reflex/components/radix/themes/typography/strong.py +1 -2
  216. reflex/components/radix/themes/typography/strong.pyi +4 -51
  217. reflex/components/radix/themes/typography/text.py +2 -3
  218. reflex/components/radix/themes/typography/text.pyi +4 -51
  219. reflex/components/radix/themes/typography.py +10 -11
  220. reflex/components/react_player/audio.pyi +2 -0
  221. reflex/components/react_player/react_player.pyi +2 -0
  222. reflex/components/react_player/video.pyi +2 -0
  223. reflex/components/recharts/cartesian.pyi +38 -0
  224. reflex/components/recharts/charts.pyi +22 -0
  225. reflex/components/recharts/general.pyi +10 -0
  226. reflex/components/recharts/polar.pyi +12 -0
  227. reflex/components/recharts/recharts.pyi +4 -0
  228. reflex/components/suneditor/editor.pyi +2 -0
  229. reflex/components/tags/tag.py +1 -1
  230. reflex/constants/base.py +5 -1
  231. reflex/constants/colors.py +80 -0
  232. reflex/constants/event.py +10 -1
  233. reflex/page.py +1 -1
  234. reflex/reflex.py +4 -0
  235. reflex/style.py +8 -3
  236. reflex/testing.py +21 -10
  237. reflex/utils/format.py +13 -9
  238. reflex/utils/prerequisites.py +41 -3
  239. reflex/utils/serializers.py +14 -0
  240. reflex/utils/telemetry.py +8 -2
  241. reflex/utils/types.py +36 -2
  242. reflex/vars.py +53 -18
  243. {reflex-0.3.9a3.dist-info → reflex-0.3.10.dist-info}/METADATA +1 -2
  244. {reflex-0.3.9a3.dist-info → reflex-0.3.10.dist-info}/RECORD +247 -233
  245. {reflex-0.3.9a3.dist-info → reflex-0.3.10.dist-info}/WHEEL +1 -1
  246. {reflex-0.3.9a3.dist-info → reflex-0.3.10.dist-info}/LICENSE +0 -0
  247. {reflex-0.3.9a3.dist-info → reflex-0.3.10.dist-info}/entry_points.txt +0 -0
@@ -55,6 +55,7 @@ class Markdown(Component):
55
55
  id: Optional[Any] = None,
56
56
  class_name: Optional[Any] = None,
57
57
  autofocus: Optional[bool] = None,
58
+ _rename_props: Optional[Dict[str, str]] = None,
58
59
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
59
60
  on_blur: Optional[
60
61
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -115,6 +116,7 @@ class Markdown(Component):
115
116
  id: The id for the component.
116
117
  class_name: The class name for the component.
117
118
  autofocus: Whether the component should take the focus once the page is loaded
119
+ _rename_props: props to change the name of
118
120
  custom_attrs: custom attribute
119
121
  **props: The properties of the component.
120
122
 
@@ -56,6 +56,7 @@ class Moment(NoSSRComponent):
56
56
  id: Optional[Any] = None,
57
57
  class_name: Optional[Any] = None,
58
58
  autofocus: Optional[bool] = None,
59
+ _rename_props: Optional[Dict[str, str]] = None,
59
60
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
60
61
  on_blur: Optional[
61
62
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -136,6 +137,7 @@ class Moment(NoSSRComponent):
136
137
  id: The id for the component.
137
138
  class_name: The class name for the component.
138
139
  autofocus: Whether the component should take the focus once the page is loaded
140
+ _rename_props: props to change the name of
139
141
  custom_attrs: custom attribute
140
142
  **props: The properties of the component.
141
143
 
@@ -22,6 +22,7 @@ class NextComponent(Component):
22
22
  id: Optional[Any] = None,
23
23
  class_name: Optional[Any] = None,
24
24
  autofocus: Optional[bool] = None,
25
+ _rename_props: Optional[Dict[str, str]] = None,
25
26
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
26
27
  on_blur: Optional[
27
28
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -79,6 +80,7 @@ class NextComponent(Component):
79
80
  id: The id for the component.
80
81
  class_name: The class name for the component.
81
82
  autofocus: Whether the component should take the focus once the page is loaded
83
+ _rename_props: props to change the name of
82
84
  custom_attrs: custom attribute
83
85
  **props: The props of the component.
84
86
 
@@ -38,6 +38,7 @@ class Image(NextComponent):
38
38
  id: Optional[Any] = None,
39
39
  class_name: Optional[Any] = None,
40
40
  autofocus: Optional[bool] = None,
41
+ _rename_props: Optional[Dict[str, str]] = None,
41
42
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
42
43
  on_blur: Optional[
43
44
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -113,6 +114,7 @@ class Image(NextComponent):
113
114
  id: The id for the component.
114
115
  class_name: The class name for the component.
115
116
  autofocus: Whether the component should take the focus once the page is loaded
117
+ _rename_props: props to change the name of
116
118
  custom_attrs: custom attribute
117
119
  **props:The props of the component.
118
120
 
@@ -23,6 +23,7 @@ class NextLink(Component):
23
23
  id: Optional[Any] = None,
24
24
  class_name: Optional[Any] = None,
25
25
  autofocus: Optional[bool] = None,
26
+ _rename_props: Optional[Dict[str, str]] = None,
26
27
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
27
28
  on_blur: Optional[
28
29
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -82,6 +83,7 @@ class NextLink(Component):
82
83
  id: The id for the component.
83
84
  class_name: The class name for the component.
84
85
  autofocus: Whether the component should take the focus once the page is loaded
86
+ _rename_props: props to change the name of
85
87
  custom_attrs: custom attribute
86
88
  **props: The props of the component.
87
89
 
@@ -25,6 +25,7 @@ class Video(NextComponent):
25
25
  id: Optional[Any] = None,
26
26
  class_name: Optional[Any] = None,
27
27
  autofocus: Optional[bool] = None,
28
+ _rename_props: Optional[Dict[str, str]] = None,
28
29
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
29
30
  on_blur: Optional[
30
31
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -83,6 +84,7 @@ class Video(NextComponent):
83
84
  id: The id for the component.
84
85
  class_name: The class name for the component.
85
86
  autofocus: Whether the component should take the focus once the page is loaded
87
+ _rename_props: props to change the name of
86
88
  custom_attrs: custom attribute
87
89
  **props: The props of the component.
88
90
 
@@ -27,6 +27,7 @@ class PlotlyLib(NoSSRComponent):
27
27
  id: Optional[Any] = None,
28
28
  class_name: Optional[Any] = None,
29
29
  autofocus: Optional[bool] = None,
30
+ _rename_props: Optional[Dict[str, str]] = None,
30
31
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
31
32
  on_blur: Optional[
32
33
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -84,6 +85,7 @@ class PlotlyLib(NoSSRComponent):
84
85
  id: The id for the component.
85
86
  class_name: The class name for the component.
86
87
  autofocus: Whether the component should take the focus once the page is loaded
88
+ _rename_props: props to change the name of
87
89
  custom_attrs: custom attribute
88
90
  **props: The props of the component.
89
91
 
@@ -111,6 +113,7 @@ class Plotly(PlotlyLib):
111
113
  id: Optional[Any] = None,
112
114
  class_name: Optional[Any] = None,
113
115
  autofocus: Optional[bool] = None,
116
+ _rename_props: Optional[Dict[str, str]] = None,
114
117
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
115
118
  on_blur: Optional[
116
119
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -173,6 +176,7 @@ class Plotly(PlotlyLib):
173
176
  id: The id for the component.
174
177
  class_name: The class name for the component.
175
178
  autofocus: Whether the component should take the focus once the page is loaded
179
+ _rename_props: props to change the name of
176
180
  custom_attrs: custom attribute
177
181
  **props: The props of the component.
178
182
 
@@ -7,6 +7,16 @@ from .accordion import (
7
7
  AccordionTrigger,
8
8
  accordion_item,
9
9
  )
10
+ from .drawer import (
11
+ drawer_close,
12
+ drawer_content,
13
+ drawer_description,
14
+ drawer_overlay,
15
+ drawer_portal,
16
+ drawer_root,
17
+ drawer_title,
18
+ drawer_trigger,
19
+ )
10
20
  from .form import (
11
21
  form_control,
12
22
  form_field,
@@ -4,18 +4,17 @@ from __future__ import annotations
4
4
 
5
5
  from typing import Any, Dict, Literal
6
6
 
7
- from reflex.components.base.fragment import Fragment
8
7
  from reflex.components.component import Component
9
8
  from reflex.components.core import cond, match
9
+ from reflex.components.lucide.icon import Icon
10
10
  from reflex.components.radix.primitives.base import RadixPrimitiveComponent
11
- from reflex.components.radix.themes.components.icons import Icon
12
11
  from reflex.style import (
13
12
  Style,
14
13
  convert_dict_to_style_and_format_emotion,
15
14
  format_as_emotion,
16
15
  )
17
16
  from reflex.utils import imports
18
- from reflex.vars import BaseVar, Var
17
+ from reflex.vars import BaseVar, Var, VarData
19
18
 
20
19
  LiteralAccordionType = Literal["single", "multiple"]
21
20
  LiteralAccordionDir = Literal["ltr", "rtl"]
@@ -115,10 +114,6 @@ def get_theme_accordion_item():
115
114
  "overflow": "hidden",
116
115
  "width": "100%",
117
116
  "margin_top": "1px",
118
- # "background_color": "var(--accent-3)",
119
- # "background_color": cond(
120
- # color_scheme == "primary", "var(--accent-3)", "var(--slate-3)"
121
- # ),
122
117
  "&:first-child": {
123
118
  "margin_top": 0,
124
119
  "border_top_left_radius": "4px",
@@ -165,8 +160,8 @@ def get_theme_accordion_trigger(variant: str | Var, color_scheme: str | Var) ->
165
160
  {
166
161
  "color": cond(
167
162
  color_scheme == "primary",
168
- "var(--accent-9-contrast)",
169
- "var(--slate-9-contrast)",
163
+ "var(--accent-11)",
164
+ "var(--slate-11)",
170
165
  ),
171
166
  "&:hover": {
172
167
  "background_color": cond(
@@ -195,7 +190,6 @@ def get_theme_accordion_trigger(variant: str | Var, color_scheme: str | Var) ->
195
190
  "align_items": "center",
196
191
  "justify_content": "space-between",
197
192
  "font_size": "15px",
198
- "box_shadow": "0 1px 0 var(--accent-6)",
199
193
  "line_height": 1,
200
194
  }
201
195
  ),
@@ -238,7 +232,6 @@ def get_theme_accordion_trigger(variant: str | Var, color_scheme: str | Var) ->
238
232
  "align_items": "center",
239
233
  "justify_content": "space-between",
240
234
  "font_size": "15px",
241
- "box_shadow": "0 1px 0 var(--accent-6)",
242
235
  "line_height": 1,
243
236
  }
244
237
  ),
@@ -251,7 +244,11 @@ def get_theme_accordion_trigger(variant: str | Var, color_scheme: str | Var) ->
251
244
  "var(--accent-9-contrast)",
252
245
  "var(--slate-9-contrast)",
253
246
  ),
254
- "box_shadow": "0 1px 0 var(--accent-6)",
247
+ "box_shadow": cond(
248
+ color_scheme == "primary",
249
+ "0 1px 0 var(--accent-6)",
250
+ "0 1px 0 var(--slate-11)",
251
+ ),
255
252
  "&:hover": {
256
253
  "background_color": cond(
257
254
  color_scheme == "primary", "var(--accent-10)", "var(--slate-10)"
@@ -304,11 +301,8 @@ def get_theme_accordion_content(variant: str | Var, color_scheme: str | Var) ->
304
301
  "font_size": "10px",
305
302
  "color": cond(
306
303
  color_scheme == "primary",
307
- "var(--accent-9-contrast)",
308
- "var(--slate-9-contrast)",
309
- ),
310
- "background_color": cond(
311
- color_scheme == "primary", "var(--accent-3)", "var(--slate-3)"
304
+ "var(--accent-11)",
305
+ "var(--slate-11)",
312
306
  ),
313
307
  "padding": "15px, 20px",
314
308
  "&[data-state='open']": {
@@ -330,10 +324,19 @@ def get_theme_accordion_content(variant: str | Var, color_scheme: str | Var) ->
330
324
  {
331
325
  "overflow": "hidden",
332
326
  "font_size": "10px",
333
- "color": cond(
334
- color_scheme == "primary",
335
- "var(--accent-9-contrast)",
336
- "var(--slate-9-contrast)",
327
+ "color": match(
328
+ variant,
329
+ (
330
+ "classic",
331
+ cond(
332
+ color_scheme == "primary",
333
+ "var(--accent-9-contrast)",
334
+ "var(--slate-9-contrast)",
335
+ ),
336
+ ),
337
+ cond(
338
+ color_scheme == "primary", "var(--accent-11)", "var(--slate-11)"
339
+ ),
337
340
  ),
338
341
  "background_color": match(
339
342
  variant,
@@ -410,6 +413,9 @@ class AccordionRoot(AccordionComponent):
410
413
  # dynamic themes of the accordion generated at compile time.
411
414
  _dynamic_themes: Var[dict]
412
415
 
416
+ # The var_data associated with the component.
417
+ _var_data: VarData = VarData() # type: ignore
418
+
413
419
  @classmethod
414
420
  def create(cls, *children, **props) -> Component:
415
421
  """Create the Accordion root component.
@@ -431,8 +437,7 @@ class AccordionRoot(AccordionComponent):
431
437
  # mark the vars of variant string literals as strings so they are formatted properly in the match condition.
432
438
  comp.variant._var_is_string = True # type: ignore
433
439
 
434
- # remove Fragment and cond wrap workaround when https://github.com/reflex-dev/reflex/issues/2393 is resolved.
435
- return Fragment.create(comp, cond(True, Fragment.create()))
440
+ return comp
436
441
 
437
442
  def _get_style(self) -> dict:
438
443
  """Get the style for the component.
@@ -443,25 +448,39 @@ class AccordionRoot(AccordionComponent):
443
448
  return {"css": self._dynamic_themes._merge(format_as_emotion(self.style))} # type: ignore
444
449
 
445
450
  def _apply_theme(self, theme: Component):
451
+ accordion_theme_root = get_theme_accordion_root(
452
+ variant=self.variant, color_scheme=self.color_scheme
453
+ )
454
+ accordion_theme_content = get_theme_accordion_content(
455
+ variant=self.variant, color_scheme=self.color_scheme
456
+ )
457
+ accordion_theme_trigger = get_theme_accordion_trigger(
458
+ variant=self.variant, color_scheme=self.color_scheme
459
+ )
460
+
461
+ # extract var_data from dynamic themes.
462
+ self._var_data = self._var_data.merge( # type: ignore
463
+ accordion_theme_trigger._var_data,
464
+ accordion_theme_content._var_data,
465
+ accordion_theme_root._var_data,
466
+ )
467
+
446
468
  self._dynamic_themes = Var.create( # type: ignore
447
469
  convert_dict_to_style_and_format_emotion(
448
470
  {
449
471
  "& .AccordionItem": get_theme_accordion_item(),
450
472
  "& .AccordionHeader": get_theme_accordion_header(),
451
- "& .AccordionTrigger": get_theme_accordion_trigger(
452
- variant=self.variant, color_scheme=self.color_scheme
453
- ),
454
- "& .AccordionContent": get_theme_accordion_content(
455
- variant=self.variant, color_scheme=self.color_scheme
456
- ),
473
+ "& .AccordionTrigger": accordion_theme_trigger,
474
+ "& .AccordionContent": accordion_theme_content,
457
475
  }
458
476
  )
459
477
  )._merge( # type: ignore
460
- get_theme_accordion_root(
461
- variant=self.variant, color_scheme=self.color_scheme
462
- )
478
+ accordion_theme_root
463
479
  )
464
480
 
481
+ def _get_imports(self):
482
+ return imports.merge_imports(super()._get_imports(), self._var_data.imports)
483
+
465
484
  def get_event_triggers(self) -> Dict[str, Any]:
466
485
  """Get the events triggers signatures for the component.
467
486
 
@@ -8,18 +8,17 @@ from reflex.vars import Var, BaseVar, ComputedVar
8
8
  from reflex.event import EventChain, EventHandler, EventSpec
9
9
  from reflex.style import Style
10
10
  from typing import Any, Dict, Literal
11
- from reflex.components.base.fragment import Fragment
12
11
  from reflex.components.component import Component
13
12
  from reflex.components.core import cond, match
13
+ from reflex.components.lucide.icon import Icon
14
14
  from reflex.components.radix.primitives.base import RadixPrimitiveComponent
15
- from reflex.components.radix.themes.components.icons import Icon
16
15
  from reflex.style import (
17
16
  Style,
18
17
  convert_dict_to_style_and_format_emotion,
19
18
  format_as_emotion,
20
19
  )
21
20
  from reflex.utils import imports
22
- from reflex.vars import BaseVar, Var
21
+ from reflex.vars import BaseVar, Var, VarData
23
22
 
24
23
  LiteralAccordionType = Literal["single", "multiple"]
25
24
  LiteralAccordionDir = Literal["ltr", "rtl"]
@@ -50,6 +49,7 @@ class AccordionComponent(RadixPrimitiveComponent):
50
49
  id: Optional[Any] = None,
51
50
  class_name: Optional[Any] = None,
52
51
  autofocus: Optional[bool] = None,
52
+ _rename_props: Optional[Dict[str, str]] = None,
53
53
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
54
54
  on_blur: Optional[
55
55
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -108,6 +108,7 @@ class AccordionComponent(RadixPrimitiveComponent):
108
108
  id: The id for the component.
109
109
  class_name: The class name for the component.
110
110
  autofocus: Whether the component should take the focus once the page is loaded
111
+ _rename_props: props to change the name of
111
112
  custom_attrs: custom attribute
112
113
  **props: The props of the component.
113
114
 
@@ -149,12 +150,14 @@ class AccordionRoot(AccordionComponent):
149
150
  Union[Var[Literal["primary", "accent"]], Literal["primary", "accent"]]
150
151
  ] = None,
151
152
  _dynamic_themes: Optional[Union[Var[dict], dict]] = None,
153
+ _var_data: Optional[VarData] = None,
152
154
  as_child: Optional[Union[Var[bool], bool]] = None,
153
155
  style: Optional[Style] = None,
154
156
  key: Optional[Any] = None,
155
157
  id: Optional[Any] = None,
156
158
  class_name: Optional[Any] = None,
157
159
  autofocus: Optional[bool] = None,
160
+ _rename_props: Optional[Dict[str, str]] = None,
158
161
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
159
162
  on_blur: Optional[
160
163
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -220,12 +223,14 @@ class AccordionRoot(AccordionComponent):
220
223
  variant: The variant of the accordion.
221
224
  color_scheme: The color scheme of the accordion.
222
225
  _dynamic_themes: dynamic themes of the accordion generated at compile time.
226
+ _var_data: The var_data associated with the component.
223
227
  as_child: Change the default rendered element for the one passed as a child.
224
228
  style: The style of the component.
225
229
  key: A unique key for the component.
226
230
  id: The id for the component.
227
231
  class_name: The class name for the component.
228
232
  autofocus: Whether the component should take the focus once the page is loaded
233
+ _rename_props: props to change the name of
229
234
  custom_attrs: custom attribute
230
235
  **props: The properties of the component.
231
236
 
@@ -249,6 +254,7 @@ class AccordionItem(AccordionComponent):
249
254
  id: Optional[Any] = None,
250
255
  class_name: Optional[Any] = None,
251
256
  autofocus: Optional[bool] = None,
257
+ _rename_props: Optional[Dict[str, str]] = None,
252
258
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
253
259
  on_blur: Optional[
254
260
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -309,6 +315,7 @@ class AccordionItem(AccordionComponent):
309
315
  id: The id for the component.
310
316
  class_name: The class name for the component.
311
317
  autofocus: Whether the component should take the focus once the page is loaded
318
+ _rename_props: props to change the name of
312
319
  custom_attrs: custom attribute
313
320
  **props: The props of the component.
314
321
 
@@ -332,6 +339,7 @@ class AccordionHeader(AccordionComponent):
332
339
  id: Optional[Any] = None,
333
340
  class_name: Optional[Any] = None,
334
341
  autofocus: Optional[bool] = None,
342
+ _rename_props: Optional[Dict[str, str]] = None,
335
343
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
336
344
  on_blur: Optional[
337
345
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -390,6 +398,7 @@ class AccordionHeader(AccordionComponent):
390
398
  id: The id for the component.
391
399
  class_name: The class name for the component.
392
400
  autofocus: Whether the component should take the focus once the page is loaded
401
+ _rename_props: props to change the name of
393
402
  custom_attrs: custom attribute
394
403
  **props: The props of the component.
395
404
 
@@ -413,6 +422,7 @@ class AccordionTrigger(AccordionComponent):
413
422
  id: Optional[Any] = None,
414
423
  class_name: Optional[Any] = None,
415
424
  autofocus: Optional[bool] = None,
425
+ _rename_props: Optional[Dict[str, str]] = None,
416
426
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
417
427
  on_blur: Optional[
418
428
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -471,6 +481,7 @@ class AccordionTrigger(AccordionComponent):
471
481
  id: The id for the component.
472
482
  class_name: The class name for the component.
473
483
  autofocus: Whether the component should take the focus once the page is loaded
484
+ _rename_props: props to change the name of
474
485
  custom_attrs: custom attribute
475
486
  **props: The props of the component.
476
487
 
@@ -494,6 +505,7 @@ class AccordionContent(AccordionComponent):
494
505
  id: Optional[Any] = None,
495
506
  class_name: Optional[Any] = None,
496
507
  autofocus: Optional[bool] = None,
508
+ _rename_props: Optional[Dict[str, str]] = None,
497
509
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
498
510
  on_blur: Optional[
499
511
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -552,6 +564,7 @@ class AccordionContent(AccordionComponent):
552
564
  id: The id for the component.
553
565
  class_name: The class name for the component.
554
566
  autofocus: Whether the component should take the focus once the page is loaded
567
+ _rename_props: props to change the name of
555
568
  custom_attrs: custom attribute
556
569
  **props: The props of the component.
557
570
 
@@ -25,6 +25,7 @@ class RadixPrimitiveComponent(Component):
25
25
  id: Optional[Any] = None,
26
26
  class_name: Optional[Any] = None,
27
27
  autofocus: Optional[bool] = None,
28
+ _rename_props: Optional[Dict[str, str]] = None,
28
29
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
29
30
  on_blur: Optional[
30
31
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -83,6 +84,7 @@ class RadixPrimitiveComponent(Component):
83
84
  id: The id for the component.
84
85
  class_name: The class name for the component.
85
86
  autofocus: Whether the component should take the focus once the page is loaded
87
+ _rename_props: props to change the name of
86
88
  custom_attrs: custom attribute
87
89
  **props: The props of the component.
88
90
 
@@ -106,6 +108,7 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
106
108
  id: Optional[Any] = None,
107
109
  class_name: Optional[Any] = None,
108
110
  autofocus: Optional[bool] = None,
111
+ _rename_props: Optional[Dict[str, str]] = None,
109
112
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
110
113
  on_blur: Optional[
111
114
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -164,6 +167,7 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
164
167
  id: The id for the component.
165
168
  class_name: The class name for the component.
166
169
  autofocus: Whether the component should take the focus once the page is loaded
170
+ _rename_props: props to change the name of
167
171
  custom_attrs: custom attribute
168
172
  **props: The props of the component.
169
173