@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.
- package/CHANGELOG.md +8 -0
- package/CHANGELOG.v1.md +70 -0
- package/SplunkThemeProvider.js +18 -31
- package/design-tokens/colors.js +495 -0
- package/design-tokens/dataViz.js +486 -0
- package/design-tokens/deprecated.js +249 -0
- package/design-tokens/elevation.js +44 -0
- package/design-tokens/index.js +23 -0
- package/design-tokens/spacing-sizing.js +39 -0
- package/design-tokens/typography.js +67 -0
- package/enterprise/comfortable.js +20 -11
- package/enterprise/compact.js +20 -15
- package/enterprise/dark.js +188 -53
- package/enterprise/dataViz.js +491 -0
- package/enterprise/index.js +9 -22
- package/enterprise/light.js +316 -271
- package/getSettingsFromThemedProps.js +4 -8
- package/getTheme.js +13 -26
- package/index.js +9 -13
- package/mixins/index.js +47 -19
- package/mixins/layout.js +42 -0
- package/mixins/prose.js +67 -0
- package/mixins/tests/prose.unit.js +49 -0
- package/mixins/tests/typography.unit.js +54 -103
- package/mixins/tests/utilityMixins.unit.js +3 -11
- package/mixins/typography.js +154 -188
- package/mixins/utilityMixins.js +13 -39
- package/package.json +22 -17
- package/pick.js +7 -18
- package/pickVariant.js +1 -7
- package/prisma/base.js +34 -42
- package/prisma/comfortable.js +1 -8
- package/prisma/compact.js +1 -8
- package/prisma/dark.js +90 -33
- package/prisma/dataViz.js +71 -87
- package/prisma/index.js +8 -16
- package/prisma/light.js +91 -34
- package/splunk-magnetic/index.js +178 -0
- package/splunk-magnetic/magneticTokensDark.js +706 -0
- package/splunk-magnetic/magneticTokensLight.js +706 -0
- package/storybook-addon-splunk-themes/SplunkThemesTool.js +20 -42
- package/storybook-addon-splunk-themes/ThemedDocsContainer.js +3 -13
- package/storybook-addon-splunk-themes/index.js +0 -4
- package/storybook-addon-splunk-themes/manager.js +1 -7
- package/storybook-addon-splunk-themes/preview.js +4 -8
- package/storybook-addon-splunk-themes/tests/util.unit.js +0 -1
- package/storybook-addon-splunk-themes/themeOptions.js +0 -1
- package/storybook-addon-splunk-themes/themes.js +4 -15
- package/storybook-addon-splunk-themes/util.js +21 -39
- package/storybook-addon-splunk-themes/withSplunkTheme.js +34 -68
- package/types/design-tokens/colors.d.ts +875 -0
- package/types/design-tokens/dataViz.d.ts +433 -0
- package/types/design-tokens/deprecated.d.ts +468 -0
- package/types/design-tokens/elevation.d.ts +49 -0
- package/types/design-tokens/index.d.ts +541 -0
- package/types/design-tokens/spacing-sizing.d.ts +39 -0
- package/types/design-tokens/typography.d.ts +79 -0
- package/types/enterprise/comfortable.d.ts +11 -17
- package/types/enterprise/compact.d.ts +11 -21
- package/types/enterprise/dark.d.ts +412 -113
- package/types/enterprise/dataViz.d.ts +14 -0
- package/types/enterprise/index.d.ts +1 -2
- package/types/enterprise/light.d.ts +439 -139
- package/types/index.d.ts +1 -0
- package/types/mixins/index.d.ts +8 -0
- package/types/mixins/layout.d.ts +21 -0
- package/types/mixins/prose.d.ts +41 -0
- package/types/mixins/tests/prose.unit.d.ts +1 -0
- package/types/mixins/typography.d.ts +5 -12
- package/types/prisma/base.d.ts +12 -16
- package/types/prisma/comfortable.d.ts +2 -17
- package/types/prisma/compact.d.ts +2 -17
- package/types/prisma/dark.d.ts +60 -9
- package/types/prisma/dataViz.d.ts +8 -426
- package/types/prisma/light.d.ts +62 -11
- package/types/splunk-magnetic/index.d.ts +2941 -0
- package/types/splunk-magnetic/magneticTokensDark.d.ts +700 -0
- package/types/splunk-magnetic/magneticTokensLight.d.ts +700 -0
- package/types/storybook-addon-splunk-themes/SplunkThemesTool.d.ts +1 -1
- package/useSplunkTheme.js +14 -22
- package/utils.js +25 -35
- package/variables.js +17 -31
- package/withSplunkTheme.js +26 -36
- package/enterprise/prismaAliases.js +0 -103
- package/types/enterprise/prismaAliases.d.ts +0 -47
|
@@ -1,101 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
5
4
|
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
5
|
var _react2 = require("@testing-library/react");
|
|
8
|
-
|
|
9
6
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
-
|
|
11
7
|
var _SplunkThemeProvider = _interopRequireDefault(require("@splunk/themes/SplunkThemeProvider"));
|
|
12
|
-
|
|
13
8
|
require("jest-styled-components");
|
|
14
|
-
|
|
15
9
|
var _typography = _interopRequireWildcard(require("../typography"));
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
|
-
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
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; }
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
23
13
|
function _templateObject7() {
|
|
24
14
|
var data = _taggedTemplateLiteral(["\n ", "\n ", ";\n ", ";\n "]);
|
|
25
|
-
|
|
26
15
|
_templateObject7 = function _templateObject7() {
|
|
27
16
|
return data;
|
|
28
17
|
};
|
|
29
|
-
|
|
30
18
|
return data;
|
|
31
19
|
}
|
|
32
|
-
|
|
33
20
|
function _templateObject6() {
|
|
34
21
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
35
|
-
|
|
36
22
|
_templateObject6 = function _templateObject6() {
|
|
37
23
|
return data;
|
|
38
24
|
};
|
|
39
|
-
|
|
40
25
|
return data;
|
|
41
26
|
}
|
|
42
|
-
|
|
43
27
|
function _templateObject5() {
|
|
44
28
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
45
|
-
|
|
46
29
|
_templateObject5 = function _templateObject5() {
|
|
47
30
|
return data;
|
|
48
31
|
};
|
|
49
|
-
|
|
50
32
|
return data;
|
|
51
33
|
}
|
|
52
|
-
|
|
53
34
|
function _templateObject4() {
|
|
54
35
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
55
|
-
|
|
56
36
|
_templateObject4 = function _templateObject4() {
|
|
57
37
|
return data;
|
|
58
38
|
};
|
|
59
|
-
|
|
60
39
|
return data;
|
|
61
40
|
}
|
|
62
|
-
|
|
63
41
|
function _templateObject3() {
|
|
64
42
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
65
|
-
|
|
66
43
|
_templateObject3 = function _templateObject3() {
|
|
67
44
|
return data;
|
|
68
45
|
};
|
|
69
|
-
|
|
70
46
|
return data;
|
|
71
47
|
}
|
|
72
|
-
|
|
73
48
|
function _templateObject2() {
|
|
74
49
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
75
|
-
|
|
76
50
|
_templateObject2 = function _templateObject2() {
|
|
77
51
|
return data;
|
|
78
52
|
};
|
|
79
|
-
|
|
80
53
|
return data;
|
|
81
54
|
}
|
|
82
|
-
|
|
83
55
|
function _templateObject() {
|
|
84
56
|
var data = _taggedTemplateLiteral(["\n ", "\n "]);
|
|
85
|
-
|
|
86
57
|
_templateObject = function _templateObject() {
|
|
87
58
|
return data;
|
|
88
59
|
};
|
|
89
|
-
|
|
90
60
|
return data;
|
|
91
61
|
}
|
|
92
|
-
|
|
93
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
94
|
-
|
|
62
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } /* eslint-env jest */
|
|
95
63
|
describe('typography', function () {
|
|
96
64
|
function ThemeSettingsList(_ref) {
|
|
97
65
|
var family = _ref.family,
|
|
98
|
-
|
|
66
|
+
Component = _ref.component;
|
|
99
67
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_SplunkThemeProvider["default"], {
|
|
100
68
|
family: family,
|
|
101
69
|
colorScheme: "dark",
|
|
@@ -114,44 +82,37 @@ describe('typography', function () {
|
|
|
114
82
|
density: "compact"
|
|
115
83
|
}, /*#__PURE__*/_react["default"].createElement(Component, null, family, " light compact")));
|
|
116
84
|
}
|
|
117
|
-
|
|
118
85
|
describe('uses default values based on theme family', function () {
|
|
119
86
|
var Component = _styledComponents["default"].p(_templateObject(), (0, _typography["default"])());
|
|
120
|
-
|
|
121
87
|
it('prisma', function () {
|
|
122
|
-
var _render = (0, _react2.render)(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
expect(container).toMatchInlineSnapshot("\n .c0 {\n color: #b5b5b5;\n font-family: 'Splunk Platform Sans','Splunk Data Sans',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n }\n\n .c1 {\n color: #4d4d4d;\n font-family: 'Splunk Platform Sans','Splunk Data Sans',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n }\n\n <div>\n <p\n class=\"c0\"\n >\n prisma\n dark comfortable\n </p>\n <p\n class=\"c1\"\n >\n prisma\n light comfortable\n </p>\n <p\n class=\"c0\"\n >\n prisma\n dark compact\n </p>\n <p\n class=\"c1\"\n >\n prisma\n light compact\n </p>\n </div>\n ");
|
|
88
|
+
var _render = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(ThemeSettingsList, {
|
|
89
|
+
family: "prisma",
|
|
90
|
+
component: Component
|
|
91
|
+
})),
|
|
92
|
+
container = _render.container;
|
|
93
|
+
expect(container).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Sans','Splunk Data Sans',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n color: #b5b5b5;\n font-size: 0.875rem;\n line-height: 1.429;\n font-weight: 400;\n }\n\n .c1 {\n font-family: 'Splunk Platform Sans','Splunk Data Sans',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n color: #4d4d4d;\n font-size: 0.875rem;\n line-height: 1.429;\n font-weight: 400;\n }\n\n <div>\n <p\n class=\"c0\"\n >\n prisma\n dark comfortable\n </p>\n <p\n class=\"c1\"\n >\n prisma\n light comfortable\n </p>\n <p\n class=\"c0\"\n >\n prisma\n dark compact\n </p>\n <p\n class=\"c1\"\n >\n prisma\n light compact\n </p>\n </div>\n ");
|
|
129
94
|
});
|
|
130
95
|
it('enterprise', function () {
|
|
131
|
-
var _render2 = (0, _react2.render)(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
expect(container).toMatchInlineSnapshot("\n .c0 {\n color: #ffffff;\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n }\n\n .c1 {\n color: #3c444d;\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n }\n\n .c2 {\n color: #ffffff;\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n }\n\n .c3 {\n color: #3c444d;\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n font-size: 12px;\n font-weight: normal;\n line-height: 20px;\n }\n\n <div>\n <p\n class=\"c0\"\n >\n enterprise\n dark comfortable\n </p>\n <p\n class=\"c1\"\n >\n enterprise\n light comfortable\n </p>\n <p\n class=\"c2\"\n >\n enterprise\n dark compact\n </p>\n <p\n class=\"c3\"\n >\n enterprise\n light compact\n </p>\n </div>\n ");
|
|
96
|
+
var _render2 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(ThemeSettingsList, {
|
|
97
|
+
family: "enterprise",
|
|
98
|
+
component: Component
|
|
99
|
+
})),
|
|
100
|
+
container = _render2.container;
|
|
101
|
+
expect(container).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n color: #e1e6eb;\n font-size: 0.875rem;\n line-height: 1.429;\n font-weight: 400;\n }\n\n .c1 {\n font-family: 'Splunk Platform Sans','Proxima Nova',Roboto,Droid,'Helvetica Neue',Helvetica,Arial,sans-serif;\n color: #5c6773;\n font-size: 0.875rem;\n line-height: 1.429;\n font-weight: 400;\n }\n\n <div>\n <p\n class=\"c0\"\n >\n enterprise\n dark comfortable\n </p>\n <p\n class=\"c1\"\n >\n enterprise\n light comfortable\n </p>\n <p\n class=\"c0\"\n >\n enterprise\n dark compact\n </p>\n <p\n class=\"c1\"\n >\n enterprise\n light compact\n </p>\n </div>\n ");
|
|
138
102
|
});
|
|
139
103
|
});
|
|
140
104
|
describe('support variants in each theme', function () {
|
|
141
105
|
function testTypographyVariantForThemeFamily(variant, family) {
|
|
142
106
|
it("".concat(variant), function () {
|
|
143
107
|
var Component = _styledComponents["default"].p(_templateObject2(), (0, _typography["default"])(variant));
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
container = _render3.container;
|
|
150
|
-
|
|
108
|
+
var _render3 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(ThemeSettingsList, {
|
|
109
|
+
family: family,
|
|
110
|
+
component: Component
|
|
111
|
+
})),
|
|
112
|
+
container = _render3.container;
|
|
151
113
|
expect(container).toMatchSnapshot();
|
|
152
114
|
});
|
|
153
115
|
}
|
|
154
|
-
|
|
155
116
|
describe('prisma', function () {
|
|
156
117
|
_typography.typographyVariants.forEach(function (variant) {
|
|
157
118
|
return testTypographyVariantForThemeFamily(variant, 'prisma');
|
|
@@ -168,56 +129,45 @@ describe('typography', function () {
|
|
|
168
129
|
color: 'muted',
|
|
169
130
|
family: 'monospace'
|
|
170
131
|
}));
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n margin: 0;\n padding: 0;\n color: #909090;\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n font-size: 14px;\n font-weight: normal;\n line-height: 20px;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
132
|
+
var _render4 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
133
|
+
container = _render4.container;
|
|
134
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n color: #909090;\n font-size: 0.875rem;\n line-height: 1.429;\n font-weight: 400;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
176
135
|
});
|
|
177
136
|
it('allows a variants values to be overridden', function () {
|
|
178
137
|
var Component = _styledComponents["default"].p(_templateObject4(), (0, _typography["default"])('body', {
|
|
179
138
|
color: 'muted',
|
|
180
139
|
family: 'monospace',
|
|
181
|
-
lineHeight:
|
|
182
|
-
size:
|
|
183
|
-
weight: 'extraBold'
|
|
184
|
-
withReset: false
|
|
140
|
+
lineHeight: 'single',
|
|
141
|
+
size: 24,
|
|
142
|
+
weight: 'extraBold'
|
|
185
143
|
}));
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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 ");
|
|
144
|
+
var _render5 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
145
|
+
container = _render5.container;
|
|
146
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n color: #909090;\n font-size: 1.5rem;\n line-height: 1;\n font-weight: 900;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
191
147
|
});
|
|
192
148
|
it('allows default values to be overridden with params', function () {
|
|
193
149
|
var Component = _styledComponents["default"].p(_templateObject5(), (0, _typography["default"])({
|
|
194
150
|
color: 'muted',
|
|
195
151
|
family: 'monospace',
|
|
196
|
-
lineHeight:
|
|
197
|
-
size:
|
|
198
|
-
weight: 'extraBold'
|
|
199
|
-
withReset: false
|
|
152
|
+
lineHeight: 'single',
|
|
153
|
+
size: 24,
|
|
154
|
+
weight: 'extraBold'
|
|
200
155
|
}));
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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 ");
|
|
156
|
+
var _render6 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
157
|
+
container = _render6.container;
|
|
158
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n color: #909090;\n font-size: 1.5rem;\n line-height: 1;\n font-weight: 900;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
206
159
|
});
|
|
207
160
|
it('transforms params that are shorthand properly to CSS', function () {
|
|
208
161
|
var Component = _styledComponents["default"].p(_templateObject6(), (0, _typography["default"])({
|
|
209
162
|
color: 'muted',
|
|
210
163
|
family: 'monospace',
|
|
211
|
-
lineHeight:
|
|
212
|
-
size:
|
|
213
|
-
weight: 'extraBold'
|
|
214
|
-
withReset: false
|
|
164
|
+
lineHeight: 'single',
|
|
165
|
+
size: 24,
|
|
166
|
+
weight: 'extraBold'
|
|
215
167
|
}));
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
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 ");
|
|
168
|
+
var _render7 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Component, null)),
|
|
169
|
+
container = _render7.container;
|
|
170
|
+
expect(container.firstChild).toMatchInlineSnapshot("\n .c0 {\n font-family: 'Splunk Platform Mono','Roboto Mono',Consolas,'Droid Sans Mono',Monaco,'Courier New',Courier,monospace;\n color: #909090;\n font-size: 1.5rem;\n line-height: 1;\n font-weight: 900;\n }\n\n <p\n class=\"c0\"\n />\n ");
|
|
221
171
|
});
|
|
222
172
|
it.skip('passes TS verification', function () {
|
|
223
173
|
(0, _typography["default"])();
|
|
@@ -228,22 +178,23 @@ describe('typography', function () {
|
|
|
228
178
|
});
|
|
229
179
|
(0, _typography["default"])({
|
|
230
180
|
family: 'monospace'
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
(0, _typography["default"])('foo'); // @ts-expect-error
|
|
181
|
+
});
|
|
234
182
|
|
|
183
|
+
// @ts-expect-error
|
|
184
|
+
(0, _typography["default"])('foo');
|
|
185
|
+
// @ts-expect-error
|
|
235
186
|
(0, _typography["default"])({
|
|
236
187
|
family: 'monospace'
|
|
237
|
-
}, true);
|
|
238
|
-
|
|
188
|
+
}, true);
|
|
189
|
+
// @ts-expect-error
|
|
239
190
|
(0, _typography["default"])({
|
|
240
191
|
family: 'monospace'
|
|
241
192
|
}, {
|
|
242
193
|
color: 'disabled'
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
(0, _typography["default"])('');
|
|
246
|
-
|
|
194
|
+
});
|
|
195
|
+
// @ts-expect-error
|
|
196
|
+
(0, _typography["default"])('');
|
|
197
|
+
// @ts-expect-error
|
|
247
198
|
(0, _typography["default"])({
|
|
248
199
|
variant: 'title1'
|
|
249
200
|
});
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _styledComponents = require("styled-components");
|
|
4
|
-
|
|
5
4
|
var _variables = _interopRequireDefault(require("../../variables"));
|
|
6
|
-
|
|
7
5
|
var _utilityMixins = require("../utilityMixins");
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
|
|
6
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
7
|
function _templateObject() {
|
|
12
8
|
var data = _taggedTemplateLiteral(["\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n ", "\n ", ";\n "]);
|
|
13
|
-
|
|
14
9
|
_templateObject = function _templateObject() {
|
|
15
10
|
return data;
|
|
16
11
|
};
|
|
17
|
-
|
|
18
12
|
return data;
|
|
19
13
|
}
|
|
20
|
-
|
|
21
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
22
|
-
|
|
14
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } /* eslint-env jest */
|
|
23
15
|
describe('colorWithAlpha', function () {
|
|
24
16
|
var defaultProps = {};
|
|
25
17
|
var enterpriseLightProps = {
|
|
@@ -46,7 +38,7 @@ describe('colorWithAlpha', function () {
|
|
|
46
38
|
var result2 = (0, _utilityMixins.colorWithAlpha)(_variables["default"].contentColorDefault, 0.2)(defaultProps);
|
|
47
39
|
expect(result2).toBe('rgba(181, 181, 181, 0.2)');
|
|
48
40
|
var result3 = (0, _utilityMixins.colorWithAlpha)(_variables["default"].contentColorDefault, 0.3)(enterpriseLightProps);
|
|
49
|
-
expect(result3).toBe('rgba(
|
|
41
|
+
expect(result3).toBe('rgba(92, 103, 115, 0.3)');
|
|
50
42
|
var result4 = (0, _utilityMixins.colorWithAlpha)(_variables["default"].brandColor, 0.3)(enterpriseLightProps);
|
|
51
43
|
expect(result4).toBe('rgba(92, 192, 92, 0.3)');
|
|
52
44
|
});
|