{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Section Head component",
  "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 sidebar section heading with optional right actions. Set `expanded` and it becomes a disclosure button\n  (aria-expanded, the toggle event).\n-->\n<script lang=\"ts\" module>\n  import type { Snippet } from \"svelte\";\n  import { variants } from \"../utils\";\n\n  /** SectionHead: the classes of each value (shadcn/cva style). */\n  export const sectionHeadVariants = variants({\n    base: \"flex items-center justify-between pr-4 pl-4\",\n    variants: {\n      size: {\n        default: \"h-8 py-2 text-xs font-semibold\",\n        lg: \"h-12 py-2 text-sm font-bold\",\n      },\n    },\n    defaultVariants: { size: \"default\" },\n  });\n\n  export type SectionHeadProps = {\n    size?: \"default\" | \"lg\";\n    expanded?: boolean;\n    controls?: string;\n    class?: string;\n    children?: Snippet;\n    right?: Snippet;\n    ontoggle?: () => void;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Box from \"../compose/Box.svelte\";\n  import ButtonPlain from \"../compose/ButtonPlain.svelte\";\n  import Inline from \"../compose/Inline.svelte\";\n  import { cn } from \"../utils\";\n\n  let {\n    size = \"default\",\n    expanded,\n    controls,\n    class: className,\n    children,\n    right,\n    ontoggle,\n  }: SectionHeadProps = $props();\n  const cls = $derived(\n    cn(\n      sectionHeadVariants({ size: size }),\n      \"rounded text-foreground in-data-[nav=collapsed]:hidden\",\n      className,\n    )\n  );\n</script>\n\n{#if (expanded != null)}\n  <ButtonPlain\n    type=\"button\"\n    class={cn(cls, \"w-full text-left\")}\n    aria-expanded={expanded}\n    aria-controls={controls}\n    data-slot=\"section-head\"\n    data-expanded={expanded}\n    onclick={() => ontoggle?.()}\n  >\n    <Inline data-slot=\"section-head-title\">\n      {@render children?.()}\n    </Inline>\n    {#if right}\n      <Inline class=\"flex items-center gap-2\" data-slot=\"section-head-right\">\n        {@render right?.()}\n      </Inline>\n    {/if}\n  </ButtonPlain>\n{:else}\n  <Box class={cls} data-slot=\"section-head\">\n    <Inline data-slot=\"section-head-title\">\n      {@render children?.()}\n    </Inline>\n    {#if right}\n      <Inline class=\"flex items-center gap-2\" data-slot=\"section-head-right\">\n        {@render right?.()}\n      </Inline>\n    {/if}\n  </Box>\n{/if}\n",
      "path": "components/section-head.svelte",
      "target": "components/section-head.svelte"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "svelte",
      "component"
    ]
  },
  "name": "section-head",
  "registryDependencies": [
    "box",
    "button-plain",
    "inline",
    "utils"
  ],
  "runtime": "svelte",
  "title": "Section Head",
  "type": "registry:component"
}
