@poodle64/ui 2026.10.25 → 2026.10.27
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 +142 -182
- package/dist/components/feedback/report-widget.svelte +8 -33
- package/dist/components/ui/app-dialog/app-dialog.svelte +2 -1
- 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 +300 -147
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +15 -37
- package/dist/components/ui/app-shell/column-scope.svelte +15 -0
- package/dist/components/ui/app-shell/column-scope.svelte.d.ts +12 -0
- package/dist/components/ui/app-shell/index.d.ts +4 -2
- package/dist/components/ui/app-shell/index.js +4 -2
- package/dist/components/ui/app-shell/page-aside.svelte +58 -0
- package/dist/components/ui/app-shell/page-aside.svelte.d.ts +30 -0
- package/dist/components/ui/app-shell/page-pane.svelte +73 -0
- package/dist/components/ui/app-shell/page-pane.svelte.d.ts +37 -0
- package/dist/components/ui/app-shell/page.d.ts +77 -0
- package/dist/components/ui/app-shell/page.js +45 -0
- 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/collection-detail/collection-detail.svelte +1 -1
- package/dist/components/ui/content-skeleton/content-skeleton.svelte +1 -1
- package/dist/components/ui/context-column/context-column.svelte +47 -129
- package/dist/components/ui/context-column/context-column.svelte.d.ts +3 -5
- package/dist/components/ui/document-reader/document-reader.svelte +56 -24
- package/dist/components/ui/document-reader/document-reader.svelte.d.ts +5 -4
- package/dist/components/ui/page-section/page-section.svelte +1 -1
- package/dist/components/ui/panel/panel.svelte +1 -0
- package/dist/components/ui/settings-shell/settings-shell.svelte +67 -81
- package/dist/components/ui/settings-shell/settings-shell.svelte.d.ts +21 -60
- package/dist/styles.css +248 -120
- package/package.json +1 -1
- package/registry/component-map.json +22 -15
- package/registry/component-map.md +8 -7
- package/dist/components/ui/app-shell/measure.d.ts +0 -28
- package/dist/components/ui/app-shell/measure.js +0 -21
- package/dist/components/ui/app-shell/padding.d.ts +0 -26
- package/dist/components/ui/app-shell/padding.js +0 -26
- package/dist/components/ui/list-shell/index.d.ts +0 -2
- package/dist/components/ui/list-shell/index.js +0 -2
- package/dist/components/ui/list-shell/list-shell.svelte +0 -85
- package/dist/components/ui/list-shell/list-shell.svelte.d.ts +0 -39
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
|
|
@@ -96,7 +96,7 @@ rather than rebuilding it:
|
|
|
96
96
|
| `breadcrumbs` | The trail: `items` of `{ label, href? }`, a named landmark, chevrons, each step truncating rather than wrapping. PageHeader draws it from `breadcrumbs={[…]}`. See [The page](#the-page-container-sections-and-the-type-scale). |
|
|
97
97
|
| `page-container` | A route's page at the one rhythm: header, sections and panels 1.5rem apart, filling the content box. |
|
|
98
98
|
| `page-section` | A section of a page: `title` at `level` 2 or 3, an optional `description`, `count` and `actions`, and its content at one distance below. |
|
|
99
|
-
| `document-reader` | A document to read: PageHeader, the body (`html` the app sanitised, or `children`) in `.ds-prose
|
|
99
|
+
| `document-reader` | A document to read: PageHeader, the body (`html` the app sanitised, or `children`) in `.ds-prose`, and a contents list from its own headings, which a shell places as the page's aside. See [A document to read](#a-document-to-read). |
|
|
100
100
|
| `content-skeleton` | A region loading, shaped like what replaces it: `rows`, `tiles` or `prose`. A whole page waiting is LoadingState. |
|
|
101
101
|
| `panel` | The generic titled card, and the settings section: optional icon, a short `subtitle` or a longer `description`, both wrapping, trailing `action`s, a body that can opt out of padding or scroll inside the card (`scroll`), an optional `footer` strip for Save/Cancel, and `tone="destructive"` for a danger zone. There is no `SettingsSection`; see [The settings destination](#the-settings-destination). |
|
|
102
102
|
| `list-toolbar` | The bar above a list, on the page ground: title, count (both wrap when crowded, after the controls drop to their own line), icon actions named by their tooltips, one labelled action. The Ledger and the RecordList draw theirs with it. |
|
|
@@ -105,8 +105,8 @@ rather than rebuilding it:
|
|
|
105
105
|
| `document-pane` | One document beside what it belongs to: titled, closable, its page fitted, with paging and zoom (a `PageCanvas` in a `Panel`). |
|
|
106
106
|
| `detail-panel` | The entity-detail surface: header with icon/eyebrow/title/`StatusBadge`/close, scrollable body, footer of actions. |
|
|
107
107
|
| `about` | About content for a page or dialogue: `name`, `version`, optional `description`/`brand`/`links`, and explicitly selected non-sensitive `diagnostics`. Never pass settings or environment objects. `writeClipboard` accepts the host clipboard API directly; otherwise the browser API is used. Mount the shared Toaster once for copy success/failure. |
|
|
108
|
-
| `settings-shell` | The settings destination:
|
|
109
|
-
| `context-column` | The
|
|
108
|
+
| `settings-shell` | The settings destination: its grouped section list of `NavItem` rows is a `panel` page's pane (`PagePane`), the section you are reading the page beside it, and the bar names "Settings › Section". The route declares `pageType: 'panel'`. See [The settings destination](#the-settings-destination). |
|
|
109
|
+
| `context-column` | The page's right-hand context, as its aside (`PageAside`). A list page's: a standing `StatList` plus an optional detail that flows in on select. A record page's (`title`, `children`): the one opened item, closable, scrolling inside itself, and its `documentPane` in the item's place. The page type places it; below the aside's width it opens from the bar as a sheet. See [A record's page](#a-records-page). |
|
|
110
110
|
| `app-dialog` | The dialogue frame: titled header, scrollable body, footer action bar, five sizes (`xs`…`xl`), and an `onOpenChange` for the dismissals the caller did not drive. |
|
|
111
111
|
| `dialog-section` | One section of a dialogue body; adjacent sections are divided automatically. |
|
|
112
112
|
| `stat-card` | A single metric that earns its space (label, value, unit, sub, status dot, and `valueTone` to colour the figure itself). |
|
|
@@ -143,8 +143,8 @@ a permanent side rail on `md`+ (an overlay drawer below it) carrying primary
|
|
|
143
143
|
navigation and the brand, **plus** a real top navbar (the collapse toggle at
|
|
144
144
|
its leading edge, search,
|
|
145
145
|
leading/trailing slots, theme toggle, identity), always both together, with
|
|
146
|
-
content
|
|
147
|
-
or spacing.
|
|
146
|
+
the content laid out by the page's type (`reading`, `panel` or `tool`; see
|
|
147
|
+
[Page types](#page-types)). Apps do not choose variants, widths or spacing.
|
|
148
148
|
|
|
149
149
|
Everything the apps otherwise differed on turned out to be a slot, not a variant.
|
|
150
150
|
The package therefore imports no app store, no app route and no app brand:
|
|
@@ -180,12 +180,17 @@ That is the whole minimum. Everything below is optional.
|
|
|
180
180
|
| `banner` | Full-width region under the bar: reconnect notices, trial warnings. |
|
|
181
181
|
| `onSearch`, `searchLabel`, `searchShortcut` | Provide `onSearch` to render the search affordance at all. |
|
|
182
182
|
| `themeToggle`, `onToggleTheme` | Defaults to `mode-watcher`. Set `themeToggle={false}` when the app puts theming inside its own user menu. |
|
|
183
|
-
| `
|
|
183
|
+
| `pageType` | What the route is: `reading` (the default), `panel` or `tool`. Apps pass `page.data.pageType`; see [Page types](#page-types). |
|
|
184
184
|
| `texture` | The house atmosphere on the content region. Defaults to `grid`; `none` is the opt-out. |
|
|
185
|
-
| `
|
|
186
|
-
|
|
187
|
-
The bar also names where you are
|
|
188
|
-
|
|
185
|
+
| `title` | The bar's name for a page the rail has no row for. Apps pass `page.data.title`. |
|
|
186
|
+
|
|
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
|
|
|
@@ -324,9 +329,11 @@ page's ink, so inverting the rail does not drag it along.
|
|
|
324
329
|
|
|
325
330
|
### The settings destination
|
|
326
331
|
|
|
327
|
-
Settings
|
|
328
|
-
|
|
329
|
-
section you are reading
|
|
332
|
+
Settings takes one shape in every app. `SettingsShell` is that shape: a `panel`
|
|
333
|
+
page whose pane is a grouped section list, flush against the rail, beside the
|
|
334
|
+
section you are reading. The route declares `pageType: 'panel'`; the shell draws
|
|
335
|
+
the pane and the content beside it, each scrolling on its own, and names
|
|
336
|
+
"Settings › Account" in the bar.
|
|
330
337
|
|
|
331
338
|
```svelte
|
|
332
339
|
<script lang="ts">
|
|
@@ -353,20 +360,18 @@ section you are reading, both panes scrolling independently from `md`.
|
|
|
353
360
|
];
|
|
354
361
|
</script>
|
|
355
362
|
|
|
356
|
-
<!--
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
{@render children()}
|
|
361
|
-
</SettingsShell>
|
|
362
|
-
</AppShell>
|
|
363
|
+
<!-- routes/(protected)/settings/+layout.ts returns { pageType: 'panel' }. -->
|
|
364
|
+
<SettingsShell {sections} currentPath={page.url.pathname}>
|
|
365
|
+
{@render children()}
|
|
366
|
+
</SettingsShell>
|
|
363
367
|
```
|
|
364
368
|
|
|
365
369
|
| Prop | Purpose |
|
|
366
370
|
| ------------- | ------------------------------------------------------------------------------ |
|
|
367
371
|
| `sections` | Groups of `NavItem`, bare items, or a mix: the rail's own vocabulary. |
|
|
368
372
|
| `currentPath` | Which row is the page. Prefix-matched on the segment boundary, as the rail is. |
|
|
369
|
-
| `listLabel` | The list's accessible name. Defaults to `Settings sections`.
|
|
373
|
+
| `listLabel` | The list's accessible name, and the bar action's that opens it as a sheet. Defaults to `Settings sections`. |
|
|
374
|
+
| `title` | What the bar and the sheet call the destination. Defaults to `Settings`. |
|
|
370
375
|
| `selected`, `onSelect` | A single-route app (no `/settings/*` routes): instead of `currentPath`, pass sections as `{ id, label, icon? }`, the current `id` and a callback. Rows become buttons; the app owns the state. |
|
|
371
376
|
|
|
372
377
|
A setting inside a section is a `SettingsRow`: `label`, optional `description`, the control as children (a Switch, a Select, a Button), and `controlId` to tie the label to the control. Use it in `<Panel pad={false}>`; the row carries its own padding and the rule between rows.
|
|
@@ -393,12 +398,9 @@ ellipsis and told the reader less than the label already did.
|
|
|
393
398
|
**There is no "Settings" heading above the list.** The bar already names the
|
|
394
399
|
section you are on, so a heading here is the same word twice.
|
|
395
400
|
|
|
396
|
-
**Below
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
375px, so the rest are behind a sideways swipe with no scrollbar advertising
|
|
400
|
-
them — a swipe _then_ a tap, where a stack is a scroll the reader is already
|
|
401
|
-
doing. It also has to drop the group labels for width.
|
|
401
|
+
**Below 64rem of window the list opens as a sheet from the bar**, the one place
|
|
402
|
+
every panel page's pane goes when it does not fit, so the section you opened
|
|
403
|
+
fills a phone and every section is a tap on the bar away.
|
|
402
404
|
|
|
403
405
|
Density works here as it does in the rail, because the list _is_ the rail's
|
|
404
406
|
list: the controls inside a section ride the `--ds-control-*` ramp and shrink
|
|
@@ -434,148 +436,110 @@ all three serve any route:
|
|
|
434
436
|
is the short qualifier under the title. Carry one or the other. A page writes a run of `Panel`s and no
|
|
435
437
|
wrapper: the pane stacks them on the package's section rhythm itself.
|
|
436
438
|
|
|
437
|
-
### A
|
|
439
|
+
### A pane beside a page's own content
|
|
440
|
+
|
|
441
|
+
A `panel` page's second column — past questions, a queue, a working list — is
|
|
442
|
+
its pane. The page registers it with `PagePane` and the shell draws it, flush
|
|
443
|
+
against the rail and as wide as the rail, so the two read as one system; it
|
|
444
|
+
folds to the rail's collapsed width when the page gives it a `folded` body, and
|
|
445
|
+
remembers the fold under `remember`. Below 64rem of window it opens as a sheet
|
|
446
|
+
from the bar instead.
|
|
438
447
|
|
|
439
448
|
```svelte
|
|
440
449
|
<script lang="ts">
|
|
441
|
-
import
|
|
442
|
-
import
|
|
443
|
-
|
|
444
|
-
// Bind it to whatever already persists a user preference for this module:
|
|
445
|
-
// a module-scoped `.svelte.ts` store backed by localStorage, or the app's
|
|
446
|
-
// own settings. ListShell holds no storage of its own.
|
|
447
|
-
let listOpen = $state(true);
|
|
450
|
+
import { PagePane } from '@poodle64/ui/app-shell';
|
|
451
|
+
import History from '@lucide/svelte/icons/history';
|
|
448
452
|
</script>
|
|
449
453
|
|
|
450
|
-
<!--
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
<
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
{/snippet}
|
|
458
|
-
<!-- tabs, group headings, rows: entirely this module's own -->
|
|
459
|
-
</ListShell>
|
|
460
|
-
<div class="min-w-0 flex-1">
|
|
461
|
-
{#if !listOpen}
|
|
462
|
-
<!-- The reopen control is this module's own markup, at whatever
|
|
463
|
-
position it chooses; ListShell never places it. -->
|
|
464
|
-
<Button onclick={() => (listOpen = true)} aria-expanded={listOpen}>
|
|
465
|
-
Waiting on you <Badge>{waitingCount}</Badge>
|
|
466
|
-
</Button>
|
|
467
|
-
{/if}
|
|
468
|
-
<!-- the module's own content -->
|
|
469
|
-
</div>
|
|
470
|
-
</div>
|
|
471
|
-
</AppShell>
|
|
454
|
+
<!-- +page.ts returns { pageType: 'panel' } -->
|
|
455
|
+
<PagePane label="Past questions" icon={History} remember="chat-past-folded" fill>
|
|
456
|
+
{#snippet body({ mode, fold, close })}<ConversationList … />{/snippet}
|
|
457
|
+
{#snippet foot()}<Button …>Clear all</Button>{/snippet}
|
|
458
|
+
{#snippet folded({ unfold })}<Button aria-label="Show past questions" onclick={unfold}>…</Button>{/snippet}
|
|
459
|
+
</PagePane>
|
|
460
|
+
<Conversation … />
|
|
472
461
|
```
|
|
473
462
|
|
|
474
463
|
| Prop | Purpose |
|
|
475
464
|
| ---------- | ----------------------------------------------------------------------------- |
|
|
476
|
-
| `
|
|
477
|
-
| `
|
|
478
|
-
| `
|
|
479
|
-
| `
|
|
480
|
-
|
|
481
|
-
|
|
465
|
+
| `label` | The pane's name: the bar action's, and the sheet's. |
|
|
466
|
+
| `body` | The column. It takes the column's state: `mode` (`column` or `sheet`), `fold`, `unfold`, `close`. |
|
|
467
|
+
| `foot` | Pinned at the pane's foot; an empty foot draws nothing. |
|
|
468
|
+
| `folded` | What the pane shows folded to its edge. Given, the pane folds. |
|
|
469
|
+
| `remember` | The localStorage key the fold is kept under. |
|
|
470
|
+
| `location` | What the bar names when the rail has no row for the page ("Settings › Account"). |
|
|
471
|
+
| `fill` | The content beside the pane fills the frame (a transcript keeping its own gutters) rather than sitting at the panel measure. |
|
|
472
|
+
| `column` | Bindable: true while the shell draws the pane as a column, so the page can drop what the column already offers. |
|
|
473
|
+
|
|
474
|
+
### Page types
|
|
475
|
+
|
|
476
|
+
A route says what it is, and the shell lays it out: width, centring, gutters,
|
|
477
|
+
the second columns and which part scrolls. An app writes no width, padding or
|
|
478
|
+
measure of its own (operator, 24/10/2026: "each app ... just chooses the page
|
|
479
|
+
type that it wants"). The route declares it in its load data, and the stamped
|
|
480
|
+
frame passes it to the shell:
|
|
482
481
|
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
<AppShell {nav} currentPath={page.url.pathname} measure="page">
|
|
487
|
-
{@render children()}
|
|
488
|
-
</AppShell>
|
|
482
|
+
```ts
|
|
483
|
+
// routes/(protected)/library/+page.ts
|
|
484
|
+
export const load = () => ({ title: 'Library', pageType: 'tool' });
|
|
489
485
|
```
|
|
490
486
|
|
|
491
|
-
|
|
|
492
|
-
|
|
|
493
|
-
| `
|
|
494
|
-
| `
|
|
495
|
-
| `
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
at once. Measured in Chromium at 2560px: the same paragraph runs to **311
|
|
515
|
-
characters per line** uncapped, against an accepted band of 45–90 for continuous
|
|
516
|
-
text. `prose` puts it at about 70. It is stated in `rem`, not `ch`: `ch` resolves
|
|
517
|
-
against each element's own font size, so a lead, a paragraph and a small intro in
|
|
518
|
-
one column ended at three right edges. A root-relative length gives every block
|
|
519
|
-
the same one.
|
|
520
|
-
|
|
521
|
-
Every tier is a CSS custom property, so an app retunes one without waiting on a
|
|
522
|
-
release of this package:
|
|
487
|
+
| Type | What it is | Reach for it for |
|
|
488
|
+
| --------- | ---------- | ---------------- |
|
|
489
|
+
| `reading` | The default. One column of 44rem, centred; a `PageAside` stands beside it (20rem, a 3rem gap), the pair centred so neither is pinned to an edge, and follows the column below 66rem of content region. Every block in the column ends at the column's one right edge. The page scrolls. | A page you read or fill in: an about page, a security statement, a record, a form, a members list, a document. |
|
|
490
|
+
| `panel` | A `PagePane` flush against the rail, as wide as the rail, and the content beside it left-aligned to it, each block at 52rem. Below 64rem of window the pane is a sheet from the bar. | Settings; a chat and its past questions; a module's working list beside its work. |
|
|
491
|
+
| `tool` | The whole frame; the page never scrolls. Its blocks keep their own height, and its fill — a block marked `data-fill` (a `Panel` that scrolls sets it), or the `PageContainer` holding one — takes the rest of the frame's height exactly (never under 24rem) and scrolls inside itself; a page taller than the frame scrolls in the frame. An aside is a column at the frame's right edge behind its own rule (20–28rem), and below 80rem of window a sheet from the bar. | A library, a table, a graph, a map, a dashboard. |
|
|
492
|
+
|
|
493
|
+
Gutters are one scale for every type, read off the content region (a container,
|
|
494
|
+
so a folded rail or a narrow window counts as the room the page has): 1rem
|
|
495
|
+
below 40rem of region, 2rem to 64rem, 3rem above. A reading page breathes
|
|
496
|
+
3.5rem above and below on a desktop (4.5rem past 100rem); a tool or a panel's
|
|
497
|
+
content 1.75rem, spending its height on what it shows.
|
|
498
|
+
|
|
499
|
+
The design is Gemini's (google/pro), read off the CASPO app's pages at 1673 and
|
|
500
|
+
390px; three numbers differ. The pane is the rail's own width (15.5rem, not
|
|
501
|
+
17.5rem), so the two columns at the left edge read as one system. A tool keeps
|
|
502
|
+
the gutters (Gemini's tool ran edge to edge, each part padding itself), so a
|
|
503
|
+
page's first column starts on one line whatever its type and no component pads
|
|
504
|
+
itself per page. A tool's aside stands behind a rule, the pane's mirror, which
|
|
505
|
+
the layout gate's judge read as composed where a bare card at the edge read as
|
|
506
|
+
stranded. And the pane is a sheet on a phone rather than a drill-down, one
|
|
507
|
+
behaviour for every panel page.
|
|
508
|
+
|
|
509
|
+
Every width is a custom property, so an app retunes one in one declaration:
|
|
523
510
|
|
|
524
511
|
```css
|
|
525
512
|
:root {
|
|
526
|
-
--ds-
|
|
527
|
-
--ds-
|
|
528
|
-
--ds-shell-measure-wide: 100rem;
|
|
513
|
+
--ds-page-reading: 42rem;
|
|
514
|
+
--ds-page-aside: 18rem;
|
|
529
515
|
}
|
|
530
516
|
```
|
|
531
517
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
replaces. An app running `padded={false}` and its own page padding gets the cap
|
|
544
|
-
flush, which is usually what it wanted.
|
|
545
|
-
|
|
546
|
-
A route declares it in its load data and the app's frame passes it on: the
|
|
547
|
-
stamped frame renders `measure={page.data.measure ?? 'wide'}`, and a route group
|
|
548
|
-
returns `{ measure: 'page' }` from its `+layout.ts`, one route from its
|
|
549
|
-
`+page.ts`. Three apps had each written a table of path regexes mapping routes
|
|
550
|
-
to tiers in their frame (22 rows in one); route data puts the decision on the
|
|
551
|
-
route it belongs to, and SvelteKit merges a layout's answer into every page
|
|
552
|
-
under it. `padded` travels the same way.
|
|
553
|
-
|
|
554
|
-
#### A block inside the page: `.ds-measure`
|
|
555
|
-
|
|
556
|
-
A route legitimately set to `wide` — a dashboard, a table, a card grid — often
|
|
557
|
-
also carries a paragraph of explanatory prose, and that prose inherits the wide
|
|
558
|
-
measure. Cap the block, not the route:
|
|
518
|
+
`--ds-page-reading`, `--ds-page-aside`, `--ds-page-aside-tool`,
|
|
519
|
+
`--ds-page-aside-gap`, `--ds-page-pane` (the rail's width), `--ds-page-pane-folded`
|
|
520
|
+
and `--ds-page-panel`. The frame is `.ds-page[data-page]` inside the content
|
|
521
|
+
region, with `.ds-page-pane`, `.ds-page-main` and `.ds-page-aside`; a component
|
|
522
|
+
that sets a line of explanation (a section's description) marks it `data-prose`,
|
|
523
|
+
and only a frame wider than the reading column caps it.
|
|
524
|
+
|
|
525
|
+
#### An aside: `PageAside`
|
|
526
|
+
|
|
527
|
+
What stands beside a page's content registers as its aside, and the type
|
|
528
|
+
places it:
|
|
559
529
|
|
|
560
530
|
```svelte
|
|
561
|
-
<
|
|
531
|
+
<PageAside label="Work under way">
|
|
532
|
+
<Panel title="Work under way">…</Panel>
|
|
533
|
+
</PageAside>
|
|
562
534
|
```
|
|
563
535
|
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
on its own content box, is that plus `margin-inline: auto` — right for a content
|
|
572
|
-
box, wrong for a block within a page, where it indented a set of left-anchored
|
|
573
|
-
paragraphs ~207px away from their own label. Both halves are gated in
|
|
574
|
-
`harness/drive.mjs` at 2560px on a `wide` route: the cap binds, the block stays
|
|
575
|
-
on the page's own left edge, and it follows a retune of
|
|
576
|
-
`--ds-shell-measure-prose`.
|
|
577
|
-
|
|
578
|
-
**Large screens.** The measures, the type and the rail are all rem, and past
|
|
536
|
+
`label` names its landmark and, where it is a sheet, the bar action and the
|
|
537
|
+
sheet's head (`description` a line under it). The body takes the column's
|
|
538
|
+
state as `{#snippet body(state)}` when it must close the sheet after a choice.
|
|
539
|
+
`ContextColumn` and `DocumentReader`'s contents list are asides; outside a shell
|
|
540
|
+
(inside an element) both render in place.
|
|
541
|
+
|
|
542
|
+
**Large screens.** The page widths, the type and the rail are all rem, and past
|
|
579
543
|
2560px the root size grows (1px per 160px of width, to 24px at 3840px), so a
|
|
580
544
|
page fills a 4K screen as it fills a laptop's. At 2560px and below nothing
|
|
581
545
|
moves. An app sets no per-page variant; one that sets its own root size does it
|
|
@@ -638,10 +602,11 @@ head, and as a heading it is the generated-UI tell `eyebrow` warns about.
|
|
|
638
602
|
The body is the app's HTML, already sanitised, for the reason `.ds-prose` gives;
|
|
639
603
|
strip the body's own leading `# Title`, since the header carries it. The
|
|
640
604
|
contents list is the body's `h2` and `h3`, shown once there are two; a heading
|
|
641
|
-
without an id gets one from its text.
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
605
|
+
without an id gets one from its text. In a shell the reader is a `reading`
|
|
606
|
+
page's column and the list is the page's aside: beside the body and in view
|
|
607
|
+
where the aside stands beside the column, and folded into an "On this page"
|
|
608
|
+
disclosure above the body where it does not. Outside a shell (inside an
|
|
609
|
+
element) the reader lays the two out itself, from 64rem of its own width. A link scrolls
|
|
645
610
|
to its heading and moves focus there, without the URL fragment, which cannot
|
|
646
611
|
reach into a shadow root.
|
|
647
612
|
|
|
@@ -829,7 +794,7 @@ Rendered markdown, an extracted document body, a rich-text field — content who
|
|
|
829
794
|
tags the app did not write and cannot style at the call site:
|
|
830
795
|
|
|
831
796
|
```svelte
|
|
832
|
-
<div class="ds-prose
|
|
797
|
+
<div class="ds-prose">
|
|
833
798
|
{@html sanitised}
|
|
834
799
|
</div>
|
|
835
800
|
```
|
|
@@ -841,9 +806,7 @@ a table wider than the measure **scrolls in its own box rather than taking the
|
|
|
841
806
|
page sideways** — gated at 360px, and driven red by removing its `overflow-x`,
|
|
842
807
|
which pushes 901px into the content region.
|
|
843
808
|
|
|
844
|
-
The face carries no measure
|
|
845
|
-
decisions, so compose it with [`.ds-measure`](#a-block-inside-the-page-ds-measure)
|
|
846
|
-
as above.
|
|
809
|
+
The face carries no measure: a `reading` page's column is the measure.
|
|
847
810
|
|
|
848
811
|
**The package styles this content; it does not render it.** Sanitising untrusted
|
|
849
812
|
HTML is a security boundary, and a package cannot see the inputs the boundary is
|
|
@@ -924,8 +887,8 @@ hover — see `packages/design-tokens/README.md`.
|
|
|
924
887
|
|
|
925
888
|
### Measuring the content region
|
|
926
889
|
|
|
927
|
-
About overflow, not width — for how wide the body is
|
|
928
|
-
[
|
|
890
|
+
About overflow, not width — for how wide the body is laid out, see
|
|
891
|
+
[Page types](#page-types) above.
|
|
929
892
|
|
|
930
893
|
`<main>` is the scrolling content region and carries
|
|
931
894
|
`data-slot="app-shell-content"`. A consuming app's "no horizontal overflow" check
|
|
@@ -1100,8 +1063,9 @@ in a real engine at 390, 1440 and 3360px (`harness/drive.mjs`, `?surface=records
|
|
|
1100
1063
|
|
|
1101
1064
|
## A record's page
|
|
1102
1065
|
|
|
1103
|
-
The record's whole name is the top bar's control; its
|
|
1104
|
-
the page opened
|
|
1066
|
+
The record's whole name is the top bar's control; its aside holds the one item
|
|
1067
|
+
the page opened, or that item's document (`?surface=record`). A record page is
|
|
1068
|
+
a `tool` page, so the aside is a column at the frame's right edge.
|
|
1105
1069
|
|
|
1106
1070
|
```svelte
|
|
1107
1071
|
<ShellControls>
|
|
@@ -1111,13 +1075,11 @@ the page opened; that item's document stands beside it (`?surface=record`).
|
|
|
1111
1075
|
pages={[{ label: 'Overview', href: '/property/4', current: true }, …]} />
|
|
1112
1076
|
</ShellControls>
|
|
1113
1077
|
|
|
1114
|
-
<
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
</ContextColumn>
|
|
1120
|
-
</div>
|
|
1078
|
+
<PageContainer><!-- header card, one line a section --></PageContainer>
|
|
1079
|
+
<ContextColumn title={opened.title} subtitle="Opened on what needs you"
|
|
1080
|
+
onClose={reopenWhatNeedsYou} documentPane={lease ? leaseDoc : undefined}>
|
|
1081
|
+
<!-- the opened section -->
|
|
1082
|
+
</ContextColumn>
|
|
1121
1083
|
|
|
1122
1084
|
{#snippet leaseDoc()}
|
|
1123
1085
|
<DocumentPane title="Residential tenancy agreement" subtitle={lease.span} pages={lease.pages}
|
|
@@ -1135,15 +1097,12 @@ the page opened; that item's document stands beside it (`?surface=record`).
|
|
|
1135
1097
|
- **ContextColumn's record form** holds one item, never none: the page opens it
|
|
1136
1098
|
on what needs the viewer first and `onClose` reopens that. The item is as tall
|
|
1137
1099
|
as what it holds up to the column, then scrolls inside itself; a new `title`
|
|
1138
|
-
swaps it in from the top. Its `documentPane` takes the
|
|
1139
|
-
|
|
1140
|
-
which a 1600px screen gives with the rail open. The row decides, not the
|
|
1141
|
-
screen, so a folded rail or a narrow window is read as the room there is.
|
|
1100
|
+
swaps it in from the top. Its `documentPane` takes the item's place. Below
|
|
1101
|
+
80rem of window the aside opens from the bar as a sheet headed by its name.
|
|
1142
1102
|
- **DocumentPane** fills the height it is given: `pages` as one image URL a page,
|
|
1143
1103
|
or `page` and `pageCount` to draw them yourself, as `PageCanvas` takes them. A
|
|
1144
1104
|
page that fails to load says so and keeps its place. Another document swapped
|
|
1145
|
-
into the same pane opens on its first page, fitted
|
|
1146
|
-
moves beside itself as the row crosses 1250px.
|
|
1105
|
+
into the same pane opens on its first page, fitted.
|
|
1147
1106
|
|
|
1148
1107
|
## A graph of relations
|
|
1149
1108
|
|
|
@@ -1621,8 +1580,8 @@ trace id. The faro packages are `dependencies`, not peers, for the same reason
|
|
|
1621
1580
|
`bits-ui` is a peer: a duplicated Faro global would strand the session id the
|
|
1622
1581
|
feedback widget reports against.
|
|
1623
1582
|
|
|
1624
|
-
`ReportWidget` is the user-facing other half:
|
|
1625
|
-
|
|
1583
|
+
`ReportWidget` is the user-facing other half: the one report dialogue,
|
|
1584
|
+
opened from the shell (below) — a labelled "What happened?" textarea, and a
|
|
1626
1585
|
screenshot checkbox (on by default) that captures `document.body` with
|
|
1627
1586
|
`html-to-image`. A capture the page cannot produce is tolerated silently: the
|
|
1628
1587
|
report sends with a null image rather than not at all. Submitting POSTs one
|
|
@@ -1653,12 +1612,13 @@ routes by situation, so it stands outside the situation→component registry
|
|
|
1653
1612
|
for the same reason. `getSessionId()` reading null when telemetry is off is
|
|
1654
1613
|
ordinary, not an error: the report sends with a null `session_id`.
|
|
1655
1614
|
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
(`
|
|
1661
|
-
|
|
1615
|
+
Feedback has one home, the shell's. The widget draws no trigger: while mounted
|
|
1616
|
+
it registers how to open its dialogue, and `AppShell` shows the trigger as an
|
|
1617
|
+
icon button in the top bar's right group from md (`ds-shell-report`, before the
|
|
1618
|
+
app's own `actions`, the theme toggle and the account menu) and as a row at the
|
|
1619
|
+
foot of the phone drawer (`ds-shell-drawer-report`). Nothing floats over a page
|
|
1620
|
+
and the shell reserves no room at its foot for it. The layout mounts the widget
|
|
1621
|
+
beside the shell, as before; an app wires nothing else.
|
|
1662
1622
|
|
|
1663
1623
|
## The alerts bell
|
|
1664
1624
|
|
|
@@ -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"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Snippet, Component } from 'svelte';
|
|
3
3
|
import * as Dialog from '../dialog/index.js';
|
|
4
4
|
import InfoTip from '../info-tip/info-tip.svelte';
|
|
5
|
+
import ColumnScope from '../app-shell/column-scope.svelte';
|
|
5
6
|
import X from '@lucide/svelte/icons/x';
|
|
6
7
|
|
|
7
8
|
// The one dialogue frame: a titled header with optional icon and subtitle, a
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
</Dialog.Close>
|
|
111
112
|
</header>
|
|
112
113
|
<div class="min-h-0 flex-1 overflow-y-auto px-6 py-5">
|
|
113
|
-
{@render children()}
|
|
114
|
+
<ColumnScope>{@render children()}</ColumnScope>
|
|
114
115
|
</div>
|
|
115
116
|
{#if footer}
|
|
116
117
|
<footer
|
|
@@ -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>
|