@atlaskit/atlassian-navigation 2.1.0 → 2.1.1

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 (122) hide show
  1. package/CHANGELOG.md +7 -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/version.json +1 -1
  26. package/dist/es2019/common/constants.js +4 -0
  27. package/dist/es2019/components/AtlassianNavigation/index.js +61 -6
  28. package/dist/es2019/components/AtlassianNavigation/skeleton.js +67 -11
  29. package/dist/es2019/components/BadgeContainer/index.js +12 -4
  30. package/dist/es2019/components/Create/index.js +26 -13
  31. package/dist/es2019/components/Create/skeleton.js +20 -6
  32. package/dist/es2019/components/Create/styles.js +0 -15
  33. package/dist/es2019/components/IconButton/skeleton.js +23 -5
  34. package/dist/es2019/components/IconButton/styles.js +1 -23
  35. package/dist/es2019/components/PrimaryButton/index.js +35 -3
  36. package/dist/es2019/components/PrimaryButton/skeleton.js +14 -5
  37. package/dist/es2019/components/PrimaryButton/styles.js +1 -46
  38. package/dist/es2019/components/PrimaryDropdownButton/index.js +7 -3
  39. package/dist/es2019/components/PrimaryItemsContainer/index.js +25 -4
  40. package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +7 -3
  41. package/dist/es2019/components/ProductHome/custom-product-home.js +119 -6
  42. package/dist/es2019/components/ProductHome/product-home.js +119 -6
  43. package/dist/es2019/components/ProductHome/skeleton.js +129 -6
  44. package/dist/es2019/components/Search/index.js +47 -6
  45. package/dist/es2019/components/Search/skeleton.js +30 -7
  46. package/dist/es2019/components/SkeletonCreateButton/index.js +23 -3
  47. package/dist/es2019/components/SkeletonIconButton/index.js +30 -3
  48. package/dist/es2019/components/SkeletonPrimaryButton/index.js +74 -3
  49. package/dist/es2019/version.json +1 -1
  50. package/dist/esm/common/constants.js +4 -0
  51. package/dist/esm/components/AtlassianNavigation/index.js +61 -6
  52. package/dist/esm/components/AtlassianNavigation/skeleton.js +67 -11
  53. package/dist/esm/components/BadgeContainer/index.js +12 -4
  54. package/dist/esm/components/Create/index.js +22 -13
  55. package/dist/esm/components/Create/skeleton.js +19 -6
  56. package/dist/esm/components/Create/styles.js +0 -15
  57. package/dist/esm/components/IconButton/skeleton.js +29 -5
  58. package/dist/esm/components/IconButton/styles.js +0 -22
  59. package/dist/esm/components/PrimaryButton/index.js +35 -3
  60. package/dist/esm/components/PrimaryButton/skeleton.js +14 -5
  61. package/dist/esm/components/PrimaryButton/styles.js +0 -44
  62. package/dist/esm/components/PrimaryDropdownButton/index.js +7 -3
  63. package/dist/esm/components/PrimaryItemsContainer/index.js +25 -4
  64. package/dist/esm/components/PrimaryItemsContainer/skeleton.js +7 -3
  65. package/dist/esm/components/ProductHome/custom-product-home.js +102 -6
  66. package/dist/esm/components/ProductHome/product-home.js +102 -6
  67. package/dist/esm/components/ProductHome/skeleton.js +117 -6
  68. package/dist/esm/components/Search/index.js +48 -6
  69. package/dist/esm/components/Search/skeleton.js +27 -7
  70. package/dist/esm/components/SkeletonCreateButton/index.js +23 -3
  71. package/dist/esm/components/SkeletonIconButton/index.js +30 -3
  72. package/dist/esm/components/SkeletonPrimaryButton/index.js +80 -3
  73. package/dist/esm/version.json +1 -1
  74. package/dist/types/common/constants.d.ts +3 -0
  75. package/dist/types/common/styles.d.ts +143 -143
  76. package/dist/types/components/AtlassianNavigation/skeleton.d.ts +1 -1
  77. package/dist/types/components/AtlassianNavigation/types.d.ts +1 -0
  78. package/dist/types/components/Create/styles.d.ts +0 -923
  79. package/dist/types/components/IconButton/skeleton.d.ts +1 -1
  80. package/dist/types/components/IconButton/styles.d.ts +0 -915
  81. package/dist/types/components/PrimaryButton/index.d.ts +1 -1
  82. package/dist/types/components/PrimaryButton/skeleton.d.ts +1 -0
  83. package/dist/types/components/PrimaryButton/styles.d.ts +0 -917
  84. package/dist/types/components/PrimaryDropdownButton/index.d.ts +1 -1
  85. package/docs/99-migrating-from-navigation-next.tsx +31 -32
  86. package/package.json +7 -3
  87. package/dist/cjs/components/AtlassianNavigation/styles.js +0 -82
  88. package/dist/cjs/components/BadgeContainer/styles.js +0 -17
  89. package/dist/cjs/components/PrimaryDropdownButton/styles.js +0 -13
  90. package/dist/cjs/components/PrimaryItemsContainer/styles.js +0 -42
  91. package/dist/cjs/components/ProductHome/styles.js +0 -152
  92. package/dist/cjs/components/Search/styles.js +0 -70
  93. package/dist/cjs/components/SkeletonCreateButton/styles.js +0 -39
  94. package/dist/cjs/components/SkeletonIconButton/styles.js +0 -46
  95. package/dist/cjs/components/SkeletonPrimaryButton/styles.js +0 -74
  96. package/dist/es2019/components/AtlassianNavigation/styles.js +0 -60
  97. package/dist/es2019/components/BadgeContainer/styles.js +0 -9
  98. package/dist/es2019/components/PrimaryDropdownButton/styles.js +0 -6
  99. package/dist/es2019/components/PrimaryItemsContainer/styles.js +0 -30
  100. package/dist/es2019/components/ProductHome/styles.js +0 -117
  101. package/dist/es2019/components/Search/styles.js +0 -43
  102. package/dist/es2019/components/SkeletonCreateButton/styles.js +0 -25
  103. package/dist/es2019/components/SkeletonIconButton/styles.js +0 -32
  104. package/dist/es2019/components/SkeletonPrimaryButton/styles.js +0 -60
  105. package/dist/esm/components/AtlassianNavigation/styles.js +0 -64
  106. package/dist/esm/components/BadgeContainer/styles.js +0 -9
  107. package/dist/esm/components/PrimaryDropdownButton/styles.js +0 -6
  108. package/dist/esm/components/PrimaryItemsContainer/styles.js +0 -29
  109. package/dist/esm/components/ProductHome/styles.js +0 -114
  110. package/dist/esm/components/Search/styles.js +0 -47
  111. package/dist/esm/components/SkeletonCreateButton/styles.js +0 -28
  112. package/dist/esm/components/SkeletonIconButton/styles.js +0 -35
  113. package/dist/esm/components/SkeletonPrimaryButton/styles.js +0 -63
  114. package/dist/types/components/AtlassianNavigation/styles.d.ts +0 -22
  115. package/dist/types/components/BadgeContainer/styles.d.ts +0 -9
  116. package/dist/types/components/PrimaryDropdownButton/styles.d.ts +0 -5
  117. package/dist/types/components/PrimaryItemsContainer/styles.d.ts +0 -9
  118. package/dist/types/components/ProductHome/styles.d.ts +0 -2791
  119. package/dist/types/components/Search/styles.d.ts +0 -1842
  120. package/dist/types/components/SkeletonCreateButton/styles.d.ts +0 -4
  121. package/dist/types/components/SkeletonIconButton/styles.d.ts +0 -4
  122. package/dist/types/components/SkeletonPrimaryButton/styles.d.ts +0 -4
@@ -2,10 +2,101 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { Fragment } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/core';
6
+ import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
6
7
  import { useTheme } from '../../theme';
7
- import { productHomeButtonCSS, productIconCSS, productLogoCSS, siteTitleCSS } from './styles';
8
8
  import { getTag } from './utils';
9
+ const VAR_LOGO_MAX_WIDTH = '--logo-max-width';
10
+ const VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
11
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
12
+ const VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
13
+ const VAR_PRODUCT_HOME_COLOR_FOCUS = '--product-home-color-focus';
14
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS = '--product-home-bg-color-focus';
15
+ const VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
16
+ const VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
17
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
18
+ const VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
19
+ const productHomeButtonStyles = css({
20
+ display: 'flex',
21
+ padding: gridSize / 2,
22
+ alignItems: 'center',
23
+ background: 'none',
24
+ border: 0,
25
+ borderRadius: 3,
26
+ color: 'inherit',
27
+ cursor: 'pointer',
28
+ '&::-moz-focus-inner': {
29
+ border: 0
30
+ },
31
+ '&:first-of-type': {
32
+ marginLeft: 0
33
+ },
34
+ '&:hover': {
35
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER})`,
36
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_HOVER})`,
37
+ color: `var(${VAR_PRODUCT_HOME_COLOR_HOVER})`
38
+ },
39
+ '&:active': {
40
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE})`,
41
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE})`,
42
+ color: `var(${VAR_PRODUCT_HOME_COLOR_ACTIVE})`
43
+ },
44
+ '&:focus': {
45
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS})`,
46
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS})`,
47
+ color: `var(${VAR_PRODUCT_HOME_COLOR_FOCUS})`,
48
+ outline: 0
49
+ },
50
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
51
+ 'div&': {
52
+ pointerEvents: 'none'
53
+ },
54
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
55
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
56
+ margin: `0 ${gridSize}px`
57
+ },
58
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
59
+ [`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
60
+ margin: `0 ${gridSize * 2}px`
61
+ }
62
+ });
63
+ const productLogoStyles = css({
64
+ // Ensure anything passed into
65
+ // productHome is aligned correctly
66
+ display: 'flex',
67
+ maxWidth: `var(${VAR_LOGO_MAX_WIDTH})`,
68
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
69
+ '& > *': {
70
+ maxHeight: 24
71
+ },
72
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
73
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
74
+ display: 'none'
75
+ }
76
+ });
77
+ const customMaxHeightStyles = css({
78
+ maxHeight: 28
79
+ });
80
+ const productIconStyles = css({
81
+ // Ensure anything passed into
82
+ // productHome is aligned correctly
83
+ display: 'flex',
84
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
85
+ '& > *': {
86
+ maxHeight: 24
87
+ },
88
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
89
+ [`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
90
+ display: 'none'
91
+ }
92
+ });
93
+ const siteTitleStyles = css({
94
+ display: 'flex',
95
+ marginRight: gridSize / 2,
96
+ marginLeft: gridSize * 0.5,
97
+ paddingRight: gridSize * 2,
98
+ alignItems: 'center'
99
+ });
9
100
 
10
101
  const ProductHome = ({
11
102
  icon: Icon,
@@ -19,6 +110,7 @@ const ProductHome = ({
19
110
  ...rest
20
111
  }) => {
21
112
  const theme = useTheme();
113
+ const primaryButton = theme.mode.primaryButton;
22
114
  const {
23
115
  iconColor = 'inherit',
24
116
  iconGradientStart = 'inherit',
@@ -32,14 +124,29 @@ const ProductHome = ({
32
124
  onMouseDown && onMouseDown(e);
33
125
  };
34
126
 
127
+ const productHomeButtonDynamicStyles = {
128
+ [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
129
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
130
+ [VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE]: primaryButton.active.boxShadow,
131
+ [VAR_PRODUCT_HOME_COLOR_FOCUS]: primaryButton.focus.color,
132
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS]: primaryButton.focus.backgroundColor,
133
+ [VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
134
+ [VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
135
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
136
+ [VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow
137
+ };
35
138
  return jsx(Fragment, null, jsx(Tag, _extends({
36
- css: productHomeButtonCSS(theme),
139
+ style: productHomeButtonDynamicStyles,
140
+ css: productHomeButtonStyles,
37
141
  href: href,
38
142
  onClick: onClick,
39
143
  onMouseDown: preventFocusRing,
40
144
  "data-testid": testId && `${testId}-container`
41
145
  }, rest), jsx("div", {
42
- css: productLogoCSS(logoMaxWidth),
146
+ style: {
147
+ [VAR_LOGO_MAX_WIDTH]: logoMaxWidth
148
+ },
149
+ css: [customMaxHeightStyles, productLogoStyles],
43
150
  "data-testid": testId && `${testId}-logo`
44
151
  }, jsx(Logo, {
45
152
  iconGradientStart: iconGradientStart,
@@ -47,14 +154,20 @@ const ProductHome = ({
47
154
  iconColor: iconColor,
48
155
  textColor: textColor
49
156
  })), jsx("div", {
50
- css: productIconCSS,
157
+ style: {
158
+ [VAR_LOGO_MAX_WIDTH]: logoMaxWidth
159
+ },
160
+ css: [customMaxHeightStyles, productIconStyles],
51
161
  "data-testid": testId && `${testId}-icon`
52
162
  }, jsx(Icon, {
53
163
  iconGradientStart: iconGradientStart,
54
164
  iconGradientStop: iconGradientStop,
55
165
  iconColor: iconColor
56
166
  }))), siteTitle && jsx("div", {
57
- css: siteTitleCSS(theme),
167
+ style: {
168
+ borderRight: theme.mode.productHome.borderRight
169
+ },
170
+ css: siteTitleStyles,
58
171
  "data-testid": testId && `${testId}-site-title`
59
172
  }, siteTitle));
60
173
  };
@@ -1,19 +1,142 @@
1
1
  /** @jsx jsx */
2
2
  import { Fragment } from 'react';
3
- import { jsx } from '@emotion/core';
3
+ import { css, jsx } from '@emotion/core';
4
+ import { gridSize, PRODUCT_HOME_BREAKPOINT } from '../../common/constants';
4
5
  import { useTheme } from '../../theme';
5
- import { productHomeButtonSkeletonCSS, productIconSkeletonCSS, productLogoSkeletonCSS, siteTitleSkeletonCSS } from './styles';
6
+ const VAR_PRODUCT_HOME_COLOR_ACTIVE = '--product-home-color-active';
7
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE = '--product-home-bg-color-active';
8
+ const VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE = '--product-home-box-shadow-active';
9
+ const VAR_PRODUCT_HOME_COLOR_FOCUS = '--product-home-color-focus';
10
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS = '--product-home-bg-color-focus';
11
+ const VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS = '--product-home-box-shadow-focus';
12
+ const VAR_PRODUCT_HOME_COLOR_HOVER = '--product-home-color-hover';
13
+ const VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER = '--product-home-bg-color-hover';
14
+ const VAR_PRODUCT_HOME_BOX_SHADOW_HOVER = '--product-home-box-shadow-hover';
15
+ const VAR_SITE_TITLE_BG_COLOR_AFTER = '--site-title-bg-color-after';
16
+ const productHomeButtonStyles = css({
17
+ display: 'flex',
18
+ padding: gridSize / 2,
19
+ alignItems: 'center',
20
+ background: 'none',
21
+ border: 0,
22
+ borderRadius: 3,
23
+ color: 'inherit',
24
+ cursor: 'pointer',
25
+ '&::-moz-focus-inner': {
26
+ border: 0
27
+ },
28
+ '&:first-of-type': {
29
+ marginLeft: 0
30
+ },
31
+ '&:active': {
32
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE})`,
33
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE})`,
34
+ color: `var(${VAR_PRODUCT_HOME_COLOR_ACTIVE})`
35
+ },
36
+ '&:focus': {
37
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS})`,
38
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS})`,
39
+ color: `var(${VAR_PRODUCT_HOME_COLOR_FOCUS})`,
40
+ outline: 0
41
+ },
42
+ '&:hover': {
43
+ backgroundColor: `var(${VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER})`,
44
+ boxShadow: `var(${VAR_PRODUCT_HOME_BOX_SHADOW_HOVER})`,
45
+ color: `var(${VAR_PRODUCT_HOME_COLOR_HOVER})`
46
+ },
47
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
48
+ 'div&': {
49
+ pointerEvents: 'none'
50
+ },
51
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
52
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
53
+ margin: `0 ${gridSize}px`
54
+ },
55
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
56
+ [`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
57
+ margin: `0 ${gridSize * 2}px`
58
+ }
59
+ });
60
+ const productLogoStyles = css({
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
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
72
+ [`@media (max-width: ${PRODUCT_HOME_BREAKPOINT - 0.1}px)`]: {
73
+ display: 'none'
74
+ }
75
+ });
76
+ const productIconStyles = css({
77
+ display: 'flex',
78
+ width: 28,
79
+ height: 28,
80
+ borderRadius: '50%',
81
+ opacity: 0.15,
82
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
83
+ '& > *': {
84
+ maxHeight: 24
85
+ },
86
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
87
+ [`@media (min-width: ${PRODUCT_HOME_BREAKPOINT}px)`]: {
88
+ display: 'none'
89
+ }
90
+ });
91
+ const siteTitleStyles = css({
92
+ display: 'flex',
93
+ width: gridSize * 5,
94
+ marginRight: gridSize / 2,
95
+ marginLeft: gridSize * 0.5,
96
+ paddingRight: gridSize * 2,
97
+ alignItems: 'center',
98
+ backgroundColor: 'transparent',
99
+ '&:after': {
100
+ width: '100%',
101
+ height: 14,
102
+ backgroundColor: `var(${VAR_SITE_TITLE_BG_COLOR_AFTER})`,
103
+ borderRadius: 4,
104
+ content: '""'
105
+ }
106
+ });
6
107
  export const ProductHomeSkeleton = ({
7
108
  showSiteName
8
109
  }) => {
9
110
  const theme = useTheme();
111
+ const primaryButton = theme.mode.primaryButton;
112
+ const productHomeButtonDynamicStyles = {
113
+ [VAR_PRODUCT_HOME_COLOR_ACTIVE]: primaryButton.active.color,
114
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_ACTIVE]: primaryButton.active.backgroundColor,
115
+ [VAR_PRODUCT_HOME_BOX_SHADOW_ACTIVE]: primaryButton.active.boxShadow,
116
+ [VAR_PRODUCT_HOME_COLOR_FOCUS]: primaryButton.focus.color,
117
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_FOCUS]: primaryButton.focus.backgroundColor,
118
+ [VAR_PRODUCT_HOME_BOX_SHADOW_FOCUS]: primaryButton.focus.boxShadow,
119
+ [VAR_PRODUCT_HOME_COLOR_HOVER]: primaryButton.hover.color,
120
+ [VAR_PRODUCT_HOME_BACKGROUND_COLOR_HOVER]: primaryButton.hover.backgroundColor,
121
+ [VAR_PRODUCT_HOME_BOX_SHADOW_HOVER]: primaryButton.hover.boxShadow,
122
+ [VAR_SITE_TITLE_BG_COLOR_AFTER]: theme.mode.skeleton.backgroundColor
123
+ };
124
+ const siteTitleDynamicStyles = {
125
+ borderRight: theme.mode.productHome.borderRight,
126
+ opacity: theme.mode.skeleton.opacity,
127
+ [VAR_SITE_TITLE_BG_COLOR_AFTER]: theme.mode.skeleton.backgroundColor
128
+ };
10
129
  return jsx(Fragment, null, jsx("div", {
11
- css: productHomeButtonSkeletonCSS(theme)
130
+ style: productHomeButtonDynamicStyles,
131
+ css: productHomeButtonStyles
12
132
  }, jsx("div", {
13
- css: productLogoSkeletonCSS(theme)
133
+ style: theme.mode.skeleton,
134
+ css: productLogoStyles
14
135
  }), jsx("div", {
15
- css: productIconSkeletonCSS(theme)
136
+ style: theme.mode.skeleton,
137
+ css: productIconStyles
16
138
  })), showSiteName && jsx("div", {
17
- css: siteTitleSkeletonCSS(theme)
139
+ style: siteTitleDynamicStyles,
140
+ css: siteTitleStyles
18
141
  }));
19
142
  };
@@ -2,11 +2,47 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
 
3
3
  /** @jsx jsx */
4
4
  import { Fragment } from 'react';
5
- import { jsx } from '@emotion/core';
5
+ import { css, jsx } from '@emotion/core';
6
6
  import SearchIcon from '@atlaskit/icon/glyph/search';
7
+ import { CREATE_BREAKPOINT, fontSize, gridSize } from '../../common/constants';
7
8
  import { useTheme } from '../../theme';
8
9
  import { IconButton } from '../IconButton';
9
- import { searchIconCSS, searchInputContainerCSS, searchInputCSS, searchInputIconCSS } from './styles';
10
+ const searchInputContainerStyles = css({
11
+ marginRight: gridSize,
12
+ marginLeft: 20,
13
+ position: 'relative',
14
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
15
+ [`@media (max-width: ${CREATE_BREAKPOINT - 1}px)`]: {
16
+ display: 'none !important'
17
+ }
18
+ });
19
+ const searchInputIconStyles = css({
20
+ width: '20px',
21
+ height: '20px',
22
+ position: 'absolute',
23
+ top: '5px',
24
+ left: '10px',
25
+ pointerEvents: 'none'
26
+ });
27
+ const searchInputStyles = css({
28
+ boxSizing: 'border-box',
29
+ width: '220px',
30
+ height: `${gridSize * 4}px`,
31
+ padding: `0 ${gridSize}px 0 40px`,
32
+ border: '2px solid',
33
+ borderRadius: 6,
34
+ fontSize: `${fontSize}px`,
35
+ outline: 'none',
36
+ '::placeholder': {
37
+ color: 'inherit'
38
+ }
39
+ });
40
+ const searchIconStyles = css({
41
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
42
+ [`@media (min-width: ${CREATE_BREAKPOINT}px)`]: {
43
+ display: 'none !important'
44
+ }
45
+ });
10
46
 
11
47
  const SearchComponent = props => {
12
48
  const {
@@ -16,6 +52,7 @@ const SearchComponent = props => {
16
52
  value
17
53
  } = props;
18
54
  const theme = useTheme();
55
+ const search = theme.mode.search;
19
56
 
20
57
  const onChange = (...args) => {
21
58
  // @ts-ignore
@@ -27,15 +64,19 @@ const SearchComponent = props => {
27
64
  onClick && onClick(...args);
28
65
  };
29
66
 
67
+ const searchInputDynamicStyles = { ...search.default,
68
+ ':focus': search.focus
69
+ };
30
70
  return jsx("div", {
31
- css: searchInputContainerCSS,
71
+ css: searchInputContainerStyles,
32
72
  role: "search"
33
73
  }, jsx("div", {
34
- css: searchInputIconCSS
74
+ css: searchInputIconStyles
35
75
  }, jsx(SearchIcon, {
36
76
  label: ""
37
77
  })), jsx("input", {
38
- css: searchInputCSS(theme),
78
+ style: searchInputDynamicStyles,
79
+ css: searchInputStyles,
39
80
  "aria-label": label,
40
81
  placeholder: placeholder,
41
82
  onChange: onChange,
@@ -58,7 +99,7 @@ export const Search = props => {
58
99
  label: label,
59
100
  value: value || ''
60
101
  }), jsx(IconButton, _extends({
61
- css: searchIconCSS,
102
+ css: searchIconStyles,
62
103
  icon: jsx(SearchIcon, {
63
104
  label: label
64
105
  }),
@@ -1,19 +1,42 @@
1
1
  /** @jsx jsx */
2
2
  import { Fragment } from 'react';
3
- import { jsx } from '@emotion/core';
4
- import { gridSize } from '@atlaskit/theme/constants';
3
+ import { css, jsx } from '@emotion/core';
4
+ import { CREATE_BREAKPOINT, gridSize } from '../../common/constants';
5
5
  import { useTheme } from '../../theme';
6
6
  import { IconButtonSkeleton } from '../IconButton/skeleton';
7
- import { searchIconSkeletonCSS, searchInputContainerCSS, searchInputSkeletonCSS } from './styles';
7
+ const searchInputContainerStyles = css({
8
+ marginRight: gridSize,
9
+ marginLeft: 20,
10
+ position: 'relative',
11
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
12
+ [`@media (max-width: ${CREATE_BREAKPOINT - 1}px)`]: {
13
+ display: 'none !important'
14
+ }
15
+ });
16
+ const searchInputSkeletonStyles = css({
17
+ boxSizing: 'border-box',
18
+ width: '220px',
19
+ height: `${gridSize * 4}px`,
20
+ padding: `0 ${gridSize}px 0 40px`,
21
+ borderRadius: 6,
22
+ opacity: 0.15
23
+ });
24
+ const searchIconStyles = css({
25
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
26
+ [`@media (min-width: ${CREATE_BREAKPOINT}px)`]: {
27
+ display: 'none !important'
28
+ }
29
+ });
8
30
  export const SearchSkeleton = () => {
9
31
  const theme = useTheme();
10
32
  return jsx(Fragment, null, jsx("div", {
11
- css: searchInputContainerCSS
33
+ css: searchInputContainerStyles
12
34
  }, jsx("div", {
13
- css: searchInputSkeletonCSS(theme)
35
+ style: theme.mode.skeleton,
36
+ css: searchInputSkeletonStyles
14
37
  })), jsx(IconButtonSkeleton, {
15
- css: searchIconSkeletonCSS,
38
+ css: searchIconStyles,
16
39
  marginRight: 5,
17
- size: gridSize() * 3.25
40
+ size: gridSize * 3.25
18
41
  }));
19
42
  };
@@ -1,14 +1,34 @@
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
+ const 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 const SkeletonCreateButton = ({
6
25
  text,
7
26
  testId
8
27
  }) => {
9
28
  const theme = useTheme();
10
29
  return jsx("button", {
11
- css: skeletonCreateButtonCSS(theme),
30
+ style: theme.mode.create.default,
31
+ css: skeletonCreateButtonStyles,
12
32
  "data-testid": testId
13
33
  }, text);
14
34
  };
@@ -1,14 +1,41 @@
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
+ const 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 const SkeletonIconButton = ({
6
32
  children,
7
33
  testId
8
34
  }) => {
9
35
  const theme = useTheme();
10
36
  return jsx("button", {
37
+ style: theme.mode.iconButton.default,
11
38
  "data-testid": testId,
12
- css: skeletonIconButtonCSS(theme)
39
+ css: skeletonIconButtonStyles
13
40
  }, children);
14
41
  };
@@ -1,7 +1,69 @@
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 skeletonPrimaryButtonCSS from './styles';
4
+ const VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR = '--primary-button-before-highlighted-background-color';
5
+ const VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR = '--primary-button-after-dropdown-border-color';
6
+ const primaryButtonSkeletonStyles = css({
7
+ margin: '0 6px',
8
+ padding: '0 4px',
9
+ position: 'relative',
10
+ appearance: 'none',
11
+ border: 0,
12
+ fontSize: 14,
13
+ fontWeight: 500,
14
+ lineHeight: 1,
15
+ pointerEvents: 'none',
16
+ ':focus, :active, :hover': {
17
+ appearance: 'none',
18
+ border: 0,
19
+ outline: 0
20
+ },
21
+ '::-moz-focus-inner': {
22
+ border: 0
23
+ }
24
+ });
25
+ const isHighlightedStyles = css({
26
+ '&:before': {
27
+ height: 3,
28
+ position: 'absolute',
29
+ bottom: 0,
30
+ left: 2,
31
+ backgroundColor: `var(${VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR})`,
32
+ borderTopLeftRadius: 1,
33
+ borderTopRightRadius: 1,
34
+ content: '""'
35
+ }
36
+ });
37
+ const isHighlightedAndDropdownButtonStyles = css({
38
+ '&:before': {
39
+ right: -10
40
+ }
41
+ });
42
+ const isHighlightedNotDropdownButtonStyles = css({
43
+ '&:before': {
44
+ right: 2
45
+ }
46
+ });
47
+ const isDropdownButtonStyles = css({
48
+ marginRight: 18,
49
+ '&:after': {
50
+ display: 'inline-block',
51
+ width: 4,
52
+ height: 4,
53
+ marginLeft: 4,
54
+ position: 'absolute',
55
+ top: 'calc(50% - 4px)',
56
+ left: 'calc(100% - 3px)',
57
+ borderBottom: '2px solid',
58
+ borderColor: `var(${VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR})`,
59
+ borderRadius: 1,
60
+ borderRight: '2px solid',
61
+ content: '""',
62
+ opacity: 0.51,
63
+ transform: 'rotate(45deg) scale(1.05)',
64
+ verticalAlign: 'middle'
65
+ }
66
+ });
5
67
  export const SkeletonPrimaryButton = ({
6
68
  isDropdownButton = false,
7
69
  isHighlighted = false,
@@ -10,8 +72,17 @@ export const SkeletonPrimaryButton = ({
10
72
  testId
11
73
  }) => {
12
74
  const theme = useTheme();
75
+ const primaryButton = theme.mode.primaryButton;
76
+ const dynamicStyles = { ...primaryButton.default,
77
+ ...(isHighlighted && {
78
+ color: primaryButton.selected.color
79
+ }),
80
+ [VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR]: primaryButton.selected.borderColor,
81
+ [VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR]: isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color
82
+ };
13
83
  return jsx("button", {
14
- css: skeletonPrimaryButtonCSS(theme, isDropdownButton, isHighlighted),
84
+ style: dynamicStyles,
85
+ css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
15
86
  "data-testid": testId
16
87
  }, text || children);
17
88
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,7 @@
1
+ import { fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
2
+ export var gridSize = getGridSize();
3
+ export var buttonHeight = gridSize * 4;
4
+ export var fontSize = getFontSize();
1
5
  export var HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
2
6
  export var PRODUCT_HOME_BREAKPOINT = 1280;
3
7
  export var CREATE_BREAKPOINT = 1130;