[BpkButton]Rename BpkButtonV2 folder to BpkButton#4268
[BpkButton]Rename BpkButtonV2 folder to BpkButton#4268Faye (Faye-Xiao) wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Renames the bpk-component-button implementation from BpkButtonV2 to BpkButton, updating imports/exports and example usage to align with the new folder and default export.
Changes:
- Moved button implementation/types/styles into
src/BpkButton/and switched the component to a default export. - Updated package entrypoint (
index.ts) to import from the new path and removed theBpkButtonV2named export. - Updated tests and an example to import/use
BpkButtoninstead ofBpkButtonV2.
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/bpk-component-button/src/BpkButton/common-types.tsx | Adds button public types/constants under the new BpkButton folder. |
| packages/bpk-component-button/src/BpkButton/accessibility-test.tsx | Updates accessibility tests to import the default BpkButton. |
| packages/bpk-component-button/src/BpkButton/BpkButton.tsx | Converts component export from named (BpkButtonV2) to default (BpkButton). |
| packages/bpk-component-button/src/BpkButton/BpkButton.module.scss | Adds styles for the new BpkButton module. |
| packages/bpk-component-button/src/BpkButton/BpkButton.figma.tsx | Updates Figma Code Connect file to import the default BpkButton. |
| packages/bpk-component-button/src/BpkButton/BpkButton-test.tsx | Updates unit tests to import the default BpkButton. |
| packages/bpk-component-button/index.ts | Switches entrypoint to src/BpkButton and removes the BpkButtonV2 named export. |
| packages/bpk-component-button/README.md | Removes the migration note about BpkButtonV2 → BpkButton. |
| examples/bpk-component-layout/stack-examples.tsx | Updates example usage to use BpkButton default import. |
Comments suppressed due to low confidence (2)
packages/bpk-component-button/index.ts:41
- This removes the
BpkButtonV2named export from the package public API. If this package is consumed externally, that’s a breaking change for any consumers importing{ BpkButtonV2 }. Consider keepingexport { default as BpkButtonV2 }as a deprecated alias for at least one major release (or ensure this ships with an intentional major version bump and migration notes).
import BpkButton from './src/BpkButton/BpkButton';
export {
BUTTON_TYPES,
SIZE_TYPES,
type ButtonType,
type SizeType,
type Props,
} from './src/BpkButton/common-types';
export {
buttonThemeAttributes,
primaryThemeAttributes,
primaryOnDarkThemeAttributes,
primaryOnLightThemeAttributes,
secondaryThemeAttributes,
secondaryOnDarkThemeAttributes,
featuredThemeAttributes,
destructiveThemeAttributes,
} from './src/themeAttributes';
export default BpkButton;
packages/bpk-component-button/README.md:44
- The README previously documented the
BpkButtonV2→BpkButtonrename/migration guidance, but that section has been removed while the PR also drops theBpkButtonV2named export. It would be helpful to keep a short migration note (or link to release notes) so consumers understand why{ BpkButtonV2 }no longer exists and what to import instead.
### Button Link
The button which has `link` or `linkOnDark` type. Detail in [Button Link Type](./docs/button-link-type.md)
## Props
Check out the full list of props on Skyscanner's [design system documentation website](https://www.skyscanner.design/latest/components/button/web-eI5EFTLO#section-button-props-48).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4268 to see this build running in a browser. |
| ### Button Link | ||
| The button which has `link` or `linkOnDark` type. Detail in [Button Link Type](./docs/button-link-type.md) | ||
|
|
||
| ## BpkButton (formerly BpkButtonV2) |
There was a problem hiding this comment.
the .specify/memory/constitution also should update
| */ | ||
|
|
||
| import { BpkButtonV2, BUTTON_TYPES } from '../../packages/bpk-component-button'; | ||
| import BpkButton, { BUTTON_TYPES } from '../../packages/bpk-component-button'; |
There was a problem hiding this comment.
there are many cases in README.md still using
import { BpkButton } from '@skyscanner/backpack-web/bpk-component-button'; should update to import BpkButton from '../../packages/bpk-component-button';, eg bottom-sheet
|
Visit https://backpack.github.io/storybook-prs/4268 to see this build running in a browser. |
Rename the
BpkButtonV2folder and all its references toBpkButton, completing the cleanup of the legacy V2 naming convention.Changes include:
src/BpkButtonV2/→src/BpkButton/folder renameindex.tsupdated to import from new path and exportBpkButtondirectly (removed legacyBpkButtonV2named export and alias)examples/bpk-component-layout/stack-examples.tsxupdated to useBpkButtonRemember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md