@nadicodeai/ui 12.1.243 → 12.1.244
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/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/showcase/usage.generated.js +2 -2
- 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 }));
|
|
@@ -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,kBAAkB,GAAG;IAC/B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,8GAA8G;AAC9G,MAAM,MAAM,cAAc,GACtB;IACE,OAAO,EAAE,WAAW,CAAC;IACrB,sHAAsH;IACtH,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAClF,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uGAAuG;IACvG,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACrB,6HAA6H;IAC7H,OAAO,CAAC,EAAE,YAAY,GAAG,SA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@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
|
}
|
|
@@ -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
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.244",
|
|
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.244",
|
|
86
86
|
"@tanstack/react-table": "^9.3.1",
|
|
87
87
|
"@vgpu/wgsl": "0.6.0",
|
|
88
88
|
"class-variance-authority": "^0.7.1",
|