@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.
Files changed (30) hide show
  1. package/package.json +2 -2
  2. package/src/core/__tests__/ShellRoutes.test.tsx +95 -95
  3. package/src/lib/utils.ts +138 -138
  4. package/src/modules/admin/__tests__/UserAccountsPage.test.tsx +156 -156
  5. package/src/modules/admin/components/UserAccountsPage.tsx +353 -353
  6. package/src/modules/layout/components/MaintenanceOverlay.tsx +104 -104
  7. package/src/modules/library/__tests__/DetailDialog.test.tsx +200 -200
  8. package/src/modules/library/__tests__/loadout.test.tsx +72 -72
  9. package/src/modules/library/__tests__/status.test.ts +117 -117
  10. package/src/modules/library/components/ChangeRequestDock.tsx +47 -47
  11. package/src/modules/library/components/CompareView.tsx +357 -357
  12. package/src/modules/library/components/DetailDialog.tsx +566 -566
  13. package/src/modules/library/components/GearIcon.tsx +12 -12
  14. package/src/modules/library/components/LibraryCard.tsx +132 -132
  15. package/src/modules/library/components/LibraryPage.tsx +254 -254
  16. package/src/modules/library/components/LoadoutSidebar.tsx +156 -156
  17. package/src/modules/library/components/StatusGem.tsx +21 -21
  18. package/src/modules/library/components/SuggestChange.tsx +171 -171
  19. package/src/modules/library/components/particles.ts +50 -50
  20. package/src/modules/library/library.css +320 -320
  21. package/src/modules/library/state/loadout.tsx +129 -129
  22. package/src/modules/library/utils/status.ts +116 -116
  23. package/src/modules/secrets-vault/components/SecretsPage.tsx +276 -276
  24. package/src/modules/secrets-vault/components/__tests__/SecretsPage.test.tsx +51 -51
  25. package/src/modules/toolbar/components/AppSwitcher.tsx +108 -108
  26. package/src/modules/toolbar/components/ExternalAgentAccessPage.tsx +548 -548
  27. package/src/modules/workspace/components/FileExplorer.tsx +1068 -1068
  28. package/src/modules/workspace/components/FileViewer.tsx +906 -906
  29. package/src/modules/workspace/utils/fileTree.ts +179 -179
  30. package/src/shared/components/PageShell.tsx +51 -51
@@ -1,156 +1,156 @@
1
- import { useEffect, useRef, useState } from 'react';
2
- import { StatusGem } from './StatusGem';
3
- import type { LoadoutKind } from '../state/loadout';
4
- import type { AttentionStatus } from '../utils/status';
5
-
6
- export interface LoadoutRow {
7
- kind: LoadoutKind;
8
- id: string;
9
- name: string;
10
- status: AttentionStatus;
11
- }
12
-
13
- interface LoadoutSidebarProps {
14
- rows: LoadoutRow[];
15
- onOpen(row: LoadoutRow): void;
16
- onRemove(row: LoadoutRow): void;
17
- /** How many loadout items still need attention; drives the CTA. */
18
- attentionCount: number;
19
- onFinishSetup(): void;
20
- }
21
-
22
- /**
23
- * The loadout sidebar (deck-tracker style). Collapses to a slim vertical rail
24
- * when empty; rows animate in, hover swaps the status gem for a remove button,
25
- * and SKILLS / INTEGRATIONS group labels appear only when both kinds are
26
- * present. The count pulses on every change.
27
- */
28
- export function LoadoutSidebar({
29
- rows,
30
- onOpen,
31
- onRemove,
32
- attentionCount,
33
- onFinishSetup,
34
- }: LoadoutSidebarProps) {
35
- const total = rows.length;
36
- const skills = rows.filter((r) => r.kind === 'skill');
37
- const integrations = rows.filter((r) => r.kind === 'integration');
38
- const both = skills.length > 0 && integrations.length > 0;
39
-
40
- // Pulse the count on change (mock's `.pulse` re-trigger).
41
- const [pulse, setPulse] = useState(false);
42
- const prevTotal = useRef(total);
43
- useEffect(() => {
44
- if (prevTotal.current !== total) {
45
- prevTotal.current = total;
46
- setPulse(true);
47
- const t = setTimeout(() => setPulse(false), 220);
48
- return () => clearTimeout(t);
49
- }
50
- }, [total]);
51
-
52
- if (total === 0) {
53
- return (
54
- <aside
55
- aria-label="Your loadout (empty)"
56
- className="flex h-full w-14 shrink-0 flex-col items-center gap-3 border-r border-slate-200 bg-gradient-to-b from-white to-[#fafbfd] py-4 shadow-[6px_0_30px_rgba(22,35,58,0.06)] transition-[width] duration-300"
57
- >
58
- <div className="flex h-[26px] w-[26px] items-center justify-center rounded-full bg-[#f0f3f7] text-xs font-bold text-slate-400 shadow-[inset_0_0_0_1px_#e2e8f0]">
59
- 0
60
- </div>
61
- <div className="text-[10.5px] font-bold uppercase tracking-[.2em] text-slate-400 [writing-mode:vertical-rl]">
62
- Loadout
63
- </div>
64
- </aside>
65
- );
66
- }
67
-
68
- const renderRow = (row: LoadoutRow) => (
69
- <div
70
- key={`${row.kind}:${row.id}`}
71
- data-loadout-key={`${row.kind}:${row.id}`}
72
- role="button"
73
- tabIndex={0}
74
- className="lib-slot relative mb-2 flex h-[46px] cursor-pointer items-center gap-2.5 overflow-hidden rounded-[11px] border border-[#d2e9e4] bg-gradient-to-r from-[#e6f7f4] via-[#e6f7f459] to-transparent px-2.5 transition-colors hover:border-[#7fd0c4]"
75
- onClick={() => onOpen(row)}
76
- onKeyDown={(e) => {
77
- if (e.key === 'Enter') onOpen(row);
78
- }}
79
- >
80
- <div className="min-w-0">
81
- <div className="truncate text-[12.5px] font-semibold text-slate-800">{row.name}</div>
82
- <div className="text-[10.5px] text-slate-400">{row.status.text}</div>
83
- </div>
84
- <span className="lib-slot-gem ml-auto shrink-0">
85
- <StatusGem state={row.status.state} />
86
- </span>
87
- <button
88
- type="button"
89
- aria-label={`Remove ${row.name} from loadout`}
90
- title="Remove from loadout"
91
- className="lib-slot-kick absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full border border-slate-200 bg-white text-xs font-bold text-slate-400 hover:scale-110 hover:border-[#f3c4c4] hover:bg-[#fdecec] hover:text-[#c53030]"
92
- onClick={(e) => {
93
- e.stopPropagation();
94
- onRemove(row);
95
- }}
96
- >
97
- ✕
98
- </button>
99
- </div>
100
- );
101
-
102
- return (
103
- <aside
104
- aria-label="Your loadout"
105
- className="flex h-full w-72 shrink-0 flex-col border-r border-slate-200 bg-gradient-to-b from-white to-[#fafbfd] p-4 shadow-[6px_0_30px_rgba(22,35,58,0.06)] transition-[width] duration-300"
106
- >
107
- <div className="mb-3 flex items-baseline justify-between">
108
- <h2 className="whitespace-nowrap text-[15px] font-bold uppercase tracking-[.06em] text-[#0f766e]">
109
- Your loadout
110
- </h2>
111
- <div className={`text-[13px] font-bold text-slate-500 ${pulse ? 'lib-count-pulse' : ''}`}>
112
- {total}
113
- </div>
114
- </div>
115
-
116
- <div className="-mx-1.5 flex-1 overflow-y-auto px-1.5 pb-1">
117
- {both && (
118
- <div className="mx-1 mb-2 mt-1 text-[10px] font-bold uppercase tracking-[.14em] text-slate-400">
119
- Skills
120
- </div>
121
- )}
122
- {skills.map(renderRow)}
123
- {both && (
124
- <div className="mx-1 mb-2 mt-3 text-[10px] font-bold uppercase tracking-[.14em] text-slate-400">
125
- Integrations
126
- </div>
127
- )}
128
- {integrations.map(renderRow)}
129
- <div className="flex h-[46px] items-center justify-center rounded-[11px] border-[1.5px] border-dashed border-[#cbd7e4] text-[11.5px] tracking-[.05em] text-slate-400">
130
- ◇ pick more from the library
131
- </div>
132
- </div>
133
-
134
- <div className="mt-3">
135
- {attentionCount > 0 ? (
136
- <>
137
- <button
138
- type="button"
139
- className="w-full rounded-xl bg-gradient-to-br from-[#0d9488] to-[#0f766e] p-3 text-sm font-bold tracking-[.03em] text-white shadow-[0_6px_20px_rgba(13,148,136,0.22),inset_0_1px_0_rgba(255,255,255,0.35)] transition-transform hover:-translate-y-0.5 active:translate-y-0 active:scale-[.98]"
140
- onClick={onFinishSetup}
141
- >
142
- Finish setup ({attentionCount})
143
- </button>
144
- <div className="mt-2 flex items-center justify-center gap-1.5 text-[11.5px] text-[#b45309]">
145
- Some items need a quick sign-in first
146
- </div>
147
- </>
148
- ) : (
149
- <div className="rounded-xl border border-[#d2e9e4] bg-[#e6f7f4] p-3 text-center text-[12px] font-semibold text-[#0f766e]">
150
- Everything in your loadout is ready
151
- </div>
152
- )}
153
- </div>
154
- </aside>
155
- );
156
- }
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import { StatusGem } from './StatusGem';
3
+ import type { LoadoutKind } from '../state/loadout';
4
+ import type { AttentionStatus } from '../utils/status';
5
+
6
+ export interface LoadoutRow {
7
+ kind: LoadoutKind;
8
+ id: string;
9
+ name: string;
10
+ status: AttentionStatus;
11
+ }
12
+
13
+ interface LoadoutSidebarProps {
14
+ rows: LoadoutRow[];
15
+ onOpen(row: LoadoutRow): void;
16
+ onRemove(row: LoadoutRow): void;
17
+ /** How many loadout items still need attention; drives the CTA. */
18
+ attentionCount: number;
19
+ onFinishSetup(): void;
20
+ }
21
+
22
+ /**
23
+ * The loadout sidebar (deck-tracker style). Collapses to a slim vertical rail
24
+ * when empty; rows animate in, hover swaps the status gem for a remove button,
25
+ * and SKILLS / INTEGRATIONS group labels appear only when both kinds are
26
+ * present. The count pulses on every change.
27
+ */
28
+ export function LoadoutSidebar({
29
+ rows,
30
+ onOpen,
31
+ onRemove,
32
+ attentionCount,
33
+ onFinishSetup,
34
+ }: LoadoutSidebarProps) {
35
+ const total = rows.length;
36
+ const skills = rows.filter((r) => r.kind === 'skill');
37
+ const integrations = rows.filter((r) => r.kind === 'integration');
38
+ const both = skills.length > 0 && integrations.length > 0;
39
+
40
+ // Pulse the count on change (mock's `.pulse` re-trigger).
41
+ const [pulse, setPulse] = useState(false);
42
+ const prevTotal = useRef(total);
43
+ useEffect(() => {
44
+ if (prevTotal.current !== total) {
45
+ prevTotal.current = total;
46
+ setPulse(true);
47
+ const t = setTimeout(() => setPulse(false), 220);
48
+ return () => clearTimeout(t);
49
+ }
50
+ }, [total]);
51
+
52
+ if (total === 0) {
53
+ return (
54
+ <aside
55
+ aria-label="Your loadout (empty)"
56
+ className="flex h-full w-14 shrink-0 flex-col items-center gap-3 border-r border-slate-200 bg-gradient-to-b from-white to-[#fafbfd] py-4 shadow-[6px_0_30px_rgba(22,35,58,0.06)] transition-[width] duration-300"
57
+ >
58
+ <div className="flex h-[26px] w-[26px] items-center justify-center rounded-full bg-[#f0f3f7] text-xs font-bold text-slate-400 shadow-[inset_0_0_0_1px_#e2e8f0]">
59
+ 0
60
+ </div>
61
+ <div className="text-[10.5px] font-bold uppercase tracking-[.2em] text-slate-400 [writing-mode:vertical-rl]">
62
+ Loadout
63
+ </div>
64
+ </aside>
65
+ );
66
+ }
67
+
68
+ const renderRow = (row: LoadoutRow) => (
69
+ <div
70
+ key={`${row.kind}:${row.id}`}
71
+ data-loadout-key={`${row.kind}:${row.id}`}
72
+ role="button"
73
+ tabIndex={0}
74
+ className="lib-slot relative mb-2 flex h-[46px] cursor-pointer items-center gap-2.5 overflow-hidden rounded-[11px] border border-[#d2e9e4] bg-gradient-to-r from-[#e6f7f4] via-[#e6f7f459] to-transparent px-2.5 transition-colors hover:border-[#7fd0c4]"
75
+ onClick={() => onOpen(row)}
76
+ onKeyDown={(e) => {
77
+ if (e.key === 'Enter') onOpen(row);
78
+ }}
79
+ >
80
+ <div className="min-w-0">
81
+ <div className="truncate text-[12.5px] font-semibold text-slate-800">{row.name}</div>
82
+ <div className="text-[10.5px] text-slate-400">{row.status.text}</div>
83
+ </div>
84
+ <span className="lib-slot-gem ml-auto shrink-0">
85
+ <StatusGem state={row.status.state} />
86
+ </span>
87
+ <button
88
+ type="button"
89
+ aria-label={`Remove ${row.name} from loadout`}
90
+ title="Remove from loadout"
91
+ className="lib-slot-kick absolute right-2 top-1/2 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full border border-slate-200 bg-white text-xs font-bold text-slate-400 hover:scale-110 hover:border-[#f3c4c4] hover:bg-[#fdecec] hover:text-[#c53030]"
92
+ onClick={(e) => {
93
+ e.stopPropagation();
94
+ onRemove(row);
95
+ }}
96
+ >
97
+ ✕
98
+ </button>
99
+ </div>
100
+ );
101
+
102
+ return (
103
+ <aside
104
+ aria-label="Your loadout"
105
+ className="flex h-full w-72 shrink-0 flex-col border-r border-slate-200 bg-gradient-to-b from-white to-[#fafbfd] p-4 shadow-[6px_0_30px_rgba(22,35,58,0.06)] transition-[width] duration-300"
106
+ >
107
+ <div className="mb-3 flex items-baseline justify-between">
108
+ <h2 className="whitespace-nowrap text-[15px] font-bold uppercase tracking-[.06em] text-[#0f766e]">
109
+ Your loadout
110
+ </h2>
111
+ <div className={`text-[13px] font-bold text-slate-500 ${pulse ? 'lib-count-pulse' : ''}`}>
112
+ {total}
113
+ </div>
114
+ </div>
115
+
116
+ <div className="-mx-1.5 flex-1 overflow-y-auto px-1.5 pb-1">
117
+ {both && (
118
+ <div className="mx-1 mb-2 mt-1 text-[10px] font-bold uppercase tracking-[.14em] text-slate-400">
119
+ Skills
120
+ </div>
121
+ )}
122
+ {skills.map(renderRow)}
123
+ {both && (
124
+ <div className="mx-1 mb-2 mt-3 text-[10px] font-bold uppercase tracking-[.14em] text-slate-400">
125
+ Integrations
126
+ </div>
127
+ )}
128
+ {integrations.map(renderRow)}
129
+ <div className="flex h-[46px] items-center justify-center rounded-[11px] border-[1.5px] border-dashed border-[#cbd7e4] text-[11.5px] tracking-[.05em] text-slate-400">
130
+ ◇ pick more from the library
131
+ </div>
132
+ </div>
133
+
134
+ <div className="mt-3">
135
+ {attentionCount > 0 ? (
136
+ <>
137
+ <button
138
+ type="button"
139
+ className="w-full rounded-xl bg-gradient-to-br from-[#0d9488] to-[#0f766e] p-3 text-sm font-bold tracking-[.03em] text-white shadow-[0_6px_20px_rgba(13,148,136,0.22),inset_0_1px_0_rgba(255,255,255,0.35)] transition-transform hover:-translate-y-0.5 active:translate-y-0 active:scale-[.98]"
140
+ onClick={onFinishSetup}
141
+ >
142
+ Finish setup ({attentionCount})
143
+ </button>
144
+ <div className="mt-2 flex items-center justify-center gap-1.5 text-[11.5px] text-[#b45309]">
145
+ Some items need a quick sign-in first
146
+ </div>
147
+ </>
148
+ ) : (
149
+ <div className="rounded-xl border border-[#d2e9e4] bg-[#e6f7f4] p-3 text-center text-[12px] font-semibold text-[#0f766e]">
150
+ Everything in your loadout is ready
151
+ </div>
152
+ )}
153
+ </div>
154
+ </aside>
155
+ );
156
+ }
@@ -1,21 +1,21 @@
1
- import type { GemState } from '../utils/status';
2
-
3
- const GLYPH: Record<GemState, string> = {
4
- ok: '✓',
5
- warn: '!',
6
- err: '✕',
7
- off: '·',
8
- };
9
-
10
- /**
11
- * Glossy status gem from the approved mock — emerald / amber / red / gray with
12
- * a text glyph. Text glyphs (not an icon set) are part of the approved visual
13
- * language; the state text next to it carries the accessible meaning.
14
- */
15
- export function StatusGem({ state, className = '' }: { state: GemState; className?: string }) {
16
- return (
17
- <span className={`lib-gem lib-gem-${state} ${className}`.trim()} aria-hidden="true">
18
- {GLYPH[state]}
19
- </span>
20
- );
21
- }
1
+ import type { GemState } from '../utils/status';
2
+
3
+ const GLYPH: Record<GemState, string> = {
4
+ ok: '✓',
5
+ warn: '!',
6
+ err: '✕',
7
+ off: '·',
8
+ };
9
+
10
+ /**
11
+ * Glossy status gem from the approved mock — emerald / amber / red / gray with
12
+ * a text glyph. Text glyphs (not an icon set) are part of the approved visual
13
+ * language; the state text next to it carries the accessible meaning.
14
+ */
15
+ export function StatusGem({ state, className = '' }: { state: GemState; className?: string }) {
16
+ return (
17
+ <span className={`lib-gem lib-gem-${state} ${className}`.trim()} aria-hidden="true">
18
+ {GLYPH[state]}
19
+ </span>
20
+ );
21
+ }