@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.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/common/constants.js +10 -1
- package/dist/cjs/components/AtlassianNavigation/index.js +61 -5
- package/dist/cjs/components/AtlassianNavigation/skeleton.js +67 -10
- package/dist/cjs/components/BadgeContainer/index.js +12 -4
- package/dist/cjs/components/Create/index.js +24 -12
- package/dist/cjs/components/Create/skeleton.js +21 -6
- package/dist/cjs/components/Create/styles.js +1 -25
- package/dist/cjs/components/IconButton/skeleton.js +31 -5
- package/dist/cjs/components/IconButton/styles.js +2 -32
- package/dist/cjs/components/PrimaryButton/index.js +35 -1
- package/dist/cjs/components/PrimaryButton/skeleton.js +15 -5
- package/dist/cjs/components/PrimaryButton/styles.js +2 -58
- package/dist/cjs/components/PrimaryDropdownButton/index.js +6 -3
- package/dist/cjs/components/PrimaryItemsContainer/index.js +26 -4
- package/dist/cjs/components/PrimaryItemsContainer/skeleton.js +8 -3
- package/dist/cjs/components/ProductHome/custom-product-home.js +104 -6
- package/dist/cjs/components/ProductHome/product-home.js +104 -6
- package/dist/cjs/components/ProductHome/skeleton.js +117 -6
- package/dist/cjs/components/Search/index.js +50 -6
- package/dist/cjs/components/Search/skeleton.js +29 -7
- package/dist/cjs/components/SkeletonCreateButton/index.js +23 -5
- package/dist/cjs/components/SkeletonIconButton/index.js +30 -5
- package/dist/cjs/components/SkeletonPrimaryButton/index.js +79 -3
- package/dist/cjs/theme/defaultTheme.js +39 -40
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/common/constants.js +4 -0
- package/dist/es2019/components/AtlassianNavigation/index.js +61 -6
- package/dist/es2019/components/AtlassianNavigation/skeleton.js +67 -11
- package/dist/es2019/components/BadgeContainer/index.js +12 -4
- package/dist/es2019/components/Create/index.js +29 -13
- package/dist/es2019/components/Create/skeleton.js +20 -6
- package/dist/es2019/components/Create/styles.js +0 -15
- package/dist/es2019/components/IconButton/skeleton.js +23 -5
- package/dist/es2019/components/IconButton/styles.js +1 -23
- package/dist/es2019/components/PrimaryButton/index.js +35 -3
- package/dist/es2019/components/PrimaryButton/skeleton.js +14 -5
- package/dist/es2019/components/PrimaryButton/styles.js +1 -46
- package/dist/es2019/components/PrimaryDropdownButton/index.js +7 -3
- package/dist/es2019/components/PrimaryItemsContainer/index.js +25 -4
- package/dist/es2019/components/PrimaryItemsContainer/skeleton.js +7 -3
- package/dist/es2019/components/ProductHome/custom-product-home.js +119 -6
- package/dist/es2019/components/ProductHome/product-home.js +119 -6
- package/dist/es2019/components/ProductHome/skeleton.js +129 -6
- package/dist/es2019/components/Search/index.js +47 -6
- package/dist/es2019/components/Search/skeleton.js +30 -7
- package/dist/es2019/components/SkeletonCreateButton/index.js +23 -3
- package/dist/es2019/components/SkeletonIconButton/index.js +30 -3
- package/dist/es2019/components/SkeletonPrimaryButton/index.js +74 -3
- package/dist/es2019/theme/defaultTheme.js +39 -40
- package/dist/es2019/version.json +1 -1
- package/dist/esm/common/constants.js +4 -0
- package/dist/esm/components/AtlassianNavigation/index.js +61 -6
- package/dist/esm/components/AtlassianNavigation/skeleton.js +67 -11
- package/dist/esm/components/BadgeContainer/index.js +12 -4
- package/dist/esm/components/Create/index.js +25 -13
- package/dist/esm/components/Create/skeleton.js +19 -6
- package/dist/esm/components/Create/styles.js +0 -15
- package/dist/esm/components/IconButton/skeleton.js +29 -5
- package/dist/esm/components/IconButton/styles.js +0 -22
- package/dist/esm/components/PrimaryButton/index.js +35 -3
- package/dist/esm/components/PrimaryButton/skeleton.js +14 -5
- package/dist/esm/components/PrimaryButton/styles.js +0 -44
- package/dist/esm/components/PrimaryDropdownButton/index.js +7 -3
- package/dist/esm/components/PrimaryItemsContainer/index.js +25 -4
- package/dist/esm/components/PrimaryItemsContainer/skeleton.js +7 -3
- package/dist/esm/components/ProductHome/custom-product-home.js +102 -6
- package/dist/esm/components/ProductHome/product-home.js +102 -6
- package/dist/esm/components/ProductHome/skeleton.js +117 -6
- package/dist/esm/components/Search/index.js +48 -6
- package/dist/esm/components/Search/skeleton.js +27 -7
- package/dist/esm/components/SkeletonCreateButton/index.js +23 -3
- package/dist/esm/components/SkeletonIconButton/index.js +30 -3
- package/dist/esm/components/SkeletonPrimaryButton/index.js +80 -3
- package/dist/esm/theme/defaultTheme.js +39 -40
- package/dist/esm/version.json +1 -1
- package/dist/types/common/constants.d.ts +3 -0
- package/dist/types/common/styles.d.ts +143 -143
- package/dist/types/components/AtlassianNavigation/skeleton.d.ts +1 -1
- package/dist/types/components/AtlassianNavigation/types.d.ts +1 -0
- package/dist/types/components/Create/index.d.ts +1 -1
- package/dist/types/components/Create/styles.d.ts +0 -923
- package/dist/types/components/Create/types.d.ts +5 -1
- package/dist/types/components/IconButton/skeleton.d.ts +1 -1
- package/dist/types/components/IconButton/styles.d.ts +0 -915
- package/dist/types/components/PrimaryButton/index.d.ts +1 -1
- package/dist/types/components/PrimaryButton/skeleton.d.ts +1 -0
- package/dist/types/components/PrimaryButton/styles.d.ts +0 -917
- package/dist/types/components/PrimaryDropdownButton/index.d.ts +1 -1
- package/docs/05-create.tsx +8 -0
- package/docs/99-migrating-from-navigation-next.tsx +31 -32
- package/package.json +9 -5
- package/dist/cjs/components/AtlassianNavigation/styles.js +0 -82
- package/dist/cjs/components/BadgeContainer/styles.js +0 -17
- package/dist/cjs/components/PrimaryDropdownButton/styles.js +0 -13
- package/dist/cjs/components/PrimaryItemsContainer/styles.js +0 -42
- package/dist/cjs/components/ProductHome/styles.js +0 -152
- package/dist/cjs/components/Search/styles.js +0 -70
- package/dist/cjs/components/SkeletonCreateButton/styles.js +0 -39
- package/dist/cjs/components/SkeletonIconButton/styles.js +0 -46
- package/dist/cjs/components/SkeletonPrimaryButton/styles.js +0 -74
- package/dist/es2019/components/AtlassianNavigation/styles.js +0 -60
- package/dist/es2019/components/BadgeContainer/styles.js +0 -9
- package/dist/es2019/components/PrimaryDropdownButton/styles.js +0 -6
- package/dist/es2019/components/PrimaryItemsContainer/styles.js +0 -30
- package/dist/es2019/components/ProductHome/styles.js +0 -117
- package/dist/es2019/components/Search/styles.js +0 -43
- package/dist/es2019/components/SkeletonCreateButton/styles.js +0 -25
- package/dist/es2019/components/SkeletonIconButton/styles.js +0 -32
- package/dist/es2019/components/SkeletonPrimaryButton/styles.js +0 -60
- package/dist/esm/components/AtlassianNavigation/styles.js +0 -64
- package/dist/esm/components/BadgeContainer/styles.js +0 -9
- package/dist/esm/components/PrimaryDropdownButton/styles.js +0 -6
- package/dist/esm/components/PrimaryItemsContainer/styles.js +0 -29
- package/dist/esm/components/ProductHome/styles.js +0 -114
- package/dist/esm/components/Search/styles.js +0 -47
- package/dist/esm/components/SkeletonCreateButton/styles.js +0 -28
- package/dist/esm/components/SkeletonIconButton/styles.js +0 -35
- package/dist/esm/components/SkeletonPrimaryButton/styles.js +0 -63
- package/dist/types/components/AtlassianNavigation/styles.d.ts +0 -22
- package/dist/types/components/BadgeContainer/styles.d.ts +0 -9
- package/dist/types/components/PrimaryDropdownButton/styles.d.ts +0 -5
- package/dist/types/components/PrimaryItemsContainer/styles.d.ts +0 -9
- package/dist/types/components/ProductHome/styles.d.ts +0 -2791
- package/dist/types/components/Search/styles.d.ts +0 -1842
- package/dist/types/components/SkeletonCreateButton/styles.d.ts +0 -4
- package/dist/types/components/SkeletonIconButton/styles.d.ts +0 -4
- 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
|
-
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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,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
|
const defaultTheme = {
|
|
5
4
|
mode: {
|
|
6
5
|
create: {
|
|
7
6
|
active: {
|
|
8
|
-
color: `var(--ds-text-
|
|
9
|
-
backgroundColor: `var(--ds-background-
|
|
7
|
+
color: `var(--ds-text-inverse, ${N0})`,
|
|
8
|
+
backgroundColor: `var(--ds-background-brand-bold-pressed, ${hexToRGBA(B400, 0.8)})`,
|
|
10
9
|
boxShadow: ''
|
|
11
10
|
},
|
|
12
11
|
default: {
|
|
13
|
-
color: `var(--ds-text-
|
|
14
|
-
backgroundColor: `var(--ds-background-
|
|
12
|
+
color: `var(--ds-text-inverse, ${N0})`,
|
|
13
|
+
backgroundColor: `var(--ds-background-brand-bold, ${B400})`,
|
|
15
14
|
boxShadow: ''
|
|
16
15
|
},
|
|
17
16
|
focus: {
|
|
18
|
-
color: `var(--ds-text-
|
|
19
|
-
backgroundColor: `var(--ds-background-
|
|
20
|
-
boxShadow: `0 0 0 2px ${"var(--ds-border-
|
|
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))"}`
|
|
21
20
|
},
|
|
22
21
|
hover: {
|
|
23
|
-
color: `var(--ds-text-
|
|
24
|
-
backgroundColor: `var(--ds-background-
|
|
22
|
+
color: `var(--ds-text-inverse, ${N0})`,
|
|
23
|
+
backgroundColor: `var(--ds-background-brand-bold-hovered, ${hexToRGBA(B400, 0.9)})`,
|
|
25
24
|
boxShadow: ''
|
|
26
25
|
},
|
|
27
26
|
selected: {
|
|
@@ -32,39 +31,39 @@ const defaultTheme = {
|
|
|
32
31
|
},
|
|
33
32
|
iconButton: {
|
|
34
33
|
active: {
|
|
35
|
-
color: `var(--ds-text-
|
|
36
|
-
backgroundColor: `var(--ds-background-
|
|
34
|
+
color: `var(--ds-text-subtle, ${B400})`,
|
|
35
|
+
backgroundColor: `var(--ds-background-neutral-pressed, ${hexToRGBA(B50, 0.6)})`,
|
|
37
36
|
boxShadow: ''
|
|
38
37
|
},
|
|
39
38
|
default: {
|
|
40
|
-
color: `var(--ds-text-
|
|
39
|
+
color: `var(--ds-text-subtle, ${N600})`,
|
|
41
40
|
backgroundColor: 'transparent',
|
|
42
41
|
boxShadow: ''
|
|
43
42
|
},
|
|
44
43
|
focus: {
|
|
45
|
-
color: `var(--ds-text-
|
|
46
|
-
backgroundColor: `var(--ds-background-
|
|
47
|
-
boxShadow: `0 0 0 2px ${`var(--ds-border-
|
|
44
|
+
color: `var(--ds-text-subtle, ${N600})`,
|
|
45
|
+
backgroundColor: `var(--ds-background-selected-hovered, ${hexToRGBA(B50, 0.5)})`,
|
|
46
|
+
boxShadow: `0 0 0 2px ${`var(--ds-border-focused, ${B200})`}`
|
|
48
47
|
},
|
|
49
48
|
hover: {
|
|
50
|
-
color: `var(--ds-text-
|
|
51
|
-
backgroundColor: `var(--ds-background-
|
|
49
|
+
color: `var(--ds-text-subtle, ${B400})`,
|
|
50
|
+
backgroundColor: `var(--ds-background-neutral-hovered, ${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
|
|
55
|
+
backgroundColor: "var(--ds-background-selected)",
|
|
57
56
|
boxShadow: ''
|
|
58
57
|
}
|
|
59
58
|
},
|
|
60
59
|
navigation: {
|
|
61
|
-
backgroundColor: `var(--ds-
|
|
62
|
-
color: `var(--ds-text-
|
|
60
|
+
backgroundColor: `var(--ds-surface, ${N0})`,
|
|
61
|
+
color: `var(--ds-text-subtlest, ${N200})`
|
|
63
62
|
},
|
|
64
63
|
productHome: {
|
|
65
64
|
backgroundColor: `var(--ds-text-brand, ${B400})`,
|
|
66
|
-
color: `var(--ds-text
|
|
67
|
-
borderRight: `1px solid ${`var(--ds-border
|
|
65
|
+
color: `var(--ds-text, ${N700})`,
|
|
66
|
+
borderRight: `1px solid ${`var(--ds-border, ${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 @@ const defaultTheme = {
|
|
|
75
74
|
},
|
|
76
75
|
primaryButton: {
|
|
77
76
|
active: {
|
|
78
|
-
color: `var(--ds-text-
|
|
79
|
-
backgroundColor: `var(--ds-background-
|
|
77
|
+
color: `var(--ds-text-subtle, ${B400})`,
|
|
78
|
+
backgroundColor: `var(--ds-background-neutral-pressed, ${hexToRGBA(B50, 0.7)})`,
|
|
80
79
|
boxShadow: ''
|
|
81
80
|
},
|
|
82
81
|
default: {
|
|
83
|
-
color: `var(--ds-text-
|
|
82
|
+
color: `var(--ds-text-subtle, ${N600})`,
|
|
84
83
|
backgroundColor: 'transparent',
|
|
85
84
|
boxShadow: ''
|
|
86
85
|
},
|
|
87
86
|
focus: {
|
|
88
|
-
color: `var(--ds-text-
|
|
87
|
+
color: `var(--ds-text-subtle, ${N600})`,
|
|
89
88
|
backgroundColor: '',
|
|
90
|
-
boxShadow: `0 0 0 2px ${`var(--ds-border-
|
|
89
|
+
boxShadow: `0 0 0 2px ${`var(--ds-border-focused, ${B200})`}`
|
|
91
90
|
},
|
|
92
91
|
hover: {
|
|
93
|
-
color: `var(--ds-text-
|
|
94
|
-
backgroundColor: `var(--ds-background-
|
|
92
|
+
color: `var(--ds-text-subtle, ${B400})`,
|
|
93
|
+
backgroundColor: `var(--ds-background-neutral-hovered, ${hexToRGBA(B50, 0.9)})`,
|
|
95
94
|
boxShadow: ''
|
|
96
95
|
},
|
|
97
96
|
selected: {
|
|
98
97
|
color: `var(--ds-text-selected, ${B400})`,
|
|
99
|
-
backgroundColor: "var(--ds-background-selected
|
|
98
|
+
backgroundColor: "var(--ds-background-selected)",
|
|
100
99
|
boxShadow: '',
|
|
101
|
-
borderColor: `var(--ds-
|
|
102
|
-
bordorBottom: `4px solid ${`var(--ds-
|
|
100
|
+
borderColor: `var(--ds-border-selected, ${B400})`,
|
|
101
|
+
bordorBottom: `4px solid ${`var(--ds-border-selected, ${B400})`}`
|
|
103
102
|
}
|
|
104
103
|
},
|
|
105
104
|
search: {
|
|
106
105
|
default: {
|
|
107
|
-
backgroundColor: `var(--ds-
|
|
108
|
-
color: `var(--ds-text-
|
|
109
|
-
borderColor: `var(--ds-border
|
|
106
|
+
backgroundColor: `var(--ds-surface, ${N0})`,
|
|
107
|
+
color: `var(--ds-text-subtlest, ${N200})`,
|
|
108
|
+
borderColor: `var(--ds-border, ${N40})`
|
|
110
109
|
},
|
|
111
110
|
focus: {
|
|
112
|
-
borderColor: `var(--ds-border-
|
|
111
|
+
borderColor: `var(--ds-border-focused, ${B200})`
|
|
113
112
|
},
|
|
114
113
|
hover: {
|
|
115
|
-
color: `var(--ds-text-
|
|
116
|
-
backgroundColor: `var(--ds-
|
|
114
|
+
color: `var(--ds-text-selected, ${B400})`,
|
|
115
|
+
backgroundColor: `var(--ds-surface, ${hexToRGBA(B50, 0.9)})`
|
|
117
116
|
}
|
|
118
117
|
},
|
|
119
118
|
skeleton: {
|
|
120
|
-
backgroundColor: `var(--ds-background-
|
|
119
|
+
backgroundColor: `var(--ds-background-neutral, ${N20})`,
|
|
121
120
|
opacity: 1
|
|
122
121
|
}
|
|
123
122
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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 {
|
|
4
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
79
|
+
style: theme.mode.navigation,
|
|
80
|
+
css: containerStyles,
|
|
81
|
+
"data-testid": testId
|
|
26
82
|
}, jsx("div", {
|
|
27
|
-
css:
|
|
83
|
+
css: leftStyles
|
|
28
84
|
}, jsx(IconButtonSkeleton, {
|
|
29
85
|
marginLeft: 0,
|
|
30
86
|
marginRight: 5,
|
|
31
|
-
size: gridSize
|
|
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:
|
|
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:
|
|
45
|
-
size: gridSize
|
|
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
|
-
|
|
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:
|
|
17
|
+
css: containerStyles
|
|
10
18
|
}, children, jsx("div", {
|
|
11
|
-
css:
|
|
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 {
|
|
11
|
-
var
|
|
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 '
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
style: theme.mode.skeleton,
|
|
24
|
+
css: [skeletonStyles, mobileStyles]
|
|
12
25
|
}), jsx(IconButtonSkeleton, {
|
|
13
|
-
css:
|
|
14
|
-
size: gridSize
|
|
26
|
+
css: mobileStyles,
|
|
27
|
+
size: gridSize * 3.25
|
|
15
28
|
}));
|
|
16
29
|
};
|