{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "guardrail-notice-vue",
  "title": "Guardrail Notice (Vue)",
  "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/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/guardrail-notice.ts",
      "content": "import { type GuardrailNoticeState, guardrailNoticePrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { type Component, defineComponent, h, type Slot, type SlotsType, type VNode } from \"vue\";\n\n// The root's props and `#render` slot, with plain `default` and `#actions` slots for the notice's content.\ntype WithActions<C extends abstract new (...args: never) => { $slots: { render?: unknown } }> = new (\n  ...args: never\n) => Omit<InstanceType<C>, \"$slots\"> & {\n  $slots: { default?: () => VNode[]; actions?: () => VNode[]; render?: InstanceType<C>[\"$slots\"][\"render\"] };\n};\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\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\n// A part whose default slot falls back to content built from its state.\nfunction withDefault<C extends Component>(\n  part: C,\n  name: string,\n  fallback: (state: GuardrailNoticeState) => unknown,\n) {\n  return defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      const fill: Slot = ({ state }) => fallback(state) as VNode[];\n      return () => h(part, attrs, { ...slots, default: slots.default ?? fill });\n    },\n  }) as unknown as C;\n}\n\n/** The `label`, else \"Response blocked\" or \"Response filtered\", unless you fill the default slot. */\nexport const GuardrailNoticeTitle = withDefault(parts.Title, \"GuardrailNoticeTitle\", ({ label }) => label);\n/** The `reason`, unless you fill the default slot. Rendered only with a `reason`. */\nexport const GuardrailNoticeReason = withDefault(\n  parts.Reason,\n  \"GuardrailNoticeReason\",\n  ({ reason }) => reason,\n);\n/** Shows and hides the detail. Reads \"Why?\" unless you fill the default slot. Rendered only with a `detail`. */\nexport const GuardrailNoticeDetailTrigger = withDefault(\n  parts.DetailTrigger,\n  \"GuardrailNoticeDetailTrigger\",\n  () => \"Why?\",\n);\n/** The `detail`, unless you fill the default slot. Rendered only with a `detail`; find in page reaches it while hidden. */\nexport const GuardrailNoticeDetail = withDefault(parts.Detail, \"GuardrailNoticeDetail\", ({ detail }) =>\n  h(\"p\", null, detail),\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, the default slot, then the `#actions` slot and Dismiss while `on-dismiss` is set. To\n * arrange the parts yourself, use `GuardrailNoticeRoot`.\n */\nexport const GuardrailNotice = defineComponent({\n  name: \"GuardrailNotice\",\n  inheritAttrs: false,\n  slots: Object as SlotsType<{ default?: () => VNode[]; actions?: () => VNode[]; render?: Slot }>,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Root, attrs, {\n        render: slots.render,\n        default: () => [\n          h(GuardrailNoticeIcon),\n          h(GuardrailNoticeTitle),\n          h(GuardrailNoticeReason),\n          h(GuardrailNoticeDetailTrigger),\n          h(GuardrailNoticeDetail),\n          slots.default ? h(GuardrailNoticeDescription, null, () => slots.default?.()) : null,\n          h(GuardrailNoticeActions, null, () => slots.actions?.()),\n          h(GuardrailNoticeDismiss),\n        ],\n      });\n  },\n}) as unknown as WithActions<typeof parts.Root>;\n",
      "type": "registry:ui",
      "target": "@ui/vue/guardrail-notice.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
