{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress",
  "title": "Progress",
  "description": "A segmented bar with a percentage readout, and an indeterminate state.",
  "dependencies": [
    "@ui-sdk/react@0.1.0-beta.5"
  ],
  "registryDependencies": [
    "https://www.cyberspec.dev/r/cyber.json"
  ],
  "files": [
    {
      "path": "registry/cyber/ui/progress.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as SdkProgress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue } from \"@ui-sdk/react/progress\"\nimport \"@/registry/cyber/ui/cyber/progress.css\"\n\n// A task's progress, as a bar of segments that light one at a time, with the\n// percentage read out beside its label in the signal color. The segment\n// being worked on breathes, so a slow task still looks alive.\n//\n// - `value`: how far along, between `min` and `max` (0 to 100 unless set).\n//   Leave it out, or pass null, while that isn't known: the bar hatches, a\n//   highlight sweeps across it, and `busyLabel` is printed where the\n//   percentage would be, so it reads as busy with every effect off too.\n// - `variant`: \"segments\", or \"thin\" for a hairline bar with its readout\n//   underneath, the way a loading screen has it.\n// - `segments`: how many steps the bar has.\nfunction Progress({\n  label,\n  value = null,\n  variant = \"segments\",\n  segments = 24,\n  busyLabel = \"Working\",\n  getValueLabel,\n  style,\n  ...props\n}: Omit<React.ComponentProps<typeof SdkProgress>, \"children\" | \"value\"> & {\n  label: string\n  value?: number | null\n  variant?: \"segments\" | \"thin\"\n  segments?: number\n  busyLabel?: string\n}) {\n  return (\n    <SdkProgress\n      data-kit=\"progress\"\n      data-variant={variant}\n      value={value}\n      // The printed readout is hidden from screen readers, which get the\n      // value from the bar itself: while it has none, they get the word.\n      getValueLabel={getValueLabel ?? ((current, details) => (current == null ? busyLabel : details.formatted))}\n      style={(state) => ({ \"--segments\": segments, ...(typeof style === \"function\" ? style(state) : style) }) as React.CSSProperties}\n      {...props}\n    >\n      <span data-kit=\"progress-head\">\n        <ProgressLabel data-kit=\"label\">{label}</ProgressLabel>\n        <ProgressValue data-kit=\"progress-value\">{(state) => state.text || busyLabel}</ProgressValue>\n      </span>\n      <ProgressTrack data-kit=\"progress-track\">\n        <ProgressIndicator data-kit=\"progress-indicator\" />\n      </ProgressTrack>\n    </SdkProgress>\n  )\n}\n\nexport { Progress }\n",
      "type": "registry:ui",
      "target": "@ui/progress.tsx"
    },
    {
      "path": "registry/cyber/ui/cyber/progress.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=\"progress\"] {\n    display: grid;\n    gap: 6px;\n    width: 100%;\n    min-width: 0;\n    text-align: start;\n  }\n\n  [data-skin=\"cyber\"] [data-kit=\"progress-head\"] {\n    display: flex;\n    align-items: baseline;\n    justify-content: space-between;\n    gap: 12px;\n    min-width: 0;\n\n    & [data-kit=\"label\"] {\n      min-width: 0;\n      overflow: hidden;\n      text-overflow: ellipsis;\n      white-space: nowrap;\n    }\n  }\n\n  /* The readout. A percentage while there is one; the word while there\n     isn't, with a caret after it. */\n  [data-skin=\"cyber\"] [data-kit=\"progress-value\"] {\n    flex: none;\n    font-family: var(--cy-mono);\n    font-size: var(--cy-text-xs);\n    font-variant-numeric: tabular-nums;\n    color: var(--cy-signal);\n\n    &[data-indeterminate] {\n      letter-spacing: 0.08em;\n      text-transform: uppercase;\n\n      &::after {\n        content: \"_\";\n        animation: var(--cy-fx-blink) 1s step-end infinite;\n      }\n    }\n  }\n\n  /* The track is one strip of the dim line color; a mask cuts it, and the\n     fill inside it, into segments. Only the mask's alpha is used, so its\n     \"color\" is any opaque token. The mask is two pixels wider than the\n     track, which pushes the gap after the last segment out of sight. */\n  [data-skin=\"cyber\"] [data-kit=\"progress-track\"] {\n    --seg: calc(100% / var(--segments, 24));\n    --gap: 2px;\n    --on: var(--cy-void);\n\n    position: relative;\n    height: 10px;\n    container-type: inline-size;\n    background: var(--cy-line-deco);\n    mask-image: repeating-linear-gradient(to right, var(--on) 0 calc(var(--seg) - var(--gap)), transparent calc(var(--seg) - var(--gap)) var(--seg));\n    mask-size: calc(100% + var(--gap)) 100%;\n    mask-repeat: no-repeat;\n\n    &:dir(rtl) {\n      mask-image: repeating-linear-gradient(to left, var(--on) 0 calc(var(--seg) - var(--gap)), transparent calc(var(--seg) - var(--gap)) var(--seg));\n      mask-position: right;\n    }\n  }\n\n  /* The SDK sets the fill's width to the exact percentage. Pinning its\n     minimum and maximum to that value rounded down to a whole segment makes\n     it step instead: a segment is lit or it isn't, and nothing slides. */\n  [data-skin=\"cyber\"] [data-kit=\"progress-indicator\"] {\n    position: relative;\n    height: 100%;\n    min-width: round(down, var(--progress-value), var(--seg));\n    max-width: round(down, var(--progress-value), var(--seg));\n    background: var(--cy-accent);\n\n    /* The segment being worked on: half lit, breathing. */\n    &::after {\n      content: \"\";\n      position: absolute;\n      inset-block: 0;\n      inset-inline-start: 100%;\n      width: calc(100cqi / var(--segments, 24));\n      background: color-mix(in srgb, var(--cy-accent) 58%, var(--cy-panel));\n      animation: var(--cy-fx-pulse) 1.4s var(--cy-ease-snap) infinite;\n    }\n\n    &[data-complete]::after {\n      content: none;\n    }\n\n    /* Unknown: every segment hatched, and a highlight crossing them. With\n       effects off the hatching stays, and so does the word above it. */\n    &[data-indeterminate] {\n      min-width: 100%;\n      background: repeating-linear-gradient(135deg, var(--cy-accent) 0 2px, transparent 2px 5px);\n\n      &::after {\n        inset: 0;\n        width: auto;\n        /* Parked out of view until the sweep runs. */\n        background: linear-gradient(90deg, transparent, var(--cy-ink-hi) 50%, transparent) 150% 0 / 300% 100% no-repeat;\n        animation: var(--cy-fx-sweep) 1.6s linear infinite;\n      }\n    }\n  }\n\n  /* Thin: a hairline with a tick riding the end of the fill, and the\n     readout underneath it, larger. */\n  [data-skin=\"cyber\"] [data-kit=\"progress\"][data-variant=\"thin\"] {\n    gap: 8px;\n\n    & [data-kit=\"progress-head\"] {\n      order: 1;\n    }\n\n    & [data-kit=\"label\"] {\n      font-family: var(--cy-mono);\n      font-size: var(--cy-text-xs);\n      font-weight: 400;\n      color: var(--cy-ink-mute);\n    }\n\n    & [data-kit=\"progress-value\"] {\n      font-family: var(--cy-font);\n      font-size: var(--cy-text-lg);\n      font-weight: 600;\n      line-height: 1;\n    }\n\n    & [data-kit=\"progress-track\"] {\n      height: 2px;\n      mask-image: none;\n    }\n\n    & [data-kit=\"progress-indicator\"] {\n      min-width: 0;\n      max-width: none;\n      background: var(--cy-ink);\n\n      &::after {\n        inset-block: -3px;\n        inset-inline-start: auto;\n        inset-inline-end: 0;\n        width: 2px;\n        background: var(--cy-ink-hi);\n        animation: none;\n      }\n\n      &[data-indeterminate] {\n        min-width: 100%;\n        background: repeating-linear-gradient(to right, var(--cy-ink) 0 6px, transparent 6px 10px);\n\n        &::after {\n          inset: 0;\n          width: auto;\n          background: linear-gradient(90deg, transparent, var(--cy-ink-hi) 50%, transparent) 150% 0 / 300% 100% no-repeat;\n          animation: var(--cy-fx-sweep) 1.6s linear infinite;\n        }\n      }\n    }\n  }\n}\n",
      "type": "registry:file",
      "target": "@ui/cyber/progress.css"
    }
  ],
  "type": "registry:ui"
}
