{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "core-microphone-arrangement-selector",
  "type": "registry:ui",
  "title": "Microphone Arrangement Selector",
  "description": "Mono, spaced pair, XY and ORTF diagrams in a compact visual card selector, sharing microphone pattern grid behavior.",
  "dependencies": [
    "@base-ui/react",
    "maruaudio@>=0.0.3 <0.1.0"
  ],
  "registryDependencies": [
    "https://pluginui.com/r/core-microphone-pattern-selector.json"
  ],
  "files": [
    {
      "path": "components/ui/microphone-arrangement-selector.tsx",
      "content": "/**\n * Source: https://maru.audio/ui-kit/microphone-arrangement-selector\n * Copyright © [Maru](https://maru.audio)\n *\n * Maru UI Kit — https://maru.audio/ui-kit\n *\n * Installed from the Maru UI registry. This file is yours now: edit it\n * freely, it will not be overwritten unless you re-run the add command.\n *\n * Keep this item’s companion files and CSS imports together. Dependencies\n * declared by the registry are installed with the source.\n */\nimport type { CSSProperties, ReactNode } from \"react\"\nimport {\n  MicrophoneCardSelector,\n  type MicrophoneSelectorParts,\n  type MicrophoneSelectorOptionInput,\n} from \"@/components/ui/microphone-pattern-selector\"\n\nexport const MICROPHONE_ARRANGEMENTS = [\n  \"mono\",\n  \"spaced-pair\",\n  \"xy\",\n  \"ortf\",\n] as const\nexport type MicrophoneArrangement = (typeof MICROPHONE_ARRANGEMENTS)[number]\nexport const MICROPHONE_ARRANGEMENT_LABELS: Record<\n  MicrophoneArrangement,\n  string\n> = {\n  mono: \"Mono\",\n  \"spaced-pair\": \"Spaced pair\",\n  xy: \"XY\",\n  ortf: \"ORTF\",\n}\nexport function microphoneArrangementAtIndex(\n  value: number\n): MicrophoneArrangement {\n  return (\n    MICROPHONE_ARRANGEMENTS[Math.max(0, Math.min(3, Math.round(value)))] ??\n    \"mono\"\n  )\n}\nexport function microphoneArrangementIndex(value: MicrophoneArrangement) {\n  return MICROPHONE_ARRANGEMENTS.indexOf(value)\n}\n\n/** Top view: capsule positions and forward axes, independent of pickup pattern. */\nexport function MicrophoneArrangementGlyph({\n  arrangement,\n  size = 48,\n}: {\n  arrangement: MicrophoneArrangement\n  size?: number\n}) {\n  const spread =\n    arrangement === \"spaced-pair\" ? 16 : arrangement === \"ortf\" ? 9 : 0\n  const angle = arrangement === \"xy\" ? 45 : arrangement === \"ortf\" ? 55 : 0\n  const annotation =\n    arrangement === \"spaced-pair\"\n      ? \"Spacing\"\n      : arrangement === \"xy\"\n        ? \"90°\"\n        : arrangement === \"ortf\"\n          ? \"17 cm · 110°\"\n          : \"Single\"\n  return (\n    <svg\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      viewBox=\"0 0 64 64\"\n      width={size}\n      height={size}\n      fill=\"none\"\n    >\n      <path d=\"M32 5v43M8 32h48\" stroke=\"currentColor\" opacity=\".12\" />\n      {arrangement === \"spaced-pair\" && (\n        <path\n          d=\"M16 44h32m-32-3v6m32-6v6\"\n          stroke=\"currentColor\"\n          opacity=\".45\"\n        />\n      )}\n      {(arrangement === \"mono\" ? [0] : [-1, 1]).map((side) => (\n        <g\n          key={side}\n          transform={`translate(${32 + side * spread} 32) rotate(${side * angle})`}\n        >\n          <path\n            d=\"M0 -7v-15m-3 3 3-3 3 3\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.2\"\n          />\n          <rect\n            x=\"-3\"\n            y=\"-7\"\n            width=\"6\"\n            height=\"16\"\n            rx=\"2\"\n            fill=\"currentColor\"\n            fillOpacity=\".16\"\n            stroke=\"currentColor\"\n            strokeWidth=\"1.6\"\n          />\n          <path d=\"M-3 -3h6\" stroke=\"currentColor\" />\n          <circle cy=\"-6\" r=\"1.2\" fill=\"currentColor\" />\n        </g>\n      ))}\n      <text\n        x=\"32\"\n        y=\"59\"\n        textAnchor=\"middle\"\n        fill=\"currentColor\"\n        fontSize=\"7\"\n        fontFamily=\"var(--uikit-font,system-ui,sans-serif)\"\n      >\n        {annotation}\n      </text>\n    </svg>\n  )\n}\nexport interface MicrophoneArrangementSelectorProps extends MicrophoneSelectorParts {\n  renderGlyph?: (arrangement: MicrophoneArrangement, size: number) => ReactNode\n  value: MicrophoneArrangement\n  onValueChange: (value: MicrophoneArrangement) => void\n  options?: readonly MicrophoneSelectorOptionInput<MicrophoneArrangement>[]\n  label?: string\n  labelHidden?: boolean\n  disabled?: boolean\n  className?: string\n  style?: CSSProperties\n}\nexport function MicrophoneArrangementSelector({\n  options = MICROPHONE_ARRANGEMENTS,\n  label = \"Arrangement\",\n  renderGlyph = (arrangement, size) => (\n    <MicrophoneArrangementGlyph arrangement={arrangement} size={size} />\n  ),\n  ...props\n}: MicrophoneArrangementSelectorProps) {\n  return (\n    <MicrophoneCardSelector\n      {...props}\n      options={options}\n      labels={MICROPHONE_ARRANGEMENT_LABELS}\n      label={label}\n      columns={2}\n      renderGlyph={renderGlyph}\n    />\n  )\n}\n",
      "type": "registry:component",
      "target": "@ui/microphone-arrangement-selector.tsx"
    }
  ]
}
