@nadicodeai/ui 12.1.240 → 12.1.242
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/action-menu.d.ts +5 -1
- package/dist/components/action-menu.d.ts.map +1 -1
- package/dist/components/assistant-panel-header.d.ts +25 -0
- package/dist/components/assistant-panel-header.d.ts.map +1 -0
- package/dist/components/assistant-panel-header.js +18 -0
- package/dist/components/assistant-welcome.d.ts +26 -0
- package/dist/components/assistant-welcome.d.ts.map +1 -0
- package/dist/components/assistant-welcome.js +16 -0
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.d.ts.map +1 -1
- package/dist/components/button.js +6 -1
- package/dist/components/collection-filters.d.ts +6 -3
- package/dist/components/collection-filters.d.ts.map +1 -1
- package/dist/components/collection-filters.js +5 -4
- package/dist/components/column-foot.d.ts +3 -2
- package/dist/components/column-foot.d.ts.map +1 -1
- package/dist/components/column-foot.js +2 -1
- package/dist/components/company-card-actions.d.ts +19 -0
- package/dist/components/company-card-actions.d.ts.map +1 -0
- package/dist/components/company-card-actions.js +16 -0
- package/dist/components/confirm-dialog.d.ts +6 -1
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +17 -3
- package/dist/components/drawer-steps.d.ts +8 -7
- package/dist/components/drawer-steps.d.ts.map +1 -1
- package/dist/components/drawer-steps.js +7 -6
- package/dist/components/figure-row.d.ts +2 -4
- package/dist/components/figure-row.d.ts.map +1 -1
- package/dist/components/figure-row.js +3 -3
- package/dist/components/filter-toolbar.d.ts +2 -4
- package/dist/components/filter-toolbar.d.ts.map +1 -1
- package/dist/components/filter-toolbar.js +2 -2
- package/dist/components/folder-field.d.ts +30 -0
- package/dist/components/folder-field.d.ts.map +1 -0
- package/dist/components/folder-field.js +22 -0
- package/dist/components/form-dialog.d.ts +11 -2
- package/dist/components/form-dialog.d.ts.map +1 -1
- package/dist/components/form-dialog.js +18 -3
- package/dist/components/item.d.ts +5 -9
- package/dist/components/item.d.ts.map +1 -1
- package/dist/components/item.js +5 -9
- package/dist/components/numbered-steps.d.ts +8 -5
- package/dist/components/numbered-steps.d.ts.map +1 -1
- package/dist/components/numbered-steps.js +5 -4
- package/dist/components/object-workspace.d.ts +2 -2
- package/dist/components/object-workspace.d.ts.map +1 -1
- package/dist/components/object-workspace.js +2 -2
- package/dist/components/page-actions.d.ts +5 -5
- package/dist/components/page-actions.d.ts.map +1 -1
- package/dist/components/page-actions.js +9 -4
- package/dist/components/plan-card.d.ts +14 -2
- package/dist/components/plan-card.d.ts.map +1 -1
- package/dist/components/plan-card.js +3 -2
- package/dist/components/product-band.d.ts +19 -7
- package/dist/components/product-band.d.ts.map +1 -1
- package/dist/components/product-band.js +12 -6
- package/dist/components/product-shell-bell.d.ts +71 -0
- package/dist/components/product-shell-bell.d.ts.map +1 -0
- package/dist/components/product-shell-bell.js +36 -0
- package/dist/components/product-shell.d.ts +21 -4
- package/dist/components/product-shell.d.ts.map +1 -1
- package/dist/components/product-shell.js +23 -2
- package/dist/components/record-list.d.ts +4 -2
- package/dist/components/record-list.d.ts.map +1 -1
- package/dist/components/record-list.js +10 -7
- package/dist/components/settings-facts.d.ts +5 -4
- package/dist/components/settings-facts.d.ts.map +1 -1
- package/dist/components/settings-facts.js +4 -3
- package/dist/components/settings-section.d.ts +11 -9
- package/dist/components/settings-section.d.ts.map +1 -1
- package/dist/components/settings-section.js +7 -6
- package/dist/internal/clear-filters.d.ts +7 -0
- package/dist/internal/clear-filters.d.ts.map +1 -0
- package/dist/internal/clear-filters.js +6 -0
- package/dist/internal/command-runner.d.ts +30 -5
- package/dist/internal/command-runner.d.ts.map +1 -1
- package/dist/internal/command-runner.js +61 -14
- package/dist/internal/footer-commands.d.ts +33 -0
- package/dist/internal/footer-commands.d.ts.map +1 -0
- package/dist/internal/footer-commands.js +27 -0
- package/dist/internal/footer-strip.d.ts.map +1 -1
- package/dist/internal/footer-strip.js +2 -4
- package/dist/internal/form-submit.d.ts +3 -2
- package/dist/internal/form-submit.d.ts.map +1 -1
- package/dist/internal/form-submit.js +2 -2
- package/dist/internal/page-command-button.d.ts +11 -1
- package/dist/internal/page-command-button.d.ts.map +1 -1
- package/dist/internal/page-command-button.js +3 -0
- package/dist/showcase/specimens/actions.d.ts +1 -0
- package/dist/showcase/specimens/actions.d.ts.map +1 -1
- package/dist/showcase/specimens/actions.js +12 -1
- package/dist/showcase/specimens/compositions.d.ts +2 -0
- package/dist/showcase/specimens/compositions.d.ts.map +1 -1
- package/dist/showcase/specimens/compositions.js +16 -7
- package/dist/showcase/specimens/data.d.ts.map +1 -1
- package/dist/showcase/specimens/data.js +1 -1
- package/dist/showcase/specimens/index.d.ts +5 -0
- package/dist/showcase/specimens/index.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.d.ts +1 -0
- package/dist/showcase/specimens/inputs.d.ts.map +1 -1
- package/dist/showcase/specimens/inputs.js +2 -0
- package/dist/showcase/specimens/navigation.d.ts +2 -0
- package/dist/showcase/specimens/navigation.d.ts.map +1 -1
- package/dist/showcase/specimens/navigation.js +28 -0
- package/dist/showcase/usage.generated.d.ts +1 -1
- package/dist/showcase/usage.generated.d.ts.map +1 -1
- package/dist/showcase/usage.generated.js +85 -30
- package/package.json +2 -2
|
@@ -10,6 +10,11 @@ import { MenuCommandRow } from "../internal/record-menu-items.js";
|
|
|
10
10
|
import { ActionMenu } from "./action-menu.js";
|
|
11
11
|
import { Button } from "./button.js";
|
|
12
12
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "./dropdown-menu.js";
|
|
13
|
+
function secondariesOf(secondary) {
|
|
14
|
+
if (secondary === undefined)
|
|
15
|
+
return [];
|
|
16
|
+
return "label" in secondary ? [secondary] : secondary;
|
|
17
|
+
}
|
|
13
18
|
/**
|
|
14
19
|
* The end of a card's header: what the card's reader can do from it, and where it leads.
|
|
15
20
|
*
|
|
@@ -18,12 +23,12 @@ import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "./dropdo
|
|
|
18
23
|
* @instead A page's own commands are `PageActions` on the title's row. A record's commands are its list's (`RecordList`) or its `RecordCommands`. A setting card whose value stands at its header's end, such as an avatar upload, gives `SettingsSection` its `control`. A link inside the card's description or footer line is a `TextLink` in that sentence (nadicode decision).
|
|
19
24
|
* @behaviour The row holds, in order: the muted `meta` (a period or a count), the reading `period`, up to two secondaries as outline buttons, the primary as the filled button, and the three dots last. A way to another page is a secondary with its `link`, drawn as a button like the others and named for the page; it is never a text link in the header's corner. A page has one filled button, so a card on a page whose primary stands elsewhere takes outline buttons only. It wraps under the title when the header is narrow, as the card's header places it.
|
|
20
25
|
* @words A command is a verb on the card's object ("Add card", "Buy Extra usage for Customers"); a way to another page is that page's name as its navigation writes it ("Statements"); `meta` is a short count or period ("2 of 5 Agents").
|
|
21
|
-
* @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A way to another page is a real link.
|
|
26
|
+
* @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A way to another page is a real link. A command with `autoFocus` takes focus as it appears, as the Edit that opened a card's in-place editor does when the editor closes.
|
|
22
27
|
*/
|
|
23
28
|
export function CardActionsRow({ meta, period, secondary, primary, menu }) {
|
|
24
29
|
if (!hasCardActions({ meta, period, secondary, primary, menu }))
|
|
25
30
|
return null;
|
|
26
|
-
const secondaries = secondary
|
|
31
|
+
const secondaries = secondariesOf(secondary);
|
|
27
32
|
return (_jsxs("div", { "data-slot": "card-actions", className: "flex max-w-full min-w-0 flex-wrap items-center gap-2", children: [meta ? (_jsx("span", { className: "mr-1 text-label-sm text-muted-foreground", "data-slot": "card-actions-meta", children: meta })) : null, period, secondaries.map((command) => (_jsx(PageCommandButton, { command: command, variant: "outline" }, command.label))), primary ? _jsx(PageCommandButton, { command: primary, variant: "default" }) : null, menu ? _jsx(ActionMenu, { ...menu, size: "page" }) : null] }));
|
|
28
33
|
}
|
|
29
34
|
export function PageCommandButton({ command, ...appearance }) {
|
|
@@ -46,7 +51,7 @@ function ChoicesButton({ command, look: ownLook, ...trigger }) {
|
|
|
46
51
|
export function PageActionsRow({ period, primary, secondary, menu }) {
|
|
47
52
|
if (!period && !primary && !secondary && !menu)
|
|
48
53
|
return null;
|
|
49
|
-
return (_jsxs("div", { "data-slot": "page-actions", className: "flex max-w-full min-w-0 flex-wrap items-center gap-2", children: [period, secondary
|
|
54
|
+
return (_jsxs("div", { "data-slot": "page-actions", className: "flex max-w-full min-w-0 flex-wrap items-center gap-2", children: [period, secondariesOf(secondary).map((command) => (_jsx(PageCommandButton, { command: command, variant: "outline" }, command.label))), primary ? _jsx(PageCommandButton, { command: primary, variant: "default" }) : null, menu ? _jsx(ActionMenu, { ...menu, size: "page" }) : null] }));
|
|
50
55
|
}
|
|
51
56
|
const TWO_OWNERS = "Two PageActions are on the page at once. The title row has one owner, so the one that mounted last hides the commands of the other. Give the page one PageActions.";
|
|
52
57
|
function createHost(titled = true) {
|
|
@@ -105,7 +110,7 @@ export function PageActionsSlot() {
|
|
|
105
110
|
* @family Actions
|
|
106
111
|
* @when The actions of a collection, an object or an overview page, at the trailing edge of the title's row, or, where the product's path names the page and its title is unseen (`ProductShell`'s `title`, every Portal page's), of the one row the unseen title keeps at the top of the page, which takes no room while the page has none (owner, 2026-11-08); the page compositions draw it from their `actions`. A settings page (`SettingsPage`) has none: each section saves from its footer (nadicode decision).
|
|
107
112
|
* @instead A record's commands are its list's (`RecordList`) or its `RecordCommands`. A collection toolbar holds search and filters, never a page action, except on a list page whose title is not drawn, where `CollectionPage` ends the toolbar with the page's actions (owner, 2026-11-08). A page whose parts each have commands gathers them in the one `PageActions` of the component that owns the page; a part never draws a second (nadicode decision).
|
|
108
|
-
* @behaviour Ours: an action sits on the title of the thing it acts on, never on a tab's, and a page's commands are the same on each of its sibling tabs, whatever its list shows or has chosen: only the viewer's permission removes one (nadicode decision). A command on chosen records is the list's own (`select.chosen`), and a record's is its row's (nadicode decision). One per page: a second `PageActions` on the page a person sees would hide the first's commands, so it throws in development and in tests, and in production the one that mounted last keeps the row; a page kept hidden for a quick return (an `Activity` with `mode="hidden"`) has given the row back (nadicode decision). It takes `period`, `secondary`, `primary` and `menu` and draws their order: the period,
|
|
113
|
+
* @behaviour Ours: an action sits on the title of the thing it acts on, never on a tab's, and a page's commands are the same on each of its sibling tabs, whatever its list shows or has chosen: only the viewer's permission removes one (nadicode decision). A command on chosen records is the list's own (`select.chosen`), and a record's is its row's (nadicode decision). One per page: a second `PageActions` on the page a person sees would hide the first's commands, so it throws in development and in tests, and in production the one that mounted last keeps the row; a page kept hidden for a quick return (an `Activity` with `mode="hidden"`) has given the row back (nadicode decision). It takes `period`, `secondary`, `primary` and `menu` and draws their order: the period, up to two outline secondaries, the filled primary, then the three dots last; one filled button per page, so a page whose commands only serve its main job, such as a Library catalogue's link to its hub and its Sync now, gives them as secondaries and no primary, and the page's one filled button is its first use's (nadicode decision). The page's three dots hold two commands or more, which the type requires; a single extra command is the secondary (owner, 2026-11-06). A primary whose job comes in a few kinds takes `choices`: its button opens a menu of them aligned to its end, each with its icon; a kind that needs its own fields opens its dialog from its row (nadicode decision). A destination outside the product ends in the arrow. A running command (`pending`) keeps its place and icon and says its pending word, and the type requires `pendingLabel` whenever `pending` is set; one that cannot run now stays, disabled, with `disabledReason` in its tooltip (nadicode decision). Deleting the page's own record is never here: it is the danger zone of the record's Settings, in a card. A reversible command on the record, such as Archive, may stand last in the page's three dots, after a divider, with its `confirm` or `undo` (nadicode decision). “Disable a button only when the action is impossible right now (missing input, insufficient permission); pair with a `Tooltip` that explains why.” (https://vercel.com/geist/button) “Group destructive items at the bottom, separated by a divider, and keep the destructive copy as `Verb + Noun` (`Delete Project`, never bare `Delete`).” (https://vercel.com/geist/menu)
|
|
109
114
|
* @words Ours: the primary is the page's main job as verb and noun: "Invite member", "New Agent"; its choices are the kinds, as nouns: "Folder", "Documents", "Web page"; the pending word is its -ing form: "Inviting member"; the menu names the page's record at its top (nadicode decision).
|
|
110
115
|
* @access DOM order is visual order. A command whose label does not name its target carries `accessibleName`. A running command is `aria-busy` and keeps focus. The three dots carry "More for {record}"; the menu returns focus to them when it closes.
|
|
111
116
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type PageCommand } from "../internal/page-command-button.js";
|
|
2
3
|
export type PlanCardAllowance = {
|
|
3
4
|
/** The use the plan includes against the smallest one, as a figure: "3×". Left out when the plan includes none. */
|
|
4
5
|
figure?: string | undefined;
|
|
@@ -10,6 +11,17 @@ export type PlanCardInclusions = {
|
|
|
10
11
|
label: string;
|
|
11
12
|
items: readonly string[];
|
|
12
13
|
};
|
|
14
|
+
/** What stands at the card's foot: the command that chooses the plan, or the line that says why none does. */
|
|
15
|
+
export type PlanCardAction = {
|
|
16
|
+
command: PageCommand;
|
|
17
|
+
/** The plan the catalogue recommends to a person choosing their first: its command is the row's one filled button. */
|
|
18
|
+
recommended?: boolean | undefined;
|
|
19
|
+
note?: never;
|
|
20
|
+
} | {
|
|
21
|
+
note: string;
|
|
22
|
+
command?: never;
|
|
23
|
+
recommended?: never;
|
|
24
|
+
};
|
|
13
25
|
export type PlanCardProps = Omit<ComponentProps<"section">, "title" | "children"> & {
|
|
14
26
|
/** The plan's name: "Business". */
|
|
15
27
|
name: string;
|
|
@@ -32,7 +44,7 @@ export type PlanCardProps = Omit<ComponentProps<"section">, "title" | "children"
|
|
|
32
44
|
note?: string | undefined;
|
|
33
45
|
};
|
|
34
46
|
/** 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:
|
|
47
|
+
action: PlanCardAction;
|
|
36
48
|
};
|
|
37
49
|
/**
|
|
38
50
|
* One plan a person can choose, in a row of plans: its emblem, name, use, what comes with it, its
|
|
@@ -41,7 +53,7 @@ export type PlanCardProps = Omit<ComponentProps<"section">, "title" | "children"
|
|
|
41
53
|
* @family Compositions
|
|
42
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).
|
|
43
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`.
|
|
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).
|
|
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).
|
|
45
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").
|
|
46
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.
|
|
47
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,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C,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,+BA0Ef"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Check } from "lucide-react";
|
|
3
3
|
import { useId } from "react";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { PageCommandButton } from "../internal/page-command-button.js";
|
|
5
6
|
import { Card, CardContent, CardHeader, CardTitle } from "./card.js";
|
|
6
7
|
/**
|
|
7
8
|
* One plan a person can choose, in a row of plans: its emblem, name, use, what comes with it, its
|
|
@@ -10,7 +11,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "./card.js";
|
|
|
10
11
|
* @family Compositions
|
|
11
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).
|
|
12
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`.
|
|
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
|
+
* @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
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").
|
|
15
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.
|
|
16
17
|
*/
|
|
@@ -18,5 +19,5 @@ export function PlanCard({ name, headingLevel = 3, picture, status, description,
|
|
|
18
19
|
const headingId = useId();
|
|
19
20
|
const inclusionsId = useId();
|
|
20
21
|
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
|
+
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.command ? (_jsx(PageCommandButton, { command: action.command, variant: action.recommended ? "default" : "outline" })) : (_jsx("p", { className: "text-caption text-muted-foreground", children: action.note })) }) })] })] }));
|
|
22
23
|
}
|
|
@@ -1,19 +1,31 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from "react";
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
+
import { type PageCommand } from "../internal/page-command-button.js";
|
|
3
|
+
/** A product's downloads, as data: the band draws each one. */
|
|
4
|
+
export type ProductDownloads = {
|
|
5
|
+
/** The file for the reader's computer, the band's one filled button: "Download for macOS". */
|
|
6
|
+
main?: PageCommand | undefined;
|
|
7
|
+
/** The product's other systems, each a way to its file: "Windows", "Linux". */
|
|
8
|
+
others?: readonly PageCommand[] | undefined;
|
|
9
|
+
/** One muted line under them: the main file's chip, size and needs, and the version. */
|
|
10
|
+
note?: string | undefined;
|
|
11
|
+
};
|
|
2
12
|
/**
|
|
3
13
|
* One product a person downloads, as a band: its name, its line and its downloads, beside its picture.
|
|
4
14
|
*
|
|
5
15
|
* @family Compositions
|
|
6
16
|
* @when The Downloads page, one band per product: Nadia, Alveare, Alveare Server, NadiaOS.
|
|
7
|
-
* @instead
|
|
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.
|
|
17
|
+
* @instead A product whose files are each chosen by what they need, such as NadiaOS's images for each hypervisor, lists them as a `RecordList` in the band's `children`, each file's Download its row's `main` command; an entry a person adds from a catalogue is a `CatalogCard`; the steps after a download are `NumberedSteps`.
|
|
18
|
+
* @behaviour One resting card. The product gives its `downloads` as data and the band draws them under its `children`, never a button of the product's own: the file for the reader's computer (`main`) filled at the large size, full width on a phone; the product's other systems (`others`) after it, quiet (ghost) beside a `main` and outline when the reader's computer has no file of its own, so every system stays offered; and the `note`, one muted line, under them (nadicode decision). 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).
|
|
19
|
+
* @words None of its own: the product's name, its line and its download labels are the product's, from its catalogue: the main one "Download for {system}", another system its name alone ("Windows").
|
|
20
|
+
* @access The band is a `section`, which the product names with its heading through `aria-labelledby`. The picture is decorative: hidden from assistive technology and never a target. Each download is a link named by its label, or by its `accessibleName` where several bands on a page carry the same label ("Windows · Nadia"); its icon is hidden. `ProductBandSkeleton` is busy and its bars are hidden from assistive technology.
|
|
11
21
|
*/
|
|
12
|
-
export declare function ProductBand({ picture, children, }: {
|
|
22
|
+
export declare function ProductBand({ picture, children, downloads, className, ...section }: Omit<ComponentProps<"section">, "children"> & {
|
|
13
23
|
/** The product's picture, an image that fills the square it is given: the product's router image with `fill`. */
|
|
14
24
|
picture: ReactElement;
|
|
15
|
-
/** The product's mark, heading
|
|
25
|
+
/** The product's mark, heading and line, and a list of its files when each is chosen by what it needs. */
|
|
16
26
|
children: ReactNode;
|
|
27
|
+
/** The downloads the band draws under `children`. */
|
|
28
|
+
downloads?: ProductDownloads | undefined;
|
|
17
29
|
}): import("react").JSX.Element;
|
|
18
30
|
/** What stands in a ProductBand's place while its page reads the releases, with no words. */
|
|
19
31
|
export declare function ProductBandSkeleton(): import("react").JSX.Element;
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"product-band.d.ts","sourceRoot":"","sources":["../../src/components/product-band.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIrE,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,gCAAgC,CAAC;AAGrF,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,8FAA8F;IAC9F,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAAC;IAC5C,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AA8CF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,GAAG,OAAO,EACX,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,GAAG;IAC/C,iHAAiH;IACjH,OAAO,EAAE,YAAY,CAAC;IACtB,0GAA0G;IAC1G,QAAQ,EAAE,SAAS,CAAC;IACpB,qDAAqD;IACrD,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC1C,+BAcA;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,gCAsBlC"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Card } from "./card.js";
|
|
3
3
|
import { Skeleton, SkeletonRegion } from "./skeleton.js";
|
|
4
|
+
import { PageCommandButton } from "../internal/page-command-button.js";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
const NO_OTHERS = [];
|
|
7
|
+
function Downloads({ main, others = NO_OTHERS, note }) {
|
|
8
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", "data-slot": "product-band-downloads", children: [_jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center", children: [main ? _jsx(PageCommandButton, { command: main, size: "lg", variant: "default" }) : null, others.length ? (_jsx("div", { className: "flex flex-wrap items-center gap-1", children: others.map((command) => (_jsx(PageCommandButton, { command: command, variant: main ? "ghost" : "outline" }, command.label))) })) : null] }), note ? _jsx("p", { className: "text-xs text-muted-foreground", children: note }) : null] }));
|
|
9
|
+
}
|
|
4
10
|
function Band({ content, picture }) {
|
|
5
11
|
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
12
|
}
|
|
@@ -9,13 +15,13 @@ function Band({ content, picture }) {
|
|
|
9
15
|
*
|
|
10
16
|
* @family Compositions
|
|
11
17
|
* @when The Downloads page, one band per product: Nadia, Alveare, Alveare Server, NadiaOS.
|
|
12
|
-
* @instead
|
|
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.
|
|
18
|
+
* @instead A product whose files are each chosen by what they need, such as NadiaOS's images for each hypervisor, lists them as a `RecordList` in the band's `children`, each file's Download its row's `main` command; an entry a person adds from a catalogue is a `CatalogCard`; the steps after a download are `NumberedSteps`.
|
|
19
|
+
* @behaviour One resting card. The product gives its `downloads` as data and the band draws them under its `children`, never a button of the product's own: the file for the reader's computer (`main`) filled at the large size, full width on a phone; the product's other systems (`others`) after it, quiet (ghost) beside a `main` and outline when the reader's computer has no file of its own, so every system stays offered; and the `note`, one muted line, under them (nadicode decision). 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).
|
|
20
|
+
* @words None of its own: the product's name, its line and its download labels are the product's, from its catalogue: the main one "Download for {system}", another system its name alone ("Windows").
|
|
21
|
+
* @access The band is a `section`, which the product names with its heading through `aria-labelledby`. The picture is decorative: hidden from assistive technology and never a target. Each download is a link named by its label, or by its `accessibleName` where several bands on a page carry the same label ("Windows · Nadia"); its icon is hidden. `ProductBandSkeleton` is busy and its bars are hidden from assistive technology.
|
|
16
22
|
*/
|
|
17
|
-
export function ProductBand({ picture, children, }) {
|
|
18
|
-
return (_jsx(Card, { className: "@container gap-0 py-0", children: _jsx(Band, { content: children, picture: picture }) }));
|
|
23
|
+
export function ProductBand({ picture, children, downloads, className, ...section }) {
|
|
24
|
+
return (_jsx(Card, { className: cn("@container gap-0 py-0", className), render: _jsx("section", { ...section }), children: _jsx(Band, { content: _jsxs(_Fragment, { children: [children, downloads ? _jsx(Downloads, { ...downloads }) : null] }), picture: picture }) }));
|
|
19
25
|
}
|
|
20
26
|
/** What stands in a ProductBand's place while its page reads the releases, with no words. */
|
|
21
27
|
export function ProductBandSkeleton() {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type PageCommandFace } from "../internal/page-command-button.js";
|
|
3
|
+
import type { CommandRun, CommandUndo } from "./action-menu.js";
|
|
4
|
+
import type { ResolvedMessage } from "./product-message.js";
|
|
5
|
+
/** One view of the inbox, a tab across its head: "To read", "Archive". */
|
|
6
|
+
export type ProductShellInboxView = {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The one command over the open view, at the inbox's foot: it runs at once, or, as Archive all,
|
|
13
|
+
* runs at once and says so in a toast whose one action is Undo.
|
|
14
|
+
*/
|
|
15
|
+
export type ProductShellInboxCommand = PageCommandFace & ({
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
undo?: never;
|
|
18
|
+
link?: never;
|
|
19
|
+
render?: never;
|
|
20
|
+
} | {
|
|
21
|
+
onClick: CommandRun;
|
|
22
|
+
undo: CommandUndo;
|
|
23
|
+
link?: never;
|
|
24
|
+
render?: never;
|
|
25
|
+
});
|
|
26
|
+
export type ProductShellBellData = {
|
|
27
|
+
/** The bell's name, with what waits unread and how urgent: "Notifications: 3 unread, needs attention". */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Something waits unread: the dot on the bell, and the kind of the most urgent, which the dot carries as `data-severity`. */
|
|
30
|
+
unread?: {
|
|
31
|
+
severity: string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
/** The inbox's unseen title, which names its popup: "Notifications". */
|
|
34
|
+
title: string;
|
|
35
|
+
open: boolean;
|
|
36
|
+
onOpenChange: (open: boolean) => void;
|
|
37
|
+
/** The inbox's views, as tabs across its head, and the one shown. */
|
|
38
|
+
views: {
|
|
39
|
+
/** What the tabs are: "Notification views". */
|
|
40
|
+
label: string;
|
|
41
|
+
items: readonly [ProductShellInboxView, ...ProductShellInboxView[]];
|
|
42
|
+
current: string;
|
|
43
|
+
onChange: (id: string) => void;
|
|
44
|
+
};
|
|
45
|
+
/** A message over the views about the last thing the person did here, as a failed archive. */
|
|
46
|
+
notice?: ResolvedMessage | undefined;
|
|
47
|
+
/** The command over the open view, at the inbox's foot; left out while the view has nothing it acts on. */
|
|
48
|
+
foot?: ProductShellInboxCommand | undefined;
|
|
49
|
+
/** The inbox's preferences, behind the gear at the end of its head. */
|
|
50
|
+
preferences?: {
|
|
51
|
+
/** The gear's name: "Preferences". */
|
|
52
|
+
label: string;
|
|
53
|
+
/** The view's heading: "Notification preferences". */
|
|
54
|
+
title: string;
|
|
55
|
+
/** The way back to the views: "Back". */
|
|
56
|
+
back: string;
|
|
57
|
+
content: ReactNode;
|
|
58
|
+
} | undefined;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The product's notifications inbox: the bell beside the account, and the popup it opens.
|
|
62
|
+
*
|
|
63
|
+
* @family Navigation
|
|
64
|
+
* @when The bell `ProductShell` draws from its `bell`, beside the account at the column's foot, as the Portal's notifications. A product whose bell waits for who is signed in streams it as a region and draws this inside it. A product gives the bell its words, its views and their commands, and never draws the bell, its popup or their buttons.
|
|
65
|
+
* @instead A record's own commands stand in its row (`RecordList`), as each notification's Archive. A condition of the page's object is `NoticeBanner`. A message about one action elsewhere is a toast.
|
|
66
|
+
* @behaviour The bell is a ghost icon button; a 6 px dot at its top right says something waits unread, and only the name says how many and how urgent. It opens a popup over the column's foot, 352 px wide and at most 512 px tall, never past the window. Its head holds the views as tabs and, at its end, the gear that opens the preferences, which take the whole popup under a head of their own: Back, then their title; Back returns to the views. Focus follows: the gear hands it to Back, and Back hands it back to the gear. A `notice` stands under the head. Each view scrolls inside the popup. The `foot` command stands at the popup's foot under a 1 px rule, full width and without chrome; one with `undo` runs at once and says so in a toast whose one action is Undo. The popup closes on Escape or a press outside and keeps the view it was on.
|
|
67
|
+
* @words The product's catalogue: the bell's name says what waits ("Notifications: 3 unread, needs attention"); the views are short nouns ("To read", "Archive"); the foot command names its result ("Archive all").
|
|
68
|
+
* @access The bell is a button named by `label`, with `aria-expanded`; the popup is a dialog named by `title`, and opening it moves focus to the current tab. The tabs are a tablist named by `views.label`; the gear and Back are icon buttons named by their words. Escape closes the popup and returns focus to the bell.
|
|
69
|
+
*/
|
|
70
|
+
export declare function ProductShellBell({ label, unread, title, open, onOpenChange, views, notice, foot, preferences, }: ProductShellBellData): import("react").JSX.Element;
|
|
71
|
+
//# sourceMappingURL=product-shell-bell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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AC;QACd,KAAK,EAAE,SAAS,CAAC,qBAAqB,EAAE,GAAG,qBAAqB,EAAE,CAAC,CAAC;QACpE,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;KAChC,CAAC;IACF,8FAA8F;IAC9F,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC;IACrC,2GAA2G;IAC3G,IAAI,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IAC5C,uEAAuE;IACvE,WAAW,CAAC,EACR;QACE,sCAAsC;QACtC,KAAK,EAAE,MAAM,CAAC;QACd,sDAAsD;QACtD,KAAK,EAAE,MAAM,CAAC;QACd,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,SAAS,CAAC;KACpB,GACD,SAAS,CAAC;CACf,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,MAAM,EACN,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,MAAM,EACN,IAAI,EACJ,WAAW,GACZ,EAAE,oBAAoB,+BAsGtB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowLeft, Bell, Settings } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { useCommandRunner } from "../internal/command-runner.js";
|
|
6
|
+
import { PageCommandButton } from "../internal/page-command-button.js";
|
|
7
|
+
import { Button } from "./button.js";
|
|
8
|
+
import { MessageNotice } from "./message-notice.js";
|
|
9
|
+
import { Popover, PopoverContent, PopoverTitle, PopoverTrigger } from "./popover.js";
|
|
10
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
|
|
11
|
+
/**
|
|
12
|
+
* The product's notifications inbox: the bell beside the account, and the popup it opens.
|
|
13
|
+
*
|
|
14
|
+
* @family Navigation
|
|
15
|
+
* @when The bell `ProductShell` draws from its `bell`, beside the account at the column's foot, as the Portal's notifications. A product whose bell waits for who is signed in streams it as a region and draws this inside it. A product gives the bell its words, its views and their commands, and never draws the bell, its popup or their buttons.
|
|
16
|
+
* @instead A record's own commands stand in its row (`RecordList`), as each notification's Archive. A condition of the page's object is `NoticeBanner`. A message about one action elsewhere is a toast.
|
|
17
|
+
* @behaviour The bell is a ghost icon button; a 6 px dot at its top right says something waits unread, and only the name says how many and how urgent. It opens a popup over the column's foot, 352 px wide and at most 512 px tall, never past the window. Its head holds the views as tabs and, at its end, the gear that opens the preferences, which take the whole popup under a head of their own: Back, then their title; Back returns to the views. Focus follows: the gear hands it to Back, and Back hands it back to the gear. A `notice` stands under the head. Each view scrolls inside the popup. The `foot` command stands at the popup's foot under a 1 px rule, full width and without chrome; one with `undo` runs at once and says so in a toast whose one action is Undo. The popup closes on Escape or a press outside and keeps the view it was on.
|
|
18
|
+
* @words The product's catalogue: the bell's name says what waits ("Notifications: 3 unread, needs attention"); the views are short nouns ("To read", "Archive"); the foot command names its result ("Archive all").
|
|
19
|
+
* @access The bell is a button named by `label`, with `aria-expanded`; the popup is a dialog named by `title`, and opening it moves focus to the current tab. The tabs are a tablist named by `views.label`; the gear and Back are icon buttons named by their words. Escape closes the popup and returns focus to the bell.
|
|
20
|
+
*/
|
|
21
|
+
export function ProductShellBell({ label, unread, title, open, onOpenChange, views, notice, foot, preferences, }) {
|
|
22
|
+
const [showsPreferences, setShowsPreferences] = useState(false);
|
|
23
|
+
const handsFocus = useRef(false);
|
|
24
|
+
const takeFocus = (button) => {
|
|
25
|
+
if (!button || !handsFocus.current)
|
|
26
|
+
return;
|
|
27
|
+
handsFocus.current = false;
|
|
28
|
+
button.focus();
|
|
29
|
+
};
|
|
30
|
+
const showPreferences = (shows) => {
|
|
31
|
+
handsFocus.current = true;
|
|
32
|
+
setShowsPreferences(shows);
|
|
33
|
+
};
|
|
34
|
+
const { arm } = useCommandRunner();
|
|
35
|
+
return (_jsxs(Popover, { open: open, onOpenChange: (next) => onOpenChange(next), children: [_jsx(PopoverTrigger, { render: _jsxs(Button, { "aria-label": label, className: "relative shrink-0 column-collapsed:mx-auto", "data-slot": "product-shell-bell", size: "icon", type: "button", variant: "ghost", children: [_jsx(Bell, { "aria-hidden": "true" }), unread ? (_jsx("span", { "aria-hidden": "true", className: "absolute top-1 right-1 size-1.5 rounded-full bg-foreground", "data-severity": unread.severity, "data-slot": "product-shell-bell-dot" })) : null] }) }), _jsxs(PopoverContent, { align: "end", className: "max-h-[min(32rem,calc(100dvh-8rem))] w-88 max-w-[calc(100vw-1.5rem)] overflow-hidden p-0", side: "top", sideOffset: 8, children: [_jsx(PopoverTitle, { className: "sr-only", children: title }), preferences && showsPreferences ? (_jsxs("div", { className: "flex min-h-0 flex-col overflow-hidden", children: [_jsxs("div", { className: "flex items-center gap-1 border-b p-2", children: [_jsx(Button, { "aria-label": preferences.back, onClick: () => showPreferences(false), ref: takeFocus, size: "icon", type: "button", variant: "ghost", children: _jsx(ArrowLeft, { "aria-hidden": "true" }) }), _jsx("span", { className: "min-w-0 truncate text-sm font-medium", children: preferences.title })] }), _jsx("div", { className: "min-h-0 overflow-auto", children: preferences.content })] })) : (_jsxs(Tabs, { className: "min-h-0 gap-0", onValueChange: views.onChange, value: views.current, children: [_jsxs("div", { className: "flex items-center gap-1 px-2 pt-2", children: [_jsx(TabsList, { "aria-label": views.label, className: "min-w-0 flex-1", variant: "line", children: views.items.map((view) => (_jsx(TabsTrigger, { value: view.id, children: view.label }, view.id))) }), preferences ? (_jsx(Button, { "aria-label": preferences.label, onClick: () => showPreferences(true), ref: takeFocus, size: "icon", type: "button", variant: "ghost", children: _jsx(Settings, { "aria-hidden": "true" }) })) : null] }), notice ? (_jsx(MessageNotice, { className: "mx-3 my-1", message: notice, placement: "action" })) : null, views.items.map((view) => (_jsx(TabsContent, { className: "min-h-0 overflow-auto", value: view.id, children: view.content }, view.id))), foot ? (_jsx("div", { className: "border-t p-2 *:w-full", "data-slot": "product-shell-bell-foot", children: _jsx(PageCommandButton, { command: arm(foot), variant: "ghost" }) })) : null] }))] })] }));
|
|
36
|
+
}
|
|
@@ -8,6 +8,7 @@ import { type RecordContextMenuProps } from "./record-commands.js";
|
|
|
8
8
|
import { type ScopeSwitcherProps } from "./scope-switcher.js";
|
|
9
9
|
import { type SidebarSectionsProps } from "./sidebar-sections.js";
|
|
10
10
|
import { type StatusBadgeTone } from "./status-badge.js";
|
|
11
|
+
import { type ProductShellBellData } from "./product-shell-bell.js";
|
|
11
12
|
/** What leads a place's row: an icon for its kind, or the place's own mark. */
|
|
12
13
|
type PlaceFigure = {
|
|
13
14
|
icon: IconComponent;
|
|
@@ -164,6 +165,18 @@ export type ProductShellHost = {
|
|
|
164
165
|
};
|
|
165
166
|
/** The one band above the account: the update offer, or the way out of the product. */
|
|
166
167
|
export type ProductShellBandData = ColumnFootBand;
|
|
168
|
+
/** The assistant's toggle at the top bar's end, which opens and closes its panel beside the page (`aside`). */
|
|
169
|
+
export type ProductShellAssistantData = {
|
|
170
|
+
/** The assistant's name, the toggle's label: "Sofia". */
|
|
171
|
+
label: string;
|
|
172
|
+
/** Her mark before the name: an Agent's orb at 24 px. */
|
|
173
|
+
mark: ReactElement;
|
|
174
|
+
/** Whether her panel is open. */
|
|
175
|
+
open: boolean;
|
|
176
|
+
/** The id of the panel it opens. */
|
|
177
|
+
panel: string;
|
|
178
|
+
onToggle: () => void;
|
|
179
|
+
};
|
|
167
180
|
/** The column's width, as the product keeps it with its preferences. */
|
|
168
181
|
export type ProductShellWidth = {
|
|
169
182
|
/** The expanded width in px it opens at, 224 to 384; 256 until the person drags it. */
|
|
@@ -230,8 +243,8 @@ export type ProductShellProps = {
|
|
|
230
243
|
foot?: readonly ProductShellPlace[];
|
|
231
244
|
/** The account menu at the column's foot, or the region that draws it; the shell decides its trigger's size and side. */
|
|
232
245
|
account: ColumnFootAccount | ProductShellRegion;
|
|
233
|
-
/** The bell beside the account, the product's notifications inbox. */
|
|
234
|
-
bell?:
|
|
246
|
+
/** The bell beside the account, the product's notifications inbox (`ProductShellBell`), or the region that draws it. */
|
|
247
|
+
bell?: ProductShellBellData | ProductShellRegion;
|
|
235
248
|
/** The path to the page, drawn in the top bar, or the region that draws it. */
|
|
236
249
|
path: readonly ProductShellCrumb[] | ProductShellRegion;
|
|
237
250
|
/** The page's unseen title and the row of its actions above the page, or the region that draws them; a page whose composition draws its own title passes none. */
|
|
@@ -240,8 +253,8 @@ export type ProductShellProps = {
|
|
|
240
253
|
tabs?: ProductShellTabsData | ProductShellRegion;
|
|
241
254
|
/** The open page's address, or the region that tells it, for a product whose path is a region: a new one opens the page at its top. */
|
|
242
255
|
address?: string | ProductShellRegion;
|
|
243
|
-
/** The top bar's end: the product's assistant, as the Portal's Sofia. */
|
|
244
|
-
assistant?:
|
|
256
|
+
/** The top bar's end: the toggle of the product's assistant, as the Portal's Sofia (`ProductShellAssistant`), or the region that draws it. */
|
|
257
|
+
assistant?: ProductShellAssistantData | ProductShellRegion;
|
|
245
258
|
/** The shell's one persistent strip under the top bar, as the Portal's impersonation, or the region that draws it. */
|
|
246
259
|
strip?: NoticeBannerProps | ProductShellRegion;
|
|
247
260
|
/** A panel beside the page, as Nadia's side panel. */
|
|
@@ -340,6 +353,10 @@ export type ProductShellAccountProps = ColumnFootAccount | {
|
|
|
340
353
|
export declare function ProductShellAccount(props: ProductShellAccountProps): import("react").JSX.Element;
|
|
341
354
|
/** The strip under the top bar: `ProductShell` draws it from its `strip`, and a product renders it in that region. */
|
|
342
355
|
export declare function ProductShellStrip(props: NoticeBannerProps): import("react").JSX.Element;
|
|
356
|
+
/**
|
|
357
|
+
* The assistant's toggle at the top bar's end: `ProductShell` draws it from its `assistant`, and a product renders it in that region. A 40 px outline button with her mark and name, secondary while her panel is open; it says whether the panel is open (`aria-expanded`) and which it is (`aria-controls`). When the panel closes from inside, by its Close or its sheet's, focus returns to the toggle, unless it has already moved elsewhere on the page.
|
|
358
|
+
*/
|
|
359
|
+
export declare function ProductShellAssistant({ label, mark, open, panel, onToggle, }: ProductShellAssistantData): import("react").JSX.Element;
|
|
343
360
|
export type ProductShellPathProps = {
|
|
344
361
|
crumbs: readonly ProductShellCrumb[];
|
|
345
362
|
/** The path's name, when the region drawn beside the page names it itself; otherwise the shell's `labels.path` names it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-shell.d.ts","sourceRoot":"","sources":["../../src/components/product-shell.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAWf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAY,MAAM,0BAA0B,CAAC;AAYjG,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAoBrF,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"product-shell.d.ts","sourceRoot":"","sources":["../../src/components/product-shell.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAWf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,cAAc,EAAY,MAAM,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AAiB,CAAC,KAAK,EAAE,sBAAsB,+BAkB9D;AAED,MAAM,MAAM,qBAAqB,GAC7B,CAAC,oBAAoB,GAAG;IAAE,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,GAC7D;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAStD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAwB5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,GACN,EAAE;IACD,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,WAAW,CAAC,CAAC;CACvD,+BA4CA"}
|
|
@@ -24,6 +24,7 @@ import { StatusBadge } from "./status-badge.js";
|
|
|
24
24
|
import { TabsLink, TabsNav } from "./tabs-nav.js";
|
|
25
25
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
26
26
|
import { PlaceCount } from "./place-count.js";
|
|
27
|
+
import { ProductShellBell } from "./product-shell-bell.js";
|
|
27
28
|
import { CommandRunnerHost } from "../internal/command-runner.js";
|
|
28
29
|
import { cssVariables } from "../lib/css-variables.js";
|
|
29
30
|
import { PRODUCT_SHELL_HEADING_ID, PRODUCT_SHELL_KEPT_COLLAPSED_ATTRIBUTE, PRODUCT_SHELL_KEPT_WIDTH_ATTRIBUTE, PRODUCT_SHELL_KEPT_WIDTH_PROPERTY, } from "../lib/product-shell.js";
|
|
@@ -331,9 +332,9 @@ function Frame({ home, create, find, band, foot, account, bell, path, title, tab
|
|
|
331
332
|
"--product-shell-start-room": sideRoom.start ? `${sideRoom.start}px` : undefined,
|
|
332
333
|
// The window's own buttons count in the end's room.
|
|
333
334
|
"--product-shell-end-room": sideRoom.end ? `${sideRoom.end}px` : undefined,
|
|
334
|
-
}), children: [_jsx("div", { className: "flex items-center self-stretch justify-self-start ps-[max(0px,calc(var(--product-shell-start-inset,0px)-0.75rem))] md:hidden", ref: startCluster, children: _jsx(SidebarTrigger, { "aria-labelledby": ids.openNavigation, attention: waiting, className: "-ml-1 self-center" }) }), Mover ? (_jsx("div", { className: "hidden self-stretch md:flex md:col-start-1 md:row-start-1", children: _jsx(Mover, {}) })) : null, _jsx("div", { className: "col-start-2 row-start-1 flex h-full min-w-0 items-center justify-center", ref: pathRoom, children: isRegion(path) ? (_jsx(Fragment, { children: path.region }, "path-region")) : (_jsx(ProductShellPath, { crumbs: path })) }), _jsxs("div", { className: "col-start-3 row-start-1 flex min-w-0 items-center justify-end gap-1 self-stretch", children: [Mover ? (_jsx("div", { className: "flex min-w-0 flex-1 self-stretch", children: _jsx(Mover, {}) })) : null, _jsxs("div", { className: "flex shrink-0 items-center gap-1 pe-(--product-shell-end-inset)", ref: endCluster, children: [host?.controls ? (_jsx("div", { className: "flex shrink-0 items-center gap-1", "data-compact": compact && host.compactControls ? "" : undefined, "data-slot": "product-shell-controls", children: compact && host.compactControls ? host.compactControls : host.controls })) : null, assistant ? _jsx(Fragment, { children: assistant }, "assistant") :
|
|
335
|
+
}), children: [_jsx("div", { className: "flex items-center self-stretch justify-self-start ps-[max(0px,calc(var(--product-shell-start-inset,0px)-0.75rem))] md:hidden", ref: startCluster, children: _jsx(SidebarTrigger, { "aria-labelledby": ids.openNavigation, attention: waiting, className: "-ml-1 self-center" }) }), Mover ? (_jsx("div", { className: "hidden self-stretch md:flex md:col-start-1 md:row-start-1", children: _jsx(Mover, {}) })) : null, _jsx("div", { className: "col-start-2 row-start-1 flex h-full min-w-0 items-center justify-center", ref: pathRoom, children: isRegion(path) ? (_jsx(Fragment, { children: path.region }, "path-region")) : (_jsx(ProductShellPath, { crumbs: path })) }), _jsxs("div", { className: "col-start-3 row-start-1 flex min-w-0 items-center justify-end gap-1 self-stretch", children: [Mover ? (_jsx("div", { className: "flex min-w-0 flex-1 self-stretch", children: _jsx(Mover, {}) })) : null, _jsxs("div", { className: "flex shrink-0 items-center gap-1 pe-(--product-shell-end-inset)", ref: endCluster, children: [host?.controls ? (_jsx("div", { className: "flex shrink-0 items-center gap-1", "data-compact": compact && host.compactControls ? "" : undefined, "data-slot": "product-shell-controls", children: compact && host.compactControls ? host.compactControls : host.controls })) : null, assistant === undefined ? null : isRegion(assistant) ? (_jsx(Fragment, { children: assistant.region }, "assistant-region")) : (_jsx(ProductShellAssistant, { ...assistant }))] })] })] }));
|
|
335
336
|
const stripRegion = strip ? (isRegion(strip) ? (_jsx(Fragment, { children: strip.region }, "strip-region")) : (_jsx(ProductShellStrip, { ...strip }))) : null;
|
|
336
|
-
return (_jsx(ProductShellContext, { value: context, children: _jsxs(CommandRunnerHost, { onAsk: closeSheet, children: [_jsx(ProductShellWordsContext, { value: wordsContext, children: isRegion(labels) ? (_jsx(Fragment, { children: labels.region }, "words-region")) : (_jsx(ProductShellWords, { ...labels })) }), _jsx(ProductShellColumnContext, { value: column, children: _jsxs(Sidebar, { mobileCloseLabel: words?.closeNavigation ?? "", mobileDescription: words?.navigationDescription, mobileFinalFocus: sheetFinalFocus, mobileTitle: words?.navigation, resize: narrow ? undefined : { "aria-labelledby": ids.resize }, children: [isMobile ? null : titleBar, _jsxs(SidebarFrame, { account: isRegion(account) ? (_jsx(Fragment, { children: account.region }, "account-region")) : (_jsx(ProductShellAccount, { ...account })), actions: bell ? _jsx(Fragment, { children: bell }, "bell") :
|
|
337
|
+
return (_jsx(ProductShellContext, { value: context, children: _jsxs(CommandRunnerHost, { onAsk: closeSheet, children: [_jsx(ProductShellWordsContext, { value: wordsContext, children: isRegion(labels) ? (_jsx(Fragment, { children: labels.region }, "words-region")) : (_jsx(ProductShellWords, { ...labels })) }), _jsx(ProductShellColumnContext, { value: column, children: _jsxs(Sidebar, { mobileCloseLabel: words?.closeNavigation ?? "", mobileDescription: words?.navigationDescription, mobileFinalFocus: sheetFinalFocus, mobileTitle: words?.navigation, resize: narrow ? undefined : { "aria-labelledby": ids.resize }, children: [isMobile ? null : titleBar, _jsxs(SidebarFrame, { account: isRegion(account) ? (_jsx(Fragment, { children: account.region }, "account-region")) : (_jsx(ProductShellAccount, { ...account })), actions: bell === undefined ? undefined : isRegion(bell) ? (_jsx(Fragment, { children: bell.region }, "bell-region")) : (_jsx(ProductShellBell, { ...bell })), band: band === undefined ? undefined : isRegion(band) ? (_jsx(Fragment, { children: band.region }, "band-region")) : (_jsx(ProductShellBand, { band: band })), find: find === undefined ? null : isRegion(find) ? (_jsx(Fragment, { children: find.region }, "find-region")) : find.form === "button" ? null : (_jsx(ProductShellFindField, { find: find })), foot: foot && foot.length > 0 ? (_jsx(SidebarMenu, { children: foot.map((place) => (_jsx(PlaceRow, { collapsed: collapsed, onChosen: isMobile ? choose : closeSheet, place: place }, place.id))) })) : undefined, header: !home ? (Mover ? (_jsx("div", { className: "flex h-14 min-w-0", children: _jsx(Mover, {}) })) : null) : isRegion(home) ? (_jsx(Fragment, { children: home.region }, "home-region")) : (_jsx(ProductShellHome, { ...home })), toggle: _jsxs(_Fragment, { children: [collapsed
|
|
337
338
|
? null
|
|
338
339
|
: topCommands.map((command) => (_jsx(TopCommand, { command: command, onChosen: closeSheet }, command.label))), collapsed && (narrow || expandBelowButtons) ? (Mover ? (_jsx("div", { className: "flex h-14 w-full self-stretch", children: _jsx(Mover, {}) })) : null) : narrow ? null : (_jsx(SidebarTrigger, { "aria-labelledby": ids.collapse, className: "hidden shrink-0 md:inline-flex" }))] }), children: [collapsed &&
|
|
339
340
|
((places && topCommands.length > 0) || (expandBelowButtons && !narrow)) ? (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsxs(SidebarMenu, { children: [expandBelowButtons && !narrow ? (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { "aria-expanded": false, "aria-labelledby": ids.collapse, onClick: toggleSidebar, tooltip: words?.collapse, children: _jsx(PanelLeftIcon, { "aria-hidden": "true" }) }) })) : null, (places ? topCommands : []).map((command) => (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { "aria-keyshortcuts": command.keyshortcuts, onClick: command.onClick, tooltip: command.label, children: [_jsx(command.icon, { "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: command.label })] }) }, command.label)))] }) }) })) : null, places ? (isRegion(places) ? (_jsx(Fragment, { children: places.region }, "places-region")) : (_jsx(ProductShellPlaces, { places: places }))) : sections ? (_jsx(ProductShellSections, { ...sections })) : null] })] }) }), isMobile && isRegion(places) ? (_jsx(ProductShellColumnContext, { value: waitingCounter, children: _jsx(Fragment, { children: places.region }, "places-count") })) : null, _jsxs(SidebarInset, { className: cn("h-full min-h-0 min-w-0", !host && "overflow-clip"), children: [isMobile ? titleBar : null, host ? (_jsxs("div", { className: "relative flex min-h-0 min-w-0 flex-1 flex-col", children: [topBar, stripRegion, _jsx("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", "data-slot": "product-shell-page", children: children })] })) : (_jsxs("div", { className: "grid min-h-0 min-w-0 flex-1 grid-rows-[auto_minmax(0,1fr)] gap-(--nc-guide) overflow-clip bg-border has-[>[data-slot=product-shell-strip]]:grid-rows-[auto_auto_minmax(0,1fr)]", "data-slot": "product-shell-inset", children: [topBar, stripRegion, _jsxs("div", { className: "group/product-shell-workspace flex min-h-0 min-w-0 flex-col overflow-clip bg-(--nc-material-workspace) has-[>[data-slot=product-shell-tabs-region]_[data-slot=tabs-nav-band]]:-mt-(--nc-guide)", "data-slot": "product-shell-workspace", children: [tabs ? (_jsx("div", { className: "min-w-0 shrink-0", "data-slot": "product-shell-tabs-region", children: isRegion(tabs) ? (_jsx(Fragment, { children: tabs.region }, "tabs-region")) : (_jsx(ProductShellTabs, { ...tabs })) })) : null, pageRegion] })] }))] }), aside ? _jsx(Fragment, { children: aside }, "aside") : null, isRegion(address) ? (_jsx(Fragment, { children: address.region }, "address-region")) : (_jsx(ProductShellAddress, { address: address ?? (isRegion(path) ? "" : path.map(crumbKey).join("\u0000")) }))] }) }));
|
|
@@ -433,6 +434,26 @@ export function ProductShellStrip(props) {
|
|
|
433
434
|
return _jsx(NoticeBanner, { ...props });
|
|
434
435
|
return (_jsx("div", { className: "min-w-0 bg-background p-3 md:px-4", "data-slot": "product-shell-strip", children: _jsx(NoticeBanner, { ...props }) }));
|
|
435
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* The assistant's toggle at the top bar's end: `ProductShell` draws it from its `assistant`, and a product renders it in that region. A 40 px outline button with her mark and name, secondary while her panel is open; it says whether the panel is open (`aria-expanded`) and which it is (`aria-controls`). When the panel closes from inside, by its Close or its sheet's, focus returns to the toggle, unless it has already moved elsewhere on the page.
|
|
439
|
+
*/
|
|
440
|
+
export function ProductShellAssistant({ label, mark, open, panel, onToggle, }) {
|
|
441
|
+
const toggle = useRef(null);
|
|
442
|
+
const wasOpen = useRef(open);
|
|
443
|
+
useEffect(() => {
|
|
444
|
+
const closed = wasOpen.current && !open;
|
|
445
|
+
wasOpen.current = open;
|
|
446
|
+
if (!closed)
|
|
447
|
+
return;
|
|
448
|
+
const focused = document.activeElement;
|
|
449
|
+
const lost = focused === null ||
|
|
450
|
+
focused === document.body ||
|
|
451
|
+
document.getElementById(panel)?.contains(focused) === true;
|
|
452
|
+
if (lost)
|
|
453
|
+
toggle.current?.focus();
|
|
454
|
+
}, [open, panel]);
|
|
455
|
+
return (_jsxs(Button, { "aria-controls": panel, "aria-expanded": open, className: "gap-2", "data-slot": "product-shell-assistant", onClick: onToggle, ref: toggle, size: "lg", type: "button", variant: open ? "secondary" : "outline", children: [mark, label] }));
|
|
456
|
+
}
|
|
436
457
|
function PlaceGroup({ group, headed, navigationId, collapsed, onChosen, }) {
|
|
437
458
|
const rows = group.loading ? (_jsx(PlaceSkeletons, { collapsed: collapsed })) : group.failed ? (_jsx(PlacesFailed, { collapsed: collapsed, message: group.failed })) : group.places.length === 0 && group.empty !== undefined ? (collapsed ? null : (_jsx(EmptyState, { kind: "nothingYet", message: group.empty, scope: "card" }))) : (_jsx(SidebarMenu, { children: group.places.map((place) => (_jsx(PlaceRow, { collapsed: collapsed, onChosen: onChosen, place: place }, place.id))) }));
|
|
438
459
|
return (_jsxs(SidebarGroup, { children: [group.label && headed ? _jsx(SidebarGroupLabel, { render: _jsx("h2", { children: group.label }) }) : null, _jsx("nav", { "aria-busy": group.loading === true, "aria-label": group.label, "aria-labelledby": group.label === undefined ? navigationId : undefined, children: _jsx(SidebarGroupContent, { children: rows }) })] }));
|