{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "inline-copy-input", "type": "registry:ui", "title": "Inline Copy Input", "description": "iOS 26 liquid-glass copy input with animated clipboard/check icon swap and haptic sound.", "dependencies": [ "motion" ], "files": [ { "path": "registry/ruixenui/inline-copy-input.tsx", "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\n\n/* ── sound ── */\nlet _a: AudioContext, _b: AudioBuffer;\nconst tick = () => {\n if (typeof window === \"undefined\") return;\n if (!_a) {\n _a = new AudioContext();\n _b = _a.createBuffer(1, (_a.sampleRate * 0.003) | 0, _a.sampleRate);\n const d = _b.getChannelData(0);\n for (let i = 0; i < d.length; i++)\n d[i] = (Math.random() * 2 - 1) * (1 - i / d.length) ** 4;\n }\n const s = _a.createBufferSource();\n s.buffer = _b;\n const g = _a.createGain();\n g.gain.value = 0.08;\n s.connect(g).connect(_a.destination);\n s.start();\n};\n\n/* ── theme ── */\nconst CSS = `\n.ci{\n --ci-glass:linear-gradient(180deg,rgba(255,255,255,0.78),rgba(255,255,255,0.62));\n --ci-border:rgba(0,0,0,0.06);\n --ci-shadow:0 0 1px rgba(0,0,0,0.04),0 2px 8px rgba(0,0,0,0.04),inset 0 1px 0 rgba(255,255,255,0.8);\n --ci-dim:rgba(0,0,0,0.42);\n --ci-mid:rgba(0,0,0,0.55);\n --ci-hi:rgba(0,0,0,0.88);\n --ci-btn:rgba(0,0,0,0.03);\n --ci-btn-h:rgba(0,0,0,0.07);\n --ci-ok:rgba(34,197,94,0.8)\n}\n.dark .ci,[data-theme=\"dark\"] .ci{\n --ci-glass:linear-gradient(180deg,rgba(255,255,255,0.05),rgba(255,255,255,0.02));\n --ci-border:rgba(255,255,255,0.07);\n --ci-shadow:0 1px 3px rgba(0,0,0,0.08),inset 0 1px 0 rgba(255,255,255,0.04);\n --ci-dim:rgba(255,255,255,0.28);\n --ci-mid:rgba(255,255,255,0.5);\n --ci-hi:rgba(255,255,255,0.88);\n --ci-btn:rgba(255,255,255,0.03);\n --ci-btn-h:rgba(255,255,255,0.07);\n --ci-ok:rgba(74,222,128,0.9)\n}`;\n\nconst MONO =\n \"ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, monospace\";\n\n/* ── types ── */\nexport interface InlineCopyInputProps {\n value?: string;\n label?: string;\n sound?: boolean;\n style?: React.CSSProperties;\n}\n\n/* ── component ── */\nexport default function InlineCopyInput({\n value = \"npm install ruixen-ui\",\n label,\n sound = true,\n style,\n}: InlineCopyInputProps) {\n const [copied, setCopied] = React.useState(false);\n\n const handleCopy = async () => {\n try {\n await navigator.clipboard.writeText(value);\n if (sound) tick();\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n } catch {\n /* clipboard not available */\n }\n };\n\n return (\n <>\n