-
Notifications
You must be signed in to change notification settings - Fork 616
Next major #1910
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
Next major #1910
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
fdd6915
prepare integration branch
rezrah 4a0cc23
Merge branch 'main' into next/v35.0.0
siddharthkp ff7da70
Merge branch 'main' into next/v35.0.0
colebemis 94034e3
Merge branch 'main' into next/v35.0.0
rezrah 8cd1243
Move deprecated components to deprecated folder (#1881)
pksjce 310e655
Prefix component with types exported from ActionList2 and ActionMenu2…
siddharthkp df75752
Export PageLayout from main bundle (#1882)
colebemis 6fc788f
Merge branch 'main' into next/v35.0.0
colebemis 14bd580
Update release notes and add deprecation notices for SelectMenu and D…
rezrah f366604
Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#1895)
siddharthkp c5c4b92
Revert "Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#189…
siddharthkp 17ef5ef
Deprecate ActionList v1 & Promote drafts/ActionList v2 (#1893)
siddharthkp d402357
Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#1897)
siddharthkp 09f87c5
Merge branch 'main' into next/v35.0.0
siddharthkp 87889b5
Merge branch 'main' of github.com:primer/react into next/v35.0.0
rezrah d6d1ca4
Deprecate DropdownMenu v1 + Remove DropdownMenu v2 (#1898)
siddharthkp 64b8f88
Fix code examples in changeset (#1901)
siddharthkp 05e54ca
Merge remote-tracking branch 'origin/main' into next-major
colebemis b51ea3b
Update .changeset/deprecate-actionlistv1-promote-actionlistv2.md
colebemis a8a3de1
Add linebreaks to changesets
colebemis 61404ae
Button deprecation (#1908)
pksjce f94dcd3
Deprecate components replaced by FormControl (#1888)
mperrotti 363bb07
fix merge conflicts with main
rezrah 4babf20
Revert "fix merge conflicts with main"
rezrah d61b28a
Deprecate ChoiceFieldset and ChoiceInputField (#1900)
mperrotti e9b81fa
Deprecate legacy Label component (#1889)
mperrotti 5b18a97
Move remaining deprecated components to src/deprecated (#1917)
siddharthkp 4d4163c
Various fixes for v35 (#1916)
rezrah 6cc86b2
Create changeset-for-1917.md (#1919)
siddharthkp 561aad8
Add align prop on ActionMenu.Overlay to pass through to AnchoredOverl…
siddharthkp b1d7b8c
ActionMenu.Button: Fix spacing between text and caret (#1922)
siddharthkp a88749a
Update ActionMenu docs (#1931)
siddharthkp a98091c
Button: Update active styles + use them for aria-expanded (#1915)
siddharthkp 1c38f84
merge main and resolve conflicts
rezrah 41dd547
fix broken test following main merging conflict resolution
rezrah 33da6a0
Fixes for v35 (#1934)
rezrah f235c3c
v35: Remove type aliases for ActionList (#1937)
siddharthkp 7d3021e
Next major changeset edits (#1939)
colebemis 8959aeb
Fixes for v35 (#1938)
rezrah 2868c21
Merge branch 'main' into next-major
rezrah 002e9cf
add missing fragments to changesets (#1940)
rezrah 16a5d17
Update changeset examples (#1941)
colebemis 4f07696
Fix table in changeset
colebemis 6bb44c4
Add missing comma
colebemis f69a6d0
Fix grid changeset
colebemis 8675cd8
Update button changeset
colebemis 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,21 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
|
||
`ActionList2` exported types are now prefixed with `ActionList`: | ||
|
||
``` | ||
ListProps → ActionListProps | ||
GroupProps → ActionListGroupProps | ||
ItemProps → ActionListItemProps | ||
DescriptionProps → ActionListDescriptionProps | ||
LeadingVisualProps → ActionListLeadingVisualProps, | ||
TrailingVisualProps → ActionListTrailingVisualProps | ||
``` | ||
|
||
`ActionMenu2` exported types are now prefixed with `ActionMenu`: | ||
|
||
``` | ||
MenuButtonProps → ActionMenuButtonProps | ||
MenuAnchorProps → ActionMenuAnchorProps | ||
``` |
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 | ||
--- | ||
|
||
Add align prop on ActionMenu.Overlay to pass through to AnchoredOverlay |
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': patch | ||
--- | ||
|
||
ActionMenu.Button: Fix spacing between text and caret |
155 changes: 155 additions & 0 deletions
155
.changeset/deprecate-actionlistv1-promote-actionlistv2.md
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,155 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
<br /> | ||
|
||
### ActionList | ||
|
||
ActionList has been rewritten with a composable API, design updates and accessibility fixes. | ||
|
||
See full list of props and examples: https://primer.style/react/ActionList | ||
|
||
<table> | ||
<tr> | ||
<th> Before (v34)</th> <th> After (v35)</th> | ||
</tr> | ||
<tr> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList | ||
items={[ | ||
{text: 'New file'}, | ||
{text: 'Copy link'}, | ||
{text: 'Edit file'}, | ||
ActionList.Divider, | ||
{text: 'Delete file', variant: 'danger'} | ||
]} | ||
/> | ||
``` | ||
|
||
</td> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList> | ||
<ActionList.Item>New file</ActionList.Item> | ||
<ActionList.Item>Copy link</ActionList.Item> | ||
<ActionList.Item>Edit file</ActionList.Item> | ||
<ActionList.Divider /> | ||
<ActionList.Item variant="danger">Delete file</ActionList.Item> | ||
</ActionList> | ||
``` | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList | ||
showItemDividers | ||
items={[ | ||
{ | ||
key: '0', | ||
leadingVisual: LinkIcon, | ||
text: 'github/primer' | ||
}, | ||
{ | ||
key: '1', | ||
leadingVisual: () => <Avatar src="https://github.com/mona.png" />, | ||
text: 'mona', | ||
description: 'Monalisa Octocat', | ||
descriptionVariant: 'block' | ||
}, | ||
{ | ||
key: '2', | ||
leadingVisual: GearIcon, | ||
text: 'View Settings', | ||
trailingVisual: ArrowRightIcon | ||
} | ||
]} | ||
/> | ||
``` | ||
|
||
</td> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList showDividers> | ||
<ActionList.Item> | ||
<ActionList.LeadingVisual> | ||
<LinkIcon /> | ||
</ActionList.LeadingVisual> | ||
github/primer | ||
</ActionList.Item> | ||
<ActionList.Item> | ||
<ActionList.LeadingVisual> | ||
<Avatar src="https://github.com/mona.png" /> | ||
</ActionList.LeadingVisual> | ||
mona | ||
<ActionList.Description variant="block">Monalisa Octocat</ActionList.Description> | ||
</ActionList.Item> | ||
<ActionList.Item> | ||
<ActionList.LeadingVisual> | ||
<GearIcon /> | ||
</ActionList.LeadingVisual> | ||
View settings | ||
<ActionList.TrailingVisual> | ||
<ArrowRightIcon /> | ||
</ActionList.TrailingVisual> | ||
</ActionList.Item> | ||
</ActionList> | ||
``` | ||
|
||
</td> | ||
</tr> | ||
<tr> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList | ||
groupMetadata={[ | ||
{groupId: '0', header: {title: 'Live query'}}, | ||
{groupId: '1', header: {title: 'Layout'}} | ||
]} | ||
items={[ | ||
{key: '0', text: 'repo:github/github', groupId: '0'}, | ||
{key: '1', text: 'Table', groupId: '1'}, | ||
{key: '2', text: 'Board', groupId: '1'}, | ||
{key: '3', text: 'View settings'} | ||
]} | ||
/> | ||
``` | ||
|
||
</td> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionList> | ||
<ActionList.Group title="Live query"> | ||
<ActionList.Item>repo:github/github</ActionList.Item> | ||
</ActionList.Group> | ||
<ActionList.Divider /> | ||
|
||
<ActionList.Group title="Layout"> | ||
<ActionList.Item>Table</ActionList.Item> | ||
<ActionList.Item>Board Description</ActionList.Item> | ||
</ActionList.Group> | ||
<ActionList.Divider /> | ||
|
||
<ActionList.Item>View settings</ActionList.Item> | ||
</ActionList> | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`: | ||
|
||
```js | ||
import {ActionList} from '@primer/react/deprecated' | ||
``` | ||
|
||
You can use the [one-time codemod](https://github.com/primer/react-migrate#readme) to change your import statements automatically. |
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,71 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
|
||
<br /> | ||
|
||
### ActionMenu | ||
colebemis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
ActionMenu has been rewritten with a composable API, design updates and accessibility fixes. | ||
|
||
See full list of props and examples: https://primer.style/react/ActionMenu | ||
|
||
Main changes: | ||
|
||
1. Instead of using `items` prop, use `ActionList` inside `ActionMenu` | ||
2. Instead of using `anchorContent` on `ActionMenu`, use `ActionMenu.Button` with `children` | ||
3. Instead of using `onAction` prop on `ActionMenu`, use `onSelect` prop on `ActionList.Item` | ||
4. Instead of using `groupMetadata` on `ActionMenu`, use `ActionList.Group` | ||
5. Instead of `overlayProps` on `ActionMenu`, use `ActionMenu.Overlay` | ||
|
||
<table> | ||
<tr> | ||
<th> Before (v34)</th> <th> After (v35)</th> | ||
</tr> | ||
<tr> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionMenu | ||
anchorContent="Menu" | ||
onAction={fn} | ||
items={[ | ||
{text: 'New file'}, | ||
{text: 'Copy link'}, | ||
{text: 'Edit file'}, | ||
ActionMenu.Divider, | ||
{text: 'Delete file', variant: 'danger'} | ||
]} | ||
overlayProps={{width: 'small'}} | ||
/> | ||
``` | ||
|
||
</td> | ||
<td valign="top"> | ||
|
||
```jsx | ||
<ActionMenu> | ||
<ActionMenu.Button>Menu</ActionMenu.Button> | ||
<ActionMenu.Overlay width="small"> | ||
<ActionList> | ||
<ActionList.Item onSelect={fn}>New file</ActionList.Item> | ||
<ActionList.Item>Copy link</ActionList.Item> | ||
<ActionList.Item>Edit file</ActionList.Item> | ||
<ActionList.Divider /> | ||
<ActionList.Item variant="danger">Delete file</ActionList.Item> | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`: | ||
|
||
```js | ||
import {ActionMenu} from '@primer/react/deprecated' | ||
``` | ||
|
||
You can use the [one-time codemod](https://github.com/primer/react-migrate#readme) to change your import statements automatically. |
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,109 @@ | ||
--- | ||
'@primer/react': major | ||
--- | ||
|
||
<br /> | ||
|
||
### DropdownMenu | ||
colebemis marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
DropdownMenu has been deprecated in favor of ActionMenu with ActionList | ||
|
||
See example with selection: https://primer.style/react/ActionMenu#with-selection | ||
|
||
Migration guide: | ||
|
||
1. Instead of using `items` prop, use `ActionList` inside `ActionMenu` | ||
2. Use `selectionVariant="single"` on `ActionList` to set the right semantics for selection | ||
3. Instead of using `selectedItem` prop, use `selected` prop on `ActionList.Item` | ||
4. Instead of using `renderAnchor` and `placeholder` props on `DropdownMenu`, use `ActionMenu.Button` or `ActionMenu.Anchor` | ||
5. Instead of using `onChange` prop on `DropdownMenu`, use `onSelect` prop on `ActionList.Item` | ||
6. Instead of using `groupMetadata` on `DropdownMenu`, use `ActionList.Group` | ||
7. Instead of `overlayProps` on `DropdownMenu`, use `ActionMenu.Overlay` | ||
|
||
<table> | ||
<tr> | ||
<th> Before (v34)</th> <th> After (v35)</th> | ||
</tr> | ||
<tr> | ||
<td valign="top"> | ||
|
||
```js | ||
const fieldTypes = [ | ||
{key: 0, text: 'Text'}, | ||
{key: 1, text: 'Number'}, | ||
{key: 3, text: 'Date'}, | ||
{key: 4, text: 'Single select'}, | ||
{key: 5, text: 'Iteration'} | ||
] | ||
|
||
const Example = () => { | ||
const [selectedType, setSelectedType] = React.useState() | ||
|
||
return ( | ||
<DropdownMenu | ||
renderAnchor={({children, ...anchorProps}) => ( | ||
<ButtonInvisible {...anchorProps}> | ||
{children} <GearIcon /> | ||
</ButtonInvisible> | ||
)} | ||
placeholder="Field type" | ||
items={fieldTypes} | ||
selectedItem={selectedType} | ||
onChange={setSelectedType} | ||
overlayProps={{width: 'medium'}} | ||
/> | ||
) | ||
} | ||
``` | ||
|
||
</td> | ||
<td valign="top"> | ||
|
||
```jsx | ||
const fieldTypes = [ | ||
{id: 0, text: 'Text'}, | ||
{id: 1, text: 'Number'}, | ||
{id: 3, text: 'Date'}, | ||
{id: 4, text: 'Single select'}, | ||
{id: 5, text: 'Iteration'} | ||
] | ||
|
||
const Example = () => { | ||
const [selectedType, setSelectedType] = React.useState() | ||
|
||
render( | ||
<ActionMenu> | ||
<ActionMenu.Button aria-label="Select field type">{selectedType.name || 'Field type'}</ActionMenu.Button> | ||
<ActionMenu.Overlay width="medium"> | ||
<ActionList selectionVariant="single"> | ||
{fieldTypes.map(type => ( | ||
<ActionList.Item | ||
key={type.id} | ||
selected={type.id === selectedType.id} | ||
onSelect={() => setSelectedType(type)} | ||
> | ||
{type.name} | ||
</ActionList.Item> | ||
))} | ||
</ActionList> | ||
</ActionMenu.Overlay> | ||
</ActionMenu> | ||
) | ||
} | ||
``` | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
|
||
To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`: | ||
|
||
```js | ||
import {DropdownMenu} from '@primer/react/deprecated' | ||
``` | ||
|
||
You can use the [one-time codemod](https://github.com/primer/react-migrate#readme) to change your import statements automatically. | ||
|
||
### drafts/DropdownMenu2 | ||
|
||
DropdownMenu2 has been removed in favor of ActionMenu with ActionList |
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,6 @@ | ||
--- | ||
"@primer/react": patch | ||
--- | ||
|
||
- Update styles for default variant of Button's active state | ||
- Use active state for Button when it is used to open an Overlay |
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.
Uh oh!
There was an error while loading. Please reload this page.