- 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
2.3 KiB
Plaintext
55 lines
2.3 KiB
Plaintext
import React from 'react';
|
|
import { Icon } from '../core/Icon';
|
|
|
|
const CSS = `
|
|
.ct-field { display: flex; flex-direction: column; gap: 6px; }
|
|
.ct-field__label { font: 600 13px/1.2 var(--font-sans); color: var(--ink-1); }
|
|
.ct-field__wrap { position: relative; display: flex; align-items: center; }
|
|
.ct-field__icon { position: absolute; left: 10px; color: var(--ink-3); pointer-events: none; display: flex; }
|
|
.ct-input {
|
|
width: 100%; height: 34px;
|
|
font: var(--text-body);
|
|
color: var(--ink-1);
|
|
background: var(--surface-card);
|
|
border: 1px solid var(--line-2);
|
|
border-radius: var(--radius-2);
|
|
padding: 0 12px;
|
|
transition: border-color var(--duration-fast) var(--ease-out);
|
|
}
|
|
.ct-input::placeholder { color: var(--ink-3); }
|
|
.ct-input:hover:not(:disabled):not(:focus) { border-color: var(--border-strong); background: var(--paper-1); }
|
|
.ct-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
|
.ct-input:disabled { opacity: 0.5; background: var(--paper-2); cursor: not-allowed; }
|
|
.ct-input--icon { padding-left: 32px; }
|
|
.ct-input--error { border-color: var(--danger); }
|
|
.ct-input--error:focus { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
|
|
.ct-input--mono { font: var(--text-data); }
|
|
.ct-field__hint { font: var(--text-caption); color: var(--ink-3); margin: 0; }
|
|
.ct-field__error { font: var(--text-caption); color: var(--danger); margin: 0; }
|
|
`;
|
|
(function inject() {
|
|
if (typeof document !== 'undefined' && !document.getElementById('ct-input-css')) {
|
|
const s = document.createElement('style'); s.id = 'ct-input-css'; s.textContent = CSS;
|
|
document.head.appendChild(s);
|
|
}
|
|
})();
|
|
|
|
export function Input({ label, hint, error, icon, mono = false, style, ...rest }) {
|
|
const cls = [
|
|
'ct-input',
|
|
icon ? 'ct-input--icon' : '',
|
|
error ? 'ct-input--error' : '',
|
|
mono ? 'ct-input--mono' : '',
|
|
].filter(Boolean).join(' ');
|
|
return (
|
|
<div className="ct-field" style={style}>
|
|
{label ? <label className="ct-field__label">{label}</label> : null}
|
|
<div className="ct-field__wrap">
|
|
{icon ? <span className="ct-field__icon"><Icon name={icon} size={15} /></span> : null}
|
|
<input className={cls} {...rest} />
|
|
</div>
|
|
{error ? <p className="ct-field__error">{error}</p> : hint ? <p className="ct-field__hint">{hint}</p> : null}
|
|
</div>
|
|
);
|
|
}
|