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:
@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
|
||||
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
import { CatalogStory } from '~/testing/types';
|
||||
|
||||
import {
|
||||
AutosizeTextInput,
|
||||
@ -23,7 +24,7 @@ export const ButtonVariant: Story = {
|
||||
args: { variant: AutosizeTextInputVariant.Button },
|
||||
};
|
||||
|
||||
export const Catalog: Story = {
|
||||
export const Catalog: CatalogStory<Story, typeof AutosizeTextInput> = {
|
||||
parameters: {
|
||||
catalog: {
|
||||
dimensions: [
|
||||
|
||||
@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
|
||||
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
import { CatalogStory } from '~/testing/types';
|
||||
|
||||
import {
|
||||
Checkbox,
|
||||
@ -29,7 +30,7 @@ export const Default: Story = {
|
||||
decorators: [ComponentDecorator],
|
||||
};
|
||||
|
||||
export const Catalog: Story = {
|
||||
export const Catalog: CatalogStory<Story, typeof Checkbox> = {
|
||||
args: {},
|
||||
argTypes: {
|
||||
variant: { control: false },
|
||||
@ -52,6 +53,7 @@ export const Catalog: Story = {
|
||||
if (state === 'indeterminate') {
|
||||
return { indeterminate: true };
|
||||
}
|
||||
return {};
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react';
|
||||
|
||||
import { CatalogDecorator } from '~/testing/decorators/CatalogDecorator';
|
||||
import { ComponentDecorator } from '~/testing/decorators/ComponentDecorator';
|
||||
import { CatalogStory } from '~/testing/types';
|
||||
|
||||
import { LabelPosition, Radio, RadioSize } from '../Radio';
|
||||
|
||||
@ -23,7 +24,7 @@ export const Default: Story = {
|
||||
decorators: [ComponentDecorator],
|
||||
};
|
||||
|
||||
export const Catalog: Story = {
|
||||
export const Catalog: CatalogStory<Story, typeof Radio> = {
|
||||
args: {
|
||||
value: 'Radio',
|
||||
},
|
||||
@ -52,7 +53,7 @@ export const Catalog: Story = {
|
||||
{
|
||||
name: 'labelPosition',
|
||||
values: Object.values(LabelPosition),
|
||||
props: (labelPosition: string) => ({
|
||||
props: (labelPosition: LabelPosition) => ({
|
||||
labelPosition,
|
||||
}),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user