Skip to content

Commit

Permalink
Merge branch 'francinelucca/3477-prcdialog-best-practice-prevent-dial…
Browse files Browse the repository at this point in the history
…og-from-closing-on-accidental-mouse-release' of github.com:primer/react into francinelucca/3477-prcdialog-best-practice-prevent-dialog-from-closing-on-accidental-mouse-release
  • Loading branch information
francinelucca committed Sep 19, 2024
2 parents 86bded5 + d831be3 commit 1057cdb
Show file tree
Hide file tree
Showing 46 changed files with 755 additions and 486 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-pianos-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Change the Link component feature flag from primer_react_css_modules_staff to primer_react_css_modules_ga
5 changes: 5 additions & 0 deletions .changeset/dull-turkeys-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Removes the feature flag from the `Blankslate` component to always render with CSS modules.
5 changes: 5 additions & 0 deletions .changeset/eighty-houses-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

fix(Dialog): track mousedown event to prevent accidental closing
5 changes: 5 additions & 0 deletions .changeset/flat-avocados-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Utilizes `[disabled]` selector instead of `:disabled` in `TooltipV2` to address a false positive
5 changes: 5 additions & 0 deletions .changeset/odd-rings-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Update Banner to use CSS Modules behind feature flag
5 changes: 5 additions & 0 deletions .changeset/selfish-carpets-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Update tab in UnderlinePanels to set explicit type
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
// rules which apply to JS, TS, etc.
rules: {
'no-shadow': 'off',
'react/button-has-type': 'error',
'react/prop-types': 'off',
'react/display-name': 'off',
'react-hooks/exhaustive-deps': 'error',
Expand Down
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.
57 changes: 57 additions & 0 deletions e2e/components/Banner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ test.describe('Banner', () => {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_team: true,
},
},
})

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

test('default (styled-components) @vrt', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_team: false,
},
},
})

Expand All @@ -89,6 +107,22 @@ test.describe('Banner', () => {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_team: true,
},
},
})
await expect(page).toHaveNoViolations()
})

test('axe (styled-components) @aat', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_team: false,
},
},
})
await expect(page).toHaveNoViolations()
Expand All @@ -101,6 +135,29 @@ test.describe('Banner', () => {
test(`${name} @vrt`, async ({page}) => {
await visit(page, {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_team: true,
},
},
})
const width = viewports[name]

await page.setViewportSize({
width,
height: 667,
})
expect(await page.screenshot()).toMatchSnapshot(`Banner.${story.title}.${name}.png`)
})

test(`${name} (styled-components) @vrt`, async ({page}) => {
await visit(page, {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_team: false,
},
},
})
const width = viewports[name]

Expand Down
54 changes: 0 additions & 54 deletions e2e/components/Blankslate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,6 @@ test.describe('Blankslate', () => {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_ga: true,
},
},
})

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

test('default (styled-components) @vrt', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_ga: false,
},
},
})

Expand All @@ -77,19 +59,6 @@ test.describe('Blankslate', () => {
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_ga: true,
},
},
})
await expect(page).toHaveNoViolations()
})

test('axe (styled-components) @aat', async ({page}) => {
await visit(page, {
id: story.id,
globals: {
Expand All @@ -106,29 +75,6 @@ test.describe('Blankslate', () => {
test(`${name} @vrt`, async ({page}) => {
await visit(page, {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_ga: true,
},
},
})
const width = viewports[name]

await page.setViewportSize({
width,
height: 667,
})
expect(await page.screenshot()).toMatchSnapshot(`Blankslate.${story.title}.${name}.png`)
})

test(`${name} (styled-components) @vrt`, async ({page}) => {
await visit(page, {
id: story.id,
globals: {
featureFlags: {
primer_react_css_modules_ga: false,
},
},
})
const width = viewports[name]

Expand Down
4 changes: 2 additions & 2 deletions e2e/components/Link.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test.describe('Link', () => {
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_staff: true,
primer_react_css_modules_ga: true,
},
},
})
Expand All @@ -55,7 +55,7 @@ test.describe('Link', () => {
globals: {
colorScheme: theme,
featureFlags: {
primer_react_css_modules_staff: true,
primer_react_css_modules_ga: true,
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion examples/app-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@primer/react": "37.0.0-rc.5",
"next": "^14.2.8",
"next": "^14.2.10",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"styled-components": "5.x",
Expand Down
2 changes: 1 addition & 1 deletion examples/codesandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"eslint-plugin-react-refresh": "^0.4.7",
"styled-components": "5.x",
"typescript": "^5.4.5",
"vite": "^5.2.6"
"vite": "^5.2.14"
}
}
2 changes: 1 addition & 1 deletion examples/theming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@primer/octicons-react": "^19.9.0",
"@primer/react": "37.0.0-rc.5",
"clsx": "^1.2.1",
"next": "^14.2.8",
"next": "^14.2.10",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"styled-components": "5.x",
Expand Down
Loading

0 comments on commit 1057cdb

Please sign in to comment.