1 | import React from 'react';
|
2 | import styledSystem, { space, width } from 'styled-system';
|
3 | import styled, { ThemeProvider } from 'styled-components';
|
4 | import { Text } from 'rebass';
|
5 |
|
6 | function styleInject(css, ref) {
|
7 | if ( ref === void 0 ) ref = {};
|
8 | var insertAt = ref.insertAt;
|
9 |
|
10 | if (!css || typeof document === 'undefined') { return; }
|
11 |
|
12 | var head = document.head || document.getElementsByTagName('head')[0];
|
13 | var style = document.createElement('style');
|
14 | style.type = 'text/css';
|
15 |
|
16 | if (insertAt === 'top') {
|
17 | if (head.firstChild) {
|
18 | head.insertBefore(style, head.firstChild);
|
19 | } else {
|
20 | head.appendChild(style);
|
21 | }
|
22 | } else {
|
23 | head.appendChild(style);
|
24 | }
|
25 |
|
26 | if (style.styleSheet) {
|
27 | style.styleSheet.cssText = css;
|
28 | } else {
|
29 | style.appendChild(document.createTextNode(css));
|
30 | }
|
31 | }
|
32 |
|
33 | var css = "/* open-sans-300normal - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: normal;\n font-display: swap;\n font-weight: 300;\n src:\n local('Open Sans Light '),\n local('Open Sans-Light'),\n url('./files/open-sans-latin-300.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-300.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-300italic - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-display: swap;\n font-weight: 300;\n src:\n local('Open Sans Light italic'),\n local('Open Sans-Lightitalic'),\n url('./files/open-sans-latin-300italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-300italic.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-400normal - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: normal;\n font-display: swap;\n font-weight: 400;\n src:\n local('Open Sans Regular '),\n local('Open Sans-Regular'),\n url('./files/open-sans-latin-400.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-400.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-400italic - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-display: swap;\n font-weight: 400;\n src:\n local('Open Sans Regular italic'),\n local('Open Sans-Regularitalic'),\n url('./files/open-sans-latin-400italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-400italic.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-600normal - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: normal;\n font-display: swap;\n font-weight: 600;\n src:\n local('Open Sans SemiBold '),\n local('Open Sans-SemiBold'),\n url('./files/open-sans-latin-600.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-600.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-600italic - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-display: swap;\n font-weight: 600;\n src:\n local('Open Sans SemiBold italic'),\n local('Open Sans-SemiBolditalic'),\n url('./files/open-sans-latin-600italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-600italic.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-700normal - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: normal;\n font-display: swap;\n font-weight: 700;\n src:\n local('Open Sans Bold '),\n local('Open Sans-Bold'),\n url('./files/open-sans-latin-700.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-700.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-700italic - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-display: swap;\n font-weight: 700;\n src:\n local('Open Sans Bold italic'),\n local('Open Sans-Bolditalic'),\n url('./files/open-sans-latin-700italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-700italic.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-800normal - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: normal;\n font-display: swap;\n font-weight: 800;\n src:\n local('Open Sans ExtraBold '),\n local('Open Sans-ExtraBold'),\n url('./files/open-sans-latin-800.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-800.woff') format('woff'); /* Modern Browsers */\n}\n/* open-sans-800italic - latin */\n@font-face {\n font-family: 'Open Sans';\n font-style: italic;\n font-display: swap;\n font-weight: 800;\n src:\n local('Open Sans ExtraBold italic'),\n local('Open Sans-ExtraBolditalic'),\n url('./files/open-sans-latin-800italic.woff2') format('woff2'), /* Super Modern Browsers */\n url('./files/open-sans-latin-800italic.woff') format('woff'); /* Modern Browsers */\n}\n\n";
|
34 | styleInject(css);
|
35 |
|
36 | var css$1 = ":root {\n /* Primary brand colors. */\n --primary: #4dbd8f;\n --primary-light: #82f0bf;\n --primary-dark: #028c61;\n\n /* Secondary colors */\n --secondary: #2d4147;\n --secondary-900: #1d2c31;\n --secondary-800: #2d4147;\n --secondary-700: #3a545b;\n --secondary-600: #486870;\n --secondary-500: #537680;\n --secondary-400: #6d8a93;\n --secondary-300: #869fa6;\n --secondary-200: #a8babf;\n --secondary-100: #cad6d9;\n --secondary-50: #e9eef0;\n\n /* Neutral colors */\n --white: #ffffff;\n --surface-light: #ffffff;\n --surface-dark: var(--secondary-50);\n\n /* Error colors */\n --error: #e25c6c;\n --error-light: #ff8d9a;\n --error-dark: #ab2941;\n\n /* Alert colors */\n --alert: #ffe04a;\n --alert-light: #ffff7d;\n --alert-dark: #c8af03;\n\n /* Shades of black/gray (translucent). */\n --black-90: rgba(0, 0, 0, 0.9);\n --black-80: rgba(0, 0, 0, 0.8);\n --black-70: rgba(0, 0, 0, 0.7);\n --black-60: rgba(0, 0, 0, 0.6);\n --black-50: rgba(0, 0, 0, 0.5);\n --black-40: rgba(0, 0, 0, 0.4);\n --black-30: rgba(0, 0, 0, 0.3);\n --black-20: rgba(0, 0, 0, 0.2);\n --black-10: rgba(0, 0, 0, 0.1);\n --black-05: rgba(0, 0, 0, 0.05);\n --black-025: rgba(0, 0, 0, 0.025);\n --black-0125: rgba(0, 0, 0, 0.0125);\n\n /* Shades of gray (opaque) */\n --grey-100: #333333;\n --grey-90: #444444;\n --grey-80: #555555;\n --grey-70: #666666;\n --grey-60: #777777;\n --grey-50: #888888;\n --grey-40: #999999;\n --grey-30: #aaaaaa;\n --grey-20: #bbbbbb;\n --grey-10: #cccccc;\n --grey-05: #dddddd;\n --grey-0: #eeeeee;\n --near-white: #f5f5f5;\n\n /* DEPRECATED */\n --text-dark: var(--black-90);\n --text-muted: var(--black-60);\n --eden-green: #6fbe9a;\n --eden-pink: #ff4557;\n --eden-shale: #2d4147;\n}\n";
|
37 | styleInject(css$1);
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 | var __assign = function() {
|
55 | __assign = Object.assign || function __assign(t) {
|
56 | for (var s, i = 1, n = arguments.length; i < n; i++) {
|
57 | s = arguments[i];
|
58 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
59 | }
|
60 | return t;
|
61 | };
|
62 | return __assign.apply(this, arguments);
|
63 | };
|
64 |
|
65 | function __makeTemplateObject(cooked, raw) {
|
66 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
67 | return cooked;
|
68 | }
|
69 |
|
70 | function unwrapExports (x) {
|
71 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x.default : x;
|
72 | }
|
73 |
|
74 | function createCommonjsModule(fn, module) {
|
75 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
76 | }
|
77 |
|
78 | var dist = createCommonjsModule(function (module, exports) {
|
79 |
|
80 | Object.defineProperty(exports, "__esModule", {
|
81 | value: true
|
82 | });
|
83 |
|
84 | var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
85 |
|
86 | var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
87 |
|
88 |
|
89 |
|
90 | var _react2 = _interopRequireDefault(React);
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | var _styledComponents2 = _interopRequireDefault(styled);
|
97 |
|
98 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
99 |
|
100 | function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
|
101 |
|
102 | function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
103 |
|
104 | var css = function css(props) {
|
105 | return props.css;
|
106 | };
|
107 |
|
108 | var omit = function omit(obj, blacklist) {
|
109 | var next = {};
|
110 | for (var key in obj) {
|
111 | if (blacklist.indexOf(key) > -1) continue;
|
112 | next[key] = obj[key];
|
113 | }
|
114 | return next;
|
115 | };
|
116 |
|
117 | var styleKeys = Object.keys(styledSystem.styles).filter(function (key) {
|
118 | return typeof styledSystem.styles[key] === 'function';
|
119 | });
|
120 |
|
121 | var propNames = styleKeys.reduce(function (a, key) {
|
122 | var names = Object.keys(styledSystem.styles[key].propTypes);
|
123 | return [].concat(_toConsumableArray(a), _toConsumableArray(names));
|
124 | }, []);
|
125 |
|
126 |
|
127 | var _blacklist = ['css', 'is', 'tag', 'extend'].concat(_toConsumableArray(propNames));
|
128 |
|
129 | var tag = _react2.default.forwardRef(function (_ref, ref) {
|
130 | var _ref$blacklist = _ref.blacklist,
|
131 | blacklist = _ref$blacklist === undefined ? [] : _ref$blacklist,
|
132 | props = _objectWithoutProperties(_ref, ['blacklist']);
|
133 |
|
134 | var Base = props.extend || props.tag || props.is || 'div';
|
135 | var next = omit(props, typeof Base === 'string' ? [].concat(_toConsumableArray(_blacklist), _toConsumableArray(blacklist)) : ['extend']);
|
136 | return _react2.default.createElement(Base, _extends({}, next, { ref: ref }));
|
137 | });
|
138 |
|
139 | var getPropTypes = function getPropTypes(funcs) {
|
140 | return funcs.filter(function (fn) {
|
141 | return typeof fn === 'function' && _typeof(fn.propTypes) === 'object';
|
142 | }).reduce(function (a, fn) {
|
143 | return _extends({}, a, fn.propTypes);
|
144 | }, {});
|
145 | };
|
146 |
|
147 | var system = function system() {
|
148 | for (var _len = arguments.length, keysOrStyles = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
149 | keysOrStyles[_key - 1] = arguments[_key];
|
150 | }
|
151 |
|
152 | var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
153 |
|
154 | var funcs = keysOrStyles.map(function (key) {
|
155 | return styledSystem.styles[key] || key;
|
156 | });
|
157 | var propTypes = getPropTypes(funcs);
|
158 |
|
159 | var Component = (0, _styledComponents2.default)(tag).apply(undefined, [[]].concat(_toConsumableArray(funcs), [css]));
|
160 |
|
161 | var baseProps = styledSystem.util.get(props, 'extend.defaultProps') || {};
|
162 |
|
163 | Component.defaultProps = _extends({}, baseProps, props);
|
164 |
|
165 | Component.propTypes = getPropTypes(funcs);
|
166 | Component.systemComponent = true;
|
167 |
|
168 | return Component;
|
169 | };
|
170 |
|
171 | exports.default = system;
|
172 | });
|
173 |
|
174 | var system = unwrapExports(dist);
|
175 |
|
176 |
|
177 |
|
178 | var PrimaryColors = {
|
179 | Primary: '#4dbd8f',
|
180 | PrimaryLight: '#82f0bf',
|
181 | PrimaryDark: '#028c61',
|
182 | };
|
183 |
|
184 | var SecondaryColors = {
|
185 | Secondary: '#2d4147',
|
186 | Secondary900: '#1d2c31',
|
187 | Secondary800: '#2d4147',
|
188 | Secondary700: '#3a545b',
|
189 | Secondary600: '#486870',
|
190 | Secondary500: '#537680',
|
191 | Secondary400: '#6d8a93',
|
192 | Secondary300: '#869fa6',
|
193 | Secondary200: '#a8babf',
|
194 | Secondary100: '#cad6d9',
|
195 | Secondary50: '#e9eef0',
|
196 | };
|
197 |
|
198 | var NeutralColors = {
|
199 | White: '#ffffff',
|
200 | SurfaceLight: '#ffffff',
|
201 | SurfaceDark: SecondaryColors.Secondary500,
|
202 | };
|
203 |
|
204 | var ErrorColors = {
|
205 | Error: '#e25c6c',
|
206 | ErrorLight: '#ff8d9a',
|
207 | ErrorDark: '#ab2941',
|
208 | };
|
209 |
|
210 | var AlertColors = {
|
211 | Alert: '#ffe04a',
|
212 | AlertLight: '#ffff7d',
|
213 | AlertDark: '#c8af03',
|
214 | };
|
215 |
|
216 | var BlackColors = {
|
217 | Black900: 'rgba(0, 0, 0, 0.9)',
|
218 | Black800: 'rgba(0, 0, 0, 0.8)',
|
219 | Black700: 'rgba(0, 0, 0, 0.7)',
|
220 | Black600: 'rgba(0, 0, 0, 0.6)',
|
221 | Black500: 'rgba(0, 0, 0, 0.5)',
|
222 | Black400: 'rgba(0, 0, 0, 0.4)',
|
223 | Black300: 'rgba(0, 0, 0, 0.3)',
|
224 | Black200: 'rgba(0, 0, 0, 0.2)',
|
225 | Black100: 'rgba(0, 0, 0, 0.1)',
|
226 | Black050: 'rgba(0, 0, 0, 0.05)',
|
227 | Black025: 'rgba(0, 0, 0, 0.025)',
|
228 | Black0125: 'rgba(0, 0, 0, 0.0125)',
|
229 | };
|
230 |
|
231 | var GreyColors = {
|
232 | Grey900: '#333333',
|
233 | Grey800: '#444444',
|
234 | Grey700: '#555555',
|
235 | Grey600: '#666666',
|
236 | Grey500: '#777777',
|
237 | Grey400: '#888888',
|
238 | Grey300: '#999999',
|
239 | Grey200: '#aaaaaa',
|
240 | Grey100: '#bbbbbb',
|
241 | Grey050: '#cccccc',
|
242 | Grey025: '#dddddd',
|
243 | Grey0125: '#e0e0e0',
|
244 | NearWhite: '#f7f7f7',
|
245 | };
|
246 | var BrandColors = __assign({}, AlertColors, ErrorColors, NeutralColors, PrimaryColors, SecondaryColors);
|
247 | var Colors = __assign({}, AlertColors, BlackColors, ErrorColors, GreyColors, NeutralColors, PrimaryColors, SecondaryColors);
|
248 |
|
249 | var BorderRadius = {
|
250 | Base: 4,
|
251 | Large: 8,
|
252 | };
|
253 | var SpacerSize;
|
254 | (function (SpacerSize) {
|
255 | SpacerSize[SpacerSize["Large"] = 0] = "Large";
|
256 | SpacerSize[SpacerSize["Medium"] = 1] = "Medium";
|
257 | SpacerSize[SpacerSize["Small"] = 2] = "Small";
|
258 | SpacerSize[SpacerSize["Tiny"] = 3] = "Tiny";
|
259 | })(SpacerSize || (SpacerSize = {}));
|
260 | var Spacing = {
|
261 | Large: 24,
|
262 | Medium: 16,
|
263 | Small: 8,
|
264 | Tiny: 4,
|
265 | };
|
266 |
|
267 | var Box = system({
|
268 | p: 3,
|
269 | space: space,
|
270 | });
|
271 | var Box$1 = styled(Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n border-radius: ", ";\n box-shadow: 0 2px 4px 2px rgba(29, 44, 49, 0.1);\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", ";\n"], ["\n background: ", ";\n border-radius: ", ";\n box-shadow: 0 2px 4px 2px rgba(29, 44, 49, 0.1);\n display: flex;\n flex-direction: column;\n justify-content: center;\n ", ";\n"])), Colors.White, BorderRadius.Large, space);
|
272 | var templateObject_1;
|
273 |
|
274 | var Separator = styled(system({ space: space, width: width }))(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n border: 1px solid ", ";\n border-bottom-width: 0;\n ", ";\n ", ";\n"], ["\n border: 1px solid ", ";\n border-bottom-width: 0;\n ", ";\n ", ";\n"])), Colors.Grey025, space, width);
|
275 | Separator.defaultProps = {
|
276 | width: '100%',
|
277 | };
|
278 | var templateObject_1$1;
|
279 |
|
280 |
|
281 |
|
282 |
|
283 |
|
284 | var FontSize = {
|
285 | Base: 16,
|
286 | BaseLarge: 18,
|
287 | BaseSmall: 14,
|
288 | HeaderBase: 20,
|
289 | };
|
290 |
|
291 |
|
292 |
|
293 | var FontWeightType;
|
294 | (function (FontWeightType) {
|
295 | FontWeightType[FontWeightType["Light"] = 0] = "Light";
|
296 | FontWeightType[FontWeightType["Regular"] = 1] = "Regular";
|
297 | FontWeightType[FontWeightType["Medium"] = 2] = "Medium";
|
298 | FontWeightType[FontWeightType["SemiBold"] = 3] = "SemiBold";
|
299 | FontWeightType[FontWeightType["Bold"] = 4] = "Bold";
|
300 | })(FontWeightType || (FontWeightType = {}));
|
301 | var FontWeight = Object.freeze({
|
302 | Light: '300',
|
303 | Regular: '400',
|
304 | Medium: '500',
|
305 | SemiBold: '600',
|
306 | Bold: '700',
|
307 | });
|
308 | var FontFamily;
|
309 | (function (FontFamily) {
|
310 | FontFamily["OpenSans"] = "Open Sans";
|
311 | FontFamily["Merriweather"] = "Merriweather";
|
312 | })(FontFamily || (FontFamily = {}));
|
313 |
|
314 | var Sans = (function (props) { return (React.createElement(Text, { fontFamily: props.fontFamily || FontFamily.OpenSans, fontSize: props.size, fontWeight: "" + FontWeight[props.weight] }, props.children)); });
|
315 |
|
316 | var Theme = {
|
317 | colors: {
|
318 | primary: Colors.Primary,
|
319 | secondary: Colors.Secondary,
|
320 | },
|
321 | fontSizes: [12, 14, 16, 18, 20, 24, 32, 48, 64],
|
322 | styles: {
|
323 | body: {
|
324 | fontFamily: "'Open Sans', Helvetica, sans-serif",
|
325 | },
|
326 | html: {
|
327 | fontFamily: "'Open Sans', Helvetica, sans-serif",
|
328 | },
|
329 | },
|
330 | };
|
331 | var Theme$1 = (function (props) { return (React.createElement(ThemeProvider, { theme: Theme }, props.children)); });
|
332 |
|
333 | var index = {
|
334 | BorderRadius: BorderRadius,
|
335 | Box: Box$1,
|
336 | Colors: Colors,
|
337 | FontFamily: FontFamily,
|
338 | FontSize: FontSize,
|
339 | FontWeight: FontWeight,
|
340 | Sans: Sans,
|
341 | Separator: Separator,
|
342 | Spacing: Spacing,
|
343 | Theme: Theme$1,
|
344 | };
|
345 |
|
346 | export default index;
|
347 |
|