{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "plan-vue",
  "title": "Plan (Vue)",
  "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/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/plan.ts",
      "content": "import { planPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { Progress, ProgressIndicator, ProgressLabel, ProgressTrack } from \"@ui-sdk/vue/progress\";\nimport { type Component, defineComponent, h, type Slot, type VNodeChild } from \"vue\";\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\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\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\n/** The `label`, else \"Plan\", unless you fill the slot. */\nexport const PlanTitle = withDefault<{ title: string }>(parts.Title, \"PlanTitle\", ({ state }) => state.title);\n\n/** How many items are done, as \"3 of 5\", unless you fill the slot. */\nexport const PlanMeta = withDefault<{ done: number; total: number }>(\n  parts.Meta,\n  \"PlanMeta\",\n  ({ state }) => `${state.done} of ${state.total}`,\n);\n\n/**\n * A UI SDK Progress of the items done, labeled \"3 of 5 steps\", unless you fill the slot. Not in the default parts,\n * whose meta says the same.\n */\nexport const PlanProgress = withDefault<{ value: number; label: string }>(\n  parts.Progress,\n  \"PlanProgress\",\n  ({ state }) =>\n    h(Progress, { value: state.value }, () => [\n      h(ProgressLabel, null, () => state.label),\n      h(ProgressTrack, null, () => h(ProgressIndicator)),\n    ]),\n);\n\n/** The item's `title`, unless you fill the slot. */\nexport const PlanItemTitle = withDefault<{ title: string }>(\n  parts.ItemTitle,\n  \"PlanItemTitle\",\n  ({ state }) => state.title,\n);\n\n/** The item's `description`, unless you fill the slot. Rendered only while the item has one. */\nexport const PlanItemDescription = withDefault<{ description: string }>(\n  parts.ItemDescription,\n  \"PlanItemDescription\",\n  ({ state }) => state.description,\n);\n\n/** The item whose `id` is `value`. Without a default slot, it shows the item's mark, title and description. */\nexport const PlanItem = withDefault(parts.Item, \"PlanItem\", () => [\n  h(PlanItemIcon),\n  h(PlanItemTitle),\n  h(PlanItemDescription),\n]);\n\n/** An item for each of the `items`, unless you fill the slot. */\nexport const PlanList = withDefault<{ items: readonly { id: string }[] }>(\n  parts.List,\n  \"PlanList\",\n  ({ state }) => state.items.map((item) => h(PlanItem, { key: item.id, value: item.id })),\n);\n\n/**\n * Calls `onAccept`. Reads \"Accept plan\", with a running mark while pending, unless you fill the slot. Rendered only\n * while `onAccept` is set and the plan isn't accepted.\n */\nexport const PlanAccept = withDefault(parts.Accept, \"PlanAccept\", () => [\n  h(\"span\", {\n    \"data-kind-pending-mark\": \"\",\n    \"data-status-mark\": \"\",\n    \"data-status\": \"running\",\n    \"aria-hidden\": \"true\",\n  }),\n  \"Accept plan\",\n]);\n\n/** \"Accepted\" with a complete mark, in Accept's place once the plan is accepted, unless you fill the slot. */\nexport const PlanOutcome = withDefault(parts.Outcome, \"PlanOutcome\", () => [h(PlanOutcomeIcon), \"Accepted\"]);\n\nconst defaultParts = () => [\n  h(PlanTrigger, null, () => [h(PlanIcon), h(PlanTitle), h(PlanMeta)]),\n  h(PlanContent, null, () => h(PlanList)),\n  h(PlanAccept),\n  h(PlanOutcome),\n];\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. A default slot replaces the default parts.\n */\nexport const Plan = withDefault(parts.Root, \"Plan\", defaultParts);\n",
      "type": "registry:ui",
      "target": "@ui/vue/plan.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
