import { css } from 'ecij'; import type { RenderGroupCellContentProps } from '../types'; const groupCellContent = css` @layer rdg.GroupCellContent { outline: none; } `; const groupCellContentClassname = `rdg-group-cell-content ${groupCellContent}`; const caret = css` @layer rdg.GroupCellCaret { margin-inline-start: 4px; stroke: currentColor; stroke-width: 1.5px; fill: transparent; vertical-align: middle; @media (prefers-reduced-motion: no-preference) { > path { transition: d 0.1s; } } } `; const caretClassname = `rdg-caret ${caret}`; export function renderToggleGroup(props: RenderGroupCellContentProps) { return ; } export function ToggleGroup({ row, tabIndex, toggleGroup }: RenderGroupCellContentProps) { function handleKeyDown({ key }: React.KeyboardEvent) { if (key === 'Enter') { toggleGroup(); } } const d = row.isExpanded ? 'M1 1 L 7 7 L 13 1' : 'M1 7 L 7 1 L 13 7'; return ( {row.groupKey} ); }