Skip to content

Conversation

@joshfarrant
Copy link
Contributor

@joshfarrant joshfarrant commented Nov 20, 2025

  • Adds Storybook with stories for each exported function/behavior.
  • Disables import/extensions ESLint rule for consistency with primer/react
  • Updates moduleResolution to "bundler" in tsconfig.json to support modern package.json exports, which is required for Storybook
  • Adds css-modules.d.ts so CSS module imports in stories have proper typings
  • Adds npm scripts: storybook (dev server) and build-storybook (production build)
  • Explicitly excludes src/stories directory from Rollup bundle

I've verified that an outputted build on this branch is byte-for-byte identical to a build outputted from latest main.

Closes https://github.com/github/primer/issues/6077

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

⚠️ No Changeset found

Latest commit: 486afbc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@joshfarrant joshfarrant added the skip changeset Skip the check for changesets label Nov 20, 2025
@joshfarrant joshfarrant changed the title Joshfarrant/add storybook Add Storybook with stories for each behavior Nov 20, 2025
@joshfarrant joshfarrant force-pushed the joshfarrant/add-storybook branch 2 times, most recently from bf9a5f1 to 58936df Compare November 21, 2025 09:20
@joshfarrant joshfarrant marked this pull request as ready for review November 21, 2025 10:17
@joshfarrant joshfarrant requested a review from a team as a code owner November 21, 2025 10:17
Copilot finished reviewing on behalf of joshfarrant November 21, 2025 10:18
Copy link

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

This PR adds Storybook integration to visualize and test the library's behaviors (Anchored Position, Focus Trap, Focus Zone, and Scroll Into View). Key changes include Storybook configuration, interactive stories for each behavior, TypeScript configuration updates to support modern module resolution, and ESLint rule adjustments for consistency with primer/react.

  • Adds Storybook configuration with React-Vite framework
  • Creates interactive stories demonstrating each exported behavior
  • Updates TypeScript moduleResolution to "bundler" for modern package.json exports support
  • Disables import/extensions ESLint rule for consistency

Reviewed Changes

Copilot reviewed 15 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tsconfig.json Updates moduleResolution to "bundler" for Storybook compatibility
src/types/css-modules.d.ts Adds type definitions for CSS module imports
src/stories/*.stories.tsx Implements interactive stories for each behavior
src/stories/*.stories.module.css Styles for story components
.storybook/main.ts Storybook configuration file
.storybook/preview.ts Storybook preview configuration
.storybook/preview.css Global styles for Storybook
package.json Adds Storybook scripts and dependencies
.eslintrc.json Disables import/extensions rule, adds storybook plugin
README.md Adds Storybook usage documentation
docs/focus-zone.md Fixes trailing whitespace

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

joshfarrant and others added 12 commits December 2, 2025 12:07
…ates (#645)

Bumps the development-dependencies group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@changesets/changelog-github](https://github.com/changesets/changesets) | `0.5.1` | `0.5.2` |
| [@changesets/cli](https://github.com/changesets/changesets) | `2.29.7` | `2.29.8` |
| [@size-limit/preset-small-lib](https://github.com/ai/size-limit) | `11.2.0` | `12.0.0` |
| [prettier](https://github.com/prettier/prettier) | `3.6.2` | `3.7.1` |
| [size-limit](https://github.com/ai/size-limit) | `11.2.0` | `12.0.0` |

Updates `@changesets/changelog-github` from 0.5.1 to 0.5.2
- [Release notes](https://github.com/changesets/changesets/releases)
- [Commits](https://github.com/changesets/changesets/compare/@changesets/[email protected]...@changesets/[email protected])

Updates `@changesets/cli` from 2.29.7 to 2.29.8
- [Release notes](https://github.com/changesets/changesets/releases)
- [Commits](https://github.com/changesets/changesets/commits)

Updates `@size-limit/preset-small-lib` from 11.2.0 to 12.0.0
- [Release notes](https://github.com/ai/size-limit/releases)
- [Changelog](https://github.com/ai/size-limit/blob/main/CHANGELOG.md)
- [Commits](ai/size-limit@11.2.0...12.0.0)

Updates `prettier` from 3.6.2 to 3.7.1
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.6.2...3.7.1)

Updates `size-limit` from 11.2.0 to 12.0.0
- [Release notes](https://github.com/ai/size-limit/releases)
- [Changelog](https://github.com/ai/size-limit/blob/main/CHANGELOG.md)
- [Commits](ai/size-limit@11.2.0...12.0.0)

---
updated-dependencies:
- dependency-name: "@changesets/changelog-github"
  dependency-version: 0.5.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@changesets/cli"
  dependency-version: 2.29.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@size-limit/preset-small-lib"
  dependency-version: 12.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: development-dependencies
- dependency-name: prettier
  dependency-version: 3.7.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: size-limit
  dependency-version: 12.0.0
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@joshfarrant joshfarrant force-pushed the joshfarrant/add-storybook branch from ccdbf13 to 486afbc Compare December 2, 2025 12:08
@joshfarrant joshfarrant merged commit db7c7b4 into main Dec 2, 2025
11 checks passed
@joshfarrant joshfarrant deleted the joshfarrant/add-storybook branch December 2, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset Skip the check for changesets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants