-
Notifications
You must be signed in to change notification settings - Fork 584
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
6 changed files
with
211 additions
and
49 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
47 changes: 47 additions & 0 deletions
47
packages/react/src/ButtonGroup/ButtonGroup.dev.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import ButtonGroup from './ButtonGroup' | ||
import {Button, IconButton} from '../Button' | ||
import {PlusIcon, DashIcon, CopilotIcon} from '@primer/octicons-react' | ||
import {Box, Tooltip, ThemeProvider, BaseStyles} from '..' | ||
|
||
const meta: Meta<typeof ButtonGroup> = { | ||
title: 'Components/ButtonGroup/DevOnly', | ||
component: ButtonGroup, | ||
decorators: [ | ||
Story => { | ||
// Add some padding to the wrapper box to make sure tooltip v1 is always in the viewport | ||
return ( | ||
<ThemeProvider> | ||
<BaseStyles> | ||
<Box padding={5}>{Story()}</Box> | ||
</BaseStyles> | ||
</ThemeProvider> | ||
) | ||
}, | ||
], | ||
} | ||
|
||
export default meta | ||
|
||
export const LinkAndButtonWithTooltip2 = () => ( | ||
<ButtonGroup sx={{pl: 2}}> | ||
<Tooltip text="Additional info about the link"> | ||
<Button as="a" href="https://primer.style"> | ||
Link | ||
</Button> | ||
</Tooltip> | ||
<IconButton icon={CopilotIcon} aria-label="Open GitHub Copilot chat" /> | ||
</ButtonGroup> | ||
) | ||
|
||
export const ButtonAndLinkWithTooltip2 = () => ( | ||
<ButtonGroup sx={{pl: 2}}> | ||
<IconButton icon={CopilotIcon} aria-label="Open GitHub Copilot chat" /> | ||
<Tooltip text="Additional info about the link"> | ||
<Button as="a" href="https://primer.style"> | ||
Link | ||
</Button> | ||
</Tooltip> | ||
</ButtonGroup> | ||
) |
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
Oops, something went wrong.