@splunk/themes 0.9.0 → 0.11.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 CHANGED
@@ -1,6 +1,28 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 0.11.0 - May 4, 2022
5
+ ----------
6
+ New Features:
7
+ * Added Data visualization colors to Prisma themes.
8
+
9
+ 0.10.1 - April 5, 2022
10
+ ----------
11
+ Bug Fixes:
12
+ * Pinned `styled-components@5.1.1` to avoid breaking changes introduced in `styled-components@5.2.0`.
13
+
14
+ **`@splunk/themes` is incompatible with styled-components version(s) `^5.2.0`**.
15
+
16
+ `styled-components@5.2.0` changed how selectors like `& + &` are compiled; [styled-components PR#3236](https://github.com/styled-components/styled-components/pull/3236).
17
+ This breaks styles that worked in previous versions of styled-components; [styled-components issue #3265](https://github.com/styled-components/styled-components/issues/3265).
18
+
19
+ **Until noted otherwise in a future release of `@splunk/themes` do not use `styled-components@^5.2.0` with` @splunk/themes`**.
20
+
21
+ 0.10.0 - February 23, 2022
22
+ ----------
23
+ New Features:
24
+ * Utility variables, `isPrisma`, `isEnterprise`, `isComfortable`, `isCompact`, `isDark`, and `isLight`, added to `useSplunkTheme()` and `withSplunkTheme()` (SUI-2376).
25
+
4
26
  0.9.0 - September 8, 2021
5
27
  ----------
6
28
  API Changes:
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
 
8
8
  /**
9
- * # Measures
9
+ * ## Measures
10
10
  * Spacing is used for margin on any element or padding on containers, but can be used for other
11
11
  * properties that position elements.
12
12
  *
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
 
8
8
  /**
9
- * # Measures
9
+ * ## Measures
10
10
  * Spacing is used for margin on any element or padding on containers, but can be used for other
11
11
  * properties that position elements.
12
12
  * * Larger containers, such as `Card` or `Modal`, use `spacing`.
@@ -14,7 +14,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
14
14
  var dragHandle = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA2SURBVHgB7dKhEQAgDAPAhDnxDMAcDIBnT1pZV1FRk3e53EWFc+2P4N3DmLN+oKh/QADqB+IMUKEQD/CeueAAAAAASUVORK5CYII="; // see babel-plugin-base64-pngimport {
15
15
 
16
16
  /**
17
- * # Brand Colors
17
+ * ## Brand colors
18
18
  *
19
19
  * @colorSet
20
20
  */
@@ -33,7 +33,7 @@ var brandColors = {
33
33
  brandColorD50: '#286728'
34
34
  };
35
35
  /**
36
- * # Grayscale Colors
36
+ * ## Grayscale colors
37
37
  *
38
38
  * @colorSet
39
39
  */
@@ -53,7 +53,7 @@ var grays = {
53
53
  black: '#000000'
54
54
  };
55
55
  /**
56
- * # Accent Colors
56
+ * ## Accent colors
57
57
  *
58
58
  * @colorSet
59
59
  */
@@ -72,7 +72,7 @@ var accentColors = {
72
72
  accentColorD50: '#003d5e'
73
73
  };
74
74
  /**
75
- * # Error Colors
75
+ * ## Error Colors
76
76
  *
77
77
  * @colorSet
78
78
  */
@@ -91,7 +91,7 @@ var errorColors = {
91
91
  errorColorD50: '#6f261d'
92
92
  };
93
93
  /**
94
- * # Alert Colors
94
+ * ## Alert colors
95
95
  *
96
96
  * @colorSet
97
97
  * */
@@ -110,7 +110,7 @@ var alertColors = {
110
110
  alertColorD50: '#79401a'
111
111
  };
112
112
  /**
113
- * # Warning Colors
113
+ * ## Warning colors
114
114
  *
115
115
  * @colorSet
116
116
  */
@@ -129,7 +129,7 @@ var warningColors = {
129
129
  warningColorD50: '#7d600f'
130
130
  };
131
131
  /**
132
- * # Success Colors
132
+ * ## Success colors
133
133
  *
134
134
  * @colorSet
135
135
  */
@@ -148,7 +148,7 @@ var successColors = {
148
148
  successColorD50: '#275126'
149
149
  };
150
150
  /**
151
- * # Info Colors
151
+ * ## Info colors
152
152
  *
153
153
  * @colorSet
154
154
  */
@@ -167,7 +167,7 @@ var infoColors = {
167
167
  infoColorD50: '#002b3e'
168
168
  };
169
169
  /**
170
- * # Diverging Colors
170
+ * ## Diverging colors
171
171
  *
172
172
  * @colorSet alphabetical
173
173
  */
@@ -185,7 +185,7 @@ var divergingColors = {
185
185
  diverging5ColorB: '#b6c75a'
186
186
  };
187
187
  /**
188
- * # Categorical Colors
188
+ * ## Categorical Colors
189
189
  *
190
190
  * @colorSet alphabetical
191
191
  */
@@ -253,7 +253,7 @@ var categoricalColors = {
253
253
  cat30ColorL: '#a4bbe0'
254
254
  };
255
255
  /**
256
- * # Usage-based Colors
256
+ * ## Usage-based colors
257
257
  *
258
258
  * @colorSet verbose
259
259
  */
@@ -272,7 +272,7 @@ var usageColors = {
272
272
  transparent: 'transparent'
273
273
  };
274
274
  /**
275
- * # Syntax Colors
275
+ * ## Syntax colors
276
276
  * The following colors should only be used for syntax coloring of code.
277
277
  *
278
278
  * @colorSet verbose alphabetical
@@ -294,7 +294,7 @@ var syntaxColors = {
294
294
  syntaxTeal: '#00a8ab'
295
295
  };
296
296
  /**
297
- * # Shadows
297
+ * ## Shadows
298
298
  *
299
299
  * @shadowSet
300
300
  */
@@ -305,7 +305,7 @@ var shadows = {
305
305
  overlayShadow: '0 4px 8px rgba(0, 0, 0, 0.2)'
306
306
  };
307
307
  /**
308
- * # Backgrounds
308
+ * ## Backgrounds
309
309
  *
310
310
  * @colorSet verbose
311
311
  */
@@ -314,7 +314,7 @@ var backgrounds = {
314
314
  draggableBackground: "url('data:image/png;base64,".concat(dragHandle, "') 0 0 / 8px 8px repeat")
315
315
  };
316
316
  /**
317
- * # Border
317
+ * ## Border
318
318
  *
319
319
  * @valueSet
320
320
  */
@@ -325,7 +325,7 @@ var borders = {
325
325
  };
326
326
  var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
327
327
  /**
328
- * # Fonts
328
+ * ## Fonts
329
329
  *
330
330
  * @valueSet
331
331
  */
@@ -339,7 +339,7 @@ var fonts = {
339
339
  fontWeightSemiBold: '500'
340
340
  };
341
341
  /**
342
- * # Layers
342
+ * ## Layers
343
343
  * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1.
344
344
  *
345
345
  * @valueSet
package/getTheme.js CHANGED
@@ -41,6 +41,12 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
41
41
  * @param {'prisma' | 'enterprise'} [options.family = 'prisma']
42
42
  * @param {'dark' | 'light'} [options.colorScheme = 'dark']
43
43
  * @param {'comfortable' | 'compact'} [options.density = 'comfortable']
44
+ * @param {Boolean} [options.isPrisma = true]
45
+ * @param {Boolean} [options.isEnterprise = false]
46
+ * @param {Boolean} [options.isComfortable = true]
47
+ * @param {Boolean} [options.isCompact = false]
48
+ * @param {Boolean} [options.isDark = true]
49
+ * @param {Boolean} [options.isLight = false]
44
50
  * @returns {object} A flat object of all variables and their values.
45
51
  * @public
46
52
  */
@@ -52,10 +58,22 @@ function getTheme() {
52
58
  colorScheme = _addThemeDefaults.colorScheme,
53
59
  density = _addThemeDefaults.density;
54
60
 
61
+ var isPrisma = family === 'prisma';
62
+ var isEnterprise = family === 'enterprise';
63
+ var isComfortable = density === 'comfortable';
64
+ var isCompact = density === 'compact';
65
+ var isDark = colorScheme === 'dark';
66
+ var isLight = colorScheme === 'light';
55
67
  return Object.freeze(_objectSpread({
56
68
  colorScheme: colorScheme,
57
69
  density: density,
58
- family: family
70
+ family: family,
71
+ isPrisma: isPrisma,
72
+ isEnterprise: isEnterprise,
73
+ isComfortable: isComfortable,
74
+ isCompact: isCompact,
75
+ isDark: isDark,
76
+ isLight: isLight
59
77
  }, family === 'enterprise' ? (0, _enterprise["default"])({
60
78
  colorScheme: colorScheme,
61
79
  density: density
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/themes",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "description": "Theme variables and mixins for the Splunk design language",
5
5
  "scripts": {
6
6
  "build": "cross-env NODE_ENV=production babel src -d . --ignore src/babel-plugin-base64-png,src/tests --extensions .js,.ts,.tsx && yarn types:build",
@@ -8,7 +8,7 @@
8
8
  "lint:ci": "yarn run lint -- -f junit -o test-reports/lint-results.xml",
9
9
  "start": "babel src -d . --watch --ignore src/babel-plugin-base64-png,src/tests --extensions .js,.ts,.tsx",
10
10
  "test": "jest",
11
- "test:ci": "JEST_JUNIT_OUTPUT_DIR=./test-reports JEST_JUNIT_OUTPUT_NAME=unit-results.xml JEST_JUNIT_CLASSNAME=unit yarn run test --ci --reporters=default jest-junit --coverage --coverageDirectory=coverage_report/coverage_maps_unit --coverageReporters=json",
11
+ "test:ci": "JEST_JUNIT_OUTPUT_DIR=./test-reports JEST_JUNIT_OUTPUT_NAME=unit-results.xml JEST_JUNIT_CLASSNAME=unit yarn run test --ci --reporters=default jest-junit --coverage --coverageDirectory=coverage_report/coverage_maps_unit --coverageReporters=cobertura",
12
12
  "test:watch": "jest --watch",
13
13
  "types:build": "tsc",
14
14
  "types:start": "yarn types:build --watch"
@@ -20,7 +20,7 @@
20
20
  "@storybook/components": ">= 6.x",
21
21
  "@storybook/theming": ">= 6.x",
22
22
  "react": "^16.8",
23
- "styled-components": "^5.1"
23
+ "styled-components": "5.1.1"
24
24
  },
25
25
  "peerDependenciesMeta": {
26
26
  "react": {
@@ -83,7 +83,7 @@
83
83
  "eslint-plugin-react-hooks": "^4.0.5",
84
84
  "jest": "^25.1.0",
85
85
  "react": "^16.12.0",
86
- "styled-components": "^5.1.1",
86
+ "styled-components": "5.1.1",
87
87
  "typescript": "^4.0.5"
88
88
  },
89
89
  "engines": {
package/prisma/base.js CHANGED
@@ -7,6 +7,8 @@ exports["default"] = void 0;
7
7
 
8
8
  var _tinycolor = _interopRequireDefault(require("tinycolor2"));
9
9
 
10
+ var _dataViz = _interopRequireDefault(require("./dataViz"));
11
+
10
12
  var _light = _interopRequireDefault(require("./light"));
11
13
 
12
14
  var _dark = _interopRequireDefault(require("./dark"));
@@ -27,7 +29,7 @@ function createPrismaBase(_ref) {
27
29
  dark: _dark["default"]
28
30
  }[colorScheme];
29
31
  /**
30
- * # Misc Colors
32
+ * ## Misc. colors
31
33
  *
32
34
  * @colorSet verbose
33
35
  */
@@ -38,7 +40,7 @@ function createPrismaBase(_ref) {
38
40
  linkColor: colorSchemeVars.interactiveColorPrimary
39
41
  };
40
42
  /**
41
- * # Interactive State Shadows
43
+ * ## Interactive state shadows
42
44
  *
43
45
  * @shadowSet
44
46
  *
@@ -50,7 +52,7 @@ function createPrismaBase(_ref) {
50
52
  focusShadowInset: "inset 0 0 0 3px ".concat(usageColors.focusColor)
51
53
  };
52
54
  /**
53
- * # Backgrounds
55
+ * ## Backgrounds
54
56
  *
55
57
  * @colorSet verbose
56
58
  */
@@ -60,7 +62,7 @@ function createPrismaBase(_ref) {
60
62
  };
61
63
  var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
62
64
  /**
63
- * # Fonts
65
+ * ## Fonts
64
66
  *
65
67
  * @valueSet
66
68
  */
@@ -74,7 +76,7 @@ function createPrismaBase(_ref) {
74
76
  fontWeightSemiBold: '500'
75
77
  };
76
78
  /**
77
- * # Layers
79
+ * ## Layers
78
80
  * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1.
79
81
  *
80
82
  * @valueSet
@@ -87,7 +89,7 @@ function createPrismaBase(_ref) {
87
89
  zindexPopover: 1060,
88
90
  zindexToastMessages: 2000
89
91
  };
90
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fonts), usageColors), shadows), backgrounds), zindexes);
92
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fonts), usageColors), _dataViz["default"]), shadows), backgrounds), zindexes);
91
93
  }
92
94
 
93
95
  var _default = createPrismaBase;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
 
8
8
  /**
9
- * # Measures
9
+ * ## Measures
10
10
  * Spacing is used for margin on any element or padding on containers, but can be used for other
11
11
  * properties that position elements.
12
12
  *
package/prisma/compact.js CHANGED
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
 
8
8
  /**
9
- * # Measures
9
+ * ## Measures
10
10
  * Spacing is used for margin on any element or padding on containers, but can be used for other
11
11
  * properties that position elements.
12
12
  * * Larger containers, such as `Card` or `Modal`, use `spacing`.
package/prisma/dark.js CHANGED
@@ -12,7 +12,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
12
12
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
13
 
14
14
  /**
15
- * # Background Colors
15
+ * ## Background colors
16
16
  * Background colors should be used only for backgrounds of higher level sections & containers of a UI.
17
17
  *
18
18
  * @colorSet verbose
@@ -28,7 +28,7 @@ var backgroundColors = {
28
28
  backgroundColorScrim: 'rgba(0, 0, 0, 0.8)'
29
29
  };
30
30
  /**
31
- * # Content Colors
31
+ * ## Content colors
32
32
  * Content colors should be used for text, icons and dividers.
33
33
  *
34
34
  * @colorSet verbose
@@ -42,7 +42,7 @@ var contentColors = {
42
42
  contentColorMuted: '#909090'
43
43
  };
44
44
  /**
45
- * # Interactive Colors
45
+ * ## Interactive colors
46
46
  * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content.
47
47
  * "Overlay" colors are intended to be placed over the default background color, such as interactiveColorPrimary.
48
48
  * If the default background color is not transparent, the `blend` mixin can be used to create a new color that combines the two.
@@ -63,7 +63,7 @@ var interactiveColors = {
63
63
  interactiveColorBackgroundDisabled: 'rgba(255, 255, 255, 0.15)'
64
64
  };
65
65
  /**
66
- * # Neutral Colors
66
+ * ## Neutral colors
67
67
  * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough.
68
68
  *
69
69
  * @colorSet verbose
@@ -79,7 +79,7 @@ var neutralColors = {
79
79
  white: '#ffffff'
80
80
  };
81
81
  /**
82
- * # Accent Colors
82
+ * ## Accent colors
83
83
  * Accent colors aid and categorize the visual communication of the system response.
84
84
  *
85
85
  * @colorSet verbose
@@ -92,7 +92,7 @@ var accentColors = {
92
92
  accentColorNegative: '#ff5c5c'
93
93
  };
94
94
  /**
95
- * # Status Colors
95
+ * ## Status colors
96
96
  * Status colors are reserved for communicating urgency and severity associated with data objects.
97
97
  *
98
98
  * @colorSet verbose
@@ -107,7 +107,7 @@ var statusColors = {
107
107
  statusColorCritical: '#a81916'
108
108
  };
109
109
  /**
110
- * # Elevation Shadows
110
+ * ## Elevation shadows
111
111
  *
112
112
  * @shadowSet
113
113
  *
@@ -120,7 +120,7 @@ var elevationShadows = {
120
120
  modalShadow: '0px 50px 200px #000000, 0px 29px 66px rgba(0, 0, 0, 0.41), 0px 14px 47px rgba(0, 0, 0, 0.17), 0px 5px 10px rgba(0, 0, 0, 0.15)'
121
121
  };
122
122
  /**
123
- * # Syntax Colors
123
+ * ## Syntax colors
124
124
  * Syntax colors are used only for code blocks.
125
125
  *
126
126
  * @colorSet verbose alphabetical