Skip to content

Commit

Permalink
Merge 1c4f15a into 511005c
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond committed Mar 15, 2024
2 parents 511005c + 1c4f15a commit c6270bd
Show file tree
Hide file tree
Showing 8 changed files with 4,239 additions and 3,791 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ Thumbs.db

# Storybook
/stories/auto
*storybook.log
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
31 changes: 21 additions & 10 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
// Note: addon-measure is forced to false in order to avoid it enabled in ZeroHeight
/** @type { import('@storybook/html-vite').StorybookConfig } */
const config = {
"stories": ["../stories/**/*.stories.@(js|jsx|ts|tsx)"],
"addons": ["@storybook/addon-a11y", {
name: "@storybook/addon-essentials",
options: {
measure: false
}
}, "@storybook/addon-themes", "@storybook/preset-scss"],
"framework": "@storybook/html-webpack5",
stories: [
"../stories/**/*.mdx",
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)",
],
addons: [
"@storybook/addon-a11y",
{
name: "@storybook/addon-essentials",
options: {
measure: false, // Note: addon-measure is forced to false in order to avoid it enabled in ZeroHeight
}
},
"@storybook/addon-themes",
],
framework: {
name: "@storybook/html-vite",
options: {},
},
docs: {
autodocs: true
autodocs: true,
defaultName: 'Docs',
}
};
export default config;
2 changes: 1 addition & 1 deletion .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import OrangeTheme from 'ods-storybook-theme/OrangeTheme.js';

addons.setConfig({
Expand Down
22 changes: 5 additions & 17 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,14 @@
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import { withThemeByDataAttribute } from '@storybook/addon-themes';
import './storybook.scss';
import prettier from 'prettier/esm/standalone';
import htmlParser from 'prettier/esm/parser-html';

export const preview = {
/** @type { import('@storybook/html').Preview } */
const preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
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;
}
},
},
decorators: [
Expand All @@ -34,5 +21,6 @@ export const preview = {
attributeName: 'data-bs-theme',
}),
]
}
};

export default preview;
Loading

0 comments on commit c6270bd

Please sign in to comment.