@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.
@@ -10,11 +10,11 @@ import { AnyTheme } from './types';
10
10
  * import useSplunkTheme from '@splunk/themes/useSplunkTheme';
11
11
  * ...
12
12
  * export function() {
13
- * const { density, focusColor } = useSplunkTheme();
13
+ * const { isComfortable, focusColor } = useSplunkTheme();
14
14
  *
15
15
  * const style = {
16
16
  * color: focusColor,
17
- * padding: density === 'comfortable' ? '10px' : '5px',
17
+ * padding: isComfortable ? '10px' : '5px',
18
18
  * }
19
19
  *
20
20
  * ...
package/types/utils.d.ts CHANGED
@@ -4,7 +4,7 @@ import { ThemeSettings, CustomizeTheme, AnyTheme } from './types';
4
4
  * Accepts a theme object and returns supported values and defaults.
5
5
  * @private
6
6
  */
7
- export declare const addThemeDefaults: ({ family, colorScheme, density, }?: Partial<ThemeSettings>) => ThemeSettings;
7
+ export declare const addThemeDefaults: ({ family, colorScheme, density, isPrisma, isEnterprise, isComfortable, isCompact, isDark, isLight, }?: Partial<ThemeSettings>) => ThemeSettings;
8
8
  declare function getCustomizedThemeUnmemo<T extends AnyTheme>(settings?: Partial<ThemeSettings<T>>, customizer?: CustomizeTheme<T>): T;
9
9
  /**
10
10
  * Accepts a theme object and customizer, and returns supported values and defaults.
package/useSplunkTheme.js CHANGED
@@ -32,11 +32,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
32
32
  * import useSplunkTheme from '@splunk/themes/useSplunkTheme';
33
33
  * ...
34
34
  * export function() {
35
- * const { density, focusColor } = useSplunkTheme();
35
+ * const { isComfortable, focusColor } = useSplunkTheme();
36
36
  *
37
37
  * const style = {
38
38
  * color: focusColor,
39
- * padding: density === 'comfortable' ? '10px' : '5px',
39
+ * padding: isComfortable ? '10px' : '5px',
40
40
  * }
41
41
  *
42
42
  * ...
package/utils.js CHANGED
@@ -22,12 +22,30 @@ var addThemeDefaults = function addThemeDefaults() {
22
22
  _ref$colorScheme = _ref.colorScheme,
23
23
  colorScheme = _ref$colorScheme === void 0 ? 'dark' : _ref$colorScheme,
24
24
  _ref$density = _ref.density,
25
- density = _ref$density === void 0 ? 'comfortable' : _ref$density;
25
+ density = _ref$density === void 0 ? 'comfortable' : _ref$density,
26
+ _ref$isPrisma = _ref.isPrisma,
27
+ isPrisma = _ref$isPrisma === void 0 ? true : _ref$isPrisma,
28
+ _ref$isEnterprise = _ref.isEnterprise,
29
+ isEnterprise = _ref$isEnterprise === void 0 ? false : _ref$isEnterprise,
30
+ _ref$isComfortable = _ref.isComfortable,
31
+ isComfortable = _ref$isComfortable === void 0 ? true : _ref$isComfortable,
32
+ _ref$isCompact = _ref.isCompact,
33
+ isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
34
+ _ref$isDark = _ref.isDark,
35
+ isDark = _ref$isDark === void 0 ? true : _ref$isDark,
36
+ _ref$isLight = _ref.isLight,
37
+ isLight = _ref$isLight === void 0 ? false : _ref$isLight;
26
38
 
27
39
  return {
28
40
  family: family,
29
41
  colorScheme: colorScheme,
30
- density: density
42
+ density: density,
43
+ isPrisma: isPrisma,
44
+ isEnterprise: isEnterprise,
45
+ isComfortable: isComfortable,
46
+ isCompact: isCompact,
47
+ isDark: isDark,
48
+ isLight: isLight
31
49
  };
32
50
  };
33
51
 
@@ -50,11 +50,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
50
50
  * };
51
51
  *
52
52
  * render() {
53
- * const { density, focusColor } = this.props.splunkTheme;
53
+ * const { isComfortable, focusColor } = this.props.splunkTheme;
54
54
  *
55
55
  * const style = {
56
56
  * color: focusColor,
57
- * padding: density === 'comfortable' ? '10px' : '5px',
57
+ * padding: isComfortable ? '10px' : '5px',
58
58
  * }
59
59
  *
60
60
  * return (