42d3fedbaa
* fix(ci): fix release workflow artifact upload issue - Split artifact upload into 3 separate steps (Chrome, Firefox, Source) - Update download steps to match new artifact names - Add if-no-files-found: error for better error handling - Fix Node.js 20 compatibility issue with upload-artifact@v4 glob pattern * docs: 更新 AGENTS.md,添加测试工具和翻译文件结构说明 * docs: 更新 AGENTS.md,完善 CI 步骤和存储键名格式说明 * fix: remove unnecessary animations from StorageCleaner page - Remove entrance animations (animate-in, fade-in, zoom-in) from all components - Remove scale effect (active:scale-[0.99]) from clean button - Remove transition effects (transition-all, transition-colors) from OptionItem, StorageOptionsGrid, AutoRefreshToggle - Remove bouncing animation from error icon - Remove pulsing animation from warning banner - Keep animate-spin on button loading spinner as functional indicator * fix: remove unnecessary animations from RightClickRestorer page * fix: remove all unnecessary animations from all pages - Remove dead code animations (animate-in, fade-in, slide-in, zoom-in, shake) from tailwindcss-animate plugin (not installed) - Remove decorative transition effects (transition-all, transition-colors) from all page components - Remove scale effects (active:scale-95) from buttons - Remove bounce animations (animate-bounce) from icons - Keep functional animate-spin on loading spinners as they provide essential loading feedback Affected pages: Dashboard, Timestamp, Jwt, JsonTools, Base64Converter, HtmlToMarkdown, MarkdownToHtml, QrCode, TextStatistics --------- Co-authored-by: Ubuntu <ubuntu@localhost.localdomain>
58 lines
2.2 KiB
TypeScript
58 lines
2.2 KiB
TypeScript
import TextInputArea from '@/components/TextInputArea';
|
|
import QrCodePreview from '@/components/QrCodePreview';
|
|
import { useLazyTranslation } from '@/utils/useLazyTranslation';
|
|
import { useQrCodeContext } from '../contexts/QrCodeContext';
|
|
import { Label } from '@/components/ui/label';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
export default function GeneratePanel() {
|
|
const { t } = useLazyTranslation('qrCode');
|
|
const { generatorState, setTextToEncode, downloadQrCode, copyQrCode } = useQrCodeContext();
|
|
|
|
return (
|
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 w-full items-stretch select-none p-0.5">
|
|
{/* 左翼:高性能受控输入翼终端 */}
|
|
<div
|
|
className={cn(
|
|
'border border-border rounded-xl bg-card text-card-foreground shadow-sm flex flex-col p-4',
|
|
'focus-within:ring-1 focus-within:ring-ring focus-within:border-ring',
|
|
)}
|
|
>
|
|
{/* 💡 2. 独立外置标签架(A11y 无障碍对齐):
|
|
- 彻底删掉 TextInputArea 上引发崩溃的违规属性。
|
|
- 改用正统的 <Label />,并注入标准的高度无障碍样式,间距比例极度平滑。
|
|
*/}
|
|
<div className="flex flex-col space-y-2.5 h-full">
|
|
<Label className="text-[10px] font-bold text-muted-foreground/90 uppercase tracking-wider select-none pl-0.5">
|
|
{t('qrCode:urlInputLabel')}
|
|
</Label>
|
|
|
|
<div className="flex-1 min-h-0">
|
|
<TextInputArea
|
|
value={generatorState.textToEncode}
|
|
onChange={setTextToEncode}
|
|
placeholder={t('qrCode:urlInputPlaceholder')}
|
|
showCount={true}
|
|
showClear={true}
|
|
allowCopy={true}
|
|
minRows={6}
|
|
maxRows={12}
|
|
externalError={generatorState.inputError || undefined}
|
|
onClear={() => setTextToEncode('')}
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{/* 右翼:活态二维码高精生成区 */}
|
|
<div className="flex flex-col h-full">
|
|
<QrCodePreview
|
|
qrCodeDataUrl={generatorState.qrCodeDataUrl}
|
|
onDownload={downloadQrCode}
|
|
onCopy={copyQrCode}
|
|
/>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|