@mrpatronz/nexusflow 0.2.17 → 0.2.19
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/.agents/skills/ccc/SKILL.md +71 -0
- package/.agents/skills/ccc/references/management.md +110 -0
- package/.agents/skills/ccc/references/settings.md +126 -0
- package/.github/dependabot.yml +52 -52
- package/.github/workflows/ci.yml +44 -0
- package/.github/workflows/dependabot-merge.yml +53 -53
- package/.github/workflows/release-desktop.yml +67 -0
- package/.github/workflows/release-npm.yml +65 -0
- package/.github/workflows/release-vscode.yml +61 -0
- package/.vscode/launch.json +17 -17
- package/.vscode/tasks.json +17 -17
- package/GETTING_STARTED.md +114 -114
- package/README.md +364 -336
- package/desktop/build-installer.js +228 -228
- package/desktop/build.js +118 -118
- package/desktop/installer/nexusflow.iss +35 -35
- package/desktop/neutralino.config.json +38 -38
- package/desktop/package-lock.json +1060 -1060
- package/desktop/package.json +14 -14
- package/dist/commands/adapter.d.ts +27 -0
- package/dist/commands/adapter.d.ts.map +1 -0
- package/dist/commands/adapter.js +318 -0
- package/dist/commands/adapter.js.map +1 -0
- package/dist/commands/add-repo.d.ts.map +1 -1
- package/dist/commands/add-repo.js +0 -1
- package/dist/commands/add-repo.js.map +1 -1
- package/dist/commands/commands.test.js +2 -2
- package/dist/commands/commands.test.js.map +1 -1
- package/dist/commands/config.d.ts +22 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +50 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +14 -17
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +11 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/refresh.d.ts +1 -0
- package/dist/commands/refresh.d.ts.map +1 -1
- package/dist/commands/refresh.js +2 -14
- package/dist/commands/refresh.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +36 -54
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js +63 -10
- package/dist/commands/tui.js.map +1 -1
- package/dist/core/adapters/local-storage.d.ts +14 -0
- package/dist/core/adapters/local-storage.d.ts.map +1 -0
- package/dist/core/adapters/local-storage.js +58 -0
- package/dist/core/adapters/local-storage.js.map +1 -0
- package/dist/core/adapters/obsidian-storage.d.ts +28 -0
- package/dist/core/adapters/obsidian-storage.d.ts.map +1 -0
- package/dist/core/adapters/obsidian-storage.js +135 -0
- package/dist/core/adapters/obsidian-storage.js.map +1 -0
- package/dist/core/adapters/registry.d.ts +8 -0
- package/dist/core/adapters/registry.d.ts.map +1 -0
- package/dist/core/adapters/registry.js +37 -0
- package/dist/core/adapters/registry.js.map +1 -0
- package/dist/core/adapters/storage.test.d.ts +2 -0
- package/dist/core/adapters/storage.test.d.ts.map +1 -0
- package/dist/core/adapters/storage.test.js +106 -0
- package/dist/core/adapters/storage.test.js.map +1 -0
- package/dist/core/adapters/vault-storage.d.ts +16 -0
- package/dist/core/adapters/vault-storage.d.ts.map +1 -0
- package/dist/core/adapters/vault-storage.js +77 -0
- package/dist/core/adapters/vault-storage.js.map +1 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +28 -4
- package/dist/core/config.js.map +1 -1
- package/dist/core/plugins/index.d.ts +14 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/index.js +2 -0
- package/dist/core/plugins/index.js.map +1 -0
- package/dist/core/plugins/loader.d.ts +2 -0
- package/dist/core/plugins/loader.d.ts.map +1 -0
- package/dist/core/plugins/loader.js +34 -0
- package/dist/core/plugins/loader.js.map +1 -0
- package/dist/core/ports/storage.d.ts +59 -0
- package/dist/core/ports/storage.d.ts.map +1 -0
- package/dist/core/ports/storage.js +10 -0
- package/dist/core/ports/storage.js.map +1 -0
- package/dist/core/storage.d.ts +10 -0
- package/dist/core/storage.d.ts.map +1 -0
- package/dist/core/storage.js +29 -0
- package/dist/core/storage.js.map +1 -0
- package/dist/core/sync.d.ts +44 -0
- package/dist/core/sync.d.ts.map +1 -0
- package/dist/core/sync.js +82 -0
- package/dist/core/sync.js.map +1 -0
- package/dist/core/workspace-state.d.ts +51 -0
- package/dist/core/workspace-state.d.ts.map +1 -0
- package/dist/core/workspace-state.js +108 -0
- package/dist/core/workspace-state.js.map +1 -0
- package/dist/core/workspace-state.test.d.ts +2 -0
- package/dist/core/workspace-state.test.d.ts.map +1 -0
- package/dist/core/workspace-state.test.js +84 -0
- package/dist/core/workspace-state.test.js.map +1 -0
- package/dist/core/workspace.d.ts.map +1 -1
- package/dist/core/workspace.js +110 -16
- package/dist/core/workspace.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +80 -79
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/codex.js +11 -11
- package/dist/generators/copilot.js +17 -17
- package/dist/generators/cursor.js +5 -5
- package/dist/generators/diff-context.d.ts +6 -0
- package/dist/generators/diff-context.d.ts.map +1 -0
- package/dist/generators/diff-context.js +68 -0
- package/dist/generators/diff-context.js.map +1 -0
- package/dist/generators/index.d.ts +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +125 -68
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/map-generator.d.ts.map +1 -1
- package/dist/generators/map-generator.js +21 -25
- package/dist/generators/map-generator.js.map +1 -1
- package/dist/generators/plan-generator.d.ts.map +1 -1
- package/dist/generators/plan-generator.js +3 -5
- package/dist/generators/plan-generator.js.map +1 -1
- package/dist/generators/skills-generator.js +28 -28
- package/dist/gui/assets/index-Bdbld6yY.css +1 -0
- package/dist/gui/assets/index-D8iJPvnk.js +26 -0
- package/dist/gui/icons.svg +24 -24
- package/dist/gui/index.html +18 -18
- package/dist/index.js +131 -20
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +42 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +140 -56
- package/dist/server.js.map +1 -1
- package/dist/server.test.js +105 -48
- package/dist/server.test.js.map +1 -1
- package/dist/types.d.ts +38 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/local-ai.d.ts.map +1 -1
- package/dist/utils/local-ai.js +7 -3
- package/dist/utils/local-ai.js.map +1 -1
- package/dist/utils/multi-git.d.ts +33 -8
- package/dist/utils/multi-git.d.ts.map +1 -1
- package/dist/utils/multi-git.js +91 -19
- package/dist/utils/multi-git.js.map +1 -1
- package/dist/utils/multi-git.test.d.ts +2 -0
- package/dist/utils/multi-git.test.d.ts.map +1 -0
- package/dist/utils/multi-git.test.js +125 -0
- package/dist/utils/multi-git.test.js.map +1 -0
- package/dist/utils/update-check.d.ts.map +1 -1
- package/dist/utils/update-check.js +0 -28
- package/dist/utils/update-check.js.map +1 -1
- package/dist/utils/workflow-advisor.d.ts +16 -0
- package/dist/utils/workflow-advisor.d.ts.map +1 -0
- package/dist/utils/workflow-advisor.js +100 -0
- package/dist/utils/workflow-advisor.js.map +1 -0
- package/extension/package-lock.json +6044 -2673
- package/extension/package.json +117 -108
- package/extension/src/extension.ts +653 -631
- package/extension/tsconfig.json +21 -21
- package/gui/README.md +73 -73
- package/gui/e2e/dashboard.spec.ts +61 -0
- package/gui/e2e/wizard.spec.ts +346 -346
- package/gui/eslint.config.js +26 -26
- package/gui/index.html +17 -17
- package/gui/package-lock.json +3137 -3079
- package/gui/package.json +37 -36
- package/gui/playwright.config.ts +41 -41
- package/gui/public/icons.svg +24 -24
- package/gui/src/App.css +1 -1
- package/gui/src/App.tsx +3573 -3407
- package/gui/src/app/AppSidebar.tsx +69 -0
- package/gui/src/assets/vite.svg +1 -1
- package/gui/src/components/AddRepoPicker.tsx +81 -0
- package/gui/src/components/ui/Button.tsx +40 -0
- package/gui/src/components/ui/Card.tsx +6 -0
- package/gui/src/components/ui/EmptyState.tsx +22 -0
- package/gui/src/components/ui/Input.tsx +21 -0
- package/gui/src/components/ui/Menu.tsx +71 -0
- package/gui/src/components/ui/Modal.tsx +39 -0
- package/gui/src/components/ui/PageHeader.tsx +21 -0
- package/gui/src/components/ui/RepoStatusStrip.tsx +33 -0
- package/gui/src/components/ui/Skeleton.tsx +5 -0
- package/gui/src/components/ui/StatusPill.tsx +36 -0
- package/gui/src/components/ui/Tabs.tsx +40 -0
- package/gui/src/components/ui/cn.ts +4 -0
- package/gui/src/components/ui/index.ts +16 -0
- package/gui/src/features/changes/ChangesViewer.tsx +388 -388
- package/gui/src/features/knowledge/KnowledgeBase.tsx +84 -84
- package/gui/src/features/onboarding/OnboardingWizard.tsx +230 -230
- package/gui/src/features/plan/ImplementationPlan.tsx +32 -32
- package/gui/src/features/services/ServiceConsole.tsx +215 -250
- package/gui/src/features/sessions/SessionHistory.tsx +195 -195
- package/gui/src/index.css +167 -152
- package/gui/src/lib/status.ts +24 -0
- package/gui/src/main.tsx +94 -94
- package/gui/src/pages/DashboardPage.tsx +129 -0
- package/gui/src/pages/WorkspacesPage.tsx +352 -0
- package/gui/src/types.ts +81 -62
- package/gui/tsconfig.app.json +25 -25
- package/gui/tsconfig.json +7 -7
- package/gui/tsconfig.node.json +24 -24
- package/gui/vite.config.ts +12 -12
- package/package.json +55 -56
- package/resources/workflows/plan-implement-review.md +8 -8
- package/resources/workflows/research-verify.md +6 -6
- package/resources/workflows/solo-developer.md +3 -3
- package/scripts/simulate-workspaces.ts +55 -55
- package/skills-lock.json +11 -0
- package/src/analyzers/detect-apis.ts +290 -290
- package/src/analyzers/detect-deps.ts +315 -315
- package/src/analyzers/detect-existing.ts +74 -74
- package/src/analyzers/detect-ports.ts +110 -110
- package/src/analyzers/index.ts +97 -97
- package/src/analyzers/messaging-analyzer.ts +254 -254
- package/src/analyzers/readme-summarizer.ts +102 -102
- package/src/analyzers/run-analyzer.ts +269 -269
- package/src/analyzers/tech-stack.ts +283 -283
- package/src/commands/adapter.ts +348 -0
- package/src/commands/add-repo.ts +156 -157
- package/src/commands/commands.test.ts +156 -155
- package/src/commands/commit.ts +131 -131
- package/src/commands/config.ts +52 -0
- package/src/commands/create.ts +204 -207
- package/src/commands/desktop.ts +128 -128
- package/src/commands/diff.ts +125 -125
- package/src/commands/doctor.ts +370 -357
- package/src/commands/handoff.ts +266 -266
- package/src/commands/init.ts +134 -134
- package/src/commands/list.ts +46 -46
- package/src/commands/logs.ts +63 -63
- package/src/commands/mcp.ts +94 -92
- package/src/commands/open.ts +129 -129
- package/src/commands/refresh.ts +137 -147
- package/src/commands/remove.ts +98 -98
- package/src/commands/start.ts +117 -117
- package/src/commands/status.ts +54 -54
- package/src/commands/stop.ts +55 -55
- package/src/commands/sync.ts +125 -151
- package/src/commands/tui.ts +484 -424
- package/src/commands/ui.ts +111 -111
- package/src/core/adapters/local-storage.ts +66 -0
- package/src/core/adapters/obsidian-storage.ts +151 -0
- package/src/core/adapters/registry.ts +44 -0
- package/src/core/adapters/storage.test.ts +174 -0
- package/src/core/adapters/vault-storage.ts +86 -0
- package/src/core/config.test.ts +96 -96
- package/src/core/config.ts +140 -115
- package/src/core/graph.ts +344 -344
- package/src/core/plugins/index.ts +17 -0
- package/src/core/plugins/loader.ts +36 -0
- package/src/core/ports/storage.ts +71 -0
- package/src/core/scanner.test.ts +61 -61
- package/src/core/scanner.ts +91 -91
- package/src/core/storage.ts +37 -0
- package/src/core/sync.ts +121 -0
- package/src/core/workspace-state.test.ts +108 -0
- package/src/core/workspace-state.ts +130 -0
- package/src/core/workspace.ts +487 -380
- package/src/core/worktree.ts +120 -120
- package/src/generators/antigravity.ts +32 -32
- package/src/generators/base.ts +243 -240
- package/src/generators/claude.ts +34 -34
- package/src/generators/codex.ts +48 -48
- package/src/generators/copilot.ts +56 -56
- package/src/generators/cursor.ts +44 -44
- package/src/generators/diff-context.ts +75 -0
- package/src/generators/index.ts +322 -250
- package/src/generators/map-generator.test.ts +159 -159
- package/src/generators/map-generator.ts +539 -542
- package/src/generators/plan-generator.ts +483 -481
- package/src/generators/skills-generator.ts +259 -259
- package/src/index.ts +539 -426
- package/src/mcp/server.ts +338 -294
- package/src/orchestration/detect.ts +313 -313
- package/src/orchestration/index.ts +7 -7
- package/src/orchestration/runner.ts +283 -283
- package/src/server.test.ts +618 -555
- package/src/server.ts +1402 -1308
- package/src/types.ts +451 -408
- package/src/utils/detect-ai.test.ts +44 -44
- package/src/utils/detect-ai.ts +84 -84
- package/src/utils/detect-editors.test.ts +48 -48
- package/src/utils/detect-editors.ts +57 -57
- package/src/utils/git.test.ts +74 -74
- package/src/utils/git.ts +117 -117
- package/src/utils/local-ai.test.ts +130 -130
- package/src/utils/local-ai.ts +116 -111
- package/src/utils/multi-git.test.ts +158 -0
- package/src/utils/multi-git.ts +405 -313
- package/src/utils/prompts.ts +209 -209
- package/src/utils/session-finder.ts +483 -483
- package/src/utils/system-scanner.test.ts +89 -89
- package/src/utils/system-scanner.ts +96 -96
- package/src/utils/update-check.ts +286 -309
- package/src/utils/workflow-advisor.ts +118 -0
- package/src/utils/workflows.test.ts +114 -114
- package/src/utils/workflows.ts +178 -178
- package/tsconfig.json +19 -19
- package/vitest.config.ts +14 -14
- package/.github/workflows/release.yml +0 -112
- package/dist/commands/pack.d.ts +0 -7
- package/dist/commands/pack.d.ts.map +0 -1
- package/dist/commands/pack.js +0 -64
- package/dist/commands/pack.js.map +0 -1
- package/dist/core/packer.d.ts +0 -14
- package/dist/core/packer.d.ts.map +0 -1
- package/dist/core/packer.js +0 -87
- package/dist/core/packer.js.map +0 -1
- package/dist/core/packer.test.d.ts +0 -2
- package/dist/core/packer.test.d.ts.map +0 -1
- package/dist/core/packer.test.js +0 -82
- package/dist/core/packer.test.js.map +0 -1
- package/dist/gui/assets/index-Ct3qq-X4.js +0 -25
- package/dist/gui/assets/index-P_ZrgHXg.css +0 -1
- package/gui/src/features/workspace/WorkspaceList.tsx +0 -666
- package/src/commands/pack.ts +0 -73
- package/src/core/packer.test.ts +0 -99
- package/src/core/packer.ts +0 -107
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LayoutDashboard, FolderGit2, Workflow, Settings as SettingsIcon, BookOpen, Plus, type LucideIcon } from 'lucide-react';
|
|
2
|
+
import { cn } from '../components/ui/index.js';
|
|
3
|
+
|
|
4
|
+
interface NavItem {
|
|
5
|
+
label: string;
|
|
6
|
+
to: string;
|
|
7
|
+
icon: LucideIcon;
|
|
8
|
+
match: (p: string) => boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ITEMS: NavItem[] = [
|
|
12
|
+
{ label: 'Overview', to: '/', icon: LayoutDashboard, match: (p) => p === '/' },
|
|
13
|
+
{ label: 'Workspaces', to: '/workspaces', icon: FolderGit2, match: (p) => p.startsWith('/workspaces') },
|
|
14
|
+
{ label: 'Strategies', to: '/strategies', icon: Workflow, match: (p) => p.startsWith('/strategies') },
|
|
15
|
+
{ label: 'Settings', to: '/settings', icon: SettingsIcon, match: (p) => p.startsWith('/settings') },
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export function AppSidebar({
|
|
19
|
+
pathname,
|
|
20
|
+
appVersion,
|
|
21
|
+
onNavigate,
|
|
22
|
+
onNewWorkspace,
|
|
23
|
+
}: {
|
|
24
|
+
pathname: string;
|
|
25
|
+
appVersion: string;
|
|
26
|
+
onNavigate: (to: string) => void;
|
|
27
|
+
onNewWorkspace: () => void;
|
|
28
|
+
}) {
|
|
29
|
+
const linkClass = (active: boolean) =>
|
|
30
|
+
cn(
|
|
31
|
+
'flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-colors cursor-pointer',
|
|
32
|
+
active ? 'bg-accent-soft text-accent' : 'text-content-muted hover:bg-raised hover:text-content',
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<aside className="flex w-60 shrink-0 flex-col border-r border-hairline bg-surface/40 p-4">
|
|
37
|
+
<div className="mb-5 flex items-center gap-2.5 px-2 py-1">
|
|
38
|
+
<div className="grid h-8 w-8 place-items-center rounded-md bg-accent font-display text-sm font-bold text-white">NF</div>
|
|
39
|
+
<span className="font-display text-sm font-semibold text-content">NexusFlow</span>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<button
|
|
43
|
+
onClick={onNewWorkspace}
|
|
44
|
+
className="mb-5 inline-flex items-center justify-center gap-2 rounded-md bg-accent px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-hover cursor-pointer"
|
|
45
|
+
>
|
|
46
|
+
<Plus size={16} /> New workspace
|
|
47
|
+
</button>
|
|
48
|
+
|
|
49
|
+
<nav className="flex flex-1 flex-col gap-1">
|
|
50
|
+
{ITEMS.map((it) => {
|
|
51
|
+
const Icon = it.icon;
|
|
52
|
+
return (
|
|
53
|
+
<button key={it.to} onClick={() => onNavigate(it.to)} className={linkClass(it.match(pathname))}>
|
|
54
|
+
<Icon size={16} /> {it.label}
|
|
55
|
+
</button>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
</nav>
|
|
59
|
+
|
|
60
|
+
<button onClick={() => onNavigate('/guide')} className={linkClass(pathname.startsWith('/guide'))}>
|
|
61
|
+
<BookOpen size={16} /> Getting started
|
|
62
|
+
</button>
|
|
63
|
+
|
|
64
|
+
<div className="mt-3 border-t border-hairline pt-3 text-center text-[10px] font-medium uppercase tracking-wider text-content-faint">
|
|
65
|
+
NexusFlow v{appVersion}
|
|
66
|
+
</div>
|
|
67
|
+
</aside>
|
|
68
|
+
);
|
|
69
|
+
}
|
package/gui/src/assets/vite.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react';
|
|
2
|
+
import { Plus, Search } from 'lucide-react';
|
|
3
|
+
import type { RepoInfo } from '../types.js';
|
|
4
|
+
import { Input } from './ui/index.js';
|
|
5
|
+
|
|
6
|
+
/** A searchable popover for attaching another repository to a workspace. */
|
|
7
|
+
export function AddRepoPicker({
|
|
8
|
+
repos,
|
|
9
|
+
disabled,
|
|
10
|
+
onAdd,
|
|
11
|
+
}: {
|
|
12
|
+
repos: RepoInfo[];
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onAdd: (repoPath: string) => void;
|
|
15
|
+
}) {
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
const [query, setQuery] = useState('');
|
|
18
|
+
|
|
19
|
+
const filtered = useMemo(() => {
|
|
20
|
+
const q = query.trim().toLowerCase();
|
|
21
|
+
if (!q) return repos;
|
|
22
|
+
return repos.filter((r) => r.name.toLowerCase().includes(q) || r.path.toLowerCase().includes(q));
|
|
23
|
+
}, [repos, query]);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div className="relative">
|
|
27
|
+
<button
|
|
28
|
+
type="button"
|
|
29
|
+
disabled={disabled}
|
|
30
|
+
aria-haspopup="listbox"
|
|
31
|
+
aria-expanded={open}
|
|
32
|
+
onClick={() => {
|
|
33
|
+
setQuery('');
|
|
34
|
+
setOpen((o) => !o);
|
|
35
|
+
}}
|
|
36
|
+
className="inline-flex items-center gap-1.5 rounded-md border border-hairline bg-surface px-3 py-1.5 text-xs font-medium text-content-muted transition-colors hover:bg-raised hover:text-content disabled:cursor-not-allowed disabled:opacity-40 cursor-pointer"
|
|
37
|
+
>
|
|
38
|
+
<Plus size={14} /> Add repository
|
|
39
|
+
</button>
|
|
40
|
+
|
|
41
|
+
{open && (
|
|
42
|
+
<>
|
|
43
|
+
<div className="fixed inset-0 z-40" aria-hidden="true" onClick={() => setOpen(false)} />
|
|
44
|
+
<div className="absolute right-0 z-50 mt-1.5 w-72 overflow-hidden rounded-lg border border-hairline bg-raised shadow-xl animate-fade-in">
|
|
45
|
+
<div className="relative border-b border-hairline p-2">
|
|
46
|
+
<Search size={14} className="pointer-events-none absolute left-4 top-1/2 -translate-y-1/2 text-content-faint" />
|
|
47
|
+
<Input
|
|
48
|
+
autoFocus
|
|
49
|
+
value={query}
|
|
50
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
51
|
+
placeholder="Search repositories"
|
|
52
|
+
className="pl-8"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<div role="listbox" className="max-h-64 overflow-y-auto py-1">
|
|
56
|
+
{filtered.length === 0 ? (
|
|
57
|
+
<div className="px-3 py-4 text-center text-xs text-content-faint">No repositories found.</div>
|
|
58
|
+
) : (
|
|
59
|
+
filtered.map((r) => (
|
|
60
|
+
<button
|
|
61
|
+
key={r.path}
|
|
62
|
+
role="option"
|
|
63
|
+
aria-selected={false}
|
|
64
|
+
onClick={() => {
|
|
65
|
+
setOpen(false);
|
|
66
|
+
onAdd(r.path);
|
|
67
|
+
}}
|
|
68
|
+
className="flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left transition-colors hover:bg-surface cursor-pointer"
|
|
69
|
+
>
|
|
70
|
+
<span className="font-mono text-xs font-semibold text-content">{r.name}</span>
|
|
71
|
+
<span className="w-full truncate text-[10px] text-content-faint">{r.path}</span>
|
|
72
|
+
</button>
|
|
73
|
+
))
|
|
74
|
+
)}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { cn } from './cn.js';
|
|
3
|
+
|
|
4
|
+
type Variant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
|
+
type Size = 'sm' | 'md';
|
|
6
|
+
|
|
7
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
variant?: Variant;
|
|
9
|
+
size?: Size;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const VARIANTS: Record<Variant, string> = {
|
|
14
|
+
primary: 'bg-accent text-white hover:bg-accent-hover border border-transparent',
|
|
15
|
+
secondary: 'bg-surface text-content border border-hairline hover:bg-raised hover:border-hairline-strong',
|
|
16
|
+
ghost: 'bg-transparent text-content-muted hover:text-content hover:bg-raised border border-transparent',
|
|
17
|
+
danger: 'bg-transparent text-danger border border-danger/40 hover:bg-danger/10',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const SIZES: Record<Size, string> = {
|
|
21
|
+
sm: 'text-xs px-2.5 py-1.5 gap-1.5 rounded-md',
|
|
22
|
+
md: 'text-sm px-3.5 py-2 gap-2 rounded-md',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function Button({ variant = 'secondary', size = 'md', icon, className, children, ...rest }: ButtonProps) {
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
className={cn(
|
|
29
|
+
'inline-flex items-center justify-center font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed',
|
|
30
|
+
VARIANTS[variant],
|
|
31
|
+
SIZES[size],
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
36
|
+
{icon}
|
|
37
|
+
{children}
|
|
38
|
+
</button>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export function EmptyState({
|
|
4
|
+
icon,
|
|
5
|
+
title,
|
|
6
|
+
description,
|
|
7
|
+
action,
|
|
8
|
+
}: {
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
action?: ReactNode;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<div className="flex flex-col items-center justify-center px-6 py-16 text-center">
|
|
16
|
+
{icon && <div className="mb-3 text-content-faint">{icon}</div>}
|
|
17
|
+
<h3 className="font-display text-lg font-semibold text-content">{title}</h3>
|
|
18
|
+
{description && <p className="mt-1 max-w-sm text-sm text-content-muted">{description}</p>}
|
|
19
|
+
{action && <div className="mt-4">{action}</div>}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, SelectHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from './cn.js';
|
|
3
|
+
|
|
4
|
+
const base =
|
|
5
|
+
'w-full bg-base border border-hairline rounded-md px-3 py-2 text-sm text-content placeholder:text-content-faint outline-none focus:border-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed';
|
|
6
|
+
|
|
7
|
+
export function Input({ className, ...rest }: InputHTMLAttributes<HTMLInputElement>) {
|
|
8
|
+
return <input className={cn(base, className)} {...rest} />;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function Textarea({ className, ...rest }: TextareaHTMLAttributes<HTMLTextAreaElement>) {
|
|
12
|
+
return <textarea className={cn(base, 'resize-y leading-relaxed', className)} {...rest} />;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function Select({ className, children, ...rest }: SelectHTMLAttributes<HTMLSelectElement>) {
|
|
16
|
+
return (
|
|
17
|
+
<select className={cn(base, 'cursor-pointer', className)} {...rest}>
|
|
18
|
+
{children}
|
|
19
|
+
</select>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useState, type ReactNode } from 'react';
|
|
2
|
+
import { cn } from './cn.js';
|
|
3
|
+
|
|
4
|
+
export interface MenuItem {
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function Menu({
|
|
13
|
+
trigger,
|
|
14
|
+
items,
|
|
15
|
+
align = 'right',
|
|
16
|
+
label,
|
|
17
|
+
}: {
|
|
18
|
+
trigger: ReactNode;
|
|
19
|
+
items: MenuItem[];
|
|
20
|
+
align?: 'left' | 'right';
|
|
21
|
+
label?: string;
|
|
22
|
+
}) {
|
|
23
|
+
const [open, setOpen] = useState(false);
|
|
24
|
+
return (
|
|
25
|
+
<div className="relative">
|
|
26
|
+
<button
|
|
27
|
+
type="button"
|
|
28
|
+
aria-haspopup="menu"
|
|
29
|
+
aria-expanded={open}
|
|
30
|
+
aria-label={label}
|
|
31
|
+
onClick={() => setOpen((o) => !o)}
|
|
32
|
+
className="inline-flex items-center justify-center cursor-pointer"
|
|
33
|
+
>
|
|
34
|
+
{trigger}
|
|
35
|
+
</button>
|
|
36
|
+
{open && (
|
|
37
|
+
<>
|
|
38
|
+
<div className="fixed inset-0 z-40" aria-hidden="true" onClick={() => setOpen(false)} />
|
|
39
|
+
<div
|
|
40
|
+
role="menu"
|
|
41
|
+
className={cn(
|
|
42
|
+
'absolute z-50 mt-1.5 min-w-48 rounded-lg border border-hairline bg-raised py-1 shadow-xl animate-fade-in',
|
|
43
|
+
align === 'right' ? 'right-0' : 'left-0',
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
{items.map((it, i) => (
|
|
47
|
+
<div key={i}>
|
|
48
|
+
{it.danger && <div className="my-1 h-px bg-hairline" />}
|
|
49
|
+
<button
|
|
50
|
+
role="menuitem"
|
|
51
|
+
disabled={it.disabled}
|
|
52
|
+
onClick={() => {
|
|
53
|
+
setOpen(false);
|
|
54
|
+
it.onClick();
|
|
55
|
+
}}
|
|
56
|
+
className={cn(
|
|
57
|
+
'flex w-full items-center gap-2.5 px-3 py-2 text-sm font-medium transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed',
|
|
58
|
+
it.danger ? 'text-danger hover:bg-danger/10' : 'text-content-muted hover:bg-surface hover:text-content',
|
|
59
|
+
)}
|
|
60
|
+
>
|
|
61
|
+
{it.icon}
|
|
62
|
+
{it.label}
|
|
63
|
+
</button>
|
|
64
|
+
</div>
|
|
65
|
+
))}
|
|
66
|
+
</div>
|
|
67
|
+
</>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { X } from 'lucide-react';
|
|
3
|
+
import { cn } from './cn.js';
|
|
4
|
+
|
|
5
|
+
export function Modal({
|
|
6
|
+
open,
|
|
7
|
+
onClose,
|
|
8
|
+
title,
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
}: {
|
|
12
|
+
open: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}) {
|
|
18
|
+
if (!open) return null;
|
|
19
|
+
return (
|
|
20
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center p-4">
|
|
21
|
+
<div className="absolute inset-0 bg-black/70" onClick={onClose} aria-hidden="true" />
|
|
22
|
+
<div
|
|
23
|
+
role="dialog"
|
|
24
|
+
aria-modal="true"
|
|
25
|
+
className={cn('relative z-10 w-full max-w-lg rounded-lg border border-hairline bg-surface shadow-2xl animate-rise', className)}
|
|
26
|
+
>
|
|
27
|
+
{title && (
|
|
28
|
+
<div className="flex items-center justify-between border-b border-hairline px-5 py-3.5">
|
|
29
|
+
<h3 className="font-display font-semibold text-content">{title}</h3>
|
|
30
|
+
<button onClick={onClose} className="cursor-pointer text-content-faint hover:text-content" aria-label="Close">
|
|
31
|
+
<X size={16} />
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
)}
|
|
35
|
+
{children}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export function PageHeader({
|
|
4
|
+
title,
|
|
5
|
+
subtitle,
|
|
6
|
+
actions,
|
|
7
|
+
}: {
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
subtitle?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
}) {
|
|
12
|
+
return (
|
|
13
|
+
<div className="mb-6 flex items-start justify-between gap-4">
|
|
14
|
+
<div className="min-w-0">
|
|
15
|
+
<h1 className="font-display text-2xl font-bold tracking-tight text-content">{title}</h1>
|
|
16
|
+
{subtitle && <p className="mt-1 text-sm text-content-muted">{subtitle}</p>}
|
|
17
|
+
</div>
|
|
18
|
+
{actions && <div className="flex shrink-0 items-center gap-2">{actions}</div>}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from './cn.js';
|
|
2
|
+
|
|
3
|
+
export type RepoState = 'clean' | 'changes' | 'conflict' | 'unknown';
|
|
4
|
+
|
|
5
|
+
const STATE_DOT: Record<RepoState, string> = {
|
|
6
|
+
clean: 'bg-success',
|
|
7
|
+
changes: 'bg-warning',
|
|
8
|
+
conflict: 'bg-danger',
|
|
9
|
+
unknown: 'bg-idle',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export interface RepoDot {
|
|
13
|
+
name: string;
|
|
14
|
+
state?: RepoState;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Signature element: a row of per-repo status dots, reused across dashboard, list and detail. */
|
|
18
|
+
export function RepoStatusStrip({ repos, className }: { repos: RepoDot[]; className?: string }) {
|
|
19
|
+
return (
|
|
20
|
+
<div className={cn('flex flex-wrap items-center gap-1.5', className)}>
|
|
21
|
+
{repos.map((r) => (
|
|
22
|
+
<span
|
|
23
|
+
key={r.name}
|
|
24
|
+
title={`${r.name}${r.state ? ` · ${r.state}` : ''}`}
|
|
25
|
+
className="inline-flex items-center gap-1.5 rounded border border-hairline bg-base px-2 py-0.5 font-mono text-[11px] font-medium text-content-muted"
|
|
26
|
+
>
|
|
27
|
+
<span className={cn('h-1.5 w-1.5 rounded-full', STATE_DOT[r.state ?? 'unknown'])} />
|
|
28
|
+
{r.name}
|
|
29
|
+
</span>
|
|
30
|
+
))}
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { cn } from './cn.js';
|
|
3
|
+
|
|
4
|
+
export type Tone = 'success' | 'warning' | 'danger' | 'running' | 'idle' | 'accent' | 'neutral';
|
|
5
|
+
|
|
6
|
+
const TONES: Record<Tone, string> = {
|
|
7
|
+
success: 'text-success border-success/30 bg-success/10',
|
|
8
|
+
warning: 'text-warning border-warning/30 bg-warning/10',
|
|
9
|
+
danger: 'text-danger border-danger/30 bg-danger/10',
|
|
10
|
+
running: 'text-running border-running/30 bg-running/10',
|
|
11
|
+
idle: 'text-content-faint border-hairline bg-surface',
|
|
12
|
+
accent: 'text-accent border-accent/30 bg-accent-soft',
|
|
13
|
+
neutral: 'text-content-muted border-hairline bg-raised',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function StatusPill({
|
|
17
|
+
tone = 'neutral',
|
|
18
|
+
dot,
|
|
19
|
+
title,
|
|
20
|
+
children,
|
|
21
|
+
}: {
|
|
22
|
+
tone?: Tone;
|
|
23
|
+
dot?: boolean;
|
|
24
|
+
title?: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}) {
|
|
27
|
+
return (
|
|
28
|
+
<span
|
|
29
|
+
title={title}
|
|
30
|
+
className={cn('inline-flex items-center gap-1.5 text-[11px] font-medium px-2 py-0.5 rounded-md border whitespace-nowrap', TONES[tone])}
|
|
31
|
+
>
|
|
32
|
+
{dot && <span className="h-1.5 w-1.5 rounded-full bg-current" />}
|
|
33
|
+
{children}
|
|
34
|
+
</span>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cn } from './cn.js';
|
|
2
|
+
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function Tabs({
|
|
9
|
+
items,
|
|
10
|
+
value,
|
|
11
|
+
onChange,
|
|
12
|
+
className,
|
|
13
|
+
}: {
|
|
14
|
+
items: TabItem[];
|
|
15
|
+
value: string;
|
|
16
|
+
onChange: (v: string) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<div role="tablist" className={cn('flex items-center gap-1 border-b border-hairline overflow-x-auto', className)}>
|
|
21
|
+
{items.map((it) => {
|
|
22
|
+
const active = it.value === value;
|
|
23
|
+
return (
|
|
24
|
+
<button
|
|
25
|
+
key={it.value}
|
|
26
|
+
role="tab"
|
|
27
|
+
aria-selected={active}
|
|
28
|
+
onClick={() => onChange(it.value)}
|
|
29
|
+
className={cn(
|
|
30
|
+
'-mb-px whitespace-nowrap border-b-2 px-3 py-2 text-sm font-medium transition-colors cursor-pointer',
|
|
31
|
+
active ? 'text-content border-accent' : 'text-content-faint border-transparent hover:text-content',
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{it.label}
|
|
35
|
+
</button>
|
|
36
|
+
);
|
|
37
|
+
})}
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { cn } from './cn.js';
|
|
2
|
+
export { Button } from './Button.js';
|
|
3
|
+
export { Card } from './Card.js';
|
|
4
|
+
export { StatusPill } from './StatusPill.js';
|
|
5
|
+
export type { Tone } from './StatusPill.js';
|
|
6
|
+
export { Tabs } from './Tabs.js';
|
|
7
|
+
export type { TabItem } from './Tabs.js';
|
|
8
|
+
export { Input, Textarea, Select } from './Input.js';
|
|
9
|
+
export { Menu } from './Menu.js';
|
|
10
|
+
export type { MenuItem } from './Menu.js';
|
|
11
|
+
export { Modal } from './Modal.js';
|
|
12
|
+
export { Skeleton } from './Skeleton.js';
|
|
13
|
+
export { EmptyState } from './EmptyState.js';
|
|
14
|
+
export { PageHeader } from './PageHeader.js';
|
|
15
|
+
export { RepoStatusStrip } from './RepoStatusStrip.js';
|
|
16
|
+
export type { RepoDot, RepoState } from './RepoStatusStrip.js';
|