@poodle64/ui 2026.10.33 → 2026.11.2
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 +1 -1
- package/dist/components/alerts/alert-bell.svelte +1 -1
- package/dist/components/feedback/report-widget.svelte +1 -1
- package/dist/components/ui/alert/alert-description.svelte +1 -1
- package/dist/components/ui/alert/alert-description.svelte.d.ts +1 -1
- package/dist/components/ui/alert/alert-title.svelte +1 -1
- package/dist/components/ui/alert/alert-title.svelte.d.ts +1 -1
- package/dist/components/ui/alert/alert.svelte +1 -1
- package/dist/components/ui/alert/alert.svelte.d.ts +2 -14
- package/dist/components/ui/app-shell/app-shell.svelte +124 -129
- package/dist/components/ui/app-shell/app-shell.svelte.d.ts +17 -20
- package/dist/components/ui/app-shell/index.d.ts +2 -1
- package/dist/components/ui/app-shell/index.js +2 -1
- package/dist/components/ui/app-shell/page.d.ts +8 -2
- package/dist/components/ui/app-shell/page.js +7 -1
- package/dist/components/ui/app-shell/shell-data.d.ts +55 -0
- package/dist/components/ui/app-shell/shell-data.js +4 -0
- package/dist/components/ui/app-shell/types.d.ts +9 -0
- package/dist/components/ui/app-shell/types.js +33 -0
- package/dist/components/ui/badge/badge.svelte.d.ts +1 -19
- package/dist/components/ui/button/button.svelte.d.ts +1 -39
- package/dist/components/ui/checkbox/checkbox.svelte +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/components/ui/command/command-dialog.svelte.d.ts +1 -1
- package/dist/components/ui/input-group/input-group-addon.svelte.d.ts +1 -15
- package/dist/components/ui/input-group/input-group-button.svelte.d.ts +1 -15
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +1 -1
- package/dist/components/ui/popover/popover-content.svelte +1 -1
- package/dist/components/ui/select/select.svelte.d.ts +1 -1
- package/dist/components/ui/sheet/sheet-content.svelte.d.ts +1 -15
- package/package.json +20 -16
- package/registry/component-map.json +1 -1
- package/registry/component-map.md +1 -1
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ The package therefore imports no app store, no app route and no app brand:
|
|
|
154
154
|
import { goto } from '$app/navigation';
|
|
155
155
|
import AppShell, { type NavGroup } from '@poodle64/ui/app-shell';
|
|
156
156
|
import CommandPalette from '@poodle64/ui/command-palette';
|
|
157
|
-
import { nav } from '
|
|
157
|
+
import { nav } from '#lib/config/navigation'; // typed as NavGroup[]
|
|
158
158
|
|
|
159
159
|
let paletteOpen = $state(false);
|
|
160
160
|
</script>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { Badge } from '../ui/badge/index.js';
|
|
20
20
|
import { Button } from '../ui/button/index.js';
|
|
21
21
|
import * as Popover from '../ui/popover/index.js';
|
|
22
|
-
import { cn } from '../../utils';
|
|
22
|
+
import { cn } from '../../utils.js';
|
|
23
23
|
|
|
24
24
|
// The alerts bell: what machines told this deployment's operator, in the
|
|
25
25
|
// shell's top-bar `actions` slot. App machinery like ReportWidget, mounted
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { Label } from '../ui/label/index.js';
|
|
18
18
|
import Textarea from '../ui/textarea/textarea.svelte';
|
|
19
19
|
import { shellReport } from '../ui/app-shell/report.svelte.js';
|
|
20
|
-
import { getSessionId } from '../../telemetry';
|
|
20
|
+
import { getSessionId } from '../../telemetry.js';
|
|
21
21
|
|
|
22
22
|
// The feedback widget every household app mounts: the one report dialogue.
|
|
23
23
|
// It draws no trigger of its own. While mounted it registers `open` with the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import { type WithElementRef } from '../../../utils';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
5
5
|
children?: Snippet;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import { type WithElementRef } from '../../../utils';
|
|
2
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLHeadingElement>> & {
|
|
5
5
|
children?: Snippet;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
24
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
25
|
-
import { cn, type WithElementRef } from '../../../utils';
|
|
25
|
+
import { cn, type WithElementRef } from '../../../utils.js';
|
|
26
26
|
import type { Snippet } from 'svelte';
|
|
27
27
|
|
|
28
28
|
let {
|
|
@@ -5,22 +5,10 @@ export declare const alertVariants: import("tailwind-variants").TVReturnType<{
|
|
|
5
5
|
destructive: string;
|
|
6
6
|
warning: string;
|
|
7
7
|
};
|
|
8
|
-
}, undefined, "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
9
|
-
variant: {
|
|
10
|
-
default: string;
|
|
11
|
-
destructive: string;
|
|
12
|
-
warning: string;
|
|
13
|
-
};
|
|
14
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
15
|
-
variant: {
|
|
16
|
-
default: string;
|
|
17
|
-
destructive: string;
|
|
18
|
-
warning: string;
|
|
19
|
-
};
|
|
20
|
-
}, undefined, "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", unknown, unknown, undefined>>;
|
|
8
|
+
}, undefined, "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", undefined, undefined, undefined>;
|
|
21
9
|
export type AlertVariant = VariantProps<typeof alertVariants>['variant'];
|
|
22
10
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
23
|
-
import { type WithElementRef } from '../../../utils';
|
|
11
|
+
import { type WithElementRef } from '../../../utils.js';
|
|
24
12
|
import type { Snippet } from 'svelte';
|
|
25
13
|
type $$ComponentProps = WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
26
14
|
variant?: AlertVariant;
|
|
@@ -17,20 +17,17 @@
|
|
|
17
17
|
* always both together. Operator ruling, 31/07/2026: every household app
|
|
18
18
|
* renders one shell shape; apps do not choose variants.
|
|
19
19
|
*
|
|
20
|
-
* The
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* right-hand group with the theme toggle and identity, so that when `context`
|
|
29
|
-
* carries route content the global affordance reads as global rather than as
|
|
30
|
-
* part of the switcher next to it.
|
|
20
|
+
* The bar, left to right: the breadcrumbs (where you are; the last crumb names
|
|
21
|
+
* the page), the app's context and the page's own controls, then from the far
|
|
22
|
+
* right the account, the day/night toggle, the alerts, the report button and
|
|
23
|
+
* a small search (operator ruling, 03/11/2026). The collapse toggle is the
|
|
24
|
+
* sidebar's own, on its top (30/10/2026 and 03/11/2026: a control that works
|
|
25
|
+
* the sidebar belongs on the sidebar, not the bar). Settings are the account
|
|
26
|
+
* menu's. None of it is a prop an app tunes: an app declares data, and the
|
|
27
|
+
* shell lays it out.
|
|
31
28
|
*
|
|
32
29
|
* Content WIDTH is not a prop. A route declares what it is (`pageType`:
|
|
33
|
-
* `reading`, `panel` or `
|
|
30
|
+
* `reading`, `panel`, `tool` or `bare`, see page.ts) and the shell owns everything
|
|
34
31
|
* that follows from it: the column's width and centring, the gutters, the
|
|
35
32
|
* pane flush against the rail, the aside beside the content, and which of
|
|
36
33
|
* them scrolls. The less an app decides, the better (operator, 24/10/2026).
|
|
@@ -92,7 +89,8 @@
|
|
|
92
89
|
import PanelRight from '@lucide/svelte/icons/panel-right';
|
|
93
90
|
import * as Sheet from '../sheet/index.js';
|
|
94
91
|
import AppNav from './app-nav.svelte';
|
|
95
|
-
import {
|
|
92
|
+
import { navTrail, TITLE_SEPARATOR, toItems, type NavSource } from './types.js';
|
|
93
|
+
import Breadcrumbs, { type BreadcrumbItem } from '../breadcrumbs/breadcrumbs.svelte';
|
|
96
94
|
import BarActions from './bar-actions.svelte';
|
|
97
95
|
import { shellReport } from './report.svelte.js';
|
|
98
96
|
import {
|
|
@@ -122,11 +120,11 @@
|
|
|
122
120
|
onSearch,
|
|
123
121
|
searchLabel = 'Search…',
|
|
124
122
|
searchShortcut = '⌘K',
|
|
125
|
-
searchPlacement = 'leading',
|
|
126
123
|
themeToggle = true,
|
|
127
124
|
onToggleTheme,
|
|
128
125
|
pageType = 'reading',
|
|
129
126
|
title,
|
|
127
|
+
breadcrumbs,
|
|
130
128
|
texture = 'grid',
|
|
131
129
|
children
|
|
132
130
|
}: {
|
|
@@ -185,14 +183,6 @@
|
|
|
185
183
|
searchLabel?: string;
|
|
186
184
|
/** The shortcut hint rendered in the search affordance; '' hides the kbd. */
|
|
187
185
|
searchShortcut?: string;
|
|
188
|
-
/**
|
|
189
|
-
* Where the search affordance sits in the top bar. `leading` (default)
|
|
190
|
-
* keeps its historical position just after the `context` slot; `trailing`
|
|
191
|
-
* moves it into the right-hand group with the theme toggle and identity —
|
|
192
|
-
* for when `context` carries route content and search should read as a
|
|
193
|
-
* global control rather than as part of it.
|
|
194
|
-
*/
|
|
195
|
-
searchPlacement?: 'leading' | 'trailing';
|
|
196
186
|
themeToggle?: boolean;
|
|
197
187
|
/** Override the theme action. Defaults to mode-watcher's toggleMode. */
|
|
198
188
|
onToggleTheme?: () => void;
|
|
@@ -207,6 +197,13 @@
|
|
|
207
197
|
* pane names where the reader is. Apps pass `page.data.title`.
|
|
208
198
|
*/
|
|
209
199
|
title?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The trail the bar carries, when the rail's own rows and `title` do not say
|
|
202
|
+
* it: the route's load data (`page.data.breadcrumbs`). The last crumb names the
|
|
203
|
+
* page. Left off, the trail is the rail's row (and its section) for the
|
|
204
|
+
* current path, then `title` where that names something deeper.
|
|
205
|
+
*/
|
|
206
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
210
207
|
/**
|
|
211
208
|
* The house atmosphere on the content region: `grid` (a dot-grid floor
|
|
212
209
|
* plus a corner vignette) or `none`.
|
|
@@ -241,19 +238,21 @@
|
|
|
241
238
|
// say: the pane is never dropped for a missing declaration.
|
|
242
239
|
const type = $derived<PageType>(slots.pane ? 'panel' : pageType);
|
|
243
240
|
|
|
244
|
-
// Where the user is,
|
|
245
|
-
//
|
|
246
|
-
//
|
|
247
|
-
// is named by its pane ("Settings › Account") or
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
241
|
+
// Where the user is, as the trail the bar carries: the route's own, else the
|
|
242
|
+
// rail's row (and section) for the path, then the page's `title` where it
|
|
243
|
+
// names something deeper than the row (a detail under its list). A page the
|
|
244
|
+
// rail has no row for is named by its pane ("Settings › Account") or its
|
|
245
|
+
// title. The LAST crumb names the page: it is the document's one heading,
|
|
246
|
+
// visually hidden, and the page body carries no title of its own.
|
|
247
|
+
const trail = $derived.by<BreadcrumbItem[]>(() => {
|
|
248
|
+
if (breadcrumbs && breadcrumbs.length > 0) return breadcrumbs;
|
|
249
|
+
const fromNav = navTrail(nav, currentPath, title);
|
|
250
|
+
if (fromNav.length > 0) return fromNav;
|
|
251
|
+
const pane = type === 'panel' ? slots.pane?.location : undefined;
|
|
252
|
+
const named = pane ?? title;
|
|
253
|
+
return named ? named.split(TITLE_SEPARATOR).map((label) => ({ label })) : [];
|
|
254
|
+
});
|
|
255
|
+
const pageName = $derived(trail.at(-1)?.label);
|
|
257
256
|
|
|
258
257
|
// The page's status and actions, registered by `<ShellActions>` from the route.
|
|
259
258
|
// Raw, not deep, so the page that registered it can find it again to withdraw it.
|
|
@@ -616,11 +615,8 @@
|
|
|
616
615
|
{/snippet}
|
|
617
616
|
|
|
618
617
|
<!--
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
markup, same `data-testid`, same behaviour; only the sizing classes differ.
|
|
622
|
-
`sizing` is where the difference lives: leading fills the row (`flex-1`),
|
|
623
|
-
trailing sizes to its clamp without stretching the right-hand group.
|
|
618
|
+
The one search button: small, the leftmost of the bar's right-hand controls.
|
|
619
|
+
`sizing` is its width at each tier.
|
|
624
620
|
-->
|
|
625
621
|
{#snippet searchButton(sizing: string)}
|
|
626
622
|
<!--
|
|
@@ -652,6 +648,9 @@
|
|
|
652
648
|
</button>
|
|
653
649
|
{/snippet}
|
|
654
650
|
|
|
651
|
+
{#if type === 'bare'}
|
|
652
|
+
{@render children()}
|
|
653
|
+
{:else}
|
|
655
654
|
<div class="ds-shell bg-background text-foreground flex h-dvh overflow-hidden">
|
|
656
655
|
<!-- WCAG 2.4.1: every app gets the bypass link, rather than one app having it. -->
|
|
657
656
|
<a href="#ds-main" class="ds-skip-link">Skip to content</a>
|
|
@@ -708,7 +707,44 @@
|
|
|
708
707
|
</button>
|
|
709
708
|
{/if}
|
|
710
709
|
|
|
711
|
-
|
|
710
|
+
<!--
|
|
711
|
+
The rail's head: the brand and, from md, the collapse toggle, on the
|
|
712
|
+
sidebar's top (operator, 03/11/2026: "the sidebar toggle sits on the
|
|
713
|
+
sidebar itself, at its top, not on the rail"). Collapsed (to icons, or
|
|
714
|
+
peeking) the two stack, the toggle under the mark, so no row moves when
|
|
715
|
+
the rail peeks.
|
|
716
|
+
-->
|
|
717
|
+
<div
|
|
718
|
+
class={cn(
|
|
719
|
+
'ds-shell-rail-head flex flex-none items-center',
|
|
720
|
+
railCollapsed && 'flex-col items-start pb-1'
|
|
721
|
+
)}
|
|
722
|
+
data-testid="ds-rail-head"
|
|
723
|
+
>
|
|
724
|
+
<div class={railCollapsed ? 'w-full' : 'min-w-0 flex-1'}>
|
|
725
|
+
{@render brandLockup()}
|
|
726
|
+
</div>
|
|
727
|
+
{#if collapsible && !mobileNavOpen}
|
|
728
|
+
<button
|
|
729
|
+
type="button"
|
|
730
|
+
onclick={toggleCollapsed}
|
|
731
|
+
class={cn(
|
|
732
|
+
'border-border text-shell-muted-foreground hover:text-shell-foreground grid size-8 flex-none place-items-center rounded-md border transition-colors',
|
|
733
|
+
railCollapsed ? 'ml-3' : 'mr-3'
|
|
734
|
+
)}
|
|
735
|
+
aria-label={collapseLabel}
|
|
736
|
+
aria-pressed={collapsed}
|
|
737
|
+
title={`${collapseLabel} (press [)`}
|
|
738
|
+
data-testid="ds-rail-collapse"
|
|
739
|
+
>
|
|
740
|
+
{#if collapsed}
|
|
741
|
+
<PanelLeftOpen class="size-4" aria-hidden="true" />
|
|
742
|
+
{:else}
|
|
743
|
+
<PanelLeftClose class="size-4" aria-hidden="true" />
|
|
744
|
+
{/if}
|
|
745
|
+
</button>
|
|
746
|
+
{/if}
|
|
747
|
+
</div>
|
|
712
748
|
<AppNav
|
|
713
749
|
{nav}
|
|
714
750
|
{currentPath}
|
|
@@ -719,52 +755,26 @@
|
|
|
719
755
|
/>
|
|
720
756
|
|
|
721
757
|
<!--
|
|
722
|
-
The rail's foot
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
top rail instead of the sidebar"). From md the report is the bar's icon.
|
|
727
|
-
Settings is the account menu's, never a row here. `.ds-nav` gives the
|
|
728
|
-
rows the rail's ink, its centring when collapsed and its peek padding.
|
|
758
|
+
The rail's foot, in the phone's drawer only: the one place feedback sits
|
|
759
|
+
there, where nothing floats over the page. From md the report is the
|
|
760
|
+
bar's icon. Settings is the account menu's, never a row here. `.ds-nav`
|
|
761
|
+
gives the row the rail's ink.
|
|
729
762
|
-->
|
|
730
|
-
{#if mobileNavOpen
|
|
731
|
-
<div
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
}}
|
|
746
|
-
>
|
|
747
|
-
<Bug class="ds-nav-icon size-[1.125rem] flex-none" aria-hidden="true" />
|
|
748
|
-
<span class="truncate">Report a problem</span>
|
|
749
|
-
</button>
|
|
750
|
-
{:else}
|
|
751
|
-
<button
|
|
752
|
-
type="button"
|
|
753
|
-
onclick={toggleCollapsed}
|
|
754
|
-
class="ds-nav-item w-full"
|
|
755
|
-
aria-label={collapseLabel}
|
|
756
|
-
aria-pressed={collapsed}
|
|
757
|
-
title={`${collapseLabel} (press [)`}
|
|
758
|
-
data-testid="ds-rail-collapse"
|
|
759
|
-
>
|
|
760
|
-
{#if collapsed}
|
|
761
|
-
<PanelLeftOpen class="size-[1.125rem] flex-none" aria-hidden="true" />
|
|
762
|
-
{:else}
|
|
763
|
-
<PanelLeftClose class="size-[1.125rem] flex-none" aria-hidden="true" />
|
|
764
|
-
{/if}
|
|
765
|
-
{#if !railNarrow}<span class="truncate">{collapsed ? 'Expand' : 'Collapse'}</span>{/if}
|
|
766
|
-
</button>
|
|
767
|
-
{/if}
|
|
763
|
+
{#if mobileNavOpen && shellReport.open}
|
|
764
|
+
<div class="ds-shell-rail-foot ds-nav mt-auto">
|
|
765
|
+
<button
|
|
766
|
+
type="button"
|
|
767
|
+
class="ds-nav-item w-full"
|
|
768
|
+
data-testid="ds-shell-drawer-report"
|
|
769
|
+
onclick={() => {
|
|
770
|
+
const open = shellReport.open;
|
|
771
|
+
closeMobileNav();
|
|
772
|
+
open?.();
|
|
773
|
+
}}
|
|
774
|
+
>
|
|
775
|
+
<Bug class="ds-nav-icon size-[1.125rem] flex-none" aria-hidden="true" />
|
|
776
|
+
<span class="truncate">Report a problem</span>
|
|
777
|
+
</button>
|
|
768
778
|
</div>
|
|
769
779
|
{/if}
|
|
770
780
|
{#if collapsible && !railCollapsed && !mobileNavOpen}
|
|
@@ -792,6 +802,11 @@
|
|
|
792
802
|
<header
|
|
793
803
|
class="ds-shell-bar bg-shell/80 text-shell-foreground border-border sticky top-0 z-20 flex min-h-14 flex-none flex-wrap items-center gap-2 border-b px-3 pt-[calc(0.5rem+env(safe-area-inset-top))] pb-2 backdrop-blur sm:gap-3 sm:px-5"
|
|
794
804
|
>
|
|
805
|
+
<!-- The page carries no title of its own: the last crumb names it, and this
|
|
806
|
+
visually hidden heading keeps the document's outline. It sits in the
|
|
807
|
+
bar, beside the trail it repeats, so the page body stays the page's. -->
|
|
808
|
+
{#if pageName}<h1 class="sr-only" data-testid="ds-page-heading">{pageName}</h1>{/if}
|
|
809
|
+
|
|
795
810
|
{#if hasNav}
|
|
796
811
|
<!-- `aria-controls` names the region this toggle opens. It is present
|
|
797
812
|
whenever that region is in the document, which is always — the
|
|
@@ -820,29 +835,15 @@
|
|
|
820
835
|
{@render brandLockup(true)}
|
|
821
836
|
</span>
|
|
822
837
|
|
|
823
|
-
<!--
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
wordmark and the search button already carry their own shrink
|
|
833
|
-
behaviour (hiding text, going icon-only); `context` is the one
|
|
834
|
-
leading slot that never had to. -->
|
|
835
|
-
{#if context}<div class="min-w-0">{@render context()}</div>{/if}
|
|
836
|
-
|
|
837
|
-
<!-- Where you are, then the page's scope controls. Inline with the
|
|
838
|
-
rest of the bar from xl; below that, controls take a second row
|
|
839
|
-
of the bar, and a bare label shows from md and not on a phone. -->
|
|
840
|
-
<!-- Where you are, then the page's scope controls. From sm they share one
|
|
841
|
-
row, inline from xl and on the bar's second row below it. On a phone
|
|
842
|
-
the wrapper steps aside (`contents`): the title takes the free room
|
|
843
|
-
of the first row, truncated, and the controls take the second row
|
|
844
|
-
whole. -->
|
|
845
|
-
{#if location || controls.content}
|
|
838
|
+
<!-- The bar, left to right: where you are (the breadcrumbs), the app's own
|
|
839
|
+
context (a workspace switch), the page's controls, then, from the far
|
|
840
|
+
right, the search, the report, the alerts, the day/night toggle and the
|
|
841
|
+
account (operator ruling, 03/11/2026). `min-w-0` lets the trail shrink
|
|
842
|
+
under crowding rather than floor at its own content and push the
|
|
843
|
+
trailing controls past the bar's edge (design-system#111). The trail
|
|
844
|
+
stays inline from sm; the page's controls take a second row of the bar
|
|
845
|
+
below xl, and on a phone the trail takes the first row's free room. -->
|
|
846
|
+
{#if trail.length > 0 || context || controls.content}
|
|
846
847
|
<div
|
|
847
848
|
class={cn(
|
|
848
849
|
'flex min-w-0 items-center gap-2 max-sm:contents sm:gap-3',
|
|
@@ -850,15 +851,14 @@
|
|
|
850
851
|
)}
|
|
851
852
|
data-testid="ds-shell-location"
|
|
852
853
|
>
|
|
853
|
-
{#if
|
|
854
|
-
<
|
|
855
|
-
|
|
856
|
-
|
|
854
|
+
{#if trail.length > 0}
|
|
855
|
+
<Breadcrumbs
|
|
856
|
+
items={trail}
|
|
857
|
+
class="min-w-0 max-sm:flex-1 max-sm:basis-0"
|
|
857
858
|
data-testid="ds-shell-title"
|
|
858
|
-
|
|
859
|
-
><span class="contents sm:hidden">{shortName}</span>{:else}{location}{/if}</span
|
|
860
|
-
>
|
|
859
|
+
/>
|
|
861
860
|
{/if}
|
|
861
|
+
{#if context}<div class="min-w-0">{@render context()}</div>{/if}
|
|
862
862
|
{#if controls.content}
|
|
863
863
|
<div
|
|
864
864
|
class="flex min-w-0 items-center gap-2 max-sm:order-last max-sm:basis-full sm:gap-3"
|
|
@@ -870,12 +870,6 @@
|
|
|
870
870
|
</div>
|
|
871
871
|
{/if}
|
|
872
872
|
|
|
873
|
-
{#if onSearch && searchPlacement === 'leading'}
|
|
874
|
-
{@render searchButton(
|
|
875
|
-
'h-9 w-9 flex-none justify-center px-0 sm:h-auto sm:w-[clamp(200px,24vw,420px)] sm:flex-1 sm:justify-start sm:gap-2 sm:px-3 sm:py-1.5'
|
|
876
|
-
)}
|
|
877
|
-
{/if}
|
|
878
|
-
|
|
879
873
|
<div class="ml-auto flex flex-none items-center gap-2 sm:gap-3">
|
|
880
874
|
<!-- The page's own columns where they do not fit beside it: the pane
|
|
881
875
|
and the aside open as sheets from here, before everything the bar
|
|
@@ -911,9 +905,14 @@
|
|
|
911
905
|
</button>
|
|
912
906
|
{/if}
|
|
913
907
|
|
|
914
|
-
{#if
|
|
908
|
+
{#if pageBar.current}
|
|
909
|
+
<BarActions bar={pageBar.current} />
|
|
910
|
+
<span class="bg-border hidden h-6 w-px flex-none sm:block" aria-hidden="true"></span>
|
|
911
|
+
{/if}
|
|
912
|
+
|
|
913
|
+
{#if onSearch}
|
|
915
914
|
{@render searchButton(
|
|
916
|
-
'h-9 w-9 flex-none justify-center px-0 sm:h-
|
|
915
|
+
'h-9 w-9 flex-none justify-center px-0 sm:h-9 sm:w-[clamp(7rem,11vw,10rem)] sm:justify-start sm:gap-2 sm:px-3'
|
|
917
916
|
)}
|
|
918
917
|
{/if}
|
|
919
918
|
|
|
@@ -932,11 +931,6 @@
|
|
|
932
931
|
</button>
|
|
933
932
|
{/if}
|
|
934
933
|
|
|
935
|
-
{#if pageBar.current}
|
|
936
|
-
<BarActions bar={pageBar.current} />
|
|
937
|
-
<span class="bg-border hidden h-6 w-px flex-none sm:block" aria-hidden="true"></span>
|
|
938
|
-
{/if}
|
|
939
|
-
|
|
940
934
|
{#if actions}{@render actions()}{/if}
|
|
941
935
|
|
|
942
936
|
{#if themeToggle}
|
|
@@ -1085,3 +1079,4 @@
|
|
|
1085
1079
|
</Sheet.Content>
|
|
1086
1080
|
</Sheet.Root>
|
|
1087
1081
|
{/if}
|
|
1082
|
+
{/if}
|
|
@@ -16,20 +16,17 @@
|
|
|
16
16
|
* always both together. Operator ruling, 31/07/2026: every household app
|
|
17
17
|
* renders one shell shape; apps do not choose variants.
|
|
18
18
|
*
|
|
19
|
-
* The
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* right-hand group with the theme toggle and identity, so that when `context`
|
|
28
|
-
* carries route content the global affordance reads as global rather than as
|
|
29
|
-
* part of the switcher next to it.
|
|
19
|
+
* The bar, left to right: the breadcrumbs (where you are; the last crumb names
|
|
20
|
+
* the page), the app's context and the page's own controls, then from the far
|
|
21
|
+
* right the account, the day/night toggle, the alerts, the report button and
|
|
22
|
+
* a small search (operator ruling, 03/11/2026). The collapse toggle is the
|
|
23
|
+
* sidebar's own, on its top (30/10/2026 and 03/11/2026: a control that works
|
|
24
|
+
* the sidebar belongs on the sidebar, not the bar). Settings are the account
|
|
25
|
+
* menu's. None of it is a prop an app tunes: an app declares data, and the
|
|
26
|
+
* shell lays it out.
|
|
30
27
|
*
|
|
31
28
|
* Content WIDTH is not a prop. A route declares what it is (`pageType`:
|
|
32
|
-
* `reading`, `panel` or `
|
|
29
|
+
* `reading`, `panel`, `tool` or `bare`, see page.ts) and the shell owns everything
|
|
33
30
|
* that follows from it: the column's width and centring, the gutters, the
|
|
34
31
|
* pane flush against the rail, the aside beside the content, and which of
|
|
35
32
|
* them scrolls. The less an app decides, the better (operator, 24/10/2026).
|
|
@@ -71,6 +68,7 @@ import type { Snippet } from 'svelte';
|
|
|
71
68
|
import { type PageType } from './page.js';
|
|
72
69
|
import type { ShellTexture } from './texture.js';
|
|
73
70
|
import { type NavSource } from './types.js';
|
|
71
|
+
import { type BreadcrumbItem } from '../breadcrumbs/breadcrumbs.svelte';
|
|
74
72
|
type $$ComponentProps = {
|
|
75
73
|
/** Navigation: bare items, groups, or a mix. Filter for permissions first. */
|
|
76
74
|
nav?: NavSource;
|
|
@@ -127,14 +125,6 @@ type $$ComponentProps = {
|
|
|
127
125
|
searchLabel?: string;
|
|
128
126
|
/** The shortcut hint rendered in the search affordance; '' hides the kbd. */
|
|
129
127
|
searchShortcut?: string;
|
|
130
|
-
/**
|
|
131
|
-
* Where the search affordance sits in the top bar. `leading` (default)
|
|
132
|
-
* keeps its historical position just after the `context` slot; `trailing`
|
|
133
|
-
* moves it into the right-hand group with the theme toggle and identity —
|
|
134
|
-
* for when `context` carries route content and search should read as a
|
|
135
|
-
* global control rather than as part of it.
|
|
136
|
-
*/
|
|
137
|
-
searchPlacement?: 'leading' | 'trailing';
|
|
138
128
|
themeToggle?: boolean;
|
|
139
129
|
/** Override the theme action. Defaults to mode-watcher's toggleMode. */
|
|
140
130
|
onToggleTheme?: () => void;
|
|
@@ -149,6 +139,13 @@ type $$ComponentProps = {
|
|
|
149
139
|
* pane names where the reader is. Apps pass `page.data.title`.
|
|
150
140
|
*/
|
|
151
141
|
title?: string;
|
|
142
|
+
/**
|
|
143
|
+
* The trail the bar carries, when the rail's own rows and `title` do not say
|
|
144
|
+
* it: the route's load data (`page.data.breadcrumbs`). The last crumb names the
|
|
145
|
+
* page. Left off, the trail is the rail's row (and its section) for the
|
|
146
|
+
* current path, then `title` where that names something deeper.
|
|
147
|
+
*/
|
|
148
|
+
breadcrumbs?: BreadcrumbItem[];
|
|
152
149
|
/**
|
|
153
150
|
* The house atmosphere on the content region: `grid` (a dot-grid floor
|
|
154
151
|
* plus a corner vignette) or `none`.
|
|
@@ -8,4 +8,5 @@ export { default as PagePane } from './page-pane.svelte';
|
|
|
8
8
|
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
|
-
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, shortLocation, navChildren, toGroups, toItems, type IconComponent, type NavBadge, type NavChildItem, type NavEntry, type NavGroup, type NavItem, type NavSource } from './types.js';
|
|
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';
|
|
@@ -7,4 +7,5 @@ export { default as PagePane } from './page-pane.svelte';
|
|
|
7
7
|
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
|
-
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, shortLocation, navChildren, toGroups, toItems } from './types.js';
|
|
10
|
+
export { activeNavTitle, hasActiveNavChild, isNavGroup, isNavItemActive, shortLocation, navTrail, navChildren, toGroups, toItems } from './types.js';
|
|
11
|
+
export { resolveNav } from './shell-data.js';
|
|
@@ -11,15 +11,21 @@
|
|
|
11
11
|
* - `tool`: the whole frame, the content filling its height and scrolling
|
|
12
12
|
* inside itself; the page never scrolls. An aside stands at the frame's
|
|
13
13
|
* right edge, and below 80rem of window opens as a sheet from the bar.
|
|
14
|
+
* - `bare`: no rail and no bar, the route owning the whole window (a deck, a
|
|
15
|
+
* workshop, a print view). The one type that is not a frame; nothing but a
|
|
16
|
+
* presentation surface picks it.
|
|
17
|
+
*
|
|
18
|
+
* No type draws a title: the bar's last crumb names the page, and the shell's
|
|
19
|
+
* visually hidden heading keeps the outline.
|
|
14
20
|
*
|
|
15
21
|
* The widths are `--ds-page-*` custom properties (`styles.css`), so an app
|
|
16
22
|
* retunes one in one declaration; it never writes a width of its own.
|
|
17
23
|
*/
|
|
18
24
|
import { type Snippet } from 'svelte';
|
|
19
25
|
import type { IconComponent } from './types.js';
|
|
20
|
-
export type PageType = 'reading' | 'panel' | 'tool';
|
|
26
|
+
export type PageType = 'reading' | 'panel' | 'tool' | 'bare';
|
|
21
27
|
/** Every page type, the default first. */
|
|
22
|
-
export declare const PAGE_TYPES: readonly ["reading", "panel", "tool"];
|
|
28
|
+
export declare const PAGE_TYPES: readonly ["reading", "panel", "tool", "bare"];
|
|
23
29
|
/** Where a pane or an aside is drawn just now, and how to put it away. */
|
|
24
30
|
export interface PageColumnState {
|
|
25
31
|
/** `column` beside the content, `sheet` over it from the bar, `stacked` after it (a reading aside). */
|
|
@@ -11,13 +11,19 @@
|
|
|
11
11
|
* - `tool`: the whole frame, the content filling its height and scrolling
|
|
12
12
|
* inside itself; the page never scrolls. An aside stands at the frame's
|
|
13
13
|
* right edge, and below 80rem of window opens as a sheet from the bar.
|
|
14
|
+
* - `bare`: no rail and no bar, the route owning the whole window (a deck, a
|
|
15
|
+
* workshop, a print view). The one type that is not a frame; nothing but a
|
|
16
|
+
* presentation surface picks it.
|
|
17
|
+
*
|
|
18
|
+
* No type draws a title: the bar's last crumb names the page, and the shell's
|
|
19
|
+
* visually hidden heading keeps the outline.
|
|
14
20
|
*
|
|
15
21
|
* The widths are `--ds-page-*` custom properties (`styles.css`), so an app
|
|
16
22
|
* retunes one in one declaration; it never writes a width of its own.
|
|
17
23
|
*/
|
|
18
24
|
import { getContext, setContext } from 'svelte';
|
|
19
25
|
/** Every page type, the default first. */
|
|
20
|
-
export const PAGE_TYPES = ['reading', 'panel', 'tool'];
|
|
26
|
+
export const PAGE_TYPES = ['reading', 'panel', 'tool', 'bare'];
|
|
21
27
|
const KEY = Symbol('ds-page-slots');
|
|
22
28
|
const IN_COLUMN = Symbol('ds-page-in-column');
|
|
23
29
|
export function providePageSlots(slots) {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an app declares about its shell: data, never markup. The factory's frame
|
|
3
|
+
* (the template's `app-frame.svelte`) reads it and lays the rail, the sidebar
|
|
4
|
+
* and the page frame out to the operator's ruling of 03/11/2026: "Apps just
|
|
5
|
+
* declare what they need in the sidebar... Apps own their own domain logic and
|
|
6
|
+
* what they put on the screens, not what the screens look like."
|
|
7
|
+
*
|
|
8
|
+
* export const shell: ShellData<typeof auth> = {
|
|
9
|
+
* workspaceLabel: 'Household',
|
|
10
|
+
* brand: { title: 'Casefile', mark: Folder },
|
|
11
|
+
* nav: (viewer) => [
|
|
12
|
+
* { items: [{ label: 'Matters', href: '/matters', icon: FolderOpen }] },
|
|
13
|
+
* ...(viewer.can('admin') ? [{ items: [{ label: 'Access', href: '/access' }] }] : [])
|
|
14
|
+
* ]
|
|
15
|
+
* };
|
|
16
|
+
*
|
|
17
|
+
* What a screen is rides its route's load data, not this file: `pageType`
|
|
18
|
+
* (`reading`, `panel`, `tool` or `bare`, page.ts), `title` (the last crumb) and,
|
|
19
|
+
* for a detail deeper than the rail's row, `breadcrumbs`.
|
|
20
|
+
*/
|
|
21
|
+
import type { IconComponent, NavSource } from './types.js';
|
|
22
|
+
/** One extra row in the account menu, beside the Settings item every app has. */
|
|
23
|
+
export interface ShellAccountLink {
|
|
24
|
+
label: string;
|
|
25
|
+
/** Where it goes. */
|
|
26
|
+
href: string;
|
|
27
|
+
icon?: IconComponent;
|
|
28
|
+
/** Shown only to a caller holding `admin`. */
|
|
29
|
+
admin?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface ShellData<Viewer = never> {
|
|
32
|
+
/** What this app calls a workspace ("Household"): the menu, the members page and the chooser read it. */
|
|
33
|
+
workspaceLabel: string;
|
|
34
|
+
brand: {
|
|
35
|
+
/** The wordmark text, and the home link's accessible name. */
|
|
36
|
+
title: string;
|
|
37
|
+
/** The mark beside the wordmark: a component taking a `class`. */
|
|
38
|
+
mark?: IconComponent;
|
|
39
|
+
/** Where the brand links. Default `/`. */
|
|
40
|
+
homeHref?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* The rail's navigation: bare items, groups, or a mix, or a function of the
|
|
44
|
+
* signed-in viewer for rows that depend on who they are. Empty until the
|
|
45
|
+
* viewer is known if the function says so; the shell knows nothing of
|
|
46
|
+
* permissions.
|
|
47
|
+
*/
|
|
48
|
+
nav: NavSource | ((viewer: Viewer) => NavSource);
|
|
49
|
+
/** The rail starts folded to icons, until the reader opens it. Default open. */
|
|
50
|
+
railCollapsed?: boolean;
|
|
51
|
+
/** Extra rows in the account menu, after Settings. */
|
|
52
|
+
accountLinks?: readonly ShellAccountLink[];
|
|
53
|
+
}
|
|
54
|
+
/** The nav as the frame renders it, whichever way the app declared it. */
|
|
55
|
+
export declare function resolveNav<Viewer>(shell: ShellData<Viewer>, viewer: Viewer): NavSource;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* const nav = $derived(allNav.filter((i) => !i.adminOnly || user.isAdmin));
|
|
18
18
|
*/
|
|
19
19
|
import type { Component } from 'svelte';
|
|
20
|
+
import type { BreadcrumbItem } from '../breadcrumbs/breadcrumbs.svelte';
|
|
20
21
|
/** A Lucide (or equivalent) icon component: takes a class, renders an SVG. */
|
|
21
22
|
export type IconComponent = Component<{
|
|
22
23
|
class?: string;
|
|
@@ -175,6 +176,14 @@ export declare const TITLE_SEPARATOR = " \u203A ";
|
|
|
175
176
|
* nothing matches, so an unlisted route renders no title rather than a wrong one.
|
|
176
177
|
*/
|
|
177
178
|
export declare function activeNavTitle(nav: NavSource | undefined, currentPath: string | undefined): string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* The breadcrumb trail for where the user is, from the rail's own rows: a
|
|
181
|
+
* section that discloses children is its first crumb (linked), the page the
|
|
182
|
+
* last. `title` names the page itself when it differs from the row that owns it
|
|
183
|
+
* (a detail page under its list: "Matters › 6 Winfield"), and the last crumb is
|
|
184
|
+
* never a link. An unlisted route has no trail here: the caller names it.
|
|
185
|
+
*/
|
|
186
|
+
export declare function navTrail(nav: NavSource | undefined, currentPath: string | undefined, title?: string): BreadcrumbItem[];
|
|
178
187
|
/**
|
|
179
188
|
* The phone bar's one name for where the user is: the page's own name, never a
|
|
180
189
|
* trail. A child that is its section's landing page (its `href` is the
|
|
@@ -129,6 +129,39 @@ export function activeNavTitle(nav, currentPath) {
|
|
|
129
129
|
}
|
|
130
130
|
return undefined;
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* The breadcrumb trail for where the user is, from the rail's own rows: a
|
|
134
|
+
* section that discloses children is its first crumb (linked), the page the
|
|
135
|
+
* last. `title` names the page itself when it differs from the row that owns it
|
|
136
|
+
* (a detail page under its list: "Matters › 6 Winfield"), and the last crumb is
|
|
137
|
+
* never a link. An unlisted route has no trail here: the caller names it.
|
|
138
|
+
*/
|
|
139
|
+
export function navTrail(nav, currentPath, title) {
|
|
140
|
+
const trail = [];
|
|
141
|
+
if (currentPath) {
|
|
142
|
+
for (const item of toItems(nav)) {
|
|
143
|
+
const child = navChildren(item).find((c) => isNavItemActive(c, currentPath));
|
|
144
|
+
if (child) {
|
|
145
|
+
// A child that is its section's landing page is named by the section.
|
|
146
|
+
trail.push({ label: item.label, href: item.href });
|
|
147
|
+
if (child.href !== item.href)
|
|
148
|
+
trail.push({ label: child.label, href: child.href });
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (isNavItemActive(item, currentPath)) {
|
|
152
|
+
trail.push({ label: item.label, href: item.href });
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const last = trail.at(-1);
|
|
158
|
+
if (!last)
|
|
159
|
+
return trail;
|
|
160
|
+
if (title && last.label !== title)
|
|
161
|
+
trail.push({ label: title });
|
|
162
|
+
delete trail[trail.length - 1].href;
|
|
163
|
+
return trail;
|
|
164
|
+
}
|
|
132
165
|
/**
|
|
133
166
|
* The phone bar's one name for where the user is: the page's own name, never a
|
|
134
167
|
* trail. A child that is its section's landing page (its `href` is the
|
|
@@ -8,25 +8,7 @@ export declare const badgeVariants: import("tailwind-variants").TVReturnType<{
|
|
|
8
8
|
ghost: string;
|
|
9
9
|
link: string;
|
|
10
10
|
};
|
|
11
|
-
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none",
|
|
12
|
-
variant: {
|
|
13
|
-
default: string;
|
|
14
|
-
secondary: string;
|
|
15
|
-
destructive: string;
|
|
16
|
-
outline: string;
|
|
17
|
-
ghost: string;
|
|
18
|
-
link: string;
|
|
19
|
-
};
|
|
20
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
21
|
-
variant: {
|
|
22
|
-
default: string;
|
|
23
|
-
secondary: string;
|
|
24
|
-
destructive: string;
|
|
25
|
-
outline: string;
|
|
26
|
-
ghost: string;
|
|
27
|
-
link: string;
|
|
28
|
-
};
|
|
29
|
-
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none", unknown, unknown, undefined>>;
|
|
11
|
+
}, undefined, "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none", undefined, undefined, undefined>;
|
|
30
12
|
export type BadgeVariant = VariantProps<typeof badgeVariants>['variant'];
|
|
31
13
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
32
14
|
import { type WithElementRef } from '../../../utils.js';
|
|
@@ -20,45 +20,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
20
20
|
'icon-sm': string;
|
|
21
21
|
'icon-lg': string;
|
|
22
22
|
};
|
|
23
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
24
|
-
variant: {
|
|
25
|
-
default: string;
|
|
26
|
-
outline: string;
|
|
27
|
-
secondary: string;
|
|
28
|
-
ghost: string;
|
|
29
|
-
destructive: string;
|
|
30
|
-
link: string;
|
|
31
|
-
};
|
|
32
|
-
size: {
|
|
33
|
-
default: string;
|
|
34
|
-
xs: string;
|
|
35
|
-
sm: string;
|
|
36
|
-
lg: string;
|
|
37
|
-
icon: string;
|
|
38
|
-
'icon-xs': string;
|
|
39
|
-
'icon-sm': string;
|
|
40
|
-
'icon-lg': string;
|
|
41
|
-
};
|
|
42
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
43
|
-
variant: {
|
|
44
|
-
default: string;
|
|
45
|
-
outline: string;
|
|
46
|
-
secondary: string;
|
|
47
|
-
ghost: string;
|
|
48
|
-
destructive: string;
|
|
49
|
-
link: string;
|
|
50
|
-
};
|
|
51
|
-
size: {
|
|
52
|
-
default: string;
|
|
53
|
-
xs: string;
|
|
54
|
-
sm: string;
|
|
55
|
-
lg: string;
|
|
56
|
-
icon: string;
|
|
57
|
-
'icon-xs': string;
|
|
58
|
-
'icon-sm': string;
|
|
59
|
-
'icon-lg': string;
|
|
60
|
-
};
|
|
61
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
23
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", undefined, undefined, undefined>;
|
|
62
24
|
export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
|
|
63
25
|
export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
|
|
64
26
|
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { Checkbox as CheckboxPrimitive } from 'bits-ui';
|
|
3
3
|
import Check from '@lucide/svelte/icons/check';
|
|
4
4
|
import Minus from '@lucide/svelte/icons/minus';
|
|
5
|
-
import { cn, type WithoutChildrenOrChild } from '../../../utils';
|
|
5
|
+
import { cn, type WithoutChildrenOrChild } from '../../../utils.js';
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
ref = $bindable(null),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Checkbox as CheckboxPrimitive } from 'bits-ui';
|
|
2
|
-
import { type WithoutChildrenOrChild } from '../../../utils';
|
|
2
|
+
import { type WithoutChildrenOrChild } from '../../../utils.js';
|
|
3
3
|
type $$ComponentProps = WithoutChildrenOrChild<CheckboxPrimitive.RootProps> & {
|
|
4
4
|
class?: string;
|
|
5
5
|
};
|
|
@@ -9,6 +9,6 @@ type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.RootProps> & With
|
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
class?: string;
|
|
11
11
|
};
|
|
12
|
-
declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "ref" | "
|
|
12
|
+
declare const CommandDialog: import("svelte").Component<$$ComponentProps, {}, "ref" | "open" | "value">;
|
|
13
13
|
type CommandDialog = ReturnType<typeof CommandDialog>;
|
|
14
14
|
export default CommandDialog;
|
|
@@ -6,21 +6,7 @@ export declare const inputGroupAddonVariants: import("tailwind-variants").TVRetu
|
|
|
6
6
|
'block-start': string;
|
|
7
7
|
'block-end': string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",
|
|
10
|
-
align: {
|
|
11
|
-
'inline-start': string;
|
|
12
|
-
'inline-end': string;
|
|
13
|
-
'block-start': string;
|
|
14
|
-
'block-end': string;
|
|
15
|
-
};
|
|
16
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
-
align: {
|
|
18
|
-
'inline-start': string;
|
|
19
|
-
'inline-end': string;
|
|
20
|
-
'block-start': string;
|
|
21
|
-
'block-end': string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", unknown, unknown, undefined>>;
|
|
9
|
+
}, undefined, "text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none", undefined, undefined, undefined>;
|
|
24
10
|
export type InputGroupAddonAlign = VariantProps<typeof inputGroupAddonVariants>['align'];
|
|
25
11
|
import { type WithElementRef } from '../../../utils.js';
|
|
26
12
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -6,21 +6,7 @@ declare const inputGroupButtonVariants: import("tailwind-variants").TVReturnType
|
|
|
6
6
|
'icon-xs': string;
|
|
7
7
|
'icon-sm': string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "gap-2 text-sm flex items-center shadow-none",
|
|
10
|
-
size: {
|
|
11
|
-
xs: string;
|
|
12
|
-
sm: string;
|
|
13
|
-
'icon-xs': string;
|
|
14
|
-
'icon-sm': string;
|
|
15
|
-
};
|
|
16
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
-
size: {
|
|
18
|
-
xs: string;
|
|
19
|
-
sm: string;
|
|
20
|
-
'icon-xs': string;
|
|
21
|
-
'icon-sm': string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "gap-2 text-sm flex items-center shadow-none", unknown, unknown, undefined>>;
|
|
9
|
+
}, undefined, "gap-2 text-sm flex items-center shadow-none", undefined, undefined, undefined>;
|
|
24
10
|
export type InputGroupButtonSize = VariantProps<typeof inputGroupButtonVariants>['size'];
|
|
25
11
|
import type { ComponentProps } from 'svelte';
|
|
26
12
|
import { Button } from '../button/index.js';
|
|
@@ -2,7 +2,7 @@ declare const InputGroupInput: import("svelte").Component<(Omit<import("svelte/e
|
|
|
2
2
|
type: "file";
|
|
3
3
|
files?: FileList;
|
|
4
4
|
} | {
|
|
5
|
-
type?: "number" | "
|
|
5
|
+
type?: "number" | "submit" | "reset" | "button" | "search" | "checkbox" | "radio" | (string & {}) | "text" | "tel" | "url" | "email" | "hidden" | "color" | "password" | "date" | "time" | "datetime-local" | "image" | "month" | "range" | "week";
|
|
6
6
|
files?: undefined;
|
|
7
7
|
})) & {
|
|
8
8
|
ref?: HTMLElement | null | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const Select: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "
|
|
1
|
+
declare const Select: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "open" | "value">;
|
|
2
2
|
type Select = ReturnType<typeof Select>;
|
|
3
3
|
export default Select;
|
|
@@ -6,21 +6,7 @@ export declare const sheetVariants: import("tailwind-variants").TVReturnType<{
|
|
|
6
6
|
bottom: string;
|
|
7
7
|
top: string;
|
|
8
8
|
};
|
|
9
|
-
}, undefined, "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out border-border fixed z-50 flex flex-col text-sm outline-none duration-200 ease-out data-closed:duration-150",
|
|
10
|
-
side: {
|
|
11
|
-
right: string;
|
|
12
|
-
left: string;
|
|
13
|
-
bottom: string;
|
|
14
|
-
top: string;
|
|
15
|
-
};
|
|
16
|
-
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
17
|
-
side: {
|
|
18
|
-
right: string;
|
|
19
|
-
left: string;
|
|
20
|
-
bottom: string;
|
|
21
|
-
top: string;
|
|
22
|
-
};
|
|
23
|
-
}, undefined, "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out border-border fixed z-50 flex flex-col text-sm outline-none duration-200 ease-out data-closed:duration-150", unknown, unknown, undefined>>;
|
|
9
|
+
}, undefined, "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out border-border fixed z-50 flex flex-col text-sm outline-none duration-200 ease-out data-closed:duration-150", undefined, undefined, undefined>;
|
|
24
10
|
export type SheetSide = VariantProps<typeof sheetVariants>['side'];
|
|
25
11
|
import { Dialog as SheetPrimitive } from 'bits-ui';
|
|
26
12
|
import type { ComponentProps, Snippet } from 'svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.2",
|
|
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",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"bits-ui": "^2.18.1",
|
|
59
|
-
"formsnap": "^2.0
|
|
59
|
+
"formsnap": "^2.1.0",
|
|
60
60
|
"mode-watcher": "^1.1.0",
|
|
61
61
|
"svelte": "^5.33.0",
|
|
62
62
|
"svelte-sonner": "^1.1.1",
|
|
63
|
-
"sveltekit-superforms": "^2.30.0"
|
|
63
|
+
"sveltekit-superforms": "^2.30.0 || ^3.0.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"mode-watcher": {
|
|
@@ -87,45 +87,49 @@
|
|
|
87
87
|
"esm-env": "^1.2.2",
|
|
88
88
|
"html-to-image": "^1.11.13",
|
|
89
89
|
"tailwind-merge": "^3.6.0",
|
|
90
|
-
"tailwind-variants": "^
|
|
90
|
+
"tailwind-variants": "^4.0.0",
|
|
91
91
|
"tw-animate-css": "^1.4.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@poodle64/design-tokens": "workspace:*",
|
|
95
|
-
"@sveltejs/kit": "^
|
|
96
|
-
"@sveltejs/package": "^
|
|
95
|
+
"@sveltejs/kit": "^3.0.0",
|
|
96
|
+
"@sveltejs/package": "^3.0.0",
|
|
97
97
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
98
98
|
"@tailwindcss/cli": "^4.3.2",
|
|
99
99
|
"@testing-library/jest-dom": "^7.0.0",
|
|
100
100
|
"@testing-library/svelte": "^5.4.2",
|
|
101
101
|
"@types/d3-force": "^3.0.10",
|
|
102
|
-
"@types/node": "^
|
|
102
|
+
"@types/node": "^24.10.0",
|
|
103
103
|
"axe-core": "^4.14.0",
|
|
104
104
|
"bits-ui": "^2.18.1",
|
|
105
|
-
"formsnap": "^2.0
|
|
106
|
-
"jsdom": "^
|
|
105
|
+
"formsnap": "^2.1.0",
|
|
106
|
+
"jsdom": "^30.1.3",
|
|
107
107
|
"mode-watcher": "^1.1.0",
|
|
108
108
|
"playwright": "^1.62.0",
|
|
109
109
|
"publint": "^0.3.15",
|
|
110
|
-
"svelte": "^5.
|
|
111
|
-
"svelte-check": "^4.
|
|
110
|
+
"svelte": "^5.57.2",
|
|
111
|
+
"svelte-check": "^4.7.5",
|
|
112
112
|
"svelte-sonner": "^1.1.1",
|
|
113
|
-
"sveltekit-superforms": "^
|
|
113
|
+
"sveltekit-superforms": "^3.1.0",
|
|
114
114
|
"tailwindcss": "^4.3.2",
|
|
115
115
|
"typescript": "^6.0.3",
|
|
116
116
|
"vite": "^8.0.16",
|
|
117
|
-
"vitest": "^
|
|
117
|
+
"vitest": "^5.0.5"
|
|
118
118
|
},
|
|
119
119
|
"scripts": {
|
|
120
|
-
"build": "node scripts/generate-registry.mjs && svelte-
|
|
120
|
+
"build": "node scripts/generate-registry.mjs && svelte-package && publint",
|
|
121
121
|
"registry": "node scripts/generate-registry.mjs",
|
|
122
122
|
"registry:check": "node scripts/generate-registry.mjs --check",
|
|
123
|
-
"check": "svelte-
|
|
123
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
124
124
|
"test": "pnpm run build && vitest run",
|
|
125
125
|
"test:browser": "pnpm run harness:build && node harness/drive.mjs && node harness/graph.mjs",
|
|
126
126
|
"prepublishOnly": "pnpm run build",
|
|
127
127
|
"harness:build": "vite build --config harness/vite.config.ts && tailwindcss -i harness/harness.css -o harness/dist/app.css --minify",
|
|
128
128
|
"harness:serve": "python3 -m http.server 4180 --directory harness/dist"
|
|
129
129
|
},
|
|
130
|
-
"packageManager": "pnpm@
|
|
130
|
+
"packageManager": "pnpm@12.16.1",
|
|
131
|
+
"imports": {
|
|
132
|
+
"#lib": "./src/lib/index.js",
|
|
133
|
+
"#lib/*": "./src/lib/*"
|
|
134
|
+
}
|
|
131
135
|
}
|
|
@@ -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.
|
|
4
|
+
Generated from `@poodle64/ui@2026.11.2`. 75 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
|
|