@meith/theme-default 0.3.0 → 0.3.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/package.json +3 -3
- package/src/slots/user-panel.tsx +45 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/theme-default",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Meith's default theme — every slot and every token, and the reference for what a complete theme fills.",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@meith/theme-kit": "^0.3.
|
|
24
|
-
"@meith/ui": "^0.3.
|
|
23
|
+
"@meith/theme-kit": "^0.3.1",
|
|
24
|
+
"@meith/ui": "^0.3.1"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^19.2.0"
|
package/src/slots/user-panel.tsx
CHANGED
|
@@ -4,11 +4,15 @@ import type { UserPanelModel } from '@meith/theme-kit'
|
|
|
4
4
|
|
|
5
5
|
import { MUTED_LINK } from '../shared'
|
|
6
6
|
|
|
7
|
+
const COUNT_LINK = 'rounded-full outline-offset-2 focus-visible:outline-2 focus-visible:outline-ring'
|
|
8
|
+
|
|
7
9
|
export function UserPanel({
|
|
8
10
|
viewer,
|
|
9
11
|
links,
|
|
10
12
|
unreadNotifications,
|
|
11
13
|
unreadMessages,
|
|
14
|
+
notificationsHref,
|
|
15
|
+
messagesHref,
|
|
12
16
|
children,
|
|
13
17
|
}: UserPanelModel) {
|
|
14
18
|
if (viewer.isGuest) {
|
|
@@ -41,46 +45,52 @@ export function UserPanel({
|
|
|
41
45
|
}}
|
|
42
46
|
/>
|
|
43
47
|
|
|
44
|
-
<div
|
|
48
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
45
49
|
{unreadNotifications > 0 && (
|
|
46
|
-
<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
<a href={notificationsHref} className={COUNT_LINK}>
|
|
51
|
+
<Badge tone="solid">
|
|
52
|
+
{unreadNotifications}
|
|
53
|
+
<span className="sr-only"> unread notifications</span>
|
|
54
|
+
<span aria-hidden="true"> new</span>
|
|
55
|
+
</Badge>
|
|
56
|
+
</a>
|
|
51
57
|
)}
|
|
52
58
|
{unreadMessages > 0 && (
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
<a href={messagesHref} className={COUNT_LINK}>
|
|
60
|
+
<Badge tone="outline">
|
|
61
|
+
{unreadMessages}
|
|
62
|
+
<span className="sr-only"> unread messages</span>
|
|
63
|
+
<span aria-hidden="true"> unread</span>
|
|
64
|
+
</Badge>
|
|
65
|
+
</a>
|
|
58
66
|
)}
|
|
59
67
|
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
<span data-account="menu" className="flex min-w-0 items-center">
|
|
69
|
+
<Menu
|
|
70
|
+
label="Your account"
|
|
71
|
+
items={links}
|
|
72
|
+
trigger={
|
|
73
|
+
<>
|
|
74
|
+
<Avatar src={viewer.avatarUrl} name={name} size={24} />
|
|
75
|
+
<span className="max-w-40 truncate font-medium text-foreground">{name}</span>
|
|
76
|
+
<svg
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
viewBox="0 0 12 12"
|
|
79
|
+
className="size-3 shrink-0 text-muted-foreground"
|
|
80
|
+
fill="none"
|
|
81
|
+
stroke="currentColor"
|
|
82
|
+
strokeWidth="1.5"
|
|
83
|
+
strokeLinecap="round"
|
|
84
|
+
strokeLinejoin="round"
|
|
85
|
+
>
|
|
86
|
+
<path d="m3 4.5 3 3 3-3" />
|
|
87
|
+
</svg>
|
|
88
|
+
</>
|
|
89
|
+
}
|
|
90
|
+
>
|
|
91
|
+
{children}
|
|
92
|
+
</Menu>
|
|
93
|
+
</span>
|
|
84
94
|
</div>
|
|
85
95
|
|
|
86
96
|
<nav
|