-
Notifications
You must be signed in to change notification settings - Fork 11
Add Storybook with stories for each behavior #640
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
Conversation
|
bf9a5f1 to
58936df
Compare
There was a problem hiding this 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
moduleResolutionto"bundler"for modern package.json exports support - Disables
import/extensionsESLint 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.
…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>
ccdbf13 to
486afbc
Compare
import/extensionsESLint rule for consistency with primer/reactmoduleResolutionto"bundler"intsconfig.jsonto support modern package.json exports, which is required for Storybookstorybook(dev server) andbuild-storybook(production build)src/storiesdirectory from Rollup bundleI'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