@pushwoosh/dumb-components 1.1.201 → 1.1.202
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.
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { Color, Shadow, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
2
|
+
import { Color, FontWeight, Shadow, ShapeRadius, THEME_ATTRIBUTE } from '@pushwoosh/kit-constants';
|
|
3
3
|
import { H4 } from '@pushwoosh/kit-typography';
|
|
4
4
|
const tabBodyHover = css(["&:hover{color:", ";background-color:", ";}"], Color.PRIMARY_HOVER, Color.BRIGHT_LIGHT);
|
|
5
|
+
// A drop shadow is what marks the active tab in light; on a dark bar it falls on
|
|
6
|
+
// an already dark track, so the surface is lifted and outlined instead.
|
|
7
|
+
const darkActiveTab = css(["[", "='dark'] &&{background-color:", ";box-shadow:inset 0 0 0 1px ", ";}"], THEME_ATTRIBUTE, Color.FORM, Color.PHANTOM);
|
|
5
8
|
export const TabBody = styled.div.withConfig({
|
|
6
9
|
displayName: "TabBody",
|
|
7
10
|
componentId: "sc-133yrgu-0"
|
|
8
|
-
})(["display:flex;justify-content:center;align-items:center;position:relative;padding:6px ", " 6px 16px;background-color:", ";border-radius:", ";box-shadow:", ";cursor:", ";user-select:none;white-space:nowrap;color:", ";", ""], ({
|
|
11
|
+
})(["display:flex;justify-content:center;align-items:center;position:relative;padding:6px ", " 6px 16px;background-color:", ";border-radius:", ";box-shadow:", ";cursor:", ";user-select:none;white-space:nowrap;color:", ";", " ", ""], ({
|
|
9
12
|
$hasIcon
|
|
10
13
|
}) => $hasIcon ? '12px' : '16px', ({
|
|
11
14
|
$isActive
|
|
@@ -24,7 +27,10 @@ export const TabBody = styled.div.withConfig({
|
|
|
24
27
|
}) => $isDisabled ? Color.LOCKED : Color.MAIN, ({
|
|
25
28
|
$isActive,
|
|
26
29
|
$isDisabled
|
|
27
|
-
}) => !$isActive && !$isDisabled && tabBodyHover
|
|
30
|
+
}) => !$isActive && !$isDisabled && tabBodyHover, ({
|
|
31
|
+
$isActive,
|
|
32
|
+
$isDisabled
|
|
33
|
+
}) => $isActive && !$isDisabled && darkActiveTab);
|
|
28
34
|
export const TabRedDot = styled.div.withConfig({
|
|
29
35
|
displayName: "TabRedDot",
|
|
30
36
|
componentId: "sc-133yrgu-1"
|
|
@@ -32,9 +38,11 @@ export const TabRedDot = styled.div.withConfig({
|
|
|
32
38
|
export const TabButtonLabel = styled(H4).withConfig({
|
|
33
39
|
displayName: "TabButtonLabel",
|
|
34
40
|
componentId: "sc-133yrgu-2"
|
|
35
|
-
})(["opacity:", ";"], ({
|
|
41
|
+
})(["opacity:", ";[", "='dark'] &&{font-weight:", ";}"], ({
|
|
42
|
+
$isActive
|
|
43
|
+
}) => $isActive ? 1 : 0.8, THEME_ATTRIBUTE, ({
|
|
36
44
|
$isActive
|
|
37
|
-
}) => $isActive ?
|
|
45
|
+
}) => $isActive ? FontWeight.MEDIUM : FontWeight.REGULAR);
|
|
38
46
|
export const TabIconBox = styled.div.withConfig({
|
|
39
47
|
displayName: "TabIconBox",
|
|
40
48
|
componentId: "sc-133yrgu-3"
|