- 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>
52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
import React from 'react';
|
|
import { Icon } from './Icon';
|
|
|
|
const CSS = `
|
|
.ct-iconbtn {
|
|
display: inline-flex; align-items: center; justify-content: center;
|
|
border-radius: var(--radius-2);
|
|
border: 1px solid transparent;
|
|
background: transparent;
|
|
color: var(--ink-2);
|
|
cursor: pointer;
|
|
transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
|
|
}
|
|
.ct-iconbtn:hover:not(:disabled) { background: var(--paper-2); color: var(--ink-1); }
|
|
.ct-iconbtn:active:not(:disabled) { background: var(--paper-3); }
|
|
.ct-iconbtn:disabled { opacity: 0.45; cursor: not-allowed; }
|
|
.ct-iconbtn--md { width: 34px; height: 34px; }
|
|
.ct-iconbtn--sm { width: 28px; height: 28px; }
|
|
.ct-iconbtn--outline { border-color: var(--line-2); background: var(--surface-card); }
|
|
.ct-iconbtn--outline:hover:not(:disabled) { background: var(--paper-2); }
|
|
`;
|
|
(function inject() {
|
|
if (typeof document !== 'undefined' && !document.getElementById('ct-iconbtn-css')) {
|
|
const s = document.createElement('style'); s.id = 'ct-iconbtn-css'; s.textContent = CSS;
|
|
document.head.appendChild(s);
|
|
}
|
|
})();
|
|
|
|
export function IconButton({
|
|
icon,
|
|
label,
|
|
variant = 'ghost',
|
|
size = 'md',
|
|
disabled = false,
|
|
style,
|
|
...rest
|
|
}) {
|
|
return (
|
|
<button
|
|
type="button"
|
|
className={`ct-iconbtn ct-iconbtn--${size}${variant === 'outline' ? ' ct-iconbtn--outline' : ''}`}
|
|
aria-label={label}
|
|
title={label}
|
|
disabled={disabled}
|
|
style={style}
|
|
{...rest}
|
|
>
|
|
<Icon name={icon} size={size === 'sm' ? 15 : 17} />
|
|
</button>
|
|
);
|
|
}
|