{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "title": "Badge",
  "description": "A small cut label in seven tones, with count and status variants.",
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/badge.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport \"@/registry/cyber/ui/cyber/badge.css\"\n\ntype Tone = \"accent\" | \"signal\" | \"flag\" | \"ok\" | \"rare\" | \"epic\" | \"mute\"\n\n// A small cut label: the tag on a list row, the count on a slot.\n//\n// - `tone`: \"accent\" is an outline; \"flag\" is the solid yellow of NEW and of\n//   counts; \"signal\" marks what an agent did; \"ok\", \"rare\" and \"epic\" are\n//   tinted outlines; \"mute\" recedes.\n// - `count` prints a number instead of children, in tabular figures, and\n//   stops at `max` (\"99+\"). `label` says what's being counted, for a screen\n//   reader: `<Badge count={3} label=\"unread\" />` reads \"3 unread\".\n// - `status` puts a small square lamp before the text, for a state such as\n//   Online. `live` lets that lamp breathe.\nfunction Badge({\n  tone = \"accent\",\n  count,\n  max = 99,\n  label,\n  status,\n  live,\n  children,\n  ...props\n}: React.ComponentProps<\"span\"> & {\n  tone?: Tone\n  count?: number\n  max?: number\n  label?: string\n  status?: boolean\n  live?: boolean\n}) {\n  const counted = count != null\n  return (\n    <span\n      data-kit=\"badge\"\n      data-frame=\"br\"\n      data-tone={tone}\n      data-variant={counted ? \"count\" : status ? \"status\" : undefined}\n      {...props}\n    >\n      {status && !counted && <span data-kit=\"badge-lamp\" data-live={live ? \"\" : undefined} aria-hidden />}\n      {counted ? (count > max ? `${max}+` : count) : children}\n      {label && <span data-sr-only> {label}</span>}\n    </span>\n  )\n}\n\nexport { Badge }\nexport type { Tone as BadgeTone }\n",
      "type": "registry:ui",
      "target": "@ui/badge.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/badge.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* A label, not a control: it has no hover and no press. Every tone but\n     \"flag\" is an outline in its color over a faint tint of it; \"flag\" is the\n     solid yellow, with dark ink, that marks the thing to look at. */\n  [data-skin=\"cyber\"] [data-kit=\"badge\"] {\n    --tone: var(--cy-ink);\n    --frame-cut: 5px;\n    --frame-image: none;\n    --frame-line: color-mix(in srgb, var(--tone) 60%, var(--cy-panel));\n    --frame-fill: color-mix(in srgb, var(--tone) 9%, var(--cy-panel));\n\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: 6px;\n    flex: none;\n    min-width: 20px;\n    height: 20px;\n    padding-inline: 7px 8px;\n    font-size: var(--cy-text-xs);\n    font-weight: 700;\n    line-height: 1;\n    letter-spacing: 0.08em;\n    text-transform: uppercase;\n    white-space: nowrap;\n    vertical-align: middle;\n    color: var(--tone);\n\n    &[data-tone=\"accent\"] {\n      --frame-line: var(--cy-line-ctl);\n      --frame-fill: transparent;\n    }\n    &[data-tone=\"signal\"] {\n      --tone: var(--cy-signal);\n    }\n    &[data-tone=\"ok\"] {\n      --tone: var(--cy-ok);\n    }\n    &[data-tone=\"rare\"] {\n      --tone: var(--cy-rare);\n    }\n    &[data-tone=\"epic\"] {\n      --tone: var(--cy-epic);\n    }\n    &[data-tone=\"mute\"] {\n      --tone: var(--cy-ink-mute);\n      --frame-line: var(--cy-line-deco);\n      --frame-fill: transparent;\n    }\n    &[data-tone=\"flag\"] {\n      --tone: var(--cy-flag);\n      --frame-line: var(--cy-flag);\n      --frame-fill: var(--cy-flag);\n      color: var(--cy-on-solid);\n    }\n\n    /* A count: numerals in the mono, so 8 and 88 and 99+ keep their step. */\n    &[data-variant=\"count\"] {\n      padding-inline: 5px 6px;\n      font-family: var(--cy-mono);\n      font-size: var(--cy-text-xs);\n      font-weight: 600;\n      letter-spacing: 0;\n      font-variant-numeric: tabular-nums;\n    }\n\n    /* A status reads as a line of text with a lamp, so it loses the tint. */\n    &[data-variant=\"status\"]:not([data-tone=\"flag\"]) {\n      --frame-fill: transparent;\n    }\n  }\n\n  /* The lamp is a square, as everything here is. Lit, it's solid; on a\n     muted badge it's hollow, so \"off\" is a shape as well as a dimmer color. */\n  [data-skin=\"cyber\"] [data-kit=\"badge-lamp\"] {\n    flex: none;\n    width: 6px;\n    height: 6px;\n    background: currentColor;\n\n    [data-tone=\"mute\"] > & {\n      background: none;\n      border: 1px solid currentColor;\n    }\n\n    &[data-live] {\n      animation: var(--cy-fx-pulse) 1.8s var(--cy-ease-snap) infinite;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/badge.css"
    }
  ],
  "type": "registry:ui"
}
