@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,74 +1,59 @@
1
1
  "use strict";
2
2
 
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
-
8
8
  var _light = _interopRequireDefault(require("./light"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
- 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; }
13
-
14
- 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; }
15
-
16
- 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; }
17
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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; }
11
+ 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; }
12
+ 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; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ 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); }
18
15
  var dragHandleDark = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAA1SURBVHgB7dKhEQAgDAPAhHmwSKZHYtmHVtZVVNTkXS53UeG57yPYazLmrB8o6h8QgPqBOAOboRAPJUGIOAAAAABJRU5ErkJggg=="; // see babel-plugin-base64-png
19
-
20
16
  var dark = {
21
- backgroundColor: _light["default"].gray20,
22
17
  backgroundColorHover: _light["default"].gray30,
23
- borderColor: _light["default"].gray22,
24
- borderColorWeak: _light["default"].gray60,
25
- borderColorStrong: _light["default"].black,
26
- borderActiveColor: "rgba(225,225,225, 0.5)",
27
- textColor: _light["default"].white,
28
- textGray: _light["default"].gray92,
29
- textDisabledColor: _light["default"].gray45,
30
- linkColor: _light["default"].accentColorL10,
31
- linkColorHover: _light["default"].accentColorL20,
32
- border: "1px solid ".concat(_light["default"].gray22),
33
- borderDark: "1px solid ".concat(_light["default"].black),
34
- borderLight: "1px solid ".concat(_light["default"].gray60),
35
- focusShadowInset: "inset 0 0 1px 1px ".concat(_light["default"].gray25, ", inset 0 0 0 3px ").concat(_light["default"].focusColor),
36
- draggableBackground: "url('data:image/png;base64,".concat(dragHandleDark, "') 0 0 / 8px 8px repeat")
18
+ borderColor: '#75797a',
19
+ borderColorWeak: '#404547',
20
+ borderColorStrong: '#9c9fa0',
21
+ borderActiveColor: "rgba(225,225,225, 0.5)"
37
22
  };
23
+
38
24
  /**
39
25
  * ## Status colors
40
26
  * Status colors are reserved for communicating urgency and severity associated with data objects and to categorize the visual communication of system responses.
41
27
  *
42
28
  * @colorSet verbose
43
29
  */
44
-
45
30
  var statusColors = {
46
- statusColorInfo: _light["default"].infoColorL10,
47
- statusColorInfoWeak: _light["default"].infoColor,
48
- statusColorInfoStrong: _light["default"].infoColorL20,
49
- statusColorNormal: _light["default"].successColorL10,
50
- statusColorNormalWeak: _light["default"].successColor,
51
- statusColorNormalStrong: _light["default"].successColorL20,
52
- statusColorLow: _light["default"].warningColorL10,
53
- statusColorLowWeak: _light["default"].warningColor,
54
- statusColorLowStrong: _light["default"].warningColorL20,
55
- statusColorMedium: _light["default"].alertColorL10,
56
- statusColorMediumWeak: _light["default"].alertColor,
57
- statusColorMediumStrong: _light["default"].alertColorL20,
58
- statusColorHigh: _light["default"].errorColorL10,
59
- statusColorHighWeak: _light["default"].errorColor,
60
- statusColorHighStrong: _light["default"].errorColorL20,
61
- statusColorCritical: _light["default"].errorColorD20,
62
- statusColorCriticalWeak: _light["default"].errorColorD30,
63
- statusColorCriticalStrong: _light["default"].errorColorD10
31
+ statusColorInfo: _light["default"].infoColor,
32
+ statusColorInfoWeak: _light["default"].infoColorD10,
33
+ statusColorInfoStrong: _light["default"].infoColorL10,
34
+ statusColorNormal: _light["default"].successColor,
35
+ statusColorNormalWeak: _light["default"].successColorD10,
36
+ statusColorNormalStrong: _light["default"].successColorL10,
37
+ statusColorLow: _light["default"].warningColor,
38
+ statusColorLowWeak: _light["default"].warningColorD10,
39
+ statusColorLowStrong: _light["default"].warningColorL10,
40
+ statusColorMedium: _light["default"].alertColor,
41
+ statusColorMediumWeak: _light["default"].alertColorD10,
42
+ statusColorMediumStrong: _light["default"].alertColorL10,
43
+ statusColorHigh: _light["default"].errorColor,
44
+ statusColorHighWeak: _light["default"].errorColorD10,
45
+ statusColorHighStrong: _light["default"].errorColorL10,
46
+ statusColorCritical: _light["default"].errorColorD10,
47
+ statusColorCriticalWeak: _light["default"].errorColorD20,
48
+ statusColorCriticalStrong: _light["default"].errorColor
64
49
  };
50
+
65
51
  /**
66
52
  * ## Syntax colors
67
53
  * Syntax colors are used only for code blocks.
68
54
  *
69
55
  * @colorSet verbose alphabetical
70
56
  */
71
-
72
57
  var syntaxColors = {
73
58
  syntaxBlue: '#6cd0f0',
74
59
  syntaxBrown: '#fccf87',
@@ -80,20 +65,170 @@ var syntaxColors = {
80
65
  syntaxRed: '#fa94aa',
81
66
  syntaxTeal: '#45d4ba'
82
67
  };
68
+
69
+ /**
70
+ * ## Content colors
71
+ * Content colors should be used for text, icons and dividers.
72
+ *
73
+ * @colorSet verbose
74
+ */
75
+ var contentColors = {
76
+ contentBackgroundColorNegativeWeak: 'rgba(160, 29, 38, 0.28)',
77
+ contentColorActive: _light["default"].white,
78
+ contentColorDefault: _light["default"].gray92,
79
+ contentColorDisabled: _light["default"].gray45,
80
+ contentColorInverted: _light["default"].black,
81
+ contentColorMuted: _light["default"].gray60,
82
+ contentColorAccent: '#20ac33',
83
+ contentColorAccentStrong: '#a4e9ae',
84
+ contentColorAccentWeak: '#0b4613',
85
+ contentColorInfo: '#66a7c4',
86
+ contentColorNegative: '#e37267',
87
+ contentColorNegativeStrong: '#ffa69e',
88
+ contentColorNegativeWeak: '#562a25',
89
+ contentColorPositive: '#7ecd7e',
90
+ contentColorWarning: '#f8be34',
91
+ contentColorLink: _light["default"].accentColorL10
92
+ };
93
+
94
+ /**
95
+ * ## Action colors
96
+ * Action colors should be used for buttons.
97
+ *
98
+ * @colorSet verbose
99
+ */
100
+
101
+ var actionColors = {
102
+ actionColorBackgroundPrimary: '#1a8929',
103
+ actionColorBackgroundPrimaryActive: '#6eba78',
104
+ actionColorBackgroundPrimaryDisabled: '#163b1b',
105
+ actionColorBackgroundPrimaryHover: '#6eba78',
106
+ actionColorBackgroundSecondary: 'transparent',
107
+ actionColorBackgroundSecondaryActive: '#424a52',
108
+ actionColorBackgroundSecondaryDisabled: 'transparent',
109
+ actionColorBackgroundSecondaryHover: '#424a52',
110
+ actionColorBackgroundSubtle: 'transparent',
111
+ actionColorBackgroundSubtleActive: '#214526',
112
+ actionColorBackgroundSubtleDisabled: 'transparent',
113
+ actionColorBackgroundSubtleHover: '#214526',
114
+ actionColorBackgroundDestructive: '#dc4e41',
115
+ actionColorBackgroundDestructiveActive: '#ff776b',
116
+ actionColorBackgroundDestructiveDisabled: '#3b1a16',
117
+ actionColorBackgroundDestructiveHover: '#ff776b',
118
+ actionColorBackgroundDestructiveSecondary: 'transparent',
119
+ actionColorBackgroundDestructiveSecondaryActive: '#47221f',
120
+ actionColorBackgroundDestructiveSecondaryDisabled: 'transparent',
121
+ actionColorBackgroundDestructiveSecondaryHover: '#47221f',
122
+ actionColorBorderSecondary: '#5c6773',
123
+ actionColorBorderSecondaryActive: '#778492',
124
+ actionColorBorderSecondaryDisabled: '#24292d',
125
+ actionColorBorderSecondaryHover: '#778492',
126
+ actionColorBorderDestructiveSecondary: '#ff776b',
127
+ actionColorBorderDestructiveSecondaryActive: '#ff8a80',
128
+ actionColorBorderDestructiveSecondaryDisabled: '#562a25',
129
+ actionColorBorderDestructiveSecondaryHover: '#ff8a80'
130
+ };
131
+
83
132
  /**
84
- * ## Interactive borders
133
+ * ## Interactive colors
134
+ * Interactive colors are specifically chosen for borders and backgrounds of controls and other interactive content.
85
135
  *
86
- * @borderSet
136
+ * @colorSet verbose
87
137
  */
138
+ var interactiveColors = {
139
+ interactiveColorPrimary: _light["default"].brandColor,
140
+ interactiveColorBorder: _light["default"].gray60,
141
+ interactiveColorBorderActive: _light["default"].gray60,
142
+ interactiveColorBorderHover: 'rgba(255, 255, 255, 0.7)',
143
+ interactiveColorBorderDisabled: _light["default"].gray45,
144
+ interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)',
145
+ interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)',
146
+ interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.2)',
147
+ interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)',
148
+ interactiveColorBackground: _light["default"].gray20,
149
+ interactiveColorBackgroundDisabled: _light["default"].gray22,
150
+ interactiveColorAccent: '#1A8929',
151
+ interactiveColorAccentError: _light["default"].errorColorL10,
152
+ interactiveColorAccentErrorStrong: '#f1b9b3'
153
+ };
88
154
 
89
- var bordersInteractive = {
90
- activeBorder: "".concat(dark.borderActiveColor, " double")
155
+ /**
156
+ * ## Neutral colors
157
+ * Neutrals are used for dividers and as backup colors that can sparingly be used for cases, when the other defined colors are not enough.
158
+ *
159
+ * @colorSet verbose
160
+ */
161
+
162
+ var neutralColors = {
163
+ white: '#ffffff',
164
+ neutral100: _light["default"].gray25,
165
+ neutral200: _light["default"].gray30,
166
+ neutral300: _light["default"].gray45,
167
+ neutral400: _light["default"].gray60,
168
+ neutral500: _light["default"].gray80,
169
+ black: '#000000',
170
+ transparent: 'transparent'
91
171
  };
92
172
 
93
- var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _light["default"]), dark), statusColors), syntaxColors), bordersInteractive), {}, {
94
- borderLightColor: _light["default"].gray60 // @deprecated, SUI-5981
173
+ /**
174
+ * ## Background colors
175
+ * Background colors should be used only for backgrounds of higher level sections & containers of a UI.
176
+ *
177
+ * @colorSet verbose
178
+ */
179
+ var backgroundColors = {
180
+ backgroundColorDialog: _light["default"].gray20,
181
+ backgroundColorFloating: _light["default"].white,
182
+ backgroundColorNavigation: _light["default"].black,
183
+ backgroundColorPage: _light["default"].gray20,
184
+ backgroundColorPopup: _light["default"].gray22,
185
+ backgroundColorScrim: "rgba(0, 0, 0, 0.8)",
186
+ backgroundColorSection: _light["default"].gray22,
187
+ backgroundColorSidebar: _light["default"].black
188
+ };
95
189
 
96
- });
190
+ /**
191
+ * ## Backgrounds
192
+ *
193
+ * @colorSet verbose
194
+ */
195
+ var backgrounds = {
196
+ draggableBackground: "url('data:image/png;base64,".concat(dragHandleDark, "') 0 0 / 8px 8px repeat")
197
+ };
97
198
 
199
+ /**
200
+ * ## Interactive state shadows
201
+ *
202
+ * @shadowSet
203
+ */
204
+ var shadows = {
205
+ focusShadow: "0 0 0 2px ".concat(backgroundColors.backgroundColorPage, ", 0 0 0 5px ").concat(_light["default"].focusColor),
206
+ focusShadowInset: "inset 0 0 0 3px ".concat(_light["default"].focusColor),
207
+ embossShadow: '0px 1px 5px rgba(0, 0, 0, 0.35), 0px 0px 1px rgba(0, 0, 0, 0.35)',
208
+ overlayShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)',
209
+ dragShadow: '0px 26px 103px rgba(0, 0, 0, 0.64), 0px 11px 18px rgba(0, 0, 0, 0.32), 0px 3px 6px rgba(0, 0, 0, 0.3)',
210
+ modalShadow: '0px 50px 200px #000000, 0px 29px 66px rgba(0, 0, 0, 0.41), 0px 14px 47px rgba(0, 0, 0, 0.17), 0px 5px 10px rgba(0, 0, 0, 0.15)'
211
+ };
212
+ var deprecated = {
213
+ backgroundColor: _light["default"].gray20,
214
+ // @deprecated SUI-6656
215
+ borderLightColor: _light["default"].gray60,
216
+ // @deprecated, SUI-5981
217
+ // @deprecated, SUI-6160
218
+ textColor: _light["default"].white,
219
+ textGray: _light["default"].gray92,
220
+ textDisabledColor: _light["default"].gray45,
221
+ // deprecated
222
+ accentColorPositive: _light["default"].successColor,
223
+ accentColorWarning: _light["default"].warningColor,
224
+ accentColorAlert: _light["default"].alertColor,
225
+ accentColorNegative: _light["default"].errorColor,
226
+ linkColor: _light["default"].accentColorL10,
227
+ linkColorHover: _light["default"].accentColorL20,
228
+ border: "1px solid ".concat(_light["default"].gray22),
229
+ borderDark: "1px solid ".concat(_light["default"].black),
230
+ borderLight: "1px solid ".concat(_light["default"].gray60)
231
+ };
232
+ var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, _light["default"]), dark), actionColors), statusColors), backgroundColors), neutralColors), syntaxColors), contentColors), shadows), interactiveColors), deprecated), backgrounds);
98
233
  var _default = theme;
99
234
  exports["default"] = _default;