@gradio/button 0.6.1 → 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 +24 -0
- package/Index.svelte +15 -3
- package/dist/Index.svelte +15 -3
- package/dist/Index.svelte.d.ts +13 -1
- package/dist/shared/Button.svelte +40 -17
- package/dist/shared/Button.svelte.d.ts +19 -41
- package/package.json +7 -7
- package/shared/Button.svelte +40 -17
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,29 @@
|
|
|
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
|
+
|
|
16
|
+
## 0.6.2
|
|
17
|
+
|
|
18
|
+
### Fixes
|
|
19
|
+
|
|
20
|
+
- [#12681](https://github.com/gradio-app/gradio/pull/12681) [`ba46c2d`](https://github.com/gradio-app/gradio/commit/ba46c2df1405c11e495304af8f91acfdf69d0b18) - Migrate Button to Svelte 5. Thanks @freddyaboulton!
|
|
21
|
+
|
|
22
|
+
### Dependency updates
|
|
23
|
+
|
|
24
|
+
- @gradio/utils@0.11.1
|
|
25
|
+
- @gradio/client@2.0.2
|
|
26
|
+
|
|
3
27
|
## 0.6.1
|
|
4
28
|
|
|
5
29
|
### Dependency updates
|
package/Index.svelte
CHANGED
|
@@ -7,9 +7,21 @@
|
|
|
7
7
|
import type { SharedProps } from "@gradio/utils";
|
|
8
8
|
|
|
9
9
|
import Button from "./shared/Button.svelte";
|
|
10
|
+
import type { FileData } from "client/js/src";
|
|
11
|
+
interface ButtonProps {
|
|
12
|
+
value: string | null;
|
|
13
|
+
variant: "primary" | "secondary" | "stop";
|
|
14
|
+
size: "sm" | "md" | "lg";
|
|
15
|
+
scale: number;
|
|
16
|
+
link: string | null;
|
|
17
|
+
icon: FileData | null;
|
|
18
|
+
link_target: "_self" | "_blank";
|
|
19
|
+
elem_id: string | null;
|
|
20
|
+
elem_classes?: string[];
|
|
21
|
+
}
|
|
10
22
|
|
|
11
|
-
let _props: { shared_props: SharedProps; props:
|
|
12
|
-
const gradio = new Gradio<never,
|
|
23
|
+
let _props: { shared_props: SharedProps; props: ButtonProps } = $props();
|
|
24
|
+
const gradio = new Gradio<never, ButtonProps>(_props);
|
|
13
25
|
|
|
14
26
|
function handle_click() {
|
|
15
27
|
gradio.dispatch("click");
|
|
@@ -29,7 +41,7 @@
|
|
|
29
41
|
visible={gradio.shared.visible}
|
|
30
42
|
disabled={!gradio.shared.interactive}
|
|
31
43
|
link_target={gradio.props.link_target}
|
|
32
|
-
|
|
44
|
+
onclick={handle_click}
|
|
33
45
|
>
|
|
34
46
|
{gradio.props.value ?? ""}
|
|
35
47
|
</Button>
|
package/dist/Index.svelte
CHANGED
|
@@ -7,9 +7,21 @@
|
|
|
7
7
|
import type { SharedProps } from "@gradio/utils";
|
|
8
8
|
|
|
9
9
|
import Button from "./shared/Button.svelte";
|
|
10
|
+
import type { FileData } from "client/js/src";
|
|
11
|
+
interface ButtonProps {
|
|
12
|
+
value: string | null;
|
|
13
|
+
variant: "primary" | "secondary" | "stop";
|
|
14
|
+
size: "sm" | "md" | "lg";
|
|
15
|
+
scale: number;
|
|
16
|
+
link: string | null;
|
|
17
|
+
icon: FileData | null;
|
|
18
|
+
link_target: "_self" | "_blank";
|
|
19
|
+
elem_id: string | null;
|
|
20
|
+
elem_classes?: string[];
|
|
21
|
+
}
|
|
10
22
|
|
|
11
|
-
let _props: { shared_props: SharedProps; props:
|
|
12
|
-
const gradio = new Gradio<never,
|
|
23
|
+
let _props: { shared_props: SharedProps; props: ButtonProps } = $props();
|
|
24
|
+
const gradio = new Gradio<never, ButtonProps>(_props);
|
|
13
25
|
|
|
14
26
|
function handle_click() {
|
|
15
27
|
gradio.dispatch("click");
|
|
@@ -29,7 +41,7 @@
|
|
|
29
41
|
visible={gradio.shared.visible}
|
|
30
42
|
disabled={!gradio.shared.interactive}
|
|
31
43
|
link_target={gradio.props.link_target}
|
|
32
|
-
|
|
44
|
+
onclick={handle_click}
|
|
33
45
|
>
|
|
34
46
|
{gradio.props.value ?? ""}
|
|
35
47
|
</Button>
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
export { default as BaseButton } from "./shared/Button.svelte";
|
|
2
2
|
import type { SharedProps } from "@gradio/utils";
|
|
3
|
+
import type { FileData } from "client/js/src";
|
|
4
|
+
interface ButtonProps {
|
|
5
|
+
value: string | null;
|
|
6
|
+
variant: "primary" | "secondary" | "stop";
|
|
7
|
+
size: "sm" | "md" | "lg";
|
|
8
|
+
scale: number;
|
|
9
|
+
link: string | null;
|
|
10
|
+
icon: FileData | null;
|
|
11
|
+
link_target: "_self" | "_blank";
|
|
12
|
+
elem_id: string | null;
|
|
13
|
+
elem_classes?: string[];
|
|
14
|
+
}
|
|
3
15
|
type $$ComponentProps = {
|
|
4
16
|
shared_props: SharedProps;
|
|
5
|
-
props:
|
|
17
|
+
props: ButtonProps;
|
|
6
18
|
};
|
|
7
19
|
declare const Index: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
20
|
type Index = ReturnType<typeof Index>;
|
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { type FileData } from "@gradio/client";
|
|
3
3
|
import { Image } from "@gradio/image/shared";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { type Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
elem_id,
|
|
8
|
+
elem_classes = [],
|
|
9
|
+
visible,
|
|
10
|
+
variant,
|
|
11
|
+
size,
|
|
12
|
+
value,
|
|
13
|
+
link,
|
|
14
|
+
link_target,
|
|
15
|
+
icon,
|
|
16
|
+
disabled,
|
|
17
|
+
scale,
|
|
18
|
+
min_width,
|
|
19
|
+
onclick = () => {},
|
|
20
|
+
children
|
|
21
|
+
}: {
|
|
22
|
+
elem_id: string | null;
|
|
23
|
+
elem_classes: string[] | null;
|
|
24
|
+
visible: boolean | "hidden";
|
|
25
|
+
variant: "primary" | "secondary" | "stop" | "huggingface";
|
|
26
|
+
size: "sm" | "md" | "lg";
|
|
27
|
+
value: string | null;
|
|
28
|
+
link: string | null;
|
|
29
|
+
link_target: "_self" | "_blank" | "_parent" | "_top";
|
|
30
|
+
icon: FileData | null;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
scale: number | null;
|
|
33
|
+
min_width: number | undefined;
|
|
34
|
+
onclick: () => void;
|
|
35
|
+
children?: Snippet;
|
|
36
|
+
} = $props();
|
|
18
37
|
</script>
|
|
19
38
|
|
|
20
39
|
{#if link && link.length > 0}
|
|
@@ -40,11 +59,13 @@
|
|
|
40
59
|
restProps={{ alt: `${value} icon`, class: "button-icon" }}
|
|
41
60
|
/>
|
|
42
61
|
{/if}
|
|
43
|
-
|
|
62
|
+
{#if children}
|
|
63
|
+
{@render children()}
|
|
64
|
+
{/if}
|
|
44
65
|
</a>
|
|
45
66
|
{:else}
|
|
46
67
|
<button
|
|
47
|
-
|
|
68
|
+
{onclick}
|
|
48
69
|
class:hidden={visible === false || visible === "hidden"}
|
|
49
70
|
class="{size} {variant} {elem_classes.join(' ')}"
|
|
50
71
|
style:flex-grow={scale}
|
|
@@ -62,7 +83,9 @@
|
|
|
62
83
|
src={icon.url}
|
|
63
84
|
/>
|
|
64
85
|
{/if}
|
|
65
|
-
|
|
86
|
+
{#if children}
|
|
87
|
+
{@render children()}
|
|
88
|
+
{/if}
|
|
66
89
|
</button>
|
|
67
90
|
{/if}
|
|
68
91
|
|
|
@@ -1,43 +1,21 @@
|
|
|
1
1
|
import { type FileData } from "@gradio/client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
elem_id?: string;
|
|
22
|
-
elem_classes?: string[];
|
|
23
|
-
visible?: boolean | "hidden";
|
|
24
|
-
variant?: "primary" | "secondary" | "stop" | "huggingface";
|
|
25
|
-
size?: "sm" | "md" | "lg";
|
|
26
|
-
value?: string | null;
|
|
27
|
-
link?: string | null;
|
|
28
|
-
link_target?: "_self" | "_blank" | "_parent" | "_top";
|
|
29
|
-
icon?: FileData | null;
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
scale?: number | null;
|
|
32
|
-
min_width?: number | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
default: {};
|
|
35
|
-
}>, {
|
|
36
|
-
click: PointerEvent;
|
|
37
|
-
} & {
|
|
38
|
-
[evt: string]: CustomEvent<any>;
|
|
39
|
-
}, {
|
|
40
|
-
default: {};
|
|
41
|
-
}, {}, string>;
|
|
42
|
-
type Button = InstanceType<typeof Button>;
|
|
2
|
+
import { type Snippet } from "svelte";
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
elem_id: string | null;
|
|
5
|
+
elem_classes: string[] | null;
|
|
6
|
+
visible: boolean | "hidden";
|
|
7
|
+
variant: "primary" | "secondary" | "stop" | "huggingface";
|
|
8
|
+
size: "sm" | "md" | "lg";
|
|
9
|
+
value: string | null;
|
|
10
|
+
link: string | null;
|
|
11
|
+
link_target: "_self" | "_blank" | "_parent" | "_top";
|
|
12
|
+
icon: FileData | null;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
scale: number | null;
|
|
15
|
+
min_width: number | undefined;
|
|
16
|
+
onclick: () => void;
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
};
|
|
19
|
+
declare const Button: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
20
|
+
type Button = ReturnType<typeof Button>;
|
|
43
21
|
export default Button;
|
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/client": "^2.0.
|
|
11
|
-
"@gradio/
|
|
12
|
-
"@gradio/upload": "^0.17.
|
|
13
|
-
"@gradio/
|
|
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",
|
package/shared/Button.svelte
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { type FileData } from "@gradio/client";
|
|
3
3
|
import { Image } from "@gradio/image/shared";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
import { type Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
elem_id,
|
|
8
|
+
elem_classes = [],
|
|
9
|
+
visible,
|
|
10
|
+
variant,
|
|
11
|
+
size,
|
|
12
|
+
value,
|
|
13
|
+
link,
|
|
14
|
+
link_target,
|
|
15
|
+
icon,
|
|
16
|
+
disabled,
|
|
17
|
+
scale,
|
|
18
|
+
min_width,
|
|
19
|
+
onclick = () => {},
|
|
20
|
+
children
|
|
21
|
+
}: {
|
|
22
|
+
elem_id: string | null;
|
|
23
|
+
elem_classes: string[] | null;
|
|
24
|
+
visible: boolean | "hidden";
|
|
25
|
+
variant: "primary" | "secondary" | "stop" | "huggingface";
|
|
26
|
+
size: "sm" | "md" | "lg";
|
|
27
|
+
value: string | null;
|
|
28
|
+
link: string | null;
|
|
29
|
+
link_target: "_self" | "_blank" | "_parent" | "_top";
|
|
30
|
+
icon: FileData | null;
|
|
31
|
+
disabled: boolean;
|
|
32
|
+
scale: number | null;
|
|
33
|
+
min_width: number | undefined;
|
|
34
|
+
onclick: () => void;
|
|
35
|
+
children?: Snippet;
|
|
36
|
+
} = $props();
|
|
18
37
|
</script>
|
|
19
38
|
|
|
20
39
|
{#if link && link.length > 0}
|
|
@@ -40,11 +59,13 @@
|
|
|
40
59
|
restProps={{ alt: `${value} icon`, class: "button-icon" }}
|
|
41
60
|
/>
|
|
42
61
|
{/if}
|
|
43
|
-
|
|
62
|
+
{#if children}
|
|
63
|
+
{@render children()}
|
|
64
|
+
{/if}
|
|
44
65
|
</a>
|
|
45
66
|
{:else}
|
|
46
67
|
<button
|
|
47
|
-
|
|
68
|
+
{onclick}
|
|
48
69
|
class:hidden={visible === false || visible === "hidden"}
|
|
49
70
|
class="{size} {variant} {elem_classes.join(' ')}"
|
|
50
71
|
style:flex-grow={scale}
|
|
@@ -62,7 +83,9 @@
|
|
|
62
83
|
src={icon.url}
|
|
63
84
|
/>
|
|
64
85
|
{/if}
|
|
65
|
-
|
|
86
|
+
{#if children}
|
|
87
|
+
{@render children()}
|
|
88
|
+
{/if}
|
|
66
89
|
</button>
|
|
67
90
|
{/if}
|
|
68
91
|
|