├── .babelrc
├── .babelrc.js
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .npmignore
├── .prettierignore
├── .prettierrc
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── assets
└── logo.png
├── jest.config.js
├── lerna.json
├── package-lock.json
├── package.json
├── packages
├── base
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── Article.js
│ │ ├── Author.js
│ │ ├── Blog.js
│ │ ├── Bodytext.js
│ │ ├── Branding.js
│ │ ├── Comments.js
│ │ ├── Footer.js
│ │ ├── Header.js
│ │ ├── Heading.js
│ │ ├── Hero.js
│ │ ├── Layout.js
│ │ ├── List.js
│ │ ├── Menu.js
│ │ ├── Meta.js
│ │ ├── NextPrev.js
│ │ ├── Page.js
│ │ ├── Seo.js
│ │ └── Share.js
│ │ └── index.js
├── classy-docs
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── Article.js
│ │ ├── Bodytext.js
│ │ ├── Branding.js
│ │ ├── Footer.js
│ │ ├── Header.js
│ │ ├── Heading.js
│ │ ├── Hero.js
│ │ ├── Layout.js
│ │ ├── List.js
│ │ ├── Menu.js
│ │ ├── Page.js
│ │ ├── Seo.js
│ │ └── Sidebar.js
│ │ ├── index.js
│ │ └── styles
│ │ ├── article.js
│ │ ├── bodytext.js
│ │ ├── branding.js
│ │ ├── footer.js
│ │ ├── global.js
│ │ ├── header.js
│ │ ├── heading.js
│ │ ├── hero.js
│ │ ├── layout.js
│ │ ├── layoutSidebar.js
│ │ ├── list.js
│ │ ├── menu.js
│ │ ├── page.js
│ │ ├── sidebar.js
│ │ └── variables.js
├── clean-diary
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── components
│ │ │ ├── Article.js
│ │ │ ├── Author.js
│ │ │ ├── Blog.js
│ │ │ ├── Bodytext.js
│ │ │ ├── Branding.js
│ │ │ ├── Comments.js
│ │ │ ├── Footer.js
│ │ │ ├── Header.js
│ │ │ ├── Heading.js
│ │ │ ├── Layout.js
│ │ │ ├── List.js
│ │ │ ├── Menu.js
│ │ │ ├── Meta.js
│ │ │ ├── NextPrev.js
│ │ │ ├── Page.js
│ │ │ ├── Pagination.js
│ │ │ ├── Seo.js
│ │ │ └── Share.js
│ │ ├── index.js
│ │ ├── styles
│ │ │ ├── article.js
│ │ │ ├── author.js
│ │ │ ├── blog.js
│ │ │ ├── bodytext.js
│ │ │ ├── branding.js
│ │ │ ├── comments.js
│ │ │ ├── footer.js
│ │ │ ├── global.js
│ │ │ ├── header.js
│ │ │ ├── heading.js
│ │ │ ├── layout.js
│ │ │ ├── list.js
│ │ │ ├── menu.js
│ │ │ ├── meta.js
│ │ │ ├── nextPrev.js
│ │ │ ├── page.js
│ │ │ ├── pagination.js
│ │ │ ├── share.js
│ │ │ └── variables.js
│ │ └── utils
│ │ │ └── prefixToDateTimeString.js
│ └── utils
│ │ └── prefixToDateTimeString.js
├── default
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── Article.js
│ │ ├── Author.js
│ │ ├── Blog.js
│ │ ├── Bodytext.js
│ │ ├── Branding.js
│ │ ├── Comments.js
│ │ ├── Footer.js
│ │ ├── Header.js
│ │ ├── Heading.js
│ │ ├── Hero.js
│ │ ├── Layout.js
│ │ ├── List.js
│ │ ├── Menu.js
│ │ ├── Meta.js
│ │ ├── NextPrev.js
│ │ ├── Page.js
│ │ ├── Seo.js
│ │ └── Share.js
│ │ ├── index.js
│ │ └── styles
│ │ ├── article.js
│ │ ├── author.js
│ │ ├── blog.js
│ │ ├── bodytext.js
│ │ ├── branding.js
│ │ ├── comments.js
│ │ ├── footer.js
│ │ ├── global.js
│ │ ├── header.js
│ │ ├── heading.js
│ │ ├── hero.js
│ │ ├── layout.js
│ │ ├── list.js
│ │ ├── menu.js
│ │ ├── meta.js
│ │ ├── nextPrev.js
│ │ ├── page.js
│ │ ├── share.js
│ │ └── variables.js
├── job-interview
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ └── src
│ │ ├── components
│ │ ├── Nav.js
│ │ ├── Screen.js
│ │ ├── Screens.js
│ │ ├── Seo.js
│ │ └── Social.js
│ │ ├── index.js
│ │ └── styles
│ │ ├── global.js
│ │ ├── nav.js
│ │ ├── screen.js
│ │ ├── screens.js
│ │ ├── social.js
│ │ └── variables.js
└── side-blog
│ ├── .babelrc
│ ├── .npmignore
│ ├── CODE_OF_CONDUCT.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── components
│ │ ├── Article.js
│ │ ├── Author.js
│ │ ├── Bodytext.js
│ │ ├── Branding.js
│ │ ├── Comments.js
│ │ ├── FilterInfo.js
│ │ ├── FilterSwitcher.js
│ │ ├── FilterWidget.js
│ │ ├── Footer.js
│ │ ├── Heading.js
│ │ ├── Layout.js
│ │ ├── List.js
│ │ ├── Menu.js
│ │ ├── Meta.js
│ │ ├── NextPrev.js
│ │ ├── Page.js
│ │ ├── Pagination.js
│ │ ├── Seo.js
│ │ ├── Share.js
│ │ ├── Sidebar.js
│ │ └── ToTop.js
│ ├── index.js
│ ├── store
│ │ └── Context.js
│ ├── styles
│ │ ├── article.js
│ │ ├── author.js
│ │ ├── bodytext.js
│ │ ├── branding.js
│ │ ├── comments.js
│ │ ├── filterInfo.js
│ │ ├── filterSwitcher.js
│ │ ├── filterWidget.js
│ │ ├── footer.js
│ │ ├── global.js
│ │ ├── heading.js
│ │ ├── layout.js
│ │ ├── list.js
│ │ ├── menu.js
│ │ ├── meta.js
│ │ ├── nextPrev.js
│ │ ├── page.js
│ │ ├── pagination.js
│ │ ├── share.js
│ │ ├── sidebar.js
│ │ ├── toTop.js
│ │ └── variables.js
│ └── utils
│ │ └── prefixToDateTimeString.js
│ ├── store
│ └── Context.js
│ └── utils
│ └── prefixToDateTimeString.js
├── stylelint.config.js
├── test
└── throwOnPropTypeError.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["@babel/preset-env", "@babel/preset-react"]
3 | }
4 |
--------------------------------------------------------------------------------
/.babelrc.js:
--------------------------------------------------------------------------------
1 | function preset() {
2 | return {
3 | presets: ['@babel/preset-env', '@babel/preset-react'],
4 | plugins: [
5 | '@babel/plugin-proposal-class-properties',
6 | '@babel/plugin-proposal-object-rest-spread'
7 | ]
8 | };
9 | }
10 |
11 | module.exports = preset;
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 |
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | end_of_line = lf
9 | insert_final_newline = true
10 | trim_trailing_whitespace = true
11 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | packages/*/index.js
2 | packages/*/components/*
3 | packages/*/styles/*
4 |
--------------------------------------------------------------------------------
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "env": {
4 | "browser": true,
5 | "node": true
6 | },
7 | "extends": ["react-app", "plugin:jsx-a11y/recommended"],
8 | "plugins": ["jsx-a11y", "emotion"],
9 | "rules": {
10 | "emotion/syntax-preference": [2, "string"]
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (http://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # Typescript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 | .env.development
60 | .env.production
61 |
62 |
63 | .vscode
64 | .cache/
65 | public
66 | yarn-error.log
67 | dist/
68 | packages/*/components/
69 | packages/*/styles/
70 | packages/*/index.js
71 | playground/*
72 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | src
2 | .vscode
3 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/greglobinski/react-website-themes/fe6f41fc56f9860f128ab3b2a2cf2dc4d6d237d5/.prettierignore
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 80,
3 | "singleQuote": true,
4 | "semi": true,
5 | "trailingComma": "es5",
6 | "bracketSpacing": true,
7 | "jsxBracketSameLine": false,
8 | "arrowParens": "avoid"
9 | }
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | A collection of sets of styled ready-to-use React components to build a website. Built for Gatsby Starter Kit .
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | ### License
18 |
19 | MIT License
20 |
21 | Copyright (c) 2018 greg lobinski
22 |
23 | Permission is hereby granted, free of charge, to any person obtaining a copy
24 | of this software and associated documentation files (the "Software"), to deal
25 | in the Software without restriction, including without limitation the rights
26 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27 | copies of the Software, and to permit persons to whom the Software is
28 | furnished to do so, subject to the following conditions:
29 |
30 | The above copyright notice and this permission notice shall be included in all
31 | copies or substantial portions of the Software.
32 |
33 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39 | SOFTWARE.
40 |
--------------------------------------------------------------------------------
/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/greglobinski/react-website-themes/fe6f41fc56f9860f128ab3b2a2cf2dc4d6d237d5/assets/logo.png
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | setupFiles: ['/test/throwOnPropTypeError.js'],
3 | coverageDirectory: './coverage/',
4 | collectCoverageFrom: ['./src/**/*.js'],
5 | testRegex: '(packages/**/src/{0,1}.*/__tests__/.*)\\.js?$',
6 | };
7 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": [
3 | "packages/*"
4 | ],
5 | "version": "independent",
6 | "npmClient": "yarn",
7 | "useWorkspaces": true
8 | }
9 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "root",
3 | "private": true,
4 | "scripts": {
5 | "build:all": "lerna exec --parallel -- babel src -d . --ignore /__tests__",
6 | "clear:all": "lerna exec --parallel -- rimraf index.js components styles",
7 | "publish:all": "npm-run-all -s build:all && lerna publish",
8 | "lint": "eslint packages/*/src/**/*.js",
9 | "stylelint": "stylelint packages/**/src/styles/*.js",
10 | "prebootstrap": "yarn",
11 | "test": "npm-run-all -s lint stylelint jest",
12 | "test:watch": "jest --watch"
13 | },
14 | "devDependencies": {
15 | "@babel/cli": "7.0.0-rc.1",
16 | "@babel/core": "7.0.0-rc.1",
17 | "@babel/plugin-proposal-class-properties": "7.0.0-rc.1",
18 | "@babel/plugin-proposal-object-rest-spread": "7.0.0-rc.1",
19 | "@babel/preset-env": "7.0.0-rc.1",
20 | "@babel/preset-react": "7.0.0-rc.1",
21 | "babel-eslint": "^8.2.6",
22 | "eslint": "4.1.1",
23 | "eslint-config-react-app": "2.1.0",
24 | "eslint-loader": "2.0.0",
25 | "eslint-plugin-babel": "5.1.0",
26 | "eslint-plugin-emotion": "^9.1.0",
27 | "eslint-plugin-flowtype": "2.34.1",
28 | "eslint-plugin-import": "2.6.0",
29 | "eslint-plugin-jest": "21.17.0",
30 | "eslint-plugin-jsx-a11y": "5.1.1",
31 | "eslint-plugin-react": "7.1.0",
32 | "jest": "23.2.0",
33 | "jest-emotion": "^9.2.4",
34 | "jsdom": "^11.11.0",
35 | "lerna": "^3.0.5",
36 | "npm-run-all": "4.1.3",
37 | "prettier": "1.13.7",
38 | "prop-types": "^15.6.0",
39 | "react": "^16.3.0",
40 | "react-dom": "^16.3.0",
41 | "react-testing-library": "^4.1.2",
42 | "rimraf": "^2.6.2",
43 | "stylelint": "9.3.0",
44 | "stylelint-config-recommended": "^2.1.0",
45 | "stylelint-config-styled-components": "^0.1.1",
46 | "stylelint-processor-styled-components": "^1.3.1"
47 | },
48 | "dependencies": {
49 | "github-slugger": "^1.2.0",
50 | "typeface-merriweather-sans": "^0.0.54"
51 | },
52 | "workspaces": [
53 | "packages/*"
54 | ]
55 | }
56 |
--------------------------------------------------------------------------------
/packages/base/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/base/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | src
--------------------------------------------------------------------------------
/packages/base/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/base/README.md:
--------------------------------------------------------------------------------
1 | # WIP
2 |
3 | ### License
4 |
5 | MIT License
6 |
7 | Copyright (c) 2018 greg lobinski
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/packages/base/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/base",
3 | "version": "0.0.7",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "typeface-open-sans": "^0.0.54"
17 | },
18 | "peerDependencies": {
19 | "emotion": "^9.2.4",
20 | "emotion-server": "^9.2.6",
21 | "facepaint": "^1.2.1",
22 | "prop-types": "^15.6.0",
23 | "react": "^16.3.0",
24 | "react-custom-share": "^0.4.8",
25 | "react-dom": "^16.3.0",
26 | "react-emotion": "^9.2.6",
27 | "react-facebook": "^5.0.3",
28 | "react-helmet": "^5.2.0"
29 | },
30 | "devDependencies": {
31 | "@babel/cli": "7.0.0-rc.1",
32 | "@babel/core": "7.0.0-rc.1",
33 | "emotion": "^9.2.4",
34 | "emotion-server": "^9.2.6",
35 | "facepaint": "^1.2.1",
36 | "npm-run-all": "4.1.3",
37 | "prop-types": "^15.6.0",
38 | "react": "^16.3.0",
39 | "react-custom-share": "^0.4.8",
40 | "react-dom": "^16.3.0",
41 | "react-emotion": "^9.2.6",
42 | "react-facebook": "^5.0.3",
43 | "react-helmet": "^5.2.0",
44 | "rimraf": "^2.6.2"
45 | },
46 | "gitHead": "c7f95f929855c2ff35dbc4cf5a8ab2e8d0f84c8b"
47 | }
48 |
--------------------------------------------------------------------------------
/packages/base/src/components/Article.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Article = props => {
6 | const { children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return {children} ;
9 | };
10 |
11 | Article.propTypes = {
12 | children: PropTypes.node.isRequired,
13 | themeStyle: PropTypes.string,
14 | customStyle: PropTypes.string,
15 | };
16 |
17 | export default Article;
18 |
--------------------------------------------------------------------------------
/packages/base/src/components/Author.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Author = props => {
6 | const { html, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
12 | );
13 | };
14 |
15 | Author.propTypes = {
16 | html: PropTypes.string,
17 | themeStyle: PropTypes.string,
18 | customStyle: PropTypes.string,
19 | };
20 |
21 | export default Author;
22 |
--------------------------------------------------------------------------------
/packages/base/src/components/Blog.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import Meta from './Meta';
7 |
8 | const Blog = props => {
9 | const { items, themeStyle = '', customStyle = '', author, metaIcons } = props;
10 |
11 | return (
12 |
13 |
14 | {items.map(item => {
15 | const {
16 | frontmatter: { title, categories },
17 | fields: { slug, prefix },
18 | excerpt,
19 | } = item;
20 |
21 | return (
22 |
23 |
24 | {title}
25 |
32 | {excerpt}
33 |
34 |
35 | );
36 | })}
37 |
38 |
39 | );
40 | };
41 |
42 | Blog.propTypes = {
43 | items: PropTypes.array.isRequired,
44 | author: PropTypes.string,
45 | themeStyle: PropTypes.string,
46 | customStyle: PropTypes.string,
47 | metaIcons: PropTypes.object,
48 | };
49 |
50 | export default Blog;
51 |
--------------------------------------------------------------------------------
/packages/base/src/components/Bodytext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Bodytext = props => {
6 | const { html, children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
10 | {html ? (
11 |
15 | ) : (
16 | {children}
17 | )}
18 |
19 | );
20 | };
21 |
22 | Bodytext.propTypes = {
23 | html: PropTypes.string,
24 | themeStyle: PropTypes.string,
25 | customStyle: PropTypes.string,
26 | };
27 |
28 | export default Bodytext;
29 |
--------------------------------------------------------------------------------
/packages/base/src/components/Branding.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | const Branding = props => {
7 | const { title, subTitle, themeStyle = '', customStyle = '' } = props;
8 |
9 | return (
10 |
11 | {title}
12 | {subTitle}
13 |
14 | );
15 | };
16 |
17 | Branding.propTypes = {
18 | title: PropTypes.string,
19 | subTitle: PropTypes.string,
20 | logo: PropTypes.node,
21 | themeStyle: PropTypes.string,
22 | customStyle: PropTypes.string,
23 | };
24 |
25 | export default Branding;
26 |
--------------------------------------------------------------------------------
/packages/base/src/components/Comments.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import FacebookProvider, { Comments as FBComments } from 'react-facebook';
4 | import { cx } from 'emotion';
5 |
6 | const Comments = props => {
7 | const {
8 | slug,
9 | siteUrl,
10 | appId,
11 | themeStyle = '',
12 | customStyle = '',
13 | colorScheme = 'light',
14 | } = props;
15 |
16 | return (
17 |
18 |
19 |
24 |
25 |
26 | );
27 | };
28 |
29 | Comments.propTypes = {
30 | slug: PropTypes.string.isRequired,
31 | siteUrl: PropTypes.string.isRequired,
32 | appId: PropTypes.string.isRequired,
33 | themeStyle: PropTypes.string,
34 | customStyle: PropTypes.string,
35 | colorScheme: PropTypes.string,
36 | };
37 |
38 | export default Comments;
39 |
--------------------------------------------------------------------------------
/packages/base/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | const Footer = props => {
6 | const { links, copyright, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
34 | );
35 | };
36 |
37 | Footer.propTypes = {
38 | links: PropTypes.string,
39 | copyright: PropTypes.string,
40 | themeStyle: PropTypes.string,
41 | customStyle: PropTypes.string,
42 | };
43 |
44 | export default Footer;
45 |
--------------------------------------------------------------------------------
/packages/base/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Header = props => {
6 | const { children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return ;
9 | };
10 |
11 | Header.propTypes = {
12 | children: PropTypes.node,
13 | themeStyle: PropTypes.string,
14 | customStyle: PropTypes.string,
15 | };
16 |
17 | export default Header;
18 |
--------------------------------------------------------------------------------
/packages/base/src/components/Heading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Heading = props => {
6 | const { title, children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
10 | {title ? {title} : children}
11 |
12 | );
13 | };
14 |
15 | Heading.propTypes = {
16 | title: PropTypes.string,
17 | children: PropTypes.node,
18 | themeStyle: PropTypes.string,
19 | customStyle: PropTypes.string,
20 | };
21 |
22 | export default Heading;
23 |
--------------------------------------------------------------------------------
/packages/base/src/components/Hero.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | const Hero = props => {
6 | const { html, children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
10 | {html ? (
11 |
15 | ) : (
16 |
17 | )}
18 |
19 | );
20 | };
21 |
22 | Hero.propTypes = {
23 | children: PropTypes.node,
24 | html: PropTypes.string,
25 | themeStyle: PropTypes.string,
26 | customStyle: PropTypes.string,
27 | };
28 |
29 | export default Hero;
30 |
--------------------------------------------------------------------------------
/packages/base/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | const Layout = props => {
6 | const { children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return (
9 |
10 | {children}
11 |
12 | );
13 | };
14 |
15 | Layout.propTypes = {
16 | children: PropTypes.node.isRequired,
17 | themeStyle: PropTypes.string,
18 | customStyle: PropTypes.string,
19 | };
20 |
21 | export default Layout;
22 |
--------------------------------------------------------------------------------
/packages/base/src/components/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | const List = props => {
7 | const { items, themeStyle = '', customStyle = '' } = props;
8 |
9 | return (
10 |
11 |
12 | {items.map(item => {
13 | const {
14 | frontmatter: { title },
15 | fields: { slug },
16 | } = item;
17 |
18 | return (
19 |
20 |
21 | {title}
22 |
23 |
24 | );
25 | })}
26 |
27 |
28 | );
29 | };
30 |
31 | List.propTypes = {
32 | items: PropTypes.array.isRequired,
33 | themeStyle: PropTypes.string,
34 | customStyle: PropTypes.string,
35 | };
36 |
37 | export default List;
38 |
--------------------------------------------------------------------------------
/packages/base/src/components/Menu.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | const Menu = props => {
7 | const { items, themeStyle = '', customStyle = '' } = props;
8 |
9 | return (
10 |
11 |
12 | {items.map(item => {
13 | const { label, to, icon: Icon, external, linkProps } = item;
14 |
15 | return (
16 |
17 | {external ? (
18 |
19 | {Icon && }
20 | {label}
21 |
22 | ) : (
23 |
24 | {Icon && }
25 | {label}
26 |
27 | )}
28 |
29 | );
30 | })}
31 |
32 |
33 | );
34 | };
35 |
36 | Menu.propTypes = {
37 | items: PropTypes.array.isRequired,
38 | themeStyle: PropTypes.string,
39 | customStyle: PropTypes.string,
40 | };
41 |
42 | export default Menu;
43 |
--------------------------------------------------------------------------------
/packages/base/src/components/Meta.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | const Meta = props => {
7 | const {
8 | prefix,
9 | categories,
10 | themeStyle = '',
11 | customStyle = '',
12 | author,
13 | categoryLink = true,
14 | icons: { calendar: CalendarIcon, user: UserIcon, tag: TagIcon },
15 | } = props;
16 |
17 | return (
18 |
19 |
20 | {CalendarIcon && } {prefix}
21 |
22 |
23 | {UserIcon && } {author}
24 |
25 | {categories && (
26 |
27 | {TagIcon && }
28 | {categories.map(category => {
29 | const link = (
30 |
31 | {category}
32 |
33 | );
34 | const txt = {category} ;
35 |
36 | return categoryLink ? link : txt;
37 | })}
38 |
39 | )}
40 |
41 | );
42 | };
43 |
44 | Meta.propTypes = {
45 | themeStyle: PropTypes.string,
46 | customStyle: PropTypes.string,
47 | prefix: PropTypes.string,
48 | categories: PropTypes.array,
49 | author: PropTypes.string,
50 | categoryLink: PropTypes.bool,
51 | icons: PropTypes.object,
52 | };
53 |
54 | export default Meta;
55 |
--------------------------------------------------------------------------------
/packages/base/src/components/NextPrev.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | const NextPrev = props => {
7 | const {
8 | themeStyle = '',
9 | customStyle = '',
10 | icons: { next: NextIcon, prev: PrevIcon },
11 | next: {
12 | fields: { prefix: nextPrefix, slug: nextSlug } = {},
13 | frontmatter: { title: nextTitle } = {},
14 | } = {},
15 | prev: {
16 | fields: { prefix: prevPrefix, slug: prevSlug } = {},
17 | frontmatter: { title: prevTitle } = {},
18 | } = {},
19 | } = props;
20 |
21 | return (
22 |
23 | {prevSlug && (
24 |
25 | {PrevIcon &&
}
26 |
27 | {prevTitle} {prevPrefix}
28 |
29 |
30 | )}
31 | {nextSlug && (
32 |
33 | {NextIcon &&
}
34 |
35 | {nextTitle} {nextPrefix}
36 |
37 |
38 | )}
39 |
40 | );
41 | };
42 |
43 | NextPrev.propTypes = {
44 | next: PropTypes.object,
45 | prev: PropTypes.object,
46 | themeStyle: PropTypes.string,
47 | icons: PropTypes.object,
48 | customStyle: PropTypes.string,
49 | };
50 |
51 | export default NextPrev;
52 |
--------------------------------------------------------------------------------
/packages/base/src/components/Page.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | const Page = props => {
6 | const { children, themeStyle = '', customStyle = '' } = props;
7 |
8 | return {children}
;
9 | };
10 |
11 | Page.propTypes = {
12 | children: PropTypes.node,
13 | themeStyle: PropTypes.string,
14 | customStyle: PropTypes.string,
15 | };
16 |
17 | export default Page;
18 |
--------------------------------------------------------------------------------
/packages/base/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 | {/* */}
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const { data, facebook } = props;
32 | // const postTitle = ((data || {}).frontmatter || {}).title;
33 | // const postDescription = ((data || {}).frontmatter || {}).description;
34 | // const postCover = ((data || {}).frontmatter || {}).cover;
35 | // const postSlug = ((data || {}).fields || {}).slug;
36 |
37 | // const title = postTitle
38 | // ? `${postTitle} - ${config.shortSiteTitle}`
39 | // : config.siteTitle;
40 | // const description = postDescription
41 | // ? postDescription
42 | // : config.siteDescription;
43 | // const image = postCover ? postCover : config.siteImage;
44 | // const url = config.siteUrl + config.pathPrefix + postSlug;
45 | };
46 |
47 | Seo.propTypes = {
48 | language: PropTypes.string,
49 | url: PropTypes.string.isRequired,
50 | title: PropTypes.string.isRequired,
51 | description: PropTypes.string.isRequired,
52 | image: PropTypes.string,
53 | };
54 |
55 | export default Seo;
56 |
--------------------------------------------------------------------------------
/packages/base/src/components/Share.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { ShareBlockStandard } from 'react-custom-share';
4 | import { cx } from 'emotion';
5 |
6 | const PostShare = props => {
7 | const { themeStyle = '', customStyle = '', shareBlockProps } = props;
8 |
9 | return (
10 |
11 |
12 |
13 | );
14 | };
15 |
16 | PostShare.propTypes = {
17 | themeStyle: PropTypes.string,
18 | customStyle: PropTypes.string,
19 | shareBlockProps: PropTypes.object,
20 | };
21 |
22 | export default PostShare;
23 |
--------------------------------------------------------------------------------
/packages/base/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Author } from './components/Author';
4 | export { default as Bodytext } from './components/Bodytext';
5 | export { default as Blog } from './components/Blog';
6 | export { default as Branding } from './components/Branding';
7 | export { default as Comments } from './components/Comments';
8 | export { default as Footer } from './components/Footer';
9 | export { default as Heading } from './components/Heading';
10 | export { default as Header } from './components/Header';
11 | export { default as Hero } from './components/Hero';
12 | export { default as Layout } from './components/Layout';
13 | export { default as List } from './components/List';
14 | export { default as Menu } from './components/Menu';
15 | export { default as Meta } from './components/Meta';
16 | export { default as NextPrev } from './components/NextPrev';
17 | export { default as Page } from './components/Page';
18 | export { default as Seo } from './components/Seo';
19 | export { default as Share } from './components/Share';
20 | /* styles */
21 | export { default as article } from './styles/article';
22 | export { default as author } from './styles/author';
23 | export { default as blog } from './styles/blog';
24 | export { default as bodytext } from './styles/bodytext';
25 | export { default as branding } from './styles/branding';
26 | export { default as comments } from './styles/comments';
27 | export { default as footer } from './styles/footer';
28 | export { default as heading } from './styles/heading';
29 | export { default as header } from './styles/header';
30 | export { default as hero } from './styles/hero';
31 | export { default as layout } from './styles/layout';
32 | export { default as list } from './styles/list';
33 | export { default as menu } from './styles/menu';
34 | export { default as meta } from './styles/meta';
35 | export { default as nextPrev } from './styles/nextPrev';
36 | export { default as page } from './styles/page';
37 | export { default as share } from './styles/share';
38 | /* global */
39 | export { default as global } from './styles/global';
40 |
--------------------------------------------------------------------------------
/packages/classy-docs/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/classy-docs/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | CODE_OF_CONDUCT.md
4 | src
5 |
--------------------------------------------------------------------------------
/packages/classy-docs/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/classy-docs/README.md:
--------------------------------------------------------------------------------
1 | # @react-website-themes/classy-docs
2 |
3 | ### License
4 |
5 | MIT License
6 |
7 | Copyright (c) 2018 greg lobinski
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/packages/classy-docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/classy-docs",
3 | "version": "0.0.23",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "github-slugger": "^1.2.0",
17 | "typeface-merriweather-sans": "^0.0.54"
18 | },
19 | "peerDependencies": {
20 | "emotion": "^9.2.4",
21 | "emotion-server": "^9.2.6",
22 | "facepaint": "^1.2.1",
23 | "prop-types": "^15.6.0",
24 | "react": "^16.3.0",
25 | "react-custom-share": "^0.4.8",
26 | "react-dom": "^16.3.0",
27 | "react-emotion": "^9.2.6",
28 | "react-helmet": "^5.2.0"
29 | },
30 | "devDependencies": {
31 | "@babel/cli": "7.0.0-rc.1",
32 | "@babel/core": "7.0.0-rc.1",
33 | "npm-run-all": "4.1.3",
34 | "rimraf": "^2.6.2"
35 | },
36 | "gitHead": "684c5c127f0f0fdabb6fc6b5cf01a8b0a7b8a27e"
37 | }
38 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Article.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/article';
6 |
7 | const Article = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return {children} ;
11 | };
12 |
13 | Article.propTypes = {
14 | children: PropTypes.node.isRequired,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Article;
20 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Bodytext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/bodytext';
6 |
7 | const Bodytext = props => {
8 | const { html, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {html ? (
13 |
17 | ) : (
18 | {children}
19 | )}
20 |
21 | );
22 | };
23 |
24 | Bodytext.propTypes = {
25 | html: PropTypes.string,
26 | themeStyle: PropTypes.string,
27 | customStyle: PropTypes.string,
28 | };
29 |
30 | export default Bodytext;
31 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Branding.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/branding';
7 |
8 | const Branding = props => {
9 | const { title, subTitle, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 | {title}
14 | {subTitle}
15 |
16 | );
17 | };
18 |
19 | Branding.propTypes = {
20 | title: PropTypes.string,
21 | subTitle: PropTypes.string,
22 | logo: PropTypes.node,
23 | themeStyle: PropTypes.string,
24 | customStyle: PropTypes.string,
25 | };
26 |
27 | export default Branding;
28 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/footer';
6 |
7 | const Footer = props => {
8 | const { links, copyright, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
36 | );
37 | };
38 |
39 | Footer.propTypes = {
40 | links: PropTypes.string,
41 | copyright: PropTypes.string,
42 | themeStyle: PropTypes.string,
43 | customStyle: PropTypes.string,
44 | };
45 |
46 | export default Footer;
47 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/header';
6 |
7 | const Header = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return ;
11 | };
12 |
13 | Header.propTypes = {
14 | children: PropTypes.node,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Header;
20 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Heading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/heading';
6 |
7 | const Heading = props => {
8 | const { title, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {title ? {title} : children}
13 |
14 | );
15 | };
16 |
17 | Heading.propTypes = {
18 | title: PropTypes.string,
19 | children: PropTypes.node,
20 | themeStyle: PropTypes.string,
21 | customStyle: PropTypes.string,
22 | };
23 |
24 | export default Heading;
25 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Hero.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/hero';
6 |
7 | const Hero = props => {
8 | const { html, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {html ? (
13 |
17 | ) : (
18 |
19 | )}
20 |
21 | );
22 | };
23 |
24 | Hero.propTypes = {
25 | children: PropTypes.node,
26 | html: PropTypes.string,
27 | themeStyle: PropTypes.string,
28 | customStyle: PropTypes.string,
29 | };
30 |
31 | export default Hero;
32 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/layout';
6 |
7 | class Layout extends React.Component {
8 | state = {
9 | modifier: '',
10 | };
11 |
12 | componentDidMount() {
13 | this.setState({
14 | modifier: 'entry',
15 | });
16 | }
17 |
18 | render() {
19 | const { children, themeStyle = style, customStyle = '' } = this.props;
20 | const { modifier } = this.state;
21 |
22 | return (
23 |
24 | {children}
25 |
26 | );
27 | }
28 | }
29 |
30 | Layout.propTypes = {
31 | children: PropTypes.node.isRequired,
32 | themeStyle: PropTypes.string,
33 | customStyle: PropTypes.string,
34 | };
35 |
36 | export default Layout;
37 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/list';
7 |
8 | function organizePagesInCategories(pages, categoryList) {
9 | return pages.reduce(
10 | (categoryContainers, currItem) => {
11 | const {
12 | frontmatter: { categories: currItemCategories },
13 | } = currItem;
14 |
15 | let pairedCategory = currItemCategories.reduce((pairedCat, currCat) => {
16 | if (
17 | pairedCat === '' &&
18 | categoryList.find(
19 | categoryListItem => categoryListItem.name === currCat
20 | )
21 | ) {
22 | return currCat;
23 | } else {
24 | return pairedCat;
25 | }
26 | }, '');
27 |
28 | if (pairedCategory) {
29 | const categoryContainer = categoryContainers.find(
30 | categoryContainer => categoryContainer.name === pairedCategory
31 | );
32 |
33 | categoryContainer.pages.push(currItem);
34 | }
35 | return categoryContainers;
36 | },
37 | categoryList.map(category => {
38 | category.pages = [];
39 | return category;
40 | })
41 | );
42 | }
43 |
44 | const List = props => {
45 | const { pages, categoryList, themeStyle = style, customStyle = '' } = props;
46 |
47 | const pagesInCategories = organizePagesInCategories(pages, categoryList);
48 |
49 | return (
50 |
51 | {pagesInCategories.map(category => {
52 | const { label, icon: Icon } = category;
53 |
54 | return (
55 |
56 |
57 |
58 | {label}
59 |
60 |
61 | {category.pages.map(page => {
62 | const {
63 | frontmatter: { title, shortTitle },
64 | fields: { slug },
65 | } = page;
66 | return (
67 |
68 |
69 | {shortTitle ? shortTitle : title}
70 |
71 |
72 | );
73 | })}
74 |
75 |
76 | );
77 | })}
78 |
79 | );
80 | };
81 |
82 | List.propTypes = {
83 | pages: PropTypes.array.isRequired,
84 | categoryList: PropTypes.array,
85 | themeStyle: PropTypes.string,
86 | customStyle: PropTypes.string,
87 | };
88 |
89 | export default List;
90 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Menu.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/menu';
7 |
8 | const Menu = props => {
9 | const { items, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 |
14 | {items.map(item => {
15 | const { label, to, icon: Icon, external, linkProps } = item;
16 |
17 | return (
18 |
19 | {external ? (
20 |
21 | {Icon && }
22 | {label}
23 |
24 | ) : (
25 |
26 | {Icon && }
27 | {label}
28 |
29 | )}
30 |
31 | );
32 | })}
33 |
34 |
35 | );
36 | };
37 |
38 | Menu.propTypes = {
39 | items: PropTypes.array.isRequired,
40 | themeStyle: PropTypes.string,
41 | customStyle: PropTypes.string,
42 | };
43 |
44 | export default Menu;
45 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Page.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/page';
6 |
7 | const Page = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return {children}
;
11 | };
12 |
13 | Page.propTypes = {
14 | children: PropTypes.node,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Page;
20 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 | {/* */}
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const { data, facebook } = props;
32 | // const postTitle = ((data || {}).frontmatter || {}).title;
33 | // const postDescription = ((data || {}).frontmatter || {}).description;
34 | // const postCover = ((data || {}).frontmatter || {}).cover;
35 | // const postSlug = ((data || {}).fields || {}).slug;
36 |
37 | // const title = postTitle
38 | // ? `${postTitle} - ${config.shortSiteTitle}`
39 | // : config.siteTitle;
40 | // const description = postDescription
41 | // ? postDescription
42 | // : config.siteDescription;
43 | // const image = postCover ? postCover : config.siteImage;
44 | // const url = config.siteUrl + config.pathPrefix + postSlug;
45 | };
46 |
47 | Seo.propTypes = {
48 | language: PropTypes.string,
49 | url: PropTypes.string.isRequired,
50 | title: PropTypes.string.isRequired,
51 | description: PropTypes.string.isRequired,
52 | image: PropTypes.string,
53 | };
54 |
55 | export default Seo;
56 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Bodytext } from './components/Bodytext';
4 | export { default as Branding } from './components/Branding';
5 | export { default as Footer } from './components/Footer';
6 | export { default as Heading } from './components/Heading';
7 | export { default as Header } from './components/Header';
8 | export { default as Hero } from './components/Hero';
9 | export { default as Layout } from './components/Layout';
10 | export { default as Menu } from './components/Menu';
11 | export { default as Page } from './components/Page';
12 | export { default as Seo } from './components/Seo';
13 | /* styles */
14 | export { default as article } from './styles/article';
15 | export { default as bodytext } from './styles/bodytext';
16 | export { default as branding } from './styles/branding';
17 | export { default as footer } from './styles/footer';
18 | export { default as heading } from './styles/heading';
19 | export { default as header } from './styles/header';
20 | export { default as hero } from './styles/hero';
21 | export { default as layout } from './styles/layout';
22 | export { default as menu } from './styles/menu';
23 | export { default as page } from './styles/page';
24 | /* global */
25 | export { default as global } from './styles/global';
26 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/article.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024, 1280];
5 |
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const article = css`
9 | margin: 0 auto 30px;
10 |
11 | ${mq({
12 | maxWidth: ['500px', '600px', '700px'],
13 | })};
14 | `;
15 |
16 | export default article;
17 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/bodytext.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const bodytext = css`
4 | margin-bottom: 50px;
5 | min-height: 40vh;
6 |
7 | & .gatsby-resp-image-wrapper {
8 | margin: 2em 0;
9 | }
10 |
11 | img:not(.emojiIcon) {
12 | border: 1px solid #ddd;
13 | border-radius: 5px;
14 | }
15 |
16 | a.demoLink {
17 | align-items: center;
18 | border-radius: 3px;
19 | color: var(--firstActiveColor);
20 | font-size: 1em;
21 | display: flex;
22 | text-decoration: none;
23 | text-transform: uppercase;
24 | padding: 0.6em 2em;
25 | background: #f9f9f9;
26 | font-weight: 700;
27 | font-size: 1.2em;
28 | border: 1px solid #ddd;
29 | margin: 40px 0 0;
30 | width: 100%;
31 | justify-content: center;
32 |
33 | @media (hover: hover) {
34 | &:hover {
35 | background: #eee;
36 | }
37 | }
38 | }
39 |
40 | p {
41 | line-height: 1.6;
42 | margin: 0 0 1.5em;
43 | font-size: 1em;
44 | }
45 |
46 | strong {
47 | letter-spacing: -0.02em;
48 | }
49 |
50 | ul {
51 | margin: 0 0 1.5em;
52 | list-style: none;
53 | }
54 |
55 | li {
56 | margin: 0.8em 0;
57 | line-height: 1.6;
58 | padding: 0 5px 0 20px;
59 | position: relative;
60 |
61 | &:before {
62 | content: '';
63 | width: 4px;
64 | height: 4px;
65 | background: var(--firstActiveColor);
66 | position: absolute;
67 | top: 0.6em;
68 | left: 1px;
69 | }
70 | }
71 |
72 | h2,
73 | h3 {
74 | line-height: 1.2;
75 | margin: 1.8em 0 1em;
76 | letter-spacing: -0.03em;
77 | display: flex;
78 | }
79 |
80 | h2 {
81 | font-size: 1.6em;
82 | }
83 |
84 | h3 {
85 | font-size: 1.3em;
86 | }
87 |
88 | .anchor {
89 | margin-left: -20px;
90 | float: none;
91 | width: 20px;
92 | display: flex;
93 | align-items: center;
94 | }
95 |
96 | pre {
97 | margin: 0 0 1.5em;
98 | }
99 |
100 | & *:not(pre) > code[class*='language-'] {
101 | background: #eee;
102 | color: #333;
103 | text-shadow: none;
104 | padding: 1px 5px 2px;
105 | border-radius: 2px;
106 | }
107 |
108 | & pre[class*='language-'] {
109 | background: #444;
110 | }
111 |
112 | blockquote {
113 | background: #f9f9f9;
114 | padding: 20px 20px 20px 30px;
115 | border-left: 5px solid #ddd;
116 | font-style: italic;
117 |
118 | & p:last-child {
119 | margin-bottom: 0;
120 | }
121 | }
122 | `;
123 |
124 | export default bodytext;
125 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/branding.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | import facepaint from 'facepaint';
4 |
5 | const breakpoints = [1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const branding = css`
9 | align-items: center;
10 | display: flex;
11 | flex-direction: column;
12 | text-align: center;
13 | flex-grow: 0;
14 | justify-content: center;
15 |
16 | ${mq({
17 | alignItems: ['center', 'flex-start'],
18 | margin: ['10px 0 20px', '0'],
19 | })};
20 |
21 | h1 {
22 | font-size: 1em;
23 | margin-bottom: 3px;
24 | font-weight: 400;
25 | }
26 |
27 | p {
28 | font-size: 0.7em;
29 | color: var(--superLightTextColor);
30 | letter-spacing: 0.1em;
31 | font-weight: 300;
32 | }
33 | `;
34 |
35 | export default branding;
36 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/footer.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const footer = css`
8 | display: flex;
9 | flex-direction: column;
10 | font-size: 0.9em;
11 | margin: 60px 0 20px;
12 |
13 | ${mq({
14 | margin: ['60px 0 60px', '60px 0 20px'],
15 | })};
16 |
17 | .links ul {
18 | list-style: none;
19 | display: flex;
20 | justify-content: center;
21 | flex-wrap: wrap;
22 | line-height: 1.1;
23 | }
24 |
25 | .links a {
26 | text-decoration: none;
27 | color: #777;
28 | font-weight: bold;
29 | }
30 |
31 | .links li {
32 | text-align: center;
33 | margin: 2px 10px;
34 | position: relative;
35 | }
36 |
37 | .copyright {
38 | font-size: 0.8em;
39 | text-align: center;
40 | margin: 10px 0 30px;
41 |
42 | & p {
43 | color: var(--superLightTextColor);
44 | }
45 | }
46 |
47 | .credits {
48 | font-size: 0.8em;
49 | color: var(--superLightTextColor);
50 | margin: 20px 0 0;
51 | text-align: center;
52 |
53 | & a {
54 | text-decoration: none;
55 | color: var(--lightTextColor);
56 | }
57 | }
58 | `;
59 |
60 | export default footer;
61 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/global.js:
--------------------------------------------------------------------------------
1 | import { injectGlobal } from 'emotion';
2 |
3 | const global = injectGlobal`
4 | html {
5 | box-sizing: border-box;
6 | font-family: "Merriweather Sans", sans-serif;
7 | font-size: 16px;
8 | color: #666;
9 | }
10 |
11 | *,
12 | *:after,
13 | *:before {
14 | box-sizing: inherit;
15 | margin: 0;
16 | padding: 0;
17 | }
18 |
19 | p {
20 | color: var(--textColor);
21 | }
22 |
23 | h1, h2, h3 {
24 | color: var(--lightTextColor);
25 | }
26 |
27 | h1 {
28 | font-size: 2.4em;
29 | }
30 |
31 | h2 {
32 | font-size: 1.8em;
33 | }
34 |
35 | ul {
36 | list-style-position: inside;
37 | }
38 |
39 | a {
40 | color: var(--linkColor);
41 | transition: .3s;
42 | }
43 |
44 | @media (hover: hover) {
45 | a:hover {
46 | color: var(--hoverLinkColor);
47 | }
48 | }
49 |
50 | *::-webkit-scrollbar {
51 | width: var(--scrollBarWidth);
52 | }
53 | *::-webkit-scrollbar-track {
54 | background: var(--scrollBarTrack);
55 | }
56 | *::-webkit-scrollbar-thumb {
57 | background-color: var(--scrollBarThumb);
58 | }
59 |
60 |
61 | `;
62 |
63 | export default global;
64 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/header.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 |
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const header = css`
9 | display: flex;
10 | margin-bottom: 50px;
11 | padding: 5px 5px 0;
12 | align-items: center;
13 |
14 | ${mq({
15 | flexDirection: ['column', 'row'],
16 | marginBottom: ['35px', '50px'],
17 | })};
18 |
19 | a {
20 | text-decoration: none;
21 | }
22 | `;
23 |
24 | export default header;
25 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/heading.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [768, 1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const heading = css`
8 | h1 {
9 | letter-spacing: -0.03em;
10 | margin-bottom: 1em;
11 | line-height: 1.2;
12 | border-left: 6px solid var(--firstActiveColor);
13 | padding-left: 15px;
14 | color: var(--lightTextColor);
15 |
16 | ${mq({
17 | fontSize: ['1.8em', '2em', '2.2em'],
18 | })};
19 | }
20 | `;
21 |
22 | export default heading;
23 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/hero.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 | import { keyframes } from 'react-emotion';
4 |
5 | const breakpoints = [768, 1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const pulse = keyframes`
9 | from {
10 | box-shadow: 0 0 0 2px white, 0 0 0 3px rgba(221,0,0, .5);
11 | }
12 | 70% {
13 | box-shadow: 0 0 0 6px white, 0 0 0 8px rgba(221, 0, 0, 0);
14 | }
15 | to {
16 | box-shadow: none;
17 | }
18 | `;
19 |
20 | const hero = css`
21 | flex-direction: column;
22 | display: flex;
23 | justify-content: center;
24 | align-items: strech;
25 | padding: 0 10%;
26 | text-align: center;
27 |
28 | ${mq({
29 | minHeight: [
30 | 'calc(100vh - 300px)',
31 | 'calc(100vh - 280px)',
32 | 'calc(100vh - 260px)',
33 | ],
34 | })};
35 |
36 | & .image {
37 | max-width: 500px;
38 | margin: 0 auto 20px;
39 | }
40 |
41 | h1 {
42 | line-height: 1;
43 | text-align: center;
44 | font-size: 2.2em;
45 | margin-bottom: 0.5em;
46 | letter-spacing: -0.03em;
47 | border-radius: 5px;
48 |
49 | ${mq({
50 | fontSize: ['2.2em', '2.6em', '3em'],
51 | })};
52 | }
53 |
54 | a {
55 | align-items: center;
56 | border-radius: 3px;
57 | color: var(--firstActiveColor);
58 | font-size: 1em;
59 | display: inline-block;
60 | text-decoration: none;
61 | text-transform: uppercase;
62 | padding: 1em 2em;
63 | background: #f9f9f9;
64 | margin: 40px 0 0;
65 | animation: ${pulse} 2s ease infinite;
66 | }
67 |
68 | @media (hover: hover) {
69 | a:hover {
70 | animation: none;
71 | background: var(--firstActiveColor);
72 | color: #fff;
73 | }
74 | }
75 | `;
76 |
77 | export default hero;
78 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/layout.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const layout = css`
4 | padding: 15px 25px;
5 | `;
6 |
7 | export default layout;
8 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/layoutSidebar.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const layoutSidebar = css`
8 | padding: 15px 25px;
9 |
10 | ${mq({
11 | marginLeft: ['0', '320px'],
12 | })};
13 |
14 | &.entry {
15 | /*background: red;*/
16 | }
17 | `;
18 |
19 | export default layoutSidebar;
20 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/list.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const list = css`
4 | & h3 {
5 | font-size: 0.7em;
6 | letter-spacing: 0.2em;
7 | padding: 10px 0 0;
8 | text-transform: uppercase;
9 | font-weight: 300;
10 | color: var(--lightTextColor);
11 | display: flex;
12 | align-items: center;
13 |
14 | & svg {
15 | width: 15px;
16 | margin: 0 5px 0 -5px;
17 | stroke: var(--superLightGray);
18 | }
19 | }
20 |
21 | ul {
22 | margin: 0 0 1.5em;
23 | list-style: none;
24 | }
25 |
26 | li {
27 | margin: 0.8em 0;
28 | line-height: 1.4;
29 | padding: 0 5px 0 20px;
30 | position: relative;
31 |
32 | &:before {
33 | content: '';
34 | width: 4px;
35 | height: 4px;
36 | background: var(--firstActiveColor);
37 | position: absolute;
38 | top: 0.45em;
39 | left: 1px;
40 | }
41 | }
42 |
43 | & a {
44 | text-decoration: none;
45 | color: #666;
46 | }
47 | `;
48 |
49 | export default list;
50 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/menu.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const menu = css`
8 | flex-grow: 1;
9 | align-items: center;
10 | display: flex;
11 | z-index: 1;
12 | background: #fff;
13 | justify-content: center;
14 |
15 | ${mq({
16 | justifyContent: ['center', 'flex-end'],
17 | position: ['fixed', 'relative'],
18 | bottom: [0, 'auto'],
19 | width: ['100%', 'auto'],
20 | left: [0, 'auto'],
21 | borderTop: ['1px solid #ddd', 'none'],
22 | })};
23 |
24 | & ul {
25 | list-style: none;
26 | display: flex;
27 | height: 44px;
28 | justify-content: center;
29 | }
30 |
31 | & li {
32 | padding: 0 5px;
33 | line-height: 1;
34 |
35 | & a {
36 | display: flex;
37 | height: 100%;
38 | justify-content: center;
39 | align-items: center;
40 | margin: 0 5px;
41 | color: var(--lightTextColor);
42 | position: relative;
43 |
44 | &:before {
45 | content: '';
46 | position: absolute;
47 | bottom: 0;
48 | left: 0;
49 | background: var(--firstActiveColor);
50 | width: 20px;
51 | height: 0px;
52 | transition: 0.3s;
53 | transform: translateY(8px);
54 | }
55 |
56 | &.active:before {
57 | height: 5px;
58 | transform: translateY(0);
59 | }
60 |
61 | &:not(.active) {
62 | @media (hover: hover) {
63 | &:hover:before {
64 | height: 5px;
65 | transform: translateY(0);
66 | background: var(--secondActiveColor);
67 | }
68 | }
69 | }
70 | }
71 |
72 | & svg {
73 | margin: 0 5px 0 0;
74 | height: 20px;
75 | width: 20px;
76 | }
77 | }
78 | `;
79 |
80 | export default menu;
81 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/page.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const page = css`
4 | display: block;
5 | `;
6 |
7 | export default page;
8 |
--------------------------------------------------------------------------------
/packages/classy-docs/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | import 'typeface-merriweather-sans';
2 | import { injectGlobal } from 'emotion';
3 |
4 | const variables = injectGlobal`
5 | :root {
6 | --firstActiveColor: #d00;
7 | --secondActiveColor: orange;
8 | --superLightGray: #ccc;
9 |
10 | --textColor: #555;
11 | --lightTextColor: #777;
12 | --superLightTextColor: #aaa;
13 |
14 | --linkColor: #a00;
15 | --hoverLinkColor: #d00;
16 |
17 | --scrollBarThumb: #eaeaea;
18 | --scrollBarTrack: #f9f9f9;
19 | --scrollBarWidth: 5px;
20 | }
21 | `;
22 |
23 | export default variables;
24 |
--------------------------------------------------------------------------------
/packages/clean-diary/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/clean-diary/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | src
--------------------------------------------------------------------------------
/packages/clean-diary/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/clean-diary/README.md:
--------------------------------------------------------------------------------
1 | # WIP
2 |
3 | ### License
4 |
5 | MIT License
6 |
7 | Copyright (c) 2018 greg lobinski
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/packages/clean-diary/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/clean-diary",
3 | "version": "0.0.3",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles utils && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "@react-website-themes/base": "^0.0.7",
17 | "dayjs": "^1.7.5",
18 | "typeface-fredericka-the-great": "^0.0.54",
19 | "typeface-merriweather": "^0.0.54",
20 | "typeface-open-sans": "^0.0.54",
21 | "typeface-pacifico": "^0.0.54",
22 | "typeface-pt-serif": "^0.0.54"
23 | },
24 | "peerDependencies": {
25 | "emotion": "^9.2.4",
26 | "emotion-server": "^9.2.6",
27 | "facepaint": "^1.2.1",
28 | "prop-types": "^15.6.0",
29 | "react": "^16.3.0",
30 | "react-custom-share": "^0.4.8",
31 | "react-dom": "^16.3.0",
32 | "react-emotion": "^9.2.6",
33 | "react-facebook": "^5.0.3",
34 | "react-helmet": "^5.2.0"
35 | },
36 | "devDependencies": {
37 | "@babel/cli": "7.0.0-rc.1",
38 | "@babel/core": "7.0.0-rc.1",
39 | "emotion": "^9.2.4",
40 | "emotion-server": "^9.2.6",
41 | "facepaint": "^1.2.1",
42 | "npm-run-all": "4.1.3",
43 | "prop-types": "^15.6.0",
44 | "react": "^16.3.0",
45 | "react-custom-share": "^0.4.8",
46 | "react-dom": "^16.3.0",
47 | "react-emotion": "^9.2.6",
48 | "react-facebook": "^5.0.3",
49 | "react-helmet": "^5.2.0",
50 | "rimraf": "^2.6.2"
51 | },
52 | "gitHead": "c7f95f929855c2ff35dbc4cf5a8ab2e8d0f84c8b"
53 | }
54 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Article.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/article';
4 | import BaseArticle from '@react-website-themes/base/components/Article';
5 |
6 | const Article = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Article;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Author.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/author';
4 | import BaseAuthor from '@react-website-themes/base/components/Author';
5 |
6 | const Author = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Author;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Bodytext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/bodytext';
4 | import BaseBodytext from '@react-website-themes/base/components/Bodytext';
5 |
6 | const Bodytext = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Bodytext;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Branding.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/branding';
7 |
8 | const Branding = props => {
9 | const { title, subTitle, themeStyle = style, customStyle = '', logo } = props;
10 |
11 | return (
12 |
13 |
14 | {title}
15 | {subTitle}
16 |
17 | );
18 | };
19 |
20 | Branding.propTypes = {
21 | title: PropTypes.string,
22 | subTitle: PropTypes.string,
23 | logo: PropTypes.node,
24 | themeStyle: PropTypes.string,
25 | customStyle: PropTypes.string,
26 | };
27 |
28 | export default Branding;
29 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Comments.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/comments';
4 | import BaseComments from '@react-website-themes/base/components/Comments';
5 |
6 | const Comments = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Comments;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/footer';
4 | import BaseFooter from '@react-website-themes/base/components/Footer';
5 |
6 | const Footer = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Footer;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/header';
4 | import BaseHeader from '@react-website-themes/base/components/Header';
5 |
6 | const Header = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Header;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Heading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/heading';
4 | import BaseHeading from '@react-website-themes/base/components/Heading';
5 |
6 | const Heading = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Heading;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/layout';
4 | import BaseLayout from '@react-website-themes/base/components/Layout';
5 |
6 | const Layout = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Layout;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 | import dayjs from 'dayjs';
6 |
7 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
8 | import style from '../styles/list';
9 |
10 | const List = props => {
11 | const { items, themeStyle = style, customStyle = '', icon: Icon } = props;
12 |
13 | return (
14 |
15 |
16 | {items.map(item => {
17 | const {
18 | frontmatter: { title },
19 | fields: { slug, prefix },
20 | } = item;
21 |
22 | const dateTimeString = prefixToDateTimeString(prefix);
23 |
24 | return (
25 |
26 |
27 |
28 |
29 | {`${dayjs(dateTimeString).format('dddd')} at ${dayjs(
30 | dateTimeString
31 | ).format('h:mm a')}, ${dayjs(dateTimeString).format(
32 | 'MMMM D, YYYY'
33 | )}`}
34 |
35 | {title}
36 |
37 |
38 | );
39 | })}
40 |
41 |
42 | );
43 | };
44 |
45 | List.propTypes = {
46 | items: PropTypes.array.isRequired,
47 | themeStyle: PropTypes.string,
48 | customStyle: PropTypes.string,
49 | icon: PropTypes.func,
50 | };
51 |
52 | export default List;
53 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Menu.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/menu';
7 |
8 | const Menu = props => {
9 | const {
10 | items,
11 | themeStyle = style,
12 | customStyle = '',
13 | actionIcons: {
14 | calendar: CalendarIcon = null,
15 | toTop: ToTopIcon = null,
16 | } = {},
17 | } = props;
18 |
19 | function scrollTop(e) {
20 | console.log(e.currentTarget);
21 | window.scroll({
22 | top: 0,
23 | left: 0,
24 | behavior: 'smooth',
25 | });
26 | e.currentTarget.blur();
27 | }
28 |
29 | return (
30 |
31 |
32 | {items.map(item => {
33 | const { label, to, icon: Icon, external, linkProps } = item;
34 |
35 | return (
36 |
37 | {external ? (
38 |
39 | {Icon && }
40 | {label}
41 |
42 | ) : (
43 |
44 | {Icon && }
45 | {label}
46 |
47 | )}
48 |
49 | );
50 | })}
51 |
52 | {CalendarIcon && (
53 |
54 |
55 |
56 | )}
57 | {ToTopIcon && (
58 |
59 |
60 |
61 | )}
62 |
63 | );
64 | };
65 |
66 | Menu.propTypes = {
67 | items: PropTypes.array.isRequired,
68 | themeStyle: PropTypes.string,
69 | customStyle: PropTypes.string,
70 | actionIcons: PropTypes.object,
71 | };
72 |
73 | export default Menu;
74 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Meta.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 | import dayjs from 'dayjs';
6 |
7 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
8 | import style from '../styles/meta';
9 |
10 | const Meta = props => {
11 | const {
12 | prefix,
13 | categories,
14 | themeStyle = style,
15 | customStyle = '',
16 | categoryLink = true,
17 | icons: { calendar: CalendarIcon, tag: TagIcon },
18 | } = props;
19 |
20 | const dateTimeString = prefixToDateTimeString(prefix);
21 |
22 | return (
23 |
24 |
25 | {CalendarIcon && }{' '}
26 | {`${dayjs(dateTimeString).format('dddd')} at ${dayjs(
27 | dateTimeString
28 | ).format('h:mm a')}, ${dayjs(dateTimeString).format('MMMM D, YYYY')}`}
29 |
30 | {categories && (
31 |
32 | {TagIcon && }
33 | {categories.map(category => {
34 | const link = (
35 |
36 | {category}
37 |
38 | );
39 | const txt = {category} ;
40 |
41 | return categoryLink ? link : txt;
42 | })}
43 |
44 | )}
45 |
46 | );
47 | };
48 |
49 | Meta.propTypes = {
50 | themeStyle: PropTypes.string,
51 | customStyle: PropTypes.string,
52 | prefix: PropTypes.string,
53 | categories: PropTypes.array,
54 | author: PropTypes.string,
55 | categoryLink: PropTypes.bool,
56 | icons: PropTypes.object,
57 | };
58 |
59 | export default Meta;
60 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/NextPrev.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 | import dayjs from 'dayjs';
6 |
7 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
8 | import style from '../styles/nextPrev';
9 |
10 | const NextPrev = props => {
11 | const {
12 | themeStyle = style,
13 | customStyle = '',
14 | icons: { next: NextIcon, prev: PrevIcon },
15 | next: {
16 | fields: { prefix: nextPrefix, slug: nextSlug } = {},
17 | frontmatter: { title: nextTitle } = {},
18 | } = {},
19 | prev: {
20 | fields: { prefix: prevPrefix, slug: prevSlug } = {},
21 | frontmatter: { title: prevTitle } = {},
22 | } = {},
23 | timeOffset,
24 | } = props;
25 |
26 | const prevDateTimeString = prevPrefix
27 | ? prefixToDateTimeString(prevPrefix)
28 | : null;
29 | const nextDateTimeString = nextPrefix
30 | ? prefixToDateTimeString(nextPrefix)
31 | : null;
32 |
33 | return (
34 |
35 | {prevSlug && (
36 |
37 | {PrevIcon &&
}
38 |
39 | {prevTitle}{' '}
40 |
41 | {dayjs(prevDateTimeString).format('dddd, MMMM D, YYYY')}
42 |
43 |
44 |
45 | )}
46 | {nextSlug && (
47 |
48 | {NextIcon &&
}
49 |
50 | {nextTitle}{' '}
51 |
52 | {dayjs(nextDateTimeString).format('dddd, MMMM D, YYYY')}
53 |
54 |
55 |
56 | )}
57 |
58 | );
59 | };
60 |
61 | NextPrev.propTypes = {
62 | next: PropTypes.object,
63 | prev: PropTypes.object,
64 | themeStyle: PropTypes.string,
65 | icons: PropTypes.object,
66 | customStyle: PropTypes.string,
67 | };
68 |
69 | export default NextPrev;
70 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Page.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/page';
4 | import BasePage from '@react-website-themes/base/components/Page';
5 |
6 | const Page = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Page;
13 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 | {/* */}
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const { data, facebook } = props;
32 | // const postTitle = ((data || {}).frontmatter || {}).title;
33 | // const postDescription = ((data || {}).frontmatter || {}).description;
34 | // const postCover = ((data || {}).frontmatter || {}).cover;
35 | // const postSlug = ((data || {}).fields || {}).slug;
36 |
37 | // const title = postTitle
38 | // ? `${postTitle} - ${config.shortSiteTitle}`
39 | // : config.siteTitle;
40 | // const description = postDescription
41 | // ? postDescription
42 | // : config.siteDescription;
43 | // const image = postCover ? postCover : config.siteImage;
44 | // const url = config.siteUrl + config.pathPrefix + postSlug;
45 | };
46 |
47 | Seo.propTypes = {
48 | language: PropTypes.string,
49 | url: PropTypes.string.isRequired,
50 | title: PropTypes.string.isRequired,
51 | description: PropTypes.string.isRequired,
52 | image: PropTypes.string,
53 | };
54 |
55 | export default Seo;
56 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/components/Share.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { ShareBlockAside } from 'react-custom-share';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/share';
7 |
8 | const PostShare = props => {
9 | const { themeStyle = style, customStyle = '', shareBlockProps } = props;
10 |
11 | return (
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | PostShare.propTypes = {
19 | themeStyle: PropTypes.string,
20 | customStyle: PropTypes.string,
21 | shareBlockProps: PropTypes.object,
22 | };
23 |
24 | export default PostShare;
25 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Author } from './components/Author';
4 | export { default as Bodytext } from './components/Bodytext';
5 | export { default as Blog } from './components/Blog';
6 | export { default as Branding } from './components/Branding';
7 | export { default as Comments } from './components/Comments';
8 | export { default as Footer } from './components/Footer';
9 | export { default as Heading } from './components/Heading';
10 | export { default as Header } from './components/Header';
11 | export { default as Hero } from './components/Hero';
12 | export { default as Layout } from './components/Layout';
13 | export { default as List } from './components/List';
14 | export { default as Menu } from './components/Menu';
15 | export { default as Meta } from './components/Meta';
16 | export { default as NextPrev } from './components/NextPrev';
17 | export { default as Page } from './components/Page';
18 | export { default as Seo } from './components/Seo';
19 | export { default as Share } from './components/Share';
20 | /* styles */
21 | export { default as article } from './styles/article';
22 | export { default as author } from './styles/author';
23 | export { default as blog } from './styles/blog';
24 | export { default as bodytext } from './styles/bodytext';
25 | export { default as branding } from './styles/branding';
26 | export { default as comments } from './styles/comments';
27 | export { default as footer } from './styles/footer';
28 | export { default as heading } from './styles/heading';
29 | export { default as header } from './styles/header';
30 | export { default as hero } from './styles/hero';
31 | export { default as layout } from './styles/layout';
32 | export { default as list } from './styles/list';
33 | export { default as menu } from './styles/menu';
34 | export { default as meta } from './styles/meta';
35 | export { default as nextPrev } from './styles/nextPrev';
36 | export { default as page } from './styles/page';
37 | export { default as share } from './styles/share';
38 | /* global */
39 | export { default as global } from './styles/global';
40 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/article.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const article = css`
4 | max-width: 600px;
5 | margin: 0 auto;
6 | padding: 15px 25px;
7 | `;
8 |
9 | export default article;
10 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/author.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const author = css`
4 | margin: 50px 0;
5 | `;
6 |
7 | export default author;
8 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/bodytext.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const bodytext = css`
4 | margin-bottom: 50px;
5 | min-height: 40vh;
6 | font-family: var(--secondFontFamily);
7 |
8 | & .gatsby-resp-image-wrapper {
9 | margin: 2em 0;
10 | }
11 |
12 | p {
13 | line-height: 1.7;
14 | margin: 0 0 1.5em;
15 | font-size: 1.1em;
16 | }
17 |
18 | .gatsby-resp-image-wrapper {
19 | border-radius: 6px;
20 | overflow: hidden;
21 | box-shadow: 0 4px 2px rgba(0, 0, 0, 0.2);
22 | }
23 |
24 | ul {
25 | margin: 0 0 1.5em;
26 | list-style-position: inside;
27 | }
28 |
29 | li {
30 | margin: 0.8em 0;
31 | font-size: 1.1em;
32 | line-height: 1.3;
33 | padding-left: 5px;
34 | }
35 |
36 | h2,
37 | h3 {
38 | line-height: 1.2;
39 | margin: 1.6em 0 0.9em;
40 | font-family: var(--firstFontFamily);
41 | }
42 |
43 | h2 {
44 | font-size: 2em;
45 | }
46 |
47 | h3 {
48 | font-size: 1.6em;
49 | }
50 |
51 | pre {
52 | margin: 0 0 1.5em;
53 | }
54 |
55 | blockquote {
56 | font-family: var(--firstFontFamily);
57 | font-size: 1.1em;
58 | font-style: italic;
59 | text-align: left;
60 | position: relative;
61 | margin: 50px 30px;
62 | color: var(--brandColor);
63 |
64 | small {
65 | text-align: right;
66 | display: block;
67 | font-size: 0.6em;
68 | font-style: normal;
69 | margin: 0.5em 0;
70 | font-family: var(--secondFontFamily);
71 | }
72 |
73 | p {
74 | color: var(--brandColor);
75 | line-height: 1.6;
76 | }
77 |
78 | &:before,
79 | &:after {
80 | content: open-quote;
81 | color: #ddd;
82 | padding-right: 0.1em;
83 | position: absolute;
84 | top: -25px;
85 | left: -50px;
86 | transform: translateY(0.1em);
87 | font-size: 4em;
88 | }
89 |
90 | &:after {
91 | content: close-quote;
92 | top: auto;
93 | bottom: -45px;
94 | left: auto;
95 | right: -45px;
96 | }
97 | }
98 | `;
99 |
100 | export default bodytext;
101 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/branding.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | import facepaint from 'facepaint';
4 |
5 | const breakpoints = [768, 1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const branding = css`
9 | align-items: center;
10 | display: flex;
11 | flex-direction: column;
12 | flex-grow: 0;
13 | align-items: center;
14 | justify-content: center;
15 |
16 | img {
17 | margin: 0 0 10px;
18 | width: 40px;
19 |
20 | ${mq({
21 | width: ['30px', '40px', '50px'],
22 | })};
23 | }
24 |
25 | h1 {
26 | color: var(--textColor);
27 | text-align: center;
28 | line-height: 1.1;
29 | margin-bottom: 0.2em;
30 | text-transform: uppercase;
31 | ${mq({
32 | fontSize: ['1.4em', '1.6em', '1.8em'],
33 | })};
34 | }
35 |
36 | p {
37 | font-size: 1em;
38 | font-family: var(--secondFontFamily);
39 | letter-spacing: -0.01em;
40 | }
41 |
42 | a {
43 | }
44 | `;
45 |
46 | export default branding;
47 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/comments.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const comments = css`
4 | margin: 60px 0;
5 | position: relative;
6 | `;
7 |
8 | export default comments;
9 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/footer.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const footer = css`
8 | background: var(--footerBgColor);
9 | font-family: var(--secondFontFamily);
10 | display: flex;
11 | flex-direction: column;
12 | font-size: 0.9em;
13 |
14 | ${mq({
15 | padding: ['40px 40px 90px', '40px 40px'],
16 | })};
17 |
18 | .links ul {
19 | list-style: none;
20 | color: var(--textColor);
21 | display: flex;
22 | justify-content: center;
23 | flex-wrap: wrap;
24 | line-height: 1.1;
25 | }
26 |
27 | .links a {
28 | text-decoration: none;
29 | color: var(--textColor);
30 | font-weight: bold;
31 | }
32 |
33 | .links li {
34 | text-align: center;
35 | margin: 2px 10px;
36 | position: relative;
37 | }
38 |
39 | .copyright {
40 | font-size: 0.9em;
41 | color: var(--lightTextColor);
42 | text-align: center;
43 | margin: 10px 0 30px;
44 | }
45 |
46 | .credits {
47 | font-size: 0.8em;
48 | color: var(--superLightTextColor);
49 | margin: 20px 0 0;
50 | text-align: center;
51 |
52 | & a {
53 | text-decoration: none;
54 | color: var(--lightTextColor);
55 | }
56 | }
57 | `;
58 |
59 | export default footer;
60 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/global.js:
--------------------------------------------------------------------------------
1 | import { injectGlobal } from 'emotion';
2 |
3 | const global = injectGlobal`
4 | html {
5 | box-sizing: border-box;
6 | font-family: var(--firstFontFamily);
7 | font-size: 16px;
8 | color: #666;
9 | }
10 |
11 | *,
12 | *:after,
13 | *:before {
14 | box-sizing: inherit;
15 | margin: 0;
16 | padding: 0;
17 | }
18 |
19 | p {
20 | color: var(--textColor);
21 | }
22 |
23 | h1 {
24 | font-size: 2.4em;
25 | }
26 |
27 | h2 {
28 | font-size: 1.8em;
29 | }
30 |
31 | ul {
32 | list-style-position: inside;
33 | }
34 |
35 | a {
36 | color: var(--linkColor);
37 | transition: .3s;
38 | }
39 |
40 | @media (hover: hover) {
41 | a:hover {
42 | color: var(--hoverLinkColor);
43 | }
44 | }
45 |
46 | *::-webkit-scrollbar {
47 | width: var(--scrollBarWidth);
48 | }
49 | *::-webkit-scrollbar-track {
50 | background: var(--scrollBarTrack);
51 | }
52 | *::-webkit-scrollbar-thumb {
53 | background-color: var(--scrollBarThumb);
54 | }
55 |
56 | `;
57 |
58 | export default global;
59 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/header.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const header = css`
8 | display: flex;
9 | flex-direction: column;
10 | max-width: 600px;
11 | margin: 0 auto;
12 |
13 | ${mq({
14 | padding: ['60px 0;', '60px 0 50px;'],
15 | })};
16 |
17 | a {
18 | text-decoration: none;
19 | }
20 | `;
21 |
22 | export default header;
23 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/heading.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [768, 1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const heading = css`
8 | text-align: center;
9 |
10 | span {
11 | display: flex;
12 | align-items: center;
13 | justify-content: center;
14 | font-family: var(--secondFontFamily);
15 |
16 | & svg {
17 | width: 18px;
18 | margin-left: 5px;
19 | }
20 | }
21 |
22 | h1 {
23 | letter-spacing: -0.01em;
24 | margin-bottom: 1em;
25 | line-height: 1.1;
26 |
27 | ${mq({
28 | fontSize: ['2em', '2.4em', '2.8em'],
29 | })};
30 | }
31 |
32 | .meta {
33 | font-family: var(--secondFontFamily);
34 | margin-top: -10px;
35 |
36 | strong {
37 | background: var(--accentColor);
38 | padding: 1px 6px;
39 | color: white;
40 | border-radius: 3px;
41 | }
42 | }
43 | `;
44 |
45 | export default heading;
46 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/layout.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const layout = css`
4 | padding: 0;
5 | `;
6 |
7 | export default layout;
8 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/list.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const list = css`
4 | ul {
5 | list-style: none;
6 |
7 | margin: 40px 0;
8 | }
9 |
10 | li {
11 | font-size: 1.5em;
12 | text-align: center;
13 | line-height: 1.2;
14 | margin-bottom: 20px;
15 | }
16 |
17 | time {
18 | font-family: var(--secondFontFamily);
19 | font-size: 0.6em;
20 | color: var(--brandColor);
21 | display: flex;
22 | justify-content: center;
23 | align-items: center;
24 | margin-bottom: 4px;
25 |
26 | & svg {
27 | width: 14px;
28 | margin-right: 5px;
29 | stroke: var(--accentColor);
30 | }
31 | }
32 |
33 | a {
34 | text-decoration: none;
35 | padding: 0.6em 5px;
36 | position: relative;
37 | display: block;
38 | color: var(--textColor);
39 |
40 | @media (any-hover: hover) {
41 | &:hover {
42 | color: var(--hoverLinkColor);
43 | }
44 | }
45 | }
46 | `;
47 |
48 | export default list;
49 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/meta.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const meta = css`
8 | margin: 0.5em 0 2em;
9 | font-size: 0.9em;
10 | color: var(--brandColor);
11 | display: flex;
12 | justify-content: center;
13 | flex-direction: column;
14 | font-family: var(--secondFontFamily);
15 |
16 | ${mq({
17 | flexDirection: ['column', 'row'],
18 | })};
19 |
20 | [class$='-blog'] & {
21 | margin-bottom: 1em;
22 | }
23 |
24 | & span {
25 | padding: 2px 0;
26 | display: flex;
27 | align-items: center;
28 | justify-content: center;
29 | line-height: 1;
30 |
31 | ${mq({
32 | marginBottom: ['6px', '0'],
33 | })};
34 | }
35 |
36 | & svg {
37 | margin: 0 5px 0 0;
38 | width: 16px;
39 | height: 16px;
40 | stroke: var(--accentColor);
41 | }
42 | `;
43 |
44 | export default meta;
45 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/nextPrev.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const circle = `
4 | background: white;
5 | border: 1px solid var(--lineColor);
6 | border-radius: 50%;
7 | content: '';
8 | height: 14px;
9 | left: 50%;
10 | position: absolute;
11 | width: 14px;
12 | `;
13 |
14 | const nextPrev = css`
15 | display: flex;
16 | justify-content: space-between;
17 | border-top: 1px solid var(--lineColor);
18 | border-bottom: 1px solid var(--lineColor);
19 | padding: 60px 0;
20 | flex-direction: column;
21 | font-size: 1.3em;
22 | line-height: 1.2;
23 | position: relative;
24 |
25 | &:before {
26 | ${circle};
27 | top: 0;
28 | transform: translate(-50%, -50%);
29 | }
30 |
31 | &:after {
32 | ${circle};
33 | bottom: 0;
34 | transform: translate(-50%, 50%);
35 | }
36 |
37 | & svg {
38 | width: 30px;
39 | height: 30px;
40 | margin: 0 10px;
41 | flex-shrink: 0;
42 | }
43 |
44 | & a {
45 | text-decoration: none;
46 | }
47 |
48 | & .next,
49 | & .prev {
50 | display: flex;
51 |
52 | & > svg {
53 | flex-grow: 0;
54 | }
55 | }
56 |
57 | & .prev {
58 | & > p {
59 | padding: 0 50px 0 0;
60 | }
61 | }
62 |
63 | & .next {
64 | flex-direction: row-reverse;
65 | text-align: right;
66 | margin-top: 20px;
67 |
68 | & > p {
69 | padding: 0 0 0 50px;
70 | }
71 | }
72 |
73 | & time {
74 | display: block;
75 | font-size: 0.65em;
76 | font-family: var(--secondFontFamily);
77 | color: var(--lightTextColor);
78 | margin-top: 6px;
79 | }
80 | `;
81 |
82 | export default nextPrev;
83 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/page.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const page = css`
4 | display: block;
5 | `;
6 |
7 | export default page;
8 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/pagination.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const pagination = css`
4 | padding: 40px 0;
5 | font-family: var(--secondFontFamily);
6 | display: flex;
7 | justify-content: center;
8 |
9 | ul {
10 | display: inline-flex;
11 | justify-content: center;
12 | list-style: none;
13 | margin: 0;
14 | padding: 0;
15 | }
16 |
17 | li {
18 | border-top: 1px solid var(--brandColor);
19 | border-bottom: 1px solid var(--brandColor);
20 | border-right: 1px solid #ddd;
21 |
22 | &:last-child,
23 | &:first-child {
24 | border: 1px solid var(--brandColor);
25 | }
26 |
27 | &:first-child {
28 | border-radius: var(--radius) 0 0 var(--radius);
29 | border-right: 1px solid #ddd;
30 |
31 | &.no-onestep {
32 | border-right: 2px dotted var(--brandColor);
33 | }
34 | }
35 |
36 | &:last-child {
37 | border-radius: 0 var(--radius) var(--radius) 0;
38 | border-left: 1px solid #ddd;
39 |
40 | &.no-onestep {
41 | border-left: 2px dotted var(--brandColor);
42 | }
43 | }
44 |
45 | &:nth-last-child(2) {
46 | border-right: none;
47 | }
48 | }
49 |
50 | svg {
51 | width: 20px;
52 | }
53 |
54 | a {
55 | display: flex;
56 | justify-content: center;
57 | align-items: center;
58 | text-decoration: none;
59 | height: 44px;
60 | min-width: 40px;
61 |
62 | &.active {
63 | color: white;
64 | font-weight: 700;
65 | background: var(--accentColor);
66 | }
67 | }
68 | `;
69 |
70 | export default pagination;
71 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/share.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const share = css`
4 | margin-bottom: 50px;
5 | `;
6 |
7 | export default share;
8 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | import 'typeface-pt-serif';
2 | import 'typeface-open-sans';
3 | import { injectGlobal } from 'emotion';
4 |
5 | const variables = injectGlobal`
6 | :root {
7 | --brandColor: #639300;
8 | --accentColor: #F06000;
9 |
10 | --textColor: #555;
11 | --lightTextColor: #888;
12 | --superLightTextColor: #aaa;
13 |
14 | --footerBgColor: #f9f9f9;
15 |
16 | --lineColor: #ddd;
17 |
18 | --firstFontFamily: "PT Serif", serif;
19 | --secondFontFamily: "Open Sans", sans-serif;
20 |
21 | --radius: 4px;
22 |
23 | --linkColor: var(--brandColor);
24 | --hoverLinkColor: #9ED200;
25 |
26 | --scrollBarThumb: #eaeaea;
27 | --scrollBarTrack: #f9f9f9;
28 | --scrollBarWidth: 10px;
29 | }
30 | `;
31 |
32 | export default variables;
33 |
--------------------------------------------------------------------------------
/packages/clean-diary/src/utils/prefixToDateTimeString.js:
--------------------------------------------------------------------------------
1 | export default function prefixToDateTimeString(str) {
2 | let dateString = /^(\d{4}-\d{2}-\d{2})/.exec(str);
3 | dateString = dateString ? dateString[1] : '';
4 |
5 | let timeString = /--(\d{2}-\d{2})$/.exec(str);
6 | timeString = timeString ? timeString[1].replace('-', ':') : '00:00';
7 |
8 | return `${dateString}T${timeString}`;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/clean-diary/utils/prefixToDateTimeString.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.default = prefixToDateTimeString;
7 |
8 | function prefixToDateTimeString(str) {
9 | var dateString = /^(\d{4}-\d{2}-\d{2})/.exec(str);
10 | dateString = dateString ? dateString[1] : '';
11 | var timeString = /--(\d{2}-\d{2})$/.exec(str);
12 | timeString = timeString ? timeString[1].replace('-', ':') : '00:00';
13 | return "".concat(dateString, "T").concat(timeString);
14 | }
--------------------------------------------------------------------------------
/packages/default/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/default/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | src
--------------------------------------------------------------------------------
/packages/default/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/default/README.md:
--------------------------------------------------------------------------------
1 | # @react-website-themes/default
2 |
3 | # ...
4 |
5 | ### License
6 |
7 | MIT License
8 |
9 | Copyright (c) 2018 greg lobinski
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 |
--------------------------------------------------------------------------------
/packages/default/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/default",
3 | "version": "0.0.20",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "typeface-open-sans": "^0.0.54"
17 | },
18 | "peerDependencies": {
19 | "emotion": "^9.2.4",
20 | "emotion-server": "^9.2.6",
21 | "facepaint": "^1.2.1",
22 | "prop-types": "^15.6.0",
23 | "react": "^16.3.0",
24 | "react-custom-share": "^0.4.8",
25 | "react-dom": "^16.3.0",
26 | "react-emotion": "^9.2.6",
27 | "react-facebook": "^5.0.3",
28 | "react-helmet": "^5.2.0"
29 | },
30 | "devDependencies": {
31 | "@babel/cli": "7.0.0-rc.1",
32 | "@babel/core": "7.0.0-rc.1",
33 | "emotion": "^9.2.4",
34 | "emotion-server": "^9.2.6",
35 | "facepaint": "^1.2.1",
36 | "npm-run-all": "4.1.3",
37 | "prop-types": "^15.6.0",
38 | "react": "^16.3.0",
39 | "react-custom-share": "^0.4.8",
40 | "react-dom": "^16.3.0",
41 | "react-emotion": "^9.2.6",
42 | "react-facebook": "^5.0.3",
43 | "react-helmet": "^5.2.0",
44 | "rimraf": "^2.6.2"
45 | },
46 | "gitHead": "684c5c127f0f0fdabb6fc6b5cf01a8b0a7b8a27e"
47 | }
48 |
--------------------------------------------------------------------------------
/packages/default/src/components/Article.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/article';
6 |
7 | const Article = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return {children} ;
11 | };
12 |
13 | Article.propTypes = {
14 | children: PropTypes.node.isRequired,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Article;
20 |
--------------------------------------------------------------------------------
/packages/default/src/components/Author.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/author';
6 |
7 | const Author = props => {
8 | const { html, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
14 | );
15 | };
16 |
17 | Author.propTypes = {
18 | html: PropTypes.string,
19 | themeStyle: PropTypes.string,
20 | customStyle: PropTypes.string,
21 | };
22 |
23 | export default Author;
24 |
--------------------------------------------------------------------------------
/packages/default/src/components/Blog.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import Meta from './Meta';
7 |
8 | import style from '../styles/blog';
9 |
10 | const Blog = props => {
11 | const {
12 | items,
13 | themeStyle = style,
14 | customStyle = '',
15 | author,
16 | metaIcons,
17 | } = props;
18 |
19 | return (
20 |
21 |
22 | {items.map(item => {
23 | const {
24 | frontmatter: { title, categories },
25 | fields: { slug, prefix },
26 | excerpt,
27 | } = item;
28 |
29 | return (
30 |
31 |
32 | {title}
33 |
40 | {excerpt}
41 |
42 |
43 | );
44 | })}
45 |
46 |
47 | );
48 | };
49 |
50 | Blog.propTypes = {
51 | items: PropTypes.array.isRequired,
52 | author: PropTypes.string,
53 | themeStyle: PropTypes.string,
54 | customStyle: PropTypes.string,
55 | metaIcons: PropTypes.object,
56 | };
57 |
58 | export default Blog;
59 |
--------------------------------------------------------------------------------
/packages/default/src/components/Bodytext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/bodytext';
6 |
7 | const Bodytext = props => {
8 | const { html, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {html ? (
13 |
17 | ) : (
18 | {children}
19 | )}
20 |
21 | );
22 | };
23 |
24 | Bodytext.propTypes = {
25 | html: PropTypes.string,
26 | themeStyle: PropTypes.string,
27 | customStyle: PropTypes.string,
28 | };
29 |
30 | export default Bodytext;
31 |
--------------------------------------------------------------------------------
/packages/default/src/components/Branding.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/branding';
7 |
8 | const Branding = props => {
9 | const { title, subTitle, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 | {title}
14 | {subTitle}
15 |
16 | );
17 | };
18 |
19 | Branding.propTypes = {
20 | title: PropTypes.string,
21 | subTitle: PropTypes.string,
22 | logo: PropTypes.node,
23 | themeStyle: PropTypes.string,
24 | customStyle: PropTypes.string,
25 | };
26 |
27 | export default Branding;
28 |
--------------------------------------------------------------------------------
/packages/default/src/components/Comments.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import FacebookProvider, { Comments as FBComments } from 'react-facebook';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/comments';
7 |
8 | const Comments = props => {
9 | const { slug, siteUrl, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 |
14 |
19 |
20 |
21 | );
22 | };
23 |
24 | Comments.propTypes = {
25 | slug: PropTypes.string.isRequired,
26 | siteUrl: PropTypes.string.isRequired,
27 | themeStyle: PropTypes.string,
28 | customStyle: PropTypes.string,
29 | };
30 |
31 | export default Comments;
32 |
--------------------------------------------------------------------------------
/packages/default/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/footer';
6 |
7 | const Footer = props => {
8 | const { links, copyright, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
36 | );
37 | };
38 |
39 | Footer.propTypes = {
40 | links: PropTypes.string,
41 | copyright: PropTypes.string,
42 | themeStyle: PropTypes.string,
43 | customStyle: PropTypes.string,
44 | };
45 |
46 | export default Footer;
47 |
--------------------------------------------------------------------------------
/packages/default/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/header';
6 |
7 | const Header = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return ;
11 | };
12 |
13 | Header.propTypes = {
14 | children: PropTypes.node,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Header;
20 |
--------------------------------------------------------------------------------
/packages/default/src/components/Heading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/heading';
6 |
7 | const Heading = props => {
8 | const { title, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {title ? {title} : children}
13 |
14 | );
15 | };
16 |
17 | Heading.propTypes = {
18 | title: PropTypes.string,
19 | children: PropTypes.node,
20 | themeStyle: PropTypes.string,
21 | customStyle: PropTypes.string,
22 | };
23 |
24 | export default Heading;
25 |
--------------------------------------------------------------------------------
/packages/default/src/components/Hero.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/hero';
6 |
7 | const Hero = props => {
8 | const { html, children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {html ? (
13 |
17 | ) : (
18 |
19 | )}
20 |
21 | );
22 | };
23 |
24 | Hero.propTypes = {
25 | children: PropTypes.node,
26 | html: PropTypes.string,
27 | themeStyle: PropTypes.string,
28 | customStyle: PropTypes.string,
29 | };
30 |
31 | export default Hero;
32 |
--------------------------------------------------------------------------------
/packages/default/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/layout';
6 |
7 | const Layout = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return (
11 |
12 | {children}
13 |
14 | );
15 | };
16 |
17 | Layout.propTypes = {
18 | children: PropTypes.node.isRequired,
19 | themeStyle: PropTypes.string,
20 | customStyle: PropTypes.string,
21 | };
22 |
23 | export default Layout;
24 |
--------------------------------------------------------------------------------
/packages/default/src/components/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/list';
7 |
8 | const List = props => {
9 | const { items, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 |
14 | {items.map(item => {
15 | const {
16 | frontmatter: { title },
17 | fields: { slug },
18 | } = item;
19 |
20 | return (
21 |
22 |
23 | {title}
24 |
25 |
26 | );
27 | })}
28 |
29 |
30 | );
31 | };
32 |
33 | List.propTypes = {
34 | items: PropTypes.array.isRequired,
35 | themeStyle: PropTypes.string,
36 | customStyle: PropTypes.string,
37 | };
38 |
39 | export default List;
40 |
--------------------------------------------------------------------------------
/packages/default/src/components/Menu.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/menu';
7 |
8 | const Menu = props => {
9 | const { items, themeStyle = style, customStyle = '' } = props;
10 |
11 | return (
12 |
13 |
14 | {items.map(item => {
15 | const { label, to, icon: Icon, external, linkProps } = item;
16 |
17 | return (
18 |
19 | {external ? (
20 |
21 | {Icon && }
22 | {label}
23 |
24 | ) : (
25 |
26 | {Icon && }
27 | {label}
28 |
29 | )}
30 |
31 | );
32 | })}
33 |
34 |
35 | );
36 | };
37 |
38 | Menu.propTypes = {
39 | items: PropTypes.array.isRequired,
40 | themeStyle: PropTypes.string,
41 | customStyle: PropTypes.string,
42 | };
43 |
44 | export default Menu;
45 |
--------------------------------------------------------------------------------
/packages/default/src/components/Meta.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/meta';
7 |
8 | const Meta = props => {
9 | const {
10 | prefix,
11 | categories,
12 | themeStyle = style,
13 | customStyle = '',
14 | author,
15 | categoryLink = true,
16 | icons: { calendar: CalendarIcon, user: UserIcon, tag: TagIcon },
17 | } = props;
18 |
19 | return (
20 |
21 |
22 | {CalendarIcon && } {prefix}
23 |
24 |
25 | {UserIcon && } {author}
26 |
27 | {categories && (
28 |
29 | {TagIcon && }
30 | {categories.map(category => {
31 | const link = (
32 |
33 | {category}
34 |
35 | );
36 | const txt = {category} ;
37 |
38 | return categoryLink ? link : txt;
39 | })}
40 |
41 | )}
42 |
43 | );
44 | };
45 |
46 | Meta.propTypes = {
47 | themeStyle: PropTypes.string,
48 | customStyle: PropTypes.string,
49 | prefix: PropTypes.string,
50 | categories: PropTypes.array,
51 | author: PropTypes.string,
52 | categoryLink: PropTypes.bool,
53 | icons: PropTypes.object,
54 | };
55 |
56 | export default Meta;
57 |
--------------------------------------------------------------------------------
/packages/default/src/components/NextPrev.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/nextPrev';
7 |
8 | const NextPrev = props => {
9 | const {
10 | themeStyle = style,
11 | customStyle = '',
12 | icons: { next: NextIcon, prev: PrevIcon },
13 | next: {
14 | fields: { prefix: nextPrefix, slug: nextSlug } = {},
15 | frontmatter: { title: nextTitle } = {},
16 | } = {},
17 | prev: {
18 | fields: { prefix: prevPrefix, slug: prevSlug } = {},
19 | frontmatter: { title: prevTitle } = {},
20 | } = {},
21 | } = props;
22 |
23 | return (
24 |
25 | {prevSlug && (
26 |
27 | {PrevIcon &&
}
28 |
29 | {prevTitle} {prevPrefix}
30 |
31 |
32 | )}
33 | {nextSlug && (
34 |
35 | {NextIcon &&
}
36 |
37 | {nextTitle} {nextPrefix}
38 |
39 |
40 | )}
41 |
42 | );
43 | };
44 |
45 | NextPrev.propTypes = {
46 | next: PropTypes.object,
47 | prev: PropTypes.object,
48 | themeStyle: PropTypes.string,
49 | icons: PropTypes.object,
50 | customStyle: PropTypes.string,
51 | };
52 |
53 | export default NextPrev;
54 |
--------------------------------------------------------------------------------
/packages/default/src/components/Page.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/page';
6 |
7 | const Page = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return {children}
;
11 | };
12 |
13 | Page.propTypes = {
14 | children: PropTypes.node,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Page;
20 |
--------------------------------------------------------------------------------
/packages/default/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 | {/* */}
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const { data, facebook } = props;
32 | // const postTitle = ((data || {}).frontmatter || {}).title;
33 | // const postDescription = ((data || {}).frontmatter || {}).description;
34 | // const postCover = ((data || {}).frontmatter || {}).cover;
35 | // const postSlug = ((data || {}).fields || {}).slug;
36 |
37 | // const title = postTitle
38 | // ? `${postTitle} - ${config.shortSiteTitle}`
39 | // : config.siteTitle;
40 | // const description = postDescription
41 | // ? postDescription
42 | // : config.siteDescription;
43 | // const image = postCover ? postCover : config.siteImage;
44 | // const url = config.siteUrl + config.pathPrefix + postSlug;
45 | };
46 |
47 | Seo.propTypes = {
48 | language: PropTypes.string,
49 | url: PropTypes.string.isRequired,
50 | title: PropTypes.string.isRequired,
51 | description: PropTypes.string.isRequired,
52 | image: PropTypes.string,
53 | };
54 |
55 | export default Seo;
56 |
--------------------------------------------------------------------------------
/packages/default/src/components/Share.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { ShareBlockStandard } from 'react-custom-share';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/share';
7 |
8 | const PostShare = props => {
9 | const { themeStyle = style, customStyle = '', shareBlockProps } = props;
10 |
11 | return (
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | PostShare.propTypes = {
19 | themeStyle: PropTypes.string,
20 | customStyle: PropTypes.string,
21 | shareBlockProps: PropTypes.object,
22 | };
23 |
24 | export default PostShare;
25 |
--------------------------------------------------------------------------------
/packages/default/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Author } from './components/Author';
4 | export { default as Bodytext } from './components/Bodytext';
5 | export { default as Blog } from './components/Blog';
6 | export { default as Branding } from './components/Branding';
7 | export { default as Comments } from './components/Comments';
8 | export { default as Footer } from './components/Footer';
9 | export { default as Heading } from './components/Heading';
10 | export { default as Header } from './components/Header';
11 | export { default as Hero } from './components/Hero';
12 | export { default as Layout } from './components/Layout';
13 | export { default as List } from './components/List';
14 | export { default as Menu } from './components/Menu';
15 | export { default as Meta } from './components/Meta';
16 | export { default as NextPrev } from './components/NextPrev';
17 | export { default as Page } from './components/Page';
18 | export { default as Seo } from './components/Seo';
19 | export { default as Share } from './components/Share';
20 | /* styles */
21 | export { default as article } from './styles/article';
22 | export { default as author } from './styles/author';
23 | export { default as blog } from './styles/blog';
24 | export { default as bodytext } from './styles/bodytext';
25 | export { default as branding } from './styles/branding';
26 | export { default as comments } from './styles/comments';
27 | export { default as footer } from './styles/footer';
28 | export { default as heading } from './styles/heading';
29 | export { default as header } from './styles/header';
30 | export { default as hero } from './styles/hero';
31 | export { default as layout } from './styles/layout';
32 | export { default as list } from './styles/list';
33 | export { default as menu } from './styles/menu';
34 | export { default as meta } from './styles/meta';
35 | export { default as nextPrev } from './styles/nextPrev';
36 | export { default as page } from './styles/page';
37 | export { default as share } from './styles/share';
38 | /* global */
39 | export { default as global } from './styles/global';
40 |
--------------------------------------------------------------------------------
/packages/default/src/styles/article.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const article = css`
4 | max-width: 600px;
5 | margin: 0 auto 30px;
6 | `;
7 |
8 | export default article;
9 |
--------------------------------------------------------------------------------
/packages/default/src/styles/author.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const author = css`
4 | margin: 50px 0;
5 | `;
6 |
7 | export default author;
8 |
--------------------------------------------------------------------------------
/packages/default/src/styles/blog.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const blog = css`
4 | ul {
5 | list-style: none;
6 | }
7 |
8 | li {
9 | padding: 0 0 2.5em;
10 | }
11 |
12 | h3 {
13 | font-size: 1.6em;
14 | margin-bottom: 0.5em;
15 | line-height: 1.2;
16 | letter-spacing: -0.02em;
17 | }
18 |
19 | a {
20 | text-decoration: none;
21 | color: var(--textColor);
22 |
23 | &:hover {
24 | color: var(--hoverLinkColor);
25 | }
26 | }
27 |
28 | p {
29 | line-height: 1.4;
30 | }
31 | `;
32 |
33 | export default blog;
34 |
--------------------------------------------------------------------------------
/packages/default/src/styles/bodytext.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const bodytext = css`
4 | margin-bottom: 50px;
5 | min-height: 40vh;
6 |
7 | & .gatsby-resp-image-wrapper {
8 | margin: 2em 0;
9 | }
10 |
11 | p {
12 | line-height: 1.6;
13 | margin: 0 0 1.5em;
14 | font-size: 1.1em;
15 | }
16 |
17 | ul {
18 | margin: 0 0 1.5em;
19 | list-style-position: inside;
20 | }
21 |
22 | li {
23 | margin: 0.8em 0;
24 | font-size: 1.1em;
25 | line-height: 1.3;
26 | padding-left: 5px;
27 | }
28 |
29 | h2,
30 | h3 {
31 | line-height: 1.2;
32 | margin: 1.5em 0 0.8em;
33 | letter-spacing: -0.01em;
34 | }
35 |
36 | h2 {
37 | font-size: 2em;
38 | }
39 |
40 | h3 {
41 | font-size: 1.6em;
42 | }
43 |
44 | pre {
45 | margin: 0 0 1.5em;
46 | }
47 |
48 | blockquote {
49 | padding-left: 20px;
50 | border-left: 5px solid #ddd;
51 | font-style: italic;
52 | }
53 | `;
54 |
55 | export default bodytext;
56 |
--------------------------------------------------------------------------------
/packages/default/src/styles/branding.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | import facepaint from 'facepaint';
4 |
5 | const breakpoints = [1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const branding = css`
9 | align-items: center;
10 | display: flex;
11 | flex-direction: column;
12 | text-align: center;
13 | flex-grow: 0;
14 |
15 | ${mq({
16 | alignItems: ['center', 'flex-start'],
17 | margin: ['10px 0 20px', '0'],
18 | })};
19 |
20 | h1 {
21 | font-size: 1em;
22 | margin-bottom: 5px;
23 |
24 | ${mq({
25 | marginBottom: ['2px', '0'],
26 | })};
27 | }
28 |
29 | p {
30 | font-size: 0.8em;
31 | }
32 | `;
33 |
34 | export default branding;
35 |
--------------------------------------------------------------------------------
/packages/default/src/styles/comments.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const comments = css`
4 | margin: 30px 0;
5 | `;
6 |
7 | export default comments;
8 |
--------------------------------------------------------------------------------
/packages/default/src/styles/footer.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const footer = css`
4 | display: flex;
5 | flex-direction: column;
6 | font-size: 0.9em;
7 | margin: 20px 0;
8 |
9 | .links ul {
10 | list-style: none;
11 | color: var(--textColor);
12 | display: flex;
13 | justify-content: center;
14 | flex-wrap: wrap;
15 | line-height: 1.1;
16 | }
17 |
18 | .links a {
19 | text-decoration: none;
20 | color: var(--textColor);
21 | font-weight: bold;
22 | }
23 |
24 | .links li {
25 | text-align: center;
26 | margin: 2px 10px;
27 | position: relative;
28 | }
29 |
30 | .copyright {
31 | font-size: 0.9em;
32 | color: var(--lightTextColor);
33 | text-align: center;
34 | margin: 10px 0 30px;
35 | }
36 |
37 | .credits {
38 | font-size: 0.8em;
39 | color: var(--superLightTextColor);
40 | margin: 20px 0 0;
41 | text-align: center;
42 |
43 | & a {
44 | text-decoration: none;
45 | color: var(--lightTextColor);
46 | }
47 | }
48 | `;
49 |
50 | export default footer;
51 |
--------------------------------------------------------------------------------
/packages/default/src/styles/global.js:
--------------------------------------------------------------------------------
1 | import { injectGlobal } from 'emotion';
2 |
3 | const global = injectGlobal`
4 | html {
5 | box-sizing: border-box;
6 | font-family: var(--fontFamily);
7 | font-size: 16px;
8 | color: #666;
9 | }
10 |
11 | *,
12 | *:after,
13 | *:before {
14 | box-sizing: inherit;
15 | margin: 0;
16 | padding: 0;
17 | }
18 |
19 | p {
20 | color: var(--textColor);
21 | }
22 |
23 | h1 {
24 | font-size: 2.4em;
25 | }
26 |
27 | h2 {
28 | font-size: 1.8em;
29 | }
30 |
31 | ul {
32 | list-style-position: inside;
33 | }
34 |
35 | a {
36 | color: var(--linkColor);
37 | transition: .3s;
38 | }
39 |
40 | @media (hover: hover) {
41 | a:hover {
42 | color: var(--hoverLinkColor);
43 | }
44 | }
45 |
46 | *::-webkit-scrollbar {
47 | width: var(--scrollBarWidth);
48 | }
49 | *::-webkit-scrollbar-track {
50 | background: var(--scrollBarTrack);
51 | }
52 | *::-webkit-scrollbar-thumb {
53 | background-color: var(--scrollBarThumb);
54 | }
55 |
56 | `;
57 |
58 | export default global;
59 |
--------------------------------------------------------------------------------
/packages/default/src/styles/header.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 |
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const header = css`
9 | display: flex;
10 | margin-bottom: 50px;
11 | padding: 5px 5px 0;
12 |
13 | ${mq({
14 | flexDirection: ['column', 'row'],
15 | marginBottom: ['35px', '50px'],
16 | })};
17 |
18 | a {
19 | text-decoration: none;
20 | }
21 | `;
22 |
23 | export default header;
24 |
--------------------------------------------------------------------------------
/packages/default/src/styles/heading.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [768, 1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const heading = css`
8 | h1 {
9 | letter-spacing: -0.03em;
10 | margin-bottom: 1em;
11 | line-height: 1.1;
12 |
13 | ${mq({
14 | fontSize: ['2em', '2.4em', '2.8em'],
15 | })};
16 | }
17 | `;
18 |
19 | export default heading;
20 |
--------------------------------------------------------------------------------
/packages/default/src/styles/hero.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 | import { keyframes } from 'react-emotion';
4 |
5 | const breakpoints = [768, 1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const breath = keyframes`
9 | from {
10 | transform: scale(1);
11 | }
12 | 80% {
13 | transform: scale(1.2);
14 | }
15 | to {
16 | transform: scale(1);
17 | }
18 | `;
19 |
20 | const hero = css`
21 | align-items: center;
22 | display: flex;
23 | flex-direction: column;
24 | justify-content: center;
25 | padding: 0 10%;
26 | text-align: center;
27 |
28 | ${mq({
29 | minHeight: [
30 | 'calc(100vh - 300px)',
31 | 'calc(100vh - 280px)',
32 | 'calc(100vh - 220px)',
33 | ],
34 | })};
35 |
36 | h1 {
37 | line-height: 1;
38 | text-align: center;
39 | font-size: 2.2em;
40 | margin-bottom: 0.5em;
41 | letter-spacing: -0.03em;
42 |
43 | ${mq({
44 | fontSize: ['2.2em', '2.6em', '3em'],
45 | })};
46 | }
47 |
48 | img {
49 | max-width: 100%;
50 | margin: 20px 0;
51 | }
52 |
53 | a {
54 | align-items: center;
55 | background: #999;
56 | border-radius: 3px;
57 | color: #fff;
58 | display: flex;
59 | font-size: 1em;
60 | height: 2.4em;
61 | line-height: 1;
62 | text-decoration: none;
63 | text-transform: uppercase;
64 | padding: 0 2em;
65 | margin: 30px 0;
66 | animation: ${breath} 6s ease infinite;
67 | }
68 | `;
69 |
70 | export default hero;
71 |
--------------------------------------------------------------------------------
/packages/default/src/styles/layout.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const layout = css`
4 | padding: 15px 25px;
5 | background: blue;
6 | `;
7 |
8 | export default layout;
9 |
--------------------------------------------------------------------------------
/packages/default/src/styles/list.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const li = `
4 | li {
5 | border-bottom: 1px dotted #ddd;
6 |
7 | &:last-child {
8 | border-bottom: none;
9 | }
10 | }
11 | `;
12 |
13 | const list = css`
14 | ul {
15 | list-style: none;
16 | font-size: 1.3em;
17 | }
18 |
19 | ${li};
20 |
21 | a {
22 | text-decoration: none;
23 | padding: 0.6em 5px;
24 | position: relative;
25 | display: block;
26 | color: #666;
27 | }
28 | `;
29 |
30 | export default list;
31 |
--------------------------------------------------------------------------------
/packages/default/src/styles/menu.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [768, 1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const menu = css`
8 | flex-grow: 1;
9 | display: flex;
10 | align-items: center;
11 | z-index: 1;
12 | background: #fff;
13 | justify-content: center;
14 |
15 | ${mq({
16 | justifyContent: ['center', 'center', 'flex-end'],
17 | })};
18 |
19 | ul {
20 | list-style: none;
21 | display: flex;
22 | height: 44px;
23 | justify-content: center;
24 | }
25 |
26 | li {
27 | padding: 0 5px;
28 | line-height: 1;
29 |
30 | a {
31 | display: flex;
32 | height: 100%;
33 | justify-content: center;
34 | align-items: center;
35 | padding: 0 5px;
36 | color: var(--lightTextColor);
37 |
38 | &:hover {
39 | color: var(--hoverLinkColor);
40 | }
41 | }
42 |
43 | svg {
44 | margin: 0 3px 0 0;
45 |
46 | ${mq({
47 | height: ['20px', '30px', '40px'],
48 | })};
49 | }
50 | }
51 | `;
52 |
53 | export default menu;
54 |
--------------------------------------------------------------------------------
/packages/default/src/styles/meta.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const meta = css`
4 | margin: 0.5em 0 2em;
5 | font-size: 0.9em;
6 | color: var(--lightTextColor);
7 | display: flex;
8 |
9 | [class$='-blog'] & {
10 | margin-bottom: 1em;
11 | }
12 |
13 | & span {
14 | display: flex;
15 | align-items: center;
16 | line-height: 1;
17 | padding-right: 10px;
18 | }
19 |
20 | & svg {
21 | margin: 2px 5px 0 0;
22 | width: 16px;
23 | height: 16px;
24 | }
25 | `;
26 |
27 | export default meta;
28 |
--------------------------------------------------------------------------------
/packages/default/src/styles/nextPrev.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const nextPrev = css`
4 | display: flex;
5 | justify-content: space-between;
6 |
7 | & svg {
8 | width: 30px;
9 | height: 30px;
10 | margin: 0 10px;
11 | flex-shrink: 0;
12 | }
13 |
14 | & a {
15 | text-decoration: none;
16 | }
17 |
18 | & .next,
19 | & .prev {
20 | display: flex;
21 | flex-basis: 46%;
22 | }
23 |
24 | & .next {
25 | flex-direction: row-reverse;
26 | text-align: right;
27 | }
28 |
29 | & time {
30 | display: block;
31 | font-size: 0.9em;
32 | color: var(--lightTextColor);
33 | margin-top: 5px;
34 | }
35 | `;
36 |
37 | export default nextPrev;
38 |
--------------------------------------------------------------------------------
/packages/default/src/styles/page.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const page = css`
4 | display: block;
5 | `;
6 |
7 | export default page;
8 |
--------------------------------------------------------------------------------
/packages/default/src/styles/share.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const share = css`
4 | margin-bottom: 50px;
5 | `;
6 |
7 | export default share;
8 |
--------------------------------------------------------------------------------
/packages/default/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | import 'typeface-open-sans';
2 | import { injectGlobal } from 'emotion';
3 |
4 | const variables = injectGlobal`
5 | :root {
6 | --textColor: #555;
7 | --lightTextColor: #888;
8 | --superLightTextColor: #aaa;
9 | --fontFamily: "Open Sans", sans-serif;
10 |
11 | --linkColor: #a00;
12 | --hoverLinkColor: #d00;
13 |
14 | --scrollBarThumb: #eaeaea;
15 | --scrollBarTrack: #f9f9f9;
16 | --scrollBarWidth: 10px;
17 | }
18 | `;
19 |
20 | export default variables;
21 |
--------------------------------------------------------------------------------
/packages/job-interview/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/job-interview/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | src
--------------------------------------------------------------------------------
/packages/job-interview/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/job-interview/README.md:
--------------------------------------------------------------------------------
1 | # @react-website-themes/default
2 |
3 | # ...
4 |
5 | ### License
6 |
7 | MIT License
8 |
9 | Copyright (c) 2018 greg lobinski
10 |
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
12 | of this software and associated documentation files (the "Software"), to deal
13 | in the Software without restriction, including without limitation the rights
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 | copies of the Software, and to permit persons to whom the Software is
16 | furnished to do so, subject to the following conditions:
17 |
18 | The above copyright notice and this permission notice shall be included in all
19 | copies or substantial portions of the Software.
20 |
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 | SOFTWARE.
28 |
--------------------------------------------------------------------------------
/packages/job-interview/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/job-interview",
3 | "version": "0.0.4",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "lodash.debounce": "^4.0.8",
17 | "typeface-open-sans": "^0.0.54"
18 | },
19 | "peerDependencies": {
20 | "emotion": "^9.2.4",
21 | "emotion-server": "^9.2.6",
22 | "facepaint": "^1.2.1",
23 | "prop-types": "^15.6.0",
24 | "react": "^16.3.0",
25 | "react-custom-share": "^0.4.8",
26 | "react-dom": "^16.3.0",
27 | "react-emotion": "^9.2.6",
28 | "react-facebook": "^5.0.3",
29 | "react-helmet": "^5.2.0"
30 | },
31 | "devDependencies": {
32 | "@babel/cli": "7.0.0-rc.1",
33 | "@babel/core": "7.0.0-rc.1",
34 | "emotion": "^9.2.4",
35 | "emotion-server": "^9.2.6",
36 | "facepaint": "^1.2.1",
37 | "npm-run-all": "4.1.3",
38 | "prop-types": "^15.6.0",
39 | "react": "^16.3.0",
40 | "react-custom-share": "^0.4.8",
41 | "react-dom": "^16.3.0",
42 | "react-emotion": "^9.2.6",
43 | "react-facebook": "^5.0.3",
44 | "react-helmet": "^5.2.0",
45 | "rimraf": "^2.6.2"
46 | },
47 | "gitHead": "684c5c127f0f0fdabb6fc6b5cf01a8b0a7b8a27e"
48 | }
49 |
--------------------------------------------------------------------------------
/packages/job-interview/src/components/Screen.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/screen';
6 |
7 | const Credist = () => (
8 |
24 | );
25 |
26 | class Screen extends React.Component {
27 | screen = React.createRef();
28 |
29 | render() {
30 | const {
31 | id,
32 | children,
33 | customStyle = '',
34 | transitionClass,
35 | avatar,
36 | } = this.props;
37 |
38 | let { themeStyle = style } = this.props;
39 |
40 | themeStyle = themeStyle(this.props);
41 |
42 | return (
43 |
50 | {avatar && (
51 |
52 |
53 |
54 | )}
55 |
63 |
68 |
69 |
70 | {children}
71 | {id === 6 && }
72 |
73 |
74 | );
75 | }
76 | }
77 |
78 | Screen.propTypes = {
79 | id: PropTypes.number.isRequired,
80 | children: PropTypes.node.isRequired,
81 | transitionClass: PropTypes.string,
82 | superSizeScale: PropTypes.number.isRequired,
83 | exposedScreenId: PropTypes.number.isRequired,
84 | themeStyle: PropTypes.string,
85 | customStyle: PropTypes.string,
86 | avatar: PropTypes.string,
87 | socialLinks: PropTypes.array,
88 | };
89 |
90 | export default Screen;
91 |
--------------------------------------------------------------------------------
/packages/job-interview/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 | {/* */}
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const { data, facebook } = props;
32 | // const postTitle = ((data || {}).frontmatter || {}).title;
33 | // const postDescription = ((data || {}).frontmatter || {}).description;
34 | // const postCover = ((data || {}).frontmatter || {}).cover;
35 | // const postSlug = ((data || {}).fields || {}).slug;
36 |
37 | // const title = postTitle
38 | // ? `${postTitle} - ${config.shortSiteTitle}`
39 | // : config.siteTitle;
40 | // const description = postDescription
41 | // ? postDescription
42 | // : config.siteDescription;
43 | // const image = postCover ? postCover : config.siteImage;
44 | // const url = config.siteUrl + config.pathPrefix + postSlug;
45 | };
46 |
47 | Seo.propTypes = {
48 | language: PropTypes.string,
49 | url: PropTypes.string.isRequired,
50 | title: PropTypes.string.isRequired,
51 | description: PropTypes.string.isRequired,
52 | image: PropTypes.string,
53 | };
54 |
55 | export default Seo;
56 |
--------------------------------------------------------------------------------
/packages/job-interview/src/components/Social.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/social';
6 |
7 | const Social = props => {
8 | const { themeStyle = style, customStyle = '', links } = props;
9 |
10 | return (
11 |
12 | {links.map(link => {
13 | const { url, icon: Icon } = link;
14 | return (
15 |
16 |
17 |
18 | );
19 | })}
20 |
21 | );
22 | };
23 |
24 | Social.propTypes = {
25 | links: PropTypes.array.isRequired,
26 | themeStyle: PropTypes.string,
27 | customStyle: PropTypes.string,
28 | };
29 |
30 | export default Social;
31 |
--------------------------------------------------------------------------------
/packages/job-interview/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Author } from './components/Author';
4 | export { default as Bodytext } from './components/Bodytext';
5 | export { default as Blog } from './components/Blog';
6 | export { default as Branding } from './components/Branding';
7 | export { default as Comments } from './components/Comments';
8 | export { default as Footer } from './components/Footer';
9 | export { default as Heading } from './components/Heading';
10 | export { default as Header } from './components/Header';
11 | export { default as Hero } from './components/Hero';
12 | export { default as Layout } from './components/Layout';
13 | export { default as List } from './components/List';
14 | export { default as Menu } from './components/Menu';
15 | export { default as Meta } from './components/Meta';
16 | export { default as NextPrev } from './components/NextPrev';
17 | export { default as Page } from './components/Page';
18 | export { default as Seo } from './components/Seo';
19 | export { default as Share } from './components/Share';
20 | /* styles */
21 | export { default as article } from './styles/article';
22 | export { default as author } from './styles/author';
23 | export { default as blog } from './styles/blog';
24 | export { default as bodytext } from './styles/bodytext';
25 | export { default as branding } from './styles/branding';
26 | export { default as comments } from './styles/comments';
27 | export { default as footer } from './styles/footer';
28 | export { default as heading } from './styles/heading';
29 | export { default as header } from './styles/header';
30 | export { default as hero } from './styles/hero';
31 | export { default as layout } from './styles/layout';
32 | export { default as list } from './styles/list';
33 | export { default as menu } from './styles/menu';
34 | export { default as meta } from './styles/meta';
35 | export { default as nextPrev } from './styles/nextPrev';
36 | export { default as page } from './styles/page';
37 | export { default as share } from './styles/share';
38 | /* global */
39 | export { default as global } from './styles/global';
40 |
--------------------------------------------------------------------------------
/packages/job-interview/src/styles/global.js:
--------------------------------------------------------------------------------
1 | import { injectGlobal } from 'emotion';
2 |
3 | const global = injectGlobal`
4 | html {
5 | box-sizing: border-box;
6 | font-family: var(--fontFamily);
7 | font-size: 16px;
8 | }
9 |
10 | body {
11 | overflow-y: hidden;
12 | -webkit-tap-highlight-color: rgba(0,0,0,.05);
13 | }
14 |
15 | *,
16 | *:after,
17 | *:before {
18 | box-sizing: inherit;
19 | margin: 0;
20 | padding: 0;
21 | }
22 |
23 | `;
24 |
25 | export default global;
26 |
--------------------------------------------------------------------------------
/packages/job-interview/src/styles/screens.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const screens = css`
4 | .info {
5 | background: red;
6 | padding: 5px 10px;
7 | color: white;
8 | position: fixed;
9 | top: 0;
10 | left: 0;
11 | z-index: 1000;
12 | }
13 | `;
14 |
15 | export default screens;
16 |
--------------------------------------------------------------------------------
/packages/job-interview/src/styles/social.js:
--------------------------------------------------------------------------------
1 | import { css, keyframes } from 'emotion';
2 |
3 | const social = css`
4 | display: flex;
5 | justify-items: center;
6 | margin-top: 10px;
7 |
8 | a {
9 | display: flex;
10 | justify-content: center;
11 | align-items: center;
12 | width: 50px;
13 | height: 50px;
14 | border-radius: 50%;
15 | margin: 0 7px;
16 | transition: all 0.5s;
17 | }
18 |
19 | a:hover {
20 | background: var(--backgroundColor);
21 |
22 | svg {
23 | stroke: var(--accentColor);
24 | transform: scale(1.2);
25 | }
26 | }
27 |
28 | svg {
29 | transition: all 0.5s;
30 | stroke: var(--backgroundColor);
31 | }
32 | `;
33 |
34 | export default social;
35 |
--------------------------------------------------------------------------------
/packages/job-interview/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | import 'typeface-open-sans';
2 | import { injectGlobal } from 'emotion';
3 |
4 | const variables = injectGlobal`
5 | :root {
6 |
7 | --accentColor: #c00;
8 | --backgroundColor: #fff;
9 | --lastBackgroundColor: #333;
10 | --transitionBackgroundColor: #ddd;
11 |
12 | --textColor: #555;
13 | --brightTextColor: #aaa;
14 | --fontFamily: "Open Sans", Arial, sans-serif;
15 |
16 | --linkColor: #c00;
17 | --hoverLinkColor: #a00;
18 | --brightLinkColor: #ddd;
19 | }
20 | `;
21 |
22 | export default variables;
23 |
--------------------------------------------------------------------------------
/packages/side-blog/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [["../../.babelrc.js"]]
3 | }
4 |
--------------------------------------------------------------------------------
/packages/side-blog/.npmignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .babelrc
3 | src
--------------------------------------------------------------------------------
/packages/side-blog/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 greg lobinski
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/packages/side-blog/README.md:
--------------------------------------------------------------------------------
1 | # WIP
2 |
3 | ### License
4 |
5 | MIT License
6 |
7 | Copyright (c) 2018 greg lobinski
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in all
17 | copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | SOFTWARE.
26 |
--------------------------------------------------------------------------------
/packages/side-blog/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@react-website-themes/side-blog",
3 | "version": "0.0.9",
4 | "description": "",
5 | "main": "index.js",
6 | "publishConfig": {
7 | "access": "public"
8 | },
9 | "scripts": {
10 | "build": "rimraf index.js components styles store utils && babel src -d . --ignore /__tests__"
11 | },
12 | "keywords": [],
13 | "author": "greg lobinski (https://www.greglobinski.com/)",
14 | "license": "MIT",
15 | "dependencies": {
16 | "@react-website-themes/base": "^0.0.7",
17 | "typeface-open-sans": "^0.0.54",
18 | "typeface-pt-serif": "^0.0.54"
19 | },
20 | "peerDependencies": {
21 | "emotion": "^9.2.4",
22 | "emotion-server": "^9.2.6",
23 | "facepaint": "^1.2.1",
24 | "prop-types": "^15.6.0",
25 | "react": "^16.3.0",
26 | "react-custom-share": "^0.4.8",
27 | "react-dom": "^16.3.0",
28 | "react-emotion": "^9.2.6",
29 | "react-facebook": "^5.0.3",
30 | "react-helmet": "^5.2.0"
31 | },
32 | "devDependencies": {
33 | "@babel/cli": "7.0.0-rc.1",
34 | "@babel/core": "7.0.0-rc.1",
35 | "emotion": "^9.2.4",
36 | "emotion-server": "^9.2.6",
37 | "facepaint": "^1.2.1",
38 | "npm-run-all": "4.1.3",
39 | "prop-types": "^15.6.0",
40 | "react": "^16.3.0",
41 | "react-custom-share": "^0.4.8",
42 | "react-dom": "^16.3.0",
43 | "react-emotion": "^9.2.6",
44 | "react-facebook": "^5.0.3",
45 | "react-helmet": "^5.2.0",
46 | "rimraf": "^2.6.2"
47 | },
48 | "gitHead": "c7f95f929855c2ff35dbc4cf5a8ab2e8d0f84c8b"
49 | }
50 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Article.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import PropTypes from 'prop-types';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/article';
7 |
8 | class Article extends React.Component {
9 | state = {
10 | entryClass: '',
11 | };
12 |
13 | componentDidMount() {
14 | this.addEntryStyle();
15 | this.props.updateArticleRendered(true);
16 | }
17 |
18 | componentDidUpdate(prevProps, prevState) {
19 | const prevPath = prevProps.location.pathname;
20 | const path = this.props.location.pathname;
21 |
22 | if (prevPath !== path) {
23 | this.addEntryStyle();
24 | this.props.updateArticleRendered(true);
25 | }
26 | }
27 |
28 | addEntryStyle() {
29 | this.setState({
30 | entryClass: 'entry',
31 | });
32 |
33 | setTimeout(() => {
34 | this.setState({
35 | entryClass: '',
36 | });
37 | }, 500);
38 | }
39 |
40 | render() {
41 | const { children, themeStyle = style, customStyle = '' } = this.props;
42 |
43 | return (
44 |
47 | {children}
48 |
49 | );
50 | }
51 | }
52 |
53 | Article.propTypes = {
54 | children: PropTypes.node.isRequired,
55 | themeStyle: PropTypes.string,
56 | customStyle: PropTypes.string,
57 | location: PropTypes.object.isRequired,
58 | articleRendered: PropTypes.bool.isRequired,
59 | updateArticleRendered: PropTypes.func.isRequired,
60 | };
61 |
62 | export default Article;
63 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Author.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/author';
6 |
7 | const Author = props => {
8 | const {
9 | html,
10 | name = 'avatar',
11 | themeStyle = style,
12 | customStyle = '',
13 | avatar,
14 | } = props;
15 |
16 | return (
17 |
18 | {avatar &&
}
19 |
20 |
21 | );
22 | };
23 |
24 | Author.propTypes = {
25 | html: PropTypes.string,
26 | avatar: PropTypes.string,
27 | name: PropTypes.string,
28 | themeStyle: PropTypes.string,
29 | customStyle: PropTypes.string,
30 | };
31 |
32 | export default Author;
33 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Bodytext.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/bodytext';
4 | import BaseBodytext from '@react-website-themes/base/components/Bodytext';
5 |
6 | const Bodytext = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Bodytext;
13 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Branding.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/branding';
7 |
8 | const Branding = props => {
9 | const { title, subTitle, themeStyle = style, customStyle = '', logo } = props;
10 |
11 | return (
12 |
13 |
14 | {title}
15 | {subTitle}
16 |
17 | );
18 | };
19 |
20 | Branding.propTypes = {
21 | title: PropTypes.string,
22 | subTitle: PropTypes.string,
23 | logo: PropTypes.node,
24 | themeStyle: PropTypes.string,
25 | customStyle: PropTypes.string,
26 | };
27 |
28 | export default Branding;
29 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Comments.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import FacebookProvider, { Comments as FBComments } from 'react-facebook';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/comments';
7 |
8 | class Comments extends React.Component {
9 | state = {
10 | hidden: true,
11 | slug: this.props.slug,
12 | };
13 |
14 | static getDerivedStateFromProps(props, state) {
15 | if (props.slug !== state.slug) {
16 | return { hidden: true, slug: props.slug };
17 | }
18 | return null;
19 | }
20 |
21 | showWidget = e => {
22 | this.setState({
23 | hidden: false,
24 | });
25 | };
26 |
27 | render() {
28 | const {
29 | slug,
30 | siteUrl,
31 | appId,
32 | themeStyle = '',
33 | customStyle = style,
34 | colorScheme = 'light',
35 | onDemand = false,
36 | onDemandLabel = 'Would you like to add a comment?',
37 | icons: { message: Icon },
38 | } = this.props;
39 |
40 | return (
41 |
42 | {this.state.hidden && (
43 |
44 | {onDemandLabel} {Icon && }
45 |
46 | )}
47 | {!this.state.hidden && (
48 |
49 |
54 |
55 | )}
56 |
57 | );
58 | }
59 | }
60 |
61 | Comments.propTypes = {
62 | slug: PropTypes.string.isRequired,
63 | siteUrl: PropTypes.string.isRequired,
64 | appId: PropTypes.string.isRequired,
65 | themeStyle: PropTypes.string,
66 | customStyle: PropTypes.string,
67 | colorScheme: PropTypes.string,
68 | onDemand: PropTypes.bool,
69 | onDemandLabel: PropTypes.string,
70 | icons: PropTypes.object,
71 | };
72 |
73 | export default Comments;
74 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/FilterInfo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/filterInfo';
6 |
7 | const FilterInfo = props => {
8 | function isApplied(item) {}
9 |
10 | const {
11 | appliedFilters,
12 | onClick,
13 | themeStyle = style,
14 | customStyle = '',
15 | icons,
16 | icons: { close: CloseIcon },
17 | } = props;
18 |
19 | const filters = Object.keys(appliedFilters)
20 | .map(key => ({ group: key, value: appliedFilters[key] }))
21 | .filter(item => item.value !== null);
22 |
23 | return filters.length ? (
24 |
25 |
Applied filters:
26 |
27 | {filters.map(item => {
28 | const { group, value } = item;
29 | const Icon = icons[group];
30 |
31 | return (
32 |
39 |
45 |
46 | {value}
47 |
48 |
49 |
50 |
51 |
52 |
53 | );
54 | })}
55 |
56 |
57 | ) : null;
58 | };
59 |
60 | FilterInfo.propTypes = {
61 | appliedFilters: PropTypes.object.isRequired,
62 | onClick: PropTypes.func.isRequired,
63 | themeStyle: PropTypes.string,
64 | customStyle: PropTypes.string,
65 | icons: PropTypes.object,
66 | };
67 |
68 | export default FilterInfo;
69 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/FilterSwitcher.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/filterSwitcher';
6 |
7 | const FilterSwitcher = props => {
8 | const {
9 | filterName,
10 | themeStyle = style,
11 | activeFilterGroup,
12 | customStyle = '',
13 | onClick,
14 | icons: { group: GroupIcon, close: CloseIcon },
15 | } = props;
16 |
17 | return (
18 |
28 | {activeFilterGroup === filterName ? : }
29 |
30 | );
31 | };
32 |
33 | // activeFilterGroup === filterName ? `var(--${filterName}Color)` : '',
34 |
35 | FilterSwitcher.propTypes = {
36 | filterName: PropTypes.string.isRequired,
37 | appliedFilters: PropTypes.object.isRequired,
38 | onClick: PropTypes.func.isRequired,
39 | icons: PropTypes.object.isRequired,
40 | activeFilterGroup: PropTypes.string,
41 | themeStyle: PropTypes.string,
42 | customStyle: PropTypes.string,
43 | };
44 |
45 | export default FilterSwitcher;
46 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/FilterWidget.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/filterWidget';
6 |
7 | const FilterWidget = props => {
8 | const {
9 | onClick,
10 | items = [],
11 | appliedFilters,
12 | group = '',
13 | themeStyle = style,
14 | customStyle = '',
15 | icons: { check: CheckIcon },
16 | } = props;
17 |
18 | return (
19 |
25 | {group && (
26 |
27 | Filter posts by » {group}
28 |
29 | )}
30 | {items.length > 0 && (
31 |
32 | {items.map(item => {
33 | const { value, label, postsNumber } = item;
34 | const isApplied = appliedFilters[group] === value;
35 | return (
36 |
43 |
44 | {label}
45 |
46 | {isApplied ? : postsNumber}
47 |
48 |
49 |
50 | );
51 | })}
52 |
53 | )}
54 |
55 | );
56 | };
57 |
58 | FilterWidget.propTypes = {
59 | onClick: PropTypes.func.isRequired,
60 | appliedFilters: PropTypes.object.isRequired,
61 | icons: PropTypes.object.isRequired,
62 | items: PropTypes.array,
63 | group: PropTypes.string,
64 | themeStyle: PropTypes.string,
65 | customStyle: PropTypes.string,
66 | };
67 |
68 | export default FilterWidget;
69 |
70 | /* {isApplied ? : postsNumber} */
71 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/footer';
4 | import BaseFooter from '@react-website-themes/base/components/Footer';
5 |
6 | const Footer = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Footer;
13 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Heading.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/heading';
6 |
7 | const Heading = props => {
8 | const {
9 | title,
10 | children,
11 | themeStyle = style,
12 | customStyle = '',
13 | special = false,
14 | } = props;
15 |
16 | return (
17 |
20 | {title ? {title} : children}
21 |
22 | );
23 | };
24 |
25 | Heading.propTypes = {
26 | title: PropTypes.string,
27 | children: PropTypes.node,
28 | themeStyle: PropTypes.string,
29 | customStyle: PropTypes.string,
30 | special: PropTypes.bool,
31 | };
32 |
33 | export default Heading;
34 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Layout.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/layout';
6 |
7 | const Layout = props => {
8 | const { children, themeStyle = style, customStyle = '' } = props;
9 |
10 | return {children}
;
11 | };
12 |
13 | Layout.propTypes = {
14 | children: PropTypes.node.isRequired,
15 | themeStyle: PropTypes.string,
16 | customStyle: PropTypes.string,
17 | };
18 |
19 | export default Layout;
20 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/List.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 | import dayjs from 'dayjs';
6 |
7 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
8 | import style from '../styles/list';
9 |
10 | const List = props => {
11 | const { items, themeStyle = style, customStyle = '', icon: Icon } = props;
12 |
13 | return (
14 |
15 |
16 | {items.map(item => {
17 | const {
18 | frontmatter: { title },
19 | fields: { slug, prefix },
20 | } = item;
21 |
22 | const dateTimeString = prefixToDateTimeString(prefix);
23 |
24 | return (
25 |
26 |
27 |
28 |
29 | {`${dayjs(dateTimeString).format('dddd')} at ${dayjs(
30 | dateTimeString
31 | ).format('h:mm a')}, ${dayjs(dateTimeString).format(
32 | 'MMMM D, YYYY'
33 | )}`}
34 |
35 | {title}
36 |
37 |
38 | );
39 | })}
40 |
41 |
42 | );
43 | };
44 |
45 | List.propTypes = {
46 | items: PropTypes.array.isRequired,
47 | themeStyle: PropTypes.string,
48 | customStyle: PropTypes.string,
49 | icon: PropTypes.func,
50 | };
51 |
52 | export default List;
53 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Menu.js:
--------------------------------------------------------------------------------
1 | import PropTypes from 'prop-types';
2 | import React from 'react';
3 | import { Link } from 'gatsby';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/menu';
7 |
8 | const Menu = props => {
9 | const {
10 | items,
11 | themeStyle = style,
12 | customStyle = '',
13 | actionIcons: {
14 | calendar: CalendarIcon = null,
15 | toTop: ToTopIcon = null,
16 | } = {},
17 | } = props;
18 |
19 | function scrollTop(e) {
20 | window.scroll({
21 | top: 0,
22 | left: 0,
23 | behavior: 'smooth',
24 | });
25 | e.currentTarget.blur();
26 | }
27 |
28 | return (
29 |
30 |
31 | {items.map(item => {
32 | const { label, to, icon: Icon, external, linkProps } = item;
33 |
34 | return (
35 |
36 | {external ? (
37 |
38 | {Icon && }
39 | {label}
40 |
41 | ) : (
42 |
43 | {Icon && }
44 | {label}
45 |
46 | )}
47 |
48 | );
49 | })}
50 |
51 | {CalendarIcon && (
52 |
53 |
54 |
55 | )}
56 | {ToTopIcon && (
57 |
58 |
59 |
60 | )}
61 |
62 | );
63 | };
64 |
65 | Menu.propTypes = {
66 | items: PropTypes.array.isRequired,
67 | themeStyle: PropTypes.string,
68 | customStyle: PropTypes.string,
69 | actionIcons: PropTypes.object,
70 | };
71 |
72 | export default Menu;
73 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Meta.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 | import parse from 'date-fns/parse';
6 | import format from 'date-fns/format';
7 |
8 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
9 | import style from '../styles/meta';
10 |
11 | const Meta = props => {
12 | const {
13 | prefix,
14 | categories,
15 | tags,
16 | themeStyle = style,
17 | customStyle = '',
18 | icons: { calendar: CalendarIcon, tag: TagIcon, folder: FolderIcon },
19 | } = props;
20 |
21 | const dateString = prefixToDateTimeString(prefix);
22 | const date = parse(dateString);
23 |
24 | return (
25 |
26 |
27 | {CalendarIcon && } {format(date, 'MMMM D, YYYY')}
28 |
29 | {categories && (
30 |
31 | {FolderIcon && }
32 | {categories.map((category, idx) => {
33 | return `${idx ? ', ' : ''}${category}`;
34 | })}
35 |
36 | )}
37 | {tags && (
38 |
39 | {TagIcon && }
40 | {tags.map((tag, idx) => {
41 | return `${idx ? ', ' : ''}${tag}`;
42 | })}
43 |
44 | )}
45 |
46 | );
47 | };
48 |
49 | Meta.propTypes = {
50 | themeStyle: PropTypes.string,
51 | customStyle: PropTypes.string,
52 | prefix: PropTypes.string,
53 | categories: PropTypes.array,
54 | author: PropTypes.string,
55 | icons: PropTypes.object,
56 | };
57 |
58 | export default Meta;
59 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/NextPrev.js:
--------------------------------------------------------------------------------
1 | import { Link } from 'gatsby';
2 | import PropTypes from 'prop-types';
3 | import React from 'react';
4 | import { cx } from 'emotion';
5 | import parse from 'date-fns/parse';
6 | import format from 'date-fns/format';
7 |
8 | import prefixToDateTimeString from '../utils/prefixToDateTimeString';
9 | import style from '../styles/nextPrev';
10 |
11 | const NextPrev = props => {
12 | const {
13 | themeStyle = style,
14 | customStyle = '',
15 | icons: { next: NextIcon, prev: PrevIcon },
16 | next: {
17 | fields: { prefix: nextPrefix, slug: nextSlug } = {},
18 | frontmatter: { title: nextTitle } = {},
19 | } = {},
20 | prev: {
21 | fields: { prefix: prevPrefix, slug: prevSlug } = {},
22 | frontmatter: { title: prevTitle } = {},
23 | } = {},
24 | timeOffset,
25 | } = props;
26 |
27 | const prevDateString = prevPrefix ? prefixToDateTimeString(prevPrefix) : null;
28 | const nextDateString = nextPrefix ? prefixToDateTimeString(nextPrefix) : null;
29 |
30 | const prevDate = parse(prevDateString);
31 | const nextDate = parse(nextDateString);
32 |
33 | return (
34 |
35 | {prevSlug && (
36 |
37 | {PrevIcon &&
}
38 |
39 | {prevTitle} {format(prevDate, 'dddd, MMMM D, YYYY')}
40 |
41 |
42 | )}
43 | {nextSlug && (
44 |
45 | {NextIcon &&
}
46 |
47 | {nextTitle} {format(nextDate, 'dddd, MMMM D, YYYY')}
48 |
49 |
50 | )}
51 |
52 | );
53 | };
54 |
55 | NextPrev.propTypes = {
56 | next: PropTypes.object,
57 | prev: PropTypes.object,
58 | themeStyle: PropTypes.string,
59 | icons: PropTypes.object,
60 | customStyle: PropTypes.string,
61 | };
62 |
63 | export default NextPrev;
64 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Page.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | import style from '../styles/page';
4 | import BasePage from '@react-website-themes/base/components/Page';
5 |
6 | const Page = props => {
7 | const { themeStyle = style, ...rest } = props;
8 |
9 | return ;
10 | };
11 |
12 | export default Page;
13 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Seo.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import Helmet from 'react-helmet';
4 |
5 | const Seo = props => {
6 | const { url, language = 'en', title, description, image } = props;
7 |
8 | return (
9 |
12 | {/* General tags */}
13 | {title}
14 |
15 | {/* OpenGraph tags */}
16 |
17 |
18 |
19 |
20 |
21 |
22 | {/* Twitter Card tags */}
23 |
24 | {/* */}
28 |
29 | );
30 |
31 | // const title = postTitle
32 | // ? `${postTitle} - ${config.shortSiteTitle}`
33 | // : config.siteTitle;
34 | // const description = postDescription
35 | // ? postDescription
36 | // : config.siteDescription;
37 | // const image = postCover ? postCover : config.siteImage;
38 | // const url = config.siteUrl + config.pathPrefix + postSlug;
39 | };
40 |
41 | Seo.propTypes = {
42 | language: PropTypes.string,
43 | url: PropTypes.string.isRequired,
44 | title: PropTypes.string.isRequired,
45 | description: PropTypes.string.isRequired,
46 | image: PropTypes.string,
47 | };
48 |
49 | export default Seo;
50 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/Share.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { ShareBlockStandard } from 'react-custom-share';
4 | import { cx } from 'emotion';
5 |
6 | import style from '../styles/share';
7 |
8 | const PostShare = props => {
9 | const { themeStyle = style, customStyle = '', shareBlockProps } = props;
10 |
11 | return (
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | PostShare.propTypes = {
19 | themeStyle: PropTypes.string,
20 | customStyle: PropTypes.string,
21 | shareBlockProps: PropTypes.object,
22 | };
23 |
24 | export default PostShare;
25 |
--------------------------------------------------------------------------------
/packages/side-blog/src/components/ToTop.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import PropTypes from 'prop-types';
3 | import { cx } from 'emotion';
4 |
5 | import style from '../styles/toTop';
6 |
7 | const ToTop = props => {
8 | function onClick(e) {
9 | if (
10 | document.body.scrollTop !== 0 ||
11 | document.documentElement.scrollTop !== 0
12 | ) {
13 | window.scrollBy(0, -150);
14 | requestAnimationFrame(onClick);
15 | }
16 | }
17 |
18 | const {
19 | themeStyle = '',
20 | customStyle = style,
21 | icons: { arrow: ArrowIcon },
22 | sideOnMobileExposed,
23 | } = props;
24 |
25 | return (
26 |
33 |
34 |
35 |
36 |
37 | );
38 | };
39 |
40 | ToTop.propTypes = {
41 | themeStyle: PropTypes.string,
42 | customStyle: PropTypes.string,
43 | icons: PropTypes.object.isRequired,
44 | sideOnMobileExposed: PropTypes.bool.isRequired,
45 | };
46 |
47 | export default ToTop;
48 |
--------------------------------------------------------------------------------
/packages/side-blog/src/index.js:
--------------------------------------------------------------------------------
1 | /* components */
2 | export { default as Article } from './components/Article';
3 | export { default as Author } from './components/Author';
4 | export { default as Bodytext } from './components/Bodytext';
5 | export { default as Blog } from './components/Blog';
6 | export { default as Branding } from './components/Branding';
7 | export { default as Comments } from './components/Comments';
8 | export { default as Footer } from './components/Footer';
9 | export { default as Heading } from './components/Heading';
10 | export { default as Header } from './components/Header';
11 | export { default as Hero } from './components/Hero';
12 | export { default as Layout } from './components/Layout';
13 | export { default as List } from './components/List';
14 | export { default as Menu } from './components/Menu';
15 | export { default as Meta } from './components/Meta';
16 | export { default as NextPrev } from './components/NextPrev';
17 | export { default as Page } from './components/Page';
18 | export { default as Seo } from './components/Seo';
19 | export { default as Share } from './components/Share';
20 | /* styles */
21 | export { default as article } from './styles/article';
22 | export { default as author } from './styles/author';
23 | export { default as blog } from './styles/blog';
24 | export { default as bodytext } from './styles/bodytext';
25 | export { default as branding } from './styles/branding';
26 | export { default as comments } from './styles/comments';
27 | export { default as footer } from './styles/footer';
28 | export { default as heading } from './styles/heading';
29 | export { default as header } from './styles/header';
30 | export { default as hero } from './styles/hero';
31 | export { default as layout } from './styles/layout';
32 | export { default as list } from './styles/list';
33 | export { default as menu } from './styles/menu';
34 | export { default as meta } from './styles/meta';
35 | export { default as nextPrev } from './styles/nextPrev';
36 | export { default as page } from './styles/page';
37 | export { default as share } from './styles/share';
38 | /* global */
39 | export { default as global } from './styles/global';
40 |
--------------------------------------------------------------------------------
/packages/side-blog/src/store/Context.js:
--------------------------------------------------------------------------------
1 | // Context.js
2 | import React from 'react';
3 |
4 | const defaultContextValue = {
5 | data: {
6 | sideOnMobileExposed: false,
7 | articleRendered: false,
8 | },
9 | set: () => {},
10 | };
11 |
12 | const { Provider, Consumer } = React.createContext(defaultContextValue);
13 |
14 | class ContextProviderComponent extends React.Component {
15 | constructor() {
16 | super();
17 |
18 | this.setData = this.setData.bind(this);
19 | this.state = {
20 | ...defaultContextValue,
21 | set: this.setData,
22 | };
23 | }
24 |
25 | setData(newData) {
26 | this.setState(state => ({
27 | data: {
28 | ...state.data,
29 | ...newData,
30 | },
31 | }));
32 | }
33 |
34 | render() {
35 | return {this.props.children} ;
36 | }
37 | }
38 |
39 | export { Consumer as default, ContextProviderComponent };
40 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/article.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import { keyframes } from 'react-emotion';
3 | import facepaint from 'facepaint';
4 |
5 | const breakpoints = [1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const entry = keyframes`
9 | from {
10 | opacity: 0;
11 | transform: translateY(30px)
12 | }
13 |
14 | to {
15 | opacity: 1
16 | transform: translateY(0)
17 | }
18 | `;
19 |
20 | const article = css`
21 | overflow-x: hidden;
22 | padding: 5% 0 0;
23 | min-height: 100vh;
24 |
25 | &.entry {
26 | ${mq({
27 | animation: ['', `${entry} var(--transitionTime) ease 1`],
28 | animationFillMode: ['', 'forwards'],
29 | })};
30 | }
31 | `;
32 |
33 | export default article;
34 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/author.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const author = css`
8 | line-height: 1.7;
9 | font-size: 1em;
10 | display: flex;
11 | max-width: var(--textMaxWidth);
12 | margin: var(--spaceXL) auto;
13 | padding-top: ;
14 | border-top: 1px dotted #ddd;
15 |
16 | ${mq({
17 | padding: [
18 | 'calc(var(--spaceXXL) * 1.5) var(--spaceXL) var(--spaceXL)',
19 | 'calc(var(--spaceXXL) * 1.5) var(--spaceXXL) var(--spaceXL)',
20 | ],
21 | })};
22 |
23 | .avatar {
24 | width: 60px;
25 | height: 60px;
26 | margin: 0.4em var(--spaceXL) 0 0;
27 | }
28 | `;
29 |
30 | export default author;
31 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/branding.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | import facepaint from 'facepaint';
4 |
5 | const breakpoints = [768, 1024];
6 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
7 |
8 | const branding = css`
9 | align-items: center;
10 | display: flex;
11 | flex-direction: column;
12 | flex-grow: 0;
13 | align-items: center;
14 | justify-content: center;
15 |
16 | img {
17 | margin: 0 0 10px;
18 | width: 40px;
19 |
20 | ${mq({
21 | width: ['30px', '40px', '50px'],
22 | })};
23 | }
24 |
25 | h1 {
26 | color: var(--textColor);
27 | text-align: center;
28 | line-height: 1.1;
29 | margin-bottom: 0.2em;
30 | text-transform: uppercase;
31 | ${mq({
32 | fontSize: ['1.4em', '1.6em', '1.8em'],
33 | })};
34 | }
35 |
36 | p {
37 | font-size: 1em;
38 | font-family: var(--firstFontFamily);
39 | letter-spacing: -0.01em;
40 | }
41 |
42 | a {
43 | }
44 | `;
45 |
46 | export default branding;
47 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/comments.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const comments = css`
8 | border-top: 1px dashed var(--brightColor);
9 | background: var(--commentsBgColor);
10 | min-height: 140px;
11 |
12 | ${mq({
13 | padding: ['var(--spaceXL)', 'var(--spaceXL) var(--spaceXXL)'],
14 | })};
15 |
16 | .demand {
17 | width: 100%;
18 | margin: var(--spaceXL) auto;
19 | display: flex;
20 | justify-content: center;
21 | align-items: center;
22 | background: none;
23 | border: 0;
24 | font-size: 1.2em;
25 | cursor: pointer;
26 | color: var(--textColor);
27 | border-radius: var(--radius);
28 | transition: all var(--transitionTime);
29 | line-height: 1.2;
30 |
31 | svg {
32 | width: 40px;
33 | height: 40px;
34 | margin: var(--spaceL);
35 | stroke: var(--linkColor);
36 | transition: all var(--transitionTime);
37 | flex-shrink: 0;
38 | flex-grow: 0;
39 | }
40 |
41 | @media (hover: hover) {
42 | &:hover {
43 | svg {
44 | stroke: var(--accentColor);
45 | }
46 | }
47 | }
48 | }
49 | `;
50 |
51 | export default comments;
52 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/filterInfo.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const filtersInfo = css`
4 | padding: var(--spaceL) var(--spaceL) var(--spaceL);
5 | border-bottom: 1px dashed var(--sidebarLineColor);
6 | background: var(--sidebarSwitchBgColor);
7 |
8 | .title {
9 | color: var(--brightColor);
10 | padding: 0 var(--spaceM) var(--spaceS);
11 | font-size: 0.8em;
12 | letter-spacing: 0.3em;
13 | text-transform: uppercase;
14 | color: var(--colorF);
15 | margin-top: -2px;
16 | }
17 |
18 | & li {
19 | display: flex;
20 | justify-content: space-between;
21 | align-items: center;
22 | }
23 |
24 | .item {
25 | border: 0;
26 | background: transparent;
27 | cursor: pointer;
28 | margin: 0;
29 | padding: calc(var(--spaceS) * 1.5);
30 |
31 | @media (hover: hover) {
32 | &:hover {
33 | .sign {
34 | background: rgba(255, 255, 255, 1);
35 | color: var(--textColor);
36 | }
37 | }
38 | }
39 | }
40 |
41 | .wrapper {
42 | display: flex;
43 | height: 32px;
44 | border-radius: var(--radius);
45 | }
46 |
47 | .value,
48 | .sign {
49 | color: var(--brightColor);
50 | display: flex;
51 | align-items: center;
52 | transition: all var(--transitionTime);
53 | }
54 |
55 | .value {
56 | border-radius: var(--radius) 0 0 var(--radius);
57 | padding: 0 10px;
58 | font-size: 1.1em;
59 | line-height: 1;
60 |
61 | svg {
62 | width: 15px;
63 | height: 15px;
64 | margin: -1px var(--spaceS) 0 0;
65 | }
66 | }
67 |
68 | .sign {
69 | border-radius: 0 var(--radius) var(--radius);
70 | margin-left: 1px;
71 | font-weight: 700;
72 | font-size: 1.3em;
73 | padding: 0 6px;
74 | background: rgba(255, 255, 255, 0.1);
75 |
76 | svg {
77 | stroke: var(--accentColor);
78 | width: 18px;
79 | height: 18px;
80 | stroke-width: 4;
81 | }
82 | }
83 | `;
84 |
85 | export default filtersInfo;
86 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/filterSwitcher.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import { keyframes } from 'react-emotion';
3 |
4 | const entry = keyframes`
5 | from {
6 | transform: scale(0);
7 | }
8 |
9 | to {
10 | transform: scale(1);
11 | }
12 | `;
13 |
14 | const filterSwitcher = css`
15 | display: flex;
16 | background: var(--sidebarSwitchBgColor);
17 | border: none;
18 | flex-shrink: 0;
19 | flex-grow: 1;
20 | width: var(--barHeight);
21 | cursor: pointer;
22 | justify-content: center;
23 | align-items: center;
24 | transition: var(--transitionTime) ease;
25 |
26 | & svg {
27 | stroke: white;
28 | animation: ${entry} var(--transitionTime) ease 1;
29 | animation-fill-mode: forwards;
30 | }
31 | `;
32 |
33 | export default filterSwitcher;
34 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/footer.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const footer = css`
8 | border-top: 1px dashed var(--brightColor);
9 | background: var(--footerBgColor);
10 | display: flex;
11 | flex-direction: column;
12 | font-size: 0.9em;
13 | padding: calc(var(--spaceXL) * 2);
14 |
15 | ${mq({
16 | paddingBottom: ['calc(var(--spaceXL) * 5)', 'calc(var(--spaceXL) * 2)'],
17 | })};
18 |
19 | .links ul {
20 | list-style: none;
21 | color: var(--textColor);
22 | display: flex;
23 | justify-content: center;
24 | flex-wrap: wrap;
25 | line-height: 1.1;
26 | }
27 |
28 | .links a {
29 | text-decoration: none;
30 | color: var(--textColor);
31 | font-weight: bold;
32 | }
33 |
34 | .links li {
35 | text-align: center;
36 | margin: var(--spaceXS) var(--spaceM);
37 | position: relative;
38 | line-height: 1.2;
39 | }
40 |
41 | .copyright {
42 | font-size: 0.9em;
43 | color: var(--lightTextColor);
44 | text-align: center;
45 | margin: var(--spaceM) 0;
46 | }
47 |
48 | .credits {
49 | font-size: 0.8em;
50 | color: var(--lightTextColor);
51 | margin: var(--spaceXL) 0 0;
52 | text-align: center;
53 |
54 | & a {
55 | text-decoration: none;
56 | color: var(--lightTextColor);
57 | }
58 | }
59 | `;
60 |
61 | export default footer;
62 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/global.js:
--------------------------------------------------------------------------------
1 | import { injectGlobal } from 'emotion';
2 |
3 | const global = injectGlobal`
4 | html {
5 | box-sizing: border-box;
6 | font-family: var(--firstFontFamily);
7 | font-size: 16px;
8 | color: #666;
9 | }
10 |
11 | .main:focus {
12 | background: red;
13 | }
14 |
15 | body {
16 | background: var(--bodyBgColor);
17 | }
18 |
19 | *,
20 | *:after,
21 | *:before {
22 | box-sizing: inherit;
23 | margin: 0;
24 | padding: 0;
25 | }
26 |
27 | p {
28 | color: var(--textColor);
29 | }
30 |
31 | h1 {
32 | font-size: 2.4em;
33 | }
34 |
35 | h2 {
36 | font-size: 1.8em;
37 | }
38 |
39 | ul {
40 | list-style-position: inside;
41 | }
42 |
43 | a {
44 | color: var(--linkColor);
45 | transition: .3s;
46 | }
47 |
48 | @media (hover: hover) {
49 | a:hover {
50 | color: var(--hoverLinkColor);
51 | }
52 |
53 | *::-webkit-scrollbar {
54 | width: var(--scrollBarWidth);
55 | }
56 | *::-webkit-scrollbar-track {
57 | background: var(--scrollBarTrack);
58 | }
59 | *::-webkit-scrollbar-thumb {
60 | background-color: var(--scrollBarThumb);
61 | }
62 | }
63 |
64 | button {
65 | font-family: var(--firstFontFamily);
66 | }
67 |
68 | `;
69 |
70 | export default global;
71 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/heading.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const heading = css`
8 | h1 {
9 | max-width: var(--textMaxWidth);
10 | letter-spacing: -0.04em;
11 | margin: 0 auto var(--spaceXXL);
12 | line-height: 1.1;
13 | color: var(--headingColor);
14 |
15 | ${mq({
16 | fontSize: ['2em', '2.3em', '2.6em'],
17 | padding: ['0 var(--spaceXL)', '0 var(--spaceXXL)'],
18 | })};
19 |
20 | small {
21 | font-size: 0.4em;
22 | display: block;
23 | font-weight: 300;
24 | letter-spacing: 0.3em;
25 | text-transform: uppercase;
26 | margin: 0.5em 0;
27 | }
28 |
29 | span {
30 | font-size: 0.5em;
31 | display: block;
32 | font-weight: 300;
33 | letter-spacing: 0;
34 | margin: 0.5em 0;
35 | }
36 | }
37 |
38 | &.special {
39 | text-align: center;
40 | margin-top: 2em;
41 |
42 | h1 {
43 | letter-spacing: -0.05em;
44 |
45 | ${mq({
46 | fontSize: ['2.5em', '2.8em', '3.2em'],
47 | })};
48 | }
49 | }
50 | `;
51 |
52 | export default heading;
53 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/layout.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const layout = css`
8 | main {
9 | ${mq({
10 | marginLeft: [0, 'var(--desktopSidebarWidth)'],
11 | width: ['100%', 'auto'],
12 | })};
13 | }
14 | `;
15 |
16 | export default layout;
17 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/list.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const list = css`
4 | ul {
5 | list-style: none;
6 |
7 | margin: 40px 0;
8 | }
9 |
10 | li {
11 | font-size: 1.5em;
12 | text-align: center;
13 | line-height: 1.2;
14 | margin-bottom: 20px;
15 | }
16 |
17 | time {
18 | font-family: var(--firstFontFamily);
19 | font-size: 0.6em;
20 | color: var(--brandColor);
21 | display: flex;
22 | justify-content: center;
23 | align-items: center;
24 | margin-bottom: 4px;
25 |
26 | & svg {
27 | width: 14px;
28 | margin-right: 5px;
29 | stroke: var(--accentColor);
30 | }
31 | }
32 |
33 | a {
34 | text-decoration: none;
35 | padding: 0.6em 5px;
36 | position: relative;
37 | display: block;
38 | color: var(--textColor);
39 |
40 | @media (any-hover: hover) {
41 | &:hover {
42 | color: var(--hoverLinkColor);
43 | }
44 | }
45 | }
46 | `;
47 |
48 | export default list;
49 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/meta.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const meta = css`
8 | max-width: var(--textMaxWidth);
9 | margin: 0 auto var(--spaceXXL);
10 | font-size: 0.9em;
11 | color: var(--headingColor);
12 | display: flex;
13 | flex-direction: column;
14 | font-family: var(--firstFontFamily);
15 | align-items: flex-start;
16 |
17 | ${mq({
18 | padding: ['0 var(--spaceXL)', '0 var(--spaceXXL)'],
19 | })};
20 |
21 | & span {
22 | padding: var(--spaceXS) 0;
23 | display: flex;
24 | align-items: center;
25 | margin-bottom: var(--spaceS);
26 | }
27 |
28 | & svg {
29 | margin: 0 var(--spaceS) 0 0;
30 | width: 16px;
31 | height: 16px;
32 | stroke: var(--accentColor);
33 | }
34 | `;
35 |
36 | export default meta;
37 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/nextPrev.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [768];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const nextPrev = css`
8 | background: var(--nextPrevBgColor);
9 | display: flex;
10 | flex-direction: column;
11 | font-size: 1.2em;
12 | line-height: 1.2;
13 | position: relative;
14 |
15 | ${mq({
16 | flexDirection: ['column', 'row'],
17 | })};
18 |
19 | & svg {
20 | width: 30px;
21 | height: 30px;
22 | flex-shrink: 0;
23 | }
24 |
25 | & a {
26 | text-decoration: none;
27 | }
28 |
29 | & .next,
30 | & .prev {
31 | display: flex;
32 | flex-grow: 0;
33 | flex-shrink: 0;
34 | flex-basis: 50%;
35 | padding: 20px;
36 |
37 | & > svg {
38 | flex-grow: 0;
39 | }
40 | }
41 |
42 | & .prev {
43 | ${mq({
44 | borderRight: [0, '1px dashed var(--brightColor)'],
45 | borderBottom: ['1px dashed var(--brightColor)', 0],
46 | })};
47 |
48 | & > svg {
49 | margin-right: 10px;
50 | }
51 | }
52 |
53 | & .next {
54 | margin-right: 1px;
55 | flex-direction: row-reverse;
56 | text-align: right;
57 |
58 | & > svg {
59 | margin-left: 10px;
60 | }
61 | }
62 |
63 | & time {
64 | display: block;
65 | font-size: 0.65em;
66 | font-family: var(--firstFontFamily);
67 | color: var(--lightTextColor);
68 | margin-top: 6px;
69 | }
70 | `;
71 |
72 | export default nextPrev;
73 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/page.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const page = css`
4 | display: block;
5 | `;
6 |
7 | export default page;
8 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/pagination.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const pagination = css`
4 | padding: 40px 0;
5 | font-family: var(--firstFontFamily);
6 | display: flex;
7 | justify-content: center;
8 |
9 | ul {
10 | display: inline-flex;
11 | justify-content: center;
12 | list-style: none;
13 | margin: 0;
14 | padding: 0;
15 | }
16 |
17 | li {
18 | border-top: 1px solid var(--brandColor);
19 | border-bottom: 1px solid var(--brandColor);
20 | border-right: 1px solid #ddd;
21 |
22 | &:last-child,
23 | &:first-child {
24 | border: 1px solid var(--brandColor);
25 | }
26 |
27 | &:first-child {
28 | border-radius: var(--radius) 0 0 var(--radius);
29 | border-right: 1px solid #ddd;
30 |
31 | &.no-onestep {
32 | border-right: 2px dotted var(--brandColor);
33 | }
34 | }
35 |
36 | &:last-child {
37 | border-radius: 0 var(--radius) var(--radius) 0;
38 | border-left: 1px solid #ddd;
39 |
40 | &.no-onestep {
41 | border-left: 2px dotted var(--brandColor);
42 | }
43 | }
44 |
45 | &:nth-last-child(2) {
46 | border-right: none;
47 | }
48 | }
49 |
50 | svg {
51 | width: 20px;
52 | }
53 |
54 | a {
55 | display: flex;
56 | justify-content: center;
57 | align-items: center;
58 | text-decoration: none;
59 | height: 44px;
60 | min-width: 40px;
61 |
62 | &.active {
63 | color: white;
64 | font-weight: 700;
65 | background: var(--accentColor);
66 | }
67 | }
68 | `;
69 |
70 | export default pagination;
71 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/share.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 |
3 | const share = css``;
4 |
5 | export default share;
6 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/toTop.js:
--------------------------------------------------------------------------------
1 | import { css } from 'emotion';
2 | import facepaint from 'facepaint';
3 |
4 | const breakpoints = [1024];
5 | const mq = facepaint(breakpoints.map(bp => `@media (min-width: ${bp}px)`));
6 |
7 | const toTop = css`
8 | position: fixed;
9 | background: var(--sidebarBarBgColor);
10 | border: 0;
11 | z-index: 1;
12 | transition: all var(--transitionTime);
13 | cursor: pointer;
14 |
15 | ${mq({
16 | width: ['var(--barHeight)', '40px'],
17 | height: ['var(--barHeight)', '40px'],
18 | borderRadius: [0, 'var(--radius)'],
19 | bottom: [0, 'var(--spaceXL)'],
20 | right: [0, 'var(--spaceXL)'],
21 | })};
22 |
23 | .wrapper {
24 | display: flex;
25 | width: 100%;
26 | height: 100%;
27 | justify-content: center;
28 | align-items: center;
29 | }
30 |
31 | svg {
32 | stroke: var(--brightColor);
33 | }
34 | `;
35 |
36 | export default toTop;
37 |
--------------------------------------------------------------------------------
/packages/side-blog/src/styles/variables.js:
--------------------------------------------------------------------------------
1 | import 'typeface-pt-serif';
2 | import 'typeface-open-sans';
3 | import { injectGlobal } from 'emotion';
4 |
5 | const variables = injectGlobal`
6 | :root {
7 |
8 | /* base colors */
9 | --darkColor: #333;
10 | --brightColor: #FFF;
11 | --accentColor: #FFA500;
12 | --colorA: #605B71;
13 | --colorB: #524D60;
14 | --colorC: #464252;
15 | --colorD: #F6F6F6;
16 | --colorE: #EEEEEE;
17 | --colorF: #DDDDDD;
18 | --colorG: #847d9c;
19 | --monthColor: #5F8C40;
20 | --categoryColor: #3E8A8E;
21 | --tagColor: #815A9A;
22 |
23 | /* elements' colors */
24 | --bodyBgColor: var(--brightColor);
25 | --linkColor: var(--colorG);
26 | --hoverLinkColor: var(--accentColor);
27 | --textColor: #555;
28 | --lightTextColor: #888;
29 | --superLightTextColor: #aaa;
30 |
31 | --sidebarBgColor: var(--colorA);
32 | --sidebarLineColor: var(--colorG);
33 | --sidebarTextColor: var(--brightColor);
34 | --sidebarActiveLinkBgColor: var(--colorC);
35 | --sidebarLinkHoverBgColor: var(--colorB);
36 | --sidebarBarBgColor: var(--colorB);
37 | --sidebarSwitchBgColor: var(--colorC);
38 |
39 | --headingColor: var(--colorA);
40 | --quoteColor: var(--colorA);
41 | --nextPrevBgColor: var(--colorD);
42 | --commentsBgColor: var(--colorE);
43 | --footerBgColor: var(--colorF);
44 |
45 | /* spaces */
46 | --spaceXS: 2px;
47 | --spaceS: 4px;
48 | --spaceM: 8px;
49 | --spaceL: 14px;
50 | --spaceXL: 20px;
51 | --spaceXXL: 30px;
52 |
53 | --textMaxWidth: 640px;
54 |
55 | --barHeight: 60px;
56 | --desktopSidebarWidth: 40%;
57 | --mobileSidebarWidth: 100%;
58 |
59 | /* fonts */
60 | --firstFontFamily: "Open Sans", sans-serif;
61 | --secondFontFamily: "PT Serif", serif;
62 |
63 | /* other */
64 | --transitionTime: 0.5s;
65 | --radius: 2px;
66 |
67 | --scrollBarThumb: rgba(0,0,0, .2);
68 | --scrollBarTrack: rgba(0,0,0, .1);
69 | --scrollBarWidth: 8px;
70 | }
71 | `;
72 |
73 | export default variables;
74 |
--------------------------------------------------------------------------------
/packages/side-blog/src/utils/prefixToDateTimeString.js:
--------------------------------------------------------------------------------
1 | export default function prefixToDateTimeString(str) {
2 | let dateString = /^(\d{4}-\d{2}-\d{2})/.exec(str);
3 | dateString = dateString ? dateString[1] : '';
4 |
5 | let timeString = /--(\d{2}-\d{2})$/.exec(str);
6 | timeString = timeString ? timeString[1].replace('-', ':') : '00:00';
7 |
8 | return `${dateString}T${timeString}`;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/side-blog/utils/prefixToDateTimeString.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports.default = prefixToDateTimeString;
7 |
8 | function prefixToDateTimeString(str) {
9 | var dateString = /^(\d{4}-\d{2}-\d{2})/.exec(str);
10 | dateString = dateString ? dateString[1] : '';
11 | var timeString = /--(\d{2}-\d{2})$/.exec(str);
12 | timeString = timeString ? timeString[1].replace('-', ':') : '00:00';
13 | return "".concat(dateString, "T").concat(timeString);
14 | }
--------------------------------------------------------------------------------
/stylelint.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | processors: ['stylelint-processor-styled-components'],
3 | extends: [
4 | 'stylelint-config-recommended',
5 | 'stylelint-config-styled-components',
6 | ],
7 | rules: {
8 | 'no-descending-specificity': null,
9 | },
10 | };
11 |
--------------------------------------------------------------------------------
/test/throwOnPropTypeError.js:
--------------------------------------------------------------------------------
1 | const error = console.error;
2 |
3 | console.error = (message, ...args) => {
4 | if (/(Invalid prop|Failed prop type)/gi.test(message)) {
5 | throw new Error(message);
6 | }
7 |
8 | error.apply(console, [message, ...args]);
9 | };
10 |
--------------------------------------------------------------------------------