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

Next major #1910

Merged
merged 46 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fdd6915
prepare integration branch
rezrah Feb 21, 2022
4a0cc23
Merge branch 'main' into next/v35.0.0
siddharthkp Feb 23, 2022
ff7da70
Merge branch 'main' into next/v35.0.0
colebemis Feb 23, 2022
94034e3
Merge branch 'main' into next/v35.0.0
rezrah Feb 23, 2022
8cd1243
Move deprecated components to deprecated folder (#1881)
pksjce Feb 24, 2022
310e655
Prefix component with types exported from ActionList2 and ActionMenu2…
siddharthkp Feb 24, 2022
df75752
Export PageLayout from main bundle (#1882)
colebemis Feb 24, 2022
6fc788f
Merge branch 'main' into next/v35.0.0
colebemis Feb 24, 2022
14bd580
Update release notes and add deprecation notices for SelectMenu and D…
rezrah Feb 25, 2022
f366604
Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#1895)
siddharthkp Feb 25, 2022
c5c4b92
Revert "Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#189…
siddharthkp Feb 25, 2022
17ef5ef
Deprecate ActionList v1 & Promote drafts/ActionList v2 (#1893)
siddharthkp Feb 25, 2022
d402357
Deprecate ActionMenu v1 & Promote drafts/ActionMenu v2 (#1897)
siddharthkp Feb 25, 2022
09f87c5
Merge branch 'main' into next/v35.0.0
siddharthkp Feb 25, 2022
87889b5
Merge branch 'main' of github.com:primer/react into next/v35.0.0
rezrah Feb 28, 2022
d6d1ca4
Deprecate DropdownMenu v1 + Remove DropdownMenu v2 (#1898)
siddharthkp Feb 28, 2022
64b8f88
Fix code examples in changeset (#1901)
siddharthkp Feb 28, 2022
05e54ca
Merge remote-tracking branch 'origin/main' into next-major
colebemis Feb 28, 2022
b51ea3b
Update .changeset/deprecate-actionlistv1-promote-actionlistv2.md
colebemis Feb 28, 2022
a8a3de1
Add linebreaks to changesets
colebemis Feb 28, 2022
61404ae
Button deprecation (#1908)
pksjce Mar 1, 2022
f94dcd3
Deprecate components replaced by FormControl (#1888)
mperrotti Mar 1, 2022
363bb07
fix merge conflicts with main
rezrah Mar 1, 2022
4babf20
Revert "fix merge conflicts with main"
rezrah Mar 1, 2022
d61b28a
Deprecate ChoiceFieldset and ChoiceInputField (#1900)
mperrotti Mar 1, 2022
e9b81fa
Deprecate legacy Label component (#1889)
mperrotti Mar 1, 2022
5b18a97
Move remaining deprecated components to src/deprecated (#1917)
siddharthkp Mar 2, 2022
4d4163c
Various fixes for v35 (#1916)
rezrah Mar 2, 2022
6cc86b2
Create changeset-for-1917.md (#1919)
siddharthkp Mar 2, 2022
561aad8
Add align prop on ActionMenu.Overlay to pass through to AnchoredOverl…
siddharthkp Mar 7, 2022
b1d7b8c
ActionMenu.Button: Fix spacing between text and caret (#1922)
siddharthkp Mar 7, 2022
a88749a
Update ActionMenu docs (#1931)
siddharthkp Mar 7, 2022
a98091c
Button: Update active styles + use them for aria-expanded (#1915)
siddharthkp Mar 8, 2022
1c38f84
merge main and resolve conflicts
rezrah Mar 8, 2022
41dd547
fix broken test following main merging conflict resolution
rezrah Mar 8, 2022
33da6a0
Fixes for v35 (#1934)
rezrah Mar 8, 2022
f235c3c
v35: Remove type aliases for ActionList (#1937)
siddharthkp Mar 8, 2022
7d3021e
Next major changeset edits (#1939)
colebemis Mar 9, 2022
8959aeb
Fixes for v35 (#1938)
rezrah Mar 9, 2022
2868c21
Merge branch 'main' into next-major
rezrah Mar 9, 2022
002e9cf
add missing fragments to changesets (#1940)
rezrah Mar 9, 2022
16a5d17
Update changeset examples (#1941)
colebemis Mar 9, 2022
4f07696
Fix table in changeset
colebemis Mar 9, 2022
6bb44c4
Add missing comma
colebemis Mar 9, 2022
f69a6d0
Fix grid changeset
colebemis Mar 9, 2022
8675cd8
Update button changeset
colebemis Mar 9, 2022
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
21 changes: 21 additions & 0 deletions .changeset/actionlist2-actionmenu2-prefix-types.md
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
```
155 changes: 155 additions & 0 deletions .changeset/deprecate-actionlistv1-promote-actionlistv2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
'@primer/react': major
---
<br />

### ActionList
colebemis marked this conversation as resolved.
Show resolved Hide resolved

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.
69 changes: 69 additions & 0 deletions .changeset/deprecate-actionmenuv1-promote-actionmenuv2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
'@primer/react': major
---

### 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.
107 changes: 107 additions & 0 deletions .changeset/deprecate-dropdownmenu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
'@primer/react': major
---

### 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
Loading