@opengeoweb/theme 2.0.1 → 2.1.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.
Files changed (46) hide show
  1. package/README.md +458 -65
  2. package/index.d.ts +1 -1
  3. package/lib/components/Theme/ThemeContext.d.ts +17 -0
  4. package/{theme.test.d.ts → lib/components/Theme/ThemeContext.spec.d.ts} +1 -1
  5. package/lib/components/Theme/darkTheme.d.ts +3 -0
  6. package/{theme.d.ts → lib/components/Theme/gwTheme.d.ts} +7 -7
  7. package/lib/components/Theme/index.d.ts +5 -0
  8. package/lib/components/Theme/lightTheme.d.ts +3 -0
  9. package/lib/components/Theme/types.d.ts +121 -0
  10. package/lib/components/Theme/utils.d.ts +7 -0
  11. package/lib/components/Theme/utils.spec.d.ts +1 -0
  12. package/lib/stories/Backdrop.stories.d.ts +8 -0
  13. package/lib/stories/Card.stories.d.ts +3 -0
  14. package/lib/stories/Colors.stories.d.ts +7 -0
  15. package/lib/stories/Elevation.stories.d.ts +3 -0
  16. package/lib/stories/FormElements.stories.d.ts +4 -0
  17. package/lib/stories/List.stories.d.ts +3 -0
  18. package/lib/stories/Slider.stories.d.ts +3 -0
  19. package/lib/stories/StoryWrapper.d.ts +9 -0
  20. package/lib/stories/Table.stories.d.ts +3 -0
  21. package/lib/stories/Tabs.stories.d.ts +8 -0
  22. package/lib/stories/Tooltip.stories.d.ts +7 -0
  23. package/lib/stories/Typography.stories.d.ts +4 -0
  24. package/lib/stories/index.stories.d.ts +15 -0
  25. package/lib/stories/snapshots/Backdrop.stories.d.ts +17 -0
  26. package/lib/stories/snapshots/Card.stories.d.ts +17 -0
  27. package/lib/stories/snapshots/Colors.stories.d.ts +17 -0
  28. package/lib/stories/snapshots/Elevation.stories.d.ts +17 -0
  29. package/lib/stories/snapshots/FormElements.stories.d.ts +7 -0
  30. package/lib/stories/snapshots/List.stories.d.ts +7 -0
  31. package/lib/stories/snapshots/Slider.stories.d.ts +7 -0
  32. package/lib/stories/snapshots/Table.stories.d.ts +17 -0
  33. package/lib/stories/snapshots/Tabs.stories.d.ts +7 -0
  34. package/lib/stories/snapshots/Tooltip.stories.d.ts +17 -0
  35. package/lib/stories/snapshots/Typography.stories.d.ts +7 -0
  36. package/lib/storyshots/Storyshots.spec.d.ts +1 -0
  37. package/package.json +11 -121
  38. package/theme.esm.js +1196 -0
  39. package/theme.umd.js +1175 -0
  40. package/AUTHORS +0 -14
  41. package/LICENCE +0 -13
  42. package/index.js +0 -13
  43. package/theme.js +0 -215
  44. package/theme.stories.d.ts +0 -7
  45. package/theme.stories.js +0 -257
  46. package/theme.test.js +0 -44
package/theme.umd.js ADDED
@@ -0,0 +1,1175 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@material-ui/core'), require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@material-ui/core', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Theme = {}, global.core, global.React));
5
+ })(this, (function (exports, core, React) { 'use strict';
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
+
27
+ /*! *****************************************************************************
28
+ Copyright (c) Microsoft Corporation.
29
+
30
+ Permission to use, copy, modify, and/or distribute this software for any
31
+ purpose with or without fee is hereby granted.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
34
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
35
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
36
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
37
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
+ PERFORMANCE OF THIS SOFTWARE.
40
+ ***************************************************************************** */
41
+
42
+ var __assign = function() {
43
+ __assign = Object.assign || function __assign(t) {
44
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
45
+ s = arguments[i];
46
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
47
+ }
48
+ return t;
49
+ };
50
+ return __assign.apply(this, arguments);
51
+ };
52
+
53
+ function __rest(s, e) {
54
+ var t = {};
55
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
56
+ t[p] = s[p];
57
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
58
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
59
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
60
+ t[p[i]] = s[p[i]];
61
+ }
62
+ return t;
63
+ }
64
+
65
+ function __read(o, n) {
66
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
67
+ if (!m) return o;
68
+ var i = m.call(o), r, ar = [], e;
69
+ try {
70
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
71
+ }
72
+ catch (error) { e = { error: error }; }
73
+ finally {
74
+ try {
75
+ if (r && !r.done && (m = i["return"])) m.call(i);
76
+ }
77
+ finally { if (e) throw e.error; }
78
+ }
79
+ return ar;
80
+ }
81
+
82
+ var hex2rgba = function hex2rgba(hex, alpha) {
83
+ if (alpha === void 0) {
84
+ alpha = 1;
85
+ }
86
+
87
+ var _a = __read(hex.match(/\w\w/g).map(function (x) {
88
+ return parseInt(x, 16);
89
+ }), 3),
90
+ r = _a[0],
91
+ g = _a[1],
92
+ b = _a[2];
93
+
94
+ return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
95
+ };
96
+ var parseColors = function parseColors(colors) {
97
+ return Object.keys(colors).reduce(function (segmentList, key) {
98
+ var _a;
99
+
100
+ var segment = colors[key];
101
+ var parsedSegment = Object.keys(segment).reduce(function (list, name) {
102
+ var _a, _b;
103
+
104
+ var value = segment[name];
105
+ var color = value.fill || value.color; // converts hex to rgba value if color and opacity property has been set
106
+
107
+ if (value && color && (value.opacity || value.opacity === 0)) {
108
+ return __assign(__assign({}, list), (_a = {}, _a[name] = __assign(__assign({}, value), {
109
+ rgba: hex2rgba(color, value.opacity)
110
+ }), _a));
111
+ }
112
+
113
+ return __assign(__assign({}, list), (_b = {}, _b[name] = value, _b));
114
+ }, {});
115
+ return __assign(__assign({}, segmentList), (_a = {}, _a[key] = parsedSegment, _a));
116
+ }, {});
117
+ };
118
+ var createShadows = function createShadows(elevations) {
119
+ var SHADOW_LIST_SIZE = 25;
120
+ var elevationList = Object.keys(elevations).map(function (elevationName) {
121
+ return elevations[elevationName];
122
+ });
123
+ return Array(SHADOW_LIST_SIZE).fill('none').map(function (value, index) {
124
+ if (index > 0) {
125
+ var elevationIndex = index - 1;
126
+
127
+ if (elevationList[elevationIndex]) {
128
+ return elevationList[elevationIndex];
129
+ }
130
+ }
131
+
132
+ return value;
133
+ });
134
+ };
135
+ var BORDER_RADIUS = 3;
136
+ var createTheme = function createTheme(paletteType, geowebColors, shadows) {
137
+ return core.createMuiTheme({
138
+ palette: {
139
+ type: paletteType,
140
+ secondary: {
141
+ main: geowebColors.typographyAndIcons.iconLinkActive
142
+ },
143
+ background: {
144
+ paper: geowebColors.background.surfaceApp,
145
+ "default": geowebColors.background.surfaceBrowser
146
+ },
147
+ text: {
148
+ primary: geowebColors.typographyAndIcons.text
149
+ },
150
+ // geoweb color palette
151
+ geowebColors: geowebColors
152
+ },
153
+ shape: {
154
+ borderRadius: BORDER_RADIUS
155
+ },
156
+ typography: {
157
+ fontFamily: ['Roboto', 'Helvetica', 'Arial', 'sans-serif'].join(',')
158
+ },
159
+ shadows: shadows,
160
+ overrides: {
161
+ MuiCssBaseline: {
162
+ '@global': {
163
+ body: {
164
+ fontSmoothing: 'auto'
165
+ }
166
+ }
167
+ },
168
+ MuiMenuItem: {
169
+ root: {
170
+ fontSize: '0.875rem',
171
+ letterSpacing: '0.25px',
172
+ ':not(:last-child)&:after': {
173
+ content: '""',
174
+ position: 'absolute',
175
+ width: '100%',
176
+ height: 1,
177
+ background: geowebColors.greys.accessible,
178
+ bottom: 0,
179
+ left: 0,
180
+ opacity: 0.5
181
+ },
182
+ '&.Mui-selected': {
183
+ background: 'none',
184
+ boxShadow: "inset 4px 0px 0px 0px " + geowebColors.typographyAndIcons.iconLinkActive
185
+ }
186
+ }
187
+ },
188
+ MuiRadio: {
189
+ root: {
190
+ color: geowebColors.typographyAndIcons.iconLinkActive
191
+ }
192
+ },
193
+ MuiPaper: {
194
+ outlined: {
195
+ borderColor: geowebColors.cards.cardContainerBorder
196
+ }
197
+ },
198
+ MuiCard: {
199
+ root: {
200
+ backgroundColor: geowebColors.cards.cardContainer
201
+ }
202
+ },
203
+ MuiSlider: {
204
+ root: {
205
+ color: geowebColors.typographyAndIcons.iconLinkActive
206
+ }
207
+ },
208
+ MuiTable: {
209
+ root: {
210
+ borderSpacing: '0 0.25rem',
211
+ borderCollapse: 'separate'
212
+ }
213
+ },
214
+ MuiTableRow: {
215
+ head: {
216
+ '&:hover': {
217
+ boxShadow: shadows[0]
218
+ }
219
+ },
220
+ root: {
221
+ transition: 'box-shadow 100ms ease-out',
222
+ boxShadow: shadows[0],
223
+ borderRadius: BORDER_RADIUS,
224
+ '&:hover': {
225
+ boxShadow: shadows[1]
226
+ },
227
+ position: 'relative'
228
+ }
229
+ },
230
+ MuiTableCell: {
231
+ head: {
232
+ borderBottom: 'none',
233
+ fontSize: '0.875rem',
234
+ fontWeight: 400
235
+ },
236
+ body: {
237
+ padding: 12,
238
+ fontWeight: 500,
239
+ backgroundColor: geowebColors.background.surface,
240
+ borderStyle: 'solid',
241
+ borderColor: 'transparent',
242
+ borderWidth: 1,
243
+ borderTopColor: geowebColors.cards.cardContainerBorder,
244
+ borderBottomColor: geowebColors.cards.cardContainerBorder,
245
+ '&:first-child': {
246
+ borderLeftColor: geowebColors.cards.cardContainerBorder,
247
+ borderRadius: BORDER_RADIUS + "px 0px 0px " + BORDER_RADIUS + "px"
248
+ },
249
+ '&:last-child': {
250
+ borderRightColor: geowebColors.cards.cardContainerBorder,
251
+ borderRadius: "0px " + BORDER_RADIUS + "px " + BORDER_RADIUS + "px 0px"
252
+ }
253
+ }
254
+ },
255
+ MuiTabs: {
256
+ root: {
257
+ position: 'relative',
258
+ '&:after': {
259
+ content: '""',
260
+ position: 'absolute',
261
+ bottom: 0,
262
+ height: 1,
263
+ width: '100%',
264
+ zIndex: 0,
265
+ backgroundColor: hex2rgba(geowebColors.greys.accessible, 0.2)
266
+ }
267
+ },
268
+ indicator: {
269
+ zIndex: 1,
270
+ backgroundColor: geowebColors.typographyAndIcons.iconLinkActive
271
+ }
272
+ },
273
+ MuiTab: {
274
+ root: {
275
+ textTransform: 'initial',
276
+ '&.Mui-selected': {
277
+ color: geowebColors.typographyAndIcons.iconLinkActive
278
+ },
279
+ '&:hover': {
280
+ opacity: 1,
281
+ color: geowebColors.typographyAndIcons.iconLinkActive,
282
+ backgroundColor: geowebColors.tab.mouseOver.rgba
283
+ }
284
+ }
285
+ },
286
+ MuiListItem: {
287
+ root: {
288
+ color: geowebColors.typographyAndIcons.text
289
+ },
290
+ divider: {
291
+ borderBottomColor: hex2rgba(geowebColors.greys.accessible, 0.2)
292
+ }
293
+ },
294
+ MuiBackdrop: {
295
+ root: {
296
+ backgroundColor: geowebColors.backdrops.black.rgba
297
+ }
298
+ },
299
+ MuiTooltip: {
300
+ tooltip: {
301
+ backgroundColor: geowebColors.tooltips.tooltipContainer.rgba,
302
+ color: geowebColors.tooltips.tooltipText.color,
303
+ padding: '8px 12px',
304
+ fontSize: 16,
305
+ fontWeight: 400,
306
+ fontStretch: 'normal',
307
+ fontStyle: 'normal',
308
+ letterSpacing: 0.44,
309
+ lineHeight: 1.56
310
+ }
311
+ },
312
+ MuiLink: {
313
+ root: {
314
+ color: geowebColors.typographyAndIcons.textLinkActive
315
+ }
316
+ },
317
+ // TODO: implement correct theming values https://gitlab.com/opengeoweb/opengeoweb/-/issues/1369
318
+ MuiAlert: {
319
+ standardError: {
320
+ border: '1px solid #c00000',
321
+ borderRadius: '0px',
322
+ backgroundColor: '#fff0ea'
323
+ },
324
+ standardWarning: {
325
+ border: '1px solid #ffa800',
326
+ borderRadius: '0px',
327
+ backgroundColor: '#fff8eb'
328
+ },
329
+ standardInfo: {
330
+ border: '1px solid #0062e6',
331
+ borderRadius: '0px',
332
+ backgroundColor: '#eaf3ff'
333
+ },
334
+ standardSuccess: {
335
+ border: '1px solid #72bb23',
336
+ borderRadius: '0px',
337
+ backgroundColor: '#fcffeb'
338
+ },
339
+ action: {
340
+ color: '#0075a9'
341
+ },
342
+ message: {
343
+ fontSize: '14px',
344
+ lineHeight: 1.43,
345
+ letterSpacing: '0.25px',
346
+ color: '#051039'
347
+ }
348
+ }
349
+ }
350
+ });
351
+ };
352
+
353
+ /* *
354
+ * Licensed under the Apache License, Version 2.0 (the "License");
355
+ * you may not use this file except in compliance with the License.
356
+ * You may obtain a copy of the License at
357
+ *
358
+ * http://www.apache.org/licenses/LICENSE-2.0
359
+ *
360
+ * Unless required by applicable law or agreed to in writing, software
361
+ * distributed under the License is distributed on an "AS IS" BASIS,
362
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
363
+ * See the License for the specific language governing permissions and
364
+ * limitations under the License.
365
+ *
366
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
367
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
368
+ * */
369
+
370
+ var colors$1 = {
371
+ background: {
372
+ surface: '#FFFFFF',
373
+ surfaceApp: '#F5F5F5',
374
+ surfaceBrowser: '#CFCFCF'
375
+ },
376
+ brand: {
377
+ brand: '#00547d'
378
+ },
379
+ buttons: {
380
+ primary: {
381
+ fill: '#186DFF'
382
+ },
383
+ primaryMouseover: {
384
+ fill: '#1047B0'
385
+ },
386
+ primaryActive: {
387
+ fill: '#186DFF'
388
+ },
389
+ flatMouseover: {
390
+ fill: '#E3E4E7'
391
+ },
392
+ focusDefault: {
393
+ outline: 'solid 2px #419cfe'
394
+ },
395
+ disabled: {
396
+ fill: '#E8E5E5'
397
+ },
398
+ surfaceIconDefault: {
399
+ fill: '#F5F5F5'
400
+ }
401
+ },
402
+ typographyAndIcons: {
403
+ text: '#051039',
404
+ icon: '#051039',
405
+ buttonIcon: '#FFFFFF',
406
+ iconLinkActive: '#186DFF',
407
+ iconLinkDisabled: '#CCCCCC',
408
+ textLinkActive: '#186DFF',
409
+ buttonIconTertiaryFlat: '#575F7A'
410
+ },
411
+ textInputField: {
412
+ "default": {
413
+ fill: '#051039',
414
+ opacity: 0.07
415
+ },
416
+ active: {
417
+ fill: '#051039',
418
+ opacity: 0.02
419
+ },
420
+ disabled: {
421
+ fill: '#000000',
422
+ opacity: 0
423
+ }
424
+ },
425
+ tab: {
426
+ mouseOver: {
427
+ fill: '#051039',
428
+ opacity: 0.07
429
+ }
430
+ },
431
+ greys: {
432
+ accessible: '#767676'
433
+ },
434
+ cards: {
435
+ cardContainer: '#FFFFFF',
436
+ cardContainerBorder: '#EEEEEE'
437
+ },
438
+ backdrops: {
439
+ black: {
440
+ fill: '#000000',
441
+ opacity: 0.5
442
+ },
443
+ white: {
444
+ fill: '#FFFFFF',
445
+ opacity: 0.24
446
+ }
447
+ },
448
+ timeSlider: {
449
+ // player
450
+ playerNeedleTimeTop: {
451
+ fill: '#E3004F',
452
+ opacity: 100
453
+ },
454
+ playerNeedleTime: {
455
+ fill: '#FFD523',
456
+ opacity: 0.75
457
+ },
458
+ playerNeedlePlayerTop: {
459
+ fill: '#051039',
460
+ opacity: 100
461
+ },
462
+ playerNeedlePlayer: {
463
+ fill: '#67F0FF',
464
+ opacity: 0.75
465
+ },
466
+ playerRailObservation: {
467
+ fill: '#0876B6',
468
+ opacity: 100
469
+ },
470
+ playerRailSelection: {
471
+ fill: '#C6D111',
472
+ opacity: 0.5
473
+ },
474
+ playerRailForecastData: {
475
+ fill: '#FD64FF',
476
+ opacity: 0.6
477
+ },
478
+ playerRailForecastNoData: {
479
+ fill: '#051039',
480
+ opacity: 0.67
481
+ },
482
+ playerTimeMarkers: {
483
+ fill: '#2C2C2C'
484
+ },
485
+ playerTimeText: {
486
+ color: '#FFFFFF',
487
+ fontFamily: 'Roboto',
488
+ fontSize: 14
489
+ },
490
+ // timeline
491
+ timelineIndicator: {
492
+ fill: '#767676'
493
+ },
494
+ timelineText: {
495
+ fontSize: 14,
496
+ color: '#051039',
497
+ fontFamily: 'Roboto'
498
+ },
499
+ timelineTimeScale: {
500
+ fill: '#979797'
501
+ },
502
+ timelineNightTime: {
503
+ fill: '#070808',
504
+ opacity: 0.1
505
+ },
506
+ timelineTimelineSurface: {
507
+ fill: '#FFFFFF'
508
+ },
509
+ timelineMonthChangeDash: {
510
+ fill: '#767676',
511
+ opacity: 0.5
512
+ },
513
+ // time scale
514
+ timeScaleText: {
515
+ fontSize: 12
516
+ },
517
+ timeScalePointer: {
518
+ fill: '#F8F9F9'
519
+ },
520
+ timeScaleHorizontalScale: {
521
+ fill: '#070808',
522
+ opacity: 0.2
523
+ },
524
+ timeScaleTimeIndicators: {
525
+ fill: '#767676'
526
+ },
527
+ timeScaleTimeIndicatorsActive: {
528
+ fill: '#051039'
529
+ },
530
+ timeScaleShadowButtonScale: {
531
+ filter: 'drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.28)) drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.24)) drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.40))'
532
+ }
533
+ },
534
+ customSlider: {
535
+ rail: '#488BFD',
536
+ railDisabled: '#CCCCCC',
537
+ track: '#186DFF',
538
+ trackDisabled: '#CCCCCC',
539
+ thumb: '#F8F9F9',
540
+ thumbDisabled: '#CCCCCC',
541
+ mark: '#FFFFFF',
542
+ markDisabled: '#FFFFFF',
543
+ switchTrack: '#72BB23',
544
+ switchTrackDisabled: '#767676'
545
+ },
546
+ syncGroups: {
547
+ drawerOpen: {
548
+ fill: '#E8E5E5'
549
+ }
550
+ },
551
+ layerManager: {
552
+ tableRowDefaultIcon: {
553
+ fill: '#051039',
554
+ opacity: 0.67
555
+ },
556
+ tableRowDefaultText: {
557
+ color: '#051039',
558
+ opacity: 0.87,
559
+ fontSize: 12
560
+ },
561
+ tableRowDefaultCardContainer: {
562
+ fill: '#FFFFFF',
563
+ border: '1px solid #EEEEEE'
564
+ },
565
+ tableRowMouseover: {
566
+ fill: '#051039',
567
+ opacity: 0.07
568
+ },
569
+ tableRowDisabledIcon: {
570
+ fill: '#767676'
571
+ },
572
+ tableRowDisabledText: {
573
+ color: '#767676',
574
+ opacity: 0.87,
575
+ fontSize: 12
576
+ },
577
+ tableRowDisabledCardContainer: {
578
+ fill: '#F5F5F5',
579
+ border: '1px solid #EEEEEE'
580
+ }
581
+ },
582
+ tooltips: {
583
+ tooltipContainer: {
584
+ fill: '#232323',
585
+ opacity: 1
586
+ },
587
+ tooltipText: {
588
+ color: '#FFFFFF'
589
+ }
590
+ },
591
+ captions: {
592
+ captionStatus: {
593
+ color: '#051039',
594
+ opacity: 0.67
595
+ },
596
+ captionInformation: {
597
+ color: '#1100FF',
598
+ opacity: 1
599
+ },
600
+ captionError: {
601
+ color: '#C00000',
602
+ opacity: 1
603
+ },
604
+ captionDisabled: {
605
+ color: '#767676',
606
+ opacity: 1
607
+ }
608
+ }
609
+ }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/609bb6a5287bd1abe0de39a7
610
+
611
+ var elevations$1 = {
612
+ elevation_01: '0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
613
+ elevation_02: '0 1px 5px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.14)',
614
+ elevation_03: '0 1px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 3px 3px 0 rgba(0, 0, 0, 0.14)',
615
+ elevation_04: '0 1px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.14)',
616
+ elevation_06: '0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14)',
617
+ elevation_08: '0 4px 5px 0 rgba(0, 0, 0, 0.2), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)',
618
+ elevation_09: '0 5px 6px 0 rgba(0, 0, 0, 0.2), 0 3px 16px 2px rgba(0, 0, 0, 0.12), 0 9px 12px 1px rgba(0, 0, 0, 0.14)',
619
+ elevation_12: '0 7px 8px 0 rgba(0, 0, 0, 0.2), 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 12px 17px 2px rgba(0, 0, 0, 0.14)',
620
+ elevation_16: '0 8px 10px 0 rgba(0, 0, 0, 0.2), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 16px 24px 2px rgba(0, 0, 0, 0.14)',
621
+ elevation_24: '0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.14)'
622
+ };
623
+ var lightTheme = createTheme('light', parseColors(colors$1), createShadows(elevations$1));
624
+
625
+ var geowebColors = __assign({}, colors$1);
626
+
627
+ var GWTheme = core.createMuiTheme({
628
+ palette: {
629
+ secondary: {
630
+ main: '#0075a9'
631
+ },
632
+ action: {
633
+ active: '#ffa800'
634
+ },
635
+ text: {
636
+ disabled: '#051039'
637
+ },
638
+ geowebColors: parseColors(geowebColors)
639
+ },
640
+ shape: {
641
+ borderRadius: 3
642
+ },
643
+ typography: {
644
+ h6: {
645
+ fontSize: '16px'
646
+ },
647
+ subtitle1: {
648
+ fontSize: '16px',
649
+ fontWeight: 500,
650
+ lineHeight: 1.5,
651
+ letterSpacing: '0.15px',
652
+ opacity: 0.87,
653
+ color: '#051039'
654
+ },
655
+ subtitle2: {
656
+ fontSize: '14px',
657
+ fontWeight: 500,
658
+ lineHeight: 1.71,
659
+ letterSpacing: '0.1px',
660
+ opacity: 0.87,
661
+ color: '#051039'
662
+ },
663
+ body1: {
664
+ fontSize: '16px',
665
+ lineHeight: 1.56,
666
+ letterSpacing: '0.44px',
667
+ color: '#051039'
668
+ },
669
+ body2: {
670
+ fontSize: '14px',
671
+ lineHeight: 1.43,
672
+ letterSpacing: '0.25px',
673
+ color: '#051039'
674
+ },
675
+ overline: {
676
+ textTransform: 'none',
677
+ fontSize: '12px',
678
+ lineHeight: 1.43,
679
+ letterSpacing: '0.25px',
680
+ color: '#051039',
681
+ opacity: 0.7
682
+ },
683
+ caption: {
684
+ fontSize: '12px',
685
+ lineHeight: 1.33,
686
+ letterSpacing: '0.4px',
687
+ color: '#051039',
688
+ opacity: 0.7
689
+ },
690
+ button: {
691
+ fontWeight: 500,
692
+ fontSize: '14px',
693
+ color: '0075a9'
694
+ }
695
+ },
696
+ overrides: {
697
+ MuiTooltip: {
698
+ tooltip: {
699
+ borderRadius: '2px',
700
+ fontSize: '16px',
701
+ fontWeight: 'normal',
702
+ padding: '10px',
703
+ backgroundColor: '#232323'
704
+ }
705
+ },
706
+ MuiIconButton: {
707
+ root: {
708
+ color: '#0075a9'
709
+ }
710
+ },
711
+ MuiCheckbox: {
712
+ root: {
713
+ color: '#0075a9'
714
+ }
715
+ },
716
+ MuiSelect: {
717
+ icon: {
718
+ color: '#0075a9'
719
+ },
720
+ select: {
721
+ '&:focus': {
722
+ backgroundColor: 'rgba(0, 117, 169, 0.05)'
723
+ }
724
+ }
725
+ },
726
+ MuiAlert: {
727
+ standardError: {
728
+ border: '1px solid #c00000',
729
+ borderRadius: '0px',
730
+ backgroundColor: '#fff0ea'
731
+ },
732
+ standardWarning: {
733
+ border: '1px solid #ffa800',
734
+ borderRadius: '0px',
735
+ backgroundColor: '#fff8eb'
736
+ },
737
+ standardInfo: {
738
+ border: '1px solid #0062e6',
739
+ borderRadius: '0px',
740
+ backgroundColor: '#eaf3ff'
741
+ },
742
+ standardSuccess: {
743
+ border: '1px solid #72bb23',
744
+ borderRadius: '0px',
745
+ backgroundColor: '#fcffeb'
746
+ },
747
+ action: {
748
+ color: '#0075a9'
749
+ },
750
+ message: {
751
+ fontSize: '14px',
752
+ lineHeight: 1.43,
753
+ letterSpacing: '0.25px',
754
+ color: '#051039'
755
+ }
756
+ },
757
+ MuiTabs: {
758
+ root: {
759
+ backgroundColor: '#ffffff',
760
+ minHeight: '30px'
761
+ },
762
+ scrollButtons: {
763
+ width: '20px'
764
+ }
765
+ },
766
+ MuiTab: {
767
+ root: {
768
+ minHeight: '30px',
769
+ textTransform: 'none',
770
+ minWidth: '76px',
771
+ '@media (min-width: 600px)': {
772
+ minWidth: '76px'
773
+ }
774
+ },
775
+ labelIcon: {
776
+ minHeight: '30px'
777
+ }
778
+ },
779
+ MuiListItem: {
780
+ root: {
781
+ '&$selected': {
782
+ backgroundColor: 'rgba(0, 117, 169, 0.15)',
783
+ borderLeft: '4px solid #0075a9',
784
+ '&:hover': {
785
+ backgroundColor: 'rgba(0, 117, 169, 0.10)'
786
+ }
787
+ }
788
+ },
789
+ button: {
790
+ '&:hover': {
791
+ backgroundColor: 'rgba(0, 117, 169, 0.15)'
792
+ }
793
+ }
794
+ },
795
+ MuiFormLabel: {
796
+ root: {
797
+ color: 'rgba(5, 16, 57, 0.7)',
798
+ '&$focused': {
799
+ color: '#0075a9'
800
+ }
801
+ }
802
+ },
803
+ MuiOutlinedInput: {
804
+ root: {
805
+ '&$focused $notchedOutline': {
806
+ borderColor: '#0075a9'
807
+ }
808
+ }
809
+ },
810
+ MuiFilledInput: {
811
+ root: {
812
+ backgroundColor: 'rgba(0, 117, 169, 0.05)',
813
+ color: '#051039',
814
+ '&$disabled': {
815
+ backgroundColor: 'transparent'
816
+ }
817
+ },
818
+ underline: {
819
+ '&$disabled:before': {
820
+ borderBottomStyle: 'none'
821
+ }
822
+ }
823
+ },
824
+ MuiCardContent: {
825
+ root: {
826
+ '&:last-child': {
827
+ paddingBottom: 0
828
+ }
829
+ }
830
+ }
831
+ }
832
+ });
833
+
834
+ /* *
835
+ * Licensed under the Apache License, Version 2.0 (the "License");
836
+ * you may not use this file except in compliance with the License.
837
+ * You may obtain a copy of the License at
838
+ *
839
+ * http://www.apache.org/licenses/LICENSE-2.0
840
+ *
841
+ * Unless required by applicable law or agreed to in writing, software
842
+ * distributed under the License is distributed on an "AS IS" BASIS,
843
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
844
+ * See the License for the specific language governing permissions and
845
+ * limitations under the License.
846
+ *
847
+ * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
848
+ * Copyright 2021 - Finnish Meteorological Institute (FMI)
849
+ * */
850
+
851
+ var colors = {
852
+ background: {
853
+ surface: '#303030',
854
+ surfaceApp: '#2B2B2B',
855
+ surfaceBrowser: '#181818'
856
+ },
857
+ brand: {
858
+ brand: '#404040'
859
+ },
860
+ buttons: {
861
+ primary: {
862
+ fill: '#186DFF'
863
+ },
864
+ primaryMouseover: {
865
+ fill: '#1047B0'
866
+ },
867
+ primaryActive: {
868
+ fill: '#186DFF'
869
+ },
870
+ flatMouseover: {
871
+ fill: '#242424'
872
+ },
873
+ focusDefault: {
874
+ outline: 'solid 2px #419cfe'
875
+ },
876
+ disabled: {
877
+ fill: '#303030'
878
+ },
879
+ surfaceIconDefault: {
880
+ fill: '#2B2B2B'
881
+ }
882
+ },
883
+ typographyAndIcons: {
884
+ text: '#FFFFFF',
885
+ icon: '#FFFFFF',
886
+ buttonIcon: '#FFFFFF',
887
+ iconLinkActive: '#488BFD',
888
+ iconLinkDisabled: '#5E5E5E',
889
+ textLinkActive: '#488BFD',
890
+ buttonIconTertiaryFlat: '#C5C5C5'
891
+ },
892
+ textInputField: {
893
+ "default": {
894
+ fill: '#000000',
895
+ opacity: 0.15
896
+ },
897
+ active: {
898
+ fill: '#909090',
899
+ opacity: 0.2
900
+ },
901
+ disabled: {
902
+ color: '#000000',
903
+ opacity: 0
904
+ }
905
+ },
906
+ tab: {
907
+ mouseOver: {
908
+ fill: '#000000',
909
+ opacity: 0.17
910
+ }
911
+ },
912
+ greys: {
913
+ accessible: '#A2A2A2'
914
+ },
915
+ cards: {
916
+ cardContainer: '#303030',
917
+ cardContainerBorder: '#404040'
918
+ },
919
+ backdrops: {
920
+ black: {
921
+ fill: '#000000',
922
+ opacity: 0.5
923
+ },
924
+ white: {
925
+ fill: '#FFFFFF',
926
+ opacity: 0.24
927
+ }
928
+ },
929
+ timeSlider: {
930
+ // player
931
+ playerNeedleTimeTop: {
932
+ fill: '#E3004F',
933
+ opacity: 100
934
+ },
935
+ playerNeedleTime: {
936
+ fill: '#FFD523',
937
+ opacity: 0.75
938
+ },
939
+ playerNeedlePlayerTop: {
940
+ fill: '#051039',
941
+ opacity: 100
942
+ },
943
+ playerNeedlePlayer: {
944
+ fill: '#67F0FF',
945
+ opacity: 0.75
946
+ },
947
+ playerRailObservation: {
948
+ fill: '#0876B6',
949
+ opacity: 100
950
+ },
951
+ playerRailSelection: {
952
+ fill: '#C6D111',
953
+ opacity: 0.5
954
+ },
955
+ playerRailForecastData: {
956
+ fill: '#FD64FF',
957
+ opacity: 0.6
958
+ },
959
+ playerRailForecastNoData: {
960
+ fill: '#051039',
961
+ opacity: 0.67
962
+ },
963
+ playerTimeMarkers: {
964
+ fill: '#2C2C2C'
965
+ },
966
+ playerTimeText: {
967
+ color: '#FFFFFF',
968
+ fontFamily: 'Roboto',
969
+ fontSize: 14
970
+ },
971
+ // timeline
972
+ timelineIndicator: {
973
+ fill: '#A2A2A2'
974
+ },
975
+ timelineText: {
976
+ fontSize: 14,
977
+ color: '#FFFFFF',
978
+ fontFamily: 'Roboto'
979
+ },
980
+ timelineTimeScale: {
981
+ fill: '#979797'
982
+ },
983
+ timelineNightTime: {
984
+ fill: '#070808',
985
+ opacity: 0.3
986
+ },
987
+ timelineTimelineSurface: {
988
+ fill: '#303030'
989
+ },
990
+ timelineMonthChangeDash: {
991
+ fill: '#A2A2A2',
992
+ opacity: 0.5
993
+ },
994
+ // time scale
995
+ timeScaleText: {
996
+ fontSize: 12
997
+ },
998
+ timeScalePointer: {
999
+ fill: '#F8F9F9'
1000
+ },
1001
+ timeScaleHorizontalScale: {
1002
+ fill: '#000000',
1003
+ opacity: 0.8
1004
+ },
1005
+ timeScaleTimeIndicators: {
1006
+ fill: '#A2A2A2'
1007
+ },
1008
+ timeScaleTimeIndicatorsActive: {
1009
+ fill: '#FFFFFF'
1010
+ },
1011
+ timeScaleShadowButtonScale: {
1012
+ filter: 'drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.28)) drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.24)) drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.40))'
1013
+ }
1014
+ },
1015
+ customSlider: {
1016
+ rail: '#488BFD',
1017
+ railDisabled: '#5E5E5E',
1018
+ track: '#186DFF',
1019
+ trackDisabled: '#5E5E5E',
1020
+ thumb: '#F8F9F9',
1021
+ thumbDisabled: '#5E5E5E',
1022
+ mark: '#FFFFFF',
1023
+ markDisabled: '#303030',
1024
+ switchTrack: '#72BB23',
1025
+ switchTrackDisabled: '#E8E5E5'
1026
+ },
1027
+ syncGroups: {
1028
+ drawerOpen: {
1029
+ fill: '#232323'
1030
+ }
1031
+ },
1032
+ layerManager: {
1033
+ tableRowDefaultIcon: {
1034
+ fill: '#C5C5C5',
1035
+ opacity: 1
1036
+ },
1037
+ tableRowDefaultText: {
1038
+ color: '#FFFFFF',
1039
+ opacity: 0.87,
1040
+ fontSize: 12
1041
+ },
1042
+ tableRowDefaultCardContainer: {
1043
+ fill: '#303030',
1044
+ border: '1px solid #404040'
1045
+ },
1046
+ tableRowMouseover: {
1047
+ fill: '#000000',
1048
+ opacity: 0.15
1049
+ },
1050
+ tableRowDisabledIcon: {
1051
+ fill: '#A2A2A2'
1052
+ },
1053
+ tableRowDisabledText: {
1054
+ color: '#909090',
1055
+ opacity: 0.87,
1056
+ fontSize: 12
1057
+ },
1058
+ tableRowDisabledCardContainer: {
1059
+ fill: '#2B2B2B',
1060
+ border: '1px solid #404040'
1061
+ }
1062
+ },
1063
+ tooltips: {
1064
+ tooltipContainer: {
1065
+ fill: '#232323',
1066
+ opacity: 1
1067
+ },
1068
+ tooltipText: {
1069
+ color: '#FFFFFF'
1070
+ }
1071
+ },
1072
+ captions: {
1073
+ captionStatus: {
1074
+ color: '#FFFFFF',
1075
+ opacity: 0.7
1076
+ },
1077
+ captionInformation: {
1078
+ color: '#9EC2FF',
1079
+ opacity: 1
1080
+ },
1081
+ captionError: {
1082
+ color: '#FF8F8F',
1083
+ opacity: 1
1084
+ },
1085
+ captionDisabled: {
1086
+ color: '#909090',
1087
+ opacity: 1
1088
+ }
1089
+ }
1090
+ }; // https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/6093e694124ecf3886de76d4
1091
+
1092
+ var elevations = {
1093
+ elevation_01: '0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)',
1094
+ elevation_02: '0 1px 5px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.14)',
1095
+ elevation_03: '0 1px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 3px 3px 0 rgba(0, 0, 0, 0.14)',
1096
+ elevation_04: '0 1px 10px 0 rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.14)',
1097
+ elevation_06: '0 3px 5px 0 rgba(0, 0, 0, 0.2), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 6px 10px 0 rgba(0, 0, 0, 0.14)',
1098
+ elevation_08: '0 4px 5px 0 rgba(0, 0, 0, 0.2), 0 3px 14px 3px rgba(0, 0, 0, 0.12), 0 8px 10px 1px rgba(0, 0, 0, 0.14)',
1099
+ elevation_09: '0 5px 6px 0 rgba(0, 0, 0, 0.2), 0 3px 16px 2px rgba(0, 0, 0, 0.12), 0 9px 12px 1px rgba(0, 0, 0, 0.14)',
1100
+ elevation_12: '0 7px 8px 0 rgba(0, 0, 0, 0.2), 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 12px 17px 2px rgba(0, 0, 0, 0.14)',
1101
+ elevation_16: '0 8px 10px 0 rgba(0, 0, 0, 0.2), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 16px 24px 2px rgba(0, 0, 0, 0.14)',
1102
+ elevation_24: '0 11px 15px 0 rgba(0, 0, 0, 0.2), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 24px 38px 3px rgba(0, 0, 0, 0.14)'
1103
+ };
1104
+ var darkTheme = createTheme('dark', parseColors(colors), createShadows(elevations));
1105
+
1106
+ var ThemeContext = /*#__PURE__*/React__namespace.createContext({
1107
+ toggleTheme: null,
1108
+ isDark: null
1109
+ });
1110
+ var ThemeProvider = function ThemeProvider(_a) {
1111
+ var children = _a.children,
1112
+ _b = _a.theme,
1113
+ defaultTheme = _b === void 0 ? lightTheme : _b,
1114
+ _c = _a.disableCssBaseline,
1115
+ disableCssBaseline = _c === void 0 ? false : _c;
1116
+
1117
+ var _d = __read(React__namespace.useState(false), 2),
1118
+ isDark = _d[0],
1119
+ setDark = _d[1];
1120
+
1121
+ var currentTheme = React__namespace.useMemo(function () {
1122
+ return isDark ? darkTheme : defaultTheme;
1123
+ }, [isDark, defaultTheme]);
1124
+
1125
+ var toggleTheme = function toggleTheme() {
1126
+ return setDark(!isDark);
1127
+ };
1128
+
1129
+ return /*#__PURE__*/React__namespace.createElement(ThemeContext.Provider, {
1130
+ value: {
1131
+ toggleTheme: toggleTheme,
1132
+ isDark: isDark
1133
+ }
1134
+ }, /*#__PURE__*/React__namespace.createElement(core.ThemeProvider, {
1135
+ theme: currentTheme
1136
+ }, !disableCssBaseline && /*#__PURE__*/React__namespace.createElement(core.CssBaseline, null), children));
1137
+ };
1138
+ var useThemeContext = function useThemeContext() {
1139
+ return React__namespace.useContext(ThemeContext);
1140
+ }; // Wrapper for storybook stories. Will include later an additional wrapper after upgrade to MUI5
1141
+
1142
+ var ThemeWrapper = function ThemeWrapper(_a) {
1143
+ var children = _a.children,
1144
+ _b = _a.theme,
1145
+ theme = _b === void 0 ? lightTheme : _b,
1146
+ _c = _a.disableCssBaseline,
1147
+ disableCssBaseline = _c === void 0 ? false : _c;
1148
+ return /*#__PURE__*/React__namespace.createElement(ThemeProvider, {
1149
+ theme: theme,
1150
+ disableCssBaseline: disableCssBaseline
1151
+ }, children);
1152
+ }; // Wrapper for storybook stories with GWTheme. Will be deprecated
1153
+
1154
+ var ThemeWrapperOldTheme = function ThemeWrapperOldTheme(_a) {
1155
+ var children = _a.children,
1156
+ props = __rest(_a, ["children"]);
1157
+
1158
+ return /*#__PURE__*/React__namespace.createElement(ThemeWrapper, __assign({
1159
+ theme: GWTheme,
1160
+ disableCssBaseline: true
1161
+ }, props), children);
1162
+ };
1163
+
1164
+ exports.GWTheme = GWTheme;
1165
+ exports.ThemeContext = ThemeContext;
1166
+ exports.ThemeProvider = ThemeProvider;
1167
+ exports.ThemeWrapper = ThemeWrapper;
1168
+ exports.ThemeWrapperOldTheme = ThemeWrapperOldTheme;
1169
+ exports.darkTheme = darkTheme;
1170
+ exports.lightTheme = lightTheme;
1171
+ exports.useThemeContext = useThemeContext;
1172
+
1173
+ Object.defineProperty(exports, '__esModule', { value: true });
1174
+
1175
+ }));