{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "billet",
  "type": "registry:ui",
  "title": "Billet",
  "description": "Content-shaped skeleton placeholder — matte graphite blocks crossed by a single cool-white light pass (heat-pass timing, not a conveyor). Card / text / circle / rect presets compose to prefigure any layout; @property-driven, zero dependencies, role=status + aria-busy, gentle opacity breathe under reduced motion.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/default/loaders/billet/billet.tsx",
      "type": "registry:ui",
      "target": "components/crucible/billet.tsx",
      "content": "import * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface BilletProps extends React.ComponentPropsWithoutRef<\"div\"> {\n  /**\n   * Which content-shaped placeholder to forge.\n   * - `card` (default): an avatar + heading rows, a media rect, and a\n   *   paragraph — a full content card blank.\n   * - `text`: a stack of text-line bars, the last one short.\n   * - `circle`: a single avatar disc.\n   * - `rect`: a single media/thumbnail block.\n   * Compose several to prefigure any layout.\n   * @default \"card\"\n   */\n  shape?: \"card\" | \"text\" | \"circle\" | \"rect\";\n  /** Number of text-line bars for `text` (and the card paragraph). @default 3 */\n  lines?: number;\n  /** Width of the final, short line — any CSS length/percentage. @default \"62%\" */\n  lastLineWidth?: string;\n  /** Diameter in px of the `circle` avatar disc. @default 48 */\n  size?: number;\n  /** Sweep-cycle speed multiplier. 1 = default, 2 = twice as fast. @default 1 */\n  speed?: number;\n  /** Direction the light pass travels. @default \"right\" */\n  direction?: \"left\" | \"right\";\n  /** Tilt of the light band in degrees (0 = vertical bar). @default 12 */\n  angle?: number;\n  /** Corner radius in px for blocks and the card panel. @default 8 */\n  radius?: number;\n  /**\n   * `sweep` (default): a single cool-white light pass with matte graphite\n   * between passes. `pulse`: a gentle opacity breathe, no pass.\n   * @default \"sweep\"\n   */\n  mode?: \"sweep\" | \"pulse\";\n  /** Matte base tone of the placeholder blocks. Any CSS color. @default \"#1c1e24\" */\n  baseColor?: string;\n  /** Peak tone of the light pass. Any CSS color. @default \"#e6ecf7\" */\n  highlightColor?: string;\n  /** Freeze the animation on a designed lit frame. @default false */\n  paused?: boolean;\n  /** Accessible label announced while content loads. @default \"Loading\" */\n  label?: string;\n}\n\n// @property makes --billet-pos a real animatable <number>, so the custom\n// property INTERPOLATES between keyframes (unregistered custom properties\n// snap, they don't tween) — that smooth tween is the whole light pass. The\n// keyframes dwell off-screen (matte) then fire a single eased pass: a heat\n// pass, not a constant conveyor. Reduced motion swaps to a slow opacity\n// breathe — a living resting frame, never a dead grey box. All pure CSS:\n// browsers already throttle CSS animations offscreen and on hidden tabs, so\n// no JS observer is needed to pause.\nconst STYLE = `\n@property --billet-pos {\n  syntax: \"<number>\";\n  inherits: false;\n  initial-value: 0;\n}\n@keyframes crucible-billet-sweep {\n  0%, 44%  { --billet-pos: var(--billet-from); }\n  44%      { --billet-pos: var(--billet-from); animation-timing-function: cubic-bezier(0.45, 0, 0.15, 1); }\n  80%      { --billet-pos: var(--billet-to); }\n  100%     { --billet-pos: var(--billet-to); }\n}\n@keyframes crucible-billet-pulse {\n  0%, 100% { opacity: 0.5; }\n  50%      { opacity: 1; }\n}\n[data-crucible=\"billet\"] .billet-block {\n  position: relative;\n  overflow: hidden;\n  isolation: isolate;\n  background-color: var(--billet-base);\n  border-radius: var(--billet-radius);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 0 0 1px rgba(255, 255, 255, 0.02);\n}\n[data-crucible=\"billet\"] .billet-shine {\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  background-image: linear-gradient(\n    var(--billet-grad-angle),\n    transparent 34%,\n    color-mix(in oklab, var(--billet-highlight) 85%, transparent) 50%,\n    transparent 66%\n  );\n  transform: translateX(calc(var(--billet-pos) * 1%));\n  mix-blend-mode: screen;\n  opacity: 0.7;\n  will-change: transform;\n}\n[data-crucible=\"billet\"][data-mode=\"sweep\"]:not([data-paused=\"true\"]) .billet-shine {\n  animation: crucible-billet-sweep var(--billet-dur) linear infinite;\n}\n[data-crucible=\"billet\"][data-mode=\"pulse\"] .billet-shine {\n  display: none;\n}\n[data-crucible=\"billet\"][data-mode=\"pulse\"]:not([data-paused=\"true\"]) .billet-block {\n  animation: crucible-billet-pulse var(--billet-dur) ease-in-out infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n  [data-crucible=\"billet\"] .billet-shine {\n    display: none !important;\n  }\n  [data-crucible=\"billet\"]:not([data-paused=\"true\"]) .billet-block {\n    animation: crucible-billet-pulse calc(var(--billet-dur) * 1.5) ease-in-out infinite !important;\n  }\n}\n`;\n\n// A single matte placeholder block with its own light-pass overlay.\nfunction Block({ style }: { style?: React.CSSProperties }) {\n  return (\n    <div className=\"billet-block\" style={style} aria-hidden>\n      <span className=\"billet-shine\" />\n    </div>\n  );\n}\n\nfunction TextLines({ lines, lastLineWidth, lineRadius }: { lines: number; lastLineWidth: string; lineRadius: number }) {\n  return (\n    <div className=\"flex w-full flex-col\" style={{ gap: \"0.62rem\" }}>\n      {Array.from({ length: lines }, (_, i) => (\n        <Block\n          key={i}\n          style={{\n            height: \"0.85rem\",\n            width: i === lines - 1 && lines > 1 ? lastLineWidth : \"100%\",\n            borderRadius: lineRadius,\n          }}\n        />\n      ))}\n    </div>\n  );\n}\n\n/**\n * Billet — a content-shaped skeleton placeholder: matte graphite blocks (an\n * \"unforged billet\") crossed by a single cool-white light pass. The pass is a\n * heat pass, not a treadmill — it dwells off the block, then fires once and\n * rests, driven by an @property-registered custom property so the shine tweens\n * smoothly with zero JavaScript. Presets cover the common blanks (card / text\n * / circle / rect) and compose to prefigure any layout. Colors, radius, sweep\n * speed/direction/angle, line count, and a pulse mode are all themeable; the\n * region carries `role=\"status\"` + `aria-busy`, and under reduced motion the\n * sweep becomes a gentle opacity breathe — a living resting frame, never a\n * dead grey box.\n */\nexport function Billet({\n  shape = \"card\",\n  lines = 3,\n  lastLineWidth = \"62%\",\n  size = 48,\n  speed = 1,\n  direction = \"right\",\n  angle = 12,\n  radius = 8,\n  mode = \"sweep\",\n  baseColor = \"#1c1e24\",\n  highlightColor = \"#e6ecf7\",\n  paused = false,\n  label = \"Loading\",\n  className,\n  style,\n  ...rest\n}: BilletProps) {\n  const lineCount = Math.max(1, Math.min(Math.round(lines), 12));\n  const lineRadius = Math.min(radius, 6);\n\n  const vars = {\n    \"--billet-base\": baseColor,\n    \"--billet-highlight\": highlightColor,\n    \"--billet-radius\": `${radius}px`,\n    \"--billet-grad-angle\": `${90 + angle}deg`,\n    \"--billet-dur\": `${(2.8 / Math.max(speed, 0.05)).toFixed(3)}s`,\n    // Percentages the light band translates between (its own width is the\n    // block width, so ±120% clears fully off either side).\n    \"--billet-from\": direction === \"left\" ? \"120\" : \"-120\",\n    \"--billet-to\": direction === \"left\" ? \"-120\" : \"120\",\n    ...style,\n  } as React.CSSProperties;\n\n  const panel: React.CSSProperties = {\n    padding: \"1rem\",\n    border: \"1px solid rgba(255,255,255,0.06)\",\n    borderRadius: `calc(var(--billet-radius) + 6px)`,\n    background: \"rgba(255,255,255,0.015)\",\n  };\n\n  return (\n    <div\n      {...rest}\n      data-crucible=\"billet\"\n      data-mode={mode}\n      data-paused={paused ? \"true\" : undefined}\n      role=\"status\"\n      aria-busy=\"true\"\n      aria-label={label}\n      className={cn(\"relative block w-full\", className)}\n      style={vars}\n    >\n      <style>{STYLE}</style>\n\n      {shape === \"circle\" && (\n        <Block style={{ width: size, height: size, borderRadius: 9999 }} />\n      )}\n\n      {shape === \"rect\" && <Block style={{ width: \"100%\", height: \"9rem\" }} />}\n\n      {shape === \"text\" && (\n        <TextLines lines={lineCount} lastLineWidth={lastLineWidth} lineRadius={lineRadius} />\n      )}\n\n      {shape === \"card\" && (\n        <div className=\"billet-card w-full\" style={panel}>\n          <div className=\"flex items-center\" style={{ gap: \"0.85rem\" }}>\n            <Block style={{ width: 44, height: 44, borderRadius: 9999, flex: \"0 0 auto\" }} />\n            <div className=\"flex min-w-0 flex-1 flex-col\" style={{ gap: \"0.5rem\" }}>\n              <Block style={{ height: \"0.95rem\", width: \"55%\", borderRadius: lineRadius }} />\n              <Block style={{ height: \"0.75rem\", width: \"32%\", borderRadius: lineRadius }} />\n            </div>\n          </div>\n          <Block\n            style={{ height: \"8.5rem\", width: \"100%\", borderRadius: \"var(--billet-radius)\", marginTop: \"1rem\" }}\n          />\n          <div className=\"flex flex-col\" style={{ gap: \"0.6rem\", marginTop: \"1rem\" }}>\n            {Array.from({ length: lineCount }, (_, i) => (\n              <Block\n                key={i}\n                style={{\n                  height: \"0.8rem\",\n                  width: i === lineCount - 1 && lineCount > 1 ? lastLineWidth : \"100%\",\n                  borderRadius: lineRadius,\n                }}\n              />\n            ))}\n          </div>\n        </div>\n      )}\n\n      <span className=\"sr-only\">{label}</span>\n    </div>\n  );\n}\n"
    }
  ]
}