Skip to content

Commit

Permalink
chore(Button): add actions addon
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork authored and testUser346 committed May 17, 2024
1 parent d93f5b4 commit 0122e6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config: StorybookConfig = {
defaultName: 'Docs',
},
addons: [
'@storybook/addon-actions',
'@storybook/preset-scss',
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
'./theme-addon/register.tsx',
Expand Down
12 changes: 11 additions & 1 deletion src/components/Button/__stories__/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Globe,
Heart,
} from '@gravity-ui/icons';
import {action} from '@storybook/addon-actions';
import type {Meta, StoryObj} from '@storybook/react';

import {Showcase} from '../../../demo/Showcase';
Expand Down Expand Up @@ -41,7 +42,16 @@ export default {

type Story = StoryObj<typeof Button>;

export const Default: Story = {args: {children: 'Button'}};
export const Default: Story = {
args: {
children: 'Button',
onClick: action('onClick'),
onMouseEnter: action('onMouseEnter'),
onMouseLeave: action('onMouseLeave'),
onFocus: action('onFocus'),
onBlur: action('onBlur'),
},
};

export const View: Story = {
render: (args) => <ButtonViewShowcase {...args} />,
Expand Down

0 comments on commit 0122e6b

Please sign in to comment.