Skip to content

More changeset updates #1941

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 1 commit 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
36 changes: 24 additions & 12 deletions .changeset/heavy-points-marry.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,36 @@ If you were using the `Label` component to render issue/PR labels, use the [Issu
<td valign="top">

```jsx
import {Label} from "@primer/react"

<>
<Label outline>default</Label>
<Label variant="small" outline sx={{borderColor: 'danger.emphasis', color: 'danger.fg'}}>danger</Label>
</>
import {Label} from '@primer/react'

function Example() {
return (
<>
<Label outline>default</Label>
<Label variant="small" outline sx={{borderColor: 'danger.emphasis', color: 'danger.fg'}}>
danger
</Label>
</>
)
}
```

</td>
<td valign="top">

```jsx
import {Label} from "@primer/react"

<>
<Label>default</Label>
<Label size="small" variant="danger">danger</Label>
</>
import {Label} from '@primer/react'

function Example() {
return (
<>
<Label>default</Label>
<Label size="small" variant="danger">
danger
</Label>
</>
)
}
```

</td>
Expand Down
68 changes: 28 additions & 40 deletions .changeset/many-roses-hammer.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,52 +18,40 @@ We now support a variant property which takes values `primary`, `invisible`, `ou
</tr>
<tr>
<td valign="top">

```jsx

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

<>
<ButtonPrimary>
Primary Button
</ButtonPrimary>
<ButtonInvisible>
Invisible Button
</ButtonInvisible>
<ButtonOutline>
Outline Button
</ButtonOutline>
<ButtonDanger>
Danger Button
</ButtonDanger>
</>
```jsx
import {ButtonPrimary, ButtonInvisible, ButtonOutline, ButtonDanger} from '@primer/react'

function Example() {
return (
<>
<ButtonPrimary>Primary Button</ButtonPrimary>
<ButtonInvisible>Invisible Button</ButtonInvisible>
<ButtonOutline>Outline Button</ButtonOutline>
<ButtonDanger>Danger Button</ButtonDanger>
</>
)
}
```

</td>
<td valign="top">

```jsx

import { Button } from '@primer/react'

<>
<Button variant="primary">
Primary Button
</Button>
<Button variant="invisible">
Invisible Button
</Button>
<Button variant="outline">
Outline Button
</Button>
<Button variant="danger">
Danger Button
</Button>
</>
```jsx
import {Button} from '@primer/react'

function Example() {
return (
<>
<Button variant="primary">Primary Button</Button>
<Button variant="invisible">Invisible Button</Button>
<Button variant="outline">Outline Button</Button>
<Button variant="danger">Danger Button</Button>
</>
)
}
```

</td>
</tr>
</table>
Expand Down
201 changes: 83 additions & 118 deletions .changeset/nervous-pets-sleep.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

<br />

### ChoiceFieldset and ChoiceFieldset
### ChoiceFieldset

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

`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.

Expand All @@ -18,131 +18,96 @@ The `CheckboxGroup` and `RadioGroup` components are replacing the `ChoiceFieldse
<td valign="top">

```jsx
import {ChoiceFieldset} from "@primer/react"

<>
// Multi-select
<ChoiceFieldset>
<ChoiceFieldset.Legend>
Preferred Primer component interface
</ChoiceFieldset.Legend>

<ChoiceFieldset.List selectionVariant="multiple">
<ChoiceFieldset.Item value="figma">
Figma library
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="css">
Primer CSS
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="react">
Primer React components
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="viewcomponents">
Primer ViewComponents
</ChoiceFieldset.Item>
</ChoiceFieldset.List>
</ChoiceFieldset>

// Single select
<ChoiceFieldset>
<ChoiceFieldset.Legend>
Preferred Primer component interface
</ChoiceFieldset.Legend>

<ChoiceFieldset.List>
<ChoiceFieldset.Item value="figma">
Figma library
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="css">
Primer CSS
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="react">
Primer React components
</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="viewcomponents">
Primer ViewComponents
</ChoiceFieldset.Item>
</ChoiceFieldset.List>
</ChoiceFieldset>
</>

import {ChoiceFieldset} from '@primer/react'

function Example() {
return (
<>
{/* Multi-select */}
<ChoiceFieldset>
<ChoiceFieldset.Legend>Preferred Primer component interface</ChoiceFieldset.Legend>
<ChoiceFieldset.List selectionVariant="multiple">
<ChoiceFieldset.Item value="figma">Figma library</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="css">Primer CSS</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="react">Primer React components</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="viewcomponents">Primer ViewComponents</ChoiceFieldset.Item>
</ChoiceFieldset.List>
</ChoiceFieldset>

{/* Single select */}
<ChoiceFieldset>
<ChoiceFieldset.Legend>Preferred Primer component interface</ChoiceFieldset.Legend>
<ChoiceFieldset.List>
<ChoiceFieldset.Item value="figma">Figma library</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="css">Primer CSS</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="react">Primer React components</ChoiceFieldset.Item>
<ChoiceFieldset.Item value="viewcomponents">Primer ViewComponents</ChoiceFieldset.Item>
</ChoiceFieldset.List>
</ChoiceFieldset>
</>
)
}
```

</td>
<td valign="top">

```jsx
import {FormGroup, Checkbox} from "@primer/react"

<>
// Multi-select
<CheckboxGroup>
<CheckboxGroup.Label>
Preferred Primer component interface
</CheckboxGroup.Label>
<FormControl>
<Checkbox value="figma" />
<FormControl.Label>Figma</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="css" />
<FormControl.Label>CSS</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="react" />
<FormControl.Label>Primer React components</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="viewcomponents" />
<FormControl.Label>Primer ViewComponents</FormControl.Label>
</FormControl>
</CheckboxGroup>

// Single select
<RadioGroup name="preferred-primer">
<RadioGroup.Label>
Preferred Primer component interface
</RadioGroup.Label>
<FormControl>
<Radio value="figma" />
<FormControl.Label>Figma</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="css" />
<FormControl.Label>CSS</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="react" />
<FormControl.Label>Primer React components</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="viewcomponents" />
<FormControl.Label>Primer ViewComponents</FormControl.Label>
</FormControl>
</RadioGroup>
</>
import {CheckboxGroup, RadioGroup, FormControl Checkbox, Radio} from '@primer/react'

function Example() {
return (
<>
{/* Multi-select */}
<CheckboxGroup>
<CheckboxGroup.Label>Preferred Primer component interface</CheckboxGroup.Label>
<FormControl>
<Checkbox value="figma" />
<FormControl.Label>Figma</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="css" />
<FormControl.Label>CSS</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="react" />
<FormControl.Label>Primer React components</FormControl.Label>
</FormControl>
<FormControl>
<Checkbox value="viewcomponents" />
<FormControl.Label>Primer ViewComponents</FormControl.Label>
</FormControl>
</CheckboxGroup>

{/* Single select */}
<RadioGroup name="preferred-primer">
<RadioGroup.Label>Preferred Primer component interface</RadioGroup.Label>
<FormControl>
<Radio value="figma" />
<FormControl.Label>Figma</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="css" />
<FormControl.Label>CSS</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="react" />
<FormControl.Label>Primer React components</FormControl.Label>
</FormControl>
<FormControl>
<Radio value="viewcomponents" />
<FormControl.Label>Primer ViewComponents</FormControl.Label>
</FormControl>
</RadioGroup>
</>
)
}
```

</td>
</tr>
</table>
<table style="display: table">
<tr><th>Migration steps to CheckboxGroup and RadioGroup</th></tr>
<tr>
<td>

<strong>Upgrade to the new</strong> `CheckboxGroup` and `RadioGroup` components by referring to the examples in our documentation: [CheckboxGroup](https://primer.style/react/CheckboxGroup), [RadioGroup](https://primer.style/react/RadioGroup).

or

<strong>Continue using the deprecated</strong> `ChoiceFieldset` component :
To continue to use the deprecated API for now, change the import path to `@primer/react/deprecated`:

```js
import {ChoiceFieldset} from '@primer/react/deprecated' // change your import statements
import {ChoiceFieldset} from '@primer/react/deprecated'
```

ChoiceFieldset codemod: https://github.com/primer/react-migrate/blob/main/src/use-deprecated-choicefieldset.js

</td>
</tr>
</table>
You can use the [one-time codemod](https://github.com/primer/react-migrate#readme) to change your import statements automatically.
Loading