@nadicodeai/ui 12.1.189 → 12.1.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/collection-page.d.ts +2 -2
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/message-notice.d.ts +14 -4
- package/dist/components/message-notice.d.ts.map +1 -1
- package/dist/components/message-notice.js +4 -4
- package/dist/components/record-list.d.ts +51 -10
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +27 -2
- package/dist/components/sonner.d.ts +1 -1
- package/dist/components/sonner.js +2 -2
- package/dist/components/toast.d.ts +13 -0
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +32 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +5 -4
- package/dist/showcase/usage.generated.js +3 -3
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ type CollectionTitle = {
|
|
|
18
18
|
title?: undefined;
|
|
19
19
|
description?: never;
|
|
20
20
|
};
|
|
21
|
-
export type CollectionPageProps<TRecord extends RowData> = RecordListWithout<TRecord, "heading" | "noMatch" | "layout"> & CollectionTitle & {
|
|
21
|
+
export type CollectionPageProps<TRecord extends RowData, TCommand extends string = never> = RecordListWithout<TRecord, "heading" | "noMatch" | "layout", TCommand> & CollectionTitle & {
|
|
22
22
|
/** The title row: secondary, primary, then the three dots. The primary stays here whether the collection is empty or not. */
|
|
23
23
|
actions?: Omit<PageActionsProps, "period">;
|
|
24
24
|
/** The page's sibling collections, under the title row: `TabsNav variant="line"`. */
|
|
@@ -58,5 +58,5 @@ export type CollectionPageProps<TRecord extends RowData> = RecordListWithout<TRe
|
|
|
58
58
|
* @access “After an async filter change, wrap the region in `aria-live="polite"` so screen readers announce the new state.” (https://vercel.com/geist/empty-state)
|
|
59
59
|
* Ours: the rows' region is the RecordList's, which holds it. The title is the page's h1 when the composition draws it. The toolbar is named by `label` and busy while `pending`; the rows are the RecordList's table, named by `label`.
|
|
60
60
|
*/
|
|
61
|
-
export declare function CollectionPage<TRecord extends RowData>(props: CollectionPageProps<TRecord>): import("react").JSX.Element;
|
|
61
|
+
export declare function CollectionPage<TRecord extends RowData, TCommand extends string = never>(props: CollectionPageProps<TRecord, TCommand>): import("react").JSX.Element;
|
|
62
62
|
//# sourceMappingURL=collection-page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-page.d.ts","sourceRoot":"","sources":["../../src/components/collection-page.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACjG,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC9F,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAExF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAIL,KAAK,gBAAgB,EAEtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,4BAA4B,CAAC;AAEvF,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,KAAK,eAAe,GAChB;IACE,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GACD;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAA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H,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;IAC3C,qFAAqF;IACrF,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACnC,iDAAiD;IACjD,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;IACpD,oGAAoG;IACpG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB,CAAC;AAEJ;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,OAAO,SAAS,OAAO,EAAE,QAAQ,SAAS,MAAM,GAAG,KAAK,EACrF,KAAK,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,+BAqE9C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
1
2
|
import { type NoticeTone as MessageNoticeTone } from "../internal/notice.js";
|
|
2
3
|
import { type ResolvedMessage } from "./product-message.js";
|
|
3
4
|
export type { MessageNoticeTone };
|
|
@@ -11,19 +12,28 @@ export type { MessageNoticeTone };
|
|
|
11
12
|
*/
|
|
12
13
|
export type MessageNoticeProps = {
|
|
13
14
|
message: ResolvedMessage;
|
|
14
|
-
placement: "action" | "section";
|
|
15
15
|
tone?: MessageNoticeTone;
|
|
16
16
|
className?: string;
|
|
17
|
-
}
|
|
17
|
+
} & ({
|
|
18
|
+
placement: "action";
|
|
19
|
+
controls?: never;
|
|
20
|
+
} | {
|
|
21
|
+
placement: "section";
|
|
22
|
+
/**
|
|
23
|
+
* Controls drawn by the host in the action's place, in place of the message's actions: a carried tree's own
|
|
24
|
+
* buttons, which keep their behaviour, with any of the message's own the host places beside them.
|
|
25
|
+
*/
|
|
26
|
+
controls?: ReactNode;
|
|
27
|
+
});
|
|
18
28
|
/**
|
|
19
29
|
* A catalogue message about one thing on the screen.
|
|
20
30
|
*
|
|
21
31
|
* @family Feedback
|
|
22
32
|
* @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "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) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, under the control whose write failed (`action`), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
|
|
23
33
|
* @instead "Pick `Banner` when the message is page-level or system-wide and needs a CTA, `Toast` for transient acknowledgments, `Modal` for destructive confirmations." (https://vercel.com/geist/note) Ours: `Banner` is `NoticeBanner`, for a condition of the page's own object, and a system-wide condition is a notification in the product's inbox, never a banner; `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a field's wrong value use `FieldError`. For a failed read use `EmptyState failed`.
|
|
24
|
-
* @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
|
|
34
|
+
* @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. A section can draw the host's own `controls` in the action's place instead, such as a carried tree's buttons that keep their behaviour. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
|
|
25
35
|
* @words "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) "`NoteContent` is one sentence in active voice that names the impact: `Changing this region restarts all functions.`" (https://vercel.com/geist/note) "No `variant="info"` exists; omit `variant` for the default info icon or use `variant="secondary"` for neutral copy." (https://vercel.com/geist/note) "Single-fragment labels take no period; full descriptive sentences in the body do." (https://vercel.com/geist/note) Ours: words come from the catalogue only. The message's title stands in for `NoteLabel` and `NoteContent`, in sentence case, and `info` exists as Geist's blue `success`. The action is labelled with its result: *Try again*, *Sign in*. When the message carries an action, its body does not repeat it: the link is the step, so the body ends before "Try again".
|
|
26
36
|
* @access `action`: `role="alert"` (`status` for info and neutral). `section`: `role="status"`, `aria-live="polite"`, atomic. The mark is hidden. Focus stays where the person was.
|
|
27
37
|
*/
|
|
28
|
-
export declare function MessageNotice({ message, placement, tone, className, }: MessageNoticeProps): import("react").JSX.Element;
|
|
38
|
+
export declare function MessageNotice({ message, placement, tone, className, controls, }: MessageNoticeProps): import("react").JSX.Element;
|
|
29
39
|
//# sourceMappingURL=message-notice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-notice.d.ts","sourceRoot":"","sources":["../../src/components/message-notice.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message-notice.d.ts","sourceRoot":"","sources":["../../src/components/message-notice.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAKL,KAAK,UAAU,IAAI,iBAAiB,EACrC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAWlC;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,eAAe,CAAC;IACzB,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CACA;IAAE,SAAS,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GACzC;IACE,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CACJ,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,IAAoB,EACpB,SAAS,EACT,QAAQ,GACT,EAAE,kBAAkB,+BA2EpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { OctagonAlert } from "lucide-react";
|
|
4
4
|
import { Alert } from "./alert.js";
|
|
5
5
|
import { closedSentence, NOTICE_EDGE, NoticeLink, NoticeMark, } from "../internal/notice.js";
|
|
@@ -19,11 +19,11 @@ const LEAD = { action: "font-medium", section: "font-semibold" };
|
|
|
19
19
|
* @family Feedback
|
|
20
20
|
* @when "Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "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) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, under the control whose write failed (`action`), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.
|
|
21
21
|
* @instead "Pick `Banner` when the message is page-level or system-wide and needs a CTA, `Toast` for transient acknowledgments, `Modal` for destructive confirmations." (https://vercel.com/geist/note) Ours: `Banner` is `NoticeBanner`, for a condition of the page's own object, and a system-wide condition is a notification in the product's inbox, never a banner; `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a field's wrong value use `FieldError`. For a failed read use `EmptyState failed`.
|
|
22
|
-
* @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
|
|
22
|
+
* @behaviour "A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia's *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. A section can draw the host's own `controls` in the action's place instead, such as a carried tree's buttons that keep their behaviour. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.
|
|
23
23
|
* @words "`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) "`NoteContent` is one sentence in active voice that names the impact: `Changing this region restarts all functions.`" (https://vercel.com/geist/note) "No `variant="info"` exists; omit `variant` for the default info icon or use `variant="secondary"` for neutral copy." (https://vercel.com/geist/note) "Single-fragment labels take no period; full descriptive sentences in the body do." (https://vercel.com/geist/note) Ours: words come from the catalogue only. The message's title stands in for `NoteLabel` and `NoteContent`, in sentence case, and `info` exists as Geist's blue `success`. The action is labelled with its result: *Try again*, *Sign in*. When the message carries an action, its body does not repeat it: the link is the step, so the body ends before "Try again".
|
|
24
24
|
* @access `action`: `role="alert"` (`status` for info and neutral). `section`: `role="status"`, `aria-live="polite"`, atomic. The mark is hidden. Focus stays where the person was.
|
|
25
25
|
*/
|
|
26
|
-
export function MessageNotice({ message, placement, tone = "destructive", className, }) {
|
|
26
|
+
export function MessageNotice({ message, placement, tone = "destructive", className, controls, }) {
|
|
27
27
|
const body = bodyBeyondTitle(message);
|
|
28
28
|
const [action, secondAction] = message.actions;
|
|
29
29
|
const mark = _jsx(NoticeMark, { icon: tone === "destructive" ? OctagonAlert : undefined, tone: tone });
|
|
@@ -31,7 +31,7 @@ export function MessageNotice({ message, placement, tone = "destructive", classN
|
|
|
31
31
|
? [action, secondAction].map((command) => command ? (_jsxs("span", { children: [" ", _jsx(NoticeLink, { command: command, place: "inline" })] }, command.label)) : null)
|
|
32
32
|
: null] }));
|
|
33
33
|
if (placement === "section") {
|
|
34
|
-
return (_jsxs(Alert, { "aria-atomic": "true", "aria-live": "polite", className: cn("flex min-h-9 flex-wrap items-center gap-3 bg-transparent px-3 py-1.5 text-body-sm", action && "rounded-md max-md:py-3 md:pr-2", NOTICE_EDGE[tone], TONE_TEXT[tone], className), "data-message-code": message.code, "data-message-notice": "section", "data-tone": tone, role: "status", variant: "default", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [_jsx("span", { className: "flex h-5 shrink-0 items-center [&_svg]:size-3.5", children: mark }), sentence] }), action ? (
|
|
34
|
+
return (_jsxs(Alert, { "aria-atomic": "true", "aria-live": "polite", className: cn("flex min-h-9 flex-wrap items-center gap-3 bg-transparent px-3 py-1.5 text-body-sm", (action ?? controls) && "rounded-md max-md:py-3 md:pr-2", NOTICE_EDGE[tone], TONE_TEXT[tone], className), "data-message-code": message.code, "data-message-notice": "section", "data-tone": tone, role: "status", variant: "default", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [_jsx("span", { className: "flex h-5 shrink-0 items-center [&_svg]:size-3.5", children: mark }), sentence] }), controls || action ? (_jsx("div", { className: "flex shrink-0 gap-2 self-center max-md:basis-full max-md:*:flex-1", "data-notice-action": true, children: controls ?? (_jsxs(_Fragment, { children: [action ? _jsx(PageCommandButton, { command: action, size: "sm", variant: "default" }) : null, secondAction ? (_jsx(PageCommandButton, { command: secondAction, size: "sm", variant: "outline" })) : null] })) })) : null] }));
|
|
35
35
|
}
|
|
36
36
|
return (_jsxs("div", { className: cn("flex min-w-0 items-start gap-2 text-body-sm", TONE_TEXT[tone], className), "data-message-code": message.code, "data-message-notice": "action", role: tone === "info" || tone === "neutral" ? "status" : "alert", children: [_jsx("span", { className: "flex h-5 shrink-0 items-center [&_svg]:size-4", children: mark }), sentence] }));
|
|
37
37
|
}
|
|
@@ -4,7 +4,7 @@ import { type MenuCommand } from "./action-menu.js";
|
|
|
4
4
|
import { type DataTableRowLinkProps } from "./data-table.js";
|
|
5
5
|
import { type EmptyStateKind } from "./empty-state.js";
|
|
6
6
|
import type { IdentityMarkProps } from "./identity-mark.js";
|
|
7
|
-
import { type CardActions, type PageCommand } from "./page-actions.js";
|
|
7
|
+
import { type CardActions, type PageCommand, type PageCommandAction } from "./page-actions.js";
|
|
8
8
|
import { type ProgressChecklistProps } from "./progress-checklist.js";
|
|
9
9
|
import { type StatusBadgeTone } from "./status-badge.js";
|
|
10
10
|
import { type TableReading } from "./table-value.js";
|
|
@@ -53,6 +53,12 @@ export type RecordStatus = {
|
|
|
53
53
|
label: string;
|
|
54
54
|
tone: StatusBadgeTone;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* A row's button as the list names it: the face from `commands`, the action and name from the row.
|
|
58
|
+
* A product that draws the same command outside a list, such as a lone Connect button, builds it
|
|
59
|
+
* with this, so the button reads the same in both places.
|
|
60
|
+
*/
|
|
61
|
+
export declare function rowButton<TCommand extends string>(faces: Readonly<Record<TCommand, RecordRowCommandFace>>, row: RecordRowCommand<TCommand>): PageCommand;
|
|
56
62
|
export type RecordTimeColumn<TRecord> = {
|
|
57
63
|
label: string;
|
|
58
64
|
of: (record: TRecord) => Date | number | string | null | undefined;
|
|
@@ -98,7 +104,47 @@ export type RecordListFooter = {
|
|
|
98
104
|
/** One muted line about the whole list, with Learn more and one secondary action, in a strip of its own under the count and the paging. */
|
|
99
105
|
note?: CollectionNote;
|
|
100
106
|
};
|
|
101
|
-
|
|
107
|
+
/** One kind of row button, named once for the whole list, so every row that does the job draws it alike. */
|
|
108
|
+
export type RecordRowCommandFace = {
|
|
109
|
+
label: string;
|
|
110
|
+
icon?: ReactElement | undefined;
|
|
111
|
+
/** Opens outside the product: the arrow after the label. */
|
|
112
|
+
external?: boolean | undefined;
|
|
113
|
+
/** What the button says while a row's command runs, for a command that can be pending. */
|
|
114
|
+
pendingLabel?: string | undefined;
|
|
115
|
+
};
|
|
116
|
+
/** One row's button: which of the list's `commands` it is, what it does, and the record it acts on. */
|
|
117
|
+
export type RecordRowCommand<TCommand extends string = string> = PageCommandAction & {
|
|
118
|
+
use: TCommand;
|
|
119
|
+
/** Every row's button reads the same, so this names the row's record: "Let in ada@acme.it". */
|
|
120
|
+
accessibleName: string;
|
|
121
|
+
pending?: boolean | undefined;
|
|
122
|
+
disabled?: boolean | undefined;
|
|
123
|
+
/** The face is the list's, in `commands`: a row never writes its own. */
|
|
124
|
+
label?: never;
|
|
125
|
+
icon?: never;
|
|
126
|
+
pendingLabel?: never;
|
|
127
|
+
external?: never;
|
|
128
|
+
};
|
|
129
|
+
/** A list's visible row buttons: their kinds, named once, and each row's pick; both or neither. */
|
|
130
|
+
export type RecordRowCommands<TRecord extends RowData, TCommand extends string> = {
|
|
131
|
+
/**
|
|
132
|
+
* The kinds of visible row button, each named once for the whole list ("Approve", "Add to an
|
|
133
|
+
* Agent"), so every row that does a job draws the same button at the same width. A row never
|
|
134
|
+
* writes its own label, and a kind with no running word keeps its label while it runs.
|
|
135
|
+
*/
|
|
136
|
+
commands: Readonly<Record<TCommand, RecordRowCommandFace>>;
|
|
137
|
+
/**
|
|
138
|
+
* The row's visible commands, one or two outline buttons of 32 px before the three dots: the
|
|
139
|
+
* record's main job, picked from `commands`. Every other command, a lone one included, goes in
|
|
140
|
+
* the menu. A compact row draws them under the name.
|
|
141
|
+
*/
|
|
142
|
+
command: (record: TRecord) => RecordRowCommand<NoInfer<TCommand>> | readonly [RecordRowCommand<NoInfer<TCommand>>, RecordRowCommand<NoInfer<TCommand>>] | null;
|
|
143
|
+
} | {
|
|
144
|
+
commands?: never;
|
|
145
|
+
command?: never;
|
|
146
|
+
};
|
|
147
|
+
export type RecordListProps<TRecord extends RowData, TCommand extends string = never> = RecordRowCommands<TRecord, TCommand> & {
|
|
102
148
|
/** Names the list for assistive technology: "Skills". */
|
|
103
149
|
label: string;
|
|
104
150
|
/** Already searched, filtered and ordered; undefined while they load. */
|
|
@@ -184,12 +230,6 @@ export type RecordListProps<TRecord extends RowData> = {
|
|
|
184
230
|
actions?: CardActions;
|
|
185
231
|
};
|
|
186
232
|
footer?: RecordListFooter;
|
|
187
|
-
/**
|
|
188
|
-
* The row's visible commands, one or two outline buttons of 32 px before the three dots: the
|
|
189
|
-
* record's main job, the same on every row that can do it ("Approve", "Add to an Agent"). Every
|
|
190
|
-
* other command, a lone one included, goes in the menu. A compact row draws them under the name.
|
|
191
|
-
*/
|
|
192
|
-
command?: (record: TRecord) => PageCommand | readonly [PageCommand, PageCommand] | null;
|
|
193
233
|
/** The record's own action failed or was refused: its message inside its row. */
|
|
194
234
|
state?: (record: TRecord) => RowMessage | null;
|
|
195
235
|
/**
|
|
@@ -200,7 +240,7 @@ export type RecordListProps<TRecord extends RowData> = {
|
|
|
200
240
|
*/
|
|
201
241
|
commandsSize?: number;
|
|
202
242
|
};
|
|
203
|
-
export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey> =
|
|
243
|
+
export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey, TCommand extends string = never> = RecordListProps<TRecord, TCommand> extends infer TProps ? TProps extends unknown ? Omit<TProps, Key> : never : never;
|
|
204
244
|
/**
|
|
205
245
|
* Entity rows: objects a person opens or acts on, one line each on one resting card: the
|
|
206
246
|
* identity mark and name over what it is, then its attributes as data, one per column: a few
|
|
@@ -223,6 +263,7 @@ export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey>
|
|
|
223
263
|
* @words “Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`).” (https://vercel.com/geist/entity)
|
|
224
264
|
* Ours: the name is the record's own and the labels around it are sentence case, not Title Case.
|
|
225
265
|
* “Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen.” (https://vercel.com/geist/entity)
|
|
266
|
+
* Ours: the list names each kind of row button once, in `commands`, so every row that does a job draws the same words at the same width; the record's own name goes in the row's `accessibleName`, never in the label.
|
|
226
267
|
* “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table)
|
|
227
268
|
* “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)
|
|
228
269
|
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `DESIGN.md` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact's `label`, the status's and the time's are the nouns the headings would be ("Partner", "State", "Asked"). The name's line under it is the one place a record is described in words, and the time keeps its verb's sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product's: `label` names the list, a time's `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu's `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception's word ("Needs attention", "Can't sign in"), never "Active" on every row, and never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent".
|
|
@@ -231,5 +272,5 @@ export type RecordListWithout<TRecord extends RowData, Key extends PropertyKey>
|
|
|
231
272
|
* “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)
|
|
232
273
|
* Ours: each box is named by `select.label`, which reads "Select {record}".
|
|
233
274
|
*/
|
|
234
|
-
export declare function RecordList<TRecord extends RowData>(props: RecordListProps<TRecord>): import("react").JSX.Element | null;
|
|
275
|
+
export declare function RecordList<TRecord extends RowData, TCommand extends string = never>(props: RecordListProps<TRecord, TCommand>): import("react").JSX.Element | null;
|
|
235
276
|
//# sourceMappingURL=record-list.d.ts.map
|
|
@@ -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;AACrD,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,
|
|
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;AACrD,OAAO,EAAiB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE5F,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAExE,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EAGvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAIjG,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,2BAA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CAAC;IACpD;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,+DAA+D;QAC/D,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,WAAW,CAAC,EAAE,SAAS,CAAC;QACxB,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;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAC3B,OAAO,SAAS,OAAO,EACvB,GAAG,SAAS,WAAW,EACvB,QAAQ,SAAS,MAAM,GAAG,KAAK,IAE/B,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,MAAM,MAAM,GACnD,MAAM,SAAS,OAAO,GACpB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GACjB,KAAK,GACP,KAAK,CAAC;AAgXZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,OAAO,EAAE,QAAQ,SAAS,MAAM,GAAG,KAAK,EACjF,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,sCA+C1C"}
|
|
@@ -5,7 +5,7 @@ import { ActionMenu } from "./action-menu.js";
|
|
|
5
5
|
import { Checkbox } from "./checkbox.js";
|
|
6
6
|
import { EntityTable, } from "./data-table.js";
|
|
7
7
|
import { EmptyState } from "./empty-state.js";
|
|
8
|
-
import { PageCommandButton } from "./page-actions.js";
|
|
8
|
+
import { PageCommandButton, } from "./page-actions.js";
|
|
9
9
|
import { ProgressChecklist } from "./progress-checklist.js";
|
|
10
10
|
import { RecordIdentity } from "./record-identity.js";
|
|
11
11
|
import { RecordTime, recordDate } from "./record-time.js";
|
|
@@ -27,11 +27,35 @@ const BUTTON_ICON_SLOT = 20;
|
|
|
27
27
|
const BUTTON_ICON_GAP = 3;
|
|
28
28
|
const EXTERNAL_ARROW = 14;
|
|
29
29
|
const WIDEST_LABEL_CHARACTER = 8;
|
|
30
|
+
/**
|
|
31
|
+
* A row's button as the list names it: the face from `commands`, the action and name from the row.
|
|
32
|
+
* A product that draws the same command outside a list, such as a lone Connect button, builds it
|
|
33
|
+
* with this, so the button reads the same in both places.
|
|
34
|
+
*/
|
|
35
|
+
export function rowButton(faces, row) {
|
|
36
|
+
const { use, accessibleName, pending, disabled, ...action } = row;
|
|
37
|
+
const face = faces[use];
|
|
38
|
+
// A kind with no running word of its own keeps its label while it runs.
|
|
39
|
+
const pendingWord = pending
|
|
40
|
+
? { pending: true, pendingLabel: face.pendingLabel ?? face.label }
|
|
41
|
+
: { pendingLabel: face.pendingLabel };
|
|
42
|
+
return {
|
|
43
|
+
...action,
|
|
44
|
+
...pendingWord,
|
|
45
|
+
label: face.label,
|
|
46
|
+
icon: face.icon,
|
|
47
|
+
external: face.external,
|
|
48
|
+
accessibleName,
|
|
49
|
+
disabled,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
30
52
|
function shownCommands(list, record) {
|
|
31
53
|
const menu = list.menu?.(record);
|
|
32
54
|
const commands = menu?.commands ?? [];
|
|
33
55
|
const own = list.command?.(record);
|
|
34
|
-
const ownButtons = own
|
|
56
|
+
const ownButtons = own
|
|
57
|
+
? [own].flat().map((row) => rowButton(list.commands ?? {}, row))
|
|
58
|
+
: [];
|
|
35
59
|
const state = list.state?.(record) ?? null;
|
|
36
60
|
const dots = menu && commands.length > 0 ? menu : undefined;
|
|
37
61
|
const opens = Boolean(list.open?.href(record)) && !state;
|
|
@@ -296,6 +320,7 @@ function RecordRows(props) {
|
|
|
296
320
|
* @words “Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`).” (https://vercel.com/geist/entity)
|
|
297
321
|
* Ours: the name is the record's own and the labels around it are sentence case, not Title Case.
|
|
298
322
|
* “Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen.” (https://vercel.com/geist/entity)
|
|
323
|
+
* Ours: the list names each kind of row button once, in `commands`, so every row that does a job draws the same words at the same width; the record's own name goes in the row's `accessibleName`, never in the label.
|
|
299
324
|
* “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table)
|
|
300
325
|
* “Render — in cells where a value is unknown or not applicable. Don’t substitute N/A, null, or an empty string.” (https://vercel.com/geist/table)
|
|
301
326
|
* Ours: a list is the records' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment's status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `DESIGN.md` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact's `label`, the status's and the time's are the nouns the headings would be ("Partner", "State", "Asked"). The name's line under it is the one place a record is described in words, and the time keeps its verb's sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product's: `label` names the list, a time's `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu's `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception's word ("Needs attention", "Can't sign in"), never "Active" on every row, and never the state a row's own command already says: a row that ends in "Resend link" carries no "Link sent".
|
|
@@ -15,7 +15,7 @@ type ToasterOwnProps = Omit<ToasterProps, "closeButton" | "containerAriaLabel" |
|
|
|
15
15
|
* @family Feedback
|
|
16
16
|
* @when "A succinct message that is displayed temporarily." (https://vercel.com/geist/toast) "Use a toast for non-blocking acknowledgments of user-initiated actions: `Domain added`, `Project archived`, `Deployment canceled`." (https://vercel.com/geist/toast) "Pick the method by how the user experienced the event, not by HTTP status. A user-canceled deploy is `toasts.message('Deployment canceled')`, not `success`. A partial deploy with skipped routes is `toasts.warning(...)`." (https://vercel.com/geist/toast) Ours: mount it once and raise toasts through `showMessageToast` from `@nadicodeai/ui/components/toast`. `toasts.message` is the tone `info`, and `success`, `warning` and `error` keep their names.
|
|
17
17
|
* @instead "Don’t use a toast alone for billing failures, permission denials, or build failures the user has to triage. Pair a ≤6-word toast (`Build failed`) with a persistent row carrying the recovery step and a stable identifier." (https://vercel.com/geist/toast) "Field-level validation belongs on the `Input`, not in a toast. Persistent configuration warnings belong in `Note` or `Banner`." (https://vercel.com/geist/toast) Ours: the persistent row is a `MessageNotice`, a field's wrong value stays on the field (`FieldError`), and a lasting condition is a `NoticeBanner`.
|
|
18
|
-
* @behaviour "Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears." (https://vercel.com/geist/toast) "Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button." (https://vercel.com/geist/toast) "Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step." (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.
|
|
18
|
+
* @behaviour "Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears." (https://vercel.com/geist/toast) "Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button." (https://vercel.com/geist/toast) "Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step." (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A product that shows another store's notifications, as Nadia shows Hermes's, raises each with `showHeldToast`: the store decides when it leaves (`dismissToast`), so a failure the person must act on stays, and its second action stands beside the first, both on a row under the toast's words when it has a body. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.
|
|
19
19
|
* @words "One sentence, sentence case, no trailing period when the toast is a single sentence." (https://vercel.com/geist/toast) "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) "Error toasts are two sentences with periods and end with a recovery step: `Couldn’t verify domain. Try again.` Use `Couldn’t` for user-state errors and `Failed to` for system or infra errors; match adjacent shipped copy and don’t flip mid-flow." (https://vercel.com/geist/toast) "Pair the toast verb 1:1 with the destructive button verb (`Delete Project` then `Project deleted`, never `Project removed`)." (https://vercel.com/geist/toast) "Undo snackbars use the literal label `Undo`, never `Restore`, `Bring Back`, or `Cancel`. Only use the pattern when the rollback is safe." (https://vercel.com/geist/toast) Ours: the words come from the catalogue; *Mailbox removed* pairs with its button *Remove mailbox*.
|
|
20
20
|
* @access "The toast region announces with `aria-live="polite"`; reserve `assertive` for blocking errors that interrupt a flow." (https://vercel.com/geist/toast) "Don’t put primary navigation inside a toast; transient surfaces vanish before keyboard users can reach them." (https://vercel.com/geist/toast) Ours: the toaster's live region is named by `regionLabel` and the close button by `closeLabel`. Navigation is never the only route to recovery: the record's own row keeps its controls. Undo is reachable by keyboard (Alt+T moves focus to the toasts) while it shows.
|
|
21
21
|
*/
|
|
@@ -15,7 +15,7 @@ const TONE_WORD_ONLY = "[&_[data-icon]]:sr-only";
|
|
|
15
15
|
* @family Feedback
|
|
16
16
|
* @when "A succinct message that is displayed temporarily." (https://vercel.com/geist/toast) "Use a toast for non-blocking acknowledgments of user-initiated actions: `Domain added`, `Project archived`, `Deployment canceled`." (https://vercel.com/geist/toast) "Pick the method by how the user experienced the event, not by HTTP status. A user-canceled deploy is `toasts.message('Deployment canceled')`, not `success`. A partial deploy with skipped routes is `toasts.warning(...)`." (https://vercel.com/geist/toast) Ours: mount it once and raise toasts through `showMessageToast` from `@nadicodeai/ui/components/toast`. `toasts.message` is the tone `info`, and `success`, `warning` and `error` keep their names.
|
|
17
17
|
* @instead "Don’t use a toast alone for billing failures, permission denials, or build failures the user has to triage. Pair a ≤6-word toast (`Build failed`) with a persistent row carrying the recovery step and a stable identifier." (https://vercel.com/geist/toast) "Field-level validation belongs on the `Input`, not in a toast. Persistent configuration warnings belong in `Note` or `Banner`." (https://vercel.com/geist/toast) Ours: the persistent row is a `MessageNotice`, a field's wrong value stays on the field (`FieldError`), and a lasting condition is a `NoticeBanner`.
|
|
18
|
-
* @behaviour "Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears." (https://vercel.com/geist/toast) "Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button." (https://vercel.com/geist/toast) "Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step." (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.
|
|
18
|
+
* @behaviour "Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears." (https://vercel.com/geist/toast) "Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button." (https://vercel.com/geist/toast) "Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step." (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A product that shows another store's notifications, as Nadia shows Hermes's, raises each with `showHeldToast`: the store decides when it leaves (`dismissToast`), so a failure the person must act on stays, and its second action stands beside the first, both on a row under the toast's words when it has a body. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.
|
|
19
19
|
* @words "One sentence, sentence case, no trailing period when the toast is a single sentence." (https://vercel.com/geist/toast) "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) "Error toasts are two sentences with periods and end with a recovery step: `Couldn’t verify domain. Try again.` Use `Couldn’t` for user-state errors and `Failed to` for system or infra errors; match adjacent shipped copy and don’t flip mid-flow." (https://vercel.com/geist/toast) "Pair the toast verb 1:1 with the destructive button verb (`Delete Project` then `Project deleted`, never `Project removed`)." (https://vercel.com/geist/toast) "Undo snackbars use the literal label `Undo`, never `Restore`, `Bring Back`, or `Cancel`. Only use the pattern when the rollback is safe." (https://vercel.com/geist/toast) Ours: the words come from the catalogue; *Mailbox removed* pairs with its button *Remove mailbox*.
|
|
20
20
|
* @access "The toast region announces with `aria-live="polite"`; reserve `assertive` for blocking errors that interrupt a flow." (https://vercel.com/geist/toast) "Don’t put primary navigation inside a toast; transient surfaces vanish before keyboard users can reach them." (https://vercel.com/geist/toast) Ours: the toaster's live region is named by `regionLabel` and the close button by `closeLabel`. Navigation is never the only route to recovery: the record's own row keeps its controls. Undo is reachable by keyboard (Alt+T moves focus to the toasts) while it shows.
|
|
21
21
|
*/
|
|
@@ -42,7 +42,7 @@ const Toaster = ({ closeLabel, regionLabel, toneLabels, ...props }) => {
|
|
|
42
42
|
toast: "nc-toast nc-elevation-floating min-h-16 pr-16! text-body-sm!",
|
|
43
43
|
title: "font-normal!",
|
|
44
44
|
description: "text-current!",
|
|
45
|
-
closeButton: "top-4! right-4! left-auto! size-8! transform-none! rounded-sm! border-0! bg-transparent! opacity-100! hover:bg-current/10!",
|
|
45
|
+
closeButton: "top-4! right-4! left-auto! size-8! transform-none! rounded-sm! border-0! bg-transparent! text-current! opacity-100! hover:bg-current/10!",
|
|
46
46
|
actionButton: "h-nadicode-control-height-sm! rounded-sm! bg-primary! px-button-padding-inline-sm! text-button! font-medium! text-primary-foreground!",
|
|
47
47
|
success: `${TONE_WORD_ONLY} [--normal-bg:var(--info)] [--normal-text:var(--info-foreground)]`,
|
|
48
48
|
info: TONE_WORD_ONLY,
|
|
@@ -6,4 +6,17 @@ export declare function showMessageToast(message: ResolvedMessage, options: {
|
|
|
6
6
|
tone: MessageToastTone;
|
|
7
7
|
id?: string;
|
|
8
8
|
}): void;
|
|
9
|
+
/**
|
|
10
|
+
* A toast whose lifetime another store holds, such as Hermes's notification
|
|
11
|
+
* store in Nadia's window: it stays until `dismissToast(id)`, offers the
|
|
12
|
+
* message's first two actions with a handler, and calls `onClose` only when the
|
|
13
|
+
* person closes or swipes it away.
|
|
14
|
+
*/
|
|
15
|
+
export declare function showHeldToast(message: ResolvedMessage, options: {
|
|
16
|
+
tone: MessageToastTone;
|
|
17
|
+
id: string;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
}): void;
|
|
20
|
+
/** Takes down the held toast `id`, without calling its `onClose`. */
|
|
21
|
+
export declare function dismissToast(id: string): void;
|
|
9
22
|
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAExE,0FAA0F;AAC1F,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,IAAI,CAON"}
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/components/toast.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAExE,0FAA0F;AAC1F,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/C,IAAI,CAON;AAOD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GACnE,IAAI,CAiBN;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE7C"}
|
package/dist/components/toast.js
CHANGED
|
@@ -14,3 +14,35 @@ export function showMessageToast(message, options) {
|
|
|
14
14
|
action: action?.onClick ? { label: action.label, onClick: action.onClick } : undefined,
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
+
const HELD_WITH_WORDS = {
|
|
18
|
+
toast: "flex-wrap! [--toast-button-margin-start:0px]",
|
|
19
|
+
content: "basis-full!",
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A toast whose lifetime another store holds, such as Hermes's notification
|
|
23
|
+
* store in Nadia's window: it stays until `dismissToast(id)`, offers the
|
|
24
|
+
* message's first two actions with a handler, and calls `onClose` only when the
|
|
25
|
+
* person closes or swipes it away.
|
|
26
|
+
*/
|
|
27
|
+
export function showHeldToast(message, options) {
|
|
28
|
+
const [action, second] = message.actions.filter((command) => command.onClick !== undefined);
|
|
29
|
+
const description = bodyBeyondTitle(message) ?? undefined;
|
|
30
|
+
toast[options.tone](message.title, {
|
|
31
|
+
id: options.id,
|
|
32
|
+
description,
|
|
33
|
+
// A held toast's words can run to a few sentences, so its buttons go on a row under them.
|
|
34
|
+
classNames: description ? HELD_WITH_WORDS : undefined,
|
|
35
|
+
duration: Number.POSITIVE_INFINITY,
|
|
36
|
+
action: action?.onClick ? { label: action.label, onClick: action.onClick } : undefined,
|
|
37
|
+
cancel: second?.onClick ? { label: second.label, onClick: second.onClick } : undefined,
|
|
38
|
+
onDismiss: (shown) => {
|
|
39
|
+
if (!shown.delete) {
|
|
40
|
+
options.onClose();
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** Takes down the held toast `id`, without calling its `onClose`. */
|
|
46
|
+
export function dismissToast(id) {
|
|
47
|
+
toast.dismiss(id);
|
|
48
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compositions.d.ts","sourceRoot":"","sources":["../../../src/showcase/specimens/compositions.tsx"],"names":[],"mappings":"AAuIA,iBAAS,oBAAoB,gCA+B5B;AAMD,iBAAS,wBAAwB,gCAahC;AAED,iBAAS,qBAAqB,gCA0B7B;AAED,iBAAS,yBAAyB,gCAGjC;AAwBD,iBAAS,mBAAmB,gCAoC3B;AAED,iBAAS,sBAAsB,gCAyD9B;AAED,iBAAS,yBAAyB,gCAUjC;AAED,iBAAS,qBAAqB,gCAwC7B;AAED,iBAAS,kBAAkB,gCAiB1B;AAED,iBAAS,oBAAoB,gCAS5B;AAED,iBAAS,kBAAkB,gCA0B1B;AAED,iBAAS,kBAAkB,gCAuE1B;AAED,iBAAS,kBAAkB,gCAwB1B;AAED,iBAAS,oBAAoB,gCAkD5B;AAED,iBAAS,oBAAoB,gCAqC5B;AAED,iBAAS,mBAAmB,gCA2B3B;AAED,iBAAS,mBAAmB,gCAoB3B;AAwBD,iBAAS,uBAAuB,gCAkD/B;AAmCD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"compositions.d.ts","sourceRoot":"","sources":["../../../src/showcase/specimens/compositions.tsx"],"names":[],"mappings":"AAuIA,iBAAS,oBAAoB,gCA+B5B;AAMD,iBAAS,wBAAwB,gCAahC;AAED,iBAAS,qBAAqB,gCA0B7B;AAED,iBAAS,yBAAyB,gCAGjC;AAwBD,iBAAS,mBAAmB,gCAoC3B;AAED,iBAAS,sBAAsB,gCAyD9B;AAED,iBAAS,yBAAyB,gCAUjC;AAED,iBAAS,qBAAqB,gCAwC7B;AAED,iBAAS,kBAAkB,gCAiB1B;AAED,iBAAS,oBAAoB,gCAS5B;AAED,iBAAS,kBAAkB,gCA0B1B;AAED,iBAAS,kBAAkB,gCAuE1B;AAED,iBAAS,kBAAkB,gCAwB1B;AAED,iBAAS,oBAAoB,gCAkD5B;AAED,iBAAS,oBAAoB,gCAqC5B;AAED,iBAAS,mBAAmB,gCA2B3B;AAED,iBAAS,mBAAmB,gCAoB3B;AAwBD,iBAAS,uBAAuB,gCAkD/B;AAmCD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;CA+FE,CAAC"}
|
|
@@ -458,10 +458,11 @@ export const COMPOSITIONS = {
|
|
|
458
458
|
] }) })),
|
|
459
459
|
OverviewPage: OverviewPageSpecimen,
|
|
460
460
|
PageHeader: () => (_jsxs(PageActionsHostProvider, { children: [_jsx(PageHeader, { title: "Customers" }), _jsx(PageActions, { primary: { label: "Invite customer", icon: _jsx(Plus, {}), onClick: nothing } })] })),
|
|
461
|
-
RecordList: () => (_jsxs("div", { className: "grid gap-6", children: [_jsx(RecordList, { ...MAILBOX_LIST, footer: { count: "3 mailboxes" }, label: "Mailboxes", records: MAILBOXES }), _jsx(RecordList, { ...MAILBOX_LIST, label: "Mailboxes with one command", menu: reconnectMenu, records: MAILBOXES }), _jsx(RecordList, { ...MAILBOX_LIST,
|
|
462
|
-
label: "Reconnect",
|
|
463
|
-
|
|
464
|
-
|
|
461
|
+
RecordList: () => (_jsxs("div", { className: "grid gap-6", children: [_jsx(RecordList, { ...MAILBOX_LIST, footer: { count: "3 mailboxes" }, label: "Mailboxes", records: MAILBOXES }), _jsx(RecordList, { ...MAILBOX_LIST, label: "Mailboxes with one command", menu: reconnectMenu, records: MAILBOXES }), _jsx(RecordList, { ...MAILBOX_LIST, commands: {
|
|
462
|
+
reconnect: { label: "Reconnect", pendingLabel: "Reconnecting…", icon: _jsx(RefreshCw, {}) },
|
|
463
|
+
}, command: (mailbox) => ({
|
|
464
|
+
use: "reconnect",
|
|
465
|
+
accessibleName: `Reconnect ${mailbox.address}`,
|
|
465
466
|
onClick: nothing,
|
|
466
467
|
}), label: "Mailboxes with a row command", records: MAILBOXES }), _jsx(SelectableRecordListSpecimen, {})] })),
|
|
467
468
|
RecordSheet: RecordSheetSpecimen,
|
|
@@ -209,7 +209,7 @@ export const USAGE = [
|
|
|
209
209
|
when: "“Use `<Entity>` for a row of descriptive content paired with one or two controls (member rows, integration rows, domain rows).” (https://vercel.com/geist/entity) Ours: the records are things a person opens or acts on and that name themselves: projects, deployments, domains, members, integrations, Agents, Skills, mailboxes. A list inside another page: an Overview's exceptions, an object page's \"Needs attention\". A page whose whole job is the list is a `CollectionPage`, which draws this. Values edited in place (a domain, an environment variable) are the same rows with an `editor`: the row expands into its form. Of the three kinds of list, entity rows and rows edited in place are this; records compared across columns are a `DataTable`.",
|
|
210
210
|
instead: "“For tabular data with sortable columns and shared row shape, use `Table` instead.” (https://vercel.com/geist/entity) “For a static key/value metadata block on a detail page, use `Description`.” (https://vercel.com/geist/entity) Ours: Geist's `Table` is a `DataTable`: this list has no visible headings and at most three facts, so a fourth fact is a table, and anything more than a few facts lives on the record's page. A screen gives `RecordList` the records and what each one says, never its own toolbar, table, rows or menus, and nothing else draws a record row. Its `Description` is `ObjectFacts`. Events in time are an `ActivityFeed`. Reusable things a person adds from a catalogue are a `LibraryShelf`. A descriptive row with prose is an `Item`.",
|
|
211
211
|
behaviour: "One bordered card, a 1 px rule between records and none after the last. A row is 72 px, with 16 px above and below, and its columns stand left to right at the widths the list declares, so a person reads every list the same way: the `select` box (40 px, only when the list is picked from, an optional column), the identity (the rest: the one column without a size), the facts (each its `size`), the status (`status.size`), the time (`time.size`, tabular), the `checklist` ring (52 px, only when the record has steps to be ready) and the commands (as wide as the widest row's buttons, a failed action's next steps and the three dots after them need, worked out from their labels, each label at most 8 px a character and a button holding the longer of its label and its pending label, the dots at their 44 px touch target; 64 px for the three dots alone; a row that draws a button or next steps is never narrower than a `commandsSize` the caller gives). A `checklist` puts the record's `ProgressChecklist` ring just before its commands, where Vercel ends a project's row with its Production Checklist; the ring opens its own drawer, never the row. Every row has its 32 px mark, its name (600) and, under it, one muted 14 px line; `name` and the mark are required; a record with nothing to say under its name leaves the line out and is the name alone, never a dash. Give every column a `size` in pixels; the name takes the rest. With `layout=\"line\"`, as on Vercel's Projects page, the facts and the status share one muted line, joined by a middle dot, in a column as wide as the name's, and the row stays one line (mark, name over its line, that summary, the time, the ring, the three dots) on a card wide enough for its sized columns and 160 px each for the name and the summary, and on a narrower card the summary and the time move under the name as muted text joined by a middle dot that wraps, the status keeping its mark whole and breaking between its words only when it alone is wider than the line, in the same row, their labels read by assistive technology only. Rows of `columns` follow the same rule once the card is narrower than their columns: the facts and the time leave the row for that muted text, wrapping so every value stays readable, never a labelled list, and the status stands beside the name, which ends in an ellipsis before it, so the exception is never the part a phone's line cuts. `facts` takes at most three. A menu keeps every command in the three dots, one alone included, as Vercel's Environment Variables and Members rows do: a button stands on a row only where the list names it as `command`, the record's main job, on every row that can do it, so one list never mixes rows ending in a button with rows ending in dots. The commands never take the name's room: once the row is compact, its commands column holds only the three dots and the row's own buttons stand under the name, beside a failed action's next steps, outside the row's link, so pressing one never opens the record. Every column of the records' attributes stands on every row, as Vercel's lists keep theirs, so a person reads one attribute down a column: a record with no value for a fact draws `TableValue`'s muted dash, with the fact's `missing` read in its place; status is only for the exception, so a healthy record's status cell stays empty and the records that need a person stand out; the commands column, which holds no attribute, stands only while a record has a command, a menu or a message, or the rows open, and it widens for a failed action's next steps only while a row shows one. Never the three dots before the button, a decorative icon for the record's mark, a status on every row, or a destructive button on every row: a destructive command stays in the three dots. A `line` row's summary joins only the facts the record has, so it never ends in a dot. A failed or refused action of the record shows as its catalogue message inside its own row, never a notice under the row: it replaces the detail line, with its next steps beside its commands, or under the message on a card too narrow for the row's columns. With `open` the whole row is one target and takes the `accent` hover, with no chevron, as Vercel's Deployments rows open theirs; a row that opens nothing never reacts to hover. Opening is the row's alone: the three dots never hold a command that only shows the record (*Details*, *View*, *Open*). With `editor` the record's row opens its form under its line. `empty` is required: `null` is the choice to draw nothing for a list with no records, and any other value is the state it draws. A list that is a section of another page takes `heading`: its title, the one line under it, and at the trailing edge the card's `actions`, such as its Add command and a muted count, drawn as every card draws them, so the list and its commands are one card, never a list inside a setting card. A note about the whole list is `footer.note`: one muted line, an optional *Learn more* after it at the left and one secondary action at the right, in a strip of its own under the count and the paging, as Vercel ends its deployments list (\"Deployment retention is enabled. Learn more\", *View recently deleted*). 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\"), so choosing never changes the page's title row; the record's own main job stays its row's `command`, 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 and a failed action's message. “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) Ours: `failed`, `noMatch` and `empty` are those variants, drawn inside the card. “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) Ours: one or two row commands (outline buttons of 32 px) stand before the three dots (36 px), the Dots Menu. “Render the Skeleton variant (`entity-with-skeleton`) during load instead of an empty row, and swap to real content once data resolves.” (https://vercel.com/geist/entity) Ours: three still skeleton rows hold the place, in a region that announces what replaces them; then the first that holds: the failed read, no match, the empty state, the rows.",
|
|
212
|
-
words: '“Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`).” (https://vercel.com/geist/entity) Ours: the name is the record\'s own and the labels around it are sentence case, not Title Case. “Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen.” (https://vercel.com/geist/entity) “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table) “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) Ours: a list is the records\' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment\'s status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `DESIGN.md` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact\'s `label`, the status\'s and the time\'s are the nouns the headings would be ("Partner", "State", "Asked"). The name\'s line under it is the one place a record is described in words, and the time keeps its verb\'s sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product\'s: `label` names the list, a time\'s `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu\'s `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception\'s word ("Needs attention", "Can\'t sign in"), never "Active" on every row, and never the state a row\'s own command already says: a row that ends in "Resend link" carries no "Link sent".',
|
|
212
|
+
words: '“Lead the left column with a scannable identifier: an `Avatar` or icon, a Title Case label, then sentence-case secondary metadata (`Member since Mar 14, 2026`).” (https://vercel.com/geist/entity) Ours: the name is the record\'s own and the labels around it are sentence case, not Title Case. “Keep right-column buttons Verb + Noun (`Remove Member`, `Resend Invite`). Bare verbs like `Remove` or `Confirm` lose context once the row scrolls offscreen.” (https://vercel.com/geist/entity) Ours: the list names each kind of row button once, in `commands`, so every row that does a job draws the same words at the same width; the record\'s own name goes in the row\'s `accessibleName`, never in the label. “Column headers (`<Table.Head>`) are Title Case nouns or noun phrases: `Last Used`, `Requests (7d)`, `Created`, `Status`. Never sentences.” (https://vercel.com/geist/table) “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) Ours: a list is the records\' attributes shown as data, not written as text. Its columns are the few attributes a person compares across the records to decide what to do with one (a deployment\'s status, environment, commit, branch and time), chosen from that job, never from what there is to say about a record. A cell holds the value alone, in the same shape down its column: a name, a kind ("Customer"), a count with its unit ("3 keys"), an amount; its position, the mark of its kind (`icon`, as Vercel marks a branch before "main") and its type say what it is, so the hidden heading needs no words in the cell. Never a sentence that restates the column ("Through Partner Alpha", "Joins as a company"), and never a word in place of a missing value ("Not available", "No Partner"): `of` returns nothing and the list draws the dash, and `nadicodeai/record-fact-no-stand-in` refuses the word given by `??`, a presence check or a guard clause. A known zero stays the count ("0 Agents") and a complete report that found nothing keeps its word ("None"), as `DESIGN.md` says; a word that names a kind of its own, a glossary term such as "Direct customer", is a value. A fact\'s `label`, the status\'s and the time\'s are the nouns the headings would be ("Partner", "State", "Asked"). The name\'s line under it is the one place a record is described in words, and the time keeps its verb\'s sentence ("Updated 3h ago"), as the approved canvas rules. Every string is the product\'s: `label` names the list, a time\'s `phrase` writes its sentence, `missing` is what a screen reader hears behind a dash, the menu\'s `label` reads "More for {record}". A row command names its result in sentence case ("Edit domain"). A status is the exception\'s word ("Needs attention", "Can\'t sign in"), never "Active" on every row, and never the state a row\'s own command already says: a row that ends in "Resend link" carries no "Link sent".',
|
|
213
213
|
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) Ours: the loading rows sit in one `SkeletonRegion` that is busy while they stand and announces what replaces them. A table named by `label`, its column headings read by assistive technology only; the commands column\'s is `commandsHeader`, and empty without one, since its controls name themselves, never the list\'s name a second time. The row link carries `open.label`; the three dots carry the menu\'s `label`, and the menu\'s first line names the record. The loading rows are a status named by `loadingLabel`, inside the one live region that announces what replaces them. “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) Ours: each box is named by `select.label`, which reads "Select {record}".',
|
|
214
214
|
},
|
|
215
215
|
{
|
|
@@ -1385,7 +1385,7 @@ export const USAGE = [
|
|
|
1385
1385
|
summary: "A catalogue message about one thing on the screen.",
|
|
1386
1386
|
when: '"Display text that requires attention or provides additional information." (https://vercel.com/geist/note) "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) "Choose `variant` by meaning: `error` for a problem the user must fix, `warning` for a consequence to acknowledge, `success` for a passed check, `secondary` for neutral information." (https://vercel.com/geist/note) Ours: a message beside the field, card or section it describes, under the control whose write failed (`action`), or atop the section whose condition lasts (`section`). The `tone` is the `variant`: `destructive` is `error`, `warning` is `warning`, `info` is `success` (a passed check or a state the product manages for the reader, drawn in the accent blue) and `neutral` is `secondary`; there is no violet or cyan.',
|
|
1387
1387
|
instead: "\"Pick `Banner` when the message is page-level or system-wide and needs a CTA, `Toast` for transient acknowledgments, `Modal` for destructive confirmations.\" (https://vercel.com/geist/note) Ours: `Banner` is `NoticeBanner`, for a condition of the page's own object, and a system-wide condition is a notification in the product's inbox, never a banner; `Toast` is `showMessageToast` and `Modal` is `ConfirmDialog`. For a field's wrong value use `FieldError`. For a failed read use `EmptyState failed`.",
|
|
1388
|
-
behaviour: '"A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia\'s *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.',
|
|
1388
|
+
behaviour: '"A Note is persistent until the underlying state changes; don’t add an ad hoc dismiss control because it competes with the message." (https://vercel.com/geist/note) "One Note per concept. Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "The optional `NoteAction` holds a single inline CTA. Don’t pair it with a second button." (https://vercel.com/geist/note) Ours: `Alert` is its primitive. Tone `destructive` by default, `warning`, `info` or `neutral`; there is no `success` tone. Colour sits on the line, the text and the mark; the ground stays clear, and the action stays neutral. `section` is the framed note, a line 36 px high with its mark and sentence on one row and the action at its trailing edge (under 768 px the action takes its own row, full width), with or without an action; `action` is the unframed passage, its mark and sentence on one row with the action link inside the sentence, after a space. The title and the body run on as one passage, the title closed by a full stop when it has none of its own, so the two never read as one sentence; the title leads in bold (semibold in a note, medium in a passage) only when a body follows it, and stands at regular weight alone. A message worded for a notice has one action, a small default button in a section and an underlined 14 px link in the passage, and at most a second one after it (Nadia\'s *Ask Nadia* after *Try again*), an outline button in a section and a second link in the passage; a third is not shown. A section can draw the host\'s own `controls` in the action\'s place instead, such as a carried tree\'s buttons that keep their behaviour. Long words wrap, nothing truncates. A successful retry removes it. Required: the catalogue `message`, so the sentence and its mark are always drawn.',
|
|
1389
1389
|
words: '"`NoteLabel` is a 1–2 word Title Case prefix that names the topic: `Region Change`, `Rate Limit`, `Plan Limit`. Cut hedges like `Heads Up`, `FYI`, and `Note`." (https://vercel.com/geist/note) "`NoteContent` is one sentence in active voice that names the impact: `Changing this region restarts all functions.`" (https://vercel.com/geist/note) "No `variant="info"` exists; omit `variant` for the default info icon or use `variant="secondary"` for neutral copy." (https://vercel.com/geist/note) "Single-fragment labels take no period; full descriptive sentences in the body do." (https://vercel.com/geist/note) Ours: words come from the catalogue only. The message\'s title stands in for `NoteLabel` and `NoteContent`, in sentence case, and `info` exists as Geist\'s blue `success`. The action is labelled with its result: *Try again*, *Sign in*. When the message carries an action, its body does not repeat it: the link is the step, so the body ends before "Try again".',
|
|
1390
1390
|
access: '`action`: `role="alert"` (`status` for info and neutral). `section`: `role="status"`, `aria-live="polite"`, atomic. The mark is hidden. Focus stays where the person was.',
|
|
1391
1391
|
},
|
|
@@ -1440,7 +1440,7 @@ export const USAGE = [
|
|
|
1440
1440
|
summary: "The one place toasts appear, mounted once per product.",
|
|
1441
1441
|
when: '"A succinct message that is displayed temporarily." (https://vercel.com/geist/toast) "Use a toast for non-blocking acknowledgments of user-initiated actions: `Domain added`, `Project archived`, `Deployment canceled`." (https://vercel.com/geist/toast) "Pick the method by how the user experienced the event, not by HTTP status. A user-canceled deploy is `toasts.message(\'Deployment canceled\')`, not `success`. A partial deploy with skipped routes is `toasts.warning(...)`." (https://vercel.com/geist/toast) Ours: mount it once and raise toasts through `showMessageToast` from `@nadicodeai/ui/components/toast`. `toasts.message` is the tone `info`, and `success`, `warning` and `error` keep their names.',
|
|
1442
1442
|
instead: '"Don’t use a toast alone for billing failures, permission denials, or build failures the user has to triage. Pair a ≤6-word toast (`Build failed`) with a persistent row carrying the recovery step and a stable identifier." (https://vercel.com/geist/toast) "Field-level validation belongs on the `Input`, not in a toast. Persistent configuration warnings belong in `Note` or `Banner`." (https://vercel.com/geist/toast) Ours: the persistent row is a `MessageNotice`, a field\'s wrong value stays on the field (`FieldError`), and a lasting condition is a `NoticeBanner`.',
|
|
1443
|
-
behaviour: "\"Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears.\" (https://vercel.com/geist/toast) \"Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button.\" (https://vercel.com/geist/toast) \"Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step.\" (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.",
|
|
1443
|
+
behaviour: "\"Default toasts auto-dismiss; pass `preserve` only when the user must read or act on the message before it disappears.\" (https://vercel.com/geist/toast) \"Undo snackbars stay on screen for 5–10 seconds and pair the past-tense toast with a single `Undo` action button.\" (https://vercel.com/geist/toast) \"Don’t stack toasts to narrate one async flow; emit the success or error toast at the terminal step.\" (https://vercel.com/geist/toast) Ours: `showMessageToast` takes no `preserve`, so every toast leaves after 6 s, which is also the Undo window; the first action with a handler becomes the toast's one button, and its label is the catalogue's, so a literal `Undo` is not enforced. A product that shows another store's notifications, as Nadia shows Hermes's, raises each with `showHeldToast`: the store decides when it leaves (`dismissToast`), so a failure the person must act on stays, and its second action stands beside the first, both on a row under the toast's words when it has a body. A toast always has a tone: `info` is the nearest to a neutral one. Colour sits on the whole toast: `success` fills it with the accent blue (Geist's blue success, the same hue as an `info` note), `warning` and `error` with their solid colour, each with that colour's text; `info` stays the solid floating surface, never glass. A toast draws no tone mark, as Geist's: its words sit alone beside the close button, on one centre line, and the tone is read as a hidden word in the product's language (`toneLabels`), so it reads without colour. A toast is 420 px wide at most, 16 px padded, with a close button of 32 px at its trailing edge. A toast that stays up shows the waiting line, not a spinner. Required: `closeLabel`, `regionLabel` and `toneLabels`, because the close button, the region and each tone need a name in the product's language.",
|
|
1444
1444
|
words: '"One sentence, sentence case, no trailing period when the toast is a single sentence." (https://vercel.com/geist/toast) "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) "Error toasts are two sentences with periods and end with a recovery step: `Couldn’t verify domain. Try again.` Use `Couldn’t` for user-state errors and `Failed to` for system or infra errors; match adjacent shipped copy and don’t flip mid-flow." (https://vercel.com/geist/toast) "Pair the toast verb 1:1 with the destructive button verb (`Delete Project` then `Project deleted`, never `Project removed`)." (https://vercel.com/geist/toast) "Undo snackbars use the literal label `Undo`, never `Restore`, `Bring Back`, or `Cancel`. Only use the pattern when the rollback is safe." (https://vercel.com/geist/toast) Ours: the words come from the catalogue; *Mailbox removed* pairs with its button *Remove mailbox*.',
|
|
1445
1445
|
access: '"The toast region announces with `aria-live="polite"`; reserve `assertive` for blocking errors that interrupt a flow." (https://vercel.com/geist/toast) "Don’t put primary navigation inside a toast; transient surfaces vanish before keyboard users can reach them." (https://vercel.com/geist/toast) Ours: the toaster\'s live region is named by `regionLabel` and the close button by `closeLabel`. Navigation is never the only route to recovery: the record\'s own row keeps its controls. Undo is reachable by keyboard (Alt+T moves focus to the toasts) while it shows.',
|
|
1446
1446
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.191",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#jsx": "./src/jsx/index.ts",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@base-ui/react": "^1.9.0",
|
|
77
77
|
"@iconify-icons/logos": "^2.0.3",
|
|
78
78
|
"@iconify/react": "^6.0.2",
|
|
79
|
-
"@nadicodeai/design-system": "12.1.
|
|
79
|
+
"@nadicodeai/design-system": "12.1.191",
|
|
80
80
|
"@tanstack/react-table": "^9.3.1",
|
|
81
81
|
"@vgpu/wgsl": "0.6.0",
|
|
82
82
|
"class-variance-authority": "^0.7.1",
|