@aeolus-fleet/ui 0.39.0 → 0.40.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.
- package/dist/atoms/checkbox.d.ts +2 -1
- package/dist/atoms/checkbox.js +3 -2
- package/dist/atoms/checkbox.js.map +1 -1
- package/dist/atoms/toast.d.ts +5 -1
- package/dist/atoms/toast.js +6 -2
- package/dist/atoms/toast.js.map +1 -1
- package/dist/first-paint-theme.d.ts +15 -0
- package/dist/first-paint-theme.js +29 -0
- package/dist/first-paint-theme.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/molecules/avatar-menu.d.ts +2 -1
- package/dist/molecules/avatar-menu.js +6 -3
- package/dist/molecules/avatar-menu.js.map +1 -1
- package/dist/molecules/harbour-group.d.ts +9 -0
- package/dist/molecules/harbour-group.js +8 -6
- package/dist/molecules/harbour-group.js.map +1 -1
- package/dist/molecules/harbour-tile.d.ts +20 -1
- package/dist/molecules/harbour-tile.js +46 -5
- package/dist/molecules/harbour-tile.js.map +1 -1
- package/dist/molecules/status-badge.d.ts +29 -6
- package/dist/molecules/status-badge.js +20 -7
- package/dist/molecules/status-badge.js.map +1 -1
- package/dist/molecules/typed-confirm.d.ts +8 -2
- package/dist/molecules/typed-confirm.js +10 -4
- package/dist/molecules/typed-confirm.js.map +1 -1
- package/dist/organisms/command-palette.d.ts +14 -2
- package/dist/organisms/command-palette.js +63 -4
- package/dist/organisms/command-palette.js.map +1 -1
- package/dist/organisms/harbour.js +2 -2
- package/dist/organisms/harbour.js.map +1 -1
- package/package.json +2 -2
package/dist/atoms/checkbox.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox';
|
|
|
2
2
|
/**
|
|
3
3
|
* shadcn Checkbox on Base UI, themed to docs/design/png/Checkbox.png: one
|
|
4
4
|
* choice among several in a form. Checked fills with --primary. The label sits
|
|
5
|
-
* to the right, outside this atom.
|
|
5
|
+
* to the right, outside this atom. aria-invalid draws the invalid border and
|
|
6
|
+
* ring, as Input does. A single instant setting uses Switch.
|
|
6
7
|
*/
|
|
7
8
|
export declare function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props): import("react").JSX.Element;
|
package/dist/atoms/checkbox.js
CHANGED
|
@@ -6,9 +6,10 @@ import { classNames } from '../class-names.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* shadcn Checkbox on Base UI, themed to docs/design/png/Checkbox.png: one
|
|
8
8
|
* choice among several in a form. Checked fills with --primary. The label sits
|
|
9
|
-
* to the right, outside this atom.
|
|
9
|
+
* to the right, outside this atom. aria-invalid draws the invalid border and
|
|
10
|
+
* ring, as Input does. A single instant setting uses Switch.
|
|
10
11
|
*/
|
|
11
12
|
export function Checkbox({ className, ...props }) {
|
|
12
|
-
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: classNames('peer inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card text-primary-foreground transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:border-primary data-checked:bg-primary data-disabled:opacity-45', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center", children: _jsx(Check, { "aria-hidden": "true", className: "size-3", strokeWidth: 3 }) }) }));
|
|
13
|
+
return (_jsx(CheckboxPrimitive.Root, { "data-slot": "checkbox", className: classNames('peer inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card text-primary-foreground transition-colors duration-(--duration-fast) outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring data-checked:border-primary data-checked:bg-primary aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/16 data-disabled:opacity-45', className), ...props, children: _jsx(CheckboxPrimitive.Indicator, { "data-slot": "checkbox-indicator", className: "flex items-center justify-center", children: _jsx(Check, { "aria-hidden": "true", className: "size-3", strokeWidth: 3 }) }) }));
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/atoms/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../src/atoms/checkbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgC;IAC5E,OAAO,CACL,KAAC,iBAAiB,CAAC,IAAI,iBACX,UAAU,EACpB,SAAS,EAAE,UAAU,CACnB,2aAA2a,EAC3a,SAAS,CACV,KACG,KAAK,YAET,KAAC,iBAAiB,CAAC,SAAS,iBAAW,oBAAoB,EAAC,SAAS,EAAC,kCAAkC,YACtG,KAAC,KAAK,mBAAa,MAAM,EAAC,SAAS,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,GAAI,GACnC,GACP,CAC1B,CAAC;AACJ,CAAC"}
|
package/dist/atoms/toast.d.ts
CHANGED
|
@@ -21,7 +21,11 @@ declare function ToastCard({ title, description, tone, action, onDismiss, }: Toa
|
|
|
21
21
|
}): import("react").JSX.Element;
|
|
22
22
|
/** Shows a toast: confirms a finished action or offers one follow-up. Never validation, never the only record. */
|
|
23
23
|
declare function showToast(content: ToastContent): void;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Desktop bottom right, 24 px in; phone 12 px from the edges. A page that
|
|
26
|
+
* shows a TabBar sets --tab-bar-clearance to its height, and the phone's
|
|
27
|
+
* toasts sit above it; elsewhere the clearance is 0.
|
|
28
|
+
*/
|
|
25
29
|
declare function Toaster({ className }: {
|
|
26
30
|
className?: string;
|
|
27
31
|
}): import("react").JSX.Element;
|
package/dist/atoms/toast.js
CHANGED
|
@@ -26,12 +26,16 @@ function showToast(content) {
|
|
|
26
26
|
sonner.dismiss(id);
|
|
27
27
|
} })), { duration: isError ? Number.POSITIVE_INFINITY : SUCCESS_DURATION_MS });
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Desktop bottom right, 24 px in; phone 12 px from the edges. A page that
|
|
31
|
+
* shows a TabBar sets --tab-bar-clearance to its height, and the phone's
|
|
32
|
+
* toasts sit above it; elsewhere the clearance is 0.
|
|
33
|
+
*/
|
|
30
34
|
function Toaster({ className }) {
|
|
31
35
|
return (_jsx(SonnerToaster, { position: "bottom-right", offset: "calc(var(--spacing) * 6)", mobileOffset: {
|
|
32
36
|
left: 'calc(var(--spacing) * 3)',
|
|
33
37
|
right: 'calc(var(--spacing) * 3)',
|
|
34
|
-
bottom: 'calc(var(--
|
|
38
|
+
bottom: 'calc(var(--spacing) * 3 + var(--tab-bar-clearance, 0px))',
|
|
35
39
|
}, toastOptions: { unstyled: true }, className: classNames('toaster', className) }));
|
|
36
40
|
}
|
|
37
41
|
export { showToast, ToastCard, Toaster };
|
package/dist/atoms/toast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/atoms/toast.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,MA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AAM,CAAC,MAAM,CACX,CAAC,EAAE,EAAE,EAAE,CAAC,CACN,KAAC,SAAS,OACJ,OAAO,EACX,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,GACD,CACH,EACD,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAAmB,EAAE,CACvE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,OAAO,CAAC,EAAE,SAAS,EAA0B;IACpD,OAAO,CACL,KAAC,aAAa,IACZ,QAAQ,EAAC,cAAc,EACvB,MAAM,EAAC,0BAA0B,EACjC,YAAY,EAAE;YACZ,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,0BAA0B;YACjC,MAAM,EAAE,0DAA0D;SACnE,EACD,YAAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAChC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,GAC3C,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Theme } from '@aeolus-fleet/common/rules';
|
|
2
|
+
/**
|
|
3
|
+
* The theme on <html> (docs/design/header-across-apps.md, T5): `data-theme`
|
|
4
|
+
* names the choice and the `dark` class (docs/design/conventions.md, "Stack")
|
|
5
|
+
* shows it, beside the tokens it switches.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The script each app's root layout puts in <head>, so the first paint shows
|
|
9
|
+
* the browser's theme and never flashes another. System follows the
|
|
10
|
+
* browser's setting and keeps in step when it changes, for as long as <html>
|
|
11
|
+
* says system.
|
|
12
|
+
*/
|
|
13
|
+
export declare function themeScript(theme: Theme): string;
|
|
14
|
+
/** Shows a theme picked in the avatar menu at once, as the script would on the next load. */
|
|
15
|
+
export declare function applyTheme(theme: Theme): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The theme on <html> (docs/design/header-across-apps.md, T5): `data-theme`
|
|
3
|
+
* names the choice and the `dark` class (docs/design/conventions.md, "Stack")
|
|
4
|
+
* shows it, beside the tokens it switches.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The script each app's root layout puts in <head>, so the first paint shows
|
|
8
|
+
* the browser's theme and never flashes another. System follows the
|
|
9
|
+
* browser's setting and keeps in step when it changes, for as long as <html>
|
|
10
|
+
* says system.
|
|
11
|
+
*/
|
|
12
|
+
export function themeScript(theme) {
|
|
13
|
+
return `(() => {
|
|
14
|
+
const root = document.documentElement;
|
|
15
|
+
const query = window.matchMedia('(prefers-color-scheme: dark)');
|
|
16
|
+
const apply = () => root.classList.toggle('dark', root.dataset.theme === 'dark' || (root.dataset.theme === 'system' && query.matches));
|
|
17
|
+
root.dataset.theme = ${JSON.stringify(theme)};
|
|
18
|
+
apply();
|
|
19
|
+
query.addEventListener('change', apply);
|
|
20
|
+
})();`;
|
|
21
|
+
}
|
|
22
|
+
/** Shows a theme picked in the avatar menu at once, as the script would on the next load. */
|
|
23
|
+
export function applyTheme(theme) {
|
|
24
|
+
const root = document.documentElement;
|
|
25
|
+
root.dataset.theme = theme;
|
|
26
|
+
const isDark = theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
27
|
+
root.classList.toggle('dark', isDark);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=first-paint-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"first-paint-theme.js","sourceRoot":"","sources":["../src/first-paint-theme.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAY;IACtC,OAAO;;;;yBAIgB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;;;MAGxC,CAAC;AACP,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,UAAU,CAAC,KAAY;IACrC,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;IACtC,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,MAAM,MAAM,GAAG,KAAK,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC,CAAC;IACrH,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from './atoms/tabs.js';
|
|
|
24
24
|
export * from './atoms/toast.js';
|
|
25
25
|
export * from './atoms/tooltip.js';
|
|
26
26
|
export * from './class-names.js';
|
|
27
|
+
export * from './first-paint-theme.js';
|
|
27
28
|
export * from './molecules/app-switcher.js';
|
|
28
29
|
export * from './molecules/avatar-entry.js';
|
|
29
30
|
export * from './molecules/avatar-menu.js';
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from './atoms/tabs.js';
|
|
|
24
24
|
export * from './atoms/toast.js';
|
|
25
25
|
export * from './atoms/tooltip.js';
|
|
26
26
|
export * from './class-names.js';
|
|
27
|
+
export * from './first-paint-theme.js';
|
|
27
28
|
export * from './molecules/app-switcher.js';
|
|
28
29
|
export * from './molecules/avatar-entry.js';
|
|
29
30
|
export * from './molecules/avatar-menu.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB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,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC"}
|
|
@@ -39,7 +39,8 @@ interface AvatarMenuLayout {
|
|
|
39
39
|
* a header, or a row of the avatar, the name and a caption in an app's sidebar
|
|
40
40
|
* foot (docs/design/fleet-overview), opens a
|
|
41
41
|
* DropdownMenu with who is signed in here and how, the account's own pages
|
|
42
|
-
* in Account, the app's entries, the theme (applied at once
|
|
42
|
+
* in Account, the app's entries, the theme (applied at once, held for this
|
|
43
|
+
* browser in every app), keyboard
|
|
43
44
|
* shortcuts, help and sign out, which shows "Signing out" until it ends.
|
|
44
45
|
*/
|
|
45
46
|
export declare function AvatarMenu(props: AvatarMenuProps & AvatarMenuLayout): import("react").JSX.Element;
|
|
@@ -12,6 +12,8 @@ import { Kbd } from '../atoms/kbd.js';
|
|
|
12
12
|
import { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from '../atoms/sheet.js';
|
|
13
13
|
import { classNames } from '../class-names.js';
|
|
14
14
|
const THEME_LABELS = { light: 'Light', dark: 'Dark', system: 'System' };
|
|
15
|
+
/** Where the theme holds: one theme per browser, in every Aeolus app (docs/design/header-across-apps.md, M1). */
|
|
16
|
+
const THEME_SCOPE = 'This browser, every Aeolus app';
|
|
15
17
|
const THEME_ICONS = { light: Sun, dark: Moon, system: Monitor };
|
|
16
18
|
/** The account's own pages in Account, from its address there. */
|
|
17
19
|
function accountPagesOf(accountUrl) {
|
|
@@ -53,7 +55,8 @@ function ShortcutsDialog({ isOpen, onOpenChange, shortcuts }) {
|
|
|
53
55
|
* a header, or a row of the avatar, the name and a caption in an app's sidebar
|
|
54
56
|
* foot (docs/design/fleet-overview), opens a
|
|
55
57
|
* DropdownMenu with who is signed in here and how, the account's own pages
|
|
56
|
-
* in Account, the app's entries, the theme (applied at once
|
|
58
|
+
* in Account, the app's entries, the theme (applied at once, held for this
|
|
59
|
+
* browser in every app), keyboard
|
|
57
60
|
* shortcuts, help and sign out, which shows "Signing out" until it ends.
|
|
58
61
|
*/
|
|
59
62
|
export function AvatarMenu(props) {
|
|
@@ -69,7 +72,7 @@ export function AvatarMenu(props) {
|
|
|
69
72
|
? {}
|
|
70
73
|
: {
|
|
71
74
|
render: (itemProps) => (_jsx("a", { ...itemProps, href: entry.href, children: itemProps.children })),
|
|
72
|
-
}), children: _jsx(EntryContent, { entry: entry }) }, entry.key))), hasTheme ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [
|
|
75
|
+
}), children: _jsx(EntryContent, { entry: entry }) }, entry.key))), hasTheme ? (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuGroup, { children: [_jsxs(DropdownMenuLabel, { className: "flex flex-col", children: ["Theme", _jsx("span", { "data-testid": "avatar-menu-theme-scope", children: THEME_SCOPE })] }), _jsx(DropdownMenuRadioGroup, { value: theme ?? null, onValueChange: (value) => {
|
|
73
76
|
const picked = themeOf(value, themes);
|
|
74
77
|
if (picked !== undefined) {
|
|
75
78
|
onThemeChange(picked);
|
|
@@ -102,7 +105,7 @@ export function AvatarMenuSheet(props) {
|
|
|
102
105
|
}, children: _jsx(EntryContent, { entry: entry }) }, entry.key)) : (_jsxs("a", { href: entry.href, "data-testid": `avatar-menu-${entry.key}`, className: rowClass, onClick: () => {
|
|
103
106
|
setIsOpen(false);
|
|
104
107
|
entry.onSelect?.();
|
|
105
|
-
}, children: [entry.icon, entry.label] }, entry.key))), hasTheme ? (_jsxs("div", { role: "group", "aria-label": "Theme", className: "flex shrink-0 flex-col gap-1.5 border-t border-border pt-3", children: [
|
|
108
|
+
}, children: [entry.icon, entry.label] }, entry.key))), hasTheme ? (_jsxs("div", { role: "group", "aria-label": "Theme", className: "flex shrink-0 flex-col gap-1.5 border-t border-border pt-3", children: [_jsxs("p", { className: "flex flex-col text-caption text-muted-foreground", children: ["Theme", _jsx("span", { "data-testid": "avatar-menu-theme-scope", children: THEME_SCOPE })] }), _jsx("div", { className: "grid grid-cols-3 gap-1 rounded-lg bg-muted p-1", children: themes.map((option) => {
|
|
106
109
|
const Icon = THEME_ICONS[option];
|
|
107
110
|
const isChosen = option === theme;
|
|
108
111
|
return (_jsxs("button", { type: "button", "aria-pressed": isChosen, disabled: theme === undefined, "data-testid": `avatar-menu-theme-${option}`, onClick: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-menu.js","sourceRoot":"","sources":["../../src/molecules/avatar-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe,EAAE,QA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,CAAC;AACJ,CAAC"}
|
|
@@ -2,6 +2,15 @@ import type { ShipId } from '@aeolus-fleet/common';
|
|
|
2
2
|
import type { useRender } from '@base-ui/react/use-render';
|
|
3
3
|
import { type HarbourGroupKind } from './harbour-state.js';
|
|
4
4
|
import { type HarbourTileShip } from './harbour-tile.js';
|
|
5
|
+
/**
|
|
6
|
+
* The tiles' grid, by Harbour's own width (a container query on Harbour,
|
|
7
|
+
* docs/design/fleet-overview): as many tiles as fit, each between 12rem and
|
|
8
|
+
* 18rem wide (Thomas, #1672). The columns count by 12rem; a column wider than
|
|
9
|
+
* 18rem (two a row, just short of a third) leaves the space beside its tile.
|
|
10
|
+
* Under two tiles' width, on a phone, two a row. Harbour's loading shape
|
|
11
|
+
* draws the same grid.
|
|
12
|
+
*/
|
|
13
|
+
export declare const HARBOUR_TILE_GRID = "grid gap-2 grid-cols-[repeat(auto-fill,minmax(12rem,1fr))] *:max-w-72 @max-[24.5rem]:grid-cols-2";
|
|
5
14
|
export interface HarbourGroupProps {
|
|
6
15
|
kind: HarbourGroupKind;
|
|
7
16
|
/** Its ships, in the order given: the app orders them (alert, waiting, working, idle). */
|
|
@@ -3,15 +3,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { HARBOUR_GROUP_LOOK } from './harbour-state.js';
|
|
4
4
|
import { HarbourTile } from './harbour-tile.js';
|
|
5
5
|
/**
|
|
6
|
-
* The tiles'
|
|
7
|
-
* docs/design/fleet-overview): as many tiles
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* The tiles' grid, by Harbour's own width (a container query on Harbour,
|
|
7
|
+
* docs/design/fleet-overview): as many tiles as fit, each between 12rem and
|
|
8
|
+
* 18rem wide (Thomas, #1672). The columns count by 12rem; a column wider than
|
|
9
|
+
* 18rem (two a row, just short of a third) leaves the space beside its tile.
|
|
10
|
+
* Under two tiles' width, on a phone, two a row. Harbour's loading shape
|
|
11
|
+
* draws the same grid.
|
|
10
12
|
*/
|
|
11
|
-
const
|
|
13
|
+
export const HARBOUR_TILE_GRID = 'grid gap-2 grid-cols-[repeat(auto-fill,minmax(12rem,1fr))] *:max-w-72 @max-[24.5rem]:grid-cols-2';
|
|
12
14
|
/** One of Harbour's groups (docs/design/fleet-overview): its icon, word and how many ships it holds, then its tiles. */
|
|
13
15
|
export function HarbourGroup({ kind, tiles, hrefOf, link, now }) {
|
|
14
16
|
const { word, Icon } = HARBOUR_GROUP_LOOK[kind];
|
|
15
|
-
return (_jsxs("section", { "aria-label": word, className: "flex flex-col gap-2", "data-testid": `harbour-group-${kind}`, children: [_jsxs("h3", { className: "flex items-center gap-2 text-body leading-5 font-semibold", children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), word, _jsx("span", { className: "font-normal text-muted-foreground tabular-nums", children: tiles.length })] }), _jsx("ul", { className:
|
|
17
|
+
return (_jsxs("section", { "aria-label": word, className: "flex flex-col gap-2", "data-testid": `harbour-group-${kind}`, children: [_jsxs("h3", { className: "flex items-center gap-2 text-body leading-5 font-semibold", children: [_jsx(Icon, { "aria-hidden": true, className: "size-4 shrink-0" }), word, _jsx("span", { className: "font-normal text-muted-foreground tabular-nums", children: tiles.length })] }), _jsx("ul", { className: HARBOUR_TILE_GRID, children: tiles.map((ship) => (_jsx("li", { className: "min-w-0", children: _jsx(HarbourTile, { ship: ship, kind: kind, href: hrefOf?.(ship.id), link: link, now: now }) }, ship.id))) })] }));
|
|
16
18
|
}
|
|
17
19
|
//# sourceMappingURL=harbour-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harbour-group.js","sourceRoot":"","sources":["../../src/molecules/harbour-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,kBAAkB,EAAyB,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAwB,MAAM,mBAAmB,CAAC;AAEtE
|
|
1
|
+
{"version":3,"file":"harbour-group.js","sourceRoot":"","sources":["../../src/molecules/harbour-group.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAKb,OAAO,EAAE,kBAAkB,EAAyB,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAwB,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,kGAAkG,CAAC;AAYpI,wHAAwH;AACxH,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAqB;IAChF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAChD,OAAO,CACL,iCAAqB,IAAI,EAAE,SAAS,EAAC,qBAAqB,iBAAc,iBAAiB,IAAI,EAAE,aAC7F,cAAI,SAAS,EAAC,2DAA2D,aACvE,KAAC,IAAI,yBAAa,SAAS,EAAC,iBAAiB,GAAG,EAC/C,IAAI,EACL,eAAM,SAAS,EAAC,gDAAgD,YAAE,KAAK,CAAC,MAAM,GAAQ,IACnF,EACL,aAAI,SAAS,EAAE,iBAAiB,YAC7B,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,aAAkB,SAAS,EAAC,SAAS,YACnC,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,GAAI,IAD/E,IAAI,CAAC,EAAE,CAEX,CACN,CAAC,GACC,IACG,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HarbourOutput } from '@aeolus-fleet/common';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import { Component } from 'react';
|
|
3
4
|
import { type HarbourGroupKind } from './harbour-state.js';
|
|
4
5
|
/** A ship as its tile shows it: `fleet.harbour`'s tile, its group saying its kind. */
|
|
5
6
|
export type HarbourTileShip = Pick<HarbourOutput['items'][number], 'id' | 'name' | 'state' | 'note' | 'lastActivityAt'>;
|
|
@@ -14,6 +15,13 @@ export interface HarbourTileProps {
|
|
|
14
15
|
/** The time the last activity is measured from. */
|
|
15
16
|
now: Date;
|
|
16
17
|
}
|
|
18
|
+
/** Colours sampled before React moves or updates the node, including an interrupted settle. */
|
|
19
|
+
interface TileColours {
|
|
20
|
+
element: HTMLElement;
|
|
21
|
+
background: string;
|
|
22
|
+
text: string;
|
|
23
|
+
border: string;
|
|
24
|
+
}
|
|
17
25
|
/**
|
|
18
26
|
* One ship on Harbour (docs/design/fleet-overview, "The tile"), the same in
|
|
19
27
|
* the console and Bridge: its kind, its whole name, what it is doing (its
|
|
@@ -21,5 +29,16 @@ export interface HarbourTileProps {
|
|
|
21
29
|
* an href it opens the ship's page, the arrow showing on hover and focus. A
|
|
22
30
|
* working ship's tile carries the live band in Sea, which stands still under
|
|
23
31
|
* reduced motion; a new state's colours settle without moving the tile. The title holds "name: note" for the note cut short.
|
|
32
|
+
*
|
|
33
|
+
* React's snapshot lifecycle runs before DOM placement. Hooks have no equivalent
|
|
34
|
+
* for reading the old colours before a parent's keyed sort re-inserts this node.
|
|
35
|
+
* Starting styles supply that snapshot only when the browser lost its old style;
|
|
36
|
+
* ordinary updates keep their native CSS transitions, including hover and press.
|
|
24
37
|
*/
|
|
25
|
-
export declare
|
|
38
|
+
export declare class HarbourTile extends Component<HarbourTileProps, object, readonly TileColours[]> {
|
|
39
|
+
private readonly tile;
|
|
40
|
+
getSnapshotBeforeUpdate(previousProps: HarbourTileProps): readonly TileColours[];
|
|
41
|
+
componentDidUpdate(_previousProps: HarbourTileProps, _previousState: object, colours: readonly TileColours[]): void;
|
|
42
|
+
render(): import("react").JSX.Element;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useRender } from '@base-ui/react/use-render';
|
|
4
4
|
import { ArrowUpRight } from 'lucide-react';
|
|
5
|
+
import { Component, createRef } from 'react';
|
|
5
6
|
import { ShipState, shipStateWordOf } from '../atoms/ship-state.js';
|
|
6
7
|
import { classNames } from '../class-names.js';
|
|
7
8
|
import { lastActivityWordsOf } from './harbour-activity.js';
|
|
@@ -27,7 +28,7 @@ const TILE = 'relative grid h-full min-h-28 min-w-0 grid-rows-[auto_1fr_auto] ga
|
|
|
27
28
|
* A new state's colours settle over 180 ms rather than flash; its word, icon
|
|
28
29
|
* and band change at once (docs/design/working-band). Reduced motion: at once.
|
|
29
30
|
*/
|
|
30
|
-
const SETTLE = 'transition-colors duration-180 ease-[ease-out] motion-reduce:transition-none';
|
|
31
|
+
const SETTLE = 'harbour-tile-colours transition-colors duration-180 ease-[ease-out] motion-reduce:transition-none';
|
|
31
32
|
/** A tile that is not a link settles its background, text and border. */
|
|
32
33
|
const PLAIN = 'transition-[background-color,color,border-color] duration-180 ease-[ease-out]';
|
|
33
34
|
/**
|
|
@@ -35,7 +36,7 @@ const PLAIN = 'transition-[background-color,color,border-color] duration-180 eas
|
|
|
35
36
|
* again. Its colours settle as a plain tile's do, its border on hover too.
|
|
36
37
|
* Reduced motion: nothing moves.
|
|
37
38
|
*/
|
|
38
|
-
const LINK = 'group cursor-pointer [transition:background-color_180ms_ease-out,color_180ms_ease-out,border-color_180ms_ease-out,box-shadow_var(--duration-fast)_var(--default-transition-timing-function),transform_var(--duration-fast)_var(--default-transition-timing-function)] outline-none hover:-translate-y-px hover:shadow-[0_2px_8px_-2px_color-mix(in_oklch,var(--foreground)_18%,transparent)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:translate-y-0 active:shadow-none motion-reduce:hover:translate-y-0';
|
|
39
|
+
const LINK = 'group cursor-pointer [transition:background-color_180ms_ease-out,color_180ms_ease-out,border-color_180ms_ease-out,box-shadow_var(--duration-fast)_var(--default-transition-timing-function),transform_var(--duration-fast)_var(--default-transition-timing-function)] outline-none hover:-translate-y-px hover:shadow-[0_2px_8px_-2px_color-mix(in_oklch,var(--foreground)_18%,transparent)] focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring active:translate-y-0 active:shadow-none motion-reduce:hover:translate-y-0';
|
|
39
40
|
/**
|
|
40
41
|
* One ship on Harbour (docs/design/fleet-overview, "The tile"), the same in
|
|
41
42
|
* the console and Bridge: its kind, its whole name, what it is doing (its
|
|
@@ -43,20 +44,60 @@ const LINK = 'group cursor-pointer [transition:background-color_180ms_ease-out,c
|
|
|
43
44
|
* an href it opens the ship's page, the arrow showing on hover and focus. A
|
|
44
45
|
* working ship's tile carries the live band in Sea, which stands still under
|
|
45
46
|
* reduced motion; a new state's colours settle without moving the tile. The title holds "name: note" for the note cut short.
|
|
47
|
+
*
|
|
48
|
+
* React's snapshot lifecycle runs before DOM placement. Hooks have no equivalent
|
|
49
|
+
* for reading the old colours before a parent's keyed sort re-inserts this node.
|
|
50
|
+
* Starting styles supply that snapshot only when the browser lost its old style;
|
|
51
|
+
* ordinary updates keep their native CSS transitions, including hover and press.
|
|
46
52
|
*/
|
|
47
|
-
export
|
|
53
|
+
export class HarbourTile extends Component {
|
|
54
|
+
tile = createRef();
|
|
55
|
+
getSnapshotBeforeUpdate(previousProps) {
|
|
56
|
+
const tile = this.tile.current;
|
|
57
|
+
if (tile === null)
|
|
58
|
+
return [];
|
|
59
|
+
if (previousProps.ship.state === this.props.ship.state && tile.getAnimations().length === 0)
|
|
60
|
+
return [];
|
|
61
|
+
return [tile, ...tile.querySelectorAll('.harbour-tile-colours')].map((element) => {
|
|
62
|
+
const style = getComputedStyle(element);
|
|
63
|
+
return { element, background: style.backgroundColor, text: style.color, border: style.borderTopColor };
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/max-params -- React fixes this lifecycle's three-argument signature.
|
|
67
|
+
componentDidUpdate(_previousProps, _previousState, colours) {
|
|
68
|
+
const tile = this.tile.current;
|
|
69
|
+
if (colours.length === 0 && tile !== null) {
|
|
70
|
+
for (const element of [tile, ...tile.querySelectorAll('.harbour-tile-colours')]) {
|
|
71
|
+
delete element.dataset.harbourSettle;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
for (const { element, background, text, border } of colours) {
|
|
75
|
+
element.style.setProperty('--harbour-from-background', background);
|
|
76
|
+
element.style.setProperty('--harbour-from-text', text);
|
|
77
|
+
element.style.setProperty('--harbour-from-border', border);
|
|
78
|
+
element.dataset.harbourSettle = '';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
render() {
|
|
82
|
+
return _jsx(HarbourTileView, { ...this.props, tileRef: this.tile });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/** Starting styles are inactive on mount and never override reduced-motion rules. */
|
|
86
|
+
const STARTING_COLOURS = 'data-harbour-settle:starting:bg-(--harbour-from-background) data-harbour-settle:starting:text-(--harbour-from-text) data-harbour-settle:starting:border-(--harbour-from-border)';
|
|
87
|
+
function HarbourTileView({ ship, kind, href, link, now, tileRef }) {
|
|
48
88
|
const { name, state, note } = ship;
|
|
49
89
|
const { kindWord, KindIcon } = HARBOUR_GROUP_LOOK[kind];
|
|
50
90
|
const isLink = href !== undefined;
|
|
51
|
-
const content = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex min-w-0 items-start gap-2 pr-4.5", children: [_jsx("span", { "data-testid": "harbour-tile-kind", title: kindWord, className: classNames('inline-flex size-5.5 shrink-0 items-center justify-center rounded-md border bg-card/70', SETTLE, state === 'idle' ? 'border-border' : 'border-current/25'), children: _jsx(KindIcon, { "aria-hidden": true, className: "size-3.25" }) }), _jsx("span", { className: "min-w-0 pt-0.5 text-meta leading-4.5 font-semibold wrap-anywhere text-foreground", children: name })] }), isLink ? (_jsx("span", { className: "absolute top-2.25 right-2.25 inline-flex text-muted-foreground opacity-0 transition-opacity duration-(--duration-fast) group-hover:opacity-100 group-focus-visible:opacity-100 motion-reduce:transition-none", children: _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" }) })) : null, _jsx("span", { className: "line-clamp-2 text-caption leading-4 text-muted-foreground", children: note }), _jsxs("span", { className: "flex flex-wrap items-center justify-between gap-x-2 gap-y-0.5", children: [_jsx(ShipState, { state: state, size: "caption", className: SETTLE }), _jsx("span", { "data-testid": "harbour-tile-age", className: "text-caption whitespace-nowrap text-muted-foreground", children: lastActivityWordsOf(ship.lastActivityAt, now) })] }), state === 'working' ? (_jsx("i", { "data-testid": "harbour-tile-live", "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-0.5 animate-live-band bg-[linear-gradient(90deg,transparent,var(--live-band),transparent)] bg-size-[40%_100%] bg-no-repeat opacity-45 motion-reduce:animate-none motion-reduce:bg-live-band motion-reduce:bg-none" })) : null] }));
|
|
91
|
+
const content = (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex min-w-0 items-start gap-2 pr-4.5", children: [_jsx("span", { "data-testid": "harbour-tile-kind", title: kindWord, className: classNames('inline-flex size-5.5 shrink-0 items-center justify-center rounded-md border bg-card/70', SETTLE, STARTING_COLOURS, state === 'idle' ? 'border-border' : 'border-current/25'), children: _jsx(KindIcon, { "aria-hidden": true, className: "size-3.25" }) }), _jsx("span", { className: "min-w-0 pt-0.5 text-meta leading-4.5 font-semibold wrap-anywhere text-foreground", children: name })] }), isLink ? (_jsx("span", { className: "absolute top-2.25 right-2.25 inline-flex text-muted-foreground opacity-0 transition-opacity duration-(--duration-fast) group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-0 motion-reduce:transition-none", children: _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5" }) })) : null, _jsx("span", { className: "line-clamp-2 text-caption leading-4 text-muted-foreground", children: note }), _jsxs("span", { className: "flex flex-wrap items-center justify-between gap-x-2 gap-y-0.5", children: [_jsx(ShipState, { state: state, size: "caption", className: classNames(SETTLE, STARTING_COLOURS) }), _jsx("span", { "data-testid": "harbour-tile-age", className: "text-caption whitespace-nowrap text-muted-foreground", children: lastActivityWordsOf(ship.lastActivityAt, now) })] }), state === 'working' ? (_jsx("i", { "data-testid": "harbour-tile-live", "aria-hidden": true, className: "absolute inset-x-0 bottom-0 h-0.5 animate-live-band bg-[linear-gradient(90deg,transparent,var(--live-band),transparent)] bg-size-[40%_100%] bg-no-repeat opacity-45 motion-reduce:animate-none motion-reduce:bg-live-band motion-reduce:bg-none" })) : null] }));
|
|
52
92
|
return useRender({
|
|
93
|
+
ref: tileRef,
|
|
53
94
|
defaultTagName: isLink ? 'a' : 'div',
|
|
54
95
|
render: isLink ? link : undefined,
|
|
55
96
|
props: {
|
|
56
97
|
'data-testid': 'harbour-tile',
|
|
57
98
|
'data-state': state,
|
|
58
99
|
title: `${name}: ${note ?? shipStateWordOf(state)}`,
|
|
59
|
-
className: classNames(TILE, TILE_TONES[state], isLink ? classNames(LINK, LINK_TONES[state]) : PLAIN),
|
|
100
|
+
className: classNames(TILE, TILE_TONES[state], STARTING_COLOURS, isLink ? classNames(LINK, LINK_TONES[state]) : PLAIN),
|
|
60
101
|
...(isLink ? { href } : {}),
|
|
61
102
|
children: content,
|
|
62
103
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harbour-tile.js","sourceRoot":"","sources":["../../src/molecules/harbour-tile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"harbour-tile.js","sourceRoot":"","sources":["../../src/molecules/harbour-tile.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,Y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B,kBAAkB,EAAC,SAAS,EAAC,sDAAsD,YAClG,mBAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,GACzC,IACF,EACN,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,CACrB,2BACc,mBAAmB,uBAE/B,SAAS,EAAC,iPAAiP,GAC3P,CACH,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;IACF,OAAO,SAAS,CAAC;QACf,GAAG,EAAE,OAAO;QACZ,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK;QACpC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACjC,KAAK,EAAE;YACL,aAAa,EAAE,cAAc;YAC7B,YAAY,EAAE,KAAK;YACnB,KAAK,EAAE,GAAG,IAAI,KAAK,IAAI,IAAI,eAAe,CAAC,KAAK,CAAC,EAAE;YACnD,SAAS,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACtH,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CrewStatus, DeliveryState, ScheduleState, ShipStatus, StuckCause } from '@aeolus-fleet/common';
|
|
2
|
+
import { type LucideIcon } from 'lucide-react';
|
|
2
3
|
/** A squadron's state (aeolus-fleet-squadrons' docs/squadrons.md). */
|
|
3
4
|
type SquadronState = 'forming' | 'sailing' | 'standing-down' | 'disbanded';
|
|
4
5
|
/** A count at its limit, or over it once a limit is lowered below use (the LimitMeter part). */
|
|
@@ -14,16 +15,38 @@ export type SealingBadgeState = 'sealing' | 'sealed' | 'reachable' | 'notReachab
|
|
|
14
15
|
/** A ship with an open alert (decision 0071): the badge after its status on the overview. */
|
|
15
16
|
export type AlertBadgeState = 'alert';
|
|
16
17
|
type Status = AlertBadgeState | SealingBadgeState | ShipStatus | DeliveryState | SquadronState | LimitState | CrewStatus | UnassignedCrewState | PushedStepState | HealthState | ScheduleState;
|
|
18
|
+
/** A tone family (docs/design/conventions.md, "Colour"): what a status means, the same in every app. */
|
|
19
|
+
export type StatusTone = 'waiting' | 'active' | 'ok' | 'attention' | 'ended';
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Abandoned keeps a dashed border to set it apart from Dismissed.
|
|
21
|
+
* How a badge draws: flat, icon and word in the tone with no fill or border,
|
|
22
|
+
* only Attention keeps its fill (the Compact look, the console's); or pill,
|
|
23
|
+
* round and filled in its tone with its border (the gateway's).
|
|
22
24
|
*/
|
|
23
|
-
export
|
|
25
|
+
export type StatusBadgeLook = 'flat' | 'pill';
|
|
26
|
+
/** A status from the catalogue: its tone, icon and label come with it. */
|
|
27
|
+
interface CatalogueStatusProps {
|
|
24
28
|
status: Status;
|
|
29
|
+
look?: StatusBadgeLook;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/** A status an app names itself (an outside party's, a request's, a limit's): it hands the tone, the icon and the label. */
|
|
33
|
+
interface ToneStatusProps {
|
|
34
|
+
tone: StatusTone;
|
|
35
|
+
icon: LucideIcon;
|
|
36
|
+
label: string;
|
|
37
|
+
look?: StatusBadgeLook;
|
|
25
38
|
className?: string;
|
|
26
|
-
}
|
|
39
|
+
}
|
|
40
|
+
export type StatusBadgeProps = CatalogueStatusProps | ToneStatusProps;
|
|
41
|
+
/**
|
|
42
|
+
* One component for every status an Aeolus app shows
|
|
43
|
+
* (docs/design/png/StatusBadge.png): a status from the catalogue, or a tone,
|
|
44
|
+
* icon and label an app hands it. Colour comes from the tone family, and
|
|
45
|
+
* each status has its icon and label, so it reads without colour. Flat by
|
|
46
|
+
* default, as the console draws it; pill where an app draws it round.
|
|
47
|
+
* Abandoned keeps a dashed border to set it apart from Dismissed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function StatusBadge(props: StatusBadgeProps): import("react").JSX.Element;
|
|
27
50
|
/** The label a status or state reads as, for a sentence beside the badge: "In flight". */
|
|
28
51
|
export declare function statusLabel(status: Status): string;
|
|
29
52
|
export {};
|
|
@@ -3,13 +3,22 @@ import { AlarmClock, Anchor, Archive, Ban, CalendarCheck, CalendarClock, Calenda
|
|
|
3
3
|
import { Badge } from '../atoms/badge.js';
|
|
4
4
|
import { classNames } from '../class-names.js';
|
|
5
5
|
/** Icon and word in the tone, no fill or border; only Attention keeps its fill (the Compact look). */
|
|
6
|
-
const
|
|
6
|
+
const FLAT_CLASSES = {
|
|
7
7
|
waiting: 'border-transparent bg-transparent px-0.5 text-tone-waiting-fg',
|
|
8
8
|
active: 'border-transparent bg-transparent px-0.5 text-tone-active-fg',
|
|
9
9
|
ok: 'border-transparent bg-transparent px-0.5 text-tone-ok-fg',
|
|
10
10
|
attention: 'border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg',
|
|
11
11
|
ended: 'border-transparent bg-transparent px-0.5 text-tone-ended-fg',
|
|
12
12
|
};
|
|
13
|
+
/** Round and filled in the tone, with its border. */
|
|
14
|
+
const PILL_CLASSES = {
|
|
15
|
+
waiting: 'rounded-full px-2 border-tone-waiting-border bg-tone-waiting-bg text-tone-waiting-fg',
|
|
16
|
+
active: 'rounded-full px-2 border-tone-active-border bg-tone-active-bg text-tone-active-fg',
|
|
17
|
+
ok: 'rounded-full px-2 border-tone-ok-border bg-tone-ok-bg text-tone-ok-fg',
|
|
18
|
+
attention: 'rounded-full px-2 border-tone-attention-border bg-tone-attention-bg text-tone-attention-fg',
|
|
19
|
+
ended: 'rounded-full px-2 border-tone-ended-border bg-tone-ended-bg text-tone-ended-fg',
|
|
20
|
+
};
|
|
21
|
+
const LOOK_CLASSES = { flat: FLAT_CLASSES, pill: PILL_CLASSES };
|
|
13
22
|
/**
|
|
14
23
|
* Every ship status, delivery state, squadron state, limit state, crew request state and schedule state with its tone, icon
|
|
15
24
|
* and label (docs/design/conventions.md, "Colour"). A handed delivery is in
|
|
@@ -65,14 +74,18 @@ const STATUSES = {
|
|
|
65
74
|
alert: { tone: 'attention', Icon: TriangleAlert, label: 'Alert' },
|
|
66
75
|
};
|
|
67
76
|
/**
|
|
68
|
-
* One component for every
|
|
69
|
-
* (docs/design/png/StatusBadge.png)
|
|
70
|
-
*
|
|
77
|
+
* One component for every status an Aeolus app shows
|
|
78
|
+
* (docs/design/png/StatusBadge.png): a status from the catalogue, or a tone,
|
|
79
|
+
* icon and label an app hands it. Colour comes from the tone family, and
|
|
80
|
+
* each status has its icon and label, so it reads without colour. Flat by
|
|
81
|
+
* default, as the console draws it; pill where an app draws it round.
|
|
71
82
|
* Abandoned keeps a dashed border to set it apart from Dismissed.
|
|
72
83
|
*/
|
|
73
|
-
export function StatusBadge(
|
|
74
|
-
const
|
|
75
|
-
|
|
84
|
+
export function StatusBadge(props) {
|
|
85
|
+
const look = props.look ?? 'flat';
|
|
86
|
+
const { tone, Icon, label } = 'status' in props ? STATUSES[props.status] : { tone: props.tone, Icon: props.icon, label: props.label };
|
|
87
|
+
const status = 'status' in props ? props.status : undefined;
|
|
88
|
+
return (_jsxs(Badge, { variant: "outline", "data-slot": "status-badge", "data-status": status, className: classNames(LOOK_CLASSES[look][tone], status === 'abandoned' ? classNames('border-dashed border-tone-ended-border', look === 'flat' ? 'px-1.5' : undefined) : undefined, props.className), children: [_jsx(Icon, { "aria-hidden": true }), label] }));
|
|
76
89
|
}
|
|
77
90
|
/** The label a status or state reads as, for a sentence beside the badge: "In flight". */
|
|
78
91
|
export function statusLabel(status) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-badge.js","sourceRoot":"","sources":["../../src/molecules/status-badge.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,UAAU,EACV,MAAM,EACN,OAAO,EACP,GAAG,EACH,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,EACT,eAAe,GAEhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"status-badge.js","sourceRoot":"","sources":["../../src/molecules/status-badge.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,UAAU,EACV,MAAM,EACN,OAAO,EACP,GAAG,EACH,aAAa,EACb,aAAa,EACb,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,UAAU,EACV,WAAW,EACX,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,OAAO,EACP,KAAK,EACL,SAAS,EACT,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,KAAK,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,SAAS,EACT,eAAe,GAEhB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA8B/C,sGAAsG;AACtG,MAAM,YAAY,GAAyB;IACzC,OAAO,EAAE,+DAA+D;IACxE,MAAM,EAAE,8DAA8D;IACtE,EA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AAO,CACL,MAAC,KAAK,IACJ,OAAO,EAAC,SAAS,eACP,cAAc,iBACX,MAAM,EACnB,SAAS,EAAE,UAAU,CACnB,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EACxB,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,wCAAwC,EAAE,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EACjI,KAAK,CAAC,SAAS,CAChB,aAED,KAAC,IAAI,0BAAe,EACnB,KAAK,IACA,CACT,CAAC;AACJ,CAAC;AACD,0FAA0F;AAC1F,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AAChC,CAAC"}
|
|
@@ -3,12 +3,18 @@ interface TypedConfirmProps {
|
|
|
3
3
|
expected: string;
|
|
4
4
|
value: string;
|
|
5
5
|
onValueChange: (value: string) => void;
|
|
6
|
+
/** Holds the field still while the action runs. */
|
|
7
|
+
isDisabled?: boolean;
|
|
6
8
|
'data-testid'?: string;
|
|
7
9
|
}
|
|
10
|
+
/** Whether the typed value confirms: exactly the expected text, case and hyphens included. */
|
|
11
|
+
export declare function isTypedMatch(expected: string, value: string): boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Second confirmation for an irreversible action that loses work
|
|
10
14
|
* (docs/design/png/TypedConfirm.png): retiring a ship that still holds open
|
|
11
|
-
* deliveries, or renaming one that other ships may address by name. The caller
|
|
15
|
+
* deliveries, or renaming one that other ships may address by name. The caller
|
|
16
|
+
* keeps its action disabled until isTypedMatch holds; no error styling while
|
|
17
|
+
* the operator is still typing.
|
|
12
18
|
*/
|
|
13
|
-
export declare function TypedConfirm({ expected, value, onValueChange, 'data-testid': testId }: TypedConfirmProps): import("react").JSX.Element;
|
|
19
|
+
export declare function TypedConfirm({ expected, value, onValueChange, isDisabled, 'data-testid': testId, }: TypedConfirmProps): import("react").JSX.Element;
|
|
14
20
|
export {};
|
|
@@ -3,22 +3,28 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useId } from 'react';
|
|
4
4
|
import { Input } from '../atoms/input.js';
|
|
5
5
|
import { Label } from '../atoms/label.js';
|
|
6
|
+
/** Whether the typed value confirms: exactly the expected text, case and hyphens included. */
|
|
7
|
+
export function isTypedMatch(expected, value) {
|
|
8
|
+
return value === expected;
|
|
9
|
+
}
|
|
6
10
|
/** The hint under the field: the rule while empty, then how far the text matches. Never error styling. */
|
|
7
11
|
function hintOf(expected, value) {
|
|
8
12
|
if (value === '') {
|
|
9
13
|
return 'Case and hyphens must match.';
|
|
10
14
|
}
|
|
11
|
-
return value
|
|
15
|
+
return isTypedMatch(expected, value) ? 'Matches. The button is now active.' : 'Doesn’t match yet.';
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* Second confirmation for an irreversible action that loses work
|
|
15
19
|
* (docs/design/png/TypedConfirm.png): retiring a ship that still holds open
|
|
16
|
-
* deliveries, or renaming one that other ships may address by name. The caller
|
|
20
|
+
* deliveries, or renaming one that other ships may address by name. The caller
|
|
21
|
+
* keeps its action disabled until isTypedMatch holds; no error styling while
|
|
22
|
+
* the operator is still typing.
|
|
17
23
|
*/
|
|
18
|
-
export function TypedConfirm({ expected, value, onValueChange, 'data-testid': testId = 'retire-typed-confirm' }) {
|
|
24
|
+
export function TypedConfirm({ expected, value, onValueChange, isDisabled = false, 'data-testid': testId = 'retire-typed-confirm', }) {
|
|
19
25
|
const inputId = useId();
|
|
20
26
|
const hintId = useId();
|
|
21
|
-
return (_jsxs("div", { "data-testid": testId, className: "flex flex-col gap-1.5", children: [_jsxs(Label, { htmlFor: inputId, className: "text-meta", children: ["Type ", _jsx("code", { className: "rounded-xs bg-muted px-1 py-0.5 font-mono text-id", children: expected }), " to confirm"] }), _jsx(Input, { id: inputId, isMono: true, autoComplete: "off", autoCapitalize: "off", autoCorrect: "off", spellCheck: false, "aria-describedby": hintId, className: "max-sm:h-(--size-control-touch) max-sm:text-input-touch", value: value, onChange: (event) => {
|
|
27
|
+
return (_jsxs("div", { "data-testid": testId, className: "flex flex-col gap-1.5", children: [_jsxs(Label, { htmlFor: inputId, className: "text-meta", children: ["Type ", _jsx("code", { className: "rounded-xs bg-muted px-1 py-0.5 font-mono text-id", children: expected }), " to confirm"] }), _jsx(Input, { id: inputId, isMono: true, autoComplete: "off", autoCapitalize: "off", autoCorrect: "off", spellCheck: false, "aria-describedby": hintId, className: "max-sm:h-(--size-control-touch) max-sm:text-input-touch", value: value, disabled: isDisabled, onChange: (event) => {
|
|
22
28
|
onValueChange(event.target.value);
|
|
23
29
|
} }), _jsx("p", { id: hintId, "aria-live": "polite", className: "text-meta text-muted-foreground", children: hintOf(expected, value) })] }));
|
|
24
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed-confirm.js","sourceRoot":"","sources":["../../src/molecules/typed-confirm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"typed-confirm.js","sourceRoot":"","sources":["../../src/molecules/typed-confirm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAY1C,8FAA8F;AAC9F,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,KAAa;IAC1D,OAAO,KAAK,KAAK,QAAQ,CAAC;AAC5B,CAAC;AAED,0GAA0G;AAC1G,SAAS,MAAM,CAAC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2
|
import { type ReactNode } from 'react';
|
|
2
3
|
/**
|
|
3
4
|
* One entry of the palette: what it shows, and where it goes. An entry with
|
|
4
5
|
* an href opens another app: the browser leaves, so the palette stays open
|
|
5
|
-
* and says "Opening ..." until it does.
|
|
6
|
-
*
|
|
6
|
+
* and says "Opening ..." until it does. An entry with copyText copies it and
|
|
7
|
+
* says Copied, opening nothing. Any other entry is handed to onSelect and
|
|
8
|
+
* the palette closes.
|
|
7
9
|
*/
|
|
8
10
|
export interface CommandEntry {
|
|
9
11
|
key: string;
|
|
@@ -11,6 +13,10 @@ export interface CommandEntry {
|
|
|
11
13
|
href?: string;
|
|
12
14
|
/** The name "Opening ..." uses for an entry with an href. */
|
|
13
15
|
name?: string;
|
|
16
|
+
/** The app the entry opens, named at the row's end (header-across-apps M2). */
|
|
17
|
+
app?: string;
|
|
18
|
+
/** What choosing the entry copies (A3). */
|
|
19
|
+
copyText?: string;
|
|
14
20
|
}
|
|
15
21
|
export interface CommandGroup {
|
|
16
22
|
key: string;
|
|
@@ -34,6 +40,12 @@ export interface CommandPaletteProps {
|
|
|
34
40
|
/** Each change of the query as typed, so the app can ask the server for what matches. */
|
|
35
41
|
onQueryChange?: (query: string) => void;
|
|
36
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Another app's group as the palette shows it (header-across-apps A2, M2):
|
|
45
|
+
* under the app's name, each entry with its icon and the app it opens named
|
|
46
|
+
* at the row's end, or copying its value.
|
|
47
|
+
*/
|
|
48
|
+
export declare function appPaletteGroupOf(group: AppPaletteGroup): CommandGroup;
|
|
37
49
|
/**
|
|
38
50
|
* The command palette (header design, docs/design/png/CommandPalette.png):
|
|
39
51
|
* search, then the app's groups of entries, filtered as you type. Arrow keys
|
|
@@ -1,12 +1,60 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx,
|
|
3
|
-
import { CornerDownLeft, LoaderCircle, Search } from 'lucide-react';
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Activity, AppWindow, ArrowUpRight, Check, Copy, CornerDownLeft, House, Inbox, LoaderCircle, Lock, Mail, Network, Plus, Search, Send, Settings, ShieldCheck, Ship, Users, } from 'lucide-react';
|
|
4
4
|
import { useId, useState } from 'react';
|
|
5
5
|
import { Button } from '../atoms/button.js';
|
|
6
6
|
import { Dialog, DialogClose, DialogContent, DialogTitle } from '../atoms/dialog.js';
|
|
7
7
|
import { dialogSurface } from '../atoms/dialog-surface.js';
|
|
8
8
|
import { Kbd } from '../atoms/kbd.js';
|
|
9
9
|
import { classNames } from '../class-names.js';
|
|
10
|
+
const PALETTE_ICON_PARTS = {
|
|
11
|
+
app: AppWindow,
|
|
12
|
+
plus: Plus,
|
|
13
|
+
send: Send,
|
|
14
|
+
users: Users,
|
|
15
|
+
ship: Ship,
|
|
16
|
+
inbox: Inbox,
|
|
17
|
+
activity: Activity,
|
|
18
|
+
home: House,
|
|
19
|
+
shield: ShieldCheck,
|
|
20
|
+
mail: Mail,
|
|
21
|
+
lock: Lock,
|
|
22
|
+
copy: Copy,
|
|
23
|
+
settings: Settings,
|
|
24
|
+
network: Network,
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Another app's group as the palette shows it (header-across-apps A2, M2):
|
|
28
|
+
* under the app's name, each entry with its icon and the app it opens named
|
|
29
|
+
* at the row's end, or copying its value.
|
|
30
|
+
*/
|
|
31
|
+
export function appPaletteGroupOf(group) {
|
|
32
|
+
return {
|
|
33
|
+
key: `app:${group.app}`,
|
|
34
|
+
label: group.label,
|
|
35
|
+
entries: group.entries.map((entry) => {
|
|
36
|
+
const Icon = PALETTE_ICON_PARTS[entry.icon];
|
|
37
|
+
return {
|
|
38
|
+
key: entry.key,
|
|
39
|
+
name: group.label,
|
|
40
|
+
content: (_jsxs(_Fragment, { children: [_jsx(Icon, { "aria-hidden": true, className: "size-(--size-icon) shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: entry.label })] })),
|
|
41
|
+
...(entry.copyText === undefined ? { app: group.label } : { copyText: entry.copyText }),
|
|
42
|
+
...(entry.href === undefined ? {} : { href: entry.href }),
|
|
43
|
+
};
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** The row's end: the app it opens, or what copying does and did. */
|
|
48
|
+
function RowEnd({ entry, copy }) {
|
|
49
|
+
if (entry.copyText !== undefined) {
|
|
50
|
+
const outcome = copy?.key === entry.key ? copy.outcome : undefined;
|
|
51
|
+
return (_jsxs("span", { "data-testid": "command-palette-item-copy", "aria-live": "polite", className: classNames('ml-auto inline-flex shrink-0 items-center gap-1 text-caption', outcome === 'failed' ? 'text-destructive' : 'text-muted-foreground'), children: [outcome === 'copied' ? _jsx(Check, { "aria-hidden": true, className: "size-3" }) : outcome === 'failed' ? null : _jsx(Copy, { "aria-hidden": true, className: "size-3" }), outcome === 'copied' ? 'Copied' : outcome === 'failed' ? 'Couldn’t copy. Try again' : 'Copies'] }));
|
|
52
|
+
}
|
|
53
|
+
if (entry.app !== undefined) {
|
|
54
|
+
return (_jsxs("span", { className: "ml-auto inline-flex shrink-0 items-center gap-0.5 text-caption text-muted-foreground", children: [_jsx("span", { "data-testid": "command-palette-item-app", children: entry.app }), _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3" })] }));
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
10
58
|
/** Rows standing in while the entries load. */
|
|
11
59
|
const SKELETON_ROWS = 4;
|
|
12
60
|
function LoadingRows() {
|
|
@@ -19,6 +67,7 @@ function PaletteBody({ groupsOf, onSelect, onOpenChange, label, emptyMessage, is
|
|
|
19
67
|
const [query, setQuery] = useState(initialQuery);
|
|
20
68
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
21
69
|
const [opening, setOpening] = useState(undefined);
|
|
70
|
+
const [copy, setCopy] = useState(undefined);
|
|
22
71
|
const groups = groupsOf(query);
|
|
23
72
|
const entries = groups.flatMap((group) => group.entries);
|
|
24
73
|
const active = entries[Math.min(activeIndex, entries.length - 1)];
|
|
@@ -27,6 +76,15 @@ function PaletteBody({ groupsOf, onSelect, onOpenChange, label, emptyMessage, is
|
|
|
27
76
|
if (opening !== undefined) {
|
|
28
77
|
return;
|
|
29
78
|
}
|
|
79
|
+
if (entry.copyText !== undefined) {
|
|
80
|
+
const { key } = entry;
|
|
81
|
+
navigator.clipboard.writeText(entry.copyText).then(() => {
|
|
82
|
+
setCopy({ key, outcome: 'copied' });
|
|
83
|
+
}, () => {
|
|
84
|
+
setCopy({ key, outcome: 'failed' });
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
30
88
|
if (entry.href !== undefined) {
|
|
31
89
|
setOpening(entry);
|
|
32
90
|
window.location.assign(entry.href);
|
|
@@ -56,12 +114,13 @@ function PaletteBody({ groupsOf, onSelect, onOpenChange, label, emptyMessage, is
|
|
|
56
114
|
onQueryChange?.(event.target.value);
|
|
57
115
|
}, 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
116
|
const isActive = entry === active;
|
|
59
|
-
|
|
117
|
+
// By key: the app hands over new entries on every render.
|
|
118
|
+
const isOpening = entry.key === opening?.key;
|
|
60
119
|
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
120
|
setActiveIndex(entries.indexOf(entry));
|
|
62
121
|
}, onClick: () => {
|
|
63
122
|
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));
|
|
123
|
+
}, 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 ?? ''] })] })) : (_jsxs(_Fragment, { children: [entry.content, _jsx(RowEnd, { entry: entry, copy: copy })] })) }, entry.key));
|
|
65
124
|
}) })] }, 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
125
|
}
|
|
67
126
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../src/organisms/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"command-palette.js","sourceRoot":"","sources":["../../src/organisms/command-palette.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EACL,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,KAAK,EACL,IAAI,EACJ,cAAc,EACd,KAAK,EACL,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,KAAK,GAEN,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA6C/C,MAAM,kBAAkB,GAAoC;IAC1D,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,QAAQ;IAClB,OA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AAa,CAAC,eAAe,EAAE,6BAA6B,CAAC,YAEhI,KAAC,WAAW,IAAC,YAAY,EAAE,YAAY,KAAM,IAAI,GAAI,GACvC,GACT,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -3,12 +3,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { CircleAlert, RotateCw } from 'lucide-react';
|
|
4
4
|
import { Button } from '../atoms/button.js';
|
|
5
5
|
import { classNames } from '../class-names.js';
|
|
6
|
-
import { HarbourGroup } from '../molecules/harbour-group.js';
|
|
6
|
+
import { HARBOUR_TILE_GRID, HarbourGroup } from '../molecules/harbour-group.js';
|
|
7
7
|
import { HarbourNumbers } from '../molecules/harbour-numbers.js';
|
|
8
8
|
/** The shape of the tiles that are coming, while the fleet is read. */
|
|
9
9
|
const LOADING_TILES = ['first', 'second', 'third', 'fourth'];
|
|
10
10
|
function HarbourLoading() {
|
|
11
|
-
return (_jsxs("div", { className: "flex flex-col gap-2", "data-testid": "harbour-loading", "aria-hidden": true, children: [_jsx("span", { className: "h-4 w-30 animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none" }), _jsx("div", { className:
|
|
11
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", "data-testid": "harbour-loading", "aria-hidden": true, children: [_jsx("span", { className: "h-4 w-30 animate-pulse rounded-sm bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none" }), _jsx("div", { className: HARBOUR_TILE_GRID, children: LOADING_TILES.map((key) => (_jsx("span", { className: "min-h-28 animate-pulse rounded-md bg-secondary [animation-duration:var(--duration-pulse)] motion-reduce:animate-none" }, key))) })] }));
|
|
12
12
|
}
|
|
13
13
|
function HarbourError({ detail, onRetry }) {
|
|
14
14
|
return (_jsxs("div", { role: "alert", "data-testid": "harbour-error", className: "flex items-start gap-2.5 rounded-lg border border-tone-attention-border bg-tone-attention-bg px-3 py-2.5 text-tone-attention-fg", children: [_jsx(CircleAlert, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [_jsx("p", { className: "text-meta font-semibold text-foreground", children: "Couldn\u2019t read the fleet" }), _jsxs("p", { className: "text-meta text-foreground", children: ["Nothing changed. The page tries again by itself", detail === undefined ? '.' : '; ', detail === undefined ? null : _jsx("code", { className: "font-mono text-code wrap-anywhere", children: detail })] })] }), _jsx(Button, { size: "xs", icon: _jsx(RotateCw, { "aria-hidden": true }), onClick: onRetry, "data-testid": "harbour-retry", children: "Try again" })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harbour.js","sourceRoot":"","sources":["../../src/organisms/harbour.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"harbour.js","sourceRoot":"","sources":["../../src/organisms/harbour.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAIb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGrD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,cAAc,EAAsB,MAAM,iCAAiC,CAAC;AAiCrF,uEAAuE;AACvE,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAEtE,SAAS,cAAc;IACrB,OAAO,CACL,eAAK,S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OAAO,GAAI,CACxD,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAChD,KAAC,cAAc,KAAG,CACnB,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACxB,KAAK,CACN,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAE,UAAU,CAAC,mGAAmG,EAAE,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,eAAa,UAAU,iBAAc,gBAAgB,YACxN,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC/B,KAAC,YAAY,IAAY,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,IAApE,IAAI,CAAoE,CAC5F,CAAC,GACE,CACP,CAAC;IACJ,OAAO,CACL,iCAAoB,SAAS,EAAC,SAAS,EAAC,0CAA0C,iBAAa,SAAS,aAErG,KAAK,KAAK,OAAO,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,cAAc,IAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAI,EACvH,OAAO,EACP,IAAI,IACG,CACX,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeolus-fleet/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "The UI parts every Aeolus web app shows: atoms, molecules and organisms, props only, and the design tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aeolus"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"postpack": "rm LICENSE"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@aeolus-fleet/common": "0.
|
|
40
|
+
"@aeolus-fleet/common": "0.40.0",
|
|
41
41
|
"@base-ui/react": "^1.8.0",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1",
|