@meith/theme-midnight 0.8.0 → 0.10.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/slots/header.tsx +31 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/theme-midnight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A dark theme for Meith, built on the default theme's slots.",
|
|
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-default": "^0.
|
|
24
|
-
"@meith/theme-kit": "^0.
|
|
23
|
+
"@meith/theme-default": "^0.10.0",
|
|
24
|
+
"@meith/theme-kit": "^0.10.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^19.2.0"
|
package/src/slots/header.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HeaderModel, SlotCopy } from '@meith/theme-kit'
|
|
2
|
-
import { fromSlotCopy } from '@meith/theme-kit'
|
|
2
|
+
import { fromSlotCopy, linkTarget } from '@meith/theme-kit'
|
|
3
3
|
|
|
4
4
|
function BoardMark({ boardTitle, logo }: Pick<HeaderModel, 'boardTitle' | 'logo'>) {
|
|
5
5
|
if (logo === undefined) return <>{boardTitle}</>
|
|
@@ -23,6 +23,26 @@ function BoardMark({ boardTitle, logo }: Pick<HeaderModel, 'boardTitle' | 'logo'
|
|
|
23
23
|
)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
function Submenu({ items }: { items: HeaderModel['navigation'][number]['submenu'] }) {
|
|
27
|
+
if (items === undefined || items.length === 0) return null
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ul className="invisible absolute top-full left-0 z-30 min-w-44 rounded-b-md border border-border bg-card py-1 text-sm opacity-0 shadow-elevation transition-opacity group-focus-within:visible group-focus-within:opacity-100 group-hover:visible group-hover:opacity-100">
|
|
31
|
+
{items.map((child) => (
|
|
32
|
+
<li key={child.href}>
|
|
33
|
+
<a
|
|
34
|
+
href={child.href}
|
|
35
|
+
{...linkTarget(child)}
|
|
36
|
+
className="block px-3 py-1.5 text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
37
|
+
>
|
|
38
|
+
{child.label}
|
|
39
|
+
</a>
|
|
40
|
+
</li>
|
|
41
|
+
))}
|
|
42
|
+
</ul>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
26
46
|
export function Header({
|
|
27
47
|
boardTitle,
|
|
28
48
|
homeHref,
|
|
@@ -48,13 +68,16 @@ export function Header({
|
|
|
48
68
|
{navigation.length > 0 && (
|
|
49
69
|
<nav aria-label={c('sectionsLabel')} className="flex flex-wrap border-b border-border">
|
|
50
70
|
{navigation.map((item) => (
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
71
|
+
<span key={item.href} className="group relative">
|
|
72
|
+
<a
|
|
73
|
+
href={item.href}
|
|
74
|
+
{...linkTarget(item)}
|
|
75
|
+
className="block border-r border-border px-3 py-1.5 font-mono text-xs uppercase tracking-wide text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
76
|
+
>
|
|
77
|
+
{item.label}
|
|
78
|
+
</a>
|
|
79
|
+
<Submenu items={item.submenu} />
|
|
80
|
+
</span>
|
|
58
81
|
))}
|
|
59
82
|
</nav>
|
|
60
83
|
)}
|