-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(styles): add BTP Tool Layout component [ci visual] (#4866)
- Loading branch information
1 parent
a83ecfa
commit 848a2d9
Showing
15 changed files
with
252 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
@import './new-settings'; | ||
@import './mixins'; | ||
|
||
$block: #{$fd-namespace}-tool-layout; | ||
|
||
.#{$block} { | ||
--fdToolLayout_Padding: 0.5rem 0.5rem 0 0.5rem; | ||
--fdToolLayout_Navigation_Container_Margin_Top: 0.5rem; | ||
--fdToolLayout_Navigation_Container_Margin_Right: 0.5rem; | ||
--fdToolLayout_Content_Container_Margin_Top: 0.5rem; | ||
--fdToolLayout_Content_Container_Border_Radius: 0.5rem 0.5rem 0 0; | ||
--fdToolLayout_Content_Container_Background: var(--sapBackgroundColor); | ||
--fdToolLayout_Content_Container_BoxShadow: var(--sapToolLayoutContent_Shadow1); | ||
|
||
@include fd-reset(); | ||
|
||
width: 100%; | ||
height: 100%; | ||
padding: var(--fdToolLayout_Padding); | ||
background: var(--fdToolLayout_Background); | ||
|
||
&__container { | ||
@include fd-reset(); | ||
|
||
@include fd-flex() { | ||
flex-wrap: wrap; | ||
} | ||
} | ||
|
||
&__header-container { | ||
@include fd-reset(); | ||
} | ||
|
||
&__navigation-container { | ||
@include fd-reset(); | ||
@include fd-set-margin-right(var(--fdToolLayout_Navigation_Container_Margin_Right)); | ||
|
||
margin-top: var(--fdToolLayout_Navigation_Container_Margin_Top); | ||
|
||
&--popup { | ||
--fdToolLayout_Navigation_Container_Margin_Top: 0; | ||
--fdToolLayout_Navigation_Container_Margin_Right: 0; | ||
} | ||
|
||
&--horizontal { | ||
--fdToolLayout_Navigation_Container_Margin_Top: 0; | ||
--fdToolLayout_Navigation_Container_Margin_Right: 0; | ||
|
||
flex: 1; | ||
min-width: 100%; | ||
|
||
& + .#{$block}__content-container { | ||
min-width: 100%; | ||
} | ||
} | ||
} | ||
|
||
&__content-container { | ||
@include fd-reset(); | ||
|
||
flex: 1; | ||
height: 100%; | ||
width: 100%; | ||
margin-top: var(--fdToolLayout_Content_Container_Margin_Top); | ||
box-shadow: var(--fdToolLayout_Content_Container_BoxShadow); | ||
background: var(--fdToolLayout_Content_Container_Background); | ||
border-radius: var(--fdToolLayout_Content_Container_Border_Radius); | ||
|
||
&--transparent { | ||
--fdToolLayout_Content_Container_Background: transparent; | ||
--fdToolLayout_Content_Container_BoxShadow: none; | ||
} | ||
|
||
&--list { | ||
--fdToolLayout_Content_Container_Background: var(--sapGroup_ContentBackground); | ||
} | ||
} | ||
|
||
&--tablet { | ||
--fdToolLayout_Padding: 0.5rem; | ||
--fdToolLayout_Content_Container_Border_Radius: 0.5rem; | ||
} | ||
|
||
&--phone { | ||
--fdToolLayout_Padding: 0.25rem; | ||
--fdToolLayout_Content_Container_Margin_Top: 0.25rem; | ||
--fdToolLayout_Content_Container_Border_Radius: 0.25rem; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/styles/stories/BTP/tool-layout/desktop.example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<div class="fd-tool-layout"> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__header-container" | ||
style="width: 100%; height: 3rem; background: #00677F;"> | ||
</div> | ||
</div> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__navigation-container" | ||
style="width: 15rem; height: 20rem; background: #00677F;"> | ||
</div> | ||
<div | ||
class="fd-tool-layout__content-container" | ||
style="width: 100%; height: 20rem; background: #00677F;"></div> | ||
</div> | ||
</div> | ||
|
13 changes: 13 additions & 0 deletions
13
packages/styles/stories/BTP/tool-layout/mobile.example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<div class="fd-tool-layout fd-tool-layout--phone" style="width: 20rem;"> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__header-container" | ||
style="width: 100%; height: 3rem; background: #00677F;"> | ||
</div> | ||
</div> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__content-container" | ||
style="width: 100%; height: 20rem; background: #00677F;"></div> | ||
</div> | ||
</div> |
37 changes: 37 additions & 0 deletions
37
packages/styles/stories/BTP/tool-layout/tablet.example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<h4>With Vertical Navigation</h4> | ||
<div class="fd-tool-layout fd-tool-layout--tablet"> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__header-container" | ||
style="width: 100%; height: 3rem; background: #00677F;"> | ||
</div> | ||
</div> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__navigation-container" | ||
style="width: 5rem; height: 20rem; background: #00677F;"> | ||
</div> | ||
<div | ||
class="fd-tool-layout__content-container" | ||
style="width: 100%; height: 20rem; background: #00677F;"></div> | ||
</div> | ||
</div> | ||
<br><br> | ||
<h4>With Horizontal Navigation</h4> | ||
<div class="fd-tool-layout fd-tool-layout--tablet"> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__header-container" | ||
style="width: 100%; height: 3rem; background: #00677F;"> | ||
</div> | ||
</div> | ||
<div class="fd-tool-layout__container"> | ||
<div | ||
class="fd-tool-layout__navigation-container fd-tool-layout__navigation-container--horizontal" | ||
style="width: 100%; height: 3rem; background: #00677F;"> | ||
</div> | ||
<div | ||
class="fd-tool-layout__content-container" | ||
style="width: 100%; height: 20rem; background: #00677F;"></div> | ||
</div> | ||
</div> |
58 changes: 58 additions & 0 deletions
58
packages/styles/stories/BTP/tool-layout/tool-layout.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import desktopExampleHtml from './desktop.example.html?raw'; | ||
import tabletExampleHtml from './tablet.example.html?raw'; | ||
import mobileExampleHtml from './mobile.example.html?raw'; | ||
|
||
import '../../../src/tool-layout.scss'; | ||
|
||
export default { | ||
title: 'BTP/Tool Layout', | ||
parameters: { | ||
description: `The Tool Layout is an essential part of most BTP tools. The layout combines the Tool Header and the Navigation components in one consistent structure. In addition, it provides necessary interaction between the two components out of the box. | ||
## Anatomy | ||
- <b>Tool Header </b>- always present and is a top-aligned UI element that contains global actions and controls navigation | ||
- <b>Navigation </b>- side navigation in all of its variants (expanded, snapped) | ||
- <b>Content </b>- an empty container area that can hold any content. | ||
## Structure | ||
- <code>.fd-tool-layout</code> | ||
- <code>.fd-tool-layout--tablet</code> - modifier class for tablets | ||
- <code>.fd-tool-layout--phone</code> - modifier class for phones | ||
- <code>.fd-tool-layout__container</code> | ||
- <code>.fd-tool-layout__header-container</code> - wraping element around the Tool Header | ||
- <code>.fd-tool-layout__header-container--popup</code> - modifier class for when the Tool Header is a Popup | ||
- <code>.fd-tool-layout__header-container--horizontal</code> - modifier class for when the Tool Header is horizontal | ||
- <code>.fd-tool-layout__navigation-container</code> - wraping element around the Navigation (all its variants) | ||
- <code>.fd-tool-layout__content-container</code> - wraping element around the page content. By default, the background of the content area is <code>var(--sapBackgroundColor)</code> | ||
- <code>.fd-tool-layout__content-container--transparent</code> - modifier class to apply transparent background to the content area. | ||
- <code>.fd-tool-layout__content-container--list</code> - modifier class to apply list <code>var(--sapGroup_ContentBackground)</code> background to the content area. | ||
`, | ||
tags: ['btp'] | ||
} | ||
}; | ||
export const Desktop = () => desktopExampleHtml; | ||
Desktop.parameters = { | ||
docs: { | ||
description: { | ||
story: `` | ||
} | ||
} | ||
}; | ||
|
||
|
||
export const Tablet = () => tabletExampleHtml; | ||
Tablet.parameters = { | ||
docs: { | ||
description: { | ||
story: `Apply the <code>fd-tool-layout--tablet</code> modifier class for tablet devices.` | ||
} | ||
} | ||
}; | ||
|
||
export const Mobile = () => mobileExampleHtml; | ||
Mobile.parameters = { | ||
docs: { | ||
description: { | ||
story: `Apply the <code>fd-tool-layout--phone</code> modifier class for mobile devices.` | ||
} | ||
} | ||
}; |