{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "guardrail-notice",
  "title": "Guardrail Notice",
  "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/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/guardrail-notice.tsx",
      "content": "\"use client\";\n\nimport { guardrailNoticePrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps, ReactNode } from \"react\";\n\nconst 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 type GuardrailNoticeProps = Omit<ComponentProps<typeof parts.Root>, \"children\"> & {\n  /** More text under the reason. */\n  children?: ReactNode;\n  /** Buttons that act on the notice, like \"Rephrase\". */\n  actions?: ReactNode;\n};\n\n/**\n * A notice that a guardrail blocked or filtered content: its mark and title, the `reason`, \"Why?\" with the\n * `detail` while there is one, any `children`, then `actions` and Dismiss while `onDismiss` is set. To arrange the parts yourself,\n * use `GuardrailNoticeRoot`.\n */\nexport function GuardrailNotice({ children, actions, ...props }: GuardrailNoticeProps) {\n  return (\n    <parts.Root {...props}>\n      <GuardrailNoticeIcon />\n      <GuardrailNoticeTitle />\n      <GuardrailNoticeReason />\n      <GuardrailNoticeDetailTrigger />\n      <GuardrailNoticeDetail />\n      {children === undefined ? null : <GuardrailNoticeDescription>{children}</GuardrailNoticeDescription>}\n      <GuardrailNoticeActions>{actions}</GuardrailNoticeActions>\n      <GuardrailNoticeDismiss />\n    </parts.Root>\n  );\n}\n\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;\n\nexport type GuardrailNoticeTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The `label`, else \"Response blocked\" or \"Response filtered\", unless you pass children. */\nexport function GuardrailNoticeTitle({\n  children = ({ label }) => label,\n  ...props\n}: GuardrailNoticeTitleProps) {\n  return <parts.Title {...props}>{children}</parts.Title>;\n}\n\nexport type GuardrailNoticeReasonProps = ComponentProps<typeof parts.Reason>;\n\n/** The `reason`, unless you pass children. Rendered only with a `reason`. */\nexport function GuardrailNoticeReason({\n  children = ({ reason }) => reason,\n  ...props\n}: GuardrailNoticeReasonProps) {\n  return <parts.Reason {...props}>{children}</parts.Reason>;\n}\n\nexport type GuardrailNoticeDetailTriggerProps = ComponentProps<typeof parts.DetailTrigger>;\n\n/** Shows and hides the detail. Reads \"Why?\" unless you pass children. Rendered only with a `detail`. */\nexport function GuardrailNoticeDetailTrigger({\n  children = \"Why?\",\n  ...props\n}: GuardrailNoticeDetailTriggerProps) {\n  return <parts.DetailTrigger {...props}>{children}</parts.DetailTrigger>;\n}\n\nexport type GuardrailNoticeDetailProps = ComponentProps<typeof parts.Detail>;\n\n/** The `detail`, unless you pass children. Rendered only with a `detail`; find in page reaches it while hidden. */\nexport function GuardrailNoticeDetail({\n  children = ({ detail }) => <p>{detail}</p>,\n  ...props\n}: GuardrailNoticeDetailProps) {\n  return <parts.Detail {...props}>{children}</parts.Detail>;\n}\n",
      "type": "registry:ui",
      "target": "@ui/guardrail-notice.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
