@tribepad/themis 1.3.3 → 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/dist/elements/Sidebar/Sidebar.types.d.ts +18 -0
- package/dist/elements/Sidebar/Sidebar.types.d.ts.map +1 -1
- package/dist/elements/Sidebar/SidebarRail.d.ts.map +1 -1
- package/dist/elements/Sidebar/index.js +1 -1
- package/dist/elements/Sidebar/index.js.map +1 -1
- package/dist/elements/Sidebar/index.mjs +1 -1
- package/dist/elements/Sidebar/index.mjs.map +1 -1
- package/dist/elements/index.js +1 -1
- package/dist/elements/index.js.map +1 -1
- package/dist/elements/index.mjs +1 -1
- package/dist/elements/index.mjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/Sidebar/Sidebar.stories.tsx +71 -0
package/package.json
CHANGED
|
@@ -221,6 +221,77 @@ export const PanelHeaderWithIcon: Story = {
|
|
|
221
221
|
),
|
|
222
222
|
};
|
|
223
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="bottom"</code>.
|
|
288
|
+
</p>
|
|
289
|
+
</main>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
|
|
224
295
|
/** Rail items that navigate via href */
|
|
225
296
|
export const LinkItems: Story = {
|
|
226
297
|
render: () => (
|