diff options
Diffstat (limited to 'packages/theme')
-rw-r--r-- | packages/theme/package.json | 6 | ||||
-rw-r--r-- | packages/theme/src/themes/IStyleTypes.ts | 2 | ||||
-rw-r--r-- | packages/theme/src/themes/dark/index.ts | 7 | ||||
-rw-r--r-- | packages/theme/src/themes/default/index.ts | 9 | ||||
-rw-r--r-- | packages/theme/test/index.test.js | 17 | ||||
-rw-r--r-- | packages/theme/test/index.test.ts | 19 | ||||
-rw-r--r-- | packages/theme/tsconfig.json | 1 |
7 files changed, 25 insertions, 36 deletions
diff --git a/packages/theme/package.json b/packages/theme/package.json index 7e3c4722d..7f3226bd8 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json | |||
@@ -15,15 +15,15 @@ | |||
15 | }, | 15 | }, |
16 | "scripts": { | 16 | "scripts": { |
17 | "dev": "tsc -w", | 17 | "dev": "tsc -w", |
18 | "prepare": "tsc", | 18 | "build": "tsc", |
19 | "preprepare": "npm run test", | 19 | "preprepare": "npm run test", |
20 | "test": "npx mocha" | 20 | "test": "ts-mocha 'test/**/*.test.ts'" |
21 | }, | 21 | }, |
22 | "bugs": { | 22 | "bugs": { |
23 | "url": "https://github.com/meetfranz/franz/issues" | 23 | "url": "https://github.com/meetfranz/franz/issues" |
24 | }, | 24 | }, |
25 | "dependencies": { | 25 | "dependencies": { |
26 | "color": "3.1.2" | 26 | "color": "4.0.1" |
27 | }, | 27 | }, |
28 | "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69" | 28 | "gitHead": "9f2ab40b7602bc3df26ebb093b484b9917768f69" |
29 | } | 29 | } |
diff --git a/packages/theme/src/themes/IStyleTypes.ts b/packages/theme/src/themes/IStyleTypes.ts index cf8bdea33..48f52daf2 100644 --- a/packages/theme/src/themes/IStyleTypes.ts +++ b/packages/theme/src/themes/IStyleTypes.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | export default interface IStyleTypes { | 1 | export interface IStyleTypes { |
2 | [index: string]: { | 2 | [index: string]: { |
3 | accent: string; | 3 | accent: string; |
4 | contrast: string; | 4 | contrast: string; |
diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts index 7d7bab399..87a68cb5d 100644 --- a/packages/theme/src/themes/dark/index.ts +++ b/packages/theme/src/themes/dark/index.ts | |||
@@ -153,13 +153,6 @@ export default (brandPrimary: string) => { | |||
153 | }, | 153 | }, |
154 | }), | 154 | }), |
155 | 155 | ||
156 | // Announcements | ||
157 | announcements: merge({}, defaultStyles.announcements, { | ||
158 | spotlight: { | ||
159 | background: legacyStyles.darkThemeGrayDark, | ||
160 | }, | ||
161 | }), | ||
162 | |||
163 | // Todos | 156 | // Todos |
164 | todos: merge({}, defaultStyles.todos, { | 157 | todos: merge({}, defaultStyles.todos, { |
165 | todosLayer: { | 158 | todosLayer: { |
diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts index 21017bbe0..80bcba766 100644 --- a/packages/theme/src/themes/default/index.ts +++ b/packages/theme/src/themes/default/index.ts | |||
@@ -2,7 +2,7 @@ import color from 'color'; | |||
2 | import { cloneDeep } from 'lodash'; | 2 | import { cloneDeep } from 'lodash'; |
3 | 3 | ||
4 | import * as legacyStyles from '../legacy'; | 4 | import * as legacyStyles from '../legacy'; |
5 | import IStyleTypes from '../IStyleTypes'; | 5 | import type { IStyleTypes } from '../IStyleTypes'; |
6 | 6 | ||
7 | export default (brandPrimary: string) => { | 7 | export default (brandPrimary: string) => { |
8 | const brandSuccess = '#5cb85c'; | 8 | const brandSuccess = '#5cb85c'; |
@@ -228,13 +228,6 @@ export default (brandPrimary: string) => { | |||
228 | }, | 228 | }, |
229 | }, | 229 | }, |
230 | 230 | ||
231 | // Announcements | ||
232 | announcements: { | ||
233 | spotlight: { | ||
234 | background: legacyStyles.themeGrayLightest, | ||
235 | }, | ||
236 | }, | ||
237 | |||
238 | // Todos | 231 | // Todos |
239 | todos: { | 232 | todos: { |
240 | todosLayer: { | 233 | todosLayer: { |
diff --git a/packages/theme/test/index.test.js b/packages/theme/test/index.test.js deleted file mode 100644 index 3906433c1..000000000 --- a/packages/theme/test/index.test.js +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | const expect = require('expect.js'); | ||
2 | |||
3 | const { colorBackground: colorBackgroundDefault } = require('../lib/themes/default'); | ||
4 | const { colorBackground: colorBackgroundDark } = require('../lib/themes/dark'); | ||
5 | const { default: theme } = require('../lib'); | ||
6 | |||
7 | describe('Load theme', () => { | ||
8 | it('Should load default theme', () => { | ||
9 | const { colorBackground } = theme('default'); | ||
10 | expect(colorBackground).to.be(colorBackgroundDefault); | ||
11 | }); | ||
12 | |||
13 | it('Should load dark theme', () => { | ||
14 | const { colorBackground } = theme('dark'); | ||
15 | expect(colorBackground).to.be(colorBackgroundDark); | ||
16 | }); | ||
17 | }); | ||
diff --git a/packages/theme/test/index.test.ts b/packages/theme/test/index.test.ts new file mode 100644 index 000000000..7eda4e359 --- /dev/null +++ b/packages/theme/test/index.test.ts | |||
@@ -0,0 +1,19 @@ | |||
1 | import expect from 'expect.js'; | ||
2 | |||
3 | import makeDefaultThemeConfig from '../src/themes/default'; | ||
4 | import makeDarkThemeConfig from '../src/themes/dark'; | ||
5 | import { theme, ThemeType } from '../src'; | ||
6 | |||
7 | describe('Load theme', () => { | ||
8 | it('Should load default theme', () => { | ||
9 | const { colorBackground } = theme('default' as ThemeType); | ||
10 | expect(colorBackground).to.be( | ||
11 | makeDefaultThemeConfig('default').colorBackground, | ||
12 | ); | ||
13 | }); | ||
14 | |||
15 | it('Should load dark theme', () => { | ||
16 | const { colorBackground } = theme('dark' as ThemeType); | ||
17 | expect(colorBackground).to.be(makeDarkThemeConfig('dark').colorBackground); | ||
18 | }); | ||
19 | }); | ||
diff --git a/packages/theme/tsconfig.json b/packages/theme/tsconfig.json index d80ee9ee7..4deaa5dd7 100644 --- a/packages/theme/tsconfig.json +++ b/packages/theme/tsconfig.json | |||
@@ -4,4 +4,5 @@ | |||
4 | "outDir": "lib", | 4 | "outDir": "lib", |
5 | "rootDir": "src" | 5 | "rootDir": "src" |
6 | }, | 6 | }, |
7 | "exclude": ["node_modules", "lib", "test"] | ||
7 | } | 8 | } |