Skip to content

Commit

Permalink
Merge branch 'main' into page-layout-a11y
Browse files Browse the repository at this point in the history
  • Loading branch information
colebemis authored Mar 23, 2022
2 parents c30240e + a377a51 commit 8106309
Show file tree
Hide file tree
Showing 37 changed files with 13,312 additions and 191 deletions.
5 changes: 0 additions & 5 deletions .changeset/loud-schools-own.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/seven-hornets-jam.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spotty-eagles-help.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/stupid-terms-hang.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ten-apes-smell.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yellow-planes-decide.md

This file was deleted.

26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @primer/components

## 35.1.0

### Minor Changes

- [#1942](https://github.com/primer/react/pull/1942) [`3f50ef54`](https://github.com/primer/react/commit/3f50ef543b8cea0306aba44bb44611f22dae657d) Thanks [@mperrotti](https://github.com/mperrotti)! - Adds button element selector to FilteredSearch button styles

* [#1920](https://github.com/primer/react/pull/1920) [`40ed423e`](https://github.com/primer/react/commit/40ed423ed546ed91b69bc7bcc8361fd1e41faa8c) Thanks [@mperrotti](https://github.com/mperrotti)! - Adds a loadings state to our text input components

- [#1961](https://github.com/primer/react/pull/1961) [`767d4166`](https://github.com/primer/react/commit/767d4166ef3e76e8ea12b6eec2d1d22f45f8609c) Thanks [@simurai](https://github.com/simurai)! - Bump primer/primitives to `7.5.1`

### Patch Changes

- [#1970](https://github.com/primer/react/pull/1970) [`3b236044`](https://github.com/primer/react/commit/3b23604438b850557e7e3d0a0594a8cca119859b) Thanks [@siddharthkp](https://github.com/siddharthkp)! - ActionMenu: Fix styles for windows high contrast mode

* [#1981](https://github.com/primer/react/pull/1981) [`e9bb5956`](https://github.com/primer/react/commit/e9bb595680ff51a563260c020d1475102eba2535) Thanks [@mperrotti](https://github.com/mperrotti)! - Ensures select option text has acceptable contrast in Firefox when in dark mode

- [#1945](https://github.com/primer/react/pull/1945) [`ef3b58a1`](https://github.com/primer/react/commit/ef3b58a1fdffc8d3f709c9f63e0ee70ee0f397ba) Thanks [@pksjce](https://github.com/pksjce)! - Icon button fixes: Removes iconLabel and adds aria-label to the type

* [#1959](https://github.com/primer/react/pull/1959) [`2025036e`](https://github.com/primer/react/commit/2025036e552d8c8d02ed3139e5c8da4cb1546bb7) Thanks [@colebemis](https://github.com/colebemis)! - Fix `TextInput` types

- [#1968](https://github.com/primer/react/pull/1968) [`1b01485a`](https://github.com/primer/react/commit/1b01485a282dc882aa7c8cc3a55fe736afdac029) Thanks [@mperrotti](https://github.com/mperrotti)! - Instead of rendering unexpected FormControl children before the rest of the content, we render them in the same spot we'd normally render a Primer input component

* [#1967](https://github.com/primer/react/pull/1967) [`c83a06f0`](https://github.com/primer/react/commit/c83a06f00280ee2f8139d0cc3489242f1af46982) Thanks [@pksjce](https://github.com/pksjce)! - Add overlay props to Autocomplete.Overlay

- [#1955](https://github.com/primer/react/pull/1955) [`77e123f4`](https://github.com/primer/react/commit/77e123f403df0669f492ac636de651506709bd9a) Thanks [@pksjce](https://github.com/pksjce)! - Add disabled color and backgroundColor to Button.Counter

## 35.0.1

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions docs/content/ActionList.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
componentId: action_list
title: ActionList
status: Alpha
status: Beta
source: https://github.com/primer/react/tree/main/src/ActionList
storybook: '/react/storybook?path=/story/composite-components-actionlist'
description: An ActionList is a list of items that can be activated or selected. ActionList is the base component for many menu-type components, including ActionMenu and SelectPanel.
Expand Down Expand Up @@ -429,9 +429,9 @@ render(<SelectFields />)
usedInProduction: true,
usageExamplesDocumented: true,
hasStorybookStories: true,
designReviewed: false,
a11yReviewed: false,
stableApi: false,
designReviewed: true,
a11yReviewed: true,
stableApi: false, // TODO: revisit on April 10, 2022
addressedApiFeedback: false,
hasDesignGuidelines: true,
hasFigmaComponent: true
Expand Down
46 changes: 20 additions & 26 deletions docs/content/Button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,58 @@
componentId: button
title: Button
status: Alpha
source: https://github.com/primer/react/tree/main/src/Button2
storybook: '/react/storybook?path=/story/composite-components-button2'
source: https://github.com/primer/react/tree/main/src/Button
storybook: '/react/storybook?path=/story/composite-components-button'
description: Use button for the main actions on a page or form.
---

import {Button, IconButton, LinkButton} from '@primer/react/drafts'
import {Button, IconButton, LinkButton} from '@primer/react'

## Usage

### Installation

```js
import {Button} from '@primer/react/drafts'
import {Button} from '@primer/react'
```

### Default button

This is the default variant for the `Button` component.

```jsx live drafts
```jsx live
<Button>Default</Button>
```

### Danger button

The `danger` variant of `Button` is used to warn users about potentially destructive actions

```jsx live drafts
```jsx live
<Button variant="danger">Danger</Button>
```

### Outline button

The `outline` variant of `Button` is typically used as a secondary button

```jsx live drafts
```jsx live
<Button variant="outline">Outline</Button>
```

### Invisible button

The `invisible` variant of `Button` indicates that the action is a low priority one.

```jsx live drafts
```jsx live
<Button variant="invisible">Invisible</Button>
```

### Different sized buttons

`Button` component supports three different sizes. `small`, `medium`, `large`.

```jsx live drafts
```jsx live
<>
<Button size="small">Search</Button>
<Button sx={{mt: 2}}>Search</Button>
Expand All @@ -65,10 +65,10 @@ The `invisible` variant of `Button` indicates that the action is a low priority

### Appending an icon

We can place an inside the `Button` in either the leading or the trailing position to enhance the visual context.
We can place an icon inside the `Button` in either the leading or the trailing position to enhance the visual context.
It is recommended to use an octicon here.

```jsx live drafts
```jsx live
<>
<Button leadingIcon={SearchIcon}>Search</Button>
<Button trailingIcon={SearchIcon} sx={{mt: 2}}>
Expand All @@ -84,25 +84,19 @@ It is recommended to use an octicon here.

A separate component called `IconButton` is used if the action shows only an icon with no text. This button will remain square in shape.

```jsx live drafts
<IconButton icon={SearchIcon}>Search</IconButton>
```jsx live
<IconButton aria-label="Search" icon={SearchIcon} />
```

### Different sized icon buttons

`IconButton` also supports the three different sizes. `small`, `medium`, `large`.

```jsx live drafts
```jsx live
<>
<IconButton icon={SearchIcon} size="small">
Search
</IconButton>
<IconButton sx={{ml: 2}} icon={SearchIcon}>
Search
</IconButton>
<IconButton sx={{ml: 2}} icon={SearchIcon} size="large">
Search
</IconButton>
<IconButton aria-label="Search" size="small" icon={SearchIcon} />
<IconButton aria-label="Search" icon={SearchIcon} sx={{ml: 2}} />
<IconButton aria-label="Search" size="large" icon={SearchIcon} sx={{ml: 2}} />
</>
```

Expand All @@ -112,7 +106,7 @@ A common use case for primer is a button with a counter component which shows th
We provide `Button.Counter` as a composite component which requires you to provide a number as child.
The counter will match the `variant` styles of the parent button.

```jsx live drafts
```jsx live
<Button>
Watch
<Button.Counter>1</Button.Counter>
Expand All @@ -121,10 +115,10 @@ The counter will match the `variant` styles of the parent button.

### Styling a button

A button can be styled in an appropriate manner using the `sx` prop. This maybe to change width, or to add margins etc.
A button can be styled in an appropriate manner using the `sx` prop. This may be to change width, or to add margins etc.
Here's an example of a block button which takes 100% of available width. Checkout [styled-system](https://styled-system.com/) to see what you can send in an `sx` prop.

```jsx live drafts
```jsx live
<Button sx={{width: '100%'}}>Block</Button>
```

Expand Down
24 changes: 9 additions & 15 deletions docs/content/IconButton.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
title: IconButton
componentId: icon_button
status: Alpha
source: https://github.com/primer/react/tree/main/src/Button2
storybook: '/react/storybook?path=/story/composite-components-button2'
source: https://github.com/primer/react/tree/main/src/Button
storybook: '/react/storybook?path=/story/composite-components-button'
description: An accessible button component with no text and only icon.
---

Expand All @@ -12,32 +12,26 @@ description: An accessible button component with no text and only icon.
### Installation

```js
import {IconButton} from '@primer/react/drafts'
import {IconButton} from '@primer/react'
```

### Icon only button

A separate component called `IconButton` is used if the action shows only an icon with no text. This button will remain square in shape.

```jsx live drafts
<IconButton icon={SearchIcon}>Search</IconButton>
```jsx live
<IconButton aria-label="Search" icon={SearchIcon} />
```

### Different sized icon buttons

`IconButton` also supports the three different sizes. `small`, `medium`, `large`.

```jsx live drafts
```jsx live
<>
<IconButton icon={SearchIcon} size="small">
Search
</IconButton>
<IconButton sx={{ml: 2}} icon={SearchIcon}>
Search
</IconButton>
<IconButton sx={{ml: 2}} icon={SearchIcon} size="large">
Search
</IconButton>
<IconButton aria-label="Search" icon={SearchIcon} size="small" />
<IconButton aria-label="Search" sx={{ml: 2}} icon={SearchIcon} />
<IconButton aria-label="Search" sx={{ml: 2}} icon={SearchIcon} size="large" />
</>
```

Expand Down
Loading

0 comments on commit 8106309

Please sign in to comment.