@pushwoosh/dumb-components 1.1.198 → 1.1.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LeafletTheme/styles.js +3 -1
- package/Spinner/styles.js +9 -4
- package/package.json +1 -1
package/LeafletTheme/styles.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createGlobalStyle } from 'styled-components';
|
|
2
2
|
import { Color, THEME_ATTRIBUTE } from '@pushwoosh/kit-constants';
|
|
3
|
+
// Leaflet's own sheet lands after ours, so equal specificity would lose on order.
|
|
4
|
+
const ROOT = '.leaflet-container.leaflet-container';
|
|
3
5
|
const DARK_TILES = 'invert(1) hue-rotate(180deg) brightness(0.9) contrast(1.05) saturate(0.55)';
|
|
4
6
|
/**
|
|
5
7
|
* Repaints Leaflet's own chrome with Pushwoosh tokens — map surface, zoom buttons,
|
|
@@ -7,4 +9,4 @@ const DARK_TILES = 'invert(1) hue-rotate(180deg) brightness(0.9) contrast(1.05)
|
|
|
7
9
|
* @example
|
|
8
10
|
* <LeafletTheme />
|
|
9
11
|
*/
|
|
10
|
-
export const LeafletTheme = createGlobalStyle(["
|
|
12
|
+
export const LeafletTheme = createGlobalStyle(["", "{background:", ";color:", ";}", " a{color:", ";}", " .leaflet-bar a,", " .leaflet-control-layers-toggle{background-color:", ";color:", ";border-bottom-color:", ";}", " .leaflet-bar a:hover,", " .leaflet-bar a:focus{background-color:", ";color:", ";}", " .leaflet-bar a.leaflet-disabled{background-color:", ";color:", ";}.leaflet-touch", " .leaflet-bar,.leaflet-touch", " .leaflet-control-layers{border-color:", ";}", " .leaflet-control-layers{background:", ";color:", ";}", " .leaflet-control-attribution{background:", ";color:", ";}", " .leaflet-control-scale-line{background:", ";color:", ";border-color:", ";text-shadow:none;}", " .leaflet-popup-content-wrapper,", " .leaflet-popup-tip{background:", ";color:", ";}", " a.leaflet-popup-close-button{color:", ";}", " a.leaflet-popup-close-button:hover,", " a.leaflet-popup-close-button:focus{color:", ";}", " .leaflet-tooltip{background-color:", ";border-color:", ";color:", ";}", " .leaflet-tooltip-top:before{border-top-color:", ";}", " .leaflet-tooltip-bottom:before{border-bottom-color:", ";}", " .leaflet-tooltip-left:before{border-left-color:", ";}", " .leaflet-tooltip-right:before{border-right-color:", ";}", " .leaflet-div-icon{background:", ";border-color:", ";}", " .leaflet-zoom-box{border-color:", ";background:", ";}[", "='dark'] ", " .leaflet-tile-pane{filter:", ";}"], ROOT, Color.FROZEN, Color.MAIN, ROOT, Color.PRIMARY, ROOT, ROOT, Color.CLEAR, Color.MAIN, Color.FORM, ROOT, ROOT, Color.FROZEN, Color.MAIN, ROOT, Color.FROZEN, Color.PHANTOM, ROOT, ROOT, Color.FORM, ROOT, Color.CLEAR, Color.MAIN, ROOT, Color.CLEAR, Color.LOCKED, ROOT, Color.CLEAR, Color.MAIN, Color.FORM, ROOT, ROOT, Color.CLEAR, Color.MAIN, ROOT, Color.LOCKED, ROOT, ROOT, Color.MAIN, ROOT, Color.CLEAR, Color.CLEAR, Color.MAIN, ROOT, Color.CLEAR, ROOT, Color.CLEAR, ROOT, Color.CLEAR, ROOT, Color.CLEAR, ROOT, Color.CLEAR, Color.FORM, ROOT, Color.PRIMARY, Color.BRIGHT_LIGHT, THEME_ATTRIBUTE, ROOT, DARK_TILES);
|
package/Spinner/styles.js
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
import styled, { keyframes } from 'styled-components';
|
|
2
|
-
import { Color } from '@pushwoosh/kit-constants';
|
|
1
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
2
|
+
import { Color, THEME_ATTRIBUTE } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { SizeInPxBySpinnerSizeMap } from './maps';
|
|
4
4
|
const rotate = keyframes(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]);
|
|
5
|
+
const cycleAccents = keyframes(["0%,100%{color:", ";}25%{color:", ";}50%{color:", ";}75%{color:", ";}"], Color.BRIGHT, Color.DANGER, Color.SUCCESS, Color.EXCEPTIONAL);
|
|
6
|
+
// Only when the caller left the colour to us: an explicit `color` is intent, not a default.
|
|
7
|
+
const accentCycle = css(["[", "='dark'] &{animation:", " 4s linear infinite;}@media (prefers-reduced-motion:reduce){[", "='dark'] &{animation:none;color:", ";}}"], THEME_ATTRIBUTE, cycleAccents, THEME_ATTRIBUTE, Color.BRIGHT);
|
|
5
8
|
export const SpinnerBox = styled.div.withConfig({
|
|
6
9
|
displayName: "SpinnerBox",
|
|
7
10
|
componentId: "sc-y39y31-0"
|
|
8
|
-
})(["width:", ";height:", ";color:", ";line-height:0;user-select:none;"], ({
|
|
11
|
+
})(["width:", ";height:", ";color:", ";line-height:0;user-select:none;", ""], ({
|
|
9
12
|
size
|
|
10
13
|
}) => SizeInPxBySpinnerSizeMap[size], ({
|
|
11
14
|
size
|
|
12
15
|
}) => SizeInPxBySpinnerSizeMap[size], ({
|
|
13
16
|
color
|
|
14
|
-
}) => color || Color.CURRENT
|
|
17
|
+
}) => color || Color.CURRENT, ({
|
|
18
|
+
color
|
|
19
|
+
}) => !color && accentCycle);
|
|
15
20
|
export const SpinnerAnimate = styled.div.withConfig({
|
|
16
21
|
displayName: "SpinnerAnimate",
|
|
17
22
|
componentId: "sc-y39y31-1"
|