{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cursor-status",
  "title": "Cursor Status",
  "author": "Nurlan Yusifli (@yuskraft)",
  "description": "A status pill that follows the pointer during a gesture: hold to delete, drag and drop, resize, rotate.",
  "dependencies": [
    "@yuskraft/cursor-status"
  ],
  "files": [
    {
      "path": "registry/cursor-status/cursor-status.tsx",
      "content": "'use client';\n\nimport type {\n  CursorStatus as CursorStatusElement,\n  CursorStatusPlacement,\n} from '@yuskraft/cursor-status';\nimport * as React from 'react';\n\ntype CursorStatusAttributes = {\n  /** CSS selector: only follow, and only stay visible, while the pointer is inside it. */\n  scope?: string;\n  /** Side of the cursor; logical, so it flips in RTL. Default `bottom-end`. */\n  placement?: CursorStatusPlacement;\n  /** Gap from the cursor, `\"x y\"` in px. Default `\"18 20\"`. */\n  offset?: string;\n  /** How long a success stays after the gesture ends, in ms. Default 1100. */\n  linger?: number;\n  /** Track the pointer, or position with `moveTo()`. Default `pointer`. */\n  follow?: 'pointer' | 'manual';\n  /** Force a theme; otherwise it follows `prefers-color-scheme`. */\n  theme?: 'light' | 'dark';\n  /** Force reduced motion; otherwise the system setting applies. */\n  motion?: 'reduce';\n  /** Follow spring ω. Default 16. */\n  stiffness?: number;\n};\n\ntype CursorStatusProps = Omit<\n  React.HTMLAttributes<CursorStatusElement>,\n  keyof CursorStatusAttributes | 'children'\n> &\n  CursorStatusAttributes;\n\ndeclare module 'react' {\n  namespace JSX {\n    interface IntrinsicElements {\n      'cursor-status': CursorStatusProps & React.RefAttributes<CursorStatusElement>;\n    }\n  }\n}\n\n/**\n * A status pill that follows the pointer during a gesture. Render one per area, then drive it\n * through the ref, or with `useCursorStatus()`.\n */\nconst CursorStatus = React.forwardRef<CursorStatusElement, CursorStatusProps>(\n  function CursorStatus(props, ref) {\n    React.useEffect(() => {\n      // Register <cursor-status> in the browser only, so server rendering never touches the DOM.\n      void import('@yuskraft/cursor-status/define');\n    }, []);\n    return <cursor-status ref={ref} {...props} />;\n  },\n);\n\nexport { CursorStatus, type CursorStatusProps };\n",
      "type": "registry:component"
    },
    {
      "path": "registry/cursor-status/use-cursor-status.ts",
      "content": "'use client';\n\nimport type { CursorStatus, CursorStatusOptions } from '@yuskraft/cursor-status';\nimport * as React from 'react';\n\n/**\n * A ref for `<CursorStatus>` plus helpers that call through to it. The returned object and its\n * helpers never change identity, so they're safe in effect dependencies and event handlers.\n *\n * The element is defined lazily (after hydration), so calls made before that wait for it.\n */\nexport function useCursorStatus() {\n  const ref = React.useRef<CursorStatus>(null);\n\n  return React.useMemo(() => {\n    const call = (fn: (el: CursorStatus) => void) => {\n      const el = ref.current;\n      if (!el) return;\n      if (customElements.get('cursor-status')) fn(el);\n      else void customElements.whenDefined('cursor-status').then(() => fn(el));\n    };\n\n    return {\n      ref,\n      show: (label: string, opts?: CursorStatusOptions) => call((el) => el.show(label, opts)),\n      info: (label: string, opts?: CursorStatusOptions) => call((el) => el.info(label, opts)),\n      error: (label: string, opts?: CursorStatusOptions) => call((el) => el.error(label, opts)),\n      success: (label?: string, opts?: CursorStatusOptions) =>\n        call((el) => el.success(label, opts)),\n      flash: (label: string, opts?: CursorStatusOptions) => call((el) => el.flash(label, opts)),\n      hide: (opts?: { delay?: number }) => call((el) => el.hide(opts)),\n      moveTo: (x: number, y: number) => call((el) => el.moveTo(x, y)),\n      /** Ring fill, 0–1; springs smoothly. Fine to call every frame. */\n      setProgress: (value: number) =>\n        call((el) => {\n          el.progress = value;\n        }),\n      announce: (text: string) => call((el) => el.announce(text)),\n    };\n  }, []);\n}\n",
      "type": "registry:hook"
    }
  ],
  "css": {
    "@layer components": {
      "cursor-status": {
        "--cs-bg": "color-mix(in oklab, var(--popover) 86%, transparent)",
        "--cs-fg": "var(--popover-foreground)",
        "--cs-muted": "color-mix(in oklab, var(--popover-foreground) 60%, transparent)",
        "--cs-track": "color-mix(in oklab, var(--popover-foreground) 20%, transparent)",
        "--cs-success": "var(--popover-foreground)",
        "--cs-on-success": "var(--popover)",
        "--cs-error": "var(--destructive)",
        "--cs-on-error": "var(--destructive-foreground, white)",
        "--cs-radius": "var(--radius)",
        "--cs-font": "var(--font-sans, system-ui, sans-serif)",
        "--cs-shadow": "0 10px 30px -10px rgb(0 0 0 / 0.3), 0 2px 6px -2px rgb(0 0 0 / 0.12), inset 0 0 0 1px var(--border)"
      }
    }
  },
  "docs": "Render <CursorStatus ref={ref} scope=\"#area\" /> next to the area it reports on, then call show(), success() or flash() from your gesture handlers. useCursorStatus() returns the ref and stable helpers. Docs: https://yuskraft.github.io/cursor-status/",
  "type": "registry:component"
}