Skip to content

Next major changeset edits #1939

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 2 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 5 deletions .changeset/changeset-for-1917.md

This file was deleted.

152 changes: 0 additions & 152 deletions .changeset/empty-pillows-hunt.md

This file was deleted.

14 changes: 13 additions & 1 deletion .changeset/heavy-points-marry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
'@primer/react': major
---

<br />

### Label

The Label component's API and visual design have been updated to be consistent with its counterpart in [Primer ViewComponents' Label component](https://primer.style/view-components/components/label).

Major changes in the new Label component:
Expand All @@ -14,7 +18,7 @@ If you were using the `Label` component to render issue/PR labels, use the [Issu

<table>
<tr>
<th> Before </th> <th> After </th>
<th> Before (v34) </th> <th> After (v35) </th>
</tr>
<tr>
<td valign="top">
Expand All @@ -39,3 +43,11 @@ import {Label} from "@primer/react"
</td>
</tr>
</table>

To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`:

```js
import {Label} from '@primer/react/deprecated'
```

You can use the [one-time codemod](https://github.com/primer/react-migrate#readme) to change your import statements automatically.
27 changes: 15 additions & 12 deletions .changeset/many-roses-hammer.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
'@primer/react': major
---
### Button deprecation

A new set of `Button` components brings a much needed update. Previously to `v35`, `Button` was a set of seven independent components. In `v35`, we now have common `Button` usage guidelines and more convenient API.
<br />

### Button

Before `v35`, `Button` was a set of seven independent components. In `v35`, we now have common `Button` usage guidelines and a more convenient API.

#### Button variants

We now support a variant property which takes values `primary`, `invisible`, `outline` and `danger`

<table>
Expand All @@ -17,10 +21,10 @@ We now support a variant property which takes values `primary`, `invisible`, `ou

```jsx

import { ButtonPrimary, ButtonInvisible,
ButtonOutline, ButtonDanger }
from '@primer/react'
import { ButtonPrimary, ButtonInvisible,
ButtonOutline, ButtonDanger }
from '@primer/react'

<ButtonPrimary>
Primary Button
</ButtonPrimary>
Expand All @@ -41,7 +45,7 @@ import { ButtonPrimary, ButtonInvisible,
```jsx

import { Button } from '@primer/react'

<Button variant="primary">
Primary Button
</Button>
Expand All @@ -60,10 +64,9 @@ import { Button } from '@primer/react'
</tr>
</table>

### Leading and Trailing icons
### Leading and trailing icons

In the previous component, we allowed icon components to be direct children. This results in a lot of custom styling for the icon components.
In the new one, we now have `leadinIcon` and `trailingIcon` properties.
Previously including icons inside buttons required a lot of custom styling. In the new `Button` component, we now support first-class `leadingIcon` and `trailingIcon` props:

<table>
<tr>
Expand Down Expand Up @@ -92,7 +95,7 @@ In the new one, we now have `leadinIcon` and `trailingIcon` properties.

### Icon buttons

Icon only buttons are common usages in products. So we now have a component for the specific usecase
Icon-only buttons are common in many applications. We now have a component for this use-case:

<table>
<tr>
Expand Down Expand Up @@ -120,7 +123,7 @@ Icon only buttons are common usages in products. So we now have a component for

### Size property

Earlier we used `variant` to mean size property. Now we have a new property called `size` which is more semantically correct.
Previously, we used a `variant` prop to set the size of buttons. We now have a prop called `size` which is more semantically correct.

<table>
<tr>
Expand Down
6 changes: 4 additions & 2 deletions .changeset/nervous-pets-sleep.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
'@primer/react': major
---

<br />

### ChoiceFieldset and ChoiceFieldset

The `CheckboxGroup` and `RadioGroup` components will be used to deprecate the `ChoiceFieldset` component. The deprecation of `ChoiceFieldset` also allows us to deprecate `ChoiceInputField`.
The `CheckboxGroup` and `RadioGroup` components are replacing the `ChoiceFieldset` component. The deprecation of `ChoiceFieldset` also allows us to deprecate `ChoiceInputField`.

`CheckboxGroup` and `RadioGroup` have the ability to render contextual content with your fieldset: labels, validation statuses, captions. It also handles the ARIA attributes that make the form controls accessible to assistive technology.
`CheckboxGroup` and `RadioGroup` have the ability to render contextual content with your fieldset: labels, validation statuses, captions. They also handle the ARIA attributes that make the form controls accessible to assistive technology.

<table>
<tr>
Expand Down
21 changes: 13 additions & 8 deletions .changeset/olive-bears-act.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
'@primer/react': major
---

The `FormControl` component will be used to deprecate the `FormGroup`, `InputField`, and `ChoiceInputField` components. It has the ability to render contextual content with your inputs: labels, validation statuses, captions. It also handles the ARIA attributes that make the form controls accessible to assistive technology.
<br />

### FormGroup, InputField, ChoiceInputField

The `FormControl` component is replacing the `FormGroup`, `InputField`, and `ChoiceInputField` components. It has the ability to render contextual content with your inputs: labels, validation statuses, captions. It also handles the ARIA attributes that make the form controls accessible to assistive technology.

<table>
<tr>
<th> Before </th> <th> After </th>
<th> Before (v34) </th> <th> After (v35) </th>
</tr>
<tr>
<td valign="top">
Expand All @@ -16,22 +20,22 @@ import {FormControl, Checkbox, TextInput} from "@primer/react"


<FormGroup>
<FormGroup.Label htmlFor="example-text">Example text</FormGroup.Label>
<TextInput id="example-text" />
<FormGroup.Label htmlFor="example-text">Example text</FormGroup.Label>
<TextInput id="example-text" />
</FormGroup>

// OR

<InputField>
<InputField.Label>Example text</InputField.Label>
<TextInput />
<InputField.Label>Example text</InputField.Label>
<TextInput />
</InputField>

// OR

<ChoiceInputField>
<ChoiceInputField.Label>Example text</ChoiceInputField.Label>
<Checkbox />
<ChoiceInputField.Label>Example text</ChoiceInputField.Label>
<Checkbox />
</ChoiceInputField>

```
Expand Down Expand Up @@ -83,6 +87,7 @@ import {FormControl} from '@primer/react'
</td>
</tr>
</table>

<table style="display: table">
<tr><th>Migration steps to FormControl</th></tr>
<tr>
Expand Down