{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "table",
  "type": "registry:ui",
  "title": "Table",
  "description": "Native table parts and typed TanStack Table composition for sorting, filtering and pagination.",
  "dependencies": [
    "@tanstack/react-table@9.2.8"
  ],
  "registryDependencies": [
    "https://ghost-ui.com/r/ghost-tokens.json",
    "https://ghost-ui.com/r/shared-background.json",
    "https://ghost-ui.com/r/foundation.json"
  ],
  "files": [
    {
      "path": "src/components/ui/table.tsx",
      "type": "registry:component",
      "target": "@ui/table.tsx",
      "content": "import \"./foundation.css\";\nimport * as React from \"react\";\nimport type {\n  Cell,\n  Column,\n  CellData,\n  Header,\n  Row,\n  RowData,\n  TableFeatures,\n} from \"@tanstack/react-table\";\nimport type { ReactTable } from \"@tanstack/react-table\";\nimport { SharedBackground } from \"./shared-background\";\nimport { TableResizeHandle } from \"./table-resize-handle\";\nimport \"./table.css\";\n\n// Local class join (no @/lib/utils import): src/components/ui/* must stay\n// importable from apps/web, whose docs masters use relative imports (see\n// src/components/ui/breadcrumb.tsx). Only custom ui-table classes merge\n// here, so plain join matches cn behavior for this file.\nfunction joinClass(...parts: Array<string | undefined>): string {\n  return parts.filter(Boolean).join(\" \");\n}\n\nexport type TableVariant = \"ghost\" | \"outline\" | \"zebra\";\nexport type TableDensity = \"dense\" | \"default\" | \"relaxed\";\nexport type TableAlignment = \"start\" | \"center\" | \"end\" | \"numeric\";\nexport type TablePinned = \"left\" | \"right\";\nexport type TableLayout = \"scroll\" | \"wrap\";\nexport type TableColumnWidthMode = \"fit\" | \"fill\";\n\nexport interface TableColumnMeta {\n  alignment?: TableAlignment;\n  /** Fit content, or fill available space. Authored TanStack sizes take precedence. */\n  widthMode?: TableColumnWidthMode;\n}\n\ndeclare module \"@tanstack/table-core\" {\n  interface ColumnMeta<\n    in out TFeatures extends TableFeatures,\n    in out TData extends RowData,\n    TValue extends CellData = CellData,\n  > extends TableColumnMeta {}\n}\n\nexport interface TableRootProps extends Omit<\n  React.ComponentPropsWithRef<\"div\">,\n  \"className\" | \"children\"\n> {\n  variant?: TableVariant;\n  /** Visual treatment for rows. Ghost is the quiet default. */\n  density?: TableDensity;\n  /** Header height for this composition. Defaults to 40px. */\n  headerHeight?: number | string;\n  /** Body row height for this composition. Defaults to 40px. */\n  rowHeight?: number | string;\n  /** Horizontal cell inset for this composition. Defaults to 16px. */\n  cellPaddingInline?: number | string;\n  /** Heading text size for this composition. Defaults to 12px. */\n  headerFontSize?: number | string;\n  /** Heading font weight for this composition. Defaults to 400. */\n  headerFontWeight?: number;\n  /** Fills the host width, including inside prose. Controls narrow cells; the default scrolls. */\n  layout?: TableLayout;\n  className?: string;\n  /** Host class for the inner <table> (wrapper keeps `className`). */\n  tableClassName?: string;\n  /** Native table attributes and ref. These are applied to the inner `<table>`. */\n  tableProps?: React.ComponentPropsWithRef<\"table\">;\n  children?: React.ReactNode;\n}\n\nexport interface TableHeadProps extends Omit<\n  React.ComponentPropsWithRef<\"th\">,\n  \"className\" | \"children\"\n> {\n  scope?: \"col\" | \"row\" | \"colgroup\" | \"rowgroup\";\n  alignment?: TableAlignment;\n  widthMode?: TableColumnWidthMode;\n  pinned?: TablePinned;\n  /** Logical offset for this pinned cell, in pixels. */\n  pinnedOffset?: number;\n  /** Mark the outer edge of a frozen block for its 1px boundary. */\n  frozenEdge?: \"start\" | \"end\";\n  className?: string;\n  children?: React.ReactNode;\n}\n\ntype TableSectionProps<\n  T extends \"thead\" | \"tbody\" | \"tfoot\" | \"tr\" | \"td\" | \"caption\",\n> = Omit<React.ComponentPropsWithRef<T>, \"className\" | \"children\"> & {\n  className?: string;\n  children?: React.ReactNode;\n};\n\nexport interface TableCellProps extends Omit<\n  React.ComponentPropsWithRef<\"td\">,\n  \"className\" | \"children\"\n> {\n  alignment?: TableAlignment;\n  widthMode?: TableColumnWidthMode;\n  pinned?: TablePinned;\n  /** Logical offset for this pinned cell, in pixels. */\n  pinnedOffset?: number;\n  /** Mark the outer edge of a frozen block for its 1px boundary. */\n  frozenEdge?: \"start\" | \"end\";\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport interface TableRowProps extends Omit<\n  React.ComponentPropsWithRef<\"tr\">,\n  \"className\" | \"children\" | \"aria-selected\"\n> {\n  /** Checked row state, independent of the row whose details are open. */\n  selected?: boolean;\n  /** Outline the row currently shown in a caller-owned detail view. */\n  focused?: boolean;\n  /** Disable the default row hover treatment for this row. */\n  hover?: boolean;\n  /** Explicit height for this native row. */\n  height?: number | string;\n  /** Stick this row to the top or bottom of the table scrollport. */\n  frozen?: \"top\" | \"bottom\";\n  /** Sticky inset in pixels. Defaults to 0. */\n  frozenOffset?: number;\n  className?: string;\n  children?: React.ReactNode;\n}\n\nexport interface TableEmptyRowProps extends Omit<\n  React.ComponentPropsWithRef<\"tr\">,\n  \"className\" | \"children\"\n> {\n  className?: string;\n  /** Status role for the empty row; override only with an equally exposed role. */\n  role?: string;\n  /** Columns the single empty cell spans. */\n  colSpan?: number;\n  children?: React.ReactNode;\n}\n\nfunction TableEmptyRow({\n  className,\n  role = \"status\",\n  colSpan = 2,\n  children = \"No rows to show.\",\n  ...props\n}: TableEmptyRowProps) {\n  return (\n    <tr\n      data-slot=\"table-empty-row\"\n      className={joinClass(\"ui-table__empty-row\", className)}\n      {...props}\n    >\n      <td colSpan={colSpan}>\n        <span role={role}>{children}</span>\n      </td>\n    </tr>\n  );\n}\n\nfunction TableHeader({\n  className,\n  children,\n  ...props\n}: TableSectionProps<\"thead\">) {\n  return (\n    <thead\n      data-slot=\"table-header\"\n      className={joinClass(\"ui-table__header\", className)}\n      {...props}\n    >\n      {children}\n    </thead>\n  );\n}\n\nfunction TableBody({\n  className,\n  children,\n  ...props\n}: TableSectionProps<\"tbody\">) {\n  return (\n    <tbody\n      data-slot=\"table-body\"\n      className={joinClass(\"ui-table__body\", className)}\n      {...props}\n    >\n      {children}\n    </tbody>\n  );\n}\n\nfunction TableRow({\n  className,\n  children,\n  selected,\n  focused,\n  hover = true,\n  height,\n  frozen,\n  frozenOffset = 0,\n  style,\n  ...rowProps\n}: TableRowProps) {\n  return (\n    <tr\n      data-slot=\"table-row\"\n      data-selected={selected ? \"true\" : undefined}\n      data-focused={focused ? \"true\" : undefined}\n      data-hover={hover ? \"true\" : undefined}\n      data-frozen={frozen}\n      aria-selected={selected === undefined ? undefined : selected}\n      className={joinClass(\"ui-table__row\", className)}\n      style={{\n        ...style,\n        ...(height === undefined ? {} : {\n          height: typeof height === \"number\" ? `${height}px` : height,\n          \"--ui-table-row-height\": typeof height === \"number\" ? `${height}px` : height,\n        }),\n        ...(frozen ? { position: \"sticky\", [frozen]: `${Number.isFinite(frozenOffset) ? frozenOffset : 0}px`, zIndex: 2 } : {}),\n      } as React.CSSProperties}\n      {...rowProps}\n    >\n      {children}\n    </tr>\n  );\n}\n\nfunction pinnedStyle(\n  pinned: TablePinned | undefined,\n  offset: number | undefined,\n  style: React.CSSProperties | undefined,\n): React.CSSProperties | undefined {\n  if (!pinned || offset === undefined) return style;\n  return {\n    ...style,\n    [pinned === \"left\" ? \"insetInlineStart\" : \"insetInlineEnd\"]: `${offset}px`,\n  };\n}\n\nfunction TableHead({\n  scope = \"col\",\n  alignment,\n  widthMode,\n  pinned,\n  pinnedOffset,\n  frozenEdge,\n  className,\n  children,\n  style,\n  ...props\n}: TableHeadProps) {\n  return (\n    <th\n      data-slot=\"table-head\"\n      data-align={alignment}\n      data-width-mode={widthMode}\n      data-pinned={pinned}\n      data-frozen-edge={frozenEdge}\n      scope={scope}\n      className={joinClass(\"ui-table__head\", className)}\n      style={pinnedStyle(pinned, pinnedOffset, style)}\n      {...props}\n    >\n      {children}\n      {frozenEdge ? <span aria-hidden=\"true\" className=\"ui-table__frozen-edge\" /> : null}\n    </th>\n  );\n}\n\nfunction TableCell({\n  alignment,\n  widthMode,\n  pinned,\n  pinnedOffset,\n  frozenEdge,\n  className,\n  children,\n  style,\n  ...props\n}: TableCellProps) {\n  return (\n    <td\n      data-slot=\"table-cell\"\n      data-align={alignment}\n      data-width-mode={widthMode}\n      data-pinned={pinned}\n      data-frozen-edge={frozenEdge}\n      className={joinClass(\"ui-table__cell\", className)}\n      style={pinnedStyle(pinned, pinnedOffset, style)}\n      {...props}\n    >\n      {children}\n      {frozenEdge ? <span aria-hidden=\"true\" className=\"ui-table__frozen-edge\" /> : null}\n    </td>\n  );\n}\n\nfunction TableFooter({\n  className,\n  children,\n  ...props\n}: TableSectionProps<\"tfoot\">) {\n  return (\n    <tfoot\n      data-slot=\"table-footer\"\n      className={joinClass(\"ui-table__footer\", className)}\n      {...props}\n    >\n      {children}\n    </tfoot>\n  );\n}\n\nfunction TableCaption({\n  className,\n  children,\n  ...props\n}: TableSectionProps<\"caption\">) {\n  return (\n    <caption\n      data-slot=\"table-caption\"\n      className={joinClass(\"ui-table__caption\", className)}\n      {...props}\n    >\n      {children}\n    </caption>\n  );\n}\n\n/**\n * Quiet data table. The default `ghost` variant draws row dividers only —\n * no grid, no box. The root owns the horizontal-overflow wrapper so long\n * content scrolls instead of breaking layout; the wrapper is a labelled\n * scroll region (`tabIndex={0}`, `role=\"region\"`) so keyboard users can\n * reach overflow. An empty body renders an empty `<tbody>` (docs adapters\n * own the honest empty copy); `Table.EmptyRow` renders the default\n * `role=\"status\"` empty row when the caller wants one.\n *\n * @example\n * ```tsx\n * <Table>\n *   <Table.Caption>Quarterly totals</Table.Caption>\n *   <Table.Header>\n *     <Table.Row>\n *       <Table.Head>Plan</Table.Head>\n *       <Table.Head>Seats</Table.Head>\n *     </Table.Row>\n *   </Table.Header>\n *   <Table.Body>\n *     <Table.Row>\n *       <Table.Head scope=\"row\">Starter</Table.Head>\n *       <Table.Cell>5</Table.Cell>\n *     </Table.Row>\n *   </Table.Body>\n * </Table>\n * ```\n */\nconst TableRoot = React.forwardRef<HTMLDivElement, TableRootProps>(\n  function TableRoot(\n    {\n      variant = \"ghost\",\n      density = \"default\",\n      layout = \"scroll\",\n      headerHeight,\n      rowHeight,\n      cellPaddingInline,\n      headerFontSize,\n      headerFontWeight,\n      className,\n      tableClassName,\n      tableProps,\n      children,\n      tabIndex = 0,\n      role = \"region\",\n      \"aria-label\": ariaLabel,\n      \"aria-labelledby\": ariaLabelledBy,\n      ...props\n    },\n    ref,\n  ) {\n    const [dataWidth, setDataWidth] = React.useState<number>();\n    const wrapperRef = React.useRef<HTMLDivElement>(null);\n    const [pinSuspended, setPinSuspended] = React.useState(false);\n    React.useImperativeHandle(ref, () => wrapperRef.current!, []);\n    React.useLayoutEffect(() => {\n      const wrapper = wrapperRef.current,\n        table = wrapper?.querySelector(\"table\");\n      if (!wrapper || !table) return;\n      const measure = () => {\n        const heads = Array.from(\n          table.querySelectorAll<HTMLTableCellElement>(\n            \"thead tr:last-child th\",\n          ),\n        );\n        const pinnedHeads = heads.filter((head) => head.dataset.pinned);\n        if (!pinnedHeads.length) { setPinSuspended(false); return; }\n        const pinned = pinnedHeads\n          .reduce(\n            (total, head) => total + head.getBoundingClientRect().width,\n            0,\n          );\n        const free = heads\n          .filter((head) => !head.dataset.pinned)\n          .map((head) => head.getBoundingClientRect().width)\n          .filter((width) => width > 0);\n        setPinSuspended(\n          pinned > 0 &&\n            free.length > 0 &&\n            wrapper.clientWidth > 0 &&\n            // A wide scrollable middle column need not fit in full beside pins.\n            // Suspend only when there is no useful strip left to inspect it.\n            pinned + Math.min(96, ...free) > wrapper.clientWidth,\n        );\n      };\n      let frame = 0;\n      const schedule = () => {\n        if (!frame) frame = requestAnimationFrame(() => { frame = 0; measure(); });\n      };\n      measure();\n      if (typeof ResizeObserver === \"undefined\") return;\n      const observer = new ResizeObserver(schedule);\n      const mutations = new MutationObserver(schedule);\n      observer.observe(wrapper);\n      observer.observe(table);\n      mutations.observe(table, { childList: true, subtree: true, attributes: true, attributeFilter: [\"data-pinned\"] });\n      return () => { cancelAnimationFrame(frame); observer.disconnect(); mutations.disconnect(); };\n    }, []);\n\n    const {\n      ref: tableRef,\n      className: nativeTableClassName,\n      children: nativeTableChildren,\n      style: nativeTableStyle,\n      ...nativeTableProps\n    } = tableProps ?? {};\n    const tableStyle = {\n      ...(dataWidth === undefined\n        ? {}\n        : { width: dataWidth, minWidth: 0, tableLayout: \"fixed\" as const }),\n      ...(headerHeight === undefined\n        ? {}\n        : {\n            \"--ui-table-header-height\":\n              typeof headerHeight === \"number\"\n                ? `${headerHeight}px`\n                : headerHeight,\n          }),\n      ...(rowHeight === undefined\n        ? {}\n        : {\n            \"--ui-table-row-height\":\n              typeof rowHeight === \"number\" ? `${rowHeight}px` : rowHeight,\n          }),\n      ...(cellPaddingInline === undefined\n        ? {}\n        : {\n            \"--ui-table-cell-padding-inline\":\n              typeof cellPaddingInline === \"number\"\n                ? `${cellPaddingInline}px`\n                : cellPaddingInline,\n          }),\n      ...(headerFontSize === undefined\n        ? {}\n        : {\n            \"--ui-table-header-font-size\":\n              typeof headerFontSize === \"number\"\n                ? `${headerFontSize}px`\n                : headerFontSize,\n          }),\n      ...(headerFontWeight === undefined\n        ? {}\n        : { \"--ui-table-header-font-weight\": String(headerFontWeight) }),\n      ...nativeTableStyle,\n    } as React.CSSProperties;\n    return (\n      <TableSizingContext.Provider value={setDataWidth}>\n        <div\n          data-slot=\"table-wrapper\"\n          data-variant={variant}\n          data-density={density}\n          className={joinClass(\n            \"ui-table-wrap\",\n            layout !== \"scroll\" ? \"ui-table-wrap--wrap\" : undefined,\n            className,\n          )}\n          data-layout={layout}\n          data-pin-suspended={pinSuspended || undefined}\n          tabIndex={tabIndex}\n          role={role}\n          aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? \"Table\")}\n          aria-labelledby={ariaLabelledBy}\n          ref={wrapperRef}\n          {...props}\n        >\n          <SharedBackground\n            className=\"ui-table__feedback\"\n            targetSelector='tbody > tr[data-hover=\"true\"]:not([data-selected=\"true\"]):not(:has([data-editing]))'\n            surface=\"secondary\"\n            inset={0}\n          >\n            <table\n              data-slot=\"table\"\n              className={joinClass(\n                \"ui-table\",\n                tableClassName,\n                nativeTableClassName,\n              )}\n              ref={tableRef}\n              style={tableStyle}\n              {...nativeTableProps}\n            >\n              {nativeTableChildren}\n              {children}\n            </table>\n          </SharedBackground>\n        </div>\n      </TableSizingContext.Provider>\n    );\n  },\n);\n\nconst TableSizingContext = React.createContext<\n  ((width: number | undefined) => void) | null\n>(null);\nfunction TableSizing({ width }: { width: number | undefined }) {\n  const setWidth = React.useContext(TableSizingContext);\n  React.useLayoutEffect(() => {\n    setWidth?.(width);\n    return () => setWidth?.(undefined);\n  }, [setWidth, width]);\n  return null;\n}\n\nexport interface TableDataProps<\n  TFeatures extends TableFeatures,\n  TData extends RowData,\n> {\n  table: ReactTable<TFeatures, TData, unknown>;\n  className?: string;\n  /** Empty message or renderer. It spans all currently visible leaf columns. */\n  emptyContent?: React.ReactNode;\n  /** Render footer groups when the configured column definitions provide them. */\n  showFooter?: boolean;\n  getRowProps?: (row: Row<TFeatures, TData>) => Partial<TableRowProps>;\n  getHeaderProps?: (\n    header: Header<TFeatures, TData, unknown>,\n  ) => Partial<Omit<TableHeadProps, \"pinned\" | \"pinnedOffset\">>;\n  getCellProps?: (\n    cell: Cell<TFeatures, TData, unknown>,\n  ) => Partial<Omit<TableCellProps, \"pinned\" | \"pinnedOffset\">>;\n}\n\nfunction columnGeometry<TFeatures extends TableFeatures, TData extends RowData>(\n  column: Column<TFeatures, TData, unknown>,\n) {\n  const sized = column as typeof column & {\n    getSize?: () => number;\n    getStart?: (side?: \"start\" | \"end\") => number;\n    getAfter?: (side?: \"start\" | \"end\") => number;\n    getIsPinned?: () => \"start\" | \"end\" | false;\n  };\n  const side = sized.getIsPinned?.();\n  return {\n    pinned: (side === \"start\"\n      ? \"left\"\n      : side === \"end\"\n        ? \"right\"\n        : undefined) as TablePinned | undefined,\n    offset:\n      side === \"start\"\n        ? sized.getStart?.(\"start\")\n        : side === \"end\"\n          ? sized.getAfter?.(\"end\")\n          : undefined,\n    width: sized.getSize?.(),\n  };\n}\n\n/** Render a caller-owned TanStack v9 table instance with the canonical Table parts. */\nfunction TableData<TFeatures extends TableFeatures, TData extends RowData>({\n  table,\n  className,\n  emptyContent = \"No rows to show.\",\n  showFooter = false,\n  getRowProps,\n  getHeaderProps,\n  getCellProps,\n}: TableDataProps<TFeatures, TData>) {\n  return (\n    <table.Subscribe selector={(state) => state}>\n      {(state) => {\n        const headerGroups = table.getHeaderGroups();\n        const rows = table.getRowModel().rows;\n        const visibilityTable = table as typeof table & {\n          getVisibleLeafColumns?: () => Column<TFeatures, TData, unknown>[];\n        };\n        const visibleColumns =\n          visibilityTable.getVisibleLeafColumns?.() ??\n          visibilityTable\n            .getAllLeafColumns()\n            .filter((column) => (column as typeof column & { getIsVisible?: () => boolean }).getIsVisible?.() !== false);\n        // The library's 150px fallback is not an authored width. Only actual\n        // definitions or caller sizing state opt a column into pixel geometry.\n        const authored = new Set<string>();\n        const collect = (definitions: ReadonlyArray<{ id?: string; accessorKey?: unknown; header?: unknown; size?: number; columns?: unknown }>): void => {\n          for (const definition of definitions) {\n            if (definition.columns) collect(definition.columns as Parameters<typeof collect>[0]);\n            if (typeof definition.size === \"number\" && Number.isFinite(definition.size)) {\n              const id = definition.id ?? (typeof definition.accessorKey === \"string\" ? definition.accessorKey.replaceAll(\".\", \"_\") : typeof definition.header === \"string\" ? definition.header : undefined);\n              if (id) authored.add(id);\n            }\n          }\n        };\n        collect(table.options.columns as Parameters<typeof collect>[0]);\n        const sizingState = (state as { columnSizing?: Record<string, number> }).columnSizing;\n        const defaultSize = (table.options.defaultColumn as { size?: number } | undefined)?.size;\n        const numericWidth = (column: Column<TFeatures, TData, unknown>) => {\n          const hasSize = authored.has(column.id) || Number.isFinite(sizingState?.[column.id]) || Number.isFinite(defaultSize);\n          return hasSize ? columnGeometry(column).width ?? (column.columnDef as { size?: number }).size : undefined;\n        };\n        const firstDataColumn = visibleColumns.find(column => column.accessorFn)?.id;\n        const visibleIds = new Set(visibleColumns.map(column => column.id));\n        const pinning = (state as { columnPinning?: { start?: string[]; end?: string[] } }).columnPinning;\n        const lastStart = pinning?.start?.filter(id => visibleIds.has(id)).at(-1);\n        const firstEnd = pinning?.end?.find(id => visibleIds.has(id));\n        // Boundary detection must work without the optional ordering feature.\n        const edge = (column: Column<TFeatures, TData, unknown>) =>\n          column.id === lastStart ? \"start\" as const : column.id === firstEnd ? \"end\" as const : undefined;\n        const mode = (column: Column<TFeatures, TData, unknown>) =>\n          (column.columnDef.meta as TableColumnMeta | undefined)?.widthMode ?? (column.id === firstDataColumn ? \"fill\" : \"fit\");\n        const dataWidth = visibleColumns.length && visibleColumns.every(column => numericWidth(column) !== undefined)\n          ? visibleColumns.reduce((sum, column) => sum + numericWidth(column)!, 0)\n          : undefined;\n        return (\n          <>\n            <TableSizing width={dataWidth || undefined} />\n            <TableHeader className={className}>\n              {headerGroups.map((group) => (\n                <TableRow key={group.id}>\n                  {group.headers.map((header) => {\n                    const meta = header.column.columnDef.meta as\n                      | TableColumnMeta\n                      | undefined;\n                    const props =\n                      getHeaderProps?.(\n                        header as Header<TFeatures, TData, unknown>,\n                      ) ?? {};\n                    const { pinned, offset } = columnGeometry(\n                      header.column,\n                    );\n                    const width = numericWidth(header.column);\n                    return (\n                      <TableHead\n                        key={header.id}\n                        colSpan={header.colSpan}\n                        scope={header.colSpan > 1 ? \"colgroup\" : \"col\"}\n                        {...props}\n                        aria-sort={\n                          props[\"aria-sort\"] ??\n                          ((\n                            header.column as typeof header.column & {\n                              getIsSorted?: () => false | \"asc\" | \"desc\";\n                            }\n                          ).getIsSorted?.() === \"asc\"\n                            ? \"ascending\"\n                            : (\n                                  header.column as typeof header.column & {\n                                    getIsSorted?: () => false | \"asc\" | \"desc\";\n                                  }\n                                ).getIsSorted?.() === \"desc\"\n                              ? \"descending\"\n                              : undefined)\n                        }\n                        alignment={props.alignment ?? meta?.alignment}\n                        widthMode={props.widthMode ?? mode(header.column)}\n                        pinned={pinned}\n                        pinnedOffset={offset}\n                        frozenEdge={props.frozenEdge ?? edge(header.column)}\n                        style={{\n                          ...props.style,\n                          ...(width === undefined ? {} : { width }),\n                        }}\n                      >\n                        {props.children !== undefined ? props.children : header.isPlaceholder ? null : (\n                          <table.FlexRender header={header} />\n                        )}\n                      </TableHead>\n                    );\n                  })}\n                </TableRow>\n              ))}\n            </TableHeader>\n            <TableBody>\n              {rows.length === 0 ? (\n                <TableEmptyRow colSpan={Math.max(1, visibleColumns.length)}>\n                  {emptyContent}\n                </TableEmptyRow>\n              ) : (\n                rows.map((row) => {\n                  const props = getRowProps?.(row) ?? {};\n                  const rowWithFeatures = row as typeof row & {\n                    getIsSelected?: () => boolean;\n                    getVisibleCells?: () => Cell<TFeatures, TData, unknown>[];\n                  };\n                  return (\n                    <TableRow\n                      key={row.id}\n                      selected={\n                        props.selected ?? rowWithFeatures.getIsSelected?.()\n                      }\n                      {...props}\n                    >\n                      {(\n                        rowWithFeatures.getVisibleCells?.() ?? row.getAllCells()\n                      ).map((cell) => {\n                        const meta = cell.column.columnDef.meta as\n                          | TableColumnMeta\n                          | undefined;\n                        const cellProps =\n                          getCellProps?.(\n                            cell as Cell<TFeatures, TData, unknown>,\n                          ) ?? {};\n                        const { pinned, offset } = columnGeometry(\n                          cell.column,\n                        );\n                        const width = numericWidth(cell.column);\n                        return (\n                          <TableCell\n                            key={cell.id}\n                            {...cellProps}\n                            alignment={cellProps.alignment ?? meta?.alignment}\n                            widthMode={cellProps.widthMode ?? mode(cell.column)}\n                            pinned={pinned}\n                            pinnedOffset={offset}\n                            frozenEdge={cellProps.frozenEdge ?? edge(cell.column)}\n                            style={{\n                              ...cellProps.style,\n                              ...(width === undefined ? {} : { width }),\n                            }}\n                          >\n                            {cellProps.children ?? <table.FlexRender cell={cell} />}\n                          </TableCell>\n                        );\n                      })}\n                    </TableRow>\n                  );\n                })\n              )}\n            </TableBody>\n            {showFooter ? (\n              <TableFooter>\n                {table.getFooterGroups().map((group) => (\n                  <TableRow key={group.id}>\n                    {group.headers.map((header) => (\n                      <TableCell\n                        key={header.id}\n                        colSpan={header.colSpan}\n                        alignment={\n                          (\n                            header.column.columnDef.meta as\n                              | TableColumnMeta\n                              | undefined\n                          )?.alignment\n                        }\n                      >\n                        {header.isPlaceholder ? null : (\n                          <table.FlexRender footer={header} />\n                        )}\n                      </TableCell>\n                    ))}\n                  </TableRow>\n                ))}\n              </TableFooter>\n            ) : null}\n          </>\n        );\n      }}\n    </table.Subscribe>\n  );\n}\n\nexport const Table = Object.assign(TableRoot, {\n  Root: TableRoot,\n  Header: TableHeader,\n  Body: TableBody,\n  Row: TableRow,\n  Head: TableHead,\n  Cell: TableCell,\n  Footer: TableFooter,\n  Data: TableData,\n  Caption: TableCaption,\n  EmptyRow: TableEmptyRow,\n  ResizeHandle: TableResizeHandle,\n});\n\nexport {\n  TableRoot,\n  TableHeader,\n  TableBody,\n  TableRow,\n  TableHead,\n  TableCell,\n  TableFooter,\n  TableCaption,\n  TableEmptyRow,\n  TableData,\n  TableResizeHandle,\n};\nexport type { TableResizeHandleProps } from \"./table-resize-handle\";\n"
    },
    {
      "path": "src/components/ui/table.css",
      "type": "registry:file",
      "target": "@ui/table.css",
      "content": "/* Public Table: quiet, borderless data surface on semantic tokens only. */\n@import \"./resize-grip.css\";\n@import \"./frozen-surface.css\";\n@import \"./data-view.css\";\n\n.ui-table-wrap {\n  box-sizing: border-box;\n  width: 100%;\n  min-width: 0;\n  overflow-x: auto;\n  font-family: var(--font-sans);\n  background: transparent;\n  border-top: 1px solid var(--border);\n}\n\n.ui-table-wrap[data-variant=\"outline\"] {\n  border: 1px solid var(--border);\n  border-radius: var(--radius-surface);\n}\n\n.ui-table-wrap[data-variant=\"outline\"] .ui-table {\n  overflow: hidden;\n}\n\n.ui-table__feedback {\n  --ui-table-hover-radius: min(\n    var(--radius-control-base, 12px),\n    var(--ui-table-cell-padding-inline, var(--space-4)),\n    max(0px, calc((var(--ui-shared-background-target-height, 40px) - 8px) * .375))\n  );\n  display: block;\n  position: relative;\n  width: 100%;\n  min-width: 100%;\n  background: transparent;\n}\n\n.ui-table__feedback > .ui-shared-background__pill {\n  z-index: 0;\n  border-radius: 0;\n  clip-path: inset(4px round var(--ui-table-hover-radius));\n  transition-property: opacity;\n  pointer-events: none;\n}\n.ui-table__feedback:not(:has(tbody > tr:hover)):has([data-slot=\"table-tree-trigger\"]:focus:not(:focus-visible)) > .ui-shared-background__pill { opacity: 0; }\n\n/* A Table fills its host; prose reading measures must not cap the data surface. */\n.ui-table-wrap .ui-table { max-width: none; }\n\n.ui-table {\n  width: 100%;\n  min-width: 100%;\n  border-collapse: separate;\n  border-spacing: 0;\n  font-size: var(--font-size-base);\n  line-height: calc(var(--font-size-base) * 10 / 7);\n  color: var(--foreground);\n}\n\n.ui-table__caption {\n  padding: var(--space-2) var(--ui-table-cell-padding-inline, var(--space-4));\n  font-size: var(--font-size-xs);\n  color: var(--muted-foreground);\n  text-align: left;\n  caption-side: top;\n}\n\n.ui-table__head,\n.ui-table__cell {\n  box-sizing: border-box;\n  min-width: 0;\n  position: relative;\n  height: var(--ui-table-row-height, var(--space-10));\n  padding: 0 var(--ui-table-cell-padding-inline, var(--space-4));\n  text-align: left;\n  vertical-align: middle;\n  white-space: nowrap;\n  background: transparent;\n  font-size: var(--font-size-base);\n  font-weight: var(--font-weight-regular);\n  line-height: calc(var(--font-size-base) * 10 / 7);\n}\n\n.ui-table__head[data-align=\"center\"],\n.ui-table__cell[data-align=\"center\"] {\n  text-align: center;\n}\n\n.ui-table__head[data-align=\"end\"],\n.ui-table__cell[data-align=\"end\"],\n.ui-table__head[data-align=\"numeric\"],\n.ui-table__cell[data-align=\"numeric\"] {\n  text-align: end;\n}\n\n.ui-table__head[data-align=\"numeric\"],\n.ui-table__cell[data-align=\"numeric\"] {\n  font-variant-numeric: tabular-nums;\n}\n\n.ui-table__head[data-pinned],\n.ui-table__cell[data-pinned] {\n  position: sticky;\n  z-index: 1;\n  background: var(--ui-table-row-surface, var(--background));\n}\n\n.ui-table__head[data-pinned=\"left\"],\n.ui-table__cell[data-pinned=\"left\"] {\n  inset-inline-start: 0;\n}\n\n.ui-table__head[data-pinned=\"right\"],\n.ui-table__cell[data-pinned=\"right\"] {\n  inset-inline-end: 0;\n}\n\n.ui-table__head {\n  height: var(--ui-table-header-height, var(--space-10));\n  font-size: var(--ui-table-header-font-size, var(--font-size-xs));\n  font-weight: var(--ui-table-header-font-weight, var(--font-weight-regular));\n  color: var(--muted-foreground);\n  line-height: calc(var(--font-size-xs) * 1.5);\n}\n\n.ui-table-wrap[data-density=\"dense\"] {\n  --ui-table-row-height: var(--space-8);\n}\n\n.ui-table-wrap[data-density=\"relaxed\"] {\n  --ui-table-row-height: calc(var(--space-12) + var(--space-1));\n}\n\n.ui-table__row > .ui-table__cell,\n.ui-table__row > .ui-table__head {\n  border-bottom: 1px solid var(--border);\n}\n\n.ui-table__body > .ui-table__row:last-child > .ui-table__cell,\n.ui-table__body > .ui-table__row:last-child > .ui-table__head {\n  border-bottom: 0;\n}\n\n.ui-table-wrap[data-variant=\"zebra\"]\n  .ui-table__body\n  .ui-table__row:nth-child(even) {\n  --ui-table-row-surface: color-mix(in srgb, var(--secondary) 50%, var(--background));\n}\n\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) {\n  --ui-table-row-surface: var(--background);\n}\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell):not([data-pinned]):not([data-editing]) {\n  background: transparent;\n}\n\n.ui-table__row[data-selected=\"true\"] {\n  --ui-table-row-state-fill: var(--secondary);\n}\n.ui-table__row[data-focused=\"true\"] {\n  --ui-table-row-state-stroke: var(--ring);\n}\n.ui-table__row:is([data-selected=\"true\"], [data-focused=\"true\"]) {\n  --ui-table-row-state-radius: min(var(--radius-control-base, 12px), var(--ui-table-cell-padding-inline, var(--space-4)), max(0px, calc((var(--ui-table-row-height, 40px) - 8px) * .375)));\n}\n.ui-table__row:is([data-selected=\"true\"], [data-focused=\"true\"]) > :is(.ui-table__cell, .ui-table__head):not([data-editing]) {\n  isolation: isolate;\n}\n.ui-table__row:is([data-selected=\"true\"], [data-focused=\"true\"]) > :is(.ui-table__cell, .ui-table__head):not([data-editing])::after {\n  position: absolute;\n  z-index: -1;\n  inset-block: 4px;\n  inset-inline: 0;\n  border-block: 1px solid var(--ui-table-row-state-stroke, transparent);\n  background: var(--ui-table-row-state-fill, transparent);\n  content: \"\";\n  pointer-events: none;\n}\n.ui-table__row:is([data-selected=\"true\"], [data-focused=\"true\"]) > :is(.ui-table__cell, .ui-table__head):first-child::after {\n  inset-inline-start: 4px;\n  border-inline-start: 1px solid var(--ui-table-row-state-stroke, transparent);\n  border-start-start-radius: var(--ui-table-row-state-radius);\n  border-end-start-radius: var(--ui-table-row-state-radius);\n}\n.ui-table__row:is([data-selected=\"true\"], [data-focused=\"true\"]) > :is(.ui-table__cell, .ui-table__head):last-child::after {\n  inset-inline-end: 4px;\n  border-inline-end: 1px solid var(--ui-table-row-state-stroke, transparent);\n  border-start-end-radius: var(--ui-table-row-state-radius);\n  border-end-end-radius: var(--ui-table-row-state-radius);\n}\n\n.ui-table__footer > .ui-table__row > .ui-table__cell,\n.ui-table__footer > .ui-table__row > .ui-table__head {\n  border-top: 1px solid var(--border);\n  border-bottom: 0;\n  font-weight: var(--font-weight-regular);\n}\n\n/* The docs/API mode keeps the identifying first column readable and gives\n   every later column permission to wrap within the available width. */\n.ui-table-wrap--wrap .ui-table__head,\n.ui-table-wrap--wrap .ui-table__cell {\n  white-space: normal;\n  overflow-wrap: anywhere;\n  word-break: break-word;\n}\n\n.ui-table-wrap--wrap .ui-table__head:first-child,\n.ui-table-wrap--wrap .ui-table__cell:first-child {\n  width: 1%;\n  white-space: nowrap;\n  overflow-wrap: normal;\n  word-break: normal;\n}\n\n.ui-table__empty-row > td {\n  padding: calc(var(--space-1) * 2) calc(var(--space-1) * 3);\n  color: var(--muted-foreground);\n  overflow-wrap: anywhere;\n}\n\n.ui-table__cell code:not(:where(.ui-table__cell .typeset *)),\n.ui-table__head code:not(:where(.ui-table__head .typeset *)) {\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: calc(1em * var(--font-mono-scale));\n}\n.ui-table__cell pre code,\n.ui-table__head pre code { font-size: inherit; }\n\n.ui-table-wrap:focus-visible {\n  outline: var(--focus-border-width) solid var(--ring);\n  outline-offset: var(--focus-outline-offset);\n}\n\n.ui-table__body .ui-table__head {\n  height: var(--ui-table-row-height, var(--space-10));\n  color: var(--foreground);\n  font-size: var(--font-size-base);\n  font-weight: var(--font-weight-regular);\n  line-height: calc(var(--font-size-base) * 10 / 7);\n}\n\n.ui-table-wrap--wrap .ui-table {\n  width: 100%;\n  min-width: 0;\n}\n\n.ui-table-wrap[data-pin-suspended]\n  :is(.ui-table__head, .ui-table__cell)[data-pinned] {\n  position: static;\n  box-shadow: none;\n}\n\n.ui-table__frozen-edge {\n  position: absolute;\n  inset-block: 0 -1px;\n  width: 6px;\n  pointer-events: none;\n}\n[data-frozen-edge=\"start\"] > .ui-table__frozen-edge { inset-inline-end: -6px; background: var(--ui-frozen-gradient-start); }\n[data-frozen-edge=\"end\"] > .ui-table__frozen-edge { inset-inline-start: -6px; background: var(--ui-frozen-gradient-end); }\n.ui-table-wrap[data-pin-suspended] .ui-table__frozen-edge { display: none; }\n\n.ui-table__row[data-frozen=\"top\"] > :is(.ui-table__head, .ui-table__cell),\n.ui-table__row[data-frozen=\"bottom\"] > :is(.ui-table__head, .ui-table__cell) {\n  background: var(--ui-table-row-surface, var(--background));\n}\n.ui-table__row[data-frozen]::after {\n  position: absolute;\n  inset-inline: 0;\n  height: 6px;\n  content: \"\";\n  pointer-events: none;\n}\n.ui-table__row[data-frozen=\"top\"]::after { bottom: -6px; background: linear-gradient(to bottom, var(--ui-frozen-edge-tint), transparent); }\n.ui-table__row[data-frozen=\"bottom\"]::after { top: -6px; background: linear-gradient(to top, var(--ui-frozen-edge-tint), transparent); }\n\n/* Sticky cells keep an opaque surface while matching the shared inset band. */\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell)[data-pinned] {\n  isolation: isolate;\n}\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell)[data-pinned]::before {\n  position: absolute;\n  z-index: -1;\n  inset: 4px 0;\n  border-radius: 0;\n  background: var(--secondary);\n  content: \"\";\n  pointer-events: none;\n}\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell)[data-pinned]:first-child::before {\n  inset-inline-start: 4px;\n  border-start-start-radius: min(var(--ui-table-hover-radius), calc((100% - 8px) / 2));\n  border-end-start-radius: min(var(--ui-table-hover-radius), calc((100% - 8px) / 2));\n}\n.ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell)[data-pinned]:last-child::before {\n  inset-inline-end: 4px;\n  border-start-end-radius: min(var(--ui-table-hover-radius), calc((100% - 8px) / 2));\n  border-end-end-radius: min(var(--ui-table-hover-radius), calc((100% - 8px) / 2));\n}\n.ui-table-wrap[data-pin-suspended] .ui-table__body .ui-table__row[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell)[data-pinned] { background: transparent; }\n.ui-table-wrap[data-pin-suspended] .ui-table__body .ui-table__row > [data-pinned]::before { display: none; }\n.ui-table__body .ui-table__row:has([data-editing]) > [data-pinned]::before { display: none; }\n\n.ui-table input[type=\"checkbox\"] {\n  display: inline-flex;\n  vertical-align: middle;\n}\n.ui-table__head:has(input[type=\"checkbox\"]),\n.ui-table__cell:has(input[type=\"checkbox\"]) { vertical-align: middle; }\n\n.ui-table__head:has([data-slot=\"table-sort-trigger\"]) { padding-inline: 0; }\n.ui-table [data-slot=\"table-sort-trigger\"] {\n  display: flex;\n  position: relative;\n  z-index: 1;\n  width: 100%;\n  max-width: none;\n  height: calc(var(--ui-table-header-height, 40px) - 1px);\n  min-height: 0;\n  margin-inline: 0;\n  align-items: center;\n  justify-content: flex-start;\n  gap: 6px;\n  padding: 0 var(--ui-table-cell-padding-inline, var(--space-4));\n  border: 0;\n  border-radius: 0;\n  background: transparent;\n  color: inherit;\n  font-family: inherit;\n  font-size: var(--font-size-xs);\n  font-weight: var(--font-weight-regular);\n  line-height: calc(var(--font-size-xs) * 1.5);\n  text-align: inherit;\n  cursor: pointer;\n}\n.ui-table [data-slot=\"table-sort-trigger\"] > .ui-table__sort-label {\n  flex: 1 1 0%;\n  min-width: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n.ui-table [data-slot=\"table-sort-trigger\"] > .ui-button-icon:last-child {\n  flex: 0 0 var(--icon-size);\n  margin-inline-start: auto;\n  opacity: 0;\n}\n.ui-table__head:is(:hover, :focus-within) [data-slot=\"table-sort-trigger\"] > .ui-button-icon:last-child,\n.ui-table__head[aria-sort=\"ascending\"] [data-slot=\"table-sort-trigger\"] > .ui-button-icon:last-child,\n.ui-table__head[aria-sort=\"descending\"] [data-slot=\"table-sort-trigger\"] > .ui-button-icon:last-child { opacity: 1; }\n@media (pointer: coarse) {\n  .ui-table [data-slot=\"table-sort-trigger\"] > .ui-button-icon:last-child { opacity: 1; }\n}\n.ui-table [data-slot=\"table-sort-trigger\"] svg {\n  box-sizing: border-box;\n  width: var(--icon-size);\n  min-width: var(--icon-size);\n  height: var(--icon-size);\n}\n.ui-table__header .ui-table__head:has([data-slot=\"table-sort-trigger\"])::before {\n  position: absolute;\n  inset: 0;\n  border-radius: 0;\n  background: var(--secondary);\n  opacity: 0;\n  content: \"\";\n  pointer-events: none;\n}\n.ui-table__header .ui-table__head:is(:hover, :focus-within):has([data-slot=\"table-sort-trigger\"])::before { opacity: 1; }\n.ui-table [data-slot=\"table-sort-trigger\"][data-variant=\"ghost\"]:is(:hover, :active, :focus-visible) { background: transparent; box-shadow: none; }\n.ui-table__head[data-align=\"end\"] [data-slot=\"table-sort-trigger\"],\n.ui-table__head[data-align=\"numeric\"] [data-slot=\"table-sort-trigger\"] {\n  justify-content: flex-end;\n}\n.ui-table [data-slot=\"table-sort-trigger\"]:focus-visible,\n.ui-table [data-slot=\"table-group-trigger\"]:focus-visible {\n  outline: var(--focus-border-width) solid var(--ring);\n  outline-offset: var(--focus-outline-offset);\n}\n\n.ui-table__row [data-slot=\"table-group-trigger\"] {\n  display: flex;\n  width: 100%;\n  min-height: var(--ui-table-row-height, var(--space-10));\n  align-items: center;\n  justify-content: flex-start;\n  gap: var(--space-2);\n  padding: 0 var(--ui-table-cell-padding-inline, var(--space-4));\n  border: 0;\n  background: transparent;\n  color: var(--muted-foreground);\n  font-family: inherit;\n  font-size: var(--font-size-base);\n  font-weight: var(--font-weight-regular);\n  line-height: calc(var(--font-size-base) * 10 / 7);\n  text-align: start;\n  cursor: pointer;\n}\n.ui-table .ui-table__row [data-slot=\"table-group-trigger\"] svg { transform: none; }\n.ui-table__row[data-slot=\"table-group-row\"] > :is(.ui-table__head, .ui-table__cell) { background: var(--background-primary-subtle); }\n.ui-table > tbody.ui-collapsible[data-variant=\"plain\"] { display: table-row-group; }\n.ui-table [data-slot=\"table-column-field-icon\"] svg,\n.ui-table [data-slot=\"table-column-sort-status\"] svg { display: block; width: var(--icon-size); height: var(--icon-size); stroke-width: var(--icon-stroke); }\n.ui-table [data-slot=\"table-column-sort-status\"] { opacity: 0; }\n.ui-table__head:is(:hover, :focus-within, [aria-sort=\"ascending\"], [aria-sort=\"descending\"]) [data-slot=\"table-column-sort-status\"] { opacity: 1; }\n@media (pointer: coarse) { .ui-table [data-slot=\"table-column-sort-status\"] { opacity: 1; } }\n.ui-table [data-slot=\"table-group-trigger\"] svg,\n.ui-table [data-slot=\"table-tree-trigger\"] svg,\n.ui-table [data-slot=\"table-tree-connector\"] { flex-shrink: 0; width: 12px; height: 12px; stroke-width: var(--icon-stroke); color: var(--muted-foreground); }\n.ui-table [data-slot=\"table-tree-trigger\"],\n.ui-table [data-slot=\"table-tree-disclosure-slot\"] { flex: 0 0 20px; }\n.ui-table [data-slot=\"table-tree-trigger\"]:focus-visible { outline: 1px solid var(--ring); outline-offset: var(--focus-outline-offset); border-radius: 4px; }\n.ui-table__row[data-tree-expanded=\"true\"] > :is(.ui-table__head, .ui-table__cell) { background: var(--secondary); }\n.ui-table [data-slot=\"table-cell-error-trigger\"] svg { stroke-width: var(--icon-stroke); }\n.ui-table__row [data-slot=\"table-group-trigger\"]:is(:hover, :focus-visible) { background: var(--secondary); }\n.ui-table .ui-collapsible .ui-disclosure { color: var(--foreground); font-size: var(--font-size-base); font-weight: var(--font-weight-regular); }\n.ui-table .ui-collapsible .ui-disclosure > svg { color: var(--muted-foreground); stroke: currentColor; stroke-width: var(--icon-stroke); }\n\n.ui-table__cell[data-editing] { padding: 0; }\n.ui-table__cell[data-editing] {\n  outline: 1px solid var(--ring);\n  outline-offset: -1px;\n  background: color-mix(in srgb, var(--primary) 5%, var(--background));\n}\n.ui-table__cell[data-invalid] { outline-color: var(--destructive); background: color-mix(in srgb, var(--destructive) 8%, var(--background)); color: var(--destructive); }\n.ui-table__cell[data-invalid] [data-slot=\"table-cell-editor\"] { color: var(--destructive); }\n.ui-table [data-slot=\"table-cell-editor-wrap\"] { display: flex; position: relative; align-items: center; width: 100%; min-width: 0; min-height: calc(var(--ui-table-row-height, 40px) - 1px); }\n.ui-table [data-slot=\"table-cell-editor-wrap\"] [data-slot=\"table-cell-editor\"] { padding-inline: var(--space-2); text-align: end; }\n.ui-table [data-slot=\"table-cell-editor-wrap\"]:has([data-slot=\"table-cell-error-trigger\"]) [data-slot=\"table-cell-editor\"] { padding-inline-end: calc(var(--icon-size) + var(--space-2) * 2); }\n.ui-table [data-slot=\"table-cell-error-trigger\"] { position: absolute; inset-inline-end: var(--space-2); top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: var(--icon-size); height: var(--icon-size); padding: 0; border: 0; background: transparent; color: var(--destructive); cursor: help; }\n.ui-table [data-slot=\"table-cell-error-trigger\"] svg { display: block; width: var(--icon-size); height: var(--icon-size); }\n.ui-table [data-slot=\"table-cell-editor\"] {\n  display: block;\n  box-sizing: border-box;\n  width: 100%;\n  min-width: 0;\n  height: 100%;\n  margin: 0;\n  padding: 0 var(--ui-table-cell-padding-inline, var(--space-4));\n  border: 0;\n  border-radius: 0;\n  background: transparent;\n  color: inherit;\n  font: inherit;\n  outline: none;\n}\n\n.ui-table__resize-handle {\n  position: absolute;\n  inset-block: 0;\n  inset-inline-end: calc(var(--space-3) / -2);\n  z-index: 3;\n  display: inline-flex;\n  flex: 0 0 auto;\n  align-items: center;\n  justify-content: center;\n  width: var(--space-3);\n  height: 100%;\n  min-height: var(--space-6);\n  padding: 0;\n  border: 0;\n  background: transparent;\n  color: var(--muted-foreground);\n  opacity: 0;\n  cursor: col-resize;\n  touch-action: none;\n}\n.ui-table__resize-handle[data-axis=\"row\"] {\n  inset-block-start: auto;\n  inset-block-end: calc(var(--space-3) / -2);\n  inset-inline: 0;\n  width: 100%;\n  height: var(--space-3);\n  min-height: 0;\n  cursor: row-resize;\n}\n.ui-table__resize-handle::before {\n  display: none;\n}\n.ui-table__resize-handle[data-axis=\"row\"]::before {\n  width: var(--font-size-base);\n  height: 1px;\n}\n.ui-table__resize-handle:hover::before,\n.ui-table__resize-handle:focus-visible::before { opacity: 1; }\n.ui-table__resize-handle:is(:hover, :focus-visible, [data-resizing]) { opacity: 1; }\n.ui-table__resize-handle[data-resizing] { outline: none; }\n.ui-table__resize-handle[data-axis=\"column\"][data-resizing] { inset-block-end: auto; height: var(--ui-resize-guide-size, 100%); }\n.ui-table__resize-handle:focus-visible:not([data-resizing]) { outline: none; }\n\n/* Intrinsic columns remain compact; the chosen content column receives space. */\n.ui-table__header .ui-table__head:not(:first-child):not([data-width-mode=\"fill\"]),\n.ui-table :is(.ui-table__head, .ui-table__cell)[data-width-mode=\"fit\"] { width: 1%; }\n.ui-table :is(.ui-table__head, .ui-table__cell)[data-width-mode=\"fill\"] { width: auto; }\n\n/* A translucent stripe over the same secondary moving layer never darkens hover. */\n.ui-table-wrap[data-variant=\"zebra\"] .ui-table__body .ui-table__row:nth-child(even):not([data-selected=\"true\"]) > :is(.ui-table__head, .ui-table__cell):not([data-pinned]):not([data-editing]) {\n  background: color-mix(in srgb, var(--secondary) 50%, transparent);\n}\n.ui-table-wrap[data-variant=\"zebra\"] .ui-table__body .ui-table__row:nth-child(even)[data-hover=\"true\"]:not([data-selected=\"true\"]):is(:hover, :focus-within) > :is(.ui-table__head, .ui-table__cell):not([data-pinned]):not([data-editing]) {\n  background: transparent;\n}\n.ui-table__head:has([data-slot=\"table-group-trigger\"]) { padding: 0; }\n.ui-table__row[data-slot=\"table-group-panel-row\"] {\n  height: auto;\n  padding: 0;\n  overflow: visible;\n}\n.ui-table__row[data-slot=\"table-group-panel-row\"][hidden] { display: none; }\n.ui-table [data-slot=\"table-sort-trigger\"] svg { width: var(--icon-size); height: var(--icon-size); }\n.ui-table [data-slot=\"table-group-trigger\"] svg { width: var(--space-4); height: var(--space-4); }\n.ui-table :is(.ui-table__head, .ui-table__cell) > .ui-check {\n  display: inline-flex;\n  vertical-align: middle;\n}\n.ui-table__cell[data-editable]:focus-visible { outline: var(--focus-border-width) solid var(--ring); outline-offset: var(--focus-outline-offset); }\n.ui-table__cell[data-editing] [data-slot=\"table-cell-editor\"]:is(:hover, :focus, :focus-visible) {\n  background: transparent;\n  border-radius: 0;\n  box-shadow: none;\n  outline: none;\n}\n"
    },
    {
      "path": "src/components/ui/table-resize-handle.tsx",
      "type": "registry:component",
      "target": "@ui/table-resize-handle.tsx",
      "content": "import * as React from \"react\";\nimport { ResizeGrip } from \"./resize-grip\";\n\nexport interface TableResizeHandleProps extends Omit<\n  React.ButtonHTMLAttributes<HTMLButtonElement>,\n  \"children\" | \"onChange\" | \"value\"\n> {\n  axis: \"column\" | \"row\";\n  value: number;\n  min?: number;\n  max?: number;\n  step?: number;\n  onValueChange: (value: number) => void;\n}\n\ntype ResizeSession = {\n  pointerId: number | null;\n  startCoordinate: number;\n  startValue: number;\n  value: number;\n};\n\nfunction finite(value: number | undefined, fallback: number): number {\n  return typeof value === \"number\" && Number.isFinite(value) ? value : fallback;\n}\n\nfunction bounded(value: number, min: number, max: number): number {\n  return Math.min(max, Math.max(min, finite(value, min)));\n}\n\n/** Controlled resize separator. Feed emitted values to the owning layout engine. */\nexport const TableResizeHandle = React.forwardRef<\n  HTMLButtonElement,\n  TableResizeHandleProps\n>(function TableResizeHandle(\n  {\n    axis,\n    value,\n    min,\n    max,\n    step,\n    onValueChange,\n    onPointerDown,\n    onPointerMove,\n    onPointerUp,\n    onPointerCancel,\n    onLostPointerCapture,\n    onKeyDown,\n    onBlur,\n    \"aria-label\": ariaLabel,\n    ...props\n  },\n  forwardedRef,\n) {\n  const defaults = axis === \"column\"\n    ? { min: 40, max: 1200, step: 8 }\n    : { min: 32, max: 240, step: 8 };\n  const minValue = finite(min, defaults.min);\n  const rawMax = finite(max, defaults.max);\n  const maxValue = Math.max(minValue, rawMax);\n  const stepValue = Math.max(1, finite(step, defaults.step));\n  const current = bounded(value, minValue, maxValue);\n  const internalRef = React.useRef<HTMLButtonElement | null>(null);\n  const sessionRef = React.useRef<ResizeSession | null>(null);\n  const [resizing, setResizing] = React.useState(false);\n  const controlledRef = React.useRef({ current, onValueChange });\n  controlledRef.current = { current, onValueChange };\n\n  const setRef = React.useCallback((node: HTMLButtonElement | null) => {\n    internalRef.current = node;\n    if (typeof forwardedRef === \"function\") forwardedRef(node);\n    else if (forwardedRef) forwardedRef.current = node;\n  }, [forwardedRef]);\n\n  const end = React.useCallback((commit: boolean) => {\n    const session = sessionRef.current;\n    if (!session) return;\n    sessionRef.current = null;\n    setResizing(false);\n    const handle = internalRef.current;\n    if (session.pointerId !== null && handle?.hasPointerCapture?.(session.pointerId)) {\n      handle.releasePointerCapture(session.pointerId);\n    }\n    if (!commit) controlledRef.current.onValueChange(session.startValue);\n  }, []);\n\n  React.useEffect(() => () => end(false), [end]);\n\n  const update = (nextValue: number) => {\n    const normalized = bounded(nextValue, minValue, maxValue);\n    const session = sessionRef.current;\n    if (session) session.value = normalized;\n    onValueChange(normalized);\n  };\n\n  const pointerCoordinate = (event: React.PointerEvent<HTMLButtonElement>) =>\n    axis === \"column\" ? event.clientX : event.clientY;\n  const measureGuide = () => {\n    const handle = internalRef.current;\n    const table = handle?.closest(\".ui-table-wrap\");\n    if (axis === \"column\" && handle && table) {\n      handle.style.setProperty(\"--ui-resize-guide-size\", `${Math.max(0, table.getBoundingClientRect().bottom - handle.getBoundingClientRect().top - 1)}px`);\n    }\n  };\n\n  return (\n    <button\n      {...props}\n      ref={setRef}\n      type={props.type ?? \"button\"}\n      className={[\"ui-table__resize-handle\", props.className].filter(Boolean).join(\" \")}\n      data-slot=\"table-resize-handle\"\n      data-axis={axis}\n      data-resizing={resizing || undefined}\n      role=\"separator\"\n      aria-orientation={axis === \"column\" ? \"vertical\" : \"horizontal\"}\n      aria-label={ariaLabel ?? (axis === \"column\" ? \"Resize column\" : \"Resize row\")}\n      aria-valuemin={minValue}\n      aria-valuemax={maxValue}\n      aria-valuenow={current}\n      aria-valuetext={`${current} pixels`}\n      onPointerDown={(event) => {\n        onPointerDown?.(event);\n        if (event.defaultPrevented || event.button !== 0) return;\n        event.preventDefault();\n        measureGuide();\n        const session: ResizeSession = {\n          pointerId: event.pointerId,\n          startCoordinate: pointerCoordinate(event),\n          startValue: current,\n          value: current,\n        };\n        sessionRef.current = session;\n        setResizing(true);\n        event.currentTarget.focus();\n        event.currentTarget.setPointerCapture?.(event.pointerId);\n      }}\n      onPointerMove={(event) => {\n        onPointerMove?.(event);\n        const session = sessionRef.current;\n        if (!session || session.pointerId !== event.pointerId) return;\n        let delta = pointerCoordinate(event) - session.startCoordinate;\n        if (axis === \"column\" && getComputedStyle(event.currentTarget).direction === \"rtl\") delta *= -1;\n        update(session.startValue + delta);\n      }}\n      onPointerUp={(event) => {\n        onPointerUp?.(event);\n        if (sessionRef.current?.pointerId === event.pointerId) end(true);\n      }}\n      onPointerCancel={(event) => {\n        onPointerCancel?.(event);\n        if (sessionRef.current?.pointerId === event.pointerId) end(false);\n      }}\n      onLostPointerCapture={(event) => {\n        onLostPointerCapture?.(event);\n        if (sessionRef.current?.pointerId === event.pointerId) end(false);\n      }}\n      onKeyDown={(event) => {\n        onKeyDown?.(event);\n        if (event.defaultPrevented) return;\n        if (event.key === \"Escape\") {\n          event.preventDefault();\n          end(false);\n          return;\n        }\n        if (event.key === \"Enter\") {\n          event.preventDefault();\n          end(true);\n          return;\n        }\n        if (event.key === \"Home\" || event.key === \"End\") {\n          event.preventDefault();\n          measureGuide();\n          if (!sessionRef.current) sessionRef.current = { pointerId: null, startCoordinate: 0, startValue: current, value: current };\n          setResizing(true);\n          update(event.key === \"Home\" ? minValue : maxValue);\n          return;\n        }\n        const increaseKey = axis === \"column\" ? \"ArrowRight\" : \"ArrowDown\";\n        const decreaseKey = axis === \"column\" ? \"ArrowLeft\" : \"ArrowUp\";\n        if (event.key !== increaseKey && event.key !== decreaseKey) return;\n        event.preventDefault();\n        measureGuide();\n        const direction = event.key === increaseKey ? 1 : -1;\n        const rtl = axis === \"column\" && getComputedStyle(event.currentTarget).direction === \"rtl\";\n        if (!sessionRef.current) sessionRef.current = { pointerId: null, startCoordinate: 0, startValue: current, value: current };\n        setResizing(true);\n        update(current + direction * (rtl ? -1 : 1) * stepValue);\n      }}\n      onBlur={(event) => {\n        onBlur?.(event);\n        if (sessionRef.current?.pointerId === null) end(true);\n      }}\n      ><ResizeGrip axis={axis === \"row\" ? \"horizontal\" : \"vertical\"} state={resizing ? \"active\" : undefined} /></button>\n  );\n});\n"
    },
    {
      "path": "src/components/ui/resize-grip.css",
      "type": "registry:file",
      "target": "@ui/resize-grip.css",
      "content": "/* Shared appearance for panel and native-field resize indicators. */\n:where(.ui-resizable-handle, .ui-textarea, .ui-textarea-shell, .ui-text-input-group-shell, .ui-text-input-group, .ui-table__resize-handle, .ui-data-grid__resize) {\n  --ui-resize-grip-weight: 2px;\n  --ui-resize-grip-cap: calc(var(--ui-resize-grip-weight) / 2);\n  --ui-resize-duration: 180ms;\n  --ui-resize-easing: ease-out;\n}\n\n/* Root cause guard: the library owns touch-action inline, but text selection\n   is host-owned. Suppress selection/callout on every resize handle so a\n   mobile drag moves the panel instead of selecting nearby text. */\n:where(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize) {\n  touch-action: none;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-tap-highlight-color: transparent;\n}\n\n/* While any separator is dragged, the surrounding surface must not select. */\n:where(\n  .ui-resizable-group:has([data-separator=\"active\"]),\n  .ui-table-wrap:has([data-resizing]),\n  .ui-data-grid:has([data-resizing])\n) {\n  user-select: none;\n  -webkit-user-select: none;\n}\n\n/* Context-free painted line shared by panels, native tables and DataGrid. */\n.ui-resize-grip {\n  display: block;\n  flex: 0 0 auto;\n  width: var(--ui-resize-grip-weight);\n  height: 24px;\n  max-height: 100%;\n  border-radius: 999px;\n  background: var(--muted-foreground);\n  pointer-events: none;\n  transition: width var(--ui-resize-duration) var(--ui-resize-easing), height var(--ui-resize-duration) var(--ui-resize-easing), background var(--ui-resize-duration) var(--ui-resize-easing);\n}\n.ui-resize-grip[data-axis=\"horizontal\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"] > .ui-resize-grip { width: 24px; max-width: 100%; height: var(--ui-resize-grip-weight); max-height: none; }\n.ui-resize-grip[data-state=\"hover\"],\n.ui-resizable-handle[data-separator=\"hover\"] > .ui-resize-grip { height: 48px; }\n.ui-resize-grip[data-axis=\"horizontal\"][data-state=\"hover\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"][data-separator=\"hover\"] > .ui-resize-grip { width: 48px; height: var(--ui-resize-grip-weight); }\n.ui-resize-grip[data-state=\"active\"],\n.ui-resizable-handle[data-separator=\"active\"] > .ui-resize-grip { width: 1px; height: 100%; box-sizing: border-box; border-inline-start: 1px dashed var(--primary); border-radius: 0; background: transparent; transition: none; }\n.ui-resize-grip[data-axis=\"horizontal\"][data-state=\"active\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"][data-separator=\"active\"] > .ui-resize-grip { width: 100%; height: 1px; border-inline-start: 0; border-block-start: 1px dashed var(--primary); }\n:is(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize):focus-visible:not([data-separator=\"active\"]) > .ui-resize-grip:not([data-state=\"active\"]) { background: var(--foreground); transition: none; }\n@media (forced-colors: active) {\n  :is(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize):focus-visible:not([data-separator=\"active\"]) > .ui-resize-grip:not([data-state=\"active\"]) { background: Highlight; forced-color-adjust: none; }\n}\n@media (prefers-reduced-motion: reduce) { .ui-resize-grip { transition: none; } }\n"
    },
    {
      "path": "src/components/ui/resize-grip.tsx",
      "type": "registry:component",
      "target": "@ui/resize-grip.tsx",
      "content": "import * as React from \"react\";\nimport \"./resize-grip.css\";\n\n/** Shared presentation for Resizable and native Table/Grid resize transactions. */\nexport function ResizeGrip({\n  axis = \"vertical\",\n  state,\n  className,\n  ...props\n}: React.ComponentProps<\"span\"> & {\n  axis?: \"vertical\" | \"horizontal\";\n  state?: \"hover\" | \"active\";\n}) {\n  return <span {...props} className={[\"ui-resize-grip\", className].filter(Boolean).join(\" \")} data-axis={axis} data-state={state} aria-hidden=\"true\" />;\n}\n"
    },
    {
      "path": "src/components/ui/frozen-surface.css",
      "type": "registry:file",
      "target": "@ui/frozen-surface.css",
      "content": "/* Shared Table/Grid frozen-edge paint. The data owners keep positioning. */\n:where(.ui-table-wrap, .ui-data-grid) {\n  --ui-frozen-edge-tint: color-mix(in srgb, var(--foreground) 8%, transparent);\n  --ui-frozen-gradient-start: linear-gradient(to right, var(--ui-frozen-edge-tint), transparent);\n  --ui-frozen-gradient-end: linear-gradient(to left, var(--ui-frozen-edge-tint), transparent);\n}\n:where(.ui-table-wrap, .ui-data-grid):dir(rtl) {\n  --ui-frozen-gradient-start: linear-gradient(to left, var(--ui-frozen-edge-tint), transparent);\n  --ui-frozen-gradient-end: linear-gradient(to right, var(--ui-frozen-edge-tint), transparent);\n}\n"
    },
    {
      "path": "src/components/ui/data-view.css",
      "type": "registry:file",
      "target": "@ui/data-view.css",
      "content": "/* Opt-in semantic paint shared by data views and their actual Button owners. */\n:where(.ui-table-wrap, .ui-data-grid, .ui-data-action--ai) {\n  --ui-data-ai-foreground: var(--link-topic);\n  --ui-data-ai-background: var(--link-topic-background);\n}\n.ui-button.ui-data-action--ai {\n  --foreground: var(--link-topic);\n  --secondary: var(--link-topic-background);\n  --secondary-hover: color-mix(in srgb, var(--link-topic) 14%, var(--card));\n  --quiet-hover: var(--secondary-hover);\n  color: var(--link-topic);\n}\n.ui-button.ui-data-action--info {\n  --foreground: var(--link);\n  --secondary: var(--link-background);\n  --secondary-hover: color-mix(in srgb, var(--link) 14%, var(--card));\n  color: var(--link);\n}\n.ui-button.ui-data-action--danger {\n  --foreground: var(--destructive);\n  --secondary: var(--color-danger-soft);\n  --secondary-hover: color-mix(in srgb, var(--destructive) 14%, var(--card));\n  color: var(--destructive);\n}\n.ui-data-ai-surface {\n  background-color: color-mix(in srgb, var(--link-topic) 3%, var(--card));\n  background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--link-topic) 8%, transparent) 4px 5px);\n}\n"
    }
  ]
}
