File size: 2,016 Bytes
2c609c4
 
 
4d31acf
2c609c4
 
 
4d31acf
2c609c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d31acf
 
 
 
 
 
 
 
2c609c4
1
2
3
4
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<script>
	export let top_panel = true;
	export let display_top_corner = false;
	export let show_background = true;
</script>

<div
	class={`icon-button-wrapper ${top_panel ? "top-panel" : ""} ${display_top_corner ? "display-top-corner" : "hide-top-corner"} ${!show_background ? "no-background" : ""}`}
>
	<slot></slot>
</div>

<style>
	.icon-button-wrapper {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		z-index: var(--layer-2);
		gap: var(--spacing-sm);
		box-shadow: var(--shadow-drop);
		border: 1px solid var(--border-color-primary);
		background: var(--block-background-fill);
		padding: var(--spacing-xxs);
	}

	.icon-button-wrapper.hide-top-corner {
		border-top: none;
		border-right: none;
		border-radius: var(--block-label-right-radius);
	}

	.icon-button-wrapper.display-top-corner {
		border-radius: var(--radius-sm) 0 0 var(--radius-sm);
		top: var(--spacing-sm);
		right: -1px;
	}

	.icon-button-wrapper:not(.top-panel) {
		border: 1px solid var(--border-color-primary);
		border-radius: var(--radius-sm);
	}

	.top-panel {
		position: absolute;
		top: var(--block-label-margin);
		right: var(--block-label-margin);
		margin: 0;
	}

	.icon-button-wrapper :global(button) {
		margin: var(--spacing-xxs);
		border-radius: var(--radius-xs);
		position: relative;
	}

	.icon-button-wrapper :global(a.download-link:not(:last-child)),
	.icon-button-wrapper :global(button:not(:last-child)) {
		margin-right: var(--spacing-xxs);
	}

	.icon-button-wrapper
		:global(a.download-link:not(:last-child):not(.no-border *)::after),
	.icon-button-wrapper
		:global(button:not(:last-child):not(.no-border *)::after) {
		content: "";
		position: absolute;
		right: -4.5px;
		top: 15%;
		height: 70%;
		width: 1px;
		background-color: var(--border-color-primary);
	}

	.icon-button-wrapper :global(> *) {
		height: 100%;
	}

	.icon-button-wrapper.no-background {
		box-shadow: none;
		border: none;
		background: none;
		padding: 0;
		z-index: var(--layer-1);
	}
</style>