浏览代码

fix, lint

Brandon Hsiao 1 年之前
父节点
当前提交
481c9d9dbd
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 6 1
      reflex/components/radix/primitives/progress.py
  2. 1 1
      reflex/components/radix/primitives/progress.pyi

+ 6 - 1
reflex/components/radix/primitives/progress.py

@@ -82,13 +82,18 @@ class Progress(SimpleNamespace):
         """High level API for progress bar.
 
         Args:
+            width: The width of the progerss bar
             **props: The props of the progress bar
 
         Returns:
             The progress bar.
         """
+
+        style = props.setdefault("style", {})
+        style.update({"width": width})
+
         return ProgressRoot.create(
-            ProgressIndicator.create(width=width, value=props.get("value")),
+            ProgressIndicator.create(value=props.get("value")),
             **props,
         )
 

+ 1 - 1
reflex/components/radix/primitives/progress.pyi

@@ -275,6 +275,6 @@ class Progress(SimpleNamespace):
     indicator = staticmethod(ProgressIndicator.create)
 
     @staticmethod
-    def __call__(**props) -> Component: ...
+    def __call__(width: Optional[str] = "100%", **props) -> Component: ...
 
 progress = Progress()