@stasho/ds 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stasho/ds",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "stasho design system",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -221,43 +221,40 @@ export function Table<T>({
221
221
  </td>
222
222
  </tr>
223
223
  ) : (
224
- sortedData.map((row) => (
225
- <tr
226
- key={keyExtractor(row)}
227
- className={cn(
228
- "border-b border-edge transition-all",
229
- activeKey === keyExtractor(row)
230
- ? "bg-accent/15 shadow-[inset_3px_0_0_var(--accent)]"
231
- : "even:bg-muted/30",
232
- "hover:bg-muted/50",
233
- onRowClick &&
234
- "cursor-pointer hover:shadow-[inset_3px_0_0_var(--accent)]",
235
- )}
236
- aria-current={
237
- activeKey === keyExtractor(row) ? "true" : undefined
238
- }
239
- style={{ transitionDuration: "var(--duration-fast)" }}
240
- tabIndex={onRowClick ? 0 : undefined}
241
- onClick={onRowClick ? () => onRowClick(row) : undefined}
242
- onKeyDown={
243
- onRowClick
244
- ? (e) => handleRowKeyDown(e, row)
245
- : undefined
246
- }
247
- >
248
- {columns.map((col) => (
249
- <td
250
- key={col.id ?? col.header}
251
- className={cn(
252
- "px-4 py-3 text-sm",
253
- alignClass[col.align ?? "left"],
254
- )}
255
- >
256
- {col.accessor(row)}
257
- </td>
258
- ))}
259
- </tr>
260
- ))
224
+ sortedData.map((row) => {
225
+ const isActive = activeKey === keyExtractor(row);
226
+ return (
227
+ <tr
228
+ key={keyExtractor(row)}
229
+ className={cn(
230
+ "border-b border-edge transition-all",
231
+ isActive
232
+ ? "bg-accent/15 shadow-[inset_3px_0_0_var(--accent)] hover:bg-accent/20"
233
+ : "even:bg-muted/30 hover:bg-muted/50",
234
+ onRowClick && "cursor-pointer",
235
+ )}
236
+ aria-current={isActive ? "true" : undefined}
237
+ style={{ transitionDuration: "var(--duration-fast)" }}
238
+ tabIndex={onRowClick ? 0 : undefined}
239
+ onClick={onRowClick ? () => onRowClick(row) : undefined}
240
+ onKeyDown={
241
+ onRowClick ? (e) => handleRowKeyDown(e, row) : undefined
242
+ }
243
+ >
244
+ {columns.map((col) => (
245
+ <td
246
+ key={col.id ?? col.header}
247
+ className={cn(
248
+ "px-4 py-3 text-sm",
249
+ alignClass[col.align ?? "left"],
250
+ )}
251
+ >
252
+ {col.accessor(row)}
253
+ </td>
254
+ ))}
255
+ </tr>
256
+ );
257
+ })
261
258
  )}
262
259
  </tbody>
263
260
  </table>