{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "menubar",
  "title": "Menubar",
  "description": "A bar of menus with one tab stop.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json",
    "https://www.cyberspec.dev/r/menu.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/menubar.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Menu as SdkMenu, MenuTrigger } from \"@ui-sdk/react/menu\"\nimport { Menubar as SdkMenubar } from \"@ui-sdk/react/menubar\"\nimport { MenuPopup, type MenuEntry } from \"@/registry/cyber/ui/menu\"\nimport \"@/registry/cyber/ui/cyber/menubar.css\"\n\ntype MenubarMenu = {\n  /** The trigger's text and its name. Keep it one word: typing its first letter finds it. */\n  label: string\n  /** The menu, as data (see MenuEntry in menu.tsx). */\n  items: MenuEntry[]\n  /** Stays focusable, so it can be found, but doesn't open. */\n  disabled?: boolean\n}\n\ntype MenuCallbacks = Pick<React.ComponentProps<typeof SdkMenu>, \"onAction\" | \"onCheckedChange\" | \"onValueChange\">\n\n// The menus of an application, on one bar. Tab lands on the bar once; Left\n// and Right move between menus, Down opens one, and once one is open,\n// pointing at another switches to it.\n//\n// - `label` names the bar.\n// - `menus` is each menu's label and its items.\n// - `onAction`, `onCheckedChange` and `onValueChange` report from every menu\n//   on the bar, the way they do on a single Menu.\n// - `code` is the micro-print at the far end. The lamp beside it lights, and\n//   its last word changes, while a menu is open.\nfunction Menubar({\n  label,\n  menus,\n  code = \"CS-07\",\n  onAction,\n  onCheckedChange,\n  onValueChange,\n  ...props\n}: Omit<React.ComponentProps<typeof SdkMenubar>, \"children\"> &\n  MenuCallbacks & {\n    label: string\n    menus: MenubarMenu[]\n    code?: string\n  }) {\n  return (\n    <SdkMenubar data-kit=\"menubar\" data-frame=\"spine br\" aria-label={label} {...props}>\n      {menus.map((menu) => (\n        <SdkMenu key={menu.label} onAction={onAction} onCheckedChange={onCheckedChange} onValueChange={onValueChange}>\n          <MenuTrigger data-kit=\"menubar-trigger\" data-frame=\"br\" data-press-flash=\"\" disabled={menu.disabled}>\n            {menu.label}\n          </MenuTrigger>\n          {/* The gap clears the bar's own edge, so the menu hangs under the bar rather than under the key. */}\n          <MenuPopup items={menu.items} sideOffset={9} />\n        </SdkMenu>\n      ))}\n      <span data-kit=\"menubar-status\" data-micro aria-hidden>\n        {code}\n      </span>\n    </SdkMenubar>\n  )\n}\n\nexport { Menubar }\nexport type { MenubarMenu }\n",
      "type": "registry:ui",
      "target": "@ui/menubar.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/menubar.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n/* A menubar is a spined bar holding one flat key per menu. The menus it\n   opens are the shared popup (popup.css) with a menu's rows (menu.css). */\n@layer cyber.ui {\n  /* The bar. It isn't a control itself, so its edge is the decorative line;\n     it comes up to a control's edge while one of its menus is open. */\n  [data-skin=\"cyber\"] [data-kit=\"menubar\"] {\n    --frame-cut: var(--cy-cut-sm);\n    --frame-line: var(--cy-line-deco);\n    --frame-fill: var(--cy-panel-a);\n    --frame-spine: 4px;\n\n    container: menubar / inline-size;\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 2px;\n    width: 100%;\n    min-width: 0;\n    padding: 3px;\n    transition: border-color var(--cy-t-fast) linear;\n\n    &[data-open] {\n      --frame-line: var(--cy-line-ctl);\n    }\n\n    /* Stacked, it's a column as wide as its longest key, and the print\n       goes. A box that measures itself for container queries can't also\n       take its width from what's in it, so the measuring comes off. */\n    &[data-orientation=\"vertical\"] {\n      container-type: normal;\n      flex-direction: column;\n      align-items: stretch;\n      width: fit-content;\n\n      & [data-kit=\"menubar-trigger\"] {\n        justify-content: flex-start;\n      }\n      & [data-kit=\"menubar-status\"] {\n        display: none;\n      }\n    }\n  }\n\n  /* A key on the bar, in the kit's state language with nothing drawn at\n     rest: hover brings the line and a 10% fill, open is the 40% fill. */\n  [data-skin=\"cyber\"] [data-kit=\"menubar-trigger\"] {\n    --frame-cut: var(--cy-cut-sm);\n    --frame-line: transparent;\n    --frame-fill: transparent;\n\n    flex: none;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    height: var(--cy-h);\n    padding-inline: 10px;\n    font-size: var(--cy-text-md);\n    font-weight: 600;\n    line-height: 1;\n    letter-spacing: var(--cy-track);\n    text-transform: uppercase;\n    white-space: nowrap;\n    color: var(--cy-ink);\n    cursor: pointer;\n    user-select: none;\n    transition:\n      background-color var(--cy-t-fast) linear,\n      border-color var(--cy-t-fast) linear,\n      color var(--cy-t-fast) linear;\n\n    @media (hover: hover) {\n      &:hover:not(:disabled, [aria-disabled=\"true\"], [data-open]) {\n        --frame-line: var(--cy-line-hot);\n        --frame-fill: var(--cy-fill-hover);\n      }\n    }\n\n    &[data-open] {\n      --frame-line: var(--cy-line-hot);\n      --frame-fill: var(--cy-fill-active);\n      color: var(--cy-ink-hi);\n    }\n\n    /* Unavailable. It keeps its place in the arrow-key order, so it shows\n       an edge and hatching rather than fading out. */\n    &:is(:disabled, [aria-disabled=\"true\"]) {\n      --frame-line: var(--cy-line-deco);\n      --frame-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--cy-line-deco) 5px 6px);\n      color: var(--cy-ink-mute);\n      cursor: not-allowed;\n    }\n  }\n\n  /* The far end of the bar: a lamp and a line of print. Closed, the lamp is\n     hollow and the print ends \"IDLE\"; with a menu open the lamp is lit and\n     it ends \"OPEN\". Decoration: the open key and its menu say the same. */\n  [data-skin=\"cyber\"] [data-kit=\"menubar-status\"] {\n    display: none;\n    align-items: center;\n    gap: 6px;\n    margin-inline-start: auto;\n    padding-inline: 10px 8px;\n\n    &::before {\n      content: \"\";\n      width: 5px;\n      height: 5px;\n      border: 1px solid var(--cy-line-ctl);\n      rotate: 45deg;\n      transition:\n        background-color var(--cy-t-fast) linear,\n        border-color var(--cy-t-fast) linear;\n    }\n\n    &::after {\n      content: \"// IDLE\";\n    }\n\n    [data-open] > & {\n      color: var(--cy-signal);\n      opacity: 1;\n\n      &::before {\n        border-color: var(--cy-signal);\n        background: var(--cy-signal);\n        box-shadow: 0 0 calc(6px * var(--cy-fx)) var(--cy-signal);\n      }\n      &::after {\n        content: \"// OPEN\";\n      }\n    }\n  }\n\n  /* The print only shows where the bar has room to spare for it. */\n  @container menubar (min-width: 440px) {\n    [data-skin=\"cyber\"] [data-kit=\"menubar-status\"] {\n      display: flex;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/menubar.css"
    }
  ],
  "type": "registry:ui"
}
