{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "title": "Button",
  "description": "A cut-corner button with a raised tab, five tones, and a press flash. Enable the cipher prop to scramble the label and briefly tear the frame on hover.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/button.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Button as SdkButton } from \"@ui-sdk/react/button\"\nimport { playButtonCipher } from \"@/registry/cyber/lib/cipher\"\nimport \"@/registry/cyber/ui/cyber/button.css\"\n\ntype Tone = \"primary\" | \"secondary\" | \"ghost\" | \"signal\" | \"flag\"\ntype Size = \"sm\" | \"md\" | \"lg\"\n\n// A key on a display: a cut frame with a raised tab along its top edge.\n//\n// - `tone`: \"secondary\" is an outline; \"primary\" is lit; \"ghost\" has no edge\n//   until hovered; \"signal\" is the cyan of values and agents; \"flag\" is the\n//   solid yellow of the one choice that matters.\n// - `icon`: a button holding only an icon is square. Give it an aria-label.\n// - `cipher`: scramble the label and briefly shear the frame on pointer entry at full FX.\n//\n// Returning a Promise from onClick keeps it pending, with a bar running\n// along its foot, until the Promise settles.\nfunction Button({\n  tone = \"secondary\",\n  size = \"md\",\n  icon,\n  cipher = false,\n  onPointerEnter,\n  ...props\n}: React.ComponentProps<typeof SdkButton> & { tone?: Tone; size?: Size; icon?: boolean; cipher?: boolean }) {\n  return (\n    <SdkButton\n      data-kit=\"button\"\n      data-frame={tone === \"ghost\" ? \"br\" : \"notch br\"}\n      data-press-flash=\"\"\n      data-tone={tone}\n      data-size={size}\n      data-icon={icon ? \"\" : undefined}\n      data-cipher={cipher ? \"\" : undefined}\n      onPointerEnter={cipher ? event => {\n        onPointerEnter?.(event)\n        if (!event.defaultPrevented && event.pointerType !== \"touch\") playButtonCipher(event.currentTarget)\n      } : onPointerEnter}\n      {...props}\n    />\n  )\n}\n\nexport { Button }\nexport type { Size as ButtonSize, Tone as ButtonTone }\n",
      "type": "registry:ui",
      "target": "@ui/button.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/button.css",
      "content": "@layer ui-sdk, cyber.tokens, cyber.base, cyber.ui, cyber.blocks, cyber.fx, cyber.a11y;\n\n@layer cyber.ui {\n  /* The kit's state language, on its simplest control:\n       idle    line 70%, no fill\n       hover   line 100%, fill 10%\n       down    fill 40%, and a flash to 70% as it lands (data-press-flash)\n     Any element can borrow the look by carrying data-kit=\"button\", which is\n     how a dialog's trigger or a popover's close key is styled. */\n  [data-skin=\"cyber\"] [data-kit=\"button\"] {\n    --frame-cut: var(--cy-cut-sm);\n    --frame-line: var(--cy-line-ctl);\n    --frame-fill: var(--cy-panel-a);\n    --frame-notch-x: 22px;\n    --frame-notch: 4px;\n\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    gap: 8px;\n    min-width: 72px;\n    height: var(--cy-h);\n    padding-inline: 16px;\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    text-decoration: none;\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    & svg {\n      width: 16px;\n      height: 16px;\n    }\n\n    @media (hover: hover) {\n      &:hover:not(:disabled, [data-disabled]) {\n        --frame-line: var(--cy-line-hot);\n        --frame-fill: var(--cy-fill-hover);\n      }\n    }\n\n    &:is(:active, [data-open], [data-pressed]):not(:disabled, [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-size=\"sm\"] {\n      min-width: 56px;\n      height: var(--cy-h-sm);\n      padding-inline: 12px;\n      font-size: var(--cy-text-sm);\n    }\n\n    &[data-size=\"lg\"] {\n      min-width: 96px;\n      height: var(--cy-h-lg);\n      padding-inline: 22px;\n      font-size: var(--cy-text-lg);\n    }\n\n    &[data-icon] {\n      min-width: 0;\n      width: var(--cy-h);\n      padding-inline: 0;\n\n      &[data-size=\"sm\"] {\n        width: var(--cy-h-sm);\n      }\n      &[data-size=\"lg\"] {\n        width: var(--cy-h-lg);\n      }\n    }\n\n    /* Lit: the 40% fill at rest, so it's the one the eye lands on. */\n    &[data-tone=\"primary\"] {\n      --frame-line: var(--cy-line-hot);\n      --frame-fill: var(--cy-fill-active);\n      color: var(--cy-ink-hi);\n\n      @media (hover: hover) {\n        &:hover:not(:disabled, [data-disabled]) {\n          --frame-fill: color-mix(in srgb, var(--cy-accent) 52%, var(--cy-panel));\n        }\n      }\n      &:active:not(:disabled, [data-disabled]) {\n        --frame-fill: var(--cy-fill-flash);\n      }\n    }\n\n    &[data-tone=\"ghost\"] {\n      --frame-line: transparent;\n      --frame-fill: transparent;\n    }\n\n    &[data-tone=\"signal\"] {\n      --frame-line: var(--cy-signal-dim);\n      --frame-focus: var(--cy-ink-hi);\n      color: var(--cy-signal);\n\n      @media (hover: hover) {\n        &:hover:not(:disabled, [data-disabled]) {\n          --frame-line: var(--cy-signal);\n          --frame-fill: var(--cy-signal-fill);\n        }\n      }\n      &:is(:active, [data-open], [data-pressed]):not(:disabled, [data-disabled]) {\n        --frame-line: var(--cy-signal);\n        --frame-fill: color-mix(in srgb, var(--cy-signal) 30%, var(--cy-panel));\n        color: var(--cy-ink-hi);\n      }\n    }\n\n    /* Solid yellow, dark ink: the answer the screen wants. */\n    &[data-tone=\"flag\"] {\n      --frame-line: var(--cy-flag);\n      --frame-fill: var(--cy-flag);\n      --frame-focus: var(--cy-on-solid);\n      color: var(--cy-on-solid);\n\n      @media (hover: hover) {\n        &:hover:not(:disabled, [data-disabled]) {\n          --frame-line: var(--cy-flag);\n          --frame-fill: color-mix(in srgb, var(--cy-flag) 86%, white);\n        }\n      }\n      &:is(:active, [data-open], [data-pressed]):not(:disabled, [data-disabled]) {\n        --frame-line: var(--cy-flag);\n        --frame-fill: color-mix(in srgb, var(--cy-flag) 78%, var(--cy-panel));\n        color: var(--cy-on-solid);\n      }\n    }\n\n    /* Unavailable: struck through with hatching rather than only dimmed, so\n       it doesn't rely on contrast alone. */\n    &:is(:disabled, [data-disabled]) {\n      --frame-line: var(--cy-line-deco);\n      --frame-fill: var(--cy-panel-a);\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    /* Pending: a bar runs along the foot of the key. */\n    &[data-pending] {\n      cursor: progress;\n\n      &::after {\n        content: \"\";\n        position: absolute;\n        inset: auto 0 0 0;\n        height: 2px;\n        background: linear-gradient(90deg, transparent, currentColor 50%, transparent) 0 0 / 300% 100% no-repeat;\n        animation: var(--cy-fx-sweep) 900ms linear infinite;\n      }\n    }\n  }\n\n  /* A row of keys that answer something: a dialog's, a popover's, a form's. */\n  [data-skin=\"cyber\"] [data-kit=\"actions\"] {\n    display: flex;\n    flex-wrap: wrap;\n    justify-content: flex-end;\n    gap: var(--cy-gap);\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/button.css"
    }
  ],
  "type": "registry:ui"
}
