reflex 0.4.5a2__py3-none-any.whl → 0.4.6__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 (196) hide show
  1. reflex/.templates/jinja/custom_components/pyproject.toml.jinja2 +5 -15
  2. reflex/.templates/jinja/web/pages/index.js.jinja2 +4 -0
  3. reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +4 -0
  4. reflex/.templates/web/utils/state.js +3 -0
  5. reflex/__init__.py +12 -2
  6. reflex/__init__.pyi +4 -0
  7. reflex/app.py +21 -1
  8. reflex/base.py +16 -4
  9. reflex/compiler/compiler.py +1 -0
  10. reflex/compiler/utils.py +11 -2
  11. reflex/components/base/app_wrap.pyi +1 -1
  12. reflex/components/base/bare.py +3 -4
  13. reflex/components/base/body.pyi +1 -1
  14. reflex/components/base/document.pyi +1 -1
  15. reflex/components/base/fragment.pyi +1 -1
  16. reflex/components/base/head.pyi +1 -1
  17. reflex/components/base/link.pyi +1 -1
  18. reflex/components/base/meta.pyi +1 -1
  19. reflex/components/base/script.pyi +1 -1
  20. reflex/components/chakra/base.pyi +1 -1
  21. reflex/components/chakra/datadisplay/badge.pyi +1 -1
  22. reflex/components/chakra/datadisplay/code.pyi +1 -1
  23. reflex/components/chakra/datadisplay/divider.pyi +1 -1
  24. reflex/components/chakra/datadisplay/keyboard_key.pyi +1 -1
  25. reflex/components/chakra/datadisplay/list.pyi +1 -1
  26. reflex/components/chakra/datadisplay/stat.pyi +1 -1
  27. reflex/components/chakra/datadisplay/table.pyi +1 -1
  28. reflex/components/chakra/datadisplay/tag.pyi +1 -1
  29. reflex/components/chakra/disclosure/accordion.pyi +1 -1
  30. reflex/components/chakra/disclosure/tabs.pyi +1 -1
  31. reflex/components/chakra/disclosure/transition.pyi +1 -1
  32. reflex/components/chakra/disclosure/visuallyhidden.pyi +1 -1
  33. reflex/components/chakra/feedback/alert.pyi +1 -1
  34. reflex/components/chakra/feedback/circularprogress.pyi +1 -1
  35. reflex/components/chakra/feedback/progress.pyi +1 -1
  36. reflex/components/chakra/feedback/skeleton.pyi +1 -1
  37. reflex/components/chakra/feedback/spinner.pyi +1 -1
  38. reflex/components/chakra/forms/button.pyi +1 -1
  39. reflex/components/chakra/forms/checkbox.pyi +1 -1
  40. reflex/components/chakra/forms/colormodeswitch.pyi +1 -1
  41. reflex/components/chakra/forms/date_picker.pyi +1 -1
  42. reflex/components/chakra/forms/date_time_picker.pyi +1 -1
  43. reflex/components/chakra/forms/editable.pyi +1 -1
  44. reflex/components/chakra/forms/email.pyi +1 -1
  45. reflex/components/chakra/forms/form.pyi +1 -1
  46. reflex/components/chakra/forms/iconbutton.pyi +1 -1
  47. reflex/components/chakra/forms/input.pyi +1 -1
  48. reflex/components/chakra/forms/numberinput.pyi +1 -1
  49. reflex/components/chakra/forms/password.pyi +1 -1
  50. reflex/components/chakra/forms/pininput.pyi +1 -1
  51. reflex/components/chakra/forms/radio.pyi +1 -1
  52. reflex/components/chakra/forms/rangeslider.pyi +1 -1
  53. reflex/components/chakra/forms/select.pyi +1 -1
  54. reflex/components/chakra/forms/slider.pyi +1 -1
  55. reflex/components/chakra/forms/switch.pyi +1 -1
  56. reflex/components/chakra/forms/textarea.pyi +1 -1
  57. reflex/components/chakra/forms/time_picker.pyi +1 -1
  58. reflex/components/chakra/layout/aspect_ratio.pyi +1 -1
  59. reflex/components/chakra/layout/box.pyi +1 -1
  60. reflex/components/chakra/layout/card.pyi +1 -1
  61. reflex/components/chakra/layout/center.pyi +1 -1
  62. reflex/components/chakra/layout/container.pyi +1 -1
  63. reflex/components/chakra/layout/flex.pyi +1 -1
  64. reflex/components/chakra/layout/grid.pyi +1 -1
  65. reflex/components/chakra/layout/spacer.pyi +1 -1
  66. reflex/components/chakra/layout/stack.pyi +1 -1
  67. reflex/components/chakra/layout/wrap.pyi +1 -1
  68. reflex/components/chakra/media/avatar.pyi +1 -1
  69. reflex/components/chakra/media/icon.pyi +1 -1
  70. reflex/components/chakra/media/image.pyi +1 -1
  71. reflex/components/chakra/navigation/breadcrumb.pyi +1 -1
  72. reflex/components/chakra/navigation/link.pyi +1 -1
  73. reflex/components/chakra/navigation/linkoverlay.pyi +1 -1
  74. reflex/components/chakra/navigation/stepper.pyi +1 -1
  75. reflex/components/chakra/overlay/alertdialog.pyi +1 -1
  76. reflex/components/chakra/overlay/drawer.pyi +1 -1
  77. reflex/components/chakra/overlay/menu.pyi +1 -1
  78. reflex/components/chakra/overlay/modal.pyi +1 -1
  79. reflex/components/chakra/overlay/popover.pyi +1 -1
  80. reflex/components/chakra/overlay/tooltip.pyi +1 -1
  81. reflex/components/chakra/typography/heading.pyi +1 -1
  82. reflex/components/chakra/typography/highlight.pyi +1 -1
  83. reflex/components/chakra/typography/span.pyi +1 -1
  84. reflex/components/chakra/typography/text.pyi +1 -1
  85. reflex/components/component.py +82 -30
  86. reflex/components/core/banner.py +1 -2
  87. reflex/components/core/banner.pyi +1 -2
  88. reflex/components/core/client_side_routing.pyi +1 -1
  89. reflex/components/core/cond.py +1 -1
  90. reflex/components/core/debounce.pyi +1 -1
  91. reflex/components/core/html.pyi +1 -1
  92. reflex/components/core/responsive.py +1 -1
  93. reflex/components/core/upload.pyi +1 -1
  94. reflex/components/datadisplay/code.py +17 -9
  95. reflex/components/datadisplay/code.pyi +3 -1
  96. reflex/components/datadisplay/dataeditor.pyi +1 -1
  97. reflex/components/el/element.pyi +1 -1
  98. reflex/components/el/elements/base.pyi +1 -1
  99. reflex/components/el/elements/forms.py +78 -1
  100. reflex/components/el/elements/forms.pyi +10 -2
  101. reflex/components/el/elements/inline.pyi +1 -1
  102. reflex/components/el/elements/media.pyi +1 -1
  103. reflex/components/el/elements/metadata.pyi +1 -1
  104. reflex/components/el/elements/other.pyi +1 -1
  105. reflex/components/el/elements/scripts.pyi +1 -1
  106. reflex/components/el/elements/sectioning.pyi +1 -1
  107. reflex/components/el/elements/tables.pyi +1 -1
  108. reflex/components/el/elements/typography.pyi +1 -1
  109. reflex/components/gridjs/datatable.pyi +1 -1
  110. reflex/components/lucide/icon.py +275 -115
  111. reflex/components/lucide/icon.pyi +259 -114
  112. reflex/components/markdown/markdown.pyi +1 -1
  113. reflex/components/moment/moment.pyi +1 -1
  114. reflex/components/next/base.pyi +1 -1
  115. reflex/components/next/image.pyi +1 -1
  116. reflex/components/next/link.pyi +1 -1
  117. reflex/components/next/video.pyi +1 -1
  118. reflex/components/plotly/plotly.pyi +1 -1
  119. reflex/components/radix/primitives/accordion.pyi +1 -1
  120. reflex/components/radix/primitives/base.pyi +1 -1
  121. reflex/components/radix/primitives/drawer.pyi +1 -1
  122. reflex/components/radix/primitives/form.pyi +1 -1
  123. reflex/components/radix/primitives/progress.pyi +1 -1
  124. reflex/components/radix/primitives/slider.pyi +1 -1
  125. reflex/components/radix/themes/base.pyi +1 -1
  126. reflex/components/radix/themes/color_mode.pyi +1 -1
  127. reflex/components/radix/themes/components/alert_dialog.pyi +1 -1
  128. reflex/components/radix/themes/components/aspect_ratio.pyi +1 -1
  129. reflex/components/radix/themes/components/avatar.pyi +1 -1
  130. reflex/components/radix/themes/components/badge.pyi +1 -1
  131. reflex/components/radix/themes/components/button.pyi +1 -1
  132. reflex/components/radix/themes/components/callout.pyi +1 -1
  133. reflex/components/radix/themes/components/card.pyi +1 -1
  134. reflex/components/radix/themes/components/checkbox.pyi +1 -1
  135. reflex/components/radix/themes/components/context_menu.pyi +1 -1
  136. reflex/components/radix/themes/components/dialog.pyi +1 -1
  137. reflex/components/radix/themes/components/dropdown_menu.pyi +1 -1
  138. reflex/components/radix/themes/components/hover_card.pyi +1 -1
  139. reflex/components/radix/themes/components/icon_button.pyi +1 -1
  140. reflex/components/radix/themes/components/inset.pyi +1 -1
  141. reflex/components/radix/themes/components/popover.pyi +1 -1
  142. reflex/components/radix/themes/components/radio_group.pyi +1 -1
  143. reflex/components/radix/themes/components/scroll_area.pyi +1 -1
  144. reflex/components/radix/themes/components/select.pyi +1 -1
  145. reflex/components/radix/themes/components/separator.pyi +1 -1
  146. reflex/components/radix/themes/components/slider.pyi +1 -1
  147. reflex/components/radix/themes/components/switch.pyi +1 -1
  148. reflex/components/radix/themes/components/table.pyi +1 -1
  149. reflex/components/radix/themes/components/tabs.pyi +1 -1
  150. reflex/components/radix/themes/components/text_area.pyi +5 -1
  151. reflex/components/radix/themes/components/text_field.pyi +1 -1
  152. reflex/components/radix/themes/components/tooltip.pyi +1 -1
  153. reflex/components/radix/themes/layout/__init__.py +5 -4
  154. reflex/components/radix/themes/layout/base.pyi +1 -1
  155. reflex/components/radix/themes/layout/box.pyi +1 -1
  156. reflex/components/radix/themes/layout/center.pyi +1 -1
  157. reflex/components/radix/themes/layout/container.pyi +1 -1
  158. reflex/components/radix/themes/layout/flex.pyi +1 -1
  159. reflex/components/radix/themes/layout/grid.pyi +1 -1
  160. reflex/components/radix/themes/layout/list.py +21 -13
  161. reflex/components/radix/themes/layout/list.pyi +139 -481
  162. reflex/components/radix/themes/layout/section.pyi +1 -1
  163. reflex/components/radix/themes/layout/spacer.pyi +1 -1
  164. reflex/components/radix/themes/layout/stack.pyi +1 -1
  165. reflex/components/radix/themes/typography/blockquote.pyi +1 -1
  166. reflex/components/radix/themes/typography/code.pyi +1 -1
  167. reflex/components/radix/themes/typography/heading.pyi +1 -1
  168. reflex/components/radix/themes/typography/link.pyi +1 -1
  169. reflex/components/radix/themes/typography/text.pyi +1 -1
  170. reflex/components/react_player/audio.pyi +1 -1
  171. reflex/components/react_player/react_player.pyi +1 -1
  172. reflex/components/react_player/video.pyi +1 -1
  173. reflex/components/recharts/cartesian.pyi +1 -1
  174. reflex/components/recharts/charts.pyi +1 -1
  175. reflex/components/recharts/general.pyi +1 -1
  176. reflex/components/recharts/polar.pyi +1 -1
  177. reflex/components/recharts/recharts.pyi +1 -1
  178. reflex/components/suneditor/editor.pyi +1 -1
  179. reflex/config.py +12 -2
  180. reflex/custom_components/custom_components.py +305 -21
  181. reflex/event.py +36 -46
  182. reflex/reflex.py +19 -13
  183. reflex/state.py +184 -39
  184. reflex/testing.py +15 -11
  185. reflex/utils/console.py +15 -7
  186. reflex/utils/prerequisites.py +11 -0
  187. reflex/utils/processes.py +8 -25
  188. reflex/utils/pyi_generator.py +842 -0
  189. reflex/utils/types.py +14 -2
  190. reflex/vars.py +33 -3
  191. {reflex-0.4.5a2.dist-info → reflex-0.4.6.dist-info}/METADATA +31 -29
  192. {reflex-0.4.5a2.dist-info → reflex-0.4.6.dist-info}/RECORD +195 -195
  193. reflex/page.pyi +0 -17
  194. {reflex-0.4.5a2.dist-info → reflex-0.4.6.dist-info}/LICENSE +0 -0
  195. {reflex-0.4.5a2.dist-info → reflex-0.4.6.dist-info}/WHEEL +0 -0
  196. {reflex-0.4.5a2.dist-info → reflex-0.4.6.dist-info}/entry_points.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/core/banner.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -21,7 +21,6 @@ from reflex.components.radix.themes.components.dialog import (
21
21
  from reflex.components.radix.themes.layout import Flex
22
22
  from reflex.components.radix.themes.typography.text import Text
23
23
  from reflex.constants import Dirs, Hooks, Imports
24
- from reflex.state import State
25
24
  from reflex.utils import imports
26
25
  from reflex.vars import Var, VarData
27
26
 
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/core/client_side_routing.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -206,7 +206,7 @@ def color_mode_cond(light: Any, dark: Any = None) -> Var | Component:
206
206
  The conditional component or prop.
207
207
  """
208
208
  return cond(
209
- color_mode == LIGHT_COLOR_MODE,
209
+ color_mode == Var.create(LIGHT_COLOR_MODE, _var_is_string=True),
210
210
  light,
211
211
  dark,
212
212
  )
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/core/debounce.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/core/html.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Responsive components."""
2
2
 
3
- from reflex.components.chakra.layout.box import Box
3
+ from reflex.components.radix.themes.layout import Box
4
4
 
5
5
 
6
6
  # Add responsive styles shortcuts.
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/core/upload.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -387,9 +387,9 @@ class CodeBlock(Component):
387
387
  merged_imports = imports.merge_imports(
388
388
  merged_imports,
389
389
  {
390
- f"react-syntax-highlighter/dist/cjs/styles/prism/{theme}": {
390
+ f"react-syntax-highlighter/dist/cjs/styles/prism/{self.convert_theme_name(theme)}": {
391
391
  ImportVar(
392
- tag=format.to_camel_case(theme),
392
+ tag=format.to_camel_case(self.convert_theme_name(theme)),
393
393
  is_default=True,
394
394
  install=False,
395
395
  )
@@ -451,13 +451,7 @@ class CodeBlock(Component):
451
451
  # react-syntax-highlighter doesnt have an explicit "light" or "dark" theme so we use one-light and one-dark
452
452
  # themes respectively to ensure code compatibility.
453
453
  if "theme" in props and not isinstance(props["theme"], Var):
454
- props["theme"] = (
455
- "one-light"
456
- if props["theme"] == "light"
457
- else "one-dark"
458
- if props["theme"] == "dark"
459
- else props["theme"]
460
- )
454
+ props["theme"] = cls.convert_theme_name(props["theme"])
461
455
 
462
456
  if can_copy:
463
457
  code = children[0]
@@ -511,3 +505,17 @@ class CodeBlock(Component):
511
505
  if self.code is not None:
512
506
  out.special_props.add(Var.create_safe(f"children={str(self.code)}"))
513
507
  return out
508
+
509
+ @staticmethod
510
+ def convert_theme_name(theme) -> str:
511
+ """Convert theme names to appropriate names.
512
+
513
+ Args:
514
+ theme: The theme name.
515
+
516
+ Returns:
517
+ The right theme name.
518
+ """
519
+ if theme in ["light", "dark"]:
520
+ return f"one-{theme}"
521
+ return theme
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/datadisplay/code.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1110,3 +1110,5 @@ class CodeBlock(Component):
1110
1110
  The text component.
1111
1111
  """
1112
1112
  ...
1113
+ @staticmethod
1114
+ def convert_theme_name(theme) -> str: ...
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/datadisplay/dataeditor.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/element.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/base.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -2,7 +2,7 @@
2
2
  from __future__ import annotations
3
3
 
4
4
  from hashlib import md5
5
- from typing import Any, Dict, Iterator, Union
5
+ from typing import Any, Dict, Iterator, Set, Union
6
6
 
7
7
  from jinja2 import Environment
8
8
 
@@ -500,6 +500,36 @@ class Select(BaseHTML):
500
500
  }
501
501
 
502
502
 
503
+ AUTO_HEIGHT_JS = """
504
+ const autoHeightOnInput = (e, is_enabled) => {
505
+ if (is_enabled) {
506
+ const el = e.target;
507
+ el.style.overflowY = "hidden";
508
+ el.style.height = "auto";
509
+ el.style.height = (e.target.scrollHeight) + "px";
510
+ if (el.form && !el.form.data_resize_on_reset) {
511
+ el.form.addEventListener("reset", () => window.setTimeout(() => autoHeightOnInput(e, is_enabled), 0))
512
+ el.form.data_resize_on_reset = true;
513
+ }
514
+ }
515
+ }
516
+ """
517
+
518
+
519
+ ENTER_KEY_SUBMIT_JS = """
520
+ const enterKeySubmitOnKeyDown = (e, is_enabled) => {
521
+ if (is_enabled && e.which === 13 && !e.shiftKey) {
522
+ e.preventDefault();
523
+ if (!e.repeat) {
524
+ if (e.target.form) {
525
+ e.target.form.requestSubmit();
526
+ }
527
+ }
528
+ }
529
+ }
530
+ """
531
+
532
+
503
533
  class Textarea(BaseHTML):
504
534
  """Display the textarea element."""
505
535
 
@@ -511,6 +541,9 @@ class Textarea(BaseHTML):
511
541
  # Automatically focuses the textarea when the page loads
512
542
  auto_focus: Var[Union[str, int, bool]]
513
543
 
544
+ # Automatically fit the content height to the text (use min-height with this prop)
545
+ auto_height: Var[bool]
546
+
514
547
  # Visible width of the text control, in average character widths
515
548
  cols: Var[Union[str, int, bool]]
516
549
 
@@ -520,6 +553,9 @@ class Textarea(BaseHTML):
520
553
  # Disables the textarea
521
554
  disabled: Var[Union[str, int, bool]]
522
555
 
556
+ # Enter key submits form (shift-enter adds new line)
557
+ enter_key_submit: Var[bool]
558
+
523
559
  # Associates the textarea with a form (by id)
524
560
  form: Var[Union[str, int, bool]]
525
561
 
@@ -550,6 +586,47 @@ class Textarea(BaseHTML):
550
586
  # How the text in the textarea is to be wrapped when submitting the form
551
587
  wrap: Var[Union[str, int, bool]]
552
588
 
589
+ def _exclude_props(self) -> list[str]:
590
+ return super()._exclude_props() + [
591
+ "auto_height",
592
+ "enter_key_submit",
593
+ ]
594
+
595
+ def get_custom_code(self) -> Set[str]:
596
+ """Include the custom code for auto_height and enter_key_submit functionality.
597
+
598
+ Returns:
599
+ The custom code for the component.
600
+ """
601
+ custom_code = super().get_custom_code()
602
+ if self.auto_height is not None:
603
+ custom_code.add(AUTO_HEIGHT_JS)
604
+ if self.enter_key_submit is not None:
605
+ custom_code.add(ENTER_KEY_SUBMIT_JS)
606
+ return custom_code
607
+
608
+ def _render(self) -> Tag:
609
+ tag = super()._render()
610
+ if self.enter_key_submit is not None:
611
+ if "on_key_down" in self.event_triggers:
612
+ raise ValueError(
613
+ "Cannot combine `enter_key_submit` with `on_key_down`.",
614
+ )
615
+ tag.add_props(
616
+ on_key_down=Var.create_safe(
617
+ f"(e) => enterKeySubmitOnKeyDown(e, {self.enter_key_submit._var_name_unwrapped})",
618
+ _var_is_local=False,
619
+ )._replace(merge_var_data=self.enter_key_submit._var_data),
620
+ )
621
+ if self.auto_height is not None:
622
+ tag.add_props(
623
+ on_input=Var.create_safe(
624
+ f"(e) => autoHeightOnInput(e, {self.auto_height._var_name_unwrapped})",
625
+ _var_is_local=False,
626
+ )._replace(merge_var_data=self.auto_height._var_data),
627
+ )
628
+ return tag
629
+
553
630
  def get_event_triggers(self) -> Dict[str, Any]:
554
631
  """Get the event triggers that pass the component's value to the handler.
555
632
 
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/forms.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -8,7 +8,7 @@ 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 hashlib import md5
11
- from typing import Any, Dict, Iterator, Union
11
+ from typing import Any, Dict, Iterator, Set, Union
12
12
  from jinja2 import Environment
13
13
  from reflex.components.el.element import Element
14
14
  from reflex.components.tags.tag import Tag
@@ -2018,7 +2018,11 @@ class Select(BaseHTML):
2018
2018
  """
2019
2019
  ...
2020
2020
 
2021
+ AUTO_HEIGHT_JS = '\nconst autoHeightOnInput = (e, is_enabled) => {\n if (is_enabled) {\n const el = e.target;\n el.style.overflowY = "hidden";\n el.style.height = "auto";\n el.style.height = (e.target.scrollHeight) + "px";\n if (el.form && !el.form.data_resize_on_reset) {\n el.form.addEventListener("reset", () => window.setTimeout(() => autoHeightOnInput(e, is_enabled), 0))\n el.form.data_resize_on_reset = true;\n }\n }\n}\n'
2022
+ ENTER_KEY_SUBMIT_JS = "\nconst enterKeySubmitOnKeyDown = (e, is_enabled) => {\n if (is_enabled && e.which === 13 && !e.shiftKey) {\n e.preventDefault();\n if (!e.repeat) {\n if (e.target.form) {\n e.target.form.requestSubmit();\n }\n }\n }\n}\n"
2023
+
2021
2024
  class Textarea(BaseHTML):
2025
+ def get_custom_code(self) -> Set[str]: ...
2022
2026
  def get_event_triggers(self) -> Dict[str, Any]: ...
2023
2027
  @overload
2024
2028
  @classmethod
@@ -2031,6 +2035,7 @@ class Textarea(BaseHTML):
2031
2035
  auto_focus: Optional[
2032
2036
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
2033
2037
  ] = None,
2038
+ auto_height: Optional[Union[Var[bool], bool]] = None,
2034
2039
  cols: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
2035
2040
  dirname: Optional[
2036
2041
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
@@ -2038,6 +2043,7 @@ class Textarea(BaseHTML):
2038
2043
  disabled: Optional[
2039
2044
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
2040
2045
  ] = None,
2046
+ enter_key_submit: Optional[Union[Var[bool], bool]] = None,
2041
2047
  form: Optional[Union[Var[Union[str, int, bool]], Union[str, int, bool]]] = None,
2042
2048
  max_length: Optional[
2043
2049
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
@@ -2168,9 +2174,11 @@ class Textarea(BaseHTML):
2168
2174
  *children: The children of the component.
2169
2175
  auto_complete: Whether the form control should have autocomplete enabled
2170
2176
  auto_focus: Automatically focuses the textarea when the page loads
2177
+ auto_height: Automatically fit the content height to the text (use min-height with this prop)
2171
2178
  cols: Visible width of the text control, in average character widths
2172
2179
  dirname: Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
2173
2180
  disabled: Disables the textarea
2181
+ enter_key_submit: Enter key submits form (shift-enter adds new line)
2174
2182
  form: Associates the textarea with a form (by id)
2175
2183
  max_length: Maximum number of characters allowed in the textarea
2176
2184
  min_length: Minimum number of characters required in the textarea
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/inline.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/media.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/metadata.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/other.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/scripts.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/sectioning.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/tables.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/el/elements/typography.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload
@@ -1,6 +1,6 @@
1
1
  """Stub file for reflex/components/gridjs/datatable.py"""
2
2
  # ------------------- DO NOT EDIT ----------------------
3
- # This file was generated by `scripts/pyi_generator.py`!
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
4
  # ------------------------------------------------------
5
5
 
6
6
  from typing import Any, Dict, Literal, Optional, Union, overload