{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"float","type":"registry:component","title":"Float","description":"A velocity-snapping floating container that projects throws into corners and tucks past the screen edge into a slim live hairline tab.","author":"Hairline UI","dependencies":["lucide-react"],"files":[{"path":"registry/float.tsx","type":"registry:component","content":"// Hairline UI · float · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport {\n  EASE_OUT,\n  INTERACTION_FOCUS,\n  MATERIAL_LIFT,\n  createSpring,\n  rubberBand,\n  softenVelocity,\n  useInteractionActivity,\n  useInteractionReducedMotion,\n  type Spring,\n} from \"./ui-interaction-motion\";\nimport { playSound } from \"./ui-sounds\";\n\n/* ─────────────────────────────────────────────────────────\n * FLOAT: velocity-snapping, edge-tucking workspace PiP\n *\n *   throw    grab anywhere on the surface and flick: release\n *            velocity projects the landing corner and feeds\n *            directly into createSpring with subtle banking tilt,\n *            so the card carries its momentum into the corner\n *\n *   tuck     push or flick past the left or right wall and it\n *            tucks off-screen into a slim hairline tab pinned to\n *            the wall that stays alive (`edgePeek`: ticking clock,\n *            speaking dot, progress). Pull the tab inward or tap\n *            it to spring straight back out.\n *\n *   infra    one-line wrapper `<Float edgePeek={...}>{children}</Float>`,\n *            supports both `viewport` (fixed overlay) and `container`\n *            (bounded canvas/pane), optional localStorage persistence,\n *            resize-safe clamping and full arrow-key corner switching.\n * ───────────────────────────────────────────────────────── */\n\nexport type FloatCorner = \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\nexport type FloatEdge = \"left\" | \"right\";\n\nexport interface FloatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n  /** Floating card content (call widget, mini player, timer, agent status, support chat). */\n  children: React.ReactNode;\n  /** Live content shown inside the slim edge tab while tucked against the left or right wall. */\n  edgePeek?: React.ReactNode;\n  /** Controlled docked corner. */\n  corner?: FloatCorner;\n  /** Initial corner when uncontrolled (default \"bottom-right\"). */\n  defaultCorner?: FloatCorner;\n  onCornerChange?: (corner: FloatCorner) => void;\n  /** Controlled edge-tucked state. */\n  tucked?: boolean;\n  /** Initial tucked state when uncontrolled (default false). */\n  defaultTucked?: boolean;\n  onTuckedChange?: (tucked: boolean, edge: FloatEdge) => void;\n  /** Allow flicking or pushing past the left/right walls to tuck into the live edge tab (default true). */\n  tuckable?: boolean;\n  /** Subtle live 8×8 Bayer optical pulse along the edge tab's wall seam when active (default true). */\n  live?: boolean;\n  /** \"viewport\" docks fixed to the browser window; \"container\" bounds inside a relative parent (default \"viewport\"). */\n  scope?: \"viewport\" | \"container\";\n  /** Safe inset from edges in CSS px (default 16). */\n  margin?: number;\n  /** Optional localStorage key to persist the user's corner and tucked state across reloads. */\n  storageKey?: string;\n  /** Accessible name describing the floating panel (e.g. \"Active huddle\"). */\n  label?: string;\n  /** Opt-in quiet Web Audio landing knocks and tuck ticks (from ui-sounds.ts). */\n  sound?: boolean;\n}\n\ntype Sample = { x: number; y: number; t: number };\n\nconst INTERACTIVE_SELECTOR =\n  'button, a, input, select, textarea, summary, [role=\"button\"], [role=\"slider\"], [contenteditable=\"true\"], [data-float-no-drag]';\n\nconst BAYER8: Float32Array = (() => {\n  const m = [\n    [0, 32, 8, 40, 2, 34, 10, 42],\n    [48, 16, 56, 24, 50, 18, 58, 26],\n    [12, 44, 4, 36, 14, 46, 6, 38],\n    [60, 28, 52, 20, 62, 30, 54, 22],\n    [3, 35, 11, 43, 1, 33, 9, 41],\n    [51, 19, 59, 27, 49, 17, 57, 25],\n    [15, 47, 7, 39, 13, 45, 5, 37],\n    [63, 31, 55, 23, 61, 29, 53, 21],\n  ];\n  const out = new Float32Array(64);\n  for (let y = 0; y < 8; y++) {\n    for (let x = 0; x < 8; x++) {\n      out[(y << 3) | x] = (m[y][x] + 0.5) / 64;\n    }\n  }\n  return out;\n})();\n\nconst IS_LE = (() => {\n  const b = new ArrayBuffer(4);\n  new Uint32Array(b)[0] = 0x0a0b0c0d;\n  return new Uint8Array(b)[0] === 0x0d;\n})();\n\nfunction packRgba(r: number, g: number, b: number, a: number): number {\n  const ri = r < 0 ? 0 : r > 255 ? 255 : r | 0;\n  const gi = g < 0 ? 0 : g > 255 ? 255 : g | 0;\n  const bi = b < 0 ? 0 : b > 255 ? 255 : b | 0;\n  const ai = a < 0 ? 0 : a > 255 ? 255 : a | 0;\n  return IS_LE ? ((ai << 24) | (bi << 16) | (gi << 8) | ri) >>> 0 : ((ri << 24) | (gi << 16) | (bi << 8) | ai) >>> 0;\n}\n\nconst clamp = (v: number, lo: number, hi: number) => (v < lo ? lo : v > hi ? hi : v);\nconst clamp01 = (v: number) => (Number.isFinite(v) ? clamp(v, 0, 1) : 0);\n\nfunction cornerEdge(corner: FloatCorner): FloatEdge {\n  return corner.endsWith(\"left\") ? \"left\" : \"right\";\n}\n\nfunction cornerCoords(corner: FloatCorner, bw: number, bh: number, cw: number, ch: number, margin: number): { x: number; y: number } {\n  const maxX = Math.max(margin, bw - cw - margin);\n  const maxY = Math.max(margin, bh - ch - margin);\n  const x = corner.endsWith(\"left\") ? margin : maxX;\n  const y = corner.startsWith(\"top\") ? margin : maxY;\n  return { x, y };\n}\n\nfunction cornerFromPoint(cx: number, cy: number, bw: number, bh: number): FloatCorner {\n  const horiz = cx < bw * 0.5 ? \"left\" : \"right\";\n  const vert = cy < bh * 0.5 ? \"top\" : \"bottom\";\n  return `${vert}-${horiz}` as FloatCorner;\n}\n\nfunction readVelocity(samples: Sample[], now: number): { vx: number; vy: number } {\n  if (samples.length < 2 || now - samples[samples.length - 1].t > 110) return { vx: 0, vy: 0 };\n  const first = samples[0];\n  const last = samples[samples.length - 1];\n  const dt = Math.max(8, last.t - first.t);\n  return { vx: (last.x - first.x) / dt, vy: (last.y - first.y) / dt };\n}\n\nconst storageListeners = new Set<() => void>();\nfunction subscribeStorage(cb: () => void) {\n  storageListeners.add(cb);\n  window.addEventListener(\"storage\", cb);\n  return () => {\n    storageListeners.delete(cb);\n    window.removeEventListener(\"storage\", cb);\n  };\n}\nfunction readStorageRaw(key: string | undefined): string | null {\n  if (!key || typeof window === \"undefined\") return null;\n  try {\n    return window.localStorage.getItem(key);\n  } catch {\n    return null;\n  }\n}\n\nexport function Float({\n  children,\n  edgePeek,\n  corner: controlledCorner,\n  defaultCorner = \"bottom-right\",\n  onCornerChange,\n  tucked: controlledTucked,\n  defaultTucked = false,\n  onTuckedChange,\n  tuckable = true,\n  live = true,\n  scope = \"viewport\",\n  margin = 16,\n  storageKey,\n  label = \"Floating panel\",\n  sound = false,\n  className = \"\",\n  ...props\n}: FloatProps) {\n  const reduced = useInteractionReducedMotion();\n  const { ref: overlayRef, active: onScreen } = useInteractionActivity<HTMLDivElement>();\n\n  const savedRaw = React.useSyncExternalStore(\n    subscribeStorage,\n    () => readStorageRaw(storageKey),\n    () => null,\n  );\n  const saved = React.useMemo(() => {\n    if (!savedRaw) return null;\n    try {\n      return JSON.parse(savedRaw) as { corner?: FloatCorner; tucked?: boolean };\n    } catch {\n      return null;\n    }\n  }, [savedRaw]);\n\n  const [ownCorner, setOwnCorner] = React.useState<FloatCorner | null>(null);\n  const [ownTucked, setOwnTucked] = React.useState<boolean | null>(null);\n  const corner: FloatCorner = controlledCorner ?? ownCorner ?? saved?.corner ?? defaultCorner;\n  const tucked: boolean = controlledTucked ?? ownTucked ?? saved?.tucked ?? defaultTucked;\n  const edge = cornerEdge(corner);\n\n  const [dragging, setDragging] = React.useState(false);\n  const [tuckHint, setTuckHint] = React.useState<FloatEdge | null>(null);\n  const [tabY, setTabY] = React.useState<number | null>(null);\n  const [liveStatus, setLiveStatus] = React.useState(\"\");\n\n  const cardRef = React.useRef<HTMLDivElement>(null);\n  const tabRef = React.useRef<HTMLButtonElement>(null);\n  const seamCanvasRef = React.useRef<HTMLCanvasElement>(null);\n\n  const boundsRef = React.useRef({ w: 0, h: 0 });\n  const cardSizeRef = React.useRef({ w: 0, h: 0 });\n  const mountedPosRef = React.useRef(false);\n\n  const springsRef = React.useRef<{ x: Spring; y: Spring; tilt: Spring } | null>(null);\n  const dragRef = React.useRef<{\n    active: boolean;\n    started: boolean;\n    pointerId: number;\n    startClientX: number;\n    startClientY: number;\n    originX: number;\n    originY: number;\n    samples: Sample[];\n  } | null>(null);\n\n  const tabPullRef = React.useRef<{\n    pointerId: number;\n    startClientX: number;\n    startClientY: number;\n    pulled: boolean;\n  } | null>(null);\n\n  const setCornerState = React.useCallback(\n    (next: FloatCorner) => {\n      if (controlledCorner === undefined) setOwnCorner(next);\n      onCornerChange?.(next);\n      if (storageKey) {\n        try {\n          window.localStorage.setItem(storageKey, JSON.stringify({ corner: next, tucked }));\n          storageListeners.forEach((fn) => fn());\n        } catch {}\n      }\n    },\n    [controlledCorner, onCornerChange, storageKey, tucked],\n  );\n\n  const setTuckedState = React.useCallback(\n    (next: boolean, nextCorner: FloatCorner = corner) => {\n      const nextEdge = cornerEdge(nextCorner);\n      if (controlledTucked === undefined) setOwnTucked(next);\n      onTuckedChange?.(next, nextEdge);\n      if (storageKey) {\n        try {\n          window.localStorage.setItem(storageKey, JSON.stringify({ corner: nextCorner, tucked: next }));\n          storageListeners.forEach((fn) => fn());\n        } catch {}\n      }\n    },\n    [controlledTucked, onTuckedChange, storageKey, corner],\n  );\n\n  // Helper: read container + card geometry\n  const measure = React.useCallback(() => {\n    const overlay = overlayRef.current;\n    const card = cardRef.current;\n    if (!overlay || !card) return false;\n    const ob = overlay.getBoundingClientRect();\n    const cb = card.getBoundingClientRect();\n    if (ob.width <= 0 || ob.height <= 0 || cb.width <= 0 || cb.height <= 0) return false;\n    boundsRef.current = { w: ob.width, h: ob.height };\n    cardSizeRef.current = { w: cb.width, h: cb.height };\n    return true;\n  }, [overlayRef]);\n\n  // Helper: compute target (x, y) for current corner & tucked state\n  const targetForState = React.useCallback(\n    (c: FloatCorner, isTucked: boolean, customY?: number | null) => {\n      const { w: bw, h: bh } = boundsRef.current;\n      const { w: cw, h: ch } = cardSizeRef.current;\n      const base = cornerCoords(c, bw, bh, cw, ch, margin);\n      if (!isTucked) return base;\n      const e = cornerEdge(c);\n      const offX = e === \"left\" ? -(cw + 24) : bw + 24;\n      const y = customY !== null && customY !== undefined ? clamp(customY, margin, Math.max(margin, bh - ch - margin)) : base.y;\n      return { x: offX, y };\n    },\n    [margin],\n  );\n\n  // Core 3-spring physics rig (posX, posY, banking tilt) writing straight to GPU transform\n  React.useEffect(() => {\n    const paint = () => {\n      const sp = springsRef.current;\n      const card = cardRef.current;\n      if (!sp || !card) return;\n      const x = sp.x.get();\n      const y = sp.y.get();\n      const deg = sp.tilt.get();\n      card.style.transform = `translate3d(${x.toFixed(2)}px, ${y.toFixed(2)}px, 0) rotate(${deg.toFixed(2)}deg)`;\n    };\n\n    const x = createSpring(margin, { stiffness: 255, damping: 24 }, paint, 0.25);\n    const y = createSpring(margin, { stiffness: 255, damping: 24 }, paint, 0.25);\n    const tilt = createSpring(0, { stiffness: 220, damping: 20 }, paint, 0.04);\n    springsRef.current = { x, y, tilt };\n\n    const syncLayout = (jumpNow: boolean) => {\n      if (!measure()) return;\n      if (dragRef.current?.started) return;\n      const t = targetForState(corner, tucked, tabY);\n      if (jumpNow || !mountedPosRef.current || reduced) {\n        x.jump(t.x);\n        y.jump(t.y);\n        tilt.jump(0);\n        mountedPosRef.current = true;\n      } else {\n        x.set(t.x);\n        y.set(t.y);\n        tilt.set(0);\n      }\n      if (cardRef.current) cardRef.current.style.opacity = \"1\";\n    };\n\n    syncLayout(true);\n\n    const ro = new ResizeObserver(() => syncLayout(true));\n    if (overlayRef.current) ro.observe(overlayRef.current);\n    if (cardRef.current) ro.observe(cardRef.current);\n\n    return () => {\n      ro.disconnect();\n      x.stop();\n      y.stop();\n      tilt.stop();\n      springsRef.current = null;\n    };\n    // Initial mount & resize observer only; state transitions handled below\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [overlayRef]);\n\n  // Animate cleanly whenever corner or tucked changes programmatically or via keyboard\n  React.useEffect(() => {\n    const sp = springsRef.current;\n    if (!sp || !measure() || dragRef.current?.started) return;\n    const t = targetForState(corner, tucked, tabY);\n    if (reduced || !mountedPosRef.current) {\n      sp.x.jump(t.x);\n      sp.y.jump(t.y);\n      sp.tilt.jump(0);\n      mountedPosRef.current = true;\n    } else {\n      sp.x.set(t.x);\n      sp.y.set(t.y);\n      sp.tilt.set(0);\n    }\n  }, [corner, tucked, tabY, reduced, measure, targetForState]);\n\n  // Subtle 1.5px 8×8 Bayer live optical pulse along the wall seam of the tucked edge tab (0% CPU when untucked!)\n  React.useEffect(() => {\n    const canvas = seamCanvasRef.current;\n    const ctx = canvas?.getContext(\"2d\");\n    if (!canvas || !ctx || !tucked || !live || !onScreen || reduced) {\n      if (canvas && ctx) ctx.clearRect(0, 0, canvas.width, canvas.height);\n      return;\n    }\n\n    const gridCanvas = document.createElement(\"canvas\");\n    const gridCtx = gridCanvas.getContext(\"2d\");\n    if (!gridCtx) return;\n\n    let raf = 0;\n    let time = 0;\n    let last = 0;\n    let gCols = 0;\n    let gRows = 0;\n    let gridImg: ImageData | null = null;\n    let gridU32: Uint32Array | null = null;\n\n    const tick = (now: number) => {\n      const dt = last ? Math.min(1 / 24, (now - last) / 1000) : 1 / 60;\n      last = now;\n      time += dt;\n\n      const rect = canvas.getBoundingClientRect();\n      const w = Math.round(rect.width);\n      const h = Math.round(rect.height);\n      if (w > 0 && h > 0) {\n        const dpr = Math.min(2, window.devicePixelRatio || 1);\n        if (canvas.width !== Math.round(w * dpr) || canvas.height !== Math.round(h * dpr)) {\n          canvas.width = Math.round(w * dpr);\n          canvas.height = Math.round(h * dpr);\n        }\n        const pitch = 1.5;\n        const cols = Math.max(1, Math.ceil(w / pitch));\n        const rows = Math.max(1, Math.ceil(h / pitch));\n        if (cols !== gCols || rows !== gRows || !gridImg || !gridU32) {\n          gCols = cols;\n          gRows = rows;\n          gridCanvas.width = cols;\n          gridCanvas.height = rows;\n          gridImg = gridCtx.createImageData(cols, rows);\n          gridU32 = new Uint32Array(gridImg.data.buffer);\n        }\n        const u32 = gridU32;\n        u32.fill(0);\n        const pulseV = 0.5 + 0.38 * Math.sin(time * 2.1);\n        for (let r = 0; r < rows; r++) {\n          const v = (r + 0.5) / rows;\n          const bRow = (r & 7) << 3;\n          const rowOff = r * cols;\n          const wave = Math.exp(-((v - pulseV) ** 2) / 0.14);\n          for (let c = 0; c < cols; c++) {\n            const u = (c + 0.5) / cols;\n            const seam = edge === \"left\" ? 1 - u : u;\n            const d = Math.pow(seam, 1.35) * (0.28 + 0.58 * wave);\n            const bayer = BAYER8[bRow | (c & 7)];\n            const hit = clamp01((d - bayer + 0.05) / 0.14);\n            if (hit > 0.02) {\n              u32[rowOff + c] = packRgba(52, 211, 153, hit * (0.35 + wave * 0.55) * 255);\n            }\n          }\n        }\n        gridCtx.putImageData(gridImg, 0, 0);\n        ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n        ctx.clearRect(0, 0, w, h);\n        ctx.imageSmoothingEnabled = false;\n        ctx.drawImage(gridCanvas, 0, 0, cols * pitch, rows * pitch);\n      }\n      raf = requestAnimationFrame(tick);\n    };\n\n    raf = requestAnimationFrame(tick);\n    return () => {\n      cancelAnimationFrame(raf);\n      ctx.clearRect(0, 0, canvas.width, canvas.height);\n    };\n  }, [tucked, live, onScreen, reduced, edge]);\n\n  // Card drag & velocity-projected throw / edge-tuck handlers\n  const handleCardPointerDown = (e: React.PointerEvent<HTMLDivElement>) => {\n    if (e.button !== 0) return;\n    if ((e.target as HTMLElement).closest(INTERACTIVE_SELECTOR)) return;\n    if (!measure() || !springsRef.current) return;\n\n    dragRef.current = {\n      active: true,\n      started: false,\n      pointerId: e.pointerId,\n      startClientX: e.clientX,\n      startClientY: e.clientY,\n      originX: springsRef.current.x.get(),\n      originY: springsRef.current.y.get(),\n      samples: [{ x: e.clientX, y: e.clientY, t: performance.now() }],\n    };\n  };\n\n  const handleCardPointerMove = (e: React.PointerEvent<HTMLDivElement>) => {\n    const drag = dragRef.current;\n    const sp = springsRef.current;\n    if (!drag || !drag.active || drag.pointerId !== e.pointerId || !sp) return;\n\n    const dx = e.clientX - drag.startClientX;\n    const dy = e.clientY - drag.startClientY;\n\n    if (!drag.started) {\n      if (Math.hypot(dx, dy) < 4) return;\n      drag.started = true;\n      e.currentTarget.setPointerCapture(e.pointerId);\n      setDragging(true);\n    }\n\n    const now = performance.now();\n    drag.samples.push({ x: e.clientX, y: e.clientY, t: now });\n    while (drag.samples.length > 2 && now - drag.samples[0].t > 95) drag.samples.shift();\n\n    const { w: bw, h: bh } = boundsRef.current;\n    const { w: cw, h: ch } = cardSizeRef.current;\n    const minX = margin;\n    const maxX = Math.max(margin, bw - cw - margin);\n    const minY = margin;\n    const maxY = Math.max(margin, bh - ch - margin);\n\n    const rawX = drag.originX + dx;\n    const rawY = drag.originY + dy;\n\n    let displayX = rawX;\n    if (rawX < minX) displayX = minX + rubberBand(rawX - minX, 180, 0.55);\n    else if (rawX > maxX) displayX = maxX + rubberBand(rawX - maxX, 180, 0.55);\n\n    let displayY = rawY;\n    if (rawY < minY) displayY = minY + rubberBand(rawY - minY, 120, 0.45);\n    else if (rawY > maxY) displayY = maxY + rubberBand(rawY - maxY, 120, 0.45);\n\n    sp.x.jump(displayX);\n    sp.y.jump(displayY);\n\n    if (!reduced) {\n      const { vx } = readVelocity(drag.samples, now);\n      sp.tilt.set(clamp(vx * 5.2, -6.5, 6.5));\n    }\n\n    if (tuckable) {\n      const pastLeft = minX - rawX;\n      const pastRight = rawX - maxX;\n      if (pastLeft > 26) setTuckHint(\"left\");\n      else if (pastRight > 26) setTuckHint(\"right\");\n      else setTuckHint(null);\n    }\n  };\n\n  const finishCardDrag = (e: React.PointerEvent<HTMLDivElement>) => {\n    const drag = dragRef.current;\n    const sp = springsRef.current;\n    if (!drag || drag.pointerId !== e.pointerId) return;\n    dragRef.current = null;\n    setDragging(false);\n    setTuckHint(null);\n\n    if (!drag.started || !sp) return;\n    if (e.currentTarget.hasPointerCapture(e.pointerId)) {\n      e.currentTarget.releasePointerCapture(e.pointerId);\n    }\n\n    const now = performance.now();\n    const { vx, vy } = readVelocity(drag.samples, now);\n    const { w: bw, h: bh } = boundsRef.current;\n    const { w: cw, h: ch } = cardSizeRef.current;\n    const curX = sp.x.get();\n    const curY = sp.y.get();\n    const minX = margin;\n    const maxX = Math.max(margin, bw - cw - margin);\n\n    // Project where the throw is heading (190ms look-ahead)\n    const projX = curX + vx * 190;\n    const projY = curY + vy * 190;\n\n    const rawDx = e.clientX - drag.startClientX;\n    const rawX = drag.originX + rawDx;\n\n    // Check edge-tuck trigger: pushed past wall OR flicked directly outward from near that wall\n    // (never accidentally tucks a brisk cross-canvas throw meant for the opposite corner!)\n    const shouldTuckLeft = tuckable && (minX - rawX > 24 || (curX <= minX + 10 && vx < -0.65));\n    const shouldTuckRight = tuckable && (rawX - maxX > 24 || (curX >= maxX - 10 && vx > 0.65));\n\n    if (shouldTuckLeft || shouldTuckRight) {\n      const vert = projY + ch * 0.5 < bh * 0.5 ? \"top\" : \"bottom\";\n      const nextCorner = `${vert}-${shouldTuckLeft ? \"left\" : \"right\"}` as FloatCorner;\n      const clampedY = clamp(curY, margin, Math.max(margin, bh - ch - margin));\n      const centeredTabY = Math.round(clampedY + Math.max(0, (ch - 44) * 0.5));\n      setTabY(centeredTabY);\n      setCornerState(nextCorner);\n      setTuckedState(true, nextCorner);\n      const target = targetForState(nextCorner, true, clampedY);\n      if (reduced) {\n        sp.x.jump(target.x);\n        sp.y.jump(target.y);\n        sp.tilt.jump(0);\n      } else {\n        sp.x.set(target.x);\n        sp.y.set(target.y);\n        sp.x.push(softenVelocity(vx * 900, target.x - curX, 11));\n        sp.tilt.set(0);\n      }\n      if (sound) playSound(\"fold\", 0.32);\n      setLiveStatus(`${label} tucked into ${shouldTuckLeft ? \"left\" : \"right\"} edge`);\n      return;\n    }\n\n    // Standard velocity-projected corner snap\n    const nextCorner = cornerFromPoint(projX + cw * 0.5, projY + ch * 0.5, bw, bh);\n    setTabY(null);\n    setCornerState(nextCorner);\n    if (tucked) setTuckedState(false, nextCorner);\n    const target = targetForState(nextCorner, false);\n\n    if (reduced) {\n      sp.x.jump(target.x);\n      sp.y.jump(target.y);\n      sp.tilt.jump(0);\n    } else {\n      sp.x.set(target.x);\n      sp.y.set(target.y);\n      sp.x.push(softenVelocity(vx * 900, target.x - curX, 10));\n      sp.y.push(softenVelocity(vy * 900, target.y - curY, 10));\n      sp.tilt.set(0);\n    }\n    if (sound) playSound(\"drop\", 0.34);\n    setLiveStatus(`${label} moved to ${nextCorner.replace(\"-\", \" \")}`);\n  };\n\n  // Untuck helper (from clicking/pulling the live edge tab or keyboard arrow)\n  const untuck = React.useCallback(\n    (pushVx = 0) => {\n      if (!tucked) return;\n      const sp = springsRef.current;\n      setTabY(null);\n      setTuckedState(false, corner);\n      if (sp && measure()) {\n        const target = targetForState(corner, false);\n        if (reduced) {\n          sp.x.jump(target.x);\n          sp.y.jump(target.y);\n          sp.tilt.jump(0);\n        } else {\n          sp.x.set(target.x);\n          sp.y.set(target.y);\n          if (pushVx !== 0) sp.x.push(pushVx);\n          sp.tilt.set(0);\n        }\n      }\n      if (sound) playSound(\"unfold\", 0.32);\n      setLiveStatus(`${label} restored to ${corner.replace(\"-\", \" \")}`);\n    },\n    [tucked, corner, setTuckedState, measure, targetForState, reduced, sound, label],\n  );\n\n  // Pull-from-edge gesture on the live edge tab (tap to open, or pull inward past 14px to spring straight out!)\n  const handleTabPointerDown = (e: React.PointerEvent<HTMLButtonElement>) => {\n    if (e.button !== 0) return;\n    e.currentTarget.setPointerCapture(e.pointerId);\n    tabPullRef.current = {\n      pointerId: e.pointerId,\n      startClientX: e.clientX,\n      startClientY: e.clientY,\n      pulled: false,\n    };\n  };\n\n  const handleTabPointerMove = (e: React.PointerEvent<HTMLButtonElement>) => {\n    const pull = tabPullRef.current;\n    if (!pull || pull.pointerId !== e.pointerId || pull.pulled) return;\n    const dx = e.clientX - pull.startClientX;\n    const inward = edge === \"left\" ? dx : -dx;\n    if (inward > 16) {\n      pull.pulled = true;\n      untuck((edge === \"left\" ? 1 : -1) * 420);\n    }\n  };\n\n  const handleTabPointerUp = (e: React.PointerEvent<HTMLButtonElement>) => {\n    const pull = tabPullRef.current;\n    if (!pull || pull.pointerId !== e.pointerId) return;\n    tabPullRef.current = null;\n    if (e.currentTarget.hasPointerCapture(e.pointerId)) {\n      e.currentTarget.releasePointerCapture(e.pointerId);\n    }\n    if (!pull.pulled) {\n      untuck((edge === \"left\" ? 1 : -1) * 260);\n    }\n  };\n\n  // Arrow-key corner switching & edge tucking for full keyboard accessibility\n  const handleKeyDown = (e: React.KeyboardEvent<HTMLElement>) => {\n    if ((e.target as HTMLElement).closest(\"input, textarea, select\")) return;\n    const isTop = corner.startsWith(\"top\");\n    const isLeft = corner.endsWith(\"left\");\n\n    if (tucked) {\n      if (e.key === \"Enter\" || e.key === \" \" || (isLeft && e.key === \"ArrowRight\") || (!isLeft && e.key === \"ArrowLeft\")) {\n        e.preventDefault();\n        untuck();\n        window.setTimeout(() => cardRef.current?.focus(), 60);\n      }\n      return;\n    }\n\n    if (e.key === \"ArrowLeft\") {\n      e.preventDefault();\n      if (isLeft && tuckable) {\n        setTuckedState(true, corner);\n        if (sound) playSound(\"fold\", 0.3);\n        setLiveStatus(`${label} tucked into left edge`);\n        window.setTimeout(() => tabRef.current?.focus(), 60);\n      } else {\n        const next = `${isTop ? \"top\" : \"bottom\"}-left` as FloatCorner;\n        setCornerState(next);\n        if (sound) playSound(\"drop\", 0.28);\n      }\n    } else if (e.key === \"ArrowRight\") {\n      e.preventDefault();\n      if (!isLeft && tuckable) {\n        setTuckedState(true, corner);\n        if (sound) playSound(\"fold\", 0.3);\n        setLiveStatus(`${label} tucked into right edge`);\n        window.setTimeout(() => tabRef.current?.focus(), 60);\n      } else {\n        const next = `${isTop ? \"top\" : \"bottom\"}-right` as FloatCorner;\n        setCornerState(next);\n        if (sound) playSound(\"drop\", 0.28);\n      }\n    } else if (e.key === \"ArrowUp\") {\n      e.preventDefault();\n      const next = `top-${isLeft ? \"left\" : \"right\"}` as FloatCorner;\n      setCornerState(next);\n      if (sound) playSound(\"drop\", 0.28);\n    } else if (e.key === \"ArrowDown\") {\n      e.preventDefault();\n      const next = `bottom-${isLeft ? \"left\" : \"right\"}` as FloatCorner;\n      setCornerState(next);\n      if (sound) playSound(\"drop\", 0.28);\n    }\n  };\n\n  // Compute clean vertical positioning for the live edge tab\n  const tabTopStyle: React.CSSProperties =\n    tabY !== null\n      ? { top: `${tabY}px` }\n      : corner.startsWith(\"top\")\n        ? { top: `${margin + 12}px` }\n        : { bottom: `${margin + 12}px` };\n\n  return (\n    <div\n      ref={overlayRef}\n      className={`${scope === \"viewport\" ? \"fixed inset-0 z-50\" : \"absolute inset-0 z-20\"} pointer-events-none overflow-hidden ${className}`}\n      {...props}\n    >\n      {/* Subtle wall-dock magnetic cue while dragging past the left or right tuck threshold */}\n      {tuckable && (\n        <>\n          <div\n            aria-hidden=\"true\"\n            className={`pointer-events-none absolute inset-y-4 left-0 w-[3px] rounded-r-full bg-primary transition-opacity duration-150 ${\n              tuckHint === \"left\" ? \"opacity-90\" : \"opacity-0\"\n            }`}\n          />\n          <div\n            aria-hidden=\"true\"\n            className={`pointer-events-none absolute inset-y-4 right-0 w-[3px] rounded-l-full bg-primary transition-opacity duration-150 ${\n              tuckHint === \"right\" ? \"opacity-90\" : \"opacity-0\"\n            }`}\n          />\n        </>\n      )}\n\n      {/* Draggable velocity-snapping floating surface */}\n      <div\n        ref={cardRef}\n        role=\"region\"\n        aria-label={`${label}. Drag to a corner, flick past an edge to tuck, or use arrow keys.`}\n        aria-hidden={tucked || undefined}\n        tabIndex={tucked ? -1 : 0}\n        data-corner={corner}\n        data-tucked={tucked ? \"true\" : \"false\"}\n        data-dragging={dragging ? \"true\" : \"false\"}\n        onPointerDown={handleCardPointerDown}\n        onPointerMove={handleCardPointerMove}\n        onPointerUp={finishCardDrag}\n        onPointerCancel={finishCardDrag}\n        onKeyDown={handleKeyDown}\n        className={`absolute left-0 top-0 touch-none select-none rounded-[16px] ${\n          tucked ? \"pointer-events-none\" : \"pointer-events-auto\"\n        } ${dragging ? \"cursor-grabbing\" : \"cursor-grab\"} ${INTERACTION_FOCUS}`}\n        style={{ opacity: 0, willChange: \"transform\" }}\n      >\n        {children}\n      </div>\n\n      {/* Signature Live Edge Tab pinned flush against the left or right wall while tucked */}\n      {tuckable && (\n        <button\n          ref={tabRef}\n          type=\"button\"\n          tabIndex={tucked ? 0 : -1}\n          aria-hidden={!tucked || undefined}\n          aria-label={`Restore ${label} from ${edge} edge`}\n          data-float-tab={edge}\n          onPointerDown={handleTabPointerDown}\n          onPointerMove={handleTabPointerMove}\n          onPointerUp={handleTabPointerUp}\n          onPointerCancel={handleTabPointerUp}\n          onKeyDown={handleKeyDown}\n          className={`group/tab absolute flex h-11 touch-none select-none items-center gap-2 overflow-hidden border border-border bg-card text-card-foreground ${MATERIAL_LIFT} ${INTERACTION_FOCUS} ${\n            edge === \"left\"\n              ? \"left-0 rounded-r-[13px] border-l-0 pl-2.5 pr-2.5\"\n              : \"right-0 rounded-l-[13px] border-r-0 pl-2.5 pr-2.5\"\n          } ${tucked ? \"pointer-events-auto cursor-pointer\" : \"pointer-events-none\"}`}\n          style={{\n            ...tabTopStyle,\n            transform: tucked\n              ? \"translate3d(0, 0, 0)\"\n              : edge === \"left\"\n                ? \"translate3d(-110%, 0, 0)\"\n                : \"translate3d(110%, 0, 0)\",\n            opacity: tucked ? 1 : 0,\n            transition: reduced ? \"none\" : `transform 320ms ${EASE_OUT}, opacity 200ms ${EASE_OUT}`,\n          }}\n        >\n          {/* Live 8×8 Bayer optical pulse along the full wall seam (0% CPU when untucked) */}\n          <canvas\n            ref={seamCanvasRef}\n            aria-hidden=\"true\"\n            className={`pointer-events-none absolute inset-y-0 h-full w-3.5 ${edge === \"left\" ? \"left-0\" : \"right-0\"}`}\n          />\n\n          {edge === \"right\" && (\n            <span\n              aria-hidden=\"true\"\n              className=\"relative z-10 flex items-center text-muted-foreground transition-transform duration-150 group-hover/tab:-translate-x-0.5\"\n            >\n              <ChevronLeft className=\"size-3.5\" strokeWidth={2.2} />\n            </span>\n          )}\n\n          <span className=\"relative z-10 inline-flex items-center gap-2 text-[12.5px] font-medium tabular-nums\">\n            {edgePeek ?? (\n              <span className=\"inline-flex items-center gap-1.5\">\n                <span className=\"size-2 rounded-full bg-emerald-500\" />\n                <span>Live</span>\n              </span>\n            )}\n          </span>\n\n          {edge === \"left\" && (\n            <span\n              aria-hidden=\"true\"\n              className=\"relative z-10 flex items-center text-muted-foreground transition-transform duration-150 group-hover/tab:translate-x-0.5\"\n            >\n              <ChevronRight className=\"size-3.5\" strokeWidth={2.2} />\n            </span>\n          )}\n        </button>\n      )}\n\n      <span className=\"sr-only\" role=\"status\" aria-live=\"polite\">\n        {liveStatus}\n      </span>\n    </div>\n  );\n}\n\nexport default Float;\n"},{"path":"registry/ui-interaction-motion.ts","type":"registry:component","content":"// Hairline UI · float · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n'use client';\n\nimport * as React from 'react';\n\nexport const EASE_OUT = 'cubic-bezier(0.16, 1, 0.3, 1)';\nexport const EASE_SETTLE = 'cubic-bezier(0.22, 1.18, 0.36, 1)';\n/** Thrown things (indicators, thumbs): a slight overshoot on transform only. */\nexport const EASE_THROW = 'cubic-bezier(0.34, 1.36, 0.64, 1)';\n/**\n * The press every button primitive shares: a 3% give that eases in and settles back.\n * Tailwind v4's scale-* writes the `scale` property, so `scale` has to be in the list\n * or the press snaps.\n */\nexport const INTERACTION_PRESS =\n  'transition-[background-color,color,box-shadow,opacity,scale] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100';\nexport const INTERACTION_FOCUS ='focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background';\n\nconst query = '(prefers-reduced-motion: reduce)';\nconst subscribe = (notify: () => void) => {\n  const media = window.matchMedia(query);\n  media.addEventListener('change', notify);\n  return () => media.removeEventListener('change', notify);\n};\nexport const useInteractionReducedMotion = () => React.useSyncExternalStore(subscribe, () => window.matchMedia(query).matches, () => false);\n\nexport function useInteractionActivity<T extends Element>() {\n  const ref = React.useRef<T>(null);\n  const [visible, setVisible] = React.useState(false);\n  const [hidden, setHidden] = React.useState(false);\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    const observer = new IntersectionObserver(([entry]) => setVisible(entry.isIntersecting));\n    observer.observe(el);\n    const visibility = () => setHidden(document.hidden);\n    visibility(); document.addEventListener('visibilitychange', visibility);\n    return () => { observer.disconnect(); document.removeEventListener('visibilitychange', visibility); };\n  }, []);\n  return { ref, active: visible && !hidden };\n}\n\nexport function interactionIcon(on: boolean, reduced: boolean): React.CSSProperties {\n  return { opacity: on ? 1 : 0, transform: on ? 'none' : 'scale(0.6)', filter: on ? 'blur(0px)' : 'blur(3px)', transition: reduced ? 'none' : `opacity 220ms ${EASE_OUT}, transform 380ms ${EASE_OUT}, filter 220ms ${EASE_OUT}` };\n}\n\n/** A raised object: one tight contact shadow, one short ambient, a hairline of light on its top edge. */\nexport const MATERIAL_LIFT =\n  'shadow-[0_1px_1.5px_rgb(0_0_0/0.07),0_3px_8px_-2px_rgb(0_0_0/0.1),inset_0_0.5px_0_rgb(255_255_255/0.8)] dark:shadow-[0_1px_2px_rgb(0_0_0/0.5),0_4px_10px_-2px_rgb(0_0_0/0.35),inset_0_0.5px_0_rgb(255_255_255/0.1)]';\n/** A trough something sits in, shaded from above, lit along its bottom edge. */\nexport const MATERIAL_RECESS =\n  'shadow-[inset_0_1px_2.5px_rgb(0_0_0/0.09),inset_0_-0.5px_0_rgb(255_255_255/0.7)] dark:shadow-[inset_0_1px_3px_rgb(0_0_0/0.45),inset_0_-0.5px_0_rgb(255_255_255/0.07)]';\n\nexport type SpringConfig = { stiffness: number; damping: number; mass?: number };\nexport interface Spring {\n  get(): number;\n  getVelocity(): number;\n  getTarget(): number;\n  /** Aim somewhere new from wherever it is now, keeping its speed. */\n  set(target: number): void;\n  /** Add speed (units per second), on top of what it already has. */\n  push(velocity: number): void;\n  /** Be there now, at rest. */\n  jump(value: number): void;\n  configure(config: SpringConfig): void;\n  stop(): void;\n}\n\n// Every moving spring on the page shares one frame loop, which sleeps when the last one rests. Each spring's onFrame runs\n// once per frame after all of them have stepped, so several springs that draw one shape paint it once.\nconst SPRING_STEP = 1 / 240;\ntype Running = { step: () => void };\nconst runningSprings = new Set<Running>();\nconst springPainters = new Set<() => void>();\nlet springFrame = 0;\nlet springLast = 0;\nlet springSpare = 0;\n\nfunction springTick(now: number) {\n  // A hidden tab stops the frames, so the first one back must not count the whole gap as time passed.\n  springSpare += Math.min((now - springLast) / 1000, 0.05);\n  springLast = now;\n  while (springSpare >= SPRING_STEP) {\n    runningSprings.forEach((spring) => spring.step());\n    springSpare -= SPRING_STEP;\n  }\n  const painters = [...springPainters];\n  springPainters.clear();\n  painters.forEach((paint) => paint());\n  springFrame = runningSprings.size ? requestAnimationFrame(springTick) : 0;\n}\n\nfunction wakeSprings(spring: Running) {\n  runningSprings.add(spring);\n  if (springFrame) return;\n  springSpare = 0;\n  springFrame = requestAnimationFrame((now) => {\n    springLast = now - 1000 / 60;\n    springTick(now);\n  });\n}\n\n/**\n * A spring that carries its speed: re-aim it mid-flight and it curves on from where it is, push it while it swings and the\n * push adds to the swing. Use it for anything that can be interrupted; a curve restarts from a standstill every time.\n * `onFrame` should write straight to the DOM. `precision` is how close counts as there, in the value's own units.\n */\nexport function createSpring(initial: number, config: SpringConfig, onFrame: () => void, precision = 0.01): Spring {\n  let value = initial;\n  let velocity = 0;\n  let target = initial;\n  let { stiffness, damping, mass = 1 } = config;\n  const running: Running = {\n    step() {\n      velocity += ((-stiffness * (value - target) - damping * velocity) / mass) * SPRING_STEP;\n      value += velocity * SPRING_STEP;\n      if (Math.abs(value - target) < precision && Math.abs(velocity) < precision * 10) {\n        value = target;\n        velocity = 0;\n        runningSprings.delete(running);\n      }\n      springPainters.add(onFrame);\n    },\n  };\n  return {\n    get: () => value,\n    getVelocity: () => velocity,\n    getTarget: () => target,\n    set(next) {\n      if (next === target && !runningSprings.has(running)) return;\n      target = next;\n      wakeSprings(running);\n    },\n    push(speed) {\n      velocity += speed;\n      wakeSprings(running);\n    },\n    jump(next) {\n      value = next;\n      target = next;\n      velocity = 0;\n      runningSprings.delete(running);\n      onFrame();\n    },\n    configure(next) {\n      ({ stiffness, damping, mass = 1 } = next);\n    },\n    stop() {\n      runningSprings.delete(running);\n    },\n  };\n}\n\n/** Sample recent movement rather than averaging a long drag and losing its release velocity. */\nexport type PointerSample = { x: number; time: number };\nexport function samplePointer(samples: PointerSample[], x: number, time: number) {\n  samples.push({ x, time });\n  while (samples.length > 2 && time - samples[0].time > 100) samples.shift();\n}\nexport function releaseVelocity(samples: PointerSample[], now: number) {\n  if (samples.length < 2 || now - samples[samples.length - 1].time > 100) return 0;\n  const first = samples[0], last = samples[samples.length - 1];\n  return (last.x - first.x) / Math.max(1, last.time - first.time);\n}\n\n/** Smooth Apple/rational rubber-band curve: continuous exponential-like resistance without linear kinks. */\nexport function rubberBand(overshoot: number, dimension = 320, constant = 0.55): number {\n  const d = dimension || 320;\n  const abs = Math.abs(overshoot);\n  return Math.sign(overshoot) * (1 - 1 / ((abs * constant) / d + 1)) * d;\n}\n\n/** Projects resting travel from release velocity (velocity in px/ms; time in seconds). */\nexport function projectInertia(distance: number, velocity: number, time = 0.12): number {\n  return distance + velocity * 1000 * time;\n}\n\n/** Smooths incoming release velocity toward a boundary so springs don't slam or clip into walls. */\nexport function softenVelocity(velocity: number, distanceToTarget: number, factor = 10): number {\n  const maxAllowed = Math.abs(distanceToTarget) * factor;\n  return Math.sign(velocity) * Math.min(Math.abs(velocity), maxAllowed);\n}\n\n/** A damped spring sampled by WAAPI: tuned for organic lightness with a hint of life (3% breath). */\nexport function springFrames(\n  from: number,\n  to: number,\n  velocity = 0,\n  duration = 480,\n  config: { omega?: number; damping?: number; steps?: number } = {},\n) {\n  const { omega = 16, damping = 0.74, steps = 36 } = config;\n  const damped = omega * Math.sqrt(Math.max(0.001, 1 - damping * damping));\n  const displacement = from - to;\n  const coefficient = (velocity * 1000 + damping * omega * displacement) / damped;\n  return Array.from({ length: steps + 1 }, (_, i) => {\n    const t = (i / steps) * (duration / 1000);\n    const value = to + Math.exp(-damping * omega * t) * (displacement * Math.cos(damped * t) + coefficient * Math.sin(damped * t));\n    return { value: i === steps ? to : value, offset: i / steps };\n  });\n}\n\n"},{"path":"registry/ui-sounds.ts","type":"registry:component","content":"// Hairline UI · float · MIT License\n// Copyright (c) 2026 Hairline UI · https://hairlineui.com/license#components\n\n/* ─────────────────────────────────────────────────────────\n * UI SOUNDS: small interface sounds, made in code\n *\n * No files and nothing to license: every sound is built from a\n * tone or a burst of noise with the Web Audio API the moment it\n * plays. They're short and quiet, made to sit under an interface,\n * and components only play them when you pass `sound`.\n *\n *   fold     paper creasing: two short crisp bursts\n *   unfold   paper opening: a soft rising sweep\n *   drop     something small landing: a low, soft knock\n *   tick     a light click\n *   pop      a quick bright blip\n *   success  two soft rising notes\n *   error    two low falling notes\n *\n * Browsers only start audio after the visitor has pressed\n * something on the page, so a sound before that stays silent.\n * ───────────────────────────────────────────────────────── */\n\nexport type UiSound = \"fold\" | \"unfold\" | \"drop\" | \"tick\" | \"pop\" | \"success\" | \"error\";\n\nlet context: AudioContext | null = null;\nlet noise: AudioBuffer | null = null;\n\nfunction audio() {\n  if (typeof window === \"undefined\") return null;\n  if (!context) {\n    const Ctx = window.AudioContext ?? (window as unknown as { webkitAudioContext?: typeof AudioContext }).webkitAudioContext;\n    if (!Ctx) return null;\n    context = new Ctx();\n  }\n  if (context.state === \"suspended\") void context.resume().catch(() => {});\n  return context;\n}\n\nfunction noiseBuffer(ctx: AudioContext) {\n  if (noise && noise.sampleRate === ctx.sampleRate) return noise;\n  noise = ctx.createBuffer(1, Math.floor(ctx.sampleRate * 0.5), ctx.sampleRate);\n  const data = noise.getChannelData(0);\n  for (let i = 0; i < data.length; i++) data[i] = Math.random() * 2 - 1;\n  return noise;\n}\n\n/** A burst of filtered noise. */\nfunction burst(ctx: AudioContext, out: AudioNode, at: number, length: number, { type = \"bandpass\", from = 2000, to = from, q = 0.9, level = 0.5 }: { type?: BiquadFilterType; from?: number; to?: number; q?: number; level?: number }) {\n  const src = ctx.createBufferSource();\n  src.buffer = noiseBuffer(ctx);\n  const filter = ctx.createBiquadFilter();\n  filter.type = type;\n  filter.Q.value = q;\n  filter.frequency.setValueAtTime(from, at);\n  filter.frequency.exponentialRampToValueAtTime(Math.max(40, to), at + length);\n  const gain = ctx.createGain();\n  gain.gain.setValueAtTime(0.0001, at);\n  gain.gain.exponentialRampToValueAtTime(level, at + Math.min(0.012, length / 3));\n  gain.gain.exponentialRampToValueAtTime(0.0001, at + length);\n  src.connect(filter).connect(gain).connect(out);\n  src.start(at, Math.random() * 0.3, length + 0.02);\n}\n\n/** A tone that glides from one pitch to another. */\nfunction tone(ctx: AudioContext, out: AudioNode, at: number, length: number, { type = \"sine\", from, to = from, level = 0.4 }: { type?: OscillatorType; from: number; to?: number; level?: number }) {\n  const osc = ctx.createOscillator();\n  osc.type = type;\n  osc.frequency.setValueAtTime(from, at);\n  osc.frequency.exponentialRampToValueAtTime(Math.max(20, to), at + length);\n  const gain = ctx.createGain();\n  gain.gain.setValueAtTime(0.0001, at);\n  gain.gain.exponentialRampToValueAtTime(level, at + 0.006);\n  gain.gain.exponentialRampToValueAtTime(0.0001, at + length);\n  osc.connect(gain).connect(out);\n  osc.start(at);\n  osc.stop(at + length + 0.02);\n}\n\n/** Plays one sound. `volume` is 0 to 1; the default sits quietly under an interface. */\nexport function playSound(name: UiSound, volume = 0.5) {\n  const ctx = audio();\n  if (!ctx) return;\n  const out = ctx.createGain();\n  out.gain.value = Math.max(0, Math.min(1, volume)) * 0.5;\n  out.connect(ctx.destination);\n  const t = ctx.currentTime + 0.005;\n  switch (name) {\n    case \"fold\":\n      burst(ctx, out, t, 0.05, { type: \"highpass\", from: 2600, q: 0.7, level: 0.45 });\n      burst(ctx, out, t + 0.07, 0.07, { type: \"bandpass\", from: 3200, to: 1800, q: 1.2, level: 0.35 });\n      break;\n    case \"unfold\":\n      burst(ctx, out, t, 0.16, { type: \"bandpass\", from: 900, to: 2800, q: 0.8, level: 0.3 });\n      break;\n    case \"drop\":\n      tone(ctx, out, t, 0.12, { from: 180, to: 70, level: 0.55 });\n      burst(ctx, out, t, 0.03, { type: \"lowpass\", from: 1200, q: 0.5, level: 0.2 });\n      break;\n    case \"tick\":\n      tone(ctx, out, t, 0.025, { type: \"triangle\", from: 1900, to: 1500, level: 0.25 });\n      break;\n    case \"pop\":\n      tone(ctx, out, t, 0.06, { from: 620, to: 980, level: 0.3 });\n      break;\n    case \"success\":\n      tone(ctx, out, t, 0.11, { from: 660, level: 0.22 });\n      tone(ctx, out, t + 0.09, 0.16, { from: 990, level: 0.22 });\n      break;\n    case \"error\":\n      tone(ctx, out, t, 0.12, { type: \"triangle\", from: 330, level: 0.25 });\n      tone(ctx, out, t + 0.1, 0.18, { type: \"triangle\", from: 247, level: 0.25 });\n      break;\n  }\n  window.setTimeout(() => out.disconnect(), 600);\n}\n"}],"css":{},"docs":"Docs and live preview: https://hairlineui.com/ui/float. MIT licensed: https://hairlineui.com/license#components","meta":{"license":"MIT"}}