@poodle64/ui 2026.10.25 → 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 +19 -13
- 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 +55 -56
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +0 -10
- 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
|
|
@@ -184,8 +184,13 @@ That is the whole minimum. Everything below is optional.
|
|
|
184
184
|
| `texture` | The house atmosphere on the content region. Defaults to `grid`; `none` is the opt-out. |
|
|
185
185
|
| `padded`, `mainClass` | Padding, and extra classes on the scrolling content container. |
|
|
186
186
|
|
|
187
|
-
The bar also names where you are
|
|
188
|
-
|
|
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
|
|
189
194
|
with `ShellControls`; they render after the location, inline from `xl` and on
|
|
190
195
|
a second row of the bar below that:
|
|
191
196
|
|
|
@@ -355,7 +360,7 @@ section you are reading, both panes scrolling independently from `md`.
|
|
|
355
360
|
|
|
356
361
|
<!-- padded={false}: the list's rule and tint have to reach the content area's
|
|
357
362
|
edges, and SettingsShell pads its own content pane to the same rhythm. -->
|
|
358
|
-
<AppShell {nav} currentPath={page.url.pathname}
|
|
363
|
+
<AppShell {nav} currentPath={page.url.pathname} padded={false}>
|
|
359
364
|
<SettingsShell {sections} currentPath={page.url.pathname}>
|
|
360
365
|
{@render children()}
|
|
361
366
|
</SettingsShell>
|
|
@@ -1621,8 +1626,8 @@ trace id. The faro packages are `dependencies`, not peers, for the same reason
|
|
|
1621
1626
|
`bits-ui` is a peer: a duplicated Faro global would strand the session id the
|
|
1622
1627
|
feedback widget reports against.
|
|
1623
1628
|
|
|
1624
|
-
`ReportWidget` is the user-facing other half:
|
|
1625
|
-
|
|
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
|
|
1626
1631
|
screenshot checkbox (on by default) that captures `document.body` with
|
|
1627
1632
|
`html-to-image`. A capture the page cannot produce is tolerated silently: the
|
|
1628
1633
|
report sends with a null image rather than not at all. Submitting POSTs one
|
|
@@ -1653,12 +1658,13 @@ routes by situation, so it stands outside the situation→component registry
|
|
|
1653
1658
|
for the same reason. `getSessionId()` reading null when telemetry is off is
|
|
1654
1659
|
ordinary, not an error: the report sends with a null `session_id`.
|
|
1655
1660
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
(`
|
|
1661
|
-
|
|
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.
|
|
1662
1668
|
|
|
1663
1669
|
## The alerts bell
|
|
1664
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
|
|
@@ -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',
|
|
@@ -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 });
|
|
@@ -619,30 +600,25 @@
|
|
|
619
600
|
/>
|
|
620
601
|
|
|
621
602
|
<!--
|
|
622
|
-
The
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
where you configure the app, and which build you are looking at.
|
|
626
|
-
|
|
627
|
-
Settings is a nav row like any other and takes the same active and
|
|
628
|
-
hover treatment, because it IS a destination — it is last rather
|
|
629
|
-
than separate because configuring the app is not navigating it.
|
|
630
|
-
The version is not a row: no icon, no tile, no hover, one muted
|
|
631
|
-
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.
|
|
632
606
|
-->
|
|
633
|
-
{#if
|
|
607
|
+
{#if mobileNavOpen && shellReport.open}
|
|
634
608
|
<div class="ds-shell-rail-foot mt-auto">
|
|
635
|
-
<
|
|
636
|
-
|
|
637
|
-
class="ds-nav-item"
|
|
638
|
-
|
|
639
|
-
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
|
+
}}
|
|
640
618
|
>
|
|
641
|
-
<
|
|
642
|
-
<span class=
|
|
643
|
-
|
|
644
|
-
</span>
|
|
645
|
-
</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>
|
|
646
622
|
</div>
|
|
647
623
|
{/if}
|
|
648
624
|
{#if collapsible && !railCollapsed && !mobileNavOpen}
|
|
@@ -744,25 +720,33 @@
|
|
|
744
720
|
<!-- Where you are, then the page's scope controls. Inline with the
|
|
745
721
|
rest of the bar from xl; below that, controls take a second row
|
|
746
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. -->
|
|
747
728
|
{#if location || controls.content}
|
|
748
729
|
<div
|
|
749
730
|
class={cn(
|
|
750
|
-
'flex min-w-0 items-center gap-2 sm:gap-3',
|
|
751
|
-
controls.content
|
|
752
|
-
? 'order-last basis-full xl:order-none xl:basis-auto'
|
|
753
|
-
: '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'
|
|
754
733
|
)}
|
|
755
734
|
data-testid="ds-shell-location"
|
|
756
735
|
>
|
|
757
736
|
{#if location}
|
|
758
737
|
<span
|
|
759
|
-
class=
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
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"
|
|
763
746
|
>
|
|
747
|
+
{@render controls.content()}
|
|
748
|
+
</div>
|
|
764
749
|
{/if}
|
|
765
|
-
{#if controls.content}{@render controls.content()}{/if}
|
|
766
750
|
</div>
|
|
767
751
|
{/if}
|
|
768
752
|
|
|
@@ -779,6 +763,21 @@
|
|
|
779
763
|
)}
|
|
780
764
|
{/if}
|
|
781
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
|
+
|
|
782
781
|
{#if actions}{@render actions()}{/if}
|
|
783
782
|
|
|
784
783
|
{#if themeToggle}
|
|
@@ -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
|
|