{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "panel",
  "title": "Panel",
  "description": "The kit's container: a frame with a spine or a title bar, a heading, micro-print and a body.",
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/panel.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport \"@/registry/cyber/ui/cyber/panel.css\"\n\ntype Tone = \"default\" | \"signal\" | \"flag\"\ntype Variant = \"spine\" | \"titled\"\n\n// The kit's container: a cut frame that holds one subject, with a line of\n// micro-print over it. It's a <section> named by its heading, so a screen\n// built from panels can be walked as landmarks.\n//\n// - `variant`: \"spine\" has a thick, hollow bar down its leading edge, which\n//   fills while focus is anywhere inside, so the panel being worked in is\n//   the lit one. \"titled\" puts the heading in a solid bar of its own, over\n//   the frame.\n// - `tone`: \"default\" is the accent, \"signal\" the cyan of readouts, \"flag\"\n//   the yellow of the one thing to look at.\n// - `code`: the micro-print over the frame. Decoration only.\n// - `actions`: trailing content beside the heading: a readout, a badge, a\n//   small key. In a titled panel it sits on the solid bar, in dark ink.\n// - `footer`: a row along the foot, under a rule: key hints, a count, keys.\n// - `level`: the heading's level, 3 by default. Use what fits the page.\nfunction Panel({\n  title,\n  code,\n  tone = \"default\",\n  variant = \"spine\",\n  level = 3,\n  actions,\n  footer,\n  children,\n  ...props\n}: Omit<React.ComponentProps<\"section\">, \"title\"> & {\n  title: string\n  code?: string\n  tone?: Tone\n  variant?: Variant\n  level?: 2 | 3 | 4 | 5 | 6\n  actions?: React.ReactNode\n  footer?: React.ReactNode\n}) {\n  const id = React.useId()\n  const Heading = `h${level}` as \"h3\"\n  const head = (\n    <>\n      <Heading id={id} data-kit=\"panel-title\">\n        {title}\n      </Heading>\n      {actions != null && <div data-kit=\"panel-actions\">{actions}</div>}\n    </>\n  )\n  return (\n    <section data-kit=\"panel\" data-variant={variant} data-tone={tone} aria-labelledby={id} {...props}>\n      {code && (\n        <span data-kit=\"panel-code\" data-micro aria-hidden>\n          {code}\n        </span>\n      )}\n      {variant === \"titled\" && (\n        <header data-kit=\"panel-bar\" data-frame=\"br\">\n          {head}\n        </header>\n      )}\n      <div data-kit=\"panel-surface\" data-frame={variant === \"spine\" ? \"spine br\" : \"br\"}>\n        {variant === \"spine\" && <header data-kit=\"panel-head\">{head}</header>}\n        <div data-kit=\"panel-body\">{children}</div>\n        {footer != null && <footer data-kit=\"panel-footer\">{footer}</footer>}\n      </div>\n    </section>\n  )\n}\n\nexport { Panel }\nexport type { Tone as PanelTone, Variant as PanelVariant }\n",
      "type": "registry:ui",
      "target": "@ui/panel.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/panel.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* The panel itself is only a column: the micro-print, a title bar when\n     it's \"titled\", and the frame. The frame is a child so the print can sit\n     outside its cut corners, and so a glow can go on the unclipped section.\n\n     One color per tone, as --tone; lines, rules and the spine are mixed\n     from it. */\n  [data-skin=\"cyber\"] [data-kit=\"panel\"] {\n    --tone: var(--cy-accent);\n    --tone-ink: var(--cy-ink);\n    --panel-line: color-mix(in srgb, var(--tone) 55%, var(--cy-panel));\n    --panel-rule: color-mix(in srgb, var(--tone) 24%, var(--cy-panel));\n    --panel-spine: 18px;\n    --panel-pad: 14px;\n\n    display: flex;\n    flex-direction: column;\n    gap: 4px;\n    width: 100%;\n    min-width: 0;\n    text-align: start;\n\n    &[data-tone=\"signal\"] {\n      --tone: var(--cy-signal);\n      --tone-ink: var(--cy-signal);\n    }\n    &[data-tone=\"flag\"] {\n      --tone: var(--cy-flag);\n      --tone-ink: var(--cy-flag);\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"panel-code\"] {\n    align-self: flex-start;\n    max-width: 100%;\n    overflow: hidden;\n    text-overflow: clip;\n    color: color-mix(in srgb, var(--tone) 70%, var(--cy-panel));\n  }\n\n  /* The frame. It stretches when the panel is given a height, and its body\n     takes what the head and the foot leave. */\n  [data-skin=\"cyber\"] [data-kit=\"panel-surface\"] {\n    --frame-cut: var(--cy-cut);\n    --frame-line: var(--panel-line);\n    --frame-fill: color-mix(in srgb, var(--tone) 5%, var(--cy-panel-a));\n    /* Frame variables inherit, and a surface behind may have set one. */\n    --frame-image: none;\n    --frame-spine: var(--panel-spine);\n\n    flex: 1 1 auto;\n    display: flex;\n    flex-direction: column;\n    min-width: 0;\n    min-height: 0;\n  }\n\n  /* The spine is the frame's own thick leading edge. Laid over it, a pixel\n     in from each side, is a darker band, which leaves the spine hollow: an\n     outer line, the band, an inner line. While focus is anywhere inside the\n     panel the band takes the tone at full strength, so the spine is solid\n     and the panel being worked in is the lit one. The band is in the\n     border, outside the padding box, hence the negative offset. */\n  [data-skin=\"cyber\"] [data-kit=\"panel\"][data-variant=\"spine\"] > [data-kit=\"panel-surface\"] {\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-block: 0;\n      inset-inline-start: calc(1px - var(--panel-spine));\n      width: calc(var(--panel-spine) - 2px);\n      background: color-mix(in srgb, var(--tone) 12%, var(--cy-panel));\n      pointer-events: none;\n      transition: background-color var(--cy-t) var(--cy-ease-snap);\n    }\n\n    &:focus-within::before {\n      background: var(--tone);\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"panel-head\"] {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 4px 12px;\n    min-height: 40px;\n    padding: 6px var(--panel-pad);\n    border-block-end: 1px solid var(--panel-rule);\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"panel-title\"] {\n    min-width: 0;\n    font-size: var(--cy-text-lg);\n    font-weight: 600;\n    line-height: 1.2;\n    letter-spacing: var(--cy-track);\n    text-transform: uppercase;\n    overflow-wrap: anywhere;\n    text-wrap: balance;\n    color: var(--tone-ink);\n  }\n\n  /* What trails the heading. Bare text there reads as a readout. */\n  [data-skin=\"cyber\"] [data-kit=\"panel-actions\"] {\n    display: flex;\n    align-items: center;\n    gap: var(--cy-gap);\n    margin-inline-start: auto;\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    letter-spacing: 0.06em;\n    text-transform: uppercase;\n    color: var(--cy-signal);\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"panel-body\"] {\n    flex: 1 1 auto;\n    display: grid;\n    align-content: start;\n    gap: 10px;\n    min-width: 0;\n    padding: 12px var(--panel-pad) 14px;\n    font-size: var(--cy-text-md);\n    line-height: 1.4;\n    color: var(--cy-ink-hi);\n\n    & p {\n      max-width: 62ch;\n      text-wrap: pretty;\n    }\n\n    /* A list in a dossier is set with dashes. */\n    & ul {\n      display: grid;\n      gap: 2px;\n      padding: 0;\n      list-style: none;\n    }\n    & ul > li {\n      position: relative;\n      padding-inline-start: 16px;\n\n      &::before {\n        content: \"\\2013\";\n        position: absolute;\n        inset-inline-start: 0;\n        color: var(--tone-ink);\n      }\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"panel-footer\"] {\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    justify-content: space-between;\n    gap: 6px 12px;\n    min-height: 38px;\n    padding: 5px var(--panel-pad) 7px;\n    border-block-start: 1px solid var(--panel-rule);\n    font-size: var(--cy-text-sm);\n    color: var(--cy-ink-mute);\n  }\n\n  /* The title bar of a \"titled\" panel: a solid strip in the tone, with its\n     own cut corner, a seam away from the frame. Everything on it is in the\n     dark ink a solid fill needs. */\n  [data-skin=\"cyber\"] [data-kit=\"panel-bar\"] {\n    --frame-cut: var(--cy-cut);\n    --frame-line: var(--tone);\n    --frame-fill: var(--tone);\n    --frame-image: none;\n    --frame-focus: var(--cy-on-solid);\n\n    display: flex;\n    flex-wrap: wrap;\n    align-items: center;\n    gap: 2px 10px;\n    min-height: 32px;\n    padding: 4px 16px 4px 10px;\n    color: var(--cy-on-solid);\n\n    /* Three ticks before the heading, like the start of a barcode. */\n    &::before {\n      content: \"\";\n      flex: none;\n      width: 10px;\n      height: 12px;\n      background: repeating-linear-gradient(to right, currentColor 0 2px, transparent 2px 4px);\n    }\n\n    & [data-kit=\"panel-title\"] {\n      font-size: var(--cy-text-md);\n      font-weight: 700;\n      color: inherit;\n    }\n\n    & [data-kit=\"panel-actions\"] {\n      font-weight: 600;\n      color: inherit;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/panel.css"
    }
  ],
  "type": "registry:ui"
}
