@nadicodeai/ui 12.1.243 → 12.1.245
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/card.d.ts +1 -1
- package/dist/components/card.js +2 -2
- package/dist/components/event-row.d.ts +1 -1
- package/dist/components/event-row.d.ts.map +1 -1
- package/dist/components/event-row.js +2 -2
- package/dist/components/object-page.js +1 -1
- package/dist/components/object-workspace.js +1 -1
- package/dist/components/plan-card.d.ts +1 -1
- package/dist/components/plan-card.d.ts.map +1 -1
- package/dist/components/plan-card.js +2 -2
- package/dist/components/sonner.js +1 -1
- package/dist/showcase/usage.generated.js +3 -3
- package/dist/styles/components.css +11 -0
- package/package.json +2 -2
|
@@ -9,7 +9,7 @@ type CardFlush = "bottom" | "all";
|
|
|
9
9
|
* @family Data
|
|
10
10
|
* @when "For in-product cards and dashboard tiles, use `Card`; Book is too decorative for repeated UI rows." (https://vercel.com/geist/book) Ours: only inside a composition that owns the job: the object card of an `ObjectPage`, the setting card of a `SettingsSection`, a KPI, a chart, a table. A new kind of card is a new composition, never a `Card` assembled at a call site, and never a card holding only an introduction.
|
|
11
11
|
* @instead "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: that card, a title and description, one control and a footer with help at the start and one action at the end, is `SettingsSection`. An object's card (a header bar with its name and commands, a body of facts, rows that open, a footer hint with one link elsewhere) is `ObjectPage`. The page's title row is never in a card. A row of a list is `Item`. A plane of brand colour is `BrandField`.
|
|
12
|
-
* @behaviour "One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title's right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title's longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header's own width, not the viewport's); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card's edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section's action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card's header holds the object's commands and its footer only a link, so it never saves; a setting card's header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card's or a section's title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section's `tone`.
|
|
12
|
+
* @behaviour "One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. A `CardTitle` wraps inside the card, breaking a word longer than its width, such as a long name, so no title runs past the card's edge. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title's right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title's longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header's own width, not the viewport's); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card's edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section's action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card's header holds the object's commands and its footer only a link, so it never saves; a setting card's header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card's or a section's title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section's `tone`.
|
|
13
13
|
* `flush="bottom"` ends the card at its last child, for rows whose hairlines run to its bottom edge, as a footer does; `flush="all"` lets the content meet every edge with no gap between children, for one picture or grid that fills the card.
|
|
14
14
|
* @words The title is a noun phrase naming what the card holds; the description one sentence directly under it, only when it adds something.
|
|
15
15
|
* @access A plain container; give it `render={<section />}` with a heading when it is a region of the page.
|
package/dist/components/card.js
CHANGED
|
@@ -8,7 +8,7 @@ import { cn } from "../lib/utils.js";
|
|
|
8
8
|
* @family Data
|
|
9
9
|
* @when "For in-product cards and dashboard tiles, use `Card`; Book is too decorative for repeated UI rows." (https://vercel.com/geist/book) Ours: only inside a composition that owns the job: the object card of an `ObjectPage`, the setting card of a `SettingsSection`, a KPI, a chart, a table. A new kind of card is a new composition, never a `Card` assembled at a call site, and never a card holding only an introduction.
|
|
10
10
|
* @instead "Groups related form controls inside a bordered card with optional footer actions." (https://vercel.com/geist/fieldset) Ours: that card, a title and description, one control and a footer with help at the start and one action at the end, is `SettingsSection`. An object's card (a header bar with its name and commands, a body of facts, rows that open, a footer hint with one link elsewhere) is `ObjectPage`. The page's title row is never in a card. A row of a list is `Item`. A plane of brand colour is `BrandField`.
|
|
11
|
-
* @behaviour "One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title's right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title's longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header's own width, not the viewport's); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card's edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section's action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card's header holds the object's commands and its footer only a link, so it never saves; a setting card's header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card's or a section's title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section's `tone`.
|
|
11
|
+
* @behaviour "One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. A `CardTitle` wraps inside the card, breaking a word longer than its width, such as a long name, so no title runs past the card's edge. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title's right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title's longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header's own width, not the viewport's); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card's edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section's action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card's header holds the object's commands and its footer only a link, so it never saves; a setting card's header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card's or a section's title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section's `tone`.
|
|
12
12
|
* `flush="bottom"` ends the card at its last child, for rows whose hairlines run to its bottom edge, as a footer does; `flush="all"` lets the content meet every edge with no gap between children, for one picture or grid that fills the card.
|
|
13
13
|
* @words The title is a noun phrase naming what the card holds; the description one sentence directly under it, only when it adds something.
|
|
14
14
|
* @access A plain container; give it `render={<section />}` with a heading when it is a region of the page.
|
|
@@ -32,7 +32,7 @@ function CardHeader({ className, narrowAction, ...props }) {
|
|
|
32
32
|
return (_jsx("div", { "data-slot": "card-header-frame", className: "@container/card-header-frame rounded-t-[inherit]", children: _jsx("div", { "data-slot": "card-header", "data-narrow-action": narrowAction, className: cn("group/card-header @container/card-header grid auto-rows-min items-start gap-x-1 gap-y-2 rounded-t-[inherit] px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] *:data-[slot=card-description]:col-start-1 *:data-[slot=card-title]:col-start-1 [.border-b]:pb-(--card-spacing)", className), ...props }) }));
|
|
33
33
|
}
|
|
34
34
|
function CardTitle({ className, focusTarget = false, ...props }) {
|
|
35
|
-
return (_jsx("div", { "data-slot": "card-title", "data-focus-target": focusTarget || undefined, className: cn("text-heading-sm group-data-[size=sm]/card:text-heading-xs", focusTarget && "rounded-sm", className), ...props }));
|
|
35
|
+
return (_jsx("div", { "data-slot": "card-title", "data-focus-target": focusTarget || undefined, className: cn("min-w-0 text-heading-sm wrap-break-word group-data-[size=sm]/card:text-heading-xs", focusTarget && "rounded-sm", className), ...props }));
|
|
36
36
|
}
|
|
37
37
|
function CardDescription({ className, ...props }) {
|
|
38
38
|
return (_jsx("div", { "data-slot": "card-description", className: cn("text-sm text-muted-foreground", className), ...props }));
|
|
@@ -51,7 +51,7 @@ export declare function EventRowSkeleton(): import("react").JSX.Element;
|
|
|
51
51
|
* @family Data
|
|
52
52
|
* @when Something that happened, read in passing: each row of an `ActivityFeed` (`layout="feed"`, which the feed draws), and, in an Agent's chat in Nadia, what happened between the messages that needs no answer from the person (`layout="conversation"`): background work finished or failed, an Assignment handed back, a scheduled task ran, the model changed, earlier messages summarized.
|
|
53
53
|
* @instead A failure the person must act on before the conversation can go on is a `MessageNotice`; the steps of one Agent run, read in order, are a `RunTimeline`; a line inside a reply that opens to a tool call's detail is a `DisclosureRow`; a record's whole history is an `ActivityFeed`.
|
|
54
|
-
* @behaviour A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.
|
|
54
|
+
* @behaviour A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, on the line of the last word, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.
|
|
55
55
|
* @words The sentence names the actor in `<strong>`, the action in the past tense and the object as a link in the text's colour: "Bruno replied to Marta", "Marta finished the Assignment Q4 price list". Done is the past tense, never a badge; a status is an exception's word only, the word the object's own page shows for that state: Failed, Needs you, Checking, Not run. A failure says so in the sentence too. The detail is one short line, such as the first words of a reply or a result. `opens.label` is the sentence in plain words; a button names what it does to the object: "Open the conversation".
|
|
56
56
|
* @access In a feed each row is an item of its day's list. A row that opens is one `button` over the whole row, named by `opens.label`, with `aria-expanded` and, while open, `aria-controls` naming the card; the object's link comes before it in the tab order and the card's buttons after it. The mark and the chevron are hidden; the time is a `<time>` with its exact moment for assistive technology.
|
|
57
57
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-row.d.ts","sourceRoot":"","sources":["../../src/components/event-row.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OA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ACH,wBAAgB,gBAAgB,gCAW/B;AAiGD;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,+BAIjF"}
|
|
@@ -33,7 +33,7 @@ export function EventRowSkeleton() {
|
|
|
33
33
|
}
|
|
34
34
|
function ConversationRow({ event, locale, timeZone, toggle, }) {
|
|
35
35
|
return (_jsxs("div", { className: "group/event-row relative grid grid-cols-[24px_minmax(0,1fr)_auto] items-start gap-x-3 px-2 py-1.5", "data-slot": toggle ? undefined : "event-row", children: [_jsx("div", { className: "flex h-5 items-center", children: _jsx(Mark, { actor: event.actor }) }), _jsxs("div", { className: "min-w-0", children: [_jsxs("div", { className: cn(WORDS, "[&_a]:relative [&_a]:z-10 [&_a]:underline [&_a]:decoration-border [&_a]:underline-offset-3", toggle &&
|
|
36
|
-
"nc-transition-paint group-hover/event-row:text-foreground group-has-[>button:focus-visible]/event-row:text-foreground"), children: [event.summary, toggle ? (_jsx(
|
|
36
|
+
"nc-transition-paint group-hover/event-row:text-foreground group-has-[>button:focus-visible]/event-row:text-foreground"), children: [event.summary, toggle ? (_jsx("span", { "aria-hidden": "true", className: "nc-after-word", children: _jsx(ChevronRightIcon, { className: "nc-transition-transform ml-1.5 inline-block size-3 align-[-1px] data-[state=open]:rotate-90", "data-state": toggle.open ? "open" : "closed" }) })) : null, _jsx(Status, { status: event.status })] }), event.detail ? (_jsx("div", { className: "mt-0.5 truncate text-label-sm text-muted-foreground", children: event.detail })) : null] }), _jsx("div", { className: "relative z-10 text-label-sm leading-5", children: _jsx(RecordTime, { at: event.at, locale: locale, mode: "clock", timeZone: timeZone }) }), toggle ? (_jsx(CollapsiblePrimitive.Trigger, { "aria-label": toggle.label, className: "absolute inset-0 cursor-pointer rounded-sm" })) : null] }));
|
|
37
37
|
}
|
|
38
38
|
function OpeningRow({ event, locale, timeZone, opens, }) {
|
|
39
39
|
const [open, setOpen] = useState(opens.defaultOpen === true);
|
|
@@ -46,7 +46,7 @@ function OpeningRow({ event, locale, timeZone, opens, }) {
|
|
|
46
46
|
* @family Data
|
|
47
47
|
* @when Something that happened, read in passing: each row of an `ActivityFeed` (`layout="feed"`, which the feed draws), and, in an Agent's chat in Nadia, what happened between the messages that needs no answer from the person (`layout="conversation"`): background work finished or failed, an Assignment handed back, a scheduled task ran, the model changed, earlier messages summarized.
|
|
48
48
|
* @instead A failure the person must act on before the conversation can go on is a `MessageNotice`; the steps of one Agent run, read in order, are a `RunTimeline`; a line inside a reply that opens to a tool call's detail is a `DisclosureRow`; a record's whole history is an `ActivityFeed`.
|
|
49
|
-
* @behaviour A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.
|
|
49
|
+
* @behaviour A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, on the line of the last word, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.
|
|
50
50
|
* @words The sentence names the actor in `<strong>`, the action in the past tense and the object as a link in the text's colour: "Bruno replied to Marta", "Marta finished the Assignment Q4 price list". Done is the past tense, never a badge; a status is an exception's word only, the word the object's own page shows for that state: Failed, Needs you, Checking, Not run. A failure says so in the sentence too. The detail is one short line, such as the first words of a reply or a result. `opens.label` is the sentence in plain words; a button names what it does to the object: "Open the conversation".
|
|
51
51
|
* @access In a feed each row is an item of its day's list. A row that opens is one `button` over the whole row, named by `opens.label`, with `aria-expanded` and, while open, `aria-controls` naming the card; the object's link comes before it in the tab order and the card's buttons after it. The mark and the chevron are hidden; the time is a `<time>` with its exact moment for assistive technology.
|
|
52
52
|
*/
|
|
@@ -27,7 +27,7 @@ function UrlValue({ url, href }) {
|
|
|
27
27
|
*/
|
|
28
28
|
export function ObjectPage({ heading, picture, mark, name, headingProps, description, facts, figures, actions, entries, footer, notice, children, }) {
|
|
29
29
|
const title = headingProps ? (_jsx("h1", { ...headingProps, className: cn("outline-none", heading && "sr-only", headingProps.className), children: name })) : heading ? null : (name);
|
|
30
|
-
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsx("div", { className: "grid min-w-0 gap-3", children: _jsxs(Card, { className: cn("min-w-0", entries && entries.length > 0 && !footer && "pb-0"), render: _jsx("div", { "data-slot": "object-card" }), size: "sm", children: [_jsxs(CardHeader, { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-3", (facts !== undefined || figures !== undefined) && "border-b"), children: [heading ? (_jsxs("div", { className: "flex min-w-0 flex-1 basis-64 items-center", children: [title, _jsx(CardTitle, {
|
|
30
|
+
return (_jsxs("div", { className: "grid min-w-0 gap-6", "data-slot": "object-page", children: [notice ? _jsx(NoticeBanner, { ...notice }) : null, _jsx("div", { className: "grid min-w-0 gap-3", children: _jsxs(Card, { className: cn("min-w-0", entries && entries.length > 0 && !footer && "pb-0"), render: _jsx("div", { "data-slot": "object-card" }), size: "sm", children: [_jsxs(CardHeader, { className: cn("flex flex-wrap items-center justify-between gap-x-4 gap-y-3", (facts !== undefined || figures !== undefined) && "border-b"), children: [heading ? (_jsxs("div", { className: "flex min-w-0 flex-1 basis-64 items-center", children: [title, _jsx(CardTitle, { children: _jsx("h2", { children: heading }) })] })) : (_jsxs("div", { className: cn("flex min-w-0 flex-1 items-center gap-4", actions?.menu && !actions.secondary && !actions.primary ? "basis-0" : "basis-64"), children: [_jsx(IdentityMark, { ...mark, size: 64 }), _jsxs("div", { className: "grid min-w-0 gap-1", children: [_jsx(CardTitle, { className: "group-data-[size=sm]/card:text-heading-sm", children: title }), description ? _jsx(CardDescription, { children: description }) : null] })] })), actions ? _jsx(CardActionsRow, { ...actions }) : null] }), facts ? (_jsx(CardContent, { className: cn("@container/object-page-body grid min-w-0 gap-x-6 gap-y-5", picture && "py-(--card-spacing)"), children: _jsxs("div", { className: cn("grid min-w-0 gap-6", picture && "@3xl/object-page-body:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]"), children: [picture ? (_jsx("div", { className: "flex min-w-0 flex-col *:flex-1", "data-slot": "object-page-picture", children: picture })) : null, _jsx("div", { className: "@container/object-page-facts grid min-w-0 content-start gap-4", children: _jsx("dl", { className: cn("grid min-w-0 grid-flow-row-dense grid-cols-2 gap-x-6 gap-y-5", picture
|
|
31
31
|
? "@lg/object-page-facts:grid-cols-3"
|
|
32
32
|
: "@xl/object-page-facts:grid-cols-4"), "data-slot": "object-page-facts", children: facts.map((fact) => (_jsxs("div", { className: cn("grid min-w-0 content-start gap-1", fact.wide && "col-span-2"), children: [_jsx("dt", { className: "text-label-sm text-muted-foreground", children: fact.label }), _jsx("dd", { className: cn("min-w-0 text-body-sm wrap-break-word text-foreground", fact.icon && "flex items-start gap-2"), children: fact.icon ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "flex h-5 shrink-0 items-center text-muted-foreground [&>svg]:size-4", children: fact.icon }), _jsx("span", { className: "min-w-0", children: fact.url ? (_jsx(UrlValue, { href: fact.href, url: fact.value })) : (fact.value) })] })) : fact.url ? (_jsx(UrlValue, { href: fact.href, url: fact.value })) : (fact.value) })] }, fact.label))) }) })] }) })) : null, figures ? (_jsx("div", { className: cn("-mb-(--card-spacing) min-w-0 px-(--card-spacing)", facts ? "border-t" : "-mt-(--card-spacing)"), "data-slot": "object-page-figures", children: figures })) : null, entries && entries.length > 0 ? (_jsx("div", { className: "@container/object-page-entries min-w-0", "data-slot": "object-page-entries", children: _jsx(Accordion, { className: "*:last:border-b-0", defaultValue: entries
|
|
33
33
|
.filter((entry) => entry.defaultOpen)
|
|
@@ -32,7 +32,7 @@ function BackLink({ label, link }) {
|
|
|
32
32
|
*/
|
|
33
33
|
export function ObjectSection({ title, status, description, actions, back, footer, children, headingLevel = 2, cardSize = "default", }) {
|
|
34
34
|
const loneMeta = Boolean(actions?.meta) && !hasCardActions({ ...actions, meta: undefined });
|
|
35
|
-
const header = (_jsxs(CardHeader, { className: status ? "[&_[data-slot=card-actions-meta]]:text-caption" : undefined, narrowAction: status && loneMeta ? "title-row" : undefined, children: [status ? (_jsxs(CardTitle, { className: "flex flex-wrap items-center gap-2 font-medium", children: [_jsx("span", { role: "heading", "aria-level": headingLevel, children: title }), status] })) : (_jsx(CardTitle, { role: "heading", "aria-level": headingLevel, children: title })), _jsx(CardDescription, { children: description }), actions ? (_jsx(CardAction, { children: _jsx(CardActionsRow, { ...actions }) })) : null] }));
|
|
35
|
+
const header = (_jsxs(CardHeader, { className: status ? "[&_[data-slot=card-actions-meta]]:text-caption" : undefined, narrowAction: status && loneMeta ? "title-row" : undefined, children: [status ? (_jsxs(CardTitle, { className: "flex flex-wrap items-center gap-2 font-medium", children: [_jsx("span", { className: "min-w-0", role: "heading", "aria-level": headingLevel, children: title }), status] })) : (_jsx(CardTitle, { role: "heading", "aria-level": headingLevel, children: title })), _jsx(CardDescription, { children: description }), actions ? (_jsx(CardAction, { children: _jsx(CardActionsRow, { ...actions }) })) : null] }));
|
|
36
36
|
return (_jsxs(Card, { "data-slot": "object-section", size: cardSize, children: [back ? (_jsxs("div", { className: "grid min-w-0 gap-2", children: [_jsx("div", { className: "px-(--card-spacing)", children: _jsx(BackLink, { ...back }) }), header] })) : (header), _jsx(CardContent, { children: children }), footer ? (_jsx(FooterStrip, { hint: footer.hint, hintSlot: "object-section-hint", children: footer.command ? (_jsx(PageCommandButton, { command: footer.command, variant: footer.command.link ? "outline" : "default" })) : null })) : null] }));
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -53,7 +53,7 @@ export type PlanCardProps = Omit<ComponentProps<"section">, "title" | "children"
|
|
|
53
53
|
* @family Compositions
|
|
54
54
|
* @when The plans a person compares and chooses from: the Portal's plan catalogue in Billing, a Partner's plans above its Customers' (nadicode decision).
|
|
55
55
|
* @instead The plan an account holds now is a fact of its billing, in an `ObjectSection` or a `SettingsFactsSection`. A thing added from a catalogue with no price is a `CatalogCard` or a `CatalogEntry`. A row of these cards is a `CardRow`.
|
|
56
|
-
* @behaviour A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
56
|
+
* @behaviour A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled, its `disabledReason` written under it as one muted line, since a disabled command's reason is never only behind hover (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
57
57
|
* @words The name as the plan is called everywhere. A badge is one word: "Current", "Next", "Recommended". The allowance's label says the use in words ("Three times the usage of Pro", "Usage included"); the price is the amount, the period "/month", the note what the price leaves out ("VAT excluded"). The action is a verb on the plan ("Subscribe", "Change plan"), or the line that says why there is none ("Your current plan").
|
|
58
58
|
* @access A `section` labelled by the plan's name, a heading at `headingLevel`. The picture and the allowance's figure are hidden from assistive technology, which reads the name and the label instead. The inclusions are a list.
|
|
59
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-card.d.ts","sourceRoot":"","sources":["../../src/components/plan-card.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAC;AAGtF,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,gCAAgC,CAAC;AAGrF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mHAAmH;IACnH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kB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nB,2GAA2G;IAC3G,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,sCAAsC;IACtC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IAC5C,2GAA2G;IAC3G,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC;IACrE,4HAA4H;IAC5H,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,YAAgB,EAChB,OAAO,EACP,MAAM,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,+BA+Ef"}
|
|
@@ -11,7 +11,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "./card.js";
|
|
|
11
11
|
* @family Compositions
|
|
12
12
|
* @when The plans a person compares and chooses from: the Portal's plan catalogue in Billing, a Partner's plans above its Customers' (nadicode decision).
|
|
13
13
|
* @instead The plan an account holds now is a fact of its billing, in an `ObjectSection` or a `SettingsFactsSection`. A thing added from a catalogue with no price is a `CatalogCard` or a `CatalogEntry`. A row of these cards is a `CardRow`.
|
|
14
|
-
* @behaviour A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
14
|
+
* @behaviour A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled, its `disabledReason` written under it as one muted line, since a disabled command's reason is never only behind hover (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
15
15
|
* @words The name as the plan is called everywhere. A badge is one word: "Current", "Next", "Recommended". The allowance's label says the use in words ("Three times the usage of Pro", "Usage included"); the price is the amount, the period "/month", the note what the price leaves out ("VAT excluded"). The action is a verb on the plan ("Subscribe", "Change plan"), or the line that says why there is none ("Your current plan").
|
|
16
16
|
* @access A `section` labelled by the plan's name, a heading at `headingLevel`. The picture and the allowance's figure are hidden from assistive technology, which reads the name and the label instead. The inclusions are a list.
|
|
17
17
|
*/
|
|
@@ -19,5 +19,5 @@ export function PlanCard({ name, headingLevel = 3, picture, status, description,
|
|
|
19
19
|
const headingId = useId();
|
|
20
20
|
const inclusionsId = useId();
|
|
21
21
|
const Heading = headingLevel === 2 ? "h2" : "h3";
|
|
22
|
-
return (_jsxs(Card, { className: cn("h-full", picture && "pt-0", className), render: _jsx("section", { ...props, "aria-labelledby": headingId, "data-slot": "plan-card" }), children: [picture ? (_jsx("div", { "aria-hidden": "true", className: "*:aspect-square *:h-auto *:w-full *:object-contain", "data-slot": "plan-card-picture", children: picture })) : null, _jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-3", children: [_jsx(CardTitle, { children: _jsx(Heading, { id: headingId, children: name }) }), status ? _jsx("div", { className: "flex flex-wrap justify-end gap-2", children: status }) : null] }), _jsxs(CardContent, { className: "flex flex-1 flex-col gap-4", children: [description ? _jsx("p", { className: "text-body-sm", children: description }) : null, _jsxs("div", { className: "flex flex-col gap-2", "data-slot": "plan-card-allowance", children: [allowance.figure ? (_jsx("p", { "aria-hidden": "true", className: "text-display-lg tabular-nums", children: allowance.figure })) : null, _jsx("p", { className: "text-body-sm text-muted-foreground", children: allowance.label })] }), inclusions && inclusions.items.length > 0 ? (_jsxs("div", { className: "flex flex-col gap-2", "data-slot": "plan-card-inclusions", children: [_jsx("p", { className: "text-caption text-muted-foreground", id: inclusionsId, children: inclusions.label }), _jsx("ul", { "aria-labelledby": inclusionsId, className: "flex flex-col gap-1.5 text-body-sm", children: inclusions.items.map((item) => (_jsxs("li", { className: "flex items-start gap-2", children: [_jsx(Check, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }), item] }, item))) })] })) : null, _jsxs("div", { className: "flex flex-col gap-1", "data-slot": "plan-card-price", children: [_jsxs("p", { className: "text-body-lg font-medium tabular-nums", children: [price.amount, _jsx("span", { className: "text-body-sm text-muted-foreground", children: price.period })] }), price.note ? _jsx("p", { className: "text-caption text-muted-foreground", children: price.note }) : null] }),
|
|
22
|
+
return (_jsxs(Card, { className: cn("h-full", picture && "pt-0", className), render: _jsx("section", { ...props, "aria-labelledby": headingId, "data-slot": "plan-card" }), children: [picture ? (_jsx("div", { "aria-hidden": "true", className: "*:aspect-square *:h-auto *:w-full *:object-contain", "data-slot": "plan-card-picture", children: picture })) : null, _jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-3", children: [_jsx(CardTitle, { children: _jsx(Heading, { id: headingId, children: name }) }), status ? _jsx("div", { className: "flex flex-wrap justify-end gap-2", children: status }) : null] }), _jsxs(CardContent, { className: "flex flex-1 flex-col gap-4", children: [description ? _jsx("p", { className: "text-body-sm", children: description }) : null, _jsxs("div", { className: "flex flex-col gap-2", "data-slot": "plan-card-allowance", children: [allowance.figure ? (_jsx("p", { "aria-hidden": "true", className: "text-display-lg tabular-nums", children: allowance.figure })) : null, _jsx("p", { className: "text-body-sm text-muted-foreground", children: allowance.label })] }), inclusions && inclusions.items.length > 0 ? (_jsxs("div", { className: "flex flex-col gap-2", "data-slot": "plan-card-inclusions", children: [_jsx("p", { className: "text-caption text-muted-foreground", id: inclusionsId, children: inclusions.label }), _jsx("ul", { "aria-labelledby": inclusionsId, className: "flex flex-col gap-1.5 text-body-sm", children: inclusions.items.map((item) => (_jsxs("li", { className: "flex items-start gap-2", children: [_jsx(Check, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }), item] }, item))) })] })) : null, _jsxs("div", { className: "flex flex-col gap-1", "data-slot": "plan-card-price", children: [_jsxs("p", { className: "text-body-lg font-medium tabular-nums", children: [price.amount, _jsx("span", { className: "text-body-sm text-muted-foreground", children: price.period })] }), price.note ? _jsx("p", { className: "text-caption text-muted-foreground", children: price.note }) : null] }), _jsxs("div", { className: "mt-auto border-t pt-4", "data-slot": "plan-card-action", children: [_jsx("div", { className: "flex min-h-control-height items-center", children: action.command ? (_jsx(PageCommandButton, { command: action.command, variant: action.recommended ? "default" : "outline" })) : (_jsx("p", { className: "text-caption text-muted-foreground", children: action.note })) }), action.command?.disabledReason ? (_jsx("p", { className: "mt-2 text-caption text-muted-foreground", children: action.command.disabledReason })) : null] })] })] }));
|
|
23
23
|
}
|
|
@@ -20,7 +20,7 @@ const TONE_WORD_ONLY = "[&_[data-icon]]:sr-only!";
|
|
|
20
20
|
*/
|
|
21
21
|
const Toaster = ({ closeLabel, regionLabel, toneLabels, ...props }) => {
|
|
22
22
|
const { theme = "system" } = useTheme();
|
|
23
|
-
return (_jsx(Sonner, { theme: isThemeMode(theme) ? theme : "system", className: "toaster group", closeButton: true, containerAriaLabel: regionLabel, duration: TOAST_DURATION_MS, richColors: true, icons: {
|
|
23
|
+
return (_jsx(Sonner, { theme: isThemeMode(theme) ? theme : "system", className: "toaster group font-sans!", closeButton: true, containerAriaLabel: regionLabel, duration: TOAST_DURATION_MS, richColors: true, icons: {
|
|
24
24
|
success: _jsx("span", { children: toneLabels.success }),
|
|
25
25
|
info: _jsx("span", { children: toneLabels.info }),
|
|
26
26
|
warning: _jsx("span", { children: toneLabels.warning }),
|
|
@@ -296,7 +296,7 @@ export const USAGE = [
|
|
|
296
296
|
summary: "One plan a person can choose, in a row of plans: its emblem, name, use, what comes with it, its price and the command that chooses it.",
|
|
297
297
|
when: "The plans a person compares and chooses from: the Portal's plan catalogue in Billing, a Partner's plans above its Customers' (nadicode decision).",
|
|
298
298
|
instead: "The plan an account holds now is a fact of its billing, in an `ObjectSection` or a `SettingsFactsSection`. A thing added from a catalogue with no price is a `CatalogCard` or a `CatalogEntry`. A row of these cards is a `CardRow`.",
|
|
299
|
-
behaviour: "A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).",
|
|
299
|
+
behaviour: "A resting card. The `picture` fills its width at the top, square, the card's corner clipping it; then the name, with the `status` badges at its trailing edge; then the `description`, the allowance's `figure` large over its `label`, the `inclusions` as a list under their label, each item after a muted check mark, and the price with its period beside it and its `note` under it. The `action` stands at the card's foot under a divider, so the actions of a row of cards line up whatever each plan holds: its `command` as an outline button, filled when `recommended`, for the plan the catalogue recommends to a person choosing their first, or its `note` as one muted line. The card draws the command itself, a link staying a link and a submit of the product's form staying its submit; one that cannot run now stays, disabled, its `disabledReason` written under it as one muted line, since a disabled command's reason is never only behind hover (nadicode decision). Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).",
|
|
300
300
|
words: 'The name as the plan is called everywhere. A badge is one word: "Current", "Next", "Recommended". The allowance\'s label says the use in words ("Three times the usage of Pro", "Usage included"); the price is the amount, the period "/month", the note what the price leaves out ("VAT excluded"). The action is a verb on the plan ("Subscribe", "Change plan"), or the line that says why there is none ("Your current plan").',
|
|
301
301
|
access: "A `section` labelled by the plan's name, a heading at `headingLevel`. The picture and the allowance's figure are hidden from assistive technology, which reads the name and the label instead. The inclusions are a list.",
|
|
302
302
|
},
|
|
@@ -1352,7 +1352,7 @@ export const USAGE = [
|
|
|
1352
1352
|
summary: "The surface of every card; on its own only a container inside a composition.",
|
|
1353
1353
|
when: '"For in-product cards and dashboard tiles, use `Card`; Book is too decorative for repeated UI rows." (https://vercel.com/geist/book) Ours: only inside a composition that owns the job: the object card of an `ObjectPage`, the setting card of a `SettingsSection`, a KPI, a chart, a table. A new kind of card is a new composition, never a `Card` assembled at a call site, and never a card holding only an introduction.',
|
|
1354
1354
|
instead: "\"Groups related form controls inside a bordered card with optional footer actions.\" (https://vercel.com/geist/fieldset) Ours: that card, a title and description, one control and a footer with help at the start and one action at the end, is `SettingsSection`. An object's card (a header bar with its name and commands, a body of facts, rows that open, a footer hint with one link elsewhere) is `ObjectPage`. The page's title row is never in a card. A row of a list is `Item`. A plane of brand colour is `BrandField`.",
|
|
1355
|
-
behaviour: '"One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title\'s right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title\'s longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header\'s own width, not the viewport\'s); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card\'s edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section\'s action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card\'s header holds the object\'s commands and its footer only a link, so it never saves; a setting card\'s header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card\'s or a section\'s title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section\'s `tone`. `flush="bottom"` ends the card at its last child, for rows whose hairlines run to its bottom edge, as a footer does; `flush="all"` lets the content meet every edge with no gap between children, for one picture or grid that fills the card.',
|
|
1355
|
+
behaviour: '"One Note per concept." (https://vercel.com/geist/note) "Stacking three Notes on a card means the page architecture, not the Note copy, is wrong." (https://vercel.com/geist/note) "Use the Error component as a block surface when a section or page-level resource failed to load: a panel, a dashboard card, a route boundary." (https://vercel.com/geist/error) Ours: the corner and shadow come with `surface`: a raised card takes the larger corner. Never set a corner at the call site. `surface` defaults to `resting`, the resting height of "Elevation & Depth" in DESIGN.md. `CardHeader` lays out title, description and one `CardAction`. A `CardTitle` wraps inside the card, breaking a word longer than its width, such as a long name, so no title runs past the card\'s edge. An action of one control (a button, a badge, a sparkline, the three dots) stands at the title\'s right; on a card narrower than 28rem, as on a phone, the description runs under both, and the control moves under the title only when the title\'s longest word would not fit beside it, so it never covers it. An action of several controls moves under the description in a header narrower than 28rem (the header\'s own width, not the viewport\'s); `CardFooter` is a strip in the `recessed` role, one tone off the card body inside the card\'s edge, behind one seam in the border colour: `canvas-soft` below the white card in light, and `dark-canvas` below the resting body in dark; on the left one short muted line, only where it says something specific to that card (a limit such as *Please use 32 characters at maximum.*, what a value is for, the plan a feature needs or a link to learn more) and never one sentence every card repeats, on the right at most one button or link, the section\'s action. It is 56 px high whether or not it holds a button, and as high as its lines in a `size="sm"` card, the compact card of a side column or a figure. The two kinds differ in what their header and footer hold: an object card\'s header holds the object\'s commands and its footer only a link, so it never saves; a setting card\'s header holds a title, a description and its `actions` or `control`, and its footer holds the Save, which also applies a switch in the card (`SettingsSection`). A card\'s or a section\'s title carries no icon, unless the card stands for one external system, whose mark it then carries. A card is neutral; colour enters only through a status inside it or a section\'s `tone`. `flush="bottom"` ends the card at its last child, for rows whose hairlines run to its bottom edge, as a footer does; `flush="all"` lets the content meet every edge with no gap between children, for one picture or grid that fills the card.',
|
|
1356
1356
|
words: "The title is a noun phrase naming what the card holds; the description one sentence directly under it, only when it adds something.",
|
|
1357
1357
|
access: "A plain container; give it `render={<section />}` with a heading when it is a region of the page.",
|
|
1358
1358
|
},
|
|
@@ -1429,7 +1429,7 @@ export const USAGE = [
|
|
|
1429
1429
|
summary: "One thing that happened, told in one sentence: a row of a feed, or a line between the messages of a conversation.",
|
|
1430
1430
|
when: 'Something that happened, read in passing: each row of an `ActivityFeed` (`layout="feed"`, which the feed draws), and, in an Agent\'s chat in Nadia, what happened between the messages that needs no answer from the person (`layout="conversation"`): background work finished or failed, an Assignment handed back, a scheduled task ran, the model changed, earlier messages summarized.',
|
|
1431
1431
|
instead: "A failure the person must act on before the conversation can go on is a `MessageNotice`; the steps of one Agent run, read in order, are a `RunTimeline`; a line inside a reply that opens to a tool call's detail is a `DisclosureRow`; a record's whole history is an `ActivityFeed`.",
|
|
1432
|
-
behaviour: "A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.",
|
|
1432
|
+
behaviour: "A row is the actor's 24 px mark, the sentence, a status badge only for an exception, one muted line of detail and the time of day in tabular figures; the sentence wraps pretty, and a status badge that wraps starts its own line at the sentence's edge, with UTC and the viewer's zone in its hover card. The mark is a person's initials or an Agent's orb, the Agent Nadia's included; the system's own work, such as background work or the app changing the model, has none, and its cell stays empty so the sentences line up. `feed`: the time leads in its own column inside the feed's card and moves under the sentence below 900 px. `conversation`: no card; the time trails at the right, the detail is one line cut with an ellipsis, and the object's link is underlined in the line colour. Only a `conversation` row opens (nadicode decision): given `opens`, the whole row toggles a resting card under the sentence, set in to the words and ending where the time ends, holding its body with its line breaks kept and at most two outline small buttons. A row that opens always shows its 12 px chevron right after the words, on the line of the last word, pointing right while closed and turned down while open; hover and focus only turn the words to the foreground colour. A row without `opens` draws no chevron and does nothing when pressed. The object's link and the time stay above the row's toggle: pressing the link goes to the object and never opens the row. The row holds whether it is open; `defaultOpen` sets how it starts.",
|
|
1433
1433
|
words: 'The sentence names the actor in `<strong>`, the action in the past tense and the object as a link in the text\'s colour: "Bruno replied to Marta", "Marta finished the Assignment Q4 price list". Done is the past tense, never a badge; a status is an exception\'s word only, the word the object\'s own page shows for that state: Failed, Needs you, Checking, Not run. A failure says so in the sentence too. The detail is one short line, such as the first words of a reply or a result. `opens.label` is the sentence in plain words; a button names what it does to the object: "Open the conversation".',
|
|
1434
1434
|
access: "In a feed each row is an item of its day's list. A row that opens is one `button` over the whole row, named by `opens.label`, with `aria-expanded` and, while open, `aria-controls` naming the card; the object's link comes before it in the tab order and the card's buttons after it. The mark and the chevron are hidden; the time is a `<time>` with its exact moment for assistive technology.",
|
|
1435
1435
|
},
|
|
@@ -161,6 +161,17 @@
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
/* An inline mark that follows a sentence, such as EventRow's chevron, stays on the line of the sentence's last word,
|
|
165
|
+
with no character added to the text: the word joiner forbids a break before it, and nowrap forbids the break a
|
|
166
|
+
browser allows between that joiner and an icon. */
|
|
167
|
+
@utility nc-after-word {
|
|
168
|
+
white-space: nowrap;
|
|
169
|
+
|
|
170
|
+
&::before {
|
|
171
|
+
content: "\2060";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
164
175
|
/* A list that scrolls under its own fade or edge, such as Command's and Combobox's, draws no scrollbar. */
|
|
165
176
|
@utility no-scrollbar {
|
|
166
177
|
scrollbar-width: none;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.245",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#jsx": "./src/jsx/index.ts",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@headless-tree/react": "1.8.0",
|
|
83
83
|
"@iconify-icons/logos": "^2.0.3",
|
|
84
84
|
"@iconify/react": "^6.0.2",
|
|
85
|
-
"@nadicodeai/design-system": "12.1.
|
|
85
|
+
"@nadicodeai/design-system": "12.1.245",
|
|
86
86
|
"@tanstack/react-table": "^9.3.1",
|
|
87
87
|
"@vgpu/wgsl": "0.6.0",
|
|
88
88
|
"class-variance-authority": "^0.7.1",
|