-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstyleguide.config.js
38 lines (37 loc) · 1023 Bytes
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const path = require('path');
const docgenTypeScript = require('react-docgen-typescript');
module.exports = {
title: 'Stack Styled: stacking layouts for React',
sections: [
{
content: path.join(__dirname, 'styleguide/Intro.md'),
},
{
components: 'src/*.tsx',
},
],
require: [path.join(__dirname, 'styleguide/styleguide.tsx')],
getComponentPathLine: () => `import Stack from 'stack-styled'`,
ribbon: {
url: 'https://github.com/sapegin/stack-styled',
},
showSidebar: false,
styleguideDir: path.join(__dirname, 'styleguide-build'),
propsParser: docgenTypeScript.withCustomConfig(
path.join(__dirname, 'tsconfig.json'),
{
propFilter(prop) {
if (prop.parent) {
return (
!prop.parent.fileName.includes('node_modules') ||
prop.parent.fileName.includes('@types/styled-system')
);
}
return true;
},
componentNameResolver: (exp, source) =>
exp.getName() === 'StyledComponentClass' &&
docgenTypeScript.getDefaultExportForFile(source),
}
).parse,
};