import React from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { DocsTemplate } from '../../../.storybook' import { toast } from '../Toast/Toast' import { filterStatesDummyData } from './filter-stories-helper' import Filter from './Filter' const meta: Meta = { title: 'Components/Filter/As Button Group', component: Filter, parameters: { docs: { page: () => ( The Filter component is a versatile and customizable form element that offers a variety of filter options to help users refine data and search results. It includes several child elements such as Select, MultiSelect, Toggle, Picker,TextInput,{' '} Datepicker, and allows the addition of other custom children elements. The Filter component empowers users to apply various filter criteria to quickly find the information they need. } infoBullets={[ Use the Filter component in data-heavy interfaces or search functionalities where users need to refine results based on specific criteria. , Provide clear labels and instructions for each filter option, guiding users on how to use the filters effectively. , The Filter component includes proper styling to maintain a cohesive and user-friendly design. , ]} /> ), }, }, } export default meta type Story = StoryObj const buttonGroupConfig = { buttons: [ { icon: 'settings' as const, onClick: () => { toast({ message: 'You clicked settings button', type: 'success' }) }, }, ], } const commonArgs = { filterStates: filterStatesDummyData, filterCallout: () => { toast({ message: 'You clicked filter button', type: 'success' }) }, cancelCallout: () => { toast({ message: 'You clicked cancel button', type: 'success' }) }, buttonGroupConfig, } const Template: Story = { render: (args) => { return }, } export const Basic: Story = { ...Template, args: { ...commonArgs, }, } export const Disabled: Story = { ...Template, args: { ...commonArgs, disableFilterButton: true, }, } export const AppliedFilter: Story = { ...Template, args: { ...commonArgs, appliedFilters: 4, }, } export const ThreeButtons: Story = { ...Template, args: { ...commonArgs, buttonGroupConfig: { ...buttonGroupConfig, buttons: [ ...buttonGroupConfig.buttons, { icon: 'config' as const, onClick: () => { toast({ message: 'You clicked config button', type: 'success' }) }, }, ], }, }, }