{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "loader-hourglass",
  "type": "registry:component",
  "title": "Loader Hourglass",
  "description": "An hourglass whose sand drains through the neck, then flips over and refills for the next round.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "loaders",
    "loader",
    "hourglass",
    "timer",
    "waiting",
    "sand",
    "svg"
  ],
  "docs": "https://hyperblur.dev/effects/loader-hourglass",
  "files": [
    {
      "path": "registry/hyperblur/loader-hourglass.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/loader-hourglass.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface LoaderHourglassProps extends React.HTMLAttributes<HTMLSpanElement> {\n  size?: number;\n  color?: string;\n  accent?: string;\n  speed?: number;\n  label?: string;\n}\n\nconst GLASS =\n  \"M10 8 H50 C50 28 34 37 32 45 C34 53 50 62 50 82 H10 C10 62 26 53 28 45 C26 37 10 28 10 8 Z\";\n\nconst css = `\n.hb-yb2 {\n  position: relative;\n  display: inline-flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 8px;\n  vertical-align: middle;\n  box-sizing: border-box;\n  font-family: inherit;\n}\n.hb-yb2 *, .hb-yb2 *::before, .hb-yb2 *::after { box-sizing: border-box; }\n.hb-yb2-svg {\n  display: block;\n  flex: none;\n  width: calc(var(--hb-yb2-s) * 0.6667);\n  height: var(--hb-yb2-s);\n  overflow: visible;\n  transform-origin: 50% 50%;\n  animation: hb-yb2-flip var(--hb-yb2-d) linear infinite;\n}\n.hb-yb2-sand { animation: hb-yb2-fade var(--hb-yb2-d) linear infinite; }\n.hb-yb2-top { animation: hb-yb2-down var(--hb-yb2-d) linear infinite; }\n.hb-yb2-bot { animation: hb-yb2-up var(--hb-yb2-d) linear infinite; }\n.hb-yb2-stream {\n  stroke-dasharray: 2 3;\n  animation:\n    hb-yb2-fall 0.45s linear infinite,\n    hb-yb2-pour var(--hb-yb2-d) linear infinite;\n}\n.hb-yb2-l {\n  font-size: 12px;\n  line-height: 1.2;\n  letter-spacing: 0.01em;\n  color: inherit;\n  opacity: 0.72;\n  white-space: nowrap;\n}\n.hb-yb2-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  margin: -1px;\n  padding: 0;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n  border: 0;\n}\n@keyframes hb-yb2-flip {\n  0%, 80% { transform: rotate(0deg); animation-timing-function: cubic-bezier(0.6, 0, 0.3, 1); }\n  94% { transform: rotate(180deg); }\n  94.1%, 100% { transform: rotate(0deg); }\n}\n@keyframes hb-yb2-fade {\n  0%, 84% { opacity: 1; }\n  90%, 95% { opacity: 0; }\n  100% { opacity: 1; }\n}\n@keyframes hb-yb2-down {\n  0% { transform: translateY(0); }\n  76%, 94% { transform: translateY(34px); }\n  94.1%, 100% { transform: translateY(0); }\n}\n@keyframes hb-yb2-up {\n  0% { transform: translateY(20px); }\n  76%, 94% { transform: translateY(0); }\n  94.1%, 100% { transform: translateY(20px); }\n}\n@keyframes hb-yb2-pour {\n  0%, 2% { opacity: 0; }\n  5%, 72% { opacity: 1; }\n  77%, 100% { opacity: 0; }\n}\n@keyframes hb-yb2-fall {\n  to { stroke-dashoffset: -5; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yb2-svg, .hb-yb2-sand, .hb-yb2-stream { animation: none; }\n  .hb-yb2-top { animation: none; transform: translateY(12px); }\n  .hb-yb2-bot { animation: none; transform: translateY(8px); }\n  .hb-yb2-stream { opacity: 0; }\n}\n`;\n\nexport function LoaderHourglass({\n  size = 56,\n  color = \"#7fb3ff\",\n  accent = \"#2f7bff\",\n  speed = 3.6,\n  label,\n  className = \"\",\n  style,\n  ...rest\n}: LoaderHourglassProps) {\n  const uid = React.useId().replace(/[^a-zA-Z0-9]/g, \"\");\n  const vars = {\n    \"--hb-yb2-s\": `${size}px`,\n    \"--hb-yb2-d\": `${(speed > 0 ? speed : 3.6).toFixed(3)}s`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <span role=\"status\" className={`hb-yb2 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-loader-hourglass\" precedence=\"default\">{css}</style>\n      <svg className=\"hb-yb2-svg\" viewBox=\"0 0 60 90\" aria-hidden=\"true\" focusable=\"false\">\n        <defs>\n          <clipPath id={`${uid}g`}>\n            <path d={GLASS} />\n          </clipPath>\n          <clipPath id={`${uid}t`}>\n            <rect x=\"0\" y=\"0\" width=\"60\" height=\"45\" />\n          </clipPath>\n          <clipPath id={`${uid}b`}>\n            <rect x=\"0\" y=\"45\" width=\"60\" height=\"45\" />\n          </clipPath>\n        </defs>\n        <path d={GLASS} fill={accent} fillOpacity=\"0.07\" />\n        <g clipPath={`url(#${uid}g)`}>\n          <g className=\"hb-yb2-sand\">\n            <g clipPath={`url(#${uid}t)`}>\n              <rect className=\"hb-yb2-top\" x=\"8\" y=\"14\" width=\"44\" height=\"36\" fill={color} />\n            </g>\n            <line\n              className=\"hb-yb2-stream\"\n              x1=\"30\"\n              y1=\"45\"\n              x2=\"30\"\n              y2=\"84\"\n              stroke={color}\n              strokeWidth=\"1.6\"\n              strokeLinecap=\"round\"\n            />\n            <g clipPath={`url(#${uid}b)`}>\n              <rect className=\"hb-yb2-bot\" x=\"8\" y=\"64\" width=\"44\" height=\"26\" fill={color} />\n            </g>\n          </g>\n        </g>\n        <path\n          d={GLASS}\n          fill=\"none\"\n          stroke={accent}\n          strokeWidth=\"2\"\n          strokeLinejoin=\"round\"\n          strokeOpacity=\"0.9\"\n        />\n        <rect x=\"5\" y=\"2\" width=\"50\" height=\"6\" rx=\"2.5\" fill={accent} />\n        <rect x=\"5\" y=\"82\" width=\"50\" height=\"6\" rx=\"2.5\" fill={accent} />\n      </svg>\n      <span className={label ? \"hb-yb2-l\" : \"hb-yb2-sr\"}>{label ?? \"Loading\"}</span>\n    </span>\n  );\n}\n"
    }
  ]
}