-
Notifications
You must be signed in to change notification settings - Fork 661
chore: add ActionList primitives exports #7755
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
38 commits
Select commit
Hold shift + click to select a range
1a70c2b
chore: add Selection type to ActionList exports
francinelucca faf7025
Merge branch 'main' into chore/export-selection-primitive
francinelucca 82f780a
export VisualContainer, ActionListGroupHeadingProps, ActionListTraili…
francinelucca bb702e5
export GroupContext
francinelucca 0b87ed6
Refactor FilteredActionList exports and types for improved clarity
francinelucca 8b9b750
fix
francinelucca b3ccc6e
Merge branch 'main' of github.com:primer/react into chore/export-sele…
francinelucca 5928110
refactor: remove unused imports and update useFocusZone export
francinelucca 5abd238
Merge branch 'main' into chore/export-selection-primitive
francinelucca 09fe81f
Merge branch 'main' into chore/export-selection-primitive
francinelucca 47ba43a
Merge branch 'main' into chore/export-selection-primitive
francinelucca 935b9c8
Merge branch 'main' into chore/export-selection-primitive
francinelucca e4ff662
feat(FilteredActionList): introduce FilteredActionListInput component…
francinelucca ecd5679
Merge branch 'chore/export-selection-primitive' of github.com:primer/…
francinelucca ce9843e
fix
francinelucca d36541c
change FilteredActionListInput API
francinelucca 1155eff
re-add disable
francinelucca 9ea6a8d
update snapshots
francinelucca a8e325a
Fix loading condition in FilteredActionList
francinelucca 068e2e0
Merge branch 'main' into chore/export-selection-primitive
francinelucca 4a792c6
Change '@primer/react' version and export new components
francinelucca de6fea8
fix typo
francinelucca fc61226
fix test
francinelucca c358995
chore: update @primer/react to version 38.21.0 and add ActionListSele…
francinelucca 42191f7
Merge branch 'main' into chore/export-selection-primitive
francinelucca 4517543
Merge branch 'main' into chore/export-selection-primitive
francinelucca 9d0a423
Merge branch 'main' into chore/export-selection-primitive
francinelucca 0e5c2a6
Refactor ActionList styles for aria attributes
francinelucca d2eb122
Clean up imports in ActionList index file
francinelucca e0db3f6
Update index.ts
francinelucca fbcdc30
Update exports.test.ts.snap
francinelucca c582d9f
Update index.ts
francinelucca bb7762b
Rename ActionListSelectionProps to SelectionProps
francinelucca 5bd47a4
Fix import statement formatting in Selection.tsx
francinelucca 732e2cf
Clean up exports in index.ts
francinelucca 01b0cd9
export GroupContext
francinelucca 78c44c5
export FocusKeys
francinelucca 30fe2c4
update test snapshot
francinelucca 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 | ||
| --- | ||
|
|
||
| feat: add ActionList, SelectPanel primitives exports and new FilteredActionList.Input components |
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
59 changes: 59 additions & 0 deletions
59
packages/react/src/FilteredActionList/FilteredActionListInput.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,59 @@ | ||
| import type React from 'react' | ||
| import {clsx} from 'clsx' | ||
| import TextInput from '../TextInput' | ||
| import type {TextInputProps} from '../TextInput' | ||
| import classes from './FilteredActionList.module.css' | ||
|
|
||
| export interface FilteredActionListInputProps extends Partial<Omit<TextInputProps, 'onChange' | 'onKeyDown'>> { | ||
| inputRef: React.RefObject<HTMLInputElement | null> | ||
| onInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void | ||
| onInputKeyPress?: React.KeyboardEventHandler<HTMLInputElement> | ||
| onInputKeyDown?: React.KeyboardEventHandler<HTMLInputElement> | ||
| placeholderText?: string | ||
| listId: string | ||
| inputDescriptionTextId: string | ||
| loading: boolean | ||
| fullScreenOnNarrow?: boolean | ||
| } | ||
|
|
||
| export function FilteredActionListInput({ | ||
| inputRef, | ||
| value, | ||
| onInputChange, | ||
| onInputKeyPress, | ||
| onInputKeyDown, | ||
| placeholderText, | ||
| listId, | ||
| inputDescriptionTextId, | ||
| loading, | ||
| fullScreenOnNarrow, | ||
| className, | ||
| ...restTextInputProps | ||
| }: FilteredActionListInputProps): React.JSX.Element { | ||
| return ( | ||
| <div className={classes.Header} data-component="FilteredActionList.Header"> | ||
| <TextInput | ||
| // @ts-expect-error it needs a non nullable ref | ||
| ref={inputRef} | ||
| block | ||
|
francinelucca marked this conversation as resolved.
|
||
| width="auto" | ||
| color="fg.default" | ||
| value={value} | ||
| onChange={onInputChange} | ||
| onKeyPress={onInputKeyPress} | ||
| onKeyDown={onInputKeyDown} | ||
| placeholder={placeholderText} | ||
| role="combobox" | ||
| aria-expanded="true" | ||
| aria-autocomplete="list" | ||
| aria-controls={listId} | ||
| aria-label={placeholderText} | ||
| aria-describedby={inputDescriptionTextId} | ||
| loaderPosition={'leading'} | ||
| loading={loading} | ||
| className={clsx(className, {[classes.FullScreenTextInput]: fullScreenOnNarrow})} | ||
| {...restTextInputProps} | ||
| /> | ||
|
francinelucca marked this conversation as resolved.
|
||
| </div> | ||
| ) | ||
| } | ||
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
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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| export {SelectPanel} from './SelectPanel' | ||
| export {SelectPanelMessage} from './SelectPanelMessage' | ||
| export type {SelectPanelProps} from './SelectPanel' | ||
|
|
||
| export type {ItemProps, ItemInput, GroupedListProps, ListPropsBase} from '../FilteredActionList' | ||
|
francinelucca marked this conversation as resolved.
|
||
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
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.
Do we envision splitting up more of
FilteredActionList?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.
We definitely could. I assume that'd come with the SelectPanel separation work if we ever get to it 🙏🏽. Just added what I needed for now