@nadicodeai/ui 12.1.240 → 12.1.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action-menu.d.ts +5 -1
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/assistant-panel-header.d.ts +25 -0
- package/dist/components/assistant-panel-header.d.ts.map +1 -0
- package/dist/components/assistant-panel-header.js +18 -0
- package/dist/components/assistant-welcome.d.ts +26 -0
- package/dist/components/assistant-welcome.d.ts.map +1 -0
- package/dist/components/assistant-welcome.js +16 -0
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +6 -1
- package/dist/components/collection-filters.d.ts +6 -3
- package/dist/components/collection-filters.d.ts.map +1 -1
- package/dist/components/collection-filters.js +5 -4
- package/dist/components/column-foot.d.ts +3 -2
- package/dist/components/column-foot.d.ts.map +1 -1
- package/dist/components/column-foot.js +2 -1
- package/dist/components/company-card-actions.d.ts +19 -0
- package/dist/components/company-card-actions.d.ts.map +1 -0
- package/dist/components/company-card-actions.js +16 -0
- package/dist/components/confirm-dialog.d.ts +6 -1
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +17 -3
- package/dist/components/drawer-steps.d.ts +8 -7
- package/dist/components/drawer-steps.d.ts.map +1 -1
- package/dist/components/drawer-steps.js +7 -6
- package/dist/components/figure-row.d.ts +2 -4
- package/dist/components/figure-row.d.ts.map +1 -1
- package/dist/components/figure-row.js +3 -3
- package/dist/components/filter-toolbar.d.ts +2 -4
- package/dist/components/filter-toolbar.d.ts.map +1 -1
- package/dist/components/filter-toolbar.js +2 -2
- package/dist/components/folder-field.d.ts +30 -0
- package/dist/components/folder-field.d.ts.map +1 -0
- package/dist/components/folder-field.js +22 -0
- package/dist/components/form-dialog.d.ts +11 -2
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +18 -3
- package/dist/components/item.d.ts +5 -9
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +5 -9
- package/dist/components/numbered-steps.d.ts +8 -5
- package/dist/components/numbered-steps.d.ts.map +1 -1
- package/dist/components/numbered-steps.js +5 -4
- package/dist/components/object-workspace.d.ts +2 -2
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +2 -2
- package/dist/components/page-actions.d.ts +5 -5
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +9 -4
- package/dist/components/plan-card.d.ts +14 -2
- package/dist/components/plan-card.d.ts.map +1 -1
- package/dist/components/plan-card.js +3 -2
- package/dist/components/product-band.d.ts +19 -7
- package/dist/components/product-band.d.ts.map +1 -1
- package/dist/components/product-band.js +12 -6
- package/dist/components/product-shell-bell.d.ts +71 -0
- package/dist/components/product-shell-bell.d.ts.map +1 -0
- package/dist/components/product-shell-bell.js +36 -0
- package/dist/components/product-shell.d.ts +21 -4
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +23 -2
- package/dist/components/record-list.d.ts +4 -2
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +10 -7
- package/dist/components/settings-facts.d.ts +5 -4
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +4 -3
- package/dist/components/settings-section.d.ts +11 -9
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +7 -6
- package/dist/internal/clear-filters.d.ts +7 -0
- package/dist/internal/clear-filters.d.ts.map +1 -0
- package/dist/internal/clear-filters.js +6 -0
- package/dist/internal/command-runner.d.ts +30 -5
- package/dist/internal/command-runner.d.ts.map +1 -1
- package/dist/internal/command-runner.js +61 -14
- package/dist/internal/footer-commands.d.ts +33 -0
- package/dist/internal/footer-commands.d.ts.map +1 -0
- package/dist/internal/footer-commands.js +27 -0
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +2 -4
- package/dist/internal/form-submit.d.ts +3 -2
- package/dist/internal/form-submit.d.ts.map +1 -1
- package/dist/internal/form-submit.js +2 -2
- package/dist/internal/page-command-button.d.ts +11 -1
- package/dist/internal/page-command-button.d.ts.map +1 -1
- package/dist/internal/page-command-button.js +3 -0
- package/dist/showcase/specimens/actions.d.ts +1 -0
- package/dist/showcase/specimens/actions.d.ts.map +1 -1
- package/dist/showcase/specimens/actions.js +12 -1
- package/dist/showcase/specimens/compositions.d.ts +2 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +16 -7
- package/dist/showcase/specimens/data.d.ts.map +1 -1
- package/dist/showcase/specimens/data.js +1 -1
- package/dist/showcase/specimens/index.d.ts +5 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.d.ts +1 -0
- package/dist/showcase/specimens/inputs.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.js +2 -0
- package/dist/showcase/specimens/navigation.d.ts +2 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.js +28 -0
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +85 -30
- package/package.json +2 -2
|
@@ -205,6 +205,8 @@ export type RecordListProps<TRecord extends RowData> = RecordCommandsOf<TRecord>
|
|
|
205
205
|
*/
|
|
206
206
|
heading?: {
|
|
207
207
|
title: string;
|
|
208
|
+
/** The section's id, so a link to it lands on it: "ssh-keys" for `#ssh-keys`. */
|
|
209
|
+
id?: string | undefined;
|
|
208
210
|
/** The list's state right after the title: a `CheckCounts`. */
|
|
209
211
|
status?: ReactElement;
|
|
210
212
|
description?: ReactNode;
|
|
@@ -242,7 +244,7 @@ export declare function RecordListSkeleton({ rows, notice, }: {
|
|
|
242
244
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
243
245
|
* “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
|
|
244
246
|
* Ours: Geist's `Table` is a `DataTable`, for rows that are not things a person opens but lines of figures read and compared under a visible heading row: usage per product, the amounts in a statement, invoices (owner, 2026-11-08). A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item` (nadicode decision).
|
|
245
|
-
* @behaviour One bordered card, a 1 px rule between records and none after the last. No list draws a heading row a person sees: its column names are read by screen readers only, so every value on a row names itself (owner, 2026-11-08). From 48rem of card, one width whatever the columns, the records stand in aligned columns, and on a narrower card each record is a card of its own: its first line holds the mark and the name with the controls beside them (the `select` box before, the `checklist` ring and the commands after), the ring and the commands moving under the name when beside it the name would have less than 10rem, and its facts, state and time wrap under it, each whole, a fact the record lacks left out. The columns stand left to right: the `select` box, the identity (the rest of the row, never less than 10rem), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring and the commands; the browser lays them out, the sized ones at their `size` while the row has room and narrower, each value ending in an ellipsis, when it has not, and the ring and the commands as wide as their widest row, never narrower than a `commandsSize` the caller gives. A row is 72 px. A `checklist` puts the record's `ProgressChecklist` ring just before its commands; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line, which `wraps="detail"` lets wrap in full where the person must read it whole; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. With `layout="line"`, the facts and the status share one muted line, joined by a middle dot, in one column. The product gives each record's `commands`, everything it can do now, and the list draws them: every command in the three dots, the record's name heading them and a destructive one last, after a divider, in the error colour; the one marked `main`, which the row is waiting on (a request to approve, a connection to finish), stands as a 32 px outline button before the three dots (owner, 2026-11-08); one whose label follows the record's state, such as Turn off and Turn on, names its other labels in `sameWidthAs`, so its button keeps one width on every row and in every state (owner, 2026-11-12). A command a record cannot run now stays, disabled, with a lock at its end and its reason read by a screen reader, never a line of text (owner, 2026-11-09); only permission leaves one out (nadicode decision). More than ten commands for a record, or two marked `main`, throws in development and tests (nadicode decision). Every column of the records' attributes stands on every row, so the values line up: a record with no value for a fact draws `TableValue`'s muted dash, with the fact's `missing` read in its place; the record's state stands on every row too, *Ready* included (owner, 2026-11-08); the commands column, which holds no attribute, stands only while a record has a command, a menu or a message, or the list gives `commandsSize`. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands. With `open` the whole row is one target and takes the `accent` hover, with no chevron; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A list that is a section of another page takes `heading`, drawn above the box and never inside it: its title, the one sentence under it, and at the title row's trailing edge its `actions`, such as its Add command and a muted count; the box holds the rows alone (owner, 2026-11-09). The heading's actions act on the list as a whole, adding a record; a command on one record is that record's, in its own row, never in the heading's menu (owner, 2026-11-09). A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging. A long list a person reads in part, such as their signed-in sessions, takes `footer.more`: its first `shows` records, then an outline button at the footer's end that shows the rest and, once they show, fewer again, its `aria-expanded` saying which; the page never draws that button under the list itself (nadicode decision). A list a person picks from (`select`) says what the chosen records do together: while any is chosen, the footer's count becomes theirs ("2 selected") and their one command stands at the footer's end as an outline button ("Invite 2"); the record's own commands stay on its row, so a person never has to choose a record to act on it. Colour is neutral, the name in ink and every other cell in the body grey, except the status badge, a `Tag` and a failed action's message.
|
|
247
|
+
* @behaviour One bordered card, a 1 px rule between records and none after the last. No list draws a heading row a person sees: its column names are read by screen readers only, so every value on a row names itself (owner, 2026-11-08). From 48rem of card, one width whatever the columns, the records stand in aligned columns, and on a narrower card each record is a card of its own: its first line holds the mark and the name with the controls beside them (the `select` box before, the `checklist` ring and the commands after), the ring and the commands moving under the name when beside it the name would have less than 10rem, and its facts, state and time wrap under it, each whole, a fact the record lacks left out. The columns stand left to right: the `select` box, the identity (the rest of the row, never less than 10rem), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring and the commands; the browser lays them out, the sized ones at their `size` while the row has room and narrower, each value ending in an ellipsis, when it has not, and the ring and the commands as wide as their widest row, never narrower than a `commandsSize` the caller gives. A row is 72 px. A `checklist` puts the record's `ProgressChecklist` ring just before its commands; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line, which `wraps="detail"` lets wrap in full where the person must read it whole; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. With `layout="line"`, the facts and the status share one muted line, joined by a middle dot, in one column. The product gives each record's `commands`, everything it can do now, and the list draws them: every command in the three dots, the record's name heading them and a destructive one last, after a divider, in the error colour; the one marked `main`, which the row is waiting on (a request to approve, a connection to finish), stands as a 32 px outline button before the three dots (owner, 2026-11-08); one whose label follows the record's state, such as Turn off and Turn on, names its other labels in `sameWidthAs`, so its button keeps one width on every row and in every state (owner, 2026-11-12). A command a record cannot run now stays, disabled, with a lock at its end and its reason read by a screen reader, never a line of text (owner, 2026-11-09); only permission leaves one out (nadicode decision). More than ten commands for a record, or two marked `main`, throws in development and tests (nadicode decision). Every column of the records' attributes stands on every row, so the values line up: a record with no value for a fact draws `TableValue`'s muted dash, with the fact's `missing` read in its place; the record's state stands on every row too, *Ready* included (owner, 2026-11-08); the commands column, which holds no attribute, stands only while a record has a command, a menu or a message, or the list gives `commandsSize`. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands. With `open` the whole row is one target and takes the `accent` hover, with no chevron; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A list that is a section of another page takes `heading`, drawn above the box and never inside it: its title, the one sentence under it, and at the title row's trailing edge its `actions`, such as its Add command and a muted count; the box holds the rows alone (owner, 2026-11-09). The heading's `id` names the section that holds the heading and the rows together, so a link to it lands on the list. The heading's actions act on the list as a whole, adding a record; a command on one record is that record's, in its own row, never in the heading's menu (owner, 2026-11-09). A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging. A long list a person reads in part, such as their signed-in sessions, takes `footer.more`: its first `shows` records, then an outline button at the footer's end that shows the rest and, once they show, fewer again, its `aria-expanded` saying which; the page never draws that button under the list itself (nadicode decision). A list a person picks from (`select`) says what the chosen records do together: while any is chosen, the footer's count becomes theirs ("2 selected") and their one command stands at the footer's end as an outline button ("Invite 2"); the record's own commands stay on its row, so a person never has to choose a record to act on it. Colour is neutral, the name in ink and every other cell in the body grey, except the status badge, a `Tag` and a failed action's message.
|
|
246
248
|
* “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state)
|
|
247
249
|
* Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card (nadicode decision).
|
|
248
250
|
* “The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`.” (https://vercel.com/geist/entity)
|
|
@@ -257,7 +259,7 @@ export declare function RecordListSkeleton({ rows, notice, }: {
|
|
|
257
259
|
* “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)
|
|
258
260
|
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the 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, and says what it is with no heading over it: a kind ("Customer"), a count with its unit ("3 keys"), a time or a date in its sentence ("Updated 3h ago", "Auto-renews Aug 3"), a figure after the word that names it, with its meter where it has one ("Included 92% of $200.00", "Extra €15.00"), a state as its badge, or a name after the mark of its kind (`icon`, a `Tag`'s `mark`, a plan's emblem). 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 name their columns for assistive technology ("Partner", "State", "Asked"). A condition of the record that waits on someone, outside its state, is the `badge` beside its name. 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, `moreLabel` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the record's state in `StatusBadge`'s words, never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent". The footer holds the paging, never how many records the list holds or a help sentence: the rows end at the last record, and guidance a step needs lives in that step (owner, 2026-11-09).
|
|
259
261
|
* @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)
|
|
260
|
-
* 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 `moreLabel`, and the menu's first line names the record; a right-click on a row opens every command of the record in one menu. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them (nadicode decision). `RecordListSkeleton`, which a page shows while it reads the records, is busy and carries no words.
|
|
262
|
+
* 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 `moreLabel`, and the menu's first line names the record; a right-click on a row opens every command of the record in one menu. Once a confirmed command takes its row away, focus goes to the list's heading, or to the list itself when it has none (nadicode decision). The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them (nadicode decision). `RecordListSkeleton`, which a page shows while it reads the records, is busy and carries no words.
|
|
261
263
|
* “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)
|
|
262
264
|
* Ours: each box is named by `select.label`, which reads "Select {record}" (nadicode decision).
|
|
263
265
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record-list.d.ts","sourceRoot":"","sources":["../../src/components/record-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"record-list.d.ts","sourceRoot":"","sources":["../../src/components/record-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAKf,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAE,KAAK,UAAU,EAAsC,MAAM,8BAA8B,CAAC;AA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AAK,EAAE,MAAM,CAAC;QACd,iFAAiF;QACjF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxB,+DAA+D;QAC/D,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,WAAW,CAAC,EAAE,SAAS,CAAC;QACxB,6GAA6G;QAC7G,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,CAAC;IACF,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,iFAAiF;IACjF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,UAAU,GAAG,IAAI,CAAC;IAC/C;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,OAAO,SAAS,OAAO,EAAE,GAAG,SAAS,WAAW,IAC5E,eAAe,CAAC,OAAO,CAAC,SAAS,MAAM,MAAM,GACzC,MAAM,SAAS,OAAO,GACpB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,KAAK,GACP,KAAK,CAAC;AAyNZ;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,IAAQ,EACR,MAAM,GACP,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACxC,+BAiBA;AA2JD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,sCAqGlF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
-
import { createContext, useContext, useId, useState, } from "react";
|
|
4
|
+
import { createContext, useCallback, useContext, useId, useRef, useState, } from "react";
|
|
5
5
|
import { ActionMenu } from "./action-menu.js";
|
|
6
6
|
import { Button } from "./button.js";
|
|
7
7
|
import { Checkbox } from "./checkbox.js";
|
|
@@ -17,7 +17,7 @@ import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
|
17
17
|
import { StatusBadge } from "./status-badge.js";
|
|
18
18
|
import { TableCard } from "./table-card.js";
|
|
19
19
|
import { TableValue } from "./table-value.js";
|
|
20
|
-
import { useCommandRunner } from "../internal/command-runner.js";
|
|
20
|
+
import { CommandFocusFallback, useCommandRunner, } from "../internal/command-runner.js";
|
|
21
21
|
import { RowMessageActions, RowMessageLine } from "../internal/row-message.js";
|
|
22
22
|
function shownCommands(list, record) {
|
|
23
23
|
const name = list.name(record).name;
|
|
@@ -267,7 +267,7 @@ function RecordRows(props) {
|
|
|
267
267
|
* @instead “For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity)
|
|
268
268
|
* “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity)
|
|
269
269
|
* Ours: Geist's `Table` is a `DataTable`, for rows that are not things a person opens but lines of figures read and compared under a visible heading row: usage per product, the amounts in a statement, invoices (owner, 2026-11-08). A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item` (nadicode decision).
|
|
270
|
-
* @behaviour One bordered card, a 1 px rule between records and none after the last. No list draws a heading row a person sees: its column names are read by screen readers only, so every value on a row names itself (owner, 2026-11-08). From 48rem of card, one width whatever the columns, the records stand in aligned columns, and on a narrower card each record is a card of its own: its first line holds the mark and the name with the controls beside them (the `select` box before, the `checklist` ring and the commands after), the ring and the commands moving under the name when beside it the name would have less than 10rem, and its facts, state and time wrap under it, each whole, a fact the record lacks left out. The columns stand left to right: the `select` box, the identity (the rest of the row, never less than 10rem), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring and the commands; the browser lays them out, the sized ones at their `size` while the row has room and narrower, each value ending in an ellipsis, when it has not, and the ring and the commands as wide as their widest row, never narrower than a `commandsSize` the caller gives. A row is 72 px. A `checklist` puts the record's `ProgressChecklist` ring just before its commands; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line, which `wraps="detail"` lets wrap in full where the person must read it whole; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. With `layout="line"`, the facts and the status share one muted line, joined by a middle dot, in one column. The product gives each record's `commands`, everything it can do now, and the list draws them: every command in the three dots, the record's name heading them and a destructive one last, after a divider, in the error colour; the one marked `main`, which the row is waiting on (a request to approve, a connection to finish), stands as a 32 px outline button before the three dots (owner, 2026-11-08); one whose label follows the record's state, such as Turn off and Turn on, names its other labels in `sameWidthAs`, so its button keeps one width on every row and in every state (owner, 2026-11-12). A command a record cannot run now stays, disabled, with a lock at its end and its reason read by a screen reader, never a line of text (owner, 2026-11-09); only permission leaves one out (nadicode decision). More than ten commands for a record, or two marked `main`, throws in development and tests (nadicode decision). Every column of the records' attributes stands on every row, so the values line up: a record with no value for a fact draws `TableValue`'s muted dash, with the fact's `missing` read in its place; the record's state stands on every row too, *Ready* included (owner, 2026-11-08); the commands column, which holds no attribute, stands only while a record has a command, a menu or a message, or the list gives `commandsSize`. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands. With `open` the whole row is one target and takes the `accent` hover, with no chevron; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A list that is a section of another page takes `heading`, drawn above the box and never inside it: its title, the one sentence under it, and at the title row's trailing edge its `actions`, such as its Add command and a muted count; the box holds the rows alone (owner, 2026-11-09). The heading's actions act on the list as a whole, adding a record; a command on one record is that record's, in its own row, never in the heading's menu (owner, 2026-11-09). A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging. A long list a person reads in part, such as their signed-in sessions, takes `footer.more`: its first `shows` records, then an outline button at the footer's end that shows the rest and, once they show, fewer again, its `aria-expanded` saying which; the page never draws that button under the list itself (nadicode decision). A list a person picks from (`select`) says what the chosen records do together: while any is chosen, the footer's count becomes theirs ("2 selected") and their one command stands at the footer's end as an outline button ("Invite 2"); the record's own commands stay on its row, so a person never has to choose a record to act on it. Colour is neutral, the name in ink and every other cell in the body grey, except the status badge, a `Tag` and a failed action's message.
|
|
270
|
+
* @behaviour One bordered card, a 1 px rule between records and none after the last. No list draws a heading row a person sees: its column names are read by screen readers only, so every value on a row names itself (owner, 2026-11-08). From 48rem of card, one width whatever the columns, the records stand in aligned columns, and on a narrower card each record is a card of its own: its first line holds the mark and the name with the controls beside them (the `select` box before, the `checklist` ring and the commands after), the ring and the commands moving under the name when beside it the name would have less than 10rem, and its facts, state and time wrap under it, each whole, a fact the record lacks left out. The columns stand left to right: the `select` box, the identity (the rest of the row, never less than 10rem), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring and the commands; the browser lays them out, the sized ones at their `size` while the row has room and narrower, each value ending in an ellipsis, when it has not, and the ring and the commands as wide as their widest row, never narrower than a `commandsSize` the caller gives. A row is 72 px. A `checklist` puts the record's `ProgressChecklist` ring just before its commands; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line, which `wraps="detail"` lets wrap in full where the person must read it whole; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. With `layout="line"`, the facts and the status share one muted line, joined by a middle dot, in one column. The product gives each record's `commands`, everything it can do now, and the list draws them: every command in the three dots, the record's name heading them and a destructive one last, after a divider, in the error colour; the one marked `main`, which the row is waiting on (a request to approve, a connection to finish), stands as a 32 px outline button before the three dots (owner, 2026-11-08); one whose label follows the record's state, such as Turn off and Turn on, names its other labels in `sameWidthAs`, so its button keeps one width on every row and in every state (owner, 2026-11-12). A command a record cannot run now stays, disabled, with a lock at its end and its reason read by a screen reader, never a line of text (owner, 2026-11-09); only permission leaves one out (nadicode decision). More than ten commands for a record, or two marked `main`, throws in development and tests (nadicode decision). Every column of the records' attributes stands on every row, so the values line up: a record with no value for a fact draws `TableValue`'s muted dash, with the fact's `missing` read in its place; the record's state stands on every row too, *Ready* included (owner, 2026-11-08); the commands column, which holds no attribute, stands only while a record has a command, a menu or a message, or the list gives `commandsSize`. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands. With `open` the whole row is one target and takes the `accent` hover, with no chevron; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A list that is a section of another page takes `heading`, drawn above the box and never inside it: its title, the one sentence under it, and at the title row's trailing edge its `actions`, such as its Add command and a muted count; the box holds the rows alone (owner, 2026-11-09). The heading's `id` names the section that holds the heading and the rows together, so a link to it lands on the list. The heading's actions act on the list as a whole, adding a record; a command on one record is that record's, in its own row, never in the heading's menu (owner, 2026-11-09). A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging. A long list a person reads in part, such as their signed-in sessions, takes `footer.more`: its first `shows` records, then an outline button at the footer's end that shows the rest and, once they show, fewer again, its `aria-expanded` saying which; the page never draws that button under the list itself (nadicode decision). A list a person picks from (`select`) says what the chosen records do together: while any is chosen, the footer's count becomes theirs ("2 selected") and their one command stands at the footer's end as an outline button ("Invite 2"); the record's own commands stay on its row, so a person never has to choose a record to act on it. Colour is neutral, the name in ink and every other cell in the body grey, except the status badge, a `Tag` and a failed action's message.
|
|
271
271
|
* “Pick the variant by what the user needs: no-results for a filtered list that returned zero rows, blank slate or informational for a resource the user hasn’t created, cleared for completed work, permission for role or tier denials, error for a failed load.” (https://vercel.com/geist/empty-state)
|
|
272
272
|
* Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card (nadicode decision).
|
|
273
273
|
* “The right column holds at most one or two controls. If the row needs more, move secondary actions into a `Dots Menu`.” (https://vercel.com/geist/entity)
|
|
@@ -282,13 +282,16 @@ function RecordRows(props) {
|
|
|
282
282
|
* “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)
|
|
283
283
|
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the 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, and says what it is with no heading over it: a kind ("Customer"), a count with its unit ("3 keys"), a time or a date in its sentence ("Updated 3h ago", "Auto-renews Aug 3"), a figure after the word that names it, with its meter where it has one ("Included 92% of $200.00", "Extra €15.00"), a state as its badge, or a name after the mark of its kind (`icon`, a `Tag`'s `mark`, a plan's emblem). 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 name their columns for assistive technology ("Partner", "State", "Asked"). A condition of the record that waits on someone, outside its state, is the `badge` beside its name. 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, `moreLabel` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the record's state in `StatusBadge`'s words, never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent". The footer holds the paging, never how many records the list holds or a help sentence: the rows end at the last record, and guidance a step needs lives in that step (owner, 2026-11-09).
|
|
284
284
|
* @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)
|
|
285
|
-
* 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 `moreLabel`, and the menu's first line names the record; a right-click on a row opens every command of the record in one menu. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them (nadicode decision). `RecordListSkeleton`, which a page shows while it reads the records, is busy and carries no words.
|
|
285
|
+
* 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 `moreLabel`, and the menu's first line names the record; a right-click on a row opens every command of the record in one menu. Once a confirmed command takes its row away, focus goes to the list's heading, or to the list itself when it has none (nadicode decision). The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them (nadicode decision). `RecordListSkeleton`, which a page shows while it reads the records, is busy and carries no words.
|
|
286
286
|
* “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)
|
|
287
287
|
* Ours: each box is named by `select.label`, which reads "Select {record}" (nadicode decision).
|
|
288
288
|
*/
|
|
289
289
|
export function RecordList(props) {
|
|
290
290
|
const { heading, footer, select } = props;
|
|
291
|
-
const
|
|
291
|
+
const title = useRef(null);
|
|
292
|
+
const box = useRef(null);
|
|
293
|
+
const focusAfterRowGoes = useCallback(() => title.current ?? box.current, []);
|
|
294
|
+
const { arm, dialog } = useCommandRunner(focusAfterRowGoes);
|
|
292
295
|
const [allShown, setAllShown] = useState(false);
|
|
293
296
|
const more = footer?.more;
|
|
294
297
|
const cut = more !== undefined && props.records !== undefined && props.records.length > more.shows;
|
|
@@ -317,6 +320,6 @@ export function RecordList(props) {
|
|
|
317
320
|
else {
|
|
318
321
|
body = _jsx(RecordRows, { ...props, records: records });
|
|
319
322
|
}
|
|
320
|
-
const list = (_jsx(TableCard, { footer: chosen || pages || cut ? (_jsxs(_Fragment, { children: [chosen ? _jsx(PageCommandButton, { command: chosen.command, variant: "outline" }) : null, pages ? _jsx(Pages, { pages: pages }) : null, cut ? (_jsx(Button, { "aria-expanded": allShown, onClick: () => setAllShown((shown) => !shown), type: "button", variant: "outline", children: allShown ? more.showFewerLabel : more.showAllLabel })) : null] })) : undefined, footerHint: chosen?.count ?? footer?.count, note: footer?.note, children: _jsx(ShownList.Provider, { value: props, children: _jsx(RowCommandsArm.Provider, { value: arm, children: _jsx(SkeletonRegion, { busy: loading, children: body }) }) }) }));
|
|
321
|
-
return (_jsxs(_Fragment, { children: [heading ? (_jsxs("section", { className: "grid min-w-0 gap-3", "data-slot": "record-list-section", children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2", "data-slot": "record-list-heading", children: [_jsxs("div", { className: "grid min-w-0 flex-[1_1_16rem] gap-1", children: [_jsxs("div", { className: cn("text-heading-sm", heading.status && "flex flex-wrap items-center gap-2"), children: [_jsx("h2", { children: heading.title }), heading.status] }), heading.description ? (_jsx("p", { className: "text-sm text-muted-foreground", children: heading.description })) : null] }), heading.actions ? _jsx(CardActionsRow, { ...heading.actions }) : null] }), list] })) : (list), dialog] }));
|
|
323
|
+
const list = (_jsx(TableCard, { ref: box, tabIndex: heading ? undefined : -1, footer: chosen || pages || cut ? (_jsxs(_Fragment, { children: [chosen ? _jsx(PageCommandButton, { command: chosen.command, variant: "outline" }) : null, pages ? _jsx(Pages, { pages: pages }) : null, cut ? (_jsx(Button, { "aria-expanded": allShown, onClick: () => setAllShown((shown) => !shown), type: "button", variant: "outline", children: allShown ? more.showFewerLabel : more.showAllLabel })) : null] })) : undefined, footerHint: chosen?.count ?? footer?.count, note: footer?.note, children: _jsx(ShownList.Provider, { value: props, children: _jsx(RowCommandsArm.Provider, { value: arm, children: _jsx(CommandFocusFallback, { to: focusAfterRowGoes, children: _jsx(SkeletonRegion, { busy: loading, children: body }) }) }) }) }));
|
|
324
|
+
return (_jsxs(_Fragment, { children: [heading ? (_jsxs("section", { className: "grid min-w-0 gap-3", "data-slot": "record-list-section", id: heading.id, children: [_jsxs("div", { className: "flex min-w-0 flex-wrap items-start justify-between gap-x-4 gap-y-2", "data-slot": "record-list-heading", children: [_jsxs("div", { className: "grid min-w-0 flex-[1_1_16rem] gap-1", children: [_jsxs("div", { className: cn("text-heading-sm", heading.status && "flex flex-wrap items-center gap-2"), children: [_jsx("h2", { ref: title, tabIndex: -1, children: heading.title }), heading.status] }), heading.description ? (_jsx("p", { className: "text-sm text-muted-foreground", children: heading.description })) : null] }), heading.actions ? _jsx(CardActionsRow, { ...heading.actions }) : null] }), list] })) : (list), dialog] }));
|
|
322
325
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
+
import { type FooterCommand } from "../internal/footer-commands.js";
|
|
2
3
|
import { type EmptyStateKind } from "./empty-state.js";
|
|
3
4
|
import { type CardActions } from "./page-actions.js";
|
|
4
5
|
import { Card, type CardSurface } from "./card.js";
|
|
@@ -16,10 +17,10 @@ type SettingsFactsBase = Omit<ComponentPropsWithoutRef<"section">, "children" |
|
|
|
16
17
|
/** The facts' commands at the header's trailing edge, drawn as every card draws them: "Edit". */
|
|
17
18
|
actions?: CardActions;
|
|
18
19
|
/**
|
|
19
|
-
* The one
|
|
20
|
-
* Review billing. Never a Save.
|
|
20
|
+
* The one command the card's state asks for, drawn filled at the footer's right beside its line:
|
|
21
|
+
* Update, Start, Review billing. Never a Save.
|
|
21
22
|
*/
|
|
22
|
-
action?:
|
|
23
|
+
action?: FooterCommand | undefined;
|
|
23
24
|
facts: readonly SettingsFact[];
|
|
24
25
|
missingValueLabel: string;
|
|
25
26
|
/**
|
|
@@ -73,7 +74,7 @@ export type SettingsFactsSectionProps = SettingsFactsBase & ({
|
|
|
73
74
|
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
74
75
|
* @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
76
|
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
76
|
-
* `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one
|
|
77
|
+
* `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one command the card's state asks for, such as a status card's fix (Update, Start), given as data and drawn as a filled button; one with `confirm` asks first, keeps its confirmation busy while it runs and shows its failure there, as `SettingsSection`'s footer does, and one running without it (`pending`) keeps its place and says its `pendingLabel`. A product never draws a button there itself (nadicode decision). Facts are plain pairs, the label above
|
|
77
78
|
* its value, in two equal columns from 640 px (`sm`) and one column below it. Every label stays when its value is missing,
|
|
78
79
|
* as *—*. A long value
|
|
79
80
|
* spans both columns. No fact gets a box of its own. While the facts are read (`loading`) each label stands over a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-facts.d.ts","sourceRoot":"","sources":["../../src/components/settings-facts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-facts.d.ts","sourceRoot":"","sources":["../../src/components/settings-facts.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,KAAK,aAAa,EAAkB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AO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;CACtD,GACD;IACE,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,KAAK,CAAC;IAChB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,CACJ,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,MAAM,EACN,YAAqB,EACrB,WAAW,EACX,KAAK,EACL,UAAU,EACV,OAAO,EACP,OAAe,EACf,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,YAAgB,EAChB,KAAK,EACL,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,yBAAyB,+BA0F3B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
+
import { FooterCommands } from "../internal/footer-commands.js";
|
|
3
4
|
import { FooterStrip } from "../internal/footer-strip.js";
|
|
4
5
|
import { EmptyState } from "./empty-state.js";
|
|
5
6
|
import { ObjectFacts } from "./object-workspace.js";
|
|
@@ -19,7 +20,7 @@ import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle,
|
|
|
19
20
|
* compared across records are a table. A relation is its identity or a `Tag`, never its own card.
|
|
20
21
|
* @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
22
|
* Ours: required: the description and the footer's left line (`footerHint`), as on a
|
|
22
|
-
* `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one
|
|
23
|
+
* `SettingsSection`. Two places take a control, each for one job: `actions` at the header's end are the commands on the facts, the Edit that opens their editor, drawn as every card's header draws them (`CardActions`); `action` at the footer's right, beside its line, is the one command the card's state asks for, such as a status card's fix (Update, Start), given as data and drawn as a filled button; one with `confirm` asks first, keeps its confirmation busy while it runs and shows its failure there, as `SettingsSection`'s footer does, and one running without it (`pending`) keeps its place and says its `pendingLabel`. A product never draws a button there itself (nadicode decision). Facts are plain pairs, the label above
|
|
23
24
|
* its value, in two equal columns from 640 px (`sm`) and one column below it. Every label stays when its value is missing,
|
|
24
25
|
* as *—*. A long value
|
|
25
26
|
* spans both columns. No fact gets a box of its own. While the facts are read (`loading`) each label stands over a
|
|
@@ -39,11 +40,11 @@ export function SettingsFactsSection({ actions, action, presentation = "card", d
|
|
|
39
40
|
const termId = useId();
|
|
40
41
|
const Heading = headingLevel === 3 ? "h3" : "h2";
|
|
41
42
|
if (presentation === "summary") {
|
|
42
|
-
return (_jsxs("section", { ...props, "aria-labelledby": headingId, className: "grid min-w-0 gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx(Heading, { id: headingId, tabIndex: -1, className: "text-sm font-medium", children: title }), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), description ? _jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null, _jsx("dl", { className: "flex flex-wrap items-start gap-x-6 gap-y-3", children: facts.map((fact, index) => (_jsxs("div", { className: "grid gap-1", children: [_jsx("dt", { className: "text-xs text-muted-foreground", id: `${termId}-${index}`, children: fact.label }), _jsx("dd", { "aria-labelledby": `${termId}-${index}`, className: "text-sm", children: fact.value ?? _jsx(TableValue, { missingLabel: missingValueLabel, value: null }) })] }, fact.label))) }), action] }));
|
|
43
|
+
return (_jsxs("section", { ...props, "aria-labelledby": headingId, className: "grid min-w-0 gap-3", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx(Heading, { id: headingId, tabIndex: -1, className: "text-sm font-medium", children: title }), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), description ? _jsx("p", { className: "text-sm text-muted-foreground", children: description }) : null, _jsx("dl", { className: "flex flex-wrap items-start gap-x-6 gap-y-3", children: facts.map((fact, index) => (_jsxs("div", { className: "grid gap-1", children: [_jsx("dt", { className: "text-xs text-muted-foreground", id: `${termId}-${index}`, children: fact.label }), _jsx("dd", { "aria-labelledby": `${termId}-${index}`, className: "text-sm", children: fact.value ?? _jsx(TableValue, { missingLabel: missingValueLabel, value: null }) })] }, fact.label))) }), action ? (_jsx("div", { className: "flex", children: _jsx(FooterCommands, { action: action }) })) : null] }));
|
|
43
44
|
}
|
|
44
45
|
return (_jsxs(Card, { render: _jsx("section", {}), ...props, "aria-labelledby": headingId, surface: surface, size: size, className: "min-w-0", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { children: _jsx(Heading, { id: headingId, tabIndex: -1, children: title }) }), description ? _jsx(CardDescription, { children: description }) : null, actions ? (_jsx(CardAction, { children: _jsx(CardActionsRow, { ...actions }) })) : null] }), _jsxs(CardContent, { className: picture ? "grid gap-6 md:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]" : undefined, children: [picture ? (_jsx("img", { alt: picture.alt, className: "hidden max-h-44 w-full self-center object-contain md:block", src: picture.src })) : null, failed ? (_jsx(EmptyState, { ...failed, scope: "card" })) : (_jsx(SkeletonRegion, { busy: loading, children: _jsx(ObjectFacts, { facts: facts.map((fact) => ({
|
|
45
46
|
label: fact.label,
|
|
46
47
|
block: fact.block,
|
|
47
48
|
value: loading ? (_jsx(Skeleton, { height: 20, width: 96 })) : fact.value === null || fact.value === undefined || fact.value === "" ? (_jsx(TableValue, { missingLabel: missingValueLabel, value: null })) : (fact.value),
|
|
48
|
-
})) }) }))] }), _jsx(FooterStrip, { hint: footerHint, hintSlot: "settings-facts-hint", children: action })] }));
|
|
49
|
+
})) }) }))] }), _jsx(FooterStrip, { hint: footerHint, hintSlot: "settings-facts-hint", children: action ? _jsx(FooterCommands, { action: action }) : undefined })] }));
|
|
49
50
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type SettingsFooter } from "../internal/footer-commands.js";
|
|
2
3
|
import { type SettingsSave } from "../internal/settings-save.js";
|
|
3
4
|
import { Field } from "./field.js";
|
|
4
|
-
import { type CardActions } from "./page-actions.js";
|
|
5
|
+
import { type CardActions, type PageCommand } from "./page-actions.js";
|
|
5
6
|
export type { SettingsSave, SettingsSaveFailure } from "../internal/settings-save.js";
|
|
7
|
+
export type { ConfirmedFooterCommand, FooterCommand, SettingsFooter, } from "../internal/footer-commands.js";
|
|
6
8
|
export type SettingsFieldControlProps = {
|
|
7
9
|
id: string;
|
|
8
10
|
"aria-labelledby": string;
|
|
@@ -55,11 +57,11 @@ type SavingSection = Titled & HeaderEnd & {
|
|
|
55
57
|
};
|
|
56
58
|
type FooterSection = Titled & {
|
|
57
59
|
save?: never;
|
|
58
|
-
/** The
|
|
59
|
-
footer?:
|
|
60
|
+
/** The card's commands, at the footer's right: its one action, and a lesser one before it. */
|
|
61
|
+
footer?: SettingsFooter | undefined;
|
|
60
62
|
/** What is specific to this card, on the footer's left: a limit, what a value is for, a plan it needs, a link. Absent: nothing. */
|
|
61
63
|
footerHint?: React.ReactNode;
|
|
62
|
-
/** A condition of the whole card: 1px border, a tinted footer; the title, line
|
|
64
|
+
/** A condition of the whole card: 1px border, a tinted footer, and the footer's action in its hue; the title, line and fields stay neutral. */
|
|
63
65
|
tone?: SettingsSectionTone;
|
|
64
66
|
lockedReason?: never;
|
|
65
67
|
unlock?: never;
|
|
@@ -71,8 +73,8 @@ type LockedSection = Titled & {
|
|
|
71
73
|
tone?: never;
|
|
72
74
|
/** Why the person may not change this section: the plan that has it, the role it needs. */
|
|
73
75
|
lockedReason: string | React.ReactElement;
|
|
74
|
-
/** The way to get access:
|
|
75
|
-
unlock?:
|
|
76
|
+
/** The way to get access, drawn filled: Upgrade, Contact sales. Left out when nothing the person does unlocks it. */
|
|
77
|
+
unlock?: PageCommand | undefined;
|
|
76
78
|
actions?: never;
|
|
77
79
|
control?: never;
|
|
78
80
|
};
|
|
@@ -99,9 +101,9 @@ export type SavingSettingsSectionProps = SettingsSectionBase & SavingSection;
|
|
|
99
101
|
* @family Compositions
|
|
100
102
|
* @when One setting a person changes on a SettingsPage, or on an ObjectPage as one of its `entries` with `frame="fold"`, the row naming it and its summary saying the value (owner, 2026-11-09): Personal details, Company identity, Notifications, a company's Internal notes. A setting that changes what the product does takes `save` and is a draft until the footer's Save applies it: a typed value, a switch, a pick from a short list. A choice of how the product looks or reads to the person alone, Theme and Language, applies the moment it is picked, on the product's preferences page as in the `AccountMenu`, so its card has no `save` and no Save button, a `footerHint` at most (owner ruling, 7 November 2026). 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).
|
|
101
103
|
* @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.
|
|
102
|
-
* @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. 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. 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, such as an avatar's upload, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem, as on a phone, they keep the title's row and the description runs under both, 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
|
|
103
|
-
* @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".
|
|
104
|
-
* @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. `SettingsSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
104
|
+
* @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. 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. 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, such as an avatar's upload, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem, as on a phone, they keep the title's row and the description runs under both, 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. Ours: a card without `save` gives its commands as data, `footer`: its one `action` and at most one lesser `secondary`; the section draws them at the footer's right, the secondary as an outline button and then the action filled, and a product never draws a button there itself (nadicode decision). `tone` marks a state with a command (a failed payment, a trial ending, a delete): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; the title, line and fields stay neutral, and the action takes its own meaning's hue, given as its `consequence`: `destructive` (red) for a permanent loss (Delete, Turn off two-factor), `disruptive` (amber) for a command that stops something until someone starts it again (Pause, Suspend, Sign out everywhere); without one it takes the card's hue, red on `tone="error"` and amber on `tone="warning"`, and otherwise the filled look; the secondary stays outline, whatever its meaning. A delete card is `tone="error"` with the object's summary as its body; an archive card is `tone="warning"` (nadicode decision). A command with `confirm` asks first: pressing it opens its confirmation and runs nothing; Cancel closes it; Confirm keeps it open and busy, saying the command's `pendingLabel`, until its `onClick` settles, then closes it when that returns `null`, or shows the message it returns inside it, where the person can try again. The confirmation's button is red when the command is red. A command without one runs at once; while it runs (`pending`) it keeps its place and says its `pendingLabel`, and one that cannot run now stays, disabled, with `disabledReason` in its tooltip (nadicode decision). "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, a command the section draws filled after the reason (Upgrade, Contact sales), left out when nothing the person does unlocks it. With `frame="fold"`, which has no footer, the reason and `unlock` take a muted row under the inert fields. A locked section has no `save` and no header `actions`. While its page reads it, `SettingsSectionSkeleton` stands in its place: the same card, a bar for the title and one for the description at their line heights, the caller's placeholders of its controls at the controls' heights, a placeholder in the shape of its `control`, and its footer with the line and the Save when the section has them, so the page does not move when the section arrives; it carries no words, so a page drawn before the reader is known shows nothing of theirs (nadicode decision).
|
|
105
|
+
* @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". A footer command is a verb and the noun it acts on ("Delete Agent", "Turn on web access"), its `pendingLabel` the same words in the -ing form ("Deleting Agent"), and a command that asks first words its confirmation in its `confirm`: a title naming the verb and the record, the consequence, and a confirm label of verb and noun.
|
|
106
|
+
* @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. Each footer command is a button named by its label, or by its `accessibleName` where the label alone does not name the target; a running one is `aria-busy`, and a confirmation is an alert dialog named by its title. `SettingsSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
105
107
|
*/
|
|
106
108
|
declare function SettingsSection({ title, headingLevel, description, status, actions, control, tone, children, className, save, footer, footerHint, lockedReason, unlock, frame, ...props }: SettingsSectionProps): React.JSX.Element;
|
|
107
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-section.d.ts","sourceRoot":"","sources":["../../src/components/settings-section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjF,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,KAAK,EAAoD,MAAM,oBAAoB,CAAC;AAG7F,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AAIxB,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAClF,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,cAAc,GACf,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,yBAAyB,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,CAAC;AAEtD,KAAK,YAAY,GAAG;IAClB,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IACvF,mGAAmG;IACnG,WAAW,EAAE,MAAM,CAAC;IACpB,+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|
|
|
2
2
|
import { Info } from "lucide-react";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { FooterCommands } from "../internal/footer-commands.js";
|
|
5
6
|
import { FooterStrip } from "../internal/footer-strip.js";
|
|
6
7
|
import { SettingsFieldFailure, SettingsSaveForm, } from "../internal/settings-save.js";
|
|
7
8
|
import { Button } from "./button.js";
|
|
@@ -9,7 +10,7 @@ import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle }
|
|
|
9
10
|
import { Field, FieldContent, FieldError, FieldGroup, FieldLabel } from "./field.js";
|
|
10
11
|
import { NativeSelect, NativeSelectOption } from "./native-select.js";
|
|
11
12
|
import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
12
|
-
import { CardActionsRow } from "./page-actions.js";
|
|
13
|
+
import { CardActionsRow, PageCommandButton, } from "./page-actions.js";
|
|
13
14
|
import { Switch } from "./switch.js";
|
|
14
15
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
15
16
|
const toneClassNames = {
|
|
@@ -22,9 +23,9 @@ const toneClassNames = {
|
|
|
22
23
|
* @family Compositions
|
|
23
24
|
* @when One setting a person changes on a SettingsPage, or on an ObjectPage as one of its `entries` with `frame="fold"`, the row naming it and its summary saying the value (owner, 2026-11-09): Personal details, Company identity, Notifications, a company's Internal notes. A setting that changes what the product does takes `save` and is a draft until the footer's Save applies it: a typed value, a switch, a pick from a short list. A choice of how the product looks or reads to the person alone, Theme and Language, applies the moment it is picked, on the product's preferences page as in the `AccountMenu`, so its card has no `save` and no Save button, a `footerHint` at most (owner ruling, 7 November 2026). 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).
|
|
24
25
|
* @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.
|
|
25
|
-
* @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. 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. 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, such as an avatar's upload, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem, as on a phone, they keep the title's row and the description runs under both, 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
|
|
26
|
-
* @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".
|
|
27
|
-
* @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. `SettingsSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
26
|
+
* @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. 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. 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, such as an avatar's upload, takes `control` instead. They stand at the title's right; on a card narrower than 28 rem, as on a phone, they keep the title's row and the description runs under both, 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. Ours: a card without `save` gives its commands as data, `footer`: its one `action` and at most one lesser `secondary`; the section draws them at the footer's right, the secondary as an outline button and then the action filled, and a product never draws a button there itself (nadicode decision). `tone` marks a state with a command (a failed payment, a trial ending, a delete): a 1px border and a footer tinted in the hue with its line in it, the line saying the condition in words; the title, line and fields stay neutral, and the action takes its own meaning's hue, given as its `consequence`: `destructive` (red) for a permanent loss (Delete, Turn off two-factor), `disruptive` (amber) for a command that stops something until someone starts it again (Pause, Suspend, Sign out everywhere); without one it takes the card's hue, red on `tone="error"` and amber on `tone="warning"`, and otherwise the filled look; the secondary stays outline, whatever its meaning. A delete card is `tone="error"` with the object's summary as its body; an archive card is `tone="warning"` (nadicode decision). A command with `confirm` asks first: pressing it opens its confirmation and runs nothing; Cancel closes it; Confirm keeps it open and busy, saying the command's `pendingLabel`, until its `onClick` settles, then closes it when that returns `null`, or shows the message it returns inside it, where the person can try again. The confirmation's button is red when the command is red. A command without one runs at once; while it runs (`pending`) it keeps its place and says its `pendingLabel`, and one that cannot run now stays, disabled, with `disabledReason` in its tooltip (nadicode decision). "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, a command the section draws filled after the reason (Upgrade, Contact sales), left out when nothing the person does unlocks it. With `frame="fold"`, which has no footer, the reason and `unlock` take a muted row under the inert fields. A locked section has no `save` and no header `actions`. While its page reads it, `SettingsSectionSkeleton` stands in its place: the same card, a bar for the title and one for the description at their line heights, the caller's placeholders of its controls at the controls' heights, a placeholder in the shape of its `control`, and its footer with the line and the Save when the section has them, so the page does not move when the section arrives; it carries no words, so a page drawn before the reader is known shows nothing of theirs (nadicode decision).
|
|
27
|
+
* @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". A footer command is a verb and the noun it acts on ("Delete Agent", "Turn on web access"), its `pendingLabel` the same words in the -ing form ("Deleting Agent"), and a command that asks first words its confirmation in its `confirm`: a title naming the verb and the record, the consequence, and a confirm label of verb and noun.
|
|
28
|
+
* @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. Each footer command is a button named by its label, or by its `accessibleName` where the label alone does not name the target; a running one is `aria-busy`, and a confirmation is an alert dialog named by its title. `SettingsSectionSkeleton` is busy and its bars are hidden from assistive technology.
|
|
28
29
|
*/
|
|
29
30
|
function SettingsSection({ title, headingLevel = 2, description, status, actions, control, tone, children, className, save, footer, footerHint, lockedReason, unlock, frame = "card", ...props }) {
|
|
30
31
|
const titleId = React.useId();
|
|
@@ -32,10 +33,10 @@ function SettingsSection({ title, headingLevel = 2, description, status, actions
|
|
|
32
33
|
const locked = lockedReason !== undefined;
|
|
33
34
|
if (frame === "fold") {
|
|
34
35
|
const foldFields = children !== null && children !== undefined ? (_jsx(FieldGroup, { "data-slot": "settings-section-fields", inert: locked, className: cn(locked && "**:text-muted-foreground"), children: children })) : null;
|
|
35
|
-
return (_jsxs("section", { ...props, className: cn("grid min-w-0 gap-4 pb-(--card-spacing)", locked && "cursor-not-allowed", className), "data-frame": "fold", "data-locked": locked || undefined, "data-slot": "settings-section", children: [title ? (_jsx(Heading, { className: "sr-only", id: titleId, children: title })) : null, _jsx("p", { className: "text-sm text-muted-foreground", children: description }), save ? (_jsx(SettingsSaveForm, { save: save, titleId: titleId, children: foldFields })) : (foldFields), locked ? (_jsxs("div", { className: "flex min-w-0 cursor-default flex-wrap items-center justify-between gap-x-4 gap-y-2 text-sm text-muted-foreground", "data-slot": "settings-section-hint", children: [_jsx("span", { className: "min-w-0", children: lockedReason }), unlock] })) : null] }));
|
|
36
|
+
return (_jsxs("section", { ...props, className: cn("grid min-w-0 gap-4 pb-(--card-spacing)", locked && "cursor-not-allowed", className), "data-frame": "fold", "data-locked": locked || undefined, "data-slot": "settings-section", children: [title ? (_jsx(Heading, { className: "sr-only", id: titleId, children: title })) : null, _jsx("p", { className: "text-sm text-muted-foreground", children: description }), save ? (_jsx(SettingsSaveForm, { save: save, titleId: titleId, children: foldFields })) : (foldFields), locked ? (_jsxs("div", { className: "flex min-w-0 cursor-default flex-wrap items-center justify-between gap-x-4 gap-y-2 text-sm text-muted-foreground", "data-slot": "settings-section-hint", children: [_jsx("span", { className: "min-w-0", children: lockedReason }), unlock ? _jsx(PageCommandButton, { command: unlock, variant: "default" }) : null] })) : null] }));
|
|
36
37
|
}
|
|
37
38
|
const fields = children !== null && children !== undefined ? (_jsx(CardContent, { children: _jsx(FieldGroup, { "data-slot": "settings-section-fields", inert: locked, className: cn(locked && "**:text-muted-foreground"), children: children }) })) : null;
|
|
38
|
-
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section", "data-tone": tone, "data-locked": locked || undefined }), className: cn("min-w-0", tone && toneClassNames[tone], locked && "cursor-not-allowed *:data-[slot=card-footer]:cursor-default", className), children: [_jsxs(CardHeader, { narrowAction: "title-row", className: cn(!title && "has-data-[slot=card-description]:grid-rows-none"), children: [title ? (_jsxs(CardTitle, { className: cn(status && "flex flex-wrap items-center gap-2"), children: [_jsx(Heading, { id: titleId, children: title }), status] })) : null, _jsx(CardDescription, { children: description }), actions || control ? (_jsx(CardAction, { children: control ?? (actions ? _jsx(CardActionsRow, { ...actions }) : null) })) : null] }), save ? (_jsx(SettingsSaveForm, { save: save, titleId: titleId, children: fields })) : (_jsxs(_Fragment, { children: [fields, _jsx(FooterStrip, { hint: locked ? lockedReason : footerHint, hintSlot: "settings-section-hint", children: locked ? unlock : footer })] }))] }));
|
|
39
|
+
return (_jsxs(Card, { render: _jsx("section", { ...props, "data-slot": "settings-section", "data-tone": tone, "data-locked": locked || undefined }), className: cn("min-w-0", tone && toneClassNames[tone], locked && "cursor-not-allowed *:data-[slot=card-footer]:cursor-default", className), children: [_jsxs(CardHeader, { narrowAction: "title-row", className: cn(!title && "has-data-[slot=card-description]:grid-rows-none"), children: [title ? (_jsxs(CardTitle, { className: cn(status && "flex flex-wrap items-center gap-2"), children: [_jsx(Heading, { id: titleId, children: title }), status] })) : null, _jsx(CardDescription, { children: description }), actions || control ? (_jsx(CardAction, { children: control ?? (actions ? _jsx(CardActionsRow, { ...actions }) : null) })) : null] }), save ? (_jsx(SettingsSaveForm, { save: save, titleId: titleId, children: fields })) : (_jsxs(_Fragment, { children: [fields, _jsx(FooterStrip, { hint: locked ? lockedReason : footerHint, hintSlot: "settings-section-hint", children: locked ? (unlock ? (_jsx(PageCommandButton, { command: unlock, variant: "default" })) : undefined) : footer ? (_jsx(FooterCommands, { ...footer, tone: tone })) : undefined })] }))] }));
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* What stands in a SettingsSection's place while its page reads it: its card, a bar for the title
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What clears a collection's narrowing: its label from the product, "Clear filters". */
|
|
2
|
+
export type ClearFilters = {
|
|
3
|
+
label: string;
|
|
4
|
+
onClear: () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function ClearFiltersButton({ label, onClear }: ClearFilters): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=clear-filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-filters.d.ts","sourceRoot":"","sources":["../../src/internal/clear-filters.tsx"],"names":[],"mappings":"AAIA,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,YAAY,+BAMlE"}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
-
import type { MenuCommand } from "../components/action-menu.js";
|
|
3
|
-
import type { PageCommandAction } from "../components/page-actions.js";
|
|
4
|
-
export type
|
|
2
|
+
import type { CommandConfirmation, CommandRun, CommandUndo, ConfirmedRun, MenuCommand } from "../components/action-menu.js";
|
|
3
|
+
import type { PageCommandAction, PendingWord } from "../components/page-actions.js";
|
|
4
|
+
export type ArmableCommand = PendingWord & {
|
|
5
|
+
label: string;
|
|
6
|
+
accessibleName?: string | undefined;
|
|
7
|
+
destructive?: boolean | undefined;
|
|
8
|
+
} & ((PageCommandAction & {
|
|
9
|
+
confirm?: never;
|
|
10
|
+
undo?: never;
|
|
11
|
+
}) | {
|
|
12
|
+
onClick: ConfirmedRun;
|
|
13
|
+
confirm: CommandConfirmation;
|
|
14
|
+
undo?: never;
|
|
15
|
+
link?: never;
|
|
16
|
+
render?: never;
|
|
17
|
+
} | {
|
|
18
|
+
onClick: CommandRun;
|
|
19
|
+
undo: CommandUndo;
|
|
20
|
+
confirm?: never;
|
|
21
|
+
link?: never;
|
|
22
|
+
render?: never;
|
|
23
|
+
});
|
|
24
|
+
export type DrawnCommand<TCommand extends ArmableCommand = MenuCommand> = (TCommand extends unknown ? Omit<TCommand, "confirm" | "undo" | "onClick" | "link" | "render"> : never) & PageCommandAction & {
|
|
5
25
|
confirm?: never;
|
|
6
26
|
undo?: never;
|
|
7
27
|
};
|
|
28
|
+
export type FocusFallback = () => HTMLElement | null;
|
|
8
29
|
export type CommandRunner = {
|
|
9
|
-
arm: <TCommand extends
|
|
30
|
+
arm: <TCommand extends ArmableCommand>(command: TCommand) => DrawnCommand<TCommand>;
|
|
10
31
|
dialog: ReactElement | null;
|
|
11
32
|
};
|
|
33
|
+
export declare function CommandFocusFallback({ to, children }: {
|
|
34
|
+
to: FocusFallback;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
12
37
|
/**
|
|
13
38
|
* Holds the confirmations every composition inside it opens, so a confirmation raised from a
|
|
14
39
|
* phone's navigation sheet opens over the page once the sheet has closed, never over the sheet:
|
|
@@ -18,5 +43,5 @@ export declare function CommandRunnerHost({ children, onAsk }: {
|
|
|
18
43
|
children: ReactNode;
|
|
19
44
|
onAsk: () => void;
|
|
20
45
|
}): import("react").JSX.Element;
|
|
21
|
-
export declare function useCommandRunner(): CommandRunner;
|
|
46
|
+
export declare function useCommandRunner(focusFallback?: FocusFallback): CommandRunner;
|
|
22
47
|
//# sourceMappingURL=command-runner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-runner.d.ts","sourceRoot":"","sources":["../../src/internal/command-runner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAE/F,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"command-runner.d.ts","sourceRoot":"","sources":["../../src/internal/command-runner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAwB,MAAM,OAAO,CAAC;AAE/F,OAAO,KAAK,EACV,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAIhF,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACnC,GAAG,CACE,CAAC,iBAAiB,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GACvD;IACE,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB,GACD;IACE,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,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