@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/atlassian-navigation
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`faee2b4ee52`](https://bitbucket.org/atlassian/atlassian-frontend/commits/faee2b4ee52) - Rewrite dynamic styles to be static to aid compiled migration.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 2.1.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -3,7 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.PRODUCT_HOME_BREAKPOINT = exports.HORIZONTAL_GLOBAL_NAV_HEIGHT = exports.CREATE_BREAKPOINT = void 0;
|
|
6
|
+
exports.gridSize = exports.fontSize = exports.buttonHeight = exports.PRODUCT_HOME_BREAKPOINT = exports.HORIZONTAL_GLOBAL_NAV_HEIGHT = exports.CREATE_BREAKPOINT = void 0;
|
|
7
|
+
|
|
8
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
9
|
+
|
|
10
|
+
var gridSize = (0, _constants.gridSize)();
|
|
11
|
+
exports.gridSize = gridSize;
|
|
12
|
+
var buttonHeight = gridSize * 4;
|
|
13
|
+
exports.buttonHeight = buttonHeight;
|
|
14
|
+
var fontSize = (0, _constants.fontSize)();
|
|
15
|
+
exports.fontSize = fontSize;
|
|
7
16
|
var HORIZONTAL_GLOBAL_NAV_HEIGHT = 56;
|
|
8
17
|
exports.HORIZONTAL_GLOBAL_NAV_HEIGHT = HORIZONTAL_GLOBAL_NAV_HEIGHT;
|
|
9
18
|
var PRODUCT_HOME_BREAKPOINT = 1280;
|
|
@@ -9,13 +9,68 @@ var _core = require("@emotion/core");
|
|
|
9
9
|
|
|
10
10
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
11
11
|
|
|
12
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
13
|
+
|
|
14
|
+
var _constants = require("../../common/constants");
|
|
15
|
+
|
|
12
16
|
var _theme = require("../../theme");
|
|
13
17
|
|
|
14
18
|
var _PrimaryItemsContainer = require("../PrimaryItemsContainer");
|
|
15
19
|
|
|
16
|
-
var _styles = require("./styles");
|
|
17
|
-
|
|
18
20
|
/** @jsx jsx */
|
|
21
|
+
var containerStyles = (0, _core.css)({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
boxSizing: 'border-box',
|
|
24
|
+
height: _constants.HORIZONTAL_GLOBAL_NAV_HEIGHT,
|
|
25
|
+
paddingRight: _constants.gridSize * 1.5,
|
|
26
|
+
paddingLeft: _constants.gridSize * 1.5,
|
|
27
|
+
position: 'relative',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
flexShrink: 0,
|
|
31
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
32
|
+
'[data-theme="light"] &, [data-theme="dark"] &': {
|
|
33
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
34
|
+
borderBottom: "1px solid ".concat("var(--ds-border, #091E4224)"),
|
|
35
|
+
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
36
|
+
'&::after': {
|
|
37
|
+
content: 'none'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
41
|
+
'&::after': {
|
|
42
|
+
height: _constants.gridSize / 2,
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
top: '100%',
|
|
45
|
+
right: 0,
|
|
46
|
+
left: 0,
|
|
47
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
48
|
+
background: "linear-gradient(180deg, ".concat(_colors.N40A, " 0, ").concat(_colors.N40A, " 1px, ").concat(_colors.N30A, " 1px, ").concat((0, _theme.hexToRGBA)( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
49
|
+
_colors.N900, 0), " 4px)"),
|
|
50
|
+
content: '""'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var leftStyles = (0, _core.css)({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
minWidth: 0,
|
|
56
|
+
height: 'inherit',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
flexGrow: 1,
|
|
59
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
60
|
+
'& > *': {
|
|
61
|
+
flexShrink: 0
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var rightStyles = (0, _core.css)({
|
|
65
|
+
display: 'flex',
|
|
66
|
+
alignItems: 'center',
|
|
67
|
+
flexShrink: 0,
|
|
68
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
69
|
+
'& > *': {
|
|
70
|
+
marginRight: _constants.gridSize / 2,
|
|
71
|
+
flexShrink: 0
|
|
72
|
+
}
|
|
73
|
+
});
|
|
19
74
|
var analyticsData = {
|
|
20
75
|
attributes: {
|
|
21
76
|
navigationLayer: 'global'
|
|
@@ -46,11 +101,12 @@ var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
|
46
101
|
}, (0, _core.jsx)(_analyticsNamespacedContext.NavigationAnalyticsContext, {
|
|
47
102
|
data: analyticsData
|
|
48
103
|
}, (0, _core.jsx)("header", {
|
|
49
|
-
|
|
104
|
+
style: theme.mode.navigation,
|
|
105
|
+
css: containerStyles,
|
|
50
106
|
"data-testid": testId && "".concat(testId, "-header"),
|
|
51
107
|
role: "banner"
|
|
52
108
|
}, (0, _core.jsx)("nav", {
|
|
53
|
-
css:
|
|
109
|
+
css: leftStyles,
|
|
54
110
|
"aria-label": label
|
|
55
111
|
}, AppSwitcher && (0, _core.jsx)(AppSwitcher, null), ProductHome && (0, _core.jsx)(ProductHome, null), (0, _core.jsx)(_PrimaryItemsContainer.PrimaryItemsContainer, {
|
|
56
112
|
testId: testId,
|
|
@@ -59,7 +115,7 @@ var AtlassianNavigation = function AtlassianNavigation(props) {
|
|
|
59
115
|
create: create,
|
|
60
116
|
theme: theme
|
|
61
117
|
})), (0, _core.jsx)("div", {
|
|
62
|
-
css:
|
|
118
|
+
css: rightStyles,
|
|
63
119
|
"data-testid": testId && "".concat(testId, "-secondary-actions")
|
|
64
120
|
}, Search && (0, _core.jsx)(Search, null), Notifications && (0, _core.jsx)(Notifications, null), Help && (0, _core.jsx)(Help, null), Settings && (0, _core.jsx)(Settings, null), SignIn && (0, _core.jsx)(SignIn, null), Profile && (0, _core.jsx)(Profile, null)))));
|
|
65
121
|
};
|
|
@@ -7,7 +7,9 @@ exports.NavigationSkeleton = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _core = require("@emotion/core");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
|
+
|
|
12
|
+
var _constants = require("../../common/constants");
|
|
11
13
|
|
|
12
14
|
var _theme = require("../../theme");
|
|
13
15
|
|
|
@@ -21,9 +23,61 @@ var _skeleton4 = require("../Profile/skeleton");
|
|
|
21
23
|
|
|
22
24
|
var _skeleton5 = require("../Search/skeleton");
|
|
23
25
|
|
|
24
|
-
var _styles = require("./styles");
|
|
25
|
-
|
|
26
26
|
/** @jsx jsx */
|
|
27
|
+
var containerStyles = (0, _core.css)({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
height: _constants.HORIZONTAL_GLOBAL_NAV_HEIGHT,
|
|
31
|
+
paddingRight: _constants.gridSize * 1.5,
|
|
32
|
+
paddingLeft: _constants.gridSize * 1.5,
|
|
33
|
+
position: 'relative',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'space-between',
|
|
36
|
+
flexShrink: 0,
|
|
37
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
38
|
+
'[data-theme="light"] &, [data-theme="dark"] &': {
|
|
39
|
+
// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
|
|
40
|
+
borderBottom: "1px solid ".concat("var(--ds-border, #091E4224)"),
|
|
41
|
+
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
42
|
+
'&::after': {
|
|
43
|
+
content: 'none'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
// TODO: (DSP-2087) Remove the below once tokens have launched
|
|
47
|
+
'&::after': {
|
|
48
|
+
height: _constants.gridSize / 2,
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
top: '100%',
|
|
51
|
+
right: 0,
|
|
52
|
+
left: 0,
|
|
53
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
54
|
+
background: "linear-gradient(180deg, ".concat(_colors.N40A, " 0, ").concat(_colors.N40A, " 1px, ").concat(_colors.N30A, " 1px, ").concat((0, _theme.hexToRGBA)( // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
55
|
+
_colors.N900, 0), " 4px)"),
|
|
56
|
+
content: '""'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
var leftStyles = (0, _core.css)({
|
|
60
|
+
display: 'flex',
|
|
61
|
+
minWidth: 0,
|
|
62
|
+
height: 'inherit',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
flexGrow: 1,
|
|
65
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
66
|
+
'& > *': {
|
|
67
|
+
flexShrink: 0
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var rightStyles = (0, _core.css)({
|
|
71
|
+
display: 'flex',
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
flexShrink: 0,
|
|
74
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
75
|
+
'& > *': {
|
|
76
|
+
marginRight: _constants.gridSize / 2,
|
|
77
|
+
flexShrink: 0
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
27
81
|
var NavigationSkeleton = function NavigationSkeleton(_ref) {
|
|
28
82
|
var _ref$primaryItemsCoun = _ref.primaryItemsCount,
|
|
29
83
|
primaryItemsCount = _ref$primaryItemsCoun === void 0 ? 4 : _ref$primaryItemsCoun,
|
|
@@ -34,31 +88,34 @@ var NavigationSkeleton = function NavigationSkeleton(_ref) {
|
|
|
34
88
|
_ref$showSiteName = _ref.showSiteName,
|
|
35
89
|
showSiteName = _ref$showSiteName === void 0 ? false : _ref$showSiteName,
|
|
36
90
|
_ref$shouldShowSearch = _ref.shouldShowSearch,
|
|
37
|
-
shouldShowSearch = _ref$shouldShowSearch === void 0 ? true : _ref$shouldShowSearch
|
|
91
|
+
shouldShowSearch = _ref$shouldShowSearch === void 0 ? true : _ref$shouldShowSearch,
|
|
92
|
+
testId = _ref.testId;
|
|
38
93
|
return (0, _core.jsx)(_theme.ThemeProvider, {
|
|
39
94
|
value: theme
|
|
40
95
|
}, (0, _core.jsx)("div", {
|
|
41
|
-
|
|
96
|
+
style: theme.mode.navigation,
|
|
97
|
+
css: containerStyles,
|
|
98
|
+
"data-testid": testId
|
|
42
99
|
}, (0, _core.jsx)("div", {
|
|
43
|
-
css:
|
|
100
|
+
css: leftStyles
|
|
44
101
|
}, (0, _core.jsx)(_skeleton.IconButtonSkeleton, {
|
|
45
102
|
marginLeft: 0,
|
|
46
103
|
marginRight: 5,
|
|
47
|
-
size:
|
|
104
|
+
size: _constants.gridSize * 3.25
|
|
48
105
|
}), (0, _core.jsx)(_skeleton3.ProductHomeSkeleton, {
|
|
49
106
|
showSiteName: showSiteName
|
|
50
107
|
}), (0, _core.jsx)(_skeleton2.PrimaryItemsContainerSkeleton, {
|
|
51
108
|
count: primaryItemsCount
|
|
52
109
|
})), (0, _core.jsx)("div", {
|
|
53
|
-
css:
|
|
110
|
+
css: rightStyles
|
|
54
111
|
}, shouldShowSearch && (0, _core.jsx)(_skeleton5.SearchSkeleton, null), Array.from({
|
|
55
112
|
length: secondaryItemsCount
|
|
56
113
|
}, function (_, index) {
|
|
57
114
|
return (0, _core.jsx)(_skeleton.IconButtonSkeleton, {
|
|
58
115
|
key: index,
|
|
59
116
|
marginLeft: 0,
|
|
60
|
-
marginRight:
|
|
61
|
-
size:
|
|
117
|
+
marginRight: _constants.gridSize / 2,
|
|
118
|
+
size: _constants.gridSize * 3.25
|
|
62
119
|
});
|
|
63
120
|
}), (0, _core.jsx)(_skeleton4.ProfileSkeleton, null))));
|
|
64
121
|
};
|
|
@@ -7,17 +7,25 @@ exports.BadgeContainer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _core = require("@emotion/core");
|
|
9
9
|
|
|
10
|
-
var _styles = require("./styles");
|
|
11
|
-
|
|
12
10
|
/** @jsx jsx */
|
|
11
|
+
var badgeContainerStyles = (0, _core.css)({
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
top: '-4px',
|
|
14
|
+
right: '-2px',
|
|
15
|
+
pointerEvents: 'none'
|
|
16
|
+
});
|
|
17
|
+
var containerStyles = (0, _core.css)({
|
|
18
|
+
position: 'relative'
|
|
19
|
+
});
|
|
20
|
+
|
|
13
21
|
var BadgeContainer = function BadgeContainer(props) {
|
|
14
22
|
var badgeId = props.id,
|
|
15
23
|
Badge = props.badge,
|
|
16
24
|
children = props.children;
|
|
17
25
|
return (0, _core.jsx)("div", {
|
|
18
|
-
css:
|
|
26
|
+
css: containerStyles
|
|
19
27
|
}, children, (0, _core.jsx)("div", {
|
|
20
|
-
css:
|
|
28
|
+
css: badgeContainerStyles,
|
|
21
29
|
id: badgeId,
|
|
22
30
|
"aria-hidden": true
|
|
23
31
|
}, (0, _core.jsx)(Badge, null)));
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.Create = void 0;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
10
12
|
var _react = require("react");
|
|
11
13
|
|
|
12
14
|
var _core = require("@emotion/core");
|
|
@@ -15,10 +17,10 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
|
|
|
15
17
|
|
|
16
18
|
var _add = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/add"));
|
|
17
19
|
|
|
18
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
19
|
-
|
|
20
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
21
|
|
|
22
|
+
var _constants = require("../../common/constants");
|
|
23
|
+
|
|
22
24
|
var _theme = require("../../theme");
|
|
23
25
|
|
|
24
26
|
var _IconButton = require("../IconButton");
|
|
@@ -26,7 +28,22 @@ var _IconButton = require("../IconButton");
|
|
|
26
28
|
var _styles = require("./styles");
|
|
27
29
|
|
|
28
30
|
/** @jsx jsx */
|
|
29
|
-
var
|
|
31
|
+
var wrapperStyles = (0, _core.css)({
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
35
|
+
'& [data-hide-on-smallscreens]': (0, _defineProperty2.default)({}, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
|
|
36
|
+
display: 'none !important'
|
|
37
|
+
}),
|
|
38
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
39
|
+
'& [data-hide-on-largescreens]': (0, _defineProperty2.default)({}, "@media (min-width: ".concat(_constants.CREATE_BREAKPOINT, "px)"), {
|
|
40
|
+
display: 'none !important'
|
|
41
|
+
}),
|
|
42
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
43
|
+
'&&': {
|
|
44
|
+
marginLeft: _constants.gridSize * 1.5
|
|
45
|
+
}
|
|
46
|
+
});
|
|
30
47
|
|
|
31
48
|
var TooltipSwitch = function TooltipSwitch(_ref) {
|
|
32
49
|
var buttonTooltip = _ref.buttonTooltip,
|
|
@@ -46,15 +63,7 @@ var Create = function Create(_ref2) {
|
|
|
46
63
|
testId = _ref2.testId;
|
|
47
64
|
var theme = (0, _theme.useTheme)();
|
|
48
65
|
return (0, _core.jsx)("div", {
|
|
49
|
-
css:
|
|
50
|
-
display: 'flex',
|
|
51
|
-
alignItems: 'center',
|
|
52
|
-
'&&': {
|
|
53
|
-
marginLeft: grid * 1.5
|
|
54
|
-
},
|
|
55
|
-
'& [data-hide-on-smallscreens]': _styles.createButtonCSS,
|
|
56
|
-
'& [data-hide-on-largescreens]': _styles.createIconCSS
|
|
57
|
-
},
|
|
66
|
+
css: wrapperStyles,
|
|
58
67
|
"data-testid": "create-button-wrapper"
|
|
59
68
|
}, (0, _core.jsx)(TooltipSwitch, {
|
|
60
69
|
buttonTooltip: buttonTooltip
|
|
@@ -1,30 +1,45 @@
|
|
|
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.CreateSkeleton = 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 buttonHeight = _constants.gridSize * 4;
|
|
24
|
+
var skeletonStyles = (0, _core.css)({
|
|
25
|
+
width: 68,
|
|
26
|
+
height: buttonHeight,
|
|
27
|
+
marginLeft: 12,
|
|
28
|
+
borderRadius: 3,
|
|
29
|
+
opacity: 0.15
|
|
30
|
+
});
|
|
31
|
+
var mobileStyles = (0, _core.css)((0, _defineProperty2.default)({}, "@media (max-width: ".concat(_constants.CREATE_BREAKPOINT - 1, "px)"), {
|
|
32
|
+
display: 'none !important'
|
|
33
|
+
}));
|
|
34
|
+
|
|
21
35
|
var CreateSkeleton = function CreateSkeleton() {
|
|
22
36
|
var theme = (0, _theme.useTheme)();
|
|
23
37
|
return (0, _core.jsx)(_react.Fragment, null, (0, _core.jsx)("div", {
|
|
24
|
-
|
|
38
|
+
style: theme.mode.skeleton,
|
|
39
|
+
css: [skeletonStyles, mobileStyles]
|
|
25
40
|
}), (0, _core.jsx)(_skeleton.IconButtonSkeleton, {
|
|
26
|
-
css:
|
|
27
|
-
size:
|
|
41
|
+
css: mobileStyles,
|
|
42
|
+
size: _constants.gridSize * 3.25
|
|
28
43
|
}));
|
|
29
44
|
};
|
|
30
45
|
|
|
@@ -5,38 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.getCreateButtonTheme =
|
|
8
|
+
exports.getCreateButtonTheme = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
13
|
-
|
|
14
|
-
var _styles = require("../../common/styles");
|
|
15
|
-
|
|
16
12
|
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
13
|
|
|
18
14
|
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
15
|
|
|
20
|
-
var gridSize = (0, _constants.gridSize)();
|
|
21
|
-
var buttonHeight = gridSize * 4;
|
|
22
|
-
var createButtonCSS = _styles.actionSectionDesktopCSS;
|
|
23
|
-
exports.createButtonCSS = createButtonCSS;
|
|
24
|
-
|
|
25
|
-
var createButtonSkeletonCSS = function createButtonSkeletonCSS(theme) {
|
|
26
|
-
return _objectSpread(_objectSpread({
|
|
27
|
-
height: "".concat(buttonHeight, "px"),
|
|
28
|
-
width: '68px',
|
|
29
|
-
borderRadius: '3px',
|
|
30
|
-
marginLeft: 12
|
|
31
|
-
}, createButtonCSS), (0, _styles.skeletonCSS)(theme));
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.createButtonSkeletonCSS = createButtonSkeletonCSS;
|
|
35
|
-
var createIconCSS = _styles.actionSectionMobileCSS;
|
|
36
|
-
exports.createIconCSS = createIconCSS;
|
|
37
|
-
var createIconSkeletonCSS = createIconCSS;
|
|
38
|
-
exports.createIconSkeletonCSS = createIconSkeletonCSS;
|
|
39
|
-
|
|
40
16
|
var getCreateButtonTheme = function getCreateButtonTheme(_ref) {
|
|
41
17
|
var create = _ref.mode.create;
|
|
42
18
|
return function (current, props) {
|
|
@@ -1,22 +1,48 @@
|
|
|
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.IconButtonSkeleton = void 0;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
8
12
|
var _core = require("@emotion/core");
|
|
9
13
|
|
|
14
|
+
var _constants = require("../../common/constants");
|
|
15
|
+
|
|
10
16
|
var _theme = require("../../theme");
|
|
11
17
|
|
|
12
|
-
var
|
|
18
|
+
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; }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
var
|
|
22
|
+
var buttonHeight = _constants.gridSize * 4;
|
|
23
|
+
var skeletonStyles = (0, _core.css)({
|
|
24
|
+
borderRadius: '50%',
|
|
25
|
+
opacity: 0.15
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
var IconButtonSkeleton = function IconButtonSkeleton(_ref) {
|
|
29
|
+
var className = _ref.className,
|
|
30
|
+
marginLeft = _ref.marginLeft,
|
|
31
|
+
marginRight = _ref.marginRight,
|
|
32
|
+
size = _ref.size;
|
|
16
33
|
var theme = (0, _theme.useTheme)();
|
|
34
|
+
|
|
35
|
+
var dynamicStyles = _objectSpread({
|
|
36
|
+
marginLeft: typeof marginLeft === 'number' ? marginLeft : _constants.gridSize / 2,
|
|
37
|
+
marginRight: typeof marginRight === 'number' ? marginRight : 0,
|
|
38
|
+
width: typeof size === 'number' ? size : buttonHeight,
|
|
39
|
+
height: typeof size === 'number' ? size : buttonHeight
|
|
40
|
+
}, theme.mode.skeleton);
|
|
41
|
+
|
|
17
42
|
return (0, _core.jsx)("div", {
|
|
18
|
-
className:
|
|
19
|
-
|
|
43
|
+
className: className,
|
|
44
|
+
style: dynamicStyles,
|
|
45
|
+
css: skeletonStyles
|
|
20
46
|
});
|
|
21
47
|
};
|
|
22
48
|
|
|
@@ -5,28 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getIconButtonTheme = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
13
|
-
|
|
14
|
-
var _styles = require("../../common/styles");
|
|
15
|
-
|
|
16
12
|
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
13
|
|
|
18
14
|
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
15
|
|
|
20
|
-
var gridSize = (0, _constants.gridSize)();
|
|
21
|
-
var margin = {
|
|
22
|
-
left: gridSize / 2
|
|
23
|
-
};
|
|
24
|
-
exports.margin = margin;
|
|
25
|
-
var padding = {
|
|
26
|
-
all: gridSize / 2
|
|
27
|
-
};
|
|
28
|
-
exports.padding = padding;
|
|
29
|
-
|
|
30
16
|
var getIconButtonTheme = function getIconButtonTheme(_ref) {
|
|
31
17
|
var iconButton = _ref.mode.iconButton;
|
|
32
18
|
return function (current, props) {
|
|
@@ -61,20 +47,4 @@ var getIconButtonTheme = function getIconButtonTheme(_ref) {
|
|
|
61
47
|
};
|
|
62
48
|
};
|
|
63
49
|
|
|
64
|
-
exports.getIconButtonTheme = getIconButtonTheme;
|
|
65
|
-
var buttonHeight = gridSize * 4;
|
|
66
|
-
|
|
67
|
-
var iconButtonSkeletonCSS = function iconButtonSkeletonCSS(theme, _ref2) {
|
|
68
|
-
var marginLeft = _ref2.marginLeft,
|
|
69
|
-
marginRight = _ref2.marginRight,
|
|
70
|
-
size = _ref2.size;
|
|
71
|
-
return _objectSpread({
|
|
72
|
-
borderRadius: '50%',
|
|
73
|
-
marginLeft: typeof marginLeft === 'number' ? marginLeft : margin.left,
|
|
74
|
-
marginRight: typeof marginRight === 'number' ? marginRight : 0,
|
|
75
|
-
width: typeof size === 'number' ? size : buttonHeight,
|
|
76
|
-
height: typeof size === 'number' ? size : buttonHeight
|
|
77
|
-
}, (0, _styles.skeletonCSS)(theme));
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
exports.iconButtonSkeletonCSS = iconButtonSkeletonCSS;
|
|
50
|
+
exports.getIconButtonTheme = getIconButtonTheme;
|
|
@@ -9,6 +9,8 @@ exports.default = exports.PrimaryButton = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
12
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
15
|
|
|
14
16
|
var _react = require("react");
|
|
@@ -19,12 +21,43 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
|
|
|
19
21
|
|
|
20
22
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
23
|
|
|
24
|
+
var _constants = require("../../common/constants");
|
|
25
|
+
|
|
22
26
|
var _theme = require("../../theme");
|
|
23
27
|
|
|
24
28
|
var _styles = require("./styles");
|
|
25
29
|
|
|
26
30
|
var _excluded = ["children", "testId", "tooltip", "isSelected", "isHighlighted"];
|
|
31
|
+
var VAR_BUTTON_SELECTED_COLOR = '--button-selected-color';
|
|
32
|
+
var VAR_BUTTON_SELECTED_BORDER_COLOR = '--button-selected-border-color';
|
|
33
|
+
var buttonBaseStyles = (0, _core.css)({
|
|
34
|
+
display: 'flex',
|
|
35
|
+
height: '100%',
|
|
36
|
+
position: 'relative',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
flexDirection: 'column'
|
|
40
|
+
});
|
|
41
|
+
var buttonHighlightedStyles = (0, _core.css)({
|
|
42
|
+
// eslint-disable-next-line @repo/internal/styles/no-nested-styles
|
|
43
|
+
'&& > *': {
|
|
44
|
+
color: "var(".concat(VAR_BUTTON_SELECTED_COLOR, ")")
|
|
45
|
+
},
|
|
46
|
+
'&:after': {
|
|
47
|
+
height: 3,
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
right: _constants.gridSize / 2,
|
|
50
|
+
bottom: 0,
|
|
51
|
+
left: _constants.gridSize / 2,
|
|
52
|
+
backgroundColor: "var(".concat(VAR_BUTTON_SELECTED_BORDER_COLOR, ")"),
|
|
53
|
+
borderTopLeftRadius: 1,
|
|
54
|
+
borderTopRightRadius: 1,
|
|
55
|
+
content: '""'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
27
58
|
var PrimaryButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
59
|
+
var _ref;
|
|
60
|
+
|
|
28
61
|
var children = props.children,
|
|
29
62
|
testId = props.testId,
|
|
30
63
|
tooltip = props.tooltip,
|
|
@@ -33,7 +66,8 @@ var PrimaryButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
33
66
|
buttonProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
34
67
|
var theme = (0, _theme.useTheme)();
|
|
35
68
|
var button = (0, _core.jsx)("div", {
|
|
36
|
-
|
|
69
|
+
style: (_ref = {}, (0, _defineProperty2.default)(_ref, VAR_BUTTON_SELECTED_COLOR, theme.mode.primaryButton.selected.color), (0, _defineProperty2.default)(_ref, VAR_BUTTON_SELECTED_BORDER_COLOR, theme.mode.primaryButton.selected.borderColor), _ref),
|
|
70
|
+
css: [buttonBaseStyles, isHighlighted && buttonHighlightedStyles]
|
|
37
71
|
}, (0, _core.jsx)(_customThemeButton.default, (0, _extends2.default)({
|
|
38
72
|
appearance: "primary",
|
|
39
73
|
testId: testId,
|
|
@@ -11,16 +11,26 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
|
|
12
12
|
var _core = require("@emotion/core");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _constants = require("../../common/constants");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _theme = require("../../theme");
|
|
17
17
|
|
|
18
18
|
/** @jsx jsx */
|
|
19
|
+
var paddingAll = _constants.gridSize / 2;
|
|
20
|
+
var skeletonStyles = (0, _core.css)({
|
|
21
|
+
display: 'inline-flex',
|
|
22
|
+
width: '68px',
|
|
23
|
+
height: "".concat(_constants.buttonHeight - paddingAll * 2.5, "px"),
|
|
24
|
+
borderRadius: "".concat(_constants.gridSize / 2, "px"),
|
|
25
|
+
opacity: 0.15
|
|
26
|
+
});
|
|
27
|
+
|
|
19
28
|
var PrimaryButtonSkeleton = function PrimaryButtonSkeleton(props) {
|
|
20
29
|
var theme = (0, _theme.useTheme)();
|
|
21
|
-
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
return (0, _core.jsx)("div", (0, _extends2.default)({
|
|
31
|
+
style: theme.mode.skeleton,
|
|
32
|
+
css: skeletonStyles
|
|
33
|
+
}, props));
|
|
24
34
|
};
|
|
25
35
|
|
|
26
36
|
exports.PrimaryButtonSkeleton = PrimaryButtonSkeleton;
|