-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
533 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Alert | ||
|
||
Display warning messages that require attention. See [Ant Design](https://ant.design/components/alert/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Alert | ||
|
||
Display warning messages that require attention. See [Ant Design](https://ant.design/components/alert/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
data = [{ | ||
"message": "Success Text", | ||
"description": | ||
"Success Description Success Description Success Description Success Description", | ||
"type": "success" | ||
}, { | ||
"message": "Info Text", | ||
"description": | ||
"Info Description Info Description Info Description Info Description", | ||
"type": "info" | ||
}, { | ||
"message": "Warning Text", | ||
"description": | ||
"Warning Description Warning Description Warning Description Warning Description", | ||
"type": "warning" | ||
}, { | ||
"message": "Error Text", | ||
"description": | ||
"Error Description Error Description Error Description Error Description", | ||
"type": "error" | ||
}] | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
with antd.Space(direction="vertical"): | ||
for item in data: | ||
antd.Alert(message=item["message"], | ||
description=item["description"], | ||
type=item["type"], | ||
closable=True, | ||
show_icon=True) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tabs | ||
|
||
Tabs make it easy to explore and switch between different views. See [Ant Design](https://ant.design/components/tabs/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="position" title="Position"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tabs | ||
|
||
Tabs make it easy to explore and switch between different views. See [Ant Design](https://ant.design/components/tabs/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="position" title="Position"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
with antd.Tabs(default_active_key='1'): | ||
with antd.Tabs.Item(key="1", label="Tab1"): | ||
ms.Text("Tab 1") | ||
with antd.Tabs.Item(key="2", label="Tab2", disabled=True): | ||
ms.Text("Tab 2") | ||
with antd.Tabs.Item(key="3", label="Tab3"): | ||
ms.Text("Tab 3") | ||
with ms.Slot("icon"): | ||
antd.Icon("AndroidOutlined") | ||
antd.Divider("Extra content") | ||
with antd.Tabs(default_active_key='1'): | ||
with ms.Slot("tabBarExtraContent.left"): | ||
antd.Button("Left Extra Action") | ||
with ms.Slot("tabBarExtraContent.right"): | ||
antd.Button("Right Extra Action") | ||
with antd.Tabs.Item(key="1", label="Tab1"): | ||
ms.Text("Tab 1") | ||
with antd.Tabs.Item(key="2", label="Tab2"): | ||
ms.Text("Tab 2") | ||
with antd.Tabs.Item(key="3", label="Tab3"): | ||
ms.Text("Tab 3") | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import gradio as gr | ||
|
||
import modelscope_studio.components.antd as antd | ||
import modelscope_studio.components.base as ms | ||
|
||
default_position = "top" | ||
|
||
with gr.Blocks() as demo: | ||
with ms.Application(): | ||
with antd.ConfigProvider(): | ||
with antd.Space(): | ||
ms.Text("Tab position") | ||
position = antd.Radio.Group( | ||
value=default_position, | ||
option_type="button", | ||
options=["top", "left", "right", "bottom"]) | ||
with antd.Tabs(default_active_key='1') as tabs: | ||
with antd.Tabs.Item(key="1", label="Tab1"): | ||
ms.Text("Tab 1") | ||
with antd.Tabs.Item(key="2", label="Tab2"): | ||
ms.Text("Tab 2") | ||
with antd.Tabs.Item(key="3", label="Tab3"): | ||
ms.Text("Tab 3") | ||
position.change(fn=lambda x: gr.update(tab_position=x), | ||
inputs=[position], | ||
outputs=[tabs]) | ||
|
||
if __name__ == "__main__": | ||
demo.queue().launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tag | ||
|
||
Used for marking and categorization. See [Ant Design](https://ant.design/components/tag/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="checkable_tag" title="Checkable Tag"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tag | ||
|
||
Used for marking and categorization. See [Ant Design](https://ant.design/components/tag/) for more information. | ||
|
||
## Examples | ||
|
||
<demo name="basic"></demo> | ||
<demo name="checkable_tag" title="Checkable Tag"></demo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from helper.Docs import Docs | ||
|
||
docs = Docs(__file__) | ||
|
||
if __name__ == "__main__": | ||
docs.render().queue().launch() |
Oops, something went wrong.