- apps/desktop: electron-vite + React + Tailwind mapped onto design tokens (preflight off; tokens/base.css owns the reset); boots to a Reginald placeholder proving fonts/tokens/core wiring - packages/core: pure TS; gitea label schema (est/*, p/*, deadline/hard) with pessimistic conflict resolution + 15 unit tests - docs/design: full design handoff (tokens, 16 component contracts, interactive 14-screen prototype, Reginald voice rules) - docs/PLAN.md: product plan (purity rule, pm-state repo, deterministic scheduler + Monte Carlo, directive log) - Deliberate deviation from novelpad stack: no ElectricSQL/PGlite — local store is a rebuildable cache over gitea REST/webhooks (better-sqlite3 in main process, arriving in P1) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
import React from 'react';
|
|
import { Icon } from './Icon';
|
|
|
|
const CSS = `
|
|
.ct-tabs {
|
|
display: flex; gap: 2px;
|
|
border-bottom: 1px solid var(--border-hairline);
|
|
}
|
|
.ct-tab {
|
|
display: inline-flex; align-items: center; gap: 7px;
|
|
font: 500 13.5px/1 var(--font-sans);
|
|
color: var(--ink-2);
|
|
background: none; border: none;
|
|
padding: 10px 12px;
|
|
margin-bottom: -1px;
|
|
border-bottom: 2px solid transparent;
|
|
cursor: pointer;
|
|
transition: color var(--duration-fast) var(--ease-out);
|
|
}
|
|
.ct-tab:hover { color: var(--ink-1); }
|
|
.ct-tab--active {
|
|
color: var(--ink-1);
|
|
font-weight: 600;
|
|
border-bottom-color: var(--accent);
|
|
}
|
|
.ct-tab__count { font: 400 11.5px/1 var(--font-mono); color: var(--ink-3); }
|
|
`;
|
|
(function inject() {
|
|
if (typeof document !== 'undefined' && !document.getElementById('ct-tabs-css')) {
|
|
const s = document.createElement('style'); s.id = 'ct-tabs-css'; s.textContent = CSS;
|
|
document.head.appendChild(s);
|
|
}
|
|
})();
|
|
|
|
export function Tabs({ items, active, onChange, style, ...rest }) {
|
|
return (
|
|
<div className="ct-tabs" role="tablist" style={style} {...rest}>
|
|
{items.map((item) => (
|
|
<button
|
|
key={item.id}
|
|
type="button"
|
|
role="tab"
|
|
aria-selected={item.id === active}
|
|
className={`ct-tab${item.id === active ? ' ct-tab--active' : ''}`}
|
|
onClick={() => onChange && onChange(item.id)}
|
|
>
|
|
{item.icon ? <Icon name={item.icon} size={15} /> : null}
|
|
{item.label}
|
|
{item.count != null ? <span className="ct-tab__count">{item.count}</span> : null}
|
|
</button>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|