@splunk/themes 0.22.0 → 1.0.0-beta.2

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 (85) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CHANGELOG.v1.md +70 -0
  3. package/SplunkThemeProvider.js +18 -31
  4. package/design-tokens/colors.js +495 -0
  5. package/design-tokens/dataViz.js +486 -0
  6. package/design-tokens/deprecated.js +249 -0
  7. package/design-tokens/elevation.js +44 -0
  8. package/design-tokens/index.js +23 -0
  9. package/design-tokens/spacing-sizing.js +39 -0
  10. package/design-tokens/typography.js +67 -0
  11. package/enterprise/comfortable.js +20 -11
  12. package/enterprise/compact.js +20 -15
  13. package/enterprise/dark.js +188 -53
  14. package/enterprise/dataViz.js +491 -0
  15. package/enterprise/index.js +9 -22
  16. package/enterprise/light.js +316 -271
  17. package/getSettingsFromThemedProps.js +4 -8
  18. package/getTheme.js +13 -26
  19. package/index.js +9 -13
  20. package/mixins/index.js +47 -19
  21. package/mixins/layout.js +42 -0
  22. package/mixins/prose.js +67 -0
  23. package/mixins/tests/prose.unit.js +49 -0
  24. package/mixins/tests/typography.unit.js +54 -103
  25. package/mixins/tests/utilityMixins.unit.js +3 -11
  26. package/mixins/typography.js +154 -188
  27. package/mixins/utilityMixins.js +13 -39
  28. package/package.json +22 -17
  29. package/pick.js +7 -18
  30. package/pickVariant.js +1 -7
  31. package/prisma/base.js +34 -42
  32. package/prisma/comfortable.js +1 -8
  33. package/prisma/compact.js +1 -8
  34. package/prisma/dark.js +90 -33
  35. package/prisma/dataViz.js +71 -87
  36. package/prisma/index.js +8 -16
  37. package/prisma/light.js +91 -34
  38. package/splunk-magnetic/index.js +178 -0
  39. package/splunk-magnetic/magneticTokensDark.js +706 -0
  40. package/splunk-magnetic/magneticTokensLight.js +706 -0
  41. package/storybook-addon-splunk-themes/SplunkThemesTool.js +20 -42
  42. package/storybook-addon-splunk-themes/ThemedDocsContainer.js +3 -13
  43. package/storybook-addon-splunk-themes/index.js +0 -4
  44. package/storybook-addon-splunk-themes/manager.js +1 -7
  45. package/storybook-addon-splunk-themes/preview.js +4 -8
  46. package/storybook-addon-splunk-themes/tests/util.unit.js +0 -1
  47. package/storybook-addon-splunk-themes/themeOptions.js +0 -1
  48. package/storybook-addon-splunk-themes/themes.js +4 -15
  49. package/storybook-addon-splunk-themes/util.js +21 -39
  50. package/storybook-addon-splunk-themes/withSplunkTheme.js +34 -68
  51. package/types/design-tokens/colors.d.ts +875 -0
  52. package/types/design-tokens/dataViz.d.ts +433 -0
  53. package/types/design-tokens/deprecated.d.ts +468 -0
  54. package/types/design-tokens/elevation.d.ts +49 -0
  55. package/types/design-tokens/index.d.ts +541 -0
  56. package/types/design-tokens/spacing-sizing.d.ts +39 -0
  57. package/types/design-tokens/typography.d.ts +79 -0
  58. package/types/enterprise/comfortable.d.ts +11 -17
  59. package/types/enterprise/compact.d.ts +11 -21
  60. package/types/enterprise/dark.d.ts +412 -113
  61. package/types/enterprise/dataViz.d.ts +14 -0
  62. package/types/enterprise/index.d.ts +1 -2
  63. package/types/enterprise/light.d.ts +439 -139
  64. package/types/index.d.ts +1 -0
  65. package/types/mixins/index.d.ts +8 -0
  66. package/types/mixins/layout.d.ts +21 -0
  67. package/types/mixins/prose.d.ts +41 -0
  68. package/types/mixins/tests/prose.unit.d.ts +1 -0
  69. package/types/mixins/typography.d.ts +5 -12
  70. package/types/prisma/base.d.ts +12 -16
  71. package/types/prisma/comfortable.d.ts +2 -17
  72. package/types/prisma/compact.d.ts +2 -17
  73. package/types/prisma/dark.d.ts +60 -9
  74. package/types/prisma/dataViz.d.ts +8 -426
  75. package/types/prisma/light.d.ts +62 -11
  76. package/types/splunk-magnetic/index.d.ts +2941 -0
  77. package/types/splunk-magnetic/magneticTokensDark.d.ts +700 -0
  78. package/types/splunk-magnetic/magneticTokensLight.d.ts +700 -0
  79. package/types/storybook-addon-splunk-themes/SplunkThemesTool.d.ts +1 -1
  80. package/useSplunkTheme.js +14 -22
  81. package/utils.js +25 -35
  82. package/variables.js +17 -31
  83. package/withSplunkTheme.js +26 -36
  84. package/enterprise/prismaAliases.js +0 -103
  85. package/types/enterprise/prismaAliases.d.ts +0 -47
@@ -1,63 +1,41 @@
1
1
  "use strict";
2
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
-
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); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.SplunkThemesTool = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _managerApi = require("@storybook/manager-api");
13
-
14
10
  var _components = require("@storybook/components");
15
-
16
11
  var _constants = require("./constants");
17
-
18
12
  var _themeOptions = require("./themeOptions");
19
-
20
13
  var _themes = require("./themes");
21
-
22
14
  var _util = require("./util");
23
-
24
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
-
26
- 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; }
27
-
28
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
29
-
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n["default"] = e, t && t.set(e, n), n; }
17
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
30
18
  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."); }
31
-
32
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
33
-
34
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
35
-
36
- 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; }
37
-
38
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
-
19
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
20
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
21
+ 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; }
22
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23
+ 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); }
24
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
40
25
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
-
42
- 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); }
43
-
44
- 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; }
45
-
46
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
47
-
48
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
-
26
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
27
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
28
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
29
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
50
30
  var SplunkThemesTool = /*#__PURE__*/(0, _react.memo)(function () {
51
31
  var _React$useState = _react["default"].useState(false),
52
- _React$useState2 = _slicedToArray(_React$useState, 2),
53
- isTooltipVisible = _React$useState2[0],
54
- setIsTooltipVisible = _React$useState2[1];
55
-
32
+ _React$useState2 = _slicedToArray(_React$useState, 2),
33
+ isTooltipVisible = _React$useState2[0],
34
+ setIsTooltipVisible = _React$useState2[1];
56
35
  var _useGlobals = (0, _managerApi.useGlobals)(),
57
- _useGlobals2 = _slicedToArray(_useGlobals, 2),
58
- globals = _useGlobals2[0],
59
- updateGlobals = _useGlobals2[1];
60
-
36
+ _useGlobals2 = _slicedToArray(_useGlobals, 2),
37
+ globals = _useGlobals2[0],
38
+ updateGlobals = _useGlobals2[1];
61
39
  var params = (0, _managerApi.useParameter)(_constants.PARAM_KEY, {});
62
40
  var globalsTheme = globals[_constants.PARAM_KEY] || undefined;
63
41
  var currentTheme = (0, _util.normalizeThemeOptions)(params, globalsTheme);
@@ -4,30 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ThemedDocsContainer = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _blocks = require("@storybook/blocks");
11
-
12
9
  var _theming = require("@storybook/theming");
13
-
14
10
  var _useSplunkTheme2 = _interopRequireDefault(require("../useSplunkTheme"));
15
-
16
11
  var _themes = require("./themes");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
-
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
20
13
  var ThemedDocsContainer = function ThemedDocsContainer(_ref) {
21
14
  var children = _ref.children,
22
- context = _ref.context;
23
-
15
+ context = _ref.context;
24
16
  var _useSplunkTheme = (0, _useSplunkTheme2["default"])(),
25
- isDark = _useSplunkTheme.isDark;
26
-
17
+ isDark = _useSplunkTheme.isDark;
27
18
  return /*#__PURE__*/_react["default"].createElement(_blocks.DocsContainer, {
28
19
  context: context,
29
20
  theme: isDark ? _theming.themes.dark : _theming.themes.light
30
21
  }, /*#__PURE__*/_react["default"].createElement(_themes.GlobalStyles, null), children);
31
22
  };
32
-
33
23
  exports.ThemedDocsContainer = ThemedDocsContainer;
@@ -27,11 +27,7 @@ Object.defineProperty(exports, "getThemeOptionsFromContext", {
27
27
  return _util.getThemeOptionsFromContext;
28
28
  }
29
29
  });
30
-
31
30
  var _SplunkThemesTool = require("./SplunkThemesTool");
32
-
33
31
  var _withSplunkTheme = require("./withSplunkTheme");
34
-
35
32
  var _ThemedDocsContainer = require("./ThemedDocsContainer");
36
-
37
33
  var _util = require("./util");
@@ -1,17 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _react = _interopRequireDefault(require("react"));
4
-
5
4
  var _managerApi = require("@storybook/manager-api");
6
-
7
5
  var _types = require("@storybook/types");
8
-
9
6
  var _constants = require("./constants");
10
-
11
7
  var _SplunkThemesTool = require("./SplunkThemesTool");
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
15
9
  _managerApi.addons.register(_constants.ADDON_ID, function () {
16
10
  _managerApi.addons.add(_constants.ADDON_ID, {
17
11
  title: 'splunk/themes',
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.globals = exports.parameters = exports.decorators = void 0;
7
-
8
7
  var _constants = require("./constants");
9
-
10
8
  var _ThemedDocsContainer = require("./ThemedDocsContainer");
11
-
12
9
  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
-
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
+ 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; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
13
+ 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); }
16
14
  var decorators = [_withSplunkTheme.withSplunkTheme];
17
15
  exports.decorators = decorators;
18
16
  var parameters = {
@@ -26,7 +24,5 @@ var parameters = {
26
24
  }
27
25
  };
28
26
  exports.parameters = parameters;
29
-
30
27
  var globals = _defineProperty({}, _constants.PARAM_KEY, null);
31
-
32
28
  exports.globals = globals;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _util = require("../util");
4
-
5
4
  describe('getMergedTheme', function () {
6
5
  // Storybook will set "null" for "globalsTheme" in some situtations so we need to validate that this doesn't throw
7
6
  it('should not throw if globalsTheme is null', function () {
@@ -22,7 +22,6 @@ var themeOptions = {
22
22
  }
23
23
  };
24
24
  exports.themeOptions = themeOptions;
25
-
26
25
  function isThemeOptionKey(key) {
27
26
  return themeOptionsKeys.includes(key);
28
27
  }
@@ -4,33 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TooltipSectionTitle = exports.GlobalStyles = void 0;
7
-
8
7
  var _styledComponents = require("styled-components");
9
-
10
8
  var _theming = require("@storybook/theming");
11
-
12
9
  var _mixins = _interopRequireDefault(require("../mixins"));
13
-
14
10
  var _variables = _interopRequireDefault(require("../variables"));
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
18
12
  function _templateObject() {
19
13
  var data = _taggedTemplateLiteral(["\n .sb-show-main {\n ", ";\n background-color: ", ";\n }\n\n .sbdocs-h2 {\n color: ", "\n }\n\n .sbdocs-h3 {\n color: ", "\n }\n\n #docs-root, .sbdocs {\n background-color: ", ";\n }\n\n #docs-root, .sbdocs-title {\n color: ", ";\n }\n\n .sbdocs, .sbdocs-preview {\n background-color: ", ";\n }\n\n .os-host, .os-host-foreign {\n color: ", ";\n background-color: ", ";\n }\n\n .prismjs {\n background-color: ", " !important;\n }\n\n .docblock-code-toggle {\n color: ", " !important;\n background-color: ", " !important;\n }\n\n #docs-root , .docblock-argstable-head, thead th {\n color: ", " !important;\n background-color: ", ";\n }\n"]);
20
-
21
14
  _templateObject = function _templateObject() {
22
15
  return data;
23
16
  };
24
-
25
17
  return data;
26
18
  }
19
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
20
+ var GlobalStyles = (0, _styledComponents.createGlobalStyle)(_templateObject(), _mixins["default"].reset('block'), _variables["default"].backgroundColorPage, _variables["default"].contentColorActive, _variables["default"].contentColorActive, _variables["default"].backgroundColorPage, _variables["default"].contentColorActive, _variables["default"].backgroundColorPage, _variables["default"].contentColorDefault, _variables["default"].backgroundColorNavigation, _variables["default"].black, _variables["default"].contentColorDefault, _variables["default"].backgroundColorSection, _variables["default"].contentColorDefault, _variables["default"].backgroundColorPopup);
27
21
 
28
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
29
-
30
- var GlobalStyles = (0, _styledComponents.createGlobalStyle)(_templateObject(), _mixins["default"].reset('block'), _variables["default"].backgroundColorPage, _variables["default"].contentColorActive, _variables["default"].contentColorActive, _variables["default"].backgroundColorPage, _variables["default"].contentColorActive, _variables["default"].backgroundColorPage, _variables["default"].contentColorDefault, _variables["default"].backgroundColorNavigation, _variables["default"].black, _variables["default"].contentColorDefault, _variables["default"].backgroundColorSection, _variables["default"].contentColorDefault, _variables["default"].backgroundColorPopup); // theming based on Storybook's <TooltipMessage>
31
-
22
+ // theming based on Storybook's <TooltipMessage>
32
23
  exports.GlobalStyles = GlobalStyles;
33
-
34
24
  var TooltipSectionTitle = _theming.styled.div(function (_ref) {
35
25
  var theme = _ref.theme;
36
26
  return {
@@ -40,5 +30,4 @@ var TooltipSectionTitle = _theming.styled.div(function (_ref) {
40
30
  padding: '15px 15px 0 15px'
41
31
  };
42
32
  });
43
-
44
33
  exports.TooltipSectionTitle = TooltipSectionTitle;
@@ -4,58 +4,45 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getThemeOptionsFromContext = exports.getMergedTheme = exports.normalizeThemeOptions = void 0;
7
-
8
7
  var _constants = require("./constants");
9
-
10
8
  var _themeOptions = require("./themeOptions");
11
-
12
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
-
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
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
14
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
-
16
- 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); }
17
-
18
- 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; }
19
-
20
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
21
-
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
-
24
- 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; }
25
-
26
- 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; }
27
-
28
- 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; }
29
-
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
16
+ 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; }
17
+ 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; }
18
+ 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; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
20
+ 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); }
30
21
  var normalizeThemeOptions = function normalizeThemeOptions() {
31
22
  var paramOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
32
23
  var globalOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33
24
  return _objectSpread(_objectSpread({}, paramOptions), globalOptions);
34
- }; // merge the existing theme with the newly selected theme
25
+ };
26
+
27
+ // merge the existing theme with the newly selected theme
35
28
  // this functon only allows the most recently-selectd "both" option to persist
36
29
  // because allowing more than one "both" leads to an unwieldy visualization
37
-
38
-
39
30
  exports.normalizeThemeOptions = normalizeThemeOptions;
40
-
41
31
  var getMergedTheme = function getMergedTheme(globalsTheme, newTheme) {
42
32
  var firstBothEntry = Object.entries(newTheme).find(function (_ref) {
43
33
  var _ref2 = _slicedToArray(_ref, 2),
44
- value = _ref2[1];
45
-
34
+ value = _ref2[1];
46
35
  return value === 'both';
47
36
  });
48
-
49
37
  var _ref3 = firstBothEntry || [],
50
- _ref4 = _slicedToArray(_ref3, 1),
51
- firstBothOption = _ref4[0];
52
-
53
- var finalValue; // only allow "both" for a single theme setting; if a new one is passed, remove the old one
38
+ _ref4 = _slicedToArray(_ref3, 1),
39
+ firstBothOption = _ref4[0];
40
+ var finalValue;
54
41
 
42
+ // only allow "both" for a single theme setting; if a new one is passed, remove the old one
55
43
  var mergedTheme = Object.entries(_themeOptions.themeOptions).reduce(function (themeAccum, _ref5) {
56
44
  var _ref6 = _slicedToArray(_ref5, 1),
57
- key = _ref6[0];
58
-
45
+ key = _ref6[0];
59
46
  if ((0, _themeOptions.isThemeOptionKey)(key)) {
60
47
  if ((globalsTheme === null || globalsTheme === void 0 ? void 0 : globalsTheme[key]) === 'both' && firstBothOption != null && key !== firstBothOption) {
61
48
  var defaultThemeOptionValue = _themeOptions.themeOptions[key].values[0];
@@ -63,25 +50,20 @@ var getMergedTheme = function getMergedTheme(globalsTheme, newTheme) {
63
50
  } else {
64
51
  finalValue = newTheme[key] || (globalsTheme === null || globalsTheme === void 0 ? void 0 : globalsTheme[key]);
65
52
  }
66
-
67
53
  if (finalValue != null) {
68
54
  return _objectSpread(_objectSpread({}, themeAccum), {}, _defineProperty({}, key, finalValue));
69
55
  }
70
56
  }
71
-
72
57
  return themeAccum;
73
58
  }, {});
74
59
  return mergedTheme;
75
60
  };
76
-
77
61
  exports.getMergedTheme = getMergedTheme;
78
-
79
62
  var getThemeOptionsFromContext = function getThemeOptionsFromContext(context) {
80
63
  var globals = context.globals,
81
- parameters = context.parameters;
64
+ parameters = context.parameters;
82
65
  var globalsTheme = globals[_constants.PARAM_KEY];
83
66
  var themesConfig = parameters[_constants.PARAM_KEY];
84
67
  return normalizeThemeOptions(themesConfig, globalsTheme);
85
68
  };
86
-
87
69
  exports.getThemeOptionsFromContext = getThemeOptionsFromContext;
@@ -1,94 +1,61 @@
1
1
  "use strict";
2
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
-
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); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.withSplunkTheme = void 0;
9
-
10
8
  var _react = _interopRequireWildcard(require("react"));
11
-
12
9
  var _lodash = require("lodash");
13
-
14
10
  var _styledComponents = _interopRequireDefault(require("styled-components"));
15
-
11
+ var _splunkMagnetic = _interopRequireDefault(require("../splunk-magnetic"));
16
12
  var _SplunkThemeProvider = _interopRequireDefault(require("../SplunkThemeProvider"));
17
-
18
13
  var _variables = _interopRequireDefault(require("../variables"));
19
-
20
14
  var _constants = require("./constants");
21
-
22
15
  var _themes = require("./themes");
23
-
24
16
  var _themeOptions = require("./themeOptions");
25
-
26
17
  var _util = require("./util");
27
-
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
-
30
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
31
-
32
- 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; }
33
-
34
- 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; }
35
-
36
- 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; }
37
-
38
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
-
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n["default"] = e, t && t.set(e, n), n; }
21
+ 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; }
22
+ 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; }
23
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
40
24
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
-
42
- 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); }
43
-
44
- 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; }
45
-
46
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
47
-
48
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
49
-
50
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
51
-
52
- 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; }
53
-
25
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
26
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
27
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
28
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
29
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
30
+ 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; }
31
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
32
+ 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); }
54
33
  function _templateObject2() {
55
34
  var data = _taggedTemplateLiteral(["\n display: flex;\n gap: ", ";\n flex-direction: column;\n"]);
56
-
57
35
  _templateObject2 = function _templateObject2() {
58
36
  return data;
59
37
  };
60
-
61
38
  return data;
62
39
  }
63
-
64
40
  function _templateObject() {
65
41
  var data = _taggedTemplateLiteral(["\n background-color: ", ";\n padding: ", ";\n"]);
66
-
67
42
  _templateObject = function _templateObject() {
68
43
  return data;
69
44
  };
70
-
71
45
  return data;
72
46
  }
73
-
74
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
75
-
47
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
76
48
  var StoryWrapper = _styledComponents["default"].div(_templateObject(), _variables["default"].backgroundColorPage, _variables["default"].spacingLarge);
77
-
78
49
  var DualStoryContainer = _styledComponents["default"].div(_templateObject2(), _variables["default"].spacingLarge);
79
-
80
50
  // Renders a story twice side-by-side in two separate color schemes
81
51
  var DualStory = function DualStory(_ref) {
82
52
  var _children$props;
83
-
84
53
  var children = _ref.children,
85
- context = _ref.context,
86
- themeOption = _ref.themeOption,
87
- themeProviderProps = _ref.themeProviderProps;
88
-
89
- if ( /*#__PURE__*/(0, _react.isValidElement)(children) && (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.componentId)) {
54
+ context = _ref.context,
55
+ themeOption = _ref.themeOption,
56
+ themeProviderProps = _ref.themeProviderProps;
57
+ if (/*#__PURE__*/(0, _react.isValidElement)(children) && (children === null || children === void 0 ? void 0 : (_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.componentId)) {
90
58
  var _themeOptions$themeOp;
91
-
92
59
  var themeOptionValues = ((_themeOptions$themeOp = _themeOptions.themeOptions[themeOption]) === null || _themeOptions$themeOp === void 0 ? void 0 : _themeOptions$themeOp.values) || [];
93
60
  return /*#__PURE__*/_react["default"].createElement(DualStoryContainer, null, themeOptionValues.map(function (themeOptionValue) {
94
61
  return /*#__PURE__*/_react["default"].createElement(_SplunkThemeProvider["default"], _extends({
@@ -97,44 +64,43 @@ var DualStory = function DualStory(_ref) {
97
64
  }));
98
65
  }
99
66
 
67
+ // Required to render correctly, otherwise DualStory isn't considered a valid component
68
+ // eslint-disable-next-line react/jsx-no-useless-fragment
100
69
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children);
101
70
  };
102
-
103
71
  var WithSplunkTheme = function WithSplunkTheme(Story, context) {
104
72
  var globals = context.globals,
105
- parameters = context.parameters;
73
+ parameters = context.parameters,
74
+ args = context.args;
106
75
  var globalsTheme = globals[_constants.PARAM_KEY];
107
76
  var themesConfig = parameters[_constants.PARAM_KEY];
108
77
  var currentTheme = (0, _util.normalizeThemeOptions)(themesConfig, globalsTheme);
109
- var dualThemeOption = null; // ideally fromPairs would be fromEntries but our ES2015 target doesn't allow this
78
+ var dualThemeOption = null;
110
79
 
80
+ // ideally fromPairs would be fromEntries but our ES2015 target doesn't allow this
111
81
  var cleanedThemeProviderProps = (0, _lodash.fromPairs)(Object.entries(currentTheme).filter(function (_ref3) {
112
82
  var _ref4 = _slicedToArray(_ref3, 2),
113
- key = _ref4[0],
114
- value = _ref4[1];
115
-
83
+ key = _ref4[0],
84
+ value = _ref4[1];
116
85
  if ((0, _themeOptions.isThemeOptionKey)(key) && value === 'both') {
117
86
  dualThemeOption = key;
118
87
  return false;
119
88
  }
120
-
121
89
  return true;
122
90
  }));
123
-
124
- var themeProviderProps = _objectSpread({}, cleanedThemeProviderProps);
125
-
91
+ var themeProviderProps = _objectSpread(_objectSpread({}, cleanedThemeProviderProps), {}, {
92
+ customizeTheme: (args === null || args === void 0 ? void 0 : args.withSplunkMagneticThemeCustomizer) ? _splunkMagnetic["default"] : undefined
93
+ });
126
94
  if (dualThemeOption != null && currentTheme[dualThemeOption] === 'both') {
127
95
  return /*#__PURE__*/_react["default"].createElement(DualStory, {
128
96
  context: context,
129
97
  themeOption: dualThemeOption,
130
- themeProviderProps: cleanedThemeProviderProps
98
+ themeProviderProps: themeProviderProps
131
99
  }, /*#__PURE__*/_react["default"].createElement(Story, context));
132
100
  }
133
-
134
- return /*#__PURE__*/_react["default"].createElement(_SplunkThemeProvider["default"], _extends({}, cleanedThemeProviderProps, {
101
+ return /*#__PURE__*/_react["default"].createElement(_SplunkThemeProvider["default"], _extends({}, themeProviderProps, {
135
102
  colorScheme: themeProviderProps.colorScheme
136
103
  }), /*#__PURE__*/_react["default"].createElement(_themes.GlobalStyles, null), /*#__PURE__*/_react["default"].createElement(Story, context));
137
104
  };
138
-
139
105
  var withSplunkTheme = WithSplunkTheme;
140
106
  exports.withSplunkTheme = withSplunkTheme;