{
  "$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<!--\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\" module>\n  import type { Snippet } from \"svelte\";\n  import type { NavLink, NavBarActions, NavSearch } from \"./nav-bar.types\";\n\n  export 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    ontheme?: () => void;\n  };\n</script>\n\n<script lang=\"ts\">\n  import Block from \"../compose/Block.svelte\";\n  import Box from \"../compose/Box.svelte\";\n  import Container from \"../compose/Container.svelte\";\n  import Grid from \"../compose/Grid.svelte\";\n  import Group from \"../compose/Group.svelte\";\n  import LinkPlain from \"../compose/LinkPlain.svelte\";\n  import MenuEntry from \"../components/menu-entry.svelte\";\n  import NavActions from \"../components/nav-actions.svelte\";\n  import NavBarMenu from \"../components/nav-bar-menu.svelte\";\n  import NavBlock from \"../components/nav-block.svelte\";\n  import NavLinks from \"../components/nav-links.svelte\";\n  import OverMedia from \"../components/over-media.svelte\";\n  import SearchPalette from \"../components/search-palette.svelte\";\n  import { cn, tpl, uniqLabel } from \"../utils\";\n\n  let {\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    ontheme,\n  }: NavBarProps = $props();\n</script>\n\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  {#if skip}\n    <LinkPlain\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  {/if}\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      {#if ((layout as string) === \"split\")}\n        <NavBlock\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                ontheme={() => ontheme?.()}\n              />\n            </Group>\n          </Grid>\n        </NavBlock>\n      {:else}\n        <MenuEntry href={brandHref} class=\"text-lg font-medium\" testid=\"brand\">\n          {brand}\n        </MenuEntry>\n        {#if ((layout as string) === \"search\")}\n          <SearchPalette label={search.label} shortcut={search.shortcut} />\n        {/if}\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          ontheme={() => ontheme?.()}\n        />\n      {/if}\n    </Box>\n  </Container>\n</Block>\n",
      "path": "blocks/nav-bar.svelte",
      "target": "blocks/nav-bar.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 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"
    }
  ],
  "meta": {
    "category": "marketing",
    "group": "navigation",
    "kind": "block",
    "tags": [
      "svelte",
      "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": "svelte",
  "title": "Nav Bar",
  "type": "registry:block"
}
