{"slug":"select","name":"Select","description":"Composable select primitives whose panel unfolds out of the trigger on one spring and pulls away into its own pill, plus a Morph variant where the trigger grows into the panel via shared layout.","category":"motion","source_url":"https:\/\/beui.dev\/r\/select\/raw","detail_url":"https:\/\/beui.dev\/r\/select","raw_url":"https:\/\/beui.dev\/r\/select\/raw","page_url":"https:\/\/beui.dev\/components\/motion\/select\/default","markdown_url":"https:\/\/beui.dev\/components\/motion\/select\/default.md","published_at":"2026-06-28","updated_at":"2026-11-25","dependencies":["clsx","lucide-react","motion","react","tailwind-merge"],"internal":[".\/engine","@\/components\/motion\/menu\/menu-item-highlight","@\/components\/motion\/select","@\/lib\/audio-context","@\/lib\/ease","@\/lib\/hooks\/use-dismiss","@\/lib\/hooks\/use-listbox","@\/lib\/hooks\/use-on-open","@\/lib\/hooks\/use-row-cursor","@\/lib\/layers","@\/lib\/sound","@\/lib\/sounds\/close","@\/lib\/sounds\/engine","@\/lib\/sounds\/open","@\/lib\/sounds\/select","@\/lib\/utils"],"install_slugs":["select"],"requires_theme":true,"props":[{"displayName":"Select","props":[{"name":"value","type":"string","required":false,"defaultValue":null,"description":"The selected value, for controlled use."},{"name":"defaultValue","type":"string","required":false,"defaultValue":null,"description":"The initial value when uncontrolled."},{"name":"onValueChange","type":"((value: string) => void)","required":false,"defaultValue":null,"description":"Called with the new value when an option is picked."},{"name":"open","type":"boolean","required":false,"defaultValue":null,"description":"Controlled open state of the panel. A layout that stacks selects can hold\nthis to keep exactly one panel open - the panel is absolutely positioned\ninside its field, so two open at once paint over each other's options."},{"name":"defaultOpen","type":"boolean","required":false,"defaultValue":"false","description":"Uncontrolled initial open state. Default false."},{"name":"onOpenChange","type":"((open: boolean) => void)","required":false,"defaultValue":null,"description":"Fires whenever the panel opens or closes. The panel is absolutely\npositioned inside the field, so a layout that stacks selects has to know\nwhich one is open to paint it above its neighbours."},{"name":"disabled","type":"boolean","required":false,"defaultValue":"false","description":"Disables the trigger so the panel cannot open. Default: false"},{"name":"sound","type":"boolean","required":false,"defaultValue":"false","description":"Play open and close swishes and a select on a pick. Off by default; a `SoundProvider` can mute it app-wide."},{"name":"className","type":"string","required":false,"defaultValue":null,"description":"Classes merged onto the root element."}]},{"displayName":"SelectTrigger","props":[{"name":"className","type":"string","required":false,"defaultValue":null,"description":"Classes merged onto the trigger button."}]},{"displayName":"SelectValue","props":[{"name":"placeholder","type":"string","required":false,"defaultValue":null,"description":"Text shown while nothing is selected. Default: \"Select\""},{"name":"className","type":"string","required":false,"defaultValue":null,"description":"Classes merged onto the label wrapper."}]},{"displayName":"SelectContent","props":[{"name":"className","type":"string","required":false,"defaultValue":null,"description":"Classes merged onto the options panel."}]},{"displayName":"SelectItem","props":[{"name":"value","type":"string","required":true,"defaultValue":null,"description":"Value reported when this option is picked."},{"name":"disabled","type":"boolean","required":false,"defaultValue":"false","description":"Prevents picking this option. Default: false"},{"name":"className","type":"string","required":false,"defaultValue":null,"description":"Classes merged onto the option button."}]}],"types":[],"files":[{"path":"components\/motion\/select.tsx","type":"component","content":"\"use client\";\n\/\/ beui.dev\/components\/motion\/select\/default\n\nimport { Check, ChevronDown } from \"lucide-react\";\nimport {\n  AnimatePresence,\n  animate,\n  type MotionValue,\n  motion,\n  useMotionValue,\n  useMotionValueEvent,\n  useReducedMotion,\n  useTransform,\n  type Variants,\n} from \"motion\/react\";\nimport {\n  createContext,\n  type ReactNode,\n  useCallback,\n  useContext,\n  useEffect,\n  useId,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from \"react\";\nimport { MENU_ITEM_CLASS, MenuItemHighlight } from \"@\/components\/motion\/menu\/menu-item-highlight\";\nimport { EASE_OUT } from \"@\/lib\/ease\";\nimport { type DismissReason, useDismiss } from \"@\/lib\/hooks\/use-dismiss\";\nimport { type ListboxRow, useListbox } from \"@\/lib\/hooks\/use-listbox\";\nimport { useSound } from \"@\/lib\/sound\";\nimport { closeSound } from \"@\/lib\/sounds\/close\";\nimport { openSound } from \"@\/lib\/sounds\/open\";\nimport { selectSound } from \"@\/lib\/sounds\/select\";\nimport { cn } from \"@\/lib\/utils\";\n\n\/\/ One progress value drives the surface, gap, corners and chevron. This short\n\/\/ spring suits the full reveal distance; each reader clamps its small internal\n\/\/ overshoot, so all visible endpoints settle together. Rows share a short\n\/\/ reveal so long lists have no late entries.\nconst UNFOLD_SPRING = {\n  type: \"spring\",\n  visualDuration: 0.2,\n  bounce: 0.12,\n} as const;\n\/\/ Exits are faster than entrances: the panel folds back on a short ease.\nconst UNFOLD_EXIT = { duration: 0.15, ease: EASE_OUT } as const;\n\/\/ Opened or closed from the keyboard: no motion at all.\nconst INSTANT = { duration: 0 } as const;\n\/\/ The trigger's label rolls when the value changes: the old one rises out,\n\/\/ faster than the new one rises in, with a 2px blur that hides the overlap.\nconst LABEL_IN = { duration: 0.18, ease: EASE_OUT } as const;\nconst LABEL_OUT = { duration: 0.12, ease: EASE_OUT } as const;\n\/\/ The trigger is a pill (half its h-10 height). The panel is rounded-2xl, the\n\/\/ radius every floating list in the library uses.\nconst TRIGGER_RADIUS = 20;\nconst PANEL_RADIUS = 16;\n\/\/ How far the open panel sits from the trigger once it has pulled away.\nconst GAP = 8;\n\/\/ The surface starts as a thin lip flush against the trigger's edge.\nconst LIP = 8;\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n\n\/\/ `custom` is the instant flag: rows of a list opened from the keyboard are\n\/\/ simply there, like the panel around them.\nconst ITEM_VARIANTS: Variants = {\n  \/\/ A shared short reveal keeps late rows in long, scrolled lists ready with\n  \/\/ the surface. Per-index staggering can delay visible rows by over a second.\n  hidden: (instant = false) => ({\n    opacity: 0,\n    y: -4,\n    transition: instant ? INSTANT : { duration: 0.08, ease: EASE_OUT },\n  }),\n  show: (instant = false) => ({\n    opacity: 1,\n    y: 0,\n    transition: instant ? INSTANT : { duration: 0.12, ease: EASE_OUT },\n  }),\n};\n\ntype Placement = \"bottom\" | \"top\";\n\ninterface SelectContextValue {\n  value: string | undefined;\n  open: boolean;\n  \/** `instant` skips the unfold: the keyboard asked for it. *\/\n  setOpen: (open: boolean, quiet?: boolean, instant?: boolean) => void;\n  select: (value: string, instant?: boolean) => void;\n  register: (value: string, label: string, disabled: boolean) => void;\n  unregister: (value: string) => void;\n  labelFor: (value: string | undefined) => string | undefined;\n  rows: ListboxRow[];\n  \/** Closes the panel; focus inside it returns to the trigger. *\/\n  close: (quiet?: boolean, instant?: boolean) => void;\n  \/** Whether the latest open or close skips its animation. *\/\n  instant: boolean;\n  reduce: boolean;\n  progress: MotionValue<number>;\n  triggerId: string;\n  listId: string;\n  disabled: boolean;\n  placement: Placement;\n  setPlacement: (p: Placement) => void;\n}\n\nconst SelectContext = createContext<SelectContextValue | null>(null);\n\/\/ The active option (resolved during render by the content), whether its\n\/\/ highlight glides (after the pointer) or jumps (after a key), and how a\n\/\/ pointer resting on an option makes it the active one.\ninterface ActiveOption {\n  activeId: string | undefined;\n  glide: boolean;\n  setActive: (id: string) => void;\n}\nconst ActiveOptionContext = createContext<ActiveOption>({\n  activeId: undefined,\n  glide: true,\n  setActive: () => {},\n});\n\nfunction useSelectContext(component: string) {\n  const ctx = useContext(SelectContext);\n  if (!ctx) throw new Error(`${component} must be used within <Select>`);\n  return ctx;\n}\n\nexport interface SelectProps {\n  \/** The selected value, for controlled use. *\/\n  value?: string;\n  \/** The initial value when uncontrolled. *\/\n  defaultValue?: string;\n  \/** Called with the new value when an option is picked. *\/\n  onValueChange?: (value: string) => void;\n  \/**\n   * Controlled open state of the panel. A layout that stacks selects can hold\n   * this to keep exactly one panel open - the panel is absolutely positioned\n   * inside its field, so two open at once paint over each other's options.\n   *\/\n  open?: boolean;\n  \/** Uncontrolled initial open state. Default false. *\/\n  defaultOpen?: boolean;\n  \/**\n   * Fires whenever the panel opens or closes. The panel is absolutely\n   * positioned inside the field, so a layout that stacks selects has to know\n   * which one is open to paint it above its neighbours.\n   *\/\n  onOpenChange?: (open: boolean) => void;\n  \/** Disables the trigger so the panel cannot open. Default: false *\/\n  disabled?: boolean;\n  \/** Play open and close swishes and a select on a pick. Off by default; a `SoundProvider` can mute it app-wide. *\/\n  sound?: boolean;\n  \/** Classes merged onto the root element. *\/\n  className?: string;\n  children: ReactNode;\n}\n\nexport function Select({\n  value,\n  defaultValue,\n  onValueChange,\n  open: openProp,\n  defaultOpen = false,\n  onOpenChange,\n  disabled = false,\n  sound = false,\n  className,\n  children,\n}: SelectProps) {\n  const reduce = useReducedMotion() ?? false;\n  const baseId = useId();\n  const rootRef = useRef<HTMLDivElement>(null);\n  const [internalOpen, setInternalOpen] = useState(defaultOpen);\n  const [internal, setInternal] = useState(defaultValue);\n  const [labels, setLabels] = useState<\n    Map<string, { label: string; disabled: boolean }>\n  >(new Map());\n  const [placement, setPlacement] = useState<Placement>(\"bottom\");\n  const [instant, setInstant] = useState(false);\n\n  const controlled = value !== undefined;\n  const current = controlled ? value : internal;\n  const openControlled = openProp !== undefined;\n  const open = openControlled ? openProp : internalOpen;\n  const progress = useMotionValue(open ? 1 : 0);\n\n  const playOpen = useSound(openSound, { enabled: sound });\n  const playClose = useSound(closeSound, { enabled: sound });\n  const playSelect = useSound(selectSound, { enabled: sound });\n\n  \/\/ `quiet` skips the close sweep when a pick already made its own sound.\n  const setOpen = useCallback(\n    (next: boolean, quiet = false, now = false) => {\n      if (next !== open) {\n        if (!quiet) {\n          if (next) playOpen();\n          else playClose();\n        }\n        setInstant(now);\n      }\n      if (!openControlled) setInternalOpen(next);\n      onOpenChange?.(next);\n    },\n    [onOpenChange, openControlled, open, playOpen, playClose],\n  );\n\n  \/\/ The panel turns inert as it closes, which would drop focus held inside it\n  \/\/ on the page body. Hand it back to the trigger before that happens.\n  const close = useCallback(\n    (quiet = false, now = false) => {\n      const trigger = document.getElementById(`${baseId}-trigger`);\n      if (\n        rootRef.current?.contains(document.activeElement) &&\n        document.activeElement !== trigger\n      )\n        trigger?.focus();\n      setOpen(false, quiet, now);\n    },\n    [baseId, setOpen],\n  );\n\n  const select = useCallback(\n    (next: string, now = false) => {\n      playSelect();\n      if (!controlled) setInternal(next);\n      onValueChange?.(next);\n      close(true, now);\n    },\n    [controlled, onValueChange, close, playSelect],\n  );\n\n  const register = useCallback((v: string, label: string, disabled: boolean) => {\n    setLabels((m) => {\n      const entry = m.get(v);\n      if (entry?.label === label && entry.disabled === disabled) return m;\n      return new Map(m).set(v, { label, disabled });\n    });\n  }, []);\n  const unregister = useCallback((v: string) => {\n    setLabels((m) => {\n      if (!m.has(v)) return m;\n      const next = new Map(m);\n      next.delete(v);\n      return next;\n    });\n  }, []);\n\n  \/\/ Reduced motion has no travel, so the progress only carries a short fade.\n  useEffect(() => {\n    const animation = animate(\n      progress,\n      open ? 1 : 0,\n      instant ? INSTANT : reduce ? { duration: 0.12 } : open ? UNFOLD_SPRING : UNFOLD_EXIT,\n    );\n    return () => animation.stop();\n  }, [open, progress, reduce, instant]);\n\n  \/\/ Escape hands focus back to the trigger and closes at once; an outside\n  \/\/ press leaves focus where the press put it and folds the panel away.\n  const dismiss = useCallback(\n    (reason: DismissReason) => (reason === \"escape\" ? close(false, true) : setOpen(false)),\n    [close, setOpen],\n  );\n  useDismiss(open, dismiss, rootRef);\n\n  const rows = useMemo(\n    () =>\n      Array.from(labels, ([id, entry]) => ({\n        id,\n        label: entry.label,\n        disabled: entry.disabled,\n      })),\n    [labels],\n  );\n\n  const ctx = useMemo<SelectContextValue>(\n    () => ({\n      value: current,\n      open,\n      setOpen,\n      select,\n      register,\n      unregister,\n      labelFor: (v) => (v === undefined ? undefined : labels.get(v)?.label),\n      rows,\n      close,\n      instant,\n      reduce,\n      progress,\n      triggerId: `${baseId}-trigger`,\n      listId: `${baseId}-list`,\n      disabled,\n      placement,\n      setPlacement,\n    }),\n    [\n      current,\n      open,\n      setOpen,\n      select,\n      register,\n      unregister,\n      labels,\n      rows,\n      close,\n      instant,\n      reduce,\n      progress,\n      baseId,\n      disabled,\n      placement,\n    ],\n  );\n\n  return (\n    <SelectContext.Provider value={ctx}>\n      <div ref={rootRef} className={cn(\"relative\", className)}>\n        {children}\n      <\/div>\n    <\/SelectContext.Provider>\n  );\n}\n\nexport interface SelectTriggerProps {\n  \/** Classes merged onto the trigger button. *\/\n  className?: string;\n  children: ReactNode;\n}\n\nexport function SelectTrigger({ className, children }: SelectTriggerProps) {\n  const ctx = useSelectContext(\"SelectTrigger\");\n  const isTop = ctx.placement === \"top\";\n  \/\/ The edge facing the panel flattens while the panel is attached to it and\n  \/\/ rounds back as the panel pulls away - the two pinch apart - on the same\n  \/\/ curve the panel moves on. The far edge stays rounded.\n  const nearRadius = useTransform(\n    ctx.progress,\n    [0, 0.2, 0.4, 1],\n    [TRIGGER_RADIUS, 0, 0, TRIGGER_RADIUS],\n  );\n  const rotate = useTransform(ctx.progress, (p) =>\n    ctx.reduce ? (ctx.open ? 180 : 0) : Math.min(1, Math.max(0, p)) * 180,\n  );\n  return (\n    <motion.button\n      type=\"button\"\n      id={ctx.triggerId}\n      disabled={ctx.disabled}\n      aria-haspopup=\"listbox\"\n      aria-expanded={ctx.open}\n      aria-controls={ctx.listId}\n      \/\/ `detail` is 0 for a click the keyboard made (Enter, Space): no unfold.\n      onClick={(event) => ctx.setOpen(!ctx.open, false, event.detail === 0)}\n      onKeyDown={(event) => {\n        if (\n          !ctx.open &&\n          (event.key === \"ArrowDown\" || event.key === \"ArrowUp\")\n        ) {\n          event.preventDefault();\n          ctx.setOpen(true, false, true);\n        }\n      }}\n      style={{\n        borderTopLeftRadius: ctx.reduce || !isTop ? TRIGGER_RADIUS : nearRadius,\n        borderTopRightRadius: ctx.reduce || !isTop ? TRIGGER_RADIUS : nearRadius,\n        borderBottomLeftRadius: ctx.reduce || isTop ? TRIGGER_RADIUS : nearRadius,\n        borderBottomRightRadius: ctx.reduce || isTop ? TRIGGER_RADIUS : nearRadius,\n      }}\n      className={cn(\n        \"relative z-10 flex h-10 w-full items-center justify-between gap-2 border border-border bg-background px-4 text-sm text-foreground outline-none transition-colors\",\n        \"hover:border-(--color-border-strong) focus-visible:ring-2 focus-visible:ring-foreground\/20\",\n        \"disabled:pointer-events-none disabled:opacity-50\",\n        className,\n      )}\n    >\n      {children}\n      <motion.span\n        aria-hidden\n        style={{ rotate }}\n        className=\"text-muted-foreground\"\n      >\n        <ChevronDown className=\"h-4 w-4\" \/>\n      <\/motion.span>\n    <\/motion.button>\n  );\n}\n\nexport interface SelectValueProps {\n  \/** Text shown while nothing is selected. Default: \"Select\" *\/\n  placeholder?: string;\n  \/** Classes merged onto the label wrapper. *\/\n  className?: string;\n}\n\nexport function SelectValue({ placeholder, className }: SelectValueProps) {\n  const ctx = useSelectContext(\"SelectValue\");\n  const label = ctx.labelFor(ctx.value);\n  const text = label ?? placeholder ?? \"Select\";\n  \/\/ A pick from the keyboard swaps the label at once; reduced motion keeps a\n  \/\/ short crossfade without the travel.\n  const still = ctx.instant || ctx.reduce;\n  const swap = ctx.instant ? INSTANT : ctx.reduce ? { duration: 0.12 } : LABEL_IN;\n  return (\n    \/\/ Both labels share one grid cell, so the outgoing one never takes space\n    \/\/ or moves the chevron, and both truncate the same way.\n    <span className={cn(\"grid min-w-0 flex-1 overflow-hidden text-left\", className)}>\n      <AnimatePresence initial={false}>\n        <motion.span\n          key={text}\n          initial={still ? { opacity: 0 } : { opacity: 0, y: \"70%\", filter: \"blur(2px)\" }}\n          animate={{ opacity: 1, y: \"0%\", filter: \"blur(0px)\" }}\n          exit={\n            still\n              ? { opacity: 0, transition: swap }\n              : { opacity: 0, y: \"-70%\", filter: \"blur(2px)\", transition: LABEL_OUT }\n          }\n          transition={swap}\n          className={cn(\n            \"col-start-1 row-start-1 block truncate\",\n            label ? \"text-foreground\" : \"text-muted-foreground\",\n          )}\n        >\n          {text}\n        <\/motion.span>\n      <\/AnimatePresence>\n    <\/span>\n  );\n}\n\nexport interface SelectContentProps {\n  \/** Classes merged onto the options panel. *\/\n  className?: string;\n  children: ReactNode;\n}\n\nexport function SelectContent({ className, children }: SelectContentProps) {\n  const ctx = useSelectContext(\"SelectContent\");\n  const panelRef = useRef<HTMLDivElement>(null);\n  const [height, setHeight] = useState(0);\n  const { open, progress, reduce, setPlacement } = ctx;\n  const { activeId, onKeyDown, moveTo } = useListbox({\n    open,\n    rows: ctx.rows,\n    selected: ctx.value,\n    list: panelRef,\n  });\n  const [glide, setGlide] = useState(true);\n  const active = useMemo<ActiveOption>(\n    () => ({ activeId, glide, setActive: moveTo }),\n    [activeId, glide, moveTo],\n  );\n\n  \/\/ Keep descendants laid out while hidden: display:none resets nested\n  \/\/ scrollers in Chromium. Collapse only the hidden outer footprint after\n  \/\/ exit so it cannot extend page scrolling. Opening restores the full box\n  \/\/ before measurement or focus; neither layout change is animated.\n  const [exiting, setExiting] = useState(false);\n  const [wasOpen, setWasOpen] = useState(open);\n  if (open !== wasOpen) {\n    setWasOpen(open);\n    if (!open) setExiting(true);\n  }\n  const present = open || exiting;\n  useMotionValueEvent(progress, \"animationComplete\", () => {\n    if (progress.get() === 0) setExiting(false);\n  });\n\n  useLayoutEffect(() => {\n    const node = panelRef.current;\n    if (!node || !present) return;\n    const measure = () => setHeight(node.offsetHeight);\n    measure();\n    const observer = new ResizeObserver(measure);\n    observer.observe(node);\n    return () => observer.disconnect();\n  }, [present]);\n\n  \/\/ On open, flip upward when there isn't room below and there's more above.\n  useLayoutEffect(() => {\n    if (!open) return;\n    const trigger = document.getElementById(ctx.triggerId);\n    const node = panelRef.current;\n    if (!trigger || !node) return;\n    const rect = trigger.getBoundingClientRect();\n    const h = node.offsetHeight;\n    const below = window.innerHeight - rect.bottom;\n    const above = rect.top;\n    setPlacement(below < h + 16 && above > below ? \"top\" : \"bottom\");\n  }, [open, ctx.triggerId, setPlacement]);\n\n  const isTop = ctx.placement === \"top\";\n\n  \/\/ Reveal a full-size panel from its near edge. No ancestor scales the list,\n  \/\/ so rows, borders and shadow keep their natural thickness. The clip and\n  \/\/ corner writes can paint; only the gap uses a transform. All read one\n  \/\/ progress value, with no animated layout properties.\n  const ready = height > 0 && !reduce;\n  const fromY = ready ? (isTop ? GAP : -GAP) : 0;\n  const detach = useTransform(progress, [0.4, 1], [0, 1]);\n  const y = useTransform(detach, (d) => lerp(fromY, 0, d));\n  const nearRadius = useTransform(detach, (d) => (ready ? PANEL_RADIUS * d : PANEL_RADIUS));\n  const borderRadius = useTransform(nearRadius, (near) =>\n    isTop\n      ? `${PANEL_RADIUS}px ${PANEL_RADIUS}px ${near}px ${near}px`\n      : `${near}px ${near}px ${PANEL_RADIUS}px ${PANEL_RADIUS}px`,\n  );\n  const clipPath = useTransform([progress, nearRadius], ([p, near]: number[]) => {\n    if (!ready) return \"none\";\n    \/\/ Clamp overshoot so the clip never extends into the trigger or exposes\n    \/\/ overflowing children. At rest remove it so the native shadow is whole.\n    const reveal = Math.min(1, Math.max(0, p));\n    if (reveal === 1) return \"none\";\n    const hidden = Math.max(0, (height - LIP) * (1 - reveal));\n    const inset = isTop ? `${hidden}px 0 0 0` : `0 0 ${hidden}px 0`;\n    const corners = isTop\n      ? `${PANEL_RADIUS}px ${PANEL_RADIUS}px ${near}px ${near}px`\n      : `${near}px ${near}px ${PANEL_RADIUS}px ${PANEL_RADIUS}px`;\n    return `inset(${inset} round ${corners})`;\n  });\n  \/\/ The surface materialises over its first frames rather than popping in as\n  \/\/ a lip; with reduced motion the fade is the whole entrance.\n  const opacity = useTransform(progress, reduce ? [0, 1] : [0, 0.12], [0, 1]);\n\n  return (\n    <motion.div\n      ref={panelRef}\n      id={ctx.listId}\n      role=\"listbox\"\n      aria-labelledby={ctx.triggerId}\n      aria-hidden={!open}\n      inert={!open}\n      onKeyDown={(event) => {\n        \/\/ Set before the key moves the active option, so its highlight jumps.\n        setGlide(false);\n        \/\/ Tab leaves the list from the trigger, so focus moves on to the\n        \/\/ control after the select rather than into the closing panel.\n        if (event.key === \"Tab\") ctx.close(false, true);\n        else onKeyDown(event);\n      }}\n      onPointerMove={(event) => {\n        if (event.pointerType !== \"touch\") setGlide(true);\n      }}\n      style={{\n        visibility: present ? undefined : \"hidden\",\n        maxHeight: present ? undefined : 0,\n        borderWidth: present ? undefined : 0,\n        y,\n        clipPath,\n        borderRadius,\n        opacity,\n        pointerEvents: open ? \"auto\" : \"none\",\n        marginTop: isTop ? 0 : GAP,\n        marginBottom: isTop ? GAP : 0,\n      }}\n      \/\/ flush against the trigger, then separates into its own rounded pill;\n      \/\/ sits above or below depending on available space\n      className={cn(\n        \/\/ The same soft shadow as the menus, so floating lists read as one family.\n        \"absolute left-0 right-0 z-20 overflow-hidden border border-border bg-background shadow-[0_8px_24px_-8px_rgb(0_0_0\/0.16)]\",\n        isTop ? \"bottom-full\" : \"top-full\",\n        className,\n      )}\n    >\n      <ActiveOptionContext.Provider value={active}>\n        <motion.div\n          initial={false}\n          animate={open ? \"show\" : \"hidden\"}\n          className=\"p-2\"\n        >\n          {children}\n        <\/motion.div>\n      <\/ActiveOptionContext.Provider>\n    <\/motion.div>\n  );\n}\n\nexport interface SelectItemProps {\n  \/** Value reported when this option is picked. *\/\n  value: string;\n  \/** Prevents picking this option. Default: false *\/\n  disabled?: boolean;\n  \/** Classes merged onto the option button. *\/\n  className?: string;\n  children: ReactNode;\n}\n\nexport function SelectItem({\n  value,\n  disabled = false,\n  className,\n  children,\n}: SelectItemProps) {\n  const ctx = useSelectContext(\"SelectItem\");\n  const { activeId, glide, setActive } = useContext(ActiveOptionContext);\n  const selected = ctx.value === value;\n  const active = activeId === value;\n  const label = typeof children === \"string\" ? children : value;\n\n  useLayoutEffect(() => {\n    ctx.register(value, label, disabled);\n  }, [ctx.register, value, label, disabled]);\n  useLayoutEffect(() => () => ctx.unregister(value), [ctx.unregister, value]);\n\n  return (\n    <motion.div custom={ctx.instant} variants={ctx.reduce ? undefined : ITEM_VARIANTS}>\n      <button\n        type=\"button\"\n        role=\"option\"\n        aria-selected={selected}\n        disabled={disabled}\n        \/\/ One tab stop: the active option, which focus follows while open.\n        tabIndex={active ? 0 : -1}\n        data-listbox-id={value}\n        \/\/ A resting pointer makes this the active option, so the highlight\n        \/\/ follows the mouse the same way it follows the arrow keys.\n        onPointerMove={(event) => {\n          if (event.pointerType !== \"touch\" && !disabled && !active) setActive(value);\n        }}\n        \/\/ Enter or Space on the option (`detail` 0) closes without folding.\n        onClick={(event) => ctx.select(value, event.detail === 0)}\n        className={cn(\n          MENU_ITEM_CLASS,\n          \"justify-between gap-2 text-foreground\",\n          \"disabled:pointer-events-none disabled:opacity-50\",\n          className,\n        )}\n      >\n        {\/* One highlight for the whole list: it glides after the pointer and\n            jumps after a key. The selected option is marked by its check. *\/}\n        {active && !disabled ? (\n          <MenuItemHighlight\n            layoutId={`${ctx.listId}-highlight`}\n            reduce={ctx.reduce}\n            instant={!glide}\n          \/>\n        ) : null}\n        <span className=\"flex min-w-0 flex-1 items-center gap-2\">{children}<\/span>\n        {selected ? <Check aria-hidden=\"true\" className=\"h-3.5 w-3.5 shrink-0\" \/> : null}\n      <\/button>\n    <\/motion.div>\n  );\n}\n"},{"path":"components\/motion\/menu\/menu-item-highlight.tsx","type":"util","content":"\"use client\";\n\nimport { motion } from \"motion\/react\";\nimport { SPRING_LAYOUT } from \"@\/lib\/ease\";\nimport { cn } from \"@\/lib\/utils\";\n\n\/** The row shape every menu item shares. Menus add their own gap and states. *\/\nexport const MENU_ITEM_CLASS =\n  \"relative isolate flex w-full select-none items-center rounded-lg px-3 py-1.5 text-left text-sm outline-none\";\n\nexport interface MenuItemHighlightProps {\n  \/** Shared by every row of one panel, so the highlight glides between them. *\/\n  layoutId: string;\n  tone?: \"default\" | \"destructive\";\n  reduce: boolean;\n  \/**\n   * Jump instead of gliding: the highlight was moved by the keyboard, where a\n   * spring only trails behind fast arrowing.\n   *\/\n  instant?: boolean;\n}\n\n\/** The highlight behind the active row. Render it only inside the active row. *\/\nexport function MenuItemHighlight({\n  layoutId,\n  tone = \"default\",\n  reduce,\n  instant = false,\n}: MenuItemHighlightProps) {\n  return (\n    <motion.span\n      aria-hidden=\"true\"\n      layoutId={layoutId}\n      className={cn(\n        \"absolute inset-0 -z-10 rounded-lg\",\n        tone === \"destructive\" ? \"bg-destructive\/10\" : \"bg-foreground\/[0.07]\",\n      )}\n      transition={reduce || instant ? { duration: 0 } : SPRING_LAYOUT}\n    \/>\n  );\n}\n"},{"path":"lib\/ease.ts","type":"util","content":"\/\/ Shared motion tokens. Easing curves mirror the CSS custom properties in\n\/\/ globals.css; springs are the canonical physics used across components.\n\/\/ Strong custom variants - defaults like `ease-in`\/`ease-out` feel weak.\n\nexport const EASE_OUT = [0.16, 1, 0.3, 1] as const;\n\/** Accelerating curve for things that fall (a dropped ball, a toppled block). Not for UI entrances. *\/\nexport const EASE_IN = [0.55, 0, 1, 0.45] as const;\nexport const EASE_IN_OUT = [0.77, 0, 0.175, 1] as const;\nexport const EASE_DRAWER = [0.32, 0.72, 0, 1] as const;\n\n\/** CSS string form of EASE_OUT for inline style transitions. *\/\nexport const EASE_OUT_CSS = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\n\/** Press feedback on buttons and other tappable surfaces. *\/\nexport const SPRING_PRESS = {\n  type: \"spring\",\n  stiffness: 500,\n  damping: 30,\n  mass: 0.6,\n} as const;\n\n\/** Content swaps - label\/icon slots trading places inside a control. *\/\nexport const SPRING_SWAP = {\n  type: \"spring\",\n  stiffness: 460,\n  damping: 30,\n  mass: 0.55,\n} as const;\n\n\/** Overlay panel entrances - modals and sheets summoned by pointer. *\/\nexport const SPRING_PANEL = {\n  type: \"spring\",\n  stiffness: 420,\n  damping: 40,\n  mass: 0.5,\n} as const;\n\n\/** Shared-layout glides - pills, indicators and panels morphing between positions. *\/\nexport const SPRING_LAYOUT = {\n  type: \"spring\",\n  stiffness: 360,\n  damping: 32,\n  mass: 0.6,\n} as const;\n\n\/** Cursor-follow physics for decorative mouse tracking (magnetic, tilt, dock). *\/\nexport const SPRING_MOUSE = {\n  stiffness: 200,\n  damping: 15,\n  mass: 0.3,\n} as const;\n\n\/** Dragged handles and fills (sliders) - critically damped `useSpring` config,\n * so the value follows the pointer butterily and never rebounds off an end. *\/\nexport const SPRING_GLIDE = {\n  stiffness: 700,\n  damping: 50,\n  mass: 0.5,\n} as const;\n\n\/** Shared-surface morphs: a trigger growing into its panel and back on one\n * weighted spring, so opening and closing travel the same path. *\/\nexport const SPRING_MORPH = {\n  type: \"spring\",\n  duration: 0.5,\n  bounce: 0.22,\n} as const;\n"},{"path":"lib\/hooks\/use-dismiss.ts","type":"util","content":"\"use client\";\n\nimport { type RefObject, useEffect, useLayoutEffect, useRef } from \"react\";\nimport { inOtherLayer, type Layer, openLayer, ownsEscape } from \"@\/lib\/layers\";\n\n\/**\n * What the dismissing gesture does to the control it landed on.\n *\n * `\"pass-through\"` is the platform norm (native popover light-dismiss): the\n * tap closes the overlay *and* activates whatever was under it. Use\n * `\"consume\"` where the open overlay sits over or beside controls that would\n * be costly to trigger by accident - the dismissal then swallows the\n * activation too, so the gesture only closes.\n *\/\nexport type DismissBehavior = \"pass-through\" | \"consume\";\n\n\/** What closed the overlay: Escape, a pointerdown outside it, or focus leaving it. *\/\nexport type DismissReason = \"escape\" | \"pointer\" | \"focus\";\n\nexport interface DismissOptions {\n  \/** Default `\"pass-through\"`. *\/\n  behavior?: DismissBehavior;\n  \/** Dismiss on Escape as well. Default true. *\/\n  escape?: boolean;\n  \/** Dismiss when focus moves outside, as a combobox does on Tab. Default false. *\/\n  focusOutside?: boolean;\n  \/**\n   * Dismiss on a pointerdown outside. Default true. Turn it off for an overlay\n   * whose own backdrop handles presses and only needs Escape and layering.\n   *\/\n  outsidePress?: boolean;\n  \/** Return true for an outside target that should *not* dismiss. *\/\n  ignore?: (target: Element) => boolean;\n}\n\n\/\/ preventDefault on pointerdown does not suppress the click that follows, so\n\/\/ consuming a gesture means swallowing that click itself. The swallower\n\/\/ deliberately outlives the effect that installed it - the dismissal it\n\/\/ belongs to has already unmounted or re-rendered by the time the click lands.\n\/\/ It releases on that click, or on the next gesture if the pointer is dragged\n\/\/ away and no click ever arrives, so it can never eat a later one. A keydown\n\/\/ releases it too: a gesture that ends with neither a click nor a cancel would\n\/\/ otherwise leave it armed, and the click Enter synthesizes on some focused\n\/\/ control is not the one this dismissal was owed.\nfunction consumeActivation(source: Event) {\n  const swallow = (event: MouseEvent) => {\n    event.preventDefault();\n    event.stopPropagation();\n    release();\n  };\n  const restart = (event: Event) => {\n    if (event !== source) release();\n  };\n  const release = () => {\n    window.removeEventListener(\"click\", swallow, true);\n    window.removeEventListener(\"pointerdown\", restart, true);\n    window.removeEventListener(\"pointercancel\", restart, true);\n    window.removeEventListener(\"keydown\", release, true);\n  };\n  window.addEventListener(\"click\", swallow, true);\n  window.addEventListener(\"pointerdown\", restart, true);\n  window.addEventListener(\"pointercancel\", restart, true);\n  window.addEventListener(\"keydown\", release, true);\n}\n\n\/**\n * Close an open overlay on Escape or a pointerdown outside `ref`. Pass `null`\n * for `ref` when what counts as inside isn't one element, and say so with\n * `ignore` instead.\n *\n * The pointerdown listener is capture-phase: a bubble-phase one is blinded by\n * any handler in between that stops propagation, and an overlay cannot know\n * what it is layered over.\n *\n * Each open dismissal is a layer in `lib\/layers.ts`, so only the innermost\n * open overlay answers Escape (a menu inside a drawer closes, the drawer\n * stays), and a drawer's focus trap leaves focus in a menu it portaled out.\n *\/\nexport function useDismiss(\n  open: boolean,\n  onDismiss: (reason: DismissReason) => void,\n  ref: RefObject<HTMLElement | SVGElement | null> | null,\n  {\n    behavior = \"pass-through\",\n    escape: dismissOnEscape = true,\n    focusOutside = false,\n    outsidePress = true,\n    ignore,\n  }: DismissOptions = {},\n) {\n  \/\/ Read through refs, so a callback rebuilt each render neither re-binds the\n  \/\/ listeners nor moves this layer to the top of the stack.\n  const dismissRef = useRef(onDismiss);\n  const ignoreRef = useRef(ignore);\n  useLayoutEffect(() => {\n    dismissRef.current = onDismiss;\n    ignoreRef.current = ignore;\n  });\n\n  useEffect(() => {\n    if (!open) return;\n    const inside = (target: Node) =>\n      Boolean(ref?.current?.contains(target)) ||\n      (target instanceof Element && Boolean(ignoreRef.current?.(target)));\n    const layer: Layer = { contains: inside, escape: dismissOnEscape };\n    const closeLayer = openLayer(layer);\n    const onKey = (event: KeyboardEvent) => {\n      if (!dismissOnEscape || event.key !== \"Escape\" || !ownsEscape(layer, event)) return;\n      event.preventDefault();\n      dismissRef.current(\"escape\");\n    };\n    const onPointer = (event: PointerEvent) => {\n      const target = event.target as Element | null;\n      if (!target || inside(target)) return;\n      \/\/ Outside this overlay, but inside another open one: the gesture is\n      \/\/ that overlay's to answer, and swallowing its click from behind would\n      \/\/ cost the user the control they actually aimed at.\n      if (behavior === \"consume\" && !inOtherLayer(layer, target, { traps: false })) {\n        consumeActivation(event);\n      }\n      dismissRef.current(\"pointer\");\n    };\n    const onFocus = (event: FocusEvent) => {\n      const target = event.target;\n      if (target instanceof Node && !inside(target)) dismissRef.current(\"focus\");\n    };\n    window.addEventListener(\"keydown\", onKey);\n    if (outsidePress) window.addEventListener(\"pointerdown\", onPointer, true);\n    if (focusOutside) window.addEventListener(\"focusin\", onFocus);\n    return () => {\n      closeLayer();\n      window.removeEventListener(\"keydown\", onKey);\n      window.removeEventListener(\"pointerdown\", onPointer, true);\n      window.removeEventListener(\"focusin\", onFocus);\n    };\n  }, [open, ref, behavior, dismissOnEscape, focusOutside, outsidePress]);\n}\n"},{"path":"lib\/hooks\/use-listbox.ts","type":"util","content":"\"use client\";\n\nimport {\n  type KeyboardEvent,\n  type RefObject,\n  useEffect,\n  useMemo,\n  useRef,\n} from \"react\";\nimport { useOnOpen } from \"@\/lib\/hooks\/use-on-open\";\nimport { useRowCursor } from \"@\/lib\/hooks\/use-row-cursor\";\n\nexport interface ListboxRow {\n  id: string;\n  label: string;\n  disabled?: boolean;\n}\n\n\/\/ How long typed characters keep building one typeahead query.\nconst TYPEAHEAD_MS = 500;\n\n\/**\n * Keyboard model for a popup listbox whose options are focusable buttons.\n *\n * The active option is resolved during render through `useRowCursor`, so the\n * roving `tabIndex` and the next key press always agree with what is on\n * screen. Opening starts on the selected option, or the first enabled one.\n * Arrow keys, Home and End move between enabled options, and printable\n * characters jump to the next option whose label starts with what was typed.\n * DOM focus follows the active option while the list is open; each option\n * carries its id in `data-listbox-id` so the list can find it.\n *\/\nexport function useListbox({\n  open,\n  rows,\n  selected,\n  list,\n}: {\n  open: boolean;\n  rows: readonly ListboxRow[];\n  selected: string | undefined;\n  list: RefObject<HTMLElement | null>;\n}) {\n  const enabled = useMemo(() => rows.filter((row) => !row.disabled), [rows]);\n  const { activeIndex, moveTo, moveActive } = useRowCursor(enabled, \"\");\n  useOnOpen(open, () =>\n    moveTo(enabled.some((row) => row.id === selected) ? (selected ?? null) : null),\n  );\n  const activeId = enabled[activeIndex]?.id;\n  const typed = useRef({ text: \"\", at: 0 });\n  \/\/ A list rendered open does not take focus from the page on mount; focus\n  \/\/ follows only once it has been opened, or once focus is already inside.\n  const openedOnMount = useRef(open);\n  useEffect(() => {\n    if (!open) openedOnMount.current = false;\n  }, [open]);\n\n  useEffect(() => {\n    if (!open || activeId === undefined) return;\n    if (\n      openedOnMount.current &&\n      !list.current?.contains(document.activeElement)\n    )\n      return;\n    const option = Array.from(\n      list.current?.querySelectorAll<HTMLElement>(\"[data-listbox-id]\") ?? [],\n    ).find((element) => element.dataset.listboxId === activeId);\n    option?.focus({ preventScroll: false });\n  }, [open, activeId, list]);\n\n  const onKeyDown = (event: KeyboardEvent) => {\n    const { key } = event;\n    if (key === \"ArrowDown\" || key === \"ArrowUp\") {\n      event.preventDefault();\n      moveActive(key === \"ArrowDown\" ? 1 : -1);\n    } else if (key === \"Home\" || key === \"End\") {\n      event.preventDefault();\n      const row = key === \"Home\" ? enabled[0] : enabled[enabled.length - 1];\n      if (row) moveTo(row.id);\n    } else if (\n      key.length === 1 &&\n      key !== \" \" &&\n      !event.ctrlKey &&\n      !event.metaKey &&\n      !event.altKey\n    ) {\n      const now = Date.now();\n      const char = key.toLowerCase();\n      const text =\n        now - typed.current.at < TYPEAHEAD_MS ? typed.current.text + char : char;\n      typed.current = { text, at: now };\n      \/\/ A repeated single letter cycles through the options that start with it.\n      const from = text.length === 1 ? activeIndex + 1 : activeIndex;\n      for (let step = 0; step < enabled.length; step++) {\n        const row = enabled[(from + step) % enabled.length];\n        if (row.label.toLowerCase().startsWith(text)) {\n          moveTo(row.id);\n          break;\n        }\n      }\n    }\n  };\n\n  \/\/ `moveTo` lets a pointer resting on an option make it the active one, so a\n  \/\/ highlight drawn from `activeId` follows the mouse as well as the keys.\n  return { activeId, onKeyDown, moveTo };\n}\n"},{"path":"lib\/sound.tsx","type":"util","content":"\"use client\";\n\nimport {\n  createContext,\n  type ReactNode,\n  useCallback,\n  useContext,\n  useEffect,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n} from \"react\";\nimport {\n  registerSoundSettings,\n  retainAudioContext,\n  type SoundSettingsEntry,\n} from \"@\/lib\/audio-context\";\nimport type { PlayOptions, Sound } from \"@\/lib\/sounds\/engine\";\n\nexport interface SoundSettings {\n  \/** False mutes every beUI sound under the provider. *\/\n  enabled: boolean;\n  \/** 0 to 1, scales every beUI sound. *\/\n  volume: number;\n}\n\nconst SoundContext = createContext<SoundSettings & { depth: number }>({\n  enabled: true,\n  volume: 1,\n  depth: 0,\n});\n\n\/**\n * App-wide sound settings. `enabled={false}` mutes every beUI sound, from\n * component `sound` props and `useSound` to the games, Wheel Picker and\n * Bookshelf, and `volume` scales them all. Without a provider, sounds play at\n * full volume. A nested provider overrides the one around it.\n *\/\nexport function SoundProvider({\n  enabled = true,\n  volume = 1,\n  children,\n}: Partial<SoundSettings> & { children: ReactNode }) {\n  const depth = useContext(SoundContext).depth + 1;\n  const value = useMemo(() => ({ enabled, volume, depth }), [enabled, volume, depth]);\n\n  \/\/ Module-level as well (lib\/audio-context.ts), so players outside React\n  \/\/ and `sound.play()` obey it too.\n  const entry = useRef<SoundSettingsEntry>({ depth, enabled, volume });\n  const registration = useRef<ReturnType<typeof registerSoundSettings> | null>(null);\n  useEffect(() => {\n    registration.current = registerSoundSettings(entry.current);\n    return () => {\n      registration.current?.release();\n      registration.current = null;\n    };\n  }, []);\n  useEffect(() => {\n    Object.assign(entry.current, { depth, enabled, volume });\n    registration.current?.update();\n  }, [depth, enabled, volume]);\n\n  return <SoundContext.Provider value={value}>{children}<\/SoundContext.Provider>;\n}\n\nexport function useSoundSettings(): SoundSettings {\n  return useContext(SoundContext);\n}\n\nexport interface UseSoundOptions {\n  \/** False makes `play` do nothing, for a component's `sound` prop. *\/\n  enabled?: boolean;\n  \/** 0 to 1 for this sound, on top of the provider volume. *\/\n  volume?: number;\n}\n\n\/**\n * A stable `play()` for one sound. It does nothing while disabled or muted,\n * and keeps the shared audio context warm only while it can play.\n *\/\nexport function useSound(sound: Sound, { enabled = true, volume = 1 }: UseSoundOptions = {}) {\n  const settings = useSoundSettings();\n  const on = enabled && settings.enabled && settings.volume > 0 && volume > 0;\n  \/\/ Read by the stable callback, so a caller's effects don't re-run when\n  \/\/ the settings change.\n  const latest = useRef({ on, volume, sound });\n  useLayoutEffect(() => {\n    latest.current = { on, volume, sound };\n  });\n\n  useEffect(() => {\n    if (!on) return;\n    return retainAudioContext();\n  }, [on]);\n\n  return useCallback((options?: PlayOptions) => {\n    const current = latest.current;\n    if (!current.on) return;\n    current.sound.play({ ...options, volume: (options?.volume ?? 1) * current.volume });\n  }, []);\n}\n"},{"path":"lib\/sounds\/close.ts","type":"util","content":"import { defineSound } from \".\/engine\";\n\n\/** The open whoosh falling and a little quicker, settling with a soft low tap, for things closing. *\/\nexport const closeSound = defineSound({\n  name: \"Close\",\n  duration: 0.16,\n  room: 0.18,\n  build: (v) => {\n    v.noise({ freq: 2600, to: 700, q: 1.2, attack: 0.012, decay: 0.09, gain: 0.7 });\n    v.click({ freq: 1400, q: 1.2, at: 0.05, decay: 0.006, gain: 0.2 });\n    v.strike({ freq: 260, material: \"wood\", bend: 1.2, at: 0.05, decay: 0.045, gain: 0.3 });\n  },\n});\n"},{"path":"lib\/sounds\/open.ts","type":"util","content":"import { defineSound } from \".\/engine\";\n\n\/** A soft rising whoosh that lands with a light glass touch, for menus, popovers and dialogs opening. *\/\nexport const openSound = defineSound({\n  name: \"Open\",\n  duration: 0.2,\n  room: 0.2,\n  build: (v) => {\n    v.noise({ freq: 600, to: 2600, q: 1.2, attack: 0.035, decay: 0.11, gain: 0.75 });\n    v.noise({ freq: 4500, to: 6000, q: 1, attack: 0.03, decay: 0.07, gain: 0.05 });\n    v.strike({ freq: 1320, material: \"glass\", at: 0.05, decay: 0.07, gain: 0.12 });\n  },\n});\n"},{"path":"lib\/sounds\/select.ts","type":"util","content":"import { defineSound } from \".\/engine\";\n\n\/** A crisp detent, like a dial clicking into a notch, for tabs, segmented controls and menu choices. *\/\nexport const selectSound = defineSound({\n  name: \"Select\",\n  duration: 0.05,\n  room: 0.08,\n  build: (v) => {\n    v.click({ freq: 4500, q: 2.5, decay: 0.003, gain: 0.45 });\n    v.strike({ freq: 1700, material: \"metal\", decay: 0.028, gain: 0.3 });\n    v.strike({ freq: 520, material: \"wood\", bend: 1.15, decay: 0.012, gain: 0.25 });\n  },\n});\n"},{"path":"lib\/utils.ts","type":"util","content":"import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n"},{"path":"lib\/layers.ts","type":"util","content":"\/**\n * Every open overlay on the page, innermost last: focus traps, modal scopes\n * and dismissable menus all register here. Overlays have no shared z-order to\n * consult, and a menu inside a drawer portals out of it, so this stack is how\n * they agree on who answers Escape and where focus may go.\n *\/\n\nexport interface Layer {\n  \/** Whether `target` belongs to this layer (its panel, portals, trigger). *\/\n  contains: (target: Node) => boolean;\n  \/** True for focus traps and modal scopes, which pull stray focus back. *\/\n  traps?: boolean;\n  \/** False for a layer that ignores Escape, so the key reaches the one below. *\/\n  escape?: boolean;\n}\n\nconst stack: Layer[] = [];\n\/\/ The innermost layer when each Escape began, read before any handler runs,\n\/\/ so a layer that closes itself mid-event can't hand the key to the one below.\nconst escapeOwners = new WeakMap<Event, Layer | undefined>();\nlet listening = false;\n\nfunction innermostEscapeLayer() {\n  for (let index = stack.length - 1; index >= 0; index--) {\n    if (stack[index].escape !== false) return stack[index];\n  }\n  return undefined;\n}\n\nfunction recordEscapeOwner(event: KeyboardEvent) {\n  if (event.key === \"Escape\") escapeOwners.set(event, innermostEscapeLayer());\n}\n\n\/** Registers an open layer. Call the returned function when it closes. *\/\nexport function openLayer(layer: Layer) {\n  if (!listening) {\n    document.addEventListener(\"keydown\", recordEscapeOwner, true);\n    listening = true;\n  }\n  stack.push(layer);\n  return () => {\n    const index = stack.indexOf(layer);\n    if (index !== -1) stack.splice(index, 1);\n  };\n}\n\n\/** Whether this Escape is `layer`'s to answer: it was innermost when the key went down. *\/\nexport function ownsEscape(layer: Layer, event: KeyboardEvent) {\n  if (event.defaultPrevented) return false;\n  const owner = escapeOwners.has(event)\n    ? escapeOwners.get(event)\n    : innermostEscapeLayer();\n  return owner === layer;\n}\n\n\/** Whether `target` sits in a layer opened on top of `layer`. *\/\nexport function inLayerAbove(layer: Layer, target: Node) {\n  const index = stack.indexOf(layer);\n  return stack.slice(index + 1).some((above) => above.contains(target));\n}\n\n\/** Whether a focus trap is open on top of `layer`; stray focus is that one's to pull back. *\/\nexport function trapAbove(layer: Layer) {\n  const index = stack.indexOf(layer);\n  return stack.slice(index + 1).some((above) => above.traps);\n}\n\n\/**\n * Whether `target` belongs to any open layer other than `layer`. Pass\n * `traps: false` to count only dismissable overlays, not the traps under them.\n *\/\nexport function inOtherLayer(layer: Layer, target: Node, { traps = true } = {}) {\n  return stack.some(\n    (other) => other !== layer && (traps || !other.traps) && other.contains(target),\n  );\n}\n"},{"path":"lib\/hooks\/use-on-open.ts","type":"util","content":"\"use client\";\n\nimport { useState } from \"react\";\n\n\/**\n * Runs `start` during the render in which `open` becomes true.\n *\n * Opening a list starts a fresh session - an empty query, the highlight back at\n * the top - and that is a resolution, not a side effect: a passive effect runs\n * after the commit, so the new session would carry the last one's state for a\n * window in which a key press can land.\n *\n * `start` may only set state belonging to the calling component. Anything that\n * reaches outside it - a consumer's callback, a DOM write, moving focus - is a\n * side effect, and React rejects a callback that sets another component's state\n * during this one's render. Put those in an effect keyed to `open`.\n *\/\nexport function useOnOpen(open: boolean, start: () => void) {\n  const [wasOpen, setWasOpen] = useState(open);\n  if (open !== wasOpen) {\n    setWasOpen(open);\n    if (open) start();\n  }\n}\n"},{"path":"lib\/hooks\/use-row-cursor.ts","type":"util","content":"\"use client\";\n\nimport { useCallback, useLayoutEffect, useRef, useState } from \"react\";\n\n\/**\n * Where the keyboard or the pointer last moved to: the row's id, stamped with\n * the query it was placed under.\n *\/\ntype RowCursor = { id: string; query: string };\n\n\/** The cursor's row, or -1 once the query has moved on or the row has left. *\/\nfunction indexOfCursor(\n  rows: readonly { id: string }[],\n  query: string,\n  cursor: RowCursor | null,\n) {\n  if (cursor === null || cursor.query !== query) return -1;\n  return rows.findIndex((row) => row.id === cursor.id);\n}\n\n\/**\n * The highlighted row of a list whose rows can change under it.\n *\n * Which row is highlighted is resolved during render, never in a passive\n * effect: a passive effect runs after the commit, so a list that had just\n * changed would carry an `aria-activedescendant` naming a row that has left it,\n * and a key pressed in that window would commit the wrong row or nothing at\n * all.\n *\n * The cursor holds the row's id, not its position. A position alone cannot tell\n * a list that shrank from one that swapped its rows for a different set of the\n * same length, and the second case is the one that silently hands Enter to a\n * row the user never chose. A cursor whose row has left the list returns the\n * highlight to the first row rather than to the nearest surviving one: the row\n * the user aimed at is gone, and the first row is where a new query already\n * puts the highlight.\n *\n * Pass the query the list is filtered by. The cursor is stamped with it and\n * dropped when it changes, so a caller cannot forget to clear it - including a\n * caller whose query arrives as a prop and so never runs its own handler. Rows\n * that come back under a query that has moved on cannot revive it either.\n * `moveTo(null)` is for deliberate resets, such as reopening the list.\n *\n * Both callbacks keep one identity for the life of the component, and read the\n * rows and the query through a ref to do it. A caller will put them in an\n * effect's dependencies - the exhaustive-deps rule makes it - and a `moveTo`\n * rebuilt on every keystroke would re-run that effect on every keystroke.\n *\/\nexport function useRowCursor(rows: readonly { id: string }[], query: string) {\n  const [cursor, setCursor] = useState<RowCursor | null>(null);\n  \/\/ Written after commit, not during render: a render React discards or has not\n  \/\/ finished still runs the component body, and an event handler that read this\n  \/\/ in that window would stamp the cursor with a query the committed tree does\n  \/\/ not have.\n  const latest = useRef({ rows, query });\n  useLayoutEffect(() => {\n    latest.current = { rows, query };\n  });\n\n  const cursorRow = indexOfCursor(rows, query, cursor);\n  \/\/ Cleared rather than ignored: React re-runs this render with the cursor\n  \/\/ already gone, so rows that come back cannot revive a highlight the user has\n  \/\/ stopped aiming at.\n  if (cursor !== null && cursorRow < 0) setCursor(null);\n\n  const moveTo = useCallback(\n    (id: string | null) =>\n      setCursor(id === null ? null : { id, query: latest.current.query }),\n    [],\n  );\n\n  const moveActive = useCallback((direction: 1 | -1) => {\n    const { rows: live, query: liveQuery } = latest.current;\n    const last = live.length - 1;\n    if (last < 0) return;\n    \/\/ Steps from the row the cursor is really on, inside the update, so that\n    \/\/ two keys landing in one batch move two rows rather than one.\n    setCursor((current) => {\n      const at = Math.max(indexOfCursor(live, liveQuery, current), 0);\n      const next = Math.min(Math.max(at + direction, 0), last);\n      return { id: live[next].id, query: liveQuery };\n    });\n  }, []);\n\n  return { activeIndex: cursorRow < 0 ? 0 : cursorRow, moveTo, moveActive };\n}\n"},{"path":"lib\/audio-context.ts","type":"util","content":"\/\/ One AudioContext for every synthesized sound on the page: the sounds\n\/\/ library (lib\/sounds\/), the WheelPicker tick (lib\/tick-sound.ts), the casino\n\/\/ games (lib\/game-sounds.ts) and Bookshelf (lib\/book-sounds.ts). Browsers cap\n\/\/ concurrent contexts, and a page can show a date made of several WheelPickers\n\/\/ next to a game, so they all share this one. It is created on first use and\n\/\/ closed once every player is disposed.\n\/\/\n\/\/ Every player connects to `audioOutput()` rather than the context's\n\/\/ destination, so the page-wide volume and mute from `SoundProvider`\n\/\/ (lib\/sound.tsx) reach all of them in one place.\n\ntype AudioContextCtor = typeof AudioContext;\n\nlet context: AudioContext | null = null;\nlet master: GainNode | null = null;\nlet users = 0;\n\n\/** Settings one mounted `SoundProvider` asks for. *\/\nexport interface SoundSettingsEntry {\n  \/** Nesting depth: the deepest provider decides. *\/\n  depth: number;\n  enabled: boolean;\n  volume: number;\n}\n\n\/\/ Mounted providers in mount order. Module state, so `sound.play()` called\n\/\/ outside React obeys them too. The deepest provider wins; among equals, the\n\/\/ one mounted last. Effects run child first, so this can't be \"whoever ran\n\/\/ last\".\nconst providers = new Set<SoundSettingsEntry>();\nlet allowed = true;\nlet volume = 1;\n\nfunction applySettings() {\n  let chosen: SoundSettingsEntry | undefined;\n  for (const entry of providers) {\n    if (!chosen || entry.depth >= chosen.depth) chosen = entry;\n  }\n  allowed = chosen?.enabled ?? true;\n  volume = Math.min(1, Math.max(0, chosen?.volume ?? 1));\n  if (master) master.gain.value = volume;\n}\n\n\/**\n * Registers a provider's settings; call `update` after changing the entry and\n * the returned release function when the provider unmounts.\n *\/\nexport function registerSoundSettings(entry: SoundSettingsEntry) {\n  providers.add(entry);\n  applySettings();\n  return {\n    update: applySettings,\n    release() {\n      providers.delete(entry);\n      applySettings();\n    },\n  };\n}\n\n\/**\n * Registers a sound player. Call the returned function when the player is\n * disposed; the context closes after the last one.\n *\/\nexport function retainAudioContext() {\n  users++;\n  let released = false;\n  return () => {\n    if (released) return;\n    released = true;\n    users--;\n    if (users === 0 && context) {\n      void context.close();\n      context = null;\n      master = null;\n    }\n  };\n}\n\n\/**\n * The shared context, created on first call and resumed if suspended. Null\n * during SSR, in browsers without Web Audio, and while sounds are muted or at\n * zero volume.\n *\/\nexport function getAudioContext(): AudioContext | null {\n  if (!allowed || volume <= 0) return null;\n  if (!context) {\n    if (typeof window === \"undefined\") return null;\n    const Ctor =\n      window.AudioContext ??\n      (window as unknown as { webkitAudioContext?: AudioContextCtor }).webkitAudioContext;\n    if (!Ctor) return null;\n    context = new Ctor();\n  }\n  \/\/ Browsers may refuse outside a user gesture. Players call this from\n  \/\/ pointer and key handlers first, so a later call finds it running.\n  if (context.state === \"suspended\") void context.resume().catch(() => undefined);\n  return context;\n}\n\n\/** The node every player connects to: the page-wide volume, then the speakers. *\/\nexport function audioOutput(ctx: AudioContext): AudioNode {\n  if (master?.context !== ctx) {\n    master = ctx.createGain();\n    master.gain.value = volume;\n    master.connect(ctx.destination);\n  }\n  return master;\n}\n\nconst gains = new WeakMap<BaseAudioContext, Map<string, GainNode>>();\n\n\/**\n * A player's own level, made once per context and routed into `audioOutput`.\n * Players keep their mix this way without rebuilding nodes on every play, and\n * a context closed and recreated gets fresh ones.\n *\/\nexport function playerGain(ctx: AudioContext, key: string, level: number): GainNode {\n  let byKey = gains.get(ctx);\n  if (!byKey) {\n    byKey = new Map();\n    gains.set(ctx, byKey);\n  }\n  let gain = byKey.get(key);\n  if (!gain) {\n    gain = ctx.createGain();\n    gain.gain.value = level;\n    gain.connect(audioOutput(ctx));\n    byKey.set(key, gain);\n  }\n  return gain;\n}\n"},{"path":"lib\/sounds\/engine.ts","type":"util","content":"import { audioOutput, getAudioContext } from \"@\/lib\/audio-context\";\n\n\/\/ Every beUI sound is a short recipe played with Web Audio the moment it is\n\/\/ asked for. Nothing is downloaded. Recipes are built the way a real tap\n\/\/ sounds: a contact click (a millisecond of filtered noise), a body that\n\/\/ rings at a few inharmonic partials of a material and settles in pitch, and\n\/\/ a little of a small room behind it.\n\n\/** Options for one play of a sound. *\/\nexport interface PlayOptions {\n  \/** 0 to 1, multiplied with the page-wide volume from `SoundProvider`. *\/\n  volume?: number;\n  \/** Pitch multiplier; 1 is the designed pitch. *\/\n  pitch?: number;\n}\n\n\/** Where a sound renders: the live context, or an offline one for drawing. *\/\nexport interface SoundTarget {\n  context: BaseAudioContext;\n  destination: AudioNode;\n  \/** Start time on the context clock, in seconds. *\/\n  when: number;\n  volume: number;\n  pitch: number;\n}\n\n\/** A plain oscillator with an attack, a decay and an optional glide. *\/\nexport interface ToneSpec {\n  type?: OscillatorType;\n  \/** Start frequency in Hz. *\/\n  freq: number;\n  \/** End frequency in Hz; glides from `freq` over `glide`. *\/\n  to?: number;\n  \/** Glide time in seconds; defaults to the attack plus decay. *\/\n  glide?: number;\n  \/** Starts this many times higher and settles to `freq` in about 15 ms, like a struck object. *\/\n  bend?: number;\n  \/** Delay from the sound's start, in seconds. *\/\n  at?: number;\n  \/** Fade-in time in seconds. *\/\n  attack?: number;\n  \/** Time to fade to silence after the attack, in seconds. *\/\n  decay: number;\n  gain: number;\n}\n\n\/** A burst of filtered white noise. *\/\nexport interface NoiseSpec {\n  filter?: BiquadFilterType;\n  \/** Filter frequency in Hz. *\/\n  freq: number;\n  \/** End filter frequency in Hz; sweeps from `freq` over the decay. *\/\n  to?: number;\n  q?: number;\n  \/** Delay from the sound's start, in seconds. *\/\n  at?: number;\n  \/** Fade-in time in seconds. *\/\n  attack?: number;\n  \/** Time to fade to silence after the attack, in seconds. *\/\n  decay: number;\n  gain: number;\n}\n\n\/** The contact of a tap: a few milliseconds of band-passed noise with an instant attack. *\/\nexport interface ClickSpec {\n  \/** Band center in Hz: 1-2 kHz is a soft knock, 3-5 kHz a crisp click. *\/\n  freq: number;\n  \/** Band width; higher is narrower and more tonal. *\/\n  q?: number;\n  \/** Delay from the sound's start, in seconds. *\/\n  at?: number;\n  \/** Time to fade to silence, in seconds. *\/\n  decay?: number;\n  gain: number;\n}\n\n\/** How a material rings: partials as [frequency ratio, level], and how fast high ones die. *\/\nexport interface Material {\n  partials: readonly (readonly [ratio: number, level: number])[];\n  \/** Higher partials decay in `decay \/ ratio ** damping`; wood is high, metal low. *\/\n  damping: number;\n}\n\n\/\/ Partial ratios follow the modes of small struck objects: a free bar for\n\/\/ wood and metal, a cup for glass, a tuned bar for the mallet.\nexport const MATERIALS = {\n  wood: { partials: [[1, 1], [2.76, 0.3], [5.4, 0.08]], damping: 1.3 },\n  plastic: { partials: [[1, 1], [2.43, 0.4], [4.86, 0.14]], damping: 0.9 },\n  glass: { partials: [[1, 1], [2.32, 0.42], [4.25, 0.2], [6.63, 0.08]], damping: 0.55 },\n  metal: { partials: [[1, 1], [2.76, 0.5], [5.4, 0.26], [8.93, 0.1]], damping: 0.4 },\n  mallet: { partials: [[1, 1], [3.99, 0.2], [9.14, 0.05]], damping: 0.8 },\n  bell: { partials: [[1, 1], [2.0, 0.34], [2.76, 0.2], [5.4, 0.07]], damping: 0.5 },\n} satisfies Record<string, Material>;\n\n\/** A struck object: one partial per mode of its material, each with its own decay. *\/\nexport interface StrikeSpec {\n  \/** Fundamental in Hz. *\/\n  freq: number;\n  \/** A name from `MATERIALS` or your own partials. Default: \"plastic\". *\/\n  material?: keyof typeof MATERIALS | Material;\n  \/** Starts this many times higher and settles in about 15 ms. Default: 1.01. *\/\n  bend?: number;\n  \/** Delay from the sound's start, in seconds. *\/\n  at?: number;\n  \/** Time for the fundamental to fade to silence, in seconds. *\/\n  decay: number;\n  gain: number;\n}\n\nexport interface Voice {\n  tone(spec: ToneSpec): void;\n  noise(spec: NoiseSpec): void;\n  click(spec: ClickSpec): void;\n  strike(spec: StrikeSpec): void;\n}\n\nexport interface Sound {\n  \/** Display name, like \"Tap\". *\/\n  name: string;\n  \/** Length in seconds; the room tail rings a little past it. *\/\n  duration: number;\n  \/** Plays the sound now. Silent during SSR and while sounds are muted. *\/\n  play(options?: PlayOptions): void;\n  \/** Schedules the sound on any context; `play` uses the live one. *\/\n  render(target: SoundTarget): void;\n}\n\nexport interface SoundRecipe {\n  \/** Display name, like \"Tap\". *\/\n  name: string;\n  \/** Length in seconds; the room tail rings a little past it. *\/\n  duration: number;\n  \/** Random pitch spread per play (0.04 = \u00b14%), so repeats don't sound stamped. *\/\n  vary?: number;\n  \/** How much of the small room the sound is played in, 0 (dry) to 1. Default: 0.12. *\/\n  room?: number;\n  \/** Adds the sound's layers to the voice on each play. *\/\n  build: (voice: Voice) => void;\n}\n\n\/\/ Keeps a sum of voices well under clipping at volume 1.\nconst MASTER_GAIN = 0.16;\nconst SILENT = 0.0001;\n\/\/ Time a strike or bend takes to settle onto its pitch.\nconst SETTLE = 0.015;\n\nconst noiseBuffers = new WeakMap<BaseAudioContext, AudioBuffer>();\n\n\/** One second of white noise per context, shared by every noise voice. *\/\nexport function noiseBuffer(context: BaseAudioContext) {\n  let buffer = noiseBuffers.get(context);\n  if (!buffer) {\n    buffer = context.createBuffer(1, context.sampleRate, context.sampleRate);\n    const data = buffer.getChannelData(0);\n    for (let i = 0; i < data.length; i++) data[i] = Math.random() * 2 - 1;\n    noiseBuffers.set(context, buffer);\n  }\n  return buffer;\n}\n\n\/\/ A small, soft room: 8 early reflections, then a diffuse tail that falls\n\/\/ 60 dB in 0.3 s and darkens as it fades, the way air and soft walls\n\/\/ absorb highs first. Generated once per context.\nconst ROOM_LENGTH = 0.3;\n\/\/ The convolver's equal-power normalization leaves the room about 15 dB\n\/\/ under the dry sound; this brings `room: 0.12` to a tail heard only as space.\nconst ROOM_GAIN = 6;\nconst roomBuffers = new WeakMap<BaseAudioContext, AudioBuffer>();\n\nfunction roomBuffer(context: BaseAudioContext) {\n  let buffer = roomBuffers.get(context);\n  if (!buffer) {\n    const rate = context.sampleRate;\n    const length = Math.ceil(ROOM_LENGTH * rate);\n    buffer = context.createBuffer(2, length, rate);\n    for (let channel = 0; channel < 2; channel++) {\n      const data = buffer.getChannelData(channel);\n      let smooth = 0;\n      for (let i = Math.floor(0.004 * rate); i < length; i++) {\n        const t = i \/ rate;\n        \/\/ One-pole low-pass whose cutoff closes over the tail.\n        const brightness = 0.7 * Math.exp(-t \/ 0.08) + 0.08;\n        smooth += brightness * (Math.random() * 2 - 1 - smooth);\n        data[i] = smooth * Math.exp(-t \/ 0.043);\n      }\n      for (let r = 0; r < 8; r++) {\n        const at = Math.floor((0.005 + Math.random() * 0.022) * rate);\n        data[at] += (Math.random() < 0.5 ? -1 : 1) * (0.5 - r * 0.05);\n      }\n    }\n    roomBuffers.set(context, buffer);\n  }\n  return buffer;\n}\n\n\/\/ One convolver per output node, shared by every play: building one is the\n\/\/ expensive part, sending to it is cheap.\nconst rooms = new WeakMap<AudioNode, ConvolverNode>();\n\nfunction roomFor(context: BaseAudioContext, destination: AudioNode) {\n  let room = rooms.get(destination);\n  if (!room) {\n    room = context.createConvolver();\n    room.buffer = roomBuffer(context);\n    room.connect(destination);\n    rooms.set(destination, room);\n  }\n  return room;\n}\n\n\/** A linear attack to `peak`, then an exponential fall to silence. *\/\nfunction envelope(param: AudioParam, start: number, attack: number, decay: number, peak: number) {\n  param.setValueAtTime(0, start);\n  param.linearRampToValueAtTime(Math.max(peak, SILENT), start + attack);\n  param.exponentialRampToValueAtTime(SILENT, start + attack + decay);\n}\n\nfunction voiceFor(target: SoundTarget, output: AudioNode): Voice {\n  const { context, when, pitch } = target;\n  \/\/ Partials above this only add hiss on small speakers, or alias near Nyquist.\n  const ceiling = Math.min(12000, context.sampleRate * 0.45);\n\n  const tone: Voice[\"tone\"] = ({ type = \"sine\", freq, to, glide, bend, at = 0, attack = 0.002, decay, gain }) => {\n    const start = when + at;\n    const osc = context.createOscillator();\n    const amp = context.createGain();\n    osc.type = type;\n    const base = freq * pitch;\n    osc.frequency.setValueAtTime(base * (bend ?? 1), start);\n    if (bend !== undefined) osc.frequency.exponentialRampToValueAtTime(base, start + SETTLE);\n    if (to !== undefined) {\n      osc.frequency.exponentialRampToValueAtTime(to * pitch, start + Math.max(glide ?? attack + decay, SETTLE));\n    }\n    envelope(amp.gain, start, attack, decay, gain);\n    osc.connect(amp).connect(output);\n    osc.start(start);\n    osc.stop(start + attack + decay + 0.02);\n  };\n\n  const noise: Voice[\"noise\"] = ({ filter = \"bandpass\", freq, to, q = 1, at = 0, attack = 0.002, decay, gain }) => {\n    const start = when + at;\n    const source = context.createBufferSource();\n    const shape = context.createBiquadFilter();\n    const amp = context.createGain();\n    source.buffer = noiseBuffer(context);\n    shape.type = filter;\n    shape.Q.value = q;\n    shape.frequency.setValueAtTime(freq * pitch, start);\n    if (to !== undefined) {\n      shape.frequency.exponentialRampToValueAtTime(to * pitch, start + attack + decay);\n    }\n    envelope(amp.gain, start, attack, decay, gain);\n    source.connect(shape).connect(amp).connect(output);\n    \/\/ A random offset into the buffer keeps each burst a little different.\n    source.start(start, Math.random() * 0.5);\n    source.stop(start + attack + decay + 0.02);\n  };\n\n  return {\n    tone,\n    noise,\n    click({ freq, q = 2, at = 0, decay = 0.005, gain }) {\n      \/\/ A little spread on the band, so no two contacts are identical.\n      noise({ freq: freq * (0.94 + Math.random() * 0.12), q, at, attack: 0.0005, decay, gain });\n    },\n    strike({ freq, material = \"plastic\", bend = 1.01, at = 0, decay, gain }) {\n      const { partials, damping } = typeof material === \"string\" ? MATERIALS[material] : material;\n      for (const [ratio, level] of partials) {\n        if (freq * ratio * pitch * bend > ceiling) continue;\n        tone({\n          \/\/ Real objects are never perfectly tuned; a hair of detune per partial.\n          freq: freq * ratio * (1 + (Math.random() * 2 - 1) * 0.003),\n          bend,\n          at,\n          attack: 0.001,\n          decay: decay \/ ratio ** damping,\n          gain: gain * level,\n        });\n      }\n    },\n  };\n}\n\n\/** Turns a recipe into a playable sound. *\/\nexport function defineSound({ name, duration, vary = 0, room = 0.12, build }: SoundRecipe): Sound {\n  const render = (target: SoundTarget) => {\n    const { context, destination } = target;\n    const output = context.createGain();\n    output.gain.value = MASTER_GAIN * target.volume;\n    output.connect(destination);\n    if (room > 0) {\n      const send = context.createGain();\n      send.gain.value = room * ROOM_GAIN;\n      output.connect(send).connect(roomFor(context, destination));\n    }\n    build(voiceFor(target, output));\n  };\n\n  return {\n    name,\n    duration,\n    render,\n    play({ volume = 1, pitch = 1 } = {}) {\n      const context = getAudioContext();\n      if (!context || volume <= 0) return;\n      const spread = vary ? 1 + (Math.random() * 2 - 1) * vary : 1;\n      render({\n        context,\n        \/\/ The page-wide volume is applied there.\n        destination: audioOutput(context),\n        when: context.currentTime + 0.005,\n        volume,\n        pitch: pitch * spread,\n      });\n    },\n  };\n}\n"},{"path":"components\/previews\/motion\/select.preview.tsx","type":"preview","content":"\"use client\";\n\nimport { useState } from \"react\";\nimport {\n  Select,\n  SelectContent,\n  SelectItem,\n  SelectTrigger,\n  SelectValue,\n} from \"@\/components\/motion\/select\";\n\nexport function SelectPreview() {\n  const [value, setValue] = useState(\"next\");\n  return (\n    <div className=\"w-56\">\n      <Select sound value={value} onValueChange={setValue}>\n        <SelectTrigger>\n          <SelectValue placeholder=\"Pick a framework\" \/>\n        <\/SelectTrigger>\n        <SelectContent>\n          <SelectItem value=\"next\">Next.js<\/SelectItem>\n          <SelectItem value=\"remix\">Remix<\/SelectItem>\n          <SelectItem value=\"astro\">Astro<\/SelectItem>\n          <SelectItem value=\"vite\">Vite<\/SelectItem>\n        <\/SelectContent>\n      <\/Select>\n    <\/div>\n  );\n}\n"}]}