@gradio/button 0.6.2 → 0.6.3
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 +81 -76
- package/CHANGELOG.md +13 -0
- package/package.json +7 -7
package/Button.stories.svelte
CHANGED
|
@@ -1,98 +1,103 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
3
|
-
import Button from "./
|
|
4
|
-
</script>
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from "@storybook/addon-svelte-csf";
|
|
3
|
+
import Button from "./shared/Button.svelte";
|
|
5
4
|
|
|
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
|
-
control: { type: "boolean" },
|
|
43
|
-
defaultValue: false
|
|
44
|
-
},
|
|
45
|
-
scale: {
|
|
46
|
-
options: [null, 0.5, 1, 2],
|
|
47
|
-
description:
|
|
48
|
-
"relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. Only applies in Rows, or top-level Components in Blocks where fill_height=True. ",
|
|
49
|
-
control: { type: "select" }
|
|
5
|
+
const { Story } = defineMeta({
|
|
6
|
+
title: "Components/Button",
|
|
7
|
+
component: Button,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
value: {
|
|
11
|
+
control: "text",
|
|
12
|
+
description: "The text to display on the button"
|
|
13
|
+
},
|
|
14
|
+
variant: {
|
|
15
|
+
options: ["primary", "secondary", "stop", "huggingface"],
|
|
16
|
+
description: "The variant of the button",
|
|
17
|
+
control: { type: "select" }
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
options: ["sm", "md", "lg"],
|
|
21
|
+
description: "The size of the button",
|
|
22
|
+
control: { type: "select" }
|
|
23
|
+
},
|
|
24
|
+
visible: {
|
|
25
|
+
description: "Sets the visibility of the button",
|
|
26
|
+
control: { type: "boolean" }
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
description: "If true, the button will be in a disabled state",
|
|
30
|
+
control: { type: "boolean" }
|
|
31
|
+
},
|
|
32
|
+
scale: {
|
|
33
|
+
options: [null, 0.5, 1, 2],
|
|
34
|
+
description: "Relative size compared to adjacent components",
|
|
35
|
+
control: { type: "select" }
|
|
36
|
+
},
|
|
37
|
+
link: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description: "URL to navigate to when clicked"
|
|
40
|
+
}
|
|
50
41
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
53
44
|
|
|
54
|
-
|
|
55
|
-
<Button
|
|
56
|
-
|
|
45
|
+
{#snippet template(args)}
|
|
46
|
+
<Button {...args}>{args.value}</Button>
|
|
47
|
+
{/snippet}
|
|
57
48
|
|
|
58
49
|
<Story
|
|
59
50
|
name="Primary"
|
|
60
|
-
args={{ variant: "primary", size: "lg",
|
|
51
|
+
args={{ variant: "primary", size: "lg", value: "Primary Button" }}
|
|
52
|
+
{template}
|
|
61
53
|
/>
|
|
62
54
|
<Story
|
|
63
55
|
name="Secondary"
|
|
64
|
-
args={{ variant: "secondary", size: "lg",
|
|
56
|
+
args={{ variant: "secondary", size: "lg", value: "Secondary Button" }}
|
|
57
|
+
{template}
|
|
65
58
|
/>
|
|
66
|
-
<Story name="Stop" args={{ variant: "stop", size: "lg", interactive: true }} />
|
|
67
59
|
<Story
|
|
68
|
-
name="
|
|
69
|
-
args={{
|
|
60
|
+
name="Stop"
|
|
61
|
+
args={{ variant: "stop", size: "lg", value: "Stop Button" }}
|
|
62
|
+
{template}
|
|
70
63
|
/>
|
|
71
64
|
<Story
|
|
72
|
-
name="
|
|
73
|
-
args={{
|
|
74
|
-
|
|
75
|
-
icon: {
|
|
76
|
-
url: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg",
|
|
77
|
-
path: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg"
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
65
|
+
name="Small"
|
|
66
|
+
args={{ variant: "primary", size: "sm", value: "Small Button" }}
|
|
67
|
+
{template}
|
|
80
68
|
/>
|
|
81
69
|
<Story
|
|
82
|
-
name="
|
|
70
|
+
name="Medium"
|
|
71
|
+
args={{ variant: "primary", size: "md", value: "Medium Button" }}
|
|
72
|
+
{template}
|
|
73
|
+
/>
|
|
74
|
+
<Story
|
|
75
|
+
name="Disabled"
|
|
83
76
|
args={{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
value: ""
|
|
77
|
+
variant: "primary",
|
|
78
|
+
size: "lg",
|
|
79
|
+
disabled: true,
|
|
80
|
+
value: "Disabled Button"
|
|
90
81
|
}}
|
|
82
|
+
{template}
|
|
91
83
|
/>
|
|
92
|
-
|
|
93
84
|
<Story
|
|
94
|
-
name="Button with
|
|
85
|
+
name="Button with link"
|
|
95
86
|
args={{
|
|
96
|
-
|
|
87
|
+
variant: "primary",
|
|
88
|
+
size: "lg",
|
|
89
|
+
link: "https://huggingface.co",
|
|
90
|
+
value: "Link Button"
|
|
97
91
|
}}
|
|
92
|
+
{template}
|
|
93
|
+
/>
|
|
94
|
+
<Story
|
|
95
|
+
name="Huggingface variant"
|
|
96
|
+
args={{ variant: "huggingface", size: "lg", value: "Huggingface Button" }}
|
|
97
|
+
{template}
|
|
98
|
+
/>
|
|
99
|
+
<Story
|
|
100
|
+
name="Hidden"
|
|
101
|
+
args={{ variant: "primary", visible: false, value: "Hidden Button" }}
|
|
102
|
+
{template}
|
|
98
103
|
/>
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @gradio/button
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
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/utils@0.11.2
|
|
12
|
+
- @gradio/upload@0.17.4
|
|
13
|
+
- @gradio/client@2.0.3
|
|
14
|
+
- @gradio/image@0.25.1
|
|
15
|
+
|
|
3
16
|
## 0.6.2
|
|
4
17
|
|
|
5
18
|
### Fixes
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/button",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
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/
|
|
11
|
-
"@gradio/image": "^0.25.
|
|
12
|
-
"@gradio/
|
|
13
|
-
"@gradio/utils": "^0.11.
|
|
10
|
+
"@gradio/client": "^2.0.3",
|
|
11
|
+
"@gradio/image": "^0.25.1",
|
|
12
|
+
"@gradio/upload": "^0.17.4",
|
|
13
|
+
"@gradio/utils": "^0.11.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@gradio/preview": "^0.15.
|
|
16
|
+
"@gradio/preview": "^0.15.2"
|
|
17
17
|
},
|
|
18
18
|
"main": "./Index.svelte",
|
|
19
19
|
"main_changeset": true,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"svelte": "^5.
|
|
29
|
+
"svelte": "^5.48.0"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|