@gradio/downloadbutton 0.4.16 → 0.4.17
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/CHANGELOG.md +12 -0
- package/DownloadButton.stories.svelte +64 -60
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @gradio/downloadbutton
|
|
2
2
|
|
|
3
|
+
## 0.4.17
|
|
4
|
+
|
|
5
|
+
### Fixes
|
|
6
|
+
|
|
7
|
+
- [#12800](https://github.com/gradio-app/gradio/pull/12800) [`7a1c321`](https://github.com/gradio-app/gradio/commit/7a1c321b6546ba05a353488f5133e8262c4a8a39) - Bump svelte/kit for security reasons. Thanks @freddyaboulton!
|
|
8
|
+
|
|
9
|
+
### Dependency updates
|
|
10
|
+
|
|
11
|
+
- @gradio/button@0.6.3
|
|
12
|
+
- @gradio/utils@0.11.2
|
|
13
|
+
- @gradio/client@2.0.3
|
|
14
|
+
|
|
3
15
|
## 0.4.16
|
|
4
16
|
|
|
5
17
|
### Fixes
|
|
@@ -1,69 +1,75 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
3
|
import DownloadButton from "./Index.svelte";
|
|
4
|
-
|
|
4
|
+
import { wrapProps } from "../storybook/wrapProps";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: "Components/DownloadButton",
|
|
8
|
+
component: DownloadButton,
|
|
9
|
+
argTypes: {
|
|
10
|
+
label: {
|
|
11
|
+
control: "text",
|
|
12
|
+
description: "The text to display on the button",
|
|
13
|
+
name: "label",
|
|
14
|
+
value: "Gradio Button"
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
options: ["primary", "secondary", "stop"],
|
|
18
|
+
description: "The variant of the button",
|
|
19
|
+
control: { type: "select" },
|
|
20
|
+
defaultValue: "primary"
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
options: ["sm", "lg"],
|
|
24
|
+
description: "The size of the button",
|
|
25
|
+
control: { type: "select" },
|
|
26
|
+
defaultValue: "lg"
|
|
27
|
+
},
|
|
28
|
+
visible: {
|
|
29
|
+
options: [true, false],
|
|
30
|
+
description: "Sets the visibility of the button",
|
|
31
|
+
control: { type: "boolean" },
|
|
32
|
+
defaultValue: true
|
|
33
|
+
},
|
|
34
|
+
interactive: {
|
|
35
|
+
options: [true, false],
|
|
36
|
+
description: "If false, the button will be in a disabled state",
|
|
37
|
+
control: { type: "boolean" },
|
|
38
|
+
defaultValue: true
|
|
39
|
+
},
|
|
40
|
+
disabled: {
|
|
41
|
+
options: [true, false],
|
|
42
|
+
control: { type: "boolean" },
|
|
43
|
+
defaultValue: false
|
|
44
|
+
},
|
|
45
|
+
scale: {
|
|
46
|
+
options: [null, 0.5, 1, 2],
|
|
47
|
+
description: "relative size compared to adjacent Components.",
|
|
48
|
+
control: { type: "select" }
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
<DownloadButton value
|
|
56
|
-
|
|
54
|
+
{#snippet template(args)}
|
|
55
|
+
<DownloadButton {...wrapProps({ value: "", interactive: true, ...args })} />
|
|
56
|
+
{/snippet}
|
|
57
57
|
|
|
58
58
|
<Story
|
|
59
59
|
name="Primary"
|
|
60
60
|
args={{ label: "Download", variant: "primary", size: "lg", scale: 1 }}
|
|
61
|
+
{template}
|
|
61
62
|
/>
|
|
62
63
|
<Story
|
|
63
64
|
name="Secondary"
|
|
64
65
|
args={{ label: "Download", variant: "secondary", size: "lg" }}
|
|
66
|
+
{template}
|
|
67
|
+
/>
|
|
68
|
+
<Story
|
|
69
|
+
name="Stop"
|
|
70
|
+
args={{ label: "Download", variant: "stop", size: "lg" }}
|
|
71
|
+
{template}
|
|
65
72
|
/>
|
|
66
|
-
<Story name="Stop" args={{ label: "Download", variant: "stop", size: "lg" }} />
|
|
67
73
|
<Story
|
|
68
74
|
name="Button with external image icon"
|
|
69
75
|
args={{
|
|
@@ -73,17 +79,15 @@
|
|
|
73
79
|
url: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
|
|
74
80
|
}
|
|
75
81
|
}}
|
|
82
|
+
{template}
|
|
76
83
|
/>
|
|
77
84
|
<Story
|
|
78
85
|
name="Button with visible equal to false"
|
|
79
|
-
args={{
|
|
80
|
-
|
|
81
|
-
visible: false
|
|
82
|
-
}}
|
|
86
|
+
args={{ label: "Download", visible: false }}
|
|
87
|
+
{template}
|
|
83
88
|
/>
|
|
84
89
|
<Story
|
|
85
90
|
name="Button with null label (should be collapsed)"
|
|
86
|
-
args={{
|
|
87
|
-
|
|
88
|
-
}}
|
|
91
|
+
args={{ label: null }}
|
|
92
|
+
{template}
|
|
89
93
|
/>
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/downloadbutton",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
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/button": "^0.6.
|
|
11
|
-
"@gradio/client": "^2.0.
|
|
12
|
-
"@gradio/utils": "^0.11.
|
|
10
|
+
"@gradio/button": "^0.6.3",
|
|
11
|
+
"@gradio/client": "^2.0.3",
|
|
12
|
+
"@gradio/utils": "^0.11.2"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@gradio/preview": "^0.15.
|
|
15
|
+
"@gradio/preview": "^0.15.2"
|
|
16
16
|
},
|
|
17
17
|
"main": "./Index.svelte",
|
|
18
18
|
"main_changeset": true,
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"svelte": "^5.
|
|
28
|
+
"svelte": "^5.48.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|