import type { AvatarProps } from '@planview/pv-uikit'; import React from 'react'; import type { IconProps } from '@planview/pv-icons'; type GridCellDefaultIcon = { /** * Icon component */ icon?: React.ReactElement; /** * URL to avatar image or Avatar component */ avatar?: never; /** * Badge to display */ badge?: never; }; type GridCellDefaultAvatar = { /** * Icon component */ icon?: never; /** * URL to avatar image or Avatar component */ avatar?: string | React.ReactElement; /** * Badge to display */ badge?: never; }; type GridCellDefaultBadge = { /** * Icon component */ icon?: never; /** * URL to avatar image or Avatar component */ avatar?: never; /** * Badge to display */ badge?: string | number; }; type AnchorTagConfig = Pick, 'download' | 'rel' | 'target' | 'onClick'> & { url: string; preventNavigation?: boolean; }; export type GridCellDefaultProps = (GridCellDefaultIcon | GridCellDefaultAvatar | GridCellDefaultBadge) & { /** * Accessible tab index. You should generally pass through the tabIndex * provided to the Renderer component. */ tabIndex: number; /** * Display value */ label?: string; /** * String to pass to a tooltip around icon/avatar/badge. Note, if `align` is set * to `right` this content will appear on the right. */ leftContentTooltip?: string; /** * Background color to use. Should only use official colors in * the 0-200 range to be properly accessible with textPrimary unless * also setting a color to ensure accessible contrast. */ backgroundColor?: string; /** * Color to use for the text. Should use official text colors or custom * colors that have enough contrast against backgroundColor. */ color?: string; /** Renders a caret icon on the right on hover or focus */ withCaret?: boolean; /** Renders the value in bold to indicate aggregation */ aggregated?: boolean; /** * Using this prop will render the label as an anchor tag. Other elements * such as icon, avatar, and badge will be rendered outside the anchor tag. * * Accepts a `string` or a * ``` type AnchorTagConfig = { url: string rel?: string target?: string download?: string preventNavigation?: boolean onClick?: React.MouseEventHandler } ``` * When using the `AnchorTagConfig` the url (as href), rel, target, download and onClick will be passed to the anchor element * */ href?: string | AnchorTagConfig; /** * @deprecated Pass onClick to the `href` prop instead * @see {@link GridCellDefaultProps.href} * * Callback when link is clicked */ onLinkClick?: React.MouseEventHandler; /** Should the field use tabular (monospace) numbers? Defaults `align` to `right` if not overridden. */ numeric?: boolean; /** Should the content of the cell be right or left aligned. Defaults to `left` unless `numeric` is true. */ align?: 'left' | 'right'; }; declare const GridCellDefaultImpl: ({ label, tabIndex, avatar, aggregated, icon, badge, leftContentTooltip, backgroundColor, color, withCaret, href, onLinkClick, numeric, align, }: GridCellDefaultProps) => React.JSX.Element; /** * Implementation of [grid renderer default](https://design.planview.com/components/grid/grid-renderer-default) * which is used by the default to render all cells. * * Though a lot is supported by this component, the default cell renderer only * leverages one aspect: rendering content that is is ellipsed when it would * overflow the cell (and provides a tooltip when this happens). * * To fully leverage this component, use a cell Renderer function that returns this * component. * * ```tsx * const calendarColumn: Column = { * id: "date", * cell: { * Renderer: ({ label, tabIndex }) => ( * } * leftContentTooltip="Tooltip for calendar icon" * tabIndex={tabIndex} /> * ) * } * } * ``` */ export declare const GridCellDefault: typeof GridCellDefaultImpl; export {}; //# sourceMappingURL=cell-default.d.ts.map