-
Notifications
You must be signed in to change notification settings - Fork 543
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix: ButtonGroup with Tooltips (#5123)
* messy stuff * fix loading button group styles * lint * Create clean-camels-train.md * remove button changes * fix(TooltipV2): check for interactive content two levels down * empty case * add test * lint * test sxprop change * revert for separate pr * test(vrt): update snapshots * test(vrt): update snapshots --------- Co-authored-by: Armagan Ersoz <[email protected]> Co-authored-by: Marie Lucca <[email protected]> Co-authored-by: langermank <[email protected]> Co-authored-by: Jon Rohan <[email protected]>
- Loading branch information
1 parent
8e481ca
commit becad7d
Showing
28 changed files
with
288 additions
and
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
Bug fix: ButtonGroup with Tooltip border-radius is incorrect |
Binary file added
BIN
+6.57 KB
...s/ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.55 KB
...nents/ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.66 KB
...uttonGroup.test.ts-snapshots/ButtonGroup-Overrides-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.57 KB
...s/components/ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.57 KB
...s/ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.66 KB
.../ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.77 KB
...ttonGroup.test.ts-snapshots/ButtonGroup-Overrides-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.66 KB
.../components/ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.66 KB
.../ButtonGroup.test.ts-snapshots/ButtonGroup-Overrides-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+306 Bytes
(100%)
...erlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+618 Bytes
(100%)
...s/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+309 Bytes
(100%)
...ay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+453 Bytes
(100%)
...mponents/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+306 Bytes
(100%)
...erlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+854 Bytes
(110%)
...rlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+203 Bytes
(100%)
...y.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+269 Bytes
(100%)
...ponents/Overlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+274 Bytes
(100%)
...rlay.test.ts-snapshots/Overlay-Memex-Nested-Overlays-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+102 Bytes
(100%)
.../Overlay.test.ts-snapshots/Overlay-Nested-Overlays-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+90 Bytes
(100%)
...Overlay.test.ts-snapshots/Overlay-Nested-Overlays-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
65 changes: 65 additions & 0 deletions
65
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,65 @@ | ||
import React from 'react' | ||
import type {Meta} from '@storybook/react' | ||
import ButtonGroup from './ButtonGroup' | ||
import {Button, IconButton, LinkButton} from '../Button' | ||
import {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> | ||
) | ||
|
||
export const ButtonGroupSingleButton = () => ( | ||
<ButtonGroup> | ||
<IconButton icon={CopilotIcon} aria-label="Open GitHub Copilot chat" /> | ||
<div></div> | ||
</ButtonGroup> | ||
) | ||
|
||
export const LinkButtonWithIconButtons = () => ( | ||
<ButtonGroup> | ||
<LinkButton size="small" sx={{color: 'deeppink'}} href="https://primer.style"> | ||
Small link | ||
</LinkButton> | ||
<Button className="testCustomClassnameColor">Pink link</Button> | ||
<IconButton icon={CopilotIcon} aria-label="Open GitHub Copilot chat" /> | ||
<IconButton icon={CopilotIcon} aria-label="Open GitHub Copilot chat" /> | ||
</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.