Skip to content

feat(BpkCheckboxV2): add fullWidth prop to Root#4772

Open
IrinaWei wants to merge 1 commit into
mainfrom
feat/checkbox-v2-full-width
Open

feat(BpkCheckboxV2): add fullWidth prop to Root#4772
IrinaWei wants to merge 1 commit into
mainfrom
feat/checkbox-v2-full-width

Conversation

@IrinaWei

Copy link
Copy Markdown
Contributor

Summary

  • Adds opt-in fullWidth?: boolean prop to BpkCheckboxV2.Root
  • When true, applies bpk-checkbox-v2--full-width modifier → width: 100%
  • Default inline-flex display unchanged — zero breaking changes for existing consumers (Overlay, carhire-homepage)
  • Adds FullWidth Storybook story with unchecked / checked+description / disabled variants inside a constrained container

Why not change inline-flexflex globally?

Searched Skyscanner org — found two external consumers using BpkCheckboxV2.Root in contexts that would break if the root became block-level. An opt-in prop avoids all regressions.

Test plan

  • BpkCheckboxV2-test — 17 tests pass, snapshots unchanged
  • Lint clean (lint-staged passed on commit)
  • Storybook: FullWidth story renders at 300px container, all three variants fill width
  • Existing stories unaffected

Adds an opt-in `fullWidth` boolean prop to `BpkCheckboxV2.Root` that
sets `width: 100%` via a new `bpk-checkbox-v2--full-width` modifier,
allowing the component to stretch as a flex child inside a container.

The default `inline-flex` display is preserved to avoid breaking
existing usages (Overlay, carhire-homepage) where the checkbox
sits inline or in a non-constrained context.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 29, 2026 10:03
@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor

Visit https://backpack.github.io/storybook-prs/4772 to see this build running in a browser.

@skyscanner-backpack-bot

Copy link
Copy Markdown
Contributor
Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.js) were updated, but snapshots weren't. Have you checked that the tests still pass?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers.

Generated by 🚫 dangerJS against a1f10ad

@IrinaWei IrinaWei added minor Non breaking change patch Patch production bug labels Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds an opt-in fullWidth prop to BpkCheckboxV2.Root to allow the checkbox root to expand to its container width via a new CSS modifier, and demonstrates the behavior in Storybook.

Changes:

  • Added fullWidth?: boolean prop to BpkCheckboxV2.Root that conditionally applies a --full-width modifier class.
  • Added SCSS styling for the new bpk-checkbox-v2--full-width modifier (width: 100%).
  • Added a new FullWidth Storybook story and included the example in the existing VisualTest composite story.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/backpack-web/src/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Root.tsx Introduces fullWidth prop and toggles a modifier class on the root.
packages/backpack-web/src/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2.stories.tsx Adds a FullWidth example/story and includes it in the mixed visual test story.
packages/backpack-web/src/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2.module.scss Adds --full-width modifier styling (width: 100%).

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

Comment on lines +67 to +69
className={getClassName('bpk-checkbox-v2', {
'bpk-checkbox-v2--full-width': fullWidth,
})}
Comment on lines 285 to 289
<IndeterminateExample />
<InvalidExample />
<ThemedExample />
<FullWidthExample />
</BpkFlex>
Comment on lines +241 to +243
const FullWidthExample = () => (
<BpkProvider>
<div style={{ width: '300px', border: '1px dashed #ccc', padding: '16px' }}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Non breaking change patch Patch production bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants