-
Notifications
You must be signed in to change notification settings - Fork 204
[CAPY-1594][BpkNavigationTabGroup/BpkBubble] Create and integrate 'new' bubble tooltip in navigation tab bar #3909
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
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
<BpkText textStyle="label-3" tagName="span"> | ||
{label} | ||
</BpkText> | ||
<svg |
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.
Unsure if there's a better way to deal with inline SVG's in react, Could we take a page from how we do icons?
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.
I extracted the svg in a separate Component (BpkArrow.tsx)/icon and import it in the BpkBadge jsx.
display: inline-flex; | ||
width: auto; | ||
min-width: tokens.bpk-spacing-xxl(); | ||
max-width: tokens.bpk-spacing-xxl() * 2; |
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.
Unsure if we want to limit the size in the base implementation
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.
Sorry, here do you mean decrease the max-width or move it to the parent?
packages/bpk-component-tab-new-bubble/src/BpkBubble.module.scss
Outdated
Show resolved
Hide resolved
packages/bpk-component-tab-new-bubble/src/BpkBubble.module.scss
Outdated
Show resolved
Hide resolved
packages/bpk-component-tab-new-bubble/src/BpkBubble.module.scss
Outdated
Show resolved
Hide resolved
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.tsx
Outdated
Show resolved
Hide resolved
@include typography.bpk-text--xs; | ||
} | ||
|
||
.bpk-badge-arrow { |
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.
thought: could placement be achieved with flexbox/grid? instead of using absolute positioning
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.
thanks for the review @gert-janvercauteren.
I believe in this case, we can't use flexbox/grid reliable because:
- flexbox: we can align the arrow horizontally but we can't position it below the main content without affecting layout height
- grid: we can make a 2-row layout (row 1: text, row 2:arrow) but again: the arrow becomes part of the layout and can't poke out visually
We lose the ability to let the arrow 'escape' the bottom of the bubble without distorting its spacing or flow.
Plus I don't think we can make the arrow visually overlap outside the bubble unless we absolutely position it anyway
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.
Makes perfect sense
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.module.scss
Outdated
Show resolved
Hide resolved
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.module.scss
Outdated
Show resolved
Hide resolved
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
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 introduces a new BpkBubble
component and integrates it with BpkNavigationTabGroup
to display "New" badges on navigation tabs. The implementation allows individual tabs to display bubble tooltips by adding a badgeText
property to tab items.
- Creates a reusable
BpkBubble
component with a pill-shaped design and downward arrow - Adds
badgeText
property to navigation tab items for displaying bubble badges - Implements positioning logic for bubble placement relative to tabs with RTL support
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/bpk-component-bubble/src/BpkBubble.tsx | New bubble component with text and arrow icon |
packages/bpk-component-bubble/src/BpkBubble.module.scss | Styling for bubble appearance and arrow positioning |
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.tsx | Integration of bubble component with tab items |
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.module.scss | Positioning styles for bubble within tab context |
packages/bpk-component-bubble/src/BpkBubble-test.tsx | Unit tests for bubble component |
packages/bpk-component-bubble/src/accessibility-test.tsx | Accessibility tests for bubble component |
examples/bpk-component-navigation-tab-group/examples.tsx | Example implementation with bubble badges |
examples/bpk-component-bubble/examples.tsx | Standalone bubble component examples |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
packages/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.module.scss
Outdated
Show resolved
Hide resolved
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
Visit https://backpack.github.io/storybook-prs/3909 to see this build running in a browser. |
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.
LGTM
* main: Bump actions/download-artifact in the artifacts-actions group (#3907) Bump actions/checkout from 4 to 5 (#3913) Fix closeText style of BpkModal in dark mode (#3919) Bump the babel group across 1 directory with 5 updates (#3917) Bump @babel/runtime in the npm_and_yarn group across 1 directory (#3884) Bump actions/cache from 4.2.3 to 4.2.4 (#3905) Bump webpack from 5.99.8 to 5.101.2 (#3916) QUAR-1046 Fix CTA Button Alignment, Logo Sizing, and Logo Vertical Alignment in Inset Banner (#3912) chore: removed duplicate aria-label (#3911) [CAPY-1594][BpkNavigationTabGroup/BpkBubble] Create and integrate 'new' bubble tooltip in navigation tab bar (#3909) [CLOV-381][BpkBreakpoint] update bpk breakpoint readme (#3910) [CYB-3904][BpkGraphicPromo] Render wrapper as semantic anchor tag to improve SEO (#3904) [CLOVER-532][BpkText] Add BpkText color prop with leverage css classname (#3900) fix: A11y and icon issue for inset banner sponsored (#3901) # Conflicts: # packages/bpk-component-text/README.md # packages/bpk-component-text/src/BpkText-test.tsx # packages/bpk-component-text/src/BpkText.tsx
Overview:
We want to launch a 'Packages' tab in the GC and Banana headers. Additionally, we want to include 'New' bubble so that it can be more easily seen by users.
This PR introduces the 'New' bubble tooltip.
Implementation details:
Screenshots:
Simple ('New' EN string)



Rtl ON
Long String ('Nouveau' DE string)
Remember to include the following changes:
[Clover-123][BpkButton] Updating the colour
README.md
(If you have created a new component)README.md