forked from britecharts/britecharts-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
styleguide.config.js
165 lines (150 loc) · 6.94 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
const path = require('path');
const MiniHtmlWebpackPlugin = require('mini-html-webpack-plugin')
const resolve = (searchPath) => path.join(__dirname, searchPath);
// Themes
// Check options in https://github.com/styleguidist/react-styleguidist/blob/master/src/styles/theme.js
module.exports = {
title: 'Britecharts React - React charting library based in Britecharts',
theme: {
sidebarWidth: 262,
color: {
base: '#333',
light: '#999',
lightest: '#ccc',
link: '#F6682f',
linkHover: '#BF4C28',
border: '#e8e8e8',
name: '#FFA71A',
type: '#b77daa',
error: '#fff',
baseBackground: '#fff',
errorBackground: '#c00',
codeBackground: '#f5f5f5',
sidebarBackground: '#45494E',
},
fontFamily: {
base: '"Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif',
},
},
styleguideComponents: {
Logo: resolve('src/docs/styleguide/Logo'),
},
components: 'src/charts/**/[A-Z]*.js',
require: [
resolve('node_modules/britecharts/dist/css/britecharts.min.css'),
resolve('src/docs/styles/custom.css'),
],
assetsDir: resolve('src/docs/public'),
template: {
head: {
meta: [
{ name: 'description', content: 'Britecharts-react is a React wrapper for the Britecharts charting library.' },
{ name: 'keywords', content: 'React, Britecharts, D3, D3.js, Charts' },
{ name: 'msapplication-tap-highlight', content: 'no' },
{ name: 'msapplication-config', content: 'icons/browserconfig.xml' },
{ name: 'mobile-web-app-capable', content: 'yes' },
{ name: 'application-name', content: 'Britecharts React' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-status-bar-style', content: '#009FA1' },
{ name: 'apple-mobile-web-app-title', content: 'Britecharts' },
{ name: 'theme-color', content: '#45494e' },
{ itemprop: 'name', content: 'Britecharts React' },
{ itemprop: 'description', content: 'Britecharts-react is a React wrapper for the Britecharts charting library.' },
{ itemprop: 'image', content: 'https://eventbrite.github.io/britecharts-react/images/logo-light.png' },
{ property: 'og:title', content: 'Britecharts React' },
{ property: 'og:type', content: 'website' },
{ property: 'og:image', content: 'https://eventbrite.github.io/britecharts-react/images/logo-light.png' },
{ property: 'og:url', content: 'https://eventbrite.github.io/britecharts-react/' },
{ property: 'og:description', content: 'Britecharts-react is a React wrapper for the Britecharts charting library.' },
{ name: 'twitter:title', content: 'Britecharts React' },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:site', content: '@britecharts' },
{ name: 'twitter:description', content: 'Britecharts-react is a React wrapper for the Britecharts charting library.' },
{ name: 'twitter:image', content: 'https://eventbrite.github.io/britecharts-react/images/logo-light.png' },
],
links: [
{ rel: 'manifest', href: 'icons/manifest.json' },
{ rel: 'apple-touch-icon', sizes: '180x180', href: 'icons/apple-touch-icon.png' },
{ rel: 'mask-icon', href: 'icons/safari-pinned-tab.svg', color: '#5bbad5' },
{ rel: 'shortcut icon', href: 'icons/favicon.ico' },
{ rel: 'icon', type: 'image/png', sizes: '32x32', href: 'icons/favicon-32x32.png' },
{ rel: 'icon', type: 'image/png', sizes: '16x16', href: 'icons/favicon-16x16.png' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Rubik:300,400' },
],
raw: `
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
`
},
body: {
raw: [
`
<a class="ribbon" href="https://github.com/eventbrite/britecharts-react" title="Check this project in github">
<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 250 250" fill="#fff" style="position: absolute; top: 0; right: 0">
<path d="M0 0l115 115h15l12 27 108 108V0z" fill="#000"/>
<path class="octo-arm" d="M128 109c-15-9-9-19-9-19 3-7 2-11 2-11-1-7 3-2 3-2 4 5 2 11 2 11-3 10 5 15 9 16" style="-webkit-transform-origin: 130px 106px; transform-origin: 130px 106px"/>
<path class="octo-body" d="M115 115s4 2 5 0l14-14c3-2 6-3 8-3-8-11-15-24 2-41 5-5 10-7 16-7 1-2 3-7 12-11 0 0 5 3 7 16 4 2 8 5 12 9s7 8 9 12c14 3 17 7 17 7-4 8-9 11-11 11 0 6-2 11-7 16-16 16-30 10-41 2 0 3-1 7-5 11l-12 11c-1 1 1 5 1 5z"/>
</svg>
</a>
<div id="app"></div>
`,
`
<script>
const approximatedLayoutRefreshDelay = 1500;
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
}, approximatedLayoutRefreshDelay);
</script>
`,
`
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-141520-33');
</script>
`,
],
scripts: [
{
async: '',
src: 'https://www.googletagmanager.com/gtag/js?id=UA-141520-33'
}
],
}
},
webpackConfig: {
module: {
rules: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css$/,
loader: [
'style-loader',
'css-loader',
],
},
],
},
},
sections: [
{
name: 'Introduction',
content: './README.md',
},
{
name: 'Components',
components: 'src/charts/!(template|loading)/[A-Z]*.js',
},
{
name: 'About',
content: './TOPICS.md',
},
],
styleguideDir: 'docs',
};