@nadicodeai/ui 12.1.224 → 12.1.226
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/AGENTS.md +4 -1
- package/dist/components/action-menu.d.ts +4 -4
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/action-menu.js +2 -2
- package/dist/components/agent-card.d.ts +2 -2
- package/dist/components/agent-card.js +2 -2
- package/dist/components/agent-profile.d.ts +2 -83
- package/dist/components/agent-profile.d.ts.map +1 -1
- package/dist/components/agent-profile.js +0 -46
- package/dist/components/badge.d.ts +2 -1
- package/dist/components/badge.d.ts.map +1 -1
- package/dist/components/badge.js +2 -1
- package/dist/components/brand.d.ts +1 -1
- package/dist/components/brand.d.ts.map +1 -1
- package/dist/components/brand.js +21 -2
- package/dist/components/card.d.ts +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/catalog-card.d.ts +1 -2
- package/dist/components/catalog-card.d.ts.map +1 -1
- package/dist/components/catalog-card.js +1 -2
- package/dist/components/chart-card.d.ts +2 -2
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +1 -1
- package/dist/components/check-counts.d.ts +3 -5
- package/dist/components/check-counts.d.ts.map +1 -1
- package/dist/components/check-counts.js +5 -7
- package/dist/components/collection-page.d.ts +6 -7
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +3 -3
- package/dist/components/data-table.d.ts +13 -21
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +57 -192
- package/dist/components/drawer-steps.d.ts +1 -1
- package/dist/components/drawer-steps.js +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -4
- package/dist/components/dropdown-menu.d.ts.map +1 -1
- package/dist/components/dropdown-menu.js +7 -6
- package/dist/components/empty-state.d.ts +4 -1
- package/dist/components/empty-state.d.ts.map +1 -1
- package/dist/components/empty-state.js +5 -4
- package/dist/components/figure-row.d.ts +58 -0
- package/dist/components/figure-row.d.ts.map +1 -0
- package/dist/components/figure-row.js +41 -0
- package/dist/components/form-dialog.d.ts +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-drawer.d.ts +2 -2
- package/dist/components/form-drawer.js +2 -2
- package/dist/components/gauge.d.ts +2 -0
- package/dist/components/gauge.d.ts.map +1 -1
- package/dist/components/gauge.js +2 -0
- package/dist/components/icon-tile.d.ts +27 -0
- package/dist/components/icon-tile.d.ts.map +1 -0
- package/dist/components/icon-tile.js +18 -0
- package/dist/components/identity-mark.d.ts +3 -2
- package/dist/components/identity-mark.d.ts.map +1 -1
- package/dist/components/identity-mark.js +3 -10
- package/dist/components/kpi-card.d.ts +23 -6
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +11 -7
- package/dist/components/library-shelf.d.ts +1 -1
- package/dist/components/library-shelf.js +1 -1
- package/dist/components/menu-choice-row.d.ts +1 -2
- package/dist/components/menu-choice-row.d.ts.map +1 -1
- package/dist/components/menu-choice-row.js +1 -2
- package/dist/components/notice-banner.d.ts +1 -1
- package/dist/components/notice-banner.js +1 -1
- package/dist/components/numbered-steps.d.ts +1 -1
- package/dist/components/numbered-steps.js +1 -1
- package/dist/components/object-page.d.ts +33 -11
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +16 -11
- package/dist/components/object-workspace.d.ts +2 -2
- package/dist/components/object-workspace.js +2 -2
- package/dist/components/overview-page.d.ts +6 -1
- package/dist/components/overview-page.d.ts.map +1 -1
- package/dist/components/page-actions.d.ts +16 -15
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +9 -7
- package/dist/components/page-frame.d.ts +1 -1
- package/dist/components/page-frame.js +1 -1
- package/dist/components/page-header.d.ts +12 -9
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +11 -8
- package/dist/components/product-shell.d.ts +10 -13
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +9 -12
- package/dist/components/progress-checklist.d.ts +4 -4
- package/dist/components/progress-checklist.d.ts.map +1 -1
- package/dist/components/progress-checklist.js +4 -14
- package/dist/components/progress.d.ts +3 -1
- package/dist/components/progress.d.ts.map +1 -1
- package/dist/components/progress.js +3 -1
- package/dist/components/reading-column.d.ts +2 -2
- package/dist/components/reading-column.js +2 -2
- package/dist/components/record-commands.d.ts +15 -7
- package/dist/components/record-commands.d.ts.map +1 -1
- package/dist/components/record-commands.js +26 -19
- package/dist/components/record-identity.d.ts +4 -2
- package/dist/components/record-identity.d.ts.map +1 -1
- package/dist/components/record-identity.js +3 -4
- package/dist/components/record-list.d.ts +25 -27
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +31 -79
- package/dist/components/record-sheet.d.ts +1 -1
- package/dist/components/record-sheet.js +1 -1
- package/dist/components/row-edit-form.d.ts +1 -1
- package/dist/components/row-edit-form.js +1 -1
- package/dist/components/settings-facts.d.ts +5 -6
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +3 -4
- package/dist/components/settings-page.d.ts +2 -2
- package/dist/components/settings-page.js +2 -2
- package/dist/components/settings-section.d.ts +10 -5
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +8 -4
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar-sections.d.ts +4 -4
- package/dist/components/sidebar-sections.d.ts.map +1 -1
- package/dist/components/sidebar-sections.js +3 -3
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/status-badge.d.ts +15 -12
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/status-badge.js +15 -12
- package/dist/components/step-cards.d.ts +1 -2
- package/dist/components/step-cards.d.ts.map +1 -1
- package/dist/components/step-cards.js +1 -2
- package/dist/components/switch.d.ts +4 -2
- package/dist/components/switch.d.ts.map +1 -1
- package/dist/components/switch.js +9 -3
- package/dist/components/table-card.d.ts +2 -3
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +2 -3
- package/dist/components/table.d.ts +6 -24
- package/dist/components/table.d.ts.map +1 -1
- package/dist/components/table.js +11 -23
- package/dist/components/tabs-nav.d.ts +2 -2
- package/dist/components/tabs-nav.js +2 -2
- package/dist/components/text-link.d.ts +5 -5
- package/dist/components/text-link.js +5 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/internal/badge-frame.d.ts +1 -1
- package/dist/internal/badge-frame.d.ts.map +1 -1
- package/dist/internal/badge-frame.js +1 -0
- package/dist/internal/catalog-list.d.ts.map +1 -1
- package/dist/internal/catalog-list.js +1 -1
- package/dist/internal/collection-rail.d.ts +2 -2
- package/dist/internal/collection-rail.d.ts.map +1 -1
- package/dist/internal/empty.d.ts +1 -1
- package/dist/internal/empty.d.ts.map +1 -1
- package/dist/internal/empty.js +1 -2
- package/dist/internal/fieldset-disabled.d.ts +6 -0
- package/dist/internal/fieldset-disabled.d.ts.map +1 -0
- package/dist/internal/fieldset-disabled.js +7 -0
- package/dist/internal/final-focus.d.ts +2 -2
- package/dist/internal/final-focus.js +2 -2
- package/dist/internal/icon-tile-frame.d.ts +16 -0
- package/dist/internal/icon-tile-frame.d.ts.map +1 -0
- package/dist/internal/icon-tile-frame.js +21 -0
- package/dist/internal/record-grid.d.ts +58 -0
- package/dist/internal/record-grid.d.ts.map +1 -0
- package/dist/internal/record-grid.js +79 -0
- package/dist/internal/settings-save.d.ts.map +1 -1
- package/dist/internal/settings-save.js +2 -1
- package/dist/showcase/specimens/actions.d.ts.map +1 -1
- package/dist/showcase/specimens/actions.js +1 -1
- package/dist/showcase/specimens/charts.d.ts.map +1 -1
- package/dist/showcase/specimens/charts.js +1 -1
- package/dist/showcase/specimens/compositions.d.ts +0 -2
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +3 -9
- package/dist/showcase/specimens/data.d.ts +1 -0
- package/dist/showcase/specimens/data.d.ts.map +1 -1
- package/dist/showcase/specimens/data.js +7 -4
- package/dist/showcase/specimens/index.d.ts +2 -1
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/status.d.ts +1 -0
- package/dist/showcase/specimens/status.d.ts.map +1 -1
- package/dist/showcase/specimens/status.js +4 -2
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +102 -91
- package/dist/standalone/index.js +1 -1
- package/package.json +2 -2
- package/dist/components/table-layouts.d.ts +0 -110
- package/dist/components/table-layouts.d.ts.map +0 -1
- package/dist/components/table-layouts.js +0 -125
- package/dist/internal/table-compact-line.d.ts +0 -57
- package/dist/internal/table-compact-line.d.ts.map +0 -1
- package/dist/internal/table-compact-line.js +0 -119
|
@@ -6,6 +6,7 @@ import * as React from "react";
|
|
|
6
6
|
import { ChevronRight } from "lucide-react";
|
|
7
7
|
import { cn } from "../lib/utils.js";
|
|
8
8
|
import { Card, CardAction, CardDescription, CardFooter, CardHeader, CardTitle, } from "./card.js";
|
|
9
|
+
import { Progress } from "./progress.js";
|
|
9
10
|
import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
10
11
|
import { TrendBadge, trendTone } from "./trend-badge.js";
|
|
11
12
|
// The line is the only part of a card that needs the chart library, which a page of figures without
|
|
@@ -19,27 +20,30 @@ const VALUE_TONE_CLASS = {
|
|
|
19
20
|
/**
|
|
20
21
|
* One measured figure, the way the dashboard-01 section card shows it: the label above the value, the change top
|
|
21
22
|
* right as a badge, and the named comparison in the footer (`rule/kpi-card-trend-top-right`). With its values over
|
|
22
|
-
* the period (`sparkline`) it
|
|
23
|
+
* the period (`sparkline`) it is a tile: the label, the value with the change badge at its right, the
|
|
23
24
|
* line across the card's width under it, and the comparison under the line, with no footer.
|
|
24
25
|
*
|
|
25
26
|
* @family Charts
|
|
26
27
|
* @when One figure a person checks at a glance: Active Agents, Spend, Tasks done, Need attention, in an overview's row of figures.
|
|
27
|
-
* @instead A figure read over time is a `ChartCard`, and a single figure is never nested inside one. A ratio beside two money measures is a `KpiCard` next to the chart, never a second axis. A level against a cap is `Progress
|
|
28
|
-
* @behaviour Label left and the change badge right on the first line, the value under them, the comparison in the footer. The footer is one line in every card of a row, so their dividers line up: the comparison and the note, joined, cut with an ellipsis when long and whole on hover. A figure with no comparison shows no badge and no empty footer. A figure that opens its owner (`render`) ends its label with a chevron. Colour sits only where it reads a fact: direction crossed with whether up is good sets the badge icon's tone (success, blocked, or grey for a flat or neutral measure), and `tone` marks the value itself as warning or critical when it crosses a threshold; the card, label and comparison stay neutral. The label keeps two lines, wrapped or not, and the value stands under them at the same height in either layout, so the values of a row sit level whichever layout each card takes. With `sparkline`,
|
|
28
|
+
* @instead A figure read over time is a `ChartCard`, and a single figure is never nested inside one. A ratio beside two money measures is a `KpiCard` next to the chart, never a second axis. A level against a cap in a row or a card is `Progress`; as one of an overview's figures it is this card with `meter`, a 4 px bar under the value in the sparkline's place.
|
|
29
|
+
* @behaviour Label left and the change badge right on the first line, the value under them, the comparison in the footer. The footer is one line in every card of a row, so their dividers line up: the comparison and the note, joined, cut with an ellipsis when long and whole on hover. A figure with no comparison shows no badge and no empty footer. A figure that opens its owner (`render`) ends its label with a chevron. Colour sits only where it reads a fact: direction crossed with whether up is good sets the badge icon's tone (success, blocked, or grey for a flat or neutral measure), and `tone` marks the value itself as warning or critical when it crosses a threshold; the card, label and comparison stay neutral. The label keeps two lines, wrapped or not, and the value stands under them at the same height in either layout, so the values of a row sit level whichever layout each card takes. With `sparkline`, a tile: the label across the tile, the value under it with the change badge at its right, a 32 px line in `chart-1` across the card's width, then the comparison and the note in muted ink on up to two lines, which every tile of a row reserves, so the tiles' lines and comparisons sit at the same heights and nothing is cut at a five-tile row. A figure with no line or no comparison keeps the empty rows. With `meter`, the same tile with a 4 px bar in the line's place, centred in its 32 px row so it lines up with the tiles beside it: the neutral track, the fill in the action colour or the threshold `tone` the reading crossed, red past the maximum; an inline figure draws the same bar under its value. A card takes `meter` or `sparkline`, never both, and the type refuses both. The line loads on demand: a streaming server render and the browser draw it once it has loaded, and a synchronous `renderToString` leaves its row empty. While its page reads the figure, `KpiCardSkeleton` stands in its place: the same small card, the label's two lines, the value's line and, with `footer`, the footer's line, with no words; with `presentation="inline"`, the same lines with no card, inside the section that groups the figure (nadicode decision).
|
|
29
30
|
* @words The label names the measure in sentence case: "Active Agents", "Spend". The change is signed with a true minus and its unit ("+12.4%", "−1"), the comparison names the period: "vs 16 last week", "vs August 2026". No icon beside the label.
|
|
30
31
|
* @access The trend icon is hidden and the direction is read as a word in the reader's language (`directionLabel`). Figures use tabular digits. The value is text, never only colour. `KpiCardSkeleton` is busy and its bars are hidden from assistive technology.
|
|
31
32
|
*/
|
|
32
|
-
function KpiCard({ label, value, delta, note, tone = "default", render, presentation = "card", sparkline, }) {
|
|
33
|
+
function KpiCard({ label, value, delta, note, tone = "default", render, presentation = "card", sparkline, meter, }) {
|
|
33
34
|
if (presentation === "inline") {
|
|
34
|
-
return (_jsxs("div", { className: "grid min-w-0 content-start gap-2", "data-slot": "metric-summary", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: label }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { className: cn("text-2xl font-semibold tabular-nums", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), delta ? (_jsx(TrendBadge, { value: delta.value, direction: delta.direction, tone: trendTone(delta.direction, delta.upIsGood, delta.neutral), directionLabel: delta.directionLabel })) : null] }), delta ? _jsx("p", { className: "text-xs text-muted-foreground", children: delta.comparison }) : null, note ? _jsx("p", { className: "text-xs text-muted-foreground", children: note }) : null] }));
|
|
35
|
+
return (_jsxs("div", { className: "grid min-w-0 content-start gap-2", "data-slot": "metric-summary", children: [_jsx("p", { className: "text-sm text-muted-foreground", children: label }), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("p", { className: cn("text-2xl font-semibold tabular-nums", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), delta ? (_jsx(TrendBadge, { value: delta.value, direction: delta.direction, tone: trendTone(delta.direction, delta.upIsGood, delta.neutral), directionLabel: delta.directionLabel })) : null] }), meter ? _jsx(MeterBar, { meter: meter }) : null, delta ? _jsx("p", { className: "text-xs text-muted-foreground", children: delta.comparison }) : null, note ? _jsx("p", { className: "text-xs text-muted-foreground", children: note }) : null] }));
|
|
35
36
|
}
|
|
36
37
|
const footerLine = [delta?.comparison, note].filter(Boolean).join(" · ");
|
|
37
38
|
const badge = delta ? (_jsx(TrendBadge, { value: delta.value, direction: delta.direction, tone: trendTone(delta.direction, delta.upIsGood, delta.neutral), directionLabel: delta.directionLabel })) : null;
|
|
38
|
-
if (sparkline) {
|
|
39
|
-
return (_jsx(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: _jsxs(CardHeader, { className: "gap-y-1", children: [_jsxs(CardDescription, { className: "col-span-2 mb-1 flex min-h-10 min-w-0 items-start gap-0.5", children: [_jsx("span", { className: "line-clamp-2", children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }) : null] }), delta ? (_jsx(CardAction, { "data-kpi-delta": delta.direction, className: "row-span-1 row-start-2 self-center", children: badge })) : null, _jsx(CardTitle, { className: cn("col-start-1 row-start-2 min-w-0 truncate text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), _jsx("div", { "data-slot": "kpi-card-sparkline", className: "col-span-2 mt-1 h-8 min-w-0", children: sparkline.length > 1 ? (_jsx(React.Suspense, { fallback: null, children: _jsx(ChartSparkline, { data: sparkline, className: "h-8 w-full" }) })) : null }), _jsx("p", { "data-slot": "kpi-card-change", className: "col-span-2 mt-1 line-clamp-2 min-h-10 min-w-0 text-sm text-muted-foreground", title: footerLine || undefined, children: footerLine })] }) }));
|
|
39
|
+
if (sparkline || meter) {
|
|
40
|
+
return (_jsx(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: _jsxs(CardHeader, { className: "gap-y-1", children: [_jsxs(CardDescription, { className: "col-span-2 mb-1 flex min-h-10 min-w-0 items-start gap-0.5", children: [_jsx("span", { className: "line-clamp-2", children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }) : null] }), delta ? (_jsx(CardAction, { "data-kpi-delta": delta.direction, className: "row-span-1 row-start-2 self-center", children: badge })) : null, _jsx(CardTitle, { className: cn("col-start-1 row-start-2 min-w-0 truncate text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), meter ? (_jsx("div", { "data-slot": "kpi-card-meter", className: "col-span-2 mt-1 flex h-8 min-w-0 items-center", children: _jsx(MeterBar, { meter: meter }) })) : (_jsx("div", { "data-slot": "kpi-card-sparkline", className: "col-span-2 mt-1 h-8 min-w-0", children: sparkline && sparkline.length > 1 ? (_jsx(React.Suspense, { fallback: null, children: _jsx(ChartSparkline, { data: sparkline, className: "h-8 w-full" }) })) : null })), _jsx("p", { "data-slot": "kpi-card-change", className: "col-span-2 mt-1 line-clamp-2 min-h-10 min-w-0 text-sm text-muted-foreground", title: footerLine || undefined, children: footerLine })] }) }));
|
|
40
41
|
}
|
|
41
42
|
return (_jsxs(Card, { size: "sm", "data-slot": "kpi-card", "data-tone": tone, render: render, variant: render ? "link" : "default", children: [_jsxs(CardHeader, { children: [_jsxs(CardDescription, { className: "flex min-h-10 items-start gap-0.5", children: [_jsx("span", { className: "line-clamp-2", children: label }), render ? _jsx(ChevronRight, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }) : null] }), _jsx(CardTitle, { className: cn("text-heading-md tabular-nums group-data-[size=sm]/card:text-heading-md", VALUE_TONE_CLASS[tone]), "data-kpi-value": "", children: value }), delta ? _jsx(CardAction, { "data-kpi-delta": delta.direction, children: badge }) : null] }), delta || note ? (_jsx(CardFooter, { className: "flex-nowrap", children: _jsx("span", { className: "min-w-0 truncate", title: footerLine, children: footerLine }) })) : null] }));
|
|
42
43
|
}
|
|
44
|
+
function MeterBar({ meter }) {
|
|
45
|
+
return (_jsx(Progress, { "aria-label": meter.label, className: "w-full", max: meter.max, size: "sm", tone: meter.tone, value: meter.value }));
|
|
46
|
+
}
|
|
43
47
|
/**
|
|
44
48
|
* What stands in a KpiCard's place while its page reads the figure: the card, the label's two
|
|
45
49
|
* lines, the value's line and, for a figure with a comparison or a note, the footer's line. An
|
|
@@ -36,7 +36,7 @@ export type LibraryShelfProps = {
|
|
|
36
36
|
* reusable things a person adds, as two-column entries, or Agent template cards or rows.
|
|
37
37
|
*
|
|
38
38
|
* @family Compositions
|
|
39
|
-
* @when A gallery of reusable things a person adds
|
|
39
|
+
* @when A gallery of reusable things a person adds: the Portal's Agent templates, Nadia's New Agent gallery; or a catalogue of cards: Nadia's Browse apps (`cards`).
|
|
40
40
|
* @instead The Portal's Skills and Plugins are entity rows a person finds, opens and adds, a CollectionPage; records a person already has and acts on are a CollectionPage too; choosing from a catalogue without leaving the page is a CatalogDrawer.
|
|
41
41
|
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates as cards, three to a row or as `columns` says, or as one list of rows with `view="rows"`, or the cards, three to a row, with `more` under them. Each entry has its kind's tile, its name (the link to its page), one line, one fact, one Add control or the word saying it is already added, then its menu. A failed add puts its message in the entry's line and its next steps beside its controls. The search shows unless the shelf is empty, with `searchEnd` at the end of its row.
|
|
42
42
|
* @words The product words every string: the optional definition (one sentence on what the shelf holds), the search's label ("Search skills"), the loading label, each entry's name, line, Add label and added word, the empty, noMatch and failed messages.
|
|
@@ -43,7 +43,7 @@ function ShelfContents({ shelf }) {
|
|
|
43
43
|
* reusable things a person adds, as two-column entries, or Agent template cards or rows.
|
|
44
44
|
*
|
|
45
45
|
* @family Compositions
|
|
46
|
-
* @when A gallery of reusable things a person adds
|
|
46
|
+
* @when A gallery of reusable things a person adds: the Portal's Agent templates, Nadia's New Agent gallery; or a catalogue of cards: Nadia's Browse apps (`cards`).
|
|
47
47
|
* @instead The Portal's Skills and Plugins are entity rows a person finds, opens and adds, a CollectionPage; records a person already has and acts on are a CollectionPage too; choosing from a catalogue without leaving the page is a CatalogDrawer.
|
|
48
48
|
* @behaviour The definition line only where the page has no title row to stand under (a titled page follows the title with the search, as every collection does). Shows, the first that holds: the failure; still entries while the shelf loads; noMatch while the search finds nothing; empty when the shelf holds nothing; then each section's title over its entries, two to a row from md, or the templates as cards, three to a row or as `columns` says, or as one list of rows with `view="rows"`, or the cards, three to a row, with `more` under them. Each entry has its kind's tile, its name (the link to its page), one line, one fact, one Add control or the word saying it is already added, then its menu. A failed add puts its message in the entry's line and its next steps beside its controls. The search shows unless the shelf is empty, with `searchEnd` at the end of its row.
|
|
49
49
|
* @words The product words every string: the optional definition (one sentence on what the shelf holds), the search's label ("Search skills"), the loading label, each entry's name, line, Add label and added word, the empty, noMatch and failed messages.
|
|
@@ -15,8 +15,7 @@ export type MenuChoiceRowProps<Value extends string = string> = Omit<React.Compo
|
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* A named preference inside a menu: its label at the leading edge and the
|
|
18
|
-
* exclusive choices in one small round pill at the trailing edge
|
|
19
|
-
* account menu draws Theme.
|
|
18
|
+
* exclusive choices in one small round pill at the trailing edge.
|
|
20
19
|
*
|
|
21
20
|
* @family Menus
|
|
22
21
|
* @when A setting that applies at once from inside a menu: the account menu's Theme and Language.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-choice-row.d.ts","sourceRoot":"","sources":["../../src/components/menu-choice-row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI;IAC5D,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAClE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5C,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"menu-choice-row.d.ts","sourceRoot":"","sources":["../../src/components/menu-choice-row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI;IAC5D,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAClE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAC3B,UAAU,GAAG,UAAU,CACxB,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IAC5C,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,iBAAS,aAAa,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EACpD,SAAS,EACT,QAAQ,EACR,KAAK,EACL,aAAa,EACb,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,KAAK,CAAC,qBAkC3B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -3,8 +3,7 @@ import { DropdownMenuRadioGroup, DropdownMenuRadioItem } from "./dropdown-menu.j
|
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* A named preference inside a menu: its label at the leading edge and the
|
|
6
|
-
* exclusive choices in one small round pill at the trailing edge
|
|
7
|
-
* account menu draws Theme.
|
|
6
|
+
* exclusive choices in one small round pill at the trailing edge.
|
|
8
7
|
*
|
|
9
8
|
* @family Menus
|
|
10
9
|
* @when A setting that applies at once from inside a menu: the account menu's Theme and Language.
|
|
@@ -26,7 +26,7 @@ export type NoticeBannerProps = {
|
|
|
26
26
|
*
|
|
27
27
|
* @family Feedback
|
|
28
28
|
* @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`, a `DataTable` that is the page's job, and `EntryPage` outside the shell), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
|
|
29
|
-
* @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section
|
|
29
|
+
* @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section; the Portal's System health raises it through Knock to the bell at the sidebar's foot.
|
|
30
30
|
* @behaviour "Project Banner is non-dismissible by design. If the message can be dismissed without resolving the underlying state, it isn’t banner-worthy; move it to a `Note`." (https://vercel.com/geist/project-banner) "Show one Project Banner at a time. Stacking competing banners drowns the most urgent state." (https://vercel.com/geist/project-banner) "Always pass a `callToAction` that resolves the state. A banner with no route is a dead end." (https://vercel.com/geist/project-banner) Ours: a strip as wide as its container: a filled ground with a line on its top and bottom edge only, no corners, 40 px high and centred, with the mark, the sentence and the fix on one row; under 768 px the fix drops under the sentence, aligned with its text. The title and the description run on as one passage: the title closed by a full stop when it has none of its own, leading in semibold when a description follows and at regular weight alone, the description after it on the same line, and a description that repeats the title not shown. `detail` takes its own row under the passage. Colour sits on the whole strip (ground, both lines, mark and text); the fix is an underlined link in the darkest step of the same hue (neutral: `text-foreground`) and returns to the strip's text on hover. Neutral and info take the Info mark, warning and destructive the TriangleAlert. `action` is the `callToAction`: one command, never two, never a ready-made button, and there is no close button. Required: `action`, `title`, `tone` and `liveRegion`; the mark is always drawn, and `icon` swaps the tone's mark for another lucide icon.
|
|
31
31
|
* @words "`label` is one sentence in sentence case that names the impact: `Your Pro trial expires in 3 days.` Don’t open with `Heads up` or apologetic preambles." (https://vercel.com/geist/project-banner) "`callToAction.label` is Title Case `Verb + Noun` and points at the resolver: `Update Payment Method`, `Reactivate Project`, `Review Tokens`." (https://vercel.com/geist/project-banner) "Name the affected entity when the project context isn’t obvious from the surrounding chrome (`Production deployments are paused on my-project`)." (https://vercel.com/geist/project-banner) "Don’t encode severity in the copy with emoji or interjections; the variant carries that signal." (https://vercel.com/geist/project-banner) "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) Ours: the `title` is the `label`: the one sentence, naming the condition, its impact and the object. A `description` only adds what the title leaves out, in one more sentence. Our `label` is the `NoteLabel` topic prefix. The action is sentence case, verb and noun, pointing at the resolver: "Update payment method", "Try again". No "Please". The words come from the product's catalogue code.
|
|
32
32
|
* @access `liveRegion="assertive"` gives `role="alert"`, for a failure the person just caused; `"polite"` gives `role="status"`, announced once when it appears; `"off"` gives `role="note"` for one already there at load. The mark, given or not, is hidden.
|
|
@@ -10,7 +10,7 @@ const LIVE_REGION_ROLE = { assertive: "alert", polite: "status", off: "note" };
|
|
|
10
10
|
*
|
|
11
11
|
* @family Feedback
|
|
12
12
|
* @when "A prominent message that spans the full width of its container to announce important information." (https://vercel.com/geist/banner) "Used for temporary, project-wide notifications that require resolution" (https://vercel.com/geist/project-banner) "Use Project Banner for project-wide states that need resolution: overdue billing, an active rollback, attack mitigation, an expiring trial blocking deploys." (https://vercel.com/geist/project-banner) "Match `variant` to severity: `error` for critical downtime or payment-blocking states, `warning` for an exceptional state with non-immediate action, `success` for a positive temporary mitigation, `gray` for routine project-wide notices." (https://vercel.com/geist/project-banner) Ours: a condition of the page's own object that the page itself resolves, with that resolving action on the banner: a past-due subscription on its billing page, a failed refresh of the page's own reading. The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` and `neutral` is `gray`. A page gives it to its composition's `notice` (`CollectionPage`, `ObjectPage`, `OverviewPage`, `SettingsPage`, a `DataTable` that is the page's job, and `EntryPage` outside the shell), which places it under the title; a product never renders it, which `nadicodeai/page-composition` refuses (nadicode decision).
|
|
13
|
-
* @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section
|
|
13
|
+
* @instead "Pick `Note` for inline contextual messages tied to a single field or card, `Toast` for transient acknowledgments, `Modal` for confirmations." (https://vercel.com/geist/project-banner) Ours: there is no announcement strip. `Note` is `MessageNotice` (`placement="section"`), `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a measured level use a `KpiCard` with its tone; crossing a threshold is a notification in the inbox, not a banner. A condition of the system, the setup or the staff (a connection, a stored secret, a failing job, anything a staff member fixes in settings) is a notification in the product's inbox, never a banner on a page, and the page that fixes it shows the state in its own section; the Portal's System health raises it through Knock to the bell at the sidebar's foot.
|
|
14
14
|
* @behaviour "Project Banner is non-dismissible by design. If the message can be dismissed without resolving the underlying state, it isn’t banner-worthy; move it to a `Note`." (https://vercel.com/geist/project-banner) "Show one Project Banner at a time. Stacking competing banners drowns the most urgent state." (https://vercel.com/geist/project-banner) "Always pass a `callToAction` that resolves the state. A banner with no route is a dead end." (https://vercel.com/geist/project-banner) Ours: a strip as wide as its container: a filled ground with a line on its top and bottom edge only, no corners, 40 px high and centred, with the mark, the sentence and the fix on one row; under 768 px the fix drops under the sentence, aligned with its text. The title and the description run on as one passage: the title closed by a full stop when it has none of its own, leading in semibold when a description follows and at regular weight alone, the description after it on the same line, and a description that repeats the title not shown. `detail` takes its own row under the passage. Colour sits on the whole strip (ground, both lines, mark and text); the fix is an underlined link in the darkest step of the same hue (neutral: `text-foreground`) and returns to the strip's text on hover. Neutral and info take the Info mark, warning and destructive the TriangleAlert. `action` is the `callToAction`: one command, never two, never a ready-made button, and there is no close button. Required: `action`, `title`, `tone` and `liveRegion`; the mark is always drawn, and `icon` swaps the tone's mark for another lucide icon.
|
|
15
15
|
* @words "`label` is one sentence in sentence case that names the impact: `Your Pro trial expires in 3 days.` Don’t open with `Heads up` or apologetic preambles." (https://vercel.com/geist/project-banner) "`callToAction.label` is Title Case `Verb + Noun` and points at the resolver: `Update Payment Method`, `Reactivate Project`, `Review Tokens`." (https://vercel.com/geist/project-banner) "Name the affected entity when the project context isn’t obvious from the surrounding chrome (`Production deployments are paused on my-project`)." (https://vercel.com/geist/project-banner) "Don’t encode severity in the copy with emoji or interjections; the variant carries that signal." (https://vercel.com/geist/project-banner) "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) Ours: the `title` is the `label`: the one sentence, naming the condition, its impact and the object. A `description` only adds what the title leaves out, in one more sentence. Our `label` is the `NoteLabel` topic prefix. The action is sentence case, verb and noun, pointing at the resolver: "Update payment method", "Try again". No "Please". The words come from the product's catalogue code.
|
|
16
16
|
* @access `liveRegion="assertive"` gives `role="alert"`, for a failure the person just caused; `"polite"` gives `role="status"`, announced once when it appears; `"off"` gives `role="note"` for one already there at load. The mark, given or not, is hidden.
|
|
@@ -29,7 +29,7 @@ export type NumberedStepsProps = {
|
|
|
29
29
|
* Steps a person follows, each with its number, its words and its own action.
|
|
30
30
|
*
|
|
31
31
|
* @family Other
|
|
32
|
-
* @when A short sequence the person does: installing Nadia from Downloads, connecting Teams, the Dashboard's setup guide, an `ObjectSection` whose body is these steps; or a sequence whose real progress the page tracks, such as the company check; and, as `columns`, the few steps a page explains, such as the website's how it works.
|
|
32
|
+
* @when A short sequence the person does: installing Nadia from Downloads, connecting Teams, the Dashboard's setup guide, an `ObjectSection` whose body is these steps; or a sequence whose real progress the page tracks, such as the company check; and, as `columns`, the few steps a page explains, such as the website's how it works.
|
|
33
33
|
* @instead Stages the system runs on an entry screen are the EntryStageList; the steps of an Agent's run are a RunTimeline; a setup with a wait is a FormDrawer with its "Step 2 of 3" line.
|
|
34
34
|
* @behaviour Each step is a 28 px square number in label-mono, its title, one muted description and, under it, the step's own action. Instructions mark no step and every number stays muted, because the page cannot know which one the person is on. Where the page tracks real progress, `current` turns that step's number to ink and writes its word beside the title. `framed` draws one bordered list with a seam between steps; `columns` sets the steps side by side as the width it is given allows, each column at least 192 px, so a phone stacks them and a wide page or panel holds three, each number above its words, and is never framed. A step's action never grows past its step: one wider than the step is held to its width. Colour is neutral: the current number is ink on the page's background and the others are muted; no hue marks a step. It is the one owner of a drawn step number.
|
|
35
35
|
* @words The title is what the person does, in the imperative ("Install Nadia"), or a finished step in the past tense ("Sofia looked up acme.it"). The current step's word is short: "Now". An action names its verb and carries its platform line ("macOS · 2.14.0 · Apple silicon").
|
|
@@ -4,7 +4,7 @@ import { cn } from "../lib/utils.js";
|
|
|
4
4
|
* Steps a person follows, each with its number, its words and its own action.
|
|
5
5
|
*
|
|
6
6
|
* @family Other
|
|
7
|
-
* @when A short sequence the person does: installing Nadia from Downloads, connecting Teams, the Dashboard's setup guide, an `ObjectSection` whose body is these steps; or a sequence whose real progress the page tracks, such as the company check; and, as `columns`, the few steps a page explains, such as the website's how it works.
|
|
7
|
+
* @when A short sequence the person does: installing Nadia from Downloads, connecting Teams, the Dashboard's setup guide, an `ObjectSection` whose body is these steps; or a sequence whose real progress the page tracks, such as the company check; and, as `columns`, the few steps a page explains, such as the website's how it works.
|
|
8
8
|
* @instead Stages the system runs on an entry screen are the EntryStageList; the steps of an Agent's run are a RunTimeline; a setup with a wait is a FormDrawer with its "Step 2 of 3" line.
|
|
9
9
|
* @behaviour Each step is a 28 px square number in label-mono, its title, one muted description and, under it, the step's own action. Instructions mark no step and every number stays muted, because the page cannot know which one the person is on. Where the page tracks real progress, `current` turns that step's number to ink and writes its word beside the title. `framed` draws one bordered list with a seam between steps; `columns` sets the steps side by side as the width it is given allows, each column at least 192 px, so a phone stacks them and a wide page or panel holds three, each number above its words, and is never framed. A step's action never grows past its step: one wider than the step is held to its width. Colour is neutral: the current number is ink on the page's background and the others are muted; no hue marks a step. It is the one owner of a drawn step number.
|
|
10
10
|
* @words The title is what the person does, in the imperative ("Install Nadia"), or a finished step in the past tense ("Sofia looked up acme.it"). The current step's word is short: "Now". An action names its verb and carries its platform line ("macOS · 2.14.0 · Apple silicon").
|
|
@@ -2,39 +2,59 @@ import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
|
2
2
|
import { type NoticeBannerProps } from "./notice-banner.js";
|
|
3
3
|
import { type IdentityMarkProps } from "./identity-mark.js";
|
|
4
4
|
import { type CardActions } from "./page-actions.js";
|
|
5
|
-
type
|
|
5
|
+
import { type TableValueProps } from "./table-value.js";
|
|
6
|
+
type ObjectPageFactShape = {
|
|
6
7
|
label: string;
|
|
8
|
+
/** The mark of the value's kind, drawn before the value. */
|
|
9
|
+
icon?: ReactElement | undefined;
|
|
10
|
+
/** The value is long, such as an address: it takes two columns. */
|
|
11
|
+
wide?: boolean | undefined;
|
|
12
|
+
};
|
|
13
|
+
export type ObjectPageFact = ObjectPageFactShape & ({
|
|
7
14
|
value: ReactNode;
|
|
8
15
|
url?: never;
|
|
9
16
|
} | {
|
|
10
|
-
label: string;
|
|
11
17
|
value: string;
|
|
12
18
|
/** The value is a web address, such as a company's website: it wraps only after `://`, a dot or a slash. */
|
|
13
19
|
url: true;
|
|
14
|
-
|
|
20
|
+
/** Where the address opens, in a new tab, when the value is the address as read: its host. */
|
|
21
|
+
href?: string | undefined;
|
|
22
|
+
});
|
|
15
23
|
export type ObjectPageEntry = {
|
|
16
|
-
/** The row's noun phrase: "
|
|
24
|
+
/** The row's noun phrase: "Activity". */
|
|
17
25
|
title: string;
|
|
18
26
|
/** What the row counts or states, at its trailing edge before the chevron: a Badge or a count. */
|
|
19
27
|
summary?: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* A setting's current value at the row's trailing edge, in each state a reading can be in:
|
|
30
|
+
* the value, a muted dash for none, the failed words, or its place while it loads.
|
|
31
|
+
*/
|
|
32
|
+
value?: TableValueProps;
|
|
20
33
|
/** Opens with the page, for a link that names this row. */
|
|
21
34
|
defaultOpen?: boolean;
|
|
22
35
|
children: ReactNode;
|
|
23
36
|
};
|
|
24
37
|
export type ObjectPageLink = {
|
|
25
38
|
label: string;
|
|
26
|
-
/** The product's router link, such as `<Link href="/
|
|
39
|
+
/** The product's router link, such as `<Link href="/agents" />`. */
|
|
27
40
|
link: ReactElement;
|
|
28
41
|
/** Opens outside the product: the arrow after the label. */
|
|
29
42
|
external?: boolean | undefined;
|
|
30
43
|
};
|
|
31
44
|
export type ObjectPageFooter = {
|
|
32
|
-
/** One muted line saying where the object changes or what governs it
|
|
45
|
+
/** One muted line saying where the object changes or what governs it. */
|
|
33
46
|
hint: string;
|
|
34
47
|
/** The one way on, elsewhere. A link only: nothing in this footer saves or changes the object. */
|
|
35
48
|
link: ObjectPageLink;
|
|
36
49
|
};
|
|
37
50
|
export type ObjectPageProps = {
|
|
51
|
+
/**
|
|
52
|
+
* The card's title, naming what the card holds: the object's name is then in the product's path,
|
|
53
|
+
* the h1 is read only, and the mark and line give way to `picture`.
|
|
54
|
+
*/
|
|
55
|
+
heading?: string | undefined;
|
|
56
|
+
/** The object's picture beside its facts, such as a company's map. It fills the facts' height. */
|
|
57
|
+
picture?: ReactNode;
|
|
38
58
|
/** The object's mark, drawn at 64 beside a company's name or another object's facts. */
|
|
39
59
|
mark: IdentityMarkProps;
|
|
40
60
|
name: string;
|
|
@@ -44,11 +64,13 @@ export type ObjectPageProps = {
|
|
|
44
64
|
description?: ReactNode;
|
|
45
65
|
/** Key facts as labelled values in one row. Left out only while the object does not exist yet, such as an account with no plan. */
|
|
46
66
|
facts?: readonly [ObjectPageFact, ...ObjectPageFact[]];
|
|
67
|
+
/** The object's own readings inside its card, after the facts and before the entries: one `FigureRows`. */
|
|
68
|
+
figures?: ReactNode;
|
|
47
69
|
/** A condition of the object that the page fixes, above its card: one `NoticeBanner`. */
|
|
48
70
|
notice?: NoticeBannerProps;
|
|
49
71
|
/** The object's commands on its header bar: a secondary, the primary, then the three dots. */
|
|
50
72
|
actions?: CardActions;
|
|
51
|
-
/** Rows that open under the facts
|
|
73
|
+
/** Rows that open under the facts for what most visits skip: one of its settings, its activity, its notes. What every reader needs, and a collection a person manages, is a section under the card instead. */
|
|
52
74
|
entries?: readonly ObjectPageEntry[];
|
|
53
75
|
/** The footer: a hint and one link elsewhere. Left out when the object has no such line. */
|
|
54
76
|
footer?: ObjectPageFooter;
|
|
@@ -60,12 +82,12 @@ export type ObjectPageProps = {
|
|
|
60
82
|
* elsewhere, then its sections as cards.
|
|
61
83
|
*
|
|
62
84
|
* @family Compositions
|
|
63
|
-
* @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry.
|
|
64
|
-
* @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections
|
|
65
|
-
* @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card.
|
|
85
|
+
* @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry, an Agent's Profile in Nadia's window.
|
|
86
|
+
* @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections. A card of values a person saves is a setting card, never this one.
|
|
87
|
+
* @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. The object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header; with `heading` the header instead names what the card holds, the name staying in the product's path and the page's h1 read only, and with `picture` the object's picture stands beside its facts, such as a company's map of its registered office (owner, 2026-11-08); facts follow in four columns once they have 36rem and two below, or in three beside a `picture`, each value after the mark of its kind (`icon`), a long one such as an address across two columns (`wide`); the facts are the object's own details, so none repeats the product's path (the name, the status beside it) or a tab (the Agents an Agents tab lists), and beside a `picture` they keep to four rows while the picture stands as tall as they do, so no fact runs below it (owner, 2026-11-08) (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. `figures` are the object's own readings, a `FigureRows` between the facts and the entries, under a rule and at the card's inset. Optional `entries` close the same card under a rule: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save fits in it. The object changes from its card, never from a Settings tab (owner, 2026-11-08): the card's secondary command, Edit, opens a `FormDialog` of the facts the card shows; each setting the card does not show is one of its `entries`, its `value` the current value (read, missing, failed or loading, as `TableValue` draws them, muted), holding a `SettingsSection` with `frame="fold"` whose controls are live and whose Save is off until one changes (owner, 2026-11-09). An entry holds what most visits to the object skip (one of its settings, its history, its notes, the output of one of its steps), read in place once opened; what every reader of the page needs, and a collection a person adds to or manages, is a section with its heading under the card (a `RecordList` or a `DataTable`), never an entry, and a different question about the object is a tab of its own (owner, 2026-11-09). A value on the card is never a control that opens an editor. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground. A fact marked `url`, such as a company's website, wraps only after `://`, a dot or a slash, never inside a word, and keeps the whole address as its text (design inspection, 2026-11-07).
|
|
66
88
|
* @words "Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen." (https://vercel.com/geist/entity) "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description) Ours: sentence case throughout. The name as the object is called everywhere else; the line says what it is and whose ("Customer of Partner Alpha · since 3 August 2026"); a fact's label is a noun ("Plan"), its value the figure; an entry's title is a noun phrase; the hint is one sentence ("To update it, push to the main branch."); the link names where it goes ("Deployments"); the menu's trigger reads "More for {name}".
|
|
67
89
|
* @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description) "Don’t wrap the component in extra paragraphs that break the list semantics." (https://vercel.com/geist/description) Ours: with `headingProps` the name is the page's h1; without them it is text, for a product whose chrome already titles the page. The mark is decorative beside the name. Each entry is an h2 heading holding a button with `aria-expanded` that controls its panel.
|
|
68
90
|
*/
|
|
69
|
-
export declare function ObjectPage({ mark, name, headingProps, description, facts, actions, entries, footer, notice, children, }: ObjectPageProps): ReactElement;
|
|
91
|
+
export declare function ObjectPage({ heading, picture, mark, name, headingProps, description, facts, figures, actions, entries, footer, notice, children, }: ObjectPageProps): ReactElement;
|
|
70
92
|
export {};
|
|
71
93
|
//# sourceMappingURL=object-page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-page.d.ts","sourceRoot":"","sources":["../../src/components/object-page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"object-page.d.ts","sourceRoot":"","sources":["../../src/components/object-page.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAY,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAKlF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAqC,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEjE,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,mEAAmE;IACnE,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,mBAAmB,GAC9C,CACI;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAE,GACjC;IACE,KAAK,EAAE,MAAM,CAAC;IACd,4GAA4G;IAC5G,GAAG,EAAE,IAAI,CAAC;IACV,8FAA8F;IAC9F,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CACJ,CAAC;AAoBJ,MAAM,MAAM,eAAe,GAAG;IAC5B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,YAAY,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,kGAAkG;IAClG,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,wFAAwF;IACxF,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,YAAY,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IACtD,qFAAqF;IACrF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,mIAAmI;IACnI,KAAK,CAAC,EAAE,SAAS,CAAC,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC;IACvD,2GAA2G;IAC3G,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,yFAAyF;IACzF,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,8FAA8F;IAC9F,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,+MAA+M;IAC/M,OAAO,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACrC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,4IAA4I;IAC5I,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,GAAG,YAAY,CA0LhC"}
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from "react";
|
|
3
3
|
import { FooterStrip } from "../internal/footer-strip.js";
|
|
4
4
|
import { NoticeBanner } from "./notice-banner.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { textLinkVariants } from "./text-link.js";
|
|
6
7
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./accordion.js";
|
|
7
8
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./card.js";
|
|
8
9
|
import { IdentityMark } from "./identity-mark.js";
|
|
9
10
|
import { CardActionsRow, PageCommandButton } from "./page-actions.js";
|
|
11
|
+
import { TableValue } from "./table-value.js";
|
|
10
12
|
const AFTER_DOT_OR_SLASH = /(?<=[./])(?!\/)/;
|
|
11
|
-
function UrlValue({ url }) {
|
|
12
|
-
|
|
13
|
+
function UrlValue({ url, href }) {
|
|
14
|
+
const parts = url.split(AFTER_DOT_OR_SLASH).map((part, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx("wbr", {}) : null, part] }, `${index}:${part}`)));
|
|
15
|
+
return href ? (_jsx("a", { className: textLinkVariants({ kind: "plain" }), href: href, rel: "noreferrer", target: "_blank", children: parts })) : (parts);
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* One object's page: the object card with its name, commands, facts, rows that open and one link
|
|
16
19
|
* elsewhere, then its sections as cards.
|
|
17
20
|
*
|
|
18
21
|
* @family Compositions
|
|
19
|
-
* @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry.
|
|
20
|
-
* @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections
|
|
21
|
-
* @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card.
|
|
22
|
+
* @when One thing a person opened from a list and now reads or acts on: a customer, a partner, an Installation, a Library entry, an Agent's Profile in Nadia's window.
|
|
23
|
+
* @instead "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a project, an API key." (https://vercel.com/geist/context-card) Ours: that hover is a `HoverCard`, drawn inside this package by a component such as `RecordTime`, never this page. A list of records is a CollectionPage; a page of settings only is a SettingsPage, whose cards are SettingsSections. A card of values a person saves is a setting card, never this one.
|
|
24
|
+
* @behaviour "For a static key/value metadata block on a detail page, use `Description`." (https://vercel.com/geist/entity) "The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`." (https://vercel.com/geist/entity) "Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`)." (https://vercel.com/geist/entity) "Don’t put interactive controls in the title slot. Buttons, menus, and links belong in the content (`<dd>`) or in the parent layout, not the label (`<dt>`)." (https://vercel.com/geist/description) Ours: where the product draws a path, the path above the page names the object's parent, and the product's section navigation stands between the path and the card. The object card is the first card of the page: a header bar with the name at the start and the object's commands at the end (a secondary, then the primary as the filled button, then the three dots, in `PageActions`' order, on the name's row while the name keeps 128 px, as on a phone, and under it otherwise; the primary is the one thing the object waits on its viewer for, such as approving a company that waits for approval, beside its alternative as the secondary, and an object with nothing waiting has none), the mark at 64 stands beside the name and optional line in the header; with `heading` the header instead names what the card holds, the name staying in the product's path and the page's h1 read only, and with `picture` the object's picture stands beside its facts, such as a company's map of its registered office (owner, 2026-11-08); facts follow in four columns once they have 36rem and two below, or in three beside a `picture`, each value after the mark of its kind (`icon`), a long one such as an address across two columns (`wide`); the facts are the object's own details, so none repeats the product's path (the name, the status beside it) or a tab (the Agents an Agents tab lists), and beside a `picture` they keep to four rows while the picture stands as tall as they do, so no fact runs below it (owner, 2026-11-08) (an object that exists always has one; an object not made yet, such as an account's plan before it chooses one, has none, and its card is the header alone, its name saying so and, for a viewer who may, its primary making it), each a muted label over its value in body text, then an optional footer with a hint at the start and one link at the end. `figures` are the object's own readings, a `FigureRows` between the facts and the entries, under a rule and at the card's inset. Optional `entries` close the same card under a rule: rows that open one by one, each with its chevron first (it turns down when open), its title, and its summary at the trailing edge; an open entry's panel starts under its title, and on a card narrower than 28 rem, as on a phone, at the card's edge, so its sections keep the chevron's room; an entry marked `defaultOpen` opens with the page, for a link that names it. The footer takes a link only, so no Save fits in it. The object changes from its card, never from a Settings tab (owner, 2026-11-08): the card's secondary command, Edit, opens a `FormDialog` of the facts the card shows; each setting the card does not show is one of its `entries`, its `value` the current value (read, missing, failed or loading, as `TableValue` draws them, muted), holding a `SettingsSection` with `frame="fold"` whose controls are live and whose Save is off until one changes (owner, 2026-11-09). An entry holds what most visits to the object skip (one of its settings, its history, its notes, the output of one of its steps), read in place once opened; what every reader of the page needs, and a collection a person adds to or manages, is a section with its heading under the card (a `RecordList` or a `DataTable`), never an entry, and a different question about the object is a tab of its own (owner, 2026-11-09). A value on the card is never a control that opens an editor. The sections follow, 24 apart, each an `ObjectSection`, `ObjectFacts`, a `RecordList` with its `heading`, a `SettingsSection` or an `ActivityFeed`, drawing its own states; a section earns a card when it owns a decision, never for every label and value. The card is neutral; colour belongs to the company's compact identity, a semantic fact value, or an entry's status summary, with no coloured card ground. A fact marked `url`, such as a company's website, wraps only after `://`, a dot or a slash, never inside a word, and keeps the whole address as its text (design inspection, 2026-11-07).
|
|
22
25
|
* @words "Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen." (https://vercel.com/geist/entity) "Title slot is Title Case noun (`Last Deployed`, `Build Duration`); content is sentence case unless the value is a literal identifier, ID, or timestamp that should be preserved verbatim." (https://vercel.com/geist/description) Ours: sentence case throughout. The name as the object is called everywhere else; the line says what it is and whose ("Customer of Partner Alpha · since 3 August 2026"); a fact's label is a noun ("Plan"), its value the figure; an entry's title is a noun phrase; the hint is one sentence ("To update it, push to the main branch."); the link names where it goes ("Deployments"); the menu's trigger reads "More for {name}".
|
|
23
26
|
* @access "Geist renders `<dl>`/`<dt>`/`<dd>` so screen readers announce each key/value pair as a definition." (https://vercel.com/geist/description) "Don’t wrap the component in extra paragraphs that break the list semantics." (https://vercel.com/geist/description) Ours: with `headingProps` the name is the page's h1; without them it is text, for a product whose chrome already titles the page. The mark is decorative beside the name. Each entry is an h2 heading holding a button with `aria-expanded` that controls its panel.
|
|
24
27
|
*/
|
|
25
|
-
export function ObjectPage({ mark, name, headingProps, description, facts, actions, entries, footer, notice, children, }) {
|
|
26
|
-
const title = headingProps ? (_jsx("h1", { ...headingProps, className: cn("outline-none", headingProps.className), children: name })) : (name);
|
|
27
|
-
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null,
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
export function ObjectPage({ heading, picture, mark, name, headingProps, description, facts, figures, actions, entries, footer, notice, children, }) {
|
|
29
|
+
const title = headingProps ? (_jsx("h1", { ...headingProps, className: cn("outline-none", heading && "sr-only", headingProps.className), children: name })) : heading ? null : (name);
|
|
30
|
+
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsx("div", { className: "grid min-w-0 gap-3", children: _jsxs(Card, { className: cn("min-w-0", entries && entries.length > 0 && !footer && "pb-0"), render: _jsx("div", { "data-slot": "object-card" }), size: "sm", children: [_jsxs(CardHeader, { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-3", (facts !== undefined || figures !== undefined) && "border-b"), children: [heading ? (_jsxs("div", { className: "flex min-w-0 flex-1 basis-64 items-center", children: [title, _jsx(CardTitle, { className: "min-w-0 wrap-break-word", children: _jsx("h2", { children: heading }) })] })) : (_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center gap-4", actions?.menu && !actions.secondary && !actions.primary ? "basis-0" : "basis-64"), children: [_jsx(IdentityMark, { ...mark, size: 64 }), _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx(CardTitle, { className: "min-w-0 wrap-break-word group-data-[size=sm]/card:text-heading-sm", children: title }), description ? _jsx(CardDescription, { children: description }) : null] })] })), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), facts ? (_jsx(CardContent, { className: cn("@container/object-page-body grid min-w-0 gap-x-6 gap-y-5", picture && "py-(--card-spacing)"), children: _jsxs("div", { className: cn("grid min-w-0 gap-6", picture && "@3xl/object-page-body:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]"), children: [picture ? (_jsx("div", { className: "flex min-w-0 flex-col *:flex-1", "data-slot": "object-page-picture", children: picture })) : null, _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: cn("grid min-w-0 grid-flow-row-dense grid-cols-2 gap-x-6 gap-y-5", picture
|
|
31
|
+
? "@lg/object-page-facts:grid-cols-3"
|
|
32
|
+
: "@xl/object-page-facts:grid-cols-4"), "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: cn("grid min-w-0 content-start gap-1", fact.wide && "col-span-2"), children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: cn("min-w-0 text-body-sm wrap-break-word text-foreground", fact.icon && "flex items-start gap-2"), children: fact.icon ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "flex h-5 shrink-0 items-center text-muted-foreground [&>svg]:size-4", children: fact.icon }), _jsx("span", { className: "min-w-0", children: fact.url ? (_jsx(UrlValue, { href: fact.href, url: fact.value })) : (fact.value) })] })) : fact.url ? (_jsx(UrlValue, { href: fact.href, url: fact.value })) : (fact.value) })] }, fact.label))) }) })] }) })) : null, figures ? (_jsx("div", { className: cn("-mb-(--card-spacing) min-w-0 px-(--card-spacing)", facts ? "border-t" : "-mt-(--card-spacing)"), "data-slot": "object-page-figures", children: figures })) : null, entries && entries.length > 0 ? (_jsx("div", { className: "@container/object-page-entries min-w-0", "data-slot": "object-page-entries", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
|
|
33
|
+
.filter((entry) => entry.defaultOpen)
|
|
34
|
+
.map((entry) => entry.title), multiple: true, size: "small", children: entries.map((entry) => (_jsxs(AccordionItem, { value: entry.title, children: [_jsxs(AccordionTrigger, { className: "justify-start gap-3 px-(--card-spacing) group-data-[size=small]/accordion:text-body-sm focus-visible:-outline-offset-2 *:data-[slot=accordion-trigger-icon]:order-first *:data-[slot=accordion-trigger-icon]:text-muted-foreground", level: 2, children: [_jsx("span", { className: "min-w-0 flex-1", children: entry.title }, "title"), _jsx(Fragment, { children: entry.summary }, "summary"), entry.value ? (_jsx("span", { className: "flex min-w-0 items-center gap-2 text-body-sm font-normal text-muted-foreground", "data-slot": "object-page-entry-value", children: _jsx(TableValue, { ...entry.value }) }, "value")) : null] }), _jsx(AccordionContent, { className: "px-(--card-spacing) @md/object-page-entries:ps-[calc(var(--card-spacing)+1.75rem)]", children: entry.children })] }, entry.title))) }) })) : null, footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-page-hint", children: _jsx(PageCommandButton, { command: footer.link, variant: "outline" }) })) : null] }) }), children] }));
|
|
30
35
|
}
|
|
@@ -39,9 +39,9 @@ export type CardFooterLine = {
|
|
|
39
39
|
* A section of an object's page: a card that owns one decision about the object.
|
|
40
40
|
*
|
|
41
41
|
* @family Compositions
|
|
42
|
-
* @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, as
|
|
42
|
+
* @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, such as the Dashboard's setup guide; and a card among a person's settings that holds no setting, such as their nadicode card on Profile.
|
|
43
43
|
* @instead Values a person edits and saves together are a SettingsSection; a list of the object's records is a RecordList with its heading; a passing condition is a MessageNotice.
|
|
44
|
-
* @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision).
|
|
44
|
+
* @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision). The section is a resting card, its title and the one-sentence description directly under it, both always given; a `status` right after the title, as SettingsSection and TableCard place theirs ("Provisional"), makes the header one record's, as a Statement's cycle: the title at medium weight, and a lone `meta` in the caption's size that keeps the title's row on a narrow card (nadicode decision); at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that shows one record chosen from a list on the same page, such as an issued Statement opened from its history, takes `back`: the way to the list with nothing chosen, a quiet link with a leading arrow above the title, never a button among the `actions` (nadicode decision). A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save. While its page reads it, `ObjectSectionSkeleton` stands in its place: the same card, bars for the title and the description at their line heights, then `rows` lines of the body, with no words (nadicode decision).
|
|
45
45
|
* @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); `back` says where it leads ("Back to statements"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
|
|
46
46
|
* @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`; a `status` stands beside it, outside it. `back` is a real link before the title in reading order. `ObjectSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
47
47
|
*/
|
|
@@ -24,9 +24,9 @@ function BackLink({ label, link }) {
|
|
|
24
24
|
* A section of an object's page: a card that owns one decision about the object.
|
|
25
25
|
*
|
|
26
26
|
* @family Compositions
|
|
27
|
-
* @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, as
|
|
27
|
+
* @when A part of an ObjectPage a person reads or changes on its own: a customer's Company details, an Agent's Instructions, a Library entry's source, a Partner's services in Billing. Also a setup card on an overview, its body the `NumberedSteps` a person follows, such as the Dashboard's setup guide; and a card among a person's settings that holds no setting, such as their nadicode card on Profile.
|
|
28
28
|
* @instead Values a person edits and saves together are a SettingsSection; a list of the object's records is a RecordList with its heading; a passing condition is a MessageNotice.
|
|
29
|
-
* @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision).
|
|
29
|
+
* @behaviour `cardSize="sm"` draws the compact card, as `Card`'s `size`, for a section that stands beside fuller cards (nadicode decision). The section is a resting card, its title and the one-sentence description directly under it, both always given; a `status` right after the title, as SettingsSection and TableCard place theirs ("Provisional"), makes the header one record's, as a Statement's cycle: the title at medium weight, and a lone `meta` in the caption's size that keeps the title's row on a narrow card (nadicode decision); at the header's trailing edge `actions`, drawn as every card's header draws them (`CardActions`: the muted `meta`, then up to two secondaries as outline buttons, the primary as the filled one, then the three dots), so a way to another page is a secondary with its `link`, an outline button named for the page, never a text link; then its body; then the optional `footer`, a strip under a divider with its sentence at the start and its one command at the end as an outline button. No icon in the header. Neutral throughout. A section that shows one record chosen from a list on the same page, such as an issued Statement opened from its history, takes `back`: the way to the list with nothing chosen, a quiet link with a leading arrow above the title, never a button among the `actions` (nadicode decision). A section that edits in place swaps to the same section as a `SettingsSection`, with Cancel (`save.cancel`) before Save. While its page reads it, `ObjectSectionSkeleton` stands in its place: the same card, bars for the title and the description at their line heights, then `rows` lines of the body, with no words (nadicode decision).
|
|
30
30
|
* @words The title names what the section holds ("Company", "Instructions"); the description says in one sentence what it holds or lets a person change; a command is a verb on it ("Edit"), and a way to another page is that page's name ("Statements"); `meta` is a short count or time ("2 of 5 Agents"); `back` says where it leads ("Back to statements"); the footer's sentence is a limit or where the section's object changes ("At most three cards.").
|
|
31
31
|
* @access The title is a heading one level under the page (h2), deeper only under another heading through `headingLevel`; a `status` stands beside it, outside it. `back` is a real link before the title in reading order. `ObjectSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
32
32
|
*/
|
|
@@ -16,7 +16,7 @@ export type OverviewPageProps = OverviewTitle & {
|
|
|
16
16
|
/** On the title row, through PageActions. */
|
|
17
17
|
period?: ReactElement;
|
|
18
18
|
/** The figures, one row of equal cards, one column below md. */
|
|
19
|
-
figures?: readonly
|
|
19
|
+
figures?: readonly KpiFigure[];
|
|
20
20
|
/**
|
|
21
21
|
* When nothing has happened yet: one line drawn in place of the figures and charts, such as "No
|
|
22
22
|
* commission yet this month." Given only when every figure would read zero.
|
|
@@ -27,6 +27,11 @@ export type OverviewPageProps = OverviewTitle & {
|
|
|
27
27
|
/** The exceptions that need a person, each opening its owner: a RecordList with its heading. */
|
|
28
28
|
exceptions?: ReactNode;
|
|
29
29
|
};
|
|
30
|
+
/** A figure's card props without its presentation, kept apart per kind, a bar or a sparkline. */
|
|
31
|
+
type WithoutPresentation<Props> = Props extends unknown ? Omit<Props, "presentation"> : never;
|
|
32
|
+
/** One figure of an overview: a `KpiCard`'s props without its presentation, with a bar or a sparkline. */
|
|
33
|
+
export type OverviewFigure = WithoutPresentation<KpiCardProps>;
|
|
34
|
+
type KpiFigure = OverviewFigure;
|
|
30
35
|
/**
|
|
31
36
|
* The page that answers "what needs attention?": is anything wrong, and where.
|
|
32
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview-page.d.ts","sourceRoot":"","sources":["../../src/components/overview-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,KAAK,aAAa,GACd;IACE,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,mGAAmG;IACnG,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"overview-page.d.ts","sourceRoot":"","sources":["../../src/components/overview-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,KAAK,aAAa,GACd;IACE,qFAAqF;IACrF,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,mGAAmG;IACnG,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gEAAgE;IAChE,OAAO,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC/B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gGAAgG;IAChG,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB,CAAC;AASF,iGAAiG;AACjG,KAAK,mBAAmB,CAAC,KAAK,IAAI,KAAK,SAAS,OAAO,GAAG,IAAI,CAAC,KAAK,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC;AAC9F,0GAA0G;AAC1G,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;AAC/D,KAAK,SAAS,GAAG,cAAc,CAAC;AAIhC;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,MAAM,EACN,OAAoB,EACpB,UAAU,EACV,MAAM,EACN,UAAU,EACV,MAAM,GACP,EAAE,iBAAiB,+BA0BnB"}
|