@splunk/themes 0.14.0 → 0.16.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 +22 -0
- package/enterprise/light.js +20 -6
- package/mixins/tests/typography.unit.js +29 -4
- package/mixins/typography.js +76 -19
- package/mixins/utilityMixins.js +9 -1
- package/package.json +2 -1
- package/prisma/base.js +20 -6
- package/types/enterprise/dark.d.ts +6 -2
- package/types/enterprise/light.d.ts +6 -2
- package/types/mixins/typography.d.ts +5 -7
- package/types/prisma/base.d.ts +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
0.16.0 - April 6, 2023
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* Added variables for supported font weights; the `typography` mixin's `weight` param supports these as keyword values (SUI-5344).
|
|
8
|
+
|
|
9
|
+
Breaking Changes:
|
|
10
|
+
* `typography` mixin's `weight` param now only accepts keyword values. Number values have been removed (SUI-5344).
|
|
11
|
+
|
|
12
|
+
Bug Fixes:
|
|
13
|
+
* `typography` mixin properly applies correct CSS for `weight` params (SUI-5344).
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
0.15.0 - January 25, 2023
|
|
17
|
+
----------
|
|
18
|
+
New Features:
|
|
19
|
+
* Added theme specific code in `typography` mixin for title variations (SUI-5272).
|
|
20
|
+
|
|
21
|
+
Bug Fixes:
|
|
22
|
+
* `mixins` now applies `color-scheme` (SUI-1926).
|
|
23
|
+
* This causes form controls, scrollbars, and other elements to respect the color scheme specified by `ThemeProvider`.
|
|
24
|
+
* Fixes documentation typo in `typography` mixin where 'subtitle' and 'smallSubtitle' should be instead be named 'title6' and 'title7' respectively.
|
|
25
|
+
|
|
4
26
|
0.14.0 - January 10, 2023
|
|
5
27
|
----------
|
|
6
28
|
New Features:
|
package/enterprise/light.js
CHANGED
|
@@ -325,18 +325,32 @@ var borders = {
|
|
|
325
325
|
};
|
|
326
326
|
var sansFontFamily = "'Splunk Platform Sans', 'Proxima Nova', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
327
327
|
/**
|
|
328
|
-
* ##
|
|
328
|
+
* ## Font family
|
|
329
329
|
*
|
|
330
330
|
* @valueSet
|
|
331
331
|
*/
|
|
332
332
|
|
|
333
|
-
var
|
|
333
|
+
var fontFamily = {
|
|
334
334
|
sansFontFamily: sansFontFamily,
|
|
335
335
|
serifFontFamily: "Georgia, 'Times New Roman', Times, serif",
|
|
336
336
|
monoFontFamily: "'Splunk Platform Mono', Inconsolata, Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace",
|
|
337
|
-
fontFamily: sansFontFamily
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
fontFamily: sansFontFamily
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* ## Font weights
|
|
341
|
+
*
|
|
342
|
+
* Based on [common weight name mappings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping)
|
|
343
|
+
*
|
|
344
|
+
* @valueSet
|
|
345
|
+
*/
|
|
346
|
+
|
|
347
|
+
var fontWeights = {
|
|
348
|
+
fontWeightLight: 300,
|
|
349
|
+
fontWeightNormal: 400,
|
|
350
|
+
fontWeightSemiBold: 500,
|
|
351
|
+
fontWeightBold: 700,
|
|
352
|
+
fontWeightHeavy: 800,
|
|
353
|
+
fontWeightExtraBold: 900
|
|
340
354
|
};
|
|
341
355
|
/**
|
|
342
356
|
* ## Layers
|
|
@@ -354,7 +368,7 @@ var zindexes = {
|
|
|
354
368
|
zindexToastMessages: 2000
|
|
355
369
|
};
|
|
356
370
|
|
|
357
|
-
var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors),
|
|
371
|
+
var theme = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, brandColors), grays), accentColors), errorColors), alertColors), warningColors), successColors), infoColors), categoricalColors), divergingColors), syntaxColors), fontFamily), fontWeights), usageColors), backgrounds), shadows), borders), zindexes);
|
|
358
372
|
|
|
359
373
|
var _default = theme;
|
|
360
374
|
exports["default"] = _default;
|
|
@@ -20,9 +20,19 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
20
20
|
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
22
|
|
|
23
|
-
function
|
|
23
|
+
function _templateObject7() {
|
|
24
24
|
var data = _taggedTemplateLiteral(["\n ", "\n ", ";\n ", ";\n "]);
|
|
25
25
|
|
|
26
|
+
_templateObject7 = function _templateObject7() {
|
|
27
|
+
return data;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function _templateObject6() {
|
|
34
|
+
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
35
|
+
|
|
26
36
|
_templateObject6 = function _templateObject6() {
|
|
27
37
|
return data;
|
|
28
38
|
};
|
|
@@ -177,7 +187,7 @@ describe('typography', function () {
|
|
|
177
187
|
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
178
188
|
container = _render5.container;
|
|
179
189
|
|
|
180
|
-
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 56px;\n font-weight:
|
|
190
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 56px;\n font-weight: 900;\n line-height: 64px;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
181
191
|
});
|
|
182
192
|
it('allows default values to be overridden with params', function () {
|
|
183
193
|
var Component = _styledComponents["default"].p(_templateObject5(), (0, _typography["default"])({
|
|
@@ -192,7 +202,22 @@ describe('typography', function () {
|
|
|
192
202
|
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
193
203
|
container = _render6.container;
|
|
194
204
|
|
|
195
|
-
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 56px;\n font-weight:
|
|
205
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 56px;\n font-weight: 900;\n line-height: 64px;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
206
|
+
});
|
|
207
|
+
it('transforms params that are shorthand properly to CSS', function () {
|
|
208
|
+
var Component = _styledComponents["default"].p(_templateObject6(), (0, _typography["default"])({
|
|
209
|
+
color: 'muted',
|
|
210
|
+
family: 'monospace',
|
|
211
|
+
lineHeight: 64,
|
|
212
|
+
size: 56,
|
|
213
|
+
weight: 'extraBold',
|
|
214
|
+
withReset: false
|
|
215
|
+
}));
|
|
216
|
+
|
|
217
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
218
|
+
container = _render7.container;
|
|
219
|
+
|
|
220
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 56px;\n font-weight: 900;\n line-height: 64px;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
196
221
|
});
|
|
197
222
|
it.skip('passes TS verification', function () {
|
|
198
223
|
(0, _typography["default"])();
|
|
@@ -227,7 +252,7 @@ describe('typography', function () {
|
|
|
227
252
|
describe('passes TS verification', function () {
|
|
228
253
|
it.skip('allows mixins in styled-components css', function () {
|
|
229
254
|
/* eslint-disable-next-line @typescript-eslint/no-unused-expressions */
|
|
230
|
-
(0, _styledComponents.css)(
|
|
255
|
+
(0, _styledComponents.css)(_templateObject7(), (0, _typography["default"])('title1'), (0, _typography["default"])('title1', {
|
|
231
256
|
color: 'disabled'
|
|
232
257
|
}), (0, _typography["default"])({
|
|
233
258
|
family: 'monospace'
|
package/mixins/typography.js
CHANGED
|
@@ -11,6 +11,8 @@ var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
|
11
11
|
|
|
12
12
|
var _variables = _interopRequireDefault(require("../variables"));
|
|
13
13
|
|
|
14
|
+
var _pick = _interopRequireDefault(require("../pick"));
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
17
|
|
|
16
18
|
function _templateObject2() {
|
|
@@ -60,42 +62,87 @@ function getStylesForVariant(variant) {
|
|
|
60
62
|
var lineHeight = _variables["default"].lineHeight; // eslint-disable-line prefer-destructuring
|
|
61
63
|
|
|
62
64
|
var size = _variables["default"].fontSize;
|
|
63
|
-
var weight = 'normal';
|
|
65
|
+
var weight = 'normal'; // TODO: After sections are removed from Heading update HeadingStyles accordingly to preserve section styles as typography variants SUI-5268
|
|
64
66
|
|
|
65
67
|
switch (variant) {
|
|
66
68
|
case 'title1':
|
|
67
69
|
color = _variables["default"].contentColorActive;
|
|
68
|
-
lineHeight =
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
lineHeight = (0, _pick["default"])({
|
|
71
|
+
enterprise: '20px',
|
|
72
|
+
prisma: '48px'
|
|
73
|
+
});
|
|
74
|
+
size = (0, _pick["default"])({
|
|
75
|
+
enterprise: '24px',
|
|
76
|
+
prisma: '36px'
|
|
77
|
+
});
|
|
78
|
+
weight = (0, _pick["default"])({
|
|
79
|
+
enterprise: '500',
|
|
80
|
+
prisma: _variables["default"].fontWeightBold
|
|
81
|
+
});
|
|
71
82
|
break;
|
|
72
83
|
|
|
73
84
|
case 'title2':
|
|
74
85
|
color = _variables["default"].contentColorActive;
|
|
75
|
-
lineHeight =
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
lineHeight = (0, _pick["default"])({
|
|
87
|
+
enterprise: '20px',
|
|
88
|
+
prisma: '24px'
|
|
89
|
+
});
|
|
90
|
+
size = (0, _pick["default"])({
|
|
91
|
+
enterprise: '18px',
|
|
92
|
+
prisma: '24px'
|
|
93
|
+
});
|
|
94
|
+
weight = (0, _pick["default"])({
|
|
95
|
+
enterprise: '500',
|
|
96
|
+
prisma: _variables["default"].fontWeightBold
|
|
97
|
+
});
|
|
78
98
|
break;
|
|
79
99
|
|
|
80
100
|
case 'title3':
|
|
81
101
|
color = _variables["default"].contentColorActive;
|
|
82
|
-
lineHeight =
|
|
83
|
-
|
|
84
|
-
|
|
102
|
+
lineHeight = (0, _pick["default"])({
|
|
103
|
+
enterprise: '20px',
|
|
104
|
+
prisma: '24px'
|
|
105
|
+
});
|
|
106
|
+
size = (0, _pick["default"])({
|
|
107
|
+
enterprise: '16px',
|
|
108
|
+
prisma: '20px'
|
|
109
|
+
});
|
|
110
|
+
weight = (0, _pick["default"])({
|
|
111
|
+
enterprise: '500',
|
|
112
|
+
prisma: _variables["default"].fontWeightBold
|
|
113
|
+
});
|
|
85
114
|
break;
|
|
86
115
|
|
|
87
116
|
case 'title4':
|
|
88
117
|
color = _variables["default"].contentColorActive;
|
|
89
|
-
lineHeight =
|
|
90
|
-
|
|
118
|
+
lineHeight = (0, _pick["default"])({
|
|
119
|
+
enterprise: '20px',
|
|
120
|
+
prisma: '24px'
|
|
121
|
+
});
|
|
122
|
+
size = (0, _pick["default"])({
|
|
123
|
+
enterprise: '12px',
|
|
124
|
+
prisma: '16px'
|
|
125
|
+
});
|
|
91
126
|
weight = _variables["default"].fontWeightBold;
|
|
92
127
|
break;
|
|
93
128
|
|
|
94
129
|
case 'title5':
|
|
95
|
-
color =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
130
|
+
color = (0, _pick["default"])({
|
|
131
|
+
enterprise: _variables["default"].contentColorActive,
|
|
132
|
+
prisma: 'default'
|
|
133
|
+
});
|
|
134
|
+
lineHeight = (0, _pick["default"])({
|
|
135
|
+
enterprise: _variables["default"].lineHeight,
|
|
136
|
+
prisma: '16px'
|
|
137
|
+
});
|
|
138
|
+
size = (0, _pick["default"])({
|
|
139
|
+
enterprise: '12px',
|
|
140
|
+
prisma: '13px'
|
|
141
|
+
});
|
|
142
|
+
weight = (0, _pick["default"])({
|
|
143
|
+
enterprise: '500',
|
|
144
|
+
prisma: _variables["default"].fontWeightBold
|
|
145
|
+
});
|
|
99
146
|
break;
|
|
100
147
|
|
|
101
148
|
case 'title6':
|
|
@@ -183,6 +230,15 @@ var colorPropToVariableMap = {
|
|
|
183
230
|
var familyPropToVariableMap = {
|
|
184
231
|
sansSerif: _variables["default"].sansFontFamily,
|
|
185
232
|
monospace: _variables["default"].monoFontFamily
|
|
233
|
+
}; // As defined by [font-weight | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping)
|
|
234
|
+
|
|
235
|
+
var weightPropToValueMap = {
|
|
236
|
+
light: _variables["default"].fontWeightLight,
|
|
237
|
+
normal: _variables["default"].fontWeightNormal,
|
|
238
|
+
semiBold: _variables["default"].fontWeightSemiBold,
|
|
239
|
+
bold: _variables["default"].fontWeightBold,
|
|
240
|
+
extraBold: _variables["default"].fontWeightExtraBold,
|
|
241
|
+
heavy: _variables["default"].fontWeightHeavy
|
|
186
242
|
};
|
|
187
243
|
/**
|
|
188
244
|
* A mixin for styling text content using predefined typography variants
|
|
@@ -218,8 +274,8 @@ var familyPropToVariableMap = {
|
|
|
218
274
|
* `'title3'`,
|
|
219
275
|
* `'title4'`,
|
|
220
276
|
* `'title5'`,
|
|
221
|
-
* `'
|
|
222
|
-
* `'
|
|
277
|
+
* `'title6'`,
|
|
278
|
+
* `'title7'`,
|
|
223
279
|
* `'largeBody'`,
|
|
224
280
|
* `'smallBody'`,
|
|
225
281
|
* `'footnote'`,
|
|
@@ -248,7 +304,8 @@ function typography(variantOrParams, additionalParams) {
|
|
|
248
304
|
size: params.size ? "".concat(params.size, "px") : undefined,
|
|
249
305
|
lineHeight: params.lineHeight ? "".concat(params.lineHeight, "px") : undefined,
|
|
250
306
|
color: params.color ? colorPropToVariableMap[params.color] : undefined,
|
|
251
|
-
family: params.family ? familyPropToVariableMap[params.family] : undefined
|
|
307
|
+
family: params.family ? familyPropToVariableMap[params.family] : undefined,
|
|
308
|
+
weight: params.weight ? weightPropToValueMap[params.weight] : undefined
|
|
252
309
|
});
|
|
253
310
|
|
|
254
311
|
var defaultTypographyParams = {
|
package/mixins/utilityMixins.js
CHANGED
|
@@ -27,7 +27,7 @@ var _pick = _interopRequireDefault(require("../pick"));
|
|
|
27
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
28
28
|
|
|
29
29
|
function _templateObject() {
|
|
30
|
-
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 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 list-style: disc outside none;\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 display: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]);
|
|
30
|
+
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 list-style: disc outside none;\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 display: ", ";\n font-family: ", ";\n font-size: ", ";\n line-height: ", ";\n outline: medium none ", ";\n visibility: inherit;\n "]);
|
|
31
31
|
|
|
32
32
|
_templateObject = function _templateObject() {
|
|
33
33
|
return data;
|
|
@@ -66,6 +66,14 @@ var reset = function reset() {
|
|
|
66
66
|
var display = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'inline';
|
|
67
67
|
return function () {
|
|
68
68
|
return (0, _styledComponents.css)(_templateObject(), (0, _pick["default"])({
|
|
69
|
+
/*
|
|
70
|
+
use pick() rather than relying on variables.colorScheme
|
|
71
|
+
because there's no guarantee that variables.colorScheme
|
|
72
|
+
has to match the css color-scheme prop
|
|
73
|
+
*/
|
|
74
|
+
dark: 'dark',
|
|
75
|
+
light: 'light'
|
|
76
|
+
}), (0, _pick["default"])({
|
|
69
77
|
enterprise: _variables["default"].textColor,
|
|
70
78
|
prisma: _variables["default"].contentColorDefault
|
|
71
79
|
}), display, _variables["default"].fontFamily, _variables["default"].fontSize, _variables["default"].lineHeight, _variables["default"].focusColor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@splunk/themes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Theme variables and mixins for the Splunk design language",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"babel": "babel src -d . --ignore src/babel-plugin-base64-png,src/tests --ignore \"**/docs\" --extensions .js,.ts,.tsx",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"test": "jest",
|
|
17
17
|
"test:ci": "JEST_JUNIT_OUTPUT_DIR=./test-reports JEST_JUNIT_OUTPUT_NAME=unit-results.xml JEST_JUNIT_CLASSNAME=unit yarn run test --ci --reporters=default jest-junit --coverage --coverageDirectory=coverage_report/coverage_maps_unit --coverageReporters=cobertura",
|
|
18
18
|
"test:watch": "jest --watch",
|
|
19
|
+
"pretypes:build": "rm -rf ./types",
|
|
19
20
|
"types:build": "tsc --emitDeclarationOnly --declaration",
|
|
20
21
|
"types:start": "yarn types:build --watch"
|
|
21
22
|
},
|
package/prisma/base.js
CHANGED
|
@@ -62,18 +62,32 @@ function createPrismaBase(_ref) {
|
|
|
62
62
|
};
|
|
63
63
|
var sansFontFamily = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
64
64
|
/**
|
|
65
|
-
* ##
|
|
65
|
+
* ## Font family
|
|
66
66
|
*
|
|
67
67
|
* @valueSet
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
|
-
var
|
|
70
|
+
var fontFamily = {
|
|
71
71
|
sansFontFamily: sansFontFamily,
|
|
72
72
|
serifFontFamily: "Georgia, 'Times New Roman', Times, serif",
|
|
73
73
|
monoFontFamily: "'Splunk Platform Mono', 'Roboto Mono', Consolas, 'Droid Sans Mono', Monaco, 'Courier New', Courier, monospace",
|
|
74
|
-
fontFamily: sansFontFamily
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
fontFamily: sansFontFamily
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* ## Font weights
|
|
78
|
+
*
|
|
79
|
+
* Based on [common weight name mappings](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#common_weight_name_mapping)
|
|
80
|
+
*
|
|
81
|
+
* @valueSet
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
var fontWeights = {
|
|
85
|
+
fontWeightLight: 300,
|
|
86
|
+
fontWeightNormal: 400,
|
|
87
|
+
fontWeightSemiBold: 500,
|
|
88
|
+
fontWeightBold: 700,
|
|
89
|
+
fontWeightHeavy: 800,
|
|
90
|
+
fontWeightExtraBold: 900
|
|
77
91
|
};
|
|
78
92
|
/**
|
|
79
93
|
* ## Layers
|
|
@@ -90,7 +104,7 @@ function createPrismaBase(_ref) {
|
|
|
90
104
|
zindexPopover: 1060,
|
|
91
105
|
zindexToastMessages: 2000
|
|
92
106
|
};
|
|
93
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({},
|
|
107
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, fontFamily), fontWeights), usageColors), _dataViz["default"]), shadows), backgrounds), zindexes);
|
|
94
108
|
}
|
|
95
109
|
|
|
96
110
|
var _default = createPrismaBase;
|
|
@@ -25,12 +25,16 @@ declare const theme: {
|
|
|
25
25
|
overlayShadow: string;
|
|
26
26
|
focusColor: string;
|
|
27
27
|
transparent: string;
|
|
28
|
+
fontWeightLight: number;
|
|
29
|
+
fontWeightNormal: number;
|
|
30
|
+
fontWeightSemiBold: number;
|
|
31
|
+
fontWeightBold: number;
|
|
32
|
+
fontWeightHeavy: number;
|
|
33
|
+
fontWeightExtraBold: number;
|
|
28
34
|
sansFontFamily: string;
|
|
29
35
|
serifFontFamily: string;
|
|
30
36
|
monoFontFamily: string;
|
|
31
37
|
fontFamily: string;
|
|
32
|
-
fontWeightBold: string;
|
|
33
|
-
fontWeightSemiBold: string;
|
|
34
38
|
syntaxBlue: string;
|
|
35
39
|
syntaxBlueLight: string;
|
|
36
40
|
syntaxBrown: string;
|
|
@@ -22,12 +22,16 @@ declare const theme: {
|
|
|
22
22
|
backgroundColorHover: string;
|
|
23
23
|
backgroundColor: string;
|
|
24
24
|
transparent: string;
|
|
25
|
+
fontWeightLight: number;
|
|
26
|
+
fontWeightNormal: number;
|
|
27
|
+
fontWeightSemiBold: number;
|
|
28
|
+
fontWeightBold: number;
|
|
29
|
+
fontWeightHeavy: number;
|
|
30
|
+
fontWeightExtraBold: number;
|
|
25
31
|
sansFontFamily: string;
|
|
26
32
|
serifFontFamily: string;
|
|
27
33
|
monoFontFamily: string;
|
|
28
34
|
fontFamily: string;
|
|
29
|
-
fontWeightBold: string;
|
|
30
|
-
fontWeightSemiBold: string;
|
|
31
35
|
syntaxBlue: string;
|
|
32
36
|
syntaxBlueLight: string;
|
|
33
37
|
syntaxBrown: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AnyTheme, Interpolation, ThemedProps } from '../types';
|
|
2
2
|
declare const typographyVariants: readonly ["body", "title1", "title2", "title3", "title4", "title5", "title6", "title7", "largeBody", "smallBody", "footnote", "monoBody", "monoSmallBody"];
|
|
3
3
|
declare type TypographyVariant = typeof typographyVariants[number];
|
|
4
|
+
declare type TypographyTitleVariant = Extract<TypographyVariant, 'title1' | 'title2' | 'title3' | 'title4' | 'title5' | 'title6' | 'title7'>;
|
|
4
5
|
interface TypographyParams {
|
|
5
6
|
/**
|
|
6
7
|
* Set the font-family to sans-serif or monospace based on current theme.
|
|
@@ -20,11 +21,8 @@ interface TypographyParams {
|
|
|
20
21
|
color?: 'active' | 'default' | 'disabled' | 'inverted' | 'muted' | 'inherit';
|
|
21
22
|
/**
|
|
22
23
|
* Set the font-weight to a system-standard value.
|
|
23
|
-
*
|
|
24
|
-
* Number or equivalent string can be used.
|
|
25
|
-
* See: [font-weight | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
|
|
26
24
|
*/
|
|
27
|
-
weight?:
|
|
25
|
+
weight?: 'light' | 'normal' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';
|
|
28
26
|
/**
|
|
29
27
|
* Apply a reset to the element's margin and padding. This defaults to true if using a `variant`.
|
|
30
28
|
*/
|
|
@@ -64,8 +62,8 @@ interface TypographyParams {
|
|
|
64
62
|
* `'title3'`,
|
|
65
63
|
* `'title4'`,
|
|
66
64
|
* `'title5'`,
|
|
67
|
-
* `'
|
|
68
|
-
* `'
|
|
65
|
+
* `'title6'`,
|
|
66
|
+
* `'title7'`,
|
|
69
67
|
* `'largeBody'`,
|
|
70
68
|
* `'smallBody'`,
|
|
71
69
|
* `'footnote'`,
|
|
@@ -80,4 +78,4 @@ declare function typography<T extends AnyTheme, A extends ThemedProps>(variant:
|
|
|
80
78
|
declare function typography<T extends AnyTheme, A extends ThemedProps>({ family, size, lineHeight, color, weight, withReset, }: TypographyParams): Interpolation<T, A>;
|
|
81
79
|
declare function typography<T extends AnyTheme, A extends ThemedProps>(variant: TypographyVariant, additionalParams: TypographyParams): Interpolation<T, A>;
|
|
82
80
|
export default typography;
|
|
83
|
-
export { typographyVariants, TypographyVariant, TypographyParams };
|
|
81
|
+
export { typographyVariants, TypographyTitleVariant, TypographyVariant, TypographyParams };
|
package/types/prisma/base.d.ts
CHANGED
|
@@ -229,12 +229,16 @@ declare function createPrismaBase({ colorScheme }: {
|
|
|
229
229
|
focusColor: string;
|
|
230
230
|
transparent: string;
|
|
231
231
|
linkColor: string;
|
|
232
|
+
fontWeightLight: number;
|
|
233
|
+
fontWeightNormal: number;
|
|
234
|
+
fontWeightSemiBold: number;
|
|
235
|
+
fontWeightBold: number;
|
|
236
|
+
fontWeightHeavy: number;
|
|
237
|
+
fontWeightExtraBold: number;
|
|
232
238
|
sansFontFamily: string;
|
|
233
239
|
serifFontFamily: string;
|
|
234
240
|
monoFontFamily: string;
|
|
235
241
|
fontFamily: string;
|
|
236
|
-
fontWeightBold: string;
|
|
237
|
-
fontWeightSemiBold: string;
|
|
238
242
|
};
|
|
239
243
|
declare type PrismaBase = ReturnType<typeof createPrismaBase>;
|
|
240
244
|
export default createPrismaBase;
|