Add a type on CatalogDecorator (#1742)

* Add a type on CatalogDecorator

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>

* Type more catalogs

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>

---------

Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Matheus <matheus_benini@hotmail.com>
This commit is contained in:
gitstart-twenty
2023-09-28 12:44:55 +03:00
committed by GitHub
parent aa0c61bed9
commit b2bac0b217
29 changed files with 101 additions and 54 deletions
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import {
Button,
@@ -37,7 +38,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof Button> = {
args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -109,7 +110,7 @@ export const Catalog: Story = {
decorators: [CatalogDecorator],
};
export const SoonCatalog: Story = {
export const SoonCatalog: CatalogStory<Story, typeof Button> = {
args: { title: 'Filter', Icon: IconSearch, soon: true },
argTypes: {
size: { control: false },
@@ -181,7 +182,7 @@ export const SoonCatalog: Story = {
decorators: [CatalogDecorator],
};
export const PositionCatalog: Story = {
export const PositionCatalog: CatalogStory<Story, typeof Button> = {
args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconCheckbox, IconNotes, IconTimelineEvent } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import { Button, ButtonAccent, ButtonSize, ButtonVariant } from '../Button';
import { ButtonGroup } from '../ButtonGroup';
@@ -32,7 +33,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof ButtonGroup> = {
args: {
children: [
<Button Icon={IconNotes} title="Note" />,
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import { FloatingButton, FloatingButtonSize } from '../FloatingButton';
@@ -31,7 +32,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof FloatingButton> = {
args: { title: 'Filter', Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconCheckbox, IconNotes, IconTimelineEvent } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import { FloatingButton, FloatingButtonSize } from '../FloatingButton';
import { FloatingButtonGroup } from '../FloatingButtonGroup';
@@ -30,7 +31,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof FloatingButtonGroup> = {
args: {
children: [
<FloatingButton Icon={IconNotes} />,
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import {
FloatingIconButton,
@@ -33,7 +34,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof FloatingIconButton> = {
args: { Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconCheckbox, IconNotes, IconTimelineEvent } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import { FloatingIconButtonSize } from '../FloatingIconButton';
import { FloatingIconButtonGroup } from '../FloatingIconButtonGroup';
@@ -32,7 +33,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof FloatingIconButtonGroup> = {
argTypes: {
size: { control: false },
},
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import {
IconButton,
@@ -33,7 +34,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof IconButton> = {
args: { Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -103,7 +104,7 @@ export const Catalog: Story = {
decorators: [CatalogDecorator],
};
export const PositionCatalog: Story = {
export const PositionCatalog: CatalogStory<Story, typeof IconButton> = {
args: { Icon: IconSearch },
argTypes: {
size: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconCheckbox, IconNotes, IconTimelineEvent } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import {
IconButtonAccent,
@@ -38,7 +39,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof IconButtonGroup> = {
argTypes: {
size: { control: false },
variant: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import { LightButton, LightButtonAccent } from '../LightButton';
@@ -29,7 +30,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof LightButton> = {
args: { title: 'Filter', icon: <IconSearch /> },
argTypes: {
accent: { control: false },
@@ -3,6 +3,7 @@ import { Meta, StoryObj } from '@storybook/react';
import { IconSearch } from '@/ui/icon';
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
import { CatalogStory } from '~/testing/types';
import {
LightIconButton,
@@ -33,7 +34,7 @@ export const Default: Story = {
decorators: [ComponentDecorator],
};
export const Catalog: Story = {
export const Catalog: CatalogStory<Story, typeof LightIconButton> = {
args: { title: 'Filter', Icon: IconSearch },
argTypes: {
accent: { control: false },