Skip to content

Promote Blankslate to main exports#7841

Draft
joshblack wants to merge 2 commits into
mainfrom
joshblack/blankslate-ga-ready
Draft

Promote Blankslate to main exports#7841
joshblack wants to merge 2 commits into
mainfrom
joshblack/blankslate-ga-ready

Conversation

@joshblack
Copy link
Copy Markdown
Member

Closes #

Promotes Blankslate from the experimental entrypoint to the main @primer/react entrypoint and adds a new polymorphic Blankslate.Action subcomponent for primary and secondary actions that can render as buttons or links.

Changelog

New

  • Blankslate is exported from @primer/react
  • Blankslate.Action supports variant="primary" | "secondary" and button/link rendering
  • BlankslateActionProps and related subcomponent prop types are exported

Changed

  • Blankslate.PrimaryAction and Blankslate.SecondaryAction now use the shared polymorphic action behavior
  • Blankslate docs metadata and Storybook stories now point to the stable component path

Removed

  • Nothing

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

  • npm run build -w @primer/react
  • npm run type-check -w @primer/react
  • npx vitest run packages/react/src/Blankslate/Blankslate.test.tsx packages/react/src/__tests__/exports.test.ts

Merge checklist

joshblack and others added 2 commits May 15, 2026 09:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 15, 2026 15:23
@joshblack joshblack requested a review from a team as a code owner May 15, 2026 15:23
@joshblack joshblack requested a review from llastflowers May 15, 2026 15:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 15, 2026

🦋 Changeset detected

Latest commit: e34b2ae

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Check the integration testing docs for step-by-step instructions. Or, apply the integration-tests: skipped manually label to skip these checks.

To publish a canary release for integration testing, apply the Canary Release label to this PR.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Promotes Blankslate from the experimental entrypoint to the main @primer/react API and introduces a shared polymorphic action subcomponent.

Changes:

  • Adds main and experimental exports for Blankslate and related prop types.
  • Introduces Blankslate.Action and refactors primary/secondary actions through shared behavior.
  • Updates tests, Storybook metadata, docs metadata, export snapshots, and adds a minor changeset.
Show a summary per file
File Description
packages/react/src/index.ts Adds stable Blankslate exports.
packages/react/src/experimental/index.ts Expands experimental type exports for Blankslate.
packages/react/src/Blankslate/index.tsx Adds Action to the compound component export.
packages/react/src/Blankslate/Blankslate.tsx Implements polymorphic action behavior and refactors existing actions.
packages/react/src/Blankslate/Blankslate.test.tsx Adds runtime coverage for the new action behavior.
packages/react/src/Blankslate/Blankslate.types.test.tsx Adds TypeScript usage coverage for action variants and element types.
packages/react/src/Blankslate/Blankslate.stories.tsx Moves stories to stable Storybook path and uses Blankslate.Action.
packages/react/src/Blankslate/Blankslate.features.stories.tsx Updates feature stories for stable path and new action API.
packages/react/src/Blankslate/Blankslate.docs.json Updates docs metadata, import path, story IDs, and action props.
packages/react/src/__tests__/__snapshots__/exports.test.ts.snap Updates export snapshots for new stable exports.
.changeset/blankslate-ga-ready.md Adds a minor changeset for the public API promotion.

Copilot's findings

Comments suppressed due to low confidence (3)

packages/react/src/Blankslate/Blankslate.tsx:171

  • Rendering the secondary action as a <button> through Link leaves the HTML button without a type, so it defaults to submit inside forms. Since this PR adds button rendering for secondary actions, this branch should set type="button" by default unless the caller explicitly supplies a type.
          <Link {...props} as="button" className={className} ref={buttonRef}>

packages/react/src/Blankslate/Blankslate.tsx:184

  • This exported prop type now only contains the internal element discriminator (as/href) and drops the props the component actually accepts, such as children, onClick, className, and button attributes. That is a type regression from the previous Blankslate.PrimaryActionProps and makes the newly exported prop type unusable for typed wrappers.
type BlankslatePrimaryActionProps = BlankslateActionElementProps

packages/react/src/Blankslate/Blankslate.tsx:194

  • The exported secondary action prop type does not include the props supported by the component, including children, onClick, className, and other button/link attributes. Because this PR documents and exports these subcomponent prop types, consumers using BlankslateSecondaryActionProps will not be able to type valid secondary action props, especially the new button variant.
type BlankslateSecondaryActionProps = BlankslateActionElementProps
  • Files reviewed: 11/11 changed files
  • Comments generated: 2

Comment on lines +155 to +161
<ButtonBase
{...props}
as="button"
className={className}
ref={buttonRef}
size={size === 'small' ? 'small' : undefined}
variant="primary"
Comment on lines +114 to +123
type BlankslateActionProps = React.PropsWithChildren<
BlankslateActionElementProps & {
className?: string

type BlankslateSecondaryActionProps = React.PropsWithChildren<{
href: string
}>
/**
* Specify the visual treatment of the action
*/
variant?: BlankslateActionVariant
}
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants