reflex 0.5.2__py3-none-any.whl → 0.5.3__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 (166) hide show
  1. reflex/.templates/web/postcss.config.js +1 -0
  2. reflex/.templates/web/styles/tailwind.css +4 -1
  3. reflex/__init__.py +298 -204
  4. reflex/__init__.pyi +196 -157
  5. reflex/app.py +13 -2
  6. reflex/compiler/compiler.py +1 -1
  7. reflex/components/__init__.py +31 -17
  8. reflex/components/__init__.pyi +26 -0
  9. reflex/components/base/__init__.py +25 -9
  10. reflex/components/base/__init__.pyi +26 -0
  11. reflex/components/base/fragment.py +3 -0
  12. reflex/components/base/fragment.pyi +2 -0
  13. reflex/components/base/head.py +3 -0
  14. reflex/components/base/head.pyi +2 -0
  15. reflex/components/base/script.py +3 -0
  16. reflex/components/base/script.pyi +2 -0
  17. reflex/components/core/__init__.py +51 -37
  18. reflex/components/core/__init__.pyi +39 -0
  19. reflex/components/core/banner.py +7 -1
  20. reflex/components/core/banner.pyi +6 -1
  21. reflex/components/core/debounce.py +3 -0
  22. reflex/components/core/debounce.pyi +2 -0
  23. reflex/components/core/foreach.py +3 -0
  24. reflex/components/core/html.py +4 -1
  25. reflex/components/core/html.pyi +2 -0
  26. reflex/components/core/match.py +3 -0
  27. reflex/components/core/responsive.py +1 -1
  28. reflex/components/core/upload.py +5 -2
  29. reflex/components/core/upload.pyi +4 -2
  30. reflex/components/datadisplay/__init__.py +17 -8
  31. reflex/components/datadisplay/__init__.pyi +14 -0
  32. reflex/components/datadisplay/code.py +3 -0
  33. reflex/components/datadisplay/code.pyi +2 -0
  34. reflex/components/datadisplay/dataeditor.py +4 -0
  35. reflex/components/datadisplay/dataeditor.pyi +3 -0
  36. reflex/components/el/__init__.py +15 -1
  37. reflex/components/el/__init__.pyi +228 -0
  38. reflex/components/el/elements/__init__.py +129 -220
  39. reflex/components/el/elements/__init__.pyi +342 -0
  40. reflex/components/el/elements/forms.py +15 -0
  41. reflex/components/el/elements/forms.pyi +14 -0
  42. reflex/components/el/elements/inline.py +30 -0
  43. reflex/components/el/elements/inline.pyi +29 -0
  44. reflex/components/el/elements/media.py +16 -0
  45. reflex/components/el/elements/media.pyi +15 -0
  46. reflex/components/el/elements/metadata.py +7 -0
  47. reflex/components/el/elements/metadata.pyi +6 -0
  48. reflex/components/el/elements/other.py +9 -0
  49. reflex/components/el/elements/other.pyi +8 -0
  50. reflex/components/el/elements/scripts.py +5 -0
  51. reflex/components/el/elements/scripts.pyi +4 -0
  52. reflex/components/el/elements/sectioning.py +17 -0
  53. reflex/components/el/elements/sectioning.pyi +16 -0
  54. reflex/components/el/elements/tables.py +12 -0
  55. reflex/components/el/elements/tables.pyi +11 -0
  56. reflex/components/el/elements/typography.py +16 -0
  57. reflex/components/el/elements/typography.pyi +15 -0
  58. reflex/components/moment/__init__.py +1 -1
  59. reflex/components/plotly/plotly.py +185 -7
  60. reflex/components/plotly/plotly.pyi +62 -4
  61. reflex/components/radix/__init__.py +14 -2
  62. reflex/components/radix/__init__.pyi +73 -0
  63. reflex/components/radix/primitives/__init__.py +13 -5
  64. reflex/components/radix/primitives/__init__.pyi +11 -0
  65. reflex/components/radix/themes/__init__.py +20 -6
  66. reflex/components/radix/themes/__init__.pyi +13 -0
  67. reflex/components/radix/themes/base.py +26 -20
  68. reflex/components/radix/themes/base.pyi +4 -1
  69. reflex/components/radix/themes/color_mode.py +3 -1
  70. reflex/components/radix/themes/color_mode.pyi +3 -1
  71. reflex/components/radix/themes/components/__init__.py +11 -79
  72. reflex/components/radix/themes/components/__init__.pyi +44 -0
  73. reflex/components/radix/themes/components/alert_dialog.py +2 -2
  74. reflex/components/radix/themes/components/alert_dialog.pyi +2 -2
  75. reflex/components/radix/themes/components/badge.py +2 -2
  76. reflex/components/radix/themes/components/badge.pyi +2 -2
  77. reflex/components/radix/themes/components/button.py +2 -2
  78. reflex/components/radix/themes/components/button.pyi +2 -2
  79. reflex/components/radix/themes/components/callout.py +4 -4
  80. reflex/components/radix/themes/components/callout.pyi +4 -4
  81. reflex/components/radix/themes/components/card.py +2 -2
  82. reflex/components/radix/themes/components/card.pyi +2 -2
  83. reflex/components/radix/themes/components/dialog.py +2 -2
  84. reflex/components/radix/themes/components/dialog.pyi +2 -2
  85. reflex/components/radix/themes/components/hover_card.py +2 -2
  86. reflex/components/radix/themes/components/hover_card.pyi +2 -2
  87. reflex/components/radix/themes/components/icon_button.py +2 -2
  88. reflex/components/radix/themes/components/icon_button.pyi +2 -2
  89. reflex/components/radix/themes/components/inset.py +2 -2
  90. reflex/components/radix/themes/components/inset.pyi +2 -2
  91. reflex/components/radix/themes/components/popover.py +2 -2
  92. reflex/components/radix/themes/components/popover.pyi +2 -2
  93. reflex/components/radix/themes/components/table.py +8 -8
  94. reflex/components/radix/themes/components/table.pyi +8 -8
  95. reflex/components/radix/themes/components/text_area.py +11 -2
  96. reflex/components/radix/themes/components/text_area.pyi +18 -3
  97. reflex/components/radix/themes/components/text_field.py +3 -3
  98. reflex/components/radix/themes/components/text_field.pyi +3 -3
  99. reflex/components/radix/themes/layout/__init__.py +12 -38
  100. reflex/components/radix/themes/layout/__init__.pyi +21 -0
  101. reflex/components/radix/themes/layout/box.py +5 -2
  102. reflex/components/radix/themes/layout/box.pyi +4 -2
  103. reflex/components/radix/themes/layout/center.py +3 -0
  104. reflex/components/radix/themes/layout/center.pyi +2 -0
  105. reflex/components/radix/themes/layout/container.py +5 -2
  106. reflex/components/radix/themes/layout/container.pyi +4 -2
  107. reflex/components/radix/themes/layout/flex.py +5 -2
  108. reflex/components/radix/themes/layout/flex.pyi +4 -2
  109. reflex/components/radix/themes/layout/grid.py +5 -2
  110. reflex/components/radix/themes/layout/grid.pyi +4 -2
  111. reflex/components/radix/themes/layout/list.py +14 -0
  112. reflex/components/radix/themes/layout/list.pyi +3 -0
  113. reflex/components/radix/themes/layout/section.py +7 -4
  114. reflex/components/radix/themes/layout/section.pyi +5 -3
  115. reflex/components/radix/themes/layout/spacer.py +3 -0
  116. reflex/components/radix/themes/layout/spacer.pyi +2 -0
  117. reflex/components/radix/themes/layout/stack.py +5 -0
  118. reflex/components/radix/themes/layout/stack.pyi +4 -0
  119. reflex/components/radix/themes/typography/__init__.py +11 -16
  120. reflex/components/radix/themes/typography/__init__.pyi +12 -0
  121. reflex/components/radix/themes/typography/blockquote.py +5 -2
  122. reflex/components/radix/themes/typography/blockquote.pyi +4 -2
  123. reflex/components/radix/themes/typography/code.py +5 -2
  124. reflex/components/radix/themes/typography/code.pyi +4 -2
  125. reflex/components/radix/themes/typography/heading.py +5 -2
  126. reflex/components/radix/themes/typography/heading.pyi +4 -2
  127. reflex/components/radix/themes/typography/link.py +3 -0
  128. reflex/components/radix/themes/typography/link.pyi +2 -0
  129. reflex/components/radix/themes/typography/text.py +6 -6
  130. reflex/components/radix/themes/typography/text.pyi +6 -6
  131. reflex/components/recharts/__init__.py +114 -104
  132. reflex/components/recharts/__init__.pyi +106 -0
  133. reflex/components/recharts/cartesian.py +17 -0
  134. reflex/components/recharts/cartesian.pyi +16 -0
  135. reflex/components/recharts/charts.py +12 -0
  136. reflex/components/recharts/charts.pyi +11 -0
  137. reflex/components/recharts/general.py +7 -0
  138. reflex/components/recharts/general.pyi +6 -0
  139. reflex/components/recharts/polar.py +11 -0
  140. reflex/components/recharts/polar.pyi +9 -0
  141. reflex/config.py +3 -0
  142. reflex/constants/__init__.py +0 -2
  143. reflex/constants/base.py +5 -1
  144. reflex/constants/installer.py +2 -1
  145. reflex/experimental/__init__.py +2 -0
  146. reflex/experimental/assets.py +56 -0
  147. reflex/experimental/client_state.py +4 -2
  148. reflex/experimental/hooks.py +8 -6
  149. reflex/experimental/layout.py +3 -1
  150. reflex/state.py +54 -4
  151. reflex/utils/exec.py +8 -0
  152. reflex/utils/format.py +8 -4
  153. reflex/utils/lazy_loader.py +33 -0
  154. reflex/utils/prerequisites.py +1 -14
  155. reflex/utils/pyi_generator.py +71 -20
  156. reflex/utils/serializers.py +9 -4
  157. reflex/utils/types.py +3 -1
  158. reflex/vars.py +92 -6
  159. reflex/vars.pyi +16 -0
  160. {reflex-0.5.2.dist-info → reflex-0.5.3.dist-info}/METADATA +2 -1
  161. {reflex-0.5.2.dist-info → reflex-0.5.3.dist-info}/RECORD +164 -151
  162. reflex/config.pyi +0 -112
  163. reflex/constants/base.pyi +0 -94
  164. {reflex-0.5.2.dist-info → reflex-0.5.3.dist-info}/LICENSE +0 -0
  165. {reflex-0.5.2.dist-info → reflex-0.5.3.dist-info}/WHEEL +0 -0
  166. {reflex-0.5.2.dist-info → reflex-0.5.3.dist-info}/entry_points.txt +0 -0
@@ -1,108 +1,118 @@
1
1
  """Recharts components."""
2
+ from __future__ import annotations
2
3
 
3
- from .cartesian import (
4
- Area,
5
- Bar,
6
- Brush,
7
- Cartesian,
8
- CartesianAxis,
9
- CartesianGrid,
10
- ErrorBar,
11
- Funnel,
12
- Line,
13
- ReferenceArea,
14
- ReferenceDot,
15
- ReferenceLine,
16
- Scatter,
17
- XAxis,
18
- YAxis,
19
- ZAxis,
20
- )
21
- from .charts import (
22
- AreaChart,
23
- BarChart,
24
- ComposedChart,
25
- FunnelChart,
26
- LineChart,
27
- PieChart,
28
- RadarChart,
29
- RadialBarChart,
30
- ScatterChart,
31
- Treemap,
32
- )
33
- from .general import GraphingTooltip, Label, LabelList, Legend, ResponsiveContainer
34
- from .polar import (
35
- Pie,
36
- PolarAngleAxis,
37
- PolarGrid,
38
- PolarRadiusAxis,
39
- Radar,
40
- RadialBar,
41
- )
42
- from .recharts import (
43
- LiteralAnimationEasing,
44
- LiteralAreaType,
45
- LiteralAxisType,
46
- LiteralBarChartStackOffset,
47
- LiteralComposedChartBaseValue,
48
- LiteralDirection,
49
- LiteralGridType,
50
- LiteralIconType,
51
- LiteralIfOverflow,
52
- LiteralInterval,
53
- LiteralLayout,
54
- LiteralLegendAlign,
55
- LiteralLegendType,
56
- LiteralLineType,
57
- LiteralOrientation,
58
- LiteralOrientationLeftRightMiddle,
59
- LiteralOrientationTopBottom,
60
- LiteralOrientationTopBottomLeftRight,
61
- LiteralPolarRadiusType,
62
- LiteralScale,
63
- LiteralShape,
64
- LiteralStackOffset,
65
- LiteralSyncMethod,
66
- LiteralVerticalAlign,
67
- )
4
+ from reflex.utils import lazy_loader
68
5
 
69
- area_chart = AreaChart.create
70
- bar_chart = BarChart.create
71
- line_chart = LineChart.create
72
- composed_chart = ComposedChart.create
73
- pie_chart = PieChart.create
74
- radar_chart = RadarChart.create
75
- radial_bar_chart = RadialBarChart.create
76
- scatter_chart = ScatterChart.create
77
- funnel_chart = FunnelChart.create
78
- treemap = Treemap.create
6
+ _SUBMOD_ATTRS: dict = {
7
+ "cartesian": [
8
+ "area",
9
+ "Area",
10
+ "bar",
11
+ "Bar",
12
+ "line",
13
+ "Line",
14
+ "scatter",
15
+ "Scatter",
16
+ "x_axis",
17
+ "XAxis",
18
+ "y_axis",
19
+ "YAxis",
20
+ "z_axis",
21
+ "ZAxis",
22
+ "brush",
23
+ "Brush",
24
+ "cartesian_axis",
25
+ "CartesianAxis",
26
+ "cartesian_grid",
27
+ "CartesianGrid",
28
+ "reference_line",
29
+ "ReferenceLine",
30
+ "reference_dot",
31
+ "ReferenceDot",
32
+ "reference_area",
33
+ "ReferenceArea",
34
+ "error_bar",
35
+ "ErrorBar",
36
+ "funnel",
37
+ "Funnel",
38
+ ],
39
+ "charts": [
40
+ "area_chart",
41
+ "AreaChart",
42
+ "bar_chart",
43
+ "BarChart",
44
+ "line_chart",
45
+ "LineChart",
46
+ "composed_chart",
47
+ "ComposedChart",
48
+ "pie_chart",
49
+ "PieChart",
50
+ "radar_chart",
51
+ "RadarChart",
52
+ "radial_bar_chart",
53
+ "RadialBarChart",
54
+ "scatter_chart",
55
+ "ScatterChart",
56
+ "funnel_chart",
57
+ "FunnelChart",
58
+ "treemap",
59
+ "Treemap",
60
+ ],
61
+ "general": [
62
+ "responsive_container",
63
+ "ResponsiveContainer",
64
+ "legend",
65
+ "Legend",
66
+ "graphing_tooltip",
67
+ "GraphingTooltip",
68
+ "label",
69
+ "Label",
70
+ "label_list",
71
+ "LabelList",
72
+ ],
73
+ "polar": [
74
+ "pie",
75
+ "Pie",
76
+ "radar",
77
+ "Radar",
78
+ "radial_bar",
79
+ "RadialBar",
80
+ "polar_angle_axis",
81
+ "PolarAngleAxis",
82
+ "polar_grid",
83
+ "PolarGrid",
84
+ "polar_radius_axis",
85
+ "PolarRadiusAxis",
86
+ ],
87
+ "recharts": [
88
+ "LiteralAnimationEasing",
89
+ "LiteralAreaType",
90
+ "LiteralAxisType",
91
+ "LiteralBarChartStackOffset",
92
+ "LiteralComposedChartBaseValue",
93
+ "LiteralDirection",
94
+ "LiteralGridType",
95
+ "LiteralIconType",
96
+ "LiteralIfOverflow",
97
+ "LiteralInterval",
98
+ "LiteralLayout",
99
+ "LiteralLegendAlign",
100
+ "LiteralLegendType",
101
+ "LiteralLineType",
102
+ "LiteralOrientation",
103
+ "LiteralOrientationLeftRightMiddle",
104
+ "LiteralOrientationTopBottom",
105
+ "LiteralOrientationTopBottomLeftRight",
106
+ "LiteralPolarRadiusType",
107
+ "LiteralScale",
108
+ "LiteralShape",
109
+ "LiteralStackOffset",
110
+ "LiteralSyncMethod",
111
+ "LiteralVerticalAlign",
112
+ ],
113
+ }
79
114
 
80
-
81
- area = Area.create
82
- bar = Bar.create
83
- line = Line.create
84
- scatter = Scatter.create
85
- x_axis = XAxis.create
86
- y_axis = YAxis.create
87
- z_axis = ZAxis.create
88
- brush = Brush.create
89
- cartesian_axis = CartesianAxis.create
90
- cartesian_grid = CartesianGrid.create
91
- reference_line = ReferenceLine.create
92
- reference_dot = ReferenceDot.create
93
- reference_area = ReferenceArea.create
94
- error_bar = ErrorBar.create
95
- funnel = Funnel.create
96
-
97
- responsive_container = ResponsiveContainer.create
98
- legend = Legend.create
99
- graphing_tooltip = GraphingTooltip.create
100
- label = Label.create
101
- label_list = LabelList.create
102
-
103
- pie = Pie.create
104
- radar = Radar.create
105
- radial_bar = RadialBar.create
106
- polar_angle_axis = PolarAngleAxis.create
107
- polar_grid = PolarGrid.create
108
- polar_radius_axis = PolarRadiusAxis.create
115
+ __getattr__, __dir__, __all__ = lazy_loader.attach(
116
+ __name__,
117
+ submod_attrs=_SUBMOD_ATTRS,
118
+ )
@@ -0,0 +1,106 @@
1
+ """Stub file for reflex/components/recharts/__init__.py"""
2
+ # ------------------- DO NOT EDIT ----------------------
3
+ # This file was generated by `reflex/utils/pyi_generator.py`!
4
+ # ------------------------------------------------------
5
+
6
+ from .cartesian import area as area
7
+ from .cartesian import Area as Area
8
+ from .cartesian import bar as bar
9
+ from .cartesian import Bar as Bar
10
+ from .cartesian import line as line
11
+ from .cartesian import Line as Line
12
+ from .cartesian import scatter as scatter
13
+ from .cartesian import Scatter as Scatter
14
+ from .cartesian import x_axis as x_axis
15
+ from .cartesian import XAxis as XAxis
16
+ from .cartesian import y_axis as y_axis
17
+ from .cartesian import YAxis as YAxis
18
+ from .cartesian import z_axis as z_axis
19
+ from .cartesian import ZAxis as ZAxis
20
+ from .cartesian import brush as brush
21
+ from .cartesian import Brush as Brush
22
+ from .cartesian import cartesian_axis as cartesian_axis
23
+ from .cartesian import CartesianAxis as CartesianAxis
24
+ from .cartesian import cartesian_grid as cartesian_grid
25
+ from .cartesian import CartesianGrid as CartesianGrid
26
+ from .cartesian import reference_line as reference_line
27
+ from .cartesian import ReferenceLine as ReferenceLine
28
+ from .cartesian import reference_dot as reference_dot
29
+ from .cartesian import ReferenceDot as ReferenceDot
30
+ from .cartesian import reference_area as reference_area
31
+ from .cartesian import ReferenceArea as ReferenceArea
32
+ from .cartesian import error_bar as error_bar
33
+ from .cartesian import ErrorBar as ErrorBar
34
+ from .cartesian import funnel as funnel
35
+ from .cartesian import Funnel as Funnel
36
+ from .charts import area_chart as area_chart
37
+ from .charts import AreaChart as AreaChart
38
+ from .charts import bar_chart as bar_chart
39
+ from .charts import BarChart as BarChart
40
+ from .charts import line_chart as line_chart
41
+ from .charts import LineChart as LineChart
42
+ from .charts import composed_chart as composed_chart
43
+ from .charts import ComposedChart as ComposedChart
44
+ from .charts import pie_chart as pie_chart
45
+ from .charts import PieChart as PieChart
46
+ from .charts import radar_chart as radar_chart
47
+ from .charts import RadarChart as RadarChart
48
+ from .charts import radial_bar_chart as radial_bar_chart
49
+ from .charts import RadialBarChart as RadialBarChart
50
+ from .charts import scatter_chart as scatter_chart
51
+ from .charts import ScatterChart as ScatterChart
52
+ from .charts import funnel_chart as funnel_chart
53
+ from .charts import FunnelChart as FunnelChart
54
+ from .charts import treemap as treemap
55
+ from .charts import Treemap as Treemap
56
+ from .general import responsive_container as responsive_container
57
+ from .general import ResponsiveContainer as ResponsiveContainer
58
+ from .general import legend as legend
59
+ from .general import Legend as Legend
60
+ from .general import graphing_tooltip as graphing_tooltip
61
+ from .general import GraphingTooltip as GraphingTooltip
62
+ from .general import label as label
63
+ from .general import Label as Label
64
+ from .general import label_list as label_list
65
+ from .general import LabelList as LabelList
66
+ from .polar import pie as pie
67
+ from .polar import Pie as Pie
68
+ from .polar import radar as radar
69
+ from .polar import Radar as Radar
70
+ from .polar import radial_bar as radial_bar
71
+ from .polar import RadialBar as RadialBar
72
+ from .polar import polar_angle_axis as polar_angle_axis
73
+ from .polar import PolarAngleAxis as PolarAngleAxis
74
+ from .polar import polar_grid as polar_grid
75
+ from .polar import PolarGrid as PolarGrid
76
+ from .polar import polar_radius_axis as polar_radius_axis
77
+ from .polar import PolarRadiusAxis as PolarRadiusAxis
78
+ from .recharts import LiteralAnimationEasing as LiteralAnimationEasing
79
+ from .recharts import LiteralAreaType as LiteralAreaType
80
+ from .recharts import LiteralAxisType as LiteralAxisType
81
+ from .recharts import LiteralBarChartStackOffset as LiteralBarChartStackOffset
82
+ from .recharts import LiteralComposedChartBaseValue as LiteralComposedChartBaseValue
83
+ from .recharts import LiteralDirection as LiteralDirection
84
+ from .recharts import LiteralGridType as LiteralGridType
85
+ from .recharts import LiteralIconType as LiteralIconType
86
+ from .recharts import LiteralIfOverflow as LiteralIfOverflow
87
+ from .recharts import LiteralInterval as LiteralInterval
88
+ from .recharts import LiteralLayout as LiteralLayout
89
+ from .recharts import LiteralLegendAlign as LiteralLegendAlign
90
+ from .recharts import LiteralLegendType as LiteralLegendType
91
+ from .recharts import LiteralLineType as LiteralLineType
92
+ from .recharts import LiteralOrientation as LiteralOrientation
93
+ from .recharts import (
94
+ LiteralOrientationLeftRightMiddle as LiteralOrientationLeftRightMiddle,
95
+ )
96
+ from .recharts import LiteralOrientationTopBottom as LiteralOrientationTopBottom
97
+ from .recharts import (
98
+ LiteralOrientationTopBottomLeftRight as LiteralOrientationTopBottomLeftRight,
99
+ )
100
+ from .recharts import LiteralPolarRadiusType as LiteralPolarRadiusType
101
+ from .recharts import LiteralScale as LiteralScale
102
+ from .recharts import LiteralShape as LiteralShape
103
+ from .recharts import LiteralStackOffset as LiteralStackOffset
104
+ from .recharts import LiteralSyncMethod as LiteralSyncMethod
105
+ from .recharts import LiteralVerticalAlign as LiteralVerticalAlign
106
+ from reflex.utils import lazy_loader
@@ -572,3 +572,20 @@ class CartesianAxis(Grid):
572
572
 
573
573
  # The margin between tick line and tick.
574
574
  tick_margin: Var[int]
575
+
576
+
577
+ area = Area.create
578
+ bar = Bar.create
579
+ line = Line.create
580
+ scatter = Scatter.create
581
+ x_axis = XAxis.create
582
+ y_axis = YAxis.create
583
+ z_axis = ZAxis.create
584
+ brush = Brush.create
585
+ cartesian_axis = CartesianAxis.create
586
+ cartesian_grid = CartesianGrid.create
587
+ reference_line = ReferenceLine.create
588
+ reference_dot = ReferenceDot.create
589
+ reference_area = ReferenceArea.create
590
+ error_bar = ErrorBar.create
591
+ funnel = Funnel.create
@@ -1849,3 +1849,19 @@ class CartesianAxis(Grid):
1849
1849
  The component.
1850
1850
  """
1851
1851
  ...
1852
+
1853
+ area = Area.create
1854
+ bar = Bar.create
1855
+ line = Line.create
1856
+ scatter = Scatter.create
1857
+ x_axis = XAxis.create
1858
+ y_axis = YAxis.create
1859
+ z_axis = ZAxis.create
1860
+ brush = Brush.create
1861
+ cartesian_axis = CartesianAxis.create
1862
+ cartesian_grid = CartesianGrid.create
1863
+ reference_line = ReferenceLine.create
1864
+ reference_dot = ReferenceDot.create
1865
+ reference_area = ReferenceArea.create
1866
+ error_bar = ErrorBar.create
1867
+ funnel = Funnel.create
@@ -521,3 +521,15 @@ class Treemap(RechartsCharts):
521
521
  width=props.pop("width", "100%"),
522
522
  height=props.pop("height", "100%"),
523
523
  )
524
+
525
+
526
+ area_chart = AreaChart.create
527
+ bar_chart = BarChart.create
528
+ line_chart = LineChart.create
529
+ composed_chart = ComposedChart.create
530
+ pie_chart = PieChart.create
531
+ radar_chart = RadarChart.create
532
+ radial_bar_chart = RadialBarChart.create
533
+ scatter_chart = ScatterChart.create
534
+ funnel_chart = FunnelChart.create
535
+ treemap = Treemap.create
@@ -893,3 +893,14 @@ class Treemap(RechartsCharts):
893
893
  The Treemap component wrapped in a responsive container.
894
894
  """
895
895
  ...
896
+
897
+ area_chart = AreaChart.create
898
+ bar_chart = BarChart.create
899
+ line_chart = LineChart.create
900
+ composed_chart = ComposedChart.create
901
+ pie_chart = PieChart.create
902
+ radar_chart = RadarChart.create
903
+ radial_bar_chart = RadialBarChart.create
904
+ scatter_chart = ScatterChart.create
905
+ funnel_chart = FunnelChart.create
906
+ treemap = Treemap.create
@@ -182,3 +182,10 @@ class LabelList(Recharts):
182
182
 
183
183
  # Color of the stroke
184
184
  stroke: Var[str]
185
+
186
+
187
+ responsive_container = ResponsiveContainer.create
188
+ legend = Legend.create
189
+ graphing_tooltip = GraphingTooltip.create
190
+ label = Label.create
191
+ label_list = LabelList.create
@@ -573,3 +573,9 @@ class LabelList(Recharts):
573
573
  The component.
574
574
  """
575
575
  ...
576
+
577
+ responsive_container = ResponsiveContainer.create
578
+ legend = Legend.create
579
+ graphing_tooltip = GraphingTooltip.create
580
+ label = Label.create
581
+ label_list = LabelList.create
@@ -308,6 +308,9 @@ class PolarRadiusAxis(Recharts):
308
308
  # Valid children components
309
309
  _valid_children: List[str] = ["Label"]
310
310
 
311
+ # The domain of the polar radius axis, specifying the minimum and maximum values.
312
+ domain: List[int] = [0, 250]
313
+
311
314
  def get_event_triggers(self) -> dict[str, Union[Var, Any]]:
312
315
  """Get the event triggers that pass the component's value to the handler.
313
316
 
@@ -322,3 +325,11 @@ class PolarRadiusAxis(Recharts):
322
325
  EventTriggers.ON_MOUSE_ENTER: lambda: [],
323
326
  EventTriggers.ON_MOUSE_LEAVE: lambda: [],
324
327
  }
328
+
329
+
330
+ pie = Pie.create
331
+ radar = Radar.create
332
+ radial_bar = RadialBar.create
333
+ polar_angle_axis = PolarAngleAxis.create
334
+ polar_grid = PolarGrid.create
335
+ polar_radius_axis = PolarRadiusAxis.create
@@ -492,6 +492,7 @@ class PolarRadiusAxis(Recharts):
492
492
  ],
493
493
  ]
494
494
  ] = None,
495
+ domain: Optional[List[int]] = None,
495
496
  style: Optional[Style] = None,
496
497
  key: Optional[Any] = None,
497
498
  id: Optional[Any] = None,
@@ -533,6 +534,7 @@ class PolarRadiusAxis(Recharts):
533
534
  tick: The width or height of tick.
534
535
  tick_count: The count of ticks.
535
536
  scale: If 'auto' set, the scale funtion is linear scale. 'auto' | 'linear' | 'pow' | 'sqrt' | 'log' | 'identity' | 'time' | 'band' | 'point' | 'ordinal' | 'quantile' | 'quantize' | 'utc' | 'sequential' | 'threshold'
537
+ domain: The domain of the polar radius axis, specifying the minimum and maximum values.
536
538
  style: The style of the component.
537
539
  key: A unique key for the component.
538
540
  id: The id for the component.
@@ -545,3 +547,10 @@ class PolarRadiusAxis(Recharts):
545
547
  The component.
546
548
  """
547
549
  ...
550
+
551
+ pie = Pie.create
552
+ radar = Radar.create
553
+ radial_bar = RadialBar.create
554
+ polar_angle_axis = PolarAngleAxis.create
555
+ polar_grid = PolarGrid.create
556
+ polar_radius_axis = PolarRadiusAxis.create
reflex/config.py CHANGED
@@ -202,6 +202,9 @@ class Config(Base):
202
202
  # Whether to enable or disable nextJS gzip compression.
203
203
  next_compression: bool = True
204
204
 
205
+ # Whether to use React strict mode in nextJS
206
+ react_strict_mode: bool = True
207
+
205
208
  # Additional frontend packages to install.
206
209
  frontend_packages: List[str] = []
207
210
 
@@ -35,7 +35,6 @@ from .compiler import (
35
35
  )
36
36
  from .config import (
37
37
  ALEMBIC_CONFIG,
38
- PRODUCTION_BACKEND_URL,
39
38
  Config,
40
39
  Expiration,
41
40
  GitIgnore,
@@ -99,7 +98,6 @@ __ALL__ = [
99
98
  Ping,
100
99
  POLLING_MAX_HTTP_BUFFER_SIZE,
101
100
  PYTEST_CURRENT_TEST,
102
- PRODUCTION_BACKEND_URL,
103
101
  Reflex,
104
102
  RELOAD_CONFIG,
105
103
  RequirementsTxt,
reflex/constants/base.py CHANGED
@@ -21,10 +21,14 @@ class Dirs(SimpleNamespace):
21
21
  WEB = ".web"
22
22
  # The name of the assets directory.
23
23
  APP_ASSETS = "assets"
24
+ # The name of the assets directory for external ressource (a subfolder of APP_ASSETS).
25
+ EXTERNAL_APP_ASSETS = "external"
24
26
  # The name of the utils file.
25
27
  UTILS = "utils"
26
28
  # The name of the output static directory.
27
29
  STATIC = "_static"
30
+ # The name of the public html directory served at "/"
31
+ PUBLIC = "public"
28
32
  # The name of the state file.
29
33
  STATE_PATH = "/".join([UTILS, "state"])
30
34
  # The name of the components file.
@@ -38,7 +42,7 @@ class Dirs(SimpleNamespace):
38
42
  # The directory where the utils file is located.
39
43
  WEB_UTILS = os.path.join(WEB, UTILS)
40
44
  # The directory where the assets are located.
41
- WEB_ASSETS = os.path.join(WEB, "public")
45
+ WEB_ASSETS = os.path.join(WEB, PUBLIC)
42
46
  # The env json file.
43
47
  ENV_JSON = os.path.join(WEB, "env.json")
44
48
  # The reflex json file.
@@ -35,7 +35,7 @@ class Bun(SimpleNamespace):
35
35
  """Bun constants."""
36
36
 
37
37
  # The Bun version.
38
- VERSION = "1.1.8"
38
+ VERSION = "1.1.10"
39
39
  # Min Bun Version
40
40
  MIN_VERSION = "0.7.0"
41
41
  # The directory to store the bun.
@@ -123,4 +123,5 @@ class PackageJson(SimpleNamespace):
123
123
  DEV_DEPENDENCIES = {
124
124
  "autoprefixer": "10.4.14",
125
125
  "postcss": "8.4.31",
126
+ "postcss-import": "16.1.0",
126
127
  }
@@ -8,6 +8,7 @@ from reflex.components.sonner.toast import toast as toast
8
8
 
9
9
  from ..utils.console import warn
10
10
  from . import hooks as hooks
11
+ from .assets import asset as asset
11
12
  from .client_state import ClientStateVar as ClientStateVar
12
13
  from .layout import layout as layout
13
14
  from .misc import run_in_thread as run_in_thread
@@ -17,6 +18,7 @@ warn(
17
18
  )
18
19
 
19
20
  _x = SimpleNamespace(
21
+ asset=asset,
20
22
  client_state=ClientStateVar.create,
21
23
  hooks=hooks,
22
24
  layout=layout,
@@ -0,0 +1,56 @@
1
+ """Helper functions for adding assets to the app."""
2
+ import inspect
3
+ from pathlib import Path
4
+ from typing import Optional
5
+
6
+ from reflex import constants
7
+
8
+
9
+ def asset(relative_filename: str, subfolder: Optional[str] = None) -> str:
10
+ """Add an asset to the app.
11
+ Place the file next to your including python file.
12
+ Copies the file to the app's external assets directory.
13
+
14
+ Example:
15
+ ```python
16
+ rx.script(src=rx._x.asset("my_custom_javascript.js"))
17
+ rx.image(src=rx._x.asset("test_image.png","subfolder"))
18
+ ```
19
+
20
+ Args:
21
+ relative_filename: The relative filename of the asset.
22
+ subfolder: The directory to place the asset in.
23
+
24
+ Raises:
25
+ FileNotFoundError: If the file does not exist.
26
+
27
+ Returns:
28
+ The relative URL to the copied asset.
29
+ """
30
+ # Determine the file by which the asset is exposed.
31
+ calling_file = inspect.stack()[1].filename
32
+ module = inspect.getmodule(inspect.stack()[1][0])
33
+ assert module is not None
34
+ caller_module_path = module.__name__.replace(".", "/")
35
+
36
+ subfolder = f"{caller_module_path}/{subfolder}" if subfolder else caller_module_path
37
+
38
+ src_file = Path(calling_file).parent / relative_filename
39
+
40
+ assets = constants.Dirs.APP_ASSETS
41
+ external = constants.Dirs.EXTERNAL_APP_ASSETS
42
+
43
+ if not src_file.exists():
44
+ raise FileNotFoundError(f"File not found: {src_file}")
45
+
46
+ # Create the asset folder in the currently compiling app.
47
+ asset_folder = Path.cwd() / assets / external / subfolder
48
+ asset_folder.mkdir(parents=True, exist_ok=True)
49
+
50
+ dst_file = asset_folder / relative_filename
51
+
52
+ if not dst_file.exists():
53
+ dst_file.symlink_to(src_file)
54
+
55
+ asset_url = f"/{external}/{subfolder}/{relative_filename}"
56
+ return asset_url
@@ -2,7 +2,7 @@
2
2
 
3
3
  import dataclasses
4
4
  import sys
5
- from typing import Any, Callable, Optional, Type
5
+ from typing import Any, Callable, Optional, Type, Union
6
6
 
7
7
  from reflex import constants
8
8
  from reflex.event import EventChain, EventHandler, EventSpec, call_script
@@ -171,7 +171,9 @@ class ClientStateVar(Var):
171
171
  )
172
172
  )
173
173
 
174
- def retrieve(self, callback: EventHandler | Callable | None = None) -> EventSpec:
174
+ def retrieve(
175
+ self, callback: Union[EventHandler, Callable, None] = None
176
+ ) -> EventSpec:
175
177
  """Pass the value of the client state variable to a backend EventHandler.
176
178
 
177
179
  The event handler must `yield` or `return` the EventSpec to trigger the event.