{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "extends": "none",
  "name": "tracker",
  "title": "tracker",
  "description": "tracker",
  "dependencies": [
    "react-aria-components",
    "cn"
  ],
  "registryDependencies": [
    "https://intentui.com/r/tooltip"
  ],
  "files": [
    {
      "path": "src/components/ui/tracker.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport { Pressable } from \"react-aria-components/Pressable\"\nimport { twJoin, cn } from \"cn\"\nimport { TooltipTrigger, Tooltip } from \"./tooltip\"\n\nexport interface TrackerBlockProps {\n  key?: string | number\n  color?: string\n  tooltip?: string\n  defaultBackgroundColor?: string\n  disabledTooltip?: boolean\n}\n\nfunction Block({\n  color,\n  tooltip,\n  disabledTooltip,\n  defaultBackgroundColor = \"bg-secondary\",\n}: TrackerBlockProps) {\n  const [open, setOpen] = useState(false)\n\n  return disabledTooltip ? (\n    <div className=\"size-full overflow-hidden px-[0.5px] transition first:rounded-s-sm first:ps-0 last:rounded-e-sm last:pe-0 sm:px-px\">\n      <div\n        className={twJoin(\n          \"size-full rounded-[1px]\",\n          color || defaultBackgroundColor,\n          \"hover:opacity-50\"\n        )}\n      />\n    </div>\n  ) : (\n    <TooltipTrigger isOpen={open} onOpenChange={setOpen} delay={0} closeDelay={0}>\n      <Pressable onPress={() => setOpen(true)}>\n        <div\n          role=\"button\"\n          tabIndex={0}\n          aria-label={tooltip ?? \"Show status\"}\n          className=\"size-full overflow-hidden px-[0.5px] transition first:rounded-s-sm first:ps-0 last:rounded-e-sm last:pe-0 sm:px-px\"\n        >\n          <div\n            className={twJoin(\n              \"size-full rounded-[1px]\",\n              color || defaultBackgroundColor,\n              \"hover:opacity-50\"\n            )}\n          />\n        </div>\n      </Pressable>\n      <Tooltip arrow={false} offset={10} placement=\"top\" inverse className=\"px-2 py-1.5 text-xs\">\n        {tooltip}\n      </Tooltip>\n    </TooltipTrigger>\n  )\n}\n\nexport interface TrackerProps\n  extends React.ComponentProps<\"div\">, Pick<TrackerBlockProps, \"disabledTooltip\"> {\n  data: TrackerBlockProps[]\n  defaultBackgroundColor?: string\n}\n\nexport function Tracker({\n  data = [],\n  disabledTooltip = false,\n  className,\n  ref,\n  ...props\n}: TrackerProps) {\n  return (\n    <div ref={ref} className={cn(\"group flex h-8 w-full items-center\", className)} {...props}>\n      {data.map((props, index) => (\n        <Block disabledTooltip={disabledTooltip} key={props.key ?? index} {...props} />\n      ))}\n    </div>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}