@poodle64/ui 2026.10.26 → 2026.10.28
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 +138 -169
- package/dist/components/ui/app-dialog/app-dialog.svelte +2 -1
- package/dist/components/ui/app-shell/app-nav.svelte +15 -2
- package/dist/components/ui/app-shell/app-shell.svelte +251 -97
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +15 -27
- 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 +3 -1
- 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/types.d.ts +18 -2
- 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 -146
- 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 +267 -119
- 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 -27
- package/dist/components/ui/app-shell/padding.js +0 -27
- 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
|
@@ -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,9 +180,9 @@ 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
|
-
| `
|
|
185
|
+
| `title` | The bar's name for a page the rail has no row for. Apps pass `page.data.title`. |
|
|
186
186
|
|
|
187
187
|
The bar also names where you are, read off `nav` and `currentPath`: "Section ›
|
|
188
188
|
Page" inside a section that has `children` ("Securities › Trading"), the item's
|
|
@@ -281,6 +281,21 @@ belongs in the page too, as a sibling of the article it serves, and not in the
|
|
|
281
281
|
shell: it is part of that page's own reading surface, it wants that page's
|
|
282
282
|
breakpoints, and no other route should be paying rail width for it.
|
|
283
283
|
|
|
284
|
+
**A row's `badge`, and a label that never truncates.** The label is the content:
|
|
285
|
+
it wraps, never ends in an ellipsis, and the badge and the chevron keep their
|
|
286
|
+
size. A text badge (`badge: 3`, `badge: 'beta'`) is a chip that costs the label
|
|
287
|
+
room: at 15.5rem, a label, a wordy chip and a chevron do not share one line, so
|
|
288
|
+
the label takes a second. Pass the icon form wherever a label could collide
|
|
289
|
+
(a tag with words in it, any row that also has `children`):
|
|
290
|
+
|
|
291
|
+
```ts
|
|
292
|
+
import Lock from '@lucide/svelte/icons/lock';
|
|
293
|
+
{ label: 'Strategy paper', href: '/strategy', icon: FileText, badge: { icon: Lock, label: 'Only you' } }
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
It draws as a compact pill holding only the icon (12px, muted), with `label` as
|
|
297
|
+
its tooltip and accessible name. `NavBadge` is the type.
|
|
298
|
+
|
|
284
299
|
`NavItem` / `NavGroup` are exported so an app types its own config against them.
|
|
285
300
|
They carry **no notion of who may see an item**: two surveyed apps gate
|
|
286
301
|
navigation on admin or per-module permission, and both do it with their own auth
|
|
@@ -329,9 +344,11 @@ page's ink, so inverting the rail does not drag it along.
|
|
|
329
344
|
|
|
330
345
|
### The settings destination
|
|
331
346
|
|
|
332
|
-
Settings
|
|
333
|
-
|
|
334
|
-
section you are reading
|
|
347
|
+
Settings takes one shape in every app. `SettingsShell` is that shape: a `panel`
|
|
348
|
+
page whose pane is a grouped section list, flush against the rail, beside the
|
|
349
|
+
section you are reading. The route declares `pageType: 'panel'`; the shell draws
|
|
350
|
+
the pane and the content beside it, each scrolling on its own, and names
|
|
351
|
+
"Settings › Account" in the bar.
|
|
335
352
|
|
|
336
353
|
```svelte
|
|
337
354
|
<script lang="ts">
|
|
@@ -358,20 +375,18 @@ section you are reading, both panes scrolling independently from `md`.
|
|
|
358
375
|
];
|
|
359
376
|
</script>
|
|
360
377
|
|
|
361
|
-
<!--
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
{@render children()}
|
|
366
|
-
</SettingsShell>
|
|
367
|
-
</AppShell>
|
|
378
|
+
<!-- routes/(protected)/settings/+layout.ts returns { pageType: 'panel' }. -->
|
|
379
|
+
<SettingsShell {sections} currentPath={page.url.pathname}>
|
|
380
|
+
{@render children()}
|
|
381
|
+
</SettingsShell>
|
|
368
382
|
```
|
|
369
383
|
|
|
370
384
|
| Prop | Purpose |
|
|
371
385
|
| ------------- | ------------------------------------------------------------------------------ |
|
|
372
386
|
| `sections` | Groups of `NavItem`, bare items, or a mix: the rail's own vocabulary. |
|
|
373
387
|
| `currentPath` | Which row is the page. Prefix-matched on the segment boundary, as the rail is. |
|
|
374
|
-
| `listLabel` | The list's accessible name. Defaults to `Settings sections`.
|
|
388
|
+
| `listLabel` | The list's accessible name, and the bar action's that opens it as a sheet. Defaults to `Settings sections`. |
|
|
389
|
+
| `title` | What the bar and the sheet call the destination. Defaults to `Settings`. |
|
|
375
390
|
| `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. |
|
|
376
391
|
|
|
377
392
|
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.
|
|
@@ -398,12 +413,9 @@ ellipsis and told the reader less than the label already did.
|
|
|
398
413
|
**There is no "Settings" heading above the list.** The bar already names the
|
|
399
414
|
section you are on, so a heading here is the same word twice.
|
|
400
415
|
|
|
401
|
-
**Below
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
375px, so the rest are behind a sideways swipe with no scrollbar advertising
|
|
405
|
-
them — a swipe _then_ a tap, where a stack is a scroll the reader is already
|
|
406
|
-
doing. It also has to drop the group labels for width.
|
|
416
|
+
**Below 64rem of window the list opens as a sheet from the bar**, the one place
|
|
417
|
+
every panel page's pane goes when it does not fit, so the section you opened
|
|
418
|
+
fills a phone and every section is a tap on the bar away.
|
|
407
419
|
|
|
408
420
|
Density works here as it does in the rail, because the list _is_ the rail's
|
|
409
421
|
list: the controls inside a section ride the `--ds-control-*` ramp and shrink
|
|
@@ -439,148 +451,110 @@ all three serve any route:
|
|
|
439
451
|
is the short qualifier under the title. Carry one or the other. A page writes a run of `Panel`s and no
|
|
440
452
|
wrapper: the pane stacks them on the package's section rhythm itself.
|
|
441
453
|
|
|
442
|
-
### A
|
|
454
|
+
### A pane beside a page's own content
|
|
455
|
+
|
|
456
|
+
A `panel` page's second column — past questions, a queue, a working list — is
|
|
457
|
+
its pane. The page registers it with `PagePane` and the shell draws it, flush
|
|
458
|
+
against the rail and as wide as the rail, so the two read as one system; it
|
|
459
|
+
folds to the rail's collapsed width when the page gives it a `folded` body, and
|
|
460
|
+
remembers the fold under `remember`. Below 64rem of window it opens as a sheet
|
|
461
|
+
from the bar instead.
|
|
443
462
|
|
|
444
463
|
```svelte
|
|
445
464
|
<script lang="ts">
|
|
446
|
-
import
|
|
447
|
-
import
|
|
448
|
-
|
|
449
|
-
// Bind it to whatever already persists a user preference for this module:
|
|
450
|
-
// a module-scoped `.svelte.ts` store backed by localStorage, or the app's
|
|
451
|
-
// own settings. ListShell holds no storage of its own.
|
|
452
|
-
let listOpen = $state(true);
|
|
465
|
+
import { PagePane } from '@poodle64/ui/app-shell';
|
|
466
|
+
import History from '@lucide/svelte/icons/history';
|
|
453
467
|
</script>
|
|
454
468
|
|
|
455
|
-
<!--
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
<
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
{/snippet}
|
|
463
|
-
<!-- tabs, group headings, rows: entirely this module's own -->
|
|
464
|
-
</ListShell>
|
|
465
|
-
<div class="min-w-0 flex-1">
|
|
466
|
-
{#if !listOpen}
|
|
467
|
-
<!-- The reopen control is this module's own markup, at whatever
|
|
468
|
-
position it chooses; ListShell never places it. -->
|
|
469
|
-
<Button onclick={() => (listOpen = true)} aria-expanded={listOpen}>
|
|
470
|
-
Waiting on you <Badge>{waitingCount}</Badge>
|
|
471
|
-
</Button>
|
|
472
|
-
{/if}
|
|
473
|
-
<!-- the module's own content -->
|
|
474
|
-
</div>
|
|
475
|
-
</div>
|
|
476
|
-
</AppShell>
|
|
469
|
+
<!-- +page.ts returns { pageType: 'panel' } -->
|
|
470
|
+
<PagePane label="Past questions" icon={History} remember="chat-past-folded" fill>
|
|
471
|
+
{#snippet body({ mode, fold, close })}<ConversationList … />{/snippet}
|
|
472
|
+
{#snippet foot()}<Button …>Clear all</Button>{/snippet}
|
|
473
|
+
{#snippet folded({ unfold })}<Button aria-label="Show past questions" onclick={unfold}>…</Button>{/snippet}
|
|
474
|
+
</PagePane>
|
|
475
|
+
<Conversation … />
|
|
477
476
|
```
|
|
478
477
|
|
|
479
478
|
| Prop | Purpose |
|
|
480
479
|
| ---------- | ----------------------------------------------------------------------------- |
|
|
481
|
-
| `
|
|
482
|
-
| `
|
|
483
|
-
| `
|
|
484
|
-
| `
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
480
|
+
| `label` | The pane's name: the bar action's, and the sheet's. |
|
|
481
|
+
| `body` | The column. It takes the column's state: `mode` (`column` or `sheet`), `fold`, `unfold`, `close`. |
|
|
482
|
+
| `foot` | Pinned at the pane's foot; an empty foot draws nothing. |
|
|
483
|
+
| `folded` | What the pane shows folded to its edge. Given, the pane folds. |
|
|
484
|
+
| `remember` | The localStorage key the fold is kept under. |
|
|
485
|
+
| `location` | What the bar names when the rail has no row for the page ("Settings › Account"). |
|
|
486
|
+
| `fill` | The content beside the pane fills the frame (a transcript keeping its own gutters) rather than sitting at the panel measure. |
|
|
487
|
+
| `column` | Bindable: true while the shell draws the pane as a column, so the page can drop what the column already offers. |
|
|
488
|
+
|
|
489
|
+
### Page types
|
|
490
|
+
|
|
491
|
+
A route says what it is, and the shell lays it out: width, centring, gutters,
|
|
492
|
+
the second columns and which part scrolls. An app writes no width, padding or
|
|
493
|
+
measure of its own (operator, 24/10/2026: "each app ... just chooses the page
|
|
494
|
+
type that it wants"). The route declares it in its load data, and the stamped
|
|
495
|
+
frame passes it to the shell:
|
|
489
496
|
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
</AppShell>
|
|
497
|
+
```ts
|
|
498
|
+
// routes/(protected)/library/+page.ts
|
|
499
|
+
export const load = () => ({ title: 'Library', pageType: 'tool' });
|
|
494
500
|
```
|
|
495
501
|
|
|
496
|
-
|
|
|
497
|
-
|
|
|
498
|
-
| `
|
|
499
|
-
| `
|
|
500
|
-
| `
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
at once. Measured in Chromium at 2560px: the same paragraph runs to **311
|
|
520
|
-
characters per line** uncapped, against an accepted band of 45–90 for continuous
|
|
521
|
-
text. `prose` puts it at about 70. It is stated in `rem`, not `ch`: `ch` resolves
|
|
522
|
-
against each element's own font size, so a lead, a paragraph and a small intro in
|
|
523
|
-
one column ended at three right edges. A root-relative length gives every block
|
|
524
|
-
the same one.
|
|
525
|
-
|
|
526
|
-
Every tier is a CSS custom property, so an app retunes one without waiting on a
|
|
527
|
-
release of this package:
|
|
502
|
+
| Type | What it is | Reach for it for |
|
|
503
|
+
| --------- | ---------- | ---------------- |
|
|
504
|
+
| `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. |
|
|
505
|
+
| `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. |
|
|
506
|
+
| `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. |
|
|
507
|
+
|
|
508
|
+
Gutters are one scale for every type, read off the content region (a container,
|
|
509
|
+
so a folded rail or a narrow window counts as the room the page has): 1rem
|
|
510
|
+
below 40rem of region, 2rem to 64rem, 3rem above. A reading page breathes
|
|
511
|
+
3.5rem above and below on a desktop (4.5rem past 100rem); a tool or a panel's
|
|
512
|
+
content 1.75rem, spending its height on what it shows.
|
|
513
|
+
|
|
514
|
+
The design is Gemini's (google/pro), read off the CASPO app's pages at 1673 and
|
|
515
|
+
390px; three numbers differ. The pane is the rail's own width (15.5rem, not
|
|
516
|
+
17.5rem), so the two columns at the left edge read as one system. A tool keeps
|
|
517
|
+
the gutters (Gemini's tool ran edge to edge, each part padding itself), so a
|
|
518
|
+
page's first column starts on one line whatever its type and no component pads
|
|
519
|
+
itself per page. A tool's aside stands behind a rule, the pane's mirror, which
|
|
520
|
+
the layout gate's judge read as composed where a bare card at the edge read as
|
|
521
|
+
stranded. And the pane is a sheet on a phone rather than a drill-down, one
|
|
522
|
+
behaviour for every panel page.
|
|
523
|
+
|
|
524
|
+
Every width is a custom property, so an app retunes one in one declaration:
|
|
528
525
|
|
|
529
526
|
```css
|
|
530
527
|
:root {
|
|
531
|
-
--ds-
|
|
532
|
-
--ds-
|
|
533
|
-
--ds-shell-measure-wide: 100rem;
|
|
528
|
+
--ds-page-reading: 42rem;
|
|
529
|
+
--ds-page-aside: 18rem;
|
|
534
530
|
}
|
|
535
531
|
```
|
|
536
532
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
replaces. An app running `padded={false}` and its own page padding gets the cap
|
|
549
|
-
flush, which is usually what it wanted.
|
|
550
|
-
|
|
551
|
-
A route declares it in its load data and the app's frame passes it on: the
|
|
552
|
-
stamped frame renders `measure={page.data.measure ?? 'wide'}`, and a route group
|
|
553
|
-
returns `{ measure: 'page' }` from its `+layout.ts`, one route from its
|
|
554
|
-
`+page.ts`. Three apps had each written a table of path regexes mapping routes
|
|
555
|
-
to tiers in their frame (22 rows in one); route data puts the decision on the
|
|
556
|
-
route it belongs to, and SvelteKit merges a layout's answer into every page
|
|
557
|
-
under it. `padded` travels the same way.
|
|
558
|
-
|
|
559
|
-
#### A block inside the page: `.ds-measure`
|
|
560
|
-
|
|
561
|
-
A route legitimately set to `wide` — a dashboard, a table, a card grid — often
|
|
562
|
-
also carries a paragraph of explanatory prose, and that prose inherits the wide
|
|
563
|
-
measure. Cap the block, not the route:
|
|
533
|
+
`--ds-page-reading`, `--ds-page-aside`, `--ds-page-aside-tool`,
|
|
534
|
+
`--ds-page-aside-gap`, `--ds-page-pane` (the rail's width), `--ds-page-pane-folded`
|
|
535
|
+
and `--ds-page-panel`. The frame is `.ds-page[data-page]` inside the content
|
|
536
|
+
region, with `.ds-page-pane`, `.ds-page-main` and `.ds-page-aside`; a component
|
|
537
|
+
that sets a line of explanation (a section's description) marks it `data-prose`,
|
|
538
|
+
and only a frame wider than the reading column caps it.
|
|
539
|
+
|
|
540
|
+
#### An aside: `PageAside`
|
|
541
|
+
|
|
542
|
+
What stands beside a page's content registers as its aside, and the type
|
|
543
|
+
places it:
|
|
564
544
|
|
|
565
545
|
```svelte
|
|
566
|
-
<
|
|
546
|
+
<PageAside label="Work under way">
|
|
547
|
+
<Panel title="Work under way">…</Panel>
|
|
548
|
+
</PageAside>
|
|
567
549
|
```
|
|
568
550
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
on its own content box, is that plus `margin-inline: auto` — right for a content
|
|
577
|
-
box, wrong for a block within a page, where it indented a set of left-anchored
|
|
578
|
-
paragraphs ~207px away from their own label. Both halves are gated in
|
|
579
|
-
`harness/drive.mjs` at 2560px on a `wide` route: the cap binds, the block stays
|
|
580
|
-
on the page's own left edge, and it follows a retune of
|
|
581
|
-
`--ds-shell-measure-prose`.
|
|
582
|
-
|
|
583
|
-
**Large screens.** The measures, the type and the rail are all rem, and past
|
|
551
|
+
`label` names its landmark and, where it is a sheet, the bar action and the
|
|
552
|
+
sheet's head (`description` a line under it). The body takes the column's
|
|
553
|
+
state as `{#snippet body(state)}` when it must close the sheet after a choice.
|
|
554
|
+
`ContextColumn` and `DocumentReader`'s contents list are asides; outside a shell
|
|
555
|
+
(inside an element) both render in place.
|
|
556
|
+
|
|
557
|
+
**Large screens.** The page widths, the type and the rail are all rem, and past
|
|
584
558
|
2560px the root size grows (1px per 160px of width, to 24px at 3840px), so a
|
|
585
559
|
page fills a 4K screen as it fills a laptop's. At 2560px and below nothing
|
|
586
560
|
moves. An app sets no per-page variant; one that sets its own root size does it
|
|
@@ -643,10 +617,11 @@ head, and as a heading it is the generated-UI tell `eyebrow` warns about.
|
|
|
643
617
|
The body is the app's HTML, already sanitised, for the reason `.ds-prose` gives;
|
|
644
618
|
strip the body's own leading `# Title`, since the header carries it. The
|
|
645
619
|
contents list is the body's `h2` and `h3`, shown once there are two; a heading
|
|
646
|
-
without an id gets one from its text.
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
620
|
+
without an id gets one from its text. In a shell the reader is a `reading`
|
|
621
|
+
page's column and the list is the page's aside: beside the body and in view
|
|
622
|
+
where the aside stands beside the column, and folded into an "On this page"
|
|
623
|
+
disclosure above the body where it does not. Outside a shell (inside an
|
|
624
|
+
element) the reader lays the two out itself, from 64rem of its own width. A link scrolls
|
|
650
625
|
to its heading and moves focus there, without the URL fragment, which cannot
|
|
651
626
|
reach into a shadow root.
|
|
652
627
|
|
|
@@ -834,7 +809,7 @@ Rendered markdown, an extracted document body, a rich-text field — content who
|
|
|
834
809
|
tags the app did not write and cannot style at the call site:
|
|
835
810
|
|
|
836
811
|
```svelte
|
|
837
|
-
<div class="ds-prose
|
|
812
|
+
<div class="ds-prose">
|
|
838
813
|
{@html sanitised}
|
|
839
814
|
</div>
|
|
840
815
|
```
|
|
@@ -846,9 +821,7 @@ a table wider than the measure **scrolls in its own box rather than taking the
|
|
|
846
821
|
page sideways** — gated at 360px, and driven red by removing its `overflow-x`,
|
|
847
822
|
which pushes 901px into the content region.
|
|
848
823
|
|
|
849
|
-
The face carries no measure
|
|
850
|
-
decisions, so compose it with [`.ds-measure`](#a-block-inside-the-page-ds-measure)
|
|
851
|
-
as above.
|
|
824
|
+
The face carries no measure: a `reading` page's column is the measure.
|
|
852
825
|
|
|
853
826
|
**The package styles this content; it does not render it.** Sanitising untrusted
|
|
854
827
|
HTML is a security boundary, and a package cannot see the inputs the boundary is
|
|
@@ -929,8 +902,8 @@ hover — see `packages/design-tokens/README.md`.
|
|
|
929
902
|
|
|
930
903
|
### Measuring the content region
|
|
931
904
|
|
|
932
|
-
About overflow, not width — for how wide the body is
|
|
933
|
-
[
|
|
905
|
+
About overflow, not width — for how wide the body is laid out, see
|
|
906
|
+
[Page types](#page-types) above.
|
|
934
907
|
|
|
935
908
|
`<main>` is the scrolling content region and carries
|
|
936
909
|
`data-slot="app-shell-content"`. A consuming app's "no horizontal overflow" check
|
|
@@ -1105,8 +1078,9 @@ in a real engine at 390, 1440 and 3360px (`harness/drive.mjs`, `?surface=records
|
|
|
1105
1078
|
|
|
1106
1079
|
## A record's page
|
|
1107
1080
|
|
|
1108
|
-
The record's whole name is the top bar's control; its
|
|
1109
|
-
the page opened
|
|
1081
|
+
The record's whole name is the top bar's control; its aside holds the one item
|
|
1082
|
+
the page opened, or that item's document (`?surface=record`). A record page is
|
|
1083
|
+
a `tool` page, so the aside is a column at the frame's right edge.
|
|
1110
1084
|
|
|
1111
1085
|
```svelte
|
|
1112
1086
|
<ShellControls>
|
|
@@ -1116,13 +1090,11 @@ the page opened; that item's document stands beside it (`?surface=record`).
|
|
|
1116
1090
|
pages={[{ label: 'Overview', href: '/property/4', current: true }, …]} />
|
|
1117
1091
|
</ShellControls>
|
|
1118
1092
|
|
|
1119
|
-
<
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
</ContextColumn>
|
|
1125
|
-
</div>
|
|
1093
|
+
<PageContainer><!-- header card, one line a section --></PageContainer>
|
|
1094
|
+
<ContextColumn title={opened.title} subtitle="Opened on what needs you"
|
|
1095
|
+
onClose={reopenWhatNeedsYou} documentPane={lease ? leaseDoc : undefined}>
|
|
1096
|
+
<!-- the opened section -->
|
|
1097
|
+
</ContextColumn>
|
|
1126
1098
|
|
|
1127
1099
|
{#snippet leaseDoc()}
|
|
1128
1100
|
<DocumentPane title="Residential tenancy agreement" subtitle={lease.span} pages={lease.pages}
|
|
@@ -1140,15 +1112,12 @@ the page opened; that item's document stands beside it (`?surface=record`).
|
|
|
1140
1112
|
- **ContextColumn's record form** holds one item, never none: the page opens it
|
|
1141
1113
|
on what needs the viewer first and `onClose` reopens that. The item is as tall
|
|
1142
1114
|
as what it holds up to the column, then scrolls inside itself; a new `title`
|
|
1143
|
-
swaps it in from the top. Its `documentPane` takes the
|
|
1144
|
-
|
|
1145
|
-
which a 1600px screen gives with the rail open. The row decides, not the
|
|
1146
|
-
screen, so a folded rail or a narrow window is read as the room there is.
|
|
1115
|
+
swaps it in from the top. Its `documentPane` takes the item's place. Below
|
|
1116
|
+
80rem of window the aside opens from the bar as a sheet headed by its name.
|
|
1147
1117
|
- **DocumentPane** fills the height it is given: `pages` as one image URL a page,
|
|
1148
1118
|
or `page` and `pageCount` to draw them yourself, as `PageCanvas` takes them. A
|
|
1149
1119
|
page that fails to load says so and keeps its place. Another document swapped
|
|
1150
|
-
into the same pane opens on its first page, fitted
|
|
1151
|
-
moves beside itself as the row crosses 1250px.
|
|
1120
|
+
into the same pane opens on its first page, fitted.
|
|
1152
1121
|
|
|
1153
1122
|
## A graph of relations
|
|
1154
1123
|
|
|
@@ -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
|
|
@@ -201,9 +201,22 @@
|
|
|
201
201
|
>{item.label.slice(0, 1).toUpperCase()}</span
|
|
202
202
|
>
|
|
203
203
|
{/if}
|
|
204
|
-
<span class={iconOnly ? 'sr-only' : '
|
|
204
|
+
<span class={iconOnly ? 'sr-only' : 'ds-nav-label'}>{item.label}</span>
|
|
205
205
|
{#if item.badge !== undefined && !iconOnly}
|
|
206
|
-
|
|
206
|
+
{#if typeof item.badge === 'object'}
|
|
207
|
+
{@const Mark = item.badge.icon}
|
|
208
|
+
<span
|
|
209
|
+
class="ds-nav-badge"
|
|
210
|
+
data-icon
|
|
211
|
+
role="img"
|
|
212
|
+
title={item.badge.label}
|
|
213
|
+
aria-label={item.badge.label}
|
|
214
|
+
>
|
|
215
|
+
<Mark class="size-3 flex-none" />
|
|
216
|
+
</span>
|
|
217
|
+
{:else}
|
|
218
|
+
<span class="ds-nav-badge">{item.badge}</span>
|
|
219
|
+
{/if}
|
|
207
220
|
{/if}
|
|
208
221
|
{/snippet}
|
|
209
222
|
{#if stateful}
|