ChatInput / HeroPromptInput 预览

所有 album-cover-generator / ai-midi-generator / music workspace 等地方共用的 prompt 输入组件。提交后会用 toast 展示解析到的 message。

0. Music workspace (expansion slot + collapsed tools)

演示在 textarea 下方推一个可扩展区域(Lyrics 编辑器),并把 model / instrumental 前置到 toolbar。Image/Audio/Attach 默认收纳到 + 按钮。

10 CR
State: model = aether · mode = vocal · lyrics = closed · (empty)

最左 + 按钮 hover 时沿弧线向左上扇形展开 Image / Audio / Attach(黏糊糊的 gooey filter 仅在展开期间挂上,关闭后卸载, 平时零开销)。首次进入会自动播一次引导动画(记入 localStorage, 再次访问不再重播;清 gooey-showcase:music-workspace-gooey-tools 可还原)。右下 Vocals / Instrumental 二段 segmented,默认 Vocals (仅 ~10% 用户需要纯器乐);点 Lyrics 自动切回 Vocals,选 Instrumental 自动收起 Lyrics。

0-1. Music workspace — larger size variant

跟 0. 的差异:textarea text-base→text-lg;toolbar 图标 size-3.5→size-4 文字 text-xs→text-sm 按钮 h-8→h-10;submit 圆形按钮 32→44px。视觉权重更接近 hero CTA 风格。

10 CR

0a. Attachment cards (image / audio / pdf)

演示统一卡片(288×72):图片缩略图 · 音频封面/播放键 + 时长与底边进度 · PDF 首页缩略图(pdfjs 渲染)· 未知文件 fallback。可同时拖入多种类型测试横向滚动轨道。

提示:playground 默认 maxFileSize = 10MB。PDF 用小文件测试更顺;pdfjs worker 走 CDN,首次加载需联网。

1. Basic ChatInput

最朴素的形态:textarea + submit 按钮,无文件、无参数。

2. HeroPromptInput

带 hero 大尺寸样式,用于 landing / tool 首屏的输入。

3. With image upload (acceptKind=image)

image picker,仅接受图片;这里走 fakeUpload 返回 data URL。

4. With audio picker + record

audio picker + 录音按钮,music workspace 用的形态。

5. Album-cover full layout

hero + DiceButton + 参数 select 行 + submit credits pill(这正是 /album-cover-generator 当前形态)。

6. Streaming mode

提交后按钮变 stop(isStreaming),点 stop 触发 onStop。4 秒自动结束。

7. Disabled

完全禁用态:textarea + 工具按钮 + submit 都灰掉。