@streamscloud/kit 0.9.3 → 0.9.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/dist/ui/avatar/cmp.avatar.svelte +63 -16
- package/dist/ui/avatar/cmp.avatar.svelte.d.ts +12 -5
- package/dist/ui/avatar/index.d.ts +1 -0
- package/dist/ui/avatar/types.d.ts +8 -0
- package/dist/ui/avatar/types.js +1 -0
- package/dist/ui/navigation/cmp.nav-menu-account-row.svelte +16 -73
- package/dist/ui/navigation/cmp.nav-menu-account-row.svelte.d.ts +9 -12
- package/package.json +1 -1
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
<script lang="ts">import { Image } from '../image';
|
|
2
|
-
let { src = null, name = '', size = 'md', status = null } = $props();
|
|
3
|
-
const
|
|
2
|
+
let { src = null, name = '', size = 'md', status = null, badge = null } = $props();
|
|
3
|
+
const deriveInitials = (value) => value
|
|
4
4
|
.split(/\s+/)
|
|
5
5
|
.filter(Boolean)
|
|
6
6
|
.slice(0, 2)
|
|
7
7
|
.map((p) => p[0])
|
|
8
8
|
.join('')
|
|
9
|
-
.toUpperCase()
|
|
9
|
+
.toUpperCase();
|
|
10
|
+
const initials = $derived(deriveInitials(name));
|
|
11
|
+
const badgeInitials = $derived(deriveInitials(badge?.name ?? ''));
|
|
10
12
|
</script>
|
|
11
13
|
|
|
14
|
+
{#snippet personIcon()}
|
|
15
|
+
<span class="avatar__fallback" aria-hidden="true">
|
|
16
|
+
<svg class="avatar__fallback-icon" viewBox="0 0 24 24">
|
|
17
|
+
<circle cx="12" cy="9" r="4" fill="currentColor" opacity="0.6"></circle>
|
|
18
|
+
<path d="M4 21c0-4 4-7 8-7s8 3 8 7" fill="currentColor" opacity="0.6"></path>
|
|
19
|
+
</svg>
|
|
20
|
+
</span>
|
|
21
|
+
{/snippet}
|
|
22
|
+
|
|
12
23
|
{#snippet fallback()}
|
|
13
24
|
{#if name && initials}
|
|
14
25
|
<span class="avatar__initials">{initials}</span>
|
|
15
26
|
{:else}
|
|
16
|
-
|
|
17
|
-
<svg class="avatar__fallback-icon" viewBox="0 0 24 24">
|
|
18
|
-
<circle cx="12" cy="9" r="4" fill="currentColor" opacity="0.6"></circle>
|
|
19
|
-
<path d="M4 21c0-4 4-7 8-7s8 3 8 7" fill="currentColor" opacity="0.6"></path>
|
|
20
|
-
</svg>
|
|
21
|
-
</span>
|
|
27
|
+
{@render personIcon()}
|
|
22
28
|
{/if}
|
|
23
29
|
{/snippet}
|
|
24
30
|
|
|
25
|
-
|
|
31
|
+
{#snippet badgeFallback()}
|
|
32
|
+
{#if badge?.name && badgeInitials}
|
|
33
|
+
<span class="avatar__initials avatar__initials--badge">{badgeInitials}</span>
|
|
34
|
+
{:else}
|
|
35
|
+
{@render personIcon()}
|
|
36
|
+
{/if}
|
|
37
|
+
{/snippet}
|
|
38
|
+
|
|
39
|
+
<span class="avatar avatar--{size}" class:avatar--with-status={!!status && !badge} role="img" aria-label={name || 'Avatar'}>
|
|
26
40
|
<Image src={src} alt={name} showStubOnError stub={fallback} />
|
|
27
|
-
{#if
|
|
41
|
+
{#if badge}
|
|
42
|
+
<span class="avatar__badge" role={badge.name ? 'img' : undefined} aria-label={badge.name || undefined} aria-hidden={badge.name ? undefined : true}>
|
|
43
|
+
<Image src={badge.src ?? null} alt={badge.name ?? ''} showStubOnError stub={badgeFallback} />
|
|
44
|
+
</span>
|
|
45
|
+
{:else if status}
|
|
28
46
|
<span class="avatar__dot avatar__dot--{status}" aria-hidden="true"></span>
|
|
29
47
|
{/if}
|
|
30
48
|
</span>
|
|
@@ -33,13 +51,16 @@ const initials = $derived(name
|
|
|
33
51
|
@component
|
|
34
52
|
A circular avatar with three render modes (priority order): image → initials (derived from `name`)
|
|
35
53
|
→ generic person icon. If `src` fails to load, automatically falls back to initials/icon. Optional
|
|
36
|
-
status dot in the bottom-right corner
|
|
37
|
-
|
|
54
|
+
status dot in the bottom-right corner, or a square `badge` mini-avatar in the same corner (the
|
|
55
|
+
workspace/org-with-user pattern, same fallback chain at badge scale) — `badge` and `status` are
|
|
56
|
+
mutually exclusive, `badge` wins. Built on top of the kit `Image` component, which handles the
|
|
57
|
+
load / error / stub state machine.
|
|
38
58
|
|
|
39
59
|
### CSS Custom Properties
|
|
40
60
|
| Property | Description | Default |
|
|
41
61
|
|---|---|---|
|
|
42
62
|
| `--sc-kit--avatar--size` | Diameter (overrides size preset) | per `size` preset (20 / 24 / 32 / 40 / 56 px) |
|
|
63
|
+
| `--sc-kit--avatar--border-radius` | Avatar shape (set e.g. `--sc-kit--radius--sm` for a rounded square) | `50%` |
|
|
43
64
|
| `--sc-kit--avatar--background` | Fallback container background (initials / icon mode) | `--sc-kit--color--bg--active` |
|
|
44
65
|
| `--sc-kit--avatar--color` | Fallback foreground (generic icon tint) | `--sc-kit--color--text--muted` |
|
|
45
66
|
| `--sc-kit--avatar--initials--background` | Initials chip background | `--sc-kit--color--accent--soft` |
|
|
@@ -48,6 +69,9 @@ the load / error / stub state machine.
|
|
|
48
69
|
| `--sc-kit--avatar--dot--color-online` | Online dot color | `--sc-kit--color--success` |
|
|
49
70
|
| `--sc-kit--avatar--dot--color-busy` | Busy dot color | `--sc-kit--color--danger` |
|
|
50
71
|
| `--sc-kit--avatar--dot--color-offline` | Offline dot color | `--sc-kit--color--text--muted` |
|
|
72
|
+
| `--sc-kit--avatar--badge--size` | Badge mini-avatar box | 45% of the avatar diameter |
|
|
73
|
+
| `--sc-kit--avatar--badge--ring-color` | Badge separation ring (override on active/hover row backgrounds to blend) | `--sc-kit--color--bg--panel` |
|
|
74
|
+
| `--sc-kit--avatar--badge--ring-width` | Badge separation ring thickness | `1.5px` |
|
|
51
75
|
-->
|
|
52
76
|
|
|
53
77
|
<style>.avatar {
|
|
@@ -59,7 +83,11 @@ the load / error / stub state machine.
|
|
|
59
83
|
--_avatar--dot-online: var(--sc-kit--avatar--dot--color-online, var(--sc-kit--color--success));
|
|
60
84
|
--_avatar--dot-busy: var(--sc-kit--avatar--dot--color-busy, var(--sc-kit--color--danger));
|
|
61
85
|
--_avatar--dot-offline: var(--sc-kit--avatar--dot--color-offline, var(--sc-kit--color--text--muted));
|
|
62
|
-
--sc-kit--
|
|
86
|
+
--_avatar--badge-size: var(--sc-kit--avatar--badge--size, calc(var(--_avatar--size) * 0.45));
|
|
87
|
+
--_avatar--badge-ring-color: var(--sc-kit--avatar--badge--ring-color, var(--sc-kit--color--bg--panel));
|
|
88
|
+
--_avatar--badge-ring-width: var(--sc-kit--avatar--badge--ring-width, 1.5px);
|
|
89
|
+
--_avatar--border-radius: var(--sc-kit--avatar--border-radius, 50%);
|
|
90
|
+
--sc-kit--image--border-radius: var(--_avatar--border-radius);
|
|
63
91
|
--sc-kit--image--background: var(--_avatar--background);
|
|
64
92
|
position: relative;
|
|
65
93
|
display: flex;
|
|
@@ -67,7 +95,7 @@ the load / error / stub state machine.
|
|
|
67
95
|
justify-content: center;
|
|
68
96
|
width: var(--_avatar--size);
|
|
69
97
|
height: var(--_avatar--size);
|
|
70
|
-
border-radius:
|
|
98
|
+
border-radius: var(--_avatar--border-radius);
|
|
71
99
|
flex-shrink: 0;
|
|
72
100
|
background: var(--_avatar--background);
|
|
73
101
|
color: var(--_avatar--color);
|
|
@@ -91,7 +119,7 @@ the load / error / stub state machine.
|
|
|
91
119
|
.avatar__initials {
|
|
92
120
|
width: 100%;
|
|
93
121
|
height: 100%;
|
|
94
|
-
border-radius:
|
|
122
|
+
border-radius: var(--_avatar--border-radius);
|
|
95
123
|
display: flex;
|
|
96
124
|
align-items: center;
|
|
97
125
|
justify-content: center;
|
|
@@ -102,6 +130,25 @@ the load / error / stub state machine.
|
|
|
102
130
|
line-height: var(--sc-kit--leading--tight);
|
|
103
131
|
user-select: none;
|
|
104
132
|
}
|
|
133
|
+
.avatar__initials--badge {
|
|
134
|
+
border-radius: var(--sc-kit--radius--sm);
|
|
135
|
+
font-size: calc(var(--_avatar--badge-size) * 0.5);
|
|
136
|
+
}
|
|
137
|
+
.avatar__badge {
|
|
138
|
+
position: absolute;
|
|
139
|
+
right: -0.125rem;
|
|
140
|
+
bottom: -0.125rem;
|
|
141
|
+
width: var(--_avatar--badge-size);
|
|
142
|
+
height: var(--_avatar--badge-size);
|
|
143
|
+
border-radius: var(--sc-kit--radius--sm);
|
|
144
|
+
box-shadow: 0 0 0 var(--_avatar--badge-ring-width) var(--_avatar--badge-ring-color);
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
background: var(--_avatar--background);
|
|
150
|
+
--sc-kit--image--border-radius: var(--sc-kit--radius--sm);
|
|
151
|
+
}
|
|
105
152
|
.avatar__fallback {
|
|
106
153
|
width: 100%;
|
|
107
154
|
height: 100%;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
type
|
|
2
|
-
type AvatarStatus = 'online' | 'busy' | 'offline';
|
|
1
|
+
import type { AvatarData, AvatarSize, AvatarStatus } from './types';
|
|
3
2
|
type Props = {
|
|
4
3
|
/** Image URL. If omitted or fails to load, falls back to initials, then to a generic icon. */
|
|
5
4
|
src?: string | null;
|
|
@@ -7,19 +6,24 @@ type Props = {
|
|
|
7
6
|
name?: string;
|
|
8
7
|
/** Size preset. @default 'md' */
|
|
9
8
|
size?: AvatarSize;
|
|
10
|
-
/** Optional status dot rendered in the bottom-right corner. */
|
|
9
|
+
/** Optional status dot rendered in the bottom-right corner. Ignored while `badge` is set — both occupy the same corner. */
|
|
11
10
|
status?: AvatarStatus | null;
|
|
11
|
+
/** Secondary mini-avatar layered on the bottom-right corner — the workspace/org-with-user pattern. Reuses the image → initials → icon fallback chain at badge scale. Takes the corner over `status`. */
|
|
12
|
+
badge?: AvatarData | null;
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
15
|
* A circular avatar with three render modes (priority order): image → initials (derived from `name`)
|
|
15
16
|
* → generic person icon. If `src` fails to load, automatically falls back to initials/icon. Optional
|
|
16
|
-
* status dot in the bottom-right corner
|
|
17
|
-
*
|
|
17
|
+
* status dot in the bottom-right corner, or a square `badge` mini-avatar in the same corner (the
|
|
18
|
+
* workspace/org-with-user pattern, same fallback chain at badge scale) — `badge` and `status` are
|
|
19
|
+
* mutually exclusive, `badge` wins. Built on top of the kit `Image` component, which handles the
|
|
20
|
+
* load / error / stub state machine.
|
|
18
21
|
*
|
|
19
22
|
* ### CSS Custom Properties
|
|
20
23
|
* | Property | Description | Default |
|
|
21
24
|
* |---|---|---|
|
|
22
25
|
* | `--sc-kit--avatar--size` | Diameter (overrides size preset) | per `size` preset (20 / 24 / 32 / 40 / 56 px) |
|
|
26
|
+
* | `--sc-kit--avatar--border-radius` | Avatar shape (set e.g. `--sc-kit--radius--sm` for a rounded square) | `50%` |
|
|
23
27
|
* | `--sc-kit--avatar--background` | Fallback container background (initials / icon mode) | `--sc-kit--color--bg--active` |
|
|
24
28
|
* | `--sc-kit--avatar--color` | Fallback foreground (generic icon tint) | `--sc-kit--color--text--muted` |
|
|
25
29
|
* | `--sc-kit--avatar--initials--background` | Initials chip background | `--sc-kit--color--accent--soft` |
|
|
@@ -28,6 +32,9 @@ type Props = {
|
|
|
28
32
|
* | `--sc-kit--avatar--dot--color-online` | Online dot color | `--sc-kit--color--success` |
|
|
29
33
|
* | `--sc-kit--avatar--dot--color-busy` | Busy dot color | `--sc-kit--color--danger` |
|
|
30
34
|
* | `--sc-kit--avatar--dot--color-offline` | Offline dot color | `--sc-kit--color--text--muted` |
|
|
35
|
+
* | `--sc-kit--avatar--badge--size` | Badge mini-avatar box | 45% of the avatar diameter |
|
|
36
|
+
* | `--sc-kit--avatar--badge--ring-color` | Badge separation ring (override on active/hover row backgrounds to blend) | `--sc-kit--color--bg--panel` |
|
|
37
|
+
* | `--sc-kit--avatar--badge--ring-width` | Badge separation ring thickness | `1.5px` |
|
|
31
38
|
*/
|
|
32
39
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
33
40
|
type Cmp = ReturnType<typeof Cmp>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
2
|
+
export type AvatarStatus = 'online' | 'busy' | 'offline';
|
|
3
|
+
export type AvatarData = {
|
|
4
|
+
/** Image URL. `null` / `undefined` skips to the initials → icon fallback chain. */
|
|
5
|
+
src?: string | null;
|
|
6
|
+
/** Display name — drives the initials fallback and the accessible label. */
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
<script lang="ts">import {
|
|
1
|
+
<script lang="ts">import { Avatar } from '../avatar';
|
|
2
|
+
import { Icon } from '../icon';
|
|
2
3
|
import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
|
|
3
|
-
const { name, subtitle, avatar,
|
|
4
|
+
const { name, subtitle, avatar, badge = null, position = 'top' } = $props();
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
|
-
<div class="nav-menu-account-row" class:nav-menu-account-row--
|
|
7
|
-
<span class="nav-menu-account-row__avatar-
|
|
8
|
-
<
|
|
9
|
-
{@render avatar()}
|
|
10
|
-
</span>
|
|
11
|
-
{#if secondaryAvatar}
|
|
12
|
-
<span class="nav-menu-account-row__avatar nav-menu-account-row__avatar--secondary">
|
|
13
|
-
{@render secondaryAvatar()}
|
|
14
|
-
</span>
|
|
15
|
-
{/if}
|
|
7
|
+
<div class="nav-menu-account-row" class:nav-menu-account-row--top={position === 'top'}>
|
|
8
|
+
<span class="nav-menu-account-row__avatar" class:nav-menu-account-row__avatar--dual={!!badge}>
|
|
9
|
+
<Avatar src={avatar.src} name={avatar.name} badge={badge} />
|
|
16
10
|
</span>
|
|
17
11
|
<span class="nav-menu-account-row__info">
|
|
18
12
|
<span class="nav-menu-account-row__name">{name}</span>
|
|
@@ -29,18 +23,13 @@ const { name, subtitle, avatar, secondaryAvatar, position = 'top' } = $props();
|
|
|
29
23
|
@component
|
|
30
24
|
NavMenuAccountRow — workspace / account trigger row for the top of a `NavMenu` panel. Purely
|
|
31
25
|
presentational: render it inside a `Popover` `trigger` snippet to make it a real switcher. Layout:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|---|---|---|
|
|
38
|
-
| `--sc-kit--nav-menu-account-row--avatar-size` | Primary avatar box | `32px` |
|
|
39
|
-
| `--sc-kit--nav-menu-account-row--secondary-avatar-size` | Secondary badge box | `14px` |
|
|
26
|
+
kit `Avatar` on the left at the `md` preset (rounded square; circle + corner badge in
|
|
27
|
+
org-with-user mode when `badge` is set), 2-line text (name + subtitle), chevron-down on the
|
|
28
|
+
right. No public CSS vars of its own — avatar sizing/colors are tuned via the
|
|
29
|
+
`--sc-kit--avatar--*` vars directly. It owns its own padding + hover; for a full-width trigger
|
|
30
|
+
set `--sc-kit--popover--width: 100%` on the `Popover`.
|
|
40
31
|
-->
|
|
41
32
|
<style>.nav-menu-account-row {
|
|
42
|
-
--_avatar-size: var(--sc-kit--nav-menu-account-row--avatar-size, 2rem);
|
|
43
|
-
--_secondary-size: var(--sc-kit--nav-menu-account-row--secondary-avatar-size, 0.875rem);
|
|
44
33
|
display: flex;
|
|
45
34
|
align-items: center;
|
|
46
35
|
gap: var(--sc-kit--space--2);
|
|
@@ -53,56 +42,17 @@ padding + hover; for a full-width trigger set `--sc-kit--popover--width: 100%` o
|
|
|
53
42
|
.nav-menu-account-row:hover {
|
|
54
43
|
background: var(--sc-kit--color--bg--hover);
|
|
55
44
|
}
|
|
56
|
-
|
|
57
45
|
.nav-menu-account-row--top {
|
|
58
46
|
margin-top: var(--sc-kit--space--4);
|
|
59
47
|
}
|
|
60
|
-
|
|
61
|
-
.nav-menu-account-row__avatar-stack {
|
|
62
|
-
position: relative;
|
|
63
|
-
display: inline-flex;
|
|
64
|
-
width: var(--_avatar-size);
|
|
65
|
-
height: var(--_avatar-size);
|
|
66
|
-
flex-shrink: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
48
|
.nav-menu-account-row__avatar {
|
|
49
|
+
--sc-kit--avatar--border-radius: var(--sc-kit--radius--sm);
|
|
70
50
|
display: inline-flex;
|
|
71
|
-
|
|
72
|
-
justify-content: center;
|
|
73
|
-
overflow: hidden;
|
|
74
|
-
background: var(--sc-kit--color--bg--field-alt);
|
|
75
|
-
color: var(--sc-kit--color--text--on-accent);
|
|
76
|
-
font-size: var(--sc-kit--font-size--sm);
|
|
77
|
-
font-weight: var(--sc-kit--font-weight--semibold);
|
|
78
|
-
}
|
|
79
|
-
.nav-menu-account-row__avatar :global(img) {
|
|
80
|
-
width: 100%;
|
|
81
|
-
height: 100%;
|
|
82
|
-
object-fit: cover;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.nav-menu-account-row__avatar--primary {
|
|
86
|
-
width: 100%;
|
|
87
|
-
height: 100%;
|
|
88
|
-
border-radius: var(--sc-kit--radius--sm);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.nav-menu-account-row--dual .nav-menu-account-row__avatar--primary {
|
|
92
|
-
border-radius: var(--sc-kit--radius--circle);
|
|
51
|
+
flex-shrink: 0;
|
|
93
52
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
position: absolute;
|
|
97
|
-
right: -2px;
|
|
98
|
-
bottom: -2px;
|
|
99
|
-
width: var(--_secondary-size);
|
|
100
|
-
height: var(--_secondary-size);
|
|
101
|
-
border-radius: var(--sc-kit--radius--sm);
|
|
102
|
-
box-shadow: 0 0 0 1.5px var(--sc-kit--color--bg--panel);
|
|
103
|
-
font-size: 0.5rem;
|
|
53
|
+
.nav-menu-account-row__avatar--dual {
|
|
54
|
+
--sc-kit--avatar--border-radius: 50%;
|
|
104
55
|
}
|
|
105
|
-
|
|
106
56
|
.nav-menu-account-row__info {
|
|
107
57
|
display: flex;
|
|
108
58
|
flex-direction: column;
|
|
@@ -110,7 +60,6 @@ padding + hover; for a full-width trigger set `--sc-kit--popover--width: 100%` o
|
|
|
110
60
|
min-width: 0;
|
|
111
61
|
gap: 0.125rem;
|
|
112
62
|
}
|
|
113
|
-
|
|
114
63
|
.nav-menu-account-row__name {
|
|
115
64
|
font-size: var(--sc-kit--font-size--md);
|
|
116
65
|
font-weight: var(--sc-kit--font-weight--semibold);
|
|
@@ -121,7 +70,6 @@ padding + hover; for a full-width trigger set `--sc-kit--popover--width: 100%` o
|
|
|
121
70
|
white-space: nowrap;
|
|
122
71
|
overflow: hidden;
|
|
123
72
|
}
|
|
124
|
-
|
|
125
73
|
.nav-menu-account-row__subtitle {
|
|
126
74
|
font-size: 0.625rem;
|
|
127
75
|
color: var(--sc-kit--color--text--secondary);
|
|
@@ -131,16 +79,11 @@ padding + hover; for a full-width trigger set `--sc-kit--popover--width: 100%` o
|
|
|
131
79
|
white-space: nowrap;
|
|
132
80
|
overflow: hidden;
|
|
133
81
|
}
|
|
134
|
-
|
|
135
82
|
.nav-menu-account-row__chevron {
|
|
83
|
+
--sc-kit--icon--size: 0.75rem;
|
|
136
84
|
flex-shrink: 0;
|
|
137
85
|
display: inline-flex;
|
|
138
86
|
align-items: center;
|
|
139
87
|
justify-content: center;
|
|
140
88
|
color: var(--sc-kit--color--text--secondary);
|
|
141
|
-
}
|
|
142
|
-
.nav-menu-account-row__chevron :global(svg) {
|
|
143
|
-
width: 0.75rem;
|
|
144
|
-
height: 0.75rem;
|
|
145
|
-
fill: currentColor;
|
|
146
89
|
}</style>
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AvatarData } from '../avatar';
|
|
2
2
|
type Props = {
|
|
3
3
|
/** Primary line — workspace / account name. Truncates with ellipsis. */
|
|
4
4
|
name: string;
|
|
5
5
|
/** Secondary line — workspace type, role, email, etc. Truncates. */
|
|
6
6
|
subtitle?: string;
|
|
7
|
-
/** Primary avatar
|
|
8
|
-
avatar:
|
|
7
|
+
/** Primary avatar data (image → initials → icon fallback). Renders as a rounded square by default; becomes a circle when `badge` is also provided (org-with-user pattern). */
|
|
8
|
+
avatar: AvatarData;
|
|
9
9
|
/** Optional secondary avatar — square badge layered on the bottom-right of the primary. Use it to show the active user when the primary is the workspace / organization. */
|
|
10
|
-
|
|
10
|
+
badge?: AvatarData | null;
|
|
11
11
|
/** Placement within the menu — `top` adds spacing above so the row clears the panel's top edge; `bottom` leaves it flush (footer use). @default 'top' */
|
|
12
12
|
position?: 'top' | 'bottom';
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* NavMenuAccountRow — workspace / account trigger row for the top of a `NavMenu` panel. Purely
|
|
16
16
|
* presentational: render it inside a `Popover` `trigger` snippet to make it a real switcher. Layout:
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* |---|---|---|
|
|
23
|
-
* | `--sc-kit--nav-menu-account-row--avatar-size` | Primary avatar box | `32px` |
|
|
24
|
-
* | `--sc-kit--nav-menu-account-row--secondary-avatar-size` | Secondary badge box | `14px` |
|
|
17
|
+
* kit `Avatar` on the left at the `md` preset (rounded square; circle + corner badge in
|
|
18
|
+
* org-with-user mode when `badge` is set), 2-line text (name + subtitle), chevron-down on the
|
|
19
|
+
* right. No public CSS vars of its own — avatar sizing/colors are tuned via the
|
|
20
|
+
* `--sc-kit--avatar--*` vars directly. It owns its own padding + hover; for a full-width trigger
|
|
21
|
+
* set `--sc-kit--popover--width: 100%` on the `Popover`.
|
|
25
22
|
*/
|
|
26
23
|
declare const Cmp: import("svelte").Component<Props, {}, "">;
|
|
27
24
|
type Cmp = ReturnType<typeof Cmp>;
|