@splunk/themes 0.16.4 → 0.18.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/enterprise/dark.js +16 -3
  3. package/enterprise/light.js +16 -2
  4. package/enterprise/prismaAliases.js +1 -1
  5. package/package.json +22 -22
  6. package/prisma/base.js +14 -1
  7. package/prisma/dark.js +1 -0
  8. package/prisma/light.js +1 -0
  9. package/storybook-addon-splunk-themes/SplunkThemesTool.js +12 -8
  10. package/storybook-addon-splunk-themes/ThemedDocsContainer.js +4 -28
  11. package/storybook-addon-splunk-themes/manager.js +28 -0
  12. package/storybook-addon-splunk-themes/preview.js +32 -0
  13. package/storybook-addon-splunk-themes/themes.js +1 -1
  14. package/stubs-dependencies.d.ts +2 -2
  15. package/types/enterprise/comfortable.d.ts +1 -1
  16. package/types/enterprise/compact.d.ts +1 -1
  17. package/types/enterprise/dark.d.ts +6 -3
  18. package/types/enterprise/index.d.ts +2 -2
  19. package/types/enterprise/light.d.ts +6 -2
  20. package/types/enterprise/prismaAliases.d.ts +1 -1
  21. package/types/mixins/typography.d.ts +2 -2
  22. package/types/mixins/utilityMixins.d.ts +2 -2
  23. package/types/prisma/base.d.ts +11 -2
  24. package/types/prisma/comfortable.d.ts +1 -1
  25. package/types/prisma/compact.d.ts +1 -1
  26. package/types/prisma/dark.d.ts +2 -1
  27. package/types/prisma/index.d.ts +2 -2
  28. package/types/prisma/light.d.ts +2 -1
  29. package/types/storybook-addon-splunk-themes/SplunkThemesTool.d.ts +4 -4
  30. package/types/storybook-addon-splunk-themes/ThemedDocsContainer.d.ts +1 -1
  31. package/types/storybook-addon-splunk-themes/{addParameter.d.ts → preview.d.ts} +5 -2
  32. package/types/storybook-addon-splunk-themes/themes.d.ts +4 -3
  33. package/types/storybook-addon-splunk-themes/util.d.ts +1 -1
  34. package/types/storybook-addon-splunk-themes/withSplunkTheme.d.ts +2 -4
  35. package/types/types.d.ts +24 -24
  36. package/types/withSplunkTheme.d.ts +2 -2
  37. package/variables.js +1 -1
  38. package/storybook-addon-splunk-themes/addDecorator.js +0 -11
  39. package/storybook-addon-splunk-themes/addParameter.js +0 -20
  40. package/storybook-addon-splunk-themes/preset.js +0 -30
  41. package/storybook-addon-splunk-themes/register.js +0 -32
  42. package/types/storybook-addon-splunk-themes/addDecorator.d.ts +0 -4
  43. package/types/storybook-addon-splunk-themes/preset.d.ts +0 -2
  44. /package/types/storybook-addon-splunk-themes/{register.d.ts → manager.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,12 +1,34 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
- 0.16.4 - Dec 5, 2023
4
+ 0.18.0 - May 6, 2024
5
+ ----------
6
+ New Features:
7
+
8
+ * All themes now support color variables for decorative borders:
9
+ * `borderColorStrong` and `borderColorWeak` added to all themes
10
+ * `borderColor` now also available in Prisma themes
11
+ * Note: Use `interactiveColorBorder` when creating a border for an interactive control
12
+
13
+ Bug Fixes:
14
+ * Enterprise light theme `interactiveColorBorder` value has been updated to meet contrast requirements.
15
+
16
+ API Changes:
17
+ * Enterprise theme `borderLightColor` has been deprecated. Instead, use `borderColorWeak`.
18
+ * Enterprise dark theme `borderDarkColor` has been removed. Instead, use `borderColorStrong`.
19
+ * `@splunk/themes/storybook-addon-splunk-themes` has been updated to work with `@storybook@^7` and no longer works with `@storybook@^6` (SUI-6170).
20
+
21
+ 0.17.0 - March 21, 2024
22
+ ----------
23
+ New Features:
24
+ * Added new variable `activeBorder`.
25
+
26
+ 0.16.4 - Dec 5, 2023
5
27
  ----------
6
28
  Bug Fixes:
7
29
  * `syntaxColors` have been updated to meet A11y_WCAG 1.4.3 contrast requirements for prisma and enterprise themes (SUI-5750).
8
30
 
9
- 0.16.3 - October 11, 2023
31
+ 0.16.3 - October 11, 2023
10
32
  ----------
11
33
  Bug Fixes:
12
34
  * This package should now load correctly in Webpack 4 environments (SUI-5802).
@@ -21,8 +21,9 @@ var dark = {
21
21
  backgroundColor: _light["default"].gray20,
22
22
  backgroundColorHover: _light["default"].gray30,
23
23
  borderColor: _light["default"].gray22,
24
- borderDarkColor: _light["default"].black,
25
- borderLightColor: _light["default"].gray60,
24
+ borderColorWeak: _light["default"].gray60,
25
+ borderColorStrong: _light["default"].black,
26
+ borderActiveColor: "rgba(225,225,225, 0.5)",
26
27
  textColor: _light["default"].white,
27
28
  textGray: _light["default"].gray92,
28
29
  textDisabledColor: _light["default"].gray45,
@@ -52,8 +53,20 @@ var syntaxColors = {
52
53
  syntaxRed: '#fa94aa',
53
54
  syntaxTeal: '#45d4ba'
54
55
  };
56
+ /**
57
+ * ## Interactive borders
58
+ *
59
+ * @borderSet
60
+ */
55
61
 
56
- var theme = _objectSpread(_objectSpread(_objectSpread({}, _light["default"]), dark), syntaxColors);
62
+ var bordersInteractive = {
63
+ activeBorder: "".concat(dark.borderActiveColor, " double")
64
+ };
65
+
66
+ var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _light["default"]), dark), syntaxColors), bordersInteractive), {}, {
67
+ borderLightColor: _light["default"].gray60 // @deprecated, SUI-5981
68
+
69
+ });
57
70
 
58
71
  var _default = theme;
59
72
  exports["default"] = _default;
@@ -264,8 +264,10 @@ var usageColors = {
264
264
  textDisabledColor: grays.gray80,
265
265
  linkColor: accentColors.accentColorD10,
266
266
  linkColorHover: accentColors.accentColor,
267
- borderLightColor: grays.gray92,
267
+ borderActiveColor: "rgba(0,0,0, 0.5)",
268
268
  borderColor: grays.gray80,
269
+ borderColorWeak: grays.gray92,
270
+ borderColorStrong: grays.gray60,
269
271
  focusColor: accentColors.accentColorD10,
270
272
  backgroundColorHover: grays.gray96,
271
273
  backgroundColor: grays.white,
@@ -304,6 +306,15 @@ var shadows = {
304
306
  focusShadowInset: "inset 0 0 1px 1px ".concat(grays.white, ", inset 0 0 0 3px ").concat(usageColors.focusColor),
305
307
  overlayShadow: '0 4px 8px rgba(0, 0, 0, 0.2)'
306
308
  };
309
+ /**
310
+ * ## Interactive borders
311
+ *
312
+ * @borderSet
313
+ */
314
+
315
+ var bordersInteractive = {
316
+ activeBorder: "".concat(usageColors.borderActiveColor, " double")
317
+ };
307
318
  /**
308
319
  * ## Backgrounds
309
320
  *
@@ -368,7 +379,10 @@ var zindexes = {
368
379
  zindexToastMessages: 2000
369
380
  };
370
381
 
371
- var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fontFamily), fontWeights), usageColors), backgrounds), shadows), borders), zindexes);
382
+ var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fontFamily), fontWeights), usageColors), backgrounds), shadows), bordersInteractive), borders), zindexes), {}, {
383
+ borderLightColor: grays.gray92 // @deprecated SUI-5981
384
+
385
+ });
372
386
 
373
387
  var _default = theme;
374
388
  exports["default"] = _default;
@@ -89,7 +89,7 @@ function createPrismaAliases(_ref) {
89
89
  neutral400: colorScheme === 'dark' ? cs.gray60 : _tinycolor["default"].mix(cs.gray92, cs.gray80).toRgbString(),
90
90
  neutral500: cs.gray80,
91
91
  interactiveColorPrimary: cs.brandColor,
92
- interactiveColorBorder: cs.borderColor,
92
+ interactiveColorBorder: colorScheme === 'dark' ? cs.borderColor : cs.gray60,
93
93
  spacingXSmall: d.spacingQuarter,
94
94
  spacingSmall: d.spacingHalf,
95
95
  spacingMedium: "calc(".concat(d.spacing, " * 0.75)"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/themes",
3
- "version": "0.16.4",
3
+ "version": "0.18.0",
4
4
  "description": "Theme variables and mixins for the Splunk design language",
5
5
  "scripts": {
6
6
  "babel": "babel src -d . --ignore src/babel-plugin-base64-png,src/tests --ignore \"**/docs\" --extensions .js,.ts,.tsx",
@@ -21,11 +21,11 @@
21
21
  "types:start": "yarn types:build --watch"
22
22
  },
23
23
  "peerDependencies": {
24
- "@storybook/addon-docs": ">= 6.x",
25
- "@storybook/addons": ">= 6.x",
26
- "@storybook/api": ">= 6.x",
27
- "@storybook/components": ">= 6.x",
28
- "@storybook/theming": ">= 6.x",
24
+ "@storybook/blocks": ">= 7.x",
25
+ "@storybook/components": ">= 7.x",
26
+ "@storybook/manager-api": ">= 7.x",
27
+ "@storybook/react": ">= 7.x",
28
+ "@storybook/theming": ">= 7.x",
29
29
  "react": "^16.8",
30
30
  "styled-components": "^5.3.10"
31
31
  },
@@ -36,16 +36,16 @@
36
36
  "styled-components": {
37
37
  "optional": true
38
38
  },
39
- "@storybook/addon-docs": {
39
+ "@storybook/blocks": {
40
40
  "optional": true
41
41
  },
42
- "@storybook/addons": {
42
+ "@storybook/components": {
43
43
  "optional": true
44
44
  },
45
- "@storybook/api": {
45
+ "@storybook/manager-api": {
46
46
  "optional": true
47
47
  },
48
- "@storybook/components": {
48
+ "@storybook/react": {
49
49
  "optional": true
50
50
  },
51
51
  "@storybook/theming": {
@@ -55,10 +55,6 @@
55
55
  "license": "Apache-2.0",
56
56
  "author": "Splunk Inc.",
57
57
  "dependencies": {
58
- "@types/lodash": "^4.14.156",
59
- "@types/react": "^16.9.38",
60
- "@types/styled-components": "^5.1.0",
61
- "@types/tinycolor2": "^1.4.2",
62
58
  "color-blend": "^2.0.9",
63
59
  "lodash": "^4.17.14",
64
60
  "tinycolor2": "^1.4.1"
@@ -68,16 +64,20 @@
68
64
  "@babel/core": "^7.2.0",
69
65
  "@splunk/babel-preset": "^4.0.0",
70
66
  "@splunk/eslint-config": "^4.0.0",
71
- "@storybook/addon-docs": "^6.5.9",
72
- "@storybook/addons": "^6.5.9",
73
- "@storybook/api": "^6.5.9",
74
- "@storybook/components": "^6.5.9",
75
- "@storybook/theming": "^6.5.9",
67
+ "@storybook/blocks": "^7.6.17",
68
+ "@storybook/components": "^7.6.17",
69
+ "@storybook/manager-api": "^7.6.17",
70
+ "@storybook/react": "^7.6.17",
71
+ "@storybook/theming": "^7.6.17",
76
72
  "@testing-library/jest-dom": "^5.16.1",
77
73
  "@testing-library/react": "^12.1.2",
78
74
  "@testing-library/react-hooks": "^7.0.2",
79
- "@typescript-eslint/eslint-plugin": "^3.4.0",
80
- "@typescript-eslint/parser": "^3.4.0",
75
+ "@types/lodash": "^4.14.156",
76
+ "@types/react": "^16.9.38",
77
+ "@types/styled-components": "^5.1.0",
78
+ "@types/tinycolor2": "^1.4.2",
79
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
80
+ "@typescript-eslint/parser": "^6.21.0",
81
81
  "babel-eslint": "^10.1.0",
82
82
  "babel-plugin-transform-define": "^2.0.0",
83
83
  "cross-env": "^6.0.3",
@@ -92,7 +92,7 @@
92
92
  "jest-styled-components": "^7.0.8",
93
93
  "react": "^16.12.0",
94
94
  "styled-components": "^5.3.10",
95
- "typescript": "^4.0.5",
95
+ "typescript": "^4.9.5",
96
96
  "webpack": "^5.88.2",
97
97
  "webpack-cli": "^5.1.4",
98
98
  "webpack-dev-server": "^4.15.1",
package/prisma/base.js CHANGED
@@ -51,6 +51,19 @@ function createPrismaBase(_ref) {
51
51
  focusShadow: "0 0 0 2px ".concat(colorSchemeVars.backgroundColorPage, ", 0 0 0 5px ").concat(usageColors.focusColor),
52
52
  focusShadowInset: "inset 0 0 0 3px ".concat(usageColors.focusColor)
53
53
  };
54
+ /**
55
+ * ## Borders
56
+ *
57
+ * @borderSet
58
+ *
59
+ */
60
+
61
+ var borders = {
62
+ activeBorder: "double ".concat(colorSchemeVars.interactiveColorBorderActive),
63
+ borderColor: "".concat(colorSchemeVars.neutral200),
64
+ borderColorWeak: "".concat(colorSchemeVars.neutral100),
65
+ borderColorStrong: "".concat(colorSchemeVars.neutral300)
66
+ };
54
67
  /**
55
68
  * ## Backgrounds
56
69
  *
@@ -104,7 +117,7 @@ function createPrismaBase(_ref) {
104
117
  zindexPopover: 1060,
105
118
  zindexToastMessages: 2000
106
119
  };
107
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontFamily), fontWeights), usageColors), _dataViz["default"]), shadows), backgrounds), zindexes);
120
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontFamily), fontWeights), usageColors), _dataViz["default"]), shadows), borders), backgrounds), zindexes);
108
121
  }
109
122
 
110
123
  var _default = createPrismaBase;
package/prisma/dark.js CHANGED
@@ -53,6 +53,7 @@ var contentColors = {
53
53
  var interactiveColors = {
54
54
  interactiveColorPrimary: '#3993FF',
55
55
  interactiveColorBorder: 'rgba(255, 255, 255, 0.5)',
56
+ interactiveColorBorderActive: 'rgba(225,225,225, 0.5)',
56
57
  interactiveColorBorderHover: 'rgba(255, 255, 255, 0.7)',
57
58
  interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.30)',
58
59
  interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)',
package/prisma/light.js CHANGED
@@ -53,6 +53,7 @@ var contentColors = {
53
53
  var interactiveColors = {
54
54
  interactiveColorPrimary: '#0264d7',
55
55
  interactiveColorBorder: 'rgba(0, 0, 0, 0.4)',
56
+ interactiveColorBorderActive: 'rgba(0, 0, 0, 0.5)',
56
57
  interactiveColorBorderHover: 'rgba(0, 0, 0, 0.6)',
57
58
  interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)',
58
59
  interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)',
@@ -9,7 +9,7 @@ exports.SplunkThemesTool = exports.themeOptions = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
12
- var _api = require("@storybook/api");
12
+ var _managerApi = require("@storybook/manager-api");
13
13
 
14
14
  var _components = require("@storybook/components");
15
15
 
@@ -56,14 +56,18 @@ var themeOptions = {
56
56
  }
57
57
  };
58
58
  exports.themeOptions = themeOptions;
59
+ var SplunkThemesTool = /*#__PURE__*/(0, _react.memo)(function () {
60
+ var _React$useState = _react["default"].useState(false),
61
+ _React$useState2 = _slicedToArray(_React$useState, 2),
62
+ isTooltipVisible = _React$useState2[0],
63
+ setIsTooltipVisible = _React$useState2[1];
59
64
 
60
- var SplunkThemesTool = function SplunkThemesTool() {
61
- var _useGlobals = (0, _api.useGlobals)(),
65
+ var _useGlobals = (0, _managerApi.useGlobals)(),
62
66
  _useGlobals2 = _slicedToArray(_useGlobals, 2),
63
67
  globals = _useGlobals2[0],
64
68
  updateGlobals = _useGlobals2[1];
65
69
 
66
- var params = (0, _api.useParameter)(_constants.PARAM_KEY, {});
70
+ var params = (0, _managerApi.useParameter)(_constants.PARAM_KEY, {});
67
71
  var globalsTheme = globals[_constants.PARAM_KEY];
68
72
  var currentTheme = (0, _util.normalizeThemeOptions)(params, globalsTheme);
69
73
  var updateTheme = (0, _react.useCallback)(function (newTheme) {
@@ -95,14 +99,14 @@ var SplunkThemesTool = function SplunkThemesTool() {
95
99
  }));
96
100
  });
97
101
  },
98
- closeOnClick: true
102
+ closeOnOutsideClick: true,
103
+ onVisibleChange: setIsTooltipVisible
99
104
  }, /*#__PURE__*/_react["default"].createElement(_components.IconButton, {
100
105
  key: "splunk-themes",
101
106
  title: "Set options for @splunk/themes",
102
- active: true
107
+ active: isTooltipVisible
103
108
  }, /*#__PURE__*/_react["default"].createElement(_components.Icons, {
104
109
  icon: "paintbrush"
105
110
  })));
106
- };
107
-
111
+ });
108
112
  exports.SplunkThemesTool = SplunkThemesTool;
@@ -7,7 +7,7 @@ exports.ThemedDocsContainer = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _blocks = require("@storybook/addon-docs/blocks");
10
+ var _blocks = require("@storybook/blocks");
11
11
 
12
12
  var _theming = require("@storybook/theming");
13
13
 
@@ -17,12 +17,6 @@ var _themes = require("./themes");
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
 
20
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
21
-
22
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23
-
24
- 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; }
25
-
26
20
  var ThemedDocsContainer = function ThemedDocsContainer(_ref) {
27
21
  var children = _ref.children,
28
22
  context = _ref.context;
@@ -30,28 +24,10 @@ var ThemedDocsContainer = function ThemedDocsContainer(_ref) {
30
24
  var _useSplunkTheme = (0, _useSplunkTheme2["default"])(),
31
25
  isDark = _useSplunkTheme.isDark;
32
26
 
33
- var themedContext = _objectSpread(_objectSpread({}, context), {}, {
34
- storyById: function storyById(id) {
35
- var _storyContext$paramet, _storyContext$paramet2;
36
-
37
- var storyContext = context.storyById(id);
38
- return _objectSpread(_objectSpread({}, storyContext), {}, {
39
- parameters: _objectSpread(_objectSpread({}, storyContext === null || storyContext === void 0 ? void 0 : storyContext.parameters), {}, {
40
- __isArgsStory: true,
41
- docs: _objectSpread(_objectSpread({}, storyContext === null || storyContext === void 0 ? void 0 : (_storyContext$paramet = storyContext.parameters) === null || _storyContext$paramet === void 0 ? void 0 : _storyContext$paramet.docs), {}, {
42
- theme: isDark ? _theming.themes.dark : _theming.themes.light
43
- }),
44
- controls: _objectSpread(_objectSpread({}, storyContext === null || storyContext === void 0 ? void 0 : (_storyContext$paramet2 = storyContext.parameters) === null || _storyContext$paramet2 === void 0 ? void 0 : _storyContext$paramet2.controls), {}, {
45
- theme: isDark ? _theming.themes.dark : _theming.themes.light
46
- })
47
- })
48
- });
49
- }
50
- });
51
-
52
27
  return /*#__PURE__*/_react["default"].createElement(_blocks.DocsContainer, {
53
- context: themedContext
54
- }, /*#__PURE__*/_react["default"].createElement(_themes.GlobalStyles, null), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children));
28
+ context: context,
29
+ theme: isDark ? _theming.themes.dark : _theming.themes.light
30
+ }, /*#__PURE__*/_react["default"].createElement(_themes.GlobalStyles, null), children);
55
31
  };
56
32
 
57
33
  exports.ThemedDocsContainer = ThemedDocsContainer;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _managerApi = require("@storybook/manager-api");
6
+
7
+ var _types = require("@storybook/types");
8
+
9
+ var _constants = require("./constants");
10
+
11
+ var _SplunkThemesTool = require("./SplunkThemesTool");
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
+
15
+ _managerApi.addons.register(_constants.ADDON_ID, function () {
16
+ _managerApi.addons.add(_constants.ADDON_ID, {
17
+ title: 'splunk/themes',
18
+ type: _types.Addon_TypesEnum.TOOL,
19
+ match: function match(_ref) {
20
+ var viewMode = _ref.viewMode;
21
+ return !!(viewMode && viewMode.match(/^(story|docs)$/));
22
+ },
23
+ paramKey: _constants.PARAM_KEY,
24
+ render: function render() {
25
+ return /*#__PURE__*/_react["default"].createElement(_SplunkThemesTool.SplunkThemesTool, null);
26
+ }
27
+ });
28
+ });
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.globals = exports.parameters = exports.decorators = void 0;
7
+
8
+ var _constants = require("./constants");
9
+
10
+ var _ThemedDocsContainer = require("./ThemedDocsContainer");
11
+
12
+ var _withSplunkTheme = require("./withSplunkTheme");
13
+
14
+ 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; }
15
+
16
+ var decorators = [_withSplunkTheme.withSplunkTheme];
17
+ exports.decorators = decorators;
18
+ var parameters = {
19
+ docs: {
20
+ container: _ThemedDocsContainer.ThemedDocsContainer
21
+ },
22
+ splunkThemes: {
23
+ family: 'prisma',
24
+ colorScheme: 'dark',
25
+ density: 'comfortable'
26
+ }
27
+ };
28
+ exports.parameters = parameters;
29
+
30
+ var globals = _defineProperty({}, _constants.PARAM_KEY, null);
31
+
32
+ exports.globals = globals;
@@ -35,7 +35,7 @@ var TooltipSectionTitle = _theming.styled.div(function (_ref) {
35
35
  var theme = _ref.theme;
36
36
  return {
37
37
  color: theme.textColor,
38
- fontWeight: theme.typography.weight.black,
38
+ fontWeight: theme.typography.weight.bold,
39
39
  lineHeight: '18px',
40
40
  padding: '15px 15px 0 15px'
41
41
  };
@@ -1,6 +1,6 @@
1
- import '@storybook/addon-docs/blocks';
1
+ import '@storybook/blocks';
2
2
 
3
- declare module '@storybook/addon-docs/blocks' {
3
+ declare module '@storybook/blocks' {
4
4
  declare interface DocsContainerPropsWithChildren extends DocsContainerProps {
5
5
  children?: ReactNode;
6
6
  }
@@ -18,6 +18,6 @@ declare const measures: {
18
18
  inputHeight: string;
19
19
  borderRadius: string;
20
20
  };
21
- declare type Comfortable = typeof measures;
21
+ type Comfortable = typeof measures;
22
22
  export default measures;
23
23
  export { Comfortable };
@@ -22,6 +22,6 @@ declare const measures: {
22
22
  inputHeight: string;
23
23
  borderRadius: string;
24
24
  };
25
- declare type Compact = typeof measures;
25
+ type Compact = typeof measures;
26
26
  export default measures;
27
27
  export { Compact };
@@ -1,4 +1,6 @@
1
1
  declare const theme: {
2
+ borderLightColor: string;
3
+ activeBorder: string;
2
4
  syntaxBlue: string;
3
5
  syntaxBrown: string;
4
6
  syntaxGray: string;
@@ -11,8 +13,9 @@ declare const theme: {
11
13
  backgroundColor: string;
12
14
  backgroundColorHover: string;
13
15
  borderColor: string;
14
- borderDarkColor: string;
15
- borderLightColor: string;
16
+ borderColorWeak: string;
17
+ borderColorStrong: string;
18
+ borderActiveColor: string;
16
19
  textColor: string;
17
20
  textGray: string;
18
21
  textDisabledColor: string;
@@ -208,6 +211,6 @@ declare const theme: {
208
211
  brandColorD40: string;
209
212
  brandColorD50: string;
210
213
  };
211
- declare type Dark = typeof theme;
214
+ type Dark = typeof theme;
212
215
  export default theme;
213
216
  export { Dark };
@@ -4,8 +4,8 @@ import { Compact } from './compact';
4
4
  import { Comfortable } from './comfortable';
5
5
  import { PrismaAliases } from './prismaAliases';
6
6
  import { ColorScheme, Density } from '../types';
7
- declare type MutableEnterprise = (Light | Dark) & (Comfortable | Compact) & PrismaAliases;
8
- declare type Enterprise = Readonly<MutableEnterprise>;
7
+ type MutableEnterprise = (Light | Dark) & (Comfortable | Compact) & PrismaAliases;
8
+ type Enterprise = Readonly<MutableEnterprise>;
9
9
  declare function createEnterpriseTheme({ colorScheme, density, }: {
10
10
  colorScheme: ColorScheme;
11
11
  density: Density;
@@ -1,4 +1,5 @@
1
1
  declare const theme: {
2
+ borderLightColor: string;
2
3
  zindexLayer: number;
3
4
  zindexFixedNavbar: number;
4
5
  zindexModalBackdrop: number;
@@ -7,6 +8,7 @@ declare const theme: {
7
8
  zindexToastMessages: number;
8
9
  borderRadius: string;
9
10
  border: string;
11
+ activeBorder: string;
10
12
  focusShadow: string;
11
13
  focusShadowInset: string;
12
14
  overlayShadow: string;
@@ -16,8 +18,10 @@ declare const theme: {
16
18
  textDisabledColor: string;
17
19
  linkColor: string;
18
20
  linkColorHover: string;
19
- borderLightColor: string;
21
+ borderActiveColor: string;
20
22
  borderColor: string;
23
+ borderColorWeak: string;
24
+ borderColorStrong: string;
21
25
  focusColor: string;
22
26
  backgroundColorHover: string;
23
27
  backgroundColor: string;
@@ -205,6 +209,6 @@ declare const theme: {
205
209
  brandColorD40: string;
206
210
  brandColorD50: string;
207
211
  };
208
- declare type Light = typeof theme;
212
+ type Light = typeof theme;
209
213
  export default theme;
210
214
  export { Light };
@@ -44,6 +44,6 @@ declare function createPrismaAliases({ colorScheme, density, }: {
44
44
  spacingXXLarge: string;
45
45
  spacingXXXLarge: string;
46
46
  };
47
- declare type PrismaAliases = ReturnType<typeof createPrismaAliases>;
47
+ type PrismaAliases = ReturnType<typeof createPrismaAliases>;
48
48
  export default createPrismaAliases;
49
49
  export { PrismaAliases };
@@ -1,7 +1,7 @@
1
1
  import { AnyTheme, Interpolation, ThemedProps } from '../types';
2
2
  declare const typographyVariants: readonly ["body", "title1", "title2", "title3", "title4", "title5", "title6", "title7", "largeBody", "smallBody", "footnote", "monoBody", "monoSmallBody"];
3
- declare type TypographyVariant = typeof typographyVariants[number];
4
- declare type TypographyTitleVariant = Extract<TypographyVariant, 'title1' | 'title2' | 'title3' | 'title4' | 'title5' | 'title6' | 'title7'>;
3
+ type TypographyVariant = typeof typographyVariants[number];
4
+ type TypographyTitleVariant = Extract<TypographyVariant, 'title1' | 'title2' | 'title3' | 'title4' | 'title5' | 'title6' | 'title7'>;
5
5
  interface TypographyParams {
6
6
  /**
7
7
  * Set the font-family to sans-serif or monospace based on current theme.
@@ -149,8 +149,8 @@ export declare function printWrapAll(): CSSObject;
149
149
  * @public
150
150
  */
151
151
  export declare function screenReaderContent(): CSSObject;
152
- declare type TemplateFunction<T extends AnyTheme> = (props: OptionalThemedProps<T>) => string | undefined;
153
- declare type ColorParameter<T extends AnyTheme> = string | TemplateFunction<T>;
152
+ type TemplateFunction<T extends AnyTheme> = (props: OptionalThemedProps<T>) => string | undefined;
153
+ type ColorParameter<T extends AnyTheme> = string | TemplateFunction<T>;
154
154
  /**
155
155
  * Calculates how one color would appear over another using a normal blend mode.
156
156
  * Colors can either be strings or functions, such as variable functions.
@@ -9,6 +9,10 @@ declare function createPrismaBase({ colorScheme }: {
9
9
  zindexPopover: number;
10
10
  zindexToastMessages: number;
11
11
  draggableBackground: string;
12
+ activeBorder: string;
13
+ borderColor: string;
14
+ borderColorWeak: string;
15
+ borderColorStrong: string;
12
16
  hoverShadow: string;
13
17
  focusShadow: string;
14
18
  focusShadowInset: string;
@@ -147,7 +151,12 @@ declare function createPrismaBase({ colorScheme }: {
147
151
  divergent2L5: string;
148
152
  divergent2L6: string;
149
153
  divergent2L7: string;
150
- divergent2D1: string;
154
+ divergent2D1: string; /**
155
+ * ## Layers
156
+ * If a variable does not suit your purpose, set a value relatively, such as zindexModal +1.
157
+ *
158
+ * @valueSet
159
+ */
151
160
  divergent2D2: string;
152
161
  divergent2D3: string;
153
162
  divergent2D4: string;
@@ -240,6 +249,6 @@ declare function createPrismaBase({ colorScheme }: {
240
249
  monoFontFamily: string;
241
250
  fontFamily: string;
242
251
  };
243
- declare type PrismaBase = ReturnType<typeof createPrismaBase>;
252
+ type PrismaBase = ReturnType<typeof createPrismaBase>;
244
253
  export default createPrismaBase;
245
254
  export { PrismaBase };
@@ -22,6 +22,6 @@ declare const measures: {
22
22
  inputHeight: string;
23
23
  borderRadius: string;
24
24
  };
25
- declare type Comfortable = typeof measures;
25
+ type Comfortable = typeof measures;
26
26
  export default measures;
27
27
  export { Comfortable };
@@ -26,6 +26,6 @@ declare const measures: {
26
26
  inputHeight: string;
27
27
  borderRadius: string;
28
28
  };
29
- declare type Compact = typeof measures;
29
+ type Compact = typeof measures;
30
30
  export default measures;
31
31
  export { Compact };
@@ -16,6 +16,7 @@ declare const theme: {
16
16
  syntaxTeal: string;
17
17
  interactiveColorPrimary: string;
18
18
  interactiveColorBorder: string;
19
+ interactiveColorBorderActive: string;
19
20
  interactiveColorBorderHover: string;
20
21
  interactiveColorBorderDisabled: string;
21
22
  interactiveColorOverlaySelected: string;
@@ -59,6 +60,6 @@ declare const theme: {
59
60
  accentColorAlert: string;
60
61
  accentColorNegative: string;
61
62
  };
62
- declare type Dark = typeof theme;
63
+ type Dark = typeof theme;
63
64
  export default theme;
64
65
  export { Dark };
@@ -4,8 +4,8 @@ import { Compact } from './compact';
4
4
  import { Comfortable } from './comfortable';
5
5
  import { PrismaBase } from './base';
6
6
  import { ColorScheme, Density } from '../types';
7
- declare type MutablePrisma = PrismaBase & (Light | Dark) & (Comfortable | Compact);
8
- declare type Prisma = Readonly<MutablePrisma>;
7
+ type MutablePrisma = PrismaBase & (Light | Dark) & (Comfortable | Compact);
8
+ type Prisma = Readonly<MutablePrisma>;
9
9
  declare function createPrismaTheme({ colorScheme, density, }: {
10
10
  colorScheme: ColorScheme;
11
11
  density: Density;
@@ -16,6 +16,7 @@ declare const theme: {
16
16
  syntaxTeal: string;
17
17
  interactiveColorPrimary: string;
18
18
  interactiveColorBorder: string;
19
+ interactiveColorBorderActive: string;
19
20
  interactiveColorBorderHover: string;
20
21
  interactiveColorBorderDisabled: string;
21
22
  interactiveColorOverlaySelected: string;
@@ -59,6 +60,6 @@ declare const theme: {
59
60
  accentColorAlert: string;
60
61
  accentColorNegative: string;
61
62
  };
62
- declare type Light = typeof theme;
63
+ type Light = typeof theme;
63
64
  export default theme;
64
65
  export { Light };
@@ -1,10 +1,10 @@
1
- import { FunctionComponent } from 'react';
1
+ import React from 'react';
2
2
  import { ThemeSettings } from '../types';
3
- declare type ThemeOption = {
3
+ type ThemeOption = {
4
4
  name: string;
5
5
  values: string[];
6
6
  };
7
- declare type ThemeOptions = Pick<Record<keyof ThemeSettings, ThemeOption>, 'family' | 'colorScheme' | 'density'>;
7
+ type ThemeOptions = Pick<Record<keyof ThemeSettings, ThemeOption>, 'family' | 'colorScheme' | 'density'>;
8
8
  export declare const themeOptions: ThemeOptions;
9
- export declare const SplunkThemesTool: FunctionComponent;
9
+ export declare const SplunkThemesTool: React.MemoExoticComponent<() => JSX.Element>;
10
10
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DocsContextProps } from '@storybook/addon-docs/blocks';
2
+ import { DocsContextProps } from '@storybook/blocks';
3
3
  declare const ThemedDocsContainer: ({ children, context, }: {
4
4
  children: React.ReactNode;
5
5
  context: DocsContextProps;
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
1
+ export declare const decorators: import("@storybook/react").Decorator<import("@storybook/types").StrictArgs>[];
2
2
  export declare const parameters: {
3
3
  docs: {
4
4
  container: ({ children, context, }: {
5
5
  children: import("react").ReactNode;
6
- context: import("@storybook/preview-web").DocsContextProps<import("@storybook/csf").AnyFramework>;
6
+ context: import("@storybook/types").DocsContextProps<import("@storybook/types").Renderer>;
7
7
  }) => import("react").ReactNode;
8
8
  };
9
9
  splunkThemes: {
@@ -12,3 +12,6 @@ export declare const parameters: {
12
12
  density: string;
13
13
  };
14
14
  };
15
+ export declare const globals: {
16
+ splunkThemes: null;
17
+ };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export declare const GlobalStyles: import("styled-components").GlobalStyleComponent<import("../types").OptionalThemedProps<import("../types").AnyTheme> & import("../types").ThemedProps<import("../types").AnyTheme>, import("styled-components").DefaultTheme>;
3
- export declare const TooltipSectionTitle: import("@storybook/theming").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is"> & {
4
- theme: import("@storybook/theming").Theme;
5
- }, import("@storybook/theming").Theme>;
3
+ export declare const TooltipSectionTitle: import("@storybook/theming").StyledComponent<{
4
+ theme?: import("@storybook/theming").Theme | undefined;
5
+ as?: import("react").ElementType<any> | undefined;
6
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,4 +1,4 @@
1
- import { StoryContext } from '@storybook/addons';
1
+ import { StoryContext } from '@storybook/types';
2
2
  import { ThemeSettings } from '../types';
3
3
  export declare const normalizeThemeOptions: (paramOptions?: {}, globalOptions?: {}) => Partial<ThemeSettings>;
4
4
  export declare const getThemeOptionsFromContext: (context: StoryContext) => Partial<ThemeSettings>;
@@ -1,4 +1,2 @@
1
- export declare const withSplunkTheme: import("@storybook/csf").DecoratorFunction<{
2
- component: any;
3
- storyResult: import("@storybook/react/dist/ts3.9/client/preview/types").StoryFnReactReturnType;
4
- }, import("@storybook/react").Args>;
1
+ import { Decorator } from '@storybook/react';
2
+ export declare const withSplunkTheme: Decorator<import("@storybook/types").StrictArgs>;
package/types/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Interpolation as SCInterpolation } from 'styled-components';
2
2
  import { Enterprise as EnterpriseVariables } from './enterprise';
3
3
  import { Prisma as PrismaVariables } from './prisma';
4
- declare type ColorScheme = 'light' | 'dark';
5
- declare type Density = 'comfortable' | 'compact';
4
+ type ColorScheme = 'light' | 'dark';
5
+ type Density = 'comfortable' | 'compact';
6
6
  interface ThemeSettingsBase {
7
7
  colorScheme: ColorScheme;
8
8
  density: Density;
@@ -16,52 +16,52 @@ interface ThemeSettingsBase {
16
16
  interface ThemeSettings<T extends AnyTheme = AnyTheme> extends ThemeSettingsBase {
17
17
  family: T extends Enterprise ? 'enterprise' : 'prisma';
18
18
  }
19
- declare type Enterprise = EnterpriseVariables & ThemeSettingsBase & {
19
+ type Enterprise = EnterpriseVariables & ThemeSettingsBase & {
20
20
  family: 'enterprise';
21
21
  isEnterprise: true;
22
22
  };
23
- declare type Prisma = PrismaVariables & ThemeSettingsBase & {
23
+ type Prisma = PrismaVariables & ThemeSettingsBase & {
24
24
  family: 'prisma';
25
25
  isPrisma: true;
26
26
  };
27
- declare type CustomizeTheme<T extends AnyTheme = AnyTheme> = {
27
+ type CustomizeTheme<T extends AnyTheme = AnyTheme> = {
28
28
  bivarianceHack(theme: T): T;
29
29
  }['bivarianceHack'];
30
- declare type CustomizerSetting<T extends AnyTheme = AnyTheme> = {
30
+ type CustomizerSetting<T extends AnyTheme = AnyTheme> = {
31
31
  customizer?: CustomizeTheme<T>;
32
32
  };
33
- declare type ThemedProps<T extends AnyTheme = AnyTheme> = {
33
+ type ThemedProps<T extends AnyTheme = AnyTheme> = {
34
34
  theme: {
35
35
  splunkThemeV1: ThemeSettings<T>;
36
36
  };
37
37
  };
38
- declare type OptionalThemedProps<T extends AnyTheme = AnyTheme> = {
38
+ type OptionalThemedProps<T extends AnyTheme = AnyTheme> = {
39
39
  theme?: {
40
40
  splunkThemeV1?: Partial<ThemeSettings<T>> & CustomizerSetting<T>;
41
41
  };
42
42
  };
43
- declare type AnyTheme = Enterprise | Prisma;
44
- declare type VariableName<T extends AnyTheme> = keyof T;
45
- declare type VariableNameExclusiveEnterprise = Exclude<VariableName<Enterprise>, VariableName<Prisma>>;
46
- declare type VariableNameExclusivePrisma = Exclude<VariableName<Prisma>, VariableName<Enterprise>>;
47
- declare type Variable<T extends AnyTheme, V extends VariableName<T>> = T[V];
48
- declare type VariableInterpolation<T extends AnyTheme, V extends VariableName<T>> = (props: OptionalThemedProps<T>) => Variable<T, V>;
49
- declare type UnsafeVariableInterpolation<T extends AnyTheme, V extends VariableName<T>> = (props: OptionalThemedProps<T>) => Variable<T, V> | undefined;
50
- declare type Variables<T extends AnyTheme> = {
43
+ type AnyTheme = Enterprise | Prisma;
44
+ type VariableName<T extends AnyTheme> = keyof T;
45
+ type VariableNameExclusiveEnterprise = Exclude<VariableName<Enterprise>, VariableName<Prisma>>;
46
+ type VariableNameExclusivePrisma = Exclude<VariableName<Prisma>, VariableName<Enterprise>>;
47
+ type Variable<T extends AnyTheme, V extends VariableName<T>> = T[V];
48
+ type VariableInterpolation<T extends AnyTheme, V extends VariableName<T>> = (props: OptionalThemedProps<T>) => Variable<T, V>;
49
+ type UnsafeVariableInterpolation<T extends AnyTheme, V extends VariableName<T>> = (props: OptionalThemedProps<T>) => Variable<T, V> | undefined;
50
+ type Variables<T extends AnyTheme> = {
51
51
  [V in VariableName<T>]: VariableInterpolation<T, V>;
52
52
  };
53
- declare type VariablesExclusiveEnterprise = {
53
+ type VariablesExclusiveEnterprise = {
54
54
  [V in VariableNameExclusiveEnterprise]: UnsafeVariableInterpolation<Enterprise, V>;
55
55
  };
56
- declare type VariablesExclusivePrisma = {
56
+ type VariablesExclusivePrisma = {
57
57
  [V in VariableNameExclusivePrisma]: UnsafeVariableInterpolation<Prisma, V>;
58
58
  };
59
- declare type AllVariables = {
59
+ type AllVariables = {
60
60
  [V in VariableName<AnyTheme>]: VariableInterpolation<AnyTheme, V>;
61
61
  } & VariablesExclusiveEnterprise & VariablesExclusivePrisma;
62
- declare type Interpolation<T extends AnyTheme, A extends object> = (props: OptionalThemedProps<T> & A) => InterpolationResult<T, A>;
63
- declare type InterpolationResult<T extends AnyTheme, A extends object> = Interpolation<T, A> | SCInterpolation<ThemedProps<T> & A> | string | number | null;
64
- declare type Tree<T extends AnyTheme, A extends object> = {
62
+ type Interpolation<T extends AnyTheme, A extends object> = (props: OptionalThemedProps<T> & A) => InterpolationResult<T, A>;
63
+ type InterpolationResult<T extends AnyTheme, A extends object> = Interpolation<T, A> | SCInterpolation<ThemedProps<T> & A> | string | number | null;
64
+ type Tree<T extends AnyTheme, A extends object> = {
65
65
  enterprise?: TreeOrInterpolationResult<Enterprise, A>;
66
66
  prisma?: TreeOrInterpolationResult<Prisma, A>;
67
67
  light?: TreeOrInterpolationResult<T, A>;
@@ -69,6 +69,6 @@ declare type Tree<T extends AnyTheme, A extends object> = {
69
69
  compact?: TreeOrInterpolationResult<T, A>;
70
70
  comfortable?: TreeOrInterpolationResult<T, A>;
71
71
  };
72
- declare type TreeOrInterpolationResult<T extends AnyTheme, A extends object> = Tree<T, A> | InterpolationResult<T, A>;
73
- declare type ObjKeys = <T>(o: T) => Extract<keyof T, string>[];
72
+ type TreeOrInterpolationResult<T extends AnyTheme, A extends object> = Tree<T, A> | InterpolationResult<T, A>;
73
+ type ObjKeys = <T>(o: T) => Extract<keyof T, string>[];
74
74
  export { AllVariables, AnyTheme, ColorScheme, CustomizerSetting, CustomizeTheme, Density, Enterprise, Interpolation, InterpolationResult, ObjKeys, OptionalThemedProps, Prisma, ThemedProps, ThemeSettings, Tree, TreeOrInterpolationResult, Variable, VariableInterpolation, VariableName, Variables, };
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { AnyTheme } from './types';
3
- declare type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
3
+ type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
4
4
  export interface SplunkThemeProps<T extends AnyTheme> {
5
5
  splunkTheme: T;
6
6
  }
7
- declare type WithoutSplunkThemeProps<P extends SplunkThemeProps<T>, T extends AnyTheme> = DistributiveOmit<P, keyof SplunkThemeProps<T>>;
7
+ type WithoutSplunkThemeProps<P extends SplunkThemeProps<T>, T extends AnyTheme> = DistributiveOmit<P, keyof SplunkThemeProps<T>>;
8
8
  declare function withSplunkTheme<C extends React.ComponentClass<P>, P extends SplunkThemeProps<T>, T extends AnyTheme = AnyTheme>(Component: C): React.ForwardRefExoticComponent<WithoutSplunkThemeProps<JSX.LibraryManagedAttributes<C, P> & {
9
9
  ref?: React.Ref<InstanceType<typeof Component>>;
10
10
  }, T>>;
package/variables.js CHANGED
@@ -85,7 +85,7 @@ var getThemeVariable = function getThemeVariable(name, settings, customizer) {
85
85
 
86
86
  if (false && typeof returnValue === 'undefined') {
87
87
  // eslint-disable-next-line no-console
88
- console.warn("The variable '".concat(name, "' does not exist in the theme '").concat(theme.family, " ").concat(theme.colorScheme, " ").concat(theme.density, "'."));
88
+ console.warn("The variable '".concat(String(name), "' does not exist in the theme '").concat(theme.family, " ").concat(theme.colorScheme, " ").concat(theme.density, "'."));
89
89
  }
90
90
 
91
91
  return returnValue;
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.decorators = void 0;
7
-
8
- var _withSplunkTheme = require("./withSplunkTheme");
9
-
10
- var decorators = [_withSplunkTheme.withSplunkTheme];
11
- exports.decorators = decorators;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.parameters = void 0;
7
-
8
- var _ThemedDocsContainer = require("./ThemedDocsContainer");
9
-
10
- var parameters = {
11
- docs: {
12
- container: _ThemedDocsContainer.ThemedDocsContainer
13
- },
14
- splunkThemes: {
15
- family: 'prisma',
16
- colorScheme: 'dark',
17
- density: 'comfortable'
18
- }
19
- };
20
- exports.parameters = parameters;
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.config = config;
7
- exports.managerEntries = managerEntries;
8
-
9
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
10
-
11
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
-
13
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
-
15
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
16
-
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
-
19
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
-
21
- /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
22
- function config() {
23
- var entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24
- return [].concat(_toConsumableArray(entry), [require.resolve('./addDecorator'), require.resolve('./addParameter')]);
25
- }
26
-
27
- function managerEntries() {
28
- var entry = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
29
- return [].concat(_toConsumableArray(entry), [require.resolve('./register')]);
30
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
5
- var _react = _interopRequireDefault(require("react"));
6
-
7
- var _addons = _interopRequireWildcard(require("@storybook/addons"));
8
-
9
- var _constants = require("./constants");
10
-
11
- var _SplunkThemesTool = require("./SplunkThemesTool");
12
-
13
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
14
-
15
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
-
17
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
18
-
19
- _addons["default"].register(_constants.ADDON_ID, function () {
20
- _addons["default"].add(_constants.ADDON_ID, {
21
- title: 'splunk/themes',
22
- type: _addons.types.TOOL,
23
- match: function match(_ref) {
24
- var viewMode = _ref.viewMode;
25
- return !!(viewMode && viewMode.match(/^(story|docs)$/));
26
- },
27
- paramKey: _constants.PARAM_KEY,
28
- render: function render() {
29
- return /*#__PURE__*/_react["default"].createElement(_SplunkThemesTool.SplunkThemesTool, null);
30
- }
31
- });
32
- });
@@ -1,4 +0,0 @@
1
- export declare const decorators: import("@storybook/csf").DecoratorFunction<{
2
- component: any;
3
- storyResult: import("@storybook/react/dist/ts3.9/client/preview/types").StoryFnReactReturnType;
4
- }, import("@storybook/csf").Args>[];
@@ -1,2 +0,0 @@
1
- export declare function config(entry?: unknown[]): unknown[];
2
- export declare function managerEntries(entry?: unknown[]): unknown[];