{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "confirmation-svelte",
  "title": "Confirmation (Svelte)",
  "description": "Approve or deny an agent's request, with an optional reason, then the recorded outcome.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/svelte@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/internal-textarea-svelte"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/confirmation/Confirmation.svelte",
      "content": "<!--\n  Asks a person to approve or deny a request, then shows what was decided. Only the choices the host supplies\n  (`onDeny`, `onAlwaysAllow`, `onApprove`) render, in that order. Any `children` replace the default parts.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import ConfirmationAlways from \"./ConfirmationAlways.svelte\";\n  import ConfirmationApprove from \"./ConfirmationApprove.svelte\";\n  import ConfirmationCancel from \"./ConfirmationCancel.svelte\";\n  import ConfirmationDeny from \"./ConfirmationDeny.svelte\";\n  import ConfirmationDetail from \"./ConfirmationDetail.svelte\";\n  import ConfirmationError from \"./ConfirmationError.svelte\";\n  import ConfirmationMeta from \"./ConfirmationMeta.svelte\";\n  import ConfirmationOutcome from \"./ConfirmationOutcome.svelte\";\n  import ConfirmationReason from \"./ConfirmationReason.svelte\";\n  import ConfirmationRisk from \"./ConfirmationRisk.svelte\";\n  import ConfirmationTitle from \"./ConfirmationTitle.svelte\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Root> = $props();\n</script>\n\n<parts.Root {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<ConfirmationTitle\n      /><ConfirmationMeta\n      /><ConfirmationRisk\n      /><ConfirmationReason\n      /><parts.Choices\n        ><ConfirmationCancel\n        /><ConfirmationDeny\n        /><ConfirmationAlways\n        /><ConfirmationApprove\n        /><ConfirmationError\n      /></parts.Choices\n      ><ConfirmationDetail\n      /><ConfirmationOutcome\n    />{/if}{/snippet}</parts.Root>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/Confirmation.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationAlways.svelte",
      "content": "<!--\n  Calls `onAlwaysAllow`, which approves and asks the host to remember. Reads the `alwaysLabel` and `alwaysTarget`\n  unless you pass children. Rendered only while `onAlwaysAllow` is set and `risk` isn't `\"danger\"`.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Always> = $props();\n</script>\n\n<parts.Always {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<!-- The mark shows only while the button's call is pending (controls.css). --><span data-kind-pending-mark=\"\" data-status-mark=\"\" data-status=\"running\" aria-hidden=\"true\"></span\n      ><WithCode text={state.label} />{/if}{/snippet}</parts.Always>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationAlways.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationApprove.svelte",
      "content": "<!--\n  Calls `onApprove`. Reads the `approveLabel` unless you pass children. Rendered only while `onApprove` is set.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Approve> = $props();\n</script>\n\n<parts.Approve {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<!-- The mark shows only while the button's call is pending (controls.css). --><span data-kind-pending-mark=\"\" data-status-mark=\"\" data-status=\"running\" aria-hidden=\"true\"></span\n      ><WithCode text={state.label} />{/if}{/snippet}</parts.Approve>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationApprove.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationCancel.svelte",
      "content": "<!-- Closes the reason box without deciding. Reads \"Cancel\" unless you pass children. Rendered while the box is open. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Cancel> = $props();\n</script>\n\n<parts.Cancel {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}Cancel{/if}{/snippet}</parts.Cancel>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationCancel.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationDeny.svelte",
      "content": "<!--\n  Calls `onDeny`. With `reason`, a person's first press opens the reason box instead. Reads the `denyLabel` unless\n  you pass children. Rendered only while `onDeny` is set.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Deny> = $props();\n</script>\n\n<parts.Deny {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<!-- The mark shows only while the button's call is pending (controls.css). --><span data-kind-pending-mark=\"\" data-status-mark=\"\" data-status=\"running\" aria-hidden=\"true\"></span\n      ><WithCode text={state.label} />{/if}{/snippet}</parts.Deny>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationDeny.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationDetail.svelte",
      "content": "<!-- The `alwaysDetail`, unless you pass children. Rendered under the choices while Always allow shows. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Detail> = $props();\n</script>\n\n<parts.Detail {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<WithCode\n        text={state.text}\n      />{/if}{/snippet}</parts.Detail>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationDetail.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationError.svelte",
      "content": "<!-- \"Decision not sent. Try again.\" while the host reports `submit-failed`, unless you pass children. -->\n<script lang=\"ts\">\n  import { WORDS } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Error> = $props();\n</script>\n\n<parts.Error {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}{WORDS.notSentRetry}{/if}{/snippet}</parts.Error>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationError.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationMeta.svelte",
      "content": "<!-- \"Sending decision\", else the deadline (\"Decide in 4 min\", then \"Expired\"), unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Meta> = $props();\n</script>\n\n<parts.Meta {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}{state.text}{/if}{/snippet}</parts.Meta>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationMeta.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationOutcome.svelte",
      "content": "<!-- Where the request stands, like \"Approved\", with the denial's reason, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Outcome> = $props();\n</script>\n\n<parts.Outcome {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<parts.OutcomeIcon\n      /><span data-confirmation-label=\"\"><WithCode text={state.label} /></span\n      >{\" \"}{#if state.reason}<span data-confirmation-reason=\"\">{state.reason}</span>{/if}{/if}{/snippet}</parts.Outcome>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationOutcome.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationReason.svelte",
      "content": "<!--\n  A box for the reason Deny sends, unless you pass children. Rendered with the `reason` option, once a person's Deny\n  opens it.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { KindTextarea } from \"../internal/textarea/index\";\n  import { parts } from \"./parts\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Reason> = $props();\n</script>\n\n<parts.Reason {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<KindTextarea\n        controller={state.controller}\n        readOnly={state.readOnly}\n        aria-label=\"Reason for denying\"\n        placeholder=\"Add a reason (optional)\"\n        rows={2}\n    />{/if}{/snippet}</parts.Reason>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationReason.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationRisk.svelte",
      "content": "<!-- The `riskText` after a warning mark, unless you pass children. Rendered only while `riskText` is set. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Risk> = $props();\n</script>\n\n<parts.Risk {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<parts.RiskIcon\n      /><span><WithCode text={state.text} /></span>{/if}{/snippet}</parts.Risk>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationRisk.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/ConfirmationTitle.svelte",
      "content": "<!-- The `label`, unless you pass children. Rendered only while `label` is set, and hidden inside a Tool. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import WithCode from \"./WithCode.svelte\";\n\n  let { children: content, ...props }: ComponentProps<typeof parts.Title> = $props();\n</script>\n\n<parts.Title {...props}\n  >{#snippet children(state)}{#if content}{@render content(state)}{:else}<WithCode text={state.label} />{/if}{/snippet}</parts.Title>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/ConfirmationTitle.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/WithCode.svelte",
      "content": "<!-- Text with its backticks as `code`. -->\n<script lang=\"ts\">\n  import { codeSpans } from \"@kind-ui/agent-ui/core\";\n\n  let { text }: { text: string } = $props();\n</script>\n\n{#each codeSpans(text) as piece, index}{#if index % 2}<code>{piece}</code>{:else}{piece}{/if}{/each}\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/WithCode.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/index.ts",
      "content": "import type { ComponentProps } from \"svelte\";\nimport Confirmation from \"./Confirmation.svelte\";\nimport ConfirmationAlways from \"./ConfirmationAlways.svelte\";\nimport ConfirmationApprove from \"./ConfirmationApprove.svelte\";\nimport ConfirmationCancel from \"./ConfirmationCancel.svelte\";\nimport ConfirmationDeny from \"./ConfirmationDeny.svelte\";\nimport ConfirmationDetail from \"./ConfirmationDetail.svelte\";\nimport ConfirmationError from \"./ConfirmationError.svelte\";\nimport ConfirmationMeta from \"./ConfirmationMeta.svelte\";\nimport ConfirmationOutcome from \"./ConfirmationOutcome.svelte\";\nimport ConfirmationReason from \"./ConfirmationReason.svelte\";\nimport ConfirmationRisk from \"./ConfirmationRisk.svelte\";\nimport ConfirmationTitle from \"./ConfirmationTitle.svelte\";\nimport { parts } from \"./parts\";\n\nexport {\n  Confirmation,\n  ConfirmationAlways,\n  ConfirmationApprove,\n  ConfirmationCancel,\n  ConfirmationDeny,\n  ConfirmationDetail,\n  ConfirmationError,\n  ConfirmationMeta,\n  ConfirmationOutcome,\n  ConfirmationReason,\n  ConfirmationRisk,\n  ConfirmationTitle,\n};\nexport const ConfirmationChoices = parts.Choices;\nexport const ConfirmationOutcomeIcon = parts.OutcomeIcon;\nexport const ConfirmationRiskIcon = parts.RiskIcon;\n\nexport type ConfirmationProps = ComponentProps<typeof Confirmation>;\nexport type ConfirmationTitleProps = ComponentProps<typeof ConfirmationTitle>;\nexport type ConfirmationMetaProps = ComponentProps<typeof ConfirmationMeta>;\nexport type ConfirmationRiskProps = ComponentProps<typeof ConfirmationRisk>;\nexport type ConfirmationReasonProps = ComponentProps<typeof ConfirmationReason>;\nexport type ConfirmationApproveProps = ComponentProps<typeof ConfirmationApprove>;\nexport type ConfirmationAlwaysProps = ComponentProps<typeof ConfirmationAlways>;\nexport type ConfirmationDenyProps = ComponentProps<typeof ConfirmationDeny>;\nexport type ConfirmationCancelProps = ComponentProps<typeof ConfirmationCancel>;\nexport type ConfirmationErrorProps = ComponentProps<typeof ConfirmationError>;\nexport type ConfirmationDetailProps = ComponentProps<typeof ConfirmationDetail>;\nexport type ConfirmationOutcomeProps = ComponentProps<typeof ConfirmationOutcome>;\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/confirmation/parts.ts",
      "content": "import { confirmationPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(confirmationPrimitive, {\n  root: \"div\",\n  title: \"div\",\n  meta: \"span\",\n  risk: \"div\",\n  \"risk-icon\": \"span\",\n  reason: \"div\",\n  choices: \"div\",\n  approve: \"button\",\n  always: \"button\",\n  deny: \"button\",\n  cancel: \"button\",\n  error: \"span\",\n  detail: \"div\",\n  outcome: \"div\",\n  \"outcome-icon\": \"span\",\n});\n",
      "type": "registry:ui",
      "target": "@ui/svelte/confirmation/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
