@opengeoweb/theme 4.18.0 → 4.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +240 -41
- package/index.umd.js +247 -47
- package/lib/stories/snapshots/IconButton.stories.d.ts +18 -2
- package/lib/types.d.ts +15 -13
- package/lib/utils/buttonStyles.d.ts +6 -5
- package/package.json +3 -2
package/index.esm.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SvgIcon, createTheme as createTheme$1, ThemeProvider as ThemeProvider$1, CssBaseline, StyledEngineProvider } from '@mui/material';
|
|
3
|
+
import { renderTimeViewClock } from '@mui/x-date-pickers';
|
|
3
4
|
|
|
4
5
|
/*! *****************************************************************************
|
|
5
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -868,31 +869,6 @@ function _nonIterableRest() {
|
|
|
868
869
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
869
870
|
}
|
|
870
871
|
|
|
871
|
-
/* *
|
|
872
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
873
|
-
* you may not use this file except in compliance with the License.
|
|
874
|
-
* You may obtain a copy of the License at
|
|
875
|
-
*
|
|
876
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
877
|
-
*
|
|
878
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
879
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
880
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
881
|
-
* See the License for the specific language governing permissions and
|
|
882
|
-
* limitations under the License.
|
|
883
|
-
*
|
|
884
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
885
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
886
|
-
* */
|
|
887
|
-
var ThemeTypes;
|
|
888
|
-
|
|
889
|
-
(function (ThemeTypes) {
|
|
890
|
-
ThemeTypes["DARK_THEME"] = "darkTheme";
|
|
891
|
-
ThemeTypes["LIGHT_THEME"] = "lightTheme";
|
|
892
|
-
})(ThemeTypes || (ThemeTypes = {}));
|
|
893
|
-
|
|
894
|
-
var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed', 'icon'];
|
|
895
|
-
|
|
896
872
|
var BORDER_RADIUS = 3;
|
|
897
873
|
var defaultButtonStyle = function defaultButtonStyle(button) {
|
|
898
874
|
return {
|
|
@@ -956,23 +932,44 @@ var buttonStyle = function buttonStyle(button) {
|
|
|
956
932
|
}
|
|
957
933
|
});
|
|
958
934
|
};
|
|
959
|
-
var
|
|
960
|
-
return
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
935
|
+
var iconButtonStyle = function iconButtonStyle(button) {
|
|
936
|
+
return Object.assign(Object.assign({}, defaultButtonStyle(button)), {
|
|
937
|
+
borderStyle: 'solid',
|
|
938
|
+
borderWidth: '1px',
|
|
939
|
+
borderColor: button["default"].borderColor,
|
|
940
|
+
// size styling
|
|
941
|
+
'&[class*="sizeSmall"]': {
|
|
942
|
+
width: 24,
|
|
943
|
+
height: 24
|
|
944
|
+
},
|
|
945
|
+
'&[class*="sizeMedium"]': {
|
|
946
|
+
width: 32,
|
|
947
|
+
height: 32
|
|
948
|
+
},
|
|
949
|
+
'&[class*="sizeLarge"]': {
|
|
950
|
+
width: 40,
|
|
951
|
+
height: 40
|
|
952
|
+
}
|
|
953
|
+
});
|
|
965
954
|
};
|
|
966
955
|
var buttonVariants = function buttonVariants(buttons) {
|
|
967
|
-
|
|
956
|
+
var stylingFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : buttonStyle;
|
|
957
|
+
return Object.keys(buttons).map(function (variant) {
|
|
968
958
|
return {
|
|
969
959
|
props: {
|
|
970
960
|
variant: variant
|
|
971
961
|
},
|
|
972
|
-
style:
|
|
962
|
+
style: stylingFn(buttons[variant])
|
|
973
963
|
};
|
|
974
964
|
});
|
|
975
965
|
};
|
|
966
|
+
var variantsToClassName = function variantsToClassName(buttonVariants) {
|
|
967
|
+
return buttonVariants.reduce(function (variants, _ref) {
|
|
968
|
+
var variant = _ref.props.variant,
|
|
969
|
+
style = _ref.style;
|
|
970
|
+
return Object.assign(Object.assign({}, variants), _defineProperty({}, "&.".concat(variant), style));
|
|
971
|
+
}, {});
|
|
972
|
+
};
|
|
976
973
|
|
|
977
974
|
/* *
|
|
978
975
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1256,8 +1253,93 @@ var colors$1 = {
|
|
|
1256
1253
|
borderColor: 'transparent'
|
|
1257
1254
|
},
|
|
1258
1255
|
focus: focusButtonStyle$1
|
|
1256
|
+
}
|
|
1257
|
+
},
|
|
1258
|
+
iconButtons: {
|
|
1259
|
+
flat: {
|
|
1260
|
+
"default": {
|
|
1261
|
+
fill: 'transparent',
|
|
1262
|
+
color: '#374061',
|
|
1263
|
+
borderColor: 'transparent'
|
|
1264
|
+
},
|
|
1265
|
+
mouseOver: {
|
|
1266
|
+
fill: '#E0E8F5',
|
|
1267
|
+
color: '#374061',
|
|
1268
|
+
borderColor: 'transparent'
|
|
1269
|
+
},
|
|
1270
|
+
active: {
|
|
1271
|
+
fill: 'transparent',
|
|
1272
|
+
color: '#186DFF',
|
|
1273
|
+
borderColor: 'transparent'
|
|
1274
|
+
},
|
|
1275
|
+
activeMouseOver: {
|
|
1276
|
+
fill: '#E0E8F5',
|
|
1277
|
+
color: '#186DFF',
|
|
1278
|
+
borderColor: 'transparent'
|
|
1279
|
+
},
|
|
1280
|
+
disabled: {
|
|
1281
|
+
fill: 'transparent',
|
|
1282
|
+
color: '#626262',
|
|
1283
|
+
borderColor: 'transparent'
|
|
1284
|
+
},
|
|
1285
|
+
focus: focusButtonStyle$1
|
|
1259
1286
|
},
|
|
1260
|
-
|
|
1287
|
+
tool: {
|
|
1288
|
+
"default": {
|
|
1289
|
+
fill: '#ECEDEE',
|
|
1290
|
+
color: '#374061',
|
|
1291
|
+
borderColor: 'transparent'
|
|
1292
|
+
},
|
|
1293
|
+
mouseOver: {
|
|
1294
|
+
fill: '#E0E8F5',
|
|
1295
|
+
color: '#374061',
|
|
1296
|
+
borderColor: 'transparent'
|
|
1297
|
+
},
|
|
1298
|
+
active: {
|
|
1299
|
+
fill: '#186DFF',
|
|
1300
|
+
color: '#FFFFFF',
|
|
1301
|
+
borderColor: 'transparent'
|
|
1302
|
+
},
|
|
1303
|
+
activeMouseOver: {
|
|
1304
|
+
fill: '#1047B0',
|
|
1305
|
+
color: '#FFFFFF',
|
|
1306
|
+
borderColor: 'transparent'
|
|
1307
|
+
},
|
|
1308
|
+
disabled: {
|
|
1309
|
+
fill: 'transparent',
|
|
1310
|
+
color: '#626262',
|
|
1311
|
+
borderColor: 'transparent'
|
|
1312
|
+
},
|
|
1313
|
+
focus: focusButtonStyle$1
|
|
1314
|
+
},
|
|
1315
|
+
boxed: {
|
|
1316
|
+
"default": {
|
|
1317
|
+
fill: 'transparent',
|
|
1318
|
+
color: '#374061',
|
|
1319
|
+
borderColor: '#374061'
|
|
1320
|
+
},
|
|
1321
|
+
mouseOver: {
|
|
1322
|
+
fill: '#E0E8F5',
|
|
1323
|
+
color: '#374061',
|
|
1324
|
+
borderColor: '#374061'
|
|
1325
|
+
},
|
|
1326
|
+
active: {
|
|
1327
|
+
fill: '#186DFF',
|
|
1328
|
+
color: '#FFFFFF',
|
|
1329
|
+
borderColor: 'transparent'
|
|
1330
|
+
},
|
|
1331
|
+
activeMouseOver: {
|
|
1332
|
+
fill: '#1047B0',
|
|
1333
|
+
color: '#FFFFFF',
|
|
1334
|
+
borderColor: 'transparent'
|
|
1335
|
+
},
|
|
1336
|
+
disabled: {
|
|
1337
|
+
fill: 'transparent',
|
|
1338
|
+
color: '#626262',
|
|
1339
|
+
borderColor: 'transparent'
|
|
1340
|
+
},
|
|
1341
|
+
focus: focusButtonStyle$1
|
|
1342
|
+
}
|
|
1261
1343
|
},
|
|
1262
1344
|
typographyAndIcons: {
|
|
1263
1345
|
text: '#051039',
|
|
@@ -1294,7 +1376,7 @@ var colors$1 = {
|
|
|
1294
1376
|
}
|
|
1295
1377
|
},
|
|
1296
1378
|
greys: {
|
|
1297
|
-
accessible: '#
|
|
1379
|
+
accessible: '#626262',
|
|
1298
1380
|
accessibleLight: '#C5C5C5'
|
|
1299
1381
|
},
|
|
1300
1382
|
cards: {
|
|
@@ -1627,7 +1709,7 @@ var createTheme = function createTheme(_ref) {
|
|
|
1627
1709
|
focusRipple: false
|
|
1628
1710
|
},
|
|
1629
1711
|
styleOverrides: {
|
|
1630
|
-
root: defaultButtonStyle(geowebColors.
|
|
1712
|
+
root: Object.assign(Object.assign({}, defaultButtonStyle(geowebColors.iconButtons.flat)), variantsToClassName(buttonVariants(geowebColors.iconButtons, iconButtonStyle)))
|
|
1631
1713
|
}
|
|
1632
1714
|
},
|
|
1633
1715
|
MuiCssBaseline: {
|
|
@@ -1828,7 +1910,7 @@ var createTheme = function createTheme(_ref) {
|
|
|
1828
1910
|
},
|
|
1829
1911
|
'&.Mui-focusVisible': {
|
|
1830
1912
|
backgroundColor: geowebColors.cards.cardContainerMouseOver,
|
|
1831
|
-
outline: geowebColors.buttons.
|
|
1913
|
+
outline: geowebColors.buttons.primary.focus.outline
|
|
1832
1914
|
},
|
|
1833
1915
|
' .MuiListItemIcon-root': {
|
|
1834
1916
|
minWidth: 40
|
|
@@ -1938,7 +2020,7 @@ var createTheme = function createTheme(_ref) {
|
|
|
1938
2020
|
backgroundColor: geowebColors.textInputField.disabled.rgba
|
|
1939
2021
|
},
|
|
1940
2022
|
'&.Mui-error': {
|
|
1941
|
-
'&:
|
|
2023
|
+
'&:before': {
|
|
1942
2024
|
borderColor: geowebColors.captions.captionError.color
|
|
1943
2025
|
}
|
|
1944
2026
|
},
|
|
@@ -2088,6 +2170,15 @@ var createTheme = function createTheme(_ref) {
|
|
|
2088
2170
|
paddingRight: '5px'
|
|
2089
2171
|
}
|
|
2090
2172
|
}
|
|
2173
|
+
},
|
|
2174
|
+
MuiDesktopDateTimePicker: {
|
|
2175
|
+
defaultProps: {
|
|
2176
|
+
viewRenderers: {
|
|
2177
|
+
hours: renderTimeViewClock,
|
|
2178
|
+
minutes: renderTimeViewClock,
|
|
2179
|
+
seconds: renderTimeViewClock
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2091
2182
|
}
|
|
2092
2183
|
}
|
|
2093
2184
|
});
|
|
@@ -2310,8 +2401,93 @@ var colors = {
|
|
|
2310
2401
|
borderColor: 'transparent'
|
|
2311
2402
|
},
|
|
2312
2403
|
focus: focusButtonStyle
|
|
2404
|
+
}
|
|
2405
|
+
},
|
|
2406
|
+
iconButtons: {
|
|
2407
|
+
flat: {
|
|
2408
|
+
"default": {
|
|
2409
|
+
fill: 'transparent',
|
|
2410
|
+
color: '#F8F9F9',
|
|
2411
|
+
borderColor: 'transparent'
|
|
2412
|
+
},
|
|
2413
|
+
mouseOver: {
|
|
2414
|
+
fill: '#414751',
|
|
2415
|
+
color: '#F8F9F9',
|
|
2416
|
+
borderColor: 'transparent'
|
|
2417
|
+
},
|
|
2418
|
+
active: {
|
|
2419
|
+
fill: 'transparent',
|
|
2420
|
+
color: '#7BACFF',
|
|
2421
|
+
borderColor: 'transparent'
|
|
2422
|
+
},
|
|
2423
|
+
activeMouseOver: {
|
|
2424
|
+
fill: '#414751',
|
|
2425
|
+
color: '#7BACFF',
|
|
2426
|
+
borderColor: 'transparent'
|
|
2427
|
+
},
|
|
2428
|
+
disabled: {
|
|
2429
|
+
fill: 'transparent',
|
|
2430
|
+
color: '#B4B4B4',
|
|
2431
|
+
borderColor: 'transparent'
|
|
2432
|
+
},
|
|
2433
|
+
focus: focusButtonStyle
|
|
2313
2434
|
},
|
|
2314
|
-
|
|
2435
|
+
tool: {
|
|
2436
|
+
"default": {
|
|
2437
|
+
fill: '#393939',
|
|
2438
|
+
color: '#F8F9F9',
|
|
2439
|
+
borderColor: 'transparent'
|
|
2440
|
+
},
|
|
2441
|
+
mouseOver: {
|
|
2442
|
+
fill: '#414751',
|
|
2443
|
+
color: '#F8F9F9',
|
|
2444
|
+
borderColor: 'transparent'
|
|
2445
|
+
},
|
|
2446
|
+
active: {
|
|
2447
|
+
fill: '#186DFF',
|
|
2448
|
+
color: '#FFFFFF',
|
|
2449
|
+
borderColor: 'transparent'
|
|
2450
|
+
},
|
|
2451
|
+
activeMouseOver: {
|
|
2452
|
+
fill: '#1047B0',
|
|
2453
|
+
color: '#FFFFFF',
|
|
2454
|
+
borderColor: 'transparent'
|
|
2455
|
+
},
|
|
2456
|
+
disabled: {
|
|
2457
|
+
fill: 'transparent',
|
|
2458
|
+
color: '#B4B4B4',
|
|
2459
|
+
borderColor: 'transparent'
|
|
2460
|
+
},
|
|
2461
|
+
focus: focusButtonStyle
|
|
2462
|
+
},
|
|
2463
|
+
boxed: {
|
|
2464
|
+
"default": {
|
|
2465
|
+
fill: 'transparent',
|
|
2466
|
+
color: '#F8F9F9',
|
|
2467
|
+
borderColor: '#F8F9F9'
|
|
2468
|
+
},
|
|
2469
|
+
mouseOver: {
|
|
2470
|
+
fill: '#414751',
|
|
2471
|
+
color: '#F8F9F9',
|
|
2472
|
+
borderColor: '#F8F9F9'
|
|
2473
|
+
},
|
|
2474
|
+
active: {
|
|
2475
|
+
fill: '#186DFF',
|
|
2476
|
+
color: '#FFFFFF',
|
|
2477
|
+
borderColor: 'transparent'
|
|
2478
|
+
},
|
|
2479
|
+
activeMouseOver: {
|
|
2480
|
+
fill: '#1047B0',
|
|
2481
|
+
color: '#FFFFFF',
|
|
2482
|
+
borderColor: 'transparent'
|
|
2483
|
+
},
|
|
2484
|
+
disabled: {
|
|
2485
|
+
fill: 'transparent',
|
|
2486
|
+
color: '#B4B4B4',
|
|
2487
|
+
borderColor: 'transparent'
|
|
2488
|
+
},
|
|
2489
|
+
focus: focusButtonStyle
|
|
2490
|
+
}
|
|
2315
2491
|
},
|
|
2316
2492
|
typographyAndIcons: {
|
|
2317
2493
|
text: '#FFFFFF',
|
|
@@ -2348,7 +2524,7 @@ var colors = {
|
|
|
2348
2524
|
}
|
|
2349
2525
|
},
|
|
2350
2526
|
greys: {
|
|
2351
|
-
accessible: '#
|
|
2527
|
+
accessible: '#B4B4B4',
|
|
2352
2528
|
accessibleLight: '#6F6F6F'
|
|
2353
2529
|
},
|
|
2354
2530
|
cards: {
|
|
@@ -2936,6 +3112,29 @@ var darkTheme = createTheme({
|
|
|
2936
3112
|
elevations: elevations
|
|
2937
3113
|
});
|
|
2938
3114
|
|
|
3115
|
+
/* *
|
|
3116
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3117
|
+
* you may not use this file except in compliance with the License.
|
|
3118
|
+
* You may obtain a copy of the License at
|
|
3119
|
+
*
|
|
3120
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3121
|
+
*
|
|
3122
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3123
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3124
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3125
|
+
* See the License for the specific language governing permissions and
|
|
3126
|
+
* limitations under the License.
|
|
3127
|
+
*
|
|
3128
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3129
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3130
|
+
* */
|
|
3131
|
+
var ThemeTypes;
|
|
3132
|
+
|
|
3133
|
+
(function (ThemeTypes) {
|
|
3134
|
+
ThemeTypes["DARK_THEME"] = "darkTheme";
|
|
3135
|
+
ThemeTypes["LIGHT_THEME"] = "lightTheme";
|
|
3136
|
+
})(ThemeTypes || (ThemeTypes = {}));
|
|
3137
|
+
|
|
2939
3138
|
var ThemeContext = /*#__PURE__*/React.createContext({
|
|
2940
3139
|
toggleTheme: undefined,
|
|
2941
3140
|
isDark: undefined
|
|
@@ -3000,4 +3199,4 @@ var ThemeWrapperOldTheme = function ThemeWrapperOldTheme(_a) {
|
|
|
3000
3199
|
}, props), children);
|
|
3001
3200
|
};
|
|
3002
3201
|
|
|
3003
|
-
export { Add, Animation, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, AutoUpdateActive, AutoUpdateInActive, Both, Cached, CalendarToday, Cancel, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clear, Clock, Close, CollapseLarge, CollapseMedium, CollapseSmall, CollapseWindow, Copy, Delete, DimensionsElevation, DimensionsOther, DimensionsRefTime, DimensionsTime, DragHandle, DrawFIRLand, DrawPolygon, DrawRegion, Edit, Equalizer, Exclamation, ExitDomain, Expand, ExpandWindow, Export, FastForward, Filter, GWTheme, GeoWebLogo, HamburgerMenu, Home, index as Icons, Info, KeyCommand, KeyOption, Layers, Link, LinkOff, List, ListItem, Location, Menu, Minus, None, Notifications, Now, Options, Pause, Picture, Play, Preset, PresetTiles, PresetWorkspace, Resize, Search, SliderThumb, Speed, SplitHorizontal, SplitVertical, StepBackward, StepForward, SubdirectoryArrowRight, Success, TextIcon, ThemeContext, ThemeProvider, ThemeTypes, ThemeWrapper, ThemeWrapperOldTheme, ThumbsUp, TimeSeriesManager, UnExpand, Update, Visibility, VisibilityOff, WebAssetOff, colors$1 as colorsLight, createShadows, createTheme, darkTheme, dragHandlePath, elevations$1 as elevationsLight,
|
|
3202
|
+
export { Add, Animation, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, AutoUpdateActive, AutoUpdateInActive, Both, Cached, CalendarToday, Cancel, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clear, Clock, Close, CollapseLarge, CollapseMedium, CollapseSmall, CollapseWindow, Copy, Delete, DimensionsElevation, DimensionsOther, DimensionsRefTime, DimensionsTime, DragHandle, DrawFIRLand, DrawPolygon, DrawRegion, Edit, Equalizer, Exclamation, ExitDomain, Expand, ExpandWindow, Export, FastForward, Filter, GWTheme, GeoWebLogo, HamburgerMenu, Home, index as Icons, Info, KeyCommand, KeyOption, Layers, Link, LinkOff, List, ListItem, Location, Menu, Minus, None, Notifications, Now, Options, Pause, Picture, Play, Preset, PresetTiles, PresetWorkspace, Resize, Search, SliderThumb, Speed, SplitHorizontal, SplitVertical, StepBackward, StepForward, SubdirectoryArrowRight, Success, TextIcon, ThemeContext, ThemeProvider, ThemeTypes, ThemeWrapper, ThemeWrapperOldTheme, ThumbsUp, TimeSeriesManager, UnExpand, Update, Visibility, VisibilityOff, WebAssetOff, colors$1 as colorsLight, createShadows, createTheme, darkTheme, dragHandlePath, elevations$1 as elevationsLight, lightTheme, parseColors, useThemeContext };
|
package/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Theme = {}, global.React, global.material));
|
|
5
|
-
})(this, (function (exports, React, material) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('@mui/material'), require('@mui/x-date-pickers')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', '@mui/material', '@mui/x-date-pickers'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Theme = {}, global.React, global.material, global.xDatePickers));
|
|
5
|
+
})(this, (function (exports, React, material, xDatePickers) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -848,31 +848,6 @@
|
|
|
848
848
|
Both: Both
|
|
849
849
|
});
|
|
850
850
|
|
|
851
|
-
/* *
|
|
852
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
853
|
-
* you may not use this file except in compliance with the License.
|
|
854
|
-
* You may obtain a copy of the License at
|
|
855
|
-
*
|
|
856
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
857
|
-
*
|
|
858
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
859
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
860
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
861
|
-
* See the License for the specific language governing permissions and
|
|
862
|
-
* limitations under the License.
|
|
863
|
-
*
|
|
864
|
-
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
865
|
-
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
866
|
-
* */
|
|
867
|
-
exports.ThemeTypes = void 0;
|
|
868
|
-
|
|
869
|
-
(function (ThemeTypes) {
|
|
870
|
-
ThemeTypes["DARK_THEME"] = "darkTheme";
|
|
871
|
-
ThemeTypes["LIGHT_THEME"] = "lightTheme";
|
|
872
|
-
})(exports.ThemeTypes || (exports.ThemeTypes = {}));
|
|
873
|
-
|
|
874
|
-
var gwButtonVariants = ['primary', 'secondary', 'tertiary', 'flat', 'tool', 'boxed', 'icon'];
|
|
875
|
-
|
|
876
851
|
var BORDER_RADIUS = 3;
|
|
877
852
|
var defaultButtonStyle = function defaultButtonStyle(button) {
|
|
878
853
|
return {
|
|
@@ -936,6 +911,40 @@
|
|
|
936
911
|
}
|
|
937
912
|
});
|
|
938
913
|
};
|
|
914
|
+
var iconButtonStyle = function iconButtonStyle(button) {
|
|
915
|
+
return __assign(__assign({}, defaultButtonStyle(button)), {
|
|
916
|
+
borderStyle: 'solid',
|
|
917
|
+
borderWidth: '1px',
|
|
918
|
+
borderColor: button["default"].borderColor,
|
|
919
|
+
// size styling
|
|
920
|
+
'&[class*="sizeSmall"]': {
|
|
921
|
+
width: 24,
|
|
922
|
+
height: 24
|
|
923
|
+
},
|
|
924
|
+
'&[class*="sizeMedium"]': {
|
|
925
|
+
width: 32,
|
|
926
|
+
height: 32
|
|
927
|
+
},
|
|
928
|
+
'&[class*="sizeLarge"]': {
|
|
929
|
+
width: 40,
|
|
930
|
+
height: 40
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
};
|
|
934
|
+
var buttonVariants = function buttonVariants(buttons, stylingFn) {
|
|
935
|
+
if (stylingFn === void 0) {
|
|
936
|
+
stylingFn = buttonStyle;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
return Object.keys(buttons).map(function (variant) {
|
|
940
|
+
return {
|
|
941
|
+
props: {
|
|
942
|
+
variant: variant
|
|
943
|
+
},
|
|
944
|
+
style: stylingFn(buttons[variant])
|
|
945
|
+
};
|
|
946
|
+
});
|
|
947
|
+
};
|
|
939
948
|
var variantsToClassName = function variantsToClassName(buttonVariants) {
|
|
940
949
|
return buttonVariants.reduce(function (variants, _a) {
|
|
941
950
|
var _b;
|
|
@@ -945,16 +954,6 @@
|
|
|
945
954
|
return __assign(__assign({}, variants), (_b = {}, _b["&." + variant] = style, _b));
|
|
946
955
|
}, {});
|
|
947
956
|
};
|
|
948
|
-
var buttonVariants = function buttonVariants(buttons) {
|
|
949
|
-
return gwButtonVariants.map(function (variant) {
|
|
950
|
-
return {
|
|
951
|
-
props: {
|
|
952
|
-
variant: variant
|
|
953
|
-
},
|
|
954
|
-
style: buttonStyle(buttons[variant])
|
|
955
|
-
};
|
|
956
|
-
});
|
|
957
|
-
};
|
|
958
957
|
|
|
959
958
|
/* *
|
|
960
959
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1243,8 +1242,93 @@
|
|
|
1243
1242
|
borderColor: 'transparent'
|
|
1244
1243
|
},
|
|
1245
1244
|
focus: focusButtonStyle$1
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
iconButtons: {
|
|
1248
|
+
flat: {
|
|
1249
|
+
"default": {
|
|
1250
|
+
fill: 'transparent',
|
|
1251
|
+
color: '#374061',
|
|
1252
|
+
borderColor: 'transparent'
|
|
1253
|
+
},
|
|
1254
|
+
mouseOver: {
|
|
1255
|
+
fill: '#E0E8F5',
|
|
1256
|
+
color: '#374061',
|
|
1257
|
+
borderColor: 'transparent'
|
|
1258
|
+
},
|
|
1259
|
+
active: {
|
|
1260
|
+
fill: 'transparent',
|
|
1261
|
+
color: '#186DFF',
|
|
1262
|
+
borderColor: 'transparent'
|
|
1263
|
+
},
|
|
1264
|
+
activeMouseOver: {
|
|
1265
|
+
fill: '#E0E8F5',
|
|
1266
|
+
color: '#186DFF',
|
|
1267
|
+
borderColor: 'transparent'
|
|
1268
|
+
},
|
|
1269
|
+
disabled: {
|
|
1270
|
+
fill: 'transparent',
|
|
1271
|
+
color: '#626262',
|
|
1272
|
+
borderColor: 'transparent'
|
|
1273
|
+
},
|
|
1274
|
+
focus: focusButtonStyle$1
|
|
1275
|
+
},
|
|
1276
|
+
tool: {
|
|
1277
|
+
"default": {
|
|
1278
|
+
fill: '#ECEDEE',
|
|
1279
|
+
color: '#374061',
|
|
1280
|
+
borderColor: 'transparent'
|
|
1281
|
+
},
|
|
1282
|
+
mouseOver: {
|
|
1283
|
+
fill: '#E0E8F5',
|
|
1284
|
+
color: '#374061',
|
|
1285
|
+
borderColor: 'transparent'
|
|
1286
|
+
},
|
|
1287
|
+
active: {
|
|
1288
|
+
fill: '#186DFF',
|
|
1289
|
+
color: '#FFFFFF',
|
|
1290
|
+
borderColor: 'transparent'
|
|
1291
|
+
},
|
|
1292
|
+
activeMouseOver: {
|
|
1293
|
+
fill: '#1047B0',
|
|
1294
|
+
color: '#FFFFFF',
|
|
1295
|
+
borderColor: 'transparent'
|
|
1296
|
+
},
|
|
1297
|
+
disabled: {
|
|
1298
|
+
fill: 'transparent',
|
|
1299
|
+
color: '#626262',
|
|
1300
|
+
borderColor: 'transparent'
|
|
1301
|
+
},
|
|
1302
|
+
focus: focusButtonStyle$1
|
|
1246
1303
|
},
|
|
1247
|
-
|
|
1304
|
+
boxed: {
|
|
1305
|
+
"default": {
|
|
1306
|
+
fill: 'transparent',
|
|
1307
|
+
color: '#374061',
|
|
1308
|
+
borderColor: '#374061'
|
|
1309
|
+
},
|
|
1310
|
+
mouseOver: {
|
|
1311
|
+
fill: '#E0E8F5',
|
|
1312
|
+
color: '#374061',
|
|
1313
|
+
borderColor: '#374061'
|
|
1314
|
+
},
|
|
1315
|
+
active: {
|
|
1316
|
+
fill: '#186DFF',
|
|
1317
|
+
color: '#FFFFFF',
|
|
1318
|
+
borderColor: 'transparent'
|
|
1319
|
+
},
|
|
1320
|
+
activeMouseOver: {
|
|
1321
|
+
fill: '#1047B0',
|
|
1322
|
+
color: '#FFFFFF',
|
|
1323
|
+
borderColor: 'transparent'
|
|
1324
|
+
},
|
|
1325
|
+
disabled: {
|
|
1326
|
+
fill: 'transparent',
|
|
1327
|
+
color: '#626262',
|
|
1328
|
+
borderColor: 'transparent'
|
|
1329
|
+
},
|
|
1330
|
+
focus: focusButtonStyle$1
|
|
1331
|
+
}
|
|
1248
1332
|
},
|
|
1249
1333
|
typographyAndIcons: {
|
|
1250
1334
|
text: '#051039',
|
|
@@ -1281,7 +1365,7 @@
|
|
|
1281
1365
|
}
|
|
1282
1366
|
},
|
|
1283
1367
|
greys: {
|
|
1284
|
-
accessible: '#
|
|
1368
|
+
accessible: '#626262',
|
|
1285
1369
|
accessibleLight: '#C5C5C5'
|
|
1286
1370
|
},
|
|
1287
1371
|
cards: {
|
|
@@ -1598,7 +1682,7 @@
|
|
|
1598
1682
|
focusRipple: false
|
|
1599
1683
|
},
|
|
1600
1684
|
styleOverrides: {
|
|
1601
|
-
root: defaultButtonStyle(geowebColors.
|
|
1685
|
+
root: __assign(__assign({}, defaultButtonStyle(geowebColors.iconButtons.flat)), variantsToClassName(buttonVariants(geowebColors.iconButtons, iconButtonStyle)))
|
|
1602
1686
|
}
|
|
1603
1687
|
},
|
|
1604
1688
|
MuiCssBaseline: {
|
|
@@ -1799,7 +1883,7 @@
|
|
|
1799
1883
|
},
|
|
1800
1884
|
'&.Mui-focusVisible': {
|
|
1801
1885
|
backgroundColor: geowebColors.cards.cardContainerMouseOver,
|
|
1802
|
-
outline: geowebColors.buttons.
|
|
1886
|
+
outline: geowebColors.buttons.primary.focus.outline
|
|
1803
1887
|
},
|
|
1804
1888
|
' .MuiListItemIcon-root': {
|
|
1805
1889
|
minWidth: 40
|
|
@@ -1909,7 +1993,7 @@
|
|
|
1909
1993
|
backgroundColor: geowebColors.textInputField.disabled.rgba
|
|
1910
1994
|
},
|
|
1911
1995
|
'&.Mui-error': {
|
|
1912
|
-
'&:
|
|
1996
|
+
'&:before': {
|
|
1913
1997
|
borderColor: geowebColors.captions.captionError.color
|
|
1914
1998
|
}
|
|
1915
1999
|
},
|
|
@@ -2059,6 +2143,15 @@
|
|
|
2059
2143
|
paddingRight: '5px'
|
|
2060
2144
|
}
|
|
2061
2145
|
}
|
|
2146
|
+
},
|
|
2147
|
+
MuiDesktopDateTimePicker: {
|
|
2148
|
+
defaultProps: {
|
|
2149
|
+
viewRenderers: {
|
|
2150
|
+
hours: xDatePickers.renderTimeViewClock,
|
|
2151
|
+
minutes: xDatePickers.renderTimeViewClock,
|
|
2152
|
+
seconds: xDatePickers.renderTimeViewClock
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2062
2155
|
}
|
|
2063
2156
|
}
|
|
2064
2157
|
});
|
|
@@ -2281,8 +2374,93 @@
|
|
|
2281
2374
|
borderColor: 'transparent'
|
|
2282
2375
|
},
|
|
2283
2376
|
focus: focusButtonStyle
|
|
2377
|
+
}
|
|
2378
|
+
},
|
|
2379
|
+
iconButtons: {
|
|
2380
|
+
flat: {
|
|
2381
|
+
"default": {
|
|
2382
|
+
fill: 'transparent',
|
|
2383
|
+
color: '#F8F9F9',
|
|
2384
|
+
borderColor: 'transparent'
|
|
2385
|
+
},
|
|
2386
|
+
mouseOver: {
|
|
2387
|
+
fill: '#414751',
|
|
2388
|
+
color: '#F8F9F9',
|
|
2389
|
+
borderColor: 'transparent'
|
|
2390
|
+
},
|
|
2391
|
+
active: {
|
|
2392
|
+
fill: 'transparent',
|
|
2393
|
+
color: '#7BACFF',
|
|
2394
|
+
borderColor: 'transparent'
|
|
2395
|
+
},
|
|
2396
|
+
activeMouseOver: {
|
|
2397
|
+
fill: '#414751',
|
|
2398
|
+
color: '#7BACFF',
|
|
2399
|
+
borderColor: 'transparent'
|
|
2400
|
+
},
|
|
2401
|
+
disabled: {
|
|
2402
|
+
fill: 'transparent',
|
|
2403
|
+
color: '#B4B4B4',
|
|
2404
|
+
borderColor: 'transparent'
|
|
2405
|
+
},
|
|
2406
|
+
focus: focusButtonStyle
|
|
2284
2407
|
},
|
|
2285
|
-
|
|
2408
|
+
tool: {
|
|
2409
|
+
"default": {
|
|
2410
|
+
fill: '#393939',
|
|
2411
|
+
color: '#F8F9F9',
|
|
2412
|
+
borderColor: 'transparent'
|
|
2413
|
+
},
|
|
2414
|
+
mouseOver: {
|
|
2415
|
+
fill: '#414751',
|
|
2416
|
+
color: '#F8F9F9',
|
|
2417
|
+
borderColor: 'transparent'
|
|
2418
|
+
},
|
|
2419
|
+
active: {
|
|
2420
|
+
fill: '#186DFF',
|
|
2421
|
+
color: '#FFFFFF',
|
|
2422
|
+
borderColor: 'transparent'
|
|
2423
|
+
},
|
|
2424
|
+
activeMouseOver: {
|
|
2425
|
+
fill: '#1047B0',
|
|
2426
|
+
color: '#FFFFFF',
|
|
2427
|
+
borderColor: 'transparent'
|
|
2428
|
+
},
|
|
2429
|
+
disabled: {
|
|
2430
|
+
fill: 'transparent',
|
|
2431
|
+
color: '#B4B4B4',
|
|
2432
|
+
borderColor: 'transparent'
|
|
2433
|
+
},
|
|
2434
|
+
focus: focusButtonStyle
|
|
2435
|
+
},
|
|
2436
|
+
boxed: {
|
|
2437
|
+
"default": {
|
|
2438
|
+
fill: 'transparent',
|
|
2439
|
+
color: '#F8F9F9',
|
|
2440
|
+
borderColor: '#F8F9F9'
|
|
2441
|
+
},
|
|
2442
|
+
mouseOver: {
|
|
2443
|
+
fill: '#414751',
|
|
2444
|
+
color: '#F8F9F9',
|
|
2445
|
+
borderColor: '#F8F9F9'
|
|
2446
|
+
},
|
|
2447
|
+
active: {
|
|
2448
|
+
fill: '#186DFF',
|
|
2449
|
+
color: '#FFFFFF',
|
|
2450
|
+
borderColor: 'transparent'
|
|
2451
|
+
},
|
|
2452
|
+
activeMouseOver: {
|
|
2453
|
+
fill: '#1047B0',
|
|
2454
|
+
color: '#FFFFFF',
|
|
2455
|
+
borderColor: 'transparent'
|
|
2456
|
+
},
|
|
2457
|
+
disabled: {
|
|
2458
|
+
fill: 'transparent',
|
|
2459
|
+
color: '#B4B4B4',
|
|
2460
|
+
borderColor: 'transparent'
|
|
2461
|
+
},
|
|
2462
|
+
focus: focusButtonStyle
|
|
2463
|
+
}
|
|
2286
2464
|
},
|
|
2287
2465
|
typographyAndIcons: {
|
|
2288
2466
|
text: '#FFFFFF',
|
|
@@ -2319,7 +2497,7 @@
|
|
|
2319
2497
|
}
|
|
2320
2498
|
},
|
|
2321
2499
|
greys: {
|
|
2322
|
-
accessible: '#
|
|
2500
|
+
accessible: '#B4B4B4',
|
|
2323
2501
|
accessibleLight: '#6F6F6F'
|
|
2324
2502
|
},
|
|
2325
2503
|
cards: {
|
|
@@ -2891,6 +3069,29 @@
|
|
|
2891
3069
|
elevations: elevations
|
|
2892
3070
|
});
|
|
2893
3071
|
|
|
3072
|
+
/* *
|
|
3073
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3074
|
+
* you may not use this file except in compliance with the License.
|
|
3075
|
+
* You may obtain a copy of the License at
|
|
3076
|
+
*
|
|
3077
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3078
|
+
*
|
|
3079
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3080
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3081
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3082
|
+
* See the License for the specific language governing permissions and
|
|
3083
|
+
* limitations under the License.
|
|
3084
|
+
*
|
|
3085
|
+
* Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
3086
|
+
* Copyright 2021 - Finnish Meteorological Institute (FMI)
|
|
3087
|
+
* */
|
|
3088
|
+
exports.ThemeTypes = void 0;
|
|
3089
|
+
|
|
3090
|
+
(function (ThemeTypes) {
|
|
3091
|
+
ThemeTypes["DARK_THEME"] = "darkTheme";
|
|
3092
|
+
ThemeTypes["LIGHT_THEME"] = "lightTheme";
|
|
3093
|
+
})(exports.ThemeTypes || (exports.ThemeTypes = {}));
|
|
3094
|
+
|
|
2894
3095
|
var ThemeContext = /*#__PURE__*/React__namespace.createContext({
|
|
2895
3096
|
toggleTheme: undefined,
|
|
2896
3097
|
isDark: undefined
|
|
@@ -3050,7 +3251,6 @@
|
|
|
3050
3251
|
exports.darkTheme = darkTheme;
|
|
3051
3252
|
exports.dragHandlePath = dragHandlePath;
|
|
3052
3253
|
exports.elevationsLight = elevations$1;
|
|
3053
|
-
exports.gwButtonVariants = gwButtonVariants;
|
|
3054
3254
|
exports.lightTheme = lightTheme;
|
|
3055
3255
|
exports.parseColors = parseColors;
|
|
3056
3256
|
exports.useThemeContext = useThemeContext;
|
|
@@ -3,5 +3,21 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
6
|
+
export declare const IconButtonLight: {
|
|
7
|
+
(): React.ReactElement;
|
|
8
|
+
parameters: {
|
|
9
|
+
zeplinLink: {
|
|
10
|
+
name: string;
|
|
11
|
+
link: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const IconButtonDark: {
|
|
16
|
+
(): React.ReactElement;
|
|
17
|
+
parameters: {
|
|
18
|
+
zeplinLink: {
|
|
19
|
+
name: string;
|
|
20
|
+
link: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
};
|
package/lib/types.d.ts
CHANGED
|
@@ -7,8 +7,7 @@ export declare enum ThemeTypes {
|
|
|
7
7
|
DARK_THEME = "darkTheme",
|
|
8
8
|
LIGHT_THEME = "lightTheme"
|
|
9
9
|
}
|
|
10
|
-
export declare
|
|
11
|
-
export declare type ButtonVariant = typeof gwButtonVariants[number];
|
|
10
|
+
export declare type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'flat' | 'tool' | 'boxed' | 'icon';
|
|
12
11
|
export interface ButtonStyle {
|
|
13
12
|
default: CSSProperties;
|
|
14
13
|
mouseOver: CSSProperties;
|
|
@@ -17,16 +16,6 @@ export interface ButtonStyle {
|
|
|
17
16
|
disabled: CSSProperties;
|
|
18
17
|
focus: CSSProperties;
|
|
19
18
|
}
|
|
20
|
-
export interface ButtonStyles {
|
|
21
|
-
primary: ButtonStyle;
|
|
22
|
-
secondary: ButtonStyle;
|
|
23
|
-
tertiary: ButtonStyle;
|
|
24
|
-
flat: ButtonStyle;
|
|
25
|
-
tool: ButtonStyle;
|
|
26
|
-
boxed: ButtonStyle;
|
|
27
|
-
icon: ButtonStyle;
|
|
28
|
-
focusDefault: CSSProperties;
|
|
29
|
-
}
|
|
30
19
|
export declare type GeowebColorPalette = {
|
|
31
20
|
background: {
|
|
32
21
|
surface: CSSProperties['color'];
|
|
@@ -36,7 +25,20 @@ export declare type GeowebColorPalette = {
|
|
|
36
25
|
brand: {
|
|
37
26
|
brand: CSSProperties['color'];
|
|
38
27
|
};
|
|
39
|
-
buttons:
|
|
28
|
+
buttons: {
|
|
29
|
+
primary: ButtonStyle;
|
|
30
|
+
secondary: ButtonStyle;
|
|
31
|
+
tertiary: ButtonStyle;
|
|
32
|
+
flat: ButtonStyle;
|
|
33
|
+
tool: ButtonStyle;
|
|
34
|
+
boxed: ButtonStyle;
|
|
35
|
+
icon: ButtonStyle;
|
|
36
|
+
};
|
|
37
|
+
iconButtons: {
|
|
38
|
+
flat: ButtonStyle;
|
|
39
|
+
tool: ButtonStyle;
|
|
40
|
+
boxed: ButtonStyle;
|
|
41
|
+
};
|
|
40
42
|
typographyAndIcons: {
|
|
41
43
|
text: CSSProperties['color'];
|
|
42
44
|
icon: CSSProperties['color'];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ComponentsVariants,
|
|
2
|
-
import { ButtonStyle
|
|
1
|
+
import { ComponentsVariants, CSSObject } from '@mui/material';
|
|
2
|
+
import { ButtonStyle } from '../types';
|
|
3
3
|
export declare const BORDER_RADIUS = 3;
|
|
4
4
|
export declare const defaultButtonStyle: (button: ButtonStyle) => CSSObject;
|
|
5
|
-
export declare const buttonStyle: (button: ButtonStyle) =>
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const buttonVariants: (buttons:
|
|
5
|
+
export declare const buttonStyle: (button: ButtonStyle) => CSSObject;
|
|
6
|
+
export declare const iconButtonStyle: (button: ButtonStyle) => CSSObject;
|
|
7
|
+
export declare const buttonVariants: (buttons: Record<string, ButtonStyle>, stylingFn?: (button: ButtonStyle) => CSSObject) => ComponentsVariants['MuiButton'];
|
|
8
|
+
export declare const variantsToClassName: (buttonVariants: ComponentsVariants['MuiButton']) => CSSObject;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/theme",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"description": "GeoWeb Theme library for the opengeoweb project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dependencies": {},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": "^18.2.0",
|
|
16
|
-
"@mui/material": "^5.
|
|
16
|
+
"@mui/material": "^5.12.0",
|
|
17
|
+
"@mui/x-date-pickers": "^6.2.1"
|
|
17
18
|
}
|
|
18
19
|
}
|