@aeolus-fleet/common 0.35.0 → 0.36.0

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 (84) hide show
  1. package/README.md +3 -3
  2. package/dist/{header/apps.d.ts → rules/app-switcher.d.ts} +2 -5
  3. package/dist/{header/apps.js → rules/app-switcher.js} +1 -6
  4. package/dist/rules/app-switcher.js.map +1 -0
  5. package/dist/rules/index.d.ts +4 -1
  6. package/dist/rules/index.js +4 -1
  7. package/dist/rules/index.js.map +1 -1
  8. package/dist/rules/page-size.d.ts +7 -0
  9. package/dist/rules/page-size.js +7 -0
  10. package/dist/rules/page-size.js.map +1 -1
  11. package/dist/schemas/content-type.d.ts +2 -0
  12. package/dist/schemas/content-type.js +6 -0
  13. package/dist/schemas/content-type.js.map +1 -0
  14. package/dist/schemas/delivery.d.ts +91 -0
  15. package/dist/schemas/delivery.js +17 -0
  16. package/dist/schemas/delivery.js.map +1 -1
  17. package/dist/schemas/index.d.ts +2 -0
  18. package/dist/schemas/index.js +2 -0
  19. package/dist/schemas/index.js.map +1 -1
  20. package/dist/schemas/notice-message.d.ts +20 -0
  21. package/dist/schemas/notice-message.js +26 -0
  22. package/dist/schemas/notice-message.js.map +1 -0
  23. package/dist/schemas/page.d.ts +1 -1
  24. package/dist/schemas/page.js +1 -1
  25. package/dist/schemas/page.js.map +1 -1
  26. package/dist/schemas/question.js +1 -5
  27. package/dist/schemas/question.js.map +1 -1
  28. package/dist/schemas/step.d.ts +57 -0
  29. package/dist/schemas/step.js +54 -0
  30. package/dist/schemas/step.js.map +1 -0
  31. package/package.json +4 -44
  32. package/dist/header/app-header.d.ts +0 -27
  33. package/dist/header/app-header.js +0 -18
  34. package/dist/header/app-header.js.map +0 -1
  35. package/dist/header/app-switcher.d.ts +0 -20
  36. package/dist/header/app-switcher.js +0 -57
  37. package/dist/header/app-switcher.js.map +0 -1
  38. package/dist/header/apps.js.map +0 -1
  39. package/dist/header/atoms/avatar.d.ts +0 -16
  40. package/dist/header/atoms/avatar.js +0 -44
  41. package/dist/header/atoms/avatar.js.map +0 -1
  42. package/dist/header/atoms/button.d.ts +0 -22
  43. package/dist/header/atoms/button.js +0 -48
  44. package/dist/header/atoms/button.js.map +0 -1
  45. package/dist/header/atoms/dialog-surface.d.ts +0 -19
  46. package/dist/header/atoms/dialog-surface.js +0 -32
  47. package/dist/header/atoms/dialog-surface.js.map +0 -1
  48. package/dist/header/atoms/dialog.d.ts +0 -19
  49. package/dist/header/atoms/dialog.js +0 -37
  50. package/dist/header/atoms/dialog.js.map +0 -1
  51. package/dist/header/atoms/dropdown-menu.d.ts +0 -21
  52. package/dist/header/atoms/dropdown-menu.js +0 -42
  53. package/dist/header/atoms/dropdown-menu.js.map +0 -1
  54. package/dist/header/atoms/kbd.d.ts +0 -7
  55. package/dist/header/atoms/kbd.js +0 -11
  56. package/dist/header/atoms/kbd.js.map +0 -1
  57. package/dist/header/atoms/sheet.d.ts +0 -23
  58. package/dist/header/atoms/sheet.js +0 -52
  59. package/dist/header/atoms/sheet.js.map +0 -1
  60. package/dist/header/atoms/tooltip.d.ts +0 -10
  61. package/dist/header/atoms/tooltip.js +0 -24
  62. package/dist/header/atoms/tooltip.js.map +0 -1
  63. package/dist/header/avatar-entry.d.ts +0 -21
  64. package/dist/header/avatar-entry.js +0 -6
  65. package/dist/header/avatar-entry.js.map +0 -1
  66. package/dist/header/avatar-menu.d.ts +0 -43
  67. package/dist/header/avatar-menu.js +0 -111
  68. package/dist/header/avatar-menu.js.map +0 -1
  69. package/dist/header/class-names.d.ts +0 -3
  70. package/dist/header/class-names.js +0 -29
  71. package/dist/header/class-names.js.map +0 -1
  72. package/dist/header/command-palette.d.ts +0 -44
  73. package/dist/header/command-palette.js +0 -77
  74. package/dist/header/command-palette.js.map +0 -1
  75. package/dist/header/index.d.ts +0 -23
  76. package/dist/header/index.js +0 -24
  77. package/dist/header/index.js.map +0 -1
  78. package/dist/header/sign-in-background.d.ts +0 -10
  79. package/dist/header/sign-in-background.js +0 -48
  80. package/dist/header/sign-in-background.js.map +0 -1
  81. package/dist/header/sign-in-backgrounds.d.ts +0 -40
  82. package/dist/header/sign-in-backgrounds.js +0 -135
  83. package/dist/header/sign-in-backgrounds.js.map +0 -1
  84. package/dist/header/tokens.css +0 -154
@@ -1,23 +0,0 @@
1
- import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
2
- import { type VariantProps } from 'class-variance-authority';
3
- import type { ComponentProps } from 'react';
4
- /**
5
- * shadcn Sheet on Base UI Dialog (docs/design/png/Sheet.png). Right: the
6
- * desktop side sheet, 560 px, header with title, context and close, scrolling
7
- * body, footer. Bottom: the phone sheet for menus, filters and confirms, with a
8
- * handle, --radius-2xl top corners and full-width 44 px actions, Cancel last.
9
- * Under reduced motion it fades instead of sliding.
10
- */
11
- declare const sheetPopup: (props?: ({
12
- side?: "bottom" | "right" | null | undefined;
13
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
14
- declare function Sheet(props: SheetPrimitive.Root.Props): import("react").JSX.Element;
15
- declare function SheetTrigger(props: SheetPrimitive.Trigger.Props): import("react").JSX.Element;
16
- declare function SheetClose(props: SheetPrimitive.Close.Props): import("react").JSX.Element;
17
- declare function SheetContent({ className, children, side, ...props }: SheetPrimitive.Popup.Props & VariantProps<typeof sheetPopup>): import("react").JSX.Element;
18
- declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
19
- declare function SheetBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
20
- declare function SheetFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
21
- declare function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props): import("react").JSX.Element;
22
- declare function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): import("react").JSX.Element;
23
- export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
@@ -1,52 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Dialog as SheetPrimitive } from '@base-ui/react/dialog';
4
- import { cva } from 'class-variance-authority';
5
- import { XIcon } from 'lucide-react';
6
- import { classNames } from '../class-names.js';
7
- import { Button } from './button.js';
8
- /**
9
- * shadcn Sheet on Base UI Dialog (docs/design/png/Sheet.png). Right: the
10
- * desktop side sheet, 560 px, header with title, context and close, scrolling
11
- * body, footer. Bottom: the phone sheet for menus, filters and confirms, with a
12
- * handle, --radius-2xl top corners and full-width 44 px actions, Cancel last.
13
- * Under reduced motion it fades instead of sliding.
14
- */
15
- const sheetPopup = cva('fixed z-50 flex flex-col bg-popover text-body text-popover-foreground shadow-lg outline-none duration-(--duration-slow) ease-(--ease-standard) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', {
16
- variants: {
17
- side: {
18
- right: 'inset-y-0 right-0 h-full w-full border-l border-border sm:max-w-(--size-sheet) motion-safe:data-open:slide-in-from-right motion-safe:data-closed:slide-out-to-right',
19
- bottom: 'inset-x-0 bottom-0 max-h-[90dvh] rounded-t-2xl border-t border-border px-4 pt-2 pb-[max(calc(var(--spacing)*4),env(safe-area-inset-bottom))] motion-safe:data-open:slide-in-from-bottom motion-safe:data-closed:slide-out-to-bottom',
20
- },
21
- },
22
- defaultVariants: { side: 'right' },
23
- });
24
- function Sheet(props) {
25
- return _jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
26
- }
27
- function SheetTrigger(props) {
28
- return _jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
29
- }
30
- function SheetClose(props) {
31
- return _jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
32
- }
33
- function SheetContent({ className, children, side = 'right', ...props }) {
34
- return (_jsxs(SheetPrimitive.Portal, { children: [_jsx(SheetPrimitive.Backdrop, { "data-slot": "sheet-overlay", className: "fixed inset-0 z-50 bg-overlay duration-(--duration-slow) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0" }), _jsxs(SheetPrimitive.Popup, { "data-slot": "sheet-content", "data-side": side, className: classNames(sheetPopup({ side }), className), ...props, children: [side === 'bottom' ? (_jsx("div", { "aria-hidden": true, className: "mx-auto mb-3 h-1 w-9 shrink-0 rounded-full bg-border" })) : (_jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", render: _jsx(Button, { variant: "ghost", size: "sm", isIconOnly: true, className: "absolute top-4 right-4", "aria-label": "Close" }), children: _jsx(XIcon, {}) })), children] })] }));
35
- }
36
- function SheetHeader({ className, ...props }) {
37
- return (_jsx("div", { "data-slot": "sheet-header", className: classNames('flex flex-col gap-0.5 in-data-[side=right]:border-b in-data-[side=right]:px-6 in-data-[side=right]:py-5 in-data-[side=right]:pr-14', className), ...props }));
38
- }
39
- function SheetBody({ className, ...props }) {
40
- return (_jsx("div", { "data-slot": "sheet-body", className: classNames('min-h-0 flex-1 overflow-y-auto in-data-[side=right]:p-6', className), ...props }));
41
- }
42
- function SheetFooter({ className, ...props }) {
43
- return (_jsx("div", { "data-slot": "sheet-footer", className: classNames('flex flex-col-reverse gap-2 pt-3 in-data-[side=right]:flex-row in-data-[side=right]:justify-end in-data-[side=right]:border-t in-data-[side=right]:px-6 in-data-[side=right]:py-4', className), ...props }));
44
- }
45
- function SheetTitle({ className, ...props }) {
46
- return (_jsx(SheetPrimitive.Title, { "data-slot": "sheet-title", className: classNames('text-heading font-semibold text-foreground in-data-[side=bottom]:py-2 in-data-[side=bottom]:text-section', className), ...props }));
47
- }
48
- function SheetDescription({ className, ...props }) {
49
- return (_jsx(SheetPrimitive.Description, { "data-slot": "sheet-description", className: classNames('text-meta text-muted-foreground', className), ...props }));
50
- }
51
- export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, };
52
- //# sourceMappingURL=sheet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../../src/header/atoms/sheet.tsx"],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,iBACf,mBAAmB,EAC7B,SAAS,EAAE,UAAU,CAAC,iCAAiC,EAAE,SAAS,CAAC,KAC/D,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,CAAC"}
@@ -1,10 +0,0 @@
1
- import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
2
- /**
3
- * shadcn Tooltip on Base UI (docs/design/png/Tooltip.png). Supplementary only:
4
- * the same text is also the accessible name or visible elsewhere. None on phone.
5
- */
6
- declare function TooltipProvider({ delay, ...props }: TooltipPrimitive.Provider.Props): import("react").JSX.Element;
7
- declare function Tooltip(props: TooltipPrimitive.Root.Props): import("react").JSX.Element;
8
- declare function TooltipTrigger(props: TooltipPrimitive.Trigger.Props): import("react").JSX.Element;
9
- declare function TooltipContent({ className, side, sideOffset, align, ...props }: TooltipPrimitive.Popup.Props & Pick<TooltipPrimitive.Positioner.Props, 'align' | 'side' | 'sideOffset'>): import("react").JSX.Element;
10
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -1,24 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';
4
- import { classNames } from '../class-names.js';
5
- /** Hover waits this long before a tooltip opens; keyboard focus opens it at once. */
6
- const HOVER_DELAY_MS = 500;
7
- /**
8
- * shadcn Tooltip on Base UI (docs/design/png/Tooltip.png). Supplementary only:
9
- * the same text is also the accessible name or visible elsewhere. None on phone.
10
- */
11
- function TooltipProvider({ delay = HOVER_DELAY_MS, ...props }) {
12
- return _jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delay: delay, ...props });
13
- }
14
- function Tooltip(props) {
15
- return _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props });
16
- }
17
- function TooltipTrigger(props) {
18
- return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
19
- }
20
- function TooltipContent({ className, side = 'top', sideOffset = 6, align = 'center', ...props }) {
21
- return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { align: align, side: side, sideOffset: sideOffset, className: "isolate z-50 max-sm:hidden", children: _jsx(TooltipPrimitive.Popup, { "data-slot": "tooltip-content", className: classNames('w-fit max-w-xs origin-(--transform-origin) rounded-sm bg-foreground px-2 py-1 text-caption font-medium text-background shadow-md duration-(--duration-fast) data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }) }) }));
22
- }
23
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
24
- //# sourceMappingURL=tooltip.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../src/header/atoms/tooltip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,qFAAqF;AACrF,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B;;;GAGG;AACH,SAAS,eAAe,CAAC,EAAE,KAAK,GAAG,cAAc,EAAE,GAAG,KAAK,EAAmC;IAC5F,OAAO,KAAC,gBAAgB,CAAC,QAAQ,iBAAW,kBAAkB,EAAC,KAAK,EAAE,KAAK,KAAM,KAAK,GAAI,CAAC;AAC7F,CAAC;AAED,SAAS,OAAO,CAAC,KAAkC;IACjD,OAAO,KAAC,gBAAgB,CAAC,IAAI,iBAAW,SAAS,KAAK,KAAK,GAAI,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,KAAqC;IAC3D,OAAO,KAAC,gBAAgB,CAAC,OAAO,iBAAW,iBAAiB,KAAK,KAAK,GAAI,CAAC;AAC7E,CAAC;AAED,SAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,CAAC,EACd,KAAK,GAAG,QAAQ,EAChB,GAAG,KAAK,EACgG;IACxG,OAAO,CACL,KAAC,gBAAgB,CAAC,MAAM,cACtB,KAAC,gBAAgB,CAAC,UAAU,IAC1B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,SAAS,EAAC,4BAA4B,YAEtC,KAAC,gBAAgB,CAAC,KAAK,iBACX,iBAAiB,EAC3B,SAAS,EAAE,UAAU,CACnB,qPAAqP,EACrP,SAAS,CACV,KACG,KAAK,GACT,GAC0B,GACN,CAC3B,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}
@@ -1,21 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- /** An entry of the app's own in the avatar menu, such as Take the tour; phone-only ones stand in for what a tab bar lacks (H6). */
3
- export interface AvatarMenuEntry {
4
- key: string;
5
- label: string;
6
- icon: ReactNode;
7
- /** A link, or an action; one of the two. */
8
- href?: string;
9
- onSelect?: () => void;
10
- isPhoneOnly?: boolean;
11
- /** For an action whose work runs on the server, such as signing in as argo: what the entry says while it runs. Set, the menu stays open once it is picked. */
12
- workingLabel?: string;
13
- /** Whether that work runs now: the entry says its working label, with a spinner, and takes no second press. */
14
- isWorking?: boolean;
15
- }
16
- /** What the menu shows of an entry: its label, or its working label while its work runs, and whether picking it closes the menu. */
17
- export declare function shownEntryOf(entry: AvatarMenuEntry): {
18
- label: string;
19
- isWorking: boolean;
20
- shouldCloseMenu: boolean;
21
- };
@@ -1,6 +0,0 @@
1
- /** What the menu shows of an entry: its label, or its working label while its work runs, and whether picking it closes the menu. */
2
- export function shownEntryOf(entry) {
3
- const isWorking = entry.workingLabel !== undefined && entry.isWorking === true;
4
- return { label: isWorking && entry.workingLabel !== undefined ? entry.workingLabel : entry.label, isWorking, shouldCloseMenu: entry.workingLabel === undefined };
5
- }
6
- //# sourceMappingURL=avatar-entry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avatar-entry.js","sourceRoot":"","sources":["../../src/header/avatar-entry.ts"],"names":[],"mappings":"AAiBA,oIAAoI;AACpI,MAAM,UAAU,YAAY,CAAC,KAAsB;IACjD,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,KAAK,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IAC/E,OAAO,EAAE,KAAK,EAAE,SAAS,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;AACnK,CAAC"}
@@ -1,43 +0,0 @@
1
- import type { Theme } from '../index.js';
2
- import { type SignedInAs } from './apps.js';
3
- import { type AvatarMenuEntry } from './avatar-entry.js';
4
- /** A keyboard shortcut the app offers, for the Keyboard shortcuts dialog: its keys in order and what it does. */
5
- export interface Shortcut {
6
- keys: readonly string[];
7
- label: string;
8
- }
9
- export interface AvatarMenuProps {
10
- /** The account's name; undefined until known, or for argo's sign-in and the viewer, which go by those names. */
11
- name: string | undefined;
12
- /** How someone is signed in here (H10); undefined until known. */
13
- signedInAs: SignedInAs | undefined;
14
- /** This session, as the app words it ("Device · Mac · Chrome, since 08:02"); unset, no session line. */
15
- session?: string;
16
- /** Account's address from the apps list: set, the menu offers Your account, Your rights and Email updates (H8). */
17
- accountUrl?: string;
18
- /** The theme chosen; undefined while unknown, or for a sign-in that has none (the viewer). */
19
- theme: Theme | undefined;
20
- themes: readonly Theme[];
21
- /** Whether the menu offers the theme at all. */
22
- hasTheme: boolean;
23
- onThemeChange: (theme: Theme) => void;
24
- shortcuts: readonly Shortcut[];
25
- helpUrl: string;
26
- onSignOut: () => void;
27
- isSigningOut: boolean;
28
- entries?: readonly AvatarMenuEntry[];
29
- }
30
- /**
31
- * The avatar menu on desktop (header design H8, H10, H13): the avatar opens a
32
- * DropdownMenu with who is signed in here and how, the account's own pages
33
- * in Account, the app's entries, the theme (applied at once), keyboard
34
- * shortcuts, help and sign out, which shows "Signing out" until it ends.
35
- */
36
- export declare function AvatarMenu(props: AvatarMenuProps): import("react").JSX.Element;
37
- /**
38
- * The avatar menu on phone (H6): the avatar opens the same content as a
39
- * bottom Sheet, with the app's phone-only entries for what its tab bar
40
- * lacks, the theme as three buttons, and Cancel. No keyboard shortcuts on
41
- * phone.
42
- */
43
- export declare function AvatarMenuSheet(props: AvatarMenuProps): import("react").JSX.Element;
@@ -1,111 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { BellRing, CircleHelp, CircleUserRound, Keyboard, LaptopMinimal, LoaderCircle, LogOut, Monitor, Moon, ShieldCheck, Sun } from 'lucide-react';
4
- import { useState } from 'react';
5
- import { signedInAsOf } from './apps.js';
6
- import { shownEntryOf } from './avatar-entry.js';
7
- import { Avatar } from './atoms/avatar.js';
8
- import { Button } from './atoms/button.js';
9
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from './atoms/dialog.js';
10
- import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from './atoms/dropdown-menu.js';
11
- import { Kbd } from './atoms/kbd.js';
12
- import { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from './atoms/sheet.js';
13
- import { classNames } from './class-names.js';
14
- const THEME_LABELS = { light: 'Light', dark: 'Dark', system: 'System' };
15
- const THEME_ICONS = { light: Sun, dark: Moon, system: Monitor };
16
- /** The account's own pages in Account, from its address there. */
17
- function accountPagesOf(accountUrl) {
18
- return [
19
- { key: 'account', label: 'Your account', href: accountUrl, Icon: CircleUserRound },
20
- { key: 'rights', label: 'Your rights', href: `${accountUrl}/rights`, Icon: ShieldCheck },
21
- { key: 'updates', label: 'Email updates', href: `${accountUrl}/updates`, Icon: BellRing },
22
- ];
23
- }
24
- /** The name the avatar shows: the account's, or argo or the viewer by their own. */
25
- function displayNameOf(name, signedInAs) {
26
- if (name !== undefined) {
27
- return name;
28
- }
29
- return signedInAs === 'viewer' ? 'viewer' : signedInAs === 'argo' ? 'argo' : ' ';
30
- }
31
- function themeOf(value, themes) {
32
- return themes.find((theme) => theme === value);
33
- }
34
- /** Who is signed in here, and how (H10), with this session when the app words it. */
35
- function WhoHeader({ name, signedInAs, session }) {
36
- const shown = displayNameOf(name, signedInAs);
37
- return (_jsxs("div", { className: "flex flex-col gap-2 px-2.5 pt-2 pb-2.5", children: [_jsxs("div", { className: "flex items-center gap-2.5", children: [_jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }), _jsxs("span", { className: "flex min-w-0 flex-col", children: [_jsx("span", { className: "truncate text-body font-medium text-foreground", children: shown }), _jsx("span", { "data-testid": "avatar-menu-signed-in-as", className: "truncate text-caption text-muted-foreground", children: signedInAs === undefined ? ' ' : signedInAsOf(signedInAs) })] })] }), session === undefined ? null : (_jsxs("p", { "data-testid": "avatar-menu-session", className: "flex items-start gap-1.5 text-caption text-muted-foreground", children: [_jsx(LaptopMinimal, { "aria-hidden": true, className: "mt-px size-(--size-icon-sm) shrink-0" }), _jsxs("span", { children: ["This session: ", _jsx("span", { className: "font-medium text-foreground", children: session })] })] }))] }));
38
- }
39
- /** An entry's icon and label, or a spinner and its working label while its work runs. */
40
- function EntryContent({ entry }) {
41
- const shown = shownEntryOf(entry);
42
- return (_jsxs(_Fragment, { children: [shown.isWorking ? _jsx(LoaderCircle, { "aria-hidden": true, "data-testid": "avatar-menu-entry-spinner", className: "animate-spin motion-reduce:animate-none" }) : entry.icon, shown.label] }));
43
- }
44
- function SignOutLabel({ isSigningOut }) {
45
- return isSigningOut ? (_jsxs(_Fragment, { children: [_jsx(LoaderCircle, { "aria-hidden": true, className: "animate-spin motion-reduce:animate-none" }), "Signing out"] })) : (_jsxs(_Fragment, { children: [_jsx(LogOut, { "aria-hidden": true }), "Sign out"] }));
46
- }
47
- /** The app's keyboard shortcuts, desktop only: phone has no Kbd hints (H6). */
48
- function ShortcutsDialog({ isOpen, onOpenChange, shortcuts }) {
49
- return (_jsx(Dialog, { open: isOpen, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { size: "sm", "data-testid": "avatar-menu-shortcuts-dialog", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Keyboard shortcuts" }), _jsx(DialogDescription, { children: "What the keys do here." })] }), _jsx("ul", { className: "flex flex-col gap-2", children: shortcuts.map((shortcut) => (_jsxs("li", { className: "flex items-center justify-between gap-4 text-body text-foreground", children: [shortcut.label, _jsx("span", { className: "flex gap-1", children: shortcut.keys.map((key) => (_jsx(Kbd, { children: key }, key))) })] }, shortcut.label))) })] }) }));
50
- }
51
- /**
52
- * The avatar menu on desktop (header design H8, H10, H13): the avatar opens a
53
- * DropdownMenu with who is signed in here and how, the account's own pages
54
- * in Account, the app's entries, the theme (applied at once), keyboard
55
- * shortcuts, help and sign out, which shows "Signing out" until it ends.
56
- */
57
- export function AvatarMenu(props) {
58
- const { name, signedInAs, accountUrl, theme, themes, hasTheme, onThemeChange, shortcuts, helpUrl, onSignOut, isSigningOut, entries = [] } = props;
59
- const [isShortcutsOpen, setIsShortcutsOpen] = useState(false);
60
- const shown = displayNameOf(name, signedInAs);
61
- const label = `Account menu, ${shown}${signedInAs === undefined ? '' : `, ${signedInAsOf(signedInAs)}`}`;
62
- return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "data-testid": "avatar-menu", "aria-label": label, className: "inline-flex size-(--size-control) shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-2 focus-visible:outline-ring", children: _jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-64", children: [_jsx(WhoHeader, { name: name, signedInAs: signedInAs, session: props.session }), accountUrl === undefined
63
- ? null
64
- : accountPagesOf(accountUrl).map(({ key, label: pageLabel, href, Icon }) => (_jsxs(DropdownMenuItem, { "data-testid": `avatar-menu-${key}`, render: (itemProps) => (_jsx("a", { ...itemProps, href: href, children: itemProps.children })), children: [_jsx(Icon, { "aria-hidden": true }), pageLabel] }, key))), entries
65
- .filter((entry) => entry.isPhoneOnly !== true)
66
- .map((entry) => (_jsx(DropdownMenuItem, { "data-testid": `avatar-menu-${entry.key}`, disabled: shownEntryOf(entry).isWorking, closeOnClick: shownEntryOf(entry).shouldCloseMenu, onClick: entry.onSelect, ...(entry.href === undefined
67
- ? {}
68
- : {
69
- render: (itemProps) => (_jsx("a", { ...itemProps, href: entry.href, children: itemProps.children })),
70
- }), children: _jsx(EntryContent, { entry: entry }) }, entry.key))), hasTheme ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { children: "Theme" }), _jsx(DropdownMenuRadioGroup, { value: theme ?? null, onValueChange: (value) => {
71
- const picked = themeOf(value, themes);
72
- if (picked !== undefined) {
73
- onThemeChange(picked);
74
- }
75
- }, children: themes.map((option) => {
76
- const Icon = THEME_ICONS[option];
77
- return (_jsxs(DropdownMenuRadioItem, { value: option, disabled: theme === undefined, closeOnClick: false, "data-testid": `avatar-menu-theme-${option}`, children: [_jsx(Icon, { "aria-hidden": true }), THEME_LABELS[option]] }, option));
78
- }) })] })] })) : null, _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { "data-testid": "avatar-menu-shortcuts", onClick: () => {
79
- setIsShortcutsOpen(true);
80
- }, children: [_jsx(Keyboard, { "aria-hidden": true }), "Keyboard shortcuts"] }), _jsxs(DropdownMenuItem, { "data-testid": "avatar-menu-help", render: (itemProps) => (_jsx("a", { ...itemProps, href: helpUrl, target: "_blank", rel: "noreferrer", children: itemProps.children })), children: [_jsx(CircleHelp, { "aria-hidden": true }), "Help", _jsx("span", { className: "sr-only", children: " (opens in a new tab)" })] }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { "data-testid": "avatar-menu-sign-out", disabled: isSigningOut, closeOnClick: false, onClick: onSignOut, children: _jsx(SignOutLabel, { isSigningOut: isSigningOut }) })] })] }), _jsx(ShortcutsDialog, { isOpen: isShortcutsOpen, onOpenChange: setIsShortcutsOpen, shortcuts: shortcuts })] }));
81
- }
82
- const rowClass = 'flex h-(--size-control-touch) w-full items-center gap-2.5 border-t border-border pt-3 text-body-touch text-foreground outline-none focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60 [&_svg]:size-(--size-icon) [&_svg]:text-muted-foreground';
83
- /**
84
- * The avatar menu on phone (H6): the avatar opens the same content as a
85
- * bottom Sheet, with the app's phone-only entries for what its tab bar
86
- * lacks, the theme as three buttons, and Cancel. No keyboard shortcuts on
87
- * phone.
88
- */
89
- export function AvatarMenuSheet(props) {
90
- const { name, signedInAs, accountUrl, theme, themes, hasTheme, onThemeChange, helpUrl, onSignOut, isSigningOut, entries = [] } = props;
91
- const [isOpen, setIsOpen] = useState(false);
92
- const shown = displayNameOf(name, signedInAs);
93
- return (_jsxs(Sheet, { open: isOpen, onOpenChange: setIsOpen, children: [_jsx(SheetTrigger, { "data-testid": "avatar-menu", "aria-label": `Account menu, ${shown}${signedInAs === undefined ? '' : `, ${signedInAsOf(signedInAs)}`}`, className: "inline-flex size-(--size-control-touch) shrink-0 items-center justify-center rounded-full outline-none focus-visible:outline-2 focus-visible:outline-ring", children: _jsx(Avatar, { kind: signedInAs === 'argo' ? 'argo' : 'account', size: 28, name: shown }) }), _jsxs(SheetContent, { side: "bottom", "data-testid": "avatar-menu-sheet", className: "gap-3", children: [_jsx(SheetTitle, { className: "sr-only", children: "Account" }), _jsx(WhoHeader, { name: name, signedInAs: signedInAs, session: props.session }), accountUrl === undefined
94
- ? null
95
- : accountPagesOf(accountUrl).map(({ key, label, href, Icon }) => (_jsxs("a", { href: href, "data-testid": `avatar-menu-${key}`, className: rowClass, children: [_jsx(Icon, { "aria-hidden": true }), label] }, key))), entries.map((entry) => entry.href === undefined ? (_jsx("button", { type: "button", "data-testid": `avatar-menu-${entry.key}`, className: rowClass, disabled: shownEntryOf(entry).isWorking, onClick: () => {
96
- if (shownEntryOf(entry).shouldCloseMenu) {
97
- setIsOpen(false);
98
- }
99
- entry.onSelect?.();
100
- }, children: _jsx(EntryContent, { entry: entry }) }, entry.key)) : (_jsxs("a", { href: entry.href, "data-testid": `avatar-menu-${entry.key}`, className: rowClass, onClick: () => {
101
- setIsOpen(false);
102
- entry.onSelect?.();
103
- }, children: [entry.icon, entry.label] }, entry.key))), hasTheme ? (_jsxs("div", { role: "group", "aria-label": "Theme", className: "flex flex-col gap-1.5 border-t border-border pt-3", children: [_jsx("p", { className: "text-caption text-muted-foreground", children: "Theme" }), _jsx("div", { className: "grid grid-cols-3 gap-1 rounded-lg bg-muted p-1", children: themes.map((option) => {
104
- const Icon = THEME_ICONS[option];
105
- const isChosen = option === theme;
106
- return (_jsxs("button", { type: "button", "aria-pressed": isChosen, disabled: theme === undefined, "data-testid": `avatar-menu-theme-${option}`, onClick: () => {
107
- onThemeChange(option);
108
- }, className: classNames('inline-flex h-(--size-control-touch) items-center justify-center gap-1.5 rounded-md text-body-touch text-muted-foreground outline-none focus-visible:outline-2 focus-visible:outline-ring disabled:opacity-60 [&_svg]:size-(--size-icon)', isChosen ? 'bg-background text-foreground shadow-xs' : undefined), children: [_jsx(Icon, { "aria-hidden": true }), THEME_LABELS[option]] }, option));
109
- }) })] })) : null, _jsxs("a", { href: helpUrl, target: "_blank", rel: "noreferrer", "data-testid": "avatar-menu-help", className: rowClass, children: [_jsx(CircleHelp, { "aria-hidden": true }), "Help", _jsx("span", { className: "sr-only", children: " (opens in a new tab)" })] }), _jsx("button", { type: "button", "data-testid": "avatar-menu-sign-out", disabled: isSigningOut, onClick: onSignOut, className: rowClass, children: _jsx(SignOutLabel, { isSigningOut: isSigningOut }) }), _jsx(SheetClose, { render: _jsx(Button, { size: "touch", className: "w-full" }), children: "Cancel" })] })] }));
110
- }
111
- //# sourceMappingURL=avatar-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"avatar-menu.js","sourceRoot":"","sources":["../../src/header/avatar-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAmB,MAAM,cAAc,CAAC;AACtK,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAmB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAChO,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA8B9C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AAC,CAAC,CAAC,SAAS,CACjE,aAED,KAAC,IAAI,0BAAe,EACnB,YAAY,CAAC,MAAM,CAAC,KAdhB,MAAM,CAeJ,CACV,CAAC;gCACJ,CAAC,CAAC,GACE,IACF,CACP,CAAC,CAAC,CAAC,IAAI,EACR,aAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAC,QAAQ,EAAC,GAAG,EAAC,YAAY,iBAAa,kBAAkB,EAAC,SAAS,EAAE,QAAQ,aACnG,KAAC,UAAU,0BAAe,UAE1B,eAAM,SAAS,EAAC,SAAS,sCAA6B,IACpD,EACJ,iBAAQ,IAAI,EAAC,QAAQ,iBAAa,sBAAsB,EAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,YACtH,KAAC,YAAY,IAAC,YAAY,EAAE,YAAY,GAAI,GACrC,EACT,KAAC,UAAU,IAAC,MAAM,EAAE,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,QAAQ,GAAG,uBAAqB,IACtE,IACT,CACT,CAAC;AACJ,CAAC"}
@@ -1,3 +0,0 @@
1
- import { type ClassValue } from 'clsx';
2
- /** Joins class names, and lets a later Tailwind class win over an earlier one for the same property. */
3
- export declare function classNames(...inputs: ClassValue[]): string;
@@ -1,29 +0,0 @@
1
- import { clsx } from 'clsx';
2
- import { extendTailwindMerge } from 'tailwind-merge';
3
- /**
4
- * The text styles from tokens.css. tailwind-merge has to know they are font
5
- * sizes: otherwise it takes text-body for a colour and drops a text colour
6
- * written before it.
7
- */
8
- const TEXT_STYLES = [
9
- 'micro',
10
- 'caption',
11
- 'meta',
12
- 'body',
13
- 'section',
14
- 'body-touch',
15
- 'input-touch',
16
- 'heading',
17
- 'heading-touch',
18
- 'title',
19
- 'title-touch',
20
- 'metric',
21
- 'id',
22
- 'code',
23
- ];
24
- const merge = extendTailwindMerge({ extend: { theme: { text: TEXT_STYLES } } });
25
- /** Joins class names, and lets a later Tailwind class win over an earlier one for the same property. */
26
- export function classNames(...inputs) {
27
- return merge(clsx(inputs));
28
- }
29
- //# sourceMappingURL=class-names.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"class-names.js","sourceRoot":"","sources":["../../src/header/class-names.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,GAAG;IAClB,OAAO;IACP,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,YAAY;IACZ,aAAa;IACb,SAAS;IACT,eAAe;IACf,OAAO;IACP,aAAa;IACb,QAAQ;IACR,IAAI;IACJ,MAAM;CACP,CAAC;AAEF,MAAM,KAAK,GAAG,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;AAEhF,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,GAAG,MAAoB;IAChD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,44 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- /**
3
- * One entry of the palette: what it shows, and where it goes. An entry with
4
- * an href opens another app: the browser leaves, so the palette stays open
5
- * and says "Opening ..." until it does. Any other entry is handed to
6
- * onSelect and the palette closes.
7
- */
8
- export interface CommandEntry {
9
- key: string;
10
- content: ReactNode;
11
- href?: string;
12
- /** The name "Opening ..." uses for an entry with an href. */
13
- name?: string;
14
- }
15
- export interface CommandGroup {
16
- key: string;
17
- label: string;
18
- entries: readonly CommandEntry[];
19
- }
20
- export interface CommandPaletteProps {
21
- isOpen: boolean;
22
- onOpenChange: (isOpen: boolean) => void;
23
- /** The groups to show for what is typed: the app filters, and leaves out an empty group. */
24
- groupsOf: (query: string) => readonly CommandGroup[];
25
- onSelect: (key: string) => void;
26
- /** The search field's name and placeholder: "Search ships or jump to". */
27
- label: string;
28
- /** What to say when nothing matches what is typed. */
29
- emptyMessage: (query: string) => string;
30
- /** While the entries load, rows in their shape stand in. */
31
- isLoading?: boolean;
32
- /** What the search starts with when it opens; empty when not given. For stories. */
33
- initialQuery?: string;
34
- /** Each change of the query as typed, so the app can ask the server for what matches. */
35
- onQueryChange?: (query: string) => void;
36
- }
37
- /**
38
- * The command palette (header design, docs/design/png/CommandPalette.png):
39
- * search, then the app's groups of entries, filtered as you type. Arrow keys
40
- * move, Enter opens, Escape closes. Desktop: a dialog near the top, opened
41
- * with ⌘K or the header's search. Phone: the search icon opens it full
42
- * screen (H6). While the entries load, rows in their shape stand in.
43
- */
44
- export declare function CommandPalette({ isOpen, onOpenChange, ...body }: CommandPaletteProps): import("react").JSX.Element;
@@ -1,77 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { CornerDownLeft, LoaderCircle, Search } from 'lucide-react';
4
- import { useId, useState } from 'react';
5
- import { Button } from './atoms/button.js';
6
- import { Dialog, DialogClose, DialogContent, DialogTitle } from './atoms/dialog.js';
7
- import { dialogSurface } from './atoms/dialog-surface.js';
8
- import { Kbd } from './atoms/kbd.js';
9
- import { classNames } from './class-names.js';
10
- /** Rows standing in while the entries load. */
11
- const SKELETON_ROWS = 4;
12
- function LoadingRows() {
13
- return (_jsx("ul", { "aria-label": "Loading", "aria-busy": true, "data-testid": "command-palette-loading", className: "flex flex-col gap-1 p-1", children: Array.from({ length: SKELETON_ROWS }, (_, row) => `row-${String(row)}`).map((row) => (_jsxs("li", { className: "flex h-(--size-control) items-center gap-2.5 px-2.5 max-sm:h-(--size-control-touch)", children: [_jsx("span", { className: "size-5 shrink-0 animate-pulse rounded-full bg-muted motion-reduce:animate-none" }), _jsx("span", { className: "h-3 w-40 animate-pulse rounded bg-muted motion-reduce:animate-none" })] }, row))) }));
14
- }
15
- /** The open palette: its query, the entry the keys move to and the one opening live here, so each opening starts fresh. */
16
- function PaletteBody({ groupsOf, onSelect, onOpenChange, label, emptyMessage, isLoading = false, initialQuery = '', onQueryChange }) {
17
- const listId = useId();
18
- const optionId = useId();
19
- const [query, setQuery] = useState(initialQuery);
20
- const [activeIndex, setActiveIndex] = useState(0);
21
- const [opening, setOpening] = useState(undefined);
22
- const groups = groupsOf(query);
23
- const entries = groups.flatMap((group) => group.entries);
24
- const active = entries[Math.min(activeIndex, entries.length - 1)];
25
- const idOf = (entry) => `${optionId}-${entry.key}`;
26
- const choose = (entry) => {
27
- if (opening !== undefined) {
28
- return;
29
- }
30
- if (entry.href !== undefined) {
31
- setOpening(entry);
32
- window.location.assign(entry.href);
33
- return;
34
- }
35
- onSelect(entry.key);
36
- onOpenChange(false);
37
- };
38
- const onKeyDown = (event) => {
39
- if (entries.length === 0) {
40
- return;
41
- }
42
- if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
43
- event.preventDefault();
44
- const step = event.key === 'ArrowDown' ? 1 : -1;
45
- const current = active ? entries.indexOf(active) : 0;
46
- setActiveIndex((current + step + entries.length) % entries.length);
47
- }
48
- else if (event.key === 'Enter' && active) {
49
- event.preventDefault();
50
- choose(active);
51
- }
52
- };
53
- return (_jsxs(_Fragment, { children: [_jsx(DialogTitle, { className: "sr-only", children: label }), _jsxs("div", { className: "flex h-12 items-center gap-2.5 border-b border-border px-4 max-sm:h-(--size-header)", children: [_jsx(Search, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 text-muted-foreground" }), _jsx("input", { role: "combobox", "aria-expanded": true, "aria-controls": listId, "aria-activedescendant": active ? idOf(active) : undefined, "aria-autocomplete": "list", "aria-label": label, autoComplete: "off", autoCapitalize: "off", spellCheck: false, placeholder: label, disabled: opening !== undefined, "data-testid": "command-palette-input", className: "h-full min-w-0 grow bg-transparent text-body text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-60 max-sm:text-body-touch", value: query, onChange: (event) => {
54
- setQuery(event.target.value);
55
- setActiveIndex(0);
56
- onQueryChange?.(event.target.value);
57
- }, onKeyDown: onKeyDown }), _jsx(Kbd, { children: "esc" }), _jsx(DialogClose, { render: _jsx(Button, { variant: "ghost", size: "sm", className: "sm:hidden" }), children: "Cancel" })] }), _jsxs("div", { className: "max-h-[min(60dvh,var(--spacing)*100)] overflow-y-auto p-2 max-sm:max-h-none max-sm:grow", children: [entries.length === 0 && isLoading ? _jsx(LoadingRows, {}) : null, entries.length === 0 && !isLoading ? _jsx("p", { className: "px-4 py-6 text-center text-meta text-muted-foreground", children: emptyMessage(query.trim()) }) : null, entries.length === 0 ? null : (_jsx("ul", { id: listId, role: "listbox", "aria-label": "Results", className: "flex flex-col gap-2", children: groups.map((group) => (_jsxs("li", { role: "presentation", className: "flex flex-col gap-0.5", children: [_jsx("p", { id: `${listId}-${group.key}`, className: "px-2.5 pt-1 pb-0.5 text-caption font-medium text-muted-foreground", children: group.label }), _jsx("ul", { role: "group", "aria-labelledby": `${listId}-${group.key}`, className: "flex flex-col gap-0.5", children: group.entries.map((entry) => {
58
- const isActive = entry === active;
59
- const isOpening = entry === opening;
60
- return (_jsx("li", { id: idOf(entry), role: "option", "aria-selected": isActive, "aria-disabled": opening !== undefined && !isOpening ? true : undefined, "data-testid": "command-palette-item", "data-item-key": entry.key, className: classNames('flex h-(--size-control) cursor-pointer items-center gap-2.5 rounded-md px-2.5 text-body text-foreground aria-disabled:opacity-60 max-sm:h-(--size-control-touch)', isActive ? 'bg-accent' : undefined), onPointerMove: () => {
61
- setActiveIndex(entries.indexOf(entry));
62
- }, onClick: () => {
63
- choose(entry);
64
- }, children: isOpening ? (_jsxs(_Fragment, { children: [_jsx(LoaderCircle, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 animate-spin text-muted-foreground motion-reduce:animate-none" }), _jsxs("span", { className: "min-w-0 truncate", children: ["Opening ", entry.name ?? ''] })] })) : (entry.content) }, entry.key));
65
- }) })] }, group.key))) }))] }), _jsxs("div", { className: "flex items-center gap-3 border-t border-border px-4 py-2 text-caption text-muted-foreground max-sm:hidden", children: [_jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: "\u2191" }), _jsx(Kbd, { children: "\u2193" }), "Move"] }), _jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: _jsx(CornerDownLeft, { "aria-hidden": true, className: "size-3" }) }), "Open"] }), _jsxs("span", { className: "inline-flex items-center gap-1", children: [_jsx(Kbd, { children: "esc" }), "Close"] })] })] }));
66
- }
67
- /**
68
- * The command palette (header design, docs/design/png/CommandPalette.png):
69
- * search, then the app's groups of entries, filtered as you type. Arrow keys
70
- * move, Enter opens, Escape closes. Desktop: a dialog near the top, opened
71
- * with ⌘K or the header's search. Phone: the search icon opens it full
72
- * screen (H6). While the entries load, rows in their shape stand in.
73
- */
74
- export function CommandPalette({ isOpen, onOpenChange, ...body }) {
75
- return (_jsx(Dialog, { open: isOpen, onOpenChange: onOpenChange, children: _jsx(DialogContent, { size: "md", "data-testid": "command-palette", className: classNames('gap-0 p-0 sm:top-[12dvh] sm:translate-y-0', dialogSurface.phoneFullScreen, 'max-sm:flex max-sm:flex-col'), children: _jsx(PaletteBody, { onOpenChange: onOpenChange, ...body }) }) }));
76
- }
77
- //# sourceMappingURL=command-palette.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../src/header/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,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AAC,YAAY,EAAE,YAAY,KAAM,IAAI,GAAI,GACvC,GACT,CACV,CAAC;AACJ,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * The header every Aeolus web app shows, and the atoms it stands on (header
3
- * design H2): React parts, props only, client-safe (decision 0033). Each app
4
- * imports its styles from `@aeolus-fleet/common/header/tokens.css` and scans
5
- * this subpath for Tailwind classes.
6
- */
7
- export * from './atoms/avatar.js';
8
- export * from './atoms/button.js';
9
- export * from './atoms/dialog.js';
10
- export * from './atoms/dialog-surface.js';
11
- export * from './atoms/dropdown-menu.js';
12
- export * from './atoms/kbd.js';
13
- export * from './atoms/sheet.js';
14
- export * from './atoms/tooltip.js';
15
- export * from './class-names.js';
16
- export * from './app-header.js';
17
- export * from './app-switcher.js';
18
- export * from './apps.js';
19
- export * from './avatar-entry.js';
20
- export * from './avatar-menu.js';
21
- export * from './command-palette.js';
22
- export * from './sign-in-background.js';
23
- export * from './sign-in-backgrounds.js';
@@ -1,24 +0,0 @@
1
- /**
2
- * The header every Aeolus web app shows, and the atoms it stands on (header
3
- * design H2): React parts, props only, client-safe (decision 0033). Each app
4
- * imports its styles from `@aeolus-fleet/common/header/tokens.css` and scans
5
- * this subpath for Tailwind classes.
6
- */
7
- export * from './atoms/avatar.js';
8
- export * from './atoms/button.js';
9
- export * from './atoms/dialog.js';
10
- export * from './atoms/dialog-surface.js';
11
- export * from './atoms/dropdown-menu.js';
12
- export * from './atoms/kbd.js';
13
- export * from './atoms/sheet.js';
14
- export * from './atoms/tooltip.js';
15
- export * from './class-names.js';
16
- export * from './app-header.js';
17
- export * from './app-switcher.js';
18
- export * from './apps.js';
19
- export * from './avatar-entry.js';
20
- export * from './avatar-menu.js';
21
- export * from './command-palette.js';
22
- export * from './sign-in-background.js';
23
- export * from './sign-in-backgrounds.js';
24
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/header/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type SignInBackgroundName } from './sign-in-backgrounds.js';
2
- /**
3
- * The ground of a signed-out screen (docs/design/sign-in-backgrounds): one of
4
- * the six backgrounds, picked at random at load, covering its positioned
5
- * parent behind the card. Without a background named, it shows the one picked.
6
- */
7
- export declare function SignInBackground({ background, className }: {
8
- background?: SignInBackgroundName;
9
- className?: string;
10
- }): import("react").JSX.Element | null;