{
  "$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\">\nimport { variants } from \"../utils\";\n\n/** SectionHead: the classes of each value (shadcn/cva style). */\nexport 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\nexport type SectionHeadProps = {\n  size?: \"default\" | \"lg\";\n  expanded?: boolean;\n  controls?: string;\n  class?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport Box from \"../compose/Box.vue\";\nimport ButtonPlain from \"../compose/ButtonPlain.vue\";\nimport Inline from \"../compose/Inline.vue\";\nimport { cn } from \"../utils\";\n\nconst { size = \"default\", expanded, controls, class: className } = defineProps<SectionHeadProps>();\nconst emit = defineEmits<{ toggle: [] }>();\ndefineSlots<{ default?(): unknown, right?(): unknown }>();\nconst cls = computed(() =>\n  cn(\n    sectionHeadVariants({ size: size }),\n    \"rounded text-foreground in-data-[nav=collapsed]:hidden\",\n    className,\n  )\n);\n</script>\n\n<template>\n  <ButtonPlain v-if=\"(expanded != null)\"\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    @click=\"() => emit('toggle')\"\n  >\n    <Inline data-slot=\"section-head-title\">\n      <slot />\n    </Inline>\n    <Inline v-if=\"$slots.right\" class=\"flex items-center gap-2\" data-slot=\"section-head-right\">\n      <slot name=\"right\" />\n    </Inline>\n  </ButtonPlain>\n  <Box v-else :class=\"cls\" data-slot=\"section-head\">\n    <Inline data-slot=\"section-head-title\">\n      <slot />\n    </Inline>\n    <Inline v-if=\"$slots.right\" class=\"flex items-center gap-2\" data-slot=\"section-head-right\">\n      <slot name=\"right\" />\n    </Inline>\n  </Box>\n</template>\n",
      "path": "components/section-head.vue",
      "target": "components/section-head.vue"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "vue",
      "component"
    ]
  },
  "name": "section-head",
  "registryDependencies": [
    "box",
    "button-plain",
    "inline",
    "utils"
  ],
  "runtime": "vue",
  "title": "Section Head",
  "type": "registry:component"
}
