5a1e185b1a
phosphor console v1.1 设计系统(从现网 web/style.css 演化):tokens(colors/effects/ typography/fonts) + components(core/forms/surfaces .jsx) + ui_kits(console + console_mobile) + assets/icons(15 双色 SVG) + guidelines + CLAUDE/SKILL/readme。供 B1–B6 重构任务对照实现。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
18 lines
769 B
React
18 lines
769 B
React
import { ensureFieldCss } from './Input.jsx';
|
|
|
|
export function Textarea({ label, required, placeholder, value, defaultValue, onChange, minHeight = 72, danger, style }) {
|
|
ensureFieldCss();
|
|
const ctrl = (
|
|
<textarea className="m-input" placeholder={placeholder} value={value} defaultValue={defaultValue}
|
|
style={{ resize: 'vertical', minHeight, width: '100%', ...(danger ? { borderColor: 'var(--red-dim)' } : {}), ...style }}
|
|
onChange={onChange ? (e) => onChange(e.target.value) : undefined} readOnly={value !== undefined && !onChange} />
|
|
);
|
|
if (!label) return ctrl;
|
|
return (
|
|
<label className="m-label" style={{ width: '100%' }}>
|
|
<span>{label}{required ? <span className="m-req"> *</span> : null}</span>
|
|
{ctrl}
|
|
</label>
|
|
);
|
|
}
|