-
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.
fix(common-css): add busy-indicator, title, text
- Loading branch information
Showing
21 changed files
with
554 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@import 'common-settings'; | ||
@import 'common-mixins'; | ||
|
||
$block: #{$sap-namespace}-text; | ||
|
||
.#{$block} { | ||
@include sap-reset(); | ||
|
||
// &::selection { //todo bring delta theming | ||
// color: var(--sapContent_ContrastTextColor); | ||
// background-color: var(--fdText_Selected_Background_Color); | ||
// } | ||
|
||
&--max-lines { | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
} | ||
|
||
&--pre-wrap { | ||
white-space: pre-wrap; | ||
} | ||
|
||
&--hyphenation { | ||
hyphens: auto; | ||
} | ||
} |
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,45 @@ | ||
@import 'common-settings'; | ||
@import 'common-mixins'; | ||
|
||
$block: #{$sap-namespace}-title; | ||
|
||
.#{$block} { | ||
@include sap-reset(); | ||
|
||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
font-size: 1rem; | ||
color: var(--sapTextColor); | ||
font-family: var(--sapFontHeaderFamily); | ||
|
||
&--h1 { | ||
font-size: var(--sapFontHeader1Size); | ||
} | ||
|
||
&--h2 { | ||
font-size: var(--sapFontHeader2Size); | ||
} | ||
|
||
&--h3 { | ||
font-size: var(--sapFontHeader3Size); | ||
} | ||
|
||
&--h4 { | ||
font-size: var(--sapFontHeader4Size); | ||
} | ||
|
||
&--h5 { | ||
font-size: var(--sapFontHeader5Size); | ||
} | ||
|
||
&--h6 { | ||
font-size: var(--sapFontHeader6Size); | ||
} | ||
|
||
&--wrap { | ||
overflow: auto; | ||
white-space: normal; | ||
text-overflow: initial; | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
packages/common-css/stories/busy-indicator/busy-indicator.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,83 @@ | ||
import desktopExampleHtml from "./desktop.example.html?raw"; | ||
import extendedBusyIndicatorInsideMessageToastExampleHtml from "./extended-busy-indicator-inside-message-toast.example.html?raw"; | ||
import extendedBusyIndicatorExampleHtml from "./extended-busy-indicator.example.html?raw"; | ||
import contrastModeExampleHtml from "./contrast-mode.example.html?raw"; | ||
import standardExampleHtml from "./standard.example.html?raw"; | ||
|
||
import '../../src/sap-busy-indicator.scss'; | ||
import '../../../styles/src/message-toast.scss'; | ||
import '../../../styles/src/dialog.scss'; | ||
import '../../../styles/src/text.scss'; | ||
import '../../../styles/src/bar.scss'; | ||
import '../../../styles/src/button.scss'; | ||
import '../../../styles/src/title.scss'; | ||
export default { | ||
title: 'Busy Indicator', | ||
parameters: { | ||
description: `The busy indicator component informs the user about an ongoing operation. Only one busy indicator should be shown at a time. | ||
## Sizes | ||
| **Size** | **rem** | **Modifier class** | | ||
| :------- | :-------------------------------- | -----------------: | | ||
| Default | 0.5 rem | none | | ||
| M | 1 rem | \`--m\` | | ||
| L | 2 rem | \`--l\` | | ||
##Usage | ||
**Use the busy indicator if:** | ||
The ongoing operation only covers part of a screen that has multiple controls, and: | ||
- You need to display additional information, or | ||
- The user needs to be able to cancel the operation. | ||
**Do not use the busy indicator if:** | ||
- The operation takes less than one second. | ||
- You need to block the screen because the user is not supposed to start another operation. In this case, use the **Busy Dialog** component. | ||
`, | ||
tags: ['f3', 'a11y', 'theme'] | ||
} | ||
}; | ||
export const Standard = () => standardExampleHtml; | ||
Standard.parameters = { | ||
docs: { | ||
description: { | ||
story: 'The standard busy indicator animates a sequence of cascading dots expanding and shrinking in a loop. The component comes in three sizes detailed above. To display the busy indicator, use the `sap-busy-indicator` class. If you want to display a certain size, add the modifier class of the desired size i.e. `--m` to the element.' | ||
} | ||
} | ||
}; | ||
export const ContrastMode = () => contrastModeExampleHtml; | ||
ContrastMode.parameters = { | ||
docs: { | ||
description: { | ||
story: 'The busy indicator also comes in contrast mode and displays white dots against a dark background. To apply contrast mode, add `contrast` into the element i.e. `sap-busy-indicator--m contrast`.' | ||
} | ||
} | ||
}; | ||
export const ExtendedBusyIndicator = () => extendedBusyIndicatorExampleHtml; | ||
ExtendedBusyIndicator.parameters = { | ||
docs: { | ||
description: { | ||
story: 'If more information needs to be displayed with the loading animation, it is replaced by the Extended Busy Indicator `sap-busy-indicator-extended`. The additional information is wrapped in an element with `sap-busy-indicator-extended__label` class.' | ||
} | ||
} | ||
}; | ||
export const ExtendedBusyIndicatorInsideMessageToast = () => extendedBusyIndicatorInsideMessageToastExampleHtml; | ||
ExtendedBusyIndicatorInsideMessageToast.parameters = { | ||
docs: { | ||
description: { | ||
story: 'At the Page level the Busy Indicator should always be placed in a container. The simplest form of container will be centred on the page and inherit the color values from Message Toast.' | ||
} | ||
} | ||
}; | ||
export const BusyDialog = () => desktopExampleHtml; | ||
BusyDialog.parameters = { | ||
docs: { | ||
description: { | ||
story: 'The busy dialog informs the user about an ongoing operation. During the operation, the entire screen is blocked.' | ||
} | ||
} | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/common-css/stories/busy-indicator/contrast-mode.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,7 @@ | ||
<div style="display:flex;justify-content:center;flex-direction:column;align-items:center;background-color:cadetblue;height:250px"> | ||
<div class="sap-busy-indicator sap-busy-indicator--l sap-busy-indicator--contrast" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div> | ||
</div> |
39 changes: 32 additions & 7 deletions
39
packages/common-css/stories/busy-indicator/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 |
---|---|---|
@@ -1,8 +1,33 @@ | ||
<div class="fd-busy-indicator-dialog"> | ||
<p > | ||
... now loading data from a far far away server from far far away.(needs separate styling) | ||
</p> | ||
<div class="fd-busy-indicator " aria-hidden="false" aria-label="Loading"> | ||
Busy Indicator Component | ||
<section class="fd-dialog-docs-static fd-dialog fd-dialog--active"> | ||
<div class="fd-dialog__content fd-dialog__content--s" role="dialog" aria-modal="true" | ||
aria-labelledby="dialog-title-2"> | ||
<header class="fd-dialog__header fd-bar fd-bar--header"> | ||
<div class="fd-bar__left"> | ||
<div class="fd-bar__element"> | ||
<h2 class="fd-title fd-title--h5" id="dialog-title-2"> | ||
Loading Data | ||
</h2> | ||
</div> | ||
</div> | ||
</header> | ||
<div class="fd-dialog__body"> | ||
<div class="sap-busy-indicator-dialog"> | ||
<p class="sap-text"> | ||
... now loading data from a far far away server from far far away. | ||
</p> | ||
<div class="sap-busy-indicator sap-busy-indicator--l" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<footer class="fd-dialog__footer fd-bar fd-bar--footer"> | ||
<div class="fd-bar__right"> | ||
<div class="fd-bar__element"> | ||
<button class="fd-dialog__decisive-button fd-button fd-button--transparent">Cancel</button> | ||
</div> | ||
</div> | ||
</footer> | ||
</div> | ||
</div> | ||
</section> |
9 changes: 9 additions & 0 deletions
9
...mmon-css/stories/busy-indicator/extended-busy-indicator-inside-message-toast.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,9 @@ | ||
|
||
<div class="fd-message-toast sap-busy-indicator-extended sap-busy-indicator-extended--message-toast"> | ||
<div class="sap-busy-indicator sap-busy-indicator--l" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div> | ||
<div class="sap-busy-indicator-extended__label">loading data...</div> | ||
</div> |
8 changes: 8 additions & 0 deletions
8
packages/common-css/stories/busy-indicator/extended-busy-indicator.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,8 @@ | ||
<div class="sap-busy-indicator-extended"> | ||
<div class="sap-busy-indicator sap-busy-indicator--l" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div> | ||
<div class="sap-busy-indicator-extended__label">loading data...</div> | ||
</div> |
17 changes: 17 additions & 0 deletions
17
packages/common-css/stories/busy-indicator/standard.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,17 @@ | ||
<div style="text-align: center"> | ||
<div class="sap-busy-indicator sap-busy-indicator--l" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div><br /><br /> | ||
<div class="sap-busy-indicator sap-busy-indicator--m" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div><br /><br /> | ||
<div class="sap-busy-indicator" aria-hidden="false" aria-label="Loading"> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
<div class="sap-busy-indicator__circle"></div> | ||
</div> | ||
</div> |
21 changes: 0 additions & 21 deletions
21
packages/common-css/stories/busy-indicator/tool-layout.stories.js
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
packages/common-css/stories/text/default-example.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,6 @@ | ||
<p class="sap-text"> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | ||
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore | ||
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia | ||
deserunt mollit anim id est laborum.</p> |
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,19 @@ | ||
<div class="example-container"> | ||
<div class="fddocs-text"> | ||
<h3>Without hyphenation</h3> | ||
<p class="sap-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | ||
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut | ||
aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore | ||
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia | ||
deserunt mollit anim id est laborum.</p> | ||
</div> | ||
|
||
<div class="fddocs-text"> | ||
<h3>Hyphenation</h3> | ||
<p class="sap-text sap-text--hyphenation">Lorem ipsum dolor sit amet, con­sectetur adip­iscing el­it, sed do eiusmod tempor | ||
incididunt ut labore et do­lore magna aliqua. Ut enim ad mi­nim veniam, quis nostrud exer­citation ullamco laboris nisi ut | ||
aliquip ex ea commodo conse­quat. Duis aute irure dolor in repre­henderit in vo­luptate velit esse cillum dolore | ||
eu fu­giat nulla pari­atur. Excepteur sint occaecat cupidatat non pro­ident, sunt in culpa qui officia | ||
deserunt mollit anim id est la­bo­rum.</p> | ||
</div> | ||
</div> |
Oops, something went wrong.