Skip to content

Revert PRs that are breaking dotcom to get the current release out #3408

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 21 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
53ec7b1
Revert "Refactor(ActionList): ActionList.Item should render content a…
broccolinisoup Jun 12, 2023
bbc86d0
Revert "Address ToggleSwitch a11y feedback (#3251)"
broccolinisoup Jun 12, 2023
78b01ad
Revert "Revert "Refactor FilteredActionList to address a11y violation…
broccolinisoup Jun 12, 2023
c6b9e25
Revert "fix: prevent closing menu when `event.preventDefault()` is ca…
broccolinisoup Jun 12, 2023
780602f
Revert "Refactor FilteredActionList to address a11y violations and us…
broccolinisoup Jun 12, 2023
741c8a7
Revert "fix(ActionList): update to read from group context if selecti…
broccolinisoup Jun 12, 2023
700dffd
Revert "Add back check for GroupContext in ActionList.Selection to fi…
broccolinisoup Jun 12, 2023
bec5827
Revert "Fix create-slots utils path (#3223)"
broccolinisoup Jun 12, 2023
f316432
Revert "Allow up to 4 levels of nesting for the NavList (#3343)"
broccolinisoup Jun 12, 2023
ae5a587
Revert "NavList: Fix group dividers (#3328)"
broccolinisoup Jun 12, 2023
4de8bd1
Revert "StyledOcticon/Octicon: Update the render func to use `React.f…
broccolinisoup Jun 12, 2023
8ced0af
Revert "Rename component StyledOcticon to Octicon (#3148)"
broccolinisoup Jun 12, 2023
ffe13a7
Revert "Update PRC ActionList implementation to have similar semantic…
broccolinisoup Jun 12, 2023
e60671c
Update generated/components.json
broccolinisoup Jun 12, 2023
ef2cd65
Revert "Bump @primer/react-octicons to v19.0.1 (#3266)"
broccolinisoup Jun 13, 2023
648d5cb
Revert "Remove aria-hidden=true from spans with required asterisk (#3…
broccolinisoup Jun 14, 2023
ef13d8f
Rename component StyledOcticon to Octicon (#3148)
jonrohan May 12, 2023
080f4ce
Allow up to 4 levels of nesting for the NavList (#3343)
mperrotti Jun 6, 2023
d39f68a
fix: prevent closing menu when `event.preventDefault()` is called on …
siddharthkp May 31, 2023
8c2732c
Revert "PageLayout.Content should not use main landmark by default. (…
broccolinisoup Jun 16, 2023
ed03efe
Revert "Update `PageLayout` docs around `<main>` usage (#3323)"
broccolinisoup Jun 16, 2023
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/eleven-humans-sneeze.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/empty-snakes-join.md

This file was deleted.

39 changes: 0 additions & 39 deletions .changeset/modern-coins-destroy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/pink-beds-fetch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-crabs-matter.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/spicy-shoes-press.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/two-cycles-provide.md

This file was deleted.

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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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.
17 changes: 8 additions & 9 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 headings
### With groups

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

return (
<>
<ActionList selectionVariant="multiple">
<ActionList.Heading title="Visible fields" />
<ActionList selectionVariant="multiple">
<ActionList.Group title="Visible fields">
{visibleOptions.map(option => (
<ActionList.Item key={option.text} selected={true} onSelect={() => toggle(option.text)}>
{option.text}
</ActionList.Item>
))}
</ActionList>
<ActionList
</ActionList.Group>
<ActionList.Group
title="Hidden fields"
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>
</>
</ActionList.Group>
</ActionList>
)
}

Expand Down
107 changes: 56 additions & 51 deletions docs/content/ActionMenu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
componentId: action_menu
title: ActionMenu
status: Beta
a11yReviewed: false
a11yReviewed: true
source: https://github.com/primer/react/tree/main/src/ActionMenu.tsx
storybook: '/react/storybook?path=/story/components-actionmenu'
description: An ActionMenu is an ActionList-based component for creating a menu of actions that expands through a trigger button.
Expand Down Expand Up @@ -110,62 +110,65 @@ You can choose to have a different _anchor_ for the Menu depending on the applic
</ActionMenu>
```

### Divided into sections
### With Groups

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

<ActionMenu.Overlay>
<ActionList showDividers>
<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>
<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.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>
</ActionMenu.Overlay>
</ActionMenu>
Expand All @@ -190,7 +193,9 @@ const Example = () => {

return (
<ActionMenu>
<ActionMenu.Button leadingIcon={selectedType.icon}>{selectedType.name}</ActionMenu.Button>
<ActionMenu.Button aria-label="Select field type" leadingIcon={selectedType.icon}>
{selectedType.name}
</ActionMenu.Button>
<ActionMenu.Overlay width="medium">
<ActionList selectionVariant="single">
{fieldTypes.map((type, index) => (
Expand Down
50 changes: 11 additions & 39 deletions docs/content/PageLayout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,14 @@ navigation container is used for.

### With `aria-label`

Using `aria-label` along with `PageLayout.Header` or `PageLayout.Footer` creates a unique label for that landmark role that can make it easier to navigate between sections of content on a page.
Using `aria-label` along with `PageLayout.Header`, `PageLayout.Content`, or `PageLayout.Footer` creates a unique label for that landmark role that can make it easier to navigate between sections of content on a page.

```jsx live
<PageLayout>
<PageLayout.Header aria-label="header">
<Placeholder label="Header" height={64} />
</PageLayout.Header>
<PageLayout.Content>
<PageLayout.Content aria-label="content">
<Placeholder label="Content" height={240} />
</PageLayout.Content>
<PageLayout.Pane>
Expand All @@ -262,15 +262,15 @@ Using `aria-label` along with `PageLayout.Header` or `PageLayout.Footer` creates

### With `aria-labelledby`

Using `aria-labelledby` along with `PageLayout.Header` or `PageLayout.Footer` creates a unique label for each landmark role by using the given `id` to associate the landmark with the content with the corresponding `id`. This is helpful when you have a visible item that visually communicates the type of content which you would like to associate to the landmark itself.
Using `aria-labelledby` along with `PageLayout.Header`, `PageLayout.Content`, or `PageLayout.Footer` creates a unique label for each landmark role by using the given `id` to associate the landmark with the content with the corresponding `id`. This is helpful when you have a visible item that visually communicates the type of content which you would like to associate to the landmark itself.

```jsx live
<PageLayout>
<PageLayout.Header aria-labelledby="header-label">
<Placeholder id="header-label" label="Header" height={64} />
</PageLayout.Header>
<PageLayout.Content>
<Placeholder label="Content" height={240} />
<PageLayout.Content aria-labelledby="main-label">
<Placeholder id="main-label" label="Content" height={240} />
</PageLayout.Content>
<PageLayout.Pane>
<Placeholder label="Pane" height={120} />
Expand Down Expand Up @@ -300,35 +300,15 @@ Using `aria-labelledby` along with `PageLayout.Header` or `PageLayout.Footer` cr
</PageLayout>
```

### With `<main>` landmark

```jsx live
<PageLayout>
<PageLayout.Header>
<Placeholder label="Header" height={64} />
</PageLayout.Header>
<PageLayout.Content>
<main>
<Placeholder label="Content" height={240} />
</main>
</PageLayout.Content>
<PageLayout.Pane resizable>
<Placeholder label="Pane" height={120} />
</PageLayout.Pane>
<PageLayout.Footer>
<Placeholder label="Footer" height={64} />
</PageLayout.Footer>
</PageLayout>
```

## Accessibility

The `PageLayout` component uses [landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role) for `PageLayout.Header` and `PageLayout.Footer` in order to make it easier for screen reader users to navigate between sections of the page.
The `PageLayout` component uses [landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role) for `PageLayout.Header`, `PageLayout.Content`, and `PageLayout.Footer` in order to make it easier for screen reader users to navigate between sections of the page.

| Component | Landmark role |
| :------------------ | :------------------------------------------------------------------------------------------------------ |
| `PageLayout.Header` | [`banner`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/banner_role) |
| `PageLayout.Footer` | [`contentinfo`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/contentinfo_role) |
| Component | Landmark role |
| :------------------- | :------------------------------------------------------------------------------------------------------ |
| `PageLayout.Header` | [`banner`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/banner_role) |
| `PageLayout.Content` | [`main`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/main_role) |
| `PageLayout.Footer` | [`contentinfo`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/contentinfo_role) |

Each component may be labeled through either `aria-label` or `aria-labelledby` in order to provide a unique label for the landmark. This can be helpful when there are multiple landmarks of the same type on the page.

Expand All @@ -338,14 +318,6 @@ Each component may be labeled through either `aria-label` or `aria-labelledby` i
- [WCAG, ARIA11 Technique](https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA11)
- [MDN, Landmark roles](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/landmark_role)

### `PageLayout.Content`

The `PageLayout.Content` component does not provide a default `<main>` landmark role.
If you want to utilize a `<main>` landmark with this component, you may supply one directly [as a child of `PageLayout.Content`](#with-main-landmark).
When using `<main>` ensure that no other `<main>` landmark exists on the page, as there should only be one per page.

- [`main` usage](https://www.w3.org/WAI/ARIA/apg/patterns/landmarks/examples/main.html)

### `PageLayout.Pane`

The `PageLayout.Pane` component does not provide a default landmark role as the
Expand Down
Loading