-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
404 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 39 additions & 11 deletions
50
src/components/ActionTooltip/__stories__/ActionTooltip.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,52 @@ | ||
import React from 'react'; | ||
|
||
import type {StoryFn} from '@storybook/react'; | ||
import {FloppyDisk} from '@gravity-ui/icons'; | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import {Button} from '../../Button'; | ||
import {Icon} from '../../Icon'; | ||
import {ActionTooltip} from '../ActionTooltip'; | ||
import type {ActionTooltipProps} from '../ActionTooltip'; | ||
|
||
export default { | ||
const meta: Meta<typeof ActionTooltip> = { | ||
title: 'Components/Overlays/ActionTooltip', | ||
component: ActionTooltip, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
}; | ||
|
||
const DefaultTemplate: StoryFn<ActionTooltipProps> = (args) => <ActionTooltip {...args} />; | ||
export default meta; | ||
|
||
export const Default = DefaultTemplate.bind({}); | ||
type Story = StoryObj<typeof ActionTooltip>; | ||
|
||
Default.args = { | ||
title: 'Tooltip text', | ||
hotkey: 'mod+s', | ||
description: | ||
'Lorem ipsum is placeholder text commonly used in the graphic, print, and publishing industries for previewing layouts and visual mockups.', | ||
children: <Button>Hover to see tooltip</Button>, | ||
export const Default: Story = { | ||
render: (args) => { | ||
return ( | ||
<ActionTooltip {...args}> | ||
<Button> | ||
<Icon data={FloppyDisk} size={16} /> | ||
</Button> | ||
</ActionTooltip> | ||
); | ||
}, | ||
args: { | ||
title: 'Save', | ||
}, | ||
}; | ||
|
||
export const Hotkey: Story = { | ||
...Default, | ||
args: { | ||
...Default.args, | ||
hotkey: 'mod+s', | ||
}, | ||
}; | ||
|
||
export const Description: Story = { | ||
...Default, | ||
args: { | ||
...Default.args, | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua', | ||
}, | ||
}; |
Oops, something went wrong.