1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 | function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
6 |
|
7 | require('./slicedToArray-ef426d0f.js');
|
8 | require('./unsupportedIterableToArray-8a00e599.js');
|
9 | var React = require('react');
|
10 | var React__default = _interopDefault(React);
|
11 | require('./_commonjsHelpers-72d386ba.js');
|
12 | var index = require('./index-b0606964.js');
|
13 | require('./defineProperty-0921a47c.js');
|
14 | require('./toConsumableArray-7f36359f.js');
|
15 | var _styled = require('styled-components');
|
16 | var _styled__default = _interopDefault(_styled);
|
17 | require('./getPrototypeOf-e2d1e599.js');
|
18 | require('./color.js');
|
19 | require('./components.js');
|
20 | require('./contains-component.js');
|
21 | require('./css.js');
|
22 | require('./dayjs.min-aa59a48e.js');
|
23 | require('./date.js');
|
24 | require('./miscellaneous.js');
|
25 | require('./environment.js');
|
26 | var font = require('./font.js');
|
27 | require('./math-ecfd5d91.js');
|
28 | require('./characters.js');
|
29 | require('./format.js');
|
30 | require('./keycodes.js');
|
31 | require('./url.js');
|
32 | require('./web3.js');
|
33 | require('./constants.js');
|
34 | require('./breakpoints.js');
|
35 | require('./springs.js');
|
36 | var textStyles = require('./text-styles.js');
|
37 | require('./theme-dark.js');
|
38 | require('./theme-light.js');
|
39 | var Theme = require('./Theme.js');
|
40 | var _extends$1 = require('./extends-40571110.js');
|
41 | require('./getDisplayName-7ab6d318.js');
|
42 | var index$2 = require('./index-2b9f03ad.js');
|
43 | var taggedTemplateLiteral = require('./taggedTemplateLiteral-227ed122.js');
|
44 |
|
45 | var overpassLightWoff2 = "cf790334a5a6d45c.woff2";
|
46 |
|
47 | var overpassRegularWoff2 = "32a3f11e7740ce58.woff2";
|
48 |
|
49 | var overpassSemiBoldWoff2 = "5cfe62515c2f9b42.woff2";
|
50 |
|
51 | var overpassMonoLightWoff2 = "3dd21d4f0d28fecb.woff2";
|
52 |
|
53 | function _templateObject() {
|
54 | var data = taggedTemplateLiteral._taggedTemplateLiteral(["\n\n // @font-face declarations\n ", "\n\n *, *:before, *:after {\n box-sizing: border-box;\n }\n html {\n -webkit-overflow-scrolling: touch;\n }\n body {\n height: 0;\n min-height: 100vh;\n color: ", ";\n background: ", ";\n font-family: ", ";\n ", ";\n }\n html, body {\n overflow: hidden;\n }\n body, ul, p, h1, h2, h3, h4, h5, h6 {\n margin: 0;\n padding: 0;\n }\n button, select, input, textarea, h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-family: inherit;\n font-weight: inherit;\n line-height: inherit;\n }\n a, button, select, input, textarea {\n color: inherit;\n }\n strong, b {\n font-weight: 600;\n }\n ::selection {\n background: ", ";\n color: ", ";\n }\n"]);
|
55 |
|
56 | _templateObject = function _templateObject() {
|
57 | return data;
|
58 | };
|
59 |
|
60 | return data;
|
61 | }
|
62 | var DEFAULT_FONTS = {
|
63 | '400': {
|
64 | url: overpassLightWoff2,
|
65 | format: 'woff2'
|
66 | },
|
67 | '600': {
|
68 | url: overpassRegularWoff2,
|
69 | format: 'woff2'
|
70 | },
|
71 | '800': {
|
72 | url: overpassSemiBoldWoff2,
|
73 | format: 'woff2'
|
74 | }
|
75 | };
|
76 | var MONOSPACE_FONTS = {
|
77 | '400': {
|
78 | url: overpassMonoLightWoff2,
|
79 | format: 'woff2'
|
80 | }
|
81 | };
|
82 |
|
83 | function fontSrc(publicUrl, _ref) {
|
84 | var url = _ref.url,
|
85 | format = _ref.format;
|
86 | return "url(".concat(publicUrl + url, ") format('").concat(format, "')");
|
87 | }
|
88 |
|
89 | function fontFaceDeclarations(_ref2) {
|
90 | var fontFamily = _ref2.fontFamily,
|
91 | publicUrl = _ref2.publicUrl;
|
92 |
|
93 |
|
94 | if (fontFamily !== BaseStyles.defaultProps.fontFamily) {
|
95 | return '';
|
96 | }
|
97 |
|
98 | return "\n @font-face {\n font-family: ".concat(font.DEFAULT_FONT_FAMILY, ";\n src: ").concat(fontSrc(publicUrl, DEFAULT_FONTS['400']), ";\n font-weight: 400;\n font-style: normal;\n }\n @font-face {\n font-family: ").concat(font.DEFAULT_FONT_FAMILY, ";\n src: ").concat(fontSrc(publicUrl, DEFAULT_FONTS['600']), ";\n font-weight: 600;\n font-style: normal;\n }\n @font-face {\n font-family: ").concat(font.DEFAULT_FONT_FAMILY, ";\n src: ").concat(fontSrc(publicUrl, DEFAULT_FONTS['800']), ";\n font-weight: 800;\n font-style: normal;\n }\n @font-face {\n font-family: ").concat(font.MONOSPACE_FONT_FAMILY, ";\n src: ").concat(fontSrc(publicUrl, MONOSPACE_FONTS['400']), ";\n font-weight: 400;\n font-style: normal;\n }\n ");
|
99 | }
|
100 |
|
101 | var BaseStyles = React__default.memo(function BaseStyles(props) {
|
102 | var theme = Theme.useTheme();
|
103 | return React__default.createElement(GlobalStyle, _extends$1._extends({}, props, {
|
104 | theme: theme,
|
105 | fontFaces: fontFaceDeclarations(props),
|
106 | textStyleCss: textStyles.textStyle('body2')
|
107 | }));
|
108 | });
|
109 | BaseStyles.propTypes = {
|
110 | publicUrl: index.PropTypes.string,
|
111 | fontFamily: index.PropTypes.string
|
112 | };
|
113 | BaseStyles.defaultProps = {
|
114 | publicUrl: '/',
|
115 | fontFamily: "".concat(font.DEFAULT_FONT_FAMILY, ", sans-serif")
|
116 | };
|
117 | var GlobalStyle = _styled.createGlobalStyle(_templateObject(), function (p) {
|
118 | return p.fontFaces ? p.fontFaces : '';
|
119 | }, function (p) {
|
120 | return p.theme.content;
|
121 | }, function (p) {
|
122 | return p.theme.background;
|
123 | }, function (p) {
|
124 | return p.fontFamily;
|
125 | }, function (p) {
|
126 | return p.textStyleCss;
|
127 | }, function (p) {
|
128 | return p.theme.selected;
|
129 | }, function (p) {
|
130 | return p.theme.selectedContent;
|
131 | });
|
132 | var BaseStyles$1 = index$2.PublicUrl.hocWrap(BaseStyles);
|
133 |
|
134 | exports.default = BaseStyles$1;
|
135 |
|