(props: ColumnProps)
| 60 | }); |
| 61 | |
| 62 | export function Column(props: ColumnProps) { |
| 63 | return ( |
| 64 | <AriaColumn |
| 65 | {...props} |
| 66 | className={composeTailwindRenderProps( |
| 67 | props.className, |
| 68 | 'box-border h-1 [&:hover]:z-20 focus-within:z-20 text-start text-sm font-semibold text-neutral-700 dark:text-neutral-300 cursor-default' |
| 69 | )}> |
| 70 | {composeRenderProps(props.children, (children, {allowsSorting, sortDirection}) => ( |
| 71 | <div className="flex items-center"> |
| 72 | <Group role="presentation" tabIndex={-1} className={columnStyles}> |
| 73 | <span className="truncate">{children}</span> |
| 74 | {allowsSorting && ( |
| 75 | <span |
| 76 | className={`w-4 h-4 flex items-center justify-center transition ${ |
| 77 | sortDirection === 'descending' ? 'rotate-180' : '' |
| 78 | }`}> |
| 79 | {sortDirection && ( |
| 80 | <ArrowUp |
| 81 | aria-hidden |
| 82 | className="w-4 h-4 text-neutral-500 dark:text-neutral-400 forced-colors:text-[ButtonText]" |
| 83 | /> |
| 84 | )} |
| 85 | </span> |
| 86 | )} |
| 87 | </Group> |
| 88 | {!props.width && <ColumnResizer className={resizerStyles} />} |
| 89 | </div> |
| 90 | ))} |
| 91 | </AriaColumn> |
| 92 | ); |
| 93 | } |
| 94 | |
| 95 | export function TableHeader<T>(props: TableHeaderProps<T>) { |
| 96 | let {selectionBehavior, selectionMode, allowsDragging} = useTableOptions(); |
nothing calls this directly
no test coverage detected