{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "data-frozen-columns",
  "type": "registry:component",
  "title": "Frozen columns",
  "description": "A pinned column beside a grid that pans",
  "author": "sudo-kw <https://github.com/sudo-kw>",
  "dependencies": [
    "@gpuix/native@0.11.0",
    "@gpuix/react@0.11.0",
    "effect@4.1.2",
    "react@^19.2.4"
  ],
  "registryDependencies": [
    "https://gpuixui.sudokw.com/gpuix-primitives.json",
    "https://gpuixui.sudokw.com/gpuix-tokens.json",
    "https://gpuixui.sudokw.com/gpuix-tw.json"
  ],
  "files": [
    {
      "path": "packages/data/src/internal/list.ts",
      "target": "@ui/gpuixui/data/internal/list.ts",
      "type": "registry:lib",
      "content": "import * as Arr from \"effect/Array\";\nimport * as P from \"effect/Predicate\";\nimport * as Str from \"effect/String\";\n\nexport const listOf = <A>(\n  value: ReadonlyArray<A> | null | undefined,\n): ReadonlyArray<A> => (Arr.isArray(value) ? value : []);\n\nexport const recordsOf = <A extends { readonly key: string }>(\n  value: ReadonlyArray<A> | undefined,\n): ReadonlyArray<A> =>\n  Arr.filter(\n    listOf(value),\n    (entry) => P.isObject(entry) && P.isString(entry.key),\n  );\n\nexport const textsOf = (\n  value: ReadonlyArray<string> | undefined,\n): ReadonlyArray<string> =>\n  Arr.map(listOf(value), (entry) => (P.isString(entry) ? entry : \"\"));\n\nconst namesRow = (value: unknown): boolean =>\n  P.isString(value) && Str.isNonEmpty(Str.trim(value));\n\nexport const rowsOf = <A>(\n  value: ReadonlyArray<A> | null | undefined,\n  keyOf: (row: A) => string,\n): ReadonlyArray<A> =>\n  Arr.filter(listOf(value), (row) => P.isObject(row) && namesRow(keyOf(row)));\n"
    },
    {
      "path": "packages/data/src/internal/painted.ts",
      "target": "@ui/gpuixui/data/internal/painted.ts",
      "type": "registry:lib",
      "content": "import type { EventPayload, StyleDesc } from \"@gpuix/react\";\nimport * as Option from \"effect/Option\";\nimport { useCallback, useState } from \"react\";\nimport { paintableSize } from \"./size.js\";\n\nexport interface PaintedHeight {\n  readonly measured: Option.Option<number>;\n\n  readonly onLayout: (event: EventPayload) => void;\n}\n\nexport const usePaintedHeight = (\n  onLayout: ((event: EventPayload) => void) | undefined,\n): PaintedHeight => {\n  const [measured, setMeasured] = useState<Option.Option<number>>(\n    Option.none(),\n  );\n  const report = useCallback(\n    (event: EventPayload) => {\n      onLayout?.(event);\n      Option.match(paintableSize(event.height), {\n        onNone: () => {},\n        onSome: (height) =>\n          setMeasured((current) =>\n            Option.contains(current, height) ? current : Option.some(height),\n          ),\n      });\n    },\n    [onLayout],\n  );\n  return { measured, onLayout: report };\n};\n\nexport const paneFill: (height: Option.Option<number>) => StyleDesc =\n  Option.match({\n    onNone: () => ({\n      display: \"flex\",\n      flexDirection: \"column\",\n      flexGrow: 1,\n      flexShrink: 1,\n      flexBasis: 0,\n      minHeight: 0,\n    }),\n    onSome: () => ({}),\n  });\n"
    },
    {
      "path": "packages/data/src/internal/size.ts",
      "target": "@ui/gpuixui/data/internal/size.ts",
      "type": "registry:lib",
      "content": "import * as Option from \"effect/Option\";\n\nexport const paintableSize = (\n  size: number | undefined,\n): Option.Option<number> =>\n  Option.filter(\n    Option.fromNullishOr(size),\n    (value) => Number.isFinite(value) && value >= 0,\n  );\n"
    },
    {
      "path": "packages/data/src/recipe.ts",
      "target": "@ui/gpuixui/data/recipe.ts",
      "type": "registry:lib",
      "content": "import type { StyleDesc } from \"@gpuix/react\";\nimport { createRecipeCache } from \"../tw/index.js\";\nimport type { Theme } from \"./theme.js\";\n\nexport const recipeStyle: (recipe: string, theme: Theme) => StyleDesc =\n  createRecipeCache(256);\n"
    },
    {
      "path": "packages/data/src/table/frame.tsx",
      "target": "@ui/gpuixui/data/table/frame.tsx",
      "type": "registry:component",
      "content": "/** @jsxImportSource @gpuix/react */\nimport {\n  createContext,\n  useCallback,\n  useContext,\n  useMemo,\n  useState,\n  type ReactNode,\n} from \"react\";\nimport type { EventPayload } from \"@gpuix/react\";\nimport * as Option from \"effect/Option\";\n\nexport const DEFAULT_HEADER_HEIGHT = 44;\n\nexport interface TableFrame {\n  readonly viewportHeight: Option.Option<number>;\n\n  readonly headerHeight: Option.Option<number>;\n  readonly reportViewport: (height: number) => void;\n  readonly reportHeader: (height: number) => void;\n}\n\nconst TableFrameContext = createContext<Option.Option<TableFrame>>(\n  Option.none(),\n);\n\nexport const useTableFrame = (): Option.Option<TableFrame> =>\n  useContext(TableFrameContext);\n\nexport const useMeasuredBodyHeight = (): Option.Option<number> => {\n  const frame = useTableFrame();\n  return Option.flatMap(frame, (value) =>\n    Option.map(value.viewportHeight, (viewport) =>\n      Math.max(0, viewport - Option.getOrElse(value.headerHeight, () => 0)),\n    ),\n  );\n};\n\nconst useHeightReport = (\n  initial?: number,\n): [Option.Option<number>, (height: number) => void] => {\n  const [height, setHeight] = useState<Option.Option<number>>(\n    Option.fromNullishOr(initial),\n  );\n  const report = useCallback((next: number) => {\n    if (!Number.isFinite(next) || next <= 0) return;\n    setHeight((current) =>\n      Option.contains(current, next) ? current : Option.some(next),\n    );\n  }, []);\n  return [height, report];\n};\n\nexport const TableFrameProvider = ({\n  children,\n  initialHeight,\n}: {\n  readonly children: ReactNode;\n\n  readonly initialHeight?: number;\n}) => {\n  const [headerHeight, reportHeader] = useHeightReport(DEFAULT_HEADER_HEIGHT);\n  const [viewportHeight, reportViewport] = useHeightReport(initialHeight);\n  const frame = useMemo<TableFrame>(\n    () => ({\n      headerHeight,\n      viewportHeight,\n      reportHeader,\n      reportViewport,\n    }),\n    [headerHeight, viewportHeight, reportHeader, reportViewport],\n  );\n  return (\n    <TableFrameContext.Provider value={Option.some(frame)}>\n      {children}\n    </TableFrameContext.Provider>\n  );\n};\n\nexport const reportBoth = (\n  event: EventPayload,\n  caller: ((event: EventPayload) => void) | undefined,\n  report: (height: number) => void,\n): void => {\n  caller?.(event);\n  report(event.height ?? 0);\n};\n"
    },
    {
      "path": "packages/data/src/table/frozen.tsx",
      "target": "@ui/gpuixui/data/table/frozen.tsx",
      "type": "registry:component",
      "content": "/** @jsxImportSource @gpuix/react */\nimport {\n  useGpuix,\n  type EventPayload,\n  type Props,\n  type PublicInstance,\n} from \"@gpuix/react\";\nimport { mergeStyles } from \"@gpuix/react/floating\";\nimport * as Option from \"effect/Option\";\nimport { Fragment, useRef, useState, type ReactNode } from \"react\";\nimport { rowsOf } from \"../internal/list.js\";\nimport { paneFill, usePaintedHeight } from \"../internal/painted.js\";\nimport { paintableSize } from \"../internal/size.js\";\nimport { DEFAULT_HEADER_HEIGHT } from \"./frame.js\";\nimport {\n  TableBody,\n  TableEmpty,\n  TableHeader,\n  TableViewport,\n  emptyMessage,\n} from \"./table.js\";\n\nexport interface FrozenTableProps<Row> extends Omit<Props, \"children\"> {\n  readonly height: number;\n\n  readonly frozenWidth: number;\n\n  readonly contentWidth: number;\n\n  readonly rows: ReadonlyArray<Row>;\n\n  readonly rowKey: (row: Row) => string;\n\n  readonly frozenHeader: ReactNode;\n\n  readonly frozenRow: (row: Row) => ReactNode;\n\n  readonly header: ReactNode;\n\n  readonly row: (row: Row) => ReactNode;\n\n  readonly empty?: ReactNode;\n\n  readonly frozenTestId?: string;\n\n  readonly bodyTestId?: string;\n\n  readonly viewportTestId?: string;\n}\n\nexport const FrozenTable = <Row,>({\n  height,\n  frozenWidth,\n  contentWidth,\n  rows,\n  rowKey,\n  frozenHeader,\n  frozenRow,\n  header,\n  row,\n  empty,\n  frozenTestId,\n  bodyTestId,\n  viewportTestId,\n  onLayout,\n  style,\n  ...rest\n}: FrozenTableProps<Row>) => {\n  const renderer = useGpuix().renderer;\n  const frozen = useRef<PublicInstance | null>(null);\n  const body = useRef<PublicInstance | null>(null);\n  const syncing = useRef(false);\n  const bodyX = useRef(0);\n\n  const bound = paintableSize(height);\n  const painted = usePaintedHeight(onLayout);\n  const box = Option.orElse(bound, () => painted.measured);\n  const boxHeight = Option.getOrUndefined(box);\n\n  const frozenTrack = Option.getOrUndefined(paintableSize(frozenWidth));\n  const contentTrack = Option.getOrUndefined(paintableSize(contentWidth));\n\n  const records = rowsOf(rows, rowKey);\n  const [frozenHeaderHeight, setFrozenHeaderHeight] = useState(0);\n  const [dataHeaderHeight, setDataHeaderHeight] = useState(0);\n\n  const measuredHeader = Math.max(frozenHeaderHeight, dataHeaderHeight);\n  const headerHeight =\n    measuredHeader === 0 ? DEFAULT_HEADER_HEIGHT : measuredHeader;\n  const bodyHeight = Option.getOrUndefined(\n    Option.map(box, (size) => Math.max(0, size - headerHeight)),\n  );\n\n  const mirror = (from: \"frozen\" | \"body\") => (event: EventPayload) => {\n    const y = event.scrollY;\n    if (from === \"body\" && event.scrollX !== undefined) {\n      bodyX.current = event.scrollX;\n    }\n    if (y === undefined || syncing.current) return;\n    const target = from === \"body\" ? frozen : body;\n    const id = target.current?.id;\n    if (id === undefined) return;\n    syncing.current = true;\n    renderer?.scrollTo?.(id, from === \"body\" ? 0 : bodyX.current, y);\n    syncing.current = false;\n  };\n\n  return (\n    <div\n      {...rest}\n      onLayout={painted.onLayout}\n      role=\"table\"\n      style={mergeStyles(\n        {\n          ...paneFill(bound),\n          display: \"flex\",\n          flexDirection: \"row\",\n          minHeight: 0,\n          overflow: \"hidden\",\n          ...(boxHeight === undefined ? {} : { height: boxHeight }),\n        },\n        style,\n      )}\n    >\n      <div\n        style={{\n          flexGrow: 0,\n          flexShrink: 0,\n          ...(frozenTrack === undefined\n            ? {}\n            : { width: frozenTrack, flexBasis: frozenTrack }),\n          display: \"flex\",\n          flexDirection: \"column\",\n          height: boxHeight,\n          minHeight: 0,\n        }}\n      >\n        <TableHeader\n          style={{ minHeight: headerHeight }}\n          onLayout={(event) => setFrozenHeaderHeight(event.height ?? 0)}\n        >\n          {frozenHeader}\n        </TableHeader>\n        <TableBody\n          height={bodyHeight}\n          testId={frozenTestId}\n          ref={frozen}\n          onScrollChange={mirror(\"frozen\")}\n        >\n          {records.map((record) => (\n            <Fragment key={rowKey(record)}>{frozenRow(record)}</Fragment>\n          ))}\n        </TableBody>\n      </div>\n      <div\n        style={{\n          flexGrow: 1,\n          flexShrink: 1,\n          flexBasis: 0,\n          minWidth: 0,\n          height: boxHeight,\n          display: \"flex\",\n          flexDirection: \"column\",\n        }}\n      >\n        <TableViewport\n          testId={viewportTestId}\n          style={{ flexGrow: 1, minHeight: 0 }}\n        >\n          <div\n            style={{\n              flexGrow: 0,\n              flexShrink: 0,\n              ...(contentTrack === undefined\n                ? {}\n                : { width: contentTrack, flexBasis: contentTrack }),\n              display: \"flex\",\n              flexDirection: \"column\",\n              height: boxHeight,\n              minHeight: 0,\n            }}\n          >\n            <TableHeader\n              style={{ minHeight: headerHeight }}\n              onLayout={(event) => setDataHeaderHeight(event.height ?? 0)}\n            >\n              {header}\n            </TableHeader>\n            <TableBody\n              height={bodyHeight}\n              testId={bodyTestId}\n              ref={body}\n              onScrollChange={mirror(\"body\")}\n            >\n              {records.length === 0 ? (\n                <TableEmpty>{emptyMessage(empty)}</TableEmpty>\n              ) : (\n                records.map((record) => (\n                  <Fragment key={rowKey(record)}>{row(record)}</Fragment>\n                ))\n              )}\n            </TableBody>\n          </div>\n        </TableViewport>\n      </div>\n    </div>\n  );\n};\n"
    },
    {
      "path": "packages/data/src/table/recipe.ts",
      "target": "@ui/gpuixui/data/table/recipe.ts",
      "type": "registry:lib",
      "content": "export const TABLE_ROOT =\n  \"flex flex-col overflow-hidden rounded-lg border border-input bg-card text-foreground\";\n\nexport const TABLE_VIEWPORT = \"flex flex-col flex-1 min-h-0\";\n\nexport const TABLE_HEADER = \"flex flex-col shrink-0\";\n\nexport const TABLE_BODY = \"flex flex-col flex-1 min-h-0\";\n\nexport const TABLE_ROW = \"flex flex-row items-center shrink-0\";\n\nexport const TABLE_ROW_SELECTED =\n  \"flex flex-row items-center shrink-0 bg-selected text-selected-foreground\";\n\nexport const TABLE_ROW_INTERACTIVE =\n  \"flex flex-row items-center shrink-0 hover:bg-hover cursor-pointer\";\n\nexport const TABLE_HEADER_CELL =\n  \"relative flex flex-row items-center px-3 py-2 text-sm font-medium text-muted-foreground\";\n\nexport const TABLE_COLUMN_DIVIDER =\n  \"absolute inset-y-0 right-0 w-1.5 bg-border hover:bg-primary\";\n\nexport const TABLE_CELL = \"px-3 py-2 text-sm\";\n\nexport const TABLE_DETAIL_ROW =\n  \"flex flex-row items-stretch shrink-0 bg-muted text-muted-foreground\";\n\nexport const TABLE_DETAIL_CELL = \"px-3 py-3 text-sm\";\n\nexport const TABLE_CAPTION = \"px-3 py-2 text-xs text-muted-foreground\";\n\nexport const TABLE_EMPTY =\n  \"flex flex-col items-center justify-center gap-1 px-3 py-6\";\n\nexport const TABLE_SKELETON_BAR = \"h-2 rounded-sm bg-skeleton\";\n"
    },
    {
      "path": "packages/data/src/table/table.tsx",
      "target": "@ui/gpuixui/data/table/table.tsx",
      "type": "registry:component",
      "content": "/** @jsxImportSource @gpuix/react */\nimport type { Props, PublicInstance, StyleDesc } from \"@gpuix/react\";\nimport { mergeStyles } from \"@gpuix/react/floating\";\nimport {\n  borderWidthOf,\n  spaceValue,\n  spokenText,\n} from \"../../primitives/core/index.js\";\nimport { cn } from \"../../tw/index.js\";\nimport * as Option from \"effect/Option\";\nimport * as P from \"effect/Predicate\";\nimport type { ReactNode, Ref } from \"react\";\nimport { paintableSize } from \"../internal/size.js\";\nimport { recipeStyle } from \"../recipe.js\";\nimport {\n  dividerOn,\n  pointerWash,\n  textStyle,\n  themeColors,\n  useTheme,\n} from \"../theme.js\";\nimport {\n  reportBoth,\n  TableFrameProvider,\n  useMeasuredBodyHeight,\n  useTableFrame,\n} from \"./frame.js\";\nimport {\n  TABLE_BODY,\n  TABLE_CAPTION,\n  TABLE_CELL,\n  TABLE_EMPTY,\n  TABLE_HEADER,\n  TABLE_HEADER_CELL,\n  TABLE_ROOT,\n  TABLE_ROW,\n  TABLE_ROW_INTERACTIVE,\n  TABLE_ROW_SELECTED,\n  TABLE_SKELETON_BAR,\n  TABLE_VIEWPORT,\n} from \"./recipe.js\";\n\nexport type CellAlign = \"left\" | \"center\" | \"right\";\n\nconst JUSTIFY: Readonly<Record<CellAlign, string>> = {\n  left: \"flex-start\",\n  center: \"center\",\n  right: \"flex-end\",\n};\n\nexport interface CellLayoutProps {\n  readonly width?: number;\n\n  readonly align?: CellAlign;\n\n  readonly className?: string;\n}\n\nconst cellLayout = ({ width, align = \"left\" }: CellLayoutProps): StyleDesc => {\n  const track = Option.getOrUndefined(paintableSize(width));\n  return {\n    ...(track === undefined\n      ? { flexGrow: 1, flexShrink: 1, flexBasis: 0, minWidth: 0 }\n      : { width: track, flexGrow: 0, flexShrink: 0, flexBasis: track }),\n    justifyContent: JUSTIFY[align],\n  };\n};\n\nexport interface TableProps extends Omit<Props, \"children\"> {\n  readonly height?: number;\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const Table = ({\n  height,\n  className,\n  children,\n  style,\n  ...rest\n}: TableProps) => {\n  const theme = useTheme();\n  const bound = Option.getOrUndefined(paintableSize(height));\n  return (\n    <TableFrameProvider initialHeight={bound}>\n      <div\n        {...rest}\n        role=\"table\"\n        style={mergeStyles(\n          mergeStyles(\n            recipeStyle(cn(TABLE_ROOT, className), theme),\n            bound === undefined ? undefined : { height: bound },\n          ),\n          style,\n        )}\n      >\n        {children}\n      </div>\n    </TableFrameProvider>\n  );\n};\n\nexport interface TableViewportProps extends Omit<Props, \"children\"> {\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const TableViewport = ({\n  className,\n  children,\n  style,\n  onLayout,\n  ...rest\n}: TableViewportProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  const frame = useTableFrame();\n  return (\n    <div\n      {...rest}\n      onLayout={(event) =>\n        reportBoth(\n          event,\n          onLayout,\n          Option.match(frame, {\n            onNone: () => () => {},\n            onSome: (measured) => measured.reportViewport,\n          }),\n        )\n      }\n      style={mergeStyles(\n        mergeStyles(recipeStyle(cn(TABLE_VIEWPORT, className), theme), {\n          overflowX: \"scroll\",\n          scrollbarColor: colors.scrollbar,\n        }),\n        style,\n      )}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport interface TableHeaderProps extends Omit<Props, \"children\"> {\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const TableHeader = ({\n  className,\n  children,\n  style,\n  onLayout,\n  ...rest\n}: TableHeaderProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  const frame = useTableFrame();\n  return (\n    <div\n      {...rest}\n      onLayout={(event) =>\n        reportBoth(\n          event,\n          onLayout,\n          Option.match(frame, {\n            onNone: () => () => {},\n            onSome: (measured) => measured.reportHeader,\n          }),\n        )\n      }\n      role=\"rowgroup\"\n      style={mergeStyles(\n        mergeStyles(recipeStyle(cn(TABLE_HEADER, className), theme), {\n          borderBottomWidth: borderWidthOf(theme, \"thin\"),\n\n          borderColor: dividerOn(theme, colors.card) ?? colors.border,\n        }),\n        style,\n      )}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport interface TableBodyProps extends Omit<Props, \"children\"> {\n  readonly rows?: number;\n\n  readonly height?: number;\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const TableBody = ({\n  rows = 3,\n  height,\n  className,\n  children,\n  style,\n  ...rest\n}: TableBodyProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  const empty = children === undefined || children === null;\n  const measured = useMeasuredBodyHeight();\n  const definite = Option.orElse(paintableSize(height), () => measured);\n  return (\n    <div\n      {...rest}\n      role=\"rowgroup\"\n      style={mergeStyles(\n        mergeStyles(recipeStyle(cn(TABLE_BODY, className), theme), {\n          overflowY: \"scroll\",\n          scrollbarColor: colors.scrollbar,\n          ...(Option.isNone(definite)\n            ? {}\n            : {\n                height: definite.value,\n                flexGrow: 0,\n                flexShrink: 0,\n                flexBasis: definite.value,\n              }),\n        }),\n        style,\n      )}\n    >\n      {empty ? <TableSkeleton rows={rows} /> : children}\n    </div>\n  );\n};\n\nexport interface TableRowProps extends Omit<Props, \"children\"> {\n  readonly selected?: boolean;\n\n  readonly disabled?: boolean;\n\n  readonly instanceRef?: Ref<PublicInstance>;\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const TableRow = ({\n  selected,\n  disabled,\n  instanceRef,\n  className,\n  children,\n  style,\n  onClick,\n  ...rest\n}: TableRowProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  const interactive = onClick !== undefined && disabled !== true;\n  const recipe =\n    selected === true\n      ? TABLE_ROW_SELECTED\n      : interactive\n        ? TABLE_ROW_INTERACTIVE\n        : TABLE_ROW;\n\n  const rule = (surface: string | undefined): string | undefined =>\n    dividerOn(theme, surface) ?? colors.border;\n  const hoverFill = selected === true ? colors.accent : colors.hover;\n  const pressFill =\n    (selected === true\n      ? pointerWash(theme, \"active\", \"accent\")\n      : pointerWash(theme, \"active\", \"hover\")) ?? colors.active;\n  return (\n    <div\n      {...rest}\n      ref={instanceRef}\n      role=\"row\"\n      aria-selected={selected}\n      onClick={disabled === true ? undefined : onClick}\n      style={mergeStyles(\n        mergeStyles(recipeStyle(cn(recipe, className), theme), {\n          borderBottomWidth: borderWidthOf(theme, \"thin\"),\n          borderColor: rule(selected === true ? colors.selected : colors.card),\n\n          ...(interactive\n            ? {\n                cursor: \"pointer\",\n\n                hover:\n                  theme.interaction === \"appkit\"\n                    ? {}\n                    : {\n                        backgroundColor: hoverFill,\n                        borderColor: rule(hoverFill),\n                      },\n                active: {\n                  backgroundColor: pressFill,\n                  borderColor: rule(pressFill),\n                },\n              }\n            : {}),\n        }),\n        style,\n      )}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport interface TableHeaderCellProps\n  extends Omit<Props, \"children\">, CellLayoutProps {\n  readonly children?: ReactNode;\n}\n\nexport const TableHeaderCell = ({\n  width,\n  align = \"left\",\n  className,\n  children,\n  style,\n  ...rest\n}: TableHeaderCellProps) => {\n  const theme = useTheme();\n  return (\n    <div\n      {...rest}\n      role=\"columnheader\"\n      style={mergeStyles(\n        mergeStyles(\n          recipeStyle(cn(TABLE_HEADER_CELL, className), theme),\n          cellLayout({ width, align }),\n        ),\n        style,\n      )}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport interface TableCellProps\n  extends Omit<Props, \"children\">, CellLayoutProps {\n  readonly children?: ReactNode;\n}\n\nexport const TableCell = ({\n  width,\n  align = \"left\",\n  className,\n  children,\n  style,\n  ...rest\n}: TableCellProps) => {\n  const theme = useTheme();\n  return (\n    <div\n      {...rest}\n      role=\"cell\"\n      style={mergeStyles(\n        mergeStyles(\n          recipeStyle(cn(TABLE_CELL, className), theme),\n          cellLayout({ width, align }),\n        ),\n        style,\n      )}\n    >\n      {children}\n    </div>\n  );\n};\n\nexport interface TableCaptionProps extends Omit<Props, \"children\"> {\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const TableCaption = ({\n  className,\n  children,\n  style,\n  ...rest\n}: TableCaptionProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  return (\n    <div\n      {...rest}\n      style={mergeStyles(\n        recipeStyle(cn(TABLE_CAPTION, className), theme),\n        style,\n      )}\n    >\n      {typeof children === \"string\" || typeof children === \"number\" ? (\n        <text\n          style={{\n            ...textStyle(theme, \"caption\"),\n            color: colors.mutedForeground,\n          }}\n        >\n          {children}\n        </text>\n      ) : (\n        children\n      )}\n    </div>\n  );\n};\n\nexport interface TableEmptyProps extends Omit<Props, \"children\"> {\n  readonly className?: string;\n  readonly children?: ReactNode;\n}\n\nexport const DEFAULT_EMPTY_MESSAGE = \"No rows\";\n\nexport const emptyMessage = (empty: ReactNode): ReactNode =>\n  P.isString(empty)\n    ? spokenText(Option.fromNullishOr(empty), DEFAULT_EMPTY_MESSAGE)\n    : (empty ?? DEFAULT_EMPTY_MESSAGE);\n\nexport const TableEmpty = ({\n  className,\n  children,\n  style,\n  ...rest\n}: TableEmptyProps) => {\n  const theme = useTheme();\n  const colors = themeColors(theme);\n  return (\n    <div\n      {...rest}\n      role=\"row\"\n      style={mergeStyles(recipeStyle(cn(TABLE_EMPTY, className), theme), style)}\n    >\n      <div\n        role=\"cell\"\n        style={{\n          display: \"flex\",\n          flexDirection: \"column\",\n          alignItems: \"center\",\n          gap: spaceValue(theme, \"xs\"),\n        }}\n      >\n        {typeof children === \"string\" || typeof children === \"number\" ? (\n          <text\n            style={{\n              ...textStyle(theme, \"body\"),\n              color: colors.mutedForeground,\n            }}\n          >\n            {children}\n          </text>\n        ) : (\n          children\n        )}\n      </div>\n    </div>\n  );\n};\n\nexport interface TableSkeletonProps {\n  readonly rows?: number;\n\n  readonly columns?: number;\n}\n\nexport const SKELETON_TRACK_LIMIT = 20;\n\nconst trackCount = (count: number, fallback: number): number =>\n  Number.isFinite(count)\n    ? Math.min(SKELETON_TRACK_LIMIT, Math.max(1, Math.floor(count)))\n    : fallback;\n\nexport const TableSkeleton = ({\n  rows = 3,\n  columns = 3,\n}: TableSkeletonProps) => {\n  const rowCount = trackCount(rows, 3);\n  const columnCount = trackCount(columns, 3);\n  return (\n    <>\n      {Array.from({ length: rowCount }, (_, row) => (\n        <TableRow key={`skeleton-${row}`}>\n          {Array.from({ length: columnCount }, (_, column) => (\n            <TableCell key={`skeleton-${row}-${column}`}>\n              <div style={{ display: \"flex\", flexDirection: \"column\" }}>\n                <SkeletonBar />\n              </div>\n            </TableCell>\n          ))}\n        </TableRow>\n      ))}\n    </>\n  );\n};\n\nconst SkeletonBar = () => {\n  const theme = useTheme();\n  return (\n    <div\n      style={mergeStyles(recipeStyle(TABLE_SKELETON_BAR, theme), {\n        width: \"60%\",\n      })}\n    />\n  );\n};\n"
    },
    {
      "path": "packages/data/src/theme.ts",
      "target": "@ui/gpuixui/data/theme.ts",
      "type": "registry:lib",
      "content": "import type { Theme } from \"../tokens/index.js\";\nimport { useTheme as useTokenTheme } from \"../tokens/react.js\";\n\nexport {\n  controlFocusRing,\n  dividerOn,\n  pointerWash,\n  textStyle,\n  themeColors,\n} from \"../tokens/index.js\";\nexport type { Theme };\n\nexport const useTheme = (): Theme => useTokenTheme();\n"
    }
  ],
  "docs": "[Frozen columns](https://gpuixui.sudokw.com/data-display/frozen-columns) — These are GPUix native components: the files render through GPUix's reconciler against `@gpuix/react`, not the DOM, and need the per-platform `@gpuix/native` binding. The CLI installs the `@gpuixui/*` runtime the components import as registry items, so the copied tree resolves on its own; wrap it in `ThemeProvider` before it renders.",
  "meta": {
    "url": "/data-display/frozen-columns",
    "kind": "component",
    "runtime": "gpuix",
    "registry": "gpuixui"
  }
}