{
  "component": {
    "id": "settings-panel",
    "name": "Settings panel",
    "tier": "pro",
    "exampleId": "settings-panel",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/settings-panel-demo.tsx",
    "exportName": "SettingsPanelDemo",
    "sha256": "57286cc1ee66c981bd884d780a8d89a9f28102503ff18446be53e503d99a9b32",
    "helperImports": [],
    "directComponentImports": [
      "settings-panel"
    ],
    "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/settings-panel",
    "registryUrl": "https://tidalui.com/r/pro/settings-panel.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/settings-panel",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/settings-panel",
      "registryUrl": "https://tidalui.com/r/pro/settings-panel.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/settings-panel.tsx",
    "exports": [
      "TidalSettingsGroup",
      "TidalSettingsPanel"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/settings-panel.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "settings-panel"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/settings-panel.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/settings-panel.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/settings-panel-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useLayoutEffect, useRef, useState } from \"react\";\n\nimport { TidalSettingsPanel, type TidalSettingsGroup } from \"./components/ui/settings-panel\";\n\nimport \"./components/ui/settings-panel.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .settings-panel-demo,\\n.tidal-scope .settings-panel-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .settings-panel-demo {\\n  width: 100%;\\n  min-width: 0;\\n  padding: clamp(14px, 3.2vw, 38px);\\n  color: var(--t-ink);\\n  background:\\n    linear-gradient(var(--t-border) 1px, transparent 1px),\\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\\n    var(--t-subtle);\\n  background-size: 24px 24px;\\n  border-radius: 22px;\\n  container: settings-demo / inline-size;\\n}\\n\\n.tidal-scope .settings-panel-demo-layout {\\n  display: grid;\\n  width: 100%;\\n  max-width: 1040px;\\n  min-width: 0;\\n  gap: 16px;\\n  margin: 0 auto;\\n}\\n\\n.tidal-scope .settings-panel-demo-page {\\n  min-width: 0;\\n  padding: 18px;\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  box-shadow: 0 20px 45px -40px #00000070;\\n}\\n\\n.tidal-scope .settings-panel-demo-page > header,\\n.tidal-scope .settings-panel-demo-page > footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: flex-end;\\n  justify-content: space-between;\\n  gap: 16px;\\n}\\n\\n.tidal-scope .settings-panel-demo-page > header > div {\\n  min-width: 0;\\n}\\n\\n.tidal-scope .settings-panel-demo-page > header span,\\n.tidal-scope .settings-panel-demo-page > footer span {\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 650;\\n  letter-spacing: 0.08em;\\n  line-height: 1.45;\\n  text-transform: uppercase;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .settings-panel-demo-page h3 {\\n  margin: 5px 0 0;\\n  font-size: 22px;\\n  font-weight: 560;\\n  letter-spacing: -0.035em;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .settings-panel-demo-page > header > span {\\n  text-align: end;\\n}\\n\\n.tidal-scope .settings-panel-demo-page-grid {\\n  display: grid;\\n  grid-template-columns: minmax(120px, 0.45fr) minmax(0, 1fr);\\n  gap: 10px;\\n  min-width: 0;\\n  margin: 17px 0;\\n}\\n\\n.tidal-scope .settings-panel-demo-page ul,\\n.tidal-scope .settings-panel-demo-page-content {\\n  min-width: 0;\\n  padding: 12px;\\n  background: var(--t-subtle);\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n}\\n\\n.tidal-scope .settings-panel-demo-page ul {\\n  display: flex;\\n  flex-direction: column;\\n  margin: 0;\\n  list-style: none;\\n}\\n\\n.tidal-scope .settings-panel-demo-page ul > li {\\n  display: flex;\\n  min-height: 36px;\\n  align-items: center;\\n  padding-inline: 10px;\\n  color: var(--t-muted);\\n  border-inline-start: 2px solid transparent;\\n  font-size: 11px;\\n  line-height: 1.4;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .settings-panel-demo-page[data-density=\\\"compact\\\"] ul > li {\\n  min-height: 28px;\\n}\\n\\n.tidal-scope .settings-panel-demo-page ul > li[data-active=\\\"true\\\"] {\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border-inline-start-color: var(--t-ink);\\n}\\n\\n.tidal-scope .settings-panel-demo-page-content {\\n  display: flex;\\n  min-height: 124px;\\n  flex-direction: column;\\n  justify-content: center;\\n  gap: 7px;\\n}\\n\\n.tidal-scope .settings-panel-demo-page-content strong {\\n  font-size: 14px;\\n  font-weight: 620;\\n  line-height: 1.4;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .settings-panel-demo-page-content span {\\n  max-width: 54ch;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.6;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .settings-panel-demo-page > footer {\\n  align-items: center;\\n  padding-top: 15px;\\n  border-top: 1px solid var(--t-border);\\n}\\n\\n.tidal-scope .settings-panel-demo-page > footer strong {\\n  font-size: 11px;\\n  font-weight: 650;\\n}\\n\\n.tidal-scope .settings-panel-demo-boundary {\\n  margin: 0;\\n  padding: 0 4px;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.6;\\n  text-align: center;\\n  overflow-wrap: anywhere;\\n}\\n\\n@container settings-demo (max-width: 480px) {\\n  .tidal-scope .settings-panel-demo {\\n    padding: 10px;\\n    background-size: 18px 18px;\\n    border-radius: 18px;\\n  }\\n\\n  .tidal-scope .settings-panel-demo-page {\\n    padding: 15px;\\n  }\\n\\n  .tidal-scope .settings-panel-demo-page > header {\\n    align-items: flex-start;\\n    flex-direction: column;\\n    gap: 7px;\\n  }\\n\\n  .tidal-scope .settings-panel-demo-page > header > span {\\n    text-align: start;\\n  }\\n\\n  .tidal-scope .settings-panel-demo-page-grid {\\n    grid-template-columns: minmax(0, 1fr);\\n  }\\n}\";\n\ntype Density = \"comfortable\" | \"compact\";\n\ntype StartView = \"overview\" | \"activity\";\n\ninterface SamplePreferences {\n  density: Density;\n  startView: StartView;\n  weeklyDigest: boolean;\n}\n\nconst INITIAL_PREFERENCES: SamplePreferences = {\n  density: \"comfortable\",\n  startView: \"overview\",\n  weeklyDigest: false,\n};\n\nconst DENSITY_LABELS: Record<Density, string> = {\n  comfortable: \"Comfortable\",\n  compact: \"Compact\",\n};\n\nconst VIEW_LABELS: Record<StartView, string> = {\n  overview: \"Overview\",\n  activity: \"Activity\",\n};\n\nfunction samePreferences(first: SamplePreferences, second: SamplePreferences) {\n  return (\n    first.density === second.density &&\n    first.startView === second.startView &&\n    first.weeklyDigest === second.weeklyDigest\n  );\n}\n\nexport function SettingsPanelDemo() {\n  const pageTitleId = useId();\n  const pageTitleRef = useRef<HTMLHeadingElement>(null);\n  const focusPageAfterApply = useRef(false);\n  const [draft, setDraft] = useState<SamplePreferences>(INITIAL_PREFERENCES);\n  const [applied, setApplied] =\n    useState<SamplePreferences>(INITIAL_PREFERENCES);\n  const [message, setMessage] = useState(\n    \"The local page sample uses the default preferences.\",\n  );\n  const dirty = !samePreferences(draft, applied);\n\n  useLayoutEffect(() => {\n    if (!focusPageAfterApply.current) return;\n    focusPageAfterApply.current = false;\n    pageTitleRef.current?.focus({ preventScroll: true });\n  }, [applied]);\n\n  const groups: readonly TidalSettingsGroup[] = [\n    {\n      id: \"workspace\",\n      title: \"Workspace view\",\n      description: \"Choose how this sample page is arranged.\",\n      fields: [\n        {\n          id: \"density\",\n          kind: \"select\",\n          name: \"density\",\n          label: \"Navigation density\",\n          description: \"Changes the spacing in the local page sample.\",\n          value: draft.density,\n          options: [\n            { value: \"comfortable\", label: \"Comfortable\" },\n            { value: \"compact\", label: \"Compact\" },\n          ],\n          onValueChange: (value) => {\n            setDraft((current) => ({\n              ...current,\n              density: value as Density,\n            }));\n            setMessage(\n              \"Navigation density changed locally. Apply to preview it.\",\n            );\n          },\n        },\n        {\n          id: \"start-view\",\n          kind: \"radio\",\n          name: \"startView\",\n          label: \"Start page\",\n          description: \"Select the view shown in the sample page.\",\n          value: draft.startView,\n          required: true,\n          options: [\n            {\n              id: \"overview\",\n              value: \"overview\",\n              label: \"Overview\",\n              description: \"Summary and open work\",\n            },\n            {\n              id: \"activity\",\n              value: \"activity\",\n              label: \"Activity\",\n              description: \"Recent sample changes\",\n            },\n          ],\n          onValueChange: (value) => {\n            setDraft((current) => ({\n              ...current,\n              startView: value as StartView,\n            }));\n            setMessage(\"Start page changed locally. Apply to preview it.\");\n          },\n        },\n      ],\n    },\n    {\n      id: \"updates\",\n      title: \"Updates\",\n      description: \"Control one sample communication preference.\",\n      fields: [\n        {\n          id: \"weekly-digest\",\n          kind: \"toggle\",\n          name: \"weeklyDigest\",\n          label: \"Weekly digest\",\n          description:\n            \"Shows whether a fictional digest is included in this preview.\",\n          checked: draft.weeklyDigest,\n          onCheckedChange: (checked) => {\n            setDraft((current) => ({\n              ...current,\n              weeklyDigest: checked,\n            }));\n            setMessage(\n              \"Digest preference changed locally. Apply to preview it.\",\n            );\n          },\n        },\n      ],\n    },\n  ];\n\n  function applyPreferences(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault();\n    focusPageAfterApply.current = true;\n    setApplied(draft);\n    setMessage(\n      `Local page updated: ${DENSITY_LABELS[draft.density]} spacing, ${VIEW_LABELS[draft.startView]} start page, weekly digest ${draft.weeklyDigest ? \"shown\" : \"hidden\"}. Nothing was saved.`,\n    );\n  }\n\n  function resetPreferences() {\n    setDraft(INITIAL_PREFERENCES);\n    setApplied(INITIAL_PREFERENCES);\n    setMessage(\n      \"Local preferences reset. No account, workspace, or saved setting changed.\",\n    );\n  }\n\n  return (\n    <section\n      className=\"settings-panel-demo\"\n      aria-label=\"Settings panel preview\"\n    >\n      <div className=\"settings-panel-demo-layout\">\n        <TidalSettingsPanel\n          title=\"Page preferences\"\n          description=\"Adjust this local sample, then apply the draft to the page preview below.\"\n          groups={groups}\n          onSubmit={applyPreferences}\n          onReset={resetPreferences}\n          applyButtonProps={{\n            name: \"intent\",\n            value: \"apply-local-sample\",\n            disabled: !dirty,\n          }}\n          summaryProps={{\n            role: \"status\",\n            \"aria-live\": \"polite\",\n            \"aria-atomic\": true,\n          }}\n          summary={\n            <p>\n              {dirty ? \"Unapplied local changes. \" : \"\"}\n              {message}\n            </p>\n          }\n        />\n\n        <section\n          className=\"settings-panel-demo-page\"\n          data-density={applied.density}\n          aria-labelledby={pageTitleId}\n        >\n          <header>\n            <div>\n              <span>LOCAL PAGE SAMPLE</span>\n              <h3 id={pageTitleId} ref={pageTitleRef} tabIndex={-1}>\n                {VIEW_LABELS[applied.startView]}\n              </h3>\n            </div>\n            <span>{DENSITY_LABELS[applied.density]} spacing</span>\n          </header>\n          <div className=\"settings-panel-demo-page-grid\">\n            <ul aria-label=\"Sections shown in the local page sample\">\n              <li data-active={applied.startView === \"overview\" || undefined}>\n                Overview\n              </li>\n              <li data-active={applied.startView === \"activity\" || undefined}>\n                Activity\n              </li>\n              <li>Projects</li>\n            </ul>\n            <div className=\"settings-panel-demo-page-content\">\n              <strong>\n                {applied.startView === \"overview\"\n                  ? \"Three sample priorities\"\n                  : \"Five sample updates\"}\n              </strong>\n              <span>\n                Preview content changes only after the native Apply button\n                submits locally.\n              </span>\n            </div>\n          </div>\n          <footer>\n            <span>Weekly digest</span>\n            <strong>{applied.weeklyDigest ? \"Shown\" : \"Hidden\"}</strong>\n          </footer>\n        </section>\n\n        <p className=\"settings-panel-demo-boundary\">\n          This demo changes only React state in the rendered preview. It makes\n          no request, creates no account, and writes no stored preference.\n        </p>\n      </div>\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      <SettingsPanelDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/settings-panel.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [
    {
      "name": "onReset",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onSubmit",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "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": "Preserve browser focus order and visible focus.",
    "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": []
}
