{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status-badge",
  "type": "registry:ui",
  "title": "StatusBadge",
  "description": "StatusBadge is a small, non-interactive label used to convey status, category, or count at a glance.",
  "dependencies": [
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/status-badge/StatusBadge.context.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadge.context.ts",
      "content": "'use client';\n\nimport { createContext, useContext } from 'react';\n\nimport type { StatusBadgeContextType } from './StatusBadge.types';\n\nexport const StatusBadgeContext = createContext<StatusBadgeContextType | undefined>(undefined);\n\nexport const useStatusBadgeContext = () => {\n  const context = useContext(StatusBadgeContext);\n  if (context === undefined) {\n    throw new Error('useStatusBadgeContext must be used within a <StatusBadge>');\n  }\n  return context;\n};\n"
    },
    {
      "path": "src/components/status-badge/StatusBadge.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadge.tsx",
      "content": "'use client';\n\nimport React from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport { StatusBadgeContext } from './StatusBadge.context';\nimport type { StatusBadgeProps, StatusBadgeWithSubComponents } from './StatusBadge.types';\nimport { statusBadgeVariants } from './StatusBadge.variants';\nimport { StatusBadgeIcon } from './StatusBadgeIcon';\nimport { StatusBadgeLabel } from './StatusBadgeLabel';\n\nconst StatusBadge = React.forwardRef<HTMLDivElement, StatusBadgeProps>(\n  ({ children, color, size, className, emphasis, shape, ...props }, ref) => {\n    return (\n      <StatusBadgeContext.Provider value={{ size }}>\n        <div\n          ref={ref}\n          data-slot=\"status-badge\"\n          className={cn(statusBadgeVariants({ color, size, emphasis, shape }), className)}\n          {...props}\n        >\n          {children}\n        </div>\n      </StatusBadgeContext.Provider>\n    );\n  },\n) as StatusBadgeWithSubComponents;\n\nStatusBadge.displayName = 'StatusBadge';\nStatusBadge.Icon = StatusBadgeIcon;\nStatusBadge.Label = StatusBadgeLabel;\n\nexport { StatusBadge };\n"
    },
    {
      "path": "src/components/status-badge/StatusBadge.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadge.types.ts",
      "content": "import type { RemixiconComponentType } from '@remixicon/react';\nimport type { VariantProps } from 'class-variance-authority';\n\nimport type { statusBadgeVariants } from './StatusBadge.variants';\nimport type { StatusBadgeIcon } from './StatusBadgeIcon';\nimport type { StatusBadgeLabel } from './StatusBadgeLabel';\n\n/** A compact status label with optional icon. */\nexport type StatusBadgeProps = {\n  /** The content of the badge. */\n  children?: React.ReactNode;\n  /** Additional CSS classes to apply to the badge. */\n  className?: string;\n} & Omit<React.ComponentProps<'div'>, 'color'> &\n  VariantProps<typeof statusBadgeVariants>;\n\n/** An icon rendered within `StatusBadge`. */\nexport type StatusBadgeIconProps = {\n  /** Additional CSS classes to apply to the badge. */\n  className?: string;\n  /** Icon component from `@remixicon/react`. */\n  icon: RemixiconComponentType;\n};\n\n/** Props for `StatusBadge.Label`. */\nexport type StatusBadgeLabelProps = React.HTMLAttributes<HTMLDivElement>;\n\nexport type StatusBadgeContextType = {\n  size: VariantProps<typeof statusBadgeVariants>['size'];\n};\n\nexport type StatusBadgeWithSubComponents = React.ForwardRefExoticComponent<\n  StatusBadgeProps & React.RefAttributes<HTMLDivElement>\n> & {\n  Icon: typeof StatusBadgeIcon;\n  Label: typeof StatusBadgeLabel;\n};\n"
    },
    {
      "path": "src/components/status-badge/StatusBadge.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadge.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const statusBadgeVariants = cva(\n  cn(\n    'gap-ws-1 inline-flex shrink-0 items-center justify-center',\n    'focus-visible:wds-focus-visible focus-visible:outline-ws-dynamic-primary-strong-default',\n  ),\n  {\n    variants: {\n      color: {\n        negative: 'bg-ws-semantic-inverse-negative text-ws-semantic-on-inverse-negative',\n        positive: 'bg-ws-semantic-inverse-positive text-ws-semantic-on-inverse-positive',\n        notice: 'bg-ws-semantic-inverse-notice text-ws-semantic-on-inverse-notice',\n        info: 'bg-ws-semantic-inverse-info text-ws-semantic-on-inverse-info',\n        neutral: 'bg-ws-semantic-inverse-neutral text-ws-semantic-on-inverse-neutral',\n      },\n      // Figma's Type=Icon variants drop all padding and pin width to the same\n      // Size/N as the height, so the icon-only badge is an exact square.\n      size: {\n        sm: 'typography-caption-strong-md h-ws-11 min-w-ws-11 gap-ws-2 px-ws-4 has-[>svg:only-child]:w-ws-11 has-[>svg:only-child]:px-0',\n        md: 'typography-label-strong-sm h-ws-12 min-w-ws-12 gap-ws-3 px-ws-5 has-[>svg:only-child]:w-ws-12 has-[>svg:only-child]:px-0',\n        // Figma pins the label-bearing variants to Size/14 (32) and the icon-only\n        // variant to Size/13 (28) — the icon-only case is the narrower exception.\n        lg: 'typography-label-strong-sm h-ws-13 min-w-ws-14 gap-ws-3 px-ws-6 has-[>svg:only-child]:w-ws-13 has-[>svg:only-child]:min-w-ws-13 has-[>svg:only-child]:px-0',\n      },\n      shape: {\n        square: '',\n        rounded: 'rounded-ws-control-full',\n      },\n      emphasis: {\n        low: '',\n        high: '',\n      },\n    },\n    defaultVariants: {\n      color: 'neutral',\n      shape: 'square',\n      size: 'md',\n      emphasis: 'low',\n    },\n    compoundVariants: [\n      // Figma: Corner Radius/Control/sm at Small, Control/md at Medium and Large.\n      {\n        shape: 'square',\n        size: 'sm',\n        className: 'rounded-ws-control-sm',\n      },\n      {\n        shape: 'square',\n        size: ['md', 'lg'],\n        className: 'rounded-ws-control-md',\n      },\n      {\n        color: 'negative',\n        emphasis: 'low',\n        className: 'bg-ws-semantic-negative text-ws-semantic-on-subtle-negative',\n      },\n      {\n        color: 'positive',\n        emphasis: 'low',\n        className: 'bg-ws-semantic-positive text-ws-semantic-on-subtle-positive',\n      },\n      {\n        color: 'notice',\n        emphasis: 'low',\n        className: 'bg-ws-semantic-notice text-ws-semantic-on-subtle-notice',\n      },\n      {\n        color: 'info',\n        emphasis: 'low',\n        className: 'bg-ws-semantic-info text-ws-semantic-on-subtle-info',\n      },\n      {\n        color: 'neutral',\n        emphasis: 'low',\n        className: 'bg-ws-semantic-neutral text-ws-semantic-on-subtle-neutral',\n      },\n    ],\n  },\n);\n\n// Figma insets the icon side by one step at md and lg (paddingLeft Gap/4 vs\n// Gap/5 at md, Gap/5 vs Gap/6 at lg) — but only when a label sits beside it.\n// The icon-only variant is sized by the root instead, so the inset is excluded\n// there with not-last / not-first.\nexport const statusBadgeIconVariants = cva(``, {\n  variants: {\n    size: {\n      sm: 'h-ws-7 w-ws-7',\n      md: 'h-ws-8 w-ws-8 first:not-last:-ml-ws-2 last:not-first:-mr-ws-2',\n      lg: 'h-ws-9 w-ws-9 first:not-last:-ml-ws-2 last:not-first:-mr-ws-2',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n  },\n});\n"
    },
    {
      "path": "src/components/status-badge/StatusBadgeIcon.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadgeIcon.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nimport { useStatusBadgeContext } from './StatusBadge.context';\nimport type { StatusBadgeIconProps } from './StatusBadge.types';\nimport { statusBadgeIconVariants } from './StatusBadge.variants';\n\nconst StatusBadgeIcon = ({ icon: Icon, className, ...props }: StatusBadgeIconProps) => {\n  const { size } = useStatusBadgeContext();\n\n  return (\n    <Icon\n      data-slot=\"status-badge-icon\"\n      {...props}\n      aria-hidden=\"true\"\n      focusable=\"false\"\n      className={cn(statusBadgeIconVariants({ size }), className)}\n    />\n  );\n};\n\nStatusBadgeIcon.displayName = 'StatusBadge.Icon';\n\nexport { StatusBadgeIcon };\n"
    },
    {
      "path": "src/components/status-badge/StatusBadgeLabel.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/status-badge/StatusBadgeLabel.tsx",
      "content": "'use client';\n\nimport React from 'react';\n\nconst StatusBadgeLabel = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n  ({ className, children, ...props }, ref) => (\n    <div ref={ref} data-slot=\"status-badge-label\" className={className} {...props}>\n      {children}\n    </div>\n  ),\n);\nStatusBadgeLabel.displayName = 'StatusBadge.Label';\n\nexport { StatusBadgeLabel };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
