@nadicodeai/ui 12.1.183 → 12.1.184

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.
Files changed (30) hide show
  1. package/dist/components/catalog-row.d.ts +98 -21
  2. package/dist/components/catalog-row.d.ts.map +1 -1
  3. package/dist/components/catalog-row.js +72 -43
  4. package/dist/components/hover-card.d.ts +1 -1
  5. package/dist/components/hover-card.js +1 -1
  6. package/dist/components/record-identity.d.ts +1 -1
  7. package/dist/components/record-identity.d.ts.map +1 -1
  8. package/dist/components/record-identity.js +2 -5
  9. package/dist/components/record-list.d.ts +7 -7
  10. package/dist/components/record-list.d.ts.map +1 -1
  11. package/dist/components/record-list.js +7 -24
  12. package/dist/components/record-time.d.ts +2 -4
  13. package/dist/components/record-time.d.ts.map +1 -1
  14. package/dist/components/record-time.js +3 -29
  15. package/dist/components/settings-facts.d.ts +18 -3
  16. package/dist/components/settings-facts.d.ts.map +1 -1
  17. package/dist/components/settings-facts.js +13 -8
  18. package/dist/components/table-layouts.d.ts +8 -8
  19. package/dist/components/table-layouts.d.ts.map +1 -1
  20. package/dist/components/table-layouts.js +8 -8
  21. package/dist/internal/table-compact-line.d.ts +2 -5
  22. package/dist/internal/table-compact-line.d.ts.map +1 -1
  23. package/dist/internal/table-compact-line.js +4 -6
  24. package/dist/lib/format-record-time.d.ts +9 -0
  25. package/dist/lib/format-record-time.d.ts.map +1 -0
  26. package/dist/lib/format-record-time.js +32 -0
  27. package/dist/showcase/specimens/compositions.d.ts.map +1 -1
  28. package/dist/showcase/specimens/compositions.js +19 -4
  29. package/dist/showcase/usage.generated.js +9 -9
  30. package/package.json +6 -2
@@ -1,39 +1,105 @@
1
+ import type { ReactNode } from "react";
1
2
  import { type CatalogCategory } from "./catalog-categories.js";
2
3
  import type { CollectionFilterCopy, CollectionFiltersProps } from "./collection-filters.js";
3
4
  import type { RecordFact, RecordFacts, RecordName } from "./record-list.js";
5
+ export type CatalogRowKind = "skill" | "plugin" | "server";
6
+ export type CatalogLearner = {
7
+ name: string;
8
+ mark?: ReactNode;
9
+ };
10
+ type OriginMap = {
11
+ skill: {
12
+ kind: "company" | "library" | "nadia" | "added";
13
+ } | {
14
+ kind: "hub";
15
+ hub: string;
16
+ } | {
17
+ kind: "learned";
18
+ by: CatalogLearner | null;
19
+ };
20
+ plugin: {
21
+ kind: "library" | "agentTemplate" | "nadia" | "added";
22
+ };
23
+ server: {
24
+ kind: "portal" | "added";
25
+ } | {
26
+ kind: "plugin";
27
+ plugin: string | null;
28
+ };
29
+ };
30
+ type OriginWordsMap = {
31
+ skill: {
32
+ company: string;
33
+ library: string;
34
+ nadia: string;
35
+ added: string;
36
+ hub: (hub: string) => string;
37
+ learned: string;
38
+ learnedBy: (agent: string) => string;
39
+ };
40
+ plugin: {
41
+ library: string;
42
+ agentTemplate: string;
43
+ nadia: string;
44
+ added: string;
45
+ };
46
+ server: {
47
+ portal: string;
48
+ added: string;
49
+ plugin: (plugin: string) => string;
50
+ anyPlugin: string;
51
+ };
52
+ };
53
+ export type CatalogOrigin<Kind extends CatalogRowKind = CatalogRowKind> = OriginMap[Kind];
54
+ export type CatalogOriginWords<Kind extends CatalogRowKind = CatalogRowKind> = OriginWordsMap[Kind];
4
55
  /** What a skill, a plugin or an MCP server is drawn from: the facts its screen reads, never how they are laid out. */
5
- export type CatalogRow = {
56
+ export type CatalogRow<Kind extends CatalogRowKind = CatalogRowKind> = {
6
57
  name: string;
7
- /** What it does, as its catalog card says it, or what it is (a server's address); left out when nothing says it. */
58
+ /** What it does, as its card or its file says it, or what it is (a server's address); left out when nothing says it. */
8
59
  detail?: string | undefined;
9
- /** The icon its catalog card names; none draws its kind's own. A server always draws the server icon. */
60
+ /** The icon its card names; none draws its kind's own. A server always draws the server icon. */
10
61
  icon?: string | null | undefined;
11
- /** The category its catalog card names; none draws no label. */
62
+ /** The category its card names; a skill or a plugin with none is Other. A server has no category. */
12
63
  category?: CatalogCategory | null | undefined;
13
- /** Where it came from, in the product's words: "From the Library", "Added in Nadia". */
14
- source: string;
64
+ /** Where the Agent's copy came from; a catalog's own entry, which no Agent holds yet, has none. */
65
+ origin?: CatalogOrigin<Kind> | undefined;
15
66
  };
16
- export type CatalogRowKind = "skill" | "plugin" | "server";
17
67
  /** The product's words for the row's columns and its category filter. */
18
- export type CatalogRowWords = {
68
+ export type CatalogRowWords<Kind extends CatalogRowKind = CatalogRowKind> = {
19
69
  category: string;
20
70
  allCategories: string;
21
71
  categoryName: (category: CatalogCategory) => string;
22
- source: string;
23
72
  filter: CollectionFilterCopy;
73
+ /** The origin column's name and words; a screen of a catalog's own entries leaves them out and draws no such column. */
74
+ origin?: {
75
+ label: string;
76
+ words: CatalogOriginWords<Kind>;
77
+ };
24
78
  };
25
79
  /** The shared row's parts a screen spreads into its `CollectionPage`. */
26
80
  export type CatalogRows<TRecord> = {
27
81
  list: {
28
82
  name: (record: TRecord) => RecordName;
29
83
  facts: RecordFacts<TRecord>;
30
- wraps: true;
31
84
  };
32
85
  filters: CollectionFiltersProps | undefined;
33
86
  keep: (rows: readonly TRecord[]) => TRecord[];
34
87
  narrowed: boolean;
35
88
  clear: () => void;
36
89
  };
90
+ export type SkillFacts = {
91
+ origin: "learned" | "written" | "company" | "hub";
92
+ wished: boolean;
93
+ brought: boolean;
94
+ hub: string | null;
95
+ savedBy: string | null;
96
+ };
97
+ /**
98
+ * A skill's origin from Nadia's facts, the one reading both products make. On an Agent's own list a company skill is
99
+ * the company's, whoever wrote it; on the company's list it is where it came from, and the Agent who learned one is
100
+ * `learner` when the screen knows her, or her saved name.
101
+ */
102
+ export declare function skillOrigin(facts: SkillFacts, on: "agent" | "company", learner?: CatalogLearner): CatalogOrigin<"skill">;
37
103
  /**
38
104
  * One row for every skill, plugin and MCP server a person meets, in the Portal's Library and an Agent's pages and in
39
105
  * Nadia's Edit Agent and company skills: the screen says what each record is, this draws it, and the screen keeps its own
@@ -42,20 +108,31 @@ export type CatalogRows<TRecord> = {
42
108
  * @family Compositions
43
109
  * @when A `CollectionPage` of skills, plugins or MCP servers. The screen calls it with its records, what each one is
44
110
  * (`CatalogRow`) and its words, spreads `list` into the page, passes `filters` as the page's filters and lists `keep`'s
45
- * rows; a new screen of the same things gets the same row by the same call.
111
+ * rows; a new screen of the same things gets the same row by the same call. A skill's origin comes from `skillOrigin`.
46
112
  * @instead Any other record is the page's own `RecordList` row. The Library's add-from drawer is `CatalogDrawer`; a
47
113
  * category on its own is `CategoryTag`.
48
114
  * @behaviour The mark is the neutral ringed tile with the card's own icon, its kind's when the card names none, and the
49
- * server icon for a server; the name; under it the detail, wrapping in full. Then two facts: the category label
50
- * (`CategoryTag`), standing only while a row has a category, and where it came from, wrapping in full. The category filter stands after
51
- * the search only while the rows hold more than one category; `keep` narrows rows to the chosen one, and a choice the
52
- * rows no longer hold narrows nothing. `narrowed` says a category is chosen, for the page's no match, and `clear`
53
- * unsets it.
54
- * @words Every string is the product's: the source in the same words wherever it means the same ("From the Library",
55
- * "Added in Nadia", "From the {plugin} plugin"), the category's name as its filter writes it.
56
- * @access The columns are named by `words.category` and `words.source`; the category's icon is decorative.
115
+ * server icon for a server; the name; under it the detail. Then the facts: a skill's or a plugin's category label
116
+ * (`CategoryTag`) on every row, Other when its card names none, a server having none; where the Agent's copy came from,
117
+ * in one closed list of origins, a learned skill naming the Agent who learned it with her mark, or by her name where the screen has no mark for her; then the screen's own
118
+ * columns. The category filter stands after the search only while the rows hold more than one category; `keep` narrows
119
+ * rows to the chosen one, and a choice the rows no longer hold narrows nothing. `narrowed` says a category is chosen,
120
+ * for the page's no match, and `clear` unsets it.
121
+ * @words Every string is the product's, one per origin in the grammar of the row's kind: "Company skill", "From the
122
+ * Library", "Comes with Nadia", "Learned", "Added in Nadia", "Added in the Portal", "From the {plugin} plugin"; the
123
+ * category's name as its filter writes it.
124
+ * @access The columns are named by `words.category` and `words.origin.label`; the category's icon is decorative, and a
125
+ * learned skill's origin reads "Learned by {Agent}".
57
126
  */
58
- export declare function useCatalogRows<TRecord>(kind: CatalogRowKind, records: readonly TRecord[] | undefined, rowOf: (record: TRecord) => CatalogRow, words: CatalogRowWords,
59
- /** One more column a screen owns after the source, such as which of the viewer's Agents have it. */
127
+ export declare function useCatalogRows<Kind extends CatalogRowKind, TRecord>(kind: Kind, records: readonly TRecord[] | undefined, rowOf: (record: TRecord) => CatalogRow<Kind>, words: CatalogRowWords<Kind> & {
128
+ origin: NonNullable<CatalogRowWords<Kind>["origin"]>;
129
+ },
130
+ /** One more column the screen owns after the origin, such as which of the viewer's Agents have it. */
60
131
  extra?: RecordFact<TRecord>): CatalogRows<TRecord>;
132
+ export declare function useCatalogRows<Kind extends CatalogRowKind, TRecord>(kind: Kind, records: readonly TRecord[] | undefined, rowOf: (record: TRecord) => CatalogRow<Kind>, words: CatalogRowWords<Kind> & {
133
+ origin?: undefined;
134
+ },
135
+ /** The screen's own columns after the category, at most two, for a catalog's entries no Agent holds. */
136
+ extra?: readonly [RecordFact<TRecord>] | readonly [RecordFact<TRecord>, RecordFact<TRecord>]): CatalogRows<TRecord>;
137
+ export {};
61
138
  //# sourceMappingURL=catalog-row.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-row.d.ts","sourceRoot":"","sources":["../../src/components/catalog-row.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAG3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEpF,sHAAsH;AACtH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,oHAAoH;IACpH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,yGAAyG;IACzG,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,gEAAgE;IACh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AAE,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,EAC5C,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;CAAE;AACvF,sGAAsG;AACtG,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAC1B,WAAW,CAAC,OAAO,CAAC,CAAC;AACxB,wBAAgB,cAAc,CAAC,IAAI,SAAS,cAAc,EAAE,OAAO,EACjE,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,EACvC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,EAC5C,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE;AACrD,wGAAwG;AACxG,KAAK,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,GAC3F,WAAW,CAAC,OAAO,CAAC,CAAC"}
@@ -1,36 +1,56 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Server } from "lucide-react";
4
4
  import { useState } from "react";
5
5
  import { CATALOG_CATEGORIES } from "./catalog-categories.js";
6
6
  import { CategoryTag } from "./catalog-category.js";
7
7
  import { catalogIcon } from "./catalog-entry.js";
8
+ const ORIGIN_READERS = {
9
+ skill: (said) => (origin) => {
10
+ if (origin.kind === "hub")
11
+ return said.hub(origin.hub);
12
+ if (origin.kind !== "learned")
13
+ return said[origin.kind];
14
+ if (origin.by && !origin.by.mark)
15
+ return said.learnedBy(origin.by.name);
16
+ return (_jsxs("span", { className: "inline-flex items-center gap-1.5", children: [origin.by?.mark, _jsx("span", { "aria-hidden": origin.by ? true : undefined, children: said.learned }), origin.by ? _jsx("span", { className: "sr-only", children: said.learnedBy(origin.by.name) }) : null] }));
17
+ },
18
+ plugin: (said) => (origin) => said[origin.kind],
19
+ server: (said) => (origin) => origin.kind === "plugin"
20
+ ? origin.plugin
21
+ ? said.plugin(origin.plugin)
22
+ : said.anyPlugin
23
+ : said[origin.kind],
24
+ };
25
+ function originReader(kind, words) {
26
+ return ORIGIN_READERS[kind](words);
27
+ }
8
28
  /**
9
- * One row for every skill, plugin and MCP server a person meets, in the Portal's Library and an Agent's pages and in
10
- * Nadia's Edit Agent and company skills: the screen says what each record is, this draws it, and the screen keeps its own
11
- * commands, menu, status and editor.
12
- *
13
- * @family Compositions
14
- * @when A `CollectionPage` of skills, plugins or MCP servers. The screen calls it with its records, what each one is
15
- * (`CatalogRow`) and its words, spreads `list` into the page, passes `filters` as the page's filters and lists `keep`'s
16
- * rows; a new screen of the same things gets the same row by the same call.
17
- * @instead Any other record is the page's own `RecordList` row. The Library's add-from drawer is `CatalogDrawer`; a
18
- * category on its own is `CategoryTag`.
19
- * @behaviour The mark is the neutral ringed tile with the card's own icon, its kind's when the card names none, and the
20
- * server icon for a server; the name; under it the detail, wrapping in full. Then two facts: the category label
21
- * (`CategoryTag`), standing only while a row has a category, and where it came from, wrapping in full. The category filter stands after
22
- * the search only while the rows hold more than one category; `keep` narrows rows to the chosen one, and a choice the
23
- * rows no longer hold narrows nothing. `narrowed` says a category is chosen, for the page's no match, and `clear`
24
- * unsets it.
25
- * @words Every string is the product's: the source in the same words wherever it means the same ("From the Library",
26
- * "Added in Nadia", "From the {plugin} plugin"), the category's name as its filter writes it.
27
- * @access The columns are named by `words.category` and `words.source`; the category's icon is decorative.
29
+ * A skill's origin from Nadia's facts, the one reading both products make. On an Agent's own list a company skill is
30
+ * the company's, whoever wrote it; on the company's list it is where it came from, and the Agent who learned one is
31
+ * `learner` when the screen knows her, or her saved name.
28
32
  */
29
- export function useCatalogRows(kind, records, rowOf, words,
30
- /** One more column a screen owns after the source, such as which of the viewer's Agents have it. */
31
- extra) {
33
+ export function skillOrigin(facts, on, learner) {
34
+ if (on === "agent" && facts.origin === "company")
35
+ return { kind: "company" };
36
+ if (facts.wished)
37
+ return { kind: "library" };
38
+ if (facts.hub !== null)
39
+ return { kind: "hub", hub: facts.hub };
40
+ if (facts.brought)
41
+ return { kind: "nadia" };
42
+ const learned = facts.origin === "learned" || (facts.origin === "company" && facts.savedBy !== null);
43
+ if (!learned)
44
+ return { kind: "added" };
45
+ return {
46
+ kind: "learned",
47
+ by: learner ?? (facts.savedBy === null ? null : { name: facts.savedBy }),
48
+ };
49
+ }
50
+ export function useCatalogRows(kind, records, rowOf, words, extra) {
32
51
  const [category, setCategory] = useState("");
33
- const held = CATALOG_CATEGORIES.filter((each) => records?.some((record) => rowOf(record).category === each) ?? false);
52
+ const categoryOf = (record) => kind === "server" ? null : (rowOf(record).category ?? "other");
53
+ const held = CATALOG_CATEGORIES.filter((each) => records?.some((record) => categoryOf(record) === each) ?? false);
34
54
  const chosen = held.find((each) => each === category) ?? "";
35
55
  const narrowed = held.length > 1 && chosen !== "";
36
56
  const filters = held.length > 1
@@ -57,29 +77,38 @@ extra) {
57
77
  shown.detail = row.detail;
58
78
  return shown;
59
79
  };
60
- const shared = [
61
- {
62
- id: "category",
63
- label: words.category,
64
- of: (record) => {
65
- const shown = rowOf(record).category;
66
- return shown ? _jsx(CategoryTag, { category: shown, label: words.categoryName(shown) }) : null;
67
- },
68
- size: 168,
80
+ const categoryFact = {
81
+ id: "category",
82
+ label: words.category,
83
+ of: (record) => {
84
+ const shown = categoryOf(record);
85
+ return shown ? _jsx(CategoryTag, { category: shown, label: words.categoryName(shown) }) : null;
69
86
  },
70
- {
71
- id: "source",
72
- label: words.source,
73
- of: (record) => rowOf(record).source,
74
- size: 200,
75
- wraps: true,
87
+ size: 128,
88
+ };
89
+ const origin = words.origin;
90
+ const own = extra === undefined ? [] : "id" in extra ? [extra] : extra;
91
+ const read = origin && originReader(kind, origin.words);
92
+ const originFact = origin && {
93
+ id: "origin",
94
+ label: origin.label,
95
+ of: (record) => {
96
+ const from = rowOf(record).origin;
97
+ return from && read ? read(from) : null;
76
98
  },
77
- ];
78
- const facts = extra ? [...shared, extra] : shared;
99
+ size: 176,
100
+ wraps: true,
101
+ };
102
+ const [first, second] = originFact ? [originFact, own[0]] : own;
103
+ const facts = first
104
+ ? second
105
+ ? [categoryFact, first, second]
106
+ : [categoryFact, first]
107
+ : [categoryFact];
79
108
  return {
80
- list: { name, facts, wraps: true },
109
+ list: { name, facts },
81
110
  filters,
82
- keep: (rows) => narrowed ? rows.filter((row) => rowOf(row).category === chosen) : [...rows],
111
+ keep: (rows) => narrowed ? rows.filter((row) => categoryOf(row) === chosen) : [...rows],
83
112
  narrowed,
84
113
  clear: () => setCategory(""),
85
114
  };
@@ -35,7 +35,7 @@ import type { PresentContent } from "../internal/present-content.js";
35
35
  * `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the
36
36
  * deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card)
37
37
  * Ours: the name and the keys are in sentence case (*Last active*). A time's card leads with the
38
- * relative label, and its trigger keeps its verb sentence: *Updated 3 hours ago*.
38
+ * relative label, and its trigger keeps its verb sentence: *Updated 3h ago*.
39
39
  * @access "The trigger keeps its own accessible name; the card is supplementary and shouldn’t
40
40
  * replace it." "Card content is reachable by keyboard once the trigger has focus; Escape closes the
41
41
  * card and returns focus to the trigger." (https://vercel.com/geist/context-card)
@@ -41,7 +41,7 @@ const HOVER_CARD_DELAY = 150;
41
41
  * `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the
42
42
  * deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card)
43
43
  * Ours: the name and the keys are in sentence case (*Last active*). A time's card leads with the
44
- * relative label, and its trigger keeps its verb sentence: *Updated 3 hours ago*.
44
+ * relative label, and its trigger keeps its verb sentence: *Updated 3h ago*.
45
45
  * @access "The trigger keeps its own accessible name; the card is supplementary and shouldn’t
46
46
  * replace it." "Card content is reachable by keyboard once the trigger has focus; Escape closes the
47
47
  * card and returns focus to the trigger." (https://vercel.com/geist/context-card)
@@ -8,7 +8,7 @@ import { type IdentityMarkProps } from "./identity-mark.js";
8
8
  * @family Status
9
9
  * @when The first cell of every collection row: the mark, the name, and one muted line saying what the record is or where it comes from, so the row reads without a heading.
10
10
  * @instead An Agent in a gallery is `AgentListRow`; a model is `ModelIdentity`. A descriptive item with prose and actions is `Item`.
11
- * @behaviour The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory, and then the detail wraps too. The table owns the link.
11
+ * @behaviour The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory: the name is then a sentence at the body's regular weight, not a name in semibold, and the detail wraps too. The table owns the link.
12
12
  * @words “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)
13
13
  * Ours: the name as the record calls itself, and the detail in sentence case: kind, then relation, three to six words, "Company skill · every Agent has it".
14
14
  * @access The name is the row link's text; the mark is decorative; the title carries the full name.
@@ -1 +1 @@
1
- {"version":3,"file":"record-identity.d.ts","sourceRoot":"","sources":["../../src/components/record-identity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIlF;;;;;;;;;;;;GAYG;AACH,iBAAS,cAAc,CAAC,EACtB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAa,GACd,EAAE;IACD,IAAI,EAAE,SAAS,CAAC;IAChB,8FAA8F;IAC9F,IAAI,EAAE,iBAAiB,CAAC;IACxB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,+BAkCA;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"record-identity.d.ts","sourceRoot":"","sources":["../../src/components/record-identity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIlF;;;;;;;;;;;;GAYG;AACH,iBAAS,cAAc,CAAC,EACtB,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,KAAa,GACd,EAAE;IACD,IAAI,EAAE,SAAS,CAAC;IAChB,8FAA8F;IAC9F,IAAI,EAAE,iBAAiB,CAAC;IACxB,qFAAqF;IACrF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,+BAgCA;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -10,16 +10,13 @@ import { cn } from "../lib/utils.js";
10
10
  * @family Status
11
11
  * @when The first cell of every collection row: the mark, the name, and one muted line saying what the record is or where it comes from, so the row reads without a heading.
12
12
  * @instead An Agent in a gallery is `AgentListRow`; a model is `ModelIdentity`. A descriptive item with prose and actions is `Item`.
13
- * @behaviour The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory, and then the detail wraps too. The table owns the link.
13
+ * @behaviour The mark stands 16 px before the name. The name is semibold (600) ink and the detail a muted 14 px line, two lines with no gap between them, so the row is an entity row; `mark` is required; a record with nothing to say under its name leaves `detail` out and is the name alone, never a dash, which is a table cell's missing value and not a record's. The name holds one line and ends in an ellipsis, whole in its title, with a `hint` such as an ID read after it. The detail is one line too and ends in an ellipsis, whole in its title when it is text; in a row on a card narrower than its columns, the facts that leave the row join it after a middle dot and wrap so every value stays readable, and a status that leaves the row stands beside the name, which ends in an ellipsis before it. `wraps` only when the name is the whole record, such as a memory: the name is then a sentence at the body's regular weight, not a name in semibold, and the detail wraps too. The table owns the link.
14
14
  * @words “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)
15
15
  * Ours: the name as the record calls itself, and the detail in sentence case: kind, then relation, three to six words, "Company skill · every Agent has it".
16
16
  * @access The name is the row link's text; the mark is decorative; the title carries the full name.
17
17
  */
18
18
  function RecordIdentity({ name, mark, hint, detail, wraps = false, }) {
19
19
  const title = typeof name === "string" ? (hint ? `${name} · ${hint}` : name) : undefined;
20
- return (_jsxs("span", { className: "flex min-w-0 items-center gap-4", "data-slot": "record-identity", children: [_jsx(IdentityMark, { ...mark, size: 32 }), _jsxs("span", { className: "grid min-w-0 in-[table]:w-0 in-[table]:flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: cn("min-w-0 font-semibold text-foreground", wraps ? "wrap-break-word whitespace-pre-wrap" : "truncate"), title: wraps ? undefined : title, children: name }), _jsx(TableCompactNameFacts, {})] }), _jsxs("span", { className: cn(
21
- // The line is the containing block of the facts' screen-reader labels, so what it cuts
22
- // stays cut instead of widening the table.
23
- "relative text-sm text-muted-foreground", wraps ? "wrap-break-word whitespace-normal" : "truncate"), "data-slot": "record-identity-detail", title: !wraps && typeof detail === "string" ? detail : undefined, children: [detail, _jsx(TableCompactFacts, {})] })] })] }));
20
+ return (_jsxs("span", { className: "flex min-w-0 items-center gap-4", "data-slot": "record-identity", children: [_jsx(IdentityMark, { ...mark, size: 32 }), _jsxs("span", { className: "grid min-w-0 in-[table]:w-0 in-[table]:flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: cn("min-w-0 text-foreground", wraps ? "wrap-break-word whitespace-pre-wrap" : "truncate font-semibold"), title: wraps ? undefined : title, children: name }), _jsx(TableCompactNameFacts, {})] }), _jsx("span", { className: cn("text-sm text-muted-foreground", wraps ? "wrap-break-word whitespace-normal" : "truncate"), "data-slot": "record-identity-detail", title: !wraps && typeof detail === "string" ? detail : undefined, children: detail }), _jsx(TableCompactFacts, {})] })] }));
24
21
  }
25
22
  export { RecordIdentity };
@@ -160,18 +160,18 @@ export type RecordListProps<TRecord extends RowData> = {
160
160
  };
161
161
  footer?: RecordListFooter;
162
162
  /**
163
- * The row's visible commands, one or two outline buttons of 32 px before the three dots:
164
- * "Connect account", "Open report". A third goes in the menu. A compact row draws them under
165
- * the name.
163
+ * The row's visible commands, one or two outline buttons of 32 px before the three dots: the
164
+ * record's main job, the same on every row that can do it ("Approve", "Add to an Agent"). Every
165
+ * other command, a lone one included, goes in the menu. A compact row draws them under the name.
166
166
  */
167
167
  command?: (record: TRecord) => PageCommand | readonly [PageCommand, PageCommand] | null;
168
168
  /** The record's own action failed or was refused: its message inside its row. */
169
169
  state?: (record: TRecord) => RowMessage | null;
170
170
  /**
171
171
  * The least width of the commands column in pixels, for a row that draws a button or a failed
172
- * action's next steps. The column is already as wide as its widest row's buttons, next steps,
173
- * three dots and chevron need, worked out from their labels, so none is cut: a list gives it
174
- * only to hold a wider column.
172
+ * action's next steps. The column is already as wide as its widest row's buttons, next steps
173
+ * and three dots need, worked out from their labels, so none is cut: a list gives it only to
174
+ * hold a wider column.
175
175
  */
176
176
  commandsSize?: number;
177
177
  };
@@ -187,7 +187,7 @@ export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey>
187
187
  * @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
188
188
  * “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
189
189
  * Ours: Geist's `Table` is a `DataTable`: this list has no visible headings and at most three facts, so a fourth fact is a table, and anything more than a few facts lives on the record's page. A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item`.
190
- * @behaviour One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots or the chevron after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots or the chevron alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout="line"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu of one command that is not destructive, with no row command, is that command's button, except in a `line` row, which keeps it in the three dots as Vercel's project row does, and the column is as wide as the widest such button, so its label is never cut. The commands never take the name's room: once the row is compact, its commands column holds only the three dots or the chevron, a sole menu command stays in the dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, and a row that only opens ends in a muted chevron; a row that opens nothing never reacts to hover. With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list ("Deployment retention is enabled. Learn more", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message.
190
+ * @behaviour One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout="line"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu keeps every command in the three dots, one alone included, as Vercel's Environment Variables and Members rows do: a button stands on a row only where the list names it as `command`, the record's main job, on every row that can do it, so one list never mixes rows ending in a button with rows ending in dots. The commands never take the name's room: once the row is compact, its commands column holds only the three dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, with no chevron, as Vercel's Deployments rows open theirs; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list ("Deployment retention is enabled. Learn more", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message.
191
191
  * “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state)
192
192
  * Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card.
193
193
  * “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)
@@ -1 +1 @@
1
- {"version":3,"file":"record-list.d.ts","sourceRoot":"","sources":["../../src/components/record-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,O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,CAAC,GAAG,cAAc,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;IACxE,kDAAkD;IAClD,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,+DAA+D;QAC/D,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,WAAW,CAAC,EAAE,SAAS,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,WAAW,GAAG,SAAS,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,IAAI,CAAC;IACxF,iFAAiF;IACjF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,GAAG,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,OAAO,EAAE,GAAG,SAAS,WAAW,IAAI,IAAI,CACpF,eAAe,CAAC,OAAO,CAAC,EACxB,GAAG,CACJ,CAAC;AA2VF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,sCAqClF"}
@@ -1,6 +1,5 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { ChevronRight } from "lucide-react";
4
3
  import { createContext, useContext, useId } from "react";
5
4
  import { ActionMenu } from "./action-menu.js";
6
5
  import { Checkbox } from "./checkbox.js";
@@ -14,7 +13,6 @@ import { Skeleton, SkeletonRegion } from "./skeleton.js";
14
13
  import { StatusBadge } from "./status-badge.js";
15
14
  import { TableCard } from "./table-card.js";
16
15
  import { TableValue } from "./table-value.js";
17
- import { soleMenuButton } from "../internal/record-menu-items.js";
18
16
  import { RowMessageActions, RowMessageLine } from "../internal/row-message.js";
19
17
  import { CompactOnly, WideOnly } from "../internal/table-compact-line.js";
20
18
  const CELL_START = 8;
@@ -28,26 +26,16 @@ const BUTTON_LABEL_INSET = 6;
28
26
  const BUTTON_ICON_SLOT = 20;
29
27
  const BUTTON_ICON_GAP = 3;
30
28
  const EXTERNAL_ARROW = 14;
31
- const CHEVRON = 16;
32
29
  const WIDEST_LABEL_CHARACTER = 8;
33
30
  function shownCommands(list, record) {
34
31
  const menu = list.menu?.(record);
35
32
  const commands = menu?.commands ?? [];
36
33
  const own = list.command?.(record);
37
34
  const ownButtons = own ? [own].flat() : [];
38
- // A sole menu command is the row's button on a wide card and stays in the dots on a compact one.
39
- const menuButton = own || list.layout === "line" ? undefined : soleMenuButton(commands);
40
35
  const state = list.state?.(record) ?? null;
41
36
  const dots = menu && commands.length > 0 ? menu : undefined;
42
37
  const opens = Boolean(list.open?.href(record)) && !state;
43
- return {
44
- besideDots: menuButton ? [menuButton] : ownButtons,
45
- underName: ownButtons,
46
- menuButton,
47
- state,
48
- dots,
49
- opens,
50
- };
38
+ return { besideDots: ownButtons, underName: ownButtons, state, dots, opens };
51
39
  }
52
40
  function buttonRoom(command, size) {
53
41
  const longerLabel = Math.max(command.label.length, command.pendingLabel?.length ?? 0);
@@ -57,19 +45,15 @@ function buttonRoom(command, size) {
57
45
  longerLabel * WIDEST_LABEL_CHARACTER);
58
46
  }
59
47
  function commandsRoom(list, record) {
60
- const { besideDots, menuButton, state, dots, opens } = shownCommands(list, record);
61
- const wideDots = dots && !menuButton;
62
- const chevron = opens && !wideDots;
48
+ const { besideDots, state, dots } = shownCommands(list, record);
63
49
  const widths = [
64
50
  ...besideDots.map((command) => buttonRoom(command, "sm")),
65
51
  ...(state?.message.actions ?? []).map((action) => buttonRoom(action, "default")),
66
52
  ];
67
53
  if (widths.length === 0)
68
54
  return DOTS_ALONE_SIZE;
69
- if (wideDots)
55
+ if (dots)
70
56
  widths.push(TOUCH_TARGET);
71
- if (chevron)
72
- widths.push(CHEVRON);
73
57
  const room = CELL_START +
74
58
  widths.reduce((sum, width) => sum + width, 0) +
75
59
  COMMANDS_GAP * (widths.length - 1) +
@@ -158,12 +142,11 @@ function ChecklistCell({ row }) {
158
142
  function CommandsCell({ row }) {
159
143
  const list = useShownList();
160
144
  const record = row.original;
161
- const { besideDots, menuButton, state, dots, opens } = shownCommands(list, record);
145
+ const { besideDots, state, dots } = shownCommands(list, record);
162
146
  const menu = dots ? (_jsx(ActionMenu, { commands: dots.commands, label: dots.label, record: list.name(record).name })) : null;
163
- const chevron = opens ? (_jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 text-muted-foreground" })) : null;
164
- if (besideDots.length === 0 && !state && !menu && !chevron)
147
+ if (besideDots.length === 0 && !state && !menu)
165
148
  return null;
166
- return (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsxs(WideOnly, { children: [besideDots.length > 0 ? (_jsx("div", { className: "flex min-w-0 justify-end gap-2 *:max-w-full *:min-w-0 *:shrink [&>*>span:not([data-icon])]:truncate", children: besideDots.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label))) })) : null, state ? _jsx(RowMessageActions, { state: state }) : null] }), menu && menuButton ? _jsx(CompactOnly, { children: menu }) : menu, chevron && menu && menuButton ? _jsx(WideOnly, { children: chevron }) : null, chevron && !menu ? chevron : null] }));
149
+ return (_jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsxs(WideOnly, { children: [besideDots.length > 0 ? (_jsx("div", { className: "flex min-w-0 justify-end gap-2 *:max-w-full *:min-w-0 *:shrink [&>*>span:not([data-icon])]:truncate", children: besideDots.map((command) => (_jsx(PageCommandButton, { command: command, size: "sm", variant: "outline" }, command.label))) })) : null, state ? _jsx(RowMessageActions, { state: state }) : null] }), menu] }));
167
150
  }
168
151
  function LoadingRecords({ label }) {
169
152
  return (_jsx("div", { "aria-busy": "true", "aria-label": label, className: "divide-y divide-border", role: "status", children: Array.from({ length: 3 }, (_, index) => (_jsxs("div", { className: "flex items-center gap-4 px-2 py-4", children: [_jsx(Skeleton, { className: "shrink-0", height: 32, width: 32 }), _jsxs("div", { className: "grid min-w-0 gap-2", children: [_jsx(Skeleton, { className: "max-w-full", height: 16, width: 160 }), _jsx(Skeleton, { className: "max-w-full", height: 16, width: 224 })] }), _jsx(Skeleton, { className: "ml-auto", height: 16, width: 92 })] }, index))) }));
@@ -293,7 +276,7 @@ function RecordRows(props) {
293
276
  * @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
294
277
  * “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
295
278
  * Ours: Geist's `Table` is a `DataTable`: this list has no visible headings and at most three facts, so a fourth fact is a table, and anything more than a few facts lives on the record's page. A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item`.
296
- * @behaviour One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots or the chevron after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots or the chevron alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout="line"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu of one command that is not destructive, with no row command, is that command's button, except in a `line` row, which keeps it in the three dots as Vercel's project row does, and the column is as wide as the widest such button, so its label is never cut. The commands never take the name's room: once the row is compact, its commands column holds only the three dots or the chevron, a sole menu command stays in the dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, and a row that only opens ends in a muted chevron; a row that opens nothing never reacts to hover. With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list ("Deployment retention is enabled. Learn more", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message.
279
+ * @behaviour One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout="line"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu keeps every command in the three dots, one alone included, as Vercel's Environment Variables and Members rows do: a button stands on a row only where the list names it as `command`, the record's main job, on every row that can do it, so one list never mixes rows ending in a button with rows ending in dots. The commands never take the name's room: once the row is compact, its commands column holds only the three dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Status is only for the exception, empty for the usual record, and its column stands only while a record in the list shows one, so the name and its line keep the room; a fact's column likewise stands only while a record in the list has its value; the commands column likewise stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, with no chevron, as Vercel's Deployments rows open theirs; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list ("Deployment retention is enabled. Learn more", *View recently deleted*). Colour is neutral, the name in ink and every other cell in the body grey, except the status badge and a failed action's message.
297
280
  * “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state)
298
281
  * Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card.
299
282
  * “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)