@aeolus-fleet/ui 0.38.7 → 0.38.9
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.
|
@@ -20,6 +20,6 @@ export interface HarbourTileProps {
|
|
|
20
20
|
* report's note, two lines), its state and when it last did something. With
|
|
21
21
|
* an href it opens the ship's page, the arrow showing on hover and focus. A
|
|
22
22
|
* working ship's tile carries the live band in Sea, which stands still under
|
|
23
|
-
* reduced motion. The title holds "name: note" for the note cut short.
|
|
23
|
+
* reduced motion; a new state's colours settle without moving the tile. The title holds "name: note" for the note cut short.
|
|
24
24
|
*/
|
|
25
25
|
export declare function HarbourTile({ ship, kind, href, link, now }: HarbourTileProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -22,22 +22,33 @@ const LINK_TONES = {
|
|
|
22
22
|
working: 'hover:border-tone-active-fg active:border-tone-active-fg',
|
|
23
23
|
idle: 'hover:border-muted-foreground active:border-muted-foreground',
|
|
24
24
|
};
|
|
25
|
-
const TILE = 'relative grid h-full min-h-28 min-w-0 grid-rows-[auto_1fr_auto] gap-1 overflow-hidden rounded-md border px-3 py-2.5 no-underline';
|
|
26
|
-
/**
|
|
27
|
-
|
|
25
|
+
const TILE = 'relative grid h-full min-h-28 min-w-0 grid-rows-[auto_1fr_auto] gap-1 overflow-hidden rounded-md border px-3 py-2.5 no-underline motion-reduce:transition-none';
|
|
26
|
+
/**
|
|
27
|
+
* A new state's colours settle over 180 ms rather than flash; its word, icon
|
|
28
|
+
* and band change at once (docs/design/working-band). Reduced motion: at once.
|
|
29
|
+
*/
|
|
30
|
+
const SETTLE = 'transition-colors duration-180 ease-[ease-out] motion-reduce:transition-none';
|
|
31
|
+
/** A tile that is not a link settles its background, text and border. */
|
|
32
|
+
const PLAIN = 'transition-[background-color,color,border-color] duration-180 ease-[ease-out]';
|
|
33
|
+
/**
|
|
34
|
+
* A link lifts a little on hover with a soft shadow; pressed, it sits down
|
|
35
|
+
* again. Its colours settle as a plain tile's do, its border on hover too.
|
|
36
|
+
* Reduced motion: nothing moves.
|
|
37
|
+
*/
|
|
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';
|
|
28
39
|
/**
|
|
29
40
|
* One ship on Harbour (docs/design/fleet-overview, "The tile"), the same in
|
|
30
41
|
* the console and Bridge: its kind, its whole name, what it is doing (its
|
|
31
42
|
* report's note, two lines), its state and when it last did something. With
|
|
32
43
|
* an href it opens the ship's page, the arrow showing on hover and focus. A
|
|
33
44
|
* working ship's tile carries the live band in Sea, which stands still under
|
|
34
|
-
* reduced motion. The title holds "name: note" for the note cut short.
|
|
45
|
+
* reduced motion; a new state's colours settle without moving the tile. The title holds "name: note" for the note cut short.
|
|
35
46
|
*/
|
|
36
47
|
export function HarbourTile({ ship, kind, href, link, now }) {
|
|
37
48
|
const { name, state, note } = ship;
|
|
38
49
|
const { kindWord, KindIcon } = HARBOUR_GROUP_LOOK[kind];
|
|
39
50
|
const isLink = href !== undefined;
|
|
40
|
-
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', 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" }), _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-
|
|
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] }));
|
|
41
52
|
return useRender({
|
|
42
53
|
defaultTagName: isLink ? 'a' : 'div',
|
|
43
54
|
render: isLink ? link : undefined,
|
|
@@ -45,7 +56,7 @@ export function HarbourTile({ ship, kind, href, link, now }) {
|
|
|
45
56
|
'data-testid': 'harbour-tile',
|
|
46
57
|
'data-state': state,
|
|
47
58
|
title: `${name}: ${note ?? shipStateWordOf(state)}`,
|
|
48
|
-
className: classNames(TILE, TILE_TONES[state], isLink ? classNames(LINK, LINK_TONES[state]) :
|
|
59
|
+
className: classNames(TILE, TILE_TONES[state], isLink ? classNames(LINK, LINK_TONES[state]) : PLAIN),
|
|
49
60
|
...(isLink ? { href } : {}),
|
|
50
61
|
children: content,
|
|
51
62
|
},
|
|
@@ -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;AAE5C,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAyB,MAAM,oBAAoB,CAAC;AAK/E,iIAAiI;AACjI,MAAM,UAAU,GAAiC;IAC/C,KAAK,EAAE,0EAA0E;IACjF,YAAY,E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K,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,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,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACpG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,QAAQ,EAAE,OAAO;SAClB;KACF,CAAC,CAAC;AACL,CAAC"}
|
package/dist/theme.css
CHANGED
|
@@ -117,15 +117,27 @@
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
/*
|
|
121
|
-
|
|
120
|
+
/*
|
|
121
|
+
* A working ship's Harbour tile: a soft band of light sweeps along its foot
|
|
122
|
+
* for 2.4 s, then rests unseen for 1.4 s (docs/design/working-band).
|
|
123
|
+
*/
|
|
124
|
+
--animate-live-band: live-band 3.8s linear infinite;
|
|
122
125
|
|
|
123
126
|
@keyframes live-band {
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
0% {
|
|
128
|
+
transform: translateX(-100%);
|
|
129
|
+
opacity: 0;
|
|
130
|
+
}
|
|
131
|
+
10% {
|
|
132
|
+
opacity: 0.45;
|
|
133
|
+
}
|
|
134
|
+
63.1579% {
|
|
135
|
+
transform: translateX(100%);
|
|
136
|
+
opacity: 0;
|
|
126
137
|
}
|
|
127
|
-
|
|
128
|
-
|
|
138
|
+
100% {
|
|
139
|
+
transform: translateX(100%);
|
|
140
|
+
opacity: 0;
|
|
129
141
|
}
|
|
130
142
|
}
|
|
131
143
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeolus-fleet/ui",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.9",
|
|
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.38.
|
|
40
|
+
"@aeolus-fleet/common": "0.38.9",
|
|
41
41
|
"@base-ui/react": "^1.8.0",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1",
|