{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "accordion",
  "title": "Accordion",
  "description": "Stacked sections that open from numbered headings, each with a glyph that turns.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/accordion.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Accordion as SdkAccordion, AccordionHeader, AccordionItem, AccordionPanel, AccordionTrigger } from \"@ui-sdk/react/accordion\"\nimport \"@/registry/cyber/ui/cyber/accordion.css\"\n\ntype AccordionSection = {\n  value: string\n  label: string\n  /** A short readout at the end of the row, like \"3 loaded\". It's read as part of the row's name. */\n  meta?: string\n  content: React.ReactNode\n  disabled?: boolean\n}\n\n// Stacked sections, each behind a row: its number, its name, and a plus\n// that turns into a minus as the section opens. The open row stays lit and\n// its number reads in the signal color.\n//\n// - `items`: the sections, in order. `value` identifies one in `value`,\n//   `defaultValue` and `onValueChange`, which are arrays of open values.\n// - `level`: the heading level of the rows, 3 by default.\n// - Everything else goes to the SDK's Accordion: `multiple`, `collapsible`,\n//   `disabled`, `keepMounted`, `hiddenUntilFound`, `controller`.\n//\n// A section's height follows the SDK's measured --accordion-panel-height,\n// so it opens and closes without the content below jumping.\nfunction Accordion({\n  items,\n  level = 3,\n  ...props\n}: Omit<React.ComponentProps<typeof SdkAccordion>, \"children\"> & {\n  items: AccordionSection[]\n  level?: 2 | 3 | 4 | 5 | 6\n}) {\n  const Heading = `h${level}` as \"h3\"\n  return (\n    <SdkAccordion data-kit=\"accordion\" {...props}>\n      {items.map((item, index) => (\n        <AccordionItem key={item.value} value={item.value} disabled={item.disabled} data-kit=\"accordion-item\">\n          <AccordionHeader data-kit=\"accordion-header\" render={<Heading />}>\n            <AccordionTrigger data-kit=\"accordion-trigger\" data-frame=\"br\" data-press-flash=\"\">\n              <span data-kit=\"accordion-index\" aria-hidden>\n                {String(index + 1).padStart(2, \"0\")}\n              </span>\n              <span data-kit=\"accordion-text\">\n                <span data-kit=\"accordion-label\">{item.label}</span>\n                {item.meta && <span data-kit=\"accordion-meta\">{item.meta}</span>}\n              </span>\n              <span data-kit=\"accordion-glyph\" aria-hidden />\n            </AccordionTrigger>\n          </AccordionHeader>\n          <AccordionPanel data-kit=\"accordion-panel\">\n            <div data-kit=\"accordion-content\">{item.content}</div>\n          </AccordionPanel>\n        </AccordionItem>\n      ))}\n    </SdkAccordion>\n  )\n}\n\nexport { Accordion }\nexport type { AccordionSection }\n",
      "type": "registry:ui",
      "target": "@ui/accordion.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/accordion.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  [data-skin=\"cyber\"] [data-kit=\"accordion\"] {\n    display: grid;\n    gap: 4px;\n    width: 100%;\n    min-width: 0;\n    text-align: start;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"accordion-item\"] {\n    min-width: 0;\n  }\n\n  /* The heading only carries the level; the row inside it is the control. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-header\"] {\n    font: inherit;\n    letter-spacing: inherit;\n  }\n\n  /* A row, in the kit's state language:\n       idle     line 70%, panel fill\n       hover    line 100%, fill 10%\n       open     line 100%, fill 40%, bright ink, its number in the signal\n                color and its plus turned to a minus\n       down     flashes to 70% (data-press-flash)\n       disabled hatched, muted */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-trigger\"] {\n    --frame-cut: var(--cy-cut-sm);\n    --frame-line: var(--cy-line-ctl);\n    --frame-fill: var(--cy-panel-a);\n    /* Frame variables inherit, and a surface behind may have set one. */\n    --frame-image: none;\n    --index-w: 36px;\n\n    display: flex;\n    align-items: center;\n    gap: 10px;\n    width: 100%;\n    min-width: 0;\n    min-height: var(--cy-h);\n    padding: 0;\n    padding-inline-end: 12px;\n    font-size: var(--cy-text-md);\n    font-weight: 600;\n    line-height: 1.2;\n    letter-spacing: var(--cy-track);\n    text-transform: uppercase;\n    text-align: start;\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([data-disabled]) {\n        --frame-line: var(--cy-line-hot);\n        --frame-fill: var(--cy-fill-hover);\n      }\n    }\n\n    &:is([data-open], :active):not([data-disabled]) {\n      --frame-line: var(--cy-line-hot);\n      --frame-fill: var(--cy-fill-active);\n      color: var(--cy-ink-hi);\n    }\n\n    &[data-disabled] {\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 row's number, in a cell of its own at the leading end. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-index\"] {\n    flex: none;\n    align-self: stretch;\n    display: grid;\n    place-items: center;\n    width: var(--index-w);\n    border-inline-end: 1px solid var(--cy-line-deco);\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    font-weight: 500;\n    letter-spacing: 0;\n    color: var(--cy-ink-mute);\n    transition:\n      border-color var(--cy-t-fast) linear,\n      color var(--cy-t-fast) linear;\n\n    [data-open]:not([data-disabled]) > & {\n      border-inline-end-color: var(--cy-line-hot);\n      color: var(--cy-signal);\n    }\n  }\n\n  /* The name and its readout share a line while there's room, and the\n     readout drops under the name when there isn't. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-text\"] {\n    flex: 1 1 auto;\n    display: flex;\n    flex-wrap: wrap;\n    align-items: baseline;\n    justify-content: space-between;\n    gap: 2px 10px;\n    min-width: 0;\n    padding-block: 8px;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"accordion-label\"] {\n    min-width: 0;\n    overflow-wrap: break-word;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"accordion-meta\"] {\n    flex: none;\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    font-weight: 500;\n    letter-spacing: 0.04em;\n    color: var(--cy-signal);\n\n    [data-disabled] & {\n      color: var(--cy-ink-mute);\n    }\n  }\n\n  /* Plus and minus are the same two bars: the upright one lies down as the\n     section opens, in steps, like a display redrawing it. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-glyph\"] {\n    position: relative;\n    flex: none;\n    width: 12px;\n    height: 12px;\n\n    &::before,\n    &::after {\n      content: \"\";\n      position: absolute;\n      inset-block-start: 5px;\n      inset-inline-start: 0;\n      width: 12px;\n      height: 2px;\n      background: currentColor;\n    }\n\n    &::after {\n      rotate: 90deg;\n      transition: rotate var(--cy-t) var(--cy-ease-step);\n    }\n\n    [data-open] > &::after {\n      rotate: 0deg;\n    }\n  }\n\n  /* The section. Its height runs between zero and the content's measured\n     height, which the SDK writes to --accordion-panel-height; it's `auto`\n     once open, so the content can still reflow. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-panel\"] {\n    height: var(--accordion-panel-height);\n    overflow: hidden;\n    transition: height var(--cy-t-slow) var(--cy-ease-snap);\n\n    &:is([data-starting-style], [data-ending-style]) {\n      height: 0;\n    }\n    &[data-ending-style] {\n      transition-duration: var(--cy-t);\n    }\n  }\n\n  /* The content hangs off a rule that drops from the middle of the row's\n     number cell. */\n  [data-skin=\"cyber\"] [data-kit=\"accordion-content\"] {\n    display: grid;\n    gap: 8px;\n    margin-inline-start: 18px;\n    padding: 10px 12px 12px 17px;\n    border-inline-start: 1px solid var(--cy-line-ctl);\n    font-size: var(--cy-text-sm);\n    line-height: 1.45;\n    color: var(--cy-ink-hi);\n    text-wrap: pretty;\n    transition: opacity var(--cy-t) linear;\n\n    :is([data-starting-style], [data-ending-style]) > & {\n      opacity: 0;\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/accordion.css"
    }
  ],
  "type": "registry:ui"
}
