@poodle64/ui 2026.11.3 → 2026.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/app-shell/app-shell.svelte +18 -1
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +3 -0
- 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/shell-data.d.ts +23 -0
- package/dist/components/ui/app-shell/shell-data.js +5 -0
- package/dist/components/ui/command-palette/command-palette.svelte +46 -2
- package/dist/components/ui/command-palette/command-palette.svelte.d.ts +3 -0
- package/dist/components/ui/page-lead/page-lead.svelte +11 -1
- package/dist/components/ui/page-lead/page-lead.svelte.d.ts +2 -0
- package/package.json +1 -1
- package/registry/component-map.json +1 -1
- package/registry/component-map.md +1 -1
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
brand,
|
|
113
113
|
brandTitle,
|
|
114
114
|
brandMark,
|
|
115
|
+
brandWordmark,
|
|
115
116
|
homeHref = '/',
|
|
116
117
|
banner,
|
|
117
118
|
context,
|
|
@@ -163,6 +164,9 @@
|
|
|
163
164
|
brandTitle?: string;
|
|
164
165
|
/** The mark beside the wordmark — an app's own logo component. */
|
|
165
166
|
brandMark?: Snippet;
|
|
167
|
+
/** A wordmark image (a URL), drawn as a mask in the rail's ink in place of `brandTitle`'s text, which
|
|
168
|
+
* stays its accessible name. */
|
|
169
|
+
brandWordmark?: string;
|
|
166
170
|
/** Where the brand links. */
|
|
167
171
|
homeHref?: string;
|
|
168
172
|
/** Full-width region directly under the top bar: reconnect notices, trials. */
|
|
@@ -592,7 +596,20 @@
|
|
|
592
596
|
{@render brandMark()}
|
|
593
597
|
</span>
|
|
594
598
|
{/if}
|
|
595
|
-
{#if
|
|
599
|
+
{#if brandWordmark && !railNarrow}
|
|
600
|
+
<!--
|
|
601
|
+
Drawn as a mask filled with the rail's ink (`currentColor`), so a
|
|
602
|
+
one-colour wordmark reads on the rail in both themes. The hidden
|
|
603
|
+
image only gives the span its natural width.
|
|
604
|
+
-->
|
|
605
|
+
<span class="relative hidden h-6 sm:inline-block" aria-hidden="true">
|
|
606
|
+
<img src={brandWordmark} alt="" class="invisible h-6 w-auto max-w-none" />
|
|
607
|
+
<span
|
|
608
|
+
class="absolute inset-0 bg-current"
|
|
609
|
+
style="mask: url({brandWordmark}) center left / contain no-repeat; -webkit-mask: url({brandWordmark}) center left / contain no-repeat;"
|
|
610
|
+
></span>
|
|
611
|
+
</span>
|
|
612
|
+
{:else if brandTitle && !railNarrow}
|
|
596
613
|
<!--
|
|
597
614
|
The wordmark stands down below sm, leaving the mark alone. On a phone
|
|
598
615
|
the rail is gone, so this same lockup is what the top bar carries — and
|
|
@@ -105,6 +105,9 @@ type $$ComponentProps = {
|
|
|
105
105
|
brandTitle?: string;
|
|
106
106
|
/** The mark beside the wordmark — an app's own logo component. */
|
|
107
107
|
brandMark?: Snippet;
|
|
108
|
+
/** A wordmark image (a URL), drawn as a mask in the rail's ink in place of `brandTitle`'s text, which
|
|
109
|
+
* stays its accessible name. */
|
|
110
|
+
brandWordmark?: string;
|
|
108
111
|
/** Where the brand links. */
|
|
109
112
|
homeHref?: string;
|
|
110
113
|
/** Full-width region directly under the top bar: reconnect notices, trials. */
|
|
@@ -9,4 +9,4 @@ export { default as PageAside } from './page-aside.svelte';
|
|
|
9
9
|
export { PAGE_TYPES, type PageAsideRegistration, type PageColumnState, type PagePaneRegistration, type PageType } from './page.js';
|
|
10
10
|
export { SHELL_TEXTURES, type ShellTexture } from './texture.js';
|
|
11
11
|
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, shortLocation, navTrail, navChildren, toGroups, toItems, type IconComponent, type NavBadge, type NavChildItem, type NavEntry, type NavGroup, type NavItem, type NavSource } from './types.js';
|
|
12
|
-
export { resolveNav, type ShellAccountLink, type ShellData } from './shell-data.js';
|
|
12
|
+
export { resolveNav, resolvePaletteGroups, type PaletteGroup, type PaletteItem, type ShellAccountLink, type ShellData } from './shell-data.js';
|
|
@@ -8,4 +8,4 @@ export { default as PageAside } from './page-aside.svelte';
|
|
|
8
8
|
export { PAGE_TYPES } from './page.js';
|
|
9
9
|
export { SHELL_TEXTURES } from './texture.js';
|
|
10
10
|
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, shortLocation, navTrail, navChildren, toGroups, toItems } from './types.js';
|
|
11
|
-
export { resolveNav } from './shell-data.js';
|
|
11
|
+
export { resolveNav, resolvePaletteGroups } from './shell-data.js';
|
|
@@ -27,6 +27,19 @@ export interface ShellAccountLink {
|
|
|
27
27
|
icon?: IconComponent;
|
|
28
28
|
/** Shown only to a caller holding `admin`. */
|
|
29
29
|
admin?: boolean;
|
|
30
|
+
/** Shown only to a caller holding this entitlement (`viewer.can`). */
|
|
31
|
+
entitlement?: string;
|
|
32
|
+
}
|
|
33
|
+
/** One destination in a palette group an app declares. */
|
|
34
|
+
export interface PaletteItem {
|
|
35
|
+
label: string;
|
|
36
|
+
href: string;
|
|
37
|
+
icon?: IconComponent;
|
|
38
|
+
}
|
|
39
|
+
/** A group of destinations the palette lists beside the nav (a lessons group). */
|
|
40
|
+
export interface PaletteGroup {
|
|
41
|
+
heading: string;
|
|
42
|
+
items: readonly PaletteItem[];
|
|
30
43
|
}
|
|
31
44
|
export interface ShellData<Viewer = never> {
|
|
32
45
|
/** What this app calls a workspace ("Household"): the menu, the members page and the chooser read it. */
|
|
@@ -36,6 +49,8 @@ export interface ShellData<Viewer = never> {
|
|
|
36
49
|
title: string;
|
|
37
50
|
/** The mark beside the wordmark: a component taking a `class`. */
|
|
38
51
|
mark?: IconComponent;
|
|
52
|
+
/** A wordmark image (a URL), drawn in place of `title`'s text; `title` stays the home link's name. */
|
|
53
|
+
wordmark?: string;
|
|
39
54
|
/** Where the brand links. Default `/`. */
|
|
40
55
|
homeHref?: string;
|
|
41
56
|
};
|
|
@@ -50,6 +65,14 @@ export interface ShellData<Viewer = never> {
|
|
|
50
65
|
railCollapsed?: boolean;
|
|
51
66
|
/** Extra rows in the account menu, after Settings. */
|
|
52
67
|
accountLinks?: readonly ShellAccountLink[];
|
|
68
|
+
/**
|
|
69
|
+
* Extra groups in the ⌘K palette, beside the nav's and the account's: a
|
|
70
|
+
* function of the viewer for rows that depend on who they are. Every app
|
|
71
|
+
* with a chat persona also gets an "Ask" row there; no declaring it.
|
|
72
|
+
*/
|
|
73
|
+
paletteGroups?: readonly PaletteGroup[] | ((viewer: Viewer) => readonly PaletteGroup[]);
|
|
53
74
|
}
|
|
54
75
|
/** The nav as the frame renders it, whichever way the app declared it. */
|
|
55
76
|
export declare function resolveNav<Viewer>(shell: ShellData<Viewer>, viewer: Viewer): NavSource;
|
|
77
|
+
/** The palette groups as the frame renders them, whichever way the app declared them. */
|
|
78
|
+
export declare function resolvePaletteGroups<Viewer>(shell: ShellData<Viewer>, viewer: Viewer): readonly PaletteGroup[];
|
|
@@ -2,3 +2,8 @@
|
|
|
2
2
|
export function resolveNav(shell, viewer) {
|
|
3
3
|
return typeof shell.nav === 'function' ? shell.nav(viewer) : shell.nav;
|
|
4
4
|
}
|
|
5
|
+
/** The palette groups as the frame renders them, whichever way the app declared them. */
|
|
6
|
+
export function resolvePaletteGroups(shell, viewer) {
|
|
7
|
+
const groups = shell.paletteGroups;
|
|
8
|
+
return (typeof groups === 'function' ? groups(viewer) : groups) ?? [];
|
|
9
|
+
}
|
|
@@ -35,7 +35,13 @@
|
|
|
35
35
|
*/
|
|
36
36
|
import type { Snippet } from 'svelte';
|
|
37
37
|
import * as Command from '../command/index.js';
|
|
38
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
isNavGroup,
|
|
40
|
+
navChildren,
|
|
41
|
+
type IconComponent,
|
|
42
|
+
type NavSource
|
|
43
|
+
} from '../app-shell/types.js';
|
|
44
|
+
import type { PaletteGroup } from '../app-shell/shell-data.js';
|
|
39
45
|
|
|
40
46
|
let {
|
|
41
47
|
open = $bindable(false),
|
|
@@ -46,6 +52,7 @@
|
|
|
46
52
|
navHeading = 'Navigate',
|
|
47
53
|
emptyText = 'No results.',
|
|
48
54
|
shortcut = true,
|
|
55
|
+
groups = [],
|
|
49
56
|
lead,
|
|
50
57
|
children
|
|
51
58
|
}: {
|
|
@@ -65,6 +72,8 @@
|
|
|
65
72
|
emptyText?: string;
|
|
66
73
|
/** Bind ⌘K / Ctrl-K to toggle. Turn off to drive `open` yourself. */
|
|
67
74
|
shortcut?: boolean;
|
|
75
|
+
/** Extra groups of destinations beneath the nav group (`shell.paletteGroups`). */
|
|
76
|
+
groups?: readonly PaletteGroup[];
|
|
68
77
|
/** App rows above the nav group, left ungrouped so they stay first while
|
|
69
78
|
* the filter sorts: an action on what was typed. Given, the palette
|
|
70
79
|
* draws no empty line of its own. */
|
|
@@ -73,7 +82,30 @@
|
|
|
73
82
|
children?: Snippet;
|
|
74
83
|
} = $props();
|
|
75
84
|
|
|
76
|
-
|
|
85
|
+
// A child is listed under its section's name ("Section · page"), so two
|
|
86
|
+
// sections each holding an "Open questions" are told apart; a child that is
|
|
87
|
+
// its section's landing page is the section's own row.
|
|
88
|
+
const items = $derived.by(() => {
|
|
89
|
+
const seen = new Set<string>();
|
|
90
|
+
const rows: { label: string; href: string; icon?: IconComponent }[] = [];
|
|
91
|
+
for (const entry of nav ?? []) {
|
|
92
|
+
for (const item of isNavGroup(entry) ? entry.items : [entry]) {
|
|
93
|
+
const candidates = [
|
|
94
|
+
item,
|
|
95
|
+
...navChildren(item).map((child) => ({
|
|
96
|
+
...child,
|
|
97
|
+
label: `${item.label} · ${child.label}`
|
|
98
|
+
}))
|
|
99
|
+
];
|
|
100
|
+
for (const row of candidates) {
|
|
101
|
+
if (seen.has(row.href)) continue;
|
|
102
|
+
seen.add(row.href);
|
|
103
|
+
rows.push(row);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return rows;
|
|
108
|
+
});
|
|
77
109
|
|
|
78
110
|
$effect(() => {
|
|
79
111
|
if (!open) query = '';
|
|
@@ -119,6 +151,18 @@
|
|
|
119
151
|
</Command.Group>
|
|
120
152
|
{/if}
|
|
121
153
|
|
|
154
|
+
{#each groups as group (group.heading)}
|
|
155
|
+
<Command.Separator />
|
|
156
|
+
<Command.Group heading={group.heading}>
|
|
157
|
+
{#each group.items as item (item.href)}
|
|
158
|
+
<Command.Item onSelect={() => go(item.href)} value={`${group.heading} ${item.label}`}>
|
|
159
|
+
{#if item.icon}<item.icon class="mr-2 size-4" />{/if}
|
|
160
|
+
{item.label}
|
|
161
|
+
</Command.Item>
|
|
162
|
+
{/each}
|
|
163
|
+
</Command.Group>
|
|
164
|
+
{/each}
|
|
165
|
+
|
|
122
166
|
{#if children}
|
|
123
167
|
{#if items.length > 0}<Command.Separator />{/if}
|
|
124
168
|
{@render children()}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
*/
|
|
35
35
|
import type { Snippet } from 'svelte';
|
|
36
36
|
import { type NavSource } from '../app-shell/types.js';
|
|
37
|
+
import type { PaletteGroup } from '../app-shell/shell-data.js';
|
|
37
38
|
type $$ComponentProps = {
|
|
38
39
|
open?: boolean;
|
|
39
40
|
/** What the user has typed. Cleared whenever the palette closes. */
|
|
@@ -51,6 +52,8 @@ type $$ComponentProps = {
|
|
|
51
52
|
emptyText?: string;
|
|
52
53
|
/** Bind ⌘K / Ctrl-K to toggle. Turn off to drive `open` yourself. */
|
|
53
54
|
shortcut?: boolean;
|
|
55
|
+
/** Extra groups of destinations beneath the nav group (`shell.paletteGroups`). */
|
|
56
|
+
groups?: readonly PaletteGroup[];
|
|
54
57
|
/** App rows above the nav group, left ungrouped so they stay first while
|
|
55
58
|
* the filter sorts: an action on what was typed. Given, the palette
|
|
56
59
|
* draws no empty line of its own. */
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
eyebrow,
|
|
16
16
|
subtitle,
|
|
17
17
|
meta,
|
|
18
|
+
icon,
|
|
18
19
|
class: className,
|
|
19
20
|
...restProps
|
|
20
21
|
}: HTMLAttributes<HTMLDivElement> & {
|
|
@@ -25,6 +26,8 @@
|
|
|
25
26
|
subtitle?: string;
|
|
26
27
|
/** Facts about the answer, under it: badges, dates, a status. */
|
|
27
28
|
meta?: Snippet;
|
|
29
|
+
/** The mark of the thing the lead is about (a record type's icon), drawn beside the lead. */
|
|
30
|
+
icon?: Snippet;
|
|
28
31
|
} = $props();
|
|
29
32
|
</script>
|
|
30
33
|
|
|
@@ -32,7 +35,14 @@
|
|
|
32
35
|
{#if eyebrow}
|
|
33
36
|
<div class="text-primary text-2xs tracking-eyebrow mb-1 font-medium uppercase">{eyebrow}</div>
|
|
34
37
|
{/if}
|
|
35
|
-
<
|
|
38
|
+
<div class="flex min-w-0 items-center gap-2.5">
|
|
39
|
+
{#if icon}
|
|
40
|
+
<span class="text-muted-foreground grid size-6 flex-none place-items-center" data-slot="page-lead-icon">
|
|
41
|
+
{@render icon()}
|
|
42
|
+
</span>
|
|
43
|
+
{/if}
|
|
44
|
+
<h2 class="font-display max-w-3xl text-xl leading-snug font-semibold" data-answer>{lead}</h2>
|
|
45
|
+
</div>
|
|
36
46
|
{#if subtitle}
|
|
37
47
|
<p class="text-muted-foreground mt-1.5 max-w-4xl text-sm">{subtitle}</p>
|
|
38
48
|
{/if}
|
|
@@ -15,6 +15,8 @@ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
15
15
|
subtitle?: string;
|
|
16
16
|
/** Facts about the answer, under it: badges, dates, a status. */
|
|
17
17
|
meta?: Snippet;
|
|
18
|
+
/** The mark of the thing the lead is about (a record type's icon), drawn beside the lead. */
|
|
19
|
+
icon?: Snippet;
|
|
18
20
|
};
|
|
19
21
|
declare const PageLead: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
20
22
|
type PageLead = ReturnType<typeof PageLead>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.5",
|
|
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.11.
|
|
4
|
+
Generated from `@poodle64/ui@2026.11.5`. 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 [`design-frontend` 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
|
|