Skip to content
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

Update next-major with changes from main #3354

Merged
merged 30 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
285f66d
ci(release-schedule): update format for previous issue id
joshblack May 23, 2023
112fd2c
ci(release-schedule): use tagged template literals for assignees row
joshblack May 23, 2023
ac698b5
docs: update to storybook v7 (#3298)
joshblack May 23, 2023
5d06738
Jdrush89/tree focus bug (#3300)
jdrush89 May 23, 2023
e71d928
feat(npm): add experimental entrypoint (#3295)
joshblack May 24, 2023
d82f505
ci: release notification (#3318)
gr2m May 24, 2023
56c9dd2
SelectPanel: Add filter input label and description (#3312)
colebemis May 24, 2023
00cf2e3
SelectPanel: Add `title` prop (#3311)
colebemis May 24, 2023
2cf7cdd
SelectPanel: Announce changes to screen readers (#3316)
colebemis May 24, 2023
9e7681c
chore(dependencies): update @typescript-eslint/* (#3307)
joshblack May 25, 2023
3ece2f6
Remove chroma-js dependency (#3325)
siddharthkp May 25, 2023
a71bb60
Update accessibility-alt-text-bot.yml (#3326)
kendallgassner May 25, 2023
47b7ea0
Remove aria-hidden=true from spans with required asterisk (#3320)
adrianababakanian May 25, 2023
e1904b2
Update `PageLayout` docs around `<main>` usage (#3323)
TylerJDev May 25, 2023
b1395e9
ci: update ci workflow to run against next-major branch (#3329)
joshblack May 25, 2023
1fd6d32
NavList: Fix group dividers (#3328)
colebemis May 25, 2023
e865e3e
Refactor FilteredActionList to address a11y violations and use new Ac…
radglob May 26, 2023
60ebd51
Add PostCSS color var fallback for upcoming CSS work (#3278)
langermank May 26, 2023
ff8c685
Move theme dependencies on lodash from devDependencies to dependencie…
siddharthkp May 26, 2023
30c7c97
chore(deps-dev): bump terser from 5.16.1 to 5.17.6 (#3336)
dependabot[bot] May 30, 2023
8d4f5b6
chore(deps-dev): bump micromark-extension-mdxjs from 1.0.0 to 1.0.1 (…
dependabot[bot] May 30, 2023
e64ecbc
chore(deps-dev): bump @storybook/addon-essentials from 7.0.12 to 7.0.…
dependabot[bot] May 30, 2023
536a93b
ci(vrt): update build storybook step (#3333)
joshblack May 30, 2023
1665a1b
chore(deps-dev): bump prettier from 2.8.1 to 2.8.8 (#3335)
dependabot[bot] May 30, 2023
6304923
fix: prevent closing menu when `event.preventDefault()` is called on …
siddharthkp May 31, 2023
524120c
Loosen `@primitives` dependency (#3350)
langermank May 31, 2023
92f24a7
Bump alt-text-bot: get alt text reminders on discussion comments (#3351)
kendallgassner Jun 1, 2023
3ad5648
Changes alignment of form control validation message icon (#3121)
mperrotti Jun 1, 2023
1fc33cb
Update release-schedule.yml (#3342)
joshblack Jun 2, 2023
a396ff4
Update release-schedule.yml (#3345)
joshblack Jun 2, 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: 5 additions & 0 deletions .changeset/big-days-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Changes the alignment of the validation message icon to be vertically center-aligned with the first line of text.
5 changes: 5 additions & 0 deletions .changeset/brave-cherries-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

ActionMenu: Calling `event.preventDefault` inside `onSelect` of `ActionList.Item` will prevent the default behavior of closing the menu
5 changes: 5 additions & 0 deletions .changeset/early-beds-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

SelectPanel: Add filter input label and description
5 changes: 5 additions & 0 deletions .changeset/eleven-sloths-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Move `lodash.isempty` and `lodash.isobject` from `devDependencies` to `dependencies`
5 changes: 5 additions & 0 deletions .changeset/fluffy-pants-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Loosen `@primitives` dependency
5 changes: 5 additions & 0 deletions .changeset/khaki-walls-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Fixing toggle bug on Treeview when it initially receives focus
5 changes: 5 additions & 0 deletions .changeset/pink-beds-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Remove `aria-hidden=true` from `span`s with required asterisk
5 changes: 5 additions & 0 deletions .changeset/rare-humans-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

SelectPanel: Announce changes to screen readers
5 changes: 5 additions & 0 deletions .changeset/rotten-dogs-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Remove chroma-js dependency. Companion to #3243
5 changes: 5 additions & 0 deletions .changeset/small-queens-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

SelectPanel: Add `title` prop
5 changes: 5 additions & 0 deletions .changeset/tiny-melons-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Add @primer/react/experimental entrypoint as an alternative to drafts
5 changes: 5 additions & 0 deletions .changeset/weak-jokes-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

FilteredActionList now uses new ActionList as a base, and SelectPanel reflects those changes.
11 changes: 9 additions & 2 deletions .github/workflows/accessibility-alt-text-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ on:
types: [opened, edited]
issue_comment:
types: [created, edited]
discussion:
types: [created, edited]

permissions:
issues: write
pull-requests: write
discussions: write

jobs:
accessibility_alt_text_bot:
name: Check alt text is set on issue or pull requests
runs-on: ubuntu-latest
if: ${{ github.event.issue || github.event.pull_request }}
if: ${{ github.event.issue || github.event.pull_request || github.event.discussion }}
steps:
- name: Get action 'github/accessibility-alt-text-bot'
uses: github/accessibility-alt-text-bot@v1.0.0
uses: github/accessibility-alt-text-bot@v1.2.0
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ on:
push:
branches:
- main
- next-major
pull_request:
merge_group:
branches:
- main
- next-major
types:
- checks_requested

Expand Down Expand Up @@ -158,7 +160,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build storybook
run: npx build-storybook
run: npx storybook build
- name: Install browsers
run: npx playwright install --with-deps
- name: Run storybook
Expand Down Expand Up @@ -204,7 +206,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build storybook
run: npx build-storybook
run: npx storybook build
- name: Install browsers
run: npx playwright install --with-deps
- name: Run storybook
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/release-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release notification
on:
release:
types:
- published

jobs:
notify:
runs-on: ubuntu-latest
steps:
- uses: gr2m/release-notifier-action@v1
with:
app_id: ${{ secrets.RELEASE_NOTIFIER_APP_ID }}
private_key: ${{ secrets.RELEASE_NOTIFIER_APP_PRIVATE_KEY }}
dispatch_event_type: 'release:primer/react'
8 changes: 5 additions & 3 deletions .github/workflows/release-schedule.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Schedule
on:
workflow_dispatch:
schedule:
- cron: '30 13 * * MON'

concurrency:
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
Expand Down Expand Up @@ -86,7 +88,7 @@ jobs:

// Issue IDs
const id = `primer-release-schedule:${format(start, 'yyyy-MM-dd')}`;
const previousId = `primer-release-schedule:${format(previousStart, 'yyyy-M-dd')}`;
const previousId = `primer-release-schedule:${format(previousStart, 'yyyy-MM-dd')}`;

core.startGroup(`Previous schedule: ${previousId}`);
core.info(`Start: ${previousStart}`);
Expand All @@ -105,7 +107,7 @@ jobs:
'<!-- Provide updates for release activities, like cutting releases and different integration points -->',
'',
...eachDayOfInterval({ start, end }).map((day) => {
return `- ${format(day, 'EEEE do')}`;
return `- ${format(day, 'EEEE, LLLL do')}`;
}),
'',
].join('\n');
Expand Down Expand Up @@ -191,7 +193,7 @@ jobs:
ISSUE_BODY += '| Last week | Value |\n';
ISSUE_BODY += '| :-------- | :---- |\n';
ISSUE_BODY += `| Issue | [${releaseIssue.title}](${releaseIssue.html_url}) |\n`;
ISSUE_BODY += '| Conductor | ${assignees} |\n';
ISSUE_BODY += `| Conductor | ${assignees} |\n`;
ISSUE_BODY += '| Release Pull Request | [Link](https://gh.io/AAksvvr) |\n';
ISSUE_BODY += '| Integration tests | [Link](https://gh.io/AAkr65h) |\n';
ISSUE_BODY += '\n';
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vrt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Install dependencies
run: npm ci
- name: Build storybook
run: npx build-storybook
run: npx storybook build
- name: Install browsers
run: npx playwright install --with-deps
- name: Run storybook
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.
40 changes: 26 additions & 14 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
{
name: '@storybook/addon-essentials',
options: {
backgrounds: false,
},
},
'@storybook/addon-storysource',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
Expand All @@ -16,26 +21,33 @@ module.exports = {
},
},
{
name: 'storybook-css-modules', // TODO: replace with @storybook/addon-styling for storybook v7
options: {cssModulesLoaderOptions: {modules: {localIdentName: 'prc_[local]-[hash:base64:5]'}}},
},
],
core: {
builder: {
name: 'webpack5',
name: 'storybook-css-modules',
// TODO: replace with @storybook/addon-styling for storybook v7
options: {
fsCache: true,
cssModulesLoaderOptions: {
modules: {
localIdentName: 'prc_[local]-[hash:base64:5]',
},
},
},
},
},
],
features: {
interactionsDebugger: true,
storyStoreV7: true,
buildStoriesJson: true,
},
framework: '@storybook/react',
reactOptions: {
fastRefresh: true,
strictMode: true,
framework: {
name: '@storybook/react-webpack5',
options: {
fastRefresh: true,
strictMode: true,
builder: {
fsCache: true,
},
},
},
docs: {
autodocs: true,
},
}
6 changes: 0 additions & 6 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ Object.entries(PrimerBreakpoints).forEach(([viewport, value]) => {
}
})

addons.setConfig({
// Some stories may set up keyboard event handlers, which can be interfered
// with by these keyboard shortcuts.
enableShortcuts: false,
})

export const parameters = {
actions: {argTypesRegex: '^on[A-Z].*'},
html: {
Expand Down
2 changes: 1 addition & 1 deletion contributor-docs/adrs/adr-010-behavior-isolation.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Primer React's [recent addition of the Relative Time component](https://github.c

```typescript
const root = (typeof globalThis !== 'undefined' ? globalThis : window) as typeof window
const HTMLElement = root.HTMLElement || (null as unknown as typeof window['HTMLElement'])
const HTMLElement = root.HTMLElement || (null as unknown as (typeof window)['HTMLElement'])
```

These lines could also be added to the global context, to avoid adding it to each element.
Expand Down
50 changes: 39 additions & 11 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`, `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.
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.

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

### With `aria-labelledby`

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

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

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 @@ -318,6 +338,14 @@ 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
26 changes: 12 additions & 14 deletions docs/content/SelectPanel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ A `SelectPanel` provides an anchor that will open an overlay with a list of sele

```javascript live noinline
function getColorCircle(color) {
return function () {
return (
<Box
borderWidth="1px"
borderStyle="solid"
bg={color}
borderColor={color}
width={14}
height={14}
borderRadius={10}
margin="auto"
/>
)
}
return (
<Box
borderWidth="1px"
borderStyle="solid"
bg={color}
borderColor={color}
width={14}
height={14}
borderRadius={10}
margin="auto"
/>
)
}

const items = [
Expand Down
Loading