@nadicodeai/ui 12.1.211 → 12.1.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/collection-toolbar.d.ts +5 -4
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +9 -5
- package/dist/components/data-table.d.ts +1 -1
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +42 -3
- package/dist/components/filter-toolbar.d.ts +1 -1
- package/dist/components/filter-toolbar.js +1 -1
- package/dist/components/invite-card.js +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kpi-card.d.ts +1 -1
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +2 -2
- package/dist/components/object-page.d.ts +8 -2
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +7 -2
- package/dist/components/page-header.d.ts +4 -3
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +5 -4
- package/dist/components/pending-label.d.ts +1 -1
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +4 -6
- package/dist/components/product-shell.d.ts +3 -1
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +75 -7
- package/dist/components/settings-section.d.ts +1 -1
- package/dist/components/settings-section.js +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/table-layouts.d.ts +27 -0
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +30 -0
- package/dist/components/update-card.js +1 -1
- package/dist/internal/table-compact-line.d.ts +1 -7
- package/dist/internal/table-compact-line.d.ts.map +1 -1
- package/dist/internal/table-compact-line.js +5 -11
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +11 -11
- package/dist/styles/components.css +26 -0
- package/dist/styles/globals.css +0 -5
- package/package.json +2 -2
|
@@ -21,10 +21,11 @@ export type CollectionToolbarProps = Omit<ComponentPropsWithoutRef<"div">, "chil
|
|
|
21
21
|
* the product is `CommandDialog`.
|
|
22
22
|
* @behaviour Glass, the resting surface at 72% with its own edge, held at the top of the scrolling content while the rows
|
|
23
23
|
* pass under it; inside a titled `TableCard`, on the title's row at its trailing edge, or with `surface="plain"`, the plain row. A search
|
|
24
|
-
* alone is always the plain row.
|
|
25
|
-
* the
|
|
26
|
-
*
|
|
27
|
-
* the
|
|
24
|
+
* alone is always the plain row. Beside `controls`, the search and the actions keep one line: where
|
|
25
|
+
* the controls leave them too little room, the two move under the controls together, so the sort
|
|
26
|
+
* never stands alone on a line. Below 640 px the search takes the first line, and the controls and
|
|
27
|
+
* then the actions follow it, wrapping onto more lines rather than cutting a control or hiding one
|
|
28
|
+
* behind another; the actions keep the trailing edge.
|
|
28
29
|
* @words The label names the collection's tools: *Customer filters*.
|
|
29
30
|
* @access `role="toolbar"` named by `label`.
|
|
30
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-toolbar.d.ts","sourceRoot":"","sources":["../../src/components/collection-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"collection-toolbar.d.ts","sourceRoot":"","sources":["../../src/components/collection-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjE,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,wBAAwB,CAAC,KAAK,CAAC,EAC/B,UAAU,GAAG,WAAW,CACzB,GAAG;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;CAC7B,CAAC;AAeF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAiB,EACjB,GAAG,KAAK,EACT,EAAE,sBAAsB,+BAsDxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
2
3
|
/*
|
|
3
4
|
* A page's collection toolbar is a control bar over its own rows: glass with its own
|
|
4
5
|
* edge, held at the top of the scrolling content while the rows pass
|
|
@@ -19,10 +20,11 @@ const IN_CARD = "[[data-slot=table-card-toolbar]_&]:relative [[data-slot=table-c
|
|
|
19
20
|
* the product is `CommandDialog`.
|
|
20
21
|
* @behaviour Glass, the resting surface at 72% with its own edge, held at the top of the scrolling content while the rows
|
|
21
22
|
* pass under it; inside a titled `TableCard`, on the title's row at its trailing edge, or with `surface="plain"`, the plain row. A search
|
|
22
|
-
* alone is always the plain row.
|
|
23
|
-
* the
|
|
24
|
-
*
|
|
25
|
-
* the
|
|
23
|
+
* alone is always the plain row. Beside `controls`, the search and the actions keep one line: where
|
|
24
|
+
* the controls leave them too little room, the two move under the controls together, so the sort
|
|
25
|
+
* never stands alone on a line. Below 640 px the search takes the first line, and the controls and
|
|
26
|
+
* then the actions follow it, wrapping onto more lines rather than cutting a control or hiding one
|
|
27
|
+
* behind another; the actions keep the trailing edge.
|
|
26
28
|
* @words The label names the collection's tools: *Customer filters*.
|
|
27
29
|
* @access `role="toolbar"` named by `label`.
|
|
28
30
|
*/
|
|
@@ -30,5 +32,7 @@ export function CollectionToolbar({ label, controls, search, actions, status, su
|
|
|
30
32
|
// A search alone is the plain row, as the usage page above says: a search box
|
|
31
33
|
// never stands in a box of its own.
|
|
32
34
|
const drawn = surface === "glass" && (controls || actions) ? "glass" : "plain";
|
|
33
|
-
return (_jsxs("div", { "data-slot": "collection-toolbar", ...props, role: "toolbar", "aria-label": label, "data-surface": drawn, className: `flex min-w-0 flex-wrap items-center gap-2 ${drawn === "glass" ? ON_PAGE : PLAIN} ${IN_CARD}`, children: [controls ? (_jsx("div", { "data-slot": "collection-toolbar-controls", className: "flex min-w-0 max-w-full flex-wrap items-center gap-2 max-sm:
|
|
35
|
+
return (_jsxs("div", { "data-slot": "collection-toolbar", ...props, role: "toolbar", "aria-label": label, "data-surface": drawn, className: `flex min-w-0 flex-wrap items-center gap-2 ${drawn === "glass" ? ON_PAGE : PLAIN} ${IN_CARD}`, children: [controls ? (_jsx("div", { "data-slot": "collection-toolbar-controls", className: "flex min-w-0 max-w-full flex-wrap items-center gap-2 max-sm:contents", children: controls })) : null, search || actions ? (_jsxs("div", { "data-slot": "collection-toolbar-end", className: controls
|
|
36
|
+
? cn("flex min-w-0 items-center gap-2 max-sm:contents", search ? (actions ? "flex-1 basis-80" : "flex-1 basis-64") : "ml-auto")
|
|
37
|
+
: "contents", children: [search ? (_jsx("div", { "data-slot": "collection-toolbar-search", className: "min-w-0 flex-1 basis-64 max-sm:-order-1 max-sm:basis-full", children: search })) : null, actions ? (_jsx("div", { "data-slot": "collection-toolbar-actions", className: "ml-auto flex min-w-0 max-w-full shrink-0 flex-wrap items-center gap-2", children: actions })) : null] })) : null, status ? _jsx("div", { className: "absolute right-0 bottom-0", children: status }) : null] }));
|
|
34
38
|
}
|
|
@@ -228,7 +228,7 @@ export declare function columnMenuLabel<TData extends RowData, TValue extends Ce
|
|
|
228
228
|
* @instead “For a row of descriptive content paired with a single action (membership row, integration row), use `Entity` instead.” (https://vercel.com/geist/table)
|
|
229
229
|
* “For a key/value metadata block on a detail page, use `Description`, not a two-column table.” (https://vercel.com/geist/table)
|
|
230
230
|
* Ours: Geist's `Entity` is a `RecordList` row. A registry of entities whose columns `RecordList` cannot hold, more than three facts beside a filter bar the product owns, as Vercel's Deployments list, is this table with `rows="entities"`, which draws the same rows: headings for assistive technology only, 72 px rows, a `RecordIdentity` in the identity column. Its `Description` is `ObjectFacts`. A list on a page of its own is a `CollectionPage`. A descriptive list is `ItemGroup`.
|
|
231
|
-
* @behaviour Every column has a `header`; a column without one does not compile. The headings are always visible, medium weight in the cells' body grey, 48 px high, with 12 px of room under the labels and then the rule, so the first row starts at the rule like every other; rows are 40 px. Each column is as wide as its definition's `size`, in pixels, and the columns without one share the rest, so a table gives a size to every column but the one that takes the spare width; a value too long for its column ends in an ellipsis, whole in its title (a record's name carries its own), unless the column `wraps`; a column marked `identifier` holds ids or paths and is cut in the middle instead. The last column trails unless it `wraps` or is `centered
|
|
231
|
+
* @behaviour Every column has a `header`; a column without one does not compile. The headings are always visible, medium weight in the cells' body grey, 48 px high, with 12 px of room under the labels and then the rule, so the first row starts at the rule like every other; rows are 40 px. Each column is as wide as its definition's `size`, in pixels, and the columns without one share the rest, so a table gives a size to every column but the one that takes the spare width; a value too long for its column ends in an ellipsis, whole in its title (a record's name carries its own), unless the column `wraps`; a column marked `identifier` holds ids or paths and is cut in the middle instead. The last column trails unless it `wraps` or is `centered`, and on a card too narrow for the columns the last one the row keeps is its last column; a `centered` column's heading and values sit in the middle of it. Records are divided by a 1 px rule, none after the last. The first and last columns stand in from the card's edges by the card's spacing, so the first lines up with the title. Records of several kinds stand in one table under `group` headings (Vercel's Usage page: *Delivery network*, *Functions*): a heading row that spans the columns, in ink, medium text, 36 px high with the same rule under it, one per group in the order the groups first appear, never a second table; a heading is the group's name and carries no figure of its own. A row that opens a record takes `accent` on hover, and any row on focus within and while its menu is open; a row that opens nothing never reacts to hover. A selected row takes `muted`; headers and footers never highlight and carry no fill. A row never scrolls sideways and never gives a column without a size less than 160 px: on a card narrower than its columns (the sized ones and 160 px for each without a size, however wide that is; columns no card holds lay out this way on every card) the row keeps its name and its `primaryColumns`, and every other column leaves it, its value joining the one muted line under the name, joined by a middle dot (a `Tag` reads as its text there); entity facts wrap below the name so every value stays readable, while other rows end in an ellipsis unless a column `wraps`, or `dropped` when its `compact` says so, or beside an entity row's name, which ends in an ellipsis before it, when it says `name`, as Vercel's lists read on a phone: no labels, no second line; an `optional` column's empty value is left out of the line. A table whose every column is in `primaryColumns`, a settings matrix, lays out by its content there instead, so the name wraps beside the columns. A document's table, such as a legal page's, is read whole instead: its columns take the `wraps` option, so their words wrap and the row grows, and it keeps its header row; in the compact layout every cell but the identity wraps between words. A bounded page's paging stands in the card's footer strip at its trailing edge, opposite `footer`, which stands at the leading edge: its `status` ("Page 2 of 7") before Previous and Next, which are the product's router links (`previousLink`, `nextLink`) when each page is its own address, and buttons otherwise; the one that leads nowhere stays, disabled. A note about the whole table is `footerNote`, in a strip of its own under that one: one muted line, an optional *Learn more* after it at the left and one secondary action at the right (Vercel's deployments list ends "Deployment retention is enabled. Learn more" with *View recently deleted*); it is the one place a table says a sentence. Colour is neutral: headings and cells in the body grey, no hue, except a status badge or a tone the cell itself carries.
|
|
232
232
|
* “When the underlying list is empty (filter cleared, never created), render `Empty State` outside the table rather than an empty `<Table.Body>`.” (https://vercel.com/geist/table)
|
|
233
233
|
* “After an async filter change, wrap the region in `aria-live="polite"` so screen readers announce the new state.” (https://vercel.com/geist/empty-state)
|
|
234
234
|
* Ours: empty sits outside the body, in a polite live region that stays in place so a filter that empties the table is announced.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/components/data-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EAGnB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,WAAW,EAIX,KA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AAE,gBAAgB,CAAC,KAAK,CAAC,qBAEhF"}
|
|
@@ -83,6 +83,9 @@ function primaryRowLinkProps({ href, label, wraps, content, }) {
|
|
|
83
83
|
const COMPACT_IDENTITY_CLASS = {
|
|
84
84
|
tight: "@max-xl/table:w-full @max-xl/table:max-w-0",
|
|
85
85
|
standard: "@max-3xl/table:w-full @max-3xl/table:max-w-0",
|
|
86
|
+
ample: "@max-[52rem]/table:w-full @max-[52rem]/table:max-w-0",
|
|
87
|
+
large: "@max-4xl/table:w-full @max-4xl/table:max-w-0",
|
|
88
|
+
generous: "@max-[60rem]/table:w-full @max-[60rem]/table:max-w-0",
|
|
86
89
|
wide: "@max-5xl/table:w-full @max-5xl/table:max-w-0",
|
|
87
90
|
roomy: "@max-[68rem]/table:w-full @max-[68rem]/table:max-w-0",
|
|
88
91
|
spacious: "@max-6xl/table:w-full @max-6xl/table:max-w-0",
|
|
@@ -90,6 +93,39 @@ const COMPACT_IDENTITY_CLASS = {
|
|
|
90
93
|
vast: "@max-[96rem]/table:w-full @max-[96rem]/table:max-w-0",
|
|
91
94
|
always: "w-full max-w-0",
|
|
92
95
|
};
|
|
96
|
+
const COMPACT_TRAILING_SPACING = {
|
|
97
|
+
tight: "@max-xl/table:pr-(--card-spacing)",
|
|
98
|
+
standard: "@max-3xl/table:pr-(--card-spacing)",
|
|
99
|
+
ample: "@max-[52rem]/table:pr-(--card-spacing)",
|
|
100
|
+
large: "@max-4xl/table:pr-(--card-spacing)",
|
|
101
|
+
generous: "@max-[60rem]/table:pr-(--card-spacing)",
|
|
102
|
+
wide: "@max-5xl/table:pr-(--card-spacing)",
|
|
103
|
+
roomy: "@max-[68rem]/table:pr-(--card-spacing)",
|
|
104
|
+
spacious: "@max-6xl/table:pr-(--card-spacing)",
|
|
105
|
+
broad: "@max-7xl/table:pr-(--card-spacing)",
|
|
106
|
+
vast: "@max-[96rem]/table:pr-(--card-spacing)",
|
|
107
|
+
always: "pr-(--card-spacing)",
|
|
108
|
+
};
|
|
109
|
+
const COMPACT_TRAILING_ALIGN = {
|
|
110
|
+
tight: "@max-xl/table:text-right",
|
|
111
|
+
standard: "@max-3xl/table:text-right",
|
|
112
|
+
ample: "@max-[52rem]/table:text-right",
|
|
113
|
+
large: "@max-4xl/table:text-right",
|
|
114
|
+
generous: "@max-[60rem]/table:text-right",
|
|
115
|
+
wide: "@max-5xl/table:text-right",
|
|
116
|
+
roomy: "@max-[68rem]/table:text-right",
|
|
117
|
+
spacious: "@max-6xl/table:text-right",
|
|
118
|
+
broad: "@max-7xl/table:text-right",
|
|
119
|
+
vast: "@max-[96rem]/table:text-right",
|
|
120
|
+
always: "text-right",
|
|
121
|
+
};
|
|
122
|
+
function compactTrailingClass(column, trailingColumnId, identityColumnId, compactLayout) {
|
|
123
|
+
if (!compactLayout || column.id !== trailingColumnId)
|
|
124
|
+
return false;
|
|
125
|
+
const meta = column.columnDef.meta;
|
|
126
|
+
const trails = meta?.wraps !== true && meta?.centered !== true && column.id !== identityColumnId;
|
|
127
|
+
return cn(COMPACT_TRAILING_SPACING[compactLayout], trails && COMPACT_TRAILING_ALIGN[compactLayout]);
|
|
128
|
+
}
|
|
93
129
|
function identityWidthClass(column, identityColumnId, compactLayout) {
|
|
94
130
|
return column.id === identityColumnId && compactLayout
|
|
95
131
|
? COMPACT_IDENTITY_CLASS[compactLayout]
|
|
@@ -199,7 +235,7 @@ function GroupHeading({ children, span }) {
|
|
|
199
235
|
* @instead “For a row of descriptive content paired with a single action (membership row, integration row), use `Entity` instead.” (https://vercel.com/geist/table)
|
|
200
236
|
* “For a key/value metadata block on a detail page, use `Description`, not a two-column table.” (https://vercel.com/geist/table)
|
|
201
237
|
* Ours: Geist's `Entity` is a `RecordList` row. A registry of entities whose columns `RecordList` cannot hold, more than three facts beside a filter bar the product owns, as Vercel's Deployments list, is this table with `rows="entities"`, which draws the same rows: headings for assistive technology only, 72 px rows, a `RecordIdentity` in the identity column. Its `Description` is `ObjectFacts`. A list on a page of its own is a `CollectionPage`. A descriptive list is `ItemGroup`.
|
|
202
|
-
* @behaviour Every column has a `header`; a column without one does not compile. The headings are always visible, medium weight in the cells' body grey, 48 px high, with 12 px of room under the labels and then the rule, so the first row starts at the rule like every other; rows are 40 px. Each column is as wide as its definition's `size`, in pixels, and the columns without one share the rest, so a table gives a size to every column but the one that takes the spare width; a value too long for its column ends in an ellipsis, whole in its title (a record's name carries its own), unless the column `wraps`; a column marked `identifier` holds ids or paths and is cut in the middle instead. The last column trails unless it `wraps` or is `centered
|
|
238
|
+
* @behaviour Every column has a `header`; a column without one does not compile. The headings are always visible, medium weight in the cells' body grey, 48 px high, with 12 px of room under the labels and then the rule, so the first row starts at the rule like every other; rows are 40 px. Each column is as wide as its definition's `size`, in pixels, and the columns without one share the rest, so a table gives a size to every column but the one that takes the spare width; a value too long for its column ends in an ellipsis, whole in its title (a record's name carries its own), unless the column `wraps`; a column marked `identifier` holds ids or paths and is cut in the middle instead. The last column trails unless it `wraps` or is `centered`, and on a card too narrow for the columns the last one the row keeps is its last column; a `centered` column's heading and values sit in the middle of it. Records are divided by a 1 px rule, none after the last. The first and last columns stand in from the card's edges by the card's spacing, so the first lines up with the title. Records of several kinds stand in one table under `group` headings (Vercel's Usage page: *Delivery network*, *Functions*): a heading row that spans the columns, in ink, medium text, 36 px high with the same rule under it, one per group in the order the groups first appear, never a second table; a heading is the group's name and carries no figure of its own. A row that opens a record takes `accent` on hover, and any row on focus within and while its menu is open; a row that opens nothing never reacts to hover. A selected row takes `muted`; headers and footers never highlight and carry no fill. A row never scrolls sideways and never gives a column without a size less than 160 px: on a card narrower than its columns (the sized ones and 160 px for each without a size, however wide that is; columns no card holds lay out this way on every card) the row keeps its name and its `primaryColumns`, and every other column leaves it, its value joining the one muted line under the name, joined by a middle dot (a `Tag` reads as its text there); entity facts wrap below the name so every value stays readable, while other rows end in an ellipsis unless a column `wraps`, or `dropped` when its `compact` says so, or beside an entity row's name, which ends in an ellipsis before it, when it says `name`, as Vercel's lists read on a phone: no labels, no second line; an `optional` column's empty value is left out of the line. A table whose every column is in `primaryColumns`, a settings matrix, lays out by its content there instead, so the name wraps beside the columns. A document's table, such as a legal page's, is read whole instead: its columns take the `wraps` option, so their words wrap and the row grows, and it keeps its header row; in the compact layout every cell but the identity wraps between words. A bounded page's paging stands in the card's footer strip at its trailing edge, opposite `footer`, which stands at the leading edge: its `status` ("Page 2 of 7") before Previous and Next, which are the product's router links (`previousLink`, `nextLink`) when each page is its own address, and buttons otherwise; the one that leads nowhere stays, disabled. A note about the whole table is `footerNote`, in a strip of its own under that one: one muted line, an optional *Learn more* after it at the left and one secondary action at the right (Vercel's deployments list ends "Deployment retention is enabled. Learn more" with *View recently deleted*); it is the one place a table says a sentence. Colour is neutral: headings and cells in the body grey, no hue, except a status badge or a tone the cell itself carries.
|
|
203
239
|
* “When the underlying list is empty (filter cleared, never created), render `Empty State` outside the table rather than an empty `<Table.Body>`.” (https://vercel.com/geist/table)
|
|
204
240
|
* “After an async filter change, wrap the region in `aria-live="polite"` so screen readers announce the new state.” (https://vercel.com/geist/empty-state)
|
|
205
241
|
* Ours: empty sits outside the body, in a polite live region that stays in place so a filter that empties the table is announced.
|
|
@@ -279,6 +315,9 @@ function RecordsTable({ kind, columns, data, getRowId, filterColumnId, filterPla
|
|
|
279
315
|
// A table whose every column stays lays out by its content on a narrow card, so the name wraps
|
|
280
316
|
// beside the columns instead of collapsing between them.
|
|
281
317
|
const tableLayout = compactLayout ?? neededLayout;
|
|
318
|
+
const visibleColumns = table.getVisibleLeafColumns();
|
|
319
|
+
const lastKept = visibleColumns.filter((column) => primaryColumns.includes(column.id)).at(-1);
|
|
320
|
+
const trailingColumnId = lastKept === visibleColumns.at(-1) ? undefined : lastKept?.id;
|
|
282
321
|
const [shownLayout, layoutProbeRef] = useShownLayout();
|
|
283
322
|
const canPreviousPage = pagination ? pagination.hasPrevious : table.getCanPreviousPage();
|
|
284
323
|
const canNextPage = pagination ? pagination.hasNext : table.getCanNextPage();
|
|
@@ -346,7 +385,7 @@ function RecordsTable({ kind, columns, data, getRowId, filterColumnId, filterPla
|
|
|
346
385
|
const centered = cell.column.columnDef.meta?.centered === true;
|
|
347
386
|
const cutByEllipsis = !wraps && !isPrimaryLink;
|
|
348
387
|
const holdsCompactLine = compactLine !== undefined && cell.column.id === identityColumnId;
|
|
349
|
-
const className = cn(numeric && "text-right tabular-nums wrap-normal", wraps && "whitespace-normal last:text-left", centered && "text-center last:text-center", cutByEllipsis && "overflow-hidden text-ellipsis", identityWidthClass(cell.column, identityColumnId, tableLayout), collapsed);
|
|
388
|
+
const className = cn(numeric && "text-right tabular-nums wrap-normal", wraps && "whitespace-normal last:text-left", centered && "text-center last:text-center", cutByEllipsis && "overflow-hidden text-ellipsis", identityWidthClass(cell.column, identityColumnId, tableLayout), compactTrailingClass(cell.column, trailingColumnId, identityColumnId, compactLayout), collapsed);
|
|
350
389
|
const drawnOnlyInDetailRow = Boolean(collapsed) && shownLayout === "details" && !isPrimaryLink;
|
|
351
390
|
if (drawnOnlyInDetailRow) {
|
|
352
391
|
return _jsx(TableCell, { className: className }, cell.id);
|
|
@@ -372,7 +411,7 @@ function RecordsTable({ kind, columns, data, getRowId, filterColumnId, filterPla
|
|
|
372
411
|
const size = sizeOf.get(column.id);
|
|
373
412
|
return (_jsx(TableCol, { className: cn(collapseTrackClass(column, primaryColumns, compactLayout)), style: size === undefined ? undefined : { width: size } }, column.id));
|
|
374
413
|
}) }), _jsx(TableHeader, { className: entities ? "sr-only" : undefined, children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => (_jsx(TableHead, { "aria-sort": sortOrder(header.column.getIsSorted()), "data-identity": header.column.id === identityColumnId ? "" : undefined, className: cn(isNumericColumn(header.column) && "text-right tabular-nums", header.column.columnDef.meta?.wraps === true && "last:text-left", header.column.columnDef.meta?.centered === true &&
|
|
375
|
-
"text-center last:text-center", identityWidthClass(header.column, identityColumnId, tableLayout), collapseClass(header.column, primaryColumns, compactLayout)), children: header.isPlaceholder
|
|
414
|
+
"text-center last:text-center", identityWidthClass(header.column, identityColumnId, tableLayout), compactTrailingClass(header.column, trailingColumnId, identityColumnId, compactLayout), collapseClass(header.column, primaryColumns, compactLayout)), children: header.isPlaceholder
|
|
376
415
|
? null
|
|
377
416
|
: flexRender(header.column.columnDef.header, header.getContext()) }, header.id))) }, headerGroup.id))) }), _jsx(LayoutProbeLeadingRecords, { layout: tableLayout, probeRef: layoutProbeRef, children: sections.map((section) => (_jsxs(React.Fragment, { children: [section.heading === undefined ? null : (_jsx(GroupHeading, { span: table.getVisibleLeafColumns().length, children: section.heading })), section.rows.map(renderRow)] }, section.heading ?? ""))) })] }) }))] }));
|
|
378
417
|
const actions = columnsControl || toolbarActions ? (_jsxs(_Fragment, { children: [columnsControl, toolbarActions] })) : null;
|
|
@@ -33,7 +33,7 @@ export declare function filterToolbarHolds({ search, filters, sort, actions, }:
|
|
|
33
33
|
* @family Compositions
|
|
34
34
|
* @when The toolbar over a collection's rows: the one `CollectionPage` draws from its `search`, `filters` and `sort`, and the one `DataTable` draws from its `toolbar` for a registry the product keeps in the URL (Customers, Statements, an Agent's usage). On its own, only over a region the server answers from the same question, which no list composition draws, such as an analysis whose search and metric live in the URL.
|
|
35
35
|
* @instead A list of records gives `CollectionPage`, and a comparison `DataTable`, its search, filters and sort, and they place this toolbar; a page never draws it beside them. The bar's own layout is `CollectionToolbar`, which a page never draws. Finding across the product is `CommandDialog`. A page's commands are `PageActions` on the title's row.
|
|
36
|
-
* @behaviour A comparison's bar (`lead="filters"`, as `DataTable` draws it) leads with its filters and Clear filters, then the search; otherwise the search comes first (nadicode decision). The search first, growing to fill the row, then the filters, then Clear filters while the search or a filter is set, then the sort, then the collection's own `actions`, in the reading and the Tab order alike; below 640 px the search takes the first line and the rest
|
|
36
|
+
* @behaviour A comparison's bar (`lead="filters"`, as `DataTable` draws it) leads with its filters and Clear filters, then the search; otherwise the search comes first (nadicode decision). The search first, growing to fill the row, then the filters, then Clear filters while the search or a filter is set, then the sort, then the collection's own `actions`, in the reading and the Tab order alike; below 640 px the search takes the first line and the rest follow under it, wrapping onto more lines rather than cutting one (`CollectionToolbar`). The search is disabled until the page is interactive, so a word typed before then is never lost. While `pending`, the toolbar is busy and, after a second, shows the one waiting line, while the rows already shown stay; it never shows a label of its own. A toolbar with nothing to hold draws nothing. While a page reads the collection, `FilterToolbarSkeleton` holds the bar's place: a search's bar and a control's, at their heights (nadicode decision).
|
|
37
37
|
* @words The label names the collection's tools: *Customer filters*. Clear filters is the product's word.
|
|
38
38
|
* @access `role="toolbar"` named by `label`, `aria-busy` while `pending`; the waiting line is decorative. The skeleton carries no words, is busy, and is hidden from assistive technology.
|
|
39
39
|
*/
|
|
@@ -24,7 +24,7 @@ export function filterToolbarHolds({ search, filters, sort, actions, }) {
|
|
|
24
24
|
* @family Compositions
|
|
25
25
|
* @when The toolbar over a collection's rows: the one `CollectionPage` draws from its `search`, `filters` and `sort`, and the one `DataTable` draws from its `toolbar` for a registry the product keeps in the URL (Customers, Statements, an Agent's usage). On its own, only over a region the server answers from the same question, which no list composition draws, such as an analysis whose search and metric live in the URL.
|
|
26
26
|
* @instead A list of records gives `CollectionPage`, and a comparison `DataTable`, its search, filters and sort, and they place this toolbar; a page never draws it beside them. The bar's own layout is `CollectionToolbar`, which a page never draws. Finding across the product is `CommandDialog`. A page's commands are `PageActions` on the title's row.
|
|
27
|
-
* @behaviour A comparison's bar (`lead="filters"`, as `DataTable` draws it) leads with its filters and Clear filters, then the search; otherwise the search comes first (nadicode decision). The search first, growing to fill the row, then the filters, then Clear filters while the search or a filter is set, then the sort, then the collection's own `actions`, in the reading and the Tab order alike; below 640 px the search takes the first line and the rest
|
|
27
|
+
* @behaviour A comparison's bar (`lead="filters"`, as `DataTable` draws it) leads with its filters and Clear filters, then the search; otherwise the search comes first (nadicode decision). The search first, growing to fill the row, then the filters, then Clear filters while the search or a filter is set, then the sort, then the collection's own `actions`, in the reading and the Tab order alike; below 640 px the search takes the first line and the rest follow under it, wrapping onto more lines rather than cutting one (`CollectionToolbar`). The search is disabled until the page is interactive, so a word typed before then is never lost. While `pending`, the toolbar is busy and, after a second, shows the one waiting line, while the rows already shown stay; it never shows a label of its own. A toolbar with nothing to hold draws nothing. While a page reads the collection, `FilterToolbarSkeleton` holds the bar's place: a search's bar and a control's, at their heights (nadicode decision).
|
|
28
28
|
* @words The label names the collection's tools: *Customer filters*. Clear filters is the product's word.
|
|
29
29
|
* @access `role="toolbar"` named by `label`, `aria-busy` while `pending`; the waiting line is decorative. The skeleton carries no words, is busy, and is hidden from assistive technology.
|
|
30
30
|
*/
|
|
@@ -20,6 +20,6 @@ const QR_PX = 160;
|
|
|
20
20
|
* @access The title is the page's level-1 heading and the installers a list under its own heading. The mark is decorative; the code is an image named by what it opens.
|
|
21
21
|
*/
|
|
22
22
|
function InviteCard({ mark, title, description, open, install, phone, }) {
|
|
23
|
-
return (_jsx(Card, { "data-slot": "invite-card", children: _jsxs(CardContent, { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [_jsx("img", { alt: "", "aria-hidden": "true", className: "h-10 w-auto", src: mark }), _jsx("h1", { className: "nc-type-heading-sm m-0", children: title }), _jsx("p", { className: "nc-type-body-md m-0 text-muted-foreground", children: description })] }), open ? (_jsx(ButtonLink, { className: "w-full", href: open.href, size: "lg", children: open.label })) : null, phone ? (_jsxs("div", { className: "hidden items-center gap-5 rounded-md border border-border p-4 lg:flex", children: [_jsx(QrCode, { className: "shrink-0", label: phone.label, size: QR_PX, value: phone.link }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("span", { className: "nc-type-body-md font-medium", children: phone.label }), _jsx("span", { className: "nc-type-body-sm text-muted-foreground", children: phone.how })] })] })) : null, install && install.installers.length > 0 ? (_jsxs("section", { "aria-labelledby": "invite-card-install", className: "hidden flex-col gap-2 md:flex", children: [_jsx("h2", { className: "nc-type-body-sm m-0 text-muted-foreground", id: "invite-card-install", children: install.label }), _jsx(ItemGroup, { className: "rounded-md border border-border", divided: true, render: _jsx("ul", {}), children: install.installers.map((installer) => (_jsxs(Item, { render: _jsx("li", {}), children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PlatformMark, { platform: installer.platform, size: 20 }) }), _jsxs(ItemContent, { children: [_jsxs(ItemTitle, { children: [installer.name, installer.suggested ? (_jsx(Badge, { size: "sm", variant: "outline", children: install.suggested })) : null] }), installer.size ? _jsx(ItemDescription, { children: installer.size }) : null] }), _jsx(ItemActions, { children: _jsxs(ButtonLink, { "aria-label": `${install.download} ${installer.name}`, href: installer.href, size: "sm", variant: "secondary", children: [_jsx(Download, { "aria-hidden": "true" }), install.download] }) })] }, installer.platform))) })] })) : null] }) }));
|
|
23
|
+
return (_jsx(Card, { "data-slot": "invite-card", children: _jsxs(CardContent, { className: "flex flex-col gap-6", children: [_jsxs("div", { className: "flex flex-col items-center gap-3 text-center", children: [_jsx("img", { alt: "", "aria-hidden": "true", className: "h-10 w-auto", src: mark }), _jsx("h1", { className: "nc-type-heading-sm m-0", children: title }), _jsx("p", { className: "nc-type-body-md m-0 text-muted-foreground", children: description })] }), open ? (_jsx(ButtonLink, { className: "w-full", href: open.href, size: "lg", children: open.label })) : null, phone ? (_jsxs("div", { className: "hidden items-center gap-5 rounded-md border border-border p-4 lg:flex", children: [_jsx(QrCode, { className: "shrink-0", label: phone.label, size: QR_PX, value: phone.link }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("span", { className: "nc-type-body-md font-medium", children: phone.label }), _jsx("span", { className: "nc-type-body-sm text-muted-foreground", children: phone.how })] })] })) : null, install && install.installers.length > 0 ? (_jsxs("section", { "aria-labelledby": "invite-card-install", className: "hidden flex-col gap-2 md:flex", children: [_jsx("h2", { className: "nc-type-body-sm m-0 text-muted-foreground", id: "invite-card-install", children: install.label }), _jsx(ItemGroup, { className: "rounded-md border border-border px-4", divided: true, render: _jsx("ul", {}), children: install.installers.map((installer) => (_jsxs(Item, { render: _jsx("li", {}), children: [_jsx(ItemMedia, { variant: "icon", children: _jsx(PlatformMark, { platform: installer.platform, size: 20 }) }), _jsxs(ItemContent, { children: [_jsxs(ItemTitle, { children: [installer.name, installer.suggested ? (_jsx(Badge, { size: "sm", variant: "outline", children: install.suggested })) : null] }), installer.size ? _jsx(ItemDescription, { children: installer.size }) : null] }), _jsx(ItemActions, { children: _jsxs(ButtonLink, { "aria-label": `${install.download} ${installer.name}`, href: installer.href, size: "sm", variant: "secondary", children: [_jsx(Download, { "aria-hidden": "true" }), install.download] }) })] }, installer.platform))) })] })) : null] }) }));
|
|
24
24
|
}
|
|
25
25
|
export { InviteCard };
|
|
@@ -27,7 +27,7 @@ declare const itemVariants: (props?: ({
|
|
|
27
27
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
28
28
|
* “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
|
|
29
29
|
* Ours: Geist's `Table` is a `DataTable` and its `Description` is `ObjectFacts`. An object a person opens, with a mark, facts and a status, is a `RecordList` row; the same row edited in place is a `RecordList` with an `editor`. A page whose job is one collection is `CollectionPage`. Agents in a gallery are `AgentListRow`; Library entries `CatalogEntry`.
|
|
30
|
-
* @behaviour A list of descriptive rows is an `ItemGroup` of `Item`s, never table semantics. A row too narrow for its title beside its actions puts the actions under the title, so a name never squeezes to a few letters a line; `min-w-0` on `ItemContent` turns that off, for a row whose figures must stay on the title's line. Every row has a title over its one muted description line; only a message row read whole, or a second content beside the first, may be description only. Media, content and actions stand 16 px apart, centred on one another, in a 72 px row of 16 px padding; a 600 title stands over one 20 px description with no gap, and each holds one line and ends in an ellipsis (`whole` lets a message wrap). Inside a card the group is `divided`: no gaps, one hairline between items. An item that is an `a`, a `button` or a `label` takes the `accent` hover and is one hit target; a plain item never reacts to hover; nested controls stay independent. An `xs` item inside a menu or a combobox option takes the option's padding and adds none. A button in the row is `size="sm"` (32 px). A row a person picks starts with `ItemSelect` and is drawn `render={<label />}`, so the whole row ticks its box and has no other control. A second content beside the first takes only the room its words need. Colour is neutral: the title in ink, the description and any trailing words muted, no hue.
|
|
30
|
+
* @behaviour A list of descriptive rows is an `ItemGroup` of `Item`s, never table semantics. A row too narrow for its title beside its actions puts the actions under the title, so a name never squeezes to a few letters a line; `min-w-0` on `ItemContent` turns that off, for a row whose figures must stay on the title's line. Every row has a title over its one muted description line; only a message row read whole, or a second content beside the first, may be description only. Media, content and actions stand 16 px apart, centred on one another, in a 72 px row of 16 px padding; a 600 title stands over one 20 px description with no gap, and each holds one line and ends in an ellipsis (`whole` lets a message wrap). Inside a card the group is `divided`: no gaps, one hairline between items, and no side padding, so each row's media and words start on the card's content edge under its title, as a table's first column does. An item that is an `a`, a `button` or a `label` takes the `accent` hover and is one hit target; a plain item never reacts to hover; nested controls stay independent. An `xs` item inside a menu or a combobox option takes the option's padding and adds none. A button in the row is `size="sm"` (32 px). A row a person picks starts with `ItemSelect` and is drawn `render={<label />}`, so the whole row ticks its box and has no other control. A second content beside the first takes only the room its words need. Colour is neutral: the title in ink, the description and any trailing words muted, no hue.
|
|
31
31
|
* “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)
|
|
32
32
|
* Ours: the third control goes in the row's three dots.
|
|
33
33
|
* “Render the Skeleton variant (`entity-with-skeleton`) during load instead of an empty row, and swap to real content once data resolves.” (https://vercel.com/geist/entity)
|
package/dist/components/item.js
CHANGED
|
@@ -22,7 +22,7 @@ function ItemGroup({ className, divided = false, render, ...props }) {
|
|
|
22
22
|
function ItemSeparator({ className, ...props }) {
|
|
23
23
|
return (_jsx(Separator, { "data-slot": "item-separator", orientation: "horizontal", className: cn("my-2", className), ...props, "aria-hidden": "true", role: "presentation" }));
|
|
24
24
|
}
|
|
25
|
-
const itemVariants = cva("nc-transition-paint group/item flex w-full flex-wrap items-center rounded-sm border text-sm in-data-divided:rounded-none in-data-divided:border-0 [a]:transition-colors [a]:hover:bg-accent [label]:cursor-pointer [label]:transition-colors [label]:hover:bg-accent [button]:transition-colors [button]:text-left [button]:enabled:hover:bg-accent [button]:disabled:opacity-50", {
|
|
25
|
+
const itemVariants = cva("nc-transition-paint group/item flex w-full flex-wrap items-center rounded-sm border text-sm in-data-divided:rounded-none in-data-divided:border-0 in-data-divided:px-0 [a]:transition-colors [a]:hover:bg-accent [label]:cursor-pointer [label]:transition-colors [label]:hover:bg-accent [button]:transition-colors [button]:text-left [button]:enabled:hover:bg-accent [button]:disabled:opacity-50", {
|
|
26
26
|
variants: {
|
|
27
27
|
variant: {
|
|
28
28
|
default: "border-transparent",
|
|
@@ -48,7 +48,7 @@ const itemVariants = cva("nc-transition-paint group/item flex w-full flex-wrap i
|
|
|
48
48
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
49
49
|
* “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
|
|
50
50
|
* Ours: Geist's `Table` is a `DataTable` and its `Description` is `ObjectFacts`. An object a person opens, with a mark, facts and a status, is a `RecordList` row; the same row edited in place is a `RecordList` with an `editor`. A page whose job is one collection is `CollectionPage`. Agents in a gallery are `AgentListRow`; Library entries `CatalogEntry`.
|
|
51
|
-
* @behaviour A list of descriptive rows is an `ItemGroup` of `Item`s, never table semantics. A row too narrow for its title beside its actions puts the actions under the title, so a name never squeezes to a few letters a line; `min-w-0` on `ItemContent` turns that off, for a row whose figures must stay on the title's line. Every row has a title over its one muted description line; only a message row read whole, or a second content beside the first, may be description only. Media, content and actions stand 16 px apart, centred on one another, in a 72 px row of 16 px padding; a 600 title stands over one 20 px description with no gap, and each holds one line and ends in an ellipsis (`whole` lets a message wrap). Inside a card the group is `divided`: no gaps, one hairline between items. An item that is an `a`, a `button` or a `label` takes the `accent` hover and is one hit target; a plain item never reacts to hover; nested controls stay independent. An `xs` item inside a menu or a combobox option takes the option's padding and adds none. A button in the row is `size="sm"` (32 px). A row a person picks starts with `ItemSelect` and is drawn `render={<label />}`, so the whole row ticks its box and has no other control. A second content beside the first takes only the room its words need. Colour is neutral: the title in ink, the description and any trailing words muted, no hue.
|
|
51
|
+
* @behaviour A list of descriptive rows is an `ItemGroup` of `Item`s, never table semantics. A row too narrow for its title beside its actions puts the actions under the title, so a name never squeezes to a few letters a line; `min-w-0` on `ItemContent` turns that off, for a row whose figures must stay on the title's line. Every row has a title over its one muted description line; only a message row read whole, or a second content beside the first, may be description only. Media, content and actions stand 16 px apart, centred on one another, in a 72 px row of 16 px padding; a 600 title stands over one 20 px description with no gap, and each holds one line and ends in an ellipsis (`whole` lets a message wrap). Inside a card the group is `divided`: no gaps, one hairline between items, and no side padding, so each row's media and words start on the card's content edge under its title, as a table's first column does. An item that is an `a`, a `button` or a `label` takes the `accent` hover and is one hit target; a plain item never reacts to hover; nested controls stay independent. An `xs` item inside a menu or a combobox option takes the option's padding and adds none. A button in the row is `size="sm"` (32 px). A row a person picks starts with `ItemSelect` and is drawn `render={<label />}`, so the whole row ticks its box and has no other control. A second content beside the first takes only the room its words need. Colour is neutral: the title in ink, the description and any trailing words muted, no hue.
|
|
52
52
|
* “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)
|
|
53
53
|
* Ours: the third control goes in the row's three dots.
|
|
54
54
|
* “Render the Skeleton variant (`entity-with-skeleton`) during load instead of an empty row, and swap to real content once data resolves.” (https://vercel.com/geist/entity)
|
|
@@ -43,7 +43,7 @@ type KpiCardProps = {
|
|
|
43
43
|
* @family Charts
|
|
44
44
|
* @when One figure a person checks at a glance: Active Agents, Spend, Tasks done, Need attention, in an overview's row of figures.
|
|
45
45
|
* @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`.
|
|
46
|
-
* @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. With `sparkline`, Vercel Observability's overview 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. 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 (nadicode decision).
|
|
46
|
+
* @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`, Vercel Observability's overview 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. 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 (nadicode decision).
|
|
47
47
|
* @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.
|
|
48
48
|
* @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.
|
|
49
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-card.d.ts","sourceRoot":"","sources":["../../src/components/kpi-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAY3D,OAAO,EAAyB,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAQtF,KAAK,gBAAgB,GAAG,cAAc,CAAC;AACvC,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtD,KAAK,YAAY,GAAG;IAClB,2CAA2C;IAC3C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sGAAsG;IACtG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,UAAU,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnD,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,CAA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AkE;IAClE,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,CAAC;AAQF;;;;;;;;;;;;GAYG;AACH,iBAAS,OAAO,CAAC,EACf,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAgB,EAChB,MAAM,EACN,YAAqB,EACrB,SAAS,GACV,EAAE,YAAY,qBAwHd;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAC,EAAE,MAAc,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,qBAoBhE;AAED,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -25,7 +25,7 @@ const VALUE_TONE_CLASS = {
|
|
|
25
25
|
* @family Charts
|
|
26
26
|
* @when One figure a person checks at a glance: Active Agents, Spend, Tasks done, Need attention, in an overview's row of figures.
|
|
27
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. With `sparkline`, Vercel Observability's overview 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. 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 (nadicode decision).
|
|
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`, Vercel Observability's overview 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. 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 (nadicode decision).
|
|
29
29
|
* @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
30
|
* @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
31
|
*/
|
|
@@ -36,7 +36,7 @@ function KpiCard({ label, value, delta, note, tone = "default", render, presenta
|
|
|
36
36
|
const footerLine = [delta?.comparison, note].filter(Boolean).join(" · ");
|
|
37
37
|
const badge = delta ? (_jsx(TrendBadge, { value: delta.value, direction: delta.direction, tone: trendTone(delta.direction, delta.upIsGood, delta.neutral), directionLabel: delta.directionLabel })) : null;
|
|
38
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 flex min-w-0 items-
|
|
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 })] }) }));
|
|
40
40
|
}
|
|
41
41
|
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
42
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type
|
|
1
|
+
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
5
|
type ObjectPageFact = {
|
|
6
6
|
label: string;
|
|
7
7
|
value: ReactNode;
|
|
8
|
+
url?: never;
|
|
9
|
+
} | {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
/** The value is a web address, such as a company's website: it wraps only after `://`, a dot or a slash. */
|
|
13
|
+
url: true;
|
|
8
14
|
};
|
|
9
15
|
export type ObjectPageEntry = {
|
|
10
16
|
/** The row's noun phrase: "Deployment settings", "Build logs". */
|
|
@@ -56,7 +62,7 @@ export type ObjectPageProps = {
|
|
|
56
62
|
* @family Compositions
|
|
57
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.
|
|
58
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; an Agent's Edit page in Nadia's window opens on its AgentProfileCard, the documented exception. A card of values a person saves is a setting card, never this one.
|
|
59
|
-
* @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. As Vercel's deployment page (Deployment Details, then its steps), 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, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (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. Optional `entries` follow in a card of their own 12 px under it: 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, as Vercel's Build Logs and Deployment Checks rows; 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 or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. 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.
|
|
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. As Vercel's deployment page (Deployment Details, then its steps), 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, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (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. Optional `entries` follow in a card of their own 12 px under it: 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, as Vercel's Build Logs and Deployment Checks rows; 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 or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. 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).
|
|
60
66
|
* @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}".
|
|
61
67
|
* @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.
|
|
62
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-page.d.ts","sourceRoot":"","sources":["../../src/components/object-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
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;AAIlF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,WAAW,EAAqC,MAAM,gBAAgB,CAAC;AAErF,KAAK,cAAc,GACf;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,CAAC,EAAE,KAAK,CAAA;CAAE,GAChD;IACE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,4GAA4G;IAC5G,GAAG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gB,UAAU,CAAC,EACzB,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,GACT,EAAE,eAAe,GAAG,YAAY,CA+FhC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
2
3
|
import { FooterStrip } from "../internal/footer-strip.js";
|
|
3
4
|
import { NoticeBanner } from "./notice-banner.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
@@ -6,6 +7,10 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./
|
|
|
6
7
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./card.js";
|
|
7
8
|
import { IdentityMark } from "./identity-mark.js";
|
|
8
9
|
import { CardActionsRow, PageCommandButton } from "./page-actions.js";
|
|
10
|
+
const AFTER_DOT_OR_SLASH = /(?<=[./])(?!\/)/;
|
|
11
|
+
function UrlValue({ url }) {
|
|
12
|
+
return url.split(AFTER_DOT_OR_SLASH).map((part, index) => (_jsxs(Fragment, { children: [index > 0 ? _jsx("wbr", {}) : null, part] }, `${index}:${part}`)));
|
|
13
|
+
}
|
|
9
14
|
/**
|
|
10
15
|
* One object's page: the object card with its name, commands, facts, rows that open and one link
|
|
11
16
|
* elsewhere, then its sections as cards.
|
|
@@ -13,13 +18,13 @@ import { CardActionsRow, PageCommandButton } from "./page-actions.js";
|
|
|
13
18
|
* @family Compositions
|
|
14
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.
|
|
15
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; an Agent's Edit page in Nadia's window opens on its AgentProfileCard, the documented exception. A card of values a person saves is a setting card, never this one.
|
|
16
|
-
* @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. As Vercel's deployment page (Deployment Details, then its steps), 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, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (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. Optional `entries` follow in a card of their own 12 px under it: 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, as Vercel's Build Logs and Deployment Checks rows; 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 or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. 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.
|
|
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. As Vercel's deployment page (Deployment Details, then its steps), 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, for every kind of object, with no preview box, since a product object has no picture of itself as a deployment has its screenshot; full-width facts follow in four columns once they have 36rem and two below (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. Optional `entries` follow in a card of their own 12 px under it: 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, as Vercel's Build Logs and Deployment Checks rows; 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 or other command of the object fits in it; the object's changes live in its sections, each a setting card with its own footer. 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).
|
|
17
22
|
* @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}".
|
|
18
23
|
* @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.
|
|
19
24
|
*/
|
|
20
25
|
export function ObjectPage({ mark, name, headingProps, description, facts, actions, entries, footer, notice, children, }) {
|
|
21
26
|
const title = headingProps ? (_jsx("h1", { ...headingProps, className: cn("outline-none", headingProps.className), children: name })) : (name);
|
|
22
|
-
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsxs("div", { className: "grid min-w-0 gap-3", children: [_jsxs(Card, { className: "min-w-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 && "border-b"), children: [_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: "grid min-w-0 gap-x-6 gap-y-5", children: _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: "grid min-w-0 grid-cols-2 gap-x-6 gap-y-4 @xl/object-page-facts:grid-cols-4", "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: "grid min-w-0 content-start gap-1", children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: "min-w-0 text-body-sm wrap-break-word text-foreground", children: fact.value })] }, fact.label))) }) }) })) : null, footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-page-hint", children: _jsx(PageCommandButton, { command: footer.link, variant: "outline" }) })) : null] }), entries && entries.length > 0 ? (_jsx(Card, { className: "@container/object-page-entries min-w-0 py-0", render: _jsx("div", { "data-slot": "object-page-entries" }), size: "sm", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
|
|
27
|
+
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsxs("div", { className: "grid min-w-0 gap-3", children: [_jsxs(Card, { className: "min-w-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 && "border-b"), children: [_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: "grid min-w-0 gap-x-6 gap-y-5", children: _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: "grid min-w-0 grid-cols-2 gap-x-6 gap-y-4 @xl/object-page-facts:grid-cols-4", "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: "grid min-w-0 content-start gap-1", children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: "min-w-0 text-body-sm wrap-break-word text-foreground", children: fact.url ? _jsx(UrlValue, { url: fact.value }) : fact.value })] }, fact.label))) }) }) })) : null, footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-page-hint", children: _jsx(PageCommandButton, { command: footer.link, variant: "outline" }) })) : null] }), entries && entries.length > 0 ? (_jsx(Card, { className: "@container/object-page-entries min-w-0 py-0", render: _jsx("div", { "data-slot": "object-page-entries" }), size: "sm", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
|
|
23
28
|
.filter((entry) => entry.defaultOpen)
|
|
24
29
|
.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 }), entry.summary] }), _jsx(AccordionContent, { className: "px-(--card-spacing) @md/object-page-entries:ps-[calc(var(--card-spacing)+1.75rem)]", children: entry.children })] }, entry.title))) }) })) : null] }), children] }));
|
|
25
30
|
}
|
|
@@ -11,8 +11,9 @@ import * as React from "react";
|
|
|
11
11
|
* it is the top bar's `Breadcrumb`; filters, search and sort sit in the toolbar below.
|
|
12
12
|
* @behaviour The header stands in the page's own column, so the title and the page's cards share one
|
|
13
13
|
* left edge. The title is always there and the actions arrive through the `PageActions` slot, so
|
|
14
|
-
* the page draws its commands once.
|
|
15
|
-
*
|
|
14
|
+
* the page draws its commands once. The title wraps between words and is never cut. On a header
|
|
15
|
+
* narrower than 576 px, a phone's or a narrow window's, the actions leave the title's row and stand
|
|
16
|
+
* as one row under the title and the description, on their left edge. Under the title sits the `description`: one muted line
|
|
16
17
|
* saying what the page's concept is, on every page that is a destination or a section, as every Vercel
|
|
17
18
|
* page does. It ends in a link to learn more when there is one, and never counts or introduces anything
|
|
18
19
|
* else. It is the page's only explanation: no other line introduces, explains or counts the page, and
|
|
@@ -23,7 +24,7 @@ import * as React from "react";
|
|
|
23
24
|
* object worked from a section sidebar, the title is the section's name: *Apps*. The description is
|
|
24
25
|
* one sentence in the product's words, saying what the page's concept does and where it applies,
|
|
25
26
|
* without a full stop when it ends in a link.
|
|
26
|
-
* @access The title is the page's `h1
|
|
27
|
+
* @access The title is the page's `h1`, read before its description and then the actions; DOM order is the narrow header's visual order, and a wider one sets the actions at the title row's end.
|
|
27
28
|
*/
|
|
28
29
|
declare function PageHeader({ title, description, headingProps, className, unseen, ...props }: Omit<React.ComponentProps<"header">, "title" | "children"> & {
|
|
29
30
|
title: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../src/components/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../src/components/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,MAAc,EACd,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAC9D,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,uEAAuE;IACvE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,qBAoCA;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -13,8 +13,9 @@ import { PageActionsSlot } from "./page-actions.js";
|
|
|
13
13
|
* it is the top bar's `Breadcrumb`; filters, search and sort sit in the toolbar below.
|
|
14
14
|
* @behaviour The header stands in the page's own column, so the title and the page's cards share one
|
|
15
15
|
* left edge. The title is always there and the actions arrive through the `PageActions` slot, so
|
|
16
|
-
* the page draws its commands once.
|
|
17
|
-
*
|
|
16
|
+
* the page draws its commands once. The title wraps between words and is never cut. On a header
|
|
17
|
+
* narrower than 576 px, a phone's or a narrow window's, the actions leave the title's row and stand
|
|
18
|
+
* as one row under the title and the description, on their left edge. Under the title sits the `description`: one muted line
|
|
18
19
|
* saying what the page's concept is, on every page that is a destination or a section, as every Vercel
|
|
19
20
|
* page does. It ends in a link to learn more when there is one, and never counts or introduces anything
|
|
20
21
|
* else. It is the page's only explanation: no other line introduces, explains or counts the page, and
|
|
@@ -25,12 +26,12 @@ import { PageActionsSlot } from "./page-actions.js";
|
|
|
25
26
|
* object worked from a section sidebar, the title is the section's name: *Apps*. The description is
|
|
26
27
|
* one sentence in the product's words, saying what the page's concept does and where it applies,
|
|
27
28
|
* without a full stop when it ends in a link.
|
|
28
|
-
* @access The title is the page's `h1
|
|
29
|
+
* @access The title is the page's `h1`, read before its description and then the actions; DOM order is the narrow header's visual order, and a wider one sets the actions at the title row's end.
|
|
29
30
|
*/
|
|
30
31
|
function PageHeader({ title, description, headingProps, className, unseen = false, ...props }) {
|
|
31
32
|
if (unseen) {
|
|
32
33
|
return (_jsx("h1", { ...headingProps, className: cn("sr-only", headingProps?.className), children: title }));
|
|
33
34
|
}
|
|
34
|
-
return (
|
|
35
|
+
return (_jsx("header", { "data-slot": "page-header", className: cn("@container/page-header min-w-0", className), ...props, children: _jsxs("div", { className: "grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(2.25rem,auto)] items-center @xl/page-header:grid-cols-[minmax(0,1fr)_auto] *:data-[slot=page-header-actions]:mt-3 @xl/page-header:*:data-[slot=page-header-actions]:col-start-2 @xl/page-header:*:data-[slot=page-header-actions]:row-start-1 @xl/page-header:*:data-[slot=page-header-actions]:ms-6 @xl/page-header:*:data-[slot=page-header-actions]:mt-0", children: [_jsx("h1", { ...headingProps, className: cn("col-start-1 row-start-1 min-w-0 text-heading-md text-foreground wrap-break-word outline-none", headingProps?.className), children: title }), description ? (_jsx("div", { "data-slot": "page-header-description", className: "mt-1 min-w-0 text-body-sm text-muted-foreground @xl/page-header:col-span-2 @xl/page-header:row-start-2", children: description })) : null, _jsx(PageActionsSlot, {})] }) }));
|
|
35
36
|
}
|
|
36
37
|
export { PageHeader };
|