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:
51
docs/design/components/core/IconButton.js.txt
Normal file
51
docs/design/components/core/IconButton.js.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user