{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "oods-pagination-bar",
  "type": "registry:component",
  "title": "OODS Foundry PaginationBar",
  "description": "React adapter for OODS PaginationBar on shadcn/ui's Radix and Base UI bases. Page links use anchors, not buttons; disabled links prevent navigation and leave the tab order.",
  "dependencies": [
    "@oods/components-react@0.11.2"
  ],
  "registryDependencies": [
    "pagination"
  ],
  "files": [
    {
      "path": "components/oods/pagination-bar.tsx",
      "target": "components/oods/pagination-bar.tsx",
      "type": "registry:component",
      "content": "import * as React from 'react';\nimport type { PaginationBarProps } from '@oods/components-react';\nimport { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis } from '@/registry/new-york-v4/ui/pagination';\n\nexport const OodsPaginationBar = React.forwardRef<HTMLElement, PaginationBarProps>(function OodsPaginationBar(\n  { page = 1, pageSize = 25, totalItems = 0, totalPages: supplied, pageSizeOptions = [10, 25, 50, 100],\n    showPageSizeSelector = false, showGotoPage = false, showItemRange = true, onPageChange, onPageSizeChange, onChange, onUpdate,\n    pageField, pageSizeField, totalItemsField, totalPagesField, pageSizeOptionsParameter, showPageSizeSelectorParameter,\n    showGotoPageParameter, showItemRangeParameter, className, 'aria-label': label = 'Pagination', ...props }, ref,\n) {\n  void [pageField, pageSizeField, totalItemsField, totalPagesField, pageSizeOptionsParameter, showPageSizeSelectorParameter, showGotoPageParameter, showItemRangeParameter];\n  const size = Number.isFinite(pageSize) && pageSize > 0 ? Math.floor(pageSize) : 25;\n  const count = Math.max(0, Math.floor(supplied ?? Math.ceil(Math.max(0, totalItems) / size)));\n  const current = count ? Math.max(1, Math.min(Math.floor(page), count)) : 1;\n  const go = (next: number) => { const target = Math.max(1, Math.min(Math.floor(next), count)); if (count && Number.isFinite(target) && target !== current) { onPageChange?.(target); onChange?.(target); onUpdate?.(target); } };\n  const numbers = count <= 7 ? Array.from({ length: count }, (_, i) => i + 1) : [...new Set([1, current - 1, current, current + 1, count])].filter(n => n >= 1 && n <= count).sort((a, b) => a - b);\n  const pages: Array<number | string> = [];\n  numbers.forEach((n, index) => { if (index && n - numbers[index - 1] > 1) pages.push(`gap-${n}`); pages.push(n); });\n  const link = (target: number, disabled = false) => ({ href: '#', role: 'link' as const, 'aria-disabled': disabled || undefined, tabIndex: disabled ? -1 : 0, onClick: (event: React.MouseEvent<HTMLAnchorElement>) => { event.preventDefault(); if (!disabled) go(target); } });\n  return <Pagination {...props} ref={ref} aria-label={label} data-oods-component={undefined} data-oods-adapter=\"PaginationBar\" className={['flex-wrap items-center gap-3', className].filter(Boolean).join(' ')}>\n    {showItemRange ? <><span>{`${totalItems} ${totalItems === 1 ? 'record' : 'records'}`}</span>{totalItems > 0 && count > 1 ? <span>{`Showing ${(current - 1) * size + 1}–${Math.min(current * size, totalItems)} of ${totalItems}`}</span> : null}</> : null}\n    {count > 1 ? <><PaginationContent>\n      <PaginationItem><PaginationPrevious {...link(current - 1, current <= 1)} aria-label=\"Previous page\" /></PaginationItem>\n      {pages.map(n => <PaginationItem key={n}>{typeof n === 'number' ? <PaginationLink {...link(n)} isActive={n === current} aria-label={`Page ${n}`}>{n}</PaginationLink> : <PaginationEllipsis />}</PaginationItem>)}\n      <PaginationItem><PaginationNext {...link(current + 1, current >= count)} aria-label=\"Next page\" /></PaginationItem>\n    </PaginationContent><span>{`Page ${current} of ${count}`}</span></> : null}\n    {showPageSizeSelector ? <label>Items per page<select aria-label=\"Items per page\" value={size} onChange={event => onPageSizeChange?.(Number(event.currentTarget.value))}>{pageSizeOptions.map(option => <option key={option} value={option}>{option}</option>)}</select></label> : null}\n    {showGotoPage ? <label>Go to page<input type=\"number\" min={1} max={Math.max(1, count)} defaultValue={current} onKeyDown={event => { if (event.key === 'Enter') go(Number(event.currentTarget.value)); }} /></label> : null}\n  </Pagination>;\n});\n"
    }
  ]
}
