@skeletonlabs/skeleton 2.9.1-dev.0020c671 → 2.9.1-dev.7a9827ee
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>export let initials = "
|
|
1
|
+
<script>export let initials = "";
|
|
2
2
|
export let fill = "fill-token";
|
|
3
3
|
export let fontSize = 150;
|
|
4
4
|
export let src = "";
|
|
@@ -24,8 +24,8 @@ function prunedRestProps() {
|
|
|
24
24
|
|
|
25
25
|
<!-- FIXME: resolve a11y warnings -->
|
|
26
26
|
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
27
|
-
<figure class="avatar {classesBase}" data-testid="avatar" on:click on:keydown on:keyup on:keypress>
|
|
28
|
-
{#if src}
|
|
27
|
+
<figure class="avatar {classesBase}" data-testid="avatar" {...prunedRestProps()} on:click on:keydown on:keyup on:keypress>
|
|
28
|
+
{#if src || fallback}
|
|
29
29
|
<img
|
|
30
30
|
class="avatar-image {cImage}"
|
|
31
31
|
style={$$props.style ?? ''}
|
|
@@ -33,9 +33,8 @@ function prunedRestProps() {
|
|
|
33
33
|
alt={$$props.alt || ''}
|
|
34
34
|
use:action={actionParams}
|
|
35
35
|
on:error={() => (src = fallback)}
|
|
36
|
-
{...prunedRestProps()}
|
|
37
36
|
/>
|
|
38
|
-
{:else}
|
|
37
|
+
{:else if initials}
|
|
39
38
|
<svg class="avatar-initials w-full h-full" viewBox="0 0 512 512">
|
|
40
39
|
<text
|
|
41
40
|
x="50%"
|
|
@@ -49,5 +48,7 @@ function prunedRestProps() {
|
|
|
49
48
|
{String(initials).substring(0, 2).toUpperCase()}
|
|
50
49
|
</text>
|
|
51
50
|
</svg>
|
|
51
|
+
{:else}
|
|
52
|
+
<slot />
|
|
52
53
|
{/if}
|
|
53
54
|
</figure>
|