@poodle64/ui 2026.10.24 → 2026.10.26
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/README.md +21 -14
- package/dist/components/feedback/report-widget.svelte +8 -33
- package/dist/components/ui/app-identity/app-identity.svelte +4 -2
- package/dist/components/ui/app-identity/app-identity.svelte.d.ts +1 -1
- package/dist/components/ui/app-shell/app-shell.svelte +96 -111
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +6 -16
- package/dist/components/ui/app-shell/index.d.ts +1 -1
- package/dist/components/ui/app-shell/index.js +1 -1
- package/dist/components/ui/app-shell/padding.d.ts +7 -6
- package/dist/components/ui/app-shell/padding.js +7 -6
- package/dist/components/ui/app-shell/report.svelte.d.ts +10 -0
- package/dist/components/ui/app-shell/report.svelte.js +8 -0
- package/dist/components/ui/app-shell/types.d.ts +6 -4
- package/dist/components/ui/app-shell/types.js +7 -5
- package/dist/components/ui/context-column/context-column.svelte +22 -5
- package/dist/styles.css +2 -3
- package/package.json +1 -1
- package/registry/component-map.json +1 -1
- package/registry/component-map.md +1 -1
package/README.md
CHANGED
|
@@ -40,8 +40,8 @@ src/lib/
|
|
|
40
40
|
components/ui/ one directory per component: the shadcn-svelte primitives
|
|
41
41
|
(bits-ui behaviour + shadcn markup/variants) and the composed
|
|
42
42
|
page-chrome components built on top of them
|
|
43
|
-
components/feedback/ ReportWidget: the
|
|
44
|
-
|
|
43
|
+
components/feedback/ ReportWidget: the "report a problem" dialogue every app
|
|
44
|
+
mounts; the shell draws its trigger (see below)
|
|
45
45
|
components/alerts/ AlertBell: the top-bar bell over the app factory's alerts
|
|
46
46
|
routes (see below)
|
|
47
47
|
dist/ generated by `pnpm build` (@sveltejs/package); never edit
|
|
@@ -140,7 +140,8 @@ be the same thing.
|
|
|
140
140
|
There is now exactly one shell shape, no prop to choose a different one.
|
|
141
141
|
Operator ruling, 31/07/2026: every household app renders the same composition,
|
|
142
142
|
a permanent side rail on `md`+ (an overlay drawer below it) carrying primary
|
|
143
|
-
navigation
|
|
143
|
+
navigation and the brand, **plus** a real top navbar (the collapse toggle at
|
|
144
|
+
its leading edge, search,
|
|
144
145
|
leading/trailing slots, theme toggle, identity), always both together, with
|
|
145
146
|
content that is always full-width. Apps do not choose variants, content modes,
|
|
146
147
|
or spacing.
|
|
@@ -183,8 +184,13 @@ That is the whole minimum. Everything below is optional.
|
|
|
183
184
|
| `texture` | The house atmosphere on the content region. Defaults to `grid`; `none` is the opt-out. |
|
|
184
185
|
| `padded`, `mainClass` | Padding, and extra classes on the scrolling content container. |
|
|
185
186
|
|
|
186
|
-
The bar also names where you are
|
|
187
|
-
|
|
187
|
+
The bar also names where you are, read off `nav` and `currentPath`: "Section ›
|
|
188
|
+
Page" inside a section that has `children` ("Securities › Trading"), the item's
|
|
189
|
+
one name for a top-level page, nothing for a route the nav does not list. It
|
|
190
|
+
shows at every width and truncates on a phone, leading the first row. Settings
|
|
191
|
+
is not in the rail: it is the account menu's one item (`AppIdentity`'s
|
|
192
|
+
`onAccountSettings`, labelled "Settings"), and Sign out lives there only. The
|
|
193
|
+
bar also carries the page's scope controls. A page registers them
|
|
188
194
|
with `ShellControls`; they render after the location, inline from `xl` and on
|
|
189
195
|
a second row of the bar below that:
|
|
190
196
|
|
|
@@ -354,7 +360,7 @@ section you are reading, both panes scrolling independently from `md`.
|
|
|
354
360
|
|
|
355
361
|
<!-- padded={false}: the list's rule and tint have to reach the content area's
|
|
356
362
|
edges, and SettingsShell pads its own content pane to the same rhythm. -->
|
|
357
|
-
<AppShell {nav} currentPath={page.url.pathname}
|
|
363
|
+
<AppShell {nav} currentPath={page.url.pathname} padded={false}>
|
|
358
364
|
<SettingsShell {sections} currentPath={page.url.pathname}>
|
|
359
365
|
{@render children()}
|
|
360
366
|
</SettingsShell>
|
|
@@ -1620,8 +1626,8 @@ trace id. The faro packages are `dependencies`, not peers, for the same reason
|
|
|
1620
1626
|
`bits-ui` is a peer: a duplicated Faro global would strand the session id the
|
|
1621
1627
|
feedback widget reports against.
|
|
1622
1628
|
|
|
1623
|
-
`ReportWidget` is the user-facing other half:
|
|
1624
|
-
|
|
1629
|
+
`ReportWidget` is the user-facing other half: the one report dialogue,
|
|
1630
|
+
opened from the shell (below) — a labelled "What happened?" textarea, and a
|
|
1625
1631
|
screenshot checkbox (on by default) that captures `document.body` with
|
|
1626
1632
|
`html-to-image`. A capture the page cannot produce is tolerated silently: the
|
|
1627
1633
|
report sends with a null image rather than not at all. Submitting POSTs one
|
|
@@ -1652,12 +1658,13 @@ routes by situation, so it stands outside the situation→component registry
|
|
|
1652
1658
|
for the same reason. `getSessionId()` reading null when telemetry is off is
|
|
1653
1659
|
ordinary, not an error: the report sends with a null `session_id`.
|
|
1654
1660
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
(`
|
|
1660
|
-
|
|
1661
|
+
Feedback has one home, the shell's. The widget draws no trigger: while mounted
|
|
1662
|
+
it registers how to open its dialogue, and `AppShell` shows the trigger as an
|
|
1663
|
+
icon button in the top bar's right group from md (`ds-shell-report`, before the
|
|
1664
|
+
app's own `actions`, the theme toggle and the account menu) and as a row at the
|
|
1665
|
+
foot of the phone drawer (`ds-shell-drawer-report`). Nothing floats over a page
|
|
1666
|
+
and the shell reserves no room at its foot for it. The layout mounts the widget
|
|
1667
|
+
beside the shell, as before; an app wires nothing else.
|
|
1661
1668
|
|
|
1662
1669
|
## The alerts bell
|
|
1663
1670
|
|
|
@@ -11,24 +11,21 @@
|
|
|
11
11
|
import Check from '@lucide/svelte/icons/check';
|
|
12
12
|
import CircleAlert from '@lucide/svelte/icons/circle-alert';
|
|
13
13
|
import LoaderCircle from '@lucide/svelte/icons/loader-circle';
|
|
14
|
-
import MessageSquarePlus from '@lucide/svelte/icons/message-square-plus';
|
|
15
14
|
import AppDialog from '../ui/app-dialog/app-dialog.svelte';
|
|
16
15
|
import { Button } from '../ui/button/index.js';
|
|
17
16
|
import { Checkbox } from '../ui/checkbox/index.js';
|
|
18
17
|
import { Label } from '../ui/label/index.js';
|
|
19
18
|
import Textarea from '../ui/textarea/textarea.svelte';
|
|
19
|
+
import { shellReport } from '../ui/app-shell/report.svelte.js';
|
|
20
20
|
import { getSessionId } from '../../telemetry';
|
|
21
21
|
|
|
22
|
-
// The feedback widget every household app mounts:
|
|
23
|
-
//
|
|
22
|
+
// The feedback widget every household app mounts: the one report dialogue.
|
|
23
|
+
// It draws no trigger of its own. While mounted it registers `open` with the
|
|
24
|
+
// shell, which puts the trigger in the top bar (md and up) and in the phone's
|
|
25
|
+
// drawer, so nothing floats over a page. It is deliberately NOT under
|
|
24
26
|
// components/ui — it is app machinery the layout mounts once (alongside
|
|
25
27
|
// initBrowserTelemetry), not page chrome a route composes from, so it does
|
|
26
28
|
// not sit in the situation→component registry either.
|
|
27
|
-
// A page control that shares its corner sets `--ds-report-clearance` on the
|
|
28
|
-
// document to lift the trigger clear of it (the librarian composer does).
|
|
29
|
-
// Every other page gets the trigger's footprint, net of that lift, as
|
|
30
|
-
// `--ds-report-reserve`: the shell ends its padded content with that much
|
|
31
|
-
// room, so a control under the corner can always scroll clear.
|
|
32
29
|
|
|
33
30
|
let {
|
|
34
31
|
/** Where the report POSTs. The app's own route, defaulting to the one every household app serves. */
|
|
@@ -59,19 +56,11 @@
|
|
|
59
56
|
const messageId = `feedback-message-${uid}`;
|
|
60
57
|
const screenshotId = `feedback-screenshot-${uid}`;
|
|
61
58
|
|
|
62
|
-
// The trigger's top edge sits 3.75rem up (1rem offset, 2.75rem disc); 4.5rem
|
|
63
|
-
// leaves a gap above it. Resolved on the document, so a lift set or cleared
|
|
64
|
-
// later moves it too.
|
|
65
59
|
$effect(() => {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
// The corner is this widget's. Another fixed control in it sits beside the
|
|
69
|
-
// trigger, this far in from the right edge with the same gap, so it stays
|
|
70
|
-
// inside the reserve too (ContextColumn's opener does).
|
|
71
|
-
root.style.setProperty('--ds-report-beside', '4.5rem');
|
|
60
|
+
const opener = () => (open = true);
|
|
61
|
+
shellReport.open = opener;
|
|
72
62
|
return () => {
|
|
73
|
-
|
|
74
|
-
root.style.removeProperty('--ds-report-beside');
|
|
63
|
+
if (shellReport.open === opener) shellReport.open = null;
|
|
75
64
|
};
|
|
76
65
|
});
|
|
77
66
|
|
|
@@ -125,20 +114,6 @@
|
|
|
125
114
|
}
|
|
126
115
|
</script>
|
|
127
116
|
|
|
128
|
-
<!-- The floating trigger is the same shape the context column's is: a raw
|
|
129
|
-
button in the house chrome rather than the Button primitive, because a
|
|
130
|
-
Button's padding and text rhythm are for a row of actions, not a
|
|
131
|
-
44px disc pinned over the page. -->
|
|
132
|
-
<button
|
|
133
|
-
type="button"
|
|
134
|
-
onclick={() => (open = true)}
|
|
135
|
-
class="border-border bg-card text-muted-foreground hover:text-foreground ds-edge fixed right-4 bottom-[calc(1rem+var(--ds-report-clearance,0px)+env(safe-area-inset-bottom))] z-50 grid size-11 flex-none place-items-center rounded-full border transition-colors"
|
|
136
|
-
aria-label="Report a problem"
|
|
137
|
-
>
|
|
138
|
-
<MessageSquarePlus class="size-4.5" />
|
|
139
|
-
<span class="sr-only">Report a problem</span>
|
|
140
|
-
</button>
|
|
141
|
-
|
|
142
117
|
<AppDialog
|
|
143
118
|
bind:open
|
|
144
119
|
title="Report a problem"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
entitlements?: string[];
|
|
63
63
|
/** Required — the whole reason this slot exists is a stamped app rendering no way to sign out. */
|
|
64
64
|
onSignOut: () => void;
|
|
65
|
-
/**
|
|
65
|
+
/** The "Settings" item, and Settings' one home: the rail has no row for it. Wire it to the app's settings route; absent renders no item. */
|
|
66
66
|
onAccountSettings?: () => void;
|
|
67
67
|
/**
|
|
68
68
|
* Reach the workspace's members surface from here. Ignored while
|
|
@@ -242,7 +242,9 @@
|
|
|
242
242
|
{#if themeToggle}
|
|
243
243
|
<DropdownMenu.Item onSelect={switchTheme}>Switch theme</DropdownMenu.Item>
|
|
244
244
|
{/if}
|
|
245
|
-
|
|
245
|
+
{#if onAccountSettings}
|
|
246
|
+
<DropdownMenu.Item onSelect={onAccountSettings}>Settings</DropdownMenu.Item>
|
|
247
|
+
{/if}
|
|
246
248
|
<DropdownMenu.Separator />
|
|
247
249
|
<DropdownMenu.Item class="text-status-error" onSelect={onSignOut}>Sign out</DropdownMenu.Item>
|
|
248
250
|
</DropdownMenu.Content>
|
|
@@ -50,7 +50,7 @@ type $$ComponentProps = {
|
|
|
50
50
|
entitlements?: string[];
|
|
51
51
|
/** Required — the whole reason this slot exists is a stamped app rendering no way to sign out. */
|
|
52
52
|
onSignOut: () => void;
|
|
53
|
-
/**
|
|
53
|
+
/** The "Settings" item, and Settings' one home: the rail has no row for it. Wire it to the app's settings route; absent renders no item. */
|
|
54
54
|
onAccountSettings?: () => void;
|
|
55
55
|
/**
|
|
56
56
|
* Reach the workspace's members surface from here. Ignored while
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
*
|
|
13
13
|
* There is now exactly one composition, no variant prop to choose it: a
|
|
14
14
|
* permanent side rail on md+ (an overlay drawer below it) carrying primary
|
|
15
|
-
* navigation and
|
|
15
|
+
* navigation and the brand, PLUS a
|
|
16
16
|
* real top navbar (search, leading/trailing slots, theme toggle, identity) —
|
|
17
17
|
* always both together. Operator ruling, 31/07/2026: every household app
|
|
18
18
|
* renders one shell shape; apps do not choose variants.
|
|
19
19
|
*
|
|
20
|
-
* The collapse toggle
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
20
|
+
* The collapse toggle is the leading edge of the top bar, before the page's
|
|
21
|
+
* title, with a thin separator after it — where the shadcn sidebar blocks put
|
|
22
|
+
* `Sidebar.Trigger`. The rail's header holds the brand alone, and the foot is
|
|
23
|
+
* left to the app.
|
|
24
24
|
*
|
|
25
25
|
* Search can sit in either of two places, because it reads as a different
|
|
26
26
|
* thing depending on what is beside it. `searchPlacement` defaults to
|
|
@@ -85,13 +85,14 @@
|
|
|
85
85
|
import Menu from '@lucide/svelte/icons/menu';
|
|
86
86
|
import X from '@lucide/svelte/icons/x';
|
|
87
87
|
import Search from '@lucide/svelte/icons/search';
|
|
88
|
-
import
|
|
88
|
+
import MessageSquarePlus from '@lucide/svelte/icons/message-square-plus';
|
|
89
89
|
import Sun from '@lucide/svelte/icons/sun';
|
|
90
90
|
import Moon from '@lucide/svelte/icons/moon';
|
|
91
91
|
import PanelLeftClose from '@lucide/svelte/icons/panel-left-close';
|
|
92
92
|
import PanelLeftOpen from '@lucide/svelte/icons/panel-left-open';
|
|
93
93
|
import AppNav from './app-nav.svelte';
|
|
94
|
-
import {
|
|
94
|
+
import { activeNavTitle, toItems, type NavSource } from './types.js';
|
|
95
|
+
import { shellReport } from './report.svelte.js';
|
|
95
96
|
import { provideShellControls, type ShellControlsSlot } from './controls.js';
|
|
96
97
|
import { cn } from '../../../utils.js';
|
|
97
98
|
import ResizeHandle from '../resize-handle/resize-handle.svelte';
|
|
@@ -110,8 +111,6 @@
|
|
|
110
111
|
context,
|
|
111
112
|
actions,
|
|
112
113
|
identity,
|
|
113
|
-
settingsHref,
|
|
114
|
-
settingsLabel = 'Settings',
|
|
115
114
|
onSearch,
|
|
116
115
|
searchLabel = 'Search…',
|
|
117
116
|
searchShortcut = '⌘K',
|
|
@@ -142,7 +141,7 @@
|
|
|
142
141
|
*/
|
|
143
142
|
currentPath?: string;
|
|
144
143
|
/**
|
|
145
|
-
* Offer an icon-only collapse toggle at the
|
|
144
|
+
* Offer an icon-only collapse toggle at the leading edge of the top bar.
|
|
146
145
|
*
|
|
147
146
|
* Defaults ON. It was opt-in while the control was being introduced, and
|
|
148
147
|
* two of nine household apps opted in — so seven rails could not be
|
|
@@ -174,16 +173,6 @@
|
|
|
174
173
|
* the alternative, rendering it in both, is the duplication this file
|
|
175
174
|
* exists to avoid. */
|
|
176
175
|
identity?: Snippet;
|
|
177
|
-
/** Where the Settings row at the rail's foot links. Absent renders no row.
|
|
178
|
-
* Settings sits at the foot because configuring the app is not navigating
|
|
179
|
-
* it, and the split reads without a label.
|
|
180
|
-
*
|
|
181
|
-
* The app's version does NOT live beside it. A build string earns rail
|
|
182
|
-
* space only if it saves a trip, and it does not: Settings is on screen
|
|
183
|
-
* at every moment and its About section is one click from here, so the
|
|
184
|
-
* line was permanent furniture duplicating the thing directly above it. */
|
|
185
|
-
settingsHref?: string;
|
|
186
|
-
settingsLabel?: string;
|
|
187
176
|
/** Provide to render the search affordance. Usually opens a CommandPalette. */
|
|
188
177
|
onSearch?: () => void;
|
|
189
178
|
searchLabel?: string;
|
|
@@ -235,19 +224,11 @@
|
|
|
235
224
|
|
|
236
225
|
const hasNav = $derived(toItems(nav).length > 0);
|
|
237
226
|
|
|
238
|
-
// The foot's Settings row owns its subtree, matched exactly as a nav `href`
|
|
239
|
-
// is, so the row's own current state and the bar's label cannot disagree.
|
|
240
|
-
const atSettings = $derived(
|
|
241
|
-
!!settingsHref && !!currentPath && matchesPrefix(currentPath, settingsHref)
|
|
242
|
-
);
|
|
243
|
-
|
|
244
227
|
// Where the user is, in words: the rail is icons when collapsed and a closed
|
|
245
|
-
// drawer on a phone, so the bar names the
|
|
246
|
-
//
|
|
247
|
-
// the
|
|
248
|
-
const location = $derived(
|
|
249
|
-
activeNavLabel(nav, currentPath) ?? (atSettings ? settingsLabel : undefined)
|
|
250
|
-
);
|
|
228
|
+
// drawer on a phone, so the bar names the page, "Section › Page" inside a
|
|
229
|
+
// section and the item's one name otherwise. Settings has no row to name: it
|
|
230
|
+
// opens from the account menu, and its own page heads itself.
|
|
231
|
+
const location = $derived(activeNavTitle(nav, currentPath));
|
|
251
232
|
|
|
252
233
|
// The page's scope controls, registered by `<ShellControls>` from the route.
|
|
253
234
|
const controls: ShellControlsSlot = $state({ content: null });
|
|
@@ -303,7 +284,7 @@
|
|
|
303
284
|
// than a flourish. The rail and the drawer are one element carrying one
|
|
304
285
|
// `collapsed` state, so a user who collapsed the rail on a desktop and later
|
|
305
286
|
// opened the menu on a phone was handed a 3.5rem icon-only drawer with no way
|
|
306
|
-
// out — the Collapse control is `md:
|
|
287
|
+
// out — the Collapse control is `md:grid` and does not render at that width.
|
|
307
288
|
// Nesting did not cause that, it raised the stakes: a collapsed rail renders
|
|
308
289
|
// no children, so the phone would have lost the sub-navigation entirely.
|
|
309
290
|
// `mobileNavOpen` implies narrow (the matchMedia effect below is what earns
|
|
@@ -335,6 +316,9 @@
|
|
|
335
316
|
|
|
336
317
|
function peekPointerEnter(event: PointerEvent) {
|
|
337
318
|
if (event.pointerType === 'touch') return;
|
|
319
|
+
// The toggle is in the bar, so a collapse made there leaves the suppression
|
|
320
|
+
// set with the pointer off the rail; coming onto the rail ends it.
|
|
321
|
+
peekSuppressed = false;
|
|
338
322
|
clearTimeout(peekTimer);
|
|
339
323
|
peekTimer = setTimeout(() => (pointerOn = true), PEEK_DELAY_MS);
|
|
340
324
|
}
|
|
@@ -403,8 +387,7 @@
|
|
|
403
387
|
const candidates = [
|
|
404
388
|
...overlay.querySelectorAll<HTMLElement>('a[href], button:not([disabled])')
|
|
405
389
|
].filter((el) => el.tabIndex !== -1);
|
|
406
|
-
// Drop what CSS has hidden —
|
|
407
|
-
// and must not be a tab stop. `getClientRects()` is the check that works
|
|
390
|
+
// Drop what CSS has hidden — anything display:none must not be a tab stop. `getClientRects()` is the check that works
|
|
408
391
|
// against a real layout; where there is no layout engine at all it reports
|
|
409
392
|
// EVERYTHING as hidden, so an empty result means "cannot tell", not "none",
|
|
410
393
|
// and the trap falls back to the unfiltered set rather than silently
|
|
@@ -606,52 +589,7 @@
|
|
|
606
589
|
</button>
|
|
607
590
|
{/if}
|
|
608
591
|
|
|
609
|
-
|
|
610
|
-
The collapse toggle rides the brand row, at the rail's own top edge —
|
|
611
|
-
where a control that acts on the rail belongs (Notion, Linear, GitHub's
|
|
612
|
-
newer nav all put it there), rather than a full-width labelled row at
|
|
613
|
-
the foot that read as a navigation destination. Expanded, it sits right
|
|
614
|
-
of the wordmark (`ml-auto`); collapsed, the head has no room beside the
|
|
615
|
-
mark, so the row becomes a column and the toggle stacks under it,
|
|
616
|
-
centred. A peek keeps that column, the mark and the toggle where the
|
|
617
|
-
slim rail put them: a peeked row half the height pulled every nav row 50px up
|
|
618
|
-
under the pointer, and a click landed on the row below the one aimed
|
|
619
|
-
at (caspo#177). `md:grid` keeps it off the mobile drawer, where
|
|
620
|
-
collapse does not apply — the same reason the foot control carried
|
|
621
|
-
`md:flex`.
|
|
622
|
-
-->
|
|
623
|
-
{#if collapsible}
|
|
624
|
-
<div
|
|
625
|
-
class={cn(
|
|
626
|
-
'flex',
|
|
627
|
-
railCollapsed ? 'flex-col gap-1 py-2' : 'items-center pr-2',
|
|
628
|
-
railNarrow && 'items-center'
|
|
629
|
-
)}
|
|
630
|
-
>
|
|
631
|
-
{@render brandLockup()}
|
|
632
|
-
<button
|
|
633
|
-
type="button"
|
|
634
|
-
onclick={toggleCollapsed}
|
|
635
|
-
class={cn(
|
|
636
|
-
'text-shell-muted-foreground hover:text-shell-foreground hidden size-8 flex-none place-items-center rounded-md transition-colors md:grid',
|
|
637
|
-
!railCollapsed && 'ml-auto',
|
|
638
|
-
railCollapsed && !railNarrow && 'ml-3'
|
|
639
|
-
)}
|
|
640
|
-
aria-label={collapseLabel}
|
|
641
|
-
aria-pressed={collapsed}
|
|
642
|
-
title={`${collapseLabel} (press [)`}
|
|
643
|
-
data-testid="ds-rail-collapse"
|
|
644
|
-
>
|
|
645
|
-
{#if collapsed}
|
|
646
|
-
<PanelLeftOpen class="size-4" />
|
|
647
|
-
{:else}
|
|
648
|
-
<PanelLeftClose class="size-4" />
|
|
649
|
-
{/if}
|
|
650
|
-
</button>
|
|
651
|
-
</div>
|
|
652
|
-
{:else}
|
|
653
|
-
{@render brandLockup()}
|
|
654
|
-
{/if}
|
|
592
|
+
{@render brandLockup()}
|
|
655
593
|
<AppNav
|
|
656
594
|
{nav}
|
|
657
595
|
{currentPath}
|
|
@@ -662,30 +600,25 @@
|
|
|
662
600
|
/>
|
|
663
601
|
|
|
664
602
|
<!--
|
|
665
|
-
The
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
where you configure the app, and which build you are looking at.
|
|
669
|
-
|
|
670
|
-
Settings is a nav row like any other and takes the same active and
|
|
671
|
-
hover treatment, because it IS a destination — it is last rather
|
|
672
|
-
than separate because configuring the app is not navigating it.
|
|
673
|
-
The version is not a row: no icon, no tile, no hover, one muted
|
|
674
|
-
line, so it reads as metadata and never competes for a click.
|
|
603
|
+
The drawer's foot: the one place feedback sits on a phone, where nothing
|
|
604
|
+
floats over the page. From md it is the bar's icon. Settings is the
|
|
605
|
+
account menu's, never a row here.
|
|
675
606
|
-->
|
|
676
|
-
{#if
|
|
607
|
+
{#if mobileNavOpen && shellReport.open}
|
|
677
608
|
<div class="ds-shell-rail-foot mt-auto">
|
|
678
|
-
<
|
|
679
|
-
|
|
680
|
-
class="ds-nav-item"
|
|
681
|
-
|
|
682
|
-
onclick={() =>
|
|
609
|
+
<button
|
|
610
|
+
type="button"
|
|
611
|
+
class="ds-nav-item w-full"
|
|
612
|
+
data-testid="ds-shell-drawer-report"
|
|
613
|
+
onclick={() => {
|
|
614
|
+
const open = shellReport.open;
|
|
615
|
+
closeMobileNav();
|
|
616
|
+
open?.();
|
|
617
|
+
}}
|
|
683
618
|
>
|
|
684
|
-
<
|
|
685
|
-
<span class=
|
|
686
|
-
|
|
687
|
-
</span>
|
|
688
|
-
</a>
|
|
619
|
+
<MessageSquarePlus class="ds-nav-icon size-[1.125rem] flex-none" aria-hidden="true" />
|
|
620
|
+
<span class="truncate">Report a problem</span>
|
|
621
|
+
</button>
|
|
689
622
|
</div>
|
|
690
623
|
{/if}
|
|
691
624
|
{#if collapsible && !railCollapsed && !mobileNavOpen}
|
|
@@ -735,6 +668,35 @@
|
|
|
735
668
|
</button>
|
|
736
669
|
{/if}
|
|
737
670
|
|
|
671
|
+
<!--
|
|
672
|
+
The collapse toggle is the leading edge of the bar, before the page's
|
|
673
|
+
title and a thin separator after it: where the shadcn sidebar blocks put
|
|
674
|
+
`Sidebar.Trigger`, so the rail's header holds the brand alone. `md:grid`
|
|
675
|
+
keeps it off the phone, where the drawer has its own trigger.
|
|
676
|
+
-->
|
|
677
|
+
{#if collapsible}
|
|
678
|
+
<button
|
|
679
|
+
type="button"
|
|
680
|
+
onclick={toggleCollapsed}
|
|
681
|
+
class="text-shell-muted-foreground hover:text-shell-foreground -ml-1 hidden size-8 flex-none place-items-center rounded-md transition-colors md:grid"
|
|
682
|
+
aria-label={collapseLabel}
|
|
683
|
+
aria-pressed={collapsed}
|
|
684
|
+
title={`${collapseLabel} (press [)`}
|
|
685
|
+
data-testid="ds-rail-collapse"
|
|
686
|
+
>
|
|
687
|
+
{#if collapsed}
|
|
688
|
+
<PanelLeftOpen class="size-4" />
|
|
689
|
+
{:else}
|
|
690
|
+
<PanelLeftClose class="size-4" />
|
|
691
|
+
{/if}
|
|
692
|
+
</button>
|
|
693
|
+
<span
|
|
694
|
+
class="bg-border hidden h-4 w-px flex-none md:block"
|
|
695
|
+
aria-hidden="true"
|
|
696
|
+
data-testid="ds-rail-collapse-separator"
|
|
697
|
+
></span>
|
|
698
|
+
{/if}
|
|
699
|
+
|
|
738
700
|
<!-- The rail carries the brand on md+; below md the rail is gone, so the
|
|
739
701
|
bar carries it or the app loses its identity on a phone entirely. -->
|
|
740
702
|
<span class={hasNav ? 'flex md:hidden' : 'flex'}>
|
|
@@ -758,25 +720,33 @@
|
|
|
758
720
|
<!-- Where you are, then the page's scope controls. Inline with the
|
|
759
721
|
rest of the bar from xl; below that, controls take a second row
|
|
760
722
|
of the bar, and a bare label shows from md and not on a phone. -->
|
|
723
|
+
<!-- Where you are, then the page's scope controls. From sm they share one
|
|
724
|
+
row, inline from xl and on the bar's second row below it. On a phone
|
|
725
|
+
the wrapper steps aside (`contents`): the title takes the free room
|
|
726
|
+
of the first row, truncated, and the controls take the second row
|
|
727
|
+
whole. -->
|
|
761
728
|
{#if location || controls.content}
|
|
762
729
|
<div
|
|
763
730
|
class={cn(
|
|
764
|
-
'flex min-w-0 items-center gap-2 sm:gap-3',
|
|
765
|
-
controls.content
|
|
766
|
-
? 'order-last basis-full xl:order-none xl:basis-auto'
|
|
767
|
-
: 'hidden md:flex'
|
|
731
|
+
'flex min-w-0 items-center gap-2 max-sm:contents sm:gap-3',
|
|
732
|
+
controls.content && 'sm:order-last sm:basis-full xl:order-none xl:basis-auto'
|
|
768
733
|
)}
|
|
769
734
|
data-testid="ds-shell-location"
|
|
770
735
|
>
|
|
771
736
|
{#if location}
|
|
772
737
|
<span
|
|
773
|
-
class=
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
738
|
+
class="text-shell-muted-foreground min-w-0 truncate text-sm max-sm:flex-1 max-sm:basis-0 sm:max-w-72"
|
|
739
|
+
title={location}>{location}</span
|
|
740
|
+
>
|
|
741
|
+
{/if}
|
|
742
|
+
{#if controls.content}
|
|
743
|
+
<div
|
|
744
|
+
class="flex min-w-0 items-center gap-2 max-sm:order-last max-sm:basis-full sm:gap-3"
|
|
745
|
+
data-testid="ds-shell-controls"
|
|
777
746
|
>
|
|
747
|
+
{@render controls.content()}
|
|
748
|
+
</div>
|
|
778
749
|
{/if}
|
|
779
|
-
{#if controls.content}{@render controls.content()}{/if}
|
|
780
750
|
</div>
|
|
781
751
|
{/if}
|
|
782
752
|
|
|
@@ -793,6 +763,21 @@
|
|
|
793
763
|
)}
|
|
794
764
|
{/if}
|
|
795
765
|
|
|
766
|
+
<!-- Feedback has one home: here from md, the drawer's foot on a phone.
|
|
767
|
+
Shown only while a ReportWidget is mounted to open. -->
|
|
768
|
+
{#if shellReport.open}
|
|
769
|
+
<button
|
|
770
|
+
type="button"
|
|
771
|
+
onclick={() => shellReport.open?.()}
|
|
772
|
+
class="border-border text-shell-muted-foreground hover:text-shell-foreground hidden size-9 flex-none place-items-center rounded-md border transition-colors md:grid"
|
|
773
|
+
aria-label="Report a problem"
|
|
774
|
+
title="Report a problem"
|
|
775
|
+
data-testid="ds-shell-report"
|
|
776
|
+
>
|
|
777
|
+
<MessageSquarePlus class="size-4" />
|
|
778
|
+
</button>
|
|
779
|
+
{/if}
|
|
780
|
+
|
|
796
781
|
{#if actions}{@render actions()}{/if}
|
|
797
782
|
|
|
798
783
|
{#if themeToggle}
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
*
|
|
12
12
|
* There is now exactly one composition, no variant prop to choose it: a
|
|
13
13
|
* permanent side rail on md+ (an overlay drawer below it) carrying primary
|
|
14
|
-
* navigation and
|
|
14
|
+
* navigation and the brand, PLUS a
|
|
15
15
|
* real top navbar (search, leading/trailing slots, theme toggle, identity) —
|
|
16
16
|
* always both together. Operator ruling, 31/07/2026: every household app
|
|
17
17
|
* renders one shell shape; apps do not choose variants.
|
|
18
18
|
*
|
|
19
|
-
* The collapse toggle
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* The collapse toggle is the leading edge of the top bar, before the page's
|
|
20
|
+
* title, with a thin separator after it — where the shadcn sidebar blocks put
|
|
21
|
+
* `Sidebar.Trigger`. The rail's header holds the brand alone, and the foot is
|
|
22
|
+
* left to the app.
|
|
23
23
|
*
|
|
24
24
|
* Search can sit in either of two places, because it reads as a different
|
|
25
25
|
* thing depending on what is beside it. `searchPlacement` defaults to
|
|
@@ -99,7 +99,7 @@ type $$ComponentProps = {
|
|
|
99
99
|
*/
|
|
100
100
|
currentPath?: string;
|
|
101
101
|
/**
|
|
102
|
-
* Offer an icon-only collapse toggle at the
|
|
102
|
+
* Offer an icon-only collapse toggle at the leading edge of the top bar.
|
|
103
103
|
*
|
|
104
104
|
* Defaults ON. It was opt-in while the control was being introduced, and
|
|
105
105
|
* two of nine household apps opted in — so seven rails could not be
|
|
@@ -131,16 +131,6 @@ type $$ComponentProps = {
|
|
|
131
131
|
* the alternative, rendering it in both, is the duplication this file
|
|
132
132
|
* exists to avoid. */
|
|
133
133
|
identity?: Snippet;
|
|
134
|
-
/** Where the Settings row at the rail's foot links. Absent renders no row.
|
|
135
|
-
* Settings sits at the foot because configuring the app is not navigating
|
|
136
|
-
* it, and the split reads without a label.
|
|
137
|
-
*
|
|
138
|
-
* The app's version does NOT live beside it. A build string earns rail
|
|
139
|
-
* space only if it saves a trip, and it does not: Settings is on screen
|
|
140
|
-
* at every moment and its About section is one click from here, so the
|
|
141
|
-
* line was permanent furniture duplicating the thing directly above it. */
|
|
142
|
-
settingsHref?: string;
|
|
143
|
-
settingsLabel?: string;
|
|
144
134
|
/** Provide to render the search affordance. Usually opens a CommandPalette. */
|
|
145
135
|
onSearch?: () => void;
|
|
146
136
|
searchLabel?: string;
|
|
@@ -4,4 +4,4 @@ export { default as ShellControls } from './shell-controls.svelte';
|
|
|
4
4
|
export { default } from './app-shell.svelte';
|
|
5
5
|
export { SHELL_MEASURES, type ShellMeasure } from './measure.js';
|
|
6
6
|
export { SHELL_TEXTURES, type ShellTexture } from './texture.js';
|
|
7
|
-
export {
|
|
7
|
+
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, navChildren, toGroups, toItems, type IconComponent, type NavChildItem, type NavEntry, type NavGroup, type NavItem, type NavSource } from './types.js';
|
|
@@ -4,4 +4,4 @@ export { default as ShellControls } from './shell-controls.svelte';
|
|
|
4
4
|
export { default } from './app-shell.svelte';
|
|
5
5
|
export { SHELL_MEASURES } from './measure.js';
|
|
6
6
|
export { SHELL_TEXTURES } from './texture.js';
|
|
7
|
-
export {
|
|
7
|
+
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, navChildren, toGroups, toItems } from './types.js';
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
* The bottom pad carries `env(safe-area-inset-bottom)` so the last row of a page
|
|
18
18
|
* clears a home-indicator gesture bar.
|
|
19
19
|
*
|
|
20
|
-
* The trailing `::after` is `--ds-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* The trailing `::after` is `--ds-float-reserve`, the room a page's own floating
|
|
21
|
+
* control (ContextColumn's opener) declares, so its last row can scroll clear.
|
|
22
|
+
* Nothing of the shell's floats: feedback is the bar's and the drawer's. An
|
|
23
|
+
* element rather than padding: a page taller than the content area overflows
|
|
24
|
+
* this box, which leaves its padding behind at the area's foot, while a last
|
|
25
|
+
* flex item follows the overflow to its end.
|
|
25
26
|
*/
|
|
26
|
-
export declare const CONTENT_PADDING = "px-4 pt-5 pb-[calc(1.25rem+env(safe-area-inset-bottom))] sm:px-6 md:px-8 md:pt-7 md:pb-[calc(1.75rem+env(safe-area-inset-bottom))] 2xl:px-12 after:block after:flex-none after:h-[var(--ds-
|
|
27
|
+
export declare const CONTENT_PADDING = "px-4 pt-5 pb-[calc(1.25rem+env(safe-area-inset-bottom))] sm:px-6 md:px-8 md:pt-7 md:pb-[calc(1.75rem+env(safe-area-inset-bottom))] 2xl:px-12 after:block after:flex-none after:h-[var(--ds-float-reserve,0px)]";
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
* The bottom pad carries `env(safe-area-inset-bottom)` so the last row of a page
|
|
18
18
|
* clears a home-indicator gesture bar.
|
|
19
19
|
*
|
|
20
|
-
* The trailing `::after` is `--ds-
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* The trailing `::after` is `--ds-float-reserve`, the room a page's own floating
|
|
21
|
+
* control (ContextColumn's opener) declares, so its last row can scroll clear.
|
|
22
|
+
* Nothing of the shell's floats: feedback is the bar's and the drawer's. An
|
|
23
|
+
* element rather than padding: a page taller than the content area overflows
|
|
24
|
+
* this box, which leaves its padding behind at the area's foot, while a last
|
|
25
|
+
* flex item follows the overflow to its end.
|
|
25
26
|
*/
|
|
26
|
-
export const CONTENT_PADDING = 'px-4 pt-5 pb-[calc(1.25rem+env(safe-area-inset-bottom))] sm:px-6 md:px-8 md:pt-7 md:pb-[calc(1.75rem+env(safe-area-inset-bottom))] 2xl:px-12 after:block after:flex-none after:h-[var(--ds-
|
|
27
|
+
export const CONTENT_PADDING = 'px-4 pt-5 pb-[calc(1.25rem+env(safe-area-inset-bottom))] sm:px-6 md:px-8 md:pt-7 md:pb-[calc(1.75rem+env(safe-area-inset-bottom))] 2xl:px-12 after:block after:flex-none after:h-[var(--ds-float-reserve,0px)]';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell's one feedback door. `ReportWidget` owns the dialogue and, while
|
|
3
|
+
* mounted, registers how to open it here; `AppShell` draws the trigger: an icon
|
|
4
|
+
* in the bar from md, a row in the phone's drawer. The widget is mounted by the
|
|
5
|
+
* app's layout beside the shell rather than inside it, so a context could not
|
|
6
|
+
* join them; this module-level slot does, and there is no wiring for an app.
|
|
7
|
+
*/
|
|
8
|
+
export declare const shellReport: {
|
|
9
|
+
open: (() => void) | null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell's one feedback door. `ReportWidget` owns the dialogue and, while
|
|
3
|
+
* mounted, registers how to open it here; `AppShell` draws the trigger: an icon
|
|
4
|
+
* in the bar from md, a row in the phone's drawer. The widget is mounted by the
|
|
5
|
+
* app's layout beside the shell rather than inside it, so a context could not
|
|
6
|
+
* join them; this module-level slot does, and there is no wiring for an app.
|
|
7
|
+
*/
|
|
8
|
+
export const shellReport = $state({ open: null });
|
|
@@ -151,9 +151,11 @@ export declare function isNavItemActive(item: NavItem, currentPath: string | und
|
|
|
151
151
|
* when the children live at their own top-level routes.
|
|
152
152
|
*/
|
|
153
153
|
export declare function hasActiveNavChild(item: NavItem, currentPath: string | undefined): boolean;
|
|
154
|
+
/** What the bar puts between a section and its page: "Securities › Trading". */
|
|
155
|
+
export declare const TITLE_SEPARATOR = " \u203A ";
|
|
154
156
|
/**
|
|
155
|
-
* The
|
|
156
|
-
* the
|
|
157
|
-
* renders no
|
|
157
|
+
* The bar's title for where the user is: "Section › Page" inside a section that
|
|
158
|
+
* discloses children, the item's one name for a top-level page. Undefined when
|
|
159
|
+
* nothing matches, so an unlisted route renders no title rather than a wrong one.
|
|
158
160
|
*/
|
|
159
|
-
export declare function
|
|
161
|
+
export declare function activeNavTitle(nav: NavSource | undefined, currentPath: string | undefined): string | undefined;
|
|
@@ -110,18 +110,20 @@ export function hasActiveNavChild(item, currentPath) {
|
|
|
110
110
|
return false;
|
|
111
111
|
return navChildren(item).some((child) => isNavItemActive(child, currentPath));
|
|
112
112
|
}
|
|
113
|
+
/** What the bar puts between a section and its page: "Securities › Trading". */
|
|
114
|
+
export const TITLE_SEPARATOR = ' › ';
|
|
113
115
|
/**
|
|
114
|
-
* The
|
|
115
|
-
* the
|
|
116
|
-
* renders no
|
|
116
|
+
* The bar's title for where the user is: "Section › Page" inside a section that
|
|
117
|
+
* discloses children, the item's one name for a top-level page. Undefined when
|
|
118
|
+
* nothing matches, so an unlisted route renders no title rather than a wrong one.
|
|
117
119
|
*/
|
|
118
|
-
export function
|
|
120
|
+
export function activeNavTitle(nav, currentPath) {
|
|
119
121
|
if (!currentPath)
|
|
120
122
|
return undefined;
|
|
121
123
|
for (const item of toItems(nav)) {
|
|
122
124
|
const child = navChildren(item).find((c) => isNavItemActive(c, currentPath));
|
|
123
125
|
if (child)
|
|
124
|
-
return child.label
|
|
126
|
+
return `${item.label}${TITLE_SEPARATOR}${child.label}`;
|
|
125
127
|
if (isNavItemActive(item, currentPath))
|
|
126
128
|
return item.label;
|
|
127
129
|
}
|
|
@@ -103,6 +103,25 @@
|
|
|
103
103
|
observer.observe(parent);
|
|
104
104
|
return () => observer.disconnect();
|
|
105
105
|
});
|
|
106
|
+
// Below xl the opener floats over the page's corner, so the shell ends its
|
|
107
|
+
// padded content with room for it (`--ds-float-reserve`, read by
|
|
108
|
+
// CONTENT_PADDING) and a list scrolled to its end clears it. The opener's top
|
|
109
|
+
// edge sits 3.75rem up; 4.5rem leaves a gap, less any lift a page control sets.
|
|
110
|
+
$effect(() => {
|
|
111
|
+
if (typeof window === 'undefined' || !window.matchMedia) return;
|
|
112
|
+
const narrow = window.matchMedia('(max-width: 79.99rem)');
|
|
113
|
+
const root = document.documentElement;
|
|
114
|
+
const sync = () =>
|
|
115
|
+
narrow.matches
|
|
116
|
+
? root.style.setProperty('--ds-float-reserve', 'calc(4.5rem - var(--ds-report-clearance, 0px))')
|
|
117
|
+
: root.style.removeProperty('--ds-float-reserve');
|
|
118
|
+
sync();
|
|
119
|
+
narrow.addEventListener('change', sync);
|
|
120
|
+
return () => {
|
|
121
|
+
narrow.removeEventListener('change', sync);
|
|
122
|
+
root.style.removeProperty('--ds-float-reserve');
|
|
123
|
+
};
|
|
124
|
+
});
|
|
106
125
|
/** Room for the document beside the column, not in its place. */
|
|
107
126
|
const BESIDE = 1250;
|
|
108
127
|
const beside = $derived(row !== null && row >= BESIDE);
|
|
@@ -169,14 +188,12 @@
|
|
|
169
188
|
package's usual 36px control row: this is the one control whose entire
|
|
170
189
|
job is making otherwise-unreachable content reachable, so it earns the
|
|
171
190
|
full touch-target minimum rather than the shell's ordinary density.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
neither covers the other and both stay in the band the shell reserves at
|
|
175
|
-
the content's end. -->
|
|
191
|
+
It lifts by `--ds-report-clearance` when a page control (the librarian
|
|
192
|
+
composer) shares the corner. -->
|
|
176
193
|
<button
|
|
177
194
|
type="button"
|
|
178
195
|
onclick={() => (sheetOpen = true)}
|
|
179
|
-
class="border-border bg-card text-muted-foreground hover:text-foreground ds-edge fixed right-
|
|
196
|
+
class="border-border bg-card text-muted-foreground hover:text-foreground ds-edge fixed right-4 bottom-[calc(1rem+var(--ds-report-clearance,0px)+env(safe-area-inset-bottom))] z-30 grid size-11 flex-none place-items-center rounded-full border xl:hidden"
|
|
180
197
|
aria-label="Open {name}"
|
|
181
198
|
>
|
|
182
199
|
<PanelRight class="size-4.5" />
|
package/dist/styles.css
CHANGED
|
@@ -837,12 +837,11 @@
|
|
|
837
837
|
padding-left: calc(0.625rem + 1px);
|
|
838
838
|
}
|
|
839
839
|
|
|
840
|
-
/* The
|
|
841
|
-
Separated from the scrolling section list by a rule in the chrome's OWN
|
|
840
|
+
/* The drawer's foot: feedback, on a phone. Separated from the scrolling section list by a rule in the chrome's OWN
|
|
842
841
|
ink rather than `--border`, for the reason the group guide takes the same
|
|
843
842
|
treatment — a page-surface token cannot follow chrome an app has branded. */
|
|
844
843
|
/* `padding-inline` matches `.ds-nav`'s own `px-3`, because the foot sits
|
|
845
|
-
OUTSIDE that wrapper: without it the
|
|
844
|
+
OUTSIDE that wrapper: without it the row's icon lands 0.75rem
|
|
846
845
|
left of every icon above it and the rail reads as two lists. */
|
|
847
846
|
.ds-shell-rail-foot {
|
|
848
847
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.26",
|
|
4
4
|
"description": "Household shared component layer: shadcn-svelte primitives (bits-ui) plus the composed page chrome every app builds its routes from, restyled by each app's @poodle64/design-tokens alias layer. One fix reaches every app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @poodle64/ui — situation → component map
|
|
2
2
|
|
|
3
3
|
<!-- GENERATED by scripts/generate-registry.mjs from scripts/situations.json + package source. DO NOT EDIT. -->
|
|
4
|
-
Generated from `@poodle64/ui@2026.10.
|
|
4
|
+
Generated from `@poodle64/ui@2026.10.26`. 76 components, 20 situations.
|
|
5
5
|
|
|
6
6
|
**Read this before writing a `<div>`.** Find the SITUATION you are in below, then compose the component named for it — do not hand-build it from raw `Card` or utility classes. Import is `import { Name } from '<import path>'`. Props marked `?` are optional. This map is the retrieval step the [`frontend-design` skill] makes mandatory; the [CHI 2026 study] measured composing-from-a-registry at 95% design-system compliance against 71% for writing the CSS from a prose style guide.
|
|
7
7
|
|