Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(link): warn if link opens in new tab but no tooltip or label for icon is provided #710

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 84 additions & 12 deletions src/components/ButtonCircleLink/ButtonCircleLink.unit.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot 1`] = `
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down Expand Up @@ -79,9 +85,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot when a ghost 1`] =
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -130,9 +142,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot when a ghost and di
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -176,9 +194,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot when color is outli
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -224,8 +248,14 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot when color is outli
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down Expand Up @@ -272,9 +302,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot when disabled 1`] =
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -318,8 +354,14 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with className 1`]
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down Expand Up @@ -362,9 +404,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with color 1`] = `
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -410,8 +458,14 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with id 1`] = `
data-size={40}
href="https://www.webex.com"
id="example-id"
onBlur={[Function]}
onFocus={[Function]}
rel=""
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down Expand Up @@ -454,9 +508,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with size 1`] = `
data-shallow-disabled={false}
data-size={64}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
>
X
<div
className="md-link-container"
>
X
</div>
</a>
</FocusRing>
</FocusRing>
Expand Down Expand Up @@ -509,13 +569,19 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with style 1`] = `
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
style={
Object {
"color": "pink",
}
}
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down Expand Up @@ -559,9 +625,15 @@ exports[`<ButtonCircleLink /> snapshot should match snapshot with title 1`] = `
data-shallow-disabled={false}
data-size={40}
href="https://www.webex.com"
onBlur={[Function]}
onFocus={[Function]}
rel=""
title="Example Text"
/>
>
<div
className="md-link-container"
/>
</a>
</FocusRing>
</FocusRing>
</Link>
Expand Down
22 changes: 18 additions & 4 deletions src/components/ButtonPillLink/ButtonPillLink.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,29 @@ Tooltip.args = {

const Overflow = Template<ButtonPillLinkProps>(ButtonPillLink).bind({});

Overflow.decorators = [
// eslint-disable-next-line react/display-name
(Story) => (
<div>
<style>
{`.md-button-pill-link-wrapper .md-link-container {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
display: inline-block;
width: 100%;
}`}
</style>
<Story />
</div>
),
];

Overflow.args = {
children: 'This is a very long label',
title: 'This is a very long label',
style: {
width: '12rem',
display: 'inline-block',
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
},
};

Expand Down
Loading
Loading