{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "plan-solid",
  "title": "Plan (Solid)",
  "description": "The steps an agent plans to take, with a progress bar and an Accept button.",
  "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/plan.tsx",
      "content": "import { planPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { Progress, ProgressIndicator, ProgressLabel, ProgressTrack } from \"@ui-sdk/solid/progress\";\nimport { For, omit } from \"solid-js\";\n\nconst parts = createParts(planPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  meta: \"span\",\n  content: \"div\",\n  progress: \"div\",\n  list: \"ol\",\n  item: \"li\",\n  \"item-icon\": \"span\",\n  \"item-title\": \"span\",\n  \"item-description\": \"span\",\n  accept: \"button\",\n  outcome: \"div\",\n  \"outcome-icon\": \"span\",\n});\n\nexport type PlanProps = ComponentProps<typeof parts.Root>;\n\n/**\n * The steps an agent plans to take, with how many are done and, while `onAccept` is set, an Accept button that\n * \"Accepted\" replaces. Any `children` replace the default parts.\n */\nexport function Plan(props: PlanProps) {\n  return <parts.Root {...omit(props, \"children\")}>{props.children ?? <DefaultParts />}</parts.Root>;\n}\n\nexport const PlanTrigger = parts.Trigger;\nexport const PlanIcon = parts.Icon;\nexport const PlanContent = parts.Content;\nexport const PlanItemIcon = parts.ItemIcon;\nexport const PlanOutcomeIcon = parts.OutcomeIcon;\n\nexport type PlanTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The `label`, else \"Plan\", unless you pass children. */\nexport function PlanTitle(props: PlanTitleProps) {\n  return <parts.Title {...omit(props, \"children\")}>{props.children ?? ((state) => state.title)}</parts.Title>;\n}\n\nexport type PlanMetaProps = ComponentProps<typeof parts.Meta>;\n\n/** How many items are done, as \"3 of 5\", unless you pass children. */\nexport function PlanMeta(props: PlanMetaProps) {\n  return (\n    <parts.Meta {...omit(props, \"children\")}>\n      {props.children ?? ((state) => `${state.done} of ${state.total}`)}\n    </parts.Meta>\n  );\n}\n\nexport type PlanProgressProps = ComponentProps<typeof parts.Progress>;\n\n/**\n * A UI SDK Progress of the items done, labeled \"3 of 5 steps\", unless you pass children. Not in the default parts,\n * whose meta says the same.\n */\nexport function PlanProgress(props: PlanProgressProps) {\n  return (\n    <parts.Progress {...omit(props, \"children\")}>\n      {props.children ??\n        ((state) => (\n          <Progress value={state.value}>\n            <ProgressLabel>{state.label}</ProgressLabel>\n            <ProgressTrack>\n              <ProgressIndicator />\n            </ProgressTrack>\n          </Progress>\n        ))}\n    </parts.Progress>\n  );\n}\n\nexport type PlanListProps = ComponentProps<typeof parts.List>;\n\n/** An item for each of the `items`, unless you pass children. */\nexport function PlanList(props: PlanListProps) {\n  return (\n    <parts.List {...omit(props, \"children\")}>\n      {props.children ??\n        ((state) => (\n          <For each={state.items} keyed={(item) => item.id}>\n            {(item) => <PlanItem value={item().id} />}\n          </For>\n        ))}\n    </parts.List>\n  );\n}\n\nexport type PlanItemProps = ComponentProps<typeof parts.Item>;\n\n/** The item whose `id` is `value`. Without children, it shows the item's mark, title and description. */\nexport function PlanItem(props: PlanItemProps) {\n  return <parts.Item {...omit(props, \"children\")}>{props.children ?? <DefaultItemParts />}</parts.Item>;\n}\n\nexport type PlanItemTitleProps = ComponentProps<typeof parts.ItemTitle>;\n\n/** The item's `title`, unless you pass children. */\nexport function PlanItemTitle(props: PlanItemTitleProps) {\n  return (\n    <parts.ItemTitle {...omit(props, \"children\")}>\n      {props.children ?? ((state) => state.title)}\n    </parts.ItemTitle>\n  );\n}\n\nexport type PlanItemDescriptionProps = ComponentProps<typeof parts.ItemDescription>;\n\n/** The item's `description`, unless you pass children. Rendered only while the item has one. */\nexport function PlanItemDescription(props: PlanItemDescriptionProps) {\n  return (\n    <parts.ItemDescription {...omit(props, \"children\")}>\n      {props.children ?? ((state) => state.description)}\n    </parts.ItemDescription>\n  );\n}\n\nexport type PlanAcceptProps = ComponentProps<typeof parts.Accept>;\n\n/**\n * Calls `onAccept`. Reads \"Accept plan\", with a running mark while pending, unless you pass children. Rendered only\n * while `onAccept` is set and the plan isn't accepted.\n */\nexport function PlanAccept(props: PlanAcceptProps) {\n  return (\n    <parts.Accept {...omit(props, \"children\")}>\n      {props.children ?? (\n        <>\n          <span data-kind-pending-mark=\"\" data-status-mark=\"\" data-status=\"running\" aria-hidden=\"true\" />\n          Accept plan\n        </>\n      )}\n    </parts.Accept>\n  );\n}\n\nexport type PlanOutcomeProps = ComponentProps<typeof parts.Outcome>;\n\n/** \"Accepted\" with a complete mark, in Accept's place once the plan is accepted, unless you pass children. */\nexport function PlanOutcome(props: PlanOutcomeProps) {\n  return (\n    <parts.Outcome {...omit(props, \"children\")}>\n      {props.children ?? (\n        <>\n          <PlanOutcomeIcon />\n          Accepted\n        </>\n      )}\n    </parts.Outcome>\n  );\n}\n\nfunction DefaultItemParts() {\n  return (\n    <>\n      <PlanItemIcon />\n      <PlanItemTitle />\n      <PlanItemDescription />\n    </>\n  );\n}\n\nfunction DefaultParts() {\n  return (\n    <>\n      <PlanTrigger>\n        <PlanIcon />\n        <PlanTitle />\n        <PlanMeta />\n      </PlanTrigger>\n      <PlanContent>\n        <PlanList />\n      </PlanContent>\n      <PlanAccept />\n      <PlanOutcome />\n    </>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@ui/solid/plan.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
