[CLOV-1341][BpkChip]Theming support to BpkChip#4272
Conversation
There was a problem hiding this comment.
Pull request overview
Adds broader theming support for BpkChip by switching more chip styles to CSS-variable-backed mixins, exposing new theme attribute groupings for consumers, and providing a Storybook example demonstrating overrides.
Changes:
- Updated chip SCSS mixin to make border-radius, colors, and borders themeable via CSS variable fallbacks.
- Expanded
bpk-component-chiptheme attribute exports (while preserving the original default export for backward compatibility) and added tests. - Added a new Storybook “Themed” example demonstrating chip theme overrides via
BpkThemeProvider.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/bpk-mixins/_chips.scss |
Applies bpk-themeable-property/CSS var fallbacks across chip variants and introduces a helper for themeable borders. |
packages/bpk-component-chip/src/themeAttributes.ts |
Keeps the legacy default export intact and adds new grouped theme attribute exports. |
packages/bpk-component-chip/src/themeAttributes-test.ts |
Verifies backward compatibility and coverage for newly exported theme attribute groups. |
packages/bpk-component-chip/index.ts |
Re-exports new theme attribute groupings from the package entry point. |
examples/bpk-component-chip/stories.tsx |
Adds a new “Themed” story entry. |
examples/bpk-component-chip/examples.tsx |
Implements the new ThemedExample using BpkThemeProvider. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Visit https://backpack.github.io/storybook-prs/4272 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4272 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4272 to see this build running in a browser. |
|
Visit https://backpack.github.io/storybook-prs/4272 to see this build running in a browser. |
Gert-Jan Vercauteren (gert-janvercauteren)
left a comment
There was a problem hiding this comment.
LGTM
| </BpkText> | ||
| <BpkThemeProvider | ||
| theme={{ | ||
| chipBorderRadius: '1rem', |
There was a problem hiding this comment.
can we use borderRadiusLg for chipBorderRadius
packages/bpk-mixins/_chips.scss
Outdated
| @include utils.bpk-themeable-property( | ||
| border-radius, | ||
| --bpk-chip-border-radius, | ||
| tokens.$bpk-border-radius-xs * 2 |
There was a problem hiding this comment.
it can use $bpk-border-radius-sm instead
|
Visit https://backpack.github.io/storybook-prs/4272 to see this build running in a browser. |
* themable bpkChip * hover color * delete skill * hover fallbaock * change to _border * update readme * update boder token using
* default export autosuggest * modify migartion * modify migration doc * change autosuggest storybook name * [CLOV-1340] [BpkBadge] BpkBadge Themeability Enhancements (#4270) * [CLOV-1340] [BpkBadge] BpkBadge Themeability Enhancements * update readme * Update examples/bpk-component-badge/examples.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * add allBadgeThemeAttributes * themeable property mixin --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [BpkButton]Add loading prop for BpkButton (#4275) * add loading state for BpkButton * fix test and comments * revert comments * remove dead code * fix bpkbutton link style * update example text * [CLOV-1341][BpkChip]Theming support to BpkChip (#4272) * themable bpkChip * hover color * delete skill * hover fallbaock * change to _border * update readme * update boder token using * [CLOV-90] TS migration of bpk-component-table (#4123) * initiate SDD * add speckit command for copilot * [TypeScript] Migrate bpk-component-table to TypeScript Migrated bpk-component-table from Flow to TypeScript with zero API changes. ## Summary - Migrated 6 table components to TypeScript (.js → .tsx) - Migrated 7 test files to TypeScript (.js → .tsx) - Migrated examples and stories to TypeScript - Added TypeScript type exports for all components - Updated README with TypeScript usage section ## Changes - All Flow annotations removed - TypeScript type definitions added inline in component files - PropTypes retained for runtime validation - Rest props pattern: [rest: string]: any; // Inexact rest - Entry point migrated: index.js → index.ts ## Testing - ✅ All 24 tests passing (100% pass rate) - ✅ Test coverage: 100% (branches, functions, lines, statements) - ✅ All snapshots byte-identical - ✅ Accessibility tests passing with jest-axe - ✅ Build successful ## Type Definitions All components now export TypeScript types: - BpkTableProps, BpkTableHeadProps, BpkTableBodyProps - BpkTableRowProps, BpkTableCellProps, BpkTableHeadCellProps ## Breaking Changes None - This is a PATCH version migration with zero API changes. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * [Docs] Add TypeScript migration specification documents Added comprehensive documentation for bpk-component-table TypeScript migration: - spec.md: Feature specification with requirements and success criteria - plan.md: Implementation plan with constitution compliance - tasks.md: Detailed task breakdown with completion tracking - research.md: Flow to TypeScript type mapping research - api-design.md: TypeScript type definitions for all components - styling-guide.md: Confirmed zero styling changes - checklists/requirements.md: Specification quality validation - MIGRATION_COMPLETE.md: Final migration summary Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * [License] Add Apache 2.0 license headers to speckit scripts Added missing license headers to all speckit bash scripts: - check-prerequisites.sh - common.sh - create-new-feature.sh - setup-plan.sh - update-agent-context.sh Updated constitution.md to document license header requirement: - Added NON-NEGOTIABLE license header requirement in Section II - Included template for TypeScript/JavaScript files - Included guidance for bash scripts (# comments after shebang) - Ensures legal compliance and proper attribution Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * [Docs] Document TypeScript file extension patterns for bpk-component-table Add comprehensive documentation for proper TypeScript file extension usage: - Update spec.md with User Story 6 (File Extension Correctness) and MIG-012 - Add file extension analysis to research.md confirming all files correctly named - Create implementation plan.md documenting verification process - Update requirements checklist with file extension guidance Key findings: - index.ts correctly uses .ts (no JSX) - All component/test/example files correctly use .tsx (contain JSX) - No code changes needed - migration already follows best practices This documentation serves as reference for future TypeScript migrations. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * update requirement for liscence header * change header template * change plan template for examples * optimize document * change api type to inherite html element * fix storybook api doc missing and delete propTypes * add comment to template * delete spec --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> * Create skill to migrate to v42 (#4277) * Create skill to migrate to v42 * add more detail for autosuggest migration * update skills --------- Co-authored-by: Kerrie Wu <kerrie.wu@skyscanner.net> Co-authored-by: kerrie-wu <52308828+kerrie-wu@users.noreply.github.com> * add using skills guide in migration doc --------- Co-authored-by: Faye <faye.xiao@skyscanner.net> Co-authored-by: Ezreal Yang <supremeyh@126.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: GC Zhu <171069086@qq.com> Co-authored-by: IrinaWei <irina.wei@skyscanner.net> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com> Co-authored-by: Jaume Salgado <jaume.salgado@skyscanner.net>
Summary
Adds full theming support to
BpkChipvia CSS custom properties, enabling consumers to override colours, borders, and border-radius throughBpkThemeProvider.What changed
packages/bpk-mixins/_chips.scssbpk-themeable-propertycalls across all three chip variants (default,on-dark,on-image) — covering background, text, hover, active, and selected states.bpk-chip-themeable-borderhelper mixin to work around the limitation thatbpk-border-sm(which usesbox-shadowshorthand) cannot accept a CSS variable directly. The two-line fallback pattern (box-shadowwith literal fallback +box-shadowwithvar()) is applied instead.border-radiusthemeable via--bpk-chip-border-radius.packages/bpk-component-chip/src/themeAttributes.tschipBorderRadiusThemeAttributes—['chipBorderRadius']chipDefaultThemeAttributes— 10 attributes covering all default variant stateschipOnDarkThemeAttributes— 9 attributes covering all on-dark variant stateschipOnImageThemeAttributes— 8 attributes covering all on-image variant statespackages/bpk-component-chip/index.tspackages/bpk-component-chip/src/themeAttributes-test.tsexamples/bpk-component-chip/examples.tsxThemedExampleStorybook story demonstrating a custom theme override usingBpkThemeProviderwithchipDefaultBorderColor,chipDefaultSelectedBackgroundColor,chipBorderRadius, and related attributes.Non-breaking
themeAttributesexport is preserved as-is.Remember to include the following changes:
[Clover-123][BpkButton] Updating the colourREADME.md(If you have created a new component)README.md