{
  "$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/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/story-tabs.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/button\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/icons\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// StoryTabsProps are the props of StoryTabs; the values are the JSON shapes of the TypeScript props.\ntype StoryTabsProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tLead any `json:\"lead\"`\n\tBadge any `json:\"badge\"`\n\tSteps any `json:\"steps\"`\n\tEmpty any `json:\"empty\"`\n\tActive any `json:\"active\"`\n\tLabels any `json:\"labels\"`\n\tLayout any `json:\"layout\"`\n\tTone any `json:\"tone\"`\n\tImage any `json:\"image\"`\n\tImageAlt any `json:\"imageAlt\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// A story in steps (years or slides). Axes: layout (years: a row of year tabs over the panel of the active year with its badge, step, title, text and tag; carousel: the heading beside a picture with previous and next arrows and one dot per step), tone. Choosing a step emits `select`.\ntempl StoryTabs(p StoryTabsProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vLead := uiutils.Def(p.Lead, \"\") }}\n\t{{ vBadge := uiutils.Def(p.Badge, \"\") }}\n\t{{ vSteps := p.Steps }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vActive := p.Active }}\n\t{{ vLabels := p.Labels }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"years\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vImage := p.Image }}\n\t{{ vImageAlt := p.ImageAlt }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\tif uiutils.Eq(uiutils.Len(vSteps), float64(0)) {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"milestone\", Title: vEmpty})\n\t\t}\n\t} else if uiutils.Eq(vLayout, \"years\") {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, LandmarkLabel: vLandmarkLabel}) {\n\t\t\t@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: \"grid grid-cols-2 gap-2 sm:grid-cols-4\", Attrs: uiutils.Attrs(\"data-slot\", \"story-tabs\")}}) {\n\t\t\t\tfor _, vS := range uiutils.L(vSteps) {\n\t\t\t\t\t@compose.Button(compose.ButtonProps{Variant: uiutils.S(uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vS, \"id\"), vActive)), \"default\", \"outline\")), Size: \"lg\", ButtonProps: button.ButtonProps{Type: \"button\", Class: \"h-auto flex-col items-start gap-0 py-2 text-start\", Attrs: uiutils.Attrs(\"data-active\", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vS, \"id\"), vActive)), \"true\", \"false\"))}}) {\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-sm font-semibold\"}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"date\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"text-xs\"}}) {\n\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vS, \"tag\")) }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor vI, vS := range uiutils.L(vSteps) {\n\t\t\t\tif uiutils.Eq(uiutils.Get(vS, \"id\"), vActive) {\n\t\t\t\t\t@StoryPanel(StoryPanelProps{S: vS, Index: float64(vI), Total: uiutils.Len(vSteps), Labels: vLabels})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{\"badge\": vBadge}, Tone: vTone, Layout: \"split\", Media: map[string]any{\"show\": true}, LandmarkLabel: vLandmarkLabel, Aside: storyTabsFill1(p, vTitle, vSteps, vActive, vLabels, vImage, vImageAlt)})\n\t}\n}\n\ntempl storyTabsFill1(p StoryTabsProps, vTitle any, vSteps any, vActive any, vLabels any, vImage any, vImageAlt any) {\n\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{}}) {\n\t\t@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: \"4/3\"})\n\t\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", Justify: \"between\", BoxProps: box.BoxProps{}}) {\n\t\t\t@compose.Button(compose.ButtonProps{Variant: \"outline\", Size: \"sm\", Layout: \"icon\", ButtonProps: button.ButtonProps{Type: \"button\", AriaLabel: uiutils.S(uiutils.Get(vLabels, \"previous\"))}}) {\n\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"chevron-left\", Size: 16})\n\t\t\t}\n\t\t\t@StoryDots(StoryDotsProps{Steps: vSteps, Active: vActive})\n\t\t\t@compose.Button(compose.ButtonProps{Variant: \"outline\", Size: \"sm\", Layout: \"icon\", ButtonProps: button.ButtonProps{Type: \"button\", AriaLabel: uiutils.S(uiutils.Get(vLabels, \"next\"))}}) {\n\t\t\t\t@icons.LucideIcon(icons.LucideIconProps{Name: \"chevron-right\", Size: 16})\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/story-tabs.templ",
      "target": "blocks/story-tabs.templ"
    }
  ],
  "meta": {
    "category": "content",
    "group": "story",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "story-tabs",
  "registryDependencies": [
    "box",
    "button",
    "empty-state",
    "group",
    "inline",
    "kit-box",
    "kit-button",
    "kit-text",
    "lucide-icon",
    "media-frame",
    "section-frame",
    "stack",
    "story-dots",
    "story-panel",
    "utils"
  ],
  "runtime": "templ",
  "title": "Story Tabs",
  "type": "registry:block"
}
