@tribepad/themis 1.3.2 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tribepad/themis",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "Accessible React component library built on React Aria primitives",
5
5
  "author": "Tribepad <mbasford@tribepad.com>",
6
6
  "license": "MIT",
@@ -197,6 +197,101 @@ export const WithBadges: Story = {
197
197
  render: () => <SidebarDemo showBadges />,
198
198
  };
199
199
 
200
+ /**
201
+ * Panel header with an optional icon slot. The icon renders before the
202
+ * title and is automatically marked `aria-hidden` — titles already carry
203
+ * the meaning, so the icon is purely decorative.
204
+ */
205
+ export const PanelHeaderWithIcon: Story = {
206
+ render: () => (
207
+ <div className="flex h-screen bg-[var(--page-background)]">
208
+ <Sidebar>
209
+ <Sidebar.Rail aria-label="Main navigation">
210
+ <Sidebar.RailItem id="inbox" icon={<Home />} label="Inbox" isActive />
211
+ <Sidebar.RailItem id="docs" icon={<FileText />} label="Docs" />
212
+ </Sidebar.Rail>
213
+ <Sidebar.Panel aria-label="Inbox details">
214
+ <Sidebar.PanelHeader title="Inbox" icon={<Home />} />
215
+ <div className="p-3 text-sm text-[var(--content-foreground)]">
216
+ Inbox contents.
217
+ </div>
218
+ </Sidebar.Panel>
219
+ </Sidebar>
220
+ </div>
221
+ ),
222
+ };
223
+
224
+ /**
225
+ * Items can opt into `placement="bottom"` to pin them to the bottom of the rail.
226
+ * Useful for low-frequency destinations like Settings, Admin, or Help.
227
+ *
228
+ * The rail is `flex-col` and the bottom group uses `mt-auto`, so top items keep
229
+ * their natural ordering while bottom items hug the rail's lower edge.
230
+ */
231
+ export const RailItemBottomPlacement: Story = {
232
+ render: () => {
233
+ const [activeId, setActiveId] = useState('home');
234
+ return (
235
+ <div className="flex h-screen bg-[var(--page-background)]">
236
+ <Sidebar>
237
+ <Sidebar.Rail aria-label="Main navigation">
238
+ <Sidebar.CollapseButton />
239
+ <Sidebar.RailItem
240
+ id="home"
241
+ icon={<Home />}
242
+ label="Home"
243
+ isActive={activeId === 'home'}
244
+ onPress={() => setActiveId('home')}
245
+ />
246
+ <Sidebar.RailItem
247
+ id="inbox"
248
+ icon={<Inbox />}
249
+ label="Inbox"
250
+ isActive={activeId === 'inbox'}
251
+ onPress={() => setActiveId('inbox')}
252
+ />
253
+ <Sidebar.RailItem
254
+ id="docs"
255
+ icon={<FileText />}
256
+ label="Docs"
257
+ isActive={activeId === 'docs'}
258
+ onPress={() => setActiveId('docs')}
259
+ />
260
+ <Sidebar.RailItem
261
+ id="help"
262
+ icon={<HelpCircle />}
263
+ label="Help"
264
+ placement="bottom"
265
+ isActive={activeId === 'help'}
266
+ onPress={() => setActiveId('help')}
267
+ />
268
+ <Sidebar.RailItem
269
+ id="settings"
270
+ icon={<Settings />}
271
+ label="Settings"
272
+ placement="bottom"
273
+ isActive={activeId === 'settings'}
274
+ onPress={() => setActiveId('settings')}
275
+ />
276
+ </Sidebar.Rail>
277
+ <Sidebar.Panel width="md" aria-label={`${activeId} details`}>
278
+ <PanelContentForItem id={activeId} />
279
+ </Sidebar.Panel>
280
+ </Sidebar>
281
+ <main className="flex-1 p-6">
282
+ <h1 className="text-2xl font-bold text-[var(--page-foreground)]">
283
+ {activeId.charAt(0).toUpperCase() + activeId.slice(1)}
284
+ </h1>
285
+ <p className="mt-2 text-[var(--muted-foreground)]">
286
+ Help and Settings are pinned to the bottom of the rail via{' '}
287
+ <code className="font-mono text-xs">placement=&quot;bottom&quot;</code>.
288
+ </p>
289
+ </main>
290
+ </div>
291
+ );
292
+ },
293
+ };
294
+
200
295
  /** Rail items that navigate via href */
201
296
  export const LinkItems: Story = {
202
297
  render: () => (