@splunk/themes 0.23.0 → 1.0.0-beta.3
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/CHANGELOG.md +3 -0
- package/CHANGELOG.v1.md +83 -0
- package/design-tokens/colors.js +544 -0
- package/design-tokens/dataViz.js +486 -0
- package/design-tokens/deprecated.js +254 -0
- package/design-tokens/elevation.js +46 -0
- package/design-tokens/index.js +23 -0
- package/design-tokens/spacing-sizing.js +44 -0
- package/design-tokens/typography.js +67 -0
- package/enterprise/comfortable.js +20 -17
- package/enterprise/compact.js +20 -21
- package/enterprise/dark.js +163 -58
- package/enterprise/dataViz.js +414 -0
- package/enterprise/index.js +1 -6
- package/enterprise/light.js +254 -265
- package/index.js +8 -0
- package/mixins/index.js +39 -1
- package/mixins/layout.js +42 -0
- package/mixins/prose.js +67 -0
- package/mixins/tests/prose.unit.js +49 -0
- package/mixins/tests/typography.unit.js +15 -18
- package/mixins/tests/utilityMixins.unit.js +2 -2
- package/mixins/typography.js +141 -144
- package/mixins/utilityMixins.js +6 -9
- package/package.json +6 -9
- package/prisma/base.js +19 -59
- package/prisma/comfortable.js +1 -14
- package/prisma/compact.js +1 -18
- package/prisma/dark.js +88 -73
- package/prisma/dataViz.js +0 -202
- package/prisma/light.js +89 -74
- package/splunk-magnetic/index.js +178 -0
- package/splunk-magnetic/magneticTokensDark.js +706 -0
- package/splunk-magnetic/magneticTokensLight.js +706 -0
- package/storybook-addon-splunk-themes/withSplunkTheme.js +8 -4
- package/types/design-tokens/colors.d.ts +945 -0
- package/types/design-tokens/dataViz.d.ts +433 -0
- package/types/design-tokens/deprecated.d.ts +478 -0
- package/types/design-tokens/elevation.d.ts +51 -0
- package/types/design-tokens/index.d.ts +563 -0
- package/types/design-tokens/spacing-sizing.d.ts +44 -0
- package/types/design-tokens/typography.d.ts +79 -0
- package/types/enterprise/comfortable.d.ts +11 -17
- package/types/enterprise/compact.d.ts +11 -21
- package/types/enterprise/dark.d.ts +424 -113
- package/types/enterprise/dataViz.d.ts +9 -0
- package/types/enterprise/index.d.ts +1 -2
- package/types/enterprise/light.d.ts +450 -139
- package/types/index.d.ts +1 -0
- package/types/mixins/index.d.ts +8 -0
- package/types/mixins/layout.d.ts +21 -0
- package/types/mixins/prose.d.ts +41 -0
- package/types/mixins/tests/prose.unit.d.ts +1 -0
- package/types/mixins/typography.d.ts +5 -12
- package/types/mixins/utilityMixins.d.ts +4 -4
- package/types/prisma/base.d.ts +12 -16
- package/types/prisma/comfortable.d.ts +2 -24
- package/types/prisma/compact.d.ts +2 -28
- package/types/prisma/dark.d.ts +78 -10
- package/types/prisma/dataViz.d.ts +7 -430
- package/types/prisma/light.d.ts +80 -12
- package/types/splunk-magnetic/index.d.ts +3073 -0
- package/types/splunk-magnetic/magneticTokensDark.d.ts +700 -0
- package/types/splunk-magnetic/magneticTokensLight.d.ts +700 -0
- package/types/storybook-addon-splunk-themes/SplunkThemesTool.d.ts +1 -1
- package/enterprise/prismaAliases.js +0 -95
- package/types/enterprise/prismaAliases.d.ts +0 -47
package/prisma/light.js
CHANGED
|
@@ -12,13 +12,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
-
/**
|
|
16
|
-
* ## Background colors
|
|
17
|
-
* Background colors should be used only for backgrounds of higher level sections & containers of a UI.
|
|
18
|
-
*
|
|
19
|
-
* @colorSet verbose
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
15
|
var backgroundColors = {
|
|
23
16
|
backgroundColorPopup: '#ffffff',
|
|
24
17
|
backgroundColorSection: '#ffffff',
|
|
@@ -29,33 +22,60 @@ var backgroundColors = {
|
|
|
29
22
|
backgroundColorDialog: '#ffffff',
|
|
30
23
|
backgroundColorScrim: 'rgba(255, 255, 255, 0.75)'
|
|
31
24
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
* @colorSet verbose
|
|
38
|
-
*/
|
|
39
|
-
|
|
25
|
+
var borderColors = {
|
|
26
|
+
borderColor: ' #8f8f8f',
|
|
27
|
+
borderColorWeak: '#e0e0e0',
|
|
28
|
+
borderColorStrong: '#6b6b6b'
|
|
29
|
+
};
|
|
40
30
|
var contentColors = {
|
|
31
|
+
contentBackgroundColorNegativeWeak: 'rgba(235, 70, 81, 0.20)',
|
|
32
|
+
contentColorAccent: '#0264d7',
|
|
33
|
+
contentColorAccentStrong: '#013f88',
|
|
34
|
+
contentColorAccentWeak: '#b3d6fe',
|
|
41
35
|
contentColorActive: '#2c2c2c',
|
|
42
36
|
contentColorDefault: '#4d4d4d',
|
|
43
37
|
contentColorDisabled: '#878787',
|
|
38
|
+
contentColorInfo: '#006be5',
|
|
44
39
|
contentColorInverted: '#ffffff',
|
|
45
|
-
contentColorMuted: '#6b6b6b'
|
|
40
|
+
contentColorMuted: '#6b6b6b',
|
|
41
|
+
contentColorNegative: '#e00000',
|
|
42
|
+
contentColorNegativeStrong: '#7a0000',
|
|
43
|
+
contentColorNegativeWeak: '#ff9999',
|
|
44
|
+
contentColorPositive: '#407a06',
|
|
45
|
+
contentColorWarning: '#c97705',
|
|
46
|
+
contentColorLink: '#0264d7'
|
|
47
|
+
};
|
|
48
|
+
var actionColors = {
|
|
49
|
+
actionColorBackgroundPrimary: '#0264d7',
|
|
50
|
+
actionColorBackgroundPrimaryActive: '#024ba2',
|
|
51
|
+
actionColorBackgroundPrimaryDisabled: '#72b2fe',
|
|
52
|
+
actionColorBackgroundPrimaryHover: '#024ba2',
|
|
53
|
+
actionColorBackgroundSubtle: 'transparent',
|
|
54
|
+
actionColorBackgroundSecondaryActive: '#d6d6d6',
|
|
55
|
+
actionColorBackgroundSubtleDisabled: 'transparent',
|
|
56
|
+
actionColorBackgroundSecondaryHover: '#d6d6d6',
|
|
57
|
+
actionColorBackgroundSecondary: 'transparent',
|
|
58
|
+
actionColorBackgroundSubtleActive: '#cce3ff',
|
|
59
|
+
actionColorBackgroundSecondaryDisabled: 'transparent',
|
|
60
|
+
actionColorBackgroundSubtleHover: '#cce3ff',
|
|
61
|
+
actionColorBackgroundDestructive: '#e00000',
|
|
62
|
+
actionColorBackgroundDestructiveActive: '#a30000',
|
|
63
|
+
actionColorBackgroundDestructiveDisabled: '#ff9999',
|
|
64
|
+
actionColorBackgroundDestructiveHover: '#a30000',
|
|
65
|
+
actionColorBackgroundDestructiveSecondary: 'transparent',
|
|
66
|
+
actionColorBackgroundDestructiveSecondaryActive: '#ffcccc',
|
|
67
|
+
actionColorBackgroundDestructiveSecondaryDisabled: 'transparent',
|
|
68
|
+
actionColorBackgroundDestructiveSecondaryHover: '#ffcccc',
|
|
69
|
+
actionColorBorderSecondary: '#858585',
|
|
70
|
+
actionColorBorderSecondaryActive: '#525252',
|
|
71
|
+
actionColorBorderSecondaryDisabled: '#d6d6d6',
|
|
72
|
+
actionColorBorderSecondaryHover: '#525252',
|
|
73
|
+
actionColorBorderDestructiveSecondary: '#e00000',
|
|
74
|
+
actionColorBorderDestructiveSecondaryActive: '#a30000',
|
|
75
|
+
actionColorBorderDestructiveSecondaryDisabled: '#ff9999',
|
|
76
|
+
actionColorBorderDestructiveSecondaryHover: '#a30000'
|
|
46
77
|
};
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* ## Interactive colors
|
|
50
|
-
* Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content.
|
|
51
|
-
* "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary.
|
|
52
|
-
* If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two.
|
|
53
|
-
*
|
|
54
|
-
* @colorSet verbose
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
78
|
var interactiveColors = {
|
|
58
|
-
interactiveColorPrimary: '#0264d7',
|
|
59
79
|
interactiveColorBorder: 'rgba(0, 0, 0, 0.48)',
|
|
60
80
|
interactiveColorBorderActive: 'rgba(0, 0, 0, 0.5)',
|
|
61
81
|
interactiveColorBorderHover: 'rgba(0, 0, 0, 0.6)',
|
|
@@ -64,33 +84,48 @@ var interactiveColors = {
|
|
|
64
84
|
interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)',
|
|
65
85
|
interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.07)',
|
|
66
86
|
interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)',
|
|
67
|
-
interactiveColorBackground: '
|
|
68
|
-
interactiveColorBackgroundDisabled: '
|
|
87
|
+
interactiveColorBackground: 'transparent',
|
|
88
|
+
interactiveColorBackgroundDisabled: 'transparent',
|
|
89
|
+
interactiveColorAccent: '#0264d7',
|
|
90
|
+
interactiveColorAccentError: '#e00000',
|
|
91
|
+
interactiveColorAccentErrorStrong: '#a01d26'
|
|
69
92
|
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* ## Neutral colors
|
|
73
|
-
* Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough.
|
|
74
|
-
*
|
|
75
|
-
* @colorSet verbose
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
93
|
var neutralColors = {
|
|
79
94
|
white: '#ffffff',
|
|
95
|
+
neutral50: '#f2f2f2',
|
|
80
96
|
neutral100: '#f0f0f0',
|
|
81
97
|
neutral200: '#e6e6e6',
|
|
82
98
|
neutral300: '#dddddd',
|
|
83
99
|
neutral400: '#cacaca',
|
|
84
100
|
neutral500: '#b8b8b8',
|
|
85
|
-
black: '#000000'
|
|
101
|
+
black: '#000000',
|
|
102
|
+
transparent: 'transparent'
|
|
103
|
+
};
|
|
104
|
+
var notificationColors = {
|
|
105
|
+
notificationColorInfoWeak: '#F0E5FF',
|
|
106
|
+
notificationColorInfo: '#8C4CEB',
|
|
107
|
+
notificationColorInfoStrong: '#40226D',
|
|
108
|
+
notificationColorPositiveWeak: '#CCEEFF',
|
|
109
|
+
notificationColorPositive: '#0076B2',
|
|
110
|
+
notificationColorPositiveStrong: '#054362',
|
|
111
|
+
notificationColorCautionWeak: '#FEE7B9',
|
|
112
|
+
notificationColorCaution: '#996600',
|
|
113
|
+
notificationColorCautionStrong: '#664400',
|
|
114
|
+
notificationColorNegativeWeak: '#FFE5E5',
|
|
115
|
+
notificationColorNegative: '#CF1717',
|
|
116
|
+
notificationColorNegativeStrong: '#5D0A0A'
|
|
117
|
+
};
|
|
118
|
+
var severityColors = {
|
|
119
|
+
severityColorCustom: '#5D6596',
|
|
120
|
+
severityColorUnknown: '#656C75',
|
|
121
|
+
severityColorInfo: '#864AE0',
|
|
122
|
+
severityColorNormal: '#017580',
|
|
123
|
+
severityColorNotice: '#A65503',
|
|
124
|
+
severityColorWarning: '#BD410B',
|
|
125
|
+
severityColorAlert: '#CC2D37',
|
|
126
|
+
severityColorCritical: '#C2306F',
|
|
127
|
+
severityColorEmergency: '#B53394'
|
|
86
128
|
};
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* ## Status colors
|
|
90
|
-
* Status colors are reserved for communicating urgency and severity associated with data objects and to categorize the visual communication of system responses.
|
|
91
|
-
*
|
|
92
|
-
* @colorSet verbose
|
|
93
|
-
*/
|
|
94
129
|
var statusColors = {
|
|
95
130
|
statusColorInfo: '#006be5',
|
|
96
131
|
statusColorInfoWeak: (0, _tinycolor["default"])('#006be5').lighten(10).toHexString(),
|
|
@@ -111,39 +146,12 @@ var statusColors = {
|
|
|
111
146
|
statusColorCriticalWeak: (0, _tinycolor["default"])('#9e1534').lighten(10).toHexString(),
|
|
112
147
|
statusColorCriticalStrong: (0, _tinycolor["default"])('#9e1534').darken(10).toHexString()
|
|
113
148
|
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* ## Accent colors
|
|
117
|
-
* Accent colors aid and categorize the visual communication of the system response.
|
|
118
|
-
*
|
|
119
|
-
* @colorSet verbose
|
|
120
|
-
*/
|
|
121
|
-
var accentColors = {
|
|
122
|
-
accentColorPositive: statusColors.statusColorNormal,
|
|
123
|
-
accentColorWarning: statusColors.statusColorMedium,
|
|
124
|
-
accentColorAlert: '#c6400d',
|
|
125
|
-
accentColorNegative: statusColors.statusColorHigh
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* ## Elevation shadows
|
|
130
|
-
*
|
|
131
|
-
* @shadowSet
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
149
|
var elevationShadows = {
|
|
135
|
-
embossShadow: '
|
|
150
|
+
embossShadow: '0px 1px 5px rgba(0, 0, 0, 0.07), 0px 0px 1px rgba(0, 0, 0, 0.07)',
|
|
136
151
|
overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)',
|
|
137
152
|
dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.13), 0px 11px 18px rgba(0, 0, 0, 0.06), 0px 3px 6px rgba(0, 0, 0, 0.06)',
|
|
138
153
|
modalShadow: '0px 50px 200px rgba(0, 0, 0, 0.3), 0px 29px 66px rgba(0, 0, 0, 0.08), 0px 29px 47px rgba(0, 0, 0, 0.08), 0px 5px 10px rgba(0, 0, 0, 0.03)'
|
|
139
154
|
};
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* ## Syntax colors
|
|
143
|
-
* Syntax colors are used only for code blocks.
|
|
144
|
-
*
|
|
145
|
-
* @colorSet verbose alphabetical
|
|
146
|
-
*/
|
|
147
155
|
var syntaxColors = {
|
|
148
156
|
syntaxBlue: '#0f7594',
|
|
149
157
|
syntaxBrown: '#9f6404',
|
|
@@ -155,6 +163,13 @@ var syntaxColors = {
|
|
|
155
163
|
syntaxRed: '#db1e47',
|
|
156
164
|
syntaxTeal: '#1d7c6b'
|
|
157
165
|
};
|
|
158
|
-
var
|
|
166
|
+
var deprecated = {
|
|
167
|
+
accentColorPositive: statusColors.statusColorNormal,
|
|
168
|
+
accentColorWarning: statusColors.statusColorMedium,
|
|
169
|
+
accentColorAlert: '#c6400d',
|
|
170
|
+
accentColorNegative: statusColors.statusColorHigh,
|
|
171
|
+
interactiveColorPrimary: '#0264d7'
|
|
172
|
+
};
|
|
173
|
+
var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, actionColors), notificationColors), severityColors), statusColors), elevationShadows), backgroundColors), borderColors), contentColors), neutralColors), interactiveColors), syntaxColors), deprecated);
|
|
159
174
|
var _default = theme;
|
|
160
175
|
exports["default"] = _default;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
|
8
|
+
var _magneticTokensLight = _interopRequireDefault(require("./magneticTokensLight"));
|
|
9
|
+
var _magneticTokensDark = _interopRequireDefault(require("./magneticTokensDark"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
|
+
/**
|
|
18
|
+
* Handles mapping both our light and dark categorical colors to their appropriate Magnetic token value
|
|
19
|
+
* Note: Unlike other tokens dark + light tokens for these exists on either colorSchem so both sets need mapped.
|
|
20
|
+
*/
|
|
21
|
+
var mapMagneticCategoricalColors = function mapMagneticCategoricalColors() {
|
|
22
|
+
var tokenMap = {
|
|
23
|
+
categorical1D1: '',
|
|
24
|
+
categorical1D2: '',
|
|
25
|
+
categorical1D3: '',
|
|
26
|
+
categorical1D4: '',
|
|
27
|
+
categorical1D5: '',
|
|
28
|
+
categorical1D6: '',
|
|
29
|
+
categorical1D7: '',
|
|
30
|
+
categorical2D1: '',
|
|
31
|
+
categorical2D2: '',
|
|
32
|
+
categorical2D3: '',
|
|
33
|
+
categorical2D4: '',
|
|
34
|
+
categorical2D5: '',
|
|
35
|
+
categorical2D6: '',
|
|
36
|
+
categorical2D7: '',
|
|
37
|
+
categorical1L1: '',
|
|
38
|
+
categorical1L2: '',
|
|
39
|
+
categorical1L3: '',
|
|
40
|
+
categorical1L4: '',
|
|
41
|
+
categorical1L5: '',
|
|
42
|
+
categorical1L6: '',
|
|
43
|
+
categorical1L7: '',
|
|
44
|
+
categorical2L1: '',
|
|
45
|
+
categorical2L2: '',
|
|
46
|
+
categorical2L3: '',
|
|
47
|
+
categorical2L4: '',
|
|
48
|
+
categorical2L5: '',
|
|
49
|
+
categorical2L6: '',
|
|
50
|
+
categorical2L7: ''
|
|
51
|
+
};
|
|
52
|
+
var magneticTokenLetters = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
|
|
53
|
+
for (var i = 0; i < 7; i += 1) {
|
|
54
|
+
var magneticCat1TokenName = "accent-".concat(magneticTokenLetters[i], "-default");
|
|
55
|
+
var magneticCat2TokenName = "accent-".concat(magneticTokenLetters[i], "-weak-default");
|
|
56
|
+
|
|
57
|
+
// Splunk light mode tokens (yes D + L are opposite of what you would think)
|
|
58
|
+
var splunkLightCat1TokenName = "categorical1D".concat(i + 1);
|
|
59
|
+
tokenMap[splunkLightCat1TokenName] = _magneticTokensLight["default"][magneticCat1TokenName];
|
|
60
|
+
var splunkLightCat2TokenName = "categorical2D".concat(i + 1);
|
|
61
|
+
tokenMap[splunkLightCat2TokenName] = _magneticTokensLight["default"][magneticCat2TokenName];
|
|
62
|
+
|
|
63
|
+
// Splunk dark mode tokens (yes D + L are opposite of what you would think)
|
|
64
|
+
var splunkDarkCat1TokenName = "categorical1L".concat(i + 1);
|
|
65
|
+
tokenMap[splunkDarkCat1TokenName] = _magneticTokensDark["default"][magneticCat1TokenName];
|
|
66
|
+
var splunkDarkCat2TokenName = "categorical2L".concat(i + 1);
|
|
67
|
+
tokenMap[splunkDarkCat2TokenName] = _magneticTokensDark["default"][magneticCat2TokenName];
|
|
68
|
+
}
|
|
69
|
+
return tokenMap;
|
|
70
|
+
};
|
|
71
|
+
var magneticTypography = {
|
|
72
|
+
fontFamily: "Inter, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
73
|
+
fontFamilyTitle: "'Sharp Sans', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif",
|
|
74
|
+
monoFontFamily: "'Roboto Mono', ui-monospace, 'Courier New', Menlo, Monaco"
|
|
75
|
+
};
|
|
76
|
+
var splunkMagneticThemeCustomizer = function splunkMagneticThemeCustomizer(currentTheme) {
|
|
77
|
+
var pickMagnetic = function pickMagnetic(magneticTokenName) {
|
|
78
|
+
switch (currentTheme.colorScheme) {
|
|
79
|
+
case 'light':
|
|
80
|
+
return _magneticTokensLight["default"][magneticTokenName];
|
|
81
|
+
case 'dark':
|
|
82
|
+
return _magneticTokensDark["default"][magneticTokenName];
|
|
83
|
+
default:
|
|
84
|
+
if (false) {
|
|
85
|
+
// ensure all possible known types had case statements: https://www.typescriptlang.org/docs/handbook/2/narrowing.html#exhaustiveness-checking
|
|
86
|
+
var exhaustiveCheck = currentTheme.colorScheme;
|
|
87
|
+
// eslint-disable-next-line no-console
|
|
88
|
+
console.log("Unknown theme colorScheme, ".concat(exhaustiveCheck, "."));
|
|
89
|
+
}
|
|
90
|
+
return '';
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, currentTheme), magneticTypography), mapMagneticCategoricalColors()), {}, {
|
|
94
|
+
accentColor: pickMagnetic('brand-accent-border-default'),
|
|
95
|
+
actionColorBackgroundDestructive: pickMagnetic('negative-bg-default'),
|
|
96
|
+
actionColorBackgroundDestructiveActive: pickMagnetic('negative-bg-active'),
|
|
97
|
+
actionColorBackgroundDestructiveDisabled: pickMagnetic('negative-bg-disabled'),
|
|
98
|
+
actionColorBackgroundDestructiveHover: pickMagnetic('negative-bg-hover'),
|
|
99
|
+
actionColorBackgroundDestructiveSecondary: pickMagnetic('interact-bg-weak-disabled'),
|
|
100
|
+
actionColorBackgroundDestructiveSecondaryActive: pickMagnetic('negative-bg-weak-active'),
|
|
101
|
+
actionColorBackgroundDestructiveSecondaryDisabled: pickMagnetic('negative-bg-weak-disabled'),
|
|
102
|
+
actionColorBackgroundDestructiveSecondaryHover: pickMagnetic('negative-bg-weak-hover'),
|
|
103
|
+
actionColorBackgroundPrimary: pickMagnetic('interact-bg-default'),
|
|
104
|
+
actionColorBackgroundPrimaryActive: pickMagnetic('interact-bg-active'),
|
|
105
|
+
actionColorBackgroundPrimaryDisabled: pickMagnetic('interact-bg-disabled'),
|
|
106
|
+
actionColorBackgroundPrimaryHover: pickMagnetic('interact-bg-hover'),
|
|
107
|
+
actionColorBackgroundSecondary: pickMagnetic('interact-bg-weak-default'),
|
|
108
|
+
actionColorBackgroundSecondaryActive: pickMagnetic('interact-bg-weak-active'),
|
|
109
|
+
actionColorBackgroundSecondaryDisabled: pickMagnetic('interact-bg-weak-disabled'),
|
|
110
|
+
actionColorBackgroundSecondaryHover: pickMagnetic('interact-bg-weak-hover'),
|
|
111
|
+
actionColorBackgroundSubtle: pickMagnetic('interact-bg-weak-default'),
|
|
112
|
+
actionColorBackgroundSubtleActive: pickMagnetic('interact-bg-weak-active'),
|
|
113
|
+
actionColorBackgroundSubtleDisabled: pickMagnetic('interact-bg-weak-disabled'),
|
|
114
|
+
actionColorBackgroundSubtleHover: pickMagnetic('interact-bg-weak-hover'),
|
|
115
|
+
actionColorBorder: pickMagnetic('interact-border-default'),
|
|
116
|
+
actionColorBorderDestructiveSecondary: pickMagnetic('negative-border-default'),
|
|
117
|
+
actionColorBorderDestructiveSecondaryActive: pickMagnetic('negative-border-active'),
|
|
118
|
+
actionColorBorderDestructiveSecondaryDisabled: pickMagnetic('negative-border-disabled'),
|
|
119
|
+
actionColorBorderDestructiveSecondaryHover: pickMagnetic('negative-border-hover'),
|
|
120
|
+
actionColorBorderSecondary: pickMagnetic('interact-border-default'),
|
|
121
|
+
actionColorBorderSecondaryActive: pickMagnetic('interact-border-active'),
|
|
122
|
+
actionColorBorderSecondaryDisabled: pickMagnetic('interact-border-disabled'),
|
|
123
|
+
actionColorBorderSecondaryHover: pickMagnetic('interact-border-hover'),
|
|
124
|
+
actionColorBorderWeak: pickMagnetic('interact-border-weak-default'),
|
|
125
|
+
actionColorPrimary: pickMagnetic('interact-bg-default'),
|
|
126
|
+
actionColorDestructive: pickMagnetic('negative-bg-default'),
|
|
127
|
+
actionColorDestructiveStrong: pickMagnetic('negative-bg-strong-default'),
|
|
128
|
+
actionColorDestructiveWeak: pickMagnetic('negative-bg-weak-default'),
|
|
129
|
+
backgroundColorDialog: pickMagnetic('control-bg-weak-default'),
|
|
130
|
+
backgroundColorInverted: pickMagnetic('inverse-bg-default'),
|
|
131
|
+
backgroundColorPage: pickMagnetic('base-bg-default'),
|
|
132
|
+
backgroundColorNavigation: currentTheme.colorScheme === 'light' ? "linear-gradient(90deg, ".concat(_magneticTokensLight["default"]['inverse-bg-gradient-start'], ", ").concat(_magneticTokensLight["default"]['inverse-bg-gradient-end']) : "linear-gradient(90deg, ".concat(_magneticTokensDark["default"]['inverse-bg-gradient-start'], ", ").concat(_magneticTokensDark["default"]['inverse-bg-gradient-end']),
|
|
133
|
+
backgroundColorPopup: pickMagnetic('base-bg-weak-default'),
|
|
134
|
+
backgroundColorScrim: pickMagnetic('control-bg-weak-default'),
|
|
135
|
+
backgroundColorSidebar: pickMagnetic('base-bg-default'),
|
|
136
|
+
backgroundColorSection: pickMagnetic('base-bg-weak-default'),
|
|
137
|
+
borderColor: pickMagnetic('base-border-default'),
|
|
138
|
+
borderColorStrong: pickMagnetic('base-border-strong-default'),
|
|
139
|
+
borderColorWeak: pickMagnetic('base-border-weak-default'),
|
|
140
|
+
contentBackgroundColorNegativeWeak: pickMagnetic('negative-bg-strong-default'),
|
|
141
|
+
contentColorActive: pickMagnetic('base-text-default'),
|
|
142
|
+
contentColorDefault: pickMagnetic('base-text-default'),
|
|
143
|
+
contentColorDisabled: pickMagnetic('interact-text-in-disabled'),
|
|
144
|
+
contentColorInverted: pickMagnetic('interact-text-in-default'),
|
|
145
|
+
contentColorMuted: pickMagnetic('base-text-weak-default'),
|
|
146
|
+
contentColorNegative: pickMagnetic('negative-text-default'),
|
|
147
|
+
embossShadow: '0px 2px 5px 0px rgba(0, 0, 0, 0.05)',
|
|
148
|
+
focusColor: pickMagnetic('control-border-focus'),
|
|
149
|
+
focusShadow: currentTheme.colorScheme === 'light' ? "0 0 0 2px ".concat(_magneticTokensLight["default"]['interact-bg-weak-active'], ",0 0 0 4px ").concat(_magneticTokensLight["default"]['control-border-focus']) : "0 0 0 2px ".concat(_magneticTokensDark["default"]['interact-bg-weak-active'], ",0 0 0 4px ").concat(_magneticTokensDark["default"]['control-border-focus']),
|
|
150
|
+
interactiveColorAccent: pickMagnetic('control-bg-strong-default'),
|
|
151
|
+
interactiveColorAccentError: pickMagnetic('negative-bg-medium-default'),
|
|
152
|
+
interactiveColorAccentErrorStrong: pickMagnetic('negative-bg-strong-default'),
|
|
153
|
+
interactiveColorAccentErrorWeak: pickMagnetic('negative-bg-weak-default'),
|
|
154
|
+
interactiveColorBackground: pickMagnetic('control-bg-default'),
|
|
155
|
+
interactiveColorBackgroundDisabled: pickMagnetic('control-bg-disabled'),
|
|
156
|
+
interactiveColorBorder: pickMagnetic('control-border-default'),
|
|
157
|
+
interactiveColorBorderDisabled: pickMagnetic('control-border-disabled'),
|
|
158
|
+
interactiveColorBorderDisabledError: pickMagnetic('negative-border-weak-disabled'),
|
|
159
|
+
interactiveColorBorderHover: pickMagnetic('control-border-hover'),
|
|
160
|
+
linkColor: pickMagnetic('interact-text-default'),
|
|
161
|
+
modalShadow: '0px 4px 12px 0px rgba(0, 0, 0, 0.12)',
|
|
162
|
+
overlayShadow: '0px 4px 12px 0px rgba(0,0,0,0.18)',
|
|
163
|
+
statusColorHigh: pickMagnetic('negative-icon-default'),
|
|
164
|
+
statusColorHighStrong: pickMagnetic('negative-border-strong-default'),
|
|
165
|
+
statusColorHighWeak: pickMagnetic('negative-bg-medium-default'),
|
|
166
|
+
statusColorInfo: pickMagnetic('info-icon-default'),
|
|
167
|
+
statusColorInfoStrong: currentTheme.colorScheme === 'light' ? (0, _tinycolor["default"])(pickMagnetic('info-icon-default')).darken(10).toRgbString() : (0, _tinycolor["default"])(pickMagnetic('info-icon-default')).lighten(10).toRgbString(),
|
|
168
|
+
statusColorInfoWeak: pickMagnetic('info-bg-medium-default'),
|
|
169
|
+
statusColorMedium: pickMagnetic('warning-icon-strong-default'),
|
|
170
|
+
statusColorMediumStrong: pickMagnetic('warning-border-strong-default'),
|
|
171
|
+
statusColorMediumWeak: pickMagnetic('warning-bg-medium-default'),
|
|
172
|
+
statusColorNormal: pickMagnetic('positive-icon-strong-default'),
|
|
173
|
+
statusColorNormalStrong: pickMagnetic('positive-border-strong-default'),
|
|
174
|
+
statusColorNormalWeak: pickMagnetic('positive-bg-medium-default')
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
var _default = splunkMagneticThemeCustomizer;
|
|
178
|
+
exports["default"] = _default;
|