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

Adds UnderlinePanels to drafts/ #4550

Merged
merged 37 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4a27922
adds UnderlinePanels components and stories
mperrotti May 1, 2024
393afbb
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti May 2, 2024
e9ac50c
adds tests, minor stylistic updates
mperrotti May 2, 2024
c05ac21
adds component docs
mperrotti May 2, 2024
5eef15a
adds changeset
mperrotti May 2, 2024
7c00947
corrects changeset
mperrotti May 2, 2024
0a87590
fixes circ dep, tests, misc bugs
mperrotti May 3, 2024
9eda952
more test fixes
mperrotti May 3, 2024
8b9c328
appease the linter
mperrotti May 3, 2024
f6a2067
updates snaps, fixes tiny visual regression
mperrotti May 3, 2024
8197cc0
test(vrt): update snapshots
mperrotti May 3, 2024
81b478c
cleanup
mperrotti May 9, 2024
b600b34
upgrades @github/tab-container-element
mperrotti May 9, 2024
b2f6daa
Merge branch 'main' into mp/underline-panels
mperrotti May 9, 2024
fa3f238
fixes createComponent import
mperrotti May 9, 2024
711fed0
updates jest snapshots
mperrotti May 9, 2024
1f2e1a9
Apply suggestion from @broccolinisoup
mperrotti May 13, 2024
047bfad
addresses PR feedback
mperrotti May 14, 2024
a2f0995
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti May 14, 2024
f728a01
Merge branch 'main' into mp/underline-panels
mperrotti May 15, 2024
7091c99
fix broken import
mperrotti May 15, 2024
ec55b9f
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti May 21, 2024
38e98ed
addresses more PR feedback
mperrotti May 21, 2024
426f8c0
Merge branch 'main' into mp/underline-panels
mperrotti May 21, 2024
0f0b58c
test(vrt): update snapshots
mperrotti May 21, 2024
86d5ef9
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti Jun 12, 2024
4dac206
Merge branch 'mp/underline-panels' of github.com:primer/react into mp…
mperrotti Jun 12, 2024
9d7e5d7
Merge branch 'main' into mp/underline-panels
mperrotti Jun 13, 2024
66e1ada
test(vrt): update snapshots
mperrotti Jun 13, 2024
efa5386
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti Jun 17, 2024
c601277
Merge branch 'mp/underline-panels' of github.com:primer/react into mp…
mperrotti Jun 17, 2024
13ad02a
Merge branch 'main' into mp/underline-panels
mperrotti Jun 17, 2024
43bb92e
adds fallbacks to CSS vars
mperrotti Jun 18, 2024
6db2049
Merge branch 'main' of github.com:primer/react into mp/underline-panels
mperrotti Jun 18, 2024
c55b637
fixes CSS typo
mperrotti Jun 18, 2024
744eb62
fixes more typos
mperrotti Jun 18, 2024
1cbc162
Merge branch 'main' into mp/underline-panels
mperrotti Jun 18, 2024
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
7 changes: 7 additions & 0 deletions .changeset/rotten-apples-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@primer/react': minor
---

Adds UnderlinePanels component. It's like UnderlineNav, but for rendering semantic tabs instead of links.

<!-- Changed components: UnderilnePanels -->
broccolinisoup marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
245 changes: 245 additions & 0 deletions e2e/components/UnderlinePanels.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
import {test, expect} from '@playwright/test'
import {visit} from '../test-helpers/storybook'
import {themes} from '../test-helpers/themes'

test.describe('UnderlinePanels', () => {
test.describe('Default', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels--default',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Default.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels--default',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('Labelled By External Element', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--labelled-by-external-element',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Labelled By External Element.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--labelled-by-external-element',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('Selected Tab', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--selected-tab',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.Selected Tab.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--selected-tab',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('With Counters', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-counters',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Counters.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-counters',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('With Counters In Loading State', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-counters-in-loading-state',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Counters In Loading State.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-counters-in-loading-state',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('With Icons', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-icons',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`UnderlineNav.With Icons.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-icons',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})

test.describe('With Icons Hidden On Narrow Screen', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-icons-hidden-on-narrow-screen',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(
`UnderlineNav.With Icons Hidden On Narrow Screen.${theme}.png`,
)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-underlinepanels-features--with-icons-hidden-on-narrow-screen',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})
})
Loading
Loading