forked from hypeserver/react-date-range
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
124 lines (121 loc) · 2.97 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
const path = require('path');
const isDEV = process.env.NODE_ENV === 'development';
const moduleSource = isDEV ? 'src' : 'src';
module.exports = {
//ignore: ['**/*.test.js', '**/DateInput/*', '**/DayCell/*', '**/Month/*', '**/InputRangeField/*'],
title: 'react-date-range',
showSidebar: false,
template: {
head: {
links: [
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css?family=Open+Sans:300,400',
},
{
rel: 'stylesheet',
href: './dist/styles.css',
},
{
rel: 'stylesheet',
href: './dist/theme/default.css',
},
{
rel: 'stylesheet',
href: './demo/styles.css',
},
],
},
},
theme: {
baseBackground: '#fdfdfc',
link: '#274e75',
linkHover: '#90a7bf',
border: '#e0d2de',
font: ['Open Sans'],
fontFamily: {
base: '"Open Sans", "Helvetica", sans-serif',
},
},
getComponentPathLine(componentPath) {
const arr = componentPath.split('/');
const name = arr[arr.length - 2];
return `import { ${name} } from 'react-date-range';`;
},
styles: function styles(theme) {
return {
Playground: {
preview: {
paddingLeft: 0,
paddingRight: 0,
borderWidth: [[0, 0, 1, 0]],
borderRadius: 0,
},
},
Code: {
code: {
// make inline code example appear the same color as links
color: theme.color.link,
fontSize: 14,
},
},
};
},
// Override Styleguidist components
styleguideComponents: {
LogoRenderer: path.join(__dirname, 'demo/components/Logo'),
StyleGuideRenderer: path.join(__dirname, 'demo/components/StyleGuide'),
SectionsRenderer: path.join(__dirname, 'demo/components/SectionsRenderer'),
},
moduleAliases: {
'react-date-range/dist': path.resolve(__dirname, moduleSource),
'react-date-range': path.resolve(__dirname, moduleSource),
},
webpackConfig: {
module: {
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?modules',
},
{
test: /\.svg$/,
loader: 'url-loader',
},
],
},
},
pagePerSection: false,
sections: [
{
name: 'Getting Started',
content: 'demo/README.md',
sectionDepth: 0,
},
{
name: 'Components',
sections: [
{
components: () => ['src/components/DateRangePicker/index.js'],
usageMode: 'hide',
},
{
components: () => ['src/components/DateRange/index.js'],
usageMode: 'hide',
},
{
components: () => ['src/components/Calendar/index.js'],
},
{
components: () => ['src/components/DefinedRange/index.js'],
},
],
sectionDepth: 0,
},
],
};