Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces BpkInputV2, a flexible composable API for input components inspired by Ark UI. The new design replaces manual docked props with automatic border detection and provides a more flexible way to compose inputs with adornments. The implementation uses a Flexbox layout approach with a unified border container, rather than absolute positioning of adornments.
Changes:
- Added new BpkInputV2 component with composable API (
Root,Input,InputAdornment) - Implemented automatic border detection for docked input groups
- Added support for validation states (valid/invalid) with icon integration
- Created comprehensive test suite and Storybook examples
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
specs/001-bpk-input-v2/tasks.md |
Task breakdown for implementing BpkInputV2 with all phases marked complete |
specs/001-bpk-input-v2/spec.md |
Component specification defining requirements and user stories |
specs/001-bpk-input-v2/research.md |
Research findings on existing patterns and architecture decisions |
specs/001-bpk-input-v2/plan.md |
Implementation plan with technical approach and structure |
specs/001-bpk-input-v2/checklists/requirements.md |
Requirements quality checklist documenting design decisions |
packages/bpk-stylesheets/base.css |
Updated base font stack (changed "Noto Sans" to "Noto Serif" in fallback list) |
packages/bpk-component-input/src/BpkInputV2/index.tsx |
Main export file for BpkInputV2 components and types |
packages/bpk-component-input/src/BpkInputV2/common-types.ts |
TypeScript type definitions for all component props |
packages/bpk-component-input/src/BpkInputV2/__snapshots__/*.snap |
Test snapshots for component variations |
packages/bpk-component-input/src/BpkInputV2/BpkInputV2.module.scss |
Component styles using Flexbox layout with unified border container |
packages/bpk-component-input/src/BpkInputV2/BpkInputV2-test.tsx |
Unit tests covering all user stories and variations |
packages/bpk-component-input/src/BpkInputV2/BpkInputRoot.tsx |
Root component managing context and automatic border detection |
packages/bpk-component-input/src/BpkInputV2/BpkInputGroup-test.tsx |
Tests for docked input group functionality |
packages/bpk-component-input/src/BpkInputV2/BpkInputContext.tsx |
React Context for sharing state between components |
packages/bpk-component-input/src/BpkInputV2/BpkInputAdornment.tsx |
Flexible adornment component as flex child |
packages/bpk-component-input/src/BpkInputV2/BpkInput.tsx |
Input element as flex child within input-container |
examples/bpk-component-input-v2/stories.tsx |
Storybook story definitions for all component variations |
examples/bpk-component-input-v2/examples.tsx |
Example implementations demonstrating component usage |
examples/bpk-component-input-v2/examples.module.scss |
Styles for Storybook examples |
CLAUDE.md |
Auto-generated development guidelines |
.github/workflows/release.yml |
Updated to use release tag instead of main branch |
.claude/commands/migrate-to-backpack.md |
Migration guide for adopting Backpack components |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/bpk-stylesheets/base.css
Outdated
| * limitations under the License. | ||
| * | ||
| *//*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none}a{background-color:rgba(0,0,0,0);-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}html{font-size:100%;box-sizing:border-box}*{box-sizing:inherit}*::before,*::after{box-sizing:inherit}body{color:#161616;font-family:var(--bpk-base-font-stack, "Skyscanner Relative", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Thai", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif);font-size:1rem;line-height:1.3rem}body.scaffold-font-size{font-size:13px}body.enable-font-smoothing{-webkit-font-smoothing:antialiased}:focus-visible{outline:.125rem solid #0062e3;outline-offset:.125rem}.hidden,.hide{display:none !important}.visuallyhidden,.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus,.visually-hidden.focusable:active,.visually-hidden.focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.invisible{visibility:hidden}.clearfix::before,.clearfix::after{content:"";display:table}.clearfix::after{clear:both} | ||
| *//*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none}a{background-color:rgba(0,0,0,0);-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}html{font-size:100%;box-sizing:border-box}*{box-sizing:inherit}*::before,*::after{box-sizing:inherit}body{color:#161616;font-family:var(--bpk-base-font-stack, "Skyscanner Relative", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Serif", "Noto Serif Devanagari", "Noto Serif Thai", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif);font-size:1rem;line-height:1.3rem}body.scaffold-font-size{font-size:13px}body.enable-font-smoothing{-webkit-font-smoothing:antialiased}:focus-visible{outline:.125rem solid #0062e3;outline-offset:.125rem}.hidden,.hide{display:none !important}.visuallyhidden,.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus,.visually-hidden.focusable:active,.visually-hidden.focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.invisible{visibility:hidden}.clearfix::before,.clearfix::after{content:"";display:table}.clearfix::after{clear:both} |
There was a problem hiding this comment.
Changed "Noto Sans" to "Noto Serif" in the font stack. This appears to be intentional for Devanagari and Thai scripts, but the base "Noto Sans" was also changed to "Noto Serif", which may not be intended as it changes from a sans-serif to a serif font as the primary fallback.
| const [value, setValue] = useState('100'); | ||
|
|
||
| return ( | ||
| <BpkInput.Root > |
There was a problem hiding this comment.
Unnecessary whitespace before the closing angle bracket. While this doesn't affect functionality, it's inconsistent with code style in other examples in the same file.
|
Visit https://backpack.github.io/storybook-prs/4209 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4209 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4209 to see this build running in a browser. |
Remember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md