@nadicodeai/ui 12.1.197 → 12.1.198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +7 -1
- package/dist/components/action-menu.d.ts +1 -1
- package/dist/components/action-menu.js +1 -1
- package/dist/components/activity-calendar.d.ts +2 -2
- package/dist/components/activity-calendar.js +2 -2
- package/dist/components/card.d.ts +2 -2
- package/dist/components/card.js +2 -2
- package/dist/components/clearable-input.d.ts +3 -2
- package/dist/components/clearable-input.d.ts.map +1 -1
- package/dist/components/clearable-input.js +3 -2
- package/dist/components/collection-page.d.ts +1 -1
- package/dist/components/collection-page.js +1 -1
- package/dist/components/collection-sort.d.ts +2 -2
- package/dist/components/collection-sort.js +2 -2
- package/dist/components/collection-toolbar.js +2 -2
- package/dist/components/command.d.ts +2 -2
- package/dist/components/command.js +2 -2
- package/dist/components/confirm-dialog.d.ts +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/context-menu.d.ts +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/data-table.d.ts +3 -3
- package/dist/components/data-table.js +2 -2
- package/dist/components/dialog.d.ts +2 -1
- package/dist/components/dialog.d.ts.map +1 -1
- package/dist/components/dialog.js +2 -1
- package/dist/components/disclosure.d.ts +2 -2
- package/dist/components/disclosure.js +2 -2
- package/dist/components/dropdown-menu.d.ts +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/empty-state.d.ts +1 -1
- package/dist/components/empty-state.js +1 -1
- package/dist/components/entry-scene.d.ts +1 -1
- package/dist/components/entry-scene.js +1 -1
- package/dist/components/form-dialog.d.ts +1 -1
- package/dist/components/form-dialog.js +1 -1
- package/dist/components/form-drawer.d.ts +1 -1
- package/dist/components/form-drawer.js +1 -1
- package/dist/components/hover-card.d.ts +2 -1
- package/dist/components/hover-card.d.ts.map +1 -1
- package/dist/components/hover-card.js +2 -1
- package/dist/components/identity-mark.d.ts +1 -1
- package/dist/components/identity-mark.js +1 -1
- package/dist/components/input.d.ts +4 -4
- package/dist/components/input.js +4 -4
- package/dist/components/middle-truncate.d.ts +3 -1
- package/dist/components/middle-truncate.d.ts.map +1 -1
- package/dist/components/middle-truncate.js +3 -1
- package/dist/components/notice-banner.d.ts +1 -1
- package/dist/components/notice-banner.js +1 -1
- package/dist/components/object-page.d.ts +3 -3
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +2 -2
- package/dist/components/page-actions.d.ts +3 -3
- package/dist/components/page-actions.js +3 -3
- package/dist/components/page-header.d.ts +16 -8
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +16 -8
- package/dist/components/popover.d.ts +4 -3
- package/dist/components/popover.d.ts.map +1 -1
- package/dist/components/popover.js +4 -3
- package/dist/components/record-identity.d.ts +1 -1
- package/dist/components/record-identity.js +1 -1
- package/dist/components/record-list.d.ts +1 -1
- package/dist/components/record-list.js +1 -1
- package/dist/components/scope-switcher.d.ts +1 -1
- package/dist/components/scope-switcher.js +1 -1
- package/dist/components/settings-facts.d.ts +1 -1
- package/dist/components/settings-facts.js +1 -1
- package/dist/components/settings-page.d.ts +1 -1
- package/dist/components/settings-page.js +1 -1
- package/dist/components/settings-section.d.ts +6 -6
- package/dist/components/settings-section.js +6 -6
- package/dist/components/sidebar-sections.d.ts +2 -2
- package/dist/components/sidebar-sections.js +2 -2
- package/dist/components/sidebar.d.ts +3 -3
- package/dist/components/sidebar.js +3 -3
- package/dist/components/status-badge.d.ts +13 -4
- package/dist/components/status-badge.d.ts.map +1 -1
- package/dist/components/status-badge.js +13 -4
- package/dist/components/table-value.d.ts +2 -2
- package/dist/components/table-value.js +2 -2
- package/dist/components/tabs.d.ts +10 -3
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +10 -3
- package/dist/components/tooltip.d.ts +3 -2
- package/dist/components/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip.js +3 -2
- package/dist/components/waiting-line.d.ts +3 -2
- package/dist/components/waiting-line.d.ts.map +1 -1
- package/dist/components/waiting-line.js +3 -2
- package/dist/internal/row-message.d.ts +1 -1
- package/dist/showcase/usage.generated.js +60 -60
- package/dist/styles/components.css +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAKrE
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAKrE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,qBAE9E;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAAK,qBAEnE;AAED,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,KAAgB,EAChB,WAAe,EACf,IAAe,EACf,UAAc,EACd,MAAM,EACN,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,GAC7B,IAAI,CACF,gBAAgB,CAAC,UAAU,CAAC,KAAK,EACjC,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,CAC3D,qBAyBF;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ1E;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,qBAQ1E;AAED,iBAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,qBAQtF;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -8,9 +8,10 @@ import { anchoredOverlayMotion } from "../lib/motion.js";
|
|
|
8
8
|
* @family Menus
|
|
9
9
|
* @when A small control set tied to its trigger: filters, a scope chooser, a date range, a feedback
|
|
10
10
|
* form. The page stays live behind it.
|
|
11
|
-
* @instead
|
|
12
|
-
*
|
|
13
|
-
* which
|
|
11
|
+
* @instead A record's commands are its `ActionMenu`, a page's are `PageActions`' `menu`. For a form
|
|
12
|
+
* that adds a record use `FormDialog`. For one phrase use `Tooltip`; facts on hover are a
|
|
13
|
+
* `HoverCard`, which only this package's components draw, such as `RecordTime`. The product-design
|
|
14
|
+
* skill's patterns.md, "Choose the surface for a change", decides which surface a job takes.
|
|
14
15
|
* @behaviour Solid floating surface, 12 px padding and gap. Opens on click, closes on Escape or
|
|
15
16
|
* outside press, focus returns to the trigger. A control set applies at once, with no Save inside;
|
|
16
17
|
* a feedback form is the exception: its button sends it, it shows its pending and result state, and
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { type IdentityMarkProps } from "./identity-mark.js";
|
|
3
3
|
/**
|
|
4
|
-
* A record's identity in a row
|
|
4
|
+
* A record's identity in a row, as `RecordList` and `DataTable` draw it: its
|
|
5
5
|
* mark at 32, its name, and under it one muted `detail` line saying what the
|
|
6
6
|
* record is or where it comes from, so the row reads without a column heading.
|
|
7
7
|
*
|
|
@@ -3,7 +3,7 @@ import { IdentityMark } from "./identity-mark.js";
|
|
|
3
3
|
import { TableCompactFacts, TableCompactNameFacts } from "../internal/table-compact-line.js";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
/**
|
|
6
|
-
* A record's identity in a row
|
|
6
|
+
* A record's identity in a row, as `RecordList` and `DataTable` draw it: its
|
|
7
7
|
* mark at 32, its name, and under it one muted `detail` line saying what the
|
|
8
8
|
* record is or where it comes from, so the row reads without a column heading.
|
|
9
9
|
*
|
|
@@ -270,7 +270,7 @@ export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey,
|
|
|
270
270
|
* Ours: the list names each kind of row button once, in `commands`, so every row that does a job draws the same words at the same width; the record's own name goes in the row's `accessibleName`, never in the label.
|
|
271
271
|
* “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table)
|
|
272
272
|
* “Render — in cells where a value is unknown or not applicable. Don’t substitute N/A, null, or an empty string.” (https://vercel.com/geist/table)
|
|
273
|
-
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `
|
|
273
|
+
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `TableValue` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact's `label`, the status's and the time's are the nouns the headings would be ("Partner", "State", "Asked"). The name's line under it is the one place a record is described in words, and the time keeps its verb's sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product's: `label` names the list, a time's `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu's `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception's word ("Needs attention", "Can't sign in"), never "Active" on every row, and never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent". The footer holds a count or the paging, never a help sentence: guidance a step needs lives in that step.
|
|
274
274
|
* @access “Wrap the loading region in `aria-busy="true"` and announce completion with `aria-live="polite"` on the destination container, not the skeleton itself.” (https://vercel.com/geist/skeleton)
|
|
275
275
|
* Ours: the loading rows sit in one `SkeletonRegion` that is busy while they stand and announces what replaces them. A table named by `label`, its column headings read by assistive technology only; the commands column's is `commandsHeader`, and empty without one, since its controls name themselves, never the list's name a second time. The row link carries `open.label`; the three dots carry the menu's `label`, and the menu's first line names the record. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them.
|
|
276
276
|
* “For multi-select rows, the leading `Checkbox` carries `aria-label="Select {entity name}"` so the row is selectable without relying on the visual label.” (https://vercel.com/geist/entity)
|
|
@@ -323,7 +323,7 @@ function RecordRows(props) {
|
|
|
323
323
|
* Ours: the list names each kind of row button once, in `commands`, so every row that does a job draws the same words at the same width; the record's own name goes in the row's `accessibleName`, never in the label.
|
|
324
324
|
* “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table)
|
|
325
325
|
* “Render — in cells where a value is unknown or not applicable. Don’t substitute N/A, null, or an empty string.” (https://vercel.com/geist/table)
|
|
326
|
-
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `
|
|
326
|
+
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `TableValue` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact's `label`, the status's and the time's are the nouns the headings would be ("Partner", "State", "Asked"). The name's line under it is the one place a record is described in words, and the time keeps its verb's sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product's: `label` names the list, a time's `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu's `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception's word ("Needs attention", "Can't sign in"), never "Active" on every row, and never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent". The footer holds a count or the paging, never a help sentence: guidance a step needs lives in that step.
|
|
327
327
|
* @access “Wrap the loading region in `aria-busy="true"` and announce completion with `aria-live="polite"` on the destination container, not the skeleton itself.” (https://vercel.com/geist/skeleton)
|
|
328
328
|
* Ours: the loading rows sit in one `SkeletonRegion` that is busy while they stand and announces what replaces them. A table named by `label`, its column headings read by assistive technology only; the commands column's is `commandsHeader`, and empty without one, since its controls name themselves, never the list's name a second time. The row link carries `open.label`; the three dots carry the menu's `label`, and the menu's first line names the record. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them.
|
|
329
329
|
* “For multi-select rows, the leading `Checkbox` carries `aria-label="Select {entity name}"` so the row is selectable without relying on the visual label.” (https://vercel.com/geist/entity)
|
|
@@ -31,7 +31,7 @@ export type ScopeSwitcherProps = {
|
|
|
31
31
|
* @family Navigation
|
|
32
32
|
* @when Changing which part of the account a page reads, such as Analytics' scope, or switching between objects from the shell's top bar with `variant="navigation"`.
|
|
33
33
|
* @instead A viewer with one scope and nothing to create reads its name with no control, which this draws by itself. Finding anything is `CommandDialog`; narrowing rows is `CollectionFilters`.
|
|
34
|
-
* @behaviour A ghost trigger, at most 16rem, opens a 288 px popover with focus in its search. Navigation omits the visible prefix, wraps the selected name on phones instead of cutting it, carries each option's identity mark and opens a 384 px popover constrained to the viewport. Type to filter, Enter chooses and closes; choosing the current one changes nothing. The caller writes the choice to the URL in `onValueChange`, so sibling pages keep it. An optional create command sits last.
|
|
34
|
+
* @behaviour A ghost trigger, at most 16rem, opens a 288 px popover with focus in its search. Navigation omits the visible prefix, wraps the selected name on phones instead of cutting it, carries each option's identity mark and opens a 384 px popover constrained to the viewport. Type to filter, Enter chooses and closes; choosing the current one changes nothing. The caller writes the choice to the URL in `onValueChange`, so sibling pages keep it. Scope selectors preserve the authorized organization or account. An optional create command sits last.
|
|
35
35
|
* @words `copy.label` names what is chosen ("Scope") beside the current scope's name. Search and empty lines name the thing: "Find a scope", "No scope matches".
|
|
36
36
|
* @access The trigger reads "Scope: All customers"; the popover has a hidden title; options are a listbox with the current one checked.
|
|
37
37
|
*/
|
|
@@ -12,7 +12,7 @@ import { cn } from "../lib/utils.js";
|
|
|
12
12
|
* @family Navigation
|
|
13
13
|
* @when Changing which part of the account a page reads, such as Analytics' scope, or switching between objects from the shell's top bar with `variant="navigation"`.
|
|
14
14
|
* @instead A viewer with one scope and nothing to create reads its name with no control, which this draws by itself. Finding anything is `CommandDialog`; narrowing rows is `CollectionFilters`.
|
|
15
|
-
* @behaviour A ghost trigger, at most 16rem, opens a 288 px popover with focus in its search. Navigation omits the visible prefix, wraps the selected name on phones instead of cutting it, carries each option's identity mark and opens a 384 px popover constrained to the viewport. Type to filter, Enter chooses and closes; choosing the current one changes nothing. The caller writes the choice to the URL in `onValueChange`, so sibling pages keep it. An optional create command sits last.
|
|
15
|
+
* @behaviour A ghost trigger, at most 16rem, opens a 288 px popover with focus in its search. Navigation omits the visible prefix, wraps the selected name on phones instead of cutting it, carries each option's identity mark and opens a 384 px popover constrained to the viewport. Type to filter, Enter chooses and closes; choosing the current one changes nothing. The caller writes the choice to the URL in `onValueChange`, so sibling pages keep it. Scope selectors preserve the authorized organization or account. An optional create command sits last.
|
|
16
16
|
* @words `copy.label` names what is chosen ("Scope") beside the current scope's name. Search and empty lines name the thing: "Find a scope", "No scope matches".
|
|
17
17
|
* @access The trigger reads "Scope: All customers"; the popover has a hidden title; options are a listbox with the current one checked.
|
|
18
18
|
*/
|
|
@@ -69,7 +69,7 @@ export type SettingsFactsSectionProps = SettingsFactsBase & ({
|
|
|
69
69
|
* `SettingsFactsSection` frames them as a card; `ObjectFacts` is the
|
|
70
70
|
* list alone.
|
|
71
71
|
* @instead Facts a person changes are a `SettingsSection` with its own Save. One server-given value,
|
|
72
|
-
* an ID, is a `SettingsSection` with the value
|
|
72
|
+
* an ID, is a `SettingsSection` with the value as a `TextWithCopyButton`, no Save. Facts
|
|
73
73
|
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
74
74
|
* @behaviour "Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`)." (https://vercel.com/geist/description)
|
|
75
75
|
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
@@ -15,7 +15,7 @@ import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle,
|
|
|
15
15
|
* `SettingsFactsSection` frames them as a card; `ObjectFacts` is the
|
|
16
16
|
* list alone.
|
|
17
17
|
* @instead Facts a person changes are a `SettingsSection` with its own Save. One server-given value,
|
|
18
|
-
* an ID, is a `SettingsSection` with the value
|
|
18
|
+
* an ID, is a `SettingsSection` with the value as a `TextWithCopyButton`, no Save. Facts
|
|
19
19
|
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
20
20
|
* @behaviour "Use `<Description>` for definition-list metadata: a short Title Case key paired with a single value (`Last Deployed`, `Region`, `Plan`)." (https://vercel.com/geist/description)
|
|
21
21
|
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
@@ -7,7 +7,7 @@ export type SettingsPageProps = {
|
|
|
7
7
|
* A page of settings: section cards across the page's width under its title, each saving its own values.
|
|
8
8
|
*
|
|
9
9
|
* @family Compositions
|
|
10
|
-
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications.
|
|
10
|
+
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications. Every page of settings is this composition, whether it belongs to the person, to the platform or to one record's Settings tab, so the column keeps its width and its field layout from one entry of a settings menu to the next.
|
|
11
11
|
* @instead One object's page with a settings card among its sections is an ObjectPage; "Place it once per app, in the footer or settings, not duplicated across pages." (https://vercel.com/geist/theme-switcher) Ours: Theme and Language, which apply on change, stay in the account menu.
|
|
12
12
|
* @behaviour One setting per card (the card's shapes are SettingsSection's: one field, a row of short parts of one value, rows of switches or of selects), the cards stacked 24 apart in the settings column (`ReadingColumn` `settings`, 960 px) under the page's header, which the product's page frame draws with its title and description, as Vercel's settings cards fill their column and stop there, with no heading between them; a field inside keeps its own bound. A page that mixes cards with other content, such as a table or a list of rules, is not a SettingsPage: its sections take a plain h2 above each card. The page draws no header and no save of its own: each SettingsSection saves from its footer. The danger zone closes the page, in rising severity: transfer, then pause, then delete; only delete is `tone="error"`, and only delete and pause take a button in a hue.
|
|
13
13
|
* @words The sections' titles and lines; a card's title is never the page's h1.
|
|
@@ -4,7 +4,7 @@ import { ReadingColumn } from "./reading-column.js";
|
|
|
4
4
|
* A page of settings: section cards across the page's width under its title, each saving its own values.
|
|
5
5
|
*
|
|
6
6
|
* @family Compositions
|
|
7
|
-
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications.
|
|
7
|
+
* @when A place whose job is changing how something behaves: an account's profile, a company's identity, Nadia's notifications. Every page of settings is this composition, whether it belongs to the person, to the platform or to one record's Settings tab, so the column keeps its width and its field layout from one entry of a settings menu to the next.
|
|
8
8
|
* @instead One object's page with a settings card among its sections is an ObjectPage; "Place it once per app, in the footer or settings, not duplicated across pages." (https://vercel.com/geist/theme-switcher) Ours: Theme and Language, which apply on change, stay in the account menu.
|
|
9
9
|
* @behaviour One setting per card (the card's shapes are SettingsSection's: one field, a row of short parts of one value, rows of switches or of selects), the cards stacked 24 apart in the settings column (`ReadingColumn` `settings`, 960 px) under the page's header, which the product's page frame draws with its title and description, as Vercel's settings cards fill their column and stop there, with no heading between them; a field inside keeps its own bound. A page that mixes cards with other content, such as a table or a list of rules, is not a SettingsPage: its sections take a plain h2 above each card. The page draws no header and no save of its own: each SettingsSection saves from its footer. The danger zone closes the page, in rising severity: transfer, then pause, then delete; only delete is `tone="error"`, and only delete and pause take a button in a hue.
|
|
10
10
|
* @words The sections' titles and lines; a card's title is never the page's h1.
|
|
@@ -92,11 +92,11 @@ export type SavingSettingsSectionProps = SettingsSectionBase & SavingSection;
|
|
|
92
92
|
* A card of one setting that says what changing it does and ends in a footer.
|
|
93
93
|
*
|
|
94
94
|
* @family Compositions
|
|
95
|
-
* @when One setting a person changes on a SettingsPage or as a section of an ObjectPage: Personal details, Company identity, Notifications. A typed value takes `save
|
|
96
|
-
* @instead Read-only facts of an object are a SettingsFactsSection; a table or a list of records is a TableCard;
|
|
97
|
-
* @behaviour "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: one setting per card, a single SettingsField with the description its only help, unless the card's description covers several settings: then they are its SettingsRows, switches and selects together. A typed value (a name, a URL, a server, a port, a key) gets its own card. A semantic subgroup of related controls inside a field, such as radios or checkboxes, is a `FieldSet` with a `FieldLegend`. Several settings in one card are declared by SettingsRows, never by classes at the call site. "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) "Pair with a form footer only when the setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip` that names the resolver." (https://vercel.com/geist/toggle) Ours: a switch never applies on change; it is a row of the card, a draft until the footer's Save, as Vercel's settings cards are. A switch blocked from above is shown off and disabled, the footer saying why and never a tooltip. Required: the title and the description. A `status` stands right after the title, as Vercel's plan card puts "Active" after "Pro Plan". The header's `actions` are drawn as every card draws them (`CardActions`: the muted meta, up to two secondaries as outline buttons, the primary as the filled one, the three dots), a way to another page among them as an outline button named for it; a card whose value is itself shown there, as Vercel's Team Avatar, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem they keep the title's row and the description runs under both, as Vercel's cards read on a phone, and when the title's longest word would not fit beside them they move under the title, so they never cover it. The footer's left line (`footerHint`, `save.hint`) is optional and specific to the card, never a generic line repeated on every card: a limit, what a value is for, a plan it needs, a link; absent, it is nothing, and a card with neither a line nor a button has no footer. Ours: `save`: a typed value, one card with its own Save in the footer, always visible. The section owns the changed state: Save stays disabled until a field differs from what is saved and says `pendingLabel` while saving with Cancel beside it; a completed save calls `saved`, and the product raises one toast from its catalogue ("Completion toasts follow `{Noun} {past-participle}`: `Blob deleted`, `Domain added`, `Environment variable saved`. Never include `successfully`; the action name implies it." https://vercel.com/geist/toast), and Save returns to disabled, with no saved state in the footer. Ours: the section never raises a toast itself. A failed save keeps every value and shows under its field, or above the footer when no field owns it. `tone` marks a state with a command (a failed payment, a trial ending): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; title, line, fields and buttons stay neutral, an outline secondary then a default primary. A button takes the hue of its command, not of the card: `destructive` (red) for a permanent loss (Delete), `warning` (amber) for a disruptive command that can be undone (Pause, Archive). A delete card is `tone="error"` with the object's summary as its body; an archive card is neutral with a `warning` button in the footer. "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "One Note per concept." (https://vercel.com/geist/note) Ours: a message about the fields inside is a MessageNotice in the body, the card staying neutral. "Disabled checkboxes still need a Tooltip naming the reason; a greyed box with no explanation reads as a bug." (https://vercel.com/geist/checkbox) Ours: `lockedReason` (Geist's disabled wall) is the reason, written as the footer's line, not in a tooltip; it keeps the fields in view, inert with muted text, under a not-allowed cursor, the title and line unchanged; `unlock` is the way to get access, left out when nothing the person does unlocks it. A locked section has no `save` and no header `actions`.
|
|
98
|
-
* @words "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: the description is that helper text for the whole card, and no field has its own. "Render an optional one-sentence description as a sibling under the label that explains ON only. Don’t describe OFF; it’s the negation." (https://vercel.com/geist/toggle) Ours: a
|
|
99
|
-
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`." (https://vercel.com/geist/toggle) Ours: the title is the section's h2, or an h3 with `headingLevel` inside an ObjectPage's row, and names the form that saves it
|
|
95
|
+
* @when One setting a person changes on a SettingsPage or as a section of an ObjectPage: Personal details, Company identity, Notifications. A typed value takes `save`, and so does a switch, a theme, a language or a pick from a short list: each is a draft until the footer's Save applies it. Also a plan-gated feature, a delete card, one read-only value (an ID as a `TextWithCopyButton`, no Save), and a paid quantity (its stepper field, the price as the description, a two-fact summary under it).
|
|
96
|
+
* @instead Read-only facts of an object are a SettingsFactsSection; a table or a list of records is a TableCard; a record's edit in a list is a RowEditForm.
|
|
97
|
+
* @behaviour "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: one setting per card, a single SettingsField with the description its only help, unless the card's description covers several settings: then they are its SettingsRows, switches and selects together. A typed value (a name, a URL, a server, a port, a key) gets its own card. A semantic subgroup of related controls inside a field, such as radios or checkboxes, is a `FieldSet` with a `FieldLegend`. Several settings in one card are declared by SettingsRows, never by classes at the call site. The card's header and fields share one uninterrupted body, and only its footer has a divider. "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) "Pair with a form footer only when the setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip` that names the resolver." (https://vercel.com/geist/toggle) Ours: a switch never applies on change; it is a row of the card, a draft until the footer's Save, as Vercel's settings cards are. A switch blocked from above is shown off and disabled, the footer saying why and never a tooltip. Required: the title and the description. A `status` stands right after the title, as Vercel's plan card puts "Active" after "Pro Plan". The header's `actions` are drawn as every card draws them (`CardActions`: the muted meta, up to two secondaries as outline buttons, the primary as the filled one, the three dots), a way to another page among them as an outline button named for it; a card whose value is itself shown there, as Vercel's Team Avatar, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem they keep the title's row and the description runs under both, as Vercel's cards read on a phone, and when the title's longest word would not fit beside them they move under the title, so they never cover it. The footer's left line (`footerHint`, `save.hint`) is optional and specific to the card, never a generic line repeated on every card: a limit, what a value is for, a plan it needs, a link; absent, it is nothing, and a card with neither a line nor a button has no footer. Ours: `save`: a typed value, one card with its own Save in the footer, always visible. The section owns the changed state: Save stays disabled until a field differs from what is saved and says `pendingLabel` while saving with Cancel beside it; a completed save calls `saved`, and the product raises one toast from its catalogue ("Completion toasts follow `{Noun} {past-participle}`: `Blob deleted`, `Domain added`, `Environment variable saved`. Never include `successfully`; the action name implies it." https://vercel.com/geist/toast), and Save returns to disabled, with no saved state in the footer. Ours: the section never raises a toast itself. A failed save keeps every value and shows under its field, or above the footer when no field owns it. `tone` marks a state with a command (a failed payment, a trial ending): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; title, line, fields and buttons stay neutral, an outline secondary then a default primary. A button takes the hue of its command, not of the card: `destructive` (red) for a permanent loss (Delete), `warning` (amber) for a disruptive command that can be undone (Pause, Archive). A delete card is `tone="error"` with the object's summary as its body; an archive card is neutral with a `warning` button in the footer. "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "One Note per concept." (https://vercel.com/geist/note) Ours: a message about the fields inside is a MessageNotice in the body, the card staying neutral. "Disabled checkboxes still need a Tooltip naming the reason; a greyed box with no explanation reads as a bug." (https://vercel.com/geist/checkbox) Ours: `lockedReason` (Geist's disabled wall) is the reason, written as the footer's line, not in a tooltip; it keeps the fields in view, inert with muted text, under a not-allowed cursor, the title and line unchanged; `unlock` is the way to get access, left out when nothing the person does unlocks it. A locked section has no `save` and no header `actions`.
|
|
98
|
+
* @words "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: the description is that helper text for the whole card, and no field has its own. "Render an optional one-sentence description as a sibling under the label that explains ON only. Don’t describe OFF; it’s the negation." (https://vercel.com/geist/toggle) Ours: a card of one switch says in its description what turning it on does. The title names the values ("Personal details"); the description says what changing them does, in one line; the footer line is a Learn more link, a limit ("Use 32 characters at most."), what stays unaffected, or what is blocked and why ("Ask an owner to change this."); Save and Saving come from the product's catalogue, and so does the toast a `saved` callback raises; a delete card's description opens "Permanently delete".
|
|
99
|
+
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`." (https://vercel.com/geist/toggle) Ours: the title is the section's h2, or an h3 with `headingLevel` inside an ObjectPage's row, and names the form that saves it. The footer's line is one status, announced politely; a failure under a field marks the control invalid and describes it. Locked fields are inert, so the section's title, description and reason are what a screen reader meets.
|
|
100
100
|
*/
|
|
101
101
|
declare function SettingsSection({ title, headingLevel, description, status, actions, control, tone, children, className, save, footer, footerHint, lockedReason, unlock, ...props }: SettingsSectionProps): React.JSX.Element;
|
|
102
102
|
type SettingsFieldBase = Omit<React.ComponentProps<typeof Field>, "children" | "orientation"> & {
|
|
@@ -133,7 +133,7 @@ type SettingsFieldProps = SettingsFieldBase & ({
|
|
|
133
133
|
*
|
|
134
134
|
* @family Inputs
|
|
135
135
|
* @when The one value of a SettingsSection: a name, an address, a choice, a switch.
|
|
136
|
-
* @instead A field of a drawer's or a dialog's form is a Field from the form's own owner; a read-only fact is a SettingsFactsSection; several switches and selects in one card are SettingsRows
|
|
136
|
+
* @instead A field of a drawer's or a dialog's form is a Field from the form's own owner; a read-only fact is a SettingsFactsSection; several switches and selects in one card are SettingsRows.
|
|
137
137
|
* @behaviour "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: label required, no help line: the card's description helps, and the (i) `info` is for a part of a value that needs a sentence. The control is 20rem wide under its label (`controlWidth`: `full` for a textarea, `natural` for a segmented control). `control="choice"` puts a checkbox or radio before its sentence; `control="switch"` puts the word for the switch's state after it and requires `stateLabel`. "Validate on blur, not on every keystroke; surface the message by passing a string to `error`." (https://vercel.com/geist/input) Ours: a validation `error` updates as the value is corrected, and it or a failed save about this field shows under the control and marks it invalid; colour sits on the control's edge and the message, never the label.
|
|
138
138
|
* @words "Labels are short Title Case nouns: `Project Name`, `Domain`, `Environment Variable Name`." (https://vercel.com/geist/input) Ours: sentence case, a noun for the value ("Display name"). "Validation names the field and the constraint, ends in a period, and skips `please` (`Project name is required.`, `Code must be 6 digits.`)." (https://vercel.com/geist/input) Ours: an error says what to do next; `info.text` is one sentence and `info.label` names its button ("About display name"); a switch shows its state word ("Enabled", "Disabled") beside it.
|
|
139
139
|
* @access "Don’t wrap a labelled `<Input>` in a `Tooltip`; put the explainer on a sibling icon button so the label stays announced." (https://vercel.com/geist/input) Ours: that sibling button is the (i) `info`. The control receives its id, `aria-invalid` and `aria-describedby` through `controlProps`, so the label, the info and the error are read with it. The info button has its own name and opens on focus.
|
|
@@ -19,11 +19,11 @@ const toneClassNames = {
|
|
|
19
19
|
* A card of one setting that says what changing it does and ends in a footer.
|
|
20
20
|
*
|
|
21
21
|
* @family Compositions
|
|
22
|
-
* @when One setting a person changes on a SettingsPage or as a section of an ObjectPage: Personal details, Company identity, Notifications. A typed value takes `save
|
|
23
|
-
* @instead Read-only facts of an object are a SettingsFactsSection; a table or a list of records is a TableCard;
|
|
24
|
-
* @behaviour "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: one setting per card, a single SettingsField with the description its only help, unless the card's description covers several settings: then they are its SettingsRows, switches and selects together. A typed value (a name, a URL, a server, a port, a key) gets its own card. A semantic subgroup of related controls inside a field, such as radios or checkboxes, is a `FieldSet` with a `FieldLegend`. Several settings in one card are declared by SettingsRows, never by classes at the call site. "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) "Pair with a form footer only when the setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip` that names the resolver." (https://vercel.com/geist/toggle) Ours: a switch never applies on change; it is a row of the card, a draft until the footer's Save, as Vercel's settings cards are. A switch blocked from above is shown off and disabled, the footer saying why and never a tooltip. Required: the title and the description. A `status` stands right after the title, as Vercel's plan card puts "Active" after "Pro Plan". The header's `actions` are drawn as every card draws them (`CardActions`: the muted meta, up to two secondaries as outline buttons, the primary as the filled one, the three dots), a way to another page among them as an outline button named for it; a card whose value is itself shown there, as Vercel's Team Avatar, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem they keep the title's row and the description runs under both, as Vercel's cards read on a phone, and when the title's longest word would not fit beside them they move under the title, so they never cover it. The footer's left line (`footerHint`, `save.hint`) is optional and specific to the card, never a generic line repeated on every card: a limit, what a value is for, a plan it needs, a link; absent, it is nothing, and a card with neither a line nor a button has no footer. Ours: `save`: a typed value, one card with its own Save in the footer, always visible. The section owns the changed state: Save stays disabled until a field differs from what is saved and says `pendingLabel` while saving with Cancel beside it; a completed save calls `saved`, and the product raises one toast from its catalogue ("Completion toasts follow `{Noun} {past-participle}`: `Blob deleted`, `Domain added`, `Environment variable saved`. Never include `successfully`; the action name implies it." https://vercel.com/geist/toast), and Save returns to disabled, with no saved state in the footer. Ours: the section never raises a toast itself. A failed save keeps every value and shows under its field, or above the footer when no field owns it. `tone` marks a state with a command (a failed payment, a trial ending): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; title, line, fields and buttons stay neutral, an outline secondary then a default primary. A button takes the hue of its command, not of the card: `destructive` (red) for a permanent loss (Delete), `warning` (amber) for a disruptive command that can be undone (Pause, Archive). A delete card is `tone="error"` with the object's summary as its body; an archive card is neutral with a `warning` button in the footer. "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "One Note per concept." (https://vercel.com/geist/note) Ours: a message about the fields inside is a MessageNotice in the body, the card staying neutral. "Disabled checkboxes still need a Tooltip naming the reason; a greyed box with no explanation reads as a bug." (https://vercel.com/geist/checkbox) Ours: `lockedReason` (Geist's disabled wall) is the reason, written as the footer's line, not in a tooltip; it keeps the fields in view, inert with muted text, under a not-allowed cursor, the title and line unchanged; `unlock` is the way to get access, left out when nothing the person does unlocks it. A locked section has no `save` and no header `actions`.
|
|
25
|
-
* @words "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: the description is that helper text for the whole card, and no field has its own. "Render an optional one-sentence description as a sibling under the label that explains ON only. Don’t describe OFF; it’s the negation." (https://vercel.com/geist/toggle) Ours: a
|
|
26
|
-
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`." (https://vercel.com/geist/toggle) Ours: the title is the section's h2, or an h3 with `headingLevel` inside an ObjectPage's row, and names the form that saves it
|
|
22
|
+
* @when One setting a person changes on a SettingsPage or as a section of an ObjectPage: Personal details, Company identity, Notifications. A typed value takes `save`, and so does a switch, a theme, a language or a pick from a short list: each is a draft until the footer's Save applies it. Also a plan-gated feature, a delete card, one read-only value (an ID as a `TextWithCopyButton`, no Save), and a paid quantity (its stepper field, the price as the description, a two-fact summary under it).
|
|
23
|
+
* @instead Read-only facts of an object are a SettingsFactsSection; a table or a list of records is a TableCard; a record's edit in a list is a RowEditForm.
|
|
24
|
+
* @behaviour "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: one setting per card, a single SettingsField with the description its only help, unless the card's description covers several settings: then they are its SettingsRows, switches and selects together. A typed value (a name, a URL, a server, a port, a key) gets its own card. A semantic subgroup of related controls inside a field, such as radios or checkboxes, is a `FieldSet` with a `FieldLegend`. Several settings in one card are declared by SettingsRows, never by classes at the call site. The card's header and fields share one uninterrupted body, and only its footer has a divider. "Use Toggle for a single boolean setting where ON takes effect immediately, like `Password Protection` or `Auto-Cancel Builds`." (https://vercel.com/geist/toggle) "Pair with a form footer only when the setting needs an explicit `Save` step." (https://vercel.com/geist/toggle) "Disable Toggle only when the action is impossible (missing plan, locked policy); pair with helper text or a `Tooltip` that names the resolver." (https://vercel.com/geist/toggle) Ours: a switch never applies on change; it is a row of the card, a draft until the footer's Save, as Vercel's settings cards are. A switch blocked from above is shown off and disabled, the footer saying why and never a tooltip. Required: the title and the description. A `status` stands right after the title, as Vercel's plan card puts "Active" after "Pro Plan". The header's `actions` are drawn as every card draws them (`CardActions`: the muted meta, up to two secondaries as outline buttons, the primary as the filled one, the three dots), a way to another page among them as an outline button named for it; a card whose value is itself shown there, as Vercel's Team Avatar, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem they keep the title's row and the description runs under both, as Vercel's cards read on a phone, and when the title's longest word would not fit beside them they move under the title, so they never cover it. The footer's left line (`footerHint`, `save.hint`) is optional and specific to the card, never a generic line repeated on every card: a limit, what a value is for, a plan it needs, a link; absent, it is nothing, and a card with neither a line nor a button has no footer. Ours: `save`: a typed value, one card with its own Save in the footer, always visible. The section owns the changed state: Save stays disabled until a field differs from what is saved and says `pendingLabel` while saving with Cancel beside it; a completed save calls `saved`, and the product raises one toast from its catalogue ("Completion toasts follow `{Noun} {past-participle}`: `Blob deleted`, `Domain added`, `Environment variable saved`. Never include `successfully`; the action name implies it." https://vercel.com/geist/toast), and Save returns to disabled, with no saved state in the footer. Ours: the section never raises a toast itself. A failed save keeps every value and shows under its field, or above the footer when no field owns it. `tone` marks a state with a command (a failed payment, a trial ending): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; title, line, fields and buttons stay neutral, an outline secondary then a default primary. A button takes the hue of its command, not of the card: `destructive` (red) for a permanent loss (Delete), `warning` (amber) for a disruptive command that can be undone (Pause, Archive). A delete card is `tone="error"` with the object's summary as its body; an archive card is neutral with a `warning` button in the footer. "Use a Note for inline contextual feedback next to the field, card, or section it describes: a region change warning above a region picker, a rate-limit notice next to a usage gauge." (https://vercel.com/geist/note) "One Note per concept." (https://vercel.com/geist/note) Ours: a message about the fields inside is a MessageNotice in the body, the card staying neutral. "Disabled checkboxes still need a Tooltip naming the reason; a greyed box with no explanation reads as a bug." (https://vercel.com/geist/checkbox) Ours: `lockedReason` (Geist's disabled wall) is the reason, written as the footer's line, not in a tooltip; it keeps the fields in view, inert with muted text, under a not-allowed cursor, the title and line unchanged; `unlock` is the way to get access, left out when nothing the person does unlocks it. A locked section has no `save` and no header `actions`.
|
|
25
|
+
* @words "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: the description is that helper text for the whole card, and no field has its own. "Render an optional one-sentence description as a sibling under the label that explains ON only. Don’t describe OFF; it’s the negation." (https://vercel.com/geist/toggle) Ours: a card of one switch says in its description what turning it on does. The title names the values ("Personal details"); the description says what changing them does, in one line; the footer line is a Learn more link, a limit ("Use 32 characters at most."), what stays unaffected, or what is blocked and why ("Ask an owner to change this."); Save and Saving come from the product's catalogue, and so does the toast a `saved` callback raises; a delete card's description opens "Permanently delete".
|
|
26
|
+
* @access "Provide an accessible name through `children`, `aria-label`, or `aria-labelledby`." (https://vercel.com/geist/toggle) Ours: the title is the section's h2, or an h3 with `headingLevel` inside an ObjectPage's row, and names the form that saves it. The footer's line is one status, announced politely; a failure under a field marks the control invalid and describes it. Locked fields are inert, so the section's title, description and reason are what a screen reader meets.
|
|
27
27
|
*/
|
|
28
28
|
function SettingsSection({ title, headingLevel = 2, description, status, actions, control, tone, children, className, save, footer, footerHint, lockedReason, unlock, ...props }) {
|
|
29
29
|
const titleId = React.useId();
|
|
@@ -70,7 +70,7 @@ function controlCellClassName(control, controlWidth) {
|
|
|
70
70
|
*
|
|
71
71
|
* @family Inputs
|
|
72
72
|
* @when The one value of a SettingsSection: a name, an address, a choice, a switch.
|
|
73
|
-
* @instead A field of a drawer's or a dialog's form is a Field from the form's own owner; a read-only fact is a SettingsFactsSection; several switches and selects in one card are SettingsRows
|
|
73
|
+
* @instead A field of a drawer's or a dialog's form is a Field from the form's own owner; a read-only fact is a SettingsFactsSection; several switches and selects in one card are SettingsRows.
|
|
74
74
|
* @behaviour "Helper text is sentence case, one sentence with a trailing period, on a sibling element wired through `aria-describedby`." (https://vercel.com/geist/input) Ours: label required, no help line: the card's description helps, and the (i) `info` is for a part of a value that needs a sentence. The control is 20rem wide under its label (`controlWidth`: `full` for a textarea, `natural` for a segmented control). `control="choice"` puts a checkbox or radio before its sentence; `control="switch"` puts the word for the switch's state after it and requires `stateLabel`. "Validate on blur, not on every keystroke; surface the message by passing a string to `error`." (https://vercel.com/geist/input) Ours: a validation `error` updates as the value is corrected, and it or a failed save about this field shows under the control and marks it invalid; colour sits on the control's edge and the message, never the label.
|
|
75
75
|
* @words "Labels are short Title Case nouns: `Project Name`, `Domain`, `Environment Variable Name`." (https://vercel.com/geist/input) Ours: sentence case, a noun for the value ("Display name"). "Validation names the field and the constraint, ends in a period, and skips `please` (`Project name is required.`, `Code must be 6 digits.`)." (https://vercel.com/geist/input) Ours: an error says what to do next; `info.text` is one sentence and `info.label` names its button ("About display name"); a switch shows its state word ("Enabled", "Disabled") beside it.
|
|
76
76
|
* @access "Don’t wrap a labelled `<Input>` in a `Tooltip`; put the explainer on a sibling icon button so the label stays announced." (https://vercel.com/geist/input) Ours: that sibling button is the (i) `info`. The control receives its id, `aria-invalid` and `aria-describedby` through `controlProps`, so the label, the info and the error are read with it. The info button has its own name and opens on focus.
|
|
@@ -34,8 +34,8 @@ export type SidebarSectionsProps<Id extends string> = {
|
|
|
34
34
|
* The sidebar swapped to one object or one area: the way back, what you are in, and its sections.
|
|
35
35
|
*
|
|
36
36
|
* @family Navigation
|
|
37
|
-
* @when Inside an object, the same sidebar column shows these instead of the places: an
|
|
38
|
-
* @instead The places a person can go are the sidebar's own groups; a
|
|
37
|
+
* @when Inside an object, the same sidebar column shows these instead of the places: an Installation's sections in the Portal, Nadia's Edit and Settings sections. Inside an area whose pages are siblings a person moves between, the area's sub-menu without `identity`, as Vercel's Settings: the Portal's Settings, Company, Library and Account. The row that opens an area ends in `SidebarMenuChevron`; a row that only opens a page has none. Required: the way back and the nav's `label`; every section has an icon.
|
|
38
|
+
* @instead The places a person can go are the sidebar's own groups; a settings page that does not swap the column is a SettingsPage. Never a second column beside the first. “Tabs imply the views share scope, URL parent, and data model” (https://vercel.com/geist/tabs) Ours: an area whose pages hold different objects, with different lists and different ways to add, is this sub-menu, as Vercel's AI Gateway is; a destination whose pages are views of one reading keeps its Tabs, as Vercel's Analytics and OpenRouter's Activity do (the Portal's Analytics). An object's sections under the top bar are a `TabsNav` band.
|
|
39
39
|
* @behaviour With `identity`: a back arrow row, then what you are in, then the sections. Without it, as Vercel's sub-menu: one row with a ‹ at its start and the area's name centred, then the sections as words alone. The back row returns to where the person came from and is disabled while leaving is blocked. One section is current and takes the selection fill; the rest stay neutral. A section that sets `group` opens a labelled group that holds the sections after it until another names its own; the label and the gap tell groups apart, never a rule. Narrow, the identity, the area's name and the labels leave, and each row keeps its icon with its name in a tooltip.
|
|
40
40
|
* @words The back row names where it goes ("Agents", "Back to workspace"); the identity is the object's own name; an area's `label` is its sidebar row's word ("Settings", "Company"); a group heading names the kind of settings ("Account"), in sentence case; sections are nouns ("Skills", "Members").
|
|
41
41
|
* @access The sections are a nav named by `label`; the current one carries aria-current="page". Without `identity` the back row is named by its `label` alone and the centred area name is read as text after it. The identity's mark is decorative beside its name.
|
|
@@ -32,8 +32,8 @@ function actionProps(action, disabled = false) {
|
|
|
32
32
|
* The sidebar swapped to one object or one area: the way back, what you are in, and its sections.
|
|
33
33
|
*
|
|
34
34
|
* @family Navigation
|
|
35
|
-
* @when Inside an object, the same sidebar column shows these instead of the places: an
|
|
36
|
-
* @instead The places a person can go are the sidebar's own groups; a
|
|
35
|
+
* @when Inside an object, the same sidebar column shows these instead of the places: an Installation's sections in the Portal, Nadia's Edit and Settings sections. Inside an area whose pages are siblings a person moves between, the area's sub-menu without `identity`, as Vercel's Settings: the Portal's Settings, Company, Library and Account. The row that opens an area ends in `SidebarMenuChevron`; a row that only opens a page has none. Required: the way back and the nav's `label`; every section has an icon.
|
|
36
|
+
* @instead The places a person can go are the sidebar's own groups; a settings page that does not swap the column is a SettingsPage. Never a second column beside the first. “Tabs imply the views share scope, URL parent, and data model” (https://vercel.com/geist/tabs) Ours: an area whose pages hold different objects, with different lists and different ways to add, is this sub-menu, as Vercel's AI Gateway is; a destination whose pages are views of one reading keeps its Tabs, as Vercel's Analytics and OpenRouter's Activity do (the Portal's Analytics). An object's sections under the top bar are a `TabsNav` band.
|
|
37
37
|
* @behaviour With `identity`: a back arrow row, then what you are in, then the sections. Without it, as Vercel's sub-menu: one row with a ‹ at its start and the area's name centred, then the sections as words alone. The back row returns to where the person came from and is disabled while leaving is blocked. One section is current and takes the selection fill; the rest stay neutral. A section that sets `group` opens a labelled group that holds the sections after it until another names its own; the label and the gap tell groups apart, never a rule. Narrow, the identity, the area's name and the labels leave, and each row keeps its icon with its name in a tooltip.
|
|
38
38
|
* @words The back row names where it goes ("Agents", "Back to workspace"); the identity is the object's own name; an area's `label` is its sidebar row's word ("Settings", "Company"); a group heading names the kind of settings ("Account"), in sentence case; sections are nouns ("Skills", "Members").
|
|
39
39
|
* @access The sections are a nav named by `label`; the current one carries aria-current="page". Without `identity` the back row is named by its `label` alone and the centred area name is read as text after it. The identity's mark is decorative beside its name.
|
|
@@ -77,7 +77,7 @@ type SidebarProps = React.ComponentProps<"div"> & ({
|
|
|
77
77
|
*
|
|
78
78
|
* @family Navigation
|
|
79
79
|
* @when The one left column of the Portal and Nadia: a header, Find, groups of places, an object's sections when the column swaps, a band for the update or the way out, and the account. 256 px wide; the Portal's can be dragged between 224 and 384 px or collapsed to icons.
|
|
80
|
-
* @instead Never a second column
|
|
80
|
+
* @instead Never a second column: an object's sections either swap this column (`SidebarSections`) or stand in a `TabsNav` band under the top bar, as the product's section navigation says. A page's own views are Tabs. A row that opens an area ends in `SidebarMenuChevron`.
|
|
81
81
|
* @behaviour Fills the cell its host gives it and stays in the page flow. `collapsible="icon"` (the default) collapses to 48 px icons with a tooltip name and becomes a sheet under 768 px; with `resize` a handle on its trailing edge drags it, steps it with the arrow keys, resets it on a double-click and collapses it on Enter. `collapsible="none"` is always open and never a sheet. A group is told apart by its label and its padding, never by a rule.
|
|
82
82
|
* @words Each row is a place's noun: "Agents", "Tasks", "Customers"; a count is a bare number. A sheet's title, description and Close label (`mobileTitle`, `mobileDescription`, `mobileCloseLabel`) are required; `resize`, when given, names the handle and comes from the catalogue.
|
|
83
83
|
* @access The column is a landmark; each row is a link or a button with its name, and the current one carries aria-current="page". The handle is a focusable separator with its value in px. The badge's number is read with its row.
|
|
@@ -128,10 +128,10 @@ declare function SidebarMenuSubButton({ render, size, isActive, className, ...pr
|
|
|
128
128
|
isActive?: boolean;
|
|
129
129
|
}): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
130
130
|
/**
|
|
131
|
-
* Vercel's ›: the mark at the end of a row that swaps the column to that area's sub-menu: the Portal's Settings and
|
|
131
|
+
* Vercel's ›: the mark at the end of a row that swaps the column to that area's sub-menu: the Portal's Settings, Company and Library, Nadia's company.
|
|
132
132
|
*
|
|
133
133
|
* @family Navigation
|
|
134
|
-
* @when The last child of a `SidebarMenuButton` whose press replaces the places with the area's sections (`SidebarSections`), never of a row that only goes to a page or to a destination whose views are tabs (the Portal's Analytics
|
|
134
|
+
* @when The last child of a `SidebarMenuButton` whose press replaces the places with the area's sections (`SidebarSections`), never of a row that only goes to a page or to a destination whose views are tabs (the Portal's Analytics).
|
|
135
135
|
* @instead A count is `SidebarMenuBadge`; an external link says so in its name.
|
|
136
136
|
* @behaviour A 16 px muted chevron pushed to the row's end, mirrored in right-to-left. A `Sidebar` with `collapsible="icon"` hides it when collapsed; a column that is narrowed by its host (`collapsible="none"`) leaves it out when narrow: `{narrow ? null : <SidebarMenuChevron />}`.
|
|
137
137
|
* @words None.
|
|
@@ -118,7 +118,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
118
118
|
*
|
|
119
119
|
* @family Navigation
|
|
120
120
|
* @when The one left column of the Portal and Nadia: a header, Find, groups of places, an object's sections when the column swaps, a band for the update or the way out, and the account. 256 px wide; the Portal's can be dragged between 224 and 384 px or collapsed to icons.
|
|
121
|
-
* @instead Never a second column
|
|
121
|
+
* @instead Never a second column: an object's sections either swap this column (`SidebarSections`) or stand in a `TabsNav` band under the top bar, as the product's section navigation says. A page's own views are Tabs. A row that opens an area ends in `SidebarMenuChevron`.
|
|
122
122
|
* @behaviour Fills the cell its host gives it and stays in the page flow. `collapsible="icon"` (the default) collapses to 48 px icons with a tooltip name and becomes a sheet under 768 px; with `resize` a handle on its trailing edge drags it, steps it with the arrow keys, resets it on a double-click and collapses it on Enter. `collapsible="none"` is always open and never a sheet. A group is told apart by its label and its padding, never by a rule.
|
|
123
123
|
* @words Each row is a place's noun: "Agents", "Tasks", "Customers"; a count is a bare number. A sheet's title, description and Close label (`mobileTitle`, `mobileDescription`, `mobileCloseLabel`) are required; `resize`, when given, names the handle and comes from the catalogue.
|
|
124
124
|
* @access The column is a landmark; each row is a link or a button with its name, and the current one carries aria-current="page". The handle is a focusable separator with its value in px. The badge's number is read with its row.
|
|
@@ -356,10 +356,10 @@ function SidebarMenuSubButton({ render, size = "md", isActive = false, className
|
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
358
|
/**
|
|
359
|
-
* Vercel's ›: the mark at the end of a row that swaps the column to that area's sub-menu: the Portal's Settings and
|
|
359
|
+
* Vercel's ›: the mark at the end of a row that swaps the column to that area's sub-menu: the Portal's Settings, Company and Library, Nadia's company.
|
|
360
360
|
*
|
|
361
361
|
* @family Navigation
|
|
362
|
-
* @when The last child of a `SidebarMenuButton` whose press replaces the places with the area's sections (`SidebarSections`), never of a row that only goes to a page or to a destination whose views are tabs (the Portal's Analytics
|
|
362
|
+
* @when The last child of a `SidebarMenuButton` whose press replaces the places with the area's sections (`SidebarSections`), never of a row that only goes to a page or to a destination whose views are tabs (the Portal's Analytics).
|
|
363
363
|
* @instead A count is `SidebarMenuBadge`; an external link says so in its name.
|
|
364
364
|
* @behaviour A 16 px muted chevron pushed to the row's end, mirrored in right-to-left. A `Sidebar` with `collapsible="icon"` hides it when collapsed; a column that is narrowed by its host (`collapsible="none"`) leaves it out when narrow: `{narrow ? null : <SidebarMenuChevron />}`.
|
|
365
365
|
* @words None.
|
|
@@ -21,10 +21,19 @@ type StatusBadgeProps = Omit<ComponentProps<"span">, "children" | "onClick" | "t
|
|
|
21
21
|
* "Map meaning to color: `green` for healthy, `red` for error, `amber` for warning, `blue` for informational or production, `gray` for neutral." (https://vercel.com/geist/badge)
|
|
22
22
|
* Ours: success is green, danger red, warning amber, info blue, neutral gray, whatever the state's
|
|
23
23
|
* name, in our colour values. The tone and the word are required, and the type asks for both.
|
|
24
|
+
* The Portal, Nadia and Alveare draw every status with this one component. In a list or a feed it
|
|
25
|
+
* shows only for the exception, the record or event that differs from the others, such as a
|
|
26
|
+
* failure, a revocation or a wait for a person's decision; the usual state shows nothing, so a
|
|
27
|
+
* status never stands on every row. An Agent fleet's operational-state column and a run history's
|
|
28
|
+
* outcome are facts being compared, so each entry there keeps its badge, Ready and Completed
|
|
29
|
+
* included. An object's own status sits beside its name in the path.
|
|
24
30
|
* @instead "For non-deployment statuses (Workflow runs, Queue messages, Sandbox, Cron jobs), use a `Badge` with the canonical state vocabulary instead of repurposing the dot." (https://vercel.com/geist/status-dot)
|
|
25
31
|
* Ours: that `Badge` is `StatusBadge`. For a category (an installation, a partner) use `Tag`. For
|
|
26
32
|
* plain metadata (a role, a plan) use `Badge`. For a control reporting its own action use
|
|
27
|
-
* `ActionStatus`. A state beside its name still uses this component.
|
|
33
|
+
* `ActionStatus`. A state beside its name still uses this component. A single coloured dot is
|
|
34
|
+
* never a status, beside a visible label and inside an Agent row or filter included; the package
|
|
35
|
+
* exports no status-dot component. An Agent's orb stays her identity and her activity. How far a
|
|
36
|
+
* record is through the steps that make it ready is `ProgressChecklist`.
|
|
28
37
|
* @behaviour "Badges are static labels." (https://vercel.com/geist/badge)
|
|
29
38
|
* "Don’t wire `onClick` onto them; promote to a Button or link if the user can act on the value." (https://vercel.com/geist/badge)
|
|
30
39
|
* Ours: a status never moves and is never a button. It is the tone's shape and the word, with no
|
|
@@ -34,7 +43,8 @@ type StatusBadgeProps = Omit<ComponentProps<"span">, "children" | "onClick" | "t
|
|
|
34
43
|
* take the tone's colour and the word the foreground colour; amber's outline takes its deep step
|
|
35
44
|
* so the triangle holds on white. `size`
|
|
36
45
|
* follows the type beside it: `sm` (a 14 px shape, 12 px word) in a small line such as an Agent's
|
|
37
|
-
* state line, `md` (16 px, 13 px) in a row, `lg` (20 px, 14 px) beside an object's name.
|
|
46
|
+
* state line, `md` (16 px, 13 px) in a row, `lg` (20 px, 14 px) beside an object's name. A new
|
|
47
|
+
* state picks one of the five tones, never a new shape.
|
|
38
48
|
* @words "Title Case, one word when possible, two max: `Active`, `Pending`, `Pro`, `Enterprise Trial`." (https://vercel.com/geist/badge)
|
|
39
49
|
* Ours: a state, not a verb (*Failed*, *Waiting for you*), in sentence case, one to three words, no
|
|
40
50
|
* trailing ellipsis. Italian runs a third longer: *In attesa di te*.
|
|
@@ -43,8 +53,7 @@ type StatusBadgeProps = Omit<ComponentProps<"span">, "children" | "onClick" | "t
|
|
|
43
53
|
* @access "Don’t rely on color alone; the text has to be readable without it." (https://vercel.com/geist/badge)
|
|
44
54
|
* Ours: the word is the name; the shape is `aria-hidden`, so colour never carries the state alone.
|
|
45
55
|
* Not focusable. Each app keeps one value-to-tone map in one module; nothing else picks a status
|
|
46
|
-
* colour.
|
|
47
|
-
* defined by DESIGN.md's Status rule.
|
|
56
|
+
* colour.
|
|
48
57
|
*/
|
|
49
58
|
declare function StatusBadge({ tone, label, since, className, size, ...props }: StatusBadgeProps): import("react").JSX.Element;
|
|
50
59
|
export { StatusBadge, type StatusBadgeProps, type StatusBadgeTone };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/components/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAS5C,KAAK,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7E,KAAK,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAsD1C,KAAK,gBAAgB,GAAG,IAAI,CAC1B,cAAc,CAAC,MAAM,CAAC,EACtB,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,SAAS,CACxF,GAAG;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"status-badge.d.ts","sourceRoot":"","sources":["../../src/components/status-badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAS5C,KAAK,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7E,KAAK,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAsD1C,KAAK,gBAAgB,GAAG,IAAI,CAC1B,cAAc,CAAC,MAAM,CAAC,EACtB,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,SAAS,CACxF,GAAG;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,iBAAS,WAAW,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,IAAW,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BA4B9F;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -38,10 +38,19 @@ function StatusMark({ shape, className, edge, }) {
|
|
|
38
38
|
* "Map meaning to color: `green` for healthy, `red` for error, `amber` for warning, `blue` for informational or production, `gray` for neutral." (https://vercel.com/geist/badge)
|
|
39
39
|
* Ours: success is green, danger red, warning amber, info blue, neutral gray, whatever the state's
|
|
40
40
|
* name, in our colour values. The tone and the word are required, and the type asks for both.
|
|
41
|
+
* The Portal, Nadia and Alveare draw every status with this one component. In a list or a feed it
|
|
42
|
+
* shows only for the exception, the record or event that differs from the others, such as a
|
|
43
|
+
* failure, a revocation or a wait for a person's decision; the usual state shows nothing, so a
|
|
44
|
+
* status never stands on every row. An Agent fleet's operational-state column and a run history's
|
|
45
|
+
* outcome are facts being compared, so each entry there keeps its badge, Ready and Completed
|
|
46
|
+
* included. An object's own status sits beside its name in the path.
|
|
41
47
|
* @instead "For non-deployment statuses (Workflow runs, Queue messages, Sandbox, Cron jobs), use a `Badge` with the canonical state vocabulary instead of repurposing the dot." (https://vercel.com/geist/status-dot)
|
|
42
48
|
* Ours: that `Badge` is `StatusBadge`. For a category (an installation, a partner) use `Tag`. For
|
|
43
49
|
* plain metadata (a role, a plan) use `Badge`. For a control reporting its own action use
|
|
44
|
-
* `ActionStatus`. A state beside its name still uses this component.
|
|
50
|
+
* `ActionStatus`. A state beside its name still uses this component. A single coloured dot is
|
|
51
|
+
* never a status, beside a visible label and inside an Agent row or filter included; the package
|
|
52
|
+
* exports no status-dot component. An Agent's orb stays her identity and her activity. How far a
|
|
53
|
+
* record is through the steps that make it ready is `ProgressChecklist`.
|
|
45
54
|
* @behaviour "Badges are static labels." (https://vercel.com/geist/badge)
|
|
46
55
|
* "Don’t wire `onClick` onto them; promote to a Button or link if the user can act on the value." (https://vercel.com/geist/badge)
|
|
47
56
|
* Ours: a status never moves and is never a button. It is the tone's shape and the word, with no
|
|
@@ -51,7 +60,8 @@ function StatusMark({ shape, className, edge, }) {
|
|
|
51
60
|
* take the tone's colour and the word the foreground colour; amber's outline takes its deep step
|
|
52
61
|
* so the triangle holds on white. `size`
|
|
53
62
|
* follows the type beside it: `sm` (a 14 px shape, 12 px word) in a small line such as an Agent's
|
|
54
|
-
* state line, `md` (16 px, 13 px) in a row, `lg` (20 px, 14 px) beside an object's name.
|
|
63
|
+
* state line, `md` (16 px, 13 px) in a row, `lg` (20 px, 14 px) beside an object's name. A new
|
|
64
|
+
* state picks one of the five tones, never a new shape.
|
|
55
65
|
* @words "Title Case, one word when possible, two max: `Active`, `Pending`, `Pro`, `Enterprise Trial`." (https://vercel.com/geist/badge)
|
|
56
66
|
* Ours: a state, not a verb (*Failed*, *Waiting for you*), in sentence case, one to three words, no
|
|
57
67
|
* trailing ellipsis. Italian runs a third longer: *In attesa di te*.
|
|
@@ -60,8 +70,7 @@ function StatusMark({ shape, className, edge, }) {
|
|
|
60
70
|
* @access "Don’t rely on color alone; the text has to be readable without it." (https://vercel.com/geist/badge)
|
|
61
71
|
* Ours: the word is the name; the shape is `aria-hidden`, so colour never carries the state alone.
|
|
62
72
|
* Not focusable. Each app keeps one value-to-tone map in one module; nothing else picks a status
|
|
63
|
-
* colour.
|
|
64
|
-
* defined by DESIGN.md's Status rule.
|
|
73
|
+
* colour.
|
|
65
74
|
*/
|
|
66
75
|
function StatusBadge({ tone, label, since, className, size = "md", ...props }) {
|
|
67
76
|
const { name, shape, ink, edge } = TONE[tone];
|
|
@@ -21,8 +21,8 @@ export type TableValueProps = {
|
|
|
21
21
|
* @when Every cell of a `DataTable` whose reading can be missing, zero, out of date, unreadable or still loading.
|
|
22
22
|
* @instead A whole table that failed to read is `EmptyState kind="failed"`; a figure on its own is a `KpiCard`.
|
|
23
23
|
* @behaviour “Render `—` in cells where a value is unknown or not applicable. Don’t substitute `N/A`, `null`, or an empty string.” (https://vercel.com/geist/table)
|
|
24
|
-
* Ours: five states that never collapse into a dash: unknown (a muted dash), zero (the figure "0"), stale (the reading, then the stale word), failed (the error mark and its words, in the error colour) and loading (a still 64 × 12 placeholder). A real value, `0` included, is shown as it is.
|
|
25
|
-
* @words Ours: `missingLabel` says what the absence means ("Not reported", never "N/A" or "None"); `staleLabel` is one word ("Stale"); `failedLabel` says the read failed ("Couldn't read").
|
|
24
|
+
* Ours: five states that never collapse into a dash: unknown (a muted dash), zero (the figure "0"), stale (the reading, then the stale word), failed (the error mark and its words, in the error colour) and loading (a still 64 × 12 placeholder). A real value, `0` included, is shown as it is. A missing permission and a setup the person can complete are not unknown either: each keeps its own visible state, never a dash.
|
|
25
|
+
* @words Ours: `missingLabel` says what the absence means ("Not reported", never "N/A" or "None"). An absent report is not "None": "None" is a value, only for a complete report that found nothing; `staleLabel` is one word ("Stale"); `failedLabel` says the read failed ("Couldn't read").
|
|
26
26
|
* @access The dash is hidden and `missingLabel` is read in its place; the error mark is hidden beside its words; the placeholder is decorative, and its cell is `aria-busy` while it loads.
|
|
27
27
|
*/
|
|
28
28
|
export declare function TableValue(props: TableValueProps): string | number | import("react").JSX.Element;
|
|
@@ -8,8 +8,8 @@ import { Skeleton } from "./skeleton.js";
|
|
|
8
8
|
* @when Every cell of a `DataTable` whose reading can be missing, zero, out of date, unreadable or still loading.
|
|
9
9
|
* @instead A whole table that failed to read is `EmptyState kind="failed"`; a figure on its own is a `KpiCard`.
|
|
10
10
|
* @behaviour “Render `—` in cells where a value is unknown or not applicable. Don’t substitute `N/A`, `null`, or an empty string.” (https://vercel.com/geist/table)
|
|
11
|
-
* Ours: five states that never collapse into a dash: unknown (a muted dash), zero (the figure "0"), stale (the reading, then the stale word), failed (the error mark and its words, in the error colour) and loading (a still 64 × 12 placeholder). A real value, `0` included, is shown as it is.
|
|
12
|
-
* @words Ours: `missingLabel` says what the absence means ("Not reported", never "N/A" or "None"); `staleLabel` is one word ("Stale"); `failedLabel` says the read failed ("Couldn't read").
|
|
11
|
+
* Ours: five states that never collapse into a dash: unknown (a muted dash), zero (the figure "0"), stale (the reading, then the stale word), failed (the error mark and its words, in the error colour) and loading (a still 64 × 12 placeholder). A real value, `0` included, is shown as it is. A missing permission and a setup the person can complete are not unknown either: each keeps its own visible state, never a dash.
|
|
12
|
+
* @words Ours: `missingLabel` says what the absence means ("Not reported", never "N/A" or "None"). An absent report is not "None": "None" is a value, only for a complete report that found nothing; `staleLabel` is one word ("Stale"); `failedLabel` says the read failed ("Couldn't read").
|
|
13
13
|
* @access The dash is hidden and `missingLabel` is read in its place; the error mark is hidden beside its words; the placeholder is decorative, and its cell is `aria-busy` while it loads.
|
|
14
14
|
*/
|
|
15
15
|
export function TableValue(props) {
|
|
@@ -25,7 +25,11 @@ type TabsProps = Omit<TabsPrimitive.Root.Props, "value" | "defaultValue" | "onVa
|
|
|
25
25
|
* Ours: the cap is 7 on a desktop and 4 on a phone, for a row of line tabs.
|
|
26
26
|
* @instead "For navigation between unrelated pages, use a sub-menu, not Tabs." (https://vercel.com/geist/tabs) "Tabs imply the views share scope, URL parent, and data model." (https://vercel.com/geist/tabs)
|
|
27
27
|
* Ours: views with their own URL are `TabsNav`. A choice that changes a value is a `RadioGroup` or
|
|
28
|
-
* `ToggleGroup`. A stable destination belongs in the `Sidebar
|
|
28
|
+
* `ToggleGroup`. A stable destination belongs in the `Sidebar`, and a set of different things,
|
|
29
|
+
* such as Nadia's company sections, is pages there, never tabs. A tab never introduces a new scope:
|
|
30
|
+
* another company or Agent is another place, reached from the sidebar or a `ScopeSwitcher`, and a
|
|
31
|
+
* choice of whose things are listed is a filter in the toolbar. Two lists are never stacked with a
|
|
32
|
+
* tab row between them.
|
|
29
33
|
* @behaviour "Selecting a tab is instant; don’t trigger network confirmation or toast on tab change." (https://vercel.com/geist/tabs)
|
|
30
34
|
* "Reflect the active tab in the URL (query param or path) so deep-links and refresh restore state." (https://vercel.com/geist/tabs)
|
|
31
35
|
* "Disable individual tabs only for permission or empty-state reasons; pair the disabled tab with a `tooltip` that names the constraint." (https://vercel.com/geist/tabs)
|
|
@@ -33,10 +37,13 @@ type TabsProps = Omit<TabsPrimitive.Root.Props, "value" | "defaultValue" | "onVa
|
|
|
33
37
|
* description; a tab is disabled only for a permission or an empty state, and `disabled` requires
|
|
34
38
|
* its `disabledReason`. One treatment among siblings, chosen through `variant`, never a page border:
|
|
35
39
|
* `line` (50 px high with 2 px sides, `body-sm` at 400, 24 px between tabs, a 2 px ink underline over
|
|
36
|
-
* the full-width row's 1 px rule) for a page's collections,
|
|
40
|
+
* the full-width row's 1 px rule) for a page's collections, under the title row and above the
|
|
41
|
+
* toolbar, `default` (a 32 px pill with 12 px
|
|
37
42
|
* sides, `label-sm` at 400, no gap between tabs, on the selection fill) for an object's sections.
|
|
38
43
|
* On a coarse or non-hover input a tab is at least 44 px high and wide, as a touch target.
|
|
39
|
-
* The page owns the chosen tab: `value` and `onValueChange` are required.
|
|
44
|
+
* The page owns the chosen tab: `value` and `onValueChange` are required. The page keeps the
|
|
45
|
+
* choice in the URL, as a route or as `?tab=` with the first tab left out, so a reload, Back and a
|
|
46
|
+
* shared link return to it; switching never changes whose things are shown. There is no sliding underline. Colour is neutral only: the
|
|
40
47
|
* chosen tab is ink, the rest are muted until hover, and a disabled tab is never dimmed: in `line`
|
|
41
48
|
* it reads as an unchosen one, in `default` it sits on the selection fill with muted text, both
|
|
42
49
|
* with a not-allowed cursor.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjE,KAAK,YAAY,GACb;IAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,SAAS,CAAA;CAAE,GAC5D;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,KAAK,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,YAAY,CAAC;AAEjF,KAAK,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,eAAe,CAAC,GAAG;IAC5F,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC;CAC7F,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjE,KAAK,YAAY,GACb;IAAE,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,SAAS,CAAA;CAAE,GAC5D;IACE,QAAQ,EAAE,IAAI,CAAC;IACf,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEN,KAAK,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,GAAG,YAAY,CAAC;AAEjF,KAAK,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,eAAe,CAAC,GAAG;IAC5F,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC;CAC7F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,WAA0B,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,qBAU3E;AAED,QAAA,MAAM,gBAAgB;;8EAarB,CAAC;AAEF,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,iBAAiB,CAAC,GACjE,YAAY,CAAC,OAAO,gBAAgB,CAAC,GACrC,YAAY,qBAUb;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,QAAQ,EACR,cAAc,EACd,kBAAkB,EAAE,WAAW,EAC/B,GAAG,KAAK,EACT,EAAE,gBAAgB,qBAmClB;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,CAAC,KAAK,CAAC,KAAK,qBAQtE;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;AACtE,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -15,7 +15,11 @@ import { cn } from "../lib/utils.js";
|
|
|
15
15
|
* Ours: the cap is 7 on a desktop and 4 on a phone, for a row of line tabs.
|
|
16
16
|
* @instead "For navigation between unrelated pages, use a sub-menu, not Tabs." (https://vercel.com/geist/tabs) "Tabs imply the views share scope, URL parent, and data model." (https://vercel.com/geist/tabs)
|
|
17
17
|
* Ours: views with their own URL are `TabsNav`. A choice that changes a value is a `RadioGroup` or
|
|
18
|
-
* `ToggleGroup`. A stable destination belongs in the `Sidebar
|
|
18
|
+
* `ToggleGroup`. A stable destination belongs in the `Sidebar`, and a set of different things,
|
|
19
|
+
* such as Nadia's company sections, is pages there, never tabs. A tab never introduces a new scope:
|
|
20
|
+
* another company or Agent is another place, reached from the sidebar or a `ScopeSwitcher`, and a
|
|
21
|
+
* choice of whose things are listed is a filter in the toolbar. Two lists are never stacked with a
|
|
22
|
+
* tab row between them.
|
|
19
23
|
* @behaviour "Selecting a tab is instant; don’t trigger network confirmation or toast on tab change." (https://vercel.com/geist/tabs)
|
|
20
24
|
* "Reflect the active tab in the URL (query param or path) so deep-links and refresh restore state." (https://vercel.com/geist/tabs)
|
|
21
25
|
* "Disable individual tabs only for permission or empty-state reasons; pair the disabled tab with a `tooltip` that names the constraint." (https://vercel.com/geist/tabs)
|
|
@@ -23,10 +27,13 @@ import { cn } from "../lib/utils.js";
|
|
|
23
27
|
* description; a tab is disabled only for a permission or an empty state, and `disabled` requires
|
|
24
28
|
* its `disabledReason`. One treatment among siblings, chosen through `variant`, never a page border:
|
|
25
29
|
* `line` (50 px high with 2 px sides, `body-sm` at 400, 24 px between tabs, a 2 px ink underline over
|
|
26
|
-
* the full-width row's 1 px rule) for a page's collections,
|
|
30
|
+
* the full-width row's 1 px rule) for a page's collections, under the title row and above the
|
|
31
|
+
* toolbar, `default` (a 32 px pill with 12 px
|
|
27
32
|
* sides, `label-sm` at 400, no gap between tabs, on the selection fill) for an object's sections.
|
|
28
33
|
* On a coarse or non-hover input a tab is at least 44 px high and wide, as a touch target.
|
|
29
|
-
* The page owns the chosen tab: `value` and `onValueChange` are required.
|
|
34
|
+
* The page owns the chosen tab: `value` and `onValueChange` are required. The page keeps the
|
|
35
|
+
* choice in the URL, as a route or as `?tab=` with the first tab left out, so a reload, Back and a
|
|
36
|
+
* shared link return to it; switching never changes whose things are shown. There is no sliding underline. Colour is neutral only: the
|
|
30
37
|
* chosen tab is ink, the rest are muted until hover, and a disabled tab is never dimmed: in `line`
|
|
31
38
|
* it reads as an unchosen one, in `default` it sits on the selection fill with muted text, both
|
|
32
39
|
* with a not-allowed cursor.
|
|
@@ -16,8 +16,9 @@ declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.
|
|
|
16
16
|
* @instead "For an entity preview with metadata rows (avatar, identifier, 2–4 facts, optional
|
|
17
17
|
* action), use `Context Card`." "For long-form content or actions that need persistence, route to a
|
|
18
18
|
* `Drawer` or page navigation." (https://vercel.com/geist/tooltip)
|
|
19
|
-
* Ours: `Context Card` is `HoverCard
|
|
20
|
-
*
|
|
19
|
+
* Ours: `Context Card` is `HoverCard`, which only this package's components draw, such as
|
|
20
|
+
* `RecordTime`, and `Drawer` is `Sheet`. Essential reasons and actions never live only in a hover
|
|
21
|
+
* tooltip: a disabled command's reason is written under it.
|
|
21
22
|
* @behaviour "Tooltips open on hover and on keyboard focus." "Keep the default ~150ms entry delay so
|
|
22
23
|
* the tooltip doesn’t flicker on a sweeping mouse." "Don’t wrap a labelled `Input` in a Tooltip."
|
|
23
24
|
* "The trigger lands on the `<label>`, not the field, and the tooltip text becomes a second
|