{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "guardrail-notice-solid",
  "title": "Guardrail Notice (Solid)",
  "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/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/guardrail-notice.tsx",
      "content": "import { guardrailNoticePrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps, JSX } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { omit } from \"solid-js\";\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?: JSX.Element;\n  /** Buttons that act on the notice, like \"Rephrase\". */\n  actions?: JSX.Element;\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(props: GuardrailNoticeProps) {\n  const rest = omit(props, \"children\", \"actions\");\n  return (\n    <parts.Root {...rest}>\n      <GuardrailNoticeIcon />\n      <GuardrailNoticeTitle />\n      <GuardrailNoticeReason />\n      <GuardrailNoticeDetailTrigger />\n      <GuardrailNoticeDetail />\n      {(() => {\n        const children = props.children;\n        return children === undefined ? null : (\n          <GuardrailNoticeDescription>{children}</GuardrailNoticeDescription>\n        );\n      })()}\n      <GuardrailNoticeActions>{props.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(props: GuardrailNoticeTitleProps) {\n  return <parts.Title {...props}>{props.children ?? ((state) => state.label)}</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(props: GuardrailNoticeReasonProps) {\n  return <parts.Reason {...props}>{props.children ?? ((state) => state.reason)}</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(props: GuardrailNoticeDetailTriggerProps) {\n  return <parts.DetailTrigger {...props}>{props.children ?? \"Why?\"}</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(props: GuardrailNoticeDetailProps) {\n  return <parts.Detail {...props}>{props.children ?? ((state) => <p>{state.detail}</p>)}</parts.Detail>;\n}\n",
      "type": "registry:ui",
      "target": "@ui/solid/guardrail-notice.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
