@atlaskit/atlassian-navigation 2.0.4 → 2.1.2

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 (128) 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 +24 -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 +39 -40
  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 +29 -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 +39 -40
  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 +25 -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 +39 -40
  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/index.d.ts +1 -1
  82. package/dist/types/components/Create/styles.d.ts +0 -923
  83. package/dist/types/components/Create/types.d.ts +5 -1
  84. package/dist/types/components/IconButton/skeleton.d.ts +1 -1
  85. package/dist/types/components/IconButton/styles.d.ts +0 -915
  86. package/dist/types/components/PrimaryButton/index.d.ts +1 -1
  87. package/dist/types/components/PrimaryButton/skeleton.d.ts +1 -0
  88. package/dist/types/components/PrimaryButton/styles.d.ts +0 -917
  89. package/dist/types/components/PrimaryDropdownButton/index.d.ts +1 -1
  90. package/docs/05-create.tsx +8 -0
  91. package/docs/99-migrating-from-navigation-next.tsx +31 -32
  92. package/package.json +9 -5
  93. package/dist/cjs/components/AtlassianNavigation/styles.js +0 -82
  94. package/dist/cjs/components/BadgeContainer/styles.js +0 -17
  95. package/dist/cjs/components/PrimaryDropdownButton/styles.js +0 -13
  96. package/dist/cjs/components/PrimaryItemsContainer/styles.js +0 -42
  97. package/dist/cjs/components/ProductHome/styles.js +0 -152
  98. package/dist/cjs/components/Search/styles.js +0 -70
  99. package/dist/cjs/components/SkeletonCreateButton/styles.js +0 -39
  100. package/dist/cjs/components/SkeletonIconButton/styles.js +0 -46
  101. package/dist/cjs/components/SkeletonPrimaryButton/styles.js +0 -74
  102. package/dist/es2019/components/AtlassianNavigation/styles.js +0 -60
  103. package/dist/es2019/components/BadgeContainer/styles.js +0 -9
  104. package/dist/es2019/components/PrimaryDropdownButton/styles.js +0 -6
  105. package/dist/es2019/components/PrimaryItemsContainer/styles.js +0 -30
  106. package/dist/es2019/components/ProductHome/styles.js +0 -117
  107. package/dist/es2019/components/Search/styles.js +0 -43
  108. package/dist/es2019/components/SkeletonCreateButton/styles.js +0 -25
  109. package/dist/es2019/components/SkeletonIconButton/styles.js +0 -32
  110. package/dist/es2019/components/SkeletonPrimaryButton/styles.js +0 -60
  111. package/dist/esm/components/AtlassianNavigation/styles.js +0 -64
  112. package/dist/esm/components/BadgeContainer/styles.js +0 -9
  113. package/dist/esm/components/PrimaryDropdownButton/styles.js +0 -6
  114. package/dist/esm/components/PrimaryItemsContainer/styles.js +0 -29
  115. package/dist/esm/components/ProductHome/styles.js +0 -114
  116. package/dist/esm/components/Search/styles.js +0 -47
  117. package/dist/esm/components/SkeletonCreateButton/styles.js +0 -28
  118. package/dist/esm/components/SkeletonIconButton/styles.js +0 -35
  119. package/dist/esm/components/SkeletonPrimaryButton/styles.js +0 -63
  120. package/dist/types/components/AtlassianNavigation/styles.d.ts +0 -22
  121. package/dist/types/components/BadgeContainer/styles.d.ts +0 -9
  122. package/dist/types/components/PrimaryDropdownButton/styles.d.ts +0 -5
  123. package/dist/types/components/PrimaryItemsContainer/styles.d.ts +0 -9
  124. package/dist/types/components/ProductHome/styles.d.ts +0 -2791
  125. package/dist/types/components/Search/styles.d.ts +0 -1842
  126. package/dist/types/components/SkeletonCreateButton/styles.d.ts +0 -4
  127. package/dist/types/components/SkeletonIconButton/styles.d.ts +0 -4
  128. package/dist/types/components/SkeletonPrimaryButton/styles.d.ts +0 -4
@@ -1,18 +1,129 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ var _css;
4
+
1
5
  /** @jsx jsx */
2
6
  import { Fragment } from 'react';
3
- import { jsx } from '@emotion/core';
7
+ import { css, jsx } from '@emotion/core';
8
+ import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
4
9
  import { useTheme } from '../../theme';
5
- import { productHomeButtonSkeletonCSS, productIconSkeletonCSS, productLogoSkeletonCSS, siteTitleSkeletonCSS } from './styles';
10
+ var VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
11
+ var VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
12
+ var VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
13
+ var VAR_PRODUCT_HOME_COLOR_FOCUS = '--product-home-color-focus';
14
+ var VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS = '--product-home-bg-color-focus';
15
+ var VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
16
+ var VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
17
+ var VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
18
+ var VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
19
+ var VAR_SITE_TITLE_BG_COLOR_AFTER = '--site-title-bg-color-after';
20
+ var productHomeButtonStyles = css((_css = {
21
+ display: 'flex',
22
+ padding: gridSize / 2,
23
+ alignItems: 'center',
24
+ background: 'none',
25
+ border: 0,
26
+ borderRadius: 3,
27
+ color: 'inherit',
28
+ cursor: 'pointer',
29
+ '&::-moz-focus-inner': {
30
+ border: 0
31
+ },
32
+ '&:first-of-type': {
33
+ marginLeft: 0
34
+ },
35
+ '&:active': {
36
+ backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, ")"),
37
+ boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, ")"),
38
+ color: "var(".concat(VAR_PRODUCT_HOME_COLOR_ACTIVE, ")")
39
+ },
40
+ '&:focus': {
41
+ backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, ")"),
42
+ boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, ")"),
43
+ color: "var(".concat(VAR_PRODUCT_HOME_COLOR_FOCUS, ")"),
44
+ outline: 0
45
+ },
46
+ '&:hover': {
47
+ backgroundColor: "var(".concat(VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, ")"),
48
+ boxShadow: "var(".concat(VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, ")"),
49
+ color: "var(".concat(VAR_PRODUCT_HOME_COLOR_HOVER, ")")
50
+ },
51
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
52
+ 'div&': {
53
+ pointerEvents: 'none'
54
+ }
55
+ }, _defineProperty(_css, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
56
+ margin: "0 ".concat(gridSize, "px")
57
+ }), _defineProperty(_css, "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
58
+ margin: "0 ".concat(gridSize * 2, "px")
59
+ }), _css));
60
+ var productLogoStyles = css(_defineProperty({
61
+ display: 'flex',
62
+ width: 120,
63
+ maxWidth: 120,
64
+ height: 24,
65
+ maxHeight: 28,
66
+ opacity: 0.15,
67
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
68
+ '& > *': {
69
+ maxHeight: 24
70
+ }
71
+ }, "@media (max-width: ".concat(PRODUCT_HOME_BREAKPOINT - 0.1, "px)"), {
72
+ display: 'none'
73
+ }));
74
+ var productIconStyles = css(_defineProperty({
75
+ display: 'flex',
76
+ width: 28,
77
+ height: 28,
78
+ borderRadius: '50%',
79
+ opacity: 0.15,
80
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
81
+ '& > *': {
82
+ maxHeight: 24
83
+ }
84
+ }, "@media (min-width: ".concat(PRODUCT_HOME_BREAKPOINT, "px)"), {
85
+ display: 'none'
86
+ }));
87
+ var siteTitleStyles = css({
88
+ display: 'flex',
89
+ width: gridSize * 5,
90
+ marginRight: gridSize / 2,
91
+ marginLeft: gridSize * 0.5,
92
+ paddingRight: gridSize * 2,
93
+ alignItems: 'center',
94
+ backgroundColor: 'transparent',
95
+ '&:after': {
96
+ width: '100%',
97
+ height: 14,
98
+ backgroundColor: "var(".concat(VAR_SITE_TITLE_BG_COLOR_AFTER, ")"),
99
+ borderRadius: 4,
100
+ content: '""'
101
+ }
102
+ });
6
103
  export var ProductHomeSkeleton = function ProductHomeSkeleton(_ref) {
104
+ var _productHomeButtonDyn;
105
+
7
106
  var showSiteName = _ref.showSiteName;
8
107
  var theme = useTheme();
108
+ var primaryButton = theme.mode.primaryButton;
109
+ var productHomeButtonDynamicStyles = (_productHomeButtonDyn = {}, _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_ACTIVE, primaryButton.active.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE, primaryButton.active.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE, primaryButton.active.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_FOCUS, primaryButton.focus.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS, primaryButton.focus.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS, primaryButton.focus.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_COLOR_HOVER, primaryButton.hover.color), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER, primaryButton.hover.backgroundColor), _defineProperty(_productHomeButtonDyn, VAR_PRODUCT_HOME_BOX_SHADOW_HOVER, primaryButton.hover.boxShadow), _defineProperty(_productHomeButtonDyn, VAR_SITE_TITLE_BG_COLOR_AFTER, theme.mode.skeleton.backgroundColor), _productHomeButtonDyn);
110
+
111
+ var siteTitleDynamicStyles = _defineProperty({
112
+ borderRight: theme.mode.productHome.borderRight,
113
+ opacity: theme.mode.skeleton.opacity
114
+ }, VAR_SITE_TITLE_BG_COLOR_AFTER, theme.mode.skeleton.backgroundColor);
115
+
9
116
  return jsx(Fragment, null, jsx("div", {
10
- css: productHomeButtonSkeletonCSS(theme)
117
+ style: productHomeButtonDynamicStyles,
118
+ css: productHomeButtonStyles
11
119
  }, jsx("div", {
12
- css: productLogoSkeletonCSS(theme)
120
+ style: theme.mode.skeleton,
121
+ css: productLogoStyles
13
122
  }), jsx("div", {
14
- css: productIconSkeletonCSS(theme)
123
+ style: theme.mode.skeleton,
124
+ css: productIconStyles
15
125
  })), showSiteName && jsx("div", {
16
- css: siteTitleSkeletonCSS(theme)
126
+ style: siteTitleDynamicStyles,
127
+ css: siteTitleStyles
17
128
  }));
18
129
  };
@@ -1,14 +1,50 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
4
  var _excluded = ["placeholder", "tooltip", "label", "value"];
4
5
 
6
+ 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; }
7
+
8
+ 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) { _defineProperty(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; }
9
+
5
10
  /** @jsx jsx */
6
11
  import { Fragment } from 'react';
7
- import { jsx } from '@emotion/core';
12
+ import { css, jsx } from '@emotion/core';
8
13
  import SearchIcon from '@atlaskit/icon/glyph/search';
14
+ import { CREATE_BREAKPOINT, fontSize, gridSize } from '../../common/constants';
9
15
  import { useTheme } from '../../theme';
10
16
  import { IconButton } from '../IconButton';
11
- import { searchIconCSS, searchInputContainerCSS, searchInputCSS, searchInputIconCSS } from './styles';
17
+ var searchInputContainerStyles = css(_defineProperty({
18
+ marginRight: gridSize,
19
+ marginLeft: 20,
20
+ position: 'relative'
21
+ }, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
22
+ display: 'none !important'
23
+ }));
24
+ var searchInputIconStyles = css({
25
+ width: '20px',
26
+ height: '20px',
27
+ position: 'absolute',
28
+ top: '5px',
29
+ left: '10px',
30
+ pointerEvents: 'none'
31
+ });
32
+ var searchInputStyles = css({
33
+ boxSizing: 'border-box',
34
+ width: '220px',
35
+ height: "".concat(gridSize * 4, "px"),
36
+ padding: "0 ".concat(gridSize, "px 0 40px"),
37
+ border: '2px solid',
38
+ borderRadius: 6,
39
+ fontSize: "".concat(fontSize, "px"),
40
+ outline: 'none',
41
+ '::placeholder': {
42
+ color: 'inherit'
43
+ }
44
+ });
45
+ var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
46
+ display: 'none !important'
47
+ }));
12
48
 
13
49
  var SearchComponent = function SearchComponent(props) {
14
50
  var onClick = props.onClick,
@@ -16,6 +52,7 @@ var SearchComponent = function SearchComponent(props) {
16
52
  label = props.label,
17
53
  value = props.value;
18
54
  var theme = useTheme();
55
+ var search = theme.mode.search;
19
56
 
20
57
  var onChange = function onChange() {
21
58
  // @ts-ignore
@@ -27,15 +64,20 @@ var SearchComponent = function SearchComponent(props) {
27
64
  onClick && onClick.apply(void 0, arguments);
28
65
  };
29
66
 
67
+ var searchInputDynamicStyles = _objectSpread(_objectSpread({}, search.default), {}, {
68
+ ':focus': search.focus
69
+ });
70
+
30
71
  return jsx("div", {
31
- css: searchInputContainerCSS,
72
+ css: searchInputContainerStyles,
32
73
  role: "search"
33
74
  }, jsx("div", {
34
- css: searchInputIconCSS
75
+ css: searchInputIconStyles
35
76
  }, jsx(SearchIcon, {
36
77
  label: ""
37
78
  })), jsx("input", {
38
- css: searchInputCSS(theme),
79
+ style: searchInputDynamicStyles,
80
+ css: searchInputStyles,
39
81
  "aria-label": label,
40
82
  placeholder: placeholder,
41
83
  onChange: onChange,
@@ -57,7 +99,7 @@ export var Search = function Search(props) {
57
99
  label: label,
58
100
  value: value || ''
59
101
  }), jsx(IconButton, _extends({
60
- css: searchIconCSS,
102
+ css: searchIconStyles,
61
103
  icon: jsx(SearchIcon, {
62
104
  label: label
63
105
  }),
@@ -1,19 +1,39 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
1
3
  /** @jsx jsx */
2
4
  import { Fragment } from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { gridSize } from '@atlaskit/theme/constants';
5
+ import { css, jsx } from '@emotion/core';
6
+ import { CREATE_BREAKPOINT, gridSize } from '../../common/constants';
5
7
  import { useTheme } from '../../theme';
6
8
  import { IconButtonSkeleton } from '../IconButton/skeleton';
7
- import { searchIconSkeletonCSS, searchInputContainerCSS, searchInputSkeletonCSS } from './styles';
9
+ var searchInputContainerStyles = css(_defineProperty({
10
+ marginRight: gridSize,
11
+ marginLeft: 20,
12
+ position: 'relative'
13
+ }, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
14
+ display: 'none !important'
15
+ }));
16
+ var searchInputSkeletonStyles = css({
17
+ boxSizing: 'border-box',
18
+ width: '220px',
19
+ height: "".concat(gridSize * 4, "px"),
20
+ padding: "0 ".concat(gridSize, "px 0 40px"),
21
+ borderRadius: 6,
22
+ opacity: 0.15
23
+ });
24
+ var searchIconStyles = css(_defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
25
+ display: 'none !important'
26
+ }));
8
27
  export var SearchSkeleton = function SearchSkeleton() {
9
28
  var theme = useTheme();
10
29
  return jsx(Fragment, null, jsx("div", {
11
- css: searchInputContainerCSS
30
+ css: searchInputContainerStyles
12
31
  }, jsx("div", {
13
- css: searchInputSkeletonCSS(theme)
32
+ style: theme.mode.skeleton,
33
+ css: searchInputSkeletonStyles
14
34
  })), jsx(IconButtonSkeleton, {
15
- css: searchIconSkeletonCSS,
35
+ css: searchIconStyles,
16
36
  marginRight: 5,
17
- size: gridSize() * 3.25
37
+ size: gridSize * 3.25
18
38
  }));
19
39
  };
@@ -1,13 +1,33 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/core';
3
3
  import { useTheme } from '../../theme';
4
- import skeletonCreateButtonCSS from './styles';
4
+ var skeletonCreateButtonStyles = css({
5
+ height: 32,
6
+ padding: '0 12px',
7
+ alignSelf: 'center',
8
+ border: 0,
9
+ borderRadius: 3,
10
+ fontSize: 14,
11
+ fontWeight: 500,
12
+ lineHeight: 1,
13
+ pointerEvents: 'none',
14
+ ':focus, :active, :hover': {
15
+ appearance: 'none',
16
+ border: 0,
17
+ outline: 0
18
+ },
19
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
20
+ '&&': {
21
+ marginLeft: 12
22
+ }
23
+ });
5
24
  export var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
6
25
  var text = _ref.text,
7
26
  testId = _ref.testId;
8
27
  var theme = useTheme();
9
28
  return jsx("button", {
10
- css: skeletonCreateButtonCSS(theme),
29
+ style: theme.mode.create.default,
30
+ css: skeletonCreateButtonStyles,
11
31
  "data-testid": testId
12
32
  }, text);
13
33
  };
@@ -1,13 +1,40 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
2
+ import { css, jsx } from '@emotion/core';
3
3
  import { useTheme } from '../../theme';
4
- import skeletonIconButtonCSS from './styles';
4
+ var skeletonIconButtonStyles = css({
5
+ margin: 0,
6
+ marginRight: 4,
7
+ padding: '4px 6px',
8
+ border: 0,
9
+ borderRadius: '100%',
10
+ pointerEvents: 'none',
11
+ ':focus, :active, :hover': {
12
+ appearance: 'none',
13
+ border: 0,
14
+ outline: 0
15
+ },
16
+ '&:only-of-type': {
17
+ marginRight: 0
18
+ },
19
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
20
+ '& > span': {
21
+ lineHeight: 'normal'
22
+ },
23
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
24
+ '& > img': {
25
+ width: 24,
26
+ height: 24,
27
+ borderRadius: '100%',
28
+ verticalAlign: 'middle'
29
+ }
30
+ });
5
31
  export var SkeletonIconButton = function SkeletonIconButton(_ref) {
6
32
  var children = _ref.children,
7
33
  testId = _ref.testId;
8
34
  var theme = useTheme();
9
35
  return jsx("button", {
36
+ style: theme.mode.iconButton.default,
10
37
  "data-testid": testId,
11
- css: skeletonIconButtonCSS(theme)
38
+ css: skeletonIconButtonStyles
12
39
  }, children);
13
40
  };
@@ -1,8 +1,78 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ 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; }
4
+
5
+ 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) { _defineProperty(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; }
6
+
1
7
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
8
+ import { css, jsx } from '@emotion/core';
3
9
  import { useTheme } from '../../theme';
4
- import skeletonPrimaryButtonCSS from './styles';
10
+ var VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR = '--primary-button-before-highlighted-background-color';
11
+ var VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR = '--primary-button-after-dropdown-border-color';
12
+ var primaryButtonSkeletonStyles = css({
13
+ margin: '0 6px',
14
+ padding: '0 4px',
15
+ position: 'relative',
16
+ appearance: 'none',
17
+ border: 0,
18
+ fontSize: 14,
19
+ fontWeight: 500,
20
+ lineHeight: 1,
21
+ pointerEvents: 'none',
22
+ ':focus, :active, :hover': {
23
+ appearance: 'none',
24
+ border: 0,
25
+ outline: 0
26
+ },
27
+ '::-moz-focus-inner': {
28
+ border: 0
29
+ }
30
+ });
31
+ var isHighlightedStyles = css({
32
+ '&:before': {
33
+ height: 3,
34
+ position: 'absolute',
35
+ bottom: 0,
36
+ left: 2,
37
+ backgroundColor: "var(".concat(VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, ")"),
38
+ borderTopLeftRadius: 1,
39
+ borderTopRightRadius: 1,
40
+ content: '""'
41
+ }
42
+ });
43
+ var isHighlightedAndDropdownButtonStyles = css({
44
+ '&:before': {
45
+ right: -10
46
+ }
47
+ });
48
+ var isHighlightedNotDropdownButtonStyles = css({
49
+ '&:before': {
50
+ right: 2
51
+ }
52
+ });
53
+ var isDropdownButtonStyles = css({
54
+ marginRight: 18,
55
+ '&:after': {
56
+ display: 'inline-block',
57
+ width: 4,
58
+ height: 4,
59
+ marginLeft: 4,
60
+ position: 'absolute',
61
+ top: 'calc(50% - 4px)',
62
+ left: 'calc(100% - 3px)',
63
+ borderBottom: '2px solid',
64
+ borderColor: "var(".concat(VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, ")"),
65
+ borderRadius: 1,
66
+ borderRight: '2px solid',
67
+ content: '""',
68
+ opacity: 0.51,
69
+ transform: 'rotate(45deg) scale(1.05)',
70
+ verticalAlign: 'middle'
71
+ }
72
+ });
5
73
  export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
74
+ var _objectSpread2;
75
+
6
76
  var _ref$isDropdownButton = _ref.isDropdownButton,
7
77
  isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
8
78
  _ref$isHighlighted = _ref.isHighlighted,
@@ -11,8 +81,15 @@ export var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
11
81
  children = _ref.children,
12
82
  testId = _ref.testId;
13
83
  var theme = useTheme();
84
+ var primaryButton = theme.mode.primaryButton;
85
+
86
+ var dynamicStyles = _objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
87
+ color: primaryButton.selected.color
88
+ }), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), _defineProperty(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2));
89
+
14
90
  return jsx("button", {
15
- css: skeletonPrimaryButtonCSS(theme, isDropdownButton, isHighlighted),
91
+ style: dynamicStyles,
92
+ css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
16
93
  "data-testid": testId
17
94
  }, text || children);
18
95
  };
@@ -1,27 +1,26 @@
1
- /* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
2
1
  import { B200, B400, B50, N0, N20, N200, N40, N600, N700 } from '@atlaskit/theme/colors';
3
2
  import { hexToRGBA } from './themeHelpers';
4
3
  var defaultTheme = {
5
4
  mode: {
6
5
  create: {
7
6
  active: {
8
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
9
- backgroundColor: "var(--ds-background-boldBrand-pressed, ".concat(hexToRGBA(B400, 0.8), ")"),
7
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
8
+ backgroundColor: "var(--ds-background-brand-bold-pressed, ".concat(hexToRGBA(B400, 0.8), ")"),
10
9
  boxShadow: ''
11
10
  },
12
11
  default: {
13
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
14
- backgroundColor: "var(--ds-background-boldBrand-resting, ".concat(B400, ")"),
12
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
13
+ backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
15
14
  boxShadow: ''
16
15
  },
17
16
  focus: {
18
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
19
- backgroundColor: "var(--ds-background-boldBrand-resting, ".concat(B400, ")"),
20
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, rgb(128,169,230))")
17
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
18
+ backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
19
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, rgb(128,169,230))")
21
20
  },
22
21
  hover: {
23
- color: "var(--ds-text-onBold, ".concat(N0, ")"),
24
- backgroundColor: "var(--ds-background-boldBrand-hover, ".concat(hexToRGBA(B400, 0.9), ")"),
22
+ color: "var(--ds-text-inverse, ".concat(N0, ")"),
23
+ backgroundColor: "var(--ds-background-brand-bold-hovered, ".concat(hexToRGBA(B400, 0.9), ")"),
25
24
  boxShadow: ''
26
25
  },
27
26
  selected: {
@@ -32,39 +31,39 @@ var defaultTheme = {
32
31
  },
33
32
  iconButton: {
34
33
  active: {
35
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
36
- backgroundColor: "var(--ds-background-subtleNeutral-pressed, ".concat(hexToRGBA(B50, 0.6), ")"),
34
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
35
+ backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.6), ")"),
37
36
  boxShadow: ''
38
37
  },
39
38
  default: {
40
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
39
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
41
40
  backgroundColor: 'transparent',
42
41
  boxShadow: ''
43
42
  },
44
43
  focus: {
45
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
46
- backgroundColor: "var(--ds-background-subtleBrand-hover, ".concat(hexToRGBA(B50, 0.5), ")"),
47
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, ".concat(B200, ")"))
44
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
45
+ backgroundColor: "var(--ds-background-selected-hovered, ".concat(hexToRGBA(B50, 0.5), ")"),
46
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
48
47
  },
49
48
  hover: {
50
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
51
- backgroundColor: "var(--ds-background-subtleNeutral-hover, ".concat(hexToRGBA(B50, 0.9), ")"),
49
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
50
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
52
51
  boxShadow: ''
53
52
  },
54
53
  selected: {
55
54
  color: "var(--ds-text-selected)",
56
- backgroundColor: "var(--ds-background-selected-resting)",
55
+ backgroundColor: "var(--ds-background-selected)",
57
56
  boxShadow: ''
58
57
  }
59
58
  },
60
59
  navigation: {
61
- backgroundColor: "var(--ds-background-default, ".concat(N0, ")"),
62
- color: "var(--ds-text-lowEmphasis, ".concat(N200, ")")
60
+ backgroundColor: "var(--ds-surface, ".concat(N0, ")"),
61
+ color: "var(--ds-text-subtlest, ".concat(N200, ")")
63
62
  },
64
63
  productHome: {
65
64
  backgroundColor: "var(--ds-text-brand, ".concat(B400, ")"),
66
- color: "var(--ds-text-highEmphasis, ".concat(N700, ")"),
67
- borderRight: "1px solid ".concat("var(--ds-border-neutral, ".concat(hexToRGBA(N200, 0.3), ")")),
65
+ color: "var(--ds-text, ".concat(N700, ")"),
66
+ borderRight: "1px solid ".concat("var(--ds-border, ".concat(hexToRGBA(N200, 0.3), ")")),
68
67
  // TODO: (DSP-1256) These colors should be moved into the Logo package
69
68
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
70
69
  iconGradientStart: B400,
@@ -75,49 +74,49 @@ var defaultTheme = {
75
74
  },
76
75
  primaryButton: {
77
76
  active: {
78
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
79
- backgroundColor: "var(--ds-background-subtleNeutral-pressed, ".concat(hexToRGBA(B50, 0.7), ")"),
77
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
78
+ backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.7), ")"),
80
79
  boxShadow: ''
81
80
  },
82
81
  default: {
83
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
82
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
84
83
  backgroundColor: 'transparent',
85
84
  boxShadow: ''
86
85
  },
87
86
  focus: {
88
- color: "var(--ds-text-mediumEmphasis, ".concat(N600, ")"),
87
+ color: "var(--ds-text-subtle, ".concat(N600, ")"),
89
88
  backgroundColor: '',
90
- boxShadow: "0 0 0 2px ".concat("var(--ds-border-focus, ".concat(B200, ")"))
89
+ boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
91
90
  },
92
91
  hover: {
93
- color: "var(--ds-text-mediumEmphasis, ".concat(B400, ")"),
94
- backgroundColor: "var(--ds-background-subtleNeutral-hover, ".concat(hexToRGBA(B50, 0.9), ")"),
92
+ color: "var(--ds-text-subtle, ".concat(B400, ")"),
93
+ backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
95
94
  boxShadow: ''
96
95
  },
97
96
  selected: {
98
97
  color: "var(--ds-text-selected, ".concat(B400, ")"),
99
- backgroundColor: "var(--ds-background-selected-resting)",
98
+ backgroundColor: "var(--ds-background-selected)",
100
99
  boxShadow: '',
101
- borderColor: "var(--ds-iconBorder-brand, ".concat(B400, ")"),
102
- bordorBottom: "4px solid ".concat("var(--ds-iconBorder-brand, ".concat(B400, ")"))
100
+ borderColor: "var(--ds-border-selected, ".concat(B400, ")"),
101
+ bordorBottom: "4px solid ".concat("var(--ds-border-selected, ".concat(B400, ")"))
103
102
  }
104
103
  },
105
104
  search: {
106
105
  default: {
107
- backgroundColor: "var(--ds-background-default, ".concat(N0, ")"),
108
- color: "var(--ds-text-lowEmphasis, ".concat(N200, ")"),
109
- borderColor: "var(--ds-border-neutral, ".concat(N40, ")")
106
+ backgroundColor: "var(--ds-surface, ".concat(N0, ")"),
107
+ color: "var(--ds-text-subtlest, ".concat(N200, ")"),
108
+ borderColor: "var(--ds-border, ".concat(N40, ")")
110
109
  },
111
110
  focus: {
112
- borderColor: "var(--ds-border-focus, ".concat(B200, ")")
111
+ borderColor: "var(--ds-border-focused, ".concat(B200, ")")
113
112
  },
114
113
  hover: {
115
- color: "var(--ds-text-brand, ".concat(B400, ")"),
116
- backgroundColor: "var(--ds-background-default, ".concat(hexToRGBA(B50, 0.9), ")")
114
+ color: "var(--ds-text-selected, ".concat(B400, ")"),
115
+ backgroundColor: "var(--ds-surface, ".concat(hexToRGBA(B50, 0.9), ")")
117
116
  }
118
117
  },
119
118
  skeleton: {
120
- backgroundColor: "var(--ds-background-subtleNeutral-resting, ".concat(N20, ")"),
119
+ backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
121
120
  opacity: 1
122
121
  }
123
122
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.0.4",
3
+ "version": "2.1.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,6 @@
1
+ export declare const gridSize: number;
2
+ export declare const buttonHeight: number;
3
+ export declare const fontSize: number;
1
4
  export declare const HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
2
5
  export declare const PRODUCT_HOME_BREAKPOINT = 1280;
3
6
  export declare const CREATE_BREAKPOINT = 1130;