{"name":"spinner","type":"registry:ui","files":[{"path":"spinner.tsx","type":"registry:ui","content":"import * as React from \"react\"\nimport { LoaderCircle as LoaderCircleIcon } from \"honestui/icons\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst sizes = {\n  sm: \"size-3.5\",\n  default: \"size-4\",\n  lg: \"size-5\",\n} as const\n\ntype SpinnerProps = Omit<React.ComponentProps<\"span\">, \"children\"> & {\n  /** Announced to assistive technology. Ignored when `decorative`. */\n  label?: string\n  /**\n   * Hides the spinner from assistive technology. Use it when nearby text\n   * already says what is loading, such as a button that reads \"Saving…\".\n   */\n  decorative?: boolean\n  size?: keyof typeof sizes | number\n}\n\nfunction Spinner({\n  className,\n  label = \"Loading\",\n  decorative = false,\n  size = \"default\",\n  style,\n  ...props\n}: SpinnerProps) {\n  const numeric = typeof size === \"number\"\n\n  return (\n    <span\n      data-slot=\"spinner\"\n      role={decorative ? undefined : \"status\"}\n      aria-hidden={decorative ? true : undefined}\n      className={cn(\n        \"inline-flex shrink-0 items-center justify-center text-current\",\n        !numeric && sizes[size],\n        className\n      )}\n      style={numeric ? { width: size, height: size, ...style } : style}\n      {...props}\n    >\n      <LoaderCircleIcon\n        aria-hidden=\"true\"\n        // The spin carries meaning, so reduced motion slows it rather than\n        // stopping it: a frozen arc reads as a broken icon.\n        className=\"size-full motion-safe:animate-spin motion-reduce:animate-[spin_2.4s_linear_infinite] forced-colors:text-[CanvasText]\"\n      />\n      {!decorative && <span className=\"sr-only\">{label}</span>}\n    </span>\n  )\n}\n\nexport { Spinner }\n","target":"components/ui/spinner.tsx"}],"dependencies":["honestui"]}