{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "guardrail-notice-svelte",
  "title": "Guardrail Notice (Svelte)",
  "description": "Says a guardrail blocked or filtered content, with the policy reason and an expandable detail.",
  "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"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/GuardrailNotice.svelte",
      "content": "<!--\n  A notice that a guardrail blocked or filtered content: its mark and title, the `reason`, \"Why?\" with the `detail`\n  while there is one, any `children`, then `actions` and Dismiss while `onDismiss` is set. To arrange the parts\n  yourself, use `GuardrailNoticeRoot`.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps, Snippet } from \"svelte\";\n  import {\n    GuardrailNoticeActions,\n    GuardrailNoticeDescription,\n    GuardrailNoticeDetail,\n    GuardrailNoticeDetailTrigger,\n    GuardrailNoticeDismiss,\n    GuardrailNoticeIcon,\n    GuardrailNoticeReason,\n    GuardrailNoticeTitle,\n    parts,\n  } from \"./index\";\n\n  // `Omit` would drop the options: part props carry an index signature for attributes.\n  type RootProps = ComponentProps<typeof parts.Root>;\n\n  let {\n    children,\n    actions,\n    ...props\n  }: { [Key in keyof RootProps as Key extends \"children\" ? never : Key]: RootProps[Key] } & {\n    /** More text under the reason. */\n    children?: Snippet;\n    /** Buttons that act on the notice, like \"Rephrase\". */\n    actions?: Snippet;\n  } = $props();\n</script>\n\n<parts.Root {...props}>\n  <GuardrailNoticeIcon\n  /><GuardrailNoticeTitle\n  /><GuardrailNoticeReason\n  /><GuardrailNoticeDetailTrigger\n  /><GuardrailNoticeDetail\n  />{#if children}<GuardrailNoticeDescription>{@render children()}</GuardrailNoticeDescription>{/if}<GuardrailNoticeActions\n  >{@render actions?.()}</GuardrailNoticeActions\n  ><GuardrailNoticeDismiss />\n</parts.Root>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/GuardrailNotice.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/GuardrailNoticeDetail.svelte",
      "content": "<!-- The `detail`, unless you pass a `children` snippet. Rendered only with a `detail`; find in page reaches it while hidden. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./index\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Detail> = $props();\n</script>\n\n{#snippet detail({ detail }: { detail: string })}<p>{detail}</p>{/snippet}\n\n<parts.Detail {...props} children={children ?? detail} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/GuardrailNoticeDetail.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/GuardrailNoticeDetailTrigger.svelte",
      "content": "<!-- Shows and hides the detail. Reads \"Why?\" unless you pass a `children` snippet. Rendered only with a `detail`. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./index\";\n\n  let { children, ...props }: ComponentProps<typeof parts.DetailTrigger> = $props();\n</script>\n\n{#snippet why()}Why?{/snippet}\n\n<parts.DetailTrigger {...props} children={children ?? why} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/GuardrailNoticeDetailTrigger.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/GuardrailNoticeReason.svelte",
      "content": "<!-- The `reason`, unless you pass a `children` snippet. Rendered only with a `reason`. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./index\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Reason> = $props();\n</script>\n\n{#snippet reason({ reason }: { reason: string })}{reason}{/snippet}\n\n<parts.Reason {...props} children={children ?? reason} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/GuardrailNoticeReason.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/GuardrailNoticeTitle.svelte",
      "content": "<!-- The `label`, else \"Response blocked\" or \"Response filtered\", unless you pass a `children` snippet. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./index\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Title> = $props();\n</script>\n\n{#snippet label({ label }: { label: string })}{label}{/snippet}\n\n<parts.Title {...props} children={children ?? label} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/GuardrailNoticeTitle.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/guardrail-notice/index.ts",
      "content": "import { guardrailNoticePrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(guardrailNoticePrimitive, {\n  root: \"div\",\n  icon: \"span\",\n  title: \"p\",\n  reason: \"p\",\n  \"detail-trigger\": \"button\",\n  detail: \"div\",\n  description: \"div\",\n  actions: \"div\",\n  dismiss: \"button\",\n});\n\nexport { default as GuardrailNotice } from \"./GuardrailNotice.svelte\";\n/** The bare root, for arranging the parts yourself. */\nexport const GuardrailNoticeRoot = parts.Root;\nexport const GuardrailNoticeIcon = parts.Icon;\nexport const GuardrailNoticeDescription = parts.Description;\nexport const GuardrailNoticeActions = parts.Actions;\nexport const GuardrailNoticeDismiss = parts.Dismiss;\nexport { default as GuardrailNoticeDetail } from \"./GuardrailNoticeDetail.svelte\";\nexport { default as GuardrailNoticeDetailTrigger } from \"./GuardrailNoticeDetailTrigger.svelte\";\nexport { default as GuardrailNoticeReason } from \"./GuardrailNoticeReason.svelte\";\nexport { default as GuardrailNoticeTitle } from \"./GuardrailNoticeTitle.svelte\";\n",
      "type": "registry:ui",
      "target": "@ui/svelte/guardrail-notice/index.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
