{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "A top bar in four shapes: inline, split around the brand, with a search field, and transparent over a picture.",
  "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\nexport type NavLink = {\n  id: string;\n  name: string;\n  icon: string;\n  href?: string;\n};\n\nexport type NavBarActions = {\n  /** cta: show the call to action */\n  mode?: \"none\" | \"cta\";\n  /** text of the call to action */\n  cta?: string;\n  /** href of the call to action */\n  href?: string;\n  /** text of the login link; none: no login */\n  login?: string;\n  /** href of the login link; none: a button with no address */\n  loginHref?: string;\n  /** text of the theme button; none: no button */\n  themeLabel?: string;\n};\n\nexport type NavSearch = {\n  /** name and placeholder of the search field (layout search) */\n  label: string;\n  /** the keys that open the search, shown in the field */\n  shortcut: string;\n};\n",
      "path": "blocks/nav-bar.types.ts",
      "target": "blocks/nav-bar.types.ts"
    },
    {
      "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 top bar in four shapes. Axes: layout (inline: brand left, links, button right; split: the brand in the\n  middle with the links on both sides; search: a search field with its shortcut in the middle), over (none,\n  media: the bar sits over a picture, transparent), actions mode (none, cta), tone (default, inverse: on a dark\n  hero band). Turning solid on scroll is a port contract.\n-->\n<script lang=\"ts\">\nimport type { NavLink, NavBarActions, NavSearch } from \"./nav-bar.types\";\n\nexport type NavBarProps = {\n  label: string;\n  brand: string;\n  brandHref?: string;\n  links: NavLink[];\n  current?: string;\n  actions?: NavBarActions;\n  search: NavSearch;\n  tone?: \"default\" | \"inverse\";\n  layout?: \"inline\" | \"split\" | \"search\";\n  over?: \"none\" | \"media\";\n  skip?: string;\n  landmarkLabel?: string;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport Block from \"../compose/Block.vue\";\nimport Box from \"../compose/Box.vue\";\nimport Container from \"../compose/Container.vue\";\nimport Grid from \"../compose/Grid.vue\";\nimport Group from \"../compose/Group.vue\";\nimport LinkPlain from \"../compose/LinkPlain.vue\";\nimport MenuEntry from \"../components/menu-entry.vue\";\nimport NavActions from \"../components/nav-actions.vue\";\nimport NavBarMenu from \"../components/nav-bar-menu.vue\";\nimport NavBlock from \"../components/nav-block.vue\";\nimport NavLinks from \"../components/nav-links.vue\";\nimport OverMedia from \"../components/over-media.vue\";\nimport SearchPalette from \"../components/search-palette.vue\";\nimport { cn, tpl, uniqLabel } from \"../utils\";\n\nconst {\n  label,\n  brand,\n  brandHref,\n  links,\n  current = \"\",\n  actions,\n  search,\n  tone = \"default\",\n  layout = \"inline\",\n  over = \"none\",\n  skip,\n  landmarkLabel,\n} = defineProps<NavBarProps>();\nconst emit = defineEmits<{ theme: [] }>();\n</script>\n\n<template>\n  <Block\n    tag=\"header\"\n    :class=\"cn(\n      'relative',\n      (\n        (tone as string) === 'inverse' ? 'border-b border-transparent bg-foreground text-background [&_a]:text-background [&_button]:text-background'\n        : 'border-b border-border bg-background'\n      ),\n      (((over as string) === 'media') ? 'isolate overflow-hidden border-0 bg-transparent' : '')\n    )\"\n    :data-layout=\"layout\"\n    :data-tone=\"tone\"\n    :aria-label=\"landmarkLabel\"\n    data-slot=\"nav-bar\"\n  >\n    <OverMedia :on=\"((over as string) === 'media')\" :alt=\"brand\" />\n    <LinkPlain v-if=\"skip\"\n      href=\"#main-content\"\n      :class=\"'sr-only focus:not-sr-only focus:fixed focus:left-2 focus:top-2 focus:z-50 focus:rounded focus:bg-background ' +\n        'focus:px-4 focus:py-2 focus:text-sm focus:inset-ring focus:inset-ring-border'\"\n      data-slot=\"skip-link\"\n    >\n      {{ skip }}\n    </LinkPlain>\n    <Container class=\"mx-auto w-full max-w-6xl px-4\" data-slot=\"container\">\n      <Box :class=\"cn('flex flex-wrap items-center justify-between gap-4', 'py-4')\">\n        <NavBlock v-if=\"((layout as string) === 'split')\"\n          :label=\"(landmarkLabel ? uniqLabel(tpl('{0}, {1}', label, landmarkLabel)) : label)\"\n          class=\"w-full\"\n          testid=\"site-nav\"\n        >\n          <Grid cols=\"1-3\" class=\"w-full items-center gap-4\">\n            <Box class=\"md:justify-self-start\">\n              <NavLinks :links=\"links\" :current=\"current\" side=\"left\" />\n            </Box>\n            <Box class=\"text-center\">\n              <MenuEntry :href=\"brandHref\" class=\"text-lg font-medium\" testid=\"brand\">\n                {{ brand }}\n              </MenuEntry>\n            </Box>\n            <Group gap=\"4\" align=\"center\" justify=\"end\" class=\"flex-wrap md:justify-self-end\">\n              <Box>\n                <NavLinks :links=\"links\" :current=\"current\" side=\"right\" />\n              </Box>\n              <NavActions\n                :login=\"actions?.login\"\n                :loginHref=\"actions?.loginHref\"\n                :cta=\"actions?.cta\"\n                :ctaHref=\"actions?.href\"\n                :actions=\"actions?.mode\"\n                :tone=\"tone\"\n                :themeLabel=\"actions?.themeLabel\"\n                @theme=\"() => emit('theme')\"\n              />\n            </Group>\n          </Grid>\n        </NavBlock>\n        <template v-else>\n          <MenuEntry :href=\"brandHref\" class=\"text-lg font-medium\" testid=\"brand\">\n            {{ brand }}\n          </MenuEntry>\n          <SearchPalette v-if=\"((layout as string) === 'search')\" :label=\"search.label\" :shortcut=\"search.shortcut\" />\n          <NavBarMenu :label=\"label\" :links=\"links\" :current=\"current\" :landmarkLabel=\"landmarkLabel\" />\n          <NavActions\n            :login=\"actions?.login\"\n            :loginHref=\"actions?.loginHref\"\n            :cta=\"actions?.cta\"\n            :ctaHref=\"actions?.href\"\n            :actions=\"actions?.mode\"\n            :tone=\"tone\"\n            :themeLabel=\"actions?.themeLabel\"\n            @theme=\"() => emit('theme')\"\n          />\n        </template>\n      </Box>\n    </Container>\n  </Block>\n</template>\n",
      "path": "blocks/nav-bar.vue",
      "target": "blocks/nav-bar.vue"
    }
  ],
  "meta": {
    "category": "marketing",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "vue",
      "block"
    ]
  },
  "name": "nav-bar",
  "registryDependencies": [
    "block",
    "box",
    "container",
    "grid",
    "group",
    "link-plain",
    "menu-entry",
    "nav-actions",
    "nav-bar-menu",
    "nav-block",
    "nav-links",
    "over-media",
    "search-palette",
    "utils"
  ],
  "runtime": "vue",
  "title": "Nav Bar",
  "type": "registry:block"
}
