@nadicodeai/ui 12.1.208 → 12.1.209

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.
Files changed (36) hide show
  1. package/dist/components/account-menu.d.ts +40 -9
  2. package/dist/components/account-menu.d.ts.map +1 -1
  3. package/dist/components/account-menu.js +31 -15
  4. package/dist/components/empty-art.d.ts +5 -3
  5. package/dist/components/empty-art.d.ts.map +1 -1
  6. package/dist/components/empty-art.js +7 -4
  7. package/dist/components/product-shell.d.ts +132 -0
  8. package/dist/components/product-shell.d.ts.map +1 -0
  9. package/dist/components/product-shell.js +83 -0
  10. package/dist/components/sidebar-sections.d.ts +3 -1
  11. package/dist/components/sidebar-sections.d.ts.map +1 -1
  12. package/dist/components/sidebar-sections.js +9 -6
  13. package/dist/components/sidebar.d.ts +12 -8
  14. package/dist/components/sidebar.d.ts.map +1 -1
  15. package/dist/components/sidebar.js +12 -9
  16. package/dist/components/update-card.d.ts +37 -10
  17. package/dist/components/update-card.d.ts.map +1 -1
  18. package/dist/components/update-card.js +63 -15
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -0
  22. package/dist/internal/badge-frame.d.ts +1 -1
  23. package/dist/internal/command-runner.d.ts +10 -1
  24. package/dist/internal/command-runner.d.ts.map +1 -1
  25. package/dist/internal/command-runner.js +21 -3
  26. package/dist/showcase/specimens/feedback.d.ts.map +1 -1
  27. package/dist/showcase/specimens/feedback.js +1 -1
  28. package/dist/showcase/specimens/index.d.ts +1 -0
  29. package/dist/showcase/specimens/index.d.ts.map +1 -1
  30. package/dist/showcase/specimens/navigation.d.ts +2 -0
  31. package/dist/showcase/specimens/navigation.d.ts.map +1 -1
  32. package/dist/showcase/specimens/navigation.js +59 -2
  33. package/dist/showcase/usage.generated.d.ts +1 -1
  34. package/dist/showcase/usage.generated.d.ts.map +1 -1
  35. package/dist/showcase/usage.generated.js +27 -16
  36. package/package.json +2 -2
@@ -1,5 +1,6 @@
1
1
  import type { ComponentProps, ReactNode } from "react";
2
2
  import type { MenuCommand } from "./action-menu.js";
3
+ import { type IdentityMarkProps } from "./identity-mark.js";
3
4
  import { type MenuChoiceRowProps } from "./menu-choice-row.js";
4
5
  import type { PageCommandAction } from "./page-actions.js";
5
6
  import { type ResolvedMessage } from "./product-message.js";
@@ -26,6 +27,14 @@ export type AccountIdentity = {
26
27
  * menu's header shows it first.
27
28
  */
28
29
  notice?: ReactNode;
30
+ /**
31
+ * Whose it is when the account is a company's, not a person's, as Alveare
32
+ * Server's workspace on this computer: the company's mark in place of the
33
+ * picture and the initials.
34
+ */
35
+ mark?: Omit<Extract<IdentityMarkProps, {
36
+ kind: "company";
37
+ }>, "size" | "label">;
29
38
  };
30
39
  export type AccountMenuIdentityProps = {
31
40
  className?: string;
@@ -34,7 +43,7 @@ export type AccountMenuIdentityProps = {
34
43
  pictureOnly?: boolean;
35
44
  };
36
45
  /**
37
- * Whose account it is at the sidebar's foot, as Vercel draws it: the picture,
46
+ * Whose account it is at the sidebar's foot: the picture,
38
47
  * the name with any notice under it, and the three dots at the end. The
39
48
  * account menu's trigger draws it, and so does a sample of the Portal's column.
40
49
  */
@@ -42,6 +51,16 @@ export declare function AccountMenuIdentity({ className, identity, pictureOnly,
42
51
  export type AccountMenuCommand = MenuCommand & {
43
52
  /** A reading at the row's end: "62% left". */
44
53
  value?: ReactNode;
54
+ /**
55
+ * The command runs with the menu open, so its pending word and its outcome
56
+ * show on its row: Alveare Server's Check for updates.
57
+ */
58
+ keepsOpen?: boolean;
59
+ /** What the command found, under its row: a neutral line, or a failure in the error colour. */
60
+ outcome?: {
61
+ tone: "neutral" | "error";
62
+ message: ResolvedMessage;
63
+ } | null;
45
64
  };
46
65
  /** A product's own exclusive setting, in a submenu: Alveare's presence. */
47
66
  export type AccountMenuChoice = {
@@ -67,7 +86,19 @@ export type AccountMenuSignOut = {
67
86
  /** Sign out opens the product's own confirmation, so the menu closes and leaves focus to it. */
68
87
  confirms?: boolean;
69
88
  };
70
- export type AccountMenuProps = {
89
+ /** How the menu ends: Sign out, or, for a product with no account to leave, its own last command. */
90
+ type AccountMenuEnd = {
91
+ signOut: AccountMenuSignOut;
92
+ last?: never;
93
+ } | {
94
+ signOut?: never;
95
+ /**
96
+ * The product's last command in Sign out's place, as Alveare Server's Stop
97
+ * workspace; a destructive one stands after a divider in the error colour.
98
+ */
99
+ last: AccountMenuCommand;
100
+ };
101
+ export type AccountMenuProps = AccountMenuEnd & {
71
102
  identity: AccountIdentity;
72
103
  /** Names the trigger and the menu: "Account" reads "Account: Ada Rossi". */
73
104
  label: string;
@@ -83,7 +114,6 @@ export type AccountMenuProps = {
83
114
  leadingCommands?: readonly AccountMenuCommand[];
84
115
  /** The product's commands after its choices, above Sign out. */
85
116
  commands?: readonly AccountMenuCommand[];
86
- signOut: AccountMenuSignOut;
87
117
  /**
88
118
  * The trigger shows the picture alone, for a navigation rail drawn too narrow
89
119
  * for the name; the menu still opens on the whole identity.
@@ -99,11 +129,12 @@ export type AccountMenuProps = {
99
129
  * and the menu opening on that same identity with what they can do beneath it.
100
130
  *
101
131
  * @family Menus
102
- * @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the account's settings, Theme, Language, a product's own settings, its commands, and Sign out.
103
- * @instead A record's or a page's commands are an ActionMenu; a setting with more than a few options or one that needs a Save belongs on a SettingsPage.
104
- * @behaviour The menu opens 6 px above its trigger, 288 px wide, as Vercel's does: a header of the name and every line under it with the gear at its end and no picture, one divider, then 36 px rows, each its label leading and its icon or control trailing in muted ink: the product's leading commands first, Theme and Language as small round pills, the product's choices as submenus, the Settings row to the gear's destination, its other commands, each command with any reading before its icon, and Sign out last in the body colour, since signing out destroys nothing. Ruled by the owner on 16 October 2026; on 27 October 2026 the owner asked for the Settings row as well as the gear in every product, as Nadia had it since 19 October. Theme and Language apply at once and keep the menu open. While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation.
105
- * @words The menu's name ("Account"), the person's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Sign out" and "Signing out".
106
- * @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out is aria-busy and announced through a status; a failure is an alert.
132
+ * @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the account's settings, Theme, Language, a product's own settings, its commands, and Sign out. In Alveare Server, which has no account to leave, the company's workspace on this computer: its mark, its status, Theme, Language, Check for updates, Help, and Stop workspace last (nadicode decision). `ProductShell` draws it from its `account`; Alveare mounts it in Buzz's sidebar (nadicode decision, 6 November 2026).
133
+ * @instead A record's commands go to `RecordList` or `RecordCommands`, a page's to its composition's `actions`; a setting that changes what the product does is a draft on a `SettingsPage` until its card's Save (nadicode decision). A product never renders it outside `ProductShell`, which `nadicodeai/page-composition` refuses (nadicode decision).
134
+ * @behaviour The menu opens 6 px above its trigger, 288 px wide: a header of the name and every line under it with the gear at its end and no picture, one divider, then 36 px rows, each its label leading and its icon or control trailing in muted ink, in an order the component draws and the product never sets: the product's leading commands first, Theme and Language as small round pills, the product's choices as submenus, the Settings row to the gear's destination, its other commands, each command with any reading before its icon, and Sign out last in the body colour, since signing out destroys nothing (owner ruling, 16 October 2026; the Settings row as well as the gear, owner ruling, 27 October 2026). Theme and Language apply at once and keep the menu open, with no Save; a product with a Preferences page may also show them there, where they apply at once too (owner ruling, 6 November 2026). While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation (nadicode decision). A product with no account to leave ends on its own `last` command in Sign out's place; a destructive one, such as Stop workspace, stands after a divider in the error colour and carries its `confirm`, which the menu opens once it closes (nadicode decision). A command that `keepsOpen` runs with the menu open: it says its pending word, aria-busy, then its `outcome` under its row, a muted line or a failure in the error colour, until the menu closes (nadicode decision). A company's account (`identity.mark`) shows the company's `IdentityMark` at 20 px in the trigger in place of a person's picture (nadicode decision).
135
+ * @words The menu's name ("Account", "Workspace"), the account's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Check for updates", "Sign out" and "Signing out".
136
+ * @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out or command is aria-busy and announced through a status; a failure is an alert, a neutral outcome a status.
107
137
  */
108
- export declare function AccountMenu({ align, choices, commands, identity, label, language, leadingCommands, onOpenChange, pictureOnly, settings, side, signOut, theme, }: AccountMenuProps): import("react").JSX.Element;
138
+ export declare function AccountMenu({ align, choices, commands, identity, label, language, last, leadingCommands, onOpenChange, pictureOnly, settings, side, signOut, theme, }: AccountMenuProps): import("react").JSX.Element;
139
+ export {};
109
140
  //# sourceMappingURL=account-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"account-menu.d.ts","sourceRoot":"","sources":["../../src/components/account-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAkB5D,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAIjE,2FAA2F;AAC3F,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,S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E,SAAS,kBAAkB,EAAE,CAAC;IAChD,gEAAgE;IAChE,QAAQ,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC3C,iFAAiF;IACjF,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AAKF;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAe,EACf,OAAoB,EACpB,QAAsB,EACtB,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,eAA6B,EAC7B,YAAY,EACZ,WAAmB,EACnB,QAAQ,EACR,IAAY,EACZ,OAAO,EACP,KAAK,GACN,EAAE,gBAAgB,+BA0ElB"}
@@ -5,6 +5,7 @@ import { useCommandRunner } from "../internal/command-runner.js";
5
5
  import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
6
6
  import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "./dropdown-menu.js";
7
7
  import { FieldError } from "./field.js";
8
+ import { IdentityMark } from "./identity-mark.js";
8
9
  import { MenuChoiceRow } from "./menu-choice-row.js";
9
10
  import { PendingLabel } from "./pending-label.js";
10
11
  import { bodyBeyondTitle } from "./product-message.js";
@@ -12,12 +13,12 @@ import { ThemeModeMenu } from "./theme-mode-switcher.js";
12
13
  import { menuItemAction } from "../internal/record-menu-items.js";
13
14
  import { cn } from "../lib/utils.js";
14
15
  /**
15
- * Whose account it is at the sidebar's foot, as Vercel draws it: the picture,
16
+ * Whose account it is at the sidebar's foot: the picture,
16
17
  * the name with any notice under it, and the three dots at the end. The
17
18
  * account menu's trigger draws it, and so does a sample of the Portal's column.
18
19
  */
19
20
  export function AccountMenuIdentity({ className, identity, pictureOnly = false, }) {
20
- return (_jsxs("span", { className: cn("flex min-w-0 items-center gap-2 text-left text-sm", !pictureOnly && "flex-1", className), "data-slot": "account-menu-identity", children: [_jsxs(Avatar, { className: "size-5", decorative: true, size: "sm", children: [identity.image ? _jsx(AvatarImage, { alt: "", src: identity.image }) : null, _jsx(AvatarFallback, { children: identity.initials === undefined || identity.initials === "" ? (_jsx(UserRound, { "aria-hidden": "true", className: "size-3/5" })) : (identity.initials) })] }), pictureOnly ? null : (_jsxs(_Fragment, { children: [_jsxs("span", { className: "grid min-w-0 flex-1 leading-tight", children: [_jsx("span", { className: "truncate text-foreground", children: identity.name }), identity.notice ? _jsx("span", { className: "truncate text-xs", children: identity.notice }) : null] }), _jsx("span", { "aria-hidden": "true", className: "grid size-6 shrink-0 place-content-center rounded-full border border-border bg-popover text-muted-foreground transition-colors group-hover/account:text-foreground group-data-popup-open/account:text-foreground", children: _jsx(Ellipsis, { className: "size-3" }) })] }))] }));
21
+ return (_jsxs("span", { className: cn("flex min-w-0 items-center gap-2 text-left text-sm", !pictureOnly && "flex-1", className), "data-slot": "account-menu-identity", children: [identity.mark ? (_jsx(IdentityMark, { ...identity.mark, size: 20 })) : (_jsxs(Avatar, { className: "size-5", decorative: true, size: "sm", children: [identity.image ? _jsx(AvatarImage, { alt: "", src: identity.image }) : null, _jsx(AvatarFallback, { children: identity.initials === undefined || identity.initials === "" ? (_jsx(UserRound, { "aria-hidden": "true", className: "size-3/5" })) : (identity.initials) })] })), pictureOnly ? null : (_jsxs(_Fragment, { children: [_jsxs("span", { className: "grid min-w-0 flex-1 leading-tight", children: [_jsx("span", { className: "truncate text-foreground", children: identity.name }), identity.notice ? _jsx("span", { className: "truncate text-xs", children: identity.notice }) : null] }), _jsx("span", { "aria-hidden": "true", className: "grid size-6 shrink-0 place-content-center rounded-full border border-border bg-popover text-muted-foreground transition-colors group-hover/account:text-foreground group-data-popup-open/account:text-foreground", children: _jsx(Ellipsis, { className: "size-3" }) })] }))] }));
21
22
  }
22
23
  const NO_CHOICES = [];
23
24
  const NO_COMMANDS = [];
@@ -26,23 +27,38 @@ const NO_COMMANDS = [];
26
27
  * and the menu opening on that same identity with what they can do beneath it.
27
28
  *
28
29
  * @family Menus
29
- * @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the account's settings, Theme, Language, a product's own settings, its commands, and Sign out.
30
- * @instead A record's or a page's commands are an ActionMenu; a setting with more than a few options or one that needs a Save belongs on a SettingsPage.
31
- * @behaviour The menu opens 6 px above its trigger, 288 px wide, as Vercel's does: a header of the name and every line under it with the gear at its end and no picture, one divider, then 36 px rows, each its label leading and its icon or control trailing in muted ink: the product's leading commands first, Theme and Language as small round pills, the product's choices as submenus, the Settings row to the gear's destination, its other commands, each command with any reading before its icon, and Sign out last in the body colour, since signing out destroys nothing. Ruled by the owner on 16 October 2026; on 27 October 2026 the owner asked for the Settings row as well as the gear in every product, as Nadia had it since 19 October. Theme and Language apply at once and keep the menu open. While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation.
32
- * @words The menu's name ("Account"), the person's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Sign out" and "Signing out".
33
- * @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out is aria-busy and announced through a status; a failure is an alert.
30
+ * @when The account at the sidebar's foot in the Portal, Nadia and Alveare: the account's settings, Theme, Language, a product's own settings, its commands, and Sign out. In Alveare Server, which has no account to leave, the company's workspace on this computer: its mark, its status, Theme, Language, Check for updates, Help, and Stop workspace last (nadicode decision). `ProductShell` draws it from its `account`; Alveare mounts it in Buzz's sidebar (nadicode decision, 6 November 2026).
31
+ * @instead A record's commands go to `RecordList` or `RecordCommands`, a page's to its composition's `actions`; a setting that changes what the product does is a draft on a `SettingsPage` until its card's Save (nadicode decision). A product never renders it outside `ProductShell`, which `nadicodeai/page-composition` refuses (nadicode decision).
32
+ * @behaviour The menu opens 6 px above its trigger, 288 px wide: a header of the name and every line under it with the gear at its end and no picture, one divider, then 36 px rows, each its label leading and its icon or control trailing in muted ink, in an order the component draws and the product never sets: the product's leading commands first, Theme and Language as small round pills, the product's choices as submenus, the Settings row to the gear's destination, its other commands, each command with any reading before its icon, and Sign out last in the body colour, since signing out destroys nothing (owner ruling, 16 October 2026; the Settings row as well as the gear, owner ruling, 27 October 2026). Theme and Language apply at once and keep the menu open, with no Save; a product with a Preferences page may also show them there, where they apply at once too (owner ruling, 6 November 2026). While signing out, Sign out says its pending word, the menu stays open and the trigger is locked; a failure shows under it. A Sign out that `confirms` closes the menu instead, for the product's own confirmation (nadicode decision). A product with no account to leave ends on its own `last` command in Sign out's place; a destructive one, such as Stop workspace, stands after a divider in the error colour and carries its `confirm`, which the menu opens once it closes (nadicode decision). A command that `keepsOpen` runs with the menu open: it says its pending word, aria-busy, then its `outcome` under its row, a muted line or a failure in the error colour, until the menu closes (nadicode decision). A company's account (`identity.mark`) shows the company's `IdentityMark` at 20 px in the trigger in place of a person's picture (nadicode decision).
33
+ * @words The menu's name ("Account", "Workspace"), the account's name and lines, then each row's noun or verb from the product's catalogue: "Theme", "Language", "Usage", "Check for updates", "Sign out" and "Signing out".
34
+ * @access The trigger and the menu are named "{label}: {name}"; the gear carries its label; the pending sign-out or command is aria-busy and announced through a status; a failure is an alert, a neutral outcome a status.
34
35
  */
35
- export function AccountMenu({ align = "start", choices = NO_CHOICES, commands = NO_COMMANDS, identity, label, language, leadingCommands = NO_COMMANDS, onOpenChange, pictureOnly = false, settings, side = "top", signOut, theme, }) {
36
+ export function AccountMenu({ align = "start", choices = NO_CHOICES, commands = NO_COMMANDS, identity, label, language, last, leadingCommands = NO_COMMANDS, onOpenChange, pictureOnly = false, settings, side = "top", signOut, theme, }) {
36
37
  const name = `${label}: ${identity.name}`;
37
38
  const { arm, dialog } = useCommandRunner();
38
- const commandRows = (rows) => rows.map(arm).map(({ value, ...command }) => (_jsx(AccountMenuRow, { "aria-label": command.accessibleName, disabled: command.locked === true || command.disabledReason !== undefined, icon: command.icon, reason: command.locked ? command.reason : command.disabledReason, value: value, ...menuItemAction(command), children: command.label }, command.label)));
39
- return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { onOpenChange: onOpenChange, children: [_jsx(DropdownMenuTrigger, { "aria-label": name, className: cn("group/account flex min-h-9 min-w-0 items-center rounded-full outline-none focus-visible:nc-focus-outline focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50", pictureOnly ? "justify-center" : "w-full pr-2 pl-2.5"), disabled: signOut.pending, children: _jsx(AccountMenuIdentity, { identity: identity, pictureOnly: pictureOnly }) }), _jsxs(DropdownMenuContent, { align: align, "aria-label": name, className: "w-72 max-w-[calc(100vw-2rem)] p-1.5", density: "comfortable", side: side, sideOffset: 6, children: [_jsxs(DropdownMenuGroup, { className: "flex min-w-0 items-center gap-2 py-1.5 pl-2", "data-slot": "account-menu-header", children: [_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 text-left", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: identity.name }), identity.notice ? _jsx("span", { className: "text-xs", children: identity.notice }) : null, identity.lines?.map((line, index) => (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: line }, index)))] }), settings ? (_jsx(DropdownMenuItem, { "aria-label": settings.label, className: "text-muted-foreground", iconOnly: true, ...menuItemAction(settings), children: _jsx(Settings, { "aria-hidden": "true" }) })) : null] }), _jsx(DropdownMenuSeparator, { className: "-mx-1.5 my-1.5" }), _jsxs(DropdownMenuGroup, { children: [commandRows(leadingCommands), _jsx(ThemeModeMenu, { ...theme }), language ? _jsx(MenuChoiceRow, { ...language }) : null, choices.map((choice) => (_jsx(AccountMenuChoiceRow, { choice: choice }, choice.label))), settings ? (_jsx(AccountMenuRow, { icon: _jsx(Settings, {}), ...menuItemAction(settings), children: settings.label })) : null, commandRows(commands), _jsx(AccountMenuRow, { "aria-busy": signOut.pending || undefined, closeOnClick: signOut.confirms === true, disabled: signOut.pending, icon: _jsx(LogOut, {}), onClick: () => {
40
- if (!signOut.pending)
41
- signOut.onSignOut();
42
- }, children: _jsx(PendingLabel, { pending: signOut.pending, pendingLabel: signOut.pendingLabel, children: signOut.label }) }), signOut.pending ? (_jsx("span", { className: "sr-only", role: "status", children: signOut.pendingLabel })) : null, signOut.failure ? (_jsxs(FieldError, { className: "mx-2 mb-1 wrap-break-word", "data-message-code": signOut.failure.code, children: [_jsx("span", { className: "block font-medium", children: signOut.failure.title }), bodyBeyondTitle(signOut.failure) ? (_jsx("span", { className: "block", children: bodyBeyondTitle(signOut.failure) })) : null] })) : null] })] })] }), dialog] }));
39
+ const commandRows = (rows) => rows.map((command) => _jsx(AccountMenuCommandRow, { command: arm(command) }, command.label));
40
+ return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { onOpenChange: onOpenChange, children: [_jsx(DropdownMenuTrigger, { "aria-label": name, className: cn("group/account flex min-h-9 min-w-0 items-center rounded-full outline-none focus-visible:nc-focus-outline focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50", pictureOnly ? "justify-center" : "w-full pr-2 pl-2.5"), disabled: signOut?.pending === true, children: _jsx(AccountMenuIdentity, { identity: identity, pictureOnly: pictureOnly }) }), _jsxs(DropdownMenuContent, { align: align, "aria-label": name, className: "w-72 max-w-[calc(100vw-2rem)] p-1.5", density: "comfortable", side: side, sideOffset: 6, children: [_jsxs(DropdownMenuGroup, { className: "flex min-w-0 items-center gap-2 py-1.5 pl-2", "data-slot": "account-menu-header", children: [_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5 text-left", children: [_jsx("span", { className: "truncate text-sm font-medium text-foreground", children: identity.name }), identity.notice ? _jsx("span", { className: "text-xs", children: identity.notice }) : null, identity.lines?.map((line, index) => (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: line }, index)))] }), settings ? (_jsx(DropdownMenuItem, { "aria-label": settings.label, className: "text-muted-foreground", iconOnly: true, ...menuItemAction(settings), children: _jsx(Settings, { "aria-hidden": "true" }) })) : null] }), _jsx(DropdownMenuSeparator, { className: "-mx-1.5 my-1.5" }), _jsxs(DropdownMenuGroup, { children: [commandRows(leadingCommands), _jsx(ThemeModeMenu, { ...theme }), language ? _jsx(MenuChoiceRow, { ...language }) : null, choices.map((choice) => (_jsx(AccountMenuChoiceRow, { choice: choice }, choice.label))), settings ? (_jsx(AccountMenuRow, { icon: _jsx(Settings, {}), ...menuItemAction(settings), children: settings.label })) : null, commandRows(commands), signOut ? _jsx(AccountMenuSignOutRow, { signOut: signOut }) : null, last?.destructive ? _jsx(DropdownMenuSeparator, { className: "-mx-1.5 my-1.5" }) : null, last ? _jsx(AccountMenuCommandRow, { command: arm(last) }) : null] })] })] }), dialog] }));
43
41
  }
44
- function AccountMenuRow({ children, icon, reason, value, ...props }) {
45
- return (_jsxs(DropdownMenuItem, { ...props, className: "min-h-9 gap-3 px-2 py-1.5 group-data-[density=comfortable]/menu:px-2 group-data-[density=comfortable]/menu:py-1.5 [@media(hover:hover)_and_(pointer:fine)]:min-h-9", children: [_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5", children: [_jsx("span", { className: "truncate", children: children }), reason ? _jsx("span", { className: "text-xs text-muted-foreground", children: reason }) : null] }), value === undefined ? null : " ", value === undefined ? null : (_jsx(DropdownMenuShortcut, { className: "ml-0", children: value })), _jsx("span", { "aria-hidden": "true", className: "flex shrink-0 items-center text-muted-foreground", children: icon })] }));
42
+ function AccountMenuSignOutRow({ signOut }) {
43
+ return (_jsxs(_Fragment, { children: [_jsx(AccountMenuRow, { "aria-busy": signOut.pending || undefined, closeOnClick: signOut.confirms === true, disabled: signOut.pending, icon: _jsx(LogOut, {}), onClick: () => {
44
+ if (!signOut.pending)
45
+ signOut.onSignOut();
46
+ }, children: _jsx(PendingLabel, { pending: signOut.pending, pendingLabel: signOut.pendingLabel, children: signOut.label }) }), signOut.pending ? (_jsx("span", { className: "sr-only", role: "status", children: signOut.pendingLabel })) : null, signOut.failure ? (_jsx(AccountMenuOutcome, { outcome: { tone: "error", message: signOut.failure } })) : null] }));
47
+ }
48
+ function AccountMenuCommandRow({ command }) {
49
+ const { value, keepsOpen = false, outcome, ...action } = command;
50
+ const pending = action.pending === true;
51
+ const pendingLabel = action.pendingLabel ?? action.label;
52
+ return (_jsxs(_Fragment, { children: [_jsx(AccountMenuRow, { "aria-busy": pending || undefined, "aria-label": action.accessibleName, closeOnClick: !keepsOpen, destructive: action.destructive === true, disabled: pending || action.locked === true || action.disabledReason !== undefined, icon: action.icon, reason: action.locked ? action.reason : action.disabledReason, value: value, ...menuItemAction(action), children: _jsx(PendingLabel, { pending: pending, pendingLabel: pendingLabel, children: action.label }) }), pending ? (_jsx("span", { className: "sr-only", role: "status", children: pendingLabel })) : null, outcome ? _jsx(AccountMenuOutcome, { outcome: outcome }) : null] }));
53
+ }
54
+ function AccountMenuOutcome({ outcome }) {
55
+ const { message, tone } = outcome;
56
+ const body = bodyBeyondTitle(message);
57
+ const words = (_jsxs(_Fragment, { children: [_jsx("span", { className: "block font-medium", children: message.title }), body ? _jsx("span", { className: "block", children: body }) : null] }));
58
+ return tone === "error" ? (_jsx(FieldError, { className: "mx-2 mb-1 wrap-break-word", "data-message-code": message.code, children: words })) : (_jsx("p", { className: "mx-2 mb-1 text-xs wrap-break-word text-muted-foreground", "data-message-code": message.code, role: "status", children: words }));
59
+ }
60
+ function AccountMenuRow({ children, destructive = false, icon, reason, value, ...props }) {
61
+ return (_jsxs(DropdownMenuItem, { ...props, variant: destructive ? "destructive" : "default", className: "min-h-9 gap-3 px-2 py-1.5 group-data-[density=comfortable]/menu:px-2 group-data-[density=comfortable]/menu:py-1.5 [@media(hover:hover)_and_(pointer:fine)]:min-h-9", children: [_jsxs("span", { className: "grid min-w-0 flex-1 gap-0.5", children: [_jsx("span", { className: "truncate", children: children }), reason ? _jsx("span", { className: "text-xs text-muted-foreground", children: reason }) : null] }), value === undefined ? null : " ", value === undefined ? null : (_jsx(DropdownMenuShortcut, { className: "ml-0", children: value })), _jsx("span", { "aria-hidden": "true", className: cn("flex shrink-0 items-center", destructive ? "text-destructive-soft-foreground" : "text-muted-foreground"), children: icon })] }));
46
62
  }
47
63
  function AccountMenuChoiceRow({ choice }) {
48
64
  const current = choice.options.find((option) => option.value === choice.value);
@@ -8,10 +8,12 @@ export type EmptyArt = string & {
8
8
  };
9
9
  /**
10
10
  * The product's one map of the approved pictures, built from the design
11
- * system's imports; the bundler of each product decides their addresses.
11
+ * system's imports; the bundler of each product decides their addresses. A
12
+ * product that shows only some of them, as Alveare Server shows members,
13
+ * installations and agents, maps those alone, so its bundle carries no other.
12
14
  */
13
- export declare function approveEmptyArt(imported: Record<EmptyArtName, string | {
15
+ export declare function approveEmptyArt<Name extends EmptyArtName>(imported: Record<Name, string | {
14
16
  src: string;
15
- }>): Record<EmptyArtName, EmptyArt>;
17
+ }>): Record<Name, EmptyArt>;
16
18
  export {};
17
19
  //# sourceMappingURL=empty-art.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"empty-art.d.ts","sourceRoot":"","sources":["../../src/components/empty-art.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,eAAO,MAAM,eAAe,oOAqBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,MAAM,CAAC;AAEtC,qFAAqF;AACrF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GACvD,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAShC"}
1
+ {"version":3,"file":"empty-art.d.ts","sourceRoot":"","sources":["../../src/components/empty-art.ts"],"names":[],"mappings":"AAIA,iGAAiG;AACjG,eAAO,MAAM,eAAe,oOAqBlB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,MAAM,CAAC;AAEtC,qFAAqF;AACrF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAS,YAAY,EACvD,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAC/C,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAYxB"}
@@ -26,12 +26,15 @@ export const EMPTY_ART_NAMES = [
26
26
  ];
27
27
  /**
28
28
  * The product's one map of the approved pictures, built from the design
29
- * system's imports; the bundler of each product decides their addresses.
29
+ * system's imports; the bundler of each product decides their addresses. A
30
+ * product that shows only some of them, as Alveare Server shows members,
31
+ * installations and agents, maps those alone, so its bundle carries no other.
30
32
  */
31
33
  export function approveEmptyArt(imported) {
32
- // SAFETY: the map holds one entry per EMPTY_ART_NAMES name, each the address of that name's imported picture; approving those addresses is this function's job, and the brand has no runtime value.
33
- // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Object.fromEntries types its keys as string and EmptyArt is a brand with no runtime value; the map has one entry per EMPTY_ART_NAMES name.
34
- return Object.fromEntries(EMPTY_ART_NAMES.map((name) => {
34
+ const names = Object.keys(imported).filter((name) => EMPTY_ART_NAMES.some((approvedName) => approvedName === name));
35
+ // SAFETY: the map holds one entry per name the caller imported, each the address of that name's picture from the design system; approving those addresses is this function's job, and the brand has no runtime value.
36
+ // oxlint-disable-next-line typescript/no-unsafe-type-assertion -- Object.fromEntries types its keys as string and EmptyArt is a brand with no runtime value; the map has one entry per imported name.
37
+ return Object.fromEntries(names.map((name) => {
35
38
  const asset = imported[name];
36
39
  return [name, typeof asset === "string" ? asset : asset.src];
37
40
  }));
@@ -0,0 +1,132 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { type AccountMenuProps } from "./account-menu.js";
3
+ import type { IconComponent } from "./identity-mark.js";
4
+ import { type KbdKey } from "./kbd.js";
5
+ import { type NoticeBannerProps } from "./notice-banner.js";
6
+ import { SidebarEntryCard } from "./sidebar.js";
7
+ import { type SidebarSectionsProps } from "./sidebar-sections.js";
8
+ import { type UpdateCardProps } from "./update-card.js";
9
+ /** One place in the column: where it goes, by the product's router link or a press. */
10
+ export type ProductShellPlace = {
11
+ id: string;
12
+ /** The place's noun: "Agents", "Colleagues". */
13
+ label: string;
14
+ icon: IconComponent;
15
+ /** The place the page belongs to: drawn selected, `aria-current="page"`. */
16
+ current?: boolean;
17
+ /** How many things there wait for the person, as an attention count at the row's end, which the phone's menu button also carries. */
18
+ badge?: number;
19
+ /** The row opens an area whose pages swap the column for their `sections`: a chevron at its end. */
20
+ opensArea?: boolean;
21
+ } & ({
22
+ link: ReactElement;
23
+ onClick?: never;
24
+ } | {
25
+ onClick: () => void;
26
+ link?: never;
27
+ });
28
+ /** A group of places; its heading only when the column has more than one group. */
29
+ export type ProductShellPlaceGroup = {
30
+ id: string;
31
+ label?: string;
32
+ places: readonly ProductShellPlace[];
33
+ };
34
+ /** One step of the path: every step but the last carries its link; the last is the page. */
35
+ export type ProductShellCrumb = {
36
+ label: string;
37
+ link?: ReactElement;
38
+ };
39
+ /** The one band above the account: the update offer, or the way out of the product. */
40
+ export type ProductShellBand = {
41
+ update: UpdateCardProps;
42
+ entry?: never;
43
+ } | {
44
+ entry: Parameters<typeof SidebarEntryCard>[0];
45
+ update?: never;
46
+ };
47
+ /** The column's width, as the product keeps it with its preferences. */
48
+ export type ProductShellWidth = {
49
+ /** The expanded width in px it opens at, 224 to 384; 256 until the person drags it. */
50
+ value: number;
51
+ /** Whether it opens collapsed to its icons. */
52
+ collapsed: boolean;
53
+ /** Told the width and the collapse after each change, to keep them where the product keeps preferences. */
54
+ onChange: (next: {
55
+ value: number;
56
+ collapsed: boolean;
57
+ }) => void;
58
+ };
59
+ /** The shell's own words, from the product's catalogue. */
60
+ export type ProductShellLabels = {
61
+ /** The column's name, the title its phone-width sheet reads: "Alveare Server's places". */
62
+ navigation: string;
63
+ /** What the sheet holds, read after its title: "Choose a place." */
64
+ navigationDescription: string;
65
+ /** The phone's menu button, given how many things wait in the places: "Open the places, 1 waiting". */
66
+ openNavigation: (waiting: number) => string;
67
+ /** The sheet's Close. */
68
+ closeNavigation: string;
69
+ /** The control beside the header that collapses the column to its icons and opens it again. */
70
+ collapse: string;
71
+ /** The handle on the column's edge that drags it wider or narrower. */
72
+ resize: string;
73
+ /** The path's name: "Path". */
74
+ path: string;
75
+ };
76
+ type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
77
+ export type ProductShellProps = {
78
+ /** The product's name and its mark when it has its own; `link` leads home. */
79
+ home: {
80
+ product: string;
81
+ mark?: string;
82
+ link?: ReactElement;
83
+ };
84
+ /** The column's Find: its label, the key that opens it with ⌘ or Ctrl, which the product listens for, and what it opens. */
85
+ find?: {
86
+ label: string;
87
+ key: KbdKey;
88
+ onOpen: () => void;
89
+ };
90
+ band?: ProductShellBand;
91
+ /** The account menu at the column's foot; the shell decides its trigger's size and side. */
92
+ account: DistributiveOmit<AccountMenuProps, "pictureOnly" | "side" | "align">;
93
+ /** The bell beside the account, the product's notifications inbox. */
94
+ bell?: ReactElement;
95
+ /** The path to the page, drawn in the top bar. */
96
+ path: readonly ProductShellCrumb[];
97
+ /** The top bar's end: the product's assistant, as the Portal's Sofia. */
98
+ assistant?: ReactElement;
99
+ /** The shell's one persistent strip under the top bar, as the Portal's impersonation. */
100
+ strip?: NoticeBannerProps;
101
+ /** A panel beside the page, as Nadia's side panel. */
102
+ aside?: ReactElement;
103
+ /** A desktop window's own strip where its buttons sit over the page, as a Mac's, which moves the window: above the column, and above the top bar at phone width. */
104
+ titleBar?: ReactElement;
105
+ width: ProductShellWidth;
106
+ labels: ProductShellLabels;
107
+ /** The product's `<main />`, which the shell fills with the page and scrolls under the top bar: a page owns its landmarks, so no component renders one. */
108
+ main: ReactElement;
109
+ /** The page: a page composition. */
110
+ children: ReactNode;
111
+ } & ({
112
+ places: readonly ProductShellPlaceGroup[];
113
+ sections?: never;
114
+ }
115
+ /** An area's or an object's pages, which swap the places for theirs. */
116
+ | {
117
+ sections: Omit<SidebarSectionsProps<string>, "onChosen">;
118
+ places?: never;
119
+ });
120
+ /**
121
+ * A desktop or web product's frame: its navigation column, the top bar with the path, and the page.
122
+ *
123
+ * @family Navigation
124
+ * @when The frame of every product page in the Portal, Nadia and Alveare Server: the product's home, Find, its places or an area's sections, the update offer or the way out, and the account, beside the page with its path. Alveare keeps Buzz's sidebar and mounts the account menu and the update card in it (nadicode decision, 6 November 2026).
125
+ * @instead A product never draws `Sidebar`, `SidebarFrame`, `SidebarProvider`, `SidebarInset`, `AccountMenu` or `UpdateCard` itself, which `nadicodeai/page-composition` refuses: it passes its places, its account, its band and its path (nadicode decision). A page's own views are `Tabs`; an object's sections swap the column (`sections`) or stand in a `TabsNav` band under the top bar, never a second column (nadicode decision).
126
+ * @behaviour One column, its regions in this order: the home with the collapse control, Find, the places in their groups, one band (the update offer or the way out), then the account with the bell beside it (nadicode decision). The column is 256 px wide, dragged on its edge between 224 and 384 px, collapsed to 48 px of icons by its control, by the handle's Enter or by dragging it under the narrowest width, and a sheet under 768 px; the width and the collapse go to the product through `width.onChange`, and the shell opens at the ones it is given (owner ruling, 6 November 2026). Collapsed, the account shows its picture alone and the update card one icon. A place's badge counts what waits there in the attention colour, and the phone's menu button carries their sum. Choosing a place closes the sheet. Every confirmation a command in the frame opens is the shell's: it closes the sheet first, so one overlay never opens over another (nadicode decision). The top bar holds navigation only, never the page's commands: the menu button at phone width, the path, and the assistant at its end (nadicode decision). The path is the breadcrumb, never a back button in its place (nadicode decision). A new path opens its page at the top. The page scrolls under a top bar that stays.
127
+ * @words Every word is the product's: the places' nouns, the path's names exactly as the places and the records write them, and `labels` from its catalogue.
128
+ * @access The column is a landmark with the places as buttons or links, the current one `aria-current="page"`; the handle is a separator named by `labels.resize`; the page is the `main` landmark the product passes; the path is a navigation named by `labels.path`. The phone's menu button names how many things wait.
129
+ */
130
+ export declare function ProductShell(props: ProductShellProps): import("react").JSX.Element;
131
+ export {};
132
+ //# sourceMappingURL=product-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-shell.d.ts","sourceRoot":"","sources":["../../src/components/product-shell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAS/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAGL,gBAAgB,EAejB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG5E,uFAAuF;AACvF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,4EAA4E;IAC5E,OAAO,CAAC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,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,iBAAiB,CAAC;IACzB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,2JAA2J;IAC3J,IAAI,EAAE,YAAY,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,CACA;IAAE,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE;AACjE,wEAAwE;GACtE;IAAE,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CAAE,CAC/E,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAwBpD"}
@@ -0,0 +1,83 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { Fragment, useLayoutEffect, useRef, useState, } from "react";
5
+ import { AccountMenu } from "./account-menu.js";
6
+ import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "./breadcrumb.js";
7
+ import { Kbd } from "./kbd.js";
8
+ import { NoticeBanner } from "./notice-banner.js";
9
+ import { Sidebar, SidebarBrand, SidebarEntryCard, SidebarFind, SidebarFrame, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarInset, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuChevron, SidebarMenuItem, SidebarProvider, SidebarTrigger, useSidebar, } from "./sidebar.js";
10
+ import { SidebarSections } from "./sidebar-sections.js";
11
+ import { UpdateCard } from "./update-card.js";
12
+ import { CommandRunnerHost } from "../internal/command-runner.js";
13
+ /**
14
+ * A desktop or web product's frame: its navigation column, the top bar with the path, and the page.
15
+ *
16
+ * @family Navigation
17
+ * @when The frame of every product page in the Portal, Nadia and Alveare Server: the product's home, Find, its places or an area's sections, the update offer or the way out, and the account, beside the page with its path. Alveare keeps Buzz's sidebar and mounts the account menu and the update card in it (nadicode decision, 6 November 2026).
18
+ * @instead A product never draws `Sidebar`, `SidebarFrame`, `SidebarProvider`, `SidebarInset`, `AccountMenu` or `UpdateCard` itself, which `nadicodeai/page-composition` refuses: it passes its places, its account, its band and its path (nadicode decision). A page's own views are `Tabs`; an object's sections swap the column (`sections`) or stand in a `TabsNav` band under the top bar, never a second column (nadicode decision).
19
+ * @behaviour One column, its regions in this order: the home with the collapse control, Find, the places in their groups, one band (the update offer or the way out), then the account with the bell beside it (nadicode decision). The column is 256 px wide, dragged on its edge between 224 and 384 px, collapsed to 48 px of icons by its control, by the handle's Enter or by dragging it under the narrowest width, and a sheet under 768 px; the width and the collapse go to the product through `width.onChange`, and the shell opens at the ones it is given (owner ruling, 6 November 2026). Collapsed, the account shows its picture alone and the update card one icon. A place's badge counts what waits there in the attention colour, and the phone's menu button carries their sum. Choosing a place closes the sheet. Every confirmation a command in the frame opens is the shell's: it closes the sheet first, so one overlay never opens over another (nadicode decision). The top bar holds navigation only, never the page's commands: the menu button at phone width, the path, and the assistant at its end (nadicode decision). The path is the breadcrumb, never a back button in its place (nadicode decision). A new path opens its page at the top. The page scrolls under a top bar that stays.
20
+ * @words Every word is the product's: the places' nouns, the path's names exactly as the places and the records write them, and `labels` from its catalogue.
21
+ * @access The column is a landmark with the places as buttons or links, the current one `aria-current="page"`; the handle is a separator named by `labels.resize`; the page is the `main` landmark the product passes; the path is a navigation named by `labels.path`. The phone's menu button names how many things wait.
22
+ */
23
+ export function ProductShell(props) {
24
+ const { width } = props;
25
+ const [open, setOpen] = useState(!width.collapsed);
26
+ const kept = useRef({ value: width.value, collapsed: width.collapsed });
27
+ const keep = (change) => {
28
+ kept.current = { ...kept.current, ...change };
29
+ width.onChange(kept.current);
30
+ };
31
+ return (_jsx(SidebarProvider, { className: "h-svh min-h-0 overflow-hidden", "data-slot": "product-shell", defaultWidth: width.value, onOpenChange: (next) => {
32
+ setOpen(next);
33
+ keep({ collapsed: !next });
34
+ }, onWidthChange: (value) => keep({ value }), open: open, children: _jsx(Frame, { ...props }) }));
35
+ }
36
+ function Frame({ home, find, band, account, bell, path, assistant, strip, aside, titleBar, labels, main, children, places, sections, }) {
37
+ const { isMobile, state, setOpenMobile } = useSidebar();
38
+ const collapsed = state === "collapsed" && !isMobile;
39
+ const closeSheet = () => setOpenMobile(false);
40
+ const waiting = (places ?? [])
41
+ .flatMap((group) => group.places)
42
+ .reduce((sum, place) => sum + (place.badge ?? 0), 0);
43
+ const page = useRef(null);
44
+ const pageKey = path.map((crumb) => crumb.label).join("\u0000");
45
+ useLayoutEffect(() => {
46
+ // A new page opens at its top, whatever the last one was scrolled to.
47
+ if (page.current && pageKey)
48
+ page.current.scrollTop = 0;
49
+ }, [pageKey]);
50
+ const pageRegion = useRender({
51
+ defaultTagName: "div",
52
+ render: main,
53
+ ref: page,
54
+ props: {
55
+ className: "min-h-0 flex-1 overflow-auto",
56
+ children: (_jsx("div", { className: "mx-auto flex w-full min-w-0 max-w-5xl flex-col gap-6 px-4 py-6 md:p-8", children: children })),
57
+ },
58
+ state: { slot: "product-shell-page" },
59
+ });
60
+ const brand = _jsx(SidebarBrand, { mark: home.mark, product: home.product });
61
+ return (_jsxs(CommandRunnerHost, { onAsk: closeSheet, children: [_jsxs(Sidebar, { mobileCloseLabel: labels.closeNavigation, mobileDescription: labels.navigationDescription, mobileTitle: labels.navigation, resize: { "aria-label": labels.resize }, children: [isMobile ? null : titleBar, _jsx(SidebarFrame, { account: _jsx(AccountMenu, { ...account, pictureOnly: collapsed }), actions: bell, band: band ? _jsx(Band, { band: band, narrow: collapsed }) : undefined, find: find ? (_jsx(SidebarFind, { label: find.label, onClick: find.onOpen, shortcut: _jsx(Kbd, { keyName: find.key, meta: true, size: "sm" }) })) : null, header: home.link ? (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { className: "px-0", onClick: closeSheet, render: home.link, size: "lg", children: brand }) }) })) : (brand), toggle: _jsx(SidebarTrigger, { "aria-label": labels.collapse, className: "hidden shrink-0 md:inline-flex" }), children: places ? (places.map((group) => (_jsxs(SidebarGroup, { children: [group.label && places.length > 1 ? (_jsx(SidebarGroupLabel, { render: _jsx("h2", { children: group.label }) })) : null, _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: group.places.map((place) => (_jsx(PlaceRow, { onChosen: closeSheet, place: place }, place.id))) }) })] }, group.id)))) : sections ? (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarSections, { ...sections, narrow: collapsed, onChosen: closeSheet }) }) })) : null })] }), _jsxs(SidebarInset, { className: "h-full min-h-0 min-w-0", children: [isMobile ? titleBar : null, _jsxs("header", { className: "grid min-h-14 w-full min-w-0 shrink-0 grid-cols-[2rem_minmax(0,1fr)_auto] items-center gap-3 bg-background px-3 py-1 md:grid-cols-[minmax(0,1fr)_minmax(0,auto)_minmax(0,1fr)] md:px-8 md:py-0", "data-slot": "product-shell-top-bar", children: [_jsx("div", { className: "flex items-center md:hidden", children: _jsx(SidebarTrigger, { "aria-label": labels.openNavigation(waiting), attention: waiting, className: "-ml-1" }) }), _jsx("div", { className: "flex min-w-0 items-center justify-center md:col-start-2", children: _jsx(Path, { label: labels.path, path: path }) }), _jsx("div", { className: "flex items-center justify-end md:col-start-3", children: assistant })] }), strip ? _jsx(NoticeBanner, { ...strip }) : null, pageRegion] }), aside] }));
62
+ }
63
+ function PlaceRow({ place, onChosen }) {
64
+ const go = place.link
65
+ ? { render: place.link, onClick: onChosen }
66
+ : {
67
+ onClick: () => {
68
+ place.onClick();
69
+ onChosen();
70
+ },
71
+ };
72
+ return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { "aria-current": place.current ? "page" : undefined, isActive: place.current === true, tooltip: place.label, ...go, children: [_jsx(place.icon, {}), _jsx("span", { className: "truncate", children: place.label }), place.opensArea ? _jsx(SidebarMenuChevron, {}) : null] }), place.badge ? _jsx(SidebarMenuBadge, { tone: "attention", children: place.badge }) : null] }));
73
+ }
74
+ function Band({ band, narrow }) {
75
+ if (band.update)
76
+ return _jsx(UpdateCard, { ...band.update, narrow: narrow });
77
+ return (_jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarEntryCard, { ...band.entry }) }) }));
78
+ }
79
+ function Path({ path, label }) {
80
+ return (_jsx(Breadcrumb, { "aria-label": label, children: _jsx(BreadcrumbList, { children: path.map((crumb, index) => (_jsxs(Fragment
81
+ // A path is a fixed list per page, so the position is the identity.
82
+ , { children: [index > 0 ? _jsx(BreadcrumbSeparator, {}) : null, _jsx(BreadcrumbItem, { children: index === path.length - 1 ? (_jsx(BreadcrumbPage, { children: crumb.label })) : crumb.link ? (_jsx(BreadcrumbLink, { render: crumb.link, children: crumb.label })) : (_jsx(BreadcrumbLink, { disabled: true, children: crumb.label })) })] }, index))) }) }));
83
+ }
@@ -31,6 +31,8 @@ export type SidebarSectionsProps<Id extends string> = {
31
31
  current: Id;
32
32
  /** The rail is too narrow for words: icons, names in tooltips. */
33
33
  narrow?: boolean;
34
+ /** Runs after a section or the way back is chosen: the phone's navigation sheet closes. */
35
+ onChosen?: () => void;
34
36
  };
35
37
  /**
36
38
  * The sidebar swapped to one object or one area: the way back, what you are in, and its sections.
@@ -42,5 +44,5 @@ export type SidebarSectionsProps<Id extends string> = {
42
44
  * @words The back row names where it goes ("Agents", "Back to workspace"); the identity is the object's own name; an area's `label` is its sidebar row's word ("Settings", "Company"); a group heading names the kind of settings ("Account"), in sentence case; sections are nouns ("Skills", "Members").
43
45
  * @access The sections are a nav named by `label`; the current one carries aria-current="page". Without `identity` the back row is named by its `label` alone and the centred area name is read as text after it. The identity's mark is decorative beside its name.
44
46
  */
45
- export declare function SidebarSections<Id extends string>({ back, current, identity, label, narrow, sections, }: SidebarSectionsProps<Id>): import("react").JSX.Element;
47
+ export declare function SidebarSections<Id extends string>({ back, current, identity, label, narrow, onChosen, sections, }: SidebarSectionsProps<Id>): import("react").JSX.Element;
46
48
  //# sourceMappingURL=sidebar-sections.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar-sections.d.ts","sourceRoot":"","sources":["../../src/components/sidebar-sections.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,iBAAiB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAUnE,MAAM,MAAM,cAAc,CAAC,EAAE,SAAS,MAAM,IAAI,iBAAiB,GAAG;IAClE,EAAE,EAAE,EAAE,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,gIAAgI;IAChI,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+GAA+G;IAC/G,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,EAAE,SAAS,MAAM,IAAI;IACpD,gEAAgE;IAChE,IAAI,EAAE,iBAAiB,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAChE;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC;IACxC,OAAO,EAAE,EAAE,CAAC;IACZ,kEAAkE;IAClE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AA2BF;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,EACjD,I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eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,EACjD,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAc,EACd,QAAQ,EACR,QAAQ,GACT,EAAE,oBAAoB,CAAC,EAAE,CAAC,+BA2E1B"}
@@ -17,14 +17,17 @@ function groupSections(sections) {
17
17
  }
18
18
  return groups;
19
19
  }
20
- function actionProps(action, disabled = false) {
20
+ function actionProps(action, disabled, onChosen) {
21
21
  const element = action.render ?? action.link;
22
22
  if (element) {
23
- return { render: element, "aria-disabled": disabled || undefined };
23
+ return { render: element, "aria-disabled": disabled || undefined, onClick: onChosen };
24
24
  }
25
25
  return {
26
26
  disabled,
27
- onClick: action.onClick,
27
+ onClick: (event) => {
28
+ action.onClick?.(event);
29
+ onChosen?.();
30
+ },
28
31
  type: "button",
29
32
  };
30
33
  }
@@ -38,13 +41,13 @@ function actionProps(action, disabled = false) {
38
41
  * @words The back row names where it goes ("Agents", "Back to workspace"); the identity is the object's own name; an area's `label` is its sidebar row's word ("Settings", "Company"); a group heading names the kind of settings ("Account"), in sentence case; sections are nouns ("Skills", "Members").
39
42
  * @access The sections are a nav named by `label`; the current one carries aria-current="page". Without `identity` the back row is named by its `label` alone and the centred area name is read as text after it. The identity's mark is decorative beside its name.
40
43
  */
41
- export function SidebarSections({ back, current, identity, label, narrow = false, sections, }) {
44
+ export function SidebarSections({ back, current, identity, label, narrow = false, onChosen, sections, }) {
42
45
  const row = cn(narrow && "justify-center px-0");
43
46
  const words = cn("truncate", narrow && "sr-only");
44
47
  const submenu = identity === undefined;
45
- return (_jsxs("div", { className: "grid w-full gap-2", "data-slot": "sidebar-sections", children: [_jsx(SidebarMenu, { children: _jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { className: row, tooltip: back.label, ...actionProps(back, back.disabled), children: [submenu ? _jsx(ChevronLeft, { "aria-hidden": "true" }) : _jsx(ArrowLeft, { "aria-hidden": "true" }), _jsx("span", { className: submenu ? "sr-only" : words, children: back.label })] }), submenu && !narrow ? (_jsx("span", { className: "pointer-events-none absolute inset-x-8 top-1/2 -translate-y-1/2 truncate text-center text-sm font-medium text-sidebar-foreground", "data-slot": "sidebar-sections-title", children: label })) : null] }) }), narrow || !identity ? null : (_jsxs("div", { className: "flex min-w-0 items-center gap-2 px-2 pt-2 text-sm", "data-slot": "sidebar-sections-identity", children: [identity.mark ? _jsx(IdentityMark, { ...identity.mark, size: 24 }) : null, _jsxs("span", { className: "grid min-w-0", children: [_jsx("span", { className: "truncate font-medium text-sidebar-foreground", children: identity.name }), identity.detail ? (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: identity.detail })) : null] })] })), _jsx("nav", { "aria-label": label, className: "grid gap-2", children: groupSections(sections).map((group) => (_jsxs("div", { className: "grid gap-1", "data-slot": "sidebar-sections-group", children: [group.label && !narrow ? _jsx(SidebarGroupLabel, { children: group.label }) : null, _jsx(SidebarMenu, { children: group.sections.map((section) => {
48
+ return (_jsxs("div", { className: "grid w-full gap-2", "data-slot": "sidebar-sections", children: [_jsx(SidebarMenu, { children: _jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { className: row, tooltip: back.label, ...actionProps(back, back.disabled === true, onChosen), children: [submenu ? _jsx(ChevronLeft, { "aria-hidden": "true" }) : _jsx(ArrowLeft, { "aria-hidden": "true" }), _jsx("span", { className: submenu ? "sr-only" : words, children: back.label })] }), submenu && !narrow ? (_jsx("span", { className: "pointer-events-none absolute inset-x-8 top-1/2 -translate-y-1/2 truncate text-center text-sm font-medium text-sidebar-foreground", "data-slot": "sidebar-sections-title", children: label })) : null] }) }), narrow || !identity ? null : (_jsxs("div", { className: "flex min-w-0 items-center gap-2 px-2 pt-2 text-sm", "data-slot": "sidebar-sections-identity", children: [identity.mark ? _jsx(IdentityMark, { ...identity.mark, size: 24 }) : null, _jsxs("span", { className: "grid min-w-0", children: [_jsx("span", { className: "truncate font-medium text-sidebar-foreground", children: identity.name }), identity.detail ? (_jsx("span", { className: "truncate text-xs text-muted-foreground", children: identity.detail })) : null] })] })), _jsx("nav", { "aria-label": label, className: "grid gap-2", children: groupSections(sections).map((group) => (_jsxs("div", { className: "grid gap-1", "data-slot": "sidebar-sections-group", children: [group.label && !narrow ? _jsx(SidebarGroupLabel, { children: group.label }) : null, _jsx(SidebarMenu, { children: group.sections.map((section) => {
46
49
  const Icon = section.icon;
47
50
  const isCurrent = section.id === current;
48
- return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { "aria-current": isCurrent ? "page" : undefined, className: row, isActive: isCurrent, tooltip: section.label, ...actionProps(section), children: [submenu && !narrow ? null : _jsx(Icon, { "aria-hidden": "true" }), _jsx("span", { className: words, children: section.label })] }), section.count === undefined || narrow ? null : (_jsx(SidebarMenuBadge, { className: "text-muted-foreground", children: section.count }))] }, section.id));
51
+ return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { "aria-current": isCurrent ? "page" : undefined, className: row, isActive: isCurrent, tooltip: section.label, ...actionProps(section, false, onChosen), children: [submenu && !narrow ? null : _jsx(Icon, { "aria-hidden": "true" }), _jsx("span", { className: words, children: section.label })] }), section.count === undefined || narrow ? null : (_jsx(SidebarMenuBadge, { className: "text-muted-foreground", children: section.count }))] }, section.id));
49
52
  }) })] }, group.id))) })] }));
50
53
  }