{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "step-group-vue",
  "title": "Step Group (Vue)",
  "description": "One line that names a turn's work, with its status in words, over the host's own steps.",
  "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/step-group.ts",
      "content": "import { codeSpans, stepGroupPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { type Component, defineComponent, h, type Slot, type VNodeChild } from \"vue\";\n\nconst parts = createParts(stepGroupPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  meta: \"span\",\n  content: \"div\",\n  children: \"div\",\n});\n\n// A part whose default slot falls back to `fallback`, as React's default `children` do.\nconst withDefault = <State, Part extends Component = Component>(\n  part: Part,\n  name: string,\n  fallback: (scope: { state: State }) => VNodeChild,\n): Part =>\n  defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      return () => h(part as Component, attrs, { ...slots, default: slots.default ?? (fallback as Slot) });\n    },\n  }) as unknown as Part;\n\n// Text with its backticks as `code`.\nconst withCode = (text: string) =>\n  codeSpans(text).map((piece, index) => (index % 2 ? h(\"code\", piece) : piece));\n\n/** The bare root, for arranging the parts yourself. */\nexport const StepGroupRoot = parts.Root;\nexport const StepGroupTrigger = parts.Trigger;\nexport const StepGroupIcon = parts.Icon;\nexport const StepGroupContent = parts.Content;\nexport const StepGroupChildren = parts.Children;\n\n/** The work in words, with code as `code`, unless you fill the slot. */\nexport const StepGroupTitle = withDefault<{ title: string }>(parts.Title, \"StepGroupTitle\", ({ state }) =>\n  withCode(state.title),\n);\n\n/** \"3 of 5\", \"1 waiting\", \"1 failed · 41 sec\" or the duration, unless you fill the slot. */\nexport const StepGroupMeta = withDefault<{ meta: string }>(\n  parts.Meta,\n  \"StepGroupMeta\",\n  ({ state }) => state.meta,\n);\n\n/**\n * One line that names a turn's work and opens to the host's own steps. Its default slot holds the steps; to arrange\n * the parts yourself, use `StepGroupRoot`.\n */\nexport const StepGroup = defineComponent({\n  name: \"StepGroup\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Root, attrs, {\n        ...slots,\n        default: () => [\n          h(StepGroupTrigger, null, () => [h(StepGroupIcon), h(StepGroupTitle), h(StepGroupMeta)]),\n          h(StepGroupContent, null, () => h(StepGroupChildren, null, () => slots.default?.())),\n        ],\n      });\n  },\n});\n",
      "type": "registry:ui",
      "target": "@ui/vue/step-group.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
