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
@@ -8,23 +8,19 @@ 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
+ import reflex as rx
11
12
  from reflex.components import el
12
13
  from reflex.components.component import Component
13
14
  from reflex.components.core.debounce import DebounceInput
15
+ from reflex.components.radix.themes.components.icons import Icon
14
16
  from reflex.constants import EventTriggers
15
17
  from reflex.vars import Var
16
- from ..base import (
17
- CommonMarginProps,
18
- LiteralAccentColor,
19
- LiteralRadius,
20
- LiteralSize,
21
- RadixThemesComponent,
22
- )
18
+ from ..base import LiteralAccentColor, LiteralRadius, LiteralSize, RadixThemesComponent
23
19
 
24
20
  LiteralTextFieldSize = Literal["1", "2", "3"]
25
21
  LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
26
22
 
27
- class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent):
23
+ class TextFieldRoot(el.Div, RadixThemesComponent):
28
24
  @overload
29
25
  @classmethod
30
26
  def create( # type: ignore
@@ -151,53 +147,12 @@ class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent):
151
147
  translate: Optional[
152
148
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
153
149
  ] = None,
154
- m: Optional[
155
- Union[
156
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
157
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
158
- ]
159
- ] = None,
160
- mx: Optional[
161
- Union[
162
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
163
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
164
- ]
165
- ] = None,
166
- my: Optional[
167
- Union[
168
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
169
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
170
- ]
171
- ] = None,
172
- mt: Optional[
173
- Union[
174
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
175
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
176
- ]
177
- ] = None,
178
- mr: Optional[
179
- Union[
180
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
181
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
182
- ]
183
- ] = None,
184
- mb: Optional[
185
- Union[
186
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
187
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
188
- ]
189
- ] = None,
190
- ml: Optional[
191
- Union[
192
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
193
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
194
- ]
195
- ] = None,
196
150
  style: Optional[Style] = None,
197
151
  key: Optional[Any] = None,
198
152
  id: Optional[Any] = None,
199
153
  class_name: Optional[Any] = None,
200
154
  autofocus: Optional[bool] = None,
155
+ _rename_props: Optional[Dict[str, str]] = None,
201
156
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
202
157
  on_blur: Optional[
203
158
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -275,18 +230,12 @@ class TextFieldRoot(el.Div, CommonMarginProps, RadixThemesComponent):
275
230
  tab_index: Defines the position of the current element in the tabbing order.
276
231
  title: Defines a tooltip for the element.
277
232
  translate: Specifies whether the content of an element should be translated or not.
278
- m: Margin: "0" - "9"
279
- mx: Margin horizontal: "0" - "9"
280
- my: Margin vertical: "0" - "9"
281
- mt: Margin top: "0" - "9"
282
- mr: Margin right: "0" - "9"
283
- mb: Margin bottom: "0" - "9"
284
- ml: Margin left: "0" - "9"
285
233
  style: The style of the component.
286
234
  key: A unique key for the component.
287
235
  id: The id for the component.
288
236
  class_name: The class name for the component.
289
237
  autofocus: Whether the component should take the focus once the page is loaded
238
+ _rename_props: props to change the name of
290
239
  custom_attrs: custom attribute
291
240
  **props: Component properties.
292
241
 
@@ -386,7 +335,7 @@ class TextFieldInput(el.Input, TextFieldRoot):
386
335
  Literal["classic", "surface", "soft"],
387
336
  ]
388
337
  ] = None,
389
- color: Optional[
338
+ color_scheme: Optional[
390
339
  Union[
391
340
  Var[
392
341
  Literal[
@@ -497,53 +446,12 @@ class TextFieldInput(el.Input, TextFieldRoot):
497
446
  translate: Optional[
498
447
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
499
448
  ] = None,
500
- m: Optional[
501
- Union[
502
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
503
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
504
- ]
505
- ] = None,
506
- mx: Optional[
507
- Union[
508
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
509
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
510
- ]
511
- ] = None,
512
- my: Optional[
513
- Union[
514
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
515
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
516
- ]
517
- ] = None,
518
- mt: Optional[
519
- Union[
520
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
521
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
522
- ]
523
- ] = None,
524
- mr: Optional[
525
- Union[
526
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
527
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
528
- ]
529
- ] = None,
530
- mb: Optional[
531
- Union[
532
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
533
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
534
- ]
535
- ] = None,
536
- ml: Optional[
537
- Union[
538
- Var[Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]],
539
- Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"],
540
- ]
541
- ] = None,
542
449
  style: Optional[Style] = None,
543
450
  key: Optional[Any] = None,
544
451
  id: Optional[Any] = None,
545
452
  class_name: Optional[Any] = None,
546
453
  autofocus: Optional[bool] = None,
454
+ _rename_props: Optional[Dict[str, str]] = None,
547
455
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
548
456
  on_blur: Optional[
549
457
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -639,7 +547,7 @@ class TextFieldInput(el.Input, TextFieldRoot):
639
547
  value: Value of the input
640
548
  width: The width of the input (only for type="image")
641
549
  variant: Variant of text field: "classic" | "surface" | "soft"
642
- color: Override theme color for text field
550
+ color_scheme: Override theme color for text field
643
551
  radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
644
552
  access_key: Provides a hint for generating a keyboard shortcut for the current element.
645
553
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
@@ -658,18 +566,12 @@ class TextFieldInput(el.Input, TextFieldRoot):
658
566
  tab_index: Defines the position of the current element in the tabbing order.
659
567
  title: Defines a tooltip for the element.
660
568
  translate: Specifies whether the content of an element should be translated or not.
661
- m: Margin: "0" - "9"
662
- mx: Margin horizontal: "0" - "9"
663
- my: Margin vertical: "0" - "9"
664
- mt: Margin top: "0" - "9"
665
- mr: Margin right: "0" - "9"
666
- mb: Margin bottom: "0" - "9"
667
- ml: Margin left: "0" - "9"
668
569
  style: The style of the component.
669
570
  key: A unique key for the component.
670
571
  id: The id for the component.
671
572
  class_name: The class name for the component.
672
573
  autofocus: Whether the component should take the focus once the page is loaded
574
+ _rename_props: props to change the name of
673
575
  custom_attrs: custom attribute
674
576
  **props: The properties of the component.
675
577
 
@@ -759,6 +661,7 @@ class TextFieldSlot(RadixThemesComponent):
759
661
  id: Optional[Any] = None,
760
662
  class_name: Optional[Any] = None,
761
663
  autofocus: Optional[bool] = None,
664
+ _rename_props: Optional[Dict[str, str]] = None,
762
665
  custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
763
666
  on_blur: Optional[
764
667
  Union[EventHandler, EventSpec, list, function, BaseVar]
@@ -822,6 +725,7 @@ class TextFieldSlot(RadixThemesComponent):
822
725
  id: The id for the component.
823
726
  class_name: The class name for the component.
824
727
  autofocus: Whether the component should take the focus once the page is loaded
728
+ _rename_props: props to change the name of
825
729
  custom_attrs: custom attribute
826
730
  **props: Component properties.
827
731
 
@@ -829,3 +733,191 @@ class TextFieldSlot(RadixThemesComponent):
829
733
  A new component instance.
830
734
  """
831
735
  ...
736
+
737
+ class Input(RadixThemesComponent):
738
+ @overload
739
+ @classmethod
740
+ def create( # type: ignore
741
+ cls,
742
+ *children,
743
+ icon: Optional[Union[Var[str], str]] = None,
744
+ size: Optional[
745
+ Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
746
+ ] = None,
747
+ variant: Optional[
748
+ Union[
749
+ Var[Literal["classic", "surface", "soft"]],
750
+ Literal["classic", "surface", "soft"],
751
+ ]
752
+ ] = None,
753
+ color_scheme: Optional[
754
+ Union[
755
+ Var[
756
+ Literal[
757
+ "tomato",
758
+ "red",
759
+ "ruby",
760
+ "crimson",
761
+ "pink",
762
+ "plum",
763
+ "purple",
764
+ "violet",
765
+ "iris",
766
+ "indigo",
767
+ "blue",
768
+ "cyan",
769
+ "teal",
770
+ "jade",
771
+ "green",
772
+ "grass",
773
+ "brown",
774
+ "orange",
775
+ "sky",
776
+ "mint",
777
+ "lime",
778
+ "yellow",
779
+ "amber",
780
+ "gold",
781
+ "bronze",
782
+ "gray",
783
+ ]
784
+ ],
785
+ Literal[
786
+ "tomato",
787
+ "red",
788
+ "ruby",
789
+ "crimson",
790
+ "pink",
791
+ "plum",
792
+ "purple",
793
+ "violet",
794
+ "iris",
795
+ "indigo",
796
+ "blue",
797
+ "cyan",
798
+ "teal",
799
+ "jade",
800
+ "green",
801
+ "grass",
802
+ "brown",
803
+ "orange",
804
+ "sky",
805
+ "mint",
806
+ "lime",
807
+ "yellow",
808
+ "amber",
809
+ "gold",
810
+ "bronze",
811
+ "gray",
812
+ ],
813
+ ]
814
+ ] = None,
815
+ radius: Optional[
816
+ Union[
817
+ Var[Literal["none", "small", "medium", "large", "full"]],
818
+ Literal["none", "small", "medium", "large", "full"],
819
+ ]
820
+ ] = None,
821
+ auto_complete: Optional[Union[Var[bool], bool]] = None,
822
+ default_value: Optional[Union[Var[str], str]] = None,
823
+ disabled: Optional[Union[Var[bool], bool]] = None,
824
+ max_length: Optional[Union[Var[str], str]] = None,
825
+ min_length: Optional[Union[Var[str], str]] = None,
826
+ name: Optional[Union[Var[str], str]] = None,
827
+ placeholder: Optional[Union[Var[str], str]] = None,
828
+ required: Optional[Union[Var[bool], bool]] = None,
829
+ value: Optional[Union[Var[str], str]] = None,
830
+ style: Optional[Style] = None,
831
+ key: Optional[Any] = None,
832
+ id: Optional[Any] = None,
833
+ class_name: Optional[Any] = None,
834
+ autofocus: Optional[bool] = None,
835
+ _rename_props: Optional[Dict[str, str]] = None,
836
+ custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
837
+ on_blur: Optional[
838
+ Union[EventHandler, EventSpec, list, function, BaseVar]
839
+ ] = None,
840
+ on_change: Optional[
841
+ Union[EventHandler, EventSpec, list, function, BaseVar]
842
+ ] = None,
843
+ on_click: Optional[
844
+ Union[EventHandler, EventSpec, list, function, BaseVar]
845
+ ] = None,
846
+ on_context_menu: Optional[
847
+ Union[EventHandler, EventSpec, list, function, BaseVar]
848
+ ] = None,
849
+ on_double_click: Optional[
850
+ Union[EventHandler, EventSpec, list, function, BaseVar]
851
+ ] = None,
852
+ on_focus: Optional[
853
+ Union[EventHandler, EventSpec, list, function, BaseVar]
854
+ ] = None,
855
+ on_key_down: Optional[
856
+ Union[EventHandler, EventSpec, list, function, BaseVar]
857
+ ] = None,
858
+ on_key_up: Optional[
859
+ Union[EventHandler, EventSpec, list, function, BaseVar]
860
+ ] = None,
861
+ on_mount: Optional[
862
+ Union[EventHandler, EventSpec, list, function, BaseVar]
863
+ ] = None,
864
+ on_mouse_down: Optional[
865
+ Union[EventHandler, EventSpec, list, function, BaseVar]
866
+ ] = None,
867
+ on_mouse_enter: Optional[
868
+ Union[EventHandler, EventSpec, list, function, BaseVar]
869
+ ] = None,
870
+ on_mouse_leave: Optional[
871
+ Union[EventHandler, EventSpec, list, function, BaseVar]
872
+ ] = None,
873
+ on_mouse_move: Optional[
874
+ Union[EventHandler, EventSpec, list, function, BaseVar]
875
+ ] = None,
876
+ on_mouse_out: Optional[
877
+ Union[EventHandler, EventSpec, list, function, BaseVar]
878
+ ] = None,
879
+ on_mouse_over: Optional[
880
+ Union[EventHandler, EventSpec, list, function, BaseVar]
881
+ ] = None,
882
+ on_mouse_up: Optional[
883
+ Union[EventHandler, EventSpec, list, function, BaseVar]
884
+ ] = None,
885
+ on_scroll: Optional[
886
+ Union[EventHandler, EventSpec, list, function, BaseVar]
887
+ ] = None,
888
+ on_unmount: Optional[
889
+ Union[EventHandler, EventSpec, list, function, BaseVar]
890
+ ] = None,
891
+ **props
892
+ ) -> "Input":
893
+ """Create an Input component.
894
+
895
+ Args:
896
+ icon: The icon to render before the input.
897
+ size: Text field size "1" - "3"
898
+ variant: Variant of text field: "classic" | "surface" | "soft"
899
+ color_scheme: Override theme color for text field
900
+ radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
901
+ auto_complete: Whether the input should have autocomplete enabled
902
+ default_value: The value of the input when initially rendered.
903
+ disabled: Disables the input
904
+ max_length: Specifies the maximum number of characters allowed in the input
905
+ min_length: Specifies the minimum number of characters required in the input
906
+ name: Name of the input, used when sending form data
907
+ placeholder: Placeholder text in the input
908
+ required: Indicates that the input is required
909
+ value: Value of the input
910
+ style: The style of the component.
911
+ key: A unique key for the component.
912
+ id: The id for the component.
913
+ class_name: The class name for the component.
914
+ autofocus: Whether the component should take the focus once the page is loaded
915
+ _rename_props: props to change the name of
916
+ custom_attrs: custom attribute
917
+ **props: The properties of the component.
918
+
919
+ Returns:
920
+ The component.
921
+ """
922
+ ...
923
+ def get_event_triggers(self) -> Dict[str, Any]: ...
@@ -1,16 +1,116 @@
1
1
  """Interactive components provided by @radix-ui/themes."""
2
+ from typing import Any, Dict, Literal, Union
3
+
4
+ from reflex.components.component import Component
5
+ from reflex.constants import EventTriggers
6
+ from reflex.utils import format
2
7
  from reflex.vars import Var
3
8
 
4
9
  from ..base import (
5
- CommonMarginProps,
6
10
  RadixThemesComponent,
7
11
  )
8
12
 
13
+ LiteralSideType = Literal[
14
+ "top",
15
+ "right",
16
+ "bottom",
17
+ "left",
18
+ ]
19
+
20
+ LiteralAlignType = Literal[
21
+ "start",
22
+ "center",
23
+ "end",
24
+ ]
25
+
26
+ LiteralStickyType = Literal[
27
+ "partial",
28
+ "always",
29
+ ]
30
+
9
31
 
10
- class Tooltip(CommonMarginProps, RadixThemesComponent):
32
+ # The Tooltip inherits props from the Tooltip.Root, Tooltip.Portal, Tooltip.Content
33
+ class Tooltip(RadixThemesComponent):
11
34
  """Floating element that provides a control with contextual information via pointer or focus."""
12
35
 
13
36
  tag = "Tooltip"
14
37
 
15
38
  # The content of the tooltip.
16
39
  content: Var[str]
40
+
41
+ # The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state.
42
+ default_open: Var[bool]
43
+
44
+ # The controlled open state of the tooltip. Must be used in conjunction with `on_open_change`.
45
+ open: Var[bool]
46
+
47
+ # The preferred side of the trigger to render against when open. Will be reversed when collisions occur and `avoid_collisions` is enabled.The position of the tooltip. Defaults to "top".
48
+ side: Var[LiteralSideType]
49
+
50
+ # The distance in pixels from the trigger. Defaults to 0.
51
+ side_offset: Var[Union[float, int]]
52
+
53
+ # The preferred alignment against the trigger. May change when collisions occur. Defaults to "center".
54
+ align: Var[LiteralAlignType]
55
+
56
+ # An offset in pixels from the "start" or "end" alignment options.
57
+ align_offset: Var[Union[float, int]]
58
+
59
+ # When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
60
+ avoid_collisions: Var[bool]
61
+
62
+ # The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { "top": 20, "left": 20 }. Defaults to 0.
63
+ collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]]
64
+
65
+ # The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. Defaults to 0.
66
+ arrow_padding: Var[Union[float, int]]
67
+
68
+ # The sticky behavior on the align axis. "partial" will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. Defaults to "partial".
69
+ sticky: Var[LiteralStickyType]
70
+
71
+ # Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
72
+ hide_when_detached: Var[bool]
73
+
74
+ # Override the duration in milliseconds to customize the open delay for a specific tooltip. Default is 700.
75
+ delay_duration: Var[Union[float, int]]
76
+
77
+ # Prevents Tooltip content from remaining open when hovering.
78
+ disable_hoverable_content: Var[bool]
79
+
80
+ # Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
81
+ force_mount: Var[bool]
82
+
83
+ # By default, screenreaders will announce the content inside the component. If this is not descriptive enough, or you have content that cannot be announced, use aria-label as a more descriptive label.
84
+ aria_label: Var[str]
85
+
86
+ def get_event_triggers(self) -> Dict[str, Any]:
87
+ """Get the events triggers signatures for the component.
88
+
89
+ Returns:
90
+ The signatures of the event triggers.
91
+ """
92
+ return {
93
+ **super().get_event_triggers(),
94
+ EventTriggers.ON_OPEN_CHANGE: lambda e0: [e0.target.value],
95
+ EventTriggers.ON_ESCAPE_KEY_DOWN: lambda e0: [e0.target.value],
96
+ EventTriggers.ON_POINTER_DOWN_OUTSIDE: lambda e0: [e0.target.value],
97
+ }
98
+
99
+ @classmethod
100
+ def create(cls, *children, **props) -> Component:
101
+ """Initialize the Tooltip component.
102
+
103
+ Run some additional handling on the props.
104
+
105
+ Args:
106
+ *children: The positional arguments
107
+ **props: The keyword arguments
108
+
109
+ Returns:
110
+ The created component.
111
+ """
112
+ ARIA_LABEL_KEY = "aria_label"
113
+ if props.get(ARIA_LABEL_KEY) is not None:
114
+ props[format.to_kebab_case(ARIA_LABEL_KEY)] = props.pop(ARIA_LABEL_KEY)
115
+
116
+ return super().create(*children, **props)