import { ButtonProps, MenuContentProps, PopoverProps } from "@trackunit/react-components"; import { IconName } from "@trackunit/ui-icons"; import { ReactElement } from "react"; export type FilterVisualStyle = "button" | "list-item"; export interface FilterProps extends ButtonProps { /** * The title/name of the filter. */ title?: string; /** * Used to indicate if the user has any active selection in the filter. */ isActive?: boolean; /** * The label that will be displayed when the filter is active. */ activeLabel?: string; /** * The number of active options for multi select filters. */ activeOptionsCount?: number; /** * The icon to be displayed in the filter button. */ asIcon?: IconName; /** * When enabled the menu list padding will be removed, and a grid will be applied to keep the first column "sticky". * This intended to be used withe the FilterHeader component. * * @default false */ withStickyHeader?: boolean; /** * Child elements will be rendered inside the menu list and are only visible when the popover is open. */ children?: MenuContentProps["children"]; /** * Can be used to override the pops of the popover. * The render prop cannot be overridden. */ popoverProps?: Omit; /** * Can be used to override the props of the MenuContent. * The render prop cannot be overridden. */ menuListProps?: Omit; /** * A flag to set a filter component into readonly mode used for presenting filtering rules that cannot be change by user */ readOnly?: boolean; /** * The visual style of the filter. List-item or Button. * * @default "button" */ visualStyle?: FilterVisualStyle; /** * Only applies to `visualStyle="list-item"`. By default the row stops click propagation like any * other `MenuItem`, so opening its own submenu never bubbles up and dismisses a parent menu. Set to * `false` only when this row is deliberately composed as the trigger for an *external* popover * (e.g. `FilterBarMenuItem`), where the click needs to reach that outer `PopoverTrigger`. * * @default true */ listItemStopPropagation?: boolean; } /** * The Filter component is the base component used in the manager to filter data. * * - This component in generic and does not have any connection to the data. * - The base props extends button props, and any button props such as prefix and suffix can be used. * - Color and size has special default values in this component, but can be overridden if needed. * * To add items to the popover list use the children prop, this is where you build all the filter items and connected logic. * * @param {FilterProps} props - The props for the Filter component * @returns {ReactElement} Filter component */ export declare const Filter: ({ title, asIcon, children, popoverProps, isActive, activeLabel, activeOptionsCount, menuListProps, className, "data-testid": dataTestId, withStickyHeader, readOnly, visualStyle, size, listItemStopPropagation, }: FilterProps) => ReactElement;