{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "example-graphite-compressor",
  "type": "registry:block",
  "title": "Graphite Compressor",
  "description": "A silent brushed graphite compressor face with ridged drive fader, domed gain dial, pixel LCD, raised character keys and machined switches.",
  "dependencies": [
    "@base-ui/react",
    "maruaudio@>=0.0.3 <0.1.0"
  ],
  "registryDependencies": [
    "https://pluginui.com/r/core-fader.json",
    "https://pluginui.com/r/gallery-graphite-fader.json",
    "https://pluginui.com/r/gallery-graphite-knob.json",
    "https://pluginui.com/r/gallery-graphite-selector.json",
    "https://pluginui.com/r/gallery-graphite-toggle.json",
    "https://pluginui.com/r/core-knob.json"
  ],
  "files": [
    {
      "path": "components/blocks/graphite-compressor.tsx",
      "content": "/**\n * Source: https://pluginui.com/examples/graphite-compressor\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 { percent } from \"maruaudio/ui/shared/format\"\nimport { Fader } from \"@/components/ui/fader\"\nimport { Knob } from \"@/components/ui/knob\"\nimport { useState, type ReactNode } from \"react\"\nimport { GraphiteKnobDesign } from \"@/components/ui/graphite-knob\"\nimport { GraphiteFaderDesign } from \"@/components/ui/graphite-fader\"\nimport { GraphiteSelector } from \"@/components/ui/graphite-selector\"\nimport { GraphiteToggle } from \"@/components/ui/graphite-toggle\"\nimport { UI_KIT_TEXT_SELECTION_STYLES } from \"maruaudio/ui/shared/portable-styles\"\nimport \"@/components/blocks/graphite-compressor.css\"\nexport interface GraphiteCompressorProps {\n  branding?: ReactNode\n}\n/** A silent interface. The LCD is a deterministic illustration of local control state. */\nexport function GraphiteCompressor({ branding }: GraphiteCompressorProps) {\n  const [drive, setDrive] = useState(0.28)\n  const [gain, setGain] = useState(0.5)\n  const [character, setCharacter] = useState(1)\n  const [classA, setClassA] = useState(true)\n  const [power, setPower] = useState(true)\n  const cells: ReactNode[] = []\n  for (let x = 0; x < 32; x++) {\n    const peak =\n      (3.5 * Math.exp(-(((x - 4) / 2.3) ** 2)) +\n        5 * Math.exp(-(((x - 14) / 2.5) ** 2)) +\n        10 * Math.exp(-(((x - 26) / 4) ** 2)) +\n        0.9) *\n      (0.75 + drive * 0.6) *\n      (0.85 + gain * 0.3)\n    const variation = 0.72 + 0.28 * Math.sin(x * 1.7 + character * 0.8)\n    const top = Math.min(11, Math.round(peak * variation))\n    const bottom = Math.min(\n      10,\n      Math.round(peak * (0.7 + 0.3 * Math.cos(x * 1.5 + (classA ? 0 : 1))))\n    )\n    for (let y = -top; y <= bottom; y++)\n      if (y !== 0)\n        cells.push(\n          <rect\n            key={`${x}:${y}`}\n            x={x * 7.2 + 6}\n            y={112 + y * 7.2}\n            width=\"5.4\"\n            height=\"5.4\"\n          />\n        )\n  }\n  return (\n    <section\n      className=\"graphite-compressor\"\n      aria-label=\"Graphite Compressor, silent interface\"\n      data-text-selection=\"editable-only\"\n      data-powered={power}\n    >\n      <style>{UI_KIT_TEXT_SELECTION_STYLES}</style>\n      <div className=\"graphite-compressor__drive\">\n        <Fader\n          value={drive}\n          onChange={setDrive}\n          format={percent()}\n          length={210}\n          orientation={\"vertical\"}\n          thickness={110}\n          capInset={68}\n          hideLabel\n          hideValue\n          renderDesign={GraphiteFaderDesign}\n        />\n      </div>\n      <div className=\"graphite-compressor__gain\">\n        <Knob\n          value={gain}\n          onChange={setGain}\n          valueDisplay=\"percent\"\n          size={200}\n          defaultValue={0.5}\n          hideLabel\n          hideValue\n          renderDesign={GraphiteKnobDesign}\n        />\n      </div>\n      <div\n        className=\"graphite-compressor__lcd\"\n        role=\"img\"\n        aria-label=\"Illustrative waveform responding to controls, not audio analysis\"\n      >\n        <svg viewBox=\"0 0 240 224\" aria-hidden=\"true\">\n          {power ? cells : null}\n        </svg>\n      </div>\n      <strong className=\"graphite-compressor__drive-label\">DRIVE</strong>\n      <strong className=\"graphite-compressor__gain-label\">MASTER GAIN</strong>\n      <div className=\"graphite-compressor__character\">\n        <GraphiteSelector value={character} onChange={setCharacter} />\n      </div>\n      <div className=\"graphite-compressor__class\">\n        <GraphiteToggle checked={classA} onChange={setClassA} label=\"Class A\" />\n        <div>\n          <span>CLASS A</span>\n          <span>CLASS AB</span>\n        </div>\n      </div>\n      <footer className=\"graphite-compressor__footer\">\n        <div className=\"graphite-compressor__identity\">\n          {branding ?? (\n            <>\n              <span>0418</span>\n              <small>COMPRESSOR</small>\n            </>\n          )}\n        </div>\n        <GraphiteToggle\n          checked={power}\n          onChange={setPower}\n          label=\"Power\"\n          power\n        />\n      </footer>\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/blocks/graphite-compressor.tsx"
    },
    {
      "path": "components/blocks/graphite-compressor.css",
      "content": "/**\n * Source: https://pluginui.com/examples/graphite-compressor\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 */\n.graphite-compressor {\n  position: relative;\n  width: 752px;\n  height: 564px;\n  flex: none;\n  overflow: hidden;\n  isolation: isolate;\n  box-sizing: border-box;\n  color: #e1e6e7;\n  background:\n    repeating-linear-gradient(\n      0deg,\n      #39424755 0px,\n      #39424755 1px,\n      #1f282c55 1px,\n      #1f282c55 2px\n    ),\n    linear-gradient(110deg, #424b50, #333b3f);\n  font-family: Arial, Helvetica, sans-serif;\n  font-size: 18px;\n  text-shadow: 0 1px 1px #172025;\n}\n.graphite-compressor:after {\n  content: \"\";\n  pointer-events: none;\n  position: absolute;\n  inset: 0;\n  opacity: 0.17;\n  background: repeating-linear-gradient(\n    90deg,\n    transparent 0px,\n    #c2d0d01c 1px,\n    transparent 2px,\n    transparent 5px\n  );\n  z-index: -1;\n}\n.graphite-compressor__drive {\n  position: absolute;\n  left: 54px;\n  top: 27px;\n}\n.graphite-compressor__gain {\n  position: absolute;\n  left: 214px;\n  top: 42px;\n}\n.graphite-compressor__lcd {\n  position: absolute;\n  left: 463px;\n  top: 34px;\n  width: 253px;\n  height: 237px;\n  box-sizing: border-box;\n  border: 4px solid #151f21;\n  border-radius: 10px;\n  background: linear-gradient(120deg, #a4bcbb, #b0c5c2 70%, #9fb9b5);\n  box-shadow:\n    inset 0 2px 4px #dee9e4,\n    0 1px 1px #b1c1c055,\n    0 0 0 1px #697575;\n}\n.graphite-compressor__lcd svg {\n  width: 100%;\n  height: 100%;\n  display: block;\n  fill: #718f8d;\n  opacity: 0.9;\n  filter: drop-shadow(0 1px 1px #c7d8d1);\n}\n.graphite-compressor__drive-label,\n.graphite-compressor__gain-label {\n  position: absolute;\n  top: 260px;\n  font-size: 18px;\n  font-weight: 900;\n  text-align: center;\n  line-height: 24px;\n}\n.graphite-compressor__drive-label {\n  left: 43px;\n  width: 128px;\n}\n.graphite-compressor__gain-label {\n  left: 216px;\n  width: 194px;\n}\n.graphite-compressor__character {\n  position: absolute;\n  left: 37px;\n  top: 313px;\n}\n.graphite-compressor__class {\n  position: absolute;\n  left: 561px;\n  top: 315px;\n  display: flex;\n  gap: 15px;\n  align-items: center;\n}\n.graphite-compressor__class > div {\n  display: flex;\n  flex-direction: column;\n  gap: 23px;\n  font-size: 18px;\n  font-weight: 900;\n  white-space: nowrap;\n}\n.graphite-compressor__footer {\n  position: absolute;\n  left: 0;\n  right: 0;\n  top: 439px;\n  height: 125px;\n  border-top: 5px solid #1c252a;\n  box-shadow: inset 0 1px 1px #80909388;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 0 34px 0 30px;\n  box-sizing: border-box;\n}\n.graphite-compressor__identity {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n}\n.graphite-compressor__identity > span {\n  font-family: \"Helvetica Neue\", system-ui, sans-serif;\n  font-weight: 200;\n  font-size: 48px;\n  line-height: 1;\n  letter-spacing: -2px;\n}\n.graphite-compressor__identity > small {\n  font-size: 10px;\n  font-weight: 700;\n  letter-spacing: 14px;\n}\n.graphite-compressor[data-powered=\"false\"] .graphite-compressor__lcd {\n  filter: brightness(0.72);\n}\n",
      "type": "registry:file",
      "target": "@components/blocks/graphite-compressor.css"
    }
  ]
}
