diff options
Diffstat (limited to 'packages/theme')
-rw-r--r-- | packages/theme/package.json | 4 | ||||
-rw-r--r-- | packages/theme/src/themes/IStyleTypes.ts | 2 | ||||
-rw-r--r-- | packages/theme/src/themes/default/index.ts | 2 | ||||
-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 |
6 files changed, 24 insertions, 21 deletions
diff --git a/packages/theme/package.json b/packages/theme/package.json index 516bab93c..7f3226bd8 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json | |||
@@ -17,13 +17,13 @@ | |||
17 | "dev": "tsc -w", | 17 | "dev": "tsc -w", |
18 | "build": "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/default/index.ts b/packages/theme/src/themes/default/index.ts index 7f69e22a5..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'; |
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 | } |