@splunk/themes 0.14.0 → 0.15.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 +10 -0
- package/mixins/typography.js +65 -18
- package/mixins/utilityMixins.js +9 -1
- package/package.json +2 -1
- package/types/mixins/typography.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
0.15.0 - January 25, 2023
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* Added theme specific code in `typography` mixin for title variations (SUI-5272).
|
|
8
|
+
|
|
9
|
+
Bug Fixes:
|
|
10
|
+
* `mixins` now applies `color-scheme` (SUI-1926).
|
|
11
|
+
* This causes form controls, scrollbars, and other elements to respect the color scheme specified by `ThemeProvider`.
|
|
12
|
+
* Fixes documentation typo in `typography` mixin where 'subtitle' and 'smallSubtitle' should be instead be named 'title6' and 'title7' respectively.
|
|
13
|
+
|
|
4
14
|
0.14.0 - January 10, 2023
|
|
5
15
|
----------
|
|
6
16
|
New Features:
|
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':
|
|
@@ -218,8 +265,8 @@ var familyPropToVariableMap = {
|
|
|
218
265
|
* `'title3'`,
|
|
219
266
|
* `'title4'`,
|
|
220
267
|
* `'title5'`,
|
|
221
|
-
* `'
|
|
222
|
-
* `'
|
|
268
|
+
* `'title6'`,
|
|
269
|
+
* `'title7'`,
|
|
223
270
|
* `'largeBody'`,
|
|
224
271
|
* `'smallBody'`,
|
|
225
272
|
* `'footnote'`,
|
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.15.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
|
},
|