@nadicodeai/ui 12.1.210 → 12.1.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +11 -4
- package/dist/components/account-menu.d.ts +3 -3
- package/dist/components/account-menu.d.ts.map +1 -1
- package/dist/components/account-menu.js +7 -5
- package/dist/components/activity-feed.d.ts +4 -2
- package/dist/components/activity-feed.d.ts.map +1 -1
- package/dist/components/activity-feed.js +10 -3
- package/dist/components/board.d.ts +45 -0
- package/dist/components/board.d.ts.map +1 -0
- package/dist/components/board.js +35 -0
- package/dist/components/breadcrumb.d.ts +3 -3
- package/dist/components/breadcrumb.d.ts.map +1 -1
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +5 -2
- package/dist/components/card-row.js +1 -1
- package/dist/components/chart-card.d.ts +19 -6
- package/dist/components/chart-card.d.ts.map +1 -1
- package/dist/components/chart-card.js +17 -7
- package/dist/components/collection-page.d.ts +4 -4
- package/dist/components/collection-page.d.ts.map +1 -1
- package/dist/components/collection-page.js +4 -8
- package/dist/components/collection-toolbar.d.ts +5 -4
- package/dist/components/collection-toolbar.d.ts.map +1 -1
- package/dist/components/collection-toolbar.js +9 -5
- package/dist/components/column-foot.d.ts +53 -0
- package/dist/components/column-foot.d.ts.map +1 -0
- package/dist/components/column-foot.js +32 -0
- package/dist/components/conversation-card.d.ts +38 -0
- package/dist/components/conversation-card.d.ts.map +1 -0
- package/dist/components/conversation-card.js +19 -0
- package/dist/components/data-table.d.ts +27 -22
- package/dist/components/data-table.d.ts.map +1 -1
- package/dist/components/data-table.js +76 -25
- package/dist/components/entry-page.d.ts +55 -0
- package/dist/components/entry-page.d.ts.map +1 -0
- package/dist/components/entry-page.js +41 -0
- package/dist/components/entry-scene.d.ts +1 -1
- package/dist/components/entry-scene.js +1 -1
- package/dist/components/filter-toolbar.d.ts +43 -0
- package/dist/components/filter-toolbar.d.ts.map +1 -0
- package/dist/components/filter-toolbar.js +44 -0
- package/dist/components/hive-scene.d.ts +4 -1
- package/dist/components/hive-scene.d.ts.map +1 -1
- package/dist/components/hive-scene.js +6 -1
- package/dist/components/invite-card.js +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kpi-card.d.ts +10 -3
- package/dist/components/kpi-card.d.ts.map +1 -1
- package/dist/components/kpi-card.js +12 -4
- package/dist/components/message-notice.d.ts +3 -3
- package/dist/components/message-notice.js +1 -1
- package/dist/components/notice-banner.d.ts +1 -1
- package/dist/components/notice-banner.js +1 -1
- package/dist/components/object-page.d.ts +8 -2
- package/dist/components/object-page.d.ts.map +1 -1
- package/dist/components/object-page.js +7 -2
- package/dist/components/object-workspace.d.ts +25 -5
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +30 -7
- package/dist/components/page-actions.d.ts +0 -2
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +1 -5
- package/dist/components/page-frame.d.ts +38 -0
- package/dist/components/page-frame.d.ts.map +1 -0
- package/dist/components/page-frame.js +29 -0
- package/dist/components/page-header.d.ts +4 -3
- package/dist/components/page-header.d.ts.map +1 -1
- package/dist/components/page-header.js +5 -4
- package/dist/components/pending-label.d.ts +1 -1
- package/dist/components/pending-label.d.ts.map +1 -1
- package/dist/components/pending-label.js +4 -6
- package/dist/components/place-count.d.ts +20 -0
- package/dist/components/place-count.d.ts.map +1 -0
- package/dist/components/place-count.js +16 -0
- package/dist/components/plan-card.d.ts +49 -0
- package/dist/components/plan-card.d.ts.map +1 -0
- package/dist/components/plan-card.js +22 -0
- package/dist/components/product-band.d.ts +20 -0
- package/dist/components/product-band.d.ts.map +1 -0
- package/dist/components/product-band.js +23 -0
- package/dist/components/product-shell.d.ts +316 -44
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +533 -36
- package/dist/components/reading-column.d.ts +1 -1
- package/dist/components/reading-column.js +1 -1
- package/dist/components/record-list.d.ts +19 -3
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +23 -8
- package/dist/components/record-time.d.ts +6 -2
- package/dist/components/record-time.d.ts.map +1 -1
- package/dist/components/record-time.js +8 -5
- package/dist/components/row-edit-form.d.ts +1 -1
- package/dist/components/row-edit-form.js +1 -1
- package/dist/components/scope-switcher.d.ts +3 -1
- package/dist/components/scope-switcher.d.ts.map +1 -1
- package/dist/components/scope-switcher.js +3 -6
- package/dist/components/settings-page.d.ts +3 -3
- package/dist/components/settings-page.js +3 -3
- package/dist/components/settings-section.d.ts +19 -5
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +14 -6
- package/dist/components/sidebar-sections.d.ts.map +1 -1
- package/dist/components/sidebar-sections.js +4 -4
- package/dist/components/sidebar.d.ts +27 -5
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +56 -24
- package/dist/components/table-card.d.ts.map +1 -1
- package/dist/components/table-card.js +2 -1
- package/dist/components/table-layouts.d.ts +27 -0
- package/dist/components/table-layouts.d.ts.map +1 -1
- package/dist/components/table-layouts.js +30 -0
- package/dist/components/toast.d.ts +10 -1
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +24 -1
- package/dist/components/update-card.js +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/internal/button-classes.d.ts +2 -0
- package/dist/internal/button-classes.d.ts.map +1 -1
- package/dist/internal/button-classes.js +54 -46
- package/dist/internal/card-actions.d.ts +3 -0
- package/dist/internal/card-actions.d.ts.map +1 -0
- package/dist/internal/card-actions.js +4 -0
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +3 -1
- package/dist/internal/table-compact-line.d.ts +1 -7
- package/dist/internal/table-compact-line.d.ts.map +1 -1
- package/dist/internal/table-compact-line.js +5 -11
- package/dist/lib/product-shell.d.ts +20 -0
- package/dist/lib/product-shell.d.ts.map +1 -0
- package/dist/lib/product-shell.js +19 -0
- package/dist/showcase/specimens/compositions.d.ts +15 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +70 -0
- package/dist/showcase/specimens/index.d.ts +11 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.d.ts +4 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.js +26 -1
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +166 -45
- package/dist/styles/components.css +38 -0
- package/dist/styles/globals.css +0 -5
- package/package.json +6 -2
|
@@ -13,8 +13,9 @@ import { PageActionsSlot } from "./page-actions.js";
|
|
|
13
13
|
* it is the top bar's `Breadcrumb`; filters, search and sort sit in the toolbar below.
|
|
14
14
|
* @behaviour The header stands in the page's own column, so the title and the page's cards share one
|
|
15
15
|
* left edge. The title is always there and the actions arrive through the `PageActions` slot, so
|
|
16
|
-
* the page draws its commands once.
|
|
17
|
-
*
|
|
16
|
+
* the page draws its commands once. The title wraps between words and is never cut. On a header
|
|
17
|
+
* narrower than 576 px, a phone's or a narrow window's, the actions leave the title's row and stand
|
|
18
|
+
* as one row under the title and the description, on their left edge. Under the title sits the `description`: one muted line
|
|
18
19
|
* saying what the page's concept is, on every page that is a destination or a section, as every Vercel
|
|
19
20
|
* page does. It ends in a link to learn more when there is one, and never counts or introduces anything
|
|
20
21
|
* else. It is the page's only explanation: no other line introduces, explains or counts the page, and
|
|
@@ -25,12 +26,12 @@ import { PageActionsSlot } from "./page-actions.js";
|
|
|
25
26
|
* object worked from a section sidebar, the title is the section's name: *Apps*. The description is
|
|
26
27
|
* one sentence in the product's words, saying what the page's concept does and where it applies,
|
|
27
28
|
* without a full stop when it ends in a link.
|
|
28
|
-
* @access The title is the page's `h1
|
|
29
|
+
* @access The title is the page's `h1`, read before its description and then the actions; DOM order is the narrow header's visual order, and a wider one sets the actions at the title row's end.
|
|
29
30
|
*/
|
|
30
31
|
function PageHeader({ title, description, headingProps, className, unseen = false, ...props }) {
|
|
31
32
|
if (unseen) {
|
|
32
33
|
return (_jsx("h1", { ...headingProps, className: cn("sr-only", headingProps?.className), children: title }));
|
|
33
34
|
}
|
|
34
|
-
return (
|
|
35
|
+
return (_jsx("header", { "data-slot": "page-header", className: cn("@container/page-header min-w-0", className), ...props, children: _jsxs("div", { className: "grid min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(2.25rem,auto)] items-center @xl/page-header:grid-cols-[minmax(0,1fr)_auto] *:data-[slot=page-header-actions]:mt-3 @xl/page-header:*:data-[slot=page-header-actions]:col-start-2 @xl/page-header:*:data-[slot=page-header-actions]:row-start-1 @xl/page-header:*:data-[slot=page-header-actions]:ms-6 @xl/page-header:*:data-[slot=page-header-actions]:mt-0", children: [_jsx("h1", { ...headingProps, className: cn("col-start-1 row-start-1 min-w-0 text-heading-md text-foreground wrap-break-word outline-none", headingProps?.className), children: title }), description ? (_jsx("div", { "data-slot": "page-header-description", className: "mt-1 min-w-0 text-body-sm text-muted-foreground @xl/page-header:col-span-2 @xl/page-header:row-start-2", children: description })) : null, _jsx(PageActionsSlot, {})] }) }));
|
|
35
36
|
}
|
|
36
37
|
export { PageHeader };
|
|
@@ -8,7 +8,7 @@ import type * as React from "react";
|
|
|
8
8
|
* `loading` and `loadingLabel` draw it.
|
|
9
9
|
* @instead Past a second add one `WaitingLine` beside the control. An Agent's work is never this:
|
|
10
10
|
* it is her orb and a sentence. A queued or paused request is a status.
|
|
11
|
-
* @behaviour Swaps the word, nothing else: same place, size and icon
|
|
11
|
+
* @behaviour Swaps the word, nothing else: same place, size and icon. At rest a text label is as wide as its own word, so a button's icon and label stand together at the button's own width; while pending it keeps at least that width, so the control never shrinks under the press. The caller sets `aria-busy`
|
|
12
12
|
* and blocks a second press, because only the caller knows which element the wait belongs to.
|
|
13
13
|
* Failure returns the rest label.
|
|
14
14
|
* @words The rest label's verb in its -ing form with the same noun: *Remove mailbox* to *Removing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pending-label.d.ts","sourceRoot":"","sources":["../../src/components/pending-label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,
|
|
1
|
+
{"version":3,"file":"pending-label.d.ts","sourceRoot":"","sources":["../../src/components/pending-label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC;;;;;;;;;;;;;;;;GAgBG;AACH,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,SAAS,EACT,OAAO,EACP,YAAY,EACZ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,qBAoBA;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { cn } from "../lib/utils.js";
|
|
|
9
9
|
* `loading` and `loadingLabel` draw it.
|
|
10
10
|
* @instead Past a second add one `WaitingLine` beside the control. An Agent's work is never this:
|
|
11
11
|
* it is her orb and a sentence. A queued or paused request is a status.
|
|
12
|
-
* @behaviour Swaps the word, nothing else: same place, size and icon
|
|
12
|
+
* @behaviour Swaps the word, nothing else: same place, size and icon. At rest a text label is as wide as its own word, so a button's icon and label stand together at the button's own width; while pending it keeps at least that width, so the control never shrinks under the press. The caller sets `aria-busy`
|
|
13
13
|
* and blocks a second press, because only the caller knows which element the wait belongs to.
|
|
14
14
|
* Failure returns the rest label.
|
|
15
15
|
* @words The rest label's verb in its -ing form with the same noun: *Remove mailbox* to *Removing
|
|
@@ -18,11 +18,9 @@ import { cn } from "../lib/utils.js";
|
|
|
18
18
|
* stays on it.
|
|
19
19
|
*/
|
|
20
20
|
function PendingLabel({ children, className, pending, pendingLabel, ...props }) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const words = typeof children === "string" && typeof pendingLabel === "string";
|
|
25
|
-
const reserved = words ? (pending ? children : pendingLabel) : undefined;
|
|
21
|
+
const reserved = pending && typeof children === "string" && typeof pendingLabel === "string"
|
|
22
|
+
? children
|
|
23
|
+
: undefined;
|
|
26
24
|
return (_jsx("span", { ...props, className: cn(className, reserved !== undefined &&
|
|
27
25
|
"inline-grid gap-0 after:invisible after:h-0 after:overflow-hidden after:content-[attr(data-reserved)]"), "data-pending": pending || undefined, "data-reserved": reserved, "data-slot": "pending-label", children: pending ? pendingLabel : children }));
|
|
28
26
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { SidebarMenuBadge } from "./sidebar.js";
|
|
3
|
+
export type PlaceCountProps = Omit<React.ComponentProps<typeof SidebarMenuBadge>, "children"> & {
|
|
4
|
+
/** How many things wait at the row's place. */
|
|
5
|
+
count: number;
|
|
6
|
+
/** What a screen reader hears after the figure, such as "unread messages". */
|
|
7
|
+
spoken?: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The count at the end of a column's row: how many things wait at that place.
|
|
11
|
+
*
|
|
12
|
+
* @family Navigation
|
|
13
|
+
* @when The end of a place's row in a column, which `ProductShell` draws from a place's `badge` and a column the product does not draw, such as Alveare's carried Buzz sidebar, mounts for its unread counts.
|
|
14
|
+
* @instead A count anywhere else is a `Badge`; a product never draws `SidebarMenuBadge` itself.
|
|
15
|
+
* @behaviour Plain figures in the column's ink, or with `tone` `attention` a filled circle in the attention colour for a count that needs the person, as `ProductShell` draws a place's badge. Above 99 it reads 99+. Hidden while the column shows icons alone.
|
|
16
|
+
* @words A figure; `spoken` names what is counted for a screen reader.
|
|
17
|
+
* @access The figure is read with its row; `spoken` follows it for a screen reader only.
|
|
18
|
+
*/
|
|
19
|
+
export declare function PlaceCount({ count, spoken, ...props }: PlaceCountProps): React.JSX.Element;
|
|
20
|
+
//# sourceMappingURL=place-count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"place-count.d.ts","sourceRoot":"","sources":["../../src/components/place-count.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,EAAE,UAAU,CAAC,GAAG;IAC9F,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,qBAOtE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SidebarMenuBadge } from "./sidebar.js";
|
|
3
|
+
const MOST_SHOWN = 99;
|
|
4
|
+
/**
|
|
5
|
+
* The count at the end of a column's row: how many things wait at that place.
|
|
6
|
+
*
|
|
7
|
+
* @family Navigation
|
|
8
|
+
* @when The end of a place's row in a column, which `ProductShell` draws from a place's `badge` and a column the product does not draw, such as Alveare's carried Buzz sidebar, mounts for its unread counts.
|
|
9
|
+
* @instead A count anywhere else is a `Badge`; a product never draws `SidebarMenuBadge` itself.
|
|
10
|
+
* @behaviour Plain figures in the column's ink, or with `tone` `attention` a filled circle in the attention colour for a count that needs the person, as `ProductShell` draws a place's badge. Above 99 it reads 99+. Hidden while the column shows icons alone.
|
|
11
|
+
* @words A figure; `spoken` names what is counted for a screen reader.
|
|
12
|
+
* @access The figure is read with its row; `spoken` follows it for a screen reader only.
|
|
13
|
+
*/
|
|
14
|
+
export function PlaceCount({ count, spoken, ...props }) {
|
|
15
|
+
return (_jsxs(SidebarMenuBadge, { ...props, children: [count > MOST_SHOWN ? `${MOST_SHOWN}+` : count, spoken ? _jsxs("span", { className: "sr-only", children: [" ", spoken] }) : null] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
export type PlanCardAllowance = {
|
|
3
|
+
/** The use the plan includes against the smallest one, as a figure: "3×". Left out when the plan includes none. */
|
|
4
|
+
figure?: string | undefined;
|
|
5
|
+
/** The same in words, which a screen reader reads: "Three times the usage of Pro". */
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export type PlanCardInclusions = {
|
|
9
|
+
/** What the list is: "Also included". */
|
|
10
|
+
label: string;
|
|
11
|
+
items: readonly string[];
|
|
12
|
+
};
|
|
13
|
+
export type PlanCardProps = Omit<ComponentProps<"section">, "title" | "children"> & {
|
|
14
|
+
/** The plan's name: "Business". */
|
|
15
|
+
name: string;
|
|
16
|
+
/** The name's heading level: 3 under the catalogue's own heading, 2 where nothing titles the plans. */
|
|
17
|
+
headingLevel?: 2 | 3;
|
|
18
|
+
/** The plan's emblem across the top of the card: the product's image element. Decorative: the name says which plan it is. */
|
|
19
|
+
picture?: ReactElement | undefined;
|
|
20
|
+
/** The plan's standing for this viewer at the name's trailing edge: Current, Next, Recommended, each a `Badge`. */
|
|
21
|
+
status?: ReactNode;
|
|
22
|
+
/** One line under the name, for a plan whose audience needs saying: "For Partners who resell nadicode". */
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
/** How much use the plan includes. */
|
|
25
|
+
allowance: PlanCardAllowance;
|
|
26
|
+
/** What comes with the plan beyond its use, each item after a check mark. */
|
|
27
|
+
inclusions?: PlanCardInclusions | undefined;
|
|
28
|
+
/** The price as it reads, its period beside it, and the line under it: "€49", "/month", "VAT excluded". */
|
|
29
|
+
price: {
|
|
30
|
+
amount: string;
|
|
31
|
+
period: string;
|
|
32
|
+
note?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
/** At the card's foot under a divider: the command that chooses the plan, or the line that says why it cannot be chosen. */
|
|
35
|
+
action: ReactNode;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* One plan a person can choose, in a row of plans: its emblem, name, use, what comes with it, its
|
|
39
|
+
* price and the command that chooses it.
|
|
40
|
+
*
|
|
41
|
+
* @family Compositions
|
|
42
|
+
* @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).
|
|
43
|
+
* @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`.
|
|
44
|
+
* @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. Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
45
|
+
* @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").
|
|
46
|
+
* @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.
|
|
47
|
+
*/
|
|
48
|
+
export declare function PlanCard({ name, headingLevel, picture, status, description, allowance, inclusions, price, action, className, ...props }: PlanCardProps): import("react").JSX.Element;
|
|
49
|
+
//# sourceMappingURL=plan-card.d.ts.map
|
|
@@ -0,0 +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;AAKtF,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,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,SAAS,CAAC;IACnC,mHAAmH;IACnH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,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,SAAS,CAAC;CACnB,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,+BAiEf"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Card, CardContent, CardHeader, CardTitle } from "./card.js";
|
|
6
|
+
/**
|
|
7
|
+
* One plan a person can choose, in a row of plans: its emblem, name, use, what comes with it, its
|
|
8
|
+
* price and the command that chooses it.
|
|
9
|
+
*
|
|
10
|
+
* @family Compositions
|
|
11
|
+
* @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).
|
|
12
|
+
* @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`.
|
|
13
|
+
* @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. Neutral throughout: a plan is told apart by its emblem and its badges, never a coloured card (nadicode decision).
|
|
14
|
+
* @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").
|
|
15
|
+
* @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.
|
|
16
|
+
*/
|
|
17
|
+
export function PlanCard({ name, headingLevel = 3, picture, status, description, allowance, inclusions, price, action, className, ...props }) {
|
|
18
|
+
const headingId = useId();
|
|
19
|
+
const inclusionsId = useId();
|
|
20
|
+
const Heading = headingLevel === 2 ? "h2" : "h3";
|
|
21
|
+
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] }), _jsx("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 }) })] })] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One product a person downloads, as a band: its name, its line and its downloads, beside its picture.
|
|
4
|
+
*
|
|
5
|
+
* @family Compositions
|
|
6
|
+
* @when The Downloads page, one band per product: Nadia, Alveare, Alveare Server, NadiaOS.
|
|
7
|
+
* @instead One file among a product's files is an `Item` row in an `ItemGroup` inside the band; an entry a person adds from a catalogue is a `CatalogCard`; the steps after a download are `NumberedSteps`.
|
|
8
|
+
* @behaviour One resting card. The content stands centred in its height, 24 px in from the card's edges and 24 px between its parts. From a card 57 rem wide the picture stands at the right, a quarter of the card and at most 288 px, its foot on the card's bottom edge; on a narrower card it stands centred under the content, 224 px square. The product's picture fills its square, so the band never jumps when it loads. While the page reads the releases, `ProductBandSkeleton` stands in its place: the same band, the mark's square and the name's and line's bars, the download button's bar, and the picture's square, with no words (nadicode decision).
|
|
9
|
+
* @words None of its own: the product's name, its line and its download labels are the product's, from its catalogue.
|
|
10
|
+
* @access The picture is decorative: hidden from assistive technology and never a target. The content names the band with its own heading. `ProductBandSkeleton` is busy and its bars are hidden from assistive technology.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ProductBand({ picture, children, }: {
|
|
13
|
+
/** The product's picture, an image that fills the square it is given: the product's router image with `fill`. */
|
|
14
|
+
picture: ReactElement;
|
|
15
|
+
/** The product's mark, heading, line and downloads. */
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/** What stands in a ProductBand's place while its page reads the releases, with no words. */
|
|
19
|
+
export declare function ProductBandSkeleton(): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=product-band.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-band.d.ts","sourceRoot":"","sources":["../../src/components/product-band.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAyBrD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,QAAQ,GACT,EAAE;IACD,iHAAiH;IACjH,OAAO,EAAE,YAAY,CAAC;IACtB,uDAAuD;IACvD,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAMA;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,gCAsBlC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Card } from "./card.js";
|
|
3
|
+
import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
4
|
+
function Band({ content, picture }) {
|
|
5
|
+
return (_jsxs("div", { className: "flex flex-col @[57rem]:flex-row @[57rem]:items-stretch", "data-slot": "product-band", children: [_jsx("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-6 p-6 @[57rem]:pr-4", children: content }), _jsx("div", { "aria-hidden": "true", className: "pointer-events-none flex justify-center px-6 pt-2 @[57rem]:w-1/4 @[57rem]:max-w-72 @[57rem]:shrink-0 @[57rem]:items-end @[57rem]:px-0 @[57rem]:pt-6", "data-slot": "product-band-picture", children: _jsx("div", { className: "relative aspect-square w-56 @[57rem]:w-full", children: picture }) })] }));
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* One product a person downloads, as a band: its name, its line and its downloads, beside its picture.
|
|
9
|
+
*
|
|
10
|
+
* @family Compositions
|
|
11
|
+
* @when The Downloads page, one band per product: Nadia, Alveare, Alveare Server, NadiaOS.
|
|
12
|
+
* @instead One file among a product's files is an `Item` row in an `ItemGroup` inside the band; an entry a person adds from a catalogue is a `CatalogCard`; the steps after a download are `NumberedSteps`.
|
|
13
|
+
* @behaviour One resting card. The content stands centred in its height, 24 px in from the card's edges and 24 px between its parts. From a card 57 rem wide the picture stands at the right, a quarter of the card and at most 288 px, its foot on the card's bottom edge; on a narrower card it stands centred under the content, 224 px square. The product's picture fills its square, so the band never jumps when it loads. While the page reads the releases, `ProductBandSkeleton` stands in its place: the same band, the mark's square and the name's and line's bars, the download button's bar, and the picture's square, with no words (nadicode decision).
|
|
14
|
+
* @words None of its own: the product's name, its line and its download labels are the product's, from its catalogue.
|
|
15
|
+
* @access The picture is decorative: hidden from assistive technology and never a target. The content names the band with its own heading. `ProductBandSkeleton` is busy and its bars are hidden from assistive technology.
|
|
16
|
+
*/
|
|
17
|
+
export function ProductBand({ picture, children, }) {
|
|
18
|
+
return (_jsx(Card, { className: "@container gap-0 py-0", children: _jsx(Band, { content: children, picture: picture }) }));
|
|
19
|
+
}
|
|
20
|
+
/** What stands in a ProductBand's place while its page reads the releases, with no words. */
|
|
21
|
+
export function ProductBandSkeleton() {
|
|
22
|
+
return (_jsx(SkeletonRegion, { busy: true, "data-slot": "product-band-skeleton", children: _jsx(Card, { className: "@container gap-0 py-0", children: _jsx(Band, { content: _jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-start gap-4", children: [_jsx(Skeleton, { className: "size-14 shrink-0" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [_jsx(Skeleton, { className: "h-7 w-40 max-w-full" }), _jsx(Skeleton, { className: "h-4 w-full max-w-xl" })] })] }), _jsx(Skeleton, { className: "h-control-height w-52 max-w-full" })] }), picture: _jsx(Skeleton, { className: "size-full" }) }) }) }));
|
|
23
|
+
}
|