mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
fe057300f0
* delegate gradio events via a custom event dispatcher * improve md perf + share code * fix df markdown * prevent model3d from rerending too frequently * tweaks * fix more event bugs with video * add changeset * optimise handle mount * does this do anything * fix * remove old dispatches * fix dropdown position * oops * fixes * fix tests * fix types * format * fix markdown code * add changeset * fix typecheck * fix typecheck * fix demos * notebooks * fix tests * changer * maybe this * fixes * add changeset * fix chatbot alignment mobile * fix chantbot * add changeset * changeset * changeset * storybook --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
40 lines
926 B
Svelte
40 lines
926 B
Svelte
<script>
|
|
import { Meta, Template, Story } from "@storybook/addon-svelte-csf";
|
|
import HighlightedText from "./static";
|
|
import { Gradio } from "../app/src/gradio_helper";
|
|
</script>
|
|
|
|
<Meta title="Components/HighlightedText" component={HighlightedText} />
|
|
|
|
<Template let:args>
|
|
<HighlightedText
|
|
value={[
|
|
["zebras", "+"],
|
|
["dogs", "-"],
|
|
["elephants", "+"]
|
|
]}
|
|
gradio={new Gradio(
|
|
0,
|
|
document.body,
|
|
"light",
|
|
"1.1.1",
|
|
"http://localhost:7860"
|
|
)}
|
|
{...args}
|
|
/>
|
|
</Template>
|
|
|
|
<Story name="Highlighted Text" />
|
|
<Story name="Highlighted Text with legend" args={{ show_legend: true }} />
|
|
<Story name="Highlighted Text with label" args={{ label: "animals" }} />
|
|
<Story
|
|
name="Highlighted Text with new lines"
|
|
args={{
|
|
value: [["zebras", "+"], ["\n"], ["dogs", "-"], ["\n"], ["elephants", "+"]]
|
|
}}
|
|
/>
|
|
<Story
|
|
name="Highlighted Text with color map"
|
|
args={{ color_map: { "+": "green", "-": "red" } }}
|
|
/>
|