Skip to content

Commit

Permalink
feat(styles): introduce new Title Bar BTP component [ci visual] (#4874)
Browse files Browse the repository at this point in the history
  • Loading branch information
InnaAtanasova authored Oct 10, 2023
1 parent aa348d6 commit 8f30a88
Show file tree
Hide file tree
Showing 11 changed files with 347 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/styles/src/fundamental-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
@import "navigation";
@import "navigation-menu";
@import "tool-layout";
@import "title-bar";

// BTP Specific components/overwrites
@import "./btp/avatar.scss";
50 changes: 50 additions & 0 deletions packages/styles/src/title-bar.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@import './new-settings';
@import './mixins';

$block: #{$fd-namespace}-title-bar;

.#{$block} {
@include fd-reset();
@include fd-ellipsis();

@include fd-flex-vertical-center() {
gap: 0.125rem;
}

max-width: 100%;

&__container {
@include fd-reset();
@include fd-ellipsis();

@include fd-flex(column) {
gap: 0.125rem;
}
}

&__title-container {
@include fd-reset();

@include fd-flex-vertical-center() {
gap: 0.125rem;
}
}

&__title {
@include fd-reset();
@include fd-ellipsis();

font-size: 1.25rem;
font-weight: bold;
line-height: 1.5rem;
}

&__subtitle {
@include fd-reset();
@include fd-ellipsis();

font-weight: normal;
font-size: var(--sapFontSize);
color: var(--sapContent_LabelColor);
}
}
8 changes: 8 additions & 0 deletions packages/styles/src/toolbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ $block: #{$fd-namespace}-toolbar;
--fdToolbar_Background: var(--sapGroup_TitleBackground);
}

&.#{$block}--title-bar {
@include fd-set-paddings-y-equal(0.375rem);

--fdToolbar_Height: auto;
--fdToolbar_Padding_Left: 0.75rem;
--fdToolbar_Padding_Right: 0.75rem;
}

&--info {
position: relative;
color: var(--fdToolbar_Info_Color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
- Avoid using the bottom navigation area for service information. Use settings and user menu instead.
`,
tags: ['btp', 'development']
tags: ['btp', 'development', 'horizon-only']
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {
- Avoid using the bottom navigation area for service information. Use settings and user menu instead.
`,
tags: ['btp', 'development']
tags: ['btp', 'development', 'horizon-only']
}
};

Expand Down
167 changes: 167 additions & 0 deletions packages/styles/stories/BTP/title-bar/desktop.example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
</div>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button fd-button--compact">View 1</button>
<button class="fd-button fd-button--compact fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button fd-button--compact">View 3</button>
</div>
<span class="fd-toolbar__spacer"></span>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>

<br><br>
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button fd-button--compact">View 1</button>
<button class="fd-button fd-button--compact fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button fd-button--compact">View 3</button>
</div>
<span class="fd-toolbar__spacer"></span>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>

<br><br>
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Back">
<i class="sap-icon--navigation-left-arrow" role="presentation"></i>
</button>
</div>
<div class="fd-title-bar__container">
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button fd-button--compact">View 1</button>
<button class="fd-button fd-button--compact fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button fd-button--compact">View 3</button>
</div>
<span class="fd-toolbar__spacer"></span>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>

<br><br>
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<ul class="fd-breadcrumb">
<li class="fd-breadcrumb__item"><a class="fd-link" tabindex="0" href="#"><span class="fd-link__content">Products</span></a></li>
<li class="fd-breadcrumb__item"><a class="fd-link" tabindex="0" href="#"><span class="fd-link__content">Suppliers</span></a></li>
</ul>
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button fd-button--compact">View 1</button>
<button class="fd-button fd-button--compact fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button fd-button--compact">View 3</button>
</div>
<span class="fd-toolbar__spacer"></span>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>

<br><br>
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Back">
<i class="sap-icon--navigation-left-arrow" role="presentation"></i>
</button>
</div>
<div class="fd-title-bar__container">
<ul class="fd-breadcrumb">
<li class="fd-breadcrumb__item"><a class="fd-link" tabindex="0" href="#"><span class="fd-link__content">Products</span></a></li>
<li class="fd-breadcrumb__item"><a class="fd-link" tabindex="0" href="#"><span class="fd-link__content">Suppliers</span></a></li>
</ul>
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button fd-button--compact">View 1</button>
<button class="fd-button fd-button--compact fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button fd-button--compact">View 3</button>
</div>
<span class="fd-toolbar__spacer"></span>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--compact fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>
31 changes: 31 additions & 0 deletions packages/styles/stories/BTP/title-bar/mobile.example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<div style="max-width: 600px;">
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<button class="fd-button fd-button--transparent" aria-label="Back">
<i class="sap-icon--navigation-left-arrow" role="presentation"></i>
</button>
</div>
<div class="fd-title-bar__container">
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>

<button class="fd-button fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--transparent" aria-label="Overflow">
<i class="sap-icon--overflow" role="presentation"></i>
</button>
</div>
</div>
35 changes: 35 additions & 0 deletions packages/styles/stories/BTP/title-bar/tablet.example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<div style="max-width: 860px;">
<div class="fd-toolbar fd-toolbar--clear fd-toolbar--title-bar" role="toolbar" aria-label="Left, center, and right-aligned toolbar">
<div class="fd-title-bar">
<div class="fd-title-bar__container">
<button class="fd-button fd-button--transparent" aria-label="Back">
<i class="sap-icon--navigation-left-arrow" role="presentation"></i>
</button>
</div>
<div class="fd-title-bar__container">
<div class="fd-title-bar__title-container">
<h4 class="fd-title-bar__title">Title</h4>
<button class="fd-button fd-button--nested" aria-label="information">
<i class="sap-icon--hint" role="presentation"></i>
</button>
</div>
<span class="fd-title-bar__subtitle">Subtitle, byline, description</span>
</div>
</div>
<span class="fd-toolbar__spacer"></span>
<div class="fd-segmented-button" role="group" aria-label="Group label">
<button class="fd-button">View 1</button>
<button class="fd-button fd-button--toggled" aria-pressed="true">View 2</button>
<button class="fd-button">View 3</button>
</div>
<button class="fd-button fd-button--transparent" aria-label="Filter">
<i class="sap-icon--filter" role="presentation"></i>
</button>
<button class="fd-button fd-button--transparent" aria-label="Sort">
<i class="sap-icon--sort" role="presentation"></i>
</button>
<button class="fd-button fd-button--transparent" aria-label="Group">
<i class="sap-icon--group-2" role="presentation"></i>
</button>
</div>
</div>
51 changes: 51 additions & 0 deletions packages/styles/stories/BTP/title-bar/title-bar.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import desktopExampleHtml from './desktop.example.html?raw';
import tabletExampleHtml from './tablet.example.html?raw';
import mobileExampleHtml from './mobile.example.html?raw';

import '../../../src/icon.scss';
import '../../../src/link.scss';
import '../../../src/button.scss';
import '../../../src/toolbar.scss';
import '../../../src/title-bar.scss';
import '../../../src/breadcrumb.scss';
import '../../../src/segmented-button.scss';

export default {
title: 'BTP/Title Bar',
parameters: {
description: `Title Bar is a composite control that uses a toolbar as a container and a title for labeling. It varies from the standard title control in its bold visual state and text size. In addition, the title bar comes in three variants:
- <b>Standard</b>&nbsp;- similar to the Fiori title but visually different
- <b>Title and Subtitle</b>&nbsp;- when an additional line of text is displayed below the title
- <b>Title and Info Icon</b>&nbsp;- when an additional icon is displayed right after the title
`,
tags: ['btp', 'development', 'horizon-only']
}
};
export const Desktop = () => desktopExampleHtml;
Desktop.parameters = {
docs: {
description: {
story: ``
}
}
};


export const Tablet = () => tabletExampleHtml;
Tablet.parameters = {
docs: {
description: {
story: ``
}
}
};

export const Mobile = () => mobileExampleHtml;
Mobile.parameters = {
docs: {
description: {
story: ``
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
- <code>fd-tool-header__separator</code> -&nbsp; The Separator is an optional element that adds space between the <b>Custom Actions Area</b> (optional), <b>System Actions Area</b> (optional) and <b>User Avatar</b> (required).
`,
tags: ['btp','horizon-only']
tags: ['btp', 'development', 'horizon-only']
}
};
export const Desktop = () => desktopExampleHtml;
Expand Down
Loading

0 comments on commit 8f30a88

Please sign in to comment.