Skip to content

Commit

Permalink
chore: update types in stories
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Apr 9, 2024
1 parent 7348336 commit 487fc8f
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions src/components/ActionsPanel/__stories__/ActionsPanel.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {Meta, Story} from '@storybook/react';
import {Meta, StoryFn} from '@storybook/react';

import {ActionsPanel, ActionsPanelProps} from '../../ActionsPanel';

Expand All @@ -11,7 +11,7 @@ export default {
component: ActionsPanel,
} as Meta;

const WithIconsTemplate: Story<ActionsPanelProps> = (args) => {
const WithIconsTemplate: StoryFn<ActionsPanelProps> = (args) => {
return (
<ActionsPanel
{...args}
Expand All @@ -22,7 +22,7 @@ const WithIconsTemplate: Story<ActionsPanelProps> = (args) => {
};
export const WithIcons = WithIconsTemplate.bind({});

const WithNoteTemplate: Story<ActionsPanelProps> = (args) => {
const WithNoteTemplate: StoryFn<ActionsPanelProps> = (args) => {
return (
<ActionsPanel
{...args}
Expand All @@ -34,12 +34,12 @@ const WithNoteTemplate: Story<ActionsPanelProps> = (args) => {
};
export const WithNote = WithNoteTemplate.bind({});

const GroupsTemplate: Story<ActionsPanelProps> = (args) => {
const GroupsTemplate: StoryFn<ActionsPanelProps> = (args) => {
return <ActionsPanel {...args} actions={actionsGroups} />;
};
export const Groups = GroupsTemplate.bind({});

const SubmenuTemplate: Story<ActionsPanelProps> = (args) => {
const SubmenuTemplate: StoryFn<ActionsPanelProps> = (args) => {
return <ActionsPanel {...args} actions={actionsSubmenu} />;
};
export const Submenu = SubmenuTemplate.bind({});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {Meta, Story} from '@storybook/react';
import {Meta, StoryFn} from '@storybook/react';

import {AdaptiveTabs, AdaptiveTabsProps} from '../AdaptiveTabs';

Expand All @@ -17,7 +17,7 @@ export default {
},
},
} as Meta;
const Template: Story<{size: 'm' | 'l' | 'xl'} & AdaptiveTabs<{}>> = (args) => {
const Template: StoryFn<{size: 'm' | 'l' | 'xl'} & AdaptiveTabs<{}>> = (args) => {
const [activeTab, setActiveTab] = React.useState('active');
const items: AdaptiveTabsProps<{}>['items'] = React.useMemo(
() => [
Expand Down Expand Up @@ -59,7 +59,7 @@ const Template: Story<{size: 'm' | 'l' | 'xl'} & AdaptiveTabs<{}>> = (args) => {
};
export const Default = Template.bind({});

const WrapTemplate: Story<AdaptiveTabsProps<{}>> = (args) => {
const WrapTemplate: StoryFn<AdaptiveTabsProps<{}>> = (args) => {
const [activeTab, setActiveTab] = React.useState('active');
const items: AdaptiveTabsProps<{}>['items'] = React.useMemo(
() => [
Expand Down Expand Up @@ -109,7 +109,7 @@ const WrapTemplate: Story<AdaptiveTabsProps<{}>> = (args) => {
};
export const Wrap = WrapTemplate.bind({});

const CustomTabTemplate: Story<AdaptiveTabsProps<{}>> = (args) => {
const CustomTabTemplate: StoryFn<AdaptiveTabsProps<{}>> = (args) => {
const [activeTab, setActiveTab] = React.useState('active');
return (
<div style={{resize: 'horizontal', overflow: 'auto'}}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import type {Meta, Story} from '@storybook/react';
import type {Meta, StoryFn} from '@storybook/react';

import {InfiniteScroll} from '../InfiniteScroll';

Expand All @@ -11,5 +11,5 @@ export default {
component: InfiniteScroll,
} as Meta;

export const Playground: Story = () => <InfiniteScrollShowcase />;
export const Playground: StoryFn = () => <InfiniteScrollShowcase />;
Playground.storyName = 'InfiniteScroll';
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {useArgs} from '@storybook/manager-api';
import {Meta, Story} from '@storybook/react';
import {Meta, StoryFn} from '@storybook/react';

import {ItemSelector, ItemSelectorProps} from '../ItemSelector';

Expand Down Expand Up @@ -56,7 +56,7 @@ export default {
},
} as Meta;

const DefaultTemplate: Story<ItemSelectorProps<{name: string; type: string}>> = (args) => {
const DefaultTemplate: StoryFn<ItemSelectorProps<{name: string; type: string}>> = (args) => {
const [, setStoryArgs] = useArgs();
return (
<ItemSelector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import {GraduationCap} from '@gravity-ui/icons';
import {Button} from '@gravity-ui/uikit';
import {actions} from '@storybook/addon-actions';
import type {Meta, Story} from '@storybook/react';
import type {Meta, StoryFn} from '@storybook/react';

import type {OnboardingMenuProps} from '../OnboardingMenu';
import {OnboardingMenu} from '../OnboardingMenu';
Expand All @@ -16,7 +16,7 @@ export default {
const actionsButtonHandlers = () => actions('onClick').onClick('Click on the button');
const actionsButtonComplete = () => actions('onClick').onClick('Click on the end button');

const DefaultTemplate: Story<OnboardingMenuProps> = (args) => {
const DefaultTemplate: StoryFn<OnboardingMenuProps> = (args) => {
const [expanded, setExpanded] = React.useState(false);

const actionsOnboardingMenuHandlers = (expanded: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import {Meta, Story} from '@storybook/react';
import {Meta, StoryFn} from '@storybook/react';

import {PlaceholderContainer} from '../PlaceholderContainer';

Expand All @@ -11,5 +11,5 @@ export default {
component: PlaceholderContainer,
} as Meta;

const ShowcaseTemplate: Story = () => <PlaceholderContainerShowcase />;
const ShowcaseTemplate: StoryFn = () => <PlaceholderContainerShowcase />;
export const Showcase = ShowcaseTemplate.bind({});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import type {ComponentMeta, ComponentStory} from '@storybook/react';
import type {Meta, StoryFn} from '@storybook/react';

import {SharePopover, sharePopoverDefaultProps} from '../SharePopover';

Expand All @@ -18,12 +18,12 @@ export default {
},
},
args: {...sharePopoverDefaultProps},
} as ComponentMeta<typeof SharePopover>;
} as Meta<typeof SharePopover>;

const DefaultTemplate: ComponentStory<typeof SharePopover> = (args) => <SharePopover {...args} />;
const DefaultTemplate: StoryFn<typeof SharePopover> = (args) => <SharePopover {...args} />;
export const Default = DefaultTemplate.bind({});

const ShowcaseTemplate: ComponentStory<typeof SharePopover & typeof SharePopoverDemo> = () => (
const ShowcaseTemplate: StoryFn<typeof SharePopover & typeof SharePopoverDemo> = () => (
<SharePopoverDemo />
);
export const Showcase = ShowcaseTemplate.bind({});
6 changes: 3 additions & 3 deletions src/components/StoreBadge/__stories__/StoreBadge.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import {Platform} from '@gravity-ui/uikit';
import {Meta, Story} from '@storybook/react';
import {Meta, StoryFn} from '@storybook/react';

import {StoreBadge, StoreBadgeProps} from '../StoreBadge';

Expand All @@ -13,11 +13,11 @@ export default {
},
} as Meta;

const Template: Story<StoreBadgeProps> = (args) => <StoreBadge {...args} />;
const Template: StoryFn<StoreBadgeProps> = (args) => <StoreBadge {...args} />;

export const Default = Template.bind({});

const WithHrefTemplate: Story<StoreBadgeProps> = (args) => (
const WithHrefTemplate: StoryFn<StoreBadgeProps> = (args) => (
<StoreBadge {...args} href="https://github.com/gravity-ui/uikit" />
);

Expand Down

0 comments on commit 487fc8f

Please sign in to comment.