{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "action-solid",
  "title": "Action (Solid)",
  "description": "An action run on selected text as a step, quoting the text above its streamed result.",
  "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",
    "@kind-ui/markdown-solid"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/action.tsx",
      "content": "import { actionPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { omit } from \"solid-js\";\nimport { Markdown } from \"./markdown\";\n\nconst parts = createParts(actionPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  content: \"div\",\n  quote: \"blockquote\",\n  result: \"div\",\n});\n\nexport type ActionProps = ComponentProps<typeof parts.Root>;\n\n/**\n * An action run on selected text, as a step: its `label`, the `quote` it ran on and its `result` as streamed markdown.\n * Any `children` replace the default trigger and content.\n */\nexport function Action(props: ActionProps) {\n  return (\n    <parts.Root {...omit(props, \"children\")}>\n      {props.children ?? (\n        <>\n          <ActionTrigger>\n            <ActionIcon />\n            <ActionTitle />\n          </ActionTrigger>\n          <ActionContent>\n            <ActionQuote />\n            <ActionResult />\n          </ActionContent>\n        </>\n      )}\n    </parts.Root>\n  );\n}\n\nexport const ActionTrigger = parts.Trigger;\nexport const ActionIcon = parts.Icon;\n\nexport type ActionTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The `label`, else \"Action\", unless you pass children. */\nexport function ActionTitle(props: ActionTitleProps) {\n  return <parts.Title {...omit(props, \"children\")}>{props.children ?? ((state) => state.title)}</parts.Title>;\n}\n\nexport const ActionContent = parts.Content;\n\nexport type ActionQuoteProps = ComponentProps<typeof parts.Quote>;\n\n/** The `quote`, unless you pass children. */\nexport function ActionQuote(props: ActionQuoteProps) {\n  return <parts.Quote {...omit(props, \"children\")}>{props.children ?? ((state) => state.quote)}</parts.Quote>;\n}\n\nexport type ActionResultProps = ComponentProps<typeof parts.Result>;\n\n/** The `result` as markdown, streaming while the action runs, unless you pass children. */\nexport function ActionResult(props: ActionResultProps) {\n  return (\n    <parts.Result {...omit(props, \"children\")}>\n      {props.children ?? ((state) => <Markdown source={state.result} streaming={state.streaming} />)}\n    </parts.Result>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@ui/solid/action.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
