@poodle64/ui 2026.10.19 → 2026.10.21
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 +2 -0
- package/dist/components/ui/app-shell/app-shell.svelte +64 -9
- package/dist/components/ui/command-palette/command-palette.svelte +19 -1
- package/dist/components/ui/command-palette/command-palette.svelte.d.ts +14 -1
- package/dist/components/ui/ledger/ledger.d.ts +5 -3
- package/dist/components/ui/ledger/ledger.js +11 -4
- package/dist/components/ui/ledger/ledger.svelte +20 -8
- package/dist/components/ui/ledger/ledger.svelte.d.ts +8 -0
- package/dist/styles.css +16 -1
- package/package.json +1 -1
- package/registry/component-map.json +1 -1
- package/registry/component-map.md +1 -1
package/README.md
CHANGED
|
@@ -1000,6 +1000,8 @@ no module rebuilds them and a need one module finds becomes a toggle for all.
|
|
|
1000
1000
|
| `columns` | The module's columns, in order after the amount. The keys `date`, `title`, `amount` and `balance` are the ledger's own cells: list one to rename or resize it (the title reads "Description" until the module names it), and list `balance` to offer the running balance at all, with `text` saying what it counts (money, a coin, units). A column `on: 'wide'` is ticked only on a wide ledger. A `cell` snippet's links and buttons take their own clicks; the rest of the cell opens the row. A column's `sort` gives the real value its head sorts by (a number, not its text); a `text` column sorts by its text without one, a `cell`-only column does not sort, and the balance never does. |
|
|
1001
1001
|
| `preferences`, `onPreferencesChange` | The viewer's `{ columns, period }`. Missing fields take the module's defaults (each column's `on`, the balance off, grouped by month); an unknown column key is ignored. The ledger stores nothing. |
|
|
1002
1002
|
| `fyStart` | The month a financial year starts, 1–12. July by default; anything else groups from July and logs an error in development. |
|
|
1003
|
+
| `dateFormat` | `'short'` (default, "30 Jun 2026") or `'numeric'`, the household's "30/06/2026" ("30/06" narrow). |
|
|
1004
|
+
| `groupTotals` | `true` by default. `false` omits each group's net, in and out, for a list of `conversion` rows. |
|
|
1003
1005
|
| `locale`, `currency` | Every figure, amounts, nets and counts, in this locale (`AU_LOCALE` by default) and currency (AUD). Dates keep the drawn "15 Sep": the ledger's words are English. |
|
|
1004
1006
|
| `title`, `meta`, `actions`, `tools`, `action` | The bar on the page ground, a `ListToolbar`: its title (a heading), the count beside it, the module's own controls after the Columns menu, its icon actions (each named by its tooltip) and its one labelled action. |
|
|
1005
1007
|
| `selected`, `bulkActions` | Ticking exists only with `bulkActions`, whose snippet gets the ticked rows in the bar that replaces the toolbar. |
|
|
@@ -310,6 +310,53 @@
|
|
|
310
310
|
// that), so this can never suppress a legitimate desktop collapse.
|
|
311
311
|
const railCollapsed = $derived(collapsible && collapsed && !mobileNavOpen);
|
|
312
312
|
|
|
313
|
+
// A collapsed rail PEEKS: while a mouse rests on it, or keyboard focus is
|
|
314
|
+
// inside it, it widens over the page to show labels, and slims again when
|
|
315
|
+
// either leaves. The page does not reflow (the rail keeps its slim slot and
|
|
316
|
+
// the extra width overlays; see `data-peek` in styles.css). `collapsed` is
|
|
317
|
+
// untouched, so what an app persists is still the user's pin, the toggle.
|
|
318
|
+
//
|
|
319
|
+
// Pointer peeks need a mouse or pen: a touch tap fires pointerenter too, and
|
|
320
|
+
// a rail that opened on a tap would sit over the link being aimed at. Below
|
|
321
|
+
// md the rail is a drawer, never `railCollapsed`, so this cannot arise there.
|
|
322
|
+
// Focus peeks only for keyboard focus (`:focus-visible`), so pressing the
|
|
323
|
+
// toggle with a mouse does not hold the rail open. `peekSuppressed` is the
|
|
324
|
+
// other half of that: collapsing from under the pointer would otherwise peek
|
|
325
|
+
// at once and read as a toggle that did nothing, so it waits for the pointer
|
|
326
|
+
// to leave first.
|
|
327
|
+
const PEEK_DELAY_MS = 120;
|
|
328
|
+
let pointerOn = $state(false);
|
|
329
|
+
let focusIn = $state(false);
|
|
330
|
+
let peekSuppressed = $state(false);
|
|
331
|
+
let peekTimer: ReturnType<typeof setTimeout> | undefined;
|
|
332
|
+
const peeking = $derived(railCollapsed && !peekSuppressed && (pointerOn || focusIn));
|
|
333
|
+
// What the rail DRAWS: labels while peeking, icons otherwise.
|
|
334
|
+
const railNarrow = $derived(railCollapsed && !peeking);
|
|
335
|
+
|
|
336
|
+
function peekPointerEnter(event: PointerEvent) {
|
|
337
|
+
if (event.pointerType === 'touch') return;
|
|
338
|
+
clearTimeout(peekTimer);
|
|
339
|
+
peekTimer = setTimeout(() => (pointerOn = true), PEEK_DELAY_MS);
|
|
340
|
+
}
|
|
341
|
+
function peekPointerLeave() {
|
|
342
|
+
clearTimeout(peekTimer);
|
|
343
|
+
pointerOn = false;
|
|
344
|
+
peekSuppressed = false;
|
|
345
|
+
}
|
|
346
|
+
function peekFocusIn(event: FocusEvent) {
|
|
347
|
+
const target = event.target as HTMLElement | null;
|
|
348
|
+
if (target?.matches?.(':focus-visible')) focusIn = true;
|
|
349
|
+
}
|
|
350
|
+
function peekFocusOut(event: FocusEvent) {
|
|
351
|
+
const next = event.relatedTarget as Node | null;
|
|
352
|
+
if (!next || !(event.currentTarget as HTMLElement).contains(next)) focusIn = false;
|
|
353
|
+
}
|
|
354
|
+
function toggleCollapsed() {
|
|
355
|
+
collapsed = !collapsed;
|
|
356
|
+
peekSuppressed = true;
|
|
357
|
+
}
|
|
358
|
+
$effect(() => () => clearTimeout(peekTimer));
|
|
359
|
+
|
|
313
360
|
// The collapse toggle's accessible name states what pressing it will DO, so it
|
|
314
361
|
// flips with the state: collapsed → "Expand", expanded → "Collapse".
|
|
315
362
|
const collapseLabel = $derived(collapsed ? 'Expand sidebar' : 'Collapse sidebar');
|
|
@@ -411,7 +458,7 @@
|
|
|
411
458
|
!e.altKey &&
|
|
412
459
|
!isTypingTarget(e.target)
|
|
413
460
|
) {
|
|
414
|
-
|
|
461
|
+
toggleCollapsed();
|
|
415
462
|
}
|
|
416
463
|
}}
|
|
417
464
|
/>
|
|
@@ -422,7 +469,7 @@
|
|
|
422
469
|
class={cn(
|
|
423
470
|
'flex flex-none items-center gap-2.5',
|
|
424
471
|
compact ? '' : 'h-14 px-4',
|
|
425
|
-
|
|
472
|
+
railNarrow && !compact && 'justify-center px-0'
|
|
426
473
|
)}
|
|
427
474
|
aria-label={brandTitle ?? 'Home'}
|
|
428
475
|
>
|
|
@@ -443,7 +490,7 @@
|
|
|
443
490
|
{@render brandMark()}
|
|
444
491
|
</span>
|
|
445
492
|
{/if}
|
|
446
|
-
{#if brandTitle && !
|
|
493
|
+
{#if brandTitle && !railNarrow}
|
|
447
494
|
<!--
|
|
448
495
|
The wordmark stands down below sm, leaving the mark alone. On a phone
|
|
449
496
|
the rail is gone, so this same lockup is what the top bar carries — and
|
|
@@ -534,6 +581,7 @@
|
|
|
534
581
|
class="ds-shell-rail bg-shell text-shell-foreground border-border flex-none flex-col border-r"
|
|
535
582
|
style={railWidth ? `--ds-shell-rail-width: ${railWidth}px` : undefined}
|
|
536
583
|
data-collapsed={railCollapsed ? 'true' : undefined}
|
|
584
|
+
data-peek={peeking ? 'true' : undefined}
|
|
537
585
|
data-resizing={resizing ? 'true' : undefined}
|
|
538
586
|
data-drawer={mobileNavOpen ? 'true' : undefined}
|
|
539
587
|
data-testid={mobileNavOpen ? 'ds-shell-drawer' : undefined}
|
|
@@ -541,6 +589,10 @@
|
|
|
541
589
|
aria-modal={mobileNavOpen ? 'true' : undefined}
|
|
542
590
|
aria-label={mobileNavOpen ? 'Navigation' : undefined}
|
|
543
591
|
onkeydown={trapTab}
|
|
592
|
+
onpointerenter={peekPointerEnter}
|
|
593
|
+
onpointerleave={peekPointerLeave}
|
|
594
|
+
onfocusin={peekFocusIn}
|
|
595
|
+
onfocusout={peekFocusOut}
|
|
544
596
|
>
|
|
545
597
|
{#if mobileNavOpen}
|
|
546
598
|
<button
|
|
@@ -564,14 +616,14 @@
|
|
|
564
616
|
not apply — the same reason the foot control carried `md:flex`.
|
|
565
617
|
-->
|
|
566
618
|
{#if collapsible}
|
|
567
|
-
<div class={cn('flex items-center',
|
|
619
|
+
<div class={cn('flex items-center', railNarrow ? 'flex-col gap-1 py-2' : 'pr-2')}>
|
|
568
620
|
{@render brandLockup()}
|
|
569
621
|
<button
|
|
570
622
|
type="button"
|
|
571
|
-
onclick={
|
|
623
|
+
onclick={toggleCollapsed}
|
|
572
624
|
class={cn(
|
|
573
625
|
'text-shell-muted-foreground hover:text-shell-foreground hidden size-8 flex-none place-items-center rounded-md transition-colors md:grid',
|
|
574
|
-
!
|
|
626
|
+
!railNarrow && 'ml-auto'
|
|
575
627
|
)}
|
|
576
628
|
aria-label={collapseLabel}
|
|
577
629
|
aria-pressed={collapsed}
|
|
@@ -591,7 +643,7 @@
|
|
|
591
643
|
<AppNav
|
|
592
644
|
{nav}
|
|
593
645
|
{currentPath}
|
|
594
|
-
collapsed={
|
|
646
|
+
collapsed={railNarrow}
|
|
595
647
|
label={navLabel}
|
|
596
648
|
onNavigate={() => (mobileNavOpen = false)}
|
|
597
649
|
/>
|
|
@@ -617,7 +669,7 @@
|
|
|
617
669
|
onclick={() => (mobileNavOpen = false)}
|
|
618
670
|
>
|
|
619
671
|
<Settings class="ds-nav-icon size-[1.125rem] flex-none" aria-hidden="true" />
|
|
620
|
-
<span class={
|
|
672
|
+
<span class={railNarrow && !mobileNavOpen ? 'sr-only' : 'truncate'}>
|
|
621
673
|
{settingsLabel}
|
|
622
674
|
</span>
|
|
623
675
|
</a>
|
|
@@ -629,7 +681,10 @@
|
|
|
629
681
|
bind:dragging={resizing}
|
|
630
682
|
storageKey="ds-shell-rail-width"
|
|
631
683
|
snap={170}
|
|
632
|
-
onsnap={() =>
|
|
684
|
+
onsnap={() => {
|
|
685
|
+
collapsed = true;
|
|
686
|
+
peekSuppressed = true;
|
|
687
|
+
}}
|
|
633
688
|
data-testid="ds-rail-resize"
|
|
634
689
|
/>
|
|
635
690
|
{/if}
|
|
@@ -15,6 +15,17 @@
|
|
|
15
15
|
* let paletteOpen = $state(false);
|
|
16
16
|
* <AppShell {nav} onSearch={() => (paletteOpen = true)}>…</AppShell>
|
|
17
17
|
* <CommandPalette bind:open={paletteOpen} {nav} onNavigate={goto} />
|
|
18
|
+
*
|
|
19
|
+
* `query` is the text in the input, bindable, so an app can offer a row that
|
|
20
|
+
* acts on what was typed ("Ask the agent: …", "Search everything for …"). Pass
|
|
21
|
+
* `forceMount` on that row, or the palette's own filter hides it the moment
|
|
22
|
+
* the text matches no label:
|
|
23
|
+
*
|
|
24
|
+
* <CommandPalette bind:open bind:query {nav}>
|
|
25
|
+
* {#if query.trim()}
|
|
26
|
+
* <Command.Item forceMount value="ask" onSelect={() => ask(query)}>Ask: {query}</Command.Item>
|
|
27
|
+
* {/if}
|
|
28
|
+
* </CommandPalette>
|
|
18
29
|
*/
|
|
19
30
|
import type { Snippet } from 'svelte';
|
|
20
31
|
import * as Command from '../command/index.js';
|
|
@@ -22,6 +33,7 @@
|
|
|
22
33
|
|
|
23
34
|
let {
|
|
24
35
|
open = $bindable(false),
|
|
36
|
+
query = $bindable(''),
|
|
25
37
|
nav,
|
|
26
38
|
onNavigate,
|
|
27
39
|
placeholder = 'Search…',
|
|
@@ -31,6 +43,8 @@
|
|
|
31
43
|
children
|
|
32
44
|
}: {
|
|
33
45
|
open?: boolean;
|
|
46
|
+
/** What the user has typed. Cleared whenever the palette closes. */
|
|
47
|
+
query?: string;
|
|
34
48
|
/** The same value passed to AppShell. Filter for permissions first. */
|
|
35
49
|
nav?: NavSource;
|
|
36
50
|
/**
|
|
@@ -50,6 +64,10 @@
|
|
|
50
64
|
|
|
51
65
|
const items = $derived(toItems(nav));
|
|
52
66
|
|
|
67
|
+
$effect(() => {
|
|
68
|
+
if (!open) query = '';
|
|
69
|
+
});
|
|
70
|
+
|
|
53
71
|
function go(href: string) {
|
|
54
72
|
open = false;
|
|
55
73
|
if (onNavigate) onNavigate(href);
|
|
@@ -71,7 +89,7 @@
|
|
|
71
89
|
/>
|
|
72
90
|
|
|
73
91
|
<Command.Dialog bind:open title="Command palette" description={placeholder}>
|
|
74
|
-
<Command.Input {placeholder} />
|
|
92
|
+
<Command.Input {placeholder} bind:value={query} />
|
|
75
93
|
<Command.List>
|
|
76
94
|
<Command.Empty>{emptyText}</Command.Empty>
|
|
77
95
|
|
|
@@ -14,11 +14,24 @@
|
|
|
14
14
|
* let paletteOpen = $state(false);
|
|
15
15
|
* <AppShell {nav} onSearch={() => (paletteOpen = true)}>…</AppShell>
|
|
16
16
|
* <CommandPalette bind:open={paletteOpen} {nav} onNavigate={goto} />
|
|
17
|
+
*
|
|
18
|
+
* `query` is the text in the input, bindable, so an app can offer a row that
|
|
19
|
+
* acts on what was typed ("Ask the agent: …", "Search everything for …"). Pass
|
|
20
|
+
* `forceMount` on that row, or the palette's own filter hides it the moment
|
|
21
|
+
* the text matches no label:
|
|
22
|
+
*
|
|
23
|
+
* <CommandPalette bind:open bind:query {nav}>
|
|
24
|
+
* {#if query.trim()}
|
|
25
|
+
* <Command.Item forceMount value="ask" onSelect={() => ask(query)}>Ask: {query}</Command.Item>
|
|
26
|
+
* {/if}
|
|
27
|
+
* </CommandPalette>
|
|
17
28
|
*/
|
|
18
29
|
import type { Snippet } from 'svelte';
|
|
19
30
|
import { type NavSource } from '../app-shell/types.js';
|
|
20
31
|
type $$ComponentProps = {
|
|
21
32
|
open?: boolean;
|
|
33
|
+
/** What the user has typed. Cleared whenever the palette closes. */
|
|
34
|
+
query?: string;
|
|
22
35
|
/** The same value passed to AppShell. Filter for permissions first. */
|
|
23
36
|
nav?: NavSource;
|
|
24
37
|
/**
|
|
@@ -35,6 +48,6 @@ type $$ComponentProps = {
|
|
|
35
48
|
/** Extra command groups: app-specific actions beneath the nav group. */
|
|
36
49
|
children?: Snippet;
|
|
37
50
|
};
|
|
38
|
-
declare const CommandPalette: import("svelte").Component<$$ComponentProps, {}, "open">;
|
|
51
|
+
declare const CommandPalette: import("svelte").Component<$$ComponentProps, {}, "open" | "query">;
|
|
39
52
|
type CommandPalette = ReturnType<typeof CommandPalette>;
|
|
40
53
|
export default CommandPalette;
|
|
@@ -3,12 +3,14 @@ export declare const LEDGER_PERIODS: readonly {
|
|
|
3
3
|
value: LedgerPeriod;
|
|
4
4
|
label: string;
|
|
5
5
|
}[];
|
|
6
|
-
/** "15 Sep", or "15
|
|
7
|
-
export
|
|
6
|
+
/** How a date reads: "15 Sep 2026" (`short`), or the household's "15/09/2026" (`numeric`). */
|
|
7
|
+
export type LedgerDateFormat = 'short' | 'numeric';
|
|
8
|
+
/** "15 Sep", or "15 Sep 2026" with the year; `numeric` gives "15/09" and "15/09/2026". */
|
|
9
|
+
export declare function ledgerDate(iso: string, withYear?: boolean, format?: LedgerDateFormat): string;
|
|
8
10
|
/** The group a date falls in: sortable, so newer keys sort later. */
|
|
9
11
|
export declare function periodKey(iso: string, period: LedgerPeriod, fyStart?: number): string;
|
|
10
12
|
/** A group's label: "FY 2025–26", "2026", "September 2026", "15 to 21 Sep 2026", "Tuesday 15 Sep 2026". */
|
|
11
|
-
export declare function periodLabel(key: string, period: LedgerPeriod, fyStart?: number, withYear?: boolean): string;
|
|
13
|
+
export declare function periodLabel(key: string, period: LedgerPeriod, fyStart?: number, withYear?: boolean, format?: LedgerDateFormat): string;
|
|
12
14
|
/** "Jul 2025 to Jun 2026", or "Jul 2026 to now" for the year still open on `today`. */
|
|
13
15
|
export declare function fySpan(key: string, fyStart?: number, today?: string): string;
|
|
14
16
|
/** Rows newest first, a day's rows in the order given, grouped by period. */
|
|
@@ -40,9 +40,13 @@ function isoOf(t) {
|
|
|
40
40
|
const pad = (n) => String(n).padStart(2, '0');
|
|
41
41
|
return `${t.getUTCFullYear()}-${pad(t.getUTCMonth() + 1)}-${pad(t.getUTCDate())}`;
|
|
42
42
|
}
|
|
43
|
-
/** "15 Sep", or "15 Sep 2026" with the year. */
|
|
44
|
-
export function ledgerDate(iso, withYear = true) {
|
|
43
|
+
/** "15 Sep", or "15 Sep 2026" with the year; `numeric` gives "15/09" and "15/09/2026". */
|
|
44
|
+
export function ledgerDate(iso, withYear = true, format = 'short') {
|
|
45
45
|
const [y, m, d] = parts(iso);
|
|
46
|
+
if (format === 'numeric') {
|
|
47
|
+
const dm = `${String(d).padStart(2, '0')}/${String(m).padStart(2, '0')}`;
|
|
48
|
+
return withYear ? `${dm}/${y}` : dm;
|
|
49
|
+
}
|
|
46
50
|
return `${d} ${MONTHS[m - 1]}${withYear ? ` ${y}` : ''}`;
|
|
47
51
|
}
|
|
48
52
|
/** The year a financial year ends in. A January start makes it the calendar year. */
|
|
@@ -71,7 +75,7 @@ export function periodKey(iso, period, fyStart = 7) {
|
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
/** A group's label: "FY 2025–26", "2026", "September 2026", "15 to 21 Sep 2026", "Tuesday 15 Sep 2026". */
|
|
74
|
-
export function periodLabel(key, period, fyStart = 7, withYear = true) {
|
|
78
|
+
export function periodLabel(key, period, fyStart = 7, withYear = true, format = 'short') {
|
|
75
79
|
switch (period) {
|
|
76
80
|
case 'fy': {
|
|
77
81
|
const end = Number(key);
|
|
@@ -85,12 +89,15 @@ export function periodLabel(key, period, fyStart = 7, withYear = true) {
|
|
|
85
89
|
const end = isoOf(shift(key, 6));
|
|
86
90
|
const [sy, sm, sd] = parts(key);
|
|
87
91
|
const [ey, em] = parts(end);
|
|
92
|
+
if (format === 'numeric') {
|
|
93
|
+
return `${ledgerDate(key, withYear || sy !== ey, format)} to ${ledgerDate(end, withYear || sy !== ey, format)}`;
|
|
94
|
+
}
|
|
88
95
|
const start = `${sd}${sm !== em ? ` ${MONTHS[sm - 1]}` : ''}${sy !== ey ? ` ${sy}` : ''}`;
|
|
89
96
|
return `${start} to ${ledgerDate(end, withYear || sy !== ey)}`;
|
|
90
97
|
}
|
|
91
98
|
case 'day': {
|
|
92
99
|
const [y, m, d] = parts(key);
|
|
93
|
-
return `${WEEKDAYS[new Date(Date.UTC(y, m - 1, d)).getUTCDay()]} ${ledgerDate(key, withYear)}`;
|
|
100
|
+
return `${WEEKDAYS[new Date(Date.UTC(y, m - 1, d)).getUTCDay()]} ${ledgerDate(key, withYear, format)}`;
|
|
94
101
|
}
|
|
95
102
|
default:
|
|
96
103
|
return '';
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
sortRows,
|
|
61
61
|
windowOf
|
|
62
62
|
} from './ledger.js';
|
|
63
|
+
import type { LedgerDateFormat } from './ledger.js';
|
|
63
64
|
import type { LedgerColumn, LedgerOpenContext, LedgerPreferences, LedgerRow } from './types.js';
|
|
64
65
|
|
|
65
66
|
type Id = R['id'];
|
|
@@ -71,6 +72,8 @@
|
|
|
71
72
|
onPreferencesChange,
|
|
72
73
|
preferencesNote,
|
|
73
74
|
fyStart = 7,
|
|
75
|
+
dateFormat = 'short',
|
|
76
|
+
groupTotals = true,
|
|
74
77
|
currency = 'AUD',
|
|
75
78
|
locale = AU_LOCALE,
|
|
76
79
|
noun = ['transaction', 'transactions'],
|
|
@@ -102,6 +105,13 @@
|
|
|
102
105
|
preferencesNote?: string;
|
|
103
106
|
/** The month a financial year starts, 1–12. July by default. */
|
|
104
107
|
fyStart?: number;
|
|
108
|
+
/** How dates read: "30 Jun 2026" (`short`), or the household's "30/06/2026" (`numeric`). */
|
|
109
|
+
dateFormat?: LedgerDateFormat;
|
|
110
|
+
/**
|
|
111
|
+
* Show each group's net, and in and out. Turn off for rows that are all
|
|
112
|
+
* `conversion`, whose group totals would read $0.00.
|
|
113
|
+
*/
|
|
114
|
+
groupTotals?: boolean;
|
|
105
115
|
currency?: string;
|
|
106
116
|
/** BCP 47 locale for every figure: amounts, nets and counts. */
|
|
107
117
|
locale?: string;
|
|
@@ -425,6 +435,7 @@
|
|
|
425
435
|
return { net: (inn + out) / 100, inn: inn / 100, out: out / 100 };
|
|
426
436
|
}
|
|
427
437
|
|
|
438
|
+
const date = (iso: string, withYear = true) => ledgerDate(iso, withYear, dateFormat);
|
|
428
439
|
const money = (value: number | string) => ledgerMoney(value, currency, locale);
|
|
429
440
|
const number = (n: number) => n.toLocaleString(locale);
|
|
430
441
|
const titleColumn = $derived(resolved.find((c) => c.key === 'title'));
|
|
@@ -500,7 +511,7 @@
|
|
|
500
511
|
{@const through = openable && THROUGH}
|
|
501
512
|
{#if c.key === 'date'}
|
|
502
513
|
<span class={cn(CELL, through, 'text-muted-foreground self-center tabular-nums')} {style}>
|
|
503
|
-
{
|
|
514
|
+
{date(r.date, WIDE)}
|
|
504
515
|
{#if c.actions}<span class="pointer-events-auto flex flex-none items-center gap-1" data-slot="ledger-actions">{@render c.actions(r)}</span>{/if}
|
|
505
516
|
</span>
|
|
506
517
|
{:else if c.key === 'title'}
|
|
@@ -571,7 +582,7 @@
|
|
|
571
582
|
{#each og.lines as l, i (i)}
|
|
572
583
|
{#if PHONE}
|
|
573
584
|
<div role="listitem" class="flex items-center gap-3 px-3 py-1.5 text-xs">
|
|
574
|
-
<span class="text-muted-foreground tabular-nums">{
|
|
585
|
+
<span class="text-muted-foreground tabular-nums">{date(l.date, false)}</span>
|
|
575
586
|
<span class="flex min-w-0 flex-1 flex-col">
|
|
576
587
|
<span class="truncate">{l.description}</span>
|
|
577
588
|
{#if l.source}<span class="text-muted-foreground text-2xs truncate">{l.source}</span
|
|
@@ -593,7 +604,7 @@
|
|
|
593
604
|
class={cn(CELL, 'text-muted-foreground self-center tabular-nums')}
|
|
594
605
|
style="grid-column: {column('date')};"
|
|
595
606
|
>
|
|
596
|
-
{
|
|
607
|
+
{date(l.date, WIDE)}
|
|
597
608
|
</span>
|
|
598
609
|
{/if}
|
|
599
610
|
<span
|
|
@@ -641,9 +652,9 @@
|
|
|
641
652
|
|
|
642
653
|
{#snippet row(r: R, first: boolean)}
|
|
643
654
|
{@const on = ticked.has(r.id)}
|
|
644
|
-
{@const label = `${r.title}, ${
|
|
655
|
+
{@const label = `${r.title}, ${date(r.date)}, ${money(r.amount)}`}
|
|
645
656
|
{#if PHONE}
|
|
646
|
-
{@const two = [BY_DAY ? '' :
|
|
657
|
+
{@const two = [BY_DAY ? '' : date(r.date, false), r.note ?? '']
|
|
647
658
|
.filter(Boolean)
|
|
648
659
|
.join(' · ')}
|
|
649
660
|
<div
|
|
@@ -732,11 +743,12 @@
|
|
|
732
743
|
key,
|
|
733
744
|
prefs.period,
|
|
734
745
|
fy,
|
|
735
|
-
!(mode === 'narrow' && (BY_DAY || prefs.period === 'week'))
|
|
746
|
+
!(mode === 'narrow' && (BY_DAY || prefs.period === 'week')),
|
|
747
|
+
dateFormat
|
|
736
748
|
)}
|
|
737
749
|
{@const span = WIDE && prefs.period === 'fy' ? `${fySpan(key, fy)} · ` : ''}
|
|
738
750
|
{@const metaText = single ? '' : PHONE ? number(rs.length) : span + count(rs.length)}
|
|
739
|
-
{@const net = single ? '' : money(t.net)}
|
|
751
|
+
{@const net = single || !groupTotals ? '' : money(t.net)}
|
|
740
752
|
{@const netTone = t.net > 0 ? 'text-status-success' : 'text-muted-foreground'}
|
|
741
753
|
{@const klass = cn(
|
|
742
754
|
GROUP,
|
|
@@ -805,7 +817,7 @@
|
|
|
805
817
|
</span>
|
|
806
818
|
<span class={cn(CELL, END, 'tabular-nums', netTone)} style="grid-column: {cAmount};">{net}</span
|
|
807
819
|
>
|
|
808
|
-
{#if WIDE && afterAmount > 0 && !BY_DAY}
|
|
820
|
+
{#if WIDE && afterAmount > 0 && !BY_DAY && groupTotals}
|
|
809
821
|
<span class={CELL} style="grid-column: {cAmount + 1} / -1;">
|
|
810
822
|
In {money(t.inn)} · out {money(t.out)}
|
|
811
823
|
</span>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type { Snippet } from 'svelte';
|
|
14
14
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
15
15
|
import type { ListAction, ListIconAction } from '../list-toolbar/types.js';
|
|
16
|
+
import type { LedgerDateFormat } from './ledger.js';
|
|
16
17
|
import type { LedgerColumn, LedgerOpenContext, LedgerPreferences, LedgerRow } from './types.js';
|
|
17
18
|
declare function $$render<R extends LedgerRow>(): {
|
|
18
19
|
props: Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
@@ -26,6 +27,13 @@ declare function $$render<R extends LedgerRow>(): {
|
|
|
26
27
|
preferencesNote?: string;
|
|
27
28
|
/** The month a financial year starts, 1–12. July by default. */
|
|
28
29
|
fyStart?: number;
|
|
30
|
+
/** How dates read: "30 Jun 2026" (`short`), or the household's "30/06/2026" (`numeric`). */
|
|
31
|
+
dateFormat?: LedgerDateFormat;
|
|
32
|
+
/**
|
|
33
|
+
* Show each group's net, and in and out. Turn off for rows that are all
|
|
34
|
+
* `conversion`, whose group totals would read $0.00.
|
|
35
|
+
*/
|
|
36
|
+
groupTotals?: boolean;
|
|
29
37
|
currency?: string;
|
|
30
38
|
/** BCP 47 locale for every figure: amounts, nets and counts. */
|
|
31
39
|
locale?: string;
|
package/dist/styles.css
CHANGED
|
@@ -1004,7 +1004,9 @@
|
|
|
1004
1004
|
height: 100dvh;
|
|
1005
1005
|
width: var(--ds-shell-rail-width);
|
|
1006
1006
|
max-width: 50%;
|
|
1007
|
-
transition:
|
|
1007
|
+
transition:
|
|
1008
|
+
width 200ms ease,
|
|
1009
|
+
margin-right 200ms ease;
|
|
1008
1010
|
}
|
|
1009
1011
|
|
|
1010
1012
|
/* Full viewport height (`inset-block: 0`), so the brand row at its top and
|
|
@@ -1068,6 +1070,19 @@
|
|
|
1068
1070
|
width: var(--ds-shell-rail-width-collapsed);
|
|
1069
1071
|
}
|
|
1070
1072
|
|
|
1073
|
+
/* A collapsed rail peeking: it takes its full width but a negative right
|
|
1074
|
+
margin of the difference, so it still claims only the slim slot in the
|
|
1075
|
+
flex row and the page does not move. It sits above the top bar (z-20) and
|
|
1076
|
+
throws the same soft shadow the drawer does. */
|
|
1077
|
+
.ds-shell-rail[data-collapsed='true'][data-peek='true'] {
|
|
1078
|
+
width: var(--ds-shell-rail-width);
|
|
1079
|
+
margin-right: calc(var(--ds-shell-rail-width-collapsed) - var(--ds-shell-rail-width));
|
|
1080
|
+
z-index: 30;
|
|
1081
|
+
box-shadow:
|
|
1082
|
+
0 10px 15px -3px oklch(0 0 0 / 0.1),
|
|
1083
|
+
0 4px 6px -4px oklch(0 0 0 / 0.1);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1071
1086
|
/* Width follows the pointer during a drag; the transition is for the
|
|
1072
1087
|
collapse, not for every pixel of a resize. */
|
|
1073
1088
|
.ds-shell-rail[data-resizing='true'] {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poodle64/ui",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.21",
|
|
4
4
|
"description": "Household shared component layer: shadcn-svelte primitives (bits-ui) plus the composed page chrome every app builds its routes from, restyled by each app's @poodle64/design-tokens alias layer. One fix reaches every app.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @poodle64/ui — situation → component map
|
|
2
2
|
|
|
3
3
|
<!-- GENERATED by scripts/generate-registry.mjs from scripts/situations.json + package source. DO NOT EDIT. -->
|
|
4
|
-
Generated from `@poodle64/ui@2026.10.
|
|
4
|
+
Generated from `@poodle64/ui@2026.10.21`. 76 components, 20 situations.
|
|
5
5
|
|
|
6
6
|
**Read this before writing a `<div>`.** Find the SITUATION you are in below, then compose the component named for it — do not hand-build it from raw `Card` or utility classes. Import is `import { Name } from '<import path>'`. Props marked `?` are optional. This map is the retrieval step the [`frontend-design` skill] makes mandatory; the [CHI 2026 study] measured composing-from-a-registry at 95% design-system compliance against 71% for writing the CSS from a prose style guide.
|
|
7
7
|
|