Files
cunningham/packages/react/.storybook/preview.js
Nathan Vasse c032e2e951 (react) publish storybook to github pages
In order to make the storybook visible to everyone. Some changes
had to be made to make index.scss compiled with the rest of the
codebase, it had to be imported from preview.js, not directly from
preview.html.
2023-01-20 17:26:06 +01:00

26 lines
614 B
JavaScript

import '../src/index.scss'
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: (a, b) => {
const roots = ['Getting Started', 'Components'];
const aParts = a.title.split('/');
const bParts = b.title.split('/');
if (aParts[0] !== bParts[0]) {
return roots.indexOf(aParts[0]) - roots.indexOf(bParts[0]);
}
if (aParts[1] !== bParts[1]) {
return aParts[1].localeCompare(bParts[1]);
}
return 0;
}
}
}