{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "test-results-svelte",
  "title": "Test Results (Svelte)",
  "description": "A test run's pass, fail and skip counts over a filterable tree of suites, each failure open to its stack trace.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/svelte@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/stack-trace-svelte",
    "@kind-ui/internal-tree-svelte"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResults.svelte",
      "content": "<!--\n  A test run as a step: its duration in the header, its counts beside it, which filter the tests when pressed, over a\n  tree of suites and tests in which a failed test opens to its message and stack trace. Any `children` replace the\n  default parts.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TestResultsEmpty from \"./TestResultsEmpty.svelte\";\n  import TestResultsFilter from \"./TestResultsFilter.svelte\";\n  import TestResultsMeta from \"./TestResultsMeta.svelte\";\n  import TestResultsTitle from \"./TestResultsTitle.svelte\";\n  import TestResultsTree from \"./TestResultsTree.svelte\";\n\n  let {\n    children,\n    open = $bindable(),\n    filter = $bindable(),\n    expanded = $bindable(),\n    ...props\n  }: ComponentProps<typeof parts.Root> = $props();\n</script>\n\n{#snippet defaultParts()}\n  <parts.Trigger>\n    <parts.Icon\n    /><TestResultsTitle\n    /><TestResultsMeta />\n  </parts.Trigger\n  ><TestResultsFilter\n  /><parts.Content>\n    <div data-test-results-panel=\"\">\n      <TestResultsTree\n      /><TestResultsEmpty />\n    </div>\n  </parts.Content>\n{/snippet}\n\n<parts.Root {...props} bind:open bind:filter bind:expanded children={children ?? defaultParts} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResults.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsCount.svelte",
      "content": "<!--\n  A toggle button for the tests with its `value` (`\"pass\"`, `\"fail\"` or `\"skip\"`): pressing it shows only those, and\n  pressing it again shows every test. \"3 passed\", unless you pass children.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Count> = $props();\n</script>\n\n{#snippet fallback({ text }: { text: string })}{text}{/snippet}\n\n<parts.Count {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsCount.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsEmpty.svelte",
      "content": "<!-- What shows when the filter lets no test through, like \"No failed tests\", unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Empty> = $props();\n</script>\n\n{#snippet fallback({ text }: { text: string })}{text}{/snippet}\n\n<parts.Empty {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsEmpty.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsFailure.svelte",
      "content": "<!-- A failed test's message and stack trace, as a Stack Trace, unless you pass children. Its `value` is the test's. -->\n<script lang=\"ts\">\n  import type { TestResultsFailureState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps } from \"svelte\";\n  import { StackTrace } from \"../stack-trace/index\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Failure> = $props();\n</script>\n\n{#snippet fallback(state: TestResultsFailureState)}\n  <StackTrace message={state.message || undefined} stack={state.stack} autoOpen=\"never\" motion={state.motion} />\n{/snippet}\n\n<parts.Failure {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsFailure.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsFilter.svelte",
      "content": "<!-- Holds the counts beside the trigger: a `TestResultsCount` for passed, failed and skipped, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TestResultsCount from \"./TestResultsCount.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Filter> = $props();\n</script>\n\n{#snippet fallback()}\n  <TestResultsCount value=\"pass\"\n  /><TestResultsCount value=\"fail\"\n  /><TestResultsCount value=\"skip\" />\n{/snippet}\n\n<parts.Filter {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsFilter.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsItem.svelte",
      "content": "<!--\n  A row's name and its status mark, unless you pass children. Its `value` is the suite's id or the test's\n  `suiteId/testId`. The duration is drawn after them.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Item> = $props();\n</script>\n\n{#snippet fallback({ name }: { name: string })}<span data-test-results-name=\"\">{name}</span>{\" \"}<parts.ItemStatus\n  />{/snippet}\n\n<parts.Item {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsItem.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsMeta.svelte",
      "content": "<!-- The run's duration, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Meta> = $props();\n</script>\n\n{#snippet fallback({ duration }: { duration: string })}{duration}{/snippet}\n\n<parts.Meta {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsMeta.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsRows.svelte",
      "content": "<!--\n  A Tree row for each item: a suite holds its tests, and a failed test its `TestResultsFailure`. Every row has an\n  indicator, a passed or skipped test's an empty spacer that lines its name up with the others. It's hidden from\n  agents, which hides UI SDK's Tree from them while the rows stay the Test Results'. Rows are keyed by value, and core\n  keeps an item while the host keeps its suite, so a streamed test updates only its suite's rows.\n-->\n<script lang=\"ts\">\n  import type { TreeItemData } from \"@ui-sdk/svelte/tree\";\n  import {\n    KindTreeGroup,\n    KindTreeItem,\n    KindTreeItemIndicator,\n    KindTreeItemLabel,\n  } from \"../internal/tree/index\";\n  import TestResultsFailure from \"./TestResultsFailure.svelte\";\n  import TestResultsItem from \"./TestResultsItem.svelte\";\n  import TestResultsRows from \"./TestResultsRows.svelte\";\n\n  let { items }: { items: TreeItemData[] } = $props();\n</script>\n\n{#each items as item (item.value)}\n  <KindTreeItem value={item.value}\n    ><KindTreeItemLabel\n      ><KindTreeItemIndicator data-agent-hidden=\"\"\n        >{#if item.children}<!-- Lucide \"chevron-right\", see THIRD_PARTY_NOTICES.md. --><svg\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            aria-hidden=\"true\"><path d=\"m9 18 6-6-6-6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" /></svg\n          >{/if}</KindTreeItemIndicator\n      ><TestResultsItem value={item.value} /></KindTreeItemLabel\n    >{#if item.children}<KindTreeGroup\n        >{#if item.children.length > 0}<TestResultsRows items={item.children} />{:else}<TestResultsFailure\n            value={item.value}\n          />{/if}</KindTreeGroup\n      >{/if}</KindTreeItem\n  >\n{/each}\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsRows.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsTitle.svelte",
      "content": "<!-- The `label`, else \"Tests\", unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Title> = $props();\n</script>\n\n{#snippet fallback({ title }: { title: string })}{title}{/snippet}\n\n<parts.Title {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsTitle.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/TestResultsTree.svelte",
      "content": "<!-- The suites and tests as a UI SDK Tree, with a row for each, unless you pass children. -->\n<script lang=\"ts\">\n  import type { TestResultsTreeState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps } from \"svelte\";\n  import { KindTree } from \"../internal/tree/index\";\n  import { parts } from \"./parts\";\n  import TestResultsRows from \"./TestResultsRows.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Tree> = $props();\n</script>\n\n{#snippet fallback(tree: TestResultsTreeState)}\n  <KindTree\n    controller={tree.controller}\n    items={tree.items}\n    defaultExpanded={tree.defaultExpanded}\n    aria-label={tree[\"aria-label\"]}\n    mode={tree.mode}\n    hiddenUntilFound={tree.hiddenUntilFound}\n  >\n    <TestResultsRows items={tree.items} />\n  </KindTree>\n{/snippet}\n\n<parts.Tree {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/TestResultsTree.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/index.ts",
      "content": "import type { ComponentProps } from \"svelte\";\nimport { parts } from \"./parts\";\nimport TestResults from \"./TestResults.svelte\";\nimport TestResultsCount from \"./TestResultsCount.svelte\";\nimport TestResultsEmpty from \"./TestResultsEmpty.svelte\";\nimport TestResultsFailure from \"./TestResultsFailure.svelte\";\nimport TestResultsFilter from \"./TestResultsFilter.svelte\";\nimport TestResultsItem from \"./TestResultsItem.svelte\";\nimport TestResultsMeta from \"./TestResultsMeta.svelte\";\nimport TestResultsRows from \"./TestResultsRows.svelte\";\nimport TestResultsTitle from \"./TestResultsTitle.svelte\";\nimport TestResultsTree from \"./TestResultsTree.svelte\";\n\nexport const TestResultsTrigger = parts.Trigger;\nexport const TestResultsIcon = parts.Icon;\nexport const TestResultsContent = parts.Content;\n/** A row's status mark, read as its status and duration, like \"failed, 12 ms\". */\nexport const TestResultsItemStatus = parts.ItemStatus;\n\nexport {\n  TestResults,\n  TestResultsCount,\n  TestResultsEmpty,\n  TestResultsFailure,\n  TestResultsFilter,\n  TestResultsItem,\n  TestResultsMeta,\n  TestResultsRows,\n  TestResultsTitle,\n  TestResultsTree,\n};\n\nexport type TestResultsProps = ComponentProps<typeof TestResults>;\nexport type TestResultsTitleProps = ComponentProps<typeof TestResultsTitle>;\nexport type TestResultsMetaProps = ComponentProps<typeof TestResultsMeta>;\nexport type TestResultsFilterProps = ComponentProps<typeof TestResultsFilter>;\nexport type TestResultsCountProps = ComponentProps<typeof TestResultsCount>;\nexport type TestResultsTreeProps = ComponentProps<typeof TestResultsTree>;\nexport type TestResultsRowsProps = ComponentProps<typeof TestResultsRows>;\nexport type TestResultsItemProps = ComponentProps<typeof TestResultsItem>;\nexport type TestResultsItemStatusProps = ComponentProps<typeof parts.ItemStatus>;\nexport type TestResultsFailureProps = ComponentProps<typeof TestResultsFailure>;\nexport type TestResultsEmptyProps = ComponentProps<typeof TestResultsEmpty>;\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/test-results/parts.ts",
      "content": "import { testResultsPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(testResultsPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  meta: \"span\",\n  content: \"div\",\n  filter: \"div\",\n  count: \"button\",\n  tree: \"div\",\n  item: \"span\",\n  \"item-status\": \"span\",\n  failure: \"div\",\n  empty: \"p\",\n});\n",
      "type": "registry:ui",
      "target": "@ui/svelte/test-results/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
