import { ReactNode } from 'react'; import { Filter, FilterItem } from '@wix/bex-core'; import { AccordionProps, PopoverCommonProps, TagListProps, } from '@wix/design-system'; import type { FieldType } from '../utils/fieldTypePrefixIcons'; export interface FilterProps { /** * A filter state object such as [ArrayFilter](./?path=/story/features-filter-factories--arrayfilter) * @external */ filter: Filter; /** * The field type string used to resolve a prefix icon for the filter. * Cairo maps this to the appropriate icon internally. * @external */ fieldType?: FieldType; /** * Padding settings. If this prop it omitted, padding will exist on the sides of the filter.

* Supported values:
* - `"button"`: Removes padding from the sides of the filter. * @external */ layout?: 'button'; /** * Customizes the filter in the toolbar.

* Supported properties:
* - `label`: [string] Prefix for the filter element. * @external */ toolbarItemProps?: { label?: ReactNode; }; /** * Customizes the filter tag in the toolbar.

* Supported properties:
* - `label`: [string] Overrides the default filter name when filtered tag is shown. * @external */ toolbarTagProps?: { label?: string; }; /** * Indicates whether the filter should be visible by default in the filters panel * @external */ initiallyOpen?: boolean; /** * Customizes the filter [accordion](https://www.docs.wixdesignsystem.com/?path=/story/components-lists--accordion).

* Supported properties:
* - `label`: [string] Accordion item title. You can also use `AccordionProps['items'][number].title` for more flexibility.
* - Extends [AccordionProps['items'[number]](https://www.docs.wixdesignsystem.com/?path=/story/components-lists--accordion). * @external */ accordionItemProps?: Required['items'][number] & { label?: string; }; /** * @deprecated */ popoverProps?: PopoverCommonProps; /** * Callback that's run when a filter is removed by a visitor from the sub-toolbar. * @param item * @external */ onAppliedFilterTagRemove?: (item: FilterItem) => unknown; /** * Customizes how the tag list in the sub-toolbar is rendered. *

* Extends [`TagListProps['tags'][number]`](https://www.docs.wixdesignsystem.com/?path=/story/components-lists-table--taglist). * @external */ renderToolbarTag?: ( item: FilterItem, ) => Partial; explodeTags?: boolean; /** * Title for the section in the accordion. * @external */ sectionTitle?: string; }