@tristan2828/ui-foundation 4.85.0 → 4.87.0
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/conventions/docs/add-an-entity.md +34 -17
- package/conventions/docs/cell-patterns.md +165 -37
- package/conventions/docs/design-language.md +30 -3
- package/dist/components/app/app-shell-nav.d.ts +24 -0
- package/dist/components/app/app-shell-nav.js +30 -0
- package/dist/components/app/app-shell.d.ts +12 -1
- package/dist/components/app/app-shell.js +19 -5
- package/dist/components/app/data-table-tools.d.ts +98 -0
- package/dist/components/app/data-table-tools.js +59 -0
- package/dist/components/app/data-table.d.ts +60 -2
- package/dist/components/app/data-table.js +97 -20
- package/dist/components/app/entity-view.d.ts +11 -1
- package/dist/components/app/entity-view.js +14 -1
- package/dist/components/app/filter-bar.d.ts +55 -0
- package/dist/components/app/filter-bar.js +28 -0
- package/dist/components/app/multi-choice.d.ts +9 -1
- package/dist/components/app/multi-choice.js +3 -3
- package/dist/components/app/page-trail-context.d.ts +18 -0
- package/dist/components/app/page-trail-context.js +28 -0
- package/dist/components/app/page-trail.d.ts +1 -1
- package/dist/components/app/page-trail.js +1 -1
- package/dist/components/app/pill-filter.d.ts +3 -1
- package/dist/components/app/pill-filter.js +3 -2
- package/dist/components/app/related-table.d.ts +11 -0
- package/dist/components/app/related-table.js +28 -0
- package/dist/components/app/search-palette.d.ts +29 -0
- package/dist/components/app/search-palette.js +160 -0
- package/dist/components/app/secondary-filters.d.ts +3 -1
- package/dist/components/app/secondary-filters.js +5 -4
- package/dist/components/app/table-columns.d.ts +15 -0
- package/dist/components/app/table-columns.js +50 -0
- package/dist/hooks/table-url-changes.d.ts +2 -0
- package/dist/hooks/use-columns-pick.d.ts +3 -0
- package/dist/hooks/use-columns-pick.js +18 -0
- package/dist/hooks/use-is-phone.d.ts +1 -0
- package/dist/hooks/use-is-phone.js +18 -0
- package/dist/hooks/use-recent-record.d.ts +10 -0
- package/dist/hooks/use-recent-record.js +20 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -0
- package/dist/lib/search-palette.d.ts +50 -0
- package/dist/lib/search-palette.js +119 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PageCrumb } from './page-trail.js';
|
|
2
|
+
export type PageTrailSlot = {
|
|
3
|
+
/** Shows these crumbs in the bar, for the page holding `owner`. */
|
|
4
|
+
set: (owner: object, crumbs: readonly PageCrumb[]) => void;
|
|
5
|
+
/** Takes them down again, unless a later page has put up its own. */
|
|
6
|
+
clear: (owner: object) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const PageTrailContext: import("react").Context<PageTrailSlot | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Puts this page's trail in AppShell's bar: from the top (a module, say)
|
|
11
|
+
* down to the page itself, last, every crumb but the last with an `href`.
|
|
12
|
+
* Nothing (`undefined` or `null`) leaves the bar to the nav entry's
|
|
13
|
+
* label. Returns whether there is a bar to show it, so a view outside
|
|
14
|
+
* the shell can draw the trail itself.
|
|
15
|
+
*
|
|
16
|
+
* usePageTrail([{ label: 'Finance', href: '/finance' }, { label: 'Accounts', href: '/finance/accounts' }, { label: 'Update balances' }])
|
|
17
|
+
*/
|
|
18
|
+
export declare function usePageTrail(crumbs: readonly PageCrumb[] | null | undefined): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The trail in AppShell's bar (#N5): a page names where it is with
|
|
2
|
+
// `usePageTrail`, and the shell draws it between the menu button and the
|
|
3
|
+
// search box. Pages that set none get their nav entry's (navTrail).
|
|
4
|
+
import { createContext, useContext, useLayoutEffect } from 'react';
|
|
5
|
+
export const PageTrailContext = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* Puts this page's trail in AppShell's bar: from the top (a module, say)
|
|
8
|
+
* down to the page itself, last, every crumb but the last with an `href`.
|
|
9
|
+
* Nothing (`undefined` or `null`) leaves the bar to the nav entry's
|
|
10
|
+
* label. Returns whether there is a bar to show it, so a view outside
|
|
11
|
+
* the shell can draw the trail itself.
|
|
12
|
+
*
|
|
13
|
+
* usePageTrail([{ label: 'Finance', href: '/finance' }, { label: 'Accounts', href: '/finance/accounts' }, { label: 'Update balances' }])
|
|
14
|
+
*/
|
|
15
|
+
export function usePageTrail(crumbs) {
|
|
16
|
+
const slot = useContext(PageTrailContext);
|
|
17
|
+
// By value, so a new array each render doesn't put the trail up again.
|
|
18
|
+
const key = crumbs ? JSON.stringify(crumbs.map((crumb) => [crumb.label, crumb.href ?? null])) : null;
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
if (!slot || key === null)
|
|
21
|
+
return;
|
|
22
|
+
const owner = {};
|
|
23
|
+
const parsed = JSON.parse(key);
|
|
24
|
+
slot.set(owner, parsed.map(([label, href]) => (href === null ? { label } : { label, href })));
|
|
25
|
+
return () => slot.clear(owner);
|
|
26
|
+
}, [slot, key]);
|
|
27
|
+
return slot !== null;
|
|
28
|
+
}
|
|
@@ -9,7 +9,7 @@ export type PageTrailProps = {
|
|
|
9
9
|
* From the top (the record, or the list it's in) down to the page
|
|
10
10
|
* itself, last. Any number: one is just the page.
|
|
11
11
|
*/
|
|
12
|
-
crumbs: PageCrumb[];
|
|
12
|
+
crumbs: readonly PageCrumb[];
|
|
13
13
|
/** The trail's name for screen readers. Defaults to "Breadcrumb". */
|
|
14
14
|
'aria-label'?: string;
|
|
15
15
|
className?: string;
|
|
@@ -63,7 +63,7 @@ export function PageTrail({ crumbs, 'aria-label': ariaLabel, className }) {
|
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
65
|
if (index === last)
|
|
66
|
-
items.push(_jsx(BreadcrumbItem, { className: "min-w-0", children: _jsx(BreadcrumbPage, { className: "block truncate", title: crumb.label, children: crumb.label }) }, "page"));
|
|
66
|
+
items.push(_jsx(BreadcrumbItem, { className: "min-w-0", children: _jsx(BreadcrumbPage, { className: "block truncate", title: crumb.label, role: undefined, "aria-disabled": undefined, children: crumb.label }) }, "page"));
|
|
67
67
|
else
|
|
68
68
|
items.push(_jsx(BreadcrumbItem, { className: index === 0 ? 'shrink-0' : 'min-w-0', children: _jsx(CrumbLink, { crumb: crumb, inRouter: inRouter }) }, `crumb-${index}`));
|
|
69
69
|
});
|
|
@@ -11,5 +11,7 @@ export type PillFilterProps = {
|
|
|
11
11
|
onValueChange: (value: string) => void;
|
|
12
12
|
/** The first pill, which clears the filter. null leaves it out, for a filter that always has a value. */
|
|
13
13
|
allLabel?: string | null;
|
|
14
|
+
/** On the group: `flex-nowrap` (with a scrolling parent) keeps the pills on one line. */
|
|
15
|
+
className?: string;
|
|
14
16
|
};
|
|
15
|
-
export declare function PillFilter({ label, options, value, onValueChange, allLabel }: PillFilterProps): import("react").JSX.Element;
|
|
17
|
+
export declare function PillFilter({ label, options, value, onValueChange, allLabel, className }: PillFilterProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
10
10
|
// with `setFilter`. Built on shadcn's ToggleGroup (Base UI): a group named
|
|
11
11
|
// by `label`, one tab stop, the arrow keys along it, each pill a toggle
|
|
12
12
|
// button with aria-pressed.
|
|
13
|
+
import { cn } from 'cn';
|
|
13
14
|
import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group.js';
|
|
14
15
|
// The All pill's value inside the group: Base UI's toggles need one that
|
|
15
16
|
// isn't empty, and '' is what the app's filter calls All.
|
|
@@ -18,10 +19,10 @@ const ALL = '__all__';
|
|
|
18
19
|
// (bg-muted) is ~3% off the page, too faint to say which one is on.
|
|
19
20
|
const PILL_CLASS = 'rounded-full px-3 aria-pressed:border-primary aria-pressed:bg-primary aria-pressed:text-primary-foreground ' +
|
|
20
21
|
'aria-pressed:hover:bg-primary/90 aria-pressed:hover:text-primary-foreground';
|
|
21
|
-
export function PillFilter({ label, options, value, onValueChange, allLabel = 'All' }) {
|
|
22
|
+
export function PillFilter({ label, options, value, onValueChange, allLabel = 'All', className }) {
|
|
22
23
|
const pills = allLabel === null ? options : [{ value: ALL, label: allLabel }, ...options];
|
|
23
24
|
const pressed = value === '' && allLabel !== null ? ALL : value;
|
|
24
|
-
return (_jsx(ToggleGroup, { "aria-label": label, variant: "outline", size: "sm", spacing: 1, className:
|
|
25
|
+
return (_jsx(ToggleGroup, { "aria-label": label, variant: "outline", size: "sm", spacing: 1, className: cn('flex-wrap', className), value: [pressed], onValueChange: (next) => {
|
|
25
26
|
// [] is the pressed pill pressed again: it stays on.
|
|
26
27
|
const chosen = next[0];
|
|
27
28
|
if (chosen === undefined || chosen === pressed)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DataTableOpens, type DataTableProps } from './data-table.js';
|
|
2
|
+
import type { DataTableViewAll } from './data-table-tools.js';
|
|
3
|
+
export type RelatedTableProps<TData extends Record<string, unknown>> = Pick<DataTableProps<TData>, 'columns' | 'data' | 'total' | 'isLoading' | 'error' | 'onRetry' | 'emptyTitle' | 'emptyDescription' | 'emptyAction' | 'getRowId' | 'visibleColumns' | 'highlightRow' | 'rowActions' | 'phoneRow' | 'onRowClick' | 'width'> & {
|
|
4
|
+
/** How a row opens its record, as on every list. */
|
|
5
|
+
opens: DataTableOpens<TData>;
|
|
6
|
+
/** The most rows shown: 10 unless set. */
|
|
7
|
+
limit?: number;
|
|
8
|
+
/** The whole list, filtered to this record: shown when `total` is over `limit`. */
|
|
9
|
+
viewAll?: DataTableViewAll;
|
|
10
|
+
};
|
|
11
|
+
export declare function RelatedTable<TData extends Record<string, unknown>>({ columns, limit, ...props }: RelatedTableProps<TData>): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// A record's list of related records (the record page standard, R8): the
|
|
3
|
+
// ten newest under a section's heading, then View all N to the whole list
|
|
4
|
+
// filtered to this record, so a long care log doesn't push the rest of the
|
|
5
|
+
// record away. A DataTable with `limit` and `viewAll` and nothing to page or
|
|
6
|
+
// sort: the app's query asks for `limit` rows, newest first, and the total.
|
|
7
|
+
//
|
|
8
|
+
// <RelatedTable
|
|
9
|
+
// columns={VISIT_COLUMNS}
|
|
10
|
+
// opens={{ kind: 'dialog', to: (visit) => `/health/visits/${visit.id}` }}
|
|
11
|
+
// data={visits.data?.items ?? []}
|
|
12
|
+
// total={visits.data?.total ?? 0}
|
|
13
|
+
// isLoading={visits.isLoading}
|
|
14
|
+
// error={visits.error}
|
|
15
|
+
// onRetry={() => visits.refetch()}
|
|
16
|
+
// emptyTitle="No visits yet"
|
|
17
|
+
// viewAll={{ to: `/health/visits?provider=${provider.id}` }}
|
|
18
|
+
// />
|
|
19
|
+
import { useMemo } from 'react';
|
|
20
|
+
import { DataTable } from './data-table.js';
|
|
21
|
+
const noop = () => { };
|
|
22
|
+
const NO_SORT = [];
|
|
23
|
+
export function RelatedTable({ columns, limit = 10, ...props }) {
|
|
24
|
+
// The headers aren't sort buttons: the newest come first, and View all
|
|
25
|
+
// has the list's own sorting.
|
|
26
|
+
const unsorted = useMemo(() => columns.map((column) => ({ ...column, enableSorting: false })), [columns]);
|
|
27
|
+
return (_jsx(DataTable, { ...props, columns: unsorted, limit: limit, page: 1, pageSize: limit, onPageChange: noop, sorting: NO_SORT, onSortingChange: noop }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { NavEntry } from './app-shell-nav.js';
|
|
2
|
+
import { type SearchRecord } from '../../lib/search-palette.js';
|
|
3
|
+
export type { RecentRecord, SearchRecord } from '../../lib/search-palette.js';
|
|
4
|
+
/** AppShell's `search`: what the box says and how it finds records. */
|
|
5
|
+
export type AppShellSearch = {
|
|
6
|
+
/** The box's words and the palette's field's name. Defaults to "Search". */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Finds the app's records whose title has the text in it, from the
|
|
10
|
+
* app's own search endpoint through its gateway (TanStack Query's
|
|
11
|
+
* `queryClient.fetchQuery`, say). Called once typing pauses, never for
|
|
12
|
+
* text of only spaces; `signal` aborts when the text changes again.
|
|
13
|
+
* The results are listed under their `kind`, in the order given.
|
|
14
|
+
* Without it the palette finds pages only.
|
|
15
|
+
*/
|
|
16
|
+
findRecords?: (query: string, options: {
|
|
17
|
+
signal: AbortSignal;
|
|
18
|
+
}) => Promise<readonly SearchRecord[]>;
|
|
19
|
+
/**
|
|
20
|
+
* How many of the records opened lately (useRecentRecord) to list
|
|
21
|
+
* before you type: 5 by default, `false` for none.
|
|
22
|
+
*/
|
|
23
|
+
recent?: number | false;
|
|
24
|
+
};
|
|
25
|
+
/** The box (md and up) and the button (a phone) that open the palette, and the palette. */
|
|
26
|
+
export declare function SearchPalette({ search, nav }: {
|
|
27
|
+
search: AppShellSearch;
|
|
28
|
+
nav: readonly NavEntry[];
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Search in AppShell's bar (#N6): a box in the header (a button on a
|
|
3
|
+
// phone) and Ctrl K (⌘K on a Mac) open a palette that finds a page or a
|
|
4
|
+
// record by name, and Enter opens it. Before you type it lists the
|
|
5
|
+
// records you opened lately (useRecentRecord), then the first pages.
|
|
6
|
+
//
|
|
7
|
+
// A combobox over a listbox in a dialog (WAI-ARIA's "combobox with
|
|
8
|
+
// listbox popup"): focus stays in the box, the arrows move the
|
|
9
|
+
// highlighted option (aria-activedescendant), Enter opens it, Esc
|
|
10
|
+
// closes. Hand-rolled because shadcn's Command needs cmdk, which isn't
|
|
11
|
+
// on the package's allowlist; the dialog is the foundation's own.
|
|
12
|
+
import { SearchIcon } from 'lucide-react';
|
|
13
|
+
import { useEffect, useId, useMemo, useRef, useState } from 'react';
|
|
14
|
+
import { useNavigate } from 'react-router';
|
|
15
|
+
import { cn } from 'cn';
|
|
16
|
+
import { useDebouncedValue } from '../../hooks/use-debounced-value.js';
|
|
17
|
+
import { groupRecords, matchPages, readRecentRecords, searchPages, } from '../../lib/search-palette.js';
|
|
18
|
+
import { Button } from '../ui/button.js';
|
|
19
|
+
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '../ui/dialog.js';
|
|
20
|
+
import { Spinner } from '../ui/spinner.js';
|
|
21
|
+
// How long typing pauses before findRecords is asked.
|
|
22
|
+
const SEARCH_DELAY_MS = 150;
|
|
23
|
+
const PAGES_BEFORE_TYPING = 5;
|
|
24
|
+
const PAGES_MATCHED = 6;
|
|
25
|
+
function isMac() {
|
|
26
|
+
return typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
27
|
+
}
|
|
28
|
+
/** The box (md and up) and the button (a phone) that open the palette, and the palette. */
|
|
29
|
+
export function SearchPalette({ search, nav }) {
|
|
30
|
+
const [open, setOpen] = useState(false);
|
|
31
|
+
const placeholder = search.placeholder ?? 'Search';
|
|
32
|
+
const shortcut = isMac() ? '⌘K' : 'Ctrl K';
|
|
33
|
+
// Ctrl K or ⌘K from anywhere, unless something on the page (an
|
|
34
|
+
// editor's link shortcut) has already taken it.
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const onKeyDown = (event) => {
|
|
37
|
+
if (event.defaultPrevented || event.altKey || event.shiftKey)
|
|
38
|
+
return;
|
|
39
|
+
if (event.key.toLowerCase() !== 'k' || !(event.ctrlKey || event.metaKey))
|
|
40
|
+
return;
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
setOpen((current) => !current);
|
|
43
|
+
};
|
|
44
|
+
window.addEventListener('keydown', onKeyDown);
|
|
45
|
+
return () => window.removeEventListener('keydown', onKeyDown);
|
|
46
|
+
}, []);
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", "data-slot": "app-shell-search", "aria-keyshortcuts": "Control+K Meta+K", "aria-haspopup": "dialog", onClick: () => setOpen(true), className: "hidden h-8 w-56 shrink-0 items-center gap-2 rounded-lg border border-input bg-background px-2.5 text-sm text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 md:flex lg:w-64", children: [_jsx(SearchIcon, { "aria-hidden": "true", className: "size-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate text-left", children: placeholder }), _jsx("kbd", { className: "shrink-0 rounded-sm border border-border px-1 font-mono text-xs text-muted-foreground", children: shortcut })] }), _jsx(Button, { variant: "ghost", size: "icon-sm", "data-slot": "app-shell-search-button", "aria-label": placeholder, "aria-haspopup": "dialog", className: "md:hidden", onClick: () => setOpen(true), children: _jsx(SearchIcon, {}) }), _jsx(Dialog, { open: open, onOpenChange: setOpen, children: open && _jsx(Palette, { search: search, nav: nav, placeholder: placeholder, onClose: () => setOpen(false) }) })] }));
|
|
48
|
+
}
|
|
49
|
+
function Palette({ search, nav, placeholder, onClose, }) {
|
|
50
|
+
const navigate = useNavigate();
|
|
51
|
+
const id = useId();
|
|
52
|
+
const listId = `${id}-list`;
|
|
53
|
+
const [query, setQuery] = useState('');
|
|
54
|
+
const [active, setActive] = useState(0);
|
|
55
|
+
const [found, setFound] = useState(null);
|
|
56
|
+
// Read once, as the palette opens: the record you just left is there.
|
|
57
|
+
const [recent] = useState(() => search.recent === false ? [] : readRecentRecords().slice(0, search.recent ?? 5));
|
|
58
|
+
const pages = useMemo(() => searchPages(nav), [nav]);
|
|
59
|
+
const text = query.trim();
|
|
60
|
+
const debounced = useDebouncedValue(text, SEARCH_DELAY_MS);
|
|
61
|
+
const findRecords = search.findRecords;
|
|
62
|
+
// The latest findRecords without re-asking when only its identity changes.
|
|
63
|
+
const findRef = useRef(findRecords);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
findRef.current = findRecords;
|
|
66
|
+
}, [findRecords]);
|
|
67
|
+
const canFind = findRecords !== undefined;
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const find = findRef.current;
|
|
70
|
+
if (!find || !debounced)
|
|
71
|
+
return;
|
|
72
|
+
const controller = new AbortController();
|
|
73
|
+
// Through a microtask, so the effect itself doesn't set state.
|
|
74
|
+
void Promise.resolve()
|
|
75
|
+
.then(() => {
|
|
76
|
+
if (!controller.signal.aborted)
|
|
77
|
+
setFound({ query: debounced, status: 'loading' });
|
|
78
|
+
return find(debounced, { signal: controller.signal });
|
|
79
|
+
})
|
|
80
|
+
.then((records) => {
|
|
81
|
+
if (!controller.signal.aborted)
|
|
82
|
+
setFound({ query: debounced, status: 'success', records });
|
|
83
|
+
}, () => {
|
|
84
|
+
if (!controller.signal.aborted)
|
|
85
|
+
setFound({ query: debounced, status: 'error' });
|
|
86
|
+
});
|
|
87
|
+
return () => controller.abort();
|
|
88
|
+
}, [debounced]);
|
|
89
|
+
// What the records part says for the text on screen: found, still
|
|
90
|
+
// looking (typing, or asked), or couldn't look.
|
|
91
|
+
const records = !canFind || !text ? null : found?.query === text ? found : { query: text, status: 'loading' };
|
|
92
|
+
const groups = [];
|
|
93
|
+
if (!text && recent.length > 0)
|
|
94
|
+
groups.push({
|
|
95
|
+
heading: 'Recent',
|
|
96
|
+
options: recent.map((record, index) => ({ id: `${id}-recent-${index}`, label: record.title, detail: record.detail, to: record.to })),
|
|
97
|
+
});
|
|
98
|
+
const matched = matchPages(pages, text, text ? PAGES_MATCHED : PAGES_BEFORE_TYPING);
|
|
99
|
+
if (matched.length > 0)
|
|
100
|
+
groups.push({
|
|
101
|
+
heading: 'Pages',
|
|
102
|
+
options: matched.map((page, index) => ({ id: `${id}-page-${index}`, label: page.label, to: page.to })),
|
|
103
|
+
});
|
|
104
|
+
if (records?.status === 'success')
|
|
105
|
+
groupRecords(records.records).forEach((group, groupIndex) => groups.push({
|
|
106
|
+
heading: group.kind,
|
|
107
|
+
options: group.records.map((record, index) => ({
|
|
108
|
+
id: `${id}-record-${groupIndex}-${index}`,
|
|
109
|
+
label: record.title,
|
|
110
|
+
detail: record.detail,
|
|
111
|
+
to: record.to,
|
|
112
|
+
})),
|
|
113
|
+
}));
|
|
114
|
+
const options = groups.flatMap((group) => group.options);
|
|
115
|
+
const activeIndex = options.length === 0 ? -1 : Math.min(active, options.length - 1);
|
|
116
|
+
const activeOption = activeIndex >= 0 ? options[activeIndex] : undefined;
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (activeOption)
|
|
119
|
+
document.getElementById(activeOption.id)?.scrollIntoView({ block: 'nearest' });
|
|
120
|
+
}, [activeOption]);
|
|
121
|
+
const go = (option) => {
|
|
122
|
+
onClose();
|
|
123
|
+
void navigate(option.to);
|
|
124
|
+
};
|
|
125
|
+
const onKeyDown = (event) => {
|
|
126
|
+
if (options.length === 0)
|
|
127
|
+
return;
|
|
128
|
+
const move = (to) => {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
setActive((to + options.length) % options.length);
|
|
131
|
+
};
|
|
132
|
+
if (event.key === 'ArrowDown')
|
|
133
|
+
move(activeIndex + 1);
|
|
134
|
+
else if (event.key === 'ArrowUp')
|
|
135
|
+
move(activeIndex - 1);
|
|
136
|
+
else if (event.key === 'Home' && event.ctrlKey)
|
|
137
|
+
move(0);
|
|
138
|
+
else if (event.key === 'End' && event.ctrlKey)
|
|
139
|
+
move(options.length - 1);
|
|
140
|
+
else if (event.key === 'Enter' && activeOption) {
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
go(activeOption);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const nothing = text && options.length === 0 && records?.status !== 'loading';
|
|
146
|
+
return (_jsxs(DialogContent, { showCloseButton: false, "data-slot": "search-palette", className: "top-[12vh] max-h-[76vh] translate-y-0 grid-rows-[auto_minmax(0,1fr)] gap-0 overflow-hidden p-0 sm:max-w-lg", children: [_jsx(DialogTitle, { className: "sr-only", children: placeholder }), _jsx(DialogDescription, { className: "sr-only", children: "Type a page or a record's name; the arrows move through what's found and Enter opens it." }), _jsxs("div", { className: "flex items-center gap-2 border-b border-border px-3", children: [_jsx(SearchIcon, { "aria-hidden": "true", className: "size-4 shrink-0 text-muted-foreground" }), _jsx("input", { role: "combobox", "aria-label": placeholder, "aria-expanded": options.length > 0, "aria-controls": listId, "aria-autocomplete": "list", "aria-activedescendant": activeOption?.id, autoComplete: "off", spellCheck: false, value: query, placeholder: "Go to a page or find a record\u2026", onChange: (event) => {
|
|
147
|
+
setQuery(event.target.value);
|
|
148
|
+
setActive(0);
|
|
149
|
+
}, onKeyDown: onKeyDown, className: "h-11 min-w-0 flex-1 bg-transparent text-base outline-none placeholder:text-muted-foreground md:text-sm" }), records?.status === 'loading' && _jsx(Spinner, { "aria-label": "Searching", className: "size-4 text-muted-foreground" })] }), _jsxs("div", { className: "min-h-0 overflow-y-auto p-1", children: [_jsx("div", { role: "listbox", id: listId, "aria-label": placeholder, children: groups.map((group, groupIndex) => (_jsxs("div", { role: "group", "aria-labelledby": `${id}-group-${groupIndex}`, children: [_jsx("div", { id: `${id}-group-${groupIndex}`, className: "px-2 pt-2 pb-1 type-caption text-muted-foreground", children: group.heading }), group.options.map((option) => {
|
|
150
|
+
const selected = option.id === activeOption?.id;
|
|
151
|
+
return (_jsxs("div", { id: option.id, role: "option", "aria-selected": selected, "data-slot": "search-palette-option",
|
|
152
|
+
// A pointer moving over an option highlights it; a
|
|
153
|
+
// click opens it, focus staying in the box.
|
|
154
|
+
onPointerMove: () => {
|
|
155
|
+
const index = options.indexOf(option);
|
|
156
|
+
if (index !== activeIndex)
|
|
157
|
+
setActive(index);
|
|
158
|
+
}, onMouseDown: (event) => event.preventDefault(), onClick: () => go(option), className: cn('flex min-h-9 cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-sm text-foreground', selected && 'bg-muted'), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: option.label }), option.detail && (_jsx("span", { className: cn('shrink-0 type-caption', selected ? 'text-foreground' : 'text-muted-foreground'), children: option.detail }))] }, option.id));
|
|
159
|
+
})] }, `${groupIndex}:${group.heading}`))) }), records?.status === 'error' && (_jsx("p", { role: "status", className: "px-2 py-2 text-sm text-muted-foreground", children: "Couldn't search records. Pages are still listed; try again in a moment." })), nothing && (_jsxs("p", { role: "status", className: "px-2 py-6 text-center text-sm text-muted-foreground", children: ["Nothing found for \u201C", text, "\u201D."] })), !text && options.length === 0 && (_jsx("p", { className: "px-2 py-6 text-center text-sm text-muted-foreground", children: "Type to find a page or a record." }))] })] }));
|
|
160
|
+
}
|
|
@@ -14,5 +14,7 @@ export type SecondaryFiltersProps = {
|
|
|
14
14
|
onClear: () => void;
|
|
15
15
|
/** The button's text. */
|
|
16
16
|
label?: string;
|
|
17
|
+
/** On the wrapper of the button and the chips (`contents`, to put them in a row of the parent's). */
|
|
18
|
+
className?: string;
|
|
17
19
|
};
|
|
18
|
-
export declare function SecondaryFilters({ children, active, onClear, label }: SecondaryFiltersProps): import("react").JSX.Element;
|
|
20
|
+
export declare function SecondaryFilters({ children, active, onClear, label, className }: SecondaryFiltersProps): import("react").JSX.Element;
|
|
@@ -18,15 +18,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
18
18
|
// their Esc); the next one closes the panel.
|
|
19
19
|
import { useState } from 'react';
|
|
20
20
|
import { SlidersHorizontalIcon, XIcon } from 'lucide-react';
|
|
21
|
+
import { cn } from 'cn';
|
|
21
22
|
import { Button } from '../ui/button.js';
|
|
22
23
|
import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from '../ui/popover.js';
|
|
23
24
|
import { Sheet, SheetContent, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from '../ui/sheet.js';
|
|
24
|
-
import {
|
|
25
|
-
export function SecondaryFilters({ children, active, onClear, label = 'Filters' }) {
|
|
26
|
-
const isMobile =
|
|
25
|
+
import { useIsPhone } from '../../hooks/use-is-phone.js';
|
|
26
|
+
export function SecondaryFilters({ children, active, onClear, label = 'Filters', className }) {
|
|
27
|
+
const isMobile = useIsPhone();
|
|
27
28
|
const [open, setOpen] = useState(false);
|
|
28
29
|
const count = active.length;
|
|
29
30
|
const trigger = (_jsxs(Button, { variant: "outline", children: [_jsx(SlidersHorizontalIcon, { "aria-hidden": "true" }), _jsxs("span", { children: [label, count > 0 && _jsx("span", { className: "text-[0px]", children: "," })] }), count > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "rounded-full bg-primary px-1.5 type-caption text-primary-foreground tabular-nums", children: count }), _jsx("span", { className: "sr-only", children: " active" })] }))] }));
|
|
30
31
|
const footer = (_jsxs("div", { className: "flex justify-end gap-2", children: [_jsx(Button, { variant: "ghost", size: "sm", disabled: count === 0, onClick: onClear, children: "Clear filters" }), _jsx(Button, { size: "sm", onClick: () => setOpen(false), children: "Done" })] }));
|
|
31
|
-
return (_jsxs("div", { "data-slot": "secondary-filters", className:
|
|
32
|
+
return (_jsxs("div", { "data-slot": "secondary-filters", className: cn('flex flex-wrap items-center gap-2', className), children: [isMobile ? (_jsxs(Sheet, { open: open, onOpenChange: setOpen, children: [_jsx(SheetTrigger, { render: trigger }), _jsxs(SheetContent, { side: "bottom", className: "max-h-[85svh] overflow-y-auto", children: [_jsx(SheetHeader, { children: _jsx(SheetTitle, { children: label }) }), _jsx("div", { className: "flex flex-col gap-3 px-4 [&>*]:w-full", children: children }), _jsx(SheetFooter, { children: footer })] })] })) : (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { render: trigger }), _jsxs(PopoverContent, { align: "start", className: "w-auto min-w-64 gap-3 p-3", children: [_jsx(PopoverTitle, { children: label }), _jsx("div", { className: "flex flex-col gap-3", children: children }), footer] })] })), active.map((filter) => (_jsxs("span", { "data-slot": "secondary-filter-chip", className: "inline-flex h-7 items-center gap-0.5 rounded-md bg-muted pr-0.5 pl-2 type-caption text-foreground", children: [filter.label, _jsx(Button, { variant: "ghost", size: "icon-xs", "aria-label": `Remove filter: ${filter.label}`, onClick: filter.onRemove, children: _jsx(XIcon, { "aria-hidden": "true" }) })] }, filter.id))), count > 1 && (_jsx(Button, { variant: "ghost", size: "sm", onClick: onClear, children: "Clear filters" }))] }));
|
|
32
33
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ROW_ACTIONS_COLUMN_ID = "__row-actions";
|
|
2
|
+
export type ColumnsPick = {
|
|
3
|
+
order: string[];
|
|
4
|
+
hidden: string[];
|
|
5
|
+
};
|
|
6
|
+
/** The stored pick, or null when there's none or it can't be read. */
|
|
7
|
+
export declare function parseColumnsPick(raw: string | null): ColumnsPick | null;
|
|
8
|
+
/** The ids to show under `pick`: every column of `ids` it doesn't hide, in `ids`' order, `fixed` always. */
|
|
9
|
+
export declare function visibleFromPick(ids: readonly string[], pick: ColumnsPick, fixed: readonly string[]): string[];
|
|
10
|
+
/**
|
|
11
|
+
* The pick after `id` is ticked (`shown`) or unticked, starting from what
|
|
12
|
+
* shows now (`visible`): every column in `ids` is in `order`, the ones not
|
|
13
|
+
* showing in `hidden`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function togglePick(ids: readonly string[], visible: readonly string[], id: string, shown: boolean, previous: ColumnsPick | null): ColumnsPick;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// The Columns menu's pick (DataTable `columnsMenu`), kept free of React so
|
|
2
|
+
// tests/ can unit-test it. It's stored on this device per list as JSON:
|
|
3
|
+
// every column's id in order, and the ones unticked:
|
|
4
|
+
//
|
|
5
|
+
// {"order":["name","status","dose","since"],"hidden":["since"]}
|
|
6
|
+
//
|
|
7
|
+
// `order` is there for reordering, a later addition to the same value; for
|
|
8
|
+
// now it's written and kept, never applied. A column the list gained after
|
|
9
|
+
// the pick was stored isn't in `hidden`, so it shows.
|
|
10
|
+
// The id of the column DataTable adds for `rowActions`, pinned last: never
|
|
11
|
+
// in the Columns menu.
|
|
12
|
+
export const ROW_ACTIONS_COLUMN_ID = '__row-actions';
|
|
13
|
+
/** The stored pick, or null when there's none or it can't be read. */
|
|
14
|
+
export function parseColumnsPick(raw) {
|
|
15
|
+
if (raw === null)
|
|
16
|
+
return null;
|
|
17
|
+
try {
|
|
18
|
+
const value = JSON.parse(raw);
|
|
19
|
+
if (typeof value !== 'object' || value === null)
|
|
20
|
+
return null;
|
|
21
|
+
const { order, hidden } = value;
|
|
22
|
+
const strings = (list) => (Array.isArray(list) ? list.filter((id) => typeof id === 'string') : null);
|
|
23
|
+
const orderIds = strings(order);
|
|
24
|
+
const hiddenIds = strings(hidden);
|
|
25
|
+
return orderIds && hiddenIds ? { order: orderIds, hidden: hiddenIds } : null;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** The ids to show under `pick`: every column of `ids` it doesn't hide, in `ids`' order, `fixed` always. */
|
|
32
|
+
export function visibleFromPick(ids, pick, fixed) {
|
|
33
|
+
const hidden = new Set(pick.hidden);
|
|
34
|
+
return ids.filter((id) => fixed.includes(id) || !hidden.has(id));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The pick after `id` is ticked (`shown`) or unticked, starting from what
|
|
38
|
+
* shows now (`visible`): every column in `ids` is in `order`, the ones not
|
|
39
|
+
* showing in `hidden`.
|
|
40
|
+
*/
|
|
41
|
+
export function togglePick(ids, visible, id, shown, previous) {
|
|
42
|
+
const next = new Set(visible);
|
|
43
|
+
if (shown)
|
|
44
|
+
next.add(id);
|
|
45
|
+
else
|
|
46
|
+
next.delete(id);
|
|
47
|
+
// Keep an order already stored (reordering, later), with new columns after.
|
|
48
|
+
const order = previous ? [...previous.order.filter((each) => ids.includes(each)), ...ids.filter((each) => !previous.order.includes(each))] : [...ids];
|
|
49
|
+
return { order, hidden: ids.filter((each) => !next.has(each)) };
|
|
50
|
+
}
|
|
@@ -4,6 +4,8 @@ type Sort = readonly {
|
|
|
4
4
|
}[];
|
|
5
5
|
export type UrlChanges = Record<string, string | string[] | null>;
|
|
6
6
|
export type TableView<F extends string, M extends string> = {
|
|
7
|
+
/** Its pill's word in DataTable's `views` ("Current"); the view's id unless set. */
|
|
8
|
+
label?: string;
|
|
7
9
|
filters?: Partial<Record<F, string>>;
|
|
8
10
|
multiFilters?: Partial<Record<M, string[]>>;
|
|
9
11
|
sort?: Sort;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ColumnsPick } from '../components/app/table-columns.js';
|
|
2
|
+
/** The pick stored under `key`, read and written through the device's store. */
|
|
3
|
+
export declare function useColumnsPick(key: string | undefined): readonly [ColumnsPick | null, (next: ColumnsPick | null) => void];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// DataTable's Columns menu pick (`columnsMenu`), remembered on this device
|
|
2
|
+
// under the list's `storageKey` in the same store as a table's layout and
|
|
3
|
+
// grouping (use-table-layout.ts). The format is table-columns.ts's.
|
|
4
|
+
import { useCallback, useSyncExternalStore } from 'react';
|
|
5
|
+
import { parseColumnsPick } from '../components/app/table-columns.js';
|
|
6
|
+
import { browserStore } from './use-table-layout.js';
|
|
7
|
+
/** The pick stored under `key`, read and written through the device's store. */
|
|
8
|
+
export function useColumnsPick(key) {
|
|
9
|
+
const subscribe = useCallback((listener) => (key === undefined ? () => { } : browserStore.subscribe(key, listener)), [key]);
|
|
10
|
+
const raw = useSyncExternalStore(subscribe, () => (key === undefined ? null : browserStore.get(key)), () => null);
|
|
11
|
+
const pick = parseColumnsPick(raw);
|
|
12
|
+
const setPick = (next) => {
|
|
13
|
+
if (key === undefined)
|
|
14
|
+
return;
|
|
15
|
+
browserStore.set(key, next === null ? '' : JSON.stringify(next));
|
|
16
|
+
};
|
|
17
|
+
return [pick, setPick];
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsPhone(): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react';
|
|
2
|
+
// Whether the screen is under 48rem (useIsMobile's 768px), read through
|
|
3
|
+
// matchMedia as a store, so rendering on the server or where matchMedia is
|
|
4
|
+
// missing (a test's DOM) gives "not a phone" instead of failing on
|
|
5
|
+
// `window`. DataTable's row list, FilterBar and SecondaryFilters' sheet
|
|
6
|
+
// read it, so they always agree.
|
|
7
|
+
const PHONE_QUERY = '(max-width: 767px)';
|
|
8
|
+
const canMatchMedia = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
9
|
+
function subscribe(listener) {
|
|
10
|
+
if (!canMatchMedia())
|
|
11
|
+
return () => { };
|
|
12
|
+
const query = window.matchMedia(PHONE_QUERY);
|
|
13
|
+
query.addEventListener('change', listener);
|
|
14
|
+
return () => query.removeEventListener('change', listener);
|
|
15
|
+
}
|
|
16
|
+
export function useIsPhone() {
|
|
17
|
+
return useSyncExternalStore(subscribe, () => canMatchMedia() && window.matchMedia(PHONE_QUERY).matches, () => false);
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type RecentRecord } from '../lib/search-palette.js';
|
|
2
|
+
/**
|
|
3
|
+
* Remembers a record as opened, on this device, for AppShell's search
|
|
4
|
+
* palette, which lists the last few before you type (#N6). Call it in a
|
|
5
|
+
* record's view once the record has loaded; pass nothing while it
|
|
6
|
+
* loads. Kept in localStorage (the latest 20), forgotten on logout.
|
|
7
|
+
*
|
|
8
|
+
* useRecentRecord(task && { title: task.title, to: `/tasks/${task.id}`, detail: 'Task' })
|
|
9
|
+
*/
|
|
10
|
+
export declare function useRecentRecord(record: RecentRecord | null | undefined | false): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { rememberRecentRecord } from '../lib/search-palette.js';
|
|
3
|
+
/**
|
|
4
|
+
* Remembers a record as opened, on this device, for AppShell's search
|
|
5
|
+
* palette, which lists the last few before you type (#N6). Call it in a
|
|
6
|
+
* record's view once the record has loaded; pass nothing while it
|
|
7
|
+
* loads. Kept in localStorage (the latest 20), forgotten on logout.
|
|
8
|
+
*
|
|
9
|
+
* useRecentRecord(task && { title: task.title, to: `/tasks/${task.id}`, detail: 'Task' })
|
|
10
|
+
*/
|
|
11
|
+
export function useRecentRecord(record) {
|
|
12
|
+
const title = record ? record.title : undefined;
|
|
13
|
+
const to = record ? record.to : undefined;
|
|
14
|
+
const detail = record ? record.detail : undefined;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (title === undefined || to === undefined || !title.trim())
|
|
17
|
+
return;
|
|
18
|
+
rememberRecentRecord({ title, to, detail });
|
|
19
|
+
}, [title, to, detail]);
|
|
20
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AppShell, type AppShellProps, type AppShellVersion, type BottomBarItem, type NavEntry, type NavItem, type NavSection, } from './components/app/app-shell.js';
|
|
1
|
+
export { AppShell, type AppShellProps, type AppShellSearch, type RecentRecord, type SearchRecord, type AppShellVersion, type BottomBarItem, type NavEntry, type NavItem, type NavSection, } from './components/app/app-shell.js';
|
|
2
2
|
export type { IconComponent } from './components/app/icon-component.js';
|
|
3
3
|
export { Board, type BoardColumn, type BoardMoveTarget, type BoardProps } from './components/app/board.js';
|
|
4
4
|
export { SpinWheel, type SpinWheelProps } from './components/app/spin-wheel.js';
|
|
@@ -10,6 +10,8 @@ export { ColorSwatch, type ColorSwatchProps } from './components/app/color-swatc
|
|
|
10
10
|
export { storedColor } from './lib/stored-color.js';
|
|
11
11
|
export { CountLink, type CountLinkProps } from './components/app/count-link.js';
|
|
12
12
|
export { DataTable, type DataTableCardLayout, type DataTableOpens, type DataTableOpensKind, type DataTableGrouping, type DataTableProps, type DataTableTotals, type DataTableWidth, type SortingState, } from './components/app/data-table.js';
|
|
13
|
+
export { type DataTableColumnsMenu, type DataTablePhoneRow, type DataTableRowAction, type DataTableView, type DataTableViewAll, } from './components/app/data-table-tools.js';
|
|
14
|
+
export { RelatedTable, type RelatedTableProps } from './components/app/related-table.js';
|
|
13
15
|
export { type RowGroup } from './components/app/table-groups.js';
|
|
14
16
|
export { byDay, type ByDayOptions } from './lib/group-by-day.js';
|
|
15
17
|
export { EntityForm, type EntityFormProps } from './components/app/entity-form.js';
|
|
@@ -35,6 +37,8 @@ export { InlineCreate, type InlineCreateProps } from './components/app/inline-cr
|
|
|
35
37
|
export { FoundationProviders } from './components/app/foundation-providers.js';
|
|
36
38
|
export { Markdown, type MarkdownProps } from './components/app/markdown.js';
|
|
37
39
|
export { PageTrail, type PageCrumb, type PageTrailProps } from './components/app/page-trail.js';
|
|
40
|
+
export { usePageTrail } from './components/app/page-trail-context.js';
|
|
41
|
+
export { useRecentRecord } from './hooks/use-recent-record.js';
|
|
38
42
|
export type { CreatePage, PageLinkInfo, PageLinkResolver } from './lib/page-link.js';
|
|
39
43
|
export { countTasks, toggleTaskAt, type TaskCount } from './lib/markdown-tasks.js';
|
|
40
44
|
export { NotesOutline, type NotesOutlineProps } from './components/app/notes-outline.js';
|
|
@@ -49,6 +53,7 @@ export { RichTextEditor, type RichTextEditorProps } from './components/app/rich-
|
|
|
49
53
|
export { RouteErrorBoundary } from './components/app/route-error-boundary.js';
|
|
50
54
|
export { PillFilter, type PillFilterOption, type PillFilterProps } from './components/app/pill-filter.js';
|
|
51
55
|
export { SecondaryFilters, type ActiveFilter, type SecondaryFiltersProps } from './components/app/secondary-filters.js';
|
|
56
|
+
export { FilterBar, FilterSelect, type FilterBarProps, type FilterBarSearch, type FilterSelectOption, type FilterSelectProps, } from './components/app/filter-bar.js';
|
|
52
57
|
export { SessionStage, SessionView, sessionStageLit, sessionStageMain, sessionStageQuiet, type SessionStageProps, type SessionStageTone, type SessionViewProps, } from './components/app/session-view.js';
|
|
53
58
|
export { AllowReminders, type AllowRemindersProps } from './components/app/allow-reminders.js';
|
|
54
59
|
export { StageCircle, type StageCircleProps, type StageCircleStage, type StageCircleTone, } from './components/app/stage-circle.js';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { ColorSwatch } from './components/app/color-swatch.js';
|
|
|
14
14
|
export { storedColor } from './lib/stored-color.js';
|
|
15
15
|
export { CountLink } from './components/app/count-link.js';
|
|
16
16
|
export { DataTable, } from './components/app/data-table.js';
|
|
17
|
+
export {} from './components/app/data-table-tools.js';
|
|
18
|
+
export { RelatedTable } from './components/app/related-table.js';
|
|
17
19
|
export {} from './components/app/table-groups.js';
|
|
18
20
|
export { byDay } from './lib/group-by-day.js';
|
|
19
21
|
export { EntityForm } from './components/app/entity-form.js';
|
|
@@ -39,6 +41,8 @@ export { InlineCreate } from './components/app/inline-create.js';
|
|
|
39
41
|
export { FoundationProviders } from './components/app/foundation-providers.js';
|
|
40
42
|
export { Markdown } from './components/app/markdown.js';
|
|
41
43
|
export { PageTrail } from './components/app/page-trail.js';
|
|
44
|
+
export { usePageTrail } from './components/app/page-trail-context.js';
|
|
45
|
+
export { useRecentRecord } from './hooks/use-recent-record.js';
|
|
42
46
|
export { countTasks, toggleTaskAt } from './lib/markdown-tasks.js';
|
|
43
47
|
export { NotesOutline } from './components/app/notes-outline.js';
|
|
44
48
|
export { MockModeBanner } from './components/app/mock-mode-banner.js';
|
|
@@ -51,6 +55,7 @@ export { RichTextEditor } from './components/app/rich-text-editor.js';
|
|
|
51
55
|
export { RouteErrorBoundary } from './components/app/route-error-boundary.js';
|
|
52
56
|
export { PillFilter } from './components/app/pill-filter.js';
|
|
53
57
|
export { SecondaryFilters } from './components/app/secondary-filters.js';
|
|
58
|
+
export { FilterBar, FilterSelect, } from './components/app/filter-bar.js';
|
|
54
59
|
export { SessionStage, SessionView, sessionStageLit, sessionStageMain, sessionStageQuiet, } from './components/app/session-view.js';
|
|
55
60
|
export { AllowReminders } from './components/app/allow-reminders.js';
|
|
56
61
|
export { StageCircle, } from './components/app/stage-circle.js';
|