reflex 0.3.9a2__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 (246) hide show
  1. reflex/__init__.py +3 -1
  2. reflex/__init__.pyi +3 -1
  3. reflex/app.py +13 -5
  4. reflex/compiler/utils.py +13 -12
  5. reflex/components/base/app_wrap.pyi +1 -0
  6. reflex/components/base/body.pyi +2 -0
  7. reflex/components/base/document.pyi +10 -0
  8. reflex/components/base/fragment.pyi +2 -0
  9. reflex/components/base/head.pyi +4 -0
  10. reflex/components/base/link.pyi +4 -0
  11. reflex/components/base/meta.pyi +8 -0
  12. reflex/components/base/script.pyi +2 -0
  13. reflex/components/chakra/base.pyi +7 -0
  14. reflex/components/chakra/datadisplay/badge.pyi +2 -0
  15. reflex/components/chakra/datadisplay/code.pyi +4 -0
  16. reflex/components/chakra/datadisplay/divider.pyi +2 -0
  17. reflex/components/chakra/datadisplay/keyboard_key.pyi +2 -0
  18. reflex/components/chakra/datadisplay/list.pyi +8 -0
  19. reflex/components/chakra/datadisplay/stat.pyi +12 -0
  20. reflex/components/chakra/datadisplay/table.pyi +18 -0
  21. reflex/components/chakra/datadisplay/tag.pyi +9 -0
  22. reflex/components/chakra/disclosure/accordion.pyi +10 -0
  23. reflex/components/chakra/disclosure/tabs.py +8 -0
  24. reflex/components/chakra/disclosure/tabs.pyi +10 -0
  25. reflex/components/chakra/disclosure/transition.pyi +12 -0
  26. reflex/components/chakra/disclosure/visuallyhidden.pyi +2 -0
  27. reflex/components/chakra/feedback/alert.pyi +8 -0
  28. reflex/components/chakra/feedback/circularprogress.pyi +4 -0
  29. reflex/components/chakra/feedback/progress.pyi +2 -0
  30. reflex/components/chakra/feedback/skeleton.pyi +6 -0
  31. reflex/components/chakra/feedback/spinner.pyi +2 -0
  32. reflex/components/chakra/forms/button.pyi +4 -0
  33. reflex/components/chakra/forms/checkbox.pyi +4 -0
  34. reflex/components/chakra/forms/colormodeswitch.pyi +7 -0
  35. reflex/components/chakra/forms/date_picker.pyi +2 -0
  36. reflex/components/chakra/forms/date_time_picker.pyi +2 -0
  37. reflex/components/chakra/forms/editable.pyi +8 -0
  38. reflex/components/chakra/forms/email.pyi +2 -0
  39. reflex/components/chakra/forms/form.pyi +10 -0
  40. reflex/components/chakra/forms/iconbutton.py +1 -0
  41. reflex/components/chakra/forms/iconbutton.pyi +2 -0
  42. reflex/components/chakra/forms/input.pyi +12 -0
  43. reflex/components/chakra/forms/numberinput.pyi +10 -0
  44. reflex/components/chakra/forms/password.pyi +2 -0
  45. reflex/components/chakra/forms/pininput.pyi +4 -0
  46. reflex/components/chakra/forms/radio.pyi +4 -0
  47. reflex/components/chakra/forms/rangeslider.pyi +8 -0
  48. reflex/components/chakra/forms/select.pyi +4 -0
  49. reflex/components/chakra/forms/slider.pyi +10 -0
  50. reflex/components/chakra/forms/switch.pyi +2 -0
  51. reflex/components/chakra/forms/textarea.pyi +2 -0
  52. reflex/components/chakra/forms/time_picker.pyi +2 -0
  53. reflex/components/chakra/layout/aspect_ratio.pyi +2 -0
  54. reflex/components/chakra/layout/box.pyi +2 -0
  55. reflex/components/chakra/layout/card.pyi +7 -0
  56. reflex/components/chakra/layout/center.pyi +6 -0
  57. reflex/components/chakra/layout/container.pyi +2 -0
  58. reflex/components/chakra/layout/flex.pyi +2 -0
  59. reflex/components/chakra/layout/grid.pyi +6 -0
  60. reflex/components/chakra/layout/html.pyi +2 -0
  61. reflex/components/chakra/layout/spacer.pyi +2 -0
  62. reflex/components/chakra/layout/stack.pyi +6 -0
  63. reflex/components/chakra/layout/wrap.pyi +4 -0
  64. reflex/components/chakra/media/avatar.pyi +6 -0
  65. reflex/components/chakra/media/icon.pyi +4 -0
  66. reflex/components/chakra/media/image.pyi +2 -0
  67. reflex/components/chakra/navigation/breadcrumb.pyi +8 -0
  68. reflex/components/chakra/navigation/link.pyi +2 -0
  69. reflex/components/chakra/navigation/linkoverlay.pyi +4 -0
  70. reflex/components/chakra/navigation/stepper.pyi +18 -0
  71. reflex/components/chakra/overlay/alertdialog.pyi +14 -0
  72. reflex/components/chakra/overlay/drawer.pyi +14 -0
  73. reflex/components/chakra/overlay/menu.pyi +16 -0
  74. reflex/components/chakra/overlay/modal.pyi +14 -0
  75. reflex/components/chakra/overlay/popover.pyi +18 -0
  76. reflex/components/chakra/overlay/tooltip.pyi +2 -0
  77. reflex/components/chakra/typography/heading.pyi +2 -0
  78. reflex/components/chakra/typography/highlight.pyi +2 -0
  79. reflex/components/chakra/typography/span.pyi +2 -0
  80. reflex/components/chakra/typography/text.pyi +2 -0
  81. reflex/components/component.py +41 -3
  82. reflex/components/core/__init__.py +2 -0
  83. reflex/components/core/banner.pyi +3 -0
  84. reflex/components/core/client_side_routing.pyi +4 -0
  85. reflex/components/core/colors.py +21 -0
  86. reflex/components/core/cond.py +11 -2
  87. reflex/components/core/debounce.pyi +1 -0
  88. reflex/components/core/layout/__init__.py +1 -0
  89. reflex/components/core/match.py +44 -18
  90. reflex/components/core/upload.py +8 -2
  91. reflex/components/core/upload.pyi +7 -1
  92. reflex/components/datadisplay/dataeditor.pyi +2 -0
  93. reflex/components/el/element.pyi +2 -0
  94. reflex/components/el/elements/base.pyi +2 -0
  95. reflex/components/el/elements/forms.py +3 -0
  96. reflex/components/el/elements/forms.pyi +32 -0
  97. reflex/components/el/elements/inline.pyi +56 -0
  98. reflex/components/el/elements/media.pyi +28 -0
  99. reflex/components/el/elements/metadata.pyi +10 -0
  100. reflex/components/el/elements/other.pyi +14 -0
  101. reflex/components/el/elements/scripts.pyi +6 -0
  102. reflex/components/el/elements/sectioning.pyi +30 -0
  103. reflex/components/el/elements/tables.pyi +20 -0
  104. reflex/components/el/elements/typography.pyi +30 -0
  105. reflex/components/gridjs/datatable.pyi +4 -0
  106. reflex/components/lucide/__init__.py +5 -0
  107. reflex/components/lucide/icon.py +1484 -0
  108. reflex/components/lucide/icon.pyi +1594 -0
  109. reflex/components/markdown/markdown.pyi +2 -0
  110. reflex/components/moment/moment.pyi +2 -0
  111. reflex/components/next/base.pyi +2 -0
  112. reflex/components/next/image.pyi +2 -0
  113. reflex/components/next/link.pyi +2 -0
  114. reflex/components/next/video.pyi +2 -0
  115. reflex/components/plotly/plotly.pyi +4 -0
  116. reflex/components/radix/primitives/__init__.py +10 -0
  117. reflex/components/radix/primitives/accordion.py +51 -32
  118. reflex/components/radix/primitives/accordion.pyi +16 -3
  119. reflex/components/radix/primitives/base.pyi +4 -0
  120. reflex/components/radix/primitives/drawer.py +240 -0
  121. reflex/components/radix/primitives/drawer.pyi +814 -0
  122. reflex/components/radix/primitives/form.py +40 -7
  123. reflex/components/radix/primitives/form.pyi +32 -10
  124. reflex/components/radix/primitives/progress.py +2 -2
  125. reflex/components/radix/primitives/progress.pyi +6 -0
  126. reflex/components/radix/primitives/slider.pyi +10 -0
  127. reflex/components/radix/themes/base.py +46 -12
  128. reflex/components/radix/themes/base.pyi +23 -9
  129. reflex/components/radix/themes/components/__init__.py +4 -2
  130. reflex/components/radix/themes/components/alertdialog.py +13 -12
  131. reflex/components/radix/themes/components/alertdialog.pyi +23 -351
  132. reflex/components/radix/themes/components/aspectratio.py +2 -5
  133. reflex/components/radix/themes/components/aspectratio.pyi +4 -51
  134. reflex/components/radix/themes/components/avatar.py +3 -4
  135. reflex/components/radix/themes/components/avatar.pyi +4 -57
  136. reflex/components/radix/themes/components/badge.py +3 -4
  137. reflex/components/radix/themes/components/badge.pyi +4 -56
  138. reflex/components/radix/themes/components/button.py +2 -3
  139. reflex/components/radix/themes/components/button.pyi +3 -51
  140. reflex/components/radix/themes/components/callout.py +9 -12
  141. reflex/components/radix/themes/components/callout.pyi +24 -217
  142. reflex/components/radix/themes/components/card.py +1 -2
  143. reflex/components/radix/themes/components/card.pyi +4 -51
  144. reflex/components/radix/themes/components/checkbox.py +11 -5
  145. reflex/components/radix/themes/components/checkbox.pyi +13 -112
  146. reflex/components/radix/themes/components/contextmenu.py +21 -21
  147. reflex/components/radix/themes/components/contextmenu.pyi +26 -401
  148. reflex/components/radix/themes/components/dialog.py +13 -16
  149. reflex/components/radix/themes/components/dialog.pyi +20 -303
  150. reflex/components/radix/themes/components/dropdownmenu.py +196 -32
  151. reflex/components/radix/themes/components/dropdownmenu.pyi +147 -389
  152. reflex/components/radix/themes/components/hovercard.py +5 -5
  153. reflex/components/radix/themes/components/hovercard.pyi +11 -151
  154. reflex/components/radix/themes/components/iconbutton.py +56 -4
  155. reflex/components/radix/themes/components/iconbutton.pyi +25 -71
  156. reflex/components/radix/themes/components/icons.pyi +4 -0
  157. reflex/components/radix/themes/components/inset.py +1 -2
  158. reflex/components/radix/themes/components/inset.pyi +4 -51
  159. reflex/components/radix/themes/components/popover.py +12 -12
  160. reflex/components/radix/themes/components/popover.pyi +14 -201
  161. reflex/components/radix/themes/components/radiogroup.py +47 -20
  162. reflex/components/radix/themes/components/radiogroup.pyi +26 -171
  163. reflex/components/radix/themes/components/scrollarea.py +2 -3
  164. reflex/components/radix/themes/components/scrollarea.pyi +4 -51
  165. reflex/components/radix/themes/components/select.py +28 -25
  166. reflex/components/radix/themes/components/select.pyi +43 -419
  167. reflex/components/radix/themes/components/separator.py +4 -5
  168. reflex/components/radix/themes/components/separator.pyi +5 -52
  169. reflex/components/radix/themes/components/slider.py +8 -5
  170. reflex/components/radix/themes/components/slider.pyi +9 -60
  171. reflex/components/radix/themes/components/switch.py +6 -4
  172. reflex/components/radix/themes/components/switch.pyi +5 -53
  173. reflex/components/radix/themes/components/table.py +14 -15
  174. reflex/components/radix/themes/components/table.pyi +22 -351
  175. reflex/components/radix/themes/components/tabs.py +9 -6
  176. reflex/components/radix/themes/components/tabs.pyi +18 -205
  177. reflex/components/radix/themes/components/textarea.py +2 -3
  178. reflex/components/radix/themes/components/textarea.pyi +10 -53
  179. reflex/components/radix/themes/components/textfield.py +105 -4
  180. reflex/components/radix/themes/components/textfield.pyi +200 -108
  181. reflex/components/radix/themes/components/tooltip.py +102 -2
  182. reflex/components/radix/themes/components/tooltip.pyi +66 -110
  183. reflex/components/radix/themes/layout/__init__.py +7 -0
  184. reflex/components/radix/themes/layout/base.pyi +2 -0
  185. reflex/components/radix/themes/layout/box.py +2 -2
  186. reflex/components/radix/themes/layout/box.pyi +4 -104
  187. reflex/components/radix/themes/layout/center.py +19 -0
  188. reflex/components/radix/themes/layout/center.pyi +261 -0
  189. reflex/components/radix/themes/layout/container.py +2 -2
  190. reflex/components/radix/themes/layout/container.pyi +4 -104
  191. reflex/components/radix/themes/layout/flex.py +2 -2
  192. reflex/components/radix/themes/layout/flex.pyi +4 -105
  193. reflex/components/radix/themes/layout/grid.pyi +2 -0
  194. reflex/components/radix/themes/layout/section.py +2 -2
  195. reflex/components/radix/themes/layout/section.pyi +4 -104
  196. reflex/components/radix/themes/layout/spacer.py +19 -0
  197. reflex/components/radix/themes/layout/spacer.pyi +261 -0
  198. reflex/components/radix/themes/layout/stack.py +60 -0
  199. reflex/components/radix/themes/layout/stack.pyi +537 -0
  200. reflex/components/radix/themes/typography/blockquote.py +2 -3
  201. reflex/components/radix/themes/typography/blockquote.pyi +4 -51
  202. reflex/components/radix/themes/typography/code.py +2 -3
  203. reflex/components/radix/themes/typography/code.pyi +4 -56
  204. reflex/components/radix/themes/typography/em.py +1 -2
  205. reflex/components/radix/themes/typography/em.pyi +4 -51
  206. reflex/components/radix/themes/typography/heading.py +2 -3
  207. reflex/components/radix/themes/typography/heading.pyi +4 -51
  208. reflex/components/radix/themes/typography/kbd.py +1 -2
  209. reflex/components/radix/themes/typography/kbd.pyi +4 -51
  210. reflex/components/radix/themes/typography/link.py +34 -3
  211. reflex/components/radix/themes/typography/link.pyi +41 -86
  212. reflex/components/radix/themes/typography/quote.py +1 -2
  213. reflex/components/radix/themes/typography/quote.pyi +4 -51
  214. reflex/components/radix/themes/typography/strong.py +1 -2
  215. reflex/components/radix/themes/typography/strong.pyi +4 -51
  216. reflex/components/radix/themes/typography/text.py +2 -3
  217. reflex/components/radix/themes/typography/text.pyi +4 -51
  218. reflex/components/radix/themes/typography.py +10 -11
  219. reflex/components/react_player/audio.pyi +2 -0
  220. reflex/components/react_player/react_player.pyi +2 -0
  221. reflex/components/react_player/video.pyi +2 -0
  222. reflex/components/recharts/cartesian.pyi +38 -0
  223. reflex/components/recharts/charts.pyi +22 -0
  224. reflex/components/recharts/general.pyi +10 -0
  225. reflex/components/recharts/polar.pyi +12 -0
  226. reflex/components/recharts/recharts.pyi +4 -0
  227. reflex/components/suneditor/editor.pyi +2 -0
  228. reflex/components/tags/tag.py +1 -1
  229. reflex/constants/base.py +5 -1
  230. reflex/constants/colors.py +80 -0
  231. reflex/constants/event.py +10 -1
  232. reflex/page.py +1 -1
  233. reflex/reflex.py +4 -0
  234. reflex/style.py +8 -3
  235. reflex/testing.py +21 -10
  236. reflex/utils/format.py +13 -9
  237. reflex/utils/prerequisites.py +41 -3
  238. reflex/utils/serializers.py +14 -0
  239. reflex/utils/telemetry.py +8 -2
  240. reflex/utils/types.py +36 -2
  241. reflex/vars.py +53 -18
  242. {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/METADATA +1 -2
  243. {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/RECORD +246 -232
  244. {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/WHEEL +1 -1
  245. {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/LICENSE +0 -0
  246. {reflex-0.3.9a2.dist-info → reflex-0.3.10.dist-info}/entry_points.txt +0 -0
@@ -1,26 +1,48 @@
1
1
  """Interactive components provided by @radix-ui/themes."""
2
- from typing import Any, Dict, Literal
2
+ from typing import Any, Dict, Literal, Union
3
3
 
4
+ from reflex.constants import EventTriggers
4
5
  from reflex.vars import Var
5
6
 
6
7
  from ..base import (
7
- CommonMarginProps,
8
8
  LiteralAccentColor,
9
9
  RadixThemesComponent,
10
10
  )
11
11
 
12
+ LiteralDirType = Literal["ltr", "rtl"]
12
13
 
13
- class DropdownMenuRoot(CommonMarginProps, RadixThemesComponent):
14
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
14
+ LiteralSizeType = Literal["1", "2"]
15
+
16
+ LiteralVariantType = Literal["solid", "soft"]
17
+
18
+ LiteralSideType = Literal["top", "right", "bottom", "left"]
19
+
20
+ LiteralAlignType = Literal["start", "center", "end"]
21
+
22
+
23
+ LiteralStickyType = Literal[
24
+ "partial",
25
+ "always",
26
+ ]
27
+
28
+
29
+ class DropdownMenuRoot(RadixThemesComponent):
30
+ """The Dropdown Menu Root Component."""
15
31
 
16
32
  tag = "DropdownMenu.Root"
17
33
 
34
+ # The open state of the dropdown menu when it is initially rendered. Use when you do not need to control its open state.
35
+ default_open: Var[bool]
36
+
18
37
  # The controlled open state of the dropdown menu. Must be used in conjunction with onOpenChange.
19
38
  open: Var[bool]
20
39
 
21
- # The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers.
40
+ # The modality of the dropdown menu. When set to true, interaction with outside elements will be disabled and only menu content will be visible to screen readers. Defaults to True.
22
41
  modal: Var[bool]
23
42
 
43
+ # The reading direction of submenus when applicable. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode.
44
+ dir: Var[LiteralDirType]
45
+
24
46
  def get_event_triggers(self) -> Dict[str, Any]:
25
47
  """Get the events triggers signatures for the component.
26
48
 
@@ -29,21 +51,72 @@ class DropdownMenuRoot(CommonMarginProps, RadixThemesComponent):
29
51
  """
30
52
  return {
31
53
  **super().get_event_triggers(),
32
- "on_open_change": lambda e0: [e0],
54
+ EventTriggers.ON_OPEN_CHANGE: lambda e0: [e0],
33
55
  }
34
56
 
35
57
 
36
- class DropdownMenuTrigger(CommonMarginProps, RadixThemesComponent):
37
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
58
+ class DropdownMenuTrigger(RadixThemesComponent):
59
+ """The button that toggles the dropdown menu."""
38
60
 
39
61
  tag = "DropdownMenu.Trigger"
40
62
 
63
+ # Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
64
+ as_child: Var[bool]
41
65
 
42
- class DropdownMenuContent(CommonMarginProps, RadixThemesComponent):
43
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
66
+
67
+ class DropdownMenuContent(RadixThemesComponent):
68
+ """The Dropdown Menu Content component that pops out when the dropdown menu is open."""
44
69
 
45
70
  tag = "DropdownMenu.Content"
46
71
 
72
+ # Dropdown Menu Content size "1" - "2"
73
+ size: Var[LiteralSizeType]
74
+
75
+ # Variant of Dropdown Menu Content: "solid" | "soft"
76
+ variant: Var[LiteralVariantType]
77
+
78
+ # Override theme color for Dropdown Menu Content
79
+ color_scheme: Var[LiteralAccentColor]
80
+
81
+ # Renders the Dropdown Menu Content in higher contrast
82
+ high_contrast: Var[bool]
83
+
84
+ # Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
85
+ as_child: Var[bool]
86
+
87
+ # When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
88
+ loop: Var[bool]
89
+
90
+ # Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
91
+ force_mount: Var[bool]
92
+
93
+ # 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".
94
+ side: Var[LiteralSideType]
95
+
96
+ # The distance in pixels from the trigger. Defaults to 0.
97
+ side_offset: Var[Union[float, int]]
98
+
99
+ # The preferred alignment against the trigger. May change when collisions occur. Defaults to "center".
100
+ align: Var[LiteralAlignType]
101
+
102
+ # An offset in pixels from the "start" or "end" alignment options.
103
+ align_offset: Var[Union[float, int]]
104
+
105
+ # When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
106
+ avoid_collisions: Var[bool]
107
+
108
+ # 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.
109
+ collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]]
110
+
111
+ # 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.
112
+ arrow_padding: Var[Union[float, int]]
113
+
114
+ # 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".
115
+ sticky: Var[LiteralStickyType]
116
+
117
+ # Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
118
+ hide_when_detached: Var[bool]
119
+
47
120
  def get_event_triggers(self) -> Dict[str, Any]:
48
121
  """Get the events triggers signatures for the component.
49
122
 
@@ -52,56 +125,147 @@ class DropdownMenuContent(CommonMarginProps, RadixThemesComponent):
52
125
  """
53
126
  return {
54
127
  **super().get_event_triggers(),
55
- "on_close_auto_focus": lambda e0: [e0],
56
- "on_escape_key_down": lambda e0: [e0],
57
- "on_pointer_down_outside": lambda e0: [e0],
58
- "on_interact_outside": lambda e0: [e0],
128
+ EventTriggers.ON_CLOSE_AUTO_FOCUS: lambda e0: [e0],
129
+ EventTriggers.ON_ESCAPE_KEY_DOWN: lambda e0: [e0],
130
+ EventTriggers.ON_POINTER_DOWN_OUTSIDE: lambda e0: [e0],
131
+ EventTriggers.ON_FOCUS_OUTSIDE: lambda e0: [e0],
132
+ EventTriggers.ON_INTERACT_OUTSIDE: lambda e0: [e0],
59
133
  }
60
134
 
61
135
 
62
- class DropdownMenuSubTrigger(CommonMarginProps, RadixThemesComponent):
136
+ class DropdownMenuSubTrigger(RadixThemesComponent):
63
137
  """Trigger an action or event, such as submitting a form or displaying a dialog."""
64
138
 
65
139
  tag = "DropdownMenu.SubTrigger"
66
140
 
141
+ # Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
142
+ as_child: Var[bool]
67
143
 
68
- class DropdownMenuSub(CommonMarginProps, RadixThemesComponent):
69
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
144
+ # When true, prevents the user from interacting with the item.
145
+ disabled: Var[bool]
146
+
147
+ # Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
148
+ text_value: Var[str]
149
+
150
+
151
+ class DropdownMenuSub(RadixThemesComponent):
152
+ """Contains all the parts of a submenu."""
70
153
 
71
154
  tag = "DropdownMenu.Sub"
72
155
 
156
+ # The controlled open state of the submenu. Must be used in conjunction with `on_open_change`.
157
+ open: Var[bool]
73
158
 
74
- class DropdownMenuSubContent(CommonMarginProps, RadixThemesComponent):
75
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
159
+ # The open state of the submenu when it is initially rendered. Use when you do not need to control its open state.
160
+ default_open: Var[bool]
161
+
162
+ def get_event_triggers(self) -> Dict[str, Any]:
163
+ """Get the events triggers signatures for the component.
164
+
165
+ Returns:
166
+ The signatures of the event triggers.
167
+ """
168
+ return {
169
+ **super().get_event_triggers(),
170
+ EventTriggers.ON_OPEN_CHANGE: lambda e0: [e0.target.value],
171
+ }
172
+
173
+
174
+ class DropdownMenuSubContent(RadixThemesComponent):
175
+ """The component that pops out when a submenu is open. Must be rendered inside DropdownMenuSub."""
76
176
 
77
177
  tag = "DropdownMenu.SubContent"
78
178
 
79
- # Button size "1" - "4"
80
- size: Var[Literal["1", "2"]]
179
+ # Dropdown Menu Sub Content size "1" - "2"
180
+ size: Var[LiteralSizeType]
81
181
 
82
- # Variant of button: "solid" | "soft" | "outline" | "ghost"
83
- variant: Var[Literal["solid", "soft"]]
182
+ # Variant of Dropdown Menu Sub Content: "solid" | "soft"
183
+ variant: Var[LiteralVariantType]
84
184
 
85
- # Override theme color for button
86
- color: Var[LiteralAccentColor]
185
+ # Override theme color for Dropdown Menu Sub Content
186
+ color_scheme: Var[LiteralAccentColor]
87
187
 
88
- # Whether to render the button with higher contrast color against background
188
+ # Whether to render the component with higher contrast color against background
89
189
  high_contrast: Var[bool]
90
190
 
191
+ # Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
192
+ as_child: Var[bool]
91
193
 
92
- class DropdownMenuItem(CommonMarginProps, RadixThemesComponent):
93
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
194
+ # When True, keyboard navigation will loop from last item to first, and vice versa. Defaults to False.
195
+ loop: Var[bool]
196
+
197
+ # Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries.
198
+ force_mount: Var[bool]
199
+
200
+ # The distance in pixels from the trigger. Defaults to 0.
201
+ side_offset: Var[Union[float, int]]
202
+
203
+ # An offset in pixels from the "start" or "end" alignment options.
204
+ align_offset: Var[Union[float, int]]
205
+
206
+ # When true, overrides the side and align preferences to prevent collisions with boundary edges. Defaults to True.
207
+ avoid_collisions: Var[bool]
208
+
209
+ # 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.
210
+ collision_padding: Var[Union[float, int, Dict[str, Union[float, int]]]]
211
+
212
+ # 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.
213
+ arrow_padding: Var[Union[float, int]]
214
+
215
+ # 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".
216
+ sticky: Var[LiteralStickyType]
217
+
218
+ # Whether to hide the content when the trigger becomes fully occluded. Defaults to False.
219
+ hide_when_detached: Var[bool]
220
+
221
+ def get_event_triggers(self) -> Dict[str, Any]:
222
+ """Get the events triggers signatures for the component.
223
+
224
+ Returns:
225
+ The signatures of the event triggers.
226
+ """
227
+ return {
228
+ **super().get_event_triggers(),
229
+ EventTriggers.ON_ESCAPE_KEY_DOWN: lambda e0: [e0],
230
+ EventTriggers.ON_POINTER_DOWN_OUTSIDE: lambda e0: [e0],
231
+ EventTriggers.ON_FOCUS_OUTSIDE: lambda e0: [e0],
232
+ EventTriggers.ON_INTERACT_OUTSIDE: lambda e0: [e0],
233
+ }
234
+
235
+
236
+ class DropdownMenuItem(RadixThemesComponent):
237
+ """The Dropdown Menu Item Component."""
94
238
 
95
239
  tag = "DropdownMenu.Item"
96
240
 
97
- # Override theme color for button
98
- color: Var[LiteralAccentColor]
241
+ # Override theme color for Dropdown Menu Item
242
+ color_scheme: Var[LiteralAccentColor]
99
243
 
100
244
  # Shortcut to render a menu item as a link
101
245
  shortcut: Var[str]
102
246
 
247
+ # Change the default rendered element for the one passed as a child, merging their props and behavior. Defaults to False.
248
+ as_child: Var[bool]
103
249
 
104
- class DropdownMenuSeparator(CommonMarginProps, RadixThemesComponent):
105
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
250
+ # When true, prevents the user from interacting with the item.
251
+ disabled: Var[bool]
252
+
253
+ # Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the item. Use this when the content is complex, or you have non-textual content inside.
254
+ text_value: Var[str]
255
+
256
+ def get_event_triggers(self) -> Dict[str, Any]:
257
+ """Get the events triggers signatures for the component.
258
+
259
+ Returns:
260
+ The signatures of the event triggers.
261
+ """
262
+ return {
263
+ **super().get_event_triggers(),
264
+ EventTriggers.ON_SELECT: lambda e0: [e0.target.value],
265
+ }
266
+
267
+
268
+ class DropdownMenuSeparator(RadixThemesComponent):
269
+ """Dropdown Menu Separator Component. Used to visually separate items in the dropdown menu."""
106
270
 
107
271
  tag = "DropdownMenu.Separator"