import { applicationConfig, type Meta, type StoryObj } from '@storybook/angular'; import { importProvidersFrom } from '@angular/core'; // components import { CaToastMessagesComponent } from './ca-toast-messages.component'; // modules import { AngularSvgIconModule, SvgIconRegistryService } from 'angular-svg-icon'; import { HttpClientModule } from '@angular/common/http'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; // enums import { eToastType } from './enums'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories const meta: Meta = { title: 'Example/CaToastMessages', component: CaToastMessagesComponent, tags: ['autodocs'], decorators: [ applicationConfig({ providers: [ SvgIconRegistryService, importProvidersFrom( HttpClientModule, BrowserAnimationsModule, AngularSvgIconModule.forRoot() ), ], }), ], argTypes: { type: { control: 'object', }, toastTitle: { control: 'object', }, toastMessage: { control: 'object', }, additionalMessage: { control: 'object', }, isFailedMessage: { control: 'boolean', }, isStorybookExample: { control: 'boolean', } }, }; export default meta; type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args export const Added: Story = { args: { type: eToastType.ADD, toastTitle: 'ADDED NEW LOAD', toastMessage: 'IVS847', isStorybookExample: true, toastIndex: 8, toastLength: 10, }, }; export const Edited: Story = { args: { type: eToastType.EDIT, toastTitle: 'EDITED LOAD', toastMessage: 'IVS847', isStorybookExample: true, }, }; export const Activated: Story = { args: { type: eToastType.ACTIVATE, toastTitle: 'ACTIVATED LOAD', toastMessage: 'IVS847', additionalMessage: '| Freight Load 58', isStorybookExample: true, }, }; export const Deleted: Story = { args: { type: eToastType.DELETE, toastTitle: 'DELETED LOAD', toastMessage: 'IVS847', isStorybookExample: true, }, }; export const Failed: Story = { args: { type: eToastType.ADD, toastTitle: 'FAILDED TO ADD LOAD', toastMessage: 'IVS847', isFailedMessage: true, isStorybookExample: true, }, };