@meith/theme-phasebook 0.35.0 → 0.36.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meith/theme-phasebook",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "A theme for Meith with a familiar social shape, built on the default theme's slots.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,9 +20,9 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@meith/theme-default": "^0.35.0",
24
- "@meith/theme-kit": "^0.35.0",
25
- "@meith/ui": "^0.35.0"
23
+ "@meith/theme-default": "^0.36.0",
24
+ "@meith/theme-kit": "^0.36.0",
25
+ "@meith/ui": "^0.36.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "react": "^19.2.0"
package/src/copy.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { mobileHeaderNavCopy, mobilePanelNavCopy } from '@meith/theme-default'
1
2
  import type { SlotCopy, Translator } from '@meith/theme-kit'
2
3
 
3
4
  function copyFor(t: Translator, keys: readonly string[]): SlotCopy {
@@ -77,7 +78,7 @@ export function forumRowCopy(t: Translator): SlotCopy {
77
78
  }
78
79
 
79
80
  export function headerCopy(t: Translator): SlotCopy {
80
- return copyFor(t, ['phasebook.header.sectionsAriaLabel'])
81
+ return { ...mobileHeaderNavCopy(t), ...copyFor(t, ['phasebook.header.sectionsAriaLabel']) }
81
82
  }
82
83
 
83
84
  export function latestPostsCopy(t: Translator): SlotCopy {
@@ -134,7 +135,7 @@ export function paginationCopy(t: Translator): SlotCopy {
134
135
  }
135
136
 
136
137
  export function panelNavCopy(t: Translator): SlotCopy {
137
- return copyFor(t, ['phasebook.panelNav.waiting'])
138
+ return { ...mobilePanelNavCopy(t), ...copyFor(t, ['phasebook.panelNav.waiting']) }
138
139
  }
139
140
 
140
141
  export function postActionsCopy(t: Translator): SlotCopy {
@@ -1,3 +1,4 @@
1
+ import { MobileHeaderNav } from '@meith/theme-default'
1
2
  import type { HeaderModel, SlotCopy } from '@meith/theme-kit'
2
3
  import { fromSlotCopy, linkTarget } from '@meith/theme-kit'
3
4
 
@@ -56,88 +57,6 @@ function Submenu({ items }: { items: HeaderModel['navigation'][number]['submenu'
56
57
  )
57
58
  }
58
59
 
59
- function Chevron({ className }: { className: string }) {
60
- return (
61
- <svg
62
- aria-hidden="true"
63
- viewBox="0 0 12 12"
64
- className={className}
65
- fill="none"
66
- stroke="currentColor"
67
- strokeWidth="1.5"
68
- strokeLinecap="round"
69
- strokeLinejoin="round"
70
- >
71
- <path d="m4.5 3 3 3-3 3" />
72
- </svg>
73
- )
74
- }
75
-
76
- function MobileNavItem({ item }: { item: HeaderModel['navigation'][number] }) {
77
- if (item.submenu === undefined || item.submenu.length === 0) {
78
- return (
79
- <li>
80
- <a
81
- href={item.href}
82
- {...linkTarget(item)}
83
- className="flex min-h-11 items-center rounded-lg px-3 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground"
84
- >
85
- {item.label}
86
- </a>
87
- </li>
88
- )
89
- }
90
-
91
- return (
92
- <li>
93
- <details data-nav-disclosure name="phasebook-header-submenu" className="group/submenu">
94
- <summary className="flex min-h-11 cursor-default list-none items-center justify-between gap-2 rounded-lg px-3 text-sm font-medium text-muted-foreground select-none [&::-webkit-details-marker]:hidden [&::marker]:content-none hover:bg-accent hover:text-foreground">
95
- <a
96
- href={item.href}
97
- {...linkTarget(item)}
98
- className="min-w-0 flex-1 truncate hover:underline"
99
- >
100
- {item.label}
101
- </a>
102
- <span className="flex size-11 shrink-0 items-center justify-center">
103
- <Chevron className="size-3 text-muted-foreground transition-transform group-open/submenu:rotate-90" />
104
- </span>
105
- </summary>
106
- <ul className="ml-2 flex flex-col gap-0.5 border-l border-border py-1 pl-2.5">
107
- {item.submenu.map((child) => (
108
- <li key={child.href}>
109
- <a
110
- href={child.href}
111
- {...linkTarget(child)}
112
- className="flex min-h-11 items-center rounded-lg px-3 text-sm text-muted-foreground hover:bg-accent hover:text-foreground"
113
- >
114
- {child.label}
115
- </a>
116
- </li>
117
- ))}
118
- </ul>
119
- </details>
120
- </li>
121
- )
122
- }
123
-
124
- function MenuGlyph() {
125
- return (
126
- <svg
127
- aria-hidden="true"
128
- viewBox="0 0 20 20"
129
- className="size-5"
130
- fill="none"
131
- stroke="currentColor"
132
- strokeWidth="1.75"
133
- strokeLinecap="round"
134
- >
135
- <path className="group-open/menu:hidden" d="M3 5.5h14M3 10h14M3 14.5h14" />
136
- <path className="hidden group-open/menu:block" d="m5 5 10 10M15 5 5 15" />
137
- </svg>
138
- )
139
- }
140
-
141
60
  export function Header({
142
61
  boardTitle,
143
62
  homeHref,
@@ -186,26 +105,7 @@ export function Header({
186
105
 
187
106
  <div className="flex shrink-0 items-center justify-end gap-2">
188
107
  {children}
189
- {navigation.length > 0 && (
190
- <nav aria-label={c('sectionsAriaLabel')} data-nav-view="mobile" className="lg:hidden">
191
- <details data-nav-disclosure className="group/menu">
192
- <summary
193
- className={`rounded-full text-foreground transition-colors hover:bg-accent group-open/menu:bg-accent flex size-10 cursor-default list-none items-center justify-center select-none [&::-webkit-details-marker]:hidden [&::marker]:content-none`}
194
- >
195
- <MenuGlyph />
196
- <span className="sr-only">{c('sectionsAriaLabel')}</span>
197
- </summary>
198
-
199
- <div className="absolute inset-x-0 top-full z-30 max-h-[calc(100dvh-4rem)] overflow-y-auto border-b border-border bg-card shadow-elevation">
200
- <ul className={`${PAGE} flex flex-col gap-0.5 py-2`}>
201
- {navigation.map((item) => (
202
- <MobileNavItem key={item.href} item={item} />
203
- ))}
204
- </ul>
205
- </div>
206
- </details>
207
- </nav>
208
- )}
108
+ <MobileHeaderNav boardTitle={boardTitle} navigation={navigation} copy={copy} />
209
109
  </div>
210
110
  </div>
211
111
  </header>
@@ -1,6 +1,7 @@
1
+ import { MobilePanelNav } from '@meith/theme-default'
1
2
  import type { PanelNavItemModel, PanelNavModel, SlotCopy } from '@meith/theme-kit'
2
3
  import { fromSlotCopy } from '@meith/theme-kit'
3
- import { cn, Disclosure } from '@meith/ui'
4
+ import { cn } from '@meith/ui'
4
5
 
5
6
  import { Chip } from '../shared'
6
7
 
@@ -98,6 +99,7 @@ function Sections({
98
99
  }
99
100
 
100
101
  export function PanelNav({
102
+ panel,
101
103
  label,
102
104
  sections,
103
105
  currentTitle,
@@ -105,14 +107,13 @@ export function PanelNav({
105
107
  }: PanelNavModel & { copy: SlotCopy }) {
106
108
  return (
107
109
  <>
108
- <Disclosure
109
- summary={label}
110
- className="lg:hidden"
111
- contentClassName="p-2"
112
- {...(currentTitle === null ? {} : { aside: currentTitle })}
113
- >
114
- <Sections label={label} sections={sections} copy={copy} />
115
- </Disclosure>
110
+ <MobilePanelNav
111
+ panel={panel}
112
+ label={label}
113
+ sections={sections}
114
+ currentTitle={currentTitle}
115
+ copy={copy}
116
+ />
116
117
 
117
118
  <div className="hidden rounded-lg border border-border bg-card p-2 shadow-elevation lg:block">
118
119
  <Sections label={label} sections={sections} copy={copy} />
package/src/theme.ts CHANGED
@@ -70,7 +70,7 @@ import { WhoIsOnline } from './slots/who-is-online'
70
70
  export const phasebookTheme = defineTheme({
71
71
  key: 'phasebook',
72
72
  title: 'Phasebook',
73
- version: '0.35.0',
73
+ version: '0.36.0',
74
74
  extends: defaultTheme,
75
75
  slots: {
76
76
  Shell,