{
  "component": {
    "id": "split-button",
    "name": "Split button",
    "tier": "pro",
    "exampleId": "split-button",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/split-button-demo.tsx",
    "exportName": "SplitButtonDemo",
    "sha256": "da6f2b75b8db7d66bbff00953d0bc9a1791d9f734990daf6edc441596da1d7bb",
    "helperImports": [],
    "directComponentImports": [
      "split-button"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/split-button",
    "registryUrl": "https://tidalui.com/r/pro/split-button.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/split-button",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/split-button",
      "registryUrl": "https://tidalui.com/r/pro/split-button.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/split-button.tsx",
    "exports": [
      "TidalSplitButton"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/split-button.css",
      "components/ui/dropdown-menu.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/tidal-button.json",
      "https://tidalui.com/r/dropdown-menu.json"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "dropdown-menu",
      "split-button",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/split-button.css",
      "components/ui/dropdown-menu.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/split-button.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/split-button-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useRef, useState } from \"react\";\n\nimport { Archive, Copy, FileCheck2 } from \"lucide-react\";\n\nimport { TidalSplitButton } from \"./components/ui/split-button\";\n\nimport \"./components/ui/split-button.css\";\n\nimport \"./components/ui/dropdown-menu.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .split-demo {\\n  container: split-demo / inline-size;\\n  display: grid;\\n  justify-items: start;\\n  width: min(100%, 440px);\\n  min-width: 0;\\n  gap: 14px;\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .split-demo-context {\\n  display: flex;\\n  align-items: baseline;\\n  justify-content: space-between;\\n  gap: 14px;\\n  width: 100%;\\n  min-width: 0;\\n  padding-bottom: 10px;\\n  border-bottom: 1px solid var(--t-border);\\n}\\n\\n.tidal-scope .split-demo-context > span,\\n.tidal-scope .split-demo-context > strong,\\n.tidal-scope .split-demo-status,\\n.tidal-scope .split-demo-note {\\n  margin: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .split-demo-context > span {\\n  min-width: 0;\\n  font-size: 12px;\\n  font-weight: 650;\\n}\\n\\n.tidal-scope .split-demo-context > strong {\\n  flex: none;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 560;\\n}\\n\\n.tidal-scope .split-demo .tidal-split-button {\\n  max-width: 100%;\\n}\\n\\n.tidal-scope .split-demo-status,\\n.tidal-scope .split-demo-note {\\n  color: var(--t-muted);\\n  font-size: 12px;\\n  line-height: 1.55;\\n}\\n\\n.tidal-scope .split-demo-status {\\n  min-height: 19px;\\n  color: var(--t-ink);\\n}\\n\\n.tidal-scope .split-demo-note {\\n  padding-top: 2px;\\n  border-top: 1px solid var(--t-border);\\n}\\n\\n@container split-demo (max-width: 300px) {\\n  .tidal-scope .split-demo-context {\\n    align-items: flex-start;\\n    flex-direction: column;\\n    gap: 4px;\\n  }\\n\\n  .tidal-scope .split-demo .tidal-split-button {\\n    width: 100%;\\n  }\\n}\";\n\nexport function SplitButtonDemo({\n  theme = \"light\",\n}: {\n  theme?: \"light\" | \"dark\";\n}) {\n  const primaryRef = useRef<HTMLButtonElement>(null);\n  const triggerRef = useRef<HTMLButtonElement>(null);\n  const [revision, setRevision] = useState(3);\n  const [archived, setArchived] = useState(false);\n  const [status, setStatus] = useState(\"Revision 3 is ready to save.\");\n\n  return (\n    <section className=\"split-demo\" aria-label=\"Split button preview\">\n      <div className=\"split-demo-context\">\n        <span>Project brief</span>\n        <strong>Revision {revision}</strong>\n      </div>\n\n      <TidalSplitButton\n        theme={theme}\n        label={archived ? \"Restore draft\" : \"Save draft\"}\n        menuLabel=\"More draft actions\"\n        primaryRef={primaryRef}\n        triggerRef={triggerRef}\n        primaryProps={{\n          onClick: () => {\n            if (archived) {\n              setArchived(false);\n              setStatus(\"The fictional draft was restored in this preview.\");\n              return;\n            }\n            setRevision((current) => current + 1);\n            setStatus(\"A new local revision was saved in this preview.\");\n          },\n        }}\n        options={[\n          {\n            id: \"copy\",\n            textValue: \"Save a copy\",\n            label: \"Save a copy\",\n            description: \"Create another local sample revision.\",\n            icon: <Copy aria-hidden=\"true\" />,\n            disabled: archived,\n            onSelect: () => {\n              setRevision((current) => current + 1);\n              setStatus(\"A sample copy was added locally.\");\n            },\n          },\n          {\n            id: \"ready\",\n            textValue: \"Mark ready\",\n            label: \"Mark ready\",\n            description: \"Update only the preview status.\",\n            icon: <FileCheck2 aria-hidden=\"true\" />,\n            disabled: archived,\n            onSelect: () => setStatus(\"Revision marked ready in this preview.\"),\n          },\n          {\n            id: \"archive\",\n            textValue: archived ? \"Restore draft\" : \"Archive draft\",\n            label: archived ? \"Restore draft\" : \"Archive draft\",\n            description: archived\n              ? \"Return the sample to active work.\"\n              : \"Move the sample out of active work.\",\n            icon: <Archive aria-hidden=\"true\" />,\n            destructive: !archived,\n            onSelect: () => {\n              setArchived((current) => !current);\n              setStatus(\n                archived\n                  ? \"The fictional draft was restored in this preview.\"\n                  : \"The fictional draft was archived in this preview.\",\n              );\n            },\n          },\n        ]}\n      />\n\n      <p className=\"split-demo-status\" role=\"status\" aria-live=\"polite\">\n        {status}\n      </p>\n      <p className=\"split-demo-note\">\n        Sample data. Changes stay in this preview.\n      </p>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <SplitButtonDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/split-button.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [],
  "nativeForm": {
    "participates": false,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "No form submit is present in the existing demo.",
    "resetBehavior": "No reset control is present in the existing demo.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Verify focus returns to the invoking control after dismissal.",
    "errorAnnouncement": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
