Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[chore] Upgrade styled components to v6 (#2894)

Igor Dykhtacf02a3ca661a
diff --git a/bindings/kepler.gl-jupyter/js/package.json b/bindings/kepler.gl-jupyter/js/package.json
index dd33c7466..08e5a3af7 100644
--- a/bindings/kepler.gl-jupyter/js/package.json
+++ b/bindings/kepler.gl-jupyter/js/package.json
@@ -92,7 +92,7 @@
"react-redux": "^8.0.5",
"redux": "^4.2.1",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"resolutions": {
"@deck.gl/core": "^8.9.27",
diff --git a/bindings/kepler.gl-jupyter/js/yarn.lock b/bindings/kepler.gl-jupyter/js/yarn.lock
index 585f00244..1165c1d73 100644
--- a/bindings/kepler.gl-jupyter/js/yarn.lock
+++ b/bindings/kepler.gl-jupyter/js/yarn.lock
@@ -1729,6 +1729,15 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/is-prop-valid@npm:1.2.1":
+ version: 1.2.1
+ resolution: "@emotion/is-prop-valid@npm:1.2.1"
+ dependencies:
+ "@emotion/memoize": "npm:^0.8.1"
+ checksum: 10c0/7c2aabdf0ca9986ca25abc9dae711348308cf18d418d64ffa4c8ffd2114806c47f2e06ba8ee769f38ec67d65bd59ec73f34d94023e81baa1c43510ac86ccd5e6
+ languageName: node
+ linkType: hard
+
"@emotion/is-prop-valid@npm:^0.8.1":
version: 0.8.8
resolution: "@emotion/is-prop-valid@npm:0.8.8"
@@ -1745,6 +1754,20 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/memoize@npm:^0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/memoize@npm:0.8.1"
+ checksum: 10c0/dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
+ languageName: node
+ linkType: hard
+
+"@emotion/unitless@npm:0.8.0":
+ version: 0.8.0
+ resolution: "@emotion/unitless@npm:0.8.0"
+ checksum: 10c0/1f2cfb7c0ccb83c20b1c6d8d92a74a93da4b2a440f9a0d49ded08647faf299065a2ffde17e1335920fa10397b85f8635bbfe14f3cd29222a59ea81d978478072
+ languageName: node
+ linkType: hard
+
"@emotion/unitless@npm:^0.7.0":
version: 0.7.5
resolution: "@emotion/unitless@npm:0.7.5"
@@ -4918,6 +4941,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/stylis@npm:4.2.0":
+ version: 4.2.0
+ resolution: "@types/stylis@npm:4.2.0"
+ checksum: 10c0/c76c13e76ca485f598a13984cfb5e07bb88a851da5bee213587424a5f101f182c74f4f92d633cebf9abcec40ccebb645d600d184b7e4b42793e3eeca8729b110
+ languageName: node
+ linkType: hard
+
"@types/supercluster@npm:^7.1.0, @types/supercluster@npm:^7.1.3":
version: 7.1.3
resolution: "@types/supercluster@npm:7.1.3"
@@ -7351,6 +7381,17 @@ __metadata:
languageName: node
linkType: hard
+"css-to-react-native@npm:3.2.0":
+ version: 3.2.0
+ resolution: "css-to-react-native@npm:3.2.0"
+ dependencies:
+ camelize: "npm:^1.0.0"
+ css-color-keywords: "npm:^1.0.0"
+ postcss-value-parser: "npm:^4.0.2"
+ checksum: 10c0/fde850a511d5d3d7c55a1e9b8ed26b69a8ad4868b3487e36ebfbfc0b96fc34bc977d9cd1d61a289d0c74d3f9a662d8cee297da53d4433bf2e27d6acdff8e1003
+ languageName: node
+ linkType: hard
+
"css-to-react-native@npm:^2.2.2":
version: 2.3.2
resolution: "css-to-react-native@npm:2.3.2"
@@ -7385,6 +7426,13 @@ __metadata:
languageName: node
linkType: hard
+"csstype@npm:3.1.2":
+ version: 3.1.2
+ resolution: "csstype@npm:3.1.2"
+ checksum: 10c0/32c038af259897c807ac738d9eab16b3d86747c72b09d5c740978e06f067f9b7b1737e1b75e407c7ab1fe1543dc95f20e202b4786aeb1b8d3bdf5d5ce655e6c6
+ languageName: node
+ linkType: hard
+
"csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
@@ -11549,7 +11597,7 @@ __metadata:
redux: "npm:^4.2.1"
redux-actions: "npm:^2.2.1"
rimraf: "npm:^2.6.1"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
webpack: "npm:^4.29.0"
webpack-cli: "npm:^3.2.1"
webpack-dev-middleware: "npm:^3.5.1"
@@ -12685,6 +12733,15 @@ __metadata:
languageName: node
linkType: hard
+"nanoid@npm:^3.3.6":
+ version: 3.3.8
+ resolution: "nanoid@npm:3.3.8"
+ bin:
+ nanoid: bin/nanoid.cjs
+ checksum: 10c0/4b1bb29f6cfebf3be3bc4ad1f1296fb0a10a3043a79f34fbffe75d1621b4318319211cd420549459018ea3592f0d2f159247a6f874911d6d26eaaadda2478120
+ languageName: node
+ linkType: hard
+
"nanoid@npm:^3.3.7":
version: 3.3.7
resolution: "nanoid@npm:3.3.7"
@@ -13670,13 +13727,24 @@ __metadata:
languageName: node
linkType: hard
-"postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
+"postcss-value-parser@npm:^4.0.2, postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
version: 4.2.0
resolution: "postcss-value-parser@npm:4.2.0"
checksum: 10c0/f4142a4f56565f77c1831168e04e3effd9ffcc5aebaf0f538eee4b2d465adfd4b85a44257bb48418202a63806a7da7fe9f56c330aebb3cac898e46b4cbf49161
languageName: node
linkType: hard
+"postcss@npm:8.4.31":
+ version: 8.4.31
+ resolution: "postcss@npm:8.4.31"
+ dependencies:
+ nanoid: "npm:^3.3.6"
+ picocolors: "npm:^1.0.0"
+ source-map-js: "npm:^1.0.2"
+ checksum: 10c0/748b82e6e5fc34034dcf2ae88ea3d11fd09f69b6c50ecdd3b4a875cfc7cdca435c958b211e2cb52355422ab6fccb7d8f2f2923161d7a1b281029e4a913d59acf
+ languageName: node
+ linkType: hard
+
"postcss@npm:^8.4.33":
version: 8.4.41
resolution: "postcss@npm:8.4.41"
@@ -15366,7 +15434,7 @@ __metadata:
languageName: node
linkType: hard
-"shallowequal@npm:^1.0.1":
+"shallowequal@npm:1.1.0, shallowequal@npm:^1.0.1":
version: 1.1.0
resolution: "shallowequal@npm:1.1.0"
checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
@@ -15586,6 +15654,13 @@ __metadata:
languageName: node
linkType: hard
+"source-map-js@npm:^1.0.2":
+ version: 1.2.1
+ resolution: "source-map-js@npm:1.2.1"
+ checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf
+ languageName: node
+ linkType: hard
+
"source-map-js@npm:^1.2.0":
version: 1.2.0
resolution: "source-map-js@npm:1.2.0"
@@ -16049,6 +16124,26 @@ __metadata:
languageName: node
linkType: hard
+"styled-components@npm:6.1.8":
+ version: 6.1.8
+ resolution: "styled-components@npm:6.1.8"
+ dependencies:
+ "@emotion/is-prop-valid": "npm:1.2.1"
+ "@emotion/unitless": "npm:0.8.0"
+ "@types/stylis": "npm:4.2.0"
+ css-to-react-native: "npm:3.2.0"
+ csstype: "npm:3.1.2"
+ postcss: "npm:8.4.31"
+ shallowequal: "npm:1.1.0"
+ stylis: "npm:4.3.1"
+ tslib: "npm:2.5.0"
+ peerDependencies:
+ react: ">= 16.8.0"
+ react-dom: ">= 16.8.0"
+ checksum: 10c0/fafe4b9198d5d7980c2358821d1a89f86200d55c8eec03670cf12cf43b8a05a77eafaf0872cd85821f68238308e0f5c9d9aa43a62e6987c65b70baa2c3277ab8
+ languageName: node
+ linkType: hard
+
"styled-components@npm:^4.1.3":
version: 4.4.1
resolution: "styled-components@npm:4.4.1"
@@ -16082,6 +16177,13 @@ __metadata:
languageName: node
linkType: hard
+"stylis@npm:4.3.1":
+ version: 4.3.1
+ resolution: "stylis@npm:4.3.1"
+ checksum: 10c0/33e8ebd2bfa5f0bd0215f718dc2d3be896e1d00c5bcaeb9a4ae03cf239db6867af9eee230f57229bf1c29499357073ba3e6b547484ba1db2f5de1e8be7d4eee9
+ languageName: node
+ linkType: hard
+
"stylis@npm:^3.5.0":
version: 3.5.4
resolution: "stylis@npm:3.5.4"
@@ -16522,6 +16624,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:2.5.0":
+ version: 2.5.0
+ resolution: "tslib@npm:2.5.0"
+ checksum: 10c0/e32fc99cc730dd514e53c44e668d76016e738f0bcc726aad5dbd2d335cf19b87a95a9b1e4f0a9993e370f1d702b5e471cdd4acabcac428a3099d496b9af2021e
+ languageName: node
+ linkType: hard
+
"tslib@npm:^1.9.0":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
diff --git a/examples/custom-map-style/package.json b/examples/custom-map-style/package.json
index 063256769..19eb1b663 100644
--- a/examples/custom-map-style/package.json
+++ b/examples/custom-map-style/package.json
@@ -13,7 +13,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/examples/custom-reducer/package.json b/examples/custom-reducer/package.json
index 71dde6339..c0d7688c9 100644
--- a/examples/custom-reducer/package.json
+++ b/examples/custom-reducer/package.json
@@ -14,7 +14,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/examples/custom-theme/package.json b/examples/custom-theme/package.json
index 58ad815f9..f184d880c 100644
--- a/examples/custom-theme/package.json
+++ b/examples/custom-theme/package.json
@@ -13,7 +13,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/examples/demo-app/package.json b/examples/demo-app/package.json
index 602f7b6a9..f7eff1d69 100644
--- a/examples/demo-app/package.json
+++ b/examples/demo-app/package.json
@@ -11,6 +11,7 @@
"dependencies": {
"@auth0/auth0-spa-js": "^2.1.2",
"@carto/toolkit": "0.0.1-rc.18",
+ "@emotion/is-prop-valid": "^1.2.1",
"@kepler.gl/actions": "^3.0.0-alpha.1",
"@kepler.gl/cloud-providers": "^3.0.0-alpha.1",
"@kepler.gl/components": "^3.0.0-alpha.1",
@@ -46,7 +47,7 @@
"redux-actions": "^2.2.1",
"redux-logger": "^3.0.6",
"redux-thunk": "^1.0.0",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"resolutions": {
"@luma.gl/core": "8.5.21",
diff --git a/examples/demo-app/src/app.tsx b/examples/demo-app/src/app.tsx
index 329cd5cff..97afddf00 100644
--- a/examples/demo-app/src/app.tsx
+++ b/examples/demo-app/src/app.tsx
@@ -3,11 +3,12 @@
import React, {useCallback, useEffect, useRef, useMemo, useState} from 'react';
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
-import styled, {ThemeProvider} from 'styled-components';
+import styled, {ThemeProvider, StyleSheetManager} from 'styled-components';
import window from 'global/window';
import {connect, useDispatch} from 'react-redux';
import cloneDeep from 'lodash.clonedeep';
import isEqual from 'lodash.isequal';
+import isPropValid from '@emotion/is-prop-valid';
import {ScreenshotWrapper} from 'react-ai-assist';
import {
@@ -61,6 +62,16 @@ import sampleRowData, {config as rowDataConfig} from './data/sample-row-data';
import {processCsvData, processGeojson, processRowObject} from '@kepler.gl/processors';
/* eslint-enable no-unused-vars */
+// This implements the default behavior from styled-components v5
+function shouldForwardProp(propName, target) {
+ if (typeof target === 'string') {
+ // For HTML elements, forward the prop if it is a valid HTML attribute
+ return isPropValid(propName);
+ }
+ // For other elements, forward all props
+ return true;
+}
+
const BannerHeight = 48;
const BannerKey = `banner-${FormLink}`;
const keplerGlGetState = state => state.demo.keplerGl;
@@ -563,49 +574,51 @@ const App = props => {
]);
return (
- <ThemeProvider theme={theme}>
- <GlobalStyle
- // this is to apply the same modal style as kepler.gl core
- // because styled-components doesn't always return a node
- // https://github.com/styled-components/styled-components/issues/617
- // ref={node => {
- // node ? (this.root = node) : null;
- // }}
- >
- <ScreenshotWrapper
- startScreenCapture={props.demo.aiAssistant.screenshotToAsk.startScreenCapture}
- setScreenCaptured={_setScreenCaptured}
- setStartScreenCapture={_setStartScreenCapture}
+ <StyleSheetManager shouldForwardProp={shouldForwardProp}>
+ <ThemeProvider theme={theme}>
+ <GlobalStyle
+ // this is to apply the same modal style as kepler.gl core
+ // because styled-components doesn't always return a node
+ // https://github.com/styled-components/styled-components/issues/617
+ // ref={node => {
+ // node ? (this.root = node) : null;
+ // }}
>
- <Banner show={showBanner} height={BannerHeight} bgColor="#2E7CF6" onClose={hideBanner}>
- <Announcement onDisable={_disableBanner} />
- </Banner>
- <div style={CONTAINER_STYLE}>
- <div style={{flexGrow: 1}}>
- <AutoSizer>
- {({height, width}) => (
- <KeplerGl
- mapboxApiAccessToken={CLOUD_PROVIDERS_CONFIGURATION.MAPBOX_TOKEN}
- id="map"
- /*
- * Specify path to keplerGl state, because it is not mount at the root
- */
- getState={keplerGlGetState}
- width={width}
- height={height}
- cloudProviders={CLOUD_PROVIDERS}
- localeMessages={combinedMessages}
- onExportToCloudSuccess={onExportFileSuccess}
- onLoadCloudMapSuccess={onLoadCloudMapSuccess}
- featureFlags={DEFAULT_FEATURE_FLAGS}
- />
- )}
- </AutoSizer>
+ <ScreenshotWrapper
+ startScreenCapture={props.demo.aiAssistant.screenshotToAsk.startScreenCapture}
+ setScreenCaptured={_setScreenCaptured}
+ setStartScreenCapture={_setStartScreenCapture}
+ >
+ <Banner show={showBanner} height={BannerHeight} bgColor="#2E7CF6" onClose={hideBanner}>
+ <Announcement onDisable={_disableBanner} />
+ </Banner>
+ <div style={CONTAINER_STYLE}>
+ <div style={{flexGrow: 1}}>
+ <AutoSizer>
+ {({height, width}) => (
+ <KeplerGl
+ mapboxApiAccessToken={CLOUD_PROVIDERS_CONFIGURATION.MAPBOX_TOKEN}
+ id="map"
+ /*
+ * Specify path to keplerGl state, because it is not mount at the root
+ */
+ getState={keplerGlGetState}
+ width={width}
+ height={height}
+ cloudProviders={CLOUD_PROVIDERS}
+ localeMessages={combinedMessages}
+ onExportToCloudSuccess={onExportFileSuccess}
+ onLoadCloudMapSuccess={onLoadCloudMapSuccess}
+ featureFlags={DEFAULT_FEATURE_FLAGS}
+ />
+ )}
+ </AutoSizer>
+ </div>
</div>
- </div>
- </ScreenshotWrapper>
- </GlobalStyle>
- </ThemeProvider>
+ </ScreenshotWrapper>
+ </GlobalStyle>
+ </ThemeProvider>
+ </StyleSheetManager>
);
};
diff --git a/examples/demo-app/src/components/announcement.js b/examples/demo-app/src/components/announcement.js
index 854e53c5e..e71aacf13 100644
--- a/examples/demo-app/src/components/announcement.js
+++ b/examples/demo-app/src/components/announcement.js
@@ -14,7 +14,7 @@ const StyledLink = styled.a`
font-weight: 500;
margin-left: 8px;
- :hover {
+ &:hover {
cursor: pointer;
}
`;
diff --git a/examples/demo-app/src/components/load-data-modal/load-remote-map.js b/examples/demo-app/src/components/load-data-modal/load-remote-map.js
index 6d3949b25..444fe1161 100644
--- a/examples/demo-app/src/components/load-data-modal/load-remote-map.js
+++ b/examples/demo-app/src/components/load-data-modal/load-remote-map.js
@@ -36,8 +36,8 @@ const StyledInput = styled.input`
outline: 0;
font-size: ${props => props.theme.inputFontSize};
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
outline: 0;
diff --git a/examples/demo-app/src/components/load-data-modal/sample-data-viewer.js b/examples/demo-app/src/components/load-data-modal/sample-data-viewer.js
index 21eb4b3d2..37280fc2d 100644
--- a/examples/demo-app/src/components/load-data-modal/sample-data-viewer.js
+++ b/examples/demo-app/src/components/load-data-modal/sample-data-viewer.js
@@ -37,7 +37,7 @@ const StyledSampleMap = styled.div`
img {
max-width: 100%;
}
- :hover {
+ &:hover {
cursor: pointer;
opacity: 1;
}
@@ -49,7 +49,7 @@ const StyledSampleMap = styled.div`
line-height: 24px;
}
- :hover {
+ &:hover {
.sample-map__image__caption {
opacity: 0.8;
transition: opacity 0.4s ease;
diff --git a/examples/demo-app/src/components/load-data-modal/sample-maps-tab.js b/examples/demo-app/src/components/load-data-modal/sample-maps-tab.js
index 25b6e0be2..0692e7c49 100644
--- a/examples/demo-app/src/components/load-data-modal/sample-maps-tab.js
+++ b/examples/demo-app/src/components/load-data-modal/sample-maps-tab.js
@@ -56,7 +56,7 @@ const StyledTrySampleData = styled.div`
font-size: 12px;
`};
- :hover {
+ &:hover {
color: ${props => props.theme.textColorLT};
}
diff --git a/examples/demo-app/src/components/map-control/map-control.js b/examples/demo-app/src/components/map-control/map-control.js
index 90f0a27ba..27ee2e32e 100644
--- a/examples/demo-app/src/components/map-control/map-control.js
+++ b/examples/demo-app/src/components/map-control/map-control.js
@@ -65,7 +65,7 @@ const StyledPanelAction = styled.div`
}
}
- :hover {
+ &:hover {
cursor: pointer;
a {
color: ${props => props.theme.textColorHl};
diff --git a/examples/demo-app/yarn.lock b/examples/demo-app/yarn.lock
index a0a520c27..14a01ef9a 100644
--- a/examples/demo-app/yarn.lock
+++ b/examples/demo-app/yarn.lock
@@ -457,6 +457,15 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/is-prop-valid@npm:1.2.1":
+ version: 1.2.1
+ resolution: "@emotion/is-prop-valid@npm:1.2.1"
+ dependencies:
+ "@emotion/memoize": "npm:^0.8.1"
+ checksum: 10c0/7c2aabdf0ca9986ca25abc9dae711348308cf18d418d64ffa4c8ffd2114806c47f2e06ba8ee769f38ec67d65bd59ec73f34d94023e81baa1c43510ac86ccd5e6
+ languageName: node
+ linkType: hard
+
"@emotion/is-prop-valid@npm:^0.8.1":
version: 0.8.8
resolution: "@emotion/is-prop-valid@npm:0.8.8"
@@ -466,6 +475,15 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/is-prop-valid@npm:^1.2.1":
+ version: 1.3.1
+ resolution: "@emotion/is-prop-valid@npm:1.3.1"
+ dependencies:
+ "@emotion/memoize": "npm:^0.9.0"
+ checksum: 10c0/123215540c816ff510737ec68dcc499c53ea4deb0bb6c2c27c03ed21046e2e69f6ad07a7a174d271c6cfcbcc9ea44e1763e0cf3875c92192f7689216174803cd
+ languageName: node
+ linkType: hard
+
"@emotion/memoize@npm:0.7.4":
version: 0.7.4
resolution: "@emotion/memoize@npm:0.7.4"
@@ -473,6 +491,27 @@ __metadata:
languageName: node
linkType: hard
+"@emotion/memoize@npm:^0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/memoize@npm:0.8.1"
+ checksum: 10c0/dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
+ languageName: node
+ linkType: hard
+
+"@emotion/memoize@npm:^0.9.0":
+ version: 0.9.0
+ resolution: "@emotion/memoize@npm:0.9.0"
+ checksum: 10c0/13f474a9201c7f88b543e6ea42f55c04fb2fdc05e6c5a3108aced2f7e7aa7eda7794c56bba02985a46d8aaa914fcdde238727a98341a96e2aec750d372dadd15
+ languageName: node
+ linkType: hard
+
+"@emotion/unitless@npm:0.8.0":
+ version: 0.8.0
+ resolution: "@emotion/unitless@npm:0.8.0"
+ checksum: 10c0/1f2cfb7c0ccb83c20b1c6d8d92a74a93da4b2a440f9a0d49ded08647faf299065a2ffde17e1335920fa10397b85f8635bbfe14f3cd29222a59ea81d978478072
+ languageName: node
+ linkType: hard
+
"@emotion/unitless@npm:^0.7.0":
version: 0.7.5
resolution: "@emotion/unitless@npm:0.7.5"
@@ -3584,6 +3623,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/stylis@npm:4.2.0":
+ version: 4.2.0
+ resolution: "@types/stylis@npm:4.2.0"
+ checksum: 10c0/c76c13e76ca485f598a13984cfb5e07bb88a851da5bee213587424a5f101f182c74f4f92d633cebf9abcec40ccebb645d600d184b7e4b42793e3eeca8729b110
+ languageName: node
+ linkType: hard
+
"@types/supercluster@npm:^7.1.0, @types/supercluster@npm:^7.1.3":
version: 7.1.3
resolution: "@types/supercluster@npm:7.1.3"
@@ -4175,6 +4221,17 @@ __metadata:
languageName: node
linkType: hard
+"css-to-react-native@npm:3.2.0":
+ version: 3.2.0
+ resolution: "css-to-react-native@npm:3.2.0"
+ dependencies:
+ camelize: "npm:^1.0.0"
+ css-color-keywords: "npm:^1.0.0"
+ postcss-value-parser: "npm:^4.0.2"
+ checksum: 10c0/fde850a511d5d3d7c55a1e9b8ed26b69a8ad4868b3487e36ebfbfc0b96fc34bc977d9cd1d61a289d0c74d3f9a662d8cee297da53d4433bf2e27d6acdff8e1003
+ languageName: node
+ linkType: hard
+
"css-to-react-native@npm:^2.2.2":
version: 2.3.2
resolution: "css-to-react-native@npm:2.3.2"
@@ -4193,6 +4250,13 @@ __metadata:
languageName: node
linkType: hard
+"csstype@npm:3.1.2":
+ version: 3.1.2
+ resolution: "csstype@npm:3.1.2"
+ checksum: 10c0/32c038af259897c807ac738d9eab16b3d86747c72b09d5c740978e06f067f9b7b1737e1b75e407c7ab1fe1543dc95f20e202b4786aeb1b8d3bdf5d5ce655e6c6
+ languageName: node
+ linkType: hard
+
"csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
@@ -6627,6 +6691,15 @@ __metadata:
languageName: node
linkType: hard
+"nanoid@npm:^3.3.6":
+ version: 3.3.8
+ resolution: "nanoid@npm:3.3.8"
+ bin:
+ nanoid: bin/nanoid.cjs
+ checksum: 10c0/4b1bb29f6cfebf3be3bc4ad1f1296fb0a10a3043a79f34fbffe75d1621b4318319211cd420549459018ea3592f0d2f159247a6f874911d6d26eaaadda2478120
+ languageName: node
+ linkType: hard
+
"node-fetch@npm:^1.0.1":
version: 1.7.3
resolution: "node-fetch@npm:1.7.3"
@@ -6907,6 +6980,24 @@ __metadata:
languageName: node
linkType: hard
+"postcss-value-parser@npm:^4.0.2":
+ version: 4.2.0
+ resolution: "postcss-value-parser@npm:4.2.0"
+ checksum: 10c0/f4142a4f56565f77c1831168e04e3effd9ffcc5aebaf0f538eee4b2d465adfd4b85a44257bb48418202a63806a7da7fe9f56c330aebb3cac898e46b4cbf49161
+ languageName: node
+ linkType: hard
+
+"postcss@npm:8.4.31":
+ version: 8.4.31
+ resolution: "postcss@npm:8.4.31"
+ dependencies:
+ nanoid: "npm:^3.3.6"
+ picocolors: "npm:^1.0.0"
+ source-map-js: "npm:^1.0.2"
+ checksum: 10c0/748b82e6e5fc34034dcf2ae88ea3d11fd09f69b6c50ecdd3b4a875cfc7cdca435c958b211e2cb52355422ab6fccb7d8f2f2923161d7a1b281029e4a913d59acf
+ languageName: node
+ linkType: hard
+
"potpack@npm:^1.0.1":
version: 1.0.2
resolution: "potpack@npm:1.0.2"
@@ -7751,6 +7842,7 @@ __metadata:
dependencies:
"@auth0/auth0-spa-js": "npm:^2.1.2"
"@carto/toolkit": "npm:0.0.1-rc.18"
+ "@emotion/is-prop-valid": "npm:^1.2.1"
"@kepler.gl/actions": "npm:^3.0.0-alpha.1"
"@kepler.gl/cloud-providers": "npm:^3.0.0-alpha.1"
"@kepler.gl/components": "npm:^3.0.0-alpha.1"
@@ -7787,7 +7879,7 @@ __metadata:
redux-actions: "npm:^2.2.1"
redux-logger: "npm:^3.0.6"
redux-thunk: "npm:^1.0.0"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
languageName: unknown
linkType: soft
@@ -7919,6 +8011,13 @@ __metadata:
languageName: node
linkType: hard
+"shallowequal@npm:1.1.0":
+ version: 1.1.0
+ resolution: "shallowequal@npm:1.1.0"
+ checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
+ languageName: node
+ linkType: hard
+
"side-channel@npm:^1.0.4":
version: 1.0.6
resolution: "side-channel@npm:1.0.6"
@@ -7966,6 +8065,13 @@ __metadata:
languageName: node
linkType: hard
+"source-map-js@npm:^1.0.2":
+ version: 1.2.1
+ resolution: "source-map-js@npm:1.2.1"
+ checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf
+ languageName: node
+ linkType: hard
+
"sourcemap-codec@npm:^1.4.8":
version: 1.4.8
resolution: "sourcemap-codec@npm:1.4.8"
@@ -8110,6 +8216,26 @@ __metadata:
languageName: node
linkType: hard
+"styled-components@npm:6.1.8":
+ version: 6.1.8
+ resolution: "styled-components@npm:6.1.8"
+ dependencies:
+ "@emotion/is-prop-valid": "npm:1.2.1"
+ "@emotion/unitless": "npm:0.8.0"
+ "@types/stylis": "npm:4.2.0"
+ css-to-react-native: "npm:3.2.0"
+ csstype: "npm:3.1.2"
+ postcss: "npm:8.4.31"
+ shallowequal: "npm:1.1.0"
+ stylis: "npm:4.3.1"
+ tslib: "npm:2.5.0"
+ peerDependencies:
+ react: ">= 16.8.0"
+ react-dom: ">= 16.8.0"
+ checksum: 10c0/fafe4b9198d5d7980c2358821d1a89f86200d55c8eec03670cf12cf43b8a05a77eafaf0872cd85821f68238308e0f5c9d9aa43a62e6987c65b70baa2c3277ab8
+ languageName: node
+ linkType: hard
+
"styled-components@npm:^4.1.3":
version: 4.4.1
resolution: "styled-components@npm:4.4.1"
@@ -8143,6 +8269,13 @@ __metadata:
languageName: node
linkType: hard
+"stylis@npm:4.3.1":
+ version: 4.3.1
+ resolution: "stylis@npm:4.3.1"
+ checksum: 10c0/33e8ebd2bfa5f0bd0215f718dc2d3be896e1d00c5bcaeb9a4ae03cf239db6867af9eee230f57229bf1c29499357073ba3e6b547484ba1db2f5de1e8be7d4eee9
+ languageName: node
+ linkType: hard
+
"stylis@npm:^3.5.0":
version: 3.5.4
resolution: "stylis@npm:3.5.4"
@@ -8351,6 +8484,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:2.5.0":
+ version: 2.5.0
+ resolution: "tslib@npm:2.5.0"
+ checksum: 10c0/e32fc99cc730dd514e53c44e668d76016e738f0bcc726aad5dbd2d335cf19b87a95a9b1e4f0a9993e370f1d702b5e471cdd4acabcac428a3099d496b9af2021e
+ languageName: node
+ linkType: hard
+
"tslib@npm:^2.0.0, tslib@npm:^2.4.0, tslib@npm:^2.5.3, tslib@npm:^2.6.2":
version: 2.6.3
resolution: "tslib@npm:2.6.3"
diff --git a/examples/node-app/package.json b/examples/node-app/package.json
index 94de7d301..9356878f5 100644
--- a/examples/node-app/package.json
+++ b/examples/node-app/package.json
@@ -14,7 +14,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/examples/open-modal/package.json b/examples/open-modal/package.json
index a8b955ef0..1c16a766e 100644
--- a/examples/open-modal/package.json
+++ b/examples/open-modal/package.json
@@ -15,7 +15,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/examples/replace-component/package.json b/examples/replace-component/package.json
index 585610936..d59832799 100644
--- a/examples/replace-component/package.json
+++ b/examples/replace-component/package.json
@@ -17,7 +17,7 @@
"react-redux": "^8.0.5",
"react-virtualized": "^9.21.0",
"redux-actions": "^2.2.1",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"esbuild-plugin-replace": "^1.4.0"
diff --git a/examples/replace-component/src/components/side-bar.js b/examples/replace-component/src/components/side-bar.js
index 6d03f8f0a..46cb09ba0 100644
--- a/examples/replace-component/src/components/side-bar.js
+++ b/examples/replace-component/src/components/side-bar.js
@@ -29,7 +29,7 @@ const StyledCloseButton = styled.div`
width: 80px;
right: 0;
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.primaryBtnBgdHover};
}
diff --git a/package.json b/package.json
index 40cb2ce87..0a8b7ddff 100644
--- a/package.json
+++ b/package.json
@@ -155,6 +155,7 @@
"babel-plugin-istanbul": "^6.0.0",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-search-and-replace": "^1.0.0",
+ "babel-plugin-styled-components": "^2.1.4",
"babel-plugin-transform-builtin-extend": "^1.1.0",
"babelify": "^10.0.0",
"css-loader": "5.2.7",
@@ -197,7 +198,7 @@
"sinon-stub-promise": "^4.0.0",
"source-map-loader": "^1.1.1",
"style-loader": "2.0.0",
- "styled-components": "^4.1.3",
+ "styled-components": "6.1.8",
"stylelint": "^13.6.1",
"stylelint-config-recommended": "^3.0.0",
"stylelint-config-styled-components": "^0.1.1",
@@ -253,7 +254,7 @@
"peerDependencies": {
"react": ">=18.2",
"react-dom": ">=18.2",
- "styled-components": "^4.x || ^5.x"
+ "styled-components": "6.1.8"
},
"nyc": {
"sourceMap": false,
diff --git a/src/ai-assistant/src/components/ai-assistant-component.tsx b/src/ai-assistant/src/components/ai-assistant-component.tsx
index fd56ff644..93972cbbb 100644
--- a/src/ai-assistant/src/components/ai-assistant-component.tsx
+++ b/src/ai-assistant/src/components/ai-assistant-component.tsx
@@ -35,8 +35,9 @@ import {updateLayerColorFunctionDefinition} from '../tools/layer-style-function'
import {SelectedKeplerGlActions} from './ai-assistant-manager';
import {getDatasetContext, getValuesFromDataset, highlightRows} from '../tools/utils';
+type ThemeProps = {theme: any};
+
export type AiAssistantComponentProps = {
- theme: any;
aiAssistant: AiAssistantState;
updateAiAssistantMessages: ActionHandler<typeof updateAiAssistantMessages>;
setStartScreenCapture: ActionHandler<typeof setStartScreenCapture>;
@@ -58,7 +59,7 @@ const StyledAiAssistantComponent = styled.div`
AiAssistantComponentFactory.deps = [];
function AiAssistantComponentFactory() {
- const AiAssistantComponent: React.FC<AiAssistantComponentProps> = ({
+ const AiAssistantComponent: React.FC<AiAssistantComponentProps & ThemeProps> = ({
theme,
aiAssistant,
updateAiAssistantMessages,
@@ -67,7 +68,7 @@ function AiAssistantComponentFactory() {
keplerGlActions,
mapStyle,
visState
- }: AiAssistantComponentProps) => {
+ }: AiAssistantComponentProps & ThemeProps) => {
const functions = [
basemapFunctionDefinition({mapStyleChange: keplerGlActions.mapStyleChange, mapStyle}),
loadUrlFunctionDefinition({
@@ -175,7 +176,7 @@ function AiAssistantComponentFactory() {
);
};
- return withTheme(AiAssistantComponent);
+ return withTheme(AiAssistantComponent) as React.FC<AiAssistantComponentProps>;
}
export default AiAssistantComponentFactory;
diff --git a/src/ai-assistant/src/components/ai-assistant-config.tsx b/src/ai-assistant/src/components/ai-assistant-config.tsx
index 3a080fd2f..7bce06323 100644
--- a/src/ai-assistant/src/components/ai-assistant-config.tsx
+++ b/src/ai-assistant/src/components/ai-assistant-config.tsx
@@ -32,11 +32,12 @@ const PROVIDER_MODELS = {
]
};
+type ThemeProps = {theme: any};
+
export type AiAssistantConfigProps = {
- theme: any;
aiAssistantConfig: AiAssistantConfig;
updateAiAssistantConfig: (aiAssistantConfig: AiAssistantConfig) => void;
-} & WrappedComponentProps;
+};
const SectionTitle = styled.div`
font-size: ${props => props.theme.inputFontSize};
@@ -136,11 +137,9 @@ const StyleErrorMessage = styled.div`
AiAssistantConfigFactory.deps = [RangeSliderFactory];
function AiAssistantConfigFactory(RangeSlider: ReturnType<typeof RangeSliderFactory>) {
- const AiAssistantConfig: React.FC<AiAssistantConfigProps> = ({
- intl,
- aiAssistantConfig,
- updateAiAssistantConfig
- }) => {
+ const AiAssistantConfig: React.FC<
+ AiAssistantConfigProps & WrappedComponentProps & ThemeProps
+ > = ({intl, aiAssistantConfig, updateAiAssistantConfig}) => {
const [provider, setProvider] = useState(aiAssistantConfig.provider || 'openai');
const [model, setModel] = useState(aiAssistantConfig.model || PROVIDER_MODELS[provider][0]);
const [apiKey, setApiKey] = useState(aiAssistantConfig.apiKey || '');
@@ -367,7 +366,7 @@ function AiAssistantConfigFactory(RangeSlider: ReturnType<typeof RangeSliderFact
);
};
- return withTheme(injectIntl(AiAssistantConfig));
+ return withTheme(injectIntl(AiAssistantConfig)) as React.FC<AiAssistantConfigProps>;
}
export default AiAssistantConfigFactory;
diff --git a/src/components/package.json b/src/components/package.json
index 322d14ed2..3ac2f4092 100644
--- a/src/components/package.json
+++ b/src/components/package.json
@@ -36,6 +36,7 @@
"@dnd-kit/modifiers": "^7.0.0",
"@dnd-kit/sortable": "^8.0.0",
"@dnd-kit/utilities": "^3.2.2",
+ "@emotion/is-prop-valid": "^1.2.1",
"@floating-ui/react": "0.25.1",
"@kepler.gl/actions": "3.1.0-alpha.3",
"@kepler.gl/cloud-providers": "3.1.0-alpha.3",
@@ -79,7 +80,7 @@
"@types/react-redux": "^7.1.23",
"@types/react-virtualized": "^9.21.30",
"@types/react-vis": "1.11.7",
- "@types/styled-components": "^5.1.25",
+ "@types/styled-components": "^5.1.32",
"classnames": "^2.2.1",
"copy-to-clipboard": "^3.3.1",
"d3-array": "^2.8.0",
@@ -125,7 +126,7 @@
"react-vis": "1.11.7",
"redux": "^4.2.1",
"reselect": "^4.0.0",
- "styled-components": "^4.1.3",
+ "styled-components": "6.1.8",
"suncalc": "^1.9.0",
"viewport-mercator-project": "^6.0.0"
},
diff --git a/src/components/src/bottom-widget.tsx b/src/components/src/bottom-widget.tsx
index 0d46d13c7..671523096 100644
--- a/src/components/src/bottom-widget.tsx
+++ b/src/components/src/bottom-widget.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React, {forwardRef, useMemo, useCallback} from 'react';
-import styled, {withTheme} from 'styled-components';
+import styled, {withTheme, IStyledComponent} from 'styled-components';
import {FILTER_VIEW_TYPES} from '@kepler.gl/constants';
import {hasPortableWidth, isSideFilter, mergeFilterWithTimeline} from '@kepler.gl/utils';
@@ -14,15 +14,20 @@ import {bottomWidgetSelector} from './kepler-gl';
import FilterAnimationControllerFactory from './filter-animation-controller';
import LayerAnimationControllerFactory from './layer-animation-controller';
import AnimationControlFactory from './common/animation-control/animation-control';
+import {BaseComponentProps} from './types';
const maxWidth = 1080;
-interface BottomWidgetContainerProps {
+export type BottomWidgetContainerProps = BaseComponentProps & {
hasPadding?: boolean;
- width?: number;
-}
+ width: number;
+ ref: React.ForwardedRef<HTMLDivElement>;
+};
-const BottomWidgetContainer = styled.div<BottomWidgetContainerProps>`
+const BottomWidgetContainer: IStyledComponent<
+ 'web',
+ BottomWidgetContainerProps
+> = styled.div<BottomWidgetContainerProps>`
display: flex;
flex-direction: column;
padding-top: ${props => (props.hasPadding ? props.theme.bottomWidgetPaddingTop : 0)}px;
@@ -44,7 +49,7 @@ export type BottomWidgetProps = {
containerW: number;
} & ReturnType<typeof bottomWidgetSelector>;
type ThemeProp = {
- theme: Record<string, any>;
+ theme: any;
};
type BottomWidgetThemedProps = BottomWidgetProps & ThemeProp;
@@ -222,11 +227,10 @@ export default function BottomWidgetFactory(
);
};
- /* eslint-disable react/display-name */
return withTheme(
- // @ts-ignore
- forwardRef((props: BottomWidgetThemedProps, ref) => <BottomWidget {...props} rootRef={ref} />)
+ forwardRef((props: BottomWidgetThemedProps, ref: React.ForwardedRef<HTMLDivElement>) => (
+ <BottomWidget {...props} rootRef={ref} />
+ ))
);
- /* eslint-enable react/display-name */
}
/* eslint-enable complexity */
diff --git a/src/components/src/common/action-panel.tsx b/src/components/src/common/action-panel.tsx
index 87d55034b..14bdccef2 100644
--- a/src/components/src/common/action-panel.tsx
+++ b/src/components/src/common/action-panel.tsx
@@ -3,15 +3,16 @@
import classnames from 'classnames';
import React, {useCallback, PropsWithChildren, ElementType, CSSProperties, ReactNode} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {ArrowRight} from './icons';
import Checkbox from './switch';
+import {BaseComponentProps} from '../types';
import TippyTooltip from './tippy-tooltip';
export type ActionPanelProps = PropsWithChildren<{
color?: string;
className?: string;
- direction?: string;
+ direction?: CSSProperties['direction'];
}>;
export type ActionPanelItemProps = PropsWithChildren<{
@@ -27,10 +28,6 @@ export type ActionPanelItemProps = PropsWithChildren<{
style?: CSSProperties;
}>;
-export interface DirectionProp {
- direction: string;
-}
-
const StyledItem = styled.div`
display: flex;
flex-direction: row;
@@ -44,7 +41,7 @@ const StyledItem = styled.div`
max-width: 200px;
position: relative;
- ${props => (props.color ? `border-left: 3px solid rgb(${props.color});` : '')} :hover {
+ ${props => (props.color ? `border-left: 3px solid rgb(${props.color});` : '')} &:hover {
color: ${props => props.theme.textColorHl};
.nested-group {
display: block;
@@ -114,7 +111,6 @@ const renderChildren = (child: ReactNode, index: number) =>
className: classnames('action-panel-item', child.props.className)
});
-/** @type {typeof import('./action-panel').ActionPanelItem} */
export const ActionPanelItem = React.memo(
({
children,
@@ -190,7 +186,14 @@ export const ActionPanelItem = React.memo(
ActionPanelItem.displayName = 'ActionPanelItem';
-const StyledActionPanel = styled.div<DirectionProp>`
+export type StyledActionPanelProps = BaseComponentProps & {
+ direction?: string;
+};
+
+const StyledActionPanel: IStyledComponent<
+ 'web',
+ StyledActionPanelProps
+> = styled.div<StyledActionPanelProps>`
display: flex;
flex-direction: ${props => props.direction};
box-shadow: ${props => props.theme.dropdownListShadow};
@@ -208,7 +211,7 @@ const StyledActionPanel = styled.div<DirectionProp>`
`;
// React compound element https://medium.com/@Dane_s/react-js-compound-components-a6e54b5c9992
-/** @type {typeof import('./action-panel').ActionPanel} */
+// @ts-expect-error looks like not valid default value for direction prop
const ActionPanel = ({children, className, direction = 'column'}: ActionPanelProps) => (
<StyledActionPanel className={className} direction={direction}>
{React.Children.map(children, renderChildren)}
diff --git a/src/components/src/common/animation-control/playback-controls.tsx b/src/components/src/common/animation-control/playback-controls.tsx
index 4c07370cf..b3a55b6ea 100644
--- a/src/components/src/common/animation-control/playback-controls.tsx
+++ b/src/components/src/common/animation-control/playback-controls.tsx
@@ -2,25 +2,29 @@
// Copyright contributors to the kepler.gl project
import React, {useState, useCallback} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import classnames from 'classnames';
import {Reset, Play, Pause, Save, Rocket, AnchorWindow, FreeWindow} from '../icons';
import {ANIMATION_WINDOW} from '@kepler.gl/constants';
-import {Filter} from '@kepler.gl/types';
+import {Filter, TimeRangeFilter} from '@kepler.gl/types';
import AnimationSpeedSliderFactory from './animation-speed-slider';
import WindowActionControlFactory from './window-action-control';
import AnimationWindowControlFactory, {AnimationItem} from './animation-window-control';
import ResetControlFactory from './reset-control';
import PlayControlFactory from './play-control';
import SpeedControlFactory from './speed-control';
+import {BaseComponentProps} from '../../types';
const DEFAULT_BUTTON_HEIGHT = '20px';
-interface StyledAnimationControlsProps {
+export type StyledAnimationControlsProps = BaseComponentProps & {
width?: number;
-}
+};
-const StyledAnimationControls = styled.div<StyledAnimationControlsProps>`
+const StyledAnimationControls: IStyledComponent<
+ 'web',
+ StyledAnimationControlsProps
+> = styled.div<StyledAnimationControlsProps>`
display: flex;
position: relative;
width: ${props => props.width}px;
@@ -64,17 +68,17 @@ export interface PlaybackControlsProps {
isAnimating?: boolean;
width?: number;
speed: number;
- animationWindow?: string;
+ animationWindow?: null | TimeRangeFilter['animationWindow'];
setFilterAnimationWindow?: (id: string) => void;
- updateAnimationSpeed?: (val: number) => void;
+ updateAnimationSpeed?: (idx: number, speed: number) => void;
pauseAnimation?: () => void;
resetAnimation?: () => void;
startAnimation: () => void;
- playbackIcons?: typeof DEFAULT_ICONS;
+ playbackIcons?: Record<string, React.FC<{height: number}>>;
animationItems?: {[key: string]: AnimationItem};
buttonStyle?: string;
buttonHeight?: string;
- playbackActionItems?: any[];
+ playbackActionItems?: React.FC[];
className?: string;
}
@@ -105,8 +109,8 @@ function PlaybackControlsFactory(
// eslint-disable-next-line complexity
const PlaybackControls: React.FC<PlaybackControlsProps> = ({
filter,
- isAnimatable,
- isAnimating = true,
+ isAnimatable = true,
+ isAnimating,
width,
speed,
animationWindow = ANIMATION_WINDOW.free,
diff --git a/src/components/src/common/color-legend.tsx b/src/components/src/common/color-legend.tsx
index 45f8c3e22..151c2042b 100644
--- a/src/components/src/common/color-legend.tsx
+++ b/src/components/src/common/color-legend.tsx
@@ -52,7 +52,7 @@ export function ResetColorLabelFactory() {
color: ${props => props.theme.labelColorLT};
cursor: pointer;
- :hover {
+ &:hover {
color: ${props => props.theme.panelHeaderIconHover};
}
`;
diff --git a/src/components/src/common/data-table/index.tsx b/src/components/src/common/data-table/index.tsx
index 50896a299..c6e1a0721 100644
--- a/src/components/src/common/data-table/index.tsx
+++ b/src/components/src/common/data-table/index.tsx
@@ -173,7 +173,7 @@ export const Container = styled.div<ContainerProps>`
}
}
- :focus {
+ &:focus {
outline: none;
}
`;
@@ -194,7 +194,7 @@ const columnWidthFunction =
};
interface GetRowCellProps {
- dataContainer: DataContainerInterface;
+ dataContainer: DataContainerInterface | null;
columns: (string & {ghost?: boolean})[];
column: string;
colMeta;
@@ -212,7 +212,7 @@ const defaultGetRowCell = (
const rowIdx = sortOrder && sortOrder.length ? get(sortOrder, rowIndex) : rowIndex;
const {type} = colMeta[column];
- const value = dataContainer.valueAt(rowIdx, columns.indexOf(column));
+ const value = dataContainer?.valueAt(rowIdx, columns.indexOf(column));
return value === null || value === undefined || value === ''
? ''
: formatter
@@ -237,7 +237,7 @@ const StyledStatsControl = styled.div<StatsControlProps>`
font-size: 12px;
color: ${props => props.theme.activeColor};
background-color: ${props => props.theme.headerCellStatsControlBackground};
- :hover {
+ &:hover {
cursor: pointer;
}
@@ -279,8 +279,8 @@ interface TableSectionProps {
isPinned?: boolean;
columns: (string & {ghost?: boolean})[];
headerGridProps?;
- fixedWidth?: number;
- fixedHeight?: number;
+ fixedWidth?: number | null;
+ fixedHeight?: number | null;
onScroll?: (params: OnScrollParams) => void;
scrollTop?: number;
dataGridProps: {
@@ -381,10 +381,10 @@ export interface DataTableProps {
cellSizeCache?: CellSizeCache;
pinnedColumns?: string[];
columns: (string & {ghost?: boolean})[];
- fixedWidth?: number;
+ fixedWidth?: number | null;
theme?: any;
- dataContainer: DataContainerInterface;
- fixedHeight?: number;
+ dataContainer: DataContainerInterface | null;
+ fixedHeight?: number | null;
colMeta: ColMeta;
sortColumn: SortColumn;
sortTableColumn: (column: string, mode?: string) => void;
@@ -405,7 +405,9 @@ interface DataTableState {
}
DataTableFactory.deps = [HeaderCellFactory];
-function DataTableFactory(HeaderCell: ReturnType<typeof HeaderCellFactory>) {
+function DataTableFactory(
+ HeaderCell: ReturnType<typeof HeaderCellFactory>
+): React.ComponentType<DataTableProps> {
class DataTable extends Component<DataTableProps, DataTableState> {
static defaultProps = {
dataContainer: null,
@@ -698,7 +700,7 @@ function DataTableFactory(HeaderCell: ReturnType<typeof HeaderCellFactory>) {
}
}
- return withTheme(DataTable) as React.ComponentType<DataTableProps>;
+ return withTheme(DataTable as React.ComponentType<DataTableProps>);
}
export default DataTableFactory;
diff --git a/src/components/src/common/file-uploader/file-upload-progress.tsx b/src/components/src/common/file-uploader/file-upload-progress.tsx
index 7b431c552..9beac5a99 100644
--- a/src/components/src/common/file-uploader/file-upload-progress.tsx
+++ b/src/components/src/common/file-uploader/file-upload-progress.tsx
@@ -87,13 +87,15 @@ const UploadProgress = ({message, fileName, percent, error, theme}: UploadProgre
);
};
-interface FileUploadProgressProps {
+type FileUploadProgressProps = {
fileLoadingProgress: FileLoadingProgress;
theme: any;
-}
+};
-/** @type {React.FunctionComponent<FileUploadProgressProps>} */
-const FileUploadProgress = ({fileLoadingProgress, theme}: FileUploadProgressProps) => (
+const FileUploadProgress: React.FC<FileUploadProgressProps> = ({
+ fileLoadingProgress,
+ theme
+}: FileUploadProgressProps) => (
<StyledContainer>
<StyledProgressWrapper>
{Object.values(fileLoadingProgress).map(item => (
@@ -103,4 +105,4 @@ const FileUploadProgress = ({fileLoadingProgress, theme}: FileUploadProgressProp
</StyledContainer>
);
-export default withTheme(FileUploadProgress);
+export default withTheme(FileUploadProgress) as React.FC<FileUploadProgressProps>;
diff --git a/src/components/src/common/file-uploader/upload-button.tsx b/src/components/src/common/file-uploader/upload-button.tsx
index be8166174..fe401c762 100644
--- a/src/components/src/common/file-uploader/upload-button.tsx
+++ b/src/components/src/common/file-uploader/upload-button.tsx
@@ -10,7 +10,7 @@ const Wrapper = styled.div`
font-size: 12px;
text-decoration: underline;
- :hover {
+ &:hover {
cursor: pointer;
font-weight: 500;
}
diff --git a/src/components/src/common/histogram-plot.tsx b/src/components/src/common/histogram-plot.tsx
index c3f3ddfab..3ef5aa5aa 100644
--- a/src/components/src/common/histogram-plot.tsx
+++ b/src/components/src/common/histogram-plot.tsx
@@ -194,6 +194,7 @@ function HistogramPlotFactory() {
: histogramStyle.unHighlightedW;
return (
<Bar
+ isOverlay={false}
inRange={inRange}
color={HISTOGRAM_MASK_FGCOLOR}
key={`mask-${idx}`}
@@ -271,6 +272,7 @@ function HistogramPlotFactory() {
if (startX > 0 && startX + barWidth * histogramStyle.unHighlightedW <= width) {
return (
<Bar
+ isOverlay={false}
inRange={inRange}
color={colorsByGroup?.[key]}
key={`bar-${idx}`}
diff --git a/src/components/src/common/icons/draggable-dots.tsx b/src/components/src/common/icons/draggable-dots.tsx
index 50a07a2ab..d560d206c 100644
--- a/src/components/src/common/icons/draggable-dots.tsx
+++ b/src/components/src/common/icons/draggable-dots.tsx
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: MIT
+// Copyright contributors to the kepler.gl project
+
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Base from './base';
diff --git a/src/components/src/common/icons/horizontal-resize-handle.tsx b/src/components/src/common/icons/horizontal-resize-handle.tsx
index c5879ce58..4a71daf67 100644
--- a/src/components/src/common/icons/horizontal-resize-handle.tsx
+++ b/src/components/src/common/icons/horizontal-resize-handle.tsx
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: MIT
+// Copyright contributors to the kepler.gl project
+
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import Base from './base';
diff --git a/src/components/src/common/icons/pin.tsx b/src/components/src/common/icons/pin.tsx
index 9f67db9b7..fd50ba3be 100644
--- a/src/components/src/common/icons/pin.tsx
+++ b/src/components/src/common/icons/pin.tsx
@@ -3,9 +3,9 @@
import React, {Component} from 'react';
import Base, {BaseProps} from './base';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
-const StyledBase = styled(Base)`
+const StyledBase: IStyledComponent<'web'> = styled(Base)`
transform: rotate(30deg);
`;
diff --git a/src/components/src/common/info-helper.tsx b/src/components/src/common/info-helper.tsx
index 41fc8b362..aa22c127e 100644
--- a/src/components/src/common/info-helper.tsx
+++ b/src/components/src/common/info-helper.tsx
@@ -22,7 +22,7 @@ const StyledInfoHelper = styled.div<StyledInfoHelperProps>`
width: ${props => (props.width ? `${props.width}px` : 'auto')};
max-width: ${props => (props.width ? 'auto' : '100px')};
}
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.textColorHl};
}
diff --git a/src/components/src/common/item-selector/chickleted-input.tsx b/src/components/src/common/item-selector/chickleted-input.tsx
index ed2b74f40..c22e7eecc 100644
--- a/src/components/src/common/item-selector/chickleted-input.tsx
+++ b/src/components/src/common/item-selector/chickleted-input.tsx
@@ -1,40 +1,26 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React, {ElementType, MouseEventHandler, ReactNode, useMemo, useCallback} from 'react';
+import React, {MouseEventHandler, ReactNode, useMemo, useCallback} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {DndContext, DragOverlay, pointerWithin} from '@dnd-kit/core';
import {SortableContext, useSortable, arrayMove} from '@dnd-kit/sortable';
import {restrictToParentElement} from '@dnd-kit/modifiers';
import Delete from '../icons/delete';
import {FormattedMessage} from '@kepler.gl/localization';
+import {BaseComponentProps} from '../../types';
-type Item = string | number | boolean | object | undefined;
-interface ChickletedInputProps {
- // required properties
- onClick: MouseEventHandler<HTMLDivElement>;
- removeItem: (item: Item, e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
-
- // optional properties
- selectedItems?: any[];
- disabled?: boolean;
- displayOption?: (item: Item) => string;
- focus?: boolean;
- error?: boolean;
- placeholder?: string;
+export type ChickletButtonProps = BaseComponentProps & {
inputTheme?: string;
- CustomChickletComponent?: ElementType | null;
- className?: string;
- reorderItems?: (newOrder: any) => void;
-}
-
-interface ChickletButtonProps {
- inputTheme?: string;
-}
+ ref?: (node: HTMLElement | null) => void;
+};
-export const ChickletButton = styled.div<ChickletButtonProps>`
+export const ChickletButton: IStyledComponent<
+ 'web',
+ ChickletButtonProps
+> = styled.div<ChickletButtonProps>`
background: ${props =>
props.inputTheme === 'light' ? props.theme.chickletBgdLT : props.theme.chickletBgd};
border-radius: 1px;
@@ -48,20 +34,20 @@ export const ChickletButton = styled.div<ChickletButtonProps>`
align-items: center;
max-width: calc(100% - 8px);
- :hover {
+ &:hover {
color: ${props =>
props.inputTheme === 'light' ? props.theme.textColorHlLT : props.theme.textColorHl};
}
`;
const DND_MODIFIERS = [restrictToParentElement];
-export const ChickletTag = styled.span`
+export const ChickletTag: IStyledComponent<'web'> = styled.span`
margin-right: 10px;
text-overflow: ellipsis;
width: 100%;
overflow: hidden;
- :hover {
+ &:hover {
overflow: visible;
}
`;
@@ -80,12 +66,18 @@ const Chicklet = ({disabled, name, remove, inputTheme}: ChickletProps) => (
</ChickletButton>
);
-interface ChickletedInputContainerProps {
+export type ChickletedInputContainerProps = BaseComponentProps & {
inputTheme?: string;
hasPlaceholder?: boolean;
-}
+ focus?: HTMLInputElement['focus'];
+ disabled?: boolean;
+ onClick?: (e: React.MouseEvent) => void;
+};
-const ChickletedInputContainer = styled.div<ChickletedInputContainerProps>`
+const ChickletedInputContainer: IStyledComponent<
+ 'web',
+ ChickletedInputContainerProps
+> = styled.div<ChickletedInputContainerProps>`
${props =>
props.inputTheme === 'secondary'
? props.theme.secondaryChickletedInput
@@ -146,6 +138,17 @@ const ChickletedItem = ({
);
};
+type Item = string | number | boolean | object | undefined;
+
+export type ChickletedInputProps = ChickletedInputContainerProps & {
+ selectedItems?: any[];
+ placeholder?: string;
+ CustomChickletComponent?: React.ComponentType<any> | null;
+ reorderItems?: (newOrder: any) => void;
+ displayOption?: (item: Item) => string;
+ removeItem: (item: Item, e: React.MouseEvent<SVGSVGElement, MouseEvent>) => void;
+};
+
const ChickletedInput: React.FC<ChickletedInputProps> = ({
disabled,
onClick,
diff --git a/src/components/src/common/item-selector/dropdown-list.tsx b/src/components/src/common/item-selector/dropdown-list.tsx
index 3c06b8406..386adf9fd 100644
--- a/src/components/src/common/item-selector/dropdown-list.tsx
+++ b/src/components/src/common/item-selector/dropdown-list.tsx
@@ -3,8 +3,9 @@
import React, {Component, ElementType} from 'react';
import classNames from 'classnames';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {INIT_FILTER_ITEMS_IN_DROPDOWN} from '@kepler.gl/constants';
+import {BaseComponentProps} from '../../types';
const LEFT_BUTTON = 0;
@@ -17,9 +18,21 @@ export const classList = {
listItemFixed: 'list__item__fixed'
};
+export type ListItemProps<Option> = {
+ value: Option;
+ displayOption: (opt: Option) => string;
+ disabled?: boolean;
+ light?: boolean;
+};
+
const defaultDisplay = d => d;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-export const ListItem = ({value, displayOption = defaultDisplay, disabled, light}) => {
+export const ListItem = ({
+ value,
+ displayOption = defaultDisplay,
+ disabled,
+ light
+}: ListItemProps<any>) => {
const displayValue = displayOption(value);
return (
<span title={displayValue} className={classNames(classList.listItemAnchor, {disabled})}>
@@ -28,11 +41,14 @@ export const ListItem = ({value, displayOption = defaultDisplay, disabled, light
);
};
-interface DropdownListWrapperProps {
+export type DropdownListWrapperProps = BaseComponentProps & {
light?: boolean;
-}
+};
-const DropdownListWrapper = styled.div<DropdownListWrapperProps>`
+const DropdownListWrapper: IStyledComponent<
+ 'web',
+ DropdownListWrapperProps
+> = styled.div<DropdownListWrapperProps>`
background-color: ${props =>
props.light ? props.theme.dropdownListBgdLT : props.theme.dropdownListBgd};
border-top: 1px solid
diff --git a/src/components/src/common/item-selector/dropdown-select.tsx b/src/components/src/common/item-selector/dropdown-select.tsx
index c537830a7..c051c8a3e 100644
--- a/src/components/src/common/item-selector/dropdown-select.tsx
+++ b/src/components/src/common/item-selector/dropdown-select.tsx
@@ -89,7 +89,7 @@ const DropdownSelectActionRight = styled.div`
display: flex;
color: ${props => props.theme.subtextColor};
- :hover {
+ &:hover {
color: ${props => props.theme.textColor};
}
`;
diff --git a/src/components/src/common/item-selector/item-selector.tsx b/src/components/src/common/item-selector/item-selector.tsx
index 99cfe058b..dd62d5213 100644
--- a/src/components/src/common/item-selector/item-selector.tsx
+++ b/src/components/src/common/item-selector/item-selector.tsx
@@ -4,7 +4,7 @@
import React, {Component, createRef, ComponentType, MouseEventHandler, RefObject} from 'react';
import classnames from 'classnames';
import uniqBy from 'lodash.uniqby';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import Accessor from './accessor';
import ChickletedInput from './chickleted-input';
@@ -17,12 +17,15 @@ import {injectIntl, IntlShape} from 'react-intl';
import {ListItemProps} from './dropdown-select';
import DropdownSelect from './dropdown-select';
-interface DropdownWrapperProps {
+export type DropdownWrapperProps = {
placement?: string;
width: number;
-}
+};
-const DropdownWrapper = styled.div<DropdownWrapperProps>`
+const DropdownWrapper: IStyledComponent<
+ 'web',
+ DropdownWrapperProps
+> = styled.div<DropdownWrapperProps>`
border: 0;
width: 100%;
left: 0;
diff --git a/src/components/src/common/item-selector/typeahead.tsx b/src/components/src/common/item-selector/typeahead.tsx
index 74edb7536..4aacb7f5b 100644
--- a/src/components/src/common/item-selector/typeahead.tsx
+++ b/src/components/src/common/item-selector/typeahead.tsx
@@ -5,13 +5,14 @@ import React, {Component, createRef, ElementType, KeyboardEventHandler} from 're
import {polyfill} from 'react-lifecycles-compat';
import fuzzy from 'fuzzy';
import classNames from 'classnames';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {console as Console} from 'global/window';
import Accessor from './accessor';
import DropdownList, {ListItem} from './dropdown-list';
import {Search} from '../icons';
import {KeyEvent} from '@kepler.gl/constants';
+import {BaseComponentProps} from '../../types';
const DEFAULT_CLASS = 'typeahead';
/**
@@ -21,18 +22,22 @@ const DEFAULT_CLASS = 'typeahead';
* keyboard or mouse to select.
*/
-interface TypeaheadWrapperProps {
+export type TypeaheadWrapperProps = BaseComponentProps & {
light?: boolean;
-}
+ ref: React.RefObject<HTMLDivElement>;
+};
-const TypeaheadWrapper = styled.div<TypeaheadWrapperProps>`
+const TypeaheadWrapper: IStyledComponent<
+ 'web',
+ TypeaheadWrapperProps
+> = styled.div<TypeaheadWrapperProps>`
display: flex;
flex-direction: column;
background-color: ${props =>
props.light ? props.theme.dropdownListBgdLT : props.theme.dropdownListBgd};
box-shadow: ${props => props.theme.dropdownListShadow};
- :focus {
+ &:focus {
outline: 0;
}
`;
@@ -43,8 +48,21 @@ const InputBox = styled.div.attrs({
padding: 8px;
`;
-const TypeaheadInput = styled.input<TypeaheadWrapperProps>`
- ${props => (props.light ? props.theme.inputLT : props.theme.secondaryInput)} :hover {
+export type TypeaheadInputProps = BaseComponentProps & {
+ light?: boolean;
+ value?: string;
+ type: string;
+ disabled?: boolean;
+ ref: React.RefObject<HTMLDivElement>;
+ placeholder?: string | undefined;
+};
+
+const TypeaheadInput: IStyledComponent<
+ 'web',
+ TypeaheadInputProps
+> = styled.input<TypeaheadInputProps>`
+ ${props => (props.light ? props.theme.inputLT : props.theme.secondaryInput)}
+ &:hover {
cursor: pointer;
background-color: ${props =>
props.light ? props.theme.selectBackgroundLT : props.theme.secondaryInputBgd};
diff --git a/src/components/src/common/loading-spinner.tsx b/src/components/src/common/loading-spinner.tsx
index cc356faf5..0eae7f156 100644
--- a/src/components/src/common/loading-spinner.tsx
+++ b/src/components/src/common/loading-spinner.tsx
@@ -1,8 +1,10 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React from 'react';
-import styled, {keyframes} from 'styled-components';
+import React, {CSSProperties} from 'react';
+import styled, {keyframes, IStyledComponent} from 'styled-components';
+
+import {BaseComponentProps} from '../types';
const animationName = keyframes`
0% {
@@ -26,23 +28,26 @@ const Loader = styled.span`
animation-name: ${animationName};
}`;
-interface LoadingWrapperProps {
- borderColor?: string;
-}
+export type LoadingWrapperProps = BaseComponentProps & {
+ borderColor?: CSSProperties['borderColor'];
+};
-const LoadingWrapper = styled.div<LoadingWrapperProps>`
+const LoadingWrapper: IStyledComponent<
+ 'web',
+ LoadingWrapperProps
+> = styled.div<LoadingWrapperProps>`
border-radius: 50%;
border: 3px solid ${props => props.borderColor || props.theme.borderColorLT};
padding: 2px;
`;
-interface LoadingSpinnerProps {
+export type LoadingSpinnerProps = {
size?: number;
color?: string;
- borderColor?: string;
+ borderColor?: CSSProperties['borderColor'];
strokeWidth?: number;
gap?: number;
-}
+};
const LoadingSpinner: React.FC<LoadingSpinnerProps> = ({
size = 32,
diff --git a/src/components/src/common/modal.tsx b/src/components/src/common/modal.tsx
index 4731c26e4..46814e39e 100644
--- a/src/components/src/common/modal.tsx
+++ b/src/components/src/common/modal.tsx
@@ -4,14 +4,16 @@
import React, {Component, ReactNode, PropsWithChildren} from 'react';
import {FormattedMessage} from '@kepler.gl/localization';
-import styled, {FlattenSimpleInterpolation} from 'styled-components';
+import styled, {css} from 'styled-components';
import Modal from 'react-modal';
import {Delete} from './icons';
import {Button} from './styled-components';
import {media} from '@kepler.gl/styles';
+type CssStyleType = ReturnType<typeof css>;
+
interface ModalContentWrapperProps {
- cssStyle?: FlattenSimpleInterpolation | string;
+ cssStyle?: CssStyleType | string;
}
const ModalContentWrapper = styled.div<ModalContentWrapperProps>`
@@ -88,7 +90,7 @@ const CloseButton = styled.div`
top: 24px;
right: 24px;
- :hover {
+ &:hover {
cursor: pointer;
}
`;
@@ -166,7 +168,7 @@ export const ModalFooter: React.FC<ModalFooterProps> = ({
);
};
-interface ModalDialogOwnProps {
+export interface ModalDialogOwnProps {
footer: boolean;
close: boolean;
isOpen: boolean;
@@ -178,7 +180,7 @@ interface ModalDialogOwnProps {
confirmButtonLabel?: string;
cancelButton?: ModalButtonProps;
cancelButtonLabel?: string;
- cssStyle?: FlattenSimpleInterpolation | string;
+ cssStyle?: CssStyleType | string;
style?: React.CSSProperties;
theme: any;
children?: ReactNode;
@@ -253,6 +255,7 @@ const StyledModal = styled(ModalDialog)`
transition: ${props => props.theme.transition};
padding-left: 40px;
padding-right: 40px;
+ outline: none;
${media.portable`
padding-left: 24px;
@@ -264,7 +267,7 @@ const StyledModal = styled(ModalDialog)`
padding-right: 0;
`};
- :focus {
+ &:focus {
outline: 0;
}
`;
diff --git a/src/components/src/common/portaled.tsx b/src/components/src/common/portaled.tsx
index eaefff318..39e02d706 100644
--- a/src/components/src/common/portaled.tsx
+++ b/src/components/src/common/portaled.tsx
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React, {Component, createRef, ElementType, PropsWithChildren} from 'react';
+import React, {Component, createRef, PropsWithChildren} from 'react';
import debounce from 'lodash.debounce';
import isEqual from 'lodash.isequal';
@@ -117,18 +117,21 @@ const noop = () => {
};
type PortaledProps = PropsWithChildren<{
- component: ElementType;
+ right?: number;
+ left?: number;
+ top?: number;
+ component?: React.ElementType<any>;
onClose?: (
event: React.MouseEvent<Element, globalThis.MouseEvent> | React.KeyboardEvent<Element>
) => void;
- theme?: any;
- isOpened?: boolean;
- top: number;
- left?: number;
- right?: number;
+ topOffset?: number;
+ leftOffset?: number;
+ rightOffset?: number;
overlayZIndex?: number;
+ isOpened?: boolean;
modalProps?: Partial<ReactModal.Props>;
modalStyle?: Partial<typeof defaultModalStyle>;
+ theme?: any;
}>;
interface PortaledState {
@@ -145,16 +148,18 @@ interface PortaledState {
isVisible: boolean;
}
+const DefaultComponent = 'div';
+
class Portaled extends Component<PortaledProps, PortaledState> {
// Make Portaled a component with Error Boundary, so React can recreate
// this component if the child 'ColorPicker' throws cross-origin error.
// see function componentDidCatch()
- static getDerivedStateFromError() {
+ static getDerivedStateFromError(): {hasError: boolean} {
return {hasError: true};
}
- static defaultProps = {
- component: 'div',
+ static defaultProps: PortaledProps = {
+ component: DefaultComponent,
onClose: noop,
theme
};
@@ -174,7 +179,7 @@ class Portaled extends Component<PortaledProps, PortaledState> {
this.handleScroll();
}
- componentDidUpdate(prevProps) {
+ componentDidUpdate(prevProps: PortaledProps) {
const didOpen = this.props.isOpened && !prevProps.isOpened;
const didClose = !this.props.isOpened && prevProps.isOpened;
if (didOpen || didClose) {
@@ -228,10 +233,10 @@ class Portaled extends Component<PortaledProps, PortaledState> {
}
};
- render() {
+ render(): JSX.Element {
const {
// relative
- component: Comp,
+ component = DefaultComponent,
overlayZIndex,
isOpened,
onClose,
@@ -257,6 +262,8 @@ class Portaled extends Component<PortaledProps, PortaledState> {
}
};
+ const Comp = component;
+
return (
<RootContext.Consumer>
{context => (
diff --git a/src/components/src/common/range-plot.tsx b/src/components/src/common/range-plot.tsx
index acfcebcb9..536b00004 100644
--- a/src/components/src/common/range-plot.tsx
+++ b/src/components/src/common/range-plot.tsx
@@ -167,7 +167,9 @@ export default function RangePlotFactory(
);
};
- const RangePlotWithTheme = withTheme(RangePlot);
+ const RangePlotWithTheme = withTheme(RangePlot) as React.FC<
+ RangePlotProps & Partial<RangeBrushProps>
+ >;
// a container to render spinner or message when the data is too big
// to generate a plot
@@ -248,5 +250,5 @@ export default function RangePlotFactory(
);
};
- return withTheme(WithPlotLoading);
+ return withTheme(WithPlotLoading) as React.FC<Omit<WithPlotLoadingProps, 'theme'>>;
}
diff --git a/src/components/src/common/slider/slider-bar-handle.tsx b/src/components/src/common/slider/slider-bar-handle.tsx
index c05716061..df5eff49d 100644
--- a/src/components/src/common/slider/slider-bar-handle.tsx
+++ b/src/components/src/common/slider/slider-bar-handle.tsx
@@ -3,22 +3,23 @@
import React, {Component, RefObject} from 'react';
import classnames from 'classnames';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import MouseEventHandler from './mouse-event';
import {StyleRangeSliderType} from './slider';
+import {BaseComponentProps} from '../../types';
-interface StyledSliderProps {
+export type StyledSliderProps = BaseComponentProps & {
active?: boolean;
vertical?: boolean;
-}
+};
-const StyledSlider = styled.div<StyledSliderProps>`
+const StyledSlider: IStyledComponent<'web', StyledSliderProps> = styled.div<StyledSliderProps>`
position: relative;
background-color: ${props =>
props.active ? props.theme.sliderBarHoverColor : props.theme.sliderBarColor};
${props => `${props.vertical ? 'width' : 'height'}: ${props.theme.sliderBarHeight}px`};
border-radius: ${props => props.theme.sliderBarRadius};
- :hover {
+ &:hover {
cursor: pointer;
}
`;
diff --git a/src/components/src/common/slider/slider-handle.tsx b/src/components/src/common/slider/slider-handle.tsx
index 1a75ebd39..4e6b2b9be 100644
--- a/src/components/src/common/slider/slider-handle.tsx
+++ b/src/components/src/common/slider/slider-handle.tsx
@@ -3,19 +3,22 @@
import React, {Component, createRef, CSSProperties, RefObject} from 'react';
import classnames from 'classnames';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import MouseEventHandler from './mouse-event';
import {StyleRangeSliderType} from './slider';
+import {BaseComponentProps} from '../../types';
-interface StyledSliderHandleProps {
+export type StyledSliderHandleProps = StyledSliderTooltipProps & {
vertical?: boolean;
- sliderHandleWidth: number;
active?: boolean;
-}
+ ref: RefObject<Element>;
+};
-const StyledSliderHandle = styled.span.attrs(props => ({
- className: classnames('kg-range-slider__handle', props.className)
-}))<StyledSliderHandleProps>`
+const StyledSliderHandle: IStyledComponent<'web', StyledSliderHandleProps> = styled.span.attrs(
+ props => ({
+ className: classnames('kg-range-slider__handle', props.className)
+ })
+)<StyledSliderHandleProps>`
position: absolute;
z-index: 10;
${props => (props.vertical ? 'margin-left' : 'margin-top')}: -${props =>
@@ -39,7 +42,7 @@ const StyledSliderHandle = styled.span.attrs(props => ({
border-color: ${props =>
props.active ? props.theme.selectBorderColor : props.theme.sliderInactiveBorderColor};
- :hover {
+ &:hover {
background-color: ${props => props.theme.sliderHandleHoverColor};
cursor: pointer;
}
@@ -48,18 +51,19 @@ const StyledSliderHandle = styled.span.attrs(props => ({
font-size: 6px;
padding: 0 3px;
letter-spacing: 1px;
- :after {
+ &:after {
content: '${props => props.theme.sliderHandleAfterContent}';
}
`;
-interface StyledSliderTooltipProps {
- vertical?: boolean;
+export type StyledSliderTooltipProps = BaseComponentProps & {
sliderHandleWidth: number;
- active?: boolean;
-}
+};
-const StyledSliderTooltip = styled.div<StyledSliderTooltipProps>`
+const StyledSliderTooltip: IStyledComponent<
+ 'web',
+ StyledSliderTooltipProps
+> = styled.div<StyledSliderTooltipProps>`
position: absolute;
border-radius: 3px;
display: inline-block;
@@ -75,22 +79,22 @@ const StyledSliderTooltip = styled.div<StyledSliderTooltipProps>`
margin-bottom: -6px;
width: 50px;
- :before,
- :after {
+ &:before,
+ &:after {
content: '';
width: 0;
height: 0;
position: absolute;
}
- :before {
+ &:before {
border-top: 6px solid transparent;
border-bottom: 6px solid transparent;
left: -8px;
top: 50%;
}
- :after {
+ &:after {
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
left: -6px;
diff --git a/src/components/src/common/styled-components.tsx b/src/components/src/common/styled-components.tsx
index 796364a00..c6b3a325f 100644
--- a/src/components/src/common/styled-components.tsx
+++ b/src/components/src/common/styled-components.tsx
@@ -6,8 +6,10 @@ import {RGBColor} from '@kepler.gl/types';
import classnames from 'classnames';
import DatePicker from 'react-date-picker';
import TimePicker from 'react-time-picker';
-import ReactTooltip from 'react-tooltip';
-import styled from 'styled-components';
+import ReactTooltip, {TooltipProps} from 'react-tooltip';
+import styled, {IStyledComponent} from 'styled-components';
+
+import {BaseComponentProps} from '../types';
export const SelectText = styled.span`
color: ${props => props.theme.labelColor};
@@ -35,7 +37,7 @@ export const IconRoundSmall = styled.div`
align-items: center;
justify-content: center;
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.secondaryBtnBgdHover};
}
@@ -148,8 +150,11 @@ export const SidePanelDivider = styled.div.attrs({
height: ${props => props.theme.sidepanelDividerHeight}px;
`;
-type TooltipProps = {interactive?: boolean};
-export const Tooltip = styled(ReactTooltip)<TooltipProps>`
+type TooltipAttrsProps = {interactive?: boolean} & TooltipProps & BaseComponentProps;
+
+export const Tooltip: IStyledComponent<'web', TooltipAttrsProps> = styled(
+ ReactTooltip
+)<TooltipProps>`
&.__react_component_tooltip {
font-size: ${props => props.theme.tooltipFontSize};
font-weight: 400;
@@ -160,25 +165,25 @@ export const Tooltip = styled(ReactTooltip)<TooltipProps>`
background-color: ${props => props.theme.tooltipBg};
color: ${props => props.theme.tooltipColor};
&.place-bottom {
- :after {
+ &:after {
border-bottom-color: ${props => props.theme.tooltipBg};
}
}
&.place-top {
- :after {
+ &:after {
border-top-color: ${props => props.theme.tooltipBg};
}
}
&.place-right {
- :after {
+ &:after {
border-right-color: ${props => props.theme.tooltipBg};
}
}
&.place-left {
- :after {
+ &:after {
border-left-color: ${props => props.theme.tooltipBg};
}
}
@@ -264,9 +269,9 @@ export const Button = styled.button.attrs(props => ({
: props.link
? props.theme.linkBtnBorder
: props.theme.primaryBtnBorder};
- :hover,
- :focus,
- :active,
+ &:hover,
+ &:focus,
+ &:active,
&.active {
background-color: ${props =>
props.negative
@@ -413,7 +418,7 @@ export const SelectionButton = styled.div<SelectionButtonProps>`
margin-right: 6px;
padding: 6px 16px;
- :hover {
+ &:hover {
color: ${props => props.theme.selectionBtnActColor};
border: 1px solid ${props => props.theme.selectionBtnBorderActColor};
}
@@ -719,9 +724,9 @@ export const MapControlButton = styled(Button).attrs(props => ({
border: ${props =>
props.active ? props.theme.floatingBtnBorderHover : props.theme.floatingBtnBorder};
- :hover,
- :focus,
- :active,
+ &:hover,
+ &:focus,
+ &:active,
&.active {
background-color: ${props => props.theme.floatingBtnBgdHover};
color: ${props => props.theme.floatingBtnActColor};
@@ -755,7 +760,7 @@ export const CheckMark = styled.span.attrs({
height: 10px;
border-top-left-radius: 2px;
- :after {
+ &:after {
position: absolute;
display: table;
border: 1px solid #fff;
diff --git a/src/components/src/common/time-range-slider-time-title.tsx b/src/components/src/common/time-range-slider-time-title.tsx
index dc88d73c4..78836791e 100644
--- a/src/components/src/common/time-range-slider-time-title.tsx
+++ b/src/components/src/common/time-range-slider-time-title.tsx
@@ -2,15 +2,19 @@
// Copyright contributors to the kepler.gl project
import React from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {Minus} from './icons';
import {datetimeFormatter} from '@kepler.gl/utils';
+import {BaseComponentProps} from '../types';
-interface TimeValueWrapperProps {
+export type TimeValueWrapperProps = BaseComponentProps & {
isEnlarged?: boolean;
-}
+};
-const TimeValueWrapper = styled.div<TimeValueWrapperProps>`
+const TimeValueWrapper: IStyledComponent<
+ 'web',
+ TimeValueWrapperProps
+> = styled.div<TimeValueWrapperProps>`
display: flex;
align-items: center;
font-size: ${props => props.theme.timeTitleFontSize};
diff --git a/src/components/src/common/time-range-slider.tsx b/src/components/src/common/time-range-slider.tsx
index 58644b472..da7eb3dc0 100644
--- a/src/components/src/common/time-range-slider.tsx
+++ b/src/components/src/common/time-range-slider.tsx
@@ -3,22 +3,19 @@
import React, {useMemo} from 'react';
import throttle from 'lodash.throttle';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import RangeSliderFactory from './range-slider';
import TimeSliderMarkerFactory from './time-slider-marker';
import PlaybackControlsFactory from './animation-control/playback-controls';
import TimeRangeSliderTimeTitleFactory from './time-range-slider-time-title';
-import {LineChart, Timeline, AnimationConfig} from '@kepler.gl/types';
+import {LineChart, Timeline, AnimationConfig, TimeBins} from '@kepler.gl/types';
import {ActionHandler, setFilterPlot} from '@kepler.gl/actions';
import AnimationControlFactory from './animation-control/animation-control';
+import {BaseComponentProps} from '../types';
const animationControlWidth = 176;
-interface StyledSliderContainerProps {
- isEnlarged?: boolean;
-}
-
type TimeRangeSliderProps = {
domain?: [number, number];
value: [number, number];
@@ -28,7 +25,7 @@ type TimeRangeSliderProps = {
isAnimating: boolean;
timeFormat: string;
timezone?: string | null;
- timeBins?: object;
+ timeBins?: TimeBins;
plotType?: {
[key: string]: any;
};
@@ -48,7 +45,14 @@ type TimeRangeSliderProps = {
animationConfig?: AnimationConfig;
};
-const StyledSliderContainer = styled.div<StyledSliderContainerProps>`
+export type StyledSliderContainerProps = BaseComponentProps & {
+ isEnlarged?: boolean;
+};
+
+const StyledSliderContainer: IStyledComponent<
+ 'web',
+ StyledSliderContainerProps
+> = styled.div<StyledSliderContainerProps>`
align-items: flex-end;
display: flex;
flex-direction: row;
@@ -74,7 +78,7 @@ TimeRangeSliderFactory.deps = [
AnimationControlFactory
];
-export function getTimeBinsForInterval(timeBins, interval) {
+export function getTimeBinsForInterval(timeBins: TimeBins | undefined, interval: number) {
if (!timeBins) return {};
return Object.keys(timeBins).reduce((acc, dataId) => {
acc[dataId] = timeBins[dataId][interval];
diff --git a/src/components/src/common/timeline-slider.tsx b/src/components/src/common/timeline-slider.tsx
index 6af31dfe7..16de3b6b7 100644
--- a/src/components/src/common/timeline-slider.tsx
+++ b/src/components/src/common/timeline-slider.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React, {useMemo} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import throttle from 'lodash.throttle';
import classnames from 'classnames';
import {clamp, datetimeFormatter} from '@kepler.gl/utils';
@@ -10,6 +10,7 @@ import {media} from '@kepler.gl/styles';
import {DEFAULT_TIME_FORMAT, ANIMATION_WINDOW} from '@kepler.gl/constants';
import {Timeline} from '@kepler.gl/types';
import Slider from './slider/slider';
+import {BaseComponentProps} from '../types';
function noop() {
return;
@@ -17,7 +18,9 @@ function noop() {
const SLIDER_MARGIN_PALM = 6;
-const AnimationControlSlider = styled.div`
+export type AnimationControlSliderProps = BaseComponentProps;
+
+const AnimationControlSlider: IStyledComponent<'web', AnimationControlSliderProps> = styled.div`
display: flex;
align-items: center;
`;
diff --git a/src/components/src/common/toolbar-item.tsx b/src/components/src/common/toolbar-item.tsx
index dd429bb3c..f4daaf018 100644
--- a/src/components/src/common/toolbar-item.tsx
+++ b/src/components/src/common/toolbar-item.tsx
@@ -35,7 +35,7 @@ const StyledDiv = styled.div.attrs(props => ({
color: ${props => props.theme.textColorHl};
}
- :hover {
+ &:hover {
background-color: ${props => props.theme.toolbarItemBgdHover};
border-color: ${props => props.theme.toolbarItemBorderHover};
svg {
diff --git a/src/components/src/common/toolbar.tsx b/src/components/src/common/toolbar.tsx
index 47112ac6b..c4ea87b81 100644
--- a/src/components/src/common/toolbar.tsx
+++ b/src/components/src/common/toolbar.tsx
@@ -1,13 +1,14 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
+import {BaseComponentProps} from '../types';
-export interface ToolbarProps {
+export type ToolbarProps = {
show?: boolean;
-}
+} & BaseComponentProps;
-const Toolbar = styled.div<ToolbarProps>`
+const Toolbar: IStyledComponent<'web', ToolbarProps> = styled.div<ToolbarProps>`
display: flex;
flex-direction: row;
background-color: ${props => props.theme.dropdownListBgd};
diff --git a/src/components/src/effects/effect-manager.tsx b/src/components/src/effects/effect-manager.tsx
index 4b84c2b97..5aff7b7c4 100644
--- a/src/components/src/effects/effect-manager.tsx
+++ b/src/components/src/effects/effect-manager.tsx
@@ -18,7 +18,7 @@ import {Effect} from '@kepler.gl/types';
import {withState} from '../injector';
import SidePanelTitleFactory from './side-panel-title';
import EffectListFactory from './effect-list';
-import EffectTypeSelectorFactory from './effect-type-selector';
+import EffectTypeSelectorFactory, {EffectTypeSelectorProps} from './effect-type-selector';
export type EffectManagerState = {
visStateActions: {
@@ -90,7 +90,7 @@ function EffectManagerFactory(
const [typeSelectorOpened, setTypeSelectorOpened] = useState(false);
// Prevent shadow effect from being added multiple times
- const effectOptions = useMemo(() => {
+ const effectOptions: EffectTypeSelectorProps['options'] = useMemo(() => {
const hasShadow = effects.some(effect => {
return effect.type === LIGHT_AND_SHADOW_EFFECT.type;
});
@@ -121,7 +121,7 @@ function EffectManagerFactory(
return (
<StyledEffectPanelContainer className="effect-manager">
<StyledEffectPanel>
- <StyledEffectPanelHeader>
+ <StyledEffectPanelHeader className="effect-panel-header">
<SidePanelTitle
className="effect-manager-title"
title={intl.formatMessage({id: 'effectManager.effects'})}
diff --git a/src/components/src/effects/effect-panel-header.tsx b/src/components/src/effects/effect-panel-header.tsx
index ce6bb4b58..5dcc5e811 100644
--- a/src/components/src/effects/effect-panel-header.tsx
+++ b/src/components/src/effects/effect-panel-header.tsx
@@ -118,7 +118,7 @@ const StyledEffectPanelHeader = styled(StyledPanelHeader)`
margin: 10px 10px 10px 5px;
}
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.panelBackgroundHover};
.effect__drag-handle {
@@ -135,7 +135,7 @@ const HeaderActionSection = styled.div`
height: 100%;
align-items: stretch;
right: 10px;
- :hover {
+ &:hover {
.effect-panel__header__actions__hidden {
opacity: 1;
background-color: ${props => props.theme.panelBackgroundHover};
@@ -155,7 +155,7 @@ const StyledPanelHeaderHiddenActions = styled.div.attrs({
background-color: ${props =>
props.isConfigActive ? props.theme.panelBackgroundHover : props.theme.panelBackground};
- :hover {
+ &:hover {
opacity: 1;
}
`;
@@ -165,7 +165,7 @@ const StyledDragHandle = styled.div`
align-items: center;
opacity: 0;
z-index: 1000;
- :hover {
+ &:hover {
cursor: move;
opacity: 1;
color: ${props => props.theme.textColorHl};
diff --git a/src/components/src/effects/effect-time-configurator.tsx b/src/components/src/effects/effect-time-configurator.tsx
index 9091c2ee0..e7e4b6dd6 100644
--- a/src/components/src/effects/effect-time-configurator.tsx
+++ b/src/components/src/effects/effect-time-configurator.tsx
@@ -63,7 +63,7 @@ const StyledButton = styled(Button)`
padding: 5px;
border-radius: 4px;
justify-content: center;
- :hover {
+ &:hover {
color: ${props => props.theme.effectPanelTextMain};
background-color: ${props => props.theme.inputBgdHover};
}
diff --git a/src/components/src/effects/effect-time-selector.tsx b/src/components/src/effects/effect-time-selector.tsx
index 6138f6220..e61bb24b7 100644
--- a/src/components/src/effects/effect-time-selector.tsx
+++ b/src/components/src/effects/effect-time-selector.tsx
@@ -29,7 +29,7 @@ const StyledEffectTimeSelector = styled.div`
}
border: 1px solid ${props => props.theme.inputBgd};
border-radius: 4px;
- :hover {
+ &:hover {
border: 1px solid ${props => props.theme.inputBgdHover};
}
.active {
@@ -59,7 +59,7 @@ const DropdownListWrapper = styled.div`
const StyledDropdownListItem = styled.div`
padding: 10px 5px 9px 10px;
width: 100%;
- :hover {
+ &:hover {
background-color: ${props => props.theme.effectPanelElementColorSelected};
cursor: pointer;
}
@@ -179,7 +179,7 @@ function EffectTimeSelectorFactory() {
);
};
- return withTheme(EffectTimeSelector);
+ return withTheme(EffectTimeSelector) as React.FC<Omit<EffectTimeSelectorProps, 'theme'>>;
}
export default EffectTimeSelectorFactory;
diff --git a/src/components/src/effects/effect-type-dropdown-list.tsx b/src/components/src/effects/effect-type-dropdown-list.tsx
index 3d78415f9..9dd0bb843 100644
--- a/src/components/src/effects/effect-type-dropdown-list.tsx
+++ b/src/components/src/effects/effect-type-dropdown-list.tsx
@@ -40,7 +40,7 @@ const StyledDropdownListItem = styled.div`
opacity: 0.3;
}
- :hover {
+ &:hover {
cursor: pointer;
.effect-type-selector__item__label {
color: ${props => props.theme.effectPanelTextMain};
diff --git a/src/components/src/effects/effect-type-list-item.tsx b/src/components/src/effects/effect-type-list-item.tsx
index 8bf483e77..8aa718d6b 100644
--- a/src/components/src/effects/effect-type-list-item.tsx
+++ b/src/components/src/effects/effect-type-list-item.tsx
@@ -24,7 +24,7 @@ const StyledListItem = styled.div`
height: 89px;
transition: background-color 0.4s;
- :hover {
+ &:hover {
background-color: ${props => props.theme.effectTypeIconBgHoverColor};
}
diff --git a/src/components/src/effects/effect-type-selector.tsx b/src/components/src/effects/effect-type-selector.tsx
index 6dca48166..b28fe0965 100644
--- a/src/components/src/effects/effect-type-selector.tsx
+++ b/src/components/src/effects/effect-type-selector.tsx
@@ -45,9 +45,11 @@ const StyledEffectTypeSelector = styled.div`
border-radius: ${props => props.theme.primaryBtnRadius};
font-size: ${props => props.theme.primaryBtnFontSizeDefault};
border: none;
- :hover {
+
+ &:hover {
background-color: ${props => props.theme.secondaryBtnBgdHover};
}
+
.item-selector__dropdown__value {
color: ${props => props.theme.secondaryBtnActColor};
}
@@ -98,7 +100,7 @@ function EffectTypeSelectorFactory(EffectTypeListItem, EffectTypeDropdownList) {
);
};
- return withTheme(EffectTypeSelector);
+ return withTheme(EffectTypeSelector) as React.FC<Omit<EffectTypeSelectorProps, 'theme'>>;
}
export default EffectTypeSelectorFactory;
diff --git a/src/components/src/effects/timezone-selector.tsx b/src/components/src/effects/timezone-selector.tsx
index d1445b7af..c493826b4 100644
--- a/src/components/src/effects/timezone-selector.tsx
+++ b/src/components/src/effects/timezone-selector.tsx
@@ -62,7 +62,7 @@ function TimezoneSelectorFactory() {
);
};
- return withTheme(TimezoneTypeSelector);
+ return withTheme(TimezoneTypeSelector) as React.FC<Omit<TimezoneSelectorProps, 'theme'>>;
}
export default TimezoneSelectorFactory;
diff --git a/src/components/src/filters/time-widget-top.tsx b/src/components/src/filters/time-widget-top.tsx
index 304aa2484..e5d1b6d07 100644
--- a/src/components/src/filters/time-widget-top.tsx
+++ b/src/components/src/filters/time-widget-top.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React, {useCallback, useMemo} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {Clock, Close, LineChart, ArrowDown, ArrowUp} from '../common/icons';
import FieldSelectorFactory from '../common/field-selector';
import {SelectTextBold, IconRoundSmall, CenterFlexbox} from '../common/styled-components';
@@ -11,7 +11,7 @@ import {Field} from '@kepler.gl/types';
const TOP_SECTION_HEIGHT = '36px';
-const TopSectionWrapper = styled.div.attrs({
+const TopSectionWrapper: IStyledComponent<'web', TopSectionWrapperProps> = styled.div.attrs({
className: 'time-widget--top'
})<TopSectionWrapperProps>`
display: flex;
@@ -34,8 +34,8 @@ const TopSectionWrapper = styled.div.attrs({
padding: 4px 10px 4px 4px;
border-color: transparent;
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
background: transparent;
diff --git a/src/components/src/filters/types.ts b/src/components/src/filters/types.ts
index 2edf36f33..8136ff99a 100644
--- a/src/components/src/filters/types.ts
+++ b/src/components/src/filters/types.ts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
+import {CSSProperties} from 'react';
import {
Filter,
MultiSelectFilter,
@@ -21,6 +22,7 @@ import {
updateFilterAnimationSpeed
} from '@kepler.gl/actions';
import {Datasets} from '@kepler.gl/table';
+import {BaseComponentProps} from '../types';
export type PolygonFilterProps = {
filter: Filter;
@@ -28,8 +30,8 @@ export type PolygonFilterProps = {
setLayers: (ids: ReadonlyArray<string>) => void;
};
-export type TopSectionWrapperProps = {
- hoverColor?: string;
+export type TopSectionWrapperProps = BaseComponentProps & {
+ hoverColor?: CSSProperties['color'];
};
export type RangeFilterProps = {
diff --git a/src/components/src/geocoder-panel.tsx b/src/components/src/geocoder-panel.tsx
index 4c6ea04c9..a29b51751 100644
--- a/src/components/src/geocoder-panel.tsx
+++ b/src/components/src/geocoder-panel.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React, {Component, ComponentType} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import classnames from 'classnames';
import {processRowObject} from '@kepler.gl/processors';
import {FlyToInterpolator} from '@deck.gl/core/typed';
@@ -20,6 +20,8 @@ import {ActionHandler, removeDataset, updateMap, updateVisData} from '@kepler.gl
import Geocoder, {Result} from './geocoder/geocoder';
import {MapViewState} from '@deck.gl/core/typed';
+import {BaseComponentProps} from './types';
+
const ICON_LAYER = {
id: GEOCODER_LAYER_ID,
type: 'icon',
@@ -50,13 +52,16 @@ function generateConfig(layerOrder) {
};
}
-interface StyledGeocoderPanelProps {
+export type StyledGeocoderPanelProps = BaseComponentProps & {
+ unsyncedViewports?: boolean;
+ index?: number;
width?: number;
- unsyncedViewports: any;
- index: any;
-}
+};
-const StyledGeocoderPanel = styled.div<StyledGeocoderPanelProps>`
+const StyledGeocoderPanel: IStyledComponent<
+ 'web',
+ StyledGeocoderPanelProps
+> = styled.div<StyledGeocoderPanelProps>`
position: absolute;
top: ${props => props.theme.geocoderTop}px;
right: ${props =>
diff --git a/src/components/src/geocoder/geocoder.tsx b/src/components/src/geocoder/geocoder.tsx
index b2abc736f..cc3453a0f 100644
--- a/src/components/src/geocoder/geocoder.tsx
+++ b/src/components/src/geocoder/geocoder.tsx
@@ -87,7 +87,7 @@ const StyledContainer = styled.div<StyledContainerProps>`
display: flex;
align-items: center;
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.textColorHl};
}
diff --git a/src/components/src/hooks/use-legend-position.ts b/src/components/src/hooks/use-legend-position.ts
index d5b5b45a3..bd15e3a00 100644
--- a/src/components/src/hooks/use-legend-position.ts
+++ b/src/components/src/hooks/use-legend-position.ts
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: MIT
+// Copyright contributors to the kepler.gl project
+
import {useMemo, useRef, useCallback, useEffect} from 'react';
export type MapLegendControlSettings = {
diff --git a/src/components/src/index.ts b/src/components/src/index.ts
index 360e3b0ed..32c680104 100644
--- a/src/components/src/index.ts
+++ b/src/components/src/index.ts
@@ -286,7 +286,11 @@ export {
export {default as FileUploadProgress} from './common/file-uploader/file-upload-progress';
export {default as UploadButton} from './common/file-uploader/upload-button';
export {default as Accessor} from './common/item-selector/accessor';
-export {ChickletButton, default as ChickletedInput} from './common/item-selector/chickleted-input';
+export {
+ default as ChickletedInput,
+ ChickletButton,
+ ChickletTag
+} from './common/item-selector/chickleted-input';
export {
default as DropdownList,
ListItem,
diff --git a/src/components/src/kepler-gl.tsx b/src/components/src/kepler-gl.tsx
index 4e729f98f..7cc03f5d7 100644
--- a/src/components/src/kepler-gl.tsx
+++ b/src/components/src/kepler-gl.tsx
@@ -4,7 +4,8 @@
import React, {Component, createRef, Dispatch} from 'react';
import Console from 'global/console';
import {bindActionCreators} from 'redux';
-import styled, {ThemeProvider, withTheme} from 'styled-components';
+import isPropValid from '@emotion/is-prop-valid';
+import styled, {withTheme, StyleSheetManager, ThemeProvider} from 'styled-components';
import {createSelector} from 'reselect';
import {connect as keplerGlConnect} from './connect/keplergl-connect';
import {IntlProvider} from 'react-intl';
@@ -65,6 +66,16 @@ import {theme as basicTheme, themeLT, themeBS, breakPointValues} from '@kepler.g
import {KeplerGlState} from '@kepler.gl/reducers';
import {Provider} from '@kepler.gl/cloud-providers';
+// This implements the default behavior from styled-components v5
+function shouldForwardProp(propName, target) {
+ if (typeof target === 'string') {
+ // For HTML elements, forward the prop if it is a valid HTML attribute
+ return isPropValid(propName);
+ }
+ // For other elements, forward all props
+ return true;
+}
+
// Maybe we should think about exporting this or creating a variable
// as part of the base.js theme
const GlobalStyle = styled.div`
@@ -100,9 +111,9 @@ const GlobalStyle = styled.div`
}
`;
-interface BottomWidgetOuterProps {
+type BottomWidgetOuterProps = {
absolute?: boolean;
-}
+};
const BottomWidgetOuter = styled.div<BottomWidgetOuterProps>(
({absolute}) => `
@@ -517,59 +528,65 @@ function KeplerGlFactory(
<RootContext.Provider value={this.root}>
<FeatureFlagsContextProvider featureFlags={featureFlags}>
<IntlProvider locale={uiState.locale} messages={localeMessages[uiState.locale]}>
- <ThemeProvider theme={theme}>
- <CloudListProvider providers={cloudProviders}>
- <GlobalStyle
- className="kepler-gl"
- id={`kepler-gl__${id}`}
- style={{
- display: 'flex',
- flexDirection: 'column',
- position: 'relative',
- width: `${width}px`,
- height: `${height}px`
- }}
- ref={this.root}
- >
- <NotificationPanel {...notificationPanelFields} />
- <DndContext>
- {!uiState.readOnly && !readOnly && <SidePanel {...sideFields} />}
- <MapsLayout className="maps" mapState={this.props.mapState}>
- {mapContainers}
- </MapsLayout>
- </DndContext>
- {isExportingImage && <PlotContainer {...plotContainerFields} />}
- {/* 1 geocoder: single mode OR split mode and synced viewports */}
- {!isViewportDisjointed(this.props) && interactionConfig.geocoder.enabled && (
- <GeoCoderPanel {...geoCoderPanelFields} index={0} unsyncedViewports={false} />
- )}
- {/* 2 geocoders: split mode and unsynced viewports */}
- {isViewportDisjointed(this.props) &&
- interactionConfig.geocoder.enabled &&
- mapContainers.map((_mapContainer, index) => (
+ <StyleSheetManager shouldForwardProp={shouldForwardProp}>
+ <ThemeProvider theme={theme}>
+ <CloudListProvider providers={cloudProviders}>
+ <GlobalStyle
+ className="kepler-gl"
+ id={`kepler-gl__${id}`}
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ position: 'relative',
+ width: `${width}px`,
+ height: `${height}px`
+ }}
+ ref={this.root}
+ >
+ <NotificationPanel {...notificationPanelFields} />
+ <DndContext>
+ {!uiState.readOnly && !readOnly && <SidePanel {...sideFields} />}
+ <MapsLayout className="maps" mapState={this.props.mapState}>
+ {mapContainers}
+ </MapsLayout>
+ </DndContext>
+ {isExportingImage && <PlotContainer {...plotContainerFields} />}
+ {/* 1 geocoder: single mode OR split mode and synced viewports */}
+ {!isViewportDisjointed(this.props) && interactionConfig.geocoder.enabled && (
<GeoCoderPanel
- key={index}
{...geoCoderPanelFields}
- index={index}
- unsyncedViewports={true}
+ index={0}
+ unsyncedViewports={false}
+ />
+ )}
+ {/* 2 geocoders: split mode and unsynced viewports */}
+ {isViewportDisjointed(this.props) &&
+ interactionConfig.geocoder.enabled &&
+ mapContainers.map((_mapContainer, index) => (
+ <GeoCoderPanel
+ key={index}
+ {...geoCoderPanelFields}
+ index={index}
+ unsyncedViewports={true}
+ />
+ ))}
+ <BottomWidgetOuter absolute={!hasPortableWidth(breakPointValues)}>
+ <BottomWidget
+ rootRef={this.bottomWidgetRef}
+ {...bottomWidgetFields}
+ containerW={dimensions.width}
+ theme={theme}
/>
- ))}
- <BottomWidgetOuter absolute={!hasPortableWidth(breakPointValues)}>
- <BottomWidget
- rootRef={this.bottomWidgetRef}
- {...bottomWidgetFields}
+ </BottomWidgetOuter>
+ <ModalContainer
+ {...modalContainerFields}
containerW={dimensions.width}
- theme={theme}
+ containerH={dimensions.height}
/>
- </BottomWidgetOuter>
- <ModalContainer
- {...modalContainerFields}
- containerW={dimensions.width}
- containerH={dimensions.height}
- />
- </GlobalStyle>
- </CloudListProvider>
- </ThemeProvider>
+ </GlobalStyle>
+ </CloudListProvider>
+ </ThemeProvider>
+ </StyleSheetManager>
</IntlProvider>
</FeatureFlagsContextProvider>
</RootContext.Provider>
diff --git a/src/components/src/map-container.tsx b/src/components/src/map-container.tsx
index ef76d63ab..b2c314de0 100644
--- a/src/components/src/map-container.tsx
+++ b/src/components/src/map-container.tsx
@@ -179,7 +179,8 @@ const StyledDatasetAttributionsContainer = styled.div<StyledDatasetAttributionsC
color: ${props => props.theme.labelColor};
margin-right: 2px;
line-height: ${props => (props.isPalm ? '1em' : '1.4em')};
- :hover {
+
+ &:hover {
white-space: inherit;
}
`;
diff --git a/src/components/src/map/map-control-panel.tsx b/src/components/src/map/map-control-panel.tsx
index 3b31db7ae..d8fb2d573 100644
--- a/src/components/src/map/map-control-panel.tsx
+++ b/src/components/src/map/map-control-panel.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React, {useCallback} from 'react';
-import styled, {StyledComponent} from 'styled-components';
+import styled from 'styled-components';
import {FormattedMessage} from '@kepler.gl/localization';
import {CenterFlexbox, IconRoundSmall} from '../common/styled-components';
import {Close, Pin} from '../common/icons';
@@ -59,14 +59,7 @@ const StyledMapControlPanelHeader = styled.div.attrs({
}
`;
-const StyledMapControlPanelHeaderSplitViewportsTools: StyledComponent<
- 'div',
- any,
- {
- className: 'map-control__panel-split-viewport-tools';
- },
- 'className'
-> = styled(StyledMapControlPanelHeader).attrs({
+const StyledMapControlPanelHeaderSplitViewportsTools = styled(StyledMapControlPanelHeader).attrs({
className: 'map-control__panel-split-viewport-tools'
})`
display: flex;
@@ -100,7 +93,7 @@ const StyledIcon = styled(IconRoundSmall)`
color: ${props => props.theme.activeColor};
background-color: transparent;
- :hover {
+ &:hover {
cursor: pointer;
background-color: transparent;
color: ${props => props.theme.floatingBtnActColor};
diff --git a/src/components/src/map/map-control-toolbar.tsx b/src/components/src/map/map-control-toolbar.tsx
index e4b75a2ef..12967d4b6 100644
--- a/src/components/src/map/map-control-toolbar.tsx
+++ b/src/components/src/map/map-control-toolbar.tsx
@@ -3,9 +3,10 @@
import styled from 'styled-components';
import VerticalToolbar from '../common/vertical-toolbar';
+import {BaseComponentProps} from '../types';
function MapControlToolbar() {
- const StyledToolbar = styled(VerticalToolbar)`
+ const StyledToolbar = styled(VerticalToolbar)<BaseComponentProps>`
position: absolute;
right: 32px;
transform: translateX(calc(-50% + 45px));
diff --git a/src/components/src/map/map-popover.tsx b/src/components/src/map/map-popover.tsx
index 0ec8378da..dbc8bbc14 100644
--- a/src/components/src/map/map-popover.tsx
+++ b/src/components/src/map/map-popover.tsx
@@ -46,7 +46,7 @@ const StyledMapPopover = styled.div`
overflow-x: auto;
box-shadow: ${props => props.theme.panelBoxShadow};
- :hover {
+ &:hover {
background-color: ${props => `${props.theme.panelBackground}dd`};
}
@@ -115,7 +115,7 @@ const PopoverContent = styled.div`
const StyledIcon = styled.div`
color: ${props => props.theme.activeColor};
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.linkBtnColor};
}
@@ -129,7 +129,7 @@ const StyledSelectGeometry = styled.div`
margin-right: 6px;
}
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.linkBtnColor};
}
diff --git a/src/components/src/modals/add-map-style-modal.tsx b/src/components/src/modals/add-map-style-modal.tsx
index bf12531c0..0d78e6016 100644
--- a/src/components/src/modals/add-map-style-modal.tsx
+++ b/src/components/src/modals/add-map-style-modal.tsx
@@ -84,7 +84,7 @@ const StyledPreviewImage = styled.div`
const InlineLink = styled.a`
font-weight: 500;
- :hover {
+ &:hover {
cursor: pointer;
}
`;
diff --git a/src/components/src/modals/cloud-tile.tsx b/src/components/src/modals/cloud-tile.tsx
index 2566deb4d..43f3d1e7c 100644
--- a/src/components/src/modals/cloud-tile.tsx
+++ b/src/components/src/modals/cloud-tile.tsx
@@ -2,17 +2,18 @@
// Copyright contributors to the kepler.gl project
import React, {useCallback, useEffect, useState} from 'react';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import {Logout, Login} from '../common/icons';
import {CenterVerticalFlexbox, Button, CheckMark} from '../common/styled-components';
import {Provider, CloudUser} from '@kepler.gl/cloud-providers';
import {useCloudListProvider} from '../hooks/use-cloud-list-provider';
+import {BaseComponentProps} from '../types';
-interface StyledTileWrapperProps {
+export type StyledTileWrapperProps = BaseComponentProps & {
selected?: boolean;
-}
+};
-const StyledTileWrapper = styled.div.attrs({
+const StyledTileWrapper: IStyledComponent<'web', StyledTileWrapperProps> = styled.div.attrs({
className: 'provider-tile__wrapper'
})<StyledTileWrapperProps>`
display: flex;
@@ -30,7 +31,7 @@ const StyledTileWrapper = styled.div.attrs({
background-color: #ffffff;
transition: ${props => props.theme.transition};
position: relative;
- :hover {
+ &:hover {
border: 1px solid ${props => props.theme.primaryBtnBgd};
color: ${props => props.theme.primaryBtnBgd};
}
diff --git a/src/components/src/modals/data-table-modal.tsx b/src/components/src/modals/data-table-modal.tsx
index d9ece9766..2236861aa 100644
--- a/src/components/src/modals/data-table-modal.tsx
+++ b/src/components/src/modals/data-table-modal.tsx
@@ -2,7 +2,7 @@
// Copyright contributors to the kepler.gl project
import React from 'react';
-import styled, {withTheme} from 'styled-components';
+import styled, {withTheme, IStyledComponent} from 'styled-components';
import DatasetLabel from '../common/dataset-label';
import DataTableFactory from '../common/data-table';
import {createSelector} from 'reselect';
@@ -14,6 +14,7 @@ import {UiState} from '@kepler.gl/types';
import {Gear} from '../common/icons';
import Portaled from '../common/portaled';
import DataTableConfigFactory from '../common/data-table/display-format';
+import {BaseComponentProps} from '../types';
const MIN_STATS_CELL_SIZE = 122;
const DEFAULT_SORT_COLUMN = {};
@@ -44,11 +45,14 @@ const DatasetCatalog = styled.div`
}
`;
-interface DatasetModalTabProps {
+export type DatasetModalTabProps = BaseComponentProps & {
active?: boolean;
-}
+};
-export const DatasetModalTab = styled.div<DatasetModalTabProps>`
+export const DatasetModalTab: IStyledComponent<
+ 'web',
+ DatasetModalTabProps
+> = styled.div<DatasetModalTabProps>`
align-items: center;
border-bottom: 3px solid ${props => (props.active ? 'black' : 'transparent')};
cursor: pointer;
@@ -57,7 +61,7 @@ export const DatasetModalTab = styled.div<DatasetModalTabProps>`
margin: 0 3px;
padding: 0 5px;
- :hover {
+ &:hover {
border-bottom: 3px solid black;
}
`;
@@ -300,6 +304,8 @@ function DataTableModalFactory(
);
}
}
+
+ // @ts-expect-error figure out the proper way to type
return withTheme(DataTableModal);
}
diff --git a/src/components/src/modals/export-map-modal/export-html-map.tsx b/src/components/src/modals/export-map-modal/export-html-map.tsx
index e5ba7da10..1c14d836e 100644
--- a/src/components/src/modals/export-map-modal/export-html-map.tsx
+++ b/src/components/src/modals/export-map-modal/export-html-map.tsx
@@ -36,8 +36,8 @@ const StyledInput = styled.input<StyledInputProps>`
outline: 0;
font-size: ${props => props.theme.inputFontSize};
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
outline: 0;
diff --git a/src/components/src/modals/modal-tabs.tsx b/src/components/src/modals/modal-tabs.tsx
index e77f49c17..61c3f342b 100644
--- a/src/components/src/modals/modal-tabs.tsx
+++ b/src/components/src/modals/modal-tabs.tsx
@@ -50,7 +50,7 @@ const StyledLoadDataModalTabItem = styled.div`
padding-left: 0;
}
- :hover {
+ &:hover {
color: ${props => props.theme.textColorLT};
}
`;
diff --git a/src/components/src/modals/storage-map-viewer.tsx b/src/components/src/modals/storage-map-viewer.tsx
index 1a6616e85..ab87515f7 100644
--- a/src/components/src/modals/storage-map-viewer.tsx
+++ b/src/components/src/modals/storage-map-viewer.tsx
@@ -55,7 +55,7 @@ const StyledAssetItem = styled.div.attrs({
img {
max-width: 100%;
}
- :hover {
+ &:hover {
cursor: pointer;
opacity: 1;
}
@@ -88,7 +88,7 @@ const BackLink = styled.div`
cursor: pointer;
margin-bottom: 40px;
- :hover {
+ &:hover {
font-weight: 500;
}
diff --git a/src/components/src/side-panel/common/dataset-title.tsx b/src/components/src/side-panel/common/dataset-title.tsx
index 683488cb2..a4cdd66d2 100644
--- a/src/components/src/side-panel/common/dataset-title.tsx
+++ b/src/components/src/side-panel/common/dataset-title.tsx
@@ -24,7 +24,7 @@ const StyledDatasetTitle = styled.div<StyledDatasetTitleProps>`
.source-data-arrow {
height: 16px;
}
- :hover {
+ &:hover {
cursor: ${props => (props.clickable ? 'pointer' : 'auto')};
.dataset-name {
diff --git a/src/components/src/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx b/src/components/src/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx
index 43dcbe0d0..88561f093 100644
--- a/src/components/src/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx
+++ b/src/components/src/side-panel/interaction-panel/tooltip-config/tooltip-chicklet.tsx
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React, {useState} from 'react';
-import styled from 'styled-components';
+import React, {useState, CSSProperties} from 'react';
+import styled, {IStyledComponent} from 'styled-components';
import classnames from 'classnames';
import {DraggableAttributes} from '@dnd-kit/core';
import {CSS, Transform} from '@dnd-kit/utilities';
@@ -15,6 +15,7 @@ import {getFormatValue, getFormatLabels} from '@kepler.gl/utils';
import TippyTooltip from '../../../common/tippy-tooltip';
import {TooltipFormat} from '@kepler.gl/constants';
import useOnClickOutside from '../../../hooks/use-on-click-outside';
+import {BaseComponentProps} from '../../../types';
interface TooltipChickletProps {
disabled: boolean;
@@ -38,10 +39,6 @@ type TooltipConfig = {
compareType: string | null;
};
-type IconDivProps = {
- status: string | null;
-};
-
const ChickletAddonWrapper = styled.div`
position: relative;
`;
@@ -59,11 +56,15 @@ const StyledPopover = styled.div`
`;
const hashStyles = {
- SHOW: 'SHOW',
- ACTIVE: 'ACTIVE'
+ SHOW: 'SHOW' as const,
+ ACTIVE: 'ACTIVE' as const
};
-const IconDiv = styled.div.attrs({
+export type IconDivProps = BaseComponentProps & {
+ status?: 'SHOW' | 'ACTIVE' | null;
+};
+
+const IconDiv: IStyledComponent<'web', IconDivProps> = styled.div.attrs({
className: 'tooltip-chicklet__icon'
})<IconDivProps>`
color: ${props =>
@@ -74,18 +75,22 @@ const IconDiv = styled.div.attrs({
: props.theme.textColor};
`;
-type SortableStyledItemProps = {
- transition?: string;
- transform?: string;
+export type SortableStyledItemProps = BaseComponentProps & {
+ transition?: CSSProperties['transition'];
+ transform?: CSSProperties['transform'];
+ ref: (node: HTMLElement | null) => void;
};
-const SortableStyledItem = styled.div<SortableStyledItemProps>`
+const SortableStyledItem: IStyledComponent<
+ 'web',
+ SortableStyledItemProps
+> = styled.div<SortableStyledItemProps>`
transition: ${props => props.transition};
transform: ${props => props.transform};
&.sorting {
opacity: 0.3;
pointer-events: none;
}
- :hover {
+ &:hover {
.tooltip-chicklet__drag-handler {
opacity: 1;
}
@@ -100,7 +105,7 @@ const StyledDragHandle = styled.div.attrs({
z-index: 1000;
opacity: 0;
margin-left: -5px;
- :hover {
+ &:hover {
cursor: move;
color: ${props => props.theme.tooltipVerticalLineColor};
}
@@ -125,6 +130,7 @@ function getFormatTooltip(formatLabels: TimeLabelFormat[], format: string | null
return typeof format === 'object' ? JSON.stringify(format, null, 2) : String(format);
}
+// TODO: a factory should take other factories as input
function TooltipChickletFactory(
dataId: string,
config: TooltipConfig,
diff --git a/src/components/src/side-panel/layer-panel/color-palette-preset.tsx b/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
index b127a2bcb..926660f37 100644
--- a/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
+++ b/src/components/src/side-panel/layer-panel/color-palette-preset.tsx
@@ -17,7 +17,7 @@ const StyledColorPalette = styled.div`
justify-content: space-between;
padding: 12px;
- :hover {
+ &:hover {
cursor: pointer;
}
`;
diff --git a/src/components/src/side-panel/layer-panel/color-palette.tsx b/src/components/src/side-panel/layer-panel/color-palette.tsx
index 1aea9e210..ea8c9ce55 100644
--- a/src/components/src/side-panel/layer-panel/color-palette.tsx
+++ b/src/components/src/side-panel/layer-panel/color-palette.tsx
@@ -1,18 +1,19 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React from 'react';
+import React, {useMemo} from 'react';
import {HexColor, RGBColor} from '@kepler.gl/types';
-import styled from 'styled-components';
+import styled, {IStyledComponent} from 'styled-components';
import classnames from 'classnames';
+import {BaseComponentProps} from '../../types';
-type ColorPaletteProps = {
+type ColorPaletteProps = BaseComponentProps & {
colors: RGBColor | HexColor[];
- colorWidths?: number[];
+ colorWidths?: number[] | null;
height?: number;
- className?: string;
isSelected?: boolean;
isReversed?: boolean;
+ className?: string;
};
const PaletteWrapper = styled.div.attrs({
@@ -26,9 +27,16 @@ const PaletteWrapper = styled.div.attrs({
overflow: hidden;
`;
-const PaletteContainer = styled.div.attrs(props => ({
- className: classnames('color-range-palette', props.className)
-}))<{isSelected?: boolean; isColorChart?: boolean}>`
+export type PaletteContainerProps = BaseComponentProps & {
+ isColorChart?: boolean;
+ isSelected?: boolean;
+};
+
+const PaletteContainer: IStyledComponent<'web', PaletteContainerProps> = styled.div.attrs(
+ props => ({
+ className: classnames('color-range-palette', props.className)
+ })
+)<PaletteContainerProps>`
display: flex;
flex-grow: 1;
border-width: ${props => (props.isColorChart ? '0px' : '1px')};
@@ -44,32 +52,38 @@ const StyledColorBlock = styled.div.attrs({
flex-grow: 1;
`;
-const ColorPalette: React.FC<ColorPaletteProps> = ({
+const ColorPalette = ({
colors = [],
height = 10,
colorWidths = null,
className = '',
isSelected = false,
isReversed = false
-}) => (
- <PaletteContainer
- className={className}
- isSelected={isSelected}
- isColorChart={Boolean(colorWidths)}
- >
- <PaletteWrapper style={{height, transform: `scale(${isReversed ? -1 : 1}, 1)`}}>
- {colors.map((color: number | string, index: number) =>
- colorWidths && colorWidths[index] ? (
- <StyledColorBlock
- key={`${color}-${index}`}
- style={{backgroundColor: String(color), width: colorWidths[index]}}
- />
- ) : (
- <StyledColorBlock key={`${color}-${index}`} style={{backgroundColor: String(color)}} />
- )
- )}
- </PaletteWrapper>
- </PaletteContainer>
-);
+}: ColorPaletteProps) => {
+ const paletteWrapperStyle = useMemo(
+ () => ({height, transform: `scale(${isReversed ? -1 : 1}, 1)`}),
+ [height, isReversed]
+ );
+ return (
+ <PaletteContainer
+ className={className}
+ isSelected={isSelected}
+ isColorChart={Boolean(colorWidths)}
+ >
+ <PaletteWrapper style={paletteWrapperStyle}>
+ {colors.map((color: number | string, index: number) =>
+ colorWidths && colorWidths[index] ? (
+ <StyledColorBlock
+ key={`${color}-${index}`}
+ style={{backgroundColor: String(color), width: colorWidths[index]}}
+ />
+ ) : (
+ <StyledColorBlock key={`${color}-${index}`} style={{backgroundColor: String(color)}} />
+ )
+ )}
+ </PaletteWrapper>
+ </PaletteContainer>
+ );
+};
export default ColorPalette;
diff --git a/src/components/src/side-panel/layer-panel/color-range-selector.tsx b/src/components/src/side-panel/layer-panel/color-range-selector.tsx
index a9ec017d7..b04d21a5d 100644
--- a/src/components/src/side-panel/layer-panel/color-range-selector.tsx
+++ b/src/components/src/side-panel/layer-panel/color-range-selector.tsx
@@ -289,7 +289,7 @@ const StyledColorRange = styled.div.attrs({
className: 'color-palette-outer'
})`
padding: 0 8px;
- :hover {
+ &:hover {
background-color: ${props => props.theme.panelBackgroundHover};
cursor: pointer;
}
diff --git a/src/components/src/side-panel/layer-panel/custom-palette.tsx b/src/components/src/side-panel/layer-panel/custom-palette.tsx
index 24d7357c8..d234c8df3 100644
--- a/src/components/src/side-panel/layer-panel/custom-palette.tsx
+++ b/src/components/src/side-panel/layer-panel/custom-palette.tsx
@@ -19,7 +19,7 @@ import {
SortableElementProps,
SortableHandle
} from 'react-sortable-hoc';
-import styled, {StyledComponent, css} from 'styled-components';
+import styled, {css} from 'styled-components';
import Portaled from '../../common/portaled';
import {Tooltip} from '../../common/styled-components';
import Typeahead from '../../common/item-selector/typeahead';
@@ -125,8 +125,8 @@ export const ColorPaletteItem = styled.div`
padding-right: 6px;
}
- :not(.sorting):not(.disabled) {
- :hover {
+ &:not(.sorting):not(.disabled) {
+ &:hover {
background-color: ${props => props.theme.panelBackgroundHover};
${dragHandleActive};
}
@@ -147,13 +147,13 @@ const StyledDragHandle = styled.div`
const StyledAction = styled.div`
color: ${props => props.theme.subtextColor};
svg {
- :hover {
+ &:hover {
color: ${props => props.theme.subtextColorActive};
}
}
margin-left: 4px;
- :hover {
+ &:hover {
cursor: pointer;
}
`;
@@ -171,7 +171,7 @@ export const ColorSwatch = styled.div.attrs({
width: 32px;
height: 18px;
display: inline-block;
- :hover {
+ &:hover {
box-shadow: ${props => props.theme.boxShadow};
cursor: pointer;
}
@@ -197,9 +197,7 @@ const StyledAddStepContainer = styled.div`
}
`;
-const StyledInput = styled(
- Input as StyledComponent<'input', any, {width: string; textAlign: string; disabled: boolean}, any>
-)`
+const StyledInput = styled(Input)<{width: string; textAlign: string}>`
width: ${props => props.width ?? '100%'};
text-align: ${props => props.textAlign ?? 'end'};
pointer-events: ${props => (props.disabled ? 'none' : 'all')};
@@ -212,7 +210,7 @@ const InputText = styled.div<{width: string; textAlign: string}>`
width: ${props => props.width ?? '100%'};
text-align: ${props => props.textAlign ?? 'end'};
- :hover {
+ &:hover {
cursor: auto;
background-color: transparent;
border-color: transparent;
diff --git a/src/components/src/side-panel/layer-panel/custom-picker.tsx b/src/components/src/side-panel/layer-panel/custom-picker.tsx
index a8715f203..2ef6975e9 100644
--- a/src/components/src/side-panel/layer-panel/custom-picker.tsx
+++ b/src/components/src/side-panel/layer-panel/custom-picker.tsx
@@ -7,13 +7,15 @@ import {SketchPicker, ColorChangeHandler} from 'react-color';
import {HexColor} from '@kepler.gl/types';
+import {BaseComponentProps} from '../../types';
+
// This was put in because 3rd party library react-color doesn't yet cater for customized color of child component <SketchField> which contains HEX/RGB input text box
// Issue raised: https://github.com/casesandberg/react-color/issues/631
type StyledPickerProps = {
type?: string;
active?: boolean;
-};
+} & BaseComponentProps;
const StyledPicker = styled.div<StyledPickerProps>`
.sketch-picker {
@@ -29,7 +31,7 @@ const StyledPicker = styled.div<StyledPickerProps>`
box-shadow: none !important;
background-color: ${props => props.theme.inputBgdHover} !important;
- :hover {
+ &:hover {
cursor: ${props => (props.type === 'number' || props.type === 'text' ? 'text' : 'pointer')};
background-color: ${props =>
props.active ? props.theme.inputBgdActive : props.theme.inputBgdHover};
@@ -37,8 +39,8 @@ const StyledPicker = styled.div<StyledPickerProps>`
props.active ? props.theme.inputBorderActiveColor : props.theme.inputBorderHoverColor};
}
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
outline: 0;
@@ -89,4 +91,4 @@ const CustomPicker: React.FC<CustomPickerProps> = ({color, onChange, theme}: Cus
);
};
-export default withTheme(CustomPicker);
+export default withTheme(CustomPicker) as React.FC<Omit<CustomPickerProps, 'theme'>>;
diff --git a/src/components/src/side-panel/layer-panel/layer-column-mode-config.tsx b/src/components/src/side-panel/layer-panel/layer-column-mode-config.tsx
index b66fdbbd5..9f45d2e12 100644
--- a/src/components/src/side-panel/layer-panel/layer-column-mode-config.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-column-mode-config.tsx
@@ -17,6 +17,7 @@ import LayerColumnConfigFactory from './layer-column-config';
import {FormattedMessage} from '@kepler.gl/localization';
import {Layer, LayerInfoModal, LayerBaseConfig} from '@kepler.gl/layers';
import {SupportedColumnMode, FieldPair, LayerColumns} from '@kepler.gl/types';
+import {BaseComponentProps} from '../../types';
import {Help} from '../../common/icons';
@@ -25,7 +26,7 @@ const TopRow = styled.div`
justify-content: space-between;
`;
-const Separator = styled(({children, className}) => (
+const Separator = styled(({children, className}: BaseComponentProps) => (
<div className={className}>
<div className="separator-line-cell">
<div className="separator-line" />
diff --git a/src/components/src/side-panel/layer-panel/layer-config-group.tsx b/src/components/src/side-panel/layer-panel/layer-config-group.tsx
index 5201aca18..dc88847a5 100644
--- a/src/components/src/side-panel/layer-panel/layer-config-group.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-config-group.tsx
@@ -88,7 +88,7 @@ export const StyledConfigGroupHeader = styled.div.attrs({
margin-bottom: 12px;
cursor: default;
- :hover {
+ &:hover {
${props => props.collapsible && 'cursor: pointer;'}
.layer-config-group__label {
color: ${props => props.theme.textColorHl};
diff --git a/src/components/src/side-panel/layer-panel/layer-panel-header.tsx b/src/components/src/side-panel/layer-panel/layer-panel-header.tsx
index 0049058fc..91b663157 100644
--- a/src/components/src/side-panel/layer-panel/layer-panel-header.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-panel-header.tsx
@@ -107,7 +107,7 @@ const StyledLayerPanelHeader = styled(StyledPanelHeader)`
${props => (props.warning ? getBorderCss('warning') : props.isValid ? '' : getBorderCss('error'))}
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.panelBackgroundHover};
@@ -137,7 +137,7 @@ const HeaderActionSection = styled.div<HeaderActionSectionProps>`
align-items: stretch;
right: 10px;
pointer-events: ${props => (props.isEditingLabel ? 'none' : 'all')};
- :hover {
+ &:hover {
.layer-panel__header__actions__hidden {
opacity: 1;
background-color: ${props => props.theme.panelBackgroundHover};
@@ -160,7 +160,7 @@ const StyledPanelHeaderHiddenActions = styled.div.attrs({
props.isConfigActive ? props.theme.panelBackgroundHover : props.theme.panelBackground};
transition: opacity 0.4s ease, background-color 0.4s ease;
- :hover {
+ &:hover {
opacity: 1;
}
`;
@@ -171,7 +171,7 @@ const StyledDragHandle = styled.div`
opacity: 0;
z-index: 1000;
- :hover {
+ &:hover {
cursor: move;
opacity: 1;
color: ${props => props.theme.textColorHl};
diff --git a/src/components/src/side-panel/layer-panel/layer-panel.tsx b/src/components/src/side-panel/layer-panel/layer-panel.tsx
index d7a338072..b34ee90b1 100644
--- a/src/components/src/side-panel/layer-panel/layer-panel.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-panel.tsx
@@ -51,7 +51,7 @@ type LayerPanelProps = {
splitMap?: SplitMap;
};
-const PanelWrapper = styled.div<{active: boolean}>`
+const PanelWrapper = styled.div`
font-size: 12px;
border-radius: 1px;
z-index: 1000;
@@ -147,7 +147,6 @@ function LayerPanelFactory(
return (
<PanelWrapper
- active={isConfigActive}
className={`layer-panel ${this.props.className}`}
data-testid={dataTestIds.layerPanel}
style={this.props.style}
diff --git a/src/components/src/side-panel/layer-panel/layer-type-dropdown-list.tsx b/src/components/src/side-panel/layer-panel/layer-type-dropdown-list.tsx
index d921c5565..db719927c 100644
--- a/src/components/src/side-panel/layer-panel/layer-type-dropdown-list.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-type-dropdown-list.tsx
@@ -52,7 +52,7 @@ const StyledDropdownListItem = styled.div`
}
}
- :hover,
+ &:hover,
&.selected {
cursor: pointer;
.layer-type-selector__item__icon {
diff --git a/src/components/src/side-panel/layer-panel/layer-type-list-item.tsx b/src/components/src/side-panel/layer-panel/layer-type-list-item.tsx
index b2a91486d..c2dfa23cb 100644
--- a/src/components/src/side-panel/layer-panel/layer-type-list-item.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-type-list-item.tsx
@@ -80,7 +80,7 @@ export function LayerTypeListItemFactory() {
</StyledListItem>
);
- return withTheme(LayerTypeListItem);
+ return withTheme(LayerTypeListItem) as React.FC<LayerTypeListItemProps>;
}
export default LayerTypeListItemFactory;
diff --git a/src/components/src/side-panel/layer-panel/layer-type-selector.tsx b/src/components/src/side-panel/layer-panel/layer-type-selector.tsx
index d5c8221ba..ce3c4928a 100644
--- a/src/components/src/side-panel/layer-panel/layer-type-selector.tsx
+++ b/src/components/src/side-panel/layer-panel/layer-type-selector.tsx
@@ -81,7 +81,7 @@ function LayerTypeSelectorFactory(
);
};
- return withTheme(LayerTypeSelector);
+ return withTheme(LayerTypeSelector) as React.FC<Omit<LayerTypeSelectorProps, 'theme'>>;
}
export default LayerTypeSelectorFactory;
diff --git a/src/components/src/side-panel/layer-panel/single-color-palette.tsx b/src/components/src/side-panel/layer-panel/single-color-palette.tsx
index 7a436ad2b..dcd26ad12 100644
--- a/src/components/src/side-panel/layer-panel/single-color-palette.tsx
+++ b/src/components/src/side-panel/layer-panel/single-color-palette.tsx
@@ -38,7 +38,7 @@ const StyledColorPickerTop = styled.div`
color: ${({theme}) => theme.textColorHl};
border-bottom-color: ${({theme}) => theme.panelToggleBorderColor};
}
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.textColorHl};
}
diff --git a/src/components/src/side-panel/map-style-panel/map-style-selector.tsx b/src/components/src/side-panel/map-style-panel/map-style-selector.tsx
index 43a609713..4a2ecd6f5 100644
--- a/src/components/src/side-panel/map-style-panel/map-style-selector.tsx
+++ b/src/components/src/side-panel/map-style-panel/map-style-selector.tsx
@@ -37,7 +37,7 @@ const StyledMapDropdown = styled(StyledPanelHeader)<StyledMapDropdownProps>`
opacity: 0;
}
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.panelBackgroundHover};
}
@@ -57,7 +57,7 @@ const StyledMapDropdown = styled(StyledPanelHeader)<StyledMapDropdownProps>`
}
/* show callout dot if props.hasCallout and theme provides calloutDot base styles */
- :after {
+ &:after {
${({theme}) => theme.calloutDot}
background-color: #00ACF5;
top: 12px;
diff --git a/src/components/src/side-panel/panel-header-action.tsx b/src/components/src/side-panel/panel-header-action.tsx
index 942f5d1be..04ed860c6 100644
--- a/src/components/src/side-panel/panel-header-action.tsx
+++ b/src/components/src/side-panel/panel-header-action.tsx
@@ -8,6 +8,7 @@ import styled from 'styled-components';
import {FormattedMessage} from '@kepler.gl/localization';
import {Tooltip} from '../common/styled-components';
import {BaseProps} from '../common/icons';
+import {BaseComponentProps} from '../types';
export type PanelHeaderActionIcon = ComponentType<Partial<BaseProps>>;
@@ -29,10 +30,13 @@ type HeaderActionWrapperProps = {
flush?: boolean;
active?: boolean;
hoverColor?: string | null;
- testId?: string;
+ dataTestId?: any;
};
-const HeaderActionWrapper = styled.div.attrs((props: HeaderActionWrapperProps) => ({
+type HeaderActionWrapperCssProps = {testId?: string} & HeaderActionWrapperProps &
+ BaseComponentProps;
+
+const HeaderActionWrapper = styled.div.attrs<HeaderActionWrapperCssProps>(props => ({
dataTestId: props.testId
}))<HeaderActionWrapperProps>`
margin-left: ${props => (props.flush ? 0 : 8)}px;
@@ -43,7 +47,7 @@ const HeaderActionWrapper = styled.div.attrs((props: HeaderActionWrapperProps) =
cursor: pointer;
- :hover {
+ &:hover {
color: ${props =>
props.hoverColor ? props.theme[props.hoverColor] : props.theme.panelHeaderIconHover};
}
diff --git a/src/components/src/side-panel/panel-header.tsx b/src/components/src/side-panel/panel-header.tsx
index 7d72548fa..00aca5706 100644
--- a/src/components/src/side-panel/panel-header.tsx
+++ b/src/components/src/side-panel/panel-header.tsx
@@ -8,7 +8,7 @@ import {createSelector} from 'reselect';
import {StyledPanelDropdown, Tooltip} from '../common/styled-components';
import KeplerGlLogo from '../common/logo';
import {Save, DataTable, Save2, Picture, Db, Map as MapIcon, Share} from '../common/icons';
-import Toolbar from '../common/toolbar';
+import Toolbar, {ToolbarProps} from '../common/toolbar';
import ToolbarItem, {ToolbarItemProps} from '../common/toolbar-item';
import {FormattedMessage} from '@kepler.gl/localization';
import {UiState} from '@kepler.gl/types';
@@ -126,7 +126,7 @@ const StyledPanelAction = styled.div.attrs({
height: 20px;
}
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.textColorHl};
@@ -136,7 +136,7 @@ const StyledPanelAction = styled.div.attrs({
}
`;
-const StyledToolbar = styled(Toolbar)`
+const StyledToolbar = styled(Toolbar)<ToolbarProps>`
position: absolute;
`;
diff --git a/src/components/src/side-panel/panel-tab.tsx b/src/components/src/side-panel/panel-tab.tsx
index 8d401f537..6c7a7b808 100644
--- a/src/components/src/side-panel/panel-tab.tsx
+++ b/src/components/src/side-panel/panel-tab.tsx
@@ -38,7 +38,7 @@ export const StyledPanelTab = styled.div.attrs({
padding-bottom: ${props => props.theme.panelToggleBottomPadding}px;
width: ${props => props.theme.panelTabWidth};
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.textColorHl};
}
diff --git a/src/components/src/side-panel/panel-view-list-toggle.tsx b/src/components/src/side-panel/panel-view-list-toggle.tsx
index 9de8e1994..c6ca8c962 100644
--- a/src/components/src/side-panel/panel-view-list-toggle.tsx
+++ b/src/components/src/side-panel/panel-view-list-toggle.tsx
@@ -38,7 +38,7 @@ export const StyledToggleOption = styled.div.attrs({
className: 'layer-panel-toggle-option'
})<{active: boolean}>`
color: ${props => (props.active ? props.theme.subtextColorActive : props.theme.panelTabColor)};
- :hover {
+ &:hover {
cursor: pointer;
color: ${props => props.theme.subtextColorActive};
}
diff --git a/src/components/src/side-panel/side-bar.tsx b/src/components/src/side-panel/side-bar.tsx
index da960dc58..311680ca5 100644
--- a/src/components/src/side-panel/side-bar.tsx
+++ b/src/components/src/side-panel/side-bar.tsx
@@ -69,7 +69,7 @@ const StyledCollapseButton = styled.div`
top: ${props => props.theme.sidePanel.margin.top}px;
width: 20px;
- :hover {
+ &:hover {
cursor: pointer;
box-shadow: none;
background-color: ${props => props.theme.sideBarCloseBtnBgdHover};
diff --git a/src/components/src/types.ts b/src/components/src/types.ts
index 9e93eb2b7..5202e6e87 100644
--- a/src/components/src/types.ts
+++ b/src/components/src/types.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
-import React from 'react';
+import React, {HTMLAttributes, PropsWithChildren} from 'react';
import {MapStyle} from '@kepler.gl/reducers';
import {Layer, LayerClassesType} from '@kepler.gl/layers';
import {Filter, InteractionConfig, UiState} from '@kepler.gl/types';
@@ -14,6 +14,8 @@ import {
} from '@kepler.gl/actions';
import {Datasets} from '@kepler.gl/table';
+export type BaseComponentProps = PropsWithChildren<HTMLAttributes<unknown>>;
+
export type SidePanelItem = {
id: string;
label: string;
diff --git a/src/layers/package.json b/src/layers/package.json
index d5e0a106a..7d7f0375d 100644
--- a/src/layers/package.json
+++ b/src/layers/package.json
@@ -65,7 +65,7 @@
"@types/keymirror": "^0.1.1",
"@types/lodash.memoize": "^4.1.7",
"@types/lodash.uniq": "^4.5.7",
- "@types/styled-components": "^5.1.25",
+ "@types/styled-components": "^5.1.32",
"apache-arrow": ">=15.0.0",
"d3-array": "^2.8.0",
"d3-shape": "^1.2.0",
@@ -81,7 +81,7 @@
"react-markdown": "^6.0.3",
"reselect": "^4.0.0",
"s2-geometry": "^1.2.10",
- "styled-components": "^4.1.3",
+ "styled-components": "6.1.8",
"type-analyzer": "0.4.0",
"viewport-mercator-project": "^6.0.0"
},
diff --git a/src/schemas/src/ui-state-schema.ts b/src/schemas/src/ui-state-schema.ts
index d983088e3..8204267c5 100644
--- a/src/schemas/src/ui-state-schema.ts
+++ b/src/schemas/src/ui-state-schema.ts
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: MIT
+// Copyright contributors to the kepler.gl project
+
import {VERSIONS} from './versions';
import Schema from './schema';
diff --git a/src/styles/package.json b/src/styles/package.json
index 22524e04b..f7faa49e2 100644
--- a/src/styles/package.json
+++ b/src/styles/package.json
@@ -31,8 +31,8 @@
],
"dependencies": {
"@kepler.gl/constants": "3.1.0-alpha.3",
- "@types/styled-components": "^5.1.25",
- "styled-components": "^4.1.3"
+ "@types/styled-components": "^5.1.32",
+ "styled-components": "6.1.8"
},
"nyc": {
"sourceMap": false,
diff --git a/src/styles/src/base.ts b/src/styles/src/base.ts
index 8731b87ca..ba318d5f4 100644
--- a/src/styles/src/base.ts
+++ b/src/styles/src/base.ts
@@ -493,14 +493,14 @@ export const rightPanelMarginRight = 12;
// all child components
const input = css<InputProps>`
- ::placeholder {
+ &::placeholder {
color: ${props => props.theme.inputPlaceholderColor};
font-weight: ${props => props.theme.inputPlaceholderFontWeight};
}
/* Disable Arrows on Number Inputs */
- ::-webkit-inner-spin-button,
- ::-webkit-outer-spin-button {
+ &::-webkit-inner-spin-button,
+ &::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
@@ -548,7 +548,7 @@ const input = css<InputProps>`
opacity: ${props => (props.disabled ? 0.5 : 1)};
box-shadow: ${props => props.theme.inputBoxShadow};
- :hover {
+ &:hover {
cursor: ${props => (props.type === 'number' || props.type === 'text' ? 'text' : 'pointer')};
background-color: ${props =>
props.active ? props.theme.inputBgdActive : props.theme.inputBgdHover};
@@ -556,8 +556,8 @@ const input = css<InputProps>`
props.active ? props.theme.inputBorderActiveColor : props.theme.inputBorderHoverColor};
}
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
background-color: ${props => props.theme.inputBgdActive};
@@ -566,8 +566,8 @@ const input = css<InputProps>`
}
`;
-const inputLT = css`
- ::placeholder {
+const inputLT = css<InputProps>`
+ &::placeholder {
color: ${props => props.theme.inputPlaceholderColorLT};
font-weight: 400;
}
@@ -584,15 +584,15 @@ const inputLT = css`
color: ${props => props.theme.selectColorLT};
caret-color: ${props => props.theme.inputBorderActiveColorLT};
- :hover {
+ &:hover {
background-color: ${props => props.theme.inputBgdActiveLT};
cursor: ${props => (['number', 'text'].includes(props.type) ? 'text' : 'pointer')};
border-color: ${props =>
props.active ? props.theme.inputBorderActiveColorLT : props.theme.inputBorderHoverColorLT};
}
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
background-color: ${props => props.theme.inputBgdActiveLT};
@@ -608,14 +608,14 @@ const secondaryInput = css<SecondaryInputProps>`
border: 1px solid
${props => (props.error ? props.theme.errorColor : props.theme.secondaryInputBorderColor)};
- :hover {
+ &:hover {
cursor: pointer;
background-color: ${props => props.theme.secondaryInputBgdHover};
border-color: ${props => props.theme.secondaryInputBgdHover};
}
- :active,
- :focus,
+ &:active,
+ &:focus,
&.focus,
&.active {
background-color: ${props => props.theme.secondaryInputBgdActive};
@@ -662,16 +662,16 @@ const inlineInput = css`
background-color: transparent;
border: 1px solid transparent;
- :hover {
+ &:hover {
height: 24px;
cursor: text;
background-color: transparent;
border: 1px solid ${props => props.theme.labelColor};
}
- :active,
+ &:active,
.active,
- :focus {
+ &:focus {
background-color: transparent;
border: 1px solid ${props => props.theme.inputBorderActiveColor};
}
@@ -723,11 +723,11 @@ const inputSwitch = css`
padding-bottom: 0;
padding-left: ${props => props.theme.switchWidth}px;
- :before {
+ &:before {
${props => props.theme.switchTrack};
}
- :after {
+ &:after {
${props => props.theme.switchButton};
}
`;
@@ -775,11 +775,11 @@ const inputCheckbox = css`
color: ${props => props.theme.labelColor};
margin-left: -${props => props.theme.switchLabelMargin}px;
- :before {
+ &:before {
${props => props.theme.checkboxBox};
}
- :after {
+ &:after {
${props => props.theme.checkboxCheck};
}
`;
@@ -813,11 +813,11 @@ const inputRadio = css`
color: ${props => props.theme.textColorHl};
cursor: pointer;
- :before {
+ &:before {
${props => props.theme.radioTrack}
}
- :after {
+ &:after {
${props => props.theme.radioButton}
}
`;
@@ -825,11 +825,11 @@ const inputRadio = css`
const secondaryRadio = css<SwitchableProps>`
${props => props.theme.inputRadio}
- :before {
+ &:before {
${props => props.theme.radioTrack} background: ${props => props.theme.secondarySwitchTrackBgd};
}
- :after {
+ &:after {
${props => props.theme.radioButton}
background: ${props =>
props.checked ? props.theme.switchBtnBgdActive : props.theme.secondarySwitchBtnBgd};
@@ -839,12 +839,12 @@ const secondaryRadio = css<SwitchableProps>`
const secondarySwitch = css<SwitchableProps>`
${props => props.theme.inputSwitch}
- :before {
+ &:before {
${props => props.theme.switchTrack} background: ${props =>
props.checked ? props.theme.switchTrackBgdActive : props.theme.secondarySwitchTrackBgd};
}
- :after {
+ &:after {
${props => props.theme.switchButton}
background: ${props =>
props.checked ? props.theme.switchBtnBgdActive : props.theme.secondarySwitchBtnBgd};
@@ -852,26 +852,26 @@ const secondarySwitch = css<SwitchableProps>`
`;
const dropdownScrollBar = css`
- ::-webkit-scrollbar {
+ &::-webkit-scrollbar {
height: 10px;
width: 10px;
}
- ::-webkit-scrollbar-corner {
+ &::-webkit-scrollbar-corner {
background: ${props => props.theme.dropdownListBgd};
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: ${props => props.theme.dropdownListBgd};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
border-radius: 10px;
background: ${props => props.theme.labelColor};
border: 3px solid ${props => props.theme.dropdownListBgd};
}
- :vertical:hover {
+ &:vertical:hover {
background: ${props => props.theme.textColorHl};
cursor: pointer;
}
@@ -882,17 +882,17 @@ const dropdownScrollBarLT = css`
background: ${props => props.theme.dropdownListBgdLT};
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: ${props => props.theme.dropdownListBgdLT};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
border-radius: 10px;
background: ${props => props.theme.scrollbarThumbColorLT};
border: 3px solid ${props => props.theme.dropdownListBgdLT};
}
- :vertical:hover {
+ &:vertical:hover {
background: ${props => props.theme.scrollbarThumbColorHoverLT};
cursor: pointer;
}
@@ -1005,25 +1005,25 @@ const dropdownListLT = css`
${props => props.theme.dropdownScrollBarLT};
`;
const sidePanelScrollBar = css`
- ::-webkit-scrollbar {
+ &::-webkit-scrollbar {
height: ${props => props.theme.sidePanelScrollBarHeight}px;
width: ${props => props.theme.sidePanelScrollBarWidth}px;
}
- ::-webkit-scrollbar-corner {
+ &::-webkit-scrollbar-corner {
background: ${props => props.theme.sidePanelBg};
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: ${props => props.theme.sidePanelBg};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
border-radius: 10px;
background: ${props => props.theme.panelBackgroundHover};
border: 3px solid ${props => props.theme.sidePanelBg};
- :hover {
+ &:hover {
background: ${props => props.theme.labelColor};
cursor: pointer;
}
@@ -1031,24 +1031,24 @@ const sidePanelScrollBar = css`
`;
const panelDropdownScrollBar = css`
- ::-webkit-scrollbar {
+ &::-webkit-scrollbar {
height: 10px;
width: 10px;
}
- ::-webkit-scrollbar-corner {
+ &::-webkit-scrollbar-corner {
background: ${props => props.theme.panelBackground};
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: ${props => props.theme.panelBackground};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
border-radius: 10px;
background: ${props => props.theme.panelBackgroundHover};
border: 3px solid ${props => props.theme.panelBackground};
- :hover {
+ &:hover {
background: ${props => props.theme.labelColor};
cursor: pointer;
}
@@ -1056,20 +1056,20 @@ const panelDropdownScrollBar = css`
`;
const scrollBar = css`
- ::-webkit-scrollbar {
+ &::-webkit-scrollbar {
height: 10px;
width: 10px;
}
- ::-webkit-scrollbar-corner {
+ &::-webkit-scrollbar-corner {
background: ${props => props.theme.panelBackground};
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: ${props => props.theme.panelBackground};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
border-radius: 10px;
background: ${props => props.theme.labelColor};
border: 3px solid ${props => props.theme.panelBackground};
@@ -1087,35 +1087,35 @@ const scrollBar = css`
`;
export const modalScrollBar = css`
- ::-webkit-scrollbar {
+ &::-webkit-scrollbar {
width: 14px;
height: 16px;
}
- ::-webkit-scrollbar-track {
+ &::-webkit-scrollbar-track {
background: white;
}
- ::-webkit-scrollbar-track:horizontal {
+ &::-webkit-scrollbar-track:horizontal {
background: ${props => props.theme.textColorHl};
}
- ::-webkit-scrollbar-thumb {
+ &::-webkit-scrollbar-thumb {
background: ${props => props.theme.scrollbarThumbColorLT};
border: 4px solid white;
}
- ::-webkit-scrollbar-corner {
+ &::-webkit-scrollbar-corner {
background: ${props => props.theme.textColorHl};
}
- ::-webkit-scrollbar-thumb:hover {
+ &::-webkit-scrollbar-thumb:hover {
background: ${props => props.theme.scrollbarThumbColorHoverLT};
}
- ::-webkit-scrollbar-thumb:vertical {
+ &::-webkit-scrollbar-thumb:vertical {
border-radius: 7px;
}
- ::-webkit-scrollbar-thumb:horizontal {
+ &::-webkit-scrollbar-thumb:horizontal {
border-radius: 9px;
border: 4px solid ${props => props.theme.textColorHl};
}
diff --git a/src/utils/src/data-scale-utils.ts b/src/utils/src/data-scale-utils.ts
index 495b728d5..2c385113a 100644
--- a/src/utils/src/data-scale-utils.ts
+++ b/src/utils/src/data-scale-utils.ts
@@ -670,7 +670,7 @@ export function addCategoricalValuesToColorMap(
export function getCategoricalColorScale(
colorDomain: number[] | string[],
colorRange: ColorRange,
- useRgb: boolean = true
+ useRgb = true
): (categoryValue: string | number) => RGBColor | RGBAColor {
const cMap = colorRange.colorMap
? colorRange.colorMap
diff --git a/test/browser-headless/component/map-container-test.js b/test/browser-headless/component/map-container-test.js
index 4ede1e91b..b6a06658f 100644
--- a/test/browser-headless/component/map-container-test.js
+++ b/test/browser-headless/component/map-container-test.js
@@ -19,6 +19,7 @@ import {gl, InteractionTestRunner} from '@deck.gl/test-utils';
import {mockKeplerProps, expectedLayerHoverProp} from '../../helpers/mock-state';
import {act} from 'react-dom/test-utils';
+import {STYLED_COMPONENTS_DUPLICATED_ENTRIES} from '../../helpers/utils';
const MapContainer = appInjector.get(MapContainerFactory);
const MapPopover = appInjector.get(MapPopoverFactory);
@@ -203,7 +204,11 @@ test('MapContainerFactory - _renderDeckOverlay', t => {
// test MapPopoverProp
testMapPopoverProp(t, mapPopoverProps);
- t.equal(wrapper.find('.map-popover').length, 3, 'should render .map-popover');
+ t.equal(
+ wrapper.find('.map-popover').length,
+ STYLED_COMPONENTS_DUPLICATED_ENTRIES,
+ 'should render .map-popover'
+ );
t.equal(wrapper.find('table').length, 1, 'should render 1 table');
const table = wrapper.find('table').at(0);
diff --git a/test/browser/components/modals/data-table-modal-test.js b/test/browser/components/modals/data-table-modal-test.js
index e48338c30..24e18991a 100644
--- a/test/browser/components/modals/data-table-modal-test.js
+++ b/test/browser/components/modals/data-table-modal-test.js
@@ -30,6 +30,7 @@ import {
import {testFields, testAllData} from 'test/fixtures/test-csv-data';
import {geoStyleFields, geoStyleRows} from 'test/fixtures/geojson';
import {StateWFiles, testCsvDataId, testGeoJsonDataId} from 'test/helpers/mock-state';
+import {STYLED_COMPONENTS_DUPLICATED_ENTRIES} from '../../../helpers/utils';
import {createDataContainer, getFieldFormatLabels} from '@kepler.gl/utils';
@@ -330,7 +331,7 @@ test('Components -> DataTableModal -> render DataTable: csv 1', t => {
t.equal(
wrapper2.find('.header-cell').length,
- testFields.length * 3,
+ testFields.length * STYLED_COMPONENTS_DUPLICATED_ENTRIES,
`should render ${testFields.length} headers`
);
@@ -475,7 +476,7 @@ test('Components -> DataTableModal -> render DataTable: sort, pin and display fo
t.equal(
wrapper2.find('.header-cell').length,
- testFields.length * 3,
+ testFields.length * STYLED_COMPONENTS_DUPLICATED_ENTRIES, // number of duplicates create by styled-components
`should render ${testFields.length} headers`
);
@@ -493,7 +494,7 @@ test('Components -> DataTableModal -> render DataTable: sort, pin and display fo
t.equal(
wrapper2
.find('.header-cell')
- .at(i * 3)
+ .at(i * STYLED_COMPONENTS_DUPLICATED_ENTRIES)
.find('.col-name__name')
.text(),
expectedHeaders[i],
@@ -670,7 +671,11 @@ test('Components -> DataTableModal.render: csv 2', t => {
});
wrapper2.update();
- t.equal(wrapper2.find('.header-cell').length, 21, `should render 7 header cells`);
+ t.equal(
+ wrapper2.find('.header-cell').length,
+ 7 * STYLED_COMPONENTS_DUPLICATED_ENTRIES,
+ `should render 7 header cells`
+ );
// test header cell
const expectedHeaders = [
@@ -685,7 +690,7 @@ test('Components -> DataTableModal.render: csv 2', t => {
expectedHeaders.forEach((name, index) => {
const header = wrapper2.find(`.header-cell.column-${index}`);
- t.equal(header.length, 3, 'should render 1 header');
+ t.equal(header.length, STYLED_COMPONENTS_DUPLICATED_ENTRIES, 'should render 1 header');
if (index < 6) {
const cellText = header.find('.col-name__name').text();
@@ -696,7 +701,7 @@ test('Components -> DataTableModal.render: csv 2', t => {
t.equal(header.find(OptionDropdown).length, 1, 'should render OptionDropdown');
} else {
// if ghost cell
- t.equal(header.at(2).text(), '', 'cell should be empty');
+ t.equal(header.at(1).text(), '', 'cell should be empty');
}
});
diff --git a/test/browser/components/modals/load-data-modal-test.js b/test/browser/components/modals/load-data-modal-test.js
index 27103f1a5..20aca1910 100644
--- a/test/browser/components/modals/load-data-modal-test.js
+++ b/test/browser/components/modals/load-data-modal-test.js
@@ -4,6 +4,7 @@
import React from 'react';
import test from 'tape';
import {IntlWrapper, mountWithTheme} from 'test/helpers/component-utils';
+import {STYLED_COMPONENTS_DUPLICATED_ENTRIES} from '../../../helpers/utils';
import {
LoadDataModalFactory,
ModalTabItem,
@@ -25,8 +26,16 @@ test('Components -> LoadDataModal.mount', t => {
);
}, 'Show not fail without props');
- t.equal(wrapper.find('.file-uploader').length, 3, 'should render FileUpload');
- t.equal(wrapper.find('.load-data-modal__tab').length, 3, 'should render ModalTabs');
+ t.equal(
+ wrapper.find('.file-uploader').length,
+ STYLED_COMPONENTS_DUPLICATED_ENTRIES,
+ 'should render FileUpload'
+ );
+ t.equal(
+ wrapper.find('.load-data-modal__tab').length,
+ STYLED_COMPONENTS_DUPLICATED_ENTRIES,
+ 'should render ModalTabs'
+ );
t.equal(wrapper.find(LoadStorageMap).length, 0, 'should not render LoadStorageMap');
t.end();
});
diff --git a/test/browser/components/side-panel/color-selector-test.js b/test/browser/components/side-panel/color-selector-test.js
index d10f49de6..c7daa2e2a 100644
--- a/test/browser/components/side-panel/color-selector-test.js
+++ b/test/browser/components/side-panel/color-selector-test.js
@@ -36,6 +36,7 @@ import {hexToRgb} from '@kepler.gl/utils';
import {IntlWrapper, mountWithTheme} from 'test/helpers/component-utils';
import {StateWFilesFiltersLayerColor, StateWTrips} from 'test/helpers/mock-state';
import {clickItemSelector} from '../../../helpers/component-utils';
+import {STYLED_COMPONENTS_DUPLICATED_ENTRIES} from '../../../helpers/utils';
const ColorSelector = appInjector.get(ColorSelectorFactory);
const LayerColorSelector = appInjector.get(LayerColorSelectorFactory);
@@ -671,7 +672,8 @@ test('Components -> LayerColorRangeSelector.render -> ColorSelector -> ColorRang
t.equal(
cp.find('.custom-palette__sortable-items').length,
- pointLayer.config.colorUI.colorRange.customPalette.colors.length * 3,
+ pointLayer.config.colorUI.colorRange.customPalette.colors.length *
+ STYLED_COMPONENTS_DUPLICATED_ENTRIES,
'should render same number of custom palette swatch'
);
@@ -929,7 +931,7 @@ test('Components -> ColorSelector.opacity', t => {
});
// select color
- wrapper.find('.single-color-palette__block').at(100).simulate('click');
+ wrapper.find('.single-color-palette__block').at(67).simulate('click');
t.ok(setColor.calledOnce, 'should call setColor once');
t.ok(setColor.calledWith([228, 155, 0, 100]), 'setColor called with correct color and opacity');
diff --git a/test/browser/components/side-panel/layer-configurator-test.js b/test/browser/components/side-panel/layer-configurator-test.js
index 5c91f6da4..e4450b775 100644
--- a/test/browser/components/side-panel/layer-configurator-test.js
+++ b/test/browser/components/side-panel/layer-configurator-test.js
@@ -30,6 +30,7 @@ import {
clickItemSelectList
} from 'test/helpers/component-utils';
import {act} from 'react-dom/test-utils';
+import {STYLED_COMPONENTS_DUPLICATED_ENTRIES} from '../../../helpers/utils';
// components
const LayerConfigurator = appInjector.get(LayerConfiguratorFactory);
@@ -289,7 +290,7 @@ test('Components -> LayerConfigurator.mount -> collapsed / expand config group '
const component = wrapper.find(LayerConfigurator).instance();
t.equal(
wrapper.find(LayerConfigGroup).at(0).find('.layer-config-group.collapsed').length,
- 3,
+ STYLED_COMPONENTS_DUPLICATED_ENTRIES,
'LayerColumnModeConfig should be collapsed'
);
diff --git a/test/browser/components/side-panel/layer-manager-test.js b/test/browser/components/side-panel/layer-manager-test.js
index fa6a779d7..cca7d347d 100644
--- a/test/browser/components/side-panel/layer-manager-test.js
+++ b/test/browser/components/side-panel/layer-manager-test.js
@@ -75,20 +75,13 @@ test('Components -> LayerManager -> render -> list view', t => {
t.ok(wrapper.find(PanelViewListToggle).length === 1, 'should render PanelViewListToggle');
t.ok(wrapper.find(PanelTitle).length === 1, 'should render PanelTitle');
- const titles = [];
- const expectedTitles = [
- 'H3 Hexagon 1',
- 'H3 Hexagon 1',
- 'H3 Hexagon 1',
- 'H3 Hexagon 2',
- 'H3 Hexagon 2',
- 'H3 Hexagon 2'
- ];
- wrapper.find('.layer__title__editor').forEach(item => titles.push(item.getDOMNode().value));
+ const expectedTitles = ['H3 Hexagon 1', 'H3 Hexagon 1', 'H3 Hexagon 2', 'H3 Hexagon 2'];
+
+ const titles = wrapper.find('.layer__title__editor').map(item => item.getDOMNode().value);
t.deepEqual(titles, expectedTitles, 'should render panels in correct order');
const layers = wrapper.find('.layer-panel');
- t.equal(layers.length, 6, 'should render 6 layer panels');
+ t.equal(layers.length, 4, 'should render 4 layer panels');
t.end();
});
@@ -111,20 +104,14 @@ test('Components -> LayerManager -> render -> order by dataset view', t => {
t.ok(wrapper.find(PanelViewListToggle).length === 1, 'should render PanelViewListToggle');
t.ok(wrapper.find(PanelTitle).length === 1, 'should render PanelTitle');
- const titles = [];
- const expectedTitles = [
- 'H3 Hexagon 1',
- 'H3 Hexagon 1',
- 'H3 Hexagon 1',
- 'H3 Hexagon 2',
- 'H3 Hexagon 2',
- 'H3 Hexagon 2'
- ];
- wrapper.find('.layer__title__editor').forEach(item => titles.push(item.getDOMNode().value));
+ // we have two layers by styled-component will render two elements for each component with the same className
+ const expectedTitles = ['H3 Hexagon 1', 'H3 Hexagon 1', 'H3 Hexagon 2', 'H3 Hexagon 2'];
+ const titles = wrapper.find('.layer__title__editor').map(item => item.getDOMNode().value);
+ t.equal(titles.length, 4, 'Should display two tiles');
t.deepEqual(titles, expectedTitles, 'should render panels in correct order');
const layers = wrapper.find('.layer-panel');
- t.equal(layers.length, 6, 'should render 6 layer panels');
+ t.equal(layers.length, 4, 'should render 6 layer panels');
t.end();
});
diff --git a/test/browser/layer-tests/icon-layer-specs.js b/test/browser/layer-tests/icon-layer-specs.js
index 00335778d..07a7afbb6 100644
--- a/test/browser/layer-tests/icon-layer-specs.js
+++ b/test/browser/layer-tests/icon-layer-specs.js
@@ -491,7 +491,7 @@ test('#IconLayer -> svg icons as constructor props -> renderIconModal', t => {
);
}, 'mount layer info modal with icons should not fail');
- t.equal(wrapper.find('.icon-table__item').length, 3, 'should render 1 icon');
+ t.equal(wrapper.find('.icon-table__item').length, 2, 'should render 1 icon');
t.equal(
wrapper.find('.icon-table_item__name').at(0).find('code').text(),
'alert',
diff --git a/test/helpers/utils.js b/test/helpers/utils.js
index bd9bf419e..1809e2291 100644
--- a/test/helpers/utils.js
+++ b/test/helpers/utils.js
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT
// Copyright contributors to the kepler.gl project
+export const STYLED_COMPONENTS_DUPLICATED_ENTRIES = 2;
+
export const cloneClassInstance = classInstance =>
Object.assign(Object.create(Object.getPrototypeOf(classInstance)), classInstance);
diff --git a/website-gatsby/package.json b/website-gatsby/package.json
index 8d9c77ac4..b465f0823 100644
--- a/website-gatsby/package.json
+++ b/website-gatsby/package.json
@@ -26,7 +26,7 @@
"react-swipeable-views": "^0.13.3",
"react-waypoint": "^9.0.2",
"redux": "^4.2.1",
- "styled-components": "^4.2.0"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"gatsby": "^2.18.0",
diff --git a/website-gatsby/src/components/common/styled-components.js b/website-gatsby/src/components/common/styled-components.js
index 7eff2b56b..cfd317a2c 100644
--- a/website-gatsby/src/components/common/styled-components.js
+++ b/website-gatsby/src/components/common/styled-components.js
@@ -52,10 +52,10 @@ const buttonStyles = css`
width: ${props => props.width || 'auto'};
text-transform: uppercase;
- :hover,
- :focus,
- :active,
- :visited,
+ &:hover,
+ &:focus,
+ &:active,
+ &:visited,
&.active {
background-color: ${props =>
props.negative
diff --git a/website-gatsby/src/components/examples.js b/website-gatsby/src/components/examples.js
index 998412157..8df0aa130 100644
--- a/website-gatsby/src/components/examples.js
+++ b/website-gatsby/src/components/examples.js
@@ -27,7 +27,7 @@ const StyledCardContainer = styled.a`
color: black;
cursor: pointer;
transition: transform 350ms;
- :hover {
+ &:hover {
transform: scale3d(1.05, 1.05, 1.05);
}
${media.palm`
diff --git a/website-gatsby/src/components/header.js b/website-gatsby/src/components/header.js
index f12e029a7..8421afb31 100644
--- a/website-gatsby/src/components/header.js
+++ b/website-gatsby/src/components/header.js
@@ -14,7 +14,7 @@ const StyledLink = styled.a`
transition: color 500ms;
display: inline-block;
- :hover {
+ &:hover {
color: white;
cursor: pointer;
}
diff --git a/website-gatsby/src/components/showcase.js b/website-gatsby/src/components/showcase.js
index 0ebfa0aa0..b41229a00 100644
--- a/website-gatsby/src/components/showcase.js
+++ b/website-gatsby/src/components/showcase.js
@@ -49,7 +49,7 @@ const NavItem = styled.div`
transform: ${props => props.isActive && 'scale(1.1)'};
transition: transform 500ms, filter 500ms;
cursor: pointer;
- :hover {
+ &:hover {
transform: scale(1.1);
}
diff --git a/website-gatsby/src/components/tutorials.js b/website-gatsby/src/components/tutorials.js
index 32876d589..4343fabbd 100644
--- a/website-gatsby/src/components/tutorials.js
+++ b/website-gatsby/src/components/tutorials.js
@@ -31,7 +31,7 @@ const StyledCardContainer = styled.a`
color: black;
cursor: pointer;
transition: transform 350ms;
- :hover {
+ &:hover {
transform: scale3d(1.05, 1.05, 1.05);
}
${media.palm`
diff --git a/website/package.json b/website/package.json
index 0595409f4..efb430ac4 100644
--- a/website/package.json
+++ b/website/package.json
@@ -31,7 +31,7 @@
"redux": "^4.2.1",
"redux-actions": "^1.2.0",
"redux-thunk": "^1.0.0",
- "styled-components": "^4.1.3"
+ "styled-components": "6.1.8"
},
"devDependencies": {
"@babel/core": "^7.12.1",
diff --git a/website/src/components/common/styled-components.js b/website/src/components/common/styled-components.js
index 9d9c4b987..3fd2fe5e1 100644
--- a/website/src/components/common/styled-components.js
+++ b/website/src/components/common/styled-components.js
@@ -54,10 +54,10 @@ const buttonStyles = css`
width: ${props => props.width || 'auto'};
text-transform: uppercase;
- :hover,
- :focus,
- :active,
- :visited,
+ &:hover,
+ &:focus,
+ &:active,
+ &:visited,
&.active {
background-color: ${props =>
props.negative
diff --git a/website/src/components/examples.js b/website/src/components/examples.js
index 998412157..8df0aa130 100644
--- a/website/src/components/examples.js
+++ b/website/src/components/examples.js
@@ -27,7 +27,7 @@ const StyledCardContainer = styled.a`
color: black;
cursor: pointer;
transition: transform 350ms;
- :hover {
+ &:hover {
transform: scale3d(1.05, 1.05, 1.05);
}
${media.palm`
diff --git a/website/src/components/header.js b/website/src/components/header.js
index 28a9bf000..b27c56394 100644
--- a/website/src/components/header.js
+++ b/website/src/components/header.js
@@ -14,7 +14,7 @@ const StyledLink = styled.a`
transition: color 500ms;
display: inline-block;
- :hover {
+ &:hover {
color: white;
cursor: pointer;
}
diff --git a/website/src/components/showcase.js b/website/src/components/showcase.js
index 0ebfa0aa0..b41229a00 100644
--- a/website/src/components/showcase.js
+++ b/website/src/components/showcase.js
@@ -49,7 +49,7 @@ const NavItem = styled.div`
transform: ${props => props.isActive && 'scale(1.1)'};
transition: transform 500ms, filter 500ms;
cursor: pointer;
- :hover {
+ &:hover {
transform: scale(1.1);
}
diff --git a/website/src/components/tutorials.js b/website/src/components/tutorials.js
index 812a5e8f6..693294009 100644
--- a/website/src/components/tutorials.js
+++ b/website/src/components/tutorials.js
@@ -31,7 +31,7 @@ const StyledCardContainer = styled.a`
color: black;
cursor: pointer;
transition: transform 350ms;
- :hover {
+ &:hover {
transform: scale3d(1.05, 1.05, 1.05);
}
${media.palm`
diff --git a/website/yarn.lock b/website/yarn.lock
index 070bd56ed..afd31dc5c 100644
--- a/website/yarn.lock
+++ b/website/yarn.lock
@@ -67,7 +67,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/helper-annotate-as-pure@npm:^7.22.5, @babel/helper-annotate-as-pure@npm:^7.24.7":
+"@babel/helper-annotate-as-pure@npm:^7.24.7":
version: 7.24.7
resolution: "@babel/helper-annotate-as-pure@npm:7.24.7"
dependencies:
@@ -154,7 +154,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/helper-module-imports@npm:^7.0.0, @babel/helper-module-imports@npm:^7.22.5, @babel/helper-module-imports@npm:^7.24.7":
+"@babel/helper-module-imports@npm:^7.24.7":
version: 7.24.7
resolution: "@babel/helper-module-imports@npm:7.24.7"
dependencies:
@@ -472,7 +472,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/plugin-syntax-jsx@npm:^7.22.5, @babel/plugin-syntax-jsx@npm:^7.24.7":
+"@babel/plugin-syntax-jsx@npm:^7.24.7":
version: 7.24.7
resolution: "@babel/plugin-syntax-jsx@npm:7.24.7"
dependencies:
@@ -1469,26 +1469,26 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/is-prop-valid@npm:^0.8.1":
- version: 0.8.8
- resolution: "@emotion/is-prop-valid@npm:0.8.8"
+"@emotion/is-prop-valid@npm:1.2.1":
+ version: 1.2.1
+ resolution: "@emotion/is-prop-valid@npm:1.2.1"
dependencies:
- "@emotion/memoize": "npm:0.7.4"
- checksum: 10c0/f6be625f067c7fa56a12a4edaf090715616dc4fc7803c87212831f38c969350107b9709b1be54100e53153b18d9fa068eb4bf4f9ac66a37a8edf1bac9b64e279
+ "@emotion/memoize": "npm:^0.8.1"
+ checksum: 10c0/7c2aabdf0ca9986ca25abc9dae711348308cf18d418d64ffa4c8ffd2114806c47f2e06ba8ee769f38ec67d65bd59ec73f34d94023e81baa1c43510ac86ccd5e6
languageName: node
linkType: hard
-"@emotion/memoize@npm:0.7.4":
- version: 0.7.4
- resolution: "@emotion/memoize@npm:0.7.4"
- checksum: 10c0/b2376548fc147b43afd1ff005a80a1a025bd7eb4fb759fdb23e96e5ff290ee8ba16628a332848d600fb91c3cdc319eee5395fa33d8875e5d5a8c4ce18cddc18e
+"@emotion/memoize@npm:^0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/memoize@npm:0.8.1"
+ checksum: 10c0/dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
languageName: node
linkType: hard
-"@emotion/unitless@npm:^0.7.0":
- version: 0.7.5
- resolution: "@emotion/unitless@npm:0.7.5"
- checksum: 10c0/4d0d94f53cb97b4481bbfa394953e1899a0b877644642ba9dd7247c27eb8c48e14e22aeb11411d7d9874685ad85dd5fb5b50eb78c6d8840eb56a84b92dcef2f4
+"@emotion/unitless@npm:0.8.0":
+ version: 0.8.0
+ resolution: "@emotion/unitless@npm:0.8.0"
+ checksum: 10c0/1f2cfb7c0ccb83c20b1c6d8d92a74a93da4b2a440f9a0d49ded08647faf299065a2ffde17e1335920fa10397b85f8635bbfe14f3cd29222a59ea81d978478072
languageName: node
linkType: hard
@@ -2010,6 +2010,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/stylis@npm:4.2.0":
+ version: 4.2.0
+ resolution: "@types/stylis@npm:4.2.0"
+ checksum: 10c0/c76c13e76ca485f598a13984cfb5e07bb88a851da5bee213587424a5f101f182c74f4f92d633cebf9abcec40ccebb645d600d184b7e4b42793e3eeca8729b110
+ languageName: node
+ linkType: hard
+
"@types/use-sync-external-store@npm:^0.0.3":
version: 0.0.3
resolution: "@types/use-sync-external-store@npm:0.0.3"
@@ -2654,21 +2661,6 @@ __metadata:
languageName: node
linkType: hard
-"babel-plugin-styled-components@npm:>= 1":
- version: 2.1.4
- resolution: "babel-plugin-styled-components@npm:2.1.4"
- dependencies:
- "@babel/helper-annotate-as-pure": "npm:^7.22.5"
- "@babel/helper-module-imports": "npm:^7.22.5"
- "@babel/plugin-syntax-jsx": "npm:^7.22.5"
- lodash: "npm:^4.17.21"
- picomatch: "npm:^2.3.1"
- peerDependencies:
- styled-components: ">= 2"
- checksum: 10c0/553f35f5feb4b51fda9c9aeef8a31c1b66f430687ab17830b7cdacfe7e93f912aef55bf59e402f4e0a1fa7ad039768ab3626512bbb9bf1f76fcc67ba47e7a56e
- languageName: node
- linkType: hard
-
"babel-runtime@npm:^6.6.1":
version: 6.26.0
resolution: "babel-runtime@npm:6.26.0"
@@ -3204,14 +3196,14 @@ __metadata:
languageName: node
linkType: hard
-"css-to-react-native@npm:^2.2.2":
- version: 2.3.2
- resolution: "css-to-react-native@npm:2.3.2"
+"css-to-react-native@npm:3.2.0":
+ version: 3.2.0
+ resolution: "css-to-react-native@npm:3.2.0"
dependencies:
camelize: "npm:^1.0.0"
css-color-keywords: "npm:^1.0.0"
- postcss-value-parser: "npm:^3.3.0"
- checksum: 10c0/37b369a52431fc356fcdfda4268ae201c8dce110e8698d8e890692cded67c7cde4872d22124e3bb026e4a2cb68e8dde4ec6e6df229206539c1d8fef70e52444e
+ postcss-value-parser: "npm:^4.0.2"
+ checksum: 10c0/fde850a511d5d3d7c55a1e9b8ed26b69a8ad4868b3487e36ebfbfc0b96fc34bc977d9cd1d61a289d0c74d3f9a662d8cee297da53d4433bf2e27d6acdff8e1003
languageName: node
linkType: hard
@@ -3224,6 +3216,13 @@ __metadata:
languageName: node
linkType: hard
+"csstype@npm:3.1.2":
+ version: 3.1.2
+ resolution: "csstype@npm:3.1.2"
+ checksum: 10c0/32c038af259897c807ac738d9eab16b3d86747c72b09d5c740978e06f067f9b7b1737e1b75e407c7ab1fe1543dc95f20e202b4786aeb1b8d3bdf5d5ce655e6c6
+ languageName: node
+ linkType: hard
+
"csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
@@ -5266,13 +5265,6 @@ __metadata:
languageName: node
linkType: hard
-"is-what@npm:^3.3.1":
- version: 3.14.1
- resolution: "is-what@npm:3.14.1"
- checksum: 10c0/4b770b85454c877b6929a84fd47c318e1f8c2ff70fd72fd625bc3fde8e0c18a6e57345b6e7aa1ee9fbd1c608d27cfe885df473036c5c2e40cd2187250804a2c7
- languageName: node
- linkType: hard
-
"is-wsl@npm:^2.2.0":
version: 2.2.0
resolution: "is-wsl@npm:2.2.0"
@@ -5531,7 +5523,7 @@ __metadata:
redux-thunk: "npm:^1.0.0"
source-map-loader: "npm:^0.2.1"
style-loader: "npm:^3.3.3"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
url-loader: "npm:^0.5.9"
webpack: "npm:^5.89.0"
webpack-cli: "npm:^5.1.4"
@@ -5640,7 +5632,7 @@ __metadata:
languageName: node
linkType: hard
-"lodash@npm:^4.13.1, lodash@npm:^4.17.11, lodash@npm:^4.17.12, lodash@npm:^4.17.14, lodash@npm:^4.17.21":
+"lodash@npm:^4.13.1, lodash@npm:^4.17.11, lodash@npm:^4.17.12, lodash@npm:^4.17.14":
version: 4.17.21
resolution: "lodash@npm:4.17.21"
checksum: 10c0/d8cbea072bb08655bb4c989da418994b073a608dffa608b09ac04b43a791b12aeae7cd7ad919aa4c925f33b48490b5cfe6c1f71d827956071dae2e7bb3a6b74c
@@ -5728,22 +5720,6 @@ __metadata:
languageName: node
linkType: hard
-"memoize-one@npm:^5.0.0":
- version: 5.2.1
- resolution: "memoize-one@npm:5.2.1"
- checksum: 10c0/fd22dbe9a978a2b4f30d6a491fc02fb90792432ad0dab840dc96c1734d2bd7c9cdeb6a26130ec60507eb43230559523615873168bcbe8fafab221c30b11d54c1
- languageName: node
- linkType: hard
-
-"merge-anything@npm:^2.2.4":
- version: 2.4.4
- resolution: "merge-anything@npm:2.4.4"
- dependencies:
- is-what: "npm:^3.3.1"
- checksum: 10c0/62864df52af3b5cbeddd3cf6381ed0e2f23b7db8796c460e8432f7c67fbe9528bbb26427b7feef55da25b87a6a8904b3e261a76f8c8171fa945cc8da0bde1ca8
- languageName: node
- linkType: hard
-
"merge-descriptors@npm:1.0.3":
version: 1.0.3
resolution: "merge-descriptors@npm:1.0.3"
@@ -6015,7 +5991,7 @@ __metadata:
languageName: node
linkType: hard
-"nanoid@npm:^3.3.7":
+"nanoid@npm:^3.3.6, nanoid@npm:^3.3.7":
version: 3.3.8
resolution: "nanoid@npm:3.3.8"
bin:
@@ -6530,20 +6506,24 @@ __metadata:
languageName: node
linkType: hard
-"postcss-value-parser@npm:^3.3.0":
- version: 3.3.1
- resolution: "postcss-value-parser@npm:3.3.1"
- checksum: 10c0/23eed98d8eeadb1f9ef1db4a2757da0f1d8e7c1dac2a38d6b35d971aab9eb3c6d8a967d0e9f435558834ffcd966afbbe875a56bcc5bcdd09e663008c106b3e47
- languageName: node
- linkType: hard
-
-"postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
+"postcss-value-parser@npm:^4.0.2, postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
version: 4.2.0
resolution: "postcss-value-parser@npm:4.2.0"
checksum: 10c0/f4142a4f56565f77c1831168e04e3effd9ffcc5aebaf0f538eee4b2d465adfd4b85a44257bb48418202a63806a7da7fe9f56c330aebb3cac898e46b4cbf49161
languageName: node
linkType: hard
+"postcss@npm:8.4.31":
+ version: 8.4.31
+ resolution: "postcss@npm:8.4.31"
+ dependencies:
+ nanoid: "npm:^3.3.6"
+ picocolors: "npm:^1.0.0"
+ source-map-js: "npm:^1.0.2"
+ checksum: 10c0/748b82e6e5fc34034dcf2ae88ea3d11fd09f69b6c50ecdd3b4a875cfc7cdca435c958b211e2cb52355422ab6fccb7d8f2f2923161d7a1b281029e4a913d59acf
+ languageName: node
+ linkType: hard
+
"postcss@npm:^8.4.33":
version: 8.4.49
resolution: "postcss@npm:8.4.49"
@@ -6741,7 +6721,7 @@ __metadata:
languageName: node
linkType: hard
-"react-is@npm:^16.13.0, react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.6.3, react-is@npm:^16.7.0, react-is@npm:^16.8.6":
+"react-is@npm:^16.13.0, react-is@npm:^16.13.1, react-is@npm:^16.6.3, react-is@npm:^16.7.0, react-is@npm:^16.8.6":
version: 16.13.1
resolution: "react-is@npm:16.13.1"
checksum: 10c0/33977da7a5f1a287936a0c85639fec6ca74f4f15ef1e59a6bc20338fc73dc69555381e211f7a3529b8150a1f71e4225525b41b60b52965bda53ce7d47377ada1
@@ -7538,6 +7518,13 @@ __metadata:
languageName: node
linkType: hard
+"shallowequal@npm:1.1.0":
+ version: 1.1.0
+ resolution: "shallowequal@npm:1.1.0"
+ checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
+ languageName: node
+ linkType: hard
+
"shebang-command@npm:^1.2.0":
version: 1.2.0
resolution: "shebang-command@npm:1.2.0"
@@ -7653,7 +7640,7 @@ __metadata:
languageName: node
linkType: hard
-"source-map-js@npm:^1.2.1":
+"source-map-js@npm:^1.0.2, source-map-js@npm:^1.2.1":
version: 1.2.1
resolution: "source-map-js@npm:1.2.1"
checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf
@@ -7949,47 +7936,34 @@ __metadata:
languageName: node
linkType: hard
-"styled-components@npm:^4.1.3":
- version: 4.4.1
- resolution: "styled-components@npm:4.4.1"
+"styled-components@npm:6.1.8":
+ version: 6.1.8
+ resolution: "styled-components@npm:6.1.8"
dependencies:
- "@babel/helper-module-imports": "npm:^7.0.0"
- "@babel/traverse": "npm:^7.0.0"
- "@emotion/is-prop-valid": "npm:^0.8.1"
- "@emotion/unitless": "npm:^0.7.0"
- babel-plugin-styled-components: "npm:>= 1"
- css-to-react-native: "npm:^2.2.2"
- memoize-one: "npm:^5.0.0"
- merge-anything: "npm:^2.2.4"
- prop-types: "npm:^15.5.4"
- react-is: "npm:^16.6.0"
- stylis: "npm:^3.5.0"
- stylis-rule-sheet: "npm:^0.0.10"
- supports-color: "npm:^5.5.0"
+ "@emotion/is-prop-valid": "npm:1.2.1"
+ "@emotion/unitless": "npm:0.8.0"
+ "@types/stylis": "npm:4.2.0"
+ css-to-react-native: "npm:3.2.0"
+ csstype: "npm:3.1.2"
+ postcss: "npm:8.4.31"
+ shallowequal: "npm:1.1.0"
+ stylis: "npm:4.3.1"
+ tslib: "npm:2.5.0"
peerDependencies:
- react: ">= 16.3.0"
- react-dom: ">= 16.3.0"
- checksum: 10c0/a95eeb24bf953ec746ca53389c9763ef8242a25cfda1d3a4250a2bd16b614002209f57974c1a4645aedcb13b1d91186c873b23640f3fca5b4afb9eec96a8c71c
+ react: ">= 16.8.0"
+ react-dom: ">= 16.8.0"
+ checksum: 10c0/fafe4b9198d5d7980c2358821d1a89f86200d55c8eec03670cf12cf43b8a05a77eafaf0872cd85821f68238308e0f5c9d9aa43a62e6987c65b70baa2c3277ab8
languageName: node
linkType: hard
-"stylis-rule-sheet@npm:^0.0.10":
- version: 0.0.10
- resolution: "stylis-rule-sheet@npm:0.0.10"
- peerDependencies:
- stylis: ^3.5.0
- checksum: 10c0/362d1a6473569f702ed814a17ecb0a71f84cb93c45aaf82d6054dd1167d60cc4d2d0bc73dc15eb069cd11ea2d91fefb572f910db64c1b5f07f81296a9c6d0f24
+"stylis@npm:4.3.1":
+ version: 4.3.1
+ resolution: "stylis@npm:4.3.1"
+ checksum: 10c0/33e8ebd2bfa5f0bd0215f718dc2d3be896e1d00c5bcaeb9a4ae03cf239db6867af9eee230f57229bf1c29499357073ba3e6b547484ba1db2f5de1e8be7d4eee9
languageName: node
linkType: hard
-"stylis@npm:^3.5.0":
- version: 3.5.4
- resolution: "stylis@npm:3.5.4"
- checksum: 10c0/5da2f4527d6f3b4877bd575dca068698ddc7882d0f4c3f69178f19328726a2b885e03d759ef82bb06e9bd1a5d47f1f2ce17cc5acbeee2435d42940a261ee11fd
- languageName: node
- linkType: hard
-
-"supports-color@npm:^5.3.0, supports-color@npm:^5.5.0":
+"supports-color@npm:^5.3.0":
version: 5.5.0
resolution: "supports-color@npm:5.5.0"
dependencies:
@@ -8136,6 +8110,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:2.5.0":
+ version: 2.5.0
+ resolution: "tslib@npm:2.5.0"
+ checksum: 10c0/e32fc99cc730dd514e53c44e668d76016e738f0bcc726aad5dbd2d335cf19b87a95a9b1e4f0a9993e370f1d702b5e471cdd4acabcac428a3099d496b9af2021e
+ languageName: node
+ linkType: hard
+
"tslib@npm:^1.9.0":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
diff --git a/yarn.lock b/yarn.lock
index 59424a214..a2cf9f7ee 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -234,7 +234,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/helper-module-imports@npm:^7.0.0, @babel/helper-module-imports@npm:^7.22.5, @babel/helper-module-imports@npm:^7.24.7":
+"@babel/helper-module-imports@npm:^7.22.5, @babel/helper-module-imports@npm:^7.24.7":
version: 7.24.7
resolution: "@babel/helper-module-imports@npm:7.24.7"
dependencies:
@@ -1868,7 +1868,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/traverse@npm:^7.0.0, @babel/traverse@npm:^7.1.4, @babel/traverse@npm:^7.12.1, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.8.3":
+"@babel/traverse@npm:^7.1.4, @babel/traverse@npm:^7.12.1, @babel/traverse@npm:^7.24.7, @babel/traverse@npm:^7.24.8, @babel/traverse@npm:^7.25.0, @babel/traverse@npm:^7.7.0, @babel/traverse@npm:^7.8.3":
version: 7.25.0
resolution: "@babel/traverse@npm:7.25.0"
dependencies:
@@ -2177,16 +2177,16 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/is-prop-valid@npm:^0.8.1":
- version: 0.8.8
- resolution: "@emotion/is-prop-valid@npm:0.8.8"
+"@emotion/is-prop-valid@npm:1.2.1":
+ version: 1.2.1
+ resolution: "@emotion/is-prop-valid@npm:1.2.1"
dependencies:
- "@emotion/memoize": "npm:0.7.4"
- checksum: 10c0/f6be625f067c7fa56a12a4edaf090715616dc4fc7803c87212831f38c969350107b9709b1be54100e53153b18d9fa068eb4bf4f9ac66a37a8edf1bac9b64e279
+ "@emotion/memoize": "npm:^0.8.1"
+ checksum: 10c0/7c2aabdf0ca9986ca25abc9dae711348308cf18d418d64ffa4c8ffd2114806c47f2e06ba8ee769f38ec67d65bd59ec73f34d94023e81baa1c43510ac86ccd5e6
languageName: node
linkType: hard
-"@emotion/is-prop-valid@npm:^1.3.1":
+"@emotion/is-prop-valid@npm:^1.2.1, @emotion/is-prop-valid@npm:^1.3.1":
version: 1.3.1
resolution: "@emotion/is-prop-valid@npm:1.3.1"
dependencies:
@@ -2195,10 +2195,10 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/memoize@npm:0.7.4":
- version: 0.7.4
- resolution: "@emotion/memoize@npm:0.7.4"
- checksum: 10c0/b2376548fc147b43afd1ff005a80a1a025bd7eb4fb759fdb23e96e5ff290ee8ba16628a332848d600fb91c3cdc319eee5395fa33d8875e5d5a8c4ce18cddc18e
+"@emotion/memoize@npm:^0.8.1":
+ version: 0.8.1
+ resolution: "@emotion/memoize@npm:0.8.1"
+ checksum: 10c0/dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
languageName: node
linkType: hard
@@ -2209,10 +2209,10 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/unitless@npm:^0.7.0":
- version: 0.7.5
- resolution: "@emotion/unitless@npm:0.7.5"
- checksum: 10c0/4d0d94f53cb97b4481bbfa394953e1899a0b877644642ba9dd7247c27eb8c48e14e22aeb11411d7d9874685ad85dd5fb5b50eb78c6d8840eb56a84b92dcef2f4
+"@emotion/unitless@npm:0.8.0":
+ version: 0.8.0
+ resolution: "@emotion/unitless@npm:0.8.0"
+ checksum: 10c0/1f2cfb7c0ccb83c20b1c6d8d92a74a93da4b2a440f9a0d49ded08647faf299065a2ffde17e1335920fa10397b85f8635bbfe14f3cd29222a59ea81d978478072
languageName: node
linkType: hard
@@ -3226,6 +3226,7 @@ __metadata:
"@dnd-kit/modifiers": "npm:^7.0.0"
"@dnd-kit/sortable": "npm:^8.0.0"
"@dnd-kit/utilities": "npm:^3.2.2"
+ "@emotion/is-prop-valid": "npm:^1.2.1"
"@floating-ui/react": "npm:0.25.1"
"@kepler.gl/actions": "npm:3.1.0-alpha.3"
"@kepler.gl/cloud-providers": "npm:3.1.0-alpha.3"
@@ -3269,7 +3270,7 @@ __metadata:
"@types/react-redux": "npm:^7.1.23"
"@types/react-virtualized": "npm:^9.21.30"
"@types/react-vis": "npm:1.11.7"
- "@types/styled-components": "npm:^5.1.25"
+ "@types/styled-components": "npm:^5.1.32"
classnames: "npm:^2.2.1"
copy-to-clipboard: "npm:^3.3.1"
d3-array: "npm:^2.8.0"
@@ -3315,7 +3316,7 @@ __metadata:
react-vis: "npm:1.11.7"
redux: "npm:^4.2.1"
reselect: "npm:^4.0.0"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
suncalc: "npm:^1.9.0"
viewport-mercator-project: "npm:^6.0.0"
languageName: unknown
@@ -3446,7 +3447,7 @@ __metadata:
"@types/keymirror": "npm:^0.1.1"
"@types/lodash.memoize": "npm:^4.1.7"
"@types/lodash.uniq": "npm:^4.5.7"
- "@types/styled-components": "npm:^5.1.25"
+ "@types/styled-components": "npm:^5.1.32"
apache-arrow: "npm:>=15.0.0"
d3-array: "npm:^2.8.0"
d3-shape: "npm:^1.2.0"
@@ -3462,7 +3463,7 @@ __metadata:
react-markdown: "npm:^6.0.3"
reselect: "npm:^4.0.0"
s2-geometry: "npm:^1.2.10"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
type-analyzer: "npm:0.4.0"
viewport-mercator-project: "npm:^6.0.0"
languageName: unknown
@@ -3584,8 +3585,8 @@ __metadata:
resolution: "@kepler.gl/styles@workspace:src/styles"
dependencies:
"@kepler.gl/constants": "npm:3.1.0-alpha.3"
- "@types/styled-components": "npm:^5.1.25"
- styled-components: "npm:^4.1.3"
+ "@types/styled-components": "npm:^5.1.32"
+ styled-components: "npm:6.1.8"
languageName: unknown
linkType: soft
@@ -9999,7 +10000,7 @@ __metadata:
languageName: node
linkType: hard
-"@types/styled-components@npm:^5.1.25":
+"@types/styled-components@npm:^5.1.32":
version: 5.1.34
resolution: "@types/styled-components@npm:5.1.34"
dependencies:
@@ -10010,6 +10011,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/stylis@npm:4.2.0":
+ version: 4.2.0
+ resolution: "@types/stylis@npm:4.2.0"
+ checksum: 10c0/c76c13e76ca485f598a13984cfb5e07bb88a851da5bee213587424a5f101f182c74f4f92d633cebf9abcec40ccebb645d600d184b7e4b42793e3eeca8729b110
+ languageName: node
+ linkType: hard
+
"@types/supercluster@npm:^7.1.0, @types/supercluster@npm:^7.1.3":
version: 7.1.3
resolution: "@types/supercluster@npm:7.1.3"
@@ -11596,7 +11604,7 @@ __metadata:
languageName: node
linkType: hard
-"babel-plugin-styled-components@npm:>= 1":
+"babel-plugin-styled-components@npm:^2.1.4":
version: 2.1.4
resolution: "babel-plugin-styled-components@npm:2.1.4"
dependencies:
@@ -13683,14 +13691,14 @@ __metadata:
languageName: node
linkType: hard
-"css-to-react-native@npm:^2.2.2":
- version: 2.3.2
- resolution: "css-to-react-native@npm:2.3.2"
+"css-to-react-native@npm:3.2.0":
+ version: 3.2.0
+ resolution: "css-to-react-native@npm:3.2.0"
dependencies:
camelize: "npm:^1.0.0"
css-color-keywords: "npm:^1.0.0"
- postcss-value-parser: "npm:^3.3.0"
- checksum: 10c0/37b369a52431fc356fcdfda4268ae201c8dce110e8698d8e890692cded67c7cde4872d22124e3bb026e4a2cb68e8dde4ec6e6df229206539c1d8fef70e52444e
+ postcss-value-parser: "npm:^4.0.2"
+ checksum: 10c0/fde850a511d5d3d7c55a1e9b8ed26b69a8ad4868b3487e36ebfbfc0b96fc34bc977d9cd1d61a289d0c74d3f9a662d8cee297da53d4433bf2e27d6acdff8e1003
languageName: node
linkType: hard
@@ -13756,6 +13764,13 @@ __metadata:
languageName: node
linkType: hard
+"csstype@npm:3.1.2":
+ version: 3.1.2
+ resolution: "csstype@npm:3.1.2"
+ checksum: 10c0/32c038af259897c807ac738d9eab16b3d86747c72b09d5c740978e06f067f9b7b1737e1b75e407c7ab1fe1543dc95f20e202b4786aeb1b8d3bdf5d5ce655e6c6
+ languageName: node
+ linkType: hard
+
"csstype@npm:^3.0.2":
version: 3.1.3
resolution: "csstype@npm:3.1.3"
@@ -19363,13 +19378,6 @@ __metadata:
languageName: node
linkType: hard
-"is-what@npm:^3.3.1":
- version: 3.14.1
- resolution: "is-what@npm:3.14.1"
- checksum: 10c0/4b770b85454c877b6929a84fd47c318e1f8c2ff70fd72fd625bc3fde8e0c18a6e57345b6e7aa1ee9fbd1c608d27cfe885df473036c5c2e40cd2187250804a2c7
- languageName: node
- linkType: hard
-
"is-whitespace-character@npm:^1.0.0":
version: 1.0.4
resolution: "is-whitespace-character@npm:1.0.4"
@@ -20502,6 +20510,7 @@ __metadata:
babel-plugin-istanbul: "npm:^6.0.0"
babel-plugin-module-resolver: "npm:^4.0.0"
babel-plugin-search-and-replace: "npm:^1.0.0"
+ babel-plugin-styled-components: "npm:^2.1.4"
babel-plugin-transform-builtin-extend: "npm:^1.1.0"
babelify: "npm:^10.0.0"
css-loader: "npm:5.2.7"
@@ -20545,7 +20554,7 @@ __metadata:
sinon-stub-promise: "npm:^4.0.0"
source-map-loader: "npm:^1.1.1"
style-loader: "npm:2.0.0"
- styled-components: "npm:^4.1.3"
+ styled-components: "npm:6.1.8"
stylelint: "npm:^13.6.1"
stylelint-config-recommended: "npm:^3.0.0"
stylelint-config-styled-components: "npm:^0.1.1"
@@ -20568,7 +20577,7 @@ __metadata:
peerDependencies:
react: ">=18.2"
react-dom: ">=18.2"
- styled-components: ^4.x || ^5.x
+ styled-components: 6.1.8
languageName: unknown
linkType: soft
@@ -21773,13 +21782,6 @@ __metadata:
languageName: node
linkType: hard
-"memoize-one@npm:^5.0.0":
- version: 5.2.1
- resolution: "memoize-one@npm:5.2.1"
- checksum: 10c0/fd22dbe9a978a2b4f30d6a491fc02fb90792432ad0dab840dc96c1734d2bd7c9cdeb6a26130ec60507eb43230559523615873168bcbe8fafab221c30b11d54c1
- languageName: node
- linkType: hard
-
"memory-fs@npm:^0.4.1":
version: 0.4.1
resolution: "memory-fs@npm:0.4.1"
@@ -21820,15 +21822,6 @@ __metadata:
languageName: node
linkType: hard
-"merge-anything@npm:^2.2.4":
- version: 2.4.4
- resolution: "merge-anything@npm:2.4.4"
- dependencies:
- is-what: "npm:^3.3.1"
- checksum: 10c0/62864df52af3b5cbeddd3cf6381ed0e2f23b7db8796c460e8432f7c67fbe9528bbb26427b7feef55da25b87a6a8904b3e261a76f8c8171fa945cc8da0bde1ca8
- languageName: node
- linkType: hard
-
"merge-descriptors@npm:1.0.1":
version: 1.0.1
resolution: "merge-descriptors@npm:1.0.1"
@@ -22445,7 +22438,7 @@ __metadata:
languageName: node
linkType: hard
-"nanoid@npm:^3.3.7":
+"nanoid@npm:^3.3.6, nanoid@npm:^3.3.7":
version: 3.3.8
resolution: "nanoid@npm:3.3.8"
bin:
@@ -24243,20 +24236,24 @@ __metadata:
languageName: node
linkType: hard
-"postcss-value-parser@npm:^3.3.0":
- version: 3.3.1
- resolution: "postcss-value-parser@npm:3.3.1"
- checksum: 10c0/23eed98d8eeadb1f9ef1db4a2757da0f1d8e7c1dac2a38d6b35d971aab9eb3c6d8a967d0e9f435558834ffcd966afbbe875a56bcc5bcdd09e663008c106b3e47
- languageName: node
- linkType: hard
-
-"postcss-value-parser@npm:^4.0.0, postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
+"postcss-value-parser@npm:^4.0.0, postcss-value-parser@npm:^4.0.2, postcss-value-parser@npm:^4.1.0, postcss-value-parser@npm:^4.2.0":
version: 4.2.0
resolution: "postcss-value-parser@npm:4.2.0"
checksum: 10c0/f4142a4f56565f77c1831168e04e3effd9ffcc5aebaf0f538eee4b2d465adfd4b85a44257bb48418202a63806a7da7fe9f56c330aebb3cac898e46b4cbf49161
languageName: node
linkType: hard
+"postcss@npm:8.4.31":
+ version: 8.4.31
+ resolution: "postcss@npm:8.4.31"
+ dependencies:
+ nanoid: "npm:^3.3.6"
+ picocolors: "npm:^1.0.0"
+ source-map-js: "npm:^1.0.2"
+ checksum: 10c0/748b82e6e5fc34034dcf2ae88ea3d11fd09f69b6c50ecdd3b4a875cfc7cdca435c958b211e2cb52355422ab6fccb7d8f2f2923161d7a1b281029e4a913d59acf
+ languageName: node
+ linkType: hard
+
"postcss@npm:^7.0.14, postcss@npm:^7.0.2, postcss@npm:^7.0.21, postcss@npm:^7.0.26, postcss@npm:^7.0.32, postcss@npm:^7.0.35, postcss@npm:^7.0.6":
version: 7.0.39
resolution: "postcss@npm:7.0.39"
@@ -24498,7 +24495,7 @@ __metadata:
languageName: node
linkType: hard
-"prop-types@npm:^15.5.10, prop-types@npm:^15.5.4, prop-types@npm:^15.5.7, prop-types@npm:^15.5.8, prop-types@npm:^15.6.0, prop-types@npm:^15.6.1, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
+"prop-types@npm:^15.5.10, prop-types@npm:^15.5.7, prop-types@npm:^15.5.8, prop-types@npm:^15.6.0, prop-types@npm:^15.6.1, prop-types@npm:^15.6.2, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1":
version: 15.8.1
resolution: "prop-types@npm:15.8.1"
dependencies:
@@ -25168,7 +25165,7 @@ __metadata:
languageName: node
linkType: hard
-"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0, react-is@npm:^16.8.6":
+"react-is@npm:^16.13.1, react-is@npm:^16.7.0, react-is@npm:^16.8.6":
version: 16.13.1
resolution: "react-is@npm:16.13.1"
checksum: 10c0/33977da7a5f1a287936a0c85639fec6ca74f4f15ef1e59a6bc20338fc73dc69555381e211f7a3529b8150a1f71e4225525b41b60b52965bda53ce7d47377ada1
@@ -26925,7 +26922,7 @@ __metadata:
languageName: node
linkType: hard
-"shallowequal@npm:^1.1.0":
+"shallowequal@npm:1.1.0, shallowequal@npm:^1.1.0":
version: 1.1.0
resolution: "shallowequal@npm:1.1.0"
checksum: 10c0/b926efb51cd0f47aa9bc061add788a4a650550bbe50647962113a4579b60af2abe7b62f9b02314acc6f97151d4cf87033a2b15fc20852fae306d1a095215396c
@@ -27268,7 +27265,7 @@ __metadata:
languageName: node
linkType: hard
-"source-map-js@npm:^1.2.1":
+"source-map-js@npm:^1.0.2, source-map-js@npm:^1.2.1":
version: 1.2.1
resolution: "source-map-js@npm:1.2.1"
checksum: 10c0/7bda1fc4c197e3c6ff17de1b8b2c20e60af81b63a52cb32ec5a5d67a20a7d42651e2cb34ebe93833c5a2a084377e17455854fee3e21e7925c64a51b6a52b0faf
@@ -28018,27 +28015,23 @@ __metadata:
languageName: node
linkType: hard
-"styled-components@npm:^4.1.3":
- version: 4.4.1
- resolution: "styled-components@npm:4.4.1"
+"styled-components@npm:6.1.8":
+ version: 6.1.8
+ resolution: "styled-components@npm:6.1.8"
dependencies:
- "@babel/helper-module-imports": "npm:^7.0.0"
- "@babel/traverse": "npm:^7.0.0"
- "@emotion/is-prop-valid": "npm:^0.8.1"
- "@emotion/unitless": "npm:^0.7.0"
- babel-plugin-styled-components: "npm:>= 1"
- css-to-react-native: "npm:^2.2.2"
- memoize-one: "npm:^5.0.0"
- merge-anything: "npm:^2.2.4"
- prop-types: "npm:^15.5.4"
- react-is: "npm:^16.6.0"
- stylis: "npm:^3.5.0"
- stylis-rule-sheet: "npm:^0.0.10"
- supports-color: "npm:^5.5.0"
+ "@emotion/is-prop-valid": "npm:1.2.1"
+ "@emotion/unitless": "npm:0.8.0"
+ "@types/stylis": "npm:4.2.0"
+ css-to-react-native: "npm:3.2.0"
+ csstype: "npm:3.1.2"
+ postcss: "npm:8.4.31"
+ shallowequal: "npm:1.1.0"
+ stylis: "npm:4.3.1"
+ tslib: "npm:2.5.0"
peerDependencies:
- react: ">= 16.3.0"
- react-dom: ">= 16.3.0"
- checksum: 10c0/a95eeb24bf953ec746ca53389c9763ef8242a25cfda1d3a4250a2bd16b614002209f57974c1a4645aedcb13b1d91186c873b23640f3fca5b4afb9eec96a8c71c
+ react: ">= 16.8.0"
+ react-dom: ">= 16.8.0"
+ checksum: 10c0/fafe4b9198d5d7980c2358821d1a89f86200d55c8eec03670cf12cf43b8a05a77eafaf0872cd85821f68238308e0f5c9d9aa43a62e6987c65b70baa2c3277ab8
languageName: node
linkType: hard
@@ -28141,19 +28134,10 @@ __metadata:
languageName: node
linkType: hard
-"stylis-rule-sheet@npm:^0.0.10":
- version: 0.0.10
- resolution: "stylis-rule-sheet@npm:0.0.10"
- peerDependencies:
- stylis: ^3.5.0
- checksum: 10c0/362d1a6473569f702ed814a17ecb0a71f84cb93c45aaf82d6054dd1167d60cc4d2d0bc73dc15eb069cd11ea2d91fefb572f910db64c1b5f07f81296a9c6d0f24
- languageName: node
- linkType: hard
-
-"stylis@npm:^3.5.0":
- version: 3.5.4
- resolution: "stylis@npm:3.5.4"
- checksum: 10c0/5da2f4527d6f3b4877bd575dca068698ddc7882d0f4c3f69178f19328726a2b885e03d759ef82bb06e9bd1a5d47f1f2ce17cc5acbeee2435d42940a261ee11fd
+"stylis@npm:4.3.1":
+ version: 4.3.1
+ resolution: "stylis@npm:4.3.1"
+ checksum: 10c0/33e8ebd2bfa5f0bd0215f718dc2d3be896e1d00c5bcaeb9a4ae03cf239db6867af9eee230f57229bf1c29499357073ba3e6b547484ba1db2f5de1e8be7d4eee9
languageName: node
linkType: hard
@@ -28225,7 +28209,7 @@ __metadata:
languageName: node
linkType: hard
-"supports-color@npm:^5.0.0, supports-color@npm:^5.3.0, supports-color@npm:^5.5.0":
+"supports-color@npm:^5.0.0, supports-color@npm:^5.3.0":
version: 5.5.0
resolution: "supports-color@npm:5.5.0"
dependencies:
@@ -29020,6 +29004,13 @@ __metadata:
languageName: node
linkType: hard
+"tslib@npm:2.5.0":
+ version: 2.5.0
+ resolution: "tslib@npm:2.5.0"
+ checksum: 10c0/e32fc99cc730dd514e53c44e668d76016e738f0bcc726aad5dbd2d335cf19b87a95a9b1e4f0a9993e370f1d702b5e471cdd4acabcac428a3099d496b9af2021e
+ languageName: node
+ linkType: hard
+
"tslib@npm:^1.10.0, tslib@npm:^1.8.1":
version: 1.14.1
resolution: "tslib@npm:1.14.1"