@splunk/themes 1.4.1 → 1.6.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 +19 -0
- package/design-tokens/colors.js +27 -25
- package/design-tokens/dataViz.js +33 -33
- package/design-tokens/deprecated.js +233 -39
- package/design-tokens/elevation.js +3 -4
- package/design-tokens/spacing-sizing.js +4 -2
- package/design-tokens/typography.js +14 -4
- package/enterprise/dark.js +3 -5
- package/enterprise/light.js +5 -6
- package/getTheme.js +3 -2
- package/mixins/prose.js +6 -6
- package/mixins/resets.js +2 -2
- package/package.json +5 -1
- package/prisma/base.js +3 -4
- package/prisma/light.js +2 -2
- package/splunk-magnetic/index.js +1 -1
- package/tokens.json +15153 -0
- package/types/design-tokens/colors.d.ts +41 -39
- package/types/design-tokens/dataViz.d.ts +1 -1
- package/types/design-tokens/deprecated.d.ts +452 -75
- package/types/design-tokens/elevation.d.ts +2 -4
- package/types/design-tokens/index.d.ts +2 -1
- package/types/design-tokens/spacing-sizing.d.ts +4 -2
- package/types/design-tokens/typography.d.ts +23 -4
- package/types/enterprise/dark.d.ts +2 -1
- package/types/enterprise/light.d.ts +2 -1
- package/types/mixins/prose.d.ts +4 -4
- package/types/prisma/base.d.ts +2 -1
- package/types/splunk-magnetic/index.d.ts +12 -6
package/enterprise/light.js
CHANGED
|
@@ -131,7 +131,7 @@ var contentColors = {
|
|
|
131
131
|
contentColorAccentWeak: '#b5e3b5',
|
|
132
132
|
contentColorNegative: '#c84535',
|
|
133
133
|
contentColorNegativeWeak: '#f5aca3',
|
|
134
|
-
contentColorLink:
|
|
134
|
+
contentColorLink: '#006297',
|
|
135
135
|
contentColorLinkDisabled: deprecatedEnterpriseColors.accentColorL30,
|
|
136
136
|
contentColorLinkVisited: '#864ae0',
|
|
137
137
|
contentColorLinkVisitedDisabled: '#e0ccff'
|
|
@@ -196,9 +196,6 @@ var interactiveColors = {
|
|
|
196
196
|
interactiveColorAccentErrorStrong: '#852d24',
|
|
197
197
|
interactiveColorAccentErrorWeak: '#ea958d'
|
|
198
198
|
};
|
|
199
|
-
var backgrounds = {
|
|
200
|
-
draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat")
|
|
201
|
-
};
|
|
202
199
|
var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
203
200
|
var typography = {
|
|
204
201
|
sansFontFamily: sansFontFamily,
|
|
@@ -217,6 +214,7 @@ var typography = {
|
|
|
217
214
|
fontWeightBold: 700,
|
|
218
215
|
fontWeightHeavy: 800,
|
|
219
216
|
fontWeightExtraBold: 900,
|
|
217
|
+
lineLengthMinimum: '34ch',
|
|
220
218
|
lineLength: '80ch',
|
|
221
219
|
lineHeight: '1.5',
|
|
222
220
|
lineHeightSingle: '1',
|
|
@@ -411,8 +409,9 @@ var deprecated = {
|
|
|
411
409
|
statusColorHighStrong: deprecatedEnterpriseColors.errorColorD10,
|
|
412
410
|
statusColorCritical: deprecatedEnterpriseColors.errorColorD10,
|
|
413
411
|
statusColorCriticalWeak: deprecatedEnterpriseColors.errorColor,
|
|
414
|
-
statusColorCriticalStrong: deprecatedEnterpriseColors.errorColorD20
|
|
412
|
+
statusColorCriticalStrong: deprecatedEnterpriseColors.errorColorD20,
|
|
413
|
+
draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat")
|
|
415
414
|
};
|
|
416
|
-
var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
415
|
+
var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, deprecatedEnterpriseColors), backgroundColors), actionColors), neutralColors), notificationColors), severityColors), elevationShadows), syntaxColors), usageColors), shadows), typography), contentColors), interactiveColors), zindexes), _dataViz["default"]), deprecated);
|
|
417
416
|
var _default = theme;
|
|
418
417
|
exports["default"] = _default;
|
package/getTheme.js
CHANGED
|
@@ -56,7 +56,7 @@ function getTheme() {
|
|
|
56
56
|
var isCompact = density === 'compact';
|
|
57
57
|
var isDark = colorScheme === 'dark';
|
|
58
58
|
var isLight = colorScheme === 'light';
|
|
59
|
-
|
|
59
|
+
var utilVariables = {
|
|
60
60
|
colorScheme: colorScheme,
|
|
61
61
|
density: density,
|
|
62
62
|
family: family,
|
|
@@ -66,7 +66,8 @@ function getTheme() {
|
|
|
66
66
|
isCompact: isCompact,
|
|
67
67
|
isDark: isDark,
|
|
68
68
|
isLight: isLight
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
|
+
return Object.freeze(_objectSpread(_objectSpread({}, utilVariables), family === 'enterprise' ? (0, _enterprise["default"])({
|
|
70
71
|
colorScheme: colorScheme,
|
|
71
72
|
density: density
|
|
72
73
|
}) : (0, _prisma["default"])({
|
package/mixins/prose.js
CHANGED
|
@@ -9,7 +9,7 @@ var _variables = _interopRequireDefault(require("../variables"));
|
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
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
11
|
function _templateObject() {
|
|
12
|
-
var data = _taggedTemplateLiteral(["\n
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n min-width: ", ";\n max-width: ", ";\n\n /*\n * Word spacing: 0.16em\n * Letter spacing (i.e., tracking): 0.12em\n */\n\n /*\n * Style all block-level elements to be 1.5 margin-bottom by default\n * wcag requirement 1.4.12\n */\n & *:is(", "):not(:last-child) {\n margin-block-end: 1lh;\n }\n\n /*\n * Separate h1 and h2 into individual rules to avoid ts-styled-plugin\u2019s parser\n * error on comma-separated, multi-line interpolations at the start of a selector.\n */\n ", ":where(h1):not(:first-child) {\n margin-block-start: 1lh;\n }\n\n ", ":where(h2):not(:first-child) {\n margin-block-start: 1lh;\n }\n\n ", ":where(img) {\n max-width: 100%;\n }\n\n ", ":where(ol), ", ":where(ul) {\n padding-inline-start: 2rem;\n }\n "]);
|
|
13
13
|
_templateObject = function _templateObject() {
|
|
14
14
|
return data;
|
|
15
15
|
};
|
|
@@ -47,12 +47,12 @@ var defaultElementSelectors = {
|
|
|
47
47
|
* @name prose
|
|
48
48
|
* @kind function
|
|
49
49
|
*
|
|
50
|
-
* @
|
|
50
|
+
* @public
|
|
51
|
+
*
|
|
52
|
+
* @param {Object} [options] The options object.
|
|
53
|
+
* @param {Object} [options.elementSelectors]
|
|
51
54
|
* By default, all elements are selected by their html tag using `*:is(<tag>)`;
|
|
52
55
|
* override that selector by setting `elementSelectors`.
|
|
53
|
-
*
|
|
54
|
-
* For example, paragraph elements are styled with the selector `*:where(p)` but that can be overridden:
|
|
55
|
-
* e.g. prose({ elementSelectors: { p: '.foo' }}) will instead style `p` elements that match `*:where(.foo)`
|
|
56
56
|
*/
|
|
57
57
|
function prose() {
|
|
58
58
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
@@ -60,7 +60,7 @@ function prose() {
|
|
|
60
60
|
var selectors = _objectSpread(_objectSpread({}, defaultElementSelectors), elementSelectors);
|
|
61
61
|
var allSelectors = Array.from(new Set(Object.values(selectors))).join(',');
|
|
62
62
|
return function () {
|
|
63
|
-
return (0, _styledComponents.css)(_templateObject(), _variables["default"].lineLength, allSelectors, selectors.h1, selectors.h2, selectors.img, selectors.ol, selectors.ul);
|
|
63
|
+
return (0, _styledComponents.css)(_templateObject(), _variables["default"].lineLengthMinimum, _variables["default"].lineLength, allSelectors, selectors.h1, selectors.h2, selectors.img, selectors.ol, selectors.ul);
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
var _default = prose;
|
package/mixins/resets.js
CHANGED
|
@@ -16,7 +16,7 @@ function _templateObject2() {
|
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
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 "]);
|
|
19
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n box-sizing: border-box;\n color: ", ";\n color-scheme: ", ";\n font-family: ", ";\n line-height: ", ";\n margin: 0;\n "]);
|
|
20
20
|
_templateObject = function _templateObject() {
|
|
21
21
|
return data;
|
|
22
22
|
};
|
|
@@ -50,7 +50,7 @@ var pageBase = function pageBase() {
|
|
|
50
50
|
return (0, _styledComponents.css)(_templateObject(), _variables["default"].backgroundColorPage, _variables["default"].contentColorDefault, (0, _pick["default"])({
|
|
51
51
|
dark: 'dark',
|
|
52
52
|
light: 'light'
|
|
53
|
-
}), _variables["default"].fontFamily);
|
|
53
|
+
}), _variables["default"].fontFamily, _variables["default"].lineHeight);
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/themes",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Theme variables and mixins for the Splunk design language",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"babel": "babel src -d . --ignore src/babel-plugin-base64-png,src/**/tests --ignore \"**/docs\" --extensions .js,.ts,.tsx",
|
|
9
9
|
"build": "cross-env NODE_ENV=production yarn babel && yarn types:build",
|
|
10
|
+
"postbuild": "node --experimental-strip-types src/scripts/generateTokenSpec.ts",
|
|
10
11
|
"docs": "NODE_ENV=production webpack --config docs.gen.webpack.config.js",
|
|
11
12
|
"docs:publish": "eval $(splunk-docs-package docs) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
|
|
12
13
|
"docs:publish:external": "eval $(splunk-docs-package docs-external --suffix=public) && artifact-ci publish generic $DOCS_GEN_OUTPUT_NAME $DOCS_GEN_REMOTE_PATH",
|
|
@@ -74,6 +75,8 @@
|
|
|
74
75
|
"@babel/core": "^7.28.0",
|
|
75
76
|
"@splunk/babel-preset": "^4.0.0",
|
|
76
77
|
"@splunk/eslint-config": "^5.0.0",
|
|
78
|
+
"@splunk/jsdoc-loader": "^3.1.1",
|
|
79
|
+
"@splunk/ui-utils": "^1.12.0",
|
|
77
80
|
"@storybook/blocks": "^7.6.20",
|
|
78
81
|
"@storybook/components": "^7.6.20",
|
|
79
82
|
"@storybook/manager-api": "^7.6.20",
|
|
@@ -82,6 +85,7 @@
|
|
|
82
85
|
"@testing-library/dom": "^10.4.1",
|
|
83
86
|
"@testing-library/jest-dom": "^6.6.3",
|
|
84
87
|
"@testing-library/react": "^16.3.0",
|
|
88
|
+
"@types/lodash": "^4.14.156",
|
|
85
89
|
"@types/react": "^18.2.0",
|
|
86
90
|
"@types/tinycolor2": "^1.4.2",
|
|
87
91
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
package/prisma/base.js
CHANGED
|
@@ -33,9 +33,6 @@ function createPrismaBase(_ref) {
|
|
|
33
33
|
borderColorWeak: "".concat(colorSchemeVars.borderColorWeak),
|
|
34
34
|
borderColorStrong: "".concat(colorSchemeVars.borderColorStrong)
|
|
35
35
|
};
|
|
36
|
-
var backgrounds = {
|
|
37
|
-
draggableBackground: "radial-gradient(circle at 1px 1px, ".concat(colorSchemeVars.contentColorMuted, ", ").concat(colorSchemeVars.contentColorMuted, " 1px, transparent 1px) 0 0 / 4px 6px")
|
|
38
|
-
};
|
|
39
36
|
var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
40
37
|
var typography = {
|
|
41
38
|
sansFontFamily: sansFontFamily,
|
|
@@ -55,6 +52,7 @@ function createPrismaBase(_ref) {
|
|
|
55
52
|
fontWeightHeavy: 800,
|
|
56
53
|
fontWeightExtraBold: 900,
|
|
57
54
|
lineHeight: '1.5',
|
|
55
|
+
lineLengthMinimum: '34ch',
|
|
58
56
|
lineLength: '80ch',
|
|
59
57
|
lineHeightNormal: '1.5',
|
|
60
58
|
lineHeightSingle: '1',
|
|
@@ -73,10 +71,11 @@ function createPrismaBase(_ref) {
|
|
|
73
71
|
zindexToastMessages: 2000
|
|
74
72
|
};
|
|
75
73
|
var deprecated = {
|
|
74
|
+
draggableBackground: "radial-gradient(circle at 1px 1px, ".concat(colorSchemeVars.contentColorMuted, ", ").concat(colorSchemeVars.contentColorMuted, " 1px, transparent 1px) 0 0 / 4px 6px"),
|
|
76
75
|
hoverShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(colorSchemeVars.interactiveColorOverlayHover),
|
|
77
76
|
linkColor: colorSchemeVars.interactiveColorPrimary
|
|
78
77
|
};
|
|
79
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
78
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, typography), usageColors), _dataViz["default"]), shadows), borders), zindexes), deprecated);
|
|
80
79
|
}
|
|
81
80
|
var _default = createPrismaBase;
|
|
82
81
|
exports["default"] = _default;
|
package/prisma/light.js
CHANGED
|
@@ -23,7 +23,7 @@ var backgroundColors = {
|
|
|
23
23
|
backgroundColorScrim: 'rgba(255, 255, 255, 0.75)'
|
|
24
24
|
};
|
|
25
25
|
var borderColors = {
|
|
26
|
-
borderColor: '
|
|
26
|
+
borderColor: '#8f8f8f',
|
|
27
27
|
borderColorWeak: '#e0e0e0',
|
|
28
28
|
borderColorStrong: '#6b6b6b'
|
|
29
29
|
};
|
|
@@ -148,7 +148,7 @@ var elevationShadows = {
|
|
|
148
148
|
var syntaxColors = {
|
|
149
149
|
syntaxBlue: '#0e6e8b',
|
|
150
150
|
syntaxBrown: '#8b5804',
|
|
151
|
-
syntaxGray: '#
|
|
151
|
+
syntaxGray: '#666666',
|
|
152
152
|
syntaxGreen: '#556f0b',
|
|
153
153
|
syntaxOrange: '#a64708',
|
|
154
154
|
syntaxPink: '#b9139e',
|
package/splunk-magnetic/index.js
CHANGED
|
@@ -200,7 +200,7 @@ var splunkMagneticThemeCustomizer = function splunkMagneticThemeCustomizer(curre
|
|
|
200
200
|
statusColorNormalWeak: pickMagnetic('positive-bg-medium-default'),
|
|
201
201
|
syntaxBlue: currentTheme.colorScheme === 'light' ? '#0f7190' : '#6cd0f0',
|
|
202
202
|
syntaxBrown: currentTheme.colorScheme === 'light' ? '#8b5804' : '#fccf87',
|
|
203
|
-
syntaxGray: currentTheme.colorScheme === 'light' ? '#
|
|
203
|
+
syntaxGray: currentTheme.colorScheme === 'light' ? '#666666' : '#909090',
|
|
204
204
|
syntaxGreen: currentTheme.colorScheme === 'light' ? '#556f0b' : '#cef06c',
|
|
205
205
|
syntaxOrange: currentTheme.colorScheme === 'light' ? '#a64708' : '#f7933f',
|
|
206
206
|
syntaxPink: currentTheme.colorScheme === 'light' ? '#b9139e' : '#f494e5',
|