import React from 'react'; import './Input.css'; /* 输入框(移动端)— 规格 §27 结构:field(容器)> input(框)> prefix / control / clear + error(框外提示)。 控件是原生 input:键盘、输入法、autofill 都用系统能力,组件不自造输入法。 有值且 clearable 时才出现清除按钮;错误态同时写 is-error 与 aria-invalid, 错误文案用 aria-describedby 关联(规格 §27.6)。 */ export default function Input({ value = '', size = 'default', placeholder = '', prefix = '', clearable = false, disabled = false, error = '', label = '输入框', onInput, onConfirm, onClear, children = null, }) { const filled = String(value || '').length > 0; const fieldCls = 'kole-m-input' + (size === 'large' ? ' kole-m-input--large' : '') + (filled ? ' is-filled' : '') + (error ? ' is-error' : '') + (disabled ? ' is-disabled' : ''); const errorId = 'kole-m-input-error'; return (