reflex 0.6.6.post3__py3-none-any.whl → 0.6.7__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 (141) hide show
  1. reflex/.templates/jinja/web/pages/stateful_component.js.jinja2 +5 -1
  2. reflex/.templates/web/utils/state.js +36 -28
  3. reflex/__init__.py +1 -1
  4. reflex/__init__.pyi +1 -0
  5. reflex/app.py +41 -16
  6. reflex/assets.py +2 -2
  7. reflex/base.py +8 -7
  8. reflex/compiler/templates.py +1 -0
  9. reflex/compiler/utils.py +2 -3
  10. reflex/components/base/bare.py +2 -2
  11. reflex/components/component.py +54 -29
  12. reflex/components/core/banner.py +2 -2
  13. reflex/components/core/banner.pyi +1 -1
  14. reflex/components/core/client_side_routing.py +2 -2
  15. reflex/components/core/client_side_routing.pyi +1 -1
  16. reflex/components/core/clipboard.py +11 -9
  17. reflex/components/core/clipboard.pyi +1 -1
  18. reflex/components/core/cond.py +3 -3
  19. reflex/components/core/foreach.py +1 -1
  20. reflex/components/core/html.pyi +1 -1
  21. reflex/components/core/upload.py +8 -8
  22. reflex/components/datadisplay/code.py +5 -5
  23. reflex/components/datadisplay/dataeditor.py +8 -28
  24. reflex/components/datadisplay/dataeditor.pyi +1 -1
  25. reflex/components/datadisplay/shiki_code_block.py +7 -7
  26. reflex/components/dynamic.py +2 -2
  27. reflex/components/el/elements/__init__.py +1 -1
  28. reflex/components/el/elements/__init__.pyi +1 -1
  29. reflex/components/el/elements/base.py +2 -2
  30. reflex/components/el/elements/base.pyi +1 -1
  31. reflex/components/el/elements/forms.py +40 -10
  32. reflex/components/el/elements/forms.pyi +17 -15
  33. reflex/components/el/elements/inline.py +1 -1
  34. reflex/components/el/elements/inline.pyi +28 -28
  35. reflex/components/el/elements/media.py +1 -4
  36. reflex/components/el/elements/media.pyi +25 -26
  37. reflex/components/el/elements/metadata.py +6 -6
  38. reflex/components/el/elements/metadata.pyi +4 -4
  39. reflex/components/el/elements/other.py +17 -9
  40. reflex/components/el/elements/other.pyi +7 -7
  41. reflex/components/el/elements/scripts.py +1 -2
  42. reflex/components/el/elements/scripts.pyi +3 -3
  43. reflex/components/el/elements/sectioning.py +16 -16
  44. reflex/components/el/elements/sectioning.pyi +15 -15
  45. reflex/components/el/elements/tables.py +1 -1
  46. reflex/components/el/elements/tables.pyi +10 -10
  47. reflex/components/el/elements/typography.py +1 -1
  48. reflex/components/el/elements/typography.pyi +15 -15
  49. reflex/components/markdown/markdown.py +3 -3
  50. reflex/components/next/image.py +1 -1
  51. reflex/components/next/image.pyi +1 -1
  52. reflex/components/plotly/plotly.py +2 -2
  53. reflex/components/radix/primitives/accordion.py +2 -1
  54. reflex/components/radix/primitives/form.pyi +3 -3
  55. reflex/components/radix/primitives/slider.py +1 -1
  56. reflex/components/radix/themes/base.py +4 -10
  57. reflex/components/radix/themes/color_mode.pyi +2 -2
  58. reflex/components/radix/themes/components/alert_dialog.pyi +1 -1
  59. reflex/components/radix/themes/components/badge.pyi +1 -1
  60. reflex/components/radix/themes/components/button.pyi +1 -1
  61. reflex/components/radix/themes/components/callout.pyi +5 -5
  62. reflex/components/radix/themes/components/card.pyi +1 -1
  63. reflex/components/radix/themes/components/checkbox.pyi +3 -3
  64. reflex/components/radix/themes/components/context_menu.py +11 -0
  65. reflex/components/radix/themes/components/context_menu.pyi +155 -0
  66. reflex/components/radix/themes/components/dialog.pyi +1 -1
  67. reflex/components/radix/themes/components/hover_card.pyi +1 -1
  68. reflex/components/radix/themes/components/icon_button.py +1 -1
  69. reflex/components/radix/themes/components/icon_button.pyi +1 -1
  70. reflex/components/radix/themes/components/inset.pyi +1 -1
  71. reflex/components/radix/themes/components/popover.pyi +1 -1
  72. reflex/components/radix/themes/components/radio_group.py +2 -4
  73. reflex/components/radix/themes/components/radio_group.pyi +1 -1
  74. reflex/components/radix/themes/components/select.pyi +3 -3
  75. reflex/components/radix/themes/components/slider.pyi +1 -1
  76. reflex/components/radix/themes/components/switch.pyi +1 -1
  77. reflex/components/radix/themes/components/table.pyi +7 -7
  78. reflex/components/radix/themes/components/tabs.pyi +2 -2
  79. reflex/components/radix/themes/components/text_area.py +3 -0
  80. reflex/components/radix/themes/components/text_area.pyi +3 -1
  81. reflex/components/radix/themes/components/text_field.py +16 -1
  82. reflex/components/radix/themes/components/text_field.pyi +105 -17
  83. reflex/components/radix/themes/layout/box.pyi +1 -1
  84. reflex/components/radix/themes/layout/center.pyi +1 -1
  85. reflex/components/radix/themes/layout/flex.pyi +1 -1
  86. reflex/components/radix/themes/layout/grid.pyi +1 -1
  87. reflex/components/radix/themes/layout/list.py +0 -4
  88. reflex/components/radix/themes/layout/list.pyi +3 -8
  89. reflex/components/radix/themes/layout/section.pyi +1 -1
  90. reflex/components/radix/themes/layout/spacer.pyi +1 -1
  91. reflex/components/radix/themes/layout/stack.pyi +3 -3
  92. reflex/components/radix/themes/typography/blockquote.pyi +1 -1
  93. reflex/components/radix/themes/typography/code.pyi +1 -1
  94. reflex/components/radix/themes/typography/heading.pyi +1 -1
  95. reflex/components/radix/themes/typography/link.py +5 -1
  96. reflex/components/radix/themes/typography/link.pyi +1 -1
  97. reflex/components/radix/themes/typography/text.pyi +7 -7
  98. reflex/components/recharts/cartesian.py +1 -1
  99. reflex/components/recharts/charts.py +4 -4
  100. reflex/components/recharts/polar.py +1 -1
  101. reflex/components/recharts/polar.pyi +1 -1
  102. reflex/components/sonner/toast.py +4 -7
  103. reflex/components/suneditor/editor.py +6 -6
  104. reflex/components/suneditor/editor.pyi +6 -6
  105. reflex/config.py +25 -10
  106. reflex/constants/compiler.py +6 -0
  107. reflex/constants/config.py +2 -0
  108. reflex/constants/custom_components.py +1 -1
  109. reflex/constants/route.py +1 -1
  110. reflex/custom_components/custom_components.py +21 -21
  111. reflex/event.py +57 -22
  112. reflex/experimental/client_state.py +2 -1
  113. reflex/experimental/layout.py +0 -6
  114. reflex/model.py +125 -9
  115. reflex/reflex.py +5 -6
  116. reflex/state.py +200 -88
  117. reflex/style.py +1 -4
  118. reflex/testing.py +10 -11
  119. reflex/utils/build.py +1 -1
  120. reflex/utils/console.py +75 -6
  121. reflex/utils/exceptions.py +12 -0
  122. reflex/utils/exec.py +10 -10
  123. reflex/utils/export.py +1 -2
  124. reflex/utils/format.py +11 -8
  125. reflex/utils/path_ops.py +2 -2
  126. reflex/utils/prerequisites.py +31 -28
  127. reflex/utils/processes.py +4 -4
  128. reflex/utils/pyi_generator.py +12 -11
  129. reflex/utils/types.py +6 -3
  130. reflex/vars/__init__.py +1 -0
  131. reflex/vars/base.py +75 -38
  132. reflex/vars/datetime.py +222 -0
  133. reflex/vars/function.py +3 -3
  134. reflex/vars/number.py +3 -3
  135. reflex/vars/object.py +5 -5
  136. reflex/vars/sequence.py +7 -7
  137. {reflex-0.6.6.post3.dist-info → reflex-0.6.7.dist-info}/METADATA +2 -2
  138. {reflex-0.6.6.post3.dist-info → reflex-0.6.7.dist-info}/RECORD +141 -140
  139. {reflex-0.6.6.post3.dist-info → reflex-0.6.7.dist-info}/LICENSE +0 -0
  140. {reflex-0.6.6.post3.dist-info → reflex-0.6.7.dist-info}/WHEEL +0 -0
  141. {reflex-0.6.6.post3.dist-info → reflex-0.6.7.dist-info}/entry_points.txt +0 -0
@@ -94,7 +94,7 @@ class TableRoot(elements.Table, RadixThemesComponent):
94
94
  variant: The variant of the table
95
95
  align: Alignment of the table
96
96
  summary: Provides a summary of the table's purpose and structure
97
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
97
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
98
98
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
99
99
  content_editable: Indicates whether the element's content is editable.
100
100
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -185,7 +185,7 @@ class TableHeader(elements.Thead, RadixThemesComponent):
185
185
  Args:
186
186
  *children: Child components.
187
187
  align: Alignment of the content within the table header
188
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
188
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
189
189
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
190
190
  content_editable: Indicates whether the element's content is editable.
191
191
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -281,7 +281,7 @@ class TableRow(elements.Tr, RadixThemesComponent):
281
281
  Args:
282
282
  *children: Child components.
283
283
  align: Alignment of the content within the table row
284
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
284
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
285
285
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
286
286
  content_editable: Indicates whether the element's content is editable.
287
287
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -395,7 +395,7 @@ class TableColumnHeaderCell(elements.Th, RadixThemesComponent):
395
395
  headers: IDs of the headers associated with this header cell
396
396
  row_span: Number of rows a header cell should span
397
397
  scope: Scope of the header cell (row, col, rowgroup, colgroup)
398
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
398
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
399
399
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
400
400
  content_editable: Indicates whether the element's content is editable.
401
401
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -486,7 +486,7 @@ class TableBody(elements.Tbody, RadixThemesComponent):
486
486
  Args:
487
487
  *children: Child components.
488
488
  align: Alignment of the content within the table body
489
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
489
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
490
490
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
491
491
  content_editable: Indicates whether the element's content is editable.
492
492
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -717,7 +717,7 @@ class TableCell(elements.Td, CommonPaddingProps, RadixThemesComponent):
717
717
  col_span: Number of columns a cell should span
718
718
  headers: IDs of the headers associated with this cell
719
719
  row_span: Number of rows a cell should span
720
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
720
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
721
721
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
722
722
  content_editable: Indicates whether the element's content is editable.
723
723
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -957,7 +957,7 @@ class TableRowHeaderCell(elements.Th, CommonPaddingProps, RadixThemesComponent):
957
957
  headers: IDs of the headers associated with this header cell
958
958
  row_span: Number of rows a header cell should span
959
959
  scope: Scope of the header cell (row, col, rowgroup, colgroup)
960
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
960
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
961
961
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
962
962
  content_editable: Indicates whether the element's content is editable.
963
963
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -72,7 +72,7 @@ class TabsRoot(RadixThemesComponent):
72
72
  orientation: The orientation of the tabs.
73
73
  dir: Reading direction of the tabs.
74
74
  activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
75
- on_change: Props to rename Fired when the value of the tabs changes.
75
+ on_change: Fired when the value of the tabs changes.
76
76
  style: The style of the component.
77
77
  key: A unique key for the component.
78
78
  id: The id for the component.
@@ -374,7 +374,7 @@ class Tabs(ComponentNamespace):
374
374
  orientation: The orientation of the tabs.
375
375
  dir: Reading direction of the tabs.
376
376
  activation_mode: The mode of activation for the tabs. "automatic" will activate the tab when focused. "manual" will activate the tab when clicked.
377
- on_change: Props to rename Fired when the value of the tabs changes.
377
+ on_change: Fired when the value of the tabs changes.
378
378
  style: The style of the component.
379
379
  key: A unique key for the component.
380
380
  id: The id for the component.
@@ -41,6 +41,9 @@ class TextArea(RadixThemesComponent, elements.Textarea):
41
41
  # Automatically focuses the textarea when the page loads
42
42
  auto_focus: Var[bool]
43
43
 
44
+ # The default value of the textarea when initially rendered
45
+ default_value: Var[str]
46
+
44
47
  # Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
45
48
  dirname: Var[str]
46
49
 
@@ -123,6 +123,7 @@ class TextArea(RadixThemesComponent, elements.Textarea):
123
123
  ] = None,
124
124
  auto_complete: Optional[Union[Var[bool], bool]] = None,
125
125
  auto_focus: Optional[Union[Var[bool], bool]] = None,
126
+ default_value: Optional[Union[Var[str], str]] = None,
126
127
  dirname: Optional[Union[Var[str], str]] = None,
127
128
  disabled: Optional[Union[Var[bool], bool]] = None,
128
129
  form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
@@ -217,6 +218,7 @@ class TextArea(RadixThemesComponent, elements.Textarea):
217
218
  radius: The radius of the text area: "none" | "small" | "medium" | "large" | "full"
218
219
  auto_complete: Whether the form control should have autocomplete enabled
219
220
  auto_focus: Automatically focuses the textarea when the page loads
221
+ default_value: The default value of the textarea when initially rendered
220
222
  dirname: Name part of the textarea to submit in 'dir' and 'name' pair when form is submitted
221
223
  disabled: Disables the textarea
222
224
  form: Associates the textarea with a form (by id)
@@ -237,7 +239,7 @@ class TextArea(RadixThemesComponent, elements.Textarea):
237
239
  on_blur: Fired when the input loses focus
238
240
  on_key_down: Fired when a key is pressed down
239
241
  on_key_up: Fired when a key is released
240
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
242
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
241
243
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
242
244
  content_editable: Indicates whether the element's content is editable.
243
245
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -9,7 +9,9 @@ from reflex.components.core.breakpoints import Responsive
9
9
  from reflex.components.core.debounce import DebounceInput
10
10
  from reflex.components.el import elements
11
11
  from reflex.event import EventHandler, input_event, key_event
12
+ from reflex.utils.types import is_optional
12
13
  from reflex.vars.base import Var
14
+ from reflex.vars.number import ternary_operation
13
15
 
14
16
  from ..base import LiteralAccentColor, LiteralRadius, RadixThemesComponent
15
17
 
@@ -17,7 +19,7 @@ LiteralTextFieldSize = Literal["1", "2", "3"]
17
19
  LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
18
20
 
19
21
 
20
- class TextFieldRoot(elements.Div, RadixThemesComponent):
22
+ class TextFieldRoot(elements.Input, RadixThemesComponent):
21
23
  """Captures user input with an optional slot for buttons and icons."""
22
24
 
23
25
  tag = "TextField.Root"
@@ -96,6 +98,19 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
96
98
  Returns:
97
99
  The component.
98
100
  """
101
+ value = props.get("value")
102
+
103
+ # React expects an empty string(instead of null) for controlled inputs.
104
+ if value is not None and is_optional(
105
+ (value_var := Var.create(value))._var_type
106
+ ):
107
+ props["value"] = ternary_operation(
108
+ (value_var != Var.create(None)) # pyright: ignore [reportGeneralTypeIssues]
109
+ & (value_var != Var(_js_expr="undefined")),
110
+ value,
111
+ Var.create(""),
112
+ )
113
+
99
114
  component = super().create(*children, **props)
100
115
  if props.get("value") is not None and props.get("on_change") is not None:
101
116
  # create a debounced input if the user requests full control to avoid typing jank
@@ -17,7 +17,7 @@ from ..base import RadixThemesComponent
17
17
  LiteralTextFieldSize = Literal["1", "2", "3"]
18
18
  LiteralTextFieldVariant = Literal["classic", "surface", "soft"]
19
19
 
20
- class TextFieldRoot(elements.Div, RadixThemesComponent):
20
+ class TextFieldRoot(elements.Input, RadixThemesComponent):
21
21
  @overload
22
22
  @classmethod
23
23
  def create( # type: ignore
@@ -120,6 +120,30 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
120
120
  type: Optional[Union[Var[str], str]] = None,
121
121
  value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None,
122
122
  list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
123
+ accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
124
+ alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
125
+ auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
126
+ capture: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
127
+ checked: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
128
+ default_checked: Optional[Union[Var[bool], bool]] = None,
129
+ dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
130
+ form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
131
+ form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
132
+ form_enc_type: Optional[
133
+ Union[Var[Union[bool, int, str]], bool, int, str]
134
+ ] = None,
135
+ form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
136
+ form_no_validate: Optional[
137
+ Union[Var[Union[bool, int, str]], bool, int, str]
138
+ ] = None,
139
+ form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
140
+ max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
141
+ min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
142
+ multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
143
+ pattern: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
144
+ src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
145
+ step: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
146
+ use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
123
147
  access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
124
148
  auto_capitalize: Optional[
125
149
  Union[Var[Union[bool, int, str]], bool, int, str]
@@ -192,12 +216,12 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
192
216
 
193
217
  Args:
194
218
  *children: The children of the component.
195
- size: Text field size "1" - "3"
219
+ size: Specifies the visible width of a text control
196
220
  variant: Variant of text field: "classic" | "surface" | "soft"
197
221
  color_scheme: Override theme color for text field
198
222
  radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
199
223
  auto_complete: Whether the input should have autocomplete enabled
200
- default_value: The value of the input when initially rendered.
224
+ default_value: The initial value for a text field
201
225
  disabled: Disables the input
202
226
  max_length: Specifies the maximum number of characters allowed in the input
203
227
  min_length: Specifies the minimum number of characters required in the input
@@ -208,12 +232,32 @@ class TextFieldRoot(elements.Div, RadixThemesComponent):
208
232
  type: Specifies the type of input
209
233
  value: Value of the input
210
234
  list: References a datalist for suggested options
211
- on_change: Fired when the value of the textarea changes.
212
- on_focus: Fired when the textarea is focused.
213
- on_blur: Fired when the textarea is blurred.
214
- on_key_down: Fired when a key is pressed down.
215
- on_key_up: Fired when a key is released.
216
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
235
+ on_change: Fired when the input value changes
236
+ on_focus: Fired when the input gains focus
237
+ on_blur: Fired when the input loses focus
238
+ on_key_down: Fired when a key is pressed down
239
+ on_key_up: Fired when a key is released
240
+ accept: Accepted types of files when the input is file type
241
+ alt: Alternate text for input type="image"
242
+ auto_focus: Automatically focuses the input when the page loads
243
+ capture: Captures media from the user (camera or microphone)
244
+ checked: Indicates whether the input is checked (for checkboxes and radio buttons)
245
+ default_checked: The initial value (for checkboxes and radio buttons)
246
+ dirname: Name part of the input to submit in 'dir' and 'name' pair when form is submitted
247
+ form: Associates the input with a form (by id)
248
+ form_action: URL to send the form data to (for type="submit" buttons)
249
+ form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons)
250
+ form_method: HTTP method to use for sending form data (for type="submit" buttons)
251
+ form_no_validate: Bypasses form validation when submitting (for type="submit" buttons)
252
+ form_target: Specifies where to display the response after submitting the form (for type="submit" buttons)
253
+ max: Specifies the maximum value for the input
254
+ min: Specifies the minimum value for the input
255
+ multiple: Indicates whether multiple values can be entered in an input of the type email or file
256
+ pattern: Regex pattern the input's value must match to be valid
257
+ src: URL for image inputs
258
+ step: Specifies the legal number intervals for an input
259
+ use_map: Name of the image map used with the input
260
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
217
261
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
218
262
  content_editable: Indicates whether the element's content is editable.
219
263
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -457,6 +501,30 @@ class TextField(ComponentNamespace):
457
501
  type: Optional[Union[Var[str], str]] = None,
458
502
  value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None,
459
503
  list: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
504
+ accept: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
505
+ alt: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
506
+ auto_focus: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
507
+ capture: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
508
+ checked: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
509
+ default_checked: Optional[Union[Var[bool], bool]] = None,
510
+ dirname: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
511
+ form: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
512
+ form_action: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
513
+ form_enc_type: Optional[
514
+ Union[Var[Union[bool, int, str]], bool, int, str]
515
+ ] = None,
516
+ form_method: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
517
+ form_no_validate: Optional[
518
+ Union[Var[Union[bool, int, str]], bool, int, str]
519
+ ] = None,
520
+ form_target: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
521
+ max: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
522
+ min: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
523
+ multiple: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
524
+ pattern: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
525
+ src: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
526
+ step: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
527
+ use_map: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
460
528
  access_key: Optional[Union[Var[Union[bool, int, str]], bool, int, str]] = None,
461
529
  auto_capitalize: Optional[
462
530
  Union[Var[Union[bool, int, str]], bool, int, str]
@@ -529,12 +597,12 @@ class TextField(ComponentNamespace):
529
597
 
530
598
  Args:
531
599
  *children: The children of the component.
532
- size: Text field size "1" - "3"
600
+ size: Specifies the visible width of a text control
533
601
  variant: Variant of text field: "classic" | "surface" | "soft"
534
602
  color_scheme: Override theme color for text field
535
603
  radius: Override theme radius for text field: "none" | "small" | "medium" | "large" | "full"
536
604
  auto_complete: Whether the input should have autocomplete enabled
537
- default_value: The value of the input when initially rendered.
605
+ default_value: The initial value for a text field
538
606
  disabled: Disables the input
539
607
  max_length: Specifies the maximum number of characters allowed in the input
540
608
  min_length: Specifies the minimum number of characters required in the input
@@ -545,12 +613,32 @@ class TextField(ComponentNamespace):
545
613
  type: Specifies the type of input
546
614
  value: Value of the input
547
615
  list: References a datalist for suggested options
548
- on_change: Fired when the value of the textarea changes.
549
- on_focus: Fired when the textarea is focused.
550
- on_blur: Fired when the textarea is blurred.
551
- on_key_down: Fired when a key is pressed down.
552
- on_key_up: Fired when a key is released.
553
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
616
+ on_change: Fired when the input value changes
617
+ on_focus: Fired when the input gains focus
618
+ on_blur: Fired when the input loses focus
619
+ on_key_down: Fired when a key is pressed down
620
+ on_key_up: Fired when a key is released
621
+ accept: Accepted types of files when the input is file type
622
+ alt: Alternate text for input type="image"
623
+ auto_focus: Automatically focuses the input when the page loads
624
+ capture: Captures media from the user (camera or microphone)
625
+ checked: Indicates whether the input is checked (for checkboxes and radio buttons)
626
+ default_checked: The initial value (for checkboxes and radio buttons)
627
+ dirname: Name part of the input to submit in 'dir' and 'name' pair when form is submitted
628
+ form: Associates the input with a form (by id)
629
+ form_action: URL to send the form data to (for type="submit" buttons)
630
+ form_enc_type: How the form data should be encoded when submitting to the server (for type="submit" buttons)
631
+ form_method: HTTP method to use for sending form data (for type="submit" buttons)
632
+ form_no_validate: Bypasses form validation when submitting (for type="submit" buttons)
633
+ form_target: Specifies where to display the response after submitting the form (for type="submit" buttons)
634
+ max: Specifies the maximum value for the input
635
+ min: Specifies the minimum value for the input
636
+ multiple: Indicates whether multiple values can be entered in an input of the type email or file
637
+ pattern: Regex pattern the input's value must match to be valid
638
+ src: URL for image inputs
639
+ step: Specifies the legal number intervals for an input
640
+ use_map: Name of the image map used with the input
641
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
554
642
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
555
643
  content_editable: Indicates whether the element's content is editable.
556
644
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -72,7 +72,7 @@ class Box(elements.Div, RadixThemesComponent):
72
72
 
73
73
  Args:
74
74
  *children: Child components.
75
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
75
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
76
76
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
77
77
  content_editable: Indicates whether the element's content is editable.
78
78
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -155,7 +155,7 @@ class Center(Flex):
155
155
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
156
156
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
157
157
  spacing: Gap between children: "0" - "9"
158
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
158
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
159
159
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
160
160
  content_editable: Indicates whether the element's content is editable.
161
161
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -158,7 +158,7 @@ class Flex(elements.Div, RadixThemesComponent):
158
158
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
159
159
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
160
160
  spacing: Gap between children: "0" - "9"
161
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
161
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
162
162
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
163
163
  content_editable: Indicates whether the element's content is editable.
164
164
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -190,7 +190,7 @@ class Grid(elements.Div, RadixThemesComponent):
190
190
  spacing: Gap between children: "0" - "9"
191
191
  spacing_x: Gap between children horizontal: "0" - "9"
192
192
  spacing_y: Gap between children vertical: "0" - "9"
193
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
193
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
194
194
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
195
195
  content_editable: Indicates whether the element's content is editable.
196
196
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -64,7 +64,6 @@ class BaseList(Component, MarkdownComponentMap):
64
64
 
65
65
  Returns:
66
66
  The list component.
67
-
68
67
  """
69
68
  items = props.pop("items", None)
70
69
  list_style_type = props.pop("list_style_type", "none")
@@ -114,7 +113,6 @@ class UnorderedList(BaseList, Ul):
114
113
 
115
114
  Returns:
116
115
  The list component.
117
-
118
116
  """
119
117
  items = props.pop("items", None)
120
118
  list_style_type = props.pop("list_style_type", "disc")
@@ -144,7 +142,6 @@ class OrderedList(BaseList, Ol):
144
142
 
145
143
  Returns:
146
144
  The list component.
147
-
148
145
  """
149
146
  items = props.pop("items", None)
150
147
  list_style_type = props.pop("list_style_type", "decimal")
@@ -168,7 +165,6 @@ class ListItem(Li, MarkdownComponentMap):
168
165
 
169
166
  Returns:
170
167
  The list item component.
171
-
172
168
  """
173
169
  for child in children:
174
170
  if isinstance(child, Text):
@@ -118,7 +118,6 @@ class BaseList(Component, MarkdownComponentMap):
118
118
 
119
119
  Returns:
120
120
  The list component.
121
-
122
121
  """
123
122
  ...
124
123
 
@@ -226,7 +225,7 @@ class UnorderedList(BaseList, Ul):
226
225
  *children: The children of the component.
227
226
  list_style_type: The style of the list. Default to "none".
228
227
  items: A list of items to add to the list.
229
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
228
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
230
229
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
231
230
  content_editable: Indicates whether the element's content is editable.
232
231
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -252,7 +251,6 @@ class UnorderedList(BaseList, Ul):
252
251
 
253
252
  Returns:
254
253
  The list component.
255
-
256
254
  """
257
255
  ...
258
256
 
@@ -364,7 +362,7 @@ class OrderedList(BaseList, Ol):
364
362
  reversed: Reverses the order of the list.
365
363
  start: Specifies the start value of the first list item in an ordered list.
366
364
  type: Specifies the kind of marker to use in the list (letters or numbers).
367
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
365
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
368
366
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
369
367
  content_editable: Indicates whether the element's content is editable.
370
368
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -390,7 +388,6 @@ class OrderedList(BaseList, Ol):
390
388
 
391
389
  Returns:
392
390
  The list component.
393
-
394
391
  """
395
392
  ...
396
393
 
@@ -451,7 +448,7 @@ class ListItem(Li, MarkdownComponentMap):
451
448
 
452
449
  Args:
453
450
  *children: The children of the component.
454
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
451
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
455
452
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
456
453
  content_editable: Indicates whether the element's content is editable.
457
454
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -477,7 +474,6 @@ class ListItem(Li, MarkdownComponentMap):
477
474
 
478
475
  Returns:
479
476
  The list item component.
480
-
481
477
  """
482
478
  ...
483
479
 
@@ -571,7 +567,6 @@ class List(ComponentNamespace):
571
567
 
572
568
  Returns:
573
569
  The list component.
574
-
575
570
  """
576
571
  ...
577
572
 
@@ -87,7 +87,7 @@ class Section(elements.Section, RadixThemesComponent):
87
87
  Args:
88
88
  *children: Child components.
89
89
  size: The size of the section: "1" - "3" (default "2")
90
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
90
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
91
91
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
92
92
  content_editable: Indicates whether the element's content is editable.
93
93
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -155,7 +155,7 @@ class Spacer(Flex):
155
155
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
156
156
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
157
157
  spacing: Gap between children: "0" - "9"
158
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
158
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
159
159
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
160
160
  content_editable: Indicates whether the element's content is editable.
161
161
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -129,7 +129,7 @@ class Stack(Flex):
129
129
  direction: How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"
130
130
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
131
131
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
132
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
132
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
133
133
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
134
134
  content_editable: Indicates whether the element's content is editable.
135
135
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -264,7 +264,7 @@ class VStack(Stack):
264
264
  as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
265
265
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
266
266
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
267
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
267
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
268
268
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
269
269
  content_editable: Indicates whether the element's content is editable.
270
270
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -399,7 +399,7 @@ class HStack(Stack):
399
399
  as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
400
400
  justify: Alignment of children along the cross axis: "start" | "center" | "end" | "between"
401
401
  wrap: Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"
402
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
402
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
403
403
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
404
404
  content_editable: Indicates whether the element's content is editable.
405
405
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -168,7 +168,7 @@ class Blockquote(elements.Blockquote, RadixThemesComponent):
168
168
  color_scheme: Overrides the accent color inherited from the Theme.
169
169
  high_contrast: Whether to render the text with higher contrast color
170
170
  cite: Define the title of a work.
171
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
171
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
172
172
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
173
173
  content_editable: Indicates whether the element's content is editable.
174
174
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -174,7 +174,7 @@ class Code(elements.Code, RadixThemesComponent, MarkdownComponentMap):
174
174
  weight: Thickness of text: "light" | "regular" | "medium" | "bold"
175
175
  color_scheme: Overrides the accent color inherited from the Theme.
176
176
  high_contrast: Whether to render the text with higher contrast color
177
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
177
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
178
178
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
179
179
  content_editable: Indicates whether the element's content is editable.
180
180
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -197,7 +197,7 @@ class Heading(elements.H1, RadixThemesComponent, MarkdownComponentMap):
197
197
  trim: Removes the leading trim space: "normal" | "start" | "end" | "both"
198
198
  color_scheme: Overrides the accent color inherited from the Theme.
199
199
  high_contrast: Whether to render the text with higher contrast color
200
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
200
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
201
201
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
202
202
  content_editable: Indicates whether the element's content is editable.
203
203
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.
@@ -77,13 +77,14 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
77
77
  Component: The link component
78
78
  """
79
79
  props.setdefault(":hover", {"color": color("accent", 8)})
80
+ href = props.get("href")
80
81
 
81
82
  is_external = props.pop("is_external", None)
82
83
 
83
84
  if is_external is not None:
84
85
  props["target"] = cond(is_external, "_blank", "")
85
86
 
86
- if props.get("href") is not None:
87
+ if href is not None:
87
88
  if not len(children):
88
89
  raise ValueError("Link without a child will not display")
89
90
 
@@ -101,6 +102,9 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
101
102
  as_child=True,
102
103
  **props,
103
104
  )
105
+ else:
106
+ props["href"] = "#"
107
+
104
108
  return super().create(*children, **props)
105
109
 
106
110
 
@@ -215,7 +215,7 @@ class Link(RadixThemesComponent, A, MemoizationLeaf, MarkdownComponentMap):
215
215
  rel: Specifies the relationship between the linked document and the current document
216
216
  shape: Specifies the shape of the area
217
217
  target: Specifies where to open the linked document
218
- access_key: Provides a hint for generating a keyboard shortcut for the current element.
218
+ access_key: Provides a hint for generating a keyboard shortcut for the current element.
219
219
  auto_capitalize: Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
220
220
  content_editable: Indicates whether the element's content is editable.
221
221
  context_menu: Defines the ID of a <menu> element which will serve as the element's context menu.