Skip to content

Commit

Permalink
Merge branch 'main' into 3096-remove-aria-live=polite-on-textinput-wr…
Browse files Browse the repository at this point in the history
…apper
  • Loading branch information
green6erry authored Apr 24, 2023
2 parents f0c5e4d + cb233cf commit 9fe09da
Show file tree
Hide file tree
Showing 191 changed files with 4,285 additions and 1,875 deletions.
39 changes: 39 additions & 0 deletions .changeset/modern-coins-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
"@primer/react": major
---

Update PRC ActionList implementation to have similar semantics to PVC.
* Removes `ActionList.Group`.
* Adds `ActionList.Heading` to be used for labelling children in an `ActionList`.
* Adds `heading` slot to `ActionList` for adding headings that label internal lists correctly.

ActionList.Groups inside an ActionList generated inaccessible markup. Previous usage:
```
<ActionList>
<ActionList.Group title="Actions">
<ActionList.Item>Create</ActionList.Item>
<ActionList.Item>Read</ActionList.Item>
<ActionList.Item>Update</ActionList.Item>
<ActionList.Item>Delete</ActionList.Item>
</ActionList.Group>
<ActionList.Group>
...
</ActionList.Group>
</ActionList>
```

Instead, use `ActionList`s and stack them as needed.
```
<div>
<ActionList>
<ActionList.Heading title="Actions" />
<ActionList.Item>Create</ActionList.Item>
<ActionList.Item>Read</ActionList.Item>
<ActionList.Item>Update</ActionList.Item>
<ActionList.Item>Delete</ActionList.Item>
</ActionList>
<ActionList>
...
</ActionList>
</div>
```
5 changes: 0 additions & 5 deletions .changeset/wicked-knives-sparkle.md

This file was deleted.

2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:18",
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "DavidAnson.vscode-markdownlint"],
"forwardPorts": [8000],
"postCreateCommand": ["/bin/bash", "-c", "npm run setup"],
"onCreateCommand": ["/bin/bash", "-c", "npm run setup"],
"remoteUser": "node",
"features": {
"ghcr.io/devcontainers/features/sshd:1": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @primer/components

## 35.25.1

### Patch Changes

- [#3174](https://github.com/primer/react/pull/3174) [`d4c6ae5b`](https://github.com/primer/react/commit/d4c6ae5b481631ab9bcd7256f5287612c97e021e) Thanks [@colebemis](https://github.com/colebemis)! - `MarkdownEditor` is now SSR-compatible.

Warning: In this new implementation, `MarkdownEditor.Toolbar`, `MarkdownEditor.Actions`, and `MarkdownEditor.Label` must be direct children of `MarkdownEditor`.

- [#3209](https://github.com/primer/react/pull/3209) [`a6279536`](https://github.com/primer/react/commit/a6279536e3c2c28788196fd9a5e28fc53ec6538a) Thanks [@langermank](https://github.com/langermank)! - Remove `--primer` prefix from CSS var

- [#3173](https://github.com/primer/react/pull/3173) [`6b900e90`](https://github.com/primer/react/commit/6b900e90c3a551251b8161227c3d51ba476b9b5c) Thanks [@colebemis](https://github.com/colebemis)! - `ActionList` and `NavList` are now SSR-compatible.

Warning: In this new implementation, `ActionList.LeadingVisual`, `ActionList.TrailingVisual,` and `ActionList.Description` must be direct children of `ActionList`. The same applies to `NavList`.

- [#3198](https://github.com/primer/react/pull/3198) [`a273748b`](https://github.com/primer/react/commit/a273748b6d8162b7f6e819200c5663963558ec2f) Thanks [@langermank](https://github.com/langermank)! - Bug fix: `ButtonGroup` borders show incorrectly on hover

## 35.25.0

### Minor Changes
Expand Down
17 changes: 9 additions & 8 deletions docs/content/ActionList.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ When you want to add links to the List instead of actions, use `ActionList.LinkI
</ActionList>
```

### With groups
### With headings

```javascript live noinline
const SelectFields = () => {
Expand All @@ -196,29 +196,30 @@ const SelectFields = () => {
}

return (
<ActionList selectionVariant="multiple">
<ActionList.Group title="Visible fields">
<>
<ActionList selectionVariant="multiple">
<ActionList.Heading title="Visible fields" />
{visibleOptions.map(option => (
<ActionList.Item key={option.text} selected={true} onSelect={() => toggle(option.text)}>
{option.text}
</ActionList.Item>
))}
</ActionList.Group>
<ActionList.Group
title="Hidden fields"
</ActionList>
<ActionList
selectionVariant={
/** selectionVariant override on Group: disable selection if there are no options */
hiddenOptions.length ? 'multiple' : false
}
>
<ActionList.Heading title="Hidden fields" />
{hiddenOptions.map((option, index) => (
<ActionList.Item key={option.text} selected={false} onSelect={() => toggle(option.text)}>
{option.text}
</ActionList.Item>
))}
{hiddenOptions.length === 0 && <ActionList.Item disabled>No hidden fields</ActionList.Item>}
</ActionList.Group>
</ActionList>
</ActionList>
</>
)
}

Expand Down
101 changes: 49 additions & 52 deletions docs/content/ActionMenu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,65 +110,62 @@ You can choose to have a different _anchor_ for the Menu depending on the applic
</ActionMenu>
```

### With Groups
### Divided into sections

```jsx live
<ActionMenu>
<ActionMenu.Button>Open column menu</ActionMenu.Button>

<ActionMenu.Overlay>
<ActionList showDividers>
<ActionList.Group title="Live query">
<ActionList.Item>
<ActionList.LeadingVisual>
<SearchIcon />
</ActionList.LeadingVisual>
repo:github/memex,github/github
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group title="Layout" variant="subtle">
<ActionList.Item>
<ActionList.LeadingVisual>
<NoteIcon />
</ActionList.LeadingVisual>
Table
<ActionList.Description variant="block">
Information-dense table optimized for operations across teams
</ActionList.Description>
</ActionList.Item>
<ActionList.Item role="listitem">
<ActionList.LeadingVisual>
<ProjectIcon />
</ActionList.LeadingVisual>
Board
<ActionList.Description variant="block">Kanban-style board focused on visual states</ActionList.Description>
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to current view
</ActionList.Item>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to new view
</ActionList.Item>
</ActionList.Group>
<ActionList.Divider />
<ActionList.Group>
<ActionList.Item>
<ActionList.LeadingVisual>
<GearIcon />
</ActionList.LeadingVisual>
View settings
</ActionList.Item>
</ActionList.Group>
<ActionList.Heading title="Live query" />
<ActionList.Item>
<ActionList.LeadingVisual>
<SearchIcon />
</ActionList.LeadingVisual>
repo:github/memex,github/github
</ActionList.Item>
</ActionList>
<ActionList showDividers>
<ActionList.Heading title="Layout" variant="subtle" />
<ActionList.Item>
<ActionList.LeadingVisual>
<NoteIcon />
</ActionList.LeadingVisual>
Table
<ActionList.Description variant="block">
Information-dense table optimized for operations across teams
</ActionList.Description>
</ActionList.Item>
<ActionList.Item role="listitem">
<ActionList.LeadingVisual>
<ProjectIcon />
</ActionList.LeadingVisual>
Board
<ActionList.Description variant="block">Kanban-style board focused on visual states</ActionList.Description>
</ActionList.Item>
</ActionList>
<ActionList showDividers>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to current view
</ActionList.Item>
<ActionList.Item>
<ActionList.LeadingVisual>
<FilterIcon />
</ActionList.LeadingVisual>
Save sort and filters to new view
</ActionList.Item>
</ActionList>
<ActionList>
<ActionList.Item>
<ActionList.LeadingVisual>
<GearIcon />
</ActionList.LeadingVisual>
View settings
</ActionList.Item>
</ActionList>
</ActionMenu.Overlay>
</ActionMenu>
Expand Down
4 changes: 2 additions & 2 deletions docs/content/Header.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All items directly under the Header component should be a `Header.Item` componen
</Header.Link>
</Header.Item>
<Header.Item full>Menu</Header.Item>
<Header.Item mr={0}>
<Header.Item sx={{mr: 0}}>
<Avatar src="https://github.com/octocat.png" size={20} square alt="@octocat" />
</Header.Item>
</Header>
Expand All @@ -37,7 +37,7 @@ All items directly under the Header component should be a `Header.Item` componen
<Header.Item full border={1} borderStyle="solid">
Item 2
</Header.Item>
<Header.Item mr={0}>Item 3</Header.Item>
<Header.Item sx={{mr: 0}}>Item 3</Header.Item>
</Header>
```

Expand Down
4 changes: 2 additions & 2 deletions docs/content/StyledOcticon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
description: Use StyledOcticon to render an Octicon as a component.
title: StyledOcticon
status: Alpha
source: https://github.com/primer/react/blob/main/src/StyledOcticon.tsx
source: https://github.com/primer/react/blob/main/src/StyledOcticon/StyledOcticon.tsx
componentId: styled_octicon
---

import data from '../../src/StyledOcticon.docs.json'
import data from '../../src/StyledOcticon/StyledOcticon.docs.json'

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/content/Truncate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Truncate
status: Alpha
---

import data from '../../src/Truncate.docs.json'
import data from '../../src/Truncate/Truncate.docs.json'

The Truncate component will shorten text with an ellipsis. Always add a `title` attribute to the truncated element so the full text remains accessible.

Expand Down
2 changes: 1 addition & 1 deletion docs/content/drafts/UnderlineNav2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function UnderlineNavItem({href, children, ...rest}) {
const router = useRouter()
const isCurrent = typeof href === 'string' ? router.asPath === href : router.pathname === href.pathname
return (
<UnderlineNav.Item s={Link} href={href} aria-current={isCurrent ? 'page' : undefined} {...rest}>
<UnderlineNav.Item as={Link} href={href} aria-current={isCurrent ? 'page' : undefined} {...rest}>
{children}
</UnderlineNav.Item>
)
Expand Down
Loading

0 comments on commit 9fe09da

Please sign in to comment.