{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Year tabs over the panel of the chosen year, or the heading beside a picture with arrows and one dot per step. Choosing a step is an event.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->\n<!--\n  A story in steps (years or slides). Axes: layout (years: a row of year tabs over the panel of the active year\n  with its badge, step, title, text and tag; carousel: the heading beside a picture with previous and next\n  arrows and one dot per step), tone. Choosing a step emits `select`.\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import type { StoryLabels } from \"./story-tabs.types\";\n  import type { Milestone } from \"./milestone-timeline.types\";\n\n  export type StoryTabsProps = {\n    id: string;\n    title: string;\n    lead?: string;\n    badge?: string;\n    steps: Milestone[];\n    empty?: string;\n    active: string;\n    labels: StoryLabels;\n    layout?: \"years\" | \"carousel\";\n    tone?: \"default\" | \"muted\";\n    image?: string;\n    imageAlt?: string;\n    landmarkLabel?: string;\n    onselect?: (id: string) => void;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import Button from \"../compose/Button.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import Inline from \"../compose/Inline.svelte\";\n  import LucideIcon from \"../icons/LucideIcon.svelte\";\n  import Stack from \"../compose/Stack.svelte\";\n  import EmptyState from \"../components/empty-state.svelte\";\n  import MediaFrame from \"../components/media-frame.svelte\";\n  import SectionFrame from \"../components/section-frame.svelte\";\n  import StoryDots from \"../components/story-dots.svelte\";\n  import StoryPanel from \"../components/story-panel.svelte\";\n\n  let {\n    id,\n    title,\n    lead = \"\",\n    badge = \"\",\n    steps,\n    empty = \"\",\n    active,\n    labels,\n    layout = \"years\",\n    tone = \"default\",\n    image,\n    imageAlt,\n    landmarkLabel,\n    onselect,\n  }: StoryTabsProps = $props();\n</script>\n\n{#if ((steps?.length ?? 0) === 0)}\n  <SectionFrame id={id} title={title} lead={lead} heading={{ badge }} tone={tone} landmarkLabel={landmarkLabel}>\n    <EmptyState icon=\"milestone\" title={empty} />\n  </SectionFrame>\n{:else if ((layout as string) === \"years\")}\n  <SectionFrame id={id} title={title} lead={lead} heading={{ badge }} tone={tone} landmarkLabel={landmarkLabel}>\n    <Box class=\"grid grid-cols-2 gap-2 sm:grid-cols-4\" data-slot=\"story-tabs\">\n      {#each steps as s (s.id)}\n        <Button\n          variant={((s.id === active) ? \"default\" : \"outline\")}\n          size=\"lg\"\n          type=\"button\"\n          class=\"h-auto flex-col items-start gap-0 py-2 text-start\"\n          data-active={((s.id === active) ? \"true\" : \"false\")}\n          onclick={() => onselect?.(s.id)}\n        >\n          <Inline class=\"text-sm font-semibold\">\n            {s.date}\n          </Inline>\n          <Inline class=\"text-xs\">\n            {s.tag}\n          </Inline>\n        </Button>\n      {/each}\n    </Box>\n    {#each steps as s, i (s.id)}\n      {#if (s.id === active)}\n        <StoryPanel s={s} index={i} total={(steps?.length ?? 0)} labels={labels} />\n      {/if}\n    {/each}\n  </SectionFrame>\n{:else}\n  <SectionFrame\n    id={id}\n    title={title}\n    lead={lead}\n    heading={{ badge }}\n    tone={tone}\n    layout=\"split\"\n    media={{ show: true }}\n    landmarkLabel={landmarkLabel}\n  >\n    {#snippet aside()}\n      <Stack gap=\"4\" align=\"stretch\">\n        <MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio=\"4/3\" />\n        <Group gap=\"4\" align=\"center\" justify=\"between\">\n          <Button variant=\"outline\" size=\"sm\" layout=\"icon\" type=\"button\" aria-label={labels.previous}>\n            <LucideIcon name=\"chevron-left\" size={16} />\n          </Button>\n          <StoryDots steps={steps} active={active} />\n          <Button variant=\"outline\" size=\"sm\" layout=\"icon\" type=\"button\" aria-label={labels.next}>\n            <LucideIcon name=\"chevron-right\" size={16} />\n          </Button>\n        </Group>\n      </Stack>\n    {/snippet}\n  </SectionFrame>\n{/if}\n",
      "path": "blocks/story-tabs.svelte",
      "target": "blocks/story-tabs.svelte"
    },
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n\nexport type StoryLabels = {\n  step: string;\n  previous: string;\n  next: string;\n};\n",
      "path": "blocks/story-tabs.types.ts",
      "target": "blocks/story-tabs.types.ts"
    }
  ],
  "meta": {
    "category": "content",
    "group": "story",
    "kind": "block",
    "tags": [
      "svelte",
      "block"
    ]
  },
  "name": "story-tabs",
  "registryDependencies": [
    "box",
    "button",
    "empty-state",
    "group",
    "inline",
    "lucide-icon",
    "media-frame",
    "milestone-timeline",
    "section-frame",
    "stack",
    "story-dots",
    "story-panel",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Story Tabs",
  "type": "registry:block"
}
