Skip to content

Commit 3df0ef6

Browse files
authored
Merge pull request #63 from kurone-kito/improve-the-appearance
Added the dark mode appearance; Added the page each by genius type and languages
2 parents 602ec60 + c35c7a9 commit 3df0ef6

72 files changed

Lines changed: 26368 additions & 7182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 25591 additions & 6804 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/dantalion-cli/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,24 @@
4040
"@kurone-kito/dantalion-core": "^0.19.1",
4141
"@kurone-kito/dantalion-i18n": "^0.19.1",
4242
"commander": "^7.2.0",
43-
"marked": "^2.1.1",
43+
"marked": "^2.1.2",
4444
"marked-terminal": "^4.1.1"
4545
},
4646
"devDependencies": {
4747
"@types/jest": "^26.0.23",
4848
"@types/marked": "^2.0.3",
4949
"@types/marked-terminal": "^3.1.1",
50-
"@typescript-eslint/eslint-plugin": "^4.27.0",
51-
"@typescript-eslint/parser": "^4.27.0",
50+
"@typescript-eslint/eslint-plugin": "^4.28.0",
51+
"@typescript-eslint/parser": "^4.28.0",
5252
"eslint": "^7.29.0",
5353
"eslint-config-airbnb-typescript": "^12.3.1",
5454
"eslint-config-prettier": "^8.3.0",
5555
"eslint-import-resolver-typescript": "^2.4.0",
56-
"eslint-plugin-import": "~2.22.1",
56+
"eslint-plugin-import": "^2.23.4",
5757
"eslint-plugin-jest": "^24.3.6",
5858
"eslint-plugin-prettier": "^3.4.0",
59-
"jest": "^27.0.4",
60-
"jest-cli": "^27.0.4",
59+
"jest": "^27.0.5",
60+
"jest-cli": "^27.0.5",
6161
"prettier": "^2.3.1",
6262
"ts-jest": "^27.0.3",
6363
"typescript": "^4.3.4"

packages/dantalion-core/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
},
3535
"devDependencies": {
3636
"@types/jest": "^26.0.23",
37-
"@typescript-eslint/eslint-plugin": "^4.27.0",
38-
"@typescript-eslint/parser": "^4.27.0",
37+
"@typescript-eslint/eslint-plugin": "^4.28.0",
38+
"@typescript-eslint/parser": "^4.28.0",
3939
"eslint": "^7.29.0",
4040
"eslint-config-airbnb-typescript": "^12.3.1",
4141
"eslint-config-prettier": "^8.3.0",
4242
"eslint-import-resolver-typescript": "^2.4.0",
43-
"eslint-plugin-import": "~2.22.1",
43+
"eslint-plugin-import": "^2.23.4",
4444
"eslint-plugin-jest": "^24.3.6",
4545
"eslint-plugin-prettier": "^3.4.0",
46-
"jest": "^27.0.4",
47-
"jest-cli": "^27.0.4",
46+
"jest": "^27.0.5",
47+
"jest-cli": "^27.0.5",
4848
"prettier": "^2.3.1",
4949
"ts-jest": "^27.0.3",
5050
"typescript": "^4.3.4"

packages/dantalion-i18n/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@
4141
"devDependencies": {
4242
"@types/jest": "^26.0.23",
4343
"@types/lodash.merge": "^4.6.6",
44-
"@typescript-eslint/eslint-plugin": "^4.27.0",
45-
"@typescript-eslint/parser": "^4.27.0",
44+
"@typescript-eslint/eslint-plugin": "^4.28.0",
45+
"@typescript-eslint/parser": "^4.28.0",
4646
"eslint": "^7.29.0",
4747
"eslint-config-airbnb-typescript": "^12.3.1",
4848
"eslint-config-prettier": "^8.3.0",
4949
"eslint-import-resolver-typescript": "^2.4.0",
50-
"eslint-plugin-import": "~2.22.1",
50+
"eslint-plugin-import": "^2.23.4",
5151
"eslint-plugin-jest": "^24.3.6",
5252
"eslint-plugin-prettier": "^3.4.0",
53-
"jest": "^27.0.4",
54-
"jest-cli": "^27.0.4",
53+
"jest": "^27.0.5",
54+
"jest-cli": "^27.0.5",
5555
"prettier": "^2.3.1",
5656
"ts-jest": "^27.0.3",
5757
"typescript": "^4.3.4"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { ReactNode, VFC } from 'react';
2+
import {
3+
DocsContainer as BaseContainer,
4+
DocsContainerProps,
5+
DocsContextProps,
6+
} from '@storybook/addon-docs/blocks';
7+
import merge from 'lodash.merge';
8+
import { useDarkMode } from 'storybook-dark-mode';
9+
import { themes } from '@storybook/theming';
10+
11+
/** Type definition of the required attributes. */
12+
export interface Props extends DocsContainerProps {
13+
/** The children items. */
14+
readonly children?: ReactNode;
15+
}
16+
17+
/** The docs container component for Storybook. */
18+
const DocsContainer: VFC<Props> = ({ children, context }) => (
19+
<BaseContainer
20+
context={merge<DocsContextProps, DocsContextProps>(context, {
21+
parameters: {
22+
docs: { theme: useDarkMode() ? themes.dark : themes.light },
23+
},
24+
})}
25+
>
26+
{children}
27+
</BaseContainer>
28+
);
29+
DocsContainer.displayName = 'DocsContainer';
30+
31+
export default DocsContainer;

packages/dantalion-web-playground/.storybook/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
name: '@storybook/addon-postcss',
66
options: { postcssLoaderOptions: { implementation: require('postcss') } },
77
},
8+
'storybook-dark-mode',
89
],
910
core: { builder: 'webpack5' },
1011
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import '../src/styles/global.css';
2+
import DocsContainer from './components/DocContainer';
23

34
export const parameters = {
45
actions: { argTypesRegex: '^on[A-Z].*' },
56
controls: { matchers: { color: /(background|color)$/i, date: /Date$/ } },
7+
darkMode: { darkClass: 'dark', stylePreview: true },
8+
docs: { container: DocsContainer },
9+
viewMode: 'docs',
610
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/// <reference types="next" />
22
/// <reference types="next/types/global" />
3+
/// <reference types="next/image-types/global" />

packages/dantalion-web-playground/next.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,20 @@ const isProd = process.env.NODE_ENV === 'production';
77
const isCI = !!process.env.CI;
88
const path = !isCI && isProd ? '' : productPath;
99
const assetPrefix = (isCI && isProd ? productDomain : localDomain) + path;
10+
const applyDarkMode = `
11+
const { classList } = window.document.getElementsByTagName('html')[0];
12+
localStorage.theme === 'dark' ||
13+
(!('theme' in localStorage) &&
14+
window.matchMedia('(prefers-color-scheme: dark)').matches)
15+
? classList.add('dark')
16+
: classList.remove('dark');
17+
`;
1018

1119
/** @type {Partial<import('next/dist/next-server/server/config-shared').NextConfig>} */
1220
const providedExports = {
1321
assetPrefix,
1422
basePath: path,
15-
env: { assetPrefix },
23+
env: { applyDarkMode, assetPrefix },
1624
future: { strictPostcssConfiguration: true },
1725
// i18n: { defaultLocale: 'en', locales: ['en', 'ja'] },
1826
reactStrictMode: true,

packages/dantalion-web-playground/package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@
4444
"@fortawesome/react-fontawesome": "^0.1.14",
4545
"@kurone-kito/dantalion-core": "^0.19.1",
4646
"@kurone-kito/dantalion-i18n": "^0.19.1",
47-
"@sentry/nextjs": "^6.7.1",
47+
"@sentry/nextjs": "^6.7.2",
4848
"classnames": "^2.3.1",
4949
"js-base64": "^3.6.1",
5050
"lodash.chunk": "^4.2.0",
51-
"next": "^11.0.0",
51+
"lodash.merge": "^4.6.2",
52+
"next": "^11.0.1",
5253
"qs": "^6.10.1",
5354
"react": "^17.0.2",
5455
"react-dom": "^17.0.2",
@@ -59,23 +60,26 @@
5960
"unstated-next": "^1.1.0"
6061
},
6162
"devDependencies": {
63+
"@storybook/addon-docs": "^6.2.9",
6264
"@storybook/addon-essentials": "^6.2.9",
6365
"@storybook/addon-postcss": "^2.0.0",
6466
"@storybook/builder-webpack5": "^6.2.9",
6567
"@storybook/react": "^6.2.9",
68+
"@storybook/theming": "^6.2.9",
6669
"@types/lodash.chunk": "^4.2.6",
70+
"@types/lodash.merge": "^4.6.6",
6771
"@types/qs": "^6.9.6",
6872
"@types/react": "^17.0.11",
6973
"@types/react-fontawesome": "^1.6.4",
70-
"@typescript-eslint/eslint-plugin": "^4.27.0",
71-
"@typescript-eslint/parser": "^4.27.0",
74+
"@typescript-eslint/eslint-plugin": "^4.28.0",
75+
"@typescript-eslint/parser": "^4.28.0",
7276
"browserslist": "^4.16.6",
7377
"eslint": "^7.29.0",
7478
"eslint-config-airbnb-typescript": "^12.3.1",
75-
"eslint-config-next": "^11.0.0",
79+
"eslint-config-next": "^11.0.1",
7680
"eslint-config-prettier": "^8.3.0",
7781
"eslint-import-resolver-typescript": "^2.4.0",
78-
"eslint-plugin-import": "~2.22.1",
82+
"eslint-plugin-import": "^2.23.4",
7983
"eslint-plugin-jsx-a11y": "^6.4.1",
8084
"eslint-plugin-next": "^0.0.0",
8185
"eslint-plugin-prettier": "^3.4.0",
@@ -85,6 +89,7 @@
8589
"postcss": "^8.3.5",
8690
"prettier": "^2.3.1",
8791
"serve": "^12.0.0",
92+
"storybook-dark-mode": "^1.0.8",
8893
"stylelint": "^13.13.1",
8994
"stylelint-config-recommended": "^5.0.0",
9095
"typescript": "^4.3.4"

0 commit comments

Comments
 (0)