diff --git a/.changeset/giant-bobcats-deliver.md b/.changeset/giant-bobcats-deliver.md
deleted file mode 100644
index ada0448a3f74..000000000000
--- a/.changeset/giant-bobcats-deliver.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@primer/react': patch
----
-
-Update ActionList to place `id` on item with an ARIA role
-
-
diff --git a/.changeset/happy-rivers-attend.md b/.changeset/happy-rivers-attend.md
deleted file mode 100644
index 82def6ab5a5c..000000000000
--- a/.changeset/happy-rivers-attend.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-"@primer/react": minor
----
-
-Updates link styles to support underline link preferences.
-
-
diff --git a/.changeset/purple-panthers-accept.md b/.changeset/purple-panthers-accept.md
deleted file mode 100644
index 11443b511e17..000000000000
--- a/.changeset/purple-panthers-accept.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-'@primer/react': patch
----
-
-Button: Allow leadingIcon, trailingIcon, trailingAction to be overridable with sx
-
-
diff --git a/.changeset/wise-boxes-peel.md b/.changeset/wise-boxes-peel.md
deleted file mode 100644
index 406b91a61d15..000000000000
--- a/.changeset/wise-boxes-peel.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-"@primer/react": patch
----
-
-Revert "Add aria-selected value to ActionList.Item."
-
-
diff --git a/.github/workflows/accessibility-alt-text-bot.yml b/.github/workflows/accessibility-alt-text-bot.yml
index 7732c9b9d2d2..fea2b10825cc 100644
--- a/.github/workflows/accessibility-alt-text-bot.yml
+++ b/.github/workflows/accessibility-alt-text-bot.yml
@@ -21,4 +21,4 @@ jobs:
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.3.0
+ uses: github/accessibility-alt-text-bot@v1.4.0
diff --git a/.github/workflows/assign_release_conductor.yml b/.github/workflows/assign_release_conductor.yml
index cc1112dfd151..86b784a3547a 100644
--- a/.github/workflows/assign_release_conductor.yml
+++ b/.github/workflows/assign_release_conductor.yml
@@ -2,6 +2,12 @@ name: Assign Release Conductor
on:
pull_request:
+ workflow_dispatch:
+ inputs:
+ pull-request:
+ type: number
+ description: Pull Request Number
+ required: true
jobs:
assign-release-conductor:
@@ -13,39 +19,84 @@ jobs:
with:
node-version: 18
- run: npm ci
- - name: Fetch user from pagerduty schedule
+ - uses: ./.github/actions/pagerduty
id: pagerduty
- uses: actions/github-script@v5
with:
- script: |
- const fetch = require('node-fetch');
- const today = new Date().toISOString().slice(0, 10) // format: 2022-11-24
- const url = `https://api.pagerduty.com/schedules/P3IIVC4?since=${today}&until=${today}`
- const response = await fetch(url, {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': 'Token token=${{ secrets.PAGERDUTY_API_KEY_SID }}'
- }
- })
- const data = await response.json()
- return data.schedule.final_schedule.rendered_schedule_entries[0].user.summary
-
- - run: echo ${{ steps.pagerduty.outputs.result }} is release conductor
-
+ schedule-id: 'P3IIVC4'
+ token: ${{ secrets.PAGERDUTY_API_KEY_SID }}
+ - run: echo ${{ steps.pagerduty.outputs.user }} is release conductor
- name: Add user as assignee and reviewer
uses: actions/github-script@v6
+ env:
+ PR_NUMBER: ${{ github.event.inputs.pull-request || github.event.pull_request.number }}
+ RELEASE_CONDUCTOR: ${{ steps.pagerduty.outputs.user }}
+ PREV_RELEASE_CONDUCTOR: ${{ steps.pagerduty.outputs.previous-schedule-user }}
with:
script: |
- github.rest.issues.addAssignees({
- issue_number: context.issue.number,
+ const { PR_NUMBER, RELEASE_CONDUCTOR, PREV_RELEASE_CONDUCTOR } = process.env;
+
+ const { data: pull } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
- assignees: [${{ steps.pagerduty.outputs.result }}]
- })
+ pull_number: PR_NUMBER,
+ });
+
+ // If the previous release conductor was added as an assignee, remove them
+ const hasPreviousAssignee = pull.assignees.find((assignee) => {
+ return assignee.login === PREV_RELEASE_CONDUCTOR;
+ });
+
+ if (hasPreviousAssignee) {
+ await github.rest.issues.removeAssignees({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: PR_NUMBER,
+ assignees: [PREV_RELEASE_CONDUCTOR],
+ });
+ }
- github.rest.pulls.requestReviewers({
- pull_number: context.issue.number,
+ // If the previous release conductor was added as a reviewer, remove them
+ const { data: requestedReviewers } = await github.rest.pulls.listRequestedReviewers({
owner: context.repo.owner,
repo: context.repo.repo,
- reviewers: [${{ steps.pagerduty.outputs.result }}]
- })
+ pull_number: PR_NUMBER,
+ });
+ const hasPreviousReviewer = requestedReviewers.users.find((user) => {
+ return user.login === PREV_RELEASE_CONDUCTOR;
+ });
+
+ if (hasPreviousReviewer) {
+ await github.rest.pulls.removeRequestedReviewers({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: PR_NUMBER,
+ reviewers: [PREV_RELEASE_CONDUCTOR],
+ });
+ }
+
+ // Add the current release conductor as an assignee if they are not currently assigned
+ const hasAssignee = pull.assignees.find((assignee) => {
+ return assignee.login === RELEASE_CONDUCTOR;
+ });
+ if (!hasAssignee) {
+ await github.rest.issues.addAssignees({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: PR_NUMBER,
+ assignees: [RELEASE_CONDUCTOR]
+ })
+ }
+
+ // Request the current release conductor as a reviewer if they are not currently requested
+ const hasReviewer = requestedReviewers.users.find((user) => {
+ return user.login === RELEASE_CONDUCTOR;
+ });
+
+ if (!hasReviewer) {
+ await github.rest.pulls.requestReviewers({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: PR_NUMBER,
+ reviewers: [RELEASE_CONDUCTOR]
+ })
+ }
diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml
deleted file mode 100644
index 614167cc9afd..000000000000
--- a/.github/workflows/changesets.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: Changesets
-'on':
- pull_request:
- types: [opened, synchronize, reopened, labeled, unlabeled]
-
-jobs:
- validate:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Set up Node.js
- uses: actions/setup-node@v3
- with:
- node-version: 18
- cache: 'npm'
- - name: Install dependencies
- run: npm ci
- # This step generates the generated/components.json file expected by the
- # validator action
- - name: Build
- run: npm run build
- - uses: gr2m/primer-release-changesets-validator-action@v1
diff --git a/.github/workflows/check_for_changeset.yml b/.github/workflows/check_for_changeset.yml
new file mode 100644
index 000000000000..3edbe005cc95
--- /dev/null
+++ b/.github/workflows/check_for_changeset.yml
@@ -0,0 +1,25 @@
+name: Check for changeset
+
+on:
+ pull_request:
+ types:
+ # On by default if you specify no types.
+ - 'opened'
+ - 'reopened'
+ - 'synchronize'
+ # For `skip-label` only.
+ - 'labeled'
+ - 'unlabeled'
+
+jobs:
+ check-for-changeset:
+ name: Check for changeset
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: 'Check for changeset'
+ uses: brettcannon/check-for-changed-files@v1
+ with:
+ file-pattern: '.changeset/*.md'
+ skip-label: 'skip changeset'
+ failure-message: 'No changeset found. If these changes should not result in a new version, apply the ${skip-label} label to this pull request. If these changes should result in a version bump, please add a changeset https://git.io/J6QvQ'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d2e7b89c6bba..ea2d3ac40fd8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,10 +54,6 @@ jobs:
run: npm run lint:md
test:
- strategy:
- fail-fast: false
- matrix:
- react: [17, 18]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -69,15 +65,7 @@ jobs:
node-version: 18
cache: 'npm'
- - name: Set React version
- run: node script/set-react-version.js ${{ matrix.react }}
-
- name: Install dependencies
- if: ${{ matrix.react == 17 }}
- run: npm install --legacy-peer-deps
-
- - name: Install dependencies
- if: ${{ matrix.react == 18 }}
run: npm ci
- name: Build
@@ -85,14 +73,8 @@ jobs:
- name: Test
run: npm run test -- --coverage
- env:
- REACT_VERSION_17: ${{ matrix.react == 17 }}
type-check:
- strategy:
- fail-fast: false
- matrix:
- react: [17, 18]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
@@ -104,15 +86,7 @@ jobs:
node-version: 18
cache: 'npm'
- - name: Set React version
- run: node script/set-react-version.js ${{ matrix.react }}
-
- - name: Install dependencies
- if: ${{ matrix.react == 17 }}
- run: npm install --legacy-peer-deps
-
- name: Install dependencies
- if: ${{ matrix.react != 17 }}
run: npm ci
- name: Type check
diff --git a/.github/workflows/release-notification.yml b/.github/workflows/release-notification.yml
deleted file mode 100644
index 6e4f653867fc..000000000000
--- a/.github/workflows/release-notification.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-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'
diff --git a/.markdownlint-cli2.cjs b/.markdownlint-cli2.cjs
index 0fe413573105..909cb8e52494 100644
--- a/.markdownlint-cli2.cjs
+++ b/.markdownlint-cli2.cjs
@@ -3,7 +3,10 @@ const githubMarkdownOpinions = require('@github/markdownlint-github')
// Rules we want to turn on but currently have too many violations
const rulesToEnforce = {
'fenced-code-language': false,
- 'no-duplicate-header': false, // Fix https://github.com/primer/doctocat/issues/527, then set this rule to `siblings_only: true`
+ // Fix https://github.com/primer/doctocat/issues/527, then set this rule to `siblings_only: true`
+ 'no-duplicate-header': false,
+ // This currently conflicts with how prettier autoformats
+ 'ul-style': false,
}
// Rules we don't care to enforce (usually stylistic)
const rulesToNotEnforce = {
diff --git a/.playwright/snapshots/components/BranchName.test.ts-snapshots/BranchName-Default-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/BranchName.test.ts-snapshots/BranchName-Default-light-forcedUnderlines-linux.png
deleted file mode 100644
index 161e327bb675..000000000000
Binary files a/.playwright/snapshots/components/BranchName.test.ts-snapshots/BranchName-Default-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/.playwright/snapshots/components/Breadcrumbs.test.ts-snapshots/Breadcrumbs-Default-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/Breadcrumbs.test.ts-snapshots/Breadcrumbs-Default-light-forcedUnderlines-linux.png
deleted file mode 100644
index 10b79842e9c0..000000000000
Binary files a/.playwright/snapshots/components/Breadcrumbs.test.ts-snapshots/Breadcrumbs-Default-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Default-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Default-light-forcedUnderlines-linux.png
deleted file mode 100644
index 0ae258202623..000000000000
Binary files a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Default-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Muted-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Muted-light-forcedUnderlines-linux.png
deleted file mode 100644
index ea2038fd8fb9..000000000000
Binary files a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Muted-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Underline-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Underline-light-forcedUnderlines-linux.png
deleted file mode 100644
index 0ae258202623..000000000000
Binary files a/.playwright/snapshots/components/Link.test.ts-snapshots/Link-Underline-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/.playwright/snapshots/components/LinkButton.test.ts-snapshots/LinkButton-Invisible-light-forcedUnderlines-linux.png b/.playwright/snapshots/components/LinkButton.test.ts-snapshots/LinkButton-Invisible-light-forcedUnderlines-linux.png
deleted file mode 100644
index 9984199a841a..000000000000
Binary files a/.playwright/snapshots/components/LinkButton.test.ts-snapshots/LinkButton-Invisible-light-forcedUnderlines-linux.png and /dev/null differ
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d6c6628367a..6da5d69a9830 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,43 @@
# @primer/components
+## 35.32.1
+
+### Patch Changes
+
+- [#3839](https://github.com/primer/react/pull/3839) [`d463d547`](https://github.com/primer/react/commit/d463d547f564d225786df7b702b735c0c7da6fd6) Thanks [@joshblack](https://github.com/joshblack)! - Restore Link underline preference to original behavior
+
+- [#3836](https://github.com/primer/react/pull/3836) [`038a7899`](https://github.com/primer/react/commit/038a7899ccaa28f57bc5ececa5aed301bab3495d) Thanks [@xiaolou86](https://github.com/xiaolou86)! - docs: fix typo
+
+## 35.32.0
+
+### Minor Changes
+
+- [#3720](https://github.com/primer/react/pull/3720) [`521b02f4`](https://github.com/primer/react/commit/521b02f4fa1fcba6375f3642e0cf1a9b01a4bda7) Thanks [@mperrotti](https://github.com/mperrotti)! - Updates link styles to support underline link preferences.
+
+
+
+- [#3813](https://github.com/primer/react/pull/3813) [`1fcfc478`](https://github.com/primer/react/commit/1fcfc47885c5c152264d7402e243700f7d02ec31) Thanks [@joshblack](https://github.com/joshblack)! - Add support for a `ref` on the inner
)
}
+Playground.argTypes = {
+ size: {
+ control: {
+ type: 'radio',
+ },
+ options: ['small', 'medium', 'large'],
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ },
+ variant: {
+ control: {
+ type: 'radio',
+ },
+ options: ['default', 'primary', 'danger', 'invisible', 'outline'],
+ },
+ alignContent: {
+ control: {
+ type: 'radio',
+ },
+ options: ['center', 'start'],
+ },
+ block: {
+ control: {
+ type: 'boolean',
+ },
+ },
+ leadingVisual: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
+ trailingVisual: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
+ trailingAction: OcticonArgType([TriangleDownIcon]),
+ trailingVisualCount: {
+ control: {
+ type: 'number',
+ },
+ },
+}
+Playground.args = {
+ block: false,
+ size: 'medium',
+ disabled: false,
+ variant: 'default',
+ alignContent: 'center',
+ trailingVisual: null,
+ leadingVisual: null,
+ trailingAction: null,
+ trailingVisualCount: undefined,
+}
export const Default = () =>
diff --git a/src/Button/IconButton.stories.tsx b/src/Button/IconButton.stories.tsx
index aad997ed291f..cc8b1f5b78af 100644
--- a/src/Button/IconButton.stories.tsx
+++ b/src/Button/IconButton.stories.tsx
@@ -6,37 +6,37 @@ import {OcticonArgType} from '../utils/story-helpers'
const meta: Meta> = {
title: 'Components/IconButton',
- argTypes: {
- size: {
- control: {
- type: 'radio',
- },
- options: ['small', 'medium', 'large'],
- },
- disabled: {
- control: {
- type: 'boolean',
- },
- },
- variant: {
- control: {
- type: 'radio',
- },
- options: ['default', 'primary', 'danger', 'invisible'],
- },
- icon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
- },
- args: {
- size: 'medium',
- disabled: false,
- variant: 'default',
- 'aria-label': 'Icon button description',
- icon: XIcon,
- },
}
export default meta
export const Playground: StoryFn = args =>
+Playground.argTypes = {
+ size: {
+ control: {
+ type: 'radio',
+ },
+ options: ['small', 'medium', 'large'],
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ },
+ variant: {
+ control: {
+ type: 'radio',
+ },
+ options: ['default', 'primary', 'danger', 'invisible'],
+ },
+ icon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
+}
+Playground.args = {
+ size: 'medium',
+ disabled: false,
+ variant: 'default',
+ 'aria-label': 'Icon button description',
+ icon: XIcon,
+}
export const Default = () =>
diff --git a/src/Button/LinkButton.stories.tsx b/src/Button/LinkButton.stories.tsx
index 7ab539d1d719..a8f21eb6325e 100644
--- a/src/Button/LinkButton.stories.tsx
+++ b/src/Button/LinkButton.stories.tsx
@@ -6,49 +6,6 @@ import {OcticonArgType} from '../utils/story-helpers'
export default {
title: 'Components/LinkButton',
- argTypes: {
- size: {
- control: {
- type: 'radio',
- },
- options: ['small', 'medium', 'large'],
- },
- variant: {
- control: {
- type: 'radio',
- },
- options: ['default', 'primary', 'danger', 'invisible', 'outline'],
- },
- alignContent: {
- control: {
- type: 'radio',
- },
- options: ['center', 'start'],
- },
- block: {
- control: {
- type: 'boolean',
- },
- },
- leadingIcon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
- trailingIcon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
- trailingAction: OcticonArgType([ChevronRightIcon]),
- trailingVisualCount: {
- control: {
- type: 'number',
- },
- },
- href: {control: 'text'},
- },
- args: {
- block: false,
- size: 'medium',
- variant: 'default',
- alignContent: 'center',
- trailingIcon: null,
- leadingIcon: null,
- href: '/',
- },
} as Meta
export const Playground: StoryFn = args => (
@@ -56,6 +13,49 @@ export const Playground: StoryFn = args => (
Default
)
+Playground.argTypes = {
+ size: {
+ control: {
+ type: 'radio',
+ },
+ options: ['small', 'medium', 'large'],
+ },
+ variant: {
+ control: {
+ type: 'radio',
+ },
+ options: ['default', 'primary', 'danger', 'invisible', 'outline'],
+ },
+ alignContent: {
+ control: {
+ type: 'radio',
+ },
+ options: ['center', 'start'],
+ },
+ block: {
+ control: {
+ type: 'boolean',
+ },
+ },
+ leadingIcon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
+ trailingIcon: OcticonArgType([EyeClosedIcon, EyeIcon, SearchIcon, XIcon, HeartIcon]),
+ trailingAction: OcticonArgType([ChevronRightIcon]),
+ trailingVisualCount: {
+ control: {
+ type: 'number',
+ },
+ },
+ href: {control: 'text'},
+}
+Playground.args = {
+ block: false,
+ size: 'medium',
+ variant: 'default',
+ alignContent: 'center',
+ trailingIcon: null,
+ leadingIcon: null,
+ href: '/',
+}
export const Default = () => (