{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "price-range",
  "title": "Price Range",
  "description": "The nx-ui Price Range block.",
  "dependencies": [
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "@nx-ui/utils"
  ],
  "files": [
    {
      "path": "components/blocks/marketplace/price-range.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * PriceRange — a gate-fee / price range atom for the marketplace family.\n *\n * Formats a min/max pair in GBP (\"£12–£18/t\", or \"£12/t\" when the bounds\n * agree), with a qualifier for uncertain figures — `from` (\"from £12/t\") and\n * `guide` (\"£12–£18/t (guide)\"). The formatting matches the gate-fee copy\n * used across the marketplace blocks; this is the standalone atom for\n * anywhere a price needs to read the same way.\n */\n\nconst priceFormatter = new Intl.NumberFormat(\"en-GB\", {\n  style: \"currency\",\n  currency: \"GBP\",\n  minimumFractionDigits: 0,\n  maximumFractionDigits: 0,\n})\n\n/** The shared formatter: \"£12–£18/t\", \"£12/t\", \"from £12/t\", \"£12–£18/t (guide)\". */\nexport function formatPriceRange({\n  min,\n  max,\n  unit = \"/t\",\n  qualifier,\n}: {\n  min: number\n  max?: number\n  unit?: string\n  qualifier?: \"from\" | \"guide\"\n}): string {\n  const range =\n    max != null && max !== min\n      ? `${priceFormatter.format(min)}–${priceFormatter.format(max)}`\n      : priceFormatter.format(min)\n  if (qualifier === \"from\") return `from ${range}${unit}`\n  if (qualifier === \"guide\") return `${range}${unit} (guide)`\n  return `${range}${unit}`\n}\n\nconst priceRangeVariants = cva(\n  \"inline-flex w-fit shrink-0 items-baseline gap-1 whitespace-nowrap tabular-nums\",\n  {\n    variants: {\n      size: {\n        sm: \"text-xs\",\n        md: \"text-sm\",\n      },\n      tone: {\n        default: \"text-secondary-foreground\",\n        muted: \"text-muted-foreground\",\n      },\n    },\n    defaultVariants: {\n      size: \"sm\",\n      tone: \"default\",\n    },\n  }\n)\n\nexport interface PriceRangeProps extends VariantProps<typeof priceRangeVariants> {\n  /** Lower bound, £/unit. */\n  min: number\n  /** Upper bound, £/unit; omit (or pass `min`) for a single figure. */\n  max?: number\n  /** Unit suffix, e.g. \"/t\" (per tonne), \"/load\". */\n  unit?: string\n  /** Uncertainty qualifier — \"from\" (open-ended) or \"guide\" (indicative). */\n  qualifier?: \"from\" | \"guide\"\n  className?: string\n}\n\nexport function PriceRange({\n  min,\n  max,\n  unit = \"/t\",\n  qualifier,\n  size,\n  tone,\n  className,\n}: PriceRangeProps) {\n  return (\n    <span\n      data-slot=\"price-range\"\n      className={cn(priceRangeVariants({ size, tone }), className)}\n    >\n      <span className={cn(tone !== \"muted\" && \"font-semibold\")}>\n        {formatPriceRange({ min, max, unit, qualifier })}\n      </span>\n    </span>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/marketplace/price-range.tsx"
    }
  ],
  "type": "registry:block"
}