import { Key, KeyboardEvent, MouseEvent, ReactNode } from 'react'; import { BorderRadiusSize as BorderRadius, BreakpointSize, HeightSize, SpacingSize, WidthSize } from '@palmetto/palmetto-design-tokens/build/types'; export type { BackgroundColor, BorderColor, BorderSize, BoxShadowSize, BrandColor, BreakpointSize, FontColor, FontFamily, FontSize, FontWeight, HeightSize, IconName, LineHeightSize, OpacitySize, SpacingSize, WidthSize, ZIndexSize, } from '@palmetto/palmetto-design-tokens/build/types'; export declare type BreakpointSizeWithBase = BreakpointSize | 'base'; export declare type Breakpoint = { name: BreakpointSizeWithBase; minWidth: number; }; export declare type DimensionSize = WidthSize | HeightSize; export declare type UnknownPropertiesObjType = { [key: string]: any; }; export interface FlexProperty { flexGrow?: number | string; flexShrink?: number | string; flexBasis?: number | string; flex?: number | string; } export declare type StylesAndClasses = { styles?: T; classes?: string[]; }; export declare type CssDimensionAbbreviation = 'h' | 'w' | 'mw' | 'mh' | 'minw' | 'minh'; export declare type CssDimensionUnit = 'px' | 'rem' | 'em' | '%'; export declare type CssDimensionValue = `${number}${CssDimensionUnit}`; export declare type CssSpacingAbbreviation = 'm' | 'p'; export declare type CssJustifyContentValue = 'space-around' | 'space-between' | 'center' | 'flex-end' | 'space-evenly' | 'flex-start' | 'stretch'; export declare type CssAlignContentValue = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around'; export declare type CssFlexDirectionValue = 'column' | 'column-reverse' | 'row' | 'row-reverse' | undefined; export declare type CssAlignItemsValue = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'; export declare type CssFlexValue = 'auto' | 'initial' | 'none' | 'inherit' | 'unset'; export declare type CssOverflowValue = 'visible' | 'hidden' | 'clip' | 'scroll' | 'auto' | 'inherit' | 'initial' | 'unset'; export declare type CssDisplayValue = 'none' | 'flex' | 'inline-flex' | 'block' | 'inline-block' | 'inline' | 'inherit' | 'grid' | 'table-cell'; export declare type CssTextAlignValue = 'left' | 'center' | 'right'; export declare type BaseSpacing = SpacingSize | string | undefined; export declare type BorderRadiusSize = BorderRadius | string | undefined; export declare type ResponsiveProp = { [breakpoint in BreakpointSizeWithBase]?: T; }; export declare type Row = UnknownPropertiesObjType; export declare type Cell = string | number | { [key: string]: unknown; } | unknown[]; export declare type Column = { /** * Text alignment for column cells (including header alignment). Cells will default to left if not defined. */ align?: 'left' | 'right' | 'center'; /** * CSS Class to be applied uniformly to all individual cells in a column. */ cellClassName?: string | ((cell?: Cell, row?: Row, rowIndex?: number) => string); /** * The key value to be rendered based on the table `rows`. */ dataKey?: string; /** * Placeholder for empty cells Applies only to the cells of the particular column with this prop. */ emptyCellPlaceholder?: string | number | undefined; /** * The heading/title of a column. */ heading?: ReactNode; /** * CSS Class to be applied to the column header cell. */ headerClassName?: string; /** * A custom key to be used when rendering the column array. * Not required as our table auto-generates static, but unique column keys if not passed in. */ key?: Key; /** * Whether the column data is sortable. Controls whether sorting controls should be displayed. */ isSortable?: boolean; /** * Render method for column cell data. Provides ability to render any aspect of the cell/row with custom * markup. */ render?: (cell?: Cell, row?: Row, rowIndex?: number) => ReactNode; /** * Whether the column is stuck to the left or right. */ sticky?: 'left' | 'right'; /** * Whether long text should be truncated based on column width. Use in tandem with column width as well as * `useFixedWidthColumns` prop in the parent table. */ truncateOverflow?: boolean; /** * Specific width of the column. Use in tandem with `useFixedWidthColumns` in the parent table. */ width?: number; }; export declare type EventWithColumnKey = (MouseEvent | KeyboardEvent) & { sortedKey: Key | undefined; }; export declare type ValueFunction = (arg: TArg) => TValue; export declare type ValueOrFunction = TValue | ValueFunction;