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