reflex 0.4.9a2__py3-none-any.whl → 0.5.0a1__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 (131) hide show
  1. reflex/.templates/apps/blank/code/blank.py +19 -16
  2. reflex/.templates/apps/demo/code/pages/datatable.py +4 -4
  3. reflex/.templates/apps/demo/code/pages/forms.py +2 -2
  4. reflex/.templates/web/utils/helpers/debounce.js +17 -0
  5. reflex/.templates/web/utils/helpers/throttle.js +22 -0
  6. reflex/.templates/web/utils/state.js +21 -3
  7. reflex/__init__.py +6 -1
  8. reflex/__init__.pyi +4 -1
  9. reflex/app.py +157 -140
  10. reflex/app_module_for_backend.py +1 -1
  11. reflex/base.py +13 -15
  12. reflex/compiler/compiler.py +10 -1
  13. reflex/compiler/utils.py +3 -30
  14. reflex/components/__init__.py +1 -0
  15. reflex/components/chakra/datadisplay/list.py +1 -3
  16. reflex/components/chakra/datadisplay/list.pyi +3 -3
  17. reflex/components/chakra/disclosure/accordion.py +1 -1
  18. reflex/components/chakra/forms/pininput.pyi +1 -1
  19. reflex/components/chakra/media/icon.py +2 -2
  20. reflex/components/component.py +279 -32
  21. reflex/components/core/__init__.py +2 -2
  22. reflex/components/core/cond.py +1 -10
  23. reflex/components/core/debounce.py +5 -2
  24. reflex/components/core/debounce.pyi +4 -2
  25. reflex/components/core/foreach.py +1 -16
  26. reflex/components/core/html.py +6 -0
  27. reflex/components/core/match.py +2 -17
  28. reflex/components/core/upload.py +42 -1
  29. reflex/components/core/upload.pyi +199 -1
  30. reflex/components/datadisplay/code.py +7 -3
  31. reflex/components/datadisplay/code.pyi +3 -1
  32. reflex/components/el/elements/forms.py +1 -1
  33. reflex/components/el/elements/forms.pyi +1 -1
  34. reflex/components/lucide/icon.py +5 -13
  35. reflex/components/lucide/icon.pyi +0 -1
  36. reflex/components/markdown/markdown.py +5 -23
  37. reflex/components/markdown/markdown.pyi +1 -4
  38. reflex/components/radix/primitives/accordion.py +227 -406
  39. reflex/components/radix/primitives/accordion.pyi +369 -28
  40. reflex/components/radix/primitives/form.py +33 -29
  41. reflex/components/radix/primitives/form.pyi +7 -2
  42. reflex/components/radix/primitives/progress.py +17 -9
  43. reflex/components/radix/primitives/progress.pyi +2 -0
  44. reflex/components/radix/primitives/slider.py +30 -18
  45. reflex/components/radix/primitives/slider.pyi +4 -0
  46. reflex/components/radix/themes/base.py +8 -1
  47. reflex/components/radix/themes/base.pyi +79 -1
  48. reflex/components/radix/themes/color_mode.py +74 -30
  49. reflex/components/radix/themes/color_mode.pyi +26 -185
  50. reflex/components/radix/themes/components/__init__.py +17 -0
  51. reflex/components/radix/themes/components/badge.py +2 -1
  52. reflex/components/radix/themes/components/badge.pyi +3 -1
  53. reflex/components/radix/themes/components/button.py +3 -1
  54. reflex/components/radix/themes/components/button.pyi +4 -1
  55. reflex/components/radix/themes/components/checkbox_cards.py +48 -0
  56. reflex/components/radix/themes/components/checkbox_cards.pyi +264 -0
  57. reflex/components/radix/themes/components/checkbox_group.py +42 -0
  58. reflex/components/radix/themes/components/checkbox_group.pyi +253 -0
  59. reflex/components/radix/themes/components/data_list.py +63 -0
  60. reflex/components/radix/themes/components/data_list.pyi +426 -0
  61. reflex/components/radix/themes/components/icon_button.py +20 -17
  62. reflex/components/radix/themes/components/icon_button.pyi +5 -1
  63. reflex/components/radix/themes/components/progress.py +55 -0
  64. reflex/components/radix/themes/components/progress.pyi +180 -0
  65. reflex/components/radix/themes/components/radio.py +31 -0
  66. reflex/components/radix/themes/components/radio.pyi +169 -0
  67. reflex/components/radix/themes/components/radio_cards.py +48 -0
  68. reflex/components/radix/themes/components/radio_cards.pyi +264 -0
  69. reflex/components/radix/themes/components/radio_group.py +2 -4
  70. reflex/components/radix/themes/components/segmented_control.py +48 -0
  71. reflex/components/radix/themes/components/segmented_control.pyi +262 -0
  72. reflex/components/radix/themes/components/skeleton.py +32 -0
  73. reflex/components/radix/themes/components/skeleton.pyi +106 -0
  74. reflex/components/radix/themes/components/spinner.py +26 -0
  75. reflex/components/radix/themes/components/spinner.pyi +101 -0
  76. reflex/components/radix/themes/components/tabs.py +26 -1
  77. reflex/components/radix/themes/components/tabs.pyi +69 -9
  78. reflex/components/radix/themes/components/text_field.py +101 -71
  79. reflex/components/radix/themes/components/text_field.pyi +81 -499
  80. reflex/components/radix/themes/layout/base.py +2 -2
  81. reflex/components/radix/themes/layout/base.pyi +4 -4
  82. reflex/components/radix/themes/layout/center.py +8 -3
  83. reflex/components/radix/themes/layout/center.pyi +2 -1
  84. reflex/components/radix/themes/layout/container.py +30 -2
  85. reflex/components/radix/themes/layout/container.pyi +9 -30
  86. reflex/components/radix/themes/layout/list.py +10 -5
  87. reflex/components/radix/themes/layout/list.pyi +5 -21
  88. reflex/components/radix/themes/layout/spacer.py +8 -3
  89. reflex/components/radix/themes/layout/spacer.pyi +2 -1
  90. reflex/components/radix/themes/layout/stack.py +7 -1
  91. reflex/components/radix/themes/layout/stack.pyi +3 -3
  92. reflex/components/radix/themes/typography/link.py +10 -2
  93. reflex/components/radix/themes/typography/link.pyi +5 -4
  94. reflex/components/sonner/__init__.py +3 -0
  95. reflex/components/sonner/toast.py +267 -0
  96. reflex/components/sonner/toast.pyi +205 -0
  97. reflex/components/tags/iter_tag.py +9 -6
  98. reflex/config.py +30 -54
  99. reflex/constants/__init__.py +0 -2
  100. reflex/constants/base.py +0 -5
  101. reflex/constants/colors.py +2 -0
  102. reflex/constants/installer.py +5 -1
  103. reflex/constants/route.py +4 -0
  104. reflex/custom_components/custom_components.py +22 -1
  105. reflex/event.py +75 -30
  106. reflex/experimental/__init__.py +5 -0
  107. reflex/experimental/layout.py +24 -6
  108. reflex/model.py +2 -1
  109. reflex/page.py +7 -4
  110. reflex/reflex.py +8 -3
  111. reflex/route.py +39 -0
  112. reflex/state.py +128 -131
  113. reflex/style.py +20 -1
  114. reflex/testing.py +10 -6
  115. reflex/utils/console.py +3 -1
  116. reflex/utils/exec.py +20 -7
  117. reflex/utils/format.py +1 -1
  118. reflex/utils/imports.py +3 -1
  119. reflex/utils/prerequisites.py +141 -20
  120. reflex/utils/processes.py +21 -1
  121. reflex/utils/pyi_generator.py +95 -5
  122. reflex/utils/serializers.py +1 -1
  123. reflex/utils/telemetry.py +26 -4
  124. reflex/utils/types.py +62 -18
  125. reflex/vars.py +11 -5
  126. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/METADATA +16 -4
  127. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/RECORD +130 -108
  128. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/WHEEL +1 -1
  129. reflex/app.pyi +0 -149
  130. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/LICENSE +0 -0
  131. {reflex-0.4.9a2.dist-info → reflex-0.5.0a1.dist-info}/entry_points.txt +0 -0
@@ -8,13 +8,14 @@ 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
  import dataclasses
11
+ from typing import Literal, get_args
11
12
  from reflex.components.component import BaseComponent
12
- from reflex.components.core.cond import Cond, color_mode_cond
13
+ from reflex.components.core.cond import Cond, color_mode_cond, cond
13
14
  from reflex.components.lucide.icon import Icon
14
- from reflex.style import LIGHT_COLOR_MODE, color_mode, toggle_color_mode
15
- from reflex.vars import BaseVar
16
- from .components.button import Button
17
- from .components.switch import Switch
15
+ from reflex.style import color_mode, toggle_color_mode
16
+ from reflex.utils import console
17
+ from reflex.vars import BaseVar, Var
18
+ from .components.icon_button import IconButton
18
19
 
19
20
  DEFAULT_LIGHT_ICON: Icon
20
21
  DEFAULT_DARK_ICON: Icon
@@ -92,187 +93,25 @@ class ColorModeIcon(Cond):
92
93
  """
93
94
  ...
94
95
 
95
- class ColorModeSwitch(Switch):
96
- @overload
97
- @classmethod
98
- def create( # type: ignore
99
- cls,
100
- *children,
101
- as_child: Optional[Union[Var[bool], bool]] = None,
102
- default_checked: Optional[Union[Var[bool], bool]] = None,
103
- checked: Optional[Union[Var[bool], bool]] = None,
104
- disabled: Optional[Union[Var[bool], bool]] = None,
105
- required: Optional[Union[Var[bool], bool]] = None,
106
- name: Optional[Union[Var[str], str]] = None,
107
- value: Optional[Union[Var[str], str]] = None,
108
- size: Optional[
109
- Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
110
- ] = None,
111
- variant: Optional[
112
- Union[
113
- Var[Literal["classic", "surface", "soft"]],
114
- Literal["classic", "surface", "soft"],
115
- ]
116
- ] = None,
117
- color_scheme: Optional[
118
- Union[
119
- Var[
120
- Literal[
121
- "tomato",
122
- "red",
123
- "ruby",
124
- "crimson",
125
- "pink",
126
- "plum",
127
- "purple",
128
- "violet",
129
- "iris",
130
- "indigo",
131
- "blue",
132
- "cyan",
133
- "teal",
134
- "jade",
135
- "green",
136
- "grass",
137
- "brown",
138
- "orange",
139
- "sky",
140
- "mint",
141
- "lime",
142
- "yellow",
143
- "amber",
144
- "gold",
145
- "bronze",
146
- "gray",
147
- ]
148
- ],
149
- Literal[
150
- "tomato",
151
- "red",
152
- "ruby",
153
- "crimson",
154
- "pink",
155
- "plum",
156
- "purple",
157
- "violet",
158
- "iris",
159
- "indigo",
160
- "blue",
161
- "cyan",
162
- "teal",
163
- "jade",
164
- "green",
165
- "grass",
166
- "brown",
167
- "orange",
168
- "sky",
169
- "mint",
170
- "lime",
171
- "yellow",
172
- "amber",
173
- "gold",
174
- "bronze",
175
- "gray",
176
- ],
177
- ]
178
- ] = None,
179
- high_contrast: Optional[Union[Var[bool], bool]] = None,
180
- radius: Optional[
181
- Union[
182
- Var[Literal["none", "small", "full"]], Literal["none", "small", "full"]
183
- ]
184
- ] = None,
185
- style: Optional[Style] = None,
186
- key: Optional[Any] = None,
187
- id: Optional[Any] = None,
188
- class_name: Optional[Any] = None,
189
- autofocus: Optional[bool] = None,
190
- custom_attrs: Optional[Dict[str, Union[Var, str]]] = None,
191
- on_blur: Optional[
192
- Union[EventHandler, EventSpec, list, function, BaseVar]
193
- ] = None,
194
- on_change: Optional[
195
- Union[EventHandler, EventSpec, list, function, BaseVar]
196
- ] = None,
197
- on_click: Optional[
198
- Union[EventHandler, EventSpec, list, function, BaseVar]
199
- ] = None,
200
- on_context_menu: Optional[
201
- Union[EventHandler, EventSpec, list, function, BaseVar]
202
- ] = None,
203
- on_double_click: Optional[
204
- Union[EventHandler, EventSpec, list, function, BaseVar]
205
- ] = None,
206
- on_focus: Optional[
207
- Union[EventHandler, EventSpec, list, function, BaseVar]
208
- ] = None,
209
- on_mount: Optional[
210
- Union[EventHandler, EventSpec, list, function, BaseVar]
211
- ] = None,
212
- on_mouse_down: Optional[
213
- Union[EventHandler, EventSpec, list, function, BaseVar]
214
- ] = None,
215
- on_mouse_enter: Optional[
216
- Union[EventHandler, EventSpec, list, function, BaseVar]
217
- ] = None,
218
- on_mouse_leave: Optional[
219
- Union[EventHandler, EventSpec, list, function, BaseVar]
220
- ] = None,
221
- on_mouse_move: Optional[
222
- Union[EventHandler, EventSpec, list, function, BaseVar]
223
- ] = None,
224
- on_mouse_out: Optional[
225
- Union[EventHandler, EventSpec, list, function, BaseVar]
226
- ] = None,
227
- on_mouse_over: Optional[
228
- Union[EventHandler, EventSpec, list, function, BaseVar]
229
- ] = None,
230
- on_mouse_up: Optional[
231
- Union[EventHandler, EventSpec, list, function, BaseVar]
232
- ] = None,
233
- on_scroll: Optional[
234
- Union[EventHandler, EventSpec, list, function, BaseVar]
235
- ] = None,
236
- on_unmount: Optional[
237
- Union[EventHandler, EventSpec, list, function, BaseVar]
238
- ] = None,
239
- **props
240
- ) -> "ColorModeSwitch":
241
- """Create a switch component bound to color_mode.
242
-
243
- Args:
244
- *children: The children of the component.
245
- as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
246
- default_checked: Whether the switch is checked by default
247
- checked: Whether the switch is checked
248
- disabled: If true, prevent the user from interacting with the switch
249
- required: If true, the user must interact with the switch to submit the form
250
- name: The name of the switch (when submitting a form)
251
- value: The value associated with the "on" position
252
- size: Switch size "1" - "4"
253
- variant: Variant of switch: "classic" | "surface" | "soft"
254
- color_scheme: Override theme color for switch
255
- high_contrast: Whether to render the switch with higher contrast color against background
256
- radius: Override theme radius for switch: "none" | "small" | "full"
257
- style: The style of the component.
258
- key: A unique key for the component.
259
- id: The id for the component.
260
- class_name: The class name for the component.
261
- autofocus: Whether the component should take the focus once the page is loaded
262
- custom_attrs: custom attribute
263
- **props: The props to pass to the component.
96
+ LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"]
97
+ position_values = get_args(LiteralPosition)
98
+ position_map = {
99
+ "position": position_values,
100
+ "left": ["top-left", "bottom-left"],
101
+ "right": ["top-right", "bottom-right"],
102
+ "top": ["top-left", "top-right"],
103
+ "bottom": ["bottom-left", "bottom-right"],
104
+ }
264
105
 
265
- Returns:
266
- The switch component.
267
- """
268
- ...
269
-
270
- class ColorModeButton(Button):
106
+ class ColorModeIconButton(IconButton):
271
107
  @overload
272
108
  @classmethod
273
109
  def create( # type: ignore
274
110
  cls,
275
111
  *children,
112
+ position: Optional[
113
+ Literal["top-left", "top-right", "bottom-left", "bottom-right"]
114
+ ] = None,
276
115
  as_child: Optional[Union[Var[bool], bool]] = None,
277
116
  size: Optional[
278
117
  Union[Var[Literal["1", "2", "3", "4"]], Literal["1", "2", "3", "4"]]
@@ -417,6 +256,7 @@ class ColorModeButton(Button):
417
256
  title: Optional[
418
257
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
419
258
  ] = None,
259
+ loading: Optional[Union[Var[bool], bool]] = None,
420
260
  style: Optional[Style] = None,
421
261
  key: Optional[Any] = None,
422
262
  id: Optional[Any] = None,
@@ -469,14 +309,15 @@ class ColorModeButton(Button):
469
309
  Union[EventHandler, EventSpec, list, function, BaseVar]
470
310
  ] = None,
471
311
  **props
472
- ) -> "ColorModeButton":
473
- """Create a button component that calls toggle_color_mode on click.
312
+ ) -> "ColorModeIconButton":
313
+ """Create a icon button component that calls toggle_color_mode on click.
474
314
 
475
315
  Args:
476
316
  *children: The children of the component.
317
+ position: The position of the icon button. Follow document flow if None.
477
318
  as_child: Change the default rendered element for the one passed as a child, merging their props and behavior.
478
319
  size: Button size "1" - "4"
479
- variant: Variant of button: "solid" | "soft" | "outline" | "ghost"
320
+ variant: Variant of button: "classic" | "solid" | "soft" | "surface" | "outline" | "ghost"
480
321
  color_scheme: Override theme color for button
481
322
  high_contrast: Whether to render the button with higher contrast color against background
482
323
  radius: Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
@@ -507,6 +348,7 @@ class ColorModeButton(Button):
507
348
  spell_check: Defines whether the element may be checked for spelling errors.
508
349
  tab_index: Defines the position of the current element in the tabbing order.
509
350
  title: Defines a tooltip for the element.
351
+ loading: If set, show an rx.spinner instead of the component children.
510
352
  style: The style of the component.
511
353
  key: A unique key for the component.
512
354
  id: The id for the component.
@@ -522,7 +364,6 @@ class ColorModeButton(Button):
522
364
 
523
365
  class ColorModeNamespace(BaseVar):
524
366
  icon = staticmethod(ColorModeIcon.create)
525
- switch = staticmethod(ColorModeSwitch.create)
526
- button = staticmethod(ColorModeButton.create)
367
+ button = staticmethod(ColorModeIconButton.create)
527
368
 
528
369
  color_mode_var_and_namespace = ColorModeNamespace(**dataclasses.asdict(color_mode))
@@ -8,7 +8,10 @@ from .button import button as button
8
8
  from .callout import callout as callout
9
9
  from .card import card as card
10
10
  from .checkbox import checkbox as checkbox
11
+ from .checkbox_cards import checkbox_cards as checkbox_cards
12
+ from .checkbox_group import checkbox_group as checkbox_group
11
13
  from .context_menu import context_menu as context_menu
14
+ from .data_list import data_list as data_list
12
15
  from .dialog import dialog as dialog
13
16
  from .dropdown_menu import dropdown_menu as dropdown_menu
14
17
  from .dropdown_menu import menu as menu
@@ -16,13 +19,18 @@ from .hover_card import hover_card as hover_card
16
19
  from .icon_button import icon_button as icon_button
17
20
  from .inset import inset as inset
18
21
  from .popover import popover as popover
22
+ from .progress import progress as progress
23
+ from .radio_cards import radio_cards as radio_cards
19
24
  from .radio_group import radio as radio
20
25
  from .radio_group import radio_group as radio_group
21
26
  from .scroll_area import scroll_area as scroll_area
27
+ from .segmented_control import segmented_control as segmented_control
22
28
  from .select import select as select
23
29
  from .separator import divider as divider
24
30
  from .separator import separator as separator
31
+ from .skeleton import skeleton as skeleton
25
32
  from .slider import slider as slider
33
+ from .spinner import spinner as spinner
26
34
  from .switch import switch as switch
27
35
  from .table import table as table
28
36
  from .tabs import tabs as tabs
@@ -41,7 +49,10 @@ __all__ = [
41
49
  "callout",
42
50
  "card",
43
51
  "checkbox",
52
+ "checkbox_cards",
53
+ "checkbox_group",
44
54
  "context_menu",
55
+ "data_list",
45
56
  "dialog",
46
57
  "divider",
47
58
  "dropdown_menu",
@@ -51,12 +62,18 @@ __all__ = [
51
62
  "inset",
52
63
  "menu",
53
64
  "popover",
65
+ # progress is in experimental namespace until https://github.com/radix-ui/themes/pull/492
66
+ # "progress",
54
67
  "radio",
68
+ "radio_cards",
55
69
  "radio_group",
56
70
  "scroll_area",
71
+ "segmented_control",
57
72
  "select",
58
73
  "separator",
74
+ "skeleton",
59
75
  "slider",
76
+ "spinner",
60
77
  "switch",
61
78
  "table",
62
79
  "tabs",
@@ -1,4 +1,5 @@
1
1
  """Interactive components provided by @radix-ui/themes."""
2
+
2
3
  from typing import Literal
3
4
 
4
5
  from reflex import el
@@ -20,7 +21,7 @@ class Badge(el.Span, RadixThemesComponent):
20
21
  variant: Var[Literal["solid", "soft", "surface", "outline"]]
21
22
 
22
23
  # The size of the badge
23
- size: Var[Literal["1", "2"]]
24
+ size: Var[Literal["1", "2", "3"]]
24
25
 
25
26
  # Color theme of the badge
26
27
  color_scheme: Var[LiteralAccentColor]
@@ -24,7 +24,9 @@ class Badge(el.Span, RadixThemesComponent):
24
24
  Literal["solid", "soft", "surface", "outline"],
25
25
  ]
26
26
  ] = None,
27
- size: Optional[Union[Var[Literal["1", "2"]], Literal["1", "2"]]] = None,
27
+ size: Optional[
28
+ Union[Var[Literal["1", "2", "3"]], Literal["1", "2", "3"]]
29
+ ] = None,
28
30
  color_scheme: Optional[
29
31
  Union[
30
32
  Var[
@@ -1,4 +1,5 @@
1
1
  """Interactive components provided by @radix-ui/themes."""
2
+
2
3
  from typing import Literal
3
4
 
4
5
  from reflex import el
@@ -8,13 +9,14 @@ from ..base import (
8
9
  LiteralAccentColor,
9
10
  LiteralRadius,
10
11
  LiteralVariant,
12
+ RadixLoadingProp,
11
13
  RadixThemesComponent,
12
14
  )
13
15
 
14
16
  LiteralButtonSize = Literal["1", "2", "3", "4"]
15
17
 
16
18
 
17
- class Button(el.Button, RadixThemesComponent):
19
+ class Button(el.Button, RadixLoadingProp, RadixThemesComponent):
18
20
  """Trigger an action or event, such as submitting a form or displaying a dialog."""
19
21
 
20
22
  tag = "Button"
@@ -14,12 +14,13 @@ from ..base import (
14
14
  LiteralAccentColor,
15
15
  LiteralRadius,
16
16
  LiteralVariant,
17
+ RadixLoadingProp,
17
18
  RadixThemesComponent,
18
19
  )
19
20
 
20
21
  LiteralButtonSize = Literal["1", "2", "3", "4"]
21
22
 
22
- class Button(el.Button, RadixThemesComponent):
23
+ class Button(el.Button, RadixLoadingProp, RadixThemesComponent):
23
24
  @overload
24
25
  @classmethod
25
26
  def create( # type: ignore
@@ -169,6 +170,7 @@ class Button(el.Button, RadixThemesComponent):
169
170
  title: Optional[
170
171
  Union[Var[Union[str, int, bool]], Union[str, int, bool]]
171
172
  ] = None,
173
+ loading: Optional[Union[Var[bool], bool]] = None,
172
174
  style: Optional[Style] = None,
173
175
  key: Optional[Any] = None,
174
176
  id: Optional[Any] = None,
@@ -262,6 +264,7 @@ class Button(el.Button, RadixThemesComponent):
262
264
  spell_check: Defines whether the element may be checked for spelling errors.
263
265
  tab_index: Defines the position of the current element in the tabbing order.
264
266
  title: Defines a tooltip for the element.
267
+ loading: If set, show an rx.spinner instead of the component children.
265
268
  style: The style of the component.
266
269
  key: A unique key for the component.
267
270
  id: The id for the component.
@@ -0,0 +1,48 @@
1
+ """Components for the Radix CheckboxCards component."""
2
+
3
+ from types import SimpleNamespace
4
+ from typing import Literal, Union
5
+
6
+ from reflex.vars import Var
7
+
8
+ from ..base import LiteralAccentColor, RadixThemesComponent
9
+
10
+
11
+ class CheckboxCardsRoot(RadixThemesComponent):
12
+ """Root element for a CheckboxCards component."""
13
+
14
+ tag = "CheckboxCards.Root"
15
+
16
+ # The size of the checkbox cards: "1" | "2" | "3"
17
+ size: Var[Literal["1", "2", "3"]]
18
+
19
+ # Variant of button: "classic" | "surface" | "soft"
20
+ variant: Var[Literal["classic", "surface"]]
21
+
22
+ # Override theme color for button
23
+ color_scheme: Var[LiteralAccentColor]
24
+
25
+ # Uses a higher contrast color for the component.
26
+ high_contrast: Var[bool]
27
+
28
+ # The number of columns:
29
+ columns: Var[Union[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]]
30
+
31
+ # The gap between the checkbox cards:
32
+ gap: Var[Union[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]]
33
+
34
+
35
+ class CheckboxCardsItem(RadixThemesComponent):
36
+ """An item in the CheckboxCards component."""
37
+
38
+ tag = "CheckboxCards.Item"
39
+
40
+
41
+ class CheckboxCards(SimpleNamespace):
42
+ """CheckboxCards components namespace."""
43
+
44
+ root = staticmethod(CheckboxCardsRoot.create)
45
+ item = staticmethod(CheckboxCardsItem.create)
46
+
47
+
48
+ checkbox_cards = CheckboxCards()