@splunk/themes 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -30
- package/SplunkThemeProvider.js +3 -4
- package/design-tokens/typography.js +33 -1
- package/enterprise/dark.js +2 -2
- package/enterprise/light.js +14 -8
- package/mixins/index.js +13 -3
- package/mixins/resets.js +96 -0
- package/mixins/typography.js +9 -9
- package/mixins/utilityMixins.js +42 -51
- package/package.json +9 -9
- package/prisma/base.js +8 -1
- package/prisma/dark.js +2 -2
- package/prisma/light.js +11 -11
- package/splunk-magnetic/index.js +17 -1
- package/splunk-magnetic/magneticTokensCore.js +390 -0
- package/splunk-magnetic/magneticTokensDark.js +4 -0
- package/splunk-magnetic/magneticTokensLight.js +4 -0
- package/storybook-addon-splunk-themes/SplunkThemesTool.js +12 -3
- package/storybook-addon-splunk-themes/constants.js +3 -1
- package/storybook-addon-splunk-themes/withSplunkTheme.js +2 -3
- package/types/design-tokens/index.d.ts +7 -0
- package/types/design-tokens/typography.d.ts +58 -0
- package/types/enterprise/dark.d.ts +7 -0
- package/types/enterprise/light.d.ts +7 -0
- package/types/mixins/index.d.ts +4 -1
- package/types/mixins/resets.d.ts +47 -0
- package/types/mixins/tests/resets.unit.d.ts +1 -0
- package/types/mixins/utilityMixins.d.ts +25 -23
- package/types/prisma/base.d.ts +7 -0
- package/types/splunk-magnetic/index.d.ts +132 -90
- package/types/splunk-magnetic/magneticTokensCore.d.ts +384 -0
- package/types/storybook-addon-splunk-themes/constants.d.ts +1 -0
- package/useSplunkTheme.js +2 -2
- package/withSplunkTheme.js +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,46 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
-
1.0
|
|
4
|
+
1.2.0 - August 5, 2025
|
|
5
5
|
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* New `lineHeight*` variables (SUI-7993).
|
|
8
|
+
|
|
6
9
|
Bug fixes:
|
|
7
|
-
*
|
|
10
|
+
* Updated `skipLink` mixin to override `min-width` and `min-height` properties.
|
|
11
|
+
|
|
12
|
+
1.1.0 - July 2, 2025
|
|
13
|
+
----------
|
|
14
|
+
New Features:
|
|
15
|
+
* `@splunk/themes/storybook-addon-splunk-themes` now supports disabling 'both' option via `disableDualTheme` story param (SUI-7702).
|
|
16
|
+
* Added `pageBase` mixin for `html` and `body` base styling (SUI-7665).
|
|
17
|
+
* New `skipLink` mixin (SUI-7854)
|
|
18
|
+
|
|
19
|
+
Bug Fixes:
|
|
20
|
+
* Updated Prisma and Magnetic light syntax token values to maintain 4.5:1 contrast with line highlight (SUI-6644).
|
|
21
|
+
* Tokens updated: `syntaxBlue`, `syntaxBrown`, `syntaxGray`, `syntaxGreen`, `syntaxHighlight`, `syntaxOrange`, `syntaxPink`, `syntaxPurple`, `syntaxRed`, and `syntaxTeal`.
|
|
22
|
+
* Updated `actionColorBackgroundSecondaryActive` token values in Enterprise and Prisma themes to fix visual regression in `Radio Bar` (SUI-7864).
|
|
23
|
+
* Updated `interactiveColorOverlayActive` token values in Prisma and Enterprise themes to match `actionColorBackgroundSecondaryActive` values for consistent active overlay states (SUI-7864).
|
|
24
|
+
* Updated enterprise theme light mode neutral color tokens `neutral300`, `neutral400`, and `neutral500` to fix lightness steps from previous changes. (SUI-7879)
|
|
25
|
+
* Added neutral tokens (`neutral50`, `neutral100`, `neutral200`, `neutral300`, `neutral400`, `neutral500`) to Magnetic theme customizer with light and dark color scheme support, matching Enterprise and Prisma theme. (SUI-7879)
|
|
26
|
+
|
|
27
|
+
1.0.1 - June 5, 2025
|
|
28
|
+
----------
|
|
29
|
+
Bug Fixes:
|
|
30
|
+
* Corrected `@types/react` peer dependency to allow `@types/react` `16` or `17` (SUI-7838).
|
|
8
31
|
|
|
9
32
|
1.0.0 - June 3, 2025
|
|
10
33
|
----------
|
|
11
34
|
* Includes all changes from `1.0.0-beta` and `1.0.0-rc` releases.
|
|
12
35
|
|
|
13
|
-
Bug
|
|
36
|
+
Bug Fixes:
|
|
14
37
|
* Color variables `backgroundColorPage`, `backgroundColorNavigation`,`backgroundColorSideBar`,`neutral50`,`neutral100` and `neutral200` in Enterprise light have been updated to align better with Prisma themes (SUI-7584).
|
|
15
38
|
* `@types/react` peer dependency now includes `^16 | ^17` and no longer blocks installation using `npm` in React 16 or 17 environments (SUI-7838).
|
|
16
39
|
* Color variables for `actionColorBorderSecondary*`, `actionColorBackgroundSecondary*`, and `interactiveColorBorderDisabled` have been updated to align with both Prisma and Enterprise themes (SUI-7839).
|
|
17
40
|
|
|
18
41
|
1.0.0-rc.2 - May 28, 2025
|
|
19
42
|
----------
|
|
20
|
-
* Release candidate 2
|
|
43
|
+
* Release candidate 2.
|
|
21
44
|
|
|
22
45
|
1.0.0-rc.1 - May 14, 2025
|
|
23
46
|
----------
|
|
@@ -35,20 +58,20 @@ New Features:
|
|
|
35
58
|
New Features:
|
|
36
59
|
* New `inputBorderWidth` variable (SUI-7384).
|
|
37
60
|
|
|
38
|
-
Bug Fixes:
|
|
39
|
-
* Fixes broken CSS for Splunk Magnetic's `backgroundColorNavigation` override (SUI-7653).
|
|
40
|
-
|
|
41
|
-
Deprecations:
|
|
42
|
-
* `statusColor*`s have been deprecated. Instead use the appropriate `notificationColor*` or `severityColor*`(SUI-7303)
|
|
43
|
-
|
|
44
61
|
API Changes:
|
|
45
62
|
* `typescript` version is now `^5.8.3` (SUI-7601).
|
|
46
63
|
* `borderActiveColor` has been deprecated. (SUI-7633).
|
|
47
|
-
|
|
64
|
+
* Use `interactiveColorBorderActive` for Data Entry components or `actionColorBorderSecondaryActive` for Buttons.
|
|
48
65
|
* `backgroundColorHover` have been deprecated. (SUI-7633).
|
|
49
|
-
|
|
66
|
+
* Use `interactiveColorOverlayHover` for Data Entry components or `actionColorBackgroundSecondaryHover` for Buttons.
|
|
50
67
|
* `hoverShadow` has been deprecated. See notes on `backgroundColorHover` for hover affordances. (SUI-7621)
|
|
51
68
|
|
|
69
|
+
Bug Fixes:
|
|
70
|
+
* Fixes broken CSS for Splunk Magnetic's `backgroundColorNavigation` override (SUI-7653).
|
|
71
|
+
|
|
72
|
+
Deprecations:
|
|
73
|
+
* `statusColor*`s have been deprecated. Instead use the appropriate `notificationColor*` or `severityColor*`(SUI-7303).
|
|
74
|
+
|
|
52
75
|
1.0.0-beta.3 - April 2, 2025
|
|
53
76
|
----------
|
|
54
77
|
New Features:
|
|
@@ -69,15 +92,15 @@ New Features:
|
|
|
69
92
|
* New `contentColorLink` variable (SUI-3568).
|
|
70
93
|
* The data-viz variables are supported in all themes (SUI-3568).
|
|
71
94
|
|
|
72
|
-
Deprecations:
|
|
73
|
-
* `linkColor` and `linkColorHover` have been deprecated. Instead use `contentColorLink` (SUI-3568).
|
|
74
|
-
|
|
75
95
|
API Changes:
|
|
76
96
|
* `accentColor` variable has been removed from Prisma themes (SUI-3568).
|
|
77
97
|
* `borderColor`, `borderColorStrong`, and `borderColorWeak` have had alpha removed from their values (SUI-7340).
|
|
78
98
|
* `embossShadow`, `overlayShadow`, `dragShadow`, and `modalShadow` variables have been updated in Enterprise themes to match Prisma (SUI-7334).
|
|
79
99
|
* Enterprise only tokens have been deprecated: `brandColor*`, `gray*`, `accentColor*`, `errorColor*`, `alertColor*`, `warningColor*`, `successColor*`, `infoColor*`, `diverging*Color*`, and `cat*Color*`.
|
|
80
100
|
|
|
101
|
+
Deprecations:
|
|
102
|
+
* `linkColor` and `linkColorHover` have been deprecated. Instead use `contentColorLink` (SUI-3568).
|
|
103
|
+
|
|
81
104
|
1.0.0-beta.1 - February 20, 2025
|
|
82
105
|
----------
|
|
83
106
|
New Features:
|
|
@@ -98,19 +121,14 @@ New Features:
|
|
|
98
121
|
* New `layout` mixin (SUI-6678).
|
|
99
122
|
* Enterprise themes now support color variable `backgroundColorSidebar` (SUI-7102).
|
|
100
123
|
|
|
101
|
-
Deprecations:
|
|
102
|
-
* Enterprise theme tokens `textColor`, `textGray`, and `textDisabledColor` have been deprecated (SUI-6160).
|
|
103
|
-
* Enterprise theme token `backgroundColor` has been deprecated (SUI-6656).
|
|
104
|
-
* `accentColorPositive`, `accentColorWarning`, `accentColorAlert`, and `accentColorNegative` have been deprecated (SUI-3658).
|
|
105
|
-
|
|
106
124
|
API Changes:
|
|
107
125
|
* `react` and `react-dom` peer dependencies are now `"^16.8.0 || ^17.0.0 || ^18.0.0"`.
|
|
108
126
|
* `px` sizing for `variables.fontSize*` and `mixins.typography` have been replaced with `rem` sizing (SUI-5509).
|
|
109
|
-
|
|
127
|
+
* This results in minor differences in text sizing; but is required to meet WCAG 1.4.4 and WCAG 1.4.10.
|
|
110
128
|
* `typography` `size` param no longer supports `56` `36` `32` and `10`.
|
|
111
129
|
* `variables.lineHeight` is no longer defined in `px` to improve readability of font at all scales (SUI-5509).
|
|
112
130
|
* `typography`'s mixin for `Title5`'s has been updated to text color `variables.contentColorActive` in Prisma theme (SUI-5685).
|
|
113
|
-
|
|
131
|
+
* This change affects `Heading` and `Typography` components.
|
|
114
132
|
* The font size and line height no longer change with density. The default font-size in Enterprise Compact now is 14px (SUI-5508).
|
|
115
133
|
* `typography`'s `line-height`, `size`, and `font-weight` values have been consolidated between Enterprise and Prisma themes (SUI-5684).
|
|
116
134
|
* `typography`'s `withReset` prop has been removed (SUI-5686).
|
|
@@ -128,6 +146,11 @@ API Changes:
|
|
|
128
146
|
* `fontSizeXLarge` size has been changed (SUI-6593).
|
|
129
147
|
* Enterprise themes support the `contentColorActive`, `contentColorDefault`, `contentColorDisabled`, `contentColorInverted`, and `contentColorMuted` tokens (SUI-6160).
|
|
130
148
|
|
|
149
|
+
Deprecations:
|
|
150
|
+
* Enterprise theme tokens `textColor`, `textGray`, and `textDisabledColor` have been deprecated (SUI-6160).
|
|
151
|
+
* Enterprise theme token `backgroundColor` has been deprecated (SUI-6656).
|
|
152
|
+
* `accentColorPositive`, `accentColorWarning`, `accentColorAlert`, and `accentColorNegative` have been deprecated (SUI-3658).
|
|
153
|
+
|
|
131
154
|
0.24.0 - May 6, 2025
|
|
132
155
|
----------
|
|
133
156
|
Bug Fixes:
|
|
@@ -167,9 +190,9 @@ API Changes:
|
|
|
167
190
|
New Features:
|
|
168
191
|
|
|
169
192
|
* All themes now support color variables for decorative borders:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
193
|
+
* `borderColorStrong` and `borderColorWeak` added to all themes
|
|
194
|
+
* `borderColor` now also available in Prisma themes
|
|
195
|
+
* Note: Use `interactiveColorBorder` when creating a border for an interactive control
|
|
173
196
|
|
|
174
197
|
Bug Fixes:
|
|
175
198
|
* Enterprise light theme `interactiveColorBorder` value has been updated to meet contrast requirements.
|
|
@@ -184,7 +207,7 @@ API Changes:
|
|
|
184
207
|
New Features:
|
|
185
208
|
* Added new variable `activeBorder`.
|
|
186
209
|
|
|
187
|
-
0.16.4 -
|
|
210
|
+
0.16.4 - December 5, 2023
|
|
188
211
|
----------
|
|
189
212
|
Bug Fixes:
|
|
190
213
|
* `syntaxColors` have been updated to meet A11y_WCAG 1.4.3 contrast requirements for prisma and enterprise themes (SUI-5750).
|
|
@@ -212,12 +235,12 @@ API Changes:
|
|
|
212
235
|
|
|
213
236
|
0.16.0 - April 6, 2023
|
|
214
237
|
----------
|
|
215
|
-
New Features:
|
|
216
|
-
* Added variables for supported font weights; the `typography` mixin's `weight` param supports these as keyword values (SUI-5344).
|
|
217
|
-
|
|
218
238
|
Breaking Changes:
|
|
219
239
|
* `typography` mixin's `weight` param now only accepts keyword values. Number values have been removed (SUI-5344).
|
|
220
240
|
|
|
241
|
+
New Features:
|
|
242
|
+
* Added variables for supported font weights; the `typography` mixin's `weight` param supports these as keyword values (SUI-5344).
|
|
243
|
+
|
|
221
244
|
Bug Fixes:
|
|
222
245
|
* `typography` mixin properly applies correct CSS for `weight` params (SUI-5344).
|
|
223
246
|
|
|
@@ -406,4 +429,4 @@ Notes:
|
|
|
406
429
|
|
|
407
430
|
0.2.0 - June 30, 2018
|
|
408
431
|
----------
|
|
409
|
-
* Initial Release
|
|
432
|
+
* Initial Release.
|
package/SplunkThemeProvider.js
CHANGED
|
@@ -7,16 +7,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = SplunkThemeProvider;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _styledComponents = require("styled-components");
|
|
10
|
-
function
|
|
11
|
-
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; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) { "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); } return f; })(e, t); }
|
|
12
11
|
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); }
|
|
13
12
|
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; }
|
|
14
13
|
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; }
|
|
15
14
|
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; }
|
|
16
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
16
|
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
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
19
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
17
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
20
19
|
/** SplunkThemeProvider defaults to `prisma` `dark` `compact`, unless the properties have already been set.
|
|
21
20
|
*
|
|
22
21
|
* For example, here the nested `SplunkThemeProvider` defaults to `enterprise` `light`:
|
|
@@ -64,7 +64,39 @@ var fontMeasures = {
|
|
|
64
64
|
* in blocks of text by preventing overly long lines.
|
|
65
65
|
*/
|
|
66
66
|
lineLength: '',
|
|
67
|
-
|
|
67
|
+
/**
|
|
68
|
+
* Default line height.
|
|
69
|
+
*/
|
|
70
|
+
lineHeight: '',
|
|
71
|
+
/**
|
|
72
|
+
* Very tight. Use where space is extremely limited and text is not expected to wrap.
|
|
73
|
+
* Ideal for buttons, badges, input fields, and compact labels.
|
|
74
|
+
*/
|
|
75
|
+
lineHeightSingle: '',
|
|
76
|
+
/**
|
|
77
|
+
* Slightly more space than single, still compact
|
|
78
|
+
*/
|
|
79
|
+
lineHeightTight: '',
|
|
80
|
+
/**
|
|
81
|
+
* Compact but a bit more readable
|
|
82
|
+
*/
|
|
83
|
+
lineHeightSnug: '',
|
|
84
|
+
/**
|
|
85
|
+
* Balanced spacing for smaller text
|
|
86
|
+
*/
|
|
87
|
+
lineHeightComfortable: '',
|
|
88
|
+
/**
|
|
89
|
+
* Slightly looser for better readability
|
|
90
|
+
*/
|
|
91
|
+
lineHeightRelaxed: '',
|
|
92
|
+
/*
|
|
93
|
+
* Ideal for larger text like headings
|
|
94
|
+
*/
|
|
95
|
+
lineHeightSpacious: '',
|
|
96
|
+
/**
|
|
97
|
+
* Default for body text; comfortable, standard line height same as `lineHeight`
|
|
98
|
+
*/
|
|
99
|
+
lineHeightNormal: ''
|
|
68
100
|
};
|
|
69
101
|
var typography = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontFamily), fontWeight), fontSize), fontMeasures);
|
|
70
102
|
var _default = typography;
|
package/enterprise/dark.js
CHANGED
|
@@ -77,7 +77,7 @@ var actionColors = {
|
|
|
77
77
|
actionColorBackgroundPrimaryDisabled: '#163b1b',
|
|
78
78
|
actionColorBackgroundPrimaryHover: '#6eba78',
|
|
79
79
|
actionColorBackgroundSecondary: 'transparent',
|
|
80
|
-
actionColorBackgroundSecondaryActive: 'rgba(
|
|
80
|
+
actionColorBackgroundSecondaryActive: 'rgba(225, 225, 225, 0.16)',
|
|
81
81
|
actionColorBackgroundSecondaryDisabled: 'transparent',
|
|
82
82
|
actionColorBackgroundSecondaryHover: 'rgba(255, 255, 255, 0.05)',
|
|
83
83
|
actionColorBackgroundSubtle: 'transparent',
|
|
@@ -108,7 +108,7 @@ var interactiveColors = {
|
|
|
108
108
|
interactiveColorBorderDisabled: 'rgba(255, 255, 255, 0.3)',
|
|
109
109
|
interactiveColorOverlaySelected: 'rgba(255, 255, 255, 0.1)',
|
|
110
110
|
interactiveColorOverlayHover: 'rgba(255, 255, 255, 0.05)',
|
|
111
|
-
interactiveColorOverlayActive: 'rgba(
|
|
111
|
+
interactiveColorOverlayActive: 'rgba(225, 225, 225, 0.16)',
|
|
112
112
|
interactiveColorOverlayDrag: 'rgba(57, 147, 255, 0.16)',
|
|
113
113
|
interactiveColorBackground: 'transparent',
|
|
114
114
|
interactiveColorBackgroundDisabled: 'transparent',
|
package/enterprise/light.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
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
|
-
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
|
8
8
|
var _dataViz = _interopRequireDefault(require("./dataViz"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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
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; }
|
|
12
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; }
|
|
13
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; }
|
|
@@ -52,9 +51,9 @@ var neutralColors = {
|
|
|
52
51
|
neutral50: '#e8ebee',
|
|
53
52
|
neutral100: '#e1e5ea',
|
|
54
53
|
neutral200: '#dae0e7',
|
|
55
|
-
neutral300:
|
|
56
|
-
neutral400:
|
|
57
|
-
neutral500:
|
|
54
|
+
neutral300: '#d5dbe2',
|
|
55
|
+
neutral400: '#c9d1da',
|
|
56
|
+
neutral500: '#bbc4ce',
|
|
58
57
|
black: '#000000',
|
|
59
58
|
transparent: 'transparent'
|
|
60
59
|
};
|
|
@@ -143,7 +142,7 @@ var actionColors = {
|
|
|
143
142
|
actionColorBackgroundPrimaryDisabled: '#98d798',
|
|
144
143
|
actionColorBackgroundPrimaryHover: '#125e1c',
|
|
145
144
|
actionColorBackgroundSecondary: 'transparent',
|
|
146
|
-
actionColorBackgroundSecondaryActive: 'rgba(0, 0, 0, 0.
|
|
145
|
+
actionColorBackgroundSecondaryActive: 'rgba(0, 0, 0, 0.12)',
|
|
147
146
|
actionColorBackgroundSecondaryDisabled: 'transparent',
|
|
148
147
|
actionColorBackgroundSecondaryHover: 'rgba(0, 0, 0, 0.03)',
|
|
149
148
|
actionColorBackgroundSubtle: 'transparent',
|
|
@@ -174,7 +173,7 @@ var interactiveColors = {
|
|
|
174
173
|
interactiveColorBorderDisabled: 'rgba(0, 0, 0, 0.3)',
|
|
175
174
|
interactiveColorOverlaySelected: 'rgba(0, 0, 0, 0.04)',
|
|
176
175
|
interactiveColorOverlayHover: 'rgba(0, 0, 0, 0.03)',
|
|
177
|
-
interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.
|
|
176
|
+
interactiveColorOverlayActive: 'rgba(0, 0, 0, 0.12)',
|
|
178
177
|
interactiveColorOverlayDrag: 'rgba(2, 100, 215, 0.16)',
|
|
179
178
|
interactiveColorBackground: 'transparent',
|
|
180
179
|
interactiveColorBackgroundDisabled: 'transparent',
|
|
@@ -204,8 +203,15 @@ var typography = {
|
|
|
204
203
|
fontWeightBold: 700,
|
|
205
204
|
fontWeightHeavy: 800,
|
|
206
205
|
fontWeightExtraBold: 900,
|
|
206
|
+
lineLength: '80ch',
|
|
207
207
|
lineHeight: '1.5',
|
|
208
|
-
|
|
208
|
+
lineHeightSingle: '1',
|
|
209
|
+
lineHeightTight: '1.2',
|
|
210
|
+
lineHeightSnug: '1.25',
|
|
211
|
+
lineHeightComfortable: '1.333',
|
|
212
|
+
lineHeightRelaxed: '1.375',
|
|
213
|
+
lineHeightSpacious: '1.429',
|
|
214
|
+
lineHeightNormal: '1.5'
|
|
209
215
|
};
|
|
210
216
|
var zindexes = {
|
|
211
217
|
zindexLayer: 1000,
|
package/mixins/index.js
CHANGED
|
@@ -49,6 +49,17 @@ Object.keys(_prose).forEach(function (key) {
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
|
+
var _resets = _interopRequireWildcard(require("./resets"));
|
|
53
|
+
Object.keys(_resets).forEach(function (key) {
|
|
54
|
+
if (key === "default" || key === "__esModule") return;
|
|
55
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
56
|
+
Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function get() {
|
|
59
|
+
return _resets[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
52
63
|
var _typography = _interopRequireWildcard(require("./typography"));
|
|
53
64
|
Object.keys(_typography).forEach(function (key) {
|
|
54
65
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -71,15 +82,14 @@ Object.keys(_utilityMixins).forEach(function (key) {
|
|
|
71
82
|
}
|
|
72
83
|
});
|
|
73
84
|
});
|
|
74
|
-
function
|
|
75
|
-
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; }
|
|
85
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) { "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); } return f; })(e, t); }
|
|
76
86
|
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); }
|
|
77
87
|
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; }
|
|
78
88
|
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; }
|
|
79
89
|
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; }
|
|
80
90
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
81
91
|
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); }
|
|
82
|
-
var _default = _objectSpread(_objectSpread({}, _utilityMixins["default"]), {}, {
|
|
92
|
+
var _default = _objectSpread(_objectSpread(_objectSpread({}, _resets["default"]), _utilityMixins["default"]), {}, {
|
|
83
93
|
layout: _layout["default"],
|
|
84
94
|
prose: _prose["default"],
|
|
85
95
|
typography: _typography["default"]
|
package/mixins/resets.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.reset = exports.pageBase = void 0;
|
|
7
|
+
var _styledComponents = require("styled-components");
|
|
8
|
+
var _pick = _interopRequireDefault(require("../pick"));
|
|
9
|
+
var _variables = _interopRequireDefault(require("../variables"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _templateObject2() {
|
|
12
|
+
var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n color-scheme: ", ";\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n ", "\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]);
|
|
13
|
+
_templateObject2 = function _templateObject2() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _templateObject() {
|
|
19
|
+
var data = _taggedTemplateLiteral(["\n background-color: ", ";\n box-sizing: border-box;\n color: ", ";\n color-scheme: ", ";\n font-family: ", ";\n margin: 0;\n "]);
|
|
20
|
+
_templateObject = function _templateObject() {
|
|
21
|
+
return data;
|
|
22
|
+
};
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
26
|
+
/**
|
|
27
|
+
* The `pageBase` mixin provides essential base styling, intended for `html` and `body` elements.
|
|
28
|
+
* This should be used in global styles to establish consistent foundational styles
|
|
29
|
+
* including theme colors, typography, and layout basics.
|
|
30
|
+
*
|
|
31
|
+
* ##### Example
|
|
32
|
+
* ```js
|
|
33
|
+
* import styled from 'styled-components';
|
|
34
|
+
* import { pageBase } from '@splunk/themes/mixins';
|
|
35
|
+
*
|
|
36
|
+
* const GlobalStyle = createGlobalStyle`
|
|
37
|
+
* html,
|
|
38
|
+
* body {
|
|
39
|
+
* ${pageBase()}
|
|
40
|
+
* }
|
|
41
|
+
* `
|
|
42
|
+
* ```
|
|
43
|
+
* @name pageBase
|
|
44
|
+
* @kind function
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
var pageBase = function pageBase() {
|
|
49
|
+
return function () {
|
|
50
|
+
return (0, _styledComponents.css)(_templateObject(), _variables["default"].backgroundColorPage, _variables["default"].contentColorDefault, (0, _pick["default"])({
|
|
51
|
+
dark: 'dark',
|
|
52
|
+
light: 'light'
|
|
53
|
+
}), _variables["default"].fontFamily);
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The `reset` mixin resets css properties to their browser defaults, plus many to
|
|
59
|
+
* theme-specific values. This ensures an element is not inheriting inappropriate styles.
|
|
60
|
+
*
|
|
61
|
+
* ##### Example
|
|
62
|
+
* ```js
|
|
63
|
+
* import styled from 'styled-components';
|
|
64
|
+
* import { reset } from '@splunk/themes/mixins';
|
|
65
|
+
*
|
|
66
|
+
* const myBlock = styled.div`
|
|
67
|
+
* ${reset('block')};
|
|
68
|
+
* `
|
|
69
|
+
* ```
|
|
70
|
+
* @name reset
|
|
71
|
+
* @kind function
|
|
72
|
+
* @param {string} [display=inline] Set the `display` property (block, inline-block, …)
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
exports.pageBase = pageBase;
|
|
76
|
+
var reset = function reset() {
|
|
77
|
+
var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline';
|
|
78
|
+
var displayRule = display !== null ? "display: ".concat(display, ";") : '';
|
|
79
|
+
return function () {
|
|
80
|
+
return (0, _styledComponents.css)(_templateObject2(), (0, _pick["default"])({
|
|
81
|
+
/*
|
|
82
|
+
use pick() rather than relying on variables.colorScheme
|
|
83
|
+
because there's no guarantee that variables.colorScheme
|
|
84
|
+
has to match the css color-scheme prop
|
|
85
|
+
*/
|
|
86
|
+
dark: 'dark',
|
|
87
|
+
light: 'light'
|
|
88
|
+
}), _variables["default"].contentColorDefault, displayRule, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor);
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
exports.reset = reset;
|
|
92
|
+
var _default = {
|
|
93
|
+
pageBase: pageBase,
|
|
94
|
+
reset: reset
|
|
95
|
+
};
|
|
96
|
+
exports["default"] = _default;
|
package/mixins/typography.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.typographyVariants = exports["default"] = void 0;
|
|
7
7
|
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
8
8
|
var _styledComponents = require("styled-components");
|
|
9
|
-
var
|
|
9
|
+
var _resets = require("./resets");
|
|
10
10
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
12
|
function _templateObject8() {
|
|
@@ -202,13 +202,13 @@ var fontsizePixelValueToRemMap = {
|
|
|
202
202
|
12: _variables["default"].fontSizeSmall
|
|
203
203
|
};
|
|
204
204
|
var lineHeightVariableToValueMap = {
|
|
205
|
-
single:
|
|
206
|
-
tight:
|
|
207
|
-
snug:
|
|
208
|
-
comfortable:
|
|
209
|
-
relaxed:
|
|
210
|
-
spacious:
|
|
211
|
-
normal:
|
|
205
|
+
single: _variables["default"].lineHeightSingle,
|
|
206
|
+
tight: _variables["default"].lineHeightTight,
|
|
207
|
+
snug: _variables["default"].lineHeightSnug,
|
|
208
|
+
comfortable: _variables["default"].lineHeightComfortable,
|
|
209
|
+
relaxed: _variables["default"].lineHeightRelaxed,
|
|
210
|
+
spacious: _variables["default"].lineHeightSpacious,
|
|
211
|
+
normal: _variables["default"].lineHeightNormal
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
// As defined by [font-weight | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping)
|
|
@@ -292,7 +292,7 @@ function typography(variantOrParams, additionalParams) {
|
|
|
292
292
|
withReset: mergedParams.withReset
|
|
293
293
|
};
|
|
294
294
|
return function () {
|
|
295
|
-
return (0, _styledComponents.css)(_templateObject8(), finalParams.withReset &&
|
|
295
|
+
return (0, _styledComponents.css)(_templateObject8(), finalParams.withReset && (0, _resets.reset)(null), finalParams.color, finalParams.family, finalParams.size, finalParams.weight, finalParams.lineHeight, finalParams.additionalStyles);
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
298
|
var _default = typography;
|
package/mixins/utilityMixins.js
CHANGED
|
@@ -10,64 +10,19 @@ exports.printHide = printHide;
|
|
|
10
10
|
exports.printNoBackground = printNoBackground;
|
|
11
11
|
exports.printWrapAll = printWrapAll;
|
|
12
12
|
exports.screenReaderContent = screenReaderContent;
|
|
13
|
+
exports.skipLink = skipLink;
|
|
13
14
|
exports.overlayColors = overlayColors;
|
|
14
15
|
exports.colorWithAlpha = colorWithAlpha;
|
|
15
|
-
exports["default"] =
|
|
16
|
+
exports["default"] = void 0;
|
|
16
17
|
var _colorBlend = require("color-blend");
|
|
17
|
-
var _styledComponents = require("styled-components");
|
|
18
18
|
var _tinycolor = _interopRequireDefault(require("tinycolor2"));
|
|
19
|
-
var _pick = _interopRequireDefault(require("../pick"));
|
|
20
|
-
var _variables = _interopRequireDefault(require("../variables"));
|
|
21
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
-
function _templateObject() {
|
|
23
|
-
var data = _taggedTemplateLiteral(["\n /* Generic resets */\n animation: none 0s ease 0s 1 normal none running;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n box-shadow: none;\n caption-side: top;\n clear: none;\n clip: auto;\n color-scheme: ", ";\n columns: auto;\n column-count: auto;\n column-fill: balance;\n column-gap: normal;\n column-rule: medium none currentColor;\n column-span: 1;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n empty-cells: show;\n float: none;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n height: auto;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n perspective: none;\n perspective-origin: 50% 50%;\n pointer-events: auto;\n position: static;\n right: auto;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n transform: none;\n transform-origin: 50% 50% 0;\n transform-style: flat;\n transition: none 0s ease 0s;\n user-select: auto;\n vertical-align: baseline;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n /* Splunk-specific resets */\n border-width: 1px;\n box-sizing: border-box;\n color: ", ";\n cursor: inherit;\n ", "\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]);
|
|
24
|
-
_templateObject = function _templateObject() {
|
|
25
|
-
return data;
|
|
26
|
-
};
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
30
20
|
/**
|
|
31
21
|
* @file
|
|
32
22
|
* A collection of style-related helper functions. All of them return a single object containing
|
|
33
23
|
* DOM CSS properties, for example: `{ display: …, fontFamily: … }`.
|
|
34
24
|
*/
|
|
35
25
|
|
|
36
|
-
/**
|
|
37
|
-
* The `reset` mixin resets css properties to their browser defaults, plus many to
|
|
38
|
-
* theme-specific values. This ensures an element is not inheriting inappropriate styles.
|
|
39
|
-
*
|
|
40
|
-
* ##### Example
|
|
41
|
-
* ```js
|
|
42
|
-
* import styled from 'styled-components';
|
|
43
|
-
* import { reset } from '@splunk/themes/mixins';
|
|
44
|
-
*
|
|
45
|
-
* const myBlock = styled.div`
|
|
46
|
-
* ${reset('block')};
|
|
47
|
-
* `
|
|
48
|
-
* ```
|
|
49
|
-
* @name reset
|
|
50
|
-
* @kind function
|
|
51
|
-
* @param {string} [display=inline] Set the `display` property (block, inline-block, …)
|
|
52
|
-
* @public
|
|
53
|
-
*/
|
|
54
|
-
|
|
55
|
-
var reset = function reset() {
|
|
56
|
-
var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline';
|
|
57
|
-
var displayRule = display !== null ? "display: ".concat(display, ";") : '';
|
|
58
|
-
return function () {
|
|
59
|
-
return (0, _styledComponents.css)(_templateObject(), (0, _pick["default"])({
|
|
60
|
-
/*
|
|
61
|
-
use pick() rather than relying on variables.colorScheme
|
|
62
|
-
because there's no guarantee that variables.colorScheme
|
|
63
|
-
has to match the css color-scheme prop
|
|
64
|
-
*/
|
|
65
|
-
dark: 'dark',
|
|
66
|
-
light: 'light'
|
|
67
|
-
}), _variables["default"].contentColorDefault, displayRule, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor);
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
|
|
71
26
|
/**
|
|
72
27
|
* `clearfix` is used on a container to ensure its height is at least as tall as any floating
|
|
73
28
|
* children.
|
|
@@ -83,7 +38,6 @@ var reset = function reset() {
|
|
|
83
38
|
* ```
|
|
84
39
|
* @public
|
|
85
40
|
*/
|
|
86
|
-
exports.reset = reset;
|
|
87
41
|
function clearfix() {
|
|
88
42
|
return {
|
|
89
43
|
'&::after': {
|
|
@@ -225,10 +179,10 @@ function printWrapAll() {
|
|
|
225
179
|
*
|
|
226
180
|
* ##### Example
|
|
227
181
|
* ``` js
|
|
228
|
-
* import screenReaderContent from '@splunk/themes/mixins';
|
|
182
|
+
* import { screenReaderContent } from '@splunk/themes/mixins';
|
|
229
183
|
*
|
|
230
184
|
* .myElement {
|
|
231
|
-
* ${
|
|
185
|
+
* ${screenReaderContent()};
|
|
232
186
|
* }
|
|
233
187
|
* ```
|
|
234
188
|
* @public
|
|
@@ -245,6 +199,43 @@ function screenReaderContent() {
|
|
|
245
199
|
border: 0
|
|
246
200
|
};
|
|
247
201
|
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Visually hide interactive elements and reveal them on focus. Use this mixin to allow
|
|
205
|
+
* keyboard users to skip over repeated content, such as navigation menus
|
|
206
|
+
*
|
|
207
|
+
* ##### Example
|
|
208
|
+
* ```js
|
|
209
|
+
* import styled from 'styled-components';
|
|
210
|
+
* import Link from '@splunk/react-ui/Link';
|
|
211
|
+
* import mixins from '@splunk/themes';
|
|
212
|
+
*
|
|
213
|
+
* const skipLink = styled(Link)`
|
|
214
|
+
* ${mixins.skipLink()};
|
|
215
|
+
* `;
|
|
216
|
+
* // or if you have a container with several links inside it:
|
|
217
|
+
* const skipLinkContainer = styled.div`
|
|
218
|
+
* ${mixins.skipLink()};
|
|
219
|
+
* `;
|
|
220
|
+
* ```
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
function skipLink() {
|
|
224
|
+
return {
|
|
225
|
+
position: 'absolute',
|
|
226
|
+
'&:not(:focus-within)': {
|
|
227
|
+
overflow: 'hidden',
|
|
228
|
+
clipPath: 'inset(50%)',
|
|
229
|
+
height: '1px',
|
|
230
|
+
minHeight: '1px',
|
|
231
|
+
width: '1px',
|
|
232
|
+
minWidth: '1px',
|
|
233
|
+
padding: '0',
|
|
234
|
+
border: '0',
|
|
235
|
+
whiteSpace: 'nowrap'
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
248
239
|
/**
|
|
249
240
|
* Calculates how one color would appear over another using a normal blend mode.
|
|
250
241
|
* Colors can either be strings or functions, such as variable functions.
|
|
@@ -304,7 +295,6 @@ function colorWithAlpha(color, alpha) {
|
|
|
304
295
|
};
|
|
305
296
|
}
|
|
306
297
|
var _default = {
|
|
307
|
-
reset: reset,
|
|
308
298
|
clearfix: clearfix,
|
|
309
299
|
ellipsis: ellipsis,
|
|
310
300
|
printWidth100Percent: printWidth100Percent,
|
|
@@ -312,6 +302,7 @@ var _default = {
|
|
|
312
302
|
printNoBackground: printNoBackground,
|
|
313
303
|
printWrapAll: printWrapAll,
|
|
314
304
|
screenReaderContent: screenReaderContent,
|
|
305
|
+
skipLink: skipLink,
|
|
315
306
|
colorWithAlpha: colorWithAlpha,
|
|
316
307
|
overlayColors: overlayColors
|
|
317
308
|
};
|