Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit fab64ab

Browse files
authored
refactor(lib): remove createColorVariants and setColorLightness utils (#583)
* replace util with static values * refactor(lib): remove `createColorVariants` and `setColorLightness` utils * add changelog entry
1 parent d9648ed commit fab64ab

File tree

5 files changed

+122
-34
lines changed

5 files changed

+122
-34
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1919

2020
### BREAKING CHANGES
2121
- `type` prop is replaced with `color` in `Divider` component @layershifter ([#558](https://github.com/stardust-ui/react/pull/558))
22+
- Remove `createColorVariants` and `setColorLightness` utils @layershifter ([#583](https://github.com/stardust-ui/react/pull/583))
2223

2324
### Fixes
2425
- Fix `Provider` is not executing staticStyles with the merged siteVariables @mnajdova ([#559](https://github.com/stardust-ui/react/pull/559))

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"homepage": "https://github.com/stardust-ui/react#readme",
6060
"dependencies": {
6161
"classnames": "^2.2.5",
62-
"color": "^3.1.0",
6362
"downshift": "^3.0.0",
6463
"fela": "^6.1.7",
6564
"fela-plugin-fallback-value": "^5.0.17",
@@ -91,6 +90,7 @@
9190
"@types/react-is": "^16.5.0",
9291
"@types/react-router": "^4.0.27",
9392
"awesome-typescript-loader": "^5.2.1",
93+
"color": "^3.1.0",
9494
"connect-history-api-fallback": "^1.3.0",
9595
"copy-to-clipboard": "^3.0.8",
9696
"copy-webpack-plugin": "^4.5.2",

src/lib/colorUtils.ts

-21
This file was deleted.

src/lib/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as commonPropTypes from './commonPropTypes'
33

44
export { default as AutoControlledComponent } from './AutoControlledComponent'
55
export { default as childrenExist } from './childrenExist'
6-
export * from './colorUtils'
76
export { default as UIComponent } from './UIComponent'
87
export { EventStack } from './eventStack'
98
export { felaRenderer, felaRtlRenderer } from './felaRenderer'

src/themes/default/colors.ts

+120-11
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,129 @@
1-
import { createColorVariants } from '../../lib'
21
import { ColorPalette, ContextualColors, EmphasisColors, NaturalColors } from '../types'
32

43
export const naturalColors: NaturalColors = {
5-
blue: createColorVariants('#0a84ff'),
6-
green: createColorVariants('#30e60b'),
7-
grey: createColorVariants('#737373'),
8-
orange: createColorVariants('#ff9400'),
9-
pink: createColorVariants('#ff1ad9'),
10-
purple: createColorVariants('#9400ff'),
11-
teal: createColorVariants('#00feff'),
12-
red: createColorVariants('#ff0039'),
13-
yellow: createColorVariants('#ffe900'),
4+
blue: {
5+
50: '#E5F2FF',
6+
100: '#CCE5FF',
7+
200: '#99CCFF',
8+
300: '#66B2FF',
9+
400: '#3399FF',
10+
500: '#0a84ff',
11+
600: '#0066CC',
12+
700: '#004C99',
13+
800: '#003366',
14+
900: '#001933',
15+
},
16+
green: {
17+
50: '#EBFEE7',
18+
100: '#D6FDCE',
19+
200: '#ADFA9E',
20+
300: '#84F86D',
21+
400: '#5CF63C',
22+
500: '#30e60b',
23+
600: '#29C309',
24+
700: '#1E9207',
25+
800: '#146105',
26+
900: '#0A3102',
27+
},
28+
grey: {
29+
50: '#F2F2F2',
30+
100: '#E6E6E6',
31+
200: '#CCCCCC',
32+
300: '#B3B3B3',
33+
400: '#999999',
34+
500: '#737373',
35+
600: '#666666',
36+
700: '#4D4D4D',
37+
800: '#333333',
38+
900: '#1A1A1A',
39+
},
40+
orange: {
41+
50: '#FFF4E5',
42+
100: '#FFEACC',
43+
200: '#FFD499',
44+
300: '#FFBF66',
45+
400: '#FFA933',
46+
500: '#ff9400',
47+
600: '#CC7600',
48+
700: '#995900',
49+
800: '#663B00',
50+
900: '#331E00',
51+
},
52+
pink: {
53+
50: '#FFE5FB',
54+
100: '#FFCCF7',
55+
200: '#FF99EE',
56+
300: '#FF66E6',
57+
400: '#FF33DD',
58+
500: '#ff1ad9',
59+
600: '#CC00AA',
60+
700: '#990080',
61+
800: '#660055',
62+
900: '#33002B',
63+
},
64+
purple: {
65+
50: '#F4E5FF',
66+
100: '#EACCFF',
67+
200: '#D499FF',
68+
300: '#BF66FF',
69+
400: '#A933FF',
70+
500: '#9400ff',
71+
600: '#7600CC',
72+
700: '#590099',
73+
800: '#3B0066',
74+
900: '#1E0033',
75+
},
76+
teal: {
77+
50: '#E5FFFF',
78+
100: '#CCFFFF',
79+
200: '#99FFFF',
80+
300: '#66FEFF',
81+
400: '#33FEFF',
82+
500: '#00feff',
83+
600: '#00CBCC',
84+
700: '#009899',
85+
800: '#006666',
86+
900: '#003333',
87+
},
88+
red: {
89+
50: '#FFE5EB',
90+
100: '#FFCCD7',
91+
200: '#FF99B0',
92+
300: '#FF6688',
93+
400: '#FF3361',
94+
500: '#ff0039',
95+
600: '#CC002E',
96+
700: '#990022',
97+
800: '#660017',
98+
900: '#33000B',
99+
},
100+
yellow: {
101+
50: '#FFFDE5',
102+
100: '#FFFBCC',
103+
200: '#FFF699',
104+
300: '#FFF266',
105+
400: '#FFED33',
106+
500: '#ffe900',
107+
600: '#CCBA00',
108+
700: '#998C00',
109+
800: '#665D00',
110+
900: '#332F00',
111+
},
14112
}
15113

16114
export const emphasisColors: EmphasisColors = {
17-
primary: createColorVariants('#0a84ff'),
115+
primary: {
116+
50: '#E5F2FF',
117+
100: '#CCE5FF',
118+
200: '#99CCFF',
119+
300: '#66B2FF',
120+
400: '#3399FF',
121+
500: '#0a84ff',
122+
600: '#0066CC',
123+
700: '#004C99',
124+
800: '#003366',
125+
900: '#001933',
126+
},
18127
secondary: naturalColors.grey,
19128
}
20129

0 commit comments

Comments
 (0)