{
  "component": {
    "id": "subscription-cancel",
    "name": "Cancellation flow",
    "tier": "pro",
    "exampleId": "subscription-cancel",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/subscription-cancel-demo.tsx",
    "exportName": "SubscriptionCancelDemo",
    "sha256": "836034f57216a2249334c697a3e17b065d9ad5550b4ae07226bccad14efe1b59",
    "helperImports": [],
    "directComponentImports": [
      "subscription-cancel"
    ],
    "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/subscription-cancel",
    "registryUrl": "https://tidalui.com/r/pro/subscription-cancel.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/subscription-cancel",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/subscription-cancel",
      "registryUrl": "https://tidalui.com/r/pro/subscription-cancel.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/subscription-cancel.tsx",
    "exports": [
      "TidalCancellationStep",
      "TidalCancellationValue",
      "TidalSubscriptionCancel"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/subscription-cancel.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "subscription-cancel"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/subscription-cancel.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/subscription-cancel.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/subscription-cancel-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalSubscriptionCancel, type TidalCancellationStep, type TidalCancellationValue } from \"./components/ui/subscription-cancel\";\n\nimport \"./components/ui/subscription-cancel.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .subscription-cancel-demo {\\n  display: grid;\\n  gap: 12px;\\n  inline-size: min(100%, 760px);\\n  min-inline-size: 0;\\n  margin-inline: auto;\\n}\\n\\n.tidal-scope .subscription-cancel-demo-footer {\\n  display: flex;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 10px;\\n  min-inline-size: 0;\\n  padding-inline: 5px;\\n}\\n\\n.tidal-scope .subscription-cancel-demo-footer p,\\n.tidal-scope .subscription-cancel-demo-note {\\n  min-inline-size: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.45;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .subscription-cancel-demo-footer button {\\n  flex: 0 0 auto;\\n  min-inline-size: 44px;\\n  min-block-size: 44px;\\n  border: 0;\\n  padding: 8px 10px;\\n  background: transparent;\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 11px;\\n  font-weight: 760;\\n  cursor: pointer;\\n}\\n\\n.tidal-scope .subscription-cancel-demo-footer button:focus-visible {\\n  outline: 3px solid var(--t-accent);\\n  outline-offset: 2px;\\n}\\n\\n.tidal-scope .subscription-cancel-demo-note {\\n  border-block-start: 1px solid var(--t-border);\\n  padding: 12px 5px 0;\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .subscription-cancel-demo * {\\n    animation: none !important;\\n    transition-duration: 0s !important;\\n  }\\n}\";\n\nconst REASONS = [\n  {\n    id: \"usage\",\n    label: \"We are not using it enough\",\n    description: \"The sample workspace is quieter than expected.\",\n  },\n  {\n    id: \"temporary\",\n    label: \"We need a temporary break\",\n    description: \"The team may return after the current project.\",\n  },\n  {\n    id: \"other\",\n    label: \"Another reason\",\n    description: \"Add optional context below.\",\n  },\n] as const;\n\nconst CHOICES = [\n  {\n    id: \"keep\",\n    label: \"Keep the current plan\",\n    description: \"Return to the sample workspace with no prepared change.\",\n    consequence: \"Nothing changes in this preview.\",\n    retainedAccessApplies: false,\n  },\n  {\n    id: \"pause\",\n    label: \"Prepare a pause\",\n    description: \"Record a local pause choice for review.\",\n    consequence: \"A pause choice is prepared locally. No schedule is created.\",\n  },\n  {\n    id: \"cancel\",\n    label: \"Prepare cancellation\",\n    description: \"Keep access through the supplied date, then stop renewal.\",\n    consequence:\n      \"The sample workspace remains available through November 15, 2026. No cancellation is sent.\",\n  },\n] as const;\n\nconst INITIAL: TidalCancellationValue = {\n  step: \"reason\",\n  reasonId: null,\n  note: \"\",\n  choiceId: null,\n  confirmed: false,\n};\n\nconst NEXT: Record<TidalCancellationStep, TidalCancellationStep> = {\n  reason: \"choice\",\n  choice: \"confirm\",\n  confirm: \"complete\",\n  complete: \"complete\",\n};\n\nexport function SubscriptionCancelDemo() {\n  const [value, setValue] = useState<TidalCancellationValue>(INITIAL);\n  const [message, setMessage] = useState(\"Choose a reason to begin.\");\n\n  return (\n    <div className=\"subscription-cancel-demo\">\n      <TidalSubscriptionCancel\n        title=\"Review your workspace plan\"\n        description=\"Choose what should happen next and review the exact access date before confirming.\"\n        subscriptionLabel=\"Sample workspace · Pro\"\n        retainedAccessDate=\"2026-11-15\"\n        retainedAccessDisplay=\"November 15, 2026\"\n        reasons={REASONS}\n        choices={CHOICES}\n        value={value}\n        onReasonChange={(reasonId) =>\n          setValue((current) => ({ ...current, reasonId }))\n        }\n        onNoteChange={(note) => setValue((current) => ({ ...current, note }))}\n        onChoiceChange={(choiceId) =>\n          setValue((current) => ({\n            ...current,\n            choiceId,\n            confirmed: false,\n          }))\n        }\n        onConfirmedChange={(confirmed) =>\n          setValue((current) => ({ ...current, confirmed }))\n        }\n        onStepChange={(step) => {\n          setValue((current) => ({ ...current, step }));\n          setMessage(\n            step === \"reason\"\n              ? \"Review the reason.\"\n              : step === \"choice\"\n                ? \"Choose a local outcome.\"\n                : \"Review the supplied consequence and access date.\",\n          );\n        }}\n        onConfirm={(event) => {\n          event.preventDefault();\n          setValue((current) => ({ ...current, step: NEXT[current.step] }));\n          setMessage(\"Choice prepared locally. No subscription was changed.\");\n        }}\n        completion=\"The selected outcome was prepared for review. No subscription was changed.\"\n      />\n      <div className=\"subscription-cancel-demo-footer\">\n        <p role=\"status\" aria-live=\"polite\">\n          {message}\n        </p>\n        <button\n          type=\"button\"\n          onClick={() => {\n            setValue(INITIAL);\n            setMessage(\"Sample flow reset.\");\n          }}\n        >\n          Reset\n        </button>\n      </div>\n      <p className=\"subscription-cancel-demo-note\">\n        Sample data. Choices stay in this preview and do not affect billing.\n      </p>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <SubscriptionCancelDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/subscription-cancel.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "INITIAL",
      "setter": "setValue",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChoiceChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "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": "onConfirm",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onConfirmedChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onNoteChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onReasonChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onStepChange",
      "nativeType": "component 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": "Consumer-provided label remains required where the component API requires one.",
    "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": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "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": []
}
