@axium/client 0.13.0 → 0.13.1
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/README.md +6 -0
- package/assets/styles.css +22 -0
- package/lib/Upload.svelte +21 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
# Axium Client
|
|
2
|
+
|
|
3
|
+
Axium Client provides client-side functionality for Axium. This includes:
|
|
4
|
+
|
|
5
|
+
- UI components, which are currently used by the web UI
|
|
6
|
+
- The `axium-client`/`axc` CLI
|
|
7
|
+
- Some utility functions like `fetchAPI` that provide strongly-typed API interaction
|
package/assets/styles.css
CHANGED
|
@@ -139,6 +139,28 @@ dialog form {
|
|
|
139
139
|
display: contents;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
progress {
|
|
143
|
+
appearance: none;
|
|
144
|
+
border: none;
|
|
145
|
+
height: 0.5em;
|
|
146
|
+
border-radius: 1em;
|
|
147
|
+
overflow: hidden;
|
|
148
|
+
background-color: var(--bg-normal);
|
|
149
|
+
border: 1px solid var(--border-accent);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
progress::-webkit-progress-bar {
|
|
153
|
+
background-color: transparent;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
progress::-webkit-progress-value {
|
|
157
|
+
background-color: hsl(0 0 var(--fg-light));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
progress::-moz-progress-bar {
|
|
161
|
+
background-color: hsl(0 0 var(--fg-light));
|
|
162
|
+
}
|
|
163
|
+
|
|
142
164
|
:not(input).error {
|
|
143
165
|
padding: 1em;
|
|
144
166
|
border-radius: 0.5em;
|
package/lib/Upload.svelte
CHANGED
|
@@ -7,17 +7,23 @@
|
|
|
7
7
|
name = 'files',
|
|
8
8
|
input = $bindable(),
|
|
9
9
|
files = $bindable(),
|
|
10
|
+
progress = $bindable(),
|
|
10
11
|
...rest
|
|
11
|
-
}: HTMLInputAttributes & { input?: HTMLInputElement } = $props();
|
|
12
|
+
}: HTMLInputAttributes & { input?: HTMLInputElement; progress?: [current: number, max: number][] } = $props();
|
|
12
13
|
|
|
13
14
|
const id = $props.id();
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
<div>
|
|
17
18
|
<label for={id} class={[files?.length && 'file']}>
|
|
18
|
-
{#each files! as file}
|
|
19
|
+
{#each files! as file, i}
|
|
19
20
|
<Icon i={forMime(file.type)} />
|
|
20
|
-
<
|
|
21
|
+
<div class="name">
|
|
22
|
+
<span>{file.name}</span>
|
|
23
|
+
{#if progress?.[i]}
|
|
24
|
+
<progress value={progress[i][0]} max={progress[i][1]}></progress>
|
|
25
|
+
{/if}
|
|
26
|
+
</div>
|
|
21
27
|
<button
|
|
22
28
|
onclick={e => {
|
|
23
29
|
e.preventDefault();
|
|
@@ -53,6 +59,18 @@
|
|
|
53
59
|
width: 20em;
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
.name {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
min-width: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
progress {
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 4px;
|
|
72
|
+
}
|
|
73
|
+
|
|
56
74
|
label.file {
|
|
57
75
|
display: grid;
|
|
58
76
|
grid-template-columns: 2em 1fr 2em;
|