-
Notifications
You must be signed in to change notification settings - Fork 650
Update activeIndicatorLine to grow with content #7056
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
6 commits
Select commit
Hold shift + click to select a range
49c8352
Update activeIndicatorLine to grow with content
adierkens f733f6c
lint
adierkens 5bd41cf
test(vrt): update snapshots
francinelucca fdc8787
Add vrt for FilteredActionList
adierkens 27367fa
test(vrt): update snapshots
adierkens bd543d5
Merge branch 'main' into adierkens/action-list-active
adierkens 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 | ||
| --- | ||
|
|
||
| Update active indicators for ActionList & FilteredActionList to follow content height |
Binary file added
BIN
+23.7 KB
...tionList.test.ts-snapshots/FilteredActionList-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
+23.9 KB
...edActionList.test.ts-snapshots/FilteredActionList-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
+23.4 KB
...nList.test.ts-snapshots/FilteredActionList-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
+23.7 KB
.../FilteredActionList.test.ts-snapshots/FilteredActionList-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
+23.7 KB
...tionList.test.ts-snapshots/FilteredActionList-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
+23.4 KB
...ionList.test.ts-snapshots/FilteredActionList-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
+23.1 KB
...List.test.ts-snapshots/FilteredActionList-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
+23.4 KB
...FilteredActionList.test.ts-snapshots/FilteredActionList-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
+23.4 KB
...ionList.test.ts-snapshots/FilteredActionList-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
+45.8 KB
....test.ts-snapshots/FilteredActionList-With-Long-Items-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
+46.8 KB
...List.test.ts-snapshots/FilteredActionList-With-Long-Items-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
+44.5 KB
...st.ts-snapshots/FilteredActionList-With-Long-Items-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
+45.8 KB
...dActionList.test.ts-snapshots/FilteredActionList-With-Long-Items-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
+45.8 KB
....test.ts-snapshots/FilteredActionList-With-Long-Items-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
+45.2 KB
...test.ts-snapshots/FilteredActionList-With-Long-Items-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
+44.2 KB
...t.ts-snapshots/FilteredActionList-With-Long-Items-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
+45.2 KB
...ActionList.test.ts-snapshots/FilteredActionList-With-Long-Items-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
+45.2 KB
...test.ts-snapshots/FilteredActionList-With-Long-Items-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 modified
BIN
+9 Bytes
(100%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+16 Bytes
(100%)
...ponents/SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+10 Bytes
(100%)
.../SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+9 Bytes
(100%)
...ots/components/SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+9 Bytes
(100%)
...nts/SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+8 Bytes
(100%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+10 Bytes
(100%)
...SelectPanel.test.ts-snapshots/SelectPanel-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 modified
BIN
+6 Bytes
(100%)
...ts/components/SelectPanel.test.ts-snapshots/SelectPanel-Default-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+8 Bytes
(100%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-Default-light-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+24 Bytes
(100%)
...electPanel-Default-responsive-width-light-full-screen-on-narrow--true-linux.png
Oops, something went wrong.
Binary file modified
BIN
+7 Bytes
(100%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+21 Bytes
(100%)
...onents/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-dimmed-linux.png
Oops, something went wrong.
Binary file modified
BIN
+10 Bytes
(100%)
...SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+9 Bytes
(100%)
...ts/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-linux.png
Oops, something went wrong.
Binary file modified
BIN
+7 Bytes
(100%)
...ts/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-dark-tritanopia-linux.png
Oops, something went wrong.
Binary file modified
BIN
+8 Bytes
(100%)
...s/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-light-colorblind-linux.png
Oops, something went wrong.
Binary file modified
BIN
+6 Bytes
(100%)
...electPanel.test.ts-snapshots/SelectPanel-With-Css-light-high-contrast-linux.png
Oops, something went wrong.
Binary file modified
BIN
+11 Bytes
(100%)
...s/components/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-light-linux.png
Oops, something went wrong.
Binary file modified
BIN
+14 Bytes
(100%)
...s/SelectPanel.test.ts-snapshots/SelectPanel-With-Css-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,34 @@ | ||
| import {test, expect} from '@playwright/test' | ||
| import {visit} from '../test-helpers/storybook' | ||
| import {themes} from '../test-helpers/themes' | ||
|
|
||
| const stories = [ | ||
| { | ||
| title: 'Default', | ||
| id: 'components-filteredactionlist--default', | ||
| }, | ||
| { | ||
| title: 'With Long Items', | ||
| id: 'components-filteredactionlist-examples--with-long-items', | ||
| }, | ||
| ] as const | ||
|
|
||
| test.describe('FilteredActionList', () => { | ||
| for (const story of stories) { | ||
| test.describe(story.title, () => { | ||
| for (const theme of themes) { | ||
| test(`default @vrt ${theme}`, async ({page}) => { | ||
| await visit(page, { | ||
| id: story.id, | ||
| globals: { | ||
| colorScheme: theme, | ||
| }, | ||
| }) | ||
|
|
||
| // Default state | ||
| await expect(page).toHaveScreenshot(`FilteredActionList.${story.title}.${theme}.png`) | ||
| }) | ||
| } | ||
| }) | ||
| } | ||
| }) |
4 changes: 2 additions & 2 deletions
4
packages/postcss-preset-primer/src/mixins/activeIndicatorLine.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
53 changes: 53 additions & 0 deletions
53
packages/react/src/FilteredActionList/FilteredActionList.examples.stories.tsx
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,53 @@ | ||
| import type {Meta} from '@storybook/react-vite' | ||
| import React, {useMemo} from 'react' | ||
| import {FilteredActionList} from '../FilteredActionList' | ||
| import classes from './FilteredActionList.stories.module.css' | ||
|
|
||
| const meta: Meta = { | ||
| title: 'Components/FilteredActionList/Examples', | ||
| component: FilteredActionList, | ||
| parameters: { | ||
| controls: { | ||
| disable: true, | ||
| }, | ||
| }, | ||
| } | ||
| export default meta | ||
|
|
||
| export function WithLongItems() { | ||
| const [filter, setFilter] = React.useState('') | ||
|
|
||
| const items = useMemo(() => { | ||
| return [ | ||
| { | ||
| text: 'enhancement with a very long label that might wrap. enhancement with a very long label that might wrap. enhancement with a very long label that might wrap. ', | ||
francinelucca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: 1, | ||
| }, | ||
| { | ||
| text: 'bug with an excessively verbose description that goes on and on. bug with an excessively verbose description that goes on and on. bug with an excessively verbose description that goes on and on.', | ||
francinelucca marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| id: 2, | ||
| }, | ||
| { | ||
| text: 'good first issue that is intended to be approachable for newcomers', | ||
| id: 3, | ||
| }, | ||
| { | ||
| text: 'design related task that involves multiple stakeholders and considerations', | ||
| id: 4, | ||
| }, | ||
| ].filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase())) | ||
| }, [filter]) | ||
|
|
||
| return ( | ||
| <> | ||
| <h1>Filtered Action List with Long Items</h1> | ||
| <div>Please select labels that describe your issue:</div> | ||
| <FilteredActionList | ||
| placeholderText="Filter Labels" | ||
| onFilterChange={setFilter} | ||
| items={items} | ||
| className={classes.FilteredActionListContainer} | ||
| /> | ||
| </> | ||
| ) | ||
| } | ||
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.
it's ok if we don't but it we want this to have VRT, we should add it to e2e/components/* (noticed we don't have one for FilteredActionList, might be a good time to add one)
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.
Good call. Added FilteredActionList to the e2e snapshots