@atlaskit/atlassian-navigation 2.0.3 → 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 (128) hide show
  1. package/CHANGELOG.md +20 -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 +40 -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 +40 -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 +40 -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 +8 -4
  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,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
  };
@@ -4,23 +4,23 @@ const defaultTheme = {
4
4
  mode: {
5
5
  create: {
6
6
  active: {
7
- color: `var(--ds-text-onBold, ${N0})`,
8
- backgroundColor: `var(--ds-background-boldBrand-pressed, ${hexToRGBA(B400, 0.8)})`,
7
+ color: `var(--ds-text-inverse, ${N0})`,
8
+ backgroundColor: `var(--ds-background-brand-bold-pressed, ${hexToRGBA(B400, 0.8)})`,
9
9
  boxShadow: ''
10
10
  },
11
11
  default: {
12
- color: `var(--ds-text-onBold, ${N0})`,
13
- backgroundColor: `var(--ds-background-boldBrand-resting, ${B400})`,
12
+ color: `var(--ds-text-inverse, ${N0})`,
13
+ backgroundColor: `var(--ds-background-brand-bold, ${B400})`,
14
14
  boxShadow: ''
15
15
  },
16
16
  focus: {
17
- color: `var(--ds-text-onBold, ${N0})`,
18
- backgroundColor: `var(--ds-background-boldBrand-resting, ${B400})`,
19
- boxShadow: `0 0 0 2px ${"var(--ds-border-focus, rgb(128,169,230))"}`
17
+ color: `var(--ds-text-inverse, ${N0})`,
18
+ backgroundColor: `var(--ds-background-brand-bold, ${B400})`,
19
+ boxShadow: `0 0 0 2px ${"var(--ds-border-focused, rgb(128,169,230))"}`
20
20
  },
21
21
  hover: {
22
- color: `var(--ds-text-onBold, ${N0})`,
23
- backgroundColor: `var(--ds-background-boldBrand-hover, ${hexToRGBA(B400, 0.9)})`,
22
+ color: `var(--ds-text-inverse, ${N0})`,
23
+ backgroundColor: `var(--ds-background-brand-bold-hovered, ${hexToRGBA(B400, 0.9)})`,
24
24
  boxShadow: ''
25
25
  },
26
26
  selected: {
@@ -31,39 +31,39 @@ const defaultTheme = {
31
31
  },
32
32
  iconButton: {
33
33
  active: {
34
- color: `var(--ds-text-mediumEmphasis, ${B400})`,
35
- backgroundColor: `var(--ds-background-subtleNeutral-pressed, ${hexToRGBA(B50, 0.6)})`,
34
+ color: `var(--ds-text-subtle, ${B400})`,
35
+ backgroundColor: `var(--ds-background-neutral-pressed, ${hexToRGBA(B50, 0.6)})`,
36
36
  boxShadow: ''
37
37
  },
38
38
  default: {
39
- color: `var(--ds-text-mediumEmphasis, ${N600})`,
39
+ color: `var(--ds-text-subtle, ${N600})`,
40
40
  backgroundColor: 'transparent',
41
41
  boxShadow: ''
42
42
  },
43
43
  focus: {
44
- color: `var(--ds-text-mediumEmphasis, ${N600})`,
45
- backgroundColor: `var(--ds-background-subtleBrand-hover, ${hexToRGBA(B50, 0.5)})`,
46
- boxShadow: `0 0 0 2px ${`var(--ds-border-focus, ${B200})`}`
44
+ color: `var(--ds-text-subtle, ${N600})`,
45
+ backgroundColor: `var(--ds-background-brand-hovered, ${hexToRGBA(B50, 0.5)})`,
46
+ boxShadow: `0 0 0 2px ${`var(--ds-border-focused, ${B200})`}`
47
47
  },
48
48
  hover: {
49
- color: `var(--ds-text-mediumEmphasis, ${B400})`,
50
- backgroundColor: `var(--ds-background-subtleNeutral-hover, ${hexToRGBA(B50, 0.9)})`,
49
+ color: `var(--ds-text-subtle, ${B400})`,
50
+ backgroundColor: `var(--ds-background-neutral-hovered, ${hexToRGBA(B50, 0.9)})`,
51
51
  boxShadow: ''
52
52
  },
53
53
  selected: {
54
- color: "var(--ds-text-selected)",
55
- backgroundColor: "var(--ds-background-selected-resting)",
54
+ color: "var(--ds-text-brand)",
55
+ backgroundColor: "var(--ds-background-brand)",
56
56
  boxShadow: ''
57
57
  }
58
58
  },
59
59
  navigation: {
60
- backgroundColor: `var(--ds-background-default, ${N0})`,
61
- color: `var(--ds-text-lowEmphasis, ${N200})`
60
+ backgroundColor: `var(--ds-surface, ${N0})`,
61
+ color: `var(--ds-text-subtlest, ${N200})`
62
62
  },
63
63
  productHome: {
64
64
  backgroundColor: `var(--ds-text-brand, ${B400})`,
65
- color: `var(--ds-text-highEmphasis, ${N700})`,
66
- borderRight: `1px solid ${`var(--ds-border-neutral, ${hexToRGBA(N200, 0.3)})`}`,
65
+ color: `var(--ds-text, ${N700})`,
66
+ borderRight: `1px solid ${`var(--ds-border, ${hexToRGBA(N200, 0.3)})`}`,
67
67
  // TODO: (DSP-1256) These colors should be moved into the Logo package
68
68
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
69
69
  iconGradientStart: B400,
@@ -74,49 +74,49 @@ const defaultTheme = {
74
74
  },
75
75
  primaryButton: {
76
76
  active: {
77
- color: `var(--ds-text-mediumEmphasis, ${B400})`,
78
- backgroundColor: `var(--ds-background-subtleNeutral-pressed, ${hexToRGBA(B50, 0.7)})`,
77
+ color: `var(--ds-text-subtle, ${B400})`,
78
+ backgroundColor: `var(--ds-background-neutral-pressed, ${hexToRGBA(B50, 0.7)})`,
79
79
  boxShadow: ''
80
80
  },
81
81
  default: {
82
- color: `var(--ds-text-mediumEmphasis, ${N600})`,
82
+ color: `var(--ds-text-subtle, ${N600})`,
83
83
  backgroundColor: 'transparent',
84
84
  boxShadow: ''
85
85
  },
86
86
  focus: {
87
- color: `var(--ds-text-mediumEmphasis, ${N600})`,
87
+ color: `var(--ds-text-subtle, ${N600})`,
88
88
  backgroundColor: '',
89
- boxShadow: `0 0 0 2px ${`var(--ds-border-focus, ${B200})`}`
89
+ boxShadow: `0 0 0 2px ${`var(--ds-border-focused, ${B200})`}`
90
90
  },
91
91
  hover: {
92
- color: `var(--ds-text-mediumEmphasis, ${B400})`,
93
- backgroundColor: `var(--ds-background-subtleNeutral-hover, ${hexToRGBA(B50, 0.9)})`,
92
+ color: `var(--ds-text-subtle, ${B400})`,
93
+ backgroundColor: `var(--ds-background-neutral-hovered, ${hexToRGBA(B50, 0.9)})`,
94
94
  boxShadow: ''
95
95
  },
96
96
  selected: {
97
- color: `var(--ds-text-selected, ${B400})`,
98
- backgroundColor: "var(--ds-background-selected-resting)",
97
+ color: `var(--ds-text-subtle, ${B400})`,
98
+ backgroundColor: "var(--ds-background-brand)",
99
99
  boxShadow: '',
100
- borderColor: `var(--ds-iconBorder-brand, ${B400})`,
101
- bordorBottom: `4px solid ${`var(--ds-iconBorder-brand, ${B400})`}`
100
+ borderColor: `var(--ds-border-brand, ${B400})`,
101
+ bordorBottom: `4px solid ${`var(--ds-border-brand, ${B400})`}`
102
102
  }
103
103
  },
104
104
  search: {
105
105
  default: {
106
- backgroundColor: `var(--ds-background-default, ${N0})`,
107
- color: `var(--ds-text-lowEmphasis, ${N200})`,
108
- borderColor: `var(--ds-border-neutral, ${N40})`
106
+ backgroundColor: `var(--ds-surface, ${N0})`,
107
+ color: `var(--ds-text-subtlest, ${N200})`,
108
+ borderColor: `var(--ds-border, ${N40})`
109
109
  },
110
110
  focus: {
111
- borderColor: `var(--ds-border-focus, ${B200})`
111
+ borderColor: `var(--ds-border-focused, ${B200})`
112
112
  },
113
113
  hover: {
114
114
  color: `var(--ds-text-brand, ${B400})`,
115
- backgroundColor: `var(--ds-background-default, ${hexToRGBA(B50, 0.9)})`
115
+ backgroundColor: `var(--ds-surface, ${hexToRGBA(B50, 0.9)})`
116
116
  }
117
117
  },
118
118
  skeleton: {
119
- backgroundColor: `var(--ds-background-subtleNeutral-resting, ${N20})`,
119
+ backgroundColor: `var(--ds-background-neutral, ${N20})`,
120
120
  opacity: 1
121
121
  }
122
122
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/atlassian-navigation",
3
- "version": "2.0.3",
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;
@@ -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
+ var 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 ".concat("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, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
36
+ N900, 0), " 4px)"),
37
+ content: '""'
38
+ }
39
+ });
40
+ var 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
+ var 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
  var analyticsData = {
8
62
  attributes: {
9
63
  navigationLayer: 'global'
@@ -33,11 +87,12 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
33
87
  }, jsx(NavigationAnalyticsContext, {
34
88
  data: analyticsData
35
89
  }, jsx("header", {
36
- css: containerCSS(theme),
90
+ style: theme.mode.navigation,
91
+ css: containerStyles,
37
92
  "data-testid": testId && "".concat(testId, "-header"),
38
93
  role: "banner"
39
94
  }, jsx("nav", {
40
- css: leftCSS,
95
+ css: leftStyles,
41
96
  "aria-label": label
42
97
  }, AppSwitcher && jsx(AppSwitcher, null), ProductHome && jsx(ProductHome, null), jsx(PrimaryItemsContainer, {
43
98
  testId: testId,
@@ -46,7 +101,7 @@ export var AtlassianNavigation = function AtlassianNavigation(props) {
46
101
  create: create,
47
102
  theme: theme
48
103
  })), jsx("div", {
49
- css: rightCSS,
104
+ css: rightStyles,
50
105
  "data-testid": testId && "".concat(testId, "-secondary-actions")
51
106
  }, Search && jsx(Search, null), Notifications && jsx(Notifications, null), Help && jsx(Help, null), Settings && jsx(Settings, null), SignIn && jsx(SignIn, null), Profile && jsx(Profile, null)))));
52
107
  };
@@ -1,13 +1,66 @@
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
+ var 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 ".concat("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, ".concat(N40A, " 0, ").concat(N40A, " 1px, ").concat(N30A, " 1px, ").concat(hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
39
+ N900, 0), " 4px)"),
40
+ content: '""'
41
+ }
42
+ });
43
+ var 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
+ var 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 var NavigationSkeleton = function NavigationSkeleton(_ref) {
12
65
  var _ref$primaryItemsCoun = _ref.primaryItemsCount,
13
66
  primaryItemsCount = _ref$primaryItemsCoun === void 0 ? 4 : _ref$primaryItemsCoun,
@@ -18,31 +71,34 @@ export var NavigationSkeleton = function NavigationSkeleton(_ref) {
18
71
  _ref$showSiteName = _ref.showSiteName,
19
72
  showSiteName = _ref$showSiteName === void 0 ? false : _ref$showSiteName,
20
73
  _ref$shouldShowSearch = _ref.shouldShowSearch,
21
- shouldShowSearch = _ref$shouldShowSearch === void 0 ? true : _ref$shouldShowSearch;
74
+ shouldShowSearch = _ref$shouldShowSearch === void 0 ? true : _ref$shouldShowSearch,
75
+ testId = _ref.testId;
22
76
  return jsx(ThemeProvider, {
23
77
  value: theme
24
78
  }, jsx("div", {
25
- css: containerCSS(theme)
79
+ style: theme.mode.navigation,
80
+ css: containerStyles,
81
+ "data-testid": testId
26
82
  }, jsx("div", {
27
- css: leftCSS
83
+ css: leftStyles
28
84
  }, jsx(IconButtonSkeleton, {
29
85
  marginLeft: 0,
30
86
  marginRight: 5,
31
- size: gridSize() * 3.25
87
+ size: gridSize * 3.25
32
88
  }), jsx(ProductHomeSkeleton, {
33
89
  showSiteName: showSiteName
34
90
  }), jsx(PrimaryItemsContainerSkeleton, {
35
91
  count: primaryItemsCount
36
92
  })), jsx("div", {
37
- css: rightCSS
93
+ css: rightStyles
38
94
  }, shouldShowSearch && jsx(SearchSkeleton, null), Array.from({
39
95
  length: secondaryItemsCount
40
96
  }, function (_, index) {
41
97
  return jsx(IconButtonSkeleton, {
42
98
  key: index,
43
99
  marginLeft: 0,
44
- marginRight: 5,
45
- size: gridSize() * 3.25
100
+ marginRight: gridSize / 2,
101
+ size: gridSize * 3.25
46
102
  });
47
103
  }), jsx(ProfileSkeleton, null))));
48
104
  };
@@ -1,14 +1,22 @@
1
1
  /** @jsx jsx */
2
- import { jsx } from '@emotion/core';
3
- import { badgeContainerCSS, containerCSS } from './styles';
2
+ import { css, jsx } from '@emotion/core';
3
+ var badgeContainerStyles = css({
4
+ position: 'absolute',
5
+ top: '-4px',
6
+ right: '-2px',
7
+ pointerEvents: 'none'
8
+ });
9
+ var containerStyles = css({
10
+ position: 'relative'
11
+ });
4
12
  export var BadgeContainer = function BadgeContainer(props) {
5
13
  var badgeId = props.id,
6
14
  Badge = props.badge,
7
15
  children = props.children;
8
16
  return jsx("div", {
9
- css: containerCSS
17
+ css: containerStyles
10
18
  }, children, jsx("div", {
11
- css: badgeContainerCSS,
19
+ css: badgeContainerStyles,
12
20
  id: badgeId,
13
21
  "aria-hidden": true
14
22
  }, jsx(Badge, null)));
@@ -1,14 +1,31 @@
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';
5
+ import { css, jsx } from '@emotion/core';
4
6
  import Button from '@atlaskit/button/custom-theme-button';
5
7
  import AddIcon from '@atlaskit/icon/glyph/editor/add';
6
- import { gridSize } from '@atlaskit/theme/constants';
7
8
  import Tooltip from '@atlaskit/tooltip';
9
+ import { CREATE_BREAKPOINT, gridSize } from '../../common/constants';
8
10
  import { useTheme } from '../../theme';
9
11
  import { IconButton } from '../IconButton';
10
- import { createButtonCSS, createIconCSS, getCreateButtonTheme } from './styles';
11
- var grid = gridSize();
12
+ import { getCreateButtonTheme } from './styles';
13
+ var wrapperStyles = css({
14
+ display: 'flex',
15
+ alignItems: 'center',
16
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
17
+ '& [data-hide-on-smallscreens]': _defineProperty({}, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
18
+ display: 'none !important'
19
+ }),
20
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
21
+ '& [data-hide-on-largescreens]': _defineProperty({}, "@media (min-width: ".concat(CREATE_BREAKPOINT, "px)"), {
22
+ display: 'none !important'
23
+ }),
24
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
25
+ '&&': {
26
+ marginLeft: gridSize * 1.5
27
+ }
28
+ });
12
29
 
13
30
  var TooltipSwitch = function TooltipSwitch(_ref) {
14
31
  var buttonTooltip = _ref.buttonTooltip,
@@ -21,27 +38,21 @@ var TooltipSwitch = function TooltipSwitch(_ref) {
21
38
 
22
39
  export var Create = function Create(_ref2) {
23
40
  var onClick = _ref2.onClick,
41
+ href = _ref2.href,
24
42
  text = _ref2.text,
25
43
  buttonTooltip = _ref2.buttonTooltip,
26
44
  iconButtonTooltip = _ref2.iconButtonTooltip,
27
45
  testId = _ref2.testId;
28
46
  var theme = useTheme();
29
47
  return jsx("div", {
30
- css: {
31
- display: 'flex',
32
- alignItems: 'center',
33
- '&&': {
34
- marginLeft: grid * 1.5
35
- },
36
- '& [data-hide-on-smallscreens]': createButtonCSS,
37
- '& [data-hide-on-largescreens]': createIconCSS
38
- },
48
+ css: wrapperStyles,
39
49
  "data-testid": "create-button-wrapper"
40
50
  }, jsx(TooltipSwitch, {
41
51
  buttonTooltip: buttonTooltip
42
52
  }, jsx(Button, {
43
53
  id: "createGlobalItem",
44
54
  onClick: onClick,
55
+ href: href,
45
56
  theme: getCreateButtonTheme(theme),
46
57
  testId: testId && "".concat(testId, "-button"),
47
58
  "data-hide-on-smallscreens": true
@@ -52,6 +63,7 @@ export var Create = function Create(_ref2) {
52
63
  label: text
53
64
  }),
54
65
  onClick: onClick,
66
+ href: href,
55
67
  tooltip: iconButtonTooltip,
56
68
  theme: getCreateButtonTheme(theme),
57
69
  "aria-label": text,
@@ -1,16 +1,29 @@
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 { createButtonSkeletonCSS, createIconSkeletonCSS } from './styles';
9
+ var buttonHeight = gridSize * 4;
10
+ var skeletonStyles = css({
11
+ width: 68,
12
+ height: buttonHeight,
13
+ marginLeft: 12,
14
+ borderRadius: 3,
15
+ opacity: 0.15
16
+ });
17
+ var mobileStyles = css(_defineProperty({}, "@media (max-width: ".concat(CREATE_BREAKPOINT - 1, "px)"), {
18
+ display: 'none !important'
19
+ }));
8
20
  export var CreateSkeleton = function CreateSkeleton() {
9
21
  var theme = useTheme();
10
22
  return jsx(Fragment, null, jsx("div", {
11
- css: createButtonSkeletonCSS(theme)
23
+ style: theme.mode.skeleton,
24
+ css: [skeletonStyles, mobileStyles]
12
25
  }), jsx(IconButtonSkeleton, {
13
- css: createIconSkeletonCSS,
14
- size: gridSize() * 3.25
26
+ css: mobileStyles,
27
+ size: gridSize * 3.25
15
28
  }));
16
29
  };
@@ -4,21 +4,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
4
4
 
5
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
6
 
7
- import { gridSize as gridSizeFn } from '@atlaskit/theme/constants';
8
- import { actionSectionDesktopCSS, actionSectionMobileCSS, skeletonCSS } from '../../common/styles';
9
- var gridSize = gridSizeFn();
10
- var buttonHeight = gridSize * 4;
11
- export var createButtonCSS = actionSectionDesktopCSS;
12
- export var createButtonSkeletonCSS = function createButtonSkeletonCSS(theme) {
13
- return _objectSpread(_objectSpread({
14
- height: "".concat(buttonHeight, "px"),
15
- width: '68px',
16
- borderRadius: '3px',
17
- marginLeft: 12
18
- }, createButtonCSS), skeletonCSS(theme));
19
- };
20
- export var createIconCSS = actionSectionMobileCSS;
21
- export var createIconSkeletonCSS = createIconCSS;
22
7
  export var getCreateButtonTheme = function getCreateButtonTheme(_ref) {
23
8
  var create = _ref.mode.create;
24
9
  return function (current, props) {