@gradio/button 0.2.22 → 0.2.24
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.
- package/Button.stories.svelte +4 -1
- package/CHANGELOG.md +13 -0
- package/Index.svelte +3 -6
- package/package.json +3 -3
- package/shared/Button.svelte +4 -7
package/Button.stories.svelte
CHANGED
@@ -65,7 +65,10 @@
|
|
65
65
|
<Story
|
66
66
|
name="Button with external image icon"
|
67
67
|
args={{
|
68
|
-
icon:
|
68
|
+
icon: {
|
69
|
+
url: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg",
|
70
|
+
path: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
|
71
|
+
}
|
69
72
|
}}
|
70
73
|
/>
|
71
74
|
<Story
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# @gradio/button
|
2
2
|
|
3
|
+
## 0.2.24
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- Updated dependencies [[`8181695`](https://github.com/gradio-app/gradio/commit/8181695e70187e8bc2bf7518697098c8d1b9843d)]:
|
8
|
+
- @gradio/upload@0.7.6
|
9
|
+
|
10
|
+
## 0.2.23
|
11
|
+
|
12
|
+
### Features
|
13
|
+
|
14
|
+
- [#7528](https://github.com/gradio-app/gradio/pull/7528) [`eda33b3`](https://github.com/gradio-app/gradio/commit/eda33b3763897a542acf298e523fa493dc655aee) - Refactors `get_fetchable_url_or_file()` to remove it from the frontend. Thanks [@abidlabs](https://github.com/abidlabs)!
|
15
|
+
|
3
16
|
## 0.2.22
|
4
17
|
|
5
18
|
### Patch Changes
|
package/Index.svelte
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
</script>
|
4
4
|
|
5
5
|
<script lang="ts">
|
6
|
-
import type { Gradio
|
6
|
+
import type { Gradio } from "@gradio/utils";
|
7
|
+
import { type FileData } from "@gradio/client";
|
7
8
|
|
8
9
|
import Button from "./shared/Button.svelte";
|
9
10
|
|
@@ -15,14 +16,12 @@
|
|
15
16
|
export let interactive: boolean;
|
16
17
|
export let size: "sm" | "lg" = "lg";
|
17
18
|
export let scale: number | null = null;
|
18
|
-
export let icon:
|
19
|
+
export let icon: FileData | null = null;
|
19
20
|
export let link: string | null = null;
|
20
21
|
export let min_width: number | undefined = undefined;
|
21
22
|
export let gradio: Gradio<{
|
22
23
|
click: never;
|
23
24
|
}>;
|
24
|
-
export let root = "";
|
25
|
-
export let proxy_url: null | string = null;
|
26
25
|
</script>
|
27
26
|
|
28
27
|
<Button
|
@@ -36,8 +35,6 @@
|
|
36
35
|
{icon}
|
37
36
|
{min_width}
|
38
37
|
{visible}
|
39
|
-
{root}
|
40
|
-
{proxy_url}
|
41
38
|
disabled={!interactive}
|
42
39
|
on:click={() => gradio.dispatch("click")}
|
43
40
|
>
|
package/package.json
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/button",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.24",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"author": "",
|
7
7
|
"license": "ISC",
|
8
8
|
"private": false,
|
9
9
|
"dependencies": {
|
10
|
-
"@gradio/
|
10
|
+
"@gradio/upload": "^0.7.6",
|
11
11
|
"@gradio/utils": "^0.3.0",
|
12
|
-
"@gradio/
|
12
|
+
"@gradio/client": "^0.12.2"
|
13
13
|
},
|
14
14
|
"main": "./Index.svelte",
|
15
15
|
"main_changeset": true,
|
package/shared/Button.svelte
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts">
|
2
|
-
import {
|
2
|
+
import { type FileData } from "@gradio/client";
|
3
3
|
|
4
4
|
export let elem_id = "";
|
5
5
|
export let elem_classes: string[] = [];
|
@@ -8,13 +8,10 @@
|
|
8
8
|
export let size: "sm" | "lg" = "lg";
|
9
9
|
export let value: string | null = null;
|
10
10
|
export let link: string | null = null;
|
11
|
-
export let icon:
|
11
|
+
export let icon: FileData | null = null;
|
12
12
|
export let disabled = false;
|
13
13
|
export let scale: number | null = null;
|
14
14
|
export let min_width: number | undefined = undefined;
|
15
|
-
export let root = "";
|
16
|
-
export let proxy_url: string | null = null;
|
17
|
-
$: icon_path = get_fetchable_url_or_file(icon, root, proxy_url);
|
18
15
|
</script>
|
19
16
|
|
20
17
|
{#if link && link.length > 0}
|
@@ -34,7 +31,7 @@
|
|
34
31
|
id={elem_id}
|
35
32
|
>
|
36
33
|
{#if icon}
|
37
|
-
<img class="button-icon" src={
|
34
|
+
<img class="button-icon" src={icon.url} alt={`${value} icon`} />
|
38
35
|
{/if}
|
39
36
|
<slot />
|
40
37
|
</a>
|
@@ -52,7 +49,7 @@
|
|
52
49
|
{disabled}
|
53
50
|
>
|
54
51
|
{#if icon}
|
55
|
-
<img class="button-icon" src={
|
52
|
+
<img class="button-icon" src={icon.url} alt={`${value} icon`} />
|
56
53
|
{/if}
|
57
54
|
<slot />
|
58
55
|
</button>
|