@meith/theme-default 0.28.1 → 0.29.0
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/shared.tsx +15 -1
- package/src/slots/member-profile.tsx +7 -2
- package/src/slots/post-bit.tsx +6 -4
- package/src/theme.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/theme-default",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Meith's default theme — every slot and every token, and the reference for what a complete theme fills.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@meith/theme-kit": "^0.
|
|
24
|
-
"@meith/ui": "^0.
|
|
23
|
+
"@meith/theme-kit": "^0.29.0",
|
|
24
|
+
"@meith/ui": "^0.29.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^19.2.0"
|
package/src/shared.tsx
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CountModel,
|
|
3
|
+
GroupTagModel,
|
|
4
|
+
PrefixModel,
|
|
5
|
+
TimeModel,
|
|
6
|
+
UserRefModel,
|
|
7
|
+
} from '@meith/theme-kit'
|
|
2
8
|
import { Badge, cn } from '@meith/ui'
|
|
3
9
|
|
|
4
10
|
const PAGE_WIDTH = 'max-w-6xl'
|
|
@@ -98,3 +104,11 @@ export function Counts({ items, className }: { items: readonly CountItem[]; clas
|
|
|
98
104
|
</dl>
|
|
99
105
|
)
|
|
100
106
|
}
|
|
107
|
+
|
|
108
|
+
export function groupTags(
|
|
109
|
+
groups: readonly GroupTagModel[] | undefined,
|
|
110
|
+
title: string | null,
|
|
111
|
+
): readonly GroupTagModel[] {
|
|
112
|
+
if (groups !== undefined && groups.length > 0) return groups
|
|
113
|
+
return title === null ? [] : [{ title }]
|
|
114
|
+
}
|
|
@@ -2,12 +2,13 @@ import type { MemberProfileModel, SlotCopy } from '@meith/theme-kit'
|
|
|
2
2
|
import { fromSlotCopy } from '@meith/theme-kit'
|
|
3
3
|
import { Avatar, buttonVariants, Card, CardContent, CardHeader, CardTitle, cn } from '@meith/ui'
|
|
4
4
|
|
|
5
|
-
import { NUMERIC, PAGE_BODY, Stamp } from '../shared'
|
|
5
|
+
import { groupTags, NUMERIC, PAGE_BODY, Stamp } from '../shared'
|
|
6
6
|
|
|
7
7
|
export function MemberProfile({
|
|
8
8
|
user,
|
|
9
9
|
avatarUrl,
|
|
10
10
|
title,
|
|
11
|
+
groups,
|
|
11
12
|
joinedAt,
|
|
12
13
|
lastVisitAt,
|
|
13
14
|
postCount,
|
|
@@ -32,7 +33,11 @@ export function MemberProfile({
|
|
|
32
33
|
>
|
|
33
34
|
{user.username}
|
|
34
35
|
</h1>
|
|
35
|
-
{title
|
|
36
|
+
{groupTags(groups, title).map((group) => (
|
|
37
|
+
<p key={group.title} className="mt-0.5 text-sm text-muted-foreground">
|
|
38
|
+
<span className={group.nameClass ?? undefined}>{group.title}</span>
|
|
39
|
+
</p>
|
|
40
|
+
))}
|
|
36
41
|
</div>
|
|
37
42
|
</div>
|
|
38
43
|
|
package/src/slots/post-bit.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import type { PostBitSlotModel, SlotCopy } from '@meith/theme-kit'
|
|
|
2
2
|
import { fromSlotCopy } from '@meith/theme-kit'
|
|
3
3
|
import { Alert, AlertDescription, AlertTitle, Avatar, Card } from '@meith/ui'
|
|
4
4
|
|
|
5
|
-
import { LINK, MUTED_LINK, NUMERIC, Stamp, UserRef } from '../shared'
|
|
5
|
+
import { groupTags, LINK, MUTED_LINK, NUMERIC, Stamp, UserRef } from '../shared'
|
|
6
6
|
|
|
7
7
|
const VISIBILITY_TINT = {
|
|
8
8
|
visible: '',
|
|
@@ -88,9 +88,11 @@ function AuthorBlock({
|
|
|
88
88
|
</p>
|
|
89
89
|
)}
|
|
90
90
|
|
|
91
|
-
{author.title
|
|
92
|
-
<p className="truncate text-xs text-muted-foreground">
|
|
93
|
-
|
|
91
|
+
{groupTags(author.groups, author.title).map((group) => (
|
|
92
|
+
<p key={group.title} className="truncate text-xs text-muted-foreground">
|
|
93
|
+
<span className={group.nameClass ?? undefined}>{group.title}</span>
|
|
94
|
+
</p>
|
|
95
|
+
))}
|
|
94
96
|
|
|
95
97
|
{author.isOnline && (
|
|
96
98
|
<p className="mt-1 flex items-center gap-1.5 text-xs text-moderation-approved sm:justify-center">
|