import * as React from 'react'; import { SortDir, ColumnDef } from './types.js'; import { ColumnCellKind } from '../../lib/column-cell-kind.js'; import { StatusBadgeTone } from '../../lib/status-badge-tints.js'; import '../../lib/table-properties-types.js'; /** * DataTable cells use `max-w-0` + `overflow-hidden` for truncation. Outset * focus rings paint outside the control and get clipped to corner stubs. * Force inset rings on common focusable descendants (hub cell renderers, * links, icon buttons, checkboxes, Tip `tabIndex={0}` glyphs). * * `p-1 -m-1` covers what `ring-inset` cannot: a plain `outline`, which several * focusable descendants use instead of a ring and which has no inset form. The * padding grows the clip box while the negative margin keeps the content box the * same size and in the same place, so truncation is unchanged and a link or Tip * glyph flush with the cell's leading edge keeps its whole indicator. */ declare const CELL_CLIP_FOCUS_INSET_CLASS = "p-1 -m-1 [&_a:focus-visible]:ring-inset [&_button:focus-visible]:ring-inset [&_[role=checkbox]:focus-visible]:ring-inset [&_[tabindex]:focus-visible]:ring-inset"; /** When `ColumnDef.label` is empty, use a standard name for select/actions columns. */ declare function defaultColumnHeaderLabel(key: string): string | undefined; /** * Side padding for a column whose content is a control rather than text. * * `px-3` is right for text, which has nothing to lose by starting 12px in. It is * wrong for a fixed-size control: a 48px actions column left 24px of cell for a * 32px icon button, and since cells clip (`max-w-0` + `overflow-hidden`, so long * text truncates) the button lost 4px off each side along with the near edges of * its focus ring. Keyboard focus then read as a ring sliced flat top and bottom. * * 4px keeps the control's own box intact in a 48px column and still reads as a * gutter, because the control is centred and narrower than the cell. */ declare const CONTROL_COLUMN_PADDING = "px-1"; /** * The group divider's own box. Shared by the row in the table and by the * clone that pins under the column header, because the clone only reads as * the same bar if it is measured and painted as one — the pin maths uses the * real row's height for the hand-off. */ declare const GROUP_BAR_CLASS = "flex items-center gap-2 px-4 py-1.5 text-xs font-semibold text-muted-foreground tracking-wide bg-dt-group-bg select-none"; /** * With a checkbox leading the bar, the bar's own start padding is dropped: the * checkbox is centred inside a slot the width of the select column instead, so * it lands on the same axis as the row checkboxes beneath it rather than 4px to * their right (the column is 40px with a 16px control, so its centre is 20px; * `px-4` put the bar's box at 16px). */ declare const GROUP_BAR_WITH_SELECT_CLASS = "ps-0 gap-3"; /** * How far a group divider travels from the neutral divider grey toward its * status fill. Not the full fill: the divider is a full-bleed band, and at 100% * it stops reading as a divider and starts reading as a section of coloured * rows. 55% is far enough to name the status at a glance and near enough to keep * the band quieter than the chip sitting on it. */ declare const GROUP_TINT_STRENGTH = 55; /** * The divider's fill for a group whose column declared a tone for this value. * Mixed in `oklab`, not `oklch`: OKLCH interpolates hue the short way round, and * amber (80°) toward the grey divider (270°) swings through red, so a warning * band came out pink. */ declare function groupBarTint(tone: StatusBadgeTone): string; /** * `select` is the group's own checkbox, and the slot it sits in is the select * column's box. `gap-3` after it matches the data columns' `px-3`, so the group * label starts on the same axis as the first column's text. * * The pinned clone passes a non-interactive mirror, so the bar does not change * shape as it pins. */ declare function groupBarContent(groupLabel: React.ReactNode, count: number, select?: React.ReactNode, selectSlotWidth?: number): React.ReactNode; /** * What `useTableState` groups rows under when the grouped field is empty. * The divider says `None` instead: a lone dash is not a word, and the band is * a heading (`exxat-copy-discipline`). */ declare const GROUP_EMPTY_KEY = "\u2014"; /** Sub-rows a split cell shows before it collapses the rest into "+N more". */ declare const SPLIT_MAX_VISIBLE = 4; /** Cell kinds whose own icon would say less than the group's name already does. */ declare const GROUP_KIND_PLAIN: ReadonlySet; /** * A group heading in the grouped column's own vocabulary, for columns that do * not ship `filter.options` to render from. * * A person column groups on the display name, so the divider can rebuild the * identity the cells show — avatar plus name, no email, because the band is one * line and a heading, not a record (`exxat-person-identity-display`). Every * other kind leads with the icon its filter menu uses, so "Type", "Level", and * "Due" dividers are told apart at a glance by the same mark the reader already * associates with that column. */ declare function groupKindNode(label: string, kind: ColumnCellKind | undefined): React.ReactNode; /** Columns the table lays out around a control, not around text. */ declare function isControlColumn(key: string): boolean; declare function resolvedColumnLabel(col: ColumnDef): string; declare const SortChevron: React.NamedExoticComponent<{ dir: SortDir; }>; declare function stickyShadow(pin: "left" | "right" | undefined): string; /** * A mouse click leaves DOM focus parked on the element (a column's ⋯ trigger) * with no visible ring, and Radix restores that focus when the menu closes. * The sticky header only needs to yield to focus that is actually *drawn*, so * plain `:focus` would let one mouse click suppress the sticky clone for the * rest of the session. */ declare function hasVisibleFocus(el: Element | null | undefined): boolean; export { CELL_CLIP_FOCUS_INSET_CLASS, CONTROL_COLUMN_PADDING, GROUP_BAR_CLASS, GROUP_BAR_WITH_SELECT_CLASS, GROUP_EMPTY_KEY, GROUP_KIND_PLAIN, GROUP_TINT_STRENGTH, SPLIT_MAX_VISIBLE, SortChevron, defaultColumnHeaderLabel, groupBarContent, groupBarTint, groupKindNode, hasVisibleFocus, isControlColumn, resolvedColumnLabel, stickyShadow };