@atlaskit/atlassian-navigation 2.0.4 → 2.1.0
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 +6 -0
- package/dist/cjs/components/Create/index.js +3 -0
- package/dist/cjs/theme/defaultTheme.js +40 -41
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/Create/index.js +3 -0
- package/dist/es2019/theme/defaultTheme.js +40 -41
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/Create/index.js +3 -0
- package/dist/esm/theme/defaultTheme.js +40 -41
- package/dist/esm/version.json +1 -1
- package/dist/types/components/Create/index.d.ts +1 -1
- package/dist/types/components/Create/types.d.ts +5 -1
- package/docs/05-create.tsx +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/atlassian-navigation
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c4e94b64308`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c4e94b64308) - Added a new href prop to the Create button which causes it to be rendered as a link. This is suitable for when the Create action is handled as a full page rather than in a modal-dialog.
|
|
8
|
+
|
|
3
9
|
## 2.0.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -39,6 +39,7 @@ var TooltipSwitch = function TooltipSwitch(_ref) {
|
|
|
39
39
|
|
|
40
40
|
var Create = function Create(_ref2) {
|
|
41
41
|
var onClick = _ref2.onClick,
|
|
42
|
+
href = _ref2.href,
|
|
42
43
|
text = _ref2.text,
|
|
43
44
|
buttonTooltip = _ref2.buttonTooltip,
|
|
44
45
|
iconButtonTooltip = _ref2.iconButtonTooltip,
|
|
@@ -60,6 +61,7 @@ var Create = function Create(_ref2) {
|
|
|
60
61
|
}, (0, _core.jsx)(_customThemeButton.default, {
|
|
61
62
|
id: "createGlobalItem",
|
|
62
63
|
onClick: onClick,
|
|
64
|
+
href: href,
|
|
63
65
|
theme: (0, _styles.getCreateButtonTheme)(theme),
|
|
64
66
|
testId: testId && "".concat(testId, "-button"),
|
|
65
67
|
"data-hide-on-smallscreens": true
|
|
@@ -70,6 +72,7 @@ var Create = function Create(_ref2) {
|
|
|
70
72
|
label: text
|
|
71
73
|
}),
|
|
72
74
|
onClick: onClick,
|
|
75
|
+
href: href,
|
|
73
76
|
tooltip: iconButtonTooltip,
|
|
74
77
|
theme: (0, _styles.getCreateButtonTheme)(theme),
|
|
75
78
|
"aria-label": text,
|
|
@@ -9,28 +9,27 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
9
9
|
|
|
10
10
|
var _themeHelpers = require("./themeHelpers");
|
|
11
11
|
|
|
12
|
-
/* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
|
|
13
12
|
var defaultTheme = {
|
|
14
13
|
mode: {
|
|
15
14
|
create: {
|
|
16
15
|
active: {
|
|
17
|
-
color: "var(--ds-text-
|
|
18
|
-
backgroundColor: "var(--ds-background-
|
|
16
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
|
|
17
|
+
backgroundColor: "var(--ds-background-brand-bold-pressed, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B400, 0.8), ")"),
|
|
19
18
|
boxShadow: ''
|
|
20
19
|
},
|
|
21
20
|
default: {
|
|
22
|
-
color: "var(--ds-text-
|
|
23
|
-
backgroundColor: "var(--ds-background-
|
|
21
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
|
|
22
|
+
backgroundColor: "var(--ds-background-brand-bold, ".concat(_colors.B400, ")"),
|
|
24
23
|
boxShadow: ''
|
|
25
24
|
},
|
|
26
25
|
focus: {
|
|
27
|
-
color: "var(--ds-text-
|
|
28
|
-
backgroundColor: "var(--ds-background-
|
|
29
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
26
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
|
|
27
|
+
backgroundColor: "var(--ds-background-brand-bold, ".concat(_colors.B400, ")"),
|
|
28
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, rgb(128,169,230))")
|
|
30
29
|
},
|
|
31
30
|
hover: {
|
|
32
|
-
color: "var(--ds-text-
|
|
33
|
-
backgroundColor: "var(--ds-background-
|
|
31
|
+
color: "var(--ds-text-inverse, ".concat(_colors.N0, ")"),
|
|
32
|
+
backgroundColor: "var(--ds-background-brand-bold-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B400, 0.9), ")"),
|
|
34
33
|
boxShadow: ''
|
|
35
34
|
},
|
|
36
35
|
selected: {
|
|
@@ -41,39 +40,39 @@ var defaultTheme = {
|
|
|
41
40
|
},
|
|
42
41
|
iconButton: {
|
|
43
42
|
active: {
|
|
44
|
-
color: "var(--ds-text-
|
|
45
|
-
backgroundColor: "var(--ds-background-
|
|
43
|
+
color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
|
|
44
|
+
backgroundColor: "var(--ds-background-neutral-pressed, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.6), ")"),
|
|
46
45
|
boxShadow: ''
|
|
47
46
|
},
|
|
48
47
|
default: {
|
|
49
|
-
color: "var(--ds-text-
|
|
48
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N600, ")"),
|
|
50
49
|
backgroundColor: 'transparent',
|
|
51
50
|
boxShadow: ''
|
|
52
51
|
},
|
|
53
52
|
focus: {
|
|
54
|
-
color: "var(--ds-text-
|
|
55
|
-
backgroundColor: "var(--ds-background-
|
|
56
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
53
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N600, ")"),
|
|
54
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.5), ")"),
|
|
55
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(_colors.B200, ")"))
|
|
57
56
|
},
|
|
58
57
|
hover: {
|
|
59
|
-
color: "var(--ds-text-
|
|
60
|
-
backgroundColor: "var(--ds-background-
|
|
58
|
+
color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
|
|
59
|
+
backgroundColor: "var(--ds-background-neutral-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.9), ")"),
|
|
61
60
|
boxShadow: ''
|
|
62
61
|
},
|
|
63
62
|
selected: {
|
|
64
|
-
color: "var(--ds-text-
|
|
65
|
-
backgroundColor: "var(--ds-background-
|
|
63
|
+
color: "var(--ds-text-brand)",
|
|
64
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
66
65
|
boxShadow: ''
|
|
67
66
|
}
|
|
68
67
|
},
|
|
69
68
|
navigation: {
|
|
70
|
-
backgroundColor: "var(--ds-
|
|
71
|
-
color: "var(--ds-text-
|
|
69
|
+
backgroundColor: "var(--ds-surface, ".concat(_colors.N0, ")"),
|
|
70
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")")
|
|
72
71
|
},
|
|
73
72
|
productHome: {
|
|
74
73
|
backgroundColor: "var(--ds-text-brand, ".concat(_colors.B400, ")"),
|
|
75
|
-
color: "var(--ds-text
|
|
76
|
-
borderRight: "1px solid ".concat("var(--ds-border
|
|
74
|
+
color: "var(--ds-text, ".concat(_colors.N700, ")"),
|
|
75
|
+
borderRight: "1px solid ".concat("var(--ds-border, ".concat((0, _themeHelpers.hexToRGBA)(_colors.N200, 0.3), ")")),
|
|
77
76
|
// TODO: (DSP-1256) These colors should be moved into the Logo package
|
|
78
77
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
79
78
|
iconGradientStart: _colors.B400,
|
|
@@ -84,49 +83,49 @@ var defaultTheme = {
|
|
|
84
83
|
},
|
|
85
84
|
primaryButton: {
|
|
86
85
|
active: {
|
|
87
|
-
color: "var(--ds-text-
|
|
88
|
-
backgroundColor: "var(--ds-background-
|
|
86
|
+
color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
|
|
87
|
+
backgroundColor: "var(--ds-background-neutral-pressed, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.7), ")"),
|
|
89
88
|
boxShadow: ''
|
|
90
89
|
},
|
|
91
90
|
default: {
|
|
92
|
-
color: "var(--ds-text-
|
|
91
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N600, ")"),
|
|
93
92
|
backgroundColor: 'transparent',
|
|
94
93
|
boxShadow: ''
|
|
95
94
|
},
|
|
96
95
|
focus: {
|
|
97
|
-
color: "var(--ds-text-
|
|
96
|
+
color: "var(--ds-text-subtle, ".concat(_colors.N600, ")"),
|
|
98
97
|
backgroundColor: '',
|
|
99
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
98
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(_colors.B200, ")"))
|
|
100
99
|
},
|
|
101
100
|
hover: {
|
|
102
|
-
color: "var(--ds-text-
|
|
103
|
-
backgroundColor: "var(--ds-background-
|
|
101
|
+
color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
|
|
102
|
+
backgroundColor: "var(--ds-background-neutral-hovered, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.9), ")"),
|
|
104
103
|
boxShadow: ''
|
|
105
104
|
},
|
|
106
105
|
selected: {
|
|
107
|
-
color: "var(--ds-text-
|
|
108
|
-
backgroundColor: "var(--ds-background-
|
|
106
|
+
color: "var(--ds-text-subtle, ".concat(_colors.B400, ")"),
|
|
107
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
109
108
|
boxShadow: '',
|
|
110
|
-
borderColor: "var(--ds-
|
|
111
|
-
bordorBottom: "4px solid ".concat("var(--ds-
|
|
109
|
+
borderColor: "var(--ds-border-brand, ".concat(_colors.B400, ")"),
|
|
110
|
+
bordorBottom: "4px solid ".concat("var(--ds-border-brand, ".concat(_colors.B400, ")"))
|
|
112
111
|
}
|
|
113
112
|
},
|
|
114
113
|
search: {
|
|
115
114
|
default: {
|
|
116
|
-
backgroundColor: "var(--ds-
|
|
117
|
-
color: "var(--ds-text-
|
|
118
|
-
borderColor: "var(--ds-border
|
|
115
|
+
backgroundColor: "var(--ds-surface, ".concat(_colors.N0, ")"),
|
|
116
|
+
color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
|
|
117
|
+
borderColor: "var(--ds-border, ".concat(_colors.N40, ")")
|
|
119
118
|
},
|
|
120
119
|
focus: {
|
|
121
|
-
borderColor: "var(--ds-border-
|
|
120
|
+
borderColor: "var(--ds-border-focused, ".concat(_colors.B200, ")")
|
|
122
121
|
},
|
|
123
122
|
hover: {
|
|
124
123
|
color: "var(--ds-text-brand, ".concat(_colors.B400, ")"),
|
|
125
|
-
backgroundColor: "var(--ds-
|
|
124
|
+
backgroundColor: "var(--ds-surface, ".concat((0, _themeHelpers.hexToRGBA)(_colors.B50, 0.9), ")")
|
|
126
125
|
}
|
|
127
126
|
},
|
|
128
127
|
skeleton: {
|
|
129
|
-
backgroundColor: "var(--ds-background-
|
|
128
|
+
backgroundColor: "var(--ds-background-neutral, ".concat(_colors.N20, ")"),
|
|
130
129
|
opacity: 1
|
|
131
130
|
}
|
|
132
131
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -20,6 +20,7 @@ const TooltipSwitch = ({
|
|
|
20
20
|
|
|
21
21
|
export const Create = ({
|
|
22
22
|
onClick,
|
|
23
|
+
href,
|
|
23
24
|
text,
|
|
24
25
|
buttonTooltip,
|
|
25
26
|
iconButtonTooltip,
|
|
@@ -42,6 +43,7 @@ export const Create = ({
|
|
|
42
43
|
}, jsx(Button, {
|
|
43
44
|
id: "createGlobalItem",
|
|
44
45
|
onClick: onClick,
|
|
46
|
+
href: href,
|
|
45
47
|
theme: getCreateButtonTheme(theme),
|
|
46
48
|
testId: testId && `${testId}-button`,
|
|
47
49
|
"data-hide-on-smallscreens": true
|
|
@@ -52,6 +54,7 @@ export const Create = ({
|
|
|
52
54
|
label: text
|
|
53
55
|
}),
|
|
54
56
|
onClick: onClick,
|
|
57
|
+
href: href,
|
|
55
58
|
tooltip: iconButtonTooltip,
|
|
56
59
|
theme: getCreateButtonTheme(theme),
|
|
57
60
|
"aria-label": text,
|
|
@@ -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-brand-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
|
-
color: "var(--ds-text-
|
|
56
|
-
backgroundColor: "var(--ds-background-
|
|
54
|
+
color: "var(--ds-text-brand)",
|
|
55
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
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
|
-
color: `var(--ds-text-
|
|
99
|
-
backgroundColor: "var(--ds-background-
|
|
97
|
+
color: `var(--ds-text-subtle, ${B400})`,
|
|
98
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
100
99
|
boxShadow: '',
|
|
101
|
-
borderColor: `var(--ds-
|
|
102
|
-
bordorBottom: `4px solid ${`var(--ds-
|
|
100
|
+
borderColor: `var(--ds-border-brand, ${B400})`,
|
|
101
|
+
bordorBottom: `4px solid ${`var(--ds-border-brand, ${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
114
|
color: `var(--ds-text-brand, ${B400})`,
|
|
116
|
-
backgroundColor: `var(--ds-
|
|
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
|
@@ -21,6 +21,7 @@ var TooltipSwitch = function TooltipSwitch(_ref) {
|
|
|
21
21
|
|
|
22
22
|
export var Create = function Create(_ref2) {
|
|
23
23
|
var onClick = _ref2.onClick,
|
|
24
|
+
href = _ref2.href,
|
|
24
25
|
text = _ref2.text,
|
|
25
26
|
buttonTooltip = _ref2.buttonTooltip,
|
|
26
27
|
iconButtonTooltip = _ref2.iconButtonTooltip,
|
|
@@ -42,6 +43,7 @@ export var Create = function Create(_ref2) {
|
|
|
42
43
|
}, jsx(Button, {
|
|
43
44
|
id: "createGlobalItem",
|
|
44
45
|
onClick: onClick,
|
|
46
|
+
href: href,
|
|
45
47
|
theme: getCreateButtonTheme(theme),
|
|
46
48
|
testId: testId && "".concat(testId, "-button"),
|
|
47
49
|
"data-hide-on-smallscreens": true
|
|
@@ -52,6 +54,7 @@ export var Create = function Create(_ref2) {
|
|
|
52
54
|
label: text
|
|
53
55
|
}),
|
|
54
56
|
onClick: onClick,
|
|
57
|
+
href: href,
|
|
55
58
|
tooltip: iconButtonTooltip,
|
|
56
59
|
theme: getCreateButtonTheme(theme),
|
|
57
60
|
"aria-label": text,
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
/* eslint-disable @atlaskit/design-system/no-unsafe-design-token-usage */
|
|
2
1
|
import { B200, B400, B50, N0, N20, N200, N40, N600, N700 } from '@atlaskit/theme/colors';
|
|
3
2
|
import { hexToRGBA } from './themeHelpers';
|
|
4
3
|
var defaultTheme = {
|
|
5
4
|
mode: {
|
|
6
5
|
create: {
|
|
7
6
|
active: {
|
|
8
|
-
color: "var(--ds-text-
|
|
9
|
-
backgroundColor: "var(--ds-background-
|
|
7
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")"),
|
|
8
|
+
backgroundColor: "var(--ds-background-brand-bold-pressed, ".concat(hexToRGBA(B400, 0.8), ")"),
|
|
10
9
|
boxShadow: ''
|
|
11
10
|
},
|
|
12
11
|
default: {
|
|
13
|
-
color: "var(--ds-text-
|
|
14
|
-
backgroundColor: "var(--ds-background-
|
|
12
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")"),
|
|
13
|
+
backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
|
|
15
14
|
boxShadow: ''
|
|
16
15
|
},
|
|
17
16
|
focus: {
|
|
18
|
-
color: "var(--ds-text-
|
|
19
|
-
backgroundColor: "var(--ds-background-
|
|
20
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
17
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")"),
|
|
18
|
+
backgroundColor: "var(--ds-background-brand-bold, ".concat(B400, ")"),
|
|
19
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, rgb(128,169,230))")
|
|
21
20
|
},
|
|
22
21
|
hover: {
|
|
23
|
-
color: "var(--ds-text-
|
|
24
|
-
backgroundColor: "var(--ds-background-
|
|
22
|
+
color: "var(--ds-text-inverse, ".concat(N0, ")"),
|
|
23
|
+
backgroundColor: "var(--ds-background-brand-bold-hovered, ".concat(hexToRGBA(B400, 0.9), ")"),
|
|
25
24
|
boxShadow: ''
|
|
26
25
|
},
|
|
27
26
|
selected: {
|
|
@@ -32,39 +31,39 @@ var defaultTheme = {
|
|
|
32
31
|
},
|
|
33
32
|
iconButton: {
|
|
34
33
|
active: {
|
|
35
|
-
color: "var(--ds-text-
|
|
36
|
-
backgroundColor: "var(--ds-background-
|
|
34
|
+
color: "var(--ds-text-subtle, ".concat(B400, ")"),
|
|
35
|
+
backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.6), ")"),
|
|
37
36
|
boxShadow: ''
|
|
38
37
|
},
|
|
39
38
|
default: {
|
|
40
|
-
color: "var(--ds-text-
|
|
39
|
+
color: "var(--ds-text-subtle, ".concat(N600, ")"),
|
|
41
40
|
backgroundColor: 'transparent',
|
|
42
41
|
boxShadow: ''
|
|
43
42
|
},
|
|
44
43
|
focus: {
|
|
45
|
-
color: "var(--ds-text-
|
|
46
|
-
backgroundColor: "var(--ds-background-
|
|
47
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
44
|
+
color: "var(--ds-text-subtle, ".concat(N600, ")"),
|
|
45
|
+
backgroundColor: "var(--ds-background-brand-hovered, ".concat(hexToRGBA(B50, 0.5), ")"),
|
|
46
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
|
|
48
47
|
},
|
|
49
48
|
hover: {
|
|
50
|
-
color: "var(--ds-text-
|
|
51
|
-
backgroundColor: "var(--ds-background-
|
|
49
|
+
color: "var(--ds-text-subtle, ".concat(B400, ")"),
|
|
50
|
+
backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
|
|
52
51
|
boxShadow: ''
|
|
53
52
|
},
|
|
54
53
|
selected: {
|
|
55
|
-
color: "var(--ds-text-
|
|
56
|
-
backgroundColor: "var(--ds-background-
|
|
54
|
+
color: "var(--ds-text-brand)",
|
|
55
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
57
56
|
boxShadow: ''
|
|
58
57
|
}
|
|
59
58
|
},
|
|
60
59
|
navigation: {
|
|
61
|
-
backgroundColor: "var(--ds-
|
|
62
|
-
color: "var(--ds-text-
|
|
60
|
+
backgroundColor: "var(--ds-surface, ".concat(N0, ")"),
|
|
61
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")")
|
|
63
62
|
},
|
|
64
63
|
productHome: {
|
|
65
64
|
backgroundColor: "var(--ds-text-brand, ".concat(B400, ")"),
|
|
66
|
-
color: "var(--ds-text
|
|
67
|
-
borderRight: "1px solid ".concat("var(--ds-border
|
|
65
|
+
color: "var(--ds-text, ".concat(N700, ")"),
|
|
66
|
+
borderRight: "1px solid ".concat("var(--ds-border, ".concat(hexToRGBA(N200, 0.3), ")")),
|
|
68
67
|
// TODO: (DSP-1256) These colors should be moved into the Logo package
|
|
69
68
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
70
69
|
iconGradientStart: B400,
|
|
@@ -75,49 +74,49 @@ var defaultTheme = {
|
|
|
75
74
|
},
|
|
76
75
|
primaryButton: {
|
|
77
76
|
active: {
|
|
78
|
-
color: "var(--ds-text-
|
|
79
|
-
backgroundColor: "var(--ds-background-
|
|
77
|
+
color: "var(--ds-text-subtle, ".concat(B400, ")"),
|
|
78
|
+
backgroundColor: "var(--ds-background-neutral-pressed, ".concat(hexToRGBA(B50, 0.7), ")"),
|
|
80
79
|
boxShadow: ''
|
|
81
80
|
},
|
|
82
81
|
default: {
|
|
83
|
-
color: "var(--ds-text-
|
|
82
|
+
color: "var(--ds-text-subtle, ".concat(N600, ")"),
|
|
84
83
|
backgroundColor: 'transparent',
|
|
85
84
|
boxShadow: ''
|
|
86
85
|
},
|
|
87
86
|
focus: {
|
|
88
|
-
color: "var(--ds-text-
|
|
87
|
+
color: "var(--ds-text-subtle, ".concat(N600, ")"),
|
|
89
88
|
backgroundColor: '',
|
|
90
|
-
boxShadow: "0 0 0 2px ".concat("var(--ds-border-
|
|
89
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B200, ")"))
|
|
91
90
|
},
|
|
92
91
|
hover: {
|
|
93
|
-
color: "var(--ds-text-
|
|
94
|
-
backgroundColor: "var(--ds-background-
|
|
92
|
+
color: "var(--ds-text-subtle, ".concat(B400, ")"),
|
|
93
|
+
backgroundColor: "var(--ds-background-neutral-hovered, ".concat(hexToRGBA(B50, 0.9), ")"),
|
|
95
94
|
boxShadow: ''
|
|
96
95
|
},
|
|
97
96
|
selected: {
|
|
98
|
-
color: "var(--ds-text-
|
|
99
|
-
backgroundColor: "var(--ds-background-
|
|
97
|
+
color: "var(--ds-text-subtle, ".concat(B400, ")"),
|
|
98
|
+
backgroundColor: "var(--ds-background-brand)",
|
|
100
99
|
boxShadow: '',
|
|
101
|
-
borderColor: "var(--ds-
|
|
102
|
-
bordorBottom: "4px solid ".concat("var(--ds-
|
|
100
|
+
borderColor: "var(--ds-border-brand, ".concat(B400, ")"),
|
|
101
|
+
bordorBottom: "4px solid ".concat("var(--ds-border-brand, ".concat(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, ".concat(N0, ")"),
|
|
107
|
+
color: "var(--ds-text-subtlest, ".concat(N200, ")"),
|
|
108
|
+
borderColor: "var(--ds-border, ".concat(N40, ")")
|
|
110
109
|
},
|
|
111
110
|
focus: {
|
|
112
|
-
borderColor: "var(--ds-border-
|
|
111
|
+
borderColor: "var(--ds-border-focused, ".concat(B200, ")")
|
|
113
112
|
},
|
|
114
113
|
hover: {
|
|
115
114
|
color: "var(--ds-text-brand, ".concat(B400, ")"),
|
|
116
|
-
backgroundColor: "var(--ds-
|
|
115
|
+
backgroundColor: "var(--ds-surface, ".concat(hexToRGBA(B50, 0.9), ")")
|
|
117
116
|
}
|
|
118
117
|
},
|
|
119
118
|
skeleton: {
|
|
120
|
-
backgroundColor: "var(--ds-background-
|
|
119
|
+
backgroundColor: "var(--ds-background-neutral, ".concat(N20, ")"),
|
|
121
120
|
opacity: 1
|
|
122
121
|
}
|
|
123
122
|
}
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CreateProps } from './types';
|
|
3
|
-
export declare const Create: ({ onClick, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
|
|
3
|
+
export declare const Create: ({ onClick, href, text, buttonTooltip, iconButtonTooltip, testId, }: CreateProps) => JSX.Element;
|
|
4
4
|
export default Create;
|
|
@@ -16,7 +16,11 @@ export interface CreateProps {
|
|
|
16
16
|
* Click handler.
|
|
17
17
|
* See @atlaskit/analytics-next for analyticsEvent type information
|
|
18
18
|
*/
|
|
19
|
-
onClick
|
|
19
|
+
onClick?: (e: React.MouseEvent<HTMLElement>, analyticsEvent: any) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Causes the Create action to be rendered as a link. This is suitable for when the Create action is handled as a full page rather than in a modal-dialog.
|
|
22
|
+
*/
|
|
23
|
+
href?: string;
|
|
20
24
|
/**
|
|
21
25
|
* A `testId` prop is provided for specified elements,
|
|
22
26
|
* which is a unique string that appears as a data attribute `data-testid` in the rendered code,
|
package/docs/05-create.tsx
CHANGED
|
@@ -20,6 +20,14 @@ import { Create } from '@atlaskit/atlassian-navigation';
|
|
|
20
20
|
/>
|
|
21
21
|
)}
|
|
22
22
|
|
|
23
|
+
${(
|
|
24
|
+
<Example
|
|
25
|
+
title="Create as a link"
|
|
26
|
+
Component={require('../examples/create-with-link.tsx').default}
|
|
27
|
+
source={require('!!raw-loader!../examples/create-with-link.tsx')}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
30
|
+
|
|
23
31
|
${(
|
|
24
32
|
<Props
|
|
25
33
|
heading="Props"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/atlassian-navigation",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A horizontal navigation component for Atlassian products.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/analytics-namespaced-context": "^6.
|
|
26
|
+
"@atlaskit/analytics-namespaced-context": "^6.4.0",
|
|
27
27
|
"@atlaskit/button": "^16.0.0",
|
|
28
28
|
"@atlaskit/icon": "^21.10.0",
|
|
29
29
|
"@atlaskit/logo": "*",
|