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

chore: update to storybook 6 #535

Merged
merged 70 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c7b8b7f
update to storybook 6 (beta)
MarcusNotheis May 21, 2020
d5cf6cb
update button story
MarcusNotheis May 22, 2020
4ff9780
Merge branch 'master' into chore/update-storybook
MarcusNotheis May 25, 2020
3f6bf5d
update to beta.13
MarcusNotheis May 25, 2020
9af616f
update to beta.15
MarcusNotheis May 27, 2020
e0e49d1
Migrate Avatar and Badge
MarcusNotheis May 27, 2020
c362a84
Update BusyIndicator.stories.tsx
MarcusNotheis May 27, 2020
1106f34
Card and Carousel
MarcusNotheis May 27, 2020
4dcaaf1
Merge remote-tracking branch 'origin/master' into chore/update-storybook
kleinju1017 May 27, 2020
d8c3752
update to beta 17
MarcusNotheis May 28, 2020
c719521
Update storybook controls
kleinju1017 May 28, 2020
a233766
Update of all stories of webcomponents
kleinju1017 May 28, 2020
63c3bf2
Update stories of components
kleinju1017 May 28, 2020
53ff73c
Merge remote-tracking branch 'origin/master' into chore/update-storybook
MarcusNotheis May 28, 2020
9e81cd0
Merge remote-tracking branch 'origin/master' into chore/update-storybook
MarcusNotheis May 28, 2020
f2ba89e
update to beta.20
MarcusNotheis Jun 2, 2020
2c13bc8
use radio types
MarcusNotheis Jun 2, 2020
3fb7362
Update yarn.lock
kleinju1017 Jun 3, 2020
3a10589
Merge branch 'chore/update-storybook' of https://github.com/SAP/ui5-w…
kleinju1017 Jun 3, 2020
687317c
update stories of notificationGroup and objectPage
kleinju1017 Jun 3, 2020
020c593
Update demo.stories.tsx
kleinju1017 Jun 3, 2020
d4aaebf
Update all stories of chart
kleinju1017 Jun 3, 2020
4c8d150
fix(Donut Chart): typo in donut chart story
kleinju1017 Jun 3, 2020
0327f2e
move react to dependencies
MarcusNotheis Jun 3, 2020
1d894bf
Update yarn.lock
kleinju1017 Jun 4, 2020
b939646
Update tests of charts
kleinju1017 Jun 4, 2020
11faff7
Update @storybook/addon-controls": "6.0.0-beta.21"
kleinju1017 Jun 5, 2020
e66c94d
Merge branch 'master' into chore/update-storybook
kleinju1017 Jun 5, 2020
4a16e89
Update yarn.lock
kleinju1017 Jun 5, 2020
54c72db
post merge cleanup
MarcusNotheis Jun 5, 2020
181e521
Merge remote-tracking branch 'origin/master' into chore/update-storybook
MarcusNotheis Jun 5, 2020
3f501e2
Update demo.stories.tsx
MarcusNotheis Jun 5, 2020
e97f2b8
fix storybook addon-actions
MarcusNotheis Jun 8, 2020
41126b4
Combine createSelectOptions calls
MarcusNotheis Jun 8, 2020
9123f01
change root level stories
MarcusNotheis Jun 8, 2020
181d17d
update to beta.23
MarcusNotheis Jun 8, 2020
bfa36b9
Update createSelectArgTypes.ts
MarcusNotheis Jun 8, 2020
42ea91c
Merge branch 'master' into chore/update-storybook
kleinju1017 Jun 10, 2020
b802ea3
update to storybook beta.26
MarcusNotheis Jun 12, 2020
6ea34da
Merge remote-tracking branch 'origin/master' into chore/update-storybook
MarcusNotheis Jun 24, 2020
721d5e2
Update yarn.lock
MarcusNotheis Jun 24, 2020
ab16ed4
updaate storybook
MarcusNotheis Jun 24, 2020
367cc0e
fix(Pie/Donut-Chart): fix measure documentation
kleinju1017 Jun 24, 2020
9e36642
fix(Micro Bar Chart): crash in storybook docs mode
kleinju1017 Jun 24, 2020
a47ffb8
fix(Scatter Chart): migrate to new storybook API
kleinju1017 Jun 24, 2020
86f60bb
fix(Charts Stories): disable dataset in addon-controls
kleinju1017 Jun 24, 2020
1bf334c
fix(Charts): add chartConfig to args in stories
kleinju1017 Jun 24, 2020
fe937fd
fix(Charts): disable dimensions and measures in stories
kleinju1017 Jun 24, 2020
be395e7
fix(Busy Indicator): fix story: typo in argTypes
kleinju1017 Jun 24, 2020
69045ea
fix(Action Sheet / Analytical Card): disable children in addon controls
kleinju1017 Jun 24, 2020
587e63a
fix(Components): disable unnecessary addon controls
kleinju1017 Jun 25, 2020
5f46c65
fix(Webcomponents Stories): disable unnecessary addon controls
kleinju1017 Jun 25, 2020
9d010e8
fix(Form Story): add addon controls to mdx story
kleinju1017 Jun 25, 2020
461ed01
Merge branch 'master' into chore/update-storybook
kleinju1017 Jul 1, 2020
699ac0b
Update yarn.lock
kleinju1017 Jul 1, 2020
697b7f4
fix(Stories): disable unnecessary controls in stories of webcomponent…
kleinju1017 Jul 1, 2020
1af3219
fix(Web Components Stories): Added controls to Title, Timeline, Toast
kleinju1017 Jul 1, 2020
8495865
fix(Components Form): update mdx story to accept addon-controls
kleinju1017 Jul 1, 2020
0c5ebd0
fix(Components Analytical Card): disabled children, header, ref control
kleinju1017 Jul 1, 2020
db95142
fix(Webcomponents Strories): added default values to stories
kleinju1017 Jul 1, 2020
c57e751
feat(Analytical Table Story): added new mdx story of analytical table…
kleinju1017 Jul 2, 2020
6e66c48
fix(Analytical Table Story)
kleinju1017 Jul 2, 2020
9c5a462
fix(Analytical Table Story): add description
kleinju1017 Jul 2, 2020
95d32a3
feat(Analytical Table Story): remove old story and rename new story
kleinju1017 Jul 2, 2020
791805e
fix(Analytical Table Story)
kleinju1017 Jul 2, 2020
9e6d623
Merge branch 'master' into chore/update-storybook
kleinju1017 Jul 2, 2020
659e320
fix(Components Message Box Story): added button for displaying and hi…
kleinju1017 Jul 2, 2020
d894e57
update to 6.0.0-rc.0
MarcusNotheis Jul 9, 2020
f3ed5f6
minor changes
MarcusNotheis Jul 9, 2020
158bf8b
Remove deprecated methods
MarcusNotheis Jul 9, 2020
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
42 changes: 7 additions & 35 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const { highlightLog } = require('../scripts/utils');
const path = require('path');
const PATHS = require('../config/paths');
const dedent = require('dedent');
require('dotenv').config({
path: path.join(PATHS.root, '.env')
});
Expand All @@ -14,8 +12,13 @@ const DEPENDENCY_REGEX = BUILD_FOR_IE11
: /node_modules\/(@ui5\/webcomponents(-(base|core|fiori|icons|theme-base))?|lit-html)\//;

module.exports = {
stories: ['../docs/**/*.stories.mdx', '../packages/**/*.stories.mdx', '../packages/**/*.stories.[tj]sx'],
addons: ['@storybook/addon-knobs', '@storybook/addon-docs', '@storybook/addon-actions'],
stories: ['../docs/**/*.stories.mdx', '../packages/**/*.stories.mdx', '../packages/**/*.stories.@(tsx|jsx)'],
addons: [
'@storybook/addon-toolbars',
'@storybook/addon-docs',
'@storybook/addon-controls',
'@storybook/addon-actions'
],
webpack: async (config, { configType }) => {
// `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
Expand All @@ -27,35 +30,6 @@ module.exports = {
type: 'javascript/auto'
});

const tsLoader = {
test: /\.tsx?$/,
include: PATHS.packages,
use: [
{
loader: require.resolve('babel-loader'),
options: {
envName: 'esm',
configFile: path.resolve(PATHS.root, 'babel.config.js')
}
}
]
};

if (IS_RELEASE_BUILD) {
highlightLog('Warning: Prop Types Table Generation is active');
tsLoader.use.push(require.resolve('react-docgen-typescript-loader'));
} else {
highlightLog('Info: Prop Types Table Generation is disabled');
console.log(dedent`
The Prop Table Generation is very expensive during build-time and therefore disabled by default.
If you need Prop-Tables, you can activate it by adding a '.env' file to the root of the project with the following content:

UI5_WEBCOMPONENTS_FOR_REACT_RELEASE_BUILD=true\n\n
`);
}

config.module.rules.push(tsLoader);

if ((IS_RELEASE_BUILD && configType === 'PRODUCTION') || BUILD_FOR_IE11) {
config.module.rules.push({
test: /\.(js|mjs)$/,
Expand Down Expand Up @@ -102,8 +76,6 @@ module.exports = {
}
});
}

config.resolve.extensions.push('.ts', '.tsx');
config.resolve.alias = {
...config.resolve.alias,
'@shared': path.join(PATHS.root, 'shared'),
Expand Down
4 changes: 3 additions & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ addons.setConfig({
* enable/disable shortcuts
* @type {Boolean}
*/
enableShortcuts: false
enableShortcuts: false,

showRoots: true
});
91 changes: 81 additions & 10 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { select, withKnobs } from '@storybook/addon-knobs';
import { makeDecorator } from '@storybook/addons';
import { addDecorator, addParameters } from '@storybook/react';
import { setTheme } from '@ui5/webcomponents-base/dist/config/Theme';
Expand All @@ -21,13 +20,14 @@ addParameters({
return a[1].kind === b[1].kind
? 0
: a[1].id.localeCompare(b[1].id, undefined, { numeric: true, caseFirst: 'upper' });
},
showRoots: true
}
}
},
passArgsFirst: true,
viewMode: 'docs',
docs: { forceExtractedArgTypes: true },
actions: { argTypesRegex: '^on.*' }
});

addDecorator(withKnobs);

const ThemeContainer = ({ theme, contentDensity, children, direction }) => {
useEffect(() => {
if (contentDensity === ContentDensity.Compact) {
Expand All @@ -38,7 +38,7 @@ const ThemeContainer = ({ theme, contentDensity, children, direction }) => {
}, [contentDensity]);

// useEffect(() => {
// document.querySelector('html').setAttribute('dir', direction.toLowerCase());
// document.querySelector('html').setAttribute('dir', direction);
// }, [direction]);

useEffect(() => {
Expand All @@ -54,9 +54,9 @@ const withQuery = makeDecorator({
wrapper: (getStory, context) => {
return (
<ThemeContainer
theme={select('Theme', Themes, Themes.sap_fiori_3)}
contentDensity={select('ContentDensity', ContentDensity, ContentDensity.Cozy)}
direction={select('Text Direction', ['LTR', 'RTL'], 'LTR')}
theme={context.globals.theme || Themes.sap_fiori_3}
contentDensity={context.globals.contentDensity}
direction={context.globals.direction}
>
{getStory(context)}
</ThemeContainer>
Expand All @@ -65,3 +65,74 @@ const withQuery = makeDecorator({
});

addDecorator(withQuery);

export const globalArgTypes = {
theme: {
name: 'Theme',
description: 'Fiori Theme',
defaultValue: Themes.sap_fiori_3,
toolbar: {
icon: 'paintbrush',
items: [
{
value: Themes.sap_fiori_3,
title: Themes.sap_fiori_3
},
{
value: Themes.sap_fiori_3_dark,
title: Themes.sap_fiori_3_dark
},
{
value: Themes.sap_belize,
title: Themes.sap_belize
},
{
value: Themes.sap_belize_hcb,
title: Themes.sap_belize_hcb
},
{
value: Themes.sap_belize_hcw,
title: Themes.sap_belize_hcw
}
]
}
},
contentDensity: {
name: 'Content Density',
description: 'Content Density',
defaultValue: ContentDensity.Cozy,
toolbar: {
icon: 'component',
items: [
{
value: ContentDensity.Cozy,
title: ContentDensity.Cozy
},
{
value: ContentDensity.Compact,
title: ContentDensity.Compact
}
]
}
},
direction: {
name: 'Direction',
description: 'Text Direction',
defaultValue: 'ltr',
toolbar: {
icon: 'transfer',
items: [
{
value: 'ltr',
title: 'LTR',
icon: 'arrowrightalt'
},
{
value: 'rtl',
title: 'RTL',
icon: 'arrowleftalt'
}
]
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { Button } from '@ui5/webcomponents-react/lib/Button';

<Meta title="1 Welcome / Getting Started" />
<Meta title="Getting Started" />

# UI5 Web Components for React
[![](https://github.com/SAP/ui5-webcomponents-react/workflows/build/badge.svg)](https://github.com/SAP/ui5-webcomponents-react/actions?query=workflow:%22build%22)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';

<Meta title="1 Welcome / Migration Guide" />
<Meta title="Migration Guide" />

# Migration Guide
<br />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { MyCustomElement } from '../styling/MyCustomElement';
import { MyCustomElement } from './styling/MyCustomElement';
import { ThemeProvider } from '@ui5/webcomponents-react/lib/ThemeProvider';

<Meta title="1 Welcome / Style Web Components" />
<Meta title="Style Web Components" />

# How can I style my Web Components?
[Open Github Project](https://github.com/SAP/ui5-webcomponents-react)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';

<Meta title="1 Welcome / Test Setup" />
<Meta title="Test Setup" />

# Test Setup for UI5 Web Components for React

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
"lerna:version-dryrun": "lerna version --conventional-graduate --no-git-tag-version --no-push"
},
"dependencies": {
"@storybook/addon-actions": "5.3.18",
"@storybook/addon-docs": "5.3.18",
"@storybook/addon-info": "5.3.18",
"@storybook/addon-knobs": "5.3.18",
"@storybook/addons": "5.3.18",
"@storybook/cli": "5.3.18",
"@storybook/react": "5.3.18",
"@storybook/theming": "5.3.18",
"@storybook/addon-actions": "6.0.0-rc.0",
"@storybook/addon-controls": "6.0.0-rc.0",
"@storybook/addon-docs": "6.0.0-rc.0",
"@storybook/addon-knobs": "6.0.0-rc.0",
"@storybook/addon-toolbars": "6.0.0-rc.0",
"@storybook/addons": "6.0.0-rc.0",
"@storybook/cli": "6.0.0-rc.0",
"@storybook/react": "6.0.0-rc.0",
"@storybook/theming": "6.0.0-rc.0",
"@ui5/webcomponents": "1.0.0-rc.7",
"@ui5/webcomponents-fiori": "1.0.0-rc.7",
"@ui5/webcomponents-icons": "1.0.0-rc.7",
"react": "16.8.0",
"react-docgen-typescript-loader": "3.7.2",
"react-dom": "16.8.0"
},
"devDependencies": {
Expand Down
Loading