@splunk/themes 1.0.0 → 1.1.0
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 +48 -28
- package/clearAllCaches.js +24 -0
- package/enterprise/dark.js +3 -3
- package/enterprise/index.js +3 -3
- package/enterprise/light.js +6 -7
- package/index.js +9 -1
- package/mixins/index.js +30 -19
- package/mixins/resets.js +96 -0
- package/mixins/typography.js +3 -3
- package/mixins/utilityMixins.js +41 -52
- package/package.json +2 -2
- package/prisma/base.js +1 -1
- package/prisma/dark.js +2 -2
- package/prisma/index.js +4 -4
- package/prisma/light.js +11 -11
- package/splunk-magnetic/index.js +18 -2
- package/splunk-magnetic/magneticTokensCore.js +390 -0
- package/splunk-magnetic/magneticTokensDark.js +4 -0
- package/splunk-magnetic/magneticTokensLight.js +4 -0
- package/storybook-addon-splunk-themes/SplunkThemesTool.js +12 -2
- package/storybook-addon-splunk-themes/constants.js +3 -1
- package/storybook-addon-splunk-themes/themes.js +1 -1
- package/storybook-addon-splunk-themes/withSplunkTheme.js +2 -2
- package/types/clearAllCaches.d.ts +10 -0
- package/types/enterprise/dark.d.ts +21 -21
- package/types/enterprise/index.d.ts +3 -3
- package/types/enterprise/light.d.ts +21 -21
- package/types/index.d.ts +1 -0
- package/types/mixins/index.d.ts +6 -3
- package/types/mixins/resets.d.ts +47 -0
- package/types/mixins/tests/resets.unit.d.ts +1 -0
- package/types/mixins/utilityMixins.d.ts +25 -23
- package/types/prisma/index.d.ts +4 -4
- package/types/splunk-magnetic/index.d.ts +170 -170
- package/types/splunk-magnetic/magneticTokensCore.d.ts +384 -0
- package/types/storybook-addon-splunk-themes/constants.d.ts +1 -0
- package/types/utils.d.ts +1 -0
- package/utils.js +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
1.1.0 - July 2, 2025
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* `@splunk/themes/storybook-addon-splunk-themes` now supports disabling 'both' option via `disableDualTheme` story param (SUI-7702).
|
|
8
|
+
* Added `pageBase` mixin for `html` and `body` base styling (SUI-7665).
|
|
9
|
+
* New `skipLink` mixin (SUI-7854)
|
|
10
|
+
|
|
11
|
+
Bug Fixes:
|
|
12
|
+
* Updated Prisma and Magnetic light syntax token values to maintain 4.5:1 contrast with line highlight (SUI-6644).
|
|
13
|
+
* Tokens updated: `syntaxBlue`, `syntaxBrown`, `syntaxGray`, `syntaxGreen`, `syntaxHighlight`, `syntaxOrange`, `syntaxPink`, `syntaxPurple`, `syntaxRed`, and `syntaxTeal`.
|
|
14
|
+
* Updated `actionColorBackgroundSecondaryActive` token values in Enterprise and Prisma themes to fix visual regression in `Radio Bar` (SUI-7864).
|
|
15
|
+
* Updated `interactiveColorOverlayActive` token values in Prisma and Enterprise themes to match `actionColorBackgroundSecondaryActive` values for consistent active overlay states (SUI-7864).
|
|
16
|
+
* Updated enterprise theme light mode neutral color tokens `neutral300`, `neutral400`, and `neutral500` to fix lightness steps from previous changes. (SUI-7879)
|
|
17
|
+
* Added neutral tokens (`neutral50`, `neutral100`, `neutral200`, `neutral300`, `neutral400`, `neutral500`) to Magnetic theme customizer with light and dark color scheme support, matching Enterprise and Prisma theme. (SUI-7879)
|
|
18
|
+
|
|
19
|
+
1.0.1 - June 5, 2025
|
|
20
|
+
----------
|
|
21
|
+
Bug Fixes:
|
|
22
|
+
* Corrected `@types/react` peer dependency to allow `@types/react` `16` or `17` (SUI-7838).
|
|
23
|
+
|
|
4
24
|
1.0.0 - June 3, 2025
|
|
5
25
|
----------
|
|
6
26
|
* Includes all changes from `1.0.0-beta` and `1.0.0-rc` releases.
|
|
7
27
|
|
|
8
|
-
Bug
|
|
28
|
+
Bug Fixes:
|
|
9
29
|
* Color variables `backgroundColorPage`, `backgroundColorNavigation`,`backgroundColorSideBar`,`neutral50`,`neutral100` and `neutral200` in Enterprise light have been updated to align better with Prisma themes (SUI-7584).
|
|
10
30
|
* `@types/react` peer dependency now includes `^16 | ^17` and no longer blocks installation using `npm` in React 16 or 17 environments (SUI-7838).
|
|
11
31
|
* Color variables for `actionColorBorderSecondary*`, `actionColorBackgroundSecondary*`, and `interactiveColorBorderDisabled` have been updated to align with both Prisma and Enterprise themes (SUI-7839).
|
|
12
32
|
|
|
13
33
|
1.0.0-rc.2 - May 28, 2025
|
|
14
34
|
----------
|
|
15
|
-
* Release candidate 2
|
|
35
|
+
* Release candidate 2.
|
|
16
36
|
|
|
17
37
|
1.0.0-rc.1 - May 14, 2025
|
|
18
38
|
----------
|
|
@@ -30,20 +50,20 @@ New Features:
|
|
|
30
50
|
New Features:
|
|
31
51
|
* New `inputBorderWidth` variable (SUI-7384).
|
|
32
52
|
|
|
33
|
-
Bug Fixes:
|
|
34
|
-
* Fixes broken CSS for Splunk Magnetic's `backgroundColorNavigation` override (SUI-7653).
|
|
35
|
-
|
|
36
|
-
Deprecations:
|
|
37
|
-
* `statusColor*`s have been deprecated. Instead use the appropriate `notificationColor*` or `severityColor*`(SUI-7303)
|
|
38
|
-
|
|
39
53
|
API Changes:
|
|
40
54
|
* `typescript` version is now `^5.8.3` (SUI-7601).
|
|
41
55
|
* `borderActiveColor` has been deprecated. (SUI-7633).
|
|
42
|
-
|
|
56
|
+
* Use `interactiveColorBorderActive` for Data Entry components or `actionColorBorderSecondaryActive` for Buttons.
|
|
43
57
|
* `backgroundColorHover` have been deprecated. (SUI-7633).
|
|
44
|
-
|
|
58
|
+
* Use `interactiveColorOverlayHover` for Data Entry components or `actionColorBackgroundSecondaryHover` for Buttons.
|
|
45
59
|
* `hoverShadow` has been deprecated. See notes on `backgroundColorHover` for hover affordances. (SUI-7621)
|
|
46
60
|
|
|
61
|
+
Bug Fixes:
|
|
62
|
+
* Fixes broken CSS for Splunk Magnetic's `backgroundColorNavigation` override (SUI-7653).
|
|
63
|
+
|
|
64
|
+
Deprecations:
|
|
65
|
+
* `statusColor*`s have been deprecated. Instead use the appropriate `notificationColor*` or `severityColor*`(SUI-7303).
|
|
66
|
+
|
|
47
67
|
1.0.0-beta.3 - April 2, 2025
|
|
48
68
|
----------
|
|
49
69
|
New Features:
|
|
@@ -64,15 +84,15 @@ New Features:
|
|
|
64
84
|
* New `contentColorLink` variable (SUI-3568).
|
|
65
85
|
* The data-viz variables are supported in all themes (SUI-3568).
|
|
66
86
|
|
|
67
|
-
Deprecations:
|
|
68
|
-
* `linkColor` and `linkColorHover` have been deprecated. Instead use `contentColorLink` (SUI-3568).
|
|
69
|
-
|
|
70
87
|
API Changes:
|
|
71
88
|
* `accentColor` variable has been removed from Prisma themes (SUI-3568).
|
|
72
89
|
* `borderColor`, `borderColorStrong`, and `borderColorWeak` have had alpha removed from their values (SUI-7340).
|
|
73
90
|
* `embossShadow`, `overlayShadow`, `dragShadow`, and `modalShadow` variables have been updated in Enterprise themes to match Prisma (SUI-7334).
|
|
74
91
|
* Enterprise only tokens have been deprecated: `brandColor*`, `gray*`, `accentColor*`, `errorColor*`, `alertColor*`, `warningColor*`, `successColor*`, `infoColor*`, `diverging*Color*`, and `cat*Color*`.
|
|
75
92
|
|
|
93
|
+
Deprecations:
|
|
94
|
+
* `linkColor` and `linkColorHover` have been deprecated. Instead use `contentColorLink` (SUI-3568).
|
|
95
|
+
|
|
76
96
|
1.0.0-beta.1 - February 20, 2025
|
|
77
97
|
----------
|
|
78
98
|
New Features:
|
|
@@ -93,19 +113,14 @@ New Features:
|
|
|
93
113
|
* New `layout` mixin (SUI-6678).
|
|
94
114
|
* Enterprise themes now support color variable `backgroundColorSidebar` (SUI-7102).
|
|
95
115
|
|
|
96
|
-
Deprecations:
|
|
97
|
-
* Enterprise theme tokens `textColor`, `textGray`, and `textDisabledColor` have been deprecated (SUI-6160).
|
|
98
|
-
* Enterprise theme token `backgroundColor` has been deprecated (SUI-6656).
|
|
99
|
-
* `accentColorPositive`, `accentColorWarning`, `accentColorAlert`, and `accentColorNegative` have been deprecated (SUI-3658).
|
|
100
|
-
|
|
101
116
|
API Changes:
|
|
102
117
|
* `react` and `react-dom` peer dependencies are now `"^16.8.0 || ^17.0.0 || ^18.0.0"`.
|
|
103
118
|
* `px` sizing for `variables.fontSize*` and `mixins.typography` have been replaced with `rem` sizing (SUI-5509).
|
|
104
|
-
|
|
119
|
+
* This results in minor differences in text sizing; but is required to meet WCAG 1.4.4 and WCAG 1.4.10.
|
|
105
120
|
* `typography` `size` param no longer supports `56` `36` `32` and `10`.
|
|
106
121
|
* `variables.lineHeight` is no longer defined in `px` to improve readability of font at all scales (SUI-5509).
|
|
107
122
|
* `typography`'s mixin for `Title5`'s has been updated to text color `variables.contentColorActive` in Prisma theme (SUI-5685).
|
|
108
|
-
|
|
123
|
+
* This change affects `Heading` and `Typography` components.
|
|
109
124
|
* The font size and line height no longer change with density. The default font-size in Enterprise Compact now is 14px (SUI-5508).
|
|
110
125
|
* `typography`'s `line-height`, `size`, and `font-weight` values have been consolidated between Enterprise and Prisma themes (SUI-5684).
|
|
111
126
|
* `typography`'s `withReset` prop has been removed (SUI-5686).
|
|
@@ -123,6 +138,11 @@ API Changes:
|
|
|
123
138
|
* `fontSizeXLarge` size has been changed (SUI-6593).
|
|
124
139
|
* Enterprise themes support the `contentColorActive`, `contentColorDefault`, `contentColorDisabled`, `contentColorInverted`, and `contentColorMuted` tokens (SUI-6160).
|
|
125
140
|
|
|
141
|
+
Deprecations:
|
|
142
|
+
* Enterprise theme tokens `textColor`, `textGray`, and `textDisabledColor` have been deprecated (SUI-6160).
|
|
143
|
+
* Enterprise theme token `backgroundColor` has been deprecated (SUI-6656).
|
|
144
|
+
* `accentColorPositive`, `accentColorWarning`, `accentColorAlert`, and `accentColorNegative` have been deprecated (SUI-3658).
|
|
145
|
+
|
|
126
146
|
0.24.0 - May 6, 2025
|
|
127
147
|
----------
|
|
128
148
|
Bug Fixes:
|
|
@@ -162,9 +182,9 @@ API Changes:
|
|
|
162
182
|
New Features:
|
|
163
183
|
|
|
164
184
|
* All themes now support color variables for decorative borders:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
185
|
+
* `borderColorStrong` and `borderColorWeak` added to all themes
|
|
186
|
+
* `borderColor` now also available in Prisma themes
|
|
187
|
+
* Note: Use `interactiveColorBorder` when creating a border for an interactive control
|
|
168
188
|
|
|
169
189
|
Bug Fixes:
|
|
170
190
|
* Enterprise light theme `interactiveColorBorder` value has been updated to meet contrast requirements.
|
|
@@ -179,7 +199,7 @@ API Changes:
|
|
|
179
199
|
New Features:
|
|
180
200
|
* Added new variable `activeBorder`.
|
|
181
201
|
|
|
182
|
-
0.16.4 -
|
|
202
|
+
0.16.4 - December 5, 2023
|
|
183
203
|
----------
|
|
184
204
|
Bug Fixes:
|
|
185
205
|
* `syntaxColors` have been updated to meet A11y_WCAG 1.4.3 contrast requirements for prisma and enterprise themes (SUI-5750).
|
|
@@ -207,12 +227,12 @@ API Changes:
|
|
|
207
227
|
|
|
208
228
|
0.16.0 - April 6, 2023
|
|
209
229
|
----------
|
|
210
|
-
New Features:
|
|
211
|
-
* Added variables for supported font weights; the `typography` mixin's `weight` param supports these as keyword values (SUI-5344).
|
|
212
|
-
|
|
213
230
|
Breaking Changes:
|
|
214
231
|
* `typography` mixin's `weight` param now only accepts keyword values. Number values have been removed (SUI-5344).
|
|
215
232
|
|
|
233
|
+
New Features:
|
|
234
|
+
* Added variables for supported font weights; the `typography` mixin's `weight` param supports these as keyword values (SUI-5344).
|
|
235
|
+
|
|
216
236
|
Bug Fixes:
|
|
217
237
|
* `typography` mixin properly applies correct CSS for `weight` params (SUI-5344).
|
|
218
238
|
|
|
@@ -401,4 +421,4 @@ Notes:
|
|
|
401
421
|
|
|
402
422
|
0.2.0 - June 30, 2018
|
|
403
423
|
----------
|
|
404
|
-
* Initial Release
|
|
424
|
+
* Initial Release.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.clearAllCaches = void 0;
|
|
7
|
+
var _getTheme = require("./getTheme");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
var _variables = require("./variables");
|
|
10
|
+
/**
|
|
11
|
+
* Note: Use with caution, as this will clear all caches in the themes package.
|
|
12
|
+
*
|
|
13
|
+
* Clear the `getTheme`, `customizedTheme`, and `variables` caches.
|
|
14
|
+
*
|
|
15
|
+
* (Note: Having this in utils causes a build time error in the themes package, due to import cycles.)
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
var clearAllCaches = function clearAllCaches() {
|
|
20
|
+
(0, _getTheme.clearGetThemeCache)();
|
|
21
|
+
(0, _utils.clearCustomizedThemeCache)();
|
|
22
|
+
(0, _variables.clearVariablesCache)();
|
|
23
|
+
};
|
|
24
|
+
exports.clearAllCaches = clearAllCaches;
|
package/enterprise/dark.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
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); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports["default"] = void 0;
|
|
8
7
|
var _light = _interopRequireDefault(require("./light"));
|
|
9
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
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; }
|
|
@@ -77,7 +77,7 @@ var actionColors = {
|
|
|
77
77
|
actionColorBackgroundPrimaryDisabled: '#163b1b',
|
|
78
78
|
actionColorBackgroundPrimaryHover: '#6eba78',
|
|
79
79
|
actionColorBackgroundSecondary: 'transparent',
|
|
80
|
-
actionColorBackgroundSecondaryActive: 'rgba(
|
|
80
|
+
actionColorBackgroundSecondaryActive: 'rgba(225, 225, 225, 0.16)',
|
|
81
81
|
actionColorBackgroundSecondaryDisabled: 'transparent',
|
|
82
82
|
actionColorBackgroundSecondaryHover: 'rgba(255, 255, 255, 0.05)',
|
|
83
83
|
actionColorBackgroundSubtle: 'transparent',
|
|
@@ -108,7 +108,7 @@ var interactiveColors = {
|
|
|
108
108
|
interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.3)',
|
|
109
109
|
interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)',
|
|
110
110
|
interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)',
|
|
111
|
-
interactiveColorOverlayActive: 'rgba(
|
|
111
|
+
interactiveColorOverlayActive: 'rgba(225, 225, 225, 0.16)',
|
|
112
112
|
interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)',
|
|
113
113
|
interactiveColorBackground: 'transparent',
|
|
114
114
|
interactiveColorBackgroundDisabled: 'transparent',
|
package/enterprise/index.js
CHANGED
|
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
var _light = _interopRequireDefault(require("./light"));
|
|
8
|
-
var _dark = _interopRequireDefault(require("./dark"));
|
|
9
|
-
var _compact = _interopRequireDefault(require("./compact"));
|
|
10
7
|
var _comfortable = _interopRequireDefault(require("./comfortable"));
|
|
8
|
+
var _compact = _interopRequireDefault(require("./compact"));
|
|
9
|
+
var _dark = _interopRequireDefault(require("./dark"));
|
|
10
|
+
var _light = _interopRequireDefault(require("./light"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
package/enterprise/light.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports["default"] = void 0;
|
|
7
|
-
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
|
8
8
|
var _dataViz = _interopRequireDefault(require("./dataViz"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
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); }
|
|
11
10
|
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; }
|
|
12
11
|
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; }
|
|
13
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; }
|
|
@@ -52,9 +51,9 @@ var neutralColors = {
|
|
|
52
51
|
neutral50: '#e8ebee',
|
|
53
52
|
neutral100: '#e1e5ea',
|
|
54
53
|
neutral200: '#dae0e7',
|
|
55
|
-
neutral300:
|
|
56
|
-
neutral400:
|
|
57
|
-
neutral500:
|
|
54
|
+
neutral300: '#d5dbe2',
|
|
55
|
+
neutral400: '#c9d1da',
|
|
56
|
+
neutral500: '#bbc4ce',
|
|
58
57
|
black: '#000000',
|
|
59
58
|
transparent: 'transparent'
|
|
60
59
|
};
|
|
@@ -143,7 +142,7 @@ var actionColors = {
|
|
|
143
142
|
actionColorBackgroundPrimaryDisabled: '#98d798',
|
|
144
143
|
actionColorBackgroundPrimaryHover: '#125e1c',
|
|
145
144
|
actionColorBackgroundSecondary: 'transparent',
|
|
146
|
-
actionColorBackgroundSecondaryActive: 'rgba(0, 0, 0, 0.
|
|
145
|
+
actionColorBackgroundSecondaryActive: 'rgba(0, 0, 0, 0.12)',
|
|
147
146
|
actionColorBackgroundSecondaryDisabled: 'transparent',
|
|
148
147
|
actionColorBackgroundSecondaryHover: 'rgba(0, 0, 0, 0.03)',
|
|
149
148
|
actionColorBackgroundSubtle: 'transparent',
|
|
@@ -174,7 +173,7 @@ var interactiveColors = {
|
|
|
174
173
|
interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)',
|
|
175
174
|
interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)',
|
|
176
175
|
interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)',
|
|
177
|
-
interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.
|
|
176
|
+
interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.12)',
|
|
178
177
|
interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)',
|
|
179
178
|
interactiveColorBackground: 'transparent',
|
|
180
179
|
interactiveColorBackgroundDisabled: 'transparent',
|
package/index.js
CHANGED
|
@@ -13,7 +13,8 @@ var _exportNames = {
|
|
|
13
13
|
unstable_splunkMagneticThemeCustomizer: true,
|
|
14
14
|
useSplunkTheme: true,
|
|
15
15
|
withSplunkTheme: true,
|
|
16
|
-
variables: true
|
|
16
|
+
variables: true,
|
|
17
|
+
clearAllCaches: true
|
|
17
18
|
};
|
|
18
19
|
Object.defineProperty(exports, "getSettingsFromThemedProps", {
|
|
19
20
|
enumerable: true,
|
|
@@ -75,6 +76,12 @@ Object.defineProperty(exports, "variables", {
|
|
|
75
76
|
return _variables["default"];
|
|
76
77
|
}
|
|
77
78
|
});
|
|
79
|
+
Object.defineProperty(exports, "clearAllCaches", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
get: function get() {
|
|
82
|
+
return _clearAllCaches.clearAllCaches;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
78
85
|
var _getSettingsFromThemedProps = _interopRequireDefault(require("./getSettingsFromThemedProps"));
|
|
79
86
|
var _getTheme = _interopRequireDefault(require("./getTheme"));
|
|
80
87
|
var _mixins = _interopRequireDefault(require("./mixins"));
|
|
@@ -85,6 +92,7 @@ var _splunkMagnetic = _interopRequireDefault(require("./splunk-magnetic"));
|
|
|
85
92
|
var _useSplunkTheme = _interopRequireDefault(require("./useSplunkTheme"));
|
|
86
93
|
var _withSplunkTheme = _interopRequireDefault(require("./withSplunkTheme"));
|
|
87
94
|
var _variables = _interopRequireDefault(require("./variables"));
|
|
95
|
+
var _clearAllCaches = require("./clearAllCaches");
|
|
88
96
|
var _types = require("./types");
|
|
89
97
|
Object.keys(_types).forEach(function (key) {
|
|
90
98
|
if (key === "default" || key === "__esModule") return;
|
package/mixins/index.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
|
|
7
|
+
layout: true,
|
|
8
8
|
prose: true,
|
|
9
|
-
|
|
9
|
+
typography: true
|
|
10
10
|
};
|
|
11
|
-
Object.defineProperty(exports, "
|
|
11
|
+
Object.defineProperty(exports, "layout", {
|
|
12
12
|
enumerable: true,
|
|
13
13
|
get: function get() {
|
|
14
|
-
return
|
|
14
|
+
return _layout["default"];
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "prose", {
|
|
@@ -20,54 +20,65 @@ Object.defineProperty(exports, "prose", {
|
|
|
20
20
|
return _prose["default"];
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
Object.defineProperty(exports, "
|
|
23
|
+
Object.defineProperty(exports, "typography", {
|
|
24
24
|
enumerable: true,
|
|
25
25
|
get: function get() {
|
|
26
|
-
return
|
|
26
|
+
return _typography["default"];
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
exports["default"] = void 0;
|
|
30
|
-
var
|
|
31
|
-
Object.keys(
|
|
30
|
+
var _layout = _interopRequireWildcard(require("./layout"));
|
|
31
|
+
Object.keys(_layout).forEach(function (key) {
|
|
32
32
|
if (key === "default" || key === "__esModule") return;
|
|
33
33
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
34
34
|
Object.defineProperty(exports, key, {
|
|
35
35
|
enumerable: true,
|
|
36
36
|
get: function get() {
|
|
37
|
-
return
|
|
37
|
+
return _layout[key];
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
var
|
|
42
|
-
Object.keys(
|
|
41
|
+
var _prose = _interopRequireWildcard(require("./prose"));
|
|
42
|
+
Object.keys(_prose).forEach(function (key) {
|
|
43
43
|
if (key === "default" || key === "__esModule") return;
|
|
44
44
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
45
45
|
Object.defineProperty(exports, key, {
|
|
46
46
|
enumerable: true,
|
|
47
47
|
get: function get() {
|
|
48
|
-
return
|
|
48
|
+
return _prose[key];
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
-
var
|
|
53
|
-
Object.keys(
|
|
52
|
+
var _resets = _interopRequireWildcard(require("./resets"));
|
|
53
|
+
Object.keys(_resets).forEach(function (key) {
|
|
54
54
|
if (key === "default" || key === "__esModule") return;
|
|
55
55
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
56
56
|
Object.defineProperty(exports, key, {
|
|
57
57
|
enumerable: true,
|
|
58
58
|
get: function get() {
|
|
59
|
-
return
|
|
59
|
+
return _resets[key];
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
-
var
|
|
64
|
-
Object.keys(
|
|
63
|
+
var _typography = _interopRequireWildcard(require("./typography"));
|
|
64
|
+
Object.keys(_typography).forEach(function (key) {
|
|
65
65
|
if (key === "default" || key === "__esModule") return;
|
|
66
66
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
67
67
|
Object.defineProperty(exports, key, {
|
|
68
68
|
enumerable: true,
|
|
69
69
|
get: function get() {
|
|
70
|
-
return
|
|
70
|
+
return _typography[key];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
var _utilityMixins = _interopRequireWildcard(require("./utilityMixins"));
|
|
75
|
+
Object.keys(_utilityMixins).forEach(function (key) {
|
|
76
|
+
if (key === "default" || key === "__esModule") return;
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
78
|
+
Object.defineProperty(exports, key, {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _utilityMixins[key];
|
|
71
82
|
}
|
|
72
83
|
});
|
|
73
84
|
});
|
|
@@ -79,7 +90,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
79
90
|
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; }
|
|
80
91
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
81
92
|
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); }
|
|
82
|
-
var _default = _objectSpread(_objectSpread({}, _utilityMixins["default"]), {}, {
|
|
93
|
+
var _default = _objectSpread(_objectSpread(_objectSpread({}, _resets["default"]), _utilityMixins["default"]), {}, {
|
|
83
94
|
layout: _layout["default"],
|
|
84
95
|
prose: _prose["default"],
|
|
85
96
|
typography: _typography["default"]
|
package/mixins/resets.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.reset = exports.pageBase = void 0;
|
|
7
|
+
var _styledComponents = require("styled-components");
|
|
8
|
+
var _pick = _interopRequireDefault(require("../pick"));
|
|
9
|
+
var _variables = _interopRequireDefault(require("../variables"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _templateObject2() {
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n color-scheme: ", ";\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n ", "\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]);
|
|
13
|
+
_templateObject2 = function _templateObject2() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _templateObject() {
|
|
19
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n box-sizing: border-box;\n color: ", ";\n color-scheme: ", ";\n font-family: ", ";\n margin: 0;\n "]);
|
|
20
|
+
_templateObject = function _templateObject() {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
26
|
+
/**
|
|
27
|
+
* The `pageBase` mixin provides essential base styling, intended for `html` and `body` elements.
|
|
28
|
+
* This should be used in global styles to establish consistent foundational styles
|
|
29
|
+
* including theme colors, typography, and layout basics.
|
|
30
|
+
*
|
|
31
|
+
* ##### Example
|
|
32
|
+
* ```js
|
|
33
|
+
* import styled from 'styled-components';
|
|
34
|
+
* import { pageBase } from '@splunk/themes/mixins';
|
|
35
|
+
*
|
|
36
|
+
* const GlobalStyle = createGlobalStyle`
|
|
37
|
+
* html,
|
|
38
|
+
* body {
|
|
39
|
+
* ${pageBase()}
|
|
40
|
+
* }
|
|
41
|
+
* `
|
|
42
|
+
* ```
|
|
43
|
+
* @name pageBase
|
|
44
|
+
* @kind function
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
var pageBase = function pageBase() {
|
|
49
|
+
return function () {
|
|
50
|
+
return (0, _styledComponents.css)(_templateObject(), _variables["default"].backgroundColorPage, _variables["default"].contentColorDefault, (0, _pick["default"])({
|
|
51
|
+
dark: 'dark',
|
|
52
|
+
light: 'light'
|
|
53
|
+
}), _variables["default"].fontFamily);
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The `reset` mixin resets css properties to their browser defaults, plus many to
|
|
59
|
+
* theme-specific values. This ensures an element is not inheriting inappropriate styles.
|
|
60
|
+
*
|
|
61
|
+
* ##### Example
|
|
62
|
+
* ```js
|
|
63
|
+
* import styled from 'styled-components';
|
|
64
|
+
* import { reset } from '@splunk/themes/mixins';
|
|
65
|
+
*
|
|
66
|
+
* const myBlock = styled.div`
|
|
67
|
+
* ${reset('block')};
|
|
68
|
+
* `
|
|
69
|
+
* ```
|
|
70
|
+
* @name reset
|
|
71
|
+
* @kind function
|
|
72
|
+
* @param {string} [display=inline] Set the `display` property (block, inline-block, …)
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
exports.pageBase = pageBase;
|
|
76
|
+
var reset = function reset() {
|
|
77
|
+
var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline';
|
|
78
|
+
var displayRule = display !== null ? "display: ".concat(display, ";") : '';
|
|
79
|
+
return function () {
|
|
80
|
+
return (0, _styledComponents.css)(_templateObject2(), (0, _pick["default"])({
|
|
81
|
+
/*
|
|
82
|
+
use pick() rather than relying on variables.colorScheme
|
|
83
|
+
because there's no guarantee that variables.colorScheme
|
|
84
|
+
has to match the css color-scheme prop
|
|
85
|
+
*/
|
|
86
|
+
dark: 'dark',
|
|
87
|
+
light: 'light'
|
|
88
|
+
}), _variables["default"].contentColorDefault, displayRule, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor);
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.reset = reset;
|
|
92
|
+
var _default = {
|
|
93
|
+
pageBase: pageBase,
|
|
94
|
+
reset: reset
|
|
95
|
+
};
|
|
96
|
+
exports["default"] = _default;
|
package/mixins/typography.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.typographyVariants = exports["default"] = void 0;
|
|
7
|
-
var _styledComponents = require("styled-components");
|
|
8
7
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
9
|
-
var
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
var _resets = require("./resets");
|
|
10
10
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
12
|
function _templateObject8() {
|
|
@@ -292,7 +292,7 @@ function typography(variantOrParams, additionalParams) {
|
|
|
292
292
|
withReset: mergedParams.withReset
|
|
293
293
|
};
|
|
294
294
|
return function () {
|
|
295
|
-
return (0, _styledComponents.css)(_templateObject8(), finalParams.withReset &&
|
|
295
|
+
return (0, _styledComponents.css)(_templateObject8(), finalParams.withReset && (0, _resets.reset)(null), finalParams.color, finalParams.family, finalParams.size, finalParams.weight, finalParams.lineHeight, finalParams.additionalStyles);
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
298
|
var _default = typography;
|