@codacy/ui-components 0.65.78 → 0.65.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Input/styles.js +58 -55
- package/lib/ScrollableContent/ScrollableContent.styles.js +18 -15
- package/lib/TagsInput/style.js +40 -31
- package/lib/Textarea/Textarea.styles.js +42 -39
- package/lib/Toast/styles.js +19 -13
- package/lib/theme/ColorSchemes/codacy.d.ts +18 -24
- package/lib/theme/ColorSchemes/codacy.js +6 -4
- package/lib/theme/ColorSchemes/dark.d.ts +2 -0
- package/lib/theme/ColorSchemes/dark.js +90 -0
- package/lib/theme/ColorSchemes/security.js +1 -1
- package/lib/theme/index.d.ts +1 -0
- package/lib/theme/index.js +11 -0
- package/lib/theme/theme.d.ts +1 -0
- package/lib/theme/theme.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.darkCodacyThemeColors = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _ = require("..");
|
|
10
|
+
// Important notes about the current dark mode colors:
|
|
11
|
+
//
|
|
12
|
+
// - To avoid performing a lot of changes in SPA, currently there's a map between colors.
|
|
13
|
+
// For example, if a color called blue-90 in light mode is a very light blue, in dark mode it is a very dark blue. The same name is used,
|
|
14
|
+
// but the color code is different.
|
|
15
|
+
// - This means that in the future we should only use the semantic names, such as "text-danger", and not the base colors (red-40), as the number
|
|
16
|
+
// associated will not reflect the real lightness of the color.
|
|
17
|
+
// - Only then, we can come back to this code and change the base colors name to have the correct lightness associated.
|
|
18
|
+
|
|
19
|
+
var generateBaseColors = function generateBaseColors(color) {
|
|
20
|
+
var colors = {};
|
|
21
|
+
colors["".concat(color.name, "-99")] = (0, _.hslToHex)(color.hue, color.saturation, 10);
|
|
22
|
+
colors["".concat(color.name, "-95")] = (0, _.hslToHex)(color.hue, color.saturation, 20);
|
|
23
|
+
colors["".concat(color.name, "-90")] = (0, _.hslToHex)(color.hue, color.saturation, 20);
|
|
24
|
+
|
|
25
|
+
//light to dark lightness map
|
|
26
|
+
var lightToDarkMap = {
|
|
27
|
+
80: 30,
|
|
28
|
+
70: 30,
|
|
29
|
+
60: 40,
|
|
30
|
+
50: 50,
|
|
31
|
+
40: 60,
|
|
32
|
+
30: 70,
|
|
33
|
+
20: 90,
|
|
34
|
+
10: 93
|
|
35
|
+
};
|
|
36
|
+
for (var i = 80; i >= 10; i -= 10) {
|
|
37
|
+
colors["".concat(color.name, "-").concat(i)] = (0, _.hslToHex)(color.hue, color.saturation, color.lightnessStart + lightToDarkMap[i]);
|
|
38
|
+
}
|
|
39
|
+
return colors;
|
|
40
|
+
};
|
|
41
|
+
var baseColors = (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, generateBaseColors({
|
|
42
|
+
name: 'turquoise',
|
|
43
|
+
hue: 183,
|
|
44
|
+
saturation: 50,
|
|
45
|
+
lightnessStart: 0
|
|
46
|
+
})), generateBaseColors({
|
|
47
|
+
name: 'blue',
|
|
48
|
+
hue: 217,
|
|
49
|
+
saturation: 100,
|
|
50
|
+
lightnessStart: 7
|
|
51
|
+
})), generateBaseColors({
|
|
52
|
+
name: 'magenta',
|
|
53
|
+
hue: 310,
|
|
54
|
+
saturation: 63,
|
|
55
|
+
lightnessStart: 2
|
|
56
|
+
})), generateBaseColors({
|
|
57
|
+
name: 'purple',
|
|
58
|
+
hue: 266,
|
|
59
|
+
saturation: 64,
|
|
60
|
+
lightnessStart: 7
|
|
61
|
+
})), generateBaseColors({
|
|
62
|
+
name: 'orange',
|
|
63
|
+
hue: 29,
|
|
64
|
+
saturation: 98,
|
|
65
|
+
lightnessStart: 7
|
|
66
|
+
})), generateBaseColors({
|
|
67
|
+
name: 'grey',
|
|
68
|
+
hue: 219,
|
|
69
|
+
saturation: 25,
|
|
70
|
+
lightnessStart: 7
|
|
71
|
+
})), generateBaseColors({
|
|
72
|
+
name: 'red',
|
|
73
|
+
hue: 359,
|
|
74
|
+
saturation: 67,
|
|
75
|
+
lightnessStart: 7
|
|
76
|
+
})), generateBaseColors({
|
|
77
|
+
name: 'green',
|
|
78
|
+
hue: 137,
|
|
79
|
+
saturation: 50,
|
|
80
|
+
lightnessStart: 0
|
|
81
|
+
})), generateBaseColors({
|
|
82
|
+
name: 'yellow',
|
|
83
|
+
hue: 38,
|
|
84
|
+
saturation: 100,
|
|
85
|
+
lightnessStart: 7
|
|
86
|
+
})), {}, {
|
|
87
|
+
white: '#000000' //this is in fact black
|
|
88
|
+
});
|
|
89
|
+
var functionalColors = (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _.functionalColorsFx)(baseColors)), (0, _.semanticFunctionalColorsFx)('text', 60)), (0, _.semanticFunctionalColorsFx)('background', 20)), (0, _.semanticFunctionalColorsFx)('border', 60)), (0, _.semanticFunctionalColorsFx)('icon', 60));
|
|
90
|
+
var darkCodacyThemeColors = exports.darkCodacyThemeColors = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, baseColors), functionalColors);
|
|
@@ -8,7 +8,7 @@ exports.securityThemeColors = void 0;
|
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
9
|
var _codacy = require("./codacy");
|
|
10
10
|
var baseColors = (0, _objectSpread2["default"])({}, _codacy.baseColors);
|
|
11
|
-
var functionalColors = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _codacy.functionalColorsFx)(baseColors)), {}, {
|
|
11
|
+
var functionalColors = (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _codacy.functionalColorsFx)(baseColors)), (0, _codacy.semanticFunctionalColorsFx)('text', 40)), (0, _codacy.semanticFunctionalColorsFx)('background', 95)), (0, _codacy.semanticFunctionalColorsFx)('border', 40)), (0, _codacy.semanticFunctionalColorsFx)('icon', 40)), {}, {
|
|
12
12
|
// UPDATE HERE FUNCTIONAL COLORS
|
|
13
13
|
|
|
14
14
|
'brand-primary': baseColors['orange-40'],
|
package/lib/theme/index.d.ts
CHANGED
package/lib/theme/index.js
CHANGED
|
@@ -25,6 +25,17 @@ Object.keys(_security).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _dark = require("./ColorSchemes/dark");
|
|
29
|
+
Object.keys(_dark).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _dark[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _dark[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _theme = require("./theme");
|
|
29
40
|
Object.keys(_theme).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|
package/lib/theme/theme.d.ts
CHANGED
|
@@ -34,5 +34,6 @@ export declare const transition: (properties: string[], speed?: Speed, refTheme?
|
|
|
34
34
|
export declare const generateTheme: (scheme: ColorScheme) => CodacyTheme;
|
|
35
35
|
export declare const codacyTheme: CodacyTheme;
|
|
36
36
|
export declare const securityTheme: CodacyTheme;
|
|
37
|
+
export declare const darkCodacyTheme: CodacyTheme;
|
|
37
38
|
/** @deprecated Use codacyTheme instead */
|
|
38
39
|
export declare const theme: CodacyTheme;
|
package/lib/theme/theme.js
CHANGED
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.transition = exports.theme = exports.securityTheme = exports.generateTheme = exports.codacyTheme = void 0;
|
|
7
|
+
exports.transition = exports.theme = exports.securityTheme = exports.generateTheme = exports.darkCodacyTheme = exports.codacyTheme = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
9
|
var _ = require("./");
|
|
10
10
|
var _polished = require("polished");
|
|
@@ -166,6 +166,7 @@ var generateTheme = exports.generateTheme = function generateTheme(scheme) {
|
|
|
166
166
|
// Themes
|
|
167
167
|
var codacyTheme = exports.codacyTheme = generateTheme(_.codacyThemeColors);
|
|
168
168
|
var securityTheme = exports.securityTheme = generateTheme(_.securityThemeColors);
|
|
169
|
+
var darkCodacyTheme = exports.darkCodacyTheme = generateTheme(_.darkCodacyThemeColors);
|
|
169
170
|
|
|
170
171
|
/** @deprecated Use codacyTheme instead */
|
|
171
172
|
var theme = exports.theme = codacyTheme;
|