Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 677
feat(ConfirmationDialog): Convert ConfirmationDialog to CSS modules behind team feature flag #5331
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0bd72709cc76cb169340aa2783181916117239a584ee4dfb514ef1ae49e25964b381b13afa403File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@primer/react": minor | ||
| --- | ||
| Convert ConfirmationDialog to CSS modules behind feature flag |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import {test, expect} from '@playwright/test' | ||
| import {visit} from '../test-helpers/storybook' | ||
| import {themes} from '../test-helpers/themes' | ||
| const stories = [ | ||
| { | ||
| title: 'Default', | ||
| id: 'components-confirmationdialog--default', | ||
| }, | ||
| { | ||
| title: 'Playground', | ||
| id: 'components-confirmationdialog--playground', | ||
| }, | ||
| { | ||
| title: 'Shorthand Hook', | ||
| id: 'components-confirmationdialog-features--shorthand-hook', | ||
| }, | ||
| { | ||
| title: 'Shorthand Hook From Action Menu', | ||
| id: 'components-confirmationdialog-features--shorthand-hook-from-action-menu', | ||
| }, | ||
| ] as const | ||
| test.describe('ConfirmationDialog', () => { | ||
| for (const story of stories) { | ||
| test.describe(story.title, () => { | ||
| for (const theme of themes) { | ||
| test.describe(theme, () => { | ||
| test('@vrt', async ({page}) => { | ||
| await visit(page, { | ||
| id: story.id, | ||
| globals: { | ||
| colorScheme: theme, | ||
| }, | ||
| args: {open: true}, | ||
| }) | ||
| // Default state | ||
| expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( | ||
| `ConfirmationDialog.${story.title}.${theme}.png`, | ||
| ) | ||
| // Focus state | ||
| await page.keyboard.press('Tab') | ||
| expect(await page.screenshot({animations: 'disabled'})).toMatchSnapshot( | ||
| `ConfirmationDialog.${story.title}.focus.${theme}.png`, | ||
| ) | ||
| }) | ||
| test('axe @aat', async ({page}) => { | ||
| await visit(page, { | ||
| id: story.id, | ||
| globals: { | ||
| colorScheme: theme, | ||
| }, | ||
| args: {open: true}, | ||
| }) | ||
| await expect(page).toHaveNoViolations() | ||
| }) | ||
| }) | ||
| } | ||
| }) | ||
| } | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| .ConfirmationHeader { | ||
| display: flex; | ||
| padding: var(--base-size-8); | ||
| flex-direction: row; | ||
| > h1 { | ||
| padding: var(--base-size-6) var(--base-size-8); | ||
| /* override default margin */ | ||
| margin: 0; | ||
| font-size: var(--text-title-size-medium); | ||
| font-weight: var(--text-title-weight-medium); | ||
| flex-grow: 1; | ||
| } | ||
| } | ||
| .ConfirmationBody { | ||
| padding: 0 var(--base-size-16) var(--base-size-16) var(--base-size-16); | ||
| font-size: var(--text-body-size-medium); | ||
| flex-grow: 1; | ||
| } | ||
| .ConfirmationFooter { | ||
| display: grid; | ||
| grid-auto-flow: column; | ||
| grid-auto-columns: max-content; | ||
| grid-gap: var(--base-size-8); | ||
| align-items: end; | ||
| justify-content: end; | ||
| padding: var(--base-size-4) var(--base-size-16) var(--base-size-16); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I don't believe we allow custom styling for this component, I didn't bother adding a
classNameprop. Not sure if we should always add one regardless or not if the component doesn't utilizesxor custom styles?