@bevel-software/platform-core-frontend 0.4.0 → 0.4.1
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/package.json +2 -2
- package/src/core/__tests__/ShellRoutes.test.tsx +95 -95
- package/src/lib/utils.ts +138 -138
- package/src/modules/admin/__tests__/UserAccountsPage.test.tsx +156 -156
- package/src/modules/admin/components/UserAccountsPage.tsx +353 -353
- package/src/modules/layout/components/MaintenanceOverlay.tsx +104 -104
- package/src/modules/library/__tests__/DetailDialog.test.tsx +200 -200
- package/src/modules/library/__tests__/loadout.test.tsx +72 -72
- package/src/modules/library/__tests__/status.test.ts +117 -117
- package/src/modules/library/components/ChangeRequestDock.tsx +47 -47
- package/src/modules/library/components/CompareView.tsx +357 -357
- package/src/modules/library/components/DetailDialog.tsx +566 -566
- package/src/modules/library/components/GearIcon.tsx +12 -12
- package/src/modules/library/components/LibraryCard.tsx +132 -132
- package/src/modules/library/components/LibraryPage.tsx +254 -254
- package/src/modules/library/components/LoadoutSidebar.tsx +156 -156
- package/src/modules/library/components/StatusGem.tsx +21 -21
- package/src/modules/library/components/SuggestChange.tsx +171 -171
- package/src/modules/library/components/particles.ts +50 -50
- package/src/modules/library/library.css +320 -320
- package/src/modules/library/state/loadout.tsx +129 -129
- package/src/modules/library/utils/status.ts +116 -116
- package/src/modules/secrets-vault/components/SecretsPage.tsx +276 -276
- package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +51 -51
- package/src/modules/toolbar/components/AppSwitcher.tsx +108 -108
- package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +548 -548
- package/src/modules/workspace/components/FileExplorer.tsx +1068 -1068
- package/src/modules/workspace/components/FileViewer.tsx +906 -906
- package/src/modules/workspace/utils/fileTree.ts +179 -179
- package/src/shared/components/PageShell.tsx +51 -51
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The thin gear from the approved mock (mocks/gear-thin.svg, inlined there as
|
|
3
|
-
* `GEAR_SVG`), converted to a React component with `fill="currentColor"` so the
|
|
4
|
-
* integration-card chrome can tint it. Purely decorative — always aria-hidden.
|
|
5
|
-
*/
|
|
6
|
-
export function GearIcon({ className }: { className?: string }) {
|
|
7
|
-
return (
|
|
8
|
-
<svg viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg" className={className} aria-hidden="true">
|
|
9
|
-
<path d="M128.001,76a52,52,0,1,0,52,52A52.05895,52.05895,0,0,0,128.001,76Zm0,96a44,44,0,1,1,44-44A44.04978,44.04978,0,0,1,128.001,172Zm103.606-19.19434-15.70459-20.93652c.07276-2.56543.01953-5.86182-.02246-7.709l15.72022-20.95948a3.99977,3.99977,0,0,0,.66162-3.44238,107.44341,107.44341,0,0,0-10.55664-25.51025,4.00044,4.00044,0,0,0-2.90332-1.96778L192.915,68.5835c-1.74854-1.9087-3.59033-3.75049-5.49854-5.49854l-3.6958-25.87549a3.99946,3.99946,0,0,0-1.96582-2.90234A107.46494,107.46494,0,0,0,156.251,23.7334a3.9984,3.9984,0,0,0-3.44385.66162L131.88867,40.08545c-2.58594-.11328-5.19043-.11328-7.77637,0L103.20215,24.40186a3.99975,3.99975,0,0,0-3.44238-.66163A107.43015,107.43015,0,0,0,74.24854,34.29736a3.99987,3.99987,0,0,0-1.96729,2.90284L68.585,63.08643c-1.90869,1.74853-3.75049,3.59033-5.499,5.499L37.21045,72.28076a4.00233,4.00233,0,0,0-2.90234,1.96631A107.45352,107.45352,0,0,0,23.73437,99.75146a4.00034,4.00034,0,0,0,.66163,3.44385l15.70459,20.93653c-.07276,2.56543-.01954,5.86181.02246,7.709L24.40283,152.80029a3.9998,3.9998,0,0,0-.66162,3.44239,107.44358,107.44358,0,0,0,10.55664,25.51025,4.0004,4.0004,0,0,0,2.90332,1.96777l25.88672,3.69678c1.74854,1.90869,3.59033,3.75049,5.49854,5.49854l3.6958,25.87548a3.99943,3.99943,0,0,0,1.96582,2.90235,107.46536,107.46536,0,0,0,25.5039,10.57373,3.99865,3.99865,0,0,0,3.44385-.66162l20.91846-15.69043c2.58594.11328,5.19043.11328,7.77636,0l20.91016,15.68359a3.99818,3.99818,0,0,0,3.44238.66162,107.42974,107.42974,0,0,0,25.51123-10.55713,3.99985,3.99985,0,0,0,1.96729-2.90283l3.69971-25.90918c1.86523-1.76269,4.1582-4.13135,5.43506-5.4668l25.936-3.70459a4.00231,4.00231,0,0,0,2.90234-1.9663,107.453,107.453,0,0,0,10.57373-25.5044A4.00032,4.00032,0,0,0,231.60693,152.80566Zm-15.89941,23.27393-25.35889,3.62207a4.00012,4.00012,0,0,0-2.34765,1.21875c-.0459.04883-4.59473,4.87744-6.98926,6.99756a4.00188,4.00188,0,0,0-1.30811,2.42969l-3.62256,25.36718a99.46249,99.46249,0,0,1-20.05908,8.29981l-20.4917-15.36914a3.99365,3.99365,0,0,0-2.64257-.793,80.73137,80.73137,0,0,1-9.77051,0,3.99956,3.99956,0,0,0-2.64258.793l-20.499,15.376a99.48407,99.48407,0,0,1-20.05274-8.31494l-3.62207-25.35742a3.9995,3.9995,0,0,0-1.3081-2.42969,80.77735,80.77735,0,0,1-6.90918-6.90869,3.99933,3.99933,0,0,0-2.4292-1.3081l-25.36719-3.62256a99.46525,99.46525,0,0,1-8.29981-20.0586l15.37012-20.49316a3.99957,3.99957,0,0,0,.79785-2.52148c-.002-.0669-.20019-6.69825-.00586-9.89063a4.00065,4.00065,0,0,0-.793-2.64307l-15.376-20.49853a99.49477,99.49477,0,0,1,8.31494-20.05322l25.35791-3.6211a4.00129,4.00129,0,0,0,2.4292-1.30859A80.70375,80.70375,0,0,1,74.99121,68.083a4.00194,4.00194,0,0,0,1.30811-2.42969l3.62255-25.36719A99.46278,99.46278,0,0,1,99.981,31.98633l20.4917,15.36914a4.01364,4.01364,0,0,0,2.64257.793,80.72728,80.72728,0,0,1,9.77051,0,4.00878,4.00878,0,0,0,2.64258-.793l20.499-15.376a99.48407,99.48407,0,0,1,20.05274,8.31494l3.62207,25.35743a3.9994,3.9994,0,0,0,1.3081,2.42968,80.78169,80.78169,0,0,1,6.90918,6.90869,3.99939,3.99939,0,0,0,2.4292,1.30811l25.36719,3.62256a99.46513,99.46513,0,0,1,8.2998,20.05859l-15.37011,20.49317a3.99954,3.99954,0,0,0-.79785,2.52148c.002.0669.20019,6.69824.00586,9.89063a4.00063,4.00063,0,0,0,.793,2.64306l15.376,20.49854A99.49477,99.49477,0,0,1,215.70752,176.07959Z" />
|
|
10
|
-
</svg>
|
|
11
|
-
);
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The thin gear from the approved mock (mocks/gear-thin.svg, inlined there as
|
|
3
|
+
* `GEAR_SVG`), converted to a React component with `fill="currentColor"` so the
|
|
4
|
+
* integration-card chrome can tint it. Purely decorative — always aria-hidden.
|
|
5
|
+
*/
|
|
6
|
+
export function GearIcon({ className }: { className?: string }) {
|
|
7
|
+
return (
|
|
8
|
+
<svg viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg" className={className} aria-hidden="true">
|
|
9
|
+
<path d="M128.001,76a52,52,0,1,0,52,52A52.05895,52.05895,0,0,0,128.001,76Zm0,96a44,44,0,1,1,44-44A44.04978,44.04978,0,0,1,128.001,172Zm103.606-19.19434-15.70459-20.93652c.07276-2.56543.01953-5.86182-.02246-7.709l15.72022-20.95948a3.99977,3.99977,0,0,0,.66162-3.44238,107.44341,107.44341,0,0,0-10.55664-25.51025,4.00044,4.00044,0,0,0-2.90332-1.96778L192.915,68.5835c-1.74854-1.9087-3.59033-3.75049-5.49854-5.49854l-3.6958-25.87549a3.99946,3.99946,0,0,0-1.96582-2.90234A107.46494,107.46494,0,0,0,156.251,23.7334a3.9984,3.9984,0,0,0-3.44385.66162L131.88867,40.08545c-2.58594-.11328-5.19043-.11328-7.77637,0L103.20215,24.40186a3.99975,3.99975,0,0,0-3.44238-.66163A107.43015,107.43015,0,0,0,74.24854,34.29736a3.99987,3.99987,0,0,0-1.96729,2.90284L68.585,63.08643c-1.90869,1.74853-3.75049,3.59033-5.499,5.499L37.21045,72.28076a4.00233,4.00233,0,0,0-2.90234,1.96631A107.45352,107.45352,0,0,0,23.73437,99.75146a4.00034,4.00034,0,0,0,.66163,3.44385l15.70459,20.93653c-.07276,2.56543-.01954,5.86181.02246,7.709L24.40283,152.80029a3.9998,3.9998,0,0,0-.66162,3.44239,107.44358,107.44358,0,0,0,10.55664,25.51025,4.0004,4.0004,0,0,0,2.90332,1.96777l25.88672,3.69678c1.74854,1.90869,3.59033,3.75049,5.49854,5.49854l3.6958,25.87548a3.99943,3.99943,0,0,0,1.96582,2.90235,107.46536,107.46536,0,0,0,25.5039,10.57373,3.99865,3.99865,0,0,0,3.44385-.66162l20.91846-15.69043c2.58594.11328,5.19043.11328,7.77636,0l20.91016,15.68359a3.99818,3.99818,0,0,0,3.44238.66162,107.42974,107.42974,0,0,0,25.51123-10.55713,3.99985,3.99985,0,0,0,1.96729-2.90283l3.69971-25.90918c1.86523-1.76269,4.1582-4.13135,5.43506-5.4668l25.936-3.70459a4.00231,4.00231,0,0,0,2.90234-1.9663,107.453,107.453,0,0,0,10.57373-25.5044A4.00032,4.00032,0,0,0,231.60693,152.80566Zm-15.89941,23.27393-25.35889,3.62207a4.00012,4.00012,0,0,0-2.34765,1.21875c-.0459.04883-4.59473,4.87744-6.98926,6.99756a4.00188,4.00188,0,0,0-1.30811,2.42969l-3.62256,25.36718a99.46249,99.46249,0,0,1-20.05908,8.29981l-20.4917-15.36914a3.99365,3.99365,0,0,0-2.64257-.793,80.73137,80.73137,0,0,1-9.77051,0,3.99956,3.99956,0,0,0-2.64258.793l-20.499,15.376a99.48407,99.48407,0,0,1-20.05274-8.31494l-3.62207-25.35742a3.9995,3.9995,0,0,0-1.3081-2.42969,80.77735,80.77735,0,0,1-6.90918-6.90869,3.99933,3.99933,0,0,0-2.4292-1.3081l-25.36719-3.62256a99.46525,99.46525,0,0,1-8.29981-20.0586l15.37012-20.49316a3.99957,3.99957,0,0,0,.79785-2.52148c-.002-.0669-.20019-6.69825-.00586-9.89063a4.00065,4.00065,0,0,0-.793-2.64307l-15.376-20.49853a99.49477,99.49477,0,0,1,8.31494-20.05322l25.35791-3.6211a4.00129,4.00129,0,0,0,2.4292-1.30859A80.70375,80.70375,0,0,1,74.99121,68.083a4.00194,4.00194,0,0,0,1.30811-2.42969l3.62255-25.36719A99.46278,99.46278,0,0,1,99.981,31.98633l20.4917,15.36914a4.01364,4.01364,0,0,0,2.64257.793,80.72728,80.72728,0,0,1,9.77051,0,4.00878,4.00878,0,0,0,2.64258-.793l20.499-15.376a99.48407,99.48407,0,0,1,20.05274,8.31494l3.62207,25.35743a3.9994,3.9994,0,0,0,1.3081,2.42968,80.78169,80.78169,0,0,1,6.90918,6.90869,3.99939,3.99939,0,0,0,2.4292,1.30811l25.36719,3.62256a99.46513,99.46513,0,0,1,8.2998,20.05859l-15.37011,20.49317a3.99954,3.99954,0,0,0-.79785,2.52148c.002.0669.20019,6.69824.00586,9.89063a4.00063,4.00063,0,0,0,.793,2.64306l15.376,20.49854A99.49477,99.49477,0,0,1,215.70752,176.07959Z" />
|
|
10
|
+
</svg>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -1,132 +1,132 @@
|
|
|
1
|
-
import { useRef, type PointerEvent } from 'react';
|
|
2
|
-
import { GearIcon } from './GearIcon';
|
|
3
|
-
import { StatusGem } from './StatusGem';
|
|
4
|
-
import type { AttentionStatus } from '../utils/status';
|
|
5
|
-
|
|
6
|
-
export interface LibraryCardProps {
|
|
7
|
-
kind: 'skill' | 'integration';
|
|
8
|
-
id: string;
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
owned: boolean;
|
|
12
|
-
/** Rendered in the footer ONLY when it needs attention (mock rule). */
|
|
13
|
-
status: AttentionStatus;
|
|
14
|
-
picked: boolean;
|
|
15
|
-
/** Card-body click: toggle loadout membership (rect feeds the particle flight). */
|
|
16
|
-
onToggle(fromRect: DOMRect): void;
|
|
17
|
-
/** Top-right info button: open the detail dialog. */
|
|
18
|
-
onInfo(): void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* One gallery card. Deliberately icon/emoji-free (approved design). Skills get
|
|
23
|
-
* the green top accent strip; integrations the gear chrome (4 corner gears +
|
|
24
|
-
* 1 center, slow-spinning on hover). 3D tilt + glare follow the pointer.
|
|
25
|
-
*/
|
|
26
|
-
export function LibraryCard({
|
|
27
|
-
kind,
|
|
28
|
-
id,
|
|
29
|
-
name,
|
|
30
|
-
description,
|
|
31
|
-
owned,
|
|
32
|
-
status,
|
|
33
|
-
picked,
|
|
34
|
-
onToggle,
|
|
35
|
-
onInfo,
|
|
36
|
-
}: LibraryCardProps) {
|
|
37
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
38
|
-
|
|
39
|
-
function onPointerMove(e: PointerEvent<HTMLDivElement>) {
|
|
40
|
-
const el = ref.current;
|
|
41
|
-
if (!el) return;
|
|
42
|
-
const r = el.getBoundingClientRect();
|
|
43
|
-
const px = (e.clientX - r.left) / r.width;
|
|
44
|
-
const py = (e.clientY - r.top) / r.height;
|
|
45
|
-
el.style.transform = `translateY(-12px) scale(1.045) rotateX(${(0.5 - py) * 10}deg) rotateY(${(px - 0.5) * 10}deg)`;
|
|
46
|
-
el.style.setProperty('--lib-mx', `${px * 100}%`);
|
|
47
|
-
el.style.setProperty('--lib-my', `${py * 100}%`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function onPointerLeave() {
|
|
51
|
-
if (ref.current) ref.current.style.transform = '';
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const needsAttention = kind === 'integration' && status.state !== 'ok';
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
ref={ref}
|
|
59
|
-
data-testid={`library-card-${kind}-${id}`}
|
|
60
|
-
role="button"
|
|
61
|
-
tabIndex={0}
|
|
62
|
-
aria-pressed={picked}
|
|
63
|
-
aria-label={`${name} — ${picked ? 'remove from loadout' : 'add to loadout'}`}
|
|
64
|
-
className={`lib-card ${kind === 'skill' ? 'lib-card-skill' : 'lib-card-tool'} ${picked ? 'lib-card-picked' : ''} flex min-h-[180px] flex-col gap-2.5 p-4`}
|
|
65
|
-
onPointerMove={onPointerMove}
|
|
66
|
-
onPointerLeave={onPointerLeave}
|
|
67
|
-
onClick={() => {
|
|
68
|
-
const el = ref.current;
|
|
69
|
-
if (el) onToggle(el.getBoundingClientRect());
|
|
70
|
-
}}
|
|
71
|
-
onKeyDown={(e) => {
|
|
72
|
-
if (e.key === 'Enter' || e.key === ' ') {
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
const el = ref.current;
|
|
75
|
-
if (el) onToggle(el.getBoundingClientRect());
|
|
76
|
-
}
|
|
77
|
-
}}
|
|
78
|
-
>
|
|
79
|
-
{kind === 'integration' && (
|
|
80
|
-
<div className="lib-gears">
|
|
81
|
-
<GearIcon />
|
|
82
|
-
<GearIcon />
|
|
83
|
-
<GearIcon />
|
|
84
|
-
<GearIcon />
|
|
85
|
-
<GearIcon />
|
|
86
|
-
</div>
|
|
87
|
-
)}
|
|
88
|
-
<div className="lib-card-glare" />
|
|
89
|
-
<button
|
|
90
|
-
type="button"
|
|
91
|
-
aria-label={`Details for ${name}`}
|
|
92
|
-
title="Details"
|
|
93
|
-
className={`absolute right-2.5 top-2.5 z-[3] flex h-6 w-6 items-center justify-center rounded-full border bg-white/85 font-serif text-xs font-bold italic transition-all hover:scale-110 hover:border-[#0d9488] hover:bg-white hover:text-[#0f766e] ${picked ? 'border-[#9dd8cd] text-slate-500' : 'border-slate-200 text-slate-400'}`}
|
|
94
|
-
onClick={(e) => {
|
|
95
|
-
e.stopPropagation();
|
|
96
|
-
onInfo();
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
i
|
|
100
|
-
</button>
|
|
101
|
-
<div className="pr-6">
|
|
102
|
-
<div className="text-[14.5px] font-bold tracking-[.01em] text-slate-800">{name}</div>
|
|
103
|
-
<div className="mt-0.5 flex items-center gap-1.5 text-[10.5px] uppercase tracking-[.08em] text-slate-400">
|
|
104
|
-
{kind === 'skill' ? 'Skill' : 'Integration'}
|
|
105
|
-
{owned && (
|
|
106
|
-
<span className="rounded-full border border-[#f0dda6] bg-[#fdf3d8] px-1.5 text-[9.5px] font-bold tracking-[.05em] text-[#92600a]">
|
|
107
|
-
OWNER
|
|
108
|
-
</span>
|
|
109
|
-
)}
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
<div className="relative flex-1 text-xs text-slate-500">{description}</div>
|
|
113
|
-
{needsAttention && (
|
|
114
|
-
<div
|
|
115
|
-
className={`flex items-center border-t pt-2.5 ${picked ? 'border-[#bde4dc]' : 'border-slate-200'}`}
|
|
116
|
-
>
|
|
117
|
-
<span className="flex items-center gap-1.5 text-[11px] font-semibold text-slate-500">
|
|
118
|
-
<StatusGem state={status.state} />
|
|
119
|
-
{status.text}
|
|
120
|
-
</span>
|
|
121
|
-
</div>
|
|
122
|
-
)}
|
|
123
|
-
<div className="lib-hover-cta">
|
|
124
|
-
{picked ? (
|
|
125
|
-
<span className="lib-hc-remove">− Remove</span>
|
|
126
|
-
) : (
|
|
127
|
-
<span className="lib-hc-add">+ Add to loadout</span>
|
|
128
|
-
)}
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
1
|
+
import { useRef, type PointerEvent } from 'react';
|
|
2
|
+
import { GearIcon } from './GearIcon';
|
|
3
|
+
import { StatusGem } from './StatusGem';
|
|
4
|
+
import type { AttentionStatus } from '../utils/status';
|
|
5
|
+
|
|
6
|
+
export interface LibraryCardProps {
|
|
7
|
+
kind: 'skill' | 'integration';
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
owned: boolean;
|
|
12
|
+
/** Rendered in the footer ONLY when it needs attention (mock rule). */
|
|
13
|
+
status: AttentionStatus;
|
|
14
|
+
picked: boolean;
|
|
15
|
+
/** Card-body click: toggle loadout membership (rect feeds the particle flight). */
|
|
16
|
+
onToggle(fromRect: DOMRect): void;
|
|
17
|
+
/** Top-right info button: open the detail dialog. */
|
|
18
|
+
onInfo(): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* One gallery card. Deliberately icon/emoji-free (approved design). Skills get
|
|
23
|
+
* the green top accent strip; integrations the gear chrome (4 corner gears +
|
|
24
|
+
* 1 center, slow-spinning on hover). 3D tilt + glare follow the pointer.
|
|
25
|
+
*/
|
|
26
|
+
export function LibraryCard({
|
|
27
|
+
kind,
|
|
28
|
+
id,
|
|
29
|
+
name,
|
|
30
|
+
description,
|
|
31
|
+
owned,
|
|
32
|
+
status,
|
|
33
|
+
picked,
|
|
34
|
+
onToggle,
|
|
35
|
+
onInfo,
|
|
36
|
+
}: LibraryCardProps) {
|
|
37
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
38
|
+
|
|
39
|
+
function onPointerMove(e: PointerEvent<HTMLDivElement>) {
|
|
40
|
+
const el = ref.current;
|
|
41
|
+
if (!el) return;
|
|
42
|
+
const r = el.getBoundingClientRect();
|
|
43
|
+
const px = (e.clientX - r.left) / r.width;
|
|
44
|
+
const py = (e.clientY - r.top) / r.height;
|
|
45
|
+
el.style.transform = `translateY(-12px) scale(1.045) rotateX(${(0.5 - py) * 10}deg) rotateY(${(px - 0.5) * 10}deg)`;
|
|
46
|
+
el.style.setProperty('--lib-mx', `${px * 100}%`);
|
|
47
|
+
el.style.setProperty('--lib-my', `${py * 100}%`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function onPointerLeave() {
|
|
51
|
+
if (ref.current) ref.current.style.transform = '';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const needsAttention = kind === 'integration' && status.state !== 'ok';
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
ref={ref}
|
|
59
|
+
data-testid={`library-card-${kind}-${id}`}
|
|
60
|
+
role="button"
|
|
61
|
+
tabIndex={0}
|
|
62
|
+
aria-pressed={picked}
|
|
63
|
+
aria-label={`${name} — ${picked ? 'remove from loadout' : 'add to loadout'}`}
|
|
64
|
+
className={`lib-card ${kind === 'skill' ? 'lib-card-skill' : 'lib-card-tool'} ${picked ? 'lib-card-picked' : ''} flex min-h-[180px] flex-col gap-2.5 p-4`}
|
|
65
|
+
onPointerMove={onPointerMove}
|
|
66
|
+
onPointerLeave={onPointerLeave}
|
|
67
|
+
onClick={() => {
|
|
68
|
+
const el = ref.current;
|
|
69
|
+
if (el) onToggle(el.getBoundingClientRect());
|
|
70
|
+
}}
|
|
71
|
+
onKeyDown={(e) => {
|
|
72
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
const el = ref.current;
|
|
75
|
+
if (el) onToggle(el.getBoundingClientRect());
|
|
76
|
+
}
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{kind === 'integration' && (
|
|
80
|
+
<div className="lib-gears">
|
|
81
|
+
<GearIcon />
|
|
82
|
+
<GearIcon />
|
|
83
|
+
<GearIcon />
|
|
84
|
+
<GearIcon />
|
|
85
|
+
<GearIcon />
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
<div className="lib-card-glare" />
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
aria-label={`Details for ${name}`}
|
|
92
|
+
title="Details"
|
|
93
|
+
className={`absolute right-2.5 top-2.5 z-[3] flex h-6 w-6 items-center justify-center rounded-full border bg-white/85 font-serif text-xs font-bold italic transition-all hover:scale-110 hover:border-[#0d9488] hover:bg-white hover:text-[#0f766e] ${picked ? 'border-[#9dd8cd] text-slate-500' : 'border-slate-200 text-slate-400'}`}
|
|
94
|
+
onClick={(e) => {
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
onInfo();
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
i
|
|
100
|
+
</button>
|
|
101
|
+
<div className="pr-6">
|
|
102
|
+
<div className="text-[14.5px] font-bold tracking-[.01em] text-slate-800">{name}</div>
|
|
103
|
+
<div className="mt-0.5 flex items-center gap-1.5 text-[10.5px] uppercase tracking-[.08em] text-slate-400">
|
|
104
|
+
{kind === 'skill' ? 'Skill' : 'Integration'}
|
|
105
|
+
{owned && (
|
|
106
|
+
<span className="rounded-full border border-[#f0dda6] bg-[#fdf3d8] px-1.5 text-[9.5px] font-bold tracking-[.05em] text-[#92600a]">
|
|
107
|
+
OWNER
|
|
108
|
+
</span>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div className="relative flex-1 text-xs text-slate-500">{description}</div>
|
|
113
|
+
{needsAttention && (
|
|
114
|
+
<div
|
|
115
|
+
className={`flex items-center border-t pt-2.5 ${picked ? 'border-[#bde4dc]' : 'border-slate-200'}`}
|
|
116
|
+
>
|
|
117
|
+
<span className="flex items-center gap-1.5 text-[11px] font-semibold text-slate-500">
|
|
118
|
+
<StatusGem state={status.state} />
|
|
119
|
+
{status.text}
|
|
120
|
+
</span>
|
|
121
|
+
</div>
|
|
122
|
+
)}
|
|
123
|
+
<div className="lib-hover-cta">
|
|
124
|
+
{picked ? (
|
|
125
|
+
<span className="lib-hc-remove">− Remove</span>
|
|
126
|
+
) : (
|
|
127
|
+
<span className="lib-hc-add">+ Add to loadout</span>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|