mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
eda33b3763
* fetch * add changeset * add changeset * simplify * add changeset * changes * format * add changeset * changes * format * fixes * lint * fix components * fixes * typing * format frontend * path * fixes * fix stories * lint * lint --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
43 lines
1010 B
Svelte
43 lines
1010 B
Svelte
<script context="module" lang="ts">
|
|
export { default as BaseButton } from "./shared/Button.svelte";
|
|
</script>
|
|
|
|
<script lang="ts">
|
|
import type { Gradio } from "@gradio/utils";
|
|
import { type FileData } from "@gradio/client";
|
|
|
|
import Button from "./shared/Button.svelte";
|
|
|
|
export let elem_id = "";
|
|
export let elem_classes: string[] = [];
|
|
export let visible = true;
|
|
export let value: string | null;
|
|
export let variant: "primary" | "secondary" | "stop" = "secondary";
|
|
export let interactive: boolean;
|
|
export let size: "sm" | "lg" = "lg";
|
|
export let scale: number | null = null;
|
|
export let icon: FileData | null = null;
|
|
export let link: string | null = null;
|
|
export let min_width: number | undefined = undefined;
|
|
export let gradio: Gradio<{
|
|
click: never;
|
|
}>;
|
|
</script>
|
|
|
|
<Button
|
|
{value}
|
|
{variant}
|
|
{elem_id}
|
|
{elem_classes}
|
|
{size}
|
|
{scale}
|
|
{link}
|
|
{icon}
|
|
{min_width}
|
|
{visible}
|
|
disabled={!interactive}
|
|
on:click={() => gradio.dispatch("click")}
|
|
>
|
|
{value ? gradio.i18n(value) : ""}
|
|
</Button>
|