{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "step-group",
  "title": "Step Group",
  "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/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/step-group.tsx",
      "content": "\"use client\";\n\nimport { codeSpans, stepGroupPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport { type ComponentProps, Fragment, type ReactNode } from \"react\";\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\nexport type StepGroupProps = Omit<ComponentProps<typeof parts.Root>, \"children\"> & {\n  /** The steps, like a `StepList` of `Tool`s, `Terminal`s or `Subagent`s. */\n  children?: ReactNode;\n};\n\n/**\n * One line that names a turn's work and opens to the host's own steps. Its `children` are the steps; to arrange\n * the parts yourself, use `StepGroupRoot`.\n */\nexport function StepGroup({ children, ...props }: StepGroupProps) {\n  return (\n    <parts.Root {...props}>\n      {DEFAULT_TRIGGER}\n      <StepGroupContent>\n        <StepGroupChildren>{children}</StepGroupChildren>\n      </StepGroupContent>\n    </parts.Root>\n  );\n}\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// Text with its backticks as `code`.\nconst withCode = (text: string) =>\n  codeSpans(text).map((piece, index) =>\n    // biome-ignore lint/suspicious/noArrayIndexKey: the pieces never move.\n    index % 2 ? <code key={index}>{piece}</code> : <Fragment key={index}>{piece}</Fragment>,\n  );\n\nexport type StepGroupTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The work in words, with code as `code`, unless you pass children. */\nexport function StepGroupTitle({ children = ({ title }) => withCode(title), ...props }: StepGroupTitleProps) {\n  return <parts.Title {...props}>{children}</parts.Title>;\n}\n\nexport type StepGroupMetaProps = ComponentProps<typeof parts.Meta>;\n\n/** \"3 of 5\", \"1 waiting\", \"1 failed · 41 sec\" or the duration, unless you pass children. */\nexport function StepGroupMeta({ children = ({ meta }) => meta, ...props }: StepGroupMetaProps) {\n  return <parts.Meta {...props}>{children}</parts.Meta>;\n}\n\n// Shared, so an update doesn't render the default parts' wrappers again.\nconst DEFAULT_TRIGGER = (\n  <StepGroupTrigger>\n    <StepGroupIcon />\n    <StepGroupTitle />\n    <StepGroupMeta />\n  </StepGroupTrigger>\n);\n",
      "type": "registry:ui",
      "target": "@ui/step-group.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
