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

feat(ActionList sub components) Convert to CSS Modules #5398

Merged
merged 61 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
cbcb00e
copy
langermank Dec 6, 2024
b4073f2
copy all
langermank Dec 7, 2024
a59907b
fix padding
langermank Dec 9, 2024
c43d0c6
Merge branch 'main' into al-trailingaction-css
langermank Dec 9, 2024
6dfcba7
Merge branch 'main' into al-trailingaction-css
langermank Dec 10, 2024
e1e1e85
add heading
langermank Dec 10, 2024
d5e8275
fix selectpanel story
langermank Dec 10, 2024
025bf4b
Merge branch 'main' into al-trailingaction-css
langermank Dec 10, 2024
e6034c2
vrt
langermank Dec 10, 2024
9fe5820
alignment
langermank Dec 10, 2024
ecf8fe6
Merge branch 'main' into al-trailingaction-css
langermank Dec 10, 2024
1f4d117
moar fixes
langermank Dec 10, 2024
270931a
dev stories
langermank Dec 10, 2024
abc7ae5
Merge branch 'main' into al-trailingaction-css
langermank Dec 11, 2024
5c76a85
tests
langermank Dec 11, 2024
3c980dd
moving tests around
langermank Dec 11, 2024
27514c9
tests
langermank Dec 11, 2024
04f1f6b
tests
langermank Dec 11, 2024
4052c0a
Apply suggestions from code review
langermank Dec 11, 2024
59cd1d2
prettier
langermank Dec 11, 2024
cd152f6
lint
langermank Dec 11, 2024
41bf57e
test(vrt): update snapshots
langermank Dec 11, 2024
5cbff43
fix nesting issue
langermank Dec 11, 2024
f29109a
reset
langermank Dec 11, 2024
27e886d
test(vrt): update snapshots
langermank Dec 11, 2024
3dbafc9
vrt
langermank Dec 11, 2024
f0ec417
cleanup
langermank Dec 11, 2024
ece68c5
Merge branch 'main' into al-trailingaction-css
langermank Dec 11, 2024
6549d5d
reset
langermank Dec 11, 2024
7240b84
test(vrt): update snapshots
langermank Dec 11, 2024
8968919
very sad and annoying
langermank Dec 12, 2024
a3850cf
snaps
langermank Dec 12, 2024
d482cb1
Create dirty-nails-applaud.md
langermank Dec 12, 2024
a146062
reduce margin on divider
langermank Dec 12, 2024
8613ebf
Merge branch 'al-trailingaction-css' of https://github.com/primer/rea…
langermank Dec 12, 2024
dd2a841
remove truncation e2e test
langermank Dec 12, 2024
a6b9b23
snappers
langermank Dec 12, 2024
d05ea74
lint
langermank Dec 12, 2024
8c29412
test(vrt): update snapshots
langermank Dec 12, 2024
58ed34f
Merge branch 'main' into al-trailingaction-css
langermank Dec 13, 2024
fac24b9
fix navlist group
langermank Dec 13, 2024
9c9d8bc
Update packages/react/src/ActionList/Visuals.tsx
langermank Dec 13, 2024
08d669b
test classname on visuals
langermank Dec 13, 2024
6db6000
add e2e
langermank Dec 13, 2024
c8d6e0a
Merge branch 'main' into al-trailingaction-css
langermank Dec 16, 2024
b5ada3f
use common ff
langermank Dec 16, 2024
cb95ff9
feat(NavList) Convert to CSS Modules (#5424)
langermank Dec 16, 2024
1b003c0
Merge branch 'main' into al-trailingaction-css
langermank Dec 16, 2024
fa22eeb
logging test failure
langermank Dec 16, 2024
261b30e
Merge branch 'al-trailingaction-css' of https://github.com/primer/rea…
langermank Dec 16, 2024
96580c3
Merge branch 'main' into al-trailingaction-css
langermank Dec 16, 2024
30a4386
reset
langermank Dec 16, 2024
ee80c83
test(vrt): update snapshots
langermank Dec 16, 2024
bf30220
remove flaky test
langermank Dec 17, 2024
d1118f5
fix changeset
langermank Dec 17, 2024
18abe0d
fix active color var
langermank Dec 17, 2024
dcda4bf
big oops
langermank Dec 17, 2024
f9a61a7
remove transitions for now
langermank Dec 17, 2024
e91e3ff
haha
langermank Dec 17, 2024
a4b11b0
fix trailing visual as text + add test
langermank Dec 18, 2024
82be5a5
test(vrt): update snapshots
langermank Dec 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
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
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()
})
})
}
})
})
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);
}
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>
)
14 changes: 13 additions & 1 deletion packages/react/src/ActionList/ActionList.examples.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,21 @@ export const ListLinkItem = () => (
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
ActionList.LinkItem with everything
With inline description
<ActionList.Description variant="inline">inline description</ActionList.Description>
</ActionList.LinkItem>
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
With block description
<ActionList.Description variant="block">Block description</ActionList.Description>
</ActionList.LinkItem>
<ActionList.LinkItem href="?path=/story/components-actionlist--default">
<ActionList.LeadingVisual>
<LinkIcon />
</ActionList.LeadingVisual>
Trailing visual
<ActionList.TrailingVisual>⌘ + L</ActionList.TrailingVisual>
</ActionList.LinkItem>
</ActionList>
Expand Down
Loading
Loading