From 0122e6b8ed84a6268c683b8e598ab064c0722b42 Mon Sep 17 00:00:00 2001 From: itwillwork Date: Fri, 17 May 2024 16:45:29 +0300 Subject: [PATCH 1/2] chore(Button): add actions addon --- .storybook/main.ts | 1 + src/components/Button/__stories__/Button.stories.tsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 8d00b405aa..3ace5ea36c 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -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', diff --git a/src/components/Button/__stories__/Button.stories.tsx b/src/components/Button/__stories__/Button.stories.tsx index 68a5363f5a..ecd4c57206 100644 --- a/src/components/Button/__stories__/Button.stories.tsx +++ b/src/components/Button/__stories__/Button.stories.tsx @@ -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'; @@ -41,7 +42,16 @@ export default { type Story = StoryObj; -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) => , From de71d6ad0320fe340cc081df92d9c3ad53b44f79 Mon Sep 17 00:00:00 2001 From: itwillwork Date: Mon, 20 May 2024 13:48:26 +0300 Subject: [PATCH 2/2] chore(Button): remove actions addon --- .storybook/main.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index 3ace5ea36c..8d00b405aa 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -7,7 +7,6 @@ const config: StorybookConfig = { defaultName: 'Docs', }, addons: [ - '@storybook/addon-actions', '@storybook/preset-scss', {name: '@storybook/addon-essentials', options: {backgrounds: false}}, './theme-addon/register.tsx',