@atlaskit/atlassian-navigation 2.1.0 → 2.1.3

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.
Files changed (125) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/common/constants.js +10 -1
  3. package/dist/cjs/components/AtlassianNavigation/index.js +61 -5
  4. package/dist/cjs/components/AtlassianNavigation/skeleton.js +67 -10
  5. package/dist/cjs/components/BadgeContainer/index.js +12 -4
  6. package/dist/cjs/components/Create/index.js +21 -12
  7. package/dist/cjs/components/Create/skeleton.js +21 -6
  8. package/dist/cjs/components/Create/styles.js +1 -25
  9. package/dist/cjs/components/IconButton/skeleton.js +31 -5
  10. package/dist/cjs/components/IconButton/styles.js +2 -32
  11. package/dist/cjs/components/PrimaryButton/index.js +35 -1
  12. package/dist/cjs/components/PrimaryButton/skeleton.js +15 -5
  13. package/dist/cjs/components/PrimaryButton/styles.js +2 -58
  14. package/dist/cjs/components/PrimaryDropdownButton/index.js +6 -3
  15. package/dist/cjs/components/PrimaryItemsContainer/index.js +26 -4
  16. package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +8 -3
  17. package/dist/cjs/components/ProductHome/custom-product-home.js +104 -6
  18. package/dist/cjs/components/ProductHome/product-home.js +104 -6
  19. package/dist/cjs/components/ProductHome/skeleton.js +117 -6
  20. package/dist/cjs/components/Search/index.js +50 -6
  21. package/dist/cjs/components/Search/skeleton.js +29 -7
  22. package/dist/cjs/components/SkeletonCreateButton/index.js +23 -5
  23. package/dist/cjs/components/SkeletonIconButton/index.js +30 -5
  24. package/dist/cjs/components/SkeletonPrimaryButton/index.js +79 -3
  25. package/dist/cjs/theme/defaultTheme.js +8 -8
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/common/constants.js +4 -0
  28. package/dist/es2019/components/AtlassianNavigation/index.js +61 -6
  29. package/dist/es2019/components/AtlassianNavigation/skeleton.js +67 -11
  30. package/dist/es2019/components/BadgeContainer/index.js +12 -4
  31. package/dist/es2019/components/Create/index.js +26 -13
  32. package/dist/es2019/components/Create/skeleton.js +20 -6
  33. package/dist/es2019/components/Create/styles.js +0 -15
  34. package/dist/es2019/components/IconButton/skeleton.js +23 -5
  35. package/dist/es2019/components/IconButton/styles.js +1 -23
  36. package/dist/es2019/components/PrimaryButton/index.js +35 -3
  37. package/dist/es2019/components/PrimaryButton/skeleton.js +14 -5
  38. package/dist/es2019/components/PrimaryButton/styles.js +1 -46
  39. package/dist/es2019/components/PrimaryDropdownButton/index.js +7 -3
  40. package/dist/es2019/components/PrimaryItemsContainer/index.js +25 -4
  41. package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +7 -3
  42. package/dist/es2019/components/ProductHome/custom-product-home.js +119 -6
  43. package/dist/es2019/components/ProductHome/product-home.js +119 -6
  44. package/dist/es2019/components/ProductHome/skeleton.js +129 -6
  45. package/dist/es2019/components/Search/index.js +47 -6
  46. package/dist/es2019/components/Search/skeleton.js +30 -7
  47. package/dist/es2019/components/SkeletonCreateButton/index.js +23 -3
  48. package/dist/es2019/components/SkeletonIconButton/index.js +30 -3
  49. package/dist/es2019/components/SkeletonPrimaryButton/index.js +74 -3
  50. package/dist/es2019/theme/defaultTheme.js +8 -8
  51. package/dist/es2019/version.json +1 -1
  52. package/dist/esm/common/constants.js +4 -0
  53. package/dist/esm/components/AtlassianNavigation/index.js +61 -6
  54. package/dist/esm/components/AtlassianNavigation/skeleton.js +67 -11
  55. package/dist/esm/components/BadgeContainer/index.js +12 -4
  56. package/dist/esm/components/Create/index.js +22 -13
  57. package/dist/esm/components/Create/skeleton.js +19 -6
  58. package/dist/esm/components/Create/styles.js +0 -15
  59. package/dist/esm/components/IconButton/skeleton.js +29 -5
  60. package/dist/esm/components/IconButton/styles.js +0 -22
  61. package/dist/esm/components/PrimaryButton/index.js +35 -3
  62. package/dist/esm/components/PrimaryButton/skeleton.js +14 -5
  63. package/dist/esm/components/PrimaryButton/styles.js +0 -44
  64. package/dist/esm/components/PrimaryDropdownButton/index.js +7 -3
  65. package/dist/esm/components/PrimaryItemsContainer/index.js +25 -4
  66. package/dist/esm/components/PrimaryItemsContainer/skeleton.js +7 -3
  67. package/dist/esm/components/ProductHome/custom-product-home.js +102 -6
  68. package/dist/esm/components/ProductHome/product-home.js +102 -6
  69. package/dist/esm/components/ProductHome/skeleton.js +117 -6
  70. package/dist/esm/components/Search/index.js +48 -6
  71. package/dist/esm/components/Search/skeleton.js +27 -7
  72. package/dist/esm/components/SkeletonCreateButton/index.js +23 -3
  73. package/dist/esm/components/SkeletonIconButton/index.js +30 -3
  74. package/dist/esm/components/SkeletonPrimaryButton/index.js +80 -3
  75. package/dist/esm/theme/defaultTheme.js +8 -8
  76. package/dist/esm/version.json +1 -1
  77. package/dist/types/common/constants.d.ts +3 -0
  78. package/dist/types/common/styles.d.ts +143 -143
  79. package/dist/types/components/AtlassianNavigation/skeleton.d.ts +1 -1
  80. package/dist/types/components/AtlassianNavigation/types.d.ts +1 -0
  81. package/dist/types/components/Create/styles.d.ts +0 -923
  82. package/dist/types/components/IconButton/skeleton.d.ts +1 -1
  83. package/dist/types/components/IconButton/styles.d.ts +0 -915
  84. package/dist/types/components/PrimaryButton/index.d.ts +1 -1
  85. package/dist/types/components/PrimaryButton/skeleton.d.ts +1 -0
  86. package/dist/types/components/PrimaryButton/styles.d.ts +0 -917
  87. package/dist/types/components/PrimaryDropdownButton/index.d.ts +1 -1
  88. package/docs/99-migrating-from-navigation-next.tsx +31 -32
  89. package/package.json +8 -4
  90. package/dist/cjs/components/AtlassianNavigation/styles.js +0 -82
  91. package/dist/cjs/components/BadgeContainer/styles.js +0 -17
  92. package/dist/cjs/components/PrimaryDropdownButton/styles.js +0 -13
  93. package/dist/cjs/components/PrimaryItemsContainer/styles.js +0 -42
  94. package/dist/cjs/components/ProductHome/styles.js +0 -152
  95. package/dist/cjs/components/Search/styles.js +0 -70
  96. package/dist/cjs/components/SkeletonCreateButton/styles.js +0 -39
  97. package/dist/cjs/components/SkeletonIconButton/styles.js +0 -46
  98. package/dist/cjs/components/SkeletonPrimaryButton/styles.js +0 -74
  99. package/dist/es2019/components/AtlassianNavigation/styles.js +0 -60
  100. package/dist/es2019/components/BadgeContainer/styles.js +0 -9
  101. package/dist/es2019/components/PrimaryDropdownButton/styles.js +0 -6
  102. package/dist/es2019/components/PrimaryItemsContainer/styles.js +0 -30
  103. package/dist/es2019/components/ProductHome/styles.js +0 -117
  104. package/dist/es2019/components/Search/styles.js +0 -43
  105. package/dist/es2019/components/SkeletonCreateButton/styles.js +0 -25
  106. package/dist/es2019/components/SkeletonIconButton/styles.js +0 -32
  107. package/dist/es2019/components/SkeletonPrimaryButton/styles.js +0 -60
  108. package/dist/esm/components/AtlassianNavigation/styles.js +0 -64
  109. package/dist/esm/components/BadgeContainer/styles.js +0 -9
  110. package/dist/esm/components/PrimaryDropdownButton/styles.js +0 -6
  111. package/dist/esm/components/PrimaryItemsContainer/styles.js +0 -29
  112. package/dist/esm/components/ProductHome/styles.js +0 -114
  113. package/dist/esm/components/Search/styles.js +0 -47
  114. package/dist/esm/components/SkeletonCreateButton/styles.js +0 -28
  115. package/dist/esm/components/SkeletonIconButton/styles.js +0 -35
  116. package/dist/esm/components/SkeletonPrimaryButton/styles.js +0 -63
  117. package/dist/types/components/AtlassianNavigation/styles.d.ts +0 -22
  118. package/dist/types/components/BadgeContainer/styles.d.ts +0 -9
  119. package/dist/types/components/PrimaryDropdownButton/styles.d.ts +0 -5
  120. package/dist/types/components/PrimaryItemsContainer/styles.d.ts +0 -9
  121. package/dist/types/components/ProductHome/styles.d.ts +0 -2791
  122. package/dist/types/components/Search/styles.d.ts +0 -1842
  123. package/dist/types/components/SkeletonCreateButton/styles.d.ts +0 -4
  124. package/dist/types/components/SkeletonIconButton/styles.d.ts +0 -4
  125. package/dist/types/components/SkeletonPrimaryButton/styles.d.ts +0 -4
@@ -11,26 +11,65 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
 
12
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
13
 
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
14
16
  var _react = require("react");
15
17
 
16
18
  var _core = require("@emotion/core");
17
19
 
18
20
  var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/search"));
19
21
 
22
+ var _constants = require("../../common/constants");
23
+
20
24
  var _theme = require("../../theme");
21
25
 
22
26
  var _IconButton = require("../IconButton");
23
27
 
24
- var _styles = require("./styles");
25
-
26
28
  var _excluded = ["placeholder", "tooltip", "label", "value"];
27
29
 
30
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
+
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
+
34
+ var searchInputContainerStyles = (0, _core.css)((0, _defineProperty2.default)({
35
+ marginRight: _constants.gridSize,
36
+ marginLeft: 20,
37
+ position: 'relative'
38
+ }, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
39
+ display: 'none !important'
40
+ }));
41
+ var searchInputIconStyles = (0, _core.css)({
42
+ width: '20px',
43
+ height: '20px',
44
+ position: 'absolute',
45
+ top: '5px',
46
+ left: '10px',
47
+ pointerEvents: 'none'
48
+ });
49
+ var searchInputStyles = (0, _core.css)({
50
+ boxSizing: 'border-box',
51
+ width: '220px',
52
+ height: "".concat(_constants.gridSize * 4, "px"),
53
+ padding: "0 ".concat(_constants.gridSize, "px 0 40px"),
54
+ border: '2px solid',
55
+ borderRadius: 6,
56
+ fontSize: "".concat(_constants.fontSize, "px"),
57
+ outline: 'none',
58
+ '::placeholder': {
59
+ color: 'inherit'
60
+ }
61
+ });
62
+ var searchIconStyles = (0, _core.css)((0, _defineProperty2.default)({}, "@media (min-width: ".concat(_constants.CREATE_BREAKPOINT, "px)"), {
63
+ display: 'none !important'
64
+ }));
65
+
28
66
  var SearchComponent = function SearchComponent(props) {
29
67
  var onClick = props.onClick,
30
68
  placeholder = props.placeholder,
31
69
  label = props.label,
32
70
  value = props.value;
33
71
  var theme = (0, _theme.useTheme)();
72
+ var search = theme.mode.search;
34
73
 
35
74
  var onChange = function onChange() {
36
75
  // @ts-ignore
@@ -42,15 +81,20 @@ var SearchComponent = function SearchComponent(props) {
42
81
  onClick && onClick.apply(void 0, arguments);
43
82
  };
44
83
 
84
+ var searchInputDynamicStyles = _objectSpread(_objectSpread({}, search.default), {}, {
85
+ ':focus': search.focus
86
+ });
87
+
45
88
  return (0, _core.jsx)("div", {
46
- css: _styles.searchInputContainerCSS,
89
+ css: searchInputContainerStyles,
47
90
  role: "search"
48
91
  }, (0, _core.jsx)("div", {
49
- css: _styles.searchInputIconCSS
92
+ css: searchInputIconStyles
50
93
  }, (0, _core.jsx)(_search.default, {
51
94
  label: ""
52
95
  })), (0, _core.jsx)("input", {
53
- css: (0, _styles.searchInputCSS)(theme),
96
+ style: searchInputDynamicStyles,
97
+ css: searchInputStyles,
54
98
  "aria-label": label,
55
99
  placeholder: placeholder,
56
100
  onChange: onChange,
@@ -71,7 +115,7 @@ var Search = function Search(props) {
71
115
  label: label,
72
116
  value: value || ''
73
117
  }), (0, _core.jsx)(_IconButton.IconButton, (0, _extends2.default)({
74
- css: _styles.searchIconCSS,
118
+ css: searchIconStyles,
75
119
  icon: (0, _core.jsx)(_search.default, {
76
120
  label: label
77
121
  }),
@@ -1,33 +1,55 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.SearchSkeleton = void 0;
7
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
8
12
  var _react = require("react");
9
13
 
10
14
  var _core = require("@emotion/core");
11
15
 
12
- var _constants = require("@atlaskit/theme/constants");
16
+ var _constants = require("../../common/constants");
13
17
 
14
18
  var _theme = require("../../theme");
15
19
 
16
20
  var _skeleton = require("../IconButton/skeleton");
17
21
 
18
- var _styles = require("./styles");
19
-
20
22
  /** @jsx jsx */
23
+ var searchInputContainerStyles = (0, _core.css)((0, _defineProperty2.default)({
24
+ marginRight: _constants.gridSize,
25
+ marginLeft: 20,
26
+ position: 'relative'
27
+ }, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
28
+ display: 'none !important'
29
+ }));
30
+ var searchInputSkeletonStyles = (0, _core.css)({
31
+ boxSizing: 'border-box',
32
+ width: '220px',
33
+ height: "".concat(_constants.gridSize * 4, "px"),
34
+ padding: "0 ".concat(_constants.gridSize, "px 0 40px"),
35
+ borderRadius: 6,
36
+ opacity: 0.15
37
+ });
38
+ var searchIconStyles = (0, _core.css)((0, _defineProperty2.default)({}, "@media (min-width: ".concat(_constants.CREATE_BREAKPOINT, "px)"), {
39
+ display: 'none !important'
40
+ }));
41
+
21
42
  var SearchSkeleton = function SearchSkeleton() {
22
43
  var theme = (0, _theme.useTheme)();
23
44
  return (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)("div", {
24
- css: _styles.searchInputContainerCSS
45
+ css: searchInputContainerStyles
25
46
  }, (0, _core.jsx)("div", {
26
- css: (0, _styles.searchInputSkeletonCSS)(theme)
47
+ style: theme.mode.skeleton,
48
+ css: searchInputSkeletonStyles
27
49
  })), (0, _core.jsx)(_skeleton.IconButtonSkeleton, {
28
- css: _styles.searchIconSkeletonCSS,
50
+ css: searchIconStyles,
29
51
  marginRight: 5,
30
- size: (0, _constants.gridSize)() * 3.25
52
+ size: _constants.gridSize * 3.25
31
53
  }));
32
54
  };
33
55
 
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -11,15 +9,35 @@ var _core = require("@emotion/core");
11
9
 
12
10
  var _theme = require("../../theme");
13
11
 
14
- var _styles = _interopRequireDefault(require("./styles"));
15
-
16
12
  /** @jsx jsx */
13
+ var skeletonCreateButtonStyles = (0, _core.css)({
14
+ height: 32,
15
+ padding: '0 12px',
16
+ alignSelf: 'center',
17
+ border: 0,
18
+ borderRadius: 3,
19
+ fontSize: 14,
20
+ fontWeight: 500,
21
+ lineHeight: 1,
22
+ pointerEvents: 'none',
23
+ ':focus, :active, :hover': {
24
+ appearance: 'none',
25
+ border: 0,
26
+ outline: 0
27
+ },
28
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
29
+ '&&': {
30
+ marginLeft: 12
31
+ }
32
+ });
33
+
17
34
  var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
18
35
  var text = _ref.text,
19
36
  testId = _ref.testId;
20
37
  var theme = (0, _theme.useTheme)();
21
38
  return (0, _core.jsx)("button", {
22
- css: (0, _styles.default)(theme),
39
+ style: theme.mode.create.default,
40
+ css: skeletonCreateButtonStyles,
23
41
  "data-testid": testId
24
42
  }, text);
25
43
  };
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -11,16 +9,43 @@ var _core = require("@emotion/core");
11
9
 
12
10
  var _theme = require("../../theme");
13
11
 
14
- var _styles = _interopRequireDefault(require("./styles"));
15
-
16
12
  /** @jsx jsx */
13
+ var skeletonIconButtonStyles = (0, _core.css)({
14
+ margin: 0,
15
+ marginRight: 4,
16
+ padding: '4px 6px',
17
+ border: 0,
18
+ borderRadius: '100%',
19
+ pointerEvents: 'none',
20
+ ':focus, :active, :hover': {
21
+ appearance: 'none',
22
+ border: 0,
23
+ outline: 0
24
+ },
25
+ '&:only-of-type': {
26
+ marginRight: 0
27
+ },
28
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
29
+ '& > span': {
30
+ lineHeight: 'normal'
31
+ },
32
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
33
+ '& > img': {
34
+ width: 24,
35
+ height: 24,
36
+ borderRadius: '100%',
37
+ verticalAlign: 'middle'
38
+ }
39
+ });
40
+
17
41
  var SkeletonIconButton = function SkeletonIconButton(_ref) {
18
42
  var children = _ref.children,
19
43
  testId = _ref.testId;
20
44
  var theme = (0, _theme.useTheme)();
21
45
  return (0, _core.jsx)("button", {
46
+ style: theme.mode.iconButton.default,
22
47
  "data-testid": testId,
23
- css: (0, _styles.default)(theme)
48
+ css: skeletonIconButtonStyles
24
49
  }, children);
25
50
  };
26
51
 
@@ -7,14 +7,83 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.SkeletonPrimaryButton = void 0;
9
9
 
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
10
12
  var _core = require("@emotion/core");
11
13
 
12
14
  var _theme = require("../../theme");
13
15
 
14
- var _styles = _interopRequireDefault(require("./styles"));
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
19
+
20
+ var VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR = '--primary-button-before-highlighted-background-color';
21
+ var VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR = '--primary-button-after-dropdown-border-color';
22
+ var primaryButtonSkeletonStyles = (0, _core.css)({
23
+ margin: '0 6px',
24
+ padding: '0 4px',
25
+ position: 'relative',
26
+ appearance: 'none',
27
+ border: 0,
28
+ fontSize: 14,
29
+ fontWeight: 500,
30
+ lineHeight: 1,
31
+ pointerEvents: 'none',
32
+ ':focus, :active, :hover': {
33
+ appearance: 'none',
34
+ border: 0,
35
+ outline: 0
36
+ },
37
+ '::-moz-focus-inner': {
38
+ border: 0
39
+ }
40
+ });
41
+ var isHighlightedStyles = (0, _core.css)({
42
+ '&:before': {
43
+ height: 3,
44
+ position: 'absolute',
45
+ bottom: 0,
46
+ left: 2,
47
+ backgroundColor: "var(".concat(VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, ")"),
48
+ borderTopLeftRadius: 1,
49
+ borderTopRightRadius: 1,
50
+ content: '""'
51
+ }
52
+ });
53
+ var isHighlightedAndDropdownButtonStyles = (0, _core.css)({
54
+ '&:before': {
55
+ right: -10
56
+ }
57
+ });
58
+ var isHighlightedNotDropdownButtonStyles = (0, _core.css)({
59
+ '&:before': {
60
+ right: 2
61
+ }
62
+ });
63
+ var isDropdownButtonStyles = (0, _core.css)({
64
+ marginRight: 18,
65
+ '&:after': {
66
+ display: 'inline-block',
67
+ width: 4,
68
+ height: 4,
69
+ marginLeft: 4,
70
+ position: 'absolute',
71
+ top: 'calc(50% - 4px)',
72
+ left: 'calc(100% - 3px)',
73
+ borderBottom: '2px solid',
74
+ borderColor: "var(".concat(VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, ")"),
75
+ borderRadius: 1,
76
+ borderRight: '2px solid',
77
+ content: '""',
78
+ opacity: 0.51,
79
+ transform: 'rotate(45deg) scale(1.05)',
80
+ verticalAlign: 'middle'
81
+ }
82
+ });
15
83
 
16
- /** @jsx jsx */
17
84
  var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
85
+ var _objectSpread2;
86
+
18
87
  var _ref$isDropdownButton = _ref.isDropdownButton,
19
88
  isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
20
89
  _ref$isHighlighted = _ref.isHighlighted,
@@ -23,8 +92,15 @@ var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
23
92
  children = _ref.children,
24
93
  testId = _ref.testId;
25
94
  var theme = (0, _theme.useTheme)();
95
+ var primaryButton = theme.mode.primaryButton;
96
+
97
+ var dynamicStyles = _objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
98
+ color: primaryButton.selected.color
99
+ }), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2));
100
+
26
101
  return (0, _core.jsx)("button", {
27
- css: (0, _styles.default)(theme, isDropdownButton, isHighlighted),
102
+ style: dynamicStyles,
103
+ css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
28
104
  "data-testid": testId
29
105
  }, text || children);
30
106
  };
@@ -51,7 +51,7 @@ var defaultTheme = {
51
51
  },
52
52
  focus: {
53
53
  color: "var(--ds-text-subtle, ".concat(_colors.N600, ")"),
54
- backgroundColor: "var(--ds-background-brand-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.5), ")"),
54
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.5), ")"),
55
55
  boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(_colors.B200, ")"))
56
56
  },
57
57
  hover: {
@@ -60,8 +60,8 @@ var defaultTheme = {
60
60
  boxShadow: ''
61
61
  },
62
62
  selected: {
63
- color: "var(--ds-text-brand)",
64
- backgroundColor: "var(--ds-background-brand)",
63
+ color: "var(--ds-text-selected)",
64
+ backgroundColor: "var(--ds-background-selected)",
65
65
  boxShadow: ''
66
66
  }
67
67
  },
@@ -103,11 +103,11 @@ var defaultTheme = {
103
103
  boxShadow: ''
104
104
  },
105
105
  selected: {
106
- color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
107
- backgroundColor: "var(--ds-background-brand)",
106
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
107
+ backgroundColor: "var(--ds-background-selected)",
108
108
  boxShadow: '',
109
- borderColor: "var(--ds-border-brand, ".concat(_colors.B400, ")"),
110
- bordorBottom: "4px solid ".concat("var(--ds-border-brand, ".concat(_colors.B400, ")"))
109
+ borderColor: "var(--ds-border-selected, ".concat(_colors.B400, ")"),
110
+ bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(_colors.B400, ")"))
111
111
  }
112
112
  },
113
113
  search: {
@@ -120,7 +120,7 @@ var defaultTheme = {
120
120
  borderColor: "var(--ds-border-focused, ".concat(_colors.B200, ")")
121
121
  },
122
122
  hover: {
123
- color: "var(--ds-text-brand, ".concat(_colors.B400, ")"),
123
+ color: "var(--ds-text-selected, ".concat(_colors.B400, ")"),
124
124
  backgroundColor: "var(--ds-surface, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.9), ")")
125
125
  }
126
126
  },
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.0",
3
+ "version": "2.1.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,7 @@
1
+ import { fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export const gridSize = getGridSize();
3
+ export const buttonHeight = gridSize * 4;
4
+ export const fontSize = getFontSize();
1
5
  export const HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
2
6
  export const PRODUCT_HOME_BREAKPOINT = 1280;
3
7
  export const CREATE_BREAKPOINT = 1130;
@@ -1,9 +1,63 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/core';
3
3
  import { NavigationAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
4
- import { defaultTheme, ThemeProvider } from '../../theme';
4
+ import { N30A, N40A, N900 } from '@atlaskit/theme/colors';
5
+ import { gridSize, HORIZONTAL_GLOBAL_NAV_HEIGHT } from '../../common/constants';
6
+ import { defaultTheme, hexToRGBA, ThemeProvider } from '../../theme';
5
7
  import { PrimaryItemsContainer } from '../PrimaryItemsContainer';
6
- import { containerCSS, leftCSS, rightCSS } from './styles';
8
+ const containerStyles = css({
9
+ display: 'flex',
10
+ boxSizing: 'border-box',
11
+ height: HORIZONTAL_GLOBAL_NAV_HEIGHT,
12
+ paddingRight: gridSize * 1.5,
13
+ paddingLeft: gridSize * 1.5,
14
+ position: 'relative',
15
+ alignItems: 'center',
16
+ justifyContent: 'space-between',
17
+ flexShrink: 0,
18
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
19
+ '[data-theme="light"] &, [data-theme="dark"] &': {
20
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
21
+ borderBottom: `1px solid ${"var(--ds-border, #091E4224)"}`,
22
+ // TODO: (DSP-2087) Remove the below once tokens have launched
23
+ '&::after': {
24
+ content: 'none'
25
+ }
26
+ },
27
+ // TODO: (DSP-2087) Remove the below once tokens have launched
28
+ '&::after': {
29
+ height: gridSize / 2,
30
+ position: 'absolute',
31
+ top: '100%',
32
+ right: 0,
33
+ left: 0,
34
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
35
+ background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
+ N900, 0)} 4px)`,
37
+ content: '""'
38
+ }
39
+ });
40
+ const leftStyles = css({
41
+ display: 'flex',
42
+ minWidth: 0,
43
+ height: 'inherit',
44
+ alignItems: 'center',
45
+ flexGrow: 1,
46
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
47
+ '& > *': {
48
+ flexShrink: 0
49
+ }
50
+ });
51
+ const rightStyles = css({
52
+ display: 'flex',
53
+ alignItems: 'center',
54
+ flexShrink: 0,
55
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
56
+ '& > *': {
57
+ marginRight: gridSize / 2,
58
+ flexShrink: 0
59
+ }
60
+ });
7
61
  const analyticsData = {
8
62
  attributes: {
9
63
  navigationLayer: 'global'
@@ -32,11 +86,12 @@ export const AtlassianNavigation = props => {
32
86
  }, jsx(NavigationAnalyticsContext, {
33
87
  data: analyticsData
34
88
  }, jsx("header", {
35
- css: containerCSS(theme),
89
+ style: theme.mode.navigation,
90
+ css: containerStyles,
36
91
  "data-testid": testId && `${testId}-header`,
37
92
  role: "banner"
38
93
  }, jsx("nav", {
39
- css: leftCSS,
94
+ css: leftStyles,
40
95
  "aria-label": label
41
96
  }, AppSwitcher && jsx(AppSwitcher, null), ProductHome && jsx(ProductHome, null), jsx(PrimaryItemsContainer, {
42
97
  testId: testId,
@@ -45,7 +100,7 @@ export const AtlassianNavigation = props => {
45
100
  create: create,
46
101
  theme: theme
47
102
  })), jsx("div", {
48
- css: rightCSS,
103
+ css: rightStyles,
49
104
  "data-testid": testId && `${testId}-secondary-actions`
50
105
  }, Search && jsx(Search, null), Notifications && jsx(Notifications, null), Help && jsx(Help, null), Settings && jsx(Settings, null), SignIn && jsx(SignIn, null), Profile && jsx(Profile, null)))));
51
106
  };
@@ -1,42 +1,98 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { gridSize } from '@atlaskit/theme/constants';
4
- import { defaultTheme, ThemeProvider } from '../../theme';
2
+ import { css, jsx } from '@emotion/core';
3
+ import { N30A, N40A, N900 } from '@atlaskit/theme/colors';
4
+ import { gridSize, HORIZONTAL_GLOBAL_NAV_HEIGHT } from '../../common/constants';
5
+ import { defaultTheme, hexToRGBA, ThemeProvider } from '../../theme';
5
6
  import { IconButtonSkeleton } from '../IconButton/skeleton';
6
7
  import { PrimaryItemsContainerSkeleton } from '../PrimaryItemsContainer/skeleton';
7
8
  import { ProductHomeSkeleton } from '../ProductHome/skeleton';
8
9
  import { ProfileSkeleton } from '../Profile/skeleton';
9
10
  import { SearchSkeleton } from '../Search/skeleton';
10
- import { containerCSS, leftCSS, rightCSS } from './styles';
11
+ const containerStyles = css({
12
+ display: 'flex',
13
+ boxSizing: 'border-box',
14
+ height: HORIZONTAL_GLOBAL_NAV_HEIGHT,
15
+ paddingRight: gridSize * 1.5,
16
+ paddingLeft: gridSize * 1.5,
17
+ position: 'relative',
18
+ alignItems: 'center',
19
+ justifyContent: 'space-between',
20
+ flexShrink: 0,
21
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
22
+ '[data-theme="light"] &, [data-theme="dark"] &': {
23
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
24
+ borderBottom: `1px solid ${"var(--ds-border, #091E4224)"}`,
25
+ // TODO: (DSP-2087) Remove the below once tokens have launched
26
+ '&::after': {
27
+ content: 'none'
28
+ }
29
+ },
30
+ // TODO: (DSP-2087) Remove the below once tokens have launched
31
+ '&::after': {
32
+ height: gridSize / 2,
33
+ position: 'absolute',
34
+ top: '100%',
35
+ right: 0,
36
+ left: 0,
37
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
38
+ background: `linear-gradient(180deg, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
39
+ N900, 0)} 4px)`,
40
+ content: '""'
41
+ }
42
+ });
43
+ const leftStyles = css({
44
+ display: 'flex',
45
+ minWidth: 0,
46
+ height: 'inherit',
47
+ alignItems: 'center',
48
+ flexGrow: 1,
49
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
50
+ '& > *': {
51
+ flexShrink: 0
52
+ }
53
+ });
54
+ const rightStyles = css({
55
+ display: 'flex',
56
+ alignItems: 'center',
57
+ flexShrink: 0,
58
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
59
+ '& > *': {
60
+ marginRight: gridSize / 2,
61
+ flexShrink: 0
62
+ }
63
+ });
11
64
  export const NavigationSkeleton = ({
12
65
  primaryItemsCount = 4,
13
66
  secondaryItemsCount = 4,
14
67
  theme = defaultTheme,
15
68
  showSiteName = false,
16
- shouldShowSearch = true
69
+ shouldShowSearch = true,
70
+ testId
17
71
  }) => {
18
72
  return jsx(ThemeProvider, {
19
73
  value: theme
20
74
  }, jsx("div", {
21
- css: containerCSS(theme)
75
+ style: theme.mode.navigation,
76
+ css: containerStyles,
77
+ "data-testid": testId
22
78
  }, jsx("div", {
23
- css: leftCSS
79
+ css: leftStyles
24
80
  }, jsx(IconButtonSkeleton, {
25
81
  marginLeft: 0,
26
82
  marginRight: 5,
27
- size: gridSize() * 3.25
83
+ size: gridSize * 3.25
28
84
  }), jsx(ProductHomeSkeleton, {
29
85
  showSiteName: showSiteName
30
86
  }), jsx(PrimaryItemsContainerSkeleton, {
31
87
  count: primaryItemsCount
32
88
  })), jsx("div", {
33
- css: rightCSS
89
+ css: rightStyles
34
90
  }, shouldShowSearch && jsx(SearchSkeleton, null), Array.from({
35
91
  length: secondaryItemsCount
36
92
  }, (_, index) => jsx(IconButtonSkeleton, {
37
93
  key: index,
38
94
  marginLeft: 0,
39
- marginRight: 5,
40
- size: gridSize() * 3.25
95
+ marginRight: gridSize / 2,
96
+ size: gridSize * 3.25
41
97
  })), jsx(ProfileSkeleton, null))));
42
98
  };
@@ -1,6 +1,14 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { badgeContainerCSS, containerCSS } from './styles';
2
+ import { css, jsx } from '@emotion/core';
3
+ const badgeContainerStyles = css({
4
+ position: 'absolute',
5
+ top: '-4px',
6
+ right: '-2px',
7
+ pointerEvents: 'none'
8
+ });
9
+ const containerStyles = css({
10
+ position: 'relative'
11
+ });
4
12
  export const BadgeContainer = props => {
5
13
  const {
6
14
  id: badgeId,
@@ -8,9 +16,9 @@ export const BadgeContainer = props => {
8
16
  children
9
17
  } = props;
10
18
  return jsx("div", {
11
- css: containerCSS
19
+ css: containerStyles
12
20
  }, children, jsx("div", {
13
- css: badgeContainerCSS,
21
+ css: badgeContainerStyles,
14
22
  id: badgeId,
15
23
  "aria-hidden": true
16
24
  }, jsx(Badge, null)));