Scaffold CommiTea: yarn workspaces, Electron shell, core label schema, design system
- 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>
This commit is contained in:
46
docs/design/components/forms/Select.js.txt
Normal file
46
docs/design/components/forms/Select.js.txt
Normal file
@@ -0,0 +1,46 @@
|
||||
import React from 'react';
|
||||
import { Icon } from '../core/Icon';
|
||||
|
||||
const CSS = `
|
||||
.ct-select-field { display: flex; flex-direction: column; gap: 6px; }
|
||||
.ct-select-field__label { font: 600 13px/1.2 var(--font-sans); color: var(--ink-1); }
|
||||
.ct-select__wrap { position: relative; display: flex; align-items: center; }
|
||||
.ct-select {
|
||||
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 30px 0 12px;
|
||||
appearance: none;
|
||||
cursor: pointer;
|
||||
transition: border-color var(--duration-fast) var(--ease-out);
|
||||
}
|
||||
.ct-select:hover:not(:disabled):not(:focus) { border-color: var(--border-strong); }
|
||||
.ct-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
|
||||
.ct-select:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
.ct-select__chevron { position: absolute; right: 10px; color: var(--ink-3); pointer-events: none; display: flex; }
|
||||
`;
|
||||
(function inject() {
|
||||
if (typeof document !== 'undefined' && !document.getElementById('ct-select-css')) {
|
||||
const s = document.createElement('style'); s.id = 'ct-select-css'; s.textContent = CSS;
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
})();
|
||||
|
||||
export function Select({ label, options, style, ...rest }) {
|
||||
return (
|
||||
<div className="ct-select-field" style={style}>
|
||||
{label ? <label className="ct-select-field__label">{label}</label> : null}
|
||||
<div className="ct-select__wrap">
|
||||
<select className="ct-select" {...rest}>
|
||||
{options.map((o) => (
|
||||
<option key={o.value} value={o.value}>{o.label}</option>
|
||||
))}
|
||||
</select>
|
||||
<span className="ct-select__chevron"><Icon name="chevron-down" size={15} /></span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user