Skip to content
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

feat(banner): additional props for banner localisation #103

Merged
merged 6 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/banner/addon/components/nucleus-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ class NucleusBanner extends Component {
*/
@defaultProp
isFixed = false;

/**
* Button Label that describes the presence of multiple banners
*
* @field showMoreLabel
* @type string
* @public
*/
@defaultProp
showMoreLabel = 'more';

/**
* Title text that describes the stack of multiple banners
*
* @field stackTitle
* @type string
* @public
*/
@defaultProp
stackTitle = 'System Alerts';

/**
* List of banner items to be rendered.
Expand Down
4 changes: 2 additions & 2 deletions packages/banner/addon/templates/components/nucleus-banner.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
ariaLabel="Show more"
block=true
type="link"
label=(concat "+ " stackedItems.length " more")
label=(concat "+ " stackedItems.length " " showMoreLabel)
onClick=(action "toggleShowMore")}}
{{#if _isShowMore}}
{{#transition-group transitionClass="fade"}}
<div class="more-card">
<h5>System alerts</h5>
<h5>{{stackTitle}}</h5>
<ul class="nucleus-banners">
{{#each stackedItems as |hiddenItem|}}
<li class="nucleus-banner--mini nucleus-banner--{{hiddenItem.type}}">
Expand Down