🎨 improve data-table row interaction and empty state styling
Browse files at this commit802ddc760269beb0664f26de3a9ed2b33157781aParent: 318e273- style
- 🎨 improve data-table row interaction and empty state styling
1 changed file +3 -2
src/components/ui/data-table.tsxmodified+3 -2
| @@ -220,8 +220,9 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 220 | {(row) => ( | 220 | {(row) => ( |
| 221 | <TableRow | 221 | <TableRow |
| 222 | data-state={row.getIsSelected() ? "selected" : undefined} | 222 | data-state={row.getIsSelected() ? "selected" : undefined} |
| 223 | + role={props.onRowClick ? "button" : undefined} | ||
| 223 | tabIndex={props.onRowClick ? 0 : undefined} | 224 | tabIndex={props.onRowClick ? 0 : undefined} |
| 224 | - class={props.onRowClick ? "cursor-pointer" : undefined} | 225 | + class={props.onRowClick ? "cursor-pointer outline-none focus-visible:bg-primary/[0.06] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring active:bg-primary/[0.08]" : undefined} |
| 225 | onClick={(event) => { | 226 | onClick={(event) => { |
| 226 | if (!props.onRowClick || isInteractiveTarget(event.target)) return; | 227 | if (!props.onRowClick || isInteractiveTarget(event.target)) return; |
| 227 | props.onRowClick(row.original); | 228 | props.onRowClick(row.original); |
| @@ -269,7 +270,7 @@ export function DataTableFrame(props: ParentProps<{ class?: string }>) { | |||
| 269 | 270 | ||
| 270 | export function DataTableEmpty(props: ParentProps<{ class?: string }>) { | 271 | export function DataTableEmpty(props: ParentProps<{ class?: string }>) { |
| 271 | return ( | 272 | return ( |
| 272 | - <div class={cn("rounded-lg border border-dashed border-border/80 bg-muted/20 px-4 py-10 text-center text-sm leading-6 text-muted-foreground", props.class)}> | 273 | + <div class={cn("rounded-2xl border border-dashed border-border/70 bg-muted/15 px-6 py-10 text-center text-sm leading-6 text-muted-foreground", props.class)}> |
| 273 | {props.children} | 274 | {props.children} |
| 274 | </div> | 275 | </div> |
| 275 | ); | 276 | ); |