@nadicodeai/ui 12.1.176 → 12.1.178
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/catalog-categories.d.ts +9 -0
- package/dist/components/catalog-categories.d.ts.map +1 -0
- package/dist/components/catalog-categories.js +36 -0
- package/dist/components/catalog-category.d.ts +16 -0
- package/dist/components/catalog-category.d.ts.map +1 -0
- package/dist/components/catalog-category.js +40 -0
- package/dist/components/catalog-entry.d.ts +1 -1
- package/dist/components/catalog-row.d.ts +61 -0
- package/dist/components/catalog-row.d.ts.map +1 -0
- package/dist/components/catalog-row.js +86 -0
- package/dist/components/collection-page.d.ts +1 -1
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +6 -3
- package/dist/components/identity-mark.d.ts +2 -2
- package/dist/components/identity-mark.d.ts.map +1 -1
- package/dist/components/identity-mark.js +1 -2
- package/dist/components/page-actions.d.ts +9 -1
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +12 -5
- package/dist/components/page-header.d.ts +6 -1
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +4 -1
- package/dist/components/record-list.d.ts +1 -1
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +7 -2
- package/dist/components/sonner.d.ts +5 -2
- package/dist/components/sonner.d.ts.map +1 -1
- package/dist/components/sonner.js +13 -10
- package/dist/components/tag.d.ts +9 -4
- package/dist/components/tag.d.ts.map +1 -1
- package/dist/components/tag.js +24 -4
- package/dist/showcase/specimens/compositions.d.ts +2 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +36 -1
- package/dist/showcase/specimens/feedback.d.ts.map +1 -1
- package/dist/showcase/specimens/feedback.js +1 -1
- package/dist/showcase/specimens/index.d.ts +2 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/status.d.ts +1 -0
- package/dist/showcase/specimens/status.d.ts.map +1 -1
- package/dist/showcase/specimens/status.js +2 -0
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +27 -5
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CatalogIconName } from "./catalog-icons.js";
|
|
2
|
+
/** The categories a hub card names, in the order a filter offers them. */
|
|
3
|
+
export declare const CATALOG_CATEGORIES: readonly ["sales", "finance", "office", "email", "calendar", "documents", "people", "legal", "messaging", "voice", "web", "other"];
|
|
4
|
+
export type CatalogCategory = (typeof CATALOG_CATEGORIES)[number];
|
|
5
|
+
/** Whether a word a hub card wrote is one of the categories, so a card read without the Portal's check draws no label it does not know. */
|
|
6
|
+
export declare function isCatalogCategory(value: string | null | undefined): value is CatalogCategory;
|
|
7
|
+
/** The icon a category names, or null for one with none of its own ("other"). */
|
|
8
|
+
export declare function categoryIconName(category: CatalogCategory): CatalogIconName | null;
|
|
9
|
+
//# sourceMappingURL=catalog-categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-categories.d.ts","sourceRoot":"","sources":["../../src/components/catalog-categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,oIAarB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,2IAA2I;AAC3I,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,KAAK,IAAI,eAAe,CAE5F;AAgBD,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,eAAe,GAAG,IAAI,CAElF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** The categories a hub card names, in the order a filter offers them. */
|
|
2
|
+
export const CATALOG_CATEGORIES = [
|
|
3
|
+
"sales",
|
|
4
|
+
"finance",
|
|
5
|
+
"office",
|
|
6
|
+
"email",
|
|
7
|
+
"calendar",
|
|
8
|
+
"documents",
|
|
9
|
+
"people",
|
|
10
|
+
"legal",
|
|
11
|
+
"messaging",
|
|
12
|
+
"voice",
|
|
13
|
+
"web",
|
|
14
|
+
"other",
|
|
15
|
+
];
|
|
16
|
+
/** Whether a word a hub card wrote is one of the categories, so a card read without the Portal's check draws no label it does not know. */
|
|
17
|
+
export function isCatalogCategory(value) {
|
|
18
|
+
return CATALOG_CATEGORIES.some((category) => category === value);
|
|
19
|
+
}
|
|
20
|
+
const CATEGORY_ICON = {
|
|
21
|
+
sales: "briefcase",
|
|
22
|
+
finance: "receipt",
|
|
23
|
+
office: "list-checks",
|
|
24
|
+
email: "mail",
|
|
25
|
+
calendar: "calendar",
|
|
26
|
+
documents: "file-text",
|
|
27
|
+
people: "users",
|
|
28
|
+
legal: "scale",
|
|
29
|
+
messaging: "message-circle",
|
|
30
|
+
voice: "mic",
|
|
31
|
+
web: "globe",
|
|
32
|
+
};
|
|
33
|
+
/** The icon a category names, or null for one with none of its own ("other"). */
|
|
34
|
+
export function categoryIconName(category) {
|
|
35
|
+
return CATEGORY_ICON[category] ?? null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type CatalogCategory } from "./catalog-categories.js";
|
|
2
|
+
/**
|
|
3
|
+
* A skill's or a plugin's category, as the label on its row.
|
|
4
|
+
*
|
|
5
|
+
* @family Status
|
|
6
|
+
* @when The category a hub card names, on every row that shows a skill or a plugin: the Portal's Library and an Agent's Skills and Plugins, and Nadia's Edit Agent and company skills, so one category reads the same everywhere.
|
|
7
|
+
* @instead A state is a `StatusBadge`; another categorical fact, such as who it is for, is a `Tag` of its own.
|
|
8
|
+
* @behaviour A vivid `Tag` in the category's own tone with the category's icon, the same pair on every surface: sales and web blue, finance green, office purple, email and messaging teal, calendar orange, documents yellow, people and voice pink, legal red, other neutral with no icon.
|
|
9
|
+
* @words The category's name in the product's language, as its filter writes it: "Finance".
|
|
10
|
+
* @access Text; the icon is decorative.
|
|
11
|
+
*/
|
|
12
|
+
export declare function CategoryTag({ category, label }: {
|
|
13
|
+
category: CatalogCategory;
|
|
14
|
+
label: string;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=catalog-category.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-category.d.ts","sourceRoot":"","sources":["../../src/components/catalog-category.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,iCAAiC,CAAC;AA2BzC;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAAE,QAAQ,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,+BAO5F"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CATALOG_CATEGORIES, categoryIconName, } from "./catalog-categories.js";
|
|
3
|
+
import { catalogIcon } from "./catalog-entry.js";
|
|
4
|
+
import { Tag } from "./tag.js";
|
|
5
|
+
const CATEGORY_TONE = {
|
|
6
|
+
sales: "blue",
|
|
7
|
+
finance: "green",
|
|
8
|
+
office: "purple",
|
|
9
|
+
email: "teal",
|
|
10
|
+
calendar: "orange",
|
|
11
|
+
documents: "yellow",
|
|
12
|
+
people: "pink",
|
|
13
|
+
legal: "red",
|
|
14
|
+
messaging: "teal",
|
|
15
|
+
voice: "pink",
|
|
16
|
+
web: "blue",
|
|
17
|
+
other: "neutral",
|
|
18
|
+
};
|
|
19
|
+
const CATEGORY_MARK = {};
|
|
20
|
+
for (const category of CATALOG_CATEGORIES) {
|
|
21
|
+
const icon = categoryIconName(category);
|
|
22
|
+
if (!icon)
|
|
23
|
+
continue;
|
|
24
|
+
const Icon = catalogIcon(icon, "skill");
|
|
25
|
+
CATEGORY_MARK[category] = _jsx(Icon, { "aria-hidden": "true" });
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A skill's or a plugin's category, as the label on its row.
|
|
29
|
+
*
|
|
30
|
+
* @family Status
|
|
31
|
+
* @when The category a hub card names, on every row that shows a skill or a plugin: the Portal's Library and an Agent's Skills and Plugins, and Nadia's Edit Agent and company skills, so one category reads the same everywhere.
|
|
32
|
+
* @instead A state is a `StatusBadge`; another categorical fact, such as who it is for, is a `Tag` of its own.
|
|
33
|
+
* @behaviour A vivid `Tag` in the category's own tone with the category's icon, the same pair on every surface: sales and web blue, finance green, office purple, email and messaging teal, calendar orange, documents yellow, people and voice pink, legal red, other neutral with no icon.
|
|
34
|
+
* @words The category's name in the product's language, as its filter writes it: "Finance".
|
|
35
|
+
* @access Text; the icon is decorative.
|
|
36
|
+
*/
|
|
37
|
+
export function CategoryTag({ category, label }) {
|
|
38
|
+
const mark = CATEGORY_MARK[category];
|
|
39
|
+
return (_jsx(Tag, { ...(mark ? { mark } : {}), tone: CATEGORY_TONE[category], vivid: true, children: label }));
|
|
40
|
+
}
|
|
@@ -24,7 +24,7 @@ export type CatalogEntryAdd = PageCommand & {
|
|
|
24
24
|
* @family Data
|
|
25
25
|
* @when A reusable thing a person can add: a skill, a plugin or an app, on a Library shelf (`LibraryShelf`) or in the drawer that adds one to an Agent (`CatalogDrawer`).
|
|
26
26
|
* @instead A record the person already holds is a row of its collection (`CollectionPage`). An Agent template is its `AgentCard`. Figures compared across entries are a `DataTable`.
|
|
27
|
-
* @behaviour The kind's tile at 40: a skill's own icon on the neutral ringed tile,
|
|
27
|
+
* @behaviour The kind's tile at 40: a skill's or a plugin's own icon on the neutral ringed tile, an app's own logo. The name is the link to its own page. One Add control, outline with a leading plus; once held, a muted check and `added`'s word take its place. A menu of one command that is not destructive, with no Add, is that command's outline button; otherwise the three dots. A failed or refused add puts its message in the line's place, with its retry before the entry's own controls.
|
|
28
28
|
* @words The name as the catalogue gives it; one line saying what it does, a sentence: "Classifies incoming requests and prepares the next step." The control is a verb: "Add".
|
|
29
29
|
* @access The tile is decorative; the name is the link's text. A failed add's message is announced as an alert.
|
|
30
30
|
*/
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type CatalogCategory } from "./catalog-categories.js";
|
|
2
|
+
import type { CollectionFilterCopy, CollectionFiltersProps } from "./collection-filters.js";
|
|
3
|
+
import type { RecordFact, RecordFacts, RecordName } from "./record-list.js";
|
|
4
|
+
/** 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 = {
|
|
6
|
+
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. */
|
|
8
|
+
detail?: string | undefined;
|
|
9
|
+
/** The icon its catalog card names; none draws its kind's own. A server always draws the server icon. */
|
|
10
|
+
icon?: string | null | undefined;
|
|
11
|
+
/** The category its catalog card names; none draws no label. */
|
|
12
|
+
category?: CatalogCategory | null | undefined;
|
|
13
|
+
/** Where it came from, in the product's words: "From the Library", "Added in Nadia". */
|
|
14
|
+
source: string;
|
|
15
|
+
};
|
|
16
|
+
export type CatalogRowKind = "skill" | "plugin" | "server";
|
|
17
|
+
/** The product's words for the row's columns and its category filter. */
|
|
18
|
+
export type CatalogRowWords = {
|
|
19
|
+
category: string;
|
|
20
|
+
allCategories: string;
|
|
21
|
+
categoryName: (category: CatalogCategory) => string;
|
|
22
|
+
source: string;
|
|
23
|
+
filter: CollectionFilterCopy;
|
|
24
|
+
};
|
|
25
|
+
/** The shared row's parts a screen spreads into its `CollectionPage`. */
|
|
26
|
+
export type CatalogRows<TRecord> = {
|
|
27
|
+
list: {
|
|
28
|
+
name: (record: TRecord) => RecordName;
|
|
29
|
+
facts: RecordFacts<TRecord>;
|
|
30
|
+
wraps: true;
|
|
31
|
+
};
|
|
32
|
+
filters: CollectionFiltersProps | undefined;
|
|
33
|
+
keep: (rows: readonly TRecord[]) => TRecord[];
|
|
34
|
+
narrowed: boolean;
|
|
35
|
+
clear: () => void;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 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
|
+
* Nadia's Edit Agent and company skills: the screen says what each record is, this draws it, and the screen keeps its own
|
|
40
|
+
* commands, menu, status and editor.
|
|
41
|
+
*
|
|
42
|
+
* @family Compositions
|
|
43
|
+
* @when A `CollectionPage` of skills, plugins or MCP servers. The screen calls it with its records, what each one is
|
|
44
|
+
* (`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.
|
|
46
|
+
* @instead Any other record is the page's own `RecordList` row. The Library's add-from drawer is `CatalogDrawer`; a
|
|
47
|
+
* category on its own is `CategoryTag`.
|
|
48
|
+
* @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.
|
|
57
|
+
*/
|
|
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. */
|
|
60
|
+
extra?: RecordFact<TRecord>): CatalogRows<TRecord>;
|
|
61
|
+
//# sourceMappingURL=catalog-row.d.ts.map
|
|
@@ -0,0 +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;IAChE,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3D,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,WAAW,CAAC,OAAO,IAAI;IACjC,IAAI,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,CAAC;QAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;QAAC,KAAK,EAAE,IAAI,CAAA;KAAE,CAAC;IAC1F,OAAO,EAAE,sBAAsB,GAAG,SAAS,CAAC;IAC5C,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EACpC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,SAAS,EACvC,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,EACtC,KAAK,EAAE,eAAe;AACtB,oGAAoG;AACpG,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAC1B,WAAW,CAAC,OAAO,CAAC,CA0DtB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Server } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { CATALOG_CATEGORIES } from "./catalog-categories.js";
|
|
6
|
+
import { CategoryTag } from "./catalog-category.js";
|
|
7
|
+
import { catalogIcon } from "./catalog-entry.js";
|
|
8
|
+
/**
|
|
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.
|
|
28
|
+
*/
|
|
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) {
|
|
32
|
+
const [category, setCategory] = useState("");
|
|
33
|
+
const held = CATALOG_CATEGORIES.filter((each) => records?.some((record) => rowOf(record).category === each) ?? false);
|
|
34
|
+
const chosen = held.find((each) => each === category) ?? "";
|
|
35
|
+
const narrowed = held.length > 1 && chosen !== "";
|
|
36
|
+
const filters = held.length > 1
|
|
37
|
+
? {
|
|
38
|
+
copy: words.filter,
|
|
39
|
+
facets: [
|
|
40
|
+
{
|
|
41
|
+
label: words.category,
|
|
42
|
+
allLabel: words.allCategories,
|
|
43
|
+
value: chosen,
|
|
44
|
+
onValueChange: setCategory,
|
|
45
|
+
options: held.map((value) => ({ value, label: words.categoryName(value) })),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
}
|
|
49
|
+
: undefined;
|
|
50
|
+
const name = (record) => {
|
|
51
|
+
const row = rowOf(record);
|
|
52
|
+
const shown = {
|
|
53
|
+
name: row.name,
|
|
54
|
+
mark: { kind: "record", icon: kind === "server" ? Server : catalogIcon(row.icon, kind) },
|
|
55
|
+
};
|
|
56
|
+
if (row.detail)
|
|
57
|
+
shown.detail = row.detail;
|
|
58
|
+
return shown;
|
|
59
|
+
};
|
|
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,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "source",
|
|
72
|
+
label: words.source,
|
|
73
|
+
of: (record) => rowOf(record).source,
|
|
74
|
+
size: 200,
|
|
75
|
+
wraps: true,
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const facts = extra ? [...shared, extra] : shared;
|
|
79
|
+
return {
|
|
80
|
+
list: { name, facts, wraps: true },
|
|
81
|
+
filters,
|
|
82
|
+
keep: (rows) => narrowed ? rows.filter((row) => rowOf(row).category === chosen) : [...rows],
|
|
83
|
+
narrowed,
|
|
84
|
+
clear: () => setCategory(""),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -52,7 +52,7 @@ export type CollectionPageProps<TRecord extends RowData> = RecordListWithout<TRe
|
|
|
52
52
|
* Ours: Customers and Partners use the full-width list, with actionable attention above the toolbar when present. Business summaries belong on Dashboard and Analytics. A rail remains available for context that belongs to the collection itself, such as the selected Library hub.
|
|
53
53
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
54
54
|
* Ours: records compared across columns, read by their headings, are a `DataTable` under the page's own title and toolbar. A list inside another page's section is a `RecordList` with its `heading`.
|
|
55
|
-
* @behaviour With a `rail`, the toolbar spans the page and under it stand two columns from 1280 px: the rail, 300 px, then the records' card, its top level with the rail's first title and named by the page's title alone, never a second heading, and the records' rows are `RecordList`'s `line` rows; below 1280 px the records come first and the rail follows them. Each rail card has its title above it at 16 px, an optional 44 px muted summary row with its one outline button at its end (a button never stands in a row of its own, so a card with an `action` has a `summary`), then its items: a figure is one 36 px row, its title and its number at the trailing edge; a record is its 24 px mark, a title over a muted line that wraps to a second before it is cut, and a figure or a status at its end, the whole item opening its record; a card with no items draws its `empty` inside it as one 44 px row like an item. While the rail's read is in flight a card's `items` are undefined and it holds its place with three placeholder lines, so the two columns stand from the first frame; a rail whose read `failed` is one card saying so, and the records beside it stay. Under the title sits only the `description`, when the collection's kind needs explaining; otherwise nothing. The title row holds at most one secondary, the primary, then the three dots, which open only for two commands or more. The primary stays in the title row whether the collection is empty or not, filled, as Vercel's Flags keeps Create Flag; a first use repeats it as the filled button in its card. One toolbar holds the search, which grows, then the filters, then the sort; it shows while there are records or a search or filter is set, and is glass only where the rows scroll under it. While a new search, filter or sort is read, the toolbar is busy and, after a second, shows the one waiting line, while the last rows stay. The rows, their states and their loading are the RecordList's; no match is offered only while a search or filter is set.
|
|
55
|
+
* @behaviour Title or none, as Vercel decides it: a page that is one plain list of things a person makes, whose concept needs no sentence, such as Vercel's Domains, Storage, Projects and AI Gateway's API Keys, has no title row, and its actions (its create buttons) end its search row, after the filters. A page that needs its one sentence, or whose commands do something other than create, such as Environment Variables, Members, Integrations and Deployments, keeps its title row with the sentence and every action on it. The product says which a page is (`PageActionsHostProvider`'s `titled`, or this composition's own `title`), never what the page shows at the moment, so an issue appearing above the list never moves the actions. With a `rail`, the toolbar spans the page and under it stand two columns from 1280 px: the rail, 300 px, then the records' card, its top level with the rail's first title and named by the page's title alone, never a second heading, and the records' rows are `RecordList`'s `line` rows; below 1280 px the records come first and the rail follows them. Each rail card has its title above it at 16 px, an optional 44 px muted summary row with its one outline button at its end (a button never stands in a row of its own, so a card with an `action` has a `summary`), then its items: a figure is one 36 px row, its title and its number at the trailing edge; a record is its 24 px mark, a title over a muted line that wraps to a second before it is cut, and a figure or a status at its end, the whole item opening its record; a card with no items draws its `empty` inside it as one 44 px row like an item. While the rail's read is in flight a card's `items` are undefined and it holds its place with three placeholder lines, so the two columns stand from the first frame; a rail whose read `failed` is one card saying so, and the records beside it stay. Under the title sits only the `description`, when the collection's kind needs explaining; otherwise nothing. The title row holds at most one secondary, the primary, then the three dots, which open only for two commands or more. The primary stays in the title row whether the collection is empty or not, filled, as Vercel's Flags keeps Create Flag; a first use repeats it as the filled button in its card. One toolbar holds the search, which grows, then the filters, then the sort; it shows while there are records or a search or filter is set, and is glass only where the rows scroll under it. While a new search, filter or sort is read, the toolbar is busy and, after a second, shows the one waiting line, while the last rows stay. The rows, their states and their loading are the RecordList's; no match is offered only while a search or filter is set.
|
|
56
56
|
* @words “For multi-facet filters use the plural template `No {Items} Match Your Filters` and suggest widening or clearing.” (https://vercel.com/geist/empty-state)
|
|
57
57
|
* Ours: every string is the product's, in sentence case. The title names the collection in the plural ("Agents"); the search says what it finds ("Find a skill"); no match says what found nothing and offers to clear it ("Clear search", "Clear filters").
|
|
58
58
|
* @access “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)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-page.d.ts","sourceRoot":"","sources":["../../src/components/collection-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,
|
|
1
|
+
{"version":3,"file":"collection-page.d.ts","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AkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC,iDAAiD;IACjD,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD,oGAAoG;IACpG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEJ;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,+BA+D1F"}
|
|
@@ -4,7 +4,7 @@ import { CollectionFilters } from "./collection-filters.js";
|
|
|
4
4
|
import { CollectionSearch } from "./collection-search.js";
|
|
5
5
|
import { CollectionSort } from "./collection-sort.js";
|
|
6
6
|
import { CollectionToolbar } from "./collection-toolbar.js";
|
|
7
|
-
import { PageActions, PageActionsHostProvider, } from "./page-actions.js";
|
|
7
|
+
import { CardActionsRow, PageActions, PageActionsHostProvider, usePageTitled, } from "./page-actions.js";
|
|
8
8
|
import { PageHeader } from "./page-header.js";
|
|
9
9
|
import { RecordList } from "./record-list.js";
|
|
10
10
|
import { WaitingLine } from "./waiting-line.js";
|
|
@@ -20,7 +20,7 @@ import { CollectionRailColumn } from "../internal/collection-rail.js";
|
|
|
20
20
|
* Ours: Customers and Partners use the full-width list, with actionable attention above the toolbar when present. Business summaries belong on Dashboard and Analytics. A rail remains available for context that belongs to the collection itself, such as the selected Library hub.
|
|
21
21
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
22
22
|
* Ours: records compared across columns, read by their headings, are a `DataTable` under the page's own title and toolbar. A list inside another page's section is a `RecordList` with its `heading`.
|
|
23
|
-
* @behaviour With a `rail`, the toolbar spans the page and under it stand two columns from 1280 px: the rail, 300 px, then the records' card, its top level with the rail's first title and named by the page's title alone, never a second heading, and the records' rows are `RecordList`'s `line` rows; below 1280 px the records come first and the rail follows them. Each rail card has its title above it at 16 px, an optional 44 px muted summary row with its one outline button at its end (a button never stands in a row of its own, so a card with an `action` has a `summary`), then its items: a figure is one 36 px row, its title and its number at the trailing edge; a record is its 24 px mark, a title over a muted line that wraps to a second before it is cut, and a figure or a status at its end, the whole item opening its record; a card with no items draws its `empty` inside it as one 44 px row like an item. While the rail's read is in flight a card's `items` are undefined and it holds its place with three placeholder lines, so the two columns stand from the first frame; a rail whose read `failed` is one card saying so, and the records beside it stay. Under the title sits only the `description`, when the collection's kind needs explaining; otherwise nothing. The title row holds at most one secondary, the primary, then the three dots, which open only for two commands or more. The primary stays in the title row whether the collection is empty or not, filled, as Vercel's Flags keeps Create Flag; a first use repeats it as the filled button in its card. One toolbar holds the search, which grows, then the filters, then the sort; it shows while there are records or a search or filter is set, and is glass only where the rows scroll under it. While a new search, filter or sort is read, the toolbar is busy and, after a second, shows the one waiting line, while the last rows stay. The rows, their states and their loading are the RecordList's; no match is offered only while a search or filter is set.
|
|
23
|
+
* @behaviour Title or none, as Vercel decides it: a page that is one plain list of things a person makes, whose concept needs no sentence, such as Vercel's Domains, Storage, Projects and AI Gateway's API Keys, has no title row, and its actions (its create buttons) end its search row, after the filters. A page that needs its one sentence, or whose commands do something other than create, such as Environment Variables, Members, Integrations and Deployments, keeps its title row with the sentence and every action on it. The product says which a page is (`PageActionsHostProvider`'s `titled`, or this composition's own `title`), never what the page shows at the moment, so an issue appearing above the list never moves the actions. With a `rail`, the toolbar spans the page and under it stand two columns from 1280 px: the rail, 300 px, then the records' card, its top level with the rail's first title and named by the page's title alone, never a second heading, and the records' rows are `RecordList`'s `line` rows; below 1280 px the records come first and the rail follows them. Each rail card has its title above it at 16 px, an optional 44 px muted summary row with its one outline button at its end (a button never stands in a row of its own, so a card with an `action` has a `summary`), then its items: a figure is one 36 px row, its title and its number at the trailing edge; a record is its 24 px mark, a title over a muted line that wraps to a second before it is cut, and a figure or a status at its end, the whole item opening its record; a card with no items draws its `empty` inside it as one 44 px row like an item. While the rail's read is in flight a card's `items` are undefined and it holds its place with three placeholder lines, so the two columns stand from the first frame; a rail whose read `failed` is one card saying so, and the records beside it stay. Under the title sits only the `description`, when the collection's kind needs explaining; otherwise nothing. The title row holds at most one secondary, the primary, then the three dots, which open only for two commands or more. The primary stays in the title row whether the collection is empty or not, filled, as Vercel's Flags keeps Create Flag; a first use repeats it as the filled button in its card. One toolbar holds the search, which grows, then the filters, then the sort; it shows while there are records or a search or filter is set, and is glass only where the rows scroll under it. While a new search, filter or sort is read, the toolbar is busy and, after a second, shows the one waiting line, while the last rows stay. The rows, their states and their loading are the RecordList's; no match is offered only while a search or filter is set.
|
|
24
24
|
* @words “For multi-facet filters use the plural template `No {Items} Match Your Filters` and suggest widening or clearing.” (https://vercel.com/geist/empty-state)
|
|
25
25
|
* Ours: every string is the product's, in sentence case. The title names the collection in the plural ("Agents"); the search says what it finds ("Find a skill"); no match says what found nothing and offers to clear it ("Clear search", "Clear filters").
|
|
26
26
|
* @access “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)
|
|
@@ -28,8 +28,11 @@ import { CollectionRailColumn } from "../internal/collection-rail.js";
|
|
|
28
28
|
*/
|
|
29
29
|
export function CollectionPage(props) {
|
|
30
30
|
const { title, description, actions, tabs, attention, search, filters, sort, toolbarSurface, noMatch, pending, rail, ...list } = props;
|
|
31
|
+
const hostTitled = usePageTitled();
|
|
32
|
+
const titled = Boolean(title) || hostTitled;
|
|
33
|
+
const toolbarActions = actions && !titled ? _jsx(CardActionsRow, { ...actions }) : null;
|
|
31
34
|
const hasRecords = list.records !== undefined && list.records.length > 0;
|
|
32
35
|
const narrowed = Boolean(search?.value) || (filters?.facets.some((facet) => facet.value) ?? false);
|
|
33
|
-
const page = (_jsxs("div", { className: "grid min-w-0 gap-4", "data-slot": "collection-page", children: [title ? _jsx(PageHeader, { description: description, title: title }) : null, actions ? _jsx(PageActions, { ...actions }) : null, tabs, attention, (search || filters || sort) && (hasRecords || narrowed) ? (_jsx(CollectionToolbar, { actions: filters || sort ? (_jsxs(_Fragment, { children: [filters ? _jsx(CollectionFilters, { ...filters }) : null, sort ? _jsx(CollectionSort, { ...sort }) : null] })) : undefined, "aria-busy": pending ? true : undefined, label: list.label, search: search ? _jsx(CollectionSearch, { ...search }) : undefined, status: _jsx(WaitingLine, { className: "w-24", decorative: true, waiting: pending === true }), surface: toolbarSurface ?? "plain" })) : null, rail ? (_jsxs("div", { className: "grid min-w-0 gap-6 xl:grid-cols-[18.75rem_minmax(0,1fr)] xl:items-start", "data-slot": "collection-columns", children: [_jsx("div", { className: "min-w-0 xl:col-start-2 xl:row-start-1", children: _jsx(RecordList, { ...list, layout: "line", noMatch: narrowed ? noMatch : undefined }) }), _jsx(CollectionRailColumn, { className: "xl:col-start-1 xl:row-start-1", rail: rail })] })) : (_jsx(RecordList, { ...list, noMatch: narrowed ? noMatch : undefined }))] }));
|
|
36
|
+
const page = (_jsxs("div", { className: "grid min-w-0 gap-4", "data-slot": "collection-page", children: [title ? _jsx(PageHeader, { description: description, title: title }) : null, actions && titled ? _jsx(PageActions, { ...actions }) : null, tabs, attention, ((search || filters || sort) && (hasRecords || narrowed)) || toolbarActions ? (_jsx(CollectionToolbar, { actions: filters || sort || toolbarActions ? (_jsxs(_Fragment, { children: [filters && (hasRecords || narrowed) ? _jsx(CollectionFilters, { ...filters }) : null, sort && (hasRecords || narrowed) ? _jsx(CollectionSort, { ...sort }) : null, toolbarActions] })) : undefined, "aria-busy": pending ? true : undefined, label: list.label, search: search && (hasRecords || narrowed) ? _jsx(CollectionSearch, { ...search }) : undefined, status: _jsx(WaitingLine, { className: "w-24", decorative: true, waiting: pending === true }), surface: toolbarSurface ?? "plain" })) : null, rail ? (_jsxs("div", { className: "grid min-w-0 gap-6 xl:grid-cols-[18.75rem_minmax(0,1fr)] xl:items-start", "data-slot": "collection-columns", children: [_jsx("div", { className: "min-w-0 xl:col-start-2 xl:row-start-1", children: _jsx(RecordList, { ...list, layout: "line", noMatch: narrowed ? noMatch : undefined }) }), _jsx(CollectionRailColumn, { className: "xl:col-start-1 xl:row-start-1", rail: rail })] })) : (_jsx(RecordList, { ...list, noMatch: narrowed ? noMatch : undefined }))] }));
|
|
34
37
|
return title ? _jsx(PageActionsHostProvider, { children: page }) : page;
|
|
35
38
|
}
|
|
@@ -45,7 +45,7 @@ export type IdentityMarkProps = {
|
|
|
45
45
|
/** The record's own icon when it names one, as a skill does in its hub card; otherwise its kind's, the one its section has in the navigation: Mail for a mailbox. */
|
|
46
46
|
icon: IconComponent;
|
|
47
47
|
/** A catalogue kind's ground; neutral is the ringed card ground. */
|
|
48
|
-
tone?: "neutral" | "
|
|
48
|
+
tone?: "neutral" | "teal";
|
|
49
49
|
/** The record's own object picture, a transparent image drawn on its kind's ground in place of the icon at 64; smaller marks draw the icon. */
|
|
50
50
|
picture?: string;
|
|
51
51
|
});
|
|
@@ -58,7 +58,7 @@ export type IdentityMarkProps = {
|
|
|
58
58
|
* @family Status
|
|
59
59
|
* @when The first thing in a record's row (32), at the head of its object page (64), in a feed or a sidebar identity line (24), on a Library entry (40), for the company at the top of Nadia's list (28): wherever it tells a person which thing they are looking at.
|
|
60
60
|
* @instead An icon beside a card's title, a KPI's label or a section heading only repeats the words and is left out. A picture for a first use or a whole-page moment is the empty state's or the page's own. A model is its `ModelIdentity`; a maker's mark beside a model's name in a list of models is `ModelMark` at 24.
|
|
61
|
-
* @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her real orb from the orb engine, at the largest orb size not above the mark's, with no tile and no ring, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo in its bordered tile on the page ground, or its first letter when it has no logo; a record that belongs to a model maker, such as a key held at that maker, is the maker's `ModelMark` at the mark's size, with its initials when LobeHub has no mark for it; a company is its own logo, contained whole in its original colours and proportions on a dark ringed tile, as Vercel shows a project's favicon, and until a logo is found, or when the stored logo does not load, its initials in white on that same tile, so a found logo only replaces the letters; a company's mark is the same whatever its standing and whichever directory opened it, and a Partner is said in words where its standing matters, never by a colour; a person is their picture, then their initials, in a round mark; a record with no picture of its own takes its kind's own icon, the same icon its section has in the navigation (Mail for a mailbox, a server for an MCP server, a key for a password), in a ringed tile on the card ground; a skill takes the icon its hub card names, and the Skills icon when it names none, on that same neutral ringed tile, so the icon alone tells one skill from another and no colour stands for the kind; a plugin takes the
|
|
61
|
+
* @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her real orb from the orb engine, at the largest orb size not above the mark's, with no tile and no ring, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo in its bordered tile on the page ground, or its first letter when it has no logo; a record that belongs to a model maker, such as a key held at that maker, is the maker's `ModelMark` at the mark's size, with its initials when LobeHub has no mark for it; a company is its own logo, contained whole in its original colours and proportions on a dark ringed tile, as Vercel shows a project's favicon, and until a logo is found, or when the stored logo does not load, its initials in white on that same tile, so a found logo only replaces the letters; a company's mark is the same whatever its standing and whichever directory opened it, and a Partner is said in words where its standing matters, never by a colour; a person is their picture, then their initials, in a round mark; a record with no picture of its own takes its kind's own icon, the same icon its section has in the navigation (Mail for a mailbox, a server for an MCP server, a key for a password), in a ringed tile on the card ground; a skill takes the icon its hub card names, and the Skills icon when it names none, on that same neutral ringed tile, so the icon alone tells one skill from another and no colour stands for the kind; a plugin likewise takes the icon its hub card names, and the Plugins icon when it names none, on the same neutral ringed tile, since the colour of a Library row is its category label's alone; a record's own object picture, such as a Library skill's or plugin's, is drawn only at 64, at the head of its own page, on its kind's ground in the icon's place, because at a row's size its detail does not read. A record tile takes `{rounded.sm}` (6 px) corners, `{rounded.md}` (8 px) at 40 and 64; a company's tile and an app's tile take `{rounded.md}` at every size.
|
|
62
62
|
* @words None of its own: the record's name stands beside it. Initials stand for a company or a person: the first letters of the name's first two words. An app with no logo takes the first letter of its name as a monogram, a model maker with no mark the initials of its slug, and no other kind takes letters.
|
|
63
63
|
* @access Decorative beside the record's name. Alone, as in a narrow rail, `label` names it.
|
|
64
64
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-mark.d.ts","sourceRoot":"","sources":["../../src/components/identity-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAMnE,MAAM,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE3D,qHAAqH;AACrH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4GAA4G;IAC5G,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,4GAA4G;IAC5G,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,CACA;IACE,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,aAAa,CAAA;KAAE,CAAC;IACrF,kGAAkG;IAClG,KAAK,CA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ring-border ring-inset",
|
|
18
|
-
plugin: "bg-info-soft text-info-soft-foreground",
|
|
19
18
|
teal: "bg-category-teal text-category-teal-foreground",
|
|
20
19
|
};
|
|
21
20
|
function naming(label) {
|
|
@@ -38,7 +37,7 @@ function RecordTile({ label, size, tone, children, }) {
|
|
|
38
37
|
* @family Status
|
|
39
38
|
* @when The first thing in a record's row (32), at the head of its object page (64), in a feed or a sidebar identity line (24), on a Library entry (40), for the company at the top of Nadia's list (28): wherever it tells a person which thing they are looking at.
|
|
40
39
|
* @instead An icon beside a card's title, a KPI's label or a section heading only repeats the words and is left out. A picture for a first use or a whole-page moment is the empty state's or the page's own. A model is its `ModelIdentity`; a maker's mark beside a model's name in a list of models is `ModelMark` at 24.
|
|
41
|
-
* @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her real orb from the orb engine, at the largest orb size not above the mark's, with no tile and no ring, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo in its bordered tile on the page ground, or its first letter when it has no logo; a record that belongs to a model maker, such as a key held at that maker, is the maker's `ModelMark` at the mark's size, with its initials when LobeHub has no mark for it; a company is its own logo, contained whole in its original colours and proportions on a dark ringed tile, as Vercel shows a project's favicon, and until a logo is found, or when the stored logo does not load, its initials in white on that same tile, so a found logo only replaces the letters; a company's mark is the same whatever its standing and whichever directory opened it, and a Partner is said in words where its standing matters, never by a colour; a person is their picture, then their initials, in a round mark; a record with no picture of its own takes its kind's own icon, the same icon its section has in the navigation (Mail for a mailbox, a server for an MCP server, a key for a password), in a ringed tile on the card ground; a skill takes the icon its hub card names, and the Skills icon when it names none, on that same neutral ringed tile, so the icon alone tells one skill from another and no colour stands for the kind; a plugin takes the
|
|
40
|
+
* @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her real orb from the orb engine, at the largest orb size not above the mark's, with no tile and no ring, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo in its bordered tile on the page ground, or its first letter when it has no logo; a record that belongs to a model maker, such as a key held at that maker, is the maker's `ModelMark` at the mark's size, with its initials when LobeHub has no mark for it; a company is its own logo, contained whole in its original colours and proportions on a dark ringed tile, as Vercel shows a project's favicon, and until a logo is found, or when the stored logo does not load, its initials in white on that same tile, so a found logo only replaces the letters; a company's mark is the same whatever its standing and whichever directory opened it, and a Partner is said in words where its standing matters, never by a colour; a person is their picture, then their initials, in a round mark; a record with no picture of its own takes its kind's own icon, the same icon its section has in the navigation (Mail for a mailbox, a server for an MCP server, a key for a password), in a ringed tile on the card ground; a skill takes the icon its hub card names, and the Skills icon when it names none, on that same neutral ringed tile, so the icon alone tells one skill from another and no colour stands for the kind; a plugin likewise takes the icon its hub card names, and the Plugins icon when it names none, on the same neutral ringed tile, since the colour of a Library row is its category label's alone; a record's own object picture, such as a Library skill's or plugin's, is drawn only at 64, at the head of its own page, on its kind's ground in the icon's place, because at a row's size its detail does not read. A record tile takes `{rounded.sm}` (6 px) corners, `{rounded.md}` (8 px) at 40 and 64; a company's tile and an app's tile take `{rounded.md}` at every size.
|
|
42
41
|
* @words None of its own: the record's name stands beside it. Initials stand for a company or a person: the first letters of the name's first two words. An app with no logo takes the first letter of its name as a monogram, a model maker with no mark the initials of its slug, and no other kind takes letters.
|
|
43
42
|
* @access Decorative beside the record's name. Alone, as in a narrow rail, `label` names it.
|
|
44
43
|
*/
|
|
@@ -107,9 +107,17 @@ export declare function PageActionsRow({ period, primary, secondary, menu }: Pag
|
|
|
107
107
|
* server HTML is still streaming makes React render that page again in the
|
|
108
108
|
* browser, beside the server's copy.
|
|
109
109
|
*/
|
|
110
|
-
export declare function PageActionsHostProvider({ children }: {
|
|
110
|
+
export declare function PageActionsHostProvider({ children, titled, }: {
|
|
111
111
|
children: ReactNode;
|
|
112
|
+
/**
|
|
113
|
+
* Whether the product drew a title row above this page. A page that is one plain list of things
|
|
114
|
+
* a person makes has none, as Vercel's Domains and Storage have none, and its actions stand at
|
|
115
|
+
* the end of its search row instead (`CollectionPage`).
|
|
116
|
+
*/
|
|
117
|
+
titled?: boolean;
|
|
112
118
|
}): import("react").JSX.Element;
|
|
119
|
+
/** Whether the page has a title row its actions go on; false outside a host or on an untitled page. */
|
|
120
|
+
export declare function usePageTitled(): boolean;
|
|
113
121
|
/** The element on `PageHeader`'s title row that the page's `PageActions` render into. */
|
|
114
122
|
export declare function PageActionsSlot(): import("react").JSX.Element;
|
|
115
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/components/page-actions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/components/page-actions.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAMf,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAGpE,MAAM,MAAM,iBAAiB,GACzB;IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE;AACrF;;;GAGG;GACD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE;AACzD;;;GAGG;GACD;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE5D,uGAAuG;AACvG,MAAM,MAAM,WAAW,GACnB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AgB,eAAe,gCAS9B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,sCA6BlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ArrowUpRight } from "lucide-react";
|
|
4
|
-
import { createContext, isValidElement, useContext, useEffect, useId, useState, } from "react";
|
|
4
|
+
import { createContext, isValidElement, useContext, useEffect, useId, useLayoutEffect, useState, } from "react";
|
|
5
5
|
import { createPortal } from "react-dom";
|
|
6
6
|
import { createStore, useStore } from "zustand";
|
|
7
7
|
import { MenuCommandRow } from "../internal/record-menu-items.js";
|
|
@@ -55,8 +55,9 @@ export function PageActionsRow({ period, primary, secondary, menu }) {
|
|
|
55
55
|
return null;
|
|
56
56
|
return (_jsxs("div", { "data-slot": "page-actions", className: "flex max-w-full min-w-0 flex-wrap items-center gap-2", children: [period, secondary ? _jsx(PageCommandButton, { command: secondary, variant: "outline" }) : null, primary ? _jsx(PageCommandButton, { command: primary, variant: "default" }) : null, menu ? _jsx(ActionMenu, { ...menu }) : null] }));
|
|
57
57
|
}
|
|
58
|
-
function createHost() {
|
|
58
|
+
function createHost(titled = true) {
|
|
59
59
|
return createStore((set) => ({
|
|
60
|
+
titled,
|
|
60
61
|
element: null,
|
|
61
62
|
owner: null,
|
|
62
63
|
attach: (element) => set({ element }),
|
|
@@ -64,7 +65,7 @@ function createHost() {
|
|
|
64
65
|
release: (owner) => set((state) => (state.owner === owner ? { owner: null } : state)),
|
|
65
66
|
}));
|
|
66
67
|
}
|
|
67
|
-
const unhosted = createHost();
|
|
68
|
+
const unhosted = createHost(false);
|
|
68
69
|
const PageActionsHostContext = createContext(null);
|
|
69
70
|
/**
|
|
70
71
|
* Holds the place on the title's row where the open page puts its actions. The
|
|
@@ -75,10 +76,16 @@ const PageActionsHostContext = createContext(null);
|
|
|
75
76
|
* server HTML is still streaming makes React render that page again in the
|
|
76
77
|
* browser, beside the server's copy.
|
|
77
78
|
*/
|
|
78
|
-
export function PageActionsHostProvider({ children }) {
|
|
79
|
-
const [host] = useState(createHost);
|
|
79
|
+
export function PageActionsHostProvider({ children, titled = true, }) {
|
|
80
|
+
const [host] = useState(() => createHost(titled));
|
|
81
|
+
useLayoutEffect(() => host.setState({ titled }), [host, titled]);
|
|
80
82
|
return _jsx(PageActionsHostContext, { value: host, children: children });
|
|
81
83
|
}
|
|
84
|
+
/** Whether the page has a title row its actions go on; false outside a host or on an untitled page. */
|
|
85
|
+
export function usePageTitled() {
|
|
86
|
+
const host = useContext(PageActionsHostContext);
|
|
87
|
+
return useStore(host ?? unhosted, (state) => state.titled);
|
|
88
|
+
}
|
|
82
89
|
/** The element on `PageHeader`'s title row that the page's `PageActions` render into. */
|
|
83
90
|
export function PageActionsSlot() {
|
|
84
91
|
const host = useContext(PageActionsHostContext);
|
|
@@ -17,11 +17,16 @@ import * as React from "react";
|
|
|
17
17
|
* description is one sentence in the product's words, without a full stop when it ends in a link.
|
|
18
18
|
* @access The title is the page's `h1`; DOM order is visual order.
|
|
19
19
|
*/
|
|
20
|
-
declare function PageHeader({ title, description, headingProps, className, ...props }: Omit<React.ComponentProps<"header">, "title" | "children"> & {
|
|
20
|
+
declare function PageHeader({ title, description, headingProps, className, unseen, ...props }: Omit<React.ComponentProps<"header">, "title" | "children"> & {
|
|
21
21
|
title: React.ReactNode;
|
|
22
22
|
/** One muted line under the title; a link to learn more may end it. */
|
|
23
23
|
description?: React.ReactNode;
|
|
24
24
|
headingProps?: Omit<React.ComponentProps<"h1">, "children">;
|
|
25
|
+
/**
|
|
26
|
+
* A plain list's page draws no title row (`CollectionPage`): the heading stays, read by
|
|
27
|
+
* assistive technology and taking focus after a navigation, and nothing is drawn.
|
|
28
|
+
*/
|
|
29
|
+
unseen?: boolean;
|
|
25
30
|
}): React.JSX.Element;
|
|
26
31
|
export { PageHeader };
|
|
27
32
|
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,UAAU,CAAC,EAClB,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,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;
|
|
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;;;;;;;;;;;;;;;;;GAiBG;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,qBAgCA;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -19,7 +19,10 @@ import { PageActionsSlot } from "./page-actions.js";
|
|
|
19
19
|
* description is one sentence in the product's words, without a full stop when it ends in a link.
|
|
20
20
|
* @access The title is the page's `h1`; DOM order is visual order.
|
|
21
21
|
*/
|
|
22
|
-
function PageHeader({ title, description, headingProps, className, ...props }) {
|
|
22
|
+
function PageHeader({ title, description, headingProps, className, unseen = false, ...props }) {
|
|
23
|
+
if (unseen) {
|
|
24
|
+
return (_jsx("h1", { ...headingProps, className: cn("sr-only", headingProps?.className), children: title }));
|
|
25
|
+
}
|
|
23
26
|
return (_jsxs("header", { "data-slot": "page-header", className: cn("min-w-0", className), ...props, children: [_jsxs("div", { className: "flex min-h-9 min-w-0 flex-wrap items-center justify-between gap-x-6 gap-y-3", children: [_jsx("h1", { ...headingProps, className: cn("min-w-0 flex-1 basis-32 truncate text-heading-md text-foreground outline-none", headingProps?.className), children: title }), _jsx(PageActionsSlot, {})] }), description ? (_jsx("div", { "data-slot": "page-header-description", className: "mt-1 min-w-0 text-body-sm text-muted-foreground", children: description })) : null] }));
|
|
24
27
|
}
|
|
25
28
|
export { PageHeader };
|
|
@@ -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; 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 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.
|
|
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)
|