{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "fieldset",
  "title": "Fieldset",
  "description": "A spined frame grouping several fields under a legend.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/fieldset.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { FieldDescription, FieldGroup, FieldLegend, FieldSet } from \"@ui-sdk/react/field\"\nimport \"@/registry/cyber/ui/cyber/fieldset.css\"\n\n// A group of fields under one name: a spined frame with the legend at its\n// head and a line of micro-print along its foot. The frame comes up a step\n// while focus is inside it, so in a long form the group being worked on is\n// the lit one.\n//\n// It's a native fieldset, so the legend names the group for a screen reader\n// and `disabled` switches off every control inside at once; the frame then\n// prints LOCKED beside the legend.\n//\n// - `legend` names the group; `description` says what it's for and is read\n//   as focus enters.\n// - `code` is the micro-print. Decoration only.\n// - `children` are the fields. Where there's room, fields sit two abreast;\n//   anything that isn't a field (a switch's row, a row of keys) takes the\n//   full width.\nfunction Fieldset({\n  legend,\n  description,\n  code = \"NODE 3F:A2 // REV 0.1\",\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof FieldSet>, \"children\"> & {\n  legend: string\n  description?: React.ReactNode\n  code?: string\n  children: React.ReactNode\n}) {\n  return (\n    <FieldSet data-kit=\"fieldset\" data-frame=\"spine br\" {...props}>\n      <FieldLegend data-kit=\"fieldset-legend\">\n        {legend}\n        <span data-kit=\"fieldset-lock\" aria-hidden>\n          LOCKED\n        </span>\n      </FieldLegend>\n      <div data-kit=\"fieldset-body\">\n        {description && <FieldDescription data-kit=\"hint\">{description}</FieldDescription>}\n        <FieldGroup data-kit=\"fieldset-group\">{children}</FieldGroup>\n        <span data-micro aria-hidden>\n          {code}\n        </span>\n      </div>\n    </FieldSet>\n  )\n}\n\nexport { Fieldset }\n",
      "type": "registry:ui",
      "target": "@ui/fieldset.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/fieldset.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* The group's frame. It's decoration around controls, not a control, so\n     its edge is the faint one; the spine is drawn hot over it. */\n  [data-skin=\"cyber\"] [data-kit=\"fieldset\"] {\n    --frame-cut: var(--cy-cut);\n    --frame-line: var(--cy-line-deco);\n    --frame-fill: color-mix(in srgb, var(--cy-accent) 5%, var(--cy-panel));\n    --frame-spine: 6px;\n\n    display: block;\n    width: 100%;\n    min-width: 0;\n    margin: 0;\n    padding: 12px 16px 12px 14px;\n    text-align: start;\n    transition: border-color var(--cy-t-fast) linear;\n\n    /* Being worked in: the frame comes up to a control's edge. */\n    &:focus-within {\n      --frame-line: var(--cy-line-ctl);\n    }\n\n    /* The spine: a solid bar over the frame's thick leading edge... */\n    &::before {\n      content: \"\";\n      position: absolute;\n      inset-block: -1px;\n      inset-inline-start: calc(var(--frame-spine) * -1);\n      width: var(--frame-spine);\n      background: var(--cy-accent);\n      transition: background-color var(--cy-t-fast) linear;\n    }\n\n    /* ...with one tick cut through it, level with the legend. */\n    &::after {\n      content: \"\";\n      position: absolute;\n      inset-block-start: 20px;\n      inset-inline-start: calc(var(--frame-spine) * -1);\n      width: var(--frame-spine);\n      height: 2px;\n      background: var(--cy-panel);\n    }\n\n    &[data-disabled] {\n      --frame-line: var(--cy-line-deco);\n      --frame-fill: var(--cy-panel);\n\n      &::before {\n        background: var(--cy-line-deco);\n      }\n    }\n  }\n\n  /* A native <legend> would sit in the frame's top edge and break it.\n     Floated, it's an ordinary row inside the frame, and still the element\n     that names the group. */\n  [data-skin=\"cyber\"] [data-kit=\"fieldset-legend\"] {\n    float: inline-start;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    gap: 12px;\n    width: 100%;\n    margin: 0;\n    padding: 0 0 8px;\n    border-block-end: 1px solid var(--cy-line-deco);\n    font-size: var(--cy-text-md);\n    font-weight: 700;\n    line-height: 1.2;\n    letter-spacing: var(--cy-track);\n    text-transform: uppercase;\n    color: var(--cy-ink);\n\n    &[data-disabled] {\n      color: var(--cy-ink-mute);\n    }\n  }\n\n  /* LOCKED: printed while the group is disabled, so that doesn't rest on\n     the hatching of what's inside. */\n  [data-skin=\"cyber\"] [data-kit=\"fieldset-lock\"] {\n    display: none;\n    flex: none;\n    padding: 3px 5px 2px;\n    border: 1px solid var(--cy-line-deco);\n    font-family: var(--cy-mono);\n    font-size: 9px;\n    font-weight: 500;\n    letter-spacing: 0.08em;\n    line-height: 1;\n    color: var(--cy-ink-mute);\n\n    [data-disabled] > & {\n      display: block;\n    }\n  }\n\n  /* Everything under the legend. It's a size container, so the fields can\n     pair up by the room the frame has, not the page. */\n  [data-skin=\"cyber\"] [data-kit=\"fieldset-body\"] {\n    clear: both;\n    display: grid;\n    gap: 12px;\n    padding-block-start: 10px;\n    container-type: inline-size;\n\n    & > [data-kit=\"hint\"] {\n      max-width: 52ch;\n      text-wrap: pretty;\n    }\n\n    & > [data-micro] {\n      min-width: 0;\n      margin-block-start: 2px;\n      overflow: hidden;\n    }\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"fieldset-group\"] {\n    display: grid;\n    grid-template-columns: minmax(0, 1fr);\n    gap: 12px;\n    min-width: 0;\n\n    @container (min-width: 420px) {\n      grid-template-columns: repeat(2, minmax(0, 1fr));\n      column-gap: 16px;\n      align-items: start;\n\n      /* A switch's row, a row of keys: not a field, so the full width. */\n      & > :not([data-kit=\"field\"]) {\n        grid-column: 1 / -1;\n      }\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/fieldset.css"
    }
  ],
  "type": "registry:ui"
}
