Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/next-14.2.15
Browse files Browse the repository at this point in the history
  • Loading branch information
francinelucca authored Dec 26, 2024
2 parents 743f7a6 + 6d70d1b commit 53374fe
Show file tree
Hide file tree
Showing 222 changed files with 7,533 additions and 3,141 deletions.
5 changes: 5 additions & 0 deletions .changeset/brave-penguins-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Corrects horizontal padding of `<Button>` when the button only contains an icon and a counter label (no button text label).
5 changes: 5 additions & 0 deletions .changeset/dirty-nails-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Convert ActionList, ActionList sub components and NavList to CSS Modules
5 changes: 5 additions & 0 deletions .changeset/few-coins-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Deprecate use of sx prop by deprecating the `SxProp` type definition
5 changes: 5 additions & 0 deletions .changeset/gentle-stingrays-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Update FormControl to use CSS Modules behind feature flag
5 changes: 5 additions & 0 deletions .changeset/proud-phones-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

chore(deps): update @primer/octicons-react to 19.13.0
5 changes: 5 additions & 0 deletions .changeset/purple-pants-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Convert Box usage in Autocomplete to CSS modules behind feature flag
5 changes: 5 additions & 0 deletions .changeset/selfish-flowers-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Update Table to use CSS Modules behind feature flag
5 changes: 5 additions & 0 deletions .changeset/shaggy-comics-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Remove CSS modules feature flag from Header
5 changes: 5 additions & 0 deletions .changeset/thirty-wasps-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Remove the CSS module feature flag from Skeleton
5 changes: 5 additions & 0 deletions .changeset/violet-tables-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

Remove CSS modules feature flag from Select
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Primer React",
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:22",
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "DavidAnson.vscode-markdownlint"],
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "DavidAnson.vscode-markdownlint", "hex-ci.stylelint-plus"],
"forwardPorts": [8000],
"onCreateCommand": ["/bin/bash", "-c", "npm run setup"],
"remoteUser": "node",
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.
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.
115 changes: 88 additions & 27 deletions e2e/components/ActionList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,33 +313,38 @@ test.describe('ActionList', () => {
}
})

test.describe('Text Wrap And Truncation', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionlist-features--text-wrap-and-truncation',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`ActionList.Text Wrap And Truncation.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionlist-features--text-wrap-and-truncation',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})
// removing this temporarily as there is a slight diff betqeen default and enabled CSS feature flag that feels like a non-issue
// eslint-disable-next-line jest/no-commented-out-tests
// test.describe('Text Wrap And Truncation', () => {
// for (const theme of themes) {
// eslint-disable-next-line jest/no-commented-out-tests
// test.describe(theme, () => {
// eslint-disable-next-line jest/no-commented-out-tests
// test('default @vrt', async ({page}) => {
// await visit(page, {
// id: 'components-actionlist-features--text-wrap-and-truncation',
// globals: {
// colorScheme: theme,
// },
// })

// // Default state
// expect(await page.screenshot()).toMatchSnapshot(`ActionList.Text Wrap And Truncation.${theme}.png`)
// })

// eslint-disable-next-line jest/no-commented-out-tests
// test('axe @aat', async ({page}) => {
// await visit(page, {
// id: 'components-actionlist-features--text-wrap-and-truncation',
// globals: {
// colorScheme: theme,
// },
// })
// await expect(page).toHaveNoViolations()
// })
// })
// }
// })

test.describe('With Avatars', () => {
for (const theme of themes) {
Expand Down Expand Up @@ -740,4 +745,60 @@ test.describe('ActionList', () => {
})
}
})

test.describe('Visuals with Classnames', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionlist-dev--visual-custom-classname',
globals: {
colorScheme: theme,
},
})

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

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionlist-dev--visual-custom-classname',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})

test.describe('Link Item Options', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-actionlist-examples--list-link-item',
globals: {
colorScheme: theme,
},
})

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

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-actionlist-examples--list-link-item',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations()
})
})
}
})
})
18 changes: 18 additions & 0 deletions e2e/components/Button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,4 +644,22 @@ test.describe('Button', () => {
})
}
})

test.describe('Trailing Counter No Text', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-button-features--trailing-counter-with-no-text',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`Trailing Counter No Text.${theme}.png`)
})
})
}
})
})
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/postcss-preset-primer/src/mixins/activeIndicatorLine.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@define-mixin activeIndicatorLine {
position: absolute;
top: calc(50% - var(--base-size-12));
left: calc(-1 * var(--base-size-8));
width: var(--base-size-4);
height: var(--base-size-24);
content: '';
/* stylelint-disable-next-line primer/colors */
background: var(--borderColor-accent-emphasis);
border-radius: var(--borderRadius-medium);
}
1 change: 1 addition & 0 deletions packages/react/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const preview = {
],
],
],
'Octicons',
[
'Experimental',
[
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@oddbird/popover-polyfill": "^0.4.4",
"@primer/behaviors": "^1.7.2",
"@primer/live-region-element": "^0.7.1",
"@primer/octicons-react": "^19.9.0",
"@primer/octicons-react": "^19.13.0",
"@primer/primitives": "9.x || 10.x",
"@styled-system/css": "^5.1.5",
"@styled-system/props": "^5.1.5",
Expand Down
4 changes: 4 additions & 0 deletions packages/react/script/figma-connect-icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ ${Array.from(uniqueNames)
${icons
.map(
icon => `figma.connect(${icon.name}, '${icon.figmaUrl}', {
props: {
name: "${icon.name}",
fn: ${icon.name}
},
example: () => <${icon.name} size={${icon.size}} />,
})`,
)
Expand Down
39 changes: 0 additions & 39 deletions packages/react/src/ActionBar/ActionBar.figma.tsx

This file was deleted.

39 changes: 39 additions & 0 deletions packages/react/src/ActionBar/disabled.ActionBar.Figma.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-nocheck
// import React from 'react'
// import {ActionBar} from '..'
// import figma from '@figma/code-connect'

// figma.connect(
// ActionBar,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17042-65810&t=ARVklwnsUc0zUmot-4',
// {
// props: {
// items: figma.children(['ActionBar.IconButton', 'ActionBar.Divider']),
// },
// example: ({items}) => <ActionBar>{items}</ActionBar>,
// },
// )

// figma.connect(
// ActionBar.IconButton,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=35848-26016&m=dev',
// {
// props: {
// iconButton: figma.nestedProps('IconButton', {
// icon: figma.instance('icon'),
// ariaLabel: figma.string('aria-label'),
// }),
// },
// example: ({iconButton}) => <ActionBar.IconButton icon={iconButton.icon} aria-label={iconButton.ariaLabel} />,
// },
// )

// figma.connect(
// ActionBar.Divider,
// 'https://www.figma.com/design/GCvY3Qv8czRgZgvl1dG6lp/Primer-Web?node-id=17042-65808&t=ARVklwnsUc0zUmot-4',
// {
// props: {},
// example: () => <ActionBar.Divider />,
// },
// )
24 changes: 24 additions & 0 deletions packages/react/src/ActionList/ActionList.dev.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Group} from './Group'
import {Divider} from './Divider'
import {Description} from './Description'
import Avatar from '../Avatar'
import {FileDirectoryIcon, HeartFillIcon} from '@primer/octicons-react'

export default {
title: 'Components/ActionList/Dev',
Expand Down Expand Up @@ -144,3 +145,26 @@ export const HeadingCustomClassname = () => (
</ActionList.Group>
</ActionList>
)

export const DescriptionCustomClassname = () => (
<ActionList>
<ActionList.Item>
Label
<ActionList.Description className="testCustomClassnameColor">This is a description</ActionList.Description>
</ActionList.Item>
</ActionList>
)

export const VisualCustomClassname = () => (
<ActionList>
<ActionList.Item>
Label
<ActionList.LeadingVisual className="testCustomClassnameColor">
<FileDirectoryIcon />
</ActionList.LeadingVisual>
<ActionList.TrailingVisual className="testCustomClassnameColor">
<HeartFillIcon />
</ActionList.TrailingVisual>
</ActionList.Item>
</ActionList>
)
Loading

0 comments on commit 53374fe

Please sign in to comment.