@atlaskit/atlassian-navigation 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -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 +21 -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/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 +26 -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/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 +22 -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/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/styles.d.ts +0 -923
- 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/99-migrating-from-navigation-next.tsx +31 -32
- package/package.json +7 -3
- 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
|
@@ -11,26 +11,65 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
14
16
|
var _react = require("react");
|
|
15
17
|
|
|
16
18
|
var _core = require("@emotion/core");
|
|
17
19
|
|
|
18
20
|
var _search = _interopRequireDefault(require("@atlaskit/icon/glyph/search"));
|
|
19
21
|
|
|
22
|
+
var _constants = require("../../common/constants");
|
|
23
|
+
|
|
20
24
|
var _theme = require("../../theme");
|
|
21
25
|
|
|
22
26
|
var _IconButton = require("../IconButton");
|
|
23
27
|
|
|
24
|
-
var _styles = require("./styles");
|
|
25
|
-
|
|
26
28
|
var _excluded = ["placeholder", "tooltip", "label", "value"];
|
|
27
29
|
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
33
|
+
|
|
34
|
+
var searchInputContainerStyles = (0, _core.css)((0, _defineProperty2.default)({
|
|
35
|
+
marginRight: _constants.gridSize,
|
|
36
|
+
marginLeft: 20,
|
|
37
|
+
position: 'relative'
|
|
38
|
+
}, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
|
|
39
|
+
display: 'none !important'
|
|
40
|
+
}));
|
|
41
|
+
var searchInputIconStyles = (0, _core.css)({
|
|
42
|
+
width: '20px',
|
|
43
|
+
height: '20px',
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
top: '5px',
|
|
46
|
+
left: '10px',
|
|
47
|
+
pointerEvents: 'none'
|
|
48
|
+
});
|
|
49
|
+
var searchInputStyles = (0, _core.css)({
|
|
50
|
+
boxSizing: 'border-box',
|
|
51
|
+
width: '220px',
|
|
52
|
+
height: "".concat(_constants.gridSize * 4, "px"),
|
|
53
|
+
padding: "0 ".concat(_constants.gridSize, "px 0 40px"),
|
|
54
|
+
border: '2px solid',
|
|
55
|
+
borderRadius: 6,
|
|
56
|
+
fontSize: "".concat(_constants.fontSize, "px"),
|
|
57
|
+
outline: 'none',
|
|
58
|
+
'::placeholder': {
|
|
59
|
+
color: 'inherit'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var searchIconStyles = (0, _core.css)((0, _defineProperty2.default)({}, "@media (min-width: ".concat(_constants.CREATE_BREAKPOINT, "px)"), {
|
|
63
|
+
display: 'none !important'
|
|
64
|
+
}));
|
|
65
|
+
|
|
28
66
|
var SearchComponent = function SearchComponent(props) {
|
|
29
67
|
var onClick = props.onClick,
|
|
30
68
|
placeholder = props.placeholder,
|
|
31
69
|
label = props.label,
|
|
32
70
|
value = props.value;
|
|
33
71
|
var theme = (0, _theme.useTheme)();
|
|
72
|
+
var search = theme.mode.search;
|
|
34
73
|
|
|
35
74
|
var onChange = function onChange() {
|
|
36
75
|
// @ts-ignore
|
|
@@ -42,15 +81,20 @@ var SearchComponent = function SearchComponent(props) {
|
|
|
42
81
|
onClick && onClick.apply(void 0, arguments);
|
|
43
82
|
};
|
|
44
83
|
|
|
84
|
+
var searchInputDynamicStyles = _objectSpread(_objectSpread({}, search.default), {}, {
|
|
85
|
+
':focus': search.focus
|
|
86
|
+
});
|
|
87
|
+
|
|
45
88
|
return (0, _core.jsx)("div", {
|
|
46
|
-
css:
|
|
89
|
+
css: searchInputContainerStyles,
|
|
47
90
|
role: "search"
|
|
48
91
|
}, (0, _core.jsx)("div", {
|
|
49
|
-
css:
|
|
92
|
+
css: searchInputIconStyles
|
|
50
93
|
}, (0, _core.jsx)(_search.default, {
|
|
51
94
|
label: ""
|
|
52
95
|
})), (0, _core.jsx)("input", {
|
|
53
|
-
|
|
96
|
+
style: searchInputDynamicStyles,
|
|
97
|
+
css: searchInputStyles,
|
|
54
98
|
"aria-label": label,
|
|
55
99
|
placeholder: placeholder,
|
|
56
100
|
onChange: onChange,
|
|
@@ -71,7 +115,7 @@ var Search = function Search(props) {
|
|
|
71
115
|
label: label,
|
|
72
116
|
value: value || ''
|
|
73
117
|
}), (0, _core.jsx)(_IconButton.IconButton, (0, _extends2.default)({
|
|
74
|
-
css:
|
|
118
|
+
css: searchIconStyles,
|
|
75
119
|
icon: (0, _core.jsx)(_search.default, {
|
|
76
120
|
label: label
|
|
77
121
|
}),
|
|
@@ -1,33 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.SearchSkeleton = void 0;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
8
12
|
var _react = require("react");
|
|
9
13
|
|
|
10
14
|
var _core = require("@emotion/core");
|
|
11
15
|
|
|
12
|
-
var _constants = require("
|
|
16
|
+
var _constants = require("../../common/constants");
|
|
13
17
|
|
|
14
18
|
var _theme = require("../../theme");
|
|
15
19
|
|
|
16
20
|
var _skeleton = require("../IconButton/skeleton");
|
|
17
21
|
|
|
18
|
-
var _styles = require("./styles");
|
|
19
|
-
|
|
20
22
|
/** @jsx jsx */
|
|
23
|
+
var searchInputContainerStyles = (0, _core.css)((0, _defineProperty2.default)({
|
|
24
|
+
marginRight: _constants.gridSize,
|
|
25
|
+
marginLeft: 20,
|
|
26
|
+
position: 'relative'
|
|
27
|
+
}, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
|
|
28
|
+
display: 'none !important'
|
|
29
|
+
}));
|
|
30
|
+
var searchInputSkeletonStyles = (0, _core.css)({
|
|
31
|
+
boxSizing: 'border-box',
|
|
32
|
+
width: '220px',
|
|
33
|
+
height: "".concat(_constants.gridSize * 4, "px"),
|
|
34
|
+
padding: "0 ".concat(_constants.gridSize, "px 0 40px"),
|
|
35
|
+
borderRadius: 6,
|
|
36
|
+
opacity: 0.15
|
|
37
|
+
});
|
|
38
|
+
var searchIconStyles = (0, _core.css)((0, _defineProperty2.default)({}, "@media (min-width: ".concat(_constants.CREATE_BREAKPOINT, "px)"), {
|
|
39
|
+
display: 'none !important'
|
|
40
|
+
}));
|
|
41
|
+
|
|
21
42
|
var SearchSkeleton = function SearchSkeleton() {
|
|
22
43
|
var theme = (0, _theme.useTheme)();
|
|
23
44
|
return (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)("div", {
|
|
24
|
-
css:
|
|
45
|
+
css: searchInputContainerStyles
|
|
25
46
|
}, (0, _core.jsx)("div", {
|
|
26
|
-
|
|
47
|
+
style: theme.mode.skeleton,
|
|
48
|
+
css: searchInputSkeletonStyles
|
|
27
49
|
})), (0, _core.jsx)(_skeleton.IconButtonSkeleton, {
|
|
28
|
-
css:
|
|
50
|
+
css: searchIconStyles,
|
|
29
51
|
marginRight: 5,
|
|
30
|
-
size:
|
|
52
|
+
size: _constants.gridSize * 3.25
|
|
31
53
|
}));
|
|
32
54
|
};
|
|
33
55
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,15 +9,35 @@ var _core = require("@emotion/core");
|
|
|
11
9
|
|
|
12
10
|
var _theme = require("../../theme");
|
|
13
11
|
|
|
14
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
|
-
|
|
16
12
|
/** @jsx jsx */
|
|
13
|
+
var skeletonCreateButtonStyles = (0, _core.css)({
|
|
14
|
+
height: 32,
|
|
15
|
+
padding: '0 12px',
|
|
16
|
+
alignSelf: 'center',
|
|
17
|
+
border: 0,
|
|
18
|
+
borderRadius: 3,
|
|
19
|
+
fontSize: 14,
|
|
20
|
+
fontWeight: 500,
|
|
21
|
+
lineHeight: 1,
|
|
22
|
+
pointerEvents: 'none',
|
|
23
|
+
':focus, :active, :hover': {
|
|
24
|
+
appearance: 'none',
|
|
25
|
+
border: 0,
|
|
26
|
+
outline: 0
|
|
27
|
+
},
|
|
28
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
29
|
+
'&&': {
|
|
30
|
+
marginLeft: 12
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
17
34
|
var SkeletonCreateButton = function SkeletonCreateButton(_ref) {
|
|
18
35
|
var text = _ref.text,
|
|
19
36
|
testId = _ref.testId;
|
|
20
37
|
var theme = (0, _theme.useTheme)();
|
|
21
38
|
return (0, _core.jsx)("button", {
|
|
22
|
-
|
|
39
|
+
style: theme.mode.create.default,
|
|
40
|
+
css: skeletonCreateButtonStyles,
|
|
23
41
|
"data-testid": testId
|
|
24
42
|
}, text);
|
|
25
43
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -11,16 +9,43 @@ var _core = require("@emotion/core");
|
|
|
11
9
|
|
|
12
10
|
var _theme = require("../../theme");
|
|
13
11
|
|
|
14
|
-
var _styles = _interopRequireDefault(require("./styles"));
|
|
15
|
-
|
|
16
12
|
/** @jsx jsx */
|
|
13
|
+
var skeletonIconButtonStyles = (0, _core.css)({
|
|
14
|
+
margin: 0,
|
|
15
|
+
marginRight: 4,
|
|
16
|
+
padding: '4px 6px',
|
|
17
|
+
border: 0,
|
|
18
|
+
borderRadius: '100%',
|
|
19
|
+
pointerEvents: 'none',
|
|
20
|
+
':focus, :active, :hover': {
|
|
21
|
+
appearance: 'none',
|
|
22
|
+
border: 0,
|
|
23
|
+
outline: 0
|
|
24
|
+
},
|
|
25
|
+
'&:only-of-type': {
|
|
26
|
+
marginRight: 0
|
|
27
|
+
},
|
|
28
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
29
|
+
'& > span': {
|
|
30
|
+
lineHeight: 'normal'
|
|
31
|
+
},
|
|
32
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
33
|
+
'& > img': {
|
|
34
|
+
width: 24,
|
|
35
|
+
height: 24,
|
|
36
|
+
borderRadius: '100%',
|
|
37
|
+
verticalAlign: 'middle'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
17
41
|
var SkeletonIconButton = function SkeletonIconButton(_ref) {
|
|
18
42
|
var children = _ref.children,
|
|
19
43
|
testId = _ref.testId;
|
|
20
44
|
var theme = (0, _theme.useTheme)();
|
|
21
45
|
return (0, _core.jsx)("button", {
|
|
46
|
+
style: theme.mode.iconButton.default,
|
|
22
47
|
"data-testid": testId,
|
|
23
|
-
css:
|
|
48
|
+
css: skeletonIconButtonStyles
|
|
24
49
|
}, children);
|
|
25
50
|
};
|
|
26
51
|
|
|
@@ -7,14 +7,83 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.SkeletonPrimaryButton = void 0;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
10
12
|
var _core = require("@emotion/core");
|
|
11
13
|
|
|
12
14
|
var _theme = require("../../theme");
|
|
13
15
|
|
|
14
|
-
var
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
+
|
|
18
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
19
|
+
|
|
20
|
+
var VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR = '--primary-button-before-highlighted-background-color';
|
|
21
|
+
var VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR = '--primary-button-after-dropdown-border-color';
|
|
22
|
+
var primaryButtonSkeletonStyles = (0, _core.css)({
|
|
23
|
+
margin: '0 6px',
|
|
24
|
+
padding: '0 4px',
|
|
25
|
+
position: 'relative',
|
|
26
|
+
appearance: 'none',
|
|
27
|
+
border: 0,
|
|
28
|
+
fontSize: 14,
|
|
29
|
+
fontWeight: 500,
|
|
30
|
+
lineHeight: 1,
|
|
31
|
+
pointerEvents: 'none',
|
|
32
|
+
':focus, :active, :hover': {
|
|
33
|
+
appearance: 'none',
|
|
34
|
+
border: 0,
|
|
35
|
+
outline: 0
|
|
36
|
+
},
|
|
37
|
+
'::-moz-focus-inner': {
|
|
38
|
+
border: 0
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
var isHighlightedStyles = (0, _core.css)({
|
|
42
|
+
'&:before': {
|
|
43
|
+
height: 3,
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
bottom: 0,
|
|
46
|
+
left: 2,
|
|
47
|
+
backgroundColor: "var(".concat(VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, ")"),
|
|
48
|
+
borderTopLeftRadius: 1,
|
|
49
|
+
borderTopRightRadius: 1,
|
|
50
|
+
content: '""'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var isHighlightedAndDropdownButtonStyles = (0, _core.css)({
|
|
54
|
+
'&:before': {
|
|
55
|
+
right: -10
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var isHighlightedNotDropdownButtonStyles = (0, _core.css)({
|
|
59
|
+
'&:before': {
|
|
60
|
+
right: 2
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var isDropdownButtonStyles = (0, _core.css)({
|
|
64
|
+
marginRight: 18,
|
|
65
|
+
'&:after': {
|
|
66
|
+
display: 'inline-block',
|
|
67
|
+
width: 4,
|
|
68
|
+
height: 4,
|
|
69
|
+
marginLeft: 4,
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
top: 'calc(50% - 4px)',
|
|
72
|
+
left: 'calc(100% - 3px)',
|
|
73
|
+
borderBottom: '2px solid',
|
|
74
|
+
borderColor: "var(".concat(VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, ")"),
|
|
75
|
+
borderRadius: 1,
|
|
76
|
+
borderRight: '2px solid',
|
|
77
|
+
content: '""',
|
|
78
|
+
opacity: 0.51,
|
|
79
|
+
transform: 'rotate(45deg) scale(1.05)',
|
|
80
|
+
verticalAlign: 'middle'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
15
83
|
|
|
16
|
-
/** @jsx jsx */
|
|
17
84
|
var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
|
|
85
|
+
var _objectSpread2;
|
|
86
|
+
|
|
18
87
|
var _ref$isDropdownButton = _ref.isDropdownButton,
|
|
19
88
|
isDropdownButton = _ref$isDropdownButton === void 0 ? false : _ref$isDropdownButton,
|
|
20
89
|
_ref$isHighlighted = _ref.isHighlighted,
|
|
@@ -23,8 +92,15 @@ var SkeletonPrimaryButton = function SkeletonPrimaryButton(_ref) {
|
|
|
23
92
|
children = _ref.children,
|
|
24
93
|
testId = _ref.testId;
|
|
25
94
|
var theme = (0, _theme.useTheme)();
|
|
95
|
+
var primaryButton = theme.mode.primaryButton;
|
|
96
|
+
|
|
97
|
+
var dynamicStyles = _objectSpread(_objectSpread(_objectSpread({}, primaryButton.default), isHighlighted && {
|
|
98
|
+
color: primaryButton.selected.color
|
|
99
|
+
}), {}, (_objectSpread2 = {}, (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_BEFORE_HIGHLIGHTED_BACKGROUND_COLOR, primaryButton.selected.borderColor), (0, _defineProperty2.default)(_objectSpread2, VAR_PRIMARY_BUTTON_AFTER_DROPDOWN_BORDER_COLOR, isHighlighted ? primaryButton.default.borderColor : primaryButton.default.color), _objectSpread2));
|
|
100
|
+
|
|
26
101
|
return (0, _core.jsx)("button", {
|
|
27
|
-
|
|
102
|
+
style: dynamicStyles,
|
|
103
|
+
css: [primaryButtonSkeletonStyles, isHighlighted && isHighlightedStyles, isDropdownButton && isDropdownButtonStyles, isHighlighted && (isDropdownButton ? isHighlightedAndDropdownButtonStyles : isHighlightedNotDropdownButtonStyles)],
|
|
28
104
|
"data-testid": testId
|
|
29
105
|
}, text || children);
|
|
30
106
|
};
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { fontSize as getFontSize, gridSize as getGridSize } from '@atlaskit/theme/constants';
|
|
2
|
+
export const gridSize = getGridSize();
|
|
3
|
+
export const buttonHeight = gridSize * 4;
|
|
4
|
+
export const fontSize = getFontSize();
|
|
1
5
|
export const HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
|
|
2
6
|
export const PRODUCT_HOME_BREAKPOINT = 1280;
|
|
3
7
|
export const 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
|
+
const 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 ${"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, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
36
|
+
N900, 0)} 4px)`,
|
|
37
|
+
content: '""'
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const 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
|
+
const 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
|
const analyticsData = {
|
|
8
62
|
attributes: {
|
|
9
63
|
navigationLayer: 'global'
|
|
@@ -32,11 +86,12 @@ export const AtlassianNavigation = props => {
|
|
|
32
86
|
}, jsx(NavigationAnalyticsContext, {
|
|
33
87
|
data: analyticsData
|
|
34
88
|
}, jsx("header", {
|
|
35
|
-
|
|
89
|
+
style: theme.mode.navigation,
|
|
90
|
+
css: containerStyles,
|
|
36
91
|
"data-testid": testId && `${testId}-header`,
|
|
37
92
|
role: "banner"
|
|
38
93
|
}, jsx("nav", {
|
|
39
|
-
css:
|
|
94
|
+
css: leftStyles,
|
|
40
95
|
"aria-label": label
|
|
41
96
|
}, AppSwitcher && jsx(AppSwitcher, null), ProductHome && jsx(ProductHome, null), jsx(PrimaryItemsContainer, {
|
|
42
97
|
testId: testId,
|
|
@@ -45,7 +100,7 @@ export const AtlassianNavigation = props => {
|
|
|
45
100
|
create: create,
|
|
46
101
|
theme: theme
|
|
47
102
|
})), jsx("div", {
|
|
48
|
-
css:
|
|
103
|
+
css: rightStyles,
|
|
49
104
|
"data-testid": testId && `${testId}-secondary-actions`
|
|
50
105
|
}, Search && jsx(Search, null), Notifications && jsx(Notifications, null), Help && jsx(Help, null), Settings && jsx(Settings, null), SignIn && jsx(SignIn, null), Profile && jsx(Profile, null)))));
|
|
51
106
|
};
|
|
@@ -1,42 +1,98 @@
|
|
|
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
|
+
const 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 ${"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, ${N40A} 0, ${N40A} 1px, ${N30A} 1px, ${hexToRGBA( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
39
|
+
N900, 0)} 4px)`,
|
|
40
|
+
content: '""'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const 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
|
+
const 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 const NavigationSkeleton = ({
|
|
12
65
|
primaryItemsCount = 4,
|
|
13
66
|
secondaryItemsCount = 4,
|
|
14
67
|
theme = defaultTheme,
|
|
15
68
|
showSiteName = false,
|
|
16
|
-
shouldShowSearch = true
|
|
69
|
+
shouldShowSearch = true,
|
|
70
|
+
testId
|
|
17
71
|
}) => {
|
|
18
72
|
return jsx(ThemeProvider, {
|
|
19
73
|
value: theme
|
|
20
74
|
}, jsx("div", {
|
|
21
|
-
|
|
75
|
+
style: theme.mode.navigation,
|
|
76
|
+
css: containerStyles,
|
|
77
|
+
"data-testid": testId
|
|
22
78
|
}, jsx("div", {
|
|
23
|
-
css:
|
|
79
|
+
css: leftStyles
|
|
24
80
|
}, jsx(IconButtonSkeleton, {
|
|
25
81
|
marginLeft: 0,
|
|
26
82
|
marginRight: 5,
|
|
27
|
-
size: gridSize
|
|
83
|
+
size: gridSize * 3.25
|
|
28
84
|
}), jsx(ProductHomeSkeleton, {
|
|
29
85
|
showSiteName: showSiteName
|
|
30
86
|
}), jsx(PrimaryItemsContainerSkeleton, {
|
|
31
87
|
count: primaryItemsCount
|
|
32
88
|
})), jsx("div", {
|
|
33
|
-
css:
|
|
89
|
+
css: rightStyles
|
|
34
90
|
}, shouldShowSearch && jsx(SearchSkeleton, null), Array.from({
|
|
35
91
|
length: secondaryItemsCount
|
|
36
92
|
}, (_, index) => jsx(IconButtonSkeleton, {
|
|
37
93
|
key: index,
|
|
38
94
|
marginLeft: 0,
|
|
39
|
-
marginRight:
|
|
40
|
-
size: gridSize
|
|
95
|
+
marginRight: gridSize / 2,
|
|
96
|
+
size: gridSize * 3.25
|
|
41
97
|
})), jsx(ProfileSkeleton, null))));
|
|
42
98
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/core';
|
|
3
|
-
|
|
2
|
+
import { css, jsx } from '@emotion/core';
|
|
3
|
+
const badgeContainerStyles = css({
|
|
4
|
+
position: 'absolute',
|
|
5
|
+
top: '-4px',
|
|
6
|
+
right: '-2px',
|
|
7
|
+
pointerEvents: 'none'
|
|
8
|
+
});
|
|
9
|
+
const containerStyles = css({
|
|
10
|
+
position: 'relative'
|
|
11
|
+
});
|
|
4
12
|
export const BadgeContainer = props => {
|
|
5
13
|
const {
|
|
6
14
|
id: badgeId,
|
|
@@ -8,9 +16,9 @@ export const BadgeContainer = props => {
|
|
|
8
16
|
children
|
|
9
17
|
} = props;
|
|
10
18
|
return jsx("div", {
|
|
11
|
-
css:
|
|
19
|
+
css: containerStyles
|
|
12
20
|
}, children, jsx("div", {
|
|
13
|
-
css:
|
|
21
|
+
css: badgeContainerStyles,
|
|
14
22
|
id: badgeId,
|
|
15
23
|
"aria-hidden": true
|
|
16
24
|
}, jsx(Badge, null)));
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { Fragment } from 'react';
|
|
3
|
-
import { jsx } from '@emotion/core';
|
|
3
|
+
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
5
5
|
import AddIcon from '@atlaskit/icon/glyph/editor/add';
|
|
6
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
|
+
import { CREATE_BREAKPOINT, gridSize } from '../../common/constants';
|
|
8
8
|
import { useTheme } from '../../theme';
|
|
9
9
|
import { IconButton } from '../IconButton';
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
10
|
+
import { getCreateButtonTheme } from './styles';
|
|
11
|
+
const wrapperStyles = css({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
15
|
+
'& [data-hide-on-smallscreens]': {
|
|
16
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
17
|
+
[`@media (max-width: ${CREATE_BREAKPOINT - 1}px)`]: {
|
|
18
|
+
display: 'none !important'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
22
|
+
'& [data-hide-on-largescreens]': {
|
|
23
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
24
|
+
[`@media (min-width: ${CREATE_BREAKPOINT}px)`]: {
|
|
25
|
+
display: 'none !important'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
29
|
+
'&&': {
|
|
30
|
+
marginLeft: gridSize * 1.5
|
|
31
|
+
}
|
|
32
|
+
});
|
|
12
33
|
|
|
13
34
|
const TooltipSwitch = ({
|
|
14
35
|
buttonTooltip,
|
|
@@ -28,15 +49,7 @@ export const Create = ({
|
|
|
28
49
|
}) => {
|
|
29
50
|
const theme = useTheme();
|
|
30
51
|
return jsx("div", {
|
|
31
|
-
css:
|
|
32
|
-
display: 'flex',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
'&&': {
|
|
35
|
-
marginLeft: grid * 1.5
|
|
36
|
-
},
|
|
37
|
-
'& [data-hide-on-smallscreens]': createButtonCSS,
|
|
38
|
-
'& [data-hide-on-largescreens]': createIconCSS
|
|
39
|
-
},
|
|
52
|
+
css: wrapperStyles,
|
|
40
53
|
"data-testid": "create-button-wrapper"
|
|
41
54
|
}, jsx(TooltipSwitch, {
|
|
42
55
|
buttonTooltip: buttonTooltip
|