-
Notifications
You must be signed in to change notification settings - Fork 646
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0bd7270
Add files for module convert
TylerJDev 9cc76cb
Add e2e test file
TylerJDev 169340a
Lint and format
TylerJDev a278318
test(vrt): update snapshots
TylerJDev 1916117
Add `open` to storybook args
TylerJDev 239a584
Add args to vrt/aat
TylerJDev ee4dfb5
test(vrt): update snapshots
TylerJDev 14ef1ae
Add open state to test e2e
TylerJDev 49e2596
Add changeset
TylerJDev 4b381b1
Fix test, add playground for `ConfirmationDialog`
TylerJDev 3afa403
test(vrt): update snapshots
TylerJDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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": minor | ||
| --- | ||
|
|
||
| Convert ConfirmationDialog to CSS modules behind feature flag |
Binary file added
BIN
+6.22 KB
...onDialog.test.ts-snapshots/ConfirmationDialog-Default-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.22 KB
...mationDialog.test.ts-snapshots/ConfirmationDialog-Default-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.24 KB
...ialog.test.ts-snapshots/ConfirmationDialog-Default-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.22 KB
.../ConfirmationDialog.test.ts-snapshots/ConfirmationDialog-Default-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.22 KB
...onDialog.test.ts-snapshots/ConfirmationDialog-Default-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.32 KB
...og.test.ts-snapshots/ConfirmationDialog-Default-focus-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.35 KB
...Dialog.test.ts-snapshots/ConfirmationDialog-Default-focus-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.32 KB
...test.ts-snapshots/ConfirmationDialog-Default-focus-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.32 KB
...rmationDialog.test.ts-snapshots/ConfirmationDialog-Default-focus-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.32 KB
...og.test.ts-snapshots/ConfirmationDialog-Default-focus-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.27 KB
...g.test.ts-snapshots/ConfirmationDialog-Default-focus-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.3 KB
...est.ts-snapshots/ConfirmationDialog-Default-focus-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.27 KB
...mationDialog.test.ts-snapshots/ConfirmationDialog-Default-focus-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.27 KB
...g.test.ts-snapshots/ConfirmationDialog-Default-focus-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 added
BIN
+6.27 KB
...nDialog.test.ts-snapshots/ConfirmationDialog-Default-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.34 KB
...alog.test.ts-snapshots/ConfirmationDialog-Default-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.27 KB
...ConfirmationDialog.test.ts-snapshots/ConfirmationDialog-Default-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.27 KB
...nDialog.test.ts-snapshots/ConfirmationDialog-Default-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 added
BIN
+23.4 KB
...ialog.test.ts-snapshots/ConfirmationDialog-Playground-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
+24.3 KB
...ionDialog.test.ts-snapshots/ConfirmationDialog-Playground-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
+24.8 KB
...og.test.ts-snapshots/ConfirmationDialog-Playground-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
+23.3 KB
...nfirmationDialog.test.ts-snapshots/ConfirmationDialog-Playground-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
+23.3 KB
...ialog.test.ts-snapshots/ConfirmationDialog-Playground-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
+23.4 KB
...test.ts-snapshots/ConfirmationDialog-Playground-focus-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
+24.4 KB
...log.test.ts-snapshots/ConfirmationDialog-Playground-focus-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
+24.8 KB
...t.ts-snapshots/ConfirmationDialog-Playground-focus-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.3 KB
...tionDialog.test.ts-snapshots/ConfirmationDialog-Playground-focus-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.3 KB
...test.ts-snapshots/ConfirmationDialog-Playground-focus-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...est.ts-snapshots/ConfirmationDialog-Playground-focus-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.3 KB
....ts-snapshots/ConfirmationDialog-Playground-focus-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...ionDialog.test.ts-snapshots/ConfirmationDialog-Playground-focus-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...est.ts-snapshots/ConfirmationDialog-Playground-focus-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...alog.test.ts-snapshots/ConfirmationDialog-Playground-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.2 KB
...g.test.ts-snapshots/ConfirmationDialog-Playground-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...firmationDialog.test.ts-snapshots/ConfirmationDialog-Playground-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+23.6 KB
...alog.test.ts-snapshots/ConfirmationDialog-Playground-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.62 KB
...ts/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.57 KB
...pshots/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.61 KB
...ConfirmationDialog-Shorthand-Hook-From-Action-Menu-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.62 KB
....ts-snapshots/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.62 KB
...ts/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.71 KB
...firmationDialog-Shorthand-Hook-From-Action-Menu-focus-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.7 KB
.../ConfirmationDialog-Shorthand-Hook-From-Action-Menu-focus-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.69 KB
...mationDialog-Shorthand-Hook-From-Action-Menu-focus-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.71 KB
...apshots/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-focus-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.71 KB
...firmationDialog-Shorthand-Hook-From-Action-Menu-focus-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.65 KB
...irmationDialog-Shorthand-Hook-From-Action-Menu-focus-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.67 KB
...ationDialog-Shorthand-Hook-From-Action-Menu-focus-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.65 KB
...pshots/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-focus-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.65 KB
...irmationDialog-Shorthand-Hook-From-Action-Menu-focus-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.64 KB
...s/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.71 KB
...onfirmationDialog-Shorthand-Hook-From-Action-Menu-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.64 KB
...ts-snapshots/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+5.64 KB
...s/ConfirmationDialog-Shorthand-Hook-From-Action-Menu-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
...g.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.5 KB
...ialog.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
...est.ts-snapshots/ConfirmationDialog-Shorthand-Hook-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
...mationDialog.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.6 KB
...g.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
....ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-dark-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
...test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-dark-dimmed-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...-snapshots/ConfirmationDialog-Shorthand-Hook-focus-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
...Dialog.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-dark-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
....ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
...snapshots/ConfirmationDialog-Shorthand-Hook-focus-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...ialog.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.8 KB
...ts-snapshots/ConfirmationDialog-Shorthand-Hook-focus-light-tritanopia-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
....test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-light-colorblind-linux.png
Oops, something went wrong.
Binary file added
BIN
+11 KB
...st.ts-snapshots/ConfirmationDialog-Shorthand-Hook-light-high-contrast-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
...ationDialog.test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-light-linux.png
Oops, something went wrong.
Binary file added
BIN
+10.7 KB
....test.ts-snapshots/ConfirmationDialog-Shorthand-Hook-light-tritanopia-linux.png
Oops, something went wrong.
This file contains hidden or 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,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() | ||
| }) | ||
| }) | ||
| } | ||
| }) | ||
| } | ||
| }) |
31 changes: 31 additions & 0 deletions
31
packages/react/src/ConfirmationDialog/ConfirmationDialog.module.css
This file contains hidden or 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,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); | ||
| } |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?