Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/bindx-ui/src/datagrid/column-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ export interface DataGridColumnHeaderUIProps {
className?: string
}

function DataGridColumnFilterIcon({ filterName }: { filterName: string }): ReactElement | null {
// Muted when idle so a filterable column advertises itself; blue keeps an active filter distinct.
function DataGridColumnFilterIcon({ filterName }: { filterName: string }): ReactElement {
const [, , { isEmpty }] = useDataViewFilter(filterName)
return isEmpty ? null : <FilterIcon className="h-4 w-4 text-blue-600" />
return <FilterIcon className={cn('h-4 w-4', isEmpty ? 'text-muted-foreground/50' : 'text-blue-600')} />
}

export function DataGridColumnHeaderUI({
Expand Down
4 changes: 3 additions & 1 deletion packages/bindx-ui/src/datagrid/ui/label-ui.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { uic } from '../../utils/uic.js'

// Focusable so the filter affordance and its tooltip are reachable without a mouse.
export const DataGridTooltipLabel = uic('span', {
baseClass: 'cursor-pointer underline decoration-dashed decoration-gray-400 underline-offset-4 hover:decoration-gray-800',
defaultProps: { tabIndex: 0 },
baseClass: 'cursor-pointer underline decoration-dashed decoration-transparent underline-offset-4 transition-colors hover:decoration-gray-400 focus-visible:decoration-gray-800 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring rounded-xs',
})
1 change: 1 addition & 0 deletions packages/bindx-ui/src/ui/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(({
<div
className={cn(
'invisible opacity-0 group-hover/tooltip:visible group-hover/tooltip:opacity-100',
'group-focus-within/tooltip:visible group-focus-within/tooltip:opacity-100',
'transition-all duration-150 absolute z-50 left-1/2 -translate-x-1/2',
'rounded-md border border-gray-200 bg-white/90 backdrop-blur-sm shadow-md px-2 py-1.5',
'whitespace-nowrap',
Expand Down