Skip to content

Commit b06772b

Browse files
committed
And avatar and update the other components.
1 parent ec87e51 commit b06772b

File tree

8 files changed

+43
-7
lines changed

8 files changed

+43
-7
lines changed

src/lib/components/Avatar.svelte

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script lang="ts">
2+
import { Icon } from "$lib/index.js";
3+
4+
export let id = "";
5+
</script>
6+
7+
<div class="avatar">
8+
{#if id === ""}
9+
<Icon icon="account_circle"/>
10+
{:else}
11+
<Icon icon="mood_bad"/>
12+
{/if}
13+
</div>
14+
15+
<style>
16+
.avatar {
17+
margin: 0rem var(--token-space-2);
18+
}
19+
</style>

src/lib/components/Inputs/TextField.svelte

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
export let invalidMessage: string = "Invalid";
1010
export let required: boolean = false;
1111
export let onEnter: (event: KeyboardEvent) => void = () => {};
12+
export let width: "100%";
1213
</script>
1314

14-
<div class="input-root">
15+
<div class="input-root" style="width: {width};">
1516
<label for={id}>
1617
{label}
1718
{#if required}
@@ -39,6 +40,8 @@
3940
<span class="material-symbols-outlined" aria-hidden="true">error</span>
4041
{invalidMessage}
4142
</div>
43+
{:else}
44+
<div class="error-placeholder"></div>
4245
{/if}
4346
</div>
4447

@@ -76,10 +79,13 @@
7679
7780
.error-message {
7881
display: flex;
79-
flex-direction: row;
8082
align-items: center;
8183
color: var(--token-color-text-danger);
8284
gap: var(--token-space-1);
85+
min-height: 1.4rem;
86+
width: 100%;
87+
white-space: normal;
88+
overflow-wrap: break-word;
8389
vertical-align: middle;
8490
}
8591

src/lib/components/Overlays/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
export { default as Modal } from "$lib/components/Overlays/Modal.svelte";
2-
export { default as ToolTip } from "$lib/components/Overlays/ToolTip.svelte";
2+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<script lang="ts">
2+
export let icon: string;
3+
export let size: string = "1rem";
4+
export let color: string = "var(--token-color-text)";
5+
</script>
6+
7+
<span style="color: {color}; font-size: {size};" class="icon material-symbols-outlined" translate="no" aria-hidden="true">{icon}</span>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as Icon } from "$lib/components/Primitives/Icon.svelte";
2+
export { default as ToolTip } from "$lib/components/Primitives/ToolTip.svelte";

src/lib/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export * from "$lib/components/Layout/index.js";
44
export * from "$lib/components/Loading/index.js";
55
export * from "$lib/components/Messaging/index.js";
66
export * from "$lib/components/Overlays/index.js";
7+
export * from "$lib/components/Primitives/index.js";
78
export * from "$lib/components/Themes/index.js";
89

910
export { default as ConnectivityCheck } from "$lib/components/ConnectivityCheck.svelte";
11+
export { default as Avatar } from "$lib/components/Avatar.svelte";

src/lib/metadata.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export const metadata = {
44
version: "1.9.1",
55
packageName: "@davidnet/svelte-ui",
66
npmUrl: "https://www.npmjs.com/package/@davidnet/svelte-ui",
7-
commitHash: "7708191",
8-
fullCommitHash: "7708191dc087cb3ee86badf1dce7b674c8a05696",
9-
commitDate: "2025-08-06T19:23:08+02:00",
7+
commitHash: "ec87e51",
8+
fullCommitHash: "ec87e51d45a3bd1cc37938625667a7979b62d11a",
9+
commitDate: "2025-08-10T12:05:07+02:00",
1010
branch: "main",
11-
commitUrl: "https://github.com/davidnet-net/svelte-ui/commit/7708191dc087cb3ee86badf1dce7b674c8a05696",
11+
commitUrl: "https://github.com/davidnet-net/svelte-ui/commit/ec87e51d45a3bd1cc37938625667a7979b62d11a",
1212
repoUrl: "https://github.com/davidnet-net/svelte-ui"
1313
};

0 commit comments

Comments
 (0)