diff options
33 files changed, 44 insertions, 128 deletions
diff --git a/.eslintignore b/.eslintignore index 0dfa46e43..820648215 100644 --- a/.eslintignore +++ b/.eslintignore | |||
@@ -27,6 +27,4 @@ npm-debug.log.* | |||
27 | 27 | ||
28 | /build/ | 28 | /build/ |
29 | /out/ | 29 | /out/ |
30 | /packages/*/lib | ||
31 | /packages/**/*.test.* | ||
32 | /recipes/ | 30 | /recipes/ |
diff --git a/electron-builder.yml b/electron-builder.yml index 0159e701f..d4d30ed85 100644 --- a/electron-builder.yml +++ b/electron-builder.yml | |||
@@ -70,4 +70,3 @@ protocols: | |||
70 | asarUnpack: | 70 | asarUnpack: |
71 | - ./recipes | 71 | - ./recipes |
72 | - ./assets/images/taskbar | 72 | - ./assets/images/taskbar |
73 | - ./node_modules/@meetfranz | ||
diff --git a/gulpfile.babel.js b/gulpfile.babel.js index d5fb607d9..ae461ba87 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js | |||
@@ -75,7 +75,6 @@ const paths = { | |||
75 | dest: 'build/', | 75 | dest: 'build/', |
76 | watch: [ | 76 | watch: [ |
77 | 'src/**/*.js', | 77 | 'src/**/*.js', |
78 | // 'packages/**/*.js', | ||
79 | ], | 78 | ], |
80 | }, | 79 | }, |
81 | typescripts: { | 80 | typescripts: { |
@@ -83,17 +82,8 @@ const paths = { | |||
83 | dest: 'build/', | 82 | dest: 'build/', |
84 | watch: [ | 83 | watch: [ |
85 | 'src/**/*.ts', | 84 | 'src/**/*.ts', |
86 | // 'packages/**/*.ts', | ||
87 | ], | 85 | ], |
88 | }, | 86 | }, |
89 | packages: { | ||
90 | watch: 'packages/**/*', | ||
91 | // dest: 'build/', | ||
92 | // watch: [ | ||
93 | // 'src/**/*.js', | ||
94 | // // 'packages/**/*.js', | ||
95 | // ], | ||
96 | }, | ||
97 | }; | 87 | }; |
98 | 88 | ||
99 | // eslint-disable-next-line no-unused-vars | 89 | // eslint-disable-next-line no-unused-vars |
@@ -145,10 +135,6 @@ export function mvPackageJson() { | |||
145 | return gulp.src(['./package.json']).pipe(gulp.dest(paths.dest)); | 135 | return gulp.src(['./package.json']).pipe(gulp.dest(paths.dest)); |
146 | } | 136 | } |
147 | 137 | ||
148 | export function mvLernaPackages() { | ||
149 | return gulp.src(['packages/**']).pipe(gulp.dest(`${paths.dest}/packages`)); | ||
150 | } | ||
151 | |||
152 | export function mvPostinstallScript() { | 138 | export function mvPostinstallScript() { |
153 | return gulp | 139 | return gulp |
154 | .src(['./scripts/postinstall.ts']) | 140 | .src(['./scripts/postinstall.ts']) |
@@ -240,7 +226,6 @@ export function processTypescripts() { | |||
240 | } | 226 | } |
241 | 227 | ||
242 | export function watch() { | 228 | export function watch() { |
243 | gulp.watch(paths.packages.watch, mvLernaPackages); | ||
244 | gulp.watch(paths.styles.watch, styles); | 229 | gulp.watch(paths.styles.watch, styles); |
245 | 230 | ||
246 | gulp.watch([paths.src], mvSrc); | 231 | gulp.watch([paths.src], mvSrc); |
@@ -273,7 +258,6 @@ const build = gulp.series( | |||
273 | gulp.parallel( | 258 | gulp.parallel( |
274 | mvSrc, | 259 | mvSrc, |
275 | mvPackageJson, | 260 | mvPackageJson, |
276 | mvLernaPackages, | ||
277 | mvPostinstallScript, | 261 | mvPostinstallScript, |
278 | exportBuildInfo, | 262 | exportBuildInfo, |
279 | ), | 263 | ), |
diff --git a/lerna.json b/lerna.json index 95aa62baa..2fec49441 100644 --- a/lerna.json +++ b/lerna.json | |||
@@ -1,9 +1,4 @@ | |||
1 | { | 1 | { |
2 | "packages": [ | ||
3 | "packages/theme", | ||
4 | "packages/forms", | ||
5 | "packages/ui" | ||
6 | ], | ||
7 | "npmClient": "npm", | 2 | "npmClient": "npm", |
8 | "version": "independent", | 3 | "version": "independent", |
9 | "ignoreChanges": [ | 4 | "ignoreChanges": [ |
diff --git a/package-lock.json b/package-lock.json index f6742cca4..e6f308bdf 100644 --- a/package-lock.json +++ b/package-lock.json | |||
@@ -5276,12 +5276,6 @@ | |||
5276 | "resolved": "https://registry.npmjs.org/@mdi/react/-/react-1.5.0.tgz", | 5276 | "resolved": "https://registry.npmjs.org/@mdi/react/-/react-1.5.0.tgz", |
5277 | "integrity": "sha512-NztRgUxSYD+ImaKN94Tg66VVVqXj4SmlDGzZoz48H9riJ+Awha56sfXH2fegw819NWo7KI3oeS1Es0lNQqwr0w==" | 5277 | "integrity": "sha512-NztRgUxSYD+ImaKN94Tg66VVVqXj4SmlDGzZoz48H9riJ+Awha56sfXH2fegw819NWo7KI3oeS1Es0lNQqwr0w==" |
5278 | }, | 5278 | }, |
5279 | "@meetfranz/theme": { | ||
5280 | "version": "file:packages/theme", | ||
5281 | "requires": { | ||
5282 | "color": "4.0.1" | ||
5283 | } | ||
5284 | }, | ||
5285 | "@nodelib/fs.scandir": { | 5279 | "@nodelib/fs.scandir": { |
5286 | "version": "2.1.5", | 5280 | "version": "2.1.5", |
5287 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", | 5281 | "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", |
diff --git a/package.json b/package.json index 248a96ef9..c453bf705 100644 --- a/package.json +++ b/package.json | |||
@@ -25,7 +25,7 @@ | |||
25 | "dev": "cross-env NODE_ENV=development gulp dev", | 25 | "dev": "cross-env NODE_ENV=development gulp dev", |
26 | "test": "jest", | 26 | "test": "jest", |
27 | "test:watch": "jest --watch", | 27 | "test:watch": "jest --watch", |
28 | "lint": "eslint \"{src,scripts,packages}/**/*.{js,jsx,ts,tsx}\" --quiet", | 28 | "lint": "eslint \"{src,test,scripts}/**/*.{js,jsx,ts,tsx}\" --quiet", |
29 | "lint:fix": "npm run lint -- --fix", | 29 | "lint:fix": "npm run lint -- --fix", |
30 | "extract": "formatjs extract 'src/**/*.{js,ts,tsx}' --out-file temp.json --flatten --id-interpolation-pattern '[sha512:contenthash:base64:6]' --preserve-whitespace", | 30 | "extract": "formatjs extract 'src/**/*.{js,ts,tsx}' --out-file temp.json --flatten --id-interpolation-pattern '[sha512:contenthash:base64:6]' --preserve-whitespace", |
31 | "compile": "formatjs compile 'temp.json' --out-file src/i18n/locales/en-US.json", | 31 | "compile": "formatjs compile 'temp.json' --out-file src/i18n/locales/en-US.json", |
@@ -35,7 +35,6 @@ | |||
35 | "commit": "git-cz", | 35 | "commit": "git-cz", |
36 | "contributors": "all-contributors", | 36 | "contributors": "all-contributors", |
37 | "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", | 37 | "reformat-files": "./node_modules/.bin/prettier --ignore-path .eslintignore --write --require-pragma \"**/*.{js,jsx,scss}\"", |
38 | "packages": "npx lerna publish --no-git-tag-version", | ||
39 | "postinstall": "ts-node scripts/postinstall.ts", | 38 | "postinstall": "ts-node scripts/postinstall.ts", |
40 | "apply-branding": "ts-node ./src/i18n/apply-branding.ts", | 39 | "apply-branding": "ts-node ./src/i18n/apply-branding.ts", |
41 | "update-submodules": "git submodule update --remote --force", | 40 | "update-submodules": "git submodule update --remote --force", |
@@ -65,7 +64,6 @@ | |||
65 | "@mdi/font": "6.2.95", | 64 | "@mdi/font": "6.2.95", |
66 | "@mdi/js": "6.2.95", | 65 | "@mdi/js": "6.2.95", |
67 | "@mdi/react": "1.5.0", | 66 | "@mdi/react": "1.5.0", |
68 | "@meetfranz/theme": "file:packages/theme", | ||
69 | "@sentry/electron": "2.5.3", | 67 | "@sentry/electron": "2.5.3", |
70 | "auto-launch": "5.0.5", | 68 | "auto-launch": "5.0.5", |
71 | "btoa": "1.2.1", | 69 | "btoa": "1.2.1", |
diff --git a/packages/theme/.gitignore b/packages/theme/.gitignore deleted file mode 100644 index d01826a6b..000000000 --- a/packages/theme/.gitignore +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | node_modules/ | ||
2 | lib | ||
diff --git a/packages/theme/README.md b/packages/theme/README.md deleted file mode 100644 index 6f9cc406b..000000000 --- a/packages/theme/README.md +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | # `theme` | ||
2 | |||
3 | > TODO: description | ||
4 | |||
5 | ## Usage | ||
6 | |||
7 | ``` | ||
8 | const theme = require('theme'); | ||
9 | |||
10 | // TODO: DEMONSTRATE API | ||
11 | ``` | ||
diff --git a/packages/theme/package.json b/packages/theme/package.json deleted file mode 100644 index 7f3226bd8..000000000 --- a/packages/theme/package.json +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | { | ||
2 | "name": "@meetfranz/theme", | ||
3 | "version": "1.0.14", | ||
4 | "description": "Theme configuration for Ferdi", | ||
5 | "author": "Stefan Malzner <stefan@adlk.io>", | ||
6 | "homepage": "https://github.com/meetfranz/franz", | ||
7 | "license": "Apache-2.0", | ||
8 | "main": "lib/index.js", | ||
9 | "publishConfig": { | ||
10 | "access": "public" | ||
11 | }, | ||
12 | "repository": { | ||
13 | "type": "git", | ||
14 | "url": "git+https://github.com/meetfranz/franz.git" | ||
15 | }, | ||
16 | "scripts": { | ||
17 | "dev": "tsc -w", | ||
18 | "build": "tsc", | ||
19 | "preprepare": "npm run test", | ||
20 | "test": "ts-mocha 'test/**/*.test.ts'" | ||
21 | }, | ||
22 | "bugs": { | ||
23 | "url": "https://github.com/meetfranz/franz/issues" | ||
24 | }, | ||
25 | "dependencies": { | ||
26 | "color": "4.0.1" | ||
27 | }, | ||
28 | "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69" | ||
29 | } | ||
diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts deleted file mode 100644 index 5ba225e51..000000000 --- a/packages/theme/src/index.ts +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | import makeDarkThemeConfig from './themes/dark'; | ||
2 | import makeDefaultThemeConfig from './themes/default'; | ||
3 | import { themeBrandPrimary } from './themes/legacy'; | ||
4 | |||
5 | export enum ThemeType { | ||
6 | default = 'default', | ||
7 | dark = 'dark', | ||
8 | } | ||
9 | |||
10 | export const DEFAULT_ACCENT_COLOR = themeBrandPrimary; | ||
11 | |||
12 | export function theme( | ||
13 | themeId: ThemeType, | ||
14 | brandColor: string = DEFAULT_ACCENT_COLOR, | ||
15 | ) { | ||
16 | return themeId === ThemeType.dark | ||
17 | ? makeDarkThemeConfig(brandColor) | ||
18 | : makeDefaultThemeConfig(brandColor); | ||
19 | } | ||
20 | |||
21 | const defaultThemeConfigWithDefaultAccentColor = | ||
22 | makeDefaultThemeConfig(DEFAULT_ACCENT_COLOR); | ||
23 | |||
24 | export type Theme = typeof defaultThemeConfigWithDefaultAccentColor; | ||
diff --git a/packages/theme/tsconfig.json b/packages/theme/tsconfig.json deleted file mode 100644 index 8b4163e7f..000000000 --- a/packages/theme/tsconfig.json +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | { | ||
2 | "extends": "../../tsconfig.json", | ||
3 | "compilerOptions": { | ||
4 | "outDir": "lib", | ||
5 | "rootDir": "src" | ||
6 | }, | ||
7 | "exclude": ["node_modules", "lib", "test"] | ||
8 | } | ||
diff --git a/src/components/ui/badge/ProBadge.tsx b/src/components/ui/badge/ProBadge.tsx index cb6bc4c98..dc1e76f7f 100644 --- a/src/components/ui/badge/ProBadge.tsx +++ b/src/components/ui/badge/ProBadge.tsx | |||
@@ -3,7 +3,7 @@ import classnames from 'classnames'; | |||
3 | import { Component } from 'react'; | 3 | import { Component } from 'react'; |
4 | import injectStyle from 'react-jss'; | 4 | import injectStyle from 'react-jss'; |
5 | 5 | ||
6 | import { Theme } from '@meetfranz/theme'; | 6 | import { Theme } from '../../../themes'; |
7 | import { Icon } from '../icon'; | 7 | import { Icon } from '../icon'; |
8 | import { Badge } from './index'; | 8 | import { Badge } from './index'; |
9 | import { IWithStyle } from '../typings/generic'; | 9 | import { IWithStyle } from '../typings/generic'; |
diff --git a/src/components/ui/badge/index.tsx b/src/components/ui/badge/index.tsx index 6495036ff..61bede937 100644 --- a/src/components/ui/badge/index.tsx +++ b/src/components/ui/badge/index.tsx | |||
@@ -2,7 +2,7 @@ import classnames from 'classnames'; | |||
2 | import { Component, ReactNode } from 'react'; | 2 | import { Component, ReactNode } from 'react'; |
3 | import injectStyle from 'react-jss'; | 3 | import injectStyle from 'react-jss'; |
4 | 4 | ||
5 | import { Theme } from '@meetfranz/theme'; | 5 | import { Theme } from '../../../themes'; |
6 | import { IWithStyle } from '../typings/generic'; | 6 | import { IWithStyle } from '../typings/generic'; |
7 | 7 | ||
8 | interface IProps extends IWithStyle { | 8 | interface IProps extends IWithStyle { |
diff --git a/src/components/ui/button/index.tsx b/src/components/ui/button/index.tsx index 5b8927b51..12e5e4449 100644 --- a/src/components/ui/button/index.tsx +++ b/src/components/ui/button/index.tsx | |||
@@ -4,8 +4,8 @@ import { Property } from 'csstype'; | |||
4 | import { Component, MouseEvent } from 'react'; | 4 | import { Component, MouseEvent } from 'react'; |
5 | import injectStyle, { withTheme } from 'react-jss'; | 5 | import injectStyle, { withTheme } from 'react-jss'; |
6 | import Loader from 'react-loader'; | 6 | import Loader from 'react-loader'; |
7 | import { Theme } from '@meetfranz/theme'; | ||
8 | 7 | ||
8 | import { Theme } from '../../../themes'; | ||
9 | import { IFormField, IWithStyle } from '../typings/generic'; | 9 | import { IFormField, IWithStyle } from '../typings/generic'; |
10 | 10 | ||
11 | type ButtonType = | 11 | type ButtonType = |
diff --git a/src/components/ui/error/styles.ts b/src/components/ui/error/styles.ts index ed993ddd5..9da95705a 100644 --- a/src/components/ui/error/styles.ts +++ b/src/components/ui/error/styles.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Theme } from '@meetfranz/theme'; | 1 | import { Theme } from '../../../themes'; |
2 | 2 | ||
3 | export default (theme: Theme) => ({ | 3 | export default (theme: Theme) => ({ |
4 | message: { | 4 | message: { |
diff --git a/src/components/ui/headline/index.tsx b/src/components/ui/headline/index.tsx index 3a3654f02..ea2949102 100644 --- a/src/components/ui/headline/index.tsx +++ b/src/components/ui/headline/index.tsx | |||
@@ -2,7 +2,7 @@ import classnames from 'classnames'; | |||
2 | import { Component, createElement, ReactNode } from 'react'; | 2 | import { Component, createElement, ReactNode } from 'react'; |
3 | import injectStyle from 'react-jss'; | 3 | import injectStyle from 'react-jss'; |
4 | 4 | ||
5 | import { Theme } from '@meetfranz/theme'; | 5 | import { Theme } from '../../../themes'; |
6 | import { IWithStyle, Omit } from '../typings/generic'; | 6 | import { IWithStyle, Omit } from '../typings/generic'; |
7 | 7 | ||
8 | interface IProps extends IWithStyle { | 8 | interface IProps extends IWithStyle { |
diff --git a/src/components/ui/icon/index.tsx b/src/components/ui/icon/index.tsx index fdc48d14a..85bb61d13 100644 --- a/src/components/ui/icon/index.tsx +++ b/src/components/ui/icon/index.tsx | |||
@@ -3,7 +3,7 @@ import classnames from 'classnames'; | |||
3 | import { Component } from 'react'; | 3 | import { Component } from 'react'; |
4 | import injectStyle from 'react-jss'; | 4 | import injectStyle from 'react-jss'; |
5 | 5 | ||
6 | import { Theme } from '@meetfranz/theme'; | 6 | import { Theme } from '../../../themes'; |
7 | import { IWithStyle } from '../typings/generic'; | 7 | import { IWithStyle } from '../typings/generic'; |
8 | 8 | ||
9 | interface IProps extends IWithStyle { | 9 | interface IProps extends IWithStyle { |
diff --git a/src/components/ui/infobox/index.tsx b/src/components/ui/infobox/index.tsx index e6be83556..87940c4d4 100644 --- a/src/components/ui/infobox/index.tsx +++ b/src/components/ui/infobox/index.tsx | |||
@@ -3,7 +3,7 @@ import classnames from 'classnames'; | |||
3 | import { Component, ReactNode } from 'react'; | 3 | import { Component, ReactNode } from 'react'; |
4 | import injectStyle from 'react-jss'; | 4 | import injectStyle from 'react-jss'; |
5 | 5 | ||
6 | import { Theme } from '@meetfranz/theme'; | 6 | import { Theme } from '../../../themes'; |
7 | import { Icon } from '../icon'; | 7 | import { Icon } from '../icon'; |
8 | import { IWithStyle } from '../typings/generic'; | 8 | import { IWithStyle } from '../typings/generic'; |
9 | 9 | ||
diff --git a/src/components/ui/input/styles.ts b/src/components/ui/input/styles.ts index 27426152e..04c1b3991 100644 --- a/src/components/ui/input/styles.ts +++ b/src/components/ui/input/styles.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Property } from 'csstype'; | 1 | import { Property } from 'csstype'; |
2 | 2 | ||
3 | import { Theme } from '@meetfranz/theme'; | 3 | import { Theme } from '../../../themes'; |
4 | 4 | ||
5 | const prefixStyles = (theme: Theme) => ({ | 5 | const prefixStyles = (theme: Theme) => ({ |
6 | background: theme.inputPrefixBackground, | 6 | background: theme.inputPrefixBackground, |
diff --git a/src/components/ui/label/styles.ts b/src/components/ui/label/styles.ts index 0c9cef8bf..faa44ae5b 100644 --- a/src/components/ui/label/styles.ts +++ b/src/components/ui/label/styles.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Theme } from '@meetfranz/theme'; | 1 | import { Theme } from '../../../themes'; |
2 | 2 | ||
3 | export default (theme: Theme) => ({ | 3 | export default (theme: Theme) => ({ |
4 | content: {}, | 4 | content: {}, |
diff --git a/src/components/ui/select/index.tsx b/src/components/ui/select/index.tsx index 41cab7818..2605503a3 100644 --- a/src/components/ui/select/index.tsx +++ b/src/components/ui/select/index.tsx | |||
@@ -8,8 +8,7 @@ import classnames from 'classnames'; | |||
8 | import { ChangeEvent, Component, createRef } from 'react'; | 8 | import { ChangeEvent, Component, createRef } from 'react'; |
9 | import injectStyle from 'react-jss'; | 9 | import injectStyle from 'react-jss'; |
10 | 10 | ||
11 | import { Theme } from '@meetfranz/theme'; | 11 | import { Theme } from '../../../themes'; |
12 | |||
13 | import { IFormField, IWithStyle } from '../typings/generic'; | 12 | import { IFormField, IWithStyle } from '../typings/generic'; |
14 | 13 | ||
15 | import { Error } from '../error'; | 14 | import { Error } from '../error'; |
diff --git a/src/components/ui/textarea/styles.ts b/src/components/ui/textarea/styles.ts index f2267e000..36fc2a82e 100644 --- a/src/components/ui/textarea/styles.ts +++ b/src/components/ui/textarea/styles.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Property } from 'csstype'; | 1 | import { Property } from 'csstype'; |
2 | 2 | ||
3 | import { Theme } from '@meetfranz/theme'; | 3 | import { Theme } from '../../../themes'; |
4 | 4 | ||
5 | export default (theme: Theme) => ({ | 5 | export default (theme: Theme) => ({ |
6 | label: { | 6 | label: { |
diff --git a/src/components/ui/toggle/index.tsx b/src/components/ui/toggle/index.tsx index 67b6c3835..7b6ba147f 100644 --- a/src/components/ui/toggle/index.tsx +++ b/src/components/ui/toggle/index.tsx | |||
@@ -2,8 +2,8 @@ import classnames from 'classnames'; | |||
2 | import { Property } from 'csstype'; | 2 | import { Property } from 'csstype'; |
3 | import { Component, InputHTMLAttributes } from 'react'; | 3 | import { Component, InputHTMLAttributes } from 'react'; |
4 | import injectStyle from 'react-jss'; | 4 | import injectStyle from 'react-jss'; |
5 | import { Theme } from '@meetfranz/theme'; | ||
6 | 5 | ||
6 | import { Theme } from '../../../themes'; | ||
7 | import { IFormField, IWithStyle } from '../typings/generic'; | 7 | import { IFormField, IWithStyle } from '../typings/generic'; |
8 | 8 | ||
9 | import { Error } from '../error'; | 9 | import { Error } from '../error'; |
diff --git a/src/components/ui/typings/generic.ts b/src/components/ui/typings/generic.ts index 084e0e0a5..65b996d59 100644 --- a/src/components/ui/typings/generic.ts +++ b/src/components/ui/typings/generic.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { Classes } from 'jss'; | 1 | import { Classes } from 'jss'; |
2 | 2 | ||
3 | import { Theme } from '@meetfranz/theme'; | 3 | import { Theme } from '../../../themes'; |
4 | 4 | ||
5 | export interface IFormField { | 5 | export interface IFormField { |
6 | showLabel?: boolean; | 6 | showLabel?: boolean; |
diff --git a/src/config.ts b/src/config.ts index e1e8230c2..5f95a59f4 100644 --- a/src/config.ts +++ b/src/config.ts | |||
@@ -2,7 +2,7 @@ | |||
2 | 2 | ||
3 | import ms from 'ms'; | 3 | import ms from 'ms'; |
4 | 4 | ||
5 | import { DEFAULT_ACCENT_COLOR } from '@meetfranz/theme'; | 5 | export const DEFAULT_ACCENT_COLOR = '#7266F0'; |
6 | 6 | ||
7 | export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks | 7 | export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks |
8 | 8 | ||
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index ec06c279d..010a029ff 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -1,7 +1,7 @@ | |||
1 | import { ThemeType } from '@meetfranz/theme'; | ||
2 | import { computed, action, observable } from 'mobx'; | 1 | import { computed, action, observable } from 'mobx'; |
3 | import localStorage from 'mobx-localstorage'; | 2 | import localStorage from 'mobx-localstorage'; |
4 | 3 | ||
4 | import { ThemeType } from '../../themes'; | ||
5 | import { todoActions } from './actions'; | 5 | import { todoActions } from './actions'; |
6 | import { | 6 | import { |
7 | CUSTOM_TODO_SERVICE, | 7 | CUSTOM_TODO_SERVICE, |
diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts index 6ab63c2ee..6a9597006 100644 --- a/src/stores/UIStore.ts +++ b/src/stores/UIStore.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { action, observable, computed, reaction } from 'mobx'; | 1 | import { action, observable, computed, reaction } from 'mobx'; |
2 | import { theme, ThemeType } from '@meetfranz/theme'; | ||
3 | import { nativeTheme, systemPreferences } from '@electron/remote'; | 2 | import { nativeTheme, systemPreferences } from '@electron/remote'; |
4 | 3 | ||
4 | import { theme, ThemeType } from '../themes'; | ||
5 | import Store from './lib/Store'; | 5 | import Store from './lib/Store'; |
6 | import { isMac, isWindows } from '../environment'; | 6 | import { isMac, isWindows } from '../environment'; |
7 | 7 | ||
diff --git a/packages/theme/src/themes/IStyleTypes.ts b/src/themes/IStyleTypes.ts index 48f52daf2..48f52daf2 100644 --- a/packages/theme/src/themes/IStyleTypes.ts +++ b/src/themes/IStyleTypes.ts | |||
diff --git a/packages/theme/src/themes/dark/index.ts b/src/themes/dark/index.ts index aa132c743..aa132c743 100644 --- a/packages/theme/src/themes/dark/index.ts +++ b/src/themes/dark/index.ts | |||
diff --git a/packages/theme/src/themes/default/index.ts b/src/themes/default/index.ts index 80bcba766..80bcba766 100644 --- a/packages/theme/src/themes/default/index.ts +++ b/src/themes/default/index.ts | |||
diff --git a/src/themes/index.ts b/src/themes/index.ts new file mode 100644 index 000000000..27be4d04b --- /dev/null +++ b/src/themes/index.ts | |||
@@ -0,0 +1,21 @@ | |||
1 | import makeDarkThemeConfig from './dark'; | ||
2 | import makeDefaultThemeConfig from './default'; | ||
3 | import { themeBrandPrimary } from './legacy'; | ||
4 | |||
5 | export enum ThemeType { | ||
6 | default = 'default', | ||
7 | dark = 'dark', | ||
8 | } | ||
9 | |||
10 | export function theme( | ||
11 | themeId: ThemeType, | ||
12 | brandColor: string = themeBrandPrimary, | ||
13 | ) { | ||
14 | return themeId === ThemeType.dark | ||
15 | ? makeDarkThemeConfig(brandColor) | ||
16 | : makeDefaultThemeConfig(brandColor); | ||
17 | } | ||
18 | |||
19 | const defaultThemeConfigWithDefaultAccentColor = makeDefaultThemeConfig(themeBrandPrimary); | ||
20 | |||
21 | export type Theme = typeof defaultThemeConfigWithDefaultAccentColor; | ||
diff --git a/packages/theme/src/themes/legacy/index.ts b/src/themes/legacy/index.ts index 3f4bec5d5..c6105a4e2 100644 --- a/packages/theme/src/themes/legacy/index.ts +++ b/src/themes/legacy/index.ts | |||
@@ -1,5 +1,7 @@ | |||
1 | import { DEFAULT_ACCENT_COLOR } from '../../config'; | ||
2 | |||
1 | /* legacy config, injected into sass */ | 3 | /* legacy config, injected into sass */ |
2 | export const themeBrandPrimary = '#7266F0'; | 4 | export const themeBrandPrimary = DEFAULT_ACCENT_COLOR; |
3 | export const themeBrandSuccess = '#5cb85c'; | 5 | export const themeBrandSuccess = '#5cb85c'; |
4 | export const themeBrandInfo = '#5bc0de'; | 6 | export const themeBrandInfo = '#5bc0de'; |
5 | export const themeBrandWarning = '#FF9F00'; | 7 | export const themeBrandWarning = '#FF9F00'; |
diff --git a/packages/theme/test/index.test.ts b/test/themes/index.test.ts index 7eda4e359..042b70009 100644 --- a/packages/theme/test/index.test.ts +++ b/test/themes/index.test.ts | |||
@@ -1,8 +1,8 @@ | |||
1 | import expect from 'expect.js'; | 1 | import expect from 'expect.js'; |
2 | 2 | ||
3 | import makeDefaultThemeConfig from '../src/themes/default'; | 3 | import makeDefaultThemeConfig from '../../src/themes/default'; |
4 | import makeDarkThemeConfig from '../src/themes/dark'; | 4 | import makeDarkThemeConfig from '../../src/themes/dark'; |
5 | import { theme, ThemeType } from '../src'; | 5 | import { theme, ThemeType } from '../../src/themes'; |
6 | 6 | ||
7 | describe('Load theme', () => { | 7 | describe('Load theme', () => { |
8 | it('Should load default theme', () => { | 8 | it('Should load default theme', () => { |