@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 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 { Meta, Template, Story } from "@storybook/addon-svelte-csf";
1
+ <script module>
2
+ import { defineMeta } from "@storybook/addon-svelte-csf";
3
3
  import DownloadButton from "./Index.svelte";
4
- </script>
4
+ import { wrapProps } from "../storybook/wrapProps";
5
5
 
6
- <Meta
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:
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" }
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
- <Template let:args>
55
- <DownloadButton value="" interactive="true" {...args} />
56
- </Template>
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
- label: "Download",
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
- label: null
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.16",
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.2",
11
- "@gradio/client": "^2.0.2",
12
- "@gradio/utils": "^0.11.1"
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.1"
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.43.4"
28
+ "svelte": "^5.48.0"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",