@axel669/zephyr 0.4.7 → 0.5.4
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/package.json +12 -10
- package/readme.md +8 -1
- package/src/async/button.svelte +17 -13
- package/src/async/suspend.svelte +38 -0
- package/src/changed.js +10 -0
- package/src/composed/data-table/th.svelte +2 -2
- package/src/composed/data-table.svelte +154 -180
- package/src/composed/entry-button.svelte +13 -16
- package/src/control/button.svelte +26 -22
- package/src/control/input.svelte +52 -50
- package/src/control/label.svelte +28 -24
- package/src/control/link.svelte +36 -30
- package/src/control/radio-group.svelte +13 -10
- package/src/control/select.svelte +21 -16
- package/src/control/tabs.svelte +18 -14
- package/src/control/toggle.svelte +33 -22
- package/src/custom-macros.js +9 -0
- package/src/data-display/avatar.svelte +12 -11
- package/src/data-display/badge.svelte +9 -7
- package/src/data-display/chip.svelte +27 -17
- package/src/data-display/details.svelte +22 -14
- package/src/data-display/popover.svelte +12 -9
- package/src/data-display/progress.svelte +17 -13
- package/src/data-display/table.svelte +29 -17
- package/src/data-display/tooltip.svelte +11 -9
- package/src/dialogs/alert.svelte +18 -12
- package/src/dialogs/confirm.svelte +22 -16
- package/src/{hash.js → hash.svelte.js} +9 -0
- package/src/{index.mjs → index.js} +10 -10
- package/src/{composed/element-toast.svelte → info/element-toaster.svelte} +41 -27
- package/src/info/icon.svelte +4 -4
- package/src/info/titlebar.svelte +20 -14
- package/src/info/toast.svelte +35 -0
- package/src/info/toaster/message.svelte +42 -0
- package/src/info/toaster.svelte +64 -6
- package/src/layout/dialog.svelte +10 -12
- package/src/layout/drawer.svelte +45 -18
- package/src/layout/flex.svelte +13 -11
- package/src/layout/grid.svelte +17 -15
- package/src/layout/modal.svelte +34 -26
- package/src/layout/paper.svelte +31 -33
- package/src/layout/screen.svelte +13 -9
- package/src/props.js +24 -0
- package/src/routing/route.svelte +29 -16
- package/src/routing/{routing.js → routing.svelte.js} +10 -1
- package/src/routing/title.svelte +8 -6
- package/src/spinner/circle-spinner.svelte +10 -8
- package/src/spinner/hexagon-spinner.svelte +10 -8
- package/src/text.svelte +6 -10
- package/src/wind.js +4 -0
- package/src/{wsx.mjs → wsx.js} +1 -1
- package/src/async/load-zone.svelte +0 -22
- package/src/composed/toast/message.svelte +0 -33
- package/src/composed/toast.svelte +0 -70
- package/src/info/notification.svelte +0 -28
- package/src/inline-dialog.svelte +0 -23
- /package/src/{handler$.mjs → handler$.js} +0 -0
- /package/src/{variant.mjs → variant.js} +0 -0
package/src/control/input.svelte
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx, { none } from "../wsx.
|
|
5
|
-
import variant from "../variant.
|
|
2
|
+
import wsx, { none } from "../wsx.js"
|
|
3
|
+
import variant from "../variant.js"
|
|
4
|
+
import { splitProps } from "../props.js"
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
type = "text",
|
|
8
|
+
|
|
9
|
+
flat = false,
|
|
10
|
+
lined = false,
|
|
11
|
+
linedFill = false,
|
|
12
|
+
outline = false,
|
|
13
|
+
label,
|
|
14
|
+
color = "@default",
|
|
15
|
+
disabled,
|
|
6
16
|
|
|
7
|
-
|
|
17
|
+
value = $bindable(""),
|
|
18
|
+
autocompleteOptions = null,
|
|
8
19
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export let outline = false
|
|
13
|
-
export let label
|
|
14
|
-
export let color = "@default"
|
|
15
|
-
export let disabled
|
|
20
|
+
start,
|
|
21
|
+
end,
|
|
22
|
+
extra,
|
|
16
23
|
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
oninput,
|
|
25
|
+
...rest
|
|
26
|
+
} = $props()
|
|
19
27
|
|
|
20
|
-
let input = null
|
|
28
|
+
let input = $state(null)
|
|
21
29
|
export const focus = () => input.focus()
|
|
22
30
|
|
|
23
31
|
const id =
|
|
@@ -25,37 +33,33 @@
|
|
|
25
33
|
? null
|
|
26
34
|
: `${Math.random().toString(16)}_${Date.now()}`
|
|
27
35
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
$: restKeys = Object.keys($$restProps)
|
|
31
|
-
$: props = restKeys.reduce(
|
|
32
|
-
(props, key) => {
|
|
33
|
-
const [target, name] =
|
|
34
|
-
(key.startsWith("i-") === true)
|
|
35
|
-
? [props.input, key.slice(2)]
|
|
36
|
-
: [props.wind, key]
|
|
37
|
-
target[name] = $$restProps[key]
|
|
38
|
-
return props
|
|
39
|
-
},
|
|
40
|
-
{wind: {}, input: {}}
|
|
41
|
-
)
|
|
36
|
+
const prop = splitProps(rest, "i!")
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
const variantStyle = $derived(
|
|
39
|
+
variant(
|
|
40
|
+
none,
|
|
41
|
+
{ outline },
|
|
42
|
+
{ linedFill },
|
|
43
|
+
{ lined },
|
|
44
|
+
{ flat }
|
|
45
|
+
)
|
|
49
46
|
)
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
const wind = $derived({
|
|
52
49
|
[variantStyle]: true,
|
|
53
50
|
"@@control": true,
|
|
54
51
|
"$color": color,
|
|
55
|
-
...
|
|
56
|
-
}
|
|
52
|
+
...prop.rest,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const tag = $derived(
|
|
56
|
+
(type === "area") ? "textarea" : "input"
|
|
57
|
+
)
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
const update = (evt) => {
|
|
60
|
+
value = evt.target.value
|
|
61
|
+
oninput?.(evt)
|
|
62
|
+
}
|
|
59
63
|
</script>
|
|
60
64
|
|
|
61
65
|
<label use:wsx={wind}>
|
|
@@ -64,37 +68,35 @@
|
|
|
64
68
|
{/if}
|
|
65
69
|
<svelte:element
|
|
66
70
|
this={tag}
|
|
67
|
-
{...
|
|
71
|
+
{...prop.input}
|
|
68
72
|
{disabled}
|
|
69
73
|
{type}
|
|
70
74
|
{value}
|
|
75
|
+
oninput={update}
|
|
71
76
|
list={id}
|
|
72
|
-
on:focus
|
|
73
|
-
on:blur
|
|
74
|
-
on:input={update}
|
|
75
77
|
bind:this={input}
|
|
76
78
|
/>
|
|
77
79
|
|
|
78
|
-
{#if
|
|
80
|
+
{#if start}
|
|
79
81
|
<span use:wsx={{ "$start": true }}>
|
|
80
|
-
|
|
82
|
+
{@render start()}
|
|
81
83
|
</span>
|
|
82
84
|
{/if}
|
|
83
|
-
{#if
|
|
85
|
+
{#if end}
|
|
84
86
|
<span use:wsx={{ "$end": true }}>
|
|
85
|
-
|
|
87
|
+
{@render end()}
|
|
86
88
|
</span>
|
|
87
89
|
{/if}
|
|
88
|
-
{#if
|
|
90
|
+
{#if extra}
|
|
89
91
|
<span use:wsx={{ "$extra": true }}>
|
|
90
|
-
|
|
92
|
+
{@render extra()}
|
|
91
93
|
</span>
|
|
92
94
|
{/if}
|
|
93
95
|
|
|
94
96
|
{#if autocompleteOptions !== null}
|
|
95
97
|
<datalist {id}>
|
|
96
98
|
{#each autocompleteOptions as value}
|
|
97
|
-
<option {value}
|
|
99
|
+
<option {value}>{value}</option>
|
|
98
100
|
{/each}
|
|
99
101
|
</datalist>
|
|
100
102
|
{/if}
|
package/src/control/label.svelte
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import variant from "../variant.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import variant from "../variant.js"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const {
|
|
6
|
+
color = false,
|
|
7
|
+
compact = false,
|
|
8
|
+
ground = false,
|
|
9
|
+
disabled,
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
button = false,
|
|
12
|
+
fill = false,
|
|
13
|
+
outline = false,
|
|
14
|
+
flat = false,
|
|
15
|
+
for:_for = "",
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
} = $props()
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const type = $derived(
|
|
22
|
+
variant(
|
|
23
|
+
"$flat",
|
|
24
|
+
{ fill },
|
|
25
|
+
{ outline },
|
|
26
|
+
{ flat }
|
|
27
|
+
)
|
|
25
28
|
)
|
|
26
|
-
|
|
29
|
+
const baseStyles = $derived(
|
|
27
30
|
(button === true)
|
|
28
31
|
? {
|
|
29
32
|
"@@button": true,
|
|
@@ -33,13 +36,14 @@
|
|
|
33
36
|
$ground: ground,
|
|
34
37
|
}
|
|
35
38
|
: {}
|
|
39
|
+
)
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
const wind = $derived({
|
|
38
42
|
...baseStyles,
|
|
39
|
-
|
|
40
|
-
}
|
|
43
|
+
...rest
|
|
44
|
+
})
|
|
41
45
|
</script>
|
|
42
46
|
|
|
43
47
|
<label use:wsx={wind} {disabled} for={_for}>
|
|
44
|
-
|
|
48
|
+
{@render children?.()}
|
|
45
49
|
</label>
|
package/src/control/link.svelte
CHANGED
|
@@ -1,41 +1,47 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import variant from "../variant.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import variant from "../variant.js"
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
button = false,
|
|
7
|
+
color = false,
|
|
8
|
+
compact = false,
|
|
9
|
+
ground = false,
|
|
10
|
+
|
|
11
|
+
href = "",
|
|
12
|
+
rel = "noreferrer",
|
|
13
|
+
target = null,
|
|
14
|
+
|
|
15
|
+
fill = false,
|
|
16
|
+
outline = false,
|
|
17
|
+
flat = false,
|
|
18
|
+
|
|
19
|
+
disabled = null,
|
|
20
|
+
|
|
21
|
+
onclick,
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
} = $props()
|
|
25
|
+
|
|
26
|
+
const type = $derived(
|
|
27
|
+
variant(
|
|
28
|
+
"$flat",
|
|
29
|
+
{ fill },
|
|
30
|
+
{ outline },
|
|
31
|
+
{ flat }
|
|
32
|
+
)
|
|
27
33
|
)
|
|
28
34
|
|
|
29
|
-
|
|
35
|
+
const wind = $derived({
|
|
30
36
|
"@@button": button,
|
|
31
37
|
[type]: true,
|
|
32
38
|
"$color": color,
|
|
33
39
|
$compact: compact,
|
|
34
40
|
$ground: ground,
|
|
35
|
-
|
|
36
|
-
}
|
|
41
|
+
...rest
|
|
42
|
+
})
|
|
37
43
|
</script>
|
|
38
44
|
|
|
39
|
-
<a {href} {target} {rel} disabled={disabled || null} use:wsx={wind}
|
|
40
|
-
|
|
45
|
+
<a {href} {target} {rel} disabled={disabled || null} use:wsx={wind} {onclick}>
|
|
46
|
+
{@render children?.()}
|
|
41
47
|
</a>
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import { handler$ } from "../handler$.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import { handler$ } from "../handler$.js"
|
|
6
4
|
|
|
7
5
|
import Flex from "../layout/flex.svelte"
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
let {
|
|
8
|
+
layout = Flex,
|
|
9
|
+
options = [],
|
|
10
|
+
value = $bindable(),
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
13
|
+
|
|
14
|
+
const Layout = $derived(layout)
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
|
-
<
|
|
15
|
-
{#each options as {value: itemValue, label, disabled, ...wind}, index (
|
|
17
|
+
<Layout {...rest}>
|
|
18
|
+
{#each options as {value: itemValue, label, disabled, ...wind}, index (itemValue)}
|
|
16
19
|
<label use:wsx={{"@@toggle": true, ...wind}} {disabled}>
|
|
17
20
|
<span>{label}</span>
|
|
18
21
|
<input type="radio" value={itemValue} bind:group={value} />
|
|
19
22
|
</label>
|
|
20
23
|
{/each}
|
|
21
|
-
</
|
|
24
|
+
</Layout>
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
1
|
+
<script module>
|
|
4
2
|
const groupOptions = (options) => options.reduce(
|
|
5
3
|
({grouped, target = grouped}, item, pos) => {
|
|
6
4
|
const opt = { ... item, pos }
|
|
@@ -17,34 +15,41 @@
|
|
|
17
15
|
</script>
|
|
18
16
|
|
|
19
17
|
<script>
|
|
20
|
-
import wsx from "../wsx.
|
|
18
|
+
import wsx from "../wsx.js"
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
let {
|
|
21
|
+
disabled = false,
|
|
22
|
+
color = "@default",
|
|
23
|
+
flat = false,
|
|
24
|
+
label = null,
|
|
25
|
+
options = [],
|
|
26
|
+
value = $bindable(),
|
|
27
|
+
...rest
|
|
28
|
+
} = $props()
|
|
28
29
|
|
|
29
30
|
const update = (evt) => value = options[evt.target.value].value
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
const indexValue = $derived(
|
|
33
|
+
options.findIndex(item => item.value === value)
|
|
34
|
+
)
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
const grouped = $derived(
|
|
37
|
+
groupOptions(options)
|
|
38
|
+
)
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
const wind = $derived({
|
|
36
41
|
"@@control": true,
|
|
37
42
|
"$flat": flat,
|
|
38
43
|
"$color": color,
|
|
39
|
-
|
|
40
|
-
}
|
|
44
|
+
...rest,
|
|
45
|
+
})
|
|
41
46
|
</script>
|
|
42
47
|
|
|
43
48
|
<label use:wsx={wind}>
|
|
44
49
|
{#if label}
|
|
45
50
|
<span ws-x="[$label]">{label}</span>
|
|
46
51
|
{/if}
|
|
47
|
-
<select value={indexValue}
|
|
52
|
+
<select value={indexValue} oninput={update} {disabled}>
|
|
48
53
|
{#each grouped as item, index}
|
|
49
54
|
{#if Array.isArray(item) === false}
|
|
50
55
|
<option value={item.pos}>
|
package/src/control/tabs.svelte
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
2
|
import { writable } from "svelte/store"
|
|
5
3
|
|
|
6
|
-
import wsx from "../wsx.
|
|
7
|
-
import { handler$ } from "../handler$.
|
|
4
|
+
import wsx from "../wsx.js"
|
|
5
|
+
import { handler$ } from "../handler$.js"
|
|
6
|
+
import { splitProps } from "../props.js"
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
let {
|
|
9
|
+
color = "@default",
|
|
10
|
+
fill = false,
|
|
11
|
+
options = [],
|
|
12
|
+
value = $bindable(),
|
|
13
|
+
vertical = false,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
const props = $derived(
|
|
18
|
+
splitProps(rest, "t!")
|
|
19
|
+
)
|
|
20
|
+
const wind = $derived({
|
|
16
21
|
"$fill": fill,
|
|
17
22
|
"$color": color,
|
|
18
23
|
$vert: vertical,
|
|
19
|
-
|
|
20
|
-
}
|
|
24
|
+
...props.rest,
|
|
25
|
+
})
|
|
21
26
|
</script>
|
|
22
27
|
|
|
23
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
24
28
|
<ws-tabs use:wsx={wind} role="tablist">
|
|
25
29
|
{#each options as tab, i}
|
|
26
30
|
<label>
|
|
27
31
|
<input type="radio" value={tab.value} bind:group={value} />
|
|
28
|
-
<ws-tab>{tab.label}</ws-tab>
|
|
32
|
+
<ws-tab use:wsx={props["t!"]}>{tab.label}</ws-tab>
|
|
29
33
|
</label>
|
|
30
34
|
{/each}
|
|
31
35
|
</ws-tabs>
|
|
@@ -1,49 +1,60 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
let {
|
|
5
|
+
color = "@default",
|
|
6
|
+
checkbox = false,
|
|
7
|
+
checked = $bindable(),
|
|
8
|
+
flat = false,
|
|
9
|
+
group = $bindable(),
|
|
10
|
+
label = "",
|
|
11
|
+
reverse = false,
|
|
12
|
+
value,
|
|
13
|
+
children,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
const container = $derived({
|
|
16
18
|
"@@toggle": true,
|
|
17
19
|
"$flat": flat,
|
|
18
20
|
"$color": color,
|
|
19
21
|
"fl.dir": reverse ? "row-reverse" : false,
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
22
|
+
...rest,
|
|
23
|
+
})
|
|
24
|
+
const input = $derived({
|
|
23
25
|
"@@switch": checkbox === false
|
|
24
|
-
}
|
|
26
|
+
})
|
|
25
27
|
|
|
26
28
|
const updateGroup = (checked) => {
|
|
29
|
+
if (Array.isArray(group) === false) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
27
32
|
if (checked === true) {
|
|
28
33
|
if (group.includes(value) === true) {
|
|
29
34
|
return
|
|
30
35
|
}
|
|
31
|
-
group
|
|
36
|
+
group.push(value)
|
|
32
37
|
return
|
|
33
38
|
}
|
|
34
39
|
if (group.includes(value) === false) {
|
|
35
40
|
return
|
|
36
41
|
}
|
|
37
|
-
group
|
|
42
|
+
group.splice(group.indexOf(value), 1)
|
|
43
|
+
}
|
|
44
|
+
const get = () => checked
|
|
45
|
+
const set = (next) => {
|
|
46
|
+
checked = next
|
|
47
|
+
updateGroup(next)
|
|
38
48
|
}
|
|
39
|
-
$: updateGroup(checked)
|
|
40
49
|
</script>
|
|
41
50
|
|
|
42
51
|
<label use:wsx={container}>
|
|
43
52
|
<div>
|
|
44
|
-
|
|
53
|
+
{#if children}
|
|
54
|
+
{@render children()}
|
|
55
|
+
{:else}
|
|
45
56
|
{label}
|
|
46
|
-
|
|
57
|
+
{/if}
|
|
47
58
|
</div>
|
|
48
|
-
<input type="checkbox" bind:checked use:wsx={input} />
|
|
59
|
+
<input type="checkbox" bind:checked={get,set} use:wsx={input} />
|
|
49
60
|
</label>
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
let {
|
|
5
|
+
alt = "",
|
|
6
|
+
image = null,
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
text = "",
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
color = false,
|
|
11
|
+
...rest
|
|
12
|
+
} = $props()
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
const wind = $derived({
|
|
14
15
|
"$color": color,
|
|
15
|
-
|
|
16
|
-
}
|
|
16
|
+
...rest
|
|
17
|
+
})
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
20
|
<ws-avatar use:wsx={wind}>
|
|
20
21
|
{#if image !== null}
|
|
21
|
-
<!-- svelte-ignore
|
|
22
|
+
<!-- svelte-ignore a11y_missing_attribute -->
|
|
22
23
|
<object data={image} type="image/png">
|
|
23
24
|
{alt}
|
|
24
25
|
</object>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
let {
|
|
5
|
+
color = null,
|
|
6
|
+
text = "",
|
|
7
|
+
children,
|
|
8
|
+
...rest
|
|
9
|
+
} = $props()
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
const wind = $derived({ "$color": color, ...rest })
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<ws-badge ws-text={text} use:wsx={wind}>
|
|
13
|
-
|
|
15
|
+
{@render children?.()}
|
|
14
16
|
</ws-badge>
|
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
1
|
<script>
|
|
4
|
-
import wsx from "../wsx.
|
|
5
|
-
import variant from "../variant.
|
|
2
|
+
import wsx from "../wsx.js"
|
|
3
|
+
import variant from "../variant.js"
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
let {
|
|
6
|
+
color = "@default",
|
|
7
|
+
clickable = false,
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
fill = false,
|
|
10
|
+
outline = false,
|
|
11
|
+
flat = false,
|
|
12
|
+
children,
|
|
13
|
+
onclick,
|
|
14
|
+
...rest
|
|
15
|
+
} = $props()
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
const type = $derived(
|
|
18
|
+
variant(
|
|
19
|
+
"$outline",
|
|
20
|
+
{ fill },
|
|
21
|
+
{ outline },
|
|
22
|
+
{ flat },
|
|
23
|
+
)
|
|
24
|
+
)
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
const wind = $derived({
|
|
17
27
|
[type]: true,
|
|
18
28
|
"$color": color,
|
|
19
29
|
"@@click": clickable,
|
|
20
|
-
|
|
21
|
-
}
|
|
30
|
+
...rest
|
|
31
|
+
})
|
|
22
32
|
</script>
|
|
23
33
|
|
|
24
|
-
<!-- svelte-ignore
|
|
25
|
-
<!-- svelte-ignore
|
|
26
|
-
<ws-chip use:wsx={wind}
|
|
27
|
-
|
|
34
|
+
<!-- svelte-ignore a11y_interactive_supports_focus -->
|
|
35
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
36
|
+
<ws-chip use:wsx={wind} {onclick} role="button">
|
|
37
|
+
{@render children?.()}
|
|
28
38
|
</ws-chip>
|