Skip to content

Commit

Permalink
Add Storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Aug 25, 2022
1 parent 6139e24 commit e33ea41
Show file tree
Hide file tree
Showing 11 changed files with 38,302 additions and 12,987 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/_site/
/js/coverage/
/site/static/sw.js
/site/storybook/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ Thumbs.db
/.pa11y/
/pa11y-ci-results.json
/.github/release-drafter.yml

# Storybook
/stories/auto
/site/storybook
20 changes: 20 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Note: addon-measure is forced to false in order to avoid it enabled in ZeroHeight
module.exports = {
"stories": [
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|ts|tsx)"
],
"addons": [
"@storybook/addon-a11y",
"@storybook/addon-links",
{
name: "@storybook/addon-essentials",
options: {
measure: false
}
},
"@storybook/addon-interactions",
"@storybook/preset-scss"
],
"framework": "@storybook/html"
}
6 changes: 6 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/addons';
import OrangeTheme from 'ods-storybook-theme/OrangeTheme.js';

addons.setConfig({
theme: OrangeTheme,
});
19 changes: 19 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

<!-- Preconnect to CDN: remove if not needed -->
<link href="https://cdn.jsdelivr.net" rel="preconnect" crossorigin="anonymous">

<!--
Neue Helvetica is a trademark of Monotype Imaging Inc. registered in the U.S.
Patent and Trademark Office and may be registered in certain other jurisdictions.
Copyright © 2014 Monotype Imaging Inc. All rights reserved.
Orange has purchased the right to use Helvetica in its websites and mobile applications.
If you are not autorized to used it, don't include the orangeHelvetica.css
See NOTICE.txt for more informations.
-->
<link href="https://cdn.jsdelivr.net/npm/boosted@5/dist/fonts/HelvNeue55_W1G.woff2" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/boosted@5/dist/fonts/HelvNeue75_W1G.woff2" rel="preload" as="font" type="font/woff2" crossorigin="anonymous">
<!-- Copyright © 2014 Monotype Imaging Inc. All rights reserved -->
<link href="https://cdn.jsdelivr.net/npm/boosted@5/dist/css/orange-helvetica.min.css" rel="stylesheet" crossorigin="anonymous">

<!-- Boosted CSS -->
<link href="https://cdn.jsdelivr.net/npm/boosted@5/dist/css/boosted.min.css" rel="stylesheet" crossorigin="anonymous">
24 changes: 24 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import './storybook.scss';
import prettier from 'prettier/esm/standalone';
import htmlParser from 'prettier/esm/parser-html';

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
expanded: true
},
viewport: { viewports: INITIAL_VIEWPORTS },
docs: {
transformSource: (src) => {
// Remove `() => `` from stories
const match = /^\(\) => [`'"](.*)['`"]$/sm.exec(src);
// Pretty print the Docs code source
return match ? prettier.format(match[1].trim(), {printWidth: 120, parser: "html", plugins: [htmlParser]}) : src;
}
}
}
7 changes: 7 additions & 0 deletions .storybook/storybook.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pre.prismjs {
color: #fff;

code {
font-size: 0.8rem;
}
}
2 changes: 2 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module:
target: assets/js/vendor/tarteaucitron.js
- source: node_modules/tarteaucitronjs/lang
target: static/docs/5.2/assets/js/lang
- source: site/storybook
target: static/storybook

params:
subtitle: "Orange Boosted with Bootstrap is a Bootstrap based, Orange branded accessible and ergonomic components library…"
Expand Down
Loading

0 comments on commit e33ea41

Please sign in to comment.