This is an automated email from the git hooks/post-receive script. New commit to branch feature/storybook in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit c5b002781c8f0065625f5e194061c22d1de4670b Author: jcouteau <couteau@codelutin.com> Date: Thu Nov 28 10:43:30 2019 +0100 Init storybook --- pollen-ui-riot-js/.storybook/addons.js | 3 +++ pollen-ui-riot-js/.storybook/config.js | 6 ++++++ pollen-ui-riot-js/.storybook/webpack.config.js | 15 +++++++++++++++ pollen-ui-riot-js/package.json | 8 +++++++- pollen-ui-riot-js/stories/LetterAvatar.stories.js | 13 +++++++++++++ pollen-ui-riot-js/stories/MultilineLabel.stories.js | 13 +++++++++++++ pollen-ui-riot-js/stories/QrCode.stories.js | 9 +++++++++ pollen-ui-riot-js/stories/Search.stories.js | 7 +++++++ 8 files changed, 73 insertions(+), 1 deletion(-) diff --git a/pollen-ui-riot-js/.storybook/addons.js b/pollen-ui-riot-js/.storybook/addons.js new file mode 100644 index 00000000..c8cd01bb --- /dev/null +++ b/pollen-ui-riot-js/.storybook/addons.js @@ -0,0 +1,3 @@ +import '@storybook/addon-actions/register'; +import '@storybook/addon-links/register'; +import '@storybook/addon-a11y/register'; \ No newline at end of file diff --git a/pollen-ui-riot-js/.storybook/config.js b/pollen-ui-riot-js/.storybook/config.js new file mode 100644 index 00000000..427ef94d --- /dev/null +++ b/pollen-ui-riot-js/.storybook/config.js @@ -0,0 +1,6 @@ +import { configure, addDecorator } from '@storybook/riot'; +import { withA11y } from '@storybook/addon-a11y'; + +// automatically import all files ending in *.stories.js +configure(require.context('../stories', true, /\.stories\.js$/), module); +addDecorator(withA11y); \ No newline at end of file diff --git a/pollen-ui-riot-js/.storybook/webpack.config.js b/pollen-ui-riot-js/.storybook/webpack.config.js new file mode 100644 index 00000000..24916270 --- /dev/null +++ b/pollen-ui-riot-js/.storybook/webpack.config.js @@ -0,0 +1,15 @@ +// Export a function. Accept the base config as the only param. +module.exports = async ({ config, mode }) => { + // `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION' + // You can change the configuration based on that. + // 'PRODUCTION' is used when building the static version of storybook. + + // Make whatever fine-grained changes you need + config.module.rules.push({ + test: /\.tag.html$/, + use: ['riot-tag-loader'], + }); + + // Return the altered config + return config; +}; \ No newline at end of file diff --git a/pollen-ui-riot-js/package.json b/pollen-ui-riot-js/package.json index b396206e..f36e172f 100644 --- a/pollen-ui-riot-js/package.json +++ b/pollen-ui-riot-js/package.json @@ -25,12 +25,18 @@ ], "scripts": { "start": "webpack-dev-server --mode development --hot --inline --host 0.0.0.0 --public ${POLLEN_UI_CONTEXT:-localhost:8080}", - "package": "webpack --config webpack.config.js --mode production" + "package": "webpack --config webpack.config.js --mode production", + "storybook": "start-storybook -p 6006", + "build-storybook": "build-storybook" }, "devDependencies": { "@babel/core": "^7.6.4", "@babel/plugin-proposal-object-rest-spread": "^7.6.2", "@babel/preset-env": "^7.6.3", + "@storybook/addon-actions": "^5.2.6", + "@storybook/addon-links": "^5.2.6", + "@storybook/addons": "^5.2.6", + "@storybook/riot": "^5.2.6", "babel-loader": "^8.0.6", "copy-webpack-plugin": "^4.5.2", "eslint": "^4.18.2", diff --git a/pollen-ui-riot-js/stories/LetterAvatar.stories.js b/pollen-ui-riot-js/stories/LetterAvatar.stories.js new file mode 100644 index 00000000..62659ed8 --- /dev/null +++ b/pollen-ui-riot-js/stories/LetterAvatar.stories.js @@ -0,0 +1,13 @@ +import { tag, mount, storiesOf, asCompiledCode } from '@storybook/riot'; + +import '../src/main/web/tag/components/LetterAvatar.tag.html'; + +export default { title: 'Letter Avatar' }; + +export const anonymous = () => mount('letteravatar',{}); + +export const anonymousRounded = () => mount('letteravatar',{rounded:true}); + +export const standard = () => mount('letteravatar',{name: 'John Doe'}); + +export const rounded = () => mount('letteravatar',{name: 'John Doe', rounded:true}); \ No newline at end of file diff --git a/pollen-ui-riot-js/stories/MultilineLabel.stories.js b/pollen-ui-riot-js/stories/MultilineLabel.stories.js new file mode 100644 index 00000000..e2649ac6 --- /dev/null +++ b/pollen-ui-riot-js/stories/MultilineLabel.stories.js @@ -0,0 +1,13 @@ +import { tag, mount, storiesOf, asCompiledCode } from '@storybook/riot'; + +import '../src/main/web/tag/components/MultiLineLabel.tag.html'; + +export default { title: 'MultiLineLabel' }; + +export const vide = () => mount('multilinelabel',{}); + +export const uneLigne = () => mount('multilinelabel',{label:'Sur une ligne'}); + +export const deuxLignes = () => mount('multilinelabel',{label: 'Sur deux lignes\nDeux lignes j\'ai dit !'}); + +export const markdown = () => mount('multilinelabel',{label: '# Avec du markdown \n Ça fait beau'}); \ No newline at end of file diff --git a/pollen-ui-riot-js/stories/QrCode.stories.js b/pollen-ui-riot-js/stories/QrCode.stories.js new file mode 100644 index 00000000..751ca2f2 --- /dev/null +++ b/pollen-ui-riot-js/stories/QrCode.stories.js @@ -0,0 +1,9 @@ +import { tag, mount, storiesOf, asCompiledCode } from '@storybook/riot'; + +import '../src/main/web/tag/QrCode.tag.html'; + +export default { title: 'QrCode' }; + +export const vide = () => mount('qrcode',{}); + +export const qrCode = () => mount('qrcode',{riotValue:'Valeur encodée'}); \ No newline at end of file diff --git a/pollen-ui-riot-js/stories/Search.stories.js b/pollen-ui-riot-js/stories/Search.stories.js new file mode 100644 index 00000000..891cff7d --- /dev/null +++ b/pollen-ui-riot-js/stories/Search.stories.js @@ -0,0 +1,7 @@ +import { tag, mount, storiesOf, asCompiledCode } from '@storybook/riot'; + +//import '../src/main/web/tag/components/Search.tag.html'; + +export default { title: 'Search' }; + +//export const search = () => mount('search',{}); \ No newline at end of file -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.