Skip to content

Commit 38df93b

Browse files
authored
docs: add table of content to stories (#944)
1 parent ab8d09a commit 38df93b

File tree

75 files changed

+662
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+662
-135
lines changed

.storybook/preview-head.html

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
<style>
2-
body {
3-
font-family: var(--sapFontFamily);
4-
background-color: var(--sapBackgroundColor);
5-
}
2+
body {
3+
font-family: var(--sapFontFamily);
4+
background-color: var(--sapBackgroundColor);
5+
}
66

7-
.pageWithPadding > section {
8-
padding: 1rem;
9-
}
7+
.pageWithPadding > section {
8+
padding: 1rem;
9+
}
1010

11-
.sbdocs-title {
12-
font-family: var(--sapFontFamily) !important;
11+
@media (min-width: 1330px) and (max-width: 1520px) {
12+
.sbdocs-wrapper {
13+
justify-content: flex-start !important;
1314
}
15+
}
1416

15-
.sbdocs-content {
16-
max-width: 1400px !important;
17-
}
17+
.sbdocs-title {
18+
font-family: var(--sapFontFamily) !important;
19+
}
20+
21+
.sbdocs-content {
22+
max-width: 1100px !important;
23+
}
1824
</style>
25+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.11.1/tocbot.css" />
1926
<script data-ui5-config type="application/json">
20-
{
21-
"theme": "sap_fiori_3"
22-
}
27+
{
28+
"theme": "sap_fiori_3"
29+
}
2330
</script>
24-

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"@ui5/webcomponents-icons": "1.0.0-rc.9",
3636
"react": "17.0.1",
3737
"react-dom": "17.0.1",
38-
"react-syntax-highlighter": "^15.2.1"
38+
"react-syntax-highlighter": "^15.2.1",
39+
"tocbot": "^4.12.0"
3940
},
4041
"devDependencies": {
4142
"@babel/core": "^7.12.3",

packages/charts/src/components/MicroBarChart/MicroBarChart.stories.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ import { DocsHeader } from '@shared/stories/DocsHeader';
3434

3535
<DocsHeader />
3636

37+
<br />
38+
39+
## Example
40+
3741
<Canvas>
3842
<Story name="Default">
3943
{(args) => (
@@ -52,6 +56,8 @@ import { DocsHeader } from '@shared/stories/DocsHeader';
5256
</Story>
5357
</Canvas>
5458

59+
## Properties
60+
5561
<ArgsTable story="." />
5662

5763
<Canvas>

packages/main/scripts/create-web-components-wrapper.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ const createWebComponentDemo = (componentSpec, componentProps, description) => {
589589
/>
590590
591591
<DocsHeader />
592+
593+
<br />
594+
595+
## Example
592596
593597
<Canvas>
594598
<Story name="Default">
@@ -599,7 +603,9 @@ const createWebComponentDemo = (componentSpec, componentProps, description) => {
599603
}}
600604
</Story>
601605
</Canvas>
602-
606+
607+
## Properties
608+
603609
<ArgsTable story="." />
604610
605611
`,

packages/main/src/components/ActionSheet/ActionSheet.stories.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { PopoverHorizontalAlign } from '@ui5/webcomponents-react/lib/PopoverHori
77
import { PopoverVerticalAlign } from '@ui5/webcomponents-react/lib/PopoverVerticalAlign';
88
import { useCallback, useRef } from 'react';
99
import { DocsHeader } from '@shared/stories/DocsHeader';
10+
import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
1011

1112
<Meta
1213
title="Components / ActionSheet"
@@ -26,9 +27,7 @@ import { DocsHeader } from '@shared/stories/DocsHeader';
2627
header: {
2728
type: null
2829
},
29-
ref: {
30-
type: null
31-
}
30+
...DocsCommonProps
3231
}}
3332
args={{
3433
horizontalAlign: PopoverHorizontalAlign.Center,
@@ -64,6 +63,10 @@ const ActionSheetComponent = () => {
6463
};
6564
```
6665

66+
<br />
67+
68+
## Example
69+
6770
<Canvas>
6871
<Story name="Default">
6972
{(args) => {
@@ -88,9 +91,11 @@ const ActionSheetComponent = () => {
8891
</Story>
8992
</Canvas>
9093

94+
## Properties
95+
9196
<ArgsTable story="." />
9297

93-
### Using ActionSheets inside other components
98+
## Using ActionSheets inside other components
9499

95100
`ActionSheets` are often used within other components, when opened this could sometimes have unwanted side effects.
96101
In this case, we recommend using [createPortal](https://reactjs.org/docs/portals.html) to mount the `ActionSheet` outside of the DOM hierarchy of the parent component.

packages/main/src/components/AnalyticalCard/AnalyticalCard.stories.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
3030

3131
**Note:** The `AnalyticalCard` was mainly made to display KPIs and complex data. If you want to implement a simple card, the `Card` component probably is more suitable.
3232

33+
<br />
34+
35+
## Example
36+
3337
<Canvas>
3438
<Story name="Default">
3539
{(args) => {
@@ -88,6 +92,8 @@ import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
8892
</Story>
8993
</Canvas>
9094

95+
## Properties
96+
9197
<ArgsTable story="Default" />
9298

9399
<br />

packages/main/src/components/AnalyticalTable/AnalyticalTable.stories.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,16 @@ import { useEffect, useRef, useState } from 'react';
125125

126126
<DocsHeader />
127127

128+
<br />
129+
130+
## Example
131+
128132
<Canvas>
129133
<Story name="Default">{(args) => <AnalyticalTable {...args} />}</Story>
130134
</Canvas>
131135

136+
## Properties
137+
132138
<ArgsTable story="." />
133139

134140
## Column Properties

packages/main/src/components/Bar/Bar.stories.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ import { GitHubLogo } from '../../../../../shared/stories/GitHub-Mark';
3131

3232
<DocsHeader />
3333

34+
<br />
35+
36+
## Example
37+
3438
<Canvas>
3539
<Story name="Default">
3640
{(args) => {
@@ -39,6 +43,8 @@ import { GitHubLogo } from '../../../../../shared/stories/GitHub-Mark';
3943
</Story>
4044
</Canvas>
4145

46+
## Properties
47+
4248
<ArgsTable story="." />
4349

4450
<br />

packages/main/src/components/Breadcrumbs/Breadcrumbs.stories.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
2727

2828
<DocsHeader />
2929

30+
<br />
31+
32+
## Example
33+
3034
<Canvas>
3135
<Story name="Default">
3236
{(args) => {
@@ -42,4 +46,6 @@ import { DocsCommonProps } from '@shared/stories/DocsCommonProps';
4246
</Story>
4347
</Canvas>
4448

49+
## Properties
50+
4551
<ArgsTable story="." />

packages/main/src/components/DynamicPage/DynamicPage.stories.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ import { useState } from 'react';
4848

4949
<DocsHeader />
5050

51+
<br />
52+
53+
## Example
54+
5155
<Canvas>
5256
<Story name="Default">
5357
{(args) => (
@@ -108,11 +112,13 @@ import { useState } from 'react';
108112
</Story>
109113
</Canvas>
110114

115+
## Properties
116+
111117
<ArgsTable story="." />
112118

113-
## Stories
119+
# Stories
114120

115-
### Always show Header Content
121+
## Always show Header Content
116122

117123
<Canvas>
118124
<Story name="Always show header content">
@@ -177,7 +183,7 @@ import { useState } from 'react';
177183
</Story>
178184
</Canvas>
179185

180-
### Variant Management as Title
186+
## Variant Management as Title
181187

182188
<Canvas>
183189
<Story name="With Variants">

0 commit comments

Comments
 (0)