@atlaskit/atlassian-navigation 2.2.7 → 2.2.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/atlassian-navigation
2
2
 
3
+ ## 2.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`eb77cae1ea4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eb77cae1ea4) - [ux] Selected buttons that have menus in the atlassian-navigation component now show the correct background color when "selected"
8
+
3
9
  ## 2.2.7
4
10
 
5
11
  ### Patch Changes
@@ -26,7 +26,7 @@ var getPrimaryButtonTheme = function getPrimaryButtonTheme(_ref) {
26
26
  padding: '0 4px',
27
27
  marginLeft: 0,
28
28
  marginRight: 0,
29
- ':hover': primaryButton.hover,
29
+ ':hover': props.isSelected ? primaryButton.selectedHover : primaryButton.hover,
30
30
  ':focus': primaryButton.focus,
31
31
  // :active doesn't work in FF, because we do a
32
32
  // e.preventDefault() on mouse down in Button.
@@ -63,6 +63,11 @@ var defaultTheme = {
63
63
  color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
64
64
  backgroundColor: "var(--ds-background-selected, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.6), ")"),
65
65
  boxShadow: ''
66
+ },
67
+ selectedHover: {
68
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
69
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.6), ")"),
70
+ boxShadow: ''
66
71
  }
67
72
  },
68
73
  navigation: {
@@ -106,8 +111,13 @@ var defaultTheme = {
106
111
  color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
107
112
  backgroundColor: "var(--ds-background-selected, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.7), ")"),
108
113
  boxShadow: '',
109
- borderColor: "var(--ds-border-selected, ".concat(_colors.B400, ")"),
110
- bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(_colors.B400, ")"))
114
+ borderColor: "var(--ds-border-selected, ".concat(_colors.B400, ")")
115
+ },
116
+ selectedHover: {
117
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
118
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.6), ")"),
119
+ boxShadow: '',
120
+ borderColor: "var(--ds-border-selected, ".concat(_colors.B400, ")")
111
121
  }
112
122
  },
113
123
  search: {
@@ -58,7 +58,13 @@ var generateButtonCSSStates = function generateButtonCSSStates(colors, buttonTyp
58
58
  },
59
59
  selected: {
60
60
  color: color,
61
- backgroundColor: backgroundColor,
61
+ backgroundColor: (0, _themeHelpers.getContrastColor)(0.3, opacityValue, backgroundColor),
62
+ borderColor: highlightColor,
63
+ boxShadow: (0, _themeHelpers.getBoxShadow)('transparent')
64
+ },
65
+ selectedHover: {
66
+ color: color,
67
+ backgroundColor: (0, _themeHelpers.getContrastColor)(0.3, opacityValue, backgroundColor),
62
68
  borderColor: highlightColor,
63
69
  boxShadow: (0, _themeHelpers.getBoxShadow)('transparent')
64
70
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "sideEffects": false
5
5
  }
@@ -15,7 +15,7 @@ export const getPrimaryButtonTheme = ({
15
15
  padding: '0 4px',
16
16
  marginLeft: 0,
17
17
  marginRight: 0,
18
- ':hover': primaryButton.hover,
18
+ ':hover': props.isSelected ? primaryButton.selectedHover : primaryButton.hover,
19
19
  ':focus': primaryButton.focus,
20
20
  // :active doesn't work in FF, because we do a
21
21
  // e.preventDefault() on mouse down in Button.
@@ -54,6 +54,11 @@ const defaultTheme = {
54
54
  color: `var(--ds-text-selected, ${B400})`,
55
55
  backgroundColor: `var(--ds-background-selected, ${hexToRGBA(B50, 0.6)})`,
56
56
  boxShadow: ''
57
+ },
58
+ selectedHover: {
59
+ color: `var(--ds-text-selected, ${B400})`,
60
+ backgroundColor: `var(--ds-background-selected-hovered, ${hexToRGBA(B50, 0.6)})`,
61
+ boxShadow: ''
57
62
  }
58
63
  },
59
64
  navigation: {
@@ -97,8 +102,13 @@ const defaultTheme = {
97
102
  color: `var(--ds-text-selected, ${B400})`,
98
103
  backgroundColor: `var(--ds-background-selected, ${hexToRGBA(B50, 0.7)})`,
99
104
  boxShadow: '',
100
- borderColor: `var(--ds-border-selected, ${B400})`,
101
- bordorBottom: `4px solid ${`var(--ds-border-selected, ${B400})`}`
105
+ borderColor: `var(--ds-border-selected, ${B400})`
106
+ },
107
+ selectedHover: {
108
+ color: `var(--ds-text-selected, ${B400})`,
109
+ backgroundColor: `var(--ds-background-selected-hovered, ${hexToRGBA(B50, 0.6)})`,
110
+ boxShadow: '',
111
+ borderColor: `var(--ds-border-selected, ${B400})`
102
112
  }
103
113
  },
104
114
  search: {
@@ -36,7 +36,13 @@ const generateButtonCSSStates = (colors, buttonType) => {
36
36
  },
37
37
  selected: {
38
38
  color,
39
- backgroundColor,
39
+ backgroundColor: getContrastColor(0.3, opacityValue, backgroundColor),
40
+ borderColor: highlightColor,
41
+ boxShadow: getBoxShadow('transparent')
42
+ },
43
+ selectedHover: {
44
+ color,
45
+ backgroundColor: getContrastColor(0.3, opacityValue, backgroundColor),
40
46
  borderColor: highlightColor,
41
47
  boxShadow: getBoxShadow('transparent')
42
48
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "sideEffects": false
5
5
  }
@@ -17,7 +17,7 @@ export var getPrimaryButtonTheme = function getPrimaryButtonTheme(_ref) {
17
17
  padding: '0 4px',
18
18
  marginLeft: 0,
19
19
  marginRight: 0,
20
- ':hover': primaryButton.hover,
20
+ ':hover': props.isSelected ? primaryButton.selectedHover : primaryButton.hover,
21
21
  ':focus': primaryButton.focus,
22
22
  // :active doesn't work in FF, because we do a
23
23
  // e.preventDefault() on mouse down in Button.
@@ -54,6 +54,11 @@ var defaultTheme = {
54
54
  color: "var(--ds-text-selected, ".concat(B400, ")"),
55
55
  backgroundColor: "var(--ds-background-selected, ".concat(hexToRGBA(B50, 0.6), ")"),
56
56
  boxShadow: ''
57
+ },
58
+ selectedHover: {
59
+ color: "var(--ds-text-selected, ".concat(B400, ")"),
60
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(hexToRGBA(B50, 0.6), ")"),
61
+ boxShadow: ''
57
62
  }
58
63
  },
59
64
  navigation: {
@@ -97,8 +102,13 @@ var defaultTheme = {
97
102
  color: "var(--ds-text-selected, ".concat(B400, ")"),
98
103
  backgroundColor: "var(--ds-background-selected, ".concat(hexToRGBA(B50, 0.7), ")"),
99
104
  boxShadow: '',
100
- borderColor: "var(--ds-border-selected, ".concat(B400, ")"),
101
- bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(B400, ")"))
105
+ borderColor: "var(--ds-border-selected, ".concat(B400, ")")
106
+ },
107
+ selectedHover: {
108
+ color: "var(--ds-text-selected, ".concat(B400, ")"),
109
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(hexToRGBA(B50, 0.6), ")"),
110
+ boxShadow: '',
111
+ borderColor: "var(--ds-border-selected, ".concat(B400, ")")
102
112
  }
103
113
  },
104
114
  search: {
@@ -42,7 +42,13 @@ var generateButtonCSSStates = function generateButtonCSSStates(colors, buttonTyp
42
42
  },
43
43
  selected: {
44
44
  color: color,
45
- backgroundColor: backgroundColor,
45
+ backgroundColor: getContrastColor(0.3, opacityValue, backgroundColor),
46
+ borderColor: highlightColor,
47
+ boxShadow: getBoxShadow('transparent')
48
+ },
49
+ selectedHover: {
50
+ color: color,
51
+ backgroundColor: getContrastColor(0.3, opacityValue, backgroundColor),
46
52
  borderColor: highlightColor,
47
53
  boxShadow: getBoxShadow('transparent')
48
54
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "sideEffects": false
5
5
  }
@@ -17,6 +17,7 @@ export declare type ButtonCSSContext = {
17
17
  focus: ButtonFocusCSSProperties;
18
18
  active: ButtonCSSProperties;
19
19
  selected: ButtonCSSProperties;
20
+ selectedHover?: ButtonCSSProperties;
20
21
  };
21
22
  export declare type CreateCSS = ButtonCSSContext;
22
23
  export declare type IconButtonCSS = ButtonCSSContext;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "A horizontal navigation component for Atlassian products.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "@atlaskit/icon": "^21.10.0",
31
31
  "@atlaskit/logo": "*",
32
32
  "@atlaskit/popup": "^1.4.0",
33
- "@atlaskit/theme": "^12.1.0",
33
+ "@atlaskit/theme": "^12.2.0",
34
34
  "@atlaskit/tokens": "^0.10.0",
35
35
  "@atlaskit/tooltip": "^17.5.0",
36
36
  "@atlaskit/width-detector": "^4.0.0",